PageSourceSearch

https://demo.mkup.orbo.ai/assets/orboAiMakeupSdk.js

js orbo.ai collected 2026-10-01 11:58:20 UTC 2,295,535 bytes, 2 lines download raw bytes

vendor: 3,326 bytes, lines 1-2
1/*! For license information please see orboAiMakeupSdk.js.LICENSE.txt */
2(()=>{var __webpack_modules__={31:function(e,t,n){var r;!function(e,o){function i(e){var t=this,n="";t.next=function(){var e=t.x^t.x>>>2;return t.x=t.y,t.y=t.z,t.z=t.w,t.w=t.v,(t.d=t.d+362437|0)+(t.v=t.v^t.v<<4^e^e<<1)|0},t.x=0,t.y=0,t.z=0,t.w=0,t.v=0,e===(0|e)?t.x=e:n+=e;for(var r=0;r<n.length+64;r++)t.x^=0|n.charCodeAt(r),r==n.length&&(t.d=t.x<<10^t.x>>>4),t.next()}function a(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t.v=e.v,t.d=e.d,t}function s(e,t){var n=new i(e),r=t&&t.state,o=function(){return(n.next()>>>0)/4294967296};return o.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},o.int32=n.next,o.quick=o,r&&("object"==typeof r&&a(r,n),o.state=function(){return a(n,{})}),o}o&&o.exports?o.exports=s:n.amdD&&n.amdO?void 0===(r=function(){return s}.call(t,n,t,o))||(o.exports=r):this.xorwow=s}(0,e=n.nmd(e),n.amdD)},67:function(e,t,n){var r;!function(e,o){function i(e){var t=this;t.next=function(){var e,n,r=t.x,o=t.i;return e=r[o],n=(e^=e>>>7)^e<<24,n^=(e=r[o+1&7])^e>>>10,n^=(e=r[o+3&7])^e>>>3,n^=(e=r[o+4&7])^e<<7,e=r[o+7&7],n^=(e^=e<<13)^e<<9,r[o]=n,t.i=o+1&7,n},function(e,t){var n,r=[];if(t===(0|t))r[0]=t;else for(t=""+t,n=0;n<t.length;++n)r[7&n]=r[7&n]<<15^t.charCodeAt(n)+r[n+1&7]<<13;for(;r.length<8;)r.push(0);for(n=0;n<8&&0===r[n];++n);for(8==n?r[7]=-1:r[n],e.x=r,e.i=0,n=256;n>0;--n)e.next()}(t,e)}function a(e,t){return t.x=e.x.slice(),t.i=e.i,t}function s(e,t){null==e&&(e=+new Date);var n=new i(e),r=t&&t.state,o=function(){return(n.next()>>>0)/4294967296};return o.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},o.int32=n.next,o.quick=o,r&&(r.x&&a(r,n),o.state=function(){return a(n,{})}),o}o&&o.exports?o.exports=s:n.amdD&&n.amdO?void 0===(r=function(){return s}.call(t,n,t,o))||(o.exports=r):this.xorshift7=s}(0,e=n.nmd(e),n.amdD)},74:()=>{},78:()=>{},108:()=>{},135:e=>{e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},180:function(e,t,n){var r;!function(e,o){function i(e){var t,n=this,r=(t=4022871197,function(e){e=e.toString();for(var n=0;n<e.length;n++){var r=.02519603282416938*(t+=e.charCodeAt(n));r-=t=r>>>0,t=(r*=t)>>>0,t+=4294967296*(r-=t)}return 2.3283064365386963e-10*(t>>>0)});n.next=function(){var e=2091639*n.s0+2.3283064365386963e-10*n.c;return n.s0=n.s1,n.s1=n.s2,n.s2=e-(n.c=0|e)},n.c=1,n.s0=r(" "),n.s1=r(" "),n.s2=r(" "),n.s0-=r(e),n.s0<0&&(n.s0+=1),n.s1-=r(e),n.s1<0&&(n.s1+=1),n.s2-=r(e),n.s2<0&&(n.s2+=1),r=null}function a(e,t){return t.c=e.c,t.s0=e.s0,t.s1=e.s1,t.s2=e.s2,t}function s(e,t){var n=new i(e),r=t&&t.state,o=n.next;return o.int32=function(){return 4294967296*n.next()|0},o.double=function(){return o()+11102230246251565e-32*(2097152*o()|0)},o.quick=o,r&&("object"==typeof r&&a(r,n),o.state=function(){return a(n,{})}),o}o&&o.exports?o.exports=s:n.amdD&&n.amdO?void 0===(r=function(){return s}.call(t,n,t,o))||(o.exports=r):this.alea=s}(0,e=n.nmd(e),n.amdD)},181:function(e,t,n){var r;!function(e,o){function i(e){var t=this,n="";t.x=0,t.y=0,t.z=0,t.w=0,t.next=function(){var e=t.x^t.x<<11;return t.x=t.y,t.y=t.z,t.z=t.w,t.w^=t.w>>>19^e^e>>>8},e===(0|e)?t.x=e:n+=e;for(var r=0;r<n.length+64;
2r++)t.x^=0|n.charCodeAt(r),t.next()}function a(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t}function s(e,t){var n=new i(e),r=t&&t.state,o=function(){return(n.next()>>>0)/4294967296};return o.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},o.int32=n.next,o.quick=o,r&&("object"==typeof r&&a(r,n),o.state=function(){return a(n,{})}),o}o&&o.exports?o.exports=s:n.amdD&&n.amdO?void 0===(r=function(){return s}.call(t,n,t,o))||(o.exports=r):this.xor128=s}(0,e=n.nmd(e),n.amdD)},234:()=>{},244:()=>{},281:()=>{},391:(e,t,n)=>{var r=n(180),o=n(181),i=n(31),a=n(67),s=n(833),l=n(717),u=n(801);u.alea=r,u.xor128=o,u.xorwow=i,u.xorshift7=a,u.xor4096=s,u.tychei=l,e.exports=u},417:(e,t,n)=>{var r,o=(r=(r="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(e){function t(){return A.buffer!=D&&K(A.buffer),O}function o(){return A.buffer!=D&&K(A.buffer),R}function i(){return A.buffer!=D&&K(A.buffer),B}function a(){return A.buffer!=D&&K(A.buffer),P}function s(){return A.buffer!=D&&K(A.buffer),L}var l,u,p=void 0!==(e=e||{})?e:{};p.ready=new Promise(function(e,t){l=e,u=t});var c,d={};for(c in p)p.hasOwnProperty(c)&&(d[c]=p[c]);var h,f,g,m,y=[],b=function(e,t){throw t};h="object"==typeof window,f="function"==typeof importScripts,g="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,m=!h&&!g&&!f;var $=p.ENVIRONMENT_IS_PTHREAD||!1;$&&(D=p.buffer);var _,w,x,S,v,k="";function E(e){return p.locateFile?p.locateFile(e,k):k+e}if(g){var I;k=f?n(281).dirname(k)+"/":"//",_=function(e,t){return S||(S=n(893)),v||(v=n(281)),e=v.normalize(e),S.readFileSync(e,t?null:"utf8")},x=function(e){var t=_(e,!0);return t.buffer||(t=new Uint8Array(t)),U(t.buffer),t},process.argv.length>1&&process.argv[1].replace(/\\/g,"/"),y=process.argv.slice(2),process.on("uncaughtException",function(e){if(!(e instanceof dt))throw e}),process.on("unhandledRejection",le),b=function(e){process.exit(e)},p.inspect=function(){return"[Emscripten Module object]"};try{I=n(556)}catch(e){throw console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?'),e}n.g.Worker=I.Worker}else m?("undefined"!=typeof read&&(_=function(e){return read(e)}),x=function(e){var t;return"function"==typeof readbuffer?new Uint8Array(readbuffer(e)):(U("object"==typeof(t=read(e,"binary"))),t)},"undefined"!=typeof scriptArgs?y=scriptArgs:void 0!==arguments&&(y=arguments),"function"==typeof quit&&(b=function(e){quit(e)}),"undefined"!=typeof print&&("undefined"==typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!=typeof printErr?printErr:print)):(h||f)&&(f?k=self.location.href:"undefined"!=typeof document&&document.currentScript&&(k=document.currentScript.src),void 0!==r&&r&&(k=r),k=0!==k.indexOf("blob:")?k.substr(0,k.lastIndexOf("/")+1):"",g?(_=function(e,t){return S||(S=n(893)),v||(v=n(281)),e=v.normalize(e),S.readFileSync(e,t?null:"utf8")},x=function(e){var t=_(e,!0);return t.buffer||(t=new Uint8Array(t)),U(t.buffer),t}):(_=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},f&&(x=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),w=function(e,t,n){var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=function(){200==r.status||0==r.status&&r.response?t(r.response):n()},r.onerror=n,r.send(null)}));g&&"undefined"==typeof performance&&(n.g.performance=n(244).performance);var T,F=p.print||console.log.bind(console),N=p.printErr||console.warn.bind(console);for(c in d)d.hasOwnProperty(c)&&(p[c]=d[c]);function j(e){j.shown||(j.shown={}),j.shown[e]||(j.shown[e]=1,N(e))}d=null,p.arguments&&(y=p.arguments),p.thisProgram&&p.thisProgram,p.quit&&(b=p.quit),Atomics.load,Atomics.store,Atomics.compareExchange,p.wasmBinary&&(T=p.wasmBinary);var A,C,M=p.noExitRuntime||!0;"object"!=typeof WebAssembly&&le("no native wasm support detected");var D,O,R,B,P,L,W=!1;function U(e,t){e||le("Assertion failed: "+t)}function z(e){var t=p["_"+e];return U(t,"Cannot call unknown function "+e+", make sure it is exported"),t}
2function V(e,t,n){for(var r=t+n,o="";!(t>=r);){var i=e[t++];if(!i)return o;if(128&i){var a=63&e[t++];if(192!=(224&i)){var s=63&e[t++];if((i=224==(240&i)?(15&i)<<12|a<<6|s:(7&i)<<18|a<<12|s<<6|63&e[t++])<65536)o+=String.fromCharCode(i);else{var l=i-65536;o+=String.fromCharCode(55296|l>>10,56320|1023&l)}}else o+=String.fromCharCode((31&i)<<6|a)}else o+=String.fromCharCode(i)}return o}function H(e,t){return e?V(o(),e,t):""}function G(e,t,n){return function(e,t,n,r){if(!(r>0))return 0;for(var o=n,i=n+r-1,a=0;a<e.length;++a){var s=e.charCodeAt(a);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++a)),s<=127){if(n>=i)break;t[n++]=s}else if(s<=2047){if(n+1>=i)break;t[n++]=192|s>>6,t[n++]=128|63&s}else if(s<=65535){if(n+2>=i)break;t[n++]=224|s>>12,t[n++]=128|s>>6&63,t[n++]=128|63&s}else{if(n+3>=i)break;t[n++]=240|s>>18,t[n++]=128|s>>12&63,t[n++]=128|s>>6&63,t[n++]=128|63&s}}return t[n]=0,n-o}(e,o(),t,n)}function q(e,t){return e%t>0&&(e+=t-e%t),e}function K(e){D=e,p.HEAP8=O=new Int8Array(e),p.HEAP16=new Int16Array(e),p.HEAP32=B=new Int32Array(e),p.HEAPU8=R=new Uint8Array(e),p.HEAPU16=new Uint16Array(e),p.HEAPU32=P=new Uint32Array(e),p.HEAPF32=new Float32Array(e),p.HEAPF64=L=new Float64Array(e)}var X,Y=p.INITIAL_MEMORY||16777216;if($)A=p.wasmMemory,D=p.buffer;else if(p.wasmMemory)A=p.wasmMemory;else if(!((A=new WebAssembly.Memory({initial:Y/65536,maximum:32768,shared:!0})).buffer instanceof SharedArrayBuffer))throw N("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 
2need to set a flag"),g&&console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)"),Error("bad memory");A&&(D=A.buffer),Y=D.byteLength,K(D);var J=[],Z=[],Q=[],ee=[],te=[];function ne(){$||ge(Z)}function re(e){J.unshift(e)}function oe(e){te.unshift(e)}$||Z.push({func:function(){Ve()}});var ie=0,ae=null,se=null;function le(e){p.onAbort&&p.onAbort(e),$&&console.error("Pthread aborting at "+(new Error).stack),N(e+=""),W=!0,e="abort("+e+"). Build with -s ASSERTIONS=1 for more info.";var t=new WebAssembly.RuntimeError(e);throw u(t),t}function ue(e,t){return String.prototype.startsWith?e.startsWith(t):0===e.indexOf(t)}function pe(e){return ue(e,"data:application/octet-stream;base64,")}function ce(e){return ue(e,"file://")}p.preloadedImages={},p.preloadedAudios={};var de="tfjs-backend-wasm-threaded-simd.wasm";function he(e){try{if(e==de&&T)return new Uint8Array(T);if(x)return x(e);throw"both async and sync fetching of the wasm failed"}catch(e){le(e)}}pe(de)||(de=E(de));var fe={10520:function(){throw"Canceled!"},10538:function(e,t){setTimeout(function(){et(e,t)},0)}};function ge(e){for(;e.length>0;){var t=e.shift();if("function"!=typeof t){var n=t.func;"number"==typeof n?void 0===t.arg?X.get(n)():X.get(n)(t.arg):n(void 0===t.arg?null:t.arg)}else t(p)}}function me(e,n){if(e<=0||e>t().length||!0&e||n<0)return-28;if(0==n)return 0;n>=2147483647&&(n=1/0);var r=Atomics.load(i(),ct>>2),o=0;if(r==e&&Atomics.compareExchange(i(),ct>>2,r,0)==r&&(o=1,--n<=0))return 1;var a=Atomics.notify(i(),e>>2,n);if(a>=0)return a+o;throw"Atomics.notify returned an unexpected value "+a}function ye(e){if($)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!e)throw"Internal Error! Null pthread_ptr in cleanupThread!";var t=$e.pthreads[e];if(t){i()[e+12>>2]=0;var n=t.worker;$e.returnWorkerToPool(n)}}p._emscripten_futex_wake=me;var be,$e={unusedWorkers:[],runningWorkers:[],initMainThreadBlock:function(){for(var e=0;e<8;++e)$e.allocateUnusedWorker()},initRuntime:function(){for(var e=He(228),t=0;t<57;++t)a()[e/4+t]=0;i()[e+12>>2]=e;var n=e+152;i()[n>>2]=n;var r=He(512);for(t=0;t<128;++t)a()[r/4+t]=0;Atomics.store(a(),e+100>>2,r),Atomics.store(a(),e+40>>2,e),ot(e,!f,1),Ze(e)},initWorker:function(){},pthreads:{},threadExitHandlers:[],setThreadStatus:function(){},runExitHandlers:function(){for(;$e.threadExitHandlers.length>0;)$e.threadExitHandlers.pop()();$&&Xe()&&Ye()},runExitHandlersAndDeinitThread:function(e,t){Atomics.store(a(),e+56>>2,1),Atomics.store(a(),e+60>>2,0),$e.runExitHandlers(),Atomics.store(a(),e+4>>
22,t),Atomics.store(a(),e+0>>2,1),me(e+0,2147483647),ot(0,0,0)},threadExit:function(e){var t=Xe();t&&($e.runExitHandlersAndDeinitThread(t,e),$&&postMessage({cmd:"exit"}))},threadCancel:function(){$e.runExitHandlersAndDeinitThread(Xe(),-1),postMessage({cmd:"cancelDone"})},terminateAllThreads:function(){for(var e in $e.pthreads)(r=$e.pthreads[e])&&r.worker&&$e.returnWorkerToPool(r.worker);$e.pthreads={};for(var t=0;t<$e.unusedWorkers.length;++t)(n=$e.unusedWorkers[t]).terminate();for($e.unusedWorkers=[],t=0;t<$e.runningWorkers.length;++t){var n,r=(n=$e.runningWorkers[t]).pthread;$e.freeThreadData(r),n.terminate()}$e.runningWorkers=[]},freeThreadData:function(e){if(e){if(e.threadInfoStruct){var t=i()[e.threadInfoStruct+100>>2];i()[e.threadInfoStruct+100>>2]=0,Ge(t),Ge(e.threadInfoStruct)}e.threadInfoStruct=0,e.allocatedOwnStack&&e.stackBase&&Ge(e.stackBase),e.stackBase=0,e.worker&&(e.worker.pthread=null)}},returnWorkerToPool:function(e){$e.runWithoutMainThreadQueuedCalls(function(){delete $e.pthreads[e.pthread.threadInfoStruct],$e.unusedWorkers.push(e),$e.runningWorkers.splice($e.runningWorkers.indexOf(e),1),$e.freeThreadData(e.pthread),e.pthread=void 0})},runWithoutMainThreadQueuedCalls:function(e){i()[pt>>2]=0;try{e()}finally{i()[pt>>2]=1}},receiveObjectTransfer:function(e){},loadWasmModuleToWorker:function(e,t){e.onmessage=function(n){var r=n.data,o=r.cmd;if(e.pthread&&($e.currentProxiedOperationCallerThread=e.pthread.threadInfoStruct),r.targetThread&&r.targetThread!=Xe()){var s=$e.pthreads[r.targetThread];return s?s.worker.postMessage(n.data,r.transferList):console.error('Internal error! Worker sent a message "'+o+'" to target pthread '+r.targetThread+", but that thread no longer exists!"),void($e.currentProxiedOperationCallerThread=void 0)}if("processQueuedMainThreadWork"===o)Je();else if("spawnThread"===o)Re(n.data);else if("cleanupThread"===o)ye(r.thread);else if("killThread"===o)!function(e){if($)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!e)throw"Internal Error! Null pthread_ptr in killThread!";i()[e+12>>2]=0;var t=$e.pthreads[e];t.worker.terminate(),$e.freeThreadData(t),$e.runningWorkers.splice($e.runningWorkers.indexOf(t.worker),1),t.worker.pthread=void 0}(r.thread);else if("cancelThread"===o)!function(e){if($)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!e)throw"Internal Error! Null pthread_ptr in cancelThread!";$e.pthreads[e].worker.postMessage({cmd:"cancel"})}(r.thread);else if("loaded"===o)e.loaded=!0,t&&t(e),e.runPthread&&(e.runPthread(),delete e.runPthread);else if("print"===o)F("Thread "+r.threadId+": "+r.text);else if("printErr"===o)N("Thread "+r.threadId+": "+r.text);else if("alert"===o)alert("Thread "+r.threadId+": "+r.text);else if("exit"===o)e.pthread&&Atomics.load(a(),e.pthread.threadInfoStruct+64>>2)&&$e.returnWorkerToPool(e);else if("exitProcess"===o)try{!function(e){if($)throw postMessage({cmd:"exitProcess",returnCode:e}),new dt(e);M||($e.terminateAllThreads(),p.onExit&&p.onExit(e),W=!0),b(e,new dt(e))}(r.returnCode)}catch(n){if(n instanceof dt)return;throw n}else"cancelDone"===o?$e.returnWorkerToPool(e):"objectTransfer"===o?$e.receiveObjectTransfer(n.data):"setimmediate"===n.data.target?e.postMessage(n.data):N("worker sent an unknown command "+o);$e.currentProxiedOperationCallerThread=void 0},e.onerror=function(e){N("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)},g&&(e.on("message",function(t){e.onmessage({data:t})}),e.on("error",function(t){e.onerror(t)}),e.on("exit",function(e){})),e.postMessage({cmd:"load",urlOrBlob:p.mainScriptUrlOrBlob||r,wasmMemory:A,wasmModule:C})},allocateUnusedWorker:function(){var e=E("tfjs-backend-wasm-threaded-simd.worker.js");$e.unusedWorkers.push(new Worker(e))},getNewWorker:function(){return 0==$e.unusedWorkers.length&&($e.allocateUnusedWorker(),$e.loadWasmModuleToWorker($e.unusedWorkers[0])),$e.unusedWorkers.length>0?$e.unusedWorkers.pop():null},busySpinWait:function(e){for(var t=performance.now()+e;performance.now()<t;);}};function _e(e,n,r){if(e<=0||e>t().length||!0&e)return-28;if(h){if(Atomics.load(i(),e>>2)!=n)return-6;var o=performance.now(),a=o+r;for(Atomics.exchange(i(),ct>>2,e);;){if((o=performance.now())>a)return Atomics.exchange(i(),ct>>2,0),-73;if(0==Atomics.exchange(i(),ct>>2,0))break;if(Je(),Atomics.load(i(),e>>2)!=n)return-6;Atomics.exchange(i(),ct>>2,e)}return 0}var s=Atomics.wait(i(),e>>2,n,r);if("timed-out"===s)return-73;if("not-equal"===s)return-6;if("ok"===s)return 0;throw"Atomics.wait returned an unexpected value "+s}function we(e,t){for(var n=arguments.length-2,r=it(),o=n,i=st(8*o),a=i>>3,l=0;l<n;l++){var u=arguments[2+l];s()[a+l]=u}var p=nt(e,o,i,t);return at(r),p}p.establishStackSpace=function(e,t){lt(e,t),at(e)},p.getNoExitRuntime=function(){return M},p.invokeEntryPoint=function(e,t){return X.get(e)(t)},be=g?function(){var e=process.hrtime();return 1e3*e[0]+e[1]/1e6}:$?function(){return performance.now()-p.__performance_now_clock_drift}:"undefined"!=typeof dateNow?dateNow:function(){return performance.now()};var xe=[],Se=[];function ve(e){try{return A.grow(e-D.byteLength+65535>>>16),K(A.buffer),1}catch(e){}}var ke={inEventHandler:0,removeAllEventListeners:function(){for(var e=ke.eventHandlers.length-1;e>=0;--e)ke._removeHandler(e);ke.eventHandlers=[],ke.deferredCalls=[]},registerRemoveEventListeners:function(){ke.removeEventListenersRegistered||(ee.push(ke.removeAllEventListeners),ke.removeEventListenersRegistered=!0)},deferredCalls:[],deferCall:function(e,t,n){function r(e,t){if(e.length!=t.length)return!1;for(var n in e)if(e[n]!=t[n])return!1;return!0}for(var o in ke.deferredCalls){var i=ke.deferredCalls[o];if(i.targetFunction==e&&r(i.argsList,n))return}ke.deferredCalls.push({targetFunction:e,precedence:t,argsList:n}),ke.deferredCalls.sort(function(e,t){return e.precedence<t.precedence})},removeDeferredCalls:function(e){for(var t=0;t<ke.deferredCalls.length;++t)ke.deferredCalls[t].targetFunction==e&&(ke.deferredCalls.splice(t,1),--t)},canPerformEventHandlerRequests:function(){return ke.inEventHandler&&ke.currentEventHandler.allowsDeferredCalls},runDeferredCalls:function(){if(ke.canPerformEventHandlerRequests())for(var e=0;e<ke.deferredCalls.length;++e){var t=ke.deferredCalls[e];ke.deferredCalls.splice(e,1),--e,t.targetFunction.apply(null,t.argsList)}},eventHandlers:[],removeAllHandlersOnTarget:function(e,t){for(var n=0;n<ke.eventHandlers.length;++n)ke.eventHandlers[n].target!=e||t&&t!=ke.eventHandlers[n].eventTypeString||ke._removeHandler(n--)},_removeHandler:function(e){var t=ke.eventHandlers[e];t.target.removeEventListener(t.eventTypeString,t.eventListenerFunc,t.useCapture),ke.eventHandlers.splice(e,1)},registerOrRemoveHandler:function(e){var t=function(t){++ke.inEventHandler,ke.currentEventHandler=e,ke.runDeferredCalls(),e.handlerFunc(t),ke.runDeferredCalls(),--ke.inEventHandler};if(e.callbackfunc)e.eventListenerFunc=t,e.target.addEventListener(e.eventTypeString,t,e.useCapture),ke.eventHandlers.push(e),ke.registerRemoveEventListeners();else for(var n=0;n<ke.eventHandlers.length;++n)ke.eventHandlers[n].target==e.target&&ke.eventHandlers[n].eventTypeString==e.eventTypeString&&ke._removeHandler(n--)},queueEventHandlerOnThread_iiii:function(e,t,n,r,o){var a=it(),s=st(12);i()[s>>2]=n,i()[s+4>>2]=r,i()[s+8>>2]=o,rt(0,e,637534208,t,r,s),at(a)},getTargetThreadForEventCallback:function(e){switch(e){case 1:return 0;case 2:return $e.currentProxiedOperationCallerThread;default:return e}},getNodeNameForTarget:function(e){return e?e==window?"#window":e==screen?"#screen":e&&e.nodeName?e.nodeName:"":""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};var Ee=[0,"undefined"!=typeof document?document:0,"undefined"!=typeof window?window:0];function Ie(e){return function(e){var t;return e=(t=e)>2?H(t):t,Ee[e]||("undefined"!=typeof document?document.querySelector(e):void 0)}(e)}function Te(e,t,n){var r=Ie(e);if(!r)return-4;if(r.canvasSharedPtr&&(i()[r.canvasSharedPtr>>2]=t,i()[r.canvasSharedPtr+4>>2]=n),!r.offscreenCanvas&&r.controlTransferredOffscreen)return r.canvasSharedPtr?(function(e,t,n,r){!function(e,t,n,r){var o,a,s,l=it(),u=st(12),p=0;t&&(a=function(e){for(var t=0,n=0;n<e.length;++n){var r=e.charCodeAt(n);r>=55296&&r<=57343&&(r=65536+((1023&r)<<10)|1023&e.charCodeAt(++n)),r<=127?++t:t+=r<=2047?2:r<=65535?3:4}return t}(o=t)+1,G(o,s=He(a),a),p=s),i()[u>>2]=p,i()[u+4>>2]=n,i()[u+8>>2]=r,rt(0,e,657457152,0,p,u),at(l)}(e,t=t?H(t):"",n,r)}(i()[r.canvasSharedPtr+8>>2],e,t,n),1):-4;r.offscreenCanvas&&(r=r.offscreenCanvas);var o=!1;if(r.GLctxObject&&r.GLctxObject.GLctx){var a=r.GLctxObject.GLctx.getParameter(2978);o=0===a[0]&&0===a[1]&&a[2]===r.width&&a[3]===r.height}return r.width=t,r.height=n,o&&r.GLctxObject.GLctx.viewport(0,0,t,n),0}function Fe(e,t,n){return $?we(2,1,e,t,n):Te(e,t,n)}var Ne,je={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],uniforms:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},timerQueriesEXT:[],programInfos:{},stringCache:{},unpackAlignment:4,recordError:function(e){je.lastError||(je.lastError=e)},getNewId:function(e){for(var t=je.counter++,n=e.length;n<t;n++)e[n]=null;return t},getSource:function(e,t,n,r){for(var o="",a=0;a<t;
2++a){var s=r?i()[r+4*a>>2]:-1;o+=H(i()[n+4*a>>2],s<0?void 0:s)}return o},createContext:function(e,t){var n=e.getContext("webgl",t);return n?je.registerContext(n,t):0},registerContext:function(e,t){var n=He(8);i()[n+4>>2]=Xe();var r={handle:n,attributes:t,version:t.majorVersion,GLctx:e};return e.canvas&&(e.canvas.GLctxObject=r),je.contexts[n]=r,(void 0===t.enableExtensionsByDefault||t.enableExtensionsByDefault)&&je.initExtensions(r),n},makeContextCurrent:function(e){return je.currentContext=je.contexts[e],p.ctx=Ne=je.currentContext&&je.currentContext.GLctx,!(e&&!Ne)},getContext:function(e){return je.contexts[e]},deleteContext:function(e){je.currentContext===je.contexts[e]&&(je.currentContext=null),"object"==typeof ke&&ke.removeAllHandlersOnTarget(je.contexts[e].GLctx.canvas),je.contexts[e]&&je.contexts[e].GLctx.canvas&&(je.contexts[e].GLctx.canvas.GLctxObject=void 0),Ge(je.contexts[e].handle),je.contexts[e]=null},initExtensions:function(e){if(e||(e=je.currentContext),!e.initExtensionsDone){e.initExtensionsDone=!0;var t,n=e.GLctx;!function(e){var t=e.getExtension("ANGLE_instanced_arrays");t&&(e.vertexAttribDivisor=function(e,n){t.vertexAttribDivisorANGLE(e,n)},e.drawArraysInstanced=function(e,n,r,o){t.drawArraysInstancedANGLE(e,n,r,o)},e.drawElementsInstanced=function(e,n,r,o,i){t.drawElementsInstancedANGLE(e,n,r,o,i)})}(n),function(e){var t=e.getExtension("OES_vertex_array_object");t&&(e.createVertexArray=function(){return t.createVertexArrayOES()},e.deleteVertexArray=function(e){t.deleteVertexArrayOES(e)},e.bindVertexArray=function(e){t.bindVertexArrayOES(e)},e.isVertexArray=function(e){return t.isVertexArrayOES(e)})}(n),function(e){var t=e.getExtension("WEBGL_draw_buffers");t&&(e.drawBuffers=function(e,n){t.drawBuffersWEBGL(e,n)})}(n),n.disjointTimerQueryExt=n.getExtension("EXT_disjoint_timer_query"),(t=n).multiDrawWebgl=t.getExtension("WEBGL_multi_draw"),(n.getSupportedExtensions()||[]).forEach(function(e){e.indexOf("lose_context")<0&&e.indexOf("debug")<0&&n.getExtension(e)})}},populateUniformTable:function(e){for(var t=je.programs[e],n=je.programInfos[e]={uniforms:{},maxUniformLength:0,maxAttributeLength:-1,maxUniformBlockNameLength:-1},r=n.uniforms,o=Ne.getProgramParameter(t,35718),i=0;i<o;++i){var a=Ne.getActiveUniform(t,i),s=a.name;n.maxUniformLength=Math.max(n.maxUniformLength,s.length+1),"]"==s.slice(-1)&&(s=s.slice(0,s.lastIndexOf("[")));var l=Ne.getUniformLocation(t,s);if(l){var u=je.getNewId(je.uniforms);r[s]=[a.size,u],je.uniforms[u]=l;for(var p=1;p<a.size;++p){var c=s+"["+p+"]";l=Ne.getUniformLocation(t,c),u=je.getNewId(je.uniforms),je.uniforms[u]=l}}}}},Ae=["default","low-power","high-performance"],Ce={mappings:{},buffers:[null,[],[]],printChar:function(e,t){var n=Ce.buffers[e];0===t||10===t?((1===e?F:N)(V(n,0)),n.length=0):n.push(t)},varargs:void 0,get:function(){return Ce.varargs+=4,i()[Ce.varargs-4>>2]},getStr:function(e){return H(e)},get64:function(e,t){return e}};function Me(e){return $?we(3,1,e):0}function De(e,t,n,r,o){if($)return we(4,1,e,t,n,r,o)}function Oe(e,t,n,r){if($)return we(5,1,e,t,n,r);for(var a=0,s=0;s<n;s++){for(var l=i()[t+8*s>>2],u=i()[t+(8*s+4)>>2],p=0;p<u;p++)Ce.printChar(e,o()[l+p]);a+=u}return i()[r>>2]=a,0}function Re(e){if($)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var t=$e.getNewWorker();if(void 0!==t.pthread)throw"Internal error!";if(!e.pthread_ptr)throw"Internal error, no pthread ptr!";$e.runningWorkers.push(t);for(var n=He(512),r=0;r<128;++r)i()[n+4*r>>2]=0;var o=e.stackBase+e.stackSize,s=$e.pthreads[e.pthread_ptr]={worker:t,stackBase:e.stackBase,stackSize:e.stackSize,allocatedOwnStack:e.allocatedOwnStack,threadInfoStruct:e.pthread_ptr},l=s.threadInfoStruct>>2;Atomics.store(a(),l+16,e.detached),Atomics.store(a(),l+25,n),Atomics.store(a(),l+10,s.threadInfoStruct),Atomics.store(a(),l+20,e.stackSize),Atomics.store(a(),l+19,o),Atomics.store(a(),l+26,e.stackSize),Atomics.store(a(),l+28,o),Atomics.store(a(),l+29,e.detached);var u=Ke()+40;Atomics.store(a(),l+43,u),t.pthread=s;var p={cmd:"run",start_routine:e.startRoutine,arg:e.arg,threadInfoStruct:e.pthread_ptr,stackBase:e.stackBase,stackSize:e.stackSize};t.runPthread=function(){p.time=performance.now(),t.postMessage(p,e.transferList)},t.loaded&&(t.runPthread(),delete t.runPthread)}function Be(){if($){var e=Xe();if(e&&!Atomics.load(a(),e+56>>2)&&2==Atomics.load(a(),e+0>>2))throw"Canceled!"}}function Pe(){g||f||j("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function Le(e){if($)return we(6,1,e);switch(e){case 30:case 75:return 16384;case 85:return 131072;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;
2case 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 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"object"==typeof navigator&&navigator.hardwareConcurrency||1}return i()[qe()>>2]=28,-1}$||$e.initMainThreadBlock();var We,Ue=[null,function(e,t){if($)return we(1,1,e,t)},Fe,Me,De,Oe,Le],ze={e:function(e,t,n,r){le("Assertion failed: "+H(e)+", at: "+[t?H(t):"unknown filename",n,r?H(r):"unknown function"])},r:function(e,t){_main(e,t)},x:function(e,t){if(e==t)postMessage({cmd:"processQueuedMainThreadWork"});else if($)postMessage({targetThread:e,cmd:"processThreadQueue"});else{var n=$e.pthreads[e],r=n&&n.worker;if(!r)return;r.postMessage({cmd:"processThreadQueue"})}return 1},b:function(){le()},y:function(e,t,n){var r=function(e,t){var n;for(Se.length=0,t>>=2;n=o()[e++];){var r=n<105;r&&1&t&&t++,Se.push(r?s()[t++>>1]:i()[t]),++t}return Se}(t,n);return fe[e].apply(null,r)},j:function(e,t){},d:_e,c:me,f:be,p:function(e,t,n){o().copyWithin(e,t,t+n)},A:function(){return g?n(74).cpus().length:navigator.hardwareConcurrency},u:function(e,t,n){xe.length=t;for(var r=n>>3,o=0;o<t;o++)xe[o]=s()[r+o];return(e<0?fe[-e-1]:Ue[e]).apply(null,xe)},q:function(e){var t=o().length;if(e<=t)return!1;var n=2147483648;if(e>n)return!1;for(var r=1;r<=4;r*=2){var i=t*(1+.2/r);if(i=Math.min(i,e+100663296),ve(Math.min(n,q(Math.max(e,i),65536))))return!0}return!1},v:function(e,t,n){return Ie(e)?Te(e,t,n):Fe(e,t,n)},i:function(e){},s:function(e,t){},w:function(e,t){return n=e,r=t>>2,o=i()[r+6],a={alpha:!!i()[r+0],depth:!!i()[r+1],stencil:!!i()[r+2],antialias:!!i()[r+3],premultipliedAlpha:!!i()[r+4],preserveDrawingBuffer:!!i()[r+5],powerPreference:Ae[o],failIfMajorPerformanceCaveat:!!i()[r+7],majorVersion:i()[r+8],minorVersion:i()[r+9],enableExtensionsByDefault:i()[r+10],explicitSwapControl:i()[r+11],proxyContextToMainThread:i()[r+12],renderViaOffscreenBackBuffer:i()[r+13]},(s=Ie(n))?a.explicitSwapControl?0:je.createContext(s,a):0;var n,r,o,a,s},l:Me,n:De,g:Oe,o:function(){$e.initRuntime()},a:A||p.wasmMemory,z:function(e){var t=$e.threadExitHandlers.pop();e&&t()},k:function(e,t){$e.threadExitHandlers.push(function(){X.get(e)(t)})},h:function(e,t,n,r){if("undefined"==typeof SharedArrayBuffer)return N("Current environment does not support SharedArrayBuffer, pthreads are not available!"),6;if(!e)return N("pthread_create called with a null thread pointer!"),28;var o=[];if($&&0===o.length)return tt(687865856,e,t,n,r);var s=0,l=0,u=0;t&&-1!=t?(s=i()[t>>2],s+=81920,l=i()[t+8>>2],u=0!==i()[t+12>>2]):s=2097152;var p=0==l;p?l=ut(16,s):U((l-=s)>0);for(var c=He(228),d=0;d<57;++d)a()[(c>>2)+d]=0;i()[e>>2]=c,i()[c+12>>2]=c;var h=c+152;i()[h>>2]=h;var f={stackBase:l,stackSize:s,allocatedOwnStack:p,detached:u,startRoutine:n,pthread_ptr:c,arg:r,transferList:o};return $?(f.cmd="spawnThread",postMessage(f,o)):Re(f),0},m:function(e,t){return function(e,t){if(!e)return N("pthread_join attempted on a null thread pointer!"),71;if($&&Xe()==e)return N("PThread "+e+" is attempting to join to itself!"),16;if(!$&&Qe()==e)return N("Main thread "+e+" is attempting to join to itself!"),16;if(i()[e+12>>2]!==e)return N("pthread_join attempted on thread "+e+", which does not point to a valid thread, or does not exist anymore!"),71;if(Atomics.load(a(),e+64>>2))return N("Attempted to join thread "+e+", which was already detached!"),28;for(Pe();;){var n=Atomics.load(a(),e+0>>2);if(1==n){var r=Atomics.load(a(),e+4>>2);return t&&(i()[t>>2]=r),Atomics.store(a(),e+64>>2,1),$?postMessage({cmd:"cleanupThread",thread:e}):ye(e),0}0,Be(),$||Je(),_e(e+0,n,$?100:1)}}(e,t)},t:Le},Ve=(function(){var e={a:ze};function t(e,t){var n=e.exports;if(p.asm=n,X=p.asm.I,C=t,!$){var r=$e.unusedWorkers.length;$e.unusedWorkers.forEach(function(e){$e.loadWasmModuleToWorker(e,function(){--r||function(){if(ie--,p.monitorRunDependencies&&p.monitorRunDependencies(ie),0==ie&&(null!==ae&&(clearInterval(ae),ae=null),se)){var e=se;se=null,e()}}()})})}}function n(e){t(e.instance,e.module)}function r(t){return function(){if(!T&&(h||f)){if("function"==typeof fetch&&!ce(de))return fetch(de,{credentials:"same-origin"}).then(function(e){if(!e.ok)throw"failed to load wasm binary file at '"+de+"'";return e.arrayBuffer()}).catch(function(){return he(de)});if(w)return new Promise(function(e,t){w(de,function(t){e(new Uint8Array(t))},t)})}return Promise.resolve().then(function(){return he(de)})}().then(function(t){return WebAssembly.instantiate(t,e)}).then(t,function(e){N("failed to asynchronously prepare wasm: "+e),le(e)}
2)}if($||(U(!$,"addRunDependency cannot be used in a pthread worker"),ie++,p.monitorRunDependencies&&p.monitorRunDependencies(ie)),p.instantiateWasm)try{return p.instantiateWasm(e,t)}catch(e){return N("Module.instantiateWasm callback failed with error: "+e),!1}(T||"function"!=typeof WebAssembly.instantiateStreaming||pe(de)||ce(de)||"function"!=typeof fetch?r(n):fetch(de,{credentials:"same-origin"}).then(function(t){return WebAssembly.instantiateStreaming(t,e).then(n,function(e){return N("wasm streaming compile failed: "+e),N("falling back to ArrayBuffer instantiation"),r(n)})})).catch(u)}(),p.___wasm_call_ctors=function(){return(Ve=p.___wasm_call_ctors=p.asm.B).apply(null,arguments)}),He=(p._init=function(){return(p._init=p.asm.C).apply(null,arguments)},p._init_with_threads_count=function(){return(p._init_with_threads_count=p.asm.D).apply(null,arguments)},p._get_threads_count=function(){return(p._get_threads_count=p.asm.E).apply(null,arguments)},p._register_tensor=function(){return(p._register_tensor=p.asm.F).apply(null,arguments)},p._dispose_data=function(){return(p._dispose_data=p.asm.G).apply(null,arguments)},p._dispose=function(){return(p._dispose=p.asm.H).apply(null,arguments)},p._Abs=function(){return(p._Abs=p.asm.J).apply(null,arguments)},p._Add=function(){return(p._Add=p.asm.K).apply(null,arguments)},p._AddN=function(){return(p._AddN=p.asm.L).apply(null,arguments)},p._All=function(){return(p._All=p.asm.M).apply(null,arguments)},p._Any=function(){return(p._Any=p.asm.N).apply(null,arguments)},p._ArgMax=function(){return(p._ArgMax=p.asm.O).apply(null,arguments)},p._AvgPool=function(){return(p._AvgPool=p.asm.P).apply(null,arguments)},p._BatchMatMul=function(){return(p._BatchMatMul=p.asm.Q).apply(null,arguments)},p._Ceil=function(){return(p._Ceil=p.asm.R).apply(null,arguments)},p._ClipByValue=function(){return(p._ClipByValue=p.asm.S).apply(null,arguments)},p._Conv2D=function(){return(p._Conv2D=p.asm.T).apply(null,arguments)},p._Conv2DBackpropInput=function(){return(p._Conv2DBackpropInput=p.asm.U).apply(null,arguments)},p._Cos=function(){return(p._Cos=p.asm.V).apply(null,arguments)},p._Cosh=function(){return(p._Cosh=p.asm.W).apply(null,arguments)},p._CropAndResize=function(){return(p._CropAndResize=p.asm.X).apply(null,arguments)},p._Cumsum=function(){return(p._Cumsum=p.asm.Y).apply(null,arguments)},p._DepthToSpace=function(){return(p._DepthToSpace=p.asm.Z).apply(null,arguments)},p._DepthwiseConv2dNative=function(){return(p._DepthwiseConv2dNative=p.asm._).apply(null,arguments)},p._Elu=function(){return(p._Elu=p.asm.$).apply(null,arguments)},p._Equal=function(){return(p._Equal=p.asm.aa).apply(null,arguments)},p._Exp=function(){return(p._Exp=p.asm.ba).apply(null,arguments)},p._FlipLeftRight=function(){return(p._FlipLeftRight=p.asm.ca).apply(null,arguments)},p._Floor=function(){return(p._Floor=p.asm.da).apply(null,arguments)},p._FloorDiv=function(){return(p._FloorDiv=p.asm.ea).apply(null,arguments)},p._FusedBatchNorm=function(){return(p._FusedBatchNorm=p.asm.fa).apply(null,arguments)},p._FusedConv2D=function(){return(p._FusedConv2D=p.asm.ga).apply(null,arguments)},p._FusedDepthwiseConv2D=function(){return(p._FusedDepthwiseConv2D=p.asm.ha).apply(null,arguments)},p._Gather=function(){return(p._Gather=p.asm.ia).apply(null,arguments)},p._GatherNd=function(){return(p._GatherNd=p.asm.ja).apply(null,arguments)},p._Greater=function(){return(p._Greater=p.asm.ka).apply(null,arguments)},p._GreaterEqual=function(){return(p._GreaterEqual=p.asm.la).apply(null,arguments)},p._LeakyRelu=function(){return(p._LeakyRelu=p.asm.ma).apply(null,arguments)},p._Less=function(){return(p._Less=p.asm.na).apply(null,arguments)},p._LessEqual=function(){return(p._LessEqual=p.asm.oa).apply(null,arguments)},p._Log=function(){return(p._Log=p.asm.pa).apply(null,arguments)},p._LogicalAnd=function(){return(p._LogicalAnd=p.asm.qa).apply(null,arguments)},p._Max=function(){return(p._Max=p.asm.ra).apply(null,arguments)},p._MaxPool=function(){return(p._MaxPool=p.asm.sa).apply(null,arguments)},p._Maximum=function(){return(p._Maximum=p.asm.ta).apply(null,arguments)},p._Mean=function(){return(p._Mean=p.asm.ua).apply(null,arguments)},p._Min=function(){return(p._Min=p.asm.va).apply(null,arguments)},p._Minimum=function(){return(p._Minimum=p.asm.wa).apply(null,arguments)},p._MirrorPad=function(){return(p._MirrorPad=p.asm.xa).apply(null,arguments)},p._Multiply=function(){return(p._Multiply=p.asm.ya).apply(null,arguments)},p._Neg=function(){return(p._Neg=p.asm.za).apply(null,arguments)},p._NonMaxSuppressionV3=function(){return(p._NonMaxSuppressionV3=p.asm.Aa).apply(null,arguments)},p._NonMaxSuppressionV4=function(){return(p._NonMaxSuppressionV4=p.asm.Ba).apply(null,arguments)},p._NonMaxSuppressionV5=function(){return(p._NonMaxSuppressionV5=p.asm.Ca).apply(null,arguments)},p._NotEqual=function(){return(p._NotEqual=p.asm.Da).apply(null,arguments)},p._OneHot=function(){return(p._OneHot=p.asm.Ea).apply(null,arguments)},p._PadV2=function(){return(p._PadV2=p.asm.Fa).apply(null,arguments)},p._Pow=function(){return(p._Pow=p.asm.Ga).apply(null,arguments)},p._Prelu=function(){return(p._Prelu=p.asm.Ha).apply(null,arguments)},p._Prod=function(){return(p._Prod=p.asm.Ia).apply(null,arguments)},p._RealDiv=function(){return(p._RealDiv=p.asm.Ja).apply(null,arguments)},p._Relu=function(){return(p._Relu=p.asm.Ka).apply(null,arguments)},p._Relu6=function(){return(p._Relu6=p.asm.La).apply(null,arguments)},p._ResizeBilinear=function(){return(p._ResizeBilinear=p.asm.Ma).apply(null,arguments)}
2,p._Reverse=function(){return(p._Reverse=p.asm.Na).apply(null,arguments)},p._RotateWithOffset=function(){return(p._RotateWithOffset=p.asm.Oa).apply(null,arguments)},p._Round=function(){return(p._Round=p.asm.Pa).apply(null,arguments)},p._Rsqrt=function(){return(p._Rsqrt=p.asm.Qa).apply(null,arguments)},p._ScatterNd=function(){return(p._ScatterNd=p.asm.Ra).apply(null,arguments)},p._SelectV2=function(){return(p._SelectV2=p.asm.Sa).apply(null,arguments)},p._Sigmoid=function(){return(p._Sigmoid=p.asm.Ta).apply(null,arguments)},p._Sin=function(){return(p._Sin=p.asm.Ua).apply(null,arguments)},p._Softmax=function(){return(p._Softmax=p.asm.Va).apply(null,arguments)},p._Sqrt=function(){return(p._Sqrt=p.asm.Wa).apply(null,arguments)},p._Square=function(){return(p._Square=p.asm.Xa).apply(null,arguments)},p._SquaredDifference=function(){return(p._SquaredDifference=p.asm.Ya).apply(null,arguments)},p._Step=function(){return(p._Step=p.asm.Za).apply(null,arguments)},p._StridedSlice=function(){return(p._StridedSlice=p.asm._a).apply(null,arguments)},p._Sub=function(){return(p._Sub=p.asm.$a).apply(null,arguments)},p._Sum=function(){return(p._Sum=p.asm.ab).apply(null,arguments)},p._Tan=function(){return(p._Tan=p.asm.bb).apply(null,arguments)},p._Tanh=function(){return(p._Tanh=p.asm.cb).apply(null,arguments)},p._Tile=function(){return(p._Tile=p.asm.db).apply(null,arguments)},p._TopK=function(){return(p._TopK=p.asm.eb).apply(null,arguments)},p._Transform=function(){return(p._Transform=p.asm.fb).apply(null,arguments)},p._Transpose=function(){return(p._Transpose=p.asm.gb).apply(null,arguments)},p.__FusedMatMul=function(){return(p.__FusedMatMul=p.asm.hb).apply(null,arguments)},p._malloc=function(){return(He=p._malloc=p.asm.ib).apply(null,arguments)}),Ge=p._free=function(){return(Ge=p._free=p.asm.jb).apply(null,arguments)},qe=p.___errno_location=function(){return(qe=p.___errno_location=p.asm.kb).apply(null,arguments)},Ke=p._emscripten_get_global_libc=function(){return(Ke=p._emscripten_get_global_libc=p.asm.lb).apply(null,arguments)},Xe=p._pthread_self=function(){return(Xe=p._pthread_self=p.asm.mb).apply(null,arguments)},Ye=p.___pthread_tsd_run_dtors=function(){return(Ye=p.___pthread_tsd_run_dtors=p.asm.nb).apply(null,arguments)},Je=p._emscripten_main_thread_process_queued_calls=function(){return(Je=p._emscripten_main_thread_process_queued_calls=p.asm.ob).apply(null,arguments)},Ze=(p._emscripten_current_thread_process_queued_calls=function(){return(p._emscripten_current_thread_process_queued_calls=p.asm.pb).apply(null,arguments)},p._emscripten_register_main_browser_thread_id=function(){return(Ze=p._emscripten_register_main_browser_thread_id=p.asm.qb).apply(null,arguments)}),Qe=p._emscripten_main_browser_thread_id=function(){return(Qe=p._emscripten_main_browser_thread_id=p.asm.rb).apply(null,arguments)},et=p.__emscripten_do_dispatch_to_thread=function(){return(et=p.__emscripten_do_dispatch_to_thread=p.asm.sb).apply(null,arguments)},tt=p._emscripten_sync_run_in_main_thread_4=function(){return(tt=p._emscripten_sync_run_in_main_thread_4=p.asm.tb).apply(null,arguments)},nt=p._emscripten_run_in_main_runtime_thread_js=function(){return(nt=p._emscripten_run_in_main_runtime_thread_js=p.asm.ub).apply(null,arguments)},rt=p.__emscripten_call_on_thread=function(){return(rt=p.__emscripten_call_on_thread=p.asm.vb).apply(null,arguments)},ot=(p._emscripten_tls_init=function(){return(p._emscripten_tls_init=p.asm.wb).apply(null,arguments)},p.__emscripten_thread_init=function(){return(ot=p.__emscripten_thread_init=p.asm.xb).apply(null,arguments)}),it=p.stackSave=function(){return(it=p.stackSave=p.asm.yb).apply(null,arguments)},at=p.stackRestore=function(){return(at=p.stackRestore=p.asm.zb).apply(null,arguments)},st=p.stackAlloc=function(){return(st=p.stackAlloc=p.asm.Ab).apply(null,arguments)},lt=p._emscripten_stack_set_limits=function(){return(lt=p._emscripten_stack_set_limits=p.asm.Bb).apply(null,arguments)},ut=p._memalign=function(){return(ut=p._memalign=p.asm.Cb).apply(null,arguments)},pt=p.__emscripten_allow_main_runtime_queued_calls=10512,ct=p.__emscripten_main_thread_futex=12148;function dt(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function ht(e){if(e=e||y,!(ie>
20)){if($)return l(p),ne(),void postMessage({cmd:"loaded"});!function(){if(!$){if(p.preRun)for("function"==typeof p.preRun&&(p.preRun=[p.preRun]);p.preRun.length;)re(p.preRun.shift());ge(J)}}(),ie>0||(p.setStatus?(p.setStatus("Running..."),setTimeout(function(){setTimeout(function(){p.setStatus("")},1),t()},1)):t())}function t(){We||(We=!0,p.calledRun=!0,W||(ne(),$||ge(Q),l(p),p.onRuntimeInitialized&&p.onRuntimeInitialized(),function(){if(!$){if(p.postRun)for("function"==typeof p.postRun&&(p.postRun=[p.postRun]);p.postRun.length;)oe(p.postRun.shift());ge(te)}}()))}}if(p.cwrap=function(e,n,r,o){var i=(r=r||[]).every(function(e){return"number"===e});return"string"!==n&&i&&!o?z(e):function(){return function(e,n,r,o){var i={string:function(e){var t=0;if(null!=e&&0!==e){var n=1+(e.length<<2);G(e,t=st(n),n)}return t},array:function(e){var n=st(e.length);return function(e,n){t().set(e,n)}(e,n),n}},a=z(e),s=[],l=0;if(o)for(var u=0;u<o.length;u++){var p=i[r[u]];p?(0===l&&(l=it()),s[u]=p(o[u])):s[u]=o[u]}var c=a.apply(null,s);return c=function(e){return"string"===n?H(e):"boolean"===n?Boolean(e):e}(c),0!==l&&at(l),c}(e,n,r,arguments)}},p.PThread=$e,p.PThread=$e,p.wasmMemory=A,p.ExitStatus=dt,se=function e(){We||ht(),We||(se=e)},p.run=ht,p.preInit)for("function"==typeof p.preInit&&(p.preInit=[p.preInit]);p.preInit.length>0;)p.preInit.pop()();return $&&(M=!1,$e.initWorker()),ht(),e.ready});e.exports=o},530:()=>{},537:(e,t,n)=>{var r=/%[sdj%]/g;t.format=function(e){if(!m(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(a(arguments[n]));return t.join(" ")}n=1;for(var o=arguments,i=o.length,s=String(e).replace(r,function(e){if("%%"===e)return"%";if(n>=i)return e;switch(e){case"%s":return String(o[n++]);case"%d":return Number(o[n++]);case"%j":try{return JSON.stringify(o[n++])}catch(e){return"[Circular]"}default:return e}}),l=o[n];n<i;l=o[++n])f(l)||!$(l)?s+=" "+l:s+=" "+a(l);return s},t.deprecate=function(e,r){if(y(n.g.process))return function(){return t.deprecate(e,r).apply(this,arguments)};if(!0===process.noDeprecation)return e;var o=!1;return function(){if(!o){if(process.throwDeprecation)throw new Error(r);process.traceDeprecation?console.trace(r):console.error(r),o=!0}return e.apply(this,arguments)}};var o,i={};function a(e,n){var r={seen:[],stylize:l};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),h(n)?r.showHidden=n:n&&t._extend(r,n),y(r.showHidden)&&(r.showHidden=!1),y(r.depth)&&(r.depth=2),y(r.colors)&&(r.colors=!1),y(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=s),u(r,e,r.depth)}function s(e,t){var n=a.styles[t];return n?"�["+a.colors[n][0]+"m"+e+"�["+a.colors[n][1]+"m":e}function l(e,t){return e}function u(e,n,r){if(e.customInspect&&n&&x(n.inspect)&&n.inspect!==t.inspect&&(!n.constructor||n.constructor.prototype!==n)){var o=n.inspect(r,e);return m(o)||(o=u(e,o,r)),o}var i=function(e,t){if(y(t))return e.stylize("undefined","undefined");if(m(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}return g(t)?e.stylize(""+t,"number"):h(t)?e.stylize(""+t,"boolean"):f(t)?e.stylize("null","null"):void 0}(e,n);if(i)return i;var a=Object.keys(n),s=function(e){var t={};return e.forEach(function(e,n){t[e]=!0}),t}(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(n)),w(n)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return p(n);if(0===a.length){if(x(n)){var l=n.name?": "+n.name:"";return e.stylize("[Function"+l+"]","special")}if(b(n))return e.stylize(RegExp.prototype.toString.call(n),"regexp");if(_(n))return e.stylize(Date.prototype.toString.call(n),"date");if(w(n))return p(n)}var $,S="",v=!1,k=["{","}"];return d(n)&&(v=!0,k=["[","]"]),x(n)&&(S=" [Function"+(n.name?": "+n.name:"")+"]"),b(n)&&(S=" "+RegExp.prototype.toString.call(n)),_(n)&&(S=" "+Date.prototype.toUTCString.call(n)),w(n)&&(S=" "+p(n)),0!==a.length||v&&0!=n.length?r<0?b(n)?e.stylize(RegExp.prototype.toString.call(n),"regexp"):e.stylize("[Object]","special"):(e.seen.push(n),$=v?function(e,t,n,r,o){for(var i=[],a=0,s=t.length;a<s;++a)E(t,String(a))?i.push(c(e,t,n,r,String(a),!0)):i.push("");return o.forEach(function(o){o.match(/^\d+$/)||i.push(c(e,t,n,r,o,!0))}),i}(e,n,r,s,a):a.map(function(t){return c(e,n,r,s,t,v)}),e.seen.pop(),function(e,t,n){return e.reduce(function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n  ")+" "+n[1]:n[0]+t+" "+e.join(", ")+" "+n[1]}($,S,k)):k[0]+S+k[1]}function p(e){return"["+Error.prototype.toString.call(e)+"]"}function c(e,t,n,r,o,i){var a,s,l;if((l=Object.getOwnPropertyDescriptor(t,o)||{value:t[o]}).get?s=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(s=e.stylize("[
2Setter]","special")),E(r,o)||(a="["+o+"]"),s||(e.seen.indexOf(l.value)<0?(s=f(n)?u(e,l.value,null):u(e,l.value,n-1)).indexOf("\n")>-1&&(s=i?s.split("\n").map(function(e){return"  "+e}).join("\n").substr(2):"\n"+s.split("\n").map(function(e){return"   "+e}).join("\n")):s=e.stylize("[Circular]","special")),y(a)){if(i&&o.match(/^\d+$/))return s;(a=JSON.stringify(""+o)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function d(e){return Array.isArray(e)}function h(e){return"boolean"==typeof e}function f(e){return null===e}function g(e){return"number"==typeof e}function m(e){return"string"==typeof e}function y(e){return void 0===e}function b(e){return $(e)&&"[object RegExp]"===S(e)}function $(e){return"object"==typeof e&&null!==e}function _(e){return $(e)&&"[object Date]"===S(e)}function w(e){return $(e)&&("[object Error]"===S(e)||e instanceof Error)}function x(e){return"function"==typeof e}function S(e){return Object.prototype.toString.call(e)}function v(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(y(o)&&(o=process.env.NODE_DEBUG||""),e=e.toUpperCase(),!i[e])if(new RegExp("\\b"+e+"\\b","i").test(o)){var n=process.pid;i[e]=function(){var r=t.format.apply(t,arguments);console.error("%s %d: %s",e,n,r)}}else i[e]=function(){};return i[e]},t.inspect=a,a.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},a.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=d,t.isBoolean=h,t.isNull=f,t.isNullOrUndefined=function(e){return null==e},t.isNumber=g,t.isString=m,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=y,t.isRegExp=b,t.isObject=$,t.isDate=_,t.isError=w,t.isFunction=x,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=n(135);var k=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function E(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){var e,n;console.log("%s - %s",(n=[v((e=new Date).getHours()),v(e.getMinutes()),v(e.getSeconds())].join(":"),[e.getDate(),k[e.getMonth()],n].join(" ")),t.format.apply(t,arguments))},t.inherits=n(698),t._extend=function(e,t){if(!t||!$(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}},551:()=>{},556:()=>{},570:e=>{e.exports=n;var t=null;try{t=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(e){}function n(e,t,n){this.low=0|e,this.high=0|t,this.unsigned=!!n}function r(e){return!0===(e&&e.__isLong__)}n.prototype.__isLong__,Object.defineProperty(n.prototype,"__isLong__",{value:!0}),n.isLong=r;var o={},i={};function a(e,t){var n,r,a;return t?(a=0<=(e>>>=0)&&e<256)&&(r=i[e])?r:(n=l(e,(0|e)<0?-1:0,!0),a&&(i[e]=n),n):(a=-128<=(e|=0)&&e<128)&&(r=o[e])?r:(n=l(e,e<0?-1:0,!1),a&&(o[e]=n),n)}function s(e,t){if(isNaN(e))return t?y:m;if(t){if(e<0)return y;if(e>=h)return x}else{if(e<=-f)return S;if(e+1>=f)return w}return e<0?s(-e,t).neg():l(e%d|0,e/d|0,t)}function l(e,t,r){return new n(e,t,r)}n.fromInt=a,n.fromNumber=s,n.fromBits=l;var u=Math.pow;function p(e,t,n){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return m;if("number"==typeof t?(n=t,t=!1):t=!!t,(n=n||10)<2||36<n)throw RangeError("radix");var r;if((r=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===r)return p(e.substring(1),t,n).neg();for(var o=s(u(n,8)),i=m,a=0;a<e.length;a+=8){var l=Math.min(8,e.length-a),c=parseInt(e.substring(a,a+l),n);if(l<8){var d=s(u(n,l));i=i.mul(d).add(s(c))}else i=(i=i.mul(o)).add(s(c))}return i.unsigned=t,i}function c(e,t){return"number"==typeof e?s(e,t):"string"==typeof e?p(e,t):l(e.low,e.high,"boolean"==typeof t?t:e.unsigned)}n.fromString=p,n.fromValue=c;var d=4294967296,h=d*d,f=h/2,g=a(1<<24),m=a(0);n.ZERO=m;var y=a(0,!0);n.UZERO=y;var b=a(1);n.ONE=b;var $=a(1,!0);n.UONE=$;var _=a(-1);n.NEG_ONE=_;var w=l(-1,2147483647,!1);n.MAX_VALUE=w;var x=l(-1,-1,!0);n.MAX_UNSIGNED_VALUE=x;var S=l(0,-2147483648,!1);n.MIN_VALUE=S;var v=n.prototype;v.toInt=function(){return this.unsigned?this.low>>>0:this.low},v.toNumber=function(){return this.unsigned?(this.high>>>0)*d+(this.low>>>0):this.high*d+(this.low>>>0)},v.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(S)){var t=s(e),n=this.div(t),r=n.mul(t).sub(this);return n.toString(e)+r.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var o=s(u(e,6),this.unsigned),i=this,a="";;){var l=i.div(o),p=(i.sub(l.mul(o)).toInt()>>>0).toString(e);if((i=l).isZero())return p+a;for(;p.length<6;)p="0"+p;a=""+p+a}},v.getHighBits=function(){return this.high},v.getHighBitsUnsigned=function(){return this.high>>>0},v.getLowBits=function(){return this.low},v.getLowBitsUnsigned=function(){return this.low>>>0},v.getNumBitsAbs=function(){if(this.isNegative())return this.eq(S)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&!(e&1<<t);t--);return 0!=this.high?t+33:t+1},v.isZero=function(){return 0===this.high&&0===this.low},v.eqz=v.isZero,v.isNegative=function(){return!this.unsigned&&this.high<0}
2,v.isPositive=function(){return this.unsigned||this.high>=0},v.isOdd=function(){return!(1&~this.low)},v.isEven=function(){return!(1&this.low)},v.equals=function(e){return r(e)||(e=c(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low},v.eq=v.equals,v.notEquals=function(e){return!this.eq(e)},v.neq=v.notEquals,v.ne=v.notEquals,v.lessThan=function(e){return this.comp(e)<0},v.lt=v.lessThan,v.lessThanOrEqual=function(e){return this.comp(e)<=0},v.lte=v.lessThanOrEqual,v.le=v.lessThanOrEqual,v.greaterThan=function(e){return this.comp(e)>0},v.gt=v.greaterThan,v.greaterThanOrEqual=function(e){return this.comp(e)>=0},v.gte=v.greaterThanOrEqual,v.ge=v.greaterThanOrEqual,v.compare=function(e){if(r(e)||(e=c(e)),this.eq(e))return 0;var t=this.isNegative(),n=e.isNegative();return t&&!n?-1:!t&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},v.comp=v.compare,v.negate=function(){return!this.unsigned&&this.eq(S)?S:this.not().add(b)},v.neg=v.negate,v.add=function(e){r(e)||(e=c(e));var t=this.high>>>16,n=65535&this.high,o=this.low>>>16,i=65535&this.low,a=e.high>>>16,s=65535&e.high,u=e.low>>>16,p=0,d=0,h=0,f=0;return h+=(f+=i+(65535&e.low))>>>16,d+=(h+=o+u)>>>16,p+=(d+=n+s)>>>16,p+=t+a,l((h&=65535)<<16|(f&=65535),(p&=65535)<<16|(d&=65535),this.unsigned)},v.subtract=function(e){return r(e)||(e=c(e)),this.add(e.neg())},v.sub=v.subtract,v.multiply=function(e){if(this.isZero())return m;if(r(e)||(e=c(e)),t)return l(t.mul(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(e.isZero())return m;if(this.eq(S))return e.isOdd()?S:m;if(e.eq(S))return this.isOdd()?S:m;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(g)&&e.lt(g))return s(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,o=65535&this.high,i=this.low>>>16,a=65535&this.low,u=e.high>>>16,p=65535&e.high,d=e.low>>>16,h=65535&e.low,f=0,y=0,b=0,$=0;return b+=($+=a*h)>>>16,y+=(b+=i*h)>>>16,b&=65535,y+=(b+=a*d)>>>16,f+=(y+=o*h)>>>16,y&=65535,f+=(y+=i*d)>>>16,y&=65535,f+=(y+=a*p)>>>16,f+=n*h+o*d+i*p+a*u,l((b&=65535)<<16|($&=65535),(f&=65535)<<16|(y&=65535),this.unsigned)},v.mul=v.multiply,v.divide=function(e){if(r(e)||(e=c(e)),e.isZero())throw Error("division by zero");var n,o,i;if(t)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?l((this.unsigned?t.div_u:t.div_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?y:m;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return y;if(e.gt(this.shru(1)))return $;i=y}else{if(this.eq(S))return e.eq(b)||e.eq(_)?S:e.eq(S)?b:(n=this.shr(1).div(e).shl(1)).eq(m)?e.isNegative()?b:_:(o=this.sub(e.mul(n)),i=n.add(o.div(e)));if(e.eq(S))return this.unsigned?y:m;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();i=m}for(o=this;o.gte(e);){n=Math.max(1,Math.floor(o.toNumber()/e.toNumber()));for(var a=Math.ceil(Math.log(n)/Math.LN2),p=a<=48?1:u(2,a-48),d=s(n),h=d.mul(e);h.isNegative()||h.gt(o);)h=(d=s(n-=p,this.unsigned)).mul(e);d.isZero()&&(d=b),i=i.add(d),o=o.sub(h)}return i},v.div=v.divide,v.modulo=function(e){return r(e)||(e=c(e)),t?l((this.unsigned?t.rem_u:t.rem_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},v.mod=v.modulo,v.rem=v.modulo,v.not=function(){return l(~this.low,~this.high,this.unsigned)},v.and=function(e){return r(e)||(e=c(e)),l(this.low&e.low,this.high&e.high,this.unsigned)},v.or=function(e){return r(e)||(e=c(e)),l(this.low|e.low,this.high|e.high,this.unsigned)},v.xor=function(e){return r(e)||(e=c(e)),l(this.low^e.low,this.high^e.high,this.unsigned)},v.shiftLeft=function(e){return r(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?l(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):l(0,this.low<<e-32,this.unsigned)},v.shl=v.shiftLeft,v.shiftRight=function(e){return r(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?l(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):l(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},v.shr=v.shiftRight,v.shiftRightUnsigned=function(e){if(r(e)&&(e=e.toInt()),0==(e&=63))return this;var t=this.high;return e<32?l(this.low>>>e|t<<32-e,t>>>e,this.unsigned):l(32===e?t:t>>>e-32,0,this.unsigned)},v.shru=v.shiftRightUnsigned,v.shr_u=v.shiftRightUnsigned,v.toSigned=function(){return this.unsigned?l(this.low,this.high,!1):this},v.toUnsigned=function(){return this.unsigned?this:l(this.low,this.high,!0)},v.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},v.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},v.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},n.fromBytes=function(e,t,r){return r?n.fromBytesLE(e,t):n.fromBytesBE(e,t)},n.fromBytesLE=function(e,t){return new n(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},n.fromBytesBE=function(e,t){return new n(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}},590:()=>{},603:()=>{},627:(e,t,n)=>{"use strict";var r="win32"===process.platform,o=n(537);function i(e,t){for(var n=[],r=0;r<e.length;r++){var o=e[r];o&&"."!==o&&(".."===o?n.length&&".."!==n[n.length-1]?n.pop():t&&n.push(".."):n.push(o))}return n}function a(e){for(var t=e.length-1,n=0;n<=t&&!e[n];n++);for(var r=t;r>=0&&!e[r];r--);return 0===n&&r===t?e:n>r?[]:e.slice(n,r+1)}var s=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/,l=/^([\s\S]*?)((?:\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))(?:[\\\/]*)$/,u={};function p(e){var t=s.exec(e),n=(t[1]||"")+(t[2]||""),r=t[3]||"",o=l.exec(r);return[n,o[1],o[2],o[3]]}function c(e){var t=s.exec(e),n=t[1]||"",r=!!n&&":"!==n[1];return{device:n,isUnc:r,isAbsolute:r||!!t[2],tail:t[3]}}function d(e){return"\\\\"+e.replace(/^[\\\/]+/,"").replace(/[\\\/]+/g,"\\")}u.resolve=function(){for(var e="",t="",n=!1,r=arguments.length-1;r>=-1;r--){var a;if(r>=0?a=arguments[r]:e?(a=process.env["="+e])&&a.substr(0,3).toLowerCase()===e.toLowerCase()+"\\"||(a=e+"\\"):a=process.cwd(),!
2o.isString(a))throw new TypeError("Arguments to path.resolve must be strings");if(a){var s=c(a),l=s.device,u=s.isUnc,p=s.isAbsolute,h=s.tail;if((!l||!e||l.toLowerCase()===e.toLowerCase())&&(e||(e=l),n||(t=h+"\\"+t,n=p),e&&n))break}}return u&&(e=d(e)),e+(n?"\\":"")+(t=i(t.split(/[\\\/]+/),!n).join("\\"))||"."},u.normalize=function(e){var t=c(e),n=t.device,r=t.isUnc,o=t.isAbsolute,a=t.tail,s=/[\\\/]$/.test(a);return(a=i(a.split(/[\\\/]+/),!o).join("\\"))||o||(a="."),a&&s&&(a+="\\"),r&&(n=d(n)),n+(o?"\\":"")+a},u.isAbsolute=function(e){return c(e).isAbsolute},u.join=function(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(!o.isString(n))throw new TypeError("Arguments to path.join must be strings");n&&e.push(n)}var r=e.join("\\");return/^[\\\/]{2}[^\\\/]/.test(e[0])||(r=r.replace(/^[\\\/]{2,}/,"\\")),u.normalize(r)},u.relative=function(e,t){e=u.resolve(e),t=u.resolve(t);for(var n=e.toLowerCase(),r=t.toLowerCase(),o=a(t.split("\\")),i=a(n.split("\\")),s=a(r.split("\\")),l=Math.min(i.length,s.length),p=l,c=0;c<l;c++)if(i[c]!==s[c]){p=c;break}if(0==p)return t;var d=[];for(c=p;c<i.length;c++)d.push("..");return(d=d.concat(o.slice(p))).join("\\")},u._makeLong=function(e){if(!o.isString(e))return e;if(!e)return"";var t=u.resolve(e);return/^[a-zA-Z]\:\\/.test(t)?"\\\\?\\"+t:/^\\\\[^?.]/.test(t)?"\\\\?\\UNC\\"+t.substring(2):e},u.dirname=function(e){var t=p(e),n=t[0],r=t[1];return n||r?(r&&(r=r.substr(0,r.length-1)),n+r):"."},u.basename=function(e,t){var n=p(e)[2];return t&&n.substr(-1*t.length)===t&&(n=n.substr(0,n.length-t.length)),n},u.extname=function(e){return p(e)[3]},u.format=function(e){if(!o.isObject(e))throw new TypeError("Parameter 'pathObject' must be an object, not "+typeof e);var t=e.root||"";if(!o.isString(t))throw new TypeError("'pathObject.root' must be a string or undefined, not "+typeof e.root);var n=e.dir,r=e.base||"";return n?n[n.length-1]===u.sep?n+r:n+u.sep+r:r},u.parse=function(e){if(!o.isString(e))throw new TypeError("Parameter 'pathString' must be a string, not "+typeof e);var t=p(e);if(!t||4!==t.length)throw new TypeError("Invalid path '"+e+"'");return{root:t[0],dir:t[0]+t[1].slice(0,-1),base:t[2],ext:t[3],name:t[2].slice(0,t[2].length-t[3].length)}},u.sep="\\",u.delimiter=";";var h=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,f={};function g(e){return h.exec(e).slice(1)}f.resolve=function(){for(var e="",t=!1,n=arguments.length-1;n>=-1&&!t;n--){var r=n>=0?arguments[n]:process.cwd();if(!o.isString(r))throw new TypeError("Arguments to path.resolve must be strings");r&&(e=r+"/"+e,t="/"===r[0])}return(t?"/":"")+(e=i(e.split("/"),!t).join("/"))||"."},f.normalize=function(e){var t=f.isAbsolute(e),n=e&&"/"===e[e.length-1];return(e=i(e.split("/"),!t).join("/"))||t||(e="."),e&&n&&(e+="/"),(t?"/":"")+e},f.isAbsolute=function(e){return"/"===e.charAt(0)},f.join=function(){for(var e="",t=0;t<arguments.length;t++){var n=arguments[t];if(!o.isString(n))throw new TypeError("Arguments to path.join must be strings");n&&(e+=e?"/"+n:n)}return f.normalize(e)},f.relative=function(e,t){e=f.resolve(e).substr(1),t=f.resolve(t).substr(1);for(var n=a(e.split("/")),r=a(t.split("/")),o=Math.min(n.length,r.length),i=o,s=0;s<o;s++)if(n[s]!==r[s]){i=s;break}var l=[];for(s=i;s<n.length;s++)l.push("..");return(l=l.concat(r.slice(i))).join("/")},f._makeLong=function(e){return e},f.dirname=function(e){var t=g(e),n=t[0],r=t[1];return n||r?(r&&(r=r.substr(0,r.length-1)),n+r):"."},f.basename=function(e,t){var n=g(e)[2];return t&&n.substr(-1*t.length)===t&&(n=n.substr(0,n.length-t.length)),n},f.extname=function(e){return g(e)[3]},f.format=function(e){if(!o.isObject(e))throw new TypeError("Parameter 'pathObject' must be an object, not "+typeof e);var t=e.root||"";if(!o.isString(t))throw new TypeError("'pathObject.root' must be a string or undefined, not "+typeof e.root);return(e.dir?e.dir+f.sep:"")+(e.base||"")},f.parse=function(e){if(!o.isString(e))throw new TypeError("Parameter 'pathString' must be a string, not "+typeof e);var t=g(e);if(!t||4!==t.length)throw new TypeError("Invalid path '"+e+"'");return t[1]=t[1]||"",t[2]=t[2]||"",t[3]=t[3]||"",{root:t[0],dir:t[0]+t[1].slice(0,-1),base:t[2],ext:t[3],name:t[2].slice(0,t[2].length-t[3].length)}},f.sep="/",f.delimiter=":",e.exports=r?u:f,e.exports.posix=f,e.exports.win32=u},698:e=>{"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},717:function(e,t,n){var r;!function(e,o){function i(e){var t=this,n="";t.next=function(){var e=t.b,n=t.c,r=t.d,o=t.a;return e=e<<25^e>>>7^n,n=n-r|0,r=r<<24^r>>>8^o,o=o-e|0,t.b=e=e<<20^e>>>12^n,t.c=n=n-r|0,t.d=r<<16^n>>>16^o,t.a=o-e|0},t.a=0,t.b=0,t.c=-1640531527,t.d=1367130551,e===Math.floor(e)?(t.a=e/4294967296|0,t.b=0|e):n+=e;for(var r=0;r<n.length+20;
2r++)t.b^=0|n.charCodeAt(r),t.next()}function a(e,t){return t.a=e.a,t.b=e.b,t.c=e.c,t.d=e.d,t}function s(e,t){var n=new i(e),r=t&&t.state,o=function(){return(n.next()>>>0)/4294967296};return o.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},o.int32=n.next,o.quick=o,r&&("object"==typeof r&&a(r,n),o.state=function(){return a(n,{})}),o}o&&o.exports?o.exports=s:n.amdD&&n.amdO?void 0===(r=function(){return s}.call(t,n,t,o))||(o.exports=r):this.tychei=s}(0,e=n.nmd(e),n.amdD)},765:(e,t,n)=>{var r,o=(r=(r="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(e){var t,o;(e=void 0!==(e=e||{})?e:{}).ready=new Promise(function(e,n){t=e,o=n});var i,a={};for(i in e)e.hasOwnProperty(i)&&(a[i]=e[i]);var s,l,u,p,c=[],d="./this.program",h=function(e,t){throw t};s="object"==typeof window,l="function"==typeof importScripts,u="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,p=!s&&!u&&!l;var f,g,m,y,b,$="";u?($=l?n(627).dirname($)+"/":"//",f=function(e,t){return y||(y=n(603)),b||(b=n(627)),e=b.normalize(e),y.readFileSync(e,t?null:"utf8")},m=function(e){var t=f(e,!0);return t.buffer||(t=new Uint8Array(t)),T(t.buffer),t},process.argv.length>1&&(d=process.argv[1].replace(/\\/g,"/")),c=process.argv.slice(2),process.on("uncaughtException",function(e){if(!(e instanceof At))throw e}),process.on("unhandledRejection",de),h=function(e){process.exit(e)},e.inspect=function(){return"[Emscripten Module object]"}):p?("undefined"!=typeof read&&(f=function(e){return read(e)}),m=function(e){var t;return"function"==typeof readbuffer?new Uint8Array(readbuffer(e)):(T("object"==typeof(t=read(e,"binary"))),t)},"undefined"!=typeof scriptArgs?c=scriptArgs:void 0!==arguments&&(c=arguments),"function"==typeof quit&&(h=function(e){quit(e)}),"undefined"!=typeof print&&("undefined"==typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!=typeof printErr?printErr:print)):(s||l)&&(l?$=self.location.href:"undefined"!=typeof document&&document.currentScript&&($=document.currentScript.src),r&&($=r),$=0!==$.indexOf("blob:")?$.substr(0,$.lastIndexOf("/")+1):"",f=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},l&&(m=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),g=function(e,t,n){var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=function(){200==r.status||0==r.status&&r.response?t(r.response):n()},r.onerror=n,r.send(null)});var _,w=e.print||console.log.bind(console),x=e.printErr||console.warn.bind(console);for(i in a)a.hasOwnProperty(i)&&(e[i]=a[i]);function S(e){S.shown||(S.shown={}),S.shown[e]||(S.shown[e]=1,x(e))}a=null,e.arguments&&(c=e.arguments),e.thisProgram&&(d=e.thisProgram),e.quit&&(h=e.quit),e.wasmBinary&&(_=e.wasmBinary);var v,k=e.noExitRuntime||!0;function E(e,t,n,r){switch("*"===(n=n||"i8").charAt(n.length-1)&&(n="i32"),n){case"i1":case"i8":R[0|e]=t;break;case"i16":P[e>>1]=t;break;case"i32":W[e>>2]=t;break;case"i64":be=[t>>>0,(ye=t,+Math.abs(ye)>=1?ye>0?(0|Math.min(+Math.floor(ye/4294967296),4294967295))>>>0:~~+Math.ceil((ye-+(~~ye>>>0))/4294967296)>>>0:0)],W[e>>2]=be[0],W[e+4>>2]=be[1];break;case"float":z[e>>2]=t;break;case"double":V[e>>3]=t;break;default:de("invalid type for setValue: "+n)}}"object"!=typeof WebAssembly&&de("no native wasm support detected");var I=!1;function T(e,t){e||de("Assertion failed: "+t)}function F(e,t){var n;return n=1==t?jt(e.length):Tt(e.length),e.subarray||e.slice?B.set(e,n):B.set(new Uint8Array(e),n),n}var N="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function j(e,t,n){for(var r=t+n,o=t;e[o]&&!(o>=r);)++o;if(o-t>16&&e.subarray&&N)return N.decode(e.subarray(t,o));for(var i="";t<o;){var a=e[t++];if(128&a){var s=63&e[t++];if(192!=(224&a)){var l=63&e[t++];if((a=224==(240&a)?(15&a)<<12|s<<6|l:(7&a)<<18|s<<12|l<<6|63&e[t++])<65536)i+=String.fromCharCode(a);else{var u=a-65536;i+=String.fromCharCode(55296|u>>10,56320|1023&u)}}else i+=String.fromCharCode((31&a)<<6|s)}else i+=String.fromCharCode(a)}return i}function A(e,t){return e?j(B,e,t):""}function C(e,t,n,r){if(!(r>0))return 0;for(var o=n,i=n+r-1,a=0;a<e.length;++a){var s=e.charCodeAt(a);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++a)),s<=127){if(n>=i)break;t[n++]=s}else if(s<=2047){if(n+1>=i)break;t[n++]=192|s>>6,t[n++]=128|63&s}else if(s<=65535){if(n+2>=i)break;t[n++]=224|s>>12,t[n++]=128|s>>6&63,t[n++]=128|63&s}else{if(n+3>=i)break;t[n++]=240|s>>18,t[n++]=128|s>>12&63,t[n++]=128|s>>6&63,t[n++]=128|63&s}}return t[n]=0,n-o}function M(e,t,n){return C(e,B,t,n)}function D(e){for(var t=0,n=0;n<e.length;++n){var r=e.charCodeAt(n);r>=55296&&r<=57343&&(r=65536+((1023&r)<<10)|1023&e.charCodeAt(++n)),r<=127?++t:t+=r<=2047?2:r<=65535?3:4}return t}var O,R,B,P,L,W,U,z,V,H="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function G(e,t){for(var n=e,r=n>>1,o=r+t/2;!(r>=o)&&L[r];)++r;if((n=r<<1)-e>32&&H)return H.decode(B.subarray(e,n));for(var i="",a=0;!(a>=t/2);++a){var s=P[e+2*a>>1];if(0==s)break;i+=String.fromCharCode(s)}return i}function q(e,t,n){if(void 0===n&&(n=2147483647),n<2)return 0;for(var r=t,o=(n-=2)<2*e.length?n/2:e.length,i=0;i<o;++i){var a=e.charCodeAt(i);P[t>>1]=a,t+=2}return P[t>>1]=0,t-r}function K(e){return 2*e.length}function X(e,t){for(var n=0,r="";!(n>=t/4);){var o=W[e+4*n>>2];if(0==o)break;if(++n,o>=65536){var i=o-65536;r+=String.fromCharCode(55296|i>>10,56320|1023&i)}else r+=String.fromCharCode(o)}return r}function Y(e,t,n){if(void 0===n&&(n=2147483647),n<4)return 0;for(var r=t,o=r+n-4,i=0;i<e.length;++i){var a=e.charCodeAt(i);if(a>=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++i)),W[t>>2]=a,(t+=4)+4>o)break}return W[t>>2]=0,t-r}function J(e){for(var t=0,n=0;n<e.length;++n){var r=e.charCodeAt(n);r>=55296&&r<=57343&&++n,t+=4}return t}function Z(e,t){return e%t>0&&(e+=t-e%t),e}function Q(t){O=t,e.HEAP8=R=new Int8Array(t),e.HEAP16=P=new Int16Array(t),e.HEAP32=W=new Int32Array(t),e.HEAPU8=B=new Uint8Array(t),e.HEAPU16=L=new Uint16Array(t),e.HEAPU32
2=U=new Uint32Array(t),e.HEAPF32=z=new Float32Array(t),e.HEAPF64=V=new Float64Array(t)}e.INITIAL_MEMORY;var ee,te=[],ne=[],re=[],oe=[];function ie(e){te.unshift(e)}function ae(e){oe.unshift(e)}ne.push({func:function(){It()}});var se=0,le=null,ue=null;function pe(t){se++,e.monitorRunDependencies&&e.monitorRunDependencies(se)}function ce(t){if(se--,e.monitorRunDependencies&&e.monitorRunDependencies(se),0==se&&(null!==le&&(clearInterval(le),le=null),ue)){var n=ue;ue=null,n()}}function de(t){e.onAbort&&e.onAbort(t),x(t+=""),I=!0,t="abort("+t+"). Build with -s ASSERTIONS=1 for more info.";var n=new WebAssembly.RuntimeError(t);throw o(n),n}function he(e,t){return String.prototype.startsWith?e.startsWith(t):0===e.indexOf(t)}function fe(e){return he(e,"data:application/octet-stream;base64,")}function ge(e){return he(e,"file://")}e.preloadedImages={},e.preloadedAudios={};var me,ye,be,$e="orboAiMakeup.wasm";function _e(e){try{if(e==$e&&_)return new Uint8Array(_);if(m)return m(e);throw"both async and sync fetching of the wasm failed"}catch(e){de(e)}}function we(t){for(;t.length>0;){var n=t.shift();if("function"!=typeof n){var r=n.func;"number"==typeof r?void 0===n.arg?ee.get(r)():ee.get(r)(n.arg):r(void 0===n.arg?null:n.arg)}else n(e)}}fe($e)||(me=$e,$e=e.locateFile?e.locateFile(me,$):$+me);function xe(e){this.excPtr=e,this.ptr=e-16,this.set_type=function(e){W[this.ptr+8>>2]=e},this.get_type=function(){return W[this.ptr+8>>2]},this.set_destructor=function(e){W[this.ptr+0>>2]=e},this.get_destructor=function(){return W[this.ptr+0>>2]},this.set_refcount=function(e){W[this.ptr+4>>2]=e},this.set_caught=function(e){e=e?1:0,R[this.ptr+12|0]=e},this.get_caught=function(){return 0!=R[this.ptr+12|0]},this.set_rethrown=function(e){e=e?1:0,R[this.ptr+13|0]=e},this.get_rethrown=function(){return 0!=R[this.ptr+13|0]},this.init=function(e,t){this.set_type(e),this.set_destructor(t),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var e=W[this.ptr+4>>2];W[this.ptr+4>>2]=e+1},this.release_ref=function(){var e=W[this.ptr+4>>2];return W[this.ptr+4>>2]=e-1,1===e}}var Se={};function ve(e){for(;e.length;){var t=e.pop();e.pop()(t)}}function ke(e){return this.fromWireType(U[e>>2])}var Ee={},Ie={},Te={};function Fe(e){if(void 0===e)return"_unknown";var t=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return t>=48&&t<=57?"_"+e:e}function Ne(e,t){return e=Fe(e),new Function("body","return function "+e+'() {\n    "use strict";    return body.apply(this, arguments);\n};\n')(t)}function je(e,t){var n=Ne(t,function(e){this.name=t,this.message=e;var n=new Error(e).stack;void 0!==n&&(this.stack=this.toString()+"\n"+n.replace(/^Error(:[^\n]*)?\n/,""))});return n.prototype=Object.create(e.prototype),n.prototype.constructor=n,n.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message},n}var Ae=void 0;function Ce(e){throw new Ae(e)}function Me(e,t,n){function r(t){var r=n(t);r.length!==e.length&&Ce("Mismatched type converter count");for(var o=0;o<e.length;++o)Le(e[o],r[o])}e.forEach(function(e){Te[e]=t});var o=new Array(t.length),i=[],a=0;t.forEach(function(e,t){Ie.hasOwnProperty(e)?o[t]=Ie[e]:(i.push(e),Ee.hasOwnProperty(e)||(Ee[e]=[]),Ee[e].push(function(){o[t]=Ie[e],++a===i.length&&r(o)}))}),0===i.length&&r(o)}function De(e){switch(e){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+e)}}var Oe=void 0;function Re(e){for(var t="",n=e;B[n];)t+=Oe[B[n++]];return t}var Be=void 0;function Pe(e){throw new Be(e)}function Le(e,t,n){if(n=n||{},!("argPackAdvance"in t))throw new TypeError("registerType registeredInstance requires argPackAdvance");var r=t.name;if(e||Pe('type "'+r+'" must have a positive integer typeid pointer'),Ie.hasOwnProperty(e)){if(n.ignoreDuplicateRegistrations)return;Pe("Cannot register type '"+r+"' twice")}if(Ie[e]=t,delete Te[e],Ee.hasOwnProperty(e)){var o=Ee[e];delete Ee[e],o.forEach(function(e){e()})}}var We=[],Ue=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function ze(e){e>4&&0===--Ue[e].refcount&&(Ue[e]=void 0,We.push(e))}function Ve(e){switch(e){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var t=We.length?We.pop():Ue.length;return Ue[t]={refcount:1,value:e},t}}function He(e){if(null===e)return"null";var t=typeof e;return"object"===t||"array"===t||"function"===t?e.toString():""+e}function Ge(e,t){switch(t){case 2:return function(e){return this.fromWireType(z[e>>2])};case 3:return function(e){return this.fromWireType(V[e>>3])};default:throw new TypeError("Unknown float type: "+e)}}function qe(t,n){var r,o,i,a=-1!=(t=Re(t)).indexOf("j")?(r=t,o=n,i=[],function(){i.length=arguments.length;for(var t=0;t<arguments.length;t++)i[t]=arguments[t];return function(t,n,r){return-1!=t.indexOf("j")?function(t,n,r){var o=e["dynCall_"+t];return r&&r.length?o.apply(null,[n].concat(r)):o.call(null,n)}(t,n,r):ee.get(n).apply(null,r)}(r,o,i)}):ee.get(n);return"function"!=typeof a&&Pe("unknown function pointer with signature "+t+": "+n),a}var Ke=void 0;function Xe(e){var t=Nt(e),n=Re(t);return Ft(t),n}function Ye(e,t,n){switch(t){case 0:return n?function(e){return R[e]}:function(e){return B[e]};case 1:return n?function(e){return P[e>>1]}:function(e){return L[e>>1]};case 2:return n?function(e){return W[e>>2]}:function(e){return U[e>>2]};default:throw new TypeError("Unknown integer type: "+e)}}function Je(e){try{return v.grow(e-O.byteLength+65535>>>16),Q(v.buffer),1}catch(e){}}var Ze={};function Qe(){if(!Qe.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:d||"./this.program"};for(var t in Ze)e[t]=Ze[t];var n=[];for(var t in e)n.push(t+"="+e[t]);Qe.strings=n}return Qe.strings}var et={splitPath:function(e){return/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1)},normalizeArray:function(e,t){for(var n=0,r=e.length-1;r>=0;r--){var o=e[r];"."===o?e.splice(r,1):".."===o?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n;n--)e.unshift("..");return e},normalize:function(e){var t="/"===e.charAt(0),n="/"===e.substr(-1);return(e=et.normalizeArray(e.split("/").filter(function(e){return!!e}),!t).join("/"))||t||(e="."),e&&n&&(e+="/"),(t?"/":"")+e},dirname:function(e){var t=et.splitPath(e),n=t[0],r=t[1];return n||r?(r&&(r=r.substr(0,r.length-1)),n+r):"."},basename:function(e){if("/"===e)return"/";var t=(e=(e=et.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)},extname:function(e){return et.splitPath(e)[3]},join:function(){var e=Array.prototype.slice.call(arguments,0);return et.normalize(e.join("/"))},join2:function(e,t){return et.normalize(e+"/"+t)}},tt={resolve:function(){for(var e="",t=!1,n=arguments.length-1;n>=-1&&!t;n--){var r=n>=0?arguments[n]:ot.cwd();if("string"!=typeof r)throw new TypeError("Arguments to path.resolve must be strings");if(!r)return"";e=r+"/"+e,t="/"===r.charAt(0)}return(t?"/":"")+(e=et.normalizeArray(e.split("/").filter(function(e){return!!e}),!t).join("/"))||"."},relative:function(e,t){function n(e){for(var t=0;t<e.length&&""===e[t];t++);for(var n=e.length-1;n>=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=tt.resolve(e).substr(1),t=tt.resolve(t).substr(1);for(var r=n(e.split("/")),o=n(t.split("/")),i=Math.min(r.length,o.length),a=i,s=0;s<i;s++)if(r[s]!==o[s]){a=s;break}var l=[];for(s=a;s<r.length;
vendor: 5,532 bytes, line 2
2s++)l.push("..");return(l=l.concat(o.slice(a))).join("/")}},nt={ttys:[],init:function(){},shutdown:function(){},register:function(e,t){nt.ttys[e]={input:[],output:[],ops:t},ot.registerDevice(e,nt.stream_ops)},stream_ops:{open:function(e){var t=nt.ttys[e.node.rdev];if(!t)throw new ot.ErrnoError(43);e.tty=t,e.seekable=!1},close:function(e){e.tty.ops.flush(e.tty)},flush:function(e){e.tty.ops.flush(e.tty)},read:function(e,t,n,r,o){if(!e.tty||!e.tty.ops.get_char)throw new ot.ErrnoError(60);for(var i=0,a=0;a<r;a++){var s;try{s=e.tty.ops.get_char(e.tty)}catch(e){throw new ot.ErrnoError(29)}if(void 0===s&&0===i)throw new ot.ErrnoError(6);if(null==s)break;i++,t[n+a]=s}return i&&(e.node.timestamp=Date.now()),i},write:function(e,t,n,r,o){if(!e.tty||!e.tty.ops.put_char)throw new ot.ErrnoError(60);try{for(var i=0;i<r;i++)e.tty.ops.put_char(e.tty,t[n+i])}catch(e){throw new ot.ErrnoError(29)}return r&&(e.node.timestamp=Date.now()),i}},default_tty_ops:{get_char:function(e){if(!e.input.length){var t=null;if(u){var n=Buffer.alloc?Buffer.alloc(256):new Buffer(256),r=0;try{r=y.readSync(process.stdin.fd,n,0,256,null)}catch(e){if(-1==e.toString().indexOf("EOF"))throw e;r=0}t=r>0?n.slice(0,r).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(t=window.prompt("Input: "))&&(t+="\n"):"function"==typeof readline&&null!==(t=readline())&&(t+="\n");if(!t)return null;e.input=vt(t,!0)}return e.input.shift()},put_char:function(e,t){null===t||10===t?(w(j(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&e.output.length>0&&(w(j(e.output,0)),e.output=[])}},default_tty1_ops:{put_char:function(e,t){null===t||10===t?(x(j(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&e.output.length>0&&(x(j(e.output,0)),e.output=[])}}};var rt={ops_table:null,mount:function(e){return rt.createNode(null,"/",16895,0)},createNode:function(e,t,n,r){if(ot.isBlkdev(n)||ot.isFIFO(n))throw new ot.ErrnoError(63);rt.ops_table||(rt.ops_table={dir:{node:{getattr:rt.node_ops.getattr,setattr:rt.node_ops.setattr,lookup:rt.node_ops.lookup,mknod:rt.node_ops.mknod,rename:rt.node_ops.rename,unlink:rt.node_ops.unlink,rmdir:rt.node_ops.rmdir,readdir:rt.node_ops.readdir,symlink:rt.node_ops.symlink},stream:{llseek:rt.stream_ops.llseek}},file:{node:{getattr:rt.node_ops.getattr,setattr:rt.node_ops.setattr},stream:{llseek:rt.stream_ops.llseek,read:rt.stream_ops.read,write:rt.stream_ops.write,allocate:rt.stream_ops.allocate,mmap:rt.stream_ops.mmap,msync:rt.stream_ops.msync}},link:{node:{getattr:rt.node_ops.getattr,setattr:rt.node_ops.setattr,readlink:rt.node_ops.readlink},stream:{}},chrdev:{node:{getattr:rt.node_ops.getattr,setattr:rt.node_ops.setattr},stream:ot.chrdev_stream_ops}});var o=ot.createNode(e,t,n,r);return ot.isDir(o.mode)?(o.node_ops=rt.ops_table.dir.node,o.stream_ops=rt.ops_table.dir.stream,o.contents={}):ot.isFile(o.mode)?(o.node_ops=rt.ops_table.file.node,o.stream_ops=rt.ops_table.file.stream,o.usedBytes=0,o.contents=null):ot.isLink(o.mode)?(o.node_ops=rt.ops_table.link.node,o.stream_ops=rt.ops_table.link.stream):ot.isChrdev(o.mode)&&(o.node_ops=rt.ops_table.chrdev.node,o.stream_ops=rt.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[t]=o,e.timestamp=o.timestamp),o},getFileDataAsTypedArray:function(e){return e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0)},expandFileStorage:function(e,t){var n=e.contents?e.contents.length:0;if(!(n>=t)){t=Math.max(t,n*(n<1048576?2:1.125)>>>0),0!=n&&(t=Math.max(t,256));var r=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(r.subarray(0,e.usedBytes),0)}},resizeFileStorage:function(e,t){if(e.usedBytes!=t)if(0==t)e.contents=null,e.usedBytes=0;else{var n=e.contents;e.contents=new Uint8Array(t),n&&e.contents.set(n.subarray(0,Math.min(t,e.usedBytes))),e.usedBytes=t}},node_ops:{getattr:function(e){var t={};return t.dev=ot.isChrdev(e.mode)?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,ot.isDir(e.mode)?t.size=4096:ot.isFile(e.mode)?t.size=e.usedBytes:ot.isLink(e.mode)?t.size=e.link.length:t.size=0,t.atime=new Date(e.timestamp),t.mtime=new Date(e.timestamp),t.ctime=new Date(e.timestamp),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr:function(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&rt.resizeFileStorage(e,t.size)},lookup:function(e,t){throw ot.genericErrors[44]},mknod:function(e,t,n,r){return rt.createNode(e,t,n,r)},rename:function(e,t,n){if(ot.isDir(e.mode)){var r;try{r=ot.lookupNode(t,n)}catch(e){}if(r)for(var o in r.contents)throw new ot.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=n,t.contents[n]=e,t.timestamp=e.parent.timestamp,e.parent=t},unlink:function(e,t){delete e.contents[t],e.timestamp=Date.now()},rmdir:function(e,t){var n=ot.lookupNode(e,t);for(var r in n.contents)throw new ot.ErrnoError(55);delete e.contents[t],e.timestamp=Date.now()},readdir:function(e){var t=[".",".."];for(var n in e.contents)e.contents.hasOwnProperty(n)&&t.push(n);return t},symlink:function(e,t,n){var r=rt.createNode(e,t,41471,0);return r.link=n,r},readlink:function(e){if(!ot.isLink(e.mode))throw new ot.ErrnoError(28);return e.link}},stream_ops:{read:function(e,t,n,r,o){var i=e.node.contents;if(o>=e.node.usedBytes)return 0;var a=Math.min(e.node.usedBytes-o,r);if(a>8&&i.subarray)t.set(i.subarray(o,o+a),n);else for(var s=0;s<a;s++)t[n+s]=i[o+s];return a}
vendor: 2,617 bytes, line 2
2,write:function(e,t,n,r,o,i){if(t.buffer===R.buffer&&(i=!1),!r)return 0;var a=e.node;if(a.timestamp=Date.now(),t.subarray&&(!a.contents||a.contents.subarray)){if(i)return a.contents=t.subarray(n,n+r),a.usedBytes=r,r;if(0===a.usedBytes&&0===o)return a.contents=t.slice(n,n+r),a.usedBytes=r,r;if(o+r<=a.usedBytes)return a.contents.set(t.subarray(n,n+r),o),r}if(rt.expandFileStorage(a,o+r),a.contents.subarray&&t.subarray)a.contents.set(t.subarray(n,n+r),o);else for(var s=0;s<r;s++)a.contents[o+s]=t[n+s];return a.usedBytes=Math.max(a.usedBytes,o+r),r},llseek:function(e,t,n){var r=t;if(1===n?r+=e.position:2===n&&ot.isFile(e.node.mode)&&(r+=e.node.usedBytes),r<0)throw new ot.ErrnoError(28);return r},allocate:function(e,t,n){rt.expandFileStorage(e.node,t+n),e.node.usedBytes=Math.max(e.node.usedBytes,t+n)},mmap:function(e,t,n,r,o,i){if(0!==t)throw new ot.ErrnoError(28);if(!ot.isFile(e.node.mode))throw new ot.ErrnoError(43);var a,s,l=e.node.contents;if(2&i||l.buffer!==O){if((r>0||r+n<l.length)&&(l=l.subarray?l.subarray(r,r+n):Array.prototype.slice.call(l,r,r+n)),s=!0,!(a=function(e){for(var t=function(e,t){return t||(t=16),Math.ceil(e/t)*t}(e,16384),n=Tt(t);e<t;)R[n+e++]=0;return n}(n)))throw new ot.ErrnoError(48);R.set(l,a)}else s=!1,a=l.byteOffset;return{ptr:a,allocated:s}},msync:function(e,t,n,r,o){if(!ot.isFile(e.node.mode))throw new ot.ErrnoError(43);return 2&o||rt.stream_ops.write(e,t,0,r,n,!1),0}}},ot={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,trackingDelegate:{},tracking:{openFlags:{READ:1,WRITE:2}},ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:function(e,t){if(t=t||{},!(e=tt.resolve(ot.cwd(),e)))return{path:"",node:null};var n={follow_mount:!0,recurse_count:0};for(var r in n)void 0===t[r]&&(t[r]=n[r]);if(t.recurse_count>8)throw new ot.ErrnoError(32);for(var o=et.normalizeArray(e.split("/").filter(function(e){return!!e}),!1),i=ot.root,a="/",s=0;s<o.length;s++){var l=s===o.length-1;if(l&&t.parent)break;if(i=ot.lookupNode(i,o[s]),a=et.join2(a,o[s]),ot.isMountpoint(i)&&(!l||l&&t.follow_mount)&&(i=i.mounted.root),!l||t.follow)for(var u=0;ot.isLink(i.mode);){var p=ot.readlink(a);if(a=tt.resolve(et.dirname(a),p),i=ot.lookupPath(a,{recurse_count:t.recurse_count}).node,u++>40)throw new ot.ErrnoError(32)}}return{path:a,node:i}},getPath:function(e){for(var t;;){if(ot.isRoot(e)){var n=e.mount.mountpoint;return t?"/"!==n[n.length-1]?n+"/"+t:n+t:n}t=t?e.name+"/"+t:e.name,e=e.parent}},hashName:function(e,t){for(var n=0,r=0;r<t.length;r++)n=(n<<5)-n+t.charCodeAt(r)|0;return(e+n>>>
20)%ot.nameTable.length},hashAddNode:function(e){var t=ot.hashName(e.parent.id,e.name);e.name_next=ot.nameTable[t],ot.nameTable[t]=e},hashRemoveNode:function(e){var t=ot.hashName(e.parent.id,e.name);if(ot.nameTable[t]===e)ot.nameTable[t]=e.name_next;else for(var n=ot.nameTable[t];n;){if(n.name_next===e){n.name_next=e.name_next;break}n=n.name_next}},lookupNode:function(e,t){var n=ot.mayLookup(e);if(n)throw new ot.ErrnoError(n,e);for(var r=ot.hashName(e.id,t),o=ot.nameTable[r];o;o=o.name_next){var i=o.name;if(o.parent.id===e.id&&i===t)return o}return ot.lookup(e,t)},createNode:function(e,t,n,r){var o=new ot.FSNode(e,t,n,r);return ot.hashAddNode(o),o},destroyNode:function(e){ot.hashRemoveNode(e)},isRoot:function(e){return e===e.parent},isMountpoint:function(e){return!!e.mounted},isFile:function(e){return 32768==(61440&e)},isDir:function(e){return 16384==(61440&e)},isLink:function(e){return 40960==(61440&e)},isChrdev:function(e){return 8192==(61440&e)},isBlkdev:function(e){return 24576==(61440&e)},isFIFO:function(e){return 4096==(61440&e)},isSocket:function(e){return!(49152&~e)},flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:function(e){var t=ot.flagModes[e];if(void 0===t)throw new Error("Unknown file open mode: "+e);return t},flagsToPermissionString:function(e){var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t},nodePermissions:function(e,t){return ot.ignorePermissions||(-1===t.indexOf("r")||292&e.mode)&&(-1===t.indexOf("w")||146&e.mode)&&(-1===t.indexOf("x")||73&e.mode)?0:2},mayLookup:function(e){return ot.nodePermissions(e,"x")||(e.node_ops.lookup?0:2)},mayCreate:function(e,t){try{return ot.lookupNode(e,t),20}catch(e){}return ot.nodePermissions(e,"wx")},mayDelete:function(e,t,n){var r;try{r=ot.lookupNode(e,t)}catch(e){return e.errno}var o=ot.nodePermissions(e,"wx");if(o)return o;if(n){if(!ot.isDir(r.mode))return 54;if(ot.isRoot(r)||ot.getPath(r)===ot.cwd())return 10}else if(ot.isDir(r.mode))return 31;return 0},mayOpen:function(e,t){return e?ot.isLink(e.mode)?32:ot.isDir(e.mode)&&("r"!==ot.flagsToPermissionString(t)||512&t)?31:ot.nodePermissions(e,ot.flagsToPermissionString(t)):44},MAX_OPEN_FDS:4096,nextfd:function(e,t){e=e||0,t=t||ot.MAX_OPEN_FDS;for(var n=e;n<=t;n++)if(!ot.streams[n])return n;throw new ot.ErrnoError(33)},getStream:function(e){return ot.streams[e]},createStream:function(e,t,n){ot.FSStream||(ot.FSStream=function(){},ot.FSStream.prototype={object:{get:function(){return this.node},set:function(e){this.node=e}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return!!(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}}});var r=new ot.FSStream;for(var o in e)r[o]=e[o];e=r;var i=ot.nextfd(t,n);return e.fd=i,ot.streams[i]=e,e},closeStream:function(e){ot.streams[e]=null},chrdev_stream_ops:{open:function(e){var t=ot.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:function(){throw new ot.ErrnoError(70)}},major:function(e){return e>>8},minor:function(e){return 255&e},makedev:function(e,t){return e<<8|t},registerDevice:function(e,t){ot.devices[e]={stream_ops:t}},getDevice:function(e){return ot.devices[e]},getMounts:function(e){for(var t=[],n=[e];n.length;){var r=n.pop();t.push(r),n.push.apply(n,r.mounts)}return t},syncfs:function(e,t){"function"==typeof e&&(t=e,e=!1),ot.syncFSRequests++,ot.syncFSRequests>1&&x("warning: "+ot.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var n=ot.getMounts(ot.root.mount),r=0;function o(e){return ot.syncFSRequests--,t(e)}function i(e){if(e)return i.errored?void 0:(i.errored=!0,o(e));++r>=n.length&&o(null)}n.forEach(function(t){if(!t.type.syncfs)return i(null);t.type.syncfs(t,e,i)})},mount:function(e,t,n){var r,o="/"===n,i=!n;if(o&&ot.root)throw new ot.ErrnoError(10);if(!o&&!i){var a=ot.lookupPath(n,{follow_mount:!1});if(n=a.path,r=a.node,ot.isMountpoint(r))throw new ot.ErrnoError(10);if(!ot.isDir(r.mode))throw new ot.ErrnoError(54)}var s={type:e,opts:t,mountpoint:n,mounts:[]},l=e.mount(s);return l.mount=s,s.root=l,o?ot.root=l:r&&(r.mounted=s,r.mount&&r.mount.mounts.push(s)),l},unmount:function(e){var t=ot.lookupPath(e,{follow_mount:!1});if(!ot.isMountpoint(t.node))throw new ot.ErrnoError(28);var n=t.node,r=n.mounted,o=ot.getMounts(r);Object.keys(ot.nameTable).forEach(function(e){for(var t=ot.nameTable[e];t;){var n=t.name_next;-1!==o.indexOf(t.mount)&&ot.destroyNode(t),t=n}}),n.mounted=null;var i=n.mount.mounts.indexOf(r);n.mount.mounts.splice(i,1)}
vendor: 4,705 bytes, line 2
2,lookup:function(e,t){return e.node_ops.lookup(e,t)},mknod:function(e,t,n){var r=ot.lookupPath(e,{parent:!0}).node,o=et.basename(e);if(!o||"."===o||".."===o)throw new ot.ErrnoError(28);var i=ot.mayCreate(r,o);if(i)throw new ot.ErrnoError(i);if(!r.node_ops.mknod)throw new ot.ErrnoError(63);return r.node_ops.mknod(r,o,t,n)},create:function(e,t){return t=void 0!==t?t:438,t&=4095,t|=32768,ot.mknod(e,t,0)},mkdir:function(e,t){return t=void 0!==t?t:511,t&=1023,t|=16384,ot.mknod(e,t,0)},mkdirTree:function(e,t){for(var n=e.split("/"),r="",o=0;o<n.length;++o)if(n[o]){r+="/"+n[o];try{ot.mkdir(r,t)}catch(e){if(20!=e.errno)throw e}}},mkdev:function(e,t,n){return void 0===n&&(n=t,t=438),t|=8192,ot.mknod(e,t,n)},symlink:function(e,t){if(!tt.resolve(e))throw new ot.ErrnoError(44);var n=ot.lookupPath(t,{parent:!0}).node;if(!n)throw new ot.ErrnoError(44);var r=et.basename(t),o=ot.mayCreate(n,r);if(o)throw new ot.ErrnoError(o);if(!n.node_ops.symlink)throw new ot.ErrnoError(63);return n.node_ops.symlink(n,r,e)},rename:function(e,t){var n,r,o=et.dirname(e),i=et.dirname(t),a=et.basename(e),s=et.basename(t);if(n=ot.lookupPath(e,{parent:!0}).node,r=ot.lookupPath(t,{parent:!0}).node,!n||!r)throw new ot.ErrnoError(44);if(n.mount!==r.mount)throw new ot.ErrnoError(75);var l,u=ot.lookupNode(n,a),p=tt.relative(e,i);if("."!==p.charAt(0))throw new ot.ErrnoError(28);if("."!==(p=tt.relative(t,o)).charAt(0))throw new ot.ErrnoError(55);try{l=ot.lookupNode(r,s)}catch(e){}if(u!==l){var c=ot.isDir(u.mode),d=ot.mayDelete(n,a,c);if(d)throw new ot.ErrnoError(d);if(d=l?ot.mayDelete(r,s,c):ot.mayCreate(r,s))throw new ot.ErrnoError(d);if(!n.node_ops.rename)throw new ot.ErrnoError(63);if(ot.isMountpoint(u)||l&&ot.isMountpoint(l))throw new ot.ErrnoError(10);if(r!==n&&(d=ot.nodePermissions(n,"w")))throw new ot.ErrnoError(d);try{ot.trackingDelegate.willMovePath&&ot.trackingDelegate.willMovePath(e,t)}catch(n){x("FS.trackingDelegate['willMovePath']('"+e+"', '"+t+"') threw an exception: "+n.message)}ot.hashRemoveNode(u);try{n.node_ops.rename(u,r,s)}catch(e){throw e}finally{ot.hashAddNode(u)}try{ot.trackingDelegate.onMovePath&&ot.trackingDelegate.onMovePath(e,t)}catch(n){x("FS.trackingDelegate['onMovePath']('"+e+"', '"+t+"') threw an exception: "+n.message)}}},rmdir:function(e){var t=ot.lookupPath(e,{parent:!0}).node,n=et.basename(e),r=ot.lookupNode(t,n),o=ot.mayDelete(t,n,!0);if(o)throw new ot.ErrnoError(o);if(!t.node_ops.rmdir)throw new ot.ErrnoError(63);if(ot.isMountpoint(r))throw new ot.ErrnoError(10);try{ot.trackingDelegate.willDeletePath&&ot.trackingDelegate.willDeletePath(e)}catch(t){x("FS.trackingDelegate['willDeletePath']('"+e+"') threw an exception: "+t.message)}t.node_ops.rmdir(t,n),ot.destroyNode(r);try{ot.trackingDelegate.onDeletePath&&ot.trackingDelegate.onDeletePath(e)}catch(t){x("FS.trackingDelegate['onDeletePath']('"+e+"') threw an exception: "+t.message)}},readdir:function(e){var t=ot.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new ot.ErrnoError(54);return t.node_ops.readdir(t)},unlink:function(e){var t=ot.lookupPath(e,{parent:!0}).node,n=et.basename(e),r=ot.lookupNode(t,n),o=ot.mayDelete(t,n,!1);if(o)throw new ot.ErrnoError(o);if(!t.node_ops.unlink)throw new ot.ErrnoError(63);if(ot.isMountpoint(r))throw new ot.ErrnoError(10);try{ot.trackingDelegate.willDeletePath&&ot.trackingDelegate.willDeletePath(e)}catch(t){x("FS.trackingDelegate['willDeletePath']('"+e+"') threw an exception: "+t.message)}t.node_ops.unlink(t,n),ot.destroyNode(r);try{ot.trackingDelegate.onDeletePath&&ot.trackingDelegate.onDeletePath(e)}catch(t){x("FS.trackingDelegate['onDeletePath']('"+e+"') threw an exception: "+t.message)}},readlink:function(e){var t=ot.lookupPath(e).node;if(!t)throw new ot.ErrnoError(44);if(!t.node_ops.readlink)throw new ot.ErrnoError(28);return tt.resolve(ot.getPath(t.parent),t.node_ops.readlink(t))},stat:function(e,t){var n=ot.lookupPath(e,{follow:!t}).node;if(!n)throw new ot.ErrnoError(44);if(!n.node_ops.getattr)throw new ot.ErrnoError(63);return n.node_ops.getattr(n)},lstat:function(e){return ot.stat(e,!0)},chmod:function(e,t,n){var r;if(!(r="string"==typeof e?ot.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new ot.ErrnoError(63);r.node_ops.setattr(r,{mode:4095&t|-4096&r.mode,timestamp:Date.now()})},lchmod:function(e,t){ot.chmod(e,t,!0)},fchmod:function(e,t){var n=ot.getStream(e);if(!n)throw new ot.ErrnoError(8);ot.chmod(n.node,t)},chown:function(e,t,n,r){var o;if(!(o="string"==typeof e?ot.lookupPath(e,{follow:!r}).node:e).node_ops.setattr)throw new ot.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:function(e,t,n){ot.chown(e,t,n,!0)},fchown:function(e,t,n){var r=ot.getStream(e);if(!r)throw new ot.ErrnoError(8);
2ot.chown(r.node,t,n)},truncate:function(e,t){if(t<0)throw new ot.ErrnoError(28);var n;if(!(n="string"==typeof e?ot.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new ot.ErrnoError(63);if(ot.isDir(n.mode))throw new ot.ErrnoError(31);if(!ot.isFile(n.mode))throw new ot.ErrnoError(28);var r=ot.nodePermissions(n,"w");if(r)throw new ot.ErrnoError(r);n.node_ops.setattr(n,{size:t,timestamp:Date.now()})},ftruncate:function(e,t){var n=ot.getStream(e);if(!n)throw new ot.ErrnoError(8);if(!(2097155&n.flags))throw new ot.ErrnoError(28);ot.truncate(n.node,t)},utime:function(e,t,n){var r=ot.lookupPath(e,{follow:!0}).node;r.node_ops.setattr(r,{timestamp:Math.max(t,n)})},open:function(t,n,r,o,i){if(""===t)throw new ot.ErrnoError(44);var a;if(r=void 0===r?438:r,r=64&(n="string"==typeof n?ot.modeStringToFlags(n):n)?4095&r|32768:0,"object"==typeof t)a=t;else{t=et.normalize(t);try{a=ot.lookupPath(t,{follow:!(131072&n)}).node}catch(e){}}var s=!1;if(64&n)if(a){if(128&n)throw new ot.ErrnoError(20)}else a=ot.mknod(t,r,0),s=!0;if(!a)throw new ot.ErrnoError(44);if(ot.isChrdev(a.mode)&&(n&=-513),65536&n&&!ot.isDir(a.mode))throw new ot.ErrnoError(54);if(!s){var l=ot.mayOpen(a,n);if(l)throw new ot.ErrnoError(l)}512&n&&ot.truncate(a,0),n&=-131713;var u=ot.createStream({node:a,path:ot.getPath(a),flags:n,seekable:!0,position:0,stream_ops:a.stream_ops,ungotten:[],error:!1},o,i);u.stream_ops.open&&u.stream_ops.open(u),!e.logReadFiles||1&n||(ot.readFiles||(ot.readFiles={}),t in ot.readFiles||(ot.readFiles[t]=1,x("FS.trackingDelegate error on read file: "+t)));try{if(ot.trackingDelegate.onOpenFile){var p=0;1!=(2097155&n)&&(p|=ot.tracking.openFlags.READ),2097155&n&&(p|=ot.tracking.openFlags.WRITE),ot.trackingDelegate.onOpenFile(t,p)}}catch(e){x("FS.trackingDelegate['onOpenFile']('"+t+"', flags) threw an exception: "+e.message)}return u},close:function(e){if(ot.isClosed(e))throw new ot.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{ot.closeStream(e.fd)}e.fd=null},isClosed:function(e){return null===e.fd},llseek:function(e,t,n){if(ot.isClosed(e))throw new ot.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new ot.ErrnoError(70);if(0!=n&&1!=n&&2!=n)throw new ot.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,n),e.ungotten=[],e.position},read:function(e,t,n,r,o){if(r<0||o<0)throw new ot.ErrnoError(28);if(ot.isClosed(e))throw new ot.ErrnoError(8);if(1==(2097155&e.flags))throw new ot.ErrnoError(8);if(ot.isDir(e.node.mode))throw new ot.ErrnoError(31);if(!e.stream_ops.read)throw new ot.ErrnoError(28);var i=void 0!==o;if(i){if(!e.seekable)throw new ot.ErrnoError(70)}else o=e.position;var a=e.stream_ops.read(e,t,n,r,o);return i||(e.position+=a),a},write:function(e,t,n,r,o,i){if(r<0||o<0)throw new ot.ErrnoError(28);if(ot.isClosed(e))throw new ot.ErrnoError(8);if(!(2097155&e.flags))throw new ot.ErrnoError(8);if(ot.isDir(e.node.mode))throw new ot.ErrnoError(31);if(!e.stream_ops.write)throw new ot.ErrnoError(28);e.seekable&&1024&e.flags&&ot.llseek(e,0,2);var a=void 0!==o;if(a){if(!e.seekable)throw new ot.ErrnoError(70)}else o=e.position;var s=e.stream_ops.write(e,t,n,r,o,i);a||(e.position+=s);try{e.path&&ot.trackingDelegate.onWriteToFile&&ot.trackingDelegate.onWriteToFile(e.path)}catch(t){x("FS.trackingDelegate['onWriteToFile']('"+e.path+"') threw an exception: "+t.message)}return s},allocate:function(e,t,n){if(ot.isClosed(e))throw new ot.ErrnoError(8);if(t<0||n<=0)throw new ot.ErrnoError(28);if(!(2097155&e.flags))throw new ot.ErrnoError(8);if(!ot.isFile(e.node.mode)&&!ot.isDir(e.node.mode))throw new ot.ErrnoError(43);if(!e.stream_ops.allocate)throw new ot.ErrnoError(138);e.stream_ops.allocate(e,t,n)},mmap:function(e,t,n,r,o,i){if(2&o&&!(2&i)&&2!=(2097155&e.flags))throw new ot.ErrnoError(2);if(1==(2097155&e.flags))throw new ot.ErrnoError(2);if(!e.stream_ops.mmap)throw new ot.ErrnoError(43);return e.stream_ops.mmap(e,t,n,r,o,i)},msync:function(e,t,n,r,o){return e&&e.stream_ops.msync?e.stream_ops.msync(e,t,n,r,o):0},munmap:function(e){return 0},ioctl:function(e,t,n){if(!e.stream_ops.ioctl)throw new ot.ErrnoError(59);return e.stream_ops.ioctl(e,t,n)},readFile:function(e,t){if((t=t||{}).flags=t.flags||0,t.encoding=t.encoding||"binary","utf8"!==t.encoding&&"binary"!==t.encoding)throw new Error('Invalid encoding type "'+t.encoding+'"');var n,r=ot.open(e,t.flags),o=ot.stat(e).size,i=new Uint8Array(o);return ot.read(r,i,0,o,0),"utf8"===t.encoding?n=j(i,0):"binary"===t.encoding&&(n=i),ot.close(r),n},writeFile:function(e,t,n){(n=n||{}).flags=n.flags||577;var r=ot.open(e,n.flags,n.mode);if("string"==typeof t){var o=new Uint8Array(D(t)+1),i=C(t,o,0,o.length);ot.write(r,o,0,i,void 0,n.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");ot.write(r,t,0,t.byteLength,void 0,n.canOwn)}ot.close(r)},cwd:function(){return ot.currentPath},chdir:function(e){var t=ot.lookupPath(e,{follow:!0});if(null===t.node)throw new ot.ErrnoError(44);if(!ot.isDir(t.node.mode))throw new ot.ErrnoError(54);var n=ot.nodePermissions(t.node,"x");if(n)throw new ot.ErrnoError(n);ot.currentPath=t.path},createDefaultDirectories:function(){ot.mkdir("/tmp"),ot.mkdir("/home"),ot.mkdir("/home/web_user")},createDefaultDevices:function(){ot.mkdir("/dev"),ot.registerDevice(ot.makedev(1,3),{read:function(){return 0},write:function(e,t,n,r,o){return r}}),ot.mkdev("/dev/null",ot.makedev(1,3)),nt.register(ot.makedev(5,0),nt.default_tty_ops),nt.register(ot.makedev(6,0),nt.default_tty1_ops),ot.mkdev("/dev/tty",ot.makedev(5,0)),ot.mkdev("/dev/tty1",ot.makedev(6,0));var e=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var e=new Uint8Array(1);return function(){return crypto.getRandomValues(e),e[0]}}if(u)try{var t=n(Object(function(){var e=new Error("Cannot find module 'crypto'");throw e.code="MODULE_NOT_FOUND",e}()));return function(){return t.randomBytes(1)[0]}}catch(e){}return function(){de("randomDevice")}}();ot.createDevice("/dev","random",e),ot.createDevice("/dev","urandom",e),ot.mkdir("/dev/shm"),ot.mkdir("/dev/shm/tmp")},createSpecialDirectories:function(){ot.mkdir("/proc");var e=ot.mkdir("/proc/self");ot.mkdir("/proc/self/fd"),ot.mount({mount:function(){var t=ot.createNode(e,"fd",16895,73);return t.node_ops={lookup:function(e,t){var n=+t,r=ot.getStream(n);if(!r)throw new ot.ErrnoError(8);var o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:function(){return r.path}}};return o.parent=o,o}},t}},{},"/proc/self/fd")}
vendor: 4,872 bytes, line 2
2,createStandardStreams:function(){e.stdin?ot.createDevice("/dev","stdin",e.stdin):ot.symlink("/dev/tty","/dev/stdin"),e.stdout?ot.createDevice("/dev","stdout",null,e.stdout):ot.symlink("/dev/tty","/dev/stdout"),e.stderr?ot.createDevice("/dev","stderr",null,e.stderr):ot.symlink("/dev/tty1","/dev/stderr"),ot.open("/dev/stdin",0),ot.open("/dev/stdout",1),ot.open("/dev/stderr",1)},ensureErrnoError:function(){ot.ErrnoError||(ot.ErrnoError=function(e,t){this.node=t,this.setErrno=function(e){this.errno=e},this.setErrno(e),this.message="FS error"},ot.ErrnoError.prototype=new Error,ot.ErrnoError.prototype.constructor=ot.ErrnoError,[44].forEach(function(e){ot.genericErrors[e]=new ot.ErrnoError(e),ot.genericErrors[e].stack="<generic error, no stack>"}))},staticInit:function(){ot.ensureErrnoError(),ot.nameTable=new Array(4096),ot.mount(rt,{},"/"),ot.createDefaultDirectories(),ot.createDefaultDevices(),ot.createSpecialDirectories(),ot.filesystems={MEMFS:rt}},init:function(t,n,r){ot.init.initialized=!0,ot.ensureErrnoError(),e.stdin=t||e.stdin,e.stdout=n||e.stdout,e.stderr=r||e.stderr,ot.createStandardStreams()},quit:function(){ot.init.initialized=!1;var t=e._fflush;t&&t(0);for(var n=0;n<ot.streams.length;n++){var r=ot.streams[n];r&&ot.close(r)}},getMode:function(e,t){var n=0;return e&&(n|=365),t&&(n|=146),n},findObject:function(e,t){var n=ot.analyzePath(e,t);return n.exists?n.object:null},analyzePath:function(e,t){try{e=(r=ot.lookupPath(e,{follow:!t})).path}catch(e){}var n={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var r=ot.lookupPath(e,{parent:!0});n.parentExists=!0,n.parentPath=r.path,n.parentObject=r.node,n.name=et.basename(e),r=ot.lookupPath(e,{follow:!t}),n.exists=!0,n.path=r.path,n.object=r.node,n.name=r.node.name,n.isRoot="/"===r.path}catch(e){n.error=e.errno}return n},createPath:function(e,t,n,r){e="string"==typeof e?e:ot.getPath(e);for(var o=t.split("/").reverse();o.length;){var i=o.pop();if(i){var a=et.join2(e,i);try{ot.mkdir(a)}catch(e){}e=a}}return a},createFile:function(e,t,n,r,o){var i=et.join2("string"==typeof e?e:ot.getPath(e),t),a=ot.getMode(r,o);return ot.create(i,a)},createDataFile:function(e,t,n,r,o,i){var a=t?et.join2("string"==typeof e?e:ot.getPath(e),t):e,s=ot.getMode(r,o),l=ot.create(a,s);if(n){if("string"==typeof n){for(var u=new Array(n.length),p=0,c=n.length;p<c;++p)u[p]=n.charCodeAt(p);n=u}ot.chmod(l,146|s);var d=ot.open(l,577);ot.write(d,n,0,n.length,0,i),ot.close(d),ot.chmod(l,s)}return l},createDevice:function(e,t,n,r){var o=et.join2("string"==typeof e?e:ot.getPath(e),t),i=ot.getMode(!!n,!!r);ot.createDevice.major||(ot.createDevice.major=64);var a=ot.makedev(ot.createDevice.major++,0);return ot.registerDevice(a,{open:function(e){e.seekable=!1},close:function(e){r&&r.buffer&&r.buffer.length&&r(10)},read:function(e,t,r,o,i){for(var a=0,s=0;s<o;s++){var l;try{l=n()}catch(e){throw new ot.ErrnoError(29)}if(void 0===l&&0===a)throw new ot.ErrnoError(6);if(null==l)break;a++,t[r+s]=l}return a&&(e.node.timestamp=Date.now()),a},write:function(e,t,n,o,i){for(var a=0;a<o;a++)try{r(t[n+a])}catch(e){throw new ot.ErrnoError(29)}return o&&(e.node.timestamp=Date.now()),a}}),ot.mkdev(o,i,a)},forceLoadFile:function(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!f)throw new Error("Cannot load without read() or XMLHttpRequest.");try{e.contents=vt(f(e.url),!0),e.usedBytes=e.contents.length}catch(e){throw new ot.ErrnoError(29)}},createLazyFile:function(e,t,n,r,o){function i(){this.lengthKnown=!1,this.chunks=[]}if(i.prototype.get=function(e){if(!(e>this.length-1||e<0)){var t=e%this.chunkSize,n=e/this.chunkSize|0;return this.getter(n)[t]}},i.prototype.setDataGetter=function(e){this.getter=e},i.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",n,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+n+". Status: "+e.status);var t,r=Number(e.getResponseHeader("Content-length")),o=(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t,i=(t=e.getResponseHeader("Content-Encoding"))&&"gzip"===t,a=1048576;o||(a=r);var s=this;s.setDataGetter(function(e){var t=e*a,o=(e+1)*a-1;if(o=Math.min(o,r-1),void 0===s.chunks[e]&&(s.chunks[e]=function(e,t){if(e>t)throw new Error("invalid range ("+e+", "+t+") or no bytes requested!");if(t>r-1)throw new Error("only "+r+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",n,!1),r!==a&&o.setRequestHeader("Range","bytes="+e+"-"+t),"undefined"!=typeof Uint8Array&&(o.responseType="arraybuffer"),o.overrideMimeType&&o.overrideMimeType("text/plain;
2 charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn't load "+n+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):vt(o.responseText||"",!0)}(t,o)),void 0===s.chunks[e])throw new Error("doXHR failed!");return s.chunks[e]}),!i&&r||(a=r=1,r=this.getter(0).length,a=r,w("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=r,this._chunkSize=a,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!l)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var a=new i;Object.defineProperties(a,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var s={isDevice:!1,contents:a}}else s={isDevice:!1,url:n};var u=ot.createFile(e,t,s,r,o);s.contents?u.contents=s.contents:s.url&&(u.contents=null,u.url=s.url),Object.defineProperties(u,{usedBytes:{get:function(){return this.contents.length}}});var p={};return Object.keys(u.stream_ops).forEach(function(e){var t=u.stream_ops[e];p[e]=function(){return ot.forceLoadFile(u),t.apply(null,arguments)}}),p.read=function(e,t,n,r,o){ot.forceLoadFile(u);var i=e.node.contents;if(o>=i.length)return 0;var a=Math.min(i.length-o,r);if(i.slice)for(var s=0;s<a;s++)t[n+s]=i[o+s];else for(s=0;s<a;s++)t[n+s]=i.get(o+s);return a},u.stream_ops=p,u},createPreloadedFile:function(t,n,r,o,i,a,s,l,u,p){dt.init();var c=n?tt.resolve(et.join2(t,n)):t;function d(r){function d(e){p&&p(),l||ot.createDataFile(t,n,e,o,i,u),a&&a(),ce()}var h=!1;e.preloadPlugins.forEach(function(e){h||e.canHandle(c)&&(e.handle(r,c,d,function(){s&&s(),ce()}),h=!0)}),h||d(r)}pe(),"string"==typeof r?dt.asyncLoad(r,function(e){d(e)},s):d(r)},indexedDB:function(){return window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB},DB_NAME:function(){return"EM_FS_"+window.location.pathname},DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:function(e,t,n){t=t||function(){},n=n||function(){};var r=ot.indexedDB();try{var o=r.open(ot.DB_NAME(),ot.DB_VERSION)}catch(e){return n(e)}o.onupgradeneeded=function(){w("creating db"),o.result.createObjectStore(ot.DB_STORE_NAME)},o.onsuccess=function(){var r=o.result.transaction([ot.DB_STORE_NAME],"readwrite"),i=r.objectStore(ot.DB_STORE_NAME),a=0,s=0,l=e.length;function u(){0==s?t():n()}e.forEach(function(e){var t=i.put(ot.analyzePath(e).object.contents,e);t.onsuccess=function(){++a+s==l&&u()},t.onerror=function(){s++,a+s==l&&u()}}),r.onerror=n},o.onerror=n},loadFilesFromDB:function(e,t,n){t=t||function(){},n=n||function(){};var r=ot.indexedDB();try{var o=r.open(ot.DB_NAME(),ot.DB_VERSION)}catch(e){return n(e)}o.onupgradeneeded=n,o.onsuccess=function(){var r=o.result;try{var i=r.transaction([ot.DB_STORE_NAME],"readonly")}catch(e){return void n(e)}var a=i.objectStore(ot.DB_STORE_NAME),s=0,l=0,u=e.length;function p(){0==l?t():n()}e.forEach(function(e){var t=a.get(e);t.onsuccess=function(){ot.analyzePath(e).exists&&ot.unlink(e),ot.createDataFile(et.dirname(e),et.basename(e),t.result,!0,!0,!0),++s+l==u&&p()},t.onerror=function(){l++,s+l==u&&p()}}),i.onerror=n},o.onerror=n}},it={mappings:{},DEFAULT_POLLMASK:5,umask:511,calculateAt:function(e,t,n){if("/"===t[0])return t;var r;if(-100===e)r=ot.cwd();else{var o=ot.getStream(e);if(!o)throw new ot.ErrnoError(8);r=o.path}if(0==t.length){if(!n)throw new ot.ErrnoError(44);return r}return et.join2(r,t)},doStat:function(e,t,n){try{var r=e(t)}catch(e){if(e&&e.node&&et.normalize(t)!==et.normalize(ot.getPath(e.node)))return-54;throw e}return W[n>>2]=r.dev,W[n+4>>2]=0,W[n+8>>2]=r.ino,W[n+12>>2]=r.mode,W[n+16>>2]=r.nlink,W[n+20>>2]=r.uid,W[n+24>>2]=r.gid,W[n+28>>2]=r.rdev,W[n+32>>2]=0,be=[r.size>>>0,(ye=r.size,+Math.abs(ye)>=1?ye>0?(0|Math.min(+Math.floor(ye/4294967296),4294967295))>>>0:~~+Math.ceil((ye-+(~~ye>>>0))/4294967296)>>>0:0)],W[n+40>>2]=be[0],W[n+44>>2]=be[1],W[n+48>>2]=4096,W[n+52>>2]=r.blocks,W[n+56>>2]=r.atime.getTime()/1e3|0,W[n+60>>2]=0,W[n+64>>2]=r.mtime.getTime()/1e3|0,W[n+68>>2]=0,W[n+72>>2]=r.ctime.getTime()/1e3|0,W[n+76>>2]=0,be=[r.ino>>>0,(ye=r.ino,+Math.abs(ye)>=1?ye>0?(0|Math.min(+Math.floor(ye/4294967296),4294967295))>>>0:~~+Math.ceil((ye-+(~~ye>>>0))/4294967296)>>>0:0)],W[n+80>>2]=be[0],W[n+84>>2]=be[1],0},doMsync:function(e,t,n,r,o){var i=B.slice(e,e+n);ot.msync(t,i,o,n,r)},doMkdir:function(e,t){return"/"===(e=et.normalize(e))[e.length-1]&&(e=e.substr(0,e.length-1)),ot.mkdir(e,t,0),0},doMknod:function(e,t,n){switch(61440&t){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}return ot.mknod(e,t,n),0},doReadlink:function(e,t,n){if(n<=0)return-28;var r=ot.readlink(e),o=Math.min(n,D(r)),i=R[t+o];return M(r,t,n+1),R[t+o]=i,o},doAccess:function(e,t){if(-8&t)return-28;var n;if(!(n=ot.lookupPath(e,{follow:!0}).node))return-44;var r="";return 4&t&&(r+="r"),2&t&&(r+="w"),1&t&&(r+="x"),r&&ot.nodePermissions(n,r)?-2:0},doDup:function(e,t,n){var r=ot.getStream(n);return r&&ot.close(r),ot.open(e,t,0,n,n).fd},doReadv:function(e,t,n,r){for(var o=0,i=0;i<n;i++){var a=W[t+8*i>>2],s=W[t+(8*i+4)>>2],l=ot.read(e,R,a,s,r);if(l<0)return-1;if(o+=l,l<s)break}return o},doWritev:function(e,t,n,r){for(var o=0,i=0;i<n;i++){var a=W[t+8*i>>2],s=W[t+(8*i+4)>>2],l=ot.write(e,R,a,s,r);if(l<0)return-1;o+=l}return o},varargs:void 0,get:function(){return it.varargs+=4,W[it.varargs-4>>2]},getStr:function(e){return A(e)},getStreamFromFD:function(e){var t=ot.getStream(e);if(!t)throw new ot.ErrnoError(8);return t},get64:function(e,t){return e}},at={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],uniforms:[],shaders:[],vaos:[],contexts:[],offscreenCanvases:{},timerQueriesEXT:[],byteSizeByTypeRoot:5120,byteSizeByType:[1,1,2,2,4,4,4,2,3,4,8],programInfos:{},stringCache:{},unpackAlignment:4,recordError:function(e){at.lastError||(at.lastError=e)},getNewId:function(e){for(var t=at.counter++,n=e.length;n<t;n++)e[n]=null;return t},MAX_TEMP_BUFFER_SIZE:2097152,numTempVertexBuffersPerSize:64,log2ceilLookup:function(e){return 32-Math.clz32(0===e?0:e-1)},generateTempBuffers:function(e,t){var n=at.log2ceilLookup(at.MAX_TEMP_BUFFER_SIZE);t.tempVertexBufferCounters1=[],t.tempVertexBufferCounters2=[],t.tempVertexBufferCounters1.length=t.tempVertexBufferCounters2.length=n+1,t.tempVertexBuffers1=[],t.tempVertexBuffers2=[],t.tempVertexBuffers1.length=t.tempVertexBuffers2.length=n+1,t.tempIndexBuffers=[],t.tempIndexBuffers.length=n+1;for(var r=0;r<=n;++r){t.tempIndexBuffers[r]=null,t.tempVertexBufferCounters1[r]=t.tempVertexBufferCounters2[r]=0;var o=at.numTempVertexBuffersPerSize;t.tempVertexBuffers1[r]=[],t.tempVertexBuffers2[r]=[];var i=t.tempVertexBuffers1[r],a=t.tempVertexBuffers2[r];i.length=a.length=o;for(var s=0;s<o;++s)i[s]=a[s]=null}if(e){t.tempQuadIndexBuffer=_t.createBuffer(),t.GLctx.bindBuffer(34963,t.tempQuadIndexBuffer);for(var l=at.MAX_TEMP_BUFFER_SIZE>>1,u=new Uint16Array(l),p=(r=0,0);u[r++]=p,!(r>=l||(u[r++]=p+1,r>=l)||(u[r++]=p+2,r>=l)||(u[r++]=p,r>=l)||(u[r++]=p+2,r>=l)||(u[r++]=p+3,r>=l));)p+=4;t.GLctx.bufferData(34963,u,35044),t.GLctx.bindBuffer(34963,null)}},getTempVertexBuffer:function(e){var t=at.log2ceilLookup(e),n=at.currentContext.tempVertexBuffers1[t],r=at.currentContext.tempVertexBufferCounters1[t];at.currentContext.tempVertexBufferCounters1[t]=at.currentContext.tempVertexBufferCounters1[t]+1&at.numTempVertexBuffersPerSize-1;var o=n[r];if(o)return o;var i=_t.getParameter(34964);return n[r]=_t.createBuffer(),_t.bindBuffer(34962,n[r]),_t.bufferData(34962,1<<t,35048),_t.bindBuffer(34962,i),n[r]},getTempIndexBuffer:function(e){var t=at.log2ceilLookup(e),n=at.currentContext.tempIndexBuffers[t];if(n)return n;var r=_t.getParameter(34965);return at.currentContext.tempIndexBuffers[t]=_t.createBuffer(),_t.bindBuffer(34963,at.currentContext.tempIndexBuffers[t]),_t.bufferData(34963,1<<t,35048),_t.bindBuffer(34963,r),at.currentContext.tempIndexBuffers[t]},newRenderingFrameStarted:function(){if(at.currentContext){var e=at.currentContext.tempVertexBuffers1;at.currentContext.tempVertexBuffers1=at.currentContext.tempVertexBuffers2,at.currentContext.tempVertexBuffers2=e,e=at.currentContext.tempVertexBufferCounters1,at.currentContext.tempVertexBufferCounters1=at.currentContext.tempVertexBufferCounters2,at.currentContext.tempVertexBufferCounters2=e;for(var t=at.log2ceilLookup(at.MAX_TEMP_BUFFER_SIZE),n=0;n<=t;++n)at.currentContext.tempVertexBufferCounters1[n]=0}},getSource:function(e,t,n,r){for(var o="",i=0;i<t;++i){var a=r?W[r+4*i>>2]:-1;o+=A(W[n+4*i>>2],a<0?void 0:a)}return o},calcBufLength:function(e,t,n,r){return n>
20?r*n:e*at.byteSizeByType[t-at.byteSizeByTypeRoot]*r},usedTempBuffers:[],preDrawHandleClientVertexAttribBindings:function(e){at.resetBufferBinding=!1;for(var t=0;t<at.currentContext.maxVertexAttribs;++t){var n=at.currentContext.clientBuffers[t];if(n.clientside&&n.enabled){at.resetBufferBinding=!0;var r=at.calcBufLength(n.size,n.type,n.stride,e),o=at.getTempVertexBuffer(r);_t.bindBuffer(34962,o),_t.bufferSubData(34962,0,B.subarray(n.ptr,n.ptr+r)),n.vertexAttribPointerAdaptor.call(_t,t,n.size,n.type,n.normalized,n.stride,0)}}},postDrawHandleClientVertexAttribBindings:function(){at.resetBufferBinding&&_t.bindBuffer(34962,at.buffers[_t.currentArrayBufferBinding])},createContext:function(e,t){var n=e.getContext("webgl",t);return n?at.registerContext(n,t):0},registerContext:function(e,t){var n=at.getNewId(at.contexts),r={handle:n,attributes:t,version:t.majorVersion,GLctx:e};e.canvas&&(e.canvas.GLctxObject=r),at.contexts[n]=r,(void 0===t.enableExtensionsByDefault||t.enableExtensionsByDefault)&&at.initExtensions(r),r.maxVertexAttribs=r.GLctx.getParameter(34921),r.clientBuffers=[];for(var o=0;o<r.maxVertexAttribs;o++)r.clientBuffers[o]={enabled:!1,clientside:!1,size:0,type:0,normalized:0,stride:0,ptr:0,vertexAttribPointerAdaptor:null};return at.generateTempBuffers(!1,r),n},makeContextCurrent:function(t){return at.currentContext=at.contexts[t],e.ctx=_t=at.currentContext&&at.currentContext.GLctx,!(t&&!_t)},getContext:function(e){return at.contexts[e]},deleteContext:function(e){at.currentContext===at.contexts[e]&&(at.currentContext=null),"object"==typeof JSEvents&&JSEvents.removeAllHandlersOnTarget(at.contexts[e].GLctx.canvas),at.contexts[e]&&at.contexts[e].GLctx.canvas&&(at.contexts[e].GLctx.canvas.GLctxObject=void 0),at.contexts[e]=null},initExtensions:function(e){if(e||(e=at.currentContext),!e.initExtensionsDone){e.initExtensionsDone=!0;var t,n=e.GLctx;!function(e){var t=e.getExtension("ANGLE_instanced_arrays");t&&(e.vertexAttribDivisor=function(e,n){t.vertexAttribDivisorANGLE(e,n)},e.drawArraysInstanced=function(e,n,r,o){t.drawArraysInstancedANGLE(e,n,r,o)},e.drawElementsInstanced=function(e,n,r,o,i){t.drawElementsInstancedANGLE(e,n,r,o,i)})}(n),function(e){var t=e.getExtension("OES_vertex_array_object");t&&(e.createVertexArray=function(){return t.createVertexArrayOES()},e.deleteVertexArray=function(e){t.deleteVertexArrayOES(e)},e.bindVertexArray=function(e){t.bindVertexArrayOES(e)},e.isVertexArray=function(e){return t.isVertexArrayOES(e)})}(n),function(e){var t=e.getExtension("WEBGL_draw_buffers");t&&(e.drawBuffers=function(e,n){t.drawBuffersWEBGL(e,n)})}(n),n.disjointTimerQueryExt=n.getExtension("EXT_disjoint_timer_query"),(t=n).multiDrawWebgl=t.getExtension("WEBGL_multi_draw"),(n.getSupportedExtensions()||[]).forEach(function(e){e.indexOf("lose_context")<0&&e.indexOf("debug")<0&&n.getExtension(e)})}},populateUniformTable:function(e){for(var t=at.programs[e],n=at.programInfos[e]={uniforms:{},maxUniformLength:0,maxAttributeLength:-1,maxUniformBlockNameLength:-1},r=n.uniforms,o=_t.getProgramParameter(t,35718),i=0;i<o;++i){var a=_t.getActiveUniform(t,i),s=a.name;n.maxUniformLength=Math.max(n.maxUniformLength,s.length+1),"]"==s.slice(-1)&&(s=s.slice(0,s.lastIndexOf("[")));var l=_t.getUniformLocation(t,s);if(l){var u=at.getNewId(at.uniforms);r[s]=[a.size,u],at.uniforms[u]=l;for(var p=1;p<a.size;++p){var c=s+"["+p+"]";l=_t.getUniformLocation(t,c),u=at.getNewId(at.uniforms),at.uniforms[u]=l}}}}};function st(e,t,n,r){for(var o=0;o<e;o++){var i=_t[n](),a=i&&at.getNewId(r);i?(i.name=a,r[a]=i):at.recordError(1282),W[t+4*o>>2]=a}}function lt(e,t,n,r,o,i){var a=function(e){return 1==(e-=5120)?B:4==e?W:6==e?z:5==e||28922==e?U:L}(e),s=function(e){return 31-Math.clz32(e.BYTES_PER_ELEMENT)}(a),l=1<<s,u=function(e){return{5:3,6:4,8:2,29502:3,29504:4}[e-6402]||1}(t)*l,p=function(e,t,n,r){var o;return t*(e*n+(o=r)-1&-o)}(n,r,u,at.unpackAlignment);return a.subarray(o>>s,o+p>>s)}var ut,pt=[];function ct(t,n){if(dt.mainLoop.timingMode=t,dt.mainLoop.timingValue=n,!dt.mainLoop.func)return 1;if(0==t)dt.mainLoop.scheduler=function(){var e=0|Math.max(0,dt.mainLoop.tickStartTime+n-ut());setTimeout(dt.mainLoop.runner,e)},dt.mainLoop.method="timeout";
2else if(1==t)dt.mainLoop.scheduler=function(){dt.requestAnimationFrame(dt.mainLoop.runner)},dt.mainLoop.method="rAF";else if(2==t){if("undefined"==typeof setImmediate){var r=[],o="setimmediate";addEventListener("message",function(e){e.data!==o&&e.data.target!==o||(e.stopPropagation(),r.shift()())},!0),setImmediate=function(t){r.push(t),l?(void 0===e.setImmediates&&(e.setImmediates=[]),e.setImmediates.push(t),postMessage({target:o})):postMessage(o,"*")}}dt.mainLoop.scheduler=function(){setImmediate(dt.mainLoop.runner)},dt.mainLoop.method="immediate"}return 0}ut=u?function(){var e=process.hrtime();return 1e3*e[0]+e[1]/1e6}:"undefined"!=typeof dateNow?dateNow:function(){return performance.now()};var dt={mainLoop:{scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],pause:function(){dt.mainLoop.scheduler=null,dt.mainLoop.currentlyRunningMainloop++},resume:function(){dt.mainLoop.currentlyRunningMainloop++;var e=dt.mainLoop.timingMode,t=dt.mainLoop.timingValue,n=dt.mainLoop.func;dt.mainLoop.func=null,function(e,t,n,r){k=!0,T(!dt.mainLoop.func,"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters."),dt.mainLoop.func=e,dt.mainLoop.arg=r;var o=dt.mainLoop.currentlyRunningMainloop;dt.mainLoop.runner=function(){if(!I)if(dt.mainLoop.queue.length>0){var t=Date.now(),n=dt.mainLoop.queue.shift();if(n.func(n.arg),dt.mainLoop.remainingBlockers){var r=dt.mainLoop.remainingBlockers,i=r%1==0?r-1:Math.floor(r);n.counted?dt.mainLoop.remainingBlockers=i:(i+=.5,dt.mainLoop.remainingBlockers=(8*r+i)/9)}if(console.log('main loop blocker "'+n.name+'" took '+(Date.now()-t)+" ms"),dt.mainLoop.updateStatus(),o<dt.mainLoop.currentlyRunningMainloop)return;setTimeout(dt.mainLoop.runner,0)}else o<dt.mainLoop.currentlyRunningMainloop||(dt.mainLoop.currentFrameNumber=dt.mainLoop.currentFrameNumber+1|0,1==dt.mainLoop.timingMode&&dt.mainLoop.timingValue>1&&dt.mainLoop.currentFrameNumber%dt.mainLoop.timingValue!=0?dt.mainLoop.scheduler():(0==dt.mainLoop.timingMode&&(dt.mainLoop.tickStartTime=ut()),at.newRenderingFrameStarted(),dt.mainLoop.runIter(e),o<dt.mainLoop.currentlyRunningMainloop||("object"==typeof SDL&&SDL.audio&&SDL.audio.queueNewAudioData&&SDL.audio.queueNewAudioData(),dt.mainLoop.scheduler())))}}(n,0,0,dt.mainLoop.arg),ct(e,t),dt.mainLoop.scheduler()},updateStatus:function(){if(e.setStatus){var t=e.statusMessage||"Please wait...",n=dt.mainLoop.remainingBlockers,r=dt.mainLoop.expectedBlockers;n?n<r?e.setStatus(t+" ("+(r-n)+"/"+r+")"):e.setStatus(t):e.setStatus("")}},runIter:function(t){if(!I){if(e.preMainLoop&&!1===e.preMainLoop())return;try{t()}catch(e){if(e instanceof At)return;if("unwind"==e)return;throw e&&"object"==typeof e&&e.stack&&x("exception thrown: "+[e,e.stack]),e}e.postMainLoop&&e.postMainLoop()}}},isFullscreen:!1,pointerLock:!1,moduleContextCreatedCallbacks:[],workers:[],init:function(){if(e.preloadPlugins||(e.preloadPlugins=[]),!dt.initted){dt.initted=!0;try{new Blob,dt.hasBlobConstructor=!0}catch(e){dt.hasBlobConstructor=!1,console.log("warning: no blob constructor, cannot create blobs with mimetypes")}dt.BlobBuilder="undefined"!=typeof MozBlobBuilder?MozBlobBuilder:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:dt.hasBlobConstructor?null:console.log("warning: no BlobBuilder"),dt.URLObject="undefined"!=typeof window?window.URL?window.URL:window.webkitURL:void 0,e.noImageDecoding||void 0!==dt.URLObject||(console.log("warning: Browser does not support creating object URLs. Built-in browser image decoding will not be available."),e.noImageDecoding=!0);var t={canHandle:function(t){return!e.noImageDecoding&&/\.(jpg|jpeg|png|bmp)$/i.test(t)},handle:function(t,n,r,o){var i=null;if(dt.hasBlobConstructor)try{(i=new Blob([t],{type:dt.getMimetype(n)})).size!==t.length&&(i=new Blob([new Uint8Array(t).buffer],{type:dt.getMimetype(n)}))}catch(e){S("Blob constructor present but fails: "+e+"; falling back to blob builder")}if(!i){var a=new dt.BlobBuilder;a.append(new Uint8Array(t).buffer),i=a.getBlob()}var s=dt.URLObject.createObjectURL(i),l=new Image;l.onload=function(){T(l.complete,"Image "+n+" could not be decoded");var o=document.createElement("canvas");o.width=l.width,o.height=l.height,o.getContext("2d").drawImage(l,0,0),e.preloadedImages[n]=o,dt.URLObject.revokeObjectURL(s),r&&r(t)},l.onerror=function(e){console.log("Image "+s+" could not be decoded"),o&&o()},l.src=s}};e.preloadPlugins.push(t);var n={canHandle:function(t){return!e.noAudioDecoding&&t.substr(-4)in{".ogg":1,".wav":1,".mp3":1}},handle:function(t,n,r,o){var i=!1;function a(o){i||(i=!0,e.preloadedAudios[n]=o,r&&r(t))}function s(){i||(i=!0,e.preloadedAudios[n]=new Audio,o&&o())}if(!dt.hasBlobConstructor)return s();try{var l=new Blob([t],{type:dt.getMimetype(n)})}catch(e){return s()}var u=dt.URLObject.createObjectURL(l),p=new Audio;p.addEventListener("canplaythrough",function(){a(p)},!1),p.onerror=function(e){i||(console.log("warning: browser could not fully decode audio "+n+", trying slower base64 approach"),p.src="data:audio/x-"+n.substr(-3)+";base64,"+function(e){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
vendor: 6,372 bytes, line 2
2+/",n="",r=0,o=0,i=0;i<e.length;i++)for(r=r<<8|e[i],o+=8;o>=6;){var a=r>>o-6&63;o-=6,n+=t[a]}return 2==o?(n+=t[(3&r)<<4],n+="=="):4==o&&(n+=t[(15&r)<<2],n+="="),n}(t),a(p))},p.src=u,dt.safeSetTimeout(function(){a(p)},1e4)}};e.preloadPlugins.push(n);var r=e.canvas;r&&(r.requestPointerLock=r.requestPointerLock||r.mozRequestPointerLock||r.webkitRequestPointerLock||r.msRequestPointerLock||function(){},r.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||function(){},r.exitPointerLock=r.exitPointerLock.bind(document),document.addEventListener("pointerlockchange",o,!1),document.addEventListener("mozpointerlockchange",o,!1),document.addEventListener("webkitpointerlockchange",o,!1),document.addEventListener("mspointerlockchange",o,!1),e.elementPointerLock&&r.addEventListener("click",function(t){!dt.pointerLock&&e.canvas.requestPointerLock&&(e.canvas.requestPointerLock(),t.preventDefault())},!1))}function o(){dt.pointerLock=document.pointerLockElement===e.canvas||document.mozPointerLockElement===e.canvas||document.webkitPointerLockElement===e.canvas||document.msPointerLockElement===e.canvas}},createContext:function(t,n,r,o){if(n&&e.ctx&&t==e.canvas)return e.ctx;var i,a;if(n){var s={antialias:!1,alpha:!1,majorVersion:1};if(o)for(var l in o)s[l]=o[l];void 0!==at&&(a=at.createContext(t,s))&&(i=at.getContext(a).GLctx)}else i=t.getContext("2d");return i?(r&&(n||T(void 0===_t,"cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),e.ctx=i,n&&at.makeContextCurrent(a),e.useWebGL=n,dt.moduleContextCreatedCallbacks.forEach(function(e){e()}),dt.init()),i):null},destroyContext:function(e,t,n){},fullscreenHandlersInstalled:!1,lockPointer:void 0,resizeCanvas:void 0,requestFullscreen:function(t,n){dt.lockPointer=t,dt.resizeCanvas=n,void 0===dt.lockPointer&&(dt.lockPointer=!0),void 0===dt.resizeCanvas&&(dt.resizeCanvas=!1);var r=e.canvas;function o(){dt.isFullscreen=!1;var t=r.parentNode;(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===t?(r.exitFullscreen=dt.exitFullscreen,dt.lockPointer&&r.requestPointerLock(),dt.isFullscreen=!0,dt.resizeCanvas?dt.setFullscreenCanvasSize():dt.updateCanvasDimensions(r)):(t.parentNode.insertBefore(r,t),t.parentNode.removeChild(t),dt.resizeCanvas?dt.setWindowedCanvasSize():dt.updateCanvasDimensions(r)),e.onFullScreen&&e.onFullScreen(dt.isFullscreen),e.onFullscreen&&e.onFullscreen(dt.isFullscreen)}dt.fullscreenHandlersInstalled||(dt.fullscreenHandlersInstalled=!0,document.addEventListener("fullscreenchange",o,!1),document.addEventListener("mozfullscreenchange",o,!1),document.addEventListener("webkitfullscreenchange",o,!1),document.addEventListener("MSFullscreenChange",o,!1));var i=document.createElement("div");r.parentNode.insertBefore(i,r),i.appendChild(r),i.requestFullscreen=i.requestFullscreen||i.mozRequestFullScreen||i.msRequestFullscreen||(i.webkitRequestFullscreen?function(){i.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)}:null)||(i.webkitRequestFullScreen?function(){i.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)}:null),i.requestFullscreen()},exitFullscreen:function(){return!!dt.isFullscreen&&((document.exitFullscreen||document.cancelFullScreen||document.mozCancelFullScreen||document.msExitFullscreen||document.webkitCancelFullScreen||function(){}).apply(document,[]),!0)},nextRAF:0,fakeRequestAnimationFrame:function(e){var t=Date.now();if(0===dt.nextRAF)dt.nextRAF=t+1e3/60;else for(;t+2>=dt.nextRAF;)dt.nextRAF+=1e3/60;var n=Math.max(dt.nextRAF-t,0);setTimeout(e,n)},requestAnimationFrame:function(e){"function"!=typeof requestAnimationFrame?(0,dt.fakeRequestAnimationFrame)(e):requestAnimationFrame(e)},safeRequestAnimationFrame:function(e){return dt.requestAnimationFrame(function(){I||e()})},safeSetTimeout:function(e,t){return k=!0,setTimeout(function(){I||e()},t)},getMimetype:function(e){return{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",bmp:"image/bmp",ogg:"audio/ogg",wav:"audio/wav",mp3:"audio/mpeg"}[e.substr(e.lastIndexOf(".")+1)]},getUserMedia:function(e){window.getUserMedia||(window.getUserMedia=navigator.getUserMedia||navigator.mozGetUserMedia),window.getUserMedia(e)},getMovementX:function(e){return e.movementX||e.mozMovementX||e.webkitMovementX||0},getMovementY:function(e){return e.movementY||e.mozMovementY||e.webkitMovementY||0},getMouseWheelDelta:function(e){var t=0;switch(e.type){case"DOMMouseScroll":t=e.detail/3;break;case"mousewheel":t=e.wheelDelta/120;break;case"wheel":switch(t=e.deltaY,e.deltaMode){case 0:t/=100;break;case 1:t/=3;break;case 2:t*=80;break;default:throw"unrecognized mouse wheel delta mode: "+e.deltaMode}break;default:throw"unrecognized mouse wheel event: "+e.type}return t},mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,touches:{},lastTouches:{},calculateMouseEvent:function(t){if(dt.pointerLock)"mousemove"!=t.type&&"mozMovementX"in t?dt.mouseMovementX=dt.mouseMovementY=0:(dt.mouseMovementX=dt.getMovementX(t),dt.mouseMovementY=dt.getMovementY(t)),"undefined"!=typeof SDL?(dt.mouseX=SDL.mouseX+dt.mouseMovementX,dt.mouseY=SDL.mouseY+dt.mouseMovementY):(dt.mouseX+=dt.mouseMovementX,dt.mouseY+=dt.mouseMovementY);else{var n=e.canvas.getBoundingClientRect(),r=e.canvas.width,o=e.canvas.height,i=void 0!==window.scrollX?window.scrollX:window.pageXOffset,a=void 0!==window.scrollY?window.scrollY:window.pageYOffset;if("touchstart"===t.type||"touchend"===t.type||"touchmove"===t.type){var s=t.touch;if(void 0===s)return;var l=s.pageX-(i+n.left),u=s.pageY-(a+n.top),p={x:l*=r/n.width,y:u*=o/n.height};if("touchstart"===t.type)dt.lastTouches[s.identifier]=p,dt.touches[s.identifier]=p;else if("touchend"===t.type||"touchmove"===t.type){var c=dt.touches[s.identifier];c||(c=p),dt.lastTouches[s.identifier]=c,dt.touches[s.identifier]=p}return}var d=t.pageX-(i+n.left),h=t.pageY-(a+n.top);d*=r/n.width,h*=o/n.height,dt.mouseMovementX=d-dt.mouseX,dt.mouseMovementY=h-dt.mouseY,dt.mouseX=d,dt.mouseY=h}},asyncLoad:function(e,t,n,r){var o=r?"":"al "+e;g(e,function(n){T(n,'Loading data file "'+e+'" failed (no arrayBuffer).'),t(new Uint8Array(n)),o&&ce()},function(t){if(!n)throw'Loading data file "'+e+'" failed.';n()}),o&&pe()},resizeListeners:[],updateResizeListeners:function(){var t=e.canvas;
2dt.resizeListeners.forEach(function(e){e(t.width,t.height)})},setCanvasSize:function(t,n,r){var o=e.canvas;dt.updateCanvasDimensions(o,t,n),r||dt.updateResizeListeners()},windowedWidth:0,windowedHeight:0,setFullscreenCanvasSize:function(){if("undefined"!=typeof SDL){var t=U[SDL.screen>>2];t|=8388608,W[SDL.screen>>2]=t}dt.updateCanvasDimensions(e.canvas),dt.updateResizeListeners()},setWindowedCanvasSize:function(){if("undefined"!=typeof SDL){var t=U[SDL.screen>>2];t&=-8388609,W[SDL.screen>>2]=t}dt.updateCanvasDimensions(e.canvas),dt.updateResizeListeners()},updateCanvasDimensions:function(t,n,r){n&&r?(t.widthNative=n,t.heightNative=r):(n=t.widthNative,r=t.heightNative);var o=n,i=r;if(e.forcedAspectRatio&&e.forcedAspectRatio>0&&(o/i<e.forcedAspectRatio?o=Math.round(i*e.forcedAspectRatio):i=Math.round(o/e.forcedAspectRatio)),(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===t.parentNode&&"undefined"!=typeof screen){var a=Math.min(screen.width/o,screen.height/i);o=Math.round(o*a),i=Math.round(i*a)}dt.resizeCanvas?(t.width!=o&&(t.width=o),t.height!=i&&(t.height=i),void 0!==t.style&&(t.style.removeProperty("width"),t.style.removeProperty("height"))):(t.width!=n&&(t.width=n),t.height!=r&&(t.height=r),void 0!==t.style&&(o!=n||i!=r?(t.style.setProperty("width",o+"px","important"),t.style.setProperty("height",i+"px","important")):(t.style.removeProperty("width"),t.style.removeProperty("height"))))},wgetRequests:{},nextWgetRequestHandle:0,getNextWgetRequestHandle:function(){var e=dt.nextWgetRequestHandle;return dt.nextWgetRequestHandle++,e}};function ht(e,t,n,r,o,i){this.id=e,this.x=0,this.y=0,this.fullscreen=!1,this.storedX=0,this.storedY=0,this.width=t,this.height=n,this.storedWidth=t,this.storedHeight=n,this.title=r,this.monitor=o,this.share=i,this.attributes=ft.hints,this.inputModes={208897:212993,208898:0,208899:0},this.buttons=0,this.keys=new Array,this.domKeys=new Array,this.shouldClose=0,this.title=null,this.windowPosFunc=null,this.windowSizeFunc=null,this.windowCloseFunc=null,this.windowRefreshFunc=null,this.windowFocusFunc=null,this.windowIconifyFunc=null,this.framebufferSizeFunc=null,this.mouseButtonFunc=null,this.cursorPosFunc=null,this.cursorEnterFunc=null,this.scrollFunc=null,this.dropFunc=null,this.keyFunc=null,this.charFunc=null,this.userptr=null}var ft={WindowFromId:function(e){return e<=0||!ft.windows?null:ft.windows[e-1]},joystickFunc:null,errorFunc:null,monitorFunc:null,active:null,windows:null,monitors:null,monitorString:null,versionString:null,initialTime:null,extensions:null,hints:null,defaultHints:{131073:0,131074:0,131075:1,131076:1,131077:1,135169:8,135170:8,135171:8,135172:8,135173:24,135174:8,135175:0,135176:0,135177:0,135178:0,135179:0,135180:0,135181:0,135182:0,135183:0,139265:196609,139266:1,139267:0,139268:0,139269:0,139270:0,139271:0,139272:0},DOMToGLFWKeyCode:function(e){switch(e){case 32:return 32;case 222:return 39;case 188:return 44;case 173:case 189:return 45;case 190:return 46;case 191:return 47;case 48:return 48;case 49:return 49;case 50:return 50;case 51:return 51;case 52:return 52;case 53:return 53;case 54:return 54;case 55:return 55;case 56:return 56;case 57:return 57;case 59:return 59;case 61:case 187:return 61;case 65:return 65;case 66:return 66;case 67:return 67;case 68:return 68;case 69:return 69;case 70:return 70;case 71:return 71;case 72:return 72;case 73:return 73;case 74:return 74;case 75:return 75;case 76:return 76;case 77:return 77;case 78:return 78;case 79:return 79;case 80:return 80;case 81:return 81;case 82:return 82;case 83:return 83;case 84:return 84;case 85:return 85;case 86:return 86;case 87:return 87;case 88:return 88;case 89:return 89;case 90:return 90;case 219:return 91;case 220:return 92;case 221:return 93;case 192:return 94;case 27:return 256;case 13:return 257;case 9:return 258;case 8:return 259;case 45:return 260;case 46:return 261;case 39:return 262;case 37:return 263;case 40:return 264;case 38:return 265;case 33:return 266;case 34:return 267;case 36:return 268;case 35:return 269;case 20:return 280;case 145:return 281;case 144:return 282;case 44:return 283;case 19:return 284;case 112:return 290;case 113:return 291;case 114:return 292;case 115:return 293;case 116:return 294;case 117:return 295;case 118:return 296;case 119:return 297;case 120:return 298;case 121:return 299;case 122:return 300;case 123:return 301;case 124:return 302;case 125:return 303;
2case 126:return 304;case 127:return 305;case 128:return 306;case 129:return 307;case 130:return 308;case 131:return 309;case 132:return 310;case 133:return 311;case 134:return 312;case 135:return 313;case 136:return 314;case 96:return 320;case 97:return 321;case 98:return 322;case 99:return 323;case 100:return 324;case 101:return 325;case 102:return 326;case 103:return 327;case 104:return 328;case 105:return 329;case 110:return 330;case 111:return 331;case 106:return 332;case 109:return 333;case 107:return 334;case 16:return 340;case 17:return 341;case 18:return 342;case 91:return 343;case 93:return 348;default:return-1}},getModBits:function(e){var t=0;return e.keys[340]&&(t|=1),e.keys[341]&&(t|=2),e.keys[342]&&(t|=4),e.keys[343]&&(t|=8),t},onKeyPress:function(e){if(ft.active&&ft.active.charFunc&&!e.ctrlKey&&!e.metaKey){var t=e.charCode;0==t||t>=0&&t<=31||ee.get(ft.active.charFunc)(ft.active.id,t)}},onKeyChanged:function(e,t){if(ft.active){var n=ft.DOMToGLFWKeyCode(e);if(-1!=n){var r=t&&ft.active.keys[n];ft.active.keys[n]=t,ft.active.domKeys[e]=t,ft.active.keyFunc&&(r&&(t=2),ee.get(ft.active.keyFunc)(ft.active.id,n,e,t,ft.getModBits(ft.active)))}}},onGamepadConnected:function(e){ft.refreshJoysticks()},onGamepadDisconnected:function(e){ft.refreshJoysticks()},onKeydown:function(e){ft.onKeyChanged(e.keyCode,1),8!==e.keyCode&&9!==e.keyCode||e.preventDefault()},onKeyup:function(e){ft.onKeyChanged(e.keyCode,0)},onBlur:function(e){if(ft.active)for(var t=0;t<ft.active.domKeys.length;++t)ft.active.domKeys[t]&&ft.onKeyChanged(t,0)},onMousemove:function(t){ft.active&&(dt.calculateMouseEvent(t),t.target==e.canvas&&ft.active.cursorPosFunc&&ee.get(ft.active.cursorPosFunc)(ft.active.id,dt.mouseX,dt.mouseY))},DOMToGLFWMouseButton:function(e){var t=e.button;return t>0&&(t=1==t?2:1),t},onMouseenter:function(t){ft.active&&t.target==e.canvas&&ft.active.cursorEnterFunc&&ee.get(ft.active.cursorEnterFunc)(ft.active.id,1)},onMouseleave:function(t){ft.active&&t.target==e.canvas&&ft.active.cursorEnterFunc&&ee.get(ft.active.cursorEnterFunc)(ft.active.id,0)},onMouseButtonChanged:function(t,n){if(ft.active&&(dt.calculateMouseEvent(t),t.target==e.canvas)){var r=ft.DOMToGLFWMouseButton(t);if(1==n){ft.active.buttons|=1<<r;try{t.target.setCapture()}catch(e){}}else ft.active.buttons&=~(1<<r);ft.active.mouseButtonFunc&&ee.get(ft.active.mouseButtonFunc)(ft.active.id,r,n,ft.getModBits(ft.active))}},onMouseButtonDown:function(e){ft.active&&ft.onMouseButtonChanged(e,1)},onMouseButtonUp:function(e){ft.active&&ft.onMouseButtonChanged(e,0)},onMouseWheel:function(t){var n=-dt.getMouseWheelDelta(t);if(n=0==n?0:n>0?Math.max(n,1):Math.min(n,-1),ft.wheelPos+=n,ft.active&&ft.active.scrollFunc&&t.target==e.canvas){var r=0,o=0;"mousewheel"==t.type?(r=t.wheelDeltaX,o=t.wheelDeltaY):(r=t.deltaX,o=t.deltaY),ee.get(ft.active.scrollFunc)(ft.active.id,r,o),t.preventDefault()}},onCanvasResize:function(e,t){if(ft.active){var n=!0;document.fullscreen||document.fullScreen||document.mozFullScreen||document.webkitIsFullScreen?(ft.active.storedX=ft.active.x,ft.active.storedY=ft.active.y,ft.active.storedWidth=ft.active.width,ft.active.storedHeight=ft.active.height,ft.active.x=ft.active.y=0,ft.active.width=screen.width,ft.active.height=screen.height,ft.active.fullscreen=!0):1==ft.active.fullscreen?(ft.active.x=ft.active.storedX,ft.active.y=ft.active.storedY,ft.active.width=ft.active.storedWidth,ft.active.height=ft.active.storedHeight,ft.active.fullscreen=!1):ft.active.width!=e||ft.active.height!=t?(ft.active.width=e,ft.active.height=t):n=!1,n&&(dt.setCanvasSize(ft.active.width,ft.active.height,!0),ft.onWindowSizeChanged(),ft.onFramebufferSizeChanged())}},onWindowSizeChanged:function(){ft.active&&ft.active.windowSizeFunc&&ee.get(ft.active.windowSizeFunc)(ft.active.id,ft.active.width,ft.active.height)},onFramebufferSizeChanged:function(){ft.active&&ft.active.framebufferSizeFunc&&ee.get(ft.active.framebufferSizeFunc)(ft.active.id,ft.active.width,ft.active.height)},getTime:function(){return ut()/1e3},setWindowTitle:function(e,t){var n=ft.WindowFromId(e);n&&(n.title=A(t),ft.active.id==n.id&&(document.title=n.title))},setJoystickCallback:function(e){ft.joystickFunc=e,ft.refreshJoysticks()},joys:{},lastGamepadState:null,lastGamepadStateFrame:null,refreshJoysticks:function(){if(dt.mainLoop.currentFrameNumber!==ft.lastGamepadStateFrame||!dt.mainLoop.currentFrameNumber){ft.lastGamepadState=navigator.getGamepads?navigator.getGamepads():navigator.webkitGetGamepads?navigator.webkitGetGamepads:null,ft.lastGamepadStateFrame=dt.mainLoop.currentFrameNumber;for(var e=0;e<ft.lastGamepadState.length;++e){var t=ft.lastGamepadState[e];if(t){ft.joys[e]||(console.log("glfw joystick connected:",e),ft.joys[e]={id:F(vt(t.id),0),buttonsCount:t.buttons.length,axesCount:t.axes.length,buttons:F(new Array(t.buttons.length),0),axes:F(new Array(4*t.axes.length),0)},ft.joystickFunc&&ee.get(ft.joystickFunc)(e,262145));for(var n=ft.joys[e],r=0;r<t.buttons.length;++r)E(n.buttons+r,t.buttons[r].pressed,"i8");for(r=0;r<t.axes.length;++r)E(n.axes+4*r,t.axes[r],"float")}else ft.joys[e]&&(console.log("glfw joystick disconnected",e),ft.joystickFunc&&ee.get(ft.joystickFunc)(e,262146),Ft(ft.joys[e].id),Ft(ft.joys[e].buttons),Ft(ft.joys[e].axes),delete ft.joys[e])}}},setKeyCallback:function(e,t){var n=ft.WindowFromId(e);if(!n)return null;var r=n.keyFunc;return n.keyFunc=t,r},setCharCallback:function(e,t){var n=ft.WindowFromId(e);if(!n)return null;var r=n.charFunc;return n.charFunc=t,r},setMouseButtonCallback:function(e,t){var n=ft.WindowFromId(e);if(!n)return null;var r=n.mouseButtonFunc;return n.mouseButtonFunc=t,r},setCursorPosCallback:function(e,t){var n=ft.WindowFromId(e);if(!n)return null;var r=n.cursorPosFunc;return n.cursorPosFunc=t,r},setScrollCallback:function(e,t){var n=ft.WindowFromId(e);if(!n)return null;var r=n.scrollFunc;return n.scrollFunc=t,r},setDropCallback:function(e,t){var n=ft.WindowFromId(e);if(!n)return null;var r=n.dropFunc;return n.dropFunc=t,r},onDrop:function(e){if(ft.active&&ft.active.dropFunc&&e.dataTransfer&&e.dataTransfer.files&&0!=e.dataTransfer.files.length){e.preventDefault();var t=F(new Array(4*e.dataTransfer.files.length),0),n=[],r=e.dataTransfer.files.length,o=0,i=".glfw_dropped_files";ot.createPath("/",i);for(var a=0;a<r;++a)s(e.dataTransfer.files[a]);return!1}function s(e){var s="/"+i+"/"+e.name.replace(/\//g,"_"),l=new FileReader;l.onloadend=function(i){if(2!=l.readyState)return++o,void console.log("failed to read dropped file: "+e.name+": "+l.error);var a=i.target.result;if(ot.writeFile(s,new Uint8Array(a)),++o===r){ee.get(ft.active.dropFunc)(ft.active.id,r,t);for(var u=0;u<n.length;++u)Ft(n[u]);Ft(t)}},l.readAsArrayBuffer(e);var u=F(vt(s),0);n.push(u),E(t+4*a,u,"i8*")}},onDragover:function(e){if(ft.active&&ft.active.dropFunc)return e.preventDefault(),!1},setWindowSizeCallback:function(e,t){var n=ft.WindowFromId(e);if(!n)return null;var r=n.windowSizeFunc;return n.windowSizeFunc=t,r},setWindowCloseCallback:function(e,t){var n=ft.WindowFromId(e);if(!n)return null;var r=n.windowCloseFunc;return n.windowCloseFunc=t,r},setWindowRefreshCallback:function(e,t){var n=ft.WindowFromId(e);if(!n)return null;var r=n.windowRefreshFunc;return n.windowRefreshFunc=t,r},onClickRequestPointerLock:function(t){!dt.pointerLock&&e.canvas.requestPointerLock&&(e.canvas.requestPointerLock(),t.preventDefault())},setInputMode:function(t,n,r){var o=ft.WindowFromId(t);if(o)switch(n){case 208897:switch(r){case 212993:o.inputModes[n]=r,e.canvas.removeEventListener("click",ft.onClickRequestPointerLock,!0),e.canvas.exitPointerLock();break;case 212994:console.log("glfwSetInputMode called with GLFW_CURSOR_HIDDEN value not implemented.");break;case 212995:o.inputModes[n]=r,e.canvas.addEventListener("click",ft.onClickRequestPointerLock,!0),e.canvas.requestPointerLock();break;default:console.log("glfwSetInputMode called with unknown value parameter value: "+r+".")}break;case 208898:console.log("glfwSetInputMode called with GLFW_STICKY_KEYS mode not implemented.");break;case 208899:console.log("glfwSetInputMode called with GLFW_STICKY_MOUSE_BUTTONS mode not implemented.");break;default:console.log("glfwSetInputMode called with unknown mode parameter value: "+n+".")}},getKey:function(e,t){var n=ft.WindowFromId(e);return n?n.keys[t]:0},getMouseButton:function(e,t){var n=ft.WindowFromId(e);return n?(n.buttons&1<<t)>0:0},getCursorPos:function(e,t,n){E(t,dt.mouseX,"double"),E(n,dt.mouseY,"double")},getMousePos:function(e,t,n){E(t,dt.mouseX,"i32"),E(n,dt.mouseY,"i32")},setCursorPos:function(e,t,n){},getWindowPos:function(e,t,n){var r=0,o=0,i=ft.WindowFromId(e);i&&(r=i.x,o=i.y),t&&E(t,r,"i32"),n&&E(n,o,"i32")},setWindowPos:function(e,t,n){var r=ft.WindowFromId(e);r&&(r.x=t,r.y=n)},getWindowSize:function(e,t,n){var r=0,o=0,i=ft.WindowFromId(e);i&&(r=i.width,o=i.height),t&&E(t,r,"i32"),n&&E(n,o,"i32")},setWindowSize:function(e,t,n){var r=ft.WindowFromId(e);
2r&&(ft.active.id==r.id&&(t==screen.width&&n==screen.height?dt.requestFullscreen():(dt.exitFullscreen(),dt.setCanvasSize(t,n),r.width=t,r.height=n)),r.windowSizeFunc&&ee.get(r.windowSizeFunc)(r.id,t,n))},createWindow:function(t,n,r,o,i){var a,s;for(a=0;a<ft.windows.length&&null!==ft.windows[a];a++);if(a>0)throw"glfwCreateWindow only supports one window at time currently";if(s=a+1,t<=0||n<=0)return 0;for(o?dt.requestFullscreen():dt.setCanvasSize(t,n),a=0;a<ft.windows.length&&null==ft.windows[a];a++);var l=ft.hints[139265]>0;if(a==ft.windows.length)if(l){var u={antialias:ft.hints[135181]>1,depth:ft.hints[135173]>0,stencil:ft.hints[135174]>0,alpha:ft.hints[135172]>0};e.ctx=dt.createContext(e.canvas,!0,!0,u)}else dt.init();if(!e.ctx&&l)return 0;var p=new ht(s,t,n,r,o,i);return s-1==ft.windows.length?ft.windows.push(p):ft.windows[s-1]=p,ft.active=p,p.id},destroyWindow:function(t){var n=ft.WindowFromId(t);if(n){n.windowCloseFunc&&ee.get(n.windowCloseFunc)(n.id),ft.windows[n.id-1]=null,ft.active.id==n.id&&(ft.active=null);for(var r=0;r<ft.windows.length;r++)if(null!==ft.windows[r])return;e.ctx=dt.destroyContext(e.canvas,!0,!0)}},swapBuffers:function(e){},GLFW2ParamToGLFW3Param:function(e){return{196609:0,196610:0,196611:0,196612:0,196613:0,196614:0,131073:0,131074:0,131075:0,131076:0,131077:135169,131078:135170,131079:135171,131080:135172,131081:135173,131082:135174,131083:135183,131084:135175,131085:135176,131086:135177,131087:135178,131088:135179,131089:135180,131090:0,131091:135181,131092:139266,131093:139267,131094:139270,131095:139271,131096:139272}[e]}};function gt(e){return e%4==0&&(e%100!=0||e%400==0)}function mt(e,t){for(var n=0,r=0;r<=t;n+=e[r++]);return n}var yt=[31,29,31,30,31,30,31,31,30,31,30,31],bt=[31,28,31,30,31,30,31,31,30,31,30,31];function $t(e,t){for(var n=new Date(e.getTime());t>0;){var r=gt(n.getFullYear()),o=n.getMonth(),i=(r?yt:bt)[o];if(!(t>i-n.getDate()))return n.setDate(n.getDate()+t),n;t-=i-n.getDate()+1,n.setDate(1),o<11?n.setMonth(o+1):(n.setMonth(0),n.setFullYear(n.getFullYear()+1))}return n}Ae=e.InternalError=je(Error,"InternalError"),function(){for(var e=new Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);Oe=e}(),Be=e.BindingError=je(Error,"BindingError"),e.count_emval_handles=function(){for(var e=0,t=5;t<Ue.length;++t)void 0!==Ue[t]&&++e;return e},e.get_first_emval=function(){for(var e=5;e<Ue.length;++e)if(void 0!==Ue[e])return Ue[e];return null},Ke=e.UnboundTypeError=je(Error,"UnboundTypeError");var _t,wt=function(e,t,n,r){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=ot.nextInode++,this.name=t,this.mode=n,this.node_ops={},this.stream_ops={},this.rdev=r};Object.defineProperties(wt.prototype,{read:{get:function(){return!(365&~this.mode)},set:function(e){e?this.mode|=365:this.mode&=-366}},write:{get:function(){return!(146&~this.mode)},set:function(e){e?this.mode|=146:this.mode&=-147}},isFolder:{get:function(){return ot.isDir(this.mode)}},isDevice:{get:function(){return ot.isChrdev(this.mode)}}}),ot.FSNode=wt,ot.staticInit();for(var xt=new Float32Array(288),St=0;St<288;++St)pt[St]=xt.subarray(0,St+1);function vt(e,t,n){var r=n>0?n:D(e)+1,o=new Array(r),i=C(e,o,0,o.length);return t&&(o.length=i),o}e.requestFullscreen=function(e,t){dt.requestFullscreen(e,t)},e.requestAnimationFrame=function(e){dt.requestAnimationFrame(e)},e.setCanvasSize=function(e,t,n){dt.setCanvasSize(e,t,n)},e.pauseMainLoop=function(){dt.mainLoop.pause()},e.resumeMainLoop=function(){dt.mainLoop.resume()},e.getUserMedia=function(){dt.getUserMedia()},e.createContext=function(e,t,n,r){return dt.createContext(e,t,n,r)};var kt,Et={J:function(e){return Tt(e+16)+16},I:function(e,t,n){throw new xe(e).init(t,n),e},s:function(e){var t=Se[e];delete Se[e];var n=t.rawConstructor,r=t.rawDestructor,o=t.fields;Me([e],o.map(function(e){return e.getterReturnType}).concat(o.map(function(e){return e.setterArgumentType})),function(e){var i={};return o.forEach(function(t,n){var r=t.fieldName,a=e[n],s=t.getter,l=t.getterContext,u=e[n+o.length],p=t.setter,c=t.setterContext;i[r]={read:function(e){return a.fromWireType(s(l,e))},write:function(e,t){var n=[];p(c,e,u.toWireType(n,t)),ve(n)}}}),[{name:t.name,fromWireType:function(e){var t={};for(var n in i)t[n]=i[n].read(e);return r(e),t},toWireType:function(e,t){for(var o in i)if(!(o in t))throw new TypeError('Missing field:  "'+o+'"');var a=n();for(o in i)i[o].write(a,t[o]);return null!==e&&e.push(r,a),a},argPackAdvance:8,readValueFromPointer:ke,destructorFunction:r}]})},ka:function(e,t,n,r,o){var i=De(n);Le(e,{name:t=Re(t),fromWireType:function(e){return!!e},toWireType:function(e,t){return t?r:o},argPackAdvance:8,readValueFromPointer:function(e){var r;if(1===n)r=R;else if(2===n)r=P;else{if(4!==n)throw new TypeError("Unknown boolean type size: "+t);r=W}return this.fromWireType(r[e>>i])},destructorFunction:null})},ja:function(e,t){Le(e,{name:t=Re(t),fromWireType:function(e){var t=Ue[e].value;return ze(e),t},toWireType:function(e,t){return Ve(t)},argPackAdvance:8,readValueFromPointer:ke,destructorFunction:null})},Q:function(e,t,n){var r=De(n);Le(e,{name:t=Re(t),fromWireType:function(e){return e},toWireType:function(e,t){if("number"!=typeof t&&"boolean"!=typeof t)throw new TypeError('Cannot convert "'+He(t)+'" to '+this.name);return t},argPackAdvance:8,readValueFromPointer:Ge(t,r),destructorFunction:null})},G:function(t,n,r,o,i,a){var s=function(e,t){for(var n=[],r=0;r<e;r++)n.push(W[(t>>2)+r]);return n}(n,r);t=Re(t),i=qe(o,i),function(t,n,r){e.hasOwnProperty(t)?((void 0===r||void 0!==e[t].overloadTable&&void 0!==e[t].overloadTable[r])&&Pe("Cannot register public name '"+t+"' twice"),function(e,t,n){if(void 0===e[t].overloadTable){var r=e[t];e[t]=function(){return e[t].overloadTable.hasOwnProperty(arguments.length)||Pe("Function '"+n+"' called with an invali
2d number of arguments ("+arguments.length+") - expects one of ("+e[t].overloadTable+")!"),e[t].overloadTable[arguments.length].apply(this,arguments)},e[t].overloadTable=[],e[t].overloadTable[r.argCount]=r}}(e,t,t),e.hasOwnProperty(r)&&Pe("Cannot register multiple overloads of a function with the same number of arguments ("+r+")!"),e[t].overloadTable[r]=n):(e[t]=n,void 0!==r&&(e[t].numArguments=r))}(t,function(){!function(e,t){var n=[],r={};throw t.forEach(function e(t){r[t]||Ie[t]||(Te[t]?Te[t].forEach(e):(n.push(t),r[t]=!0))}),new Ke(e+": "+n.map(Xe).join([", "]))}("Cannot call "+t+" due to unbound types",s)},n-1),Me([],s,function(r){var o=[r[0],null].concat(r.slice(1));return function(t,n,r){e.hasOwnProperty(t)||Ce("Replacing nonexistant public symbol"),void 0!==e[t].overloadTable&&void 0!==r?e[t].overloadTable[r]=n:(e[t]=n,e[t].argCount=r)}(t,function(e,t,n,r,o){var i=t.length;i<2&&Pe("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var a=null!==t[1]&&null!==n,s=!1,l=1;l<t.length;++l)if(null!==t[l]&&void 0===t[l].destructorFunction){s=!0;break}var u="void"!==t[0].name,p="",c="";for(l=0;l<i-2;++l)p+=(0!==l?", ":"")+"arg"+l,c+=(0!==l?", ":"")+"arg"+l+"Wired";var d="return function "+Fe(e)+"("+p+") {\nif (arguments.length !== "+(i-2)+") {\nthrowBindingError('function "+e+" called with ' + arguments.length + ' arguments, expected "+(i-2)+" args!');\n}\n";s&&(d+="var destructors = [];\n");var h=s?"destructors":"null",f=["throwBindingError","invoker","fn","runDestructors","retType","classParam"],g=[Pe,r,o,ve,t[0],t[1]];for(a&&(d+="var thisWired = classParam.toWireType("+h+", this);\n"),l=0;l<i-2;++l)d+="var arg"+l+"Wired = argType"+l+".toWireType("+h+", arg"+l+"); // "+t[l+2].name+"\n",f.push("argType"+l),g.push(t[l+2]);if(a&&(c="thisWired"+(c.length>0?", ":"")+c),d+=(u?"var rv = ":"")+"invoker(fn"+(c.length>0?", ":"")+c+");\n",s)d+="runDestructors(destructors);\n";else for(l=a?1:2;l<t.length;++l){var m=1===l?"thisWired":"arg"+(l-2)+"Wired";null!==t[l].destructorFunction&&(d+=m+"_dtor("+m+"); // "+t[l].name+"\n",f.push(m+"_dtor"),g.push(t[l].destructorFunction))}return u&&(d+="var ret = retType.fromWireType(rv);\nreturn ret;\n"),d+="}\n",f.push(d),function(e,t){if(!(e instanceof Function))throw new TypeError("new_ called with constructor type "+typeof e+" which is not a function");var n=Ne(e.name||"unknownFunctionName",function(){});n.prototype=e.prototype;var r=new n,o=e.apply(r,t);return o instanceof Object?o:r}(Function,f).apply(null,g)}(t,o,null,i,a),n-1),[]})},y:function(e,t,n,r,o){t=Re(t),-1===o&&(o=4294967295);var i=De(n),a=function(e){return e};if(0===r){var s=32-8*n;a=function(e){return e<<s>>>s}}var l=-1!=t.indexOf("unsigned");Le(e,{name:t,fromWireType:a,toWireType:function(e,n){if("number"!=typeof n&&"boolean"!=typeof n)throw new TypeError('Cannot convert "'+He(n)+'" to '+this.name);if(n<r||n>o)throw new TypeError('Passing a number "'+He(n)+'" from JS side to C/C++ side to an argument of type "'+t+'", which is outside the valid range ['+r+", "+o+"]!");return l?n>>>0:0|n},argPackAdvance:8,readValueFromPointer:Ye(t,i,0!==r),destructorFunction:null})},u:function(e,t,n){var r=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][t];function o(e){var t=U,n=t[e>>=2],o=t[e+1];return new r(O,o,n)}Le(e,{name:n=Re(n),fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},S:function(e,t){var n="std::string"===(t=Re(t));Le(e,{name:t,fromWireType:function(e){var t,r=U[e>>2];if(n)for(var o=e+4,i=0;i<=r;++i){var a=e+4+i;if(i==r||0==B[a]){var s=A(o,a-o);void 0===t?t=s:(t+=String.fromCharCode(0),t+=s),o=a+1}}else{var l=new Array(r);for(i=0;i<r;++i)l[i]=String.fromCharCode(B[e+4+i]);t=l.join("")}return Ft(e),t},toWireType:function(e,t){t instanceof ArrayBuffer&&(t=new Uint8Array(t));var r="string"==typeof t;r||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int8Array||Pe("Cannot pass non-string to std::string");var o=(n&&r?function(){return D(t)}:function(){return t.length})(),i=Tt(4+o+1);if(U[i>>2]=o,n&&r)M(t,i+4,o+1);else if(r)for(var a=0;a<o;++a){var s=t.charCodeAt(a);s>255&&(Ft(i),Pe("String has UTF-16 code units that do not fit in 8 bits")),B[i+4+a]=s}else for(a=0;a<o;++a)B[i+4+a]=t[a];return null!==e&&e.push(Ft,i),i},argPackAdvance:8,readValueFromPointer:ke,destructorFunction:function(e){Ft(e)}})},K:function(e,t,n){var r,o,i,a,s;n=Re(n),2===t?(r=G,o=q,a=K,i=function(){return L},s=1):4===t&&(r=X,o=Y,a=J,i=function(){return U},s=2),Le(e,{name:n,fromWireType:function(e){for(var n,o=U[e>>2],a=i(),l=e+4,u=0;u<=o;++u){var p=e+4+u*t;if(u==o||0==a[p>>s]){var c=r(l,p-l);void 0===n?n=c:(n+=String.fromCharCode(0),n+=c),l=p+t}}return Ft(e),n},toWireType:function(e,r){"string"!=typeof r&&Pe("Cannot pass non-string to C++ string type "+n);var i=a(r),l=Tt(4+i+t);return U[l>>2]=i>>s,o(r,l+4,i+t),null!==e&&e.push(Ft,l),l},argPackAdvance:8,readValueFromPointer:ke,destructorFunction:function(e){Ft(e)}})},t:function(e,t,n,r,o,i){Se[e]={name:Re(t),rawConstructor:qe(n,r),rawDestructor:qe(o,i),fields:[]}}
2,b:function(e,t,n,r,o,i,a,s,l,u){Se[e].fields.push({fieldName:Re(t),getterReturnType:n,getter:qe(r,o),getterContext:i,setterArgumentType:a,setter:qe(s,l),setterContext:u})},la:function(e,t){Le(e,{isVoid:!0,name:t=Re(t),argPackAdvance:0,fromWireType:function(){},toWireType:function(e,t){}})},R:ze,T:function(e){e>4&&(Ue[e].refcount+=1)},N:function(e,t){var n,r;return void 0===(r=Ie[n=e])&&Pe("_emval_take_value has unknown type "+Xe(n)),Ve((e=r).readValueFromPointer(t))},P:function(){de()},ua:function(t){k=!1,function(t){k||(e.onExit&&e.onExit(t),I=!0),h(t,new At(t))}(t)},ca:function(e,t,n){B.copyWithin(e,t,t+n)},A:function(e){var t=B.length,n=2147483648;if(e>n)return!1;for(var r=1;r<=4;r*=2){var o=t*(1+.2/r);if(o=Math.min(o,e+100663296),Je(Math.min(n,Z(Math.max(e,o),65536))))return!0}return!1},ea:function(e,t){try{var n=0;return Qe().forEach(function(r,o){var i=t+n;W[e+4*o>>2]=i,function(e,t){for(var n=0;n<e.length;++n)R[0|t++]=e.charCodeAt(n);R[0|t]=0}(r,i),n+=r.length+1}),0}catch(e){return void 0!==ot&&e instanceof ot.ErrnoError||de(e),e.errno}},fa:function(e,t){try{var n=Qe();W[e>>2]=n.length;var r=0;return n.forEach(function(e){r+=e.length+1}),W[t>>2]=r,0}catch(e){return void 0!==ot&&e instanceof ot.ErrnoError||de(e),e.errno}},ia:function(e){try{var t=it.getStreamFromFD(e);return ot.close(t),0}catch(e){return void 0!==ot&&e instanceof ot.ErrnoError||de(e),e.errno}},ga:function(e,t,n,r){try{var o=it.getStreamFromFD(e),i=it.doReadv(o,t,n);return W[r>>2]=i,0}catch(e){return void 0!==ot&&e instanceof ot.ErrnoError||de(e),e.errno}},ba:function(e,t,n,r,o){try{var i=it.getStreamFromFD(e),a=4294967296*n+(t>>>0),s=9007199254740992;return a<=-s||a>=s?-61:(ot.llseek(i,a,r),be=[i.position>>>0,(ye=i.position,+Math.abs(ye)>=1?ye>0?(0|Math.min(+Math.floor(ye/4294967296),4294967295))>>>0:~~+Math.ceil((ye-+(~~ye>>>0))/4294967296)>>>0:0)],W[o>>2]=be[0],W[o+4>>2]=be[1],i.getdents&&0===a&&0===r&&(i.getdents=null),0)}catch(e){return void 0!==ot&&e instanceof ot.ErrnoError||de(e),e.errno}},ha:function(e,t,n,r){try{var o=it.getStreamFromFD(e),i=it.doWritev(o,t,n);return W[r>>2]=i,0}catch(e){return void 0!==ot&&e instanceof ot.ErrnoError||de(e),e.errno}},q:function(e){_t.activeTexture(e)},W:function(e,t){_t.attachShader(at.programs[e],at.shaders[t])},i:function(e,t){34962==e?_t.currentArrayBufferBinding=t:34963==e&&(_t.currentElementArrayBufferBinding=t),_t.bindBuffer(e,at.buffers[t])},k:function(e,t){_t.bindFramebuffer(e,at.framebuffers[t])},f:function(e,t){_t.bindTexture(e,at.textures[t])},j:function(e){_t.bindVertexArray(at.vaos[e]);var t=_t.getParameter(34965);_t.currentElementArrayBufferBinding=t?0|t.name:0},o:function(e,t,n,r){_t.bufferData(e,n?B.subarray(n,n+t):t,r)},E:function(e){_t.clear(e)},F:function(e,t,n,r){_t.clearColor(e,t,n,r)},Z:function(e){_t.compileShader(at.shaders[e])},ra:function(){var e=at.getNewId(at.programs),t=_t.createProgram();return t.name=e,at.programs[e]=t,e},$:function(e){var t=at.getNewId(at.shaders);return at.shaders[t]=_t.createShader(e),t},l:function(e,t){for(var n=0;n<e;n++){var r=W[t+4*n>>2],o=at.buffers[r];o&&(_t.deleteBuffer(o),o.name=0,at.buffers[r]=null,r==_t.currentArrayBufferBinding&&(_t.currentArrayBufferBinding=0),r==_t.currentElementArrayBufferBinding&&(_t.currentElementArrayBufferBinding=0))}},v:function(e,t){for(var n=0;n<e;n++){var r=W[t+4*n>>2];_t.deleteVertexArray(at.vaos[r]),at.vaos[r]=null}},w:function(e,t,n,r){var o;if(!_t.currentElementArrayBufferBinding){var i=at.calcBufLength(1,n,0,t);o=at.getTempIndexBuffer(i),_t.bindBuffer(34963,o),_t.bufferSubData(34963,0,B.subarray(r,r+i)),r=0}at.preDrawHandleClientVertexAttribBindings(t),_t.drawElements(e,t,n,r),at.postDrawHandleClientVertexAttribBindings(t),_t.currentElementArrayBufferBinding||_t.bindBuffer(34963,null)},m:function(e){at.currentContext.clientBuffers[e].enabled=!0,_t.enableVertexAttribArray(e)},r:function(e,t,n,r,o){_t.framebufferTexture2D(e,t,n,at.textures[r],o)},p:function(e,t){st(e,t,"createBuffer",at.buffers)},V:function(e,t){st(e,t,"createFramebuffer",at.framebuffers)},z:function(e,t){st(e,t,"createTexture",at.textures)},x:function(e,t){st(e,t,"createVertexArray",at.vaos)},oa:function(e,t,n,r){var o=_t.getProgramInfoLog(at.programs[e]);null===o&&(o="(unknown error)");var i=t>0&&r?M(o,r,t):0;
2n&&(W[n>>2]=i)},pa:function(e,t,n){if(n)if(e>=at.counter)at.recordError(1281);else{var r=at.programInfos[e];if(r)if(35716==t){var o=_t.getProgramInfoLog(at.programs[e]);null===o&&(o="(unknown error)"),W[n>>2]=o.length+1}else if(35719==t)W[n>>2]=r.maxUniformLength;else if(35722==t){if(-1==r.maxAttributeLength){e=at.programs[e];var i=_t.getProgramParameter(e,35721);r.maxAttributeLength=0;for(var a=0;a<i;++a){var s=_t.getActiveAttrib(e,a);r.maxAttributeLength=Math.max(r.maxAttributeLength,s.name.length+1)}}W[n>>2]=r.maxAttributeLength}else if(35381==t){if(-1==r.maxUniformBlockNameLength){e=at.programs[e];var l=_t.getProgramParameter(e,35382);for(r.maxUniformBlockNameLength=0,a=0;a<l;++a){var u=_t.getActiveUniformBlockName(e,a);r.maxUniformBlockNameLength=Math.max(r.maxUniformBlockNameLength,u.length+1)}}W[n>>2]=r.maxUniformBlockNameLength}else W[n>>2]=_t.getProgramParameter(at.programs[e],t);else at.recordError(1282)}else at.recordError(1281)},X:function(e,t,n,r){var o=_t.getShaderInfoLog(at.shaders[e]);null===o&&(o="(unknown error)");var i=t>0&&r?M(o,r,t):0;n&&(W[n>>2]=i)},Y:function(e,t,n){if(n)if(35716==t){var r=_t.getShaderInfoLog(at.shaders[e]);null===r&&(r="(unknown error)");var o=r?r.length+1:0;W[n>>2]=o}else if(35720==t){var i=_t.getShaderSource(at.shaders[e]),a=i?i.length+1:0;W[n>>2]=a}
2else W[n>>2]=_t.getShaderParameter(at.shaders[e],t);else at.recordError(1281)},a:function(e,t){var n,r=0;if("]"==(t=A(t))[t.length-1]){var o=t.lastIndexOf("[");r="]"!=t[o+1]?(n=t.slice(o+1),parseInt(n)):0,t=t.slice(0,o)}var i=at.programInfos[e]&&at.programInfos[e].uniforms[t];return i&&r>=0&&r<i[0]?i[1]+r:-1},qa:function(e){_t.linkProgram(at.programs[e]),at.populateUniformTable(e)},U:function(e,t,n,r,o,i,a){var s=lt(i,o,n,r,a);s?_t.readPixels(e,t,n,r,o,i,s):at.recordError(1280)},_:function(e,t,n,r){var o=at.getSource(e,t,n,r);_t.shaderSource(at.shaders[e],o)},h:function(e,t,n,r,o,i,a,s,l){_t.texImage2D(e,t,n,r,o,i,a,s,l?lt(s,a,r,o,l):null)},e:function(e,t,n){_t.texParameteri(e,t,n)},c:function(e,t){_t.uniform1f(at.uniforms[e],t)},d:function(e,t){_t.uniform1i(at.uniforms[e],t)},g:function(e,t,n,r){_t.uniform3f(at.uniforms[e],t,n,r)},H:function(e,t,n){if(t<=96)for(var r=pt[3*t-1],o=0;o<3*t;o+=3)r[o]=z[n+4*o>>2],r[o+1]=z[n+(4*o+4)>>2],r[o+2]=z[n+(4*o+8)>>2];else r=z.subarray(n>>2,n+12*t>>2);_t.uniform3fv(at.uniforms[e],r)},L:function(e,t,n,r){if(t<=18){var o=pt[16*t-1],i=z;r>>=2;for(var a=0;a<16*t;a+=16){var s=r+a;o[a]=i[s],o[a+1]=i[s+1],o[a+2]=i[s+2],o[a+3]=i[s+3],o[a+4]=i[s+4],o[a+5]=i[s+5],o[a+6]=i[s+6],o[a+7]=i[s+7],o[a+8]=i[s+8],o[a+9]=i[s+9],o[a+10]=i[s+10],o[a+11]=i[s+11],o[a+12]=i[s+12],o[a+13]=i[s+13],o[a+14]=i[s+14],o[a+15]=i[s+15]}}else o=z.subarray(r>>2,r+64*t>>2);_t.uniformMatrix4fv(at.uniforms[e],!!n,o)},B:function(e){_t.useProgram(at.programs[e])},n:function(e,t,n,r,o,i){var a=at.currentContext.clientBuffers[e];if(!_t.currentArrayBufferBinding)return a.size=t,a.type=n,a.normalized=r,a.stride=o,a.ptr=i,a.clientside=!0,void(a.vertexAttribPointerAdaptor=function(e,t,n,r,o,i){this.vertexAttribPointer(e,t,n,r,o,i)});a.clientside=!1,_t.vertexAttribPointer(e,t,n,!!r,o,i)},sa:function(e,t,n,r){_t.viewport(e,t,n,r)},va:function(e,t,n,r,o){return ft.createWindow(e,t,n,r,o)},na:function(e){return ft.destroyWindow(e)},aa:function(){return ft.windows||(ft.initialTime=ft.getTime(),ft.hints=ft.defaultHints,ft.windows=new Array,ft.active=null,window.addEventListener("gamepadconnected",ft.onGamepadConnected,!0),window.addEventListener("gamepaddisconnected",ft.onGamepadDisconnected,!0),window.addEventListener("keydown",ft.onKeydown,!0),window.addEventListener("keypress",ft.onKeyPress,!0),window.addEventListener("keyup",ft.onKeyup,!0),window.addEventListener("blur",ft.onBlur,!0),e.canvas.addEventListener("touchmove",ft.onMousemove,!0),e.canvas.addEventListener("touchstart",ft.onMouseButtonDown,!0),e.canvas.addEventListener("touchcancel",ft.onMouseButtonUp,!0),e.canvas.addEventListener("touchend",ft.onMouseButtonUp,!0),e.canvas.addEventListener("mousemove",ft.onMousemove,!0),e.canvas.addEventListener("mousedown",ft.onMouseButtonDown,!0),e.canvas.addEventListener("mouseup",ft.onMouseButtonUp,!0),e.canvas.addEventListener("wheel",ft.onMouseWheel,!0),e.canvas.addEventListener("mousewheel",ft.onMouseWheel,!0),e.canvas.addEventListener("mouseenter",ft.onMouseenter,!0),e.canvas.addEventListener("mouseleave",ft.onMouseleave,!0),e.canvas.addEventListener("drop",ft.onDrop,!0),e.canvas.addEventListener("dragover",ft.onDragover,!0),dt.resizeListeners.push(function(e,t){ft.onCanvasResize(e,t)})),1},ta:function(e){},C:function(){},D:function(e){ft.swapBuffers(e)},ma:function(){window.removeEventListener("gamepadconnected",ft.onGamepadConnected,!0),window.removeEventListener("gamepaddisconnected",ft.onGamepadDisconnected,!0),window.removeEventListener("keydown",ft.onKeydown,!0),window.removeEventListener("keypress",ft.onKeyPress,!0),window.removeEventListener("keyup",ft.onKeyup,!0),window.removeEventListener("blur",ft.onBlur,!0),e.canvas.removeEventListener("touchmove",ft.onMousemove,!0),e.canvas.removeEventListener("touchstart",ft.onMouseButtonDown,!0),e.canvas.removeEventListener("touchcancel",ft.onMouseButtonUp,!0),e.canvas.removeEventListener("touchend",ft.onMouseButtonUp,!0),e.canvas.removeEventListener("mousemove",ft.onMousemove,!0),e.canvas.removeEventListener("mousedown",ft.onMouseButtonDown,!0),e.canvas.removeEventListener("mouseup",ft.onMouseButtonUp,!0),e.canvas.removeEventListener("wheel",ft.onMouseWheel,!0),e.canvas.removeEventListener("mousewheel",ft.onMouseWheel,!0),e.canvas.removeEventListener("mouseenter",ft.onMouseenter,!0),e.canvas.removeEventListener("mouseleave",ft.onMouseleave,!0),e.canvas.removeEventListener("drop",ft.onDrop,!0),e.canvas.removeEventListener("dragover",ft.onDragover,!0),e.canvas.width=e.canvas.height=1,ft.windows=null,ft.active=null},M:function(e,t){ft.hints[e]=t},O:function(e){},da:function(e,t,n,r){return function(e,t,n,r){var o=W[r+40>>2],i={tm_sec:W[r>>2],tm_min:W[r+4>>2],tm_hour:W[r+8>>2],tm_mday:W[r+12>>2],tm_mon:W[r+16>>2],tm_year:W[r+20>>2],tm_wday:W[r+24>>2],tm_yday:W[r+28>>2],tm_isdst:W[r+32>>2],tm_gmtoff:W[r+36>>2],tm_zone:o?A(o):""},a=A(n),s={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var l in s)a=a.replace(new RegExp(l,"g"),s[l]);
vendor: 5,208 bytes, line 2
2var u=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],p=["January","February","March","April","May","June","July","August","September","October","November","December"];function c(e,t,n){for(var r="number"==typeof e?e.toString():e||"";r.length<t;)r=n[0]+r;return r}function d(e,t){return c(e,t,"0")}function h(e,t){function n(e){return e<0?-1:e>0?1:0}var r;return 0===(r=n(e.getFullYear()-t.getFullYear()))&&0===(r=n(e.getMonth()-t.getMonth()))&&(r=n(e.getDate()-t.getDate())),r}function f(e){switch(e.getDay()){case 0:return new Date(e.getFullYear()-1,11,29);case 1:return e;case 2:return new Date(e.getFullYear(),0,3);case 3:return new Date(e.getFullYear(),0,2);case 4:return new Date(e.getFullYear(),0,1);case 5:return new Date(e.getFullYear()-1,11,31);case 6:return new Date(e.getFullYear()-1,11,30)}}function g(e){var t=$t(new Date(e.tm_year+1900,0,1),e.tm_yday),n=new Date(t.getFullYear(),0,4),r=new Date(t.getFullYear()+1,0,4),o=f(n),i=f(r);return h(o,t)<=0?h(i,t)<=0?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var m={"%a":function(e){return u[e.tm_wday].substring(0,3)},"%A":function(e){return u[e.tm_wday]},"%b":function(e){return p[e.tm_mon].substring(0,3)},"%B":function(e){return p[e.tm_mon]},"%C":function(e){return d((e.tm_year+1900)/100|0,2)},"%d":function(e){return d(e.tm_mday,2)},"%e":function(e){return c(e.tm_mday,2," ")},"%g":function(e){return g(e).toString().substring(2)},"%G":function(e){return g(e)},"%H":function(e){return d(e.tm_hour,2)},"%I":function(e){var t=e.tm_hour;return 0==t?t=12:t>12&&(t-=12),d(t,2)},"%j":function(e){return d(e.tm_mday+mt(gt(e.tm_year+1900)?yt:bt,e.tm_mon-1),3)},"%m":function(e){return d(e.tm_mon+1,2)},"%M":function(e){return d(e.tm_min,2)},"%n":function(){return"\n"},"%p":function(e){return e.tm_hour>=0&&e.tm_hour<12?"AM":"PM"},"%S":function(e){return d(e.tm_sec,2)},"%t":function(){return"\t"},"%u":function(e){return e.tm_wday||7},"%U":function(e){var t=new Date(e.tm_year+1900,0,1),n=0===t.getDay()?t:$t(t,7-t.getDay()),r=new Date(e.tm_year+1900,e.tm_mon,e.tm_mday);if(h(n,r)<0){var o=mt(gt(r.getFullYear())?yt:bt,r.getMonth()-1)-31,i=31-n.getDate()+o+r.getDate();return d(Math.ceil(i/7),2)}return 0===h(n,t)?"01":"00"},"%V":function(e){var t,n=new Date(e.tm_year+1900,0,4),r=new Date(e.tm_year+1901,0,4),o=f(n),i=f(r),a=$t(new Date(e.tm_year+1900,0,1),e.tm_yday);return h(a,o)<0?"53":h(i,a)<=0?"01":(t=o.getFullYear()<e.tm_year+1900?e.tm_yday+32-o.getDate():e.tm_yday+1-o.getDate(),d(Math.ceil(t/7),2))},"%w":function(e){return e.tm_wday},"%W":function(e){var t=new Date(e.tm_year,0,1),n=1===t.getDay()?t:$t(t,0===t.getDay()?1:7-t.getDay()+1),r=new Date(e.tm_year+1900,e.tm_mon,e.tm_mday);if(h(n,r)<0){var o=mt(gt(r.getFullYear())?yt:bt,r.getMonth()-1)-31,i=31-n.getDate()+o+r.getDate();return d(Math.ceil(i/7),2)}return 0===h(n,t)?"01":"00"},"%y":function(e){return(e.tm_year+1900).toString().substring(2)},"%Y":function(e){return e.tm_year+1900},"%z":function(e){var t=e.tm_gmtoff,n=t>=0;return t=(t=Math.abs(t)/60)/60*100+t%60,(n?"+":"-")+String("0000"+t).slice(-4)},"%Z":function(e){return e.tm_zone},"%%":function(){return"%"}};for(var l in m)a.indexOf(l)>=0&&(a=a.replace(new RegExp(l,"g"),m[l](i)));var y=vt(a,!1);return y.length>t?0:(function(e,t){R.set(e,t)}(y,e),y.length-1)}(e,t,n,r)}},It=(function(){var t={a:Et};function n(t,n){var r=t.exports;e.asm=r,Q((v=e.asm.wa).buffer),ee=e.asm.ya,ce()}function r(e){n(e.instance)}function i(e){return function(){if(!_&&(s||l)){if("function"==typeof fetch&&!ge($e))return fetch($e,{credentials:"same-origin"}).then(function(e){if(!e.ok)throw"failed to load wasm binary file at '"+$e+"'";return e.arrayBuffer()}).catch(function(){return _e($e)});if(g)return new Promise(function(e,t){g($e,function(t){e(new Uint8Array(t))},t)})}return Promise.resolve().then(function(){return _e($e)})}().then(function(e){return WebAssembly.instantiate(e,t)}).then(e,function(e){x("failed to asynchronously prepare wasm: "+e),de(e)})}if(pe(),e.instantiateWasm)try{return e.instantiateWasm(t,n)}catch(e){return x("Module.instantiateWasm callback failed with error: "+e),!1}(_||"function"!=typeof WebAssembly.instantiateStreaming||fe($e)||ge($e)||"function"!=typeof fetch?i(r):fetch($e,{credentials:"same-origin"}).then(function(e){return WebAssembly.instantiateStreaming(e,t).then(r,function(e){return x("wasm streaming compile failed: "+e),x("falling back to ArrayBuffer instantiation"),i(r)})})).catch(o)}(),e.___wasm_call_ctors=function(){return(It=e.___wasm_call_ctors=e.asm.xa).apply(null,arguments)}),Tt=e._malloc=function(){return(Tt=e._malloc=e.asm.za).apply(null,arguments)},Ft=e._free=function(){return(Ft=e._free=e.asm.Aa).apply(null,arguments)},Nt=e.___getTypeName=function(){return(Nt=e.___getTypeName=e.asm.Ba).apply(null,arguments)},jt=(e.___embind_register_native_and_builtin_types=function(){return(e.___embind_register_native_and_builtin_types=e.asm.Ca).apply(null,arguments)},e.stackAlloc=function(){return(jt=e.stackAlloc=e.asm.Da).apply(null,arguments)});function At(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function Ct(n){function r(){kt||(kt=!0,e.calledRun=!0,I||(e.noFSInit||ot.init.initialized||ot.init(
2),nt.init(),we(ne),ot.ignorePermissions=!1,we(re),t(e),e.onRuntimeInitialized&&e.onRuntimeInitialized(),function(){if(e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;)ae(e.postRun.shift());we(oe)}()))}n=n||c,se>0||(function(){if(e.preRun)for("function"==typeof e.preRun&&(e.preRun=[e.preRun]);e.preRun.length;)ie(e.preRun.shift());we(te)}(),se>0||(e.setStatus?(e.setStatus("Running..."),setTimeout(function(){setTimeout(function(){e.setStatus("")},1),r()},1)):r()))}if(e.dynCall_ji=function(){return(e.dynCall_ji=e.asm.Ea).apply(null,arguments)},e.dynCall_viijii=function(){return(e.dynCall_viijii=e.asm.Fa).apply(null,arguments)},e.dynCall_jiji=function(){return(e.dynCall_jiji=e.asm.Ga).apply(null,arguments)},e.dynCall_iiiiiijj=function(){return(e.dynCall_iiiiiijj=e.asm.Ha).apply(null,arguments)},e.dynCall_iiiiij=function(){return(e.dynCall_iiiiij=e.asm.Ia).apply(null,arguments)},e.dynCall_iiiiijj=function(){return(e.dynCall_iiiiijj=e.asm.Ja).apply(null,arguments)},ue=function e(){kt||Ct(),kt||(ue=e)},e.run=Ct,e.preInit)for("function"==typeof e.preInit&&(e.preInit=[e.preInit]);e.preInit.length>0;)e.preInit.pop()();return Ct(),e.ready});e.exports=o},770:function(__unused_webpack_module,exports,__webpack_require__){var $jscomp=$jscomp||{};$jscomp.scope={},$jscomp.arrayIteratorImpl=function(e){var t=0;return function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}},$jscomp.arrayIterator=function(e){return{next:$jscomp.arrayIteratorImpl(e)}},$jscomp.ASSUME_ES5=!1,$jscomp.ASSUME_NO_NATIVE_MAP=!1,$jscomp.ASSUME_NO_NATIVE_SET=!1,$jscomp.SIMPLE_FROUND_POLYFILL=!1,$jscomp.ISOLATE_POLYFILLS=!1,$jscomp.FORCE_POLYFILL_PROMISE=!1,$jscomp.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION=!1,$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,n){return e==Array.prototype||e==Object.prototype||(e[t]=n.value),e},$jscomp.getGlobal=function(e){e=["object"==typeof globalThis&&globalThis,e,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof __webpack_require__.g&&__webpack_require__.g];for(var t=0;t<e.length;++t){var n=e[t];if(n&&n.Math==Math)return n}throw Error("Cannot find global object")},$jscomp.global=$jscomp.getGlobal(this),$jscomp.IS_SYMBOL_NATIVE="function"==typeof Symbol&&"symbol"==typeof Symbol("x"),$jscomp.TRUST_ES6_POLYFILLS=!$jscomp.ISOLATE_POLYFILLS||$jscomp.IS_SYMBOL_NATIVE,$jscomp.polyfills={},$jscomp.propertyToPolyfillSymbol={},$jscomp.POLYFILL_PREFIX="$jscp$",$jscomp.polyfill=function(e,t,n,r){t&&($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(e,t,n,r):$jscomp.polyfillUnisolated(e,t,n,r))},$jscomp.polyfillUnisolated=function(e,t){var n=$jscomp.global;e=e.split(".");for(var r=0;r<e.length-1;r++){var o=e[r];if(!(o in n))return;n=n[o]}(t=t(r=n[e=e[e.length-1]]))!=r&&null!=t&&$jscomp.defineProperty(n,e,{configurable:!0,writable:!0,value:t})},$jscomp.polyfillIsolated=function(e,t,n){var r=e.split(".");e=1===r.length;var o=r[0];o=!e&&o in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var i=0;i<r.length-1;i++){var a=r[i];if(!(a in o))return;o=o[a]}r=r[r.length-1],null!=(t=t(n=$jscomp.IS_SYMBOL_NATIVE&&"es6"===n?o[r]:null))&&(e?$jscomp.defineProperty($jscomp.polyfills,r,{configurable:!0,writable:!0,value:t}):t!==n&&(void 0===$jscomp.propertyToPolyfillSymbol[r]&&(e=1e9*Math.random()>>>0,$jscomp.propertyToPolyfillSymbol[r]=$jscomp.IS_SYMBOL_NATIVE?$jscomp.global.Symbol(r):$jscomp.POLYFILL_PREFIX+e+"$"+r),$jscomp.defineProperty(o,$jscomp.propertyToPolyfillSymbol[r],{configurable:!0,writable:!0,value:t})))},$jscomp.initSymbol=function(){},$jscomp.polyfill("Symbol",function(e){if(e)return e;var t=function(e,t){this.$jscomp$symbol$id_=e,$jscomp.defineProperty(this,"description",{configurable:!0,writable:!0,value:t})};t.prototype.toString=function(){return this.$jscomp$symbol$id_};var n="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",r=0,o=function(e){if(this instanceof o)throw new TypeError("Symbol is not a constructor");return new t(n+(e||"")+"_"+r++,e)};return o},"es6","es3"),$jscomp.polyfill("Symbol.iterator",function(e){if(e)return e;e=Symbol("Symbol.iterator");for(var t="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),n=0;n<t.length;n++){var r=$jscomp.global[t[n]];"function"==typeof r&&"function"!=typeof r.prototype[e]&&$jscomp.defineProperty(r.prototype,e,{configurable:!0,writable:!0,value:function(){return $jscomp.iteratorPrototype($jscomp.arrayIteratorImpl(this))}})}return e},"es6","es3"),$jscomp.iteratorPrototype=function(e){return(e={next:e})[Symbol.iterator]=function(){return this},e},$jscomp.createTemplateTagFirstArg=function(e){return e.raw=e},$jscomp.createTemplateTagFirstArgWithRaw=function(e,t){return e.raw=t,e},$jscomp.makeIterator=function(e){var t="undefined"!=typeof Symbol&&Symbol.iterator&&e[Symbol.iterator];return t?t.call(e):$jscomp.arrayIterator(e)},$jscomp.arrayFromIterator=function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n},$jscomp.arrayFromIterable=function(e){return e instanceof Array?e:$jscomp.arrayFromIterator($jscomp.makeIterator(e))},$jscomp.objectCreate=$jscomp.ASSUME_ES5||"function"==typeof Object.create?Object.create:function(e){var t=function(){};return t.prototype=e,new t},$jscomp.getConstructImplementation=function(){if($jscomp.TRUST_ES6_POLYFILLS&&"undefined"!=typeof Reflect&&Reflect.construct){if(function(){function e(){}return new e,Reflect.construct(e,[],function(){}
vendor: 6,619 bytes, line 2
2),new e instanceof e}())return Reflect.construct;var e=Reflect.construct;return function(t,n,r){return t=e(t,n),r&&Reflect.setPrototypeOf(t,r.prototype),t}}return function(e,t,n){return void 0===n&&(n=e),n=$jscomp.objectCreate(n.prototype||Object.prototype),Function.prototype.apply.call(e,n,t)||n}},$jscomp.construct=$jscomp.getConstructImplementation(),$jscomp.underscoreProtoCanBeSet=function(){var e={};try{return e.__proto__={a:!0},e.a}catch(e){}return!1},$jscomp.setPrototypeOf=$jscomp.TRUST_ES6_POLYFILLS&&"function"==typeof Object.setPrototypeOf?Object.setPrototypeOf:$jscomp.underscoreProtoCanBeSet()?function(e,t){if(e.__proto__=t,e.__proto__!==t)throw new TypeError(e+" is not extensible");return e}:null,$jscomp.inherits=function(e,t){if(e.prototype=$jscomp.objectCreate(t.prototype),e.prototype.constructor=e,$jscomp.setPrototypeOf){var n=$jscomp.setPrototypeOf;n(e,t)}else for(n in t)if("prototype"!=n)if(Object.defineProperties){var r=Object.getOwnPropertyDescriptor(t,n);r&&Object.defineProperty(e,n,r)}else e[n]=t[n];e.superClass_=t.prototype},$jscomp.generator={},$jscomp.generator.ensureIteratorResultIsObject_=function(e){if(!(e instanceof Object))throw new TypeError("Iterator result "+e+" is not an object")},$jscomp.generator.Context=function(){this.isRunning_=!1,this.yieldAllIterator_=null,this.yieldResult=void 0,this.nextAddress=1,this.finallyAddress_=this.catchAddress_=0,this.finallyContexts_=this.abruptCompletion_=null},$jscomp.generator.Context.prototype.start_=function(){if(this.isRunning_)throw new TypeError("Generator is already running");this.isRunning_=!0},$jscomp.generator.Context.prototype.stop_=function(){this.isRunning_=!1},$jscomp.generator.Context.prototype.jumpToErrorHandler_=function(){this.nextAddress=this.catchAddress_||this.finallyAddress_},$jscomp.generator.Context.prototype.next_=function(e){this.yieldResult=e},$jscomp.generator.Context.prototype.throw_=function(e){this.abruptCompletion_={exception:e,isException:!0},this.jumpToErrorHandler_()},$jscomp.generator.Context.prototype.return=function(e){this.abruptCompletion_={return:e},this.nextAddress=this.finallyAddress_},$jscomp.generator.Context.prototype.jumpThroughFinallyBlocks=function(e){this.abruptCompletion_={jumpTo:e},this.nextAddress=this.finallyAddress_},$jscomp.generator.Context.prototype.yield=function(e,t){return this.nextAddress=t,{value:e}},$jscomp.generator.Context.prototype.yieldAll=function(e,t){var n=(e=$jscomp.makeIterator(e)).next();if($jscomp.generator.ensureIteratorResultIsObject_(n),!n.done)return this.yieldAllIterator_=e,this.yield(n.value,t);this.yieldResult=n.value,this.nextAddress=t},$jscomp.generator.Context.prototype.jumpTo=function(e){this.nextAddress=e},$jscomp.generator.Context.prototype.jumpToEnd=function(){this.nextAddress=0},$jscomp.generator.Context.prototype.setCatchFinallyBlocks=function(e,t){this.catchAddress_=e,null!=t&&(this.finallyAddress_=t)},$jscomp.generator.Context.prototype.setFinallyBlock=function(e){this.catchAddress_=0,this.finallyAddress_=e||0},$jscomp.generator.Context.prototype.leaveTryBlock=function(e,t){this.nextAddress=e,this.catchAddress_=t||0},$jscomp.generator.Context.prototype.enterCatchBlock=function(e){return this.catchAddress_=e||0,e=this.abruptCompletion_.exception,this.abruptCompletion_=null,e},$jscomp.generator.Context.prototype.enterFinallyBlock=function(e,t,n){n?this.finallyContexts_[n]=this.abruptCompletion_:this.finallyContexts_=[this.abruptCompletion_],this.catchAddress_=e||0,this.finallyAddress_=t||0},$jscomp.generator.Context.prototype.leaveFinallyBlock=function(e,t){if(t=this.finallyContexts_.splice(t||0)[0],t=this.abruptCompletion_=this.abruptCompletion_||t){if(t.isException)return this.jumpToErrorHandler_();null!=t.jumpTo&&this.finallyAddress_<t.jumpTo?(this.nextAddress=t.jumpTo,this.abruptCompletion_=null):this.nextAddress=this.finallyAddress_}else this.nextAddress=e},$jscomp.generator.Context.prototype.forIn=function(e){return new $jscomp.generator.Context.PropertyIterator(e)},$jscomp.generator.Context.PropertyIterator=function(e){for(var t in this.object_=e,this.properties_=[],e)this.properties_.push(t);this.properties_.reverse()},$jscomp.generator.Context.PropertyIterator.prototype.getNext=function(){for(;0<this.properties_.length;){var e=this.properties_.pop();if(e in this.object_)return e}return null},$jscomp.generator.Engine_=function(e){this.context_=new $jscomp.generator.Context,this.program_=e},$jscomp.generator.Engine_.prototype.next_=function(e){return this.context_.start_(),this.context_.yieldAllIterator_?this.yieldAllStep_(this.context_.yieldAllIterator_.next,e,this.context_.next_):(this.context_.next_(e),this.nextStep_())},$jscomp.generator.Engine_.prototype.return_=function(e){this.context_.start_();var t=this.context_.yieldAllIterator_;return t?this.yieldAllStep_("return"in t?t.return:function(e){return{value:e,done:!0}},e,this.context_.return):(this.context_.return(e),this.nextStep_())},$jscomp.generator.Engine_.prototype.throw_=function(e){return this.context_.start_(),this.context_.yieldAllIterator_?this.yieldAllStep_(this.context_.yieldAllIterator_.throw,e,this.context_.next_):(this.context_.throw_(e),this.nextStep_())},$jscomp.generator.Engine_.prototype.yieldAllStep_=function(e,t,n){try{var r=e.call(this.context_.yieldAllIterator_,t);if($jscomp.generator.ensureIteratorResultIsObject_(r),!r.done)return this.context_.stop_(),r;var o=r.value}catch(e){return this.context_.yieldAllIterator_=null,this.context_.throw_(e),this.nextStep_()}return this.context_.yieldAllIterator_=null,n.call(this.context_,o),this.nextStep_()},$jscomp.generator.Engine_.prototype.nextStep_=function(){for(;this.context_.nextAddress;)try{var e=this.program_(this.context_);if(e)return this.context_.stop_(),{value:e.value,done:!1}}catch(e){this.context_.yieldResult=void 0,this.context_.throw_(e)}if(this.context_.stop_(),this.context_.abruptCompletion_){if(e=this.context_.abruptCompletion_,this.context_.abruptCompletion_=null,e.isException)throw e.exception;return{value:e.return,done:!0}}return{value:void 0,done:!0}},$jscomp.generator.Generator_=function(e){this.next=function(t){return e.next_(t)},this.throw=function(t){return e.throw_(t)},this.return=function(t){return e.return_(t)},this[Symbol.iterator]=function(){return this}},$jscomp.generator.createGenerator=function(e,t){return t=new $jscomp.generator.Generator_(new $jscomp.generator.Engine_(t)),$jscomp.setPrototypeOf&&e.prototype&&$jscomp.setPrototypeOf(t,e.prototype),t},$jscomp.asyncExecutePromiseGenerator=function(e){function t(t){return e.next(t)}function n(t){return e.throw(t)}return new Promise(
2function(r,o){!function e(i){i.done?r(i.value):Promise.resolve(i.value).then(t,n).then(e,o)}(e.next())})},$jscomp.asyncExecutePromiseGeneratorFunction=function(e){return $jscomp.asyncExecutePromiseGenerator(e())},$jscomp.asyncExecutePromiseGeneratorProgram=function(e){return $jscomp.asyncExecutePromiseGenerator(new $jscomp.generator.Generator_(new $jscomp.generator.Engine_(e)))},$jscomp.polyfill("Reflect",function(e){return e||{}},"es6","es3"),$jscomp.polyfill("Reflect.construct",function(){return $jscomp.construct},"es6","es3"),$jscomp.polyfill("Reflect.setPrototypeOf",function(e){if(e)return e;if($jscomp.setPrototypeOf){var t=$jscomp.setPrototypeOf;return function(e,n){try{return t(e,n),!0}catch(e){return!1}}}return null},"es6","es5"),$jscomp.polyfill("Promise",function(e){function t(){this.batch_=null}function n(e){return e instanceof o?e:new o(function(t){t(e)})}if(e&&(!($jscomp.FORCE_POLYFILL_PROMISE||$jscomp.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION&&void 0===$jscomp.global.PromiseRejectionEvent)||!$jscomp.global.Promise||-1===$jscomp.global.Promise.toString().indexOf("[native code]")))return e;t.prototype.asyncExecute=function(e){if(null==this.batch_){this.batch_=[];var t=this;this.asyncExecuteFunction(function(){t.executeBatch_()})}this.batch_.push(e)};var r=$jscomp.global.setTimeout;t.prototype.asyncExecuteFunction=function(e){r(e,0)},t.prototype.executeBatch_=function(){for(;this.batch_&&this.batch_.length;){var e=this.batch_;this.batch_=[];for(var t=0;t<e.length;++t){var n=e[t];e[t]=null;try{n()}catch(e){this.asyncThrow_(e)}}}this.batch_=null},t.prototype.asyncThrow_=function(e){this.asyncExecuteFunction(function(){throw e})};var o=function(e){this.state_=0,this.result_=void 0,this.onSettledCallbacks_=[],this.isRejectionHandled_=!1;var t=this.createResolveAndReject_();try{e(t.resolve,t.reject)}catch(e){t.reject(e)}};o.prototype.createResolveAndReject_=function(){function e(e){return function(r){n||(n=!0,e.call(t,r))}}var t=this,n=!1;return{resolve:e(this.resolveTo_),reject:e(this.reject_)}},o.prototype.resolveTo_=function(e){if(e===this)this.reject_(new TypeError("A Promise cannot resolve to itself"));else if(e instanceof o)this.settleSameAsPromise_(e);else{e:switch(typeof e){case"object":var t=null!=e;break e;case"function":t=!0;break e;default:t=!1}t?this.resolveToNonPromiseObj_(e):this.fulfill_(e)}},o.prototype.resolveToNonPromiseObj_=function(e){var t=void 0;try{t=e.then}catch(e){return void this.reject_(e)}"function"==typeof t?this.settleSameAsThenable_(t,e):this.fulfill_(e)},o.prototype.reject_=function(e){this.settle_(2,e)},o.prototype.fulfill_=function(e){this.settle_(1,e)},o.prototype.settle_=function(e,t){if(0!=this.state_)throw Error("Cannot settle("+e+", "+t+"): Promise already settled in state"+this.state_);this.state_=e,this.result_=t,2===this.state_&&this.scheduleUnhandledRejectionCheck_(),this.executeOnSettledCallbacks_()},o.prototype.scheduleUnhandledRejectionCheck_=function(){var e=this;r(function(){if(e.notifyUnhandledRejection_()){var t=$jscomp.global.console;void 0!==t&&t.error(e.result_)}},1)},o.prototype.notifyUnhandledRejection_=function(){if(this.isRejectionHandled_)return!1;var e=$jscomp.global.CustomEvent,t=$jscomp.global.Event,n=$jscomp.global.dispatchEvent;return void 0===n||("function"==typeof e?e=new e("unhandledrejection",{cancelable:!0}):"function"==typeof t?e=new t("unhandledrejection",{cancelable:!0}):(e=$jscomp.global.document.createEvent("CustomEvent")).initCustomEvent("unhandledrejection",!1,!0,e),e.promise=this,e.reason=this.result_,n(e))},o.prototype.executeOnSettledCallbacks_=function(){if(null!=this.onSettledCallbacks_){for(var e=0;e<this.onSettledCallbacks_.length;++e)i.asyncExecute(this.onSettledCallbacks_[e]);this.onSettledCallbacks_=null}};var i=new t;return o.prototype.settleSameAsPromise_=function(e){var t=this.createResolveAndReject_();e.callWhenSettled_(t.resolve,t.reject)},o.prototype.settleSameAsThenable_=function(e,t){var n=this.createResolveAndReject_();try{e.call(t,n.resolve,n.reject)}catch(e){n.reject(e)}},o.prototype.then=function(e,t){function n(e,t){return"function"==typeof e?function(t){try{r(e(t))}catch(e){i(e)}}:t}var r,i,a=new o(function(e,t){r=e,i=t});return this.callWhenSettled_(n(e,r),n(t,i)),a},o.prototype.catch=function(e){return this.then(void 0,e)},o.prototype.callWhenSettled_=function(e,t){function n(){switch(r.state_){case 1:e(r.result_);break;case 2:t(r.result_);break;default:throw Error("Unexpected state: "+r.state_)}}var r=this;null==this.onSettledCallbacks_?i.asyncExecute(n):this.onSettledCallbacks_.push(n),this.isRejectionHandled_=!0},o.resolve=n,o.reject=function(e){return new o(function(t,n){n(e)})},o.race=function(e){return new o(function(t,r){for(var o=$jscomp.makeIterator(e),i=o.next();!i.done;i=o.next())n(i.value).callWhenSettled_(t,r)})},o.all=function(e){var t=$jscomp.makeIterator(e),r=t.next();return r.done?n([]):new o(function(e,o){function i(t){return function(n){a[t]=n,0==--s&&e(a)}}var a=[],s=0;do{a.push(void 0),s++,n(r.value).callWhenSettled_(i(a.length-1),o),r=t.next()}while(!r.done)})},o},"es6","es3"),$jscomp.findInternal=function(e,t,n){e instanceof String&&(e=String(e));for(var r=e.length,o=0;o<r;o++){var i=e[o];if(t.call(n,i,o,e))return{i:o,v:i}}return{i:-1,v:void 0}},$jscomp.polyfill("Array.prototype.find",function(e){return e||function(e,t){return $jscomp.findInternal(this,e,t).v}},"es6","es3"),$jscomp.checkEs6ConformanceViaProxy=function(){try{var e={},t=Object.create(new $jscomp.global.Proxy(e,{get:function(n,r,o){return n==e&&"q"==r&&o==t}}));return!0===t.q}catch(e){return!1}},$jscomp.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS=!1,$jscomp.ES6_CONFORMANCE=$jscomp.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS&&$jscomp.checkEs6ConformanceViaProxy(),$jscomp.owns=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},$jscomp.polyfill("WeakMap",function(e){function t(){}function n(e){var t=typeof e;return"object"===t&&null!==e||"function"===t}function r(e){if(!$jscomp.owns(e,i)){var n=new t;$jscomp.defineProperty(e,i,{value:n})}}function o(e){if(!$jscomp.ISOLATE_POLYFILLS){var n=Object[e];n&&(Object[e]=function(e){return e instanceof t?e:(Object.isExtensible(e)&&r(e),n(e))})}}if($jscomp.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS){if(e&&$jscomp.ES6_CONFORMANCE)return e}else if(function(){if(!e||!Object.seal)return!1;try{var t=Object.seal({}
vendor: 19,822 bytes, line 2
2),n=Object.seal({}),r=new e([[t,2],[n,3]]);return 2==r.get(t)&&3==r.get(n)&&(r.delete(t),r.set(n,4),!r.has(t)&&4==r.get(n))}catch(e){return!1}}())return e;var i="$jscomp_hidden_"+Math.random();o("freeze"),o("preventExtensions"),o("seal");var a=0,s=function(e){if(this.id_=(a+=Math.random()+1).toString(),e){e=$jscomp.makeIterator(e);for(var t;!(t=e.next()).done;)t=t.value,this.set(t[0],t[1])}};return s.prototype.set=function(e,t){if(!n(e))throw Error("Invalid WeakMap key");if(r(e),!$jscomp.owns(e,i))throw Error("WeakMap key fail: "+e);return e[i][this.id_]=t,this},s.prototype.get=function(e){return n(e)&&$jscomp.owns(e,i)?e[i][this.id_]:void 0},s.prototype.has=function(e){return n(e)&&$jscomp.owns(e,i)&&$jscomp.owns(e[i],this.id_)},s.prototype.delete=function(e){return!!(n(e)&&$jscomp.owns(e,i)&&$jscomp.owns(e[i],this.id_))&&delete e[i][this.id_]},s},"es6","es3"),$jscomp.MapEntry=function(){},$jscomp.polyfill("Map",function(e){if($jscomp.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS){if(e&&$jscomp.ES6_CONFORMANCE)return e}else if(function(){if($jscomp.ASSUME_NO_NATIVE_MAP||!e||"function"!=typeof e||!e.prototype.entries||"function"!=typeof Object.seal)return!1;try{var t=Object.seal({x:4}),n=new e($jscomp.makeIterator([[t,"s"]]));if("s"!=n.get(t)||1!=n.size||n.get({x:4})||n.set({x:4},"t")!=n||2!=n.size)return!1;var r=n.entries(),o=r.next();return!o.done&&o.value[0]==t&&"s"==o.value[1]&&!((o=r.next()).done||4!=o.value[0].x||"t"!=o.value[1]||!r.next().done)}catch(e){return!1}}())return e;var t=new WeakMap,n=function(e){if(this.data_={},this.head_=i(),this.size=0,e){e=$jscomp.makeIterator(e);for(var t;!(t=e.next()).done;)t=t.value,this.set(t[0],t[1])}};n.prototype.set=function(e,t){var n=r(this,e=0===e?0:e);return n.list||(n.list=this.data_[n.id]=[]),n.entry?n.entry.value=t:(n.entry={next:this.head_,previous:this.head_.previous,head:this.head_,key:e,value:t},n.list.push(n.entry),this.head_.previous.next=n.entry,this.head_.previous=n.entry,this.size++),this},n.prototype.delete=function(e){return!(!(e=r(this,e)).entry||!e.list||(e.list.splice(e.index,1),e.list.length||delete this.data_[e.id],e.entry.previous.next=e.entry.next,e.entry.next.previous=e.entry.previous,e.entry.head=null,this.size--,0))},n.prototype.clear=function(){this.data_={},this.head_=this.head_.previous=i(),this.size=0},n.prototype.has=function(e){return!!r(this,e).entry},n.prototype.get=function(e){return(e=r(this,e).entry)&&e.value},n.prototype.entries=function(){return o(this,function(e){return[e.key,e.value]})},n.prototype.keys=function(){return o(this,function(e){return e.key})},n.prototype.values=function(){return o(this,function(e){return e.value})},n.prototype.forEach=function(e,t){for(var n,r=this.entries();!(n=r.next()).done;)n=n.value,e.call(t,n[1],n[0],this)},n.prototype[Symbol.iterator]=n.prototype.entries;var r=function(e,n){var r=n&&typeof n;"object"==r||"function"==r?t.has(n)?r=t.get(n):(r=""+ ++a,t.set(n,r)):r="p_"+n;var o=e.data_[r];if(o&&$jscomp.owns(e.data_,r))for(e=0;e<o.length;e++){var i=o[e];if(n!=n&&i.key!=i.key||n===i.key)return{id:r,list:o,index:e,entry:i}}return{id:r,list:o,index:-1,entry:void 0}},o=function(e,t){var n=e.head_;return $jscomp.iteratorPrototype(function(){if(n){for(;n.head!=e.head_;)n=n.previous;for(;n.next!=n.head;)return n=n.next,{done:!1,value:t(n)};n=null}return{done:!0,value:void 0}})},i=function(){var e={};return e.previous=e.next=e.head=e},a=0;return n},"es6","es3"),$jscomp.iteratorFromArray=function(e,t){e instanceof String&&(e+="");var n=0,r=!1,o={next:function(){if(!r&&n<e.length){var o=n++;return{value:t(o,e[o]),done:!1}}return r=!0,{done:!0,value:void 0}}};return o[Symbol.iterator]=function(){return o},o},$jscomp.polyfill("Array.prototype.entries",function(e){return e||function(){return $jscomp.iteratorFromArray(this,function(e,t){return[e,t]})}},"es6","es3"),$jscomp.checkStringArgs=function(e,t,n){if(null==e)throw new TypeError("The 'this' value for String.prototype."+n+" must not be null or undefined");if(t instanceof RegExp)throw new TypeError("First argument to String.prototype."+n+" must not be a regular expression");return e+""},$jscomp.polyfill("String.prototype.endsWith",function(e){return e||function(e,t){var n=$jscomp.checkStringArgs(this,e,"endsWith");e+="",void 0===t&&(t=n.length),t=Math.max(0,Math.min(0|t,n.length));for(var r=e.length;0<r&&0<t;)if(n[--t]!=e[--r])return!1;return 0>=r}},"es6","es3"),$jscomp.polyfill("String.prototype.startsWith",function(e){return e||function(e,t){var n=$jscomp.checkStringArgs(this,e,"startsWith");e+="";var r=n.length,o=e.length;t=Math.max(0,Math.min(0|t,n.length));for(var i=0;i<o&&t<r;)if(n[t++]!=e[i++])return!1;return i>=o}},"es6","es3"),$jscomp.polyfill("Number.isFinite",function(e){return e||function(e){return"number"==typeof e&&!isNaN(e)&&1/0!==e&&-1/0!==e}},"es6","es3"),$jscomp.polyfill("String.prototype.repeat",function(e){return e||function(e){var t=$jscomp.checkStringArgs(this,null,"repeat");if(0>e||1342177279<e)throw new RangeError("Invalid count value");e|=0;for(var n="";e;)1&e&&(n+=t),(e>>>=1)&&(t+=t);return n}},"es6","es3"),$jscomp.polyfill("Object.setPrototypeOf",function(e){return e||$jscomp.setPrototypeOf},"es6","es5"),$jscomp.assign=$jscomp.TRUST_ES6_POLYFILLS&&"function"==typeof Object.assign?Object.assign:function(e,t){for(var n=1;n<arguments.length;n++){var r=arguments[n];if(r)for(var o in r)$jscomp.owns(r,o)&&(e[o]=r[o])}return e},$jscomp.polyfill("Object.assign",function(e){return e||$jscomp.assign},"es6","es3");var goog=goog||{};goog.global=this||self,goog.exportPath_=function(e,t,n,r){e=e.split("."),r=r||goog.global,e[0]in r||void 0===r.execScript||r.execScript("var "+e[0]);for(var o;e.length&&(o=e.shift());)if(e.length||void 0===t)r=r[o]&&r[o]!==Object.prototype[o]?r[o]:r[o]={};else if(!n&&goog.isObject(t)&&goog.isObject(r[o]))for(var i in t)t.hasOwnProperty(i)&&(r[o][i]=t[i]);else r[o]=t},goog.define=function(e,t){return t},goog.FEATURESET_YEAR=2012,goog.DEBUG=!0,goog.LOCALE="en",goog.getLocale=function(){return goog.LOCALE},goog.TRUSTED_SITE=!0,goog.DISALLOW_TEST_ONLY_CODE=!goog.DEBUG,goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING=!1,goog.provide=function(e){if(goog.isInModuleLoader_())throw Error("goog.provide cannot be used within a module.");goog.constructNamespace_(e)},goog.constructNamespace_=function(e,t,n){goog.exportPath_(e,t,n)},goog.NONCE_PATTERN_=/^[\w+/_-]+[=]{0,2}$/,goog.getScriptNonce_=function(e){return(e=(e=(e||goog.global).document).querySelector&&e.querySelector("script[nonce]"))&&(e=e.nonce||e.getAttribute("nonce"))&&goog.NONCE_PATTERN_.test(e)?e:""},goog.VALID_MODULE_RE_=/^[a-zA-Z_$][a-zA-Z0-9._$]*$/,goog.module=function(e){if("string"!=typeof e||!e||-1==e.search(goog.VALID_MODULE_RE_))throw Error("Invalid module identifier");if(!goog.isInGoogModuleLoader_())throw Error("Module "+e+" has been loaded incorrectly. Note, modules cannot be loaded as normal scripts. They require some kind of pre-processing step. You're likely trying to load a module via a script tag or as a part of a concatenated bundle without rewriting the module. For more info see: https://github.com/google/closure-library/wiki/goog.module:-an-ES6-module-like-alternative-to-goog.provide.");if(goog.moduleLoaderState_.moduleName)throw Error("goog.module may only be called once per module.");goog.moduleLoaderState_.moduleName=e},goog.module.get=function(e){return goog.module.getInternal_(e)},goog.module.getInternal_=function(){return null},goog.ModuleType={ES6:"es6",GOOG:"goog"},goog.moduleLoaderState_=null,goog.isInModuleLoader_=function(){return goog.isInGoogModuleLoader_()||goog.isInEs6ModuleLoader_()},goog.isInGoogModuleLoader_=function(){return!!goog.moduleLoaderState_&&goog.moduleLoaderState_.type==goog.ModuleType.GOOG},goog.isInEs6ModuleLoader_=function(){if(goog.moduleLoaderState_&&goog.moduleLoaderState_.type==goog.ModuleType.ES6)return!0;var e=goog.global.$jscomp;return!!e&&"function"==typeof e.getCurrentModulePath&&!!e.getCurrentModulePath()},goog.module.declareLegacyNamespace=function(){goog.moduleLoaderState_.declareLegacyNamespace=!0},goog.declareModuleId=function(e){if(goog.moduleLoaderState_)goog.moduleLoaderState_.moduleName=e;else{var t=goog.global.$jscomp;if(!t||"function"!=typeof t.getCurrentModulePath)throw Error('Module with namespace "'+e+'" has been loaded incorrectly.');t=t.require(t.getCurrentModulePath()),goog.loadedModules_[e]={exports:t,type:goog.ModuleType.ES6,moduleId:e}}},goog.setTestOnly=function(e){if(goog.DISALLOW_TEST_ONLY_CODE)throw e=e||"",Error("Importing test-only code into non-debug environment"+(e?": "+e:"."))},goog.forwardDeclare=function(){},goog.getObjectByName=function(e,t){e=e.split("."),t=t||goog.global;for(var n=0;n<e.length;n++)if(null==(t=t[e[n]]))return null;return t},goog.addDependency=function(){},goog.ENABLE_DEBUG_LOADER=!0,goog.logToConsole_=function(e){goog.global.console&&goog.global.console.error(e)},goog.require=function(){},goog.requireType=function(){return{}},goog.basePath="",goog.nullFunction=function(){},goog.abstractMethod=function(){throw Error("unimplemented abstract method")},goog.addSingletonGetter=function(e){e.instance_=void 0,e.getInstance=function(){return e.instance_?e.instance_:(goog.DEBUG&&(goog.instantiatedSingletons_[goog.instantiatedSingletons_.length]=e),e.instance_=new e)}},goog.instantiatedSingletons_=[],goog.LOAD_MODULE_USING_EVAL=!0,goog.SEAL_MODULE_EXPORTS=goog.DEBUG,goog.loadedModules_={},goog.DEPENDENCIES_ENABLED=!1,goog.TRANSPILE="detect",goog.ASSUME_ES_MODULES_TRANSPILED=!1,goog.TRANSPILE_TO_LANGUAGE="",goog.TRANSPILER="transpile.js",goog.TRUSTED_TYPES_POLICY_NAME="goog",goog.hasBadLetScoping=null,goog.loadModule=function(e){var t=goog.moduleLoaderState_;try{goog.moduleLoaderState_={moduleName:"",declareLegacyNamespace:!1,type:goog.ModuleType.GOOG};var n={},r=n;if("function"==typeof e)r=e.call(void 0,r);else{if("string"!=typeof e)throw Error("Invalid module definition");r=goog.loadModuleFromSource_.call(void 0,r,e)}var o=goog.moduleLoaderState_.moduleName;if("string"!=typeof o||!o)throw Error('Invalid module name "'+o+'"');goog.moduleLoaderState_.declareLegacyNamespace?goog.constructNamespace_(o,r,n!==r):goog.SEAL_MODULE_EXPORTS&&Object.seal&&"object"==typeof r&&null!=r&&Object.seal(r),goog.loadedModules_[o]={exports:r,type:goog.ModuleType.GOOG,moduleId:goog.moduleLoaderState_.moduleName}}finally{goog.moduleLoaderState_=t}},goog.loadModuleFromSource_=function(a,b){return eval(goog.CLOSURE_EVAL_PREFILTER_.createScript(b)),a},goog.normalizePath_=function(e){e=e.split("/");for(var t=0;t<e.length;)"."==e[t]?e.splice(t,1):t&&".."==e[t]&&e[t-1]&&".."!=e[t-1]?e.splice(--t,2):t++;return e.join("/")},goog.loadFileSync_=function(e){if(goog.global.CLOSURE_LOAD_FILE_SYNC)return goog.global.CLOSURE_LOAD_FILE_SYNC(e);try{var t=new goog.global.XMLHttpRequest;return t.open("get",e,!1),t.send(),0==t.status||200==t.status?t.responseText:null}catch(e){return null}},goog.transpile_=function(e,t,n){var r=goog.global.$jscomp;r||(goog.global.$jscomp=r={});var o=r.transpile;if(!o){var i=goog.basePath+goog.TRANSPILER,a=goog.loadFileSync_(i);if(a){if(function(){(0,eval)(a+"\n//# sourceURL="+i)}.call(goog.global),goog.global.$gwtExport&&goog.global.$gwtExport.$jscomp&&!goog.global.$gwtExport.$jscomp.transpile)throw Error('The transpiler did not properly export the "transpile" method. $gwtExport: '+JSON.stringify(goog.global.$gwtExport));goog.global.$jscomp.transpile=goog.global.$gwtExport.$jscomp.transpile,o=(r=goog.global.$jscomp).transpile}}return o||(o=r.transpile=function(e,t){return goog.logToConsole_(t+' requires transpilation but no transpiler was found. Please add "//javascript/closure:transpiler" as a data dependency to ensure it is included.'),e}),o(e,t,n)},goog.typeOf=function(e){var t=typeof e;return"object"!=t?t:e?Array.isArray(e)?"array":t:"null"},goog.isArrayLike=function(e){var t=goog.typeOf(e);return"array"==t||"object"==t&&"number"==typeof e.length},goog.isDateLike=function(e){return goog.isObject(e)&&"function"==typeof e.getFullYear},goog.isObject=function(e){var t=typeof e;return"object"==t&&null!=e||"function"==t},goog.getUid=function(e){return Object.prototype.hasOwnProperty.call(e,goog.UID_PROPERTY_)&&e[goog.UID_PROPERTY_]||(e[goog.UID_PROPERTY_]=++goog.uidCounter_)},goog.hasUid=function(e){return!!e[goog.UID_PROPERTY_]},goog.removeUid=function(e){null!==e&&"removeAttribute"in e&&e.removeAttribute(goog.UID_PROPERTY_);try{delete e[goog.UID_PROPERTY_]}catch(e){}},goog.UID_PROPERTY_="closure_uid_"+(1e9*Math.random()>>>0),goog.uidCounter_=0,goog.cloneObject=function(e){var t=goog.typeOf(e);if("object"==t||"array"==t){if("function"==typeof e.clone)return e.clone();if("undefined"!=typeof Map&&e instanceof Map)return new Map(e);if("undefined"!=typeof Set&&e instanceof Set)return new Set(e);for(var n in t="array"==t?[]:{},e)t[n]=goog.cloneObject(e[n]);return t}return e},goog.bindNative_=function(e,t,n){return e.call.apply(e.bind,arguments)},goog.bindJs_=function(e,t,n){if(!e)throw Error();if(2<arguments.length){var r=Array.prototype.slice.call(arguments,2);return function(){var n=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(n,r),e.apply(t,n)}}return function(){return e.apply(t,arguments)}},goog.bind=function(e,t,n){return Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?goog.bind=goog.bindNative_:goog.bind=goog.bindJs_,goog.bind.apply(null,arguments)},goog.partial=function(e,t){var n=Array.prototype.slice.call(arguments,1);return function(){var t=n.slice();return t.push.apply(t,arguments),e.apply(this,t)}},goog.mixin=function(e,t){for(var n in t)e[n]=t[n]},goog.now=function(){return Date.now()},goog.globalEval=function(e){(0,eval)(e)},goog.getCssName=function(e,t){if("."==String(e).charAt(0))throw Error('className passed in goog.getCssName must not start with ".". You passed: '+e);var n=function(e){return goog.cssNameMapping_[e]||e},r=function(e){e=e.split("-");for(var t=[],r=0;r<e.length;r++)t.push(n(e[r]));return t.join("-")};return r=goog.cssNameMapping_?"BY_WHOLE"==goog.cssNameMappingStyle_?n:r:function(e){return e},e=t?e+"-"+r(t):r(e),goog.global.CLOSURE_CSS_NAME_MAP_FN?goog.global.CLOSURE_CSS_NAME_MAP_FN(e):e},goog.setCssNameMapping=function(e,t){goog.cssNameMapping_=e,goog.cssNameMappingStyle_=t},goog.getMsg=function(e,t,n){return n&&n.html&&(e=e.replace(/</g,"&lt;")),n&&n.unescapeHtmlEntities&&(e=e.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&apos;/g,"'").replace(/&quot;/g,'"').replace(/&amp;/g,"&")),t&&(e=e.replace(/\{\$([^}]+)}/g,function(e,n){return null!=t&&n in t?t[n]:e})),e},goog.getMsgWithFallback=function(e){return e},goog.exportSymbol=function(e,t,n){goog.exportPath_(e,t,!0,n)},goog.exportProperty=function(e,t,n){e[t]=n},goog.inherits=function(e,t){function n(){}n.prototype=t.prototype,e.superClass_=t.prototype,e.prototype=new n,e.prototype.constructor=e,e.base=function(e,n,r){for(var o=Array(arguments.length-2),i=2;i<arguments.length;i++)o[i-2]=arguments[i];return t.prototype[n].apply(e,o)}},goog.scope=function(e){if(goog.isInModuleLoader_())throw Error("goog.scope is not supported within a module.");e.call(goog.global)},goog.defineClass=function(e,t){var n=t.constructor,r=t.statics;return n&&n!=Object.prototype.constructor||(n=function(){throw Error("cannot instantiate an interface (no constructor defined).")}),n=goog.defineClass.createSealingConstructor_(n,e),e&&goog.inherits(n,e),delete t.constructor,delete t.statics,goog.defineClass.applyProperties_(n.prototype,t),null!=r&&(r instanceof Function?r(n):goog.defineClass.applyProperties_(n,r)),n},goog.defineClass.SEAL_CLASS_INSTANCES=goog.DEBUG,goog.defineClass.createSealingConstructor_=function(e){return goog.defineClass.SEAL_CLASS_INSTANCES?function(){var t=e.apply(this,arguments)||this;return t[goog.UID_PROPERTY_]=t[goog.UID_PROPERTY_],t}:e},goog.defineClass.OBJECT_PROTOTYPE_FIELDS_="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),goog.defineClass.applyProperties_=function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);for(var r=0;r<goog.defineClass.OBJECT_PROTOTYPE_FIELDS_.length;r++)n=goog.defineClass.OBJECT_PROTOTYPE_FIELDS_[r],Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},goog.identity_=function(e){return e},goog.createTrustedTypesPolicy=function(e){var t=null,n=goog.global.trustedTypes;if(!n||!n.createPolicy)return t;try{t=n.createPolicy(e,{createHTML:goog.identity_,createScript:goog.identity_,createScriptURL:goog.identity_})}catch(e){goog.logToConsole_(e.message)}return t};var module$exports$jspb$BinaryConstants={FieldType:{INVALID:-1,DOUBLE:1,FLOAT:2,INT64:3,UINT64:4,INT32:5,FIXED64:6,FIXED32:7,BOOL:8,STRING:9,GROUP:10,MESSAGE:11,BYTES:12,UINT32:13,ENUM:14,SFIXED32:15,SFIXED64:16,SINT32:17,SINT64:18},WireType:{INVALID:-1,VARINT:0,FIXED64:1,DELIMITED:2,START_GROUP:3,END_GROUP:4,FIXED32:5}};function module$contents$jspb$BinaryConstants_isValidWireType(e){return 0<=e&&5>=e}function module$contents$jspb$BinaryConstants_FieldTypeToWireType(e){switch(e){case module$exports$jspb$BinaryConstants.FieldType.INT32:case module$exports$jspb$BinaryConstants.FieldType.INT64:case module$exports$jspb$BinaryConstants.FieldType.UINT32:case module$exports$jspb$BinaryConstants.FieldType.UINT64:case module$exports$jspb$BinaryConstants.FieldType.SINT32:case module$exports$jspb$BinaryConstants.FieldType.SINT64:case module$exports$jspb$BinaryConstants.FieldType.BOOL:case module$exports$jspb$BinaryConstants.FieldType.ENUM:return module$exports$jspb$BinaryConstants.WireType.VARINT;case module$exports$jspb$BinaryConstants.FieldType.DOUBLE:case module$exports$jspb$BinaryConstants.FieldType.FIXED64:case module$exports$jspb$BinaryConstants.FieldType.SFIXED64:return module$exports$jspb$BinaryConstants.WireType.FIXED64;case module$exports$jspb$BinaryConstants.FieldType.STRING:case module$exports$jspb$BinaryConstants.FieldType.MESSAGE:case module$exports$jspb$BinaryConstants.FieldType.BYTES:return module$exports$jspb$BinaryConstants.WireType.DELIMITED;case module$exports$jspb$BinaryConstants.FieldType.FLOAT:case module$exports$jspb$BinaryConstants.FieldType.FIXED32:case module$exports$jspb$BinaryConstants.FieldType.SFIXED32:return module$exports$jspb$BinaryConstants.WireType.FIXED32;default:return module$exports$jspb$BinaryConstants.WireType.INVALID}}module$exports$jspb$BinaryConstants.INVALID_FIELD_NUMBER=-1,module$exports$jspb$BinaryConstants.INVALID_TAG=-1,module$exports$jspb$BinaryConstants.FLOAT32_EPS=1401298464324817e-60,module$exports$jspb$BinaryConstants.FLOAT32_MIN=11754943508222875e-54,module$exports$jspb$BinaryConstants.FLOAT32_MAX=34028234663852886e22,module$exports$jspb$BinaryConstants.FLOAT64_EPS=5e-324,module$exports$jspb$BinaryConstants.FLOAT64_MIN=22250738585072014e-324,module$exports$jspb$BinaryConstants.FLOAT64_MAX=17976931348623157e292,module$exports$jspb$BinaryConstants.TWO_TO_20=1048576,module$exports$jspb$BinaryConstants.TWO_TO_23=8388608,module$exports$jspb$BinaryConstants.TWO_TO_31=2147483648,module$exports$jspb$BinaryConstants.TWO_TO_32=4294967296,module$exports$jspb$BinaryConstants.TWO_TO_52=4503599627370496,module$exports$jspb$BinaryConstants.TWO_TO_63=0x8000000000000000,module$exports$jspb$BinaryConstants.TWO_TO_64=0x10000000000000000,module$exports$jspb$BinaryConstants.ZERO_HASH="\0\0\0\0\0\0\0\0",module$exports$jspb$BinaryConstants.FieldTypeToWireType=module$contents$jspb$BinaryConstants_FieldTypeToWireType,module$exports$jspb$BinaryConstants.isValidWireType=module$contents$jspb$BinaryConstants_isValidWireType;var jspb={};function module$contents$jspb$binary$errors_invalidWireTypeError(e,t){return Error("Invalid wire type: "+e+" (at position "+t+")")}function module$contents$jspb$binary$errors_invalidVarintError(){return Error("Failed to read varint, encoding is invali
2d.")}function module$contents$jspb$binary$errors_readTooFarError(e,t){return Error("Tried to read past the end of the data "+t+" > "+e)}function module$contents$goog$debug$Error_DebugError(e,t){if(Error.captureStackTrace)Error.captureStackTrace(this,module$contents$goog$debug$Error_DebugError);else{var n=Error().stack;n&&(this.stack=n)}e&&(this.message=String(e)),void 0!==t&&(this.cause=t),this.reportErrorToServer=!0}jspb.ByteSource={}.ByteSource,goog.debug={},goog.inherits(module$contents$goog$debug$Error_DebugError,Error),module$contents$goog$debug$Error_DebugError.prototype.name="CustomError",goog.debug.Error=module$contents$goog$debug$Error_DebugError,goog.dom={},goog.dom.NodeType={ELEMENT:1,ATTRIBUTE:2,TEXT:3,CDATA_SECTION:4,ENTITY_REFERENCE:5,ENTITY:6,PROCESSING_INSTRUCTION:7,COMMENT:8,DOCUMENT:9,DOCUMENT_TYPE:10,DOCUMENT_FRAGMENT:11,NOTATION:12},goog.asserts={},goog.asserts.ENABLE_ASSERTS=goog.DEBUG,goog.asserts.AssertionError=function(e,t){module$contents$goog$debug$Error_DebugError.call(this,goog.asserts.subs_(e,t)),this.messagePattern=e},goog.inherits(goog.asserts.AssertionError,module$contents$goog$debug$Error_DebugError),goog.asserts.AssertionError.prototype.name="AssertionError",goog.asserts.DEFAULT_ERROR_HANDLER=function(e){throw e},goog.asserts.errorHandler_=goog.asserts.DEFAULT_ERROR_HANDLER,goog.asserts.subs_=function(e,t){for(var n="",r=(e=e.split("%s")).length-1,o=0;o<r;o++)n+=e[o]+(o<t.length?t[o]:"%s");return n+e[r]},goog.asserts.doAssertFailure_=function(e,t,n,r){var o="Assertion failed";if(n){o+=": "+n;var i=r}else e&&(o+=": "+e,i=t);
2e=new goog.asserts.AssertionError(""+o,i||[]),goog.asserts.errorHandler_(e)},goog.asserts.setErrorHandler=function(e){goog.asserts.ENABLE_ASSERTS&&(goog.asserts.errorHandler_=e)},goog.asserts.assert=function(e,t,n){return goog.asserts.ENABLE_ASSERTS&&!e&&goog.asserts.doAssertFailure_("",null,t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertExists=function(e,t,n){return goog.asserts.ENABLE_ASSERTS&&null==e&&goog.asserts.doAssertFailure_("Expected to exist: %s.",[e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.fail=function(e,t){goog.asserts.ENABLE_ASSERTS&&goog.asserts.errorHandler_(new goog.asserts.AssertionError("Failure"+(e?": "+e:""),Array.prototype.slice.call(arguments,1)))},goog.asserts.assertNumber=function(e,t,n){return goog.asserts.ENABLE_ASSERTS&&"number"!=typeof e&&goog.asserts.doAssertFailure_("Expected number but got %s: %s.",[goog.typeOf(e),e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertString=function(e,t,n){return goog.asserts.ENABLE_ASSERTS&&"string"!=typeof e&&goog.asserts.doAssertFailure_("Expected string but got %s: %s.",[goog.typeOf(e),e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertFunction=function(e,t,n){return goog.asserts.ENABLE_ASSERTS&&"function"!=typeof e&&goog.asserts.doAssertFailure_("Expected function but got %s: %s.",[goog.typeOf(e),e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertObject=function(e,t,n){return goog.asserts.ENABLE_ASSERTS&&!goog.isObject(e)&&goog.asserts.doAssertFailure_("Expected object but got %s: %s.",[goog.typeOf(e),e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertArray=function(e,t,n){return goog.asserts.ENABLE_ASSERTS&&!Array.isArray(e)&&goog.asserts.doAssertFailure_("Expected array but got %s: %s.",[goog.typeOf(e),e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertBoolean=function(e,t,n){return goog.asserts.ENABLE_ASSERTS&&"boolean"!=typeof e&&goog.asserts.doAssertFailure_("Expected boolean but got %s: %s.",[goog.typeOf(e),e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertElement=function(e,t,n){return!goog.asserts.ENABLE_ASSERTS||goog.isObject(e)&&e.nodeType==goog.dom.NodeType.ELEMENT||goog.asserts.doAssertFailure_("Expected Element but got %s: %s.",[goog.typeOf(e),e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertInstanceof=function(e,t,n,r){return!goog.asserts.ENABLE_ASSERTS||e instanceof t||goog.asserts.doAssertFailure_("Expected instanceof %s but got %s.",[goog.asserts.getType_(t),goog.asserts.getType_(e)],n,Array.prototype.slice.call(arguments,3)),e},goog.asserts.assertFinite=function(e,t,n){return!goog.asserts.ENABLE_ASSERTS||"number"==typeof e&&isFinite(e)||goog.asserts.doAssertFailure_("Expected %s to be a finite number but it is not.",[e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.getType_=function(e){return e instanceof Function?e.displayName||e.name||"unknown type name":e instanceof Object?e.constructor.displayName||e.constructor.name||Object.prototype.toString.call(e):null===e?"null":typeof e};var module$contents$jspb$binary$utf8_ENFORCE_UTF8=goog.DEBUG?"ALWAYS":"DEFAULT";(0,goog.asserts.assert)("NEVER"===module$contents$jspb$binary$utf8_ENFORCE_UTF8||"DEFAULT"===module$contents$jspb$binary$utf8_ENFORCE_UTF8||"ALWAYS"===module$contents$jspb$binary$utf8_ENFORCE_UTF8);var module$contents$jspb$binary$utf8_REJECT_UNPAIRED_SURROGATES=goog.DEBUG,module$contents$jspb$binary$utf8_USE_TEXT_ENCODING=2020<=goog.FEATURESET_YEAR,module$contents$jspb$binary$utf8_fatalDecoderInstance,module$contents$jspb$binary$utf8_nonFatalDecoderInstance;function module$contents$jspb$binary$utf8_utf8ErrorsAreFatal(e){return"ALWAYS"===module$contents$jspb$binary$utf8_ENFORCE_UTF8||"NEVER"!==module$contents$jspb$binary$utf8_ENFORCE_UTF8&&e}function module$contents$jspb$binary$utf8_invalid(e,t){if(module$contents$jspb$binary$utf8_utf8ErrorsAreFatal(e))throw Error("Invalid UTF8");t.push(65533)}function module$contents$jspb$binary$utf8_codeUnitsToString(e,t){return t=String.fromCharCode.apply(null,t),null==e?t:e+t}function module$contents$jspb$binary$utf8_polyfillDecodeUtf8(e,t,n,r){n=t+n;for(var o,i,a,s,l=[],u=null;t<n;)128>(o=e[t++])?l.push(o):224>o?t>=n?module$contents$jspb$binary$utf8_invalid(r,l):(i=e[t++],194>o||128!=(192&i)?(t--,module$contents$jspb$binary$utf8_invalid(r,l)):(o=(31&o)<<6|63&i,(0,goog.asserts.assert)(128<=o&&2047>=o),l.push(o))):240>o?t>=n-1?module$contents$jspb$binary$utf8_invalid(r,l):128!=(192&(i=e[t++]))||224===o&&160>i||237===o&&160<=i||128!=(192&(a=e[t++]))?(t--,module$contents$jspb$binary$utf8_invalid(r,l)):(o=(15&o)<<12|(63&i)<<6|63&a,(0,goog.asserts.assert)(2048<=o&&65535>=o),(0,goog.asserts.assert)(55296>o||57343<o),l.push(o)):244>=o?t>=n-2?module$contents$jspb$binary$utf8_invalid(r,l):128!=(192&(i=e[t++]))||i-144+(o<<28)>>30||128!=(192&(a=e[t++]))||128!=(192&(s=e[t++]))?(t--,module$contents$jspb$binary$utf8_invalid(r,l)):(o=(7&o)<<18|(63&i)<<12|(63&a)<<6|63&s,(0,goog.asserts.assert)(65536<=o&&1114111>=o),o-=65536,l.push(55296+(o>>10&1023),56320+(1023&o))):module$contents$jspb$binary$utf8_invalid(r,l),8192<=l.length&&(u=module$contents$jspb$binary$utf8_codeUnitsToString(u,l),l.length=0);return(0,goog.asserts.assert)(t===n,"expected "+t+" === "+n),module$contents$jspb$binary$utf8_codeUnitsToString(u,l)}function module$contents$jspb$binary$utf8_getFatalDecoderInstance(){var e=module$contents$jspb$binary$utf8_fatalDecoderInstance;return e||(e=module$contents$jspb$binary$utf8_fatalDecoderInstance=new TextDecoder("utf-8",{fatal:!0})),e}function module$contents$jspb$binary$utf8_getNonFatalDecoderInstance(){var e=module$contents$jspb$binary$utf8_nonFatalDecoderInstance;return e||(e=module$contents$jspb$binary$utf8_nonFatalDecoderInstance=new TextDecoder("utf-8",{fatal:!1})),e}var module$contents$jspb$binary$utf8_useTextDecoderDecode=module$contents$jspb$binary$utf8_USE_TEXT_ENCODING||"undefined"!=typeof TextDecoder,module$contents$jspb$binary$utf8_textEncoderInstance,module$contents$jspb$binary$utf8_useTextEncoderEncode=module$contents$jspb$binary$utf8_USE_TEXT_ENCODING||"undefined"!=typeof TextEncoder;function module$contents$jspb$binary$utf8_encodeUtf8(e,t){if((0,goog.asserts.assertString)(e),module$contents$jspb$binary$utf8_useTextEncoderEncode){if((void 0!==t&&t||module$contents$jspb$binary$utf8_REJECT_UNPAIRED_SURROGATES)&&/(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])/.test(e))throw Error("Found an unpaired surrogate");e=(module$contents$jspb$binary$utf8_textEncoderInstance||(module$contents$jspb$binary$utf8_textEncoderInstance=new TextEncoder)).encode(e)}else{t=void 0!==t&&t;for(var n=0,r=new Uint8Array(3*e.length),o=0;o<e.length;o++){var i=e.charCodeAt(o);if(128>i)r[n++]=i;else{if(2048>i)r[n++]=i>>6|192;else{if((0,goog.asserts.assert)(65536>i),55296<=i&&57343>=i){if(56319>=i&&o<e.length){var a=e.charCodeAt(++o);if(56320<=a&&57343>=a){i=1024*(i-55296)+a-56320+65536,r[n++]=i>>18|240,r[n++]=i>>12&63|128,r[n++]=i>>6&63|128,r[n++]=63&i|128;continue}o--}if(t||module$contents$jspb$binary$utf8_REJECT_UNPAIRED_SURROGATES)throw Error("Found an unpaired surrogate");i=65533}r[n++]=i>>12|224,r[n++]=i>>6&63|128}r[n++]=63&i|128}}e=r.subarray(0,n)}return e}goog.crypt={},goog.crypt.stringToByteArray=function(e){for(var t=[],n=0,r=0;r<e.length;r++){var o=e.charCodeAt(r);255<o&&(t[n++]=255&o,o>>=8),t[n++]=o}return t},goog.crypt.byteArrayToString=function(e){if(8192>=e.length)return String.fromCharCode.apply(null,e);for(var t="",n=0;n<e.length;n+=8192){var r=Array.prototype.slice.call(e,n,n+8192);t+=String.fromCharCode.apply(null,r)}return t},goog.crypt.byteArrayToHex=function(e,t){return Array.prototype.map.call(e,function(e){return 1<(e=e.toString(16)).length?e:"0"+e}).join(t||"")},goog.crypt.hexToByteArray=function(e){goog.asserts.assert(0==e.length%2,"Key string length must be multiple of 2");for(var t=[],n=0;n<e.length;n+=2)t.push(parseInt(e.substring(n,n+2),16));return t},goog.crypt.stringToUtf8ByteArray=function(e){for(var t=[],n=0,r=0;r<e.length;r++){var o=e.charCodeAt(r);128>o?t[n++]=o:(2048>o?t[n++]=o>>6|192:(55296==(64512&o)&&r+1<e.length&&56320==(64512&e.charCodeAt(r+1))?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++r)),t[n++]=o>>18|240,t[n++]=o>>12&63|128):t[n++]=o>>12|224,t[n++]=o>>6&63|128),t[n++]=63&o|128)}return t},goog.crypt.utf8ByteArrayToString=function(e){for(var t=[],n=0,r=0;n<e.length;){var o=e[n++];if(128>o)t[r++]=String.fromCharCode(o);else if(191<o&&224>o){var i=e[n++];t[r++]=String.fromCharCode((31&o)<<6|63&i)}else if(239<o&&365>o){i=e[n++];var a=e[n++];o=((7&o)<<18|(63&i)<<12|(63&a)<<6|63&e[n++])-65536,t[r++]=String.fromCharCode(55296+(o>>10)),t[r++]=String.fromCharCode(56320+(1023&o))}
vendor: 7,547 bytes, line 2
2else i=e[n++],a=e[n++],t[r++]=String.fromCharCode((15&o)<<12|(63&i)<<6|63&a)}return t.join("")},goog.crypt.xorByteArray=function(e,t){goog.asserts.assert(e.length==t.length,"XOR array lengths must match");for(var n=[],r=0;r<e.length;r++)n.push(e[r]^t[r]);return n},goog.string={},goog.string.internal={},goog.string.internal.startsWith=function(e,t){return 0==e.lastIndexOf(t,0)},goog.string.internal.endsWith=function(e,t){var n=e.length-t.length;return 0<=n&&e.indexOf(t,n)==n},goog.string.internal.caseInsensitiveStartsWith=function(e,t){return 0==goog.string.internal.caseInsensitiveCompare(t,e.substr(0,t.length))},goog.string.internal.caseInsensitiveEndsWith=function(e,t){return 0==goog.string.internal.caseInsensitiveCompare(t,e.substr(e.length-t.length,t.length))},goog.string.internal.caseInsensitiveEquals=function(e,t){return e.toLowerCase()==t.toLowerCase()},goog.string.internal.isEmptyOrWhitespace=function(e){return/^[\s\xa0]*$/.test(e)},goog.string.internal.trim=goog.TRUSTED_SITE&&String.prototype.trim?function(e){return e.trim()}:function(e){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(e)[1]},goog.string.internal.caseInsensitiveCompare=function(e,t){return(e=String(e).toLowerCase())<(t=String(t).toLowerCase())?-1:e==t?0:1},goog.string.internal.newLineToBr=function(e,t){return e.replace(/(\r\n|\r|\n)/g,t?"<br />":"<br>")},goog.string.internal.htmlEscape=function(e,t){if(t)e=e.replace(goog.string.internal.AMP_RE_,"&amp;").replace(goog.string.internal.LT_RE_,"&lt;").replace(goog.string.internal.GT_RE_,"&gt;").replace(goog.string.internal.QUOT_RE_,"&quot;").replace(goog.string.internal.SINGLE_QUOTE_RE_,"&#39;").replace(goog.string.internal.NULL_RE_,"&#0;");else{if(!goog.string.internal.ALL_RE_.test(e))return e;-1!=e.indexOf("&")&&(e=e.replace(goog.string.internal.AMP_RE_,"&amp;")),-1!=e.indexOf("<")&&(e=e.replace(goog.string.internal.LT_RE_,"&lt;")),-1!=e.indexOf(">")&&(e=e.replace(goog.string.internal.GT_RE_,"&gt;")),-1!=e.indexOf('"')&&(e=e.replace(goog.string.internal.QUOT_RE_,"&quot;")),-1!=e.indexOf("'")&&(e=e.replace(goog.string.internal.SINGLE_QUOTE_RE_,"&#39;")),-1!=e.indexOf("\0")&&(e=e.replace(goog.string.internal.NULL_RE_,"&#0;"))}return e},goog.string.internal.AMP_RE_=/&/g,goog.string.internal.LT_RE_=/</g,goog.string.internal.GT_RE_=/>/g,goog.string.internal.QUOT_RE_=/"/g,goog.string.internal.SINGLE_QUOTE_RE_=/'/g,goog.string.internal.NULL_RE_=/\x00/g,goog.string.internal.ALL_RE_=/[\x00&<>"']/,goog.string.internal.whitespaceEscape=function(e,t){return goog.string.internal.newLineToBr(e.replace(/  /g," &#160;"),t)},goog.string.internal.contains=function(e,t){return-1!=e.indexOf(t)},goog.string.internal.caseInsensitiveContains=function(e,t){return goog.string.internal.contains(e.toLowerCase(),t.toLowerCase())},goog.string.internal.compareVersions=function(e,t){var n=0;e=goog.string.internal.trim(String(e)).split("."),t=goog.string.internal.trim(String(t)).split(".");for(var r=Math.max(e.length,t.length),o=0;0==n&&o<r;o++){var i=e[o]||"",a=t[o]||"";do{if(i=/(\d*)(\D*)(.*)/.exec(i)||["","","",""],a=/(\d*)(\D*)(.*)/.exec(a)||["","","",""],0==i[0].length&&0==a[0].length)break;n=goog.string.internal.compareElements_(0==i[1].length?0:parseInt(i[1],10),0==a[1].length?0:parseInt(a[1],10))||goog.string.internal.compareElements_(0==i[2].length,0==a[2].length)||goog.string.internal.compareElements_(i[2],a[2]),i=i[3],a=a[3]}while(0==n)}return n},goog.string.internal.compareElements_=function(e,t){return e<t?-1:e>t?1:0};var module$exports$goog$labs$userAgent={USE_CLIENT_HINTS:!1};function module$contents$goog$labs$userAgent$util_getNativeUserAgentString(){var e=goog.global.navigator;return e&&(e=e.userAgent)?e:""}function module$contents$goog$labs$userAgent$util_getNativeUserAgentData(){if(!module$exports$goog$labs$userAgent.USE_CLIENT_HINTS)return null;var e=goog.global.navigator;return e&&e.userAgentData||null}goog.labs={},goog.labs.userAgent={},goog.labs.userAgent.util={};var module$contents$goog$labs$userAgent$util_userAgentInternal=null,module$contents$goog$labs$userAgent$util_userAgentDataInternal=module$contents$goog$labs$userAgent$util_getNativeUserAgentData();function module$contents$goog$labs$userAgent$util_getUserAgent(){return null==module$contents$goog$labs$userAgent$util_userAgentInternal?module$contents$goog$labs$userAgent$util_getNativeUserAgentString():module$contents$goog$labs$userAgent$util_userAgentInternal}function module$contents$goog$labs$userAgent$util_matchUserAgentDataBrand(e){return!!module$contents$goog$labs$userAgent$util_userAgentDataInternal&&module$contents$goog$labs$userAgent$util_userAgentDataInternal.brands.some(function(t){return(t=t.brand)&&(0,goog.string.internal.contains)(t,e)})}function module$contents$goog$labs$userAgent$util_matchUserAgent(e){return(0,goog.string.internal.contains)(module$contents$goog$labs$userAgent$util_getUserAgent(),e)}function module$contents$goog$labs$userAgent$util_matchUserAgentIgnoreCase(e){return(0,goog.string.internal.caseInsensitiveContains)(module$contents$goog$labs$userAgent$util_getUserAgent(),e)}function module$contents$goog$labs$userAgent$util_extractVersionTuples(e){for(var t,n=RegExp("([A-Z][\\w ]+)/([^\\s]+)\\s*(?:\\((.*?)\\))?","g"),r=[];t=n.exec(e);)r.push([t[1],t[2],t[3]||void 0]);return r}goog.labs.userAgent.util.ASSUME_CLIENT_HINTS_SUPPORT=!1,goog.labs.userAgent.util.extractVersionTuples=module$contents$goog$labs$userAgent$util_extractVersionTuples,goog.labs.userAgent.util.getNativeUserAgentString=module$contents$goog$labs$userAgent$util_getNativeUserAgentString,goog.labs.userAgent.util.getUserAgent=module$contents$goog$labs$userAgent$util_getUserAgent,goog.labs.userAgent.util.getUserAgentData=function(){return module$contents$goog$labs$userAgent$util_userAgentDataInternal},goog.labs.userAgent.util.matchUserAgent=module$contents$goog$labs$userAgent$util_matchUserAgent,goog.labs.userAgent.util.matchUserAgentDataBrand=module$contents$goog$labs$userAgent$util_matchUserAgentDataBrand,goog.labs.userAgent.util.matchUserAgentIgnoreCase=module$contents$goog$labs$userAgent$util_matchUserAgentIgnoreCase,goog.labs.userAgent.util.resetUserAgentData=function(){module$contents$goog$labs$userAgent$util_userAgentDataInternal=module$contents$goog$labs$userAgent$util_getNativeUserAgentData()},goog.labs.userAgent.util.setUserAgent=function(e){module$contents$goog$labs$userAgent$util_userAgentInternal="string"==typeof e?e:module$contents$goog$labs$userAgent$util_getNativeUserAgentString()},goog.labs.userAgent.util.setUserAgentData=function(e){module$contents$goog$labs$userAgent$util_userAgentDataInternal=e};var module$exports$goog$labs$userAgent$highEntropy$highEntropyValue={AsyncValue:function(){}};module$exports$goog$labs$userAgent$highEntropy$highEntropyValue.AsyncValue.prototype.getIfLoaded=function(){},module$exports$goog$labs$userAgent$highEntropy$highEntropyValue.AsyncValue.prototype.load=function(){},module$exports$goog$labs$userAgent$highEntropy$highEntropyValue.HighEntropyValue=function(e){this.key_=e,this.promise_=this.value_=void 0,this.pending_=!1},module$exports$goog$labs$userAgent$highEntropy$highEntropyValue.HighEntropyValue.prototype.getIfLoaded=function(){if(module$contents$goog$labs$userAgent$util_userAgentDataInternal)return this.value_},module$exports$goog$labs$userAgent$highEntropy$highEntropyValue.HighEntropyValue.prototype.load=function(){var e,t=this;return $jscomp.asyncExecutePromiseGeneratorProgram(function(n){return 1==n.nextAddress?(e=module$contents$goog$labs$userAgent$util_userAgentDataInternal)?(t.promise_||(t.pen
2ding_=!0,t.promise_=$jscomp.asyncExecutePromiseGeneratorProgram(function(n){return 1==n.nextAddress?(n.setFinallyBlock(2),n.yield(e.getHighEntropyValues([t.key_]),4)):2!=n.nextAddress?(r=n.yieldResult,t.value_=r[t.key_],n.return(t.value_)):(n.enterFinallyBlock(),t.pending_=!1,n.leaveFinallyBlock(0))})),n.yield(t.promise_,2)):n.return(void 0):n.return(n.yieldResult);var r})},module$exports$goog$labs$userAgent$highEntropy$highEntropyValue.HighEntropyValue.prototype.resetForTesting=function(){if(this.pending_)throw Error("Unsafe call to resetForTesting");this.value_=this.promise_=void 0,this.pending_=!1},module$exports$goog$labs$userAgent$highEntropy$highEntropyValue.Version=function(e){this.versionString_=e},module$exports$goog$labs$userAgent$highEntropy$highEntropyValue.Version.prototype.toVersionStringForLogging=function(){return this.versionString_},module$exports$goog$labs$userAgent$highEntropy$highEntropyValue.Version.prototype.isAtLeast=function(e){return 0<=(0,goog.string.internal.compareVersions)(this.versionString_,e)};var module$exports$goog$labs$userAgent$highEntropy$highEntropyData={},module$contents$goog$labs$userAgent$highEntropy$highEntropyData_fullVersionListAvailable=!1;module$exports$goog$labs$userAgent$highEntropy$highEntropyData.hasFullVersionList=function(){return module$contents$goog$labs$userAgent$highEntropy$highEntropyData_fullVersionListAvailable},module$exports$goog$labs$userAgent$highEntropy$highEntropyData.setHasFullVersionListForTesting=function(e){module$contents$goog$labs$userAgent$highEntropy$highEntropyData_fullVersionListAvailable=e},module$exports$goog$labs$userAgent$highEntropy$highEntropyData.fullVersionList=new module$exports$goog$labs$userAgent$highEntropy$highEntropyValue.HighEntropyValue("fullVersionList"),module$exports$goog$labs$userAgent$highEntropy$highEntropyData.platformVersion=new module$exports$goog$labs$userAgent$highEntropy$highEntropyValue.HighEntropyValue("platformVersion"),module$exports$goog$labs$userAgent$highEntropy$highEntropyData.resetAllForTesting=function(){module$exports$goog$labs$userAgent$highEntropy$highEntropyData.fullVersionList.resetForTesting(),module$exports$goog$labs$userAgent$highEntropy$highEntropyData.platformVersion.resetForTesting()},goog.labs.userAgent.browser={};var module$contents$goog$labs$userAgent$browser_Brand={ANDROID_BROWSER:"Android Browser",CHROMIUM:"Chromium",EDGE:"Microsoft Edge",FIREFOX:"Firefox",IE:"Internet Explorer",OPERA:"Opera",SAFARI:"Safari",SILK:"Silk"};function module$contents$goog$labs$userAgent$browser_useUserAgentDataBrand(){return!!module$contents$goog$labs$userAgent$util_userAgentDataInternal&&0<module$contents$goog$labs$userAgent$util_userAgentDataInternal.brands.length}function module$contents$goog$labs$userAgent$browser_matchOpera(){return!module$contents$goog$labs$userAgent$browser_useUserAgentDataBrand()&&module$contents$goog$labs$userAgent$util_matchUserAgent("Opera")}function module$contents$goog$labs$userAgent$browser_matchIE(){return!module$contents$goog$labs$userAgent$browser_useUserAgentDataBrand()&&(module$contents$goog$labs$userAgent$util_matchUserAgent("Trident")||module$contents$goog$labs$userAgent$util_matchUserAgent("MSIE"))}function module$contents$goog$labs$userAgent$browser_matchEdgeHtml(){return!module$contents$goog$labs$userAgent$browser_useUserAgentDataBrand()&&module$contents$goog$labs$userAgent$util_matchUserAgent("Edge")}function module$contents$goog$labs$userAgent$browser_matchEdgeChromium(){return module$contents$goog$labs$userAgent$browser_useUserAgentDataBrand()?module$contents$goog$labs$userAgent$util_matchUserAgentDataBrand(module$contents$goog$labs$userAgent$browser_Brand.EDGE):module$contents$goog$labs$userAgent$util_matchUserAgent("Edg/")}function module$contents$goog$labs$userAgent$browser_matchOperaChromium(){return module$contents$goog$labs$userAgent$browser_useUserAgentDataBrand()?module$contents$goog$labs$userAgent$util_matchUserAgentDataBrand(module$contents$goog$labs$userAgent$browser_Brand.OPERA):module$contents$goog$labs$userAgent$util_matchUserAgent("OPR")}function module$contents$goog$labs$userAgent$browser_matchFirefox(){return module$contents$goog$labs$userAgent$util_matchUserAgent("Firefox")||module$contents$goog$labs$userAgent$util_matchUserAgent("FxiOS")}function module$contents$goog$labs$userAgent$browser_matchSafari(){return module$contents$goog$labs$userAgent$util_matchUserAgent("Safari")&&!(module$contents$goog$labs$userAgent$browser_matchChrome()||module$contents$goog$labs$userAgent$browser_matchCoast()||module$contents$goog$labs$userAgent$browser_matchOpera()||module$contents$goog$labs$userAgent$browser_matchEdgeHtml()||module$contents$goog$labs$userAgent$browser_matchEdgeChromium()||module$contents$goog$labs$userAgent$browser_matchOperaChromium()||module$contents$goog$labs$userAgent$browser_matchFirefox()||module$contents$goog$labs$userAgent$browser_isSilk()||module$contents$goog$labs$userAgent$util_matchUserAgent("Android"))}function module$contents$goog$labs$userAgent$browser_matchCoast(){return!module$contents$goog$labs$userAgent$browser_useUserAgentDataBrand()&&module$contents$goog$labs$userAgent$util_matchUserAgent("Coast")}function module$contents$goog$labs$userAgent$browser_matchChrome(){return module$contents$goog$labs$userAgent$browser_useUserAgentDataBrand()?module$contents$goog$labs$userAgent$util_matchUserAgentDataBrand(module$contents$goog$labs$userAgent$browser_Brand.CHROMIUM):(module$contents$goog$labs$userAgent$util_matchUserAgent("Chrome")||module$contents$goog$labs$userAgent$util_matchUserAgent("CriOS"))&&!module$contents$goog$labs$userAgent$browser_matchEdgeHtml()||module$contents$goog$labs$userAgent$browser_isSilk()}function module$contents$goog$labs$userAgent$browser_matchAndroid
vendor: 5,524 bytes, line 2
2Browser(){return module$contents$goog$labs$userAgent$util_matchUserAgent("Android")&&!(module$contents$goog$labs$userAgent$browser_matchChrome()||module$contents$goog$labs$userAgent$browser_matchFirefox()||module$contents$goog$labs$userAgent$browser_matchOpera()||module$contents$goog$labs$userAgent$browser_isSilk())}function module$contents$goog$labs$userAgent$browser_isSilk(){return module$contents$goog$labs$userAgent$util_matchUserAgent("Silk")}function module$contents$goog$labs$userAgent$browser_createVersionMap(e){var t={};return e.forEach(function(e){t[e[0]]=e[1]}),function(e){return t[e.find(function(e){return e in t})]||""}}function module$contents$goog$labs$userAgent$browser_getVersion(){var e=module$contents$goog$labs$userAgent$util_getUserAgent();if(module$contents$goog$labs$userAgent$browser_matchIE())return module$contents$goog$labs$userAgent$browser_getIEVersion(e);var t=module$contents$goog$labs$userAgent$browser_createVersionMap(e=module$contents$goog$labs$userAgent$util_extractVersionTuples(e));return module$contents$goog$labs$userAgent$browser_matchOpera()?t(["Version","Opera"]):module$contents$goog$labs$userAgent$browser_matchEdgeHtml()?t(["Edge"]):module$contents$goog$labs$userAgent$browser_matchEdgeChromium()?t(["Edg"]):module$contents$goog$labs$userAgent$browser_isSilk()?t(["Silk"]):module$contents$goog$labs$userAgent$browser_matchChrome()?t(["Chrome","CriOS","HeadlessChrome"]):(e=e[2])&&e[1]||""}function module$contents$goog$labs$userAgent$browser_getIEVersion(e){var t=/rv: *([\d\.]*)/.exec(e);if(t&&t[1])return t[1];t="";var n=/MSIE +([\d\.]+)/.exec(e);if(n&&n[1])if(e=/Trident\/(\d.\d)/.exec(e),"7.0"==n[1])if(e&&e[1])switch(e[1]){case"4.0":t="8.0";break;case"5.0":t="9.0";break;case"6.0":t="10.0";break;case"7.0":t="11.0"}else t="7.0";else t=n[1];return t}function module$contents$goog$labs$userAgent$browser_getFullVersionFromUserAgentString(e){var t=module$contents$goog$labs$userAgent$util_getUserAgent();if(e===module$contents$goog$labs$userAgent$browser_Brand.IE)return module$contents$goog$labs$userAgent$browser_matchIE()?module$contents$goog$labs$userAgent$browser_getIEVersion(t):"";var n=module$contents$goog$labs$userAgent$browser_createVersionMap(t=module$contents$goog$labs$userAgent$util_extractVersionTuples(t));switch(e){case module$contents$goog$labs$userAgent$browser_Brand.OPERA:if(module$contents$goog$labs$userAgent$browser_matchOpera())return n(["Version","Opera"]);if(module$contents$goog$labs$userAgent$browser_matchOperaChromium())return n(["OPR"]);break;case module$contents$goog$labs$userAgent$browser_Brand.EDGE:if(module$contents$goog$labs$userAgent$browser_matchEdgeHtml())return n(["Edge"]);if(module$contents$goog$labs$userAgent$browser_matchEdgeChromium())return n(["Edg"]);break;case module$contents$goog$labs$userAgent$browser_Brand.CHROMIUM:if(module$contents$goog$labs$userAgent$browser_matchChrome())return n(["Chrome","CriOS","HeadlessChrome"])}return(e===module$contents$goog$labs$userAgent$browser_Brand.FIREFOX&&module$contents$goog$labs$userAgent$browser_matchFirefox()||e===module$contents$goog$labs$userAgent$browser_Brand.SAFARI&&module$contents$goog$labs$userAgent$browser_matchSafari()||e===module$contents$goog$labs$userAgent$browser_Brand.ANDROID_BROWSER&&module$contents$goog$labs$userAgent$browser_matchAndroidBrowser()||e===module$contents$goog$labs$userAgent$browser_Brand.SILK&&module$contents$goog$labs$userAgent$browser_isSilk())&&(e=t[2])&&e[1]||""}function module$contents$goog$labs$userAgent$browser_versionOf(e){if(module$contents$goog$labs$userAgent$browser_useUserAgentDataBrand()&&e!==module$contents$goog$labs$userAgent$browser_Brand.SILK){var t=module$contents$goog$labs$userAgent$util_userAgentDataInternal.brands.find(function(t){return t.brand===e});if(!t||!t.version)return NaN;t=t.version.split(".")}else{if(""===(t=module$contents$goog$labs$userAgent$browser_getFullVersionFromUserAgentString(e)))return NaN;t=t.split(".")}return 0===t.length?NaN:Number(t[0])}goog.labs.userAgent.browser.Brand=module$contents$goog$labs$userAgent$browser_Brand,goog.labs.userAgent.browser.isOpera=module$contents$goog$labs$userAgent$browser_matchOpera,goog.labs.userAgent.browser.isIE=module$contents$goog$labs$userAgent$browser_matchIE,goog.labs.userAgent.browser.isEdge=module$contents$goog$labs$userAgent$browser_matchEdgeHtml,goog.labs.userAgent.browser.isEdgeChromium=module$contents$goog$labs$userAgent$browser_matchEdgeChromium,goog.labs.userAgent.browser.isOperaChromium=module$contents$goog$labs$userAgent$browser_matchOperaChromium,goog.labs.userAgent.browser.isFirefox=module$contents$goog$labs$userAgent$browser_matchFirefox,goog.labs.userAgent.browser.isSafari=module$contents$goog$labs$userAgent$browser_matchSafari,goog.labs.userAgent.browser.isCoast=module$contents$goog$labs$userAgent$browser_matchCoast,goog.labs.userAgent.browser.isIosWebview=function(){return(module$contents$goog$labs$userAgent$util_matchUserAgent("iPad")||module$contents$goog$labs$userAgent$util_matchUserAgent("iPhone"))&&!module$contents$goog$labs$userAgent$browser_matchSafari()&&!module$contents$goog$labs$userAgent$browser_matchChrome()&&!module$contents$goog$labs$userAgent$browser_matchCoast()&&!module$contents$goog$labs$userAgent$browser_matchFirefox()&&module$contents$goog$labs$userAgent$util_matchUserAgent("AppleWebKit")},goog.labs.userAgent.browser.isChrome=module$contents$goog$labs$userAgent$browser_matchChrome,goog.labs.userAgent.browser.isAndroidBrowser=module$contents$goog$labs$userAgent$browser_matchAndroid
2Browser,goog.labs.userAgent.browser.isSilk=module$contents$goog$labs$userAgent$browser_isSilk,goog.labs.userAgent.browser.getVersion=module$contents$goog$labs$userAgent$browser_getVersion,goog.labs.userAgent.browser.isVersionOrHigher=function(e){return 0<=(0,goog.string.internal.compareVersions)(module$contents$goog$labs$userAgent$browser_getVersion(),e)},goog.labs.userAgent.browser.versionOf=module$contents$goog$labs$userAgent$browser_versionOf,goog.labs.userAgent.browser.isAtLeast=function(e,t){return goog.asserts.assert(Math.floor(t)===t,"Major version must be an integer"),module$contents$goog$labs$userAgent$browser_versionOf(e)>=t},goog.labs.userAgent.browser.isAtMost=function(e,t){return goog.asserts.assert(Math.floor(t)===t,"Major version must be an integer"),module$contents$goog$labs$userAgent$browser_versionOf(e)<=t};var module$contents$goog$labs$userAgent$browser_HighEntropyBrandVersion=function(e){this.brand_=e};module$contents$goog$labs$userAgent$browser_HighEntropyBrandVersion.prototype.getIfLoaded=function(){var e=this,t=module$exports$goog$labs$userAgent$highEntropy$highEntropyData.fullVersionList.getIfLoaded();if(void 0!==t)return t=t.find(function(t){return e.brand_===t.brand}),goog.asserts.assertExists(t),new module$exports$goog$labs$userAgent$highEntropy$highEntropyValue.Version(t.version)},module$contents$goog$labs$userAgent$browser_HighEntropyBrandVersion.prototype.load=function(){var e,t,n=this;return $jscomp.asyncExecutePromiseGeneratorProgram(function(r){return 1==r.nextAddress?r.yield(module$exports$goog$labs$userAgent$highEntropy$highEntropyData.fullVersionList.load(),2):(e=r.yieldResult,t=e.find(function(e){return n.brand_===e.brand}),goog.asserts.assertExists(t),r.return(new module$exports$goog$labs$userAgent$highEntropy$highEntropyValue.Version(t.version)))})};var module$contents$goog$labs$userAgent$browser_UserAgentStringFallbackBrandVersion=function(e){this.version_=new module$exports$goog$labs$userAgent$highEntropy$highEntropyValue.Version(e)};function module$contents$goog$labs$userAgent$browser_fullVersionOf(e){if(module$contents$goog$labs$userAgent$browser_useUserAgentDataBrand()&&module$contents$goog$labs$userAgent$highEntropy$highEntropyData_fullVersionListAvailable)return module$contents$goog$labs$userAgent$util_userAgentDataInternal.brands.find(function(t){return t.brand===e})?new module$contents$goog$labs$userAgent$browser_HighEntropyBrandVersion(e):void 0;var t=module$contents$goog$labs$userAgent$browser_getFullVersionFromUserAgentString(e);return""===t?void 0:new module$contents$goog$labs$userAgent$browser_UserAgentStringFallbackBrandVersion(t)}function module$contents$goog$labs$userAgent$platform_useUserAgentDataPlatform(){return!!module$contents$goog$labs$userAgent$util_userAgentDataInternal&&!!module$contents$goog$labs$userAgent$util_userAgentDataInternal.platform}function module$contents$goog$labs$userAgent$platform_isAndroid(){return module$contents$goog$labs$userAgent$platform_useUserAgentDataPlatform()?"Android"===module$contents$goog$labs$userAgent$util_userAgentDataInternal.platform:module$contents$goog$labs$userAgent$util_matchUserAgent("Android")}function module$contents$goog$labs$userAgent$platform_isIpod(){return module$contents$goog$labs$userAgent$util_matchUserAgent("iPod")}function module$contents$goog$labs$userAgent$platform_isIphone(){return module$contents$goog$labs$userAgent$util_matchUserAgent("iPhone")&&!module$contents$goog$labs$userAgent$util_matchUserAgent("iPod")&&!module$contents$goog$labs$userAgent$util_matchUserAgent("iPad")}function module$contents$goog$labs$userAgent$platform_isIpad(){return module$contents$goog$labs$userAgent$util_matchUserAgent("iPad")}function module$contents$goog$labs$userAgent$platform_isIos(){return module$contents$goog$labs$userAgent$platform_isIphone()||module$contents$goog$labs$userAgent$platform_isIpad()||module$contents$goog$labs$userAgent$platform_isIpod()}function module$contents$goog$labs$userAgent$platform_isMacintosh(){return module$contents$goog$labs$userAgent$platform_useUserAgentDataPlatform()?"macOS"===module$contents$goog$labs$userAgent$util_userAgentDataInternal.platform:module$contents$goog$labs$userAgent$util_matchUserAgent("Macintosh")}function module$contents$goog$labs$userAgent$platform_isLinux(){return module$contents$goog$labs$userAgent$platform_useUserAgentDataPlatform()?"Linux"===module$contents$goog$labs$userAgent$util_userAgentDataInternal.platform:module$contents$goog$labs$userAgent$util_matchUserAgent("Linux")}function module$contents$goog$labs$userAgent$platform_isWindows(){return module$contents$goog$labs$userAgent$platform_useUserAgentDataPlatform()?"Windows"===module$contents$goog$labs$userAgent$util_userAgentDataInternal.platform:module$contents$goog$labs$userAgent$util_matchUserAgent("Windows")}function module$contents$goog$labs$userAgent$platform_isChromeOS(){return module$contents$goog$labs$userAgent$platform_useUserAgentDataPlatform()?"Chrome OS"===module$contents$goog$labs$userAgent$util_userAgentDataInternal.platform:module$contents$goog$labs$userAgent$util_matchUserAgent("CrOS")}function module$contents$goog$labs$userAgent$platform_isKaiOS(){return module$contents$goog$labs$userAgent$util_matchUserAgentIgnoreCase("KaiOS")}function module$contents$goog$labs$userAgent$platform_getVersion(){var e=module$contents$goog$labs$userAgent$util_getUserAgent(),t="";return module$contents$goog$labs$userAgent$platform_isWindows()?t=(e=(t=/Windows (?:NT|Phone) ([0-9.]+)/).exec(e))?e[1]:"0.0":module$contents$goog$labs$userAgent$platform_isIos()?t=(e=(t=/(?:iPhone|iPod|iPad|CPU)\s+OS\s+(\S+)/).exec(e))&&e[1].replace(/_/g,"."):module$contents$goog$labs$userAgent$platform_isMacintosh()?t=(e
2=(t=/Mac OS X ([0-9_.]+)/).exec(e))?e[1].replace(/_/g,"."):"10":module$contents$goog$labs$userAgent$platform_isKaiOS()?t=(e=(t=/(?:KaiOS)\/(\S+)/i).exec(e))&&e[1]:module$contents$goog$labs$userAgent$platform_isAndroid()?t=(e=(t=/Android\s+([^\);]+)(\)|;)/).exec(e))&&e[1]:module$contents$goog$labs$userAgent$platform_isChromeOS()&&(t=(e=(t=/(?:CrOS\s+(?:i686|x86_64)\s+([0-9.]+))/).exec(e))&&e[1]),t||""}module$contents$goog$labs$userAgent$browser_UserAgentStringFallbackBrandVersion.prototype.getIfLoaded=function(){return this.version_},module$contents$goog$labs$userAgent$browser_UserAgentStringFallbackBrandVersion.prototype.load=function(){var e=this;return $jscomp.asyncExecutePromiseGeneratorProgram(function(t){return t.return(e.version_)})},goog.labs.userAgent.browser.loadFullVersions=function(){return $jscomp.asyncExecutePromiseGeneratorProgram(function(e){return module$contents$goog$labs$userAgent$browser_useUserAgentDataBrand()&&module$contents$goog$labs$userAgent$highEntropy$highEntropyData_fullVersionListAvailable?e.yield(module$exports$goog$labs$userAgent$highEntropy$highEntropyData.fullVersionList.load(),0):e.jumpTo(0)})},goog.labs.userAgent.browser.fullVersionOf=module$contents$goog$labs$userAgent$browser_fullVersionOf,goog.labs.userAgent.browser.getVersionStringForLogging=function(e){if(module$contents$goog$labs$userAgent$browser_useUserAgentDataBrand()){var t=module$contents$goog$labs$userAgent$browser_fullVersionOf(e);return t?(t=t.getIfLoaded())?t.toVersionStringForLogging():(t=module$contents$goog$labs$userAgent$util_userAgentDataInternal.brands.find(function(t){return t.brand===e}),goog.asserts.assertExists(t),t.version):""}return module$contents$goog$labs$userAgent$browser_getFullVersionFromUserAgentString(e)},goog.labs.userAgent.platform={};var module$contents$goog$labs$userAgent$platform_PlatformVersion=function(){};module$contents$goog$labs$userAgent$platform_PlatformVersion.prototype.getIfLoaded=function(){if(!module$contents$goog$labs$userAgent$util_userAgentDataInternal)return new module$exports$goog$labs$userAgent$highEntropy$highEntropyValue.Version(module$contents$goog$labs$userAgent$platform_getVersion());var e=module$exports$goog$labs$userAgent$highEntropy$highEntropyData.platformVersion.getIfLoaded();return void 0!==e?new module$exports$goog$labs$userAgent$highEntropy$highEntropyValue.Version(e):void 0},module$contents$goog$labs$userAgent$platform_PlatformVersion.prototype.load=function(){var e;return $jscomp.asyncExecutePromiseGeneratorProgram(function(t){return 1==t.nextAddress?module$contents$goog$labs$userAgent$util_userAgentDataInternal?(e=module$exports$goog$labs$userAgent$highEntropy$highEntropyValue.Version,t.yield(module$exports$goog$labs$userAgent$highEntropy$highEntropyData.platformVersion.load(),3)):t.return(new module$exports$goog$labs$userAgent$highEntropy$highEntropyValue.Version(module$contents$goog$labs$userAgent$platform_getVersion())):t.return(new e(t.yieldResult))})};var module$contents$goog$labs$userAgent$platform_version=new module$contents$goog$labs$userAgent$platform_PlatformVersion;goog.labs.userAgent.platform.getVersion=module$contents$goog$labs$userAgent$platform_getVersion,goog.labs.userAgent.platform.isAndroid=module$contents$goog$labs$userAgent$platform_isAndroid,goog.labs.userAgent.platform.isChromeOS=module$contents$goog$labs$userAgent$platform_isChromeOS,goog.labs.userAgent.platform.isChromecast=function(){return module$contents$goog$labs$userAgent$util_matchUserAgent("CrKey")},goog.labs.userAgent.platform.isIos=module$contents$goog$labs$userAgent$platform_isIos,goog.labs.userAgent.platform.isIpad=module$contents$goog$labs$userAgent$platform_isIpad,goog.labs.userAgent.platform.isIphone=module$contents$goog$labs$userAgent$platform_isIphone,goog.labs.userAgent.platform.isIpod=module$contents$goog$labs$userAgent$platform_isIpod,goog.labs.userAgent.platform.isKaiOS=module$contents$goog$labs$userAgent$platform_isKaiOS,goog.labs.userAgent.platform.isLinux=module$contents$goog$labs$userAgent$platform_isLinux,goog.labs.userAgent.platform.isMacintosh=module$contents$goog$labs$userAgent$platform_isMacintosh,goog.labs.userAgent.platform.isVersionOrHigher=function(e){return 0<=goog.string.internal.compareVersions(module$contents$goog$labs$userAgent$platform_getVersion(),e)},goog.labs.userAgent.platform.isWindows=module$contents$goog$labs$userAgent$platform_isWindows,goog.labs.userAgent.platform.ver
vendor: 28,037 bytes, line 2
2sion=module$contents$goog$labs$userAgent$platform_version,goog.array={},goog.NATIVE_ARRAY_PROTOTYPES=goog.TRUSTED_SITE;var module$contents$goog$array_ASSUME_NATIVE_FUNCTIONS=2012<goog.FEATURESET_YEAR;function module$contents$goog$array_peek(e){return e[e.length-1]}goog.array.ASSUME_NATIVE_FUNCTIONS=module$contents$goog$array_ASSUME_NATIVE_FUNCTIONS,goog.array.peek=module$contents$goog$array_peek,goog.array.last=module$contents$goog$array_peek;var module$contents$goog$array_indexOf=goog.NATIVE_ARRAY_PROTOTYPES&&(module$contents$goog$array_ASSUME_NATIVE_FUNCTIONS||Array.prototype.indexOf)?function(e,t,n){return goog.asserts.assert(null!=e.length),Array.prototype.indexOf.call(e,t,n)}:function(e,t,n){if(n=null==n?0:0>n?Math.max(0,e.length+n):n,"string"==typeof e)return"string"!=typeof t||1!=t.length?-1:e.indexOf(t,n);for(;n<e.length;n++)if(n in e&&e[n]===t)return n;return-1};goog.array.indexOf=module$contents$goog$array_indexOf;var module$contents$goog$array_lastIndexOf=goog.NATIVE_ARRAY_PROTOTYPES&&(module$contents$goog$array_ASSUME_NATIVE_FUNCTIONS||Array.prototype.lastIndexOf)?function(e,t,n){return goog.asserts.assert(null!=e.length),Array.prototype.lastIndexOf.call(e,t,null==n?e.length-1:n)}:function(e,t,n){if(0>(n=null==n?e.length-1:n)&&(n=Math.max(0,e.length+n)),"string"==typeof e)return"string"!=typeof t||1!=t.length?-1:e.lastIndexOf(t,n);for(;0<=n;n--)if(n in e&&e[n]===t)return n;return-1};goog.array.lastIndexOf=module$contents$goog$array_lastIndexOf;var module$contents$goog$array_forEach=goog.NATIVE_ARRAY_PROTOTYPES&&(module$contents$goog$array_ASSUME_NATIVE_FUNCTIONS||Array.prototype.forEach)?function(e,t,n){goog.asserts.assert(null!=e.length),Array.prototype.forEach.call(e,t,n)}:function(e,t,n){for(var r=e.length,o="string"==typeof e?e.split(""):e,i=0;i<r;i++)i in o&&t.call(n,o[i],i,e)};function module$contents$goog$array_forEachRight(e,t,n){var r=e.length,o="string"==typeof e?e.split(""):e;for(--r;0<=r;--r)r in o&&t.call(n,o[r],r,e)}goog.array.forEach=module$contents$goog$array_forEach,goog.array.forEachRight=module$contents$goog$array_forEachRight,goog.array.filter=goog.NATIVE_ARRAY_PROTOTYPES&&(module$contents$goog$array_ASSUME_NATIVE_FUNCTIONS||Array.prototype.filter)?function(e,t,n){return goog.asserts.assert(null!=e.length),Array.prototype.filter.call(e,t,n)}:function(e,t,n){for(var r=e.length,o=[],i=0,a="string"==typeof e?e.split(""):e,s=0;s<r;s++)if(s in a){var l=a[s];t.call(n,l,s,e)&&(o[i++]=l)}return o};var module$contents$goog$array_map=goog.NATIVE_ARRAY_PROTOTYPES&&(module$contents$goog$array_ASSUME_NATIVE_FUNCTIONS||Array.prototype.map)?function(e,t,n){return goog.asserts.assert(null!=e.length),Array.prototype.map.call(e,t,n)}:function(e,t,n){for(var r=e.length,o=Array(r),i="string"==typeof e?e.split(""):e,a=0;a<r;a++)a in i&&(o[a]=t.call(n,i[a],a,e));return o},JSCompiler_inline_result$jscomp$82;function module$contents$goog$array_find(e,t,n){return 0>(t=module$contents$goog$array_findIndex(e,t,n))?null:"string"==typeof e?e.charAt(t):e[t]}function module$contents$goog$array_findIndex(e,t,n){for(var r=e.length,o="string"==typeof e?e.split(""):e,i=0;i<r;i++)if(i in o&&t.call(n,o[i],i,e))return i;return-1}function module$contents$goog$array_findIndexRight(e,t,n){var r=e.length,o="string"==typeof e?e.split(""):e;for(--r;0<=r;r--)if(r in o&&t.call(n,o[r],r,e))return r;return-1}function module$contents$goog$array_contains(e,t){return 0<=module$contents$goog$array_indexOf(e,t)}function module$contents$goog$array_insertAt(e,t,n){module$contents$goog$array_splice(e,n,0,t)}function module$contents$goog$array_removeAt(e,t){return goog.asserts.assert(null!=e.length),1==Array.prototype.splice.call(e,t,1).length}function module$contents$goog$array_concat(e){return Array.prototype.concat.apply([],arguments)}function module$contents$goog$array_toArray(e){var t=e.length;if(0<t){for(var n=Array(t),r=0;r<t;r++)n[r]=e[r];return n}return[]}function module$contents$goog$array_splice(e,t,n,r){return goog.asserts.assert(null!=e.length),Array.prototype.splice.apply(e,module$contents$goog$array_slice(arguments,1))}function module$contents$goog$array_slice(e,t,n){return goog.asserts.assert(null!=e.length),2>=arguments.length?Array.prototype.slice.call(e,t):Array.prototype.slice.call(e,t,n)}function module$contents$goog$array_binarySearch(e,t,n){return module$contents$goog$array_binarySearch_(e,n||module$contents$goog$array_defaultCompare,!1,t)}function module$contents$goog$array_binarySearch_(e,t,n,r,o){for(var i,a=0,s=e.length;a<s;){var l=a+(s-a>>>1),u=n?t.call(o,e[l],l,e):t(r,e[l]);0<u?a=l+1:(s=l,i=!u)}return i?a:-a-1}function module$contents$goog$array_sort(e,t){e.sort(t||module$contents$goog$array_defaultCompare)}function module$contents$goog$array_sortByKey(e,t,n){var r=n||module$contents$goog$array_defaultCompare;module$contents$goog$array_sort(e,function(e,n){return r(t(e),t(n))})}function module$contents$goog$array_defaultCompare(e,t){return e>t?1:e<t?-1:0}function module$contents$goog$array_defaultCompareEquality(e,t){return e===t}function module$contents$goog$array_flatten(e){for(var t=[],n=0;n<arguments.length;n++){var r=arguments[n];if(Array.isArray(r))for(var o=0;o<r.length;o+=8192){var i=module$contents$goog$array_slice(r,o,o+8192);i=module$contents$goog$array_flatten.apply(null,i);for(var a=0;a<i.length;a++)t.push(i[a])}else t.push(r)}return t}function module$contents$goog$labs$userAgent$engine_isTrident(){return module$contents$goog$labs$userAgent$util_matchUserAgent("Trident")||module$contents$goog$labs$userAgent$util_matchUserAgent("MSIE")}function module$contents$goog$labs$userAgent$engine_isEdge(){return module$contents$goog$labs$userAgent$util_matchUserAgent("Edge")}function module$contents$goog$labs$userAgent$engine_isWebKit(){return module$contents$goog$labs$userAgent$util_matchUserAgentIgnoreCase("WebKit")&&!module$contents$goog$labs$userAgent$engine_isEdge()}function module$contents$goog$labs$userAgent$engine_isGecko(){return module$contents$goog$labs$userAgent$util_matchUserAgent("Gecko")&&!module$contents$goog$labs$userAgent$engine_isWebKit()&&!module$contents$goog$labs$userAgent$engine_isTrident()&&!module$contents$goog$labs$userAgent$engine_isEdge()}function module$contents$goog$labs$userAgent$engine_getVersion(){var e=module$contents$goog$labs$userAgent$util_getUserAgent();if(e){var t,n;e=module$contents$goog$labs$userAgent$util_extractVersionTuples(e);e:if(module$contents$goog$labs$userAgent$engine_isEdge()){for(t=0;t<e.length;t++){var r=e[t];if("Edge"==r[0]){t=r;break e}}t=void 0}else t=e[1];if(t)return"Gecko"==t[0]?module$contents$goog$labs$userAgent$engine_getVersionForKey(e,"Firefox"):t[1];if((e=e[0])&&(n=e[2])&&(n=/Trident\/([^\s;]+)/.exec(n)))return n[1]}return""}function module$contents$goog$labs$userAgent$engine_getVersionForKey(e,t){return(e=module$contents$goog$array_find(e,function(e){return t==e[0]}))&&e[1]||""}if(goog.array.map=module$contents$goog$array_map,goog.array.reduce=goog.NATIVE_ARRAY_PROTOTYPES&&(module$contents$goog$array_ASSUME_NATIVE_FUNCTIONS||Array.prototype.reduce)?function(e,t,n,r){return goog.asserts.assert(null!=e.length),r&&(t=goog.bind(t,r)),Array.prototype.reduce.call(e,t,n)}:function(e,t,n,r){var o=n;return module$contents$goog$array_forEach(e,function(n,i){o=t.call(r,o,n,i,e)}),o},goog.array.reduceRight=goog.NATIVE_ARRAY_PROTOTYPES&&(module$contents$goog$array_ASSUME_NATIVE_FUNCTIONS||Array.prototype.reduceRight)?function(e,t,n,r){return goog.asserts.assert(null!=e.length),goog.asserts.assert(null!=t),r&&(t=goog.bind(t,r)),Array.prototype.reduceRight.call(e,t,n)}:function(e,t,n,r){var o=n;return module$contents$goog$array_forEachRight(e,function(n,i){o=t.call(r,o,n,i,e)}),o},goog.array.some=goog.NATIVE_ARRAY_PROTOTYPES&&(module$contents$goog$array_ASSUME_NATIVE_FUNCTIONS||Array.prototype.some)?function(e,t,n){return goog.asserts.assert(null!=e.length),Array.prototype.some.call(e,t,n)}:function(e,t,n){for(var r=e.length,o="string"==typeof e?e.split(""):e,i=0;i<r;i++)if(i in o&&t.call(n,o[i],i,e))return!0;return!1},goog.array.every=goog.NATIVE_ARRAY_PROTOTYPES&&(module$contents$goog$array_ASSUME_NATIVE_FUNCTIONS||Array.prototype.every)?function(e,t,n){return goog.asserts.assert(null!=e.length),Array.prototype.every.call(e,t,n)}:function(e,t,n){for(var r=e.length,o="string"==typeof e?e.split(""):e,i=0;i<r;i++)if(i in o&&!t.call(n,o[i],i,e))return!1;return!0},goog.array.count=function(e,t,n){var r=0;return module$contents$goog$array_forEach(e,function(e,o,i){t.call(n,e,o,i)&&++r},n),r},goog.array.find=module$contents$goog$array_find,goog.array.findIndex=module$contents$goog$array_findIndex,goog.array.findRight=function(e,t,n){return 0>(t=module$contents$goog$array_findIndexRight(e,t,n))?null:"string"==typeof e?e.charAt(t):e[t]},goog.array.findIndexRight=module$contents$goog$array_findIndexRight,goog.array.contains=module$contents$goog$array_contains,goog.array.isEmpty=function(e){return 0==e.length},goog.array.clear=function(e){if(!Array.isArray(e))for(var t=e.length-1;0<=t;t--)delete e[t];e.length=0},goog.array.insert=function(e,t){module$contents$goog$array_contains(e,t)||e.push(t)},goog.array.insertAt=module$contents$goog$array_insertAt,goog.array.insertArrayAt=function(e,t,n){goog.partial(module$contents$goog$array_splice,e,n,0).apply(null,t)},goog.array.insertBefore=function(e,t,n){var r;2==arguments.length||0>(r=module$contents$goog$array_indexOf(e,n))?e.push(t):module$contents$goog$array_insertAt(e,t,r)},goog.array.remove=function(e,t){var n;return(n=0<=(t=module$contents$goog$array_indexOf(e,t)))&&module$contents$goog$array_removeAt(e,t),n},goog.array.removeLast=function(e,t){return 0<=(t=module$contents$goog$array_lastIndexOf(e,t))&&(module$contents$goog$array_removeAt(e,t),!0)},goog.array.removeAt=module$contents$goog$array_removeAt,goog.array.removeIf=function(e,t,n){return 0<=(t=module$contents$goog$array_findIndex(e,t,n))&&(module$contents$goog$array_removeAt(e,t),!0)},goog.array.removeAllIf=function(e,t,n){var r=0;return module$contents$goog$array_forEachRight(e,function(o,i){t.call(n,o,i,e)&&module$contents$goog$array_removeAt(e,i)&&r++}),r},goog.array.concat=module$contents$goog$array_concat,goog.array.join=function(e){return Array.prototype.concat.apply([],arguments)},goog.array.toArray=module$contents$goog$array_toArray,goog.array.clone=module$contents$goog$array_toArray,goog.array.extend=function(e,t){for(var n=1;n<arguments.length;n++){var r=arguments[n];if(goog.isArrayLike(r)){var o=e.length||0,i=r.length||0;e.length=o+i;for(var a=0;a<i;a++)e[o+a]=r[a]}else e.push(r)}},goog.array.splice=module$contents$goog$array_splice,goog.array.slice=module$contents$goog$array_slice,goog.array.removeDuplicates=function(e,t,n){t=t||e;var r=function(e){return goog.isObject(e)?"o"+goog.getUid(e):(typeof e).charAt(0)+e};n=n||r;for(var o=r=0,i={};o<e.length;){var a=e[o++],s=n(a);Object.prototype.hasOwnProperty.call(i,s)||(i[s]=!0,t[r++]=a)}t.length=r},goog.array.binarySearch=module$contents$goog$array_binarySearch,goog.array.binarySelect=function(e,t,n){return module$contents$goog$array_binarySearch_(e,t,!0,void 0,n)},goog.array.sort=module$contents$goog$array_sort,goog.array.stableSort=function(e,t){for(var n=Array(e.length),r=0;r<e.length;r++)n[r]={index:r,value:e[r]};var o=t||module$contents$goog$array_defaultCompare;for(module$contents$goog$array_sort(n,function(e,t){return o(e.value,t.value)||e.index-t.index}),t=0;t<e.length;t++)e[t]=n[t].value},goog.array.sortByKey=module$contents$goog$array_sortByKey,goog.array.sortObjectsByKey=function(e,t,n){module$contents$goog$array_sortByKey(e,function(e){return e[t]},n)},goog.array.isSorted=function(e,t,n){t=t||module$contents$goog$array_defaultCompare;for(var r=1;r<e.length;r++){var o=t(e[r-1],e[r]);if(0<o||0==o&&n)return!1}return!0},goog.array.equals=function(e,t,n){if(!goog.isArrayLike(e)||!goog.isArrayLike(t)||e.length!=t.length)return!1;var r=e.length;n=n||module$contents$goog$array_defaultCompareEquality;for(var o=0;o<r;o++)if(!n(e[o],t[o]))return!1;return!0},goog.array.compare3=function(e,t,n){n=n||module$contents$goog$array_defaultCompare;for(var r=Math.min(e.length,t.length),o=0;o<r;o++){var i=n(e[o],t[o]);if(0!=i)return i}return module$contents$goog$array_defaultCompare(e.length,t.length)},goog.array.defaultCompare=module$contents$goog$array_defaultCompare,goog.array.inverseDefaultCompare=function(e,t){return-module$contents$goog$array_defaultCompare(e,t)},goog.array.defaultCompareEquality=module$contents$goog$array_defaultCompareEquality,goog.array.binaryInsert=function(e,t,n){return 0>(n=module$contents$goog$array_binarySearch(e,t,n))&&(module$contents$goog$array_insertAt(e,t,-(n+1)),!0)},goog.array.binaryRemove=function(e,t,n){return 0<=(t=module$contents$goog$array_binarySearch(e,t,n))&&module$contents$goog$array_removeAt(e,t)},goog.array.bucket=function(e,t,n){for(var r={},o=0;o<e.length;o++){var i=e[o],a=t.call(n,i,o,e);void 0!==a&&(r[a]||(r[a]=[])).push(i)}return r},goog.array.bucketToMap=function(e,t){for(var n=new Map,r=0;r<e.length;r++){var o=e[r],i=t(o,r,e);if(void 0!==i){var a=n.get(i);a||(a=[],n.set(i,a)),a.push(o)}}return n},goog.array.toObject=function(e,t,n){var r={};return module$contents$goog$array_forEach(e,function(o,i){r[t.call(n,o,i,e)]=o}),r},goog.array.toMap=function(e,t){for(var n=new Map,r=0;r<e.length;r++){var o=e[r];n.set(t(o,r,e),o)}return n},goog.array.range=function(e,t,n){var r=[],o=0,i=e;if(void 0!==t&&(o=e,i=t),0>(n=n||1)*(i-o))return[];if(0<n)for(e=o;e<i;e+=n)r.push(e);else for(e=o;e>i;e+=n)r.push(e);return r},goog.array.repeat=function(e,t){for(var n=[],r=0;r<t;r++)n[r]=e;return n},goog.array.flatten=module$contents$goog$array_flatten,goog.array.rotate=function(e,t){return goog.asserts.assert(null!=e.length),e.length&&(0<(t%=e.length)?Array.prototype.unshift.apply(e,e.splice(-t,t)):0>t&&Array.prototype.push.apply(e,e.splice(0,-t))),e},goog.array.moveItem=function(e,t,n){goog.asserts.assert(0<=t&&t<e.length),goog.asserts.assert(0<=n&&n<e.length),t=Array.prototype.splice.call(e,t,1),Array.prototype.splice.call(e,n,0,t[0])},goog.array.zip=function(e){if(!arguments.length)return[];for(var t=[],n=arguments[0].length,r=1;r<arguments.length;r++)arguments[r].length<n&&(n=arguments[r].length);for(r=0;r<n;r++){for(var o=[],i=0;i<arguments.length;i++)o.push(arguments[i][r]);t.push(o)}return t},goog.array.shuffle=function(e,t){t=t||Math.random;for(var n=e.length-1;0<n;n--){var r=Math.floor(t()*(n+1)),o=e[n];e[n]=e[r],e[r]=o}},goog.array.copyByIndex=function(e,t){var n=[];return module$contents$goog$array_forEach(t,function(t){n.push(e[t])}),n},goog.array.concatMap=function(e,t,n){return module$contents$goog$array_concat.apply([],module$contents$goog$array_map(e,t,n))},goog.labs.userAgent.engine={},goog.labs.userAgent.engine.getVersion=module$contents$goog$labs$userAgent$engine_getVersion,goog.labs.userAgent.engine.isEdge=module$contents$goog$labs$userAgent$engine_isEdge,goog.labs.userAgent.engine.isGecko=module$contents$goog$labs$userAgent$engine_isGecko,goog.labs.userAgent.engine.isPresto=function(){return module$contents$goog$labs$userAgent$util_matchUserAgent("Presto")},goog.labs.userAgent.engine.isTrident=module$contents$goog$labs$userAgent$engine_isTrident,goog.labs.userAgent.engine.isVersionOrHigher=function(e){return 0<=goog.string.internal.compareVersions(module$contents$goog$labs$userAgent$engine_getVersion(),e)},goog.labs.userAgent.engine.isWebKit=module$contents$goog$labs$userAgent$engine_isWebKit,goog.reflect={},goog.reflect.object=function(e,t){return t},goog.reflect.objectProperty=function(e){return e},goog.reflect.sinkValue=function(e){return goog.reflect.sinkValue[" "](e),e},goog.reflect.sinkValue[" "]=goog.nullFunction,goog.reflect.canAccessProperty=function(e,t){try{return goog.reflect.sinkValue(e[t]),!0}catch(e){}return!1},goog.reflect.cache=function(e,t,n,r){return r=r?r(t):t,Object.prototype.hasOwnProperty.call(e,r)?e[r]:e[r]=n(t)},goog.userAgent={},goog.userAgent.ASSUME_IE=!1,goog.userAgent.ASSUME_EDGE=!1,goog.userAgent.ASSUME_GECKO=!1,goog.userAgent.ASSUME_WEBKIT=!1,goog.userAgent.ASSUME_MOBILE_WEBKIT=!1,goog.userAgent.ASSUME_OPERA=!1,goog.userAgent.ASSUME_ANY_VERSION=!1,goog.userAgent.BROWSER_KNOWN_=goog.userAgent.ASSUME_IE||goog.userAgent.ASSUME_EDGE||goog.userAgent.ASSUME_GECKO||goog.userAgent.ASSUME_MOBILE_WEBKIT||goog.userAgent.ASSUME_WEBKIT||goog.userAgent.ASSUME_OPERA,goog.userAgent.getUserAgentString=function(){return module$contents$goog$labs$userAgent$util_getUserAgent()},goog.userAgent.getNavigatorTyped=function(){return goog.global.navigator||null},goog.userAgent.getNavigator=function(){return goog.userAgent.getNavigatorTyped()},goog.userAgent.OPERA=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_OPERA:module$contents$goog$labs$userAgent$browser_matchOpera(),goog.userAgent.IE=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_IE:module$contents$goog$labs$userAgent$browser_matchIE(),goog.userAgent.EDGE=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_EDGE:module$contents$goog$labs$userAgent$engine_isEdge(),goog.userAgent.EDGE_OR_IE=goog.userAgent.EDGE||goog.userAgent.IE,goog.userAgent.GECKO=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_GECKO:module$contents$goog$labs$userAgent$engine_isGecko(),goog.userAgent.WEBKIT=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_WEBKIT||goog.userAgent.ASSUME_MOBILE_WEBKIT:module$contents$goog$labs$userAgent$engine_isWebKit(),goog.userAgent.isMobile_=function(){return goog.userAgent.WEBKIT&&module$contents$goog$labs$userAgent$util_matchUserAgent("Mobile")},goog.userAgent.MOBILE=goog.userAgent.ASSUME_MOBILE_WEBKIT||goog.userAgent.isMobile_(),goog.userAgent.SAFARI=goog.userAgent.WEBKIT,goog.userAgent.determinePlatform_=function(){var e=goog.userAgent.getNavigatorTyped();return e&&e.platform||""},goog.userAgent.PLATFORM=goog.userAgent.determinePlatform_(),goog.userAgent.ASSUME_MAC=!1,goog.userAgent.ASSUME_WINDOWS=!1,goog.userAgent.ASSUME_LINUX=!1,goog.userAgent.ASSUME_X11=!1,goog.userAgent.ASSUME_ANDROID=!1,goog.userAgent.ASSUME_IPHONE=!1,goog.userAgent.ASSUME_IPAD=!1,goog.userAgent.ASSUME_IPOD=!1,goog.userAgent.ASSUME_KAIOS=!1,goog.userAgent.PLATFORM_KNOWN_=goog.userAgent.ASSUME_MAC||goog.userAgent.ASSUME_WINDOWS||goog.userAgent.ASSUME_LINUX||goog.userAgent.ASSUME_X11||goog.userAgent.ASSUME_ANDROID||goog.userAgent.ASSUME_IPHONE||goog.userAgent.ASSUME_IPAD||goog.userAgent.ASSUME_IPOD,goog.userAgent.MAC=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_MAC:module$contents$goog$labs$userAgent$platform_isMacintosh(),goog.userAgent.WINDOWS=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_WINDOWS:module$contents$goog$labs$userAgent$platform_isWindows(),goog.userAgent.isLegacyLinux_=function(){return module$contents$goog$labs$userAgent$platform_isLinux()||module$contents$goog$labs$userAgent$platform_isChromeOS()},goog.userAgent.LINUX=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_LINUX:goog.userAgent.isLegacyLinux_(),goog.userAgent.isX11_=function(){var e=goog.userAgent.getNavigatorTyped();return!!e&&goog.string.internal.contains(e.appVersion||"","X11")},goog.userAgent.X11=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_X11:goog.userAgent.isX11_(),goog.userAgent.ANDROID=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_ANDROID:module$contents$goog$labs$userAgent$platform_isAndroid(),goog.userAgent.IPHONE=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_IPHONE:module$contents$goog$labs$userAgent$platform_isIphone(),goog.userAgent.IPAD=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_IPAD:module$contents$goog$labs$userAgent$platform_isIpad(),goog.userAgent.IPOD=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_IPOD:module$contents$goog$labs$userAgent$platform_isIpod(),goog.userAgent.IOS=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_IPHONE||goog.userAgent.ASSUME_IPAD||goog.userAgent.ASSUME_IPOD:module$contents$goog$labs$userAgent$platform_isIos(),goog.userAgent.KAIOS=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_KAIOS:module$contents$goog$labs$userAgent$platform_isKaiOS(),goog.userAgent.determineVersion_=function(){var e="",t=goog.userAgent.getVersionRegexResult_();return t&&(e=t?t[1]:""),goog.userAgent.IE&&null!=(t=goog.userAgent.getDocumentMode_())&&t>parseFloat(e)?String(t):e},goog.userAgent.getVersionRegexResult_=function(){var e=goog.userAgent.getUserAgentString();return goog.userAgent.GECKO?/rv:([^\);]+)(\)|;)/.exec(e):goog.userAgent.EDGE?/Edge\/([\d\.]+)/.exec(e):goog.userAgent.IE?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(e):goog.userAgent.WEBKIT?/WebKit\/(\S+)/.exec(e):goog.userAgent.OPERA?/(?:Version)[ \/]?(\S+)/.exec(e):void 0},goog.userAgent.getDocumentMode_=function(){var e=goog.global.document;return e?e.documentMode:void 0},goog.userAgent.VERSION=goog.userAgent.determineVersion_(),goog.userAgent.compare=function(e,t){return goog.string.internal.compareVersions(e,t)},goog.userAgent.isVersionOrHigherCache_={},goog.userAgent.isVersionOrHigher=function(e){return goog.userAgent.ASSUME_ANY_VERSION||goog.reflect.cache(goog.userAgent.isVersionOrHigherCache_,e,function(){return 0<=goog.string.internal.compareVersions(goog.userAgent.VERSION,e)})},goog.userAgent.isDocumentModeOrHigher=function(e){return Number(goog.userAgent.DOCUMENT_MODE)>=e},goog.userAgent.isDocumentMode=goog.userAgent.isDocumentModeOrHigher,goog.global.document&&goog.userAgent.IE){var documentMode$jscomp$inline_116=goog.userAgent.getDocumentMode_();JSCompiler_inline_result$jscomp$82=documentMode$jscomp$inline_116||parseInt(goog.userAgent.VERSION,10)||void 0}else JSCompiler_inline_result$jscomp$82=void 0;goog.userAgent.DOCUMENT_MODE=JSCompiler_inline_result$jscomp$82,goog.userAgent.product={},goog.userAgent.product.ASSUME_FIREFOX=!1,goog.userAgent.product.ASSUME_IPHONE=!1,goog.userAgent.product.ASSUME_IPAD=!1,goog.userAgent.product.ASSUME_ANDROID=!1,goog.userAgent.product.ASSUME_CHROME=!1,goog.userAgent.product.ASSUME_SAFARI=!1,goog.userAgent.product.PRODUCT_KNOWN_=goog.userAgent.ASSUME_IE||goog.userAgent.ASSUME_EDGE||goog.userAgent.ASSUME_OPERA||goog.userAgent.product.ASSUME_FIREFOX||goog.userAgent.product.ASSUME_IPHONE||goog.userAgent.product.ASSUME_IPAD||goog.userAgent.product.ASSUME_ANDROID||goog.userAgent.product.ASSUME_CHROME||goog.userAgent.product.ASSUME_SAFARI,goog.userAgent.product.OPERA=goog.userAgent.OPERA,goog.userAgent.product.IE=goog.userAgent.IE,goog.userAgent.product.EDGE=goog.userAgent.EDGE,goog.userAgent.product.FIREFOX=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_FIREFOX:module$contents$goog$labs$userAgent$browser_matchFirefox(),goog.userAgent.product.isIphoneOrIpod_=function(){return module$contents$goog$labs$userAgent$platform_isIphone()||module$contents$goog$labs$userAgent$platform_isIpod()},goog.userAgent.product.IPHONE=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_IPHONE:goog.userAgent.product.isIphoneOrIpod_(),goog.userAgent.product.IPAD=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_IPAD:module$contents$goog$labs$userAgent$platform_isIpad(),goog.userAgent.product.ANDROID=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_ANDROID:module$contents$goog$labs$userAgent$browser_matchAndroidBrowser(),goog.userAgent.product.CHROME=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_CHROME:module$contents$goog$labs$userAgent$browser_matchChrome(),goog.userAgent.product.isSafariDesktop_=function(){return module$contents$goog$labs$userAgent$browser_matchSafari()&&!module$contents$goog$labs$userAgent$platform_isIos()},goog.userAgent.product.SAFARI=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_SAFARI:goog.userAgent.product.isSafariDesktop_(),goog.crypt.base64={},goog.crypt.base64.DEFAULT_ALPHABET_COMMON_="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",goog.crypt.base64.ENCODED_VALS=goog.crypt.base64.DEFAULT_ALPHABET_COMMON_+"+/=",goog.crypt.base64.ENCODED_VALS_WEBSAFE=goog.crypt.base64.DEFAULT_ALPHABET_COMMON_+"-_.",goog.crypt.base64.Alphabet={DEFAULT:0,NO_PADDING:1,WEBSAFE:2,WEBSAFE_DOT_PADDING:3,WEBSAFE_NO_PADDING:4},goog.crypt.base64.paddingChars_="=.",goog.crypt.base64.isPadding_=function(e){return goog.string.internal.contains(goog.crypt.base64.paddingChars_,e)},goog.crypt.base64.byteToCharMaps_={},goog.crypt.base64.charToByteMap_=null,goog.crypt.base64.ASSUME_NATIVE_SUPPORT_=goog.userAgent.GECKO||goog.userAgent.WEBKIT,goog.crypt.base64.HAS_NATIVE_ENCODE_=goog.crypt.base64.ASSUME_NATIVE_SUPPORT_||"function"==typeof goog.global.btoa,goog.crypt.base64.HAS_NATIVE_DECODE_=goog.crypt.base64.ASSUME_NATIVE_SUPPORT_||!goog.userAgent.product.SAFARI&&!goog.userAgent.IE&&"function"==typeof goog.global.atob,goog.crypt.base64.encodeByteArray=function(e,t){goog.asserts.assert(goog.isArrayLike(e),"encodeByteArray takes an array as a parameter"),void 0===t&&(t=goog.crypt.base64.Alphabet.DEFAULT),goog.crypt.base64.init_(),t=goog.crypt.base64.byteToCharMaps_[t];for(var n=Array(Math.floor(e.length/3)),r=t[64]||"",o=0,i=0;o<e.length-2;o+=3){var a=e[o],s=e[o+1],l=e[o+2],u=t[a>>2];a=t[(3&a)<<4|s>>4],s=t[(15&s)<<2|l>>6],l=t[63&l],n[i++]=""+u+a+s+l}switch(u=0,l=r,e.length-o){case 2:l=t[(15&(u=e[o+1]))<<2]||r;case 1:e=e[o],n[i]=""+t[e>>2]+t[(3&e)<<4|u>>4]+l+r}return n.join("")},goog.crypt.base64.encodeString=function(e,t){return goog.crypt.base64.HAS_NATIVE_ENCODE_&&!t?goog.global.btoa(e):goog.crypt.base64.encodeByteArray(goog.crypt.stringToByteArray(e),t)},goog.crypt.base64.decodeString=function(e,t){if(goog.crypt.base64.HAS_NATIVE_DECODE_&&!t)return goog.global.atob(e);var n="";return goog.crypt.base64.decodeStringInternal_(e,function(e){n+=String.fromCharCode(e)}),n},goog.crypt.base64.decodeStringToByteArray=function(e){var t=[];return goog.crypt.base64.decodeStringInternal_(e,function(e){t.push(e)}),t},goog.crypt.base64.decodeStringToUint8Array=function(e){goog.asserts.assert(!goog.userAgent.IE||goog.userAgent.isVersionOrHigher("10"),"Browser does not support typed arrays");var t=e.length,n=3*t/4;n%3?n=Math.floor(n):goog.crypt.base64.isPadding_(e[t-1])&&(n=goog.crypt.base64.isPadding_(e[t-2])?n-2:n-1);var r=new Uint8Array(n),o=0;return goog.crypt.base64.decodeStringInternal_(e,function(e){r[o++]=e}),r.subarray(0,o)},goog.crypt.base64.decodeStringInternal_=function(e,t){function n(t){for(;r<e.length;){var n=e.charAt(r++),o=goog.crypt.base64.charToByteMap_[n];if(null!=o)return o;if(!goog.string.internal.isEmptyOrWhitespace(n))throw Error("Unknown base64 encoding at char: "+n)}return t}goog.crypt.base64.init_();for(var r=0;;){var o=n(-1),i=n(0),a=n(64),s=n(64);if(64===s&&-1===o)break;t(o<<2|i>>4),64!=a&&(t(i<<4&240|a>>2),64!=s&&t(a<<6&192|s))}},goog.crypt.base64.init_=function(){if(!goog.crypt.base64.charToByteMap_){goog.crypt.base64.charToByteMap_={};for(var e=goog.crypt.base64.DEFAULT_ALPHABET_COMMON_.split(""),t=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var r=e.concat(t[n].split(""));goog.crypt.base64.byteToCharMaps_[n]=r;for(var o=0;o<r.length;o++){var i=r[o],a=goog.crypt.base64.charToByteMap_[i];void 0===a?goog.crypt.base64.charToByteMap_[i]=o:goog.asserts.assert(a===o)}}}};var module$exports$jspb$internal_bytes={},module$contents$jspb$internal_bytes_emptyUint8Array_;function module$contents$jspb$internal_bytes_dataAsB64(e){return null==e||"string"==typeof e?e:module$exports$jspb$internal_bytes.SUPPORTS_UINT8ARRAY&&e instanceof Uint8Array?goog.crypt.base64.encodeByteArray(e):((0,goog.asserts.fail)("Cannot coerce to b64 string: "+goog.typeOf(e)),null)}function module$contents$jspb$internal_bytes_dataAsU8(e){return null==e||module$contents$jspb$internal_bytes_isU8(e)?e:"string"==typeof e?goog.crypt.base64.decodeStringToUint8Array(e):((0,goog.asserts.fail)("Cannot coerce to Uint8Array: "+goog.typeOf(e)),null)}function module$contents$jspb$internal_bytes_isU8(e){return module$exports$jspb$internal_bytes.SUPPORTS_UINT8ARRAY&&null!=e&&e instanceof Uint8Array}function module$contents$jspb$internal_bytes_emptyUint8Array(){return module$contents$jspb$internal_bytes_emptyUint8Array_||(module$contents$jspb$internal_bytes_emptyUint8Array_=new 
2Uint8Array(0))}module$exports$jspb$internal_bytes.SUPPORTS_UINT8ARRAY="function"==typeof Uint8Array,module$exports$jspb$internal_bytes.dataAsB64=module$contents$jspb$internal_bytes_dataAsB64,module$exports$jspb$internal_bytes.dataAsU8=module$contents$jspb$internal_bytes_dataAsU8,module$exports$jspb$internal_bytes.emptyUint8Array=module$contents$jspb$internal_bytes_emptyUint8Array,module$exports$jspb$internal_bytes.isU8=module$contents$jspb$internal_bytes_isU8;var module$exports$jspb$bytestring={},module$contents$jspb$bytestring_emptyByteString;module$exports$jspb$bytestring.ByteString=function(e){if(this.value_=e,null!==e&&0===e.length)throw Error("ByteString should be constructed with non-empty values")},module$exports$jspb$bytestring.ByteString.fromBase64=function(e){return e?new module$exports$jspb$bytestring.ByteString(e):module$exports$jspb$bytestring.ByteString.empty()},module$exports$jspb$bytestring.ByteString.fromUint8Array=function(e){return e.length?new module$exports$jspb$bytestring.ByteString(new Uint8Array(e)):module$exports$jspb$bytestring.ByteString.empty()},module$exports$jspb$bytestring.ByteString.fromStringUtf8=function(e){return e.length?new module$exports$jspb$bytestring.ByteString(module$contents$jspb$binary$utf8_encodeUtf8(e,!0)):module$exports$jspb$bytestring.ByteString.empty()},module$exports$jspb$bytestring.ByteString.empty=function(){return module$contents$jspb$bytestring_emptyByteString||(module$contents$jspb$bytestring_emptyByteString=new module$exports$jspb$bytestring.ByteString(null))},module$exports$jspb$bytestring.ByteString.prototype.asBase64=function(){return this.isEmpty()?"":this.ensureBase64String_()},module$exports$jspb$bytestring.ByteString.prototype.asUint8Array=function(){return this.isEmpty()?module$contents$jspb$internal_bytes_emptyUint8Array():new Uint8Array(this.ensureUint8Array_())},module$exports$jspb$bytestring.ByteString.prototype.isEmpty=function(){return null==this.value_},module$exports$jspb$bytestring.ByteString.prototype.asStringUtf8=function(){var e=this.ensureUint8Array_();if(e){var t=e.length;e=module$contents$jspb$binary$utf8_useTextDecoderDecode?(module$contents$jspb$binary$utf8_utf8ErrorsAreFatal(!0)?module$contents$jspb$binary$utf8_getFatalDecoderInstance():module$contents$jspb$binary$utf8_getNonFatalDecoderInstance()).decode(e.subarray(0,0+t)):module$contents$jspb$binary$utf8_polyfillDecodeUtf8(e,0,t,!0)}else e="";return e},module$exports$jspb$bytestring.ByteString.prototype.ensureBase64String_=function(){return this.value_=module$contents$jspb$internal_bytes_dataAsB64(this.value_)},module$exports$jspb$bytestring.ByteString.prototype.ensureUint8Array_=function(){return this.value_=module$contents$jspb$internal_bytes_dataAsU8(this.value_)};var module$contents$jspb$utils_SUPPORTS_UINT8ARRAY_SLICING="function"==typeof Uint8Array.prototype.slice;function module$contents$jspb$utils_sliceUint8Array(e,t,n){return t===n?module$contents$jspb$internal_bytes_emptyUint8Array():module$contents$jspb$utils_SUPPORTS_UINT8ARRAY_SLICING?e.slice(t,n):new Uint8Array(e.subarray(t,n))}var module$contents$jspb$utils_split64Low=0,module$contents$jspb$utils_split64High=0;function module$contents$jspb$utils_splitUint64(e){var t=e>>>0;e=Math.floor((e-t)/module$exports$jspb$BinaryConstants.TWO_TO_32)>>>0,module$contents$jspb$utils_split64Low=t,module$contents$jspb$utils_split64High=e}function module$contents$jspb$utils_splitInt64(e){var t=0>e,n=(e=Math.abs(e))>>>0;e=Math.floor((e-n)/module$exports$jspb$BinaryConstants.TWO_TO_32),e>>>=0,t&&(e=~e>>>0,4294967295<(n=(~n>>>0)+1)&&(n=0,4294967295<++e&&(e=0))),module$contents$jspb$utils_split64Low=n,module$contents$jspb$utils_split64High=e}function module$contents$jspb$utils_splitBytes64(e){var t=$jscomp.makeIterator(e);e=t.next().value;var n=t.next().value,r=t.next().value,o=t.next().value,i=t.next().value,a=t.next().value,s=t.next().value;t=t.next().value,module$contents$jspb$utils_split64Low=e+(n<<8)+(r<<16)+(o<<24)>>>0,module$contents$jspb$utils_split64High=i+(a<<8)+(s<<16)+(t<<24)>>>0}function module$contents$jspb$utils_joinUint64(e,t){return t*module$exports$jspb$BinaryConstants.TWO_TO_32+(e>>>0)}function module$contents$jspb$utils_joinInt64(e,t){var n=2147483648&t;return n&&(t=~t>>>0,0==(e=1+~e>>>0)&&(t=t+1>>>0)),e=module$contents$jspb$utils_joinUint64(e,t),n?-e:e}function module$contents$jspb$utils_toZigzag64(e,t,n){var r=t>>31;return n(e<<1^r,(t<<1|e>>>31)^r)}function module$contents$jspb$utils_joinZigzag64(e,t){return module$contents$jspb$utils_fromZigzag64(e,t,module$contents$jspb$utils_joinInt64)}function module$contents$jspb$utils_fromZigzag64(e,t,n){var r=-(1&e);return n((e>>>1|t<<31)^r,t>>>1^r)}function module$contents$jspb$utils_joinUnsignedDecimalString(e,t){function n(e,t){return e=e?String(e):"",t?"0000000".slice(e.length)+e:e}if(2097151>=t)return""+(module$exports$jspb$BinaryConstants.TWO_TO_32*t+e);var r=(e>>>24|t<<8)>>>0&16777215;return e=(16777215&e)+6777216*r+6710656*(t=t>>16&65535),r+=8147497*t,t*=2,1e7<=e&&(r+=Math.floor(e/1e7),e%=1e7),1e7<=r&&(t+=Math.floor(r/1e7),r%=1e7),n(t,0)+n(r,t)+n(e,1)}function module$contents$jspb$utils_joinSignedDecimalString(e,t){var n=2147483648&t;return n&&(t=~t+(0==(e=1+~e>>>0)?1:0)>>>0),e=module$contents$jspb$utils_joinUnsignedDecimalString(e,t),n?"-"+e:e}function module$contents$jspb$utils_decimalStringToBytes64(e){function t(e,t){for(var n=0;8>n&&(1!==e||0<t);n++)t=e*r[n]+t,r[n]=255&t,t>>>=8}(0,goog.asserts.assert)(0<e.length);var n=!1;"-"===e[0]&&(n=!0,e=e.slice(1));for(var r=[0,0,0,0,0,0,0,0],o=0;o<e.length;o++)t(10,e.charCodeAt(o)-48);return n&&(function(){for(var e=0;8>e;e++)r[e]=255&~r[e]}(),t(1,1)),r}function module$contents$jspb$utils_byteSourceToUint8Array(e){if(e.constructor===Uint8Array)return e;if(e.constructor===ArrayBuffer)return new Uint8Array(e);if(e.constructor===Array)return new Uint8Array(e);if(e.constructor===String)return goog.crypt.base64.decodeStringToUint8Array(e);if(e.constructor===module$exports$jspb$bytestring.ByteString)return e.asUint8Array();if(e instanceof Uint8Array)return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, or Array of numbers")}var module$exports$jspb$binary$decoder={BinaryDecoderOptions:function(){},BinaryDecoder:function(e,t,n,r){r=void 0!==(r=void 0===r?{}:r).bytesFieldsAsMutableViews&&r.bytesFieldsAsMutableViews,this.dataView_=this.bytes_=null,this.cursor_=this.end_=this.start_=0,this.bytesFieldsAsMutableViews=r,e&&this.setBlock(e,t,n)}};module$exports$jspb$binary$decoder.BinaryDecoder.alloc=function(e,t,n,r){if(module$exports$jspb$binary$decoder.BinaryDecoder.instanceCache_.length){var o=module$exports$jspb$binary$decoder.BinaryDecoder.instanceCache_.pop();return r&&(o.bytesFieldsAsMutableViews=r.bytesFieldsAsMutableViews),e&&o.setBlock(e,t,n),o}return new module$exports$jspb$binary$decoder.BinaryDecoder(e,t,n,r)},module$exports$jspb$binary$decoder.BinaryDecoder.prototype.free=function(){this.clear(),100>module$exports$jspb$binary$decoder.BinaryDecoder.instanceCache_.length&&module$exports$jspb$binary$decoder.BinaryDecoder.instanceCache_.push(this)},module$exports$jspb$binary$decoder.BinaryDecoder.prototype.clear=function(){this.dataView_=this.bytes_=null,this.cursor_=this.end_=this.start_=0,this.bytesFieldsAsMutableViews=!1},module$exports$jspb$binary$decoder.BinaryDecoder.prototype.getBuffer=function(){return this.bytes_},module$exports$jspb$binary$decoder.BinaryDecoder.prototype.setBlock=function(e,t,n){this.bytes_=module$contents$jspb$utils_byteSourceToUint8Array(e),module$contents$jspb$binary$decoder_ASSUME_DATAVIEW_IS_FAST&&(this.dataView_=new DataView(this.bytes_.buffer,this.bytes_.byteOffset,this.bytes_.byteLength)),this.start_=void 0!==t?t:0,this.end_=void 0!==n?this.start_+n:this.bytes_.length,this.cursor_=this.start_},module$exports$jspb$binary$decoder.BinaryDecoder.prototype.getEnd=function(){return this.end_},module$exports$jspb$binary$decoder.BinaryDecoder.prototype.setEnd=function(e){this.end_=e},module$exports$jspb$binary$decoder.BinaryDecoder.prototype.reset=function(){this.cursor_=this.start_},module$exports$jspb$binary$decoder.BinaryDecoder.prototype.getCursor=function(){return this.cursor_},module$exports$jspb$binary$decoder.BinaryDecoder.prototype.setCursor=function(e){this.cursor_=e},module$exports$jspb$binary$decoder.BinaryDecoder.prototype.advance=function(e){this.cursor_+=e,this.checkCursor()},module$exports$jspb$binary$decoder.BinaryDecoder.prototype.atEnd=function(){return this.cursor_==this.end_},module$exports$jspb$binary$decoder.BinaryDecoder.prototype.pastEnd=function(){return this.cursor_>this.end_},module$exports$jspb$binary$decoder.BinaryDecoder.prototype.readSplitVarint64=function(e){for(var t=128,n=0,r=0,o=0;4>o&&128<=t;o++)n|=(127&(t=this.bytes_[this.cursor_++]))<<7*o;if(128<=t&&(n|=(127&(t=this.bytes_[this.cursor_++]))<<28,r|=(127&t)>>4),128<=t)for(o=0;5>o&&128<=t;o++)r|=(127&(t=this.bytes_[this.cursor_++]))<<7*o+3;if(128>t)return e(n>>>0,r>>>0);throw module$contents$jspb$binary$errors_invalidVarintError()},module$exports$jspb$binary$decoder.BinaryDecoder.prototype.readSplitZigzagVarint64=function(e){return this.readSplitVarint64(function(t,n){return module$contents$jspb$utils_fromZigzag64(t,n,e)})},module$exports$jspb$binary$decoder.BinaryDecoder.prototype.readSplitFixed64=function(e){var t=this.bytes_,n=this.cursor_;this.cursor_+=8,this.checkCursor();for(var r=0,o=0,i=n+7;i>=n;i--)r=r<<8|t[i],o=o<<8|t[i+4];return e(r,o)},module$exports$jspb$binary$decoder.BinaryDecoder.prototype.skipVarint=function(){for(var e=this.cursor_,t=0;10>t;t++){if(!(128&this.bytes_[e]))return this.cursor_=e+1,void this.checkCursor();e++}throw module$contents$jspb$binary$errors_invalidVarintError()},module$exports$jspb$binary$decoder.BinaryDecoder.prototype.checkCursor=function(){if(this.cursor_>this.end_)throw module$contents$jspb$binary$errors_readTooFarError(this.end_,this.cursor_)},module$exports$jspb$binary$decoder.BinaryDecoder.prototype.readUnsignedVarint32=function(){var e=this.bytes_,t=e[this.cursor_+0],n=127&t;if(128>t)return this.cursor_+=1,this.checkCursor(),n;if(n|=(127&(t=e[this.cursor_+1]))<<7,128>t)return this.cursor_+=2,this.checkCursor(),n;if(n|=(127&(t=e[this.cursor_+2]))<<14,128>t)return this.cursor_+=3,this.checkCursor(),n;if(n|=(127&(t=e[this.cursor_+3]))<<21,128>t)return this.cursor_+=4,this.checkCursor(),n;if(n|=(15&(t=e[this.cursor_+4]))<<28,128>t)return this.cursor_+=5,this.checkCursor(),n>>>0;if(this.cursor_+=5,128<=e[this.cursor_++]&&128<=e[this.cursor_++]&&128<=e[this.cursor_++]&&128<=e[this.cursor_++]&&128<=e[this.cursor_++])throw module$contents$jspb$binary$errors_invalidVarintError();return this.checkCursor(),n},module$exports$jspb$binary$decoder.BinaryDecoder.prototype.readSignedVarint32=function(){return this.readUnsignedVarint32()},module$exports$jspb$binary$decoder.BinaryDecoder.prototype.readZigzagVarint32=function(){var e=this.readUnsignedVarint32();return e>>>1^-(1&e)},module$exports$jspb$binary$decoder.BinaryDecoder.prototype.readUnsignedVarint64=function(){return this.readSplitVarint64(module$contents$jspb$utils_joinUint64)},module$exports$jspb$binary$decoder.BinaryDecoder.prototype.readUnsignedVarint64String=function(){return this.readSplitVarint64(module$contents$jspb$utils_joinUnsignedDecimalString)},module$exports$jspb$binary$decoder.BinaryDecoder.prototype.readSignedVarint64=function(){return this.readSplitVarint64(module$contents$jspb$utils_joinInt64)},module$exports$jspb$binary$decoder.BinaryDecoder.prototype.readSignedVarint64String=function(){return this.readSplitVarint64(module$contents$jspb$utils_joinSignedDecimalString)},module$exports$jspb$binary$decoder.BinaryDecoder.prototype.readZigzagVarint64=function(){return this.readSplitVarint64(module$contents$jspb$utils_joinZigzag64)},module$exports$jspb$binary$decoder.BinaryDecoder.prototype.readZigzagVarint64String=function(){return this.readSplitZigzagVarint64(module$contents$jspb$utils_joinSignedDecimalString)},module$exports$jspb$binary$decoder.BinaryDecoder.prototype.readUint8=function(){var e=this.bytes_[this.cursor_+0];return this.cursor_+=1,this.checkCursor(),e},module$exports$jspb$binary$decoder.BinaryDecoder.prototype.readUint16=function(){var e=this.bytes_[this.cursor_+0],t=this.bytes_[this.cursor_+1];return this.cursor_+=2,this.checkCursor(),e|t<<8},module$exports$jspb$binary$decoder.BinaryDecoder.prototype.readUint32=function(){var e=this.bytes_[this.cursor_+0],t=this.bytes_[this.cursor_+1],n=this.bytes_[this.cursor_+2],r=this.bytes_[this.cursor_+3];return this.cursor_+=4,this.checkCursor(),(e|t<<8|n<<16|r<<24)>>>0},module$exports$jspb$binary$decoder.BinaryDecoder.prototype.readUint64=function(){return module$contents$jspb$utils_joinUint64(this.readUint32(),this.readUint32())},module$exports$jspb$binary$decoder.BinaryDecoder.prototype.readUint64String=function(){return module$contents$jspb$utils_joinUnsignedDecimalString(this.readUint32(),this.readUint32())},module$exports$jspb$binary$decoder.BinaryDecoder.prototype.readInt8=function(){var e=this.bytes_[this.cursor_+0];return this.cursor_+=1,this.checkCursor(),e<<24>>24},module$exports$jspb$binary$decoder.BinaryDecoder.prototype.readInt16=function(){var e=this.bytes_[this.cursor_+0],t=this.bytes_[this.cursor_+1];return this.cursor_+=2,this.checkCursor(),(e|t<<8)<<16>>16},module$exports$jspb$binary$decoder.BinaryDecoder.prototype.readInt32=function(){var e=this.bytes_[this.cursor_+0],t=this.bytes_[this.cursor_+1],n=this.bytes_[this.cursor_+2],r=this.bytes_[this.cursor_+3];return this.cursor_+=4,this.checkCursor(),e|t<<8|n<<16|r<<24},module$exports$jspb$binary$decoder.BinaryDecoder.prototype.readInt64=function(){return module$contents$jspb$utils_joinInt64(this.readUint32(),this.readUint32())},module$exports$jspb$binary$decoder.BinaryDecoder.prototype.readInt64String=function(){return module$contents$jspb$utils_joinSignedDecimalString(this.readUint32(),this.readUint32())},module$exports$jspb$binary$decoder.BinaryDecoder.prototype.readFloat=function(){var e=this.readUint32(),t=2*(e>>31)+1,n=e>>>23&255;return e&=8388607,255==n?e?NaN:1/0*t:0==n?t*Math.pow(2,-149)*e:t*Math.pow(2,n-150)*(e+Math.pow(2,23))},module$exports$jspb$binary$decoder.BinaryDecoder.prototype.readDouble=function(){if(module$contents$jspb$binary$decoder_ASSUME_DATAVIEW_IS_FAST){var e=this.dataView_.getFloat64(this.cursor_,!0);return this.cursor_+=8,this.checkCursor(),e}var t=this.readUint32(),n=this.readUint32();e=2*(n>>31)+1;var r=n>>>20&2047;return t=module$exports$jspb$BinaryConstants.TWO_TO_32*(1048575&n)+t,2047==r?t?NaN:1/0*e:0==r?e*Math.pow(2,-1074)*t:e*Math.pow(2,r-1075)*(t+module$exports$jspb$BinaryConstants.TWO_TO_52)},module$exports$jspb$binary$decoder.BinaryDecoder.prototype.readDoubleArrayInto=function(e,t){var n=this.cursor_,r=8*e;if(n+r>this.end_)throw module$contents$jspb$binary$errors_readTooFarError(r,this.end_-n);if(n+=this.bytes_.byteOffset,module$contents$jspb$binary$decoder_ASSUME_DATAVIEW_IS_FAST)for(this.cursor_+=r,e=new DataView(this.bytes_.buffer,n,r),r=0;!((n=r+8)>e.byteLength);)t.push(e.getFloat64(r,!0)),r=n;else if(void 0===module$contents$jspb$binary$decoder_isLittleEndianCache&&(module$contents$jspb$binary$decoder_isLittleEndianCache=513==new Uint16Array(new Uint8Array([1,2]).buffer)[0]),goog.asserts.assertBoolean(module$contents$jspb$binary$decoder_isLittleEndianCache))for(this.cursor_+=r,e=new Float64Array(this.bytes_.buffer.slice(n,n+r)),r=0;r<e.length;r++)t.push(e[r]);else for(r=0;r<e;r++)t.push(this.readDouble())},module$exports$jspb$binary$decoder.BinaryDecoder.prototype.readBool=function(){var e=!!this.bytes_[this.cursor_++];return this.checkCursor(),e},module$exports$jspb$binary$decoder.BinaryDecoder.prototype.readEnum=function(){return this.readSignedVarint32()},module$exports$jspb$binary$decoder.BinaryDecoder.prototype.readString=function(e,t){var n=this.cursor_;this.cursor_+=e,this.checkCursor();var r=goog.asserts.assert(this.bytes_);return module$contents$jspb$binary$utf8_useTextDecoderDecode?(module$contents$jspb$binary$utf8_utf8ErrorsAreFatal(t)?module$contents$jspb$binary$utf8_getFatalDecoderInstance():module$contents$jspb$binary$utf8_getNonFatalDecoderInstance()).decode(r.subarray(n,n+e)):module$contents$jspb$binary$utf8_polyfillDecodeUtf8(r,n,e,t)},module$exports$jspb$binary$decoder.Bi
2naryDecoder.prototype.readBytes=function(e){if(0>e||this.cursor_+e>this.bytes_.length){if(0>e)throw Error("Tried to read a negative byte length: "+e);throw module$contents$jspb$binary$errors_readTooFarError(e,this.bytes_.length-this.cursor_)}var t=this.bytesFieldsAsMutableViews?this.bytes_.subarray(this.cursor_,this.cursor_+e):module$contents$jspb$utils_sliceUint8Array(this.bytes_,this.cursor_,this.cursor_+e);return this.cursor_+=e,t},module$exports$jspb$binary$decoder.BinaryDecoder.resetInstanceCache=function(){module$exports$jspb$binary$decoder.BinaryDecoder.instanceCache_=[]},module$exports$jspb$binary$decoder.BinaryDecoder.getInstanceCache=function(){return module$exports$jspb$binary$decoder.BinaryDecoder.instanceCache_},module$exports$jspb$binary$decoder.BinaryDecoder.instanceCache_=[];var module$contents$jspb$binary$decoder_isLittleEndianCache=void 0,module$contents$jspb$binary$decoder_ASSUME_DATAVIEW_IS_FAST=2019<=goog.FEATURESET_YEAR,module$exports$jspb$binary$reader={BinaryReader:function(e,t,n,r){var o=void 0!==(r=void 0===r?{}:r).discardUnknownFields&&r.discardUnknownFields;this.decoderOptions={bytesFieldsAsMutableViews:void 0!==r.bytesFieldsAsMutableViews&&r.bytesFieldsAsMutableViews},this.discardUnknownFields=o,this.decoder_=module$exports$jspb$binary$decoder.BinaryDecoder.alloc(e,t,n,this.decoderOptions),this.fieldCursor_=this.decoder_.getCursor(),this.nextField_=module$exports$jspb$BinaryConstants.INVALID_FIELD_NUMBER,this.nextTag_=module$exports$jspb$BinaryConstants.INVALID_TAG,this.nextWireType_=module$exports$jspb$BinaryConstants.WireType.INVALID}};module$exports$jspb$binary$reader.BinaryReader.alloc=function(e,t,n){if(module$exports$jspb$binary$reader.BinaryReader.instanceCache_.length){var r=module$exports$jspb$binary$reader.BinaryReader.instanceCache_.pop();return e&&r.setBlock(e,t,n),r}return new module$exports$jspb$binary$reader.BinaryReader(e,t,n)},module$exports$jspb$binary$reader.BinaryReader.prototype.free=function(){this.decoder_.clear(),this.nextTag_=module$exports$jspb$BinaryConstants.INVALID_TAG,this.nextField_=module$exports$jspb$BinaryConstants.INVALID_FIELD_NUMBER,this.nextWireType_=module$exports$jspb$BinaryConstants.WireType.INVALID,100>module$exports$jspb$binary$reader.BinaryReader.instanceCache_.length&&module$exports$jspb$binary$reader.BinaryReader.instanceCache_.push(this)},module$exports$jspb$binary$reader.BinaryReader.prototype.getFieldCursor=function(){return this.fieldCursor_},module$exports$jspb$binary$reader.BinaryReader.prototype.getCursor=function(){return this.decoder_.getCursor()},module$exports$jspb$binary$reader.BinaryReader.prototype.getBuffer=function(){return this.decoder_.getBuffer()},module$exports$jspb$binary$reader.BinaryReader.prototype.getTag=function(){return this.nextTag_},module$exports$jspb$binary$reader.BinaryReader.prototype.getFieldNumber=function(){return this.nextField_},module$exports$jspb$binary$reader.BinaryReader.prototype.getWireType=function(){return this.nextWireType_},module$exports$jspb$binary$reader.BinaryReader.prototype.isEndGroup=function(){return this.nextWireType_==module$exports$jspb$BinaryConstants.WireType.END_GROUP},module$exports$jspb$binary$reader.BinaryReader.prototype.isDelimited=function(){return this.nextWireType_==module$exports$jspb$BinaryConstants.WireType.DELIMITED},module$exports$jspb$binary$reader.BinaryReader.prototype.setBlock=function(e,t,n){this.decoder_.setBlock(e,t,n),this.nextField_=module$exports$jspb$BinaryConstants.INVALID_FIELD_NUMBER,this.nextWireType_=module$exports$jspb$BinaryConstants.WireType.INVALID},module$exports$jspb$binary$reader.BinaryReader.prototype.reset=function(){this.decoder_.reset(),this.nextField_=module$exports$jspb$BinaryConstants.INVALID_FIELD_NUMBER,this.nextWireType_=module$exports$jspb$BinaryConstants.WireType.INVALID},module$exports$jspb$binary$reader.BinaryReader.prototype.advance=function(e){this.decoder_.advance(e)},module$exports$jspb$binary$reader.BinaryReader.prototype.nextField=function(){if(this.decoder_.atEnd())return!1;this.fieldCursor_=this.decoder_.getCursor();var e=this.decoder_.readUnsignedVarint32(),t=7&e;if(!module$contents$jspb$BinaryConstants_isValidWireType(t))throw module$contents$jspb$binary$errors_invalidWireTypeError(t,this.fieldCursor_);return this.nextTag_=e,this.nextField_=e>>>3,this.nextWireType_=t,!0},module$exports$jspb$binary$reader.BinaryReader.prototype.skipVarintField=function(){this.nextWireType_!=module$exports$jspb$BinaryConstants.WireType.VARINT?(goog.asserts.fail("Invalid wire type for skipVarintField"),this.skipField()):this.decoder_.skipVarint()},module$exports$jspb$binary$reader.BinaryReader.prototype.skipDelimitedField=function(){if(this.nextWireType_!=module$exports$jspb$BinaryConstants.WireType.DELIMITED)goog.asserts.fail("Invalid wire type for skipDelimitedField"),this.skipField();else{var e=this.decoder_.readUnsignedVarint32();this.decoder_.advance(e)}},module$exports$jspb$binary$reader.BinaryReader.prototype.skipFixed32Field=function(){goog.asserts.assert(this.nextWireType_===module$exports$jspb$BinaryConstants.WireType.FIXED32),this.decoder_.advance(4)},module$exports$jspb$binary$reader.BinaryReader.prototype.skipFixed64Field=function(){goog.asserts.assert(this.nextWireType_===module$exports$jspb$BinaryConstants.WireType.FIXED64),this.decoder_.advance(8)},module$exports$jspb$binary$reader.BinaryReader.prototype.skipGroup=function(){for(var e=this.nextField_;;){if(!this.nextField())throw Error("Unmatched start-group tag: stream EOF");if(this.nextWireType_==module$exports$jspb$BinaryConstants.WireType.END_GROUP){if(this.nextField_!=e)throw Error("Unmatched end-group tag");break}this.skipField()}},module$exports$jspb$binary$reader.BinaryReader.prototype.skipField=function(){switch(this.nextWireType_){case module$exports$jspb$BinaryConstants.WireType.VARINT:this.skipVarintField();break;case module$exports$jspb$BinaryConstants.WireType.FIXED64:this.skipFixed64Field();break;case module$exports$jspb$BinaryConstants.WireType.DELIMITED:this.skipDelimitedField();break;case module$exports$jspb$BinaryConstants.WireType.FIXED32:this.skipFixed32Field();break;case module$exports$jspb$BinaryConstants.WireType.START_GROUP:this.skipGroup();break;default:throw module$contents$jspb$binary$errors_invalidWireTypeError(this.nextWireType_,this.fieldCursor_)}},module$exports$jspb$binary$reader.BinaryReader.prototype.handleUnknownField=function(e){var t=this.getFieldCursor();this.skipField(),this.addUnknownFieldsStartingFrom(e,t)},module$exports$jspb$binary$reader.BinaryReader.prototype.addUnknownFieldsStartingFrom=function(e,t){if(!this.discardUnknownFields){t=module$contents$jspb$utils_sliceUint8Array(goog.asserts.assert(this.decoder_.getBuffer()),t,this.decoder_.getCursor());var n=e.internalUnknownFields_;n?n.push(t):e.internalUnknownFields_=[t]}},module$exports$jspb$binary$reader.BinaryReader.prototype.readAny=function(e){if(module$contents$jspb$BinaryConstants_FieldTypeToWireType(e)!==this.nextWireType_)return null;var t=module$exports$jspb$BinaryConstants.FieldType;switch(e){case t.DOUBLE:return this.readDouble();case t.FLOAT:return this.readFloat();case t.INT64:return this.readInt64();case t.UINT64:return this.readUint64();case t.INT32:return this.readInt32();case t.FIXED64:return this.readFixed64();case t.FIXED32:return this.readFixed32();case t.BOOL:return this.readBool();case t.STRING:return this.readString();case t.GROUP:goog.asserts.fail("Group field type not supported in readAny()");case t.MESSAGE:goog.asserts.fail("Message field type not supported in readAny()");case t.BYTES:return this.readBytes();case t.UINT32:return this.readUint32();case t.ENUM:return this.readEnum();case t.SFIXED32:return this.readSfixed32();case t.SFIXED64:return this.readSfixed64();case t.SINT32:return this.readSint32();case t.SINT64:return this.readSint64();default:goog.asserts.fail("Invalid field type in readAny()")}return null},module$exports$jspb$binary$reader.BinaryReader.prototype.readMessage=function(e,t){goog.asserts.assert(this.nextWireType_==module$exports$jspb$BinaryConstants.WireType.DELIMITED);var n=this.decoder_.getEnd(),r=this.decoder_.readUnsignedVarint32(),o=this.decoder_.getCursor()+r;if(this.decoder_.setEnd(o),t(e,this),0!==(t=o-this.decoder_.getCursor()))throw Error("Message parsing ended unexpectedly. Expected to read "+r+" bytes, instead read "+(r-t)+" bytes, either the data ended unexpectedly or the message misreported its own length");return this.decoder_.setCursor(o),this.decoder_.setEnd(n),e},module$exports$jspb$binary$reader.BinaryReader.prototype.readGroup=function(e,t,n){if(goog.asserts.assert(this.nextWireType_==module$exports$jspb$BinaryConstants.WireType.START_GROUP),goog.asserts.assert(this.nextField_==e),n(t,this),this.nextWireType_!==module$exports$jspb$BinaryConstants.WireType.END_GROUP)throw Error("Group submessage did n
2ot end with an END_GROUP tag");if(this.nextField_!==e)throw Error("Unmatched end-group tag");return t},module$exports$jspb$binary$reader.BinaryReader.prototype.readInt32=function(){return goog.asserts.assert(this.nextWireType_==module$exports$jspb$BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint32()},module$exports$jspb$binary$reader.BinaryReader.prototype.readInt64=function(){return goog.asserts.assert(this.nextWireType_==module$exports$jspb$BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint64()},module$exports$jspb$binary$reader.BinaryReader.prototype.readInt64String=function(){return goog.asserts.assert(this.nextWireType_==module$exports$jspb$BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint64String()},module$exports$jspb$binary$reader.BinaryReader.prototype.readUint32=function(){return goog.asserts.assert(this.nextWireType_==module$exports$jspb$BinaryConstants.WireType.VARINT),this.decoder_.readUnsignedVarint32()},module$exports$jspb$binary$reader.BinaryReader.prototype.readUint64=function(){return goog.asserts.assert(this.nextWireType_==module$exports$jspb$BinaryConstants.WireType.VARINT),this.decoder_.readUnsignedVarint64()},module$exports$jspb$binary$reader.BinaryReader.prototype.readUint64String=function(){return goog.asserts.assert(this.nextWireType_==module$exports$jspb$BinaryConstants.WireType.VARINT),this.decoder_.readUnsignedVarint64String()},module$exports$jspb$binary$reader.BinaryReader.prototype.readSint32=function(){return goog.asserts.assert(this.nextWireType_==module$exports$jspb$BinaryConstants.WireType.VARINT),this.decoder_.readZigzagVarint32()},module$exports$jspb$binary$reader.BinaryReader.prototype.readSint64=function(){return goog.asserts.assert(this.nextWireType_==module$exports$jspb$BinaryConstants.WireType.VARINT),this.decoder_.readZigzagVarint64()},module$exports$jspb$binary$reader.BinaryReader.prototype.readSint64String=function(){return goog.asserts.assert(this.nextWireType_==module$exports$jspb$BinaryConstants.WireType.VARINT),this.decoder_.readZigzagVarint64String()},module$exports$jspb$binary$reader.BinaryReader.prototype.readFixed32=function(){return goog.asserts.assert(this.nextWireType_==module$exports$jspb$BinaryConstants.WireType.FIXED32),this.decoder_.readUint32()},module$exports$jspb$binary$reader.BinaryReader.prototype.readFixed64=function(){return goog.asserts.assert(this.nextWireType_==module$exports$jspb$BinaryConstants.WireType.FIXED64),this.decoder_.readUint64()},module$exports$jspb$binary$reader.BinaryReader.prototype.readFixed64String=function(){return goog.asserts.assert(this.nextWireType_==module$exports$jspb$BinaryConstants.WireType.FIXED64),this.decoder_.readUint64String()},module$exports$jspb$binary$reader.BinaryReader.prototype.readSfixed32=function(){return goog.asserts.assert(this.nextWireType_==module$exports$jspb$BinaryConstants.WireType.FIXED32),this.decoder_.readInt32()},module$exports$jspb$binary$reader.BinaryReader.prototype.readSfixed32String=function(){return goog.asserts.assert(this.nextWireType_==module$exports$jspb$BinaryConstants.WireType.FIXED32),this.decoder_.readInt32().toString()},module$exports$jspb$binary$reader.BinaryReader.prototype.readSfixed64=function(){return goog.asserts.assert(this.nextWireType_==module$exports$jspb$BinaryConstants.WireType.FIXED64),this.decoder_.readInt64()},module$exports$jspb$binary$reader.BinaryReader.prototype.readSfixed64String=function(){return goog.asserts.assert(this.nextWireType_==module$exports$jspb$BinaryConstants.WireType.FIXED64),this.decoder_.readInt64String()},module$exports$jspb$binary$reader.BinaryReader.prototype.readFloat=function(){return goog.asserts.assert(this.nextWireType_==module$exports$jspb$BinaryConstants.WireType.FIXED32),this.decoder_.readFloat()},module$exports$jspb$binary$reader.BinaryReader.prototype.readDouble=function(){return goog.asserts.assert(this.nextWireType_==module$exports$jspb$BinaryConstants.WireType.FIXED64),this.decoder_.readDouble()},module$exports$jspb$binary$reader.BinaryReader.prototype.readBool=function(){return goog.asserts.assert(this.nextWireType_==module$exports$jspb$BinaryConstants.WireType.VARINT),!!this.decoder_.readUnsignedVarint32()},module$exports$jspb$binary$reader.BinaryReader.prototype.readEnum=function(){return goog.asserts.assert(this.nextWireType_==module$exports$jspb$BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint64()},module$exports$jspb$binary$reader.BinaryReader.prototype.readString=function(){goog.asserts.assert(this.nextWireType_==module$exports$jspb$BinaryConstants.WireType.DELIMITED);var e=this.decoder_.readUnsignedVarint32();return this.decoder_.readString(e,!1)},module$exports$jspb$binary$reader.BinaryReader.prototype.readStringRequireUtf8=function(){goog.asserts.assert(this.nextWireType_==module$exports$jspb$BinaryConstants.WireType.DELIMITED);var e=this.decoder_.readUnsignedVarint32();return this.decoder_.readString(e,!0)},module$exports$jspb$binary$reader.BinaryReader.prototype.readBytes=function(){goog.asserts.assert(this.nextWireType_==module$exports$jspb$BinaryConstants.WireType.DELIMITED);var e=this.decoder_.readUnsignedVarint32();return this.decoder_.readBytes(e)},module$exports$jspb$binary$reader.BinaryReader.prototype.readSplitVarint64=function(e){return goog.asserts.assert(this.nextWireType_==module$exports$jspb$BinaryConstants.WireType.VARINT),this.decoder_.readSplitVarint64(e)},module$exports$jspb$binary$reader.BinaryReader.prototype.readSplitZigzagVarint64=function(e){return goog.asserts.assert(this.nextWireType_==module$exports$jspb$BinaryConstants.WireType.VARINT),this.decoder_.readSplitVarint64(function(t,n){return module$contents$jspb$utils_fromZigzag64(t,n,e)})},module$exports$jspb$binary$reader.BinaryReader.prototype.readSplitFixed64=function(e){return goog.asserts.assert(this.nextWireType_==module$exports$jspb$BinaryConstants.WireType.FIXED64),this.decoder_.readSplitFixed64
2(e)},module$exports$jspb$binary$reader.BinaryReader.prototype.readPackedFieldInto_=function(e,t){var n=this.readPackedFieldLength_();for(n=this.decoder_.getCursor()+n;this.decoder_.getCursor()<n;)t.push(e.call(this.decoder_))},module$exports$jspb$binary$reader.BinaryReader.prototype.readPackedFieldLength_=function(){return goog.asserts.assert(this.nextWireType_==module$exports$jspb$BinaryConstants.WireType.DELIMITED),this.decoder_.readUnsignedVarint32()},module$exports$jspb$binary$reader.BinaryReader.prototype.readPackableInt32Into=function(e){this.isDelimited()?this.readPackedFieldInto_(module$exports$jspb$binary$decoder.BinaryDecoder.prototype.readSignedVarint32,e):e.push(this.readInt32())},module$exports$jspb$binary$reader.BinaryReader.prototype.readPackableInt64Into=function(e){this.isDelimited()?this.readPackedFieldInto_(module$exports$jspb$binary$decoder.BinaryDecoder.prototype.readSignedVarint64,e):e.push(this.readInt64())},module$exports$jspb$binary$reader.BinaryReader.prototype.readPackableInt64StringInto=function(e){this.isDelimited()?this.readPackedFieldInto_(module$exports$jspb$binary$decoder.BinaryDecoder.prototype.readSignedVarint64String,e):e.push(this.readInt64String())},module$exports$jspb$binary$reader.BinaryReader.prototype.readPackableUint32Into=function(e){this.isDelimited()?this.readPackedFieldInto_(module$exports$jspb$binary$decoder.BinaryDecoder.prototype.readUnsignedVarint32,e):e.push(this.readUint32())},module$exports$jspb$binary$reader.BinaryReader.prototype.readPackableUint64Into=function(e){this.isDelimited()?this.readPackedFieldInto_(module$exports$jspb$binary$decoder.BinaryDecoder.prototype.readUnsignedVarint64,e):e.push(this.readUint64())},module$exports$jspb$binary$reader.BinaryReader.prototype.readPackableUint64StringInto=function(e){this.isDelimited()?this.readPackedFieldInto_(module$exports$jspb$binary$decoder.BinaryDecoder.prototype.readUnsignedVarint64String,e):e.push(this.readUint64String())},module$exports$jspb$binary$reader.BinaryReader.prototype.readPackableSint32Into=function(e){this.isDelimited()?this.readPackedFieldInto_(module$exports$jspb$binary$decoder.BinaryDecoder.prototype.readZigzagVarint32,e):e.push(this.readSint32())},module$exports$jspb$binary$reader.BinaryReader.prototype.readPackableSint64Into=function(e){this.isDelimited()?this.readPackedFieldInto_(module$exports$jspb$binary$decoder.BinaryDecoder.prototype.readZigzagVarint64,e):e.push(this.readSint64())},module$exports$jspb$binary$reader.BinaryReader.prototype.readPackableSint64StringInto=function(e){this.isDelimited()?this.readPackedFieldInto_(module$exports$jspb$binary$decoder.BinaryDecoder.prototype.readZigzagVarint64String,e):e.push(this.readSint64String())},module$exports$jspb$binary$reader.BinaryReader.prototype.readPackableFixed32Into=function(e){this.isDelimited()?this.readPackedFieldInto_(module$exports$jspb$binary$decoder.BinaryDecoder.prototype.readUint32,e):e.push(this.readFixed32())},module$exports$jspb$binary$reader.BinaryReader.prototype.readPackableFixed64Into=function(e){this.isDelimited()?this.readPackedFieldInto_(module$exports$jspb$binary$decoder.BinaryDecoder.prototype.readUint64,e):e.push(this.readFixed64())},module$exports$jspb$binary$reader.BinaryReader.prototype.readPackableFixed64StringInto=function(e){this.isDelimited()?this.readPackedFieldInto_(module$exports$jspb$binary$decoder.BinaryDecoder.prototype.readUint64String,e):e.push(this.readFixed64String())},module$exports$jspb$binary$reader.BinaryReader.prototype.readPackableSfixed32Into=function(e){this.isDelimited()?this.readPackedFieldInto_(module$exports$jspb$binary$decoder.BinaryDecoder.prototype.readInt32,e):e.push(this.readSfixed32())},module$exports$jspb$binary$reader.BinaryReader.prototype.readPackableSfixed64Into=function(e){this.isDelimited()?this.readPackedFieldInto_(module$exports$jspb$binary$decoder.BinaryDecoder.prototype.readInt64,e):e.push(this.readSfixed64())},module$exports$jspb$binary$reader.BinaryReader.prototype.readPackableSfixed64StringInto=function(e){this.isDelimited()?this.readPackedFieldInto_(module$exports$jspb$binary$decoder.BinaryDecoder.prototype.readInt64String,e):e.push(this.readSfixed64String())},module$exports$jspb$binary$reader.BinaryReader.prototype.readPackableFloatInto=function(e){this.isDelimited()?this.readPackedFieldInto_(module$exports$jspb$binary$decoder.BinaryDecoder.prototype.readFloat,e):e.push(this.readFloat())},module$exports$jspb$binary$reader.BinaryReader.prototype.readPackableDoubleInto=function(e){this.isDelimited()?this.decoder_.readDoubleArrayInto(this.readPackedFieldLength_()/8,e):e.push(this.readDouble())},module$exports$jspb$binary$reader.BinaryReader.prototype.readPackableBoolInto=function(e){this.isDelimited()?this.readPackedFieldInto_(module$exports$jspb$binary$decoder.BinaryDecoder.prototype.readBool,e):e.push(this.readBool())},module$exports$jspb$binary$reader.BinaryReader.prototype.readPackableEnumInto=function(e){this.isDelimited()?this.readPackedFieldInto_(module$exports$jspb$binary$decoder.BinaryDecoder.prototype.readEnum,e):e.push(this.readEnum())},module$exports$jspb$binary$reader.BinaryReader.resetInstanceCache=function(){module$exports$jspb$binary$reader.BinaryReader.instanceCache_=[]},module$exports$jspb$binary$reader.BinaryReader.getInstanceCache=function(){return module$exports$jspb$binary$reader.BinaryReader.instanceCache_},module$exports$jspb$binary$reader.BinaryReader.instanceCache_=[];var module$exports$jspb$arith={UInt64:function(e,t){this.lo=e,this.hi=t}};module$exports$jspb$arith.UInt64.prototype.cmp=function(e){return this.hi<e.hi||this.hi==e.hi&&this.lo<e.lo?-1:this.hi==e.hi&&this.lo==e.lo?0:1},module$exports$jspb$arith.UInt64.prototype.rightShift=function(){return new module$exports$jspb$arith.UInt64((this.lo>>>1|(1&this.hi)<<31)>>>0,this.hi>>>1>>>0)},module$exports$jspb$arith.UInt64.prototype.leftShift=function(){return new module$exports$jspb$arith.UInt64(this.lo<<1>>>0,(this.hi<<1|this.lo>>>31)>>>0)},module$exports$jspb$arith.UInt64.prototype.msb=function(){return!!(2147483648&this.hi)},module$exports$jspb$arith.UInt64.prototype.lsb=function(){return!!(1&this.lo)},module$exports$jspb$arith.UInt64.prototype.zero=function(){return 0==this.lo&&0==this.hi},module$exports$jspb$arith.UInt64.prototype.add=function(e){return new module$exports$jspb$arith.UInt64((this.lo+e.lo&4294967295)>>>0>>>0,((this.hi+e.hi&4294967295)>>>0)+(4294967296<=this.lo+e.lo?1:0)>>>0)},module$exports$jspb$arith.UInt64.prototype.sub=function(e){return new module$exports$jspb$arith.UInt64((this.lo-e.lo&4294967295)>>>0>>>0,((this.hi-e.hi&4294967295)>>>0)-(0>this.lo-e.lo?1:0)>>>0)},module$exports$jspb$arith.UInt64.mul32x32=function(e,t){var n=65535&e,r=65535&t,o=t>>>16;for(t=n*r+65536*(n*o&65535)+65536*((e>>>
2=16)*r&65535),n=e*o+(n*o>>>16)+(e*r>>>16);4294967296<=t;)t-=4294967296,n+=1;return new module$exports$jspb$arith.UInt64(t>>>0,n>>>0)},module$exports$jspb$arith.UInt64.prototype.mul=function(e){var t=module$exports$jspb$arith.UInt64.mul32x32(this.lo,e);return(e=module$exports$jspb$arith.UInt64.mul32x32(this.hi,e)).hi=e.lo,e.lo=0,t.add(e)},module$exports$jspb$arith.UInt64.prototype.div=function(e){if(0==e)return[];for(var t=new module$exports$jspb$arith.UInt64(0,0),n=new module$exports$jspb$arith.UInt64(this.lo,this.hi),r=new module$exports$jspb$arith.UInt64(e,0),o=new module$exports$jspb$arith.UInt64(1,0);!r.msb();)r=r.leftShift(),o=o.leftShift();for(;!o.zero();)0>=r.cmp(n)&&(t=t.add(o),n=n.sub(r)),r=r.rightShift(),o=o.rightShift();return[t,n]},module$exports$jspb$arith.UInt64.prototype.toString=function(){for(var e="",t=this;!t.zero();){var n=(t=t.div(10))[0];e=t[1].lo+e,t=n}return""==e&&(e="0"),e},module$exports$jspb$arith.UInt64.fromString=function(e){for(var t=new module$exports$jspb$arith.UInt64(0,0),n=new module$exports$jspb$arith.UInt64(0,0),r=0;r<e.length;r++){if("0">e[r]||"9"<e[r])return null;n.lo=parseInt(e[r],10),t=t.mul(10).add(n)}return t},module$exports$jspb$arith.UInt64.prototype.clone=function(){return new module$exports$jspb$arith.UInt64(this.lo,this.hi)},module$exports$jspb$arith.Int64=function(e,t){this.lo=e,this.hi=t},module$exports$jspb$arith.Int64.prototype.add=function(e){return new module$exports$jspb$arith.Int64((this.lo+e.lo&4294967295)>>>0>>>0,((this.hi+e.hi&4294967295)>>>0)+(4294967296<=this.lo+e.lo?1:0)>>>0)},module$exports$jspb$arith.Int64.prototype.sub=function(e){return new module$exports$jspb$arith.Int64((this.lo-e.lo&4294967295)>>>0>>>0,((this.hi-e.hi&4294967295)>>>0)-(0>this.lo-e.lo?1:0)>>>0)},module$exports$jspb$arith.Int64.prototype.clone=function(){return new module$exports$jspb$arith.Int64(this.lo,this.hi)},module$exports$jspb$arith.Int64.prototype.toString=function(){var e=!!(2147483648&this.hi),t=new module$exports$jspb$arith.UInt64(this.lo,this.hi);return e&&(t=new module$exports$jspb$arith.UInt64(0,0).sub(t)),(e?"-":"")+t.toString()},module$exports$jspb$arith.Int64.fromString=function(e){var t=0<e.length&&"-"==e[0];return t&&(e=e.substring(1)),null===(e=module$exports$jspb$arith.UInt64.fromString(e))?null:(t&&(e=new module$exports$jspb$arith.UInt64(0,0).sub(e)),new module$exports$jspb$arith.Int64(e.lo,e.hi))};var module$exports$jspb$binary$encoder={BinaryEncoder:function(){this.buffer_=new Uint8Array(64),this.length_=0}};module$exports$jspb$binary$encoder.BinaryEncoder.prototype.ensureSpace_=function(e){if(!(this.length_+e<this.buffer_.length)){var t=this.buffer_;this.buffer_=new Uint8Array(Math.ceil(e+2*this.buffer_.length)),this.buffer_.set(t)}},module$exports$jspb$binary$encoder.BinaryEncoder.prototype.push=function(e){this.ensureSpace_(1),this.buffer_[this.length_++]=e},module$exports$jspb$binary$encoder.BinaryEncoder.prototype.writeBytes=function(e){this.ensureSpace_(e.length),this.buffer_.set(e,this.length_),this.length_+=e.length},module$exports$jspb$binary$encoder.BinaryEncoder.prototype.length=function(){return this.length_},module$exports$jspb$binary$encoder.BinaryEncoder.prototype.end=function(){var e=this.buffer_,t=this.length_;return this.length_=0,module$contents$jspb$utils_sliceUint8Array(e,0,t)},module$exports$jspb$binary$encoder.BinaryEncoder.prototype.writeAndEnd=function(e,t){var n=this.length_;return 0===n?0:(e.set(this.buffer_.subarray(0,n),t),this.length_=0,n)},module$exports$jspb$binary$encoder.BinaryEncoder.prototype.writeSplitVarint64=function(e,t){for(goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(t==Math.floor(t)),goog.asserts.assert(0<=e&&e<module$exports$jspb$BinaryConstants.TWO_TO_32),goog.asserts.assert(0<=t&&t<module$exports$jspb$BinaryConstants.TWO_TO_32);0<t||127<e;)this.push(127&e|128),e=(e>>>7|t<<25)>>>0,t>>>=7;this.push(e)},module$exports$jspb$binary$encoder.BinaryEncoder.prototype.writeSplitFixed64=function(e,t){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(t==Math.floor(t)),goog.asserts.assert(0<=e&&e<module$exports$jspb$BinaryConstants.TWO_TO_32),goog.asserts.assert(0<=t&&t<module$exports$jspb$BinaryConstants.TWO_TO_32),this.writeUint32(e),this.writeUint32(t)},module$exports$jspb$binary$encoder.BinaryEncoder.prototype.writeSplitZigzagVarint64=function(e,t){var n=this;module$contents$jspb$utils_toZigzag64(e,t,function(e,t){n.writeSplitVarint64(e>>>0,t>>>0)})},module$exports$jspb$binary$encoder.BinaryEncoder.prototype.writeUnsignedVarint32=function(e){for(goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(0<=e&&e<module$exports$jspb$BinaryConstants.TWO_TO_32);127<e;)this.push(127&e|128),e>>>=7;this.push(e)},module$exports$jspb$binary$encoder.BinaryEncoder.prototype.writeSignedVarint32=function(e){if(goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(e>=-module$exports$jspb$BinaryConstants.TWO_TO_31&&e<module$exports$jspb$BinaryConstants.TWO_TO_31),0<=e)this.writeUnsignedVarint32(e);else{for(var t=0;9>t;t++)this.push(127&e|128),e>>=7;this.push(1)}},module$exports$jspb$binary$encoder.BinaryEncoder.prototype.writeUnsignedVarint64=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(0<=e&&e<module$exports$jspb$BinaryConstants.TWO_TO_64),module$contents$jspb$utils_splitInt64(e),this.writeSplitVarint64(module$contents$jspb$utils_split64Low,module$contents$jspb$utils_split64High)},module$exports$jspb$binary$encoder.BinaryEncoder.prototype.writeSignedVarint64=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(e>=-module$exports$jspb$BinaryConstants.TWO_TO_63&&e<module$exports$jspb$BinaryConstants.TWO_TO_63),module$contents$jspb$utils_splitInt64(e),this.writeSplitVarint64(module$contents$jspb$utils_split64Low,module$contents$jspb$utils_split64High)},module$exports$jspb$binary$encoder.BinaryEncoder.prototype.writeZigzagVarint32=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(e>=-module$exports$jspb$BinaryConstants.TWO_TO_31&&e<module$exports$jspb$BinaryConstants.TWO_TO_31),this.writeUnsignedVarint32((e<<1^e>>31)>>>0)},module$exports$jspb$binary$encoder.BinaryEncoder.prototype.writeZigzagVarint64=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(e>=-module$exports$jspb$BinaryConstants.TWO_TO_63&&e<module$exports$jspb$BinaryConstants.TWO_TO_63);var t=e;e=0>t,module$contents$jspb$utils_splitUint64(t=2*Math.abs(t)),t=module$contents$jspb$utils_split64Low;var n=module$contents$jspb$utils_split64High;e&&(0==t?0==n?n=t=4294967295:(n--,t=4294967295):t--),module$contents$jspb$utils_split64Low=t,module$contents$jspb$utils_split64High=n,this.writeSplitVarint64(module$contents$jspb$utils_split64Low,module$contents$jspb$utils_split64High)},module$exports$jspb$binary$encoder.BinaryEncoder.prototype.writeZigzagVarint64String=function(e){var t=this;module$contents$jspb$utils_splitBytes64(module$contents$jspb$utils_decimalStringToBytes64(e)),module$contents$jspb$utils_toZigzag64(module$contents$jspb$utils_split64Low,module$contents$jspb$utils_split64High,function(e,n){t.writeSplitVarint64(e>>>0,n>>>0)})},module$exports$jspb$binary$encoder.BinaryEncoder.prototype.writeUint8=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(0<=e&&256>e),this.push(e>>>0&255)},module$exports$jspb$binary$encoder.BinaryEncoder.prototype.writeUint16=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(0<=e&&65536>e),this.push(e>>>0&255),this.push(e>>>8&255)},module$exports$jspb$binary$encoder.BinaryEncoder.prototype.writeUint32=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(0<=e&&e<module$exports$jspb$BinaryConstants.TWO_TO_32),this.push(e>>>0&255),this.push(e>>>8&255),this.push(e>>>16&255),this.push(e>>>24&255)},module$exports$jspb$binary$encoder.BinaryEncoder.prototype.writeUint64=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(0<=e&&e<module$exports$jspb$BinaryConstants.TWO_TO_64),module$contents$jspb$utils_splitUint64(e),this.writeUint32(module$contents$jspb$utils_split64Low),this.writeUint32(module$contents$jspb$utils_split64High)},module$exports$jspb$binary$encoder.BinaryEncoder.prototype.writeInt8=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(-128<=e&&128>e),this.push(e>>>0&255)},module$exports$jspb$binary$encoder.BinaryEncoder.prototype.writeInt16=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(-32768<=e&&32768>e),this.push(e>>>0&255),this.push(e>>>8&255)},module$exports$jspb$binary$encoder.BinaryEncoder.prototype.writeInt32=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(e>=-module$exports$jspb$BinaryConstants.TWO_TO_31&&e<module$exports$jspb$BinaryConstants.TWO_TO_31),this.push(e>>>0&255),this.push(e>>>8&255),this.push(e>>>16&255),this.push(e>>>24&255)},module$exports$jspb$binary$encoder.BinaryEncoder.prototype.writeInt64=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(e>=-module$exports$jspb$BinaryConstants.TWO_TO_63&&e<module$exports$jspb$BinaryConstants.TWO_TO_63),module$contents$jspb$utils_splitInt64(e),this.writeSplitFixed64
2(module$contents$jspb$utils_split64Low,module$contents$jspb$utils_split64High)},module$exports$jspb$binary$encoder.BinaryEncoder.prototype.writeFloat=function(e){goog.asserts.assert(1/0===e||-1/0===e||isNaN(e)||e>=-module$exports$jspb$BinaryConstants.FLOAT32_MAX&&e<=module$exports$jspb$BinaryConstants.FLOAT32_MAX);var t=e;if(0===(t=(e=0>t?1:0)?-t:t))0<1/t?module$contents$jspb$utils_split64Low=module$contents$jspb$utils_split64High=0:(module$contents$jspb$utils_split64High=0,module$contents$jspb$utils_split64Low=2147483648);else if(isNaN(t))module$contents$jspb$utils_split64High=0,module$contents$jspb$utils_split64Low=2147483647;else if(t>module$exports$jspb$BinaryConstants.FLOAT32_MAX)module$contents$jspb$utils_split64High=0,module$contents$jspb$utils_split64Low=(e<<31|2139095040)>>>0;else if(t<module$exports$jspb$BinaryConstants.FLOAT32_MIN)t=Math.round(t/Math.pow(2,-149)),module$contents$jspb$utils_split64High=0,module$contents$jspb$utils_split64Low=(e<<31|t)>>>0;else{var n=Math.floor(Math.log(t)/Math.LN2);t*=Math.pow(2,-n),16777216<=(t=Math.round(t*module$exports$jspb$BinaryConstants.TWO_TO_23))&&++n,module$contents$jspb$utils_split64High=0,module$contents$jspb$utils_split64Low=(e<<31|n+127<<23|8388607&t)>>>0}this.writeUint32(module$contents$jspb$utils_split64Low)},module$exports$jspb$binary$encoder.BinaryEncoder.prototype.writeDouble=function(e){goog.asserts.assert(1/0===e||-1/0===e||isNaN(e)||e>=-module$exports$jspb$BinaryConstants.FLOAT64_MAX&&e<=module$exports$jspb$BinaryConstants.FLOAT64_MAX);var t=e;if(0===(t=(e=0>t?1:0)?-t:t))module$contents$jspb$utils_split64High=0<1/t?0:2147483648,module$contents$jspb$utils_split64Low=0;else if(isNaN(t))module$contents$jspb$utils_split64High=2147483647,module$contents$jspb$utils_split64Low=4294967295;else if(t>module$exports$jspb$BinaryConstants.FLOAT64_MAX)module$contents$jspb$utils_split64High=(e<<31|2146435072)>>>0,module$contents$jspb$utils_split64Low=0;else if(t<module$exports$jspb$BinaryConstants.FLOAT64_MIN){var n=t/Math.pow(2,-1074);module$contents$jspb$utils_split64High=(e<<31|n/module$exports$jspb$BinaryConstants.TWO_TO_32)>>>0,module$contents$jspb$utils_split64Low=n>>>0}else{var r=t;if(n=0,2<=r)for(;2<=r&&1023>n;)n++,r/=2;else for(;1>r&&-1022<n;)r*=2,n--;r=(t*=Math.pow(2,-n))*module$exports$jspb$BinaryConstants.TWO_TO_52>>>0,module$contents$jspb$utils_split64High=(e<<31|n+1023<<20|t*module$exports$jspb$BinaryConstants.TWO_TO_20&1048575)>>>0,module$contents$jspb$utils_split64Low=r}this.writeUint32(module$contents$jspb$utils_split64Low),this.writeUint32(module$contents$jspb$utils_split64High)},module$exports$jspb$binary$encoder.BinaryEncoder.prototype.writeBool=function(e){goog.asserts.assert("boolean"==typeof e||"number"==typeof e),this.push(e?1:0)},module$exports$jspb$binary$encoder.BinaryEncoder.prototype.writeEnum=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(e>=-module$exports$jspb$BinaryConstants.TWO_TO_31&&e<module$exports$jspb$BinaryConstants.TWO_TO_31),this.writeSignedVarint32(e)};var module$exports$jspb$binary$writer={BinaryWriter:function(){this.blocks_=[],this.totalLength_=0,this.encoder_=new module$exports$jspb$binary$encoder.BinaryEncoder}};function module$contents$jspb$binary$writer_assertSignedInteger(e,t){module$contents$jspb$binary$writer_assertThat(e,t,t===Math.floor(t)),module$contents$jspb$binary$writer_assertThat(e,t,t>=-module$exports$jspb$BinaryConstants.TWO_TO_31&&t<module$exports$jspb$BinaryConstants.TWO_TO_31)}function module$contents$jspb$binary$writer_assertThat(e,t,n){n||(0,goog.asserts.fail)("for ["+t+"] at ["+e+"]")}module$exports$jspb$binary$writer.BinaryWriter.prototype.pushBlock=function(e){0!==e.length&&(this.blocks_.push(e),this.totalLength_+=e.length)},module$exports$jspb$binary$writer.BinaryWriter.prototype.endAndAccumulate=function(){this.pushBlock(this.encoder_.end())},module$exports$jspb$binary$writer.BinaryWriter.prototype.appendUint8Array_=function(e){this.endAndAccumulate(),this.pushBlock(e)},module$exports$jspb$binary$writer.BinaryWriter.prototype.beginDelimited_=function(e){return this.writeFieldHeader_(e,module$exports$jspb$BinaryConstants.WireType.DELIMITED),this.endAndAccumulate(),{lengthAtStart:this.totalLength_,blockIndex:this.blocks_.length-1}},module$exports$jspb$binary$writer.BinaryWriter.prototype.endDelimited_=function(e){this.endAndAccumulate(),this.encoder_.writeUnsignedVarint32(this.totalLength_+this.encoder_.length()-e.lengthAtStart);var t=this.encoder_.end();this.totalLength_+=t.length,this.blocks_.splice(1+e.blockIndex,0,t)},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUnknownFields=function(e){if(e=e.internalUnknownFields_){this.endAndAccumulate();for(var t=0;t<e.length;t++)this.pushBlock(e[t])}},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSerializedMessage=function(e,t,n){this.appendUint8Array_(e.subarray(t,n))},module$exports$jspb$binary$writer.BinaryWriter.prototype.maybeWriteSerializedMessage=function(e,t,n){null!=e&&null!=t&&null!=n&&this.writeSerializedMessage(e,t,n)},module$exports$jspb$binary$writer.BinaryWriter.prototype.getResultBuffer=function(){var e=this.totalLength_+this.encoder_.length();if(0===e)return new Uint8Array(0);e=new Uint8Array(e);for(var t=this.blocks_,n=t.length,r=0,o=0;o<n;o++){var i=t[o];0!==i.length&&(e.set(i,r),r+=i.length)}
vendor: 16,480 bytes, line 2
2return r+=this.encoder_.writeAndEnd(e,r),(0,goog.asserts.assert)(r==e.length),this.blocks_=[e],e},module$exports$jspb$binary$writer.BinaryWriter.prototype.getResultBase64String=function(e){return(0,goog.crypt.base64.encodeByteArray)(this.getResultBuffer(),e)},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFieldHeader_=function(e,t){(0,goog.asserts.assert)(1<=e&&e==Math.floor(e)),this.encoder_.writeUnsignedVarint32(8*e+t)},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeAny=function(e,t,n){switch(e){case module$exports$jspb$BinaryConstants.FieldType.DOUBLE:this.writeDouble(t,n);break;case module$exports$jspb$BinaryConstants.FieldType.FLOAT:this.writeFloat(t,n);break;case module$exports$jspb$BinaryConstants.FieldType.INT64:this.writeInt64(t,n);break;case module$exports$jspb$BinaryConstants.FieldType.UINT64:this.writeUint64(t,n);break;case module$exports$jspb$BinaryConstants.FieldType.INT32:this.writeInt32(t,n);break;case module$exports$jspb$BinaryConstants.FieldType.FIXED64:this.writeFixed64(t,n);break;case module$exports$jspb$BinaryConstants.FieldType.FIXED32:this.writeFixed32(t,n);break;case module$exports$jspb$BinaryConstants.FieldType.BOOL:this.writeBool(t,n);break;case module$exports$jspb$BinaryConstants.FieldType.STRING:this.writeString(t,n);break;case module$exports$jspb$BinaryConstants.FieldType.GROUP:(0,goog.asserts.fail)("Group field type not supported in writeAny()");break;case module$exports$jspb$BinaryConstants.FieldType.MESSAGE:(0,goog.asserts.fail)("Message field type not supported in writeAny()");break;case module$exports$jspb$BinaryConstants.FieldType.BYTES:this.writeBytes(t,n);break;case module$exports$jspb$BinaryConstants.FieldType.UINT32:this.writeUint32(t,n);break;case module$exports$jspb$BinaryConstants.FieldType.ENUM:this.writeEnum(t,n);break;case module$exports$jspb$BinaryConstants.FieldType.SFIXED32:this.writeSfixed32(t,n);break;case module$exports$jspb$BinaryConstants.FieldType.SFIXED64:this.writeSfixed64(t,n);break;case module$exports$jspb$BinaryConstants.FieldType.SINT32:this.writeSint32(t,n);break;case module$exports$jspb$BinaryConstants.FieldType.SINT64:this.writeSint64(t,n);break;default:(0,goog.asserts.fail)("Invalid field type in writeAny()")}},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUnsignedVarint32_=function(e,t){null!=t&&(this.writeFieldHeader_(e,module$exports$jspb$BinaryConstants.WireType.VARINT),this.encoder_.writeUnsignedVarint32(t))},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSignedVarint32_=function(e,t){null!=t&&(module$contents$jspb$binary$writer_assertSignedInteger(e,t),this.writeFieldHeader_(e,module$exports$jspb$BinaryConstants.WireType.VARINT),this.encoder_.writeSignedVarint32(t))},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUnsignedVarint64_=function(e,t){null!=t&&(this.writeFieldHeader_(e,module$exports$jspb$BinaryConstants.WireType.VARINT),this.encoder_.writeUnsignedVarint64(t))},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSignedVarint64_=function(e,t){null!=t&&(this.writeFieldHeader_(e,module$exports$jspb$BinaryConstants.WireType.VARINT),this.encoder_.writeSignedVarint64(t))},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeZigzagVarint32_=function(e,t){null!=t&&(this.writeFieldHeader_(e,module$exports$jspb$BinaryConstants.WireType.VARINT),this.encoder_.writeZigzagVarint32(t))},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeZigzagVarint64_=function(e,t){null!=t&&(this.writeFieldHeader_(e,module$exports$jspb$BinaryConstants.WireType.VARINT),this.encoder_.writeZigzagVarint64(t))},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeZigzagVarint64String_=function(e,t){null!=t&&(this.writeFieldHeader_(e,module$exports$jspb$BinaryConstants.WireType.VARINT),this.encoder_.writeZigzagVarint64String(t))},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeInt32=function(e,t){null!=t&&(module$contents$jspb$binary$writer_assertThat(e,t,t>=-module$exports$jspb$BinaryConstants.TWO_TO_31&&t<module$exports$jspb$BinaryConstants.TWO_TO_31),this.writeSignedVarint32_(e,t))},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeInt64=function(e,t){null!=t&&(module$contents$jspb$binary$writer_assertThat(e,t,t>=-module$exports$jspb$BinaryConstants.TWO_TO_63&&t<module$exports$jspb$BinaryConstants.TWO_TO_63),this.writeSignedVarint64_(e,t))},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeInt64String=function(e,t){null!=t&&(t=module$exports$jspb$arith.Int64.fromString(t),this.writeFieldHeader_(e,module$exports$jspb$BinaryConstants.WireType.VARINT),this.encoder_.writeSplitVarint64(t.lo,t.hi))},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUint32=function(e,t){null!=t&&(module$contents$jspb$binary$writer_assertThat(e,t,0<=t&&t<module$exports$jspb$BinaryConstants.TWO_TO_32),this.writeUnsignedVarint32_(e,t))},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUint64=function(e,t){null!=t&&(module$contents$jspb$binary$writer_assertThat(e,t,0<=t&&t<module$exports$jspb$BinaryConstants.TWO_TO_64),this.writeUnsignedVarint64_(e,t))},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUint64String=function(e,t){null!=t&&(t=module$exports$jspb$arith.UInt64.fromString(t),this.writeFieldHeader_(e,module$exports$jspb$BinaryConstants.WireType.VARINT),this.encoder_.writeSplitVarint64(t.lo,t.hi))},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSint32=function(e,t){null!=t&&(module$contents$jspb$binary$writer_assertThat(e,t,t>=-module$exports$jspb$BinaryConstants.TWO_TO_31&&t<module$exports$jspb$BinaryConstants.TWO_TO_31),this.writeZigzagVarint32_(e,t))},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSint64=function(e,t){null!=t&&(module$contents$jspb$binary$writer_assertThat(e,t,t>=-module$exports$jspb$BinaryConstants.TWO_TO_63&&t<module$exports$jspb$BinaryConstants.TWO_TO_63),this.writeZigzagVarint64_(e,t))},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSint64String=function(e,t){null!=t&&this.writeZigzagVarint64String_(e,t)},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFixed32=function(e,t){null!=t&&(module$contents$jspb$binary$writer_assertThat(e,t,0<=t&&t<module$exports$jspb$BinaryConstants.TWO_TO_32),this.writeFieldHeader_(e,module$exports$jspb$BinaryConstants.WireType.FIXED32),this.encoder_.writeUint32(t))},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFixed64=function(e,t){null!=t&&(module$contents$jspb$binary$writer_assertThat(e,t,0<=t&&t<module$exports$jspb$BinaryConstants.TWO_TO_64),this.writeFieldHeader_(e,module$exports$jspb$BinaryConstants.WireType.FIXED64),this.encoder_.writeUint64(t))},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFixed64String=function(e,t){null!=t&&(t=module$exports$jspb$arith.UInt64.fromString(t),this.writeFieldHeader_(e,module$exports$jspb$BinaryConstants.WireType.FIXED64),this.encoder_.writeSplitFixed64(t.lo,t.hi))},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSfixed32=function(e,t){null!=t&&(module$contents$jspb$binary$writer_assertThat(e,t,t>=-module$exports$jspb$BinaryConstants.TWO_TO_31&&t<module$exports$jspb$BinaryConstants.TWO_TO_31),this.writeFieldHeader_(e,module$exports$jspb$BinaryConstants.WireType.FIXED32),this.encoder_.writeInt32(t))},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSfixed64=function(e,t){null!=t&&(module$contents$jspb$binary$writer_assertThat(e,t,t>=-module$exports$jspb$BinaryConstants.TWO_TO_63&&t<module$exports$jspb$BinaryConstants.TWO_TO_63),this.writeFieldHeader_(e,module$exports$jspb$BinaryConstants.WireType.FIXED64),this.encoder_.writeInt64(t))},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSfixed64String=function(e,t){null!=t&&(t=module$exports$jspb$arith.Int64.fromString(t),this.writeFieldHeader_(e,module$exports$jspb$BinaryConstants.WireType.FIXED64),this.encoder_.writeSplitFixed64(t.lo,t.hi))},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFloat=function(e,t){null!=t&&(this.writeFieldHeader_(e,module$exports$jspb$BinaryConstants.WireType.FIXED32),this.encoder_.writeFloat(t))},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeDouble=function(e,t){null!=t&&(this.writeFieldHeader_(e,module$exports$jspb$BinaryConstants.WireType.FIXED64),this.encoder_.writeDouble(t))},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeBool=function(e,t){null!=t&&(module$contents$jspb$binary$writer_assertThat(e,t,"boolean"==typeof t||"number"==typeof t),this.writeFieldHeader_(e,module$exports$jspb$BinaryConstants.WireType.VARINT),this.encoder_.writeBool(t))},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeEnum=function(e,t){null!=t&&(module$contents$jspb$binary$writer_assertSignedInteger(e,t=parseInt(t,10)),this.writeFieldHeader_(e,module$exports$jspb$BinaryConstants.WireType.VARINT),this.encoder_.writeSignedVarint32(t))},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeString=function(e,t){null!=t&&this.writeUint8Array(e,module$contents$jspb$binary$utf8_encodeUtf8(t))},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeBytes=function(e,t){null!=t&&this.writeUint8Array(e,module$contents$jspb$utils_byteSourceToUint8Array(t))},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUint8Array=function(e,t){this.writeFieldHeader_(e,module$exports$jspb$BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(t.length),this.appendUint8Array_(t)},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeMessage=function(e,t,n){null!=t&&(e=this.beginDelimited_(e),n(t,this),this.endDelimited_(e))},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeMessageSet=function(e,t,n){null!=t&&(this.writeFieldHeader_(1,module$exports$jspb$BinaryConstants.WireType.START_GROUP),this.writeFieldHeader_(2,module$exports$jspb$BinaryConstants.WireType.VARINT),this.encoder_.writeSignedVarint32(e),e=this.beginDelimited_(3),n(t,this),this.endDelimited_(e),this.writeFieldHeader_(1,module$exports$jspb$BinaryConstants.WireType.END_GROUP))},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeGroup=function(e,t,n){null!=t&&(this.writeFieldHeader_(e,module$exports$jspb$BinaryConstants.WireType.START_GROUP),n(t,this),this.writeFieldHeader_(e,module$exports$jspb$BinaryConstants.WireType.END_GROUP))},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSplitFixed64=function(e,t,n){this.writeFieldHeader_(e,module$exports$jspb$BinaryConstants.WireType.FIXED64),this.encoder_.writeSplitFixed64(t,n)},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSplitVarint64=function(e,t,n){this.writeFieldHeader_(e,module$exports$jspb$BinaryConstants.WireType.VARINT),this.encoder_.writeSplitVarint64(t,n)},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSplitZigzagVarint64=function(e,t,n){this.writeFieldHeader_(e,module$exports$jspb$BinaryConstants.WireType.VARINT),this.encoder_.writeSplitZigzagVarint64(t>>>0,n>>>0)},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeRepeatedInt32=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeSignedVarint32_(e,t[n])},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeRepeatedInt64=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeSignedVarint64_(e,t[n])},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeRepeatedSplitFixed64=function(e,t,n,r){if(null!=t)for(var o=0;o<t.length;o++)this.writeSplitFixed64(e,n(t[o]),r(t[o]))},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeRepeatedSplitVarint64=function(e,t,n,r){if(null!=t)for(var o=0;o<t.length;o++)this.writeSplitVarint64(e,n(t[o]),r(t[o]))},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeRepeatedSplitZigzagVarint64=function(e,t,n,r){if(null!=t)for(var o=0;o<t.length;o++)this.writeSplitZigzagVarint64(e,n(t[o]),r(t[o]))},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeRepeatedInt64String=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeInt64String(e,t[n])},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeRepeatedUint32=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeUnsignedVarint32_(e,t[n])},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeRepeatedUint64=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeUnsignedVarint64_(e,t[n])},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeRepeatedUint64String=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeUint64String(e,t[n])},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeRepeatedSint32=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeZigzagVarint32_(e,t[n])},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeRepeatedSint64=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeZigzagVarint64_(e,t[n])},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeRepeatedSint64String=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeZigzagVarint64String_(e,t[n])},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeRepeatedFixed32=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeFixed32(e,t[n])},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeRepeatedFixed64=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeFixed64(e,t[n])},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeRepeatedFixed64String=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeFixed64String(e,t[n])},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeRepeatedSfixed32=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeSfixed32(e,t[n])},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeRepeatedSfixed64=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeSfixed64(e,t[n])},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeRepeatedSfixed64String=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeSfixed64String(e,t[n])},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeRepeatedFloat=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeFloat(e,t[n])},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeRepeatedDouble=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeDouble(e,t[n])},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeRepeatedBool=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeBool(e,t[n])},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeRepeatedEnum=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeEnum(e,t[n])},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeRepeatedString=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeString(e,t[n])},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeRepeatedBytes=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeBytes(e,t[n])},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeRepeatedMessage=function(e,t,n){if(null!=t)for(var r=0;r<t.length;r++){var o=this.beginDelimited_(e);n(t[r],this),this.endDelimited_(o)}},module$exports$jspb$binary$writer.BinaryWriter.prototype.writeRepeatedGroup=function(e,t,n){if(null!=t)for(var r=0;r<t.length;r++)this.writeFieldHeader_(e,module$exports$jspb$BinaryConstants.WireType.START_GROUP),n(t[r],this),this.writeFieldHeader_(e,module$exports$jspb$BinaryConstants.WireType.END_GROUP)},module$exports$jspb$binary$writer.BinaryWriter.prototype.writePackedInt32=function(e,t){if(null!=t&&t.length){for(var n=this.beginDelimited_(e),r=0;r<t.length;r++)module$contents$jspb$binary$writer_assertSignedInteger(e,t[r]),this.encoder_.writeSignedVarint32(t[r]);this.endDelimited_(n)}},module$exports$jspb$binary$writer.BinaryWriter.prototype.writePackedInt32String=function(e,t){if(null!=t&&t.length){for(var n=this.beginDelimited_(e),r=0;r<t.length;r++){var o=parseInt(t[r],10);module$contents$jspb$binary$writer_assertSignedInteger(e,o),this.encoder_.writeSignedVarint32(o)}this.endDelimited_(n)}},module$exports$jspb$binary$writer.BinaryWriter.prototype.writePackedInt64=function(e,t){if(null!=t&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeSignedVarint64(t[n]);this.endDelimited_(e)}},module$exports$jspb$binary$writer.BinaryWriter.prototype.writePackedSplitFixed64=function(e,t,n,r){if(null!=t){e=this.beginDelimited_(e);for(var o=0;o<t.length;
2o++)this.encoder_.writeSplitFixed64(n(t[o]),r(t[o]));this.endDelimited_(e)}},module$exports$jspb$binary$writer.BinaryWriter.prototype.writePackedSplitVarint64=function(e,t,n,r){if(null!=t){e=this.beginDelimited_(e);for(var o=0;o<t.length;o++)this.encoder_.writeSplitVarint64(n(t[o]),r(t[o]));this.endDelimited_(e)}},module$exports$jspb$binary$writer.BinaryWriter.prototype.writePackedSplitZigzagVarint64=function(e,t,n,r){if(null!=t){e=this.beginDelimited_(e);for(var o=this.encoder_,i=0;i<t.length;i++)o.writeSplitZigzagVarint64(n(t[i]),r(t[i]));this.endDelimited_(e)}},module$exports$jspb$binary$writer.BinaryWriter.prototype.writePackedInt64String=function(e,t){if(null!=t&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++){var r=module$exports$jspb$arith.Int64.fromString(t[n]);this.encoder_.writeSplitVarint64(r.lo,r.hi)}this.endDelimited_(e)}},module$exports$jspb$binary$writer.BinaryWriter.prototype.writePackedUint32=function(e,t){if(null!=t&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeUnsignedVarint32(t[n]);this.endDelimited_(e)}},module$exports$jspb$binary$writer.BinaryWriter.prototype.writePackedUint64=function(e,t){if(null!=t&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeUnsignedVarint64(t[n]);this.endDelimited_(e)}},module$exports$jspb$binary$writer.BinaryWriter.prototype.writePackedUint64String=function(e,t){if(null!=t&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++){var r=module$exports$jspb$arith.UInt64.fromString(t[n]);this.encoder_.writeSplitVarint64(r.lo,r.hi)}this.endDelimited_(e)}},module$exports$jspb$binary$writer.BinaryWriter.prototype.writePackedSint32=function(e,t){if(null!=t&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeZigzagVarint32(t[n]);this.endDelimited_(e)}},module$exports$jspb$binary$writer.BinaryWriter.prototype.writePackedSint64=function(e,t){if(null!=t&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeZigzagVarint64(t[n]);this.endDelimited_(e)}},module$exports$jspb$binary$writer.BinaryWriter.prototype.writePackedSint64String=function(e,t){if(null!=t&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeZigzagVarint64String(t[n]);this.endDelimited_(e)}},module$exports$jspb$binary$writer.BinaryWriter.prototype.writePackedFixed32=function(e,t){if(null!=t&&t.length)for(this.writeFieldHeader_(e,module$exports$jspb$BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(4*t.length),e=0;e<t.length;e++)this.encoder_.writeUint32(t[e])},module$exports$jspb$binary$writer.BinaryWriter.prototype.writePackedFixed64=function(e,t){if(null!=t&&t.length)for(this.writeFieldHeader_(e,module$exports$jspb$BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),e=0;e<t.length;e++)this.encoder_.writeUint64(t[e])},module$exports$jspb$binary$writer.BinaryWriter.prototype.writePackedFixed64String=function(e,t){if(null!=t&&t.length)for(this.writeFieldHeader_(e,module$exports$jspb$BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),e=0;e<t.length;e++){var n=module$exports$jspb$arith.UInt64.fromString(t[e]);this.encoder_.writeSplitFixed64(n.lo,n.hi)}},module$exports$jspb$binary$writer.BinaryWriter.prototype.writePackedSfixed32=function(e,t){if(null!=t&&t.length)for(this.writeFieldHeader_(e,module$exports$jspb$BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(4*t.length),e=0;e<t.length;e++)this.encoder_.writeInt32(t[e])},module$exports$jspb$binary$writer.BinaryWriter.prototype.writePackedSfixed64=function(e,t){if(null!=t&&t.length)for(this.writeFieldHeader_(e,module$exports$jspb$BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),e=0;e<t.length;e++)this.encoder_.writeInt64(t[e])},module$exports$jspb$binary$writer.BinaryWriter.prototype.writePackedSfixed64String=function(e,t){if(null!=t&&t.length)for(this.writeFieldHeader_(e,module$exports$jspb$BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),e=0;e<t.length;e++){var n=module$exports$jspb$arith.Int64.fromString(t[e]);
2this.encoder_.writeSplitFixed64(n.lo,n.hi)}},module$exports$jspb$binary$writer.BinaryWriter.prototype.writePackedFloat=function(e,t){if(null!=t&&t.length)for(this.writeFieldHeader_(e,module$exports$jspb$BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(4*t.length),e=0;e<t.length;e++)this.encoder_.writeFloat(t[e])},module$exports$jspb$binary$writer.BinaryWriter.prototype.writePackedDouble=function(e,t){if(null!=t&&t.length)for(this.writeFieldHeader_(e,module$exports$jspb$BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),e=0;e<t.length;e++)this.encoder_.writeDouble(t[e])},module$exports$jspb$binary$writer.BinaryWriter.prototype.writePackedBool=function(e,t){if(null!=t&&t.length)for(this.writeFieldHeader_(e,module$exports$jspb$BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(t.length),e=0;e<t.length;e++)this.encoder_.writeBool(t[e])},module$exports$jspb$binary$writer.BinaryWriter.prototype.writePackedEnum=function(e,t){if(null!=t&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeEnum(t[n]);this.endDelimited_(e)}};var module$exports$jspb$internal_options={},module$contents$jspb$internal_options_freezerLoaded=!1,module$contents$jspb$internal_options_skipMessageIdValidation=!0,module$contents$jspb$internal_options_skipMessageArgumentTypeValidation=!1;module$exports$jspb$internal_options.SERIALIZE_EMPTY_TRAILING_FIELDS=!0,module$exports$jspb$internal_options.isFreezerLoaded=function(){return module$contents$jspb$internal_options_freezerLoaded},module$exports$jspb$internal_options.markFreezerLoaded=function(){module$contents$jspb$internal_options_freezerLoaded=!0},module$exports$jspb$internal_options.skipMessageIdValidation=function(){return module$contents$jspb$internal_options_skipMessageIdValidation},module$exports$jspb$internal_options.skipMessageArgumentTypeValidation=function(){return module$contents$jspb$internal_options_skipMessageArgumentTypeValidation},module$exports$jspb$internal_options.setMessageArgumentTypeValidation=function(e){module$contents$jspb$internal_options_skipMessageArgumentTypeValidation=!e},module$exports$jspb$internal_options.setValidateMessageIds=function(e){module$contents$jspb$internal_options_skipMessageIdValidation=!e};var module$contents$jspb$internal_array_state_ARRAY_STATE_SYMBOL=2018<=goog.FEATURESET_YEAR||"function"==typeof Symbol&&"symbol"==typeof Symbol()?Symbol(goog.DEBUG?"INTERNAL_ARRAY_STATE":void 0):void 0,module$contents$jspb$internal_array_state_ARRAY_STATE_BIT_MASKS={IS_REPEATED_FIELD:1,IS_IMMUTABLE_ARRAY:2};function module$contents$jspb$internal_array_state_addMask(e,t){Object.isFrozen(e)||(module$contents$jspb$internal_array_state_ARRAY_STATE_SYMBOL?e[module$contents$jspb$internal_array_state_ARRAY_STATE_SYMBOL]|=t:void 0!==e.internalArrayState?e.internalArrayState|=t:Object.defineProperties(e,{internalArrayState:{value:t,configurable:!0,writable:!0,enumerable:!1}}))}function module$contents$jspb$internal_array_state_getState(e){return goog.asserts.assertArray(e,"state is only maintained on arrays."),null==(e=module$contents$jspb$internal_array_state_ARRAY_STATE_SYMBOL?e[module$contents$jspb$internal_array_state_ARRAY_STATE_SYMBOL]:e.internalArrayState)?0:e}function module$contents$jspb$internal_array_state_isRepeatedField(e){return!!Array.isArray(e)&&!!(module$contents$jspb$internal_array_state_getState(e)&module$contents$jspb$internal_array_state_ARRAY_STATE_BIT_MASKS.IS_REPEATED_FIELD)}function module$contents$jspb$internal_array_state_markRepeatedField(e){return goog.asserts.assertArray(e,"state is only maintained on arrays."),module$contents$jspb$internal_array_state_addMask(e,module$contents$jspb$internal_array_state_ARRAY_STATE_BIT_MASKS.IS_REPEATED_FIELD),e}function module$contents$jspb$internal_array_state_isImmutableArray(e){return!!(module$contents$jspb$internal_options_freezerLoaded&&Array.isArray(e)&&module$contents$jspb$internal_array_state_getState(e)&module$contents$jspb$internal_array_state_ARRAY_STATE_BIT_MASKS.IS_IMMUTABLE_ARRAY)}function module$contents$jspb$internal_array_state_markArrayImmutable(e){if(!Array.isArray(e))throw Error("cannot mark non-array as immutable");return module$contents$jspb$internal_array_state_addMask(e,module$contents$jspb$internal_array_state_ARRAY_STATE_BIT_MASKS.IS_IMMUTABLE_ARRAY),e}var module$exports$jspb$internal={InternalMessage:function(){}},module$contents$jspb$internal_inSerialize;function module$contents$jspb$internal_isImmutableMessage(e){return!!module$contents$jspb$internal_options_freezerLoaded&&module$contents$jspb$internal_array_state_isImmutableArray(e.internalArray_)}function module$contents$jspb$internal_internalMarkMessageImmutable(e){(0,goog.asserts.assert)(module$contents$jspb$internal_options_freezerLoaded),module$contents$jspb$internal_array_state_markArrayImmutable(e.internalArray_)}function module$contents$jspb$internal_isExtensionObject(e){return null!==e&&"object"==typeof e&&e.constructor===Object}function module$contents$jspb$internal_hasOwnPropertyIfNotTrusted(e,t){return goog.TRUSTED_SITE||Object.prototype.hasOwnProperty.call(e,t)}function module$contents$jspb$internal_newRepeatedField(){return module$contents$jspb$internal_array_state_markRepeatedField([])}function module$contents$jspb$internal_bytesAsB64(e){return module$contents$jspb$internal_bytes_dataAsB64(module$contents$jspb$internal_maybeUnwrapByteString(e))}function module$contents$jspb$internal_bytesAsU8(e){return module$contents$jspb$internal_bytes_dataAsU8(module$contents$jspb$internal_maybeUnwrapByteString(e))}function module$contents$jspb$internal_bytesAsByteString(e){return null==e?module$exports$jspb$bytestring.ByteString.empty():e.constructor===module$exports$jspb$bytestring.ByteString?e:"string"==typeof e?module$exports$jspb$bytestring.ByteString.fromBase64(e):module$contents$jspb$internal_bytes_isU8(e)?module$exports$jspb$bytestring.ByteString.fromUint8Array(e):((0,goog.asserts.fail)("Cannot coerce to ByteString: "+goog.typeOf(e)),module$exports$jspb$bytestring.ByteString.empty())}function module$contents$jspb$internal_maybeUnwrapByteString(e){return e instanceof module$exports$jspb$bytestring.ByteString?e.value_||"":e}function module$contents$jspb$internal_isEmptyRepeatedField(e){return Array.isArray(e)&&module$contents$jspb$internal_array_state_isRepeatedField(e)&&!e.length}module$exports$jspb$internal.EXEMPTED_SUBCLASS_MARKER=goog.asserts.ENABLE_ASSERTS?Symbol(goog.DEBUG?"exempted jspb subclass":void 0):void 0,module$exports$jspb$internal.GENERATED_SUBCLASS_MARKER=goog.asserts.ENABLE_ASSERTS?Symbol(goog.DEBUG?"generated by jspb":void 0):void 0,module$exports$jspb$internal.bytesAsB64=module$contents$jspb$internal_bytesAsB64,module$exports$jspb$internal.bytesAsByteString=module$contents$jspb$internal_bytesAsByteString,module$exports$jspb$internal.bytesAsU8=module$contents$jspb$internal_bytesAsU8,module$exports$jspb$internal.fieldNumberFromIndex=function(e,t){return t-e.arrayIndexOffset},module$exports$jspb$internal.getInSerialize=function(){return module$contents$jspb$internal_inSerialize},module$exports$jspb$internal.hasOwnPropertyIfNotTrusted=module$contents$jspb$internal_hasOwnPropertyIfNotTrusted,module$exports$jspb$internal.indexFromFieldNumber=function(e,t){return t+e.arrayIndexOffset},module$exports$jspb$internal.internalMarkMessageImmutable=module$contents$jspb$internal_internalMarkMessageImmutable,module$exports$jspb$internal.isEmptyRepeatedField=module$contents$jspb$internal_isEmptyRepeatedField,module$exports$jspb$internal.isExtensionObject=module$contents$jspb$internal_isExtensionObject,module$exports$jspb$internal.isImmutableMessage=module$contents$jspb$internal_isImmutableMessage,module$exports$jspb$internal.newRepeatedField=module$contents$jspb$internal_newRepeatedField,module$exports$jspb$internal.setInSerialize=function(e){module$contents$jspb$internal_inSerialize=e},module$exports$jspb$internal.maybeUnwrapByteString=module$contents$jspb$internal_maybeUnwrapByteString,jspb.extension_field_info={};var module$contents$jspb$extension_field_info_ExtensionFieldInfo=function(e,t,n,r,o){this.fieldIndex=e,this.fieldName=t,this.ctor=n,this.toObjectFn=r,this.isRepeated=o};module$contents$jspb$extension_field_info_ExtensionFieldInfo.prototype.isMessageType=function(){return!!this.ctor},jspb.extension_field_info.ExtensionFieldInfo=module$contents$jspb$extension_field_info_ExtensionFieldInfo;var module$exports$jspb$map={Map:function(e,t){this.arr_=e,this.valueCtor=t,this.map={},this.arrClean=!0,this.isImmutable_=!1,0<this.arr_.length&&this.loadFromArray_()}};module$exports$jspb$map.Map.prototype.internalMarkImmutable=function(){goog.asserts.assert(module$contents$jspb$internal_options_freezerLoaded),this.isImmutable_=!0},module$exports$jspb$map.Map.prototype.checkNotImmutable_=function(){if(module$contents$jspb$internal_options_freezerLoaded&&this.isImmutable_)throw Error("Cannot mutate an immutable Map")},module$exports$jspb$map.Map.prototype.loadFromArray_=function(){for(var e=0;e<this.arr_.length;e++){var t=this.arr_[e],n=t[0];this.map[n.toString()]=new module$contents$jspb$map_Entry_(n,t[1])}this.arrClean=!0},module$exports$jspb$map.Map.prototype.toArrayInternal=function(){if(!this.arrClean){this.arr_.length=0;var e=this.stringKeys_();e.sort();for(var t=0;t<e.length;t++){var n=this.map[e[t]];this.arr_.push([n.key,n.value])}this.arrClean=!0}return this.arr_},module$exports$jspb$map.Map.prototype.internalClone=function(e,t){var n,r=this.valueCtor,o=new module$exports$jspb$map.Map(module$contents$jspb$internal_newRepeatedField(),r);for(n in this.map){var i=this.map[n];r?o.set(i.key,t(this.wrapEntry_(i))):o.set(i.key,e(i.value))}return o},module$exports$jspb$map.Map.prototype.getLength=function(){return this.size},module$exports$jspb$map.Map.prototype.clear=function(){this.checkNotImmutable_(),this.map={},this.arrClean=!1},module$exports$jspb$map.Map.prototype.delete=function(e){this.checkNotImmutable_(),e=e.toString();var t=this.map.hasOwnProperty(e);return delete this.map[e],this.arrClean=!1,t},module$exports$jspb$map.Map.prototype.del=function(e){return this.delete(e)},module$exports$jspb$map.Map.prototype.getEntryList=function(){var e=[],t=this.stringKeys_();t.sort();for(var n=0;n<t.length;n++){var r=this.map[t[n]];
2e.push([r.key,r.value])}return e},module$exports$jspb$map.Map.prototype.entries=function(){var e=[],t=this.stringKeys_();t.sort();for(var n=0;n<t.length;n++){var r=this.map[t[n]];e.push([r.key,this.wrapEntry_(r)])}return new module$contents$jspb$map_ArrayIteratorIterable(e)},module$exports$jspb$map.Map.prototype.keys=function(){var e=[],t=this.stringKeys_();t.sort();for(var n=0;n<t.length;n++)e.push(this.map[t[n]].key);return new module$contents$jspb$map_ArrayIteratorIterable(e)},module$exports$jspb$map.Map.prototype.values=function(){var e=[],t=this.stringKeys_();t.sort();for(var n=0;n<t.length;n++)e.push(this.wrapEntry_(this.map[t[n]]));return new module$contents$jspb$map_ArrayIteratorIterable(e)},module$exports$jspb$map.Map.prototype.forEach=function(e,t){var n=this.stringKeys_();n.sort();for(var r=0;r<n.length;r++){var o=this.map[n[r]];e.call(t,this.wrapEntry_(o),o.key,this)}},module$exports$jspb$map.Map.prototype.set=function(e,t){this.checkNotImmutable_();var n=new module$contents$jspb$map_Entry_(e);return this.valueCtor?(n.valueWrapper=t,n.value=t.toArrayInternal()):n.value=t,this.map[e.toString()]=n,this.arrClean=!1,this},module$exports$jspb$map.Map.prototype.wrapEntry_=function(e){return this.valueCtor?(e.valueWrapper||(e.valueWrapper=new this.valueCtor(e.value),this.isImmutable_&&module$contents$jspb$internal_internalMarkMessageImmutable(e.valueWrapper)),e.valueWrapper):e.value},module$exports$jspb$map.Map.prototype.get=function(e){if(e=this.map[e.toString()])return this.wrapEntry_(e)},module$exports$jspb$map.Map.prototype.has=function(e){return e.toString()in this.map},module$exports$jspb$map.Map.prototype.stringKeys_=function(){var e,t=this.map,n=[];for(e in t)Object.prototype.hasOwnProperty.call(t,e)&&n.push(e);return n},module$exports$jspb$map.Map.prototype[Symbol.iterator]=function(){return this.entries()},$jscomp.global.Object.defineProperties(module$exports$jspb$map.Map.prototype,{size:{configurable:!0,enumerable:!0,get:function(){return this.stringKeys_().length}}});var module$contents$jspb$map_Entry_=function(e,t){this.key=e,this.value=t,this.valueWrapper=void 0},module$contents$jspb$map_ArrayIteratorIterable=function(e){this.idx_=0,this.arr_=e},module$contents$jspb$message_ctor_alternateDataPayload;function module$contents$jspb$internal_compare_compareExtensions(e,t){e=e||{},t=t||{};var n,r={};for(n in e)module$contents$jspb$internal_hasOwnPropertyIfNotTrusted(e,n)&&(r[n]=0);for(var o in t)module$contents$jspb$internal_hasOwnPropertyIfNotTrusted(t,o)&&(r[o]=0);for(var i in r)if(module$contents$jspb$internal_hasOwnPropertyIfNotTrusted(r,i)&&!module$contents$jspb$internal_compare_compareFields(e[i],t[i]))return!1;return!0}function module$contents$jspb$internal_compare_maybeUnwrapMap(e){return e instanceof module$exports$jspb$map.Map?e.toArrayInternal():e}function module$contents$jspb$internal_compare_compareFields(e,t){if(e=module$contents$jspb$internal_maybeUnwrapByteString(e),t=module$contents$jspb$internal_maybeUnwrapByteString(t),(e=module$contents$jspb$internal_compare_maybeUnwrapMap(e))==(t=module$contents$jspb$internal_compare_maybeUnwrapMap(t)))return!0;if(module$exports$jspb$internal_bytes.SUPPORTS_UINT8ARRAY){var n=module$contents$jspb$internal_bytes_isU8(e),r=module$contents$jspb$internal_bytes_isU8(t);if(n||r){if(!n){if("string"!=typeof e)return!1;e=module$contents$jspb$internal_bytes_dataAsU8(e)}if(r)r=t;else{if("string"!=typeof t)return!1;r=module$contents$jspb$internal_bytes_dataAsU8(t)}if(e.length!==r.length)return!1;for(t=0;t<e.length;t++)if(e[t]!==r[t])return!1;return!0}}if(null==e&&module$contents$jspb$internal_isEmptyRepeatedField(t)||null==t&&module$contents$jspb$internal_isEmptyRepeatedField(e))return!0;if(!goog.isObject(e)||!goog.isObject(t))return!!("number"==typeof e&&isNaN(e)||"number"==typeof t&&isNaN(t))&&String(e)==String(t);if(e.constructor!=t.constructor)return!1;if(e.constructor===Array){r=e,n=e=void 0;for(var o=Math.max(r.length,t.length),i=0;i<o;i++){var a=r[i],s=t[i];if(a&&a.constructor==Object&&((0,goog.asserts.assert)(void 0===e),(0,goog.asserts.assert)(i===r.length-1),e=a,a=void 0),s&&s.constructor==Object&&((0,goog.asserts.assert)(void 0===n),(0,goog.asserts.assert)(i===t.length-1),n=s,s=void 0),!module$contents$jspb$internal_compare_compareFields(a,s))return!1}return!e&&!n||module$contents$jspb$internal_compare_compareExtensions(e=e||{},n=n||{})}if(e.constructor===Object)return module$contents$jspb$internal_compare_compareExtensions(e,t);throw Error("Invalid type in JSPB array")}function module$contents$jspb$internal_json_convertToJsonFormat(e){switch(typeof e){case"number":return isFinite(e)?e:String(e);case"object":if(module$contents$jspb$internal_bytes_isU8(e))return(0,goog.crypt.base64.encodeByteArray)(e);if(e instanceof module$exports$jspb$bytestring.ByteString)return e.asBase64();if(e instanceof module$exports$jspb$map.Map)return e=e.toArrayInternal(),module$exports$jspb$internal_options.SERIALIZE_EMPTY_TRAILING_FIELDS||0!==e.length?e:void 0}return e}function module$contents$jspb$internal_copy_cloneJspbField(e){return module$contents$jspb$internal_copy_cloneJspbFieldInternal(e,module$contents$jspb$internal_copy_convertToJspbFormat)}function module$contents$jspb$internal_copy_cloneJspbFieldInternal(e,t){if(null!=e)return Array.isArray(e)||module$contents$jspb$internal_isExtensionObject(e)?module$contents$jspb$internal_copy_cloneJspbObjectInternal(e,t):t(e)}function module$contents$jspb$internal_copy_cloneJspbObjectInternal(e,t){if(Array.isArray(e)){for(var n=Array(e.length),r=0;r<e.length;r++)n[r]=module$contents$jspb$internal_copy_cloneJspbFieldInternal(e[r],t);return module$contents$jspb$internal_array_state_isRepeatedField(e)&&module$contents$jspb$internal_array_state_markRepeatedField(n),n}for(r in n={},e)module$contents$jspb$internal_hasOwnPropertyIfNotTrusted(e,r)&&(n[r]=module$contents$jspb$internal_copy_cloneJspbFieldInternal(e[r],t));return n}function module$contents$jspb$internal_copy_convertToStructuredCloneableFormat(e){return module$contents$jspb$internal_bytes_isU8(e=module$contents$jspb$internal_maybeUnwrapByteString(e))?new Uint8Array(e):e instanceof module$exports$jspb$map.Map?module$contents$jspb$internal_copy_cloneJspbObjectInternal(e.toArrayInternal(),module$contents$jspb$internal_copy_convertToStructuredCloneableFormat):e}function module$contents$jspb$internal_copy_convertToJsonFormat(e){return e=module$contents$jspb$internal_json_convertToJsonFormat(e),Array.isArray(e)?module$contents$jspb$internal_copy_cloneJspbObjectInternal(e,module$contents$jspb$internal_copy_convertToJsonFormat):e}function module$contents$jspb$internal_copy_messageCloner(e){return e.clone()}function module$contents$jspb$internal_copy_convertToJspbFormat(e){return module$contents$jspb$internal_bytes_isU8(e)?new Uint8Array(e):e instanceof module$exports$jspb$map.Map?e.internalClone(module$contents$jspb$internal_copy_cloneJspbField,module$contents$jspb$internal_copy_messageCloner):e}function module$contents$jspb$message_ctor_newMessage(e,t){return module$contents$jspb$message_ctor_alternateDataPayload=t,e=new e(t),module$contents$jspb$message_ctor_alternateDataPayload=null,e}module$contents$jspb$map_ArrayIteratorIterable.prototype.next=function(){return this.idx_<this.arr_.length?{done:!1,value:this.arr_[this.idx_++]}:{done:!0,value:void 0}},module$contents$jspb$map_ArrayIteratorIterable.prototype[Symbol.iterator]=function(){return this};var module$exports$jspb={Message:function(e,t,n){if(goog.asserts.assertInstanceof(this,module$exports$jspb.Message,"The message constructor should only be used by subclasses"),goog.asserts.assert(this.constructor!==module$exports$jspb.Message,"Message is an abstract class and cannot be directly constructed"),goog.asserts.ENABLE_ASSERTS&&!0!==this[module$exports$jspb$internal.EXEMPTED_SUBCLASS_MARKER]){goog.asserts.assert(!0===this[module$exports$jspb$internal.GENERATED_SUBCLASS_MARKER],"Message can only be subclassed by proto gencode.");var r=Object.getPrototypeOf(goog.asserts.assert(Object.getPrototypeOf(this)));goog.asserts.assert(r.hasOwnProperty(module$exports$jspb$internal.GENERATED_SUBCLASS_MARKER),"Generated jspb classes should not be extended")}if(r=module$contents$jspb$message_ctor_alternateDataPayload,module$contents$jspb$message_ctor_alternateDataPayload=null,e||(e=r),r=this.getJsPbMessageId(),e){if(!module$contents$jspb$internal_options_skipMessageIdValidation&&r&&"_"!==r&&r!==e[0])throw Error('Expected message to have a message id: "'+r+'" in the array, got: '+JSON.stringify(e)+", are you parsing with the wrong proto?")}else e=r?[r]:[];if(this.arrayIndexOffset=(r?0:-1)-(this.constructor.internalGroupNumberDoNotUse||0),this.convertedPrimitiveFields_=this.internalWrappers_=null,this.internalArray_=e,module$contents$jspb_initPivotAndExtensionObject(this,t),n)for(e=0;e<n.length;e++)(t=n[e])<this.pivot_?(t+=this.arrayIndexOffset,(r=this.internalArray_[t])?Array.isArray(r)&&module$contents$jspb$internal_array_state_markRepeatedField(r):this.internalArray_[t]=module$contents$jspb_EMPTY_LIST_SENTINEL):(module$contents$jspb_maybeInitEmptyExtensionObject(this),(r=this.internalExtensionObject_[t])?Array.isArray(r)&&module$contents$jspb$internal_array_state_markRepeatedField(r):this.internalExtensionObject_[t]=module$contents$jspb_EMPTY_LIST_SENTINEL)}};module$exports$jspb.Message.prototype.getJsPbMessageId=function(){return this.constructor.messageId};var module$contents$jspb_EMPTY_LIST_SENTINEL=Object.freeze(module$contents$jspb$internal_newRepeatedField()),module$contents$jspb_initPivotAndExtensionObject=function(e,t){var n=e.internalArray_.length,r=n-1;if(n&&module$contents$jspb$internal_isExtensionObject(n=e.internalArray_[r]))return e.pivot_=r-e.arrayIndexOffset,void(e.internalExtensionObject_=n);void 0!==t&&-1<t?(e.pivot_=Math.max(t,r+1-e.arrayIndexOffset),e.internalExtensionObject_=null):e.pivot_=Number.MAX_VALUE},module$contents$jspb_maybeInitEmptyExtensionObject=function(e){var t=e.pivot_+e.arrayIndexOffset;e.internalArray_[t]||(module$contents$jspb$internal_isImmutableMessage(e)?(e.internalExtensionObject_={},Object.freeze(e.internalExtensionObject_)):e.internalExtensionObject_=e.internalArray_[t]={})};function module$contents$jspb_getMapField(e,t,n,r,o){if(null==t){if(r)return;t=module$contents$jspb$internal_newRepeatedField()}return t.constructor===module$exports$jspb$map.Map||(t=new module$exports$jspb$map.Map(t,o),module$contents$jspb$internal_isImmutableMessage(e)&&t.internalMarkImmutable(),e.internal_setField(n,t,!1,!0)),t}function module$contents$jspb_setFieldIgnoringDefault(e,t,n,r){return goog.asserts.assertInstanceof(e,module$exports$jspb.Message),module$contents$jspb_checkNotImmutable(e),n!==r?e.internal_setField(t,n):e.internal_clearField(t),e}function module$contents$jspb_serializeSpecialValues(e,t){return module$contents$jspb$internal_json_convertToJsonFormat(t)}module$exports$jspb.Message.prototype.internal_getField=function(e,t){return-1===e?null:e>=this.pivot_?this.internalExtensionObject_?this.internalExtensionObject_[e]:void 0:void 0!==t&&t&&this.internalExtensionObject_&&this.internalExtensionObject_[e]?this.internalExtensionObject_[e]:this.internalArray_[e+this.arrayIndexOffset]},module$exports$jspb.Message.prototype.internal_hasField=function(e){return null!=this.internal_getField(e)},module$exports$jspb.Message.prototype.internal_hasOneofField=function(e,t){return this.internal_computeOneofCase(t)===e},module$exports$jspb.Message.prototype.internal_getRepeatedField=function(e,t,n){t=void 0===t||t,n=void 0!==n&&n;var r=this.internal_getField(e,n);return null==r&&(r=module$contents$jspb_EMPTY_LIST_SENTINEL),module$contents$jspb$internal_isImmutableMessage(this)?t&&(module$contents$jspb$internal_array_state_markArrayImmutable(r),Object.freeze(r)):(r===module$contents$jspb_EMPTY_LIST_SENTINEL||module$contents$jspb$internal_array_state_isImmutableArray(r))&&(r=module$contents$jspb$internal_array_state_markRepeatedField(r.slice()),this.internal_setField(e,r,n)),r},module$exports$jspb.Message.prototype.internal_getFloatingPointField=function(e){return null==(e=this.internal_getField(e))?e:+e},module$exports$jspb.Message.prototype.internal_getBooleanField=function(e){return null==(e=this.internal_getField(e))?e:!!e},module$exports$jspb.Message.prototype.internal_getRepeatedFloatingPointField=function(e){var t=this.internal_getRepeatedField(e,!1);if(this.convertedPrimitiveFields_||(this.convertedPrimitiveFields_={}),!this.convertedPrimitiveFields_[e]){for(var n=0;n<t.length;n++)t[n]=+t[n];this.convertedPrimitiveFields_[e]=!0}return module$contents$jspb$internal_isImmutableMessage(this)&&Object.freeze(t),t},module$exports$jspb.Message.prototype.internal_getRepeatedBooleanField=function(e){var t=this.internal_getRepeatedField(e,!1);if(this.convertedPrimitiveFields_||(this.convertedPrimitiveFields_={}),!this.convertedPrimitiveFields_[e]){for(var n=0;n<t.length;n++)t[n]=!!t[n];this.convertedPrimitiveFields_[e]=!0}return module$contents$jspb$internal_isImmutableMessage(this)&&Object.freeze(t),t},module$exports$jspb.Message.prototype.internal_getFieldWithDefault=function(e,t){return null==(e=this.internal_getField(e))?t:e},module$exports$jspb.Message.prototype.internal_getBooleanFieldWithDefault=function(e,t){return null==(e=this.internal_getBooleanField(e))?void 0!==t&&t:e},module$exports$jspb.Message.prototype.internal_getFloatingPointFieldWithDefault=function(e,t){return null==(e=this.internal_getFloatingPointField(e))?void 0===t?0:t:e},module$exports$jspb.Message.prototype.internal_getMapField=function(e,t,n){return module$contents$jspb_getMapField(this,this.internal_getField(e),e,t,n)},module$exports$jspb.Message.prototype.internal_getBytesMapField=function(e,t){var n=this.internal_getField(e);if(Array.isArray(n)&&n)for(var r=0;r<n.length;r++)n[r][1]=module$contents$jspb$internal_bytesAsByteString(n[r][1]);return module$contents$jspb_getMapField(this,n,e,t)},module$exports$jspb.Message.prototype.internal_clearMapField=function(e){var t=this.internal_getField(e);return t instanceof module$exports$jspb$map.Map?t.clear():this.internal_clearField(e),this},module$exports$jspb.Message.prototype.internal_setField=function(e,t,n,r){return n=void 0!==n&&n,void 0!==r&&r||module$contents$jspb_checkNotImmutable(this),n||e>=this.pivot_?(module$contents$jspb_maybeInitEmptyExtensionObject(this),this.internalExtensionObject_[e]=t):this.internalArray_[e+this.arrayIndexOffset]=t,this},module$exports$jspb.Message.prototype.internal_setRepeatedField=function(e,t,n){return n=void 0!==n&&n,this.internal_setField(e,null==t?module$contents$jspb$internal_array_state_markRepeatedField([]):Array.isArray(t)?module$contents$jspb$internal_array_state_markRepeatedField(t):t,n)},module$exports$jspb.Message.prototype.internal_clearField=function(e,t){return this.internal_setField(e,void 0,!1,void 0!==t&&t)},module$exports$jspb.Message.prototype.internal_clearRepeatedField=function(e){return this.internal_setField(e,module$contents$jspb_EMPTY_LIST_SENTINEL)},module$exports$jspb.Message.prototype.internal_clearWrapperField=function(e){return this.internal_setWrapperField(e,void 0)},module$exports$jspb.Message.prototype.internal_clearRepeatedWrapperField=function(e){return this.internal_setRepeatedWrapperField(e,void 0)},module$exports$jspb.Message.prototype.internal_addToRepeatedField=function(e,t,n){return module$contents$jspb_checkNotImmutable(this),e=this.internal_getRepeatedField(e),null!=n?e.splice(n,0,t):e.push(t),this},module$exports$jspb.Message.prototype.internal_setOneofField=function(e,t,n){return module$contents$jspb_checkNotImmutable(this),(t=this.internal_computeOneofCase(t))&&t!==e&&null!=n&&(this.internalWrappers_&&t in this.internalWrappers_&&(this.internalWrappers_[t]=void 0),this.internal_setField(t,void 0)),this.internal_setField(e,n)},module$exports$jspb.Message.prototype.internal_computeOneofCase=function(e){for(var t=0,n=0;n<e.length;n++){var r=e[n];null!=this.internal_getField(r)&&(0!==t&&this.internal_clearField(t,!0),t=r)}return t},module$exports$jspb.Message.prototype.internal_getWrapperField=function(e,t,n,r){if(-1===t)return null;this.internalWrappers_||(this.internalWrappers_={});var o=this.internalWrappers_[t];return o||(null!=(r=this.internal_getField(t,void 0!==r&&r))||n?(e=new e(r),module$contents$jspb$internal_isImmutableMessage(this)&&module$contents$jspb$i
2nternal_internalMarkMessageImmutable(e),this.internalWrappers_[t]=e):o)},module$exports$jspb.Message.prototype.internal_getRepeatedWrapperField=function(e,t,n){n=void 0!==n&&n,this.internalWrappers_||(this.internalWrappers_={});var r=module$contents$jspb$internal_isImmutableMessage(this),o=this.internalWrappers_[t];if(!o){n=this.internal_getRepeatedField(t,!0,n),o=[],r=r||module$contents$jspb$internal_array_state_isImmutableArray(n);for(var i=0;i<n.length;i++)o[i]=new e(n[i]),r&&module$contents$jspb$internal_internalMarkMessageImmutable(o[i]);r&&(module$contents$jspb$internal_array_state_markArrayImmutable(o),Object.freeze(o)),this.internalWrappers_[t]=o}return o},module$exports$jspb.Message.prototype.internal_setWrapperField=function(e,t,n){n=void 0!==n&&n,module$contents$jspb_checkNotImmutable(this),this.internalWrappers_||(this.internalWrappers_={});var r=t?t.toArrayInternal():t;return this.internalWrappers_[e]=t,this.internal_setField(e,r,n)},module$exports$jspb.Message.prototype.internal_setOneofWrapperField=function(e,t,n){module$contents$jspb_checkNotImmutable(this),this.internalWrappers_||(this.internalWrappers_={});var r=n?n.toArrayInternal():n;return this.internalWrappers_[e]=n,this.internal_setOneofField(e,t,r)},module$exports$jspb.Message.prototype.internal_setRepeatedWrapperField=function(e,t,n){if(n=void 0!==n&&n,module$contents$jspb_checkNotImmutable(this),t){for(var r=module$contents$jspb$internal_newRepeatedField(),o=0;o<t.length;o++)r[o]=t[o].toArrayInternal();this.internalWrappers_||(this.internalWrappers_={}),this.internalWrappers_[e]=t}else this.internalWrappers_&&(this.internalWrappers_[e]=void 0),r=module$contents$jspb_EMPTY_LIST_SENTINEL;return this.internal_setField(e,r,n)},module$exports$jspb.Message.prototype.internal_addAndReturnRepeatedWrapperField=function(e,t,n,r){module$contents$jspb_checkNotImmutable(this);var o=this.internal_getRepeatedWrapperField(n,e);return t=t||new n,e=this.internal_getRepeatedField(e),null!=r?(o.splice(r,0,t),e.splice(r,0,t.toArrayInternal())):(o.push(t),e.push(t.toArrayInternal())),t},module$exports$jspb.Message.prototype.internal_addToRepeatedWrapperField=function(e,t,n,r){return this.internal_addAndReturnRepeatedWrapperField(e,t,n,r),this},module$exports$jspb.Message.prototype.toArray=function(){return this.toJSON()},module$exports$jspb.Message.prototype.toJsonValue=function(){return this.toJSON()},module$exports$jspb.Message.prototype.toJSON=function(){var e=module$contents$jspb_prepareForSerialize(this.toArrayInternal());return module$contents$jspb$internal_inSerialize?e:module$contents$jspb$internal_copy_cloneJspbObjectInternal(e,module$contents$jspb$internal_copy_convertToJsonFormat)},module$exports$jspb.Message.prototype.toStructuredCloneableValue=function(){return module$contents$jspb$internal_copy_cloneJspbObjectInternal(this.toArrayInternal(),module$contents$jspb$internal_copy_convertToStructuredCloneableFormat)},module$exports$jspb.Message.prototype.toArrayInternal=function(){return this.internalArray_},module$exports$jspb.Message.prototype.serialize=function(){module$contents$jspb$internal_inSerialize=!0;try{return JSON.stringify(this.toJSON(),module$contents$jspb_serializeSpecialValues)}finally{module$contents$jspb$internal_inSerialize=!1}};var module$contents$jspb_prepareForSerialize=function(e){if(module$exports$jspb$internal_options.SERIALIZE_EMPTY_TRAILING_FIELDS)return e;for(var t,n,r=e.length,o=!1,i=e.length;i--;){var a=e[i];if(Array.isArray(a)){var s=a;(a=module$contents$jspb$internal_isEmptyRepeatedField(a)?null:module$contents$jspb_prepareForSerialize(a))!=s&&(o=!0)}else if(i===e.length-1&&module$contents$jspb$internal_isExtensionObject(a)){e:{s=n=void 0;var l=a;goog.asserts.assert(!module$exports$jspb$internal_options.SERIALIZE_EMPTY_TRAILING_FIELDS);var u={},p=!1;for(s in l)if(module$contents$jspb$internal_hasOwnPropertyIfNotTrusted(l,s)){var c=l[s];if(Array.isArray(c)){var d=c;(c=module$contents$jspb$internal_isEmptyRepeatedField(c)?null:module$contents$jspb_prepareForSerialize(c))!=d&&(p=!0)}null!=c?u[s]=c:p=!0}if(p){for(n in u){n=u;break e}n=null}else n=l}n!=a&&(o=!0),r--;continue}null==a&&r==i+1?(o=!0,r--):o&&(t||(t=e.slice(0,r)),t[i]=a)}return o?(t||(t=e.slice(0,r)),n&&t.push(n),t):e};function module$contents$jspb_clearMessage(e){goog.asserts.assertInstanceof(e,module$exports$jspb.Message),module$contents$jspb_checkNotImmutable(e);for(var t=e.internalArray_,n=e.internalExtensionObject_,r=t.length+(null!=n?-1:0),o=null!=e.getJsPbMessageId()?1:0;o<r;o++)t[o]=module$contents$jspb$internal_array_state_isRepeatedField(t[o])?module$contents$jspb_EMPTY_LIST_SENTINEL:void 0;if(n)for(var i in n)module$contents$jspb$internal_hasOwnPropertyIfNotTrusted(n,i)&&(n[i]=module$contents$jspb$internal_array_state_isRepeatedField(n[i])?module$contents$jspb_EMPTY_LIST_SENTINEL:void 0);return e.internalWrappers_=null,e.convertedPrimitiveFields_=null,delete e.internalUnknownFields_,e}function module$contents$jspb_copyUnknownFields(e,t){goog.asserts.assert(e,"expected `to` to be non-null"),goog.asserts.assert(t,"expected `from` to be non-null"),t.internalUnknownFields_&&(e.internalUnknownFields_=t.internalUnknownFields_.slice());var n=t.internalWrappers_;if(n)for(var r in t=t.internalExtensionObject_,n)if(module$contents$jspb$internal_hasOwnPropertyIfNotTrusted(n,r)){var o=n[r];if(o){var i=!(!t||!t[r]),a=+r;if(Array.isArray(o)){if(o.length)for(i=e.internal_getRepeatedWrapperField(o[0].constructor,a,i),a=0;a<Math.min(i.length,o.length);a++)module$contents$jspb_copyUnknownFields(i[a],goog.asserts.assertInstanceof(
2o[a],module$exports$jspb.Message))}else goog.asserts.assertInstanceof(o,module$exports$jspb.Message),(i=e.internal_getWrapperField(o.constructor,a,void 0,i))&&module$contents$jspb_copyUnknownFields(i,o)}}}module$exports$jspb.Message.deserializeWithCtor=function(e,t){return e=module$contents$jspb$message_ctor_newMessage(e,t?JSON.parse(t):null),goog.asserts.assertInstanceof(e,module$exports$jspb.Message),e},module$exports$jspb.Message.prototype.toString=function(){return this.toArrayInternal().toString()},module$exports$jspb.Message.prototype.getExtension=function(e){var t=e.fieldIndex,n=e.ctor;return e.isRepeated?n?this.internal_getRepeatedWrapperField(n,t,!0):this.internal_getRepeatedField(t,!0,!0):n?this.internal_getWrapperField(n,t,void 0,!0):this.internal_getField(t,!0)},module$exports$jspb.Message.prototype.setExtension=function(e,t){module$contents$jspb_checkNotImmutable(this);var n=e.fieldIndex,r=e.ctor;return e.isRepeated?r?this.internal_setRepeatedWrapperField(n,t,!0):this.internal_setRepeatedField(n,t,!0):r?this.internal_setWrapperField(n,t,!0):this.internal_setField(n,t,!0)},module$exports$jspb.Message.difference=function(e,t){if(!(e instanceof t.constructor))throw Error("Messages have different types.");var n=e.toArrayInternal();t=t.toArrayInternal();var r=[],o=0,i=n.length>t.length?n.length:t.length;for(e.getJsPbMessageId()&&(r[0]=e.getJsPbMessageId(),o=1);o<i;o++)module$contents$jspb$internal_compare_compareFields(n[o],t[o])||(r[o]=t[o]);return module$contents$jspb$message_ctor_newMessage(e.constructor,r)},module$exports$jspb.Message.equals=function(e,t){return e==t||!(!e||!t)&&e instanceof t.constructor&&module$contents$jspb$internal_compare_compareFields(e.toArrayInternal(),t.toArrayInternal())},module$exports$jspb.Message.prototype.clone=function(){var e=goog.asserts.assertInstanceof(this,module$exports$jspb.Message),t=e.constructor;return module$contents$jspb_copyUnknownFields(t=module$contents$jspb$message_ctor_newMessage(t,module$contents$jspb$internal_copy_cloneJspbObjectInternal(e.toArrayInternal(),module$contents$jspb$internal_copy_convertToJspbFormat)),e),t};var module$contents$jspb_checkNotImmutable=function(e){if(module$contents$jspb$internal_options_freezerLoaded&&module$contents$jspb$internal_isImmutableMessage(e))throw Error("Cannot mutate an immutable Message")};function module$contents$jspb_isOneofCase(e,t,n){return e.internal_computeOneofCase(t)===n?n:-1}function module$contents$jspb$internal$binary_newBinaryExtension(e,t,n,r,o,i,a){return{fieldInfo:e,binaryReaderFn:t,binaryWriterFn:n,binaryMessageSerializeFn:r,binaryFieldsInitializer:o,messageSetReaderFn:i,messageSetExtensions:a}}module$exports$jspb.Message.prototype.internal_getIntegerFieldWithDefault=function(e,t){return this.internal_getFieldWithDefault(e,void 0===t?0:t)},module$exports$jspb.Message.prototype.internal_getIntegerInStringFieldWithDefault=function(e,t){return this.internal_getFieldWithDefault(e,void 0===t?"0":t)},module$exports$jspb.Message.prototype.internal_getStringFieldWithDefault=function(e,t){return this.internal_getFieldWithDefault(e,void 0===t?"":t)},module$exports$jspb.Message.prototype.internal_getOneofFieldWithDefault=function(e,t,n){return this.internal_getFieldWithDefault(module$contents$jspb_isOneofCase(this,t,e),n)},module$exports$jspb.Message.prototype.internal_getOneofBooleanFieldWithDefault=function(e,t,n){return this.internal_getBooleanFieldWithDefault(module$contents$jspb_isOneofCase(this,t,e),n)},module$exports$jspb.Message.prototype.internal_getOneofIntegerFieldWithDefault=function(e,t,n){return this.internal_getIntegerFieldWithDefault(module$contents$jspb_isOneofCase(this,t,e),n)},module$exports$jspb.Message.prototype.internal_getOneofIntegerInStringFieldWithDefault=function(e,t,n){return this.internal_getIntegerInStringFieldWithDefault(module$contents$jspb_isOneofCase(this,t,e),n)},module$exports$jspb.Message.prototype.internal_getOneofFloatingPointFieldWithDefault=function(e,t,n){return this.internal_getFloatingPointFieldWithDefault(module$contents$jspb_isOneofCase(this,t,e),n)},module$exports$jspb.Message.prototype.internal_getOneofStringFieldWithDefault=function(e,t,n){return this.internal_getStringFieldWithDefault(module$contents$jspb_isOneofCase(this,t,e),n)},module$exports$jspb.Message.prototype.internal_getOneofField=function(e,t){return this.internal_getField(module$contents$jspb_isOneofCase(this,t,e))},module$exports$jspb.Message.prototype.internal_getOneofBooleanField=function(e,t){return this.internal_getBooleanField(module$contents$jspb_isOneofCase(this,t,e))},module$exports$jspb.Message.prototype.internal_getOneofFloatingPointField=function(e,t){return this.internal_getFloatingPointField(module$contents$jspb_isOneofCase(this,t,e))},module$exports$jspb.Message.prototype.internal_getOneofWrapperField=function(e,t,n){return this.internal_getWrapperField(e,module$contents$jspb_isOneofCase(this,n,t))},module$exports$jspb.Message.prototype.internal_setProto3BooleanField=function(e,t){return module$contents$jspb_setFieldIgnoringDefault(this,e,t,!1)},module$exports$jspb.Message.prototype.internal_setProto3IntField=function(e,t){return module$contents$jspb_setFieldIgnoringDefault(this,e,t,0)},module$exports$jspb.Message.prototype.internal_setProto3FloatField=function(e,t){return module$contents$jspb_setFieldIgnoringDefault(this,e,t,0)},module$exports$jspb.Message.prototype.internal_setProto3StringField=function(e,t){return module$contents$jspb_setFieldIgnoringDefault(this,e,t,"")},module$exports$jspb.Message.prototype.internal_setProto3EnumField=function(e,t){return module$contents$jspb_setFieldIgnoringDefault(this,e,t,0)},module$exports$jspb.Message.prototype.internal_setProto3StringIntField=function(e,t){return goog.asserts.assertInstanceof(this,module$exports$jspb.Message),module$contents$jspb_checkNotImmutable(this),null!=t&&0!==+t?this.internal_setField(e,t):this.internal_clearField(e),this},module$exports$jspb.Message.prototype.internal_setProto3BytesField=function(e,t){return goog.asserts.assertInstanceof(this,module$exports$jspb.Message),module$contents$jspb_checkNotImmutable(this),null!=t&&0!==t.length?this.internal_setField(e,t):this.internal_clearField(e),this},module$exports$jspb.clearMessage=module$contents$jspb_clearMessage,module$exports$jspb.copyMessage=function(e,t){goog.asserts.assertInstanceof(e,module$exports$jspb.Message),goog.asserts.assertInstanceof(t,module$exports$jspb.Message),goog.asserts.assert(t.constructor==e.constructor,"Copy source and target message should have the same type."),module$contents$jspb_checkNotImmutable(e);var n=t.toArrayInternal(),r=e.internalArray_;r.length=n.length;for(var o=0;o<n.length;o++)r[o]=module$contents$jspb$internal_copy_cloneJspbField(n[o]);return e.internalWrappers_=null,e.convertedPrimitiveFields_=null,e.internalExtensionObject_=null,module$contents$jspb_initPivotAndExtensionObject(e,e.pivot_),module$contents$jspb_copyUnknownFields(e,t),e},jspb.internal={},jspb.internal.binary={},jspb.internal.binary.createBinaryExtension=function(e,t,n,r,o){return module$contents$jspb$internal$binary_newBinaryExtension(e,t,n,r,o)},jspb.internal.binary.createBinaryMessageSetExtension=function(e,t,n,r,o){return module$contents$jspb$internal$binary_newBinaryExtension(e,t,n,r,void 0,module$contents$jspb$internal$binary_readBinaryExtensionMessageSet,o)},jspb.internal.binary.serializeBinaryExtensionsAndUnknownFields=function(e,t,n){if(t.writeUnknownFields(e),n)for(var r in n)if(module$contents$jspb$internal_hasOwnPropertyIfNotTrusted(n,r)){var o=n[r];goog.asserts.assert(o.binaryWriterFn),o.binaryWriterFn(t,e,o.fieldInfo,o.binaryMessageSerializeFn)}},jspb.internal.binary.writeMessageSetExt=function(e,t,n,r){e.writeMessageSet(n.fieldIndex,t.getExtension(n),r)};var module$contents$jspb$internal$binary_MESSAGE_SET_START_TAG=8+module$exports$jspb$BinaryConstants.WireType.START_GROUP,module$contents$jspb$internal$binary_MESSAGE_SET_END_TAG=8+module$exports$jspb$BinaryConstants.WireType.END_GROUP,module$contents$jspb$internal$binary_MESSAGE_SET_TYPE_ID_TAG=16+module$exports$jspb$BinaryConstants.WireType.VARINT,module$contents$jspb$internal$binary_MESSAGE_SET_MESSAGE_TAG=24+module$exports$jspb$BinaryConstants.WireType.DELIMITED,module$contents$jspb$internal$binary_readBinaryExtensionMessageSet=function(e,t,n){goog.asserts.assertInstanceof(e,module$exports$jspb.Message);var r=e.constructor;r=r[module$contents$jspb$internal$binary_binaryFieldsCache]||(r[module$contents$jspb$internal$binary_binaryFieldsCache]={});for(var o={};t.nextField()&&!t.isEndGroup();){if(t.getTag()===module$contents$jspb$internal$binary_MESSAGE_SET_START_TAG){for(var i=t.getFieldCursor(),a=0,s=null;t.nextField();)if(t.getTag()===module$contents$jspb$internal$binary_MESSAGE_SET_TYPE_ID_TAG)a=t.readUint32();else if(t.getTag()===module$contents$jspb$internal$binary_MESSAGE_SET_MESSAGE_TAG)s=t.readBytes();
2else{if(t.getWireType()===module$exports$jspb$BinaryConstants.WireType.END_GROUP)break;t.skipField()}if(t.getTag()!==module$contents$jspb$internal$binary_MESSAGE_SET_END_TAG||null===s||0===a)throw Error("Malformed binary bytes for message set");var l=r[a];if(!l){var u=n[a];u&&(o.$jscomp$loop$prop$fieldInfo$55=u.fieldInfo,o.$jscomp$loop$prop$deserializeBinaryFromReader$56=module$contents$jspb$internal$binary_makeDeserializeBinaryFromReaderFromBinaryExtension(u),l=r[a]=function(e){return function(t,n){return t.setExtension(e.$jscomp$loop$prop$fieldInfo$55,e.$jscomp$loop$prop$deserializeBinaryFromReader$56(new e.$jscomp$loop$prop$fieldInfo$55.ctor,new module$exports$jspb$binary$reader.BinaryReader(n)))}}(o))}l?l(e,s):t.addUnknownFieldsStartingFrom(e,i)}else t.handleUnknownField(e);o={$jscomp$loop$prop$fieldInfo$55:o.$jscomp$loop$prop$fieldInfo$55,$jscomp$loop$prop$deserializeBinaryFromReader$56:o.$jscomp$loop$prop$deserializeBinaryFromReader$56}}return e};function module$contents$jspb$internal$binary_writeMap(e,t,n,r,o,i){(e=e.internal_getMapField(t,!0))&&e.forEach(function(e,t){r.writeMessage(n,e,function(n,r){o.call(r,1,t),i.call(r,2,e)})})}function module$contents$jspb$internal$binary_writeMessageMap(e,t,n,r,o,i,a){(e=e.internal_getMapField(t,!0,n))&&e.forEach(function(e,t){o.writeMessage(r,e,function(n,r){i.call(r,1,t),r.writeMessage(2,e,a)})})}jspb.internal.binary.readBinaryExtensionMessageSet=module$contents$jspb$internal$binary_readBinaryExtensionMessageSet;var module$contents$jspb$internal$binary_primitiveMapEntry,module$contents$jspb$internal$binary_MapEntry=function(){module$exports$jspb.Message.call(this,null)};function module$contents$jspb$internal$binary_readMessageMapEntry(e,t,n,r,o,i,a){if(e.getWireType()!==module$exports$jspb$BinaryConstants.WireType.DELIMITED)return!1;var s=new module$contents$jspb$internal$binary_MapEntry;return e.readMessage(s,function(e,t){for(;t.nextField();){var n=t.getFieldNumber();1===n?o(t,e,1):2===n&&jspb.internal.binary.readMessage(t,e,2,r,a)}}),s.applyToMessageValuedMap(goog.asserts.assert(t.internal_getMapField(n,!1,r)),i,r),!0}function module$contents$jspb$internal$binary_readMapEntry(e,t,n,r,o,i,a){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.DELIMITED&&(void 0===module$contents$jspb$internal$binary_primitiveMapEntry?module$contents$jspb$internal$binary_primitiveMapEntry=new module$contents$jspb$internal$binary_MapEntry:module$contents$jspb_clearMessage(module$contents$jspb$internal$binary_primitiveMapEntry),e.readMessage(module$contents$jspb$internal$binary_primitiveMapEntry,function(e,t){for(;t.nextField();){var n=t.getFieldNumber();1===n?r(t,e,1):2===n&&o(t,e,2)}}),e=goog.asserts.assert(t.internal_getMapField(n,!1)),a===module$exports$jspb$bytestring.ByteString.empty()?module$contents$jspb$internal$binary_primitiveMapEntry.applyToBytesValuedMap(e,i):module$contents$jspb$internal$binary_primitiveMapEntry.applyToMap(e,i,a),!0)}$jscomp.inherits(module$contents$jspb$internal$binary_MapEntry,module$exports$jspb.Message),module$contents$jspb$internal$binary_MapEntry.prototype.applyToMap=function(e,t,n){e.set(this.internal_getFieldWithDefault(1,t),this.internal_getFieldWithDefault(2,n))},module$contents$jspb$internal$binary_MapEntry.prototype.applyToMessageValuedMap=function(e,t,n){e.set(this.internal_getFieldWithDefault(1,t),this.internal_getWrapperField(n,2)||new n)},module$contents$jspb$internal$binary_MapEntry.prototype.applyToBytesValuedMap=function(e,t){e.set(this.internal_getFieldWithDefault(1,t),module$contents$jspb$internal_bytesAsByteString(this.internal_getFieldWithDefault(2,module$exports$jspb$bytestring.ByteString.empty())))},goog.asserts.ENABLE_ASSERTS&&(module$contents$jspb$internal$binary_MapEntry.prototype[module$exports$jspb$internal.EXEMPTED_SUBCLASS_MARKER]=!0);var module$contents$jspb$internal$binary_deserializeBinaryFromReaderCache=goog.DEBUG?Symbol("deserializeBinaryFromReaderCache"):Symbol();function module$contents$jspb$internal$binary_makeDeserializeBinaryFromReaderFromMessageSetAndReader(e,t,n){return goog.asserts.assertFunction(t),goog.asserts.assertObject(n),e[module$contents$jspb$internal$binary_deserializeBinaryFromReaderCache]||(e[module$contents$jspb$internal$binary_deserializeBinaryFromReaderCache]=function(e,r){return t(e,r,n)})}function module$contents$jspb$internal$binary_makeDeserializeBinaryFromReaderFromBinaryFields(e){var t=e[module$contents$jspb$internal$binary_deserializeBinaryFromReaderCache];if(!t){var n=module$contents$jspb$internal$binary_getBinaryFields(e);t=function(e,t){return module$contents$jspb$internal$binary_deserializeBinaryFromReaderGenericImpl(e,t,n)},e[module$contents$jspb$internal$binary_deserializeBinaryFromReaderCache]=t}return t}function module$contents$jspb$internal$binary_makeDeserializeBinaryFromReaderFromBinaryExtension(e){var t=e.binaryFieldsInitializer;if(goog.DEBUG&&delete e.binaryFieldsInitializer,t)return module$contents$jspb$internal$binary_makeDeserializeBinaryFromReaderFromBinaryFields(t);if(t=e.messageSetReaderFn,goog.DEBUG&&delete e.messageSetReaderFn,t){var n=goog.asserts.assert(e.messageSetExtensions);return delete e.messageSetExtensions,module$contents$jspb$internal$binary_makeDeserializeBinaryFromReaderFromMessageSetAndReader(goog.asserts.assert(e.fieldInfo.ctor),t,n)}}function module$contents$jspb$internal$binary_makeParserFromBinaryExtension(e){var t=module$contents$jspb$internal$binary_makeDeserializeBinaryFromReaderFromBinaryExtension(e),n=e.fieldInfo,r=goog.asserts.assert(e.binaryReaderFn);return goog.DEBUG&&delete e.binaryReaderFn,t?function(e,o){return r(e,o,n,t)}:function(e,t){return r(e,t,n)}}var module$contents$jspb$internal$binary_makeParserFromArray=function(e){var t=e[0];switch(e.length){case 2:var n=e[1];return goog.asserts.assertArray(n),function(e,r,o){return t(e,r,o,n)};case 3:goog.asserts.assert(5===t.length);var r=e[1];e=e[2],goog.asserts.assertFunction(r);var o=module$contents$jspb$internal$binary_makeDeserializeBinaryFromReaderFromBinaryFields(e);return function(e,n,i){return t(e,n,i,r,o)};case 4:goog.asserts.assert(6===t.length);var i=e[1],a=e[2],s=e[3];goog.asserts.assertFunction(i);var l=module$contents$jspb$internal$binary_makeDeserializeBinaryFromReaderFromBinaryFields(a);return goog.asserts.assertArray(s),function(e,n,r){return t(e,n,r,i,l,s)};case 5:goog.asserts.assert(5===t.length);var u=e[1];a=e[3];var p=e[4];goog.asserts.assert(void 0===e[2]),goog.asserts.assertFunction(u);var c=module$contents$jspb$internal$binary_makeDeserializeBinaryFromReaderFromMessageSetAndReader(u,a,p);return function(e,n,r){return t(e,n,r,u,c)};case 6:goog.asserts.assert(6===t.length);var d=e[1];a=e[3],p=e[4];var h=e[5];goog.asserts.assert(void 0===e[2]),goog.asserts.assertFunction(d),goog.asserts.assertArray(h);var f=module$contents$jspb$internal$binary_makeDeserializeBinaryFromReaderFromMessageSetAndReader(d,a,p);return function(e,n,r){return t(e,n,r,d,f,h)};default:throw Error("Unsupported number of parameters, expected [2-6], got "+e.length)}},module$contents$jspb$internal$binary_binaryFieldsCache=goog.DEBUG?Symbol("binaryFieldsCache"):Symbol();function module$contents$jspb$internal$binary_getBinaryFields(e){return goog.asserts.assertFunction(e),goog.asserts.assert(0===e.length),e[module$contents$jspb$internal$binary_binaryFieldsCache]||(e[module$contents$jspb$internal$binary_binaryFieldsCache]=goog.asserts.assertObject(e()))}var module$contents$jspb$internal$binary_deserializeBinaryFromReaderGenericImpl=function(e,t,n){for(;t.nextField()&&!t.isEndGroup();){var r=t.getFieldNumber(),o=n[r];if(o)Array.isArray(o)&&(o=n[r]=module$contents$jspb$internal$binary_makeParserFromArray(o));else{var i=n[0];i&&(i=i[r])&&(o=n[r]=module$contents$jspb$internal$binary_makeParserFromBinaryExtension(i))}o&&o(t,e,r)||t.handleUnknownField(e)}return e},module$contents$jspb$internal$binary_deserializeBinaryFromReaderGeneric=function(e,t,n){return module$contents$jspb$internal$binary_deserializeBinaryFromReaderGenericImpl(e,t,module$contents$jspb$internal$binary_getBinaryFields(n))};jspb.internal.binary.deserializeBinaryFromReaderGeneric=module$contents$jspb$internal$binary_deserializeBinaryFromReaderGeneric,jspb.internal.binary.serializeBinary=function(e,t){var n=new module$exports$jspb$binary$writer.BinaryWriter;return t(e,n),n.getResultBuffer()},jspb.internal.binary.deserializeBinary=function(e,t,n){e=module$exports$jspb$binary$reader.BinaryReader.alloc(e);try{return module$contents$jspb$internal$binary_deserializeBinaryFromReaderGeneric(new t,e,n)}finally{e.free()}},jspb.internal.binary.deserializeBinaryMessageSet=function(e,t,n){e=module$exports$jspb$binary$reader.BinaryReader.alloc(e);try{return module$contents$jspb$internal$binary_readBinaryExtensionMessageSet(new t,e,n)}finally{e.free()}},jspb.internal.binary.writeDoubleExt=function(e,t,n){e.writeDouble(n.fieldIndex,t.getExtension(n))},jspb.internal.binary.writeRepeatedDoubleExt=function(e,t,n){e.writeRepeatedDouble(n.fieldIndex,t.getExtension(n))},jspb.internal.binary.writePackedDoubleExt=function(e,t,n){e.writePackedDouble(n.fieldIndex,t.getExtension(n))},jspb.internal.binary.writeDouble=function(e,t,n){e.writeDouble(n,t.internal_getField(n))},jspb.internal.binary.writeRepeatedDouble=function(e,t,n){e.writeRepeatedDouble(n,t.internal_getRepeatedField(n))},jspb.internal.binary.writePackedDouble=function(e,t,n){e.writePackedDouble(n,t.internal_getRepeatedField(n))},jspb.internal.binary.writeFloatExt=function(e,t,n){e.writeFloat(n.fieldIndex,t.getExtension(n))},jspb.internal.binary.writeRepeatedFloatExt=function(e,t,n){e.writeRepeatedFloat(n.fieldIndex,t.getExtension(n))},jspb.internal.binary.writePackedFloatExt=function(e,t,n){e.writePackedFloat(n.fieldIndex,t.getExtension(n))},jspb.internal.binary.writeFloat=function(e,t,n){e.writeFloat(n,t.internal_getField(n))},jspb.internal.binary.writeRepeatedFloat=function(e,t,n){e.writeRepeatedFloat(n,t.internal_getRepeatedField(n))},jspb.internal.binary.writePackedFloat=function(e,t,n){e.writePackedFloat(n,t.internal_getRepeatedField(n))}
2,jspb.internal.binary.writeInt64StringExt=function(e,t,n){e.writeInt64String(n.fieldIndex,t.getExtension(n))},jspb.internal.binary.writeRepeatedInt64StringExt=function(e,t,n){e.writeRepeatedInt64String(n.fieldIndex,t.getExtension(n))},jspb.internal.binary.writePackedInt64StringExt=function(e,t,n){e.writePackedInt64String(n.fieldIndex,t.getExtension(n))},jspb.internal.binary.writeInt64Ext=function(e,t,n){e.writeInt64(n.fieldIndex,t.getExtension(n))},jspb.internal.binary.writeRepeatedInt64Ext=function(e,t,n){e.writeRepeatedInt64(n.fieldIndex,t.getExtension(n))},jspb.internal.binary.writePackedInt64Ext=function(e,t,n){e.writePackedInt64(n.fieldIndex,t.getExtension(n))},jspb.internal.binary.writeInt64String=function(e,t,n){e.writeInt64String(n,t.internal_getField(n))},jspb.internal.binary.writeRepeatedInt64String=function(e,t,n){e.writeRepeatedInt64String(n,t.internal_getRepeatedField(n))},jspb.internal.binary.writePackedInt64String=function(e,t,n){e.writePackedInt64String(n,t.internal_getRepeatedField(n))},jspb.internal.binary.writeInt64=function(e,t,n){e.writeInt64(n,t.internal_getField(n))},jspb.internal.binary.writeRepeatedInt64=function(e,t,n){e.writeRepeatedInt64(n,t.internal_getRepeatedField(n))},jspb.internal.binary.writePackedInt64=function(e,t,n){e.writePackedInt64(n,t.internal_getRepeatedField(n))},jspb.internal.binary.writeUint64StringExt=function(e,t,n){e.writeUint64String(n.fieldIndex,t.getExtension(n))},jspb.internal.binary.writeRepeatedUint64StringExt=function(e,t,n){e.writeRepeatedUint64String(n.fieldIndex,t.getExtension(n))},jspb.internal.binary.writePackedUint64StringExt=function(e,t,n){e.writePackedUint64String(n.fieldIndex,t.getExtension(n))},jspb.internal.binary.writeUint64Ext=function(e,t,n){e.writeUint64(n.fieldIndex,t.getExtension(n))},jspb.internal.binary.writeRepeatedUint64Ext=function(e,t,n){e.writeRepeatedUint64(n.fieldIndex,t.getExtension(n))},jspb.internal.binary.writePackedUint64Ext=function(e,t,n){e.writePackedUint64(n.fieldIndex,t.getExtension(n))},jspb.internal.binary.writeUint64String=function(e,t,n){e.writeUint64String(n,t.internal_getField(n))},jspb.internal.binary.writeRepeatedUint64String=function(e,t,n){e.writeRepeatedUint64String(n,t.internal_getRepeatedField(n))},jspb.internal.binary.writePackedUint64String=function(e,t,n){e.writePackedUint64String(n,t.internal_getRepeatedField(n))},jspb.internal.binary.writeUint64=function(e,t,n){e.writeUint64(n,t.internal_getField(n))},jspb.internal.binary.writeRepeatedUint64=function(e,t,n){e.writeRepeatedUint64(n,t.internal_getRepeatedField(n))},jspb.internal.binary.writePackedUint64=function(e,t,n){e.writePackedUint64(n,t.internal_getRepeatedField(n))},jspb.internal.binary.writeInt32Ext=function(e,t,n){e.writeInt32(n.fieldIndex,t.getExtension(n))},jspb.internal.binary.writeRepeatedInt32Ext=function(e,t,n){e.writeRepeatedInt32(n.fieldIndex,t.getExtension(n))},jspb.internal.binary.writePackedInt32Ext=function(e,t,n){e.writePackedInt32(n.fieldIndex,t.getExtension(n))},jspb.internal.binary.writeInt32=function(e,t,n){e.writeInt32(n,t.internal_getField(n))},jspb.internal.binary.writeRepeatedInt32=function(e,t,n){e.writeRepeatedInt32(n,t.internal_getRepeatedField(n))},jspb.internal.binary.writePackedInt32=function(e,t,n){e.writePackedInt32(n,t.internal_getRepeatedField(n))}
2,jspb.internal.binary.writeFixed64StringExt=function(e,t,n){e.writeFixed64String(n.fieldIndex,t.getExtension(n))},jspb.internal.binary.writeRepeatedFixed64StringExt=function(e,t,n){e.writeRepeatedFixed64String(n.fieldIndex,t.getExtension(n))},jspb.internal.binary.writePackedFixed64StringExt=function(e,t,n){e.writePackedFixed64String(n.fieldIndex,t.getExtension(n))},jspb.internal.binary.writeFixed64Ext=function(e,t,n){e.writeFixed64(n.fieldIndex,t.getExtension(n))},jspb.internal.binary.writeRepeatedFixed64Ext=function(e,t,n){e.writeRepeatedFixed64(n.fieldIndex,t.getExtension(n))},jspb.internal.binary.writePackedFixed64Ext=function(e,t,n){e.writePackedFixed64(n.fieldIndex,t.getExtension(n))},jspb.internal.binary.writeFixed64String=function(e,t,n){e.writeFixed64String(n,t.internal_getField(n))},jspb.internal.binary.writeRepeatedFixed64String=function(e,t,n){e.writeRepeatedFixed64String(n,t.internal_getRepeatedField(n))},jspb.internal.binary.writePackedFixed64String=function(e,t,n){e.writePackedFixed64String(n,t.internal_getRepeatedField(n))},jspb.internal.binary.writeFixed64=function(e,t,n){e.writeFixed64(n,t.internal_getField(n))},jspb.internal.binary.writeRepeatedFixed64=function(e,t,n){e.writeRepeatedFixed64(n,t.internal_getRepeatedField(n))},jspb.internal.binary.writePackedFixed64=function(e,t,n){e.writePackedFixed64(n,t.internal_getRepeatedField(n))},jspb.internal.binary.writeFixed32Ext=function(e,t,n){e.writeFixed32(n.fieldIndex,t.getExtension(n))},jspb.internal.binary.writeRepeatedFixed32Ext=function(e,t,n){e.writeRepeatedFixed32(n.fieldIndex,t.getExtension(n))},jspb.internal.binary.writePackedFixed32Ext=function(e,t,n){e.writePackedFixed32(n.fieldIndex,t.getExtension(n))},jspb.internal.binary.writeFixed32=function(e,t,n){e.writeFixed32(n,t.internal_getField(n))},jspb.internal.binary.writeRepeatedFixed32=function(e,t,n){e.writeRepeatedFixed32(n,t.internal_getRepeatedField(n))},jspb.internal.binary.writePackedFixed32=function(e,t,n){e.writePackedFixed32(n,t.internal_getRepeatedField(n))},jspb.internal.binary.writeBoolExt=function(e,t,n){e.writeBool(n.fieldIndex,t.getExtension(n))},jspb.internal.binary.writeRepeatedBoolExt=function(e,t,n){e.writeRepeatedBool(n.fieldIndex,t.getExtension(n))},jspb.internal.binary.writePackedBoolExt=function(e,t,n){e.writePackedBool(n.fieldIndex,t.getExtension(n))},jspb.internal.binary.writeBool=function(e,t,n){e.writeBool(n,t.internal_getField(n))},jspb.internal.binary.writeRepeatedBool=function(e,t,n){e.writeRepeatedBool(n,t.internal_getRepeatedField(n))},jspb.internal.binary.writePackedBool=function(e,t,n){e.writePackedBool(n,t.internal_getRepeatedField(n))},jspb.internal.binary.writeStringExt=function(e,t,n){e.writeString(n.fieldIndex,t.getExtension(n))},jspb.internal.binary.writeRepeatedStringExt=function(e,t,n){e.writeRepeatedString(n.fieldIndex,t.getExtension(n))},jspb.internal.binary.writeString=function(e,t,n){e.writeString(n,t.internal_getField(n))},jspb.internal.binary.writeRepeatedString=function(e,t,n){e.writeRepeatedString(n,t.internal_getRepeatedField(n))},jspb.internal.binary.writeGroupExt=function(e,t,n,r){e.writeGroup(n.fieldIndex,t.getExtension(n),r)},jspb.internal.binary.writeRepeatedGroupExt=function(e,t,n,r){e.writeRepeatedGroup(n.fieldIndex,t.getExtension(n),r)},jspb.internal.binary.writeGroup=function(e,t,n,r,o){e.writeGroup(n,t.internal_getWrapperField(r,n),o)},jspb.internal.binary.writeRepeatedGroup=function(e,t,n,r,o){e.writeRepeatedGroup(n,t.internal_getRepeatedWrapperField(r,n),o)},jspb.internal.binary.writeMessageExt=function(e,t,n,r){e.writeMessage(n.fieldIndex,t.getExtension(n),r)},jspb.internal.binary.writeRepeatedMessageExt=function(e,t,n,r){e.writeRepeatedMessage(n.fieldIndex,t.getExtension(n),r)},jspb.internal.binary.writeMessage=function(e,t,n,r,o){e.writeMessage(n,t.internal_getWrapperField(r,n),o)},jspb.internal.binary.writeRepeatedMessage=function(e,t,n,r,o){e.writeRepeatedMessage(n,t.internal_getRepeatedWrapperField(r,n),o)},jspb.internal.binary.writeBytesExt=function(e,t,n){e.writeBytes(n.fieldIndex,t.getExtension(n))},jspb.internal.binary.writeRepeatedBytesExt=function(e,t,n){e.writeRepeatedBytes(n.fieldIndex,t.getExtension(n))},jspb.internal.binary.writeBytes=function(e,t,n){e.writeBytes(n,t.internal_getField(n))},jspb.internal.binary.writeRepeatedBytes=function(e,t,n){e.writeRepeatedBytes(n,t.internal_getRepeatedField(n))},jspb.internal.binary.writeUint32Ext=function(e,t,n){e.writeUint32(n.fieldIndex,t.getExtension(n))},jspb.internal.binary.writeRepeatedUint32Ext=function(e,t,n){e.writeRepeatedUint32(n.fieldIndex,t.getExtension(n))},jspb.internal.binary.writePackedUint32Ext=function(e,t,n){e.writePackedUint32(n.fieldIndex,t.getExtension(n))},jspb.internal.binary.writeUint32=function(e,t,n){e.writeUint32(n,t.internal_getField(n))},jspb.internal.binary.writeRepeatedUint32=function(e,t,n){e.writeRepeatedUint32(n,t.internal_getRepeatedField(n))},jspb.internal.binary.writePackedUint32=function(e,t,n){e.writePackedUint32(n,t.internal_getRepeatedField(n))},jspb.internal.binary.writeEnumExt=function(e,t,n){e.writeEnum(n.fieldIndex,t.getExtension(n))},jspb.internal.binary.writeRepeatedEnumExt=function(e,t,n){e.writeRepeatedEnum(n.fieldIndex,t.getExtension(n))},jspb.internal.binary.writePackedEnumExt=function(e,t,n){e.writePackedEnum(n.fieldIndex,t.getExtension(n))},jspb.internal.binary.writeEnum=function(e,t,n){e.writeEnum(n,t.internal_getField(n))},jspb.internal.binary.writeRepeatedEnum=function(e,t,n){e.writeRepeatedEnum(n,t.internal_getRepeatedField(n))},jspb.internal.binary.writePackedEnum=function(e,t,n){e.writePackedEnum(n,t.internal_getRepeatedField(n))},jspb.internal.binary.writeSfixed32Ext=function(e,t,n){e.writeSfixed32(n.fieldIndex,t.getExtension(n))},jspb.internal.binary.writeRepeatedSfixed32Ext=function(e,t,n){e.writeRepeatedSfixed32(n.fieldIndex,t.getExtension(n))},jspb.internal.binary.writePackedSfixed32Ext=function(e,t,n){e.writePackedSfixed32(n.fieldIndex,t.getExtension(n))},jspb.internal.binary.writeSfixed32=function(e,t,n){e.writeSfixed32(n,t.internal_getField(n))},jspb.internal.binary.writeRepeatedSfixed32=function(e,t,n){e.writeRepeatedSfixed32(n,t.internal_getRepeatedField(n))},jspb.internal.binary.writePackedSfixed32=function(e,t,n){e.writePackedSfixed32(n,t.internal_getRepeatedField(n))}
2,jspb.internal.binary.writeSfixed64StringExt=function(e,t,n){e.writeSfixed64String(n.fieldIndex,t.getExtension(n))},jspb.internal.binary.writeRepeatedSfixed64StringExt=function(e,t,n){e.writeRepeatedSfixed64String(n.fieldIndex,t.getExtension(n))},jspb.internal.binary.writePackedSfixed64StringExt=function(e,t,n){e.writePackedSfixed64String(n.fieldIndex,t.getExtension(n))},jspb.internal.binary.writeSfixed64Ext=function(e,t,n){e.writeSfixed64(n.fieldIndex,t.getExtension(n))},jspb.internal.binary.writeRepeatedSfixed64Ext=function(e,t,n){e.writeRepeatedSfixed64(n.fieldIndex,t.getExtension(n))},jspb.internal.binary.writePackedSfixed64Ext=function(e,t,n){e.writePackedSfixed64(n.fieldIndex,t.getExtension(n))},jspb.internal.binary.writeSfixed64String=function(e,t,n){e.writeSfixed64String(n,t.internal_getField(n))},jspb.internal.binary.writeRepeatedSfixed64String=function(e,t,n){e.writeRepeatedSfixed64String(n,t.internal_getRepeatedField(n))},jspb.internal.binary.writePackedSfixed64String=function(e,t,n){e.writePackedSfixed64String(n,t.internal_getRepeatedField(n))},jspb.internal.binary.writeSfixed64=function(e,t,n){e.writeSfixed64(n,t.internal_getField(n))},jspb.internal.binary.writeRepeatedSfixed64=function(e,t,n){e.writeRepeatedSfixed64(n,t.internal_getRepeatedField(n))},jspb.internal.binary.writePackedSfixed64=function(e,t,n){e.writePackedSfixed64(n,t.internal_getRepeatedField(n))},jspb.internal.binary.writeSint32Ext=function(e,t,n){e.writeSint32(n.fieldIndex,t.getExtension(n))},jspb.internal.binary.writeRepeatedSint32Ext=function(e,t,n){e.writeRepeatedSint32(n.fieldIndex,t.getExtension(n))},jspb.internal.binary.writePackedSint32Ext=function(e,t,n){e.writePackedSint32(n.fieldIndex,t.getExtension(n))},jspb.internal.binary.writeSint32=function(e,t,n){e.writeSint32(n,t.internal_getField(n))},jspb.internal.binary.writeRepeatedSint32=function(e,t,n){e.writeRepeatedSint32(n,t.internal_getRepeatedField(n))},jspb.internal.binary.writePackedSint32=function(e,t,n){e.writePackedSint32(n,t.internal_getRepeatedField(n))},jspb.internal.binary.writeSint64StringExt=function(e,t,n){e.writeSint64String(n.fieldIndex,t.getExtension(n))},jspb.internal.binary.writeRepeatedSint64StringExt=function(e,t,n){e.writeRepeatedSint64String(n.fieldIndex,t.getExtension(n))},jspb.internal.binary.writePackedSint64StringExt=function(e,t,n){e.writePackedSint64String(n.fieldIndex,t.getExtension(n))},jspb.internal.binary.writeSint64Ext=function(e,t,n){e.writeSint64(n.fieldIndex,t.getExtension(n))},jspb.internal.binary.writeRepeatedSint64Ext=function(e,t,n){e.writeRepeatedSint64(n.fieldIndex,t.getExtension(n))},jspb.internal.binary.writePackedSint64Ext=function(e,t,n){e.writePackedSint64(n.fieldIndex,t.getExtension(n))},jspb.internal.binary.writeSint64String=function(e,t,n){e.writeSint64String(n,t.internal_getField(n))},jspb.internal.binary.writeRepeatedSint64String=function(e,t,n){e.writeRepeatedSint64String(n,t.internal_getRepeatedField(n))},jspb.internal.binary.writePackedSint64String=function(e,t,n){e.writePackedSint64String(n,t.internal_getRepeatedField(n))},jspb.internal.binary.writeSint64=function(e,t,n){e.writeSint64(n,t.internal_getField(n))},jspb.internal.binary.writeRepeatedSint64=function(e,t,n){e.writeRepeatedSint64(n,t.internal_getRepeatedField(n))},jspb.internal.binary.writePackedSint64=function(e,t,n){e.writePackedSint64(n,t.internal_getRepeatedField(n))},jspb.internal.binary.readDoubleExt=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.FIXED64&&(t.setExtension(n,e.readDouble()),!0)},jspb.internal.binary.readPackableDoubleIntoExt=function(e,t,n){return(e.getWireType()===module$exports$jspb$BinaryConstants.WireType.FIXED64||e.getWireType()===module$exports$jspb$BinaryConstants.WireType.DELIMITED)&&(e.readPackableDoubleInto(t.getExtension(n)),!0)},jspb.internal.binary.readDouble=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.FIXED64&&(t.internal_setField(n,e.readDouble()),!0)},jspb.internal.binary.readPackableDoubleInto=function(e,t,n){return(e.getWireType()===module$exports$jspb$BinaryConstants.WireType.FIXED64||e.getWireType()===module$exports$jspb$BinaryConstants.WireType.DELIMITED)&&(e.readPackableDoubleInto(t.internal_getRepeatedField(n)),!0)},jspb.internal.binary.readDoubleIgnoringDefault=function(e,t,n){return e.getW
2ireType()===module$exports$jspb$BinaryConstants.WireType.FIXED64&&(t.internal_setProto3FloatField(n,e.readDouble()),!0)},jspb.internal.binary.readDoubleOneof=function(e,t,n,r){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.FIXED64&&(t.internal_setOneofField(n,r,e.readDouble()),!0)},jspb.internal.binary.readFloatExt=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.FIXED32&&(t.setExtension(n,e.readFloat()),!0)},jspb.internal.binary.readPackableFloatIntoExt=function(e,t,n){return(e.getWireType()===module$exports$jspb$BinaryConstants.WireType.FIXED32||e.getWireType()===module$exports$jspb$BinaryConstants.WireType.DELIMITED)&&(e.readPackableFloatInto(t.getExtension(n)),!0)},jspb.internal.binary.readFloat=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.FIXED32&&(t.internal_setField(n,e.readFloat()),!0)},jspb.internal.binary.readPackableFloatInto=function(e,t,n){return(e.getWireType()===module$exports$jspb$BinaryConstants.WireType.FIXED32||e.getWireType()===module$exports$jspb$BinaryConstants.WireType.DELIMITED)&&(e.readPackableFloatInto(t.internal_getRepeatedField(n)),!0)},jspb.internal.binary.readFloatIgnoringDefault=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.FIXED32&&(t.internal_setProto3FloatField(n,e.readFloat()),!0)},jspb.internal.binary.readFloatOneof=function(e,t,n,r){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.FIXED32&&(t.internal_setOneofField(n,r,e.readFloat()),!0)},jspb.internal.binary.readInt64StringExt=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT&&(t.setExtension(n,e.readInt64String()),!0)},jspb.internal.binary.readPackableInt64StringIntoExt=function(e,t,n){return(e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT||e.getWireType()===module$exports$jspb$BinaryConstants.WireType.DELIMITED)&&(e.readPackableInt64StringInto(t.getExtension(n)),!0)},jspb.internal.binary.readInt64Ext=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT&&(t.setExtension(n,e.readInt64()),!0)},jspb.internal.binary.readPackableInt64IntoExt=function(e,t,n){return(e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT||e.getWireType()===module$exports$jspb$BinaryConstants.WireType.DELIMITED)&&(e.readPackableInt64Into(t.getExtension(n)),!0)},jspb.internal.binary.readInt64String=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT&&(t.internal_setField(n,e.readInt64String()),!0)},jspb.internal.binary.readPackableInt64StringInto=function(e,t,n){return(e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT||e.getWireType()===module$exports$jspb$BinaryConstants.WireType.DELIMITED)&&(e.readPackableInt64StringInto(t.internal_getRepeatedField(n)),!0)},jspb.internal.binary.readInt64StringIgnoringDefault=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT&&(t.internal_setProto3StringIntField(n,e.readInt64String()),!0)},jspb.internal.binary.readInt64StringOneof=function(e,t,n,r){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT&&(t.internal_setOneofField(n,r,e.readInt64String()),!0)},jspb.internal.binary.readInt64=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT&&(t.internal_setField(n,e.readInt64()),!0)},jspb.internal.binary.readPackableInt64Into=function(e,t,n){return(e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT||e.getWireType()===module$exports$jspb$BinaryConstants.WireType.DELIMITED)&&(e.readPackableInt64Into(t.internal_getRepeatedField(n)),!0)},jspb.internal.binary.readInt64IgnoringDefault=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT&&(t.internal_setProto3IntField(n,e.readInt64()),!0)},jspb.internal.binary.readInt64Oneof=function(e,t,n,r){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT&&(t.internal_setOneofField(n,r,e.readInt64()),!0)}
2,jspb.internal.binary.readUint64StringExt=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT&&(t.setExtension(n,e.readUint64String()),!0)},jspb.internal.binary.readPackableUint64StringIntoExt=function(e,t,n){return(e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT||e.getWireType()===module$exports$jspb$BinaryConstants.WireType.DELIMITED)&&(e.readPackableUint64StringInto(t.getExtension(n)),!0)},jspb.internal.binary.readUint64Ext=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT&&(t.setExtension(n,e.readUint64()),!0)},jspb.internal.binary.readPackableUint64IntoExt=function(e,t,n){return(e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT||e.getWireType()===module$exports$jspb$BinaryConstants.WireType.DELIMITED)&&(e.readPackableUint64Into(t.getExtension(n)),!0)},jspb.internal.binary.readUint64String=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT&&(t.internal_setField(n,e.readUint64String()),!0)},jspb.internal.binary.readPackableUint64StringInto=function(e,t,n){return(e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT||e.getWireType()===module$exports$jspb$BinaryConstants.WireType.DELIMITED)&&(e.readPackableUint64StringInto(t.internal_getRepeatedField(n)),!0)},jspb.internal.binary.readUint64StringIgnoringDefault=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT&&(t.internal_setProto3StringIntField(n,e.readUint64String()),!0)},jspb.internal.binary.readUint64StringOneof=function(e,t,n,r){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT&&(t.internal_setOneofField(n,r,e.readUint64String()),!0)},jspb.internal.binary.readUint64=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT&&(t.internal_setField(n,e.readUint64()),!0)},jspb.internal.binary.readPackableUint64Into=function(e,t,n){return(e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT||e.getWireType()===module$exports$jspb$BinaryConstants.WireType.DELIMITED)&&(e.readPackableUint64Into(t.internal_getRepeatedField(n)),!0)},jspb.internal.binary.readUint64IgnoringDefault=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT&&(t.internal_setProto3IntField(n,e.readUint64()),!0)},jspb.internal.binary.readUint64Oneof=function(e,t,n,r){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT&&(t.internal_setOneofField(n,r,e.readUint64()),!0)},jspb.internal.binary.readInt32Ext=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT&&(t.setExtension(n,e.readInt32()),!0)},jspb.internal.binary.readPackableInt32IntoExt=function(e,t,n){return(e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT||e.getWireType()===module$exports$jspb$BinaryConstants.WireType.DELIMITED)&&(e.readPackableInt32Into(t.getExtension(n)),!0)},jspb.internal.binary.readInt32=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT&&(t.internal_setField(n,e.readInt32()),!0)},jspb.internal.binary.readPackableInt32Into=function(e,t,n){return(e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT||e.getWireType()===module$exports$jspb$BinaryConstants.WireType.DELIMITED)&&(e.readPackableInt32Into(t.internal_getRepeatedField(n)),!0)},jspb.internal.binary.readInt32IgnoringDefault=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT&&(t.internal_setProto3IntField(n,e.readInt32()),!0)},jspb.internal.binary.readInt32Oneof=function(e,t,n,r){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT&&(t.internal_setOneofField(n,r,e.readInt32()),!0)}
2,jspb.internal.binary.readFixed64StringExt=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.FIXED64&&(t.setExtension(n,e.readFixed64String()),!0)},jspb.internal.binary.readPackableFixed64StringIntoExt=function(e,t,n){return(e.getWireType()===module$exports$jspb$BinaryConstants.WireType.FIXED64||e.getWireType()===module$exports$jspb$BinaryConstants.WireType.DELIMITED)&&(e.readPackableFixed64StringInto(t.getExtension(n)),!0)},jspb.internal.binary.readFixed64Ext=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.FIXED64&&(t.setExtension(n,e.readFixed64()),!0)},jspb.internal.binary.readPackableFixed64IntoExt=function(e,t,n){return(e.getWireType()===module$exports$jspb$BinaryConstants.WireType.FIXED64||e.getWireType()===module$exports$jspb$BinaryConstants.WireType.DELIMITED)&&(e.readPackableFixed64Into(t.getExtension(n)),!0)},jspb.internal.binary.readFixed64String=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.FIXED64&&(t.internal_setField(n,e.readFixed64String()),!0)},jspb.internal.binary.readPackableFixed64StringInto=function(e,t,n){return(e.getWireType()===module$exports$jspb$BinaryConstants.WireType.FIXED64||e.getWireType()===module$exports$jspb$BinaryConstants.WireType.DELIMITED)&&(e.readPackableFixed64StringInto(t.internal_getRepeatedField(n)),!0)},jspb.internal.binary.readFixed64StringIgnoringDefault=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.FIXED64&&(t.internal_setProto3StringIntField(n,e.readFixed64String()),!0)},jspb.internal.binary.readFixed64StringOneof=function(e,t,n,r){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.FIXED64&&(t.internal_setOneofField(n,r,e.readFixed64String()),!0)},jspb.internal.binary.readFixed64=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.FIXED64&&(t.internal_setField(n,e.readFixed64()),!0)},jspb.internal.binary.readPackableFixed64Into=function(e,t,n){return(e.getWireType()===module$exports$jspb$BinaryConstants.WireType.FIXED64||e.getWireType()===module$exports$jspb$BinaryConstants.WireType.DELIMITED)&&(e.readPackableFixed64Into(t.internal_getRepeatedField(n)),!0)},jspb.internal.binary.readFixed64IgnoringDefault=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.FIXED64&&(t.internal_setProto3IntField(n,e.readFixed64()),!0)},jspb.internal.binary.readFixed64Oneof=function(e,t,n,r){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.FIXED64&&(t.internal_setOneofField(n,r,e.readFixed64()),!0)},jspb.internal.binary.readFixed32Ext=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.FIXED32&&(t.setExtension(n,e.readFixed32()),!0)},jspb.internal.binary.readPackableFixed32IntoExt=function(e,t,n){return(e.getWireType()===module$exports$jspb$BinaryConstants.WireType.FIXED32||e.getWireType()===module$exports$jspb$BinaryConstants.WireType.DELIMITED)&&(e.readPackableFixed32Into(t.getExtension(n)),!0)},jspb.internal.binary.readFixed32=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.FIXED32&&(t.internal_setField(n,e.readFixed32()),!0)},jspb.internal.binary.readPackableFixed32Into=function(e,t,n){return(e.getWireType()===module$exports$jspb$BinaryConstants.WireType.FIXED32||e.getWireType()===module$exports$jspb$BinaryConstants.WireType.DELIMITED)&&(e.readPackableFixed32Into(t.internal_getRepeatedField(n)),!0)},jspb.internal.binary.readFixed32IgnoringDefault=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.FIXED32&&(t.internal_setProto3IntField(n,e.readFixed32()),!0)},jspb.internal.binary.readFixed32Oneof=function(e,t,n,r){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.FIXED32&&(t.internal_setOneofField(n,r,e.readFixed32()),!0)},jspb.internal.binary.readBoolExt=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT&&(t.setExtension(n,e.readBool()),!0)},jspb.internal.binary.readPackableBoolIntoExt=function(e,t,n){return(e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT||e.getWireType()===module$exports$jspb$BinaryConstants.WireType.DELIMITED)&&(e.readPackableBoolInto(t.getExtension(n)),!0)}
2,jspb.internal.binary.readBool=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT&&(t.internal_setField(n,e.readBool()),!0)},jspb.internal.binary.readPackableBoolInto=function(e,t,n){return(e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT||e.getWireType()===module$exports$jspb$BinaryConstants.WireType.DELIMITED)&&(e.readPackableBoolInto(t.internal_getRepeatedField(n)),!0)},jspb.internal.binary.readBoolIgnoringDefault=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT&&(t.internal_setProto3BooleanField(n,e.readBool()),!0)},jspb.internal.binary.readBoolOneof=function(e,t,n,r){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT&&(t.internal_setOneofField(n,r,e.readBool()),!0)},jspb.internal.binary.readStringRequireUtf8Ext=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.DELIMITED&&(t.setExtension(n,e.readStringRequireUtf8()),!0)},jspb.internal.binary.readRepeatedStringRequireUtf8Ext=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.DELIMITED&&(t.getExtension(n).push(e.readStringRequireUtf8()),!0)},jspb.internal.binary.readStringRequireUtf8=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.DELIMITED&&(t.internal_setField(n,e.readStringRequireUtf8()),!0)},jspb.internal.binary.readRepeatedStringRequireUtf8=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.DELIMITED&&(t.internal_addToRepeatedField(n,e.readStringRequireUtf8()),!0)},jspb.internal.binary.readStringRequireUtf8IgnoringDefault=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.DELIMITED&&(t.internal_setProto3StringField(n,e.readStringRequireUtf8()),!0)},jspb.internal.binary.readStringRequireUtf8Oneof=function(e,t,n,r){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.DELIMITED&&(t.internal_setOneofField(n,r,e.readStringRequireUtf8()),!0)},jspb.internal.binary.readStringExt=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.DELIMITED&&(t.setExtension(n,e.readString()),!0)},jspb.internal.binary.readRepeatedStringExt=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.DELIMITED&&(t.getExtension(n).push(e.readString()),!0)},jspb.internal.binary.readString=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.DELIMITED&&(t.internal_setField(n,e.readString()),!0)},jspb.internal.binary.readRepeatedString=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.DELIMITED&&(t.internal_addToRepeatedField(n,e.readString()),!0)},jspb.internal.binary.readStringOneof=function(e,t,n,r){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.DELIMITED&&(t.internal_setOneofField(n,r,e.readString()),!0)},jspb.internal.binary.readGroupExt=function(e,t,n,r){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.START_GROUP&&(t.setExtension(n,e.readGroup(n.fieldIndex,new n.ctor,r)),!0)},jspb.internal.binary.readRepeatedGroupExt=function(e,t,n,r){if(e.getWireType()!==module$exports$jspb$BinaryConstants.WireType.START_GROUP)return!1;var o=t.getExtension(n);return o.push(e.readGroup(n.fieldIndex,new n.ctor,r)),t.setExtension(n,o),!0},jspb.internal.binary.readGroup=function(e,t,n,r,o){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.START_GROUP&&(t.internal_setWrapperField(n,e.readGroup(n,new r,o)),!0)},jspb.internal.binary.readRepeatedGroup=function(e,t,n,r,o){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.START_GROUP&&(t.internal_addToRepeatedWrapperField(n,e.readGroup(n,new r,o),r),!0)},jspb.internal.binary.readGroupOneof=function(e,t,n,r,o,i){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.START_GROUP&&(t.internal_setOneofWrapperField(n,i,e.readGroup(n,new r,o)),!0)},jspb.internal.binary.readMessageExt=function(e,t,n,r){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.DELIMITED&&(t.setExtension(n,e.readMessage(new n.ctor,r)),!0)},jspb.internal.binary.readRepeatedMessageExt=function(e,t,n,r){if(e.getWireType()!==module$exports$jspb$BinaryConstants.WireType.DELIMITED)return!1;var o=t.getExtension(n);return o.push(e.readMessage(new n.ctor,r)),t.setExtension(n,o),!0},jspb.internal.binary.readMessage=function(e,t,n,r,o){return e.getW
2ireType()===module$exports$jspb$BinaryConstants.WireType.DELIMITED&&(t.internal_setWrapperField(n,e.readMessage(new r,o)),!0)},jspb.internal.binary.readRepeatedMessage=function(e,t,n,r,o){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.DELIMITED&&(t.internal_addToRepeatedWrapperField(n,e.readMessage(new r,o),r),!0)},jspb.internal.binary.readMessageOneof=function(e,t,n,r,o,i){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.DELIMITED&&(t.internal_setOneofWrapperField(n,i,e.readMessage(new r,o)),!0)},jspb.internal.binary.readBytesExt=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.DELIMITED&&(t.setExtension(n,e.readBytes()),!0)},jspb.internal.binary.readRepeatedBytesExt=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.DELIMITED&&(t.getExtension(n).push(e.readBytes()),!0)},jspb.internal.binary.readBytes=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.DELIMITED&&(t.internal_setField(n,e.readBytes()),!0)},jspb.internal.binary.readRepeatedBytes=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.DELIMITED&&(t.internal_addToRepeatedField(n,e.readBytes()),!0)},jspb.internal.binary.readBytesIgnoringDefault=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.DELIMITED&&(t.internal_setProto3BytesField(n,e.readBytes()),!0)},jspb.internal.binary.readBytesOneof=function(e,t,n,r){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.DELIMITED&&(t.internal_setOneofField(n,r,e.readBytes()),!0)},jspb.internal.binary.readUint32Ext=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT&&(t.setExtension(n,e.readUint32()),!0)},jspb.internal.binary.readPackableUint32IntoExt=function(e,t,n){return(e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT||e.getWireType()===module$exports$jspb$BinaryConstants.WireType.DELIMITED)&&(e.readPackableUint32Into(t.getExtension(n)),!0)},jspb.internal.binary.readUint32=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT&&(t.internal_setField(n,e.readUint32()),!0)},jspb.internal.binary.readPackableUint32Into=function(e,t,n){return(e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT||e.getWireType()===module$exports$jspb$BinaryConstants.WireType.DELIMITED)&&(e.readPackableUint32Into(t.internal_getRepeatedField(n)),!0)},jspb.internal.binary.readUint32IgnoringDefault=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT&&(t.internal_setProto3IntField(n,e.readUint32()),!0)},jspb.internal.binary.readUint32Oneof=function(e,t,n,r){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT&&(t.internal_setOneofField(n,r,e.readUint32()),!0)},jspb.internal.binary.readEnumExt=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT&&(t.setExtension(n,e.readEnum()),!0)},jspb.internal.binary.readPackableEnumIntoExt=function(e,t,n){return(e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT||e.getWireType()===module$exports$jspb$BinaryConstants.WireType.DELIMITED)&&(e.readPackableEnumInto(t.getExtension(n)),!0)},jspb.internal.binary.readEnum=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT&&(t.internal_setField(n,e.readEnum()),!0)},jspb.internal.binary.readPackableEnumInto=function(e,t,n){return(e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT||e.getWireType()===module$exports$jspb$BinaryConstants.WireType.DELIMITED)&&(e.readPackableEnumInto(t.internal_getRepeatedField(n)),!0)},jspb.internal.binary.readEnumIgnoringDefault=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT&&(t.internal_setProto3EnumField(n,e.readEnum()),!0)},jspb.internal.binary.readEnumOneof=function(e,t,n,r){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT&&(t.internal_setOneofField(n,r,e.readEnum()),!0)},jspb.internal.binary.readSfixed32Ext=function(e,t,n){return e.getW
2ireType()===module$exports$jspb$BinaryConstants.WireType.FIXED32&&(t.setExtension(n,e.readSfixed32()),!0)},jspb.internal.binary.readPackableSfixed32IntoExt=function(e,t,n){return(e.getWireType()===module$exports$jspb$BinaryConstants.WireType.FIXED32||e.getWireType()===module$exports$jspb$BinaryConstants.WireType.DELIMITED)&&(e.readPackableSfixed32Into(t.getExtension(n)),!0)},jspb.internal.binary.readSfixed32=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.FIXED32&&(t.internal_setField(n,e.readSfixed32()),!0)},jspb.internal.binary.readPackableSfixed32Into=function(e,t,n){return(e.getWireType()===module$exports$jspb$BinaryConstants.WireType.FIXED32||e.getWireType()===module$exports$jspb$BinaryConstants.WireType.DELIMITED)&&(e.readPackableSfixed32Into(t.internal_getRepeatedField(n)),!0)},jspb.internal.binary.readSfixed32IgnoringDefault=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.FIXED32&&(t.internal_setProto3IntField(n,e.readSfixed32()),!0)},jspb.internal.binary.readSfixed32Oneof=function(e,t,n,r){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.FIXED32&&(t.internal_setOneofField(n,r,e.readSfixed32()),!0)}
2,jspb.internal.binary.readSfixed64StringExt=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.FIXED64&&(t.setExtension(n,e.readSfixed64String()),!0)},jspb.internal.binary.readPackableSfixed64StringIntoExt=function(e,t,n){return(e.getWireType()===module$exports$jspb$BinaryConstants.WireType.FIXED64||e.getWireType()===module$exports$jspb$BinaryConstants.WireType.DELIMITED)&&(e.readPackableSfixed64StringInto(t.getExtension(n)),!0)},jspb.internal.binary.readSfixed64Ext=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.FIXED64&&(t.setExtension(n,e.readSfixed64()),!0)},jspb.internal.binary.readPackableSfixed64IntoExt=function(e,t,n){return(e.getWireType()===module$exports$jspb$BinaryConstants.WireType.FIXED64||e.getWireType()===module$exports$jspb$BinaryConstants.WireType.DELIMITED)&&(e.readPackableSfixed64Into(t.getExtension(n)),!0)},jspb.internal.binary.readSfixed64String=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.FIXED64&&(t.internal_setField(n,e.readSfixed64String()),!0)},jspb.internal.binary.readPackableSfixed64StringInto=function(e,t,n){return(e.getWireType()===module$exports$jspb$BinaryConstants.WireType.FIXED64||e.getWireType()===module$exports$jspb$BinaryConstants.WireType.DELIMITED)&&(e.readPackableSfixed64StringInto(t.internal_getRepeatedField(n)),!0)},jspb.internal.binary.readSfixed64StringIgnoringDefault=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.FIXED64&&(t.internal_setProto3StringIntField(n,e.readSfixed64String()),!0)},jspb.internal.binary.readSfixed64StringOneof=function(e,t,n,r){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.FIXED64&&(t.internal_setOneofField(n,r,e.readSfixed64String()),!0)},jspb.internal.binary.readSfixed64=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.FIXED64&&(t.internal_setField(n,e.readSfixed64()),!0)},jspb.internal.binary.readPackableSfixed64Into=function(e,t,n){return(e.getWireType()===module$exports$jspb$BinaryConstants.WireType.FIXED64||e.getWireType()===module$exports$jspb$BinaryConstants.WireType.DELIMITED)&&(e.readPackableSfixed64Into(t.internal_getRepeatedField(n)),!0)},jspb.internal.binary.readSfixed64IgnoringDefault=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.FIXED64&&(t.internal_setProto3IntField(n,e.readSfixed64()),!0)},jspb.internal.binary.readSfixed64Oneof=function(e,t,n,r){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.FIXED64&&(t.internal_setOneofField(n,r,e.readSfixed64()),!0)},jspb.internal.binary.readSint32Ext=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT&&(t.setExtension(n,e.readSint32()),!0)},jspb.internal.binary.readPackableSint32IntoExt=function(e,t,n){return(e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT||e.getWireType()===module$exports$jspb$BinaryConstants.WireType.DELIMITED)&&(e.readPackableSint32Into(t.getExtension(n)),!0)},jspb.internal.binary.readSint32=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT&&(t.internal_setField(n,e.readSint32()),!0)},jspb.internal.binary.readPackableSint32Into=function(e,t,n){return(e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT||e.getWireType()===module$exports$jspb$BinaryConstants.WireType.DELIMITED)&&(e.readPackableSint32Into(t.internal_getRepeatedField(n)),!0)},jspb.internal.binary.readSint32IgnoringDefault=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT&&(t.internal_setProto3IntField(n,e.readSint32()),!0)},jspb.internal.binary.readSint32Oneof=function(e,t,n,r){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT&&(t.internal_setOneofField(n,r,e.readSint32()),!0)},jspb.internal.binary.readSint64StringExt=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT&&(t.setExtension(n,e.readSint64String()),!0)},jspb.internal.binary.readPackableSint64StringIntoExt=function(e,t,n){return(e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT||e.getWireType()===module$exports$jspb$BinaryConstants.WireType.DELIMITED)&&(e.readPackableSint64StringInto(t.getExtension(n)),!0)},jspb.internal.binary.readSint64Ext=function(e,t,n){return e.getW
2ireType()===module$exports$jspb$BinaryConstants.WireType.VARINT&&(t.setExtension(n,e.readSint64()),!0)},jspb.internal.binary.readPackableSint64IntoExt=function(e,t,n){return(e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT||e.getWireType()===module$exports$jspb$BinaryConstants.WireType.DELIMITED)&&(e.readPackableSint64Into(t.getExtension(n)),!0)},jspb.internal.binary.readSint64String=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT&&(t.internal_setField(n,e.readSint64String()),!0)},jspb.internal.binary.readPackableSint64StringInto=function(e,t,n){return(e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT||e.getWireType()===module$exports$jspb$BinaryConstants.WireType.DELIMITED)&&(e.readPackableSint64StringInto(t.internal_getRepeatedField(n)),!0)},jspb.internal.binary.readSint64StringIgnoringDefault=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT&&(t.internal_setProto3StringIntField(n,e.readSint64String()),!0)},jspb.internal.binary.readSint64StringOneof=function(e,t,n,r){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT&&(t.internal_setOneofField(n,r,e.readSint64String()),!0)},jspb.internal.binary.readSint64=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT&&(t.internal_setField(n,e.readSint64()),!0)},jspb.internal.binary.readPackableSint64Into=function(e,t,n){return(e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT||e.getWireType()===module$exports$jspb$BinaryConstants.WireType.DELIMITED)&&(e.readPackableSint64Into(t.internal_getRepeatedField(n)),!0)},jspb.internal.binary.readSint64IgnoringDefault=function(e,t,n){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT&&(t.internal_setProto3IntField(n,e.readSint64()),!0)},jspb.internal.binary.readSint64Oneof=function(e,t,n,r){return e.getWireType()===module$exports$jspb$BinaryConstants.WireType.VARINT&&(t.internal_setOneofField(n,r,e.readSint64()),!0)},jspb.internal.binary.writeInt64DoubleMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeInt64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeDouble)},jspb.internal.binary.writeInt64FloatMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeInt64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFloat)},jspb.internal.binary.writeInt64Int64Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeInt64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeInt64)},jspb.internal.binary.writeInt64Uint64Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeInt64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUint64)},jspb.internal.binary.writeInt64Int32Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeInt64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeInt32)},jspb.internal.binary.writeInt64Fixed64Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeInt64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFixed64)},jspb.internal.binary.writeInt64Fixed32Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeInt64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFixed32)},jspb.internal.binary.writeInt64BoolMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeInt64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeBool)},jspb.internal.binary.writeInt64StringMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,
2n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeInt64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeString)},jspb.internal.binary.writeInt64MessageMap=function(e,t,n,r,o){module$contents$jspb$internal$binary_writeMessageMap(t,n,r,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeInt64,o)},jspb.internal.binary.writeInt64BytesMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeInt64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeBytes)},jspb.internal.binary.writeInt64Uint32Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeInt64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUint32)},jspb.internal.binary.writeInt64EnumMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeInt64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeEnum)},jspb.internal.binary.writeInt64Sfixed32Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeInt64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSfixed32)},jspb.internal.binary.writeInt64Sfixed64Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeInt64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSfixed64)},jspb.internal.binary.writeInt64Sint32Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeInt64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSint32)},jspb.internal.binary.writeInt64Sint64Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeInt64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSint64)},jspb.internal.binary.writeUint64DoubleMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUint64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeDouble)},jspb.internal.binary.writeUint64FloatMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUint64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFloat)},jspb.internal.binary.writeUint64Int64Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUint64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeInt64)},jspb.internal.binary.writeUint64Uint64Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUint64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUint64)},jspb.internal.binary.writeUint64Int32Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUint64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeInt32)},jspb.internal.binary.writeUint64Fixed64Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUint64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFixed64)},jspb.internal.binary.writeUint64Fixed32Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUint64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFixed32)},jspb.internal.binary.writeUint64BoolMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUint64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeBool)},jspb.internal.binary.writeUint64StringMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,
2n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUint64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeString)},jspb.internal.binary.writeUint64MessageMap=function(e,t,n,r,o){module$contents$jspb$internal$binary_writeMessageMap(t,n,r,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUint64,o)},jspb.internal.binary.writeUint64BytesMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUint64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeBytes)},jspb.internal.binary.writeUint64Uint32Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUint64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUint32)},jspb.internal.binary.writeUint64EnumMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUint64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeEnum)},jspb.internal.binary.writeUint64Sfixed32Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUint64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSfixed32)},jspb.internal.binary.writeUint64Sfixed64Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUint64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSfixed64)},jspb.internal.binary.writeUint64Sint32Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUint64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSint32)},jspb.internal.binary.writeUint64Sint64Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUint64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSint64)},jspb.internal.binary.writeInt32DoubleMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeInt32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeDouble)},jspb.internal.binary.writeInt32FloatMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeInt32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFloat)},jspb.internal.binary.writeInt32Int64Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeInt32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeInt64)},jspb.internal.binary.writeInt32Uint64Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeInt32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUint64)},jspb.internal.binary.writeInt32Int32Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeInt32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeInt32)},jspb.internal.binary.writeInt32Fixed64Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeInt32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFixed64)},jspb.internal.binary.writeInt32Fixed32Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeInt32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFixed32)},jspb.internal.binary.writeInt32BoolMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeInt32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeBool)},jspb.internal.binary.writeInt32StringMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,
2n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeInt32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeString)},jspb.internal.binary.writeInt32MessageMap=function(e,t,n,r,o){module$contents$jspb$internal$binary_writeMessageMap(t,n,r,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeInt32,o)},jspb.internal.binary.writeInt32BytesMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeInt32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeBytes)},jspb.internal.binary.writeInt32Uint32Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeInt32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUint32)},jspb.internal.binary.writeInt32EnumMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeInt32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeEnum)},jspb.internal.binary.writeInt32Sfixed32Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeInt32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSfixed32)},jspb.internal.binary.writeInt32Sfixed64Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeInt32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSfixed64)},jspb.internal.binary.writeInt32Sint32Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeInt32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSint32)},jspb.internal.binary.writeInt32Sint64Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeInt32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSint64)},jspb.internal.binary.writeFixed64DoubleMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFixed64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeDouble)},jspb.internal.binary.writeFixed64FloatMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFixed64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFloat)},jspb.internal.binary.writeFixed64Int64Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFixed64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeInt64)},jspb.internal.binary.writeFixed64Uint64Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFixed64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUint64)},jspb.internal.binary.writeFixed64Int32Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFixed64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeInt32)},jspb.internal.binary.writeFixed64Fixed64Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFixed64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFixed64)},jspb.internal.binary.writeFixed64Fixed32Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFixed64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFixed32)},jspb.internal.binary.writeFixed64BoolMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFixed64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeBool)},jspb.internal.binary.writeFixed64StringMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,
2n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFixed64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeString)},jspb.internal.binary.writeFixed64MessageMap=function(e,t,n,r,o){module$contents$jspb$internal$binary_writeMessageMap(t,n,r,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFixed64,o)},jspb.internal.binary.writeFixed64BytesMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFixed64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeBytes)},jspb.internal.binary.writeFixed64Uint32Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFixed64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUint32)},jspb.internal.binary.writeFixed64EnumMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFixed64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeEnum)},jspb.internal.binary.writeFixed64Sfixed32Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFixed64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSfixed32)},jspb.internal.binary.writeFixed64Sfixed64Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFixed64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSfixed64)},jspb.internal.binary.writeFixed64Sint32Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFixed64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSint32)},jspb.internal.binary.writeFixed64Sint64Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFixed64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSint64)},jspb.internal.binary.writeFixed32DoubleMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFixed32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeDouble)},jspb.internal.binary.writeFixed32FloatMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFixed32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFloat)},jspb.internal.binary.writeFixed32Int64Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFixed32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeInt64)},jspb.internal.binary.writeFixed32Uint64Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFixed32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUint64)},jspb.internal.binary.writeFixed32Int32Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFixed32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeInt32)},jspb.internal.binary.writeFixed32Fixed64Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFixed32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFixed64)},jspb.internal.binary.writeFixed32Fixed32Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFixed32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFixed32)},jspb.internal.binary.writeFixed32BoolMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFixed32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeBool)},jspb.internal.binary.writeFixed32StringMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,
2n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFixed32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeString)},jspb.internal.binary.writeFixed32MessageMap=function(e,t,n,r,o){module$contents$jspb$internal$binary_writeMessageMap(t,n,r,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFixed32,o)},jspb.internal.binary.writeFixed32BytesMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFixed32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeBytes)},jspb.internal.binary.writeFixed32Uint32Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFixed32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUint32)},jspb.internal.binary.writeFixed32EnumMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFixed32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeEnum)},jspb.internal.binary.writeFixed32Sfixed32Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFixed32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSfixed32)},jspb.internal.binary.writeFixed32Sfixed64Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFixed32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSfixed64)},jspb.internal.binary.writeFixed32Sint32Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFixed32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSint32)},jspb.internal.binary.writeFixed32Sint64Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFixed32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSint64)},jspb.internal.binary.writeBoolDoubleMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeBool,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeDouble)},jspb.internal.binary.writeBoolFloatMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeBool,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFloat)},jspb.internal.binary.writeBoolInt64Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeBool,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeInt64)},jspb.internal.binary.writeBoolUint64Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeBool,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUint64)},jspb.internal.binary.writeBoolInt32Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeBool,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeInt32)},jspb.internal.binary.writeBoolFixed64Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeBool,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFixed64)},jspb.internal.binary.writeBoolFixed32Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeBool,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFixed32)},jspb.internal.binary.writeBoolBoolMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeBool,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeBool)},jspb.internal.binary.writeBoolStringMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,
2n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeBool,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeString)},jspb.internal.binary.writeBoolMessageMap=function(e,t,n,r,o){module$contents$jspb$internal$binary_writeMessageMap(t,n,r,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeBool,o)},jspb.internal.binary.writeBoolBytesMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeBool,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeBytes)},jspb.internal.binary.writeBoolUint32Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeBool,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUint32)},jspb.internal.binary.writeBoolEnumMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeBool,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeEnum)},jspb.internal.binary.writeBoolSfixed32Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeBool,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSfixed32)},jspb.internal.binary.writeBoolSfixed64Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeBool,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSfixed64)},jspb.internal.binary.writeBoolSint32Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeBool,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSint32)},jspb.internal.binary.writeBoolSint64Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeBool,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSint64)},jspb.internal.binary.writeStringDoubleMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeString,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeDouble)},jspb.internal.binary.writeStringFloatMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeString,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFloat)},jspb.internal.binary.writeStringInt64Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeString,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeInt64)},jspb.internal.binary.writeStringUint64Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeString,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUint64)},jspb.internal.binary.writeStringInt32Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeString,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeInt32)},jspb.internal.binary.writeStringFixed64Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeString,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFixed64)},jspb.internal.binary.writeStringFixed32Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeString,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFixed32)},jspb.internal.binary.writeStringBoolMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeString,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeBool)},jspb.internal.binary.writeStringStringMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,
2n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeString,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeString)},jspb.internal.binary.writeStringMessageMap=function(e,t,n,r,o){module$contents$jspb$internal$binary_writeMessageMap(t,n,r,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeString,o)},jspb.internal.binary.writeStringBytesMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeString,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeBytes)},jspb.internal.binary.writeStringUint32Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeString,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUint32)},jspb.internal.binary.writeStringEnumMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeString,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeEnum)},jspb.internal.binary.writeStringSfixed32Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeString,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSfixed32)},jspb.internal.binary.writeStringSfixed64Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeString,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSfixed64)},jspb.internal.binary.writeStringSint32Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeString,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSint32)},jspb.internal.binary.writeStringSint64Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeString,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSint64)},jspb.internal.binary.writeUint32DoubleMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUint32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeDouble)},jspb.internal.binary.writeUint32FloatMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUint32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFloat)},jspb.internal.binary.writeUint32Int64Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUint32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeInt64)},jspb.internal.binary.writeUint32Uint64Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUint32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUint64)},jspb.internal.binary.writeUint32Int32Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUint32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeInt32)},jspb.internal.binary.writeUint32Fixed64Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUint32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFixed64)},jspb.internal.binary.writeUint32Fixed32Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUint32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFixed32)},jspb.internal.binary.writeUint32BoolMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUint32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeBool)},jspb.internal.binary.writeUint32StringMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,
2n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUint32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeString)},jspb.internal.binary.writeUint32MessageMap=function(e,t,n,r,o){module$contents$jspb$internal$binary_writeMessageMap(t,n,r,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUint32,o)},jspb.internal.binary.writeUint32BytesMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUint32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeBytes)},jspb.internal.binary.writeUint32Uint32Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUint32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUint32)},jspb.internal.binary.writeUint32EnumMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUint32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeEnum)},jspb.internal.binary.writeUint32Sfixed32Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUint32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSfixed32)},jspb.internal.binary.writeUint32Sfixed64Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUint32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSfixed64)},jspb.internal.binary.writeUint32Sint32Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUint32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSint32)},jspb.internal.binary.writeUint32Sint64Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUint32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSint64)},jspb.internal.binary.writeSfixed32DoubleMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSfixed32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeDouble)},jspb.internal.binary.writeSfixed32FloatMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSfixed32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFloat)},jspb.internal.binary.writeSfixed32Int64Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSfixed32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeInt64)},jspb.internal.binary.writeSfixed32Uint64Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSfixed32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUint64)},jspb.internal.binary.writeSfixed32Int32Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSfixed32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeInt32)},jspb.internal.binary.writeSfixed32Fixed64Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSfixed32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFixed64)},jspb.internal.binary.writeSfixed32Fixed32Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSfixed32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFixed32)},jspb.internal.binary.writeSfixed32BoolMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSfixed32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeBool)},jspb.internal.binary.writeSfixed32StringMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,
2n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSfixed32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeString)},jspb.internal.binary.writeSfixed32MessageMap=function(e,t,n,r,o){module$contents$jspb$internal$binary_writeMessageMap(t,n,r,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSfixed32,o)},jspb.internal.binary.writeSfixed32BytesMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSfixed32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeBytes)},jspb.internal.binary.writeSfixed32Uint32Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSfixed32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUint32)},jspb.internal.binary.writeSfixed32EnumMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSfixed32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeEnum)},jspb.internal.binary.writeSfixed32Sfixed32Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSfixed32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSfixed32)},jspb.internal.binary.writeSfixed32Sfixed64Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSfixed32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSfixed64)},jspb.internal.binary.writeSfixed32Sint32Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSfixed32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSint32)},jspb.internal.binary.writeSfixed32Sint64Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSfixed32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSint64)},jspb.internal.binary.writeSfixed64DoubleMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSfixed64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeDouble)},jspb.internal.binary.writeSfixed64FloatMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSfixed64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFloat)},jspb.internal.binary.writeSfixed64Int64Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSfixed64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeInt64)},jspb.internal.binary.writeSfixed64Uint64Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSfixed64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUint64)},jspb.internal.binary.writeSfixed64Int32Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSfixed64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeInt32)},jspb.internal.binary.writeSfixed64Fixed64Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSfixed64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFixed64)},jspb.internal.binary.writeSfixed64Fixed32Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSfixed64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFixed32)},jspb.internal.binary.writeSfixed64BoolMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSfixed64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeBool)},jspb.internal.binary.writeSfixed64StringMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,
2n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSfixed64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeString)},jspb.internal.binary.writeSfixed64MessageMap=function(e,t,n,r,o){module$contents$jspb$internal$binary_writeMessageMap(t,n,r,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSfixed64,o)},jspb.internal.binary.writeSfixed64BytesMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSfixed64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeBytes)},jspb.internal.binary.writeSfixed64Uint32Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSfixed64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUint32)},jspb.internal.binary.writeSfixed64EnumMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSfixed64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeEnum)},jspb.internal.binary.writeSfixed64Sfixed32Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSfixed64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSfixed32)},jspb.internal.binary.writeSfixed64Sfixed64Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSfixed64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSfixed64)},jspb.internal.binary.writeSfixed64Sint32Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSfixed64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSint32)},jspb.internal.binary.writeSfixed64Sint64Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSfixed64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSint64)},jspb.internal.binary.writeSint32DoubleMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSint32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeDouble)},jspb.internal.binary.writeSint32FloatMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSint32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFloat)},jspb.internal.binary.writeSint32Int64Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSint32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeInt64)},jspb.internal.binary.writeSint32Uint64Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSint32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUint64)},jspb.internal.binary.writeSint32Int32Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSint32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeInt32)},jspb.internal.binary.writeSint32Fixed64Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSint32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFixed64)},jspb.internal.binary.writeSint32Fixed32Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSint32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFixed32)},jspb.internal.binary.writeSint32BoolMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSint32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeBool)},jspb.internal.binary.writeSint32StringMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,
2n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSint32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeString)},jspb.internal.binary.writeSint32MessageMap=function(e,t,n,r,o){module$contents$jspb$internal$binary_writeMessageMap(t,n,r,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSint32,o)},jspb.internal.binary.writeSint32BytesMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSint32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeBytes)},jspb.internal.binary.writeSint32Uint32Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSint32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUint32)},jspb.internal.binary.writeSint32EnumMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSint32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeEnum)},jspb.internal.binary.writeSint32Sfixed32Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSint32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSfixed32)},jspb.internal.binary.writeSint32Sfixed64Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSint32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSfixed64)},jspb.internal.binary.writeSint32Sint32Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSint32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSint32)},jspb.internal.binary.writeSint32Sint64Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSint32,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSint64)},jspb.internal.binary.writeSint64DoubleMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSint64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeDouble)},jspb.internal.binary.writeSint64FloatMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSint64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFloat)},jspb.internal.binary.writeSint64Int64Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSint64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeInt64)},jspb.internal.binary.writeSint64Uint64Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSint64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUint64)},jspb.internal.binary.writeSint64Int32Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSint64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeInt32)},jspb.internal.binary.writeSint64Fixed64Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSint64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFixed64)},jspb.internal.binary.writeSint64Fixed32Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSint64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeFixed32)},jspb.internal.binary.writeSint64BoolMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSint64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeBool)},jspb.internal.binary.writeSint64StringMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,
2n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSint64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeString)},jspb.internal.binary.writeSint64MessageMap=function(e,t,n,r,o){module$contents$jspb$internal$binary_writeMessageMap(t,n,r,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSint64,o)},jspb.internal.binary.writeSint64BytesMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSint64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeBytes)},jspb.internal.binary.writeSint64Uint32Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSint64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeUint32)},jspb.internal.binary.writeSint64EnumMap=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSint64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeEnum)},jspb.internal.binary.writeSint64Sfixed32Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSint64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSfixed32)},jspb.internal.binary.writeSint64Sfixed64Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSint64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSfixed64)},jspb.internal.binary.writeSint64Sint32Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSint64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSint32)},jspb.internal.binary.writeSint64Sint64Map=function(e,t,n){module$contents$jspb$internal$binary_writeMap(t,n,n,e,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSint64,module$exports$jspb$binary$writer.BinaryWriter.prototype.writeSint64)},jspb.internal.binary.readInt64DoubleMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readInt64,jspb.internal.binary.readDouble,0,0)},jspb.internal.binary.readInt64FloatMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readInt64,jspb.internal.binary.readFloat,0,0)},jspb.internal.binary.readInt64Int64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readInt64,jspb.internal.binary.readInt64,0,0)},jspb.internal.binary.readInt64Uint64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readInt64,jspb.internal.binary.readUint64,0,0)},jspb.internal.binary.readInt64Int32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readInt64,jspb.internal.binary.readInt32,0,0)},jspb.internal.binary.readInt64Fixed64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readInt64,jspb.internal.binary.readFixed64,0,0)},jspb.internal.binary.readInt64Fixed32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readInt64,jspb.internal.binary.readFixed32,0,0)},jspb.internal.binary.readInt64BoolMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readInt64,jspb.internal.binary.readBool,0,!1)},jspb.internal.binary.readInt64StringRequireUtf8Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readInt64,jspb.internal.binary.readStringRequireUtf8,0,"")},jspb.internal.binary.readInt64StringMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readInt64,jspb.internal.binary.readString,0,"")},jspb.internal.binary.readInt64MessageMap=function(e,t,n,r,o){return module$contents$jspb$internal$binary_readMessageMapEntry(e,t,n,r,jspb.internal.binary.readInt64,0,o)},jspb.internal.binary.readInt64BytesMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readInt64,jspb.internal.binary.readBytes,0,module$exports$jspb$bytestring.ByteString.empty())},jspb.internal.binary.readInt64Uint32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readInt64,jspb.internal.binary.readUint32,0,0)},jspb.internal.binary.readInt64EnumMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readInt64,jspb.internal.binary.readEnum,0,0)},jspb.internal.binary.readInt64Sfixed32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readInt64,jspb.internal.binary.readSfixed32,0,0)},jspb.internal.binary.readInt64Sfixed64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readInt64,jspb.internal.binary.readSfixed64,0,0)},jspb.internal.binary.readInt64Sint32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readInt64,jspb.internal.binary.readSint32,0,0)},jspb.internal.binary.readInt64Sint64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readInt64,jspb.internal.binary.readSint64,0,0
2)},jspb.internal.binary.readUint64DoubleMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readUint64,jspb.internal.binary.readDouble,0,0)},jspb.internal.binary.readUint64FloatMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readUint64,jspb.internal.binary.readFloat,0,0)},jspb.internal.binary.readUint64Int64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readUint64,jspb.internal.binary.readInt64,0,0)},jspb.internal.binary.readUint64Uint64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readUint64,jspb.internal.binary.readUint64,0,0)},jspb.internal.binary.readUint64Int32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readUint64,jspb.internal.binary.readInt32,0,0)},jspb.internal.binary.readUint64Fixed64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readUint64,jspb.internal.binary.readFixed64,0,0)},jspb.internal.binary.readUint64Fixed32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readUint64,jspb.internal.binary.readFixed32,0,0)},jspb.internal.binary.readUint64BoolMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readUint64,jspb.internal.binary.readBool,0,!1)},jspb.internal.binary.readUint64StringRequireUtf8Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readUint64,jspb.internal.binary.readStringRequireUtf8,0,"")},jspb.internal.binary.readUint64StringMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readUint64,jspb.internal.binary.readString,0,"")},jspb.internal.binary.readUint64MessageMap=function(e,t,n,r,o){return module$contents$jspb$internal$binary_readMessageMapEntry(e,t,n,r,jspb.internal.binary.readUint64,0,o)},jspb.internal.binary.readUint64BytesMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readUint64,jspb.internal.binary.readBytes,0,module$exports$jspb$bytestring.ByteString.empty())},jspb.internal.binary.readUint64Uint32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readUint64,jspb.internal.binary.readUint32,0,0)},jspb.internal.binary.readUint64EnumMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readUint64,jspb.internal.binary.readEnum,0,0)},jspb.internal.binary.readUint64Sfixed32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readUint64,jspb.internal.binary.readSfixed32,0,0)},jspb.internal.binary.readUint64Sfixed64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readUint64,jspb.internal.binary.readSfixed64,0,0)},jspb.internal.binary.readUint64Sint32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readUint64,jspb.internal.binary.readSint32,0,0)},jspb.internal.binary.readUint64Sint64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readUint64,jspb.internal.binary.readSint64,0,0)},jspb.internal.binary.readInt32DoubleMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readInt32,jspb.internal.binary.readDouble,0,0)},jspb.internal.binary.readInt32FloatMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readInt32,jspb.internal.binary.readFloat,0,0)},jspb.internal.binary.readInt32Int64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readInt32,jspb.internal.binary.readInt64,0,0)},jspb.internal.binary.readInt32Uint64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readInt32,jspb.internal.binary.readUint64,0,0
2)},jspb.internal.binary.readInt32Int32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readInt32,jspb.internal.binary.readInt32,0,0)},jspb.internal.binary.readInt32Fixed64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readInt32,jspb.internal.binary.readFixed64,0,0)},jspb.internal.binary.readInt32Fixed32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readInt32,jspb.internal.binary.readFixed32,0,0)},jspb.internal.binary.readInt32BoolMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readInt32,jspb.internal.binary.readBool,0,!1)},jspb.internal.binary.readInt32StringRequireUtf8Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readInt32,jspb.internal.binary.readStringRequireUtf8,0,"")},jspb.internal.binary.readInt32StringMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readInt32,jspb.internal.binary.readString,0,"")},jspb.internal.binary.readInt32MessageMap=function(e,t,n,r,o){return module$contents$jspb$internal$binary_readMessageMapEntry(e,t,n,r,jspb.internal.binary.readInt32,0,o)},jspb.internal.binary.readInt32BytesMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readInt32,jspb.internal.binary.readBytes,0,module$exports$jspb$bytestring.ByteString.empty())},jspb.internal.binary.readInt32Uint32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readInt32,jspb.internal.binary.readUint32,0,0)},jspb.internal.binary.readInt32EnumMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readInt32,jspb.internal.binary.readEnum,0,0)},jspb.internal.binary.readInt32Sfixed32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readInt32,jspb.internal.binary.readSfixed32,0,0)},jspb.internal.binary.readInt32Sfixed64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readInt32,jspb.internal.binary.readSfixed64,0,0)},jspb.internal.binary.readInt32Sint32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readInt32,jspb.internal.binary.readSint32,0,0)},jspb.internal.binary.readInt32Sint64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readInt32,jspb.internal.binary.readSint64,0,0)},jspb.internal.binary.readFixed64DoubleMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readFixed64,jspb.internal.binary.readDouble,0,0)},jspb.internal.binary.readFixed64FloatMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readFixed64,jspb.internal.binary.readFloat,0,0)},jspb.internal.binary.readFixed64Int64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readFixed64,jspb.internal.binary.readInt64,0,0)},jspb.internal.binary.readFixed64Uint64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readFixed64,jspb.internal.binary.readUint64,0,0)},jspb.internal.binary.readFixed64Int32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readFixed64,jspb.internal.binary.readInt32,0,0)},jspb.internal.binary.readFixed64Fixed64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readFixed64,jspb.internal.binary.readFixed64,0,0)},jspb.internal.binary.readFixed64Fixed32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readFixed64,jspb.internal.binary.readFixed32,0,0)},jspb.internal.binary.readFixed64BoolMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readFixed64,jspb.internal.binary.readBool,0,!1)},jspb.internal.binary.readFixed64StringRequireUtf8Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readFixed64,jspb.internal.binary.readStringRequireUtf8,0,"")},jspb.internal.binary.readFixed64StringMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readFixed64,jspb.internal.binary.readString,0,"")},jspb.internal.binary.readFixed64MessageMap=function(e,t,n,r,o){return module$contents$jspb$internal$binary_readMessageMapEntry(e,t,n,r,jspb.internal.binary.readFixed64,0,o)},jspb.internal.binary.readFixed64BytesMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readFixed64,jspb.internal.binary.readBytes,0,module$exports$jspb$bytestring.ByteString.empty())},jspb.internal.binary.readFixed64Uint32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readFixed64,jspb.internal.binary.readUint32,0,0)},jspb.internal.binary.readFixed64EnumMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readFixed64,jspb.internal.binary.readEnum,0,0)},jspb.internal.binary.readFixed64Sfixed32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readFixed64,jspb.internal.binary.readSfixed32,0,0)},jspb.internal.binary.readFixed64Sfixed64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readFixed64,jspb.internal.binary.readSfixed64,0,0)},jspb.internal.binary.readFixed64Sint32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readFixed64,jspb.internal.binary.readSint32,0,0)},jspb.internal.binary.readFixed64Sint64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readFixed64,jspb.internal.binary.readSint64,0,0
2)},jspb.internal.binary.readFixed32DoubleMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readFixed32,jspb.internal.binary.readDouble,0,0)},jspb.internal.binary.readFixed32FloatMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readFixed32,jspb.internal.binary.readFloat,0,0)},jspb.internal.binary.readFixed32Int64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readFixed32,jspb.internal.binary.readInt64,0,0)},jspb.internal.binary.readFixed32Uint64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readFixed32,jspb.internal.binary.readUint64,0,0)},jspb.internal.binary.readFixed32Int32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readFixed32,jspb.internal.binary.readInt32,0,0)},jspb.internal.binary.readFixed32Fixed64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readFixed32,jspb.internal.binary.readFixed64,0,0)},jspb.internal.binary.readFixed32Fixed32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readFixed32,jspb.internal.binary.readFixed32,0,0)},jspb.internal.binary.readFixed32BoolMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readFixed32,jspb.internal.binary.readBool,0,!1)},jspb.internal.binary.readFixed32StringRequireUtf8Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readFixed32,jspb.internal.binary.readStringRequireUtf8,0,"")},jspb.internal.binary.readFixed32StringMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readFixed32,jspb.internal.binary.readString,0,"")},jspb.internal.binary.readFixed32MessageMap=function(e,t,n,r,o){return module$contents$jspb$internal$binary_readMessageMapEntry(e,t,n,r,jspb.internal.binary.readFixed32,0,o)},jspb.internal.binary.readFixed32BytesMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readFixed32,jspb.internal.binary.readBytes,0,module$exports$jspb$bytestring.ByteString.empty())},jspb.internal.binary.readFixed32Uint32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readFixed32,jspb.internal.binary.readUint32,0,0)},jspb.internal.binary.readFixed32EnumMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readFixed32,jspb.internal.binary.readEnum,0,0)},jspb.internal.binary.readFixed32Sfixed32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readFixed32,jspb.internal.binary.readSfixed32,0,0)},jspb.internal.binary.readFixed32Sfixed64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readFixed32,jspb.internal.binary.readSfixed64,0,0)},jspb.internal.binary.readFixed32Sint32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readFixed32,jspb.internal.binary.readSint32,0,0)},jspb.internal.binary.readFixed32Sint64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readFixed32,jspb.internal.binary.readSint64,0,0)},jspb.internal.binary.readBoolDoubleMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readBool,jspb.internal.binary.readDouble,!1,0)},jspb.internal.binary.readBoolFloatMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readBool,jspb.internal.binary.readFloat,!1,0)},jspb.internal.binary.readBoolInt64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readBool,jspb.internal.binary.readInt64,!1,0)},jspb.internal.binary.readBoolUint64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readBool,jspb.internal.binary.readUint64,!1,0)},jspb.internal.binary.readBoolInt32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readBool,jspb.internal.binary.readInt32,!1,0)},jspb.internal.binary.readBoolFixed64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readBool,jspb.internal.binary.readFixed64,!1,0)},jspb.internal.binary.readBoolFixed32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readBool,jspb.internal.binary.readFixed32,!1,0)},jspb.internal.binary.readBoolBoolMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readBool,jspb.internal.binary.readBool,!1,!1)},jspb.internal.binary.readBoolStringRequireUtf8Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readBool,jspb.internal.binary.readStringRequireUtf8,!1,"")},jspb.internal.binary.readBoolStringMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readBool,jspb.internal.binary.readString,!1,"")},jspb.internal.binary.readBoolMessageMap=function(e,t,n,r,o){return module$contents$jspb$internal$binary_readMessageMapEntry(e,t,n,r,jspb.internal.binary.readBool,!1,o)},jspb.internal.binary.readBoolBytesMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readBool,jspb.internal.binary.readBytes,!1,module$exports$jspb$bytestring.ByteString.empty())},jspb.internal.binary.readBoolUint32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readBool,jspb.internal.binary.readUint32,!1,0)},jspb.internal.binary.readBoolEnumMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readBool,jspb.internal.binary.readEnum,!1,0)},jspb.internal.binary.readBoolSfixed32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readBool,jspb.internal.binary.readSfixed32,!1,0)},jspb.internal.binary.readBoolSfixed64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readBool,jspb.internal.binary.readSfixed64,!1,0)},jspb.internal.binary.readBoolSint32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readBool,jspb.internal.binary.readSint32,!1,0)},jspb.internal.binary.readBoolSint64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readBool,jspb.internal.binary.readSint64,!1,0)},jspb.internal.binary.readStringRequireUtf8DoubleMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readStringRequireUtf8,jspb.internal.binary.readDouble,"",0)},jspb.internal.binary.readStringDoubleMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readString,jspb.internal.binary.readDouble,"",0)},jspb.internal.binary.readStringRequireUtf8FloatMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readStringRequireUtf8,jspb.internal.binary.readFloat,"",0)},jspb.internal.binary.readStringFloatMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readString,jspb.internal.binary.readFloat,"",0)},jspb.internal.binary.readStringRequireUtf8Int64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readStringRequireUtf8,jspb.internal.binary.readInt64,"",0)},jspb.internal.binary.readStringInt64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readString,jspb.internal.binary.readInt64,"",0)},jspb.internal.binary.readStringRequireUtf8Uint64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readStringRequireUtf8,jspb.internal.binary.readUint64,"",0)},jspb.internal.binary.readStringUint64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readString,jspb.internal.binary.readUint64,"",0)},jspb.internal.binary.readStringRequireUtf8Int32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readStringRequireUtf8,jspb.internal.binary.readInt32,"",0)},jspb.internal.binary.readStringInt32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readString,jspb.internal.binary.readInt32,"",0)},jspb.internal.binary.readStringRequireUtf8Fixed64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readStringRequireUtf8,jspb.internal.binary.readFixed64,"",0)},jspb.internal.binary.readStringFixed64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readString,jspb.internal.binary.readFixed64,"",0)},jspb.internal.binary.readStringRequireUtf8Fixed32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readStringRequireUtf8,jspb.internal.binary.readFixed32,"",0)},jspb.internal.binary.readStringFixed32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readString,jspb.internal.binary.readFixed32,"",0)},jspb.internal.binary.readStringRequireUtf8BoolMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readStringRequireUtf8,jspb.internal.binary.readBool,"",!1)},jspb.internal.binary.readStringBoolMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readString,jspb.internal.binary.readBool,"",!1)},jspb.internal.binary.readStringRequireUtf8StringRequireUtf8Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readStringRequireUtf8,jspb.internal.binary.readStringRequireUtf8,"","")},jspb.internal.binary.readStringStringMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readString,jspb.internal.binary.readString,"","")},jspb.internal.binary.readStringRequireUtf8MessageMap=function(e,t,n,r,o){return module$contents$jspb$internal$binary_readMessageMapEntry(e,t,n,r,jspb.internal.binary.readStringRequireUtf8,"",o)},jspb.internal.binary.readStringMessageMap=function(e,t,n,r,o){return module$contents$jspb$internal$binary_readMessageMapEntry(e,t,n,r,jspb.internal.binary.readString,"",o)},jspb.internal.binary.readStringRequireUtf8BytesMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readStringRequireUtf8,jspb.internal.binary.readBytes,"",module$exports$jspb$bytestring.ByteString.empty())},jspb.internal.binary.readStringBytesMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readString,jspb.internal.binary.readBytes,"",module$exports$jspb$bytestring.ByteString.empty())},jspb.internal.binary.readStringRequireUtf8Uint32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readStringRequireUtf8,jspb.internal.binary.readUint32,"",0)},jspb.internal.binary.readStringUint32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readString,jspb.internal.binary.readUint32,"",0)},jspb.internal.binary.readStringRequireUtf8EnumMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readStringRequireUtf8,jspb.internal.binary.readEnum,"",0)},jspb.internal.binary.readStringEnumMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readString,jspb.internal.binary.readEnum,"",0)},jspb.internal.binary.readStringRequireUtf8Sfixed32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readStringRequireUtf8,jspb.internal.binary.readSfixed32,"",0)},jspb.internal.binary.readStringSfixed32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readString,jspb.internal.binary.readSfixed32,"",0)},jspb.internal.binary.readStringRequireUtf8Sfixed64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readStringRequireUtf8,jspb.internal.binary.readSfixed64,"",0)},jspb.internal.binary.readStringSfixed64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readString,jspb.internal.binary.readSfixed64,"",0)},jspb.internal.binary.readStringRequireUtf8Sint32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readStringRequireUtf8,jspb.internal.binary.readSint32,"",0)},jspb.internal.binary.readStringSint32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readString,jspb.internal.binary.readSint32,"",0)},jspb.internal.binary.readStringRequireUtf8Sint64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readStringRequireUtf8,jspb.internal.binary.readSint64,"",0)},jspb.internal.binary.readStringSint64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readString,jspb.internal.binary.readSint64,"",0)},jspb.internal.binary.readUint32DoubleMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readUint32,jspb.internal.binary.readDouble,0,0)},jspb.internal.binary.readUint32FloatMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readUint32,jspb.internal.binary.readFloat,0,0)},jspb.internal.binary.readUint32Int64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readUint32,jspb.internal.binary.readInt64,0,0
2)},jspb.internal.binary.readUint32Uint64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readUint32,jspb.internal.binary.readUint64,0,0)},jspb.internal.binary.readUint32Int32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readUint32,jspb.internal.binary.readInt32,0,0)},jspb.internal.binary.readUint32Fixed64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readUint32,jspb.internal.binary.readFixed64,0,0)},jspb.internal.binary.readUint32Fixed32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readUint32,jspb.internal.binary.readFixed32,0,0)},jspb.internal.binary.readUint32BoolMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readUint32,jspb.internal.binary.readBool,0,!1)},jspb.internal.binary.readUint32StringRequireUtf8Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readUint32,jspb.internal.binary.readStringRequireUtf8,0,"")},jspb.internal.binary.readUint32StringMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readUint32,jspb.internal.binary.readString,0,"")},jspb.internal.binary.readUint32MessageMap=function(e,t,n,r,o){return module$contents$jspb$internal$binary_readMessageMapEntry(e,t,n,r,jspb.internal.binary.readUint32,0,o)},jspb.internal.binary.readUint32BytesMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readUint32,jspb.internal.binary.readBytes,0,module$exports$jspb$bytestring.ByteString.empty())},jspb.internal.binary.readUint32Uint32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readUint32,jspb.internal.binary.readUint32,0,0)},jspb.internal.binary.readUint32EnumMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readUint32,jspb.internal.binary.readEnum,0,0)},jspb.internal.binary.readUint32Sfixed32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readUint32,jspb.internal.binary.readSfixed32,0,0)},jspb.internal.binary.readUint32Sfixed64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readUint32,jspb.internal.binary.readSfixed64,0,0)},jspb.internal.binary.readUint32Sint32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readUint32,jspb.internal.binary.readSint32,0,0)},jspb.internal.binary.readUint32Sint64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readUint32,jspb.internal.binary.readSint64,0,0)},jspb.internal.binary.readSfixed32DoubleMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSfixed32,jspb.internal.binary.readDouble,0,0)},jspb.internal.binary.readSfixed32FloatMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSfixed32,jspb.internal.binary.readFloat,0,0)},jspb.internal.binary.readSfixed32Int64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSfixed32,jspb.internal.binary.readInt64,0,0)},jspb.internal.binary.readSfixed32Uint64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSfixed32,jspb.internal.binary.readUint64,0,0)},jspb.internal.binary.readSfixed32Int32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSfixed32,jspb.internal.binary.readInt32,0,0)},jspb.internal.binary.readSfixed32Fixed64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSfixed32,jspb.internal.binary.readFixed64,0,0)},jspb.internal.binary.readSfixed32Fixed32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSfixed32,jspb.internal.binary.readFixed32,0,0)},jspb.internal.binary.readSfixed32BoolMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSfixed32,jspb.internal.binary.readBool,0,!1)},jspb.internal.binary.readSfixed32StringRequireUtf8Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSfixed32,jspb.internal.binary.readStringRequireUtf8,0,"")},jspb.internal.binary.readSfixed32StringMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSfixed32,jspb.internal.binary.readString,0,"")},jspb.internal.binary.readSfixed32MessageMap=function(e,t,n,r,o){return module$contents$jspb$internal$binary_readMessageMapEntry(e,t,n,r,jspb.internal.binary.readSfixed32,0,o)},jspb.internal.binary.readSfixed32BytesMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSfixed32,jspb.internal.binary.readBytes,0,module$exports$jspb$bytestring.ByteString.empty())},jspb.internal.binary.readSfixed32Uint32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSfixed32,jspb.internal.binary.readUint32,0,0)},jspb.internal.binary.readSfixed32EnumMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSfixed32,jspb.internal.binary.readEnum,0,0)},jspb.internal.binary.readSfixed32Sfixed32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSfixed32,jspb.internal.binary.readSfixed32,0,0)},jspb.internal.binary.readSfixed32Sfixed64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSfixed32,jspb.internal.binary.readSfixed64,0,0)},jspb.internal.binary.readSfixed32Sint32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSfixed32,jspb.internal.binary.readSint32,0,0)},jspb.internal.binary.readSfixed32Sint64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSfixed32,jspb.internal.binary.readSint64,0,0
2)},jspb.internal.binary.readSfixed64DoubleMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSfixed64,jspb.internal.binary.readDouble,0,0)},jspb.internal.binary.readSfixed64FloatMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSfixed64,jspb.internal.binary.readFloat,0,0)},jspb.internal.binary.readSfixed64Int64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSfixed64,jspb.internal.binary.readInt64,0,0)},jspb.internal.binary.readSfixed64Uint64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSfixed64,jspb.internal.binary.readUint64,0,0)},jspb.internal.binary.readSfixed64Int32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSfixed64,jspb.internal.binary.readInt32,0,0)},jspb.internal.binary.readSfixed64Fixed64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSfixed64,jspb.internal.binary.readFixed64,0,0)},jspb.internal.binary.readSfixed64Fixed32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSfixed64,jspb.internal.binary.readFixed32,0,0)},jspb.internal.binary.readSfixed64BoolMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSfixed64,jspb.internal.binary.readBool,0,!1)},jspb.internal.binary.readSfixed64StringRequireUtf8Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSfixed64,jspb.internal.binary.readStringRequireUtf8,0,"")},jspb.internal.binary.readSfixed64StringMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSfixed64,jspb.internal.binary.readString,0,"")},jspb.internal.binary.readSfixed64MessageMap=function(e,t,n,r,o){return module$contents$jspb$internal$binary_readMessageMapEntry(e,t,n,r,jspb.internal.binary.readSfixed64,0,o)},jspb.internal.binary.readSfixed64BytesMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSfixed64,jspb.internal.binary.readBytes,0,module$exports$jspb$bytestring.ByteString.empty())},jspb.internal.binary.readSfixed64Uint32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSfixed64,jspb.internal.binary.readUint32,0,0)},jspb.internal.binary.readSfixed64EnumMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSfixed64,jspb.internal.binary.readEnum,0,0)},jspb.internal.binary.readSfixed64Sfixed32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSfixed64,jspb.internal.binary.readSfixed32,0,0)},jspb.internal.binary.readSfixed64Sfixed64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSfixed64,jspb.internal.binary.readSfixed64,0,0)},jspb.internal.binary.readSfixed64Sint32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSfixed64,jspb.internal.binary.readSint32,0,0)},jspb.internal.binary.readSfixed64Sint64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSfixed64,jspb.internal.binary.readSint64,0,0)},jspb.internal.binary.readSint32DoubleMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSint32,jspb.internal.binary.readDouble,0,0)},jspb.internal.binary.readSint32FloatMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSint32,jspb.internal.binary.readFloat,0,0)},jspb.internal.binary.readSint32Int64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSint32,jspb.internal.binary.readInt64,0,0
2)},jspb.internal.binary.readSint32Uint64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSint32,jspb.internal.binary.readUint64,0,0)},jspb.internal.binary.readSint32Int32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSint32,jspb.internal.binary.readInt32,0,0)},jspb.internal.binary.readSint32Fixed64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSint32,jspb.internal.binary.readFixed64,0,0)},jspb.internal.binary.readSint32Fixed32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSint32,jspb.internal.binary.readFixed32,0,0)},jspb.internal.binary.readSint32BoolMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSint32,jspb.internal.binary.readBool,0,!1)},jspb.internal.binary.readSint32StringRequireUtf8Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSint32,jspb.internal.binary.readStringRequireUtf8,0,"")},jspb.internal.binary.readSint32StringMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSint32,jspb.internal.binary.readString,0,"")},jspb.internal.binary.readSint32MessageMap=function(e,t,n,r,o){return module$contents$jspb$internal$binary_readMessageMapEntry(e,t,n,r,jspb.internal.binary.readSint32,0,o)},jspb.internal.binary.readSint32BytesMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSint32,jspb.internal.binary.readBytes,0,module$exports$jspb$bytestring.ByteString.empty())},jspb.internal.binary.readSint32Uint32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSint32,jspb.internal.binary.readUint32,0,0)},jspb.internal.binary.readSint32EnumMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSint32,jspb.internal.binary.readEnum,0,0)},jspb.internal.binary.readSint32Sfixed32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSint32,jspb.internal.binary.readSfixed32,0,0)},jspb.internal.binary.readSint32Sfixed64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSint32,jspb.internal.binary.readSfixed64,0,0)},jspb.internal.binary.readSint32Sint32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSint32,jspb.internal.binary.readSint32,0,0)},jspb.internal.binary.readSint32Sint64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSint32,jspb.internal.binary.readSint64,0,0)},jspb.internal.binary.readSint64DoubleMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSint64,jspb.internal.binary.readDouble,0,0)},jspb.internal.binary.readSint64FloatMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSint64,jspb.internal.binary.readFloat,0,0)},jspb.internal.binary.readSint64Int64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSint64,jspb.internal.binary.readInt64,0,0)},jspb.internal.binary.readSint64Uint64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSint64,jspb.internal.binary.readUint64,0,0)},jspb.internal.binary.readSint64Int32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSint64,jspb.internal.binary.readInt32,0,0)},jspb.internal.binary.readSint64Fixed64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSint64,jspb.internal.binary.readFixed64,0,0)},jspb.internal.binary.readSint64Fixed32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSint64,jspb.internal.binary.readFixed32,0,0)},jspb.internal.binary.readSint64BoolMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSint64,jspb.internal.binary.readBool,0,!1)},jspb.internal.binary.readSint64StringRequireUtf8Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSint64,jspb.internal.binary.readStringRequireUtf8,0,"")},jspb.internal.binary.readSint64StringMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSint64,jspb.internal.binary.readString,0,"")},jspb.internal.binary.readSint64MessageMap=function(e,t,n,r,o){return module$contents$jspb$internal$binary_readMessageMapEntry(e,t,n,r,jspb.internal.binary.readSint64,0,o)},jspb.internal.binary.readSint64BytesMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSint64,jspb.internal.binary.readBytes,0,module$exports$jspb$bytestring.ByteString.empty())},jspb.internal.binary.readSint64Uint32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSint64,jspb.internal.binary.readUint32,0,0)},jspb.internal.binary.readSint64EnumMap=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSint64,jspb.internal.binary.readEnum,0,0)},jspb.internal.binary.readSint64Sfixed32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSint64,jspb.internal.binary.readSfixed32,0,0)},jspb.internal.binary.readSint64Sfixed64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSint64,jspb.internal.binary.readSfixed64,0,0)},jspb.internal.binary.readSint64Sint32Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSint64,jspb.internal.binary.readSint32,0,0)},jspb.internal.binary.readSint64Sint64Map=function(e,t,n){return module$contents$jspb$internal$binary_readMapEntry(e,t,n,jspb.internal.binary.readSint64,jspb.internal.binary.readSint64,0,0
2)},jspb.internal.public_for_gencode={};var module$contents$jspb$internal$public_for_gencode_GENERATE_FROM_OBJECT=!goog.DISALLOW_TEST_ONLY_CODE;function module$contents$jspb$internal$public_for_gencode_toObjectList(e,t,n){for(var r=[],o=0;o<e.length;o++)r.push(t(n,e[o]));return r}function module$contents$jspb$internal$public_for_gencode_assertConsistentTypes(e){if(goog.DEBUG&&e&&1<e.length){var t=goog.typeOf(e[0]);module$contents$goog$array_forEach(e,function(e){goog.typeOf(e)!=t&&goog.asserts.fail("Inconsistent type in JSPB repeated field array. Got "+goog.typeOf(e)+" expected "+t)})}}function module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(e){return null===e?void 0:e}var module$contents$jspb$internal$public_for_gencode_GeneratedMessageImpl=function(){module$exports$jspb.Message.apply(this,arguments)};$jscomp.inherits(module$contents$jspb$internal$public_for_gencode_GeneratedMessageImpl,module$exports$jspb.Message),goog.asserts.ENABLE_ASSERTS&&(module$contents$jspb$internal$public_for_gencode_GeneratedMessageImpl.prototype[module$exports$jspb$internal.GENERATED_SUBCLASS_MARKER]=!0);var module$contents$jspb$internal$public_for_gencode_GeneratedMessage=goog.asserts.ENABLE_ASSERTS?module$contents$jspb$internal$public_for_gencode_GeneratedMessageImpl:module$exports$jspb.Message;jspb.internal.public_for_gencode.GENERATE_FROM_OBJECT=module$contents$jspb$internal$public_for_gencode_GENERATE_FROM_OBJECT,jspb.internal.public_for_gencode.GENERATE_TO_OBJECT=!0,jspb.internal.public_for_gencode.GeneratedMessage=module$contents$jspb$internal$public_for_gencode_GeneratedMessage,jspb.internal.public_for_gencode.bytesAsB64=module$contents$jspb$internal_bytesAsB64,jspb.internal.public_for_gencode.bytesAsU8=module$contents$jspb$internal_bytesAsU8,jspb.internal.public_for_gencode.bytesListAsB64=function(e){return module$contents$jspb$internal$public_for_gencode_assertConsistentTypes(e),e.length&&"string"!=typeof e[0]?module$contents$goog$array_map(e,module$contents$jspb$internal_bytesAsB64):e},jspb.internal.public_for_gencode.bytesListAsU8=function(e){return module$contents$jspb$internal$public_for_gencode_assertConsistentTypes(e),!e.length||e[0]instanceof Uint8Array?e:module$contents$goog$array_map(e,module$contents$jspb$internal_bytesAsU8)},jspb.internal.public_for_gencode.createMessageExtension=function(e,t,n,r,o){return new module$contents$jspb$extension_field_info_ExtensionFieldInfo(e,t,n,r,void 0===o?0:o)},jspb.internal.public_for_gencode.createPrimitiveExtension=function(e,t,n){return new module$contents$jspb$extension_field_info_ExtensionFieldInfo(e,t,null,null,void 0===n?0:n)},jspb.internal.public_for_gencode.mapFromObject=function(e,t,n){for(var r=0;r<t.length;r++){var o=t[r][0],i=n(t[r][1]);e.set(o,i)}return e},jspb.internal.public_for_gencode.mapToObject=function(e,t,n){var r=[];return e.forEach(function(e,o){r.push([o,n?n(t,e):e])}),r},jspb.internal.public_for_gencode.toObjectExtension=function(e,t,n,r){for(var o in n)if(module$contents$jspb$internal_hasOwnPropertyIfNotTrusted(n,o)){var i=n[o],a=e.getExtension(i);if(null!=a){var s=void 0;for(s in i.fieldName)if(i.fieldName.hasOwnProperty(s))break;var l=i.toObjectFn;t[s]=l?i.isRepeated?module$contents$jspb$internal$public_for_gencode_toObjectList(a,l,r):l(r,a):a}}},jspb.internal.public_for_gencode.toObjectList=module$contents$jspb$internal$public_for_gencode_toObjectList,jspb.internal.public_for_gencode.toObjectPrimitive=module$contents$jspb$internal$public_for_gencode_toObjectPrimitive,jspb.internal.public_for_gencode.toObjectAnyValue=function(e){if(null==(e=e.internal_getField(2)))return"";if("string"==typeof e)return e;if(module$contents$jspb$internal_bytes_isU8(e))return goog.crypt.base64.encodeByteArray(e);if(Array.isArray(e))return module$contents$jspb$internal_copy_cloneJspbObjectInternal(e,module$contents$jspb$internal_copy_convertToJspbFormat);throw Error("invalid value in Any.value field: "+e)},jspb.internal.public_for_gencode.fromObjectAnyValue=function(e,t){if(null!=t)if("string"==typeof t)t.length&&e.internal_setField(2,t);else{if(!Array.isArray(t))throw Error("invalid value in Any.value field: "+t);e.internal_setField(2,module$contents$jspb$internal_copy_cloneJspbObjectInternal(t,module$contents$jspb$internal_copy_convertToJspbFormat))}},jspb.internal.public_for_gencode.packAnyValueBinary=function(e,t){return goog.asserts.assertInstanceof(e,module$exports$jspb.Message),e.internal_setProto3BytesField(2,module$contents$jspb$utils_byteSourceToUint8Array(t)),e},jspb.Message=module$exports$jspb.Message;var proto={acceleration:{}};function module$contents$goog$object_getKeys(e){var t,n=[],r=0;for(t in e)n[r++]=t;return n}function module$contents$goog$object_containsValue(e,t){for(var n in e)if(e[n]==t)return!0;return!1}function module$contents$goog$object_findKey(e,t,n){for(var r in e)if(t.call(n,e[r],r,e))return r}function module$contents$goog$object_unsafeClone(e){if(!e||"object"!=typeof e)return e;if("function"==typeof e.clone)return e.clone();if("undefined"!=typeof Map&&e instanceof Map)return new Map(e);if("undefined"!=typeof Set&&e instanceof Set)return new Set(e);var t,n=Array.isArray(e)?[]:"function"!=typeof ArrayBuffer||"function"!=typeof ArrayBuffer.isView||!ArrayBuffer.isView(e)||e instanceof DataView?{}:new e.constructor(e.length);for(t in e)n[t]=module$contents$goog$object_unsafeClone(e[t]);return n}proto.acceleration.ModelIdentifier=function(e){module$contents$jspb$internal$public_for_gencode_GeneratedMessage.call(this,e)},$jscomp.inherits(proto.acceleration.ModelIdentifier,module$contents$jspb$internal$public_for_gencode_GeneratedMessage),proto.acceleration.ModelIdentifier.prototype.getModelFingerprint=function(){return this.internal_getField(1)},proto.acceleration.ModelIdentifier.prototype.setModelFingerprint=function(e){return this.internal_setField(1,e)},proto.acceleration.ModelIdentifier.prototype.clearModelFingerprint=function(){return this.internal_clearField(1)},proto.acceleration.ModelIdentifier.prototype.hasModelFingerprint=function(){return this.internal_hasField(1)},proto.acceleration.ModelIdentifier.prototype.getModelId=function(){return this.internal_getField(2)},proto.acceleration.ModelIdentifier.prototype.setModelId=function(e){return this.internal_setField(2,e)},proto.acceleration.ModelIdentifier.prototype.clearModelId=function(){return this.internal_clearField(2)},proto.acceleration.ModelIdentifier.prototype.hasModelId=function(){return this.internal_hasField(2)},proto.acceleration.ModelIdentifier.internalDoNotUse$proto$acceleration$ModelIdentifier$getBinaryFieldsObject=function(){return{1:jspb.internal.binary.readString,2:jspb.internal.binary.readString}},proto.acceleration.ModelIdentifier.prototype.serializeBinary=function(){return jspb.internal.binary.serializeBinary(this,proto.acceleration.ModelIdentifier.serializeBinaryToWriter)},proto.acceleration.ModelIdentifier.serializeBinaryToWriter=function(e,t){jspb.internal.binary.writeString(t,e,1),jspb.internal.binary.writeString(t,e,2),jspb.internal.binary.serializeBinaryExtensionsAndUnknownFields(e,t)},proto.acceleration.ModelIdentifier.deserializeBinary=function(e){return jspb.internal.binary.deserializeBinary(e,proto.acceleration.ModelIdentifier,proto.acceleration.ModelIdentifier.internalDoNotUse$proto$acceleration$ModelIdentifier$getBinaryFieldsObject)},proto.acceleration.ModelIdentifier.deserializeBinaryFromReader=function(e,t){return module$contents$jspb$internal$binary_deserializeBinaryFromReaderGeneric(e,t,proto.acceleration.ModelIdentifier.internalDoNotUse$proto$acceleration$ModelIdentifier$getBinaryFieldsObject)},proto.acceleration.ModelIdentifier.deserialize=function(e){return module$exports$jspb.Message.deserializeWithCtor(proto.acceleration.ModelIdentifier,e)},proto.acceleration.ModelIdentifier.ObjectFormat=function(){},module$contents$jspb$internal$public_for_gencode_GENERATE_FROM_OBJECT&&(proto.acceleration.ModelIdentifier.fromObject=function(e){var t=new proto.acceleration.ModelIdentifier;return null!=e.modelFingerprint&&t.internal_setField(1,e.modelFingerprint),null!=e.modelId&&t.internal_setField(2,e.modelId),t}),proto.acceleration.ModelIdentifier.prototype.toObject=function(e){return proto.acceleration.ModelIdentifier.internal_toObject(e,this)},proto.acceleration.ModelIdentifier.internal_toObject=function(e,t){if(null!=t){var n={modelFingerprint:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(1)),modelId:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(2))};return e&&(n.$jspbMessageInstance=t),n}},proto.acceleration.InferenceToUseFor=function(e){module$contents$jspb$internal$public_for_gencode_GeneratedMessage.call(this,e)},$jscomp.inherits(proto.acceleration.InferenceToUseFor,module$contents$jspb$internal$public_for_gencode_GeneratedMessage),proto.acceleration.InferenceToUseFor.prototype.getModelNamespace=function(){return this.internal_getField(1)},proto.acceleration.InferenceToUseFor.prototype.setModelNamespace=function(e){return this.internal_setField(1,e)},proto.acceleration.InferenceToUseFor.prototype.clearModelNamespace=function(){return this.internal_clearField(1)},proto.acceleration.InferenceToUseFor.prototype.hasModelNamespace=function(){return this.internal_hasField(1)},proto.acceleration.InferenceToUseFor.prototype.getModel=function(){return this.internal_getWrapperField(proto.acceleration.ModelIdentifier,2)},proto.acceleration.InferenceToUseFor.prototype.setModel=function(e){return this.internal_setWrapperField(2,e)},proto.acceleration.InferenceToUseFor.prototype.clearModel=function(){return this.internal_clearWrapperField(2)},proto.acceleration.InferenceToUseFor.prototype.hasModel=function(){return this.internal_hasField(2)},proto.acceleration.InferenceToUseFor.internalDoNotUse$proto$acceleration$InferenceToUseFor$getBinaryFieldsObject=function(){return{1:jspb.internal.binary.readString,2:[jspb.internal.binary.readMessage,proto.acceleration.ModelIdentifier,proto.acceleration.ModelIdentifier.internalDoNotUse$proto$acceleration$ModelIdentifier$getBinaryFieldsObject]}},proto.acceleration.InferenceToUseFor.prototype.serializeBinary=function(){return jspb.internal.binary.serializeBinary(this,proto.acceleration.InferenceToUseFor.serializeBinaryToWriter)},proto.acceleration.InferenceToUseFor.serializeBinaryToWriter=function(e,t){jspb.internal.binary.writeString(t,e,1),jspb.internal.binary.writeMessage(t,e,2,proto.acceleration.ModelIdentifier,proto.acceleration.ModelIdentifier.serializeBinaryToWriter),jspb.internal.binary.serializeBinaryExtensionsAndUnknownFields(e,t)},proto.acceleration.InferenceToUseFor.deserializeBinary=function(e){return jspb.internal.binary.deserializeBinary(e,proto.acceleration.InferenceToUseFor,proto.acceleration.InferenceToUseFor.internalDoNotUse$proto$acceleration$InferenceToUseFor$getBinaryFieldsObject)},proto.acceleration.InferenceToUseFor.deserializeBinaryFromReader=function(e,t){return module$contents$jspb$internal$binary_deserializeBinaryFromReaderGeneric(e,t,proto.acceleration.InferenceToUseFor.internalDoNotUse$proto$acceleration$InferenceToUseFor$getBinaryFieldsObject)},proto.acceleration.InferenceToUseFor.deserialize=function(e){return module$exports$jspb.Message.deserializeWithCtor(proto.acceleration.InferenceToUseFor,e)},proto.acceleration.InferenceToUseFor.ObjectFormat=function(){},module$contents$jspb$internal$public_for_gencode_GENERATE_FROM_OBJECT&&(proto.acceleration.InferenceToUseFor.fromObject=function(e){var t=new proto.acceleration.InferenceToUseFor;return null!=e.modelNamespace&&t.internal_setField(1,e.modelNamespace),e.model&&t.internal_setWrapperField(2,proto.acceleration.ModelIdentifier.fromObject(e.model)),t}),proto.acceleration.InferenceToUseFor.prototype.toObject=function(e){return proto.acceleration.InferenceToUseFor.internal_toObject(e,this)},proto.acceleration.InferenceToUseFor.internal_toObject=function(e,t){if(null!=t){var n={modelNamespace:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(1)),model:proto.acceleration.ModelIdentifier.internal_toObject(e,t.getModel())};return e&&(n.$jspbMessageInstance=t),n}},proto.acceleration.BenchmarkStoragePaths=function(e){module$contents$jspb$internal$public_for_gencode_GeneratedMessage.call(this,e)},$jscomp.inherits(proto.acceleration.BenchmarkStoragePaths,module$contents$jspb$internal$public_for_gencode_GeneratedMessage),proto.acceleration.BenchmarkStoragePaths.prototype.getStorageFilePath=function(){return this.internal_getField(1)},proto.acceleration.BenchmarkStoragePaths.prototype.setStorageFilePath=function(e){return this.internal_setField(1,e)},proto.acceleration.BenchmarkStoragePaths.prototype.clearStorageFilePath=function(){return this.internal_clearField(1)},proto.acceleration.BenchmarkStoragePaths.prototype.hasStorageFilePath=function(){return this.internal_hasField(1)},proto.acceleration.BenchmarkStoragePaths.prototype.getDataDirectoryPath=function(){return this.internal_getField(2)},proto.acceleration.BenchmarkStoragePaths.prototype.setDataDirectoryPath=function(e){return this.internal_setField(2,e)},proto.acceleration.BenchmarkStoragePaths.prototype.clearDataDirectoryPath=function(){return this.internal_clearField(2)},proto.acceleration.BenchmarkStoragePaths.prototype.hasDataDirectoryPath=function(){return this.internal_hasField(2)},proto.acceleration.BenchmarkStoragePaths.internalDoNotUse$proto$acceleration$BenchmarkStoragePaths$getBinaryFieldsObject=function(){return{1:jspb.internal.binary.readString,2:jspb.internal.binary.readString}},proto.acceleration.BenchmarkStoragePaths.prototype.serializeBinary=function(){return jspb.internal.binary.serializeBinary(this,proto.acceleration.BenchmarkStoragePaths.serializeBinaryToWriter)},proto.acceleration.BenchmarkStoragePaths.serializeBinaryToWriter=function(e,t){jspb.internal.binary.writeString(t,e,1),jspb.internal.binary.writeString(t,e,2),jspb.internal.binary.serializeBinaryExtensionsAndUnknownFields(e,t)},proto.acceleration.BenchmarkStoragePaths.deserializeBinary=function(e){return jspb.internal.binary.deserializeBinary(e,proto.acceleration.BenchmarkStoragePaths,proto.acceleration.BenchmarkStoragePaths.internalDoNotUse$proto$acceleration$BenchmarkStoragePaths$getBinaryFieldsObject)},proto.acceleration.BenchmarkStoragePaths.deserializeBinaryFromReader=function(e,t){return module$contents$jspb$internal$binary_deserializeBinaryFromReaderGeneric(e,t,proto.acceleration.BenchmarkStoragePaths.internalDoNotUse$proto$acceleration$BenchmarkStoragePaths$getBinaryFieldsObject)},proto.acceleration.BenchmarkStoragePaths.deserialize=function(e){return module$exports$jspb.Message.deserializeWithCtor(proto.acceleration.BenchmarkStoragePaths,e)},proto.acceleration.BenchmarkStoragePaths.ObjectFormat=function(){},module$contents$jspb$internal$public_for_gencode_GENERATE_FROM_OBJECT&&(proto.acceleration.BenchmarkStoragePaths.fromObject=function(e){var t=new proto.acceleration.BenchmarkStoragePaths;return null!=e.storageFilePath&&t.internal_setField(1,e.storageFilePath),null!=e.dataDirectoryPath&&t.internal_setField(2,e.dataDirectoryPath),t}),proto.acceleration.BenchmarkStoragePaths.prototype.toObject=function(e){return proto.acceleration.BenchmarkStoragePaths.internal_toObject(e,this)},proto.acceleration.BenchmarkStoragePaths.internal_toObject=function(e,t){if(null!=t){var n={storageFilePath:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(1)),dataDirectoryPath:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(2))};return e&&(n.$jspbMessageInstance=t),n}},proto.acceleration.ModelFile=function(e){module$contents$jspb$internal$public_for_gencode_GeneratedMessage.call(this,e)},$jscomp.inherits(proto.acceleration.ModelFile,module$contents$jspb$internal$public_for_gencode_GeneratedMessage),proto.acceleration.ModelFile.prototype.getFilename=function(){return this.internal_getField(1)},proto.acceleration.ModelFile.prototype.setFilename=function(e){return this.internal_setField(1,e)},proto.acceleration.ModelFile.prototype.clearFilename=function(){return this.internal_clearField(1)},proto.acceleration.ModelFile.prototype.hasFilename=function(){return this.internal_hasField(1)},proto.acceleration.ModelFile.prototype.getFd=function(){return this.internal_getField(2)},proto.acceleration.
2ModelFile.prototype.setFd=function(e){return this.internal_setField(2,e)},proto.acceleration.ModelFile.prototype.clearFd=function(){return this.internal_clearField(2)},proto.acceleration.ModelFile.prototype.hasFd=function(){return this.internal_hasField(2)},proto.acceleration.ModelFile.prototype.getOffset=function(){return this.internal_getField(3)},proto.acceleration.ModelFile.prototype.setOffset=function(e){return this.internal_setField(3,e)},proto.acceleration.ModelFile.prototype.clearOffset=function(){return this.internal_clearField(3)},proto.acceleration.ModelFile.prototype.hasOffset=function(){return this.internal_hasField(3)},proto.acceleration.ModelFile.prototype.getLength=function(){return this.internal_getField(4)},proto.acceleration.ModelFile.prototype.setLength=function(e){return this.internal_setField(4,e)},proto.acceleration.ModelFile.prototype.clearLength=function(){return this.internal_clearField(4)},proto.acceleration.ModelFile.prototype.hasLength=function(){return this.internal_hasField(4)},proto.acceleration.ModelFile.internalDoNotUse$proto$acceleration$ModelFile$getBinaryFieldsObject=function(){return{1:jspb.internal.binary.readString,2:jspb.internal.binary.readInt64,3:jspb.internal.binary.readInt64,4:jspb.internal.binary.readInt64}},proto.acceleration.ModelFile.prototype.serializeBinary=function(){return jspb.internal.binary.serializeBinary(this,proto.acceleration.ModelFile.serializeBinaryToWriter)},proto.acceleration.ModelFile.serializeBinaryToWriter=function(e,t){jspb.internal.binary.writeString(t,e,1),jspb.internal.binary.writeInt64(t,e,2),jspb.internal.binary.writeInt64(t,e,3),jspb.internal.binary.writeInt64(t,e,4),jspb.internal.binary.serializeBinaryExtensionsAndUnknownFields(e,t)},proto.acceleration.ModelFile.deserializeBinary=function(e){return jspb.internal.binary.deserializeBinary(e,proto.acceleration.ModelFile,proto.acceleration.ModelFile.internalDoNotUse$proto$acceleration$ModelFile$getBinaryFieldsObject)},proto.acceleration.ModelFile.deserializeBinaryFromReader=function(e,t){return module$contents$jspb$internal$binary_deserializeBinaryFromReaderGeneric(e,t,proto.acceleration.ModelFile.internalDoNotUse$proto$acceleration$ModelFile$getBinaryFieldsObject)},proto.acceleration.ModelFile.deserialize=function(e){return module$exports$jspb.Message.deserializeWithCtor(proto.acceleration.ModelFile,e)},proto.acceleration.ModelFile.ObjectFormat=function(){},module$contents$jspb$internal$public_for_gencode_GENERATE_FROM_OBJECT&&(proto.acceleration.ModelFile.fromObject=function(e){var t=new proto.acceleration.ModelFile;return null!=e.filename&&t.internal_setField(1,e.filename),null!=e.fd&&t.internal_setField(2,e.fd),null!=e.offset&&t.internal_setField(3,e.offset),null!=e.length&&t.internal_setField(4,e.length),t}),proto.acceleration.ModelFile.prototype.toObject=function(e){return proto.acceleration.ModelFile.internal_toObject(e,this)},proto.acceleration.ModelFile.internal_toObject=function(e,t){if(null!=t){var n={filename:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(1)),fd:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(2)),offset:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(3)),length:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(4))};return e&&(n.$jspbMessageInstance=t),n}},proto.acceleration.CPUSettings=function(e){module$contents$jspb$internal$public_for_gencode_GeneratedMessage.call(this,e)},$jscomp.inherits(proto.acceleration.CPUSettings,module$contents$jspb$internal$public_for_gencode_GeneratedMessage),proto.acceleration.CPUSettings.prototype.getNumThreads=function(){return this.internal_getIntegerFieldWithDefault(1,-1)},proto.acceleration.CPUSettings.prototype.setNumThreads=function(e){return this.internal_setField(1,e)},proto.acceleration.CPUSettings.prototype.clearNumThreads=function(){return this.internal_clearField(1)},proto.acceleration.CPUSettings.prototype.hasNumThreads=function(){return this.internal_hasField(1)},proto.acceleration.CPUSettings.internalDoNotUse$proto$acceleration$CPUSettings$getBinaryFieldsObject=function(){return{1:jspb.internal.binary.readInt32}},proto.acceleration.CPUSettings.prototype.serializeBinary=function(){return jspb.internal.binary.serializeBinary(this,proto.acceleration.CPUSettings.serializeBinaryToWriter)},proto.acceleration.CPUSettings.serializeBinaryToWriter=function(e,t){jspb.internal.binary.writeInt32(t,e,1),jspb.internal.binary.serializeBinaryExtensionsAndUnknownFields(e,t)},proto.acceleration.CPUSettings.deserializeBinary=function(e){return jspb.internal.binary.deserializeBinary(e,proto.acceleration.CPUSettings,proto.acceleration.CPUSettings.internalDoNotUse$proto$acceleration$CPUSettings$getBinaryFieldsObject)},proto.acceleration.CPUSettings.deserializeBinaryFromReader=function(e,t){return module$contents$jspb$internal$binary_deserializeBinaryFromReaderGeneric(e,t,proto.acceleration.CPUSettings.internalDoNotUse$proto$acceleration$CPUSettings$getBinaryFieldsObject)},proto.acceleration.CPUSettings.deserialize=function(e){return module$exports$jspb.Message.deserializeWithCtor(proto.acceleration.CPUSettings,e)},proto.acceleration.CPUSettings.ObjectFormat=function(){},module$contents$jspb$internal$public_for_gencode_GENERATE_FROM_OBJECT&&(proto.acceleration.CPUSettings.fromObject=function(e){var t=new proto.acceleration.CPUSettings;return null!=e.numThreads&&t.internal_setField(1,e.numThreads),t}),proto.acceleration.CPUSettings.prototype.toObject=function(e){return proto.acceleration.CPUSettings.internal_toObject(e,this)},proto.acceleration.CPUSettings.internal_toObject=function(e,t){if(null!=t){var n={numThreads:t.internal_getIntegerFieldWithDefault(1,-1)};return e&&(n.$jspbMessageInstance=t),n}},proto.acceleration.CoralDelegateSettings=function(e){module$contents$jspb$internal$public_for_gencode_GeneratedMessage.call(this,e)},$jscomp.inherits(proto.acceleration.CoralDelegateSettings,module$contents$jspb$internal$public_for_gencode_GeneratedMessage),proto.acceleration.CoralDelegateSettings.prototype.getDevice=function(){return this.internal_getField(1)},proto.acceleration.CoralDelegateSettings.prototype.setDevice=function(e){return this.internal_setField(1,e)},proto.acceleration.CoralDelegateSettings.prototype.clearDevice=function(){return this.internal_clearField(1)},proto.acceleration.CoralDelegateSettings.prototype.hasDevice=function(){return this.internal_hasField(1)},proto.acceleration.CoralDelegateSettings.prototype.getPerformance=function(){return this.internal_getFieldWithDefault(2,1)},proto.acceleration.CoralDelegateSettings.prototype.setPerformance=function(e){return this.internal_setField(2,e)},proto.acceleration.CoralDelegateSettings.prototype.clearPerformance=function(){return this.internal_clearField(2)},proto.acceleration.CoralDelegateSettings.prototype.hasPerformance=function(){return this.internal_hasField(2)},proto.acceleration.CoralDelegateSettings.prototype.getUsbAlwaysDfu=function(){return this.internal_getBooleanField(3)},proto.acceleration.CoralDelegateSettings.prototype.setUsbAlwaysDfu=function(e){return this.internal_setField(3,e)},proto.acceleration.CoralDelegateSettings.prototype.clearUsbAlwaysDfu=function(){return this.internal_clearField(3)},proto.acceleration.CoralDelegateSettings.prototype.hasUsbAlwaysDfu=function(){return this.internal_hasField(3)},proto.acceleration.CoralDelegateSettings.prototype.getUsbMaxBulkInQueueLength=function(){return this.internal_getField(4)},proto.acceleration.CoralDelegateSettings.prototype.setUsbMaxBulkInQueueLength=function(e){return this.internal_setField(4,e)},proto.acceleration.CoralDelegateSettings.prototype.clearUsbMaxBulkInQueueLength=function(){return this.internal_clearField(4)},proto.acceleration.CoralDelegateSettings.prototype.hasUsbMaxBulkInQueueLength=function(){return this.internal_hasField(4)},proto.acceleration.CoralDelegateSettings.internalDoNotUse$proto$acceleration$CoralDelegateSettings$getBinaryFieldsObject=function(){return{1:jspb.internal.binary.readString,2:jspb.internal.binary.readEnum,3:jspb.internal.binary.readBool,4:jspb.internal.binary.readInt32}},proto.acceleration.CoralDelegateSettings.prototype.serializeBinary=function(){return jspb.internal.binary.serializeBinary(this,proto.acceleration.CoralDelegateSettings.serializeBinaryToWriter)},proto.acceleration.CoralDelegateSettings.serializeBinaryToWriter=function(e,t){jspb.internal.binary.writeString(t,e,1),jspb.internal.binary.writeEnum(t,e,2),jspb.internal.binary.writeBool(t,e,3),jspb.internal.binary.writeInt32(t,e,4),jspb.internal.binary.serializeBinaryExtensionsAndUnknownFields(e,t)},proto.acceleration.CoralDelegateSettings.deserializeBinary=function(e){return jspb.internal.binary.deserializeBinary(e,proto.acceleration.CoralDelegateSettings,proto.acceleration.CoralDelegateSettings.internalDoNotUse$proto$acceleration$CoralDelegateSettings$getBinaryFieldsObject)},proto.acceleration.CoralDelegateSettings.deserializeBinaryFromReader=function(e,t){return module$contents$jspb$internal$binary_deserializeBinaryFromReaderGeneric(e,t,proto.acceleration.CoralDelegateSettings.internalDoNotUse$proto$acceleration$CoralDelegateSettings$getBinaryFieldsObject)},proto.acceleration.CoralDelegateSettings.deserialize=function(e){return module$exports$jspb.Message.deserializeWithCtor(proto.acceleration.CoralDelegateSettings,e)},proto.acceleration.CoralDelegateSettings.ObjectFormat=function(){},module$contents$jspb$internal$public_for_gencode_GENERATE_FROM_OBJECT&&(proto.acceleration.CoralDelegateSettings.fromObject=function(e){var t=new proto.acceleration.CoralDelegateSettings;return null!=e.device&&t.internal_setField(1,e.device),null!=e.performance&&t.internal_setField(2,e.performance),null!=e.usbAlwaysDfu&&t.internal_setField(3,e.usbAlwaysDfu),null!=e.usbMaxBulkInQueueLength&&t.internal_setField(4,e.usbMaxBulkInQueueLength),t}),proto.acceleration.CoralDelegateSettings.prototype.toObject=function(e){return proto.acceleration.CoralDelegateSettings.internal_toObject(e,this)},proto.acceleration.CoralDelegateSettings.internal_toObject=function(e,t){if(null!=t){var n={device:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(1)),performance:t.internal_getFieldWithDefault(2,1),usbAlwaysDfu:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getBooleanField(3)),usbMaxBulkInQueueLength:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(4))};return e&&(n.$jspbMessageInstance=t),n}},proto.acceleration.CoralDelegateSettings.Performance={UNDEFINED:0,MAXIMUM:1,HIGH:2,MEDIUM:3,LOW:4},proto.acceleration.EdgeTpuDelegateDeviceSpec=function(e){module$contents$jspb$internal$public_for_gencode_GeneratedMessage.call(this,e,-1,proto.acceleration.EdgeTpuDelegateDeviceSpec.repeatedFields_)},$jscomp.inherits(proto.acceleration.EdgeTpuDelegateDeviceSpec,module$contents$jspb$internal$public_for_gencode_GeneratedMessage),proto.acceleration.EdgeTpuDelegateDeviceSpec.prototype.getPlatformType=function(){return this.internal_getField(1)},proto.acceleration.EdgeTpuDelegateDeviceSpec.prototype.setPlatformType=function(e){return this.internal_setField(1,e)},proto.acceleration.EdgeTpuDelegateDeviceSpec.prototype.clearPlatformType=function(){return this.internal_clearField(1)},proto.acceleration.EdgeTpuDelegateDeviceSpec.prototype.hasPlatformType=function(){return this.internal_hasField(1)},proto.acceleration.EdgeTpuDelegateDeviceSpec.prototype.getNumChips=function(){return this.internal_getField(2)},proto.acceleration.EdgeTpuDelegateDeviceSpec.prototype.setNumChips=function(e){return this.internal_setField(2,e)},proto.acceleration.EdgeTpuDelegateDeviceSpec.prototype.clearNumChips=function(){return this.internal_clearField(2)},proto.acceleration.EdgeTpuDelegateDeviceSpec.prototype.hasNumChips=function(){return this.internal_hasField(2)},proto.acceleration.EdgeTpuDelegateDeviceSpec.prototype.getDevicePathsList=function(){return this.internal_getRepeatedField(3)},proto.acceleration.EdgeTpuDelegateDeviceSpec.prototype.setDevicePathsList=function(e){return this.internal_setRepeatedField(3,e)},proto.acceleration.EdgeTpuDelegateDeviceSpec.prototype.addDevicePaths=function(e,t){return this.internal_addToRepeatedField(3,e,t)},proto.acceleration.EdgeTpuDelegateDeviceSpec.prototype.clearDevicePathsList=function(){return this.internal_clearRepeatedField(3)},proto.acceleration.EdgeTpuDelegateDeviceSpec.prototype.getChipFamily=function(){return this.internal_getField(4)},proto.acceleration.EdgeTpuDelegateDeviceSpec.prototype.setChipFamily=function(e){return this.internal_setField(4,e)},proto.acceleration.EdgeTpuDelegateDeviceSpec.prototype.clearChipFamily=function(){return this.internal_clearField(4)},proto.acceleration.EdgeTpuDelegateDeviceSpec.prototype.hasChipFamily=function(){return this.internal_hasField(4)},proto.acceleration.EdgeTpuDelegateDeviceSpec.internalDoNotUse$proto$acceleration$EdgeTpuDelegateDeviceSpec$getBinaryFieldsObject=function(){return{1:jspb.internal.binary.readEnum,2:jspb.internal.binary.readInt32,3:jspb.internal.binary.readRepeatedString,4:jspb.internal.binary.readInt32}},proto.acceleration.EdgeTpuDelegateDeviceSpec.prototype.serializeBinary=function(){return jspb.internal.binary.serializeBinary(this,proto.acceleration.EdgeTpuDelegateDeviceSpec.serializeBinaryToWriter)},proto.acceleration.EdgeTpuDelegateDeviceSpec.serializeBinaryToWriter=function(e,t){jspb.internal.binary.writeEnum(t,e,1),jspb.internal.binary.writeInt32(t,e,2),jspb.internal.binary.writeRepeatedString(t,e,3),jspb.internal.binary.writeInt32(t,e,4),jspb.internal.binary.serializeBinaryExtensionsAndUnknownFields(e,t)},proto.acceleration.EdgeTpuDelegateDeviceSpec.deserializeBinary=function(e){return jspb.internal.binary.deserializeBinary(e,proto.acceleration.EdgeTpuDelegateDeviceSpec,proto.acceleration.EdgeTpuDelegateDeviceSpec.internalDoNotUse$proto$acceleration$EdgeTpuDelegateDeviceSpec$getBinaryFieldsObject)},proto.acceleration.EdgeTpuDelegateDeviceSpec.deserializeBinaryFromReader=function(e,t){return module$contents$jspb$internal$binary_deserializeBinaryFromReaderGeneric(e,t,proto.acceleration.EdgeTpuDelegateDeviceSpec.internalDoNotUse$proto$acceleration$EdgeTpuDelegateDeviceSpec$getBinaryFieldsObject)},proto.acceleration.EdgeTpuDelegateDeviceSpec.deserialize=function(e){return module$exports$jspb.Message.deserializeWithCtor(proto.acceleration.EdgeTpuDelegateDeviceSpec,e)},proto.acceleration.EdgeTpuDelegateDeviceSpec.repeatedFields_=[3],proto.acceleration.EdgeTpuDelegateDeviceSpec.ObjectFormat=function(){},module$contents$jspb$internal$public_for_gencode_GENERATE_FROM_OBJECT&&(proto.acceleration.EdgeTpuDelegateDeviceSpec.fromObject=function(e){var t=new proto.acceleration.EdgeTpuDelegateDeviceSpec;return null!=e.platformType&&t.internal_setField(1,e.platformType),null!=e.numChips&&t.internal_setField(2,e.numChips),null!=e.devicePathsList&&t.internal_setRepeatedField(3,e.devicePathsList),null!=e.chipFamily&&t.internal_setField(4,e.chipFamily),t}),proto.acceleration.EdgeTpuDelegateDeviceSpec.prototype.toObject=function(e){return proto.acceleration.EdgeTpuDelegateDeviceSpec.internal_toObject(e,this)},proto.acceleration.EdgeTpuDelegateDeviceSpec.internal_toObject=function(e,t){if(null!=t){var n={platformType:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(1)),numChips:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(2)),devicePathsList:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getRepeatedField(3)),chipFamily:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(4))};return e&&(n.$jspbMessageInstance=t),n}},proto.acceleration.EdgeTpuDelegateDeviceSpec.PlatformType={MMIO:0,REFERENCE:1,SIMULATOR:2,REMOTE_SIMULATOR:3},proto.acceleration.EdgeTpuDelegateInactivePowerConfig=function(e){module$contents$jspb$internal$public_for_gencode_GeneratedMessage.call(this,e)},$jscomp.inherits(proto.acceleration.EdgeTpuDelegateInactivePowerConfig,module$contents$jspb$internal$public_for_gencode_GeneratedMessage),proto.acceleration.EdgeTpuDelegateInactivePowerConfig.prototype.getInactivePowerState=function(){return this.internal_getField(1)},proto.acceleration.EdgeT
2puDelegateInactivePowerConfig.prototype.setInactivePowerState=function(e){return this.internal_setField(1,e)},proto.acceleration.EdgeTpuDelegateInactivePowerConfig.prototype.clearInactivePowerState=function(){return this.internal_clearField(1)},proto.acceleration.EdgeTpuDelegateInactivePowerConfig.prototype.hasInactivePowerState=function(){return this.internal_hasField(1)},proto.acceleration.EdgeTpuDelegateInactivePowerConfig.prototype.getInactiveTimeoutUs=function(){return this.internal_getField(2)},proto.acceleration.EdgeTpuDelegateInactivePowerConfig.prototype.setInactiveTimeoutUs=function(e){return this.internal_setField(2,e)},proto.acceleration.EdgeTpuDelegateInactivePowerConfig.prototype.clearInactiveTimeoutUs=function(){return this.internal_clearField(2)},proto.acceleration.EdgeTpuDelegateInactivePowerConfig.prototype.hasInactiveTimeoutUs=function(){return this.internal_hasField(2)},proto.acceleration.EdgeTpuDelegateInactivePowerConfig.internalDoNotUse$proto$acceleration$EdgeTpuDelegateInactivePowerConfig$getBinaryFieldsObject=function(){return{1:jspb.internal.binary.readEnum,2:jspb.internal.binary.readInt64}},proto.acceleration.EdgeTpuDelegateInactivePowerConfig.prototype.serializeBinary=function(){return jspb.internal.binary.serializeBinary(this,proto.acceleration.EdgeTpuDelegateInactivePowerConfig.serializeBinaryToWriter)},proto.acceleration.EdgeTpuDelegateInactivePowerConfig.serializeBinaryToWriter=function(e,t){jspb.internal.binary.writeEnum(t,e,1),jspb.internal.binary.writeInt64(t,e,2),jspb.internal.binary.serializeBinaryExtensionsAndUnknownFields(e,t)},proto.acceleration.EdgeTpuDelegateInactivePowerConfig.deserializeBinary=function(e){return jspb.internal.binary.deserializeBinary(e,proto.acceleration.EdgeTpuDelegateInactivePowerConfig,proto.acceleration.EdgeTpuDelegateInactivePowerConfig.internalDoNotUse$proto$acceleration$EdgeTpuDelegateInactivePowerConfig$getBinaryFieldsObject)},proto.acceleration.EdgeTpuDelegateInactivePowerConfig.deserializeBinaryFromReader=function(e,t){return module$contents$jspb$internal$binary_deserializeBinaryFromReaderGeneric(e,t,proto.acceleration.EdgeTpuDelegateInactivePowerConfig.internalDoNotUse$proto$acceleration$EdgeTpuDelegateInactivePowerConfig$getBinaryFieldsObject)},proto.acceleration.EdgeTpuDelegateInactivePowerConfig.deserialize=function(e){return module$exports$jspb.Message.deserializeWithCtor(proto.acceleration.EdgeTpuDelegateInactivePowerConfig,e)},proto.acceleration.EdgeTpuDelegateInactivePowerConfig.ObjectFormat=function(){},module$contents$jspb$internal$public_for_gencode_GENERATE_FROM_OBJECT&&(proto.acceleration.EdgeTpuDelegateInactivePowerConfig.fromObject=function(e){var t=new proto.acceleration.EdgeTpuDelegateInactivePowerConfig;return null!=e.inactivePowerState&&t.internal_setField(1,e.inactivePowerState),null!=e.inactiveTimeoutUs&&t.internal_setField(2,e.inactiveTimeoutUs),t}),proto.acceleration.EdgeTpuDelegateInactivePowerConfig.prototype.toObject=function(e){return proto.acceleration.EdgeTpuDelegateInactivePowerConfig.internal_toObject(e,this)},proto.acceleration.EdgeTpuDelegateInactivePowerConfig.internal_toObject=function(e,t){if(null!=t){var n={inactivePowerState:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(1)),inactiveTimeoutUs:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(2))};return e&&(n.$jspbMessageInstance=t),n}},proto.acceleration.EdgeTpuDelegateSettings=function(e){module$contents$jspb$internal$public_for_gencode_GeneratedMessage.call(this,e,-1,proto.acceleration.EdgeTpuDelegateSettings.repeatedFields_)},$jscomp.inherits(proto.acceleration.EdgeTpuDelegateSettings,module$contents$jspb$internal$public_for_gencode_GeneratedMessage),proto.acceleration.EdgeTpuDelegateSettings.prototype.getInferencePowerState=function(){return this.internal_getField(1)},proto.acceleration.EdgeTpuDelegateSettings.prototype.setInferencePowerState=function(e){return this.internal_setField(1,e)},proto.acceleration.EdgeTpuDelegateSettings.prototype.clearInferencePowerState=function(){return this.internal_clearField(1)},proto.acceleration.EdgeTpuDelegateSettings.prototype.hasInferencePowerState=function(){return this.internal_hasField(1)},proto.acceleration.EdgeTpuDelegateSettings.prototype.getInactivePowerConfigsList=function(){return this.internal_getRepeatedWrapperField(proto.acceleration.EdgeTpuDelegateInactivePowerConfig,2)},proto.acceleration.EdgeTpuDelegateSettings.prototype.setInactivePowerConfigsList=function(e){return this.internal_setRepeatedWrapperField(2,e)},proto.acceleration.EdgeTpuDelegateSettings.prototype.addInactivePowerConfigs=function(e,t){return this.internal_addToRepeatedWrapperField(2,e,proto.acceleration.EdgeTpuDelegateInactivePowerConfig,t)},proto.acceleration.EdgeTpuDelegateSettings.prototype.addAndReturnInactivePowerConfigs=function(e,t){return this.internal_addAndReturnRepeatedWrapperField(2,e,proto.acceleration.EdgeTpuDelegateInactivePowerConfig,t)},proto.acceleration.EdgeTpuDelegateSettings.prototype.clearInactivePowerConfigsList=function(){return this.internal_clearRepeatedWrapperField(2)},proto.acceleration.EdgeTpuDelegateSettings.prototype.getInferencePriority=function(){return this.internal_getIntegerFieldWithDefault(3,-1)},proto.acceleration.EdgeTpuDelegateSettings.prototype.setInferencePriority=function(e){return this.internal_setField(3,e)},proto.acceleration.EdgeTpuDelegateSettings.prototype.clearInferencePriority=function(){return this.internal_clearField(3)},proto.acceleration.EdgeTpuDelegateSettings.prototype.hasInferencePriority=function(){return this.internal_hasField(3)},proto.acceleration.EdgeTpuDelegateSettings.prototype.getEdgetpuDeviceSpec=function(){return this.internal_getWrapperField(proto.acceleration.EdgeTpuDelegateDeviceSpec,4)},proto.acceleration.EdgeTpuDelegateSettings.prototype.setEdgetpuDeviceSpec=function(e){return this.internal_setWrapperField(4,e)},proto.acceleration.EdgeTpuDelegateSettings.prototype.clearEdgetpuDeviceSpec=function(){return this.internal_clearWrapperField(4)},proto.acceleration.EdgeTpuDelegateSettings.prototype.hasEdgetpuDeviceSpec=function(){return this.internal_hasField(4)},proto.acceleration.EdgeTpuDelegateSettings.prototype.getModelToken=function(){return this.internal_getField(5)},proto.acceleration.EdgeTpuDelegateSettings.prototype.setModelToken=function(e){return this.internal_setField(5,e)},proto.acceleration.EdgeTpuDelegateSettings.prototype.clearModelToken=function(){return this.internal_clearField(5)},proto.acceleration.EdgeTpuDelegateSettings.prototype.hasModelToken=function(){return this.internal_hasField(5)},proto.acceleration.EdgeTpuDelegateSettings.prototype.getFloatTruncationType=function(){return this.internal_getField(6)},proto.acceleration.EdgeTpuDelegateSettings.prototype.setFloatTruncationType=function(e){return this.internal_setField(6,e)},proto.acceleration.EdgeTpuDelegateSettings.prototype.clearFloatTruncationType=function(){return this.internal_clearField(6)},proto.acceleration.EdgeTpuDelegateSettings.prototype.hasFloatTruncationType=function(){return this.internal_hasField(6)},proto.acceleration.EdgeTpuDelegateSettings.internalDoNotUse$proto$acceleration$EdgeTpuDelegateSettings$getBinaryFieldsObject=function(){return{1:jspb.internal.binary.readEnum,2:[jspb.internal.binary.readRepeatedMessage,proto.acceleration.EdgeTpuDelegateInactivePowerConfig,proto.acceleration.EdgeTpuDelegateInactivePowerConfig.internalDoNotUse$proto$acceleration$EdgeTpuDelegateInactivePowerConfig$getBinaryFieldsObject],3:jspb.internal.binary.readInt32,4:[jspb.internal.binary.readMessage,proto.acceleration.EdgeTpuDelegateDeviceSpec,proto.acceleration.EdgeTpuDelegateDeviceSpec.internalDoNotUse$proto$acceleration$EdgeTpuDelegateDeviceSpec$getBinaryFieldsObject],5:jspb.internal.binary.readString,6:jspb.internal.binary.readEnum}},proto.acceleration.EdgeTpuDelegateSettings.prototype.serializeBinary=function(){return jspb.internal.binary.serializeBinary(this,proto.acceleration.EdgeTpuDelegateSettings.serializeBinaryToWriter)},proto.acceleration.EdgeTpuDelegateSettings.serializeBinaryToWriter=function(e,t){jspb.internal.binary.writeEnum(t,e,1),jspb.internal.binary.writeRepeatedMessage(t,e,2,proto.acceleration.EdgeTpuDelegateInactivePowerConfig,proto.acceleration.EdgeTpuDelegateInactivePowerConfig.serializeBinaryToWriter),jspb.internal.binary.writeInt32(t,e,3),jspb.internal.binary.writeMessage(t,e,4,proto.acceleration.EdgeTpuDelegateDeviceSpec,proto.acceleration.EdgeTpuDelegateDeviceSpec.serializeBinaryToWriter),jspb.internal.binary.writeString(t,e,5),jspb.internal.binary.writeEnum(t,e,6),jspb.internal.binary.serializeBinaryExtensionsAndUnknownFields(e,t)},proto.acceleration.EdgeTpuDelegateSettings.deserializeBinary=function(e){return jspb.internal.binary.deserializeBinary(e,proto.acceleration.EdgeTpuDelegateSettings,proto.acceleration.EdgeTpuDelegateSettings.internalDoNotUse$proto$acceleration$EdgeTpuDelegateSettings$getBinaryFieldsObject)},proto.acceleration.EdgeTpuDelegateSettings.deserializeBinaryFromReader=function(e,t){return module$contents$jspb$internal$binary_deserializeBinaryFromReaderGeneric(e,t,proto.acceleration.EdgeTpuDelegateSettings.internalDoNotUse$proto$acceleration$EdgeTpuDelegateSettings$getBinaryFieldsObject)},proto.acceleration.EdgeTpuDelegateSettings.deserialize=function(e){return module$exports$jspb.Message.deserializeWithCtor(proto.acceleration.EdgeTpuDelegateSettings,e)},proto.acceleration.EdgeTpuDelegateSettings.repeatedFields_=[2],proto.acceleration.EdgeTpuDelegateSettings.ObjectFormat=function(){},module$contents$jspb$internal$public_for_gencode_GENERATE_FROM_OBJECT&&(proto.acceleration.EdgeTpuDelegateSettings.fromObject=function(e){var t=new proto.acceleration.EdgeTpuDelegateSettings;return null!=e.inferencePowerState&&t.internal_setField(1,e.inferencePowerState),e.inactivePowerConfigsList&&t.internal_setRepeatedWrapperField(2,e.inactivePowerConfigsList.map(proto.acceleration.EdgeTpuDelegateInactivePowerConfig.fromObject)),null!=e.inferencePriority&&t.internal_setField(3,e.inferencePriority),e.edgetpuDeviceSpec&&t.internal_setWrapperField(4,proto.acceleration.EdgeTpuDelegateDeviceSpec.fromObject(e.edgetpuDeviceSpec)),null!=e.modelToken&&t.internal_setField(5,e.modelToken),null!=e.floatTruncationType&&t.internal_setField(6,e.floatTruncationType),t}),proto.acceleration.EdgeTpuDelegateSettings.prototype.toObject=function(e){return proto.acceleration.EdgeTpuDelegateSettings.internal_toObject(e,this)},proto.acceleration.EdgeTpuDelegateSettings.internal_toObject=function(e,t){if(null!=t){var n={inferencePowerState:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(1)),inactivePowerConfigsList:module$contents$jspb$internal$public_for_gencode_toObjectList(t.getInactivePowerConfigsList(),proto.acceleration.EdgeTpuDelegateInactivePowerConfig.internal_toObject,e),inferencePriority:t.internal_getIntegerFieldWithDefault(3,-1),edgetpuDeviceSpec:proto.acceleration.EdgeTpuDelegateDeviceSpec.internal_toObject(e,t.getEdgetpuDeviceSpec()),modelToken:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(5)),floatTruncationType:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(6))};return e&&(n.$jspbMessageInstance=t),n}},proto.acceleration.EdgeTpuDelegateSettings.FloatTruncationType={UNSPECIFIED:0,NO_TRUNCATION:1,BFLOAT16:2,HALF:3},proto.acceleration.FallbackSettings=function(e){module$contents$jspb$internal$public_for_gencode_GeneratedMessage.call(this,e)},$jscomp.inherits(proto.acceleration.FallbackSettings,module$contents$jspb$internal$public_for_gencode_GeneratedMessage),proto.acceleration.FallbackSettings.prototype.getAllowAutomaticFallbackOnCompilationError=function(){return this.internal_getBooleanField(5)},proto.acceleration.FallbackSettings.prototype.setAllowAutomaticFallbackOnCompilationError=function(e){return this.internal_setField(5,e)},proto.acceleration.FallbackSettings.prototype.clearAllowAutomaticFallbackOnCompilationError=function(){return this.internal_clearField(5)},proto.acceleration.FallbackSettings.prototype.hasAllowAutomaticFallbackOnCompilationError=function(){return this.internal_hasField(5)},proto.acceleration.FallbackSettings.prototype.getAllowAutomaticFallbackOnExecutionError=function(){return this.internal_getBooleanField(6)},proto.acceleration.FallbackSettings.prototype.setAllowAutomaticFallbackOnExecutionError=function(e){return this.internal_setField(6,e)},proto.acceleration.FallbackSettings.prototype.clearAllowAutomaticFallbackOnExecutionError=function(){return this.internal_clearField(6)},proto.acceleration.FallbackSettings.prototype.hasAllowAutomaticFallbackOnExecutionError=function(){return this.internal_hasField(6)},proto.acceleration.FallbackSettings.internalDoNotUse$proto$acceleration$FallbackSettings$getBinaryFieldsObject=function(){return{5:jspb.internal.binary.readBool,6:jspb.internal.binary.readBool}},proto.acceleration.FallbackSettings.prototype.serializeBinary=function(){return jspb.internal.binary.serializeBinary(this,proto.acceleration.FallbackSettings.serializeBinaryToWriter)},proto.acceleration.FallbackSettings.serializeBinaryToWriter=function(e,t){jspb.internal.binary.writeBool(t,e,5),jspb.internal.binary.writeBool(t,e,6),jspb.internal.binary.serializeBinaryExtensionsAndUnknownFields(e,t)},proto.acceleration.FallbackSettings.deserializeBinary=function(e){return jspb.internal.binary.deserializeBinary(e,proto.acceleration.FallbackSettings,proto.acceleration.FallbackSettings.internalDoNotUse$proto$acceleration$FallbackSettings$getBinaryFieldsObject)},proto.acceleration.FallbackSettings.deserializeBinaryFromReader=function(e,t){return module$contents$jspb$internal$binary_deserializeBinaryFromReaderGeneric(e,t,proto.acceleration.FallbackSettings.internalDoNotUse$proto$acceleration$FallbackSettings$getBinaryFieldsObject)},proto.acceleration.FallbackSettings.deserialize=function(e){return module$exports$jspb.Message.deserializeWithCtor(proto.acceleration.FallbackSettings,e)},proto.acceleration.FallbackSettings.ObjectFormat=function(){},module$contents$jspb$internal$public_for_gencode_GENERATE_FROM_OBJECT&&(proto.acceleration.FallbackSettings.fromObject=function(e){var t=new proto.acceleration.FallbackSettings;return null!=e.allowAutomaticFallbackOnCompilationError&&t.internal_setField(5,e.allowAutomaticFallbackOnCompilationError),null!=e.allowAutomaticFallbackOnExecutionError&&t.internal_setField(6,e.allowAutomaticFallbackOnExecutionError),t}),proto.acceleration.FallbackSettings.prototype.toObject=function(e){return proto.acceleration.FallbackSettings.internal_toObject(e,this)},proto.acceleration.FallbackSettings.internal_toObject=function(e,t){if(null!=t){var n={allowAutomaticFallbackOnCompilationError:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getBooleanField(5)),allowAutomaticFallbackOnExecutionError:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getBooleanField(6))};return e&&(n.$jspbMessageInstance=t),n}},proto.acceleration.GPUDelegateSettings=function(e){module$contents$jspb$internal$public_for_gencode_GeneratedMessage.call(this,e)},$jscomp.inherits(proto.acceleration.GPUDelegateSettings,module$contents$jspb$internal$public_for_gencode_GeneratedMessage),proto.acceleration.GPUDelegateSettings.prototype.getIsPrecisionLossAllowed=function(){return this.internal_getBooleanField(1)},proto.acceleration.GPUDelegateSettings.prototype.setIsPrecisionLossAllowed=function(e){return this.internal_setField(1,e)},proto.acceleration.GPUDelegateSettings.prototype.clearIsPrecisionLossAllowed=function(){return this.internal_clearField(1)},proto.acceleration.GPUDelegateSettings.prototype.hasIsPrecisionLossAllowed=function(){return this.internal_hasField(1)},proto.acceleration.GPUDelegateSettings.prototype.getInferencePreference=function(){return this.internal_getField(2)},proto.acceleration.GPUDelegateSettings.prototype.setInferencePreference=function(e){return this.internal_setField(2,e)},proto.acceleration.GPUDelegateSettings.prototype.clearInferencePreference=function(){return this.internal_clearField(2)},proto.acceleration.GPUDelegateSettings.prototype.hasInferencePreference=function(){return this.internal_hasField(2)},proto.acceleration.GPUDelegateSettings.pro
2totype.getEnableQuantizedInference=function(){return this.internal_getBooleanFieldWithDefault(3,!0)},proto.acceleration.GPUDelegateSettings.prototype.setEnableQuantizedInference=function(e){return this.internal_setField(3,e)},proto.acceleration.GPUDelegateSettings.prototype.clearEnableQuantizedInference=function(){return this.internal_clearField(3)},proto.acceleration.GPUDelegateSettings.prototype.hasEnableQuantizedInference=function(){return this.internal_hasField(3)},proto.acceleration.GPUDelegateSettings.prototype.getForceBackend=function(){return this.internal_getField(4)},proto.acceleration.GPUDelegateSettings.prototype.setForceBackend=function(e){return this.internal_setField(4,e)},proto.acceleration.GPUDelegateSettings.prototype.clearForceBackend=function(){return this.internal_clearField(4)},proto.acceleration.GPUDelegateSettings.prototype.hasForceBackend=function(){return this.internal_hasField(4)},proto.acceleration.GPUDelegateSettings.prototype.getInferencePriority1=function(){return this.internal_getFieldWithDefault(5,0)},proto.acceleration.GPUDelegateSettings.prototype.setInferencePriority1=function(e){return this.internal_setField(5,e)},proto.acceleration.GPUDelegateSettings.prototype.clearInferencePriority1=function(){return this.internal_clearField(5)},proto.acceleration.GPUDelegateSettings.prototype.hasInferencePriority1=function(){return this.internal_hasField(5)},proto.acceleration.GPUDelegateSettings.prototype.getInferencePriority2=function(){return this.internal_getFieldWithDefault(6,0)},proto.acceleration.GPUDelegateSettings.prototype.setInferencePriority2=function(e){return this.internal_setField(6,e)},proto.acceleration.GPUDelegateSettings.prototype.clearInferencePriority2=function(){return this.internal_clearField(6)},proto.acceleration.GPUDelegateSettings.prototype.hasInferencePriority2=function(){return this.internal_hasField(6)},proto.acceleration.GPUDelegateSettings.prototype.getInferencePriority3=function(){return this.internal_getFieldWithDefault(7,0)},proto.acceleration.GPUDelegateSettings.prototype.setInferencePriority3=function(e){return this.internal_setField(7,e)},proto.acceleration.GPUDelegateSettings.prototype.clearInferencePriority3=function(){return this.internal_clearField(7)},proto.acceleration.GPUDelegateSettings.prototype.hasInferencePriority3=function(){return this.internal_hasField(7)},proto.acceleration.GPUDelegateSettings.prototype.getCacheDirectory=function(){return this.internal_getField(8)},proto.acceleration.GPUDelegateSettings.prototype.setCacheDirectory=function(e){return this.internal_setField(8,e)},proto.acceleration.GPUDelegateSettings.prototype.clearCacheDirectory=function(){return this.internal_clearField(8)},proto.acceleration.GPUDelegateSettings.prototype.hasCacheDirectory=function(){return this.internal_hasField(8)},proto.acceleration.GPUDelegateSettings.prototype.getModelToken=function(){return this.internal_getField(9)},proto.acceleration.GPUDelegateSettings.prototype.setModelToken=function(e){return this.internal_setField(9,e)},proto.acceleration.GPUDelegateSettings.prototype.clearModelToken=function(){return this.internal_clearField(9)},proto.acceleration.GPUDelegateSettings.prototype.hasModelToken=function(){return this.internal_hasField(9)},proto.acceleration.GPUDelegateSettings.internalDoNotUse$proto$acceleration$GPUDelegateSettings$getBinaryFieldsObject=function(){return{1:jspb.internal.binary.readBool,2:jspb.internal.binary.readEnum,3:jspb.internal.binary.readBool,4:jspb.internal.binary.readEnum,5:jspb.internal.binary.readEnum,6:jspb.internal.binary.readEnum,7:jspb.internal.binary.readEnum,8:jspb.internal.binary.readString,9:jspb.internal.binary.readString}},proto.acceleration.GPUDelegateSettings.prototype.serializeBinary=function(){return jspb.internal.binary.serializeBinary(this,proto.acceleration.GPUDelegateSettings.serializeBinaryToWriter)},proto.acceleration.GPUDelegateSettings.serializeBinaryToWriter=function(e,t){jspb.internal.binary.writeBool(t,e,1),jspb.internal.binary.writeEnum(t,e,2),jspb.internal.binary.writeBool(t,e,3),jspb.internal.binary.writeEnum(t,e,4),jspb.internal.binary.writeEnum(t,e,5),jspb.internal.binary.writeEnum(t,e,6),jspb.internal.binary.writeEnum(t,e,7),jspb.internal.binary.writeString(t,e,8),jspb.internal.binary.writeString(t,e,9),jspb.internal.binary.serializeBinaryExtensionsAndUnknownFields(e,t)},proto.acceleration.GPUDelegateSettings.deserializeBinary=function(e){return jspb.internal.binary.deserializeBinary(e,proto.acceleration.GPUDelegateSettings,proto.acceleration.GPUDelegateSettings.internalDoNotUse$proto$acceleration$GPUDelegateSettings$getBinaryFieldsObject)},proto.acceleration.GPUDelegateSettings.deserializeBinaryFromReader=function(e,t){return module$contents$jspb$internal$binary_deserializeBinaryFromReaderGeneric(e,t,proto.acceleration.GPUDelegateSettings.internalDoNotUse$proto$acceleration$GPUDelegateSettings$getBinaryFieldsObject)},proto.acceleration.GPUDelegateSettings.deserialize=function(e){return module$exports$jspb.Message.deserializeWithCtor(proto.acceleration.GPUDelegateSettings,e)},proto.acceleration.GPUDelegateSettings.ObjectFormat=function(){},module$contents$jspb$internal$public_for_gencode_GENERATE_FROM_OBJECT&&(proto.acceleration.GPUDelegateSettings.fromObject=function(e){var t=new proto.acceleration.GPUDelegateSettings;return null!=e.isPrecisionLossAllowed&&t.internal_setField(1,e.isPrecisionLossAllowed),null!=e.inferencePreference&&t.internal_setField(2,e.inferencePreference),null!=e.enableQuantizedInference&&t.internal_setField(3,e.enableQuantizedInference),null!=e.forceBackend&&t.internal_setField(4,e.forceBackend),null!=e.inferencePriority1&&t.internal_setField(5,e.inferencePriority1),null!=e.inferencePriority2&&t.internal_setField(6,e.inferencePriority2),null!=e.inferencePriority3&&t.internal_setField(7,e.inferencePriority3),null!=e.cacheDirectory&&t.internal_setField(8,e.cacheDirectory),null!=e.modelToken&&t.internal_setField(9,e.modelToken),t}),proto.acceleration.GPUDelegateSettings.prototype.toObject=function(e){return proto.acceleration.GPUDelegateSettings.internal_toObject(e,this)},proto.acceleration.GPUDelegateSettings.internal_toObject=function(e,t){if(null!=t){var n={isPrecisionLossAllowed:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getBooleanField(1)),inferencePreference:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(2)),enableQuantizedInference:t.internal_getBooleanFieldWithDefault(3,!0),forceBackend:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(4)),inferencePriority1:t.internal_getFieldWithDefault(5,0),inferencePriority2:t.internal_getFieldWithDefault(6,0),inferencePriority3:t.internal_getFieldWithDefault(7,0
2),cacheDirectory:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(8)),modelToken:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(9))};return e&&(n.$jspbMessageInstance=t),n}},proto.acceleration.HangDetectionSettings=function(e){module$contents$jspb$internal$public_for_gencode_GeneratedMessage.call(this,e)},$jscomp.inherits(proto.acceleration.HangDetectionSettings,module$contents$jspb$internal$public_for_gencode_GeneratedMessage),proto.acceleration.HangDetectionSettings.prototype.getBehaviour=function(){return this.internal_getField(1)},proto.acceleration.HangDetectionSettings.prototype.setBehaviour=function(e){return this.internal_setField(1,e)},proto.acceleration.HangDetectionSettings.prototype.clearBehaviour=function(){return this.internal_clearField(1)},proto.acceleration.HangDetectionSettings.prototype.hasBehaviour=function(){return this.internal_hasField(1)},proto.acceleration.HangDetectionSettings.prototype.getCrashTriggerPercentage=function(){return this.internal_getIntegerFieldWithDefault(2,100)},proto.acceleration.HangDetectionSettings.prototype.setCrashTriggerPercentage=function(e){return this.internal_setField(2,e)},proto.acceleration.HangDetectionSettings.prototype.clearCrashTriggerPercentage=function(){return this.internal_clearField(2)},proto.acceleration.HangDetectionSettings.prototype.hasCrashTriggerPercentage=function(){return this.internal_hasField(2)},proto.acceleration.HangDetectionSettings.prototype.getHangTimeoutMs=function(){return this.internal_getField(3)},proto.acceleration.HangDetectionSettings.prototype.setHangTimeoutMs=function(e){return this.internal_setField(3,e)},proto.acceleration.HangDetectionSettings.prototype.clearHangTimeoutMs=function(){return this.internal_clearField(3)},proto.acceleration.HangDetectionSettings.prototype.hasHangTimeoutMs=function(){return this.internal_hasField(3)},proto.acceleration.HangDetectionSettings.internalDoNotUse$proto$acceleration$HangDetectionSettings$getBinaryFieldsObject=function(){return{1:jspb.internal.binary.readEnum,2:jspb.internal.binary.readInt32,3:jspb.internal.binary.readInt32}},proto.acceleration.HangDetectionSettings.prototype.serializeBinary=function(){return jspb.internal.binary.serializeBinary(this,proto.acceleration.HangDetectionSettings.serializeBinaryToWriter)},proto.acceleration.HangDetectionSettings.serializeBinaryToWriter=function(e,t){jspb.internal.binary.writeEnum(t,e,1),jspb.internal.binary.writeInt32(t,e,2),jspb.internal.binary.writeInt32(t,e,3),jspb.internal.binary.serializeBinaryExtensionsAndUnknownFields(e,t)},proto.acceleration.HangDetectionSettings.deserializeBinary=function(e){return jspb.internal.binary.deserializeBinary(e,proto.acceleration.HangDetectionSettings,proto.acceleration.HangDetectionSettings.internalDoNotUse$proto$acceleration$HangDetectionSettings$getBinaryFieldsObject)},proto.acceleration.HangDetectionSettings.deserializeBinaryFromReader=function(e,t){return module$contents$jspb$internal$binary_deserializeBinaryFromReaderGeneric(e,t,proto.acceleration.HangDetectionSettings.internalDoNotUse$proto$acceleration$HangDetectionSettings$getBinaryFieldsObject)},proto.acceleration.HangDetectionSettings.deserialize=function(e){return module$exports$jspb.Message.deserializeWithCtor(proto.acceleration.HangDetectionSettings,e)},proto.acceleration.HangDetectionSettings.ObjectFormat=function(){},module$contents$jspb$internal$public_for_gencode_GENERATE_FROM_OBJECT&&(proto.acceleration.HangDetectionSettings.fromObject=function(e){var t=new proto.acceleration.HangDetectionSettings;return null!=e.behaviour&&t.internal_setField(1,e.behaviour),null!=e.crashTriggerPercentage&&t.internal_setField(2,e.crashTriggerPercentage),null!=e.hangTimeoutMs&&t.internal_setField(3,e.hangTimeoutMs),t}),proto.acceleration.HangDetectionSettings.prototype.toObject=function(e){return proto.acceleration.HangDetectionSettings.internal_toObject(e,this)},proto.acceleration.HangDetectionSettings.internal_toObject=function(e,t){if(null!=t){var n={behaviour:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(1)),crashTriggerPercentage:t.internal_getIntegerFieldWithDefault(2,100),hangTimeoutMs:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(3))};return e&&(n.$jspbMessageInstance=t),n}},proto.acceleration.HexagonDelegateSettings=function(e){module$contents$jspb$internal$public_for_gencode_GeneratedMessage.call(this,e)},$jscomp.inherits(proto.acceleration.HexagonDelegateSettings,module$contents$jspb$internal$public_for_gencode_GeneratedMessage),proto.acceleration.HexagonDelegateSettings.prototype.getNoOfHexagonInstancesToCache=function(){return this.internal_getField(1)}
2,proto.acceleration.HexagonDelegateSettings.prototype.setNoOfHexagonInstancesToCache=function(e){return this.internal_setField(1,e)},proto.acceleration.HexagonDelegateSettings.prototype.clearNoOfHexagonInstancesToCache=function(){return this.internal_clearField(1)},proto.acceleration.HexagonDelegateSettings.prototype.hasNoOfHexagonInstancesToCache=function(){return this.internal_hasField(1)},proto.acceleration.HexagonDelegateSettings.internalDoNotUse$proto$acceleration$HexagonDelegateSettings$getBinaryFieldsObject=function(){return{1:jspb.internal.binary.readInt32}},proto.acceleration.HexagonDelegateSettings.prototype.serializeBinary=function(){return jspb.internal.binary.serializeBinary(this,proto.acceleration.HexagonDelegateSettings.serializeBinaryToWriter)},proto.acceleration.HexagonDelegateSettings.serializeBinaryToWriter=function(e,t){jspb.internal.binary.writeInt32(t,e,1),jspb.internal.binary.serializeBinaryExtensionsAndUnknownFields(e,t)},proto.acceleration.HexagonDelegateSettings.deserializeBinary=function(e){return jspb.internal.binary.deserializeBinary(e,proto.acceleration.HexagonDelegateSettings,proto.acceleration.HexagonDelegateSettings.internalDoNotUse$proto$acceleration$HexagonDelegateSettings$getBinaryFieldsObject)},proto.acceleration.HexagonDelegateSettings.deserializeBinaryFromReader=function(e,t){return module$contents$jspb$internal$binary_deserializeBinaryFromReaderGeneric(e,t,proto.acceleration.HexagonDelegateSettings.internalDoNotUse$proto$acceleration$HexagonDelegateSettings$getBinaryFieldsObject)},proto.acceleration.HexagonDelegateSettings.deserialize=function(e){return module$exports$jspb.Message.deserializeWithCtor(proto.acceleration.HexagonDelegateSettings,e)},proto.acceleration.HexagonDelegateSettings.ObjectFormat=function(){},module$contents$jspb$internal$public_for_gencode_GENERATE_FROM_OBJECT&&(proto.acceleration.HexagonDelegateSettings.fromObject=function(e){var t=new proto.acceleration.HexagonDelegateSettings;return null!=e.noOfHexagonInstancesToCache&&t.internal_setField(1,e.noOfHexagonInstancesToCache),t}),proto.acceleration.HexagonDelegateSettings.prototype.toObject=function(e){return proto.acceleration.HexagonDelegateSettings.internal_toObject(e,this)},proto.acceleration.HexagonDelegateSettings.internal_toObject=function(e,t){if(null!=t){var n={noOfHexagonInstancesToCache:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(1))};return e&&(n.$jspbMessageInstance=t),n}},proto.acceleration.NNAPIDelegateSettings=function(e){module$contents$jspb$internal$public_for_gencode_GeneratedMessage.call(this,e)},$jscomp.inherits(proto.acceleration.NNAPIDelegateSettings,module$contents$jspb$internal$public_for_gencode_GeneratedMessage),proto.acceleration.NNAPIDelegateSettings.prototype.getAcceleratorName=function(){return this.internal_getField(1)},proto.acceleration.NNAPIDelegateSettings.prototype.setAcceleratorName=function(e){return this.internal_setField(1,e)},proto.acceleration.NNAPIDelegateSettings.prototype.clearAcceleratorName=function(){return this.internal_clearField(1)},proto.acceleration.NNAPIDelegateSettings.prototype.hasAcceleratorName=function(){return this.internal_hasField(1)},proto.acceleration.NNAPIDelegateSettings.prototype.getCacheDirectory=function(){return this.internal_getField(2)},proto.acceleration.NNAPIDelegateSettings.prototype.setCacheDirectory=function(e){return this.internal_setField(2,e)},proto.acceleration.NNAPIDelegateSettings.prototype.clearCacheDirectory=function(){return this.internal_clearField(2)},proto.acceleration.NNAPIDelegateSettings.prototype.hasCacheDirectory=function(){return this.internal_hasField(2)},proto.acceleration.NNAPIDelegateSettings.prototype.getModelToken=function(){return this.internal_getField(3)},proto.acceleration.NNAPIDelegateSettings.prototype.setModelToken=function(e){return this.internal_setField(3,e)},proto.acceleration.NNAPIDelegateSettings.prototype.clearModelToken=function(){return this.internal_clearField(3)},proto.acceleration.NNAPIDelegateSettings.prototype.hasModelToken=function(){return this.internal_hasField(3)},proto.acceleration.NNAPIDelegateSettings.prototype.getExecutionPreference=function(){return this.internal_getField(4)},proto.acceleration.NNAPIDelegateSettings.prototype.setExecutionPreference=function(e){return this.internal_setField(4,e)},proto.acceleration.NNAPIDelegateSettings.prototype.clearExecutionPreference=function(){return this.internal_clearField(4)},proto.acceleration.NNAPIDelegateSettings.prototype.hasExecutionPreference=function(){return this.internal_hasField(4)},proto.acceleration.NNAPIDelegateSettings.prototype.getNoOfNnapiInstancesToCache=function(){return this.internal_getField(5)}
2,proto.acceleration.NNAPIDelegateSettings.prototype.setNoOfNnapiInstancesToCache=function(e){return this.internal_setField(5,e)},proto.acceleration.NNAPIDelegateSettings.prototype.clearNoOfNnapiInstancesToCache=function(){return this.internal_clearField(5)},proto.acceleration.NNAPIDelegateSettings.prototype.hasNoOfNnapiInstancesToCache=function(){return this.internal_hasField(5)},proto.acceleration.NNAPIDelegateSettings.prototype.getFallbackSettings=function(){return this.internal_getWrapperField(proto.acceleration.FallbackSettings,6)},proto.acceleration.NNAPIDelegateSettings.prototype.setFallbackSettings=function(e){return this.internal_setWrapperField(6,e)},proto.acceleration.NNAPIDelegateSettings.prototype.clearFallbackSettings=function(){return this.internal_clearWrapperField(6)},proto.acceleration.NNAPIDelegateSettings.prototype.hasFallbackSettings=function(){return this.internal_hasField(6)},proto.acceleration.NNAPIDelegateSettings.prototype.getAllowNnapiCpuOnAndroid10Plus=function(){return this.internal_getBooleanField(7)},proto.acceleration.NNAPIDelegateSettings.prototype.setAllowNnapiCpuOnAndroid10Plus=function(e){return this.internal_setField(7,e)},proto.acceleration.NNAPIDelegateSettings.prototype.clearAllowNnapiCpuOnAndroid10Plus=function(){return this.internal_clearField(7)},proto.acceleration.NNAPIDelegateSettings.prototype.hasAllowNnapiCpuOnAndroid10Plus=function(){return this.internal_hasField(7)},proto.acceleration.NNAPIDelegateSettings.prototype.getExecutionPriority=function(){return this.internal_getField(8)},proto.acceleration.NNAPIDelegateSettings.prototype.setExecutionPriority=function(e){return this.internal_setField(8,e)},proto.acceleration.NNAPIDelegateSettings.prototype.clearExecutionPriority=function(){return this.internal_clearField(8)},proto.acceleration.NNAPIDelegateSettings.prototype.hasExecutionPriority=function(){return this.internal_hasField(8)},proto.acceleration.NNAPIDelegateSettings.prototype.getAllowDynamicDimensions=function(){return this.internal_getBooleanField(9)},proto.acceleration.NNAPIDelegateSettings.prototype.setAllowDynamicDimensions=function(e){return this.internal_setField(9,e)},proto.acceleration.NNAPIDelegateSettings.prototype.clearAllowDynamicDimensions=function(){return this.internal_clearField(9)},proto.acceleration.NNAPIDelegateSettings.prototype.hasAllowDynamicDimensions=function(){return this.internal_hasField(9)},proto.acceleration.NNAPIDelegateSettings.prototype.getAllowFp16PrecisionForFp32=function(){return this.internal_getBooleanField(10)},proto.acceleration.NNAPIDelegateSettings.prototype.setAllowFp16PrecisionForFp32=function(e){return this.internal_setField(10,e)},proto.acceleration.NNAPIDelegateSettings.prototype.clearAllowFp16PrecisionForFp32=function(){return this.internal_clearField(10)},proto.acceleration.NNAPIDelegateSettings.prototype.hasAllowFp16PrecisionForFp32=function(){return this.internal_hasField(10)},proto.acceleration.NNAPIDelegateSettings.prototype.getUseBurstComputation=function(){return this.internal_getBooleanField(11)},proto.acceleration.NNAPIDelegateSettings.prototype.setUseBurstComputation=function(e){return this.internal_setField(11,e)},proto.acceleration.NNAPIDelegateSettings.prototype.clearUseBurstComputation=function(){return this.internal_clearField(11)},proto.acceleration.NNAPIDelegateSettings.prototype.hasUseBurstComputation=function(){return this.internal_hasField(11)},proto.acceleration.NNAPIDelegateSettings.prototype.getSupportLibraryHandle=function(){return this.internal_getField(12)},proto.acceleration.NNAPIDelegateSettings.prototype.setSupportLibraryHandle=function(e){return this.internal_setField(12,e)},proto.acceleration.NNAPIDelegateSettings.prototype.clearSupportLibraryHandle=function(){return this.internal_clearField(12)},proto.acceleration.NNAPIDelegateSettings.prototype.hasSupportLibraryHandle=function(){return this.internal_hasField(12)},proto.acceleration.NNAPIDelegateSettings.internalDoNotUse$proto$acceleration$NNAPIDelegateSettings$getBinaryFieldsObject=function(){return{1:jspb.internal.binary.readString,2:jspb.internal.binary.readString,3:jspb.internal.binary.readString,4:jspb.internal.binary.readEnum,5:jspb.internal.binary.readInt32,6:[jspb.internal.binary.readMessage,proto.acceleration.FallbackSettings,proto.acceleration.FallbackSettings.internalDoNotUse$proto$acceleration$FallbackSettings$getBinaryFieldsObject],7:js
2pb.internal.binary.readBool,8:jspb.internal.binary.readEnum,9:jspb.internal.binary.readBool,10:jspb.internal.binary.readBool,11:jspb.internal.binary.readBool,12:jspb.internal.binary.readInt64}},proto.acceleration.NNAPIDelegateSettings.prototype.serializeBinary=function(){return jspb.internal.binary.serializeBinary(this,proto.acceleration.NNAPIDelegateSettings.serializeBinaryToWriter)},proto.acceleration.NNAPIDelegateSettings.serializeBinaryToWriter=function(e,t){jspb.internal.binary.writeString(t,e,1),jspb.internal.binary.writeString(t,e,2),jspb.internal.binary.writeString(t,e,3),jspb.internal.binary.writeEnum(t,e,4),jspb.internal.binary.writeInt32(t,e,5),jspb.internal.binary.writeMessage(t,e,6,proto.acceleration.FallbackSettings,proto.acceleration.FallbackSettings.serializeBinaryToWriter),jspb.internal.binary.writeBool(t,e,7),jspb.internal.binary.writeEnum(t,e,8),jspb.internal.binary.writeBool(t,e,9),jspb.internal.binary.writeBool(t,e,10),jspb.internal.binary.writeBool(t,e,11),jspb.internal.binary.writeInt64(t,e,12),jspb.internal.binary.serializeBinaryExtensionsAndUnknownFields(e,t)},proto.acceleration.NNAPIDelegateSettings.deserializeBinary=function(e){return jspb.internal.binary.deserializeBinary(e,proto.acceleration.NNAPIDelegateSettings,proto.acceleration.NNAPIDelegateSettings.internalDoNotUse$proto$acceleration$NNAPIDelegateSettings$getBinaryFieldsObject)},proto.acceleration.NNAPIDelegateSettings.deserializeBinaryFromReader=function(e,t){return module$contents$jspb$internal$binary_deserializeBinaryFromReaderGeneric(e,t,proto.acceleration.NNAPIDelegateSettings.internalDoNotUse$proto$acceleration$NNAPIDelegateSettings$getBinaryFieldsObject)},proto.acceleration.NNAPIDelegateSettings.deserialize=function(e){return module$exports$jspb.Message.deserializeWithCtor(proto.acceleration.NNAPIDelegateSettings,e)},proto.acceleration.NNAPIDelegateSettings.ObjectFormat=function(){},module$contents$jspb$internal$public_for_gencode_GENERATE_FROM_OBJECT&&(proto.acceleration.NNAPIDelegateSettings.fromObject=function(e){var t=new proto.acceleration.NNAPIDelegateSettings;return null!=e.acceleratorName&&t.internal_setField(1,e.acceleratorName),null!=e.cacheDirectory&&t.internal_setField(2,e.cacheDirectory),null!=e.modelToken&&t.internal_setField(3,e.modelToken),null!=e.executionPreference&&t.internal_setField(4,e.executionPreference),null!=e.noOfNnapiInstancesToCache&&t.internal_setField(5,e.noOfNnapiInstancesToCache),e.fallbackSettings&&t.internal_setWrapperField(6,proto.acceleration.FallbackSettings.fromObject(e.fallbackSettings)),null!=e.allowNnapiCpuOnAndroid10Plus&&t.internal_setField(7,e.allowNnapiCpuOnAndroid10Plus),null!=e.executionPriority&&t.internal_setField(8,e.executionPriority),null!=e.allowDynamicDimensions&&t.internal_setField(9,e.allowDynamicDimensions),null!=e.allowFp16PrecisionForFp32&&t.internal_setField(10,e.allowFp16PrecisionForFp32),null!=e.useBurstComputation&&t.internal_setField(11,e.useBurstComputation),null!=e.supportLibraryHandle&&t.internal_setField(12,e.supportLibraryHandle),t}),proto.acceleration.NNAPIDelegateSettings.prototype.toObject=function(e){return proto.acceleration.NNAPIDelegateSettings.internal_toObject(e,this)},proto.acceleration.NNAPIDelegateSettings.internal_toObject=function(e,t){if(null!=t){var n={acceleratorName:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(1)),cacheDirectory:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(2)),modelToken:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(3)),executionPreference:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(4)),noOfNnapiInstancesToCache:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(5)),fallbackSettings:proto.acceleration.FallbackSettings.internal_toObject(e,t.getFallbackSettings()),allowNnapiCpuOnAndroid10Plus:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getBooleanField(7)),executionPriority:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(8)),allowDynamicDimensions:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getBooleanField(9)),allowFp16PrecisionForFp32:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getBooleanField(10)),useBurstComputation:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getBooleanField(11)),supportLibraryHandle:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(12))};return e&&(n.$jspbMessageInstance=t),n}},proto.acceleration.XNNPackSettings=function(e){module$contents$jspb$internal$public_for_gencode_GeneratedMessage.call(this,e)},$jscomp.inherits(proto.acceleration.XNNPackSettings,module$contents$jspb$internal$public_for_gencode_GeneratedMessage),proto.acceleration.XNNPackSettings.prototype.getNumThreads=function(){return this.internal_getField(1)},proto.acceleration.XNNPackSettings.prototype.setNumThreads=function(e){return this.internal_setField(1,e)},proto.acceleration.XNNPackSettings.prototype.clearNumThreads=function(){return this.internal_clearField(1)},proto.acceleration.XNNPackSettings.prototype.hasNumThreads=function(){return this.internal_hasField(1)},proto.acceleration.XNNPackSettings.internalDoNotUse$proto$acceleration$XNNPackSettings$getBinaryFieldsObject=function(){return{1:jspb.internal.binary.readInt32}},proto.acceleration.XNNPackSettings.prototype.serializeBinary=function(){return jspb.internal.binary.serializeBinary(this,proto.acceleration.XNNPackSettings.serializeBinaryToWriter)},proto.acceleration.XNNPackSettings.serializeBinaryToWriter=function(e,t){jspb.internal.binary.writeInt32(t,e,1),jspb.internal.binary.serializeBinaryExtensionsAndUnknownFields(e,t)},proto.acceleration.XNNPackSettings.deserializeBinary=function(e){return jspb.internal.binary.deserializeBinary(e,proto.acceleration.XNNPackSettings,proto.acceleration.XNNPackSettings.internalDoNotUse$proto$acceleration$XNNPackSettings$getBinaryFieldsObject)},proto.acceleration.XNNPackSettings.deserializeBinaryFromReader=function(e,t){return module$contents$jspb$internal$binary_deserializeBinaryFromReaderGeneric(e,t,proto.acceleration.XNNPackSettings.internalDoNotUse$proto$acceleration$XNNPackSettings$getBinaryFieldsObject)},proto.acceleration.XNNPackSettings.deserialize=function(e){return module$exports$jspb.Message.deserializeWithCtor(proto.acceleration.XNNPackSettings,e)},proto.acceleration.XNNPackSettings.ObjectFormat=function(){},module$contents$jspb$internal$public_for_gencode_GENERATE_FROM_OBJECT&&(proto.acceleration.XNNPackSettings.fromObject=function(e){var t=new proto.acceleration.XNNPackSettings;return null!=e.numThreads&&t.internal_setField(1,e.numThreads),t}),proto.acceleration.XNNPackSettings.prototype.toObject=function(e){return proto.acceleration.XNNPackSettings.internal_toObject(e,this)},proto.acceleration.XNNPackSettings.internal_toObject=function(e,t){if(null!=t){var n={numThreads:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(1))};return e&&(n.$jspbMessageInstance=t),n}},proto.acceleration.TFLiteSettings=function(e){module$contents$jspb$internal$public_for_gencode_GeneratedMessage.call(this,e)},$jscomp.inherits(proto.acceleration.TFLiteSettings,module$contents$jspb$internal$public_for_gencode_GeneratedMessage),proto.acceleration.TFLiteSettings.prototype.getDelegate=function(){return this.internal_getField(1)},proto.acceleration.TFLiteSettings.prototype.setDelegate=function(e){return this.internal_setField(1,e)},proto.acceleration.TFLiteSettings.prototype.clearDelegate=function(){return this.internal_clearField(1)},proto.acceleration.TFLiteSettings.prototype.hasDelegate=function(){return this.internal_hasField(1)},proto.acceleration.TFLiteSettings.prototype.getNnapiSettings=function(){return this.internal_getWrapperField(proto.acceleration.NNAPIDelegateSettings,2)},proto.acceleration.TFLiteSettings.prototype.setNnapiSettings=function(e){return this.internal_setWrapperField(2,e)},proto.acceleration.TFLiteSettings.prototype.clearNnapiSettings=function(){return this.internal_clearWrapperField(2)},proto.acceleration.TFLiteSettings.prototype.hasNnapiSettings=function(){return this.internal_hasField(2)},proto.acceleration.TFLiteSettings.prototype.getGpuSettings=function(){return this.internal_getWrapperField(proto.acceleration.GPUDelegateSettings,3)},proto.acceleration.TFLiteSettings.prototype.setGpuSettings=function(e){return this.internal_setWrapperField(3,e)},proto.acceleration.TFLiteSettings.prototype.clearGpuSettings=function(){return this.internal_clearWrapperField(3)},proto.acceleration.TFLiteSettings.prototype.hasGpuSettings=function(){return this.internal_hasField(3)},proto.acceleration.TFLiteSettings.prototype.getCpuSettings=function(){return this.internal_getWrapperField(proto.acceleration.CPUSettings,4)},proto.acceleration.TFLiteSettings.prototype.setCpuSettings=function(e){return this.internal_setWrapperField(4,e)},proto.acceleration.TFLiteSettings.prototype.clearCpuSettings=function(){return this.internal_clearWrapperField(4)}
2,proto.acceleration.TFLiteSettings.prototype.hasCpuSettings=function(){return this.internal_hasField(4)},proto.acceleration.TFLiteSettings.prototype.getHexagonSettings=function(){return this.internal_getWrapperField(proto.acceleration.HexagonDelegateSettings,5)},proto.acceleration.TFLiteSettings.prototype.setHexagonSettings=function(e){return this.internal_setWrapperField(5,e)},proto.acceleration.TFLiteSettings.prototype.clearHexagonSettings=function(){return this.internal_clearWrapperField(5)},proto.acceleration.TFLiteSettings.prototype.hasHexagonSettings=function(){return this.internal_hasField(5)},proto.acceleration.TFLiteSettings.prototype.getEdgetpuSettings=function(){return this.internal_getWrapperField(proto.acceleration.EdgeTpuDelegateSettings,10)},proto.acceleration.TFLiteSettings.prototype.setEdgetpuSettings=function(e){return this.internal_setWrapperField(10,e)},proto.acceleration.TFLiteSettings.prototype.clearEdgetpuSettings=function(){return this.internal_clearWrapperField(10)},proto.acceleration.TFLiteSettings.prototype.hasEdgetpuSettings=function(){return this.internal_hasField(10)},proto.acceleration.TFLiteSettings.prototype.getCoralSettings=function(){return this.internal_getWrapperField(proto.acceleration.CoralDelegateSettings,12)},proto.acceleration.TFLiteSettings.prototype.setCoralSettings=function(e){return this.internal_setWrapperField(12,e)},proto.acceleration.TFLiteSettings.prototype.clearCoralSettings=function(){return this.internal_clearWrapperField(12)},proto.acceleration.TFLiteSettings.prototype.hasCoralSettings=function(){return this.internal_hasField(12)},proto.acceleration.TFLiteSettings.prototype.getXnnpackSettings=function(){return this.internal_getWrapperField(proto.acceleration.XNNPackSettings,13)},proto.acceleration.TFLiteSettings.prototype.setXnnpackSettings=function(e){return this.internal_setWrapperField(13,e)},proto.acceleration.TFLiteSettings.prototype.clearXnnpackSettings=function(){return this.internal_clearWrapperField(13)},proto.acceleration.TFLiteSettings.prototype.hasXnnpackSettings=function(){return this.internal_hasField(13)},proto.acceleration.TFLiteSettings.prototype.getEnumerationHangDetection=function(){return this.internal_getWrapperField(proto.acceleration.HangDetectionSettings,6)},proto.acceleration.TFLiteSettings.prototype.setEnumerationHangDetection=function(e){return this.internal_setWrapperField(6,e)},proto.acceleration.TFLiteSettings.prototype.clearEnumerationHangDetection=function(){return this.internal_clearWrapperField(6)},proto.acceleration.TFLiteSettings.prototype.hasEnumerationHangDetection=function(){return this.internal_hasField(6)},proto.acceleration.TFLiteSettings.prototype.getCompilationHangDetection=function(){return this.internal_getWrapperField(proto.acceleration.HangDetectionSettings,7)},proto.acceleration.TFLiteSettings.prototype.setCompilationHangDetection=function(e){return this.internal_setWrapperField(7,e)},proto.acceleration.TFLiteSettings.prototype.clearCompilationHangDetection=function(){return this.internal_clearWrapperField(7)},proto.acceleration.TFLiteSettings.prototype.hasCompilationHangDetection=function(){return this.internal_hasField(7)},proto.acceleration.TFLiteSettings.prototype.getExecutionHangDetection=function(){return this.internal_getWrapperField(proto.acceleration.HangDetectionSettings,8)},proto.acceleration.TFLiteSettings.prototype.setExecutionHangDetection=function(e){return this.internal_setWrapperField(8,e)},proto.acceleration.TFLiteSettings.prototype.clearExecutionHangDetection=function(){return this.internal_clearWrapperField(8)},proto.acceleration.TFLiteSettings.prototype.hasExecutionHangDetection=function(){return this.internal_hasField(8)},proto.acceleration.TFLiteSettings.prototype.getAllowFp16PrecisionForFp32=function(){return this.internal_getBooleanField(9)},proto.acceleration.TFLiteSettings.prototype.setAllowFp16PrecisionForFp32=function(e){return this.internal_setField(9,e)},proto.acceleration.TFLiteSettings.prototype.clearAllowFp16PrecisionForFp32=function(){return this.internal_clearField(9)},proto.acceleration.TFLiteSettings.prototype.hasAllowFp16PrecisionForFp32=function(){return this.internal_hasField(9)},proto.acceleration.TFLiteSettings.prototype.getFallbackSettings=function(){return this.internal_getWrapperField(proto.acceleration.FallbackSettings,11)},proto.acceleration.TFLiteSettings.prototype.setFallbackSettings=function(e){return this.internal_setWrapperField(11,e)},proto.acceleration.TFLiteSettings.prototype.clearFallbackSettings=function(){return this.internal_clearWrapperField(11)},proto.acceleration.TFLiteSettings.prototype.hasFallbackSettings=function(){return this.internal_hasField(11)},proto.acceleration.TFLiteSettings.prototype.getMaxDelegatedPartitions=function(){return this.internal_getIntegerFieldWithDefault(14,-1)},proto.acceleration.TFLiteSettings.prototype.setMaxDelegatedPartitions=function(e){return this.internal_setField(14,e)},proto.acceleration.TFLiteSettings.prototype.clearMaxDelegatedPartitions=function(){return this.internal_clearField(14)},proto.acceleration.TFLiteSettings.prototype.hasMaxDelegatedPartitions=function(){return this.internal_hasField(14)},proto.acceleration.TFLiteSettings.internalDoNotUse$proto$acceleration$TFLiteSettings$getBinaryFieldsObject=function(){return{1:jspb.internal.binary.readEnum,2:[jspb.internal.binary.readMessage,proto.acceleration.NNAPIDelegateSettings,proto.acceleration.NNAPIDelegateSettings.internalDoNotUse$proto$acceleration$NNAPIDelegateSettings$getBinaryFieldsObject],3:[jspb.internal.binary.readMessage,proto.acceleration.GPUDelegateSettings,proto.acceleration.GPUDelegateSettings.internalDoNotUse$proto$acceleration$GPUDelegateSettings$getBinaryFieldsObject],4:[jspb.internal.binary.readMessage,proto.acceleration.CPUSettings,proto.acceleration.CPUSettings.internalDoNotUse$proto$acceleration$CPUSettings$getBinaryFieldsObject],5:[jspb.internal.binary.readMessage,proto.acceleration.HexagonDelegateSettings,proto.acceleration.HexagonDelegateSettings.internalDoNotUse$proto$acceleration$HexagonDelegateSettings$getBinaryFieldsObject],10:[jspb.internal.binary.readMessage,proto.acceleration.EdgeTpuDelegateSettings,proto.acceleration.EdgeTpuDelegateSettings.internalDoNotUse$proto$acceleration$EdgeTpuDelegateSettings$getBinaryFieldsObject],12:[jspb.internal.binary.readMessage,proto.acceleration.CoralDelegateSettings,proto.acceleration.CoralDelegateSettings.internalDoNotUse$proto$acceleration$CoralDelegateSettings$getBinaryFieldsObject],13:[jspb.internal.binary.readMessage,proto.acceleration.XNNPackSettings,proto.acceleration.XNNPackSettings.internalDoNotUse$proto$acceleration$XNNPackSettings$getBinaryFieldsObject],6:[jspb.internal.binary.readMessage,proto.acceleration.HangDetectionSettings,proto.acceleration.HangDetectionSettings.internalDoNotUse$proto$acceleration$HangDetectionSettings$getBinaryFieldsObject],7:[jspb.internal.binary.readMessage,proto.acceleration.HangDetectionSettings,proto.acceleration.HangDetectionSettings.internalDoNotUse$proto$acceleration$HangDetectionSettings$getBinaryFieldsObject],8:[jspb.internal.binary.readMessage,proto.acceleration.HangDetectionSettings,proto.acceleration.HangDetectionSettings.internalDoNotUse$proto$acceleration$HangDetectionSettings$getBinaryFieldsObject],9:jspb.internal.binary.readBool,11:[jspb.internal.binary.readMessage,proto.acceleration.FallbackSettings,proto.acceleration.FallbackSettings.internalDoNotUse$proto$acceleration$FallbackSettings$getBinaryFieldsObject],14:jspb.internal.binary.readInt32}},proto.acceleration.TFLiteSettings.prototype.serializeBinary=function(){return jspb.internal.binary.serializeBinary(this,proto.acceleration.TFLiteSettings.serializeBinaryToWriter)},proto.acceleration.TFLiteSettings.serializeBinaryToWriter=function(e,t){jspb.internal.binary.writeEnum(t,e,1),jspb.internal.binary.writeMessage(t,e,2,proto.acceleration.NNAPIDelegateSettings,proto.acceleration.NNAPIDelegateSettings.serializeBinaryToWriter),jspb.internal.binary.writeMessage(t,e,3,proto.acceleration.GPUDelegateSettings,proto.acceleration.GPUDelegateSettings.serializeBinaryToWriter),jspb.internal.binary.writeMessage(t,e,4,proto.acceleration.CPUSettings,proto.acceleration.CPUSettings.serializeBinaryToWriter),jspb.internal.binary.writeMessage(t,e,5,proto.acceleration.HexagonDelegateSettings,proto.acceleration.HexagonDelegateSettings.serializeBinaryToWriter),jspb.internal.binary.writeMessage(t,e,10,proto.acceleration.EdgeTpuDelegateSettings,proto.acceleration.EdgeTpuDelegateSettings.serializeBinaryToWriter),jspb.internal.binary.writeMessage(t,e,12,proto.acceleration.CoralDelegateSettings,proto.acceleration.CoralDelegateSettings.serializeBinaryToWriter),jspb.internal.binary.writeMessage(t,e,13,proto.acceleration.XNNPackSettings,proto.acceleration.XNNPackSettings.serializeBinaryToWriter),jspb.internal.binary.writeMessage(t,e,6,proto.acceleration.HangDetectionSettings,proto.acceleration.HangDetectionSettings.serializeBinaryToWriter),jspb.internal.binary.writeMessage(t,e,7,proto.acceleration.HangDetectionSettings,proto.acceleration.HangDetectionSettings.serializeBinaryToWriter),jspb.internal.binary.writeMessage(t,e,8,proto.acceleration.HangDetectionSettings,proto.acceleration.HangDetectionSettings.serializeBinaryToWriter),jspb.internal.binary.writeBool(t,e,9),jspb.internal.binary.writeMessage(t,e,11,proto.acceleration.FallbackSettings,proto.acceleration.FallbackSettings.serializeBinaryToWriter),jspb.internal.binary.writeInt32(t,e,14),jspb.internal.binary.serializeBinaryExtensionsAndUnknownFields(e,t)},proto.acceleration.TFLiteSettings.deserializeBinary=function(e){return jspb.internal.binary.deserializeBinary(e,proto.acceleration.TFLiteSettings,proto.acceleration.TFLiteSettings.internalDoNotUse$proto$acceleration$TFLiteSettings$getBinaryFieldsObject)},proto.acceleration.TFLiteSettings.deserializeBinaryFromReader=function(e,t){return module$contents$jspb$internal$binary_deserializeBinaryFromReaderGeneric(e,t,proto.acceleration.TFLiteSettings.internalDoNotUse$proto$acceleration$TFLiteSettings$getBinaryFieldsObject)},proto.acceleration.TFLiteSettings.deserialize=function(e){return module$exports$jspb.Message.deserializeWithCtor(proto.acceleration.TFLiteSettings,e)},proto.acceleration.TFLiteSettings.ObjectFormat=function(){},module$contents$jspb$internal$public_for_gencode_GENERATE_FROM_OBJECT&&(proto.acceleration.TFLiteSettings.fromObject=function(e){var t=new proto.acceleration.TFLiteSettings;return null!=e.delegate&&t.internal_setField(1,e.delegate),e.nnapiSettings&&t.internal_setWrapperField(2,proto.acceleration.NNAPIDelegateSettings.fromObject(e.nnapiSettings)),e.gpuSettings&&t.internal_setWrapperField(3,proto.acceleration.GPUDelegateSettings.fromObject(e.gpuSettings)),e.cpuSettings&&t.internal_setWrapperField(4,proto.acceleration.CPUSettings.fromObject(e.cpuSettings)),e.hexagonSettings&&t.internal_setWrapperField(5,proto.acceleration.HexagonDelegateSettings.fromObject(e.hexagonSettings)),e.edgetpuSettings&&t.internal_setWrapperField(10,proto.acceleration.EdgeTpuDelegateSettings.fromObject(e.edgetpuSettings)),e.coralSettings&&t.internal_setWrapperField(12,proto.acceleration.CoralDelegateSettings.fromObject(e.coralSettings)),e.xnnpackSettings&&t.internal_setWrapperField(13,proto.acceleration.XNNPackSettings.fromObject(e.xnnpackSettings)),e.enumerationHangDetection&&t.internal_setWrapperField(6,proto.acceleration.HangDetectionSettings.fromObject(e.enumerationHangDetection)),e.compilationHangDetection&&t.internal_setWrapperField(7,proto.acceleration.HangDetectionSettings.fromObject(e.compilationHangDetection)),e.executionHangDetection&&t.internal_setWrapperField(8,proto.acceleration.HangDetectionSettings.fromObject(e.executionHangDetection)),null!=e.allowFp16PrecisionForFp32&&t.internal_setField(9,e.allowFp16PrecisionForFp32),e.fallbackSettings&&t.internal_setWrapperField(11,proto.acceleration.FallbackSettings.fromObject(e.fallbackSettings)),null!=e.maxDelegatedPartitions&&t.internal_setField(14,e.maxDelegatedPartitions),t}),proto.acceleration.TFLiteSettings.prototype.toObject=function(e){return proto.acceleration.TFLiteSettings.internal_toObject(e,this)},proto.acceleration.TFLiteSettings.internal_toObject=function(e,t){if(null!=t){var n={delegate:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(1)),nnapiSettings:proto.acceleration.NNAPIDelegateSettings.internal_toObject(e,t.getNnapiSettings()),gpuSettings:proto.acceleration.GPUDelegateSettings.internal_toObject(e,t.getGpuSettings()),cpuSettings:proto.acceleration.CPUSettings.internal_toObject(e,t.getCpuSettings()),hexagonSettings:proto.acceleration.HexagonDelegateSettings.internal_toObject(e,t.getHexagonSettings()),edgetpuSettings:proto.acceleration.EdgeTpuDelegateSettings.internal_toObject(e,t.getEdgetpuSettings()),c
2oralSettings:proto.acceleration.CoralDelegateSettings.internal_toObject(e,t.getCoralSettings()),xnnpackSettings:proto.acceleration.XNNPackSettings.internal_toObject(e,t.getXnnpackSettings()),enumerationHangDetection:proto.acceleration.HangDetectionSettings.internal_toObject(e,t.getEnumerationHangDetection()),compilationHangDetection:proto.acceleration.HangDetectionSettings.internal_toObject(e,t.getCompilationHangDetection()),executionHangDetection:proto.acceleration.HangDetectionSettings.internal_toObject(e,t.getExecutionHangDetection()),allowFp16PrecisionForFp32:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getBooleanField(9)),fallbackSettings:proto.acceleration.FallbackSettings.internal_toObject(e,t.getFallbackSettings()),maxDelegatedPartitions:t.internal_getIntegerFieldWithDefault(14,-1)};return e&&(n.$jspbMessageInstance=t),n}},proto.acceleration.MinibenchmarkSettings=function(e){module$contents$jspb$internal$public_for_gencode_GeneratedMessage.call(this,e,-1,proto.acceleration.MinibenchmarkSettings.repeatedFields_)},$jscomp.inherits(proto.acceleration.MinibenchmarkSettings,module$contents$jspb$internal$public_for_gencode_GeneratedMessage),proto.acceleration.MinibenchmarkSettings.prototype.getSettingsToTestList=function(){return this.internal_getRepeatedWrapperField(proto.acceleration.TFLiteSettings,1)},proto.acceleration.MinibenchmarkSettings.prototype.setSettingsToTestList=function(e){return this.internal_setRepeatedWrapperField(1,e)},proto.acceleration.MinibenchmarkSettings.prototype.addSettingsToTest=function(e,t){return this.internal_addToRepeatedWrapperField(1,e,proto.acceleration.TFLiteSettings,t)},proto.acceleration.MinibenchmarkSettings.prototype.addAndReturnSettingsToTest=function(e,t){return this.internal_addAndReturnRepeatedWrapperField(1,e,proto.acceleration.TFLiteSettings,t)},proto.acceleration.MinibenchmarkSettings.prototype.clearSettingsToTestList=function(){return this.internal_clearRepeatedWrapperField(1)},proto.acceleration.MinibenchmarkSettings.prototype.getModelFile=function(){return this.internal_getWrapperField(proto.acceleration.ModelFile,2)},proto.acceleration.MinibenchmarkSettings.prototype.setModelFile=function(e){return this.internal_setWrapperField(2,e)},proto.acceleration.MinibenchmarkSettings.prototype.clearModelFile=function(){return this.internal_clearWrapperField(2)},proto.acceleration.MinibenchmarkSettings.prototype.hasModelFile=function(){return this.internal_hasField(2)},proto.acceleration.MinibenchmarkSettings.prototype.getStoragePaths=function(){return this.internal_getWrapperField(proto.acceleration.BenchmarkStoragePaths,3)},proto.acceleration.MinibenchmarkSettings.prototype.setStoragePaths=function(e){return this.internal_setWrapperField(3,e)},proto.acceleration.MinibenchmarkSettings.prototype.clearStoragePaths=function(){return this.internal_clearWrapperField(3)},proto.acceleration.MinibenchmarkSettings.prototype.hasStoragePaths=function(){return this.internal_hasField(3)},proto.acceleration.MinibenchmarkSettings.internalDoNotUse$proto$acceleration$MinibenchmarkSettings$getBinaryFieldsObject=function(){return{1:[jspb.internal.binary.readRepeatedMessage,proto.acceleration.TFLiteSettings,proto.acceleration.TFLiteSettings.internalDoNotUse$proto$acceleration$TFLiteSettings$getBinaryFieldsObject],2:[jspb.internal.binary.readMessage,proto.acceleration.ModelFile,proto.acceleration.ModelFile.internalDoNotUse$proto$acceleration$ModelFile$getBinaryFieldsObject],3:[jspb.internal.binary.readMessage,proto.acceleration.BenchmarkStoragePaths,proto.acceleration.BenchmarkStoragePaths.internalDoNotUse$proto$acceleration$BenchmarkStoragePaths$getBinaryFieldsObject]}},proto.acceleration.MinibenchmarkSettings.prototype.serializeBinary=function(){return jspb.internal.binary.serializeBinary(this,proto.acceleration.MinibenchmarkSettings.serializeBinaryToWriter)},proto.acceleration.MinibenchmarkSettings.serializeBinaryToWriter=function(e,t){jspb.internal.binary.writeRepeatedMessage(t,e,1,proto.acceleration.TFLiteSettings,proto.acceleration.TFLiteSettings.serializeBinaryToWriter),jspb.internal.binary.writeMessage(t,e,2,proto.acceleration.ModelFile,proto.acceleration.ModelFile.serializeBinaryToWriter),jspb.internal.binary.writeMessage(t,e,3,proto.acceleration.BenchmarkStoragePaths,proto.acceleration.BenchmarkStoragePaths.serializeBinaryToWriter),jspb.internal.binary.serializeBinaryExtensionsAndUnknownFields(e,t)},proto.acceleration.MinibenchmarkSettings.deserializeBinary=function(e){return jspb.internal.binary.deserializeBinary(e,proto.acceleration.MinibenchmarkSettings,proto.acceleration.MinibenchmarkSettings.internalDoNotUse$proto$acceleration$MinibenchmarkSettings$getBinaryFieldsObject)},proto.acceleration.MinibenchmarkSettings.deserializeBinaryFromReader=function(e,t){return module$contents$jspb$internal$binary_deserializeBinaryFromReaderGeneric(e,t,proto.acceleration.MinibenchmarkSettings.internalDoNotUse$proto$acceleration$MinibenchmarkSettings$getBinaryFieldsObject)},proto.acceleration.MinibenchmarkSettings.deserialize=function(e){return module$exports$jspb.Message.deserializeWithCtor(proto.acceleration.MinibenchmarkSettings,e)},proto.acceleration.MinibenchmarkSettings.repeatedFields_=[1],proto.acceleration.MinibenchmarkSettings.ObjectFormat=function(){},module$contents$jspb$internal$public_for_gencode_GENERATE_FROM_OBJECT&&(proto.acceleration.MinibenchmarkSettings.fromObject=function(e){var t=new proto.acceleration.MinibenchmarkSettings;return e.settingsToTestList&&t.internal_setRepeatedWrapperField(1,e.settingsToTestList.map(proto.acceleration.TFLiteSettings.fromObject)),e.modelFile&&t.internal_setWrapperField(2,proto.acceleration.ModelFile.fromObject(e.modelFile)),e.storagePaths&&t.internal_setWrapperField(3,proto.acceleration.BenchmarkStoragePaths.fromObject(e.storagePaths)),t}),proto.acceleration.MinibenchmarkSettings.prototype.toObject=function(e){return proto.acceleration.MinibenchmarkSettings.internal_toObject(e,this)},proto.acceleration.MinibenchmarkSettings.internal_toObject=function(e,t){if(null!=t){var n={settingsToTestList:module$contents$jspb$internal$public_for_gencode_toObjectList(t.getSettingsToTestList(),proto.acceleration.TFLiteSettings.internal_toObject,e),modelFile:proto.acceleration.ModelFile.internal_toObject(e,t.getModelFile()),storagePaths:proto.acceleration.BenchmarkStoragePaths.internal_toObject(e,t.getStoragePaths())};return e&&(n.$jspbMessageInstance=t),n}},proto.acceleration.Acceleration=function(e){module$contents$jspb$internal$public_for_gencode_GeneratedMessage.call(this,e)},$jscomp.inherits(proto.acceleration.Acceleration,module$contents$jspb$internal$public_for_gencode_GeneratedMessage),proto.acceleration.Acceleration.prototype.getPreference=function(){return this.internal_getField(1)},proto.acceleration.Acceleration.prototype.setPreference=function(e){return this.internal_setField(1,e)},proto.acceleration.Acceleration.prototype.clearPreference=function(){return this.internal_clearField(1)},proto.acceleration.Acceleration.prototype.hasPreference=function(){return this.internal_hasField(1)},proto.acceleration.Acceleration.prototype.getTfliteSettings=function(){return this.internal_getWrapperField(proto.acceleration.TFLiteSettings,2)},proto.acceleration.Acceleration.prototype.setTfliteSettings=function(e){return this.internal_setWrapperField(2,e)},proto.acceleration.Acceleration.prototype.clearTfliteSettings=function(){return this.internal_clearWrapperField(2)},proto.acceleration.Acceleration.prototype.hasTfliteSettings=function(){return this.internal_hasField(2)},proto.acceleration.Acceleration.prototype.getModelIdentifierForStatistics=function(){return this.internal_getWrapperField(proto.acceleration.InferenceToUseFor,3)},proto.acceleration.Acceleration.prototype.setModelIdentifierForStatistics=function(e){return this.internal_setWrapperField(3,e)},proto.acceleration.Acceleration.prototype.clearModelIdentifierForStatistics=function(){return this.internal_clearWrapperField(3)},proto.acceleration.Acceleration.prototype.hasModelIdentifierForStatistics=function(){return this.internal_hasField(3)},proto.acceleration.Acceleration.prototype.getSettingsToTestLocally=function(){return this.internal_getWrapperField(proto.acceleration.MinibenchmarkSettings,5)},proto.acceleration.Acceleration.prototype.setSettingsToTestLocally=function(e){return this.internal_setWrapperField(5,e)},proto.acceleration.Acceleration.prototype.clearSettingsToTestLocally=function(){return this.internal_clearWrapperField(5)},proto.acceleration.Acceleration.prototype.hasSettingsToTestLocally=function(){return this.internal_hasField(5)},proto.acceleration.Acceleration.internalDoNotUse$proto$acceleration$Acceleration$getBinaryFieldsObject=function(){return{1:jspb.internal.binary.readEnum,2:[jspb.internal.binary.readMessage,proto.acceleration.TFLiteSettings,proto.acceleration.TFLiteSettings.internalDoNotUse$proto$acceleration$TFLiteSettings$getBinaryFieldsObject],3:[jspb.internal.binary.readMessage,proto.acceleration.InferenceToUseFor,proto.acceleration.InferenceToUseFor.internalDoNotUse$proto$acceleration$InferenceToUseFor$getBinaryFieldsObject],5:[jspb.internal.binary.readMessage,proto.acceleration.MinibenchmarkSettings,proto.acceleration.MinibenchmarkSettings.internalDoNotUse$proto$acceleration$MinibenchmarkSettings$getBinaryFieldsObject]}},proto.acceleration.Acceleration.prototype.serializeBinary=function(){return jspb.internal.binary.serializeBinary(this,proto.acceleration.Acceleration.seri
2alizeBinaryToWriter)},proto.acceleration.Acceleration.serializeBinaryToWriter=function(e,t){jspb.internal.binary.writeEnum(t,e,1),jspb.internal.binary.writeMessage(t,e,2,proto.acceleration.TFLiteSettings,proto.acceleration.TFLiteSettings.serializeBinaryToWriter),jspb.internal.binary.writeMessage(t,e,3,proto.acceleration.InferenceToUseFor,proto.acceleration.InferenceToUseFor.serializeBinaryToWriter),jspb.internal.binary.writeMessage(t,e,5,proto.acceleration.MinibenchmarkSettings,proto.acceleration.MinibenchmarkSettings.serializeBinaryToWriter),jspb.internal.binary.serializeBinaryExtensionsAndUnknownFields(e,t)},proto.acceleration.Acceleration.deserializeBinary=function(e){return jspb.internal.binary.deserializeBinary(e,proto.acceleration.Acceleration,proto.acceleration.Acceleration.internalDoNotUse$proto$acceleration$Acceleration$getBinaryFieldsObject)},proto.acceleration.Acceleration.deserializeBinaryFromReader=function(e,t){return module$contents$jspb$internal$binary_deserializeBinaryFromReaderGeneric(e,t,proto.acceleration.Acceleration.internalDoNotUse$proto$acceleration$Acceleration$getBinaryFieldsObject)},proto.acceleration.Acceleration.deserialize=function(e){return module$exports$jspb.Message.deserializeWithCtor(proto.acceleration.Acceleration,e)},proto.acceleration.Acceleration.ObjectFormat=function(){},module$contents$jspb$internal$public_for_gencode_GENERATE_FROM_OBJECT&&(proto.acceleration.Acceleration.fromObject=function(e){var t=new proto.acceleration.Acceleration;return null!=e.preference&&t.internal_setField(1,e.preference),e.tfliteSettings&&t.internal_setWrapperField(2,proto.acceleration.TFLiteSettings.fromObject(e.tfliteSettings)),e.modelIdentifierForStatistics&&t.internal_setWrapperField(3,proto.acceleration.InferenceToUseFor.fromObject(e.modelIdentifierForStatistics)),e.settingsToTestLocally&&t.internal_setWrapperField(5,proto.acceleration.MinibenchmarkSettings.fromObject(e.settingsToTestLocally)),t}),proto.acceleration.Acceleration.prototype.toObject=function(e){return proto.acceleration.Acceleration.internal_toObject(e,this)},proto.acceleration.Acceleration.internal_toObject=function(e,t){if(null!=t){var n={preference:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(1)),tfliteSettings:proto.acceleration.TFLiteSettings.internal_toObject(e,t.getTfliteSettings()),modelIdentifierForStatistics:proto.acceleration.InferenceToUseFor.internal_toObject(e,t.getModelIdentifierForStatistics()),settingsToTestLocally:proto.acceleration.MinibenchmarkSettings.internal_toObject(e,t.getSettingsToTestLocally())};return e&&(n.$jspbMessageInstance=t),n}},proto.visionkit={},proto.visionkit.FileDescriptorMeta=function(e){module$contents$jspb$internal$public_for_gencode_GeneratedMessage.call(this,e)},$jscomp.inherits(proto.visionkit.FileDescriptorMeta,module$contents$jspb$internal$public_for_gencode_GeneratedMessage),proto.visionkit.FileDescriptorMeta.prototype.getFd=function(){return this.internal_getField(1)},proto.visionkit.FileDescriptorMeta.prototype.setFd=function(e){return this.internal_setField(1,e)},proto.visionkit.FileDescriptorMeta.prototype.clearFd=function(){return this.internal_clearField(1)},proto.visionkit.FileDescriptorMeta.prototype.hasFd=function(){return this.internal_hasField(1)},proto.visionkit.FileDescriptorMeta.prototype.getLength=function(){return this.internal_getField(2)},proto.visionkit.FileDescriptorMeta.prototype.setLength=function(e){return this.internal_setField(2,e)},proto.visionkit.FileDescriptorMeta.prototype.clearLength=function(){return this.internal_clearField(2)},proto.visionkit.FileDescriptorMeta.prototype.hasLength=function(){return this.internal_hasField(2)},proto.visionkit.FileDescriptorMeta.prototype.getOffset=function(){return this.internal_getField(3)},proto.visionkit.FileDescriptorMeta.prototype.setOffset=function(e){return this.internal_setField(3,e)},proto.visionkit.FileDescriptorMeta.prototype.clearOffset=function(){return this.internal_clearField(3)},proto.visionkit.FileDescriptorMeta.prototype.hasOffset=function(){return this.internal_hasField(3)},proto.visionkit.FileDescriptorMeta.internalDoNotUse$proto$visionkit$FileDescriptorMeta$getBinaryFieldsObject=function(){return{1:jspb.internal.binary.readInt32,2:jspb.internal.binary.readInt64,3:jspb.internal.binary.readInt64}},proto.visionkit.FileDescriptorMeta.prototype.serializeBinary=function(){return jspb.internal.binary.serializeBinary(this,proto.visionkit.FileDescriptorMeta.serializeBinaryToWriter)},proto.visionkit.FileDescriptorMeta.serializeBinaryToWriter=function(e,t){jspb.internal.binary.writeInt32(t,e,1),jspb.internal.binary.writeInt64(t,e,2),jspb.internal.binary.writeInt64(t,e,3),jspb.internal.binary.serializeBinaryExtensionsAndUnknownFields(e,t)},proto.visionkit.FileDescriptorMeta.deserializeBinary=function(e){return jspb.internal.binary.deserializeBinary(e,proto.visionkit.FileDescriptorMeta,proto.visionkit.FileDescriptorMeta.internalDoNotUse$proto$visionkit$FileDescriptorMeta$getBinaryFieldsObject)},proto.visionkit.FileDescriptorMeta.deserializeBinaryFromReader=function(e,t){return module$contents$jspb$internal$binary_deserializeBinaryFromReaderGeneric(e,t,proto.visionkit.FileDescriptorMeta.internalDoNotUse$proto$visionkit$FileDescriptorMeta$getBinaryFieldsObject)},proto.visionkit.FileDescriptorMeta.deserialize=function(e){return module$exports$jspb.Message.deserializeWithCtor(proto.visionkit.FileDescriptorMeta,e)},proto.visionkit.FileDescriptorMeta.ObjectFormat=function(){},module$contents$jspb$internal$public_for_gencode_GENERATE_FROM_OBJECT&&(proto.visionkit.FileDescriptorMeta.fromObject=function(e){var t=new proto.visionkit.FileDescriptorMeta;return null!=e.fd&&t.internal_setField(1,e.fd),null!=e.length&&t.internal_setField(2,e.length),null!=e.offset&&t.internal_setField(3,e.offset),t}),proto.visionkit.FileDescriptorMeta.prototype.toObject=function(e){return proto.visionkit.FileDescriptorMeta.internal_toObject(e,this)},proto.visionkit.FileDescriptorMeta.internal_toObject=function(e,t){if(null!=t){var n={fd:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(1)),length:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(2)),offset:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(3))};return e&&(n.$jspbMessageInstance=t),n}},proto.visionkit.ExternalFile=function(e){module$contents$jspb$internal$public_for_gencode_GeneratedMessage.call(this,e)},$jscomp.inherits(proto.visionkit.ExternalFile,module$contents$jspb$internal$public_for_gencode_GeneratedMessage),proto.visionkit.ExternalFile.prototype.getFileContent=function(){return this.internal_getField(2)},proto.visionkit.ExternalFile.prototype.getFileContent_asB64=function(){return module$contents$jspb$internal_bytesAsB64(this.getFileContent())},proto.visionkit.ExternalFile.prototype.getFileContent_asU8=function(){return module$contents$jspb$internal_bytesAsU8(this.getFileContent())},proto.visionkit.ExternalFile.prototype.setFileContent=function(e){return this.internal_setField(2,e)},proto.visionkit.ExternalFile.prototype.clearFileContent=function(){return this.internal_clearField(2)},proto.visionkit.ExternalFile.prototype.hasFileContent=function(){return this.internal_hasField(2)},proto.visionkit.ExternalFile.prototype.getFileName=function(){return this.internal_getField(1)},proto.visionkit.ExternalFile.prototype.setFileName=function(e){return this.internal_setField(1,e)},proto.visionkit.ExternalFile.prototype.clearFileName=function(){return this.internal_clearField(1)},proto.visionkit.ExternalFile.prototype.hasFileName=function(){return this.internal_hasField(1)},proto.visionkit.ExternalFile.prototype.getFileDescriptorMeta=function(){return this.internal_getWrapperField(proto.visionkit.FileDescriptorMeta,4)},proto.visionkit.ExternalFile.prototype.setFileDescriptorMeta=function(e){return this.internal_setWrapperField(4,e)},proto.visionkit.ExternalFile.prototype.clearFileDescriptorMeta=function(){return this.internal_clearWrapperField(4)},proto.visionkit.ExternalFile.prototype.hasFileDescriptorMeta=function(){return this.internal_hasField(4)},proto.visionkit.ExternalFile.internalDoNotUse$proto$visionkit$ExternalFile$getBinaryFieldsObject=function(){return{2:jspb.internal.binary.readBytes,1:jspb.internal.binary.readString,4:[jspb.internal.binary.readMessage,proto.visionkit.FileDescriptorMeta,proto.visionkit.FileDescriptorMeta.internalDoNotUse$proto$visionkit$FileDescriptorMeta$getBinaryFieldsObject]}},proto.visionkit.ExternalFile.prototype.serializeBinary=function(){return jspb.internal.binary.serializeBinary(this,proto.visionkit.ExternalFile.serializeBinaryToWriter)},proto.visionkit.ExternalFile.serializeBinaryToWriter=function(e,t){jspb.internal.binary.writeBytes(t,e,2),jspb.internal.binary.writeString(t,e,1),jspb.internal.binary.writeMessage(t,e,4,proto.visionkit.FileDescriptorMeta,proto.visionkit.FileDescriptorMeta.serializeBinaryToWriter),jspb.internal.binary.serializeBinaryExtensionsAndUnknownFields(e,t)},proto.visionkit.ExternalFile.deserializeBinary=function(e){return jspb.internal.binary.deserializeBinary(e,proto.visionkit.ExternalFile,proto.visionkit.ExternalFile.internalDoNotUse$proto$visionkit$ExternalFile$getBinaryFieldsObject)},proto.visionkit.ExternalFile.deserializeBinaryFromReader=function(e,t){return module$contents$jspb$internal$binary_deserializeBinaryFromReaderGeneric(e,t,proto.visionkit.ExternalFile.internalDoNotUse$proto$visionkit$ExternalFile$getBinaryFieldsObject)},proto.visionkit.ExternalFile.deserialize=function(e){return module$exports$jspb.Message.deserializeWithCtor(proto.visionkit.ExternalFile,e)},proto.visionkit.ExternalFile.ObjectFormat=function(){},module$contents$jspb$internal$public_for_gencode_GENERATE_FROM_OBJECT&&(proto.visionkit.ExternalFile.fromObject=function(e){var t=new proto.visionkit.ExternalFile;
vendor: 10,727 bytes, line 2
2return null!=e.fileContent&&t.internal_setField(2,e.fileContent),null!=e.fileName&&t.internal_setField(1,e.fileName),e.fileDescriptorMeta&&t.internal_setWrapperField(4,proto.visionkit.FileDescriptorMeta.fromObject(e.fileDescriptorMeta)),t}),proto.visionkit.ExternalFile.prototype.toObject=function(e){return proto.visionkit.ExternalFile.internal_toObject(e,this)},proto.visionkit.ExternalFile.internal_toObject=function(e,t){if(null!=t){var n={fileContent:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.getFileContent_asB64()),fileName:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(1)),fileDescriptorMeta:proto.visionkit.FileDescriptorMeta.internal_toObject(e,t.getFileDescriptorMeta())};return e&&(n.$jspbMessageInstance=t),n}},goog.dom.asserts={},goog.dom.asserts.assertIsLocation=function(e){if(goog.asserts.ENABLE_ASSERTS){var t=goog.dom.asserts.getWindow_(e);t&&(!e||!(e instanceof t.Location)&&e instanceof t.Element)&&goog.asserts.fail("Argument is not a Location (or a non-Element mock); got: %s",goog.dom.asserts.debugStringForType_(e))}return e},goog.dom.asserts.assertIsElementType_=function(e,t){if(goog.asserts.ENABLE_ASSERTS){var n=goog.dom.asserts.getWindow_(e);n&&void 0!==n[t]&&(e&&(e instanceof n[t]||!(e instanceof n.Location||e instanceof n.Element))||goog.asserts.fail("Argument is not a %s (or a non-Element, non-Location mock); got: %s",t,goog.dom.asserts.debugStringForType_(e)))}return e},goog.dom.asserts.assertIsHTMLAnchorElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLAnchorElement")},goog.dom.asserts.assertIsHTMLButtonElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLButtonElement")},goog.dom.asserts.assertIsHTMLLinkElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLLinkElement")},goog.dom.asserts.assertIsHTMLImageElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLImageElement")},goog.dom.asserts.assertIsHTMLAudioElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLAudioElement")},goog.dom.asserts.assertIsHTMLVideoElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLVideoElement")},goog.dom.asserts.assertIsHTMLInputElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLInputElement")},goog.dom.asserts.assertIsHTMLTextAreaElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLTextAreaElement")},goog.dom.asserts.assertIsHTMLCanvasElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLCanvasElement")},goog.dom.asserts.assertIsHTMLEmbedElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLEmbedElement")},goog.dom.asserts.assertIsHTMLFormElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLFormElement")},goog.dom.asserts.assertIsHTMLFrameElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLFrameElement")},goog.dom.asserts.assertIsHTMLIFrameElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLIFrameElement")},goog.dom.asserts.assertIsHTMLObjectElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLObjectElement")},goog.dom.asserts.assertIsHTMLScriptElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLScriptElement")},goog.dom.asserts.debugStringForType_=function(e){if(!goog.isObject(e))return void 0===e?"undefined":null===e?"null":typeof e;try{return e.constructor.displayName||e.constructor.name||Object.prototype.toString.call(e)}catch(e){return"<object could not be stringified>"}},goog.dom.asserts.getWindow_=function(e){try{var t=e&&e.ownerDocument,n=t&&(t.defaultView||t.parentWindow);if((n=n||goog.global).Element&&n.Location)return n}catch(e){}return null},goog.dom.HtmlElement=function(){},goog.functions={},goog.functions.constant=function(e){return function(){return e}},goog.functions.FALSE=function(){return!1},goog.functions.TRUE=function(){return!0},goog.functions.NULL=function(){return null},goog.functions.UNDEFINED=function(){},goog.functions.EMPTY=goog.functions.UNDEFINED,goog.functions.identity=function(e){return e},goog.functions.error=function(e){return function(){throw Error(e)}},goog.functions.fail=function(e){return function(){throw e}},goog.functions.lock=function(e,t){return t=t||0,function(){return e.apply(this,Array.prototype.slice.call(arguments,0,t))}},goog.functions.nth=function(e){return function(){return arguments[e]}},goog.functions.partialRight=function(e,t){var n=Array.prototype.slice.call(arguments,1);return function(){var t=this;t===goog.global&&(t=void 0);var r=Array.prototype.slice.call(arguments);return r.push.apply(r,n),e.apply(t,r)}},goog.functions.withReturnValue=function(e,t){return goog.functions.sequence(e,goog.functions.constant(t))},goog.functions.equalTo=function(e,t){return function(n){return t?e==n:e===n}},goog.functions.compose=function(e,t){var n=arguments,r=n.length;return function(){var e;r&&(e=n[r-1].apply(this,arguments));for(var t=r-2;0<=t;t--)e=n[t].call(this,e);return e}},goog.functions.sequence=function(e){var t=arguments,n=t.length;return function(){for(var e,r=0;r<n;r++)e=t[r].apply(this,arguments);return e}},goog.functions.and=function(e){var t=arguments,n=t.length;return function(){for(var e=0;e<n;e++)if(!t[e].apply(this,arguments))return!1;return!0}},goog.functions.or=function(e){var t=arguments,n=t.length;return function(){for(var e=0;e<n;e++)if(t[e].apply(this,arguments))return!0;return!1}},goog.functions.not=function(e){return function(){return!e.apply(this,arguments)}},goog.functions.create=function(e,t){var n=function(){};return n.prototype=e.prototype,n=new n,e.apply(n,Array.prototype.slice.call(arguments,1)),n},goog.functions.CACHE_RETURN_VALUE=!0,goog.functions.cacheReturnValue=function(e){var t,n=!1;return function(){return goog.functions.CACHE_RETURN_VALUE?(n||(t=e(),n=!0),t):e()}},goog.functions.once=function(e){var t=e;return function(){if(t){var e=t;t=null,e()}}},goog.functions.debounce=function(e,t,n){var r=0;return function(o){goog.global.clearTimeout(r);var i=arguments;r=goog.global.setTimeout(function(){e.apply(n,i)},t)}},goog.functions.throttle=function(e,t,n){var r=0,o=!1,i=[],a=function(){r=0,o&&(o=!1,s())},s=function(){r=goog.global.setTimeout(a,t);var o=i;i=[],e.apply(n,o)};return function(e){i=arguments,r?o=!0:s()}},goog.functions.rateLimit=function(e,t,n){var r=0,o=function(){r=0};return function(i){r||(r=goog.global.setTimeout(o,t),e.apply(n,arguments))}},goog.functions.isFunction=function(e){return"function"==typeof e},goog.dom.TagName=function(){},goog.dom.TagName.cast=function(e){return e},goog.dom.TagName.prototype.toString=function(){},goog.dom.TagName.A="A",goog.dom.TagName.ABBR="ABBR",goog.dom.TagName.ACRONYM="ACRONYM",goog.dom.TagName.ADDRESS="ADDRESS",goog.dom.TagName.APPLET="APPLET",goog.dom.TagName.AREA="AREA",goog.dom.TagName.ARTICLE="ARTICLE",goog.dom.TagName.ASIDE="ASIDE",goog.dom.TagName.AUDIO="AUDIO",goog.dom.TagName.B="B",goog.dom.TagName.BASE="BASE",goog.dom.TagName.BASEFONT="BASEFONT",goog.dom.TagName.BDI="BDI",goog.dom.TagName.BDO="BDO",goog.dom.TagName.BIG="BIG",goog.dom.TagName.BLOCKQUOTE="BLOCKQUOTE",goog.dom.TagName.BODY="BODY",goog.dom.TagName.BR="BR",goog.dom.TagName.BUTTON="BUTTON",goog.dom.TagName.CANVAS="CANVAS",goog.dom.TagName.CAPTION="CAPTION",goog.dom.TagName.CENTER="CENTER",goog.dom.TagName.CITE="CITE",goog.dom.TagName.CODE="CODE",goog.dom.TagName.COL="COL",goog.dom.TagName.COLGROUP="COLGROUP",goog.dom.TagName.COMMAND="COMMAND",goog.dom.TagName.DATA="DATA",goog.dom.TagName.DATALIST="DATALIST",goog.dom.TagName.DD="DD",goog.dom.TagName.DEL="DEL",goog.dom.TagName.DETAILS="DETAILS",goog.dom.TagName.DFN="DFN",goog.dom.TagName.DIALOG="DIALOG",goog.dom.TagName.DIR="DIR",goog.dom.TagName.DIV="DIV",goog.dom.TagName.DL="DL",goog.dom.TagName.DT="DT",goog.dom.TagName.EM="EM",goog.dom.TagName.EMBED="EMBED",goog.dom.TagName.FIELDSET="FIELDSET",goog.dom.TagName.FIGCAPTION="FIGCAPTION",goog.dom.TagName.FIGURE="FIGURE",goog.dom.TagName.FONT="FONT",goog.dom.TagName.FOOTER="FOOTER",goog.dom.TagName.FORM="FORM",goog.dom.TagName.FRAME="FRAME",goog.dom.TagName.FRAMESET="FRAMESET",goog.dom.TagName.H1="H1",goog.dom.TagName.H2="H2",goog.dom.TagName.H3="H3",goog.dom.TagName.H4="H4",goog.dom.TagName.H5="H5",goog.dom.TagName.H6="H6",goog.dom.TagName.HEAD="HEAD",goog.dom.TagName.HEADER="HEADER",goog.dom.TagName.HGROUP="HGROUP",goog.dom.TagName.HR="HR",goog.dom.TagName.HTML="HTML",goog.dom.TagName.I="I",goog.dom.TagName.IFRAME="IFRAME",goog.dom.TagName.IMG="IMG",goog.dom.TagName.INPUT="INPUT",goog.dom.TagName.INS="INS",goog.dom.TagName.ISINDEX="ISINDEX",goog.dom.TagName.KBD="KBD",goog.dom.TagName.KEYGEN="KEYGEN",goog.dom.TagName.LABEL="LABEL",goog.dom.TagName.LEGEND="LEGEND",goog.dom.TagName.LI="LI",goog.dom.TagName.LINK="LINK",goog.dom.TagName.MAIN="MAIN",goog.dom.TagName.MAP="MAP",goog.dom.TagName.MARK="MARK",goog.dom.TagName.MATH="MATH",goog.dom.TagName.MENU="MENU",goog.dom.TagName.MENUITEM="MENUITEM",goog.dom.TagName.META="META",goog.dom.TagName.METER="METER",goog.dom.TagName.NAV="NAV",goog.dom.TagName.NOFRAMES="NOFRAMES",goog.dom.TagName.NOSCRIPT="NOSCRIPT",goog.dom.TagName.OBJECT="OBJECT",goog.dom.TagName.OL="OL",goog.dom.TagName.OPTGROUP="OPTGROUP",goog.dom.TagName.OPTION="OPTION",goog.dom.TagName.OUTPUT="OUTPUT",goog.dom.TagName.P="P",goog.dom.TagName.PARAM="PARAM",goog.dom.TagName.PICTURE="PICTURE",goog.dom.TagName.PRE="PRE",goog.dom.TagName.PROGRESS="PROGRESS",goog.dom.TagName.Q="Q",goog.dom.TagName.RP="RP",goog.dom.TagName.RT="RT",goog.dom.TagName.RTC="RTC",goog.dom.TagName.RUBY="RUBY",goog.dom.TagName.S="S",goog.dom.TagName.SAMP="SAMP",goog.dom.TagName.SCRIPT="SCRIPT",goog.dom.TagName.SECTION="SECTION",goog.dom.TagName.SELECT="SELECT",goog.dom.TagName.SMALL="SMALL",goog.dom.TagName.SOURCE="SOURCE",goog.dom.TagName.SPAN="SPAN",goog.dom.TagName.STRIKE="STRIKE",goog.dom.TagName.STRONG="STRONG",goog.dom.TagName.STYLE="STYLE",goog.dom.TagName.SUB="SUB",goog.dom.TagName.SUMMARY="SUMMARY",goog.dom.TagName.SUP="SUP",goog.dom.TagName.SVG="SVG",goog.dom.TagName.TABLE="TABLE",goog.dom.TagName.TBODY="TBODY",goog.dom.TagName.TD="TD",goog.dom.TagName.TEMPLATE="TEMPLATE",goog.dom.TagName.TEXTAREA="TEXTAREA",goog.dom.TagName.TFOOT="TFOOT",goog.dom.TagName.TH="TH",goog.dom.TagName.THEAD="THEAD",goog.dom.TagName.TIME="TIME",goog.dom.TagName.TITLE="TITLE",goog.dom.TagName.TR="TR",goog.dom.TagName.TRACK="TRACK",goog.dom.TagName.TT="TT",goog.dom.TagName.U="U",goog.dom.TagName.UL="UL",goog.dom.TagName.VAR="VAR",goog.dom.TagName.VIDEO="VIDEO",goog.dom.TagName.WBR="WBR",goog.object={};var module$contents$goog$object_PROTOTYPE_FIELDS="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleStr
2ing toString valueOf".split(" ");function module$contents$goog$object_create(e){var t=arguments.length;if(1==t&&Array.isArray(arguments[0]))return module$contents$goog$object_create.apply(null,arguments[0]);if(t%2)throw Error("Uneven number of arguments");for(var n={},r=0;r<t;r+=2)n[arguments[r]]=arguments[r+1];return n}function module$contents$goog$object_createSet(e){var t=arguments.length;if(1==t&&Array.isArray(arguments[0]))return module$contents$goog$object_createSet.apply(null,arguments[0]);for(var n={},r=0;r<t;r++)n[arguments[r]]=!0;return n}goog.object.add=function(e,t,n){if(null!==e&&t in e)throw Error('The object already contains the key "'+t+'"');e[t]=n},goog.object.clear=function(e){for(var t in e)delete e[t]},goog.object.clone=function(e){var t,n={};for(t in e)n[t]=e[t];return n},goog.object.contains=function(e,t){return module$contents$goog$object_containsValue(e,t)},goog.object.containsKey=function(e,t){return null!==e&&t in e},goog.object.containsValue=module$contents$goog$object_containsValue,goog.object.create=module$contents$goog$object_create,goog.object.createImmutableView=function(e){var t=e;return Object.isFrozen&&!Object.isFrozen(e)&&(t=Object.create(e),Object.freeze(t)),t},goog.object.createSet=module$contents$goog$object_createSet,goog.object.equals=function(e,t){for(var n in e)if(!(n in t)||e[n]!==t[n])return!1;for(var r in t)if(!(r in e))return!1;return!0},goog.object.every=function(e,t,n){for(var r in e)if(!t.call(n,e[r],r,e))return!1;return!0},goog.object.extend=function(e,t){for(var n,r,o=1;o<arguments.length;o++){for(n in r=arguments[o])e[n]=r[n];for(var i=0;i<module$contents$goog$object_PROTOTYPE_FIELDS.length;i++)n=module$contents$goog$object_PROTOTYPE_FIELDS[i],Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}},goog.object.filter=function(e,t,n){var r,o={};for(r in e)t.call(n,e[r],r,e)&&(o[r]=e[r]);return o},goog.object.findKey=module$contents$goog$object_findKey,goog.object.findValue=function(e,t,n){return(t=module$contents$goog$object_findKey(e,t,n))&&e[t]},goog.object.forEach=function(e,t,n){for(var r in e)t.call(n,e[r],r,e)},goog.object.get=function(e,t,n){return null!==e&&t in e?e[t]:n},goog.object.getAllPropertyNames=function(e,t,n){if(!e)return[];if(!Object.getOwnPropertyNames||!Object.getPrototypeOf)return module$contents$goog$object_getKeys(e);for(var r={};e&&(e!==Object.prototype||t)&&(e!==Function.prototype||n);){for(var o=Object.getOwnPropertyNames(e),i=0;i<o.length;i++)r[o[i]]=!0;e=Object.getPrototypeOf(e)}return module$contents$goog$object_getKeys(r)},goog.object.getAnyKey=function(e){for(var t in e)return t},goog.object.getAnyValue=function(e){for(var t in e)return e[t]},goog.object.getCount=function(e){var t,n=0;for(t in e)n++;return n},goog.object.getKeys=module$contents$goog$object_getKeys,goog.object.getSuperClass=function(e){return(e=Object.getPrototypeOf(e.prototype))&&e.constructor},goog.object.getValueByKeys=function(e,t){var n=goog.isArrayLike(t),r=n?t:arguments;for(n=n?0:1;n<r.length;n++){if(null==e)return;e=e[r[n]]}return e},goog.object.getValues=function(e){var t,n=[],r=0;for(t in e)n[r++]=e[t];return n},goog.object.isEmpty=function(e){for(var t in e)return!1;return!0},goog.object.isImmutableView=function(e){return!!Object.isFrozen&&Object.isFrozen(e)},goog.object.map=function(e,t,n){var r,o={};for(r in e)o[r]=t.call(n,e[r],r,e);return o},goog.object.remove=function(e,t){var n;return(n=t in e)&&delete e[t],n},goog.object.set=function(e,t,n){e[t]=n},goog.object.setIfUndefined=function(e,t,n){return t in e?e[t]:e[t]=n},goog.object.setWithReturnValueIfNotSet=function(e,t,n){return t in e?e[t]:(n=n(),e[t]=n)},goog.object.some=function(e,t,n){for(var r in e)if(t.call(n,e[r],r,e))return!0;return!1},goog.object.transpose=function(e){var t,n={};for(t in e)n[e[t]]=t;return n},goog.object.unsafeClone=module$contents$goog$object_unsafeClone,goog.dom.tags={},goog.dom.tags.VOID_TAGS_={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},goog.dom.tags.isVoidTag=function(e){return!0===goog.dom.tags.VOID_TAGS_[e]},goog.html={},goog.html.trustedtypes={},goog.html.trustedtypes.getPolicyPrivateDoNotAccessOrElse=function(){return goog.TRUSTED_TYPES_POLICY_NAME?(void 0===goog.html.trustedtypes.cachedPolicy_&&(goog.html.trustedtypes.cachedPolicy_=goog.createTrustedTypesPolicy(goog.TRUSTED_TYPES_POLICY_NAME+"#html")),goog.html.trustedtypes.cachedPolicy_):null},goog.string.TypedString=function(){},goog.string.Const=function(e,t){this.stringConstValueWithSecurityContract__googStr
vendor: 4,199 bytes, line 2
2ingSecurityPrivate_=e===goog.string.Const.GOOG_STRING_CONSTRUCTOR_TOKEN_PRIVATE_&&t||"",this.STRING_CONST_TYPE_MARKER__GOOG_STRING_SECURITY_PRIVATE_=goog.string.Const.TYPE_MARKER_},goog.string.Const.prototype.implementsGoogStringTypedString=!0,goog.string.Const.prototype.getTypedStringValue=function(){return this.stringConstValueWithSecurityContract__googStringSecurityPrivate_},goog.DEBUG&&(goog.string.Const.prototype.toString=function(){return"Const{"+this.stringConstValueWithSecurityContract__googStringSecurityPrivate_+"}"}),goog.string.Const.unwrap=function(e){return e instanceof goog.string.Const&&e.constructor===goog.string.Const&&e.STRING_CONST_TYPE_MARKER__GOOG_STRING_SECURITY_PRIVATE_===goog.string.Const.TYPE_MARKER_?e.stringConstValueWithSecurityContract__googStringSecurityPrivate_:(goog.asserts.fail("expected object of type Const, got '"+e+"'"),"type_error:Const")},goog.string.Const.from=function(e){return new goog.string.Const(goog.string.Const.GOOG_STRING_CONSTRUCTOR_TOKEN_PRIVATE_,e)},goog.string.Const.TYPE_MARKER_={},goog.string.Const.GOOG_STRING_CONSTRUCTOR_TOKEN_PRIVATE_={},goog.string.Const.EMPTY=goog.string.Const.from("");var module$contents$goog$html$SafeScript_CONSTRUCTOR_TOKEN_PRIVATE={},module$contents$goog$html$SafeScript_SafeScript=function(e,t){this.privateDoNotAccessOrElseSafeScriptWrappedValue_=t===module$contents$goog$html$SafeScript_CONSTRUCTOR_TOKEN_PRIVATE?e:"",this.implementsGoogStringTypedString=!0};module$contents$goog$html$SafeScript_SafeScript.fromConstant=function(e){return 0===(e=goog.string.Const.unwrap(e)).length?module$contents$goog$html$SafeScript_SafeScript.EMPTY:module$contents$goog$html$SafeScript_SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse(e)},module$contents$goog$html$SafeScript_SafeScript.fromJson=function(e){return module$contents$goog$html$SafeScript_SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse(module$contents$goog$html$SafeScript_SafeScript.stringify_(e))},module$contents$goog$html$SafeScript_SafeScript.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseSafeScriptWrappedValue_.toString()},module$contents$goog$html$SafeScript_SafeScript.unwrap=function(e){return module$contents$goog$html$SafeScript_SafeScript.unwrapTrustedScript(e).toString()},module$contents$goog$html$SafeScript_SafeScript.unwrapTrustedScript=function(e){return e instanceof module$contents$goog$html$SafeScript_SafeScript&&e.constructor===module$contents$goog$html$SafeScript_SafeScript?e.privateDoNotAccessOrElseSafeScriptWrappedValue_:((0,goog.asserts.fail)("expected object of type SafeScript, got '"+e+"' of type "+goog.typeOf(e)),"type_error:SafeScript")},module$contents$goog$html$SafeScript_SafeScript.stringify_=function(e){return JSON.stringify(e).replace(/</g,"\\x3c")},module$contents$goog$html$SafeScript_SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse=function(e){var t=goog.html.trustedtypes.getPolicyPrivateDoNotAccessOrElse();return e=t?t.createScript(e):e,new module$contents$goog$html$SafeScript_SafeScript(e,module$contents$goog$html$SafeScript_CONSTRUCTOR_TOKEN_PRIVATE)},module$contents$goog$html$SafeScript_SafeScript.prototype.toString=function(){return this.privateDoNotAccessOrElseSafeScriptWrappedValue_.toString()},module$contents$goog$html$SafeScript_SafeScript.EMPTY=module$contents$goog$html$SafeScript_SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse(""),goog.html.SafeScript=module$contents$goog$html$SafeScript_SafeScript,goog.fs={},goog.fs.url={},goog.fs.url.createObjectUrl=function(e){return goog.fs.url.getUrlObject_().createObjectURL(e)},goog.fs.url.revokeObjectUrl=function(e){goog.fs.url.getUrlObject_().revokeObjectURL(e)},goog.fs.url.UrlObject_=function(){},goog.fs.url.UrlObject_.prototype.createObjectURL=function(){},goog.fs.url.UrlObject_.prototype.revokeObjectURL=function(){},goog.fs.url.getUrlObject_=function(){var e=goog.fs.url.findUrlObject_();if(null!=e)return e;throw Error("This browser doesn't seem to support blob URLs")},goog.fs.url.findUrlObject_=function(){return void 0!==goog.global.URL&&void 0!==goog.global.URL.createObjectURL?goog.global.URL:void 0!==goog.global.createObjectURL?goog.global:null}
2,goog.fs.url.browserSupportsObjectUrls=function(){return null!=goog.fs.url.findUrlObject_()},goog.fs.blob={},goog.fs.blob.getBlob=function(e){var t=goog.global.BlobBuilder||goog.global.WebKitBlobBuilder;if(void 0!==t){t=new t;for(var n=0;n<arguments.length;n++)t.append(arguments[n]);return t.getBlob()}return goog.fs.blob.getBlobWithProperties(Array.prototype.slice.call(arguments))},goog.fs.blob.getBlobWithProperties=function(e,t,n){var r=goog.global.BlobBuilder||goog.global.WebKitBlobBuilder;if(void 0!==r){r=new r;for(var o=0;o<e.length;o++)r.append(e[o],n);return r.getBlob(t)}if(void 0!==goog.global.Blob)return r={},t&&(r.type=t),n&&(r.endings=n),new Blob(e,r);throw Error("This browser doesn't seem to support creating Blobs")},goog.i18n={},goog.i18n.bidi={},goog.i18n.bidi.FORCE_RTL=!1,goog.i18n.bidi.IS_RTL=goog.i18n.bidi.FORCE_RTL||("ar"==goog.LOCALE.substring(0,2).toLowerCase()||"fa"==goog.LOCALE.substring(0,2).toLowerCase()||"he"==goog.LOCALE.substring(0,2).toLowerCase()||"iw"==goog.LOCALE.substring(0,2).toLowerCase()||"ps"==goog.LOCALE.substring(0,2).toLowerCase()||"sd"==goog.LOCALE.substring(0,2).toLowerCase()||"ug"==goog.LOCALE.substring(0,2).toLowerCase()||"ur"==goog.LOCALE.substring(0,2).toLowerCase()||"yi"==goog.LOCALE.substring(0,2).toLowerCase())&&(2==goog.LOCALE.length||"-"==goog.LOCALE.substring(2,3)||"_"==goog.LOCALE.substring(2,3))||3<=goog.LOCALE.length&&"ckb"==goog.LOCALE.substring(0,3).toLowerCase()&&(3==goog.LOCALE.length||"-"==goog.LOCALE.substring(3,4)||"_"==goog.LOCALE.substring(3,4))||7<=goog.LOCALE.length&&("-"==goog.LOCALE.substring(2,3)||"_"==goog.LOCALE.substring(2,3))&&("adlm"==goog.LOCALE.substring(3,7).toLowerCase()||"arab"==goog.LOCALE.substring(3,7).toLowerCase()||"hebr"==goog.LOCALE.substring(3,7).toLowerCase()||"nkoo"==goog.LOCALE.substring(3,7).toLowerCase()||"rohg"==goog.LOCALE.substring(3,7).toLowerCase()||"thaa"==goog.LOCALE.substring(3,7).toLowerCase())||8<=goog.LOCALE.length&&("-"==goog.LOCALE.substring(3,4)||"_"==goog.LOCALE.substring(3,4))&&("adlm"==goog.LOCALE.substring(4,8).toLowerCase()||"arab"==goog.LOCALE.substring(4,8).toLowerCase()||"hebr"==goog.LOCALE.substring(4,8).toLowerCase()||"nkoo"==goog.LOCALE.substring(4,8).toLowerCase()||"rohg"==goog.LOCALE.substring(4,8).toLowerCase()||"thaa"==goog.LOCALE.substring(4,8).toLowerCase()),goog.i18n.bidi.Format={LRE:"‪",RLE:"‫",PDF:"‬",LRM:"‎",RLM:"‏"},goog.i18n.bidi.Dir={LTR:1,RTL:-1,NEUTRAL:0},goog.i18n.bidi.RIGHT="right",goog.i18n.bidi.LEFT="left",goog.i18n.bidi.I18N_RIGHT=goog.i18n.bidi.IS_RTL?goog.i18n.bidi.LEFT:goog.i18n.bidi.RIGHT,goog.i18n.bidi.I18N_LEFT=goog.i18n.bidi.IS_RTL?goog.i18n.bidi.RIGHT:goog.i18n.bidi.LEFT,goog.i18n.bidi.toDir=function(e,t){return"number"==typeof e?0<e?goog.i18n.bidi.Dir.LTR:0>e?goog.i18n.bidi.Dir.RTL:t?null:goog.i18n.bidi.Dir.NEUTRAL:null==e?null:e?goog.i18n.bidi.Dir.RTL:goog.i18n.bidi.Dir.LTR},goog.i18n.bidi.ltrChars_="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ऀ-῿‎Ⰰ-\ud801\ud804-\ud839\ud83c-\udbff豈-﬜︀-﹯﻽-￿",goog.i18n.bidi.rtlChars_="֑-ۯۺ-ࣿ‏\ud802-\ud803\ud83a-\ud83bיִ-﷿ﹰ-ﻼ",goog.i18n.bidi.htmlSkipReg_=/<[^>]*>|&[^;]+;/g,goog.i18n.bidi.stripHtmlIfNeeded_=function(e,t){return t?e.replace(goog.i18n.bidi.htmlSkipReg_,""):e},goog.i18n.bidi.rtlCharReg_=new RegExp("["+goog.i18n.bidi.rtlChars_+"]"),goog.i18n.bidi.ltrCharReg_=new RegExp("["+goog.i18n.bidi.ltrChars_+"]"),goog.i18n.bidi.hasAnyRtl=function(e,t){return goog.i18n.bidi.rtlCharReg_.test(goog.i18n.bidi.stripHtmlIfNeeded_(e,t))},goog.i18n.bidi.hasRtlChar=goog.i18n.bidi.hasAnyRtl,goog.i18n.bidi.hasAnyLtr=function(e,t){return goog.i18n.bidi.ltrCharReg_.test(goog.i18n.bidi.stripHtmlIfNeeded_(e,t))},goog.i18n.bidi.ltrRe_=new RegExp("^["+goog.i18n.bidi.ltrChars_+"]"),goog.i18n.bidi.rtlRe_=new RegExp("^["+goog.i18n.bidi.rtlChars_+"]"),goog.i18n.bidi.isRtlChar=function(e){return goog.i18n.bidi.rtlRe_.test(e)},goog.i18n.bidi.isLtrChar=function(e){return goog.i18n.bidi.ltrRe_.test(e)},goog.i18n.bidi.isNeutralChar=function(e){return!goog.i18n.bidi.isLtrChar(e)&&!goog.i18n.bidi.isRtlChar(e)},goog.i18n.bidi.ltrDirCheckRe_=new RegExp("^[^"+goog.i18n.bidi.rtlChars_+"]*["+goog.i18n.bidi.ltrChars_+"]"),goog.i18n.bidi.rtlDirCheckRe_=new RegExp("^[^"+goog.i18n.bidi.ltrChars_+"]*["+goog.i18n.bidi.rtlChars_+"]"),goog.i18n.bidi.startsWithRtl=function(e,t){return goog.i18n.bidi.rtlDirCheckRe_.test(goog.i18n.bidi.stripHtmlIfNeeded_(e,t))},goog.i18n.bidi.isRtlText=goog.i18n.bidi.startsWithRtl,goog.i18n.bidi.startsWithLtr=function(e,t){return goog.i18n.bidi.ltrDirCheckRe_.test(goog.i18n.bidi.stripHtmlIfNeeded_(e,t))},goog.i18n.bidi.isLtrText=goog.i18n.bidi.startsWithLtr,goog.i18n.bidi.isRequiredLtrRe_=/^http:\/\/.*/,goog.i18n.bidi.isNeutralText=function(e,t){return e=goog.i18n.bidi.stripHtmlIfNeeded_(e,t),goog.i18n.bidi.isRequiredLtrRe_.test(e)||!goog.i18n.bidi.hasAnyLtr(e)&&!goog.i18n.bidi.hasAnyRtl(e)},goog.i18n.bidi.ltrExitDirCheckRe_=new RegExp("["+goog.i18n.bidi.ltrChars_+"][^"+goog.i18n.bidi.rtlChars_+"]*$"),goog.i18n.bidi.rtlExitDirCheckRe_=new RegExp("["+goog.i18n.bidi.rtlChars_+"][^"+goog.i18n.bidi.ltrChars_+"]*$"),goog.i18n.bidi.endsWithLtr
2=function(e,t){return goog.i18n.bidi.ltrExitDirCheckRe_.test(goog.i18n.bidi.stripHtmlIfNeeded_(e,t))},goog.i18n.bidi.isLtrExitText=goog.i18n.bidi.endsWithLtr,goog.i18n.bidi.endsWithRtl=function(e,t){return goog.i18n.bidi.rtlExitDirCheckRe_.test(goog.i18n.bidi.stripHtmlIfNeeded_(e,t))},goog.i18n.bidi.isRtlExitText=goog.i18n.bidi.endsWithRtl,goog.i18n.bidi.rtlLocalesRe_=RegExp("^(ar|ckb|dv|he|iw|fa|nqo|ps|sd|ug|ur|yi|.*[-_](Adlm|Arab|Hebr|Nkoo|Rohg|Thaa))(?!.*[-_](Latn|Cyrl)($|-|_))($|-|_)","i"),goog.i18n.bidi.isRtlLanguage=function(e){return goog.i18n.bidi.rtlLocalesRe_.test(e)},goog.i18n.bidi.bracketGuardTextRe_=/(\(.*?\)+)|(\[.*?\]+)|(\{.*?\}+)|(<.*?>+)/g,goog.i18n.bidi.guardBracketInText=function(e,t){return t=(void 0===t?goog.i18n.bidi.hasAnyRtl(e):t)?goog.i18n.bidi.Format.RLM:goog.i18n.bidi.Format.LRM,e.replace(goog.i18n.bidi.bracketGuardTextRe_,t+"$&"+t)},goog.i18n.bidi.enforceRtlInHtml=function(e){return"<"==e.charAt(0)?e.replace(/<\w+/,"$& dir=rtl"):"\n<span dir=rtl>"+e+"</span>"},goog.i18n.bidi.enforceRtlInText=function(e){return goog.i18n.bidi.Format.RLE+e+goog.i18n.bidi.Format.PDF},goog.i18n.bidi.enforceLtrInHtml=function(e){return"<"==e.charAt(0)?e.replace(/<\w+/,"$& dir=ltr"):"\n<span dir=ltr>"+e+"</span>"},goog.i18n.bidi.enforceLtrInText=function(e){return goog.i18n.bidi.Format.LRE+e+goog.i18n.bidi.Format.PDF},goog.i18n.bidi.dimensionsRe_=/:\s*([.\d][.\w]*)\s+([.\d][.\w]*)\s+([.\d][.\w]*)\s+([.\d][.\w]*)/g,goog.i18n.bidi.leftRe_=/left/gi,goog.i18n.bidi.rightRe_=/right/gi,goog.i18n.bidi.tempRe_=/%%%%/g,goog.i18n.bidi.mirrorCSS=function(e){return e.replace(goog.i18n.bidi.dimensionsRe_,":$1 $4 $3 $2").replace(goog.i18n.bidi.leftRe_,"%%%%").replace(goog.i18n.bidi.rightRe_,goog.i18n.bidi.LEFT).replace(goog.i18n.bidi.tempRe_,goog.i18n.bidi.RIGHT)},goog.i18n.bidi.doubleQuoteSubstituteRe_=/([\u0591-\u05f2])"/g,goog.i18n.bidi.singleQuoteSubstituteRe_=/([\u0591-\u05f2])'/g,goog.i18n.bidi.normalizeHebrewQuote=function(e){return e.replace(goog.i18n.bidi.doubleQuoteSubstituteRe_,"$1״").replace(goog.i18n.bidi.singleQuoteSubstituteRe_,"$1׳")},goog.i18n.bidi.wordSeparatorRe_=/\s+/,goog.i18n.bidi.hasNumeralsRe_=/[\d\u06f0-\u06f9]/,goog.i18n.bidi.rtlDetectionThreshold_=.4,goog.i18n.bidi.estimateDirection=function(e,t){var n=0,r=0,o=!1;for(e=goog.i18n.bidi.stripHtmlIfNeeded_(e,t).split(goog.i18n.bidi.wordSeparatorRe_),t=0;t<e.length;t++){var i=e[t];goog.i18n.bidi.startsWithRtl(i)?(n++,r++):goog.i18n.bidi.isRequiredLtrRe_.test(i)?o=!0:goog.i18n.bidi.hasAnyLtr(i)?r++:goog.i18n.bidi.hasNumeralsRe_.test(i)&&(o=!0)}return 0==r?o?goog.i18n.bidi.Dir.LTR:goog.i18n.bidi.Dir.NEUTRAL:n/r>goog.i18n.bidi.rtlDetectionThreshold_?goog.i18n.bidi.Dir.RTL:goog.i18n.bidi.Dir.LTR},goog.i18n.bidi.detectRtlDirectionality=function(e,t){return goog.i18n.bidi.estimateDirection(e,t)==goog.i18n.bidi.Dir.RTL},goog.i18n.bidi.setElementDirAndAlign=function(e,t){e&&(t=goog.i18n.bidi.toDir(t))&&(e.style.textAlign=t==goog.i18n.bidi.Dir.RTL?goog.i18n.bidi.RIGHT:goog.i18n.bidi.LEFT,e.dir=t==goog.i18n.bidi.Dir.RTL?"rtl":"ltr")},goog.i18n.bidi.setElementDirByTextDirectionality=function(e,t){switch(goog.i18n.bidi.estimateDirection(t)){case goog.i18n.bidi.Dir.LTR:"ltr"!==e.dir&&(e.dir="ltr");break;case goog.i18n.bidi.Dir.RTL:"rtl"!==e.dir&&(e.dir="rtl");break;default:e.removeAttribute("dir")}},goog.i18n.bidi.DirectionalString=function(){},goog.html.TrustedResourceUrl=function(e,t){this.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_=t===goog.html.TrustedResourceUrl.CONSTRUCTOR_TOKEN_PRIVATE_?e:""},goog.html.TrustedResourceUrl.prototype.implementsGoogStringTypedString=!0,goog.html.TrustedResourceUrl.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_.toString()},goog.html.TrustedResourceUrl.prototype.implementsGoogI18nBidiDirectionalString=!0,goog.html.TrustedResourceUrl.prototype.getDirection=function(){return goog.i18n.bidi.Dir.LTR},goog.html.TrustedResourceUrl.prototype.cloneWithParams=function(e,t){var n=goog.html.TrustedResourceUrl.unwrap(this),r=(n=goog.html.TrustedResourceUrl.URL_PARAM_PARSER_.exec(n))[3]||"";return goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(n[1]+goog.html.TrustedResourceUrl.stringifyParams_("?",n[2]||"",e)+goog.html.TrustedResourceUrl.stringifyParams_("#",r,t))},goog.html.TrustedResourceUrl.prototype.toString=function(){return this.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_+""},goog.html.TrustedResourceUrl.unwrap=function(e){return goog.html.TrustedResourceUrl.unwrapTrustedScriptURL(e).toString()},goog.html.TrustedResourceUrl.unwrapTrustedScriptURL=function(e){return e instanceof goog.html.TrustedResourceUrl&&e.constructor===goog.html.TrustedResourceUrl?e.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_:(goog.asserts.fail("expected object of type TrustedResourceUrl, got '"+e+"' of type "+goog.typeOf(e)),"type_error:TrustedResourceUrl")},goog.html.TrustedResourceUrl.format=function(e,t){var n=goog.string.Const.unwrap(e);if(!goog.html.TrustedResourceUrl.BASE_URL_.test(n))throw Error("Invalid TrustedResourceUrl format: "+n);return e=n.replace(goog.html.TrustedResourceUrl.FORMAT_MARKER_,function(e,r){if(!Object.prototype.hasOwnProperty.call(t,r))throw Error('Found marker, "'+r+'", in format str
2ing, "'+n+'", but no valid label mapping found in args: '+JSON.stringify(t));return(e=t[r])instanceof goog.string.Const?goog.string.Const.unwrap(e):encodeURIComponent(String(e))}),goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.TrustedResourceUrl.FORMAT_MARKER_=/%{(\w+)}/g,goog.html.TrustedResourceUrl.BASE_URL_=RegExp("^((https:)?//[0-9a-z.:[\\]-]+/|/[^/\\\\]|[^:/\\\\%]+/|[^:/\\\\%]*[?#]|about:blank#)","i"),goog.html.TrustedResourceUrl.URL_PARAM_PARSER_=/^([^?#]*)(\?[^#]*)?(#[\s\S]*)?/,goog.html.TrustedResourceUrl.formatWithParams=function(e,t,n,r){return goog.html.TrustedResourceUrl.format(e,t).cloneWithParams(n,r)},goog.html.TrustedResourceUrl.fromConstant=function(e){return goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(goog.string.Const.unwrap(e))},goog.html.TrustedResourceUrl.fromConstants=function(e){for(var t="",n=0;n<e.length;n++)t+=goog.string.Const.unwrap(e[n]);return goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(t)},goog.html.TrustedResourceUrl.fromSafeScript=function(e){return e=goog.fs.blob.getBlobWithProperties([module$contents$goog$html$SafeScript_SafeScript.unwrap(e)],"text/javascript"),e=goog.fs.url.createObjectUrl(e),goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.TrustedResourceUrl.CONSTRUCTOR_TOKEN_PRIVATE_={},goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse=function(e){var t=goog.html.trustedtypes.getPolicyPrivateDoNotAccessOrElse();return e=t?t.createScriptURL(e):e,new goog.html.TrustedResourceUrl(e,goog.html.TrustedResourceUrl.CONSTRUCTOR_TOKEN_PRIVATE_)},goog.html.TrustedResourceUrl.stringifyParams_=function(e,t,n){if(null==n)return t;if("string"==typeof n)return n?e+encodeURIComponent(n):"";for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var o=n[r];o=Array.isArray(o)?o:[o];for(var i=0;i<o.length;i++){var a=o[i];null!=a&&(t||(t=e),t+=(t.length>e.length?"&":"")+encodeURIComponent(r)+"="+encodeURIComponent(String(a)))}}return t},goog.html.SafeUrl=function(e,t){this.privateDoNotAccessOrElseSafeUrlWrappedValue_=t===goog.html.SafeUrl.CONSTRUCTOR_TOKEN_PRIVATE_?e:""},goog.html.SafeUrl.INNOCUOUS_STRING="about:invalid#zClosurez",goog.html.SafeUrl.prototype.implementsGoogStringTypedString=!0,goog.html.SafeUrl.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseSafeUrlWrappedValue_.toString()},goog.html.SafeUrl.prototype.implementsGoogI18nBidiDirectionalString=!0,goog.html.SafeUrl.prototype.getDirection=function(){return goog.i18n.bidi.Dir.LTR},goog.html.SafeUrl.prototype.toString=function(){return this.privateDoNotAccessOrElseSafeUrlWrappedValue_.toString()},goog.html.SafeUrl.unwrap=function(e){return e instanceof goog.html.SafeUrl&&e.constructor===goog.html.SafeUrl?e.privateDoNotAccessOrElseSafeUrlWrappedValue_:(goog.asserts.fail("expected object of type SafeUrl, got '"+e+"' of type "+goog.typeOf(e)),"type_error:SafeUrl")},goog.html.SafeUrl.fromConstant=function(e){return goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(goog.string.Const.unwrap(e))},goog.html.SAFE_MIME_TYPE_PATTERN_=RegExp('^(?:audio/(?:3gpp2|3gpp|aac|L16|midi|mp3|mp4|mpeg|oga|ogg|opus|x-m4a|x-matroska|x-wav|wav|webm)|font/\\w+|image/(?:bmp|gif|jpeg|jpg|png|tiff|webp|x-icon)|video/(?:mpeg|mp4|ogg|webm|quicktime|x-matroska))(?:;\\w+=(?:\\w+|"[\\w;,= ]+"))*$',"i"),goog.html.SafeUrl.isSafeMimeType=function(e){return goog.html.SAFE_MIME_TYPE_PATTERN_.test(e)},goog.html.SafeUrl.fromBlob=function(e){return e=goog.html.SafeUrl.isSafeMimeType(e.type)?goog.fs.url.createObjectUrl(e):goog.html.SafeUrl.INNOCUOUS_STRING,goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.SafeUrl.revokeObjectUrl=function(e){(e=e.getTypedStringValue())!==goog.html.SafeUrl.INNOCUOUS_STRING&&goog.fs.url.revokeObjectUrl(e)},goog.html.SafeUrl.fromMediaSource=function(e){return goog.asserts.assert("MediaSource"in goog.global,"No support for MediaSource"),e=e instanceof MediaSource?goog.f
vendor: 15,593 bytes, line 2
2s.url.createObjectUrl(e):goog.html.SafeUrl.INNOCUOUS_STRING,goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.DATA_URL_PATTERN_=/^data:(.*);base64,[a-z0-9+\/]+=*$/i,goog.html.SafeUrl.tryFromDataUrl=function(e){var t=(e=(e=String(e)).replace(/(%0A|%0D)/g,"")).match(goog.html.DATA_URL_PATTERN_);return t&&goog.html.SafeUrl.isSafeMimeType(t[1])?goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e):null},goog.html.SafeUrl.fromDataUrl=function(e){return goog.html.SafeUrl.tryFromDataUrl(e)||goog.html.SafeUrl.INNOCUOUS_URL},goog.html.SafeUrl.fromTelUrl=function(e){return goog.string.internal.caseInsensitiveStartsWith(e,"tel:")||(e=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.SIP_URL_PATTERN_=RegExp("^sip[s]?:[+a-z0-9_.!$%&'*\\/=^`{|}~-]+@([a-z0-9-]+\\.)+[a-z0-9]{2,63}$","i"),goog.html.SafeUrl.fromSipUrl=function(e){return goog.html.SIP_URL_PATTERN_.test(decodeURIComponent(e))||(e=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.SafeUrl.fromFacebookMessengerUrl=function(e){return goog.string.internal.caseInsensitiveStartsWith(e,"fb-messenger://share")||(e=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.SafeUrl.fromWhatsAppUrl=function(e){return goog.string.internal.caseInsensitiveStartsWith(e,"whatsapp://send")||(e=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.SafeUrl.fromSmsUrl=function(e){return goog.string.internal.caseInsensitiveStartsWith(e,"sms:")&&goog.html.SafeUrl.isSmsUrlBodyValid_(e)||(e=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.SafeUrl.isSmsUrlBodyValid_=function(e){var t=e.indexOf("#");if(0<t&&(e=e.substring(0,t)),!(t=e.match(/[?&]body=/gi)))return!0;if(1<t.length)return!1;if(!(e=e.match(/[?&]body=([^&]*)/)[1]))return!0;try{decodeURIComponent(e)}catch(e){return!1}return/^(?:[a-z0-9\-_.~]|%[0-9a-f]{2})+$/i.test(e)},goog.html.SafeUrl.fromSshUrl=function(e){return goog.string.internal.caseInsensitiveStartsWith(e,"ssh://")||(e=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.SafeUrl.sanitizeChromeExtensionUrl=function(e,t){return goog.html.SafeUrl.sanitizeExtensionUrl_(/^chrome-extension:\/\/([^\/]+)\//,e,t)},goog.html.SafeUrl.sanitizeFirefoxExtensionUrl=function(e,t){return goog.html.SafeUrl.sanitizeExtensionUrl_(/^moz-extension:\/\/([^\/]+)\//,e,t)},goog.html.SafeUrl.sanitizeEdgeExtensionUrl=function(e,t){return goog.html.SafeUrl.sanitizeExtensionUrl_(/^ms-browser-extension:\/\/([^\/]+)\//,e,t)},goog.html.SafeUrl.sanitizeExtensionUrl_=function(e,t,n){return(e=e.exec(t))?(e=e[1],-1==(n instanceof goog.string.Const?[goog.string.Const.unwrap(n)]:n.map(function(e){return goog.string.Const.unwrap(e)})).indexOf(e)&&(t=goog.html.SafeUrl.INNOCUOUS_STRING)):t=goog.html.SafeUrl.INNOCUOUS_STRING,goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(t)},goog.html.SafeUrl.fromTrustedResourceUrl=function(e){return goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(goog.html.TrustedResourceUrl.unwrap(e))},goog.html.SAFE_URL_PATTERN_=/^(?:(?:https?|mailto|ftp):|[^:/?#]*(?:[/?#]|$))/i,goog.html.SafeUrl.SAFE_URL_PATTERN=goog.html.SAFE_URL_PATTERN_,goog.html.SafeUrl.trySanitize=function(e){return e instanceof goog.html.SafeUrl?e:(e="object"==typeof e&&e.implementsGoogStringTypedString?e.getTypedStringValue():String(e),goog.html.SAFE_URL_PATTERN_.test(e)?goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e):goog.html.SafeUrl.tryFromDataUrl(e))},goog.html.SafeUrl.sanitize=function(e){return goog.html.SafeUrl.trySanitize(e)||goog.html.SafeUrl.INNOCUOUS_URL},goog.html.SafeUrl.sanitizeAssertUnchanged=function(e,t){return e instanceof goog.html.SafeUrl?e:(e="object"==typeof e&&e.implementsGoogStringTypedString?e.getTypedStringValue():String(e),t&&/^data:/i.test(e)&&(t=goog.html.SafeUrl.fromDataUrl(e)).getTypedStringValue()==e?t:(goog.asserts.assert(goog.html.SAFE_URL_PATTERN_.test(e),"%s does not match the safe URL pattern",e)||(e=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)))},goog.html.SafeUrl.CONSTRUCTOR_TOKEN_PRIVATE_={},goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse=function(e){return new goog.html.SafeUrl(e,goog.html.SafeUrl.CONSTRUCTOR_TOKEN_PRIVATE_)},goog.html.SafeUrl.INNOCUOUS_URL=goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.ABOUT_BLANK=goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse("about:blank");var module$contents$goog$html$SafeStyle_CONSTRUCTOR_TOKEN_PRIVATE={},module$contents$goog$html$SafeStyle_SafeStyle=function(e,t){this.privateDoNotAccessOrElseSafeStyleWrappedValue_=t===module$contents$goog$html$SafeStyle_CONSTRUCTOR_TOKEN_PRIVATE?e:"",this.implementsGoogStringTypedString=!0};function module$contents$goog$html$SafeStyle_sanitizePropertyValue(e){if(e instanceof goog.html.SafeUrl)return'url("'+goog.html.SafeUrl.unwrap(e).replace(/</g,"%3c").replace(/[\\"]/g,"\\$&")+'")';if(e=e instanceof goog.string.Const?goog.string.Const.unwrap(e):module$contents$goog$html$SafeStyle_sanitizePropertyValueString(String(e)),/[{;}]/.test(e))throw new goog.asserts.AssertionError("Value does not allow [{;}], got: %s.",[e]);return e}function module$contents$goog$html$SafeStyle_sanitizePropertyValueString(e){var t=e.replace(module$contents$goog$html$SafeStyle_FUNCTIONS_RE,"$1").replace(module$contents$goog$html$SafeStyle_FUNCTIONS_RE,"$1").replace(module$contents$goog$html$SafeStyle_URL_RE,"url");if(!module$contents$goog$html$SafeStyle_VALUE_RE.test(t))return(0,goog.asserts.fail)("String value allows only [-,.\"'%_!#/ a-zA-Z0-9\\[\\]] and simple functions, got: "+e),module$contents$goog$html$SafeStyle_SafeStyle.INNOCUOUS_STRING;if(module$contents$goog$html$SafeStyle_COMMENT_RE.test(e))return(0,goog.asserts.fail)("String value disallows comments, got: "+e),module$contents$goog$html$SafeStyle_SafeStyle.INNOCUOUS_STRING;for(var n=t=!0,r=0;r<e.length;r++){var o=e.charAt(r);"'"==o&&n?t=!t:'"'==o&&t&&(n=!n)}return t&&n?module$contents$goog$html$SafeStyle_hasBalancedSquareBrackets(e)?module$contents$goog$html$SafeStyle_sanitizeUrl(e):((0,goog.asserts.fail)("String value requires balanced square brackets and one identifier per pair of brackets, got: "+e),module$contents$goog$html$SafeStyle_SafeStyle.INNOCUOUS_STRING):((0,goog.asserts.fail)("String value requires balanced quotes, got: "+e),module$contents$goog$html$SafeStyle_SafeStyle.INNOCUOUS_STRING)}function module$contents$goog$html$SafeStyle_hasBalancedSquareBrackets(e){for(var t=!0,n=/^[-_a-zA-Z0-9]$/,r=0;r<e.length;r++){var o=e.charAt(r);if("]"==o){if(t)return!1;t=!0}else if("["==o){if(!t)return!1;t=!1}else if(!t&&!n.test(o))return!1}return t}module$contents$goog$html$SafeStyle_SafeStyle.fromConstant=function(e){return 0===(e=goog.string.Const.unwrap(e)).length?module$contents$goog$html$SafeStyle_SafeStyle.EMPTY:((0,goog.asserts.assert)((0,goog.string.internal.endsWith)(e,";"),"Last character of style string is not ';': "+e),(0,goog.asserts.assert)((0,goog.string.internal.contains)(e,":"),"Style string must contain at least one ':', to specify a \"name: value\" pair: "+e),module$contents$goog$html$SafeStyle_SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse(e))},module$contents$goog$html$SafeStyle_SafeStyle.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseSafeStyleWrappedValue_},module$contents$goog$html$SafeStyle_SafeStyle.prototype.toString=function(){return this.privateDoNotAccessOrElseSafeStyleWrappedValue_.toString()},module$contents$goog$html$SafeStyle_SafeStyle.unwrap=function(e){return e instanceof module$contents$goog$html$SafeStyle_SafeStyle&&e.constructor===module$contents$goog$html$SafeStyle_SafeStyle?e.privateDoNotAccessOrElseSafeStyleWrappedValue_:((0,goog.asserts.fail)("expected object of type SafeStyle, got '"+e+"' of type "+goog.typeOf(e)),"type_error:SafeStyle")},module$contents$goog$html$SafeStyle_SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse=function(e){return new module$contents$goog$html$SafeStyle_SafeStyle(e,module$contents$goog$html$SafeStyle_CONSTRUCTOR_TOKEN_PRIVATE)},module$contents$goog$html$SafeStyle_SafeStyle.create=function(e){var t,n="";for(t in e)if(Object.prototype.hasOwnProperty.call(e,t)){if(!/^[-_a-zA-Z0-9]+$/.test(t))throw Error("Name allows only [-_a-zA-Z0-9], got: "+t);var r=e[t];null!=r&&(n+=t+":"+(r=Array.isArray(r)?r.map(module$contents$goog$html$SafeStyle_sanitizePropertyValue).join(" "):module$contents$goog$html$SafeStyle_sanitizePropertyValue(r))+";")}return n?module$contents$goog$html$SafeStyle_SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse(n):module$contents$goog$html$SafeStyle_SafeStyle.EMPTY},module$contents$goog$html$SafeStyle_SafeStyle.concat=function(e){var t="",n=function(e){Array.isArray(e)?e.forEach(n):t+=module$contents$goog$html$SafeStyle_SafeStyle.unwrap(e)};return Array.prototype.forEach.call(arguments,n),t?module$contents$goog$html$SafeStyle_SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse(t):module$contents$goog$html$SafeStyle_SafeStyle.EMPTY},module$contents$goog$html$SafeStyle_SafeStyle.EMPTY=module$contents$goog$html$SafeStyle_SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse(""),module$contents$goog$html$SafeStyle_SafeStyle.INNOCUOUS_STRING="zClosurez";var module$contents$goog$html$SafeStyle_VALUE_RE=RegExp("^[-,.\"'%_!#/ a-zA-Z0-9\\[\\]]+$"),module$contents$goog$html$SafeStyle_URL_RE=RegExp("\\b(url\\([ \t\n]*)('[ -&(-\\[\\]-~]*'|\"[ !#-\\[\\]-~]*\"|[!#-&*-\\[\\]-~]*)([ \t\n]*\\))","g"),module$contents$goog$html$SafeStyle_FUNCTIONS_RE=RegExp("\\b(calc|cubic-bezier|fit-content|hsl|hsla|linear-gradient|matrix|minmax|repeat|rgb|rgba|(rotate|scale|translate)(X|Y|Z|3d)?|var)\\([-+*/0-9a-zA-Z.%#\\[\\], ]+\\)","g"),module$contents$goog$html$SafeStyle_COMMENT_RE=/\/\*/;function module$contents$goog$html$SafeStyle_sanitizeUrl(e){return e.replace(module$contents$goog$html$SafeStyle_URL_RE,function(e,t,n,r){var o="";return n=n.replace(/^(['"])(.*)\1$/,function(e,t,n){return o=t,n}),e=goog.html.SafeUrl.sanitize(n).getTypedStringValue(),t+o+e+o+r})}goog.html.SafeStyle=module$contents$goog$html$SafeStyle_SafeStyle;var module$contents$goog$html$SafeStyleSheet_CONSTRUCTOR_TOKEN_PRIVATE={},module$contents$goog$html$SafeStyleSheet_SafeStyleSheet=function(e,t){this.privateDoNotAccessOrElseSafeStyleSheetWrappedValue_=t===module$contents$goog$html$SafeStyleSheet_CONSTRUCTOR_TOKEN_PRIVATE?e:"",this.implementsGoogStringTypedString=!0};module$contents$goog$html$SafeStyleSheet_SafeStyleSheet.createRule=function(e,t){if((0,goog.string.internal.contains)(e,"<"))throw Error("Selector does not allow '<', got: "+e);var n=e.replace(/('|")((?!\1)[^\r\n\f\\]|\\[\s\S])*\1/g,"");if(!/^[-_a-zA-Z0-9#.:* ,>+~[\]()=^$|]+$/.test(n))throw Error("Selector allows only [-_a-zA-Z0-9#.:* ,>+~[\\]()=^$|] and strings, got: "+e);if(!module$contents$goog$html$SafeStyleSheet_SafeStyleSheet.hasBalancedBrackets_(n))throw Error("() and [] in selector must be balanced, got: "+e);return t instanceof module$contents$goog$html$SafeStyle_SafeStyle||(t=module$contents$goog$html$SafeStyle_SafeStyle.create(t)),e=e+"{"+module$contents$goog$html$SafeStyle_SafeStyle.unwrap(t).replace(/</g,"\\3C ")+"}",module$contents$goog$html$SafeStyleSheet_SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse(e)},module$contents$goog$html$SafeStyleSheet_SafeStyleSheet.hasBalancedBrackets_=function(e){for(var t={"(":")","[":"]"},n=[],r=0;r<e.length;r++){var o=e[r];if(t[o])n.push(t[o]);else if(module$contents$goog$object_containsValue(t,o)&&n.pop()!=o)return!1}return 0==n.length},module$contents$goog$html$SafeStyleSheet_SafeStyleSheet.concat=function(e){var t="",n=function(e){Array.isArray(e)?e.forEach(n):t+=module$contents$goog$html$SafeStyleSheet_SafeStyleSheet.unwrap(e)};return Array.prototype.forEach.call(arguments,n),module$contents$goog$html$SafeStyleSheet_SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse(t)},module$contents$goog$html$SafeStyleSheet_SafeStyleSheet.fromConstant=function(e){return 0===(e=goog.string.Const.unwrap(e)).length?module$contents$goog$html$SafeStyleSheet_SafeStyleSheet.EMPTY:((0,goog.asserts.assert)(!(0,goog.string.internal.contains)(e,"<"),"Forbidden '<' character in style sheet string: "+e),module$contents$goog$html$SafeStyleSheet_SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse(e))},module$contents$goog$html$SafeStyleSheet_SafeStyleSheet.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseSafeStyleSheetWrappedValue_},module$contents$goog$html$SafeStyleSheet_SafeStyleSheet.unwrap=function(e){return e instanceof module$contents$goog$html$SafeStyleSheet_SafeStyleSheet&&e.constructor===module$contents$goog$html$SafeStyleSheet_SafeStyleSheet?e.privateDoNotAccessOrElseSafeStyleSheetWrappedValue_:((0,goog.asserts.fail)("expected object of type SafeStyleSheet, got '"+e+"' of type "+goog.typeOf(e)),"type_error:SafeStyleSheet")},module$contents$goog$html$SafeStyleSheet_SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse=function(e){return new module$contents$goog$html$SafeStyleSheet_SafeStyleSheet(e,module$contents$goog$html$SafeStyleSheet_CONSTRUCTOR_TOKEN_PRIVATE)},module$contents$goog$html$SafeStyleSheet_SafeStyleSheet.prototype.toString=function(){return this.privateDoNotAccessOrElseSafeStyleSheetWrappedValue_.toString()},module$contents$goog$html$SafeStyleSheet_SafeStyleSheet.EMPTY=module$contents$goog$html$SafeStyleSheet_SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse(""),goog.html.SafeStyleSheet=module$contents$goog$html$SafeStyleSheet_SafeStyleSheet;var module$contents$goog$html$SafeHtml_CONSTRUCTOR_TOKEN_PRIVATE={},module$contents$goog$html$SafeHtml_SafeHtml=function(e,t,n){this.privateDoNotAccessOrElseSafeHtmlWrappedValue_=n===module$contents$goog$html$SafeHtml_CONSTRUCTOR_TOKEN_PRIVATE?e:"",this.dir_=t,this.implementsGoogStringTypedString=this.implementsGoogI18nBidiDirectionalString=!0};module$contents$goog$html$SafeHtml_SafeHtml.prototype.getDirection=function(){return this.dir_},module$contents$goog$html$SafeHtml_SafeHtml.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseSafeHtmlWrappedValue_.toString()},module$contents$goog$html$SafeHtml_SafeHtml.prototype.toString=function(){return this.privateDoNotAccessOrElseSafeHtmlWrappedValue_.toString()},module$contents$goog$html$SafeHtml_SafeHtml.unwrap=function(e){return module$contents$goog$html$SafeHtml_SafeHtml.unwrapTrustedHTML(e).toString()},module$contents$goog$html$SafeHtml_SafeHtml.unwrapTrustedHTML=function(e){return e instanceof module$contents$goog$html$SafeHtml_SafeHtml&&e.constructor===module$contents$goog$html$SafeHtml_SafeHtml?e.privateDoNotAccessOrElseSafeHtmlWrappedValue_:(goog.asserts.fail("expected object of type SafeHtml, got '"+e+"' of type "+goog.typeOf(e)),"type_error:SafeHtml")},module$contents$goog$html$SafeHtml_SafeHtml.htmlEscape=function(e){if(e instanceof module$contents$goog$html$SafeHtml_SafeHtml)return e;var t="object"==typeof e,n=null;return t&&e.implementsGoogI18nBidiDirectionalString&&(n=e.getDirection()),module$contents$goog$html$SafeHtml_SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(goog.string.internal.htmlEscape(t&&e.
2implementsGoogStringTypedString?e.getTypedStringValue():String(e)),n)},module$contents$goog$html$SafeHtml_SafeHtml.htmlEscapePreservingNewlines=function(e){return e instanceof module$contents$goog$html$SafeHtml_SafeHtml?e:(e=module$contents$goog$html$SafeHtml_SafeHtml.htmlEscape(e),module$contents$goog$html$SafeHtml_SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(goog.string.internal.newLineToBr(module$contents$goog$html$SafeHtml_SafeHtml.unwrap(e)),e.getDirection()))},module$contents$goog$html$SafeHtml_SafeHtml.htmlEscapePreservingNewlinesAndSpaces=function(e){return e instanceof module$contents$goog$html$SafeHtml_SafeHtml?e:(e=module$contents$goog$html$SafeHtml_SafeHtml.htmlEscape(e),module$contents$goog$html$SafeHtml_SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(goog.string.internal.whitespaceEscape(module$contents$goog$html$SafeHtml_SafeHtml.unwrap(e)),e.getDirection()))},module$contents$goog$html$SafeHtml_SafeHtml.comment=function(e){return module$contents$goog$html$SafeHtml_SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse("\x3c!--"+goog.string.internal.htmlEscape(e)+"--\x3e",null)},module$contents$goog$html$SafeHtml_SafeHtml.create=function(e,t,n){return module$contents$goog$html$SafeHtml_SafeHtml.verifyTagName(String(e)),module$contents$goog$html$SafeHtml_SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse(String(e),t,n)},module$contents$goog$html$SafeHtml_SafeHtml.verifyTagName=function(e){if(!module$contents$goog$html$SafeHtml_VALID_NAMES_IN_TAG.test(e))throw Error(module$contents$goog$html$SafeHtml_SafeHtml.ENABLE_ERROR_MESSAGES?"Invalid tag name <"+e+">.":"");if(e.toUpperCase()in module$contents$goog$html$SafeHtml_NOT_ALLOWED_TAG_NAMES)throw Error(module$contents$goog$html$SafeHtml_SafeHtml.ENABLE_ERROR_MESSAGES?"Tag name <"+e+"> is not allowed for SafeHtml.":"")},module$contents$goog$html$SafeHtml_SafeHtml.createIframe=function(e,t,n,r){e&&goog.html.TrustedResourceUrl.unwrap(e);var o={};return o.src=e||null,o.srcdoc=t&&module$contents$goog$html$SafeHtml_SafeHtml.unwrap(t),e=module$contents$goog$html$SafeHtml_SafeHtml.combineAttributes(o,{sandbox:""},n),module$contents$goog$html$SafeHtml_SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse("iframe",e,r)},module$contents$goog$html$SafeHtml_SafeHtml.createSandboxIframe=function(e,t,n,r){if(!module$contents$goog$html$SafeHtml_SafeHtml.canUseSandboxIframe())throw Error(module$contents$goog$html$SafeHtml_SafeHtml.ENABLE_ERROR_MESSAGES?"The browser does not support sandboxed iframes.":"");var o={};return o.src=e?goog.html.SafeUrl.unwrap(goog.html.SafeUrl.sanitize(e)):null,o.srcdoc=t||null,o.sandbox="",e=module$contents$goog$html$SafeHtml_SafeHtml.combineAttributes(o,{},n),module$contents$goog$html$SafeHtml_SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse("iframe",e,r)},module$contents$goog$html$SafeHtml_SafeHtml.canUseSandboxIframe=function(){return goog.global.HTMLIFrameElement&&"sandbox"in goog.global.HTMLIFrameElement.prototype},module$contents$goog$html$SafeHtml_SafeHtml.createScriptSrc=function(e,t){return goog.html.TrustedResourceUrl.unwrap(e),e=module$contents$goog$html$SafeHtml_SafeHtml.combineAttributes({src:e},{},t),module$contents$goog$html$SafeHtml_SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse("script",e)},module$contents$goog$html$SafeHtml_SafeHtml.createScript=function(e,t){for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){var r=n.toLowerCase();if("language"==r||"src"==r||"text"==r||"type"==r)throw Error(module$contents$goog$html$SafeHtml_SafeHtml.ENABLE_ERROR_MESSAGES?'Cannot set "'+r+'" attribute':"")}for(n="",e=module$contents$goog$array_concat(e),r=0;r<e.length;r++)n+=module$contents$goog$html$SafeScript_SafeScript.unwrap(e[r]);return e=module$contents$goog$html$SafeHtml_SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(n,goog.i18n.bidi.Dir.NEUTRAL),module$contents$goog$html$SafeHtml_SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse("script",t,e)},module$contents$goog$html$SafeHtml_SafeHtml.createStyle=function(e,t){t=module$contents$goog$html$SafeHtml_SafeHtml.combineAttributes({type:"text/css"},{},t);var n="";e=module$contents$goog$array_concat(e);for(var r=0;r<e.length;r++)n+=module$contents$goog$html$SafeStyleSheet_SafeStyleSheet.unwrap(e[r]);return e=module$contents$goog$html$SafeHtml_SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(n,goog.i18n.bidi.Dir.NEUTRAL),module$contents$goog$html$SafeHtml_SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse("style",t,e)},module$contents$goog$html$SafeHtml_SafeHtml.createMetaRefresh=function(e,t){return e=goog.html.SafeUrl.unwrap(goog.html.SafeUrl.sanitize(e)),(module$contents$goog$labs$userAgent$browser_matchIE()||module$contents$goog$labs$userAgent$browser_matchEdgeHtml())&&goog.string.internal.contains(e,";")&&(e="'"+e.replace(/'/g,"%27")+"'"),module$contents$goog$html$SafeHtml_SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse("meta",{"http-equiv":"refresh",content:(t||0)+"; url="+e})},module$contents$goog$html$SafeHtml_SafeHtml.createWithDir=function(e,t,n,r){return(t=module$contents$goog$html$SafeHtml_SafeHtml.create(t,n,r)).dir_=e,t},module$contents$goog$html$SafeHtml_SafeHtml.join=function(e,t){var n=(e=module$contents$goog$html$SafeHtml_SafeHtml.htmlEscape(e)).getDirection(),r=[],o=function(e){Array.isArray(e)?e.forEach(o):(e=module$contents$goog$html$SafeHtml_SafeHtml.htmlEscape(e),r.push(module$contents$goog$html$SafeHtml_SafeHtml.unwrap(e)),e=e.getDirection(),n==goog.i18n.bidi.Dir.NEUTRAL?n=e:e!=goog.i18n.bidi.Dir.NEUTRAL&&n!=e&&(n=null))};return t.forEach(o),module$contents$goog$html$SafeHtml_SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(r.join(module$contents$goog$html$SafeHtml_SafeHtml.unwrap(e)),n)},module$contents$goog$html$SafeHtml_SafeHtml.concat=function(e){return module$contents$goog$html$SafeHtml_SafeHtml.join(module$contents$goog$html$SafeHtml_SafeHtml.EMPTY,Array.prototype.slice.call(arguments))},module$contents$goog$html$SafeHtml_SafeHtml.concatWithDir=function(e,t){var n=module$contents$goog$html$SafeHtml_SafeHtml.concat(Array.prototype.slice.call(arguments,1
vendor: 4,726 bytes, line 2
2));return n.dir_=e,n},module$contents$goog$html$SafeHtml_SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse=function(e,t){var n=goog.html.trustedtypes.getPolicyPrivateDoNotAccessOrElse();return e=n?n.createHTML(e):e,new module$contents$goog$html$SafeHtml_SafeHtml(e,t,module$contents$goog$html$SafeHtml_CONSTRUCTOR_TOKEN_PRIVATE)},module$contents$goog$html$SafeHtml_SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse=function(e,t,n){var r=null,o="<"+e+module$contents$goog$html$SafeHtml_SafeHtml.stringifyAttributes(e,t);return null==n?n=[]:Array.isArray(n)||(n=[n]),goog.dom.tags.isVoidTag(e.toLowerCase())?(goog.asserts.assert(!n.length,"Void tag <"+e+"> does not allow content."),o+=">"):(r=module$contents$goog$html$SafeHtml_SafeHtml.concat(n),o+=">"+module$contents$goog$html$SafeHtml_SafeHtml.unwrap(r)+"</"+e+">",r=r.getDirection()),(e=t&&t.dir)&&(r=/^(ltr|rtl|auto)$/i.test(e)?goog.i18n.bidi.Dir.NEUTRAL:null),module$contents$goog$html$SafeHtml_SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(o,r)},module$contents$goog$html$SafeHtml_SafeHtml.stringifyAttributes=function(e,t){var n="";if(t)for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(!module$contents$goog$html$SafeHtml_VALID_NAMES_IN_TAG.test(r))throw Error(module$contents$goog$html$SafeHtml_SafeHtml.ENABLE_ERROR_MESSAGES?'Invalid attribute name "'+r+'".':"");var o=t[r];if(null!=o){var i=e,a=r;if(o instanceof goog.string.Const)o=goog.string.Const.unwrap(o);else if("style"==a.toLowerCase()){if(!module$contents$goog$html$SafeHtml_SafeHtml.SUPPORT_STYLE_ATTRIBUTE)throw Error(module$contents$goog$html$SafeHtml_SafeHtml.ENABLE_ERROR_MESSAGES?'Attribute "style" not supported.':"");if(!goog.isObject(o))throw Error(module$contents$goog$html$SafeHtml_SafeHtml.ENABLE_ERROR_MESSAGES?'The "style" attribute requires goog.html.SafeStyle or map of style properties, '+typeof o+" given: "+o:"");o instanceof module$contents$goog$html$SafeStyle_SafeStyle||(o=module$contents$goog$html$SafeStyle_SafeStyle.create(o)),o=module$contents$goog$html$SafeStyle_SafeStyle.unwrap(o)}else{if(/^on/i.test(a))throw Error(module$contents$goog$html$SafeHtml_SafeHtml.ENABLE_ERROR_MESSAGES?'Attribute "'+a+'" requires goog.string.Const value, "'+o+'" given.':"");if(a.toLowerCase()in module$contents$goog$html$SafeHtml_URL_ATTRIBUTES)if(o instanceof goog.html.TrustedResourceUrl)o=goog.html.TrustedResourceUrl.unwrap(o);else if(o instanceof goog.html.SafeUrl)o=goog.html.SafeUrl.unwrap(o);else{if("string"!=typeof o)throw Error(module$contents$goog$html$SafeHtml_SafeHtml.ENABLE_ERROR_MESSAGES?'Attribute "'+a+'" on tag "'+i+'" requires goog.html.SafeUrl, goog.string.Const, or string, value "'+o+'" given.':"");o=goog.html.SafeUrl.sanitize(o).getTypedStringValue()}}o.implementsGoogStringTypedString&&(o=o.getTypedStringValue()),goog.asserts.assert("string"==typeof o||"number"==typeof o,"String or number value expected, got "+typeof o+" with value: "+o),n+=" "+(a=a+'="'+goog.string.internal.htmlEscape(String(o))+'"')}}return n},module$contents$goog$html$SafeHtml_SafeHtml.combineAttributes=function(e,t,n){var r={};for(a in e)Object.prototype.hasOwnProperty.call(e,a)&&(goog.asserts.assert(a.toLowerCase()==a,"Must be lower case"),r[a]=e[a]);for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(goog.asserts.assert(o.toLowerCase()==o,"Must be lower case"),r[o]=t[o]);if(n)for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)){var a=i.toLowerCase();if(a in e)throw Error(module$contents$goog$html$SafeHtml_SafeHtml.ENABLE_ERROR_MESSAGES?'Cannot override "'+a+'" attribute, got "'+i+'" with value "'+n[i]+'"':"");a in t&&delete r[a],r[i]=n[i]}return r},module$contents$goog$html$SafeHtml_SafeHtml.ENABLE_ERROR_MESSAGES=goog.DEBUG,module$contents$goog$html$SafeHtml_SafeHtml.SUPPORT_STYLE_ATTRIBUTE=!0,module$contents$goog$html$SafeHtml_SafeHtml.from=module$contents$goog$html$SafeHtml_SafeHtml.htmlEscape;var module$contents$goog$html$SafeHtml_VALID_NAMES_IN_TAG=/^[a-zA-Z0-9-]+$/,module$contents$goog$html$SafeHtml_URL_ATTRIBUTES={action:!0,cite:!0,data:!0,formaction:!0,href:!0,manifest:!0,poster:!0,src:!0},module$contents$goog$html$SafeHtml_NOT_ALLOWED_TAG_NAMES=module$contents$goog$object_createSet(goog.dom.TagName.APPLET,goog.dom.TagName.BASE,goog.dom.TagName.EMBED,goog.dom.TagName.IFRAME,goog.dom.TagName.LINK,goog.dom.TagName.MATH,goog.dom.TagName.META,goog.dom.TagName.OBJECT,goog.dom.TagName.SCRIPT,goog.dom.TagName.STYLE,goog.dom.TagName.SVG,goog.dom.TagName.TEMPLATE);module$contents$goog$html$SafeHtml_SafeHtml.DOCTYPE_HTML=module$contents$goog$html$SafeHtml_SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse("<!DOCTYPE html>",goog.i18n.bidi.Dir.NEUTRAL),module$contents$goog$html$SafeHtml_SafeHtml.EMPTY=ne
2w module$contents$goog$html$SafeHtml_SafeHtml(goog.global.trustedTypes&&goog.global.trustedTypes.emptyHTML||"",goog.i18n.bidi.Dir.NEUTRAL,module$contents$goog$html$SafeHtml_CONSTRUCTOR_TOKEN_PRIVATE),module$contents$goog$html$SafeHtml_SafeHtml.BR=module$contents$goog$html$SafeHtml_SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse("<br>",goog.i18n.bidi.Dir.NEUTRAL),goog.html.SafeHtml=module$contents$goog$html$SafeHtml_SafeHtml,goog.html.uncheckedconversions={},goog.html.uncheckedconversions.safeHtmlFromStringKnownToSatisfyTypeContract=function(e,t,n){return goog.asserts.assertString(goog.string.Const.unwrap(e),"must provide justification"),goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap(e)),"must provide non-empty justification"),module$contents$goog$html$SafeHtml_SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(t,n||null)},goog.html.uncheckedconversions.safeScriptFromStringKnownToSatisfyTypeContract=function(e,t){return goog.asserts.assertString(goog.string.Const.unwrap(e),"must provide justification"),goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap(e)),"must provide non-empty justification"),module$contents$goog$html$SafeScript_SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse(t)},goog.html.uncheckedconversions.safeStyleFromStringKnownToSatisfyTypeContract=function(e,t){return goog.asserts.assertString(goog.string.Const.unwrap(e),"must provide justification"),goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap(e)),"must provide non-empty justification"),module$contents$goog$html$SafeStyle_SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse(t)},goog.html.uncheckedconversions.safeStyleSheetFromStringKnownToSatisfyTypeContract=function(e,t){return goog.asserts.assertString(goog.string.Const.unwrap(e),"must provide justification"),goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap(e)),"must provide non-empty justification"),module$contents$goog$html$SafeStyleSheet_SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse(t)},goog.html.uncheckedconversions.safeUrlFromStringKnownToSatisfyTypeContract=function(e,t){return goog.asserts.assertString(goog.string.Const.unwrap(e),"must provide justification"),goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap(e)),"must provide non-empty justification"),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(t)},goog.html.uncheckedconversions.trustedResourceUrlFromStringKnownToSatisfyTypeContract=function(e,t){return goog.asserts.assertString(goog.string.Const.unwrap(e),"must provide justification"),goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap(e)),"must provide non-empty justification"),goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(t)},goog.dom.safe={},goog.dom.safe.InsertAdjacentHtmlPosition={AFTERBEGIN:"afterbegin",AFTEREND:"afterend",BEFOREBEGIN:"beforebegin",BEFOREEND:"beforeend"},goog.dom.safe.insertAdjacentHtml=function(e,t,n){e.insertAdjacentHTML(t,module$contents$goog$html$SafeHtml_SafeHtml.unwrapTrustedHTML(n))},goog.dom.safe.SET_INNER_HTML_DISALLOWED_TAGS_={MATH:!0,SCRIPT:!0,STYLE:!0,SVG:!0,TEMPLATE:!0},goog.dom.safe.isInnerHtmlCleanupRecursive_=goog.functions.cacheReturnValue(function(){if(goog.DEBUG&&"undefined"==typeof document)return!1;var e=document.createElement("div"),t=document.createElement("div");return t.appendChild(document.createElement("div")),e.appendChild(t),!(goog.DEBUG&&!e.firstChild||(t=e.firstChild.firstChild,e.innerHTML=module$contents$goog$html$SafeHtml_SafeHtml.unwrapTrustedHTML(module$contents$goog$html$SafeHtml_SafeHtml.EMPTY),t.parentElement))}),goog.dom.safe.unsafeSetInnerHtmlDoNotUseOrElse=function(e,t){if(goog.dom.safe.isInnerHtmlCleanupRecursive_())for(;e.lastChild;)e.removeChild(e.lastChild);e.innerHTML=module$contents$goog$html$SafeHtml_SafeHtml.unwrapTrustedHTML(t)},goog.dom.safe.setInnerHtml=function(e,t){if(goog.asserts.ENABLE_ASSERTS&&e.tagName&&goog.dom.safe.SET_INNER_HTML_DISALLOWED_TAGS_[e.tagName.toUpperCase()])throw Error("goog.dom.safe.setInnerHtml cannot be used to set content of "+e.tagName+".");goog.dom.safe.unsafeSetInnerHtmlDoNotUseOrElse(e,t)},goog.dom.safe.setInnerHtmlFromConstant=function(e,t){goog.dom.safe.setInnerHtml(e,goog.html.uncheckedconversions.safeHtmlFromStringKnownToSatisfyTypeContract(goog.string.Const.from("Constant HTML to be immediatelly used."),goog.string.Const.unwrap(t)))},goog.dom.safe.setOuterHtml=function(e,t){e.outerHTML=module$contents$goog$html$SafeHtml_SafeHtml.unwrapTrustedHTML(t)},goog.dom.safe.setFormElementAction=function(e,t){t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),goog.dom.asserts.assertIsHTMLFormElement(e).action=goog.html.SafeUrl.unwrap(t)}
vendor: 5,282 bytes, line 2
2,goog.dom.safe.setButtonFormAction=function(e,t){t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),goog.dom.asserts.assertIsHTMLButtonElement(e).formAction=goog.html.SafeUrl.unwrap(t)},goog.dom.safe.setInputFormAction=function(e,t){t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),goog.dom.asserts.assertIsHTMLInputElement(e).formAction=goog.html.SafeUrl.unwrap(t)},goog.dom.safe.setStyle=function(e,t){e.style.cssText=module$contents$goog$html$SafeStyle_SafeStyle.unwrap(t)},goog.dom.safe.documentWrite=function(e,t){e.write(module$contents$goog$html$SafeHtml_SafeHtml.unwrapTrustedHTML(t))},goog.dom.safe.setAnchorHref=function(e,t){goog.dom.asserts.assertIsHTMLAnchorElement(e),t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),e.href=goog.html.SafeUrl.unwrap(t)},goog.dom.safe.setImageSrc=function(e,t){goog.dom.asserts.assertIsHTMLImageElement(e),t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t,/^data:image\//i.test(t)),e.src=goog.html.SafeUrl.unwrap(t)},goog.dom.safe.setAudioSrc=function(e,t){goog.dom.asserts.assertIsHTMLAudioElement(e),t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t,/^data:audio\//i.test(t)),e.src=goog.html.SafeUrl.unwrap(t)},goog.dom.safe.setVideoSrc=function(e,t){goog.dom.asserts.assertIsHTMLVideoElement(e),t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t,/^data:video\//i.test(t)),e.src=goog.html.SafeUrl.unwrap(t)},goog.dom.safe.setEmbedSrc=function(e,t){goog.dom.asserts.assertIsHTMLEmbedElement(e),e.src=goog.html.TrustedResourceUrl.unwrapTrustedScriptURL(t)},goog.dom.safe.setFrameSrc=function(e,t){goog.dom.asserts.assertIsHTMLFrameElement(e),e.src=goog.html.TrustedResourceUrl.unwrap(t)},goog.dom.safe.setIframeSrc=function(e,t){goog.dom.asserts.assertIsHTMLIFrameElement(e),e.src=goog.html.TrustedResourceUrl.unwrap(t)},goog.dom.safe.setIframeSrcdoc=function(e,t){goog.dom.asserts.assertIsHTMLIFrameElement(e),e.srcdoc=module$contents$goog$html$SafeHtml_SafeHtml.unwrapTrustedHTML(t)},goog.dom.safe.setLinkHrefAndRel=function(e,t,n){goog.dom.asserts.assertIsHTMLLinkElement(e),e.rel=n,goog.string.internal.caseInsensitiveContains(n,"stylesheet")?(goog.asserts.assert(t instanceof goog.html.TrustedResourceUrl,'URL must be TrustedResourceUrl because "rel" contains "stylesheet"'),e.href=goog.html.TrustedResourceUrl.unwrap(t),(t=goog.dom.safe.getStyleNonce(e.ownerDocument&&e.ownerDocument.defaultView))&&e.setAttribute("nonce",t)):e.href=t instanceof goog.html.TrustedResourceUrl?goog.html.TrustedResourceUrl.unwrap(t):t instanceof goog.html.SafeUrl?goog.html.SafeUrl.unwrap(t):goog.html.SafeUrl.unwrap(goog.html.SafeUrl.sanitizeAssertUnchanged(t))},goog.dom.safe.setObjectData=function(e,t){goog.dom.asserts.assertIsHTMLObjectElement(e),e.data=goog.html.TrustedResourceUrl.unwrapTrustedScriptURL(t)},goog.dom.safe.setScriptSrc=function(e,t){goog.dom.asserts.assertIsHTMLScriptElement(e),e.src=goog.html.TrustedResourceUrl.unwrapTrustedScriptURL(t),goog.dom.safe.setNonceForScriptElement_(e)},goog.dom.safe.setScriptContent=function(e,t){goog.dom.asserts.assertIsHTMLScriptElement(e),e.textContent=module$contents$goog$html$SafeScript_SafeScript.unwrapTrustedScript(t),goog.dom.safe.setNonceForScriptElement_(e)},goog.dom.safe.setNonceForScriptElement_=function(e){var t=goog.dom.safe.getScriptNonce(e.ownerDocument&&e.ownerDocument.defaultView);t&&e.setAttribute("nonce",t)},goog.dom.safe.setLocationHref=function(e,t){goog.dom.asserts.assertIsLocation(e),t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),e.href=goog.html.SafeUrl.unwrap(t)},goog.dom.safe.assignLocation=function(e,t){goog.dom.asserts.assertIsLocation(e),t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),e.assign(goog.html.SafeUrl.unwrap(t))},goog.dom.safe.replaceLocation=function(e,t){t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),e.replace(goog.html.SafeUrl.unwrap(t))},goog.dom.safe.openInWindow=function(e,t,n,r){return e=e instanceof goog.html.SafeUrl?e:goog.html.SafeUrl.sanitizeAssertUnchanged(e),t=t||goog.global,n=n instanceof goog.string.Const?goog.string.Const.unwrap(n):n||"",void 0!==r?t.open(goog.html.SafeUrl.unwrap(e),n,r):t.open(goog.html.SafeUrl.unwrap(e),n)},goog.dom.safe.parseFromStringHtml=function(e,t){return goog.dom.safe.parseFromString(e,t,"text/html")},goog.dom.safe.parseFromString=function(e,t,n){return e.parseFromString(module$contents$goog$html$SafeHtml_SafeHtml.unwrapTrustedHTML(t),n)},goog.dom.safe.createImageFromBlob=function(e){if(!/^image\/.*/g.test(e.type))throw Error("goog.dom.safe.createImageFromBlob only accepts MIME type image/.*.");var t=goog.global.URL.createObjectURL(e);return(e=new goog.global.Image).onload=function(){goog.global.URL.revokeObjectURL(t)},goog.dom.safe.setImageSrc(e,goog.html.uncheckedconversions.safeUrlFromStringKnownToSatisfyTypeContract(goog.string.Const.from("Image blob URL."),t)),e},goog.dom.safe.createContextualFragment=function(e,t){return e.createContextualFragment(module$contents$goog$html$SafeHtml_SafeHtml.unwrapTrustedHTML(t))},goog.dom.safe.getScriptNonce=function(e){return goog.dom.safe.getNonce_("script[n
2once]",e)},goog.dom.safe.getStyleNonce=function(e){return goog.dom.safe.getNonce_('style[nonce],link[rel="stylesheet"][nonce]',e)},goog.dom.safe.NONCE_PATTERN_=/^[\w+/_-]+[=]{0,2}$/,goog.dom.safe.getNonce_=function(e,t){return(t=(t||goog.global).document).querySelector&&(e=t.querySelector(e))&&(e=e.nonce||e.getAttribute("nonce"))&&goog.dom.safe.NONCE_PATTERN_.test(e)?e:""},goog.string.DETECT_DOUBLE_ESCAPING=!1,goog.string.FORCE_NON_DOM_HTML_UNESCAPING=!1,goog.string.Unicode={NBSP:" "},goog.string.startsWith=goog.string.internal.startsWith,goog.string.endsWith=goog.string.internal.endsWith,goog.string.caseInsensitiveStartsWith=goog.string.internal.caseInsensitiveStartsWith,goog.string.caseInsensitiveEndsWith=goog.string.internal.caseInsensitiveEndsWith,goog.string.caseInsensitiveEquals=goog.string.internal.caseInsensitiveEquals,goog.string.subs=function(e,t){for(var n=e.split("%s"),r="",o=Array.prototype.slice.call(arguments,1);o.length&&1<n.length;)r+=n.shift()+o.shift();return r+n.join("%s")},goog.string.collapseWhitespace=function(e){return e.replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")},goog.string.isEmptyOrWhitespace=goog.string.internal.isEmptyOrWhitespace,goog.string.isEmptyString=function(e){return 0==e.length},goog.string.isEmpty=goog.string.isEmptyOrWhitespace,goog.string.isEmptyOrWhitespaceSafe=function(e){return goog.string.isEmptyOrWhitespace(goog.string.makeSafe(e))},goog.string.isEmptySafe=goog.string.isEmptyOrWhitespaceSafe,goog.string.isBreakingWhitespace=function(e){return!/[^\t\n\r ]/.test(e)},goog.string.isAlpha=function(e){return!/[^a-zA-Z]/.test(e)},goog.string.isNumeric=function(e){return!/[^0-9]/.test(e)},goog.string.isAlphaNumeric=function(e){return!/[^a-zA-Z0-9]/.test(e)},goog.string.isSpace=function(e){return" "==e},goog.string.isUnicodeChar=function(e){return 1==e.length&&" "<=e&&"~">=e||"€"<=e&&"�">=e},goog.string.stripNewlines=function(e){return e.replace(/(\r\n|\r|\n)+/g," ")},goog.string.canonicalizeNewlines=function(e){return e.replace(/(\r\n|\r|\n)/g,"\n")},goog.string.normalizeWhitespace=function(e){return e.replace(/\xa0|\s/g," ")},goog.string.normalizeSpaces=function(e){return e.replace(/\xa0|[ \t]+/g," ")},goog.string.collapseBreakingSpaces=function(e){return e.replace(/[\t\r\n ]+/g," ").replace(/^[\t\r\n ]+|[\t\r\n ]+$/g,"")},goog.string.trim=goog.string.internal.trim,goog.string.trimLeft=function(e){return e.replace(/^[\s\xa0]+/,"")},goog.string.trimRight=function(e){return e.replace(/[\s\xa0]+$/,"")},goog.string.caseInsensitiveCompare=goog.string.internal.caseInsensitiveCompare,goog.string.numberAwareCompare_=function(e,t,n){if(e==t)return 0;if(!e)return-1;if(!t)return 1;for(var r=e.toLowerCase().match(n),o=t.toLowerCase().match(n),i=Math.min(r.length,o.length),a=0;a<i;a++){n=r[a];var s=o[a];if(n!=s)return e=parseInt(n,10),!isNaN(e)&&(t=parseInt(s,10),!isNaN(t)&&e-t)?e-t:n<s?-1:1}return r.length!=o.length?r.length-o.length:e<t?-1:1},goog.string.intAwareCompare=function(e,t){return goog.string.numberAwareCompare_(e,t,/\d+|\D+/g)},goog.string.floatAwareCompare=function(e,t){return goog.string.numberAwareCompare_(e,t,/\d+|\.\d+|\D+/g)},goog.string.numerateCompare=goog.string.floatAwareCompare,goog.string.urlEncode=function(e){return encodeURIComponent(String(e))},goog.string.urlDecode=function(e){return decodeURIComponent(e.replace(/\+/g," "))},goog.string.newLineToBr=goog.string.internal.newLineToBr,goog.string.htmlEscape=function(e,t){return e=goog.string.internal.htmlEscape(e,t),goog.string.DETECT_DOUBLE_ESCAPING&&(e=e.replace(goog.string.E_RE_,"&#101;")),e},goog.string.E_RE_=/e/g,goog.string.unescapeEntities=function(e){return goog.string.contains(e,"&")?!goog.string.FORCE_NON_DOM_HTML_UNESCAPING&&"document"in goog.global?goog.string.unescapeEntitiesUsingDom_(e):goog.string.unescapePureXmlEntities_(e):e},goog.string.unescapeEntitiesWithDocument=function(e,t){return goog.string.contains(e,"&")?goog.string.unescapeEntitiesUsingDom_(e,t):e},goog.string.unescapeEntitiesUsingDom_=function(e,t){var n={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"'},r=t?t.createElement("div"):goog.global.document.createElement("div");return e.replace(goog.string.HTML_ENTITY_PATTERN_,function(e,t){var o=n[e];return o||("#"==t.charAt(0)&&(t=Number("0"+t.substr(1)),isNaN(t)||(o=String.fromCharCode(t))),o||(goog.dom.safe.setInnerHtml(r,goog.html.uncheckedconversions.safeHtmlFromStringKnownToSatisfyTypeContract(goog.string.Const.from("Single HTML entity."),e+" ")),o=r.firstChild.nodeValue.slice(0,-1)),n[e]=o)})},goog.string.unescapePureXmlEntities_=function(e){return e.replace(/&([^;]+);/g,function(e,t){switch(t){case"amp":return"&";case"lt":return"<";case"gt":return">";case"quot":return'"';default:return"#"!=t.charAt(0)||(t=Number("0"+t.substr(1)),isNaN(t))?e:String.fromCharCode(t)}})},goog.string.HTML_ENTITY_PATTERN_=/&([^;\s<&]+);?/g,goog.string.whitespaceEscape=function(e,t){return goog.string.newLineToBr(e.replace(/  /g," &#160;"),t)},goog.string.preserveSpaces=function(e){return e.replace(/(^|[\n ]) /g,"$1"+goog.string.Unicode.NBSP)},goog.string.stripQuotes=function(e,t){for(var n=t.length,r=0;r<n;r++){var o=1==n?t:t.charAt(r);if(e.charAt(0)==o&&e.charAt(e.length-1)==o)return e.substring(1,e.length-1)}return e},goog.string.truncate=function(e,t,n){return n&&(e=goog.string.unescapeEntities(e)),e.length>t&&(e=e.substring(0,t-3)+"..."),n&&(e=goog.string.htmlEscape(e)),e},goog.string.truncateMiddle=function(e,t,n,r){return n&&(e=goog.string.unescapeEntities(e)),r&&e.length>t?(r>t&&(r=t),e=e.substring(0,t-r)+"..."+e.substring(e.length-r)):e.length>t&&(r=Math.floor(t/2),e=e.substring(0,r+t%2)+"..."+e.substring(e.length-r)),n&&(e=goog.string.htmlEscape(e)),e},goog.string.specialEscapeChars_={"\0":"\\0","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\x0B",'"':'\\"',"\\":"\\\\","<":"\\u003C"},goog.string.jsEscapeCache_={"'":"\\'"},goog.string.quote=function(e){e=String(e);for(var t=['"'],n=0;n<e.length;n++){var r=e.charAt(n),o=r.charCodeAt(0);t[n+1]=goog.string.specialEscapeChars_[r]||(31<o&&127>o?r:goog.string.escapeChar(r))}return t.push('"'),t.join("")},goog.string.escapeString=function(e){for(var t=[],n=0;n<e.length;n++)t[n]=goog.string.escapeChar(e.charAt(n));return t.join("")},goog.string.escapeChar=function(e){if(e in goog.string.jsEscapeCache_)return goog.string.jsEscapeCache_[e];if(e in goog.string.specialEscapeChars_)return goog.string.jsEscapeCache_[e]=goog.string.specialEscapeChars_[e];var t=e.charCodeAt(0);if(31<t&&127>t)var n=e;else 256>t?(n="\\x",(16>t||256<t)&&(n+="0")):(n="\\u",4096>t&&(n+="0")),n+=t.toString(16).toUpperCase();return goog.string.jsEscapeCache_[e]=n},goog.string.contains=goog.string.internal.contains,goog.string.caseInsensitiveContains=goog.string.internal.caseInsensitiveContains,goog.string.countOf=function(e,t){return e&&t?e.split(t).length-1:0},goog.string.removeAt=function(e,t,n){var r=e;return 0<=t&&t<e.length&&0<n&&(r=e.substr(0,t)+e.substr(t+n,e.length-t-n)),r},goog.string.remove=function(e,t){return e.replace(t,"")},goog.string.removeAll=function(e,t){return t=new RegExp(goog.string.regExpEscape(t),"g"),e.replace(t,"")},goog.string.replaceAll=function(e,t,n){return t=new RegExp(goog.string.regExpEscape(t),"g"),e.replace(t,n.replace(/\$/g,"$$$$"))},goog.string.regExpEscape=function(e){return String(e).replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1").replace(/\x08/g,"\\x08")},goog.string.repeat=String.prototype.repeat?function(e,t){return e.repeat(t)}:function(e,t){return Array(t+1).join(e)},goog.string.padNumber=function(e,t,n){if(!Number.isFinite(e))return String(e);-1===(n=(e=void 0!==n?e.toFixed(n):String(e)).indexOf("."))&&(n=e.length);var r="-"===e[0]?"-":"";return r&&(e=e.substring(1)),r+goog.string.repeat("0",Math.max(0,t-n))+e},goog.string.makeSafe=function(e){return null==e?"":String(e)},goog.string.buildString=function(e){return Array.prototype.join.call(arguments,"")},goog.string.getRandomString=function(){return Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^goog.now()).toString(36)},goog.string.compareVersions=goog.string.internal.compareVersions,goog.string.hashCode=function(e){for(var t=0,n=0;n<e.length;++n)t=31*t+e.charCodeAt(n)>>>0;return t},goog.string.uniqueStringCounter_=2147483648*Math.random()|0,goog.string.createUniqueString=function(){return"goog_"+goog.string.uniqueStringCounter_++},goog.string.toNumber=function(e){var t=Number(e);return 0==t&&goog.string.isEmptyOrWhitespace(e)?NaN:t},goog.string.isLowerCamelCase=function(e){return/^[a-z]+([A-Z][a-z]*)*$/.test(e)}
vendor: 7,245 bytes, line 2
2,goog.string.isUpperCamelCase=function(e){return/^([A-Z][a-z]*)+$/.test(e)},goog.string.toCamelCase=function(e){return String(e).replace(/\-([a-z])/g,function(e,t){return t.toUpperCase()})},goog.string.toSelectorCase=function(e){return String(e).replace(/([A-Z])/g,"-$1").toLowerCase()},goog.string.toTitleCase=function(e,t){return t="string"==typeof t?goog.string.regExpEscape(t):"\\s",e.replace(new RegExp("(^"+(t?"|["+t+"]+":"")+")([a-z])","g"),function(e,t,n){return t+n.toUpperCase()})},goog.string.capitalize=function(e){return String(e.charAt(0)).toUpperCase()+String(e.substr(1)).toLowerCase()},goog.string.parseInt=function(e){return isFinite(e)&&(e=String(e)),"string"==typeof e?/^\s*-?0x/i.test(e)?parseInt(e,16):parseInt(e,10):NaN},goog.string.splitLimit=function(e,t,n){e=e.split(t);for(var r=[];0<n&&e.length;)r.push(e.shift()),n--;return e.length&&r.push(e.join(t)),r},goog.string.lastComponent=function(e,t){if(!t)return e;"string"==typeof t&&(t=[t]);for(var n=-1,r=0;r<t.length;r++)if(""!=t[r]){var o=e.lastIndexOf(t[r]);o>n&&(n=o)}return-1==n?e:e.slice(n+1)},goog.string.editDistance=function(e,t){var n=[],r=[];if(e==t)return 0;if(!e.length||!t.length)return Math.max(e.length,t.length);for(var o=0;o<t.length+1;o++)n[o]=o;for(o=0;o<e.length;o++){r[0]=o+1;for(var i=0;i<t.length;i++)r[i+1]=Math.min(r[i]+1,n[i+1]+1,n[i]+Number(e[o]!=t[i]));for(i=0;i<n.length;i++)n[i]=r[i]}return r[t.length]},goog.uri={},goog.uri.utils={},goog.uri.utils.QueryArray={},goog.uri.utils.QueryValue={},goog.uri.utils.CharCode_={AMPERSAND:38,EQUAL:61,HASH:35,QUESTION:63},goog.uri.utils.buildFromEncodedParts=function(e,t,n,r,o,i,a){var s="";return e&&(s+=e+":"),n&&(s+="//",t&&(s+=t+"@"),s+=n,r&&(s+=":"+r)),o&&(s+=o),i&&(s+="?"+i),a&&(s+="#"+a),s},goog.uri.utils.splitRe_=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^\\\\/?#]*)@)?([^\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\/?#]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$"),goog.uri.utils.ComponentIndex={SCHEME:1,USER_INFO:2,DOMAIN:3,PORT:4,PATH:5,QUERY_DATA:6,FRAGMENT:7},goog.uri.utils.urlPackageSupportLoggingHandler_=null,goog.uri.utils.setUrlPackageSupportLoggingHandler=function(e){goog.uri.utils.urlPackageSupportLoggingHandler_=e},goog.uri.utils.split=function(e){var t=e.match(goog.uri.utils.splitRe_);return goog.uri.utils.urlPackageSupportLoggingHandler_&&0<=["http","https","ws","wss","ftp"].indexOf(t[goog.uri.utils.ComponentIndex.SCHEME])&&goog.uri.utils.urlPackageSupportLoggingHandler_(e),t},goog.uri.utils.decodeIfPossible_=function(e,t){return e?t?decodeURI(e):decodeURIComponent(e):e},goog.uri.utils.getComponentByIndex_=function(e,t){return goog.uri.utils.split(t)[e]||null},goog.uri.utils.getScheme=function(e){return goog.uri.utils.getComponentByIndex_(goog.uri.utils.ComponentIndex.SCHEME,e)},goog.uri.utils.getEffectiveScheme=function(e){return!(e=goog.uri.utils.getScheme(e))&&goog.global.self&&goog.global.self.location&&(e=(e=goog.global.self.location.protocol).substr(0,e.length-1)),e?e.toLowerCase():""},goog.uri.utils.getUserInfoEncoded=function(e){return goog.uri.utils.getComponentByIndex_(goog.uri.utils.ComponentIndex.USER_INFO,e)},goog.uri.utils.getUserInfo=function(e){return goog.uri.utils.decodeIfPossible_(goog.uri.utils.getUserInfoEncoded(e))},goog.uri.utils.getDomainEncoded=function(e){return goog.uri.utils.getComponentByIndex_(goog.uri.utils.ComponentIndex.DOMAIN,e)},goog.uri.utils.getDomain=function(e){return goog.uri.utils.decodeIfPossible_(goog.uri.utils.getDomainEncoded(e),!0)},goog.uri.utils.getPort=function(e){return Number(goog.uri.utils.getComponentByIndex_(goog.uri.utils.ComponentIndex.PORT,e))||null},goog.uri.utils.getPathEncoded=function(e){return goog.uri.utils.getComponentByIndex_(goog.uri.utils.ComponentIndex.PATH,e)},goog.uri.utils.getPath=function(e){return goog.uri.utils.decodeIfPossible_(goog.uri.utils.getPathEncoded(e),!0)},goog.uri.utils.getQueryData=function(e){return goog.uri.utils.getComponentByIndex_(goog.uri.utils.ComponentIndex.QUERY_DATA,e)},goog.uri.utils.getFragmentEncoded=function(e){var t=e.indexOf("#");return 0>t?null:e.substr(t+1)},goog.uri.utils.setFragmentEncoded=function(e,t){return goog.uri.utils.removeFragment(e)+(t?"#"+t:"")},goog.uri.utils.getFragment=function(e){return goog.uri.utils.decodeIfPossible_(goog.uri.utils.getFragmentEncoded(e))},goog.uri.utils.getHost=function(e){return e=goog.uri.utils.split(e),goog.uri.utils.buildFromEncodedParts(e[goog.uri.utils.ComponentIndex.SCHEME],e[goog.uri.utils.ComponentIndex.USER_INFO],e[goog.uri.utils.ComponentIndex.DOMAIN],e[goog.uri.utils.ComponentIndex.PORT])},goog.uri.utils.getOrigin=function(e){return e=goog.uri.utils.split(e),goog.uri.utils.buildFromEncodedParts(e[goog.uri.utils.ComponentIndex.SCHEME],null,e[goog.uri.utils.ComponentIndex.DOMAIN],e[goog.uri.utils.ComponentIndex.PORT])},goog.uri.utils.getPathAndAfter=function(e){return e=goog.uri.utils.split(e),goog.uri.utils.buildFromEncodedParts(null,null,null,null,e[goog.uri.utils.ComponentIndex.PATH],e[goog.uri.utils.ComponentIndex.QUERY_DATA],e[goog.uri.utils.ComponentIndex.FRAGMENT])},goog.uri.utils.removeFragment=function(e){var t=e.indexOf("#");return 0>t?e:e.substr(0,t)},goog.uri.utils.haveSameDomain=function(e,t){return e=goog.uri.utils.split(e),t=goog.uri.utils.split(t),e[goog.uri.utils.ComponentIndex.DOMAIN]==t[goog.uri.utils.ComponentIndex.DOMAIN]&&e[goog.uri.utils.ComponentIndex.SCHEME]==t[goog.uri.utils.ComponentIndex.SCHEME]&&e[goog.uri.utils.ComponentIndex.PORT]==t[goog.uri.utils.ComponentIndex.PORT]},goog.uri.utils.assertNoFragmentsOrQueries_=function(e){goog.asserts.assert(0>e.indexOf("#")&&0>e.indexOf("?"),"goog.uri.utils: Fragment or query identifiers are not supported: [%s]",e)},goog.uri.utils.parseQueryData=function(e,t){if(e){e=e.split("&");for(var n=0;n<e.length;n++){var r=e[n].indexOf("="),o=null;if(0<=r){var i=e[n].substring(0,r);o=e[n].substring(r+1)}else i=e[n];t(i,o?goog.string.urlDecode(o):"")}}},goog.uri.utils.splitQueryData_=function(e){var t=e.indexOf("#");0>t&&(t=e.length);var n=e.indexOf("?");if(0>n||n>t){n=t;var r=""}else r=e.substring(n+1,t);return[e.substr(0,n),r,e.substr(t)]},goog.uri.utils.joinQueryData_=function(e){return e[0]+(e[1]?"?"+e[1]:"")+e[2]},goog.uri.utils.appendQueryData_=function(e,t){return t?e?e+"&"+t:t:e},goog.uri.utils.appendQueryDataToUri_=function(e,t){return t?((e=goog.uri.utils.splitQueryData_(e))[1]=goog.uri.utils.appendQueryData_(e[1],t),goog.uri.utils.joinQueryData_(e)):e},goog.uri.utils.appendKeyValuePairs_=function(e,t,n){if(goog.asserts.assertString(e),Array.isArray(t)){goog.asserts.assertArray(t);for(var r=0;r<t.length;r++)goog.uri.utils.appendKeyValuePairs_(e,String(t[r]),n)}else null!=t&&n.push(e+(""===t?"":"="+goog.string.urlEncode(t)))},goog.uri.utils.buildQueryData=function(e,t){goog.asserts.assert(0==Math.max(e.length-(t||0),0)%2,"goog.uri.utils: Key/value lists must be even in length.");var n=[];for(t=t||0;t<e.length;t+=2)goog.uri.utils.appendKeyValuePairs_(e[t],e[t+1],n);return n.join("&")},goog.uri.utils.buildQueryDataFromMap=function(e){var t,n=[];for(t in e)goog.uri.utils.appendKeyValuePairs_(t,e[t],n);return n.join("&")},goog.uri.utils.appendParams=function(e,t){var n=2==arguments.length?goog.uri.utils.buildQueryData(arguments[1],0):goog.uri.utils.buildQueryData(arguments,1
2);return goog.uri.utils.appendQueryDataToUri_(e,n)},goog.uri.utils.appendParamsFromMap=function(e,t){return t=goog.uri.utils.buildQueryDataFromMap(t),goog.uri.utils.appendQueryDataToUri_(e,t)},goog.uri.utils.appendParam=function(e,t,n){return n=null!=n?"="+goog.string.urlEncode(n):"",goog.uri.utils.appendQueryDataToUri_(e,t+n)},goog.uri.utils.findParam_=function(e,t,n,r){for(var o=n.length;0<=(t=e.indexOf(n,t))&&t<r;){var i=e.charCodeAt(t-1);if(!(i!=goog.uri.utils.CharCode_.AMPERSAND&&i!=goog.uri.utils.CharCode_.QUESTION||(i=e.charCodeAt(t+o))&&i!=goog.uri.utils.CharCode_.EQUAL&&i!=goog.uri.utils.CharCode_.AMPERSAND&&i!=goog.uri.utils.CharCode_.HASH))return t;t+=o+1}return-1},goog.uri.utils.hashOrEndRe_=/#|$/,goog.uri.utils.hasParam=function(e,t){return 0<=goog.uri.utils.findParam_(e,0,t,e.search(goog.uri.utils.hashOrEndRe_))},goog.uri.utils.getParamValue=function(e,t){var n=e.search(goog.uri.utils.hashOrEndRe_),r=goog.uri.utils.findParam_(e,0,t,n);if(0>r)return null;var o=e.indexOf("&",r);return(0>o||o>n)&&(o=n),r+=t.length+1,goog.string.urlDecode(e.substr(r,o-r))},goog.uri.utils.getParamValues=function(e,t){for(var n,r=e.search(goog.uri.utils.hashOrEndRe_),o=0,i=[];0<=(n=goog.uri.utils.findParam_(e,o,t,r));)(0>(o=e.indexOf("&",n))||o>r)&&(o=r),n+=t.length+1,i.push(goog.string.urlDecode(e.substr(n,o-n)));return i},goog.uri.utils.trailingQueryPunctuationRe_=/[?&]($|#)/,goog.uri.utils.removeParam=function(e,t){for(var n,r=e.search(goog.uri.utils.hashOrEndRe_),o=0,i=[];0<=(n=goog.uri.utils.findParam_(e,o,t,r));)i.push(e.substring(o,n)),o=Math.min(e.indexOf("&",n)+1||r,r);return i.push(e.substr(o)),i.join("").replace(goog.uri.utils.trailingQueryPunctuationRe_,"$1")},goog.uri.utils.setParam=function(e,t,n){return goog.uri.utils.appendParam(goog.uri.utils.removeParam(e,t),t,n)},goog.uri.utils.setParamsFromMap=function(e,t){var n=(e=goog.uri.utils.splitQueryData_(e))[1],r=[];return n&&n.split("&").forEach(function(e){var n=e.indexOf("=");t.hasOwnProperty(0<=n?e.substr(0,n):e)||r.push(e)}),e[1]=goog.uri.utils.appendQueryData_(r.join("&"),goog.uri.utils.buildQueryDataFromMap(t)),goog.uri.utils.joinQueryData_(e)},goog.uri.utils.appendPath=function(e,t){return goog.uri.utils.assertNoFragmentsOrQueries_(e),goog.string.endsWith(e,"/")&&(e=e.substr(0,e.length-1)),goog.string.startsWith(t,"/")&&(t=t.substr(1)),e+"/"+t},goog.uri.utils.setPath=function(e,t){return goog.string.startsWith(t,"/")||(t="/"+t),e=goog.uri.utils.split(e),goog.uri.utils.buildFromEncodedParts(e[goog.uri.utils.ComponentIndex.SCHEME],e[goog.uri.utils.ComponentIndex.USER_INFO],e[goog.uri.utils.ComponentIndex.DOMAIN],e[goog.uri.utils.ComponentIndex.PORT],t,e[goog.uri.utils.ComponentIndex.QUERY_DATA],e[goog.uri.utils.ComponentIndex.FRAGMENT])},goog.uri.utils.StandardQueryParam={RANDOM:"zx"},goog.uri.utils.makeUnique=function(e){return goog.uri.utils.setParam(e,goog.uri.utils.StandardQueryParam.RANDOM,goog.string.getRandomString())},proto.tflite={},proto.tflite.proto={},proto.tflite.proto.BenchmarkStoragePaths=function(e){module$contents$jspb$internal$public_for_gencode_GeneratedMessage.call(this,e)},$jscomp.inherits(proto.tflite.proto.BenchmarkStoragePaths,module$contents$jspb$internal$public_for_gencode_GeneratedMessage),proto.tflite.proto.BenchmarkStoragePaths.prototype.getStorageFilePath=function(){return this.internal_getStringFieldWithDefault(1)},proto.tflite.proto.BenchmarkStoragePaths.prototype.setStorageFilePath=function(e){return this.internal_setField(1,e)},proto.tflite.proto.BenchmarkStoragePaths.prototype.clearStorageFilePath=function(){return this.internal_clearField(1)},proto.tflite.proto.BenchmarkStoragePaths.prototype.hasStorageFilePath=function(){return this.internal_hasField(1)},proto.tflite.proto.BenchmarkStoragePaths.prototype.getDataDirectoryPath=function(){return this.internal_getStringFieldWithDefault(2)},proto.tflite.proto.BenchmarkStoragePaths.prototype.setDataDirectoryPath=function(e){return this.internal_setField(2,e)},proto.tflite.proto.BenchmarkStoragePaths.prototype.clearDataDirectoryPath=function(){return this.internal_clearField(2)},proto.tflite.proto.BenchmarkStoragePaths.prototype.hasDataDirectoryPath=function(){return this.internal_hasField(2)},proto.tflite.proto.BenchmarkStoragePaths.internalDoNotUse$proto$tflite$proto$BenchmarkStoragePaths$getBinaryFieldsObject=function(){return{1:jspb.internal.binary.readString,2:jspb.internal.binary.readString}},proto.tflite.proto.BenchmarkStoragePaths.prototype.serializeBinary=function(){return jspb.internal.binary.serializeBinary(this,proto.tflite.proto.BenchmarkStoragePaths.serializeBinaryToWriter)},proto.tflite.proto.BenchmarkStoragePaths.serializeBinaryToWriter=function(e,t){jspb.internal.binary.writeString(t,e,1),jspb.internal.binary.writeString(t,e,2),jspb.internal.binary.serializeBinaryExtensionsAndUnknownFields(e,t)},proto.tflite.proto.BenchmarkStoragePaths.deserializeBinary=function(e){return jspb.internal.binary.deserializeBinary(e,proto.tflite.proto.BenchmarkStoragePaths,proto.tflite.proto.BenchmarkStoragePaths.internalDoNotUse$proto$tflite$proto$BenchmarkStoragePaths$getBinaryFieldsObject)},proto.tflite.proto.BenchmarkStoragePaths.deserializeBinaryFromReader=function(e,t){return module$contents$jspb$internal$binary_deserializeBinaryFromReaderGeneric(e,t,proto.tflite.proto.BenchmarkStoragePaths.internalDoNotUse$proto$tflite$proto$BenchmarkStoragePaths$getBinaryFieldsObject)},proto.tflite.proto.BenchmarkStoragePaths.deserialize=function(e){return module$exports$jspb.Message.deserializeWithCtor(proto.tflite.proto.BenchmarkStoragePaths,e)},proto.tflite.proto.BenchmarkStoragePaths.ObjectFormat=function(){},module$contents$jspb$internal$public_for_gencode_GENERATE_FROM_OBJECT&&(proto.tflite.proto.BenchmarkStoragePaths.fromObject=function(e){var t=new proto.tflite.proto.BenchmarkStoragePaths;return null!=e.storageFilePath&&t.internal_setField(1,e.storageFilePath),null!=e.dataDirectoryPath&&t.internal_setField(2,e.dataDirectoryPath),t}),proto.tflite.proto.BenchmarkStoragePaths.prototype.toObject=function(e){return proto.tflite.proto.BenchmarkStoragePaths.internal_toObject(e,this)},proto.tflite.proto.BenchmarkStoragePaths.internal_toObject=function(e,t){if(null!=t){var n={storageFilePath:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(1)),dataDirectoryPath:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(2))};return e&&(n.$jspbMessageInstance=t),n}},proto.tflite.proto.CPUSettings=function(e){module$contents$jspb$internal$public_for_gencode_GeneratedMessage.call(this,e)},$jscomp.inherits(proto.tflite.proto.CPUSettings,module$contents$jspb$internal$public_for_gencode_GeneratedMessage),proto.tflite.proto.CPUSettings.prototype.getNumThreads=function(){return this.internal_getIntegerFieldWithDefault(1,-1)},proto.tflite.proto.CPUSettings.prototype.setNumThreads=function(e){return this.internal_setField(1,e)},proto.tflite.proto.CPUSettings.prototype.clearNumThreads=function(){return this.internal_clearField(1)},proto.tflite.proto.CPUSettings.prototype.hasNumThreads=function(){return this.internal_hasField(1)},proto.tflite.proto.CPUSettings.internalDoNotUse$proto$tflite$proto$CPUSettings$getBinaryFieldsObject=function(){return{1:jspb.internal.binary.readInt32}},proto.tflite.proto.CPUSettings.prototype.serializeBinary=function(){return jspb.internal.binary.serializeBinary(this,proto.tflite.proto.CPUSettings.serializeBinaryToWriter)},proto.tflite.proto.CPUSettings.serializeBinaryToWriter=function(e,t){jspb.internal.binary.writeInt32(t,e,1),jspb.internal.binary.serializeBinaryExtensionsAndUnknownFields(e,t)},proto.tflite.proto.CPUSettings.deserializeBinary=function(e){return jspb.internal.binary.deserializeBinary(e,proto.tflite.proto.CPUSettings,proto.tflite.proto.CPUSettings.internalDoNotUse$proto$tflite$proto$CPUSettings$getBinaryFieldsObject)},proto.tflite.proto.CPUSettings.deserializeBinaryFromReader=function(e,t){return module$contents$jspb$internal$binary_deserializeBinaryFromReaderGeneric(e,t,proto.tflite.proto.CPUSettings.internalDoNotUse$proto$tflite$proto$CPUSettings$getBinaryFieldsObject)},proto.tflite.proto.CPUSettings.deserialize=function(e){return module$exports$jspb.Message.deserializeWithCtor(proto.tflite.proto.CPUSettings,e)},proto.tflite.proto.CPUSettings.ObjectFormat=function(){},module$contents$jspb$internal$public_for_gencode_GENERATE_FROM_OBJECT&&(proto.tflite.proto.CPUSettings.fromObject=function(e){var t=new proto.tflite.proto.CPUSettings;return null!=e.numThreads&&t.internal_setField(1,e.numThreads),t}),proto.tflite.proto.CPUSettings.prototype.toObject=function(e){return proto.tflite.proto.CPUSettings.internal_toObject(e,this)},proto.tflite.proto.CPUSettings.internal_toObject=function(e,t){if(null!=t){var n={numThreads:t.internal_getIntegerFieldWithDefault(1,-1)};return e&&(n.$jspbMessageInstance=t),n}},proto.tflite.proto.ModelFile=function(e){module$contents$jspb$internal$public_for_gencode_GeneratedMessage.call(this,e)},$jscomp.inherits(proto.tflite.proto.ModelFile,module$contents$jspb$internal$public_for_gencode_GeneratedMessage),proto.tflite.proto.ModelFile.prototype.getFilename=function(){return this.internal_getStringFieldWithDefault(1)},proto.tflite.proto.ModelFile.prototype.setFilename=function(e){return this.internal_setField(1,e)},proto.tflite.proto.ModelFile.prototype.clearFilename=function(){return this.internal_clearField(1)},proto.tflite.proto.ModelFile.prototype.hasFilename=function(){return this.internal_hasField(1)},proto.tflite.proto.ModelFile.prototype.getFd=function(){return this.internal_getIntegerFieldWithDefault(2)},proto.tflite.proto.ModelFile.prototype.setFd=function(e){return this.internal_setField(2,e)},proto.tflite.proto.ModelFile.prototype.clearFd=function(){return this.internal_clearField(2)}
2,proto.tflite.proto.ModelFile.prototype.hasFd=function(){return this.internal_hasField(2)},proto.tflite.proto.ModelFile.prototype.getOffset=function(){return this.internal_getIntegerFieldWithDefault(3)},proto.tflite.proto.ModelFile.prototype.setOffset=function(e){return this.internal_setField(3,e)},proto.tflite.proto.ModelFile.prototype.clearOffset=function(){return this.internal_clearField(3)},proto.tflite.proto.ModelFile.prototype.hasOffset=function(){return this.internal_hasField(3)},proto.tflite.proto.ModelFile.prototype.getLength=function(){return this.internal_getIntegerFieldWithDefault(4)},proto.tflite.proto.ModelFile.prototype.setLength=function(e){return this.internal_setField(4,e)},proto.tflite.proto.ModelFile.prototype.clearLength=function(){return this.internal_clearField(4)},proto.tflite.proto.ModelFile.prototype.hasLength=function(){return this.internal_hasField(4)},proto.tflite.proto.ModelFile.internalDoNotUse$proto$tflite$proto$ModelFile$getBinaryFieldsObject=function(){return{1:jspb.internal.binary.readString,2:jspb.internal.binary.readInt64,3:jspb.internal.binary.readInt64,4:jspb.internal.binary.readInt64}},proto.tflite.proto.ModelFile.prototype.serializeBinary=function(){return jspb.internal.binary.serializeBinary(this,proto.tflite.proto.ModelFile.serializeBinaryToWriter)},proto.tflite.proto.ModelFile.serializeBinaryToWriter=function(e,t){jspb.internal.binary.writeString(t,e,1),jspb.internal.binary.writeInt64(t,e,2),jspb.internal.binary.writeInt64(t,e,3),jspb.internal.binary.writeInt64(t,e,4),jspb.internal.binary.serializeBinaryExtensionsAndUnknownFields(e,t)},proto.tflite.proto.ModelFile.deserializeBinary=function(e){return jspb.internal.binary.deserializeBinary(e,proto.tflite.proto.ModelFile,proto.tflite.proto.ModelFile.internalDoNotUse$proto$tflite$proto$ModelFile$getBinaryFieldsObject)},proto.tflite.proto.ModelFile.deserializeBinaryFromReader=function(e,t){return module$contents$jspb$internal$binary_deserializeBinaryFromReaderGeneric(e,t,proto.tflite.proto.ModelFile.internalDoNotUse$proto$tflite$proto$ModelFile$getBinaryFieldsObject)},proto.tflite.proto.ModelFile.deserialize=function(e){return module$exports$jspb.Message.deserializeWithCtor(proto.tflite.proto.ModelFile,e)},proto.tflite.proto.ModelFile.ObjectFormat=function(){},module$contents$jspb$internal$public_for_gencode_GENERATE_FROM_OBJECT&&(proto.tflite.proto.ModelFile.fromObject=function(e){var t=new proto.tflite.proto.ModelFile;return null!=e.filename&&t.internal_setField(1,e.filename),null!=e.fd&&t.internal_setField(2,e.fd),null!=e.offset&&t.internal_setField(3,e.offset),null!=e.length&&t.internal_setField(4,e.length),t}),proto.tflite.proto.ModelFile.prototype.toObject=function(e){return proto.tflite.proto.ModelFile.internal_toObject(e,this)},proto.tflite.proto.ModelFile.internal_toObject=function(e,t){if(null!=t){var n={filename:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(1)),fd:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(2)),offset:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(3)),length:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(4))};return e&&(n.$jspbMessageInstance=t),n}},proto.tflite.proto.CoralSettings=function(e){module$contents$jspb$internal$public_for_gencode_GeneratedMessage.call(this,e)},$jscomp.inherits(proto.tflite.proto.CoralSettings,module$contents$jspb$internal$public_for_gencode_GeneratedMessage),proto.tflite.proto.CoralSettings.prototype.getDevice=function(){return this.internal_getStringFieldWithDefault(1)},proto.tflite.proto.CoralSettings.prototype.setDevice=function(e){return this.internal_setField(1,e)},proto.tflite.proto.CoralSettings.prototype.clearDevice=function(){return this.internal_clearField(1)},proto.tflite.proto.CoralSettings.prototype.hasDevice=function(){return this.internal_hasField(1)},proto.tflite.proto.CoralSettings.prototype.getPerformance=function(){return this.internal_getFieldWithDefault(2,1)},proto.tflite.proto.CoralSettings.prototype.setPerformance=function(e){return this.internal_setField(2,e)},proto.tflite.proto.CoralSettings.prototype.clearPerformance=function(){return this.internal_clearField(2)},proto.tflite.proto.CoralSettings.prototype.hasPerformance=function(){return this.internal_hasField(2)},proto.tflite.proto.CoralSettings.prototype.getUsbAlwaysDfu=function(){return this.internal_getBooleanFieldWithDefault(3)},proto.tflite.proto.CoralSettings.prototype.setUsbAlwaysDfu=function(e){return this.internal_setField(3,e)},proto.tflite.proto.CoralSettings.prototype.clearUsbAlwaysDfu=function(){return this.internal_clearField(3)},proto.tflite.proto.CoralSettings.prototype.hasUsbAlwaysDfu=function(){return this.internal_hasField(3)},proto.tflite.proto.CoralSettings.prototype.getUsbMaxBulkInQueueLength=function(){return this.internal_getIntegerFieldWithDefault(4)},proto.tflite.proto.CoralSettings.prototype.setUsbMaxBulkInQueueLength=function(e){return this.internal_setField(4,e)},proto.tflite.proto.CoralSettings.prototype.clearUsbMaxBulkInQueueLength=function(){return this.internal_clearField(4)},proto.tflite.proto.CoralSettings.prototype.hasUsbMaxBulkInQueueLength=function(){return this.internal_hasField(4)},proto.tflite.proto.CoralSettings.internalDoNotUse$proto$tflite$proto$CoralSettings$getBinaryFieldsObject=function(){return{1:jspb.internal.binary.readString,2:jspb.internal.binary.readEnum,3:jspb.internal.binary.readBool,4:jspb.internal.binary.readInt32}},proto.tflite.proto.CoralSettings.prototype.serializeBinary=function(){return jspb.internal.binary.serializeBinary(this,proto.tflite.proto.CoralSettings.serializeBinaryToWriter)},proto.tflite.proto.CoralSettings.serializeBinaryToWriter=function(e,t){jspb.internal.binary.writeString(t,e,1),jspb.internal.binary.writeEnum(t,e,2),jspb.internal.binary.writeBool(t,e,3),jspb.internal.binary.writeInt32(t,e,4),jspb.internal.binary.serializeBinaryExtensionsAndUnknownFields(e,t)},proto.tflite.proto.CoralSettings.deserializeBinary=function(e){return jspb.internal.binary.deserializeBinary(e,proto.tflite.proto.CoralSettings,proto.tflite.proto.CoralSettings.internalDoNotUse$proto$tflite$proto$CoralSettings$getBinaryFieldsObject)},proto.tflite.proto.CoralSettings.deserializeBinaryFromReader=function(e,t){return module$contents$jspb$internal$binary_deserializeBinaryFromReaderGeneric(e,t,proto.tflite.proto.CoralSettings.internalDoNotUse$proto$tflite$proto$CoralSettings$getBinaryFieldsObject)},proto.tflite.proto.CoralSettings.deserialize=function(e){return module$exports$jspb.Message.deserializeWithCtor(proto.tflite.proto.CoralSettings,e)},proto.tflite.proto.CoralSettings.ObjectFormat=function(){},module$contents$jspb$internal$public_for_gencode_GENERATE_FROM_OBJECT&&(proto.tflite.proto.CoralSettings.fromObject=function(e){var t=new proto.tflite.proto.CoralSettings;return null!=e.device&&t.internal_setField(1,e.device),null!=e.performance&&t.internal_setField(2,e.performance),null!=e.usbAlwaysDfu&&t.internal_setField(3,e.usbAlwaysDfu),null!=e.usbMaxBulkInQueueLength&&t.internal_setField(4,e.usbMaxBulkInQueueLength),t}),proto.tflite.proto.CoralSettings.prototype.toObject=function(e){return proto.tflite.proto.CoralSettings.internal_toObject(e,this)},proto.tflite.proto.CoralSettings.internal_toObject=function(e,t){if(null!=t){var n={device:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(1)),performance:t.internal_getFieldWithDefault(2,1),usbAlwaysDfu:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getBooleanField(3)),usbMaxBulkInQueueLength:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(4))};return e&&(n.$jspbMessageInstance=t),n}},proto.tflite.proto.CoralSettings.Performance={UNDEFINED:0,MAXIMUM:1,HIGH:2,MEDIUM:3,LOW:4},proto.tflite.proto.EdgeTpuDeviceSpec=function(e){module$contents$jspb$internal$public_for_gencode_GeneratedMessage.call(this,e,-1,proto.tflite.proto.EdgeTpuDeviceSpec.repeatedFields_)},$jscomp.inherits(proto.tflite.proto.EdgeTpuDeviceSpec,module$contents$jspb$internal$public_for_gencode_GeneratedMessage),proto.tflite.proto.EdgeTpuDeviceSpec.prototype.getPlatformType=function(){return this.internal_getFieldWithDefault(1,0)},proto.tflite.proto.EdgeTpuDeviceSpec.prototype.setPlatformType=function(e){return this.internal_setField(1,e)},proto.tflite.proto.EdgeTpuDeviceSpec.prototype.clearPlatformType=function(){return this.internal_clearField(1)},proto.tflite.proto.EdgeTpuDeviceSpec.prototype.hasPlatformType=function(){return this.internal_hasField(1)},proto.tflite.proto.EdgeTpuDeviceSpec.prototype.getNumChips=function(){return this.internal_getIntegerFieldWithDefault(2)},proto.tflite.proto.EdgeTpuDeviceSpec.prototype.setNumChips=function(e){return this.internal_setField(2,e)},proto.tflite.proto.EdgeTpuDeviceSpec.prototype.clearNumChips=function(){return this.internal_clearField(2)},proto.tflite.proto.EdgeTpuDeviceSpec.prototype.hasNumChips=function(){return this.internal_hasField(2)},proto.tflite.proto.EdgeTpuDeviceSpec.prototype.getDevicePathsList=function(){return this.internal_getRepeatedField(3)},proto.tflite.proto.EdgeTpuDeviceSpec.prototype.setDevicePathsList=function(e){return this.internal_setRepeatedField(3,e)},proto.tflite.proto.EdgeTpuDeviceSpec.prototype.addDevicePaths=function(e,t){return this.internal_addToRepeatedField(3,e,t)},proto.tflite.proto.EdgeTpuDeviceSpec.prototype.clearDevicePathsList=function(){return this.internal_clearRepeatedField(3)},proto.tflite.proto.EdgeTpuDeviceSpec.prototype.getChipFamily=function(){return this.internal_getIntegerFieldWithDefault(4)},proto.tflite.proto.EdgeTpuDeviceSpec.prototype.setChipFamily=function(e){return this.internal_setField(4,e)},proto.tflite.proto.EdgeTpuDeviceSpec.prototype.clearChipFamily=function(){return this.internal_clearField(4)},proto.tflite.proto.EdgeTpuDeviceSpec.prototype.hasChipFamily=function(){return this.internal_hasField(4)},proto.tflite.proto.EdgeTpuDeviceSpec.internalDoNotUse$proto$tflite$proto$EdgeTpuDeviceSpec$getBinaryFieldsObject=function(){return{1:jspb.internal.binary.readEnum,2:jspb.internal.binary.readInt32,3:jspb.internal.binary.readRepeatedString,4:jspb.internal.binary.readInt32}},proto.tflite.proto.EdgeTpuDeviceSpec.prototype.serializeBinary=function(){return jspb.internal.binary.serializeBinary(this,proto.tflite.proto.EdgeTpuDeviceSpec.serializeBinaryToWriter)},proto.tflite.proto.EdgeTpuDeviceSpec.serializeBinaryToWriter=function(e,t){jspb.internal.binary.writeEnum(t,e,1),jspb.internal.binary.writeInt32(t,e,2),jspb.internal.binary.writeRepeatedString(t,e,3),jspb.internal.binary.writeInt32(t,e,4),jspb.internal.binary.serializeBinaryExtensionsAndUnknownFields(e,t)},proto.tflite.proto.EdgeTpuDeviceSpec.deserializeBinary=function(e){return jspb.internal.binary.deserializeBinary(e,proto.tflite.proto.EdgeTpuDeviceSpec,proto.tflite.proto.EdgeTpuDeviceSpec.internalDoNotUse$proto$tflite$proto$EdgeTpuDeviceSpec$getBinaryFieldsObject)},proto.tflite.proto.EdgeTpuDeviceSpec.deserializeBinaryFromReader=function(e,t){return module$contents$jspb$internal$binary_deserializeBinaryFromReaderGeneric(e,t,proto.tflite.proto.EdgeTpuDeviceSpec.internalDoNotUse$proto$tflite$proto$EdgeTpuDeviceSpec$getBinaryFieldsObject)},proto.tflite.proto.EdgeTpuDeviceSpec.deserialize=function(e){return module$exports$jspb.Message.deserializeWithCtor(proto.tflite.proto.EdgeTpuDeviceSpec,e)},proto.tflite.proto.EdgeTpuDeviceSpec.repeatedFields_=[3],proto.tflite.proto.EdgeTpuDeviceSpec.ObjectFormat=function(){},module$contents$jspb$internal$public_for_gencode_GENERATE_FROM_OBJECT&&(proto.tflite.proto.EdgeTpuDeviceSpec.fromObject=function(e){var t=new proto.tflite.proto.EdgeTpuDeviceSpec;return null!=e.platformType&&t.internal_setField(1,e.platformType),null!=e.numChips&&t.internal_setField(2,e.numChips),null!=e.devicePathsList&&t.internal_setRepeatedField(3,e.devicePathsList),null!=e.chipFamily&&t.internal_setField(4,e.chipFamily),t}),proto.tflite.proto.EdgeTpuDeviceSpec.prototype.toObject=function(e){return proto.tflite.proto.EdgeTpuDeviceSpec.internal_toObject(e,this)},proto.tflite.proto.EdgeTpuDeviceSpec.internal_toObject=function(e,t){if(null!=t){var n={platformType:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(1)),numChips:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(2)),devicePathsList:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getRepeatedField(3)),chipFamily:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(4))};return e&&(n.$jspbMessageInstance=t),n}},proto.tflite.proto.EdgeTpuDeviceSpec.PlatformType={MMIO:0,REFERENCE:1,SIMULATOR:2,REMOTE_SIMULATOR:3},proto.tflite.proto.EdgeTpuInactivePowerConfig=function(e){module$contents$jspb$internal$public_for_gencode_GeneratedMessage.call(this,e)},$jscomp.inherits(proto.tflite.proto.EdgeTpuInactivePowerConfig,module$contents$jspb$internal$public_for_gencode_GeneratedMessage),proto.tflite.proto.EdgeTpuInactivePowerConfig.prototype.getInactivePowerState=function(){return this.internal_getFieldWithDefault(1,0)},proto.tflite.proto.EdgeTpuInactivePowerConfig.prototype.setInactivePowerState=function(e){return this.internal_setField(1,e)},proto.tflite.proto.EdgeTpuInactivePowerConfig.prototype.clearInactivePowerState=function(){return this.internal_clearField(1)},proto.tflite.proto.EdgeTpuInactivePowerConfig.prototype.hasInactivePowerState=function(){return this.internal_hasField(1)},proto.tflite.proto.EdgeTpuInactivePowerConfig.prototype.getInactiveTimeoutUs=function(){return this.internal_getIntegerFieldWithDefault(2)},proto.tflite.proto.EdgeTpuInactivePowerConfig.prototype.setInactiveTimeoutUs=function(e){return this.internal_setField(2,e)},proto.tflite.proto.EdgeTpuInactivePowerConfig.prototype.clearInactiveTimeoutUs=function(){return this.internal_clearField(2)},proto.tflite.proto.EdgeTpuInactivePowerConfig.prototype.hasInactiveTimeoutUs=function(){return this.internal_hasField(2)},proto.tflite.proto.EdgeTpuInactivePowerConfig.internalDoNotUse$proto$tflite$proto$EdgeTpuInactivePowerConfig$getBinaryFieldsObject=function(){return{1:jspb.internal.binary.readEnum,2:jspb.internal.binary.readInt64}},proto.tflite.proto.EdgeTpuInactivePowerConfig.prototype.serializeBinary=function(){return jspb.internal.binary.serializeBinary(this,proto.tflite.proto.EdgeTpuInactivePowerConfig.serializeBinaryToWriter)},proto.tflite.proto.EdgeTpuInactivePowerConfig.serializeBinaryToWriter=function(e,t){jspb.internal.binary.writeEnum(t,e,1),jspb.internal.binary.writeInt64(t,e,2),jspb.internal.binary.serializeBinaryExtensionsAndUnknownFields(e,t)},proto.tflite.proto.EdgeTpuInactivePowerConfig.deserializeBinary=function(e){return jspb.internal.binary.deserializeBinary(e,proto.tflite.proto.EdgeTpuInactivePowerConfig,proto.tflite.proto.EdgeTpuInactivePowerConfig.internalDoNotUse$proto$tflite$proto$EdgeTpuInactivePowerConfig$getBinaryFieldsObject)},proto.tflite.proto.EdgeTpuInactivePowerConfig.deserializeBinaryFromReader=function(e,t){return module$contents$jspb$internal$binary_deserializeBinaryFromReaderGeneric(e,t,proto.tflite.proto.EdgeTpuInactivePowerConfig.internalDoNotUse$proto$tflite$proto$EdgeTpuInactivePowerConfig$getBinaryFieldsObject)},proto.tflite.proto.EdgeTpuInactivePowerConfig.deserialize=function(e){return module$exports$jspb.Message.deserializeWithCtor(proto.tflite.proto.EdgeTpuInactivePowerConfig,e)},proto.tflite.proto.EdgeTpuInactivePowerConfig.ObjectFormat=function(){},module$contents$jspb$internal$public_for_gencode_GENERATE_FROM_OBJECT&&(proto.tflite.proto.EdgeTpuInactivePowerConfig.fromObject=function(e){var t=new proto.tflite.proto.EdgeTpuInactivePowerConfig;return null!=e.inactivePowerState&&t.internal_setField(1,e.inactivePowerState),null!=e.inactiveTimeoutUs&&t.internal_setField(2,e.inactiveTimeoutUs),t}),proto.tflite.proto.EdgeTpuInactivePowerConfig.prototype.toObject=function(e){return proto.tflite.proto.EdgeTpuInactivePowerConfig.internal_toObject(e,this)},proto.tflite.proto.EdgeTpuInactivePowerConfig.internal_toObject=function(e,t){if(null!=t){var n={inactivePowerState:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(1)),inactiveTimeoutUs:m
2odule$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(2))};return e&&(n.$jspbMessageInstance=t),n}},proto.tflite.proto.EdgeTpuSettings=function(e){module$contents$jspb$internal$public_for_gencode_GeneratedMessage.call(this,e,-1,proto.tflite.proto.EdgeTpuSettings.repeatedFields_)},$jscomp.inherits(proto.tflite.proto.EdgeTpuSettings,module$contents$jspb$internal$public_for_gencode_GeneratedMessage),proto.tflite.proto.EdgeTpuSettings.prototype.getInferencePowerState=function(){return this.internal_getFieldWithDefault(1,0)},proto.tflite.proto.EdgeTpuSettings.prototype.setInferencePowerState=function(e){return this.internal_setField(1,e)},proto.tflite.proto.EdgeTpuSettings.prototype.clearInferencePowerState=function(){return this.internal_clearField(1)},proto.tflite.proto.EdgeTpuSettings.prototype.hasInferencePowerState=function(){return this.internal_hasField(1)},proto.tflite.proto.EdgeTpuSettings.prototype.getInactivePowerConfigsList=function(){return this.internal_getRepeatedWrapperField(proto.tflite.proto.EdgeTpuInactivePowerConfig,2)},proto.tflite.proto.EdgeTpuSettings.prototype.setInactivePowerConfigsList=function(e){return this.internal_setRepeatedWrapperField(2,e)},proto.tflite.proto.EdgeTpuSettings.prototype.addInactivePowerConfigs=function(e,t){return this.internal_addToRepeatedWrapperField(2,e,proto.tflite.proto.EdgeTpuInactivePowerConfig,t)},proto.tflite.proto.EdgeTpuSettings.prototype.addAndReturnInactivePowerConfigs=function(e,t){return this.internal_addAndReturnRepeatedWrapperField(2,e,proto.tflite.proto.EdgeTpuInactivePowerConfig,t)},proto.tflite.proto.EdgeTpuSettings.prototype.clearInactivePowerConfigsList=function(){return this.internal_clearRepeatedWrapperField(2)},proto.tflite.proto.EdgeTpuSettings.prototype.getInferencePriority=function(){return this.internal_getIntegerFieldWithDefault(3,-1)},proto.tflite.proto.EdgeTpuSettings.prototype.setInferencePriority=function(e){return this.internal_setField(3,e)},proto.tflite.proto.EdgeTpuSettings.prototype.clearInferencePriority=function(){return this.internal_clearField(3)},proto.tflite.proto.EdgeTpuSettings.prototype.hasInferencePriority=function(){return this.internal_hasField(3)},proto.tflite.proto.EdgeTpuSettings.prototype.getEdgetpuDeviceSpec=function(){return this.internal_getWrapperField(proto.tflite.proto.EdgeTpuDeviceSpec,4)},proto.tflite.proto.EdgeTpuSettings.prototype.setEdgetpuDeviceSpec=function(e){return this.internal_setWrapperField(4,e)},proto.tflite.proto.EdgeTpuSettings.prototype.clearEdgetpuDeviceSpec=function(){return this.internal_clearWrapperField(4)},proto.tflite.proto.EdgeTpuSettings.prototype.hasEdgetpuDeviceSpec=function(){return this.internal_hasField(4)},proto.tflite.proto.EdgeTpuSettings.prototype.getModelToken=function(){return this.internal_getStringFieldWithDefault(5)},proto.tflite.proto.EdgeTpuSettings.prototype.setModelToken=function(e){return this.internal_setField(5,e)},proto.tflite.proto.EdgeTpuSettings.prototype.clearModelToken=function(){return this.internal_clearField(5)},proto.tflite.proto.EdgeTpuSettings.prototype.hasModelToken=function(){return this.internal_hasField(5)},proto.tflite.proto.EdgeTpuSettings.prototype.getFloatTruncationType=function(){return this.internal_getFieldWithDefault(6,0)},proto.tflite.proto.EdgeTpuSettings.prototype.setFloatTruncationType=function(e){return this.internal_setField(6,e)},proto.tflite.proto.EdgeTpuSettings.prototype.clearFloatTruncationType=function(){return this.internal_clearField(6)},proto.tflite.proto.EdgeTpuSettings.prototype.hasFloatTruncationType=function(){return this.internal_hasField(6)},proto.tflite.proto.EdgeTpuSettings.internalDoNotUse$proto$tflite$proto$EdgeTpuSettings$getBinaryFieldsObject=function(){return{1:jspb.internal.binary.readEnum,2:[jspb.internal.binary.readRepeatedMessage,proto.tflite.proto.EdgeTpuInactivePowerConfig,proto.tflite.proto.EdgeTpuInactivePowerConfig.internalDoNotUse$proto$tflite$proto$EdgeTpuInactivePowerConfig$getBinaryFieldsObject],3:jspb.internal.binary.readInt32,4:[jspb.internal.binary.readMessage,proto.tflite.proto.EdgeTpuDeviceSpec,proto.tflite.proto.EdgeTpuDeviceSpec.internalDoNotUse$proto$tflite$proto$EdgeTpuDeviceSpec$getBinaryFieldsObject],5:jspb.internal.binary.readString,6:jspb.internal.binary.readEnum}},proto.tflite.proto.EdgeTpuSettings.prototype.serializeBinary=function(){return jspb.internal.binary.serializeBinary(this,proto.tflite.proto.EdgeTpuSettings.serializeBinaryToWriter)},proto.tflite.proto.EdgeTpuSettings.serializeBinaryToWriter=function(e,t){jspb.internal.binary.writeEnum(t,e,1),jspb.internal.binary.writeRepeatedMessage(t,e,2,proto.tflite.proto.EdgeTpuInactivePowerConfig,proto.tflite.proto.EdgeTpuInactivePowerConfig.serializeBinaryToWriter),jspb.internal.binary.writeInt32(t,e,3),jspb.internal.binary.writeMessage(t,e,4,proto.tflite.proto.EdgeTpuDeviceSpec,proto.tflite.proto.EdgeTpuDeviceSpec.serializeBinaryToWriter),jspb.internal.binary.writeString(t,e,5),jspb.internal.binary.writeEnum(t,e,6),jspb.internal.binary.serializeBinaryExtensionsAndUnknownFields(e,t)},proto.tflite.proto.EdgeTpuSettings.deserializeBinary=function(e){return jspb.internal.binary.deserializeBinary(e,proto.tflite.proto.EdgeTpuSettings,proto.tflite.proto.EdgeTpuSettings.internalDoNotUse$proto$tflite$proto$EdgeTpuSettings$getBinaryFieldsObject)},proto.tflite.proto.EdgeTpuSettings.deserializeBinaryFromReader=function(e,t){return module$contents$jspb$internal$binary_deserializeBinaryFromReaderGeneric(e,t,proto.tflite.proto.EdgeTpuSettings.internalDoNotUse$proto$tflite$proto$EdgeTpuSettings$getBinaryFieldsObject)},proto.tflite.proto.EdgeTpuSettings.deserialize=function(e){return module$exports$jspb.Message.deserializeWithCtor(proto.tflite.proto.EdgeTpuSettings,e)},proto.tflite.proto.EdgeTpuSettings.repeatedFields_=[2],proto.tflite.proto.EdgeTpuSettings.ObjectFormat=function(){},module$contents$jspb$internal$public_for_gencode_GENERATE_FROM_OBJECT&&(proto.tflite.proto.EdgeTpuSettings.fromObject=function(e){var t=new proto.tflite.proto.EdgeTpuSettings;return null!=e.inferencePowerState&&t.internal_setField(1,e.inferencePowerState),e.inactivePowerConfigsList&&t.internal_setRepeatedWrapperField(2,e.inactivePowerConfigsList.map(proto.tflite.proto.EdgeTpuInactivePowerConfig.fromObject)),null!=e.inferencePriority&&t.internal_setField(3,e.inferencePriority),e.edgetpuDeviceSpec&&t.internal_setWrapperField(4,proto.tflite.proto.EdgeTpuDeviceSpec.fromObject(e.edgetpuDeviceSpec)),null!=e.modelToken&&t.internal_setField(5,e.modelToken),null!=e.floatTruncationType&&t.internal_setField(6,e.floatTruncationType),t}),proto.tflite.proto.EdgeTpuSettings.prototype.toObject=function(e){return proto.tflite.proto.EdgeTpuSettings.internal_toObject(e,this)},proto.tflite.proto.EdgeTpuSettings.internal_toObject=function(e,t){if(null!=t){var n={inferencePowerState:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(1)),inactivePowerConfigsList:module$contents$jspb$internal$public_for_gencode_toObjectList(t.getInactivePowerConfigsList(),proto.tflite.proto.EdgeTpuInactivePowerConfig.internal_toObject,e),inferencePriority:t.internal_getIntegerFieldWithDefault(3,-1),edgetpuDeviceSpec:proto.tflite.proto.EdgeTpuDeviceSpec.internal_toObject(e,t.getEdgetpuDeviceSpec()),modelToken:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(5)),floatTruncationType:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(6))};return e&&(n.$jspbMessageInstance=t),n}},proto.tflite.proto.EdgeTpuSettings.FloatTruncationType={UNSPECIFIED:0,NO_TRUNCATION:1,BFLOAT16:2,HALF:3},proto.tflite.proto.FallbackSettings=function(e){module$contents$jspb$internal$public_for_gencode_GeneratedMessage.call(this,e)},$jscomp.inherits(proto.tflite.proto.FallbackSettings,module$contents$jspb$internal$public_for_gencode_GeneratedMessage),proto.tflite.proto.FallbackSettings.prototype.getAllowAutomaticFallbackOnCompilationError=function(){return this.internal_getBooleanFieldWithDefault(7)},proto.tflite.proto.FallbackSettings.prototype.setAllowAutomaticFallbackOnCompilationError=function(e){return this.internal_setField(7,e)},proto.tflite.proto.FallbackSettings.prototype.clearAllowAutomaticFallbackOnCompilationError=function(){return this.internal_clearField(7)},proto.tflite.proto.FallbackSettings.prototype.hasAllowAutomaticFallbackOnCompilationError=function(){return this.internal_hasField(7)},proto.tflite.proto.FallbackSettings.prototype.getAllowAutomaticFallbackOnExecutionError=function(){return this.internal_getBooleanFieldWithDefault(8)},proto.tflite.proto.FallbackSettings.prototype.setAllowAutomaticFallbackOnExecutionError=function(e){return this.internal_setField(8,e)},proto.tflite.proto.FallbackSettings.prototype.clearAllowAutomaticFallbackOnExecutionError=function(){return this.internal_clearField(8)},proto.tflite.proto.FallbackSettings.prototype.hasAllowAutomaticFallbackOnExecutionError=function(){return this.internal_hasField(8)},proto.tflite.proto.FallbackSettings.internalDoNotUse$proto$tflite$proto$FallbackSettings$getBinaryFieldsObject=function(){return{7:jspb.internal.binary.readBool,8:jspb.internal.binary.readBool}},proto.tflite.proto.FallbackSettings.prototype.serializeBinary=function(){return jspb.internal.binary.serializeBinary(this,proto.tflite.proto.FallbackSettings.serializeBinaryToWriter)},proto.tflite.proto.FallbackSettings.serializeBinaryToWriter=function(e,t){jspb.internal.binary.writeBool(t,e,7),jspb.internal.binary.writeBool(t,e,8),jspb.internal.binary.serializeBinaryExtensionsAndUnknownFields(e,t)},proto.tflite.proto.FallbackSettings.deserializeBinary=function(e){return jspb.internal.binary.deserializeBinary(e,proto.tflite.proto.FallbackSettings,proto.tflite.proto.FallbackSettings.internalDoNotUse$proto$tflite$proto$FallbackSettings$getBinaryFieldsObject)},proto.tflite.proto.FallbackSettings.deserializeBinaryFromReader=function(e,t){return module$contents$jspb$internal$binary_deserializeBinaryFromReaderGeneric(e,t,proto.tflite.proto.FallbackSettings.internalDoNotUse$proto$tflite$proto$FallbackSettings$getBinaryFieldsObject)},proto.tflite.proto.FallbackSettings.deserialize=function(e){return module$exports$jspb.Message.deserializeWithCtor(proto.tflite.proto.FallbackSettings,e)},proto.tflite.proto.FallbackSettings.ObjectFormat=function(){},module$contents$jspb$internal$public_for_gencode_GENERATE_FROM_OBJECT&&(proto.tflite.proto.FallbackSettings.fromObject=function(e){var t=new proto.tflite.proto.FallbackSettings;return null!=e.allowAutomaticFallbackOnCompilationError&&t.internal_setField(7,e.allowAutomaticFallbackOnCompilationError),null!=e.allowAutomaticFallbackOnExecutionError&&t.internal_setField(8,e.allowAutomaticFallbackOnExecutionError),t}),proto.tflite.proto.FallbackSettings.prototype.toObject=function(e){return proto.tflite.proto.FallbackSettings.internal_toObject(e,this)},proto.tflite.proto.FallbackSettings.internal_toObject=function(e,t){if(null!=t){var n={allowAutomaticFallbackOnCompilationError:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getBooleanField(7)),allowAutomaticFallbackOnExecutionError:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getBooleanField(8))};return e&&(n.$jspbMessageInstance=t),n}},proto.tflite.proto.GPUSettings=function(e){module$contents$jspb$internal$public_for_gencode_GeneratedMessage.call(this,e)},$jscomp.inherits(proto.tflite.proto.GPUSettings,module$contents$jspb$internal$public_for_gencode_GeneratedMessage),proto.tflite.proto.GPUSettings.prototype.getIsPrecisionLossAllowed=function(){return this.internal_getBooleanFieldWithDefault(1)},proto.tflite.proto.GPUSettings.prototype.setIsPrecisionLossAllowed=function(e){return this.internal_setField(1,e)},proto.tflite.proto.GPUSettings.prototype.clearIsPrecisionLossAllowed=function(){return this.internal_clearField(1)},proto.tflite.proto.GPUSettings.prototype.hasIsPrecisionLossAllowed=function(){return this.internal_hasField(1)},proto.tflite.proto.GPUSettings.prototype.getEnableQuantizedInference=function(){return this.internal_getBooleanFieldWithDefault(2,!0)},proto.tflite.proto.GPUSettings.prototype.setEnableQuantizedInference=function(e){return this.internal_setField(2,e)},proto.tflite.proto.GPUSettings.prototype.clearEnableQuantizedInference=function(){return this.internal_clearField(2)},proto.tflite.proto.GPUSettings.prototype.hasEnableQuantizedInference=function(){return this.internal_hasField(2)},proto.tflite.proto.GPUSettings.prototype.getForceBackend=function(){return this.internal_getFieldWithDefault(3,0)},proto.tflite.proto.GPUSettings.prototype.setForceBackend=function(e){return this.internal_setField(3,e)},proto.tflite.proto.GPUSettings.prototype.clearForceBackend=function(){return this.internal_clearField(3)},proto.tflite.proto.GPUSettings.prototype.hasForceBackend=function(){return this.internal_hasField(3)},proto.tflite.proto.GPUSettings.prototype.getInferencePriority1=function(){return this.internal_getFieldWithDefault(4,0)},proto.tflite.proto.GPUSettings.prototype.setInferencePriority1=function(e){return this.internal_setField(4,e)},proto.tflite.proto.GPUSettings.prototype.clearInferencePriority1=function(){return this.internal_clearField(4)},proto.tflite.proto.GPUSettings.prototype.hasInferencePriority1=function(){return this.internal_hasField(4)},proto.tflite.proto.GPUSettings.prototype.getInferencePriority2=function(){return this.internal_getFieldWithDefault(5,0)},proto.tflite.proto.GPUSettings.prototype.setInferencePriority2=function(e){return this.internal_setField(5,e)},proto.tflite.proto.GPUSettings.prototype.clearInferencePriority2=function(){return this.internal_clearField(5)},proto.tflite.proto.GPUSettings.prototype.hasInferencePriority2=function(){return this.internal_hasField(5)},proto.tflite.proto.GPUSettings.prototype.getInferencePriority3=function(){return this.internal_getFieldWithDefault(6,0)},proto.tflite.proto.GPUSettings.prototype.setInferencePriority3=function(e){return this.internal_setField(6,e)},proto.tflite.proto.GPUSettings.prototype.clearInferencePriority3=function(){return this.internal_clearField(6)},proto.tflite.proto.GPUSettings.prototype.hasInferencePriority3=function(){return this.internal_hasField(6)},proto.tflite.proto.GPUSettings.prototype.getInferencePreference=function(){return this.internal_getFieldWithDefault(7,0
2)},proto.tflite.proto.GPUSettings.prototype.setInferencePreference=function(e){return this.internal_setField(7,e)},proto.tflite.proto.GPUSettings.prototype.clearInferencePreference=function(){return this.internal_clearField(7)},proto.tflite.proto.GPUSettings.prototype.hasInferencePreference=function(){return this.internal_hasField(7)},proto.tflite.proto.GPUSettings.prototype.getCacheDirectory=function(){return this.internal_getStringFieldWithDefault(8)},proto.tflite.proto.GPUSettings.prototype.setCacheDirectory=function(e){return this.internal_setField(8,e)},proto.tflite.proto.GPUSettings.prototype.clearCacheDirectory=function(){return this.internal_clearField(8)},proto.tflite.proto.GPUSettings.prototype.hasCacheDirectory=function(){return this.internal_hasField(8)},proto.tflite.proto.GPUSettings.prototype.getModelToken=function(){return this.internal_getStringFieldWithDefault(9)},proto.tflite.proto.GPUSettings.prototype.setModelToken=function(e){return this.internal_setField(9,e)},proto.tflite.proto.GPUSettings.prototype.clearModelToken=function(){return this.internal_clearField(9)},proto.tflite.proto.GPUSettings.prototype.hasModelToken=function(){return this.internal_hasField(9)},proto.tflite.proto.GPUSettings.internalDoNotUse$proto$tflite$proto$GPUSettings$getBinaryFieldsObject=function(){return{1:jspb.internal.binary.readBool,2:jspb.internal.binary.readBool,3:jspb.internal.binary.readEnum,4:jspb.internal.binary.readEnum,5:jspb.internal.binary.readEnum,6:jspb.internal.binary.readEnum,7:jspb.internal.binary.readEnum,8:jspb.internal.binary.readString,9:jspb.internal.binary.readString}},proto.tflite.proto.GPUSettings.prototype.serializeBinary=function(){return jspb.internal.binary.serializeBinary(this,proto.tflite.proto.GPUSettings.serializeBinaryToWriter)},proto.tflite.proto.GPUSettings.serializeBinaryToWriter=function(e,t){jspb.internal.binary.writeBool(t,e,1),jspb.internal.binary.writeBool(t,e,2),jspb.internal.binary.writeEnum(t,e,3),jspb.internal.binary.writeEnum(t,e,4),jspb.internal.binary.writeEnum(t,e,5),jspb.internal.binary.writeEnum(t,e,6),jspb.internal.binary.writeEnum(t,e,7),jspb.internal.binary.writeString(t,e,8),jspb.internal.binary.writeString(t,e,9),jspb.internal.binary.serializeBinaryExtensionsAndUnknownFields(e,t)},proto.tflite.proto.GPUSettings.deserializeBinary=function(e){return jspb.internal.binary.deserializeBinary(e,proto.tflite.proto.GPUSettings,proto.tflite.proto.GPUSettings.internalDoNotUse$proto$tflite$proto$GPUSettings$getBinaryFieldsObject)},proto.tflite.proto.GPUSettings.deserializeBinaryFromReader=function(e,t){return module$contents$jspb$internal$binary_deserializeBinaryFromReaderGeneric(e,t,proto.tflite.proto.GPUSettings.internalDoNotUse$proto$tflite$proto$GPUSettings$getBinaryFieldsObject)},proto.tflite.proto.GPUSettings.deserialize=function(e){return module$exports$jspb.Message.deserializeWithCtor(proto.tflite.proto.GPUSettings,e)},proto.tflite.proto.GPUSettings.ObjectFormat=function(){},module$contents$jspb$internal$public_for_gencode_GENERATE_FROM_OBJECT&&(proto.tflite.proto.GPUSettings.fromObject=function(e){var t=new proto.tflite.proto.GPUSettings;return null!=e.isPrecisionLossAllowed&&t.internal_setField(1,e.isPrecisionLossAllowed),null!=e.enableQuantizedInference&&t.internal_setField(2,e.enableQuantizedInference),null!=e.forceBackend&&t.internal_setField(3,e.forceBackend),null!=e.inferencePriority1&&t.internal_setField(4,e.inferencePriority1),null!=e.inferencePriority2&&t.internal_setField(5,e.inferencePriority2),null!=e.inferencePriority3&&t.internal_setField(6,e.inferencePriority3),null!=e.inferencePreference&&t.internal_setField(7,e.inferencePreference),null!=e.cacheDirectory&&t.internal_setField(8,e.cacheDirectory),null!=e.modelToken&&t.internal_setField(9,e.modelToken),t}),proto.tflite.proto.GPUSettings.prototype.toObject=function(e){return proto.tflite.proto.GPUSettings.internal_toObject(e,this)},proto.tflite.proto.GPUSettings.internal_toObject=function(e,t){if(null!=t){var n={isPrecisionLossAllowed:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getBooleanField(1)),enableQuantizedInference:t.internal_getBooleanFieldWithDefault(2,!0),forceBackend:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(3)),inferencePriority1:t.internal_getFieldWithDefault(4,0),inferencePriority2:t.internal_getFieldWithDefault(5,0),inferencePriority3:t.internal_getFieldWithDefault(6,0),inferencePreference:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(7)),cacheDirectory:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(8)),modelToken:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(9))};return e&&(n.$jspbMessageInstance=t),n}},proto.tflite.proto.HexagonSettings=function(e){module$contents$jspb$internal$public_for_gencode_GeneratedMessage.call(this,e)},$jscomp.inherits(proto.tflite.proto.HexagonSettings,module$contents$jspb$internal$public_for_gencode_GeneratedMessage),proto.tflite.proto.HexagonSettings.prototype.getDebugLevel=function(){return this.internal_getIntegerFieldWithDefault(1)},proto.tflite.proto.HexagonSettings.prototype.setDebugLevel=function(e){return this.internal_setField(1,e)},proto.tflite.proto.HexagonSettings.prototype.clearDebugLevel=function(){return this.internal_clearField(1)},proto.tflite.proto.HexagonSettings.prototype.hasDebugLevel=function(){return this.internal_hasField(1)},proto.tflite.proto.HexagonSettings.prototype.getPowersaveLevel=function(){return this.internal_getIntegerFieldWithDefault(2)},proto.tflite.proto.HexagonSettings.prototype.setPowersaveLevel=function(e){return this.internal_setField(2,e)},proto.tflite.proto.HexagonSettings.prototype.clearPowersaveLevel=function(){return this.internal_clearField(2)},proto.tflite.proto.HexagonSettings.prototype.hasPowersaveLevel=function(){return this.internal_hasField(2)},proto.tflite.proto.HexagonSettings.prototype.getPrintGraphProfile=function(){return this.internal_getBooleanFieldWithDefault(3)},proto.tflite.proto.HexagonSettings.prototype.setPrintGraphProfile=function(e){return this.internal_setField(3,e)},proto.tflite.proto.HexagonSettings.prototype.clearPrintGraphProfile=function(){return this.internal_clearField(3)},proto.tflite.proto.HexagonSettings.prototype.hasPrintGraphProfile=function(){return this.internal_hasField(3)},proto.tflite.proto.HexagonSettings.prototype.getPrintGraphDebug=function(){return this.internal_getBooleanFieldWithDefault(4)},proto.tflite.proto.HexagonSettings.prototype.setPrintGraphDebug=function(e){return this.internal_setField(4,e)},proto.tflite.proto.HexagonSettings.prototype.clearPrintGraphDebug=function(){return this.internal_clearField(4)},proto.tflite.proto.HexagonSettings.prototype.hasPrintGraphDebug=function(){return this.internal_hasField(4)},proto.tflite.proto.HexagonSettings.internalDoNotUse$proto$tflite$proto$HexagonSettings$getBinaryFieldsObject=function(){return{1:jspb.internal.binary.readInt32,2:jspb.internal.binary.readInt32,3:jspb.internal.binary.readBool,4:jspb.internal.binary.readBool}},proto.tflite.proto.HexagonSettings.prototype.serializeBinary=function(){return jspb.internal.binary.serializeBinary(this,proto.tflite.proto.HexagonSettings.serializeBinaryToWriter)},proto.tflite.proto.HexagonSettings.serializeBinaryToWriter=function(e,t){jspb.internal.binary.writeInt32(t,e,1),jspb.internal.binary.writeInt32(t,e,2),jspb.internal.binary.writeBool(t,e,3),jspb.internal.binary.writeBool(t,e,4),jspb.internal.binary.serializeBinaryExtensionsAndUnknownFields(e,t)},proto.tflite.proto.HexagonSettings.deserializeBinary=function(e){return jspb.internal.binary.deserializeBinary(e,proto.tflite.proto.HexagonSettings,proto.tflite.proto.HexagonSettings.internalDoNotUse$proto$tflite$proto$HexagonSettings$getBinaryFieldsObject)},proto.tflite.proto.HexagonSettings.deserializeBinaryFromReader=function(e,t){return module$contents$jspb$internal$binary_deserializeBinaryFromReaderGeneric(e,t,proto.tflite.proto.HexagonSettings.internalDoNotUse$proto$tflite$proto$HexagonSettings$getBinaryFieldsObject)},proto.tflite.proto.HexagonSettings.deserialize=function(e){return module$exports$jspb.Message.deserializeWithCtor(proto.tflite.proto.HexagonSettings,e)},proto.tflite.proto.HexagonSettings.ObjectFormat=function(){},module$contents$jspb$internal$public_for_gencode_GENERATE_FROM_OBJECT&&(proto.tflite.proto.HexagonSettings.fromObject=function(e){var t=new proto.tflite.proto.HexagonSettings;return null!=e.debugLevel&&t.internal_setField(1,e.debugLevel),null!=e.powersaveLevel&&t.internal_setField(2,e.powersaveLevel),null!=e.printGraphProfile&&t.internal_setField(3,e.printGraphProfile),null!=e.printGraphDebug&&t.internal_setField(4,e.printGraphDebug),t}),proto.tflite.proto.HexagonSettings.prototype.toObject=function(e){return proto.tflite.proto.HexagonSettings.internal_toObject(e,this)},proto.tflite.proto.HexagonSettings.internal_toObject=function(e,t){if(null!=t){var n={debugLevel:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(1)),powersaveLevel:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(2)),printGraphProfile:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getBooleanField(3)),printGraphDebug:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getBooleanField(4))};return e&&(n.$jspbMessageInstance=t),n}},proto.tflite.proto.NNAPISettings=function(e){module$contents$jspb$internal$public_for_gencode_GeneratedMessage.call(this,e)},$jscomp.inherits(proto.tflite.proto.NNAPISettings,module$contents$jspb$internal$public_for_gencode_GeneratedMessage),proto.tflite.proto.NNAPISettings.prototype.getAcceleratorName=function(){return this.internal_getStringFieldWithDefault(1)},proto.tflite.proto.NNAPISettings.prototype.setAcceleratorName=function(e){return this.internal_setField(1,e)},proto.tflite.proto.NNAPISettings.prototype.clearAcceleratorName=function(){return this.internal_clearField(1)},proto.tflite.proto.NNAPISettings.prototype.hasAcceleratorName=function(){return this.internal_hasField(1)},proto.tflite.proto.NNAPISettings.prototype.getCacheDirectory=function(){return this.internal_getStringFieldWithDefault(2)},proto.tflite.proto.NNAPISettings.prototype.setCacheDirectory=function(e){return this.internal_setField(2,e)},proto.tflite.proto.NNAPISettings.prototype.clearCacheDirectory=function(){return this.internal_clearField(2)},proto.tflite.proto.NNAPISettings.prototype.hasCacheDirectory=function(){return this.internal_hasField(2)},proto.tflite.proto.NNAPISettings.prototype.getModelToken=function(){return this.internal_getStringFieldWithDefault(3)},proto.tflite.proto.NNAPISettings.prototype.setModelToken=function(e){return this.internal_setField(3,e)},proto.tflite.proto.NNAPISettings.prototype.clearModelToken=function(){return this.internal_clearField(3)},proto.tflite.proto.NNAPISettings.prototype.hasModelToken=function(){return this.internal_hasField(3)},proto.tflite.proto.NNAPISettings.prototype.getExecutionPreference=function(){return this.internal_getFieldWithDefault(4,0)},proto.tflite.proto.NNAPISettings.prototype.setExecutionPreference=function(e){return this.internal_setField(4,e)},proto.tflite.proto.NNAPISettings.prototype.clearExecutionPreference=function(){return this.internal_clearField(4)},proto.tflite.proto.NNAPISettings.prototype.hasExecutionPreference=function(){return this.internal_hasField(4)},proto.tflite.proto.NNAPISettings.prototype.getNoOfNnapiInstancesToCache=function(){return this.internal_getIntegerFieldWithDefault(5)}
2,proto.tflite.proto.NNAPISettings.prototype.setNoOfNnapiInstancesToCache=function(e){return this.internal_setField(5,e)},proto.tflite.proto.NNAPISettings.prototype.clearNoOfNnapiInstancesToCache=function(){return this.internal_clearField(5)},proto.tflite.proto.NNAPISettings.prototype.hasNoOfNnapiInstancesToCache=function(){return this.internal_hasField(5)},proto.tflite.proto.NNAPISettings.prototype.getFallbackSettings=function(){return this.internal_getWrapperField(proto.tflite.proto.FallbackSettings,6)},proto.tflite.proto.NNAPISettings.prototype.setFallbackSettings=function(e){return this.internal_setWrapperField(6,e)},proto.tflite.proto.NNAPISettings.prototype.clearFallbackSettings=function(){return this.internal_clearWrapperField(6)},proto.tflite.proto.NNAPISettings.prototype.hasFallbackSettings=function(){return this.internal_hasField(6)},proto.tflite.proto.NNAPISettings.prototype.getAllowNnapiCpuOnAndroid10Plus=function(){return this.internal_getBooleanFieldWithDefault(7)},proto.tflite.proto.NNAPISettings.prototype.setAllowNnapiCpuOnAndroid10Plus=function(e){return this.internal_setField(7,e)},proto.tflite.proto.NNAPISettings.prototype.clearAllowNnapiCpuOnAndroid10Plus=function(){return this.internal_clearField(7)},proto.tflite.proto.NNAPISettings.prototype.hasAllowNnapiCpuOnAndroid10Plus=function(){return this.internal_hasField(7)},proto.tflite.proto.NNAPISettings.prototype.getExecutionPriority=function(){return this.internal_getFieldWithDefault(8,0)},proto.tflite.proto.NNAPISettings.prototype.setExecutionPriority=function(e){return this.internal_setField(8,e)},proto.tflite.proto.NNAPISettings.prototype.clearExecutionPriority=function(){return this.internal_clearField(8)},proto.tflite.proto.NNAPISettings.prototype.hasExecutionPriority=function(){return this.internal_hasField(8)},proto.tflite.proto.NNAPISettings.prototype.getAllowDynamicDimensions=function(){return this.internal_getBooleanFieldWithDefault(9)},proto.tflite.proto.NNAPISettings.prototype.setAllowDynamicDimensions=function(e){return this.internal_setField(9,e)},proto.tflite.proto.NNAPISettings.prototype.clearAllowDynamicDimensions=function(){return this.internal_clearField(9)},proto.tflite.proto.NNAPISettings.prototype.hasAllowDynamicDimensions=function(){return this.internal_hasField(9)},proto.tflite.proto.NNAPISettings.prototype.getAllowFp16PrecisionForFp32=function(){return this.internal_getBooleanFieldWithDefault(10)},proto.tflite.proto.NNAPISettings.prototype.setAllowFp16PrecisionForFp32=function(e){return this.internal_setField(10,e)},proto.tflite.proto.NNAPISettings.prototype.clearAllowFp16PrecisionForFp32=function(){return this.internal_clearField(10)},proto.tflite.proto.NNAPISettings.prototype.hasAllowFp16PrecisionForFp32=function(){return this.internal_hasField(10)},proto.tflite.proto.NNAPISettings.prototype.getUseBurstComputation=function(){return this.internal_getBooleanFieldWithDefault(11)},proto.tflite.proto.NNAPISettings.prototype.setUseBurstComputation=function(e){return this.internal_setField(11,e)},proto.tflite.proto.NNAPISettings.prototype.clearUseBurstComputation=function(){return this.internal_clearField(11)},proto.tflite.proto.NNAPISettings.prototype.hasUseBurstComputation=function(){return this.internal_hasField(11)},proto.tflite.proto.NNAPISettings.prototype.getSupportLibraryHandle=function(){return this.internal_getIntegerFieldWithDefault(12)},proto.tflite.proto.NNAPISettings.prototype.setSupportLibraryHandle=function(e){return this.internal_setField(12,e)},proto.tflite.proto.NNAPISettings.prototype.clearSupportLibraryHandle=function(){return this.internal_clearField(12)},proto.tflite.proto.NNAPISettings.prototype.hasSupportLibraryHandle=function(){return this.internal_hasField(12)},proto.tflite.proto.NNAPISettings.internalDoNotUse$proto$tflite$proto$NNAPISettings$getBinaryFieldsObject=function(){return{1:jspb.internal.binary.readString,2:jspb.internal.binary.readString,3:jspb.internal.binary.readString,4:jspb.internal.binary.readEnum,5:jspb.internal.binary.readInt32,6:[jspb.internal.binary.readMessage,proto.tflite.proto.FallbackSettings,proto.tflite.proto.FallbackSettings.internalDoNotUse$proto$tflite$proto$FallbackSettings$getBinaryFieldsObject],7:js
2pb.internal.binary.readBool,8:jspb.internal.binary.readEnum,9:jspb.internal.binary.readBool,10:jspb.internal.binary.readBool,11:jspb.internal.binary.readBool,12:jspb.internal.binary.readInt64}},proto.tflite.proto.NNAPISettings.prototype.serializeBinary=function(){return jspb.internal.binary.serializeBinary(this,proto.tflite.proto.NNAPISettings.serializeBinaryToWriter)},proto.tflite.proto.NNAPISettings.serializeBinaryToWriter=function(e,t){jspb.internal.binary.writeString(t,e,1),jspb.internal.binary.writeString(t,e,2),jspb.internal.binary.writeString(t,e,3),jspb.internal.binary.writeEnum(t,e,4),jspb.internal.binary.writeInt32(t,e,5),jspb.internal.binary.writeMessage(t,e,6,proto.tflite.proto.FallbackSettings,proto.tflite.proto.FallbackSettings.serializeBinaryToWriter),jspb.internal.binary.writeBool(t,e,7),jspb.internal.binary.writeEnum(t,e,8),jspb.internal.binary.writeBool(t,e,9),jspb.internal.binary.writeBool(t,e,10),jspb.internal.binary.writeBool(t,e,11),jspb.internal.binary.writeInt64(t,e,12),jspb.internal.binary.serializeBinaryExtensionsAndUnknownFields(e,t)},proto.tflite.proto.NNAPISettings.deserializeBinary=function(e){return jspb.internal.binary.deserializeBinary(e,proto.tflite.proto.NNAPISettings,proto.tflite.proto.NNAPISettings.internalDoNotUse$proto$tflite$proto$NNAPISettings$getBinaryFieldsObject)},proto.tflite.proto.NNAPISettings.deserializeBinaryFromReader=function(e,t){return module$contents$jspb$internal$binary_deserializeBinaryFromReaderGeneric(e,t,proto.tflite.proto.NNAPISettings.internalDoNotUse$proto$tflite$proto$NNAPISettings$getBinaryFieldsObject)},proto.tflite.proto.NNAPISettings.deserialize=function(e){return module$exports$jspb.Message.deserializeWithCtor(proto.tflite.proto.NNAPISettings,e)},proto.tflite.proto.NNAPISettings.ObjectFormat=function(){},module$contents$jspb$internal$public_for_gencode_GENERATE_FROM_OBJECT&&(proto.tflite.proto.NNAPISettings.fromObject=function(e){var t=new proto.tflite.proto.NNAPISettings;return null!=e.acceleratorName&&t.internal_setField(1,e.acceleratorName),null!=e.cacheDirectory&&t.internal_setField(2,e.cacheDirectory),null!=e.modelToken&&t.internal_setField(3,e.modelToken),null!=e.executionPreference&&t.internal_setField(4,e.executionPreference),null!=e.noOfNnapiInstancesToCache&&t.internal_setField(5,e.noOfNnapiInstancesToCache),e.fallbackSettings&&t.internal_setWrapperField(6,proto.tflite.proto.FallbackSettings.fromObject(e.fallbackSettings)),null!=e.allowNnapiCpuOnAndroid10Plus&&t.internal_setField(7,e.allowNnapiCpuOnAndroid10Plus),null!=e.executionPriority&&t.internal_setField(8,e.executionPriority),null!=e.allowDynamicDimensions&&t.internal_setField(9,e.allowDynamicDimensions),null!=e.allowFp16PrecisionForFp32&&t.internal_setField(10,e.allowFp16PrecisionForFp32),null!=e.useBurstComputation&&t.internal_setField(11,e.useBurstComputation),null!=e.supportLibraryHandle&&t.internal_setField(12,e.supportLibraryHandle),t}),proto.tflite.proto.NNAPISettings.prototype.toObject=function(e){return proto.tflite.proto.NNAPISettings.internal_toObject(e,this)},proto.tflite.proto.NNAPISettings.internal_toObject=function(e,t){if(null!=t){var n={acceleratorName:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(1)),cacheDirectory:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(2)),modelToken:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(3)),executionPreference:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(4)),noOfNnapiInstancesToCache:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(5)),fallbackSettings:proto.tflite.proto.FallbackSettings.internal_toObject(e,t.getFallbackSettings()),allowNnapiCpuOnAndroid10Plus:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getBooleanField(7)),executionPriority:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(8)),allowDynamicDimensions:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getBooleanField(9)),allowFp16PrecisionForFp32:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getBooleanField(10)),useBurstComputation:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getBooleanField(11)),supportLibraryHandle:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(12))};return e&&(n.$jspbMessageInstance=t),n}},proto.tflite.proto.XNNPackSettings=function(e){module$contents$jspb$internal$public_for_gencode_GeneratedMessage.call(this,e)},$jscomp.inherits(proto.tflite.proto.XNNPackSettings,module$contents$jspb$internal$public_for_gencode_GeneratedMessage),proto.tflite.proto.XNNPackSettings.prototype.getNumThreads=function(){return this.internal_getIntegerFieldWithDefault(1)},proto.tflite.proto.XNNPackSettings.prototype.setNumThreads=function(e){return this.internal_setField(1,e)},proto.tflite.proto.XNNPackSettings.prototype.clearNumThreads=function(){return this.internal_clearField(1)},proto.tflite.proto.XNNPackSettings.prototype.hasNumThreads=function(){return this.internal_hasField(1)},proto.tflite.proto.XNNPackSettings.internalDoNotUse$proto$tflite$proto$XNNPackSettings$getBinaryFieldsObject=function(){return{1:jspb.internal.binary.readInt32}},proto.tflite.proto.XNNPackSettings.prototype.serializeBinary=function(){return jspb.internal.binary.serializeBinary(this,proto.tflite.proto.XNNPackSettings.serializeBinaryToWriter)},proto.tflite.proto.XNNPackSettings.serializeBinaryToWriter=function(e,t){jspb.internal.binary.writeInt32(t,e,1),jspb.internal.binary.serializeBinaryExtensionsAndUnknownFields(e,t)},proto.tflite.proto.XNNPackSettings.deserializeBinary=function(e){return jspb.internal.binary.deserializeBinary(e,proto.tflite.proto.XNNPackSettings,proto.tflite.proto.XNNPackSettings.internalDoNotUse$proto$tflite$proto$XNNPackSettings$getBinaryFieldsObject)},proto.tflite.proto.XNNPackSettings.deserializeBinaryFromReader=function(e,t){return module$contents$jspb$internal$binary_deserializeBinaryFromReaderGeneric(e,t,proto.tflite.proto.XNNPackSettings.internalDoNotUse$proto$tflite$proto$XNNPackSettings$getBinaryFieldsObject)},proto.tflite.proto.XNNPackSettings.deserialize=function(e){return module$exports$jspb.Message.deserializeWithCtor(proto.tflite.proto.XNNPackSettings,e)},proto.tflite.proto.XNNPackSettings.ObjectFormat=function(){},module$contents$jspb$internal$public_for_gencode_GENERATE_FROM_OBJECT&&(proto.tflite.proto.XNNPackSettings.fromObject=function(e){var t=new proto.tflite.proto.XNNPackSettings;return null!=e.numThreads&&t.internal_setField(1,e.numThreads),t}),proto.tflite.proto.XNNPackSettings.prototype.toObject=function(e){return proto.tflite.proto.XNNPackSettings.internal_toObject(e,this)},proto.tflite.proto.XNNPackSettings.internal_toObject=function(e,t){if(null!=t){var n={numThreads:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(1))};return e&&(n.$jspbMessageInstance=t),n}},proto.tflite.proto.TFLiteSettings=function(e){module$contents$jspb$internal$public_for_gencode_GeneratedMessage.call(this,e)},$jscomp.inherits(proto.tflite.proto.TFLiteSettings,module$contents$jspb$internal$public_for_gencode_GeneratedMessage),proto.tflite.proto.TFLiteSettings.prototype.getDelegate=function(){return this.internal_getFieldWithDefault(1,0)},proto.tflite.proto.TFLiteSettings.prototype.setDelegate=function(e){return this.internal_setField(1,e)},proto.tflite.proto.TFLiteSettings.prototype.clearDelegate=function(){return this.internal_clearField(1)},proto.tflite.proto.TFLiteSettings.prototype.hasDelegate=function(){return this.internal_hasField(1)},proto.tflite.proto.TFLiteSettings.prototype.getNnapiSettings=function(){return this.internal_getWrapperField(proto.tflite.proto.NNAPISettings,2)},proto.tflite.proto.TFLiteSettings.prototype.setNnapiSettings=function(e){return this.internal_setWrapperField(2,e)},proto.tflite.proto.TFLiteSettings.prototype.clearNnapiSettings=function(){return this.internal_clearWrapperField(2)},proto.tflite.proto.TFLiteSettings.prototype.hasNnapiSettings=function(){return this.internal_hasField(2)},proto.tflite.proto.TFLiteSettings.prototype.getGpuSettings=function(){return this.internal_getWrapperField(proto.tflite.proto.GPUSettings,3)},proto.tflite.proto.TFLiteSettings.prototype.setGpuSettings=function(e){return this.internal_setWrapperField(3,e)},proto.tflite.proto.TFLiteSettings.prototype.clearGpuSettings=function(){return this.internal_clearWrapperField(3)},proto.tflite.proto.TFLiteSettings.prototype.hasGpuSettings=function(){return this.internal_hasField(3)},proto.tflite.proto.TFLiteSettings.prototype.getHexagonSettings=function(){return this.internal_getWrapperField(proto.tflite.proto.HexagonSettings,4)},proto.tflite.proto.TFLiteSettings.prototype.setHexagonSettings=function(e){return this.internal_setWrapperField(4,e)},proto.tflite.proto.TFLiteSettings.prototype.clearHexagonSettings=function(){return this.internal_clearWrapperField(4)},proto.tflite.proto.TFLiteSettings.prototype.hasHexagonSettings=function(){return this.internal_hasField(4)},proto.tflite.proto.TFLiteSettings.prototype.getXnnpackSettings=function(){return this.internal_getWrapperField(proto.tflite.proto.XNNPackSettings,5)},proto.tflite.proto.TFLiteSettings.prototype.setXnnpackSettings=function(e){return this.internal_setWrapperField(5,e)},proto.tflite.proto.TFLiteSettings.prototype.clearXnnpackSettings=function(){return this.internal_clearWrapperField(5)},proto.tflite.proto.TFLiteSettings.prototype.hasXnnpackSettings=function(){return this.internal_hasField(5)},proto.tflite.proto.TFLiteSettings.prototype.getCpuSettings=function(){return this.internal_getWrapperField(proto.tflite.proto.CPUSettings,6)},proto.tflite.proto.TFLiteSettings.prototype.setCpuSettings=function(e){return this.internal_setWrapperField(6,e)},proto.tflite.proto.TFLiteSettings.prototype.clearCpuSettings=function(){return this.internal_clearWrapperField(6)}
2,proto.tflite.proto.TFLiteSettings.prototype.hasCpuSettings=function(){return this.internal_hasField(6)},proto.tflite.proto.TFLiteSettings.prototype.getMaxDelegatedPartitions=function(){return this.internal_getIntegerFieldWithDefault(7)},proto.tflite.proto.TFLiteSettings.prototype.setMaxDelegatedPartitions=function(e){return this.internal_setField(7,e)},proto.tflite.proto.TFLiteSettings.prototype.clearMaxDelegatedPartitions=function(){return this.internal_clearField(7)},proto.tflite.proto.TFLiteSettings.prototype.hasMaxDelegatedPartitions=function(){return this.internal_hasField(7)},proto.tflite.proto.TFLiteSettings.prototype.getEdgetpuSettings=function(){return this.internal_getWrapperField(proto.tflite.proto.EdgeTpuSettings,8)},proto.tflite.proto.TFLiteSettings.prototype.setEdgetpuSettings=function(e){return this.internal_setWrapperField(8,e)},proto.tflite.proto.TFLiteSettings.prototype.clearEdgetpuSettings=function(){return this.internal_clearWrapperField(8)},proto.tflite.proto.TFLiteSettings.prototype.hasEdgetpuSettings=function(){return this.internal_hasField(8)},proto.tflite.proto.TFLiteSettings.prototype.getCoralSettings=function(){return this.internal_getWrapperField(proto.tflite.proto.CoralSettings,10)},proto.tflite.proto.TFLiteSettings.prototype.setCoralSettings=function(e){return this.internal_setWrapperField(10,e)},proto.tflite.proto.TFLiteSettings.prototype.clearCoralSettings=function(){return this.internal_clearWrapperField(10)},proto.tflite.proto.TFLiteSettings.prototype.hasCoralSettings=function(){return this.internal_hasField(10)},proto.tflite.proto.TFLiteSettings.prototype.getFallbackSettings=function(){return this.internal_getWrapperField(proto.tflite.proto.FallbackSettings,9)},proto.tflite.proto.TFLiteSettings.prototype.setFallbackSettings=function(e){return this.internal_setWrapperField(9,e)},proto.tflite.proto.TFLiteSettings.prototype.clearFallbackSettings=function(){return this.internal_clearWrapperField(9)},proto.tflite.proto.TFLiteSettings.prototype.hasFallbackSettings=function(){return this.internal_hasField(9)},proto.tflite.proto.TFLiteSettings.internalDoNotUse$proto$tflite$proto$TFLiteSettings$getBinaryFieldsObject=function(){return{1:jspb.internal.binary.readEnum,2:[jspb.internal.binary.readMessage,proto.tflite.proto.NNAPISettings,proto.tflite.proto.NNAPISettings.internalDoNotUse$proto$tflite$proto$NNAPISettings$getBinaryFieldsObject],3:[jspb.internal.binary.readMessage,proto.tflite.proto.GPUSettings,proto.tflite.proto.GPUSettings.internalDoNotUse$proto$tflite$proto$GPUSettings$getBinaryFieldsObject],4:[jspb.internal.binary.readMessage,proto.tflite.proto.HexagonSettings,proto.tflite.proto.HexagonSettings.internalDoNotUse$proto$tflite$proto$HexagonSettings$getBinaryFieldsObject],5:[jspb.internal.binary.readMessage,proto.tflite.proto.XNNPackSettings,proto.tflite.proto.XNNPackSettings.internalDoNotUse$proto$tflite$proto$XNNPackSettings$getBinaryFieldsObject],6:[jspb.internal.binary.readMessage,proto.tflite.proto.CPUSettings,proto.tflite.proto.CPUSettings.internalDoNotUse$proto$tflite$proto$CPUSettings$getBinaryFieldsObject],7:jspb.internal.binary.readInt32,8:[jspb.internal.binary.readMessage,proto.tflite.proto.EdgeTpuSettings,proto.tflite.proto.EdgeTpuSettings.internalDoNotUse$proto$tflite$proto$EdgeTpuSettings$getBinaryFieldsObject],10:[jspb.internal.binary.readMessage,proto.tflite.proto.CoralSettings,proto.tflite.proto.CoralSettings.internalDoNotUse$proto$tflite$proto$CoralSettings$getBinaryFieldsObject],9:[jspb.internal.binary.readMessage,proto.tflite.proto.FallbackSettings,proto.tflite.proto.FallbackSettings.internalDoNotUse$proto$tflite$proto$FallbackSettings$getBinaryFieldsObject]}},proto.tflite.proto.TFLiteSettings.prototype.serializeBinary=function(){return jspb.internal.binary.serializeBinary(this,proto.tflite.proto.TFLiteSettings.serializeBinaryToWriter)},proto.tflite.proto.TFLiteSettings.serializeBinaryToWriter=function(e,t){jspb.internal.binary.writeEnum(t,e,1),jspb.internal.binary.writeMessage(t,e,2,proto.tflite.proto.NNAPISettings,proto.tflite.proto.NNAPISettings.serializeBinaryToWriter),jspb.internal.binary.writeMessage(t,e,3,proto.tflite.proto.GPUSettings,proto.tflite.proto.GPUSettings.serializeBinaryToWriter),jspb.internal.binary.writeMessage(t,e,4,proto.tflite.proto.HexagonSettings,proto.tflite.proto.HexagonSettings.serializeBinaryToWriter),jspb.internal.binary.writeMessage(t,e,5,proto.tflite.proto.XNNPackSettings,proto.tflite.proto.XNNPackSettings.serializeBinaryToWriter),jspb.internal.binary.writeMessage(t,e,6,proto.tflite.proto.CPUSettings,proto.tflite.proto.CPUSettings.serializeBinaryToWriter),jspb.internal.binary.writeInt32(t,e,7),jspb.internal.binary.writeMessage(t,e,8,proto.tflite.proto.EdgeTpuSettings,proto.tflite.proto.EdgeTpuSettings.serializeBinaryToWriter),jspb.internal.binary.writeMessage(t,e,10,proto.tflite.proto.CoralSettings,proto.tflite.proto.CoralSettings.serializeBinaryToWriter),jspb.internal.binary.writeMessage(t,e,9,proto.tflite.proto.FallbackSettings,proto.tflite.proto.FallbackSettings.serializeBinaryToWriter),jspb.internal.binary.serializeBinaryExtensionsAndUnknownFields(e,t)},proto.tflite.proto.TFLiteSettings.deserializeBinary=function(e){return jspb.internal.binary.deserializeBinary(e,proto.tflite.proto.TFLiteSettings,proto.tflite.proto.TFLiteSettings.internalDoNotUse$proto$tflite$proto$TFLiteSettings$getBinaryFieldsObject)},proto.tflite.proto.TFLiteSettings.deserializeBinaryFromReader=function(e,t){return module$contents$jspb$internal$binary_deserializeBinaryFromReaderGeneric(e,t,proto.tflite.proto.TFLiteSettings.internalDoNotUse$proto$tflite$proto$TFLiteSettings$getBinaryFieldsObject)},proto.tflite.proto.TFLiteSettings.deserialize=function(e){return module$exports$jspb.Message.deserializeWithCtor(proto.tflite.proto.TFLiteSettings,e)},proto.tflite.proto.TFLiteSettings.ObjectFormat=function(){},module$contents$jspb$internal$public_for_gencode_GENERATE_FROM_OBJECT&&(proto.tflite.proto.TFLiteSettings.fromObject=function(e){var t=new proto.tflite.proto.TFLiteSettings;return null!=e.delegate&&t.internal_setField(1,e.delegate),e.nnapiSettings&&t.internal_setWrapperField(2,proto.tflite.proto.NNAPISettings.fromObject(e.nnapiSettings)),e.gpuSettings&&t.internal_setWrapperField(3,proto.tflite.proto.GPUSettings.fromObject(e.gpuSettings)),e.hexagonSettings&&t.internal_setWrapperField(4,proto.tflite.proto.HexagonSettings.fromObject(e.hexagonSettings)),e.xnnpackSettings&&t.internal_setWrapperField(5,proto.tflite.proto.XNNPackSettings.fromObject(e.xnnpackSettings)),e.cpuSettings&&t.internal_setWrapperField(6,proto.tflite.proto.CPUSettings.fromObject(e.cpuSettings)),null!=e.maxDelegatedPartitions&&t.internal_setField(7,e.maxDelegatedPartitions),e.edgetpuSettings&&t.internal_setWrapperField(8,proto.tflite.proto.EdgeTpuSettings.fromObject(e.edgetpuSettings)),e.coralSettings&&t.internal_setWrapperField(10,proto.tflite.proto.CoralSettings.fromObject(e.coralSettings)),e.fallbackSettings&&t.internal_setWrapperField(9,proto.tflite.proto.FallbackSettings.fromObject(e.fallbackSettings)),t}),proto.tflite.proto.TFLiteSettings.prototype.toObject=function(e){return proto.tflite.proto.TFLiteSettings.internal_toObject(e,this)},proto.tflite.proto.TFLiteSettings.internal_toObject=function(e,t){if(null!=t){var n={delegate:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(1)),nnapiSettings:proto.tflite.proto.NNAPISettings.internal_toObject(e,t.getNnapiSettings()),gpuSettings:proto.tflite.proto.GPUSettings.internal_toObject(e,t.getGpuSettings()),hexagonSettings:proto.tflite.proto.HexagonSettings.internal_toObject(e,t.getHexagonSettings()),xnnpackSettings:proto.tflite.proto.XNNPackSettings.internal_toObject(e,t.getXnnpackSettings()),cpuSettings:proto.tflite.proto.CPUSettings.internal_toObject(e,t.getCpuSettings()),maxDelegatedPartitions:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(7)),edgetpuSettings:proto.tflite.proto.EdgeTpuSettings.internal_toObject(e,t.getEdgetpuSettings()),c
2oralSettings:proto.tflite.proto.CoralSettings.internal_toObject(e,t.getCoralSettings()),fallbackSettings:proto.tflite.proto.FallbackSettings.internal_toObject(e,t.getFallbackSettings())};return e&&(n.$jspbMessageInstance=t),n}},proto.tflite.proto.MinibenchmarkSettings=function(e){module$contents$jspb$internal$public_for_gencode_GeneratedMessage.call(this,e,-1,proto.tflite.proto.MinibenchmarkSettings.repeatedFields_)},$jscomp.inherits(proto.tflite.proto.MinibenchmarkSettings,module$contents$jspb$internal$public_for_gencode_GeneratedMessage),proto.tflite.proto.MinibenchmarkSettings.prototype.getSettingsToTestList=function(){return this.internal_getRepeatedWrapperField(proto.tflite.proto.TFLiteSettings,1)},proto.tflite.proto.MinibenchmarkSettings.prototype.setSettingsToTestList=function(e){return this.internal_setRepeatedWrapperField(1,e)},proto.tflite.proto.MinibenchmarkSettings.prototype.addSettingsToTest=function(e,t){return this.internal_addToRepeatedWrapperField(1,e,proto.tflite.proto.TFLiteSettings,t)},proto.tflite.proto.MinibenchmarkSettings.prototype.addAndReturnSettingsToTest=function(e,t){return this.internal_addAndReturnRepeatedWrapperField(1,e,proto.tflite.proto.TFLiteSettings,t)},proto.tflite.proto.MinibenchmarkSettings.prototype.clearSettingsToTestList=function(){return this.internal_clearRepeatedWrapperField(1)},proto.tflite.proto.MinibenchmarkSettings.prototype.getModelFile=function(){return this.internal_getWrapperField(proto.tflite.proto.ModelFile,2)},proto.tflite.proto.MinibenchmarkSettings.prototype.setModelFile=function(e){return this.internal_setWrapperField(2,e)},proto.tflite.proto.MinibenchmarkSettings.prototype.clearModelFile=function(){return this.internal_clearWrapperField(2)},proto.tflite.proto.MinibenchmarkSettings.prototype.hasModelFile=function(){return this.internal_hasField(2)},proto.tflite.proto.MinibenchmarkSettings.prototype.getStoragePaths=function(){return this.internal_getWrapperField(proto.tflite.proto.BenchmarkStoragePaths,3)},proto.tflite.proto.MinibenchmarkSettings.prototype.setStoragePaths=function(e){return this.internal_setWrapperField(3,e)},proto.tflite.proto.MinibenchmarkSettings.prototype.clearStoragePaths=function(){return this.internal_clearWrapperField(3)},proto.tflite.proto.MinibenchmarkSettings.prototype.hasStoragePaths=function(){return this.internal_hasField(3)},proto.tflite.proto.MinibenchmarkSettings.internalDoNotUse$proto$tflite$proto$MinibenchmarkSettings$getBinaryFieldsObject=function(){return{1:[jspb.internal.binary.readRepeatedMessage,proto.tflite.proto.TFLiteSettings,proto.tflite.proto.TFLiteSettings.internalDoNotUse$proto$tflite$proto$TFLiteSettings$getBinaryFieldsObject],2:[jspb.internal.binary.readMessage,proto.tflite.proto.ModelFile,proto.tflite.proto.ModelFile.internalDoNotUse$proto$tflite$proto$ModelFile$getBinaryFieldsObject],3:[jspb.internal.binary.readMessage,proto.tflite.proto.BenchmarkStoragePaths,proto.tflite.proto.BenchmarkStoragePaths.internalDoNotUse$proto$tflite$proto$BenchmarkStoragePaths$getBinaryFieldsObject]}},proto.tflite.proto.MinibenchmarkSettings.prototype.serializeBinary=function(){return jspb.internal.binary.serializeBinary(this,proto.tflite.proto.MinibenchmarkSettings.serializeBinaryToWriter)},proto.tflite.proto.MinibenchmarkSettings.serializeBinaryToWriter=function(e,t){jspb.internal.binary.writeRepeatedMessage(t,e,1,proto.tflite.proto.TFLiteSettings,proto.tflite.proto.TFLiteSettings.serializeBinaryToWriter),jspb.internal.binary.writeMessage(t,e,2,proto.tflite.proto.ModelFile,proto.tflite.proto.ModelFile.serializeBinaryToWriter),jspb.internal.binary.writeMessage(t,e,3,proto.tflite.proto.BenchmarkStoragePaths,proto.tflite.proto.BenchmarkStoragePaths.serializeBinaryToWriter),jspb.internal.binary.serializeBinaryExtensionsAndUnknownFields(e,t)},proto.tflite.proto.MinibenchmarkSettings.deserializeBinary=function(e){return jspb.internal.binary.deserializeBinary(e,proto.tflite.proto.MinibenchmarkSettings,proto.tflite.proto.MinibenchmarkSettings.internalDoNotUse$proto$tflite$proto$MinibenchmarkSettings$getBinaryFieldsObject)},proto.tflite.proto.MinibenchmarkSettings.deserializeBinaryFromReader=function(e,t){return module$contents$jspb$internal$binary_deserializeBinaryFromReaderGeneric(e,t,proto.tflite.proto.MinibenchmarkSettings.internalDoNotUse$proto$tflite$proto$MinibenchmarkSettings$getBinaryFieldsObject)},proto.tflite.proto.MinibenchmarkSettings.deserialize=function(e){return module$exports$jspb.Message.deserializeWithCtor(proto.tflite.proto.MinibenchmarkSettings,e)},proto.tflite.proto.MinibenchmarkSettings.repeatedFields_=[1],proto.tflite.proto.MinibenchmarkSettings.ObjectFormat=function(){},module$contents$jspb$internal$public_for_gencode_GENERATE_FROM_OBJECT&&(proto.tflite.proto.MinibenchmarkSettings.fromObject=function(e){var t=new proto.tflite.proto.MinibenchmarkSettings;return e.settingsToTestList&&t.internal_setRepeatedWrapperField(1,e.settingsToTestList.map(proto.tflite.proto.TFLiteSettings.fromObject)),e.modelFile&&t.internal_setWrapperField(2,proto.tflite.proto.ModelFile.fromObject(e.modelFile)),e.storagePaths&&t.internal_setWrapperField(3,proto.tflite.proto.BenchmarkStoragePaths.fromObject(e.storagePaths)),t}),proto.tflite.proto.MinibenchmarkSettings.prototype.toObject=function(e){return proto.tflite.proto.MinibenchmarkSettings.internal_toObject(e,this)},proto.tflite.proto.MinibenchmarkSettings.internal_toObject=function(e,t){if(null!=t){var n={settingsToTestList:module$contents$jspb$internal$public_for_gencode_toObjectList(t.getSettingsToTestList(),proto.tflite.proto.TFLiteSettings.internal_toObject,e),modelFile:proto.tflite.proto.ModelFile.internal_toObject(e,t.getModelFile()),storagePaths:proto.tflite.proto.BenchmarkStoragePaths.internal_toObject(e,t.getStoragePaths())};return e&&(n.$jspbMessageInstance=t),n}},proto.tflite.proto.ComputeSettings=function(e){module$contents$jspb$internal$public_for_gencode_GeneratedMessage.call(this,e)},$jscomp.inherits(proto.tflite.proto.ComputeSettings,module$contents$jspb$internal$public_for_gencode_GeneratedMessage),proto.tflite.proto.ComputeSettings.prototype.getPreference=function(){return this.internal_getFieldWithDefault(1,0)},proto.tflite.proto.ComputeSettings.prototype.setPreference=function(e){return this.internal_setField(1,e)},proto.tflite.proto.ComputeSettings.prototype.clearPreference=function(){return this.internal_clearField(1)},proto.tflite.proto.ComputeSettings.prototype.hasPreference=function(){return this.internal_hasField(1)},proto.tflite.proto.ComputeSettings.prototype.getTfliteSettings=function(){return this.internal_getWrapperField(proto.tflite.proto.TFLiteSettings,2)},proto.tflite.proto.ComputeSettings.prototype.setTfliteSettings=function(e){return this.internal_setWrapperField(2,e)},proto.tflite.proto.ComputeSettings.prototype.clearTfliteSettings=function(){return this.internal_clearWrapperField(2)},proto.tflite.proto.ComputeSettings.prototype.hasTfliteSettings=function(){return this.internal_hasField(2)},proto.tflite.proto.ComputeSettings.prototype.getModelNamespaceForStatistics=function(){return this.internal_getStringFieldWithDefault(3)},proto.tflite.proto.ComputeSettings.prototype.setModelNamespaceForStatistics=function(e){return this.internal_setField(3,e)},proto.tflite.proto.ComputeSettings.prototype.clearModelNamespaceForStatistics=function(){return this.internal_clearField(3)},proto.tflite.proto.ComputeSettings.prototype.hasModelNamespaceForStatistics=function(){return this.internal_hasField(3)},proto.tflite.proto.ComputeSettings.prototype.getModelIdentifierForStatistics=function(){return this.internal_getStringFieldWithDefault(4)},proto.tflite.proto.ComputeSettings.prototype.setModelIdentifierForStatistics=function(e){return this.internal_setField(4,e)},proto.tflite.proto.ComputeSettings.prototype.clearModelIdentifierForStatistics=function(){return this.internal_clearField(4)},proto.tflite.proto.ComputeSettings.prototype.hasModelIdentifierForStatistics=function(){return this.internal_hasField(4)},proto.tflite.proto.ComputeSettings.prototype.getSettingsToTestLocally=function(){return this.internal_getWrapperField(proto.tflite.proto.MinibenchmarkSettings,5)},proto.tflite.proto.ComputeSettings.prototype.setSettingsToTestLocally=function(e){return this.internal_setWrapperField(5,e)},proto.tflite.proto.ComputeSettings.prototype.clearSettingsToTestLocally=function(){return this.internal_clearWrapperField(5)},proto.tflite.proto.ComputeSettings.prototype.hasSettingsToTestLocally=function(){return this.internal_hasField(5)},proto.tflite.proto.ComputeSettings.internalDoNotUse$proto$tflite$proto$ComputeSettings$getBinaryFieldsObject=function(){return{1:jspb.internal.binary.readEnum,2:[jspb.internal.binary.readMessage,proto.tflite.proto.TFLiteSettings,proto.tflite.proto.TFLiteSettings.internalDoNotUse$proto$tflite$proto$TFLiteSettings$getBinaryFieldsObject],3:jspb.internal.binary.readString,4:jspb.internal.binary.readString,5:[jspb.internal.binary.readMessage,proto.tflite.proto.MinibenchmarkSettings,proto.tflite.proto.MinibenchmarkSettings.internalDoNotUse$proto$tflite$proto$MinibenchmarkSettings$getBinaryFieldsObject]}},proto.tflite.proto.ComputeSettings.prototype.serializeBinary=function(){return jspb.internal.binary.serializeBinary(this,proto.tflite.proto.ComputeSettings.serializeBinaryToWriter)},proto.tflite.proto.ComputeSettings.serializeBinaryToWriter=function(e,t){jspb.internal.binary.writeEnum(t,e,1),jspb.internal.binary.writeMessage(t,e,2,proto.tflite.proto.TFLiteSettings,proto.tflite.proto.TFLiteSettings.serializeBinaryToWriter),jspb.internal.binary.writeString(t,e,3),jspb.internal.binary.writeString(t,e,4),jspb.internal.binary.writeMessage(t,e,5,proto.tflite.proto.MinibenchmarkSettings,proto.tflite.proto.MinibenchmarkSettings.serializeBinaryToWriter),jspb.internal.binary.serializeBinaryExtensionsAndUnknownFields(e,t)},proto.tflite.proto.ComputeSettings.deserializeBinary=function(e){return jspb.internal.binary.deserializeBinary(e,proto.tflite.proto.ComputeSettings,proto.tflite.proto.ComputeSettings.internalDoNotUse$proto$tflite$proto$ComputeSettings$getBinaryFieldsObject)},proto.tflite.proto.ComputeSettings.deserializeBinaryFromReader=function(e,t){return module$contents$jspb$internal$binary_deserializeBinaryFromReaderGeneric(e,t,proto.tflite.proto.ComputeSettings.internalDoNotUse$proto$tflite$proto$ComputeSettings$getBinaryFieldsObject)},proto.tflite.proto.ComputeSettings.deserialize=function(e){return module$exports$jspb.Message.deserializeWithCtor(proto.tflite.proto.ComputeSettings,e)},proto.tflite.proto.ComputeSettings.ObjectFormat=function(){},module$contents$jspb$internal$public_for_gencode_GENERATE_FROM_OBJECT&&(proto.tflite.proto.ComputeSettings.fromObject=function(e){var t=new proto.tflite.proto.ComputeSettings;return null!=e.preference&&t.internal_setField(1,e.preference),e.tfliteSettings&&t.internal_setWrapperField(2,proto.tflite.proto.TFLiteSettings.fromObject(e.tfliteSettings)),null!=e.modelNamespaceForStatistics&&t.internal_setField(3,e.modelNamespaceForStatistics),null!=e.modelIdentifierForStatistics&&t.internal_setField(4,e.modelIdentifierForStatistics),e.settingsToTestLocally&&t.internal_setWrapperField(5,proto.tflite.proto.MinibenchmarkSettings.fromObject(e.settingsToTestLocally)),t}),proto.tflite.proto.ComputeSettings.prototype.toObject=function(e){return proto.tflite.proto.ComputeSettings.internal_toObject(e,this)},proto.tflite.proto.ComputeSettings.internal_toObject=function(e,t){if(null!=t){var n={preference:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(1)),tfliteSettings:proto.tflite.proto.TFLiteSettings.internal_toObject(e,t.getTfliteSettings()),modelNamespaceForStatistics:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(3)),modelIdentifierForStatistics:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(4)),settingsToTestLocally:proto.tflite.proto.MinibenchmarkSettings.internal_toObject(e,t.getSettingsToTestLocally())};return e&&(n.$jspbMessageInstance=t),n}},proto.tflite.task={},proto.tflite.task.core={},proto.tflite.task.core.BaseOptions=function(e){module$contents$jspb$internal$public_for_gencode_GeneratedMessage.call(this,e)},$jscomp.inherits(proto.tflite.task.core.BaseOptions,module$contents$jspb$internal$public_for_gencode_GeneratedMessage),proto.tflite.task.core.BaseOptions.prototype.getModelFile=function(){return this.internal_getWrapperField(proto.visionkit.ExternalFile,1)},proto.tflite.task.core.BaseOptions.prototype.setModelFile=function(e){return this.internal_setWrapperField(1,e)},proto.tflite.task.core.BaseOptions.prototype.clearModelFile=function(){return this.internal_clearWrapperField(1)},proto.tflite.task.core.BaseOptions.prototype.hasModelFile=function(){return this.internal_hasField(1)},proto.tflite.task.core.BaseOptions.prototype.getComputeSettings=function(){return this.internal_getWrapperField(proto.acceleration.Acceleration,2)},proto.tflite.task.core.BaseOptions.prototype.setComputeSettings=function(e){return this.internal_setWrapperField(2,e)},proto.tflite.task.core.BaseOptions.prototype.clearComputeSettings=function(){return this.internal_clearWrapperField(2)},proto.tflite.task.core.BaseOptions.prototype.hasComputeSettings=function(){return this.internal_hasField(2)},proto.tflite.task.core.BaseOptions.internalDoNotUse$proto$tflite$task$core$BaseOptions$getBinaryFieldsObject=function(){return{1:[jspb.internal.binary.readMessage,proto.visionkit.ExternalFile,proto.visionkit.ExternalFile.internalDoNotUse$proto$visionkit$ExternalFile$getBinaryFieldsObject],2:[jspb.internal.binary.readMessage,proto.acceleration.Acceleration,proto.acceleration.Acceleration.internalDoNotUse$proto$acceleration$Acceleration$getBinaryFieldsObject]}},proto.tflite.task.core.BaseOptions.prototype.serializeBinary=function(){return jspb.internal.binary.serializeBinary(this,proto.tflite.task.core.BaseOptions.serializeBinaryToWriter)},proto.tflite.task.core.BaseOptions.serializeBinaryToWriter=function(e,t){jspb.internal.binary.writeMessage(t,e,1,proto.visionkit.ExternalFile,proto.visionkit.ExternalFile.serializeBinaryToWriter),jspb.internal.binary.writeMessage(t,e,2,proto.acceleration.Acceleration,proto.acceleration.Acceleration.seri
2alizeBinaryToWriter),jspb.internal.binary.serializeBinaryExtensionsAndUnknownFields(e,t)},proto.tflite.task.core.BaseOptions.deserializeBinary=function(e){return jspb.internal.binary.deserializeBinary(e,proto.tflite.task.core.BaseOptions,proto.tflite.task.core.BaseOptions.internalDoNotUse$proto$tflite$task$core$BaseOptions$getBinaryFieldsObject)},proto.tflite.task.core.BaseOptions.deserializeBinaryFromReader=function(e,t){return module$contents$jspb$internal$binary_deserializeBinaryFromReaderGeneric(e,t,proto.tflite.task.core.BaseOptions.internalDoNotUse$proto$tflite$task$core$BaseOptions$getBinaryFieldsObject)},proto.tflite.task.core.BaseOptions.deserialize=function(e){return module$exports$jspb.Message.deserializeWithCtor(proto.tflite.task.core.BaseOptions,e)},proto.tflite.task.core.BaseOptions.ObjectFormat=function(){},module$contents$jspb$internal$public_for_gencode_GENERATE_FROM_OBJECT&&(proto.tflite.task.core.BaseOptions.fromObject=function(e){var t=new proto.tflite.task.core.BaseOptions;return e.modelFile&&t.internal_setWrapperField(1,proto.visionkit.ExternalFile.fromObject(e.modelFile)),e.computeSettings&&t.internal_setWrapperField(2,proto.acceleration.Acceleration.fromObject(e.computeSettings)),t}),proto.tflite.task.core.BaseOptions.prototype.toObject=function(e){return proto.tflite.task.core.BaseOptions.internal_toObject(e,this)},proto.tflite.task.core.BaseOptions.internal_toObject=function(e,t){if(null!=t){var n={modelFile:proto.visionkit.ExternalFile.internal_toObject(e,t.getModelFile()),computeSettings:proto.acceleration.Acceleration.internal_toObject(e,t.getComputeSettings())};return e&&(n.$jspbMessageInstance=t),n}},proto.tflite.task.core.FileDescriptorMeta=function(e){module$contents$jspb$internal$public_for_gencode_GeneratedMessage.call(this,e)},$jscomp.inherits(proto.tflite.task.core.FileDescriptorMeta,module$contents$jspb$internal$public_for_gencode_GeneratedMessage),proto.tflite.task.core.FileDescriptorMeta.prototype.getFd=function(){return this.internal_getIntegerFieldWithDefault(1)},proto.tflite.task.core.FileDescriptorMeta.prototype.setFd=function(e){return this.internal_setField(1,e)},proto.tflite.task.core.FileDescriptorMeta.prototype.clearFd=function(){return this.internal_clearField(1)},proto.tflite.task.core.FileDescriptorMeta.prototype.hasFd=function(){return this.internal_hasField(1)},proto.tflite.task.core.FileDescriptorMeta.prototype.getLength=function(){return this.internal_getIntegerFieldWithDefault(2)},proto.tflite.task.core.FileDescriptorMeta.prototype.setLength=function(e){return this.internal_setField(2,e)},proto.tflite.task.core.FileDescriptorMeta.prototype.clearLength=function(){return this.internal_clearField(2)},proto.tflite.task.core.FileDescriptorMeta.prototype.hasLength=function(){return this.internal_hasField(2)},proto.tflite.task.core.FileDescriptorMeta.prototype.getOffset=function(){return this.internal_getIntegerFieldWithDefault(3)},proto.tflite.task.core.FileDescriptorMeta.prototype.setOffset=function(e){return this.internal_setField(3,e)},proto.tflite.task.core.FileDescriptorMeta.prototype.clearOffset=function(){return this.internal_clearField(3)},proto.tflite.task.core.FileDescriptorMeta.prototype.hasOffset=function(){return this.internal_hasField(3)},proto.tflite.task.core.FileDescriptorMeta.internalDoNotUse$proto$tflite$task$core$FileDescriptorMeta$getBinaryFieldsObject=function(){return{1:jspb.internal.binary.readInt32,2:jspb.internal.binary.readInt64,3:jspb.internal.binary.readInt64}},proto.tflite.task.core.FileDescriptorMeta.prototype.serializeBinary=function(){return jspb.internal.binary.serializeBinary(this,proto.tflite.task.core.FileDescriptorMeta.serializeBinaryToWriter)},proto.tflite.task.core.FileDescriptorMeta.serializeBinaryToWriter=function(e,t){jspb.internal.binary.writeInt32(t,e,1),jspb.internal.binary.writeInt64(t,e,2),jspb.internal.binary.writeInt64(t,e,3),jspb.internal.binary.serializeBinaryExtensionsAndUnknownFields(e,t)},proto.tflite.task.core.FileDescriptorMeta.deserializeBinary=function(e){return jspb.internal.binary.deserializeBinary(e,proto.tflite.task.core.FileDescriptorMeta,proto.tflite.task.core.FileDescriptorMeta.internalDoNotUse$proto$tflite$task$core$FileDescriptorMeta$getBinaryFieldsObject)},proto.tflite.task.core.FileDescriptorMeta.deserializeBinaryFromReader=function(e,t){return module$contents$jspb$internal$binary_deserializeBinaryFromReaderGeneric(e,t,proto.tflite.task.core.FileDescriptorMeta.internalDoNotUse$proto$tflite$task$core$FileDescriptorMeta$getBinaryFieldsObject)},proto.tflite.task.core.FileDescriptorMeta.deserialize=function(e){return module$exports$jspb.Message.deserializeWithCtor(proto.tflite.task.core.FileDescriptorMeta,e)},proto.tflite.task.core.FileDescriptorMeta.ObjectFormat=function(){},module$contents$jspb$internal$public_for_gencode_GENERATE_FROM_OBJECT&&(proto.tflite.task.core.FileDescriptorMeta.fromObject=function(e){var t=new proto.tflite.task.core.FileDescriptorMeta;return null!=e.fd&&t.internal_setField(1,e.fd),null!=e.length&&t.internal_setField(2,e.length),null!=e.offset&&t.internal_setField(3,e.offset),t}),proto.tflite.task.core.FileDescriptorMeta.prototype.toObject=function(e){return proto.tflite.task.core.FileDescriptorMeta.internal_toObject(e,this)},proto.tflite.task.core.FileDescriptorMeta.internal_toObject=function(e,t){if(null!=t){var n={fd:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(1)),length:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(2)),offset:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(3))};return e&&(n.$jspbMessageInstance=t),n}},proto.tflite.task.core.ExternalFile=function(e){module$contents$jspb$internal$public_for_gencode_GeneratedMessage.call(this,e)},$jscomp.inherits(proto.tflite.task.core.ExternalFile,module$contents$jspb$internal$public_for_gencode_GeneratedMessage),proto.tflite.task.core.ExternalFile.prototype.getFileName=function(){return this.internal_getStringFieldWithDefault(1)},proto.tflite.task.core.ExternalFile.prototype.setFileName=function(e){return this.internal_setField(1,e)},proto.tflite.task.core.ExternalFile.prototype.clearFileName=function(){return this.internal_clearField(1)},proto.tflite.task.core.ExternalFile.prototype.hasFileName=function(){return this.internal_hasField(1)},proto.tflite.task.core.ExternalFile.prototype.getFileContent=function(){return this.internal_getStringFieldWithDefault(2)},proto.tflite.task.core.ExternalFile.prototype.getFileContent_asB64=function(){return module$contents$jspb$internal_bytesAsB64(this.getFileContent())},proto.tflite.task.core.ExternalFile.prototype.getFileContent_asU8=function(){return module$contents$jspb$internal_bytesAsU8(this.getFileContent())},proto.tflite.task.core.ExternalFile.prototype.setFileContent=function(e){return this.internal_setField(2,e)},proto.tflite.task.core.ExternalFile.prototype.clearFileContent=function(){return this.internal_clearField(2)},proto.tflite.task.core.ExternalFile.prototype.hasFileContent=function(){return this.internal_hasField(2)},proto.tflite.task.core.ExternalFile.prototype.getFileDescriptorMeta=function(){return this.internal_getWrapperField(proto.tflite.task.core.FileDescriptorMeta,4)},proto.tflite.task.core.ExternalFile.prototype.setFileDescriptorMeta=function(e){return this.internal_setWrapperField(4,e)},proto.tflite.task.core.ExternalFile.prototype.clearFileDescriptorMeta=function(){return this.internal_clearWrapperField(4)},proto.tflite.task.core.ExternalFile.prototype.hasFileDescriptorMeta=function(){return this.internal_hasField(4)},proto.tflite.task.core.ExternalFile.internalDoNotUse$proto$tflite$task$core$ExternalFile$getBinaryFieldsObject=function(){return{1:jspb.internal.binary.readString,2:jspb.internal.binary.readBytes,4:[jspb.internal.binary.readMessage,proto.tflite.task.core.FileDescriptorMeta,proto.tflite.task.core.FileDescriptorMeta.internalDoNotUse$proto$tflite$task$core$FileDescriptorMeta$getBinaryFieldsObject]}},proto.tflite.task.core.ExternalFile.prototype.serializeBinary=function(){return jspb.internal.binary.serializeBinary(this,proto.tflite.task.core.ExternalFile.serializeBinaryToWriter)},proto.tflite.task.core.ExternalFile.serializeBinaryToWriter=function(e,t){jspb.internal.binary.writeString(t,e,1),jspb.internal.binary.writeBytes(t,e,2),jspb.internal.binary.writeMessage(t,e,4,proto.tflite.task.core.FileDescriptorMeta,proto.tflite.task.core.FileDescriptorMeta.serializeBinaryToWriter),jspb.internal.binary.serializeBinaryExtensionsAndUnknownFields(e,t)},proto.tflite.task.core.ExternalFile.deserializeBinary=function(e){return jspb.internal.binary.deserializeBinary(e,proto.tflite.task.core.ExternalFile,proto.tflite.task.core.ExternalFile.internalDoNotUse$proto$tflite$task$core$ExternalFile$getBinaryFieldsObject)},proto.tflite.task.core.ExternalFile.deserializeBinaryFromReader=function(e,t){return module$contents$jspb$internal$binary_deserializeBinaryFromReaderGeneric(e,t,proto.tflite.task.core.ExternalFile.internalDoNotUse$proto$tflite$task$core$ExternalFile$getBinaryFieldsObject)},proto.tflite.task.core.ExternalFile.deserialize=function(e){return module$exports$jspb.Message.deserializeWithCtor(proto.tflite.task.core.ExternalFile,e)},proto.tflite.task.core.ExternalFile.ObjectFormat=function(){},module$contents$jspb$internal$public_for_gencode_GENERATE_FROM_OBJECT&&(proto.tflite.task.core.ExternalFile.fromObject=function(e){var t=new proto.tflite.task.core.ExternalFile;
2return null!=e.fileName&&t.internal_setField(1,e.fileName),null!=e.fileContent&&t.internal_setField(2,e.fileContent),e.fileDescriptorMeta&&t.internal_setWrapperField(4,proto.tflite.task.core.FileDescriptorMeta.fromObject(e.fileDescriptorMeta)),t}),proto.tflite.task.core.ExternalFile.prototype.toObject=function(e){return proto.tflite.task.core.ExternalFile.internal_toObject(e,this)},proto.tflite.task.core.ExternalFile.internal_toObject=function(e,t){if(null!=t){var n={fileName:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(1)),fileContent:t.getFileContent_asB64(),fileDescriptorMeta:proto.tflite.task.core.FileDescriptorMeta.internal_toObject(e,t.getFileDescriptorMeta())};return e&&(n.$jspbMessageInstance=t),n}},proto.tflite.task.text={},proto.tflite.task.text.BertNLClassifierOptions=function(e){module$contents$jspb$internal$public_for_gencode_GeneratedMessage.call(this,e)},$jscomp.inherits(proto.tflite.task.text.BertNLClassifierOptions,module$contents$jspb$internal$public_for_gencode_GeneratedMessage),proto.tflite.task.text.BertNLClassifierOptions.prototype.getBaseOptions=function(){return this.internal_getWrapperField(proto.tflite.task.core.BaseOptions,1)},proto.tflite.task.text.BertNLClassifierOptions.prototype.setBaseOptions=function(e){return this.internal_setWrapperField(1,e)},proto.tflite.task.text.BertNLClassifierOptions.prototype.clearBaseOptions=function(){return this.internal_clearWrapperField(1)},proto.tflite.task.text.BertNLClassifierOptions.prototype.hasBaseOptions=function(){return this.internal_hasField(1)},proto.tflite.task.text.BertNLClassifierOptions.prototype.getMaxSeqLen=function(){return this.internal_getIntegerFieldWithDefault(2,128)},proto.tflite.task.text.BertNLClassifierOptions.prototype.setMaxSeqLen=function(e){return this.internal_setField(2,e)},proto.tflite.task.text.BertNLClassifierOptions.prototype.clearMaxSeqLen=function(){return this.internal_clearField(2)},proto.tflite.task.text.BertNLClassifierOptions.prototype.hasMaxSeqLen=function(){return this.internal_hasField(2)},proto.tflite.task.text.BertNLClassifierOptions.internalDoNotUse$proto$tflite$task$text$BertNLClassifierOptions$getBinaryFieldsObject=function(){return{1:[jspb.internal.binary.readMessage,proto.tflite.task.core.BaseOptions,proto.tflite.task.core.BaseOptions.internalDoNotUse$proto$tflite$task$core$BaseOptions$getBinaryFieldsObject],2:jspb.internal.binary.readInt32}},proto.tflite.task.text.BertNLClassifierOptions.prototype.serializeBinary=function(){return jspb.internal.binary.serializeBinary(this,proto.tflite.task.text.BertNLClassifierOptions.serializeBinaryToWriter)},proto.tflite.task.text.BertNLClassifierOptions.serializeBinaryToWriter=function(e,t){jspb.internal.binary.writeMessage(t,e,1,proto.tflite.task.core.BaseOptions,proto.tflite.task.core.BaseOptions.serializeBinaryToWriter),jspb.internal.binary.writeInt32(t,e,2),jspb.internal.binary.serializeBinaryExtensionsAndUnknownFields(e,t)},proto.tflite.task.text.BertNLClassifierOptions.deserializeBinary=function(e){return jspb.internal.binary.deserializeBinary(e,proto.tflite.task.text.BertNLClassifierOptions,proto.tflite.task.text.BertNLClassifierOptions.internalDoNotUse$proto$tflite$task$text$BertNLClassifierOptions$getBinaryFieldsObject)},proto.tflite.task.text.BertNLClassifierOptions.deserializeBinaryFromReader=function(e,t){return module$contents$jspb$internal$binary_deserializeBinaryFromReaderGeneric(e,t,proto.tflite.task.text.BertNLClassifierOptions.internalDoNotUse$proto$tflite$task$text$BertNLClassifierOptions$getBinaryFieldsObject)},proto.tflite.task.text.BertNLClassifierOptions.deserialize=function(e){return module$exports$jspb.Message.deserializeWithCtor(proto.tflite.task.text.BertNLClassifierOptions,e)},proto.tflite.task.text.BertNLClassifierOptions.ObjectFormat=function(){},module$contents$jspb$internal$public_for_gencode_GENERATE_FROM_OBJECT&&(proto.tflite.task.text.BertNLClassifierOptions.fromObject=function(e){var t=new proto.tflite.task.text.BertNLClassifierOptions;return e.baseOptions&&t.internal_setWrapperField(1,proto.tflite.task.core.BaseOptions.fromObject(e.baseOptions)),null!=e.maxSeqLen&&t.internal_setField(2,e.maxSeqLen),t}),proto.tflite.task.text.BertNLClassifierOptions.prototype.toObject=function(e){return proto.tflite.task.text.BertNLClassifierOptions.internal_toObject(e,this)},proto.tflite.task.text.BertNLClassifierOptions.internal_toObject=function(e,t){if(null!=t){var n={baseOptions:proto.tflite.task.core.BaseOptions.internal_toObject(e,t.getBaseOptions()),maxSeqLen:t.internal_getIntegerFieldWithDefault(2,128)};return e&&(n.$jspbMessageInstance=t),n}},proto.tflite.task.vision={},proto.tflite.task.vision.BoundingBox=function(e){module$contents$jspb$internal$public_for_gencode_GeneratedMessage.call(this,e)},$jscomp.inherits(proto.tflite.task.vision.BoundingBox,module$contents$jspb$internal$public_for_gencode_GeneratedMessage),proto.tflite.task.vision.BoundingBox.prototype.getOriginX=function(){return this.internal_getIntegerFieldWithDefault(1)},proto.tflite.task.vision.BoundingBox.prototype.setOriginX=function(e){return this.internal_setField(1,e)},proto.tflite.task.vision.BoundingBox.prototype.clearOriginX=function(){return this.internal_clearField(1)},proto.tflite.task.vision.BoundingBox.prototype.hasOriginX=function(){return this.internal_hasField(1)},proto.tflite.task.vision.BoundingBox.prototype.getOriginY=function(){return this.internal_getIntegerFieldWithDefault(2)},proto.tflite.task.vision.BoundingBox.prototype.setOriginY=function(e){return this.internal_setField(2,e)},proto.tflite.task.vision.BoundingBox.prototype.clearOriginY=function(){return this.internal_clearField(2)},proto.tflite.task.vision.BoundingBox.prototype.hasOriginY=function(){return this.internal_hasField(2)},proto.tflite.task.vision.BoundingBox.prototype.getWidth=function(){return this.internal_getIntegerFieldWithDefault(3)},proto.tflite.task.vision.BoundingBox.prototype.setWidth=function(e){return this.internal_setField(3,e)},proto.tflite.task.vision.BoundingBox.prototype.clearWidth=function(){return this.internal_clearField(3)},proto.tflite.task.vision.BoundingBox.prototype.hasWidth=function(){return this.internal_hasField(3)},proto.tflite.task.vision.BoundingBox.prototype.getHeight=function(){return this.internal_getIntegerFieldWithDefault(4)},proto.tflite.task.vision.BoundingBox.prototype.setHeight=function(e){return this.internal_setField(4,e)},proto.tflite.task.vision.BoundingBox.prototype.clearHeight=function(){return this.internal_clearField(4)},proto.tflite.task.vision.BoundingBox.prototype.hasHeight=function(){return this.internal_hasField(4)},proto.tflite.task.vision.BoundingBox.internalDoNotUse$proto$tflite$task$vision$BoundingBox$getBinaryFieldsObject=function(){return{1:jspb.internal.binary.readInt32,2:jspb.internal.binary.readInt32,3:jspb.internal.binary.readInt32,4:jspb.internal.binary.readInt32}},proto.tflite.task.vision.BoundingBox.prototype.serializeBinary=function(){return jspb.internal.binary.serializeBinary(this,proto.tflite.task.vision.BoundingBox.serializeBinaryToWriter)},proto.tflite.task.vision.BoundingBox.serializeBinaryToWriter=function(e,t){jspb.internal.binary.writeInt32(t,e,1),jspb.internal.binary.writeInt32(t,e,2),jspb.internal.binary.writeInt32(t,e,3),jspb.internal.binary.writeInt32(t,e,4),jspb.internal.binary.serializeBinaryExtensionsAndUnknownFields(e,t)},proto.tflite.task.vision.BoundingBox.deserializeBinary=function(e){return jspb.internal.binary.deserializeBinary(e,proto.tflite.task.vision.BoundingBox,proto.tflite.task.vision.BoundingBox.internalDoNotUse$proto$tflite$task$vision$BoundingBox$getBinaryFieldsObject)},proto.tflite.task.vision.BoundingBox.deserializeBinaryFromReader=function(e,t){return module$contents$jspb$internal$binary_deserializeBinaryFromReaderGeneric(e,t,proto.tflite.task.vision.BoundingBox.internalDoNotUse$proto$tflite$task$vision$BoundingBox$getBinaryFieldsObject)},proto.tflite.task.vision.BoundingBox.deserialize=function(e){return module$exports$jspb.Message.deserializeWithCtor(proto.tflite.task.vision.BoundingBox,e)},proto.tflite.task.vision.BoundingBox.ObjectFormat=function(){},module$contents$jspb$internal$public_for_gencode_GENERATE_FROM_OBJECT&&(proto.tflite.task.vision.BoundingBox.fromObject=function(e){var t=new proto.tflite.task.vision.BoundingBox;return null!=e.originX&&t.internal_setField(1,e.originX),null!=e.originY&&t.internal_setField(2,e.originY),null!=e.width&&t.internal_setField(3,e.width),null!=e.height&&t.internal_setField(4,e.height),t}),proto.tflite.task.vision.BoundingBox.prototype.toObject=function(e){return proto.tflite.task.vision.BoundingBox.internal_toObject(e,this)},proto.tflite.task.vision.BoundingBox.internal_toObject=function(e,t){if(null!=t){var n={originX:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(1)),originY:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(2)),width:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(3)),height:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(4))};return e&&(n.$jspbMessageInstance=t),n}},proto.tflite.task.vision.Class=function(e){module$contents$jspb$internal$public_for_gencode_GeneratedMessage.call(this,e)},$jscomp.inherits(proto.tflite.task.vision.Class,module$contents$jspb$internal$public_for_gencode_GeneratedMessage),proto.tflite.task.vision.Class.prototype.getIndex=function(){return this.internal_getIntegerFieldWithDefault(1)},proto.tflite.task.vision.Class.prototype.setIndex=function(e){return this.internal_setField(1,e)},proto.tflite.task.vision.Class.prototype.clearIndex=function(){return this.internal_clearField(1)},proto.tflite.task.vision.Class.prototype.hasIndex=function(){return this.internal_hasField(1)},proto.tflite.task.vision.Class.prototype.getScore=function(){return this.internal_getFloatingPointFieldWithDefault(2)},proto.tflite.task.vision.Class.prototype.setScore=function(e){return this.internal_setField(2,e)},proto.tflite.task.vision.Class.prototype.clearScore=function(){return this.internal_clearField(2)},proto.tflite.task.vision.Class.prototype.hasScore=function(){return this.internal_hasField(2)},proto.tflite.task.vision.Class.prototype.getDisplayName=function(){return this.internal_getStringFieldWithDefault(3)},proto.tflite.task.vision.Class.prototype.setDisplayName=function(e){return this.internal_setField(3,e)},proto.tflite.task.vision.Class.prototype.clearDisplayName=function(){return this.internal_clearField(3)},proto.tflite.task.vision.Class.prototype.hasDisplayName=function(){return this.internal_hasField(3)},proto.tflite.task.vision.Class.prototype.getClassName=function(){return this.internal_getStringFieldWithDefault(4)},proto.tflite.task.vision.Class.prototype.setClassName=function(e){return this.internal_setField(4,e)},proto.tflite.task.vision.Class.prototype.clearClassName=function(){return this.internal_clearField(4)},proto.tflite.task.vision.Class.prototype.hasClassName=function(){return this.internal_hasField(4)},proto.tflite.task.vision.Class.internalDoNotUse$proto$tflite$task$vision$Class$getBinaryFieldsObject=function(){return{1:jspb.internal.binary.readInt32,2:jspb.internal.binary.readFloat,3:jspb.internal.binary.readString,4:jspb.internal.binary.readString}},proto.tflite.task.vision.Class.prototype.serializeBinary=function(){return jspb.internal.binary.serializeBinary(this,proto.tflite.task.vision.Class.serializeBinaryToWriter)},proto.tflite.task.vision.Class.serializeBinaryToWriter=function(e,t){jspb.internal.binary.writeInt32(t,e,1),jspb.internal.binary.writeFloat(t,e,2),jspb.internal.binary.writeString(t,e,3),jspb.internal.binary.writeString(t,e,4),jspb.internal.binary.serializeBinaryExtensionsAndUnknownFields(e,t)},proto.tflite.task.vision.Class.deserializeBinary=function(e){return jspb.internal.binary.deserializeBinary(e,proto.tflite.task.vision.Class,proto.tflite.task.vision.Class.internalDoNotUse$proto$tflite$task$vision$Class$getBinaryFieldsObject)},proto.tflite.task.vision.Class.deserializeBinaryFromReader=function(e,t){return module$contents$jspb$internal$binary_deserializeBinaryFromReaderGeneric(e,t,proto.tflite.task.vision.Class.internalDoNotUse$proto$tflite$task$vision$Class$getBinaryFieldsObject)},proto.tflite.task.vision.Class.deserialize=function(e){return module$exports$jspb.Message.deserializeWithCtor(proto.tflite.task.vision.Class,e)};proto.tflite.task.vision.Class.ObjectFormat=function(){},module$contents$jspb$internal$public_for_gencode_GENERATE_FROM_OBJECT&&(proto.tflite.task.vision.Class.fromObject=function(e){var t=new proto.tflite.task.vision.Class;return null!=e.index&&t.internal_setField(1,e.index),null!=e.score&&t.internal_setField(2,e.score),null!=e.displayName&&t.internal_setField(3,e.displayName),null!=e.className&&t.internal_setField(4,e.className),t}),proto.tflite.task.vision.Class.prototype.toObject=function(e){return proto.tflite.task.vision.Class.internal_toObject(e,this)},proto.tflite.task.vision.Class.internal_toObject=function(e,t){if(null!=t){var n={index:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(1)),score:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getFloatingPointField(2)),displayName:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(3)),className:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(4))};return e&&(n.$jspbMessageInstance=t),n}},proto.tflite.task.vision.Classifications=function(e){module$contents$jspb$internal$public_for_gencode_GeneratedMessage.call(this,e,-1,proto.tflite.task.vision.Classifications.repeatedFields_)},$jscomp.inherits(proto.tflite.task.vision.Classifications,module$contents$jspb$internal$public_for_gencode_GeneratedMessage),proto.tflite.task.vision.Classifications.prototype.getClassesList=function(){return this.internal_getRepeatedWrapperField(proto.tflite.task.vision.Class,1)},proto.tflite.task.vision.Classifications.prototype.setClassesList=function(e){return this.internal_setRepeatedWrapperField(1,e)},proto.tflite.task.vision.Classifications.prototype.addClasses=function(e,t){return this.internal_addToRepeatedWrapperField(1,e,proto.tflite.task.vision.Class,t)},proto.tflite.task.vision.Classifications.prototype.addAndReturnClasses=function(e,t){return this.internal_addAndReturnRepeatedWrapperField(1,e,proto.tflite.task.vision.Class,t)},proto.tflite.task.vision.Classifications.prototype.clearClassesList=function(){return this.internal_clearRepeatedWrapperField(1)},proto.tflite.task.vision.Classifications.prototype.getHeadIndex=function(){return this.internal_getIntegerFieldWithDefault(2)},proto.tflite.task.vision.Classifications.prototype.setHeadIndex=function(e){return this.internal_setField(2,e)},proto.tflite.task.vision.Classifications.prototype.clearHeadIndex=function(){return this.internal_clearField(2)},proto.tflite.task.vision.Classifications.prototype.hasHeadIndex=function(){return this.internal_hasField(2)},proto.tflite.task.vision.Classifications.internalDoNotUse$proto$tflite$task$vision$Classifications$getBinaryFieldsObject=function(){return{1:[jspb.internal.binary.readRepeatedMessage,proto.tflite.task.vision.Class,proto.tflite.task.vision.Class.internalDoNotUse$proto$tflite$task$vision$Class$getBinaryFieldsObject],2:jspb.internal.binary.readInt32}},proto.tflite.task.vision.Classifications.prototype.serializeBinary=function(){return jspb.internal.binary.serializeBinary(this,proto.tflite.task.vision.Classifications.serializeBinaryToWriter)},proto.tflite.task.vision.Classifications.serializeBinaryToWriter=function(e,t){jspb.internal.binary.writeRepeatedMessage(t,e,1,proto.tflite.task.vision.Class,proto.tflite.task.vision.Class.serializeBinaryToWriter),jspb.internal.binary.writeInt32(t,e,2),jspb.internal.binary.serializeBinaryExtensionsAndUnknownFields(e,t)},proto.tflite.task.vision.Classifications.deserializeBinary=function(e){return jspb.internal.binary.deserializeBinary(e,proto.tflite.task.vision.Classifications,proto.tflite.task.vision.Classifications.internalDoNotUse$proto$tflite$task$vision$Classifications$getBinaryFieldsObject)},proto.tflite.task.vision.Classifications.deserializeBinaryFromReader=function(e,t){return module$c
2ontents$jspb$internal$binary_deserializeBinaryFromReaderGeneric(e,t,proto.tflite.task.vision.Classifications.internalDoNotUse$proto$tflite$task$vision$Classifications$getBinaryFieldsObject)},proto.tflite.task.vision.Classifications.deserialize=function(e){return module$exports$jspb.Message.deserializeWithCtor(proto.tflite.task.vision.Classifications,e)},proto.tflite.task.vision.Classifications.repeatedFields_=[1],proto.tflite.task.vision.Classifications.ObjectFormat=function(){},module$contents$jspb$internal$public_for_gencode_GENERATE_FROM_OBJECT&&(proto.tflite.task.vision.Classifications.fromObject=function(e){var t=new proto.tflite.task.vision.Classifications;return e.classesList&&t.internal_setRepeatedWrapperField(1,e.classesList.map(proto.tflite.task.vision.Class.fromObject)),null!=e.headIndex&&t.internal_setField(2,e.headIndex),t}),proto.tflite.task.vision.Classifications.prototype.toObject=function(e){return proto.tflite.task.vision.Classifications.internal_toObject(e,this)},proto.tflite.task.vision.Classifications.internal_toObject=function(e,t){if(null!=t){var n={classesList:module$contents$jspb$internal$public_for_gencode_toObjectList(t.getClassesList(),proto.tflite.task.vision.Class.internal_toObject,e),headIndex:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(2))};return e&&(n.$jspbMessageInstance=t),n}},proto.tflite.task.vision.ClassificationResult=function(e){module$contents$jspb$internal$public_for_gencode_GeneratedMessage.call(this,e,-1,proto.tflite.task.vision.ClassificationResult.repeatedFields_)},$jscomp.inherits(proto.tflite.task.vision.ClassificationResult,module$contents$jspb$internal$public_for_gencode_GeneratedMessage),proto.tflite.task.vision.ClassificationResult.prototype.getClassificationsList=function(){return this.internal_getRepeatedWrapperField(proto.tflite.task.vision.Classifications,1)},proto.tflite.task.vision.ClassificationResult.prototype.setClassificationsList=function(e){return this.internal_setRepeatedWrapperField(1,e)},proto.tflite.task.vision.ClassificationResult.prototype.addClassifications=function(e,t){return this.internal_addToRepeatedWrapperField(1,e,proto.tflite.task.vision.Classifications,t)},proto.tflite.task.vision.ClassificationResult.prototype.addAndReturnClassifications=function(e,t){return this.internal_addAndReturnRepeatedWrapperField(1,e,proto.tflite.task.vision.Classifications,t)},proto.tflite.task.vision.ClassificationResult.prototype.clearClassificationsList=function(){return this.internal_clearRepeatedWrapperField(1)},proto.tflite.task.vision.ClassificationResult.internalDoNotUse$proto$tflite$task$vision$ClassificationResult$getBinaryFieldsObject=function(){return{1:[jspb.internal.binary.readRepeatedMessage,proto.tflite.task.vision.Classifications,proto.tflite.task.vision.Classifications.internalDoNotUse$proto$tflite$task$vision$Classifications$getBinaryFieldsObject]}},proto.tflite.task.vision.ClassificationResult.prototype.serializeBinary=function(){return jspb.internal.binary.serializeBinary(this,proto.tflite.task.vision.ClassificationResult.serializeBinaryToWriter)},proto.tflite.task.vision.ClassificationResult.serializeBinaryToWriter=function(e,t){jspb.internal.binary.writeRepeatedMessage(t,e,1,proto.tflite.task.vision.Classifications,proto.tflite.task.vision.Classifications.serializeBinaryToWriter),jspb.internal.binary.serializeBinaryExtensionsAndUnknownFields(e,t)},proto.tflite.task.vision.ClassificationResult.deserializeBinary=function(e){return jspb.internal.binary.deserializeBinary(e,proto.tflite.task.vision.ClassificationResult,proto.tflite.task.vision.ClassificationResult.internalDoNotUse$proto$tflite$task$vision$ClassificationResult$getBinaryFieldsObject)},proto.tflite.task.vision.ClassificationResult.deserializeBinaryFromReader=function(e,t){return module$contents$jspb$internal$binary_deserializeBinaryFromReaderGeneric(e,t,proto.tflite.task.vision.ClassificationResult.internalDoNotUse$proto$tflite$task$vision$ClassificationResult$getBinaryFieldsObject)},proto.tflite.task.vision.ClassificationResult.deserialize=function(e){return module$exports$jspb.Message.deserializeWithCtor(proto.tflite.task.vision.ClassificationResult,e)},proto.tflite.task.vision.ClassificationResult.repeatedFields_=[1],proto.tflite.task.vision.ClassificationResult.ObjectFormat=function(){},module$contents$jspb$internal$public_for_gencode_GENERATE_FROM_OBJECT&&(proto.tflite.task.vision.ClassificationResult.fromObject=function(e){var t=new proto.tflite.task.vision.ClassificationResult;return e.classificationsList&&t.internal_setRepeatedWrapperField(1,e.classificationsList.map(proto.tflite.task.vision.Classifications.fromObject)),t}),proto.tflite.task.vision.ClassificationResult.prototype.toObject=function(e){return proto.tflite.task.vision.ClassificationResult.internal_toObject(e,this)},proto.tflite.task.vision.ClassificationResult.internal_toObject=function(e,t){if(null!=t){var n={classificationsList:module$contents$jspb$internal$public_for_gencode_toObjectList(t.getClassificationsList(),proto.tflite.task.vision.Classifications.internal_toObject,e)};return e&&(n.$jspbMessageInstance=t),n}},proto.tflite.task.vision.Detection=function(e){module$contents$jspb$internal$public_for_gencode_GeneratedMessage.call(this,e,-1,proto.tflite.task.vision.Detection.repeatedFields_)},$jscomp.inherits(proto.tflite.task.vision.Detection,module$contents$jspb$internal$public_for_gencode_GeneratedMessage),proto.tflite.task.vision.Detection.prototype.getBoundingBox=function(){return this.internal_getWrapperField(proto.tflite.task.vision.BoundingBox,2)},proto.tflite.task.vision.Detection.prototype.setBoundingBox=function(e){return this.internal_setWrapperField(2,e)},proto.tflite.task.vision.Detection.prototype.clearBoundingBox=function(){return this.internal_clearWrapperField(2)},proto.tflite.task.vision.Detection.prototype.hasBoundingBox=function(){return this.internal_hasField(2)},proto.tflite.task.vision.Detection.prototype.getClassesList=function(){return this.internal_getRepeatedWrapperField(proto.tflite.task.vision.Class,3)},proto.tflite.task.vision.Detection.prototype.setClassesList=function(e){return this.internal_setRepeatedWrapperField(3,e)},proto.tflite.task.vision.Detection.prototype.addClasses=function(e,t){return this.internal_addToRepeatedWrapperField(3,e,proto.tflite.task.vision.Class,t)},proto.tflite.task.vision.Detection.prototype.addAndReturnClasses=function(e,t){return this.internal_addAndReturnRepeatedWrapperField(3,e,proto.tflite.task.vision.Class,t)},proto.tflite.task.vision.Detection.prototype.clearClassesList=function(){return this.internal_clearRepeatedWrapperField(3)},proto.tflite.task.vision.Detection.internalDoNotUse$proto$tflite$task$vision$Detection$getBinaryFieldsObject=function(){return{2:[jspb.internal.binary.readMessage,proto.tflite.task.vision.BoundingBox,proto.tflite.task.vision.BoundingBox.internalDoNotUse$proto$tflite$task$vision$BoundingBox$getBinaryFieldsObject],3:[jspb.internal.binary.readRepeatedMessage,proto.tflite.task.vision.Class,proto.tflite.task.vision.Class.internalDoNotUse$proto$tflite$task$vision$Class$getBinaryFieldsObject]}},proto.tflite.task.vision.Detection.prototype.serializeBinary=function(){return jspb.internal.binary.serializeBinary(this,proto.tflite.task.vision.Detection.seri
2alizeBinaryToWriter)},proto.tflite.task.vision.Detection.serializeBinaryToWriter=function(e,t){jspb.internal.binary.writeMessage(t,e,2,proto.tflite.task.vision.BoundingBox,proto.tflite.task.vision.BoundingBox.serializeBinaryToWriter),jspb.internal.binary.writeRepeatedMessage(t,e,3,proto.tflite.task.vision.Class,proto.tflite.task.vision.Class.serializeBinaryToWriter),jspb.internal.binary.serializeBinaryExtensionsAndUnknownFields(e,t)},proto.tflite.task.vision.Detection.deserializeBinary=function(e){return jspb.internal.binary.deserializeBinary(e,proto.tflite.task.vision.Detection,proto.tflite.task.vision.Detection.internalDoNotUse$proto$tflite$task$vision$Detection$getBinaryFieldsObject)},proto.tflite.task.vision.Detection.deserializeBinaryFromReader=function(e,t){return module$contents$jspb$internal$binary_deserializeBinaryFromReaderGeneric(e,t,proto.tflite.task.vision.Detection.internalDoNotUse$proto$tflite$task$vision$Detection$getBinaryFieldsObject)},proto.tflite.task.vision.Detection.deserialize=function(e){return module$exports$jspb.Message.deserializeWithCtor(proto.tflite.task.vision.Detection,e)},proto.tflite.task.vision.Detection.repeatedFields_=[3],proto.tflite.task.vision.Detection.ObjectFormat=function(){},module$contents$jspb$internal$public_for_gencode_GENERATE_FROM_OBJECT&&(proto.tflite.task.vision.Detection.fromObject=function(e){var t=new proto.tflite.task.vision.Detection;return e.boundingBox&&t.internal_setWrapperField(2,proto.tflite.task.vision.BoundingBox.fromObject(e.boundingBox)),e.classesList&&t.internal_setRepeatedWrapperField(3,e.classesList.map(proto.tflite.task.vision.Class.fromObject)),t}),proto.tflite.task.vision.Detection.prototype.toObject=function(e){return proto.tflite.task.vision.Detection.internal_toObject(e,this)},proto.tflite.task.vision.Detection.internal_toObject=function(e,t){if(null!=t){var n={boundingBox:proto.tflite.task.vision.BoundingBox.internal_toObject(e,t.getBoundingBox()),classesList:module$contents$jspb$internal$public_for_gencode_toObjectList(t.getClassesList(),proto.tflite.task.vision.Class.internal_toObject,e)};return e&&(n.$jspbMessageInstance=t),n}},proto.tflite.task.vision.DetectionResult=function(e){module$contents$jspb$internal$public_for_gencode_GeneratedMessage.call(this,e,-1,proto.tflite.task.vision.DetectionResult.repeatedFields_)},$jscomp.inherits(proto.tflite.task.vision.DetectionResult,module$contents$jspb$internal$public_for_gencode_GeneratedMessage),proto.tflite.task.vision.DetectionResult.prototype.getDetectionsList=function(){return this.internal_getRepeatedWrapperField(proto.tflite.task.vision.Detection,1)},proto.tflite.task.vision.DetectionResult.prototype.setDetectionsList=function(e){return this.internal_setRepeatedWrapperField(1,e)},proto.tflite.task.vision.DetectionResult.prototype.addDetections=function(e,t){return this.internal_addToRepeatedWrapperField(1,e,proto.tflite.task.vision.Detection,t)},proto.tflite.task.vision.DetectionResult.prototype.addAndReturnDetections=function(e,t){return this.internal_addAndReturnRepeatedWrapperField(1,e,proto.tflite.task.vision.Detection,t)},proto.tflite.task.vision.DetectionResult.prototype.clearDetectionsList=function(){return this.internal_clearRepeatedWrapperField(1)},proto.tflite.task.vision.DetectionResult.internalDoNotUse$proto$tflite$task$vision$DetectionResult$getBinaryFieldsObject=function(){return{1:[jspb.internal.binary.readRepeatedMessage,proto.tflite.task.vision.Detection,proto.tflite.task.vision.Detection.internalDoNotUse$proto$tflite$task$vision$Detection$getBinaryFieldsObject]}},proto.tflite.task.vision.DetectionResult.prototype.serializeBinary=function(){return jspb.internal.binary.serializeBinary(this,proto.tflite.task.vision.DetectionResult.serializeBinaryToWriter)},proto.tflite.task.vision.DetectionResult.serializeBinaryToWriter=function(e,t){jspb.internal.binary.writeRepeatedMessage(t,e,1,proto.tflite.task.vision.Detection,proto.tflite.task.vision.Detection.serializeBinaryToWriter),jspb.internal.binary.serializeBinaryExtensionsAndUnknownFields(e,t)},proto.tflite.task.vision.DetectionResult.deserializeBinary=function(e){return jspb.internal.binary.deserializeBinary(e,proto.tflite.task.vision.DetectionResult,proto.tflite.task.vision.DetectionResult.internalDoNotUse$proto$tflite$task$vision$DetectionResult$getBinaryFieldsObject)},proto.tflite.task.vision.DetectionResult.deserializeBinaryFromReader=function(e,t){return module$contents$jspb$internal$binary_deserializeBinaryFromReaderGeneric(e,t,proto.tflite.task.vision.DetectionResult.internalDoNotUse$proto$tflite$task$vision$DetectionResult$getBinaryFieldsObject)},proto.tflite.task.vision.DetectionResult.deserialize=function(e){return module$exports$jspb.Message.deserializeWithCtor(proto.tflite.task.vision.DetectionResult,e)},proto.tflite.task.vision.DetectionResult.repeatedFields_=[1],proto.tflite.task.vision.DetectionResult.ObjectFormat=function(){},module$contents$jspb$internal$public_for_gencode_GENERATE_FROM_OBJECT&&(proto.tflite.task.vision.DetectionResult.fromObject=function(e){var t=new proto.tflite.task.vision.DetectionResult;return e.detectionsList&&t.internal_setRepeatedWrapperField(1,e.detectionsList.map(proto.tflite.task.vision.Detection.fromObject)),t}),proto.tflite.task.vision.DetectionResult.prototype.toObject=function(e){return proto.tflite.task.vision.DetectionResult.internal_toObject(e,this)},proto.tflite.task.vision.DetectionResult.internal_toObject=function(e,t){if(null!=t){var n={detectionsList:module$contents$jspb$internal$public_for_gencode_toObjectList(t.getDetectionsList(),proto.tflite.task.vision.Detection.internal_toObject,e)};return e&&(n.$jspbMessageInstance=t),n}},proto.tflite.task.vision.ImageClassifierOptions=function(e){module$contents$jspb$internal$public_for_gencode_GeneratedMessage.call(this,e,-1,proto.tflite.task.vision.ImageClassifierOptions.repeatedFields_)},$jscomp.inherits(proto.tflite.task.vision.ImageClassifierOptions,module$contents$jspb$internal$public_for_gencode_GeneratedMessage),proto.tflite.task.vision.ImageClassifierOptions.prototype.getBaseOptions=function(){return this.internal_getWrapperField(proto.tflite.task.core.BaseOptions,14)},proto.tflite.task.vision.ImageClassifierOptions.prototype.setBaseOptions=function(e){return this.internal_setWrapperField(14,e)},proto.tflite.task.vision.ImageClassifierOptions.prototype.clearBaseOptions=function(){return this.internal_clearWrapperField(14)},proto.tflite.task.vision.ImageClassifierOptions.prototype.hasBaseOptions=function(){return this.internal_hasField(14)},proto.tflite.task.vision.ImageClassifierOptions.prototype.getModelFileWithMetadata=function(){return this.internal_getWrapperField(proto.tflite.task.core.ExternalFile,10)},proto.tflite.task.vision.ImageClassifierOptions.prototype.setModelFileWithMetadata=function(e){return this.internal_setWrapperField(10,e)},proto.tflite.task.vision.ImageClassifierOptions.prototype.clearModelFileWithMetadata=function(){return this.internal_clearWrapperField(10)},proto.tflite.task.vision.ImageClassifierOptions.prototype.hasModelFileWithMetadata=function(){return this.internal_hasField(10)},proto.tflite.task.vision.ImageClassifierOptions.prototype.getDisplayNamesLocale=function(){return this.internal_getStringFieldWithDefault(11,"en")},proto.tflite.task.vision.ImageClassifierOptions.prototype.setDisplayNamesLocale=function(e){return this.internal_setField(11,e)},proto.tflite.task.vision.ImageClassifierOptions.prototype.clearDisplayNamesLocale=function(){return this.internal_clearField(11)},proto.tflite.task.vision.ImageClassifierOptions.prototype.hasDisplayNamesLocale=function(){return this.internal_hasField(11)},proto.tflite.task.vision.ImageClassifierOptions.prototype.getMaxResults=function(){return this.internal_getIntegerFieldWithDefault(2,-1)},proto.tflite.task.vision.ImageClassifierOptions.prototype.setMaxResults=function(e){return this.internal_setField(2,e)},proto.tflite.task.vision.ImageClassifierOptions.prototype.clearMaxResults=function(){return this.internal_clearField(2)},proto.tflite.task.vision.ImageClassifierOptions.prototype.hasMaxResults=function(){return this.internal_hasField(2)},proto.tflite.task.vision.ImageClassifierOptions.prototype.getScoreThreshold=function(){return this.internal_getFloatingPointFieldWithDefault(3)},proto.tflite.task.vision.ImageClassifierOptions.prototype.setScoreThreshold=function(e){return this.internal_setField(3,e)},proto.tflite.task.vision.ImageClassifierOptions.prototype.clearScoreThreshold=function(){return this.internal_clearField(3)},proto.tflite.task.vision.ImageClassifierOptions.prototype.hasScoreThreshold=function(){return this.internal_hasField(3)},proto.tflite.task.vision.ImageClassifierOptions.prototype.getClassNameWhitelistList=function(){return this.internal_getRepeatedField(4)},proto.tflite.task.vision.ImageClassifierOptions.prototype.setClassNameWhitelistList=function(e){return this.internal_setRepeatedField(4,e)},proto.tflite.task.vision.ImageClassifierOptions.prototype.addClassNameWhitelist=function(e,t){return this.internal_addToRepeatedField(4,e,t)},proto.tflite.task.vision.ImageClassifierOptions.prototype.clearClassNameWhitelistList=function(){return this.internal_clearRepeatedField(4)},proto.tflite.task.vision.ImageClassifierOptions.prototype.getClassNameBlacklistList=function(){return this.internal_getRepeatedField(5)},proto.tflite.task.vision.ImageClassifierOptions.prototype.setClassNameBlacklistList=function(e){return this.internal_setRepeatedField(5,e)},proto.tflite.task.vision.ImageClassifierOptions.prototype.addClassNameBlacklist=function(e,t){return this.internal_addToRepeatedField(5,e,t)},proto.tflite.task.vision.ImageClassifierOptions.prototype.clearClassNameBlacklistList=function(){return this.internal_clearRepeatedField(5)},proto.tflite.task.vision.ImageClassifierOptions.prototype.getNumThreads=function(){return this.internal_getIntegerFieldWithDefault(13,-1)},proto.tflite.task.vision.ImageClassifierOptions.prototype.setNumThreads=function(e){return this.internal_setField(13,e)},proto.tflite.task.vision.ImageClassifierOptions.prototype.clearNumThreads=function(){return this.internal_clearField(13)},proto.tflite.task.vision.ImageClassifierOptions.prototype.hasNumThreads=function(){return this.internal_hasField(13)},proto.tflite.task.vision.ImageClassifierOptions.prototype.getComputeSettings=function(){return this.internal_getWrapperField(proto.tflite.proto.ComputeSettings,9)},proto.tflite.task.vision.ImageClassifierOptions.prototype.setComputeSettings=function(e){return this.internal_setWrapperField(9,e)},proto.tflite.task.vision.ImageClassifierOptions.prototype.clearComputeSettings=function(){return this.internal_clearWrapperField(9)},proto.tflite.task.vision.ImageClassifierOptions.prototype.hasComputeSettings=function(){return this.internal_hasField(9)},proto.tflite.task.vision.ImageClassifierOptions.internalDoNotUse$proto$tflite$task$vision$ImageClassifierOptions$getBinaryFieldsObject=function(){return{14:[jspb.internal.binary.readMessage,proto.tflite.task.core.BaseOptions,proto.tflite.task.core.BaseOptions.internalDoNotUse$proto$tflite$task$core$BaseOptions$getBinaryFieldsObject],10:[jspb.internal.binary.readMessage,proto.tflite.task.core.ExternalFile,proto.tflite.task.core.ExternalFile.internalDoNotUse$proto$tflite$task$core$ExternalFile$getBinaryFieldsObject],11:jspb.internal.binary.readString,2:jspb.internal.binary.readInt32,3:jspb.internal.binary.readFloat,4:jspb.internal.binary.readRepeatedString,5:jspb.internal.binary.readRepeatedString,13:jspb.internal.binary.readInt32,9:[jspb.internal.binary.readMessage,proto.tflite.proto.ComputeSettings,proto.tflite.proto.ComputeSettings.internalDoNotUse$proto$tflite$proto$ComputeSettings$getBinaryFieldsObject]}},proto.tflite.task.vision.ImageClassifierOptions.prototype.serializeBinary=function(){return jspb.internal.binary.serializeBinary(this,proto.tflite.task.vision.ImageClassifierOptions.serializeBinaryToWriter)},proto.tflite.task.vision.ImageClassifierOptions.serializeBinaryToWriter=function(e,t){jspb.internal.binary.writeMessage(t,e,14,proto.tflite.task.core.BaseOptions,proto.tflite.task.core.BaseOptions.serializeBinaryToWriter),jspb.internal.binary.writeMessage(t,e,10,proto.tflite.task.core.ExternalFile,proto.tflite.task.core.ExternalFile.serializeBinaryToWriter),jspb.internal.binary.writeString(t,e,11),jspb.internal.binary.writeInt32(t,e,2),jspb.internal.binary.writeFloat(t,e,3),jspb.internal.binary.writeRepeatedString(t,e,4),jspb.internal.binary.writeRepeatedString(t,e,5),jspb.internal.binary.writeInt32(t,e,13),jspb.internal.binary.writeMessage(t,e,9,proto.tflite.proto.ComputeSettings,proto.tflite.proto.ComputeSettings.serializeBinaryToWriter),jspb.internal.binary.serializeBinaryExtensionsAndUnknownFields(e,t)},proto.tflite.task.vision.ImageClassifierOptions.deserializeBinary=function(e){return jspb.internal.binary.deserializeBinary(e,proto.tflite.task.vision.ImageClassifierOptions,proto.tflite.task.vision.ImageClassifierOptions.internalDoNotUse$proto$tflite$task$vision$ImageClassifierOptions$getBinaryFieldsObject)},proto.tflite.task.vision.ImageClassifierOptions.deserializeBinaryFromReader=function(e,t){return module$contents$jspb$internal$binary_deserializeBinaryFromReaderGeneric(e,t,proto.tflite.task.vision.ImageClassifierOptions.internalDoNotUse$proto$tflite$task$vision$ImageClassifierOptions$getBinaryFieldsObject)},proto.tflite.task.vision.ImageClassifierOptions.deserialize=function(e){return module$exports$jspb.Message.deserializeWithCtor(proto.tflite.task.vision.ImageClassifierOptions,e)},proto.tflite.task.vision.ImageClassifierOptions.repeatedFields_=[4,5],proto.tflite.task.vision.ImageClassifierOptions.ObjectFormat=function(){},module$contents$jspb$internal$public_for_gencode_GENERATE_FROM_OBJECT&&(proto.tflite.task.vision.ImageClassifierOptions.fromObject=function(e){var t=new proto.tflite.task.vision.ImageClassifierOptions;return e.baseOptions&&t.internal_setWrapperField(14,proto.tflite.task.core.BaseOptions.fromObject(e.baseOptions)),e.modelFileWithMetadata&&t.internal_setWrapperField(10,proto.tflite.task.core.ExternalFile.fromObject(e.modelFileWithMetadata)),null!=e.displayNamesLocale&&t.internal_setField(11,e.displayNamesLocale),null!=e.maxResults&&t.internal_setField(2,e.maxResults),null!=e.scoreThreshold&&t.internal_setField(3,e.scoreThreshold),null!=e.classNameWhitelistList&&t.internal_setRepeatedField(4,e.classNameWhitelistList),null!=e.classNameBlacklistList&&t.internal_setRepeatedField(5,e.classNameBlacklistList),null!=e.numThreads&&t.internal_setField(13,e.numThreads),e.computeSettings&&t.internal_setWrapperField(9,proto.tflite.proto.ComputeSettings.fromObject(e.computeSettings)),t}),proto.tflite.task.vision.ImageClassifierOptions.prototype.toObject=function(e){return proto.tflite.task.vision.ImageClassifierOptions.internal_toObject(e,this)},proto.tflite.task.vision.ImageClassifierOptions.internal_toObject=function(e,t){if(null!=t){var n={baseOptions:proto.tflite.task.core.BaseOptions.internal_toObject(e,t.getBaseOptions()),modelFileWithMetadata:proto.tflite.task.core.ExternalFile.internal_toObject(e,t.getModelFileWithMetadata()),displayNamesLocale:t.internal_getStringFieldWithDefault(11,"en"),maxResults:t.internal_getIntegerFieldWithDefault(2,-1),scoreThreshold:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getFloatingPointField(3)),classNameWhitelistList:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getRepeatedField(4)),classNameBlacklistList:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getRepeatedField(5)),numThreads:t.internal_getIntegerFieldWithDefault(13,-1),computeSettings:proto.tflite.proto.ComputeSettings.internal_toObject(e,t.getComputeSettings())};return e&&(n.$jspbMessageInstance=t),n}},proto.tflite.task.vision.ImageSegmenterOptions=function(e){module$contents$jspb$internal$public_for_gencode_GeneratedMessage.call(this,e)},$jscomp.inherits(proto.tflite.task.vision.ImageSegmenterOptions,module$contents$jspb$internal$public_for_gencode_GeneratedMessage),proto.tflite.task.vision.ImageSegmenterOptions.prototype.getBaseOptions=function(){return this.internal_getWrapperField(proto.tflite.task.core.BaseOptions,8)},proto.tflite.task.vision.ImageSegmenterOptions.prototype.setBaseOptions=function(e){return
2 this.internal_setWrapperField(8,e)},proto.tflite.task.vision.ImageSegmenterOptions.prototype.clearBaseOptions=function(){return this.internal_clearWrapperField(8)},proto.tflite.task.vision.ImageSegmenterOptions.prototype.hasBaseOptions=function(){return this.internal_hasField(8)},proto.tflite.task.vision.ImageSegmenterOptions.prototype.getModelFileWithMetadata=function(){return this.internal_getWrapperField(proto.tflite.task.core.ExternalFile,5)},proto.tflite.task.vision.ImageSegmenterOptions.prototype.setModelFileWithMetadata=function(e){return this.internal_setWrapperField(5,e)},proto.tflite.task.vision.ImageSegmenterOptions.prototype.clearModelFileWithMetadata=function(){return this.internal_clearWrapperField(5)},proto.tflite.task.vision.ImageSegmenterOptions.prototype.hasModelFileWithMetadata=function(){return this.internal_hasField(5)},proto.tflite.task.vision.ImageSegmenterOptions.prototype.getDisplayNamesLocale=function(){return this.internal_getStringFieldWithDefault(6,"en")},proto.tflite.task.vision.ImageSegmenterOptions.prototype.setDisplayNamesLocale=function(e){return this.internal_setField(6,e)},proto.tflite.task.vision.ImageSegmenterOptions.prototype.clearDisplayNamesLocale=function(){return this.internal_clearField(6)},proto.tflite.task.vision.ImageSegmenterOptions.prototype.hasDisplayNamesLocale=function(){return this.internal_hasField(6)},proto.tflite.task.vision.ImageSegmenterOptions.prototype.getOutputType=function(){return this.internal_getFieldWithDefault(3,1)},proto.tflite.task.vision.ImageSegmenterOptions.prototype.setOutputType=function(e){return this.internal_setField(3,e)},proto.tflite.task.vision.ImageSegmenterOptions.prototype.clearOutputType=function(){return this.internal_clearField(3)},proto.tflite.task.vision.ImageSegmenterOptions.prototype.hasOutputType=function(){return this.internal_hasField(3)},proto.tflite.task.vision.ImageSegmenterOptions.prototype.getNumThreads=function(){return this.internal_getIntegerFieldWithDefault(7,-1)},proto.tflite.task.vision.ImageSegmenterOptions.prototype.setNumThreads=function(e){return this.internal_setField(7,e)},proto.tflite.task.vision.ImageSegmenterOptions.prototype.clearNumThreads=function(){return this.internal_clearField(7)},proto.tflite.task.vision.ImageSegmenterOptions.prototype.hasNumThreads=function(){return this.internal_hasField(7)},proto.tflite.task.vision.ImageSegmenterOptions.prototype.getComputeSettings=function(){return this.internal_getWrapperField(proto.tflite.proto.ComputeSettings,4)},proto.tflite.task.vision.ImageSegmenterOptions.prototype.setComputeSettings=function(e){return this.internal_setWrapperField(4,e)},proto.tflite.task.vision.ImageSegmenterOptions.prototype.clearComputeSettings=function(){return this.internal_clearWrapperField(4)},proto.tflite.task.vision.ImageSegmenterOptions.prototype.hasComputeSettings=function(){return this.internal_hasField(4)},proto.tflite.task.vision.ImageSegmenterOptions.internalDoNotUse$proto$tflite$task$vision$ImageSegmenterOptions$getBinaryFieldsObject=function(){return{8:[jspb.internal.binary.readMessage,proto.tflite.task.core.BaseOptions,proto.tflite.task.core.BaseOptions.internalDoNotUse$proto$tflite$task$core$BaseOptions$getBinaryFieldsObject],5:[jspb.internal.binary.readMessage,proto.tflite.task.core.ExternalFile,proto.tflite.task.core.ExternalFile.internalDoNotUse$proto$tflite$task$core$ExternalFile$getBinaryFieldsObject],6:jspb.internal.binary.readString,3:jspb.internal.binary.readEnum,7:jspb.internal.binary.readInt32,4:[jspb.internal.binary.readMessage,proto.tflite.proto.ComputeSettings,proto.tflite.proto.ComputeSettings.internalDoNotUse$proto$tflite$proto$ComputeSettings$getBinaryFieldsObject]}},proto.tflite.task.vision.ImageSegmenterOptions.prototype.serializeBinary=function(){return jspb.internal.binary.serializeBinary(this,proto.tflite.task.vision.ImageSegmenterOptions.serializeBinaryToWriter)},proto.tflite.task.vision.ImageSegmenterOptions.serializeBinaryToWriter=function(e,t){jspb.internal.binary.writeMessage(t,e,8,proto.tflite.task.core.BaseOptions,proto.tflite.task.core.BaseOptions.serializeBinaryToWriter),jspb.internal.binary.writeMessage(t,e,5,proto.tflite.task.core.ExternalFile,proto.tflite.task.core.ExternalFile.serializeBinaryToWriter),jspb.internal.binary.writeString(t,e,6),jspb.internal.binary.writeEnum(t,e,3),jspb.internal.binary.writeInt32(t,e,7),jspb.internal.binary.writeMessage(t,e,4,proto.tflite.proto.ComputeSettings,proto.tflite.proto.ComputeSettings.serializeBinaryToWriter),jspb.internal.binary.serializeBinaryExtensionsAndUnknownFields(e,t)},proto.tflite.task.vision.ImageSegmenterOptions.deserializeBinary=function(e){return jspb.internal.binary.deserializeBinary(e,proto.tflite.task.vision.ImageSegmenterOptions,proto.tflite.task.vision.ImageSegmenterOptions.internalDoNotUse$proto$tflite$task$vision$ImageSegmenterOptions$getBinaryFieldsObject)},proto.tflite.task.vision.ImageSegmenterOptions.deserializeBinaryFromReader=function(e,t){return module$contents$jspb$internal$binary_deserializeBinaryFromReaderGeneric(e,t,proto.tflite.task.vision.ImageSegmenterOptions.internalDoNotUse$proto$tflite$task$vision$ImageSegmenterOptions$getBinaryFieldsObject)},proto.tflite.task.vision.ImageSegmenterOptions.deserialize=function(e){return module$exports$jspb.Message.deserializeWithCtor(proto.tflite.task.vision.ImageSegmenterOptions,e)},proto.tflite.task.vision.ImageSegmenterOptions.ObjectFormat=function(){},module$contents$jspb$internal$public_for_gencode_GENERATE_FROM_OBJECT&&(proto.tflite.task.vision.ImageSegmenterOptions.fromObject=function(e){var t=new proto.tflite.task.vision.ImageSegmenterOptions;return e.baseOptions&&t.internal_setWrapperField(8,proto.tflite.task.core.BaseOptions.fromObject(e.baseOptions)),e.modelFileWithMetadata&&t.internal_setWrapperField(5,proto.tflite.task.core.ExternalFile.fromObject(e.modelFileWithMetadata)),null!=e.displayNamesLocale&&t.internal_setField(6,e.displayNamesLocale),null!=e.outputType&&t.internal_setField(3,e.outputType),null!=e.numThreads&&t.internal_setField(7,e.numThreads),e.computeSettings&&t.internal_setWrapperField(4,proto.tflite.proto.ComputeSettings.fromObject(e.computeSettings)),t}),proto.tflite.task.vision.ImageSegmenterOptions.prototype.toObject=function(e){return proto.tflite.task.vision.ImageSegmenterOptions.internal_toObject(e,this)},proto.tflite.task.vision.ImageSegmenterOptions.internal_toObject=function(e,t){if(null!=t){var n={baseOptions:proto.tflite.task.core.BaseOptions.internal_toObject(e,t.getBaseOptions()),modelFileWithMetadata:proto.tflite.task.core.ExternalFile.internal_toObject(e,t.getModelFileWithMetadata()),displayNamesLocale:t.internal_getStringFieldWithDefault(6,"en"),outputType:t.internal_getFieldWithDefault(3,1),numThreads:t.internal_getIntegerFieldWithDefault(7,-1),computeSettings:proto.tflite.proto.ComputeSettings.internal_toObject(e,t.getComputeSettings())};return e&&(n.$jspbMessageInstance=t),n}},proto.tflite.task.vision.ImageSegmenterOptions.OutputType={UNSPECIFIED:0,CATEGORY_MASK:1,CONFIDENCE_MASK:2},proto.tflite.task.vision.ObjectDetectorOptions=function(e){module$contents$jspb$internal$public_for_gencode_GeneratedMessage.call(this,e,-1,proto.tflite.task.vision.ObjectDetectorOptions.repeatedFields_)},$jscomp.inherits(proto.tflite.task.vision.ObjectDetectorOptions,module$contents$jspb$internal$public_for_gencode_GeneratedMessage),proto.tflite.task.vision.ObjectDetectorOptions.prototype.getBaseOptions=function(){return this.internal_getWrapperField(proto.tflite.task.core.BaseOptions,9)},proto.tflite.task.vision.ObjectDetectorOptions.prototype.setBaseOptions=function(e){return this.internal_setWrapperField(9,e)},proto.tflite.task.vision.ObjectDetectorOptions.prototype.clearBaseOptions=function(){return this.internal_clearWrapperField(9)},proto.tflite.task.vision.ObjectDetectorOptions.prototype.hasBaseOptions=function(){return this.internal_hasField(9)},proto.tflite.task.vision.ObjectDetectorOptions.prototype.getModelFileWithMetadata=function(){return this.internal_getWrapperField(proto.tflite.task.core.ExternalFile,1)},proto.tflite.task.vision.ObjectDetectorOptions.prototype.setModelFileWithMetadata=function(e){return this.internal_setWrapperField(1,e)},proto.tflite.task.vision.ObjectDetectorOptions.prototype.clearModelFileWithMetadata=function(){return this.internal_clearWrapperField(1)},proto.tflite.task.vision.ObjectDetectorOptions.prototype.hasModelFileWithMetadata=function(){return this.internal_hasField(1)},proto.tflite.task.vision.ObjectDetectorOptions.prototype.getDisplayNamesLocale=function(){return this.internal_getStringFieldWithDefault(2,"en")},proto.tflite.task.vision.ObjectDetectorOptions.prototype.setDisplayNamesLocale=function(e){return this.internal_setField(2,e)},proto.tflite.task.vision.ObjectDetectorOptions.prototype.clearDisplayNamesLocale=function(){return this.internal_clearField(2)},proto.tflite.task.vision.ObjectDetectorOptions.prototype.hasDisplayNamesLocale=function(){return this.internal_hasField(2)},proto.tflite.task.vision.ObjectDetectorOptions.prototype.getMaxResults=function(){return this.internal_getIntegerFieldWithDefault(3,-1)},proto.tflite.task.vision.ObjectDetectorOptions.prototype.setMaxResults=function(e){return this.internal_setField(3,e)},proto.tflite.task.vision.ObjectDetectorOptions.prototype.clearMaxResults=function(){return this.internal_clearField(3)},proto.tflite.task.vision.ObjectDetectorOptions.prototype.hasMaxResults=function(){return this.internal_hasField(3)},proto.tflite.task.vision.ObjectDetectorOptions.prototype.getScoreThreshold=function(){return this.internal_getFloatingPointFieldWithDefault(4)},proto.tflite.task.vision.ObjectDetectorOptions.prototype.setScoreThreshold=function(e){return this.internal_setField(4,e)},proto.tflite.task.vision.ObjectDetectorOptions.prototype.clearScoreThreshold=function(){return this.internal_clearField(4)},proto.tflite.task.vision.ObjectDetectorOptions.prototype.hasScoreThreshold=function(){return this.internal_hasField(4)},proto.tflite.task.vision.ObjectDetectorOptions.prototype.getClassNameWhitelistList=function(){return this.internal_getRepeatedField(5)},proto.tflite.task.vision.ObjectDetectorOptions.prototype.setClassNameWhitelistList=function(e){return this.internal_setRepeatedField(5,e)},proto.tflite.task.vision.ObjectDetectorOptions.prototype.addClassNameWhitelist=function(e,t){return this.internal_addToRepeatedField(5,e,t)},proto.tflite.task.vision.ObjectDetectorOptions.prototype.clearClassNameWhitelistList=function(){return this.internal_clearRepeatedField(5)},proto.tflite.task.vision.ObjectDetectorOptions.prototype.getClassNameBlacklistList=function(){return this.internal_getRepeatedField(6)},proto.tflite.task.vision.ObjectDetectorOptions.prototype.setClassNameBlacklistList=function(e){return this.internal_setRepeatedField(6,e)},proto.tflite.task.vision.ObjectDetectorOptions.prototype.addClassNameBlacklist=function(e,t){return this.internal_addToRepeatedField(6,e,t)},proto.tflite.task.vision.ObjectDetectorOptions.prototype.clearClassNameBlacklistList=function(){return this.internal_clearRepeatedField(6)},proto.tflite.task.vision.ObjectDetectorOptions.prototype.getNumThreads=function(){return this.internal_getIntegerFieldWithDefault(7,-1)},proto.tflite.task.vision.ObjectDetectorOptions.prototype.setNumThreads=function(e){return this.internal_setField(7,e)},proto.tflite.task.vision.ObjectDetectorOptions.prototype.clearNumThreads=function(){return this.internal_clearField(7)},proto.tflite.task.vision.ObjectDetectorOptions.prototype.hasNumThreads=function(){return this.internal_hasField(7)},proto.tflite.task.vision.ObjectDetectorOptions.prototype.getComputeSettings=function(){return this.internal_getWrapperField(proto.tflite.proto.ComputeSettings,8)},proto.tflite.task.vision.ObjectDetectorOptions.prototype.setComputeSettings=function(e){return this.internal_setWrapperField(8,e)},proto.tflite.task.vision.ObjectDetectorOptions.prototype.clearComputeSettings=function(){return this.internal_clearWrapperField(8)},proto.tflite.task.vision.ObjectDetectorOptions.prototype.hasComputeSettings=function(){return this.internal_hasField(8)},proto.tflite.task.vision.ObjectDetectorOptions.internalDoNotUse$proto$tflite$task$vision$ObjectDetectorOptions$getBinaryFieldsObject=function(){return{9:[jspb.internal.binary.readMessage,proto.tflite.task.core.BaseOptions,proto.tflite.task.core.BaseOptions.internalDoNotUse$proto$tflite$task$core$BaseOptions$getBinaryFieldsObject],1:[jspb.internal.binary.readMessage,proto.tflite.task.core.ExternalFile,proto.tflite.task.core.ExternalFile.internalDoNotUse$proto$tflite$task$core$ExternalFile$getBinaryFieldsObject],2:jspb.internal.binary.readString,3:jspb.internal.binary.readInt32,4:jspb.internal.binary.readFloat,5:jspb.internal.binary.readRepeatedString,6:jspb.internal.binary.readRepeatedString,7:jspb.internal.binary.readInt32,8:[jspb.internal.binary.readMessage,proto.tflite.proto.ComputeSettings,proto.tflite.proto.ComputeSettings.internalDoNotUse$proto$tflite$proto$ComputeSettings$getBinaryFieldsObject]}},proto.tflite.task.vision.ObjectDetectorOptions.prototype.serializeBinary=function(){return jspb.internal.binary.serializeBinary(this,proto.tflite.task.vision.ObjectDetectorOptions.serializeBinaryToWriter)},proto.tflite.task.vision.ObjectDetectorOptions.serializeBinaryToWriter=function(e,t){jspb.internal.binary.writeMessage(t,e,9,proto.tflite.task.core.BaseOptions,proto.tflite.task.core.BaseOptions.serializeBinaryToWriter),jspb.internal.binary.writeMessage(t,e,1,proto.tflite.task.core.ExternalFile,proto.tflite.task.core.ExternalFile.serializeBinaryToWriter),jspb.internal.binary.writeString(t,e,2),jspb.internal.binary.writeInt32(t,e,3),jspb.internal.binary.writeFloat(t,e,4),jspb.internal.binary.writeRepeatedString(t,e,5),jspb.internal.binary.writeRepeatedString(t,e,6),jspb.internal.binary.writeInt32(t,e,7),jspb.internal.binary.writeMessage(t,e,8,proto.tflite.proto.ComputeSettings,proto.tflite.proto.ComputeSettings.serializeBinaryToWriter),jspb.internal.binary.serializeBinaryExtensionsAndUnknownFields(e,t)},proto.tflite.task.vision.ObjectDetectorOptions.deserializeBinary=function(e){return jspb.internal.binary.deserializeBinary(e,proto.tflite.task.vision.ObjectDetectorOptions,proto.tflite.task.vision.ObjectDetectorOptions.internalDoNotUse$proto$tflite$task$vision$ObjectDetectorOptions$getBinaryFieldsObject)},proto.tflite.task.vision.ObjectDetectorOptions.deserializeBinaryFromReader=function(e,t){return module$contents$jspb$internal$binary_deserializeBinaryFromReaderGeneric(e,t,proto.tflite.task.vision.ObjectDetectorOptions.internalDoNotUse$proto$tflite$task$vision$ObjectDetectorOptions$getBinaryFieldsObject)},proto.tflite.task.vision.ObjectDetectorOptions.deserialize=function(e){return module$exports$jspb.Message.deserializeWithCtor(proto.tflite.task.vision.ObjectDetectorOptions,e)},proto.tflite.task.vision.ObjectDetectorOptions.repeatedFields_=[5,6],proto.tflite.task.vision.ObjectDetectorOptions.ObjectFormat=function(){},module$contents$jspb$internal$public_for_gencode_GENERATE_FROM_OBJECT&&(proto.tflite.task.vision.ObjectDetectorOptions.fromObject=function(e){var t=new proto.tflite.task.vision.ObjectDetectorOptions;return e.baseOptions&&t.internal_setWrapperField(9,proto.tflite.task.core.BaseOptions.fromObject(e.baseOptions)),e.modelFileWithMetadata&&t.internal_setWrapperField(1,proto.tflite.task.core.ExternalFile.fromObject(e.modelFileWithMetadata)),null!=e.displayNamesLocale&&t.internal_setField(2,e.displayNamesLocale),null!=e.maxResults&&t.internal_setField(3,e.maxResults),null!=e.scoreThreshold&&t.internal_setField(4,e.
2scoreThreshold),null!=e.classNameWhitelistList&&t.internal_setRepeatedField(5,e.classNameWhitelistList),null!=e.classNameBlacklistList&&t.internal_setRepeatedField(6,e.classNameBlacklistList),null!=e.numThreads&&t.internal_setField(7,e.numThreads),e.computeSettings&&t.internal_setWrapperField(8,proto.tflite.proto.ComputeSettings.fromObject(e.computeSettings)),t}),proto.tflite.task.vision.ObjectDetectorOptions.prototype.toObject=function(e){return proto.tflite.task.vision.ObjectDetectorOptions.internal_toObject(e,this)},proto.tflite.task.vision.ObjectDetectorOptions.internal_toObject=function(e,t){if(null!=t){var n={baseOptions:proto.tflite.task.core.BaseOptions.internal_toObject(e,t.getBaseOptions()),modelFileWithMetadata:proto.tflite.task.core.ExternalFile.internal_toObject(e,t.getModelFileWithMetadata()),displayNamesLocale:t.internal_getStringFieldWithDefault(2,"en"),maxResults:t.internal_getIntegerFieldWithDefault(3,-1),scoreThreshold:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getFloatingPointField(4)),classNameWhitelistList:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getRepeatedField(5)),classNameBlacklistList:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getRepeatedField(6)),numThreads:t.internal_getIntegerFieldWithDefault(7,-1),computeSettings:proto.tflite.proto.ComputeSettings.internal_toObject(e,t.getComputeSettings())};return e&&(n.$jspbMessageInstance=t),n}},proto.tflite.task.vision.Segmentation=function(e){module$contents$jspb$internal$public_for_gencode_GeneratedMessage.call(this,e,-1,proto.tflite.task.vision.Segmentation.repeatedFields_)},$jscomp.inherits(proto.tflite.task.vision.Segmentation,module$contents$jspb$internal$public_for_gencode_GeneratedMessage),proto.tflite.task.vision.Segmentation.prototype.getMaskOneofCase=function(){return this.internal_computeOneofCase(proto.tflite.task.vision.Segmentation.oneofGroup_MaskOneof_)},proto.tflite.task.vision.Segmentation.prototype.getCategoryMask=function(){return this.internal_getOneofStringFieldWithDefault(1,proto.tflite.task.vision.Segmentation.oneofGroup_MaskOneof_)},proto.tflite.task.vision.Segmentation.prototype.getCategoryMask_asB64=function(){return module$contents$jspb$internal_bytesAsB64(this.getCategoryMask())},proto.tflite.task.vision.Segmentation.prototype.getCategoryMask_asU8=function(){return module$contents$jspb$internal_bytesAsU8(this.getCategoryMask())},proto.tflite.task.vision.Segmentation.prototype.setCategoryMask=function(e){return this.internal_setOneofField(1,proto.tflite.task.vision.Segmentation.oneofGroup_MaskOneof_,e)},proto.tflite.task.vision.Segmentation.prototype.clearCategoryMask=function(){return this.internal_clearField(1)},proto.tflite.task.vision.Segmentation.prototype.hasCategoryMask=function(){return this.internal_hasOneofField(1,proto.tflite.task.vision.Segmentation.oneofGroup_MaskOneof_)},proto.tflite.task.vision.Segmentation.prototype.getConfidenceMasks=function(){return this.internal_getOneofWrapperField(proto.tflite.task.vision.Segmentation.ConfidenceMasks,4,proto.tflite.task.vision.Segmentation.oneofGroup_MaskOneof_)},proto.tflite.task.vision.Segmentation.prototype.setConfidenceMasks=function(e){return this.internal_setOneofWrapperField(4,proto.tflite.task.vision.Segmentation.oneofGroup_MaskOneof_,e)},proto.tflite.task.vision.Segmentation.prototype.clearConfidenceMasks=function(){return this.internal_clearWrapperField(4)},proto.tflite.task.vision.Segmentation.prototype.hasConfidenceMasks=function(){return this.internal_hasOneofField(4,proto.tflite.task.vision.Segmentation.oneofGroup_MaskOneof_)},proto.tflite.task.vision.Segmentation.prototype.getWidth=function(){return this.internal_getIntegerFieldWithDefault(2)},proto.tflite.task.vision.Segmentation.prototype.setWidth=function(e){return this.internal_setField(2,e)},proto.tflite.task.vision.Segmentation.prototype.clearWidth=function(){return this.internal_clearField(2)},proto.tflite.task.vision.Segmentation.prototype.hasWidth=function(){return this.internal_hasField(2)},proto.tflite.task.vision.Segmentation.prototype.getHeight=function(){return this.internal_getIntegerFieldWithDefault(3)},proto.tflite.task.vision.Segmentation.prototype.setHeight=function(e){return this.internal_setField(3,e)},proto.tflite.task.vision.Segmentation.prototype.clearHeight=function(){return this.internal_clearField(3)},proto.tflite.task.vision.Segmentation.prototype.hasHeight=function(){return this.internal_hasField(3)},proto.tflite.task.vision.Segmentation.prototype.getColoredLabelsList=function(){return this.internal_getRepeatedWrapperField(proto.tflite.task.vision.Segmentation.ColoredLabel,5)},proto.tflite.task.vision.Segmentation.prototype.setColoredLabelsList=function(e){return this.internal_setRepeatedWrapperField(5,e)},proto.tflite.task.vision.Segmentation.prototype.addColoredLabels=function(e,t){return this.internal_addToRepeatedWrapperField(5,e,proto.tflite.task.vision.Segmentation.ColoredLabel,t)},proto.tflite.task.vision.Segmentation.prototype.addAndReturnColoredLabels=function(e,t){return this.internal_addAndReturnRepeatedWrapperField(5,e,proto.tflite.task.vision.Segmentation.ColoredLabel,t)},proto.tflite.task.vision.Segmentation.prototype.clearColoredLabelsList=function(){return this.internal_clearRepeatedWrapperField(5)},proto.tflite.task.vision.Segmentation.internalDoNotUse$proto$tflite$task$vision$Segmentation$getBinaryFieldsObject=function(){return{1:[jspb.internal.binary.readBytesOneof,proto.tflite.task.vision.Segmentation.oneofGroup_MaskOneof_],4:[jspb.internal.binary.readMessageOneof,proto.tflite.task.vision.Segmentation.ConfidenceMasks,proto.tflite.task.vision.Segmentation.ConfidenceMasks.internalDoNotUse$proto$tflite$task$vision$Segmentation$ConfidenceMasks$getBinaryFieldsObject,proto.tflite.task.vision.Segmentation.oneofGroup_MaskOneof_],2:jspb.internal.binary.readInt32,3:jspb.internal.binary.readInt32,5:[jspb.internal.binary.readRepeatedMessage,proto.tflite.task.vision.Segmentation.ColoredLabel,proto.tflite.task.vision.Segmentation.ColoredLabel.
2internalDoNotUse$proto$tflite$task$vision$Segmentation$ColoredLabel$getBinaryFieldsObject]}},proto.tflite.task.vision.Segmentation.prototype.serializeBinary=function(){return jspb.internal.binary.serializeBinary(this,proto.tflite.task.vision.Segmentation.serializeBinaryToWriter)},proto.tflite.task.vision.Segmentation.serializeBinaryToWriter=function(e,t){jspb.internal.binary.writeBytes(t,e,1),jspb.internal.binary.writeMessage(t,e,4,proto.tflite.task.vision.Segmentation.ConfidenceMasks,proto.tflite.task.vision.Segmentation.ConfidenceMasks.serializeBinaryToWriter),jspb.internal.binary.writeInt32(t,e,2),jspb.internal.binary.writeInt32(t,e,3),jspb.internal.binary.writeRepeatedMessage(t,e,5,proto.tflite.task.vision.Segmentation.ColoredLabel,proto.tflite.task.vision.Segmentation.ColoredLabel.serializeBinaryToWriter),jspb.internal.binary.serializeBinaryExtensionsAndUnknownFields(e,t)},proto.tflite.task.vision.Segmentation.deserializeBinary=function(e){return jspb.internal.binary.deserializeBinary(e,proto.tflite.task.vision.Segmentation,proto.tflite.task.vision.Segmentation.internalDoNotUse$proto$tflite$task$vision$Segmentation$getBinaryFieldsObject)},proto.tflite.task.vision.Segmentation.deserializeBinaryFromReader=function(e,t){return module$contents$jspb$internal$binary_deserializeBinaryFromReaderGeneric(e,t,proto.tflite.task.vision.Segmentation.internalDoNotUse$proto$tflite$task$vision$Segmentation$getBinaryFieldsObject)},proto.tflite.task.vision.Segmentation.deserialize=function(e){return module$exports$jspb.Message.deserializeWithCtor(proto.tflite.task.vision.Segmentation,e)},proto.tflite.task.vision.Segmentation.ConfidenceMask=function(e){module$contents$jspb$internal$public_for_gencode_GeneratedMessage.call(this,e,-1,proto.tflite.task.vision.Segmentation.ConfidenceMask.repeatedFields_)},$jscomp.inherits(proto.tflite.task.vision.Segmentation.ConfidenceMask,module$contents$jspb$internal$public_for_gencode_GeneratedMessage),proto.tflite.task.vision.Segmentation.ConfidenceMask.prototype.getValueList=function(){return this.internal_getRepeatedFloatingPointField(1)},proto.tflite.task.vision.Segmentation.ConfidenceMask.prototype.setValueList=function(e){return this.internal_setRepeatedField(1,e)},proto.tflite.task.vision.Segmentation.ConfidenceMask.prototype.addValue=function(e,t){return this.internal_addToRepeatedField(1,e,t)},proto.tflite.task.vision.Segmentation.ConfidenceMask.prototype.clearValueList=function(){return this.internal_clearRepeatedField(1)},proto.tflite.task.vision.Segmentation.ConfidenceMask.internalDoNotUse$proto$tflite$task$vision$Segmentation$ConfidenceMask$getBinaryFieldsObject=function(){return{1:jspb.internal.binary.readPackableFloatInto}},proto.tflite.task.vision.Segmentation.ConfidenceMask.prototype.serializeBinary=function(){return jspb.internal.binary.serializeBinary(this,proto.tflite.task.vision.Segmentation.ConfidenceMask.serializeBinaryToWriter)},proto.tflite.task.vision.Segmentation.ConfidenceMask.serializeBinaryToWriter=function(e,t){jspb.internal.binary.writePackedFloat(t,e,1),jspb.internal.binary.serializeBinaryExtensionsAndUnknownFields(e,t)},proto.tflite.task.vision.Segmentation.ConfidenceMask.deserializeBinary=function(e){return jspb.internal.binary.deserializeBinary(e,proto.tflite.task.vision.Segmentation.ConfidenceMask,proto.tflite.task.vision.Segmentation.ConfidenceMask.internalDoNotUse$proto$tflite$task$vision$Segmentation$ConfidenceMask$getBinaryFieldsObject)},proto.tflite.task.vision.Segmentation.ConfidenceMask.deserializeBinaryFromReader=function(e,t){return module$contents$jspb$internal$binary_deserializeBinaryFromReaderGeneric(e,t,proto.tflite.task.vision.Segmentation.ConfidenceMask.internalDoNotUse$proto$tflite$task$vision$Segmentation$ConfidenceMask$getBinaryFieldsObject)},proto.tflite.task.vision.Segmentation.ConfidenceMask.deserialize=function(e){return module$exports$jspb.Message.deserializeWithCtor(proto.tflite.task.vision.Segmentation.ConfidenceMask,e)},proto.tflite.task.vision.Segmentation.ConfidenceMasks=function(e){module$contents$jspb$internal$public_for_gencode_GeneratedMessage.call(this,e,-1,proto.tflite.task.vision.Segmentation.ConfidenceMasks.repeatedFields_)},$jscomp.inherits(proto.tflite.task.vision.Segmentation.ConfidenceMasks,module$contents$jspb$internal$public_for_gencode_GeneratedMessage),proto.tflite.task.vision.Segmentation.ConfidenceMasks.prototype.getConfidenceMaskList=function(){return this.internal_getRepeatedWrapperField(proto.tflite.task.vision.Segmentation.ConfidenceMask,1)},proto.tflite.task.vision.Segmentation.ConfidenceMasks.prototype.setConfidenceMaskList=function(e){return this.internal_setRepeatedWrapperField(1,e)},proto.tflite.task.vision.Segmentation.ConfidenceMasks.prototype.addConfidenceMask=function(e,t){return this.internal_addToRepeatedWrapperField(1,e,proto.tflite.task.vision.Segmentation.ConfidenceMask,t)},proto.tflite.task.vision.Segmentation.ConfidenceMasks.prototype.addAndReturnConfidenceMask=function(e,t){return this.internal_addAndReturnRepeatedWrapperField(1,e,proto.tflite.task.vision.Segmentation.ConfidenceMask,t)},proto.tflite.task.vision.Segmentation.ConfidenceMasks.prototype.clearConfidenceMaskList=function(){return this.internal_clearRepeatedWrapperField(1)},proto.tflite.task.vision.Segmentation.ConfidenceMasks.internalDoNotUse$proto$tflite$task$vision$Segmentation$ConfidenceMasks$getBinaryFieldsObject=function(){return{1:[jspb.internal.binary.readRepeatedMessage,proto.tflite.task.vision.Segmentation.ConfidenceMask,proto.tflite.task.vision.Segmentation.ConfidenceMask.internalDoNotUse$proto$tflite$task$vision$Segmentation$ConfidenceMask$getBinaryFieldsObject]}},proto.tflite.task.vision.Segmentation.ConfidenceMasks.prototype.serializeBinary=function(){return jspb.internal.binary.serializeBinary(this,proto.tflite.task.vision.Segmentation.ConfidenceMasks.serializeBinaryToWriter)},proto.tflite.task.vision.Segmentation.ConfidenceMasks.serializeBinaryToWriter=function(e,t){jspb.internal.binary.writeRepeatedMessage(t,e,1,proto.tflite.task.vision.Segmentation.ConfidenceMask,proto.tflite.task.vision.Segmentation.ConfidenceMask.serializeBinaryToWriter),jspb.internal.binary.serializeBinaryExtensionsAndUnknownFields(e,t)},proto.tflite.task.vision.Segmentation.ConfidenceMasks.deserializeBinary=function(e){return jspb.internal.binary.deserializeBinary(e,proto.tflite.task.vision.Segmentation.ConfidenceMasks,proto.tflite.task.vision.Segmentation.ConfidenceMasks.internalDoNotUse$proto$tflite$task$vision$Segmentation$ConfidenceMasks$getBinaryFieldsObject)},proto.tflite.task.vision.Segmentation.ConfidenceMasks.deserializeBinaryFromReader=function(e,t){return module$contents$jspb$internal$binary_deserializeBinaryFromReaderGeneric(e,t,proto.tflite.task.vision.Segmentation.ConfidenceMasks.internalDoNotUse$proto$tflite$task$vision$Segmentation$ConfidenceMasks$getBinaryFieldsObject)},proto.tflite.task.vision.Segmentation.ConfidenceMasks.deserialize=function(e){return module$exports$jspb.Message.deserializeWithCtor(proto.tflite.task.vision.Segmentation.ConfidenceMasks,e)},proto.tflite.task.vision.Segmentation.ColoredLabel=function(e){module$contents$jspb$internal$public_for_gencode_GeneratedMessage.call(this,e)},$jscomp.inherits(proto.tflite.task.vision.Segmentation.ColoredLabel,module$contents$jspb$internal$public_for_gencode_GeneratedMessage),proto.tflite.task.vision.Segmentation.ColoredLabel.prototype.getR=function(){return this.internal_getIntegerFieldWithDefault(1)},proto.tflite.task.vision.Segmentation.ColoredLabel.prototype.setR=function(e){return this.internal_setField(1,e)},proto.tflite.task.vision.Segmentation.ColoredLabel.prototype.clearR=function(){return this.internal_clearField(1)},proto.tflite.task.vision.Segmentation.ColoredLabel.prototype.hasR=function(){return this.internal_hasField(1)},proto.tflite.task.vision.Segmentation.ColoredLabel.prototype.getG=function(){return this.internal_getIntegerFieldWithDefault(2)},proto.tflite.task.vision.Segmentation.ColoredLabel.prototype.setG=function(e){return this.internal_setField(2,e)},proto.tflite.task.vision.Segmentation.ColoredLabel.prototype.clearG=function(){return this.internal_clearField(2)},proto.tflite.task.vision.Segmentation.ColoredLabel.prototype.hasG=function(){return this.internal_hasField(2)},proto.tflite.task.vision.Segmentation.ColoredLabel.prototype.getB=function(){return this.internal_getIntegerFieldWithDefault(3)},proto.tflite.task.vision.Segmentation.ColoredLabel.prototype.setB=function(e){return this.internal_setField(3,e)},proto.tflite.task.vision.Segmentation.ColoredLabel.prototype.clearB=function(){return this.internal_clearField(3)},proto.tflite.task.vision.Segmentation.ColoredLabel.prototype.hasB=function(){return this.internal_hasField(3)},proto.tflite.task.vision.Segmentation.ColoredLabel.prototype.getClassName=function(){return this.internal_getStringFieldWithDefault(4)},proto.tflite.task.vision.Segmentation.ColoredLabel.prototype.setClassName=function(e){return this.internal_setField(4,e)},proto.tflite.task.vision.Segmentation.ColoredLabel.prototype.clearClassName=function(){return this.internal_clearField(4)},proto.tflite.task.vision.Segmentation.ColoredLabel.prototype.hasClassName=function(){return this.internal_hasField(4)},proto.tflite.task.vision.Segmentation.ColoredLabel.prototype.getDisplayName=function(){return this.internal_getStringFieldWithDefault(5)},proto.tflite.task.vision.Segmentation.ColoredLabel.prototype.setDisplayName=function(e){return this.internal_setField(5,e)},proto.tflite.task.vision.Segmentation.ColoredLabel.prototype.clearDisplayName=function(){return this.internal_clearField(5)},proto.tflite.task.vision.Segmentation.ColoredLabel.prototype.hasDisplayName=function(){return this.internal_hasField(5)}
2,proto.tflite.task.vision.Segmentation.ColoredLabel.internalDoNotUse$proto$tflite$task$vision$Segmentation$ColoredLabel$getBinaryFieldsObject=function(){return{1:jspb.internal.binary.readUint32,2:jspb.internal.binary.readUint32,3:jspb.internal.binary.readUint32,4:jspb.internal.binary.readString,5:jspb.internal.binary.readString}},proto.tflite.task.vision.Segmentation.ColoredLabel.prototype.serializeBinary=function(){return jspb.internal.binary.serializeBinary(this,proto.tflite.task.vision.Segmentation.ColoredLabel.serializeBinaryToWriter)},proto.tflite.task.vision.Segmentation.ColoredLabel.serializeBinaryToWriter=function(e,t){jspb.internal.binary.writeUint32(t,e,1),jspb.internal.binary.writeUint32(t,e,2),jspb.internal.binary.writeUint32(t,e,3),jspb.internal.binary.writeString(t,e,4),jspb.internal.binary.writeString(t,e,5),jspb.internal.binary.serializeBinaryExtensionsAndUnknownFields(e,t)},proto.tflite.task.vision.Segmentation.ColoredLabel.deserializeBinary=function(e){return jspb.internal.binary.deserializeBinary(e,proto.tflite.task.vision.Segmentation.ColoredLabel,proto.tflite.task.vision.Segmentation.ColoredLabel.internalDoNotUse$proto$tflite$task$vision$Segmentation$ColoredLabel$getBinaryFieldsObject)},proto.tflite.task.vision.Segmentation.ColoredLabel.deserializeBinaryFromReader=function(e,t){return module$contents$jspb$internal$binary_deserializeBinaryFromReaderGeneric(e,t,proto.tflite.task.vision.Segmentation.ColoredLabel.internalDoNotUse$proto$tflite$task$vision$Segmentation$ColoredLabel$getBinaryFieldsObject)},proto.tflite.task.vision.Segmentation.ColoredLabel.deserialize=function(e){return module$exports$jspb.Message.deserializeWithCtor(proto.tflite.task.vision.Segmentation.ColoredLabel,e)},proto.tflite.task.vision.Segmentation.repeatedFields_=[5],proto.tflite.task.vision.Segmentation.oneofGroup_MaskOneof_=[1,4],proto.tflite.task.vision.Segmentation.MaskOneofCase={MASK_ONEOF_NOT_SET:0,CATEGORY_MASK:1,CONFIDENCE_MASKS:4},proto.tflite.task.vision.Segmentation.ObjectFormat=function(){},module$contents$jspb$internal$public_for_gencode_GENERATE_FROM_OBJECT&&(proto.tflite.task.vision.Segmentation.fromObject=function(e){var t=new proto.tflite.task.vision.Segmentation;return null!=e.categoryMask&&t.internal_setOneofField(1,proto.tflite.task.vision.Segmentation.oneofGroup_MaskOneof_,e.categoryMask),e.confidenceMasks&&t.internal_setOneofWrapperField(4,proto.tflite.task.vision.Segmentation.oneofGroup_MaskOneof_,proto.tflite.task.vision.Segmentation.ConfidenceMasks.fromObject(e.confidenceMasks)),null!=e.width&&t.internal_setField(2,e.width),null!=e.height&&t.internal_setField(3,e.height),e.coloredLabelsList&&t.internal_setRepeatedWrapperField(5,e.coloredLabelsList.map(proto.tflite.task.vision.Segmentation.ColoredLabel.fromObject)),t}),proto.tflite.task.vision.Segmentation.prototype.toObject=function(e){return proto.tflite.task.vision.Segmentation.internal_toObject(e,this)},proto.tflite.task.vision.Segmentation.internal_toObject=function(e,t){if(null!=t){var n={categoryMask:t.getCategoryMask_asB64(),confidenceMasks:proto.tflite.task.vision.Segmentation.ConfidenceMasks.internal_toObject(e,t.getConfidenceMasks()),width:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(2)),height:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(3)),coloredLabelsList:module$contents$jspb$internal$public_for_gencode_toObjectList(t.getColoredLabelsList(),proto.tflite.task.vision.Segmentation.ColoredLabel.internal_toObject,e)};return e&&(n.$jspbMessageInstance=t),n}},proto.tflite.task.vision.Segmentation.ConfidenceMask.repeatedFields_=[1],proto.tflite.task.vision.Segmentation.ConfidenceMask.ObjectFormat=function(){},module$contents$jspb$internal$public_for_gencode_GENERATE_FROM_OBJECT&&(proto.tflite.task.vision.Segmentation.ConfidenceMask.fromObject=function(e){var t=new proto.tflite.task.vision.Segmentation.ConfidenceMask;return null!=e.valueList&&t.internal_setRepeatedField(1,e.valueList),t}),proto.tflite.task.vision.Segmentation.ConfidenceMask.prototype.toObject=function(e){return proto.tflite.task.vision.Segmentation.ConfidenceMask.internal_toObject(e,this)},proto.tflite.task.vision.Segmentation.ConfidenceMask.internal_toObject=function(e,t){if(null!=t){var n={valueList:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getRepeatedFloatingPointField(1))};return e&&(n.$jspbMessageInstance=t),n}},proto.tflite.task.vision.Segmentation.ConfidenceMasks.repeatedFields_=[1],proto.tflite.task.vision.Segmentation.ConfidenceMasks.ObjectFormat=function(){},module$contents$jspb$internal$public_for_gencode_GENERATE_FROM_OBJECT&&(proto.tflite.task.vision.Segmentation.ConfidenceMasks.fromObject=function(e){var t=new proto.tflite.task.vision.Segmentation.ConfidenceMasks;return e.confidenceMaskList&&t.internal_setRepeatedWrapperField(1,e.confidenceMaskList.map(proto.tflite.task.vision.Segmentation.ConfidenceMask.fromObject)),t}),proto.tflite.task.vision.Segmentation.ConfidenceMasks.prototype.toObject=function(e){return proto.tflite.task.vision.Segmentation.ConfidenceMasks.internal_toObject(e,this)},proto.tflite.task.vision.Segmentation.ConfidenceMasks.internal_toObject=function(e,t){if(null!=t){var n={confidenceMaskList:module$contents$jspb$internal$public_for_gencode_toObjectList(t.getConfidenceMaskList(),proto.tflite.task.vision.Segmentation.ConfidenceMask.internal_toObject,e)};return e&&(n.$jspbMessageInstance=t),n}},proto.tflite.task.vision.Segmentation.ColoredLabel.ObjectFormat=function(){},module$contents$jspb$internal$public_for_gencode_GENERATE_FROM_OBJECT&&(proto.tflite.task.vision.Segmentation.ColoredLabel.fromObject=function(e){var t=new proto.tflite.task.vision.Segmentation.ColoredLabel;return null!=e.r&&t.internal_setField(1,e.r),null!=e.g&&t.internal_setField(2,e.g),null!=e.b&&t.internal_setField(3,e.b),null!=e.className&&t.internal_setField(4,e.className),null!=e.displayName&&t.internal_setField(5,e.displayName),t}),proto.tflite.task.vision.Segmentation.ColoredLabel.prototype.toObject=function(e){return proto.tflite.task.vision.Segmentation.ColoredLabel.
vendor: 18,272 bytes, line 2
2internal_toObject(e,this)},proto.tflite.task.vision.Segmentation.ColoredLabel.internal_toObject=function(e,t){if(null!=t){var n={r:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(1)),g:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(2)),b:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(3)),className:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(4)),displayName:module$contents$jspb$internal$public_for_gencode_toObjectPrimitive(t.internal_getField(5))};return e&&(n.$jspbMessageInstance=t),n}},proto.tflite.task.vision.SegmentationResult=function(e){module$contents$jspb$internal$public_for_gencode_GeneratedMessage.call(this,e,-1,proto.tflite.task.vision.SegmentationResult.repeatedFields_)},$jscomp.inherits(proto.tflite.task.vision.SegmentationResult,module$contents$jspb$internal$public_for_gencode_GeneratedMessage),proto.tflite.task.vision.SegmentationResult.prototype.getSegmentationList=function(){return this.internal_getRepeatedWrapperField(proto.tflite.task.vision.Segmentation,1)},proto.tflite.task.vision.SegmentationResult.prototype.setSegmentationList=function(e){return this.internal_setRepeatedWrapperField(1,e)},proto.tflite.task.vision.SegmentationResult.prototype.addSegmentation=function(e,t){return this.internal_addToRepeatedWrapperField(1,e,proto.tflite.task.vision.Segmentation,t)},proto.tflite.task.vision.SegmentationResult.prototype.addAndReturnSegmentation=function(e,t){return this.internal_addAndReturnRepeatedWrapperField(1,e,proto.tflite.task.vision.Segmentation,t)},proto.tflite.task.vision.SegmentationResult.prototype.clearSegmentationList=function(){return this.internal_clearRepeatedWrapperField(1)},proto.tflite.task.vision.SegmentationResult.internalDoNotUse$proto$tflite$task$vision$SegmentationResult$getBinaryFieldsObject=function(){return{1:[jspb.internal.binary.readRepeatedMessage,proto.tflite.task.vision.Segmentation,proto.tflite.task.vision.Segmentation.internalDoNotUse$proto$tflite$task$vision$Segmentation$getBinaryFieldsObject]}},proto.tflite.task.vision.SegmentationResult.prototype.serializeBinary=function(){return jspb.internal.binary.serializeBinary(this,proto.tflite.task.vision.SegmentationResult.serializeBinaryToWriter)},proto.tflite.task.vision.SegmentationResult.serializeBinaryToWriter=function(e,t){jspb.internal.binary.writeRepeatedMessage(t,e,1,proto.tflite.task.vision.Segmentation,proto.tflite.task.vision.Segmentation.serializeBinaryToWriter),jspb.internal.binary.serializeBinaryExtensionsAndUnknownFields(e,t)},proto.tflite.task.vision.SegmentationResult.deserializeBinary=function(e){return jspb.internal.binary.deserializeBinary(e,proto.tflite.task.vision.SegmentationResult,proto.tflite.task.vision.SegmentationResult.internalDoNotUse$proto$tflite$task$vision$SegmentationResult$getBinaryFieldsObject)},proto.tflite.task.vision.SegmentationResult.deserializeBinaryFromReader=function(e,t){return module$contents$jspb$internal$binary_deserializeBinaryFromReaderGeneric(e,t,proto.tflite.task.vision.SegmentationResult.internalDoNotUse$proto$tflite$task$vision$SegmentationResult$getBinaryFieldsObject)},proto.tflite.task.vision.SegmentationResult.deserialize=function(e){return module$exports$jspb.Message.deserializeWithCtor(proto.tflite.task.vision.SegmentationResult,e)},proto.tflite.task.vision.SegmentationResult.repeatedFields_=[1],proto.tflite.task.vision.SegmentationResult.ObjectFormat=function(){},module$contents$jspb$internal$public_for_gencode_GENERATE_FROM_OBJECT&&(proto.tflite.task.vision.SegmentationResult.fromObject=function(e){var t=new proto.tflite.task.vision.SegmentationResult;return e.segmentationList&&t.internal_setRepeatedWrapperField(1,e.segmentationList.map(proto.tflite.task.vision.Segmentation.fromObject)),t}),proto.tflite.task.vision.SegmentationResult.prototype.toObject=function(e){return proto.tflite.task.vision.SegmentationResult.internal_toObject(e,this)},proto.tflite.task.vision.SegmentationResult.internal_toObject=function(e,t){if(null!=t){var n={segmentationList:module$contents$jspb$internal$public_for_gencode_toObjectList(t.getSegmentationList(),proto.tflite.task.vision.Segmentation.internal_toObject,e)};return e&&(n.$jspbMessageInstance=t),n}};var module$exports$google3$third_party$tensorflow_lite_support$web$task$codegen$common$utils={},module$contents$google3$third_party$tensorflow_lite_support$web$task$codegen$common$utils_WASM_SIMD_CHECK=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]),module$contents$google3$third_party$tensorflow_lite_support$web$task$codegen$common$utils_WASM_MULTI_THREADED_CHECK=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]),module$contents$google3$third_party$tensorflow_lite_support$web$task$codegen$common$utils_wasmFeatures=void 0;module$exports$google3$third_party$tensorflow_lite_support$web$task$codegen$common$utils.convertCppVectorToArray=function(e){if(null==e)return[];for(var t=[],n=0;n<e.size();n++){var r=e.get(n);t.push(r)}return t},module$exports$google3$third_party$tensorflow_lite_support$web$task$codegen$common$utils.callAndDelete=function(e,t){try{return t(e)}finally{null!=e&&e.delete()}},module$exports$google3$third_party$tensorflow_lite_support$web$task$codegen$common$utils.callWithStatusOrAndDelete=function(e,t,n){try{if(!e.ok())throw Error(t+e.errorMessage());return n(e.value())}finally{e.delete()}};var module$contents$google3$third_party$tensorflow_lite_support$web$task$codegen$common$utils_fromPixels2DContext=null;function module$contents$google3$third_party$tensorflow_lite_support$web$task$codegen$common$utils_isSupportedSimd(){return $jscomp.asyncExecutePromiseGeneratorProgram(function(e){switch(e.nextAddress){case 1:return e.setCatchFinallyBlocks(2),e.yield(WebAssembly.instantiate(module$contents$google3$third_party$tensorflow_lite_support$web$task$codegen$common$utils_WASM_SIMD_CHECK),4);case 4:e.leaveTryBlock(3);break;case 2:return e.enterCatchBlock(),e.return(!1);case 3:return e.return(!0)}})}function module$contents$google3$third_party$tensorflow_lite_support$web$task$codegen$common$utils_isSupportedMultiThreaded(){return $jscomp.asyncExecutePromiseGeneratorProgram(function(e){switch(e.nextAddress){case 1:return e.setCatchFinallyBlocks(2),(new MessageChannel).port1.postMessage(new SharedArrayBuffer(1)),e.yield(WebAssembly.instantiate(module$contents$google3$third_party$tensorflow_lite_support$web$task$codegen$common$utils_WASM_MULTI_THREADED_CHECK),4);case 4:e.leaveTryBlock(3);break;case 2:return e.enterCatchBlock(),e.return(!1);case 3:return e.return(!0)}})}module$exports$google3$third_party$tensorflow_lite_support$web$task$codegen$common$utils.fromPixels=function(e){if(null==e)throw Error("pixels passed to fromPixels() can not be null");var t=!1,n=!1,r=!1,o=!1;if("undefined"!=typeof ImageData&&e instanceof ImageData)t=!0;else if("undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement)n=!0;else if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement)r=!0;else{if(null==e.getContext)throw Error("pixels passed to 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);o=!0}if(n&&n&&2>e.readyState)throw Error("The video element has not loaded data yet. Please wait for `loadeddata` event on the <video> element.");var i=$jscomp.makeIterator(n?[e.videoWidth,e.videoHeight]:[e.width,e.height]),a=i.next().value;if(i=i.next().value,o)var s=e.getContext("2d").getImageData(0,0,a,i).data;else t?s=e.data:(r||n)&&(null==module$contents$google3$third_party$tensorflow_lite_support$web$task$codegen$common$utils_fromPixels2DContext&&(module$contents$google3$third_party$tensorflow_lite_support$web$task$codegen$common$utils_fromPixels2DContext=document.createElement("canvas").getContext("2d")),module$contents$google3$third_party$tensorflow_lite_support$web$task$codegen$common$utils_fromPixels2DContext.canvas.width=a,module$contents$google3$third_party$tensorflow_lite_support$web$task$codegen$common$utils_fromPixels2DContext.canvas.height=i,module$contents$google3$third_party$tensorflow_lite_support$web$task$codegen$common$utils_fromPixels2DContext.drawImage(e,0,0,a,i),s=module$contents$google3$third_party$tensorflow_lite_support$web$task$codegen$common$utils_fromPixels2DContext.getImageData(0,0,a,i).data);return{vals:s,width:a,height:i}},module$exports$google3$third_party$tensorflow_lite_support$web$task$codegen$common$utils.getWasmFeatures=function(){var e,t,n,r,o;return $jscomp.asyncExecutePromiseGeneratorProgram(function(i){return 1==i.nextAddress?module$contents$google3$third_party$tensorflow_lite_support$web$task$codegen$common$utils_wasmFeatures?i.jumpTo(2):(t=(e=$jscomp).makeIterator,i.yield(Promise.all([module$contents$google3$third_party$tensorflow_lite_support$web$task$codegen$common$utils_isSupportedSimd(),module$contents$google3$third_party$tensorflow_lite_support$web$task$codegen$common$utils_isSupportedMultiThreaded()]),3)):(2!=i.nextAddress&&(n=t.call(e,i.yieldResult),r=n.next().value,o=n.next().value,module$contents$google3$third_party$tensorflow_lite_support$web$task$codegen$common$utils_wasmFeatures={simd:r,multiThreading:o}),i.return(module$contents$google3$third_party$tensorflow_lite_support$web$task$codegen$common$utils_wasmFeatures))})};var module$exports$google3$third_party$tensorflow_lite_support$web$task$codegen$common$emscripten_module_loader={EmscriptenModuleLoader:function(e,t,n){this.wasmModulesPath=e,this.tfliteWebApiName=t,this.wasmWebWorkerObjectURL=n,this.scriptSrc="",this.scriptSrc=!this.isWebWorker()&&document.currentScript&&document.currentScript.getAttribute("src")||""}};module$exports$google3$third_party$tensorflow_lite_support$web$task$codegen$common$emscripten_module_loader.EmscriptenModuleLoader.getInstance=function(e,t,n){var r=e+t;return n=URL.createObjectURL(new Blob([n],{type:"application/javascript"})),module$exports$google3$third_party$tensorflow_lite_support$web$task$codegen$common$emscripten_module_loader.EmscriptenModuleLoader.instances.has(r)||(e=new module$exports$google3$third_party$tensorflow_lite_support$web$task$codegen$common$emscripten_module_loader.EmscriptenModuleLoader(e,t,n),module$exports$google3$third_party$tensorflow_lite_support$web$task$codegen$common$emscripten_module_loader.EmscriptenModuleLoader.instances.set(r,e)),module$exports$google3$third_party$tensorflow_lite_support$web$task$codegen$common$emscripten_module_loader.EmscriptenModuleLoader.instances.get(r)},module$exports$google3$third_party$tensorflow_lite_support$web$task$codegen$common$emscripten_module_loader.EmscriptenModuleLoader.prototype.load=function(e){return this.loadPromise||(this.loadPromise=this.loadModule(void 0!==e&&e)),this.loadPromise},module$exports$google3$third_party$tensorflow_lite_support$web$task$codegen$common$emscripten_module_loader.EmscriptenModuleLoader.prototype.loadModule=function(e){e=void 0!==e&&e;var t,n,r,o,i,a,s,l,u,p,c,d,h,f,g=this;return $jscomp.asyncExecutePromiseGeneratorProgram(function(m){return 1==m.nextAddress?m.yield(g.genFullLoaderUrl(),2):3!=m.nextAddress?((t=m.yieldResult).startsWith("http")||(t.startsWith("/")?t=g.scriptSrc.startsWith("http")?""+(0,goog.uri.utils.getHost)(g.scriptSrc)+t:""+g.getLocation().origin+t:e?g.scriptSrc.startsWith("http")?(n=g.scriptSrc.lastIndexOf("/"),r=g.scriptSrc.substring(0,n),t=r+"/"+t):g.scriptSrc.startsWith("/")?(o=g.scriptSrc.lastIndexOf("/"),i=g.scriptSrc.substring(0,o),t=""+g.getLocation().origin+i+"/"+t):(a=g.getLocation().href.lastIndexOf("/"),s=g.getLocation().href.substring(0,a),0>(l=g.scriptSrc.lastIndexOf("/"))?t=s+"/"+t:(u=g.scriptSrc.substring(0,l),t=s+"/"+u+"/"+t)):(p=g.getLocation().href,c=p.lastIndexOf("/"),d=p.substring(0,c),t=d+"/"+t)),h=!0,m.yield(g.loadScript(t).catch(function(){h=!1}),3)):h?(f=g.isWebWorker()?self:window,m.return(f[g.tfliteWebApiName+"_ModuleFactory"]({mainScriptUrlOrBlob:t,locateFile:function(e,n){if(e.endsWith(".worker.js"))return g.wasmWebWorkerObjectURL;if(g.isWebWorker()&&e.endsWith(".wasm")){n="";var r=t.lastIndexOf("/");return 0<=r&&(n=t.substring(0,r+1)),n+e}return n+e}}))):m.return(void 0)})},module$exports$google3$third_party$tensorflow_lite_support$web$task$codegen$common$emscripten_module_loader.EmscriptenModuleLoader.prototype.genFullLoaderUrl=function(){var e,t,n,r,o=this;return $jscomp.asyncExecutePromiseGeneratorProgram(function(i){return 1==i.nextAddress?(e=[o.wasmModulesPath,o.tfliteWebApiName,"_cc"],i.yield((0,module$exports$google3$third_party$tensorflow_lite_support$web$task$codegen$common$utils.getWasmFeatures)(),2)):(t=i.yieldResult,n=t.simd,r=t.multiThreading,n&&r?e.push("_simd_threaded.js"):!n&&r?e.push("_threaded.js"):n&&!r?e.push("_simd.js"):e.push(".js"),i.return(e.join("")))})},module$exports$google3$third_party$tensorflow_lite_support$web$task$codegen$common$emscripten_module_loader.EmscriptenModuleLoader.prototype.loadScript=function(e){var t,n,r=this;return $jscomp.asyncExecutePromiseGeneratorProgram(function(o){return r.isWebWorker()?(importScripts(e),o.jumpTo(0)):((t=document.createElement("script")).setAttribute("id",r.tfliteWebApiName+"_loader_script"),n=new Promise(function(e,n){t.onerror=function(){n(),document.head.removeChild(t)},t.onload=e}),document.head.appendChild(t),t.setAttribute("src",e),o.yield(n,0))})},module$exports$google3$third_party$tensorflow_lite_support$web$task$codegen$common$emscripten_module_loader.EmscriptenModuleLoader.prototype.getLocation=function(){if(this.isWebWorker()){var e=self.location;return{origin:e.origin,href:e=e.href.replace("blob:","")}}return window.location},module$exports$google3$third_party$tensorflow_lite_support$web$task$codegen$common$emscripten_module_loader.EmscriptenModuleLoader.prototype.isWebWorker=function(){return"undefined"==typeof window},module$exports$google3$third_party$tensorflow_lite_support$web$task$codegen$common$emscripten_module_loader.EmscriptenModuleLoader.instances=new Map;var module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client={};module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.getWasmFeatures=module$exports$google3$third_party$tensorflow_lite_support$web$task$codegen$common$utils.getWasmFeatures;var module$contents$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client_wasmModulesPath="";function module$contents$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client_setWasmPath(e){module$contents$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client_wasmModulesPath=e}module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.setWasmPath=module$contents$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client_setWasmPath,module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.BertNLClassifier=function(e,t,n){this.module=e,this.memOffsetsToFree=t,this.cppClassifier=n},module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.BertNLClassifier.create=function(e,t){var n,r,o,i,a,s,l,u,p,c;return t=void 0===t?new proto.tflite.task.text.BertNLClassifierOptions:t,$jscomp.asyncExecutePromiseGeneratorProgram(function(d){if(1==d.nextAddress)return n=module$exports$google3$third_party$tensorflow_lite_support$web$task$codegen$common$emscripten_module_loader.EmscriptenModuleLoader.getInstance(module$contents$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client_wasmModulesPath,"tflite_web_api",'"use strict";var Module={};var initializedJS=false;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;self.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};self.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)}tflite_web_api_ModuleFactory(Module).then(function(instance){Module=instance})}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["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();if(!initializedJS){Module["___embind_register_native_and_builtin_types"]();initializedJS=true}try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["__emscripten_thread_exit"](result)}}catch(ex){if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["__emscripten_thread_exit"](ex.status)}}else{throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["__emscripten_thread_exit"](-1)}postMessage({"cmd":"cancelDone"})}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}};\n'),o=(r=$jscomp).makeIterator,d.yield(Promise.all([n.load(),"string"==typeof e?fetch(e).then(function(e){return e.arrayBuffer()}):Promise.resolve(e)]),2);
2if(i=o.call(r,d.yieldResult),a=i.next().value,s=i.next().value,l=a,u=new Uint8Array(s),p=l._malloc(u.length),l.HEAPU8.set(u,p),null==(c=(0,module$exports$google3$third_party$tensorflow_lite_support$web$task$codegen$common$utils.callAndDelete)(new l.BertNLClassifierOptionsCppProto,function(e){if(null!=e)return e.initFromJsProto(t),l.BertNLClassifier.CreateFromOptions(p,u.length,e)}))||!c.ok())throw Error("Failed to create BertNLClassifier: "+(null==c?void 0:c.errorMessage()));return d.return(new module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.BertNLClassifier(l,[p],c.value()))})},module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.BertNLClassifier.prototype.classify=function(e){if(null!=this.cppClassifier)return e=this.cppClassifier.Classify(e),(0,module$exports$google3$third_party$tensorflow_lite_support$web$task$codegen$common$utils.callAndDelete)(e,function(e){return(0,module$exports$google3$third_party$tensorflow_lite_support$web$task$codegen$common$utils.convertCppVectorToArray)(e)})},module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.BertNLClassifier.prototype.cleanUp=function(){if(null!=this.cppClassifier){for(var e=$jscomp.makeIterator(this.memOffsetsToFree),t=e.next();!t.done;t=e.next())this.module._free(t.value);this.cppClassifier.delete()}},goog.exportSymbol("tfweb.BertNLClassifierOptions",proto.tflite.task.text.BertNLClassifierOptions),goog.exportSymbol("tfweb.BertNLClassifierOptions.prototype.serializeBinary",proto.tflite.task.text.BertNLClassifierOptions.prototype.serializeBinary),goog.exportSymbol("tfweb.BertNLClassifier",module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.BertNLClassifier),goog.exportSymbol("tfweb.BertNLClassifier.create",module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.BertNLClassifier.create),goog.exportSymbol("tfweb.BertNLClassifier.prototype.classify",module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.BertNLClassifier.prototype.classify),goog.exportSymbol("tfweb.BertNLClassifier.prototype.cleanUp",module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.BertNLClassifier.prototype.cleanUp),module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.BertQuestionAnswerer=function(e,t,n){this.module=e,this.memOffsetsToFree=t,this.cppClassifier=n},module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.BertQuestionAnswerer.create=function(e){var t,n,r,o,i,a,s,l,u,p;return $jscomp.asyncExecutePromiseGeneratorProgram(function(c){if(1==c.nextAddress)return t=module$exports$google3$third_party$tensorflow_lite_support$web$task$codegen$common$emscripten_module_loader.EmscriptenModuleLoader.getInstance(module$contents$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client_wasmModulesPath,"tflite_web_api",'"use strict";var Module={};var initializedJS=false;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;self.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};self.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)}tflite_web_api_ModuleFactory(Module).then(function(instance){Module=instance})}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["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();if(!initializedJS){Module["___embind_register_native_and_builtin_types"]();initializedJS=true}try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["__emscripten_thread_exit"](result)}}catch(ex){if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["__emscripten_thread_exit"](ex.status)}}else{throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["__emscripten_thread_exit"](-1)}postMessage({"cmd":"cancelDone"})}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}};\n'),r=(n=$jscomp).makeIterator,c.yield(Promise.all([t.load(),"string"==typeof e?fetch(e).then(function(e){return e.arrayBuffer()}):Promise.resolve(e)]),2);
2if(o=r.call(n,c.yieldResult),i=o.next().value,a=o.next().value,s=i,l=new Uint8Array(a),u=s._malloc(l.length),s.HEAPU8.set(l,u),null==(p=s.BertQuestionAnswerer.CreateFromBuffer(u,l.length))||!p.ok())throw Error("Failed to create BertQuestionAnswerer: "+(null==p?void 0:p.errorMessage()));return c.return(new module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.BertQuestionAnswerer(s,[u],p.value()))})},module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.BertQuestionAnswerer.prototype.answer=function(e,t){if(null!=this.cppClassifier)return e=this.cppClassifier.Answer(e,t),(0,module$exports$google3$third_party$tensorflow_lite_support$web$task$codegen$common$utils.callAndDelete)(e,function(e){return(0,module$exports$google3$third_party$tensorflow_lite_support$web$task$codegen$common$utils.convertCppVectorToArray)(e)})},module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.BertQuestionAnswerer.prototype.cleanUp=function(){if(null!=this.cppClassifier){for(var e=$jscomp.makeIterator(this.memOffsetsToFree),t=e.next();!t.done;t=e.next())this.module._free(t.value);this.cppClassifier.delete()}},goog.exportSymbol("tfweb.BertQuestionAnswerer",module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.BertQuestionAnswerer),goog.exportSymbol("tfweb.BertQuestionAnswerer.create",module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.BertQuestionAnswerer.create),goog.exportSymbol("tfweb.BertQuestionAnswerer.prototype.answer",module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.BertQuestionAnswerer.prototype.answer),goog.exportSymbol("tfweb.BertQuestionAnswerer.prototype.cleanUp",module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.BertQuestionAnswerer.prototype.cleanUp),module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.ImageClassifier=function(e,t,n){this.module=e,this.memOffsetsToFree=t,this.cppClassifier=n},module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.ImageClassifier.create=function(e,t){var n,r,o,i,a,s,l,u,p,c;return t=void 0===t?new proto.tflite.task.vision.ImageClassifierOptions:t,$jscomp.asyncExecutePromiseGeneratorProgram(function(d){if(1==d.nextAddress)return n=module$exports$google3$third_party$tensorflow_lite_support$web$task$codegen$common$emscripten_module_loader.EmscriptenModuleLoader.getInstance(module$contents$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client_wasmModulesPath,"tflite_web_api",'"use strict";var Module={};var initializedJS=false;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;self.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};self.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)}tflite_web_api_ModuleFactory(Module).then(function(instance){Module=instance})}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["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();if(!initializedJS){Module["___embind_register_native_and_builtin_types"]();initializedJS=true}try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["__emscripten_thread_exit"](result)}}catch(ex){if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["__emscripten_thread_exit"](ex.status)}}else{throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["__emscripten_thread_exit"](-1)}postMessage({"cmd":"cancelDone"})}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}};\n'),o=(r=$jscomp).makeIterator,d.yield(Promise.all([n.load(),"string"==typeof e?fetch(e).then(function(e){return e.arrayBuffer()}):Promise.resolve(e)]),2);
2if(i=o.call(r,d.yieldResult),a=i.next().value,s=i.next().value,l=a,u=new Uint8Array(s),p=l._malloc(u.length),l.HEAPU8.set(u,p),null==(c=(0,module$exports$google3$third_party$tensorflow_lite_support$web$task$codegen$common$utils.callAndDelete)(new l.ImageClassifierOptionsCppProto,function(e){if(null!=e)return e.initFromJsProto(t),l.ImageClassifier.CreateFromOptions(p,u.length,e)}))||!c.ok())throw Error("Failed to create ImageClassifier: "+(null==c?void 0:c.errorMessage()));return d.return(new module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.ImageClassifier(l,[p],c.value()))})},module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.ImageClassifier.prototype.classify=function(e){if(null!=this.cppClassifier){var t=(0,module$exports$google3$third_party$tensorflow_lite_support$web$task$codegen$common$utils.fromPixels)(e);e=t.vals;var n=t.width,r=t.height;if(null!=e)return t=this.module._malloc(e.length),this.module.HEAPU8.set(e,t),e=this.cppClassifier.Classify(t,n,r),this.module._free(t),(0,module$exports$google3$third_party$tensorflow_lite_support$web$task$codegen$common$utils.callWithStatusOrAndDelete)(e,"Failed to run inference method classify: ",function(e){return e=e.toArrayBuffer(),proto.tflite.task.vision.ClassificationResult.deserializeBinary(e)})}},module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.ImageClassifier.prototype.cleanUp=function(){if(null!=this.cppClassifier){for(var e=$jscomp.makeIterator(this.memOffsetsToFree),t=e.next();!t.done;t=e.next())this.module._free(t.value);this.cppClassifier.delete()}},goog.exportSymbol("tfweb.ClassificationResult",proto.tflite.task.vision.ClassificationResult),goog.exportSymbol("tfweb.ClassificationResult.prototype.serializeBinary",proto.tflite.task.vision.ClassificationResult.prototype.serializeBinary),goog.exportSymbol("tfweb.ImageClassifierOptions",proto.tflite.task.vision.ImageClassifierOptions),goog.exportSymbol("tfweb.ImageClassifierOptions.prototype.serializeBinary",proto.tflite.task.vision.ImageClassifierOptions.prototype.serializeBinary),goog.exportSymbol("tfweb.ImageClassifier",module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.ImageClassifier),goog.exportSymbol("tfweb.ImageClassifier.create",module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.ImageClassifier.create),goog.exportSymbol("tfweb.ImageClassifier.prototype.classify",module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.ImageClassifier.prototype.classify),goog.exportSymbol("tfweb.ImageClassifier.prototype.cleanUp",module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.ImageClassifier.prototype.cleanUp),module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.ImageSegmenter=function(e,t,n){this.module=e,this.memOffsetsToFree=t,this.cppClassifier=n},module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.ImageSegmenter.create=function(e,t){var n,r,o,i,a,s,l,u,p,c;return t=void 0===t?new proto.tflite.task.vision.ImageSegmenterOptions:t,$jscomp.asyncExecutePromiseGeneratorProgram(function(d){if(1==d.nextAddress)return n=module$exports$google3$third_party$tensorflow_lite_support$web$task$codegen$common$emscripten_module_loader.EmscriptenModuleLoader.getInstance(module$contents$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client_wasmModulesPath,"tflite_web_api",'"use strict";var Module={};var initializedJS=false;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;self.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};self.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)}tflite_web_api_ModuleFactory(Module).then(function(instance){Module=instance})}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["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();if(!initializedJS){Module["___embind_register_native_and_builtin_types"]();initializedJS=true}try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["__emscripten_thread_exit"](result)}}catch(ex){if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["__emscripten_thread_exit"](ex.status)}}else{throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["__emscripten_thread_exit"](-1)}postMessage({"cmd":"cancelDone"})}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}};\n'),o=(r=$jscomp).makeIterator,d.yield(Promise.all([n.load(),"string"==typeof e?fetch(e).then(function(e){return e.arrayBuffer()}):Promise.resolve(e)]),2);
2if(i=o.call(r,d.yieldResult),a=i.next().value,s=i.next().value,l=a,u=new Uint8Array(s),p=l._malloc(u.length),l.HEAPU8.set(u,p),null==(c=(0,module$exports$google3$third_party$tensorflow_lite_support$web$task$codegen$common$utils.callAndDelete)(new l.ImageSegmenterOptionsCppProto,function(e){if(null!=e)return e.initFromJsProto(t),l.ImageSegmenter.CreateFromOptions(p,u.length,e)}))||!c.ok())throw Error("Failed to create ImageSegmenter: "+(null==c?void 0:c.errorMessage()));return d.return(new module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.ImageSegmenter(l,[p],c.value()))})},module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.ImageSegmenter.prototype.segment=function(e){if(null!=this.cppClassifier){var t=(0,module$exports$google3$third_party$tensorflow_lite_support$web$task$codegen$common$utils.fromPixels)(e);e=t.vals;var n=t.width,r=t.height;if(null!=e)return t=this.module._malloc(e.length),this.module.HEAPU8.set(e,t),e=this.cppClassifier.Segment(t,n,r),this.module._free(t),(0,module$exports$google3$third_party$tensorflow_lite_support$web$task$codegen$common$utils.callWithStatusOrAndDelete)(e,"Failed to run inference method segment: ",function(e){return e=e.toArrayBuffer(),proto.tflite.task.vision.SegmentationResult.deserializeBinary(e)})}},module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.ImageSegmenter.prototype.cleanUp=function(){if(null!=this.cppClassifier){for(var e=$jscomp.makeIterator(this.memOffsetsToFree),t=e.next();!t.done;t=e.next())this.module._free(t.value);this.cppClassifier.delete()}},goog.exportSymbol("tfweb.ImageSegmenterOptions",proto.tflite.task.vision.ImageSegmenterOptions),goog.exportSymbol("tfweb.ImageSegmenterOptions.prototype.serializeBinary",proto.tflite.task.vision.ImageSegmenterOptions.prototype.serializeBinary),goog.exportSymbol("tfweb.SegmentationResult",proto.tflite.task.vision.SegmentationResult),goog.exportSymbol("tfweb.SegmentationResult.prototype.serializeBinary",proto.tflite.task.vision.SegmentationResult.prototype.serializeBinary),goog.exportSymbol("tfweb.ImageSegmenter",module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.ImageSegmenter),goog.exportSymbol("tfweb.ImageSegmenter.create",module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.ImageSegmenter.create),goog.exportSymbol("tfweb.ImageSegmenter.prototype.segment",module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.ImageSegmenter.prototype.segment),goog.exportSymbol("tfweb.ImageSegmenter.prototype.cleanUp",module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.ImageSegmenter.prototype.cleanUp),module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.NLClassifier=function(e,t,n){this.module=e,this.memOffsetsToFree=t,this.cppClassifier=n},module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.NLClassifier.create=function(e,t){var n,r,o,i,a,s,l,u,p,c;return $jscomp.asyncExecutePromiseGeneratorProgram(function(d){if(1==d.nextAddress)return n=module$exports$google3$third_party$tensorflow_lite_support$web$task$codegen$common$emscripten_module_loader.EmscriptenModuleLoader.getInstance(module$contents$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client_wasmModulesPath,"tflite_web_api",'"use strict";var Module={};var initializedJS=false;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;self.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};self.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)}tflite_web_api_ModuleFactory(Module).then(function(instance){Module=instance})}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["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();if(!initializedJS){Module["___embind_register_native_and_builtin_types"]();initializedJS=true}try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["__emscripten_thread_exit"](result)}}catch(ex){if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["__emscripten_thread_exit"](ex.status)}}else{throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["__emscripten_thread_exit"](-1)}postMessage({"cmd":"cancelDone"})}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}};\n'),o=(r=$jscomp).makeIterator,d.yield(Promise.all([n.load(),"string"==typeof e?fetch(e).then(function(e){return e.arrayBuffer()}):Promise.resolve(e)]),2);
2if(i=o.call(r,d.yieldResult),a=i.next().value,s=i.next().value,l=a,u=new Uint8Array(s),p=l._malloc(u.length),l.HEAPU8.set(u,p),null==(c=l.NLClassifier.CreateFromBufferAndOptions(p,u.length,t))||!c.ok())throw Error("Failed to create NLClassifier: "+(null==c?void 0:c.errorMessage()));return d.return(new module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.NLClassifier(l,[p],c.value()))})},module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.NLClassifier.prototype.classify=function(e){if(null!=this.cppClassifier)return e=this.cppClassifier.Classify(e),(0,module$exports$google3$third_party$tensorflow_lite_support$web$task$codegen$common$utils.callAndDelete)(e,function(e){return(0,module$exports$google3$third_party$tensorflow_lite_support$web$task$codegen$common$utils.convertCppVectorToArray)(e)})},module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.NLClassifier.prototype.cleanUp=function(){if(null!=this.cppClassifier){for(var e=$jscomp.makeIterator(this.memOffsetsToFree),t=e.next();!t.done;t=e.next())this.module._free(t.value);this.cppClassifier.delete()}},goog.exportSymbol("tfweb.NLClassifier",module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.NLClassifier),goog.exportSymbol("tfweb.NLClassifier.create",module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.NLClassifier.create),goog.exportSymbol("tfweb.NLClassifier.prototype.classify",module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.NLClassifier.prototype.classify),goog.exportSymbol("tfweb.NLClassifier.prototype.cleanUp",module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.NLClassifier.prototype.cleanUp),module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.ObjectDetector=function(e,t,n){this.module=e,this.memOffsetsToFree=t,this.cppClassifier=n},module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.ObjectDetector.create=function(e,t){var n,r,o,i,a,s,l,u,p,c;return t=void 0===t?new proto.tflite.task.vision.ObjectDetectorOptions:t,$jscomp.asyncExecutePromiseGeneratorProgram(function(d){if(1==d.nextAddress)return n=module$exports$google3$third_party$tensorflow_lite_support$web$task$codegen$common$emscripten_module_loader.EmscriptenModuleLoader.getInstance(module$contents$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client_wasmModulesPath,"tflite_web_api",'"use strict";var Module={};var initializedJS=false;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;self.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};self.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)}tflite_web_api_ModuleFactory(Module).then(function(instance){Module=instance})}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["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();if(!initializedJS){Module["___embind_register_native_and_builtin_types"]();initializedJS=true}try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["__emscripten_thread_exit"](result)}}catch(ex){if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["__emscripten_thread_exit"](ex.status)}}else{throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["__emscripten_thread_exit"](-1)}postMessage({"cmd":"cancelDone"})}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}};\n'),o=(r=$jscomp).makeIterator,d.yield(Promise.all([n.load(),"string"==typeof e?fetch(e).then(function(e){return e.arrayBuffer()}):Promise.resolve(e)]),2);
2if(i=o.call(r,d.yieldResult),a=i.next().value,s=i.next().value,l=a,u=new Uint8Array(s),p=l._malloc(u.length),l.HEAPU8.set(u,p),null==(c=(0,module$exports$google3$third_party$tensorflow_lite_support$web$task$codegen$common$utils.callAndDelete)(new l.ObjectDetectorOptionsCppProto,function(e){if(null!=e)return e.initFromJsProto(t),l.ObjectDetector.CreateFromOptions(p,u.length,e)}))||!c.ok())throw Error("Failed to create ObjectDetector: "+(null==c?void 0:c.errorMessage()));return d.return(new module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.ObjectDetector(l,[p],c.value()))})},module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.ObjectDetector.prototype.detect=function(e){if(null!=this.cppClassifier){var t=(0,module$exports$google3$third_party$tensorflow_lite_support$web$task$codegen$common$utils.fromPixels)(e);e=t.vals;var n=t.width,r=t.height;if(null!=e)return t=this.module._malloc(e.length),this.module.HEAPU8.set(e,t),e=this.cppClassifier.Detect(t,n,r),this.module._free(t),(0,module$exports$google3$third_party$tensorflow_lite_support$web$task$codegen$common$utils.callWithStatusOrAndDelete)(e,"Failed to run inference method detect: ",function(e){return e=e.toArrayBuffer(),proto.tflite.task.vision.DetectionResult.deserializeBinary(e)})}},module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.ObjectDetector.prototype.cleanUp=function(){if(null!=this.cppClassifier){for(var e=$jscomp.makeIterator(this.memOffsetsToFree),t=e.next();!t.done;t=e.next())this.module._free(t.value);this.cppClassifier.delete()}},goog.exportSymbol("tfweb.DetectionResult",proto.tflite.task.vision.DetectionResult),goog.exportSymbol("tfweb.DetectionResult.prototype.serializeBinary",proto.tflite.task.vision.DetectionResult.prototype.serializeBinary),goog.exportSymbol("tfweb.ObjectDetectorOptions",proto.tflite.task.vision.ObjectDetectorOptions),goog.exportSymbol("tfweb.ObjectDetectorOptions.prototype.serializeBinary",proto.tflite.task.vision.ObjectDetectorOptions.prototype.serializeBinary),goog.exportSymbol("tfweb.ObjectDetector",module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.ObjectDetector),goog.exportSymbol("tfweb.ObjectDetector.create",module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.ObjectDetector.create),goog.exportSymbol("tfweb.ObjectDetector.prototype.detect",module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.ObjectDetector.prototype.detect),goog.exportSymbol("tfweb.ObjectDetector.prototype.cleanUp",module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.ObjectDetector.prototype.cleanUp),module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.TFLiteWebModelRunner=function(e,t,n){this.module=e,this.memOffsetsToFree=t,this.cppClassifier=n},module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.TFLiteWebModelRunner.create=function(e,t){var n,r,o,i,a,s,l,u,p,c;return t=void 0===t?{}:t,$jscomp.asyncExecutePromiseGeneratorProgram(function(d){if(1==d.nextAddress)return n=module$exports$google3$third_party$tensorflow_lite_support$web$task$codegen$common$emscripten_module_loader.EmscriptenModuleLoader.getInstance(module$contents$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client_wasmModulesPath,"tflite_web_api",'"use strict";var Module={};var initializedJS=false;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;self.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};self.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)}tflite_web_api_ModuleFactory(Module).then(function(instance){Module=instance})}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["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();if(!initializedJS){Module["___embind_register_native_and_builtin_types"]();initializedJS=true}try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["__emscripten_thread_exit"](result)}}catch(ex){if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["__emscripten_thread_exit"](ex.status)}}else{throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["__emscripten_thread_exit"](-1)}postMessage({"cmd":"cancelDone"})}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}};\n'),o=(r=$jscomp).makeIterator,d.yield(Promise.all([n.load(),"string"==typeof e?fetch(e).then(function(e){return e.arrayBuffer()}):Promise.resolve(e)]),2);
2if(i=o.call(r,d.yieldResult),a=i.next().value,s=i.next().value,l=a,u=new Uint8Array(s),p=l._malloc(u.length),l.HEAPU8.set(u,p),null==t.numThreads&&(t.numThreads=navigator?navigator.hardwareConcurrency/2:-1),null==t.enableProfiling&&(t.enableProfiling=!1),null==t.maxProfilingBufferEntries&&(t.maxProfilingBufferEntries=1024),null==(c=l.TFLiteWebModelRunner.CreateFromBufferAndOptions(p,u.length,t))||!c.ok())throw Error("Failed to create TFLiteWebModelRunner: "+(null==c?void 0:c.errorMessage()));return d.return(new module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.TFLiteWebModelRunner(l,[p],c.value()))})},module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.TFLiteWebModelRunner.prototype.getInputs=function(){if(null!=this.cppClassifier){var e=this.cppClassifier.GetInputs();return(0,module$exports$google3$third_party$tensorflow_lite_support$web$task$codegen$common$utils.callAndDelete)(e,function(e){return(0,module$exports$google3$third_party$tensorflow_lite_support$web$task$codegen$common$utils.convertCppVectorToArray)(e)})}},module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.TFLiteWebModelRunner.prototype.getOutputs=function(){if(null!=this.cppClassifier){var e=this.cppClassifier.GetOutputs();return(0,module$exports$google3$third_party$tensorflow_lite_support$web$task$codegen$common$utils.callAndDelete)(e,function(e){return(0,module$exports$google3$third_party$tensorflow_lite_support$web$task$codegen$common$utils.convertCppVectorToArray)(e)})}},module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.TFLiteWebModelRunner.prototype.infer=function(){if(null!=this.cppClassifier)return this.cppClassifier.Infer()},module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.TFLiteWebModelRunner.prototype.getProfilingResults=function(){if(null!=this.cppClassifier){var e=this.cppClassifier.GetProfilingResults();return(0,module$exports$google3$third_party$tensorflow_lite_support$web$task$codegen$common$utils.callAndDelete)(e,function(e){return(0,module$exports$google3$third_party$tensorflow_lite_support$web$task$codegen$common$utils.convertCppVectorToArray)(e)})}},module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.TFLiteWebModelRunner.prototype.getProfilingSummary=function(){if(null!=this.cppClassifier)return this.cppClassifier.GetProfilingSummary()},module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.TFLiteWebModelRunner.prototype.cleanUp=function(){if(null!=this.cppClassifier){for(var e=$jscomp.makeIterator(this.memOffsetsToFree),t=e.next();!t.done;t=e.next())this.module._free(t.value);this.cppClassifier.delete()}},goog.exportSymbol("tfweb.TFLiteWebModelRunner",module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.TFLiteWebModelRunner),goog.exportSymbol("tfweb.TFLiteWebModelRunner.create",module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.TFLiteWebModelRunner.create),goog.exportSymbol("tfweb.TFLiteWebModelRunner.prototype.getInputs",module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.TFLiteWebModelRunner.prototype.getInputs),goog.exportSymbol("tfweb.TFLiteWebModelRunner.prototype.getOutputs",module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.TFLiteWebModelRunner.prototype.getOutputs),goog.exportSymbol("tfweb.TFLiteWebModelRunner.prototype.infer",module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.TFLiteWebModelRunner.prototype.infer),goog.exportSymbol("tfweb.TFLiteWebModelRunner.prototype.getProfilingResults",module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.TFLiteWebModelRunner.prototype.getProfilingResults),goog.exportSymbol("tfweb.TFLiteWebModelRunner.prototype.getProfilingSummary",module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.TFLiteWebModelRunner.prototype.getProfilingSummary),goog.exportSymbol("tfweb.TFLiteWebModelRunner.prototype.cleanUp",module$exports$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client.TFLiteWebModelRunner.prototype.cleanUp),goog.exportSymbol("tfweb.tflite_web_api.setWasmPath",module$contents$google3$third_party$tensorflow_lite_support$web$tflite_web_api_client_setWasmPath),goog.exportSymbol("tfweb.tflite_web_api.getWasmFeatures",module$exports$google3$third_party$tensorflow_lite_support$web$task$codegen$common$utils.getWasmFeatures),module$exports$google3$third_party$tensorflow_lite_support$web$task$codegen$common$emscripten_module_loader.EmscriptenModuleLoader.getInstance("","tflite_web_api",'"use strict";var Module={};var initializedJS=false;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;self.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};self.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)}tflite_web_api_ModuleFactory(Module).then(function(instance){Module=instance})}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["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();if(!initializedJS){Module["___embind_register_native_and_builtin_types"]();initializedJS=true}try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["__emscripten_thread_exit"](result)}}catch(ex){if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["__emscripten_thread_exit"](ex.status)}}else{throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["__emscripten_thread_exit"](-1)}postMessage({"cmd":"cancelDone"})}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}};\n').load(!0);var tfweb="undefined"!=typeof window&&window.tfweb||this.tfweb;exports.tfweb=tfweb},801:(e,t,n)=>{var r;!function(o,i){var a,s=this,l=256,u="random",p=i.pow(l,6),c=i.pow(2,52),d=2*c,h=255;function f(e,t,n){var r=[],h=b(y((t=1==t?{entropy:!0}:t||{}).entropy?[e,$(o)]:null==e?function(){try{var e;return a&&(e=a.randomBytes)?e=e(l):(e=new Uint8Array(l),(s.crypto||s.msCrypto).getRandomValues(e)),$(e)}catch(e){var t=s.navigator,n=t&&t.plugins;return[+new Date,s,n,s.screen,$(o)]}}():e,3),r),f=new g(r),_=function(){for(var e=f.g(6),t=p,n=0;e<c;)e=(e+n)*l,t*=l,n=f.g(1);for(;e>=d;)e/=2,t/=2,n>>>=1;return(e+n)/t};return _.int32=function(){return 0|f.g(4)},_.quick=function(){return f.g(4)/4294967296},_.double=_,b($(f.S),o),(t.pass||n||function(e,t,n,r){return r&&(r.S&&m(r,f),e.state=function(){return m(f,{})}),n?(i[u]=e,t):e})(_,h,"global"in t?t.global:this==i,t.state)}function g(e){var t,n=e.length,r=this,o=0,i=r.i=r.j=0,a=r.S=[];for(n||(e=[n++]);o<l;)a[o]=o++;for(o=0;o<l;o++)a[o]=a[i=h&i+e[o%n]+(t=a[o])],a[i]=t;(r.g=function(e){for(var t,n=0,o=r.i,i=r.j,a=r.S;e--;)t=a[o=h&o+1],n=n*l+a[h&(a[o]=a[i=h&i+t])+(a[i]=t)];return r.i=o,r.j=i,n})(l)}function m(e,t){return t.i=e.i,t.j=e.j,t.S=e.S.slice(),t}function y(e,t){var n,r=[],o=typeof e;if(t&&"object"==o)for(n in e)try{r.push(y(e[n],t-1))}catch(e){}return r.length?r:"string"==o?e:e+"\0"}function b(e,t){for(var n,r=e+"",o=0;o<r.length;)t[h&o]=h&(n^=19*t[h&o])+r.charCodeAt(o++);return $(t)}function $(e){return String.fromCharCode.apply(0,e)}if(i["seed"+u]=f,b(i.random(),o),e.exports){e.exports=f;try{a=n(234)}catch(e){}}else void 0===(r=function(){return f}.call(t,n,t,e))||(e.exports=r)}([],Math)},805:(e,t,n)=>{var r,o=(r=(r="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(e){var t,o,i=void 0!==(e=e||{})?e:{};i.ready=new Promise(function(e,n){t=e,o=n});var a,s={};for(a in i)i.hasOwnProperty(a)&&(s[a]=i[a]);var l,u,p,c,d=[];l="object"==typeof window,u="function"==typeof importScripts,p="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,c=!l&&!p&&!u;var h,f,g,m,y,b="";p?(b=u?n(281).dirname(b)+"/":"//",h=function(e,t){return m||(m=n(893)),y||(y=n(281)),e=y.normalize(e),m.readFileSync(e,t?null:"utf8")},g=function(e){var t=h(e,!0);return t.buffer||(t=new Uint8Array(t)),v(t.buffer),t},process.argv.length>1&&process.argv[1].replace(/\\/g,"/"),d=process.argv.slice(2),process.on("uncaughtException",function(e){if(!(e instanceof le))throw e}),process.on("unhandledRejection",H),i.inspect=function(){return"[Emscripten Module object]"}):c?("undefined"!=typeof read&&(h=function(e){return read(e)}),g=function(e){var t;return"function"==typeof readbuffer?new Uint8Array(readbuffer(e)):(v("object"==typeof(t=read(e,"binary"))),t)},"undefined"!=typeof scriptArgs?d=scriptArgs:void 0!==arguments&&(d=arguments),"undefined"!=typeof print&&("undefined"==typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!=typeof printErr?printErr:print)):(l||u)&&(u?b=self.location.href:"undefined"!=typeof document&&document.currentScript&&(b=document.currentScript.src),r&&(b=r),b=0!==b.indexOf("blob:")?b.substr(0,b.lastIndexOf("/")+1):"",h=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},u&&(g=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),f=function(e,t,n){var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=function(){200==r.status||0==r.status&&r.response?t(r.response):n()},r.onerror=n,r.send(null)});var $,_,w=i.print||console.log.bind(console),x=i.printErr||console.warn.bind(console);for(a in s)s.hasOwnProperty(a)&&(i[a]=s[a]);s=null,i.arguments&&(d=i.arguments),i.thisProgram&&i.thisProgram,i.quit&&i.quit,
2i.wasmBinary&&($=i.wasmBinary),i.noExitRuntime,"object"!=typeof WebAssembly&&H("no native wasm support detected");var S=!1;function v(e,t){e||H("Assertion failed: "+t)}function k(e){var t=i["_"+e];return v(t,"Cannot call unknown function "+e+", make sure it is exported"),t}var E,I,T,F,N="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function j(e,t,n){for(var r=t+n,o=t;e[o]&&!(o>=r);)++o;if(o-t>16&&e.subarray&&N)return N.decode(e.subarray(t,o));for(var i="";t<o;){var a=e[t++];if(128&a){var s=63&e[t++];if(192!=(224&a)){var l=63&e[t++];if((a=224==(240&a)?(15&a)<<12|s<<6|l:(7&a)<<18|s<<12|l<<6|63&e[t++])<65536)i+=String.fromCharCode(a);else{var u=a-65536;i+=String.fromCharCode(55296|u>>10,56320|1023&u)}}else i+=String.fromCharCode((31&a)<<6|s)}else i+=String.fromCharCode(a)}return i}function A(e,t){return e?j(T,e,t):""}function C(e,t){return e%t>0&&(e+=t-e%t),e}function M(e){E=e,i.HEAP8=I=new Int8Array(e),i.HEAP16=new Int16Array(e),i.HEAP32=F=new Int32Array(e),i.HEAPU8=T=new Uint8Array(e),i.HEAPU16=new Uint16Array(e),i.HEAPU32=new Uint32Array(e),i.HEAPF32=new Float32Array(e),i.HEAPF64=new Float64Array(e)}i.INITIAL_MEMORY;var D,O=[],R=[],B=[],P=[];function L(e){O.unshift(e)}function W(e){P.unshift(e)}R.push({func:function(){re()}});var U=0,z=null,V=null;function H(e){i.onAbort&&i.onAbort(e),x(e+=""),S=!0,e="abort("+e+"). Build with -s ASSERTIONS=1 for more info.";var t=new WebAssembly.RuntimeError(e);throw o(t),t}function G(e,t){return String.prototype.startsWith?e.startsWith(t):0===e.indexOf(t)}function q(e){return G(e,"data:application/octet-stream;base64,")}function K(e){return G(e,"file://")}i.preloadedImages={},i.preloadedAudios={};var X,Y="tfjs-backend-wasm.wasm";function J(e){try{if(e==Y&&$)return new Uint8Array($);if(g)return g(e);throw"both async and sync fetching of the wasm failed"}catch(e){H(e)}}function Z(e){for(;e.length>0;){var t=e.shift();if("function"!=typeof t){var n=t.func;"number"==typeof n?void 0===t.arg?D.get(n)():D.get(n)(t.arg):n(void 0===t.arg?null:t.arg)}else t(i)}}function Q(e){try{return _.grow(e-E.byteLength+65535>>>16),M(_.buffer),1}catch(e){}}q(Y)||(X=Y,Y=i.locateFile?i.locateFile(X,b):b+X);var ee,te={mappings:{},buffers:[null,[],[]],printChar:function(e,t){var n=te.buffers[e];0===t||10===t?((1===e?w:x)(j(n,0)),n.length=0):n.push(t)},varargs:void 0,get:function(){return te.varargs+=4,F[te.varargs-4>>2]},getStr:function(e){return A(e)},get64:function(e,t){return e}},ne={a:function(){H()},d:function(e,t,n){T.copyWithin(e,t,t+n)},e:function(e){var t=T.length,n=2147483648;if(e>n)return!1;for(var r=1;r<=4;r*=2){var o=t*(1+.2/r);if(o=Math.min(o,e+100663296),Q(Math.min(n,C(Math.max(e,o),65536))))return!0}return!1},f:function(e){return 0},c:function(e,t,n,r,o){},b:function(e,t,n,r){for(var o=0,i=0;i<n;i++){for(var a=F[t+8*i>>2],s=F[t+(8*i+4)>>2],l=0;l<s;l++)te.printChar(e,T[a+l]);o+=s}return F[r>>2]=o,0},h:function(){return 6},g:function(){return 28},i:function(e){switch(e){case 30:case 75:return 16384;case 85:return 131072;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 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"object"==typeof navigator&&navigator.hardwareConcurrency||1}return F[oe()>>2]=28,-1}},re=(function(){var e={a:ne};function t(e,t){var n=e.exports;i.asm=n,M((_=i.asm.j).buffer),D=i.asm.r,function(){if(U--,i.monitorRunDependencies&&i.monitorRunDependencies(U),0==U&&(null!==z&&(clearInterval(z),z=null),V)){var e=V;V=null,e()}}()}function n(e){t(e.instance)}function r(t){return function(){if(!$&&(l||u)){if("function"==typeof fetch&&!K(Y))return fetch(Y,{credentials:"same-origin"}).then(function(e){if(!e.ok)throw"failed to load wasm binary file at '"+Y+"'";return e.arrayBuffer()}).catch(function(){return J(Y)});if(f)return new Promise(function(e,t){f(Y,function(t){e(new Uint8Array(t))},t)})}return Promise.resolve().then(function(){return J(Y)})}().then(function(t){return WebAssembly.instantiate(t,e)}).then(t,function(e){x("failed to asynchronously prepare wasm: "+e),H(e)})}if(U++,i.monitorRunDependencies&&i.monitorRunDependencies(U),i.instantiateWasm)try{return i.instantiateWasm(e,t)}catch(e){return x("Module.instantiateWasm callback failed with error: "+e),!1}($||"function"!=typeof WebAssembly.instantiateStreaming||q(Y)||K(Y)||"function"!=typeof fetch?r(n):fetch(Y,{credentials:"same-origin"}).then(function(t){return WebAssembly.instantiateStreaming(t,e).then(n,function(e){return x("wasm streaming compile failed: "+e),x("falling back to ArrayBuffer instantiation"),r(n)})})).catch(o)}(),i.___wasm_call_ctors=function(){return(re=i.___wasm_call_ctors=i.asm.k).apply(null,arguments)}),oe=(i._init=function(){return(i._init=i.asm.l).apply(null,arguments)},i._init_with_threads_count=function(){return(i._init_with_threads_count=i.asm.m).apply(null,arguments)},i._get_threads_count=function(){return(i._get_threads_count=i.asm.n).apply(null,arguments)},i._register_tensor=function(){return(i._register_tensor=i.asm.o).apply(null,arguments)},i._dispose_data=function(){return(i._dispose_data=i.asm.p).apply(null,arguments)},i._dispose=function(){return(i._dispose=i.asm.q).apply(null,arguments)},i._Abs=function(){return(i._Abs=i.asm.s).apply(null,arguments)},i._Add=function(){return(i._Add=i.asm.t).apply(null,arguments)},i._AddN=function(){return(i._AddN=i.asm.u).apply(null,arguments)},i._All=function(){return(i._All=i.asm.v).apply(null,arguments)},i._Any=function(){return(i._Any=i.asm.w).apply(null,arguments)}
vendor: 6,424 bytes, line 2
2,i._ArgMax=function(){return(i._ArgMax=i.asm.x).apply(null,arguments)},i._AvgPool=function(){return(i._AvgPool=i.asm.y).apply(null,arguments)},i._BatchMatMul=function(){return(i._BatchMatMul=i.asm.z).apply(null,arguments)},i._Ceil=function(){return(i._Ceil=i.asm.A).apply(null,arguments)},i._ClipByValue=function(){return(i._ClipByValue=i.asm.B).apply(null,arguments)},i._Conv2D=function(){return(i._Conv2D=i.asm.C).apply(null,arguments)},i._Conv2DBackpropInput=function(){return(i._Conv2DBackpropInput=i.asm.D).apply(null,arguments)},i._Cos=function(){return(i._Cos=i.asm.E).apply(null,arguments)},i._Cosh=function(){return(i._Cosh=i.asm.F).apply(null,arguments)},i._CropAndResize=function(){return(i._CropAndResize=i.asm.G).apply(null,arguments)},i._Cumsum=function(){return(i._Cumsum=i.asm.H).apply(null,arguments)},i._DepthToSpace=function(){return(i._DepthToSpace=i.asm.I).apply(null,arguments)},i._DepthwiseConv2dNative=function(){return(i._DepthwiseConv2dNative=i.asm.J).apply(null,arguments)},i._Elu=function(){return(i._Elu=i.asm.K).apply(null,arguments)},i._Equal=function(){return(i._Equal=i.asm.L).apply(null,arguments)},i._Exp=function(){return(i._Exp=i.asm.M).apply(null,arguments)},i._FlipLeftRight=function(){return(i._FlipLeftRight=i.asm.N).apply(null,arguments)},i._Floor=function(){return(i._Floor=i.asm.O).apply(null,arguments)},i._FloorDiv=function(){return(i._FloorDiv=i.asm.P).apply(null,arguments)},i._FusedBatchNorm=function(){return(i._FusedBatchNorm=i.asm.Q).apply(null,arguments)},i._FusedConv2D=function(){return(i._FusedConv2D=i.asm.R).apply(null,arguments)},i._FusedDepthwiseConv2D=function(){return(i._FusedDepthwiseConv2D=i.asm.S).apply(null,arguments)},i._Gather=function(){return(i._Gather=i.asm.T).apply(null,arguments)},i._GatherNd=function(){return(i._GatherNd=i.asm.U).apply(null,arguments)},i._Greater=function(){return(i._Greater=i.asm.V).apply(null,arguments)},i._GreaterEqual=function(){return(i._GreaterEqual=i.asm.W).apply(null,arguments)},i._LeakyRelu=function(){return(i._LeakyRelu=i.asm.X).apply(null,arguments)},i._Less=function(){return(i._Less=i.asm.Y).apply(null,arguments)},i._LessEqual=function(){return(i._LessEqual=i.asm.Z).apply(null,arguments)},i._Log=function(){return(i._Log=i.asm._).apply(null,arguments)},i._LogicalAnd=function(){return(i._LogicalAnd=i.asm.$).apply(null,arguments)},i._Max=function(){return(i._Max=i.asm.aa).apply(null,arguments)},i._MaxPool=function(){return(i._MaxPool=i.asm.ba).apply(null,arguments)},i._Maximum=function(){return(i._Maximum=i.asm.ca).apply(null,arguments)},i._Mean=function(){return(i._Mean=i.asm.da).apply(null,arguments)},i._Min=function(){return(i._Min=i.asm.ea).apply(null,arguments)},i._Minimum=function(){return(i._Minimum=i.asm.fa).apply(null,arguments)},i._MirrorPad=function(){return(i._MirrorPad=i.asm.ga).apply(null,arguments)},i._Multiply=function(){return(i._Multiply=i.asm.ha).apply(null,arguments)},i._Neg=function(){return(i._Neg=i.asm.ia).apply(null,arguments)},i._NonMaxSuppressionV3=function(){return(i._NonMaxSuppressionV3=i.asm.ja).apply(null,arguments)},i._NonMaxSuppressionV4=function(){return(i._NonMaxSuppressionV4=i.asm.ka).apply(null,arguments)},i._NonMaxSuppressionV5=function(){return(i._NonMaxSuppressionV5=i.asm.la).apply(null,arguments)},i._NotEqual=function(){return(i._NotEqual=i.asm.ma).apply(null,arguments)},i._OneHot=function(){return(i._OneHot=i.asm.na).apply(null,arguments)},i._PadV2=function(){return(i._PadV2=i.asm.oa).apply(null,arguments)},i._Pow=function(){return(i._Pow=i.asm.pa).apply(null,arguments)},i._Prelu=function(){return(i._Prelu=i.asm.qa).apply(null,arguments)},i._Prod=function(){return(i._Prod=i.asm.ra).apply(null,arguments)},i._RealDiv=function(){return(i._RealDiv=i.asm.sa).apply(null,arguments)},i._Relu=function(){return(i._Relu=i.asm.ta).apply(null,arguments)},i._Relu6=function(){return(i._Relu6=i.asm.ua).apply(null,arguments)},i._ResizeBilinear=function(){return(i._ResizeBilinear=i.asm.va).apply(null,arguments)},i._Reverse=function(){return(i._Reverse=i.asm.wa).apply(null,arguments)},i._RotateWithOffset=function(){return(i._RotateWithOffset=i.asm.xa).apply(null,arguments)},i._Round=function(){return(i._Round=i.asm.ya).apply(null,arguments)},i._Rsqrt=function(){return(i._Rsqrt=i.asm.za).apply(null,arguments)},i._ScatterNd=function(){return(i._ScatterNd=i.asm.Aa).apply(null,arguments)},i._SelectV2=function(){return(i._SelectV2=i.asm.Ba).apply(null,arguments)},i._Sigmoid=function(){return(i._Sigmoid=i.asm.Ca).apply(null,arguments)},i._Sin=function(){return(i._Sin=i.asm.Da).apply(null,arguments)},i._Softmax=function(){return(i._Softmax=i.asm.Ea).apply(null,arguments)},i._Sqrt=function(){return(i._Sqrt=i.asm.Fa).apply(null,arguments)},i._Square=function(){return(i._Square=i.asm.Ga).apply(null,arguments)},i._SquaredDifference=function(){return(i._SquaredDifference=i.asm.Ha).apply(null,arguments)},i._Step=function(){return(i._Step=i.asm.Ia).apply(null,arguments)},i._StridedSlice=function(){return(i._StridedSlice=i.asm.Ja).apply(null,arguments)},i._Sub=function(){return(i._Sub=i.asm.Ka).apply(null,arguments)},i._Sum=function(){return(i._Sum=i.asm.La).apply(null,arguments)},i._Tan=function(){return(i._Tan=i.asm.Ma).apply(null,arguments)},i._Tanh=function(){return(i._Tanh=i.asm.Na).apply(null,arguments)},i._Tile=function(){return(i._Tile=i.asm.Oa).apply(null,arguments)},i._TopK=function(){return(i._TopK=i.asm.Pa).apply(null,arguments)},i._Transform=function(){return(i._Transform=i.asm.Qa).apply(null,arguments)},i._Transpose=function(){return(i._Transpose=i.asm.Ra).apply(null,arguments)},i.__FusedMatMul=function(){return(i.__FusedMatMul=i.asm.Sa).apply(null,arguments)},i._malloc=function(){return(i._malloc=i.asm.Ta).apply(null,arguments)},i._free=function(){return(i._free=i.asm.Ua).apply(null,arguments)},i.___errno_location=function(){return(oe=i.___errno_location=i.asm.Va).apply(null,arguments)}),ie=i.stackSave=function(){return(ie=i.stackSave=i.asm.Wa).apply(null,arguments)},ae=i.stackRestore=function(){return(ae=i.stackRestore=i.asm.Xa).apply(null,arguments)},se=i.stackAlloc=function(){return(se=i.stackAlloc=i.asm.Ya).apply(null,arguments)};function le(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function ue(e){function n(){ee||(ee=!0,i.calledRun=!0,S||(Z(R),Z(B),t(i),i.onRuntimeInitialized&&i.onRuntimeInitialized(),function(){if(i.postRun)for("function"==typeof i.postRu
2n&&(i.postRun=[i.postRun]);i.postRun.length;)W(i.postRun.shift());Z(P)}()))}e=e||d,U>0||(function(){if(i.preRun)for("function"==typeof i.preRun&&(i.preRun=[i.preRun]);i.preRun.length;)L(i.preRun.shift());Z(O)}(),U>0||(i.setStatus?(i.setStatus("Running..."),setTimeout(function(){setTimeout(function(){i.setStatus("")},1),n()},1)):n()))}if(i.cwrap=function(e,t,n,r){var o=(n=n||[]).every(function(e){return"number"===e});return"string"!==t&&o&&!r?k(e):function(){return function(e,t,n,r){var o={string:function(e){var t=0;if(null!=e&&0!==e){var n=1+(e.length<<2);!function(e,t,n){!function(e,t,n,r){if(!(r>0))return 0;for(var o=n+r-1,i=0;i<e.length;++i){var a=e.charCodeAt(i);if(a>=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++i)),a<=127){if(n>=o)break;t[n++]=a}else if(a<=2047){if(n+1>=o)break;t[n++]=192|a>>6,t[n++]=128|63&a}else if(a<=65535){if(n+2>=o)break;t[n++]=224|a>>12,t[n++]=128|a>>6&63,t[n++]=128|63&a}else{if(n+3>=o)break;t[n++]=240|a>>18,t[n++]=128|a>>12&63,t[n++]=128|a>>6&63,t[n++]=128|63&a}}t[n]=0}(e,T,t,n)}(e,t=se(n),n)}return t},array:function(e){var t=se(e.length);return function(e,t){I.set(e,t)}(e,t),t}},i=k(e),a=[],s=0;if(r)for(var l=0;l<r.length;l++){var u=o[n[l]];u?(0===s&&(s=ie()),a[l]=u(r[l])):a[l]=r[l]}var p=i.apply(null,a);return p=function(e){return"string"===t?A(e):"boolean"===t?Boolean(e):e}(p),0!==s&&ae(s),p}(e,t,n,arguments)}},V=function e(){ee||ue(),ee||(V=e)},i.run=ue,i.preInit)for("function"==typeof i.preInit&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();return ue(),e.ready});e.exports=o},817:()=>{},833:function(e,t,n){var r;!function(e,o){function i(e){var t=this;t.next=function(){var e,n,r=t.w,o=t.X,i=t.i;return t.w=r=r+1640531527|0,n=o[i+34&127],e=o[i=i+1&127],n^=n<<13,e^=e<<17,n^=n>>>15,e^=e>>>12,n=o[i]=n^e,t.i=i,n+(r^r>>>16)|0},function(e,t){var n,r,o,i,a,s=[],l=128;for(t===(0|t)?(r=t,t=null):(t+="\0",r=0,l=Math.max(l,t.length)),o=0,i=-32;i<l;++i)t&&(r^=t.charCodeAt((i+32)%t.length)),0===i&&(a=r),r^=r<<10,r^=r>>>15,r^=r<<4,r^=r>>>13,i>=0&&(a=a+1640531527|0,o=0==(n=s[127&i]^=r+a)?o+1:0);for(o>=128&&(s[127&(t&&t.length||0)]=-1),o=127,i=512;i>0;--i)r=s[o+34&127],n=s[o=o+1&127],r^=r<<13,n^=n<<17,r^=r>>>15,n^=n>>>12,s[o]=r^n;e.w=a,e.X=s,e.i=o}(t,e)}function a(e,t){return t.i=e.i,t.w=e.w,t.X=e.X.slice(),t}function s(e,t){null==e&&(e=+new Date);var n=new i(e),r=t&&t.state,o=function(){return(n.next()>>>0)/4294967296};return o.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},o.int32=n.next,o.quick=o,r&&(r.X&&a(r,n),o.state=function(){return a(n,{})}),o}o&&o.exports?o.exports=s:n.amdD&&n.amdO?void 0===(r=function(){return s}.call(t,n,t,o))||(o.exports=r):this.xor4096=s}(0,e=n.nmd(e),n.amdD)},893:()=>{},905:()=>{}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.loaded=!0,n.exports}__webpack_require__.amdD=function(){throw new Error("define cannot be used indirect")},__webpack_require__.amdO={},__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var __webpack_exports__={};(()=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>a0,stopMakeup:()=>i0});var e={};__webpack_require__.r(e),__webpack_require__.d(e,{assertParamsValid:()=>Ti,computeFlatOffset:()=>Wi,computeOutShape:()=>Ni,getNormalizedAxes:()=>Mi,isSliceContinous:()=>Li,maskToAxes:()=>Fi,parseSliceParams:()=>Ui,sliceInfo:()=>zi,startForAxis:()=>Bi,startIndicesWithElidedDims:()=>Di,stopForAxis:()=>Pi,stopIndicesWithElidedDims:()=>Oi,stridesForAxis:()=>Ri,stridesWithElidedDims:()=>ji});var t={};__webpack_require__.r(t),__webpack_require__.d(t,{collectGatherOpShapeInfo:()=>au,computeOutShape:()=>iu,segOpComputeOptimalWindowSize:()=>ou});var n={};__webpack_require__.r(n),__webpack_require__.d(n,{ERF_A1:()=>Ml,ERF_A2:()=>Dl,ERF_A3:()=>
2Ol,ERF_A4:()=>Rl,ERF_A5:()=>Bl,ERF_P:()=>Cl,PARALLELIZE_THRESHOLD:()=>$l,SELU_SCALE:()=>Al,SELU_SCALEALPHA:()=>jl,applyActivation:()=>yl,assertAndGetBroadcastShape:()=>Pa,assertAxesAreInnerMostDims:()=>rs,assertParamsConsistent:()=>Ks,assignToTypedArray:()=>Vl,axesAreInnerMostDims:()=>Qa,calculateShapes:()=>Nl,checkEinsumDimSizes:()=>Ql,combineLocations:()=>es,complexWithEvenIndex:()=>Wl,complexWithOddIndex:()=>Ul,computeConv2DInfo:()=>Qs,computeConv3DInfo:()=>el,computeDefaultPad:()=>tl,computeDilation2DInfo:()=>Ys,computeOptimalWindowSize:()=>_l,computeOutAndReduceShapes:()=>ts,computeOutShape:()=>Xs,computePool2DInfo:()=>Js,computePool3DInfo:()=>Zs,convertConv2DDataFormat:()=>ll,decodeEinsumEquation:()=>Jl,eitherStridesOrDilationsAreOne:()=>sl,expandShapeToKeepDim:()=>ns,exponent:()=>Gl,exponents:()=>Hl,fromStringArrayToUint8:()=>lu,fromUint8ToStringArray:()=>su,getAxesPermutation:()=>os,getBroadcastDims:()=>Ra,getComplexWithIndex:()=>zl,getEinsumComputePath:()=>eu,getEinsumPermutation:()=>Zl,getFusedBiasGradient:()=>ml,getFusedDyActivation:()=>gl,getImageCenter:()=>wl,getInnerMostAxes:()=>as,getPermuted:()=>Sl,getReductionAxes:()=>Ba,getReshaped:()=>xl,getReshapedPermuted:()=>vl,getSliceBeginCoords:()=>kl,getSliceSize:()=>El,getUndoAxesPermutation:()=>is,isIdentityPermutation:()=>tu,log:()=>we,mergeRealAndImagArrays:()=>Pl,prepareAndValidate:()=>Il,prepareSplitSize:()=>ru,segment_util:()=>t,shouldFuse:()=>bl,slice_util:()=>e,splitRealAndImagArrays:()=>Ll,tupleValuesAreOne:()=>al,upcastType:()=>po,validateInput:()=>Fl,validateUpdateShape:()=>Tl,warn:()=>_e});var r={};__webpack_require__.r(r),__webpack_require__.d(r,{json:()=>TN});var o={};__webpack_require__.r(o),__webpack_require__.d(o,{json:()=>FN});var i={};__webpack_require__.r(i),__webpack_require__.d(i,{json:()=>NN});var a={};__webpack_require__.r(a),__webpack_require__.d(a,{json:()=>jN});var s={};__webpack_require__.r(s),__webpack_require__.d(s,{json:()=>AN});var l={};__webpack_require__.r(l),__webpack_require__.d(l,{json:()=>CN});var u={};__webpack_require__.r(u),__webpack_require__.d(u,{json:()=>MN});var p={};__webpack_require__.r(p),__webpack_require__.d(p,{json:()=>DN});var c={};__webpack_require__.r(c),__webpack_require__.d(c,{json:()=>ON});var d={};__webpack_require__.r(d),__webpack_require__.d(d,{json:()=>RN});var h={};__webpack_require__.r(h),__webpack_require__.d(h,{json:()=>BN});var f={};__webpack_require__.r(f),__webpack_require__.d(f,{json:()=>PN});var g={};__webpack_require__.r(g),__webpack_require__.d(g,{json:()=>LN});var m={};__webpack_require__.r(m),__webpack_require__.d(m,{json:()=>WN});var y={};__webpack_require__.r(y),__webpack_require__.d(y,{json:()=>UN});var b={};__webpack_require__.r(b),__webpack_require__.d(b,{json:()=>zN});var $={};__webpack_require__.r($),__webpack_require__.d($,{json:()=>VN});var _={};__webpack_require__.r(_),__webpack_require__.d(_,{json:()=>HN});var w={};__webpack_require__.r(w),__webpack_require__.d(w,{json:()=>GN});var x={};__webpack_require__.r(x),__webpack_require__.d(x,{mx:()=>aC,XI:()=>ZC,Nk:()=>QC,YG:()=>nM,hH:()=>lM,z3:()=>VM,sG:()=>XM,uM:()=>eD,vS:()=>yD,qB:()=>kD,GG:()=>ID,lg:()=>AD,rq:()=>FD,cu:()=>zD,WR:()=>LD,GE:()=>GD,px:()=>KD,jC:()=>uO,He:()=>dO,hE:()=>xO,BF:()=>OM,Dk:()=>AO,cl:()=>LO,_B:()=>QO,qy:()=>tR,Zy:()=>hR,zv:()=>qA,dH:()=>gC,HS:()=>KC,yH:()=>CR,l3:()=>DR,z9:()=>RR,x6:()=>UR,eW:()=>JR,GK:()=>eB,SP:()=>rB,f6:()=>iB,dl:()=>aD,Dw:()=>pB,xT:()=>hB,_X:()=>xC,wz:()=>$B});var S={};__webpack_require__.r(S),__webpack_require__.d(S,{json:()=>RY});var v={};__webpack_require__.r(v),__webpack_require__.d(v,{json:()=>BY});var k={};__webpack_require__.r(k),__webpack_require__.d(k,{json:()=>PY});var E={};__webpack_require__.r(E),__webpack_require__.d(E,{json:()=>LY});var I={};__webpack_require__.r(I),__webpack_require__.d(I,{json:()=>WY});var T={};__webpack_require__.r(T),__webpack_require__.d(T,{json:()=>UY});var F={};__webpack_require__.r(F),__webpack_require__.d(F,{json:()=>zY});var N={};__webpack_require__.r(N),__webpack_require__.d(N,{json:()=>VY});var j={};__webpack_require__.r(j),__webpack_require__.d(j,{json:()=>HY});var A={};__webpack_require__.r(A),__webpack_require__.d(A,{json:()=>GY});
vendor: 4,625 bytes, line 2
2var C={};__webpack_require__.r(C),__webpack_require__.d(C,{json:()=>qY});var M={};__webpack_require__.r(M),__webpack_require__.d(M,{json:()=>KY});var D={};__webpack_require__.r(D),__webpack_require__.d(D,{json:()=>XY});var O={};__webpack_require__.r(O),__webpack_require__.d(O,{json:()=>YY});var R={};__webpack_require__.r(R),__webpack_require__.d(R,{json:()=>JY});var B={};__webpack_require__.r(B),__webpack_require__.d(B,{json:()=>ZY});var P={};__webpack_require__.r(P),__webpack_require__.d(P,{json:()=>QY});var L={};__webpack_require__.r(L),__webpack_require__.d(L,{json:()=>eJ});var W={};__webpack_require__.r(W),__webpack_require__.d(W,{json:()=>tJ});class U{constructor(e,t){this.backend=e,this.dataMover=t,this.data=new WeakMap,this.dataIdsCount=0}get(e){return this.data.has(e)||this.dataMover.moveData(this.backend,e),this.data.get(e)}set(e,t){this.dataIdsCount++,this.data.set(e,t)}has(e){return this.data.has(e)}delete(e){return this.dataIdsCount--,this.data.delete(e)}numDataIds(){return this.dataIdsCount}}class z{refCount(e){return V("refCount")}incRef(e){return V("incRef")}timerAvailable(){return!0}time(e){return V("time")}read(e){return V("read")}readSync(e){return V("readSync")}numDataIds(){return V("numDataIds")}disposeData(e,t){return V("disposeData")}write(e,t,n){return V("write")}move(e,t,n,r,o){return V("move")}memory(){return V("memory")}floatPrecision(){return V("floatPrecision")}epsilon(){return 32===this.floatPrecision()?1e-7:1e-4}dispose(){return V("dispose")}}function V(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 H(e,t,n){return Math.max(e,Math.min(t,n))}function G(e){return e%2==0?e:e+1}function q(e,t){if(!e)throw new Error("string"==typeof t?t:t())}function K(e,t,n=""){q(Z(e,t),()=>n+` Shapes ${e} and ${t} must match`)}function X(e){q(null!=e,()=>"The input to the tensor constructor must be a non-null value.")}function Y(e,t=[],n=!1){if(null==t&&(t=[]),Array.isArray(e)||se(e)&&!n)for(let r=0;r<e.length;++r)Y(e[r],t,n);else t.push(e);return t}function J(e){if(0===e.length)return 1;let t=e[0];for(let n=1;n<e.length;n++)t*=e[n];return t}function Z(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Q(e){return e%1==0}function ee(e){const t=Math.ceil(Math.sqrt(e));return[t,Math.ceil(e/t)]}function te(e,t){return t<=e.length?e:e+" ".repeat(t-e.length)}function ne(e,t=e=>0,n){return new Promise((r,o)=>{let i=0;const a=()=>{if(e())return void r();i++;const s=t(i);null!=n&&i>=n?o():setTimeout(a,s)};a()})}function re(e,t){const n=t.length;return q((e=null==e?t.map((e,t)=>t):[].concat(e)).every(e=>e>=-n&&e<n),()=>`All values in axis param must be in range [-${n}, ${n}) but got axis ${e}`),q(e.every(e=>Q(e)),()=>`All values in axis param must be integers but got axis ${e}`),e.map(e=>e<0?n+e:e)}function oe(e,t){const n=[],r=[],o=null!=t&&Array.isArray(t)&&0===t.length,i=null==t||o?null:re(t,e).sort();let a=0;for(let t=0;t<e.length;++t){if(null!=i){if(i[a]===t&&1!==e[t])throw new Error(`Can't squeeze axis ${t} since its dim '${e[t]}' is not 1`);(null==i[a]||i[a]>t)&&1===e[t]&&(n.push(e[t]),r.push(t)),i[a]<=t&&a++}1!==e[t]&&(n.push(e[t]),r.push(t))}return{newShape:n,keptDims:r}}function ie(e,t){let n=null;if(null==e||"float32"===e)n=new Float32Array(t);else if("int32"===e)n=new Int32Array(t);else{if("bool"!==e)throw new Error(`Unknown data type ${e}`);n=new Uint8Array(t)}return n}function ae(e,t){let n=null;if(null==e||"float32"===e)n=new Float32Array(t);else if("int32"===e)n=new Int32Array(t);else if("bool"===e)n=new Uint8Array(t);else{if("string"!==e)throw new Error(`Unknown data type ${e}`);n=new Array(t)}return n}function se(e){return e instanceof Float32Array||e instanceof Int32Array||e instanceof Uint8Array}function le(e){if("float32"===e||"int32"===e)return 4;if("complex64"===e)return 8;if("bool"===e)return 1;throw new Error(`Unknown dtype ${e}`)}function ue(e){return"string"==typeof e||e instanceof String}function pe(e){return Array.isArray(e)?pe(e[0]):e instanceof Float32Array?"float32":e instanceof Int32Array||e instanceof Uint8Array?"int32":"number"==typeof e?"float32":ue(e)?"string":"boolean"==typeof e?"bool":"float32"}function ce(e){return!!(e&&e.constructor&&e.call&&e.apply)}function de(e,t){for(let n=t;n<e;++n)if(e%n===0)return n;return e}function he(e){const t=e.length;if(t<2)return[];const n=new Array(t-1);n[t-2]=e[t-1];for(let r=t-3;r>=0;--r)n[r]=n[r+1]*e[r+1];return n}function fe(e,t,n,r=!1){const o=new Array;
vendor: 7,713 bytes, line 2
2if(1===t.length){const i=t[0]*(r?2:1);for(let t=0;t<i;t++)o[t]=n[e+t]}else{const i=t[0],a=t.slice(1),s=a.reduce((e,t)=>e*t)*(r?2:1);for(let t=0;t<i;t++)o[t]=fe(e+t*s,a,n,r)}return o}function ge(e,t,n=!1){if(0===e.length)return t[0];const r=e.reduce((e,t)=>e*t)*(n?2:1);if(0===r)return[];if(r!==t.length)throw new Error(`[${e}] does not match the input size ${t.length}${n?" for a complex tensor":""}.`);return fe(0,e,t,n)}function me(e,t){const n=ye(e,t);for(let e=0;e<n.length;e++)n[e]=1;return n}function ye(e,t){if(null==t||"float32"===t||"complex64"===t)return new Float32Array(e);if("int32"===t)return new Int32Array(e);if("bool"===t)return new Uint8Array(e);throw new Error(`Unknown data type ${t}`)}function be(e){e.forEach(t=>{q(Number.isInteger(t)&&t>=0,()=>`Tensor must have a shape comprised of positive integers but got shape [${e}].`)})}function $e(e){return e&&e.then&&"function"==typeof e.then}function _e(...e){ke().getBool("IS_TEST")||ke().getBool("PROD")||console.warn(...e)}function we(...e){ke().getBool("IS_TEST")||ke().getBool("PROD")||console.log(...e)}const xe="tfjsflags";class Se{constructor(e){this.global=e,this.flags={},this.flagRegistry={},this.urlFlags={},this.getQueryParams=ve,this.populateURLFlags()}setPlatform(e,t){null!=this.platform&&_e(`Platform ${this.platformName} has already been set. Overwriting the platform with ${t}.`),this.platformName=e,this.platform=t}registerFlag(e,t,n){if(this.flagRegistry[e]={evaluationFn:t,setHook:n},null!=this.urlFlags[e]){const t=this.urlFlags[e];_e(`Setting feature override from URL ${e}: ${t}.`),this.set(e,t)}}async getAsync(e){return e in this.flags||(this.flags[e]=await this.evaluateFlag(e)),this.flags[e]}get(e){if(e in this.flags)return this.flags[e];const t=this.evaluateFlag(e);if($e(t))throw new Error(`Flag ${e} cannot be synchronously evaluated. Please use getAsync() instead.`);return this.flags[e]=t,this.flags[e]}getNumber(e){return this.get(e)}getBool(e){return this.get(e)}getFlags(){return this.flags}get features(){return this.flags}set(e,t){if(null==this.flagRegistry[e])throw new Error(`Cannot set flag ${e} as it has not been registered.`);this.flags[e]=t,null!=this.flagRegistry[e].setHook&&this.flagRegistry[e].setHook(t)}evaluateFlag(e){if(null==this.flagRegistry[e])throw new Error(`Cannot evaluate flag '${e}': no evaluation function found.`);return this.flagRegistry[e].evaluationFn()}setFlags(e){this.flags=Object.assign({},e)}reset(){this.flags={},this.urlFlags={},this.populateURLFlags()}populateURLFlags(){if(void 0===this.global||void 0===this.global.location||void 0===this.global.location.search)return;const e=this.getQueryParams(this.global.location.search);xe in e&&e[xe].split(",").forEach(e=>{const[t,n]=e.split(":");this.urlFlags[t]=function(e,t){if("true"===(t=t.toLowerCase())||"false"===t)return"true"===t;if(""+ +t===t)return+t;throw new Error(`Could not parse value flag value ${t} for flag ${e}.`)}(t,n)})}}function ve(e){const t={};return e.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g,(e,...n)=>(function(e,t,n){e[decodeURIComponent(t)]=decodeURIComponent(n||"")}(t,n[0],n[1]),n.join("="))),t}function ke(){return Ie}let Ee,Ie=null;function Te(){if(null==Ee){let e;if("undefined"!=typeof window)e=window;else if(void 0!==__webpack_require__.g)e=__webpack_require__.g;else if("undefined"!=typeof process)e=process;else{if("undefined"==typeof self)throw new Error("Could not find a global object");e=self}Ee=e}return Ee}function Fe(e,t){const n=function(){const e=Te();return null==e._tfGlobals&&(e._tfGlobals=new Map),e._tfGlobals}();if(n.has(e))return n.get(e);{const r=t();return n.set(e,r),n.get(e)}}const Ne="Abs",je="Acos",Ae="Acosh",Ce="Add",Me="AddN",De="ArgMax",Oe="ArgMin",Re="Asin",Be="Asinh",Pe="Atan",Le="Atanh",We="Atan2",Ue="AvgPool",ze="AvgPoolGrad",Ve="AvgPool3D",He="AvgPool3DGrad",Ge="BatchMatMul",qe="BatchToSpaceND",Ke="Bincount",Xe="Cast",Ye="Ceil",Je="ClipByValue",Ze="Complex",Qe="ComplexAbs",et="Concat",tt="Conv2D",nt="Conv2DBackpropFilter",rt="Conv2DBackpropInput",ot="Conv3D",it="Conv3DBackpropFilterV2",at="Conv3DBackpropInputV2",st="Cos",lt="Cosh",ut="Cumsum",pt="CropAndResize",ct="DenseBincount",dt="DepthToSpace",ht="DepthwiseConv2dNative",ft="DepthwiseConv2dNativeBackpropFilter",gt="DepthwiseConv2dNativeBackpropInput",mt="Dilation2D",yt="RealDiv",bt="Einsum",$t="Elu",_t="EluGrad",wt="Erf",xt="Equal",St="Exp",vt="ExpandDims",kt="Expm1",Et="Fill",It="FlipLeftRight",Tt="Floor",Ft="FloorDiv",Nt="FusedBatchNorm",jt="GatherV2",At="GatherNd",Ct="Greater",Mt="GreaterEqual",Dt="Identity",Ot="IFFT",Rt="Imag",Bt="IsFinite",Pt="IsInf",Lt="IsNan",Wt="LeakyRelu",Ut="Less",zt="LessEqual",Vt="LinSpace",Ht="Log",Gt="Log1p",qt="LogicalAnd",Kt="LogicalNot",Xt="LogicalOr",Yt="LRN",Jt="LRNGrad",Zt="Max",Qt="Maximum",en="MaxPool",tn="MaxPoolGrad",nn="MaxPool3D",rn="MaxPool3DGrad",on="MaxPoolWithArgmax",an="Mean",sn="Min",ln="Minimum",un="MirrorPad",pn="Mod",cn="Multinomial",dn="Multiply",hn="Neg",fn="NotEqual",gn="NonMaxSuppressionV3",mn="NonMaxSuppressionV4",yn="NonMaxSuppressionV5",bn="OnesLike",$n="OneHot",_n="Pack",wn="PadV2",xn="Pow",Sn="Prelu",vn="Prod",kn="Range",En="Real",In="Reciprocal",Tn="Relu",Fn="Reshape",Nn="ResizeNearestNeighbor",jn="ResizeNearestNeighborGrad",An="ResizeBilinear",Cn="ResizeBilinearGrad",Mn="Relu6",Dn="Reverse",On="Round",Rn="Rsqrt",Bn="ScatterNd",Pn="Select",Ln="Selu",Wn="Slice",Un="Sin",zn="Sinh",Vn="Sign",Hn="Sigmoid",Gn="Softplus",qn="Sqrt",Kn="Sum",Xn="SpaceToBatchND",Yn="SplitV",Jn="Softmax",Zn="SparseFillEmptyRows",Qn="SparseReshape",er="SparseSegmentMean",tr="SparseSegmentSum",nr="SparseToDense",rr="SquaredDifference",or="Square",ir="StridedSlice",ar="StringNGrams",sr="StringSplit",lr="StringToHashBucketFast",ur="Sub",pr="Tan",cr="Tanh",dr="Tile",hr="TopK",fr="Transform",gr="Transpose",mr="Unique",yr="Unpack",br="UnsortedSegmentSum",$r="ZerosLike",_r="Step",wr="FromPixels",xr="RotateWithOffset",Sr="_FusedMatMul",vr="FusedConv2D",kr="FusedDepthwiseConv2D",Er=Fe("kernelRegistry",()=>new Map),Ir=Fe("gradRegistry",()=>new Map);function Tr(e,t){const n=Cr(e,t);return Er.get(n)}function Fr(e){return Ir.get(e)}function Nr(e){const t=Er.entries(),n=[];for(;;){const{done:r,value:o}=t.next();if(r)break;const[i,a]=o,[s]=i.split("_");s===e&&n.push(a)}return n}function jr(e){const{kernelName:t,backendName:n}=e,r=Cr(t,n);Er.has(r)&&_e(`The kernel '${t}' for backend '${n}' is already registered`),Er.set(r,e)}function Ar(e){const{kernelName:t}=e;Ir.has(t)&&ke().getBool("DEBUG")&&_e(`Overriding the gradient for '${t}'`),Ir.set(t,e)}function Cr(e,t){return`${t}_${e}`}var Mr=__webpack_require__(570),Dr=__webpack_require__.n(Mr);const Or=Dr()||Mr;function Rr(e){return Or.fromString(e,!0,16)}function Br(e,t){return"string"===t?Wr(e):Pr([e],t)}function Pr(e,t){if("string"===t)throw new Error("Cannot convert a string[] to a TypedArray");if(Array.isArray(e)&&(e=Y(e)),ke().getBool("DEBUG")&&function(e,t){for(let n=0;n<e.length;n++){const r=e[n];if(isNaN(r)||!isFinite(r))throw Error(`A tensor of type ${t} being uploaded contains ${r}.`)}}(e,t),function(e,t){return e instanceof Float32Array&&"float32"===t||e instanceof Int32Array&&"int32"===t||e instanceof Uint8Array&&"bool"===t}(e,t))return e;if(null==t||"float32"===t||"complex64"===t)return new Float32Array(e);if("int32"===t)return new Int32Array(e);if("bool"===t){const t=new Uint8Array(e.length);for(let n=0;n<t.length;++n)0!==Math.round(e[n])&&(t[n]=1);return t}throw new Error(`Unknown data type ${t}`)}function Lr(){return ke().platform.now()}function Wr(e,t="utf-8"){return t=t||"utf-8",ke().platform.encode(e,t)}function Ur(e,t="utf-8"){return t=t||"utf-8",ke().platform.decode(e,t)}Rr("c3a5c85c97cb3127"),Rr("b492b66fbe98f273"),Rr("9ae16a3b2f90404f");
vendor: 5,264 bytes, line 2
2class zr{constructor(e,t){this.backendTimer=e,this.logger=t,null==t&&(this.logger=new Hr)}profileKernel(e,t,n){let r;const o=()=>{r=n()};let i;const a=Lr();if(this.backendTimer.timerAvailable())i=this.backendTimer.time(o);else{o();for(const e of r)e.dataSync();i=Promise.resolve({kernelMs:Lr()-a})}if(ke().getBool("CHECK_COMPUTATION_FOR_ERRORS"))for(let t=0;t<r.length;t++){const n=r[t];n.data().then(t=>{Vr(t,n.dtype,e)})}return{kernelName:e,outputs:r,inputs:t,timeMs:i.then(e=>e.kernelMs),extraInfo:i.then(e=>null!=e.getExtraProfileInfo?e.getExtraProfileInfo():"")}}logKernelProfile(e){const{kernelName:t,outputs:n,timeMs:r,inputs:o,extraInfo:i}=e;n.forEach(e=>{Promise.all([e.data(),r,i]).then(n=>{this.logger.logKernelProfile(t,e,n[0],n[1],o,n[2])})})}}function Vr(e,t,n){if("float32"!==t)return!1;for(let t=0;t<e.length;t++){const r=e[t];if(isNaN(r)||!isFinite(r))return console.warn(`Found ${r} in the result of '${n}'`),!0}return!1}class Hr{logKernelProfile(e,t,n,r,o,i){const a="number"==typeof r?te(`${r}ms`,9):r.error,s=te(e,25),l=t.rank,u=t.size,p=te(t.shape.toString(),14);let c="";for(const e in o){const n=o[e];if(null!=n){const r=n.shape||t.shape,o=r.length;c+=`${e}: ${o}D ${o>0?r:""} `}}console.log(`%c${s}\t%c${a}\t%c${l}D ${p}\t%c${u}\t%c${c}\t%c${i}`,"font-weight:bold","color:red","color:blue","color: orange","color: green","color: steelblue")}}function Gr(e,t,n,r){const o=he(t),i=function(e,t,n,r){const o=J(t),i=r[r.length-1],a=new Array(i).fill(0),s=t.length,l="complex64"===n?Yr(e):e;if(s>1)for(let e=0;e<o/i;e++){const t=e*i;for(let e=0;e<i;e++)a[e]=Math.max(a[e],qr(l[t+e],0,n).length)}return a}(e,t,n,o),a=t.length,s=Xr(e,t,n,o,i),l=["Tensor"];return r&&(l.push(`  dtype: ${n}`),l.push(`  rank: ${a}`),l.push(`  shape: [${t}]`),l.push("  values:")),l.push(s.map(e=>"    "+e).join("\n")),l.join("\n")}function qr(e,t,n){let r;return r=Array.isArray(e)?`${parseFloat(e[0].toFixed(7))} + ${parseFloat(e[1].toFixed(7))}j`:ue(e)?`'${e}'`:"bool"===n?Kr(e):parseFloat(e.toFixed(7)).toString(),te(r,t)}function Kr(e){return 0===e?"false":"true"}function Xr(e,t,n,r,o,i=!0){const a="complex64"===n?2:1,s=t[0],l=t.length;if(0===l)return"complex64"===n?[qr(Yr(e)[0],0,n)]:"bool"===n?[Kr(e[0])]:[e[0].toString()];if(1===l){if(s>20){const t=3*a;let r=Array.from(e.slice(0,t)),i=Array.from(e.slice((s-3)*a,s*a));return"complex64"===n&&(r=Yr(r),i=Yr(i)),["["+r.map((e,t)=>qr(e,o[t],n)).join(", ")+", ..., "+i.map((e,t)=>qr(e,o[s-3+t],n)).join(", ")+"]"]}return["["+("complex64"===n?Yr(e):Array.from(e)).map((e,t)=>qr(e,o[t],n)).join(", ")+"]"]}const u=t.slice(1),p=r.slice(1),c=r[0]*a,d=[];if(s>20){for(let t=0;t<3;t++){const r=t*c,i=r+c;d.push(...Xr(e.slice(r,i),u,n,p,o,!1))}d.push("...");for(let t=s-3;t<s;t++){const r=t*c,i=r+c;d.push(...Xr(e.slice(r,i),u,n,p,o,t===s-1))}}else for(let t=0;t<s;t++){const r=t*c,i=r+c;d.push(...Xr(e.slice(r,i),u,n,p,o,t===s-1))}const h=2===l?",":"";d[0]="["+d[0]+h;for(let e=1;e<d.length-1;e++)d[e]=" "+d[e]+h;let f=",\n";for(let e=2;e<l;e++)f+="\n";return d[d.length-1]=" "+d[d.length-1]+"]"+(i?"":f),d}function Yr(e){const t=[];for(let n=0;n<e.length;n+=2)t.push([e[n],e[n+1]]);return t}class Jr{constructor(e,t,n){if(this.dtype=t,this.shape=e.slice(),this.size=J(e),null!=n){const e=n.length;q(e===this.size,()=>`Length of values '${e}' does not match the size inferred by the shape '${this.size}'.`)}if("complex64"===t)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||ae(t,this.size),this.strides=he(e)}set(e,...t){0===t.length&&(t=[0]),q(t.length===this.rank,()=>`The number of provided coordinates (${t.length}) must match the rank (${this.rank})`);const n=this.locToIndex(t);this.values[n]=e}get(...e){0===e.length&&(e=[0]);let t=0;for(const n of e){if(n<0||n>=this.shape[t]){const t=`Requested out of range element at ${e}.   Buffer shape=${this.shape}`;throw new Error(t)}t++}let n=e[e.length-1];for(let t=0;t<e.length-1;++t)n+=this.strides[t]*e[t];return this.values[n]}locToIndex(e){if(0===this.rank)return 0;if(1===this.rank)return e[0];let t=e[e.length-1];for(let n=0;n<e.length-1;++n)t+=this.strides[n]*e[n];return t}indexToLoc(e){if(0===this.rank)return[];if(1===this.rank)return[e];const t=new Array(this.shape.length);for(let n=0;n<t.length-1;++n)t[n]=Math.floor(e/this.strides[n]),e-=t[n]*this.strides[n];return t[t.length-1]=e,t}get rank(){return this.shape.length}toTensor(){return Zr().makeTensor(this.values,this.shape,this.dtype)}}let Zr=null,Qr=null,eo=null;class to{constructor(e,t,n,r){this.kept=!1,this.isDisposedInternal=!1,this.shape=e.slice(),this.dtype=t||"float32",this.size=J(e),this.strides=he(e),this.dataId=n,this.id=r,this.rankType=this.rank<5?this.rank.toString():"higher"}get rank(){return this.shape.length}async buffer(){const e=await this.data();return Qr.buffer(this.shape,this.dtype,e)}bufferSync(){return Qr.buffer(this.shape,this.dtype,this.dataSync())}async array(){const e=await this.data();return ge(this.shape,e,"complex64"===this.dtype)}arraySync(){return ge(this.shape,this.dataSync(),"complex64"===this.dtype)}async data(){this.throwIfDisposed();const e=Zr().read(this.dataId);if("string"===this.dtype){const t=await e;
vendor: 24,661 bytes, line 2
2try{return t.map(e=>Ur(e))}catch(e){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();const e=Zr().readSync(this.dataId);if("string"===this.dtype)try{return e.map(e=>Ur(e))}catch(e){throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().")}return e}async bytes(){this.throwIfDisposed();const e=await Zr().read(this.dataId);return"string"===this.dtype?e:new Uint8Array(e.buffer)}dispose(){this.isDisposed||(Zr().disposeTensor(this),this.isDisposedInternal=!0)}get isDisposed(){return this.isDisposedInternal}throwIfDisposed(){if(this.isDisposed)throw new Error("Tensor is disposed.")}print(e=!1){return Qr.print(this,e)}clone(){return this.throwIfDisposed(),Qr.clone(this)}toString(e=!1){return Gr(this.dataSync(),this.shape,this.dtype,e)}cast(e){return this.throwIfDisposed(),Qr.cast(this,e)}variable(e=!0,t,n){return this.throwIfDisposed(),Zr().makeVariable(this,e,t,n)}}function no(){return Fe("Tensor",()=>to)}Object.defineProperty(to,Symbol.hasInstance,{value:e=>!!e&&null!=e.data&&null!=e.dataSync&&null!=e.throwIfDisposed}),no();class ro extends to{constructor(e,t,n,r){super(e.shape,e.dtype,e.dataId,r),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(!Z(e.shape,this.shape))throw new Error(`shape of the new value (${e.shape}) and previous value (${this.shape}) must match`);Zr().disposeTensor(this),this.dataId=e.dataId,Zr().incRef(this,null)}dispose(){Zr().disposeVariable(this),this.isDisposedInternal=!0}}var oo,io,ao,so,lo;Object.defineProperty(ro,Symbol.hasInstance,{value:e=>e instanceof to&&null!=e.assign&&e.assign instanceof Function}),function(e){e.R0="R0",e.R1="R1",e.R2="R2",e.R3="R3",e.R4="R4",e.R5="R5",e.R6="R6"}(oo||(oo={})),function(e){e.float32="float32",e.int32="int32",e.bool="int32",e.complex64="complex64"}(io||(io={})),function(e){e.float32="float32",e.int32="int32",e.bool="bool",e.complex64="complex64"}(ao||(ao={})),function(e){e.float32="float32",e.int32="float32",e.bool="float32",e.complex64="complex64"}(so||(so={})),function(e){e.float32="complex64",e.int32="complex64",e.bool="complex64",e.complex64="complex64"}(lo||(lo={}));const uo={float32:so,int32:io,bool:ao,complex64:lo};function po(e,t){if("string"===e||"string"===t){if("string"===e&&"string"===t)return"string";throw new Error(`Can not upcast ${e} with ${t}`)}return uo[e][t]}function co(e){return po(e,"int32")}function ho(e,t){if(e.dtype===t.dtype)return[e,t];const n=po(e.dtype,t.dtype);return[e.cast(n),t.cast(n)]}function fo(e){const t=[];return go(e,t,new Set),t}function go(e,t,n){if(null==e)return;if(e instanceof to)return void t.push(e);if(r=e,!Array.isArray(r)&&"object"!=typeof r)return;var r;const o=e;for(const e in o){const r=o[e];n.has(r)||(n.add(r),go(r,t,n))}}function mo(e){return null!=e.kernelName}class yo{constructor(){this.registeredVariables={},this.nextTapeNodeId=0,this.numBytes=0,this.numTensors=0,this.numStringTensors=0,this.numDataBuffers=0,this.gradientDepth=0,this.kernelDepth=0,this.scopeStack=[],this.numDataMovesStack=[],this.nextScopeId=0,this.tensorInfo=new WeakMap,this.profiling=!1,this.activeProfile={newBytes:0,newTensors:0,peakBytes:0,kernels:[],result:null,get kernelNames(){return Array.from(new Set(this.kernels.map(e=>e.name)))}}}dispose(){for(const e in this.registeredVariables)this.registeredVariables[e].dispose()}}class bo{constructor(e){this.ENV=e,this.registry={},this.registryFactory={},this.pendingBackendInitId=0,this.state=new yo}async ready(){if(null!=this.pendingBackendInit)return this.pendingBackendInit.then(()=>{});if(null!=this.backendInstance)return;const e=this.getSortedBackends();for(let t=0;t<e.length;t++){const n=e[t];if(await this.initializeBackend(n).success)return void await this.setBackend(n)}throw new Error("Could not initialize any backends, all backend initializations failed.")}get backend(){if(null!=this.pendingBackendInit)throw new Error(`Backend '${this.backendName}' has not yet been initialized. Make sure to await tf.ready() or await tf.setBackend() before calling other methods`);if(null==this.backendInstance){const{name:e,asyncInit:t}=this.initializeBackendsAndReturnBest();if(t)throw new Error(`The highest priority backend '${e}' has not yet been initialized. Make sure to await tf.ready() or await tf.setBackend() before calling other methods`);this.setBackend(e)}return this.backendInstance}backendNames(){return Object.keys(this.registryFactory)}findBackend(e){if(!(e in this.registry)){if(!(e in this.registryFactory))return null;{const{asyncInit:t}=this.initializeBackend(e);if(t)return null}}return this.registry[e]}findBackendFactory(e){return e in this.registryFactory?this.registryFactory[e].factory:null}registerBackend(e,t,n=1){return e in this.registryFactory?(_e(`${e} backend was already registered. Reusing existing backend factory.`),!1):(this.registryFactory[e]={factory:t,priority:n},!0)}async setBackend(e){if(null==this.registryFactory[e])throw new Error(`Backend name '${e}' not found in registry`);if(this.backendName=e,null==this.registry[e]){this.backendInstance=null;const{success:t,asyncInit:n}=this.initializeBackend(e);if(!(n?await t:t))return!1}return this.backendInstance=this.registry[e],this.setupRegisteredKernels(),this.profiler=new zr(this.backendInstance),!0}setupRegisteredKernels(){Nr(this.backendName).forEach(e=>{null!=e.setupFunc&&e.setupFunc(this.backendInstance)})}disposeRegisteredKernels(e){Nr(e).forEach(t=>{null!=t.disposeFunc&&t.disposeFunc(this.registry[e])})}initializeBackend(e){const t=this.registryFactory[e];if(null==t)throw new Error(`Cannot initialize backend ${e}, no registration found.`);try{const n=t.factory();if(!n||n instanceof z||"function"!=typeof n.then)return this.registry[e]=n,{success:!0,asyncInit:!1};{const t=++this.pendingBackendInitId,r=n.then(n=>!(t<this.pendingBackendInitId||(this.registry[e]=n,this.pendingBackendInit=null,0))).catch(n=>(t<this.pendingBackendInitId||(this.pendingBackendInit=null,_e(`Initialization of backend ${e} failed`),_e(n.stack||n.message)),!1));return this.pendingBackendInit=r,{success:r,asyncInit:!0}}}catch(t){return _e(`Initialization of backend ${e} failed`),_e(t.stack||t.message),{success:!1,asyncInit:!1}}}removeBackend(e){if(!(e in this.registryFactory))throw new Error(`${e} backend not found in registry`);this.backendName===e&&null!=this.pendingBackendInit&&this.pendingBackendInitId++,e in this.registry&&(this.disposeRegisteredKernels(e),this.registry[e].dispose(),delete this.registry[e]),delete this.registryFactory[e],this.backendName===e&&(this.pendingBackendInit=null,this.backendName=null,this.backendInstance=null)}getSortedBackends(){if(0===Object.keys(this.registryFactory).length)throw new Error("No backend found in registry.");return Object.keys(this.registryFactory).sort((e,t)=>this.registryFactory[t].priority-this.registryFactory[e].priority)}initializeBackendsAndReturnBest(){const e=this.getSortedBackends();for(let t=0;t<e.length;t++){const n=e[t],{success:r,asyncInit:o}=this.initializeBackend(n);if(o||r)return{name:n,asyncInit:o}}throw new Error("Could not initialize any backends, all backend initializations failed.")}moveData(e,t){const n=this.state.tensorInfo.get(t),r=n.backend,o=this.readSync(t),i=r.refCount(t);r.disposeData(t,!0),n.backend=e,e.move(t,o,n.shape,n.dtype,i),this.shouldCheckForMemLeaks()&&this.state.numDataMovesStack[this.state.numDataMovesStack.length-1]++}tidy(e,t){let n,r=null;if(null==t){if("function"!=typeof e)throw new Error("Please provide a function to tidy()");t=e}else{if("string"!=typeof e&&!(e instanceof String))throw new Error("When calling with two arguments, the first argument to tidy() must be a string");if("function"!=typeof t)throw new Error("When calling with two arguments, the 2nd argument to tidy() must be a function");r=e}return this.scopedRun(()=>this.startScope(r),()=>this.endScope(n),()=>(n=t(),n instanceof Promise&&console.error("Cannot return a Promise inside of tidy."),n))}scopedRun(e,t,n){e();try{const e=n();return t(),e}catch(e){throw t(),e}}nextTensorId(){return bo.nextTensorId++}nextVariableId(){return bo.nextVariableId++}clone(e){const t=_o.runKernel(Dt,{x:e}),n={x:e};return this.addTapeNode(this.state.activeScope.name,n,[t],e=>({x:()=>{const t={x:e};return _o.runKernel(Xe,t,{dtype:"float32"})}}),[],{}),t}runKernel(e,t,n){if(null==this.backendName&&this.backend,null==Tr(e,this.backendName))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){const r=this.backend.numDataIds();let o=0;n.forEach(e=>{o+="complex64"===e.dtype?3:1});const i=this.state.numDataMovesStack[this.state.numDataMovesStack.length-1],a=r-t-o-i;if(a>0)throw new Error(`Backend '${this.backendName}' has an internal memory leak (${a} data ids) after running '${e}'`)}runKernelFunc(e){let t,n=[];const r=this.isTapeOn(),o=this.state.numBytes,i=this.state.numTensors;let a,s;this.shouldCheckForMemLeaks()&&this.state.numDataMovesStack.push(0),null==this.backendName&&this.backend;const l=mo(e)?e.kernelName:null!=this.state.activeScope?this.state.activeScope.name:"";if(mo(e)){const{kernelName:t,inputs:o,attrs:i}=e;null==this.backendName&&this.backend;const l=Tr(t,this.backendName);q(null!=l,()=>`Cannot find registered kernel '${t}' for backend '${this.backendName}'`),a=()=>{const e=this.backend.numDataIds();s=l.kernelFunc({inputs:o,attrs:i,backend:this.backend});const a=Array.isArray(s)?s:[s];this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(t,e,a);const u=a.map(e=>{if(null!=e.rank)return e;const{dataId:t,shape:n,dtype:r}=e;return this.makeTensorFromDataId(t,n,r)});if(r){const e=this.getTensorsForGradient(t,o,u);n=this.saveTensorsForBackwardMode(e)}return u}}else{const{forwardFunc:t}=e,o=e=>{r&&(n=e.map(e=>this.keep(this.clone(e))))};a=()=>{const e=this.backend.numDataIds();s=this.tidy(()=>t(this.backend,o));const n=Array.isArray(s)?s:[s];return this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(l,e,n),n}}const{inputs:u,attrs:p}=e,c=mo(e)?null:e.backwardsFunc;let d;return this.scopedRun(()=>this.state.kernelDepth++,()=>this.state.kernelDepth--,()=>{this.ENV.getBool("DEBUG")||this.state.profiling?(d=this.profiler.profileKernel(l,u,()=>a()),this.ENV.getBool("DEBUG")&&this.profiler.logKernelProfile(d),t=d.outputs):t=a()}),r&&this.addTapeNode(l,u,t,c,n,p),this.state.profiling&&this.state.activeProfile.kernels.push({name:l,bytesAdded:this.state.numBytes-o,totalBytesSnapshot:this.state.numBytes,tensorsAdded:this.state.numTensors-i,totalTensorsSnapshot:this.state.numTensors,inputShapes:Object.keys(u).map(e=>null!=u[e]?u[e].shape:null),outputShapes:t.map(e=>e.shape),kernelTimeMs:d.timeMs,extraInfo:d.extraInfo}),Array.isArray(s)?t:t[0]}saveTensorsForBackwardMode(e){return e.map(e=>this.keep(this.clone(e)))}getTensorsForGradient(e,t,n){const r=Fr(e);if(null!=r){const e=r.inputsToSave||[],o=r.outputsToSave||[];let i;r.saveAllInputs?(q(Array.isArray(t),()=>"saveAllInputs is true, expected inputs to be an array."),i=Object.keys(t).map(e=>t[e])):i=e.map(e=>t[e]);const a=n.filter((e,t)=>o[t]);return i.concat(a)}return[]}makeTensor(e,t,n,r){if(null==e)throw new Error("Values passed to engine.makeTensor() are null");n=n||"float32",r=r||this.backend;let o=e;"string"===n&&ue(e[0])&&(o=e.map(e=>Wr(e)));const i=r.write(o,t,n),a=new to(t,n,i,this.nextTensorId());if(this.trackTensor(a,r),"string"===n){const e=this.state.tensorInfo.get(i),t=function(e){if(null==e)return 0;let t=0;return e.forEach(e=>t+=e.length),t}(o);this.state.numBytes+=t-e.bytes,e.bytes=t}return a}makeTensorFromDataId(e,t,n,r){const o=new to(t,n=n||"float32",e,this.nextTensorId());return this.trackTensor(o,r),o}makeVariable(e,t=!0,n,r){n=n||this.nextVariableId().toString(),null!=r&&r!==e.dtype&&(e=e.cast(r));const o=new ro(e,t,n,this.nextTensorId());if(null!=this.state.registeredVariables[o.name])throw new Error(`Variable with name ${o.name} was already registered`);return this.state.registeredVariables[o.name]=o,this.incRef(o,this.backend),o}trackTensor(e,t){this.state.numTensors++,"string"===e.dtype&&this.state.numStringTensors++;let n=0;"complex64"!==e.dtype&&"string"!==e.dtype&&(n=e.size*le(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 ro||this.track(e)}incRef(e,t){this.trackTensor(e,t),this.backend.incRef(e.dataId)}removeDataId(e,t){this.state.tensorInfo.has(e)&&this.state.tensorInfo.get(e).backend===t&&(this.state.tensorInfo.delete(e),this.state.numDataBuffers--)}disposeTensor(e){if(!this.state.tensorInfo.has(e.dataId))return;const t=this.state.tensorInfo.get(e.dataId);if(this.state.numTensors--,"string"===e.dtype&&(this.state.numStringTensors--,this.state.numBytes-=t.bytes),"complex64"!==e.dtype&&"string"!==e.dtype){const t=e.size*le(e.dtype);this.state.numBytes-=t}t.backend.disposeData(e.dataId)&&this.removeDataId(e.dataId,t.backend)}disposeVariables(){for(const e in this.state.registeredVariables){const t=this.state.registeredVariables[e];this.disposeVariable(t)}}disposeVariable(e){this.disposeTensor(e),null!=this.state.registeredVariables[e.name]&&delete this.state.registeredVariables[e.name]}memory(){const e=this.backend.memory();return e.numTensors=this.state.numTensors,e.numDataBuffers=this.state.numDataBuffers,e.numBytes=this.state.numBytes,this.state.numStringTensors>0&&(e.unreliable=!0,null==e.reasons&&(e.reasons=[]),e.reasons.push("Memory usage by string tensors is approximate (2 bytes per character)")),e}async profile(e){this.state.profiling=!0;const t=this.state.numBytes,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(e=>e.totalBytesSnapshot)),this.state.activeProfile.newBytes=this.state.numBytes-t,this.state.activeProfile.newTensors=this.state.numTensors-n;for(const e of this.state.activeProfile.kernels)e.kernelTimeMs=await e.kernelTimeMs,e.extraInfo=await e.extraInfo;return this.state.activeProfile}isTapeOn(){return this.state.gradientDepth>0&&0===this.state.kernelDepth}addTapeNode(e,t,n,r,o,i){const a={id:this.state.nextTapeNodeId++,kernelName:e,inputs:t,outputs:n,saved:o},s=Fr(e);null!=s&&(r=s.gradFunc),null!=r&&(a.gradient=e=>(e=e.map((e,t)=>{if(null==e){const e=n[t],r=ye(e.size,e.dtype);return this.makeTensor(r,e.shape,e.dtype)}return e}),r(e.length>1?e:e[0],o,i))),this.state.activeTape.push(a)}keep(e){return e.kept=!0,e}startTape(){0===this.state.gradientDepth&&(this.state.activeTape=[]),this.state.gradientDepth++}endTape(){this.state.gradientDepth--}startScope(e){const t={track:[],name:"unnamed scope",id:this.state.nextScopeId++};e&&(t.name=e),this.state.scopeStack.push(t),this.state.activeScope=t}endScope(e){const t=fo(e),n=new Set(t.map(e=>e.id));for(let e=0;e<this.state.activeScope.track.length;e++){const t=this.state.activeScope.track[e];t.kept||n.has(t.id)||t.dispose()}const r=this.state.scopeStack.pop();this.state.activeScope=0===this.state.scopeStack.length?null:this.state.scopeStack[this.state.scopeStack.length-1],t.forEach(e=>{e.kept||e.scopeId!==r.id||this.track(e)})}gradients(e,t,n,r=!1){if(q(t.length>0,()=>"gradients() received an empty list of xs."),null!=n&&"float32"!==n.dtype)throw new Error(`dy must have 'float32' dtype, but has '${n.dtype}'`);const o=this.scopedRun(()=>this.startTape(),()=>this.endTape(),()=>this.tidy("forward",e));q(o instanceof to,()=>"The result y returned by f() must be a tensor.");const i=function(e,t,n){const r={},o={};for(let e=0;e<t.length;e++)r[t[e].id]=!0;for(let n=0;n<e.length;n++){const i=e[n],a=i.inputs;for(const e in a){const n=a[e];let s=!1;for(let e=0;e<t.length;e++)if(r[n.id]){i.outputs.forEach(e=>r[e.id]=!0),s=!0,o[i.id]=!0;break}if(s)break}}const i={};i[n.id]=!0;const a={};for(let t=e.length-1;t>=0;t--){const n=e[t],r=n.inputs;for(let e=0;e<n.outputs.length;e++)if(i[n.outputs[e].id]){for(const e in r)i[r[e].id]=!0,a[n.id]=!0;break}}const s=[];for(let t=0;t<e.length;t++){const n=e[t];if(o[n.id]&&a[n.id]){const e={};for(const t in n.inputs){const o=n.inputs[t];r[o.id]&&(e[t]=o)}const t=Object.assign({},n);t.inputs=e,t.outputs=n.outputs,s.push(t)}}return s}(this.state.activeTape,t,o);if(!r&&0===i.length&&t.length>0)throw new Error("Cannot compute gradient of y=f(x) with respect to x. Make sure that the f you passed encloses all operations that lead from x to y.");return this.tidy("backward",()=>{const e={};e[o.id]=null==n?function(e){const t=me(J(e),"float32");return _o.makeTensor(t,e,"float32")}(o.shape):n,function(e,t,n,r){for(let o=t.length-1;o>=0;o--){const i=t[o],a=[];if(i.outputs.forEach(t=>{const n=e[t.id];null!=n?a.push(n):a.push(null)}),null==i.gradient)throw new Error(`Cannot compute gradient: gradient function not found for ${i.kernelName}.`);const s=i.gradient(a);for(const t in i.inputs){if(!(t in s))throw new Error(`Cannot backprop through input ${t}. Available gradients found: ${Object.keys(s)}.`);const o=n(()=>s[t]());if("float32"!==o.dtype)throw new Error(`Error in gradient for op ${i.kernelName}. The gradient of input ${t} must have 'float32' dtype, but has '${o.dtype}'`);const a=i.inputs[t];if(!Z(o.shape,a.shape))throw new Error(`Error in gradient for op ${i.kernelName}. The gradient of input '${t}' has shape '${o.shape}', which does not match the shape of the input '${a.shape}'`);if(null==e[a.id])e[a.id]=o;else{const t=e[a.id];e[a.id]=r(t,o),t.dispose()}}}}(e,i,e=>this.tidy(e),wo);const r=t.map(t=>e[t.id]);return 0===this.state.gradientDepth&&(this.state.activeTape.forEach(e=>{for(const t of e.saved)t.dispose()}),this.state.activeTape=null),{value:o,grads:r}})}customGrad(e){return q(ce(e),()=>"The f passed in customGrad(f) must be a function."),(...t)=>{let n;q(t.every(e=>e instanceof to),()=>"The args passed in customGrad(f)(x1, x2,...) must all be tensors");const r={};return t.forEach((e,t)=>{r[t]=e}),this.runKernelFunc({forwardFunc:(r,o)=>(n=e(...t,o),q(n.value instanceof to,()=>"The function f passed in customGrad(f) must return an object where `obj.value` is a tensor"),q(ce(n.gradFunc),()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function."),n.value),backwardsFunc:(e,r)=>{const o=n.gradFunc(e,r),i=Array.isArray(o)?o:[o];q(i.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(...)."),q(i.every(e=>e instanceof to),()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns a list of only tensors.");const a={};return i.forEach((e,t)=>{a[t]=()=>e}),a},inputs:r})}}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){const t=Lr(),n=await this.backend.time(e);return n.wallMs=Lr()-t,n}track(e){return null!=this.state.activeScope&&(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 yo;for(const e in this.registry)this.disposeRegisteredKernels(e),this.registry[e].dispose(),delete this.registry[e];this.backendName=null,this.backendInstance=null,this.pendingBackendInit=null}}function $o(){const e=Te();if(null==e._tfengine){const t=new Se(e);e._tfengine=new bo(t)}var t;return t=e._tfengine.ENV,Ie=t,Zr=()=>e._tfengine,e._tfengine}bo.nextTensorId=0,bo.nextVariableId=0;const _o=$o();function wo(e,t){const n={a:e,b:t};return _o.runKernel(Ce,n)}function xo(e){if(e||"undefined"!=typeof navigator&&null!=navigator){if(e||(e=navigator),"ReactNative"===e.product)return!0;const t=e.userAgent||e.vendor||("undefined"!=typeof window?window.opera:"");if(!t){const t=e;return t.userAgentData&&t.userAgentData.mobile}return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(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 So(){return"undefined"!=typeof window&&null!=window.document||"undefined"!=typeof WorkerGlobalScope}const vo=ke();function ko(e,t){let n=e;if(se(e))return"string"===t?[]:[e.length];if(!Array.isArray(e))return[];const r=[];for(;Array.isArray(n)||se(n)&&"string"!==t;)r.push(n.length),n=n[0];return Array.isArray(e)&&ke().getBool("TENSORLIKE_CHECK_SHAPE_CONSISTENCY")&&Eo(e,r,[]),r}function Eo(e,t,n){if(n=n||[],!Array.isArray(e)&&!se(e))return void q(0===t.length,()=>`Element arr[${n.join("][")}] is a primitive, but should be an array/TypedArray of ${t[0]} elements`);q(t.length>0,()=>`Element arr[${n.join("][")}] should be a primitive, but is an array of ${e.length} elements`),q(e.length===t[0],()=>`Element arr[${n.join("][")}] should have ${t[0]} elements, but has ${e.length} elements`);const r=t.slice(1);for(let t=0;t<e.length;++t)Eo(e[t],r,n.concat(t))}function Io(e,t,n,r){if("string_or_numeric"!==e){if(null==e)throw new Error("Expected dtype cannot be null.");if("numeric"!==e&&e!==t||"numeric"===e&&"string"===t)throw new Error(`Argument '${n}' passed to '${r}' must be ${e} tensor, but got ${t} tensor`)}}function To(e,t,n,r="numeric"){if(e instanceof to)return Io(r,e.dtype,t,n),e;let o=pe(e);if("string"!==o&&["bool","int32","float32"].indexOf(r)>=0&&(o=r),Io(r,o,t,n),null==e||!se(e)&&!Array.isArray(e)&&"number"!=typeof e&&"boolean"!=typeof e&&"string"!=typeof e){const r=null==e?"null":e.constructor.name;throw new Error(`Argument '${t}' passed to '${n}' must be a Tensor or TensorLike, but got '${r}'`)}const i=ko(e,o);se(e)||Array.isArray(e)||(e=[e]);const a="string"!==o?Pr(e,o):Y(e,[],!0);return _o.makeTensor(a,i,o)}function Fo(e,t,n,r="numeric"){if(!Array.isArray(e))throw new Error(`Argument ${t} passed to ${n} must be a \`Tensor[]\` or \`TensorLike[]\``);return e.map((e,o)=>To(e,`${t}[${o}]`,n,r))}function No(e){const t=Object.keys(e);if(1!==t.length)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];const r=e[n];n.endsWith("_")&&(n=n.substring(0,n.length-1)),n+="__op";const o=(...e)=>{_o.startScope(n);try{const t=r(...e);return $e(t)&&console.error("Cannot return a Promise inside of tidy."),_o.endScope(t),t}catch(e){throw _o.endScope(null),e}};return Object.defineProperty(o,"name",{value:n,configurable:!0}),o}vo.registerFlag("DEBUG",()=>!1,e=>
2{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.")}),vo.registerFlag("IS_BROWSER",()=>So()),vo.registerFlag("IS_NODE",()=>"undefined"!=typeof process&&void 0!==process.versions&&void 0!==process.versions.node),vo.registerFlag("IS_CHROME",()=>"undefined"!=typeof navigator&&null!=navigator&&null!=navigator.userAgent&&/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)),vo.registerFlag("PROD",()=>!1),vo.registerFlag("TENSORLIKE_CHECK_SHAPE_CONSISTENCY",()=>vo.getBool("DEBUG")),vo.registerFlag("DEPRECATION_WARNINGS_ENABLED",()=>!0),vo.registerFlag("IS_TEST",()=>!1),vo.registerFlag("CHECK_COMPUTATION_FOR_ERRORS",()=>!0),vo.registerFlag("WRAP_TO_IMAGEBITMAP",()=>!1);const jo=No({complex_:function(e,t){const n=To(e,"real","complex"),r=To(t,"imag","complex");K(n.shape,r.shape,`real and imag shapes, ${n.shape} and ${r.shape}, must match in call to tf.complex().`);const o={real:n,imag:r};return _o.runKernel(Ze,o)}});function Ao(e,t,n,r){if(null==r&&(r=pe(e)),"complex64"===r)throw new Error("Cannot construct a complex64 tensor directly. Please use tf.complex(real, imag).");if(!se(e)&&!Array.isArray(e)&&"number"!=typeof e&&"boolean"!=typeof e&&"string"!=typeof e)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(null!=t){be(t);const e=J(t),r=J(n);q(e===r,()=>`Based on the provided shape, [${t}], the tensor should have ${e} values but has ${r}`);for(let e=0;e<n.length;++e){const r=n[e],o=e!==n.length-1||r!==J(t.slice(e));q(n[e]===t[e]||!o,()=>`Error creating a new Tensor. Inferred shape (${n}) does not match the provided shape (${t}). `)}}return se(e)||Array.isArray(e)||(e=[e]),t=t||n,e="string"!==r?Pr(e,r):Y(e,[],!0),_o.makeTensor(e,t,r)}function Co(e,t,n){return Ao(e,t,ko(e,n),n)}const Mo={float32:4,float16:2,int32:4,uint16:2,uint8:1,bool:1,complex64:8};const Do="undefined"!=typeof Buffer&&("undefined"==typeof Blob||"undefined"==typeof atob||"undefined"==typeof btoa);function Oo(e){return Do?Buffer.byteLength(e):new Blob([e]).size}function Ro(e){if(1===e.length)return e[0];let t=0;e.forEach(e=>{t+=e.byteLength});const n=new Uint8Array(t);let r=0;return e.forEach(e=>{n.set(new Uint8Array(e),r),r+=e.byteLength}),n.buffer}function Bo(e,t){const n={modelTopology:e.modelTopology,format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy,weightsManifest:t};return null!=e.signature&&(n.signature=e.signature),null!=e.userDefinedMetadata&&(n.userDefinedMetadata=e.userDefinedMetadata),null!=e.modelInitializer&&(n.modelInitializer=e.modelInitializer),null!=e.trainingConfig&&(n.trainingConfig=e.trainingConfig),n}function Po(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("Expected JSON model topology, received ArrayBuffer.");return{dateSaved:new Date,modelTopologyType:"JSON",modelTopologyBytes:null==e.modelTopology?0:Oo(JSON.stringify(e.modelTopology)),weightSpecsBytes:null==e.weightSpecs?0:Oo(JSON.stringify(e.weightSpecs)),weightDataBytes:null==e.weightData?0:e.weightData.byteLength}}function Lo(){const e=function(){const e=e=>{let t=e<<13,n=0;for(;!(8388608&t);)n-=8388608,t<<=1;return t&=-8388609,n+=947912704,t|n},t=new Uint32Array(2048);t[0]=0;for(let n=1;n<1024;n++)t[n]=e(n);for(let e=1024;e<2048;e++)t[e]=939524096+(e-1024<<13);return t}(),t=function(){const 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}(),n=function(){const e=new Uint32Array(64);for(let t=0;t<64;t++)e[t]=1024;return e[0]=e[32]=0,e}();return r=>{const o=new ArrayBuffer(4*r.length),i=new Uint32Array(o);for(let o=0;o<r.length;o++){const a=r[o],s=e[n[a>>10]+(1023&a)]+t[a>>10];i[o]=s}return new Float32Array(o)}}class Wo{constructor(){this.saveRouters=[],this.loadRouters=[]}static getInstance(){return null==Wo.instance&&(Wo.instance=new Wo),Wo.instance}static registerSaveRouter(e){Wo.getInstance().saveRouters.push(e)}static registerLoadRouter(e){Wo.getInstance().loadRouters.push(e)}static getSaveHandlers(e){return Wo.getHandlers(e,"save")}static getLoadHandlers(e,t){return Wo.getHandlers(e,"load",t)}static getHandlers(e,t,n){const r=[];return("load"===t?Wo.getInstance().loadRouters:Wo.getInstance().saveRouters).forEac
vendor: 7,192 bytes, line 2
2h(t=>{const o=t(e,n);null!==o&&r.push(o)}),r}}const Uo="tensorflowjs",zo="models_store",Vo="model_info_store";function Ho(){if(!ke().getBool("IS_BROWSER"))throw new Error("Failed to obtain IndexedDB factory because the current environmentis not a web browser.");const e="undefined"==typeof window?self:window,t=e.indexedDB||e.mozIndexedDB||e.webkitIndexedDB||e.msIndexedDB||e.shimIndexedDB;if(null==t)throw new Error("The current browser does not appear to support IndexedDB.");return t}function Go(e){const t=e.result;t.createObjectStore(zo,{keyPath:"modelPath"}),t.createObjectStore(Vo,{keyPath:"modelPath"})}class qo{constructor(e){if(this.indexedDB=Ho(),null==e||!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((e,n)=>{const r=this.indexedDB.open(Uo,1);r.onupgradeneeded=()=>Go(r),r.onsuccess=()=>{const o=r.result;if(null==t){const t=o.transaction(zo,"readonly"),r=t.objectStore(zo).get(this.modelPath);r.onsuccess=()=>{if(null==r.result)return o.close(),n(new Error(`Cannot find model with path '${this.modelPath}' in IndexedDB.`));e(r.result.modelArtifacts)},r.onerror=e=>(o.close(),n(r.error)),t.oncomplete=()=>o.close()}else{const r=Po(t),i=o.transaction(Vo,"readwrite");let a=i.objectStore(Vo);const s=a.put({modelPath:this.modelPath,modelArtifactsInfo:r});let l;s.onsuccess=()=>{l=o.transaction(zo,"readwrite");const s=l.objectStore(zo).put({modelPath:this.modelPath,modelArtifacts:t,modelArtifactsInfo:r});s.onsuccess=()=>e({modelArtifactsInfo:r}),s.onerror=e=>{a=i.objectStore(Vo);const t=a.delete(this.modelPath);t.onsuccess=()=>(o.close(),n(s.error)),t.onerror=e=>(o.close(),n(s.error))}},s.onerror=e=>(o.close(),n(s.error)),i.oncomplete=()=>{null==l?o.close():l.oncomplete=()=>o.close()}}},r.onerror=e=>n(r.error)})}}qo.URL_SCHEME="indexeddb://";const Ko=e=>{return ke().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(qo.URL_SCHEME)?(t=e.slice(qo.URL_SCHEME.length),new qo(t)):null;var t};Wo.registerSaveRouter(Ko),Wo.registerLoadRouter(Ko);class Xo{constructor(){this.indexedDB=Ho()}async listModels(){return new Promise((e,t)=>{const n=this.indexedDB.open(Uo,1);n.onupgradeneeded=()=>Go(n),n.onsuccess=()=>{const r=n.result,o=r.transaction(Vo,"readonly"),i=o.objectStore(Vo).getAll();i.onsuccess=()=>{const t={};for(const e of i.result)t[e.modelPath]=e.modelArtifactsInfo;e(t)},i.onerror=e=>(r.close(),t(i.error)),o.oncomplete=()=>r.close()},n.onerror=e=>t(n.error)})}async removeModel(e){var t;return e=(t=e).startsWith(qo.URL_SCHEME)?t.slice(qo.URL_SCHEME.length):t,new Promise((t,n)=>{const r=this.indexedDB.open(Uo,1);r.onupgradeneeded=()=>Go(r),r.onsuccess=()=>{const o=r.result,i=o.transaction(Vo,"readwrite"),a=i.objectStore(Vo),s=a.get(e);let l;s.onsuccess=()=>{if(null==s.result)return o.close(),n(new Error(`Cannot find model with path '${e}' in IndexedDB.`));{const r=a.delete(e),i=()=>{l=o.transaction(zo,"readwrite");const r=l.objectStore(zo).delete(e);r.onsuccess=()=>t(s.result.modelArtifactsInfo),r.onerror=e=>n(s.error)};r.onsuccess=i,r.onerror=e=>(i(),o.close(),n(s.error))}},s.onerror=e=>(o.close(),n(s.error)),i.oncomplete=()=>{null==l?o.close():l.oncomplete=()=>o.close()}},r.onerror=e=>n(r.error)})}}const Yo="/",Jo="tensorflowjs_models",Zo="info",Qo="model_topology",ei="weight_specs",ti="weight_data",ni="model_metadata";function ri(e){return{info:[Jo,e,Zo].join(Yo),topology:[Jo,e,Qo].join(Yo),weightSpecs:[Jo,e,ei].join(Yo),weightData:[Jo,e,ti].join(Yo),modelMetadata:[Jo,e,ni].join(Yo)}}function oi(e){for(const t of Object.values(e))window.localStorage.removeItem(t)}function ii(e){const t=e.split(Yo);if(t.length<3)throw new Error(`Invalid key format: ${e}`);return t.slice(1,t.length-1).join(Yo)}class ai{constructor(e){if(!ke().getBool("IS_BROWSER")||"undefined"==typeof window||void 0===window.localStorage)throw new Error("The current environment does not support local storage.");if(this.LS=window.localStorage,null==e||!e)throw new Error("For local storage, modelPath must not be null, undefined or empty.");this.modelPath=e,this.keys=ri(this.modelPath)}async save(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserLocalStorage.save() does not support saving model topology in binary formats yet.");{const t=JSON.stringify(e.modelTopology),n=JSON.stringify(e.weightSpecs),r=Po(e);try{this.LS.setItem(this.keys.info,JSON.stringify(r)),this.LS.setItem(this.keys.topology,t),this.LS.setItem(this.keys.weightSpecs,n),this.LS.setItem(this.keys.weightData,function(e){if(Do)return Buffer.from(e).toString("base64");const t=new Uint8Array(e);let n="";for(let e=0,r=t.length;e<r;e++)n+=String.fromCharCode(t[e]);return btoa(n)}(e.weightData));const o={format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy,signature:null!=e.signature?e.signature:void 0,userDefinedMetadata:null!=e.userDefinedMetadata?e.userDefinedMetadata:void 0,modelInitializer:null!=e.modelInitializer?e.modelInitializer:void 0,trainingConfig:null!=e.trainingConfig?e.trainingConfig:void 0};return this.LS.setItem(this.keys.modelMetadata,JSON.stringify(o)),{modelArtifactsInfo:r}}catch(e){throw oi(this.keys),new Error(`Failed to save model '${this.modelPath}' to local storage: size quota being exceeded is a possible cause of this failure: modelTopologyBytes=${r.modelTopologyBytes}, weightSpecsBytes=${r.weightSpecsBytes}, weightDataBytes=${r.weightDataBytes}.`)}}}async load(){const e=JSON.parse(this.LS.getItem(this.keys.info));if(null==e)throw new Error(`In local storage, there is no model with name '${this.modelPath}'`);if("JSON"!==e.modelTopologyType)throw new Error("BrowserLocalStorage does not support loading non-JSON model topology yet.");const t={},n=JSON.parse(this.LS.getItem(this.keys.topology));if(null==n)throw new Error(`In local storage, the topology of model '${this.modelPath}' is missing.`);t.modelTopology=n;const r=JSON.parse(this.LS.getItem(this.keys.weightSpecs));if(null==r)throw new Error(`In local storage, the weight specs of model '${this.modelPath}' are missing.`);t.weightSpecs=r;const o=this.LS.getItem(this.keys.modelMetadata);if(null!=o){const e=JSON.parse(o);t.format=e.format,t.generatedBy=e.generatedBy,t.convertedBy=e.convertedBy,null!=e.signature&&(t.signature=e.signature),null!=e.userDefinedMetadata&&(t.userDefinedMetadata=e.userDefinedMetadata),null!=e.modelInitializer&&(t.modelInitializer=e.modelInitializer),null!=e.trainingConfig&&(t.trainingConfig=e.trainingConfig)}const i=this.LS.getItem(this.keys.weightData);if(null==i)throw new Error(`In local storage, the binary weight values of model '${this.modelPath}' are missing.`);return t.weightData=function(e){if(Do){const t=Buffer.from(e,"base64");return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}const t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n.set([t.charCodeAt(e)],e);return n.buffer}(i),t}}ai.URL_SCHEME="localstorage://";const si=e=>
vendor: 4,524 bytes, line 2
2{return ke().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(ai.URL_SCHEME)?(t=e.slice(ai.URL_SCHEME.length),new ai(t)):null;var t};Wo.registerSaveRouter(si),Wo.registerLoadRouter(si);class li{constructor(){q(ke().getBool("IS_BROWSER"),()=>"Current environment is not a web browser"),q("undefined"==typeof window||void 0!==window.localStorage,()=>"Current browser does not appear to support localStorage"),this.LS=window.localStorage}async listModels(){const e={},t=Jo+Yo,n=Yo+Zo;for(let r=0;r<this.LS.length;++r){const o=this.LS.key(r);o.startsWith(t)&&o.endsWith(n)&&(e[ii(o)]=JSON.parse(this.LS.getItem(o)))}return e}async removeModel(e){var t;const n=ri(e=(t=e).startsWith(ai.URL_SCHEME)?t.slice(ai.URL_SCHEME.length):t);if(null==this.LS.getItem(n.info))throw new Error(`Cannot find model at path '${e}'`);const r=JSON.parse(this.LS.getItem(n.info));return oi(n),r}}class ui{constructor(){this.managers={}}static getInstance(){return null==ui.instance&&(ui.instance=new ui),ui.instance}static registerManager(e,t){q(null!=e,()=>"scheme must not be undefined or null."),e.endsWith("://")&&(e=e.slice(0,e.indexOf("://"))),q(e.length>0,()=>"scheme must not be an empty string.");const n=ui.getInstance();q(null==n.managers[e],()=>`A model store manager is already registered for scheme '${e}'.`),n.managers[e]=t}static getManager(e){const t=this.getInstance().managers[e];if(null==t)throw new Error(`Cannot find model manager for scheme '${e}'`);return t}static getSchemes(){return Object.keys(this.getInstance().managers)}}class pi{fetch(e,t){return fetch(e,t)}now(){return performance.now()}encode(e,t){if("utf-8"!==t&&"utf8"!==t)throw new Error(`Browser's encoder only supports utf-8, but got ${t}`);return null==this.textEncoder&&(this.textEncoder=new TextEncoder),this.textEncoder.encode(e)}decode(e,t){return new TextDecoder(t).decode(e)}}if(ke().get("IS_BROWSER")){ke().setPlatform("browser",new pi);try{ui.registerManager(ai.URL_SCHEME,new li)}catch(e){}try{ui.registerManager(qo.URL_SCHEME,new Xo)}catch(e){}}let ci;function di(e,t="float32",n){return t=t||"float32",be(e),new Jr(e,t,n)}ke().get("IS_NODE")&&ke().setPlatform("node",new class{constructor(){this.util=__webpack_require__(905),this.textEncoder=new this.util.TextEncoder}fetch(e,t){return null!=ke().global.fetch?ke().global.fetch(e,t):(null==ci&&(ci=__webpack_require__(78)),ci(e,t))}now(){const e=process.hrtime();return 1e3*e[0]+e[1]/1e6}encode(e,t){if("utf-8"!==t&&"utf8"!==t)throw new Error(`Node built-in encoder only supports utf-8, but got ${t}`);return this.textEncoder.encode(e)}decode(e,t){return 0===e.length?"":new this.util.TextDecoder(t).decode(e)}});const hi=No({cast_:function(e,t){const n=To(e,"x","cast");if(!function(e){return"bool"===e||"complex64"===e||"float32"===e||"int32"===e||"string"===e}(t))throw new Error(`Failed to cast to unknown dtype ${t}`);if("string"===t&&"string"!==n.dtype||"string"!==t&&"string"===n.dtype)throw new Error("Only strings can be casted to strings");const r={x:n},o={dtype:t};return _o.runKernel(Xe,r,o)}}),fi=No({clone_:function(e){const t={x:To(e,"x","clone","string_or_numeric")};return _o.runKernel(Dt,t)}});function gi(e){return new Promise(e=>setTimeout(e)).then(e)}$o(),Qr={buffer:di,cast:hi,clone:fi,print:function(e,t=!1){console.log(e.toString(t))}};class mi{constructor(e){if(!ke().getBool("IS_BROWSER"))throw new Error("browserDownloads() cannot proceed because the current environment is not a browser.");e.startsWith(mi.URL_SCHEME)&&(e=e.slice(mi.URL_SCHEME.length)),null!=e&&0!==e.length||(e="model"),this.modelJsonFileName=e+".json",this.weightDataFileName=e+".weights.bin"}async save(e){if("undefined"==typeof document)throw new Error("Browser downloads are not supported in this environment since `document` is not present");const 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.");{const n=Bo(e,[{paths:["./"+this.weightDataFileName],weights:e.weightSpecs}]),r=window.URL.createObjectURL(new Blob([JSON.stringify(n)],{type:"application/json"})),o=null==this.modelJsonAnchor?document.createElement("a"):this.modelJsonAnchor;if(o.download=this.modelJsonFileName,o.href=r,await gi(()=>o.dispatchEvent(new MouseEvent("click"))),null!=e.weightData){const e=null==this.weightDataAnchor?document.createElement("a"):this.weightDataAnchor;e.download=this.weightDataFileName,e.href=t,await gi(()=>
2e.dispatchEvent(new MouseEvent("click")))}return{modelArtifactsInfo:Po(e)}}}}function yi(e,t,n,r){!function(e){q(null!=e&&Array.isArray(e)&&e.length>0,()=>"promises must be a none empty array")}(e),function(e,t){q(e>=0&&e<=1,()=>`Progress fraction must be in range [0, 1], but got startFraction ${e}`),q(t>=0&&t<=1,()=>`Progress fraction must be in range [0, 1], but got endFraction ${t}`),q(t>=e,()=>`startFraction must be no more than endFraction, but got startFraction ${e} and endFraction ${t}`)}(n=null==n?0:n,r=null==r?1:r);let o=0;return Promise.all(e.map(i=>(i.then(i=>{const a=n+ ++o/e.length*(r-n);return t(a),i}),i)))}async function bi(e,t){null==t&&(t={});const n=null==t.fetchFunc?ke().platform.fetch:t.fetchFunc,r=e.map(e=>n(e,t.requestInit,{isBinary:!0})),o=(null==t.onProgress?await Promise.all(r):await yi(r,t.onProgress,0,.5)).map(e=>e.arrayBuffer());return null==t.onProgress?await Promise.all(o):await yi(o,t.onProgress,.5,1)}mi.URL_SCHEME="downloads://",Wo.registerSaveRouter(e=>ke().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(mi.URL_SCHEME)?function(e="model"){return new mi(e)}(e.slice(mi.URL_SCHEME.length)):null);class $i{constructor(e,t){if(this.DEFAULT_METHOD="POST",null==t&&(t={}),this.weightPathPrefix=t.weightPathPrefix,this.onProgress=t.onProgress,this.weightUrlConverter=t.weightUrlConverter,null!=t.fetchFunc?(q("function"==typeof t.fetchFunc,()=>"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=ke().platform.fetch,q(null!=e&&e.length>0,()=>"URL path for http must not be null, undefined or empty."),Array.isArray(e)&&q(2===e.length,()=>`URL paths for http must have a length of 2, (actual length is ${e.length}).`),this.path=e,null!=t.requestInit&&null!=t.requestInit.body)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.");const t=Object.assign({method:this.DEFAULT_METHOD},this.requestInit);t.body=new FormData;const n=Bo(e,[{paths:["./model.weights.bin"],weights:e.weightSpecs}]);t.body.append("model.json",new Blob([JSON.stringify(n)],{type:"application/json"}),"model.json"),null!=e.weightData&&t.body.append("model.weights.bin",new Blob([e.weightData],{type:"application/octet-stream"}),"model.weights.bin");const r=await this.fetch(this.path,t);if(r.ok)return{modelArtifactsInfo:Po(e),responses:[r]};throw new Error(`BrowserHTTPRequest.save() failed due to HTTP response status ${r.status}.`)}async load(){const e=await this.fetch(this.path,this.requestInit);if(!e.ok)throw new Error(`Request to ${this.path} failed with status code ${e.status}. Please verify this URL points to the model JSON of the model to load.`);let t;try{t=await e.json()}catch(e){let t=`Failed to parse model JSON of response from ${this.path}.`;throw this.path.endsWith(".pb")?t+=" 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.":t+=" Please make sure the server is serving valid JSON for this request.",new Error(t)}const n=t.modelTopology,r=t.weightsManifest;if(null==n&&null==r)throw new Error(`The JSON from HTTP path ${this.path} contains neither model topology or manifest for weights.`);return async function(e,t){const n={modelTopology:e.modelTopology,format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy};if(null!=e.trainingConfig&&(n.trainingConfig=e.trainingConfig),null!=e.weightsManifest){const[r,o]=await t(e.weightsManifest);n.weightSpecs=r,n.weightData=o}return null!=e.signature&&(n.signature=e.signature),null!=e.userDefinedMetadata&&(n.userDefinedMetadata=e.userDefinedMetadata),null!=e.modelInitializer&&(n.modelInitializer=e.modelInitializer),n}(t,e=>this.loadWeights(e))}async loadWeights(e){const t=Array.isArray(this.path)?this.path[1]:this.path,[n,r]=function(e){const t=e.lastIndexOf("/"),n=e.lastIndexOf("?");return[e.substring(0,t)+"/",n>t?e.substring(n):""]}(t),o=this.weightPathPrefix||n,i=[];for(const t of e)i.push(...t.weights);const a=[],s=[];for(const t of e)for(const e of t.paths)null!=this.weightUrlConverter?s.push(this.weightUrlConverter(e)):a.push(o+e+r);return this.weightUrlConverter&&a.push(...await Promise.all(s)),[i,Ro(await bi(a,{requestInit:this.requestInit,fetchFunc:this.fetch,onProgress:this.onProgress}))]}}function _i(e){return null!=e.match($i.URL_SCHEME_REGEX)}$i.URL_SCHEME_REGEX=/^https?:\/\//;const wi=(e,t)=>{if("undefined"==typeof fetch&&(null==t||null==t.fetchFunc))return null;{let n=!0;if(n=Array.isArray(e)?e.every(e=>_i(e)):_i(e),n)return xi(e,t)}return null};function xi(e,t){return new $i(e,t)}function Si(e,t){return xi(e,t)}Wo.registerSaveRouter(wi),Wo.registerLoadRouter(wi);class vi{constructor(e){this.modelArtifacts=e}async load(){return this.modelArtifacts}}let ki;async function Ei(e,t){let n=To(e,"img","toPixels");if(!(e instanceof to)){const e=n;n=hi(e,"int32"),e.dispose()}
vendor: 4,923 bytes, line 2
2if(2!==n.rank&&3!==n.rank)throw new Error(`toPixels only supports rank 2 or 3 tensors, got rank ${n.rank}.`);const[r,o]=n.shape.slice(0,2),i=2===n.rank?1:n.shape[2];if(i>4||2===i)throw new Error(`toPixels only supports depth of size 1, 3 or 4 but got ${i}`);if("float32"!==n.dtype&&"int32"!==n.dtype)throw new Error(`Unsupported type for toPixels: ${n.dtype}. Please use float32 or int32 tensors.`);const a=await n.data(),s="float32"===n.dtype?255:1,l=new Uint8ClampedArray(o*r*4);for(let e=0;e<r*o;++e){const t=[0,0,0,255];for(let r=0;r<i;r++){const o=a[e*i+r];if("float32"===n.dtype){if(o<0||o>1)throw new Error(`Tensor values for a float32 Tensor must be in the range [0 - 1] but encountered ${o}.`)}else if("int32"===n.dtype&&(o<0||o>255))throw new Error(`Tensor values for a int32 Tensor must be in the range [0 - 255] but encountered ${o}.`);1===i?(t[0]=o*s,t[1]=o*s,t[2]=o*s):t[r]=o*s}const r=4*e;l[r+0]=Math.round(t[0]),l[r+1]=Math.round(t[1]),l[r+2]=Math.round(t[2]),l[r+3]=Math.round(t[3])}if(null!=t){t.width=o,t.height=r;const e=t.getContext("2d"),n=new ImageData(l,o,r);e.putImageData(n,0,0)}return n!==e&&n.dispose(),l}const Ii=No({fromPixels_:function(e,t=3){if(t>4)throw new Error("Cannot construct Tensor with more than 4 channels from pixels.");if(null==e)throw new Error("pixels passed to tf.browser.fromPixels() can not be null");let n=!1,r=!1,o=!1,i=!1,a=!1,s=!1;if(e.data instanceof Uint8Array)n=!0;else if("undefined"!=typeof ImageData&&e instanceof ImageData)r=!0;else if("undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement)o=!0;else if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement)i=!0;else if(null!=e.getContext)a=!0;else{if(!("undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap))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}`);s=!0}if(o){const t=2;if(o&&e.readyState<t)throw new Error("The video element has not loaded data yet. Please wait for `loadeddata` event on the <video> element.")}if(null!=Tr(wr,_o.backendName)){const n={pixels:e},r={numChannels:t};return _o.runKernel(wr,n,r)}const[l,u]=o?[e.videoWidth,e.videoHeight]:[e.width,e.height];let p,c;if(a?p=e.getContext("2d").getImageData(0,0,l,u).data:r||n?p=e.data:(i||o||s)&&(null==ki&&(ki=document.createElement("canvas").getContext("2d")),ki.canvas.width=l,ki.canvas.height=u,ki.drawImage(e,0,0,l,u),p=ki.getImageData(0,0,l,u).data),4===t)c=new Int32Array(p);else{const e=l*u;c=new Int32Array(e*t);for(let n=0;n<e;n++)for(let e=0;e<t;++e)c[n*t+e]=p[4*n+e]}return function(e,t,n){if(X(e),null!=t&&3!==t.length)throw new Error("tensor3d() requires shape to have three numbers");const r=ko(e,n);if(3!==r.length&&1!==r.length)throw new Error("tensor3d() requires values to be number[][][] or flat/TypedArray");if(1===r.length&&null==t)throw new Error("tensor3d() requires shape to be provided when `values` are a flat array");return Ao(e,t,r,n)}(c,[u,l,t],"int32")}});function Ti(e,t,n){const r=e.shape.length;q(r===t.length,()=>`Error in slice${r}D: Length of begin ${t} must match the rank of the array (${r}).`),q(r===n.length,()=>`Error in slice${r}D: Length of size ${n} must match the rank of the array (${r}).`);for(let o=0;o<r;++o)q(t[o]+n[o]<=e.shape[o],()=>`Error in slice${r}D: begin[${o}] + size[${o}] (${t[o]+n[o]}) would overflow input.shape[${o}] (${e.shape[o]})`)}function Fi(e){const t=[];let n=0;for(;e>0;)1&e&&t.push(n),e/=2,n++;return t}function Ni(e,t,n){const r=[];for(let o=0;o<e.length;o++)r[o]=Math.ceil((t[o]-e[o])/n[o]);return r}function ji(e,t,n,r){const o=[...e];for(let e=o.length;e<r.length;e++)o.push(1);for(let e=0;e<n;e++)0===e?o[t]=1:(o.splice(t,0,1),o.pop());return o}function Ai(e,t,n){return n<=e?n:n-(t-1)}function Ci(e,t){const n=[];for(let r=0;r<e;r++)n.push(t+r);return n}function Mi(e,t,n,r,o,i,a,s,l){const u=e.length;let p=new Array(u),c=new Array(u),d=new Array(u);if(t.length&&n>0){const l=t[0],u=n+1;p=Di(a,l,u,r,e),c=Oi(s,l,u,o,e),d=ji(i,l,u,e)}else for(let t=0;t<u;t++)p[t]=Bi(a,r,i,e,t,l),c[t]=Pi(s,o,i,e,t,l),d[t]=Ri(i,t,l);return{begin:p,end:c,strides:d}}function Di(e,t,n,r,o){const i=[...o],a=Ci(n,t);for(let o=0;o<i.length;o++)if(a.indexOf(o)>-1)i[o]=0;else{const a=Ai(t,n,o);let s=r[a];e&1<<a&&(s=0),i[o]=s}return i}function Oi(e,t,n,r,o){const i=[...o],a=Ci(n,t);for(let o=0;o<i.length;o++)if(a.indexOf(o)>-1)i[o]=Number.MAX_SAFE_INTEGER;else{const a=Ai(t,n,o);let s=r[a];e&1<<a&&(s=Number.MAX_SAFE_INTEGER),i[o]=s}for(let e=0;e<i.length;e++){const t=o[e];i[e]<0&&(i[e]+=t),i[e]=H(0,i[e],o[e])}return i}function Ri(e,t,n){let r=e[t];return(n&1<<t||null==r)&&(r=1),r}function Bi(e,t,n,r,o,i){let a=t[o];const s=n[o]||1;(e&1<<o||i&1<<o||null==a)&&(a=s>0?Number.MIN_SAFE_INTEGER:Number.MAX_SAFE_INTEGER);
2const l=r[o];return a<0&&(a+=l),a=H(0,a,l-1),a}function Pi(e,t,n,r,o,i){let a=t[o];const s=n[o]||1;(e&1<<o||i&1<<o||null==a)&&(a=s>0?Number.MAX_SAFE_INTEGER:Number.MIN_SAFE_INTEGER);const l=r[o];return a<0&&(a+=l),a=s>0?H(0,a,l):H(-1,a,l-1),a}function Li(e,t,n){let r=n.length;for(let e=0;e<n.length;e++)if(n[e]>1){r=e;break}for(let o=r+1;o<n.length;o++)if(t[o]>0||n[o]!==e[o])return!1;return!0}function Wi(e,t){let n=e.length>0?e[e.length-1]:1;for(let r=0;r<e.length-1;r++)n+=e[r]*t[r];return n}function Ui(e,t,n){let r;const o=e.shape.length;let i;return r="number"==typeof t?[t,...new Array(o-1).fill(0)]:t.length<o?t.concat(new Array(o-t.length).fill(0)):t.slice(),r.forEach(e=>{q(-1!==e,()=>"slice() does not support negative begin indexing.")}),i=null==n?new Array(o).fill(-1):"number"==typeof n?[n,...new Array(o-1).fill(-1)]:n.length<o?n.concat(new Array(o-n.length).fill(-1)):n,i=i.map((t,n)=>t>=0?t:(q(-1===t,()=>`Negative size values should be exactly -1 but got ${t} for the slice() size at index ${n}.`),e.shape[n]-r[n])),[r,i]}function zi(e,t,n,r,o,i,a,s,l){let u=t.slice(),p=n.slice(),c=r;null==r&&(c=new Array(u.length));const d=Fi(a);if(d.length>1)throw new Error("Multiple ellipses in slice is not allowed.");if(0!==a&&0!==s)throw new Error("Using both ellipsisMask and newAxisMask is not yet supported.");if(0!==a&&0!==l)throw new Error("Using both ellipsisMask and shrinkAxisMask is not yet supported.");const h=e.length-u.length,f=Fi(s),g=e.slice();f.forEach(e=>{u[e]=0,p[e]=1,g.splice(e,0,1)});const{begin:m,end:y,strides:b}=Mi(g,d,h,u,p,c,o,i,a);u=m,p=y,c=b;const $=Fi(l);$.forEach(e=>{p[e]=u[e]+1,c[e]=1});const _=Ni(u,p,c),w=_.filter((e,t)=>-1===$.indexOf(t));return{nonStrided:c.every(e=>1===e),$begin:u,$end:p,$strides:c,size:_,newShape:g,outShape:w}}const Vi=No({add_:function(e,t){let n=To(e,"a","add"),r=To(t,"b","add");[n,r]=ho(n,r);const o={a:n,b:r};return _o.runKernel(Ce,o)}}),Hi=No({concat_:function(e,t=0){q(e.length>=1,()=>"Pass at least one tensor to concat");const n=Fo(e,"tensors","concat","string_or_numeric");
vendor: 4,338 bytes, line 2
2if("complex64"===n[0].dtype&&n.forEach(e=>{if("complex64"!==e.dtype)throw new Error(`Cannot concatenate complex64 tensors with a tensor\n          with dtype ${e.dtype}. `)}),1===n.length)return fi(n[0]);const r=n,o={axis:t};return _o.runKernel(et,r,o)}}),Gi=No({floorDiv_:function(e,t){let n=To(e,"a","floorDiv"),r=To(t,"b","floorDiv");[n,r]=ho(n,r);const o={a:n,b:r};return _o.runKernel(Ft,o)}}),qi=No({div_:function(e,t){let n=To(e,"a","div"),r=To(t,"b","div");if([n,r]=ho(n,r),"int32"===n.dtype&&"int32"===r.dtype)return Gi(n,r);const o={a:n,b:r};return _o.runKernel(yt,o,{})}}),Ki=No({mul_:function(e,t){let n=To(e,"a","mul"),r=To(t,"b","mul");[n,r]=ho(n,r);const o={a:n,b:r};return _o.runKernel(dn,o)}}),Xi=No({reshape_:function(e,t){const n={x:To(e,"x","reshape","string_or_numeric")},r={shape:t};return _o.runKernel(Fn,n,r)}});function Yi(e,t){if((se(e)&&"string"!==t||Array.isArray(e))&&"complex64"!==t)throw new Error("Error creating a new Scalar: value must be a primitive (number|boolean|string)");if("string"===t&&se(e)&&!(e instanceof Uint8Array))throw new Error("When making a scalar from encoded string, the value must be `Uint8Array`.");return Ao(e,[],[],t)}const Ji=No({slice_:function(e,t,n){const r=To(e,"x","slice","string_or_numeric");if(0===r.rank)throw new Error("Slicing scalar is not possible");const o={x:r},i={begin:t,size:n};return _o.runKernel(Wn,o,i)}}),Zi=No({split_:function(e,t,n=0){const r={x:To(e,"x","split")},o={numOrSizeSplits:t,axis:n};return _o.runKernel(Yn,r,o)}}),Qi=No({stack_:function(e,t=0){const n=Fo(e,"tensors","stack","string_or_numeric");q(n.length>=1,()=>"Pass at least one tensor to tf.stack"),n.length>0&&q(t<=n[0].rank,()=>"Axis must be <= rank of the tensor");const r=n,o={axis:t};return _o.runKernel(_n,r,o)}}),ea=No({unstack_:function(e,t=0){const n=To(e,"x","unstack","string_or_numeric");q(t>=-n.shape.length&&t<n.shape.length,()=>`Axis = ${t} is not in [-${n.shape.length}, ${n.shape.length})`);const r={value:n},o={axis:t};return _o.runKernel(yr,r,o)}});function ta(e,t="float32"){if("complex64"===t){const t=ta(e,"float32"),n=ta(e,"float32");return jo(t,n)}const n=ye(J(e),t);return _o.makeTensor(n,e,t)}const na=No({imag_:function(e){const t={input:To(e,"input","imag")};return _o.runKernel(Rt,t)}}),ra=No({real_:function(e){const t={input:To(e,"input","real")};return _o.runKernel(En,t)}}),oa=No({zerosLike_:function(e){const t={x:To(e,"x","zerosLike")};return _o.runKernel($r,t)}}),ia=No({fft_:function(e){q("complex64"===e.dtype,()=>`The dtype for tf.spectral.fft() must be complex64 but got ${e.dtype}.`);const t={input:e};return _o.runKernel("FFT",t)}}),aa=No({rfft_:function(e,t){q("float32"===e.dtype,()=>`The dtype for rfft() must be real value but got ${e.dtype}`);let n=e.shape[e.shape.length-1];const r=e.size/n;let o;if(null!=t&&t<n){const r=e.shape.map(e=>0),i=e.shape.map(e=>e);i[e.shape.length-1]=t,o=Ji(e,r,i),n=t}else if(null!=t&&t>n){const r=e.shape.map(e=>e);r[e.shape.length-1]=t-n,o=Hi([e,ta(r)],e.shape.length-1),n=t}else o=e;const i=oa(o),a=Xi(jo(o,i),[r,n]),s=ia(a),l=Math.floor(n/2)+1,u=ra(s),p=na(s),c=Zi(u,[l,n-l],u.shape.length-1),d=Zi(p,[l,n-l],p.shape.length-1),h=o.shape.slice();return h[o.shape.length-1]=l,Xi(jo(c[0],d[0]),h)}}),sa=No({ifft_:function(e){q("complex64"===e.dtype,()=>`The dtype for tf.spectral.ifft() must be complex64 but got ${e.dtype}.`);const t={input:e};return _o.runKernel(Ot,t)}}),la=No({reverse_:function(e,t){const n={x:To(e,"x","reverse")},r={dims:t};return _o.runKernel(Dn,n,r)}}),ua=No({irfft_:function(e){const t=e.shape[e.shape.length-1],n=e.size/t;let r;if(t<=2){const o=Xi(e,[n,t]);r=sa(o)}else{const o=[n,2*(t-1)],i=Xi(ra(e),[n,t]),a=Xi(na(e),[n,t]),s=la(Ji(i,[0,1],[n,t-2]),1),l=Ki(la(Ji(a,[0,1],[n,t-2]),1),Yi(-1)),u=Hi([i,s],1),p=Hi([a,l],1),c=Xi(jo(u,p),[o[0],o[1]]);r=sa(c)}if(r=ra(r),3===e.rank&&0!==e.shape[0]){const t=r,n=e.shape[0];r=Xi(r,[n,r.shape[0]/n,r.shape[1]]),t.dispose()}return r}});function pa(e,t){X(e);const n=ko(e,t);if(1!==n.length)throw new Error("tensor1d() requires values to be a flat/TypedArray");return Ao(e,null,n,t)}function ca(e,t,n){const r=1-e%2,o=new Float32Array(e);for(let i=0;i<e;++i){const a=2*Math.PI*i/(e+r-1);o[i]=t-n*Math.cos(a)}return pa(o,"float32")}No({hammingWindow_:function(e){return ca(e,.54,.46)}});const da=No({hannWindow_:function(e){return ca(e,.5,.5)}});
2function ha(e,t,n){const r={shape:e,value:t,dtype:n};return _o.runKernel(Et,{},r)}function fa(e,t,n){if(X(e),null!=t&&2!==t.length)throw new Error("tensor2d() requires shape to have two numbers");const r=ko(e,n);if(2!==r.length&&1!==r.length)throw new Error("tensor2d() requires values to be number[][] or flat/TypedArray");if(1===r.length&&null==t)throw new Error("tensor2d() requires shape to be provided when `values` are a flat/TypedArray");return Ao(e,t,r,n)}const ga=No({frame_:function(e,t,n,r=!1,o=0){let i=0;const a=[];for(;i+t<=e.size;)a.push(Ji(e,i,t)),i+=n;if(r)for(;i<e.size;){const r=i+t-e.size,s=Hi([Ji(e,i,t-r),ha([r],o)]);a.push(s),i+=n}return 0===a.length?fa([],[0,t]):Xi(Hi(a),[a.length,t])}});No({stft_:function(e,t,n,r,o=da){var i;null==r&&(i=t,r=Math.floor(Math.pow(2,Math.ceil(Math.log(i)/Math.log(2)))));const a=ga(e,t,n),s=Ki(a,o(t));return aa(s,r)}});const ma=No({cropAndResize_:function(e,t,n,r,o="bilinear",i=0){const a=To(e,"image","cropAndResize"),s=To(t,"boxes","cropAndResize","float32"),l=To(n,"boxInd","cropAndResize","int32"),u=s.shape[0];q(4===a.rank,()=>`Error in cropAndResize: image must be rank 4,but got rank ${a.rank}.`),q(2===s.rank&&4===s.shape[1],()=>`Error in cropAndResize: boxes must be have size [${u},4] but had shape ${s.shape}.`),q(1===l.rank&&l.shape[0]===u,()=>`Error in cropAndResize: boxInd must be have size [${u}] but had shape ${s.shape}.`),q(2===r.length,()=>`Error in cropAndResize: cropSize must be of length 2, but got length ${r.length}.`),q(r[0]>=1&&r[1]>=1,()=>`cropSize must be atleast [1,1], but was ${r}`),q("bilinear"===o||"nearest"===o,()=>`method must be bilinear or nearest, but was ${o}`);const p={image:a,boxes:s,boxInd:l},c={method:o,extrapolationValue:i,cropSize:r};return _o.runKernel(pt,p,c)}}),ya=No({flipLeftRight_:function(e){const t=To(e,"image","flipLeftRight","float32");q(4===t.rank,()=>`Error in flipLeftRight: image must be rank 4,but got rank ${t.rank}.`);const n={image:t};return _o.runKernel(It,n,{})}}),ba=No({tile_:function(e,t){const n=To(e,"x","tile","string_or_numeric");q(n.rank===t.length,()=>`Error in transpose: rank of input ${n.rank} must match length of reps ${t}.`);const r={x:n},o={reps:t};return _o.runKernel(dr,r,o)}}),$a=No({grayscaleToRGB_:function(e){const t=To(e,"image","grayscaleToRGB"),n=t.rank-1,r=t.shape[n];q(t.rank>=2,()=>`Error in grayscaleToRGB: images must be at least rank 2, but got rank ${t.rank}.`),q(1===r,()=>`Error in grayscaleToRGB: last dimension of a grayscale image should be size 1, but got size ${r}.`);const o=new Array(t.rank);return o.fill(1,0,n),o[n]=3,ba(t,o)}}),_a=No({rotateWithOffset_:function(e,t,n=0,r=.5){const o=To(e,"image","rotateWithOffset","float32");q(4===o.rank,()=>`Error in rotateWithOffset: image must be rank 4,but got rank ${o.rank}.`);const i={image:o},a={radians:t,fillValue:n,center:r};return _o.runKernel(xr,i,a)}});function wa(e,t,n,r,o,i){null==r&&(r=.5),null==o&&(o=Number.NEGATIVE_INFINITY),null==i&&(i=0);const a=e.shape[0];return n=Math.min(n,a),q(0<=r&&r<=1,()=>`iouThreshold must be in [0, 1], but was '${r}'`),q(2===e.rank,()=>`boxes must be a 2D tensor, but was of rank '${e.rank}'`),q(4===e.shape[1],()=>`boxes must have 4 columns, but 2nd dimension was ${e.shape[1]}`),q(1===t.rank,()=>"scores must be a 1D tensor"),q(t.shape[0]===a,()=>`scores has incompatible shape with boxes. Expected ${a}, but was ${t.shape[0]}`),q(0<=i&&i<=1,()=>`softNmsSigma must be in [0, 1], but was '${i}'`),{maxOutputSize:n,iouThreshold:r,scoreThreshold:o,softNmsSigma:i}}const xa=No({nonMaxSuppression_:function(e,t,n,r=.5,o=Number.NEGATIVE_INFINITY){const i=To(e,"boxes","nonMaxSuppression"),a=To(t,"scores","nonMaxSuppression"),s=wa(i,a,n,r,o),l={maxOutputSize:n=s.maxOutputSize,iouThreshold:r=s.iouThreshold,scoreThreshold:o=s.scoreThreshold};return _o.runKernel(gn,{boxes:i,scores:a},l)}});function Sa(e,t,n){const r=function(e,t,n){return function(e,t,n){let r=0,o=e.length,i=0,a=!1;for(;r<o;){i=r+(o-r>>>1);const s=n(t,e[i]);s>0?r=i+1:(o=i,a=!s)}return a?r:-r-1}(e,t,n||va)}(e,t,n),o=r<0?-(r+1):r;e.splice(o,0,t)}function va(e,t){return e>t?1:e<t?-1:0}function ka(e,t,n,r,o){return Ta(e,t,n,r,o,0)}function Ea(e,t,n,r,o,i){return Ta(e,t,n,r,o,0,!1,i,!0)}function Ia(e,t,n,r,o,i){return Ta(e,t,n,r,o,i,!0)}function Ta(e,t,n,r,o,i,a=!1,s=!1,l=!1){const u=[];for(let e=0;e<t.length;e++)t[e]>o&&u.push({score:t[e],boxIndex:e,suppressBeginIndex:0});
vendor: 7,706 bytes, line 2
2u.sort(ja);const p=i>0?-.5/i:0,c=[],d=[];for(;c.length<n&&u.length>0;){const t=u.pop(),{score:n,boxIndex:i,suppressBeginIndex:a}=t;if(n<o)break;let s=!1;for(let n=c.length-1;n>=a;--n){const a=Fa(e,i,c[n]);if(a>=r){s=!0;break}if(t.score=t.score*Na(r,p,a),t.score<=o)break}t.suppressBeginIndex=c.length,s||(t.score===n?(c.push(i),d.push(t.score)):t.score>o&&Sa(u,t,ja))}const h=c.length,f=n-h;s&&f>0&&(c.push(...new Array(f).fill(0)),d.push(...new Array(f).fill(0)));const g={selectedIndices:c};return a&&(g.selectedScores=d),l&&(g.validOutputs=h),g}function Fa(e,t,n){const r=e.subarray(4*t,4*t+4),o=e.subarray(4*n,4*n+4),i=Math.min(r[0],r[2]),a=Math.min(r[1],r[3]),s=Math.max(r[0],r[2]),l=Math.max(r[1],r[3]),u=Math.min(o[0],o[2]),p=Math.min(o[1],o[3]),c=Math.max(o[0],o[2]),d=Math.max(o[1],o[3]),h=(s-i)*(l-a),f=(c-u)*(d-p);if(h<=0||f<=0)return 0;const g=Math.max(i,u),m=Math.max(a,p),y=Math.min(s,c),b=Math.min(l,d),$=Math.max(y-g,0)*Math.max(b-m,0);return $/(h+f-$)}function Na(e,t,n){const r=Math.exp(t*n*n);return n<=e?r:0}function ja(e,t){return e.score-t.score||e.score===t.score&&t.boxIndex-e.boxIndex}const Aa=No({nonMaxSuppressionWithScore_:function(e,t,n,r=.5,o=Number.NEGATIVE_INFINITY,i=0){const a=To(e,"boxes","nonMaxSuppression"),s=To(t,"scores","nonMaxSuppression"),l=wa(a,s,n,r,o,i),u={boxes:a,scores:s},p={maxOutputSize:n=l.maxOutputSize,iouThreshold:r=l.iouThreshold,scoreThreshold:o=l.scoreThreshold,softNmsSigma:i=l.softNmsSigma},c=_o.runKernel(yn,u,p);return{selectedIndices:c[0],selectedScores:c[1]}}}),Ca=No({nonMaxSuppressionPadded_:function(e,t,n,r=.5,o=Number.NEGATIVE_INFINITY,i=!1){const a=To(e,"boxes","nonMaxSuppression"),s=To(t,"scores","nonMaxSuppression"),l=wa(a,s,n,r,o,null),u={boxes:a,scores:s},p={maxOutputSize:l.maxOutputSize,iouThreshold:l.iouThreshold,scoreThreshold:l.scoreThreshold,padToMaxOutputSize:i},c=_o.runKernel(mn,u,p);return{selectedIndices:c[0],validOutputs:c[1]}}}),Ma=No({resizeBilinear_:function(e,t,n=!1,r=!1){const o=To(e,"images","resizeBilinear");q(3===o.rank||4===o.rank,()=>`Error in resizeBilinear: x must be rank 3 or 4, but got rank ${o.rank}.`),q(2===t.length,()=>`Error in resizeBilinear: new shape must 2D, but got shape ${t}.`),q(!1===r||!1===n,()=>"Error in resizeBilinear: If halfPixelCenters is true, alignCorners must be false.");let i=o,a=!1;3===o.rank&&(a=!0,i=Xi(o,[1,o.shape[0],o.shape[1],o.shape[2]]));const[]=t,s={images:i},l={alignCorners:n,halfPixelCenters:r,size:t},u=_o.runKernel(An,s,l);return a?Xi(u,[u.shape[1],u.shape[2],u.shape[3]]):u}}),Da=No({resizeNearestNeighbor_:function(e,t,n=!1,r=!1){const o=To(e,"images","resizeNearestNeighbor");q(3===o.rank||4===o.rank,()=>`Error in resizeNearestNeighbor: x must be rank 3 or 4, but got rank ${o.rank}.`),q(2===t.length,()=>`Error in resizeNearestNeighbor: new shape must 2D, but got shape ${t}.`),q("float32"===o.dtype||"int32"===o.dtype,()=>"`images` must have `int32` or `float32` as dtype"),q(!1===r||!1===n,()=>"Error in resizeNearestNeighbor: If halfPixelCenters is true, alignCorners must be false.");let i=o,a=!1;3===o.rank&&(a=!0,i=Xi(o,[1,o.shape[0],o.shape[1],o.shape[2]]));const[]=t,s={images:i},l={alignCorners:n,halfPixelCenters:r,size:t},u=_o.runKernel(Nn,s,l);return a?Xi(u,[u.shape[1],u.shape[2],u.shape[3]]):u}}),Oa=No({bincount_:function(e,t,n){const r=To(e,"x","bincount"),o=To(t,"weights","bincount");q("int32"===r.dtype,()=>`Error in bincount: input dtype must be int32, but got ${r.dtype}`),q(n>=0,()=>`size must be non-negative, but got ${n}.`),q(o.size===r.size||0===o.size,()=>`Error in bincount: weights must have the same size as input or0-length, but got input shape: ${r.shape}, weights shape: ${o.shape}.`);const i={x:r,weights:o},a={size:n};return _o.runKernel(Ke,i,a)}});function Ra(e,t){const n=e.length,r=[];for(let o=0;o<n;o++){const i=n-1-o,a=e[i]||1;(t[t.length-1-o]||1)>1&&1===a&&r.unshift(i)}return r}function Ba(e,t){const n=[];for(let r=0;r<t.length;r++){const o=e[e.length-r-1],i=t.length-r-1,a=t[i];(null==o||1===o&&a>1)&&n.unshift(i)}return n}function Pa(e,t){const n=[],r=Math.max(e.length,t.length);for(let o=0;o<r;o++){let r=e[e.length-o-1];null==r&&(r=1);let i=t[t.length-o-1];if(null==i&&(i=1),1===r)n.unshift(i);else if(1===i)n.unshift(r);else{if(r!==i)throw Error(`Operands could not be broadcast together with shapes ${e} and ${t}.`);n.unshift(r)}}return n}const La=No({lessEqual_:function(e,t){let n=To(e,"a","lessEqual","string_or_numeric"),r=To(t,"b","lessEqual","string_or_numeric");[n,r]=ho(n,r),Pa(n.shape,r.shape);const o={a:n,b:r};return _o.runKernel(zt,o)}}),Wa=No({greater_:function(e,t){let n=To(e,"a","greater","string_or_numeric"),r=To(t,"b","greater","string_or_numeric");[n,r]=ho(n,r),Pa(n.shape,r.shape);const o={a:n,b:r};return _o.runKernel(Ct,o)}}),Ua=No({sum_:function(e,t=null,n=!1){let r=To(e,"x","sum");"bool"===r.dtype&&(r=hi(r,"int32"));const o={x:r},i={axis:t,keepDims:n};return _o.runKernel(Kn,o,i)}}),za=No({sub_:function(e,t){let n=To(e,"a","sub"),r=To(t,"b","sub");[n,r]=ho(n,r);const o={a:n,b:r};return _o.runKernel(ur,o)}}),Va=No({round_:function(e){const t={x:To(e,"x","round")};return _o.runKernel(On,t)}}),Ha=No({broadcastTo_:function(e,t){let n=To(e,"broadcastTo","x");const r=n.shape;if(t.some(e=>!(e>0)||e%1!=0))throw new Error(`broadcastTo(): Invalid broadcast shape [${t}].`);if(t.length<n.rank)throw new Error(`broadcastTo(): shape.length=${t.length} < input.rank=${n.rank}.`);if(t.length>n.rank){const e=n.shape.slice();for(;e.length<t.length;)e.unshift(1);n=Xi(n,e)}const o=n.shape,i=Array.from(t);for(let e=t.length-1;e>=0;e--)if(o[e]===t[e])i[e]=1;else if(1!==n.shape[e])throw new Error(`broadcastTo(): [${r}] cannot be broadcast to [${t}].`);if(0===i.map((e,t)=>e>1?t:-1).filter(e=>e>=0).length)return fi(n);const a={x:n},s={reps:i};return _o.runKernel(dr,a,s)}}),Ga=No({where_:function(e,t,n){const r=To(t,"a","where"),o=To(n,"b","where"),i=To(e,"condition","where","bool"),a=Pa(Pa(i.shape,r.shape),o.shape),s={condition:Ha(i,a),t:Ha(r,a),e:Ha(o,a)};return _o.runKernel(Pn,s)}});function qa(e,t,n=1,r="float32"){if(0===n)throw new Error("Cannot have a step of zero");const o={start:e,stop:t,step:n,dtype:r};return _o.runKernel(kn,{},o)}const Ka=No({threshold_:function(e,t="binary",n=!1,r=.5){const o=To(e,"image","threshold"),i=o.shape[0]*o.shape[1];let a,s,l,u,p=Ki(pa([r]),255);if(q(3===o.rank,()=>`Error in threshold: image must be rank 3,but got rank ${o.rank}.`),q(3===o.shape[2]||1===o.shape[2],()=>`Error in threshold: image color channel must be equal to 3 or 1but got ${o.shape[2]}.`),q("int32"===o.dtype||"float32"===o.dtype,()=>`Error in dtype: image dtype must be int32 or float32,but got dtype ${o.dtype}.`),q("otsu"===t||"binary"===t,()=>`Method must be binary or otsu, but was ${t}`),3===o.shape[2]){[a,s,l]=Zi(o,[1,1,1],-1);const e=Ki(a,.2989),t=Ki(s,.587),n=Ki(l,.114);u=Vi(Vi(e,t),n)}else u=e;"otsu"===t&&(p=function(e,t){let n,r,o,i,a,s,l=pa([-1]),u=pa([0]),p=pa([0]);for(let c=0;c<e.size-1;c++){n=Ji(e,0,c+1),r=Ji(e,c+1),a=qi(Ua(n),t),s=qi(Ua(r),t);const d=Ua(Ki(n,qa(0,n.size)));o=qi(d,Ua(n));const h=ha(r.shape,n.size),f=Vi(qa(0,r.size),h),g=Ki(r,f);i=qi(Ua(g),Ua(r));const m=za(o,i),y=za(o,i),b=Ki(a,s);p=Ki(Ki(b,m),y);const $=Wa(p,u);u=Ga($,p,u),l=Ga($,pa([c]),l)}return l}(Oa(hi(Va(u),"int32"),Co([]),256),i));const c=n?La(u,p):Wa(u,p);return hi(Ki(c,255),"int32")}}),Xa=No({transform_:function(e,t,n="nearest",r="constant",o=0,i){const a=To(e,"image","transform","float32"),s=To(t,"transforms","transform","float32");q(4===a.rank,()=>`Error in transform: image must be rank 4,but got rank ${a.rank}.`),q(2===s.rank&&(s.shape[0]===a.shape[0]||1===s.shape[0])&&8===s.shape[1],()=>"Error in transform: Input transform should be batch x 8 or 1 x 8"),q
2(null==i||2===i.length,()=>`Error in transform: outputShape must be [height, width] or null, but got ${i}.`);const l={image:a,transforms:s},u={interpolation:n,fillMode:r,fillValue:o,outputShape:i};return _o.runKernel(fr,l,u)}}),Ya=No({greaterEqual_:function(e,t){let n=To(e,"a","greaterEqual","string_or_numeric"),r=To(t,"b","greaterEqual","string_or_numeric");[n,r]=ho(n,r),Pa(n.shape,r.shape);const o={a:n,b:r};return _o.runKernel(Mt,o)}}),Ja=No({logicalAnd_:function(e,t){const n=To(e,"a","logicalAnd","bool"),r=To(t,"b","logicalAnd","bool");Pa(n.shape,r.shape);const o={a:n,b:r};return _o.runKernel(qt,o)}});No({bandPart_:function(e,t,n){q(t%1==0,()=>`bandPart(): numLower must be an integer, got ${t}.`),q(n%1==0,()=>`bandPart(): numUpper must be an integer, got ${n}.`);const r=To(e,"a","bandPart");q(r.rank>=2,()=>`bandPart(): Rank must be at least 2, got ${r.rank}.`);const o=r.shape,[i,a]=r.shape.slice(-2);if(!(t<=i))throw new Error(`bandPart(): numLower (${t}) must not be greater than the number of rows (${i}).`);if(!(n<=a))throw new Error(`bandPart(): numUpper (${n}) must not be greater than the number of columns (${a}).`);t<0&&(t=i),n<0&&(n=a);const s=Xi(qa(0,i,1,"int32"),[-1,1]),l=qa(0,a,1,"int32"),u=za(s,l),p=Ja(La(u,Yi(+t,"int32")),Ya(u,Yi(-n,"int32"))),c=ta([i,a],r.dtype);return Xi(Qi(ea(Xi(r,[-1,i,a])).map(e=>Ga(p,e,c))),o)}});const Za=No({abs_:function(e){const t=To(e,"x","abs");if("complex64"===t.dtype){const e={x:t};return _o.runKernel(Qe,e)}{const e={x:t};return _o.runKernel(Ne,e)}}});function Qa(e,t){for(let n=0;n<e.length;++n)if(e[e.length-n-1]!==t-1-n)return!1;return!0}
2function es(e,t,n){const r=e.length+t.length,o=[];let i=0,a=0;for(let s=0;s<r;s++)-1===n.indexOf(s)?o.push(e[i++]):o.push(t[a++]);return o}function ts(e,t){const n=[],r=e.length;for(let o=0;o<r;o++)-1===t.indexOf(o)&&n.push(e[o]);return[n,t.map(t=>e[t])]}function ns(e,t){return es(e,t.map(e=>1),t)}function rs(e,t,n){q(Qa(t,n),()=>`${e} supports only inner-most axes for now. Got axes ${t} and rank-${n} input.`)}function os(e,t){if(Qa(e,t))return null;const n=[];for(let r=0;r<t;++r)-1===e.indexOf(r)&&n.push(r);return e.forEach(e=>n.push(e)),n}function is(e){return e.map((e,t)=>[t,e]).sort((e,t)=>e[1]-t[1]).map(e=>e[0])}function as(e,t){const n=[];for(let r=t-e;r<t;++r)n.push(r);return n}const ss=No({max_:function(e,t=null,n=!1){const r={x:To(e,"x","max")},o={reductionIndices:t,keepDims:n};return _o.runKernel(Zt,r,o)}}),ls=No({min_:function(e,t=null,n=!1){const r={x:To(e,"x","min")},o={axis:t,keepDims:n};return _o.runKernel(sn,r,o)}}),us=No({pow_:function(e,t){let n=To(e,"base","pow"),r=To(t,"exp","pow");[n,r]=ho(n,r);const o={a:n,b:r};return _o.runKernel(xn,o)}}),ps=No({sqrt_:function(e){const t={x:To(e,"x","sqrt")};return _o.runKernel(qn,t)}}),cs=No({square_:function(e){const t=To(e,"x","square");return _o.runKernel("Square",{x:t},{})}});function ds(e,t,n=null){if(0===e.rank)return Za(e);if(1!==e.rank&&null===n)return ds(Xi(e,[-1]),t,n);if(1===e.rank||"number"==typeof n||Array.isArray(n)&&1===n.length){if(1===t)return Ua(Za(e),n);if(t===1/0)return ss(Za(e),n);if(t===-1/0)return ls(Za(e),n);if("euclidean"===t||2===t)return ps(Ua(us(Za(e),Yi(2,"int32")),n));throw new Error(`Error in norm: invalid ord value: ${t}`)}if(Array.isArray(n)&&2===n.length){if(1===t)return ss(Ua(Za(e),n[0]),n[1]-1);if(t===1/0)return ss(Ua(Za(e),n[1]),n[0]);if(t===-1/0)return ls(Ua(Za(e),n[1]),n[0]);if("fro"===t||"euclidean"===t)return ps(Ua(cs(e),n));throw new Error(`Error in norm: invalid ord value: ${t}`)}throw new Error(`Error in norm: invalid axis: ${n}`)}const hs=No({norm_:function(e,t="euclidean",n=null,r=!1){const o=ds(e=To(e,"x","norm"),t,n);let i=o.shape;if(r){const t=re(n,e.shape);i=ns(o.shape,t)}return Xi(o,i)}}),fs=No({squeeze_:function(e,t){const n=To(e,"x","squeeze");return Xi(n,oe(n.shape,t).newShape)}});function gs(){return _o}function ms(e,t){return _o.tidy(e,t)}function ys(e){fo(e).forEach(e=>e.dispose())}function bs(e){return _o.keep(e)}No({gramSchmidt_:function(e){let t;if(Array.isArray(e)){t=!1,q(null!=e&&e.length>0,()=>"Gram-Schmidt process: input must not be null, undefined, or empty");const n=e[0].shape[0];for(let t=1;t<e.length;++t)q(e[t].shape[0]===n,()=>`Gram-Schmidt: Non-unique lengths found in the input vectors: (${e[t].shape[0]} vs. ${n})`)}else t=!0,e=Zi(e,e.shape[0],0).map(e=>fs(e,[0]));q(e.length<=e[0].shape[0],()=>`Gram-Schmidt: Number of vectors (${e.length}) exceeds number of dimensions (${e[0].shape[0]}).`);const n=[],r=e;for(let t=0;t<e.length;++t)n.push(_o.tidy(()=>{let e=r[t];if(t>0)for(let r=0;r<t;++r){const t=Ki(Ua(Ki(n[r],e)),n[r]);e=za(e,t)}return qi(e,hs(e,"euclidean"))}));return t?Qi(n,0):n}}),eo=function(e){ke().getBool("DEPRECATION_WARNINGS_ENABLED")&&console.warn(e+" You can disable deprecation warnings with tf.disableDeprecationWarnings().")};const $s=No({expandDims_:function(e,t=0){const n=To(e,"x","expandDims","string_or_numeric");q(t<=n.rank,()=>"Axis must be <= rank of the tensor");const r={input:n},o={dim:t};return _o.runKernel(vt,r,o)}}),_s=No({eye_:function(e,t,n,r="float32"){null==t&&(t=e);const o=di([e,t],r),i=e<=t?e:t;for(let e=0;e<i;++e)o.set(1,e,e);const a=Xi(o.toTensor(),[e,t]);if(null==n)return a;if(1===n.length)return ba($s(a,0),[n[0],1,1]);if(2===n.length)return ba($s($s(a,0),0),[n[0],n[1],1,1]);if(3===n.length)return ba($s($s($s(a,0),0),0),[n[0],n[1],n[2],1,1]);throw new Error(`eye() currently supports only 1D and 2D batchShapes, but received ${n.length}D.`)}}),ws=No({matMul_:function(e,t,n=!1,r=!1){let o=To(e,"a","matMul"),i=To(t,"b","matMul");[o,i]=ho(o,i);const a={a:o,b:i},s={transposeA:n,transposeB:r};return _o.runKernel(Ge,a,s)}}),xs=No({neg_:function(e){const t={x:To(e,"x","neg")};return _o.runKernel(hn,t)}}),Ss=No({transpose_:function(e,t){const n=To(e,"x","transpose");if(null==t&&(t=n.shape.map((e,t)=>t).reverse()),q(n.rank===t.length,()=>`Error in transpose: rank of input ${n.rank}
2 must match length of perm ${t}.`),t.forEach(e=>{q(e>=0&&e<n.rank,()=>"All entries in 'perm' must be between 0 and "+(n.rank-1)+` but got ${t}`)}),n.rank<=1)return n.clone();const r={x:n},o={perm:t};return _o.runKernel(gr,r,o)}});function vs(e,t=!1){return _o.tidy(()=>{q(2===e.shape.length,()=>`qr2d() requires a 2D Tensor, but got a ${e.shape.length}D Tensor.`);const n=e.shape[0],r=e.shape[1];let o=_s(n),i=fi(e);const a=fa([[1]],[1,1]);let s=fi(a);const l=n>=r?r:n;for(let e=0;e<l;++e){const t=i,l=s,u=o;[s,i,o]=_o.tidy(()=>{const t=Ji(i,[e,e],[n-e,1]),l=hs(t),u=Ji(i,[e,e],[1,1]),p=Ga(Wa(u,0),fa([[-1]]),fa([[1]])),c=za(u,Ki(p,l)),d=qi(t,c);s=1===d.shape[0]?fi(a):Hi([a,Ji(d,[1,0],[d.shape[0]-1,d.shape[1]])],0);const h=xs(qi(ws(p,c),l)),f=Ji(i,[e,0],[n-e,r]),g=Ki(h,s),m=Ss(s);if(0===e)i=za(f,ws(g,ws(m,f)));else{const t=za(f,ws(g,ws(m,f)));i=Hi([Ji(i,[0,0],[e,r]),t],0)}const y=Ss(g),b=Ji(o,[0,e],[n,o.shape[1]-e]);if(0===e)o=za(b,ws(ws(b,s),y));else{const t=za(b,ws(ws(b,s),y));o=Hi([Ji(o,[0,0],[n,e]),t],1)}return[s,i,o]}),ys([t,l,u])}return!t&&n>r&&(o=Ji(o,[0,0],[n,r]),i=Ji(i,[0,0],[r,r])),[o,i]})}var ks;No({qr_:function(e,t=!1){if(q(e.rank>=2,()=>`qr() requires input tensor to have a rank >= 2, but got rank ${e.rank}`),2===e.rank)return vs(e,t);{const n=e.shape.slice(0,e.shape.length-2).reduce((e,t)=>e*t),r=ea(Xi(e,[n,e.shape[e.shape.length-2],e.shape[e.shape.length-1]]),0),o=[],i=[];return r.forEach(e=>{const[n,r]=vs(e,t);o.push(n),i.push(r)}),[Xi(Qi(o,0),e.shape),Xi(Qi(i,0),e.shape)]}}}),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"}(ks||(ks={}));const Es=No({mean_:function(e,t=null,n=!1){const r={x:To(e,"x","mean")},o={axis:t,keepDims:n};return _o.runKernel(an,r,o)}}),Is=No({notEqual_:function(e,t){let n=To(e,"a","notEqual","string_or_numeric"),r=To(t,"b","notEqual","string_or_numeric");[n,r]=ho(n,r),Pa(n.shape,r.shape);const o={a:n,b:r};return _o.runKernel(fn,o)}});function Ts(e,t="float32"){if("complex64"===t){const t=Ts(e,"float32"),n=ta(e,"float32");return jo(t,n)}const n=me(J(e),t);return _o.makeTensor(n,e,t)}const Fs=No({computeWeightedLoss_:function(e,t,n=ks.SUM_BY_NONZERO_WEIGHTS){const r=To(e,"losses","computeWeightedLoss");let o=null;null!=t&&(o=To(t,"weights","computeWeightedLoss"));const i=null==o?r:Ki(r,o);if(n===ks.NONE)return i;if(n===ks.SUM)return Ua(i);if(n===ks.MEAN){if(null==o)return Es(i);{const e=r.size/o.size,t=qi(Ua(i),Ua(o));return e>1?qi(t,Yi(e)):t}}if(n===ks.SUM_BY_NONZERO_WEIGHTS){if(null==o)return qi(Ua(i),Yi(r.size));{const e=Ki(o,Ts(r.shape)),t=hi(Ua(Is(e,Yi(0))),"float32");return qi(Ua(i),t)}}throw Error(`Unknown reduction: ${n}`)}});No({absoluteDifference_:function(e,t,n,r=ks.SUM_BY_NONZERO_WEIGHTS){const o=To(e,"labels","absoluteDifference"),i=To(t,"predictions","absoluteDifference");let a=null;null!=n&&(a=To(n,"weights","absoluteDifference")),K(o.shape,i.shape,"Error in absoluteDifference: ");const s=Za(za(o,i));return Fs(s,a,r)}}),No({cosineDistance_:function(e,t,n,r,o=ks.SUM_BY_NONZERO_WEIGHTS){const i=To(e,"labels","cosineDistance"),a=To(t,"predictions","cosineDistance");let s=null;null!=r&&(s=To(r,"weights","cosineDistance")),K(i.shape,a.shape,"Error in cosineDistance: ");const l=Yi(1),u=za(l,Ua(Ki(i,a),n,!0));return Fs(u,s,o)}});const Ns=No({relu_:function(e){const t={x:To(e,"x","relu")};return _o.runKernel(Tn,t)}});No({hingeLoss_:function(e,t,n,r=ks.SUM_BY_NONZERO_WEIGHTS){let o=To(e,"labels","hingeLoss");const i=To(t,"predictions","hingeLoss");let a=null;null!=n&&(a=To(n,"weights","hingeLoss")),K(o.shape,i.shape,"Error in hingeLoss: ");const s=Yi(1);o=za(Ki(Yi(2),o),s);const l=Ns(za(s,Ki(o,i)));return Fs(l,a,r)}});const js=No({minimum_:function(e,t){let n=To(e,"a","minimum"),r=To(t,"b","minimum");[n,r]=ho(n,r),"bool"===n.dtype&&(n=hi(n,"int32"),r=hi(r,"int32")),Pa(n.shape,r.shape);const o={a:n,b:r};return _o.runKernel(ln,o)}});No({huberLoss_:function(e,t,n,r=1,o=ks.SUM_BY_NONZERO_WEIGHTS){const i=To(e,"labels","huberLoss"),a=To(t,"predictions","huberLoss");let s=null;null!=n&&(s=To(n,"weights","huberLoss")),K(i.shape,a.shape,"Error in huberLoss: ");const l=Yi(r),u=Za(za(a,i)),p=js(u,l),c=za(u,p),d=Vi(Ki(Yi(.5),cs(p)),Ki(l,c));return Fs(d,s,o)}});const As=No({log_:function(e){const t={x:To(e,"x","log")};return _o.runKernel(Ht,t)}});No({logLoss_:function(e,t,n,r=1e-7,o=ks.SUM_BY_NONZERO_WEIGHTS){const i=To(e,"labels","logLoss"),a=To(t,"predictions","logLoss");let s=null;null!=n&&(s=To(n,"weights","logLoss")),K(i.shape,a.shape,"Error in logLoss: ");const l=Yi(1),u=Yi(r),p=xs(Ki(i,As(Vi(a,u)))),c=Ki(za(l,i),As(Vi(za(l,a),u))),d=za(p,c);return Fs(d,s,o)}});const Cs=No({squaredDifference_:function(e,t){let n=To(e,"a","squaredDifference"),r=To(t,"b","squaredDifference");[n,r]=ho(n,r),Pa(n.shape,r.shape);const o={a:n,b:r};return _o.runKernel(rr,o,{})}});
vendor: 8,779 bytes, line 2
2No({meanSquaredError_:function(e,t,n,r=ks.SUM_BY_NONZERO_WEIGHTS){const o=To(e,"labels","meanSquaredError"),i=To(t,"predictions","meanSquaredError");let a=null;null!=n&&(a=To(n,"weights","meanSquaredError")),K(o.shape,i.shape,"Error in meanSquaredError: ");const s=Cs(o,i);return Fs(s,a,r)}});const Ms=No({exp_:function(e){const t={x:To(e,"x","exp")};return _o.runKernel(St,t)}}),Ds=No({log1p_:function(e){const t={x:To(e,"x","log1p")};return _o.runKernel(Gt,t)}});function Os(e){return _o.customGrad(e)}No({sigmoidCrossEntropy_:function(e,t,n,r=0,o=ks.SUM_BY_NONZERO_WEIGHTS){let i=To(e,"multiClassLabels","sigmoidCrossEntropy");const a=To(t,"logits","sigmoidCrossEntropy");let s=null;if(null!=n&&(s=To(n,"weights","sigmoidCrossEntropy")),K(i.shape,a.shape,"Error in sigmoidCrossEntropy: "),r>0){const e=Yi(r),t=Yi(1),n=Yi(.5);i=Vi(Ki(i,za(t,e)),Ki(n,e))}const l=function(e,t){const n=To(e,"labels","sigmoidCrossEntropyWithLogits"),r=To(t,"logits","sigmoidCrossEntropyWithLogits");K(n.shape,r.shape,"Error in sigmoidCrossEntropyWithLogits: ");const o=Ns(r),i=Ki(r,n),a=Ds(Ms(xs(Za(r))));return Vi(za(o,i),a)}(i,a);return Fs(l,s,o)}});const Rs=No({logSumExp_:function(e,t=null,n=!1){const r=To(e,"x","logSumExp"),o=re(t,r.shape),i=ss(r,o,!0),a=za(r,i),s=Ms(a),l=Ua(s,o),u=As(l),p=Vi(Xi(i,u.shape),u);if(n){const e=ns(p.shape,o);return Xi(p,e)}return p}});No({softmaxCrossEntropy_:function(e,t,n,r=0,o=ks.SUM_BY_NONZERO_WEIGHTS){let i=To(e,"onehotLabels","softmaxCrossEntropy");const a=To(t,"logits","softmaxCrossEntropy");let s=null;if(null!=n&&(s=To(n,"weights","softmaxCrossEntropy")),K(i.shape,a.shape,"Error in softmaxCrossEntropy: "),r>0){const e=Yi(r),t=Yi(1),n=Yi(i.shape[1]);i=Vi(Ki(i,za(t,e)),qi(e,n))}const l=function(e,t,n=-1){if(-1===n&&(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}`);const r=Os((e,t,r)=>{const o=Rs(t,[n],!0),i=za(hi(t,"float32"),o);r([e,i]);const a=xs(Ki(i,e));return{value:Ua(a,[n]),gradFunc:(e,t)=>{const[r,o]=t,i=ns(e.shape,[n]);return[Ki(Xi(e,i),za(hi(r,"float32"),Ms(o))),Ki(Xi(e,i),za(Ms(o),hi(r,"float32")))]}}});return r(e,t)}(i,a);return Fs(l,s,o)}});const Bs=No({sparseFillEmptyRows_:function(e,t,n,r){const o=To(e,"indices","sparseFillEmptyRows"),i=To(t,"values","sparseFillEmptyRows"),a=To(n,"denseShape","sparseFillEmptyRows"),s=To(r,"defaultValue","sparseFillEmptyRows",i.dtype);if(2!==o.rank)throw new Error(`Indices should be Tensor2D but received shape\n        ${o.shape}`);if(1!==i.rank)throw new Error(`Values should be Tensor1D but received shape ${i.shape}`);if(1!==a.rank)throw new Error(`Dense shape should be Tensor1D but received shape ${a.shape}`);if(0!==s.rank)throw new Error(`Default value should be a scalar but received shape ${s.shape}`);const l={indices:o,values:i,denseShape:a,defaultValue:s},u=_o.runKernel(Zn,l);return{outputIndices:u[0],outputValues:u[1],emptyRowIndicator:u[2],reverseIndexMap:u[3]}}}),Ps=No({sparseReshape_:function(e,t,n){const r=To(e,"inputIndices","sparseReshape"),o=To(t,"inputShape","sparseReshape"),i=To(n,"newShape","sparseReshape");if(2!==r.rank)throw new Error(`Input indices should be Tensor2D but received shape\n        ${r.shape}`);if(1!==o.rank)throw new Error(`Input shape should be Tensor1D but received shape ${o.shape}`);if(1!==i.rank)throw new Error(`New shape should be Tensor1D but received shape ${i.shape}`);const a={inputIndices:r,inputShape:o,newShape:i},s=_o.runKernel(Qn,a);return{outputIndices:s[0],outputShape:s[1]}}}),Ls=No({sparseSegmentMean_:function(e,t,n){const r=To(e,"data","sparseSegmentMean"),o=To(t,"indices","sparseSegmentMean"),i=To(n,"segmentIds","sparseSegmentMean");if(r.rank<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(1!==o.rank)throw new Error(`Indices should be Tensor1D but received shape\n          ${o.shape}`);if(1!==i.rank)throw new Error(`Segment ids should be Tensor1D but received shape\n          ${i.shape}`);const a={data:r,indices:o,segmentIds:i};return _o.runKernel(er,a)}}),Ws=No({sparseSegmentSum_:function(e,t,n){const r=To(e,"data","sparseSegmentSum"),o=To(t,"indices","sparseSegmentSum"),i=To(n,"segmentIds","sparseSegmentSum");if(r.rank<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(1!==o.rank)throw new Error(`Indices should be Tensor1D but received shape\n         ${o.shape}`);if(1!==i.rank)throw new Error(`Segment ids should be Tensor1D but received shape\n         ${i.shape}`);const a={data:r,indices:o,segmentIds:i};return _o.runKernel(tr,a)}}),Us=No({stringNGrams_:function(e,t,n,r,o,i,a,s){const l=To(e,"data","stringNGrams","string");if("string"!==l.dtype)throw new Error("Data must be of datatype string");if(1!==l.shape.length)throw new Error(`Data must be a vector, saw: ${l.shape}`);const u=To(t,"dataSplits","stringNGrams");if("int32"!==u.dtype)throw new Error("Data splits must be of datatype int32");const p={separator:n,nGramWidths:r,leftPad:o,rightPad:i,padWidth:a,preserveShortSequences:s},c={data:l,dataSplits:u},d=_o.runKernel(ar,c,p);return{nGrams:d[0],nGramsSplits:d[1]}}}),zs=No({stringSplit_:function(e,t,n=!0){const r=To(e,"input","stringSplit","string"),o=To(t,"delimiter","stringSplit","string");if(1!==r.rank)throw new Error(`Input should be Tensor1D but received shape ${r.shape}`);if(0!==o.rank)throw new Error(`Delimiter should be a scalar but received shape ${o.shape}`);const i={skipEmpty:n},a={input:r,delimiter:o},s=_o.runKernel(sr,a,i);return{indices:s[0],values:s[1],shape:s[2]}}}),Vs=No({stringToHashBucketFast_:function(e,t){const n=To(e,"input","stringToHashBucketFast","string"),r={numBuckets:t};if(t<=0)throw new Error("Number of buckets must be at least 1");const o={input:n};return _o.runKernel(lr,o,r)}}),Hs={flipLeftRight:ya,grayscaleToRGB:$a,resizeNearestNeighbor:Da,resizeBilinear:Ma,rotateWithOffset:_a,cropAndResize:ma,nonMaxSuppression:xa,nonMaxSuppressionAsync:async function(e,t,n,r=.5,o=Number.NEGATIVE_INFINITY){const i=To(e,"boxes","nonMaxSuppressionAsync"),a=To(t,"scores","nonMaxSuppressionAsync"),s=wa(i,a,n,r,o);n=s.maxOutputSize,r=s.iouThreshold,o=s.scoreThreshold;const l=await Promise.all([i.data(),a.data()]),u=l[0],p=l[1],{selectedIndices:c}=ka(u,p,n,r,o);return i!==e&&i.dispose(),a!==t&&a.dispose(),pa(c,"int32")},nonMaxSuppressionWithScore:Aa,nonMaxSuppressionWithScoreAsync:async function(e,t,n,r=.5,o=Number.NEGATIVE_INFINITY,i=0){const a=To(e,"boxes","nonMaxSuppressionAsync"),s=To(t,"scores","nonMaxSuppressionAsync"),l=wa(a,s,n,r,o,i);n=l.maxOutputSize,r=l.iouThreshold,o=l.scoreThreshold,i=l.softNmsSigma;const u=await Promise.all([a.data(),s.data()]),p=u[0],c=u[1],{selectedIndices:d,selectedScores:h}=Ia(p,c,n,r,o,i);return a!==e&&a.dispose(),s!==t&&s.dispose(),{selectedIndices:pa(d,"int32"),selectedScores:pa(h)}},nonMaxSuppressionPadded:Ca,nonMaxSuppressionPaddedAsync:async function(e,t,n,r=.5,o=Number.NEGATIVE_INFINITY,i=!1){const a=To(e,"boxes","nonMaxSuppressionAsync"),s=To(t,"scores","nonMaxSuppressionAsync"),l=wa(a,s,n,r,o,null),u=l.maxOutputSize,p=l.iouThreshold,c=l.scoreThreshold,[d,h]=await Promise.all([a.data(),s.data()]),{selectedIndices:f,validOutputs:g}=Ea(d,h,u,p,c,i);return a!==e&&a.dispose(),s!==t&&s.dispose(),{selectedIndices:pa(f,"int32"),validOutputs:Yi(g,"int32")}},threshold:Ka,transform:Xa},Gs={sparseFillEmptyRows:Bs,sparseReshape:Ps,sparseSegmentMean:Ls,sparseSegmentSum:Ws},qs={stringNGrams:Us,stringSplit:zs,stringToHashBucketFast:Vs};function Ks(e,t){const n=e[0].length;e.forEach((e,t)=>{q(e.length===n,()=>`Error in concat${n}D: rank of tensors[${t}] must be the same as the rank of the rest (${n})`)}),q(t>=0&&t<n,()=>`Error in concat${n}D: axis must be between 0 and ${n-1}.`);const r=e[0];e.forEach((e,o)=>{for(let i=0;i<n;i++)q(i===t||e[i]===r[i],()=>`Error in concat${n}D: Shape of tensors[${o}] (${e}) does not match the shape of the rest (${r}) along the non-concatenated axis ${o}.`)})}function Xs(e,t){const n=e[0].slice();for(let r=1;r<e.length;r++)n[t]+=e[r][t];return n}function Ys(e,t,n,r,o="NHWC",i){return Qs(e,[...t,e[3]],n,i,r,null,null,ll(o))}function Js(e,t,n,r,o,i,a="channelsLast"){const[s,l]=nl(t);let u;if("channelsLast"===a)u=[s,l,e[3],e[3]];else{if("channelsFirst"!==a)throw new Error(`Unknown dataFormat ${a}`);u=[s,l,e[1],e[1]]}return Qs(e,u,n,r,o,i,!1,a)}function Zs(e,t,n,r,o,i,a="NDHWC"){const[s,l,u]=rl(t);let p,c;if("NDHWC"===a)c="channelsLast",p=[s,l,u,e[4],e[4]];else{if("NCDHW"!==a)throw new Error(`Unknown dataFormat ${a}`);c="channelsFirst",p=[s,l,u,e[1],e[1]]}return el(e,p,n,r,o,!1,c,i)}function Qs(e,t,n,r,o,i,a=!1,s="channelsLast"){let[l,u,p,c]=[-1,-1,-1,-1];if("channelsLast"===s)[l,u,p,c]=e;else{if("channelsFirst"!==s)throw new Error(`Unknown dataFormat ${s}`);[l,c,u,p]=e}
vendor: 4,916 bytes, line 2
2const[d,h,,f]=t,[g,m]=nl(n),[y,b]=nl(r),$=ol(d,y),_=ol(h,b),{padInfo:w,outHeight:x,outWidth:S}=function(e,t,n,r,o,i,a,s,l){let u,p,c;if("number"==typeof e){u={top:e,bottom:e,left:e,right:e,type:0===e?"VALID":"NUMBER"};const o=function(e,t,n,r,o){null==r&&(r=tl(e,t,n));const i=e[1];return[il((e[0]-t+2*r)/n+1,o),il((i-t+2*r)/n+1,o)]}([t,n],i,r,e,s);p=o[0],c=o[1]}else if("same"===e){p=Math.ceil(t/r),c=Math.ceil(n/o);const e=Math.max(0,(p-1)*r+i-t),s=Math.max(0,(c-1)*o+a-n),l=Math.floor(e/2),d=e-l,h=Math.floor(s/2);u={top:l,bottom:d,left:h,right:s-h,type:"SAME"}}else if("valid"===e)u={top:0,bottom:0,left:0,right:0,type:"VALID"},p=Math.ceil((t-i+1)/r),c=Math.ceil((n-a+1)/o);else{if("object"!=typeof e)throw Error(`Unknown padding parameter: ${e}`);{const d="channelsLast"===l?e[1][0]:e[2][0],h="channelsLast"===l?e[1][1]:e[2][1],f="channelsLast"===l?e[2][0]:e[3][0],g="channelsLast"===l?e[2][1]:e[3][1];u={top:d,bottom:h,left:f,right:g,type:0===d&&0===h&&0===f&&0===g?"VALID":"EXPLICIT"},p=il((t-i+d+h)/r+1,s),c=il((n-a+f+g)/o+1,s)}}return{padInfo:u,outHeight:p,outWidth:c}}(o,u,p,g,m,$,_,i,s),v=a?f*c:f;let k;return"channelsFirst"===s?k=[l,v,x,S]:"channelsLast"===s&&(k=[l,x,S,v]),{batchSize:l,dataFormat:s,inHeight:u,inWidth:p,inChannels:c,outHeight:x,outWidth:S,outChannels:v,padInfo:w,strideHeight:g,strideWidth:m,filterHeight:d,filterWidth:h,effectiveFilterHeight:$,effectiveFilterWidth:_,dilationHeight:y,dilationWidth:b,inShape:e,outShape:k,filterShape:t}}function el(e,t,n,r,o,i=!1,a="channelsLast",s){let[l,u,p,c,d]=[-1,-1,-1,-1,-1];if("channelsLast"===a)[l,u,p,c,d]=e;else{if("channelsFirst"!==a)throw new Error(`Unknown dataFormat ${a}`);[l,d,u,p,c]=e}const[h,f,g,,m]=t,[y,b,$]=rl(n),[_,w,x]=rl(r),S=ol(h,_),v=ol(f,w),k=ol(g,x),{padInfo:E,outDepth:I,outHeight:T,outWidth:F}=function(e,t,n,r,o,i,a,s,l,u,p){let c,d,h,f;if("number"==typeof e){c={top:e,bottom:e,left:e,right:e,front:e,back:e,type:0===e?"VALID":"NUMBER"};const i=function(e,t,n,r,o,i){null==o&&(o=tl(e,t,r));const a=e[1],s=e[2];return[il((e[0]-t+2*o)/r+1,i),il((a-t+2*o)/r+1,i),il((s-t+2*o)/r+1,i),1]}([t,n,r,1],s,0,o,e,p);d=i[0],h=i[1],f=i[2]}else if("same"===e){d=Math.ceil(t/o),h=Math.ceil(n/i),f=Math.ceil(r/a);const e=(d-1)*o+s-t,p=(h-1)*i+l-n,g=(f-1)*a+u-r,m=Math.floor(e/2),y=e-m,b=Math.floor(p/2),$=p-b,_=Math.floor(g/2);c={top:b,bottom:$,left:_,right:g-_,front:m,back:y,type:"SAME"}}else{if("valid"!==e)throw Error(`Unknown padding parameter: ${e}`);c={top:0,bottom:0,left:0,right:0,front:0,back:0,type:"VALID"},d=Math.ceil((t-s+1)/o),h=Math.ceil((n-l+1)/i),f=Math.ceil((r-u+1)/a)}return{padInfo:c,outDepth:d,outHeight:h,outWidth:f}}(o,u,p,c,y,b,$,S,v,k,s),N=i?m*d:m;let j;return"channelsFirst"===a?j=[l,N,I,T,F]:"channelsLast"===a&&(j=[l,I,T,F,N]),{batchSize:l,dataFormat:a,inDepth:u,inHeight:p,inWidth:c,inChannels:d,outDepth:I,outHeight:T,outWidth:F,outChannels:N,padInfo:E,strideDepth:y,strideHeight:b,strideWidth:$,filterDepth:h,filterHeight:f,filterWidth:g,effectiveFilterDepth:S,effectiveFilterHeight:v,effectiveFilterWidth:k,dilationDepth:_,dilationHeight:w,dilationWidth:x,inShape:e,outShape:j,filterShape:t}}function tl(e,t,n,r=1){const o=ol(t,r);return Math.floor((e[0]*(n-1)-n+o)/2)}function nl(e){return"number"==typeof e?[e,e,e]:2===e.length?[e[0],e[1],1]:e}function rl(e){return"number"==typeof e?[e,e,e]:e}function ol(e,t){return t<=1?e:e+(e-1)*(t-1)}function il(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 al(e){const[t,n,r]=nl(e);return 1===t&&1===n&&1===r}function sl(e,t){return al(e)||al(t)}function ll(e){if("NHWC"===e)return"channelsLast";if("NCHW"===e)return"channelsFirst";throw new Error(`Unknown dataFormat ${e}`)}const ul=No({elu_:function(e){const t={x:To(e,"x","elu")};return _o.runKernel($t,t)}}),pl=No({leakyRelu_:function(e,t=.2){const n={x:To(e,"x","leakyRelu")},r={alpha:t};return _o.runKernel(Wt,n,r)}}),cl=No({prelu_:function(e,t){const n={x:To(e,"x","prelu"),alpha:To(t,"alpha","prelu")};return _o.runKernel(Sn,n)}}),dl=No({relu6_:function(e){const t={x:To(e,"x","relu6")};return _o.runKernel(Mn,t)}}),hl=No({sigmoid_:function(e){const t={x:To(e,"x","sigmoid")};return _o.runKernel(Hn,t)}}),fl=No({step_:function(e,t=0){const n={x:To(e,"x","step")},r={alpha:t};return _o.runKernel(_r,n,r)}});function gl(e,t,n){if(null==n||"linear"===n)return e;if("relu"===n)return Ki(e,fl(t));throw new Error(`Cannot compute gradient for fused activation ${n}.`)}function ml(e,t){let n=t;const r=Ba(e.shape,t.shape);return r.length>0&&(n=Ua(n,r)),Xi(n,e.shape)}function yl(e,t,n,r){if("linear"===t)return e;if("relu"===t)return Ns(e);if("elu"===t)return ul(e);if("relu6"===t)return dl(e);if("prelu"===t)return cl(e,n);if("leakyrelu"===t)return pl(e,r);if("sigmoid"===t)return hl(e);throw new Error(`Unknown fused activation ${t}.`)}const bl=(e,t)=>
vendor: 5,013 bytes, line 2
2!(e>0)||"linear"===t,$l=30;function _l(e){return e<=$l?e:de(e,Math.floor(Math.sqrt(e)))}function wl(e,t,n){return[n*("number"==typeof e?e:e[0]),t*("number"==typeof e?e:e[1])]}function xl(e,t,n,r=!0){let o=[];if(r)o=o.concat(t.slice(0)),o.push(e[0]/n),o=o.concat(e.slice(1));else{o=o.concat(e[0]);const n=t.length;for(let r=0;r<n;++r)o=o.concat([e[r+1]/t[r],t[r]]);o=o.concat(e.slice(n+1))}return o}function Sl(e,t,n=!0){const r=[];if(n){r.push(t);for(let n=t+1;n<e;++n)n<=2*t?(r.push(n),r.push(n-(t+1))):r.push(n)}else{const n=[],o=[];for(let r=1;r<e;++r)r>=2*t+1||r%2==1?o.push(r):n.push(r);r.push(...n),r.push(0),r.push(...o)}return r}function vl(e,t,n,r=!0){const o=[];r?o.push(e[0]/n):o.push(e[0]*n);for(let n=1;n<e.length;++n)n<=t.length?r?o.push(t[n-1]*e[n]):o.push(e[n]/t[n-1]):o.push(e[n]);return o}function kl(e,t){const n=[0];for(let r=0;r<t;++r)n.push(e[r][0]);return n}function El(e,t,n){const r=e.slice(0,1);for(let o=0;o<n;++o)r.push(e[o+1]-t[o][0]-t[o][1]);return r}function Il(e,t){const n=e.shape.length,r=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(r<1)throw new Error(`tf.gatherND() expects the indices to be rank 1 or higher, but the rank was ${r}.`);if("int32"!==t.dtype)throw new Error(`tf.gatherND() expects the indices to be int32 type, but the dtype was ${t.dtype}.`);if(t.shape[r-1]>n)throw new Error(`index innermost dimension length must be <= tensor rank; saw: ${t.shape[r-1]} vs. ${n}`);if(0===J(e.shape))throw new Error(`Requested more than 0 entries, but input is empty. Input shape: ${e.shape}.`);const o=t.shape,i=o[o.length-1];let a=1;for(let e=0;e<o.length-1;++e)a*=o[e];const s=e.shape,l=o.slice();l.pop();let u=1;for(let e=i;e<n;++e)u*=s[e],l.push(s[e]);const p=[...he(e.shape).map(e=>e/u),1].slice(0,i);return[l,a,u,p]}function Tl(e,t,n){const r=t.rank>1?t.shape[t.rank-1]:1,o=t.rank>1?t.rank-1:1,i=`Must have updates.shape = indices.shape[:batchDim] + shape[sliceDim:], got updates.shape: ${n.shape}, indices.shape: ${t.shape}, shape: ${e}, sliceDim: ${r}, and batchDim: ${o}.`;if(n.rank<o)throw new Error(i+` update.rank < ${o}. `);if(e.length<r+(n.rank-o))throw new Error(i+` Output shape length < ${r+(n.rank-o)}`);if(n.rank!==o+e.length-r)throw new Error(i+" update.rank != "+(o+e.length-r));for(let e=0;e<o;++e)if(n.shape[e]!==t.shape[e])throw new Error(i+` updates.shape[${e}] (${n.shape[e]}) != indices.shape[${e}] (${t.shape[e]}).`);for(let t=0;t<n.rank-o;++t)if(n.shape[t+o]!==e[t+r])throw new Error(i+` updates.shape[${t+o}] (${n.shape[t+o]}) != shape[${t+o}] (${e[t+o]})`)}function Fl(e,t,n){if(t.rank<1)throw new Error(`tf.scatterND() expects the indices to be rank 1 or higher, but the rank was ${t.rank}.`);if(e.rank<1)throw new Error(`tf.scatterND() expects the updates to be rank 1 or higher, but the rank was ${e.rank}.`);if("int32"!==t.dtype)throw new Error(`The dtype of 'indices' should be int32, but got dtype: ${t.dtype}`);if(n.length<1)throw new Error(`Output rank must be greater or equal to 1, but got shape: ${n}`);if(0===n.length){if(0===t.size)throw new Error(`Indices specified for empty output. indices shape: ${t.shape}`);if(0===e.size)throw new Error(`Updates specified for empty output. updates shape: ${e.shape}`)}Tl(n,t,e)}function Nl(e,t,n){const r=t.shape.length,o=r>1?t.shape[r-1]:1,i=n.length;let a=1;for(let e=o;e<i;++e)a*=n[e];const s=o<1?1:o;return{sliceRank:o,numUpdates:J(t.shape)/s,sliceSize:a,strides:[...he(n.slice(0,o)),1],outputSize:J(n)}}const jl=1.7580993408473768,Al=1.0507009873554805,Cl=.3275911,Ml=.254829592,Dl=-.284496736,Ol=1.421413741,Rl=-1.453152027,Bl=1.061405429;function Pl(e,t){if(e.length!==t.length)throw new Error(`Cannot merge real and imag arrays of different lengths. real:${e.length}, imag: ${t.length}.`);const n=new Float32Array(2*e.length);for(let r=0;r<n.length;r+=2)n[r]=e[r/2],n[r+1]=t[r/2];return n}function Ll(e){const t=new Float32Array(e.length/2),n=new Float32Array(e.length/2);for(let r=0;r<e.length;r+=2)t[r/2]=e[r],n[r/2]=e[r+1];return{real:t,imag:n}}function Wl(e){const t=Math.ceil(e.length/4),n=new Float32Array(t),r=new Float32Array(t);for(let t=0;t<e.length;t+=4)n[Math.floor(t/4)]=e[t],r[Math.floor(t/4)]=e[t+1];return{real:n,imag:r}}function Ul(e){const t=Math.floor(e.length/4),n=new Float32Array(t),r=new Float32Array(t);for(let t=2;t<e.length;t+=4)n[Math.floor(t/4)]=e[t],r[Math.floor(t/4)]=e[t+1];return{real:n,imag:r}}function zl(e,t){return{real:e[2*t],imag:e[2*t+1]}}function Vl(e,t,n,r){e[2*r]=t,e[2*r+1]=n}function Hl(e,t){const n=new Float32Array(e/2),r=new Float32Array(e/2);for(let o=0;o<Math.ceil(e/2);o++){const i=(t?2:-2)*Math.PI*(o/e);n[o]=Math.cos(i),r[o]=Math.sin(i)}return{real:n,imag:r}}function Gl(e,t,n){const r=(n?2:-2)*Math.PI*(e/t);return{real:Math.cos(r),imag:Math.sin(r)}}const ql="->",Kl=/->/g,Xl=",",Yl="...";function Jl(e,t){const n=((e=e.replace(/\s/g,"")).length-e.replace(Kl,"").length)/ql.length;if(n<1)throw new Error("Equations without an arrow are not supported.");
2if(n>1)throw new Error(`Equation must contain exactly one arrow ("${ql}").`);const[r,o]=e.split(ql);q(-1===r.indexOf(Yl),()=>`The ellipsis notation ("${Yl}") is not supported yet.`);const i=r.split(Xl),a=i.length;if(t!==a)throw new Error(`Expected ${a} input tensors, received ${t}`);if(a>2)throw new Error("Support for more than 2 input tensors is not implemented yet.");const s=[];for(let e=0;e<o.length;++e){const t=o[e];if(!i.some(e=>-1!==e.indexOf(t)))throw new Error(`Output subscripts contain the label ${t} not present in the input subscripts.`);-1===s.indexOf(t)&&s.push(t)}for(let e=0;e<r.length;++e){const t=r[e];-1===s.indexOf(t)&&t!==Xl&&s.push(t)}const l=new Array(i.length);for(let e=0;e<a;++e){if(new Set(i[e].split("")).size!==i[e].length)throw new Error(`Found duplicate axes in input component ${i[e]}. Support for duplicate axes in input is not implemented yet.`);l[e]=[];for(let t=0;t<i[e].length;++t)l[e].push(s.indexOf(i[e][t]))}const u=s.length,p=[];for(let e=o.length;e<u;++e)p.push(e);return{allDims:s,summedDims:p,idDims:l}}function Zl(e,t){let n=new Array(e);n.fill(-1);for(let e=0;e<t.length;++e)n[t[e]]=e;const r=[];for(let t=0;t<e;++t)-1===n[t]&&r.push(t);return n=n.filter(e=>-1!==e),{permutationIndices:n,expandDims:r}}function Ql(e,t,n){const r=new Array(e);for(let e=0;e<n.length;++e){const o=n[e].shape;for(let n=0;n<t[e].length;++n)void 0===r[t[e][n]]?r[t[e][n]]=o[n]:q(r[t[e][n]]===o[n],()=>`Expected dimension ${r[t[e][n]]} at axis ${n} of input shaped ${JSON.stringify(o)}, but got dimension ${o[n]}`)}}function eu(e,t){const n=e,r=[];let o=0;0===e.length&&n.push(-1),o=e.length+1;for(let e=0;e<o;++e)r.push([]);const i=[];for(let e=0;e<n.length;++e){const o=nu(t,n[e]);for(const t of o)-1===i.indexOf(t)&&(r[e].push(t),i.push(t))}return{path:n,steps:r}}function tu(e){return e.every((e,t)=>e===t)}function nu(e,t){const n=[];for(let r=0;r<e.length;++r)0!==e[r].length&&-1===e[r].indexOf(t)&&-1!==t||n.push(r);return n}function ru(e,t,n=0){let r=[];if("number"==typeof t)q(e.shape[n]%t===0,()=>"Number of splits must evenly divide the axis."),r=new Array(t).fill(e.shape[n]/t);else{const o=t.reduce((e,t)=>(-1===t&&(e+=1),e),0);q(o<=1,()=>"There should be only one negative value in split array.");const i=t.indexOf(-1);if(-1!==i){const r=t.reduce((e,t)=>t>0?e+t:e);t[i]=e.shape[n]-r}q(e.shape[n]===t.reduce((e,t)=>e+t),()=>"The sum of sizes must match the size of the axis dimension."),r=t}return r}function ou(e,t){let n,r=!1;for(e<=$l?(n=e,r=!0):n=de(e,Math.floor(Math.sqrt(e)));!r;)n>t||n===e?r=!0:n=de(e,n+1);return n}function iu(e,t,n){const r=[],o=e.length;for(let i=0;i<o;i++)i!==t?r.push(e[i]):r.push(n);return r}function au(e,t,n,r){const o=t.shape.length,i=e.shape.length;if(0!==r&&(r<-o||r>o))throw new Error(`Expect batchDims in the range of [-${o}, ${o}], but got ${r}`);if(r<0&&(r+=o),r>i)throw new Error(`batchDims (${r}) must be less than rank(x) (\n    ${i}).`);if(n<r)throw new Error(`batchDims (${r}) must be less than or equal to axis (${n}).`);for(let n=0;n<r;++n)if(e.shape[n]!==t.shape[n])throw new Error(`x.shape[${n}]: ${e.shape[n]} should be equal to indices.shape[${n}]: ${t.shape[n]}.`);const a=e.shape[n],s=[];let l=1,u=1,p=1;for(let t=0;t<r;++t)s.push(e.shape[t]),l*=e.shape[t];for(let t=r;t<n;t++)s.push(e.shape[t]),u*=e.shape[t];for(let e=r;e<o;e++)s.push(t.shape[e]);for(let t=n+1;t<i;t++)s.push(e.shape[t]),p*=e.shape[t];return{batchSize:l,sliceSize:p,outerSize:u,dimSize:a,outputShape:s}}function su(e){try{return e.map(e=>Ur(e))}catch(e){throw new Error(`Failed to decode encoded string bytes into utf-8, error: ${e}`)}}function lu(e){return e.map(e=>Wr(e))}function uu(e,t){const n=[];for(let e=0;e<t.length;e++)t[e]&&n.push(e);const r=di(e,"int32"),o=di([n.length,e.length],"int32");for(let t=0;t<n.length;t++){const i=r.indexToLoc(n[t]),a=t*e.length;o.values.set(i,a)}return o.toTensor()}const pu={kernelName:Ne,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Ki(e,fl(hi(n,"float32"),-1))}}},cu={kernelName:je,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>{const t=cs(hi(n,"float32")),r=ps(za(Yi(1),t));return xs(qi(e,r))}}}},du={kernelName:Ae,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>{const t=ps(za(cs(hi(n,"float32")),1));return qi(e,t)}}}}
vendor: 9,596 bytes, line 2
2,hu={kernelName:Ce,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,r]=t,o=Pa(n.shape,r.shape);return{a:()=>{let t=e;const r=Ba(n.shape,o);return r.length>0&&(t=Ua(t,r)),Xi(t,n.shape)},b:()=>{let t=e;const n=Ba(r.shape,o);return n.length>0&&(t=Ua(t,n)),Xi(t,r.shape)}}}},fu={kernelName:Me,saveAllInputs:!0,gradFunc:(e,t)=>{const n={};return t.forEach((t,r)=>{n[r]=()=>e.clone()}),n}},gu={kernelName:De,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>oa(n)}}},mu={kernelName:Oe,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>oa(n)}}},yu={kernelName:Re,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>qi(e,ps(za(Yi(1),cs(hi(n,"float32")))))}}},bu={kernelName:Be,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>{const t=ps(Vi(Yi(1),cs(hi(n,"float32"))));return qi(e,t)}}}},$u={kernelName:We,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,r]=t,o=Pa(n.shape,r.shape);return{a:()=>{const t=Vi(cs(n),cs(r));let i=Ki(e,qi(r,t));const a=Ba(n.shape,o);return a.length>0&&(i=Ua(i,a)),Xi(i,n.shape)},b:()=>{const t=Vi(cs(n),cs(r));let i=xs(Ki(e,qi(n,t)));const a=Ba(r.shape,o);return a.length>0&&(i=Ua(i,a)),Xi(i,r.shape)}}}},_u={kernelName:Pe,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>qi(e,Vi(cs(hi(n,"float32")),1))}}},wu={kernelName:Le,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>qi(e,za(Yi(1),cs(hi(n,"float32"))))}}},xu=No({avgPool3dGrad_:function(e,t,n,r,o,i){const a=To(e,"dy","avgPool3dGrad"),s=To(t,"input","avgPool3dGrad");let l=a,u=s,p=!1;4===s.rank&&(p=!0,l=Xi(a,[1,a.shape[0],a.shape[1],a.shape[2],a.shape[3]]),u=Xi(s,[1,s.shape[0],s.shape[1],s.shape[2],s.shape[3]])),q(5===l.rank,()=>`Error in avgPool3dGrad: dy must be rank 5 but got rank ${l.rank}.`),q(5===u.rank,()=>`Error in avgPool3dGrad: input must be rank 5 but got rank ${u.rank}.`),null!=i&&q(Q(o),()=>`Error in avgPool3dGrad: pad must be an integer when using, dimRoundingMode ${i} but got pad ${o}.`);const c={dy:l,input:u},d={filterSize:n,strides:r,pad:o,dimRoundingMode:i},h=_o.runKernel(He,c,d);return p?Xi(h,[h.shape[1],h.shape[2],h.shape[3],h.shape[4]]):h}}),Su={kernelName:Ve,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[r]=t,{filterSize:o,strides:i,pad:a,dimRoundingMode:s}=n;return{x:()=>xu(e,r,o,i,a,s)}}},vu=No({avgPoolGrad_:function(e,t,n,r,o){const i=To(e,"dy","avgPoolGrad"),a=To(t,"input","avgPoolGrad");q(a.rank===i.rank,()=>`Rank of input (${a.rank}) does not match rank of dy (${i.rank})`);let s=a,l=i,u=!1;3===a.rank&&(u=!0,s=Xi(a,[1,a.shape[0],a.shape[1],a.shape[2]]),l=Xi(i,[1,i.shape[0],i.shape[1],i.shape[2]])),q(4===l.rank,()=>`Error in avgPoolGrad: dy must be rank 4 but got rank ${l.rank}.`),q(4===s.rank,()=>`Error in avgPoolGrad: input must be rank 4 but got rank ${s.rank}.`);const p={dy:l,input:s},c={filterSize:n,strides:r,pad:o},d=_o.runKernel(ze,p,c);return u?Xi(d,[d.shape[1],d.shape[2],d.shape[3]]):d}}),ku={kernelName:Ue,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[r]=t,{filterSize:o,strides:i,pad:a}=n;return{x:()=>vu(e,r,o,i,a)}}},Eu={kernelName:Ge,inputsToSave:["a","b"],gradFunc:(e,t,n)=>{const[r,o]=t,{transposeA:i,transposeB:a}=n;return i||a?!i&&a?{a:()=>ws(e,o,!1,!1),b:()=>ws(e,r,!0,!1)}:i&&!a?{a:()=>ws(o,e,!1,!0),b:()=>ws(r,e,!1,!1)}:{a:()=>ws(o,e,!0,!0),b:()=>ws(e,r,!0,!0)}:{a:()=>ws(e,o,!1,!0),b:()=>ws(r,e,!0,!1)}}},Iu=No({spaceToBatchND_:function(e,t,n){const r=To(e,"x","spaceToBatchND");q(r.rank>=1+t.length,()=>`input rank ${r.rank} should be > than [blockShape] ${t.length}`),q(n.length===t.length,()=>`paddings.shape[0] ${n.length} must be equal to [blockShape] ${t.length}`),q(r.shape.reduce((e,r,o)=>o>0&&o<=t.length?e&&(r+n[o-1][0]+n[o-1][1])%t[o-1]===0:e,!0),()=>`input spatial dimensions ${r.shape.slice(1)} with paddings ${n.toString()} must be divisible by blockShapes ${t.toString()}`);const o={x:r},i={blockShape:t,paddings:n};return _o.runKernel(Xn,o,i)}}),Tu={kernelName:qe,gradFunc:(e,t,n)=>{const{blockShape:r,crops:o}=n;return{x:()=>Iu(e,r,o)}}},Fu={kernelName:"BroadcastTo",gradFunc:(e,t,n)=>{const r=n,o=r.inputShape,i=r.shape,a=Array.from(i);for(let e=o.length-1;e>=0;e--)if(o[e]===i[e])a[e]=1;else if(1!==o[e])throw new Error(`broadcastTo(): [${o}] cannot be broadcast to [${i}].`);const s=[];for(let e=0;e<a.length;e++)a[e]>1&&s.push(e);return{x:()=>Ua(e,s,!0)}}},Nu={kernelName:Xe,gradFunc:e=>({x:()=>e.clone()})},ju={kernelName:Ye,gradFunc:e=>({x:()=>oa(e)})},Au={kernelName:Je,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[r]=t,{clipValueMin:o,clipValueMax:i}=n;return{x:()=>Ga(Ja(Ya(r,o),La(r,i)),e,oa(e))}}},Cu={kernelName:Qe,inputsToSave:["x"],gradFunc:pu.gradFunc},Mu={kernelName:et,saveAllInputs:!0,gradFunc:(e,t,n)=>{const r=t.map(e=>e.shape),{axis:o}=n,i=re(o,t[0].shape)[0],a=r.map(e=>e[i]);return Zi(e,a,i).map(e=>()=>e)}},Du=No({conv2DBackpropFilter_:function(e,t,n,r,o,i="NHWC",a){let s=e;3===e.rank&&(s=Xi(e,[1,e.shape[0],e.shape[1],e.shape[2]]));let l=t;3===l.rank&&(l=Xi(t,[1,t.shape[0],t.shape[1],t.shape[2]])),q(4===s.rank,()=>`Error in conv2dDerFilter: input must be rank 4, but got shape ${s.shape}.`),q(4===l.rank,()=>`Error in conv2dDerFilter: dy must be rank 4, but got shape ${l.shape}.`),q(4===n.length,()=>`Error in conv2dDerFilter: filterShape must be length 4, but got ${n}.`);const u="NHWC"===i?s.shape[3]:s.shape[1],p="NHWC"===i?l.shape[3]:l.shape[1];q(u===n[2],()=>`Error in conv2dDerFilter: depth of input ${u}) must match input depth in filter (${n[2]}.`),q(p===n[3],()=>`Error in conv2dDerFilter: depth of dy (${p}) must match output depth for filter (${n[3]}).`),null!=a&&q(Q(o),()=>`Error in conv2dDerFilter: pad must be an integer when using, dimRoundingMode ${a} but got pad ${o}.`);const c={x:s,dy:l},d={strides:r,pad:o,dataFormat:i,dimRoundingMode:a,filterShape:n};return _o.runKernel(nt,c,d)}}),Ou=No({conv2DBackpropInput_:function(e,t,n,r,o,i="NHWC",a){q(e.length===t.rank,()=>`Length of inShape (${e.length}) and rank of dy (${t.rank}) must match`);let s=e,l=t,u=!1;3===t.rank&&(u=!0,l=Xi(t,[1,t.shape[0],t.shape[1],t.shape[2]]),s=[1,e[0],e[1],e[2]]),q(4===s.length,()=>`Error in conv2dDerInput: inShape must be length 4, but got length ${s.length}.`),q(4===l.rank,()=>`Error in conv2dDerInput: dy must be rank 4, but got rank ${l.rank}`),q(4===n.rank,()=>`Error in conv2dDerInput: filter must be rank 4, but got rank ${n.rank}`);const p="NHWC"===i?s[3]:s[1],c="NHWC"===i?l.shape[3]:l.shape[1];q(p===n.shape[2],()=>`Error in conv2dDerInput: depth of input (${p}) must match input depth for filter ${n.shape[2]}.`),q(c===n.shape[3],()=>`Error in conv2dDerInput: depth of output (${c}) must match output depth for filter ${n.shape[3]}.`),null!=a&&q(Q(o),()=>`Error in conv2dDerInput: pad must be an integer when using, dimRoundingMode ${a} but got pad ${o}.`);const d={dy:l,filter:n},h={strides:r,pad:o,dataFormat:i,dimRoundingMode:a,inputShape:s},f=_o.runKernel(rt,d,h);return u?Xi(f,[f.shape[1],f.shape[2],f.shape[3]]):f}}),Ru={kernelName:tt,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{const[r,o]=t,{dilations:i,strides:a,pad:s,dataFormat:l}=n;return q(al(i),()=>`Error in gradient of conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${i}'`),{x:()=>Ou(r.shape,e,o,a,s,l),filter:()=>Du(r,e,o.shape,a,s,l)}}},Bu=No({conv2d_:function(e,t,n,r,o="NHWC",i=[1,1],a){const s=To(e,"x","conv2d"),l=To(t,"filter","conv2d");let u=s,p=!1;3===s.rank&&(p=!0,u=Xi(s,[1,s.shape[0],s.shape[1],s.shape[2]])),q(4===u.rank,()=>`Error in conv2d: input must be rank 4, but got rank ${u.rank}.`),q(4===l.rank,()=>`Error in conv2d: filter must be rank 4, but got rank ${l.rank}.`),null!=a&&q(Q(r),()=>`Error in conv2d: pad must be an integer when using, dimRoundingMode ${a} but got pad ${r}.`);const c="NHWC"===o?u.shape[3]:u.shape[1];q(c===l.shape[2],()=>`Error in conv2d: depth of input (${c}) must match input depth for filter ${l.shape[2]}.`),q(sl(n,i),()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${n} and dilations '${i}'`);const d={x:u,filter:l},h={strides:n,pad:r,dataFormat:o,dilations:i,dimRoundingMode:a},f=_o.runKernel(tt,d,h);return p?Xi(f,[f.shape[1],f.shape[2],f.shape[3]]):f}}),Pu={kernelName:rt,inputsToSave:["dy","filter"],gradFunc:(e,t,n)=>{const[r,o]=t,{strides:i,pad:a,dataFormat:s,dimRoundingMode:l}=n;return{dy:()=>Bu(e,o,i,a,s,1,l),filter:()=>Du(e,r,o.shape,i,a,s,l)}}},Lu=No({conv3DBackpropFilter_:function(e,t,n,r,o){let i=e;4===e.rank&&(i=Xi(e,[1,e.shape[0],e.shape[1],e.shape[2],e.shape[3]]));let a=t;4===a.rank&&(a=Xi(t,[1,t.shape[0],t.shape[1],t.shape[2],t.shape[3]])),q(5===i.rank,()=>`Error in conv3dDerFilter: input must be rank 5, but got shape ${i.shape}.`),q(5===a.rank,()=>`Error in conv3dDerFilter: dy must be rank 5, but got shape ${a.shape}.`),q(5===n.length,()=>`Error in conv3dDerFilter: filterShape must be length 5, but got ${n}.`),q(i.shape[4]===n[3],()=>`Error in conv3dDerFilter: depth of input ${i.shape[4]}) must match input depth in filter (${n[3]}.`),q(a.shape[4]===n[4],()=>`Error in conv3dDerFilter: depth of dy (${a.shape[4]}) must match output depth for filter (${n[4]}).`);const s={x:i,dy:a},l={strides:r,pad:o,filterShape:n};return _o.runKernel(it,s,l)}}),Wu=No({conv3DBackpropInput_:function(e,t,n,r,o){q(e.length===t.rank,()=>`Length of inShape (${e.length}) and rank of dy (${t.rank}) must match`);let i=e,a=t,s=!1;4===t.rank&&(s=!0,a=Xi(t,[1,t.shape[0],t.shape[1],t.shape[2],t.shape[3]]),i=[1,e[0],e[1],e[2],e[3]]);const l=i[4],u=a.shape[4];q(5===i.length,()=>`Error in conv3dDerInput: inShape must be length 5, but got length ${i.length}.`),q(5===a.rank,()=>`Error in conv3dDerInput: dy must be rank 5, but got rank ${a.rank}
2`),q(5===n.rank,()=>`Error in conv3dDerInput: filter must be rank 5, but got rank ${n.rank}`),q(l===n.shape[3],()=>`Error in conv3dDerInput: depth of input (${l}) must match input depth for filter ${n.shape[3]}.`),q(u===n.shape[4],()=>`Error in conv3dDerInput: depth of output (${u}) must match output depth for filter ${n.shape[4]}.`);const p={dy:a,filter:n},c={pad:o,strides:r,inputShape:i},d=_o.runKernel(at,p,c);return s?Xi(d,[d.shape[1],d.shape[2],d.shape[3],d.shape[4]]):d}}),Uu={kernelName:ot,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{const{dilations:r,strides:o,pad:i}=n;q(al(r),()=>`Error in gradient of conv3D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${r}'`);const[a,s]=t;return{x:()=>Wu(a.shape,e,s,o,i),filter:()=>Lu(a,e,s.shape,o,i)}}},zu=No({sin_:function(e){const t={x:To(e,"x","sin")};return _o.runKernel(Un,t)}}),Vu={kernelName:st,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Ki(xs(zu(hi(n,"float32"))),e)}}},Hu=No({sinh_:function(e){const t={x:To(e,"x","sinh")};return _o.runKernel(zn,t)}}),Gu={kernelName:lt,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Ki(Hu(hi(n,"float32")),e)}}},qu=No({cumsum_:function(e,t=0,n=!1,r=!1){const o={x:To(e,"x","cumsum")},i={axis:t,exclusive:n,reverse:r};return _o.runKernel(ut,o,i)}}),Ku={kernelName:ut,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[r]=t,{axis:o,exclusive:i,reverse:a}=n;return{x:()=>{const t=os([o],r.rank);let n=qu(e,o,i,!a);return null!=t&&(n=Ss(n,t)),n}}}},Xu=No({depthwiseConv2dNativeBackpropFilter_:function(e,t,n,r,o,i=[1,1],a){let s=e;3===e.rank&&(s=Xi(e,[1,e.shape[0],e.shape[1],e.shape[2]]));let l=t;3===l.rank&&(l=Xi(t,[1,t.shape[0],t.shape[1],t.shape[2]]));const u={x:s,dy:l},p={strides:r,pad:o,dimRoundingMode:a,dilations:i,filterShape:n};return _o.runKernel(ft,u,p)}}),Yu=No({depthwiseConv2dNativeBackpropInput_:function(e,t,n,r,o,i=[1,1],a){let s=t,l=!1;3===t.rank&&(l=!0,s=Xi(t,[1,t.shape[0],t.shape[1],t.shape[2]]));const u={dy:s,filter:n},p={strides:r,pad:o,dimRoundingMode:a,dilations:i,inputShape:e},c=_o.runKernel(gt,u,p);return l?Xi(c,[c.shape[1],c.shape[2],c.shape[3]]):c}}),Ju={kernelName:ht,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{const{dilations:r,strides:o,pad:i,dimRoundingMode:a}=n,s=null==r?[1,1]:r;q(al(s),()=>`Error in gradient of depthwiseConv2dNative: dilation rates greater than 1 are not yet supported. Got dilations '${s}'`);const[l,u]=t;return q(4===l.rank,()=>`Error in gradient of depthwiseConv2dNative: input must be rank 4, but got rank ${l.rank}.`),q(4===u.rank,()=>`Error in gradient of depthwiseConv2dNative: filter must be rank 4, but got rank ${u.rank}.`),q(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]}.`),q(sl(o,s),()=>`Error in gradient of depthwiseConv2d: Either strides or dilations must be  1. Got strides ${o} and dilations '${s}'.`),null!=a&&q(Q(i),()=>`Error in depthwiseConv2d: pad must be an integer when using, dimRoundingMode ${a} but got pad ${i}.`),{x:()=>Yu(l.shape,e,u,o,i,s,a),filter:()=>Xu(l,e,u.shape,o,i,s,a)}}},Zu={kernelName:mt,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{const[r,o]=t,i={x:r,filter:o,dy:e},a={x:r,filter:o,dy:e};return{x:()=>_o.runKernel("Dilation2DBackpropInput",i,n),filter:()=>_o.runKernel("Dilation2DBackpropFilter",a,n)}}},Qu={kernelName:$t,outputsToSave:[!0],gradFunc:(e,t)=>{const[n]=t,r={dy:e,y:n};return{x:()=>_o.runKernel(_t,r)}}},ep={kernelName:wt,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t,r=Ki(Ms(xs(cs(n))),2/Math.sqrt(Math.PI));return{x:()=>Ki(e,r)}}},tp={kernelName:St,outputsToSave:[!0],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Ki(e,n)}}},np={kernelName:vt,inputsToSave:["input"],gradFunc:(e,t)=>{const[n]=t;return{input:()=>Xi(e,n.shape)}}},rp={kernelName:kt,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Ki(e,Ms(n))}}},op={kernelName:Tt,gradFunc:e=>({x:()=>oa(e)})},ip={kernelName:Ft,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,r]=t,o=Pa(n.shape,r.shape);return{a:()=>{const t=qi(e,hi(r,"float32")),i=Ba(n.shape,o);return i.length>0?Xi(Ua(t,i),n.shape):t},b:()=>{let t=Ki(e,hi(n,"float32"));const i=Ba(r.shape,o);i.length>0&&(t=Xi(Ua(t,i),r.shape));const a=cs(r);return xs(qi(t,hi(a,"float32")))}}}},ap=No({rsqrt_:function(e){const t={x:To(e,"x","rsqrt")};return _o.runKernel(Rn,t)}}),sp={kernelName:Nt,inputsToSave:["x","mean","variance","scale"],gradFunc:(e,t,n)=>{const{varianceEpsilon:r}=n,[o,i,a,s]=t,l=null==s?Yi(1):s,u=Ba(i.shape,o.shape),p=[];if(1===i.rank){for(let e=0;e<o.shape.length-1;++e)p.push(o.shape[e]);p.push(1)}const c=za(o,i),d=Ki(e,l),h=ap(Vi(a,Yi(r))),f=Ki(Ki(Ki(h,h),h),Yi(-.5));return{x:()=>1===i.rank?Xi(Ki(Ki(e,ba(Xi(h,[1,1,1,i.shape[0]]),p)),l),o.shape):Xi(Ki(Ki(e,h),l),o.shape),mean:()=>{let e=Ki(Ki(h,Yi(-1)),d);return 1===i.rank&&(e=Ua(e,u)),Xi(e,i.shape)},variance:()=>{let e=Ki(Ki(f,c),d);return 1===i.rank&&(e=Ua(e,u)),Xi(e,i.shape)},scale:()=>{const t=Ki(c,h);let n=Ki(e,t);return 1===i.rank&&(n=Ua(n,u)),Xi(n,i.shape)},offset:()=>{let t=e;return 1===i.rank&&(t=Ua(t,u)),Xi(t,i.shape)}}}},lp=No({unsortedSegmentSum_:function(e,t,n){const r=To(e,"x","unsortedSegmentSum"),o=To(t,"segmentIds","unsortedSegmentSum","int32");q(Q(n),()=>"numSegments must be of dtype int");const i={x:r,segmentIds:o},a={numSegments:n};return _o.runKernel(br,i,a)}}),up={kernelName:jt,inputsToSave:["x","indices"],gradFunc:(e,t,n)=>{const[r,o]=t,{axis:i}=n,a=re(i,r.shape)[0];return{x:()=>{const t=r.shape,n=o.size,s=t.slice(0,a),l=s.length,u=t.slice(i,t.length).slice(1),p=u.length,c=pp(0,l),d=pp(l+1,l+1+p),h=cp([s,[n],u]),f=Xi(e,h),g=Xi(o,[n]),m=cp([[l],c,d]),y=Ss(f,m);let b=lp(y,g,r.shape[a]);const $=is(m);return b=Ss(b,$),b},indices:()=>o}}};function pp(e,t){const n=[];for(let r=e;r<t;++r)n.push(r);return n}function cp(e){const t=[];for(let n=0;n<e.length;++n)for(let r=0;r<e[n].length;++r)t.push(e[n][r]);return t}const dp={kernelName:Mt,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,r]=t;return{a:()=>oa(n),b:()=>oa(r)}}}
vendor: 9,384 bytes, line 2
2,hp={kernelName:Dt,gradFunc:e=>({x:()=>hi(e,"float32")})},fp={kernelName:Bt,gradFunc:e=>({x:()=>oa(e)})},gp={kernelName:Pt,gradFunc:e=>({x:()=>oa(e)})},mp={kernelName:Lt,gradFunc:e=>({x:()=>oa(e)})},yp={kernelName:Wt,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[r]=t,{alpha:o}=n,i=Wa(r,0);return{x:()=>Ga(i,e,Ki(e,o))}}},bp={kernelName:Gt,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>qi(e,Vi(n,1))}}},$p={kernelName:Ht,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>qi(e,hi(n,"float32"))}}},_p={kernelName:"LogSoftmax",inputsToSave:[],outputsToSave:[!0],gradFunc:(e,t,n)=>{const[r]=t,{axis:o}=n;return{logits:()=>{const t=Ms(r);return za(e,Ki(Ua(e,o,!0),t))}}}},wp=No({localResponseNormalizationBackprop_:function(e,t,n,r=5,o=1,i=1,a=.5){const s={x:e,y:t,dy:n},l={depthRadius:r,bias:o,alpha:i,beta:a};return _o.runKernel(Jt,s,l)}}),xp={kernelName:Yt,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{const[r,o]=t,{depthRadius:i,bias:a,alpha:s,beta:l}=n;return{x:()=>wp(r,o,e,i,a,s,l)}}},Sp=No({equal_:function(e,t){let n=To(e,"a","equal","string_or_numeric"),r=To(t,"b","equal","string_or_numeric");[n,r]=ho(n,r),Pa(n.shape,r.shape);const o={a:n,b:r};return _o.runKernel(xt,o)}});function vp(e,t,n,r){return t.rank<n.rank&&(t=Xi(t,ns(t.shape,r))),e.rank<n.rank&&(e=Xi(e,ns(e.shape,r))),{x:()=>Ki(e,hi(Sp(n,t),e.dtype))}}const kp={kernelName:Zt,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{const r=n,{reductionIndices:o}=r,i=t[0],a=vp(e,t[1],i,re(o,i.shape));return{x:()=>a.x()}}},Ep=No({less_:function(e,t){let n=To(e,"a","less","string_or_numeric"),r=To(t,"b","less","string_or_numeric");[n,r]=ho(n,r),Pa(n.shape,r.shape);const o={a:n,b:r};return _o.runKernel(Ut,o)}}),Ip={kernelName:Qt,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,r]=t;return{a:()=>Ki(e,hi(Ya(n,r),"float32")),b:()=>Ki(e,hi(Ep(n,r),"float32"))}}},Tp=No({maxPool3dGrad_:function(e,t,n,r,o,i,a){const s=To(e,"dy","maxPool3dGrad"),l=To(t,"input","maxPool3dGrad"),u=To(n,"output","maxPool3dGrad");let p=s,c=l,d=u,h=!1;4===l.rank&&(h=!0,p=Xi(s,[1,s.shape[0],s.shape[1],s.shape[2],s.shape[3]]),c=Xi(l,[1,l.shape[0],l.shape[1],l.shape[2],l.shape[3]]),d=Xi(u,[1,u.shape[0],u.shape[1],u.shape[2],u.shape[3]])),q(5===p.rank,()=>`Error in maxPool3dGrad: dy must be rank 5 but got rank ${p.rank}.`),q(5===c.rank,()=>`Error in maxPool3dGrad: input must be rank 5 but got rank ${c.rank}.`),q(5===d.rank,()=>`Error in maxPool3dGrad: output must be rank 5 but got rank ${d.rank}.`),null!=a&&q(Q(i),()=>`Error in maxPool3dGrad: pad must be an integer when using, dimRoundingMode ${a} but got pad ${i}.`);const f={dy:p,input:c,output:d},g={filterSize:r,strides:o,pad:i,dimRoundingMode:a},m=_o.runKernel(rn,f,g);return h?Xi(m,[m.shape[1],m.shape[2],m.shape[3],m.shape[4]]):m}}),Fp={kernelName:nn,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{const[r,o]=t,{filterSize:i,strides:a,pad:s,dimRoundingMode:l}=n;return{x:()=>Tp(e,r,o,i,a,s,l)}}},Np=No({maxPoolGrad_:function(e,t,n,r,o,i,a){const s=To(e,"dy","maxPoolGrad"),l=To(t,"input","maxPoolGrad"),u=To(n,"output","maxPoolGrad");q(l.rank===s.rank,()=>`Rank of input (${l.rank}) does not match rank of dy (${s.rank})`),q(4===s.rank,()=>`Error in maxPoolGrad: dy must be rank 4 but got rank ${s.rank}.`),q(4===l.rank,()=>`Error in maxPoolGrad: input must be rank 4 but got rank ${l.rank}.`),null!=a&&q(Q(i),()=>`Error in maxPoolGrad: pad must be an integer when using, dimRoundingMode ${a} but got pad ${i}.`);const p={dy:s,input:l,output:u},c={filterSize:r,strides:o,pad:i,dimRoundingMode:a};return _o.runKernel(tn,p,c)}}),jp={kernelName:en,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{const[r,o]=t,{filterSize:i,strides:a,pad:s}=n;return{x:()=>Np(e,r,o,i,a,s)}}},Ap={kernelName:an,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[r]=t,{axis:o}=n,i=re(o,r.shape),a=J(ts(r.shape,i)[1]);return{x:()=>{const t=r.shape.slice();i.forEach(e=>{t[e]=1});const n=Xi(e,t);return qi(Ki(n,Ts(r.shape,"float32")),a)}}}},Cp={kernelName:sn,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{const r=n,{axis:o}=r,[i,a]=t,s=vp(e,a,i,re(o,i.shape));return{x:()=>s.x()}}},Mp={kernelName:ln,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,r]=t;return{a:()=>Ki(e,hi(La(n,r),"float32")),b:()=>Ki(e,hi(Wa(n,r),"float32"))}}},Dp={kernelName:un,inputsToSave:["x"],gradFunc:(e,t,n)=>{const r=t[0],{paddings:o}=n,i=o.map(e=>e[0]);return{x:()=>Ji(e,i,r.shape)}}},Op=No({floor_:function(e){const t={x:To(e,"x","floor")};return _o.runKernel(Tt,t)}}),Rp={kernelName:pn,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,r]=t,o=Pa(n.shape,r.shape);return{a:()=>{const t=Ba(n.shape,o);return t.length>0?Xi(Ua(e,t),n.shape):e},b:()=>{const t=Ki(e,xs(Op(qi(n,r)))),i=Ba(r.shape,o);return i.length>0?Xi(Ua(t,i),r.shape):t}}}},Bp={kernelName:dn,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,r]=t,o=Pa(n.shape,r.shape);return{a:()=>{const t=Ki(e,hi(r,"float32")),i=Ba(n.shape,o);return i.length>0?Xi(Ua(t,i),n.shape):t},b:()=>{const t=Ki(e,hi(n,"float32")),i=Ba(r.shape,o);return i.length>0?Xi(Ua(t,i),r.shape):t}}}},Pp={kernelName:hn,gradFunc:e=>({x:()=>xs(e)})},Lp={kernelName:$n,inputsToSave:["indices"],gradFunc:(e,t)=>{const n=t[0];return{indices:()=>ta(n.shape,"float32")}}},Wp={kernelName:bn,gradFunc:e=>({x:()=>oa(e)})},Up={kernelName:_n,saveAllInputs:!0,gradFunc:(e,t,n)=>{const{axis:r}=n;return ea(e,r).map(e=>()=>e)}},zp={kernelName:wn,inputsToSave:["x"],gradFunc:(e,t,n)=>{const r=t[0],{paddings:o}=n,i=o.map(e=>e[0]);return{x:()=>Ji(e,i,r.shape)}}},Vp={kernelName:xn,inputsToSave:["a","b"],outputsToSave:[!0],gradFunc:(e,t)=>{const[n,r,o]=t,i=n,a=r,s=Pa(i.shape,a.shape);return{a:()=>{const t=hi(a,"float32");let n=Ki(e,Ki(t,us(i,za(t,Yi(1)))));const r=Ba(i.shape,s);return r.length>0&&(n=Ua(n,r)),Xi(n,i.shape)},b:()=>{const t=Wa(i,0),n=Ga(t,As(i),oa(i));let r=Ki(e,Ki(o,n));const l=Ba(a.shape,s);return l.length>0&&(r=Ua(r,l)),Xi(r,a.shape)}}}},Hp={kernelName:Sn,inputsToSave:["x","alpha"],gradFunc:(e,t)=>{const[n,r]=t,o=Wa(n,0);return{x:()=>Ga(o,e,Ki(e,r)),alpha:()=>{let t=Ga(o,oa(e),Ki(e,n));const i=Ba(r.shape,e.shape);return i.length>0&&(t=Ua(t,i)),Xi(t,r.shape)}}}},Gp={kernelName:yt,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,r]=t,o=Pa(n.shape,r.shape);return{a:()=>{const t=qi(e,hi(r,"float32")),i=Ba(n.shape,o);return i.length>0?Xi(Ua(t,i),n.shape):t},b:()=>{let t=Ki(e,hi(n,"float32"));const i=Ba(r.shape,o);i.length>0&&(t=Xi(Ua(t,i),r.shape));const a=cs(r);return xs(qi(t,hi(a,"float32")))}}}},qp={kernelName:In,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>qi(e,xs(cs(n)))}}},Kp={kernelName:Mn,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t,r=Ki(La(n,6),fl(n));return{x:()=>Ki(e,hi(r,"float32"))}}},Xp={kernelName:Tn,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Ki(e,hi(fl(n),"float32"))}}},Yp={kernelName:Fn,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Xi(e,n.shape)}}},Jp={kernelName:An,inputsToSave:["images"],gradFunc:(e,t,n)=>{const[r]=t,o={dy:e,images:r};return{images:()=>_o.runKernel(Cn,o,n)}}},Zp={kernelName:Nn,inputsToSave:["images"],gradFunc:(e,t,n)=>{const[r]=t,o={dy:e,images:r};return{images:()=>_o.runKernel(jn,o,n)}}},Qp={kernelName:Dn,gradFunc:(e,t,n)=>{const{dims:r}=n,o=re(r,e.shape);return{x:()=>la(e,o)}}},ec={kernelName:On,gradFunc:e=>({x:()=>oa(e)})},tc={kernelName:Rn,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>xs(qi(e,Ki(us(n,1.5),2)))}}},nc=No({logicalNot_:function(e){const t={x:To(e,"x","logicalNot","bool")};return _o.runKernel(Kt,t)}}),rc={kernelName:Pn,inputsToSave:["condition"],gradFunc:(e,t)=>{const[n]=t;return{condition:()=>hi(oa(n),"float32"),t:()=>Ki(e,hi(n,e.dtype)),e:()=>Ki(e,hi(nc(n),e.dtype))}}},oc={kernelName:Ln,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>{const t=Wa(n,Yi(0)),r=Yi(jl),o=Yi(Al),i=Ki(e,o),a=Ki(Ki(e,r),Ms(hi(n,"float32")));return Ga(t,i,a)}}}},ic={kernelName:Hn,outputsToSave:[!0],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Ki(e,Ki(n,za(Yi(1),n)))}}},ac={kernelName:Vn,gradFunc:e=>({x:()=>oa(e)})},sc=No({cos_:function(e){const t={x:To(e,"x","cos")};return _o.runKernel(st,t)}}),lc={kernelName:Un,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Ki(sc(hi(n,"float32")),e)}}},uc=No({cosh_:function(e){const t={x:To(e,"x","cosh")};return _o.runKernel(lt,t)}}),pc={kernelName:zn,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Ki(uc(hi(n,"float32")),e)}}},cc=No({pad_:function(e,t,n=0){const r=To(e,"x","pad");if(0===r.rank)throw new Error("pad(scalar) is not defined. Pass non-scalar to pad");const o={paddings:t,constantValue:n},i={x:r};return _o.runKernel(wn,i,o)}}),dc={kernelName:Wn,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[r]=t,{begin:o,size:i}=n,a=r.shape,[s,l]=Ui(r,o,i),u=[];for(let t=0;t<e.rank;t++)u.push([s[t],a[t]-s[t]-l[t]]);return{x:()=>cc(e,u)}}},hc={kernelName:Jn,outputsToSave:[!0],gradFunc:(e,t,n)=>{const[r]=t,{dim:o}=n,i=Ki(e,r);return{logits:()=>za(i,Ki(Ua(i,[o],!0),r))}}},fc={kernelName:Gn,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Ki(e,hl(n))}}},gc=No({batchToSpaceND_:function(e,t,n){const r=To(e,"x","batchToSpaceND"),o=t.reduce((e,t)=>e*t);q(r.rank>=1+t.length,()=>`input rank is ${r.rank} but should be > than blockShape.length ${t.length}`),q(n.length===t.length,()=>`crops.length is ${n.length} but should be equal to blockShape.length  ${t.length}`),q(r.shape[0]%o===0,()=>`input tensor batch is ${r.shape[0]}
2 but is not divisible by the product of the elements of blockShape ${t.join(" * ")} === ${o}`);const i={x:r},a={blockShape:t,crops:n};return _o.runKernel(qe,i,a)}}),mc={kernelName:Xn,gradFunc:(e,t,n)=>{const{blockShape:r,paddings:o}=n;return{x:()=>gc(e,r,o)}}},yc={kernelName:Yn,gradFunc:(e,t,n)=>{const{axis:r}=n;return{x:()=>Hi(e,r)}}},bc={kernelName:qn,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>qi(e,Ki(ps(hi(n,"float32")),2))}}},$c={kernelName:or,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Ki(e,Ki(hi(n,"float32"),2))}}},_c={kernelName:rr,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,r]=t,o=Yi(2);return{a:()=>Ki(e,Ki(o,za(n,r))),b:()=>Ki(e,Ki(o,za(r,n)))}}},wc={kernelName:_r,gradFunc:e=>({x:()=>oa(e)})},xc={kernelName:ur,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,r]=t,o=Pa(n.shape,r.shape);return{a:()=>{let t=e;const r=Ba(n.shape,o);return r.length>0&&(t=Ua(t,r)),Xi(t,n.shape)},b:()=>{let t=e;const n=Ba(r.shape,o);return n.length>0&&(t=Ua(t,n)),Xi(xs(t),r.shape)}}}},Sc={kernelName:Kn,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[r]=t,o=r.shape.slice(),{axis:i}=n;re(i,r.shape).forEach(e=>{o[e]=1});const a=Xi(e,o),s=Ki(a,Ts(r.shape,"float32"));return{x:()=>s}}},vc={kernelName:pr,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>qi(e,cs(sc(n)))}}},kc={kernelName:cr,outputsToSave:[!0],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Ki(za(Yi(1),cs(n)),e)}}},Ec={kernelName:dr,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[r]=t,{reps:o}=n;return{x:()=>
vendor: 24,572 bytes, line 2
2{let t=oa(r);if(1===r.rank)for(let n=0;n<o[0];++n)t=Vi(t,Ji(e,[n*r.shape[0]],[r.shape[0]]));else if(2===r.rank)for(let n=0;n<o[0];++n)for(let i=0;i<o[1];++i)t=Vi(t,Ji(e,[n*r.shape[0],i*r.shape[1]],[r.shape[0],r.shape[1]]));else if(3===r.rank)for(let n=0;n<o[0];++n)for(let i=0;i<o[1];++i)for(let a=0;a<o[2];++a)t=Vi(t,Ji(e,[n*r.shape[0],i*r.shape[1],a*r.shape[2]],[r.shape[0],r.shape[1],r.shape[2]]));else{if(4!==r.rank)throw new Error(`Gradient for tile operation is not implemented for rank-${r.rank} tensors yet.`);for(let n=0;n<o[0];++n)for(let i=0;i<o[1];++i)for(let a=0;a<o[2];++a)for(let s=0;s<o[3];++s)t=Vi(t,Ji(e,[n*r.shape[0],i*r.shape[1],a*r.shape[2],s*r.shape[3]],[r.shape[0],r.shape[1],r.shape[2],r.shape[3]]))}return t}}}},Ic={kernelName:gr,gradFunc:(e,t,n)=>{const r=n,{perm:o}=r,i=is(o);return{x:()=>Ss(e,i)}}},Tc={kernelName:yr,gradFunc:(e,t,n)=>{const r=n,{axis:o}=r;return{value:()=>Qi(e,o)}}},Fc=No({gather_:function(e,t,n=0,r=0){const o={x:To(e,"x","gather"),indices:To(t,"indices","gather","int32")},i={axis:n,batchDims:r};return _o.runKernel(jt,o,i)}}),Nc=No({maximum_:function(e,t){let n=To(e,"a","maximum"),r=To(t,"b","maximum");[n,r]=ho(n,r),"bool"===n.dtype&&(n=hi(n,"int32"),r=hi(r,"int32")),Pa(n.shape,r.shape);const o={a:n,b:r};return _o.runKernel(Qt,o)}}),jc=[pu,cu,du,hu,fu,gu,mu,yu,bu,$u,_u,wu,Su,ku,Eu,Tu,Fu,Nu,ju,Au,Cu,Mu,Pu,Ru,Uu,Vu,Gu,Ku,Ju,Zu,Gp,Qu,ep,tp,np,rp,ip,op,sp,up,dp,hp,fp,gp,mp,yp,bp,$p,_p,xp,kp,kp,Ip,Fp,jp,Ap,Cp,Mp,Dp,Rp,Bp,Pp,Lp,Wp,Up,zp,zp,Vp,Hp,qp,Kp,Xp,Yp,Jp,Zp,Qp,ec,tc,rc,oc,ic,ac,lc,pc,dc,hc,fc,mc,mc,yc,yc,bc,_c,$c,wc,xc,Sc,vc,kc,Ec,Ic,Tc,{kernelName:br,inputsToSave:["segmentIds"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>function(e,t){const n=Nc(t,oa(t)),r=Fc(e,n);let o=Ya(t,Yi(0,"int32"));const i=r.rank-o.rank;for(let e=0;e<i;++e)o=$s(o,e+1);o=Ja(o,Ts(r.shape,"bool"));const a=oa(r);return Ga(o,r,a)}(e,n)}}},{kernelName:$r,gradFunc:e=>({x:()=>oa(e)})}];for(const e of jc)Ar(e);no().prototype.abs=function(){return this.throwIfDisposed(),Za(this)};const Ac=No({acos_:function(e){const t={x:To(e,"x","acos")};return _o.runKernel(je,t)}});no().prototype.acos=function(){return this.throwIfDisposed(),Ac(this)};const Cc=No({acosh_:function(e){const t={x:To(e,"x","acosh")};return _o.runKernel(Ae,t)}});no().prototype.acosh=function(){return this.throwIfDisposed(),Cc(this)},no().prototype.add=function(e){return this.throwIfDisposed(),Vi(this,e)};const Mc=No({all_:function(e,t=null,n=!1){const r={x:To(e,"x","all","bool")},o={axis:t,keepDims:n};return _o.runKernel("All",r,o)}});no().prototype.all=function(e,t){return this.throwIfDisposed(),Mc(this,e,t)};const Dc=No({any_:function(e,t=null,n=!1){const r={x:To(e,"x","any","bool")},o={axis:t,keepDims:n};return _o.runKernel("Any",r,o)}});no().prototype.any=function(e,t){return this.throwIfDisposed(),Dc(this,e,t)};const Oc=No({argMax_:function(e,t=0){const n={x:To(e,"x","argMax")},r={axis:t};return _o.runKernel(De,n,r)}});no().prototype.argMax=function(e){return this.throwIfDisposed(),Oc(this,e)};const Rc=No({argMin_:function(e,t=0){const n={x:To(e,"x","argMin")},r={axis:t};return _o.runKernel(Oe,n,r)}});no().prototype.argMin=function(e){return this.throwIfDisposed(),Rc(this,e)},no().prototype.asScalar=function(){return this.throwIfDisposed(),q(1===this.size,()=>"The array must have only 1 element."),Xi(this,[])},no().prototype.asType=function(e){return this.throwIfDisposed(),hi(this,e)},no().prototype.as1D=function(){return this.throwIfDisposed(),Xi(this,[this.size])},no().prototype.as2D=function(e,t){return this.throwIfDisposed(),Xi(this,[e,t])},no().prototype.as3D=function(e,t,n){return this.throwIfDisposed(),Xi(this,[e,t,n])},no().prototype.as4D=function(e,t,n,r){return this.throwIfDisposed(),Xi(this,[e,t,n,r])},no().prototype.as5D=function(e,t,n,r,o){return this.throwIfDisposed(),Xi(this,[e,t,n,r,o])};const Bc=No({asin_:function(e){const t={x:To(e,"x","asin")};return _o.runKernel(Re,t)}});no().prototype.asin=function(){return this.throwIfDisposed(),Bc(this)};const Pc=No({asinh_:function(e){const t={x:To(e,"x","asinh")};return _o.runKernel(Be,t)}});no().prototype.asinh=function(){return this.throwIfDisposed(),Pc(this)};const Lc=No({atan_:function(e){const t={x:To(e,"x","atan")};return _o.runKernel(Pe,t)}});no().prototype.atan=function(){return this.throwIfDisposed(),Lc(this)};const Wc=No({atan2_:function(e,t){let n=To(e,"a","atan2"),r=To(t,"b","atan2");[n,r]=ho(n,r);const o={a:n,b:r};return _o.runKernel(We,o)}});no().prototype.atan2=function(e){return this.throwIfDisposed(),Wc(this,e)};const Uc=No({atanh_:function(e){const t={x:To(e,"x","atanh")};return _o.runKernel(Le,t)}});no().prototype.atanh=function(){return this.throwIfDisposed(),Uc(this)};const zc=No({avgPool_:function(e,t,n,r,o){const i=To(e,"x","avgPool","float32");q(sl(n,1),()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${n} and dilations '1'`);let a=i,s=!1;3===i.rank&&(s=!0,a=Xi(i,[1,i.shape[0],i.shape[1],i.shape[2]])),q(4===a.rank,()=>`Error in avgPool: x must be rank 4 but got rank ${a.rank}.`),null!=o&&q(Q(r),()=>`Error in avgPool: pad must be an integer when using, dimRoundingMode ${o} but got pad ${r}.`);const l={x:a},u={filterSize:t,strides:n,pad:r,dimRoundingMode:o};let p=_o.runKernel(Ue,l,u);return p=hi(p,i.dtype),s?Xi(p,[p.shape[1],p.shape[2],p.shape[3]]):p}});no().prototype.avgPool=function(e,t,n,r){return this.throwIfDisposed(),zc(this,e,t,n,r)},no().prototype.batchToSpaceND=function(e,t){return this.throwIfDisposed(),gc(this,e,t)};const Vc=No({batchNorm_:function(e,t,n,r,o,i){null==i&&(i=.001);const a=To(e,"x","batchNorm"),s=To(t,"mean","batchNorm"),l=To(n,"variance","batchNorm");let u,p;null!=o&&(u=To(o,"scale","batchNorm")),null!=r&&(p=To(r,"offset","batchNorm")),q(s.rank===l.rank,()=>"Batch normalization gradient requires mean and variance to have equal ranks."),q(null==p||s.rank===p.rank,()=>"Batch normalization gradient requires mean and offset to have equal ranks."),q(null==u||s.rank===u.rank,()=>"Batch normalization gradient requires mean and scale to have equal ranks.");const c={x:function(e){let t;return t=0===e.rank||1===e.rank?Xi(e,[1,1,1,e.size]):2===e.rank?Xi(e,[1,1,e.shape[0],e.shape[1]]):3===e.rank?Xi(e,[1,e.shape[0],e.shape[1],e.shape[2]]):e,t}(a),scale:u,offset:p,mean:s,variance:l},d={varianceEpsilon:i},h=_o.runKernel(Nt,c,d);return Xi(h,a.shape)}});no().prototype.batchNorm=function(e,t,n,r,o){return this.throwIfDisposed(),Vc(this,e,t,n,r,o)},no().prototype.broadcastTo=function(e){return this.throwIfDisposed(),Ha(this,e)},no().prototype.cast=function(e){return this.throwIfDisposed(),hi(this,e)};const Hc=No({ceil_:function(e){const t={x:To(e,"x","ceil")};return _o.runKernel(Ye,t)}});no().prototype.ceil=function(){return this.throwIfDisposed(),Hc(this)};const Gc=No({clipByValue_:function(e,t,n){const r=To(e,"x","clipByValue");q(t<=n,()=>`Error in clip: min (${t}) must be less than or equal to max (${n}).`);const o={x:r},i={clipValueMin:t,clipValueMax:n};return _o.runKernel(Je,o,i)}});no().prototype.clipByValue=function(e,t){return this.throwIfDisposed(),Gc(this,e,t)},no().prototype.concat=function(e,t){return this.throwIfDisposed(),e instanceof to&&(e=[e]),Hi([this,...e],t)};const qc=No({conv1d_:function(e,t,n,r,o="NWC",i=1,a){const s=To(e,"x","conv1d"),l=To(t,"filter","conv1d");let u=s,p=!1;2===s.rank&&(p=!0,u=Xi(s,[1,s.shape[0],s.shape[1]])),q(3===u.rank,()=>`Error in conv1d: input must be rank 3, but got rank ${u.rank}.`),q(3===l.rank,()=>`Error in conv1d: filter must be rank 3, but got rank ${l.rank}.`),null!=a&&q(Q(r),()=>`Error in conv1d: pad must be an integer when using, dimRoundingMode ${a} but got pad ${r}.`),q(u.shape[2]===l.shape[1],()=>`Error in conv1d: depth of input (${u.shape[2]}) must match input depth for filter ${l.shape[1]}.`),q(sl(n,i),()=>`Error in conv1D: Either stride or dilation must be 1. Got stride ${n} and dilation '${i}'`),q("NWC"===o,()=>`Error in conv1d: got dataFormat of ${o} but only NWC is currently supported.`);const c=Xi(l,[1,l.shape[0],l.shape[1],l.shape[2]]),d=Xi(u,[u.shape[0],1,u.shape[1],u.shape[2]]),h=Bu(d,c,[1,n],r,"NHWC",[1,i],a);return Xi(h,p?[h.shape[2],h.shape[3]]:[h.shape[0],h.shape[2],h.shape[3]])}});no().prototype.conv1d=function(e,t,n,r,o,i){return this.throwIfDisposed(),qc(this,e,t,n,r,o,i)};const Kc=No({conv2dTranspose_:function(e,t,n,r,o,i){const a=To(e,"x","conv2dTranspose"),s=To(t,"filter","conv2dTranspose");return Ou(n,a,s,r,o,"NHWC",i)}});no().prototype.conv2dTranspose=function(e,t,n,r,o){return this.throwIfDisposed(),Kc(this,e,t,n,r,o)},no().prototype.conv2d=function(e,t,n,r,o,i){return this.throwIfDisposed(),Bu(this,e,t,n,r,o,i)},no().prototype.cos=function(){return this.throwIfDisposed(),sc(this)},no().prototype.cosh=function(){return this.throwIfDisposed(),uc(this)},no().prototype.cumsum=function(e,t,n){return this.throwIfDisposed(),qu(this,e,t,n)};const Xc=No({depthToSpace_:function(e,t,n="NHWC"){const r=To(e,"x","depthToSpace"),o="NHWC"===n?r.shape[1]:r.shape[2],i="NHWC"===n?r.shape[2]:r.shape[3],a="NHWC"===n?r.shape[3]:r.shape[1];q(o*t>=0,()=>`Negative dimension size caused by overflow when multiplying\n    ${o} and ${t}  for depthToSpace with input shape\n    ${r.shape}`),q(i*t>=0,()=>`Negative dimension size caused by overflow when multiplying\n    ${i} and ${t} for depthToSpace with input shape\n        ${r.shape}`),q(a%(t*t)===0,()=>`Dimension size must be evenly divisible by ${t*t} but is ${a} for depthToSpace with input shape ${r.shape}`);const s={x:r},l={blockSize:t,dataFormat:n};return _o.runKernel(dt,s,l)}});no().prototype.depthToSpace=function(e,t){return this.throwIfDisposed(),Xc(this,e,t)};const Yc=No({depthwiseConv2d_:function(e,t,n,r,o="NHWC",i=[1,1],a){const s=To(e,"x","depthwiseConv2d"),l=To(t,"filter","depthwiseConv2d");let u=s,p=!1;3===s.rank&&(p=!0,u=Xi(s,[1,s.shape[0],s.shape[1],s.shape[2]])),q(4===u.rank,()=>`Error in depthwiseConv2d: input must be rank 4, but got rank ${u.rank}.`),q(4===l.rank,()=>`Error in depthwiseConv2d: filter must be rank 4, but got rank ${l.rank}.`),q(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]}.`),null!=a&&q(Q(r),()=>`Error in depthwiseConv2d: pad must be an integer when using, dimRoundingMode ${a} but got pad ${r}.`);const c={x:u,filter:l},d={strides:n,pad:r,dataFormat:o,dilations:i,dimRoundingMode:a},h=_o.runKernel(ht,c,d);return p?Xi(h,[h.shape[1],h.shape[2],h.shape[3]]):h}});no().prototype.depthwiseConv2d=function(e,t,n,r,o,i){return this.throwIfDisposed(),Yc(this,e,t,n,r,o,i)};const Jc=No({dilation2d_:function(e,t,n,r,o=[1,1],i="NHWC"){const a=To(e,"x","dilation2d"),s=To(t,"filter","dilation2d");q(3===a.rank||4===a.rank,()=>`Error in dilation2d: input must be rank 3 or 4, but got rank ${a.rank}.`),q(3===s.rank,()=>`Error in dilation2d: filter must be rank 3, but got rank ${s.rank}.`),q("NHWC"===i,()=>`Error in dilation2d: Only NHWC is currently supported, but got dataFormat of ${i}`);let l=a,u=!1;3===a.rank&&(l=Xi(a,[1,a.shape[0],a.shape[1],a.shape[2]]),u=!0);const p={x:l,filter:s},c={strides:n,pad:r,dilations:o},d=_o.runKernel(mt,p,c);return u?Xi(d,[d.shape[1],d.shape[2],d.shape[3]]):d}});no().prototype.dilation2d=function(e,t,n,r,o){return this.throwIfDisposed(),Jc(this,e,t,n,r,o)};const Zc=No({divNoNan_:function(e,t){let n=To(e,"a","div"),r=To(t,"b","div");[n,r]=ho(n,r);const o=qi(n,r),i=oa(o),a=Sp(r,i);return Ga(a,i,o)}});no().prototype.divNoNan=function(e){return this.throwIfDisposed(),Zc(this,e)},no().prototype.div=function(e){return this.throwIfDisposed(),qi(this,e)};const Qc=No({dot_:function(e,t){const n=To(e,"t1","dot"),r=To(t,"t2","dot");q(!(1!==n.rank&&2!==n.rank||1!==r.rank&&2!==r.rank),()=>`Error in dot: inputs must all be rank 1 or 2, but got ranks ${n.rank} and ${r.rank}.`);const o=1===n.rank?n.size:n.shape[1],i=1===r.rank?r.size:r.shape[0];if(q(o===i,()=>`Error in dot: inner dimensions of inputs must match, but got ${o} and ${i}.`),1===n.rank&&1===r.rank){const e=Xi(n,[1,-1]),t=Xi(r,[-1,1]),o=ws(e,t);return Xi(o,[])}if(1===n.rank&&2===r.rank){const e=Xi(n,[1,-1]),t=Xi(r,[r.shape[0],r.shape[1]]),o=ws(e,t);return Xi(o,[o.size])}if(2===n.rank&&1===r.rank){const e=Xi(r,[-1,1]),t=ws(n,e);return Xi(t,[t.size])}{const e=Xi(r,[r.shape[0],r.shape[1]]);return ws(n,e)}}});no().prototype.dot=function(e){return this.throwIfDisposed(),Qc(this,e)},no().prototype.elu=function(){return this.throwIfDisposed(),ul(this)},no().prototype.equal=function(e){return this.throwIfDisposed(),Sp(this,e)};const ed=No({erf_:function(e){let t=To(e,"x","erf");q("int32"===t.dtype||"float32"===t.dtype,()=>"Input dtype must be `int32` or `float32`."),"int32"===t.dtype&&(t=hi(t,"float32"));const n={x:t};return _o.runKernel(wt,n)}});no().prototype.erf=function(){return this.throwIfDisposed(),ed(this)},no().prototype.exp=function(){return this.throwIfDisposed(),Ms(this)},no().prototype.expandDims=function(e){return this.throwIfDisposed(),$s(this,e)};const td=No({expm1_:function(e){const t={x:To(e,"x","expm1")};return _o.runKernel(kt,t)}});no().prototype.expm1=function(){return this.throwIfDisposed(),td(this)},no().prototype.fft=function(){return this.throwIfDisposed(),ia(this)},no().prototype.flatten=function(){return this.throwIfDisposed(),Xi(this,[this.size])},no().prototype.floor=function(){return this.throwIfDisposed(),Op(this)},no().prototype.floorDiv=function(e){return this.throwIfDisposed(),Gi(this,e)},no().prototype.gather=function(e,t){return this.throwIfDisposed(),Fc(this,e,t)},no().prototype.greaterEqual=function(e){return this.throwIfDisposed(),Ya(this,e)},no().prototype.greater=function(e){return this.throwIfDisposed(),Wa(this,e)},no().prototype.ifft=function(){return this.throwIfDisposed(),sa(this)},no().prototype.irfft=function(){return this.throwIfDisposed(),ua(this)};const nd=No({isFinite_:function(e){const t={x:To(e,"x","isFinite")};return _o.runKernel(Bt,t)}});no().prototype.isFinite=function(){return this.throwIfDisposed(),nd(this)};const rd=No({isInf_:function(e){const t={x:To(e,"x","isInf")};return _o.runKernel(Pt,t)}});no().prototype.isInf=function(){return this.throwIfDisposed(),rd(this)};const od=No({isNaN_:function(e){const t={x:To(e,"x","isNaN")};return _o.runKernel(Lt,t)}});no().prototype.isNaN=function(){return this.throwIfDisposed(),od(this)},no().prototype.leakyRelu=function(e){return this.throwIfDisposed(),pl(this,e)},no().prototype.lessEqual=function(e){return this.throwIfDisposed(),La(this,e)},no().prototype.less=function(e){return this.throwIfDisposed(),Ep(this,e)};const id=No({localResponseNormalization_:function(e,t=5,n=1,r=1,o=.5){const i=To(e,"x","localResponseNormalization");q(4===i.rank||3===i.rank,()=>`Error in localResponseNormalization: x must be rank 3 or 4 but got\n               rank ${i.rank}.`),q(Q(t),()=>`Error in localResponseNormalization: depthRadius must be an integer but got depthRadius ${t}.`);let a=i,s=!1;3===i.rank&&(s=!0,a=Xi(i,[1,i.shape[0],i.shape[1],i.shape[2]]));const l={x:a},u={depthRadius:t,bias:n,alpha:r,beta:o},p=_o.runKernel(Yt,l,u);return s?Xi(p,[p.shape[1],p.shape[2],p.shape[3]]):p}});no().prototype.localResponseNormalization=function(e,t,n,r){return this.throwIfDisposed(),id(this,e,t,n,r)};const ad=No({softplus_:function(e){const t={x:To(e,"x","softplus")};return _o.runKernel(Gn,t)}}),sd=No({logSigmoid_:function(e){const t=To(e,"x","logSigmoid");return Os(e=>({value:xs(ad(xs(e))),gradFunc:t=>Ki(t,hl(xs(e)))}))(t)}});no().prototype.logSigmoid=function(){return this.throwIfDisposed(),sd(this)};const ld=No({logSoftmax_:function(e,t=-1){const n=To(e,"logits","logSoftmax");if(-1===t&&(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}`);const r=Os((e,n)=>{const r=ss(e,t,!0),o=za(e,r),i=za(hi(o,"float32"),As(Ua(Ms(o),t,!0)));return n([i]),{value:i,gradFunc:(e,n)=>{const[r]=n,o=Ms(r);return za(e,Ki(Ua(e,t,!0),o))}}});return r(n)}});no().prototype.logSoftmax=function(e){return this.throwIfDisposed(),ld(this,e)},no().prototype.logSumExp=function(e,t){return this.throwIfDisposed(),Rs(this,e,t)},no().prototype.log=function(){return this.throwIfDisposed(),As(this)},no().prototype.log1p=function(){return this.throwIfDisposed(),Ds(this)},no().prototype.logicalAnd=function(e){return this.throwIfDisposed(),Ja(this,e)},no().prototype.logicalNot=function(){return this.throwIfDisposed(),nc(this)};const ud=No({logicalOr_:function(e,t){const n=To(e,"a","logicalOr","bool"),r=To(t,"b","logicalOr","bool");Pa(n.shape,r.shape);const o={a:n,b:r};return _o.runKernel(Xt,o)}});no().prototype.logicalOr=function(e){return this.throwIfDisposed(),ud(this,e)};const pd=No({logicalXor_:function(e,t){const n=To(e,"a","logicalXor","bool"),r=To(t,"b","logicalXor","bool");return Pa(n.shape,r.shape),Ja(ud(e,t),nc(Ja(e,t)))}});no().prototype.logicalXor=function(e){return this.throwIfDisposed(),pd(this,e)},no().prototype.matMul=function(e,t,n){return this.throwIfDisposed(),ws(this,e,t,n)};const cd=No({maxPool_:function(e,t,n,r,o){const i=To(e,"x","maxPool");let a=i,s=!1;3===i.rank&&(s=!0,a=Xi(i,[1,i.shape[0],i.shape[1],i.shape[2]])),q(4===a.rank,()=>`Error in maxPool: input must be rank 4 but got rank ${a.rank}.`),q(sl(n,1),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${n} and dilations '1'`),null!=o&&q(Q(r),()=>`Error in maxPool: pad must be an integer when using, dimRoundingMode ${o} but got pad ${r}.`);const l={x:a},u={filterSize:t,strides:n,pad:r,dimRoundingMode:o},p=_o.runKernel(en,l,u);return s?Xi(p,[p.shape[1],p.shape[2],p.shape[3]]):p}});no().prototype.maxPool=function(e,t,n,r){return this.throwIfDisposed(),cd(this,e,t,n,r)},no().prototype.max=function(e,t){return this.throwIfDisposed(),ss(this,e,t)},no().prototype.maximum=function(e){return this.throwIfDisposed(),Nc(this,e)},no().prototype.mean=function(e,t){return this.throwIfDisposed(),Es(this,e,t)},no().prototype.min=function(e,t){return this.throwIfDisposed(),ls(this,e,t)},no().prototype.minimum=function(e){return this.throwIfDisposed(),js(this,e)};const dd=No({mirrorPad_:function(e,t,n){q("reflect"===n||"symmetric"===n,()=>`Invalid mode. Mode must be either reflect or symmetric. Got ${n}.`);const r=To(e,"x","mirrorPad");if(0===r.rank)throw new Error("mirrorPad(scalar) is not defined. Pass non-scalar to mirrorPad");q(t.length===r.rank,()=>`Padding doesn't match input. Must be ${r.rank}. Got ${t.length}.`);const o="reflect"===n?1:0;for(let e=0;e<r.rank;e++)q(2===t[e].length,()=>"Invalid number of paddings. Must be length of 2 each."),q(t[e][0]>=0&&t[e][0]<=r.shape[e]-o&&t[e][1]>=0&&t[e][1]<=r.shape[e]-o,()=>`Padding in dimension ${e} cannot be greater than or equal to ${r.shape[e]-o} or less than 0 for input of shape ${r.shape}`);const i={paddings:t,mode:n},a={x:r};return _o.runKernel(un,a,i)}});no().prototype.mirrorPad=function(e,t){return this.throwIfDisposed(),dd(this,e,t)};const hd=No({mod_:function(e,t){let n=To(e,"a","mod"),r=To(t,"b","mod");[n,r]=ho(n,r);const o={a:n,b:r};return _o.runKernel(pn,o)}});no().prototype.mod=function(e){return this.throwIfDisposed(),hd(this,e)},no().prototype.mul=function(e){return this.throwIfDisposed(),Ki(this,e)},no().prototype.neg=function(){return this.throwIfDisposed(),xs(this)},no().prototype.norm=function(e,t,n){return this.throwIfDisposed(),hs(this,e,t,n)},no().prototype.notEqual=function(e){return this.throwIfDisposed(),Is(this,e)};const fd=No({oneHot_:function(e,t,n=1,r=0){if(t<2)throw new Error(`Error in oneHot: depth must be >=2, but it is ${t}`);const o={indices:To(e,"indices","oneHot","int32")},i={depth:t,onValue:n,offValue:r};return _o.runKernel($n,o,i)}});no().prototype.oneHot=function(e,t=1,n=0){return this.throwIfDisposed(),fd(this,e,t,n)};const gd=No({onesLike_:function(e){const t={x:To(e,"x","onesLike")};return _o.runKernel(bn,t)}});no().prototype.onesLike=function(){return this.throwIfDisposed(),gd(this)},no().prototype.pad=function(e,t){return this.throwIfDisposed(),cc(this,e,t)};const md=No({pool_:function(e,t,n,r,o,i){null==o&&(o=[1,1]),null==i&&(i=1),0===r&&(r="valid");const a=To(e,"x","maxPool");let s=a,l=!1;3===a.rank&&(l=!0,s=Xi(a,[1,a.shape[0],a.shape[1],a.shape[2]])),q(sl(i,o),()=>`Error in pool: Either strides or dilations must be 1. Got strides ${i} and dilations '${o}'`);const u=Js(s.shape,t,i,o,r),p=[u.dilationHeight,u.dilationWidth];let c;c="same"===r?function(e,t){const n=e.map((e,n)=>e+(e-1)*(t[n]-1)).map(e=>e-1),r=n.map(e=>Math.floor(e/2)),o=n.map((e,t)=>e-r[t]);return n.map((e,t)=>[r[t],o[t]])}([u.filterHeight,u.filterWidth],p):[[0,0],[0,0]];const d=1===p[0]&&1===p[1],[h,f]=function(e,t,n){const r=n.map(e=>e[0]),o=n.map(e=>e[1]),i=e.concat(r,o),a=t.map((e,t)=>(e-i[t]%e)%e),s=o.map((e,t)=>e+a[t]);return[t.map((e,t)=>[r[t],s[t]]),t.map((e,t)=>[0,a[t]])]}([u.inHeight,u.inWidth],p,c),g=d?r:"valid",m=d?s:Iu(s,p,h),y=("avg"===n?()=>zc(m,t,i,g):()=>cd(m,t,i,g))(),b=d?y:gc(y,p,f);return l?Xi(b,[b.shape[1],b.shape[2],b.shape[3]]):b}});no().prototype.pool=function(e,t,n,r,o){return this.throwIfDisposed(),md(this,e,t,n,r,o)},no().prototype.pow=function(e){return this.throwIfDisposed(),us(this,e)},no().prototype.prelu=function(e){return this.throwIfDisposed(),cl(this,e)};const yd=No({prod_:function(e,t=null,n=!1){let r=To(e,"x","prod");"bool"===r.dtype&&(r=hi(r,"int32"));const o={x:r},i={axis:t,keepDims:n};return _o.runKernel(vn,o,i)}});no().prototype.prod=function(e,t){return this.throwIfDisposed(),yd(this,e,t)};const bd=No({reciprocal_:function(e){const t={x:To(e,"x","reciprocal")};return _o.runKernel(In,t)}});no().prototype.reciprocal=function(){return this.throwIfDisposed(),bd(this)},no().prototype.relu=function(){return this.throwIfDisposed(),Ns(this)},no().prototype.relu6=function(){return this.throwIfDisposed(),dl(this)},no().prototype.reshapeAs=function(e){return this.throwIfDisposed(),Xi(this,e.shape)},no().prototype.reshape=function(e){return this.throwIfDisposed(),Xi(this,e)},no().prototype.resizeBilinear=function(e,t,n){return this.throwIfDisposed(),Ma(this,e,t,n)},no().prototype.resizeNearestNeighbor=function(e,t,n){return this.throwIfDisposed(),Da(this,e,t,n)},no().prototype.reverse=function(e){return this.throwIfDisposed(),la(this,e)},no().prototype.rfft=function(){return this.throwIfDisposed(),aa(this)},no().prototype.round=function(){return this.throwIfDisposed(),Va(this)},no().prototype.rsqrt=function(){return this.throwIfDisposed(),ap(this)};const $d=No({selu_:function(e){const t={x:To(e,"x","selu")};return _o.runKernel(Ln,t)}});no().prototype.selu=function(){return this.throwIfDisposed(),$d(this)};const _d=No({separableConv2d_:function(e,t,n,r,o,i=[1,1],a="NHWC"){const s=To(e,"x","separableConv2d"),l=To(t,"depthwiseFilter","separableConv2d"),u=To(n,"pointwiseFilter","separableConv2d");let p=s,c=!1;if(3===s.rank&&(c=!0,p=Xi(s,[1,s.shape[0],s.shape[1],s.shape[2]])),"NCHW"===a)throw new Error("separableConv2d currently does not support dataFormat NCHW; only NHWC is supported");q(4===p.rank,()=>`Error in separableConv2d: input must be rank 4, but got rank ${p.rank}.`),q(4===l.rank,()=>`Error in separableConv2d: depthwise filter must be rank 4, but got rank ${l.rank}.`),q(4===u.rank,()=>`Error in separableConv2d: pointwise filter must be rank 4, but got rank ${l.rank}.`),q(1===u.shape[0],()=>`Error in separableConv2d: the first dimension of pointwise filter  must be 1, but got ${u.shape[0]}.`),q(1===u.shape[1],()=>`Error in separableConv2d: the second dimension of pointwise filter must be 1, but got ${u.shape[1]}.`);const d=l.shape[2],h=l.shape[3];q(u.shape[2]===d*h,()=>`Error in separableConv2d: the third dimension of pointwise filter must be ${d*h}, but got ${u.shape[2]}.`);const f=Yc(p,l,r,o,a,i),g=Bu(f,u,1,"valid",a);return c?Xi(g,[g.shape[1],g.shape[2],g.shape[3]]):g}});no().prototype.separableConv2d=function(e,t,n,r,o,i){return this.throwIfDisposed(),_d(this,e,t,n,r,o,i)},no().prototype.sigmoid=function(){return this.throwIfDisposed(),hl(this)};const wd=No({sign_:function(e){const t={x:To(e,"x","sign")};return _o.runKernel(Vn,t)}});no().prototype.sign=function(){return this.throwIfDisposed(),wd(this)},no().prototype.sin=function(){return this.throwIfDisposed(),zu(this)},no().prototype.sinh=function(){return this.throwIfDisposed(),Hu(this)},no().prototype.slice=function(e,t){return this.throwIfDisposed(),Ji(this,e,t)};const xd=No({softmax_:function(e,t=-1){const n=To(e,"logits","softmax","float32");if(-1===t&&(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}
2 and dim was ${t}`);const r={logits:n},o={dim:t};return _o.runKernel(Jn,r,o)}});no().prototype.softmax=function(e){return this.throwIfDisposed(),xd(this,e)},no().prototype.softplus=function(){return this.throwIfDisposed(),ad(this)},no().prototype.spaceToBatchND=function(e,t){return this.throwIfDisposed(),Iu(this,e,t)},no().prototype.split=function(e,t){return this.throwIfDisposed(),Zi(this,e,t)},no().prototype.sqrt=function(){return this.throwIfDisposed(),ps(this)},no().prototype.square=function(){return this.throwIfDisposed(),cs(this)},no().prototype.squaredDifference=function(e){return this.throwIfDisposed(),Cs(this,e)},no().prototype.squeeze=function(e){return this.throwIfDisposed(),fs(this,e)},no().prototype.stack=function(e,t){this.throwIfDisposed();const n=e instanceof to?[this,e]:[this,...e];return Qi(n,t)},no().prototype.step=function(e){return this.throwIfDisposed(),fl(this,e)};const Sd=No({stridedSlice_:function(e,t,n,r,o=0,i=0,a=0,s=0,l=0){const u={x:To(e,"x","stridedSlice","string_or_numeric")},p={begin:t,end:n,strides:r,beginMask:o,endMask:i,ellipsisMask:a,newAxisMask:s,shrinkAxisMask:l};return _o.runKernel(ir,u,p)}});no().prototype.stridedSlice=function(e,t,n,r,o,i,a,s){return this.throwIfDisposed(),Sd(this,e,t,n,r,o,i,a,s)},no().prototype.sub=function(e){return this.throwIfDisposed(),za(this,e)},no().prototype.sum=function(e,t){return this.throwIfDisposed(),Ua(this,e,t)};const vd=No({tan_:function(e){const t={x:To(e,"x","tan")};return _o.runKernel(pr,t)}});no().prototype.tan=function(){return this.throwIfDisposed(),vd(this)};const kd=No({tanh_:function(e){const t={x:To(e,"x","tanh")};return _o.runKernel(cr,t)}});no().prototype.tanh=function(){return this.throwIfDisposed(),kd(this)},no().prototype.tile=function(e){return this.throwIfDisposed(),ba(this,e)},no().prototype.toBool=function(){return this.throwIfDisposed(),hi(this,"bool")},no().prototype.toFloat=function(){return this.throwIfDisposed(),hi(this,"float32")},no().prototype.toInt=function(){return this.throwIfDisposed(),hi(this,"int32")};const Ed=No({topk_:function(e,t=1,n=!0){const r=To(e,"x","topk");
2if(0===r.rank)throw new Error("topk() expects the input to be of rank 1 or higher");const o=r.shape[r.shape.length-1];if(t<0)throw new Error(`'k' passed to topk() must be >= 0 but got ${t}`);if(t>o)throw new Error(`'k' passed to topk() must be <= the last dimension (${o}) but got ${t}`);const i={x:r},a={k:t,sorted:n},[s,l]=_o.runKernel(hr,i,a);return{values:s,indices:l}}});no().prototype.topk=function(e,t){return this.throwIfDisposed(),Ed(this,e,t)},no().prototype.transpose=function(e){return this.throwIfDisposed(),Ss(this,e)};const Id=No({unique_:function(e,t=0){const n=To(e,"x","unique","string_or_numeric");q(n.rank>0,()=>"The input tensor must be at least 1D");const r={x:n},o={axis:t},[i,a]=_o.runKernel(mr,r,o);return{values:i,indices:a}}});no().prototype.unique=function(e){return this.throwIfDisposed(),Id(this,e)},no().prototype.unsortedSegmentSum=function(e,t){return this.throwIfDisposed(),lp(this,e,t)},no().prototype.unstack=function(e){return this.throwIfDisposed(),ea(this,e)},no().prototype.where=function(e,t){return this.throwIfDisposed(),Ga(e,this,t)},no().prototype.zerosLike=function(){return this.throwIfDisposed(),oa(this)};class Td{constructor(e,t){this.backend=e,this.dataMover=t,this.data=new WeakMap,this.dataIdsCount=0}get(e){return this.data.has(e)||this.dataMover.moveData(this.backend,e),this.data.get(e)}set(e,t){this.dataIdsCount++,this.data.set(e,t)}has(e){return this.data.has(e)}delete(e){return this.dataIdsCount--,this.data.delete(e)}numDataIds(){return this.dataIdsCount}}class Fd{refCount(e){return Nd("refCount")}incRef(e){return Nd("incRef")}timerAvailable(){return!0}time(e){return Nd("time")}read(e){return Nd("read")}readSync(e){return Nd("readSync")}numDataIds(){return Nd("numDataIds")}disposeData(e,t){return Nd("disposeData")}write(e,t,n){return Nd("write")}move(e,t,n,r,o){return Nd("move")}memory(){return Nd("memory")}floatPrecision(){return Nd("floatPrecision")}epsilon(){return 32===this.floatPrecision()?1e-7:1e-4}dispose(){return Nd("dispose")}}function Nd(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 jd(e){let t=e.length,n=0;for(;t>0;)n=Math.random()*t|0,t--,Cd(e,t,n)}function Ad(e,t,n){return Math.max(e,Math.min(t,n))}function Cd(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Md(e,t){if(!e)throw new Error("string"==typeof t?t:t())}function Dd(e,t,n=""){Md(Pd(e,t),()=>n+` Shapes ${e} and ${t} must match`)}function Od(e){Md(null!=e,()=>"The input to the tensor constructor must be a non-null value.")}function Rd(e,t=[],n=!1){if(null==t&&(t=[]),Array.isArray(e)||Gd(e)&&!n)for(let r=0;r<e.length;++r)Rd(e[r],t,n);else t.push(e);return t}function Bd(e){if(0===e.length)return 1;let t=e[0];for(let n=1;n<e.length;n++)t*=e[n];return t}function Pd(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Ld(e){return e%1==0}function Wd(e,t){return t<=e.length?e:e+" ".repeat(t-e.length)}function Ud(e,t){let n=1,r=-1;for(let t=0;t<e.length;++t)if(e[t]>=0)n*=e[t];else if(-1===e[t]){if(-1!==r)throw Error(`Shapes can only have 1 implicit size. Found -1 at dim ${r} and dim ${t}`);r=t}else if(e[t]<0)throw Error(`Shapes can not be < 0. Found ${e[t]} at dim ${t}`);if(-1===r){if(t>0&&t!==n)throw Error(`Size(${t}) must match the product of shape ${e}`);return e}if(0===n)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}`);const o=e.slice();return o[r]=t/n,o}function zd(e,t){const n=t.length;return Md((e=null==e?t.map((e,t)=>t):[].concat(e)).every(e=>e>=-n&&e<n),()=>`All values in axis param must be in range [-${n}, ${n}) but got axis ${e}`),Md(e.every(e=>Ld(e)),()=>`All values in axis param must be integers but got axis ${e}`),e.map(e=>e<0?n+e:e)}function Vd(e,t){let n=null;if(null==e||"float32"===e)n=new Float32Array(t);else if("int32"===e)n=new Int32Array(t);else{if("bool"!==e)throw new Error(`Unknown data type ${e}`);n=new Uint8Array(t)}return n}function Hd(e,t){let n=null;if(null==e||"float32"===e)n=new Float32Array(t);else if("int32"===e)n=new Int32Array(t);else if("bool"===e)n=new Uint8Array(t);else{if("string"!==e)throw new Error(`Unknown data type ${e}`);n=new Array(t)}return n}function Gd(e){return e instanceof Float32Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray}function qd(e){if("float32"===e||"int32"===e)return 4;if("complex64"===e)return 8;if("bool"===e)return 1;throw new Error(`Unknown dtype ${e}`)}function Kd(e){return"string"==typeof e||e instanceof String}function Xd(e){return"number"==typeof e}function Yd(e){return Array.isArray(e)?Yd(e[0]):e instanceof Float32Array?"float32":e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray?"int32":Xd(e)?"float32":Kd(e)?"string":"boolean"==typeof e?"bool":"float32"}function Jd(e){return!!(e&&e.constructor&&e.call&&e.apply)}function Zd(e){const t=e.length;if(t<2)return[];const n=new Array(t-1);n[t-2]=e[t-1];for(let r=t-3;r>=0;--r)n[r]=n[r+1]*e[r+1];return n}function Qd(e,t,n,r=!1){const o=new Array;
vendor: 4,076 bytes, line 2
2if(1===t.length){const i=t[0]*(r?2:1);for(let t=0;t<i;t++)o[t]=n[e+t]}else{const i=t[0],a=t.slice(1),s=a.reduce((e,t)=>e*t)*(r?2:1);for(let t=0;t<i;t++)o[t]=Qd(e+t*s,a,n,r)}return o}function eh(e,t,n=!1){if(0===e.length)return t[0];const r=e.reduce((e,t)=>e*t)*(n?2:1);if(0===r)return[];if(r!==t.length)throw new Error(`[${e}] does not match the input size ${t.length}${n?" for a complex tensor":""}.`);return Qd(0,e,t,n)}function th(e,t){const n=nh(e,t);for(let e=0;e<n.length;e++)n[e]=1;return n}function nh(e,t){if(null==t||"float32"===t||"complex64"===t)return new Float32Array(e);if("int32"===t)return new Int32Array(e);if("bool"===t)return new Uint8Array(e);throw new Error(`Unknown data type ${t}`)}function rh(e,t){const n=e.reduce((e,t)=>e*t,1);if(null==t||"float32"===t)return eh(e,new Float32Array(n));if("int32"===t)return eh(e,new Int32Array(n));if("bool"===t)return eh(e,new Uint8Array(n));throw new Error(`Unknown data type ${t}`)}function oh(e){e.forEach(t=>{Md(Number.isInteger(t)&&t>=0,()=>`Tensor must have a shape comprised of positive integers but got shape [${e}].`)})}function ih(e,t,n){if(0===t)return 0;if(1===t)return e[0];let r=e[e.length-1];for(let t=0;t<e.length-1;++t)r+=n[t]*e[t];return r}function ah(e,t,n){if(0===t)return[];if(1===t)return[e];const r=new Array(t);for(let t=0;t<r.length-1;++t)r[t]=Math.floor(e/n[t]),e-=r[t]*n[t];return r[r.length-1]=e,r}function sh(e){return e&&e.then&&"function"==typeof e.then}function lh(...e){dh().getBool("IS_TEST")||dh().getBool("PROD")||console.warn(...e)}const uh="tfjsflags";class ph{constructor(e){this.global=e,this.flags={},this.flagRegistry={},this.urlFlags={},this.getQueryParams=ch,this.populateURLFlags()}setPlatform(e,t){null!=this.platform&&lh(`Platform ${this.platformName} has already been set. Overwriting the platform with ${t}.`),this.platformName=e,this.platform=t}registerFlag(e,t,n){if(this.flagRegistry[e]={evaluationFn:t,setHook:n},null!=this.urlFlags[e]){const t=this.urlFlags[e];lh(`Setting feature override from URL ${e}: ${t}.`),this.set(e,t)}}async getAsync(e){return e in this.flags||(this.flags[e]=await this.evaluateFlag(e)),this.flags[e]}get(e){if(e in this.flags)return this.flags[e];const t=this.evaluateFlag(e);if(sh(t))throw new Error(`Flag ${e} cannot be synchronously evaluated. Please use getAsync() instead.`);return this.flags[e]=t,this.flags[e]}getNumber(e){return this.get(e)}getBool(e){return this.get(e)}getFlags(){return this.flags}get features(){return this.flags}set(e,t){if(null==this.flagRegistry[e])throw new Error(`Cannot set flag ${e} as it has not been registered.`);this.flags[e]=t,null!=this.flagRegistry[e].setHook&&this.flagRegistry[e].setHook(t)}evaluateFlag(e){if(null==this.flagRegistry[e])throw new Error(`Cannot evaluate flag '${e}': no evaluation function found.`);return this.flagRegistry[e].evaluationFn()}setFlags(e){this.flags=Object.assign({},e)}reset(){this.flags={},this.urlFlags={},this.populateURLFlags()}populateURLFlags(){if(void 0===this.global||void 0===this.global.location||void 0===this.global.location.search)return;const e=this.getQueryParams(this.global.location.search);uh in e&&e[uh].split(",").forEach(e=>{const[t,n]=e.split(":");this.urlFlags[t]=function(e,t){if("true"===(t=t.toLowerCase())||"false"===t)return"true"===t;if(""+ +t===t)return+t;throw new Error(`Could not parse value flag value ${t} for flag ${e}.`)}(t,n)})}}function ch(e){const t={};return e.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g,(e,...n)=>(function(e,t,n){e[decodeURIComponent(t)]=decodeURIComponent(n||"")}(t,n[0],n[1]),n.join("="))),t}function dh(){return fh}let hh,fh=null;function gh(){if(null==hh){let e;if("undefined"!=typeof window)e=window;else if(void 0!==__webpack_require__.g)e=__webpack_require__.g;else if("undefined"!=typeof process)e=process;else{if("undefined"==typeof self)throw new Error("Could not find a global object");e=self}hh=e}return hh}function mh(e,t){const n=function(){const e=gh();return null==e._tfGlobals&&(e._tfGlobals=new Map),e._tfGlobals}();if(n.has(e))return n.get(e);{const r=t();return n.set(e,r),n.get(e)}}
vendor: 5,625 bytes, line 2
2const yh="Abs",bh="Acos",$h="Acosh",_h="Add",wh="AddN",xh="All",Sh="Any",vh="ArgMax",kh="ArgMin",Eh="Asin",Ih="Asinh",Th="Atan",Fh="Atanh",Nh="Atan2",jh="AvgPool",Ah="AvgPoolGrad",Ch="AvgPool3D",Mh="AvgPool3DGrad",Dh="BatchMatMul",Oh="BatchToSpaceND",Rh="Bincount",Bh="BroadcastArgs",Ph="Cast",Lh="Ceil",Wh="ClipByValue",Uh="Complex",zh="ComplexAbs",Vh="Concat",Hh="Conv2D",Gh="Conv2DBackpropFilter",qh="Conv2DBackpropInput",Kh="Conv3D",Xh="Conv3DBackpropFilterV2",Yh="Conv3DBackpropInputV2",Jh="Cos",Zh="Cosh",Qh="Cumsum",ef="CropAndResize",tf="DenseBincount",nf="DepthToSpace",rf="DepthwiseConv2dNative",of="DepthwiseConv2dNativeBackpropFilter",af="DepthwiseConv2dNativeBackpropInput",sf="Dilation2D",lf="Dilation2DBackpropInput",uf="Dilation2DBackpropFilter",pf="RealDiv",cf="Einsum",df="Elu",hf="EluGrad",ff="Erf",gf="Equal",mf="Exp",yf="ExpandDims",bf="Expm1",$f="Fill",_f="FlipLeftRight",wf="Floor",xf="FloorDiv",Sf="FusedBatchNorm",vf="GatherV2",kf="GatherNd",Ef="Greater",If="GreaterEqual",Tf="Identity",Ff="IFFT",Nf="Imag",jf="IsFinite",Af="IsInf",Cf="IsNan",Mf="LeakyRelu",Df="Less",Of="LessEqual",Rf="LinSpace",Bf="Log",Pf="Log1p",Lf="LogicalAnd",Wf="LogicalNot",Uf="LogicalOr",zf="LRN",Vf="LRNGrad",Hf="Max",Gf="Maximum",qf="MaxPool",Kf="MaxPoolGrad",Xf="MaxPool3D",Yf="MaxPool3DGrad",Jf="MaxPoolWithArgmax",Zf="Mean",Qf="Min",eg="Minimum",tg="MirrorPad",ng="Mod",rg="Multinomial",og="Multiply",ig="Neg",ag="NotEqual",sg="NonMaxSuppressionV3",lg="NonMaxSuppressionV4",ug="NonMaxSuppressionV5",pg="OnesLike",cg="OneHot",dg="Pack",hg="PadV2",fg="Pow",gg="Prelu",mg="Prod",yg="Range",bg="Real",$g="Reciprocal",_g="Relu",wg="Reshape",xg="ResizeNearestNeighbor",Sg="ResizeNearestNeighborGrad",vg="ResizeBilinear",kg="ResizeBilinearGrad",Eg="Relu6",Ig="Reverse",Tg="Round",Fg="Rsqrt",Ng="ScatterNd",jg="Select",Ag="Selu",Cg="Slice",Mg="Sin",Dg="Sinh",Og="Sign",Rg="Sigmoid",Bg="Softplus",Pg="Sqrt",Lg="Sum",Wg="SpaceToBatchND",Ug="SplitV",zg="Softmax",Vg="SparseFillEmptyRows",Hg="SparseReshape",Gg="SparseSegmentMean",qg="SparseSegmentSum",Kg="SparseToDense",Xg="SquaredDifference",Yg="Square",Jg="StridedSlice",Zg="StringNGrams",Qg="StringSplit",em="StringToHashBucketFast",tm="Sub",nm="Tan",rm="Tanh",om="Tile",im="TopK",am="Transform",sm="Transpose",lm="Unique",um="Unpack",pm="UnsortedSegmentSum",cm="ZerosLike",dm="Step",hm="FromPixels",fm="RotateWithOffset",gm="_FusedMatMul",mm="FusedConv2D",ym="FusedDepthwiseConv2D",bm=mh("kernelRegistry",()=>new Map),$m=mh("gradRegistry",()=>new Map);function _m(e,t){const n=km(e,t);return bm.get(n)}function wm(e){return $m.get(e)}function xm(e){const t=bm.entries(),n=[];for(;;){const{done:r,value:o}=t.next();if(r)break;const[i,a]=o,[s]=i.split("_");s===e&&n.push(a)}return n}function Sm(e){const{kernelName:t,backendName:n}=e,r=km(t,n);bm.has(r)&&lh(`The kernel '${t}' for backend '${n}' is already registered`),bm.set(r,e)}function vm(e){const{kernelName:t}=e;$m.has(t)&&dh().getBool("DEBUG")&&lh(`Overriding the gradient for '${t}'`),$m.set(t,e)}function km(e,t){return`${t}_${e}`}const Em=Dr()||Mr;function Im(e){return Em.fromString(e,!0,16)}const Tm=Im("c3a5c85c97cb3127"),Fm=Im("b492b66fbe98f273"),Nm=Im("9ae16a3b2f90404f");function jm(e){return e.xor(e.shru(47))}function Am(e,t,n){const r=e.slice(t,t+n);return Em.fromBytes(Array.from(r),!0,!0)}function Cm(e,t){return Am(e,t,8)}function Mm(e,t){return Am(e,t,4)}function Dm(e,t){return 0===t?e:e.shru(t).or(e.shl(64-t))}function Om(e,t,n=Im("9ddfea08eb382d69")){let r=e.xor(t).mul(n);r=r.xor(r.shru(47));let o=t.xor(r).mul(n);return o=o.xor(o.shru(47)),o=o.mul(n),o}function Rm(e,t,n,r){return function(e,t,n,r,o,i){o=o.add(e),i=Dm(i.add(o).add(r),21);const a=o;return o=(o=o.add(t)).add(n),i=i.add(Dm(o,44)),[o.add(r),i.add(a)]}(Cm(e,t),Cm(e,t+8),Cm(e,t+16),Cm(e,t+24),n,r)}function Bm(e,t=e.length){const n=Em.fromNumber(81,!0);if(t<=32)return t<=16?function(e,t=e.length){if(t>=8){const n=Nm.add(2*t),r=Cm(e,0).add(Nm),o=Cm(e,t-8);return Om(Dm(o,37).mul(n).add(r),Dm(r,25).add(o).mul(n),n)}if(t>=4){const n=Nm.add(2*t);return Om(Mm(e,0).shl(3).add(t),Mm(e,t-4),n)}if(t>0){const n=e[0]+(e[t>>1]<<8),r=t+(e[t-1]<<2);return jm(Nm.mul(n).xor(Tm.mul(r))).mul(Nm)}return Nm}(e,t):function(e,t=e.length){const n=Nm.add(2*t),r=Cm(e,0).mul(Fm),o=Cm(e,8),i=Cm(e,t-8).mul(n),a=Cm(e,t-16).mul(Nm);return Om(Dm(r.add(o),43).add(Dm(i,30)).add(a),r.add(Dm(o.add(Nm),18)).add(i),n)}(e,t);if(t<=64)return function(e,t=e.length){const n=Nm.add(2*t),r=Cm(e,0).mul(Nm),o=Cm(e,8),i=Cm(e,t-8).mul(n),a=Cm(e,t-16).mul(Nm),s=Dm(r.add(o),43).add(Dm(i,30)).add(a),l=Om(s,r.add(Dm(o.add(Nm),18)).add(i),n),u=Cm(e,16).mul(n),p=Cm(e,24),c=s.add(Cm(e,t-32)).mul(n),d=l.add(Cm(e,t-24)).mul(n);return Om(Dm(u.add(p),43).add(Dm(c,30)).add(d),u.add(Dm(p.add(r),18)).add(c),n)}(e,t);let r=n,o=n.mul(Fm).add(113),i=jm(o.mul(Nm).add(113)).mul(Nm),a=[Em.UZERO,Em.UZERO],s=[Em.UZERO,Em.UZERO];r=r.mul(Nm).add(Cm(e,0));let l=0;const u=64*(t-1>>6),p=u+(t-1&63)-63;do{r=Dm(r.add(o).add(a[0]).add(Cm(e,l+8)),37).mul(Fm),o=Dm(o.add(a[1]).add(Cm(e,l+48)),42).mul(Fm),r=r.xor(s[1]),o=o.add(a[0]).add(Cm(e,l+40)),i=Dm(i.add(s[0]),33).mul(Fm),a=Rm(e,l,a[1].mul(Fm),r.add(s[0])),s=Rm(e,l+32,i.add(s[1]),o.add(Cm(e,l+16))),[i,r]=[r,i],l+=64}while(l!==u);const c=Fm.add(i.and(255).shl(1));return l=p,s[0]=s[0].add(t-1&63),a[0]=a[0].add(s[0]),s[0]=s[0].add(a[0]),r=Dm(r.add(o).add(a[0]).add(Cm(e,l+8)),37).mul(c),o=Dm(o.add(a[1]).add(Cm(e,l+48)),42).mul(c),r=r.xor(s[1].mul(9)),o=o.add(a[0].mul(9).add(Cm(e,l+40))),i=Dm(i.add(s[0]),33).mul(c),a=Rm(e,l,a[1].mul(c),r.add(s[0])),s=Rm(e,l+32,i.add(s[1]),o.add(Cm(e,l+16))),[i,r]=[r,i],Om(Om(a[0],s[0],c).add(jm(o
vendor: 6,270 bytes, line 2
2).mul(Tm)).add(i),Om(a[1],s[1],c).add(r),c)}function Pm(e,t){return"string"===t?Um(e):Lm([e],t)}function Lm(e,t){if("string"===t)throw new Error("Cannot convert a string[] to a TypedArray");if(Array.isArray(e)&&(e=Rd(e)),dh().getBool("DEBUG")&&function(e,t){for(let n=0;n<e.length;n++){const r=e[n];if(isNaN(r)||!isFinite(r))throw Error(`A tensor of type ${t} being uploaded contains ${r}.`)}}(e,t),function(e,t){return e instanceof Float32Array&&"float32"===t||e instanceof Int32Array&&"int32"===t||e instanceof Uint8Array&&"bool"===t}(e,t))return e;if(null==t||"float32"===t||"complex64"===t)return new Float32Array(e);if("int32"===t)return new Int32Array(e);if("bool"===t){const t=new Uint8Array(e.length);for(let n=0;n<t.length;++n)0!==Math.round(e[n])&&(t[n]=1);return t}throw new Error(`Unknown data type ${t}`)}function Wm(){return dh().platform.now()}function Um(e,t="utf-8"){return t=t||"utf-8",dh().platform.encode(e,t)}function zm(e,t="utf-8"){return t=t||"utf-8",dh().platform.decode(e,t)}class Vm{constructor(e,t){this.backendTimer=e,this.logger=t,null==t&&(this.logger=new Gm)}profileKernel(e,t,n){let r;const o=()=>{r=n()};let i;const a=Wm();if(this.backendTimer.timerAvailable())i=this.backendTimer.time(o);else{o();for(const e of r)e.dataSync();i=Promise.resolve({kernelMs:Wm()-a})}if(dh().getBool("CHECK_COMPUTATION_FOR_ERRORS"))for(let t=0;t<r.length;t++){const n=r[t];n.data().then(t=>{Hm(t,n.dtype,e)})}return{kernelName:e,outputs:r,inputs:t,timeMs:i.then(e=>e.kernelMs),extraInfo:i.then(e=>null!=e.getExtraProfileInfo?e.getExtraProfileInfo():"")}}logKernelProfile(e){const{kernelName:t,outputs:n,timeMs:r,inputs:o,extraInfo:i}=e;n.forEach(e=>{Promise.all([e.data(),r,i]).then(n=>{this.logger.logKernelProfile(t,e,n[0],n[1],o,n[2])})})}}function Hm(e,t,n){if("float32"!==t)return!1;for(let t=0;t<e.length;t++){const r=e[t];if(isNaN(r)||!isFinite(r))return console.warn(`Found ${r} in the result of '${n}'`),!0}return!1}class Gm{logKernelProfile(e,t,n,r,o,i){const a="number"==typeof r?Wd(`${r}ms`,9):r.error,s=Wd(e,25),l=t.rank,u=t.size,p=Wd(t.shape.toString(),14);let c="";for(const e in o){const n=o[e];if(null!=n){const r=n.shape||t.shape,o=r.length;c+=`${e}: ${o}D ${o>0?r:""} `}}console.log(`%c${s}\t%c${a}\t%c${l}D ${p}\t%c${u}\t%c${c}\t%c${i}`,"font-weight:bold","color:red","color:blue","color: orange","color: green","color: steelblue")}}function qm(e,t,n,r){const o=Zd(t),i=function(e,t,n,r){const o=Bd(t),i=r[r.length-1],a=new Array(i).fill(0),s=t.length,l="complex64"===n?Jm(e):e;if(s>1)for(let e=0;e<o/i;e++){const t=e*i;for(let e=0;e<i;e++)a[e]=Math.max(a[e],Km(l[t+e],0,n).length)}return a}(e,t,n,o),a=t.length,s=Ym(e,t,n,o,i),l=["Tensor"];return r&&(l.push(`  dtype: ${n}`),l.push(`  rank: ${a}`),l.push(`  shape: [${t}]`),l.push("  values:")),l.push(s.map(e=>"    "+e).join("\n")),l.join("\n")}function Km(e,t,n){let r;return r=Array.isArray(e)?`${parseFloat(e[0].toFixed(7))} + ${parseFloat(e[1].toFixed(7))}j`:Kd(e)?`'${e}'`:"bool"===n?Xm(e):parseFloat(e.toFixed(7)).toString(),Wd(r,t)}function Xm(e){return 0===e?"false":"true"}function Ym(e,t,n,r,o,i=!0){const a="complex64"===n?2:1,s=t[0],l=t.length;if(0===l)return"complex64"===n?[Km(Jm(e)[0],0,n)]:"bool"===n?[Xm(e[0])]:[e[0].toString()];if(1===l){if(s>20){const t=3*a;let r=Array.from(e.slice(0,t)),i=Array.from(e.slice((s-3)*a,s*a));return"complex64"===n&&(r=Jm(r),i=Jm(i)),["["+r.map((e,t)=>Km(e,o[t],n)).join(", ")+", ..., "+i.map((e,t)=>Km(e,o[s-3+t],n)).join(", ")+"]"]}return["["+("complex64"===n?Jm(e):Array.from(e)).map((e,t)=>Km(e,o[t],n)).join(", ")+"]"]}const u=t.slice(1),p=r.slice(1),c=r[0]*a,d=[];if(s>20){for(let t=0;t<3;t++){const r=t*c,i=r+c;d.push(...Ym(e.slice(r,i),u,n,p,o,!1))}d.push("...");for(let t=s-3;t<s;t++){const r=t*c,i=r+c;d.push(...Ym(e.slice(r,i),u,n,p,o,t===s-1))}}else for(let t=0;t<s;t++){const r=t*c,i=r+c;d.push(...Ym(e.slice(r,i),u,n,p,o,t===s-1))}const h=2===l?",":"";d[0]="["+d[0]+h;for(let e=1;e<d.length-1;e++)d[e]=" "+d[e]+h;let f=",\n";for(let e=2;e<l;e++)f+="\n";return d[d.length-1]=" "+d[d.length-1]+"]"+(i?"":f),d}function Jm(e){const t=[];for(let n=0;n<e.length;n+=2)t.push([e[n],e[n+1]]);return t}class Zm{constructor(e,t,n){if(this.dtype=t,this.shape=e.slice(),this.size=Bd(e),null!=n){const e=n.length;Md(e===this.size,()=>`Length of values '${e}' does not match the size inferred by the shape '${this.size}'.`)}if("complex64"===t)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||Hd(t,this.size),this.strides=Zd(e)}set(e,...t){0===t.length&&(t=[0]),Md(t.length===this.rank,()=>`The number of provided coordinates (${t.length}) must match the rank (${this.rank})`);const n=this.locToIndex(t);this.values[n]=e}get(...e){0===e.length&&(e=[0]);let t=0;for(const n of e){if(n<0||n>=this.shape[t]){const t=`Requested out of range element at ${e}.   Buffer shape=${this.shape}`;throw new Error(t)}t++}let n=e[e.length-1];for(let t=0;t<e.length-1;++t)n+=this.strides[t]*e[t];return this.values[n]}locToIndex(e){if(0===this.rank)return 0;if(1===this.rank)return e[0];let t=e[e.length-1];for(let n=0;n<e.length-1;++n)t+=this.strides[n]*e[n];return t}indexToLoc(e){if(0===this.rank)return[];if(1===this.rank)return[e];const t=new Array(this.shape.length);for(let n=0;n<t.length-1;++n)t[n]=Math.floor(e/this.strides[n]),e-=t[n]*this.strides[n];return t[t.length-1]=e,t}get rank(){return this.shape.length}toTensor(){return Qm().makeTensor(this.values,this.shape,this.dtype)}}let Qm=null,ey=null,ty=null;class ny{constructor(e,t,n,r){this.kept=!1,this.isDisposedInternal=!1,this.shape=e.slice(),this.dtype=t||"float32",this.size=Bd(e),this.strides=Zd(e),this.dataId=n,this.id=r,this.rankType=this.rank<5?this.rank.toString():"higher"}get rank(){return this.shape.length}async buffer(){const e=await this.data();return ey.buffer(this.shape,this.dtype,e)}bufferSync(){return ey.buffer(this.shape,this.dtype,this.dataSync())}async array(){const e=await this.data();return eh(this.shape,e,"complex64"===this.dtype)}arraySync(){return eh(this.shape,this.dataSync(),"complex64"===this.dtype)}async data(){this.throwIfDisposed();const e=Qm().read(this.dataId);if("string"===this.dtype){const t=await e;
vendor: 23,615 bytes, line 2
2try{return t.map(e=>zm(e))}catch(e){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();const e=Qm().readSync(this.dataId);if("string"===this.dtype)try{return e.map(e=>zm(e))}catch(e){throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().")}return e}async bytes(){this.throwIfDisposed();const e=await Qm().read(this.dataId);return"string"===this.dtype?e:new Uint8Array(e.buffer)}dispose(){this.isDisposed||(Qm().disposeTensor(this),this.isDisposedInternal=!0)}get isDisposed(){return this.isDisposedInternal}throwIfDisposed(){if(this.isDisposed)throw new Error("Tensor is disposed.")}print(e=!1){return ey.print(this,e)}clone(){return this.throwIfDisposed(),ey.clone(this)}toString(e=!1){return qm(this.dataSync(),this.shape,this.dtype,e)}cast(e){return this.throwIfDisposed(),ey.cast(this,e)}variable(e=!0,t,n){return this.throwIfDisposed(),Qm().makeVariable(this,e,t,n)}}Object.defineProperty(ny,Symbol.hasInstance,{value:e=>!!e&&null!=e.data&&null!=e.dataSync&&null!=e.throwIfDisposed}),mh("Tensor",()=>ny);class ry extends ny{constructor(e,t,n,r){super(e.shape,e.dtype,e.dataId,r),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(!Pd(e.shape,this.shape))throw new Error(`shape of the new value (${e.shape}) and previous value (${this.shape}) must match`);Qm().disposeTensor(this),this.dataId=e.dataId,Qm().incRef(this,null)}dispose(){Qm().disposeVariable(this),this.isDisposedInternal=!0}}var oy,iy,ay,sy,ly;Object.defineProperty(ry,Symbol.hasInstance,{value:e=>e instanceof ny&&null!=e.assign&&e.assign instanceof Function}),function(e){e.R0="R0",e.R1="R1",e.R2="R2",e.R3="R3",e.R4="R4",e.R5="R5",e.R6="R6"}(oy||(oy={})),function(e){e.float32="float32",e.int32="int32",e.bool="int32",e.complex64="complex64"}(iy||(iy={})),function(e){e.float32="float32",e.int32="int32",e.bool="bool",e.complex64="complex64"}(ay||(ay={})),function(e){e.float32="float32",e.int32="float32",e.bool="float32",e.complex64="complex64"}(sy||(sy={})),function(e){e.float32="complex64",e.int32="complex64",e.bool="complex64",e.complex64="complex64"}(ly||(ly={}));const uy={float32:sy,int32:iy,bool:ay,complex64:ly};function py(e,t){if("string"===e||"string"===t){if("string"===e&&"string"===t)return"string";throw new Error(`Can not upcast ${e} with ${t}`)}return uy[e][t]}function cy(e,t){if(e.dtype===t.dtype)return[e,t];const n=py(e.dtype,t.dtype);return[e.cast(n),t.cast(n)]}function dy(e,t){return t.some(t=>t.id===e.id)}function hy(e){const t=[];return fy(e,t,new Set),t}function fy(e,t,n){if(null==e)return;if(e instanceof ny)return void t.push(e);if(r=e,!Array.isArray(r)&&"object"!=typeof r)return;var r;const o=e;for(const e in o){const r=o[e];n.has(r)||(n.add(r),fy(r,t,n))}}function gy(e){return null!=e.kernelName}class my{constructor(){this.registeredVariables={},this.nextTapeNodeId=0,this.numBytes=0,this.numTensors=0,this.numStringTensors=0,this.numDataBuffers=0,this.gradientDepth=0,this.kernelDepth=0,this.scopeStack=[],this.numDataMovesStack=[],this.nextScopeId=0,this.tensorInfo=new WeakMap,this.profiling=!1,this.activeProfile={newBytes:0,newTensors:0,peakBytes:0,kernels:[],result:null,get kernelNames(){return Array.from(new Set(this.kernels.map(e=>e.name)))}}}dispose(){for(const e in this.registeredVariables)this.registeredVariables[e].dispose()}}class yy{constructor(e){this.ENV=e,this.registry={},this.registryFactory={},this.pendingBackendInitId=0,this.state=new my}async ready(){if(null!=this.pendingBackendInit)return this.pendingBackendInit.then(()=>{});if(null!=this.backendInstance)return;const e=this.getSortedBackends();for(let t=0;t<e.length;t++){const n=e[t];if(await this.initializeBackend(n).success)return void await this.setBackend(n)}throw new Error("Could not initialize any backends, all backend initializations failed.")}get backend(){if(null!=this.pendingBackendInit)throw new Error(`Backend '${this.backendName}' has not yet been initialized. Make sure to await tf.ready() or await tf.setBackend() before calling other methods`);if(null==this.backendInstance){const{name:e,asyncInit:t}=this.initializeBackendsAndReturnBest();if(t)throw new Error(`The highest priority backend '${e}' has not yet been initialized. Make sure to await tf.ready() or await tf.setBackend() before calling other methods`);this.setBackend(e)}return this.backendInstance}backendNames(){return Object.keys(this.registryFactory)}findBackend(e){if(!(e in this.registry)){if(!(e in this.registryFactory))return null;{const{asyncInit:t}=this.initializeBackend(e);if(t)return null}}return this.registry[e]}findBackendFactory(e){return e in this.registryFactory?this.registryFactory[e].factory:null}registerBackend(e,t,n=1){return e in this.registryFactory?(lh(`${e} backend was already registered. Reusing existing backend factory.`),!1):(this.registryFactory[e]={factory:t,priority:n},!0)}async setBackend(e){if(null==this.registryFactory[e])throw new Error(`Backend name '${e}' not found in registry`);if(this.backendName=e,null==this.registry[e]){this.backendInstance=null;const{success:t,asyncInit:n}=this.initializeBackend(e);if(!(n?await t:t))return!1}return this.backendInstance=this.registry[e],this.setupRegisteredKernels(),this.profiler=new Vm(this.backendInstance),!0}setupRegisteredKernels(){xm(this.backendName).forEach(e=>{null!=e.setupFunc&&e.setupFunc(this.backendInstance)})}disposeRegisteredKernels(e){xm(e).forEach(t=>{null!=t.disposeFunc&&t.disposeFunc(this.registry[e])})}initializeBackend(e){const t=this.registryFactory[e];if(null==t)throw new Error(`Cannot initialize backend ${e}, no registration found.`);try{const n=t.factory();if(!n||n instanceof Fd||"function"!=typeof n.then)return this.registry[e]=n,{success:!0,asyncInit:!1};{const t=++this.pendingBackendInitId,r=n.then(n=>!(t<this.pendingBackendInitId||(this.registry[e]=n,this.pendingBackendInit=null,0))).catch(n=>(t<this.pendingBackendInitId||(this.pendingBackendInit=null,lh(`Initialization of backend ${e} failed`),lh(n.stack||n.message)),!1));return this.pendingBackendInit=r,{success:r,asyncInit:!0}}}catch(t){return lh(`Initialization of backend ${e} failed`),lh(t.stack||t.message),{success:!1,asyncInit:!1}}}removeBackend(e){if(!(e in this.registryFactory))throw new Error(`${e} backend not found in registry`);this.backendName===e&&null!=this.pendingBackendInit&&this.pendingBackendInitId++,e in this.registry&&(this.disposeRegisteredKernels(e),this.registry[e].dispose(),delete this.registry[e]),delete this.registryFactory[e],this.backendName===e&&(this.pendingBackendInit=null,this.backendName=null,this.backendInstance=null)}getSortedBackends(){if(0===Object.keys(this.registryFactory).length)throw new Error("No backend found in registry.");return Object.keys(this.registryFactory).sort((e,t)=>this.registryFactory[t].priority-this.registryFactory[e].priority)}initializeBackendsAndReturnBest(){const e=this.getSortedBackends();for(let t=0;t<e.length;t++){const n=e[t],{success:r,asyncInit:o}=this.initializeBackend(n);if(o||r)return{name:n,asyncInit:o}}throw new Error("Could not initialize any backends, all backend initializations failed.")}moveData(e,t){const n=this.state.tensorInfo.get(t),r=n.backend,o=this.readSync(t),i=r.refCount(t);r.disposeData(t,!0),n.backend=e,e.move(t,o,n.shape,n.dtype,i),this.shouldCheckForMemLeaks()&&this.state.numDataMovesStack[this.state.numDataMovesStack.length-1]++}tidy(e,t){let n,r=null;if(null==t){if("function"!=typeof e)throw new Error("Please provide a function to tidy()");t=e}else{if("string"!=typeof e&&!(e instanceof String))throw new Error("When calling with two arguments, the first argument to tidy() must be a string");if("function"!=typeof t)throw new Error("When calling with two arguments, the 2nd argument to tidy() must be a function");r=e}return this.scopedRun(()=>this.startScope(r),()=>this.endScope(n),()=>(n=t(),n instanceof Promise&&console.error("Cannot return a Promise inside of tidy."),n))}scopedRun(e,t,n){e();try{const e=n();return t(),e}catch(e){throw t(),e}}nextTensorId(){return yy.nextTensorId++}nextVariableId(){return yy.nextVariableId++}clone(e){const t=$y.runKernel(Tf,{x:e}),n={x:e};return this.addTapeNode(this.state.activeScope.name,n,[t],e=>({x:()=>{const t={x:e};return $y.runKernel(Ph,t,{dtype:"float32"})}}),[],{}),t}runKernel(e,t,n){if(null==this.backendName&&this.backend,null==_m(e,this.backendName))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){const r=this.backend.numDataIds();let o=0;n.forEach(e=>{o+="complex64"===e.dtype?3:1});const i=this.state.numDataMovesStack[this.state.numDataMovesStack.length-1],a=r-t-o-i;if(a>0)throw new Error(`Backend '${this.backendName}' has an internal memory leak (${a} data ids) after running '${e}'`)}runKernelFunc(e){let t,n=[];const r=this.isTapeOn(),o=this.state.numBytes,i=this.state.numTensors;let a,s;this.shouldCheckForMemLeaks()&&this.state.numDataMovesStack.push(0),null==this.backendName&&this.backend;const l=gy(e)?e.kernelName:null!=this.state.activeScope?this.state.activeScope.name:"";if(gy(e)){const{kernelName:t,inputs:o,attrs:i}=e;null==this.backendName&&this.backend;const l=_m(t,this.backendName);Md(null!=l,()=>`Cannot find registered kernel '${t}' for backend '${this.backendName}'`),a=()=>{const e=this.backend.numDataIds();s=l.kernelFunc({inputs:o,attrs:i,backend:this.backend});const a=Array.isArray(s)?s:[s];this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(t,e,a);const u=a.map(e=>{if(null!=e.rank)return e;const{dataId:t,shape:n,dtype:r}=e;return this.makeTensorFromDataId(t,n,r)});if(r){const e=this.getTensorsForGradient(t,o,u);n=this.saveTensorsForBackwardMode(e)}return u}}else{const{forwardFunc:t}=e,o=e=>{r&&(n=e.map(e=>this.keep(this.clone(e))))};a=()=>{const e=this.backend.numDataIds();s=this.tidy(()=>t(this.backend,o));const n=Array.isArray(s)?s:[s];return this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(l,e,n),n}}const{inputs:u,attrs:p}=e,c=gy(e)?null:e.backwardsFunc;let d;return this.scopedRun(()=>this.state.kernelDepth++,()=>this.state.kernelDepth--,()=>{this.ENV.getBool("DEBUG")||this.state.profiling?(d=this.profiler.profileKernel(l,u,()=>a()),this.ENV.getBool("DEBUG")&&this.profiler.logKernelProfile(d),t=d.outputs):t=a()}),r&&this.addTapeNode(l,u,t,c,n,p),this.state.profiling&&this.state.activeProfile.kernels.push({name:l,bytesAdded:this.state.numBytes-o,totalBytesSnapshot:this.state.numBytes,tensorsAdded:this.state.numTensors-i,totalTensorsSnapshot:this.state.numTensors,inputShapes:Object.keys(u).map(e=>null!=u[e]?u[e].shape:null),outputShapes:t.map(e=>e.shape),kernelTimeMs:d.timeMs,extraInfo:d.extraInfo}),Array.isArray(s)?t:t[0]}saveTensorsForBackwardMode(e){return e.map(e=>this.keep(this.clone(e)))}getTensorsForGradient(e,t,n){const r=wm(e);if(null!=r){const e=r.inputsToSave||[],o=r.outputsToSave||[];let i;r.saveAllInputs?(Md(Array.isArray(t),()=>"saveAllInputs is true, expected inputs to be an array."),i=Object.keys(t).map(e=>t[e])):i=e.map(e=>t[e]);const a=n.filter((e,t)=>o[t]);return i.concat(a)}return[]}makeTensor(e,t,n,r){if(null==e)throw new Error("Values passed to engine.makeTensor() are null");n=n||"float32",r=r||this.backend;let o=e;"string"===n&&Kd(e[0])&&(o=e.map(e=>Um(e)));const i=r.write(o,t,n),a=new ny(t,n,i,this.nextTensorId());if(this.trackTensor(a,r),"string"===n){const e=this.state.tensorInfo.get(i),t=function(e){if(null==e)return 0;let t=0;return e.forEach(e=>t+=e.length),t}(o);this.state.numBytes+=t-e.bytes,e.bytes=t}return a}makeTensorFromDataId(e,t,n,r){const o=new ny(t,n=n||"float32",e,this.nextTensorId());return this.trackTensor(o,r),o}makeVariable(e,t=!0,n,r){n=n||this.nextVariableId().toString(),null!=r&&r!==e.dtype&&(e=e.cast(r));const o=new ry(e,t,n,this.nextTensorId());if(null!=this.state.registeredVariables[o.name])throw new Error(`Variable with name ${o.name} was already registered`);return this.state.registeredVariables[o.name]=o,this.incRef(o,this.backend),o}trackTensor(e,t){this.state.numTensors++,"string"===e.dtype&&this.state.numStringTensors++;let n=0;"complex64"!==e.dtype&&"string"!==e.dtype&&(n=e.size*qd(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 ry||this.track(e)}incRef(e,t){this.trackTensor(e,t),this.backend.incRef(e.dataId)}removeDataId(e,t){this.state.tensorInfo.has(e)&&this.state.tensorInfo.get(e).backend===t&&(this.state.tensorInfo.delete(e),this.state.numDataBuffers--)}disposeTensor(e){if(!this.state.tensorInfo.has(e.dataId))return;const t=this.state.tensorInfo.get(e.dataId);if(this.state.numTensors--,"string"===e.dtype&&(this.state.numStringTensors--,this.state.numBytes-=t.bytes),"complex64"!==e.dtype&&"string"!==e.dtype){const t=e.size*qd(e.dtype);this.state.numBytes-=t}t.backend.disposeData(e.dataId)&&this.removeDataId(e.dataId,t.backend)}disposeVariables(){for(const e in this.state.registeredVariables){const t=this.state.registeredVariables[e];this.disposeVariable(t)}}disposeVariable(e){this.disposeTensor(e),null!=this.state.registeredVariables[e.name]&&delete this.state.registeredVariables[e.name]}memory(){const e=this.backend.memory();return e.numTensors=this.state.numTensors,e.numDataBuffers=this.state.numDataBuffers,e.numBytes=this.state.numBytes,this.state.numStringTensors>0&&(e.unreliable=!0,null==e.reasons&&(e.reasons=[]),e.reasons.push("Memory usage by string tensors is approximate (2 bytes per character)")),e}async profile(e){this.state.profiling=!0;const t=this.state.numBytes,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(e=>e.totalBytesSnapshot)),this.state.activeProfile.newBytes=this.state.numBytes-t,this.state.activeProfile.newTensors=this.state.numTensors-n;for(const e of this.state.activeProfile.kernels)e.kernelTimeMs=await e.kernelTimeMs,e.extraInfo=await e.extraInfo;return this.state.activeProfile}isTapeOn(){return this.state.gradientDepth>0&&0===this.state.kernelDepth}addTapeNode(e,t,n,r,o,i){const a={id:this.state.nextTapeNodeId++,kernelName:e,inputs:t,outputs:n,saved:o},s=wm(e);null!=s&&(r=s.gradFunc),null!=r&&(a.gradient=e=>(e=e.map((e,t)=>{if(null==e){const e=n[t],r=nh(e.size,e.dtype);return this.makeTensor(r,e.shape,e.dtype)}return e}),r(e.length>1?e:e[0],o,i))),this.state.activeTape.push(a)}keep(e){return e.kept=!0,e}startTape(){0===this.state.gradientDepth&&(this.state.activeTape=[]),this.state.gradientDepth++}endTape(){this.state.gradientDepth--}startScope(e){const t={track:[],name:"unnamed scope",id:this.state.nextScopeId++};e&&(t.name=e),this.state.scopeStack.push(t),this.state.activeScope=t}endScope(e){const t=hy(e),n=new Set(t.map(e=>e.id));for(let e=0;e<this.state.activeScope.track.length;e++){const t=this.state.activeScope.track[e];t.kept||n.has(t.id)||t.dispose()}const r=this.state.scopeStack.pop();this.state.activeScope=0===this.state.scopeStack.length?null:this.state.scopeStack[this.state.scopeStack.length-1],t.forEach(e=>{e.kept||e.scopeId!==r.id||this.track(e)})}gradients(e,t,n,r=!1){if(Md(t.length>0,()=>"gradients() received an empty list of xs."),null!=n&&"float32"!==n.dtype)throw new Error(`dy must have 'float32' dtype, but has '${n.dtype}'`);const o=this.scopedRun(()=>this.startTape(),()=>this.endTape(),()=>this.tidy("forward",e));Md(o instanceof ny,()=>"The result y returned by f() must be a tensor.");const i=function(e,t,n){const r={},o={};for(let e=0;e<t.length;e++)r[t[e].id]=!0;for(let n=0;n<e.length;n++){const i=e[n],a=i.inputs;for(const e in a){const n=a[e];let s=!1;for(let e=0;e<t.length;e++)if(r[n.id]){i.outputs.forEach(e=>r[e.id]=!0),s=!0,o[i.id]=!0;break}if(s)break}}const i={};i[n.id]=!0;const a={};for(let t=e.length-1;t>=0;t--){const n=e[t],r=n.inputs;for(let e=0;e<n.outputs.length;e++)if(i[n.outputs[e].id]){for(const e in r)i[r[e].id]=!0,a[n.id]=!0;break}}const s=[];for(let t=0;t<e.length;t++){const n=e[t];if(o[n.id]&&a[n.id]){const e={};for(const t in n.inputs){const o=n.inputs[t];r[o.id]&&(e[t]=o)}const t=Object.assign({},n);t.inputs=e,t.outputs=n.outputs,s.push(t)}}return s}(this.state.activeTape,t,o);if(!r&&0===i.length&&t.length>0)throw new Error("Cannot compute gradient of y=f(x) with respect to x. Make sure that the f you passed encloses all operations that lead from x to y.");return this.tidy("backward",()=>{const e={};e[o.id]=null==n?function(e){const t=th(Bd(e),"float32");return $y.makeTensor(t,e,"float32")}(o.shape):n,function(e,t,n,r){for(let o=t.length-1;o>=0;o--){const i=t[o],a=[];if(i.outputs.forEach(t=>{const n=e[t.id];null!=n?a.push(n):a.push(null)}),null==i.gradient)throw new Error(`Cannot compute gradient: gradient function not found for ${i.kernelName}.`);const s=i.gradient(a);for(const t in i.inputs){if(!(t in s))throw new Error(`Cannot backprop through input ${t}. Available gradients found: ${Object.keys(s)}.`);const o=n(()=>s[t]());if("float32"!==o.dtype)throw new Error(`Error in gradient for op ${i.kernelName}. The gradient of input ${t} must have 'float32' dtype, but has '${o.dtype}'`);const a=i.inputs[t];if(!Pd(o.shape,a.shape))throw new Error(`Error in gradient for op ${i.kernelName}. The gradient of input '${t}' has shape '${o.shape}', which does not match the shape of the input '${a.shape}'`);if(null==e[a.id])e[a.id]=o;else{const t=e[a.id];e[a.id]=r(t,o),t.dispose()}}}}(e,i,e=>this.tidy(e),_y);const r=t.map(t=>e[t.id]);return 0===this.state.gradientDepth&&(this.state.activeTape.forEach(e=>{for(const t of e.saved)t.dispose()}),this.state.activeTape=null),{value:o,grads:r}})}customGrad(e){return Md(Jd(e),()=>"The f passed in customGrad(f) must be a function."),(...t)=>{let n;Md(t.every(e=>e instanceof ny),()=>"The args passed in customGrad(f)(x1, x2,...) must all be tensors");const r={};return t.forEach((e,t)=>{r[t]=e}),this.runKernelFunc({forwardFunc:(r,o)=>(n=e(...t,o),Md(n.value instanceof ny,()=>"The function f passed in customGrad(f) must return an object where `obj.value` is a tensor"),Md(Jd(n.gradFunc),()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function."),n.value),backwardsFunc:(e,r)=>{const o=n.gradFunc(e,r),i=Array.isArray(o)?o:[o];Md(i.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(...)."),Md(i.every(e=>e instanceof ny),()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns a list of only tensors.");const a={};return i.forEach((e,t)=>{a[t]=()=>e}),a},inputs:r})}}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){const t=Wm(),n=await this.backend.time(e);return n.wallMs=Wm()-t,n}track(e){return null!=this.state.activeScope&&(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 my;for(const e in this.registry)this.disposeRegisteredKernels(e),this.registry[e].dispose(),delete this.registry[e];this.backendName=null,this.backendInstance=null,this.pendingBackendInit=null}}function by(){const e=gh();if(null==e._tfengine){const t=new ph(e);e._tfengine=new yy(t)}var t;return t=e._tfengine.ENV,fh=t,Qm=()=>e._tfengine,e._tfengine}yy.nextTensorId=0,yy.nextVariableId=0;const $y=by();function _y(e,t){const n={a:e,b:t};return $y.runKernel(_h,n)}const wy=dh();function xy(e,t){let n=e;if(Gd(e))return"string"===t?[]:[e.length];if(!Array.isArray(e))return[];const r=[];for(;Array.isArray(n)||Gd(n)&&"string"!==t;)r.push(n.length),n=n[0];return Array.isArray(e)&&dh().getBool("TENSORLIKE_CHECK_SHAPE_CONSISTENCY")&&Sy(e,r,[]),r}function Sy(e,t,n){if(n=n||[],!Array.isArray(e)&&!Gd(e))return void Md(0===t.length,()=>`Element arr[${n.join("][")}] is a primitive, but should be an array/TypedArray of ${t[0]} elements`);Md(t.length>0,()=>`Element arr[${n.join("][")}] should be a primitive, but is an array of ${e.length} elements`),Md(e.length===t[0],()=>`Element arr[${n.join("][")}] should have ${t[0]} elements, but has ${e.length} elements`);const r=t.slice(1);for(let t=0;t<e.length;++t)Sy(e[t],r,n.concat(t))}function vy(e,t,n,r){if("string_or_numeric"!==e){if(null==e)throw new Error("Expected dtype cannot be null.");if("numeric"!==e&&e!==t||"numeric"===e&&"string"===t)throw new Error(`Argument '${n}' passed to '${r}' must be ${e} tensor, but got ${t} tensor`)}}function ky(e,t,n,r="numeric"){if(e instanceof ny)return vy(r,e.dtype,t,n),e;let o=Yd(e);if("string"!==o&&["bool","int32","float32"].indexOf(r)>=0&&(o=r),vy(r,o,t,n),null==e||!Gd(e)&&!Array.isArray(e)&&"number"!=typeof e&&"boolean"!=typeof e&&"string"!=typeof e){const r=null==e?"null":e.constructor.name;throw new Error(`Argument '${t}' passed to '${n}' must be a Tensor or TensorLike, but got '${r}'`)}const i=xy(e,o);Gd(e)||Array.isArray(e)||(e=[e]);const a="string"!==o?Lm(e,o):Rd(e,[],!0);return $y.makeTensor(a,i,o)}function Ey(e,t,n,r="numeric"){if(!Array.isArray(e))throw new Error(`Argument ${t} passed to ${n} must be a \`Tensor[]\` or \`TensorLike[]\``);return e.map((e,o)=>ky(e,`${t}[${o}]`,n,r))}function Iy(e){const t=Object.keys(e);if(1!==t.length)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];const r=e[n];n.endsWith("_")&&(n=n.substring(0,n.length-1)),n+="__op";const o=(...e)=>{$y.startScope(n);try{const t=r(...e);return sh(t)&&console.error("Cannot return a Promise inside of tidy."),$y.endScope(t),t}catch(e){throw $y.endScope(null),e}};return Object.defineProperty(o,"name",{value:n,configurable:!0}),o}wy.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.")}),wy.registerFlag("IS_BROWSER",()=>"undefined"!=typeof window&&null!=window.document||"undefined"!=typeof WorkerGlobalScope),wy.registerFlag("IS_NODE",()=>"undefined"!=typeof process&&void 0!==process.versions&&void 0!==process.versions.node),wy.registerFlag("IS_CHROME",()=>"undefined"!=typeof navigator&&null!=navigator&&null!=navigator.userAgent&&/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)),wy.registerFlag("PROD",()=>!1),wy.registerFlag("TENSORLIKE_CHECK_SHAPE_CONSISTENCY",()=>wy.getBool("DEBUG")),wy.registerFlag("DEPRECATION_WARNINGS_ENABLED",()=>!0),wy.registerFlag("IS_TEST",()=>!1),wy.registerFlag("CHECK_COMPUTATION_FOR_ERRORS",()=>!0),wy.registerFlag("WRAP_TO_IMAGEBITMAP",()=>!1);const Ty=Iy({complex_:function(e,t){const n=ky(e,"real","complex"),r=ky(t,"imag","complex");Dd(n.shape,r.shape,`real and imag shapes, ${n.shape} and ${r.shape}, must match in call to tf.complex().`);const o={real:n,imag:r};return $y.runKernel(Uh,o)}});function Fy(e,t,n,r){if(null==r&&(r=Yd(e)),"complex64"===r)throw new Error("Cannot construct a complex64 tensor directly. Please use tf.complex(real, imag).");
vendor: 4,454 bytes, line 2
2if(!Gd(e)&&!Array.isArray(e)&&"number"!=typeof e&&"boolean"!=typeof e&&"string"!=typeof e)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(null!=t){oh(t);const e=Bd(t),r=Bd(n);Md(e===r,()=>`Based on the provided shape, [${t}], the tensor should have ${e} values but has ${r}`);for(let e=0;e<n.length;++e){const r=n[e],o=e!==n.length-1||r!==Bd(t.slice(e));Md(n[e]===t[e]||!o,()=>`Error creating a new Tensor. Inferred shape (${n}) does not match the provided shape (${t}). `)}}return Gd(e)||Array.isArray(e)||(e=[e]),t=t||n,e="string"!==r?Lm(e,r):Rd(e,[],!0),$y.makeTensor(e,t,r)}function Ny(e,t,n){return Fy(e,t,xy(e,n),n)}const jy={float32:4,float16:2,int32:4,uint16:2,uint8:1,bool:1,complex64:8};async function Ay(e,t){const n=[],r=[],o=Array.isArray(e)?e.map(e=>e.name):Object.keys(e);for(let i=0;i<o.length;++i){const a=o[i],s=Array.isArray(e)?e[i].tensor:e[a];if("float32"!==s.dtype&&"int32"!==s.dtype&&"bool"!==s.dtype&&"string"!==s.dtype&&"complex64"!==s.dtype)throw new Error(`Unsupported dtype in weight '${a}': ${s.dtype}`);const l={name:a,shape:s.shape,dtype:s.dtype};if("string"===s.dtype){const e=new Promise(async e=>{const t=await s.bytes(),n=t.reduce((e,t)=>e+t.length,0)+4*t.length,r=new Uint8Array(n);let o=0;for(let e=0;e<t.length;e++){const n=t[e],i=new Uint8Array(new Uint32Array([n.length]).buffer);r.set(i,o),o+=4,r.set(n,o),o+=n.length}e(r)});r.push(e)}else r.push(s.data());null!=t&&(l.group=t),n.push(l)}return{data:Cy(await Promise.all(r)),specs:n}}function Cy(e){if(null===e)throw new Error(`Invalid input value: ${JSON.stringify(e)}`);let t=0;const n=[];e.forEach(e=>{if(t+=e.byteLength,n.push(e.byteLength===e.buffer.byteLength?e:new e.constructor(e)),!(e instanceof Float32Array||e instanceof Int32Array||e instanceof Uint8Array))throw new Error(`Unsupported TypedArray subtype: ${e.constructor.name}`)});const r=new Uint8Array(t);let o=0;return n.forEach(e=>{r.set(new Uint8Array(e.buffer),o),o+=e.byteLength}),r.buffer}const My="undefined"!=typeof Buffer&&("undefined"==typeof Blob||"undefined"==typeof atob||"undefined"==typeof btoa);function Dy(e){return My?Buffer.byteLength(e):new Blob([e]).size}function Oy(e){if(1===e.length)return e[0];let t=0;e.forEach(e=>{t+=e.byteLength});const n=new Uint8Array(t);let r=0;return e.forEach(e=>{n.set(new Uint8Array(e),r),r+=e.byteLength}),n.buffer}function Ry(e,t){const n={modelTopology:e.modelTopology,format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy,weightsManifest:t};return null!=e.signature&&(n.signature=e.signature),null!=e.userDefinedMetadata&&(n.userDefinedMetadata=e.userDefinedMetadata),null!=e.modelInitializer&&(n.modelInitializer=e.modelInitializer),null!=e.trainingConfig&&(n.trainingConfig=e.trainingConfig),n}function By(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("Expected JSON model topology, received ArrayBuffer.");return{dateSaved:new Date,modelTopologyType:"JSON",modelTopologyBytes:null==e.modelTopology?0:Dy(JSON.stringify(e.modelTopology)),weightSpecsBytes:null==e.weightSpecs?0:Dy(JSON.stringify(e.weightSpecs)),weightDataBytes:null==e.weightData?0:e.weightData.byteLength}}function Py(){const e=function(){const e=e=>{let t=e<<13,n=0;for(;!(8388608&t);)n-=8388608,t<<=1;return t&=-8388609,n+=947912704,t|n},t=new Uint32Array(2048);t[0]=0;for(let n=1;n<1024;n++)t[n]=e(n);for(let e=1024;e<2048;e++)t[e]=939524096+(e-1024<<13);return t}(),t=function(){const 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}(),n=function(){const e=new Uint32Array(64);for(let t=0;t<64;t++)e[t]=1024;return e[0]=e[32]=0,e}();return r=>{const o=new ArrayBuffer(4*r.length),i=new Uint32Array(o);for(let o=0;o<r.length;o++){const a=r[o],s=e[n[a>>10]+(1023&a)]+t[a>>10];i[o]=s}return new Float32Array(o)}}class Ly{constructor(){this.saveRouters=[],this.loadRouters=[]}static getInstance(){return null==Ly.instance&&(Ly.instance=new Ly),Ly.instance}static registerSaveRouter(e){Ly.getInstance().saveRouters.push(e)}static registerLoadRouter(e){Ly.getInstance().loadRouters.push(e)}static getSaveHandlers(e){return Ly.getHandlers(e,"save")}static getLoadHandlers(e,t){return Ly.getHandlers(e,"load",t)}static getHandlers(e,t,n){const r=[];return("load"===t?Ly.getInstance().loadRouters:Ly.getInstance().saveRouters).forEac
vendor: 7,220 bytes, line 2
2h(t=>{const o=t(e,n);null!==o&&r.push(o)}),r}}const Wy=e=>Ly.getSaveHandlers(e),Uy="tensorflowjs",zy="models_store",Vy="model_info_store";function Hy(){if(!dh().getBool("IS_BROWSER"))throw new Error("Failed to obtain IndexedDB factory because the current environmentis not a web browser.");const e="undefined"==typeof window?self:window,t=e.indexedDB||e.mozIndexedDB||e.webkitIndexedDB||e.msIndexedDB||e.shimIndexedDB;if(null==t)throw new Error("The current browser does not appear to support IndexedDB.");return t}function Gy(e){const t=e.result;t.createObjectStore(zy,{keyPath:"modelPath"}),t.createObjectStore(Vy,{keyPath:"modelPath"})}class qy{constructor(e){if(this.indexedDB=Hy(),null==e||!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((e,n)=>{const r=this.indexedDB.open(Uy,1);r.onupgradeneeded=()=>Gy(r),r.onsuccess=()=>{const o=r.result;if(null==t){const t=o.transaction(zy,"readonly"),r=t.objectStore(zy).get(this.modelPath);r.onsuccess=()=>{if(null==r.result)return o.close(),n(new Error(`Cannot find model with path '${this.modelPath}' in IndexedDB.`));e(r.result.modelArtifacts)},r.onerror=e=>(o.close(),n(r.error)),t.oncomplete=()=>o.close()}else{const r=By(t),i=o.transaction(Vy,"readwrite");let a=i.objectStore(Vy);const s=a.put({modelPath:this.modelPath,modelArtifactsInfo:r});let l;s.onsuccess=()=>{l=o.transaction(zy,"readwrite");const s=l.objectStore(zy).put({modelPath:this.modelPath,modelArtifacts:t,modelArtifactsInfo:r});s.onsuccess=()=>e({modelArtifactsInfo:r}),s.onerror=e=>{a=i.objectStore(Vy);const t=a.delete(this.modelPath);t.onsuccess=()=>(o.close(),n(s.error)),t.onerror=e=>(o.close(),n(s.error))}},s.onerror=e=>(o.close(),n(s.error)),i.oncomplete=()=>{null==l?o.close():l.oncomplete=()=>o.close()}}},r.onerror=e=>n(r.error)})}}qy.URL_SCHEME="indexeddb://";const Ky=e=>{return dh().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(qy.URL_SCHEME)?(t=e.slice(qy.URL_SCHEME.length),new qy(t)):null;var t};Ly.registerSaveRouter(Ky),Ly.registerLoadRouter(Ky);class Xy{constructor(){this.indexedDB=Hy()}async listModels(){return new Promise((e,t)=>{const n=this.indexedDB.open(Uy,1);n.onupgradeneeded=()=>Gy(n),n.onsuccess=()=>{const r=n.result,o=r.transaction(Vy,"readonly"),i=o.objectStore(Vy).getAll();i.onsuccess=()=>{const t={};for(const e of i.result)t[e.modelPath]=e.modelArtifactsInfo;e(t)},i.onerror=e=>(r.close(),t(i.error)),o.oncomplete=()=>r.close()},n.onerror=e=>t(n.error)})}async removeModel(e){var t;return e=(t=e).startsWith(qy.URL_SCHEME)?t.slice(qy.URL_SCHEME.length):t,new Promise((t,n)=>{const r=this.indexedDB.open(Uy,1);r.onupgradeneeded=()=>Gy(r),r.onsuccess=()=>{const o=r.result,i=o.transaction(Vy,"readwrite"),a=i.objectStore(Vy),s=a.get(e);let l;s.onsuccess=()=>{if(null==s.result)return o.close(),n(new Error(`Cannot find model with path '${e}' in IndexedDB.`));{const r=a.delete(e),i=()=>{l=o.transaction(zy,"readwrite");const r=l.objectStore(zy).delete(e);r.onsuccess=()=>t(s.result.modelArtifactsInfo),r.onerror=e=>n(s.error)};r.onsuccess=i,r.onerror=e=>(i(),o.close(),n(s.error))}},s.onerror=e=>(o.close(),n(s.error)),i.oncomplete=()=>{null==l?o.close():l.oncomplete=()=>o.close()}},r.onerror=e=>n(r.error)})}}const Yy="/",Jy="tensorflowjs_models",Zy="info",Qy="model_topology",eb="weight_specs",tb="weight_data",nb="model_metadata";function rb(e){return{info:[Jy,e,Zy].join(Yy),topology:[Jy,e,Qy].join(Yy),weightSpecs:[Jy,e,eb].join(Yy),weightData:[Jy,e,tb].join(Yy),modelMetadata:[Jy,e,nb].join(Yy)}}function ob(e){for(const t of Object.values(e))window.localStorage.removeItem(t)}function ib(e){const t=e.split(Yy);if(t.length<3)throw new Error(`Invalid key format: ${e}`);return t.slice(1,t.length-1).join(Yy)}class ab{constructor(e){if(!dh().getBool("IS_BROWSER")||"undefined"==typeof window||void 0===window.localStorage)throw new Error("The current environment does not support local storage.");if(this.LS=window.localStorage,null==e||!e)throw new Error("For local storage, modelPath must not be null, undefined or empty.");this.modelPath=e,this.keys=rb(this.modelPath)}async save(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserLocalStorage.save() does not support saving model topology in binary formats yet.");{const t=JSON.stringify(e.modelTopology),n=JSON.stringify(e.weightSpecs),r=By(e);try{this.LS.setItem(this.keys.info,JSON.stringify(r)),this.LS.setItem(this.keys.topology,t),this.LS.setItem(this.keys.weightSpecs,n),this.LS.setItem(this.keys.weightData,function(e){if(My)return Buffer.from(e).toString("base64");const t=new Uint8Array(e);let n="";for(let e=0,r=t.length;e<r;e++)n+=String.fromCharCode(t[e]);return btoa(n)}(e.weightData));const o={format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy,signature:null!=e.signature?e.signature:void 0,userDefinedMetadata:null!=e.userDefinedMetadata?e.userDefinedMetadata:void 0,modelInitializer:null!=e.modelInitializer?e.modelInitializer:void 0,trainingConfig:null!=e.trainingConfig?e.trainingConfig:void 0};return this.LS.setItem(this.keys.modelMetadata,JSON.stringify(o)),{modelArtifactsInfo:r}}catch(e){throw ob(this.keys),new Error(`Failed to save model '${this.modelPath}' to local storage: size quota being exceeded is a possible cause of this failure: modelTopologyBytes=${r.modelTopologyBytes}, weightSpecsBytes=${r.weightSpecsBytes}, weightDataBytes=${r.weightDataBytes}.`)}}}async load(){const e=JSON.parse(this.LS.getItem(this.keys.info));if(null==e)throw new Error(`In local storage, there is no model with name '${this.modelPath}'`);if("JSON"!==e.modelTopologyType)throw new Error("BrowserLocalStorage does not support loading non-JSON model topology yet.");const t={},n=JSON.parse(this.LS.getItem(this.keys.topology));if(null==n)throw new Error(`In local storage, the topology of model '${this.modelPath}' is missing.`);t.modelTopology=n;const r=JSON.parse(this.LS.getItem(this.keys.weightSpecs));if(null==r)throw new Error(`In local storage, the weight specs of model '${this.modelPath}' are missing.`);t.weightSpecs=r;const o=this.LS.getItem(this.keys.modelMetadata);if(null!=o){const e=JSON.parse(o);t.format=e.format,t.generatedBy=e.generatedBy,t.convertedBy=e.convertedBy,null!=e.signature&&(t.signature=e.signature),null!=e.userDefinedMetadata&&(t.userDefinedMetadata=e.userDefinedMetadata),null!=e.modelInitializer&&(t.modelInitializer=e.modelInitializer),null!=e.trainingConfig&&(t.trainingConfig=e.trainingConfig)}const i=this.LS.getItem(this.keys.weightData);if(null==i)throw new Error(`In local storage, the binary weight values of model '${this.modelPath}' are missing.`);return t.weightData=function(e){if(My){const t=Buffer.from(e,"base64");return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}const t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n.set([t.charCodeAt(e)],e);return n.buffer}(i),t}}ab.URL_SCHEME="localstorage://";const sb=e=>
vendor: 4,325 bytes, line 2
2{return dh().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(ab.URL_SCHEME)?(t=e.slice(ab.URL_SCHEME.length),new ab(t)):null;var t};Ly.registerSaveRouter(sb),Ly.registerLoadRouter(sb);class lb{constructor(){Md(dh().getBool("IS_BROWSER"),()=>"Current environment is not a web browser"),Md("undefined"==typeof window||void 0!==window.localStorage,()=>"Current browser does not appear to support localStorage"),this.LS=window.localStorage}async listModels(){const e={},t=Jy+Yy,n=Yy+Zy;for(let r=0;r<this.LS.length;++r){const o=this.LS.key(r);o.startsWith(t)&&o.endsWith(n)&&(e[ib(o)]=JSON.parse(this.LS.getItem(o)))}return e}async removeModel(e){var t;const n=rb(e=(t=e).startsWith(ab.URL_SCHEME)?t.slice(ab.URL_SCHEME.length):t);if(null==this.LS.getItem(n.info))throw new Error(`Cannot find model at path '${e}'`);const r=JSON.parse(this.LS.getItem(n.info));return ob(n),r}}class ub{constructor(){this.managers={}}static getInstance(){return null==ub.instance&&(ub.instance=new ub),ub.instance}static registerManager(e,t){Md(null!=e,()=>"scheme must not be undefined or null."),e.endsWith("://")&&(e=e.slice(0,e.indexOf("://"))),Md(e.length>0,()=>"scheme must not be an empty string.");const n=ub.getInstance();Md(null==n.managers[e],()=>`A model store manager is already registered for scheme '${e}'.`),n.managers[e]=t}static getManager(e){const t=this.getInstance().managers[e];if(null==t)throw new Error(`Cannot find model manager for scheme '${e}'`);return t}static getSchemes(){return Object.keys(this.getInstance().managers)}}class pb{fetch(e,t){return fetch(e,t)}now(){return performance.now()}encode(e,t){if("utf-8"!==t&&"utf8"!==t)throw new Error(`Browser's encoder only supports utf-8, but got ${t}`);return null==this.textEncoder&&(this.textEncoder=new TextEncoder),this.textEncoder.encode(e)}decode(e,t){return new TextDecoder(t).decode(e)}}if(dh().get("IS_BROWSER")){dh().setPlatform("browser",new pb);try{ub.registerManager(ab.URL_SCHEME,new lb)}catch(e){}try{ub.registerManager(qy.URL_SCHEME,new Xy)}catch(e){}}let cb;function db(e,t="float32",n){return t=t||"float32",oh(e),new Zm(e,t,n)}dh().get("IS_NODE")&&dh().setPlatform("node",new class{constructor(){this.util=__webpack_require__(590),this.textEncoder=new this.util.TextEncoder}fetch(e,t){return null!=dh().global.fetch?dh().global.fetch(e,t):(null==cb&&(cb=__webpack_require__(817)),cb(e,t))}now(){const e=process.hrtime();return 1e3*e[0]+e[1]/1e6}encode(e,t){if("utf-8"!==t&&"utf8"!==t)throw new Error(`Node built-in encoder only supports utf-8, but got ${t}`);return this.textEncoder.encode(e)}decode(e,t){return 0===e.length?"":new this.util.TextDecoder(t).decode(e)}});const hb=Iy({cast_:function(e,t){const n=ky(e,"x","cast");if(!function(e){return"bool"===e||"complex64"===e||"float32"===e||"int32"===e||"string"===e}(t))throw new Error(`Failed to cast to unknown dtype ${t}`);if("string"===t&&"string"!==n.dtype||"string"!==t&&"string"===n.dtype)throw new Error("Only strings can be casted to strings");const r={x:n},o={dtype:t};return $y.runKernel(Ph,r,o)}}),fb=Iy({clone_:function(e){const t={x:ky(e,"x","clone","string_or_numeric")};return $y.runKernel(Tf,t)}});function gb(e){return new Promise(e=>setTimeout(e)).then(e)}by(),ey={buffer:db,cast:hb,clone:fb,print:function(e,t=!1){console.log(e.toString(t))}};class mb{constructor(e){if(!dh().getBool("IS_BROWSER"))throw new Error("browserDownloads() cannot proceed because the current environment is not a browser.");e.startsWith(mb.URL_SCHEME)&&(e=e.slice(mb.URL_SCHEME.length)),null!=e&&0!==e.length||(e="model"),this.modelJsonFileName=e+".json",this.weightDataFileName=e+".weights.bin"}async save(e){if("undefined"==typeof document)throw new Error("Browser downloads are not supported in this environment since `document` is not present");const 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.");{const n=Ry(e,[{paths:["./"+this.weightDataFileName],weights:e.weightSpecs}]),r=window.URL.createObjectURL(new Blob([JSON.stringify(n)],{type:"application/json"})),o=null==this.modelJsonAnchor?document.createElement("a"):this.modelJsonAnchor;if(o.download=this.modelJsonFileName,o.href=r,await gb(()=>
vendor: 5,056 bytes, line 2
2o.dispatchEvent(new MouseEvent("click"))),null!=e.weightData){const e=null==this.weightDataAnchor?document.createElement("a"):this.weightDataAnchor;e.download=this.weightDataFileName,e.href=t,await gb(()=>e.dispatchEvent(new MouseEvent("click")))}return{modelArtifactsInfo:By(e)}}}}function yb(e,t,n,r){!function(e){Md(null!=e&&Array.isArray(e)&&e.length>0,()=>"promises must be a none empty array")}(e),function(e,t){Md(e>=0&&e<=1,()=>`Progress fraction must be in range [0, 1], but got startFraction ${e}`),Md(t>=0&&t<=1,()=>`Progress fraction must be in range [0, 1], but got endFraction ${t}`),Md(t>=e,()=>`startFraction must be no more than endFraction, but got startFraction ${e} and endFraction ${t}`)}(n=null==n?0:n,r=null==r?1:r);let o=0;return Promise.all(e.map(i=>(i.then(i=>{const a=n+ ++o/e.length*(r-n);return t(a),i}),i)))}async function bb(e,t){null==t&&(t={});const n=null==t.fetchFunc?dh().platform.fetch:t.fetchFunc,r=e.map(e=>n(e,t.requestInit,{isBinary:!0})),o=(null==t.onProgress?await Promise.all(r):await yb(r,t.onProgress,0,.5)).map(e=>e.arrayBuffer());return null==t.onProgress?await Promise.all(o):await yb(o,t.onProgress,.5,1)}mb.URL_SCHEME="downloads://",Ly.registerSaveRouter(e=>dh().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(mb.URL_SCHEME)?function(e="model"){return new mb(e)}(e.slice(mb.URL_SCHEME.length)):null);class $b{constructor(e,t){if(this.DEFAULT_METHOD="POST",null==t&&(t={}),this.weightPathPrefix=t.weightPathPrefix,this.onProgress=t.onProgress,this.weightUrlConverter=t.weightUrlConverter,null!=t.fetchFunc?(Md("function"==typeof t.fetchFunc,()=>"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=dh().platform.fetch,Md(null!=e&&e.length>0,()=>"URL path for http must not be null, undefined or empty."),Array.isArray(e)&&Md(2===e.length,()=>`URL paths for http must have a length of 2, (actual length is ${e.length}).`),this.path=e,null!=t.requestInit&&null!=t.requestInit.body)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.");const t=Object.assign({method:this.DEFAULT_METHOD},this.requestInit);t.body=new FormData;const n=Ry(e,[{paths:["./model.weights.bin"],weights:e.weightSpecs}]);t.body.append("model.json",new Blob([JSON.stringify(n)],{type:"application/json"}),"model.json"),null!=e.weightData&&t.body.append("model.weights.bin",new Blob([e.weightData],{type:"application/octet-stream"}),"model.weights.bin");const r=await this.fetch(this.path,t);if(r.ok)return{modelArtifactsInfo:By(e),responses:[r]};throw new Error(`BrowserHTTPRequest.save() failed due to HTTP response status ${r.status}.`)}async load(){const e=await this.fetch(this.path,this.requestInit);if(!e.ok)throw new Error(`Request to ${this.path} failed with status code ${e.status}. Please verify this URL points to the model JSON of the model to load.`);let t;try{t=await e.json()}catch(e){let t=`Failed to parse model JSON of response from ${this.path}.`;throw this.path.endsWith(".pb")?t+=" 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.":t+=" Please make sure the server is serving valid JSON for this request.",new Error(t)}const n=t.modelTopology,r=t.weightsManifest;if(null==n&&null==r)throw new Error(`The JSON from HTTP path ${this.path} contains neither model topology or manifest for weights.`);return async function(e,t){const n={modelTopology:e.modelTopology,format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy};if(null!=e.trainingConfig&&(n.trainingConfig=e.trainingConfig),null!=e.weightsManifest){const[r,o]=await t(e.weightsManifest);n.weightSpecs=r,n.weightData=o}return null!=e.signature&&(n.signature=e.signature),null!=e.userDefinedMetadata&&(n.userDefinedMetadata=e.userDefinedMetadata),null!=e.modelInitializer&&(n.modelInitializer=e.modelInitializer),n}(t,e=>this.loadWeights(e))}async loadWeights(e){const t=Array.isArray(this.path)?this.path[1]:this.path,[n,r]=function(e){const t=e.lastIndexOf("/"),n=e.lastIndexOf("?");return[e.substring(0,t)+"/",n>t?e.substring(n):""]}(t),o=this.weightPathPrefix||n,i=[];for(const t of e)i.push(...t.weights);const a=[],s=[];for(const t of e)for(const e of t.paths)null!=this.weightUrlConverter?s.push(this.weightUrlConverter(e)):a.push(o+e+r);return this.weightUrlConverter&&a.push(...await Promise.all(s)),[i,Oy(await bb(a,{requestInit:this.requestInit,fetchFunc:this.fetch,onProgress:this.onProgress}))]}}function _b(e){return null!=e.match($b.URL_SCHEME_REGEX)}$b.URL_SCHEME_REGEX=/^https?:\/\//;const wb=(e,t)=>
vendor: 4,123 bytes, line 2
2{if("undefined"==typeof fetch&&(null==t||null==t.fetchFunc))return null;{let n=!0;if(n=Array.isArray(e)?e.every(e=>_b(e)):_b(e),n)return xb(e,t)}return null};function xb(e,t){return new $b(e,t)}function Sb(e,t){return xb(e,t)}let vb;Ly.registerSaveRouter(wb),Ly.registerLoadRouter(wb);const kb=Iy({fromPixels_:function(e,t=3){if(t>4)throw new Error("Cannot construct Tensor with more than 4 channels from pixels.");if(null==e)throw new Error("pixels passed to tf.browser.fromPixels() can not be null");let n=!1,r=!1,o=!1,i=!1,a=!1,s=!1;if(e.data instanceof Uint8Array)n=!0;else if("undefined"!=typeof ImageData&&e instanceof ImageData)r=!0;else if("undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement)o=!0;else if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement)i=!0;else if(null!=e.getContext)a=!0;else{if(!("undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap))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}`);s=!0}if(o){const t=2;if(o&&e.readyState<t)throw new Error("The video element has not loaded data yet. Please wait for `loadeddata` event on the <video> element.")}if(null!=_m(hm,$y.backendName)){const n={pixels:e},r={numChannels:t};return $y.runKernel(hm,n,r)}const[l,u]=o?[e.videoWidth,e.videoHeight]:[e.width,e.height];let p,c;if(a)p=e.getContext("2d").getImageData(0,0,l,u).data;else if(r||n)p=e.data;else if(i||o||s){if(null==vb)if("undefined"==typeof document){if("undefined"==typeof OffscreenCanvas||"undefined"==typeof OffscreenCanvasRenderingContext2D)throw new Error("Cannot parse input in current context. Reason: OffscreenCanvas Context2D rendering is not supported.");vb=new OffscreenCanvas(1,1).getContext("2d")}else vb=document.createElement("canvas").getContext("2d");vb.canvas.width=l,vb.canvas.height=u,vb.drawImage(e,0,0,l,u),p=vb.getImageData(0,0,l,u).data}if(4===t)c=new Int32Array(p);else{const e=l*u;c=new Int32Array(e*t);for(let n=0;n<e;n++)for(let e=0;e<t;++e)c[n*t+e]=p[4*n+e]}return function(e,t,n){if(Od(e),null!=t&&3!==t.length)throw new Error("tensor3d() requires shape to have three numbers");const r=xy(e,n);if(3!==r.length&&1!==r.length)throw new Error("tensor3d() requires values to be number[][][] or flat/TypedArray");if(1===r.length&&null==t)throw new Error("tensor3d() requires shape to be provided when `values` are a flat array");return Fy(e,t,r,n)}(c,[u,l,t],"int32")}});function Eb(e,t){const n=e.shape.length,r=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(r<1)throw new Error(`tf.gatherND() expects the indices to be rank 1 or higher, but the rank was ${r}.`);if("int32"!==t.dtype)throw new Error(`tf.gatherND() expects the indices to be int32 type, but the dtype was ${t.dtype}.`);if(t.shape[r-1]>n)throw new Error(`index innermost dimension length must be <= tensor rank; saw: ${t.shape[r-1]} vs. ${n}`);if(0===Bd(e.shape))throw new Error(`Requested more than 0 entries, but input is empty. Input shape: ${e.shape}.`);const o=t.shape,i=o[o.length-1];let a=1;for(let e=0;e<o.length-1;++e)a*=o[e];const s=e.shape,l=o.slice();l.pop();let u=1;for(let e=i;e<n;++e)u*=s[e],l.push(s[e]);const p=[...Zd(e.shape).map(e=>e/u),1].slice(0,i);return[l,a,u,p]}function Ib(e,t,n){const r=t.shape.length,o=r>1?t.shape[r-1]:1,i=n.length;let a=1;for(let e=o;e<i;++e)a*=n[e];const s=o<1?1:o;return{sliceRank:o,numUpdates:Bd(t.shape)/s,sliceSize:a,strides:[...Zd(n.slice(0,o)),1],outputSize:Bd(n)}}function Tb(e,t,n){let r=n.length;for(let e=0;e<n.length;e++)if(n[e]>1){r=e;break}for(let o=r+1;o<n.length;o++)if(t[o]>0||n[o]!==e[o])return!1;return!0}function Fb(e,t){let n=e.length>0?e[e.length-1]:1;for(let r=0;r<e.length-1;r++)n+=e[r]*t[r];return n}function Nb(e,t,n){let r;const o=e.shape.length;let i;return r="number"==typeof t?[t,...new Array(o-1).fill(0)]:t.length<o?t.concat(new Array(o-t.length).fill(0)):t.slice(),r.forEach(e
vendor: 4,459 bytes, line 2
2=>{Md(-1!==e,()=>"slice() does not support negative begin indexing.")}),i=null==n?new Array(o).fill(-1):"number"==typeof n?[n,...new Array(o-1).fill(-1)]:n.length<o?n.concat(new Array(o-n.length).fill(-1)):n,i=i.map((t,n)=>t>=0?t:(Md(-1===t,()=>`Negative size values should be exactly -1 but got ${t} for the slice() size at index ${n}.`),e.shape[n]-r[n])),[r,i]}function jb(e,t,n,r,o,i,a,s,l){let u;if(null==r?(u=new Array(t.length),u.fill(1)):u=r,null!=a&&a&a-1)throw new Error("Multiple ellipses in slice is not allowed.");let p=!1;const c={dims:u.length,numAddAxisAfterEllipsis:0,begin:t.slice(),end:n.slice(),strides:u.slice(),beginMask:o,endMask:i,ellipsisMask:a,newAxisMask:s,shrinkAxisMask:l};for(let e=0;e<c.dims;e++)p&&1<<e&s&&c.numAddAxisAfterEllipsis++,1<<e&a&&(p=!0);p||(c.ellipsisMask|=1<<c.dims,c.dims++);const d={dims:e.length,beginMask:0,endMask:0,beginValid:!1,endValid:!1};!function(e,t){t.beginMask=0,t.endMask=0,t.shrinkAxisMask=0;let n=0;t.beginValid=null!=e.begin,t.endValid=null!=e.end,t.begin=new Array(t.dims),t.end=new Array(t.dims),t.strides=new Array(t.dims),t.finalShapeGatherIndices=[],t.finalShapeGatherIndicesSparse=[],t.inputShapeGatherIndicesSparse=new Array(t.dims);for(let r=0;r<e.dims;r++)if(1<<r&e.ellipsisMask){const o=Math.min(t.dims-(e.dims-r)+1+e.numAddAxisAfterEllipsis,t.dims);for(;n<o;n++)t.begin[n]=0,t.end[n]=0,t.strides[n]=1,t.beginMask|=1<<n,t.endMask|=1<<n,t.finalShapeGatherIndices.push(n),t.finalShapeGatherIndicesSparse.push(-1),t.inputShapeGatherIndicesSparse[n]=r}else if(1<<r&e.newAxisMask)t.finalShapeGatherIndices.push(-2),t.finalShapeGatherIndicesSparse.push(-1);else{if(n===t.begin.length)throw Error(`Index out of range using input dim ${n}; input has only ${t.dims} dims, ${t.begin.length}.`);null!=e.begin&&(t.begin[n]=e.begin[r]),null!=e.end&&(t.end[n]=e.end[r]),t.strides[n]=e.strides[r],e.beginMask&1<<r&&(t.beginMask|=1<<n),e.endMask&1<<r&&(t.endMask|=1<<n),e.shrinkAxisMask&1<<r?(t.finalShapeGatherIndices.push(-1),t.finalShapeGatherIndicesSparse.push(-1),t.shrinkAxisMask|=1<<n):(t.finalShapeGatherIndices.push(n),t.finalShapeGatherIndicesSparse.push(r)),t.inputShapeGatherIndicesSparse[n]=r,n++}}(c,d);let h=!0,f=!0,g=!0;const m=[],y=[];for(let t=0;t<e.length;++t){if(0===d.strides[t])throw Error(`strides[${t}] must be non-zero`);const n=!!(d.shrinkAxisMask&1<<t),r=e[t];if(-1===r){m.push(n?1:-1);continue}const o=[d.beginMask&1<<t,d.endMask&1<<t],i=[d.strides[t]>0?0:-1,d.strides[t]>0?r:r-1];if(n&&d.strides[t]<=0)throw Error("only stride 1 allowed on non-range indexing.");g=g&&1===d.strides[t];const a=!!(d.beginMask&1<<t&&d.endMask&1<<t);if(d.beginValid&&d.endValid){if(n){const e=d.begin[t]<0?r+d.begin[t]:d.begin[t];if(d.begin[t]=e,d.end[t]=d.begin[t]+1,e<0||e>=r)throw Error(`slice index ${d.begin[t]} of dimension ${t} out of bounds.`)}else d.begin[t]=Ab(d.begin[t],0,d.strides[t],r,o,i),d.end[t]=Ab(d.end[t],1,d.strides[t],r,o,i);const e=1===d.strides[t]&&0===d.begin[t]&&d.end[t]===r;h=h&&e,f=f&&(0===t&&1===d.strides[t]||e)}else h=h&&1===d.strides[t]&&a,f=f&&(0===t&&1===d.strides[t]||a);let s,l=!1;if(d.beginValid&&d.endValid?(s=d.end[t]-d.begin[t],l=!0):n?(s=1,l=!0):a&&r>=0&&(s=d.strides[t]<0?-r:r,l=!0),l){let e;e=0===s||s<0!=d.strides[t]<0?0:Math.trunc(s/d.strides[t])+(s%d.strides[t]!==0?1:0),m.push(e)}else m.push(-1)}for(let e=0;e<d.finalShapeGatherIndices.length;++e){const t=d.finalShapeGatherIndices[e];t>=0?y.push(m[t]):-2===t&&y.push(1)}return{finalShapeSparse:y.filter((e,t)=>-2!==d.finalShapeGatherIndices[t]),finalShape:y,isIdentity:h,sliceDim0:f,isSimpleSlice:g,begin:d.begin,end:d.end,strides:d.strides}}function Ab(e,t,n,r,o,i){if(o[t])return n>0?i[t]:i[t+1&1];{const t=e<0?r+e:e;return t<i[0]?i[0]:t>i[1]?i[1]:t}}class Cb{getClassName(){return this.constructor.className}static fromConfig(e,t){return new e(t)}}class Mb{constructor(){this.classNameMap={}}static getMap(){return null==Mb.instance&&(Mb.instance=new Mb),Mb.instance}static register(e){Mb.getMap().classNameMap[e.className]=[e,e.fromConfig]}}function Db(e){Md(null!=e.className,()=>"Class being registered does not have the static className property defined."),Md("string"==typeof e.className,()=>"className is required to be a string, but got type "+typeof e.className),Md(e.className.length>0,()=>"Class being registered has an empty-string as its className, which is disallowed."),Mb.register(e)}function Ob(){return $y}function Rb(){return $y.memory()}function Bb(e,t){return $y.tidy(e,t)}
vendor: 4,642 bytes, line 2
2function Pb(e){hy(e).forEach(e=>e.dispose())}function Lb(e){return $y.keep(e)}function Wb(e,t,n=1){return $y.registerBackend(e,t,n)}function Ub(e){return $y.customGrad(e)}function zb(e,t){if((Gd(e)&&"string"!==t||Array.isArray(e))&&"complex64"!==t)throw new Error("Error creating a new Scalar: value must be a primitive (number|boolean|string)");if("string"===t&&Gd(e)&&!(e instanceof Uint8Array))throw new Error("When making a scalar from encoded string, the value must be `Uint8Array`.");return Fy(e,[],[],t)}ty=function(e){dh().getBool("DEPRECATION_WARNINGS_ENABLED")&&console.warn(e+" You can disable deprecation warnings with tf.disableDeprecationWarnings().")};class Vb extends Cb{minimize(e,t=!1,n){const{value:r,grads:o}=this.computeGradients(e,n);if(null!=n){const e=n.map(e=>({name:e.name,tensor:o[e.name]}));this.applyGradients(e)}else this.applyGradients(o);return Pb(o),t?r:(r.dispose(),null)}get iterations(){return null==this.iterations_&&(this.iterations_=0),this.iterations_}incrementIterations(){this.iterations_=this.iterations+1}computeGradients(e,t){return function(e,t){Md(Jd(e),()=>"The f passed in variableGrads(f) must be a function"),Md(null==t||Array.isArray(t)&&t.every(e=>e instanceof ry),()=>"The varList passed in variableGrads(f, varList) must be an array of variables");const n=null!=t;if(!n){t=[];for(const e in $y.registeredVariables)t.push($y.registeredVariables[e])}const r=n?t.filter(e=>!e.trainable):null,o=t.length;Md((t=t.filter(e=>e.trainable)).length>0,()=>`variableGrads() expects at least one of the input variables to be trainable, but none of the ${o} variables is trainable.`);const{value:i,grads:a}=$y.gradients(e,t,null,!0);Md(a.some(e=>null!=e),()=>"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()."),Md(0===i.rank,()=>`The f passed in variableGrads(f) must return a scalar, but it returned a rank-${i.rank} tensor`);const s={};return t.forEach((e,t)=>{null!=a[t]&&(s[e.name]=a[t])}),null!=r&&r.forEach(e=>s[e.name]=null),{value:i,grads:s}}(e,t)}dispose(){null!=this.iterations_&&Pb(this.iterations_)}async saveIterations(){return null==this.iterations_&&(this.iterations_=0),{name:"iter",tensor:zb(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(Vb,Symbol.hasInstance,{value:e=>null!=e.minimize&&null!=e.computeGradients&&null!=e.applyGradients});const Hb=Iy({abs_:function(e){const t=ky(e,"x","abs");if("complex64"===t.dtype){const e={x:t};return $y.runKernel(zh,e)}{const e={x:t};return $y.runKernel(yh,e)}}}),Gb=Iy({add_:function(e,t){let n=ky(e,"a","add"),r=ky(t,"b","add");[n,r]=cy(n,r);const o={a:n,b:r};return $y.runKernel(_h,o)}}),qb=Iy({all_:function(e,t=null,n=!1){const r={x:ky(e,"x","all","bool")},o={axis:t,keepDims:n};return $y.runKernel(xh,r,o)}}),Kb=Iy({any_:function(e,t=null,n=!1){const r={x:ky(e,"x","any","bool")},o={axis:t,keepDims:n};return $y.runKernel(Sh,r,o)}}),Xb=Iy({argMax_:function(e,t=0){const n={x:ky(e,"x","argMax")},r={axis:t};return $y.runKernel(vh,n,r)}});function Yb(e,t,n,r,o="NHWC",i){return Qb(e,[...t,e[3]],n,i,r,null,null,l$(o))}function Jb(e,t,n,r,o,i,a="channelsLast"){const[s,l]=n$(t);let u;if("channelsLast"===a)u=[s,l,e[3],e[3]];else{if("channelsFirst"!==a)throw new Error(`Unknown dataFormat ${a}`);u=[s,l,e[1],e[1]]}return Qb(e,u,n,r,o,i,!1,a)}function Zb(e,t,n,r,o,i,a="NDHWC"){const[s,l,u]=r$(t);let p,c;if("NDHWC"===a)c="channelsLast",p=[s,l,u,e[4],e[4]];else{if("NCDHW"!==a)throw new Error(`Unknown dataFormat ${a}`);c="channelsFirst",p=[s,l,u,e[1],e[1]]}return e$(e,p,n,r,o,!1,c,i)}function Qb(e,t,n,r,o,i,a=!1,s="channelsLast"){let[l,u,p,c]=[-1,-1,-1,-1];if("channelsLast"===s)[l,u,p,c]=e;else{if("channelsFirst"!==s)throw new Error(`Unknown dataFormat ${s}`);[l,c,u,p]=e}const[d,h,,f]=t,[g,m]=n$(n),[y,b]=n$(r),$=o$(d,y),_=o$(h,b),{padInfo:w,outHeight:x,outWidth:S}=function(e,t,n,r,o,i,a,s,l){let u,p,c;if("number"==typeof e){u={top:e,bottom:e,left:e,right:e,type:0===e?"VALID":"NUMBER"};const o=function(e,t,n,r,o){null==r&&(r=t$(e,t,n));const i=e[1];return[i$((e[0]-t+2*r)/n+1,o),i$((i-t+2*r)/n+1,o)]}([t,n],i,r,e,s);p=o[0],c=o[1]}else if("same"===e){p=Math.ceil(t/r),c=Math.ceil(n/o);const e=Math.max(0,(p-1)*r+i-t),s=Math.max(0,(c-1)*o+a-n),l=Math.floor(e/2),d=e-l,h=Math.floor(s/2);
vendor: 4,275 bytes, line 2
2u={top:l,bottom:d,left:h,right:s-h,type:"SAME"}}else if("valid"===e)u={top:0,bottom:0,left:0,right:0,type:"VALID"},p=Math.ceil((t-i+1)/r),c=Math.ceil((n-a+1)/o);else{if("object"!=typeof e)throw Error(`Unknown padding parameter: ${e}`);{const d="channelsLast"===l?e[1][0]:e[2][0],h="channelsLast"===l?e[1][1]:e[2][1],f="channelsLast"===l?e[2][0]:e[3][0],g="channelsLast"===l?e[2][1]:e[3][1];u={top:d,bottom:h,left:f,right:g,type:0===d&&0===h&&0===f&&0===g?"VALID":"EXPLICIT"},p=i$((t-i+d+h)/r+1,s),c=i$((n-a+f+g)/o+1,s)}}return{padInfo:u,outHeight:p,outWidth:c}}(o,u,p,g,m,$,_,i,s),v=a?f*c:f;let k;return"channelsFirst"===s?k=[l,v,x,S]:"channelsLast"===s&&(k=[l,x,S,v]),{batchSize:l,dataFormat:s,inHeight:u,inWidth:p,inChannels:c,outHeight:x,outWidth:S,outChannels:v,padInfo:w,strideHeight:g,strideWidth:m,filterHeight:d,filterWidth:h,effectiveFilterHeight:$,effectiveFilterWidth:_,dilationHeight:y,dilationWidth:b,inShape:e,outShape:k,filterShape:t}}function e$(e,t,n,r,o,i=!1,a="channelsLast",s){let[l,u,p,c,d]=[-1,-1,-1,-1,-1];if("channelsLast"===a)[l,u,p,c,d]=e;else{if("channelsFirst"!==a)throw new Error(`Unknown dataFormat ${a}`);[l,d,u,p,c]=e}const[h,f,g,,m]=t,[y,b,$]=r$(n),[_,w,x]=r$(r),S=o$(h,_),v=o$(f,w),k=o$(g,x),{padInfo:E,outDepth:I,outHeight:T,outWidth:F}=function(e,t,n,r,o,i,a,s,l,u,p){let c,d,h,f;if("number"==typeof e){c={top:e,bottom:e,left:e,right:e,front:e,back:e,type:0===e?"VALID":"NUMBER"};const i=function(e,t,n,r,o,i){null==o&&(o=t$(e,t,r));const a=e[1],s=e[2];return[i$((e[0]-t+2*o)/r+1,i),i$((a-t+2*o)/r+1,i),i$((s-t+2*o)/r+1,i),1]}([t,n,r,1],s,0,o,e,p);d=i[0],h=i[1],f=i[2]}else if("same"===e){d=Math.ceil(t/o),h=Math.ceil(n/i),f=Math.ceil(r/a);const e=(d-1)*o+s-t,p=(h-1)*i+l-n,g=(f-1)*a+u-r,m=Math.floor(e/2),y=e-m,b=Math.floor(p/2),$=p-b,_=Math.floor(g/2);c={top:b,bottom:$,left:_,right:g-_,front:m,back:y,type:"SAME"}}else{if("valid"!==e)throw Error(`Unknown padding parameter: ${e}`);c={top:0,bottom:0,left:0,right:0,front:0,back:0,type:"VALID"},d=Math.ceil((t-s+1)/o),h=Math.ceil((n-l+1)/i),f=Math.ceil((r-u+1)/a)}return{padInfo:c,outDepth:d,outHeight:h,outWidth:f}}(o,u,p,c,y,b,$,S,v,k,s),N=i?m*d:m;let j;return"channelsFirst"===a?j=[l,N,I,T,F]:"channelsLast"===a&&(j=[l,I,T,F,N]),{batchSize:l,dataFormat:a,inDepth:u,inHeight:p,inWidth:c,inChannels:d,outDepth:I,outHeight:T,outWidth:F,outChannels:N,padInfo:E,strideDepth:y,strideHeight:b,strideWidth:$,filterDepth:h,filterHeight:f,filterWidth:g,effectiveFilterDepth:S,effectiveFilterHeight:v,effectiveFilterWidth:k,dilationDepth:_,dilationHeight:w,dilationWidth:x,inShape:e,outShape:j,filterShape:t}}function t$(e,t,n,r=1){const o=o$(t,r);return Math.floor((e[0]*(n-1)-n+o)/2)}function n$(e){return"number"==typeof e?[e,e,e]:2===e.length?[e[0],e[1],1]:e}function r$(e){return"number"==typeof e?[e,e,e]:e}function o$(e,t){return t<=1?e:e+(e-1)*(t-1)}function i$(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 a$(e){const[t,n,r]=n$(e);return 1===t&&1===n&&1===r}function s$(e,t){return a$(e)||a$(t)}function l$(e){if("NHWC"===e)return"channelsLast";if("NCHW"===e)return"channelsFirst";throw new Error(`Unknown dataFormat ${e}`)}const u$=Iy({reshape_:function(e,t){const n={x:ky(e,"x","reshape","string_or_numeric")},r={shape:t};return $y.runKernel(wg,n,r)}}),p$=Iy({avgPool_:function(e,t,n,r,o){const i=ky(e,"x","avgPool","float32");Md(s$(n,1),()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${n} and dilations '1'`);let a=i,s=!1;3===i.rank&&(s=!0,a=u$(i,[1,i.shape[0],i.shape[1],i.shape[2]])),Md(4===a.rank,()=>`Error in avgPool: x must be rank 4 but got rank ${a.rank}.`),null!=o&&Md(Ld(r),()=>`Error in avgPool: pad must be an integer when using, dimRoundingMode ${o} but got pad ${r}.`);const l={x:a},u={filterSize:t,strides:n,pad:r,dimRoundingMode:o};let p=$y.runKernel(jh,l,u);return p=hb(p,i.dtype),s?u$(p,[p.shape[1],p.shape[2],p.shape[3]]):p}}),c$=Iy({avgPool3d_:function(e,t,n,r,o,i="NDHWC"){const a=ky(e,"x","avgPool3d","float32");let s=a,l=!1;4===a.rank&&(l=!0,s=u$(a,[1,a.shape[0],a.shape[1],a.shape[2],a.shape[3]])),Md(5===s.rank,()=>`Error in avgPool3d: x must be rank 5 but got rank ${s.rank}
2.`),Md("NDHWC"===i,()=>`Error in avgPool3d: Only NDHWC is currently supported, but got dataFormat of ${i}`),null!=o&&Md(Ld(r),()=>`Error in avgPool3d: pad must be an integer when using, dimRoundingMode ${o} but got pad ${r}.`);const u={x:s},p={filterSize:t,strides:n,pad:r,dimRoundingMode:o,dataFormat:i};let c=$y.runKernel(Ch,u,p);return c=hb(c,s.dtype),l?u$(c,[c.shape[1],c.shape[2],c.shape[3],c.shape[4]]):c}}),d$=Iy({batchNorm_:function(e,t,n,r,o,i){null==i&&(i=.001);const a=ky(e,"x","batchNorm"),s=ky(t,"mean","batchNorm"),l=ky(n,"variance","batchNorm");let u,p;null!=o&&(u=ky(o,"scale","batchNorm")),null!=r&&(p=ky(r,"offset","batchNorm")),Md(s.rank===l.rank,()=>"Batch normalization gradient requires mean and variance to have equal ranks."),Md(null==p||s.rank===p.rank,()=>"Batch normalization gradient requires mean and offset to have equal ranks."),Md(null==u||s.rank===u.rank,()=>"Batch normalization gradient requires mean and scale to have equal ranks.");const c={x:function(e){let t;return t=0===e.rank||1===e.rank?u$(e,[1,1,1,e.size]):2===e.rank?u$(e,[1,1,e.shape[0],e.shape[1]]):3===e.rank?u$(e,[1,e.shape[0],e.shape[1],e.shape[2]]):e,t}(a),scale:u,offset:p,mean:s,variance:l},d={varianceEpsilon:i},h=$y.runKernel(Sf,c,d);return u$(h,a.shape)}}),h$=Iy({batchNorm2d_:function(e,t,n,r,o,i){const a=ky(e,"x","batchNorm"),s=ky(t,"mean","batchNorm"),l=ky(n,"variance","batchNorm");let u,p;return null!=o&&(u=ky(o,"scale","batchNorm")),null!=r&&(p=ky(r,"offset","batchNorm")),Md(2===a.rank,()=>`Error in batchNorm2D: x must be rank 2 but got rank ${a.rank}.`),Md(2===s.rank||1===s.rank,()=>`Error in batchNorm2D: mean must be rank 2 or rank 1 but got rank ${s.rank}.`),Md(2===l.rank||1===l.rank,()=>`Error in batchNorm2D: variance must be rank 2 or rank 1 but got rank ${l.rank}.`),null!=u&&Md(2===u.rank||1===u.rank,()=>`Error in batchNorm2D: scale must be rank 2 or rank 1 but got rank ${u.rank}.`),null!=p&&Md(2===p.rank||1===p.rank,()=>`Error in batchNorm2D: offset must be rank 2 or rank 1 but got rank ${p.rank}.`),d$(a,s,l,p,u,i)}}),f$=Iy({batchNorm3d_:function(e,t,n,r,o,i){const a=ky(e,"x","batchNorm"),s=ky(t,"mean","batchNorm"),l=ky(n,"variance","batchNorm");let u,p;return null!=o&&(u=ky(o,"scale","batchNorm")),null!=r&&(p=ky(r,"offset","batchNorm")),Md(3===a.rank,()=>`Error in batchNorm3D: x must be rank 3 but got rank ${a.rank}.`),Md(3===s.rank||1===s.rank,()=>`Error in batchNorm3D: mean must be rank 3 or rank 1 but got rank ${s.rank}.`),Md(3===l.rank||1===l.rank,()=>`Error in batchNorm3D: variance must be rank 3 or rank 1 but got rank ${l.rank}.`),null!=u&&Md(3===u.rank||1===u.rank,()=>`Error in batchNorm3D: scale must be rank 3 or rank 1 but got rank ${u.rank}.`),null!=p&&Md(3===p.rank||1===p.rank,()=>`Error in batchNorm3D: offset must be rank 3 or rank 1 but got rank ${p.rank}.`),d$(a,s,l,p,u,i)}}),g$=Iy({batchNorm4d_:function(e,t,n,r,o,i){const a=ky(e,"x","batchNorm"),s=ky(t,"mean","batchNorm"),l=ky(n,"variance","batchNorm");let u,p;return null!=o&&(u=ky(o,"scale","batchNorm")),null!=r&&(p=ky(r,"offset","batchNorm")),Md(4===a.rank,()=>`Error in batchNorm4D: x must be rank 4 but got rank ${a.rank}.`),Md(4===s.rank||1===s.rank,()=>`Error in batchNorm4D: mean must be rank 4 or rank 1 but got rank ${s.rank}.`),Md(4===l.rank||1===l.rank,()=>`Error in batchNorm4D: variance must be rank 4 or rank 1 but got rank ${l.rank}.`),null!=u&&Md(4===u.rank||1===u.rank,()=>`Error in batchNorm4D: scale must be rank 4 or rank 1 but got rank ${u.rank}.`),null!=p&&Md(4===p.rank||1===p.rank,()=>`Error in batchNorm4D: offset must be rank 4 or rank 1 but got rank ${p.rank}.`),d$(a,s,l,p,u,i)}}),m$=Iy({clipByValue_:function(e,t,n){const r=ky(e,"x","clipByValue");Md(t<=n,()=>`Error in clip: min (${t}) must be less than or equal to max (${n}).`);const o={x:r},i={clipValueMin:t,clipValueMax:n};return $y.runKernel(Wh,o,i)}}),y$=Iy({concat_:function(e,t=0){Md(e.length>=1,()=>"Pass at least one tensor to concat");const n=Ey(e,"tensors","concat","string_or_numeric");
vendor: 5,082 bytes, line 2
2if("complex64"===n[0].dtype&&n.forEach(e=>{if("complex64"!==e.dtype)throw new Error(`Cannot concatenate complex64 tensors with a tensor\n          with dtype ${e.dtype}. `)}),1===n.length)return fb(n[0]);const r=n,o={axis:t};return $y.runKernel(Vh,r,o)}}),b$=Iy({concat1d_:function(e){return y$(e,0)}}),$$=Iy({concat2d_:function(e,t){return y$(e,t)}}),_$=Iy({concat3d_:function(e,t){return y$(e,t)}}),w$=Iy({concat4d_:function(e,t){return y$(e,t)}}),x$=Iy({conv2d_:function(e,t,n,r,o="NHWC",i=[1,1],a){const s=ky(e,"x","conv2d","float32"),l=ky(t,"filter","conv2d","float32");let u=s,p=!1;3===s.rank&&(p=!0,u=u$(s,[1,s.shape[0],s.shape[1],s.shape[2]])),Md(4===u.rank,()=>`Error in conv2d: input must be rank 4, but got rank ${u.rank}.`),Md(4===l.rank,()=>`Error in conv2d: filter must be rank 4, but got rank ${l.rank}.`),null!=a&&Md(Ld(r),()=>`Error in conv2d: pad must be an integer when using, dimRoundingMode ${a} but got pad ${r}.`);const c="NHWC"===o?u.shape[3]:u.shape[1];Md(c===l.shape[2],()=>`Error in conv2d: depth of input (${c}) must match input depth for filter ${l.shape[2]}.`),Md(s$(n,i),()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${n} and dilations '${i}'`);const d={x:u,filter:l},h={strides:n,pad:r,dataFormat:o,dilations:i,dimRoundingMode:a},f=$y.runKernel(Hh,d,h);return p?u$(f,[f.shape[1],f.shape[2],f.shape[3]]):f}}),S$=Iy({conv1d_:function(e,t,n,r,o="NWC",i=1,a){const s=ky(e,"x","conv1d"),l=ky(t,"filter","conv1d");let u=s,p=!1;2===s.rank&&(p=!0,u=u$(s,[1,s.shape[0],s.shape[1]])),Md(3===u.rank,()=>`Error in conv1d: input must be rank 3, but got rank ${u.rank}.`),Md(3===l.rank,()=>`Error in conv1d: filter must be rank 3, but got rank ${l.rank}.`),null!=a&&Md(Ld(r),()=>`Error in conv1d: pad must be an integer when using, dimRoundingMode ${a} but got pad ${r}.`),Md(u.shape[2]===l.shape[1],()=>`Error in conv1d: depth of input (${u.shape[2]}) must match input depth for filter ${l.shape[1]}.`),Md(s$(n,i),()=>`Error in conv1D: Either stride or dilation must be 1. Got stride ${n} and dilation '${i}'`),Md("NWC"===o,()=>`Error in conv1d: got dataFormat of ${o} but only NWC is currently supported.`);const c=u$(l,[1,l.shape[0],l.shape[1],l.shape[2]]),d=u$(u,[u.shape[0],1,u.shape[1],u.shape[2]]),h=x$(d,c,[1,n],r,"NHWC",[1,i],a);return u$(h,p?[h.shape[2],h.shape[3]]:[h.shape[0],h.shape[2],h.shape[3]])}}),v$=Iy({conv2DBackpropInput_:function(e,t,n,r,o,i="NHWC",a){Md(e.length===t.rank,()=>`Length of inShape (${e.length}) and rank of dy (${t.rank}) must match`);let s=e,l=t,u=!1;3===t.rank&&(u=!0,l=u$(t,[1,t.shape[0],t.shape[1],t.shape[2]]),s=[1,e[0],e[1],e[2]]),Md(4===s.length,()=>`Error in conv2dDerInput: inShape must be length 4, but got length ${s.length}.`),Md(4===l.rank,()=>`Error in conv2dDerInput: dy must be rank 4, but got rank ${l.rank}`),Md(4===n.rank,()=>`Error in conv2dDerInput: filter must be rank 4, but got rank ${n.rank}`);const p="NHWC"===i?s[3]:s[1],c="NHWC"===i?l.shape[3]:l.shape[1];Md(p===n.shape[2],()=>`Error in conv2dDerInput: depth of input (${p}) must match input depth for filter ${n.shape[2]}.`),Md(c===n.shape[3],()=>`Error in conv2dDerInput: depth of output (${c}) must match output depth for filter ${n.shape[3]}.`),null!=a&&Md(Ld(o),()=>`Error in conv2dDerInput: pad must be an integer when using, dimRoundingMode ${a} but got pad ${o}.`);const d={dy:l,filter:n},h={strides:r,pad:o,dataFormat:i,dimRoundingMode:a,inputShape:s},f=$y.runKernel(qh,d,h);return u?u$(f,[f.shape[1],f.shape[2],f.shape[3]]):f}}),k$=Iy({conv2dTranspose_:function(e,t,n,r,o,i){const a=ky(e,"x","conv2dTranspose"),s=ky(t,"filter","conv2dTranspose");return v$(n,a,s,r,o,"NHWC",i)}}),E$=Iy({conv3d_:function(e,t,n,r,o="NDHWC",i=[1,1,1]){const a=ky(e,"x","conv3d"),s=ky(t,"filter","conv3d");let l=a,u=!1;4===a.rank&&(u=!0,l=u$(a,[1,a.shape[0],a.shape[1],a.shape[2],a.shape[3]])),Md(5===l.rank,()=>`Error in conv3d: input must be rank 5, but got rank ${l.rank}.`),Md(5===s.rank,()=>`Error in conv3d: filter must be rank 5, but got rank ${s.rank}.`),Md(l.shape[4]===s.shape[3],()=>`Error in conv3d: depth of input (${l.shape[4]}) must match input depth for filter ${s.shape[3]}.`),Md(s$(n,i),()=>`Error in conv3D: Either strides or dilations must be 1. Got strides ${n} and dilations '${i}'`),Md("NDHWC"===o,()=>`Error in conv3d: got dataFormat of ${o} but only NDHWC is currently supported.`);const p={x:l,filter:s},c={strides:n,pad:r,dataFormat:o,dilations:i},d=$y.runKernel(Kh,p,c);return u?u$(d,[d.shape[1],d.shape[2],d.shape[3],d.shape[4]]):d}}),I$=Iy({conv3DBackpropInput_:function(e,t,n,r,o){Md(e.length===t.rank,()=>`Length of inShape (${e.length}) and rank of dy (${t.rank}) must match`);let i=e,a=t,s=!1;4===t.rank&&(s=!0,a=u$(t,[1,t.shape[0],t.shape[1],t.shape[2],t.shape[3]]),i=[1,e[0],e[1],e[2],e[3]]);const l=i[4],u=a.shape[4];Md(5===i.length,()=>`Error in conv3dDerInput: inShape must be length 5, but got length ${i.length}.`),Md(5===a.rank,()=>`Error in conv3dDerInput: dy must be rank 5, but got rank ${a.rank}`),Md(5===n.rank,()=>`Error in conv3dDerInput: filter must be rank 5, but got rank ${n.rank}
2`),Md(l===n.shape[3],()=>`Error in conv3dDerInput: depth of input (${l}) must match input depth for filter ${n.shape[3]}.`),Md(u===n.shape[4],()=>`Error in conv3dDerInput: depth of output (${u}) must match output depth for filter ${n.shape[4]}.`);const p={dy:a,filter:n},c={pad:o,strides:r,inputShape:i},d=$y.runKernel(Yh,p,c);return s?u$(d,[d.shape[1],d.shape[2],d.shape[3],d.shape[4]]):d}}),T$=Iy({conv3dTranspose_:function(e,t,n,r,o){const i=ky(e,"x","conv3dTranspose"),a=ky(t,"filter","conv3dTranspose");return I$(n,i,a,r,o)}}),F$=Iy({depthwiseConv2d_:function(e,t,n,r,o="NHWC",i=[1,1],a){const s=ky(e,"x","depthwiseConv2d","float32"),l=ky(t,"filter","depthwiseConv2d","float32");let u=s,p=!1;3===s.rank&&(p=!0,u=u$(s,[1,s.shape[0],s.shape[1],s.shape[2]])),Md(4===u.rank,()=>`Error in depthwiseConv2d: input must be rank 4, but got rank ${u.rank}.`),Md(4===l.rank,()=>`Error in depthwiseConv2d: filter must be rank 4, but got rank ${l.rank}.`),Md(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]}.`),null!=a&&Md(Ld(r),()=>`Error in depthwiseConv2d: pad must be an integer when using, dimRoundingMode ${a} but got pad ${r}.`);const c={x:u,filter:l},d={strides:n,pad:r,dataFormat:o,dilations:i,dimRoundingMode:a},h=$y.runKernel(rf,c,d);return p?u$(h,[h.shape[1],h.shape[2],h.shape[3]]):h}}),N$=Iy({floorDiv_:function(e,t){let n=ky(e,"a","floorDiv"),r=ky(t,"b","floorDiv");[n,r]=cy(n,r);const o={a:n,b:r};return $y.runKernel(xf,o)}}),j$=Iy({div_:function(e,t){let n=ky(e,"a","div"),r=ky(t,"b","div");if([n,r]=cy(n,r),"int32"===n.dtype&&"int32"===r.dtype)return N$(n,r);const o={a:n,b:r};return $y.runKernel(pf,o,{})}}),A$=Iy({elu_:function(e){const t={x:ky(e,"x","elu","float32")};return $y.runKernel(df,t)}});function C$(e,t){const n=e.length,r=[];for(let o=0;o<n;o++){const i=n-1-o,a=e[i]||1;(t[t.length-1-o]||1)>1&&1===a&&r.unshift(i)}return r}function M$(e,t){const n=[];for(let r=0;r<t.length;r++){const o=e[e.length-r-1],i=t.length-r-1,a=t[i];(null==o||1===o&&a>1)&&n.unshift(i)}return n}function D$(e,t){const n=[],r=Math.max(e.length,t.length);for(let o=0;o<r;o++){let r=e[e.length-o-1];null==r&&(r=1);let i=t[t.length-o-1];if(null==i&&(i=1),1===r)n.unshift(i);else if(1===i)n.unshift(r);else{if(r!==i)throw Error(`Operands could not be broadcast together with shapes ${e} and ${t}.`);n.unshift(r)}}return n}const O$=Iy({equal_:function(e,t){let n=ky(e,"a","equal","string_or_numeric"),r=ky(t,"b","equal","string_or_numeric");[n,r]=cy(n,r),D$(n.shape,r.shape);const o={a:n,b:r};return $y.runKernel(gf,o)}}),R$=Iy({exp_:function(e){const t={x:ky(e,"x","exp")};return $y.runKernel(mf,t)}}),B$=Iy({expandDims_:function(e,t=0){const n=ky(e,"x","expandDims","string_or_numeric");Md(t<=n.rank,()=>"Axis must be <= rank of the tensor");const r={input:n},o={dim:t};return $y.runKernel(yf,r,o)}}),P$=Iy({tile_:function(e,t){const n=ky(e,"x","tile","string_or_numeric");Md(n.rank===t.length,()=>`Error in transpose: rank of input ${n.rank} must match length of reps ${t}.`);const r={x:n},o={reps:t};return $y.runKernel(om,r,o)}}),L$=Iy({eye_:function(e,t,n,r="float32"){null==t&&(t=e);const o=db([e,t],r),i=e<=t?e:t;for(let e=0;e<i;++e)o.set(1,e,e);const a=u$(o.toTensor(),[e,t]);if(null==n)return a;if(1===n.length)return P$(B$(a,0),[n[0],1,1]);if(2===n.length)return P$(B$(B$(a,0),0),[n[0],n[1],1,1]);if(3===n.length)return P$(B$(B$(B$(a,0),0),0),[n[0],n[1],n[2],1,1]);throw new Error(`eye() currently supports only 1D and 2D batchShapes, but received ${n.length}D.`)}});function W$(e,t,n){const r={shape:e,value:t,dtype:n};return $y.runKernel($f,{},r)}const U$=Iy({floor_:function(e){const t={x:ky(e,"x","floor","float32")};return $y.runKernel(wf,t)}}),z$=Iy({gather_:function(e,t,n=0,r=0){const o={x:ky(e,"x","gather"),indices:ky(t,"indices","gather","int32")},i={axis:n,batchDims:r};return $y.runKernel(vf,o,i)}}),V$=Iy({greater_:function(e,t){let n=ky(e,"a","greater","string_or_numeric"),r=ky(t,"b","greater","string_or_numeric");[n,r]=cy(n,r),D$(n.shape,r.shape);const o={a:n,b:r};return $y.runKernel(Ef,o)}}),H$=Iy({greaterEqual_:function(e,t){let n=ky(e,"a","greaterEqual","string_or_numeric"),r=ky(t,"b","greaterEqual","string_or_numeric");[n,r]=cy(n,r),D$(n.shape,r.shape);const o={a:n,b:r};return $y.runKernel(If,o)}}),G$=Iy({leakyRelu_:function(e,t=.2){const n={x:ky(e,"x","leakyRelu")},r={alpha:t};return $y.runKernel(Mf,n,r)}}),q$=Iy({log_:function(e){const t={x:ky(e,"x","log","float32")};return $y.runKernel(Bf,t)}}),K$=Iy({log1p_:function(e){const t={x:ky(e,"x","log1p")};return $y.runKernel(Pf,t)}}),X$=Iy({max_:function(e,t=null,n=!1){const r={x:ky(e,"x","max")},o={reductionIndices:t,keepDims:n};return $y.runKernel(Hf,r,o)}}),Y$=Iy({mul_:function(e,t){let n=ky(e,"a","mul"),r=ky(t,"b","mul");[n,r]=cy(n,r);const o={a:n,b:r};return $y.runKernel(og,o)}}),J$=Iy({sub_:function(e,t){let n=ky(e,"a","sub"),r=ky(t,"b","sub");[n,r]=cy(n,r);const o={a:n,b:r};return $y.runKernel(tm,o)}}),Z$=Iy({sum_:function(e,t=null,n=!1){let r=ky(e,"x","sum");"bool"===r.dtype&&(r=hb(r,"int32"));const o={x:r},i={axis:t,keepDims:n};return $y.runKernel(Lg,o,i)}}),Q$=Iy({logSoftmax_:function(e,t=-1){const n=ky(e,"logits","logSoftmax");if(-1===t&&(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}
2 and axis was ${t}`);const r=Ub((e,n)=>{const r=X$(e,t,!0),o=J$(e,r),i=J$(hb(o,"float32"),q$(Z$(R$(o),t,!0)));return n([i]),{value:i,gradFunc:(e,n)=>{const[r]=n,o=R$(r);return J$(e,Y$(Z$(e,t,!0),o))}}});return r(n)}}),e_=Iy({logicalAnd_:function(e,t){const n=ky(e,"a","logicalAnd","bool"),r=ky(t,"b","logicalAnd","bool");D$(n.shape,r.shape);const o={a:n,b:r};return $y.runKernel(Lf,o)}}),t_=Iy({matMul_:function(e,t,n=!1,r=!1){let o=ky(e,"a","matMul"),i=ky(t,"b","matMul");[o,i]=cy(o,i);const a={a:o,b:i},s={transposeA:n,transposeB:r};return $y.runKernel(Dh,a,s)}}),n_=Iy({maxPool_:function(e,t,n,r,o){const i=ky(e,"x","maxPool");let a=i,s=!1;3===i.rank&&(s=!0,a=u$(i,[1,i.shape[0],i.shape[1],i.shape[2]])),Md(4===a.rank,()=>`Error in maxPool: input must be rank 4 but got rank ${a.rank}.`),Md(s$(n,1),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${n} and dilations '1'`),null!=o&&Md(Ld(r),()=>`Error in maxPool: pad must be an integer when using, dimRoundingMode ${o} but got pad ${r}.`);const l={x:a},u={filterSize:t,strides:n,pad:r,dimRoundingMode:o},p=$y.runKernel(qf,l,u);return s?u$(p,[p.shape[1],p.shape[2],p.shape[3]]):p}}),r_=Iy({maxPool3d_:function(e,t=[1,1,1],n,r,o,i="NDHWC"){const a=ky(e,"x","maxPool3d");let s=a,l=!1;4===a.rank&&(l=!0,s=u$(a,[1,a.shape[0],a.shape[1],a.shape[2],a.shape[3]])),Md(5===s.rank,()=>`Error in maxPool3d: x must be rank 5 but got rank ${s.rank}.`),Md("NDHWC"===i,()=>`Error in maxPool3d: Only NDHWC is currently supported, but got dataFormat of ${i}`),null!=o&&Md(Ld(r),()=>`Error in maxPool3d: pad must be an integer when using, dimRoundingMode ${o} but got pad ${r}.`);const u={x:s},p={filterSize:t,strides:n,pad:r,dimRoundingMode:o,dataFormat:i},c=$y.runKernel(Xf,u,p);return l?u$(c,[c.shape[1],c.shape[2],c.shape[3],c.shape[4]]):c}}),o_=Iy({maximum_:function(e,t){let n=ky(e,"a","maximum"),r=ky(t,"b","maximum");[n,r]=cy(n,r),"bool"===n.dtype&&(n=hb(n,"int32"),r=hb(r,"int32")),D$(n.shape,r.shape);const o={a:n,b:r};return $y.runKernel(Gf,o)}}),i_=Iy({mean_:function(e,t=null,n=!1){const r={x:ky(e,"x","mean")},o={axis:t,keepDims:n};return $y.runKernel(Zf,r,o)}}),a_=Iy({minimum_:function(e,t){let n=ky(e,"a","minimum"),r=ky(t,"b","minimum");[n,r]=cy(n,r),"bool"===n.dtype&&(n=hb(n,"int32"),r=hb(r,"int32")),D$(n.shape,r.shape);const o={a:n,b:r};return $y.runKernel(eg,o)}});function s_(e,t){for(let n=0;n<e.length;++n)if(e[e.length-n-1]!==t-1-n)return!1;return!0}function l_(e,t){const n=[],r=e.length;for(let o=0;o<r;o++)-1===t.indexOf(o)&&n.push(e[o]);return[n,t.map(t=>e[t])]}function u_(e,t){return function(e,t,n){const r=e.length+t.length,o=[];let i=0,a=0;for(let s=0;s<r;s++)-1===n.indexOf(s)?o.push(e[i++]):o.push(t[a++]);return o}(e,t.map(e=>1),t)}function p_(e,t,n){Md(s_(t,n),()=>`${e} supports only inner-most axes for now. Got axes ${t} and rank-${n} input.`)}function c_(e,t){if(s_(e,t))return null;const n=[];for(let r=0;r<t;++r)-1===e.indexOf(r)&&n.push(r);return e.forEach(e=>n.push(e)),n}function d_(e){return e.map((e,t)=>[t,e]).sort((e,t)=>e[1]-t[1]).map(e=>e[0])}function h_(e,t){const n=[];for(let r=t-e;r<t;++r)n.push(r);return n}const f_=Iy({square_:function(e){const t=ky(e,"x","square");return $y.runKernel("Square",{x:t},{})}}),g_=Iy({moments_:function(e,t=null,n=!1){const r=zd(t,(e=ky(e,"x","moments")).shape),o=i_(e,r,n);let i=o.shape;n||(i=u_(o.shape,r));const a=f_(J$(hb(e,"float32"),u$(o,i)));return{mean:o,variance:i_(a,r,n)}}}),m_=Iy({neg_:function(e){const t={x:ky(e,"x","neg")};return $y.runKernel(ig,t)}}
vendor: 5,565 bytes, line 2
2),y_=Iy({notEqual_:function(e,t){let n=ky(e,"a","notEqual","string_or_numeric"),r=ky(t,"b","notEqual","string_or_numeric");[n,r]=cy(n,r),D$(n.shape,r.shape);const o={a:n,b:r};return $y.runKernel(ag,o)}}),b_=Iy({oneHot_:function(e,t,n=1,r=0){if(t<2)throw new Error(`Error in oneHot: depth must be >=2, but it is ${t}`);const o={indices:ky(e,"indices","oneHot","int32")},i={depth:t,onValue:n,offValue:r};return $y.runKernel(cg,o,i)}});function $_(e,t="float32"){if("complex64"===t){const t=$_(e,"float32"),n=$_(e,"float32");return Ty(t,n)}const n=nh(Bd(e),t);return $y.makeTensor(n,e,t)}function __(e,t="float32"){if("complex64"===t){const t=__(e,"float32"),n=$_(e,"float32");return Ty(t,n)}const n=th(Bd(e),t);return $y.makeTensor(n,e,t)}const w_=Iy({onesLike_:function(e){const t={x:ky(e,"x","onesLike")};return $y.runKernel(pg,t)}}),x_=Iy({pad_:function(e,t,n=0){const r=ky(e,"x","pad");if(0===r.rank)throw new Error("pad(scalar) is not defined. Pass non-scalar to pad");const o={paddings:t,constantValue:n},i={x:r};return $y.runKernel(hg,i,o)}}),S_=Iy({prelu_:function(e,t){const n={x:ky(e,"x","prelu"),alpha:ky(t,"alpha","prelu")};return $y.runKernel(gg,n)}});var v_=__webpack_require__(391);class k_{constructor(e,t,n,r,o){this.mean=e,this.stdDev=t,this.dtype=n,this.nextVal=NaN,this.truncated=r,this.truncated&&(this.upper=this.mean+2*this.stdDev,this.lower=this.mean-2*this.stdDev);const i=o||Math.random();this.random=v_.alea(i.toString())}nextValue(){if(!isNaN(this.nextVal)){const e=this.nextVal;return this.nextVal=NaN,e}let e,t,n=!1;for(;!n;){let r,o,i;do{r=2*this.random()-1,o=2*this.random()-1,i=r*r+o*o}while(i>=1||0===i);const a=Math.sqrt(-2*Math.log(i)/i);e=this.mean+this.stdDev*r*a,t=this.mean+this.stdDev*o*a,this.truncated&&!this.isValidTruncated(e)||(n=!0)}return this.truncated&&!this.isValidTruncated(t)||(this.nextVal=this.convertValue(t)),this.convertValue(e)}convertValue(e){return null==this.dtype||"float32"===this.dtype?e:Math.round(e)}isValidTruncated(e){return e<=this.upper&&e>=this.lower}}class E_{constructor(e=0,t=1,n,r){if(this.canReturnFloat=()=>null==this.dtype||"float32"===this.dtype,this.min=e,this.range=t-e,this.dtype=n,null==r&&(r=Math.random()),"number"==typeof r&&(r=r.toString()),!this.canReturnFloat()&&this.range<=1)throw new Error(`The difference between ${e} - ${t} <= 1 and dtype is not float`);this.random=v_.alea(r)}convertValue(e){return this.canReturnFloat()?e:Math.round(e)}nextValue(){return this.convertValue(this.min+this.range*this.random())}}const I_=Iy({randomNormal_:function(e,t=0,n=1,r,o){if(null!=r&&"bool"===r)throw new Error(`Unsupported data type ${r}`);const i=new k_(t,n,r,!1,o),a=db(e,r);for(let e=0;e<a.values.length;e++)a.values[e]=i.nextValue();return a.toTensor()}}),T_=Iy({randomUniform_:function(e,t=0,n=1,r="float32",o){const i=db(e,r),a=new E_(t,n,null,o);for(let e=0;e<i.values.length;e++)i.values[e]=a.nextValue();return i.toTensor()}}),F_=Iy({relu_:function(e){const t={x:ky(e,"x","relu")};return $y.runKernel(_g,t)}}),N_=Iy({reverse_:function(e,t){const n={x:ky(e,"x","reverse")},r={dims:t};return $y.runKernel(Ig,n,r)}}),j_=Iy({selu_:function(e){const t={x:ky(e,"x","selu")};return $y.runKernel(Ag,t)}}),A_=Iy({separableConv2d_:function(e,t,n,r,o,i=[1,1],a="NHWC"){const s=ky(e,"x","separableConv2d"),l=ky(t,"depthwiseFilter","separableConv2d"),u=ky(n,"pointwiseFilter","separableConv2d");let p=s,c=!1;if(3===s.rank&&(c=!0,p=u$(s,[1,s.shape[0],s.shape[1],s.shape[2]])),"NCHW"===a)throw new Error("separableConv2d currently does not support dataFormat NCHW; only NHWC is supported");Md(4===p.rank,()=>`Error in separableConv2d: input must be rank 4, but got rank ${p.rank}.`),Md(4===l.rank,()=>`Error in separableConv2d: depthwise filter must be rank 4, but got rank ${l.rank}.`),Md(4===u.rank,()=>`Error in separableConv2d: pointwise filter must be rank 4, but got rank ${l.rank}.`),Md(1===u.shape[0],()=>`Error in separableConv2d: the first dimension of pointwise filter  must be 1, but got ${u.shape[0]}.`),Md(1===u.shape[1],()=>`Error in separableConv2d: the second dimension of pointwise filter must be 1, but got ${u.shape[1]}.`);const d=l.shape[2],h=l.shape[3];Md(u.shape[2]===d*h,()=>`Error in separableConv2d: the third dimension of pointwise filter must be ${d*h}, but got ${u.shape[2]}.`);const f=F$(p,l,r,o,a,i),g=x$(f,u,1,"valid",a);return c?u$(g,[g.shape[1],g.shape[2],g.shape[3]]):g}}),C_=Iy({sigmoid_:function(e){const t={x:ky(e,"x","sigmoid","float32")};return $y.runKernel(Rg,t)}}),M_=Iy({slice_:function(e,t,n){const r=ky(e,"x","slice","string_or_numeric");if(0===r.rank)throw new Error("Slicing scalar is not possible");const o={x:r},i={begin:t,size:n};return $y.runKernel(Cg,o,i)}}),D_=Iy({slice1d_:function(e,t,n){const r=ky(e,"x","slice1d");return Md(1===r.rank,()=>`slice1d expects a rank-1 tensor, but got a rank-${r.rank} tensor`),M_(r,[t],[n])}}),O_=Iy({slice2d_:function(e,t,n){const r=ky(e,"x","slice2d");return Md(2===r.rank,()=>`slice2d expects a rank-2 tensor, but got a rank-${r.rank} tensor`),M_(r,t,n)}}),R_=Iy({slice3d_:function(e,t,n){const r=ky(e,"x","slice3d");return Md(3===r.rank,()=>`slice3d expects a rank-3 tensor, but got a rank-${r.rank} tensor`),M_(r,t,n)}}),B_=Iy({slice4d_:function(e,t,n){const r=ky(e,"x","slice4d");return Md(4===r.rank,()=>`slice4d expects a rank-4 tensor, but got a rank-${r.rank} tensor`),M_(r,t,n)}}),P_=Iy({softmax_:function(e,t=-1){const n=ky(e,"logits","softmax","float32");if(-1===t&&(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}
2 and dim was ${t}`);const r={logits:n},o={dim:t};return $y.runKernel(zg,r,o)}}),L_=Iy({softplus_:function(e){const t={x:ky(e,"x","softplus")};return $y.runKernel(Bg,t)}}),W_=Iy({split_:function(e,t,n=0){const r={x:ky(e,"x","split")},o={numOrSizeSplits:t,axis:n};return $y.runKernel(Ug,r,o)}}),U_=Iy({sqrt_:function(e){const t={x:ky(e,"x","sqrt","float32")};return $y.runKernel(Pg,t)}}),z_=Iy({squeeze_:function(e,t){const n=ky(e,"x","squeeze");return u$(n,function(e,t){const n=[],r=[],o=null!=t&&Array.isArray(t)&&0===t.length,i=null==t||o?null:zd(t,e).sort();let a=0;for(let t=0;t<e.length;++t){if(null!=i){if(i[a]===t&&1!==e[t])throw new Error(`Can't squeeze axis ${t} since its dim '${e[t]}' is not 1`);(null==i[a]||i[a]>t)&&1===e[t]&&(n.push(e[t]),r.push(t)),i[a]<=t&&a++}1!==e[t]&&(n.push(e[t]),r.push(t))}return{newShape:n,keptDims:r}}(n.shape,t).newShape)}}),V_=Iy({stack_:function(e,t=0){const n=Ey(e,"tensors","stack","string_or_numeric");Md(n.length>=1,()=>"Pass at least one tensor to tf.stack"),n.length>0&&Md(t<=n[0].rank,()=>"Axis must be <= rank of the tensor");const r=n,o={axis:t};return $y.runKernel(dg,r,o)}}),H_=Iy({tanh_:function(e){const t={x:ky(e,"x","tanh","float32")};return $y.runKernel(rm,t)}});function G_(e,t){Od(e);const n=xy(e,t);if(1!==n.length)throw new Error("tensor1d() requires values to be a flat/TypedArray");return Fy(e,null,n,t)}function q_(e,t,n){if(Od(e),null!=t&&2!==t.length)throw new Error("tensor2d() requires shape to have two numbers");const r=xy(e,n);if(2!==r.length&&1!==r.length)throw new Error("tensor2d() requires values to be number[][] or flat/TypedArray");if(1===r.length&&null==t)throw new Error("tensor2d() requires shape to be provided when `values` are a flat/TypedArray");return Fy(e,t,r,n)}const K_=Iy({truncatedNormal_:function(e,t=0,n=1,r,o){if(null!=r&&"bool"===r)throw new Error("Unsupported data type $ { dtype }");const i=new k_(t,n,r,!0,o),a=db(e,r);for(let e=0;e<a.values.length;e++)a.values[e]=i.nextValue();return a.toTensor()}}),X_=Iy({unstack_:function(e,t=0){const n=ky(e,"x","unstack","string_or_numeric");Md(t>=-n.shape.length&&t<n.shape.length,()=>`Axis = ${t} is not in [-${n.shape.length}, ${n.shape.length})`);const r={value:n},o={axis:t};return $y.runKernel(um,r,o)}}),Y_=Iy({broadcastTo_:function(e,t){let n=ky(e,"broadcastTo","x");const r=n.shape;if(t.some(e=>!(e>0)||e%1!=0))throw new Error(`broadcastTo(): Invalid broadcast shape [${t}].`);if(t.length<n.rank)throw new Error(`broadcastTo(): shape.length=${t.length} < input.rank=${n.rank}.`);if(t.length>n.rank){const e=n.shape.slice();for(;e.length<t.length;)e.unshift(1);n=u$(n,e)}const o=n.shape,i=Array.from(t);for(let e=t.length-1;e>=0;e--)if(o[e]===t[e])i[e]=1;else if(1!==n.shape[e])throw new Error(`broadcastTo(): [${r}] cannot be broadcast to [${t}].`);if(0===i.map((e,t)=>e>1?t:-1).filter(e=>e>=0).length)return fb(n);const a={x:n},s={reps:i};return $y.runKernel(om,a,s)}}),J_=Iy({where_:function(e,t,n){const r=ky(t,"a","where"),o=ky(n,"b","where"),i=ky(e,"condition","where","bool"),a=D$(D$(i.shape,r.shape),o.shape),s={condition:Y_(i,a),t:Y_(r,a),e:Y_(o,a)};return $y.runKernel(jg,s)}}),Z_=Iy({zerosLike_:function(e){const t={x:ky(e,"x","zerosLike")};return $y.runKernel(cm,t)}}),Q_=Iy({transpose_:function(e,t){const n=ky(e,"x","transpose");if(null==t&&(t=n.shape.map((e,t)=>t).reverse()),Md(n.rank===t.length,()=>`Error in transpose: rank of input ${n.rank} must match length of perm ${t}.`),t.forEach(e=>{Md(e>=0&&e<n.rank,()=>"All entries in 'perm' must be between 0 and "+(n.rank-1)+` but got ${t}`)}),n.rank<=1)return n.clone();const r={x:n},o={perm:t};return $y.runKernel(sm,r,o)}}),ew=Iy({dropout_:function(e,t,n,r){const o=ky(e,"x","dropout");if(Md("float32"===o.dtype,()=>`x has to be a floating point tensor since it's going to be scaled, but got a ${o.dtype} tensor instead.`),Md(t>=0&&t<1,()=>`rate must be a float in the range [0, 1), but got ${t}.`),0===t)return e instanceof ny?o.clone():o;const i=function(e,t){if(null==t)return e.shape.slice();if(Pd(e.shape,t))return t;if(e.shape.length===t.length){const n=[];for(let r=0;r<e.shape.length;r++)null==t[r]&&null!=e.shape[r]?n.push(e.shape[r]):n.push(t[r]);return n}return t}(o,n),a=1-t,s=j$(U$(Gb(T_(i,0,1,"float32",r),a)),a);return Y$(o,s)}}),tw=Iy({imag_:function(e){const t={input:ky(e,"input","imag")};return $y.runKernel(Nf,t)}}),nw=Iy({real_:function(e){const t={input:ky(e,"input","real")};return $y.runKernel(bg,t)}}),rw=Iy({fft_:function(e){Md("complex64"===e.dtype,()=>`The dtype for tf.spectral.fft() must be complex64 but got ${e.dtype}.`);const t={input:e};return $y.runKernel("FFT",t)}}),ow=Iy({rfft_:function(e,t){Md("float32"===e.dtype,()=>`The dtype for rfft() must be real value but got ${e.dtype}`);let n=e.shape[e.shape.length-1];const r=e.size/n;let o;if(null!=t&&t<n){const r=e.shape.map(e=>0),i=e.shape.map(e=>e);i[e.shape.length-1]=t,o=M_(e,r,i),n=t}else if(null!=t&&t>n){const r=e.shape.map(e=>e);r[e.shape.length-1]=t-n,o=y$([e,$_(r)],e.shape.length-1),n=t}else o=e;const i=Z_(o),a=u$(Ty(o,i),[r,n]),s=rw(a),l=Math.floor(n/2)+1,u=nw(s),p=tw(s),c=W_(u,[l,n-l],u.shape.length-1),d=W_(p,[l,n-l],p.shape.length-1),h=o.shape.slice();return h[o.shape.length-1]=l,u$(Ty(c[0],d[0]),h)}}),iw=Iy({ifft_:function(e){Md("complex64"===e.dtype,()=>`The dtype for tf.spectral.ifft() must be complex64 but got ${e.dtype}.`);const t={input:e};return $y.runKernel(Ff,t)}}),aw=Iy({irfft_:function(e){const t=e.shape[e.shape.length-1],n=e.size/t;let r;if(t<=2){const o=u$(e,[n,t]);r=iw(o)}else{const o=[n,2*(t-1)],i=u$(nw(e),[n,t]),a=u$(tw(e),[n,t]),s=N_(M_(i,[0,1],[n,t-2]),1),l=Y$(N_(M_(a,[0,1],[n,t-2]),1),zb(-1)),u=y$([i,s],1),p=y$([a,l],1),c=u$(Ty(u,p),[o[0],o[1]]);r=iw(c)}if(r=nw(r),3===e.rank&&0!==e.shape[0]){const t=r,n=e.shape[0];
2r=u$(r,[n,r.shape[0]/n,r.shape[1]]),t.dispose()}return r}}),sw=Iy({conv2DBackpropFilter_:function(e,t,n,r,o,i="NHWC",a){let s=e;3===e.rank&&(s=u$(e,[1,e.shape[0],e.shape[1],e.shape[2]]));let l=t;3===l.rank&&(l=u$(t,[1,t.shape[0],t.shape[1],t.shape[2]])),Md(4===s.rank,()=>`Error in conv2dDerFilter: input must be rank 4, but got shape ${s.shape}.`),Md(4===l.rank,()=>`Error in conv2dDerFilter: dy must be rank 4, but got shape ${l.shape}.`),Md(4===n.length,()=>`Error in conv2dDerFilter: filterShape must be length 4, but got ${n}.`);const u="NHWC"===i?s.shape[3]:s.shape[1],p="NHWC"===i?l.shape[3]:l.shape[1];Md(u===n[2],()=>`Error in conv2dDerFilter: depth of input ${u}) must match input depth in filter (${n[2]}.`),Md(p===n[3],()=>`Error in conv2dDerFilter: depth of dy (${p}) must match output depth for filter (${n[3]}).`),null!=a&&Md(Ld(o),()=>`Error in conv2dDerFilter: pad must be an integer when using, dimRoundingMode ${a} but got pad ${o}.`);const c={x:s,dy:l},d={strides:r,pad:o,dataFormat:i,dimRoundingMode:a,filterShape:n};return $y.runKernel(Gh,c,d)}}),lw=Iy({relu6_:function(e){const t={x:ky(e,"x","relu6")};return $y.runKernel(Eg,t)}}),uw=Iy({step_:function(e,t=0){const n={x:ky(e,"x","step")},r={alpha:t};return $y.runKernel(dm,n,r)}});function pw(e,t,n){if(null==n||"linear"===n)return e;if("relu"===n)return Y$(e,uw(t));throw new Error(`Cannot compute gradient for fused activation ${n}.`)}function cw(e,t){let n=t;const r=M$(e.shape,t.shape);return r.length>0&&(n=Z$(n,r)),u$(n,e.shape)}function dw(e,t,n,r){if("linear"===t)return e;if("relu"===t)return F_(e);if("elu"===t)return A$(e);if("relu6"===t)return lw(e);if("prelu"===t)return S_(e,n);if("leakyrelu"===t)return G$(e,r);if("sigmoid"===t)return C_(e);throw new Error(`Unknown fused activation ${t}.`)}const hw=(e,t)=>!(e>0)||"linear"===t,fw=Iy({fusedConv2d_:function({x:e,filter:t,strides:n,pad:r,dataFormat:o="NHWC",dilations:i=[1,1],dimRoundingMode:a,bias:s,activation:l="linear",preluActivationWeights:u,leakyreluAlpha:p}){if(l=l||"linear",!1===hw($y.state.gradientDepth,l)){let c=x$(e,t,n,r,o,i,a);return null!=s&&(c=Gb(c,s)),dw(c,l,u,p)}const c=ky(e,"x","conv2d","float32"),d=ky(t,"filter","conv2d","float32");let h=c,f=!1;3===c.rank&&(f=!0,h=u$(c,[1,c.shape[0],c.shape[1],c.shape[2]])),Md(4===h.rank,()=>`Error in fused conv2d: input must be rank 4, but got rank ${h.rank}.`),Md(4===d.rank,()=>`Error in fused conv2d: filter must be rank 4, but got rank ${d.rank}.`),null!=a&&Md(Ld(r),()=>`Error in fused conv2d: pad must be an integer when using, dimRoundingMode ${a} but got pad ${r}.`),Md(h.shape[3]===d.shape[2],()=>`Error in conv2d: depth of input (${h.shape[3]}) must match input depth for filter ${d.shape[2]}.`),Md(s$(n,i),()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${n} and dilations '${i}'`),Md("NHWC"===o,()=>`Error in conv2d: got dataFormat of ${o} but only NHWC is currently supported.`);const g=Qb(h.shape,d.shape,n,i,r,a);let m,y;null!=s&&(m=ky(s,"bias","fused conv2d"),[m]=cy(m,c),D$(g.outShape,m.shape)),null!=u&&(y=ky(u,"prelu weights","fused conv2d"));const b=(e,t)=>{const[o,a,s,u]=t,p=pw(e,s,l);Md(a$(i),()=>`Error in gradient of fused conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${i}'`);const c=[v$(a.shape,p,o,n,r),sw(a,p,o.shape,n,r)];if(null!=u){const e=cw(u,p);c.push(e)}return c},$={x:h,filter:d,bias:m,preluActivationWeights:y},_={strides:n,pad:r,dataFormat:o,dilations:i,dimRoundingMode:a,activation:l,leakyreluAlpha:p};if(null==s){const e=Ub((e,t,n)=>{let r=$y.runKernel(mm,$,_);return n([t,e,r]),f&&(r=u$(r,[r.shape[1],r.shape[2],r.shape[3]])),{value:r,gradFunc:b}});return e(h,d)}{const e=Ub((e,t,n,r)=>{let o=$y.runKernel(mm,$,_);return r([t,e,o,n]),f&&(o=u$(o,[o.shape[1],o.shape[2],o.shape[3]])),{value:o,gradFunc:b}});return e(h,d,m)}}}),gw=Iy({depthwiseConv2dNativeBackpropFilter_:function(e,t,n,r,o,i=[1,1],a){let s=e;3===e.rank&&(s=u$(e,[1,e.shape[0],e.shape[1],e.shape[2]]));let l=t;3===l.rank&&(l=u$(t,[1,t.shape[0],t.shape[1],t.shape[2]]));const u={x:s,dy:l},p={strides:r,pad:o,dimRoundingMode:a,dilations:i,filterShape:n};return $y.runKernel(of,u,p)}}),mw=Iy({depthwiseConv2dNativeBackpropInput_:function(e,t,n,r,o,i=[1,1],a){let s=t,l=!1;3===t.rank&&(l=!0,s=u$(t,[1,t.shape[0],t.shape[1],t.shape[2]]));const u={dy:s,filter:n},p={strides:r,pad:o,dimRoundingMode:a,dilations:i,inputShape:e},c=$y.runKernel(af,u,p);return l?u$(c,[c.shape[1],c.shape[2],c.shape[3]]):c}}),yw=Iy({fusedDepthwiseConv2d_:function({x:e,filter:t,strides:n,pad:r,dataFormat:o="NHWC",dilations:i=[1,1],dimRoundingMode:a,bias:s,activation:l="linear",preluActivationWeights:u,leakyreluAlpha:p}){if(!1===hw($y.state.gradientDepth,l)){let c=F$(e,t,n,r,o,i,a);return null!=s&&(c=Gb(c,s)),dw(c,l,u,p)}const c=ky(e,"x","depthwiseConv2d","float32"),d=ky(t,"filter","depthwiseConv2d","float32");let h=c,f=!1;3===c.rank&&(f=!0,h=u$(c,[1,c.shape[0],c.shape[1],c.shape[2]])),Md(4===h.rank,()=>`Error in fused depthwiseConv2d: input must be rank 4, but got rank ${h.rank}.`),Md(4===d.rank,()=>`Error in fused depthwiseConv2d: filter must be rank 4, but got rank ${d.rank}.`),Md(h.shape[3]===d.shape[2],()=>`Error in fused depthwiseConv2d: number of input channels (${h.shape[3]}) must match the inChannels dimension in filter ${d.shape[2]}.`),null==i&&(i=[1,1]),Md(s$(n,i),()=>`Error in fused depthwiseConv2d: Either strides or dilations must be 1. Got strides ${n} and dilations '${i}'`),null!=a&&Md(Ld(r),()=>`Error in fused depthwiseConv2d: pad must be an integer when using dimRoundingMode ${a} but got pad ${r}.`);const g=Qb(h.shape,d.shape,n,i,r,a,!0);let m,y;null!=s&&(m=ky(s,"bias","fused conv2d"),[m]=cy(m,c),D$(g.outShape,m.shape)),null!=u&&(y=ky(u,"prelu weights","fused depthwiseConv2d"));const b=(e,t)=>
2{Md(a$(i),()=>`Error in gradient of fused depthwiseConv2d: dilation rates greater than 1 are not yet supported. Got dilations '${i}'`);const[o,s,u,p]=t,c=pw(e,u,l),d=mw(s.shape,c,o,n,r,i,a),h=gw(s,c,o.shape,n,r,i,a);return null!=p?[d,h,cw(m,c)]:[d,h]},$={x:h,filter:d,bias:m,preluActivationWeights:y},_={strides:n,pad:r,dataFormat:o,dilations:i,dimRoundingMode:a,activation:l,leakyreluAlpha:p};if(null==s){const e=Ub((e,t,n)=>{let r=$y.runKernel(ym,$,_);return n([t,e,r]),f&&(r=u$(r,[r.shape[1],r.shape[2],r.shape[3]])),{value:r,gradFunc:b}});return e(h,d)}{const e=Ub((e,t,n,r)=>{let o=$y.runKernel(ym,$,_);return r([t,e,o,n]),f&&(o=u$(o,[o.shape[1],o.shape[2],o.shape[3]])),{value:o,gradFunc:b}});return e(h,d,m)}}}),bw=Iy({fusedMatMul_:function({a:e,b:t,transposeA:n=!1,transposeB:r=!1,bias:o,activation:i="linear",preluActivationWeights:a,leakyreluAlpha:s}){if(!1===hw($y.state.gradientDepth,i)){let l=t_(e,t,n,r);return null!=o&&(l=Gb(l,o)),dw(l,i,a,s)}let l=ky(e,"a","fused matMul"),u=ky(t,"b","fused matMul");[l,u]=cy(l,u);const p=n?l.shape[l.rank-2]:l.shape[l.rank-1],c=r?u.shape[u.rank-1]:u.shape[u.rank-2],d=n?l.shape[l.rank-1]:l.shape[l.rank-2],h=r?u.shape[u.rank-2]:u.shape[u.rank-1],f=l.shape.slice(0,-2),g=u.shape.slice(0,-2),m=Bd(f),y=Bd(g);Md(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}.`),Md(Pd(f,g),()=>`Error in fused matMul: outer dimensions (${f}) and (${g}) of Tensors with shapes ${l.shape} and ${u.shape} must match.`),Md(p===c,()=>`Error in fused matMul: inner shapes (${p}) and (${c}) of Tensors with shapes ${l.shape} and ${u.shape} and transposeA=${n} and transposeB=${r} must match.`);const b=l.shape.slice(0,-2).concat([d,h]),$=u$(l,n?[m,p,d]:[m,d,p]),_=u$(u,r?[y,h,c]:[y,c,h]);let w,x;null!=o&&(w=ky(o,"bias","fused matMul"),[w]=cy(w,l),D$(b,w.shape)),null!=a&&(x=ky(a,"prelu weights","fused matMul"));const S=(e,t)=>{const[a,s,l,u]=t,p=pw(u$(e,l.shape),l,i);let c,d;return n||r?!n&&r?(c=t_(p,s,!1,!1),d=t_(p,a,!0,!1)):n&&!r?(c=t_(s,p,!1,!0),d=t_(a,p,!1,!1)):(c=t_(s,p,!0,!0),d=t_(p,a,!0,!0)):(c=t_(p,s,!1,!0),d=t_(a,p,!0,!1)),null!=o?[c,d,cw(u,p)]:[c,d]},v={a:$,b:_,bias:w,preluActivationWeights:x},k={transposeA:n,transposeB:r,activation:i,leakyreluAlpha:s};if(null==o){const e=Ub((e,t,n)=>{const r=$y.runKernel(gm,v,k);return n([e,t,r]),{value:u$(r,b),gradFunc:S}});return e($,_)}{const e=Ub((e,t,n,r)=>{const o=$y.runKernel(gm,v,k);return r([e,t,o,n]),{value:u$(o,b),gradFunc:S}});
vendor: 11,305 bytes, line 2
2return e($,_,w)}}});function $w(e,t,n){const r=1-e%2,o=new Float32Array(e);for(let i=0;i<e;++i){const a=2*Math.PI*i/(e+r-1);o[i]=t-n*Math.cos(a)}return G_(o,"float32")}Iy({hammingWindow_:function(e){return $w(e,.54,.46)}});const _w=Iy({hannWindow_:function(e){return $w(e,.5,.5)}}),ww=Iy({frame_:function(e,t,n,r=!1,o=0){let i=0;const a=[];for(;i+t<=e.size;)a.push(M_(e,i,t)),i+=n;if(r)for(;i<e.size;){const r=i+t-e.size,s=y$([M_(e,i,t-r),W$([r],o)]);a.push(s),i+=n}return 0===a.length?q_([],[0,t]):u$(y$(a),[a.length,t])}});Iy({stft_:function(e,t,n,r,o=_w){var i;null==r&&(i=t,r=Math.floor(Math.pow(2,Math.ceil(Math.log(i)/Math.log(2)))));const a=ww(e,t,n),s=Y$(a,o(t));return ow(s,r)}});const xw=Iy({cropAndResize_:function(e,t,n,r,o="bilinear",i=0){const a=ky(e,"image","cropAndResize"),s=ky(t,"boxes","cropAndResize","float32"),l=ky(n,"boxInd","cropAndResize","int32"),u=s.shape[0];Md(4===a.rank,()=>`Error in cropAndResize: image must be rank 4,but got rank ${a.rank}.`),Md(2===s.rank&&4===s.shape[1],()=>`Error in cropAndResize: boxes must be have size [${u},4] but had shape ${s.shape}.`),Md(1===l.rank&&l.shape[0]===u,()=>`Error in cropAndResize: boxInd must be have size [${u}] but had shape ${s.shape}.`),Md(2===r.length,()=>`Error in cropAndResize: cropSize must be of length 2, but got length ${r.length}.`),Md(r[0]>=1&&r[1]>=1,()=>`cropSize must be atleast [1,1], but was ${r}`),Md("bilinear"===o||"nearest"===o,()=>`method must be bilinear or nearest, but was ${o}`);const p={image:a,boxes:s,boxInd:l},c={method:o,extrapolationValue:i,cropSize:r};return $y.runKernel(ef,p,c)}}),Sw=Iy({flipLeftRight_:function(e){const t=ky(e,"image","flipLeftRight","float32");Md(4===t.rank,()=>`Error in flipLeftRight: image must be rank 4,but got rank ${t.rank}.`);const n={image:t};return $y.runKernel(_f,n,{})}}),vw=Iy({grayscaleToRGB_:function(e){const t=ky(e,"image","grayscaleToRGB"),n=t.rank-1,r=t.shape[n];Md(t.rank>=2,()=>`Error in grayscaleToRGB: images must be at least rank 2, but got rank ${t.rank}.`),Md(1===r,()=>`Error in grayscaleToRGB: last dimension of a grayscale image should be size 1, but got size ${r}.`);const o=new Array(t.rank);return o.fill(1,0,n),o[n]=3,P$(t,o)}}),kw=Iy({rotateWithOffset_:function(e,t,n=0,r=.5){const o=ky(e,"image","rotateWithOffset","float32");Md(4===o.rank,()=>`Error in rotateWithOffset: image must be rank 4,but got rank ${o.rank}.`);const i={image:o},a={radians:t,fillValue:n,center:r};return $y.runKernel(fm,i,a)}});function Ew(e,t,n,r,o,i){null==r&&(r=.5),null==o&&(o=Number.NEGATIVE_INFINITY),null==i&&(i=0);const a=e.shape[0];return n=Math.min(n,a),Md(0<=r&&r<=1,()=>`iouThreshold must be in [0, 1], but was '${r}'`),Md(2===e.rank,()=>`boxes must be a 2D tensor, but was of rank '${e.rank}'`),Md(4===e.shape[1],()=>`boxes must have 4 columns, but 2nd dimension was ${e.shape[1]}`),Md(1===t.rank,()=>"scores must be a 1D tensor"),Md(t.shape[0]===a,()=>`scores has incompatible shape with boxes. Expected ${a}, but was ${t.shape[0]}`),Md(0<=i&&i<=1,()=>`softNmsSigma must be in [0, 1], but was '${i}'`),{maxOutputSize:n,iouThreshold:r,scoreThreshold:o,softNmsSigma:i}}const Iw=Iy({nonMaxSuppression_:function(e,t,n,r=.5,o=Number.NEGATIVE_INFINITY){const i=ky(e,"boxes","nonMaxSuppression","float32"),a=ky(t,"scores","nonMaxSuppression","float32"),s=Ew(i,a,n,r,o),l={maxOutputSize:n=s.maxOutputSize,iouThreshold:r=s.iouThreshold,scoreThreshold:o=s.scoreThreshold};return $y.runKernel(sg,{boxes:i,scores:a},l)}});function Tw(e,t,n){const r=function(e,t,n){return function(e,t,n){let r=0,o=e.length,i=0,a=!1;for(;r<o;){i=r+(o-r>>>1);const s=n(t,e[i]);s>0?r=i+1:(o=i,a=!s)}return a?r:-r-1}(e,t,n||Fw)}(e,t,n),o=r<0?-(r+1):r;e.splice(o,0,t)}function Fw(e,t){return e>t?1:e<t?-1:0}function Nw(e,t,n,r,o){return Cw(e,t,n,r,o,0)}function jw(e,t,n,r,o,i){return Cw(e,t,n,r,o,0,!1,i,!0)}function Aw(e,t,n,r,o,i){return Cw(e,t,n,r,o,i,!0)}function Cw(e,t,n,r,o,i,a=!1,s=!1,l=!1){const u=[];for(let e=0;e<t.length;e++)t[e]>o&&u.push({score:t[e],boxIndex:e,suppressBeginIndex:0});u.sort(Ow);const p=i>0?-.5/i:0,c=[],d=[];for(;c.length<n&&u.length>0;){const t=u.pop(),{score:n,boxIndex:i,suppressBeginIndex:a}=t;if(n<o)break;let s=!1;for(let n=c.length-1;n>=a;--n){const a=Mw(e,i,c[n]);if(a>=r){s=!0;break}if(t.score=t.score*Dw(r,p,a),t.score<=o)break}t.suppressBeginIndex=c.length,s||(t.score===n?(c.push(i),d.push(t.score)):t.score>o&&Tw(u,t,Ow))}const h=c.length,f=n-h;s&&f>0&&(c.push(...new Array(f).fill(0)),d.push(...new Array(f).fill(0)));const g={selectedIndices:c};return a&&(g.selectedScores=d),l&&(g.validOutputs=h),g}function Mw(e,t,n){const r=e.subarray(4*t,4*t+4),o=e.subarray(4*n,4*n+4),i=Math.min(r[0],r[2]),a=Math.min(r[1],r[3]),s=Math.max(r[0],r[2]),l=Math.max(r[1],r[3]),u=Math.min(o[0],o[2]),p=Math.min(o[1],o[3]),c=Math.max(o[0],o[2]),d=Math.max(o[1],o[3]),h=(s-i)*(l-a),f=(c-u)*(d-p);if(h<=0||f<=0)return 0;const g=Math.max(i,u),m=Math.max(a,p),y=Math.min(s,c),b=Math.min(l,d),$=Math.max(y-g,0)*Math.max(b-m,0);return $/(h+f-$)}function Dw(e,t,n){const r=Math.exp(t*n*n);return n<=e?r:0}function Ow(e,t){return e.score-t.score||e.score===t.score&&t.boxIndex-e.boxIndex}const Rw=Iy({nonMaxSuppressionWithScore_:function(e,t,n,r=.5,o=Number.NEGATIVE_INFINITY,i=0){const a=ky(e,"boxes","nonMaxSuppression"),s=ky(t,"scores","nonMaxSuppression"),l=Ew(a,s,n,r,o,i),u={boxes:a,scores:s},p={maxOutputSize:n=l.maxOutputSize,iouThreshold:r=l.iouThreshold,scoreThreshold:o=l.scoreThreshold,softNmsSigma:i=l.softNmsSigma},c=$y.runKernel(ug,u,p);return{selectedIndices:c[0],selectedScores:c[1]}}}),Bw=Iy({nonMaxSuppressionPadded_:function(e,t,n,r=.5,o=Number.NEGATIVE_INFINITY,i=!1){const a=ky(e,"boxes","nonMaxSuppression"),s=ky(t,"scores","nonMaxSuppression"),l=Ew(a,s,n,r,o,null),u={boxes:a,scores:s},p={maxOutputSize:l.maxOutputSize,iouThreshold:l.iouThreshold,scoreThreshold:l.scoreThreshold,padToMaxOutputSize:i},c=$y.runKernel(lg,u,p);return{selectedIndices:c[0],validOutputs:c[1]}}}),Pw=Iy({resizeBilinear_:function(e,t,n=!1,r=!1){const o=ky(e,"images","resizeBilinear");Md(3===o.rank||4===o.rank,()=>`Error in resizeBilinear: x must be rank 3 or 4, but got rank ${o.rank}.`),Md(2===t.length,()=>`Error in resizeBilinear: new shape must 2D, but got shape ${t}.`),Md(!1===r||!1===n,()=>"Error in resizeBilinear: If halfPixelCenters is true, alignCorners must be false.");let i=o,a=!1;3===o.rank&&(a=!0,i=u$(o,[1,o.shape[0],o.shape[1],o.shape[2]]));const[]=t,s={images:i},l={alignCorners:n,halfPixelCenters:r,size:t},u=$y.runKernel(vg,s,l);return a?u$(u,[u.shape[1],u.shape[2],u.shape[3]]):u}}),Lw=Iy({resizeNearestNeighbor_:function(e,t,n=!1,r=!1){const o=ky(e,"images","resizeNearestNeighbor");Md(3===o.rank||4===o.rank,()=>`Error in resizeNearestNeighbor: x must be rank 3 or 4, but got rank ${o.rank}.`),Md(2===t.length,()=>`Error in resizeNearestNeighbor: new shape must 2D, but got shape ${t}.`),Md("float32"===o.dtype||"int32"===o.dtype,()=>"`images` must have `int32` or `float32` as dtype"),Md(!1===r||!1===n,()=>"Error in resizeNearestNeighbor: If halfPixelCenters is true, alignCorners must be false.");let i=o,a=!1;3===o.rank&&(a=!0,i=u$(o,[1,o.shape[0],o.shape[1],o.shape[2]]));const[]=t,s={images:i},l={alignCorners:n,halfPixelCenters:r,size:t},u=$y.runKernel(xg,s,l);return a?u$(u,[u.shape[1],u.shape[2],u.shape[3]]):u}}),Ww=Iy({bincount_:function(e,t,n){const r=ky(e,"x","bincount"),o=ky(t,"weights","bincount");Md("int32"===r.dtype,()=>`Error in bincount: input dtype must be int32, but got ${r.dtype}`),Md(n>=0,()=>`size must be non-negative, but got ${n}.`),Md(o.size===r.size||0===o.size,()=>`Error in bincount: weights must have the same size as input or0-length, but got input shape: ${r.shape}, weights shape: ${o.shape}.`);const i={x:r,weights:o},a={size:n};return $y.runKernel(Rh,i,a)}}),Uw=Iy({lessEqual_:function(e,t){let n=ky(e,"a","lessEqual","string_or_numeric"),r=ky(t,"b","lessEqual","string_or_numeric");[n,r]=cy(n,r),D$(n.shape,r.shape);const o={a:n,b:r};return $y.runKernel(Of,o)}}),zw=Iy({round_:function(e){const t={x:ky(e,"x","round")};return $y.runKernel(Tg,t)}});function Vw(e,t,n=1,r="float32"){if(0===n)throw new Error("Cannot have a step of zero");const o={start:e,stop:t,step:n,dtype:r};return $y.runKernel(yg,{},o)}const Hw=Iy({threshold_:function(e,t="binary",n=!1,r=.5){const o=ky(e,"image","threshold"),i=o.shape[0]*o.shape[1];let a,s,l,u,p=Y$(G_([r]),255);if(Md(3===o.rank,()=>`Error in threshold: image must be rank 3,but got rank ${o.rank}.`),Md(3===o.shape[2]||1===o.shape[2],()=>`Error in threshold: image color channel must be equal to 3 or 1but got ${o.shape[2]}.`),Md("int32"===o.dtype||"float32"===o.dtype,()=>`Error in dtype: image dtype must be int32 or float32,but got dtype ${o.dtype}.`),Md("otsu"===t||"binary"===t,()=>`Method must be binary or otsu, but was ${t}`),3===o.shape[2]){[a,s,l]=W_(o,[1,1,1],-1);const e=Y$(a,.2989),t=Y$(s,.587),n=Y$(l,.114);u=Gb(Gb(e,t),n)}else u=e;"otsu"===t&&(p=function(e,t){let n,r,o,i,a,s,l=G_([-1]),u=G_([0]),p=G_([0]);for(let c=0;c<e.size-1;c++){n=M_(e,0,c+1),r=M_(e,c+1),a=j$(Z$(n),t),s=j$(Z$(r),t);const d=Z$(Y$(n,Vw(0,n.size)));o=j$(d,Z$(n));const h=W$(r.shape,n.size),f=Gb(Vw(0,r.size),h),g=Y$(r,f);i=j$(Z$(g),Z$(r));const m=J$(o,i),y=J$(o,i),b=Y$(a,s);p=Y$(Y$(b,m),y);const $=V$(p,u);u=J_($,p,u),l=J_($,G_([c]),l)}return l}(Ww(hb(zw(u),"int32"),Ny([]),256),i));const c=n?Uw(u,p):V$(u,p);return hb(Y$(c,255),"int32")}}),Gw=Iy({transform_:function(e,t,n="nearest",r="constant",o=0,i){const a=ky(e,"image","transform","float32"),s=ky(t,"transforms","transform","float32");Md(4===a.rank,()=>`Error in transform: image must be rank 4,but got rank ${a.rank}.`),Md(2===s.rank&&(s.shape[0]===a.shape[0]||1===s.shape[0])&&8===s.shape[1],()=>"Error in transform: Input transform should be batch x 8 or 1 x 8"),Md(null==i||2===i.length,()=>`Error in transform: outputShape must be [height, width] or null, but got ${i}.`);const l={image:a,transforms:s},u={interpolation:n,fillMode:r,fillValue:o,outputShape:i};return $y.runKernel(am,l,u)}}),qw=Iy({bandPart_:function(e,t,n){Md(t%1==0,()=>`bandPart(): numLower must be an integer, got ${t}.`),Md(n%1==0,()=>`bandPart(): numUpper must be an integer, got ${n}.`);const r=ky(e,"a","bandPart");Md(r.rank>=2,()=>`bandPart(): Rank must be at least 2, got ${r.rank}.`);const o=r.shape,[i,a]=r.shape.slice(-2);if(!(t<=i))throw new Error(`bandPart(): numLower (${t}) must not be greater than the number of rows (${i}).`);if(!(n<=a))throw new Error(`bandPart(): numUpper (${n}) must not be greater than the number of columns (${a}).`);t<0&&(t=i),n<0&&(n=a);const s=u$(Vw(0,i,1,"int32"),[-1,1]),l=Vw(0,a,1,"int32"),u=J$(s,l),p=e_(Uw(u,zb(+t,"int32")),H$(u,zb(-n,"int32"))),c=$_([i,a],r.dtype);return u$(V_(X_(u$(r,[-1,i,a])).map(e=>J_(p,e,c))),o)}}),Kw=Iy({min_:function(e,t=null,n=!1){const r={x:ky(e,"x","min")},o={axis:t,keepDims:n};return $y.runKernel(Qf,r,o)}}),Xw=Iy({pow_:function(e,t){let n=ky(e,"base","pow"),r=ky(t,"exp","pow");[n,r]=cy(n,r);const o={a:n,b:r};return $y.runKernel(fg,o)}});function Yw(e,t,n=null){if(0===e.rank)return Hb(e);if(1!==e.rank&&null===n)return Yw(u$(e,[-1]),t,n);if(1===e.rank||"number"==typeof n||Array.isArray(n)&&1===n.length){if(1===t)return Z$(Hb(e),n);if(t===1/0)return X$(Hb(e),n);if(t===-1/0)return Kw(Hb(e),n);if("euclidean"===t||2===t)return U_(Z$(Xw(Hb(e),zb(2,"int32")),n)
vendor: 8,617 bytes, line 2
2);throw new Error(`Error in norm: invalid ord value: ${t}`)}if(Array.isArray(n)&&2===n.length){if(1===t)return X$(Z$(Hb(e),n[0]),n[1]-1);if(t===1/0)return X$(Z$(Hb(e),n[1]),n[0]);if(t===-1/0)return Kw(Z$(Hb(e),n[1]),n[0]);if("fro"===t||"euclidean"===t)return U_(Z$(f_(e),n));throw new Error(`Error in norm: invalid ord value: ${t}`)}throw new Error(`Error in norm: invalid axis: ${n}`)}const Jw=Iy({norm_:function(e,t="euclidean",n=null,r=!1){const o=Yw(e=ky(e,"x","norm"),t,n);let i=o.shape;if(r){const t=zd(n,e.shape);i=u_(o.shape,t)}return u$(o,i)}}),Zw=Iy({gramSchmidt_:function(e){let t;if(Array.isArray(e)){t=!1,Md(null!=e&&e.length>0,()=>"Gram-Schmidt process: input must not be null, undefined, or empty");const n=e[0].shape[0];for(let t=1;t<e.length;++t)Md(e[t].shape[0]===n,()=>`Gram-Schmidt: Non-unique lengths found in the input vectors: (${e[t].shape[0]} vs. ${n})`)}else t=!0,e=W_(e,e.shape[0],0).map(e=>z_(e,[0]));Md(e.length<=e[0].shape[0],()=>`Gram-Schmidt: Number of vectors (${e.length}) exceeds number of dimensions (${e[0].shape[0]}).`);const n=[],r=e;for(let t=0;t<e.length;++t)n.push($y.tidy(()=>{let e=r[t];if(t>0)for(let r=0;r<t;++r){const t=Y$(Z$(Y$(n[r],e)),n[r]);e=J$(e,t)}return j$(e,Jw(e,"euclidean"))}));return t?V_(n,0):n}});function Qw(e,t=!1){return $y.tidy(()=>{Md(2===e.shape.length,()=>`qr2d() requires a 2D Tensor, but got a ${e.shape.length}D Tensor.`);const n=e.shape[0],r=e.shape[1];let o=L$(n),i=fb(e);const a=q_([[1]],[1,1]);let s=fb(a);const l=n>=r?r:n;for(let e=0;e<l;++e){const t=i,l=s,u=o;[s,i,o]=$y.tidy(()=>{const t=M_(i,[e,e],[n-e,1]),l=Jw(t),u=M_(i,[e,e],[1,1]),p=J_(V$(u,0),q_([[-1]]),q_([[1]])),c=J$(u,Y$(p,l)),d=j$(t,c);s=1===d.shape[0]?fb(a):y$([a,M_(d,[1,0],[d.shape[0]-1,d.shape[1]])],0);const h=m_(j$(t_(p,c),l)),f=M_(i,[e,0],[n-e,r]),g=Y$(h,s),m=Q_(s);if(0===e)i=J$(f,t_(g,t_(m,f)));else{const t=J$(f,t_(g,t_(m,f)));i=y$([M_(i,[0,0],[e,r]),t],0)}const y=Q_(g),b=M_(o,[0,e],[n,o.shape[1]-e]);if(0===e)o=J$(b,t_(t_(b,s),y));else{const t=J$(b,t_(t_(b,s),y));o=y$([M_(o,[0,0],[n,e]),t],1)}return[s,i,o]}),Pb([t,l,u])}return!t&&n>r&&(o=M_(o,[0,0],[n,r]),i=M_(i,[0,0],[r,r])),[o,i]})}const ex=Iy({qr_:function(e,t=!1){if(Md(e.rank>=2,()=>`qr() requires input tensor to have a rank >= 2, but got rank ${e.rank}`),2===e.rank)return Qw(e,t);{const n=e.shape.slice(0,e.shape.length-2).reduce((e,t)=>e*t),r=X_(u$(e,[n,e.shape[e.shape.length-2],e.shape[e.shape.length-1]]),0),o=[],i=[];return r.forEach(e=>{const[n,r]=Qw(e,t);o.push(n),i.push(r)}),[u$(V_(o,0),e.shape),u$(V_(i,0),e.shape)]}}});var tx;!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"}(tx||(tx={}));const nx=Iy({computeWeightedLoss_:function(e,t,n=tx.SUM_BY_NONZERO_WEIGHTS){const r=ky(e,"losses","computeWeightedLoss");let o=null;null!=t&&(o=ky(t,"weights","computeWeightedLoss"));const i=null==o?r:Y$(r,o);if(n===tx.NONE)return i;if(n===tx.SUM)return Z$(i);if(n===tx.MEAN){if(null==o)return i_(i);{const e=r.size/o.size,t=j$(Z$(i),Z$(o));return e>1?j$(t,zb(e)):t}}if(n===tx.SUM_BY_NONZERO_WEIGHTS){if(null==o)return j$(Z$(i),zb(r.size));{const e=Y$(o,__(r.shape)),t=hb(Z$(y_(e,zb(0))),"float32");return j$(Z$(i),t)}}throw Error(`Unknown reduction: ${n}`)}});Iy({absoluteDifference_:function(e,t,n,r=tx.SUM_BY_NONZERO_WEIGHTS){const o=ky(e,"labels","absoluteDifference"),i=ky(t,"predictions","absoluteDifference");let a=null;null!=n&&(a=ky(n,"weights","absoluteDifference")),Dd(o.shape,i.shape,"Error in absoluteDifference: ");const s=Hb(J$(o,i));return nx(s,a,r)}}),Iy({cosineDistance_:function(e,t,n,r,o=tx.SUM_BY_NONZERO_WEIGHTS){const i=ky(e,"labels","cosineDistance"),a=ky(t,"predictions","cosineDistance");let s=null;null!=r&&(s=ky(r,"weights","cosineDistance")),Dd(i.shape,a.shape,"Error in cosineDistance: ");const l=zb(1),u=J$(l,Z$(Y$(i,a),n,!0));return nx(u,s,o)}}),Iy({hingeLoss_:function(e,t,n,r=tx.SUM_BY_NONZERO_WEIGHTS){let o=ky(e,"labels","hingeLoss");const i=ky(t,"predictions","hingeLoss");let a=null;null!=n&&(a=ky(n,"weights","hingeLoss")),Dd(o.shape,i.shape,"Error in hingeLoss: ");const s=zb(1);o=J$(Y$(zb(2),o),s);const l=F_(J$(s,Y$(o,i)));return nx(l,a,r)}}),Iy({huberLoss_:function(e,t,n,r=1,o=tx.SUM_BY_NONZERO_WEIGHTS){const i=ky(e,"labels","huberLoss"),a=ky(t,"predictions","huberLoss");let s=null;null!=n&&(s=ky(n,"weights","huberLoss")),Dd(i.shape,a.shape,"Error in huberLoss: ");const l=zb(r),u=Hb(J$(a,i)),p=a_(u,l),c=J$(u,p),d=Gb(Y$(zb(.5),f_(p)),Y$(l,c));return nx(d,s,o)}}),Iy({logLoss_:function(e,t,n,r=1e-7,o=tx.SUM_BY_NONZERO_WEIGHTS){const i=ky(e,"labels","logLoss"),a=ky(t,"predictions","logLoss");let s=null;null!=n&&(s=ky(n,"weights","logLoss")),Dd(i.shape,a.shape,"Error in logLoss: ");const l=zb(1),u=zb(r),p=m_(Y$(i,q$(Gb(a,u)))),c=Y$(J$(l,i),q$(Gb(J$(l,a),u))),d=J$(p,c);return nx(d,s,o)}});const rx=Iy({squaredDifference_:function(e,t){let n=ky(e,"a","squaredDifference"),r=ky(t,"b","squaredDifference");[n,r]=cy(n,r),D$(n.shape,r.shape);const o={a:n,b:r};return $y.runKernel(Xg,o,{})}});Iy({meanSquaredError_:function(e,t,n,r=tx.SUM_BY_NONZERO_WEIGHTS){const o=ky(e,"labels","meanSquaredError"),i=ky(t,"predictions","meanSquaredError");let a=null;null!=n&&(a=ky(n,"weights","meanSquaredError")),Dd(o.shape,i.shape,"Error in meanSquaredError: ");const s=rx(o,i);return nx(s,a,r)}}),Iy({sigmoidCrossEntropy_:function(e,t,n,r=0,o=tx.SUM_BY_NONZERO_WEIGHTS){let i=ky(e,"multiClassLabels","sigmoidCrossEntropy");const a=ky(t,"logits","sigmoidCrossEntropy");let s=null;if(null!=n&&(s=ky(n,"weights","sigmoidCrossEntropy")),Dd(i.shape,a.shape,"Error in sigmoidCrossEntropy: "),r>0){const e=zb(r),t=zb(1),n=zb(.5);i=Gb(Y$(i,J$(t,e)),Y$(n,e))}const l=function(e,t){const n=ky(e,"labels","sigmoidCrossEntropyWithLogits"),r=ky(t,"logits","sigmoidCrossEntropyWithLogits");Dd(n.shape,r.shape,"Error in sigmoidCrossEntropyWithLogits: ");const o=F_(r),i=Y$(r,n),a=K$(R$(m_(Hb(r))));return Gb(J$(o,i),a)}(i,a);return nx(l,s,o)}});const ox=Iy({logSumExp_:function(e,t=null,n=!1){const r=ky(e,"x","logSumExp"),o=zd(t,r.shape),i=X$(r,o,!0),a=J$(r,i),s=R$(a),l=Z$(s,o),u=q$(l),p=Gb(u$(i,u.shape),u);if(n){const e=u_(p.shape,o);return u$(p,e)}return p}});Iy({softmaxCrossEntropy_:function(e,t,n,r=0,o=tx.SUM_BY_NONZERO_WEIGHTS){let i=ky(e,"onehotLabels","softmaxCrossEntropy");const a=ky(t,"logits","softmaxCrossEntropy");let s=null;if(null!=n&&(s=ky(n,"weights","softmaxCrossEntropy")),Dd(i.shape,a.shape,"Error in softmaxCrossEntropy: "),r>0){const e=zb(r),t=zb(1),n=zb(i.shape[1]);i=Gb(Y$(i,J$(t,e)),j$(e,n))}const l=function(e,t,n=-1){if(-1===n&&(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}`);const r=Ub((e,t,r)=>{const o=ox(t,[n],!0),i=J$(hb(t,"float32"),o);r([e,i]);const a=m_(Y$(i,e));return{value:Z$(a,[n]),gradFunc:(e,t)=>{const[r,o]=t,i=u_(e.shape,[n]);return[Y$(u$(e,i),J$(hb(r,"float32"),R$(o))),Y$(u$(e,i),J$(R$(o),hb(r,"float32")))]}}});return r(e,t)}(i,a);return nx(l,s,o)}});const ix=Iy({sparseFillEmptyRows_:function(e,t,n,r){const o=ky(e,"indices","sparseFillEmptyRows"),i=ky(t,"values","sparseFillEmptyRows"),a=ky(n,"denseShape","sparseFillEmptyRows"),s=ky(r,"defaultValue","sparseFillEmptyRows",i.dtype);if(2!==o.rank)throw new Error(`Indices should be Tensor2D but received shape\n        ${o.shape}`);if(1!==i.rank)throw new Error(`Values should be Tensor1D but received shape ${i.shape}`);if(1!==a.rank)throw new Error(`Dense shape should be Tensor1D but received shape ${a.shape}`);if(0!==s.rank)throw new Error(`Default value should be a scalar but received shape ${s.shape}`);const l={indices:o,values:i,denseShape:a,defaultValue:s},u=$y.runKernel(Vg,l);return{outputIndices:u[0],outputValues:u[1],emptyRowIndicator:u[2],reverseIndexMap:u[3]}}}),ax=Iy({sparseReshape_:function(e,t,n){const r=ky(e,"inputIndices","sparseReshape"),o=ky(t,"inputShape","sparseReshape"),i=ky(n,"newShape","sparseReshape");if(2!==r.rank)throw new Error(`Input indices should be Tensor2D but received shape\n        ${r.shape}`);if(1!==o.rank)throw new Error(`Input shape should be Tensor1D but received shape ${o.shape}`);if(1!==i.rank)throw new Error(`New shape should be Tensor1D but received shape ${i.shape}`);const a={inputIndices:r,inputShape:o,newShape:i},s=$y.runKernel(Hg,a);return{outputIndices:s[0],outputShape:s[1]}}}),sx=Iy({sparseSegmentMean_:function(e,t,n){const r=ky(e,"data","sparseSegmentMean"),o=ky(t,"indices","sparseSegmentMean"),i=ky(n,"segmentIds","sparseSegmentMean");if(r.rank<1)throw new Error("Data should be at least 1 dimensional but received scalar");
2if(1!==o.rank)throw new Error(`Indices should be Tensor1D but received shape\n          ${o.shape}`);if(1!==i.rank)throw new Error(`Segment ids should be Tensor1D but received shape\n          ${i.shape}`);const a={data:r,indices:o,segmentIds:i};return $y.runKernel(Gg,a)}}),lx=Iy({sparseSegmentSum_:function(e,t,n){const r=ky(e,"data","sparseSegmentSum"),o=ky(t,"indices","sparseSegmentSum"),i=ky(n,"segmentIds","sparseSegmentSum");if(r.rank<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(1!==o.rank)throw new Error(`Indices should be Tensor1D but received shape\n         ${o.shape}`);if(1!==i.rank)throw new Error(`Segment ids should be Tensor1D but received shape\n         ${i.shape}`);const a={data:r,indices:o,segmentIds:i};return $y.runKernel(qg,a)}}),ux=Iy({stringNGrams_:function(e,t,n,r,o,i,a,s){const l=ky(e,"data","stringNGrams","string");if("string"!==l.dtype)throw new Error("Data must be of datatype string");if(1!==l.shape.length)throw new Error(`Data must be a vector, saw: ${l.shape}`);const u=ky(t,"dataSplits","stringNGrams");if("int32"!==u.dtype)throw new Error("Data splits must be of datatype int32");const p={separator:n,nGramWidths:r,leftPad:o,rightPad:i,padWidth:a,preserveShortSequences:s},c={data:l,dataSplits:u},d=$y.runKernel(Zg,c,p);return{nGrams:d[0],nGramsSplits:d[1]}}}),px=Iy({stringSplit_:function(e,t,n=!0){const r=ky(e,"input","stringSplit","string"),o=ky(t,"delimiter","stringSplit","string");if(1!==r.rank)throw new Error(`Input should be Tensor1D but received shape ${r.shape}`);if(0!==o.rank)throw new Error(`Delimiter should be a scalar but received shape ${o.shape}`);const i={skipEmpty:n},a={input:r,delimiter:o},s=$y.runKernel(Qg,a,i);return{indices:s[0],values:s[1],shape:s[2]}}}),cx=Iy({stringToHashBucketFast_:function(e,t){const n=ky(e,"input","stringToHashBucketFast","string"),r={numBuckets:t};if(t<=0)throw new Error("Number of buckets must be at least 1");const o={input:n};return $y.runKernel(em,o,r)}}),dx={flipLeftRight:Sw,grayscaleToRGB:vw,resizeNearestNeighbor:Lw,resizeBilinear:Pw,rotateWithOffset:kw,cropAndResize:xw,nonMaxSuppression:Iw,nonMaxSuppressionAsync:async function(e,t,n,r=.5,o=Number.NEGATIVE_INFINITY){const i=ky(e,"boxes","nonMaxSuppressionAsync"),a=ky(t,"scores","nonMaxSuppressionAsync"),s=Ew(i,a,n,r,o);n=s.maxOutputSize,r=s.iouThreshold,o=s.scoreThreshold;const l=await Promise.all([i.data(),a.data()]),u=l[0],p=l[1],{selectedIndices:c}=Nw(u,p,n,r,o);return i!==e&&i.dispose(),a!==t&&a.dispose(),G_(c,"int32")},nonMaxSuppressionWithScore:Rw,nonMaxSuppressionWithScoreAsync:async function(e,t,n,r=.5,o=Number.NEGATIVE_INFINITY,i=0){const a=ky(e,"boxes","nonMaxSuppressionAsync"),s=ky(t,"scores","nonMaxSuppressionAsync"),l=Ew(a,s,n,r,o,i);n=l.maxOutputSize,r=l.iouThreshold,o=l.scoreThreshold,i=l.softNmsSigma;const u=await Promise.all([a.data(),s.data()]),p=u[0],c=u[1],{selectedIndices:d,selectedScores:h}=Aw(p,c,n,r,o,i);return a!==e&&a.dispose(),s!==t&&s.dispose(),{selectedIndices:G_(d,"int32"),selectedScores:G_(h)}},nonMaxSuppressionPadded:Bw,nonMaxSuppressionPaddedAsync:async function(e,t,n,r=.5,o=Number.NEGATIVE_INFINITY,i=!1){const a=ky(e,"boxes","nonMaxSuppressionAsync"),s=ky(t,"scores","nonMaxSuppressionAsync"),l=Ew(a,s,n,r,o,null),u=l.maxOutputSize,p=l.iouThreshold,c=l.scoreThreshold,[d,h]=await Promise.all([a.data(),s.data()]),{selectedIndices:f,validOutputs:g}=jw(d,h,u,p,c,i);return a!==e&&a.dispose(),s!==t&&s.dispose(),{selectedIndices:G_(f,"int32"),validOutputs:zb(g,"int32")}},threshold:Hw,transform:Gw},hx={bandPart:qw,gramSchmidt:Zw,qr:ex},fx={sparseFillEmptyRows:ix,sparseReshape:ax,sparseSegmentMean:sx,sparseSegmentSum:lx},gx={stringNGrams:ux,stringSplit:px,stringToHashBucketFast:cx};class mx extends Vb{constructor(e,t,n=null){super(),this.learningRate=e,this.rho=t,this.epsilon=n,this.accumulatedGrads=[],this.accumulatedUpdates=[],null==n&&(this.epsilon=$y.backend.epsilon())}applyGradients(e){(Array.isArray(e)?e.map(e=>e.name):Object.keys(e)).forEach((t,n)=>{const r=$y.registeredVariables[t],o=!1;null==this.accumulatedGrads[n]&&(this.accumulatedGrads[n]={originalName:`${t}/accum_grad`,variable:Bb(()=>Z_(r).variable(o))}),null==this.accumulatedUpdates[n]&&(this.accumulatedUpdates[n]={originalName:`${t}/accum_var`,variable:Bb(()=>Z_(r).variable(o))});const i=Array.isArray(e)?e[n].tensor:e[t];if(null==i)return;const a=this.accumulatedGrads[n].variable,s=this.accumulatedUpdates[n].variable;Bb(()=>{const e=Gb(Y$(a,this.rho),Y$(f_(i),1-this.rho)),t=Y$(j$(U_(Gb(s,this.epsilon)),U_(Gb(a,this.epsilon))),i),n=Gb(Y$(s,this.rho),Y$(f_(t),1-this.rho));a.assign(e),s.assign(n);const o=Gb(Y$(t,-this.learningRate),r);r.assign(o)})}),this.incrementIterations()}dispose(){null!=this.accumulatedUpdates&&(Pb(this.accumulatedGrads.map(e=>e.variable)),Pb(this.accumulatedUpdates.map(e=>e.variable)))}async getWeights(){const e=[...this.accumulatedGrads,...this.accumulatedUpdates];return[await this.saveIterations()].concat(e.map(e=>({name:e.originalName,tensor:e.variable}
2)))}async setWeights(e){const t=(e=await this.extractIterations(e)).length/2,n=!1;this.accumulatedGrads=e.slice(0,t).map(e=>({originalName:e.name,variable:e.tensor.variable(n)})),this.accumulatedUpdates=e.slice(t,2*t).map(e=>({originalName:e.name,variable:e.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)}}mx.className="Adadelta",Db(mx);class yx extends Vb{constructor(e,t=.1){super(),this.learningRate=e,this.initialAccumulatorValue=t,this.accumulatedGrads=[]}applyGradients(e){(Array.isArray(e)?e.map(e=>e.name):Object.keys(e)).forEach((t,n)=>{const r=$y.registeredVariables[t];if(null==this.accumulatedGrads[n]){const e=!1;this.accumulatedGrads[n]={originalName:`${t}/accumulator`,variable:Bb(()=>W$(r.shape,this.initialAccumulatorValue).variable(e))}}const o=Array.isArray(e)?e[n].tensor:e[t];if(null==o)return;const i=this.accumulatedGrads[n].variable;Bb(()=>{const e=Gb(i,f_(o));i.assign(e);const t=Gb(Y$(j$(o,U_(Gb(e,$y.backend.epsilon()))),-this.learningRate),r);r.assign(t)})}),this.incrementIterations()}dispose(){null!=this.accumulatedGrads&&Pb(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),this.accumulatedGrads=e.map(e=>({originalName:e.name,variable:e.tensor.variable(!1)}))}getConfig(){return{learningRate:this.learningRate,initialAccumulatorValue:this.initialAccumulatorValue}}static fromConfig(e,t){return new e(t.learningRate,t.initialAccumulatorValue)}}yx.className="Adagrad",Db(yx);class bx extends Vb{constructor(e,t,n,r=null){super(),this.learningRate=e,this.beta1=t,this.beta2=n,this.epsilon=r,this.accumulatedFirstMoment=[],this.accumulatedSecondMoment=[],Bb(()=>{this.accBeta1=zb(t).variable(),this.accBeta2=zb(n).variable()}),null==r&&(this.epsilon=$y.backend.epsilon())}applyGradients(e){const t=Array.isArray(e)?e.map(e=>e.name):Object.keys(e);Bb(()=>{const n=J$(1,this.accBeta1),r=J$(1,this.accBeta2);t.forEach((t,o)=>{const i=$y.registeredVariables[t],a=!1;null==this.accumulatedFirstMoment[o]&&(this.accumulatedFirstMoment[o]={originalName:`${t}/m`,variable:Bb(()=>Z_(i).variable(a))}),null==this.accumulatedSecondMoment[o]&&(this.accumulatedSecondMoment[o]={originalName:`${t}/v`,variable:Bb(()=>Z_(i).variable(a))});const s=Array.isArray(e)?e[o].tensor:e[t];if(null==s)return;const l=this.accumulatedFirstMoment[o].variable,u=this.accumulatedSecondMoment[o].variable,p=Gb(Y$(l,this.beta1),Y$(s,1-this.beta1)),c=Gb(Y$(u,this.beta2),Y$(f_(s),1-this.beta2)),d=j$(p,n),h=j$(c,r);l.assign(p),u.assign(c);const f=Gb(Y$(j$(d,Gb(U_(h),this.epsilon)),-this.learningRate),i);i.assign(f)}),this.accBeta1.assign(Y$(this.accBeta1,this.beta1)),this.accBeta2.assign(Y$(this.accBeta2,this.beta2))}),this.incrementIterations()}dispose(){this.accBeta1.dispose(),this.accBeta2.dispose(),null!=this.accumulatedFirstMoment&&Pb(this.accumulatedFirstMoment.map(e=>e.variable)),null!=this.accumulatedSecondMoment&&Pb(this.accumulatedSecondMoment.map(e=>e.variable))}async getWeights(){const e=[...this.accumulatedFirstMoment,...this.accumulatedSecondMoment];return[await this.saveIterations()].concat(e.map(e=>({name:e.originalName,tensor:e.variable})))}async setWeights(e){e=await this.extractIterations(e),Bb(()=>{this.accBeta1.assign(Xw(this.beta1,this.iterations_+1)),this.accBeta2.assign(Xw(this.beta2,this.iterations_+1))});const t=e.length/2,n=!1;this.accumulatedFirstMoment=e.slice(0,t).map(e=>({originalName:e.name,variable:e.tensor.variable(n)})),this.accumulatedSecondMoment=e.slice(t,2*t).map(e=>({originalName:e.name,variable:e.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)}}bx.className="Adam",Db(bx);class $x extends Vb{constructor(e,t,n,r=null,o=0){super(),this.learningRate=e,this.beta1=t,this.beta2=n,this.epsilon=r,this.decay=o,this.accumulatedFirstMoment=[],this.accumulatedWeightedInfNorm=[],Bb(()=>{this.iteration=zb(0).variable(),this.accBeta1=zb(t).variable()}),null==r&&(this.epsilon=$y.backend.epsilon())}applyGradients(e){const t=Array.isArray(e)?e.map(e=>e.name):Object.keys(e);Bb(()=>{const n=J$(1,this.accBeta1),r=j$(-this.learningRate,Gb(Y$(this.iteration,this.decay),1));t.forEach((t,o)=>{const i=$y.registeredVariables[t],a=!1;null==this.accumulatedFirstMoment[o]&&(this.accumulatedFirstMoment[o]={originalName:`${t}/m`,variable:Z_(i).variable(a)}),null==this.accumulatedWeightedInfNorm[o]&&(this.accumulatedWeightedInfNorm[o]={originalName:`${t}/v`,variable:Z_(i).variable(a)});const s=Array.isArray(e)?e[o].tensor:e[t];if(null==s)return;const l=this.accumulatedFirstMoment[o].variable,u=this.accumulatedWeightedInfNorm[o].variable,p=Gb(Y$(l,this.beta1),Y$(s,1-this.beta1)),c=Y$(u,this.beta2),d=Hb(s),h=o_(c,d);l.assign(p),u.assign(h);const f=Gb(Y$(j$(r,n),j$(p,Gb(h,this.epsilon))),i);i.assign(f)}),this.iteration.assign(Gb(this.iteration,1)),this.accBeta1.assign(Y$(this.accBeta1,this.beta1))}),this.incrementIterations()}dispose(){this.accBeta1.dispose(),this.iteration.dispose(),null!=this.accumulatedFirstMoment&&Pb(this.accumulatedFirstMoment.map(e=>e.variable)),null!=this.accumulatedWeightedInfNorm&&Pb(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)}}$x.className="Adamax",Db($x);class _x extends Vb{constructor(e){super(),this.learningRate=e,this.setLearningRate(e)}
2applyGradients(e){(Array.isArray(e)?e.map(e=>e.name):Object.keys(e)).forEach((t,n)=>{const r=Array.isArray(e)?e[n].tensor:e[t];if(null==r)return;const o=$y.registeredVariables[t];Bb(()=>{const e=Gb(Y$(this.c,r),o);o.assign(e)})}),this.incrementIterations()}setLearningRate(e){this.learningRate=e,null!=this.c&&this.c.dispose(),this.c=Lb(zb(-e))}dispose(){this.c.dispose()}async getWeights(){return[await this.saveIterations()]}async setWeights(e){if(0!==(e=await this.extractIterations(e)).length)throw new Error("SGD optimizer does not have settable weights.")}getConfig(){return{learningRate:this.learningRate}}static fromConfig(e,t){return new e(t.learningRate)}}_x.className="SGD",Db(_x);class wx extends _x{constructor(e,t,n=!1){super(e),this.learningRate=e,this.momentum=t,this.useNesterov=n,this.accumulations=[],this.m=zb(this.momentum)}applyGradients(e){(Array.isArray(e)?e.map(e=>e.name):Object.keys(e)).forEach((t,n)=>{const r=$y.registeredVariables[t];if(null==this.accumulations[n]){const e=!1;this.accumulations[n]={originalName:`${t}/momentum`,variable:Bb(()=>Z_(r).variable(e))}}const o=this.accumulations[n].variable,i=Array.isArray(e)?e[n].tensor:e[t];null!=i&&Bb(()=>{let e;const t=Gb(Y$(this.m,o),i);e=this.useNesterov?Gb(Y$(this.c,Gb(i,Y$(t,this.m))),r):Gb(Y$(this.c,t),r),o.assign(t),r.assign(e)})}),this.incrementIterations()}dispose(){this.m.dispose(),null!=this.accumulations&&Pb(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),this.accumulations=e.map(e=>({originalName:e.name,variable:e.tensor.variable(!1)}))}getConfig(){return{learningRate:this.learningRate,momentum:this.momentum,useNesterov:this.useNesterov}}static fromConfig(e,t){return new e(t.learningRate,t.momentum,t.useNesterov)}}wx.className="Momentum",Db(wx);class xx extends Vb{constructor(e,t=.9,n=0,r=null,o=!1){if(super(),this.learningRate=e,this.decay=t,this.momentum=n,this.epsilon=r,this.accumulatedMeanSquares=[],this.accumulatedMoments=[],this.accumulatedMeanGrads=[],this.centered=o,null==r&&(this.epsilon=$y.backend.epsilon()),null==e)throw new Error("learningRate for RMSPropOptimizer must be defined.")}applyGradients(e){(Array.isArray(e)?e.map(e=>e.name):Object.keys(e)).forEach((t,n)=>{const r=$y.registeredVariables[t],o=!1;null==this.accumulatedMeanSquares[n]&&(this.accumulatedMeanSquares[n]={originalName:`${t}/rms`,variable:Bb(()=>Z_(r).variable(o))}),null==this.accumulatedMoments[n]&&(this.accumulatedMoments[n]={originalName:`${t}/momentum`,variable:Bb(()=>Z_(r).variable(o))}),null==this.accumulatedMeanGrads[n]&&this.centered&&(this.accumulatedMeanGrads[n]={originalName:`${t}/mg`,variable:Bb(()=>Z_(r).variable(o))});const i=Array.isArray(e)?e[n].tensor:e[t];if(null==i)return;const a=this.accumulatedMeanSquares[n].variable,s=this.accumulatedMoments[n].variable;Bb(()=>{const e=Gb(Y$(a,this.decay),Y$(f_(i),1-this.decay));if(this.centered){const t=this.accumulatedMeanGrads[n].variable,o=Gb(Y$(t,this.decay),Y$(i,1-this.decay)),l=j$(Y$(i,this.learningRate),U_(J$(e,Gb(f_(o),this.epsilon)))),u=Gb(Y$(s,this.momentum),l);a.assign(e),t.assign(o),s.assign(u);const p=J$(r,u);r.assign(p)}else{const e=Gb(Y$(a,this.decay),Y$(f_(i),1-this.decay)),t=Gb(Y$(s,this.momentum),j$(Y$(i,this.learningRate),U_(Gb(e,this.epsilon))));a.assign(e),s.assign(t);const n=J$(r,t);r.assign(n)}})}),this.incrementIterations()}dispose(){null!=this.accumulatedMeanSquares&&Pb(this.accumulatedMeanSquares.map(e=>e.variable)),null!=this.accumulatedMeanGrads&&this.centered&&Pb(this.accumulatedMeanGrads.map(e=>e.variable)),null!=this.accumulatedMoments&&Pb(this.accumulatedMoments.map(e=>e.variable))}async getWeights(){const e=[...this.accumulatedMeanSquares,...this.accumulatedMoments];return this.centered&&e.push(...this.accumulatedMeanGrads),[await this.saveIterations()].concat(e.map(e=>({name:e.originalName,tensor:e.variable})))}async setWeights(e){e=await this.extractIterations(e);const t=this.centered?e.length/3:e.length/2,n=!1;this.accumulatedMeanSquares=e.slice(0,t).map(e=>({originalName:e.name,variable:e.tensor.variable(n)})),this.accumulatedMoments=e.slice(t,2*t).map(e=>({originalName:e.name,variable:e.tensor.variable(n)})),this.centered&&(this.accumulatedMeanGrads=e.slice(2*t,3*t).map(e=>({originalName:e.name,variable:e.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)}}xx.className="RMSProp",Db(xx);class Sx{static sgd(e){return new _x(e)}static momentum(e,t,n=!1){return new wx(e,t,n)}static rmsprop(e,t=.9,n=0,r=null,o=!1){return new xx(e,t,n,r,o)}static adam(e=.001,t=.9,n=.999,r=null){return new bx(e,t,n,r)}static adadelta(e=.001,t=.95,n=null){return new mx(e,t,n)}static adamax(e=.002,t=.9,n=.999,r=null,o=0){return new $x(e,t,n,r,o)}static adagrad(e,t=.1){return new yx(e,t)}}const vx={sgd:Sx.sgd,momentum:Sx.momentum,adadelta:Sx.adadelta,adagrad:Sx.adagrad,rmsprop:Sx.rmsprop,adamax:Sx.adamax,adam:Sx.adam},kx="undefined"!=typeof requestAnimationFrame?requestAnimationFrame:"undefined"!=typeof setImmediate?setImmediate:e=>e();function Ex(){return new Promise(e=>kx(()=>e()))}function Ix(e,t){const n=e[0].length;e.forEach((e,t)=>{Md(e.length===n,()=>`Error in concat${n}D: rank of tensors[${t}] must be the same as the rank of the rest (${n})`)}),Md(t>=0&&t<n,()=>`Error in concat${n}D: axis must be between 0 and ${n-1}.`);const r=e[0];e.forEach((e,o)=>{for(let i=0;i<n;i++)Md(i===t||e[i]===r[i],()=>`Error in concat${n}D: Shape of tensors[${o}] (${e}) does not match the shape of the rest (${r}) along the non-concatenated axis ${o}.`)})}function Tx(e,t){const n=e[0].slice();for(let r=1;r<e.length;r++)n[t]+=e[r][t];return n}
vendor: 6,602 bytes, line 2
2function Fx(e,t,n){return[n*("number"==typeof e?e:e[0]),t*("number"==typeof e?e:e[1])]}function Nx(e,t,n,r=!0){let o=[];if(r)o=o.concat(t.slice(0)),o.push(e[0]/n),o=o.concat(e.slice(1));else{o=o.concat(e[0]);const n=t.length;for(let r=0;r<n;++r)o=o.concat([e[r+1]/t[r],t[r]]);o=o.concat(e.slice(n+1))}return o}function jx(e,t,n=!0){const r=[];if(n){r.push(t);for(let n=t+1;n<e;++n)n<=2*t?(r.push(n),r.push(n-(t+1))):r.push(n)}else{const n=[],o=[];for(let r=1;r<e;++r)r>=2*t+1||r%2==1?o.push(r):n.push(r);r.push(...n),r.push(0),r.push(...o)}return r}function Ax(e,t,n,r=!0){const o=[];r?o.push(e[0]/n):o.push(e[0]*n);for(let n=1;n<e.length;++n)n<=t.length?r?o.push(t[n-1]*e[n]):o.push(e[n]/t[n-1]):o.push(e[n]);return o}function Cx(e,t){const n=[0];for(let r=0;r<t;++r)n.push(e[r][0]);return n}function Mx(e,t,n){const r=e.slice(0,1);for(let o=0;o<n;++o)r.push(e[o+1]-t[o][0]-t[o][1]);return r}const Dx=1.7580993408473768,Ox=1.0507009873554805;function Rx(e,t){if(e.length!==t.length)throw new Error(`Cannot merge real and imag arrays of different lengths. real:${e.length}, imag: ${t.length}.`);const n=new Float32Array(2*e.length);for(let r=0;r<n.length;r+=2)n[r]=e[r/2],n[r+1]=t[r/2];return n}function Bx(e,t){return{real:e[2*t],imag:e[2*t+1]}}function Px(e,t,n,r){e[2*r]=t,e[2*r+1]=n}function Lx(e,t,n){const r=(n?2:-2)*Math.PI*(e/t);return{real:Math.cos(r),imag:Math.sin(r)}}const Wx=/->/g;function Ux(e,t){let n=new Array(e);n.fill(-1);for(let e=0;e<t.length;++e)n[t[e]]=e;const r=[];for(let t=0;t<e;++t)-1===n[t]&&r.push(t);return n=n.filter(e=>-1!==e),{permutationIndices:n,expandDims:r}}function zx(e){return e.every((e,t)=>e===t)}function Vx(e,t){const n=[];for(let r=0;r<e.length;++r)0!==e[r].length&&-1===e[r].indexOf(t)&&-1!==t||n.push(r);return n}function Hx(e,t,n=0){let r=[];if("number"==typeof t)Md(e.shape[n]%t===0,()=>"Number of splits must evenly divide the axis."),r=new Array(t).fill(e.shape[n]/t);else{const o=t.reduce((e,t)=>(-1===t&&(e+=1),e),0);Md(o<=1,()=>"There should be only one negative value in split array.");const i=t.indexOf(-1);if(-1!==i){const r=t.reduce((e,t)=>t>0?e+t:e);t[i]=e.shape[n]-r}Md(e.shape[n]===t.reduce((e,t)=>e+t),()=>"The sum of sizes must match the size of the axis dimension."),r=t}return r}function Gx(e,t,n,r){const o=t.shape.length,i=e.shape.length;if(0!==r&&(r<-o||r>o))throw new Error(`Expect batchDims in the range of [-${o}, ${o}], but got ${r}`);if(r<0&&(r+=o),r>i)throw new Error(`batchDims (${r}) must be less than rank(x) (\n    ${i}).`);if(n<r)throw new Error(`batchDims (${r}) must be less than or equal to axis (${n}).`);for(let n=0;n<r;++n)if(e.shape[n]!==t.shape[n])throw new Error(`x.shape[${n}]: ${e.shape[n]} should be equal to indices.shape[${n}]: ${t.shape[n]}.`);const a=e.shape[n],s=[];let l=1,u=1,p=1;for(let t=0;t<r;++t)s.push(e.shape[t]),l*=e.shape[t];for(let t=r;t<n;t++)s.push(e.shape[t]),u*=e.shape[t];for(let e=r;e<o;e++)s.push(t.shape[e]);for(let t=n+1;t<i;t++)s.push(e.shape[t]),p*=e.shape[t];return{batchSize:l,sliceSize:p,outerSize:u,dimSize:a,outputShape:s}}function qx(e){try{return e.map(e=>zm(e))}catch(e){throw new Error(`Failed to decode encoded string bytes into utf-8, error: ${e}`)}}function Kx(e){return e.map(e=>Um(e))}function Xx(e,t){const n=[];for(let e=0;e<t.length;e++)t[e]&&n.push(e);const r=db(e,"int32"),o=db([n.length,e.length],"int32");for(let t=0;t<n.length;t++){const i=r.indexToLoc(n[t]),a=t*e.length;o.values.set(i,a)}return o.toTensor()}const Yx={kernelName:yh,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Y$(e,uw(hb(n,"float32"),-1))}}},Jx={kernelName:bh,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>{const t=f_(hb(n,"float32")),r=U_(J$(zb(1),t));return m_(j$(e,r))}}}},Zx={kernelName:$h,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>{const t=U_(J$(f_(hb(n,"float32")),1));return j$(e,t)}}}},Qx={kernelName:_h,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,r]=t,o=D$(n.shape,r.shape);return{a:()=>{let t=e;const r=M$(n.shape,o);return r.length>0&&(t=Z$(t,r)),u$(t,n.shape)},b:()=>{let t=e;const n=M$(r.shape,o);return n.length>0&&(t=Z$(t,n)),u$(t,r.shape)}}}},eS={kernelName:wh,saveAllInputs:!0,gradFunc:(e,t)=>{const n={};return t.forEach((t,r)=>{n[r]=()=>e.clone()}),n}},tS={kernelName:vh,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Z_(n)}}},nS={kernelName:kh,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Z_(n)}}},rS={kernelName:Eh,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>j$(e,U_(J$(zb(1),f_(hb(n,"float32")))))}}},oS={kernelName:Ih,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>{const t=U_(Gb(zb(1),f_(hb(n,"float32"))));return j$(e,t)}}}},iS={kernelName:Nh,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,r]=t,o=D$(n.shape,r.shape);return{a:()=>{const t=Gb(f_(n),f_(r));let i=Y$(e,j$(r,t));const a=M$(n.shape,o);return a.length>0&&(i=Z$(i,a)),u$(i,n.shape)},b:()=>{const t=Gb(f_(n),f_(r));let i=m_(Y$(e,j$(n,t)));const a=M$(r.shape,o);return a.length>0&&(i=Z$(i,a)),u$(i,r.shape)}}}},aS={kernelName:Th,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>j$(e,Gb(f_(hb(n,"float32")),1))}}},sS={kernelName:Fh,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>j$(e,J$(zb(1),f_(hb(n,"float32"))))}}},lS=Iy({avgPool3dGrad_:function(e,t,n,r,o,i){const a=ky(e,"dy","avgPool3dGrad"),s=ky(t,"input","avgPool3dGrad");let l=a,u=s,p=!1;4===s.rank&&(p=!0,l=u$(a,[1,a.shape[0],a.shape[1],a.shape[2],a.shape[3]]),u=u$(s,[1,s.shape[0],s.shape[1],s.shape[2],s.shape[3]])),Md(5===l.rank,()=>`Error in avgPool3dGrad: dy must be rank 5 but got rank ${l.rank}.`),Md(5===u.rank,()=>`Error in avgPool3dGrad: input must be rank 5 but got rank ${u.rank}.`),null!=i&&Md(Ld(o),()=>`Error in avgPool3dGrad: pad must be an integer when using, dimRoundingMode ${i} but got pad ${o}.`);const c={dy:l,input:u},d={filterSize:n,strides:r,pad:o,dimRoundingMode:i},h=$y.runKernel(Mh,c,d);return p?u$(h,[h.shape[1],h.shape[2],h.shape[3],h.shape[4]]):h}}),uS={kernelName:Ch,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[r]=t,{filterSize:o,strides:i,pad:a,dimRoundingMode:s}=n;return{x:()=>lS(e,r,o,i,a,s)}}},pS=Iy({avgPoolGrad_:function(e,t,n,r,o){const i=ky(e,"dy","avgPoolGrad"),a=ky(t,"input","avgPoolGrad");Md(a.rank===i.rank,()=>`Rank of input (${a.rank}) does not match rank of dy (${i.rank})`);let s=a,l=i,u=!1;3===a.rank&&(u=!0,s=u$(a,[1,a.shape[0],a.shape[1],a.shape[2]]),l=u$(i,[1,i.shape[0],i.shape[1],i.shape[2]])),Md(4===l.rank,()=>`Error in avgPoolGrad: dy must be rank 4 but got rank ${l.rank}.`),Md(4===s.rank,()=>`Error in avgPoolGrad: input must be rank 4 but got rank ${s.rank}
2.`);const p={dy:l,input:s},c={filterSize:n,strides:r,pad:o},d=$y.runKernel(Ah,p,c);return u?u$(d,[d.shape[1],d.shape[2],d.shape[3]]):d}}),cS={kernelName:jh,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[r]=t,{filterSize:o,strides:i,pad:a}=n;return{x:()=>pS(e,r,o,i,a)}}},dS={kernelName:Dh,inputsToSave:["a","b"],gradFunc:(e,t,n)=>{const[r,o]=t,{transposeA:i,transposeB:a}=n;return i||a?!i&&a?{a:()=>t_(e,o,!1,!1),b:()=>t_(e,r,!0,!1)}:i&&!a?{a:()=>t_(o,e,!1,!0),b:()=>t_(r,e,!1,!1)}:{a:()=>t_(o,e,!0,!0),b:()=>t_(e,r,!0,!0)}:{a:()=>t_(e,o,!1,!0),b:()=>t_(r,e,!0,!1)}}},hS=Iy({spaceToBatchND_:function(e,t,n){const r=ky(e,"x","spaceToBatchND");Md(r.rank>=1+t.length,()=>`input rank ${r.rank} should be > than [blockShape] ${t.length}`),Md(n.length===t.length,()=>`paddings.shape[0] ${n.length} must be equal to [blockShape] ${t.length}`),Md(r.shape.reduce((e,r,o)=>o>0&&o<=t.length?e&&(r+n[o-1][0]+n[o-1][1])%t[o-1]===0:e,!0),()=>`input spatial dimensions ${r.shape.slice(1)} with paddings ${n.toString()} must be divisible by blockShapes ${t.toString()}`);const o={x:r},i={blockShape:t,paddings:n};return $y.runKernel(Wg,o,i)}}),fS={kernelName:Oh,gradFunc:(e,t,n)=>{const{blockShape:r,crops:o}=n;return{x:()=>hS(e,r,o)}}},gS={kernelName:"BroadcastTo",gradFunc:(e,t,n)=>{const r=n,o=r.inputShape,i=r.shape,a=Array.from(i);for(let e=o.length-1;e>=0;e--)if(o[e]===i[e])a[e]=1;else if(1!==o[e])throw new Error(`broadcastTo(): [${o}] cannot be broadcast to [${i}].`);const s=[];for(let e=0;e<a.length;e++)a[e]>1&&s.push(e);return{x:()=>Z$(e,s,!0)}}},mS={kernelName:Ph,gradFunc:e=>({x:()=>e.clone()})},yS={kernelName:Lh,gradFunc:e=>({x:()=>Z_(e)})},bS={kernelName:Wh,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[r]=t,{clipValueMin:o,clipValueMax:i}=n;return{x:()=>J_(e_(H$(r,o),Uw(r,i)),e,Z_(e))}}},$S={kernelName:zh,inputsToSave:["x"],gradFunc:Yx.gradFunc},_S={kernelName:Vh,saveAllInputs:!0,gradFunc:(e,t,n)=>{const r=t.map(e=>e.shape),{axis:o}=n,i=zd(o,t[0].shape)[0],a=r.map(e=>e[i]);return W_(e,a,i).map(e=>()=>e)}},wS={kernelName:Hh,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{const[r,o]=t,{dilations:i,strides:a,pad:s,dataFormat:l}=n;return Md(a$(i),()=>`Error in gradient of conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${i}'`),{x:()=>v$(r.shape,e,o,a,s,l),filter:()=>sw(r,e,o.shape,a,s,l)}}},xS={kernelName:qh,inputsToSave:["dy","filter"],gradFunc:(e,t,n)=>{const[r,o]=t,{strides:i,pad:a,dataFormat:s,dimRoundingMode:l}=n;return{dy:()=>x$(e,o,i,a,s,1,l),filter:()=>sw(e,r,o.shape,i,a,s,l)}}},SS=Iy({conv3DBackpropFilter_:function(e,t,n,r,o){let i=e;4===e.rank&&(i=u$(e,[1,e.shape[0],e.shape[1],e.shape[2],e.shape[3]]));let a=t;4===a.rank&&(a=u$(t,[1,t.shape[0],t.shape[1],t.shape[2],t.shape[3]])),Md(5===i.rank,()=>`Error in conv3dDerFilter: input must be rank 5, but got shape ${i.shape}.`),Md(5===a.rank,()=>`Error in conv3dDerFilter: dy must be rank 5, but got shape ${a.shape}.`),Md(5===n.length,()=>`Error in conv3dDerFilter: filterShape must be length 5, but got ${n}.`),Md(i.shape[4]===n[3],()=>`Error in conv3dDerFilter: depth of input ${i.shape[4]}) must match input depth in filter (${n[3]}.`),Md(a.shape[4]===n[4],()=>`Error in conv3dDerFilter: depth of dy (${a.shape[4]}) must match output depth for filter (${n[4]}).`);const s={x:i,dy:a},l={strides:r,pad:o,filterShape:n};return $y.runKernel(Xh,s,l)}}),vS={kernelName:Kh,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{const{dilations:r,strides:o,pad:i}=n;Md(a$(r),()=>`Error in gradient of conv3D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${r}'`);const[a,s]=t;return{x:()=>I$(a.shape,e,s,o,i),filter:()=>SS(a,e,s.shape,o,i)}}},kS=Iy({sin_:function(e){const t={x:ky(e,"x","sin","float32")};return $y.runKernel(Mg,t)}}),ES={kernelName:Jh,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Y$(m_(kS(hb(n,"float32"))),e)}}},IS=Iy({sinh_:function(e){const t={x:ky(e,"x","sinh")};return $y.runKernel(Dg,t)}}),TS={kernelName:Zh,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Y$(IS(hb(n,"float32")),e)}}},FS=Iy({cumsum_:function(e,t=0,n=!1,r=!1){const o={x:ky(e,"x","cumsum")},i={axis:t,exclusive:n,reverse:r};return $y.runKernel(Qh,o,i)}}),NS={kernelName:Qh,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[r]=t,{axis:o,exclusive:i,reverse:a}=n;return{x:()=>{const t=c_([o],r.rank);let n=FS(e,o,i,!a);return null!=t&&(n=Q_(n,t)),n}}}},jS={kernelName:rf,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{const{dilations:r,strides:o,pad:i,dimRoundingMode:a}=n,s=null==r?[1,1]:r;Md(a$(s),()=>`Error in gradient of depthwiseConv2dNative: dilation rates greater than 1 are not yet supported. Got dilations '${s}'`);const[l,u]=t;return Md(4===l.rank,()=>`Error in gradient of depthwiseConv2dNative: input must be rank 4, but got rank ${l.rank}.`),Md(4===u.rank,()=>`Error in gradient of depthwiseConv2dNative: filter must be rank 4, but got rank ${u.rank}.`),Md(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]}.`),Md(s$(o,s),()=>`Error in gradient of depthwiseConv2d: Either strides or dilations must be  1. Got strides ${o} and dilations '${s}'.`),null!=a&&Md(Ld(i),()=>`Error in depthwiseConv2d: pad must be an integer when using, dimRoundingMode ${a} but got pad ${i}.`),{x:()=>mw(l.shape,e,u,o,i,s,a),filter:()=>gw(l,e,u.shape,o,i,s,a)}}},AS={kernelName:sf,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{const[r,o]=t,i={x:r,filter:o,dy:e},a={x:r,filter:o,dy:e};return{x:()=>$y.runKernel(lf,i,n),filter:()=>$y.runKernel(uf,a,n)}}},CS={kernelName:df,outputsToSave:[!0],gradFunc:(e,t)=>{const[n]=t,r={dy:e,y:n};return{x:()=>$y.runKernel(hf,r)}}},MS={kernelName:ff,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t,r=Y$(R$(m_(f_(n))),2/Math.sqrt(Math.PI));return{x:()=>Y$(e,r)}}},DS={kernelName:mf,outputsToSave:[!0],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Y$(e,n)}}},OS={kernelName:yf,inputsToSave:["input"],gradFunc:(e,t)=>{const[n]=t;return{input:()=>u$(e,n.shape)}}},RS={kernelName:bf,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Y$(e,R$(n))}}}
vendor: 12,544 bytes, line 2
2,BS={kernelName:wf,gradFunc:e=>({x:()=>Z_(e)})},PS={kernelName:xf,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,r]=t,o=D$(n.shape,r.shape);return{a:()=>{const t=j$(e,hb(r,"float32")),i=M$(n.shape,o);return i.length>0?u$(Z$(t,i),n.shape):t},b:()=>{let t=Y$(e,hb(n,"float32"));const i=M$(r.shape,o);i.length>0&&(t=u$(Z$(t,i),r.shape));const a=f_(r);return m_(j$(t,hb(a,"float32")))}}}},LS=Iy({rsqrt_:function(e){const t={x:ky(e,"x","rsqrt","float32")};return $y.runKernel(Fg,t)}}),WS={kernelName:Sf,inputsToSave:["x","mean","variance","scale"],gradFunc:(e,t,n)=>{const{varianceEpsilon:r}=n,[o,i,a,s]=t,l=null==s?zb(1):s,u=M$(i.shape,o.shape),p=[];if(1===i.rank){for(let e=0;e<o.shape.length-1;++e)p.push(o.shape[e]);p.push(1)}const c=J$(o,i),d=Y$(e,l),h=LS(Gb(a,zb(r))),f=Y$(Y$(Y$(h,h),h),zb(-.5));return{x:()=>1===i.rank?u$(Y$(Y$(e,P$(u$(h,[1,1,1,i.shape[0]]),p)),l),o.shape):u$(Y$(Y$(e,h),l),o.shape),mean:()=>{let e=Y$(Y$(h,zb(-1)),d);return 1===i.rank&&(e=Z$(e,u)),u$(e,i.shape)},variance:()=>{let e=Y$(Y$(f,c),d);return 1===i.rank&&(e=Z$(e,u)),u$(e,i.shape)},scale:()=>{const t=Y$(c,h);let n=Y$(e,t);return 1===i.rank&&(n=Z$(n,u)),u$(n,i.shape)},offset:()=>{let t=e;return 1===i.rank&&(t=Z$(t,u)),u$(t,i.shape)}}}},US=Iy({unsortedSegmentSum_:function(e,t,n){const r=ky(e,"x","unsortedSegmentSum"),o=ky(t,"segmentIds","unsortedSegmentSum","int32");Md(Ld(n),()=>"numSegments must be of dtype int");const i={x:r,segmentIds:o},a={numSegments:n};return $y.runKernel(pm,i,a)}}),zS={kernelName:vf,inputsToSave:["x","indices"],gradFunc:(e,t,n)=>{const[r,o]=t,{axis:i}=n,a=zd(i,r.shape)[0];return{x:()=>{const t=r.shape,n=o.size,s=t.slice(0,a),l=s.length,u=t.slice(i,t.length).slice(1),p=u.length,c=VS(0,l),d=VS(l+1,l+1+p),h=HS([s,[n],u]),f=u$(e,h),g=u$(o,[n]),m=HS([[l],c,d]),y=Q_(f,m);let b=US(y,g,r.shape[a]);const $=d_(m);return b=Q_(b,$),b},indices:()=>o}}};function VS(e,t){const n=[];for(let r=e;r<t;++r)n.push(r);return n}function HS(e){const t=[];for(let n=0;n<e.length;++n)for(let r=0;r<e[n].length;++r)t.push(e[n][r]);return t}const GS={kernelName:If,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,r]=t;return{a:()=>Z_(n),b:()=>Z_(r)}}},qS={kernelName:Tf,gradFunc:e=>({x:()=>hb(e,"float32")})},KS={kernelName:jf,gradFunc:e=>({x:()=>Z_(e)})},XS={kernelName:Af,gradFunc:e=>({x:()=>Z_(e)})},YS={kernelName:Cf,gradFunc:e=>({x:()=>Z_(e)})},JS={kernelName:Mf,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[r]=t,{alpha:o}=n,i=V$(r,0);return{x:()=>J_(i,e,Y$(e,o))}}},ZS={kernelName:Pf,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>j$(e,Gb(n,1))}}},QS={kernelName:Bf,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>j$(e,hb(n,"float32"))}}},ev={kernelName:"LogSoftmax",inputsToSave:[],outputsToSave:[!0],gradFunc:(e,t,n)=>{const[r]=t,{axis:o}=n;return{logits:()=>{const t=R$(r);return J$(e,Y$(Z$(e,o,!0),t))}}}},tv=Iy({localResponseNormalizationBackprop_:function(e,t,n,r=5,o=1,i=1,a=.5){const s={x:e,y:t,dy:n},l={depthRadius:r,bias:o,alpha:i,beta:a};return $y.runKernel(Vf,s,l)}}),nv={kernelName:zf,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{const[r,o]=t,{depthRadius:i,bias:a,alpha:s,beta:l}=n;return{x:()=>tv(r,o,e,i,a,s,l)}}};function rv(e,t,n,r){return t.rank<n.rank&&(t=u$(t,u_(t.shape,r))),e.rank<n.rank&&(e=u$(e,u_(e.shape,r))),{x:()=>Y$(e,hb(O$(n,t),e.dtype))}}const ov={kernelName:Hf,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{const r=n,{reductionIndices:o}=r,i=t[0],a=rv(e,t[1],i,zd(o,i.shape));return{x:()=>a.x()}}},iv=Iy({less_:function(e,t){let n=ky(e,"a","less","string_or_numeric"),r=ky(t,"b","less","string_or_numeric");[n,r]=cy(n,r),D$(n.shape,r.shape);const o={a:n,b:r};return $y.runKernel(Df,o)}}),av={kernelName:Gf,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,r]=t;return{a:()=>Y$(e,hb(H$(n,r),"float32")),b:()=>Y$(e,hb(iv(n,r),"float32"))}}},sv=Iy({maxPool3dGrad_:function(e,t,n,r,o,i,a){const s=ky(e,"dy","maxPool3dGrad"),l=ky(t,"input","maxPool3dGrad"),u=ky(n,"output","maxPool3dGrad");let p=s,c=l,d=u,h=!1;4===l.rank&&(h=!0,p=u$(s,[1,s.shape[0],s.shape[1],s.shape[2],s.shape[3]]),c=u$(l,[1,l.shape[0],l.shape[1],l.shape[2],l.shape[3]]),d=u$(u,[1,u.shape[0],u.shape[1],u.shape[2],u.shape[3]])),Md(5===p.rank,()=>`Error in maxPool3dGrad: dy must be rank 5 but got rank ${p.rank}.`),Md(5===c.rank,()=>`Error in maxPool3dGrad: input must be rank 5 but got rank ${c.rank}.`),Md(5===d.rank,()=>`Error in maxPool3dGrad: output must be rank 5 but got rank ${d.rank}.`),null!=a&&Md(Ld(i),()=>`Error in maxPool3dGrad: pad must be an integer when using, dimRoundingMode ${a} but got pad ${i}.`);const f={dy:p,input:c,output:d},g={filterSize:r,strides:o,pad:i,dimRoundingMode:a},m=$y.runKernel(Yf,f,g);return h?u$(m,[m.shape[1],m.shape[2],m.shape[3],m.shape[4]]):m}}),lv={kernelName:Xf,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{const[r,o]=t,{filterSize:i,strides:a,pad:s,dimRoundingMode:l}=n;return{x:()=>sv(e,r,o,i,a,s,l)}}},uv=Iy({maxPoolGrad_:function(e,t,n,r,o,i,a){const s=ky(e,"dy","maxPoolGrad"),l=ky(t,"input","maxPoolGrad"),u=ky(n,"output","maxPoolGrad");Md(l.rank===s.rank,()=>`Rank of input (${l.rank}) does not match rank of dy (${s.rank})`),Md(4===s.rank,()=>`Error in maxPoolGrad: dy must be rank 4 but got rank ${s.rank}.`),Md(4===l.rank,()=>`Error in maxPoolGrad: input must be rank 4 but got rank ${l.rank}.`),null!=a&&Md(Ld(i),()=>`Error in maxPoolGrad: pad must be an integer when using, dimRoundingMode ${a} but got pad ${i}.`);const p={dy:s,input:l,output:u},c={filterSize:r,strides:o,pad:i,dimRoundingMode:a};return $y.runKernel(Kf,p,c)}}),pv={kernelName:qf,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{const[r,o]=t,{filterSize:i,strides:a,pad:s}=n;return{x:()=>uv(e,r,o,i,a,s)}}},cv={kernelName:Zf,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[r]=t,{axis:o}=n,i=zd(o,r.shape),a=Bd(l_(r.shape,i)[1]);return{x:()=>{const t=r.shape.slice();i.forEach(e=>{t[e]=1});const n=u$(e,t);return j$(Y$(n,__(r.shape,"float32")),a)}}}},dv={kernelName:Qf,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{const r=n,{axis:o}=r,[i,a]=t,s=rv(e,a,i,zd(o,i.shape));return{x:()=>s.x()}}},hv={kernelName:eg,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,r]=t;return{a:()=>Y$(e,hb(Uw(n,r),"float32")),b:()=>Y$(e,hb(V$(n,r),"float32"))}}},fv={kernelName:tg,inputsToSave:["x"],gradFunc:(e,t,n)=>{const r=t[0],{paddings:o}=n,i=o.map(e=>e[0]);return{x:()=>M_(e,i,r.shape)}}},gv={kernelName:ng,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,r]=t,o=D$(n.shape,r.shape);return{a:()=>{const t=M$(n.shape,o);return t.length>0?u$(Z$(e,t),n.shape):e},b:()=>{const t=Y$(e,m_(U$(j$(n,r)))),i=M$(r.shape,o);return i.length>0?u$(Z$(t,i),r.shape):t}}}},mv={kernelName:og,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,r]=t,o=D$(n.shape,r.shape);return{a:()=>{const t=Y$(e,hb(r,"float32")),i=M$(n.shape,o);return i.length>0?u$(Z$(t,i),n.shape):t},b:()=>{const t=Y$(e,hb(n,"float32")),i=M$(r.shape,o);return i.length>0?u$(Z$(t,i),r.shape):t}}}},yv={kernelName:ig,gradFunc:e=>({x:()=>m_(e)})},bv={kernelName:cg,inputsToSave:["indices"],gradFunc:(e,t)=>{const n=t[0];return{indices:()=>$_(n.shape,"float32")}}},$v={kernelName:pg,gradFunc:e=>({x:()=>Z_(e)})},_v={kernelName:dg,saveAllInputs:!0,gradFunc:(e,t,n)=>{const{axis:r}=n;return X_(e,r).map(e=>()=>e)}},wv={kernelName:hg,inputsToSave:["x"],gradFunc:(e,t,n)=>{const r=t[0],{paddings:o}=n,i=o.map(e=>e[0]);return{x:()=>M_(e,i,r.shape)}}},xv={kernelName:fg,inputsToSave:["a","b"],outputsToSave:[!0],gradFunc:(e,t)=>{const[n,r,o]=t,i=n,a=r,s=D$(i.shape,a.shape);return{a:()=>{const t=hb(a,"float32");let n=Y$(e,Y$(t,Xw(i,J$(t,zb(1)))));const r=M$(i.shape,s);return r.length>0&&(n=Z$(n,r)),u$(n,i.shape)},b:()=>{const t=V$(i,0),n=J_(t,q$(i),Z_(i));let r=Y$(e,Y$(o,n));const l=M$(a.shape,s);return l.length>0&&(r=Z$(r,l)),u$(r,a.shape)}}}},Sv={kernelName:gg,inputsToSave:["x","alpha"],gradFunc:(e,t)=>{const[n,r]=t,o=V$(n,0);return{x:()=>J_(o,e,Y$(e,r)),alpha:()=>{let t=J_(o,Z_(e),Y$(e,n));const i=M$(r.shape,e.shape);return i.length>0&&(t=Z$(t,i)),u$(t,r.shape)}}}},vv={kernelName:pf,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,r]=t,o=D$(n.shape,r.shape);return{a:()=>{const t=j$(e,hb(r,"float32")),i=M$(n.shape,o);return i.length>0?u$(Z$(t,i),n.shape):t},b:()=>{let t=Y$(e,hb(n,"float32"));const i=M$(r.shape,o);i.length>0&&(t=u$(Z$(t,i),r.shape));const a=f_(r);return m_(j$(t,hb(a,"float32")))}}}},kv={kernelName:$g,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>j$(e,m_(f_(n)))}}},Ev={kernelName:Eg,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t,r=Y$(Uw(n,6),uw(n));return{x:()=>Y$(e,hb(r,"float32"))}}},Iv={kernelName:_g,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Y$(e,hb(uw(n),"float32"))}}},Tv={kernelName:wg,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>u$(e,n.shape)}}},Fv={kernelName:vg,inputsToSave:["images"],gradFunc:(e,t,n)=>{const[r]=t,o={dy:e,images:r};return{images:()=>$y.runKernel(kg,o,n)}}},Nv={kernelName:xg,inputsToSave:["images"],gradFunc:(e,t,n)=>{const[r]=t,o={dy:e,images:r};return{images:()=>$y.runKernel(Sg,o,n)}}},jv={kernelName:Ig,gradFunc:(e,t,n)=>{const{dims:r}=n,o=zd(r,e.shape);return{x:()=>N_(e,o)}}},Av={kernelName:Tg,gradFunc:e=>({x:()=>Z_(e)})},Cv={kernelName:Fg,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>m_(j$(e,Y$(Xw(n,1.5),2)))}}},Mv=Iy({logicalNot_:function(e){const t={x:ky(e,"x","logicalNot","bool")};return $y.runKernel(Wf,t)}}),Dv={kernelName:jg,inputsToSave:["condition"],gradFunc:(e,t)=>{const[n]=t;return{condition:()=>hb(Z_(n),"float32"),t:()=>Y$(e,hb(n,e.dtype)),e:()=>Y$(e,hb(Mv(n),e.dtype))}}},Ov={kernelName:Ag,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>{const t=V$(n,zb(0)),r=zb(Dx),o=zb(Ox),i=Y$(e,o),a=Y$(Y$(e,r),R$(hb(n,"float32")));return J_(t,i,a)}}}},Rv={kernelName:Rg,outputsToSave:[!0],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Y$(e,Y$(n,J$(zb(1),n)))}}},Bv={kernelName:Og,gradFunc:e=>({x:()=>Z_(e)})},Pv=Iy({cos_:function(e){const t={x:ky(e,"x","cos","float32")};return $y.runKernel(Jh,t)}}),Lv={kernelName:Mg,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Y$(Pv(hb(n,"float32")),e)}}},Wv=Iy({cosh_:function(e){const t={x:ky(e,"x","cosh","float32")};return $y.runKernel(Zh,t)}}),Uv={kernelName:Dg,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Y$(Wv(hb(n,"float32")),e)}}},zv={kernelName:Cg,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[r]=t,{begin:o,size:i}=n,a=r.shape,[s,l]=Nb(r,o,i),u=[];for(let t=0;t<e.rank;t++)u.push([s[t],a[t]-s[t]-l[t]]);return{x:()=>x_(e,u)}}},Vv={kernelName:zg,outputsToSave:[!0],gradFunc:(e,t,n)=>{const[r]=t,{dim:o}=n,i=Y$(e,r);return{logits:()=>J$(i,Y$(Z$(i,[o],!0),r))}}},Hv={kernelName:Bg,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Y$(e,C_(n))}}},Gv=Iy({batchToSpaceND_:function(e,t,n){const r=ky(e,"x","batchToSpaceND"),o=t.reduce((e,t)=>e*t);Md(r.rank>=1+t.length,()=>`input rank is ${r.rank} but should be > than blockShape.length ${t.length}`),Md(n.length===t.length,()=>`crops.length is ${n.length} but should be equal to blockShape.length  ${t.length}`),Md(r.shape[0]%o===0,()=>`input tensor batch is ${r.shape[0]} but is not divisible by the product of the elements of blockShape ${t.join(" * ")} === ${o}`);const i={x:r},a={blockShape:t,crops:n};return $y.runKernel(Oh,i,a)}}),qv={kernelName:Wg,gradFunc:(e,t,n)=>{const{blockShape:r,paddings:o}=n;return{x:()=>Gv(e,r,o)}}},Kv={kernelName:Ug,gradFunc:(e,t,n)=>{const{axis:r}=n;return{x:()=>y$(e,r)}}},Xv=[Yx,Jx,Zx,Qx,eS,tS,nS,rS,oS,iS,aS,sS,uS,cS,dS,fS,gS,mS,yS,bS,$S,_S,xS,wS,vS,ES,TS,NS,jS,AS,vv,CS,MS,DS,OS,RS,PS,BS,WS,zS,GS,qS,KS,XS,YS,JS,ZS,QS,ev,nv,ov,ov,av,lv,pv,cv,dv,hv,fv,gv,mv,yv,bv,$v,_v,wv,wv,xv,Sv,kv,Ev,Iv,Tv,Fv,Nv,jv,Av,Cv,Dv,Ov,Rv,Bv,Lv,Uv,zv,Vv,Hv,qv,qv,Kv,Kv,{kernelName:Pg,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>j$(e,Y$(U_(hb(n,"float32")),2))}}},{kernelName:Xg,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,r]=t,o=zb(2);return{a:()=>Y$(e,Y$(o,J$(n,r))),b:()=>Y$(e,Y$(o,J$(r,n)))}}},{kernelName:Yg,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Y$(e,Y$(hb(n,"float32"),2))}}},{kernelName:dm,gradFunc:e=>({x:()=>Z_(e)})},{kernelName:tm,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,r]=t,o=D$(n.shape,r.shape);return{a:()=>{let t=e;const r=M$(n.shape,o);return r.length>0&&(t=Z$(t,r)),u$(t,n.shape)},b:()=>{let t=e;const n=M$(r.shape,o);return n.length>0&&(t=Z$(t,n)),u$(m_(t),r.shape)}}}},{kernelName:Lg,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[r]=t,o=r.shape.slice(),{axis:i}=n;zd(i,r.shape).forEach(e=>{o[e]=1});const a=u$(e,o),s=Y$(a,__(r.shape,"float32"));return{x:()=>s}}}
vendor: 17,211 bytes, line 2
2,{kernelName:nm,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>j$(e,f_(Pv(n)))}}},{kernelName:rm,outputsToSave:[!0],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Y$(J$(zb(1),f_(n)),e)}}},{kernelName:om,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[r]=t,{reps:o}=n;return{x:()=>{let t=Z_(r);if(1===r.rank)for(let n=0;n<o[0];++n)t=Gb(t,M_(e,[n*r.shape[0]],[r.shape[0]]));else if(2===r.rank)for(let n=0;n<o[0];++n)for(let i=0;i<o[1];++i)t=Gb(t,M_(e,[n*r.shape[0],i*r.shape[1]],[r.shape[0],r.shape[1]]));else if(3===r.rank)for(let n=0;n<o[0];++n)for(let i=0;i<o[1];++i)for(let a=0;a<o[2];++a)t=Gb(t,M_(e,[n*r.shape[0],i*r.shape[1],a*r.shape[2]],[r.shape[0],r.shape[1],r.shape[2]]));else{if(4!==r.rank)throw new Error(`Gradient for tile operation is not implemented for rank-${r.rank} tensors yet.`);for(let n=0;n<o[0];++n)for(let i=0;i<o[1];++i)for(let a=0;a<o[2];++a)for(let s=0;s<o[3];++s)t=Gb(t,M_(e,[n*r.shape[0],i*r.shape[1],a*r.shape[2],s*r.shape[3]],[r.shape[0],r.shape[1],r.shape[2],r.shape[3]]))}return t}}}},{kernelName:sm,gradFunc:(e,t,n)=>{const r=n,{perm:o}=r,i=d_(o);return{x:()=>Q_(e,i)}}},{kernelName:um,gradFunc:(e,t,n)=>{const r=n,{axis:o}=r;return{value:()=>V_(e,o)}}},{kernelName:pm,inputsToSave:["segmentIds"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>function(e,t){const n=o_(t,Z_(t)),r=z$(e,n);let o=H$(t,zb(0,"int32"));const i=r.rank-o.rank;for(let e=0;e<i;++e)o=B$(o,e+1);o=e_(o,__(r.shape,"bool"));const a=Z_(r);return J_(o,r,a)}(e,n)}}},{kernelName:cm,gradFunc:e=>({x:()=>Z_(e)})}];for(const e of Xv)vm(e);let Yv;function Jv(){return null==Yv&&(Yv=$y.backend.epsilon()),Yv}class Zv extends Error{constructor(e){super(e),Object.setPrototypeOf(this,Zv.prototype)}}class Qv extends Error{constructor(e){super(e),Object.setPrototypeOf(this,Qv.prototype)}}class ek extends Error{constructor(e){super(e),Object.setPrototypeOf(this,ek.prototype)}}class tk extends Error{constructor(e){super(e),Object.setPrototypeOf(this,tk.prototype)}}class nk extends Error{constructor(e){super(e),Object.setPrototypeOf(this,nk.prototype)}}function rk(e,t){if(Array.isArray(e)){let n=[];for(let r=0;r<t;r++)n=n.concat(e);return n}{const n=new Array(t);return n.fill(e),n}}function ok(e,t){if(!e)throw new nk(t)}function ik(e,t){let n=0;for(const r of e)r===t&&n++;return n}function ak(e){return 1===e.length?e[0]:e}function sk(e){return Array.isArray(e)?e:[e]}function lk(e){const t=e.replace(/(.)([A-Z][a-z0-9]+)/g,"$1_$2").replace(/([a-z])([A-Z])/g,"$1_$2").toLowerCase();return"_"!==t[0]?t:"private"+t}function uk(e){return e.length<=1||-1===e.indexOf("_")?e:e.replace(/[_]+(\w|$)/g,(e,t)=>t.toUpperCase())}Error;let pk={};function ck(e){if(null==e)return null;const t={};return t.className=e.getClassName(),t.config=e.getConfig(),t}function dk(e){if(null!=e&&"object"==typeof e)if(Array.isArray(e))e.forEach(e=>dk(e));else{const t=Object.keys(e);for(const n of t){const t=e[n];null!=t&&"object"==typeof t&&(Array.isArray(t)||"ndarray"!==t.type||"number"!=typeof t.value?dk(t):e[n]=t.value)}}}function hk(e,t={},n={},r="object",o=!1){if("string"==typeof e){const o=e;let i;if(o in n)i=n[o];else if(o in pk)i=pk[o];else if(i=t[o],null==i)throw new ek(`Unknown ${r}: ${e}. This may be due to one of the following reasons:\n1. The ${r} is defined in Python, in which case it needs to be ported to TensorFlow.js or your JavaScript code.\n2. The custom ${r} is defined in JavaScript, but is not registered properly with tf.serialization.registerClass().`);return i}{const i=e;if(null==i.className||null==i.config)throw new ek(`${r}: Improper config format: ${JSON.stringify(i)}.\n'className' and 'config' must set.`);const a=i.className;let s,l;if(a in n?[s,l]=n[a]:a in pk?[s,l]=pk.className:a in t&&([s,l]=t[a]),null==s)throw new ek(`Unknown ${r}: ${a}. This may be due to one of the following reasons:\n1. The ${r} is defined in Python, in which case it needs to be ported to TensorFlow.js or your JavaScript code.\n2. The custom ${r} is defined in JavaScript, but is not registered properly with tf.serialization.registerClass().`);if(null!=l){const e={};for(const t of Object.keys(pk))e[t]=pk[t];for(const t of Object.keys(n))e[t]=n[t];i.config.customObjects=e;const t=Object.assign({},pk);for(const e of Object.keys(n))pk[e]=n[e];dk(i.config);const r=l(s,i.config,n,o);return pk=Object.assign({},t),r}{const e=Object.assign({},pk);for(const e of Object.keys(n))pk[e]=n[e];const t=new s(i.config);return pk=Object.assign({},e),t}}}function fk(e,t){return-1*function(e,t){return e<t?-1:e>t?1:0}(e,t)}function gk(e){if(null==e)return e;const t=[];for(const n of e)-1===t.indexOf(n)&&t.push(n);return t}function mk(e){if(null==e)throw new ek(`Invalid value in obj: ${JSON.stringify(e)}`);for(const t in e)if(e.hasOwnProperty(t))return!1;return!0}function yk(e,t,n){if(null!=n&&e.indexOf(n)<0)throw new ek(`${n} is not a valid ${t}.  Valid values are ${e} or null/undefined.`)}function bk(e,t,n=0,r=1/0){return ok(n>=0),ok(r>=n),Array.isArray(e)&&e.length>=n&&e.length<=r&&e.every(e=>typeof e===t)}function $k(e,t){Array.isArray(e)?(Md(e.length>0,()=>`${t} is unexpectedly an empty array.`),e.forEach((e,n)=>$k(e,`element ${n+1} of ${t}`))):Md(Number.isInteger(e)&&e>0,()=>`Expected ${t} to be a positive integer, but got ${_k(e)}.`)}function _k(e){return null===e?"null":Array.isArray(e)?"["+e.map(e=>_k(e)).join(",")+"]":"string"==typeof e?`"${e}"`:`${e}`}function wk(e){return"relu"===e?"relu":"linear"===e?"linear":"elu"===e?"elu":null}function xk(e,t){return Bb(()=>U_(Z$(Y$(e,e),t,!0)))}class Sk extends Cb{getConfig(){return{}}}class vk extends Sk{constructor(e){super(),this.defaultMaxValue=2,this.defaultAxis=0,this.maxValue=null!=e.maxValue?e.maxValue:this.defaultMaxValue,this.axis=null!=e.axis?e.axis:this.defaultAxis}apply(e){return Bb(()=>{const t=xk(e,this.axis),n=m$(t,0,this.maxValue);return Y$(e,j$(n,Gb(Jv(),t)))})}getConfig(){return{maxValue:this.maxValue,axis:this.axis}}}vk.className="MaxNorm",Db(vk);class kk extends Sk{constructor(e){super(),this.defaultAxis=0,this.axis=null!=e.axis?e.axis:this.defaultAxis}apply(e){return Bb(()=>j$(e,Gb(Jv(),xk(e,this.axis))))}getConfig(){return{axis:this.axis}}}kk.className="UnitNorm",Db(kk);class Ek extends Sk{apply(e){return F_(e)}}Ek.className="NonNeg",Db(Ek);class Ik extends Sk{constructor(e){super(),this.defaultMinValue=0,this.defaultMaxValue=1,this.defaultRate=1,this.defaultAxis=0,this.minValue=null!=e.minValue?e.minValue:this.defaultMinValue,this.maxValue=null!=e.maxValue?e.maxValue:this.defaultMaxValue,this.rate=null!=e.rate?e.rate:this.defaultRate,this.axis=null!=e.axis?e.axis:this.defaultAxis}apply(e){return Bb(()=>{const t=xk(e,this.axis),n=Gb(Y$(this.rate,m$(t,this.minValue,this.maxValue)),Y$(1-this.rate,t));return Y$(e,j$(n,Gb(Jv(),t)))})}getConfig(){return{minValue:this.minValue,maxValue:this.maxValue,rate:this.rate,axis:this.axis}}}Ik.className="MinMaxNorm",Db(Ik);const Tk={maxNorm:"MaxNorm",minMaxNorm:"MinMaxNorm",nonNeg:"NonNeg",unitNorm:"UnitNorm"};function Fk(e){return ck(e)}function Nk(e,t={}){return hk(e,Mb.getMap().classNameMap,t,"constraint")}function jk(e){return null==e?null:"string"==typeof e?Nk({className:e in Tk?Tk[e]:e,config:{}}):e instanceof Sk?e:Nk(e)}const Ak=["channelsFirst","channelsLast"],Ck=["nearest","bilinear"],Mk=["valid","same","causal"],Dk=["max","avg"],Ok=["sum","mul","concat","ave"],Rk=new Map;function Bk(e){yk(Ak,"DataFormat",e)}function Pk(e){yk(Mk,"PaddingMode",e)}function Lk(e){yk(Dk,"PoolMode",e)}const Wk=[];function Uk(e,t){Wk.push(e);try{const e=t();return Wk.pop(),e}catch(e){throw Wk.pop(),e}}function zk(e){if(!Gk(e))throw new Error("Not a valid tensor name: '"+e+"'");return(0===Wk.length?"":Wk.join("/")+"/")+e}function Vk(e){if(!Gk(e))throw new Error("Not a valid tensor name: '"+e+"'");Rk.has(e)||Rk.set(e,0);const t=Rk.get(e);if(Rk.set(e,Rk.get(e)+1),t>0){const n=`${e}_${t}`;return Rk.set(n,1),n}return e}const Hk=new RegExp(/^[A-Za-z0-9][-A-Za-z0-9\._\/]*$/);function Gk(e){return!!e.match(Hk)}function qk(e){return e===parseInt(e.toString(),10)}function Kk(e,t,n){null==t&&(t=0),null==n&&(n=e.length);let r=1;for(let o=t;o<n;++o)r*=e[o];return r}function Xk(e){if(0===e.length)return Number.NaN;let t=Number.POSITIVE_INFINITY;for(let n=0;n<e.length;n++){const r=e[n];r<t&&(t=r)}return t}function Yk(e){if(0===e.length)return Number.NaN;let t=Number.NEGATIVE_INFINITY;for(let n=0;n<e.length;n++){const r=e[n];r>t&&(t=r)}return t}function Jk(e,t){if(t<e)throw new ek(`end (${t}) < begin (${e}) is forbidden.`);const n=[];for(let r=e;r<t;++r)n.push(r);return n}function Zk(e,t){return hb(e,t)}function Qk(e,t=-1){const n=e.shape.slice();return t<0&&(t=n.length+t+1),n.splice(t,0,1),u$(e,n)}function eE(e,t,n){return Bb(()=>{switch(e.rank){case 1:return D_(e,t,n);case 2:return O_(e,[t,0],[n,e.shape[1]]);case 3:return R_(e,[t,0,0],[n,e.shape[1],e.shape[2]]);case 4:return B_(e,[t,0,0,0],[n,e.shape[1],e.shape[2],e.shape[3]]);case 5:return M_(e,[t,0,0,0,0],[n,e.shape[1],e.shape[2],e.shape[3],e.shape[4]]);case 6:return M_(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 ek(`sliceAlongFirstAxis() received an unsupported tensor rank: ${e.rank}`)}})}function tE(e,t,n){return Bb(()=>{switch(e.rank){case 1:return D_(e,t,n);case 2:return O_(e,[0,t],[e.shape[0],n]);case 3:return R_(e,[0,0,t],[e.shape[0],e.shape[1],n]);case 4:return B_(e,[0,0,0,t],[e.shape[0],e.shape[1],e.shape[2],n]);default:throw new ek(`sliceAlongLastAxis() received an unsupported tensor rank: ${e.rank}`)}})}function nE(e,t,n,r){return Bb(()=>{switch(e.rank){case 1:return D_(e,t,n);case 2:switch(r){case 1:return eE(e,t,n);case 2:return tE(e,t,n);default:throw new ek(`The axis is not within the rank of the tensor ${r}`)}case 3:switch(r){case 1:return eE(e,t,n);case 2:return R_(e,[0,t,0],[e.shape[0],n,e.shape[2]]);case 3:return tE(e,t,n);default:throw new ek(`The axis is not within the rank of the tensor ${r}`)}case 4:switch(r){case 1:return eE(e,t,n);case 2:return B_(e,[0,t,0,0],[e.shape[0],n,e.shape[2],e.shape[3]]);case 3:return B_(e,[0,0,t,0],[e.shape[0],e.shape[1],n,e.shape[3]]);case 4:return tE(e,t,n);default:throw new ek(`The axis is not within the rank of the tensor ${r}`)}default:throw new ek(`sliceAlongLastAxis() received an unsupported tensor rank: ${e.rank}`)}})}function rE(e,t=-1){let n;return t<0&&(n=e[0].rank,t=0!==n?n:0),t===e[0].rank&&(t=-1),y$(e,t)}function oE(e,t){switch(e.rank){case 1:return b$([e,t]);case 2:return $$([e,t],0);case 3:return _$([e,t],0);case 4:return w$([e,t],0);default:throw new ek(`concatAlongFirstAxis() received an unsupported tensor rank: ${e.rank}`)}}function iE(e,t){if(Array.isArray(t)||(t=[t]),e.rank!==t.length)throw new ek(`The length of input n (${t.length}) does not match the number of dimensions in input x (${e.rank})`);return P$(e,t)}function aE(e,t=0,n=1,r,o){return I_(e,t,n,r,o)}function sE(e,t,n,r){if(e.rank<2||t.rank<2)throw new tk(`dot requires both inputs to be rank >= 2 but got x shape = ${e.shape} and y shape = ${t.shape}`);if(t.rank>=3&&e.shape.slice(-1)[0]!==t.shape.slice(-2)[0])throw new tk(`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(2===e.rank&&2===t.rank)return bw({a:e,b:t,transposeA:!1,transposeB:!1,bias:r?pE(e.rank,r,"channelsLast"):null,activation:n});{const o=e.shape.slice(),i=o.pop();e=u$(e,[-1,i]);const a=t.shape.slice(),s=a.pop(),l=a.pop(),u=[...a,s],p=Array.from({length:t.rank},(e,n)=>0===n?t.rank-2:n<=t.rank-2?n-1:n);t=u$(Q_(t,p),[l,-1]);const c=[...o,...u];return u$(bw({a:e,b:t,transposeA:!1,transposeB:!1,bias:r?pE(e.rank,r,"channelsLast"):null,activation:n}),c)}}function lE(e,t,n){return Bb(()=>(t=Array.isArray(t)?G_(t,"int32"):hb(t,"int32"),z$(e,t,n)))}function uE(e){return Y$(e,e)}function pE(e,t,n){const r=t.shape;if(1!==t.rank&&t.rank!==e)throw new ek(`Unexpected bias dimensions: ${t.rank}; expected it to be 1 or ${e}`);if(5===e){if("channelsFirst"===n)return 1===r.length?u$(t,[1,r[0],1,1,1]):u$(t,[1,r[3],r[0],r[1],r[2]]);if("channelsLast"===n)return 1===r.length?u$(t,[1,1,1,1,r[0]]):u$(t,[1].concat(r))}else if(4===e){if("channelsFirst"===n)return 1===r.length?u$(t,[1,r[0],1,1]):u$(t,[1,r[2],r[0],r[1]]);if("channelsLast"===n)return 1===r.length?u$(t,[1,1,1,r[0]]):u$(t,[1].concat(r))}else if(3===e){if("channelsFirst"===n)return 1===r.length?u$(t,[1,r[0],1]):u$(t,[1,r[1],r[0]]);if("channelsLast"===n)return 1===r.length?u$(t,[1,1,r[0]]):u$(t,[1].concat(r))}else if(e<3)return t;throw new ek(`Unsupported input rank by biasAdd: ${t.rank}`)}function cE(e,t,n){return Bb(()=>(null==n&&(n="channelsLast"),Bk(n),Gb(e,pE(e.rank,t,n))))}function dE(e,t,n,r){return Bb(()=>ew(e,t,n,r))}function hE(e,t,n=!1){return n?e():t()}const fE=["fanIn","fanOut","fanAvg"],gE=["normal","uniform","truncatedNormal"];class mE extends Cb{fromConfigUsesCustomObjects(){return!1}getConfig(){return{}}}class yE extends mE{apply(e,t){return $_(e,t)}}yE.className="Zeros",Db(yE);class bE extends mE{apply(e,t){return __(e,t)}}bE.className="Ones",Db(bE);class $E extends mE{constructor(e){if(super(),"object"!=typeof e)throw new ek(`Expected argument of type ConstantConfig but got ${e}`);if(void 0===e.value)throw new ek(`config must have value set but got ${e}`);this.value=e.value}apply(e,t){return Bb(()=>Y$(zb(this.value),__(e,t)))}getConfig(){return{value:this.value}}}$E.className="Constant",Db($E);class _E extends mE{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 T_(e,this.minval,this.maxval,t)}getConfig(){return{minval:this.minval,maxval:this.maxval,seed:this.seed}}}_E.className="RandomUniform",Db(_E);class wE extends mE{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("float32"!==(t=t||"float32")&&"int32"!==t)throw new tk(`randomNormal does not support dType ${t}.`);return aE(e,this.mean,this.stddev,t,this.seed)}getConfig(){return{mean:this.mean,stddev:this.stddev,seed:this.seed}}}wE.className="RandomNormal",Db(wE);class xE extends mE{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("float32"!==(t=t||"float32")&&"int32"!==t)throw new tk(`truncatedNormal does not support dType ${t}.`);return K_(e,this.mean,this.stddev,t,this.seed)}getConfig(){return{mean:this.mean,stddev:this.stddev,seed:this.seed}}}xE.className="TruncatedNormal",Db(xE);class SE extends mE{constructor(e){super(),this.gain=null!=e.gain?e.gain:1}apply(e,t){return Bb(()=>{if(2!==e.length||e[0]!==e[1])throw new ek("Identity matrix initializer can only be used for 2D square matrices.");return Y$(this.gain,L$(e[0]))})}getConfig(){return{gain:this.gain}}}SE.className="Identity",Db(SE);class vE extends mE{constructor(e){if(super(),e.scale<0)throw new ek(`scale must be a positive float. Got: ${e.scale}`);var t;this.scale=null==e.scale?1:e.scale,this.mode=null==e.mode?"fanIn":e.mode,t=this.mode,yk(fE,"FanMode",t),this.distribution=null==e.distribution?"normal":e.distribution,function(e){yk(gE,"Distribution",e)}(this.distribution),this.seed=e.seed}apply(e,t){const n=function(e,t="channelsLast"){let n,r;if(Bk(t),2===e.length)n=e[0],r=e[1];else if(-1!==[3,4,5].indexOf(e.length)){if("channelsFirst"===t){const t=Kk(e,2);n=e[1]*t,r=e[0]*t}else if("channelsLast"===t){const t=Kk(e,0,e.length-2);n=e[e.length-2]*t,r=e[e.length-1]*t}}else{const t=Kk(e);n=Math.sqrt(t),r=Math.sqrt(t)}return[n,r]}(e),r=n[0],o=n[1];let i=this.scale;if("fanIn"===this.mode?i/=Math.max(1,r):"fanOut"===this.mode?i/=Math.max(1,o):i/=Math.max(1,(r+o)/2),"normal"===this.distribution){const n=Math.sqrt(i);if("float32"!==(t=t||"float32")&&"int32"!==t)throw new tk(`${this.getClassName()} does not support dType ${t}.`);return K_(e,0,n,t,this.seed)}{const n=Math.sqrt(3*i);return T_(e,-n,n,t)}}getConfig(){return{scale:this.scale,mode:this.mode,distribution:this.distribution,seed:this.seed}}}vE.className="VarianceScaling",Db(vE);class kE extends vE{constructor(e){super({scale:1,mode:"fanAvg",distribution:"uniform",seed:null==e?null:e.seed})}getClassName(){return vE.className}}kE.className="GlorotUniform",Db(kE);class EE extends vE{constructor(e){super({scale:1,mode:"fanAvg",distribution:"normal",seed:null==e?null:e.seed})}getClassName(){return vE.className}}EE.className="GlorotNormal",Db(EE);class IE extends vE{constructor(e){super({scale:2,mode:"fanIn",distribution:"normal",seed:null==e?null:e.seed})}getClassName(){return vE.className}}IE.className="HeNormal",Db(IE);class TE extends vE{constructor(e){super({scale:2,mode:"fanIn",distribution:"uniform",seed:null==e?null:e.seed})}getClassName(){return vE.className}}TE.className="HeUniform",Db(TE);class FE extends vE{constructor(e){super({scale:1,mode:"fanIn",distribution:"normal",seed:null==e?null:e.seed})}getClassName(){return vE.className}}FE.className="LeCunNormal",Db(FE);class NE extends vE{constructor(e){super({scale:1,mode:"fanIn",distribution:"uniform",seed:null==e?null:e.seed})}getClassName(){return vE.className}}
vendor: 18,089 bytes, line 2
2NE.className="LeCunNormal",Db(NE);class jE extends mE{constructor(e){if(super(),this.DEFAULT_GAIN=1,this.gain=null==e.gain?this.DEFAULT_GAIN:e.gain,this.seed=e.seed,null!=this.seed)throw new tk("Random seed is not implemented for Orthogonal Initializer yet.")}apply(e,t){return Bb(()=>{if(e.length<2)throw new tk("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.`);const t=aE(e[0]>e[1]?[e[1],e[0]]:e,0,1,"float32");let n=hx.gramSchmidt(t);return e[0]>e[1]&&(n=Q_(n)),Y$(this.gain,n)})}getConfig(){return{gain:this.gain,seed:this.seed}}}jE.className="Orthogonal",Db(jE);const AE={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 CE(e,t={}){return hk(e,Mb.getMap().classNameMap,t,"initializer")}function ME(e){return ck(e)}function DE(e){if("string"==typeof e){const t=e in AE?AE[e]:e;if("GlorotNormal"===t)return new EE;if("GlorotUniform"===t)return new kE;if("HeNormal"===t)return new IE;if("HeUniform"===t)return new TE;if("LeCunNormal"===t)return new FE;if("LeCunUniform"===t)return new NE;{const e={};return e.className=t,e.config={},CE(e)}}return e instanceof mE?e:CE(e)}let OE=0;function RE(){return OE++}const BE={};function PE(e=""){return e in BE||(BE[e]=0),BE[e]+=1,e+BE[e].toString()}function LE(e){return Array.isArray(e)&&Array.isArray(e[0])}function WE(e){return 0===e.length?[]:Array.isArray(e[0])?e:[e]}function UE(e){let t;if(Array.isArray(e)){if(1!==e.length)throw new ek(`Expected Tensor length to be 1; got ${e.length}`);t=e[0]}else t=e;return t}function zE(e){if(Array.isArray(e)&&Array.isArray(e[0])){if(1===e.length)return e[0];throw new ek(`Expected exactly 1 Shape; got ${e.length}`)}return e}function VE(e){let t=0;for(const n of e)0===n.shape.length?t+=1:t+=n.shape.reduce((e,t)=>e*t);return t}const HE="Variable";class GE{constructor(e,t="float32",n=HE,r=!0,o=null){this.dtype=null==t?"float32":t,this.shape=e.shape,this.id=RE(),n=null==n?HE:n,this.originalName=zk(n),this.name=Vk(this.originalName),this.trainable_=r,this.constraint=o,this.val=function(e,t=!0,n,r){return $y.makeVariable(e,t,n,r)}(e,this.trainable_,this.name,this.dtype)}read(){return this.assertNotDisposed(),this.val}write(e){return this.assertNotDisposed(),function(e,t){if(e.shape.toString()!==t.shape.toString())throw new Error("Shape mismatch: "+JSON.stringify(e.shape)+" vs. "+JSON.stringify(t.shape))}(this.val,e),this.val.id!==e.id&&(this.val.assign(e),null!=this.constraint&&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 qE(e){return e.map(e=>e.read())}function KE(e){e.forEach(e=>{e[0].write(e[1])})}class XE{constructor(e){this.dtype=e.dtype,this.shape=e.shape,null!=e.shape?this.ndim=e.shape.length:this.ndim=e.ndim,this.maxNDim=e.maxNDim,this.minNDim=e.minNDim,this.axes=e.axes||{}}}class YE{constructor(e,t,n,r,o,i,a){this.dtype=e,this.shape=t,this.sourceLayer=n,this.inputs=r,this.callArgs=o,this.outputTensorIndex=a,this.id=RE(),null!=i&&(this.originalName=zk(i),this.name=Vk(this.originalName)),this.rank=t.length}}let JE=0;class ZE{constructor(e,t){this.callArgs=t,this.id=JE++,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(const t of e.inboundLayers)null!=t&&t.outboundNodes.push(this);e.outboundLayer.inboundNodes.push(this)}getConfig(){const e=[];for(const t of this.inboundLayers)null!=t?e.push(t.name):e.push(null);return{outboundLayer:this.outboundLayer?this.outboundLayer.name:null,inboundLayers:e,nodeIndices:this.nodeIndices,tensorIndices:this.tensorIndices}}}let QE=0;class eI extends Cb{constructor(e={}){super(),this._callHook=null,this._addedWeightNames=[],this._stateful=!1,this.id=QE++,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){const e=this.getClassName();t=lk(e)+"_"+PE(e)}if(this.name=t,this.trainable_=null==e.trainable||e.trainable,null!=e.inputShape||null!=e.batchInputShape){let t;if(null!=e.batchInputShape)t=e.batchInputShape;else if(null!=e.inputShape){let n=null;null!=e.batchSize&&(n=e.batchSize),t=[n].concat(e.inputShape)}this.batchInputShape=t;let n=e.dtype;null==n&&(n=e.inputDType),null==n&&(n="float32"),this.dtype=n}null!=e.weights?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(0===this.inboundNodes.length)throw new Qv(`The layer has never been called and thus has no defined ${t}.`);if(this.inboundNodes.length<=e)throw new ek(`Asked to get ${t} at node ${e}, but the layer has only ${this.inboundNodes.length} inbound nodes.`);return this.inboundNodes[e]}getInputAt(e){return ak(this.getNodeAtIndex(e,"input").inputTensors)}getOutputAt(e){return ak(this.getNodeAtIndex(e,"output").outputTensors)}get input(){if(this.inboundNodes.length>1)throw new Zv(`Layer ${this.name} has multiple inbound nodes, hence the notion of "layer input" is ill-defined. Use \`getInputAt(nodeIndex)\` instead.`);if(0===this.inboundNodes.length)throw new Zv(`Layer ${this.name} is not connected, no input to return.`);return ak(this.getNodeAtIndex(0,"input").inputTensors)}get output(){if(0===this.inboundNodes.length)throw new Zv(`Layer ${this.name} has no inbound nodes.`);if(this.inboundNodes.length>1)throw new Zv(`Layer ${this.name} has multiple inbound nodes, hence the notion of "layer output" is ill-defined. Use \`getOutputAt(nodeIndex)\` instead.`);return ak(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=sk(e),null==this.inputSpec||0===this.inputSpec.length)return;const t=sk(this.inputSpec);if(e.length!==t.length)throw new ek(`Layer ${this.name} expects ${t.length} inputs, but it received ${e.length} input tensors. Input received: ${e}`);for(let n=0;n<e.length;n++){const r=e[n],o=t[n];if(null==o)continue;const i=r.rank;if(null!=o.ndim&&i!==o.ndim)throw new ek(`Input ${n} is incompatible with layer ${this.name}: expected ndim=${o.ndim}, found ndim=${i}`);if(null!=o.maxNDim&&i>o.maxNDim)throw new ek(`Input ${n} is incompatible with layer ${this.name}: expected max_ndim=${o.maxNDim}, found ndim=${i}`);if(null!=o.minNDim&&i<o.minNDim)throw new ek(`Input ${n} is incompatible with layer ${this.name}: expected min_ndim=${o.minNDim}, found ndim=${i}.`);if(null!=o.dtype&&r.dtype!==o.dtype)throw new ek(`Input ${n} is incompatible with layer ${this.name} : expected dtype=${o.dtype}, found dtype=${r.dtype}.`);if(o.axes){const e=r.shape;for(const t in o.axes){const r=Number(t),i=o.axes[t],a=r>=0?e[r]:e[e.length+r];if(null!=i&&-1===[i,null].indexOf(a))throw new ek(`Input ${n} is incompatible with layer ${this.name}: expected axis ${r} of input shape to have value ${i} but got shape ${e}.`)}}if(null!=o.shape)for(let e=0;e<o.shape.length;++e){const t=o.shape[e],i=r.shape[e];if(null!=t&&null!=i&&t!==i)throw new ek(`Input ${n} is incompatible with layer ${this.name}: expected shape=${o.shape}, found shape=${r.shape}.`)}}}call(e,t){return e}invokeCallHook(e,t){null!=this._callHook&&this._callHook(e,t)}setCallHook(e){this._callHook=e}clearCallHook(){this._callHook=null}apply(e,t){t=t||{},this.assertNotDisposed();const n=sk(e);let r=!0;for(const e of n)if(!(e instanceof YE)){r=!1;break}let o=!0;for(const e of n)if(e instanceof YE){o=!1;break}if(r===o)throw new ek("Arguments to apply() must be all SymbolicTensors or all Tensors");return Uk(this.name,()=>{if(!this.built){this.assertInputCompatibility(e);const t=[];for(const n of sk(e))t.push(n.shape);this.build(ak(t)),this.built=!0,this.initialWeights&&this.setWeights(this.initialWeights),null===this._refCount&&o&&(this._refCount=1)}if(this.assertInputCompatibility(e),o){let r=this.call(e,t);const o=sk(r),i=[];for(let e of o)-1!==n.indexOf(e)&&(e=e.clone()),i.push(e);if(r=ak(i),null!=this.activityRegularizer)throw new tk("Layer invocation in the presence of activity regularizer(s) is not supported yet.");return r}{const n=function(e){e=sk(e);const t=[];for(const n of e)t.push(n.shape);return ak(t)}(e),r=this.computeOutputShape(n);let o;const i="float32";if(this.warnOnIncompatibleInputShape(Array.isArray(e)?n[0]:n),o=null!=r&&r.length>0&&Array.isArray(r[0])?r.map((n,r)=>new YE(i,n,this,sk(e),t,this.name,r)):new YE(i,r,this,sk(e),t,this.name),this.addInboundNode(e,o,null,null,n,r,t),this._refCount++,null!=this.activityRegularizer)throw new tk("Layer invocation in the presence of activity regularizer(s) is not supported yet.");return o}})}warnOnIncompatibleInputShape(e){if(null!=this.batchInputShape)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,r)=>{null!=n&&null!=e[r]&&e[r]!==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(null==this.inboundNodes||0===this.inboundNodes.length)throw new Zv(`The layer ${this.name} has never been called and thus has no defined output shape.`);const e=[];for(const t of this.inboundNodes){const n=JSON.stringify(t.outputShapes);-1===e.indexOf(n)&&e.push(n)}if(1===e.length){const e=this.inboundNodes[0].outputShapes;return Array.isArray(e)&&Array.isArray(e[0])&&1===e.length?e[0]:e}throw new Zv(`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 Qv(`You tried to call countParams() on ${this.name}, but the layer is not built yet. Build it first by calling build(batchInputShape).`);return VE(this.weights)}build(e){this.built=!0}getWeights(e=!1){return qE(e?this.trainableWeights:this.weights)}setWeights(e){Bb(()=>{const t=this.weights;if(t.length!==e.length)throw new ek(`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(0===t.length)return;const n=[],r=qE(t);for(let o=0;o<r.length;++o){const i=r[o],a=t[o],s=e[o];if(!Pd(i.shape,s.shape))throw new ek(`Layer weight shape ${i.shape} not compatible with provided weight shape ${s.shape}`);n.push([a,s])}KE(n)})}addWeight(e,t,n,r,o,i,a){if(-1!==this._addedWeightNames.indexOf(e))throw new ek(`Duplicate weight name ${e} for layer ${this.name}`);this._addedWeightNames.push(e),null==n&&(n="float32"),this.fastWeightInitDuringBuild&&(r=DE("zeros"));const s=r.apply(t,n),l=new GE(s,n,e,i,a);return s.dispose(),null!=o&&this.addLoss(()=>o.apply(l.read())),null==i&&(i=!0),i?this._trainableWeights.push(l):this._nonTrainableWeights.push(l),l}setFastWeightInitDuringBuild(e){this.fastWeightInitDuringBuild=e}addLoss(e){null==e||Array.isArray(e)&&0===e.length||(e=sk(e),void 0!==this._losses&&null!==this._losses&&this.losses.push(...e))}computeOutputShape(e){return e}computeMask(e,t){if(!this.supportsMasking){if(null!=t){if(!Array.isArray(t))throw new TypeError(`Layer ${this.name} does not support masking, but was passed an inputMask.`);t.forEach(e=>{if(null!=e)throw new TypeError(`Layer ${this.name} does not support masking, but was passed an inputMask.`)})}return null}return t}addInboundNode(e,t,n,r,o,i,a=null){const s=sk(e);t=sk(t),n=sk(n),r=sk(r),o=WE(o),i=WE(i);const l=[],u=[],p=[];for(const e of s)l.push(e.sourceLayer),u.push(e.nodeIndex),p.push(e.tensorIndex);new ZE({outboundLayer:this,inboundLayers:l,nodeIndices:u,tensorIndices:p,inputTensors:s,outputTensors:t,inputMasks:n,outputMasks:r,inputShapes:o,outputShapes:i},a);for(let e=0;e<t.length;e++)t[e].sourceLayer=this,t[e].nodeIndex=this.inboundNodes.length-1,t[e].tensorIndex=e}getConfig(){const e={name:this.name,trainable:this.trainable};return null!=this.batchInputShape&&(e.batchInputShape=this.batchInputShape),null!=this.dtype&&(e.dtype=this.dtype),e}disposeWeights(){return this.weights.forEach(e=>e.dispose()),this.weights.length}assertNotDisposed(){if(0===this._refCount)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(null===this._refCount)throw new Error(`Cannot dispose Layer ${this.name} because it has not been used yet.`);this.assertNotDisposed();let e=0;return 0===--this._refCount&&(e=this.disposeWeights()),{refCountAfterDispose:this._refCount,numDisposedVariables:e}}}function tI(e,t,n){if((null==t||null!=n&&n>0)&&(t=e.sourceLayer,n=e.nodeIndex),0===t.inboundNodes.length)return[e];{const e=t.inboundNodes[n];if(0===e.inboundLayers.length)return e.inputTensors;{const t=[];for(let n=0;n<e.inboundLayers.length;n++){const r=tI(e.inputTensors[n],e.inboundLayers[n],e.nodeIndices[n]);for(const e of r)-1===t.indexOf(e)&&t.push(e)}return t}}}class nI extends eI{constructor(e){if(super({dtype:e.dtype,name:null!=e.name?e.name:PE("input").toString()}),null==e.batchSize&&(e.batchSize=null),null==e.sparse&&(e.sparse=!1),this.trainable=!1,this.built=!0,this.sparse=e.sparse,null!=e.inputShape&&null!=e.batchInputShape)throw new ek("Only provide the inputShape OR batchInputShape argument to inputLayer, not both at the same time.");let t=e.batchInputShape;if(null==t){if(null==e.inputShape)throw new ek("An InputLayer should be passed either a `batchInputShape` or an `inputShape`.");t=[e.batchSize].concat(e.inputShape)}else if(null!=e.batchSize)throw new ek("Cannot specify batchSize if batchInputShape is specified when creating an InputLayer.");const n=e.dtype||"float32";this.batchInputShape=t,this.dtype=n,this.inputSpec=[{shape:t}];const r=new YE(this.dtype,this.batchInputShape,this,[],{},this.name);r.nodeIndex=0,r.tensorIndex=0,new ZE({outboundLayer:this,inboundLayers:[],nodeIndices:[],tensorIndices:[],inputTensors:[r],outputTensors:[r],inputMasks:[null],outputMasks:[null],inputShapes:[t],outputShapes:[t]})}apply(e,t){throw new ek(`Cannot pass any input to an InputLayer's apply() method. InputLayer name: ${this.name}`)}dispose(){return{refCountAfterDispose:this._refCount,numDisposedVariables:0}}getConfig(){return{batchInputShape:this.batchInputShape,dtype:this.dtype,sparse:this.sparse,name:this.name}}}async function rI(e){if(null==e)return;const t=[],n=[],r=[];for(const o in e){const i=e[o];if("number"!=typeof i){const e=i;t.push(e.data()),n.push(o),r.push(e)}}if(t.length>0){const o=await Promise.all(t);for(let t=0;t<o.length;++t)e[n[t]]=o[t][0];Pb(r)}}function oI(e){if(null!=e)for(const t in e){const n=e[t];"number"!=typeof n&&n.dispose()}}var iI;nI.className="InputLayer",Db(nI),function(e){e[e.SILENT=0]="SILENT",e[e.VERBOSE=1]="VERBOSE"}(iI||(iI={}));class aI{constructor(){this.validationData=null}setParams(e){this.params=e}async onEpochBegin(e,t){}async onEpochEnd(e,t){}async onBatchBegin(e,t){}async onBatchEnd(e,t){}async onTrainBegin(e){}async onTrainEnd(e){}setModel(e){}}class sI{constructor(e,t=10){null==e&&(e=[]),this.callbacks=e,this.queueLength=t}append(e){this.callbacks.push(e)}setParams(e){for(const t of this.callbacks)t.setParams(e)}setModel(e){for(const t of this.callbacks)t.setModel(e)}async onEpochBegin(e,t){null==t&&(t={});for(const n of this.callbacks)await n.onEpochBegin(e,t)}async onEpochEnd(e,t){null==t&&(t={});for(const n of this.callbacks)await n.onEpochEnd(e,t)}async onBatchBegin(e,t){null==t&&(t={});for(const n of this.callbacks)await n.onBatchBegin(e,t)}async onBatchEnd(e,t){null==t&&(t={});for(const n of this.callbacks)await n.onBatchEnd(e,t)}async onTrainBegin(e){null==e&&(e={});for(const t of this.callbacks)await t.onTrainBegin(e)}async onTrainEnd(e){null==e&&(e={});for(const t of this.callbacks)await t.onTrainEnd(e)}}class lI extends aI{constructor(){super()}async onEpochBegin(e){this.seen=0,this.totals={}}async onBatchEnd(e,t){null==t&&(t={});const n=null==t.size?0:t.size;this.seen+=n;for(const e in t){const r=t[e];if("number"==typeof r)this.totals.hasOwnProperty(e)||(this.totals[e]=0),this.totals[e]=this.totals[e]+r*n;else{let t;e in this.totals?t=this.totals[e]:this.totals[e]=0;const o=Bb(()=>Gb(this.totals[e],Y$(r,n)));
2this.totals[e]=o,null!=t&&t.dispose()}}}async onEpochEnd(e,t){if(null!=t)for(const e of this.params.metrics)null!=this.totals[e]&&("number"==typeof this.totals[e]?t[e]=this.totals[e]/this.seen:Bb(()=>{const n=Y$(j$(1,this.seen),this.totals[e]);t[e]=n,this.totals[e].dispose(),Lb(t[e])}))}}class uI extends aI{async onTrainBegin(e){this.epoch=[],this.history={}}async onEpochEnd(e,t){null==t&&(t={}),this.epoch.push(e);for(const e in t)null==this.history[e]&&(this.history[e]=[]),this.history[e].push(t[e])}async syncData(){const e=[],t=[],n=[];for(const r in this.history){const o=this.history[r];for(let i=0;i<o.length;++i)if("number"!=typeof o[i]){const a=o[i];e.push(a.data()),t.push(r),n.push(i)}}const r=await Promise.all(e);for(let e=0;e<r.length;++e)this.history[t[e]][n[e]].dispose(),this.history[t[e]][n[e]]=r[e][0]}}class pI extends aI{constructor(e,t){if(super(),this.currentEpoch=0,this.yieldEvery=t||"auto","auto"===this.yieldEvery&&(this.yieldEvery=125),"never"===this.yieldEvery&&null!=e.onYield)throw new Error("yieldEvery is `never` but you provided an `onYield` callback. Either change `yieldEvery` or remove the callback");Xd(this.yieldEvery)&&(this.maybeWait=function(e,t){let n,r=Wm();return(...o)=>{const i=Wm();return i-r<t||(r=i,n=e(...o)),n}}(this.maybeWait.bind(this),this.yieldEvery)),this.trainBegin=e.onTrainBegin,this.trainEnd=e.onTrainEnd,this.epochBegin=e.onEpochBegin,this.epochEnd=e.onEpochEnd,this.batchBegin=e.onBatchBegin,this.batchEnd=e.onBatchEnd,this.yield=e.onYield}async maybeWait(e,t,n){const r=[];null!=this.yield&&(await rI(n),r.push(this.yield(e,t,n))),r.push(Ex()),await Promise.all(r)}async onEpochBegin(e,t){this.currentEpoch=e,null!=this.epochBegin&&(await rI(t),await this.epochBegin(e,t))}async onEpochEnd(e,t){const n=[];null!=this.epochEnd&&(await rI(t),n.push(this.epochEnd(e,t))),"epoch"===this.yieldEvery&&n.push(Ex()),await Promise.all(n)}async onBatchBegin(e,t){null!=this.batchBegin&&(await rI(t),await this.batchBegin(e,t))}async onBatchEnd(e,t){const n=[];null!=this.batchEnd&&(await rI(t),n.push(this.batchEnd(e,t))),"batch"===this.yieldEvery?n.push(Ex()):Xd(this.yieldEvery)&&n.push(this.maybeWait(this.currentEpoch,e,t)),await Promise.all(n)}async onTrainBegin(e){null!=this.trainBegin&&(await rI(e),await this.trainBegin(e))}async onTrainEnd(e){null!=this.trainEnd&&(await rI(e),await this.trainEnd(e))}}function cI(e,t){return null==e&&(e={}),e instanceof aI?[e]:Array.isArray(e)&&e[0]instanceof aI?e:sk(e).map(e=>new pI(e,t))}class dI{constructor(){}static registerCallbackConstructor(e,t){Md(e>=0&&Number.isInteger(e),()=>`Verbosity level is expected to be an integer >= 0, but got ${e}`),dI.checkForDuplicate(t),null==dI.constructors[e]&&(dI.constructors[e]=[]),dI.constructors[e].push(t)}static checkForDuplicate(e){for(const t in dI.constructors)dI.constructors[+t].forEach(t=>{if(t===e)throw new ek("Duplicate callback constructor.")})}static clear(){dI.constructors={}}static createCallbacks(e){const t=[];for(const n in dI.constructors){const r=+n;e>=r&&t.push(...dI.constructors[r])}return t.map(e=>new e)}}function hI(e,t,n,r,o,i,a,s,l){const u=new uI,p=[new lI,...dI.createCallbacks(t)];null!=e&&p.push(...e),p.push(u);const c=new sI(p);return c.setParams({epochs:n,initialEpoch:r,samples:o,steps:i,batchSize:a,verbose:t,doValidation:s,metrics:l}),{callbackList:c,history:u}}function fI(e,t={},n=!1){return hk(e,Mb.getMap().classNameMap,t,"layer",n)}function gI(e,t){return Bb(()=>{"float32"!==e.dtype&&(e=hb(e,"float32"));const n=Z$(uE(e),t,!0),r=W$(n.shape,Jv()),o=U_(o_(n,r));return j$(e,o)})}function mI(e,t){return Bb(()=>i_(uE(J$(t,e)),-1))}function yI(e,t){return Bb(()=>i_(Hb(J$(t,e)),-1))}function bI(e,t){return Bb(()=>{const n=J$(e,t),r=m$(Hb(e),Jv(),Number.MAX_VALUE),o=Hb(j$(n,r));return Y$(100,i_(o,-1))})}function $I(e,t,n=!1){return Bb(()=>{if(n)t=P_(t);else{const e=Z$(t,t.shape.length-1,!0);t=j$(t,e)}return t=m$(t,Jv(),1-Jv()),m_(Z$(Y$(hb(e,"float32"),q$(t)),t.shape.length-1))})}function _I(e,t,n=!1){return Bb(()=>{const r=hb(U$(function(e){const t=[Kk(e.shape)];return u$(e,t)}(e)),"int32"),o=(t=m$(t,Jv(),1-Jv())).shape;return $I(u$(b_(r,o[o.length-1]),o),t,n)})}function wI(e,t){return Bb(()=>{let n;return n=m$(t,Jv(),1-Jv()),n=q$(j$(n,J$(1,n))),i_(function(e,t){if(!Pd(e.shape,t.shape))throw new ek(`logits and labels must have the same shape, but got shapes ${JSON.stringify(e.shape)} and ${JSON.stringify(t.shape)}`);return Bb(()=>{const n=F_(t),r=m_(Hb(t));return Gb(J$(n,Y$(t,e)),K$(R$(r)))})}
vendor: 5,857 bytes, line 2
2(e,n),-1)})}function xI(e,t){return Bb(()=>{const n=gI(e,-1),r=gI(t,-1),o=Y$(n,r);return m_(Z$(o,-1))})}dI.constructors={};const SI={meanSquaredError:mI,meanAbsoluteError:yI,meanAbsolutePercentageError:bI,meanSquaredLogarithmicError:function(e,t){return Bb(()=>{const n=m$(t,Jv(),Number.MAX_VALUE),r=q$(Gb(1,n)),o=m$(e,Jv(),Number.MAX_VALUE),i=q$(Gb(1,o));return i_(uE(J$(r,i)),-1)})},squaredHinge:function(e,t){return Bb(()=>{const n=o_(0,J$(1,Y$(e,t)));return i_(uE(n),-1)})},hinge:function(e,t){return Bb(()=>{const n=o_(0,J$(1,Y$(e,t)));return i_(n,-1)})},categoricalHinge:function(e,t){return Bb(()=>{const n=Z$(Y$(e,t),-1),r=X$(Y$(J$(1,e),t),-1);return o_(0,Gb(1,J$(r,n)))})},logcosh:function(e,t){return Bb(()=>{const n=Math.log(2),r=J$(t,e),o=J$(Gb(r,L_(Y$(-2,r))),n);return i_(o,-1)})},categoricalCrossentropy:$I,sparseCategoricalCrossentropy:_I,binaryCrossentropy:wI,kullbackLeiblerDivergence:function(e,t){return Bb(()=>{const n=m$(e,Jv(),1),r=m$(t,Jv(),1);return Z$(Y$(e,q$(j$(n,r))),-1)})},poisson:function(e,t){return Bb(()=>{const n=q$(Gb(Jv(),t));return i_(J$(t,Y$(e,n)),-1)})},cosineProximity:xI};function vI(e){if("string"==typeof e){if(e in SI)return SI[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 ek(t)}return e}function kI(e,t){return Bb(()=>{const n=Y$(.5,w_(t)),r=Zk(V$(t,n),e.dtype);return i_(O$(e,r),-1)})}function EI(e,t){return Bb(()=>Zk(O$(Xb(e,-1),Xb(t,-1)),"float32"))}function II(e,t){return wI(e,t)}function TI(e,t){return e.rank===t.rank&&(e=z_(e,[e.rank-1])),(t=Xb(t,-1)).dtype!==e.dtype&&(t=hb(t,e.dtype)),hb(O$(e,t),"float32")}const FI=$I,NI=_I,jI={binaryAccuracy:kI,categoricalAccuracy:EI,precision:function(e,t){return Bb(()=>{const n=function(e,t){return Bb(()=>hb(Z$(e_(O$(e,1),O$(t,1))),"float32"))}(e,t),r=function(e,t){return Bb(()=>hb(Z$(e_(O$(e,0),O$(t,1))),"float32"))}(e,t),o=Gb(n,r);return hb(J_(V$(o,0),j$(n,o),0),"float32")})},categoricalCrossentropy:FI,sparseCategoricalCrossentropy:NI,mse:mI,MSE:mI,mae:yI,MAE:yI,mape:bI,MAPE:bI,cosine:xI};function AI(e){if("string"==typeof e&&e in jI)return jI[e];if("string"!=typeof e&&null!=e)return e;throw new ek(`Unknown metric ${e}`)}function CI(e){if(ok(null!==e,`Unknown LossOrMetricFn ${e}`),"string"==typeof e)return e;{let t;for(const n of Object.keys(SI))if(SI[n]===e){t=n;break}if(void 0!==t)return t;for(const n of Object.keys(jI))if(jI[n]===e){t=n;break}return void 0!==t?t:e.name}}function MI(e,t,n=!1){if(null==e||"object"!=typeof e||Object.getPrototypeOf(e)!==Object.prototype||!DI(e))throw new Error("User-defined metadata is expected to be a JSON object, but is not.");if(n){const n=JSON.stringify(e);n.length>1048576&&console.warn(`User-defined metadata of model "${t}" is too large in size (length=${n.length} when serialized). It is not recommended to store such large objects in user-defined metadata. Please make sure its serialized length is <= 1048576.`)}}function DI(e){if(null===e)return!0;if("object"==typeof e){if(Object.getPrototypeOf(e)===Object.prototype){const t=Object.keys(e);for(const n of t){if("string"!=typeof n)return!1;if(!DI(e[n]))return!1}return!0}if(Array.isArray(e)){for(const t of e)if(!DI(t))return!1;return!0}return!1}{const t=typeof e;return"string"===t||"number"===t||"boolean"===t}}function OI(e,t,n=console.log){let r="";for(let n=0;n<e.length;++n)n>0&&(r=r.slice(0,r.length-1)+" "),r+=e[n],r=r.slice(0,t[n]),r+=" ".repeat(t[n]-r.length);n(r)}function RI(e,t,n){let r;try{r=JSON.stringify(e.outputShape)}catch(e){r="multiple"}OI([`${e.name} (${e.getClassName()})`,r,e.countParams().toString()],t,n)}function BI(e,t,n,r){let o;try{o=JSON.stringify(e.outputShape)}catch(e){o="multiple"}const i=[];for(const t of e.inboundNodes)if(!(null!=n&&n.length>0&&-1===n.indexOf(t)))for(let e=0;e<t.inboundLayers.length;++e){const n=t.inboundLayers[e].name,r=t.nodeIndices[e],o=t.tensorIndices[e];i.push(`${n}[${r}][${o}]`)}const a=e.name,s=e.getClassName(),l=0===i.length?"":i[0];OI([`${a} (${s})`,o,e.countParams().toString(),l],t,r);for(let e=1;e<i.length;++e)OI(["","","",i[e]],t,r)}function PI(e,t,n){return("inboundNodes"===e||"outputLayers"===e||"inputLayers"===e)&&0===t&&"string"==typeof n}function LI(e,t){if(null===e)return null;if("string"==typeof e)return uk(e);if("number"==typeof e||"boolean"==typeof e)return e;if(e instanceof Array){const n=[],r=e.length;for(let o=0;o<r;++o){const r=e[o];PI(t,o,r)?n.push(r):n.push(LI(r,t))}return n}{const t={};for(const n of Object.keys(e)){const r=e[n];if("name"===n&&"string"==typeof r)t[n]=r;else{const e=uk(n);t[e]=LI(r,e)}}return t}}function WI(e,t){if(null==e)return null;if("string"==typeof e)return lk(e);if("number"==typeof e||"boolean"==typeof e)return e;if(e instanceof Array){const n=[],r=e.length;for(let o=0;o<r;++o){const r=e[o];PI(t,o,r)?n.push(r):n.push(WI(r,t))}return n}{const t={};for(const n of Object.keys(e)){const r=e[n];t[lk(n)]="name"!==n&&"className"!==n||"string"!=typeof r?WI(r,n):r}return t}}const UI="3.9.0";class zI{constructor(e){if(this.id2Value={},this.id2Mask={},this.name2Id={},e instanceof zI)for(const t in e.id2Value)this.id2Value[t]=e.id2Value[t],t in e.id2Mask&&(this.id2Mask[t]=e.id2Mask[t]);else{if(null==e)return;for(const t of e)this.add(t.key,t.value)}}add(e,t,n){if(null!=this.id2Value[e.id])throw new ek(`Duplicate key: name=${e.name}, id=${e.id}`);return this.id2Value[e.id]=function(e,t){if(null==e.dtype||e.dtype===t.dtype)return t;try{return hb(t,e.dtype)}catch(n){throw new ek(`The dtype of the feed (${t.dtype}) can not be cast to the dtype of the key '${e.name}' (${e.dtype}).`)}}(e,t),this.name2Id[e.name]=e.id,null!=n&&(this.id2Mask[e.id]=n),this}addFeed(e){this.add(e.key,e.value)}hasKey(e){return null!=this.id2Value[e.id]}names(){return Object.keys(this.name2Id)}
vendor: 17,712 bytes, line 2
2getValue(e){if(e instanceof YE){if(null==this.id2Value[e.id])throw new ek(`Nonexistent key: ${e.name}`);return this.id2Value[e.id]}{const t=this.name2Id[e];if(null==t)throw new ek(`Feed dict has no SymbolicTensor name: ${e}`);return this.id2Value[t]}}getMask(e){if(e instanceof YE){if(null==this.id2Value[e.id])throw new ek(`Nonexistent key: ${e.name}`);return this.id2Mask[e.id]}{const t=this.name2Id[e];if(null==t)throw new ek(`Feed dict has no SymbolicTensor name: ${e}`);return this.id2Mask[t]}}disposeMasks(){null!=this.id2Mask&&Pb(this.id2Mask)}}const VI={},HI={};function GI(e,t,n,r){const o=null!=n&&n.training,i=Array.isArray(e),a=i?e:[e],s=a.map(e=>e.name),l=[],u=t.names();for(const e of s)-1!==u.indexOf(e)?l.push(t.getValue(e)):l.push(null);null!=r&&(r.maxNumTensors=-1/0,r.minNumTensors=1/0);const p=s.join(",")+"|"+t.names().join(",");let c,d;if(null==VI[p]){const e=function(e,t){Md(null!=e&&e.length>0,()=>"Expected at least one fetch, got none");let n=[],r={};if(1===e.length){const o=KI(e[0],t);n=o.sorted,r=o.recipientMap}else{const o=new Set;for(const i of e){const{sorted:e,recipientMap:a}=KI(i,t);for(const t of e)o.has(t.name)||(n.push(t),o.add(t.name));for(const e in a)null==r[e]&&(r[e]=new Set),a[e].forEach(t=>r[e].add(t))}}return{sorted:n,recipientCounts:qI(r)}}(a,t);c=e.sorted,d=e.recipientCounts,VI[p]=c,HI[p]=d}c=VI[p],d={},o||Object.assign(d,HI[p]);const h=new zI(t);for(let e=0;e<c.length;++e){if(null!=r){const e=Rb().numTensors;e>r.maxNumTensors&&(r.maxNumTensors=e),e<r.minNumTensors&&(r.minNumTensors=e)}const i=c[e],a=i.sourceLayer;if(a instanceof nI)continue;const u=[],p=[],f=[];let g=!1;for(const e of i.inputs){const n=h.getValue(e),r=h.getMask(e);u.push(n),p.push(r),null!=r&&(g=!0),o||(d[e.name]--,0!==d[e.name]||t.hasKey(e)||-1!==s.indexOf(e.name)||n.isDisposed||!0===e.sourceLayer.stateful||f.push(n))}g&&((n=n||{}).mask=p[0]);const m=sk(a.apply(u,n));let y=null;a.supportsMasking&&(y=a.computeMask(u,p));const b=XI(i),$=Array.isArray(b)?b:[b];for(let e=0;e<$.length;++e){h.hasKey($[e])||h.add($[e],m[e],Array.isArray(y)?y[0]:y);const t=s.indexOf($[e].name);-1!==t&&(l[t]=m[e])}o||Pb(f)}return h.disposeMasks(),i?l:l[0]}function qI(e){const t={};for(const n in e)t[n]=e[n].size;return t}function KI(e,t){const n=new Set,r=[],o={};for(const e of t.names())n.add(e);const i=[],a=[];for(i.push(e);i.length>0;){const e=i[i.length-1];if(n.has(e.name)){i.pop();continue}const t=a[a.length-1]===i.length-1;if(0===e.inputs.length||t)i.pop(),r.push(e),n.add(e.name),t&&a.pop();else{a.push(i.length-1);for(const t of e.inputs)null==o[t.name]&&(o[t.name]=new Set),o[t.name].add(e.name),n.has(t.name)||i.push(t)}}return{sorted:r,recipientMap:o}}function XI(e){let t;if(1===e.sourceLayer.inboundNodes.length)t=e.sourceLayer.output;else{let n=null;for(let t=0;t<e.sourceLayer.inboundNodes.length;++t)for(const r of e.sourceLayer.inboundNodes[t].outputTensors)if(r.id===e.id){n=t;break}t=e.sourceLayer.getOutputAt(n)}return t}class YI extends eI{constructor(e){if(super({}),this.containerNodes=new Set,this.name=e.name,null==this.name){const e=this.getClassName().toLowerCase();this.name=PE(e)}if(this.supportsMasking=!1,this.trainable_=!0,Array.isArray(e.inputs)?this.inputs=e.inputs.slice():this.inputs=[e.inputs],Array.isArray(e.outputs)?this.outputs=e.outputs.slice():this.outputs=[e.outputs],gk(this.inputs).length!==this.inputs.length)throw new ek(`The list of inputs passed to the model is redundant. All inputs should only appear once. Found: ${this.inputs.map(e=>e.name)}`);gk(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(e=>e.name)}`),this.inputLayers=[],this.inputLayersNodeIndices=[],this.inputLayersTensorIndices=[],this.outputLayers=[],this.outputLayersNodeIndices=[],this.outputLayersTensorIndices=[],this.layers=[],this.internalContainerRefs=[];for(const e of this.outputs){const t=e.sourceLayer,n=e.nodeIndex,r=e.tensorIndex;this.outputLayers.push(t),this.outputLayersNodeIndices.push(n),this.outputLayersTensorIndices.push(r)}for(const e of this.inputs){const t=e.sourceLayer,n=e.nodeIndex,r=e.tensorIndex;ok(0===n,"input layer has >1 nodes"),ok(0===r,"input layer has >1 tensors"),this.inputLayers.push(t),this.inputLayersNodeIndices.push(n),this.inputLayersTensorIndices.push(r)}this.inputNames=[],this.outputNames=[],this.feedInputShapes=[],this.feedInputNames=[],this.feedOutputNames=[];for(let t=0;t<this.inputLayers.length;t++){const n=this.inputLayers[t];if(!(n instanceof nI))throw new TypeError(`Input layers to a LayersModel must be InputLayer objects. Received inputs: ${e.inputs}. Input ${t} (0-based) originates from layer type ${n.getClassName()}.`);this.inputNames.push(n.name),this.feedInputShapes.push(n.batchInputShape),this.feedInputNames.push(n.name)}for(const e of this.outputLayers)this.outputNames.push(e.name);this.internalInputShapes=this.inputs.map(e=>e.shape),this.internalOutputShapes=this.outputs.map(e=>e.shape);const t={},n={},r={},o={},i={},a=[],s=(e,t,n,r,o,l)=>{null!=r&&null!=o&&null!=l||(r=e.sourceLayer,o=e.nodeIndex,l=e.tensorIndex);const u=r.inboundNodes[o];if(-1!==n.indexOf(u))throw new Qv(`The tensor ${e.name} at layer "${r.name}" is part of a cycle.`);if(-1!==t.indexOf(u))return;this.containerNodes.add(YI.nodeKey(r,o)),r.id in i||(i[r.id]=Object.keys(i).length),-1===n.indexOf(u)&&n.push(u);const p=u.inboundLayers.length;for(let e=0;e<p;e++){const r=u.inputTensors[e],o=u.inboundLayers[e],i=u.nodeIndices[e],a=u.tensorIndices[e];s(r,t,n,o,i,a)}for(t.push(u);n.indexOf(u)>=0;)n.splice(n.indexOf(u),1);a.push(u)},l=[],u=[];for(const e of this.outputs)s(e,l,u);const p=a.slice().reverse();for(const e of p){n[e.id]=e,e.id in t||(t[e.id]=0);let i=t[e.id];const a=null==r[e.outboundLayer.id]?0:r[e.outboundLayer.id];i=Math.max(i,a),r[e.outboundLayer.id]=i,o[e.outboundLayer.id]=e.outboundLayer,t[e.id]=i;for(let r=0;r<e.inboundLayers.length;r++){const o=e.inboundLayers[r],a=e.nodeIndices[r],s=o.inboundNodes[a],l=null==t[s.id]?0:t[s.id];t[s.id]=Math.max(i+1,l),n[s.id]=s}}const c={};for(const e in t){const r=t[e];r in c||(c[r]=[]),c[r].push(n[e])}const d={};for(const e in r){const t=r[e];t in d||(d[t]=[]),d[t].push(o[e])}let h=Object.keys(d).map(e=>parseInt(e,10)).sort(fk);this.layers=[];for(const e of h){const t=d[e];t.sort((e,t)=>{const n=i[e.id],r=i[t.id];return n<r?-1:n>r?1:0});for(const e of t)e instanceof YI&&this.internalContainerRefs.push(e),this.layers.push(e)}this.layersByDepth=d,h=Object.keys(c).map(e=>parseInt(e,10)).sort(fk);const f=this.inputs.slice(),g=[];for(const e of h)for(const t of c[e]){const e=t.outboundLayer;if(null!=e){for(const n of t.inputTensors)if(-1===f.indexOf(n))throw new Qv(`Graph disconnected: cannot obtain value for tensor ${n} at layer "${e.name}". The following previous layers were accessed without issue: ${g}`);for(const e of t.outputTensors)f.push(e);g.push(e.name)}}this.nodesByDepth=c;const m=this.layers.map(e=>e.name);for(const e of m){const t=m.filter(t=>t===e).length;if(1!==t)throw new Qv(`The name "${e}" is used ${t} times in the model. All layer names should be unique. Layer names: `+JSON.stringify(m))}this.outboundNodes=[],this.inboundNodes=[],new ZE({outboundLayer:this,inboundLayers:[],nodeIndices:[],tensorIndices:[],inputTensors:this.inputs,outputTensors:this.outputs,inputMasks:this.inputs.map(e=>null),outputMasks:this.outputs.map(e=>null),inputShapes:this.inputs.map(e=>e.shape),outputShapes:this.outputs.map(e=>e.shape)}),this.built=!0,this._refCount=1}assertNotDisposed(){if(0===this._refCount)throw new Error(`Container '${this.name}' is already disposed.`)}dispose(){this.assertNotDisposed();const e={refCountAfterDispose:null,numDisposedVariables:0};if(0===--this._refCount){for(const t of this.layers)e.numDisposedVariables+=t.dispose().numDisposedVariables;for(const 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(t=>t.trainable=e)}),this.trainable_=e}get trainableWeights(){if(this._trainableWeights.length>0)throw new ek("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(const t of this.layers)e=e.concat(t.trainableWeights);return e}get nonTrainableWeights(){const e=[];for(const t of this.layers)e.push(...t.nonTrainableWeights);if(!this.trainable){const t=[];for(const e of this.layers)t.push(...e.trainableWeights);return t.concat(e)}return e}get weights(){return this.trainableWeights.concat(this.nonTrainableWeights)}loadWeights(e,t=!0){const n={};let r=0;for(const e of this.layers)for(const t of e.weights){if(null!=n[t.originalName])throw new ek(`Duplicate weight name: ${t.originalName}`);n[t.originalName]=t,r++}const o=[];for(const r in e){let i=r;if(null==n[r]){const e=r.split("/");i=e.slice(0,-2).concat([e[e.length-1]]).join("/")}if(null!=n[i])o.push([n[i],e[r]]);else if(t)throw new ek(`Provided weight data has no target variable: ${r}`);delete n[i]}if(t){const e=[];for(const t in n)e.push(t);if(e.length>0)throw new ek(`${e.length} of ${r} weights are not set: ${e}`)}KE(o)}updatedConfig(){const e=this.getConfig(),t={};return t.className=this.getClassName(),t.config=e,t.kerasVersion=`tfjs-layers ${UI}`,t.backend="TensorFlow.js",t}toJSON(e,t=!0){const n=WI(this.updatedConfig());return t?JSON.stringify(n):n}call(e,t){return Bb(()=>{e=sk(e);const n=new zI;for(let t=0;t<this.inputs.length;++t)n.add(this.inputs[t],e[t]);return GI(this.outputs,n,t)})}computeMask(e,t){return Bb(()=>{let n;return e=sk(e),n=null==t?rk(null,e.length):sk(t),this.runInternalGraph(e,n)[1]})}computeOutputShape(e){const t=WE(e);if(t.length!==this.inputLayers.length)throw new ek(`Invalid inputShape argument ${e}: model has ${this.inputLayers.length} tensor inputs.`);const n={};for(let e=0;e<t.length;e++){const r=this.inputLayers[e],o=t[e];n[r.name+"_0_0"]=o}const r=Object.keys(this.nodesByDepth).map(e=>parseInt(e,10)).sort(fk);if(r.length>1)for(const e of r){const t=this.nodesByDepth[e];for(const e of t){const t=e.outboundLayer;if(-1!==this.inputLayers.map(e=>e.id).indexOf(t.id))continue;const r=[];for(let t=0;t<e.inboundLayers.length;t++){const o=e.inboundLayers[t],i=e.nodeIndices[t],a=e.tensorIndices[t],s=n[`${o.name}_${i}_${a}`];r.push(s)}const o=WE(t.computeOutputShape(ak(r))),i=t.inboundNodes.indexOf(e);for(let e=0;e<o.length;e++)n[`${t.name}_${i}_${e}`]=o[e]}}const o=[],i=[];for(let e=0;e<this.outputLayers.length;e++){const t=this.outputLayers[e],n=this.outputLayersNodeIndices[e],r=this.outputLayersTensorIndices[e],o=`${t.name}_${n}_${r}`;i.push(o)}for(let e=0;e<i.length;e++){const t=i[e];ok(t in n),o.push(n[t])}return ak(o)}runInternalGraph(e,t){null==t&&(t=rk(null,e.length));const n={};for(let r=0;r<this.inputs.length;++r){const o=this.inputs[r],i=e[r],a=t[r];n[o.id]=[i,a]}const r=Object.keys(this.nodesByDepth).map(e=>parseInt(e,10)).sort(fk);for(const e of r){const t=this.nodesByDepth[e];for(const e of t){const t=e.outboundLayer,r=e.inputTensors,o=e.outputTensors,i=new Array;for(const e of r)e.id in n&&i.push(n[e.id]);if(i.length===r.length){let r,a,s,l,u={};if(null!=e.callArgs&&(u=e.callArgs),1===i.length){const[e,n]=i[0];null==u.mask&&(u.mask=n),s=sk(t.call(e,u)),l=sk(t.computeMask(e,n)),r=[e],a=[n]}else r=i.map(e=>e[0]),a=i.map(e=>e[1]),null==u.mask&&(u.mask=a),s=sk(t.call(r,u)),l=sk(t.computeMask(r,a));if(t.activityRegularizer)throw new tk("LayersModel invocation with concrete Tensor value(s) in the presence of activity regularizer(s) is not supported yet.");for(let e=0;e<o.length;++e){const t=o[e],r=s[e],i=l[e];n[t.id]=[r,i]}}}}const o=[],i=[],a=[];for(const e of this.outputs){ok(e.id in n,`Could not compute output ${e.name} : ${e.id}`);const[t,r]=n[e.id];a.push(t.shape),o.push(t),i.push(r)}return[o,i,a]}buildNodeConversionMap(e){const t={};let n;for(const e of this.layers){n=e instanceof YI?1:0;for(let r=0;r<e.inboundNodes.length;r++){const o=YI.nodeKey(e,r);this.containerNodes.has(o)&&(t[o]=n,n+=1)}}return t}getLayer(e,t){if(null!=t){if(this.layers.length<=t)throw new ek(`Was asked to retrieve layer at index ${t}, but model only has ${this.layers.length} layer(s).`);return this.layers[t]}if(null==e)throw new ek("Provide either a layer name or layer index");for(const t of this.layers)if(t.name===e)return t;throw new ek(`No such layer: ${e}`)}calculateLosses(){return Bb(()=>{const e=[];for(const t of this.layers)for(let n=0;n<t.inboundNodes.length;++n){const r=YI.nodeKey(t,n);this.containerNodes.has(r)&&e.push(...t.calculateLosses())}return e})}getConfig(){const e={name:this.name},t=this.buildNodeConversionMap(this.layers),n=[];for(const e of this.layers){const r=e.getClassName(),o=e.getConfig(),i=[];for(let n=0;n<e.inboundNodes.length;n++){const r=e.inboundNodes[n],o=YI.nodeKey(e,n);let a={};if(this.containerNodes.has(o)){if(r.callArgs)try{JSON.stringify(r.callArgs),a=r.callArgs}catch(t){console.warn(`Layer ${e.name} was passed non-serializable keyword arguments: ${r.callArgs}. They will not be included in the serialized model (and thus will be missing at deserialization time).`),a={}}if(r.inboundLayers.length>0){const e=[];for(let n=0;n<r.inboundLayers.length;n++){const o=r.inboundLayers[n],i=r.nodeIndices[n],s=r.tensorIndices[n];let l=t[YI.nodeKey(o,i)];null==l&&(l=0),e.push([o.name,l,s,a])}i.push(e)}}}const a={};a.name=e.name,a.className=r,a.config=o,a.inboundNodes=i,n.push(a)}e.layers=n;const r=[];for(let e=0;e<this.inputLayers.length;e++){const n=this.inputLayers[e],o=this.inputLayersNodeIndices[e],i=YI.nodeKey(n,o);if(!this.containerNodes.has(i))continue;let a=t[i];null==a&&(a=0);const s=this.inputLayersTensorIndices[e];r.push([n.name,a,s])}e.inputLayers=r;const o=[];for(let e=0;e<this.outputLayers.length;e++){const n=this.outputLayers[e],r=this.outputLayersNodeIndices[e],i=YI.nodeKey(n,r);if(!this.containerNodes.has(i))continue;let a=t[i];null==a&&(a=0);const s=this.outputLayersTensorIndices[e];o.push([n.name,a,s])}return e.outputLayers=o,e}static fromConfig(e,t,n={},r=!1){const o={},i={};function a(e,t){e.name in i?i[e.name].push(t):i[e.name]=[t]}function s(e,t){const n=[];let r;for(const i of t){const s=i[0],l=i[1],u=i[2];if(r=null==i[3]?{}:i[3],!(s in o))return void a(e,t);const p=o[s];if(p.inboundNodes.length<=l)return void a(e,t);const c=p.inboundNodes[l];n.push(c.outputTensors[u])}n.length>0&&e.apply(ak(n),r)}function l(e){const n=e.name,i=fI(e,null!=t.customObjects?t.customObjects:{});i.setFastWeightInitDuringBuild(r),o[n]=i,e.inboundNodes.forEach(e=>{if(!(e instanceof Array))throw new ek(`Corrupted configuration, expected array for nodeData: ${e}`);a(i,e)})}const u=t.name,p=t.layers;for(const e of p)l(e);for(;!mk(i);)for(const e of p){const t=o[e.name];if(t.name in i){const e=i[t.name];delete i[t.name];for(const n of e)s(t,n)}}const c=[],d=[],h=t.inputLayers;for(const e of h){const t=e[0],n=e[1],r=e[2];ok(t in o);const i=o[t].inboundNodes[n].outputTensors;c.push(i[r])}const f=t.outputLayers;for(const e of f){const t=e[0],n=e[1],r=e[2];ok(t in o);const i=o[t].inboundNodes[n].outputTensors;d.push(i[r])}return new e({inputs:c,outputs:d,name:u})}get stateful(){if(this._stateful)throw new ek("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(const e of this.layers)if(e.stateful)return!0;return!1}resetStates(){Bb(()=>{this.layers.forEach(e=>{e.stateful&&e.resetStates()})})}}function JI(e,t){return function(e,t,n){const r=t.length;if(null==e||Array.isArray(e)&&0===e.length)return t.map(e=>null);if(1===r)return Array.isArray(e)&&1===e.length?e:"object"==typeof e&&t[0]in e?[e[t[0]]]:[e];if(Array.isArray(e)){if(e.length!==r)throw new Error(`Provided ${n} is an array of ${e.length} element(s), but the model has ${r} outputs. Make sure a set of weights is provided for each model output.`);return e}if("object"==typeof e&&Object.keys(e).length>0&&"object"==typeof e[Object.keys(e)[0]]){const n=[];return t.forEach(t=>{t in e?n.push(e[t]):n.push(null)}),n}throw new Error(`The model has multiple (${r}) outputs, so ${n} must be either an array with ${r} elements or an object with ${t} keys. Provided ${n} not understood: ${JSON.stringify(e)}`)}(e,t,"classWeight")}async function ZI(e,t,n,r){if(null!=t||null!=r)throw new Error("Support sampleWeight is not implemented yet");if(null!=n){const t=Bb(()=>{if(1===e.shape.length)return fb(e);if(2===e.shape.length){if(e.shape[1]>1)return Xb(e,1);if(1===e.shape[1])return u$(e,[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.`)}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.`)}),r=Array.from(await t.data());Pb(t);const o=[];return r.forEach(e=>{if(null==n[e])throw new Error(`classWeight must contain all classes in the training data. The class ${e} exists in the data but not in classWeight`);o.push(n[e])}),G_(o,"float32")}return null}function QI(e,t){return Y$(e,t)}function eT(e,t){let n,r;const o=t;n=o.xs,r=o.ys,Md(null!=n&&null!=r,()=>`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}`);
2const i=tT("input",e.inputNames,n),a=tT("output",e.outputNames,r),s=i[0].shape[0];Md(i.length===e.inputs.length,()=>`LayersModel has ${e.inputs.length} inputs, but the dataset provides ${i.length} inputs.  (Expected input keys: ${JSON.stringify(e.inputNames)})`),Md(a.length===e.outputs.length,()=>`LayersModel has ${e.outputs.length} outputs, but the dataset provides ${a.length} outputs.  (Expected output keys: ${JSON.stringify(e.outputNames)})`);for(let t=0;t<i.length;t++)Md(i[t].shape[0]===s,()=>`Batch size mismatch: input ${e.inputNames[t]} has ${i[t].shape[0]}; expected  ${s} based on input ${e.inputNames[0]}.`);for(let t=0;t<a.length;t++)Md(a[t].shape[0]===s,()=>`Batch size mismatch: output ${e.outputNames[t]} has ${a[t].shape[0]}; expected  ${s} based on input ${e.inputNames[0]}.`);return{xs:i,ys:a}}function tT(e,t,n){if(n instanceof ny)return[n];if(Array.isArray(n))return Md(n.length===t.length,()=>`Received an array of ${n.length} Tensors, but expected ${t.length} to match the ${e} keys ${t}.`),n;{const r=[];for(const o of t){if(null==n[o])throw new ek(`The feature data generated by the dataset lacks the required ${e} key '${o}'.`);r.push(n[o])}return r}}function nT(e){return"function"==typeof e.iterator}function rT(e){Md(e>0&&Number.isInteger(e),()=>`batchSize is required to be a positive integer, but got ${e}`)}function oT(e,t,n){return null==e?[null]:Array.isArray(e)?e.map(e=>eE(e,t,n-t)):eE(e,t,n-t)}function iT(e,t){return Bb(()=>null==e?null:Array.isArray(e)?e.map(e=>iT(e,t)):lE(e,"int32"===t.dtype?t:hb(t,"int32")))}function aT(e,t){const n=[];let r=0,o=null;for(;r<e;)o=r+t,o>=e&&(o=e),n.push([r,o]),r=o;return n}function sT(e){const t=[];e instanceof ny&&(e=[e]);for(let n=0;n<e.length;++n){const r=e[n];if(1===r.rank)t.push(Qk(r,1));else{if(0===r.rank)throw new Error("Expected tensor to be at least 1D, but received a 0D tensor (scalar).");t.push(r)}}return t}function lT(e,t){if(null==e)return;const n=[];if(t instanceof ny)n.push(t.id);else if(Array.isArray(t))t.forEach(e=>n.push(e.id));else if(null!=t)for(const e in t){const r=t[e];n.push(r.id)}const r=[];if(e instanceof ny)-1===n.indexOf(e.id)&&r.push(e);else if(Array.isArray(e))e.forEach(e=>{-1===n.indexOf(e.id)&&r.push(e)});else if(null!=e)for(const t in e){const o=e[t];-1===n.indexOf(o.id)&&r.push(o)}r.forEach(e=>{e.isDisposed||e.dispose()})}function uT(e){return Array.isArray(e)}function pT(e){return!function(e){return e instanceof ny}(e)&&!uT(e)}function cT(e,t,n,r=!0,o=""){if(null==t||0===t.length){if(null!=e){let t=!1;if(uT(e)&&e.length>0)t=!0;else if(pT(e)){for(const n in e)if(e.hasOwnProperty(n)){t=!0;break}}else t=!0;if(t)throw new ek(`Error when checking model ${o} expected no data, but got ${e}`)}return[]}if(null==e)return t.map(e=>null);let i;if(pT(e)){i=[];for(const n of t){if(null==e[n])throw new ek(`No data provided for "${n}". Need data for each key in: ${t}`);i.push(e[n])}}else if(uT(e)){if(e.length!==t.length)throw new ek(`Error when checking model ${o}: 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}`);i=e}else{if(t.length>1)throw new ek(`The model ${o} expects ${t.length} Tensor(s), but only received one Tensor. Found: Tensor with shape ${e.shape}`);i=[e]}if(i=sT(i),null!=n)for(let e=0;e<t.length;++e){if(null==n[e])continue;const a=i[e];if(a.shape.length!==n[e].length)throw new ek(`Error when checking ${o}: expected ${t[e]} to have ${n[e].length} dimension(s). but got array with shape ${a.shape}`);for(let t=0;t<n[e].length;++t){if(0===t&&!r)continue;const i=a.shape[t],s=n[e][t];if(null!=s&&s>=0&&i!==s)throw new ek(`${o} expected a batch of elements where each example has shape [${n[e].slice(1,n[e].length)}] (i.e.,tensor shape [*,${n[e].slice(1,n[e].length)}]) but the ${o} received an input with ${a.shape[0]} examples, each with shape [${a.shape.slice(1,a.shape.length)}] (tensor shape [${a.shape}])`)}}return i}function dT(e,t,n,r=!0,o=""){let i;if(Array.isArray(e)){if(e.length!==t.length)throw new ek(`Error when checking model ${o}: the Array of Tensors that you are passing to your model is not the size the the model expected. Expected to see ${t.length} Tensor(s), but instead got ${e.length} Tensors(s).`);i=e}else{if(t.length>1)throw new ek(`The model expects ${t.length} ${o} Tensors, but only received one Tensor. Found: array with shape ${JSON.stringify(e.shape)}.`);
vendor: 5,687 bytes, line 2
2i=[e]}if(null!=n)for(let e=0;e<t.length;++e){if(null==n[e])continue;const a=i[e];if(a.shape.length!==n[e].length)throw new ek(`Error when checking ${o}: expected ${t[e]} to have ${n[e].length} dimension(s), but got array with shape ${JSON.stringify(a.shape)}`);for(let i=0;i<n[e].length;++i){if(0===i&&!r)continue;const s=a.shape[i],l=n[e][i];if(null!=l&&l!==s)throw new ek(`Error when checking ${o}: expected ${t[e]} to have shape ${JSON.stringify(n[e])} but got array with shape ${JSON.stringify(a.shape)}.`)}}}class hT extends YI{constructor(e){super(e),this.isTraining=!1}summary(e,t,n=console.log){if(!this.built)throw new ek("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).");!function(e,t,n,r=console.log){const o=function(e){let t=!0;const n=[],r=[];for(const t in e.nodesByDepth)n.push(e.nodesByDepth[t]);for(const e of n){if(e.length>1||1===e.length&&e[0].inboundLayers.length>1){t=!1;break}r.push(...e)}if(t)for(const n of e.layers){let e=!1;for(const o of n.inboundNodes)if(-1!==r.indexOf(o)){if(e){t=!1;break}e=!0}if(!t)break}return t}(e),i=["Layer (type)","Output shape","Param #"];let a;if(o?(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(e=>Math.floor(t*e))),!o){i.push("Receives inputs"),a=[];for(const t in e.nodesByDepth)a.push(...e.nodesByDepth[t])}r("_".repeat(t)),OI(i,n,r),r("=".repeat(t));const s=e.layers;for(let e=0;e<s.length;++e)o?RI(s[e],n,r):BI(s[e],n,a,r),r((e===s.length-1?"=":"_").repeat(t));e.checkTrainableWeightsConsistency();const l=function(e){let t;return t=null!=e.collectedTrainableWeights?VE(e.collectedTrainableWeights):VE(e.trainableWeights),t}(e),u=VE(e.nonTrainableWeights);r(`Total params: ${l+u}`),r(`Trainable params: ${l}`),r(`Non-trainable params: ${u}`),r("_".repeat(t))}(this,e,t,n)}compile(e){if(null==e.loss&&(e.loss=[]),this.loss=e.loss,"string"==typeof e.optimizer)this.optimizer_=function(e){const t={Adagrad:()=>vx.adagrad(.01),Adadelta:()=>vx.adadelta(1,.95,Jv()),Adam:()=>vx.adam(.001,.9,.999,Jv()),Adamax:()=>vx.adamax(.002,.9,.999,Jv(),0),RMSProp:()=>vx.rmsprop(.001,.9,0,Jv()),SGD:()=>vx.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 ek(`Unknown Optimizer ${e}`)}(e.optimizer),this.isOptimizerOwned=!0;else{if(!(e.optimizer instanceof Vb))throw new ek("User-defined optimizer must be an instance of tf.Optimizer.");this.optimizer_=e.optimizer,this.isOptimizerOwned=!1}let t=[];if(Array.isArray(e.loss)||"string"==typeof e.loss||"function"==typeof e.loss)if(Array.isArray(e.loss)){if(e.loss.length!==this.outputs.length)throw new ek(`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}.`);const n=e.loss;t=n.map(e=>vI(e))}else{const n=vI(e.loss);this.outputs.forEach(e=>{t.push(n)})}else{e.loss=e.loss;for(const t in e.loss)if(-1===this.outputNames.indexOf(t))throw new ek(`Unknown entry in loss dictionary: "${t}". Only expected the following keys: ${this.outputNames}`);for(const n of this.outputNames)null==e.loss[n]&&console.warn(`Output "${n}" is missing from loss dictionary. We assume this was done on purpose, and we will not be expecting data to be passed to ${n} during training`),t.push(vI(e.loss[n]))}this.lossFunctions=t,this.feedOutputNames=[],this.feedOutputShapes=[],this.feedLossFns=[];for(let e=0;e<this.outputs.length;++e){const t=this.internalOutputShapes[e],n=this.outputNames[e];this.feedOutputNames.push(n),this.feedOutputShapes.push(t),this.feedLossFns.push(this.lossFunctions[e])}const n=[];this.metrics=e.metrics,this.metricsNames=["loss"],this.metricsTensors=[],Uk("loss",()=>{for(let e=0;e<this.outputs.length;++e){if(-1!==n.indexOf(e))continue;const t=this.lossFunctions[e];this.outputs.length>1&&(this.metricsTensors.push([t,e]),this.metricsNames.push(this.outputNames[e]+"_loss"))}});const r=function(e,t){if(null==e||Array.isArray(e)&&0===e.length)return t.map(e=>[]);let n;if("string"==typeof e||"function"==typeof e)n=[e];else{if(!Array.isArray(e)&&"object"!=typeof e)throw new TypeError(`Type of metrics argument not understood. Expected an string,function, Array, or Object, found: ${e}`);n=e}if(Array.isArray(n))return t.map(e=>n);{const e=[];for(const r of t){let t=n.hasOwnProperty(r)?n[r]:[];Array.isArray(t)||(t=[t]),e.push(t)}return e}}(e.metrics,this.outputNames),o=(e,t,n)=>{this.outputNames.length>1&&(t=this.outputNames[e]+"_"+t),this.metricsNames.push(t),this.metricsTensors.push([n,e])};Uk("metric",()=>{for(let e=0;e<this.outputs.length;++e)-1===n.indexOf(e)&&(t=>{let n,r,i;for(const a of t){if("string"==typeof a&&-1!==["accuracy","acc","crossentropy","ce"].indexOf(a)){const t=this.internalOutputShapes[e];let o;1===t[t.length-1]||this.lossFunctions[e]===wI?-1!==["accuracy","acc"].indexOf(a)?r=kI:-1!==["crossentropy","ce"].indexOf(a)&&(r=II):this.lossFunctions[e]===_I?-1!==["accuracy","acc"].indexOf(a)?r=TI:-1!==["crossentropy","ce"].indexOf(a)&&(r=NI):-1!==["accuracy","acc"].indexOf(a)?r=EI:-1!==["crossentropy","ce"].indexOf(a)&&(r=FI),-1!==["accuracy","acc"].indexOf(a)?o="acc":-1!==["crossentropy","ce"].indexOf(a)&&(o="ce"),i=r,n=""+o}else{const e=AI(a);i=e,n=""+CI(a)}let t;Uk(n,()=>{t=i}),o(e,n,t)}})(r[e])}),this.collectedTrainableWeights=this.trainableWeights}checkTrainableWeightsConsistency(){null!=this.collectedTrainableWeights&&this.trainableWeights.length!==this.collectedTrainableWeights.length&&console.warn("Discrepancy between trainableweights and collected trainable weights. Did 
2you set `model.trainable` without calling `model.compile()` afterwards?")}evaluate(e,t,n={}){const r=null==n.batchSize?32:n.batchSize;rT(r);const o=this.standardizeUserDataXY(e,t,!0,r);try{const e=o[0].concat(o[1]);this.makeTestFunction();const t=this.testFunction;return ak(this.testLoop(t,e,r,n.verbose,n.steps))}finally{lT(o[0],e),lT(o[1],t)}}async evaluateDataset(e,t){return this.makeTestFunction(),async function(e,t,n){const r=null!=(n=n||{}).batches,o=e.testFunction;let i=[];if(n.verbose>0)throw new tk("Verbose mode is not implemented yet.");Md(!r||n.batches>0&&Number.isInteger(n.batches),()=>`Test loop expects \`batches\` to be a positive integer, but received ${JSON.stringify(n.batches)}`);const a="function"==typeof t.next?t:await t.iterator();let s=0,l=0;for(;!r||l<n.batches;){const t=await a.next();if(i=Bb(()=>{if(t.value){const{xs:n,ys:r}=eT(e,t.value),a=n.concat(r),u=Bb(()=>o(a));if(Pb(a),0===l)for(let e=0;e<u.length;++e)i.push(zb(0));const p=a[0].shape[0];for(let e=0;e<u.length;++e){const t=u[e],n=i[e];i[e]=Bb(()=>Gb(i[e],Y$(p,t))),l>0&&Pb(n)}Pb(u),s+=p,++l}return i}),t.done){r&&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 e=0;e<i.length;++e){const t=i[e];i[e]=j$(i[e],s),Pb(t)}return ak(i)}(this,e,t)}checkNumSamples(e,t,n,r="steps"){let o;if(null!=n){if(o=null,null!=t)throw new ek(`If ${r} is set, batchSize must be null or undefined.Got batchSize = ${t}`)}else{if(null==e)throw new ek(`Either the input data should have a defined shape, or ${r} shoud be specified.`);o=Array.isArray(e)?e[0].shape[0]:e.shape[0]}return o}execute(e,t){if(Array.isArray(t)&&0===t.length)throw new ek("`outputs` is an empty Array, which is not allowed.");const n=Array.isArray(t),r=n?t:[t],o=this.retrieveSymbolicTensors(r),i=new zI;if(e instanceof ny&&(e=[e]),Array.isArray(e)){if(e.length!==this.inputs.length)throw new ek(`The number of inputs provided (${e.length}) does not match the number of inputs of this model (${this.inputs.length}).`);for(let t=0;t<this.inputs.length;++t)i.add(this.inputs[t],e[t])}else for(const t of this.inputs){const n=e[t.name];if(null==n)throw new ek(`No value is provided for the model's input ${t.name}`);i.add(t,n)}const a=GI(o,i);return n?a:a[0]}retrieveSymbolicTensors(e){const t=rk(null,e.length);let n=e.length;for(const r of this.layers){const o=Array.isArray(r.output)?r.output:[r.output],i=o.map(e=>e.name);for(let r=0;r<e.length;++r){const a=i.indexOf(e[r]);if(-1!==a&&(t[r]=o[a],n--),0===n)break}if(0===n)break}if(n>0){const n=[];throw t.forEach((t,r)=>{null==t&&n.push(e[r])}),new ek(`Cannot find SymbolicTensors for output name(s): ${JSON.stringify(n)}`)}return t}predictLoop(e,t=32,n=!1){return Bb(()=>{const r=this.checkNumSamples(e);if(n)throw new tk("Verbose predictLoop() is not implemented yet.");const o=aT(r,t),i=this.outputs.map(e=>[]);for(let t=0;t<o.length;++t)Bb(()=>{const n=o[t][0],r=o[t][1],i=oT(e,n,r),a=[];if(Array.isArray(i))for(let e=0;e<i.length;++e)a.push({key:this.inputs[e],value:i[e]});else a.push({key:this.inputs[0],value:i});const s=new zI(a);return GI(this.outputs,s)}).forEach((e,t)=>i[t].push(e));return ak(i.map(e=>y$(e,0)))})}predict(e,t={}){const n=sT(e);dT(n,this.inputNames,this.feedInputShapes,!1);try{const e=null==t.batchSize?32:t.batchSize;return rT(e),this.predictLoop(n,e)}finally{lT(n,e)}}predictOnBatch(e){dT(e,this.inputNames,this.feedInputShapes,!0);const t=(Array.isArray(e)?e[0]:e).shape[0];return this.predictLoop(e,t)}standardizeUserDataXY(e,t,n=!0,r){if(null==this.optimizer_)throw new Qv("You must compile a model before training/testing. Use LayersModel.compile(modelCompileArgs).");const o=[];for(let e=0;e<this.feedOutputShapes.length;++e){const t=this.feedOutputShapes[e];this.feedLossFns[e]===_I?o.push(t.slice(0,t.length-1).concat([1])):o.push(t)}if(function(e,t){const n=gk(e.map(e=>e.shape[0]));n.sort();const r=gk(t.map(e=>e.shape[0]));if(r.sort(),n.length>1)throw new ek(`All input Tensors (x) should have the same number of samples. Got array shapes: ${JSON.stringify(e.map(e=>e.shape))}`);if(r.length>1)throw new ek(`All target Tensors (y) should have the same number of samples. Got array shapes: ${JSON.stringify(t.map(e=>e.shape))}`);if(n.length>0&&r.length>0&&!Pd(n,r))throw new ek(`Input Tensors should have the same number of samples as target Tensors. Found ${n[0]} input sample(s) and ${r[0]} target sample(s).`)}(e=cT(e,this.feedInputNames,this.feedInputShapes,!1,"input"),t=cT(t,this.feedOutputNames,o,!1,"target")),function(e,t,n){const r=[mI,wI,$I];for(let o=0;o<e.length;++o){const i=e[o],a=t[o],s=n[o];
vendor: 12,920 bytes, line 2
2if(null!=a){if(a===$I&&1===i.shape[i.shape.length-1])throw new ek(`You are passing a target array of shape ${i.shape} while using a loss 'categorical_crossentropy'. 'categorical_crossentropy'expects targets to be binary matrices (1s and 0s) of shape [samples, classes].`);if(-1!==r.indexOf(a)){const e=i.shape.slice(1),t=s.slice(1);for(let n=0;n<e.length;++n){const r=e[n],o=t[n];if(null!=o&&r!==o)throw new ek(`A target Tensor with shape ${i.shape} was passed for an output of shape ${s}, while using a loss function that expects targets to have the same shape as the output.`)}}}}}(t,this.feedLossFns,this.feedOutputShapes),this.stateful&&null!=r&&r>0&&e[0].shape[0]%r!==0)throw new ek(`In a stateful network, you should only pass inputs with a number of samples that is divisible by the batch size ${r}. Found: ${e[0].shape[0]} sample(s).`);return[e,t]}async standardizeUserData(e,t,n,r,o=!0,i){const[a,s]=this.standardizeUserDataXY(e,t,o,i);if(null!=n)throw new Error("sample weight is not supported yet.");let l=null;if(null!=r){const e=JI(r,this.outputNames);l=[];for(let t=0;t<e.length;++t)l.push(await ZI(s[t],null,e[t]))}return[a,s,l]}testLoop(e,t,n,r=0,o){return Bb(()=>{const i=this.checkNumSamples(t,n,o,"steps"),a=[];if(r>0)throw new tk("Verbose mode is not implemented yet.");if(null!=o)throw new tk("steps mode in testLoop() is not implemented yet");{const r=aT(i,n),o=G_(Jk(0,i));for(let n=0;n<r.length;++n){const i=r[n][0],s=r[n][1],l=eE(o,i,s-i),u=iT(t,l),p=e(u);if(0===n)for(let e=0;e<p.length;++e)a.push(zb(0));for(let e=0;e<p.length;++e){const t=p[e];a[e]=Gb(a[e],Y$(s-i,t))}}for(let e=0;e<a.length;++e)a[e]=j$(a[e],i)}return a})}getDedupedMetricsNames(){const e=this.metricsNames,t=[];for(let n=0;n<e.length;++n){const r=e[n];let o=r;ik(e,r)>1&&(o+=`_${ik(e.slice(0,n),r)}`),t.push(o)}return t}makeTrainFunction(){return e=>{const t=[],n=e.slice(0,this.inputs.length),r=e.slice(this.inputs.length,this.inputs.length+this.outputs.length),o=e.slice(this.inputs.length+this.outputs.length,this.inputs.length+2*this.outputs.length),i=[],a=this.collectedTrainableWeights.map(e=>e.read());return[this.optimizer_.minimize(()=>{const e=[];for(let t=0;t<this.inputs.length;++t)e.push({key:this.inputs[t],value:n[t]});const a=new zI(e),s=GI(this.outputs,a,{training:!0});let l;for(let e=0;e<this.lossFunctions.length;++e){let n=(0,this.lossFunctions[e])(r[e],s[e]);null!=o[e]&&(n=QI(n,o[e]));const i=i_(n);t.push(i),l=0===e?n:Gb(l,n)}for(let e=0;e<this.metricsTensors.length;++e){let n;if(this.outputs.length>1&&e<this.outputs.length)n=t[e];else{const t=this.metricsTensors[e][0],o=this.metricsTensors[e][1];n=i_(t(r[o],s[o]))}Lb(n),i.push(n)}return l=i_(l),this.calculateLosses().forEach(e=>{l=Gb(l,e)}),l},!0,a)].concat(i)}}makeTestFunction(){this.testFunction=e=>Bb(()=>{const t=[];let n;const r=e.slice(0,this.inputs.length),o=e.slice(this.inputs.length,this.inputs.length+this.outputs.length),i=[];for(let e=0;e<this.inputs.length;++e)i.push({key:this.inputs[e],value:r[e]});const a=new zI(i),s=GI(this.outputs,a);for(let e=0;e<this.lossFunctions.length;++e){const r=this.lossFunctions[e],i=i_(r(o[e],s[e]));n=0===e?i:Gb(n,i),t.push(n)}for(let e=0;e<this.metricsTensors.length;++e){const n=this.metricsTensors[e][0],r=this.metricsTensors[e][1],i=i_(n(o[r],s[r]));t.push(i)}return t})}async fit(e,t,n={}){return async function(e,t,n,r={}){if(e.isTraining)throw new Error("Cannot start training because another fit() call is ongoing.");let o,i,a,s,l,u,p;e.isTraining=!0;try{const c=null==r.batchSize?32:r.batchSize;rT(c);const d=!1,h=await e.standardizeUserData(t,n,r.sampleWeight,r.classWeight,d,c);o=h[0],i=h[1],p=h[2];let f,g=!1;if(null!=r.validationData&&r.validationData.length>0){if(g=!0,2!==r.validationData.length)throw 3===r.validationData.length?new tk("validationData including sample weights is not supported yet."):new ek(`When passing validation data, it must contain 2 (valX, valY) or 3 (valX, valY, valSampleWeight) items; ${r.validationData} is invalid.`);a=r.validationData[0],s=r.validationData[1];const t=!0,n=await e.standardizeUserData(a,s,null,null,t,c);l=n[0],u=n[1],f=l.concat(u)}else if(null!=r.validationSplit&&r.validationSplit>0&&r.validationSplit<1){g=!0;const e=Math.floor(o[0].shape[0]*(1-r.validationSplit)),t=o[0].shape[0];l=oT(o,e,t),o=oT(o,0,e),u=oT(i,e,t),i=oT(i,0,e),f=l.concat(u)}else null!=r.validationSteps&&(g=!0);const m=o.concat(i).concat(p);e.checkTrainableWeightsConsistency();const y=e.makeTrainFunction(),b=e.getDedupedMetricsNames();let $,_;g?(e.makeTestFunction(),$=e.testFunction,_=b.slice().concat(b.map(e=>"val_"+e))):($=null,f=[],_=b.slice());const w=cI(r.callbacks,r.yieldEvery),x=await async function(e,t,n,r,o,i,a,s,l,u,p,c,d,h){null==o&&(o=32),null==i&&(i=1),null==p&&(p=!0),null==d&&(d=0);let f=!1;null!=l&&null!=u&&(f=!0);const g=e.checkNumSamples(n,o,h,"steps_per_epoch");let m;null!=g&&(m=Jk(0,g)),null==a&&(a=1);const{callbackList:y,history:b}=hI(s,a,i,d,g,h,o,f,c);y.setModel(e),e.history=b,await y.onTrainBegin(),e.stopTraining_=!1;for(let a=d;a<i;++a){await y.onEpochBegin(a);const i={};{if("batch"===p)throw new tk("batch shuffling is not implemneted yet");p&&jd(m);const a=G_(m),s=aT(g,o);for(let p=0;p<s.length;++p){const c={};if(await y.onBatchBegin(p,c),Bb(()=>{const d=s[p][0],h=s[p][1],g=eE(a,d,h-d);c.batch=p,c.size=h-d;const m=iT(n,g),y=t(m);for(let e=0;e<r.length;++e){const t=r[e],n=y[e];c[t]=n,Lb(n)}if(p===s.length-1&&f){const t=e.testLoop(l,u,o);for(let e=0;e<r.length;++e){const n=r[e],o=t[e];Lb(o),i["val_"+n]=o}}}),await y.onBatchEnd(p,c),oI(c),e.stopTraining_)break}a.dispose()}if(await y.onEpochEnd(a,i),e.stopTraining_)break}return await y.onTrainEnd(),await e.history.syncData(),e.history}(e,y,m,b,c,r.epochs,r.verbose,w,$,f,r.shuffle,_,r.initialEpoch,null);return x}finally{e.isTraining=!1,lT(o,t),lT(i,n),lT(l,a),lT(u,s),null!=p&&Pb(p)}}(this,e,t,n)}async fitDataset(e,t){return async function(e,t,n){const r=null!=n.batchesPerEpoch;if(Md(null!=e.optimizer,()=>"You must compile a model before training/testing. Use LayersModel.compile(modelCompileConfig)."),Md(null!=n,()=>"For fitDataset(), the 2nd argument (config) is required, but it is not provided in this call."),Md(null!=n.epochs&&n.epochs>0&&Number.isInteger(n.epochs),()=>`For fitDataset(), config.epochs is expected to be a positive integer, but got ${n.epochs}`),Md(!r||n.batchesPerEpoch>0&&Number.isInteger(n.batchesPerEpoch),()=>`For fitDataset(), config.batchesPerEpoch is expected to be a positive integer if specified, but got ${n.batchesPerEpoch}`),Md(null==n.validationSplit,()=>"`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{const o=null!=n.validationData;let i,a;if(o)if(nT(n.validationData))Md(null==n.validationBatches||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{const e=function(e){if(3===e.length)throw new tk("Validation with sample weights is not implemented yet.");return{xs:e[0],ys:e[1]}}(n.validationData);i=e.xs,a=e.ys}const s=e.makeTrainFunction(),l=e.getDedupedMetricsNames();let u;u=o?l.slice().concat(l.map(e=>"val_"+e)):l.slice();const p=cI(n.callbacks,n.yieldEvery),c=null==n.verbose?1:n.verbose,{callbackList:d,history:h}=hI(p,c,n.epochs,null,null,function(e,t){let n=null;return null!=t.batchesPerEpoch?n=t.batchesPerEpoch:Number.isFinite(e.size)&&(n=e.size),n}(t,n),null,o,u);d.setModel(e),e.history=h,await d.onTrainBegin(),e.stopTraining_=!1;let f=null==n.initialEpoch?0:n.initialEpoch,g=await t.iterator();for(;f<n.epochs;){const u={};await d.onEpochBegin(f);let p=0,c=0;for(r||(g=await t.iterator());!r||p<n.batchesPerEpoch;){const t=await g.next();if(r&&t.done){console.warn(`You provided \`batchesPerEpoch\` as ${n.batchesPerEpoch}, but your dataset iterator ran out of data after ${p} batches; interrupting training. Make sure that your dataset can generate at least \`batchesPerEpoch * epochs\` batches (in this case, `+n.batchesPerEpoch*n.epochs+" batches). You may need to use the repeat() function when building your dataset.");break}if(null!=t.value){const{xs:r,ys:o}=eT(e,t.value),i={};i.batch=c,i.size=r[0].shape[0],await d.onBatchBegin(c,i);const a=[];if(null!=n.classWeight){const t=JI(n.classWeight,e.outputNames);for(let e=0;e<t.length;++e)a.push(await ZI(o[e],null,t[e]))}const u=r.concat(o).concat(a),h=s(u);Pb(u);for(let e=0;e<l.length;++e){const t=l[e],n=h[e];i[t]=n,Lb(n)}await d.onBatchEnd(c,i),oI(i),c++,p++}if(r?p>=n.batchesPerEpoch:t.done){if(o){let t;t=nT(n.validationData)?sk(await e.evaluateDataset(n.validationData,{batches:n.validationBatches})):sk(e.evaluate(i,a,{batchSize:null==n.validationBatchSize?32:n.validationBatchSize,verbose:0}));for(let n=0;n<e.metricsNames.length;++n)u[`val_${e.metricsNames[n]}`]=t[n]}break}if(e.stopTraining_)break}if(await d.onEpochEnd(f,u),f++,e.stopTraining_)break}return await d.onTrainEnd(),await e.history.syncData(),e.history}finally{e.isTraining=!1}}(this,e,t)}async trainOnBatch(e,t){const n=await this.standardizeUserData(e,t),r=n[0],o=n[1],i=this.makeTrainFunction()(r.concat(o)),a=[];for(const e of i){const t=await e.data();a.push(t[0])}return Pb(i),ak(a)}getNamedWeights(e){const t=[],n=null!=e&&e.trainableOnly,r=n?this.trainableWeights:this.weights,o=this.getWeights(n);for(let e=0;e<r.length;++e)n&&!r[e].trainable||t.push({name:r[e].originalName,tensor:o[e]});return t}set stopTraining(e){this.stopTraining_=e}get stopTraining(){return this.stopTraining_}get optimizer(){return this.optimizer_}set optimizer(e){this.optimizer_!==e&&(this.optimizer_=e,this.isOptimizerOwned=!1)}dispose(){const e=super.dispose();if(0===e.refCountAfterDispose&&null!=this.optimizer&&this.isOptimizerOwned){const t=Rb().numTensors;this.optimizer_.dispose(),e.numDisposedVariables+=t-Rb().numTensors}return e}getLossIdentifiers(){let e;if("string"==typeof this.loss)e=lk(this.loss);else if(Array.isArray(this.loss)){for(const e of this.loss)if("string"!=typeof e)throw new Error("Serialization of non-string loss is not supported.");e=this.loss.map(e=>lk(e))}else{const t=Object.keys(this.loss);e={};const n=this.loss;for(const r of t){if("string"!=typeof n[r])throw new Error("Serialization of non-string loss is not supported.");e[r]=lk(n[r])}}return e}getMetricIdentifiers(){if("string"==typeof this.metrics||"function"==typeof this.metrics)return[lk(CI(this.metrics))];if(Array.isArray(this.metrics))return this.metrics.map(e=>lk(CI(e)));{const e={};for(const t in this.metrics)e[t]=lk(CI(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(null!=e.weighted_metrics)throw new Error("Loading weight_metrics is not supported yet.");if(null!=e.loss_weights)throw new Error("Loading loss_weights is not supported yet.");if(null!=e.sample_weight_mode)throw new Error("Loading sample_weight_mode is not supported yet.");const t=fI(LI(e.optimizer_config));let n,r;if("string"==typeof e.loss)n=uk(e.loss);else if(Array.isArray(e.loss))n=e.loss.map(e=>uk(e));else if(null!=e.loss){n={};for(const t in e.loss)n[t]=uk(e.loss[t])}if(Array.isArray(e.metrics))r=e.metrics.map(e=>uk(e));else if(null!=e.metrics){r={};for(const t in e.metrics)r[t]=uk(e.metrics[t])}this.compile({loss:n,metrics:r,optimizer:t})}async save(e,t){if("string"==typeof e){const t=Wy(e);if(0===t.length)throw new ek(`Cannot find any save handlers for URL '${e}'`);if(t.length>1)throw new ek(`Found more than one (${t.length}) save handlers for URL '${e}'`);e=t[0]}if(null==e.save)throw new ek("LayersModel.save() cannot proceed because the IOHandler provided does not have the `save` attribute defined.");const n=await Ay(this.getNamedWeights(t)),r={modelTopology:this.toJSON(null,!1),format:"layers-model",generatedBy:`TensorFlow.js tfjs-layers v${UI}`,convertedBy:null};if(null!=t&&t.includeOptimizer&&null!=this.optimizer){r.trainingConfig=this.getTrainingConfig();const e="optimizer",{data:t,specs:o}=await Ay(await this.optimizer.getWeights(),e);n.specs.push(...o),n.data=Oy([n.data,t])}if(null!=this.userDefinedMetadata){const e=!0;MI(this.userDefinedMetadata,this.name,e),r.userDefinedMetadata=this.userDefinedMetadata}return r.weightData=n.data,r.weightSpecs=n.specs,e.save(r)}setUserDefinedMetadata(e){MI(e,this.name),this.userDefinedMetadata=e}getUserDefinedMetadata(){return this.userDefinedMetadata}}hT.className="Model",Db(hT);class fT extends hT{}fT.className="Functional",Db(fT);class gT extends hT{constructor(e){if(super({inputs:[],outputs:[]}),e=e||{},this.trainable=!0,this.built=!1,this.name=null!=e.name?e.name:PE("sequential_"),null!=e.layers
vendor: 3,460 bytes, line 2
2)for(const t of e.layers)this.add(t)}checkShape(e){if(e.inboundNodes[0].outputTensors[0].shape.some(e=>e<0))throw new ek(`Negative dimension size caused by adding layer ${e.name} with input shape [${e.inboundNodes[0].inputTensors[0].shape}]`)}add(e){const t=e instanceof gT||e instanceof hT;let n;if(t){if(n=e,1!==n.outputs.length)throw new ek("All layers in a Sequential model should have a single output tensor. For multi-output layers, use the functional API.");if(1!==n.inputs.length)throw new ek("All layers in a Sequential model should have a single input tensor. For multi-input layers, use the functional API.")}if(0===this.outputs.length){if(0===e.inboundNodes.length){if(null==e.batchInputShape)throw new ek("The first layer in a Sequential model must get an `inputShape` or `batchInputShape` argument.");const t=function(e){if(null==e.batchShape&&null==e.shape)throw new Error("Please provide to Input either a `shape` or a `batchShape` argument. Note that `shape` does not include the batch dimension.");if(null!=e.batchShape&&null!=e.shape)throw new ek("Please provide either a `shape` or `batchShape` argument to Input, but not both.");let t=e.batchShape;null!=e.shape&&null==t&&(t=[null].concat(e.shape));let n=e.dtype;return null==n&&(n="float32"),new nI({batchInputShape:t,name:e.name,dtype:n,sparse:e.sparse}).inboundNodes[0].outputTensors[0]}({batchShape:e.batchInputShape,dtype:e.dtype,name:e.name+"_input"});e.apply(t)}if(t)this.outputs=n.outputs,this.inputs=n.inputs;else{if(1!==e.inboundNodes.length)throw new ek(`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(1!==e.inboundNodes[0].outputTensors.length)throw new ek("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=tI(this.outputs[0])}this.inboundNodes=[],new ZE({outboundLayer:this,inboundLayers:[],nodeIndices:[],tensorIndices:[],inputTensors:this.inputs,outputTensors:this.outputs,inputMasks:rk(null,this.inputs.length),outputMasks:[null],inputShapes:this.inputs.map(e=>e.shape),outputShapes:this.outputs[0].shape})}else{const t=e.apply(this.outputs[0]);if(Array.isArray(t))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=[t],this.inboundNodes[0].outputTensors=this.outputs,this.inboundNodes[0].outputShapes=[this.outputs[0].shape]}this.layers.push(e),this.built=!1}pop(){if(0===this.layers.length)throw new TypeError("There are no layers in the model.");if(this.layers.pop(),0===this.layers.length)this.outputs=[],this.inboundNodes=[],this.outboundNodes=[];else{const 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 null==this.model&&this.build(),this.model.call(e,t)}build(e){if(zE(e),0===this.inputs.length||0===this.outputs.length)throw new TypeError("Sequential model cannot be built: model is empty. Add some layers first.");this.model=new hT({inputs:this.inputs,outputs:this.outputs[0],name:this.name+"_model"}),this.model.trainable=this.trainable,this.supportsMasking=this.model.supp
vendor: 19,261 bytes, line 2
2ortsMasking,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){null==this.model&&this.build(),this.model.setWeights(e)}evaluate(e,t,n={}){if(!this.built)throw new Qv("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 Qv("The model needs to be compiled before being used.");return this.model.evaluateDataset(e,t)}predict(e,t={}){return null==this.model&&this.build(),this.model.predict(e,t)}predictOnBatch(e){return null==this.model&&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 null==this.model?void 0:this.model.optimizer}set optimizer(e){this.model.optimizer=e}async fit(e,t,n={}){if(!this.built)throw new Qv("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 Qv("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={},r=!1){let o,i={};if(t instanceof Array){if(null==t[0].className||"Merge"===t[0].className)throw new ek("Legacy serialization format not supported yet.");o=t}else Md(null!=t.layers,()=>"When the config data for a Sequential model is not an Array, it must be an Object that contains the 'layers' field."),o=t.layers,delete t.layers,i=t;const a=new e(i);if(!(a instanceof gT))throw new tk(`Sequential.fromConfig called on non-Sequential input: ${a}`);for(const e of o){const t=fI(e,void 0,r);r&&t.setFastWeightInitDuringBuild(!0),a.add(t)}return a}set stopTraining(e){if(null==this.model)throw new ek("Cannot set the stopTraining property of a sequential model before it is compiled.");this.model.stopTraining=e}get stopTraining(){if(null==this.model)throw new ek("Cannot get the stopTraining property of a sequential model before it is compiled.");return this.model.stopTraining}getConfig(){const e=[];for(const t of this.layers){const n={};n.className=t.getClassName(),n.config=t.getConfig(),e.push(n)}return{name:this.name,layers:e}}}gT.className="Sequential",Db(gT);class mT extends Cb{getConfig(){return{}}}class yT extends mT{apply(e,t=1){return function(e,t=1){if(1!==t)throw new tk(`Support for alpha values other than 1 (${t}) is not implemented yet.`);return A$(e)}(e,t)}}yT.className="elu",Db(yT);class bT extends mT{apply(e){return j_(e)}}bT.className="selu",Db(bT);class $T extends mT{apply(e){return F_(e)}}$T.className="relu",Db($T);class _T extends mT{apply(e){return Bb(()=>a_(6,F_(e)))}}_T.className="relu6",Db(_T);class wT extends mT{apply(e){return e}}wT.className="linear",Db(wT);class xT extends mT{apply(e){return C_(e)}}xT.className="sigmoid",Db(xT);class ST extends mT{apply(e){return function(e){return Bb(()=>{const t=Gb(.5,Y$(.2,e));return m$(t,0,1)})}(e)}}ST.className="hardSigmoid",Db(ST);class vT extends mT{apply(e){return L_(e)}}vT.className="softplus",Db(vT);class kT extends mT{apply(e){return function(e){return Bb(()=>j$(e,Gb(Hb(e),1)))}(e)}}kT.className="softsign",Db(kT);class ET extends mT{apply(e){return H_(e)}}ET.className="tanh",Db(ET);class IT extends mT{apply(e,t=-1){return P_(e,t)}}IT.className="softmax",Db(IT);class TT extends mT{apply(e,t=-1){return Q$(e,t)}}TT.className="logSoftmax",Db(TT);class FT extends mT{apply(e,t=1){return Bb(()=>Y$(C_(Y$(e,t)),e))}}FT.className="swish",Db(FT);class NT extends mT{apply(e){return Bb(()=>Y$(e,H_(L_(e))))}}function jT(e){return e.getClassName()}function AT(e,t={}){return hk(e,Mb.getMap().classNameMap,t,"activation")}function CT(e){if(null==e){return AT({className:"linear",config:{}})}if("string"==typeof e){const t={};return t.className=e,t.config={},AT(t)}return e instanceof mT?e:AT(e)}NT.className="mish",Db(NT);class MT extends Cb{}class DT extends MT{constructor(e){super(),function(e){if(null!=e&&"object"!=typeof e)throw new Error(`Argument to L1L2 regularizer's constructor is expected to be an object, but received: ${e}`)}(e),this.l1=null==e||null==e.l1?.01:e.l1,this.l2=null==e||null==e.l2?.01:e.l2,this.hasL1=0!==this.l1,this.hasL2=0!==this.l2}apply(e){return Bb(()=>{let t=$_([1]);return this.hasL1&&(t=Gb(t,Z$(Y$(this.l1,Hb(e))))),this.hasL2&&(t=Gb(t,Z$(Y$(this.l2,uE(e))))),u$(t,[])})}getConfig(){return{l1:this.l1,l2:this.l2}}static fromConfig(e,t){return new e({l1:t.l1,l2:t.l2})}}DT.className="L1L2",Db(DT);const OT={l1l2:"L1L2"};function RT(e){return ck(e)}function BT(e,t={}){return hk(e,Mb.getMap().classNameMap,t,"regularizer")}function PT(e){return null==e?null:"string"==typeof e?BT({className:e in OT?OT[e]:e,config:{}}):e instanceof MT?e:BT(e)}class LT extends eI{constructor(e){super(null==e?{}:e),this.supportsMasking=!0,null!=e&&(this.maxValue=e.maxValue)}call(e,t){e=UE(e);let n=F_(e);return null!=this.maxValue&&(n=m$(n,0,this.maxValue)),n}computeOutputShape(e){return e}getConfig(){const e={maxValue:this.maxValue},t=super.getConfig();return Object.assign(e,t),e}}LT.className="ReLU",Db(LT);class WT extends eI{constructor(e){super(null==e?{}:e),this.DEFAULT_ALPHA=.3,null==e&&(e={}),this.alpha=null==e.alpha?this.DEFAULT_ALPHA:e.alpha}call(e,t){const n=UE(e);return G$(n,this.alpha)}computeOutputShape(e){return e}getConfig(){const e={alpha:this.alpha},t=super.getConfig();return Object.assign(e,t),e}}WT.className="LeakyReLU",Db(WT);class UT extends eI{constructor(e){if(super(null==e?{}:e),this.DEFAULT_ALPHA_INITIALIZER="zeros",null==e&&(e={}),this.supportsMasking=!0,this.alphaInitializer=DE(e.alphaInitializer||this.DEFAULT_ALPHA_INITIALIZER),this.alphaRegularizer=PT(e.alphaRegularizer),this.alphaConstraint=jk(e.alphaConstraint),null==e.sharedAxes)this.sharedAxes=null;else if(Array.isArray(e.sharedAxes))this.sharedAxes=e.sharedAxes;else{if("number"!=typeof e.sharedAxes)throw new ek(`Expected sharedAxes to be a number or an array of numbers, but got ${e.sharedAxes}`);this.sharedAxes=[e.sharedAxes]}}build(e){const t=(e=zE(e)).slice(1);if(null!=this.sharedAxes)for(const e of this.sharedAxes)t[e-1]=1;this.alpha=this.addWeight("alpha",t,"float32",this.alphaInitializer,this.alphaRegularizer,!0,this.alphaConstraint);const n={};if(null!=this.sharedAxes)for(let t=1;t<e.length;++t)n[t]=e[t];this.inputSpec=[new XE({ndim:e.length,axes:n})],this.built=!0}call(e,t){return e=UE(e),S_(e,this.alpha.read())}getConfig(){const e={alphaInitializer:ME(this.alphaInitializer),alphaRegularizer:RT(this.alphaRegularizer),alphaConstraint:Fk(this.alphaConstraint),sharedAxes:this.sharedAxes},t=super.getConfig();return Object.assign(e,t),e}}UT.className="PReLU",Db(UT);class zT extends eI{constructor(e){if(super(null==e?{}:e),this.DEFAULT_ALPHA=1,null==e&&(e={}),null!=e.alpha&&e.alpha!==this.DEFAULT_ALPHA)throw new tk(`Non-default alpha value (${e.alpha}) is not supported by the ELU layer yet.`);this.alpha=null==e.alpha?this.DEFAULT_ALPHA:e.alpha}call(e,t){const n=UE(e);return A$(n)}computeOutputShape(e){return e}getConfig(){const e={alpha:this.alpha},t=super.getConfig();return Object.assign(e,t),e}}zT.className="ELU",Db(zT);class VT extends eI{constructor(e){super(null==e?{}:e),this.DEFAULT_THETA=1,null==e&&(e={}),this.theta=null==e.theta?this.DEFAULT_THETA:e.theta}call(e,t){const n=UE(e);return Y$(n,hb(V$(n,this.theta),"float32"))}computeOutputShape(e){return e}getConfig(){const e={theta:this.theta},t=super.getConfig();return Object.assign(e,t),e}}VT.className="ThresholdedReLU",Db(VT);class HT extends eI{constructor(e){super(null==e?{}:e),this.DEFAULT_AXIS=1,null==e&&(e={}),this.softmax=(new IT).apply,this.axis=null==e.axis?this.DEFAULT_AXIS:e.axis}call(e,t){const n=UE(e);return this.softmax(n,this.axis)}computeOutputShape(e){return e}getConfig(){const e={axis:this.axis},t=super.getConfig();return Object.assign(e,t),e}}function GT(e,t,n){if("number"==typeof e)return rk(e,t);if(e.length!==t)throw new ek(`The ${n} argument must be an integer or tuple of ${t} integers. Received: ${e.length} elements.`);for(let r=0;r<t;++r){const o=e[r];if(!qk(o))throw new ek(`The ${n} argument must be an integer or tuple of ${t} integers. Received: ${JSON.stringify(e)} including a non-integer number ${o}`)}return e}function qT(e,t,n,r,o=1){if(null==e)return e;let i;return i="same"===n?e:e-(t+(t-1)*(o-1))+1,Math.floor((i+r-1)/r)}function KT(e,t,n,r){if(null==e)return null;if("valid"===r)e=e*t+Yk([n-t,0]);else{if("same"!==r)throw new ek(`Unsupport padding mode: ${r}.`);e*=t}return e}function XT(e,t){return Bb(()=>(Bk(t),"channelsFirst"===t?Q_(e,[0,2,3,1]):e))}function YT(e,t){return Bb(()=>(Bk(t),"channelsFirst"===t?Q_(e,[0,2,3,4,1]):e))}function JT(e,t,n,r=[1,1],o="valid",i,a,s=null){return Bb(()=>{if(null==i&&(i="channelsLast"),Bk(i),3!==e.rank&&4!==e.rank)throw new ek(`conv2dWithBiasActivation expects input to be of rank 3 or 4, but received ${e.rank}.`);if(3!==t.rank&&4!==t.rank)throw new ek(`conv2dWithBiasActivation expects kernel to be of rank 3 or 4, but received ${e.rank}.`);let l=XT(e,i);if("causal"===o)throw new tk("The support for CAUSAL padding mode in conv1dWithBias is not implemented yet.");return l=fw({x:l,filter:t,strides:r,pad:"same"===o?"same":"valid",dilations:a,dataFormat:"NHWC",bias:n,activation:s}),"channelsFirst"===i&&(l=Q_(l,[0,3,1,2])),l})}HT.className="Softmax",Db(HT);class ZT extends eI{constructor(e,t){if(super(t),this.bias=null,this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_BIAS_INITIALIZER="zeros",ZT.verifyArgs(t),this.rank=e,$k(this.rank,"rank"),1!==this.rank&&2!==this.rank&&3!==this.rank)throw new tk(`Convolution layer for rank other than 1, 2, or 3 (${this.rank}) is not implemented yet.`);if(this.kernelSize=GT(t.kernelSize,e,"kernelSize"),this.strides=GT(null==t.strides?1:t.strides,e,"strides"),this.padding=null==t.padding?"valid":t.padding,Pk(this.padding),this.dataFormat=null==t.dataFormat?"channelsLast":t.dataFormat,Bk(this.dataFormat),this.activation=CT(t.activation),this.useBias=null==t.useBias||t.useBias,this.biasInitializer=DE(t.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.biasConstraint=jk(t.biasConstraint),this.biasRegularizer=PT(t.biasRegularizer),this.activityRegularizer=PT(t.activityRegularizer),this.dilationRate=GT(null==t.dilationRate?1:t.dilationRate,e,"dilationRate"),1===this.rank&&Array.isArray(this.dilationRate)&&1!==this.dilationRate.length)throw new ek(`dilationRate must be a number or an array of a single number for 1D convolution, but received ${JSON.stringify(this.dilationRate)}`);if(2===this.rank){if("number"==typeof this.dilationRate)this.dilationRate=[this.dilationRate,this.dilationRate];else if(2!==this.dilationRate.length)throw new ek(`dilationRate must be a number or array of two numbers for 2D convolution, but received ${JSON.stringify(this.dilationRate)}`)}else if(3===this.rank)if("number"==typeof this.dilationRate)this.dilationRate=[this.dilationRate,this.dilationRate,this.dilationRate];else if(3!==this.dilationRate.length)throw new ek(`dilationRate must be a number or array of three numbers for 3D convolution, but received ${JSON.stringify(this.dilationRate)}`)}static verifyArgs(e){if(ok("kernelSize"in e,"required key 'kernelSize' not in config"),"number"!=typeof e.kernelSize&&!bk(e.kernelSize,"number",1,3))throw new ek(`BaseConv expects config.kernelSize to be number or number[] with length 1, 2, or 3, but received ${JSON.stringify(e.kernelSize)}.`)}getConfig(){const e={kernelSize:this.kernelSize,strides:this.strides,padding:this.padding,dataFormat:this.dataFormat,dilationRate:this.dilationRate,activation:jT(this.activation),useBias:this.useBias,biasInitializer:ME(this.biasInitializer),biasRegularizer:RT(this.biasRegularizer),activityRegularizer:RT(this.activityRegularizer),biasConstraint:Fk(this.biasConstraint)},t=super.getConfig();return Object.assign(e,t),e}}class QT extends ZT{constructor(e,t){super(e,t),this.kernel=null,QT.verifyArgs(t),this.filters=t.filters,$k(this.filters,"filters"),this.kernelInitializer=DE(t.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.kernelConstraint=jk(t.kernelConstraint),this.kernelRegularizer=PT(t.kernelRegularizer)}build(e){e=zE(e);const t="channelsFirst"===this.dataFormat?1:e.length-1;if(null==e[t])throw new ek(`The channel dimension of the input should be defined. Found ${e[t]}`);const n=e[t],r=this.kernelSize.concat([n,this.filters]);this.kernel=this.addWeight("kernel",r,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 Bb(()=>{let t;e=UE(e);const n=null==this.bias?null:this.bias.read(),r=wk(this.activation.getClassName());if(null!=r&&2===this.rank)t=JT(e,this.kernel.read(),n,this.strides,this.padding,this.dataFormat,this.dilationRate,r);else{if(1===this.rank)t=function(e,t,n,r=1,o="valid",i,a=1){return Bb(()=>{if(null==i&&(i="channelsLast"),Bk(i),3!==e.shape.length)throw new ek(`The input of a conv1dWithBias operation should be 3, but is ${e.shape.length} instead.`);if(3!==t.shape.length)throw new ek(`The kernel for a conv1dWithBias operation should be 3, but is ${t.shape.length} instead`);if(null!=n&&1!==n.shape.length)throw new ek(`The bias for a conv1dWithBias operation should be 1, but is ${t.shape.length} instead`);if("channelsFirst"===i&&(e=Q_(e,[0,2,1])),"causal"===o)throw new tk("The support for CAUSAL padding mode in conv1dWithBias is not implemented yet.");let s=S$(e,t,r,"same"===o?"same":"valid","NWC",a);return null!=n&&(s=cE(s,n)),s})}(e,this.kernel.read(),n,this.strides[0],this.padding,this.dataFormat,this.dilationRate[0]);else if(2===this.rank)t=JT(e,this.kernel.read(),n,this.strides,this.padding,this.dataFormat,this.dilationRate);else{if(3!==this.rank)throw new tk("convolutions greater than 3D are not implemented yet.");t=function(e,t,n,r=[1,1,1],o="valid",i,a){return Bb(()=>{if(null==i&&(i="channelsLast"),Bk(i),4!==e.rank&&5!==e.rank)throw new ek(`conv3dWithBias expects input to be of rank 4 or 5, but received ${e.rank}.`);if(4!==t.rank&&5!==t.rank)throw new ek(`conv3dWithBias expects kernel to be of rank 4 or 5, but received ${e.rank}.`);let s=YT(e,i);if("causal"===o)throw new tk("The support for CAUSAL padding mode in conv3dWithBias is not implemented yet.");return s=E$(s,t,r,"same"===o?"same":"valid","NDHWC",a),null!=n&&(s=cE(s,n)),"channelsFirst"===i&&(s=Q_(s,[0,4,1,2,3])),s})}(e,this.kernel.read(),n,this.strides,this.padding,this.dataFormat,this.dilationRate)}null!=this.activation&&(t=this.activation.apply(t))}return t})}computeOutputShape(e){e=zE(e);const t=[],n="channelsLast"===this.dataFormat?e.slice(1,e.length-1):e.slice(2);for(let e=0;e<n.length;++e){const r=qT(n[e],this.kernelSize[e],this.padding,this.strides[e],"number"==typeof this.dilationRate?this.dilationRate:this.dilationRate[e]);t.push(r)}let r=[e[0]];return"channelsLast"===this.dataFormat?(r=r.concat(t),r.push(this.filters)):(r.push(this.filters),r=r.concat(t)),r}getConfig(){const e={filters:this.filters,kernelInitializer:ME(this.kernelInitializer),kernelRegularizer:RT(this.kernelRegularizer),kernelConstraint:Fk(this.kernelConstraint)},t=super.getConfig();return Object.assign(e,t),e}static verifyArgs(e){if(!("filters"in e)||"number"!=typeof e.filters||e.filters<1)throw new ek(`Convolution layer expected config.filters to be a 'number' > 0 but got ${JSON.stringify(e.filters)}`)}}class eF extends QT{constructor(e){super(2,e),eF.verifyArgs(e)}getConfig(){const e=super.getConfig();return delete e.rank,e}static verifyArgs(e){if("number"!=typeof e.kernelSize&&!bk(e.kernelSize,"number",1,2))throw new ek(`Conv2D expects config.kernelSize to be number or number[] with length 1 or 2, but received ${JSON.stringify(e.kernelSize)}.`)}}eF.className="Conv2D",Db(eF);class tF extends QT{constructor(e){super(3,e),tF.verifyArgs(e)}getConfig(){const e=super.getConfig();return delete e.rank,e}static verifyArgs(e){if("number"!=typeof e.kernelSize&&(!Array.isArray(e.kernelSize)||1!==e.kernelSize.length&&3!==e.kernelSize.length))throw new ek(`Conv3D expects config.kernelSize to be number or [number, number, number], but received ${JSON.stringify(e.kernelSize)}.`)}}tF.className="Conv3D",Db(tF);class nF extends eF{constructor(e){if(super(e),this.inputSpec=[new XE({ndim:4})],"same"!==this.padding&&"valid"!==this.padding)throw new ek(`Conv2DTranspose currently supports only padding modes 'same' and 'valid', but received padding mode ${this.padding}`)}build(e){if(4!==(e=zE(e)).length)throw new ek("Input should have rank 4; Received input shape: "+JSON.stringify(e));const t="channelsFirst"===this.dataFormat?1:e.length-1;if(null==e[t])throw new ek("The channel dimension of the inputs should be defined. Found `None`.");const n=e[t],r=this.kernelSize.concat([this.filters,n]);this.kernel=this.addWeight("kernel",r,"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 XE({ndim:4,axes:{[t]:n}})],this.built=!0}call(e,t){return Bb(()=>{let t=UE(e);if(4!==t.shape.length)throw new ek(`Conv2DTranspose.call() expects input tensor to be rank-4, but received a tensor of rank-${t.shape.length}`);const n=t.shape,r=n[0];let o,i;"channelsFirst"===this.dataFormat?(o=2,i=3):(o=1,i=2);const a=n[o],s=n[i],l=this.kernelSize[0],u=this.kernelSize[1],p=this.strides[0],c=this.strides[1],d=[r,KT(a,p,l,this.padding),KT(s,c,u,this.padding),this.filters];"channelsLast"!==this.dataFormat&&(t=Q_(t,[0,2,3,1]));let h=k$(t,this.kernel.read(),d,this.strides,this.padding);return"channelsLast"!==this.dataFormat&&(h=Q_(h,[0,3,1,2])),null!=this.bias&&(h=cE(h,this.bias.read(),this.dataFormat)),null!=this.activation&&(h=this.activation.apply(h)),h})}computeOutputShape(e){const t=(e=zE(e)).slice();let n,r,o;"channelsFirst"===this.dataFormat?(n=1,r=2,o=3):(n=3,r=1,o=2);const i=this.kernelSize[0],a=this.kernelSize[1],s=this.strides[0],l=this.strides[1];return t[n]=this.filters,t[r]=KT(t[r],s,i,this.padding),t[o]=KT(t[o],l,a,this.padding),t}getConfig(){const e=super.getConfig();return delete e.dilationRate,e}}nF.className="Conv2DTranspose",Db(nF);class rF extends tF{constructor(e){if(super(e),this.inputSpec=[new XE({ndim:5})],"same"!==this.padding&&"valid"!==this.padding)throw new ek(`Conv3DTranspose currently supports only padding modes '
2same' and 'valid', but received padding mode ${this.padding}`)}build(e){if(5!==(e=zE(e)).length)throw new ek("Input should have rank 5; Received input shape: "+JSON.stringify(e));const t="channelsFirst"===this.dataFormat?1:e.length-1;if(null==e[t])throw new ek("The channel dimension of the inputs should be defined. Found `None`.");const n=e[t],r=this.kernelSize.concat([this.filters,n]);this.kernel=this.addWeight("kernel",r,"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 XE({ndim:5,axes:{[t]:n}})],this.built=!0}call(e,t){return Bb(()=>{let t=UE(e);if(5!==t.shape.length)throw new ek(`Conv3DTranspose.call() expects input tensor to be rank-4, but received a tensor of rank-${t.shape.length}`);const n=t.shape,r=n[0];let o,i,a;"channelsFirst"===this.dataFormat?(a=2,o=3,i=4):(a=1,o=2,i=3);const s=n[a],l=n[o],u=n[i],p=this.kernelSize[0],c=this.kernelSize[1],d=this.kernelSize[2],h=this.strides[0],f=this.strides[1],g=this.strides[2],m=[r,KT(s,h,p,this.padding),KT(l,f,c,this.padding),KT(u,g,d,this.padding),this.filters];"channelsLast"!==this.dataFormat&&(t=Q_(t,[0,2,3,4,1]));let y=T$(t,this.kernel.read(),m,this.strides,this.padding);return"channelsLast"!==this.dataFormat&&(y=Q_(y,[0,4,1,2,3])),null!==this.bias&&(y=cE(y,this.bias.read(),this.dataFormat)),null!==this.activation&&(y=this.activation.apply(y)),y})}computeOutputShape(e){const t=(e=zE(e)).slice();let n,r,o,i;"channelsFirst"===this.dataFormat?(n=1,r=2,o=3,i=4):(n=4,r=1,o=2,i=3);const a=this.kernelSize[0],s=this.kernelSize[1],l=this.kernelSize[2],u=this.strides[0],p=this.strides[1],c=this.strides[2];return t[n]=this.filters,t[r]=KT(t[r],u,a,this.padding),t[o]=KT(t[o],p,s,this.padding),t[i]=KT(t[i],c,l,this.padding),t}getConfig(){const e=super.getConfig();return delete e.dilationRate,e}}rF.className="Conv3DTranspose",Db(rF);class oF extends QT{constructor(e,t){if(super(e,t),this.DEFAULT_DEPTHWISE_INITIALIZER="glorotUniform",this.DEFAULT_POINTWISE_INITIALIZER="glorotUniform",this.depthwiseKernel=null,this.pointwiseKernel=null,null==t.filters)throw new ek("The `filters` configuration field is required by SeparableConv, but is unspecified.");if(null!=t.kernelInitializer||null!=t.kernelRegularizer||null!=t.kernelConstraint)throw new ek("Fields kernelInitializer, kernelRegularizer and kernelConstraint are invalid for SeparableConv2D. Use depthwiseInitializer, depthwiseRegularizer, depthwiseConstraint, pointwiseInitializer, pointwiseRegularizer and pointwiseConstraint instead.");if(null!=t.padding&&"same"!==t.padding&&"valid"!==t.padding)throw new ek(`SeparableConv${this.rank}D supports only padding modes: 'same' and 'valid', but received ${JSON.stringify(t.padding)}`);this.depthMultiplier=null==t.depthMultiplier?1:t.depthMultiplier,this.depthwiseInitializer=DE(t.depthwiseInitializer||this.DEFAULT_DEPTHWISE_INITIALIZER),this.depthwiseRegularizer=PT(t.depthwiseRegularizer),this.depthwiseConstraint=jk(t.depthwiseConstraint),this.pointwiseInitializer=DE(t.depthwiseInitializer||this.DEFAULT_POINTWISE_INITIALIZER),this.pointwiseRegularizer=PT(t.pointwiseRegularizer),this.pointwiseConstraint=jk(t.pointwiseConstraint)}build(e){if((e=zE(e)).length<this.rank+2)throw new ek(`Inputs to SeparableConv${this.rank}D should have rank ${this.rank+2}, but received input shape: ${JSON.stringify(e)}`);const t="channelsFirst"===this.dataFormat?1:e.length-1;if(null==e[t]||e[t]<0)throw new ek(`The channel dimension of the inputs should be defined, but found ${JSON.stringify(e[t])}`);const n=e[t],r=this.kernelSize.concat([n,this.depthMultiplier]),o=[];for(let e=0;e<this.rank;++e)o.push(1);o.push(n*this.depthMultiplier,this.filters);const i=!0;this.depthwiseKernel=this.addWeight("depthwise_kernel",r,"float32",this.depthwiseInitializer,this.depthwiseRegularizer,i,this.depthwiseConstraint),this.pointwiseKernel=this.addWeight("pointwise_kernel",o,"float32",this.pointwiseInitializer,this.pointwiseRegularizer,i,this.pointwiseConstraint),this.useBias?this.bias=this.addWeight("bias",[this.filters],"float32",this.biasInitializer,this.biasRegularizer,i,this.biasConstraint):this.bias=null,this.inputSpec=[new XE({ndim:this.rank+2,axes:{[t]:n}})],this.built=!0}call(e,t){return Bb(()=>{let t;if(e=UE(e),1===this.rank)throw new tk("1D separable convolution is not implemented yet.");return 2===this.rank&&("channelsFirst"===this.dataFormat&&(e=Q_(e,[0,2,3,1])),t=A_(e,this.depthwiseKernel.read(),this.pointwiseKernel.read(),this.strides,this.padding,this.dilationRate,"NHWC")),this.useBias&&(t=cE(t,this.bias.read(),this.dataFormat)),null!=this.activation&&(t=this.activation.apply(t)),"channelsFirst"===this.dataFormat&&(t=Q_(t,[0,3,1,2])),t})}getConfig(){const e=super.getConfig();return delete e.rank,delete e.kernelInitializer,delete e.kernelRegularizer,delete e.kernelConstraint,e.depthwiseInitializer=ME(this.depthwiseInitializer),e.pointwiseInitializer=ME(this.pointwiseInitializer),e.depthwiseRegularizer=RT(this.depthwiseRegularizer),e.pointwiseRegularizer=RT(this.pointwiseRegularizer),e.depthwiseConstraint=Fk(this.depthwiseConstraint),e.pointwiseConstraint=Fk(this.pointwiseConstraint),e}}oF.className="SeparableConv";class iF extends oF{constructor(e){super(2,e)}}iF.className="SeparableConv2D",Db(iF);class aF extends QT{constructor(e){super(1,e),aF.verifyArgs(e),this.inputSpec=[{ndim:3}]}getConfig(){const e=super.getConfig();return delete e.rank,delete e.dataFormat,e}static verifyArgs(e){if("number"!=typeof e.kernelSize&&!bk(e.kernelSize,"number",1,1))throw new ek(`Conv1D expects config.kernelSize to be number or number[] with length 1, but received ${JSON.stringify(e.kernelSize)}.`)}}aF.className="Conv1D",Db(aF);class sF extends eI{constructor(e){super(e),"number"==typeof e.cropping?this.cropping=[[e.cropping,e.cropping],[e.cropping,e.cropping]]:"number"==typeof e.cropping[0]?this.cropping=[[e.cropping[0],e.cropping[0]],[e.cropping[1],e.cropping[1]]]:this.cropping=e.cropping,this.dataFormat=void 0===e.dataFormat?"channelsLast":e.dataFormat,this.inputSpec=[{ndim:4}]}computeOutputShape(e){return"channelsFirst"===this.dataFormat?[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 Bb(()=>{if(e=UE(e),"channelsLast"===this.dataFormat){const t=nE(e,this.cropping[0][0],e.shape[1]-this.cropping[0][0]-this.cropping[0][1],2);return nE(t,this.cropping[1][0],e.shape[2]-this.cropping[1][1]-this.cropping[1][0],3)}{const t=nE(e,this.cropping[0][0],e.shape[2]-this.cropping[0][0]-this.cropping[0][1],3);return nE(t,this.cropping[1][0],e.shape[3]-this.cropping[1][1]-this.cropping[1][0],4)}})}getConfig(){const e={cropping:this.cropping,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}}sF.className="Cropping2D",Db(sF);class lF extends eI{constructor(e){var t;super(e),this.DEFAULT_SIZE=[2,2],this.inputSpec=[{ndim:4}],this.size=null==e.size?this.DEFAULT_SIZE:e.size,this.dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,Bk(this.dataFormat),this.interpolation=null==e.interpolation?"nearest":e.interpolation,t=this.interpolation,yk(Ck,"InterpolationFormat",t)}computeOutputShape(e){if("channelsFirst"===this.dataFormat){const t=null==e[2]?null:this.size[0]*e[2],n=null==e[3]?null:this.size[1]*e[3];return[e[0],e[1],t,n]}{const t=null==e[1]?null:this.size[0]*e[1],n=null==e[2]?null:this.size[1]*e[2];return[e[0],t,n,e[3]]}}call(e,t){return Bb(()=>{let t=UE(e);const n=t.shape;if("channelsFirst"===this.dataFormat){t=Q_(t,[0,2,3,1]);const e=this.size[0]*n[2],r=this.size[1]*n[3],o="nearest"===this.interpolation?dx.resizeNearestNeighbor(t,[e,r]):dx.resizeBilinear(t,[e,r]);return Q_(o,[0,3,1,2])}{const e=this.size[0]*n[1],r=this.size[1]*n[2];return"nearest"===this.interpolation?dx.resizeNearestNeighbor(t,[e,r]):dx.resizeBilinear(t,[e,r])}})}getConfig(){const e={size:this.size,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}}lF.className="UpSampling2D",Db(lF);class uF extends ZT{constructor(e){super(2,e),this.depthwiseKernel=null,this.depthMultiplier=null==e.depthMultiplier?1:e.depthMultiplier,this.depthwiseInitializer=DE(e.depthwiseInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.depthwiseConstraint=jk(e.depthwiseConstraint),this.depthwiseRegularizer=PT(e.depthwiseRegularizer)}build(e){if((e=zE(e)).length<4)throw new ek(`Inputs to DepthwiseConv2D should have rank 4. Received input shape: ${JSON.stringify(e)}.`);const t="channelsFirst"===this.dataFormat?1:3;if(null==e[t]||e[t]<0)throw new ek(`The channel dimension of the inputs to DepthwiseConv2D should be defined, but is not (${e[t]}).`);const n=e[t],r=[this.kernelSize[0],this.kernelSize[1],n,this.depthMultiplier];this.depthwiseKernel=this.addWeight("depthwise_kernel",r,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 Bb(()=>{let t=function(e,t,n=[1,1],r="valid",o,i){return Bb(()=>{null==o&&(o="channelsLast"),Bk(o);let a=XT(e,o);if(4!==e.rank)throw new ek(`Input for depthwiseConv2d is required to be 4-D, but is instead ${e.rank}-D`);if(4!==t.rank)throw new ek(`depthwiseKernel is required to be 4-D, but is instead ${t.rank}-D`);return a=F$(a,t,n,"same"===r?"same":"valid","NHWC",i),"channelsFirst"===o&&(a=Q_(a,[0,3,1,2])),a})}(e=UE(e),this.depthwiseKernel.read(),this.strides,this.padding,this.dataFormat,null);return this.useBias&&(t=cE(t,this.bias.read(),this.dataFormat)),null!=this.activation&&(t=this.activation.apply(t)),t})}computeOutputShape(e){e=zE(e);const t="channelsFirst"===this.dataFormat?e[2]:e[1],n="channelsFirst"===this.dataFormat?e[3]:e[2],r="channelsFirst"===this.dataFormat?e[1]*this.depthMultiplier:e[3]*this.depthMultiplier,o=qT(t,this.kernelSize[0],this.padding,this.strides[0]),i=qT(n,this.kernelSize[1],this.padding,this.strides[1]);return"channelsFirst"===this.dataFormat?[e[0],r,o,i]:[e[0],o,i,r]}getConfig(){const e=super.getConfig();return e.depthMultiplier=this.depthMultiplier,e.depthwiseInitializer=ME(this.depthwiseInitializer),e.depthwiseRegularizer=RT(this.depthwiseRegularizer),e.depthwiseConstraint=Fk(this.depthwiseRegularizer),e}}function pF(e,t,n,r){if(Array.isArray(e)){if(null!=t||null!=n)throw new ek("When input
2s is an array, neither initialState or constants should be provided");null!=r&&(n=e.slice(e.length-r,e.length),e=e.slice(0,e.length-r)),e.length>1&&(t=e.slice(1,e.length)),e=e[0]}function o(e){return null==e||Array.isArray(e)?e:[e]}return{inputs:e,initialState:t=o(t),constants:n=o(n)}}function cF(e,t,n,r=!1,o,i,a=!1,s=!1){return Bb(()=>{const l=t.shape.length;if(l<3)throw new ek(`Input should be at least 3D, but is ${l}D.`);const u=[1,0].concat(Jk(2,l));if(t=Q_(t,u),null!=i)throw new tk("The rnn() functoin of the deeplearn.js backend does not support constants yet.");a&&console.warn("Backend rnn(): the unroll = true option is not applicable to the imperative deeplearn.js backend."),null!=o&&((o=hb(hb(o,"bool"),"float32")).rank===l-1&&(o=B$(o,-1)),o=Q_(o,u)),r&&(t=N_(t,0),null!=o&&(o=N_(o,0)));const p=[];let c,d=n;const h=t.shape[0],f=X_(t);let g,m;null!=o&&(g=X_(o));for(let t=0;t<h;++t){const n=f[t],r=Bb(()=>e(n,d));if(null==o)c=r[0],d=r[1];else{const e=Bb(()=>{const e=g[t],n=J$(w_(e),e);return{output:Gb(Y$(r[0],e),Y$(d[0],n)),newStates:d.map((t,o)=>Gb(Y$(r[1][o],e),Y$(t,n)))}});c=e.output,d=e.newStates}s&&p.push(c)}return s&&(m=V_(p,1)),[c,m,d]})}uF.className="DepthwiseConv2D",Db(uF);class dF extends eI{constructor(e){let t;if(super(e),null==e.cell)throw new ek("cell property is missing for the constructor of RNN.");if(t=Array.isArray(e.cell)?new _F({cells:e.cell}):e.cell,null==t.stateSize)throw new ek("The RNN cell should have an attribute `stateSize` (tuple of integers, one integer per RNN state).");this.cell=t,this.returnSequences=null!=e.returnSequences&&e.returnSequences,this.returnState=null!=e.returnState&&e.returnState,this.goBackwards=null!=e.goBackwards&&e.goBackwards,this._stateful=null!=e.stateful&&e.stateful,this.unroll=null!=e.unroll&&e.unroll,this.supportsMasking=!0,this.inputSpec=[new XE({ndim:3})],this.stateSpec=null,this.states_=null,this.numConstants=null,this.keptStates=[]}getStates(){return null==this.states_?Jk(0,Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1).map(e=>null):this.states_}setStates(e){this.states_=e}computeOutputShape(e){LE(e)&&(e=e[0]);let t=this.cell.stateSize;Array.isArray(t)||(t=[t]);const n=t[0];let r;if(r=this.returnSequences?[e[0],e[1],n]:[e[0],n],this.returnState){const n=[];for(const r of t)n.push([e[0],r]);return[r].concat(n)}return r}computeMask(e,t){return Bb(()=>{Array.isArray(t)&&(t=t[0]);const e=this.returnSequences?t:null;if(this.returnState){const t=this.states.map(e=>null);return[e].concat(t)}return e})}get states(){if(null==this.states_){const e=Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1,t=[];for(let n=0;n<e;++n)t.push(null);return t}return this.states_}set states(e){this.states_=e}build(e){if(null!=this.numConstants)throw new tk("Constants support is not implemented in RNN yet.");LE(e)&&(e=e[0]);const t=this.stateful?e[0]:null,n=e.slice(2);this.inputSpec[0]=new XE({shape:[t,null,...n]});const r=[e[0]].concat(e.slice(2));let o;if(this.cell.build(r),o=Array.isArray(this.cell.stateSize)?this.cell.stateSize:[this.cell.stateSize],null!=this.stateSpec){if(!Pd(this.stateSpec.map(e=>e.shape[e.shape.length-1]),o))throw new ek(`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=o.map(e=>new XE({shape:[null,e]}));this.stateful&&this.resetStates()}resetStates(e,t=!1){Bb(()=>{if(!this.stateful)throw new Zv("Cannot call resetStates() on an RNN Layer that is not stateful.");const n=this.inputSpec[0].shape[0];if(null==n)throw new ek("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(null==this.states_)Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map(e=>$_([n,e])):this.states_=[$_([n,this.cell.stateSize])];else if(null==e)Pb(this.states_),null!=this.keptStates&&(Pb(this.keptStates),this.keptStates=[]),Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map(e=>$_([n,e])):this.states_[0]=$_([n,this.cell.stateSize]);else{if(Array.isArray(e)||(e=[e]),e.length!==this.states_.length)throw new ek(`Layer ${this.name} expects ${this.states_.length} state(s), but it received ${e.length} state value(s). Input received: ${e}`);!0===t?this.keptStates.push(this.states_.slice()):Pb(this.states_);for(let t=0;t<this.states_.length;++t){const r=e[t],o=Array.isArray(this.cell.stateSize)?this.cell.stateSize[t]:this.cell.stateSize,i=[n,o];if(!Pd(r.shape,i))throw new ek(`State ${t} is incompatible with layer ${this.name}: expected shape=${i}, received shape=${r.shape}`);this.states_[t]=r}}this.states_=this.states_.map(e=>Lb(e.clone()))})}apply(e,t){let n=null==t?null:t.initialState,r=null==t?null:t.constants;null==t&&(t={});const o=pF(e,n,r,this.numConstants);e=o.inputs,n=o.initialState,r=o.constants;let i=[],a=[];if(null!=n){t.initialState=n,i=i.concat(n),this.stateSpec=[];for(const e of n)this.stateSpec.push(new XE({shape:e.shape}));a=a.concat(this.stateSpec)}if(null!=r&&(t.constants=r,i=i.concat(r),this.numConstants=r.length),i[0]instanceof YE){const n=[e].concat(i),r=this.inputSpec.concat(a),o=this.inputSpec;this.inputSpec=r;const s=super.apply(n,t);return this.inputSpec=o,s}return super.apply(e,t)}call(e,t){return Bb(()=>{const n=null==t?null:t.mask,r=null==t?null:t.training;let o=null==t?null:t.initialState;e=UE(e),null==o&&(o=this.stateful?this.states_:this.getInitialState(e));const i=Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1;if(o.length!==i)throw new ek(`RNN Layer has ${i} state(s) but was passed ${o.length} initial state(s).`);this.unroll&&console.warn("Ignoring unroll = true for RNN layer, due to imperative backend.");const a={training:r},s=cF((e,t)=>{const n=this.cell.call([e].concat(t),a);return[n[0],n.slice(1)]},e,o,this.goBackwards,n,null,this.unroll,this.returnSequences),l=s[0],u=s[1],p=s[2];this.stateful&&this.resetStates(p,r);const c=this.returnSequences?u:l;return this.returnState?[c].concat(p):c})}getInitialState(e){return Bb(()=>{let t=$_(e.shape);return t=Z$(t,[1,2]),t=Qk(t),Array.isArray(this.cell.stateSize)?this.cell.stateSize.map(e=>e>1?iE(t,[1,e]):t):this.cell.stateSize>1?[iE(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),null!=this.cell&&this.cell.setFastWeightInitDuringBuild(e)}getConfig(){const e=super.getConfig(),t={returnSequences:this.returnSequences,returnState:this.returnState,goBackwards:this.goBackwards,stateful:this.stateful,unroll:this.unroll};null!=this.numConstants&&(t.numConstants=this.numConstants);const n=this.cell.getConfig();return this.getClassName()===dF.className&&(t.cell={className:this.cell.getClassName(),config:n}),Object.assign({},n,e,t)}static fromConfig(e,t,n={}){const r=fI(t.cell,n);return new e(Object.assign(t,{cell:r}))}}dF.className="RNN",Db(dF);class hF extends eI{}class fF extends hF{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,$k(this.units,"units"),this.activation=CT(null==e.activation?this.DEFAULT_ACTIVATION:e.activation),this.useBias=null==e.useBias||e.useBias,this.kernelInitializer=DE(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=DE(e.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=DE(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelRegularizer=PT(e.kernelRegularizer),this.recurrentRegularizer=PT(e.recurrentRegularizer),this.biasRegularizer=PT(e.biasRegularizer),this.kernelConstraint=jk(e.kernelConstraint),this.recurrentConstraint=jk(e.recurrentConstraint),this.biasConstraint=jk(e.biasConstraint),this.dropout=Xk([1,Yk([0,null==e.dropout?0:e.dropout])]),this.recurrentDropout=Xk([1,Yk([0,null==e.recurrentDropout?0:e.recurrentDropout])]),this.stateSize=this.units,this.dropoutMask=null,this.recurrentDropoutMask=null}build(e){e=zE(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 Bb(()=>{if(2!==e.length)throw new ek(`SimpleRNNCell expects 2 input Tensors, got ${e.length}.`);let n=e[1];e=e[0];const r=null!=t.training&&t.training;let o;0<this.dropout&&this.dropout<1&&null==this.dropoutMask&&(this.dropoutMask=wF({ones:()=>w_(e),rate:this.dropout,training:r})),0<this.recurrentDropout&&this.recurrentDropout<1&&null==this.recurrentDropoutMask&&(this.recurrentDropoutMask=wF({ones:()=>w_(n),rate:this.recurrentDropout,training:r}));const i=this.dropoutMask,a=this.recurrentDropoutMask;o=sE(null!=i?Y$(e,i):e,this.kernel.read()),null!=this.bias&&(o=cE(o,this.bias.read())),null!=a&&(n=Y$(n,a));let s=Gb(o,sE(n,this.recurrentKernel.read()));return null!=this.activation&&(s=this.activation.apply(s)),[s,s]})}getConfig(){const e=super.getConfig(),t={units:this.units,activation:jT(this.activation),useBias:this.useBias,kernelInitializer:ME(this.kernelInitializer),recurrentInitializer:ME(this.recurrentInitializer),biasInitializer:ME(this.biasInitializer),kernelRegularizer:RT(this.kernelRegularizer),recurrentRegularizer:RT(this.recurrentRegularizer),biasRegularizer:RT(this.biasRegularizer),activityRegularizer:RT(this.activityRegularizer),kernelConstraint:Fk(this.kernelConstraint),recurrentConstraint:Fk(this.recurrentConstraint),biasConstraint:Fk(this.biasConstraint),dropout:this.dropout,recurrentDropout:this.recurrentDropout};return Object.assign({},e,t)}}fF.className="SimpleRNNCell",Db(fF);class gF extends dF{constructor(e){e.cell=new fF(e),super(e)}call(e,t){return Bb(()=>{null!=this.cell.dropoutMask&&(Pb(this.cell.dropoutMask),this.cell.dropoutMask=null),null!=this.cell.recurrentDropoutMask&&(Pb(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null);const n=null==t?null:t.mask,r=null==t?null:t.training,o=null==t?null:t.initialState;return super.call(e,{mask:n,training:r,initialState:o})})}static fromConfig(e,t){return new e(t)}}gF.className="SimpleRNN",Db(gF);class mF extends hF{constructor(e){if(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",e.resetAfter)throw new ek("GRUCell does not support reset_after parameter set to true.");this.units=e.units,$k(this.units,"units"),this.activation=CT(void 0===e.activation?this.DEFAULT_ACTIVATION:e.activation),this.recurrentActivation=CT(void 0===e.recurrentActivation?this.DEFAULT_RECURRENT_ACTIVATION:e.recurrentActivation),this.useBias=null==e.useBias||e.useBias,this.kernelInitializer=DE(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=DE(e.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=DE(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelRegularizer=PT(e.kernelRegularizer),this.recurrentRegularizer=PT(e.recurrentRegularizer),this.biasRegularizer=PT(e.biasRegularizer),this.kernelConstraint=jk(e.kernelConstraint),this.recurrentConstraint=jk(e.recurrentConstraint),this.biasConstraint=jk(e.biasConstraint),this.dropout=Xk([1,Yk([0,null==e.dropout?0:e.dropout])]),this.recurrentDropout=Xk([1,Yk([0,null==e.recurrentDropout?0:e.recurrentDropout])]),this.implementation=e.implementation,this.stateSize=this.units,this.dropoutMask=null,this.recurrentDropoutMask=null}build(e){const t=(e=zE(e))[e.length-1];this.kernel=this.addWeight("kernel",[t,3*this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,3*this.units],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias?this.bias=this.addWeight("bias",[3*this.units],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0}call(e,t){return Bb(()=>{if(2!==e.length)throw new ek(`GRUCell expects 2 input Tensors (inputs, h, c), got ${e.length}.`);const n=null!=t.training&&t.training;let r=e[1];e=e[0],0<this.dropout&&this.dropout<1&&null==this.dropoutMask&&(this.dropoutMask=wF({ones:()=>w_(e),rate:this.dropout,training:n,count:3})),0<this.recurrentDropout&&this.recurrentDropout<1&&null==this.recurrentDropoutMask&&(this.recurrentDropoutMask=wF({ones:()=>w_(r),rate:this.recurrentDropout,training:n,count:3}));const o=this.dropoutMask,i=this.recurrentDropoutMask;let a,s,l;0<this.dropout&&this.dropout<1&&(e=Y$(e,o[0]));let u=sE(e,this.kernel.read());this.useBias&&(u=cE(u,this.bias.read())),0<this.recurrentDropout&&this.recurrentDropout<1&&(r=Y$(r,i[0]));const p=this.recurrentKernel.read(),[c,d]=W_(p,[2*this.units,this.units],p.rank-1),h=sE(r,c),[f,g,m]=W_(u,3,u.rank-1),[y,b]=W_(h,2,h.rank-1);a=this.recurrentActivation.apply(Gb(f,y)),s=this.recurrentActivation.apply(Gb(g,b));const $=sE(Y$(s,r),d);l=this.activation.apply(Gb(m,$));const _=Gb(Y$(a,r),Y$(Gb(1,m_(a)),l));return[_,_]}
vendor: 6,747 bytes, line 2
2)}getConfig(){const e=super.getConfig(),t={units:this.units,activation:jT(this.activation),recurrentActivation:jT(this.recurrentActivation),useBias:this.useBias,kernelInitializer:ME(this.kernelInitializer),recurrentInitializer:ME(this.recurrentInitializer),biasInitializer:ME(this.biasInitializer),kernelRegularizer:RT(this.kernelRegularizer),recurrentRegularizer:RT(this.recurrentRegularizer),biasRegularizer:RT(this.biasRegularizer),activityRegularizer:RT(this.activityRegularizer),kernelConstraint:Fk(this.kernelConstraint),recurrentConstraint:Fk(this.recurrentConstraint),biasConstraint:Fk(this.biasConstraint),dropout:this.dropout,recurrentDropout:this.recurrentDropout,implementation:this.implementation,resetAfter:!1};return Object.assign({},e,t)}}mF.className="GRUCell",Db(mF);class yF extends dF{constructor(e){0===e.implementation&&console.warn("`implementation=0` has been deprecated, and now defaults to `implementation=1`. Please update your layer call."),e.cell=new mF(e),super(e)}call(e,t){return Bb(()=>{null!=this.cell.dropoutMask&&(Pb(this.cell.dropoutMask),this.cell.dropoutMask=null),null!=this.cell.recurrentDropoutMask&&(Pb(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null);const n=null==t?null:t.mask,r=null==t?null:t.training,o=null==t?null:t.initialState;return super.call(e,{mask:n,training:r,initialState:o})})}static fromConfig(e,t){return 0===t.implmentation&&(t.implementation=1),new e(t)}}yF.className="GRU",Db(yF);class bF extends hF{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,$k(this.units,"units"),this.activation=CT(void 0===e.activation?this.DEFAULT_ACTIVATION:e.activation),this.recurrentActivation=CT(void 0===e.recurrentActivation?this.DEFAULT_RECURRENT_ACTIVATION:e.recurrentActivation),this.useBias=null==e.useBias||e.useBias,this.kernelInitializer=DE(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=DE(e.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=DE(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.unitForgetBias=e.unitForgetBias,this.kernelRegularizer=PT(e.kernelRegularizer),this.recurrentRegularizer=PT(e.recurrentRegularizer),this.biasRegularizer=PT(e.biasRegularizer),this.kernelConstraint=jk(e.kernelConstraint),this.recurrentConstraint=jk(e.recurrentConstraint),this.biasConstraint=jk(e.biasConstraint),this.dropout=Xk([1,Yk([0,null==e.dropout?0:e.dropout])]),this.recurrentDropout=Xk([1,Yk([0,null==e.recurrentDropout?0:e.recurrentDropout])]),this.implementation=e.implementation,this.stateSize=[this.units,this.units],this.dropoutMask=null,this.recurrentDropoutMask=null}build(e){var t;const n=(e=zE(e))[e.length-1];let r;if(this.kernel=this.addWeight("kernel",[n,4*this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,4*this.units],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias){if(this.unitForgetBias){const e=this.biasInitializer,n=this.units;r=new((t=class extends mE{apply(t,r){const o=e.apply([n]),i=(new bE).apply([n]),a=e.apply([2*n]);return oE(oE(o,i),a)}}).className="CustomInit",t)}else r=this.biasInitializer;this.bias=this.addWeight("bias",[4*this.units],null,r,this.biasRegularizer,!0,this.biasConstraint)}else this.bias=null;this.built=!0}call(e,t){return Bb(()=>{const n=null!=t.training&&t.training;if(3!==e.length)throw new ek(`LSTMCell expects 3 input Tensors (inputs, h, c), got ${e.length}.`);let r=e[1];const o=e[2];e=e[0],0<this.dropout&&this.dropout<1&&null==this.dropoutMask&&(this.dropoutMask=wF({ones:()=>w_(e),rate:this.dropout,training:n,count:4})),0<this.recurrentDropout&&this.recurrentDropout<1&&null==this.recurrentDropoutMask&&(this.recurrentDropoutMask=wF({ones:()=>w_(r),rate:this.recurrentDropout,training:n,count:4}));const i=this.dropoutMask,a=this.recurrentDropoutMask;let s,l,u,p;0<this.dropout&&this.dropout<1&&(e=Y$(e,i[0]));let c=sE(e,this.kernel.read());0<this.recurrentDropout&&this.recurrentDropout<1&&(r=Y$(r,a[0])),c=Gb(c,sE(r,this.recurrentKernel.read())),this.useBias&&(c=cE(c,this.bias.read()));const[d,h,f,g]=W_(c,4,c.rank-1);s=this.recurrentActivation.apply(d),l=this.recurrentActivation.apply(h),u=Gb(Y$(l,o),Y$(s,this.activation.apply(f))),p=this.recurrentActivation.apply(g);const m=Y$(p,this.activation.apply(u));return[m,m,u]})}getConfig(){const e=super.getConfig(),t={units:this.units,activation:jT(this.activation),recurrentActivation:jT(this.recurrentActivation),useBias:this.useBias,kernelInitializer:ME(this.kernelInitializer),recurrentInitializer:ME(this.recurrentInitializer),biasInitializer:ME(this.biasInitializer),unitForgetBias:this.unitForgetBias,kernelRegularizer:RT(this.kernelRegularizer),recurrentRegularizer:RT(this.recurrentRegularizer),biasRegularizer:RT(this.biasRegularizer),activityRegularizer:RT(this.activityRegularizer),kernelConstraint:Fk(this.kernelConstraint),recurrentConstraint:Fk(this.recurrentConstraint),biasConstraint:Fk(this.biasConstraint),dropout:this.dropout,recurrentDropout:this.recurrentDropout,implementation:this.implementation};return Object.assign({},e,t)}}bF.className="LSTMCell",Db(bF);class $F extends dF{constructor(e){0===e.implementation&&console.warn("`implementation=0` has been deprecated, and now defaults to `implementation=1`. Please update your layer call."),e.cell=new bF(e),super(e)}call(e,t){return Bb(()=>{null!=this.cell.dropoutMask&&(Pb(this.cell.dropoutMask),this.cell.dropoutMask=null),null!=this.cell.recurrentDropoutMask&&(Pb(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null);const n=null==t?null:t.mask,r=null==t?null:t.training,o=null==t?null:t.initialState;return super.call(e,{mask:n,training:r,initialState:o})})}static fromConfig(e,t){return 0===t.implmentation&&(t.implementation=1),new e(t)}}$F.className="LSTM",Db($F);class _F extends hF{constructor(e){super(e),this.cells=e.cells}get stateSize(){const e=[];for(const t of this.cells.slice().reverse())Array.isArray(t.stateSize)?e.push(...t.stateSize):e.push(t.stateSize);return e}call(e,t){return Bb(()=>{let n=e.slice(1);const r=[];for(const e of this.cells.slice().reverse())Array.isArray(e.stateSize)?r.push(n.splice(0,e.stateSize.length)):r.push(n.splice(0,1));r.reverse();const o=[];let i;for(let a=0;a<this.cells.length;++a){const s=this.cells[a];n=r[a],i=0===a?[e[0]].concat(n):[i[0]].concat(n),i=s.call(i,t),o.push(i.slice(1))}n=[];for(const e of o.slice().reverse())n.push(...e);return[i[0]].concat(n)})}build(e){let t;
2LE(e)&&(e=e[0]),this.cells.forEach((n,r)=>{Uk(`RNNCell_${r}`,()=>{n.build(e),t=Array.isArray(n.stateSize)?n.stateSize[0]:n.stateSize,e=[e[0],t]})}),this.built=!0}getConfig(){const e=super.getConfig(),t={cells:this.cells.map(e=>({className:e.getClassName(),config:e.getConfig()}))};return Object.assign({},e,t)}static fromConfig(e,t,n={}){const r=[];for(const e of t.cells)r.push(fI(e,n));return new e({cells:r})}get trainableWeights(){if(!this.trainable)return[];const e=[];for(const t of this.cells)e.push(...t.trainableWeights);return e}get nonTrainableWeights(){const e=[];for(const t of this.cells)e.push(...t.nonTrainableWeights);if(!this.trainable){const t=[];for(const e of this.cells)t.push(...e.trainableWeights);return t.concat(e)}return e}getWeights(){const e=[];for(const t of this.cells)e.push(...t.weights);return qE(e)}setWeights(e){const t=[];for(const n of this.cells){const r=n.weights.length,o=e.splice(r);for(let e=0;e<n.weights.length;++e)t.push([n.weights[e],o[e]])}KE(t)}}function wF(e){const{ones:t,rate:n,training:r=!1,count:o=1}=e,i=()=>dE(t(),n),a=()=>hE(i,t,r);return!o||o<=1?Lb(a().clone()):Array(o).fill(void 0).map(a).map(e=>Lb(e.clone()))}_F.className="StackedRNNCells",Db(_F);var xF,SF;class vF extends dF{constructor(e){if(e.unroll)throw new tk("Unrolling is not possible with convolutional RNNs.");if(Array.isArray(e.cell))throw new tk("It is not possible at the moment to stack convolutional cells.");super(e),this.inputSpec=[new XE({ndim:5})]}call(e,t){return Bb(()=>{if(null!=this.cell.dropoutMask&&(Pb(this.cell.dropoutMask),this.cell.dropoutMask=null),null!=this.cell.recurrentDropoutMask&&(Pb(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null),t&&t.constants)throw new ek("ConvRNN2D cell does not support constants");const n=null==t?null:t.mask,r=null==t?null:t.training,o=null==t?null:t.initialState;return super.call(e,{mask:n,training:r,initialState:o})})}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 Bb(()=>{const{stateSize:t}=this.cell,n=e.shape,r=this.computeSingleOutputShape(n),o=$_([r[0],...r.slice(2)]);return Array.isArray(t)?Array(t.length).fill(o):[o]})}resetStates(e,t=!1){Bb(()=>{if(!this.stateful)throw new Zv("Cannot call resetStates() on an RNN Layer that is not stateful.");const n=this.inputSpec[0].shape,r=this.computeSingleOutputShape(n),o=[r[0],...r.slice(2)];if(null==n[0])throw new ek("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(null==this.getStates())Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map(()=>$_(o)):this.states_=[$_(o)];else if(null==e)Pb(this.states_),null!=this.keptStates&&(Pb(this.keptStates),this.keptStates=[]),Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map(()=>$_(o)):this.states_[0]=$_(o);else{if(Array.isArray(e)||(e=[e]),e.length!==this.states_.length)throw new ek(`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()):Pb(this.states_);for(let t=0;t<this.states_.length;++t){const n=e[t],r=o;if(!Pd(n.shape,r))throw new ek(`State ${t} is incompatible with layer ${this.name}: expected shape=${r}, received shape=${n.shape}`);this.states_[t]=n}}this.states_=this.states_.map(e=>Lb(e.clone()))})}computeSingleOutputShape(e){const{dataFormat:t,filters:n,kernelSize:r,padding:o,strides:i,dilationRate:a}=this.cell,s="channelsFirst"===t,l=e[s?3:2],u=e[s?4:3],p=qT(l,r[0],o,i[0],a[0]),c=qT(u,r[1],o,i[1],a[1]);return[...e.slice(0,2),...s?[n,p,c]:[p,c,n]]}}vF.className="ConvRNN2D";class kF extends bF{constructor(e){const{filters:t,kernelSize:n,strides:r,padding:o,dataFormat:i,dilationRate:a}=e;super(Object.assign({},e,{units:t})),this.filters=t,$k(this.filters,"filters"),this.kernelSize=GT(n,2,"kernelSize"),this.kernelSize.forEach(e
vendor: 35,283 bytes, line 2
2=>$k(e,"kernelSize")),this.strides=GT(r||1,2,"strides"),this.strides.forEach(e=>$k(e,"strides")),this.padding=o||"valid",Pk(this.padding),this.dataFormat=i||"channelsLast",Bk(this.dataFormat),this.dilationRate=GT(a||1,2,"dilationRate"),this.dilationRate.forEach(e=>$k(e,"dilationRate"))}build(e){var t;e=zE(e);const n="channelsFirst"===this.dataFormat?1:e.length-1;if(null==e[n])throw new ek(`The channel dimension of the input should be defined. Found ${e[n]}`);const r=e[n],o=this.kernelSize.concat([r,4*this.filters]);this.kernel=this.addWeight("kernel",o,null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint);const i=this.kernelSize.concat([this.filters,4*this.filters]);if(this.recurrentKernel=this.addWeight("recurrent_kernel",i,null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias){let e;if(this.unitForgetBias){const n=this.biasInitializer,r=this.filters;e=new((t=class extends mE{apply(e,t){return rE([n.apply([r]),__([r]),n.apply([2*r])])}}).className="CustomInit",t)}else e=this.biasInitializer;this.bias=this.addWeight("bias",[4*this.filters],null,e,this.biasRegularizer,!0,this.biasConstraint)}this.built=!0}call(e,t){return Bb(()=>{if(3!==e.length)throw new ek(`ConvLSTM2DCell expects 3 input Tensors (inputs, h, c), got ${e.length}.`);const n=t.training||!1,r=e[0],o=e[1],i=e[2];0<this.dropout&&this.dropout<1&&null==this.dropoutMask&&(this.dropoutMask=wF({ones:()=>w_(r),rate:this.dropout,training:n,count:4}));const a=this.dropoutMask,s=(e,t,n)=>t&&t[n]?Y$(t[n],e):e;let l=s(r,a,0),u=s(r,a,1),p=s(r,a,2),c=s(r,a,3);0<this.recurrentDropout&&this.recurrentDropout<1&&null==this.recurrentDropoutMask&&(this.recurrentDropoutMask=wF({ones:()=>w_(o),rate:this.recurrentDropout,training:n,count:4}));const d=this.recurrentDropoutMask;let h=s(o,d,0),f=s(o,d,1),g=s(o,d,2),m=s(o,d,3);const[y,b,$,_]=W_(this.kernel.read(),4,3),[w,x,S,v]=this.useBias?W_(this.bias.read(),4):[null,null,null,null];l=this.inputConv(l,y,w,this.padding),u=this.inputConv(u,b,x,this.padding),p=this.inputConv(p,$,S,this.padding),c=this.inputConv(c,_,v,this.padding);const[k,E,I,T]=W_(this.recurrentKernel.read(),4,3);h=this.recurrentConv(h,k),f=this.recurrentConv(f,E),g=this.recurrentConv(g,I),m=this.recurrentConv(m,T);const F=this.recurrentActivation.apply(Gb(l,h)),N=this.recurrentActivation.apply(Gb(u,f)),j=Gb(Y$(N,i),Y$(F,this.activation.apply(Gb(p,g)))),A=Y$(this.recurrentActivation.apply(Gb(c,m)),this.activation.apply(j));return[A,A,j]})}getConfig(){const e=super.getConfig(),{units:t}=e,n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(e,["units"]),r={filters:this.filters,kernelSize:this.kernelSize,padding:this.padding,dataFormat:this.dataFormat,dilationRate:this.dilationRate,strides:this.strides};return Object.assign({},n,r)}inputConv(e,t,n,r){const o=x$(e,t,this.strides,r||"valid","channelsFirst"===this.dataFormat?"NCHW":"NHWC",this.dilationRate);return n?cE(o,n,this.dataFormat):o}recurrentConv(e,t){return x$(e,t,1,"same","channelsFirst"===this.dataFormat?"NCHW":"NHWC")}}kF.className="ConvLSTM2DCell",Db(kF);class EF extends vF{constructor(e){const t=new kF(e);super(Object.assign({},e,{cell:t}))}static fromConfig(e,t){return new e(t)}}EF.className="ConvLSTM2D",Db(EF);class IF extends eI{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(null==this.noiseShape)return this.noiseShape;const t=e.shape,n=[];for(let e=0;e<this.noiseShape.length;++e)n.push(null==this.noiseShape[e]?t[e]:this.noiseShape[e]);return n}call(e,t){return Bb(()=>{this.invokeCallHook(e,t);const n=UE(e);if(0<this.rate&&this.rate<1){const e=null!=t.training&&t.training,r=this.getNoiseShape(n);return hE(()=>dE(n,this.rate,r,this.seed),()=>n,e)}return e})}getConfig(){const e={rate:this.rate,noiseShape:this.noiseShape,seed:this.seed},t=super.getConfig();return Object.assign(e,t),e}dispose(){return super.dispose()}}IF.className="Dropout",Db(IF);class TF extends IF{constructor(e){super(e),this.inputSpec=[{ndim:3}]}getNoiseShape(e){const t=e.shape;return[t[0],1,t[2]]}}TF.className="SpatialDropout1D",Db(TF);class FF extends eI{constructor(e){if(super(e),this.activation=null,this.useBias=!0,this.kernel=null,this.bias=null,this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_BIAS_INITIALIZER="zeros",null==e.batchInputShape&&null==e.inputShape&&null!=e.inputDim){let t=null;null!=e.batchSize&&(t=e.batchSize),this.batchInputShape=[t,e.inputDim]}this.units=e.units,$k(this.units,"units"),this.activation=CT(e.activation),null!=e.useBias&&(this.useBias=e.useBias),this.kernelInitializer=DE(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.biasInitializer=DE(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelConstraint=jk(e.kernelConstraint),this.biasConstraint=jk(e.biasConstraint),this.kernelRegularizer=PT(e.kernelRegularizer),this.biasRegularizer=PT(e.biasRegularizer),this.activityRegularizer=PT(e.activityRegularizer),this.supportsMasking=!0,this.inputSpec=[{minNDim:2}]}build(e){const t=(e=zE(e))[e.length-1];null==this.kernel&&(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){const t=(e=zE(e)).slice();return t[t.length-1]=this.units,t}call(e,t){return Bb(()=>{this.invokeCallHook(e,t);const n=UE(e),r=wk(this.activation.getClassName());let o;return null!=r?o=sE(n,this.kernel.read(),r,this.bias?this.bias.read():null):(o=sE(n,this.kernel.read()),null!=this.bias&&(o=cE(o,this.bias.read())),null!=this.activation&&(o=this.activation.apply(o))),o})}getConfig(){const e={units:this.units,activation:jT(this.activation),useBias:this.useBias,kernelInitializer:ME(this.kernelInitializer),biasInitializer:ME(this.biasInitializer),kernelRegularizer:RT(this.kernelRegularizer),biasRegularizer:RT(this.biasRegularizer),activityRegularizer:RT(this.activityRegularizer),kernelConstraint:Fk(this.kernelConstraint),biasConstraint:Fk(this.biasConstraint)},t=super.getConfig();return Object.assign(e,t),e}}FF.className="Dense",Db(FF);class NF extends eI{constructor(e){super(e=e||{}),this.inputSpec=[{minNDim:3}],this.dataFormat=e.dataFormat}computeOutputShape(e){e=zE(e);for(const t of e.slice(1))if(null==t)throw new ek(`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],Kk(e,1)]}call(e,t){return Bb(()=>{this.invokeCallHook(e,t);let n=UE(e);if("channelsFirst"===this.dataFormat&&n.rank>1){const e=[0];for(let t=2;t<n.rank;++t)e.push(t);e.push(1),n=Q_(n,e)}return function(e){if(e.rank<=1)throw new ek(`batchFlatten requires a minimum rank of 2. Got rank: ${e.rank}.`);const t=[e.shape[0],Kk(e.shape,1)];return u$(e,t)}(n)})}getConfig(){const e={};null!=this.dataFormat&&(e.dataFormat=this.dataFormat);const t=super.getConfig();return Object.assign(e,t),e}}NF.className="Flatten",Db(NF);class jF extends eI{constructor(e){super(e),this.supportsMasking=!0,this.activation=CT(e.activation)}call(e,t){return Bb(()=>{this.invokeCallHook(e,t);const n=UE(e);return this.activation.apply(n)})}getConfig(){const e={activation:jT(this.activation)},t=super.getConfig();return Object.assign(e,t),e}}jF.className="Activation",Db(jF);class AF extends eI{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 Bb(()=>{return e=UE(e),t=e,n=this.n,Bb(()=>{if(2!==t.shape.length)throw new ek(`repeat() expects a rank-2 tensor, but received a rank-${t.shape.length} tensor.`);return iE(Qk(t,1),[1,n,1])});var t,n})}getConfig(){const e={n:this.n},t=super.getConfig();return Object.assign(e,t),e}}AF.className="RepeatVector",Db(AF);class CF extends eI{constructor(e){super(e),this.targetShape=e.targetShape;for(let e=0;e<this.targetShape.length;++e)this.isUnknown(this.targetShape[e])&&(this.targetShape[e]=null)}isUnknown(e){return e<0||null==e}fixUnknownDimension(e,t){const n="Total size of new array must be unchanged.",r=t.slice();let o=1,i=null;for(let e=0;e<r.length;++e){const t=r[e];if(this.isUnknown(t)){if(null!==i)throw new ek("Can only specifiy one unknown dimension.");i=e}else o*=t}const a=Kk(e);if(null!==i){if(0===o||a%o!==0)throw new ek(n);r[i]=a/o}else if(a!==o)throw new ek(n);return r}computeOutputShape(e){let t=!1;for(let n=0;n<e.length;++n)if(this.isUnknown(e[n])){t=!0;break}return t?e.slice(0,1).concat(this.targetShape):e.slice(0,1).concat(this.fixUnknownDimension(e.slice(1),this.targetShape))}call(e,t){return Bb(()=>{this.invokeCallHook(e,t);const n=UE(e),r=n.shape,o=r.slice(0,1).concat(this.fixUnknownDimension(r.slice(1),this.targetShape));return u$(n,o)})}getConfig(){const e={targetShape:this.targetShape},t=super.getConfig();return Object.assign(e,t),e}}CF.className="Reshape",Db(CF);class MF extends eI{constructor(e){if(super(e),null==e.dims)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.`);const t=Jk(1,e.dims.length+1);if(!Pd(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 XE({ndim:this.dims.length+1})]}computeOutputShape(e){const t=(e=zE(e)).slice();return this.dims.forEach((n,r)=>{t[r+1]=e[n]}),t}call(e,t){return Q_(UE(e),this.dimsIncludingBatch)}getConfig(){const e={dims:this.dims},t=super.getConfig();return Object.assign(e,t),e}}MF.className="Permute",Db(MF);class DF extends eI{constructor(e){super(null==e?{}:e),this.supportsMasking=!0,this.maskValue=null!=e?null==e.maskValue?0:e.maskValue:0}computeOutputShape(e){return e}getConfig(){const e=super.getConfig(),t={maskValue:this.maskValue};return Object.assign(t,e),t}computeMask(e,t){const n=UE(e);return Kb(y_(n,this.maskValue),-1)}call(e,t){return Bb(()=>{this.invokeCallHook(e,t);const n=UE(e),r=Kb(y_(n,this.maskValue),-1,!0);return Y$(n,hb(r,n.dtype))})}}DF.className="Masking",Db(DF);class OF extends eI{constructor(e){if(super(e),this.embeddings=null,this.DEFAULT_EMBEDDINGS_INITIALIZER="randomUniform",null==e.batchInputShape&&null==e.inputShape){let t=null;null!=e.batchSize&&(t=e.batchSize),null==e.inputLength?this.batchInputShape=[t,null]:this.batchInputShape=[t].concat(sk(e.inputLength))}this.inputDim=e.inputDim,$k(this.inputDim,"inputDim"),this.outputDim=e.outputDim,$k(this.outputDim,"outputDim"),this.embeddingsInitializer=DE(e.embeddingsInitializer||this.DEFAULT_EMBEDDINGS_INITIALIZER),this.embeddingsRegularizer=PT(e.embeddingsRegularizer),this.activityRegularizer=PT(e.activityRegularizer),this.embeddingsConstraint=jk(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 Bb(()=>this.maskZero?(e=UE(e),y_(e,Z_(e))):null)}computeOutputShape(e){if(e=zE(e),null==this.inputLength)return[...e,this.outputDim];const t=sk(this.inputLength);if(t.length!==e.length-1)throw new ek(`"inputLength" is ${this.inputLength}, but received input shape has shape ${e}`);{let n=0;for(let r=0;r<t.length;++r){const o=t[r],i=e[r+1];if(null!=o&&null!=i&&o!==i)throw new ek(`"inputLength" is ${this.inputLength}, but received input shape has shape ${e}`);null==o&&(t[n]=i),n++}}return[e[0],...t,this.outputDim]}call(e,t){return Bb(()=>{this.invokeCallHook(e,t);let n=UE(e);"int32"!==n.dtype&&(n=Zk(n,"int32"));const r=lE(this.embeddings.read(),u$(n,[n.size]));return u$(r,zE(this.computeOutputShape(n.shape)))})}getConfig(){const e={inputDim:this.inputDim,outputDim:this.outputDim,embeddingsInitializer:ME(this.embeddingsInitializer),embeddingsRegularizer:RT(this.embeddingsRegularizer),activityRegularizer:RT(this.activityRegularizer),embeddingsConstraint:Fk(this.embeddingsConstraint),maskZero:this.maskZero,inputLength:this.inputLength},t=super.getConfig();return Object.assign(e,t),e}}OF.className="Embedding",Db(OF);class RF extends eI{constructor(e){super(e||{}),this.supportsMasking=!0}mergeFunction(e){throw new tk}computeElementwiseOpOutputShape(e,t){if(null==e||null==t)return null;if(e.length<t.length)return this.computeElementwiseOpOutputShape(t,e);if(0===t.length)return e;const n=e.slice(0,e.length-t.length);for(let r=0;r<t.length;++r){const o=e[e.length-t.length+r],i=t[r];if(null==o||null==i||o<0||i<0)n.push(null);else if(1===o)n.push(i);else if(1===i)n.push(o);else{if(o!==i)throw new ek("Operands could not be broadcast together with shapes "+JSON.stringify(e)+" "+JSON.stringify(t));n.push(o)}}return n}build(e){if(Array.isArray(e)&&!Array.isArray(e[0])&&(e=[zE(e)]),e.length<2)throw new ek(`A merge layer should be called on an Array of at least 2 inputs. Got ${e.length} input(s).`);let t=[];for(const n of e)null!=n&&null!==n[0]&&t.push(n[0]);if(t=gk(t),t.length>1)throw new ek(`Can not merge tensors with different batch sizes. Got tensors with shapes: ${JSON.stringify(e)}.`);let n=null==e[0]?null:e[0].slice(1);for(let t=1;t<e.length;++t){const r=null==e[t]?null:e[t].slice(1);n=this.computeElementwiseOpOutputShape(n,r)}const r=e.map(e=>e.length);-1===e.indexOf(null)&&1===gk(r).length?this.reshapeRequired=!1:this.reshapeRequired=!0}call(e,t){return Bb(()=>{if(this.reshapeRequired){const t=[],n=e.map(e=>e.rank);if(-1===n.indexOf(null)){const r=Yk(n);for(let n of e){const e=n.rank;for(let t=0;t<r-e;++t)n=Qk(n,1);t.push(n)}return this.mergeFunction(t)}{let n=!1;for(const r of e){const e=r.rank;if(null==e){const e=r.shape,o=e[0],i=e.slice(1).concat([o]);let a=u$(r,[o].concat(Kk(e.slice(1))));a=Q_(a,[1,0]),a=u$(a,i),t.push(a),n=!0}else if(e>1){const o=Jk(1,e).concat([0]);t.push(Q_(r,o)),n=!0}else t.push(r)}let r=this.mergeFunction(t);const o=r.rank;if(n)if(null==o){const e=r.shape,t=e[e.length-1],n=[t].concat(e.slice(0,e.length-1));r=u$(Q_(u$(r,[-1,t]),[1,0]),n)}else if(o>1){const e=[o-1].concat(Jk(0,o-1));r=Q_(r,e)}return r}}return this.mergeFunction(e)})}computeOutputShape(e){let t;t=null==e[0]?null:e[0].slice(1);for(let n=1;n<e.length;++n){const r=null==e[n]?null:e[n].slice(1);t=this.computeElementwiseOpOutputShape(t,r)}let n=[];for(const t of e)null!=t&&null!==t[0]&&n.push(t[0]);return n=gk(n),t=1===n.length?n.concat(t):[null].concat(t),t}computeMask(e,t){return Bb(()=>{if(null==t)return null;if(!Array.isArray(t))throw new ek("`mask` should be an Array");if(!Array.isArray(e))throw new ek("`inputs` should be an Array");if(t.length!==e.length)throw new ek(`The Array 'inputs' and 'mask' are expected to have the same length, but have different lengths (${e.length} vs ${t.length})`);if(t.every(e=>null==e))return null;let n=(t=t.map(e=>null==e?e:B$(e,0)))[0];for(let e=1;e<t.length-1;++e)n=e_(n,t[e]);return n})}}class BF extends RF{constructor(e){super(e)}mergeFunction(e){return Bb(()=>{let t=e[0].clone();for(let n=1;n<e.length;++n)t=Gb(t,e[n]);return t})}}BF.className="Add",Db(BF);class PF extends RF{constructor(e){super(e)}mergeFunction(e){return Bb(()=>{let t=e[0].clone();for(let n=1;n<e.length;++n)t=Y$(t,e[n]);return t})}}PF.className="Multiply",Db(PF);class LF extends RF{constructor(e){super(e)}mergeFunction(e){return Bb(()=>{let t=e[0].clone();for(let n=1;n<e.length;++n)t=Gb(t,e[n]);return Y$(1/e.length,t)})}}LF.className="Average",Db(LF);class WF extends RF{constructor(e){super(e)}mergeFunction(e){return Bb(()=>{let t=e[0];for(let n=1;n<e.length;++n)t=o_(t,e[n]);return t})}}WF.className="Maximum",Db(WF);class UF extends RF{constructor(e){super(e)}mergeFunction(e){return Bb(()=>{let t=e[0];for(let n=1;n<e.length;++n)t=a_(t,e[n]);return t})}}UF.className="Minimum",Db(UF);class zF extends RF{constructor(e){super(e),this.DEFAULT_AXIS=-1,null==e&&(e={}),this.axis=null==e.axis?this.DEFAULT_AXIS:e.axis,this.supportsMasking=!0,this.reshapeRequired=!1}build(e){if(!Array.isArray(e)||!Array.isArray(e[0])||1===e.length)throw new ek("A `Concatenate` layer should be called on a list of at least 2 inputs");let t=!0;for(const n of e)if(null!=n){t=!1;break}if(t)return;const n=[];for(let t=0;t<e.length;++t){const r=e[t].slice();r.splice(this.axis,1);let o=!1;for(const e of n)if(Pd(e,r)){o=!0;break}o||n.push(r)}if(n.length>1)throw new ek("A `Concatenate` layer requires inputs with matching shapes except for the concat axis. Got input shapes: "+JSON.stringify(e))}mergeFunction(e){return Bb(()=>rE(e,this.axis))}computeOutputShape(e){if(!Array.isArray(e)||!Array.isArray(e[0]))throw new ek("A `Concatenate` layer should be called on a list of inputs.");const t=e,n=t[0].slice(),r=this.axis<0?n.length+this.axis:this.axis;for(const e of t.slice(1)){if(null==n[r]||null==e[r]){n[r]=null;break}n[r]+=e[r]}return n}computeMask(e,t){if(null==t)return null;if(!Array.isArray(t))throw new ek("`mask` should be an array for Concatenate");if(!Array.isArray(e))throw new ek("`inputs` should be an array for Concatenate");if(t.length!==e.length)throw new ek(`Mismatch in the length of mask (${t.length}) and the legnth of inputs (${e.length})`);return Bb(()=>{let n=!0;if(t.forEach(e=>{null==e||(n=!1)}),n)return null;const r=[];for(let n=0;n<e.length;++n)null==t[n]?r.push(hb(w_(e[n]),"bool")):t[n].rank<e[n].rank?r.push(B$(t[n],-1)):r.push(t[n]);const o=y$(r,this.axis);return qb(o,-1,!1)})}getConfig(){const e={axis:this.axis},t=super.getConfig();return Object.assign(e,t),e}}function VF(e,t){for(;e<0;)e+=t;return e}zF.className="Concatenate",Db(zF);class HF extends RF{constructor(e){super(e),this.axes=e.axes,this.normalize=null!=e.normalize&&e.normalize,this.supportsMasking=!0,this.reshapeRequired=!1}build(e){Md(Array.isArray(e)&&2===e.length&&Array.isArray(e[0])&&Array.isArray(e[1]),()=>"A `Dot` layer should be called on a list of exactly 2 inputs.");const t=e[0],n=e[1];if(t.length>3||n.length>3)throw new tk("Dot layer does not support tensors of 4D or higher rank yet.");const r=this.interpretAxes(t,n);if(t[r[0]]!==n[r[1]])throw new ek(`Dimension incompatibility: ${t[r[0]]} !== ${n[r[1]]}`)}mergeFunction(e){if(2!==e.length)throw new ek(`A \`Dot\` layer must be called on exactly 2 inputs, but received ${e.length} input(s).`);let t,n=e[0],r=e[1];return t=Array.isArray(this.axes)?this.axes.map((t,n)=>VF(t,e[n].shape.length)):[VF(this.axes,n.shape.length),VF(this.axes,r.shape.length)],this.normalize&&(n=gI(n,t[0]),r=gI(r,t[1])),function(e,t,n){if(e.shape.length>3||t.shape.length>3)throw new tk("batchDot is not implemented for tensors of 4D or higher rank yet");if(Md(e.shape.length>=2,()=>`batchDot requires the rank of x to be >= 2, but got ${e.shape.length}`),Md(e.shape.length>=2,()=>`batchDot requires the rank of y to be >= 2, but got ${t.shape.length}`),"number"==typeof n&&(n=[n,n]),"complex64"===e.dtype||"complex64"===t.dtype)throw new tk("batchDot is not implemented for complex64-type Tensors yet.");const r=e.shape.length,o=t.shape.length;null==n&&(n=[r-1,o-2]);const i=n;return Bb(()=>{let n,a;if(r>o){n=r-o;const e=[];for(let t=0;t<n;++t)e.push(1);t=u$(t,t.shape.concat(e))}else if(o>r){n=o-r;const t=[];for(let e=0;e<n;++e)t.push(1);e=u$(e,e.shape.concat(t))}else n=0;if(2===e.shape.length&&2===t.shape.length)a=i[0]===i[1]?Z$(Y$(e,t),i[0]):Z$(Y$(Q_(e,[1,0]),t),i[1]);else{const n=i[0]!==e.shape.length-1,r=i[1]===t.shape.length-1;a=t_(e,t,n,r)}if(n>0){let e;e=r>o?r+o-3:r-1;const t=[];for(let r=e;r<e+n;++r)t.push(r);a=z_(a,t)}return 1===a.shape.length&&(a=B$(a,1)),a})}(n,r,t)}interpretAxes(e,t){let n;return n=Array.isArray(this.axes)?this.axes:[VF(this.axes,e.length),VF(this.axes,t.length)],n}computeOutputShape(e){Md(Array.isArray(e)&&2===e.length&&Array.isArray(e[0])&&Array.isArray(e[1]),()=>"A `Dot` layer should be called on a list of exactly 2 inputs.");const t=e[0].slice(),n=e[1].slice();if(t.length>3||n.length>3)throw new tk("Dot layer does not support tensors of 4D or higher rank yet.");const r=this.interpretAxes(t,n);t.splice(r[0],1),n.splice(r[1],1),n.splice(0,1);const o=t.concat(n);return 1===o.length&&o.push(1),o}computeMask(e,t){return null}getConfig(){const e={axes:this.axes,normalize:this.normalize},t=super.getConfig();return Object.assign(e,t),e}}HF.className="Dot",Db(HF);class GF extends eI{constructor(e){super(e),this.supportsMasking=!0,this.stddev=e.stddev}computeOutputShape(e){return e}getConfig(){const e=super.getConfig(),t={stddev:this.stddev};return Object.assign(t,e),t}call(e,t){return Bb(()=>{this.invokeCallHook(e,t);const n=UE(e);return hE(()=>Gb(aE(n.shape,0,this.stddev),n),()=>n,t.training||!1)})}}GF.className="GaussianNoise",Db(GF);class qF extends eI{constructor(e){super(e),this.supportsMasking=!0,this.rate=e.rate}computeOutputShape(e){return e}getConfig(){const e=super.getConfig(),t={rate:this.rate};return Object.assign(t,e),t}call(e,t){return Bb(()=>{this.invokeCallHook(e,t);const n=UE(e);return this.rate>0&&this.rate<1?hE(()=>{const e=Math.sqrt(this.rate/(1-this.rate));return Y$(n,aE(n.shape,1,e))},()=>n,t.training||!1):n})}}qF.className="GaussianDropout",Db(qF);class KF extends eI{constructor(e){super(e),this.supportsMasking=!0,this.rate=e.rate,this.noiseShape=e.noiseShape}_getNoiseShape(e){return this.noiseShape||UE(e).shape}computeOutputShape(e){return e}getConfig(){const e=super.getConfig(),t={rate:this.rate};return Object.assign(t,e),t}call(e,t){return Bb(()=>{if(this.rate<1&&this.rate>0){const n=this._getNoiseShape(e);return hE(()=>{const t=UE(e),r=-1.7580993408473766;let o=H$(T_(n),this.rate);o=Zk(o,"float32");const i=((1-this.rate)*(1+this.rate*r**2))**-.5,a=-i*r*this.rate,s=Gb(Y$(t,o),Y$(Gb(o,-1),r));return Gb(Y$(s,i),a)},()=>UE(e),t.training||!1)}return e})}}function XF(e,t,n,r,o,i=.001){let a;if(2===e.rank)a=h$(e,t,n,r,o,i);else if(3===e.rank)a=f$(e,t,n,r,o,i);else{if(4!==e.rank)throw new tk(`batchNormalization is not implemented for array of rank ${e.rank} yet`);a=g$(e,t,n,r,o,i)}return a}KF.className="AlphaDropout",Db(KF);class YF extends eI{constructor(e){null==e&&(e={}),super(e),this.supportsMasking=!0,this.axis=null==e.axis?-1:e.axis,this.momentum=null==e.momentum?.99:e.momentum,this.epsilon=null==e.epsilon?.001:e.epsilon,this.center=null==e.center||e.center,this.scale=null==e.scale||e.scale,this.betaInitializer=DE(e.betaInitializer||"zeros"),this.gammaInitializer=DE(e.gammaInitializer||"ones"),this.movingMeanInitializer=DE(e.movingMeanInitializer||"zeros"),this.movingVarianceInitializer=DE(e.movingVarianceInitializer||"ones"),this.betaConstraint=jk(e.betaConstraint),this.gammaConstraint=jk(e.gammaConstraint),this.betaRegularizer=PT(e.betaRegularizer),this.gammaRegularizer=PT(e.gammaRegularizer)}build(e){e=zE(e);const t=this.axis>=0?this.axis:this.axis+e.length,n=e[t];if(null==n)throw new ek(`Axis ${t} of input tensor should have a defined dimension but the layer received an input with shape ${JSON.stringify(e)}.`);this.inputSpec=[new XE({ndim:e.length,axes:{[t]:n}})];const r=[n];this.scale&&(this.gamma=this.addWeight("gamma",r,null,this.gammaInitializer,this.gammaRegularizer,!0,this.gammaConstraint)),this.center&&(this.beta=this.addWeight("beta",r,null,this.betaInitializer,this.betaRegularizer,!0,this.betaConstraint)),this.movingMean=this.addWeight("moving_mean",r,null,this.movingMeanInitializer,null,!1),this.movingVariance=this.addWeight("moving_variance",r,null,this.movingVarianceInitializer,null,!1),this.built=!0}call(e,t){return Bb(()=>{const n=null!=t.training&&t.training,r=UE(e),o=r.shape,i=o.length,a=Jk(0,i),s=this.axis>=0?this.axis:this.axis+i;a.splice(s,1);const l=rk(1,i);l[s]=o[s];const u=a.slice();u.sort();const p=!Pd(u,Jk(0,i).slice(0,i-1));if(!n)return(()=>{if(p){const e=u$(this.movingMean.read(),l),t=u$(this.movingVariance.read(),l),n=this.center?u$(this.beta.read(),l):null,o=this.scale?u$(this.gamma.read(),l):null;return XF(r,e,t,n,o,this.epsilon)}return XF(r,this.movingMean.read(),this.movingVariance.read(),null==this.beta?null:this.beta.read(),null==this.gamma?null:this.gamma.read(),this.epsilon)})();const[c,d,h]=function(e,t,n,r,o=.001){return Pd(r.slice().sort(),Jk(0,e.rank-1))?function(e,t,n,r,o=.001){return Bb(()=>{const i=g_(e,r),a=i.mean,s=i.variance;return[XF(e,a,s,n,t,o),a,s]})}(e,t,n,r,o):function(e,t,n,r,o=.001){return Bb(()=>{const i=g_(e,r),a=i.mean,s=i.variance,l=[];for(const t of Jk(0,e.rank))-1!==r.indexOf(t)?l.push(1):l.push(e.shape[t]);const u=u$(a,l),p=u$(s,l),c=null==t?null:u$(t,l),d=null==n?null:u$(n,l);return[XF(e,u,p,d,c,o),a,s]})}(e,t,n,r,o)}(r,this.gamma.read(),this.beta.read(),a,this.epsilon),f=(e,t,n)=>{Bb(()=>{const r=1-n,o=e.read(),i=Y$(J$(o,t),r);e.write(J$(o,i))})};return(()=>{f(this.movingMean,d,this.momentum),f(this.movingVariance,h,this.momentum)})(),c})}getConfig(){const e={axis:this.axis,momentum:this.momentum,epsilon:this.epsilon,center:this.center,scale:this.scale,betaInitializer:ME(this.betaInitializer),gammaInitializer:ME(this.gammaInitializer),movingMeanInitializer:ME(this.movingMeanInitializer),movingVarianceInitializer:ME(this.movingVarianceInitializer),betaRegularizer:RT(this.betaRegularizer),gammaRegularizer:RT(this.gammaRegularizer),betaConstraint:Fk(this.betaConstraint),gammaConstraint:Fk(this.gammaConstraint)},t=super.getConfig();return Object.assign(e,t),e}}YF.className="BatchNormalization",Db(YF);class JF extends eI{constructor(e){if(null==e&&(e={}),super(e),this.axis=null==e.axis?-1:e.axis,"number"==typeof this.axis){if(!Number.isInteger(this.axis))throw new Error(`Expected axis to be an integer, but received ${this.axis}`)}else{if(!Array.isArray(this.axis))throw new Error(`Expected axis to be an integer or an array of integers, but received ${JSON.stringify(this.axis)}`);for(const e of this.axis)if(!Number.isInteger(e))throw new Error(`Expected axis to be an array of integers, but received ${JSON.stringify(this.axis)}`)}this.epsilon=null==e.epsilon?.001:e.epsilon,this.center=null==e.center||e.center,this.scale=null==e.scale||e.scale,this.betaInitializer=DE(e.betaInitializer||"zeros"),this.gammaInitializer=DE(e.gammaInitializer||"ones"),this.betaRegularizer=PT(e.betaRegularizer),this.gammaRegularizer=PT(e.gammaRegularizer),this.supportsMasking=!0}build(e){const t=(e=zE(e)).length;"number"==typeof this.axis&&(this.axis=[this.axis]);for(let e=0;e<this.axis.length;++e)this.axis[e]<0&&(this.axis[e]+=t);for(const e of this.axis)if(e<0||e>=t)throw new Error(`Invalid axis: ${e}`);if(this.axis.length!==gk(this.axis).length)throw new Error(`Found duplicate axes in: ${this.axis}`);const n=this.axis.map(t=>e[t]),r=!0;this.scale?this.gamma=this.addWeight("gamma",n,"float32",this.gammaInitializer,this.gammaRegularizer,r):this.gamma=null,this.center?this.beta=this.addWeight("beta",n,"float32",this.betaInitializer,this.betaRegularizer,r):this.beta=null,this.built=!0}call(e,t){const n=UE(e),r=n.shape,o=r.length;return Bb(()=>{let{mean:e,variance:t}=g_(n,this.axis,!0);const i=rk(1,o);for(const e of this.axis)i[e]=r[e];const a=e=>null!=e&&e.shape.length!==o&&this.axis!==[o-1]?u$(e,i):e;let s=a(this.gamma.read()),l=a(this.beta.read());const u=[],p=[];for(let e=0;e<o;++e)-1!==this.axis.indexOf(e)?(u.push(r[e]),p.push(1)):(u.push(1),p.push(r[e]));return e=P$(e,u),t=P$(t,u),s=P$(s,p),l=P$(l,p),XF(n,e,t,l,s,this.epsilon)})}getConfig(){const e={axis:this.axis,epsilon:this.epsilon,center:this.center,scale:this.scale,betaInitializer:ME(this.betaInitializer),gammaInitializer:ME(this.gammaInitializer),betaRegularizer:RT(this.betaRegularizer),gammaRegularizer:RT(this.gammaRegularizer)},t=super.getConfig();return Object.assign(e,t),e}}JF.className="LayerNormalization",Db(JF);class ZF extends eI{constructor(e){if(null==e&&(e={}),super(e),this.dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,null==e.padding)this.padding=[[1,1],[1,1]];else if("number"==typeof e.padding)this.padding=[[e.padding,e.padding],[e.padding,e.padding]];else{if(e.padding=e.padding,2!==e.padding.length)throw new ek(`ZeroPadding2D expects padding to be a length-2 array, but received a length-${e.padding.length} array.`);let t,n;if("number"==typeof e.padding[0])t=[e.padding[0],e.padding[0]],n=[e.padding[1],e.padding[1]];else{if(e.padding=e.padding,2!==e.padding[0].length)throw new ek(`ZeroPadding2D expects height padding to be a length-2 array, but received a length-${e.padding[0].length} array.`);if(t=e.padding[0],2!==e.padding[1].length)throw new ek(`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 XE({ndim:4})]}computeOutputShape(e){let t,n;return e=zE(e),"channelsFirst"===this.dataFormat?(t=null!=e[2]&&e[2]>=0?e[2]+this.padding[0][0]+this.padding[0][1]:null,n=null!=e[3]&&e[3]>=0?e[3]+this.padding[1][0]+this.padding[1][1]:null,[e[0],e[1],t,n]):(t=null!=e[1]&&e[1]>=0?e[1]+this.padding[0][0]+this.padding[0][1]:null,n=null!=e[2]&&e[2]>=0?e[2]+this.padding[1][0]+this.padding[1][1]:null,[e[0],t,n,e[3]])}call(e,t){return Bb(()=>{return t=UE(e),n=this.padding,r=this.dataFormat,Bb(()=>{if(4!==t.rank)throw new ek(`temporalPadding expects input tensor to be 4-D, but received a ${t.rank}-D tensor.`);if(null==n&&(n=[[1,1],[1,1]]),2!==n.length||2!==n[0].length||2!==n[1].length)throw new ek("spatial2dPadding expects `padding` to be an Array of two Arrays, each of which is an Array of two integers.");if(null==r&&(r="channelsLast"),"channelsLast"!==r&&"channelsFirst"!==r)throw new ek(`Unknown data format: ${r}. Supported data formats are 'channelsLast' and 'channelsFirst.`);let e;return e="channelsFirst"===r?[[0,0],[0,0],n[0],n[1]]:[[0,0],n[0],n[1],[0,0]],x_(t,e)});var t,n,r})}getConfig(){const e={padding:this.padding,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}}function QF(e,t,n,r,o,i){return Bb(()=>{let a;Bk(o),Lk(i),Pk(r),null==n&&(n=[1,1]),null==r&&(r="valid"),null==o&&(o="channelsLast"),null==i&&(i="max"),e=XT(e,o);const s="same"===r?"same":"valid";return a="max"===i?n_(e,t,n,s):p$(e,t,n,s),"channelsFirst"===o&&(a=Q_(a,[0,3,1,2])),a})}function eN(e,t,n,r,o,i){return Bb(()=>{let a;Bk(o),Lk(i),Pk(r),null==n&&(n=[1,1,1]),null==r&&(r="valid"),null==o&&(o="channelsLast"),null==i&&(i="max"),e=YT(e,o);const s="same"===r?"same":"valid";return a="max"===i?r_(e,t,n,s):c$(e,t,n,s),"channelsFirst"===o&&(a=Q_(a,[0,4,1,2,3])),a})}ZF.className="ZeroPadding2D",Db(ZF);class tN extends eI{constructor(e){if(null==e.poolSize&&(e.poolSize=2),super(e),"number"==typeof e.poolSize)this.poolSize=[e.poolSize];else{if(!Array.isArray(e.poolSize)||1!==e.poolSize.length||"number"!=typeof e.poolSize[0])throw new ek(`poolSize for 1D convolutional layer must be a number or an Array of a single number, but received ${JSON.stringify(e.poolSize)}`);this.poolSize=e.poolSize}if($k(this.poolSize,"poolSize"),null==e.strides)this.strides=this.poolSize;else if("number"==typeof e.strides)this.strides=[e.strides];else{if(!Array.isArray(e.strides)||1!==e.strides.length||"number"!=typeof e.strides[0])throw new ek(`strides for 1D convolutional layer must be a number or an Array of a single number, but received ${JSON.stringify(e.strides)}`);this.strides=e.strides}$k(this.strides,"strides"),this.padding=null==e.padding?"valid":e.padding,Pk(this.padding),this.inputSpec=[new XE({ndim:3})]}computeOutputShape(e){const t=qT((e=zE(e))[1],this.poolSize[0],this.padding,this.strides[0]);return[e[0],t,e[2]]}call(e,t){return Bb(()=>{this.invokeCallHook(e,t),e=Qk(UE(e),2);const n=this.poolingFunction(UE(e),[this.poolSize[0],1],[this.strides[0],1],this.padding,"channelsLast");return z_(n,[2])})}getConfig(){const e={poolSize:this.poolSize,padding:this.padding,strides:this.strides},t=super.getConfig();return Object.assign(e,t),e}}class nN extends tN{constructor(e){super(e)}poolingFunction(e,t,n,r,o){return Bk(o),Pk(r),QF(e,t,n,r,o,"max")}}nN.className="MaxPooling1D",Db(nN);class rN extends tN{constructor(e){super(e)}poolingFunction(e,t,n,r,o){return Bk(o),Pk(r),QF(e,t,n,r,o,"avg")}}rN.className="AveragePooling1D",Db(rN);class oN extends eI{constructor(e){if(null==e.poolSize&&(e.poolSize=[2,2]),super(e),this.poolSize=Array.isArray(e.poolSize)?e.poolSize:[e.poolSize,e.poolSize],null==e.strides)this.strides=this.poolSize;else if(Array.isArray(e.strides)){if(2!==e.strides.length)throw new ek(`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];$k(this.poolSize,"poolSize"),$k(this.strides,"strides"),this.padding=null==e.padding?"valid":e.padding,this.dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,Bk(this.dataFormat),Pk(this.padding),this.inputSpec=[new XE({ndim:4})]}computeOutputShape(e){e=zE(e);let t="channelsFirst"===this.dataFormat?e[2]:e[1],n="channelsFirst"===this.dataFormat?e[3]:e[2];return t=qT(t,this.poolSize[0],this.padding,this.strides[0]),n=qT(n,this.poolSize[1],this.padding,this.strides[1]),"channelsFirst"===this.dataFormat?[e[0],e[1],t,n]:[e[0],t,n,e[3]]}call(e,t){return Bb(()=>(this.invokeCallHook(e,t),this.poolingFunction(UE(e),this.poolSize,this.strides,this.padding,this.dataFormat)))}getConfig(){const e={poolSize:this.poolSize,padding:this.padding,strides:this.strides,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}}class iN extends oN{constructor(e){super(e)}poolingFunction(e,t,n,r,o){return Bk(o),Pk(r),QF(e,t,n,r,o,"max")}}iN.className="MaxPooling2D",Db(iN);class aN extends oN{constructor(e){super(e)}poolingFunction(e,t,n,r,o){return Bk(o),Pk(r),QF(e,t,n,r,o,"avg")}}aN.className="AveragePooling2D",Db(aN);class sN extends eI{constructor(e){if(null==e.poolSize&&(e.poolSize=[2,2,2]),super(e),this.poolSize=Array.isArray(e.poolSize)?e.poolSize:[e.poolSize,e.poolSize,e.poolSize],null==e.strides)this.strides=this.poolSize;else if(Array.isArray(e.strides)){if(3!==e.strides.length)throw new ek(`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];$k(this.poolSize,"poolSize"),$k(this.strides,"strides"),this.padding=null==e.padding?"valid":e.padding,this.dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,Bk(this.dataFormat),Pk(this.padding),this.inputSpec=[new XE({ndim:5})]}computeOutputShape(e){e=zE(e);let t="channelsFirst"===this.dataFormat?e[2]:e[1],n="channelsFirst"===this.dataFormat?e[3]:e[2],r="channelsFirst"===this.dataFormat?e[4]:e[3];return t=qT(t,this.poolSize[0],this.padding,this.strides[0]),n=qT(n,this.poolSize[1],this.padding,this.strides[1]),r
vendor: 10,578 bytes, line 2
2=qT(r,this.poolSize[2],this.padding,this.strides[2]),"channelsFirst"===this.dataFormat?[e[0],e[1],t,n,r]:[e[0],t,n,r,e[4]]}call(e,t){return Bb(()=>(this.invokeCallHook(e,t),this.poolingFunction(UE(e),this.poolSize,this.strides,this.padding,this.dataFormat)))}getConfig(){const e={poolSize:this.poolSize,padding:this.padding,strides:this.strides,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}}class lN extends sN{constructor(e){super(e)}poolingFunction(e,t,n,r,o){return Bk(o),Pk(r),eN(e,t,n,r,o,"max")}}lN.className="MaxPooling3D",Db(lN);class uN extends sN{constructor(e){super(e)}poolingFunction(e,t,n,r,o){return Bk(o),Pk(r),eN(e,t,n,r,o,"avg")}}uN.className="AveragePooling3D",Db(uN);class pN extends eI{constructor(e){super(e),this.inputSpec=[new XE({ndim:3})]}computeOutputShape(e){return[e[0],e[2]]}call(e,t){throw new tk}}class cN extends pN{constructor(e){super(e||{})}call(e,t){return Bb(()=>{const t=UE(e);return i_(t,1)})}}cN.className="GlobalAveragePooling1D",Db(cN);class dN extends pN{constructor(e){super(e||{})}call(e,t){return Bb(()=>{const t=UE(e);return X$(t,1)})}}dN.className="GlobalMaxPooling1D",Db(dN);class hN extends eI{constructor(e){super(e),this.dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,Bk(this.dataFormat),this.inputSpec=[new XE({ndim:4})]}computeOutputShape(e){return"channelsLast"===this.dataFormat?[e[0],e[3]]:[e[0],e[1]]}call(e,t){throw new tk}getConfig(){const e={dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}}class fN extends hN{call(e,t){return Bb(()=>{const t=UE(e);return"channelsLast"===this.dataFormat?i_(t,[1,2]):i_(t,[2,3])})}}fN.className="GlobalAveragePooling2D",Db(fN);class gN extends hN{call(e,t){return Bb(()=>{const t=UE(e);return"channelsLast"===this.dataFormat?X$(t,[1,2]):X$(t,[2,3])})}}gN.className="GlobalMaxPooling2D",Db(gN);class mN extends eI{constructor(e){super(e),this.layer=e.layer}build(e){this.built=!0}get trainable(){return null!=this.layer&&this.layer.trainable}set trainable(e){null!=this.layer&&(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(){const e={layer:{className:this.layer.getClassName(),config:this.layer.getConfig()}},t=super.getConfig();return Object.assign(e,t),e}setFastWeightInitDuringBuild(e){super.setFastWeightInitDuringBuild(e),null!=this.layer&&this.layer.setFastWeightInitDuringBuild(e)}static fromConfig(e,t,n={}){const r=fI(t.layer,n);delete t.layer;const o={layer:r};return Object.assign(o,t),new e(o)}}class yN extends mN{constructor(e){super(e),this.supportsMasking=!0}build(e){if((e=zE(e)).length<3)throw new ek(`TimeDistributed layer expects an input shape >= 3D, but received input shape ${JSON.stringify(e)}`);this.inputSpec=[{shape:e}];const t=[e[0]].concat(e.slice(2));this.layer.built||(this.layer.build(t),this.layer.built=!0),super.build(e)}computeOutputShape(e){const t=[(e=zE(e))[0]].concat(e.slice(2)),n=this.layer.computeOutputShape(t),r=e[1];return[n[0],r].concat(n.slice(1))}call(e,t){return Bb(()=>cF((e,n)=>[UE(this.layer.call(e,t)),[]],e=UE(e),[],!1,null,null,!1,!0)[1])}}yN.className="TimeDistributed",Db(yN);class bN extends mN{constructor(e){super(e);const t=e.layer.getConfig(),n={};n.className=e.layer.getClassName(),n.config=t,this.forwardLayer=fI(n),t.goBackwards=!0!==t.goBackwards;const r={};var o;if(r.className=e.layer.getClassName(),r.config=t,this.backwardLayer=fI(r),this.forwardLayer.name="forward_"+this.forwardLayer.name,this.backwardLayer.name="backward_"+this.backwardLayer.name,this.mergeMode=void 0===e.mergeMode?"concat":e.mergeMode,o=this.mergeMode,yk(Ok,"BidirectionalMergeMode",o),e.weights)throw new tk("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,null!=this.forwardLayer&&(this.forwardLayer.trainable=e),null!=this.backwardLayer&&(this.backwardLayer.trainable=e)}getWeights(){return this.forwardLayer.getWeights().concat(this.backwardLayer.getWeights())}setWeights(e){const 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,n,r,o=this.forwardLayer.computeOutputShape(e);return Array.isArray(o)&&Array.isArray(o[0])||(o=[o]),this.returnState?(r=o.slice(1),t=o[0]):t=o[0],"concat"===this.mergeMode?(t[t.length-1]*=2,n=[t]):n=null==this.mergeMode?[t,t.slice()]:[t],this.returnState?null==this.mergeMode?n.concat(r).concat(r.slice()):[t].concat(r).concat(r.slice()):ak(n)}apply(e,t){let n=null==t?null:t.initialState,r=null==t?null:t.constants;null==t&&(t={});const o=pF(e,n,r,this.numConstants);if(e=o.inputs,n=o.initialState,r=o.constants,Array.isArray(e)&&(n=e.slice(1),e=e[0]),(null==n||0===n.length)&&null==r)return super.apply(e,t);const i=[],a=[];if(null!=n){const e=n.length;if(e%2>0)throw new ek("When passing `initialState` to a Bidrectional RNN, the state should be an Array containing the states of the underlying RNNs.");t.initialState=n,i.push(...n);const r=n.map(e=>new XE({shape:e.shape}));this.forwardLayer.stateSpec=r.slice(0,e/2),this.backwardLayer.stateSpec=r.slice(e/2),a.push(...r)}if(null!=r)throw new tk("Support for constants in Bidirectional layers is not implemented yet.");const s=i[0]instanceof YE;for(const e of i)if(e instanceof YE!==s)throw new ek("The initial state of a Bidirectional layer cannot be specified as a mix of symbolic and non-symbolic tensors");if(s){const n=[e].concat(i),r=this.inputSpec.concat(a),o=this.inputSpec;this.inputSpec=r;const s=super.apply(n,t);return this.inputSpec=o,s}return super.apply(e,t)}call(e,t){return Bb(()=>{const n=t.initialState;let r,o,i,a;if(null==n)r=this.forwardLayer.call(e,t),o=this.backwardLayer.call(e,t);else{const i=n.slice(0,n.length/2),a=n.slice(n.length/2);r=this.forwardLayer.call(e,Object.assign(t,{initialState:i})),o=this.backwardLayer.call(e,Object.assign(t,{initialState:a}))}return this.returnState&&(Array.isArray(r)&&(i=r.slice(1).concat(o.slice(1))),r=r[0],o=o[0]),this.returnSequences&&(o=N_(o,1)),"concat"===this.mergeMode?a=rE([r,o]):"sum"===this.mergeMode?a=Gb(r,o):"ave"===this.mergeMode?a=Y$(.5,Gb(r,o)):"mul"===this.mergeMode?a=Y$(r,o):null==this.mergeMode&&(a=[r,o]),this.returnState?null==this.mergeMode?a.concat(i):[a].concat(i):a})}resetStates(e){this.forwardLayer.resetStates(),this.backwardLayer.resetStates()}build(e){Uk(this.forwardLayer.name,()=>{this.forwardLayer.build(e)}),Uk(this.backwardLayer.name,()=>{this.backwardLayer.build(e)}),this.built=!0}computeMask(e,t){let n;if(Array.isArray(t)&&(t=t[0]),n=this.returnSequences?null==this.mergeMode?[t,t]:t:null==this.mergeMode?[null,null]:null,this.returnState){const e=this.forwardLayer.states.map(e=>null);return Array.isArray(n)?n.concat(e).concat(e):[n].concat(e).concat(e)}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),null!=this.forwardLayer&&this.forwardLayer.setFastWeightInitDuringBuild(e),null!=this.backwardLayer&&this.backwardLayer.setFastWeightInitDuringBuild(e)}getConfig(){const e={mergeMode:this.mergeMode},t=super.getConfig();return Object.assign(e,t),e}static fromConfig(e,t){const n=fI(t.layer);if(delete t.layer,null!=t.numConstants)throw new tk("Deserialization of a Bidirectional layer with numConstants present is not supported yet.");const r=t;return r.layer=n,new e(r)}}bN.className="Bidirectional",Db(bN),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"}(xF||(xF={})),function(e){let t;!function(e){e[e.LEGACY=0]="LEGACY",e[e.V1=1]="V1",e[e.V2=2]="V2"}(t=e.CheckpointFormatVersion||(e.CheckpointFormatVersion={}))}(SF||(SF={}));const $N={};function _N(e){return $N[e]}function wN(e,t,n,r,o){const i=t.inputParams[e];if(i&&void 0!==i.inputIndexStart){const e=i.inputIndexStart,a=0===i.inputIndexEnd?void 0:void 0===i.inputIndexEnd?e+1:i.inputIndexEnd;if("tensor"===i.type)return xN(t.inputNames[i.inputIndexStart],n,r,o);if("tensors"===i.type)return t.inputNames.slice(e,a).map(e=>xN(e,n,r,o));const s=xN(t.inputNames.slice(e)[0],n,r,o),l=s.dataSync();return"number"===i.type?l[0]:ge(s.shape,l)}const a=t.attrParams[e];return a&&a.value}function xN(e,t,n,r){const[o,i]=kN(e);if(null!=r){const e=r.getHashTableHandleByName(o);if(null!=e)return e}const a=n.currentContextIds.find(e=>!!t[vN(o,e)]);return void 0!==a?t[vN(o,a)][i]:void 0}function SN(e,t){const[n,r,o]=kN(e);return[vN(n,t&&t.currentContextId),r,o]}function vN(e,t){return t?`${e}-${t}`:e}function kN(e){const t=e.split(":");if(1===t.length)return[e,0,void 0];const n=t[0],r=3===t.length?t[1]:void 0;return[n,Number(t[t.length-1]),r]}function EN(e,t,n){let r=wN("pad",e,t,n);if("explicit"===r){r=wN("explicitPaddings",e,t,n);const o=[[0,0],[0,0],[0,0],[0,0]];for(let e=0;e<4;e++)o[e][0]=r[2*e],o[e][1]=r[2*e+1];return o}return r}function IN(e){return e.kept?e:fi(e)}const TN=[{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}
2]},{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}]}],FN=
vendor: 6,168 bytes, line 2
2[{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:"
2Prod",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}]}],NN=[{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"}]}
2,{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"}]}],jN=[{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}
vendor: 9,845 bytes, line 2
2,{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"}]}],AN=[{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"}]}],CN=[{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}
2,{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}]}],MN=[{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"}]}],DN=[{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"}]}],ON=[{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"}
2],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"}]}],RN=[{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"}]}],BN=[{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}]}],PN=[{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}
2]},{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"}]}],LN=[{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}]}],WN=[{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"}]}],UN=[{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}
2]},{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}]}],zN=[{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"}]}],VN=[{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}]}],HN=[{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"}]}
2],GN=[{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:[]},{tfOpName:"BroadcastArgs",category:"transformation",inputs:[{start:0,name:"s0",type:"tensor"},{start:1,name:"s1",type:"tensor"}],attrs:[]}];class qN{static get Instance(){return this._instance||(this._instance=new this)}constructor(){const e=[].concat(...[r,o,i,a,s,l,u,p,c,d,h,f,g,m,y,b,$,_,w].map(e=>e.json));this.opMappers=e.reduce((e,t)=>(e[t.tfOpName]=t,e),{})}transformGraph(e,t={}){const n=e.node,r=[],o=[],i=[],a=n.reduce((e,t)=>(e[t.name]=this.mapNode(t),t.op.startsWith("Placeholder")?r.push(e[t.name]):"Const"===t.op?o.push(e[t.name]):null!=t.input&&0!==t.input.length||i.push(e[t.name]),e),{});let s=[];const l=[];let u={},p={};null!=t&&(u=this.mapSignatureEntries(t.inputs),p=this.mapSignatureEntries(t.outputs));const c=Object.keys(a);c.forEach(e=>{const t=a[e];t.inputNames.forEach((e,n)=>{const[r,,o]=SN(e),i=a[r];if(null!=i.outputs){const e=i.outputs.indexOf(o);if(-1!==e){const o=`${r}:${e}`;t.inputNames[n]=o}}t.inputs.push(i),i.children.push(t)})}
vendor: 4,410 bytes, line 2
2),0===Object.keys(p).length?c.forEach(e=>{const t=a[e];0===t.children.length&&l.push(t)}):Object.keys(p).forEach(e=>{const[t]=SN(e),n=a[t];null!=n&&(n.signatureKey=p[e],l.push(n))}),Object.keys(u).length>0?Object.keys(u).forEach(e=>{const[t]=SN(e),n=a[t];n&&(n.signatureKey=u[e],s.push(n))}):s=r;let d={};null!=e.library&&null!=e.library.function&&(d=e.library.function.reduce((e,t)=>(e[t.signature.name]=this.mapFunction(t),e),{}));const h={nodes:a,inputs:s,outputs:l,weights:o,placeholders:r,signature:t,functions:d};return i.length>0&&(h.initNodes=i),h}mapSignatureEntries(e){return Object.keys(e||{}).reduce((t,n)=>(t[e[n].name]=n,t),{})}mapNode(e){const t=_N(e.op)||this.opMappers[e.op]||{};null==e.attr&&(e.attr={});const n={name:e.name,op:e.op,category:t.category,inputNames:(e.input||[]).map(e=>e.startsWith("^")?e.substr(1):e),inputs:[],children:[],inputParams:{},attrParams:{},rawAttrs:e.attr,outputs:t.outputs};return null!=t.inputs&&(n.inputParams=t.inputs.reduce((e,t)=>(e[t.name]={type:t.type,inputIndexStart:t.start,inputIndexEnd:t.end},e),{})),null!=t.attrs&&(n.attrParams=t.attrs.reduce((t,n)=>{const r=n.type;let o;switch(n.type){case"string":o=XN(e.attr,n.tfName,n.defaultValue),void 0===o&&n.tfDeprecatedName&&(o=XN(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"string[]":o=ij(e.attr,n.tfName,n.defaultValue),void 0===o&&n.tfDeprecatedName&&(o=ij(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"number":o=JN(e.attr,n.tfName,n.defaultValue||0),void 0===o&&n.tfDeprecatedName&&(o=JN(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"number[]":o=oj(e.attr,n.tfName,n.defaultValue),void 0===o&&n.tfDeprecatedName&&(o=oj(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"bool":o=YN(e.attr,n.tfName,n.defaultValue),void 0===o&&n.tfDeprecatedName&&(o=YN(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"bool[]":o=sj(e.attr,n.tfName,n.defaultValue),void 0===o&&n.tfDeprecatedName&&(o=sj(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"shape":o=rj(e.attr,n.tfName,n.defaultValue),void 0===o&&n.tfDeprecatedName&&(o=rj(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"shape[]":o=aj(e.attr,n.tfName,n.defaultValue),void 0===o&&n.tfDeprecatedName&&(o=aj(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"dtype":o=ej(e.attr,n.tfName,n.defaultValue),void 0===o&&n.tfDeprecatedName&&(o=ej(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"dtype[]":o=tj(e.attr,n.tfName,n.defaultValue),void 0===o&&n.tfDeprecatedName&&(o=tj(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"func":o=QN(e.attr,n.tfName,n.defaultValue),void 0===o&&n.tfDeprecatedName&&(o=QN(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"tensor":case"tensors":break;default:throw new Error(`Unsupported param type: ${n.type} for op: ${e.op}`)}return t[n.name]={value:o,type:r},t},{})),n}mapFunction(e){const t=e.nodeDef,n=[];let r={};null!=t&&(r=t.reduce((e,t)=>(e[t.name]=this.mapNode(t),"Const"===t.op&&n.push(e[t.name]),e),{}));const o=[],i=[];e.signature.inputArg.forEach(e=>{const[t]=SN(e.name),n={name:t,op:"Placeholder",inputs:[],inputNames:[],category:"graph",inputParams:{},attrParams:{dtype:{value:ZN(e.type),type:"dtype"}},children:[]};n.signatureKey=e.name,o.push(n),r[t]=n}),Object.keys(r).forEach(e=>{const t=r[e];t.inputNames.forEach((e,n)=>{const[o,,i]=SN(e),a=r[o];if(null!=a.outputs){const e=a.outputs.indexOf(i);if(-1!==e){const r=`${o}:${e}`;t.inputNames[n]=r}}t.inputs.push(a),a.children.push(t)})});const a=e.ret;e.signature.outputArg.forEach(e=>{const[t,n]=SN(a[e.name]),o=r[t];null!=o&&(o.defaultOutput=n,i.push(o))});const s=this.mapArgsToSignature(e);return{nodes:r,inputs:o,outputs:i,weights:n,placeholders:[],signature:s}}mapArgsToSignature(e){return{methodName:e.signature.name,inputs:e.signature.inputArg.reduce((e,t)=>(e[t.name]=this.mapArgToTensorInfo(t),e),{}),outputs:e.signature.outputArg.reduce((t,n)=>(t[n.name]=this.mapArgToTensorInfo(n,e.ret),t),{})}}mapArgToTensorInfo(e,t){let n=e.name;return null!=t&&(n=t[n]),{name:n,dtype:e.type}}}function KN(e,t){const n=Array.isArray(e)?String.fromCharCode.apply(null,e):function(e){const t=ke().global;if(void 0!==t.atob)return t.atob(e);if("undefined"!=typeof Buffer)return new Buffer(e,"base64").toString();throw new Error("Unable to decode base64 in this environment. Missing built-in atob() or Buffer()")}(e);return t?n:n.toLowerCase()}function XN(e,t,n,r=!1){const o=e[t];return null!=o?KN(o.s,r):n}
2function YN(e,t,n){const r=e[t];return r?r.b:n}function JN(e,t,n){const r=e[t]||{},o=null!=r.i?r.i:null!=r.f?r.f:n;return"number"==typeof o?o:parseInt(o,10)}function ZN(e){switch("string"==typeof e&&(e=xF[e]),e){case xF.DT_FLOAT:return"float32";case xF.DT_INT32:case xF.DT_INT64:case xF.DT_INT8:case xF.DT_UINT8:return"int32";case xF.DT_BOOL:return"bool";case xF.DT_DOUBLE:return"float32";case xF.DT_STRING:return"string";default:return null}}function QN(e,t,n){const r=e[t];return r&&r.func?r.func.name:n}function ej(e,t,n){const r=e[t];return r&&r.type?ZN(r.type):n}function tj(e,t,n){const r=e[t];return r&&r.list&&r.list.type?r.list.type.map(e=>ZN(e)):n}function nj(e){if(!e.unknownRank)return null!=e.dim?e.dim.map(e=>"number"==typeof e.size?e.size:parseInt(e.size,10)):[]}function rj(e,t,n){const r=e[t];return r&&r.shape?nj(r.shape):n}function oj(e,t,n){const r=e[t];return r?((r.list.f&&r.list.f.length?r.list.f:r.list.i)||[]).map(e=>"number"==typeof e?e:parseInt(e,10)):n}function ij(e,t,n,r=!1){const o=e[t];return o&&o.list&&o.list.s?o.list.s.map(e=>KN(e,r)):n}function aj(e,t,n){const r=e[t];return r&&r.list&&r.list.shape?r.list.shape.map(e=>nj(e)):n}function sj(e,t,n){const r=e[t];return r&&r.list&&r.list.b?r.list.b:n}class lj{constructor(e,t,n){this.node=e,this.tensorMap=t,this.context=n,this.inputs=[],this.attrs={},this.inputs=e.inputNames.map(e=>this.getInput(e)),null!=e.rawAttrs&&(this.attrs=Object.keys(e.rawAttrs).reduce((e,t)=>(e[t]=this.getAttr(t),e),{}))}getInput(e){return xN(e,this.tensorMap,this.context)}getAttr(e,t){const n=this.node.rawAttrs[e];if(null!=n.tensor)return xN(e,this.tensorMap,this.context);if(null!=n.i||null!=n.f)return JN(this.node.rawAttrs,e,t);if(null!=n.s)return XN(this.node.rawAttrs,e,t);if(null!=n.b)return YN(this.node.rawAttrs,e,t);if(null!=n.shape)return rj(this.node.rawAttrs,e,t);if(null!=n.type)return ej(this.node.rawAttrs,e,t);if(null!=n.list){if(null!=n.list.i||null!=n.list.f)return oj(this.node.rawAttrs,e,t);if(null!=n.list.s)return ij(this.node.rawAttrs,e,t);if(null!=n.list.shape)return aj(this.node.rawAttrs,e,t);if(null!=n.list.b)return sj(this.node.rawAttrs,e,t);if(null!=n.list.type)return tj(this.node.rawAttrs,e,t)}return t}}const uj=No({addN_:function(e){q(Array.isArray(e),()=>"The argument passed to tf.addN() must be a list of tensors"),q(e.length>=1,()=>`Must pass at least one tensor to tf.addN(), but got ${e.length}`);const t=e.map((e,t)=>To(e,`tensors${t}`,"addN")),n=t[0];t.forEach(e=>{if(e.dtype!==n.dtype)throw new Error("All tensors passed to tf.addN() must have the same dtype")}),t.forEach(e=>{if(!Z(e.shape,n.shape))throw new Error("All tensors passed to tf.addN() must have the same shape")});const r=t;return _o.runKernel(Me,r)}});function pj(e,t,n=""){if("number"!=typeof e&&"number"!=typeof t){q(e.length===t.length,()=>n+` Shapes ${e} and ${t} must match`);for(let r=0;r<e.length;r++){const o=e[r],i=t[r];q(o<0||i<0||o===i,()=>n+` Shapes ${e} and ${t} must match`)}}}function cj(e){return"number"!=typeof e&&!e.some(e=>e<0)}function dj(e,t,n){let r=hj(e,n);const o=!cj(r);if(o&&0===t.length)throw new Error(`Tried to calculate elements of an empty list with non-fully-defined elementShape: ${r}`);if(o&&t.forEach(e=>{r=hj(e.shape,r)}),!cj(r))throw new Error(`Non-fully-defined elementShape: ${r}`);return r}function hj(e,t){if("number"==typeof e)return t;if("number"==typeof t)return e;if(e.length!==t.length)throw new Error(`Incompatible ranks during merge: ${e} vs. ${t}`);const n=[];for(let r=0;r<e.length;++r){const o=e[r],i=t[r];if(o>=0&&i>=0&&o!==i)throw new Error(`Incompatible shape during merge: ${e} vs. ${t}`);n[r]=o>=0?o:i}return n}class fj{constructor(e,t,n,r,o,i,a){this.name=e,this.dtype=t,this.maxSize=n,this.elementShape=r,this.identicalElementShapes=o,this.dynamicSize=i,this.clearAfterRead=a,this.tensors=[],this.closed_=!1,this.idTensor=Yi(0),bs(this.idTensor)}get id(){return this.idTensor.id}get closed(){return this.closed_}clearAndClose(e){this.tensors.forEach(t=>{null!=e&&e.has(t.tensor.id)||t.tensor.dispose()}),this.tensors=[],this.closed_=!0,this.idTensor.dispose()}size(){return this.tensors.length}read(e){if(this.closed_)throw new Error(`TensorArray ${this.name} has already been closed.`);if(e<0||e>=this.size())throw new Error(`Tried to read from index ${e}, but array size is: ${this.size()}`);const t=this.tensors[e];if(t.cleared)throw new Error(`TensorArray ${this.name}: Could not read index ${e} twice because it was cleared after a previous read (perhaps try setting clear_after_read = false?).`);return this.clearAfterRead&&(t.cleared=!0),t.read=!0,t.tensor}readMany(e){return e.map(e=>this.read(e))}write(e,t){if(this.closed_)throw new Error(`TensorArray ${this.name} has already been closed.`);if(e<0||!this.dynamicSize&&e>=this.maxSize)throw new Error(`Tried to write to index ${e}, but array is not resizeable and size is: ${this.maxSize}`);const n=this.tensors[e]||{};if(t.dtype!==this.dtype)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e},\n          because the value dtype is ${t.dtype}, but TensorArray dtype is ${this.dtype}.`);if(0!==this.size()||null!=this.elementShape&&0!==this.elementShape.length||(this.elementShape=t.shape),pj(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,bs(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((e,n)=>this.write(e,t[n]))}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 t=0;t<this.size();t++)e.push(t)}if(0===e.length)return Co([],[0].concat(this.elementShape));const n=this.readMany(e);return pj(this.elementShape,n[0].shape,"TensorArray shape mismatch: "),Qi(n,0)}concat(e){if(e&&e!==this.dtype)throw new Error(`TensorArray dtype is ${this.dtype} but concat requested dtype ${e}`);if(0===this.size())return Co([],[0].concat(this.elementShape));const t=[];for(let e=0;e<this.size();e++)t.push(e);const n=this.readMany(t);return pj(this.elementShape,n[0].shape,`TensorArray shape mismatch: tensor array shape (${this.elementShape}) vs first tensor shape (${n[0].shape})`),Hi(n,0)}scatter(e,t){if(t.dtype!==this.dtype)throw new Error(`TensorArray dtype is ${this.dtype} but tensor has dtype ${t.dtype}`);if(e.length!==t.shape[0])throw new Error(`Expected len(indices) == tensor.shape[0], but saw: ${e.length} vs. ${t.shape[0]}`);const n=Math.max(...e);if(!this.dynamicSize&&n>=this.maxSize)throw new Error(`Max index must be < array size (${n}  vs. ${this.maxSize})`);this.writeMany(e,ea(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;const r=e.map(e=>(n+=e,n));if(n!==t.shape[0])throw new Error(`Expected sum of lengths to be equal to\n          tensor.shape[0], but sum of lengths is\n        ${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`);const o=0===n?0:t.size/n,i=[];ms(()=>{t=Xi(t,[1,n,o]);for(let n=0;n<e.length;++n){const a=[0,0===n?0:r[n-1],0],s=[1,e[n],o];i[n]=Xi(Ji(t,a,s),this.elementShape)}return i});const a=[];for(let t=0;t<e.length;t++)a[t]=t;this.writeMany(a,i)}}class gj{constructor(e,t,n,r=-1){this.tensors=e,this.elementShape=t,this.elementDtype=n,null!=e&&e.forEach(e
2=>{if(n!==e.dtype)throw new Error(`Invalid data types; op elements ${n}, but list elements ${e.dtype}`);pj(t,e.shape,"TensorList shape mismatch: "),bs(e)}),this.idTensor=Yi(0),this.maxNumElements=r,bs(this.idTensor)}get id(){return this.idTensor.id}copy(){return new gj([...this.tensors],this.elementShape,this.elementDtype)}clearAndClose(e){this.tensors.forEach(t=>{null!=e&&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(-1!==n&&this.tensors.length!==n)throw new Error(`Operation expected a list with ${n} elements but got a list with ${this.tensors.length} elements.`);pj(e,this.elementShape,"TensorList shape mismatch: ");const r=dj(this.elementShape,this.tensors,e);return ms(()=>{const e=this.tensors.map(e=>Xi(e,r));return Qi(e,0)})}popBack(e,t){if(t!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t}, but list elements ${this.elementDtype}`);if(0===this.size())throw new Error("Trying to pop from an empty list.");const n=dj(this.elementShape,this.tensors,e),r=this.tensors.pop();return pj(r.shape,e,"TensorList shape mismatch: "),Xi(r,n)}pushBack(e){if(e.dtype!==this.elementDtype)throw new Error(`Invalid data types; op elements ${e.dtype}, but list elements ${this.elementDtype}`);if(pj(e.shape,this.elementShape,"TensorList shape mismatch: "),this.maxNumElements===this.size())throw new Error("Trying to push element into a full list.");bs(e),this.tensors.push(e)}resize(e){if(e<0)throw new Error(`TensorListResize expects size to be non-negative. Got: ${e}`);if(-1!==this.maxNumElements&&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(null==this.tensors[e])throw new Error(`element at index ${e} is null.`);pj(this.tensors[e].shape,t,"TensorList shape mismatch: ");const r=dj(this.elementShape,this.tensors,t);return Xi(this.tensors[e],r)}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||-1!==this.maxNumElements&&e>=this.maxNumElements)throw new Error(`Trying to set element ${e} in a list with max ${this.maxNumElements} elements.`);pj(this.elementShape,t.shape,"TensorList shape mismatch: "),bs(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}`);pj(this.elementShape,n,"TensorList shape mismatch: "),e=e.slice(0,this.size());const r=dj(this.elementShape,this.tensors,n);return 0===e.length?Co([],[0].concat(r)):ms(()=>{const t=e.map(e=>Xi(this.tensors[e],r));return Qi(t,0)})}concat(e,t){if(e&&e!==this.elementDtype)throw new Error(`TensorList dtype is ${this.elementDtype} but concat requested dtype ${e}`);pj(this.elementShape,t,"TensorList shape mismatch: ");const n=dj(this.elementShape,this.tensors,t);return 0===this.size()?Co([],[0].concat(n)):ms(()=>{const e=this.tensors.map(e=>Xi(e,n));return Hi(e,0)})}}const mj=No({fusedConv2d_:function({x:e,filter:t,strides:n,pad:r,dataFormat:o="NHWC",dilations:i=[1,1],dimRoundingMode:a,bias:s,activation:l="linear",preluActivationWeights:u,leakyreluAlpha:p}){if(l=l||"linear",!1===bl(_o.state.gradientDepth,l)){let c=Bu(e,t,n,r,o,i,a);return null!=s&&(c=Vi(c,s)),yl(c,l,u,p)}const c=To(e,"x","conv2d"),d=To(t,"filter","conv2d");let h=c,f=!1;3===c.rank&&(f=!0,h=Xi(c,[1,c.shape[0],c.shape[1],c.shape[2]])),q(4===h.rank,()=>`Error in fused conv2d: input must be rank 4, but got rank ${h.rank}.`),q(4===d.rank,()=>`Error in fused conv2d: filter must be rank 4, but got rank ${d.rank}.`),null!=a&&q(Q(r),()=>`Error in fused conv2d: pad must be an integer when using, dimRoundingMode ${a} but got pad ${r}.`),q(h.shape[3]===d.shape[2],()=>`Error in conv2d: depth of input (${h.shape[3]}) must match input depth for filter ${d.shape[2]}.`),q(sl(n,i),()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${n} and dilations '${i}'`),q("NHWC"===o,()=>`Error in conv2d: got dataFormat of ${o} but only NHWC is currently supported.`);const g=Qs(h.shape,d.shape,n,i,r,a);let m,y;null!=s&&(m=To(s,"bias","fused conv2d"),[m]=ho(m,c),Pa(g.outShape,m.shape)),null!=u&&(y=To(u,"prelu weights","fused conv2d"));const b=(e,t)=>{const[o,a,s,u]=t,p=gl(e,s,l);q(al(i),()=>`Error in gradient of fused conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${i}'`);const c=[Ou(a.shape,p,o,n,r),Du(a,p,o.shape,n,r)];if(null!=u){const e=ml(u,p);c.push(e)}return c},$={x:h,filter:d,bias:m,preluActivationWeights:y},_={strides:n,pad:r,dataFormat:o,dilations:i,dimRoundingMode:a,activation:l,leakyreluAlpha:p};if(null==s){const e=Os((e,t,n)=>{let r=_o.runKernel(vr,$,_);return n([t,e,r]),f&&(r=Xi(r,[r.shape[1],r.shape[2],r.shape[3]])),{value:r,gradFunc:b}});return e(h,d)}{const e=Os((e,t,n,r)=>{let o=_o.runKernel(vr,$,_);return r([t,e,o,n]),f&&(o=Xi(o,[o.shape[1],o.shape[2],o.shape[3]])),{value:o,gradFunc:b}});return e(h,d,m)}}}),yj=No({fusedDepthwiseConv2d_:function({x:e,filter:t,strides:n,pad:r,dataFormat:o="NHWC",dilations:i=[1,1],dimRoundingMode:a,bias:s,activation:l="linear",preluActivationWeights:u,leakyreluAlpha:p}){if(!1===bl(_o.state.gradientDepth,l)){let c=Yc(e,t,n,r,o,i,a);return null!=s&&(c=Vi(c,s)),yl(c,l,u,p)}const c=To(e,"x","depthwiseConv2d"),d=To(t,"filter","depthwiseConv2d");let h=c,f=!1;3===c.rank&&(f=!0,h=Xi(c,[1,c.shape[0],c.shape[1],c.shape[2]])),q(4===h.rank,()=>`Error in fused depthwiseConv2d: input must be rank 4, but got rank ${h.rank}.`),q(4===d.rank,()=>`Error in fused depthwiseConv2d: filter must be rank 4, but got rank ${d.rank}.`),q(h.shape[3]===d.shape[2],()=>`Error in fused depthwiseConv2d: number of input channels (${h.shape[3]}) must match the inChannels dimension in filter ${d.shape[2]}.`),null==i&&(i=[1,1]),q(sl(n,i),()=>`Error in fused depthwiseConv2d: Either strides or dilations must be 1. Got strides ${n} and dilations '${i}'`),null!=a&&q(Q(r),()=>`Error in fused depthwiseConv2d: pad must be an integer when using dimRoundingMode ${a} but got pad ${r}.`);const g=Qs(h.shape,d.shape,n,i,r,a,!0);let m,y;null!=s&&(m=To(s,"bias","fused conv2d"),[m]=ho(m,c),Pa(g.outShape,m.shape)),null!=u&&(y=To(u,"prelu weights","fused depthwiseConv2d"));const b=(e,t)=>{q(al(i),()=>`Error in gradient of fused depthwiseConv2d: dilation rates greater than 1 are not yet supported. Got dilations '${i}'`);const[o,s,u,p]=t,c=gl(e,u,l),d=Yu(s.shape,c,o,n,r,i,a),h=Xu(s,c,o.shape,n,r,i,a);return null!=p?[d,h,ml(m,c)]:[d,h]},$={x:h,filter:d,bias:m,preluActivationWeights:y},_={strides:n,pad:r,dataFormat:o,dilations:i,dimRoundingMode:a,activation:l,leakyreluAlpha:p};if(null==s){const e=Os((e,t,n)=>{let r=_o.runKernel(kr,$,_);return n([t,e,r]),f&&(r=Xi(r,[r.shape[1],r.shape[2],r.shape[3]])),{value:r,gradFunc:b}});return e(h,d)}{const e=Os((e,t,n,r)=>{let o=_o.runKernel(kr,$,_);return r([t,e,o,n]),f&&(o=Xi(o,[o.shape[1],o.shape[2],o.shape[3]])),{value:o,gradFunc:b}});return e(h,d,m)}}}),bj=No({conv3d_:function(e,t,n,r,o="NDHWC",i=[1,1,1]){const a=To(e,"x","conv3d"),s=To(t,"filter","conv3d");let l=a,u=!1;4===a.rank&&(u=!0,l=Xi(a,[1,a.shape[0],a.shape[1],a.shape[2],a.shape[3]])),q(5===l.rank,()=>`Error in conv3d: input must be rank 5, but got rank ${l.rank}.`),q(5===s.rank,()=>`Error in conv3d: filter must be rank 5, but got rank ${s.rank}
2.`),q(l.shape[4]===s.shape[3],()=>`Error in conv3d: depth of input (${l.shape[4]}) must match input depth for filter ${s.shape[3]}.`),q(sl(n,i),()=>`Error in conv3D: Either strides or dilations must be 1. Got strides ${n} and dilations '${i}'`),q("NDHWC"===o,()=>`Error in conv3d: got dataFormat of ${o} but only NDHWC is currently supported.`);const p={x:l,filter:s},c={strides:n,pad:r,dataFormat:o,dilations:i},d=_o.runKernel(ot,p,c);return u?Xi(d,[d.shape[1],d.shape[2],d.shape[3],d.shape[4]]):d}}),$j=No({maxPoolWithArgmax_:function(e,t,n,r,o=!1){const i={x:To(e,"x","maxPoolWithArgmax")},a={filterSize:t,strides:n,pad:r,includeBatchInIndex:o},s=_o.runKernel(on,i,a);return{result:s[0],indexes:s[1]}}}),_j=No({avgPool3d_:function(e,t,n,r,o,i="NDHWC"){const a=To(e,"x","avgPool3d","float32");let s=a,l=!1;4===a.rank&&(l=!0,s=Xi(a,[1,a.shape[0],a.shape[1],a.shape[2],a.shape[3]])),q(5===s.rank,()=>`Error in avgPool3d: x must be rank 5 but got rank ${s.rank}.`),q("NDHWC"===i,()=>`Error in avgPool3d: Only NDHWC is currently supported, but got dataFormat of ${i}`),null!=o&&q(Q(r),()=>`Error in avgPool3d: pad must be an integer when using, dimRoundingMode ${o} but got pad ${r}.`);const u={x:s},p={filterSize:t,strides:n,pad:r,dimRoundingMode:o,dataFormat:i};let c=_o.runKernel(Ve,u,p);return c=hi(c,s.dtype),l?Xi(c,[c.shape[1],c.shape[2],c.shape[3],c.shape[4]]):c}}),wj=No({maxPool3d_:function(e,t=[1,1,1],n,r,o,i="NDHWC"){const a=To(e,"x","maxPool3d");let s=a,l=!1;4===a.rank&&(l=!0,s=Xi(a,[1,a.shape[0],a.shape[1],a.shape[2],a.shape[3]])),q(5===s.rank,()=>`Error in maxPool3d: x must be rank 5 but got rank ${s.rank}.`),q("NDHWC"===i,()=>`Error in maxPool3d: Only NDHWC is currently supported, but got dataFormat of ${i}`),null!=o&&q(Q(r),()=>`Error in maxPool3d: pad must be an integer when using, dimRoundingMode ${o} but got pad ${r}.`);const u={x:s},p={filterSize:t,strides:n,pad:r,dimRoundingMode:o,dataFormat:i},c=_o.runKernel(nn,u,p);return l?Xi(c,[c.shape[1],c.shape[2],c.shape[3],c.shape[4]]):c}});function xj(e,t,n){const[r,o]=wN("fusedOps",e,t,n),i="biasadd"===r,a=!i,s="prelu"===o,l="fusedbatchnorm"===r,u=wN("numArgs",e,t,n);if(i){if(s&&2!==u)throw new Error("FusedConv2d and DepthwiseConv2d with BiasAdd and Prelu must have two extra arguments: bias and alpha.");if(!s&&i&&1!==u)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");const p=wN("strides",e,t,n),c=EN(e,t,n),d=wN("dataFormat",e,t,n).toUpperCase(),h=wN("dilations",e,t,n);let[f,g]=wN("args",e,t,n);return a&&(g=f,f=void 0),{stride:p,pad:c,dataFormat:d,dilations:h,biasArg:f,preluArg:g,activationFunc:o,leakyreluAlpha:wN("leakyreluAlpha",e,t,n)}}function Sj(e,t,n){if(n<=0)throw new Error("The number of values should be positive.");const r={start:e,stop:t,num:n};return _o.runKernel(Vt,{},r)}const vj=No({multinomial_:function(e,t,n,r=!1){const o=To(e,"logits","multinomial"),i=o.size,a=o.rank;if(i<2)throw new Error(`Error in multinomial: you need at least 2 outcomes, but got ${i}.`);if(a>2)throw new Error(`Rank of probabilities must be 1 or 2, but is ${a}`);n=n||Math.random();const s={logits:1===a?Xi(o,[1,-1]):o},l={numSamples:t,seed:n,normalized:r},u=_o.runKernel(cn,s,l);return 1===a?Xi(u,[u.size]):u}});class kj{constructor(e,t,n,r,o){this.mean=e,this.stdDev=t,this.dtype=n,this.nextVal=NaN,this.truncated=r,this.truncated&&(this.upper=this.mean+2*this.stdDev,this.lower=this.mean-2*this.stdDev);const i=o||Math.random();this.random=v_.alea(i.toString())}nextValue(){if(!isNaN(this.nextVal)){const e=this.nextVal;return this.nextVal=NaN,e}let e,t,n=!1;for(;!n;){let r,o,i;do{r=2*this.random()-1,o=2*this.random()-1,i=r*r+o*o}while(i>=1||0===i);const a=Math.sqrt(-2*Math.log(i)/i);e=this.mean+this.stdDev*r*a,t=this.mean+this.stdDev*o*a,this.truncated&&!this.isValidTruncated(e)||(n=!0)}return this.truncated&&!this.isValidTruncated(t)||(this.nextVal=this.convertValue(t)),this.convertValue(e)}convertValue(e){return null==this.dtype||"float32"===this.dtype?e:Math.round(e)}isValidTruncated(e){return e<=this.upper&&e>=this.lower}}class Ej{constructor(e=0,t=1,n,r){if(this.canReturnFloat=()=>null==this.dtype||"float32"===this.dtype,this.min=e,this.range=t-e,this.dtype=n,null==r&&(r=Math.random()),"number"==typeof r&&(r=r.toString()),!this.canReturnFloat()&&this.range<=1)throw new Error(`The difference between ${e} - ${t} <= 1 and dtype is not float`);this.random=v_.alea(r)}convertValue(e){return this.canReturnFloat()?e:Math.round(e)}
2nextValue(){return this.convertValue(this.min+this.range*this.random())}}const Ij=No({randomUniform_:function(e,t=0,n=1,r="float32",o){const i=di(e,r),a=new Ej(t,n,null,o);for(let e=0;e<i.values.length;e++)i.values[e]=a.nextValue();return i.toTensor()}}),Tj=No({truncatedNormal_:function(e,t=0,n=1,r,o){if(null!=r&&"bool"===r)throw new Error("Unsupported data type $ { dtype }");const i=new kj(t,n,r,!0,o),a=di(e,r);for(let e=0;e<a.values.length;e++)a.values[e]=i.nextValue();return a.toTensor()}}),Fj=async function(e){const t=To(e,"condition","whereAsync","bool"),n=await t.data(),r=uu(t.shape,n);return e!==t&&t.dispose(),r};function Nj(e,t,n){return{boxes:wN("boxes",e,t,n),scores:wN("scores",e,t,n),maxOutputSize:wN("maxOutputSize",e,t,n),iouThreshold:wN("iouThreshold",e,t,n),scoreThreshold:wN("scoreThreshold",e,t,n),softNmsSigma:wN("softNmsSigma",e,t,n)}}class jj{constructor(e,t){this.keyDType=e,this.valueDType=t,this.handle=Yi(0),this.tensorMap=new Map,bs(this.handle)}get id(){return this.handle.id}clearAndClose(){this.tensorMap.forEach(e=>e.dispose()),this.tensorMap.clear(),this.handle.dispose()}size(){return this.tensorMap.size}tensorSize(){return Yi(this.size(),"int32")}async import(e,t){this.checkKeyAndValueTensor(e,t);const n=await e.data();return this.tensorMap.forEach(e=>e.dispose()),this.tensorMap.clear(),ms(()=>{const e=ea(t),r=n.length,o=e.length;q(r===o,()=>`The number of elements doesn't match, keys has ${r} elements, the values has ${o} elements.`);for(let t=0;t<r;t++){const r=n[t],o=e[t];bs(o),this.tensorMap.set(r,o)}return this.handle})}async find(e,t){this.checkKeyAndValueTensor(e,t);const n=await e.data();return ms(()=>{const e=[];for(let r=0;r<n.length;r++){const o=n[r],i=this.findWithDefault(o,t);e.push(i)}return Qi(e)})}findWithDefault(e,t){const n=this.tensorMap.get(e);return null!=n?n:t}checkKeyAndValueTensor(e,t){if(e.dtype!==this.keyDType)throw new Error(`Expect key dtype ${this.keyDType}, but got ${e.dtype}`);if(t.dtype!==this.valueDType)throw new Error(`Expect value dtype ${this.valueDType}, but got ${t.dtype}`)}}const Aj=No({einsum_:function(e,...t){const n=t.map((e,t)=>To(e,`tensors${t}`,"einsum")),r={equation:e};return _o.runKernel(bt,n,r)}}),Cj=No({fusedMatMul_:function({a:e,b:t,transposeA:n=!1,transposeB:r=!1,bias:o,activation:i="linear",preluActivationWeights:a,leakyreluAlpha:s}){if(!1===bl(_o.state.gradientDepth,i)){let l=ws(e,t,n,r);return null!=o&&(l=Vi(l,o)),yl(l,i,a,s)}let l=To(e,"a","fused matMul"),u=To(t,"b","fused matMul");[l,u]=ho(l,u);const p=n?l.shape[l.rank-2]:l.shape[l.rank-1],c=r?u.shape[u.rank-1]:u.shape[u.rank-2],d=n?l.shape[l.rank-1]:l.shape[l.rank-2],h=r?u.shape[u.rank-2]:u.shape[u.rank-1],f=l.shape.slice(0,-2),g=u.shape.slice(0,-2),m=J(f),y=J(g);q(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}.`),q(Z(f,g),()=>`Error in fused matMul: outer dimensions (${f}) and (${g}) of Tensors with shapes ${l.shape} and ${u.shape} must match.`),q(p===c,()=>`Error in fused matMul: inner shapes (${p}) and (${c}) of Tensors with shapes ${l.shape} and ${u.shape} and transposeA=${n} and transposeB=${r} must match.`);const b=l.shape.slice(0,-2).concat([d,h]),$=Xi(l,n?[m,p,d]:[m,d,p]),_=Xi(u,r?[y,h,c]:[y,c,h]);let w,x;null!=o&&(w=To(o,"bias","fused matMul"),[w]=ho(w,l),Pa(b,w.shape)),null!=a&&(x=To(a,"prelu weights","fused matMul"));const S=(e,t)=>{const[a,s,l,u]=t,p=gl(Xi(e,l.shape),l,i);let c,d;return n||r?!n&&r?(c=ws(p,s,!1,!1),d=ws(p,a,!0,!1)):n&&!r?(c=ws(s,p,!1,!0),d=ws(a,p,!1,!1)):(c=ws(s,p,!0,!0),d=ws(p,a,!0,!0)):(c=ws(p,s,!1,!0),d=ws(a,p,!0,!1)),null!=o?[c,d,ml(u,p)]:[c,d]},v={a:$,b:_,bias:w,preluActivationWeights:x},k={transposeA:n,transposeB:r,activation:i,leakyreluAlpha:s};if(null==o){const e=Os((e,t,n)=>{const r=_o.runKernel(Sr,v,k);return n([e,t,r]),{value:Xi(r,b),gradFunc:S}});return e($,_)}{const e=Os((e,t,n,r)=>{const o=_o.runKernel(Sr,v,k);return r([e,t,o,n]),{value:Xi(o,b),gradFunc:S}});
2return e($,_,w)}}}),Mj=No({sparseToDense_:function(e,t,n,r=0){const o=To(e,"sparseIndices","sparseToDense","int32"),i=To(t,"sparseValues","sparseToDense"),a=To(r,"defaultValue","sparseToDense",i.dtype);!function(e,t,n,r){if("int32"!==e.dtype)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}.`);const o=e.rank>0?e.shape[0]:1,i=e.rank>1?e.shape[1]:1;if(n.length!==i)throw new Error(`outputShape has incorrect number of elements:, ${n.length}, should be: ${i}.`);const a=t.size;if(0!==t.rank&&(1!==t.rank||a!==o))throw new Error(`sparseValues has incorrect shape ${t.shape}, should be [] or [${o}]`);if(t.dtype!==r.dtype)throw new Error("sparseValues.dtype must match defaultValues.dtype")}(o,i,n,a);const s={sparseIndices:o,sparseValues:i,defaultValue:a},l={outputShape:n};return _o.runKernel(nr,s,l)}}),Dj=No({denseBincount_:function(e,t,n,r=!1){const o=To(e,"x","denseBincount"),i=To(t,"weights","denseBincount");q("int32"===o.dtype,()=>`Error in denseBincount: input dtype must be int32, but got ${o.dtype}`),q(o.rank<=2,()=>`Error in denseBincount: input must be at most rank 2, but got rank ${o.rank}.`),q(n>=0,()=>`size must be non-negative, but got ${n}.`),q(i.size===o.size||0===i.size,()=>`Error in denseBincount: weights must have the same shape as x or 0-length, but got x shape: ${o.shape}, weights shape: ${i.shape}.`);const a={x:o,weights:i},s={size:n,binaryOutput:r};return _o.runKernel(ct,a,s)}}),Oj=No({scatterND_:function(e,t,n){const r=To(e,"indices","scatterND","int32"),o=To(t,"updates","scatterND");Fl(o,r,n);const i={indices:r,updates:o},a={shape:n};return _o.runKernel(Bn,i,a)}}),Rj=No({gatherND_:function(e,t){const n=To(t,"indices","gatherND","int32"),r={params:To(e,"x","gatherND","string_or_numeric"),indices:n};return _o.runKernel(At,r)}}),Bj=No({broadcastArgs_:function(e,t){const n=To(e,"s0","broadcastArgs","int32"),r=To(t,"s1","broadcastArgs","int32");if(1!==n.rank)throw new Error(`broadcastArgs(): first input must be a vector (rank=1). Has rank ${n.rank}`);if(1!==r.rank)throw new Error(`broadcastArgs(): second input must be a vector (rank=1). Has rank ${r.rank}`);const o={s0:n,s1:r};return _o.runKernel("BroadcastArgs",o)}});function Pj(e,t,n,r){const o=((e,t,n)=>{switch(e.category){case"arithmetic":return ms(()=>((e,t,n)=>{switch(e.op){case"BiasAdd":case"AddV2":case"Add":return[Vi(wN("a",e,t,n),wN("b",e,t,n))];case"AddN":return[uj(wN("tensors",e,t,n))];case"FloorMod":case"Mod":return[hd(wN("a",e,t,n),wN("b",e,t,n))];case"Mul":return[Ki(wN("a",e,t,n),wN("b",e,t,n))];case"RealDiv":case"Div":return[qi(wN("a",e,t,n),wN("b",e,t,n))];case"DivNoNan":return[Zc(wN("a",e,t,n),wN("b",e,t,n))];case"FloorDiv":return[Gi(wN("a",e,t,n),wN("b",e,t,n))];case"Sub":return[za(wN("a",e,t,n),wN("b",e,t,n))];case"Minimum":return[js(wN("a",e,t,n),wN("b",e,t,n))];case"Maximum":return[Nc(wN("a",e,t,n),wN("b",e,t,n))];case"Pow":return[us(wN("a",e,t,n),wN("b",e,t,n))];case"SquaredDifference":return[Cs(wN("a",e,t,n),wN("b",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"basic_math":return ms(()=>((e,t,n)=>{switch(e.op){case"Abs":case"ComplexAbs":return[Za(wN("x",e,t,n))];case"Acos":return[Ac(wN("x",e,t,n))];case"Acosh":return[Cc(wN("x",e,t,n))];case"Asin":return[Bc(wN("x",e,t,n))];case"Asinh":return[Pc(wN("x",e,t,n))];case"Atan":return[Lc(wN("x",e,t,n))];case"Atan2":return[Wc(wN("x",e,t,n),wN("y",e,t,n))];case"Atanh":return[Uc(wN("x",e,t,n))];case"Ceil":return[Hc(wN("x",e,t,n))];case"Complex":return[jo(wN("real",e,t,n),wN("imag",e,t,n))];case"Cos":return[sc(wN("x",e,t,n))];case"Cosh":return[uc(wN("x",e,t,n))];case"Elu":return[ul(wN("x",e,t,n))];case"Erf":return[ed(wN("x",e,t,n))];case"Exp":return[Ms(wN("x",e,t,n))];case"Expm1":return[td(wN("x",e,t,n))];case"Floor":return[Op(wN("x",e,t,n))];case"Log":return[As(wN("x",e,t,n))];case"Log1p":return[Ds(wN("x",e,t,n))];case"Imag":return[na(wN("x",e,t,n))];case"Neg":return[xs(wN("x",e,t,n))];case"Reciprocal":return[bd(wN("x",e,t,n))];case"Real":return[ra(wN("x",e,t,n))];case"Relu":return[Ns(wN("x",e,t,n))];case"Round":return[Va(wN("x",e,t,n))];case"Selu":return[$d(wN("x",e,t,n))];case"Sigmoid":return[hl(wN("x",e,t,n))];case"Sin":return[zu(wN("x",e,t,n))];case"Sign":return[wd(wN("x",e,t,n))];case"Sinh":return[Hu(wN("x",e,t,n))];case"Softplus":return[ad(wN("x",e,t,n))];case"Sqrt":return[ps(wN("x",e,t,n))];case"Square":return[cs(wN("x",e,t,n))];case"Tanh":return[kd(wN("x",e,t,n))];case"Tan":return[vd(wN("x",e,t,n))];case"ClipByValue":return[Gc(wN("x",e,t,n),wN("clipValueMin",e,t,n),wN("clipValueMax",e,t,n))];case"Relu6":return[dl(wN("x",e,t,n))];case"Rsqrt":return[ap(xN(e.inputNames[0],t,n))];case"Prod":return[yd(wN("x",e,t,n),wN("axes",e,t,n))];case"LeakyRelu":return[pl(wN("x",e,t,n),wN("alpha",e,t,n))];case"Prelu":return[cl(wN("x",e,t,n),wN("alpha",e,t,n))];case"IsNan":return[od(xN(e.inputNames[0],t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"control":return(async(e,t,n)=>{switch(e.op){case"If":case"StatelessIf":{const r=wN("thenBranch",e,t,n),o=wN("elseBranch",e,t,n),i=wN("cond",e,t,n),a=wN("args",e,t,n);return(await i.data())[0]?n.functionMap[r].executeFunctionAsync(a,n.tensorArrayMap,n.tensorListMap):n.functionMap[o].executeFunctionAsync(a,n.tensorArrayMap,n.tensorListMap)}case"While":case"StatelessWhile":{const r=wN("body",e,t,n),o=wN("cond",e,t,n),i=wN("args",e,t,n),a=await n.functionMap[o].executeFunctionAsync(i,n.tensorArrayMap,n.tensorListMap),s=i.map(e=>e.id);let l=await a[0].data();
vendor: 6,961 bytes, line 2
2a.forEach(e=>{e.kept||-1!==s.indexOf(e.id)||e.dispose()});let u=i;for(;l[0];){const e=u;u=await n.functionMap[r].executeFunctionAsync(u,n.tensorArrayMap,n.tensorListMap);const t=u.map(e=>e.id);e.forEach(e=>{e.kept||-1!==s.indexOf(e.id)||-1!==t.indexOf(e.id)||e.dispose()});const i=await n.functionMap[o].executeFunctionAsync(u,n.tensorArrayMap,n.tensorListMap);l=await i[0].data(),i.forEach(e=>{e.kept||-1!==s.indexOf(e.id)||-1!==t.indexOf(e.id)||e.dispose()})}return u}case"LoopCond":return[IN(wN("pred",e,t,n))];case"Switch":{const r=wN("pred",e,t,n);let o=wN("data",e,t,n);return o.kept||(o=IN(o)),(await r.data())[0]?[void 0,o]:[o,void 0]}case"Merge":{const r=e.inputNames.find(e=>void 0!==xN(e,t,n));return r?[IN(xN(r,t,n))]:void 0}case"Enter":{const r=wN("frameName",e,t,n),o=wN("tensor",e,t,n);return n.enterFrame(r),[IN(o)]}case"Exit":{const r=wN("tensor",e,t,n);return n.exitFrame(),[IN(r)]}case"NextIteration":{const r=wN("tensor",e,t,n);return n.nextIteration(),[IN(r)]}case"TensorArrayV3":{const r=wN("size",e,t,n),o=wN("dtype",e,t,n),i=wN("elementShape",e,t,n),a=wN("dynamicSize",e,t,n),s=wN("clearAfterRead",e,t,n),l=wN("identicalElementShapes",e,t,n),u=wN("name",e,t,n),p=new fj(u,o,r,i,l,a,s);return n.addTensorArray(p),[p.idTensor,Yi(1)]}case"TensorArrayWriteV3":{const r=wN("tensorArrayId",e,t,n),o=wN("index",e,t,n),i=wN("tensor",e,t,n),a=n.getTensorArray(r.id);return a.write(o,i),[a.idTensor]}case"TensorArrayReadV3":{const r=wN("tensorArrayId",e,t,n),o=wN("index",e,t,n);return[n.getTensorArray(r.id).read(o)]}case"TensorArrayGatherV3":{const r=wN("tensorArrayId",e,t,n),o=wN("indices",e,t,n),i=wN("dtype",e,t,n);return[n.getTensorArray(r.id).gather(o,i)]}case"TensorArrayScatterV3":{const r=wN("tensorArrayId",e,t,n),o=wN("indices",e,t,n),i=wN("tensor",e,t,n),a=n.getTensorArray(r.id);return a.scatter(o,i),[a.idTensor]}case"TensorArrayConcatV3":{const r=wN("tensorArrayId",e,t,n),o=n.getTensorArray(r.id),i=wN("dtype",e,t,n);return[o.concat(i)]}case"TensorArraySplitV3":{const r=wN("tensorArrayId",e,t,n),o=wN("tensor",e,t,n),i=wN("lengths",e,t,n),a=n.getTensorArray(r.id);return a.split(i,o),[a.idTensor]}case"TensorArraySizeV3":{const r=wN("tensorArrayId",e,t,n);return[Yi(n.getTensorArray(r.id).size(),"int32")]}case"TensorArrayCloseV3":{const r=wN("tensorArrayId",e,t,n),o=n.getTensorArray(r.id);return o.clearAndClose(),[o.idTensor]}case"TensorListSetItem":{const r=wN("tensorListId",e,t,n),o=wN("index",e,t,n),i=wN("tensor",e,t,n),a=n.getTensorList(r.id);return a.setItem(o,i),[a.idTensor]}case"TensorListGetItem":{const r=wN("tensorListId",e,t,n),o=wN("index",e,t,n),i=wN("elementShape",e,t,n),a=wN("elementDType",e,t,n);return[n.getTensorList(r.id).getItem(o,i,a)]}case"TensorListScatterV2":case"TensorListScatter":{const r=wN("indices",e,t,n),o=function(e,t,n,r){if(t.length!==e.shape[0])throw new Error(`Expected len(indices) == tensor.shape[0], but saw: ${t.length} vs. ${e.shape[0]}`);const o=Math.max(...t);if(null!=r&&-1!==r&&o>=r)throw new Error(`Max index must be < array size (${o}  vs. ${r})`);const i=new gj([],n,e.dtype,r),a=ea(e,0);return t.forEach((e,t)=>{i.setItem(e,a[t])}),i}(wN("tensor",e,t,n),r,wN("elementShape",e,t,n),wN("numElements",e,t,n));return n.addTensorList(o),[o.idTensor]}case"TensorListReserve":case"EmptyTensorList":{const r=wN("elementShape",e,t,n),o=wN("elementDType",e,t,n);let i;i="TensorListReserve"===e.op?"numElements":"maxNumElements";const a=function(e,t,n){return new gj([],e,t,n)}(r,o,wN(i,e,t,n));return n.addTensorList(a),[a.idTensor]}case"TensorListGather":{const r=wN("tensorListId",e,t,n),o=wN("indices",e,t,n),i=wN("elementShape",e,t,n),a=wN("elementDType",e,t,n);return[n.getTensorList(r.id).gather(o,a,i)]}case"TensorListStack":{const r=wN("tensorListId",e,t,n),o=wN("elementShape",e,t,n),i=wN("elementDType",e,t,n),a=wN("numElements",e,t,n);return[n.getTensorList(r.id).stack(o,i,a)]}case"TensorListFromTensor":{const r=function(e,t,n){const r=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}`);pj(e.shape.slice(1),t,"TensorList shape mismatch: ");const o=ea(e);return new gj(o,t,r)}(wN("tensor",e,t,n),wN("elementShape",e,t,n),wN("elementDType",e,t,n));return n.addTensorList(r),[r.idTensor]}case"TensorListConcat":{const r=wN("tensorListId",e,t,n),o=n.getTensorList(r.id),i=wN("dtype",e,t,n),a=wN("elementShape",e,t,n);return[o.concat(i,a)]}case"TensorListPushBack":{const r=wN("tensorListId",e,t,n),o=wN("tensor",e,t,n),i=n.getTensorList(r.id);return i.pushBack(o),[i.idTensor]}case"TensorListPopBack":{const r=wN("tensorListId",e,t,n),o=wN("elementShape",e,t,n),i=wN("elementDType",e,t,n);return[n.getTensorList(r.id).popBack(o,i)]}case"TensorListSplit":{const r=wN("tensor",e,t,n),o=wN("elementShape",e,t,n),i=function(e,t,n){let r=0;const o=t.map(e=>(r+=e,r));if(r!==e.shape[0])throw new Error(`Expected sum of lengths to be equal to\n          tensor.shape[0], but sum of lengths is\n        ${r}, and tensor's shape is: ${e.shape}`);const i=hj(e.shape.slice(1),n),a=0===r?0:e.size/r,s=ms(()=>{const n=[];e=Xi(e,[1,r,a]);for(let r=0;r<t.length;++r){const s=[0,0===r?0:o[r-1],0],l=[1,t[r],a];n[r]=Xi(Ji(e,s,l),i)}return e.dispose(),n}),l=new gj([],n,e.dtype,t.length);for(let e=0;e<s.length;e++)l.setItem(e,s[e]);return l}(r,wN("lengths",e,t,n),o);return n.addTensorList(i),[i.idTensor]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n);case"convolution":return ms(()=>((e,t,n)=>{switch(e.op){case"Conv1D":{const r=wN("stride",e,t,n),o=wN("pad",e,t,n),i=wN("dataFormat",e,t,n).toUpperCase(),a=wN("dilation",e,t,n);return[qc(wN("x",e,t,n),wN("filter",e,t,n),r,o,i,a)]}case"Conv2D":{const r=wN("strides",e,t,n),o=EN(e,t,n),i=wN("dataFormat",e,t,n).toUpperCase(),a=wN("dilations",e,t,n);return[Bu(wN("x",e,t,n),wN("filter",e,t,n),[r[1],r[2]],o,i,[a[1],a[2]])]}case"_FusedConv2D":{const{stride:r,pad:o,dataFormat:i,dilations:a,biasArg:s,preluArg:l,activationFunc:u,leakyreluAlpha:p}=xj(e,t,n);return[mj({x:wN("x",e,t,n),filter:wN("filter",e,t,n),strides:[r[1],r[2]],pad:o,dataFormat:i,dilations:[a[1],a[2]],bias:s,activation:u,preluActivationWeights:l,leakyreluAlpha:p})]}case"FusedDepthwiseConv2dNative":{const{stride:r,pad:o,dataFormat:i,dilations:a,biasArg:s,preluArg:l,activationFunc:u,leakyreluAlpha:p}=xj(e,t,n);return[yj({x:wN("x",e,t,n),filter:wN("filter",e,t,n),strides:[r[1],r[2]],pad:o,dataFormat:i,dilations:[a[1],a[2]],bias:s,activation:u,preluActivationWeights:l,leakyreluAlpha:p})]}case"Conv2DBackpropInput":case"Conv2dTranspose":{const r=wN("outputShape",e,t,n),o=wN("strides",e,t,n),i=EN(e,t,n);return[Kc(wN("x",e,t,n),wN("filter",e,t,n),r,[o[1],o[2]],i)]}case"DepthwiseConv2dNative":case"DepthwiseConv2d":{const r=wN("strides",e,t,n),o=EN(e,t,n),i=wN("dilations",e,t,n),a=wN("dataFormat",e,t,n).toUpperCase();return[Yc(wN("input",e,t,n),wN("filter",e,t,n),[r[1],r[2]],o,a,[i[
21],i[2]])]}case"Conv3D":{const r=wN("strides",e,t,n),o=wN("pad",e,t,n),i=wN("dataFormat",e,t,n).toUpperCase(),a=wN("dilations",e,t,n);return[bj(wN("x",e,t,n),wN("filter",e,t,n),[r[1],r[2],r[3]],o,i,[a[1],a[2],a[3]])]}case"AvgPool":{const r=wN("strides",e,t,n),o=wN("pad",e,t,n),i=wN("kernelSize",e,t,n);return[zc(wN("x",e,t,n),[i[1],i[2]],[r[1],r[2]],o)]}case"MaxPool":{const r=wN("strides",e,t,n),o=wN("pad",e,t,n),i=wN("kernelSize",e,t,n);return[cd(wN("x",e,t,n),[i[1],i[2]],[r[1],r[2]],o)]}case"MaxPoolWithArgmax":{const r=wN("strides",e,t,n),o=wN("pad",e,t,n),i=wN("kernelSize",e,t,n),a=wN("includeBatchInIndex",e,t,n),{result:s,indexes:l}=$j(wN("x",e,t,n),[i[1],i[2]],[r[1],r[2]],o,a);return[s,l]}case"AvgPool3D":{const r=wN("strides",e,t,n),o=wN("pad",e,t,n),i=wN("kernelSize",e,t,n);return[_j(wN("x",e,t,n),[i[1],i[2],i[3]],[r[1],r[2],r[3]],o)]}case"MaxPool3D":{const r=wN("strides",e,t,n),o=wN("pad",e,t,n),i=wN("kernelSize",e,t,n);return[wj(wN("x",e,t,n),[i[1],i[2],i[3]],[r[1],r[2],r[3]],o)]}case"Dilation2D":{const r=wN("strides",e,t,n),o=wN("pad",e,t,n),i=wN("dilations",e,t,n),a=r[1],s=r[2],l=i[1],u=i[2];return[Jc(wN("x",e,t,n),wN("filter",e,t,n),[a,s],o,[l,u],"NHWC")]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"creation":return ms(()=>((e,t,n)=>{switch(e.op){case"Fill":{const r=wN("shape",e,t,n),o=wN("dtype",e,t,n);return[ha(r,wN("value",e,t,n),o)]}case"LinSpace":return[Sj(wN("start",e,t,n),wN("stop",e,t,n),wN("num",e,t,n))];case"Multinomial":{const r=wN("logits",e,t,n),o=wN("numSamples",e,t,n),i=wN("seed",e,t,n);return[vj(r,o,i)]}case"OneHot":{const r=wN("indices",e,t,n),o=wN("depth",e,t,n),i=wN("onValue",e,t,n),a=wN("offValue",e,t,n);return[fd(r,o,i,a)]}case"Ones":return[Ts(wN("shape",e,t,n),wN("dtype",e,t,n))];case"OnesLike":return[gd(wN("x",e,t,n))];case"RandomUniform":return[Ij(wN("shape",e,t,n),wN("minval",e,t,n),wN("maxval",e,t,n),wN("dtype",e,t,n))];case"Range":return[qa(wN("start",e,t,n),wN("stop",e,t,n),wN("step",e,t,n),wN("dtype",e,t,n))];case"TruncatedNormal":{const r=wN("shape",e,t,n),o=wN("mean",e,t,n),i=wN("stdDev",e,t,n),a=wN("seed",e,t,n);return[Tj(r,o,i,wN("dtype",e,t,n),a)]}case"Zeros":return[ta(wN("shape",e,t,n),wN("dtype",e,t,n))];case"ZerosLike":return[oa(wN("x",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"dynamic":return(async(e,t,n)=>{switch(e.op){case"NonMaxSuppressionV5":{const{boxes:r,scores:o,maxOutputSize:i,iouThreshold:a,scoreThreshold:s,softNmsSigma:l}=Nj(e,t,n),u=await Hs.nonMaxSuppressionWithScoreAsync(r,o,i,a,s,l);return[u.selectedIndices,u.selectedScores]}case"NonMaxSuppressionV4":{const{boxes:r,scores:o,maxOutputSize:i,iouThreshold:a,scoreThreshold:s}=Nj(e,t,n),l=wN("padToMaxOutputSize",e,t,n),u=await Hs.nonMaxSuppressionPaddedAsync(r,o,i,a,s,l);return[u.selectedIndices,u.validOutputs]}case"NonMaxSuppressionV3":case"NonMaxSuppressionV2":{const{boxes:r,scores:o,maxOutputSize:i,iouThreshold:a,scoreThreshold:s}=Nj(e,t,n);return[await Hs.nonMaxSuppressionAsync(r,o,i,a,s)]}case"Where":{const r=hi(wN("condition",e,t,n),"bool"),o=[await Fj(r)];return r.dispose(),o}case"ListDiff":return async function(e,t){const n=To(e,"x","setdiff1d"),r=To(t,"y","setdiff1d");q(n.dtype===r.dtype,()=>`x and y should have the same dtype, but got x (${n.dtype}) and y (${r.dtype}).`),q(1===n.rank,()=>`x should be 1D tensor, but got x (${n.shape}).`),q(1===r.rank,()=>`y should be 1D tensor, but got y (${r.shape}).`);const o=await n.data(),i=await r.data(),a=new Set(i);let s=0;for(let e=0;e<o.length;e++)a.has(o[e])||s++;const l=new Jr([s],n.dtype),u=new Jr([s],"int32");for(let e=0,t=0;e<o.length;e++)a.has(o[e])||(l.values[t]=o[e],u.values[t]=e,t++);return[l.toTensor(),u.toTensor()]}(wN("x",e,t,n),wN("y",e,t,n));default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n);case"evaluation":return ms(()=>((e,t,n)=>{switch(e.op){case"TopKV2":{const r=wN("x",e,t,n),o=wN("k",e,t,n),i=wN("sorted",e,t,n),a=Ed(r,o,i);return[a.values,a.indices]}case"Unique":{const r=wN("x",e,t,n),o=Id(r);return[o.values,o.indices]}case"UniqueV2":{const r=wN("x",e,t,n),o=wN("axis",e,t,n),i=Id(r,o);return[i.values,i.indices]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"image":return ms(()=>((e,t,n)=>{switch(e.op){case"ResizeBilinear":{const r=wN("images",e,t,n),o=wN("size",e,t,n),i=wN("alignCorners",e,t,n),a=wN("halfPixelCenters",e,t,n);return[Hs.resizeBilinear(r,[o[0],o[1]],i,a)]}case"ResizeNearestNeighbor":{const r=wN("images",e,t,n),o=wN("size",e,t,n),i=wN("alignCorners",e,t,n),a=wN("halfPixelCenters",e,t,n);return[Hs.resizeNearestNeighbor(r,[o[0],o[1]],i,a)]}case"CropAndResize":{const r=wN("image",e,t,n),o=wN("boxes",e,t,n),i=wN("boxInd",e,t,n),a=wN("cropSize",e,t,n),s=wN("method",e,t,n),l=wN("extrapolationValue",e,t,n);return[Hs.cropAndResize(r,o,i,a,s,l)]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"graph":return ms(()=>((e,t,n)=>{switch(e.op){case"Const":return t[e.name];case"PlaceholderWithDefault":const r=wN("default",e,t,n);return[xN(e.name,t,n)||r];case"Placeholder":return[xN(e.name,t,n)];case"Identity":case"StopGradient":case"FakeQuantWithMinMaxVars":case"Snapshot":return[IN(wN("x",e,t,n))];case"IdentityN":return wN("x",e,t,n).map(e=>IN(e));case"Shape":return[pa(wN("x",e,t,n).shape,"int32")];case"ShapeN":return wN("x",e,t,n).map(e=>pa(e.shape));case"Size":return[Yi(wN("x",e,t,n).size,"int32")];case"Rank":return[Yi(wN("x",e,t,n).rank,"int32")];case"NoOp":return[Yi(1)];case"Print":const o=wN("x",e,t,n),i=wN("data",e,t,n),a=wN("message",e,t,n),s=wN("summarize",e,t,n);console.warn("The graph has a tf.print() operation,usually used for debugging, which slows down performance."),console.log(a);for(let e=0;e<i.length;e++)console.log(Array.prototype.slice.call(i[e].dataSync()).slice(0,s));return[o];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"logical":return ms(()=>((e,t,n)=>{switch(e.op){case"Equal":return[Sp(wN("a",e,t,n),wN("b",e,t,n))];case"NotEqual":return[Is(wN("a",e,t,n),wN("b",e,t,n))];case"Greater":return[Wa(wN("a",e,t,n),wN("b",e,t,n))];case"GreaterEqual":return[Ya(wN("a",e,t,n),wN("b",e,t,n))];case"Less":return[Ep(wN("a",e,t,n),wN("b",e,t,n))];case"LessEqual":return[La(wN("a",e,t,n),wN("b",e,t,n))];case"LogicalAnd":return[Ja(wN("a",e,t,n),wN("b",e,t,n))];case"LogicalNot":return[nc(wN("a",e,t,n))];case"LogicalOr":return[ud(wN("a",e,t,n),wN("b",e,t,n))];case"Select":case"SelectV2":return[Ga(wN("condition",e,t,n),wN("a",e,t,n),wN("b",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"matrices":return ms(()=>((e,t,n)=>{switch(e.op){case"BatchMatMul":case"BatchMatMulV2":case"MatMul":return[ws(wN("a",e,t,n),wN("b",e,t,n),wN("transposeA",e,t,n),wN("transposeB",e,t,n))];case"Einsum":return[Aj(wN("equation",e,t,n),...wN("tensors",e,t,n))];case"Transpose":return[Ss(wN("x",e,t,n),wN("perm",e,t,n))];case"_FusedMatMul":const[r,o]=wN("fusedOps",e,t,n),i="biasadd"===r,a="prelu"===o,s=wN("numArgs",e,t,n),l=wN("leakyreluAlpha",e,t,n);if(i){if(a&&2!==s)throw new Error("Fused MatMul with BiasAdd and Prelu must have two extra arguments: bias and alpha.");if(!a&&1!==s)throw new Error("Fused MatMul with BiasAdd must have one extra argument: bias.")}const[u,p]=wN("args",e,t,n);return[Cj({a:wN("a",e,t,n),b:wN("b",e,t,n),transposeA:wN("transposeA",e,t,n),transposeB:wN("transposeB",e,t,n),bias:u,activation:o,preluActivationWeights:p,leakyreluAlpha:l})];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"normalization":return ms(()=>((e,t,n)=>{switch(e.op){case"FusedBatchNorm":case"FusedBatchNormV2":case"FusedBatchNormV3":return[Vc(wN("x",e,t,n),wN("mean",e,t,n),wN("variance",e,t,n),wN("offset",e,t,n),wN("scale",e,t,n),wN("epsilon",e,t,n))];case"LRN":return[id(wN("x",e,t,n),wN("radius",e,t,n),wN("bias",e,t,n),wN("alpha",e,t,n),wN("beta",e,t,n))];case"Softmax":return[xd(wN("x",e,t,n))];case"LogSoftmax":return[ld(wN("x",e,t,n))];case"SparseToDense":return[Mj(wN("sparseIndices",e,t,n),wN("outputShape",e,t,n),wN("sparseValues",e,t,n),wN("defaultValue",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"reduction":return ms(()=>((e,t,n)=>{switch(e.op){case"Max":{const r=wN("axis",e,t,n),o=wN("keepDims",e,t,n);return[ss(wN("x",e,t,n),r,o)]}case"Mean":{const r=wN("axis",e,t,n),o=wN("keepDims",e,t,n);return[Es(wN("x",e,t,n),r,o)]}case"Min":{const r=wN("axis",e,t,n),o=wN("keepDims",e,t,n);return[ls(wN("x",e,t,n),r,o)]}case"Sum":{const r=wN("axis",e,t,n),o=wN("keepDims",e,t,n);return[Ua(wN("x",e,t,n),r,o)]}case"All":{const r=wN("axis",e,t,n),o=wN("keepDims",e,t,n);return[Mc(wN("x",e,t,n),r,o)]}case"Any":{const r=wN("axis",e,t,n),o=wN("keepDims",e,t,n);return[Dc(wN("x",e,t,n),r,o)]}case"ArgMax":{const r=wN("axis",e,t,n);return[Oc(wN("x",e,t,n),r)]}case"ArgMin":{const r=wN("axis",e,t,n);return[Rc(wN("x",e,t,n),r)]}case"Prod":{const r=wN("axis",e,t,n),o=wN("keepDims",e,t,n);return[yd(wN("x",e,t,n),r,o)]}case"Cumsum":{const r=wN("axis",e,t,n),o=wN("exclusive",e,t,n),i=wN("reverse",e,t,n);return[qu(wN("x",e,t,n),r,o,i)]}case"Bincount":const r=wN("x",e,t,n),o=wN("weights",e,t,n),i=wN("size",e,t,n);return[Oa(r,o,i)];case"DenseBincount":{const r=wN("x",e,t,n),o=wN("weights",e,t,n),i=wN("size",e,t,n),a=wN("binaryOutput",e,t,n);return[Dj(r,o,i,a)]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"slice_join":return ms(()=>((e,t,n)=>{switch(e.op){case"ConcatV2":case"Concat":{const r=wN("n",e,t,n),o=wN("axis",e,t,n);let i=wN("tensors",e,t,n);return i=i.slice(0,r),[Hi(i,o)]}case"Gather":{const r=wN("x",e,t,n),o=wN("indices",e,t,n);return[Fc(r,hi(o,"int32"),0)]}case"GatherV2":{const r=wN("axis",e,t,n),o=wN("batchDims",e,t,n),i=wN("x",e,t,n),a=wN("indices",e,t,n);return[Fc(i,hi(a,"int32"),r,o)]}case"Reverse":{const r=wN("dims",e,t,n),o=[];for(let e=0;e<r.length;e++)r[e]&&o.push(e);const i=wN("x",e,t,n);return[la(i,o)]}case"ReverseV2":{const r=wN("axis",e,t,n),o=wN("x",e,t,n);return[la(o,r)]}case"Slice":{const r=wN("begin",e,t,n),o=wN("size",e,t,n);return[Ji(wN("x",e,t,n),r,o)]}
2case"StridedSlice":{const r=wN("begin",e,t,n),o=wN("end",e,t,n),i=wN("strides",e,t,n),a=wN("beginMask",e,t,n),s=wN("endMask",e,t,n),l=wN("ellipsisMask",e,t,n),u=wN("newAxisMask",e,t,n),p=wN("shrinkAxisMask",e,t,n),c=wN("x",e,t,n);return[Sd(c,r,o,i,a,s,l,u,p)]}case"Pack":return ms(()=>{const r=wN("axis",e,t,n),o=wN("tensors",e,t,n),i=o[0].shape,a=fs(o[0]).shape,s=o.map(e=>{const t=Z(e.shape,i);if(!t&&!Z(fs(e).shape,a))throw new Error("the input tensors shape does not match");return t?e:Xi(e,i)});return[Qi(s,r)]});case"Unpack":{const r=wN("axis",e,t,n),o=wN("tensor",e,t,n);return ea(o,r)}case"Tile":{const r=wN("reps",e,t,n);return[ba(wN("x",e,t,n),r)]}case"Split":case"SplitV":{const r=wN("axis",e,t,n),o=wN("numOrSizeSplits",e,t,n),i=wN("x",e,t,n);return Zi(i,o,r)}case"ScatterNd":{const r=wN("indices",e,t,n),o=wN("values",e,t,n),i=wN("shape",e,t,n);return[Oj(r,o,i)]}case"GatherNd":{const r=wN("x",e,t,n),o=wN("indices",e,t,n);return[Rj(r,o)]}case"SparseToDense":{const r=wN("sparseIndices",e,t,n),o=wN("outputShape",e,t,n),i=wN("sparseValues",e,t,n),a=wN("defaultValue",e,t,n);return[Mj(r,i,o,i.dtype===a.dtype?a:hi(a,i.dtype))]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"sparse":return ms(()=>((e,t,n)=>{switch(e.op){case"SparseFillEmptyRows":{const{outputIndices:r,outputValues:o,emptyRowIndicator:i,reverseIndexMap:a}=Gs.sparseFillEmptyRows(wN("indices",e,t,n),wN("values",e,t,n),wN("denseShape",e,t,n),wN("defaultValue",e,t,n));return[r,o,i,a]}case"SparseReshape":{const{outputIndices:r,outputShape:o}=Gs.sparseReshape(wN("inputIndices",e,t,n),wN("inputShape",e,t,n),wN("newShape",e,t,n));return[r,o]}case"SparseSegmentMean":return[Gs.sparseSegmentMean(wN("data",e,t,n),wN("indices",e,t,n),wN("segmentIds",e,t,n))];case"SparseSegmentSum":return[Gs.sparseSegmentSum(wN("data",e,t,n),wN("indices",e,t,n),wN("segmentIds",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"spectral":return ms(()=>((e,t,n)=>{switch(e.op){case"FFT":return[ia(wN("x",e,t,n))];case"IFFT":return[sa(wN("x",e,t,n))];case"RFFT":return[aa(wN("x",e,t,n))];case"IRFFT":return[ua(wN("x",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"string":return ms(()=>((e,t,n)=>{switch(e.op){case"StringNGrams":{const{nGrams:r,nGramsSplits:o}=qs.stringNGrams(wN("data",e,t,n),wN("dataSplits",e,t,n),wN("separator",e,t,n),wN("nGramWidths",e,t,n),wN("leftPad",e,t,n),wN("rightPad",e,t,n),wN("padWidth",e,t,n),wN("preserveShortSequences",e,t,n));return[r,o]}case"StringSplit":{const{indices:r,values:o,shape:i}=qs.stringSplit(wN("input",e,t,n),wN("delimiter",e,t,n),wN("skipEmpty",e,t,n));return[r,o,i]}case"StringToHashBucketFast":return[qs.stringToHashBucketFast(wN("input",e,t,n),wN("numBuckets",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"transformation":return ms(()=>((e,t,n)=>{switch(e.op){case"Cast":return[hi(wN("x",e,t,n),wN("dtype",e,t,n))];case"ExpandDims":{const r=wN("axis",e,t,n);return[$s(wN("x",e,t,n),r)]}case"Squeeze":{const r=wN("axis",e,t,n);return[fs(wN("x",e,t,n),r)]}case"Reshape":return[Xi(wN("x",e,t,n),wN("shape",e,t,n))];case"MirrorPad":return[dd(wN("x",e,t,n),wN("padding",e,t,n),wN("mode",e,t,n))];case"PadV2":case"Pad":return[cc(wN("x",e,t,n),wN("padding",e,t,n),wN("constantValue",e,t,n))];case"SpaceToBatchND":{const r=wN("blockShape",e,t,n),o=wN("paddings",e,t,n);return[Iu(wN("x",e,t,n),r,o)]}case"BatchToSpaceND":{const r=wN("blockShape",e,t,n),o=wN("crops",e,t,n);return[gc(wN("x",e,t,n),r,o)]}case"DepthToSpace":{const r=wN("blockSize",e,t,n),o=wN("dataFormat",e,t,n).toUpperCase();
vendor: 18,698 bytes, line 2
2return[Xc(wN("x",e,t,n),r,o)]}case"BroadcastTo":return[Ha(wN("x",e,t,n),wN("shape",e,t,n))];case"BroadcastArgs":return[Bj(wN("s0",e,t,n),wN("s1",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"hash_table":return(async(e,t,n,r)=>{switch(e.op){case"HashTable":case"HashTableV2":{const o=wN("keyDType",e,t,n),i=wN("valueDType",e,t,n),a=new jj(o,i);return r.addHashTable(e.name,a),[a.handle]}case"LookupTableImport":case"LookupTableImportV2":{const o=wN("tableHandle",e,t,n,r),i=wN("keys",e,t,n),a=wN("values",e,t,n),s=r.getHashTableById(o.id);return[await s.import(i,a)]}case"LookupTableFind":case"LookupTableFindV2":{const o=wN("tableHandle",e,t,n,r),i=wN("keys",e,t,n),a=wN("defaultValue",e,t,n),s=r.getHashTableById(o.id);return[await s.find(i,a)]}case"LookupTableSize":case"LookupTableSizeV2":{const o=wN("tableHandle",e,t,n,r);return[r.getHashTableById(o.id).tensorSize()]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n,r);case"custom":const o=_N(e.op);if(o&&o.customExecutor)return o.customExecutor(new lj(e,t,n));throw TypeError(`Custom op ${e.op} is not registered.`);default:throw TypeError(`Unknown op '${e.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 $e(o)?o.then(e=>[].concat(e)):[].concat(o)}class Lj{constructor(e={},t={},n={},r={}){this.weightMap=e,this.tensorArrayMap=t,this.tensorListMap=n,this.functionMap=r,this.rootContext={id:0,frameName:"",iterationId:0},this.contexts=[this.rootContext],this.lastId=0,this.generateCurrentContextIds()}newFrame(e,t){return{id:e,frameName:t,iterationId:0}}set currentContext(e){this.contexts!==e&&(this.contexts=e,this.generateCurrentContextIds())}get currentContext(){return this.contexts}get currentContextId(){return this._currentContextIds[0]}get currentContextIds(){return this._currentContextIds}generateCurrentContextIds(){const e=[];for(let t=0;t<this.contexts.length-1;t++){const n=this.contexts.slice(0,this.contexts.length-t);e.push(this.contextIdforContexts(n))}e.push(""),this._currentContextIds=e}contextIdforContexts(e){return e?e.map(e=>0===e.id&&0===e.iterationId?"":`${e.frameName}-${e.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))throw new Error("Cannot exit frame, the context is empty");this.contexts=this.contexts.slice(),this.contexts.splice(-1),this.currentContextIds.shift()}nextIteration(){if(!(this.contexts&&this.contexts.length>0))throw new Error("Cannot increase frame iteration, the context is empty");{this.contexts=this.contexts.slice(),this.lastId++;const e=Object.assign({},this.contexts[this.contexts.length-1]);e.iterationId+=1,e.id=this.lastId,this.contexts.splice(-1,1,e),this._currentContextIds.splice(0,1,this.contextIdforContexts(this.contexts))}}getWeight(e){return this.weightMap[e]}addTensorArray(e){this.tensorArrayMap[e.id]=e}getTensorArray(e){return this.tensorArrayMap[e]}addTensorList(e){this.tensorListMap[e.id]=e}getTensorList(e){return this.tensorListMap[e]}dispose(e){for(const t in this.tensorArrayMap)this.tensorArrayMap[t].clearAndClose(e);for(const t in this.tensorListMap)this.tensorListMap[t].clearAndClose(e)}}function Wj(e,t,n,r){const o=new Set,i=[];let a=null,s=null;const l=new Set,u=Object.keys(e).map(e=>kN(e)[0]);let p=[];null!=r&&(p=r.map(e=>kN(e.name)[0]));const c=[...t];for(;c.length>0;){const e=c.pop();(Hj(e)||Gj(e)||qj(e))&&null==a&&(a=e,s=a.children.map(e=>e.name).filter(e=>o.has(e))),o.add(e.name),null==n[e.name]&&-1===u.indexOf(e.name)&&-1===p.indexOf(e.name)&&(0!==e.inputs.length?e.inputs.forEach(e=>{l.has(e.name)||(l.add(e.name),c.push(e))}):i.push(e.name))}return{inputs:e,outputs:t,usedNodes:o,missingInputs:i,dynamicNode:a,syncInputs:s}}const Uj=["Switch","Merge","Enter","Exit","NextIteration","StatelessIf","StatelessWhile","if","While"],zj=["NonMaxSuppressionV2","NonMaxSuppressionV3","NonMaxSuppressionV5","Where"],Vj=["HashTable","HashTableV2","LookupTableImport","LookupTableImportV2","LookupTableFind","LookupTableFindV2","LookupTableSize","LookupTableSizeV2"];function Hj(e){return Uj.indexOf(e.op)>=0}function Gj(e){return zj.indexOf(e.op)>=0}function qj(e){return Vj.indexOf(e.op)>=0}class Kj{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,null!=e.functions&&Object.keys(e.functions).forEach(t=>{this._functionExecutorMap[t]=new Kj(e.functions[t],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){const t=Object.keys(e).map(t=>e[t].map(e=>e.id));this._weightIds=[].concat(...t),this._weightMap=e}set resourceManager(e){this._resourceManager=e}get inputs(){return this._inputs.map(e=>({name:e.name,shape:e.attrParams.shape?e.attrParams.shape.value:void 0,dtype:e.attrParams.dtype?e.attrParams.dtype.value:void 0}))}get outputs(){return this._outputs.map(e=>({name:e.name,shape:e.attrParams.shape?e.attrParams.shape.value:void 0,dtype:e.attrParams.dtype?e.attrParams.dtype.value:void 0}))}get inputNodes(){return this._inputs.map(e=>e.signatureKey||e.name)}get outputNodes(){return this._outputs.map(e=>{const t=e.signatureKey||e.name;return e.defaultOutput?`${t}:${e.defaultOutput}`:t})}get functions(){return Object.keys(this._functions).reduce((e,t)=>(e[t]=this._functions[t].signature,e),{})}getCompilationKey(e,t){const n=e.map(e=>e.name).sort(),r=t.map(e=>e.name).sort();return n.join(this.SEPERATOR)+"--"+r.join(this.SEPERATOR)}compile(e,t){const n=Wj(e,t,this.weightMap,this._initNodes),{missingInputs:r,dynamicNode:o,syncInputs:i}=n;if(null!=o)throw new Error(`This execution contains the node '${o.name}', which has the dynamic op '${o.op}'. Please use model.executeAsync() instead. Alternatively, to avoid the dynamic ops, specify the inputs [${i}]`);if(r.length>0){const n=t.map(e=>e.name),o=Object.keys(e);throw new Error(`Cannot compute the outputs [${n}] from the provided inputs [${o}]. Missing the following inputs: [${r}]`)}return function(e,t,n){const{usedNodes:r,inputs:o}=n,i=[],a=Object.keys(o).map(e=>kN(e)[0]).map(t=>e.nodes[t]),s=e.initNodes;a.forEach(e=>{r.has(e.name)&&i.push(e)}),e.weights.forEach(e=>{r.has(e.name)&&i.push(e)}),null!=s&&s.forEach(e=>{r.has(e.name)&&i.push(e)});const l=new Set,u=[];for(;i.length>0;){const e=i.pop();l.add(e.name),t[e.name]||u.push(e),e.children.forEach(e=>{!l.has(e.name)&&r.has(e.name)&&e.inputs.every(e=>l.has(e.name))&&i.push(e)})}return u}(this.graph,this.weightMap,n)}execute(e,t){e=this.mapInputs(e);const n=Object.keys(e).sort();this.checkInputs(e),this.checkInputShapeAndType(e),t=this.mapOutputs(t),this.checkOutputs(t);const r=n.map(e=>this.graph.nodes[kN(e)[0]]),o=t.map(e=>kN(e)[0]);let i=o.map(e=>this.graph.nodes[e]);0===i.length&&(i=this._outputs);const a=this.getCompilationKey(r,i);let s=this.compiledMap.get(a);null==s&&(s=this.compile(e,i),this.compiledMap.set(a,s));const l={},u={};return ms(()=>{const n=new Lj(this.weightMap,l,u,this.functionExecutorMap),r=Object.assign({},this.weightMap);Object.keys(e).forEach(t=>{const[n,o]=kN(t),i=[];i[o]=e[t],r[n]=i});const i=this.getFrozenTensorIds(r),a={};for(let e=0;e<s.length;e++){const t=s[e];if(!r[t.name]){const e=Pj(t,r,n,this._resourceManager);if($e(e))throw new Error(`The execution of the op '${t.op}' returned a promise. Please use model.executeAsync() instead.`);r[t.name]=e,this.checkTensorForDisposal(t.name,t,r,n,i,o,a)}}return null==this.parent&&n.dispose(i),t.map(e=>xN(e,r,n))})}getFrozenTensorIds(e){const t=[].concat.apply([],Object.keys(e).map(t=>e[t]).map(e=>e.map(e=>e.id)));return new Set(t)}checkTensorForDisposal(e,t,n,r,o,i,a){"control"!==t.category&&-1===i.indexOf(e)&&(n[e].forEach(e=>{null!=e&&(a[e.id]=(a[e.id]||0)+t.children.length)}),t.inputs.forEach(e=>{if("control"!==e.category){const t=function(e,t,n){return t[vN(e,n.currentContextId)]}(e.name,n,r);null!=t&&t.forEach(e=>{if(e&&!e.kept&&!o.has(e.id)){const t=a[e.id];1===t?(e.dispose(),delete a[e.id]):null!=t&&a[e.id]--}})}}))}async executeAsync(e,t){return this._executeAsync(e,t)}async _executeAsync(e,t,n=!1,r={},o={}){n||(e=this.mapInputs(e),this.checkInputs(e),this.checkInputShapeAndType(e),t=this.mapOutputs(t),this.checkOutputs(t));const i=new Lj(this.weightMap,r,o,this.functionExecutorMap),a=await this.executeWithControlFlow(e,i,t,n),s=t.map(e=>xN(e,a,i)),l=s.map(e=>e.id),u=Object.keys(e).map(t=>e[t].id),p=new Set([...l,...u,...this.weightIds]);return Object.keys(a).forEach(e=>{a[e].forEach(e=>{!e||e.kept||e.isDisposed||p.has(e.id)||e.dispose()})}),null==this.parent&&i.dispose(p),s}async executeFunctionAsync(e,t,n){const r=e.reduce((e,t,n)=>(e[this.inputs[n].name]=t,e),{});return this._executeAsync(r,this.outputNodes,!0,t,n)}async executeWithControlFlow(e,t,n,r){const o=Object.keys(e),i=o.map(e=>this.graph.nodes[kN(e)[0]]),a=n.map(e=>kN(e)[0]);let s=a.map(e=>this.graph.nodes[e]);0===s.length&&(s=this._outputs);const{usedNodes:l,missingInputs:u,dynamicNode:p,syncInputs:c}=Wj(e,s,this.weightMap,this._initNodes),d=[...i,...this.graph.weights,...this._initNodes||[]].map(e=>({node:e,contexts:t.currentContext})),h=Object.assign({},this.weightMap);Object.keys(e).forEach(t=>{const[n,r]=kN(t),o=[];o[r]=e[t],h[n]=o});const f={},g=this.getFrozenTensorIds(h),m={};for(;d.length>0;){const e=this.processStack(i,d,t,h,m,g,a,f,l);await Promise.all(e)}null!=p||r||console.warn("This model execution did not contain any nodes with control flow or dynamic output shapes. You can use model.execute() instead.");const y=s.filter(e=>!Hj(e)&&!xN(e.name,h,t)).map(e=>e.name);if(y.length>0){let e="";throw null!=p&&(e=`Alternatively, to avoid the dynamic ops, use model.execute() and specify the inputs [${c}]`),new Error(`Cannot compute the outputs [${y}] from the provided inputs [${o}]. Consider providing the following inputs: [${u}]. ${e}`)}return h}processStack(e,t,n,r,o,i,a,s,l){const u=[];for(;t.length>0;){const e=t.pop();n.currentContext=e.contexts;let p="";if("Enter"===e.node.op&&wN("isConstant",e.node,r,n)&&([p]=SN(e.node.name,n)),null==r[e.node.name]){const c=Pj(e.node,r,n,this._resourceManager);p||([p]=SN(e.node.name,n));const d=n.currentContext;$e(c)?u.push(c.then(u=>(r[p]=u,n.currentContext=d,this.checkTensorForDisposal(p,e.node,r,n,i,a,s),this.processChildNodes(e.node,t,n,r,o,l),u))):(r[p]=c,this.checkTensorForDisposal(p,e.node,r,n,i,a,s),this.processChildNodes(e.node,t,n,r,o,l))}else this.processChildNodes(e.node,t,n,r,o,l)}return u}processChildNodes(e,t,n,r,o,i){e.children.forEach(e=>{const[a]=SN(e.name,n);!o[a]&&i.has(e.name)&&("Merge"===e.op?e.inputNames.some(e=>!!xN(e,r,n))&&(o[a]=!0,t.push({contexts:n.currentContext,node:e})):e.inputNames.every(e=>!!xN(e,r,n))&&(o[a]=!0,t.push({contexts:n.currentContext,node:e})))})}dispose(){Object.keys(this.weightMap).forEach(e=>this.weightMap[e].forEach(e=>e.dispose()))}checkInputShapeAndType(e){Object.keys(e).forEach(t=>{const n=e[t],[r]=kN(t),o=this.graph.nodes[r];if(o.attrParams.shape&&o.attrParams.shape.value){const e=o.attrParams.shape.value;q(e.length===n.shape.length&&n.shape.every((t,n)=>-1===e[n]||e[n]===t),()=>`The shape of dict['${o.name}'] provided in model.execute(dict) must be [${e}], but was [${n.shape}]`)}o.attrParams.dtype&&o.attrParams.dtype.value&&q(n.dtype===o.attrParams.dtype.value,()=>`The dtype of dict['${o.name}'] provided in model.execute(dict) must be ${o.attrParams.dtype.value}, but was ${n.dtype}`)})}mapInputs(e){const t={};for(const n in e)null!=this._signature&&null!=this._signature.inputs&&null!=this._signature.inputs[n]?t[this._signature.inputs[n].name]=e[n]:t[n]=e[n];return t}checkInputs(e){const t=Object.keys(e).filter(e=>{const[t]=kN(e);return null==this.graph.nodes[t]});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(e=>null!=this._signature&&null!=this._signature.outputs&&null!=this._signature.outputs[e]?this._signature.outputs[e].name:e,{})}checkOutputs(e){e.forEach(e=>{const[t]=kN(e);if(!this.graph.nodes[t])throw new Error(`The output '${e}' is not found in the graph`)})}}class Xj{constructor(e={},t={}){this.hashTableNameToHandle=e,this.hashTableMap=t}addHashTable(e,t){this.hashTableNameToHandle[e]=t.handle,this.hashTableMap[t.id]=t}getHashTableHandleByName(e){return this.hashTableNameToHandle[e]}getHashTableById(e){return this.hashTableMap[e]}dispose(){for(const e in this.hashTableMap)this.hashTableMap[e].clearAndClose(),delete this.hashTableMap[e];for(const e in this.hashTableNameToHandle)this.hashTableNameToHandle[e].dispose(),delete this.hashTableNameToHandle[e]}}class Yj{constructor(e,t={}){this.modelUrl=e,this.loadOptions=t,this.version="n/a",null==t&&(this.loadOptions={}),this.resourceManager=new Xj}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(){const e=this.modelUrl;if(null!=e.load)this.handler=e;else if(null!=this.loadOptions.requestInit)this.handler=Si(e,this.loadOptions);else{const r=(t=e,n=this.loadOptions,Wo.getLoadHandlers(t,n));if(0===r.length)r.push(Si(e,this.loadOptions));else if(r.length>1)throw new Error(`Found more than one (${r.length}) load handlers for URL '${[e]}'`);this.handler=r[0]}var t,n}async load(){if(this.findIOHandler(),null==this.handler.load)throw new Error("Cannot proceed with model loading because the IOHandler provided does not have the `load` method implemented.");const e=await this.handler.load();return this.loadSync(e)}loadSync(e){this.artifacts=e;const t=this.artifacts.modelTopology;let n;n=null!=this.artifacts.userDefinedMetadata&&null!=this.artifacts.userDefinedMetadata.signature?this.artifacts.userDefinedMetadata.signature:this.artifacts.signature,this.signature=n,this.version=`${t.versions.producer}.${t.versions.minConsumer}`;const r=function(e,t){const n={};let r,o=0;for(const i of t){const t=i.name,a=i.dtype,s=i.shape,l=J(s);let u;if("quantization"in i){const n=i.quantization;if("uint8"===n.dtype||"uint16"===n.dtype){if(!("min"in n)||!("scale"in n))throw new Error(`Weight ${i.name} with quantization ${n.dtype} doesn't have corresponding metadata min and scale.`)}else{if("float16"!==n.dtype)throw new Error(`Weight ${i.name} has unknown quantization dtype ${n.dtype}. Supported quantization dtypes are: 'uint8', 'uint16', and 'float16'.`);if("float32"!==a)throw new Error(`Weight ${i.name} is quantized with ${n.dtype} which only supports weights of type float32 not ${a}.`)}const s=Mo[n.dtype],p=e.slice(o,o+l*s),c="uint8"===n.dtype?new Uint8Array(p):new Uint16Array(p);if("float32"===a)if("uint8"===n.dtype||"uint16"===n.dtype){u=new Float32Array(c.length);for(let e=0;e<c.length;e++){const t=c[e];u[e]=t*n.scale+n.min}}else{if("float16"!==n.dtype)throw new Error(`Unsupported quantization type ${n.dtype} for weight type float32.`);void 0===r&&(r=Lo()),u=r(c)}else{if("int32"!==a)throw new Error(`Unsupported dtype in weight '${t}': ${a}`);if("uint8"!==n.dtype&&"uint16"!==n.dtype)throw new Error(`Unsupported quantization type ${n.dtype} for weight type int32.`);u=new Int32Array(c.length);for(let e=0;e<c.length;e++){const t=c[e];u[e]=Math.round(t*n.scale+n.min)}}o+=l*s}else if("string"===a){const t=J(i.shape);u=[];for(let n=0;n<t;n++){const t=new Uint32Array(e.slice(o,o+4))[0];o+=4;const n=new Uint8Array(e.slice(o,o+t));u.push(n),o+=t}}else{const r=Mo[a],i=e.slice(o,o+l*r);if("float32"===a)u=new Float32Array(i);else if("int32"===a)u=new Int32Array(i);else if("bool"===a)u=new Uint8Array(i);else{if("complex64"!==a)throw new Error(`Unsupported dtype in weight '${t}': ${a}`);{u=new Float32Array(i);const e=new Float32Array(u.length/2),r=new Float32Array(u.length/2);for(let t=0;t<e.length;t++)e[t]=u[2*t],r[t]=u[2*t+1];const o=Co(e,s,"float32"),a=Co(r,s,"float32");n[t]=jo(o,a),o.dispose(),a.dispose()}}o+=l*r}"complex64"!==a&&(n[t]=Co(u,s,a))}return n}(this.artifacts.weightData,this.artifacts.weightSpecs);if(this.executor=new Kj(qN.Instance.transformGraph(t,this.signature)),this.executor.weightMap=this.convertTensorMapToTensorsMap(r),this.executor.resourceManager=this.resourceManager,null!=e.modelInitializer&&null!=e.modelInitializer.node){const t=qN.Instance.transformGraph(e.modelInitializer);this.initializer=new Kj(t),this.initializer.weightMap=this.executor.weightMap,this.initializer.resourceManager=this.resourceManager,this.initializer.executeAsync({},[])}return!0}async save(e,t){if("string"==typeof e){const t=(n=e,Wo.getSaveHandlers(n));if(0===t.length)throw new Error(`Cannot find any save handlers for URL '${e}'`);if(t.length>1)throw new Error(`Found more than one (${t.length}) save handlers for URL '${e}'`);e=t[0]}var n;if(null==e.save)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 to||Array.isArray(e)))return e;if((e=Array.isArray(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,r)=>(t[n]=e[r],t),{})}normalizeOutputs(e){return e=e||this.outputNodes,Array.isArray(e)?e:[e]}execute(e,t){e=this.normalizeInputs(e),t=this.normalizeOutputs(t);const 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);const 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()}}function Jj(e,t,n=new Map,r=new Set){if(null==e)return null;if(r.has(e))throw new Error("Circular references are not supported.");
vendor: 9,297 bytes, line 2
2if(n.has(e))return n.get(e);const o=t(e);if(o.recurse&&null!==o.value)throw new Error("A deep map function may not return both a value and recurse=true.");if(o.recurse){if(tA(e)){const o=Array.isArray(e)?[]:{};r.add(e);for(const i in e){const a=Jj(e[i],t,n,r);o[i]=a}return r.delete(e),o}throw new Error(`Can't recurse into non-iterable type: ${e}`)}return n.set(e,o.value),o.value}function Zj(e,t=eA){return Qj(e,t)}function Qj(e,t,n=new Set){const r=e[0];if(n.has(r))throw new Error("Circular references are not supported.");const o=t(e);if(o.recurse&&null!==o.value)throw new Error("A deep zip function may not return both a value and recurse=true.");if(o.recurse){if(tA(r)){const o=Array.isArray(r)?[]:{};n.add(r);for(const i in r){const r=Qj(e.map(e=>e[i]),t,n);o[i]=r}return n.delete(r),o}throw new Error(`Can't recurse into non-iterable type: ${r}`)}return o.value}function eA(e){return null===e?null:tA(e[0])?{value:null,recurse:!0}:{value:e,recurse:!1}}function tA(e){let t=!1;if(dh().get("IS_BROWSER"))t=e instanceof TextDecoder;else{const{StringDecoder:n}=__webpack_require__(551);t=e instanceof n}return null!=e&&!ArrayBuffer.isView(e)&&(Array.isArray(e)||"object"==typeof e&&!(e instanceof ny)&&!(e instanceof Promise)&&!t)}function nA(e){return Jj(e,rA)}function rA(e){return e instanceof ny?{value:e.clone(),recurse:!1}:tA(e)?{value:null,recurse:!0}:{value:e,recurse:!1}}class oA{constructor(e){if(this.capacity=e,this.begin=0,this.end=0,null==e)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 0===this.length()}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(const t of e)this.push(t)}pop(){if(this.isEmpty())throw new RangeError("Ring buffer is empty.");this.end=this.wrap(this.end-1);const 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.");const 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.");const t=this.wrap(this.begin+e),n=this.get(t);return this.set(t,this.pop()),n}}class iA extends oA{constructor(){super(iA.INITIAL_CAPACITY)}isFull(){return!1}push(e){super.isFull()&&this.expand(),super.push(e)}unshift(e){super.isFull()&&this.expand(),super.unshift(e)}expand(){const e=2*this.capacity,t=new Array(e),n=this.length();for(let e=0;e<n;e++)t[e]=this.get(this.wrap(this.begin+e));this.data=t,this.capacity=e,this.doubledCapacity=2*this.capacity,this.begin=0,this.end=n}}iA.INITIAL_CAPACITY=32;class aA{async toArray(){const e=[];let t=await this.next();for(;!t.done;)e.push(t.value),t=await this.next();return e}async toArrayForTest(){const e=this.prefetch(100),t=[];let n=await e.next();for(;!n.done;)t.push(n.value),n=await e.next();return t}async resolveFully(){let e=await this.next();for(;!e.done;)e=await this.next()}async resolveWhile(e){let t=await this.next(),n=e(t.value);for(;!t.done&&n;)t=await this.next(),n=e(t.value)}handleErrors(e){return new gA(this,e)}filter(e){return new hA(this,e)}map(e){return new fA(this,e)}mapAsync(e){return new mA(this,e)}serialMapAsync(e){return new mA(this,e).serial()}flatmap(e){return new bA(this,e)}async forEachAsync(e){return this.map(e).resolveFully()}async serialForEach(e){return this.serialMapAsync(e).resolveWhile(e=>!0===e)}rowMajorBatch(e,t=!0){return new dA(this,e,t)}columnMajorBatch(e,t=!0,n=eA){return this.rowMajorBatch(e,t).map(e=>Zj(e,n))}concatenate(e,t){return new $A(new sA([this,e]),t)}take(e){return e<0||null==e?this:new cA(this,e)}skip(e){return e<0||null==e?this:new pA(this,e)}prefetch(e){return new xA(this,e)}shuffle(e,t){return new SA(this,e,t)}serial(){return new uA(this)}}class sA extends aA{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};const e=this.items[this.trav];return this.trav++,{value:nA(e),done:!1}}}class lA extends aA{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}}}class uA extends aA{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()}}class pA extends aA{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++<this.maxCount;){const e=await this.upstream.next();if(e.done)return e;Pb(e.value)}return this.upstream.next()}}class cA extends aA{constructor(e,t){super(),this.upstream=e,this.maxCount=t,this.count=0}summary(){return`${this.upstream.summary()} -> Take`}async next(){return this.count++>=this.maxCount?{value:null,done:!0}:this.upstream.next()}}class dA extends aA{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(){const e=[];for(;e.length<this.batchSize;){const t=await this.upstream.next();if(t.done)return this.enableSmallLastBatch&&e.length>0?{value:e,done:!1}:{value:null,done:!0};e.push(t.value)}return{value:e,done:!1}}}class hA extends aA{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(;;){const e=await this.upstream.next();if(e.done||this.predicate(e.value))return e;Pb(e.value)}}}class fA extends aA{constructor(e,t){super(),this.upstream=e,this.transform=t}summary(){return`${this.upstream.summary()} -> Map`}async next(){const e=await this.upstream.next();if(e.done)return{value:null,done:!0};const t=hy(e.value),n=this.transform(e.value),r=hy(n);for(const e of t)dy(e,r)||e.dispose();return{value:n,done:!1}}}class gA extends aA{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}}}}class mA extends aA{constructor(e,t){super(),this.upstream=e,this.transform=t}summary(){return`${this.upstream.summary()} -> AsyncMap`}async next(){const e=await this.upstream.next();if(e.done)return{value:null,done:!0};const t=hy(e.value),n=await this.transform(e.value),r=hy(n);for(const e of t)dy(e,r)||e.dispose();return{value:n,done:!1}}}class yA extends aA{constructor(){super(),this.outputQueue=new iA,this.lastRead=Promise.resolve({value:null,done:!1})}async next(){return this.lastRead=this.lastRead.then(()=>this.serialNext()),this.lastRead}async serialNext(){for(;0===this.outputQueue.length();)if(!await this.pump())return{value:null,done:!0};return{value:this.outputQueue.shift(),done:!1}}}class bA extends yA{constructor(e,t){super(),this.upstream=e,this.transform=t}summary(){return`${this.upstream.summary()} -> Flatmap`}async pump(){const e=await this.upstream.next();if(e.done)return!1;const t=hy(e.value),n=this.transform(e.value),r=hy(n);this.outputQueue.pushAll(n);for(const e of t)dy(e,r)||e.dispose();return!0}}class $A extends aA{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,null==this.iterator){const e=await this.moreIterators.next();if(e.done)return{value:null,done:!0};this.iterator=e.value,null!=this.baseErrorHandler&&(this.iterator=this.iterator.handleErrors(this.baseErrorHandler))}const t=await this.iterator.next();return t.done?(this.iterator=null,this.readFromChain(e)):t}}var _A,wA;(wA=_A||(_A={}
2))[wA.FAIL=0]="FAIL",wA[wA.SHORTEST=1]="SHORTEST",wA[wA.LONGEST=2]="LONGEST";class xA extends aA{constructor(e,t){super(),this.upstream=e,this.bufferSize=t,this.buffer=new oA(t)}summary(){return`${this.upstream.summary()} -> Prefetch`}refill(){for(;!this.buffer.isFull();){const e=this.upstream.next();this.buffer.push(e)}}next(){return this.refill(),this.buffer.shift()}}class SA extends xA{constructor(e,t,n){super(e,t),this.upstream=e,this.windowSize=t,this.upstreamExhausted=!1,this.random=v_.alea(n||Wm().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();){const e=this.chooseIndex(),t=await this.buffer.shuffleExcise(e);if(!t.done)return this.refill(),t;this.upstreamExhausted=!0}return{value:null,done:!0}}}class vA{constructor(){this.size=null}batch(e,t=!0){const n=this;let r;return Md(e>0,()=>`batchSize needs to be positive, but it is\n      ${e}`),r=this.size===1/0||null==this.size?this.size:t?Math.ceil(this.size/e):Math.floor(this.size/e),kA(async()=>(await n.iterator()).columnMajorBatch(e,t,EA),r)}concatenate(e){const t=this;let n;return n=this.size===1/0||e.size===1/0?1/0:null!=this.size&&null!=e.size?this.size+e.size:null,kA(async()=>(await t.iterator()).concatenate(await e.iterator()),n)}filter(e){const t=this;let n;return n=this.size===1/0?1/0:null,kA(async()=>(await t.iterator()).filter(t=>Bb(()=>e(t))),n)}async forEachAsync(e){return(await this.iterator()).forEachAsync(e)}map(e){const t=this;return kA(async()=>(await t.iterator()).map(t=>Bb(()=>e(t))),this.size)}mapAsync(e){const t=this;return kA(async()=>(await t.iterator()).mapAsync(e),this.size)}prefetch(e){if(null==e)throw new RangeError("`Dataset.prefetch()` requires bufferSize to be specified.");const t=this;return kA(async()=>(await t.iterator()).prefetch(e),this.size)}repeat(e){const t=this;let n;return n=null!=this.size&&e>0?this.size*e:0===e?0:null!=this.size&&(void 0===e||e<0)?1/0:null,kA(async()=>{return n=(o=async()=>({value:await t.iterator(),done:!1}),new lA(o)).take(e),new $A(n,r);var n,r,o},n)}skip(e){const t=this;let n;return n=null!=this.size&&e>=0&&this.size>=e?this.size-e:null!=this.size&&(this.size<e||void 0===e||e<0)?0:null,kA(async()=>(await t.iterator()).skip(e),n)}shuffle(e,t,n=!0){if(null==e||e<0)throw null==this.size?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)`);const r=this,o=v_.alea(t||Wm().toString());return kA(async()=>
2{let t=o.int32();return n&&(t+=o.int32()),(await r.iterator()).shuffle(e,t.toString())},this.size)}take(e){const t=this;let n;return n=null!=this.size&&this.size>e?e:null!=this.size&&this.size<=e?this.size:null,kA(async()=>(await t.iterator()).take(e),n)}async toArray(){if(this.size===1/0)throw new Error("Can not convert infinite data stream to array.");return(await this.iterator()).toArray()}async toArrayForTest(){if(this.size===1/0)throw new Error("Can not convert infinite data stream to array.");return(await this.iterator()).toArrayForTest()}}function kA(e,t=null){return new class extends vA{constructor(){super(...arguments),this.size=t}async iterator(){return e()}}}function EA(e){if(null===e)return null;return null==(t=e[0])||null===(n=t)||"object"!=typeof n&&"function"!=typeof n||Array.isArray(t)||"object"==typeof t&&t instanceof ny||Gd(t)?{value:function(e){if(0===e.length)throw new Error("Can't make a batch of zero elements.");return e[0]instanceof ny?V_(e):Ny(e)}(e),recurse:!1}:{value:null,recurse:!0};var t,n}function IA(e,t){Array.isArray(e)||(e=[e]),e.forEach(e=>{null!=e&&Md("complex64"!==e.dtype,()=>`${t} does not support complex64 tensors in the CPU backend.`)})}vA.MAX_BUFFER_SIZE=1e4,Symbol("out"),Symbol("field"),Symbol("quote"),Symbol("quoteafterquote"),Symbol("quoteinquote");const TA=Xx;class FA extends Fd{constructor(){super(),this.blockSize=48,this.firstUse=!0,this.data=new Td(this,Ob())}nextDataId(){return FA.nextDataId++}write(e,t,n){this.firstUse&&(this.firstUse=!1,dh().get("IS_NODE")&&lh("\n============================\nHi there 👋. 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.\n============================"));const r={id:this.nextDataId()};return this.data.set(r,{values:e,dtype:n,refCount:1}),r}makeTensorInfo(e,t,n){let r;if("string"===t&&null!=n&&n.length>0&&Kd(n[0])){const o=n.map(e=>Um(e));r=this.write(o,e,t)}else r=this.write(n,e,t);return{dataId:r,shape:e,dtype:t}}refCount(e){return this.data.has(e)?this.data.get(e).refCount:0}incRef(e){this.data.get(e).refCount++}decRef(e){this.data.has(e)&&this.data.get(e).refCount--}move(e,t,n,r,o){this.data.set(e,{values:t,dtype:r,refCount:o})}numDataIds(){return this.data.numDataIds()}async read(e){return this.readSync(e)}readSync(e){const{dtype:t,complexTensorInfos:n}=this.data.get(e);return"complex64"===t?Rx(this.readSync(n.real.dataId),this.readSync(n.imag.dataId)):this.data.get(e).values}bufferSync(e){const t=this.readSync(e.dataId);let n=t;if("string"===e.dtype)try{n=t.map(e=>zm(e))}catch(e){throw new Error("Failed to decode encoded string bytes into utf-8")}return db(e.shape,e.dtype,n)}makeOutput(e,t,n){const r=this.write(e,t,n);return Ob().makeTensorFromDataId(r,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;const{complexTensorInfos:n}=this.data.get(e);null!=n&&(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){const t=Wm();return e(),{kernelMs:Wm()-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){IA([e],"where");const t=this.readSync(e.dataId);return TA(e.shape,t)}dispose(){}floatPrecision(){return 32}epsilon(){return super.epsilon()}}function NA(e,t,n){return({inputs:r,attrs:o,backend:i})=>{const{x:a}=r;if(IA(a,e),"string"===a.dtype||"string"===n)throw new Error("unaryKernelFunc does not support string input/output");const s=i,l=s.data.get(a.dataId).values,u=Bd(a.shape),p=n||a.dtype,c=Hd(p,u);for(let e=0;e<u;++e)c[e]=t(l[e],o);return s.makeTensorInfo(a.shape,p,c)}}function jA(e,t,n){return({inputs:r,attrs:o,backend:i}
2)=>{const{x:a}=r;if(IA(a,e),"string"===a.dtype||"string"===n)throw new Error("unaryKernelFunc does not support string input/output");const s=i,l=s.data.get(a.dataId).values,u=n||a.dtype,p=t(l,u,o);return s.makeTensorInfo(a.shape,u,p)}}FA.nextDataId=0,Wb("cpu",()=>new FA,1);const AA=NA(df,e=>e>=0?e:Math.exp(e)-1),CA={kernelName:df,backendName:"cpu",kernelFunc:AA};function MA(e){const{inputs:t,backend:n}=e,{x:r}=t;return n.incRef(r.dataId),{dataId:r.dataId,shape:r.shape,dtype:r.dtype}}const DA={kernelName:Tf,backendName:"cpu",kernelFunc:MA};function OA(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{alpha:i}=r;IA([o],"leakyRelu");const a=Bd(o.shape),s=n.data.get(o.dataId).values,l=Vd("float32",a);for(let e=0;e<s.length;e++)l[e]=s[e]<0?i*s[e]:s[e];return n.makeTensorInfo(o.shape,"float32",l)}const RA={kernelName:Mf,backendName:"cpu",kernelFunc:OA};function BA(e){return(t,n,r,o,i)=>{const a=D$(t,n),s=a.length,l=Zd(a),u=Vd(i,Bd(a)),p=t.length,c=n.length,d=Zd(t),h=Zd(n),f=C$(t,a),g=C$(n,a);if(f.length+g.length===0)for(let t=0;t<u.length;++t)u[t]=e(r[t%r.length],o[t%o.length]);else for(let t=0;t<u.length;++t){const n=ah(t,s,l),i=n.slice(-p);f.forEach(e=>i[e]=0);const a=ih(i,p,d),m=n.slice(-c);g.forEach(e=>m[e]=0);const y=ih(m,c,h);u[t]=e(r[a],o[y])}return[u,a]}}const PA=BA((e,t)=>e<0?t*e:e);function LA(e){const{inputs:t,backend:n}=e,{x:r,alpha:o}=t;IA([r,o],"prelu");const i=n.data.get(r.dataId).values,a=n.data.get(o.dataId).values,[s,l]=PA(r.shape,o.shape,i,a,r.dtype);return n.makeTensorInfo(l,r.dtype,s)}const WA={kernelName:gg,backendName:"cpu",kernelFunc:LA},UA=NA(_g,e=>Math.max(0,e)),zA={kernelName:_g,backendName:"cpu",kernelFunc:UA},VA=NA(Eg,e=>Math.min(Math.max(0,e),6)),HA={kernelName:Eg,backendName:"cpu",kernelFunc:VA};function GA(e){return(t,n,r)=>{const o=Vd(n,t.length);for(let n=0;n<t.length;++n)o[n]=e(t[n],r);return o}}const qA=GA(e=>1/(1+Math.exp(-e))),KA=NA(Rg,e=>1/(1+Math.exp(-e))),XA={kernelName:Rg,backendName:"cpu",kernelFunc:KA};function YA(e,t,n,r,o){if("linear"===n)return MA({inputs:{x:t},backend:e});if("relu"===n)return UA({inputs:{x:t},backend:e});if("elu"===n)return AA({inputs:{x:t},backend:e});if("relu6"===n)return VA({inputs:{x:t},backend:e});if("prelu"===n)return LA({inputs:{x:t,alpha:r},backend:e});if("leakyrelu"===n)return OA({inputs:{x:t},backend:e,attrs:{alpha:o}});if("sigmoid"===n)return KA({inputs:{x:t},backend:e});throw new Error(`Activation ${n} has not been implemented for the CPU backend.`)}function JA(e){const{inputs:t,backend:n}=e,{real:r,imag:o}=t,i=n.data.get(r.dataId).values,a=n.data.get(o.dataId).values,s=n.makeTensorInfo(r.shape,"complex64");return n.data.get(s.dataId).complexTensorInfos={real:n.makeTensorInfo(r.shape,"float32",i),imag:n.makeTensorInfo(o.shape,"float32",a)},s}const ZA={kernelName:Uh,backendName:"cpu",kernelFunc:JA};function QA(e,t,n="float32"){if("complex64"===n)return JA({inputs:{real:QA(e,t,"float32"),imag:QA(e,t,"float32")},backend:e});const r=nh(Bd(t),n);return e.makeTensorInfo(t,n,r)}function eC(e){const{inputs:t,backend:n}=e,{input:r}=t,o=n.data.get(r.dataId).complexTensorInfos.real,i=n.data.get(o.dataId).values;return n.makeTensorInfo(o.shape,o.dtype,i)}const tC={kernelName:bg,backendName:"cpu",kernelFunc:eC};function nC(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{dtype:i}=r;if("complex64"===i){if("complex64"===o.dtype)return MA({inputs:{x:o},backend:n});const e=QA(n,o.shape,o.dtype),t=nC({inputs:{x:o},backend:n,attrs:{dtype:"float32"}}),r=JA({inputs:{real:t,imag:e},backend:n});return n.disposeIntermediateTensorInfo(e),n.disposeIntermediateTensorInfo(t),r}if("complex64"===o.dtype){const e=eC({inputs:{input:o},backend:n}),t=nC({inputs:{x:e},backend:n,attrs:{dtype:i}});return n.disposeIntermediateTensorInfo(e),t}if(a=o.dtype,"complex64"===(s=i)||"float32"===s&&"complex64"!==a||"int32"===s&&"float32"!==a&&"complex64"!==a||"bool"===s&&"bool"===a){const e=MA({inputs:{x:o},backend:n});return{dataId:e.dataId,shape:e.shape,dtype:i}}var a,s;if("int32"===i){const e=n.data.get(o.dataId).values,t=Int32Array.from(e);return n.makeTensorInfo(o.shape,"int32",t)}if("bool"===i){const e=n.data.get(o.dataId).values,t=Lm([0],o.dtype),[r,i]=BA((e,t)=>
vendor: 14,112 bytes, line 2
2e!==t?1:0)(o.shape,[],e,t,"bool");return n.makeTensorInfo(i,"bool",r)}throw new Error(`Error in Cast: failed to cast ${o.dtype} to ${i}`)}const rC={kernelName:Ph,backendName:"cpu",kernelFunc:nC};function oC(e,t,n,r){return null==n?({inputs:n,backend:o})=>{const{a:i,b:a}=n,s=o;IA([i,a],e);const l=s.data.get(i.dataId).values,u=s.data.get(a.dataId).values,p="string"===i.dtype?qx(l):l,c="string"===i.dtype?qx(u):u,d=r||i.dtype,[h,f]=t(i.shape,a.shape,p,c,d);return s.makeTensorInfo(f,d,h)}:({inputs:e,backend:o})=>{const{a:i,b:a}=e,s=o;if("complex64"===i.dtype||"complex64"===a.dtype){const e=nC({inputs:{x:i},backend:s,attrs:{dtype:"complex64"}}),t=s.data.get(e.dataId),r=t.complexTensorInfos.real,o=t.complexTensorInfos.imag,l=s.data.get(r.dataId).values,u=s.data.get(o.dataId).values,p=nC({inputs:{x:a},backend:s,attrs:{dtype:"complex64"}}),c=s.data.get(p.dataId),d=c.complexTensorInfos.real,h=c.complexTensorInfos.imag,f=s.data.get(d.dataId).values,g=s.data.get(h.dataId).values,[m,y,b]=n(i.shape,a.shape,l,u,f,g),$=s.makeTensorInfo(b,"float32",m),_=s.makeTensorInfo(b,"float32",y),w=JA({inputs:{real:$,imag:_},backend:s});return s.disposeIntermediateTensorInfo(e),s.disposeIntermediateTensorInfo(p),s.disposeIntermediateTensorInfo($),s.disposeIntermediateTensorInfo(_),w}{const e=s.data.get(i.dataId).values,n=s.data.get(a.dataId).values,o=r||i.dtype,[l,u]=t(i.shape,a.shape,e,n,o);return s.makeTensorInfo(u,o,l)}}}function iC(e){return(t,n,r,o,i,a)=>{const s=D$(t,n),l=Bd(s),u=s.length,p=Zd(s),c=Vd("float32",l),d=Vd("float32",l),h=C$(t,s),f=C$(n,s),g=Rx(r,o),m=Rx(i,a),y=t.length,b=Zd(t),$=n.length,_=Zd(n);if(h.length+f.length===0)for(let t=0;t<c.length;t++){const n=t%g.length,r=t%m.length,o=e(g[2*n],g[2*n+1],m[2*r],m[2*r+1]);c[t]=o.real,d[t]=o.imag}else for(let t=0;t<c.length;t++){const n=ah(t,u,p),r=n.slice(-y);h.forEach(e=>r[e]=0);const o=ih(r,y,b),i=n.slice(-$);f.forEach(e=>i[e]=0);const a=ih(i,$,_),s=e(g[2*o],g[2*o+1],m[2*a],m[2*a+1]);c[t]=s.real,d[t]=s.imag}return[c,d,s]}}const aC=BA((e,t)=>e+t),sC=iC((e,t,n,r)=>({real:e+n,imag:t+r})),lC=oC(_h,aC,sC),uC={kernelName:_h,backendName:"cpu",kernelFunc:lC};function pC(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{shape:i}=r,a=Bd(o.shape),s=Ud(i,a),l=Bd(s);Md(a===l,()=>`The new shape (${s}) has ${l} elements and the old shape (${o.shape}) has ${a} elements. The new shape and old shape must have the same number of elements.`),n.incRef(o.dataId);const u=n.data.get(o.dataId);if(null!=u.complexTensorInfos){const e=u.complexTensorInfos.real,t=u.complexTensorInfos.imag;e.shape=s,t.shape=s}return{dataId:o.dataId,shape:s,dtype:o.dtype}}const cC={kernelName:wg,backendName:"cpu",kernelFunc:pC};function dC(e){const{inputs:t,backend:n,attrs:r}=e,{a:o,b:i}=t,{transposeA:a,transposeB:s}=r;IA([o,i],"matMul");const l=o.shape.length,u=i.shape.length,p=a?o.shape[l-2]:o.shape[l-1],c=s?i.shape[u-1]:i.shape[u-2],d=a?o.shape[l-1]:o.shape[l-2],h=s?i.shape[u-2]:i.shape[u-1],f=o.shape.slice(0,-2),g=i.shape.slice(0,-2),m=Bd(f),y=Bd(g);Md(l>=2&&u>=2&&(m===y||1===m||1===y),()=>`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}).`);const b=(m>y?o.shape.slice(0,-2):i.shape.slice(0,-2)).concat([d,h]);Md(p===c,()=>`Error in matMul: inner shapes (${p}) and (${c}) of Tensors with shapes ${o.shape} and ${i.shape} and transposeA=${a} and transposeB=${s} must match.`);const $=s?[y,h,c]:[y,c,h],_=pC({inputs:{x:o},backend:n,attrs:{shape:a?[m,p,d]:[m,d,p]}}),w=pC({inputs:{x:i},backend:n,attrs:{shape:$}}),x=a?_.shape[1]:_.shape[2],S=a?_.shape[2]:_.shape[1],v=s?w.shape[1]:w.shape[2],k=Math.max(m,y),E=n.data.get(_.dataId).values,I=n.data.get(w.dataId).values,T=Zd(_.shape),F=Zd(w.shape),[N,j,A]=a?[T[0],1,T[1]]:[T[0],T[1],1],[C,M,D]=s?[1,F[1],F[0]]:[F[1],1,F[0]],O=S*v,R=db([k,S,v],_.dtype),B=R.values,P=n.blockSize;for(let e=0;e<k;e++)for(let t=0;t<S;t+=P)for(let n=0;n<v;n+=P)for(let r=0;r<x;r+=P){const o=Math.min(t+P,S),i=Math.min(n+P,v),a=Math.min(r+P,x);for(let s=t;s<o;s++)for(let t=n;t<i;t++){let n=0;for(let o=r;o<a;o++){const r=Math.min(e,m-1)*N,i=Math.min(e,y-1)*D;n+=E[r+s*j+o*A]*I[o*C+t*M+i]}B[e*O+(s*v+t)]+=n}}return n.disposeIntermediateTensorInfo(_),n.disposeIntermediateTensorInfo(w),n.makeTensorInfo(b,R.dtype,R.values)}const hC={kernelName:Dh,backendName:"cpu",kernelFunc:dC},fC={kernelName:gm,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{a:o,b:i,bias:a,preluActivationWeights:s}=t,{transposeA:l,transposeB:u,activation:p,leakyreluAlpha:c}=r;let d,h,f;const g=[];d=dC({inputs:{a:o,b:i},attrs:{transposeA:l,transposeB:u},backend:n}),a&&(h=lC({inputs:{a:d,b:a},backend:n}),g.push(d),d=h),p&&(f=YA(n,d,p,s,c),g.push(d),d=f);for(const e of g)n.disposeIntermediateTensorInfo(e);return d}};function gC(e){const t=new Float32Array(e.length);for(let n=0;n<e.length;++n)t[n]=Math.abs(e[n]);return t}const mC={kernelName:yh,backendName:"cpu",kernelFunc:e=>{const{x:t}=e.inputs,n=e.backend;IA(t,"abs");let r=new Float32Array(Bd(t.shape));return r=gC(n.data.get(t.dataId).values),n.makeOutput(r,t.shape,"float32")}},yC=NA(bh,e=>Math.acos(e)),bC={kernelName:bh,backendName:"cpu",kernelFunc:yC},$C=NA($h,e=>Math.acosh(e)),_C={kernelName:$h,backendName:"cpu",kernelFunc:$C},wC={kernelName:wh,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n}=e,r=t;IA(t,"addN");const o=r.map(e=>n.data.get(e.dataId).values),i=db(r[0].shape,r[0].dtype),a=i.values;for(let e=0;e<r.length;e++){const t=o[e];for(let e=0;e<a.length;e++)a[e]+=t[e]}return n.makeTensorInfo(i.shape,i.dtype,i.values)}};function xC(e,t,n,r,o){const i=t.length,a=Bd(t),s=Zd(t),l=Zd(o),u=Vd(n,Bd(o));for(let t=0;t<a;++t){const n=ah(t,i,s),o=new Array(n.length);for(let e=0;e<o.length;e++)o[e]=n[r[e]];u[ih(o,i,l)]=e[t]}return u}function SC(e){const{inputs:t,attrs:n,backend:r}=e,{x:o}=t,{perm:i}=n;IA(o,"transpose");const a=o.shape.length,s=new Array(a);for(let e=0;e<s.length;e++)s[e]=o.shape[i[e]];const l=xC(r.data.get(o.dataId).values,o.shape,o.dtype,i,s);return{dataId:r.write(l,s,o.dtype),shape:s,dtype:o.dtype}}const vC={kernelName:sm,backendName:"cpu",kernelFunc:SC},kC={kernelName:xh,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{axis:i,keepDims:a}=r;IA(o,"all");const s=zd(i,o.shape);let l=s;const u=c_(l,o.shape.length);let p=o;null!=u&&(p=SC({inputs:{x:o},backend:n,attrs:{perm:u}}),l=h_(l.length,o.shape.length)),p_("all",l,p.shape.length);const[c,d]=l_(p.shape,l),h=Bd(d),f=nh(Bd(c),p.dtype),g=n.data.get(p.dataId).values;for(let e=0;e<f.length;++e){const t=e*h;let n=g[t];for(let e=0;e<h;++e){const r=g[t+e];n=n&&r}f[e]=n}null!=u&&n.disposeIntermediateTensorInfo(p);const m=n.makeTensorInfo(c,p.dtype,f);if(a){const e=pC({inputs:{x:m},backend:n,attrs:{shape:u_(c,s)}});return n.disposeIntermediateTensorInfo(m),e}return m}},EC={kernelName:Sh,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{axis:i,keepDims:a}=r;IA(o,"any");const s=zd(i,o.shape);let l=s;const u=c_(l,o.shape.length);let p=o;null!=u&&(p=SC({inputs:{x:o},backend:n,attrs:{perm:u}}),l=h_(l.length,o.shape.length)),p_("any",l,p.shape.length);const[c,d]=l_(p.shape,l),h=Bd(d),f=nh(Bd(c),p.dtype),g=n.data.get(p.dataId).values;for(let e=0;e<f.length;++e){const t=e*h;let n=g[t];for(let e=0;e<h;++e){const r=g[t+e];n=n||r}f[e]=n}null!=u&&n.disposeIntermediateTensorInfo(p);const m=n.makeTensorInfo(c,p.dtype,f);if(a){const e=pC({inputs:{x:m},backend:n,attrs:{shape:u_(c,s)}});return n.disposeIntermediateTensorInfo(m),e}return m}},IC={kernelName:vh,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{axis:i}=r;IA(o,"argMax");let a=zd(i,o.shape);const s=c_(a,o.shape.length);let l=o;const u=[];null!=s&&(l=SC({inputs:{x:o},backend:n,attrs:{perm:s}}),u.push(l),a=h_(a.length,l.shape.length)),a=[a[0]],p_("argMax",a,l.shape.length);const[p,c]=l_(l.shape,a),d=nh(Bd(p),"int32"),h=Bd(c),f=n.data.get(l.dataId).values;for(let e=0;e<d.length;++e){const t=e*h;let n=f[t],r=0;for(let e=0;e<h;++e){const o=f[t+e];o>n&&(n=o,r=e)}d[e]=r}return u.forEach(e=>n.disposeIntermediateTensorInfo(e)),n.makeTensorInfo(p,"int32",d)}},TC={kernelName:kh,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{axis:i}=r;IA(o,"argMin");let a=zd(i,o.shape);const s=c_(a,o.shape.length);let l=o;const u=[];null!=s&&(l=SC({inputs:{x:o},backend:n,attrs:{perm:s}}),u.push(l),a=h_(a.length,l.shape.length)),a=[a[0]],p_("argMin",a,l.shape.length);const[p,c]=l_(l.shape,a),d=nh(Bd(p),"int32"),h=Bd(c),f=n.data.get(l.dataId).values;for(let e=0;e<d.length;++e){const t=e*h;let n=f[t],r=0;for(let e=0;e<h;++e){const o=f[t+e];o<n&&(n=o,r=e)}d[e]=r}return u.forEach(e=>n.disposeIntermediateTensorInfo(e)),n.makeTensorInfo(p,"int32",d)}},FC=NA(Eh,e=>Math.asin(e)),NC={kernelName:Eh,backendName:"cpu",kernelFunc:FC},jC=NA(Ih,e=>Math.asinh(e)),AC={kernelName:Ih,backendName:"cpu",kernelFunc:jC},CC=NA(Th,e=>Math.atan(e)),MC={kernelName:Th,backendName:"cpu",kernelFunc:CC},DC=BA((e,t)=>Math.atan2(e,t)),OC=oC(Nh,DC),RC={kernelName:Nh,backendName:"cpu",kernelFunc:OC},BC=NA(Fh,e=>Math.atanh(e)),PC={kernelName:Fh,backendName:"cpu",kernelFunc:BC};function LC(e,t,n,r,o,i){const a=o.strideHeight,s=o.strideWidth,l=o.dilationHeight,u=o.dilationWidth,p=o.effectiveFilterHeight,c=o.effectiveFilterWidth,d=o.padInfo.top,h=o.padInfo.left,f="max"===i?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,g=db(o.outShape,n),m=g.values,y=o.outShape[1]*o.outShape[2]*o.outShape[3],b=o.outShape[2]*o.outShape[3],$=o.outShape[3];for(let t=0;t<o.batchSize;++t){const n=t*y,g=t*r[0];for(let t=0;t<o.inChannels;++t)for(let y=0;y<o.outHeight;++y){const _=y*a-d,w=Math.max(0,_),x=Math.min(o.inHeight,p+_),S=n+y*b;for(let n=0;n<o.outWidth;++n){const a=n*s-h,p=Math.max(0,a),d=Math.min(o.inWidth,c+a);let y=f,b=0,_=0;for(let n=w;n<x;n+=l){const o=g+n*r[1];for(let n=p;n<d;n+=u){const a=e[o+n*r[2]+t];"max"===i&&a>y?y=a:"avg"===i&&(b+=a,_++)}if(isNaN(y))break}m[S+n*$+t]="avg"===i?b/_:y}}}return g}function WC(e,t,n,r,o=!1,i=!1){const a=db(r.outShape,"int32"),s=r.strideHeight,l=r.strideWidth,u=r.dilationHeight,p=r.dilationWidth,c=r.effectiveFilterHeight,d=r.effectiveFilterWidth,h=r.padInfo.top,f=r.padInfo.left,g=db(t,n,e);for(let e=0;e<r.batchSize;++e)for(let t=0;t<r.inChannels;++t)for(let n=0;n<r.outHeight;++n){const m=n*s-h;let y=m;for(;y<0;)y+=u;const b=Math.min(r.inHeight,c+m);for(let s=0;s<r.outWidth;++s){const c=s*l-f;let h=c;for(;h<0;)h+=p;const $=Math.min(r.inWidth,d+c);let _=Number.NEGATIVE_INFINITY,w=-1;for(let n=y;n<b;n+=u){const a=n-m;for(let s=h;s<$;s+=p){const l=s-c,u=g.get(e,n,s,t);u>_&&(_=u,w=o?i?((e*r.inHeight+n)*r.inWidth+s)*r.inChannels+t:(n*r.inWidth+s)*r.inChannels+t:a*d+l)}}a.set(w,e,n,s,t)}}return a}function UC(e,t,n,r,o,i){const a=o.strideDepth,s=o.strideHeight,l=o.strideWidth,u=o.dilationDepth,p=o.dilationHeight,c=o.dilationWidth,d=o.effectiveFilterDepth,h=o.effectiveFilterHeight,f=o.effectiveFilterWidth,g=o.padInfo.front,m=o.padInfo.top,y=o.padInfo.left,b="max"===i?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,$=db(o.outShape,n),_=$.values,w=o.outShape[1]*o.outShape[2]*o.outShape[3]*o.outShape[4],x=o.outShape[2]*o.outShape[3]*o.outShape[4],S=o.outShape[3]*o.outShape[4],v=o.outShape[4];for(let t=0;t<o.batchSize;++t){const n=t*w,$=t*r[0];for(let t=0;t<o.inChannels;++t)for(let w=0;w<o.outDepth;++w){const k=w*a-g;let E=k;for(;E<0;)E+=u;const I=Math.min(o.inDepth,d+k),T=n+w*x;for(let n=0;n<o.outHeight;++n){const a=n*s-m;let d=a;for(;d<0;)d+=p;const g=Math.min(o.inHeight,h+a),w=T+n*S;for(let n=0;n<o.outWidth;++n){const a=n*l-y;let s=a;for(;s<0;)s+=c;const h=Math.min(o.inWidth,f+a),m=w+n*v;let x=b,S=0,k=0;for(let n=E;n<I;n+=u){const o=$+n*r[1];for(let n=d;n<g;n+=p){const a=o+n*r[2];for(let n=s;n<h;n+=c){const o=e[a+n*r[3]+t];if("max"===i&&o>x?x=o:"avg"===i&&(S+=o,k++),isNaN(x))break}if(isNaN(x))break}if(isNaN(x))break}_[m+t]="avg"===i?S/k:x}}}}return $}const zC={kernelName:jh,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t;IA(o,"avgPool");const{filterSize:i,strides:a,pad:s,dimRoundingMode:l}=r;Md(s$(a,1),()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${a} and dilations '1'`);const u=Jb(o.shape,i,a,1,s,l);let p;if(1===u.filterWidth&&1===u.filterHeight&&Pd(u.inShape,u.outShape))p=MA({inputs:{x:o},backend:n});else{const e=n.data.get(o.dataId).values,t=Zd(o.shape),r=LC(e,o.shape,o.dtype,t,u,"avg");p=n.makeTensorInfo(u.outShape,o.dtype,r.values)}return p}},VC={kernelName:Ch,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{filterSize:i,strides:a,pad:s,dimRoundingMode:l,dataFormat:u}=r;IA(o,"avgPool3d");const p=Zb(o.shape,i,a,1,s,l,u),c=UC(n.data.get(o.dataId).values,o.shape,o.dtype,Zd(o.shape),p,"avg");return n.makeTensorInfo(c.shape,"float32",c.values)}},HC={kernelName:Mh,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{dy:o,input:i}=t,{filterSize:a,strides:s,pad:l,dimRoundingMode:u}=r;IA([o,i],"avgPool3DGrad");const p=Zb(i.shape,a,s,1,l,u),c=p.strideDepth,d=p.strideHeight,h=p.strideWidth,f=p.filterDepth,g=p.filterHeight,m=p.filterWidth,y=p.dilationDepth,b=p.dilationHeight,$=p.dilationWidth,_=p.effectiveFilterDepth,w=p.effectiveFilterHeight,x=p.effectiveFilterWidth,S=_-1-p.padInfo.front,v=x-1-p.padInfo.left,k=w-1-p.padInfo.top,E=db(i.shape,"float32"),I=1/(f*g*m),T=n.bufferSync(o);for(let e=0;e<p.batchSize;++e)for(let t=0;t<p.inChannels;++t)for(let n=0;n<p.inDepth;++n)for(let r=0;r<p.inHeight;++r)for(let o=0;o<p.inWidth;++o){const i=n-S,a=r-k,s=o-v;let l=0;for(let n=0;n<_;n+=y){const r=(i+n)/c;if(!(r<0||r>=p.outDepth||Math.floor(r)!==r))for(let n=0;n<w;n+=b){const o=(a+n)/d;if(!(o<0||o>=p.outHeight||Math.floor(o)!==o))for(let n=0;n<x;n+=$){const i=(s+n)/h;i<0||i>=p.outWidth||Math.floor(i)!==i||(l+=T.get(e,r,o,i,t))}}}E.set(l*I,e,n,r,o,t)}return n.makeTensorInfo(E.shape,E.dtype,E.values)}},GC={kernelName:Ah,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{dy:o,input:i}=t,a=i;IA([o,i],"avgPoolGrad");const{filterSize:s,strides:l,pad:u}
2=r,p=Jb(a.shape,s,l,1,u),c=p.strideHeight,d=p.strideWidth,h=p.filterHeight,f=p.filterWidth,g=p.dilationHeight,m=p.dilationWidth,y=p.effectiveFilterHeight,b=p.effectiveFilterWidth,$=b-1-p.padInfo.left,_=y-1-p.padInfo.top,w=db(a.shape,"float32"),x=1/(h*f),S=n.data.get(o.dataId).values,v=db(o.shape,"float32",S);for(let e=0;e<p.batchSize;++e)for(let t=0;t<p.inChannels;++t)for(let n=0;n<p.inHeight;++n)for(let r=0;r<p.inWidth;++r){const o=n-_,i=r-$;let a=0;for(let n=0;n<y;n+=g){const r=(o+n)/c;if(!(r<0||r>=p.outHeight||Math.floor(r)!==r))for(let n=0;n<b;n+=m){const o=(i+n)/d;o<0||o>=p.outWidth||Math.floor(o)!==o||(a+=v.get(e,r,o,t))}}w.set(a*x,e,n,r,t)}return n.makeTensorInfo(w.shape,w.dtype,w.values)}},qC={kernelName:Sf,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o,scale:i,offset:a,mean:s,variance:l}=t;Md(s.shape.length===l.shape.length,()=>"Batch normalization gradient requires mean and variance to have equal ranks."),Md(null==a||s.shape.length===a.shape.length,()=>"Batch normalization gradient requires mean and offset to have equal ranks."),Md(null==i||s.shape.length===i.shape.length,()=>"Batch normalization gradient requires mean and scale to have equal ranks."),IA([o,s,l,i,a],"batchNorm");let{varianceEpsilon:u}=r;null==u&&(u=.001);const p=n.data.get(o.dataId).values,c=n.data.get(s.dataId).values,d=n.data.get(l.dataId).values,h=i?n.data.get(i.dataId).values:new Float32Array([1]),f=a?n.data.get(a.dataId).values:new Float32Array([0]),g=new Float32Array(p.length),m=f.length,y=h.length,b=d.length,$=c.length;let _=0,w=0,x=0,S=0;for(let e=0;e<p.length;++e)g[e]=f[_++]+(p[e]-c[w++])*h[x++]/Math.sqrt(d[S++]+u),_>=m&&(_=0),w>=$&&(w=0),x>=y&&(x=0),S>=b&&(S=0);return n.makeTensorInfo(o.shape,o.dtype,g)}};function KC(e,t,n,r,o){const i=Tb(r,t,n),a=Bd(n),s=Zd(r);if(i){const n=Fb(t,s);return"string"===o?e.slice(n,n+a):e.subarray(n,n+a)}const l=db(r,o,"string"===o?qx(e):e),u=db(n,o);for(let e=0;e<u.size;++e){const n=u.indexToLoc(e),r=n.map((e,n)=>e+t[n]);u.set(l.get(...r),...n)}return"string"===o?Kx(u.values):u.values}function XC(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{begin:i,size:a}=r;IA(o,"slice");const[s,l]=Nb(o,i,a);!function(e,t,n){const r=e.shape.length;Md(r===t.length,()=>`Error in slice${r}D: Length of begin ${t} must match the rank of the array (${r}).`),Md(r===n.length,()=>`Error in slice${r}D: Length of size ${n} must match the rank of the array (${r}).`);for(let o=0;o<r;++o)Md(t[o]+n[o]<=e.shape[o],()=>`Error in slice${r}D: begin[${o}] + size[${o}] (${t[o]+n[o]}) would overflow input.shape[${o}] (${e.shape[o]})`)}(o,s,l);const u=KC(n.data.get(o.dataId).values,s,l,o.shape,o.dtype);return n.makeTensorInfo(l,o.dtype,u)}const YC={kernelName:Cg,backendName:"cpu",kernelFunc:XC},JC={kernelName:Oh,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{blockShape:i,crops:a}=r;IA([o],"batchToSpaceND");const s=i.reduce((e,t)=>e*t),l=Nx(o.shape,i,s),u=jx(l.length,i.length),p=Ax(o.shape,i,s),c=Cx(a,i.length),d=Mx(p,a,i.length),h=pC({inputs:{x:o},backend:n,attrs:{shape:l}}),f=SC({inputs:{x:h},backend:n,attrs:{perm:u}}
2),g=pC({inputs:{x:f},backend:n,attrs:{shape:p}}),m=XC({inputs:{x:g},backend:n,attrs:{begin:c,size:d}});return n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(g),m}};function ZC(e,t,n,r,o){const i=Bd(r),a=nh(o,n);for(let n=0;n<e.length;n++){const r=e[n];if(r<0)throw new Error("Input x must be non-negative!");r>=o||(a[r]+=i>0?t[n]:1)}return a}function QC(e,t,n,r=!1){const o=e.shape[0],i=e.shape[1],a=db([o,n],t.dtype);for(let s=0;s<o;s++)for(let o=0;o<i;o++){const i=e.get(s,o);if(i<0)throw new Error("Input x must be non-negative!");i>=n||(r?a.set(1,s,i):t.size>0?a.set(a.get(s,i)+t.get(s,o),s,i):a.set(a.get(s,i)+1,s,i))}return a}const eM={kernelName:Rh,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o,weights:i}=t,{size:a}=r,s=ZC(n.data.get(o.dataId).values,n.data.get(i.dataId).values,i.dtype,i.shape,a);return n.makeTensorInfo([a],i.dtype,s)}},tM={kernelName:Bh,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n}=e,{s0:r,s1:o}=t,i=n.data.get(r.dataId).values,a=n.data.get(o.dataId).values,s=D$(Array.from(i),Array.from(a));return n.makeTensorInfo([s.length],"int32",Int32Array.from(s))}},nM=GA(e=>Math.ceil(e)),rM=jA(Lh,nM),oM={kernelName:Lh,backendName:"cpu",kernelFunc:rM},iM=NA(Wh,(e,t)=>{const n=t;return e>n.clipValueMax?n.clipValueMax:e<n.clipValueMin?n.clipValueMin:e}),aM={kernelName:Wh,backendName:"cpu",kernelFunc:iM},sM={kernelName:zh,backendName:"cpu",kernelFunc:e=>{const{x:t}=e.inputs,n=e.backend,r=new Float32Array(Bd(t.shape)),o=n.data.get(t.dataId),i=o.complexTensorInfos.real,a=o.complexTensorInfos.imag,s=n.data.get(i.dataId).values,l=n.data.get(a.dataId).values;for(let e=0;e<s.length;e++){const t=s[e],n=l[e];r[e]=Math.hypot(t,n)}return n.makeOutput(r,t.shape,"float32")}};function lM(e,t,n,r){const o=Hd(n,Bd(t));if(r&&"string"!==n){let t=0;e.forEach(e=>{const n=Bd(e.shape);o.set(e.vals,t),t+=n})}else{let r=0;e.forEach(e=>{const i="string"===n?qx(e.vals):e.vals;let a=0;for(let n=0;n<e.shape[0];++n){const s=n*t[1]+r;for(let t=0;t<e.shape[1];++t)o[s+t]=i[a++]}r+=e.shape[1]})}return o}function uM(e){const{inputs:t,backend:n}=e,{input:r}=t,o=n.data.get(r.dataId).complexTensorInfos.imag,i=n.data.get(o.dataId).values;return n.makeTensorInfo(o.shape,o.dtype,i)}const pM={kernelName:Nf,backendName:"cpu",kernelFunc:uM};function cM(e){const{inputs:t,backend:n,attrs:r}=e,{axis:o}=r,i=zd(o,t[0].shape)[0];let a=Tx(t.map(e=>e.shape),i);if(0===Bd(a))return n.makeTensorInfo(a,t[0].dtype,[]);const s=t.filter(e=>Bd(e.shape)>0);if(1===s.length)return MA({inputs:{x:s[0]},backend:n});if(Ix(s.map(e=>e.shape),i),"complex64"===s[0].dtype){const e=s.map(e=>eC({inputs:{input:e},backend:n})),t=s.map(e=>uM({inputs:{input:e},backend:n})),r=cM({inputs:e,backend:n,attrs:{axis:i}}),o=cM({inputs:t,backend:n,attrs:{axis:i}}),a=JA({inputs:{real:r,imag:o},backend:n});return e.forEach(e=>n.disposeIntermediateTensorInfo(e)),t.forEach(e=>n.disposeIntermediateTensorInfo(e)),n.disposeIntermediateTensorInfo(r),n.disposeIntermediateTensorInfo(o),a}const l=s.map(e=>{const t=Bd(e.shape.slice(i));return pC({inputs:{x:e},backend:n,attrs:{shape:[-1,t]}})}),u=l.map(e=>({vals:n.data.get(e.dataId).values,shape:e.shape}));a=Tx(l.map(e=>e.shape),1);const p=1===l[0].shape[0],c=lM(u,a,t[0].dtype,p),d=Tx(s.map(e=>e.shape),i),h=n.makeTensorInfo(d,t[0].dtype,c);return l.forEach(e=>n.disposeIntermediateTensorInfo(e)),h}const dM={kernelName:Vh,backendName:"cpu",kernelFunc:cM};function hM(e){const{inputs:t,backend:n,attrs:r}=e,{x:o,filter:i}=t,{strides:a,pad:s,dataFormat:l,dilations:u,dimRoundingMode:p}=r;IA([o,i],"conv2d");const c=l$(l),d=Qb(o.shape,i.shape,a,u,s,p,!1,c),h=d.filterHeight,f=d.filterWidth,g=d.dilationHeight,m=d.dilationWidth,y=d.padInfo.left,b=d.padInfo.top,$="channelsLast"===d.dataFormat,_=new Zm(d.outShape,o.dtype),w=Zd(o.shape),x=Zd(i.shape),S=w[0],v=$?w[1]:w[2],k=$?w[2]:1,E=$?1:w[1],I=_.strides[0],T=$?_.strides[1]:_.strides[2],F=$?_.strides[2]:1,N=$?1:_.strides[1],j=n.data.get(o.dataId).values,A=n.data.get(i.dataId).values,C=_.values;for(let e=0;e<d.batchSize;++e){const t=e*S,n=e*I;for(let e=0;e<d.outHeight;++e){const r=n+e*T,o=e*d.strideHeight-b;for(let e=0;e<h;++e){const n=o+e*g;if(n<0||n>=d.inHeight)continue;const i=e*x[0],a=t+n*v;for(let e=0;e<d.outWidth;++e){const t=r+e*F,n=e*d.strideWidth-y;for(let e=0;e<f;++e){const r=n+e*m;if(r<0||r>=d.inWidth)continue;const o=a+r*k;let s=i+e*x[1];for(let e=0;e<d.inChannels;++e){const n=j[o+e*E];for(let e=0;e<d.outChannels;++e)C[t+e*N]+=n*A[s+e];s+=d.outChannels}}}}}}return n.makeTensorInfo(_.shape,_.dtype,C)}const fM={kernelName:Hh,backendName:"cpu",kernelFunc:hM},gM={kernelName:Gh,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o,dy:i}=t,{strides:a,pad:s,dataFormat:l,dimRoundingMode:u,filterShape:p}=r;IA([o,i],"conv2dBackpropFilter");const c=l$(l),d=Qb(o.shape,p,a,1,s,u,!1,c),{strideHeight:h,strideWidth:f,filterHeight:g,filterWidth:m}
vendor: 28,317 bytes, line 2
2=d,y="channelsLast"===d.dataFormat,b=new Zm(d.filterShape,"float32"),$=d.padInfo.left,_=d.padInfo.top,w=n.data.get(o.dataId).values,x=n.data.get(i.dataId).values,S=new Zm(o.shape,o.dtype,w),v=new Zm(i.shape,i.dtype,x);for(let e=0;e<g;++e){const t=Math.max(0,Math.ceil((_-e)/h)),n=Math.min(d.outHeight,(d.inHeight+_-e)/h);for(let r=0;r<m;++r){const o=Math.max(0,Math.ceil(($-r)/f)),i=Math.min(d.outWidth,(d.inWidth+$-r)/f);for(let a=0;a<d.inChannels;++a)for(let s=0;s<d.outChannels;++s){let l=0;for(let u=0;u<d.batchSize;++u)for(let p=t;p<n;++p){const t=e+p*h-_;for(let e=o;e<i;++e){const n=r+e*f-$;l+=y?S.get(u,t,n,a)*v.get(u,p,e,s):S.get(u,a,t,n)*v.get(u,s,p,e)}}b.set(l,e,r,a,s)}}}return n.makeTensorInfo(b.shape,b.dtype,b.values)}},mM={kernelName:qh,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{dy:o,filter:i}=t,{inputShape:a,strides:s,pad:l,dataFormat:u,dimRoundingMode:p}=r;IA([o,i],"conv2dBackpropInput");const c=Zd(i.shape),d=Zd(o.shape);let h=l$(u);const f=Qb(a,i.shape,s,1,l,p,!1,h),g=new Zm(f.inShape,"float32"),m=g.values,y=n.data.get(o.dataId).values,b=n.data.get(i.dataId).values,[$,_,w]=c,{batchSize:x,filterHeight:S,filterWidth:v,inChannels:k,inHeight:E,inWidth:I,outChannels:T,outHeight:F,outWidth:N,strideHeight:j,strideWidth:A}=f;h=f.dataFormat;const C=S-1-f.padInfo.top,M=v-1-f.padInfo.left,D="channelsLast"===h,O=g.strides[0],R=D?g.strides[1]:g.strides[2],B=D?g.strides[2]:1,P=D?1:g.strides[1],L=d[0],W=D?d[1]:d[2],U=D?d[2]:1,z=D?1:d[1];for(let e=0;e<x;++e)for(let t=0;t<k;++t)for(let n=0;n<E;++n){const r=n-C,o=Math.max(0,Math.ceil(r/j)),i=Math.min(F,(S+r)/j);for(let a=0;a<I;++a){const s=a-M,l=Math.max(0,Math.ceil(s/A)),u=Math.min(N,(v+s)/A);let p=0;for(let n=o;n<i;++n){const o=n*j-r;for(let r=l;r<u;++r){const i=L*e+W*n+U*r,a=$*(S-1-o)+_*(v-1-(r*A-s))+w*t;for(let e=0;e<T;++e)p+=y[i+z*e]*b[a+e]}}m[O*e+R*n+B*a+P*t]=p}}return n.makeTensorInfo(g.shape,g.dtype,g.values)}},yM={kernelName:Kh,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o,filter:i}=t,{strides:a,pad:s,dilations:l}=r;IA([o,i],"conv3d");const u=e$(o.shape,i.shape,a,l,s),{filterDepth:p,filterHeight:c,filterWidth:d,dilationDepth:h,dilationHeight:f,dilationWidth:g,padInfo:m}=u,y=m.front,b=m.left,$=m.top,_=new Zm(u.outShape,o.dtype),w=n.data.get(o.dataId).values,x=n.data.get(i.dataId).values,S=_.values,v=Zd(o.shape),k=Zd(i.shape);for(let e=0;e<u.batchSize;++e){const t=e*v[0],n=e*_.strides[0];for(let e=0;e<u.outDepth;++e){const r=n+e*_.strides[1],o=e*u.strideDepth-y;for(let e=0;e<p;++e){const n=o+e*h;if(n<0||n>=u.inDepth)continue;const i=e*k[0],a=t+n*v[1];for(let e=0;e<u.outHeight;++e){const t=r+e*_.strides[2],n=e*u.strideHeight-$;for(let e=0;e<c;++e){const r=n+e*f;if(r<0||r>=u.inHeight)continue;const o=i+e*k[1],s=a+r*v[2];for(let e=0;e<u.outWidth;++e){const n=t+e*u.outChannels,r=e*u.strideWidth-b;for(let e=0;e<d;++e){const t=r+e*g;if(t<0||t>=u.inWidth)continue;const i=o+e*k[2],a=s+t*u.inChannels;let l=i;for(let e=0;e<u.inChannels;++e){const t=w[a+e];for(let e=0;e<u.outChannels;++e)S[n+e]+=t*x[l+e];l+=u.outChannels}}}}}}}}return n.makeTensorInfo(_.shape,_.dtype,_.values)}},bM={kernelName:Xh,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o,dy:i}=t,{strides:a,pad:s,filterShape:l}=r;IA([o,i],"conv3dBackpropFilterV2");const u=Zd(o.shape),p=Zd(i.shape),c=e$(o.shape,l,a,1,s),d=c.strideDepth,h=c.strideHeight,f=c.strideWidth,g=c.filterDepth,m=c.filterHeight,y=c.filterWidth,b=new Zm(c.filterShape,"float32"),$=b.values,[_,w,x,S]=b.strides,v=n.data.get(i.dataId).values,[k,E,I,T]=p,F=n.data.get(o.dataId).values,[N,j,A,C]=u,M=c.padInfo.front,D=c.padInfo.left,O=c.padInfo.top;for(let e=0;e<g;++e){const t=Math.max(0,Math.ceil((M-e)/d)),n=Math.min(c.outDepth,(c.inDepth+M-e)/d),r=e*_;for(let o=0;o<m;++o){const i=Math.max(0,Math.ceil((O-o)/h)),a=Math.min(c.outHeight,(c.inHeight+O-o)/h),s=o*w+r;for(let r=0;r<y;++r){const l=Math.max(0,Math.ceil((D-r)/f)),u=Math.min(c.outWidth,(c.inWidth+D-r)/f),p=r*x+s;for(let s=0;s<c.inChannels;++s){const g=s*S+p;for(let p=0;p<c.outChannels;++p){let m=0;for(let g=0;g<c.batchSize;++g){const c=g*N,y=g*k;for(let g=t;g<n;++g){const t=(e+g*d-M)*j+c,n=g*E+y;for(let e=i;e<a;++e){const i=(o+e*h-O)*A+t,a=e*I+n;for(let e=l;e<u;++e){const t=e*T+a;m+=F[(r+e*f-D)*C+i+s]*v[t+p]}}}}$[g+p]=m}}}}}return n.makeTensorInfo(b.shape,b.dtype,b.values)}},$M={kernelName:Yh,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{dy:o,filter:i}=t,{pad:a,strides:s,inputShape:l}=r;IA([o],"conv3dBackpropInputV2");const u=Zd(o.shape),p=Zd(i.shape),c=e$(l,i.shape,s,1,a),d=new Zm(c.inShape,"float32"),h=d.values,[f,g,m,y]=d.strides,b=n.data.get(o.dataId).values,[$,_,w,x]=u,S=n.data.get(i.dataId).values,[v,k,E,I]=p,{batchSize:T,filterDepth:F,filterHeight:N,filterWidth:j,inChannels:A,inDepth:C,inHeight:M,inWidth:D,outChannels:O,outDepth:R,outHeight:B,outWidth:P,strideDepth:L,strideHeight:W,strideWidth:U}=c,z=F-1-c.padInfo.front,V=N-1-c.padInfo.top,H=j-1-c.padInfo.left;for(let e=0;e<T;++e)for(let t=0;t<A;++t)for(let n=0;n<C;++n){const r=n-z,o=Math.max(0,Math.ceil(r/L)),i=Math.min(R,(F+r)/L);for(let a=0;a<M;++a){const s=a-V,l=Math.max(0,Math.ceil(s/W)),u=Math.min(B,(N+s)/W);for(let p=0;p<D;++p){const c=p-H,d=Math.max(0,Math.ceil(c/U)),T=Math.min(P,(j+c)/U);let A=0;for(let n=o;n<i;++n){const o=n*L-r;for(let r=l;r<u;++r){const i=r*W-s;for(let a=d;a<T;++a){const s=$*e+_*n+w*r+x*a,l=v*(F-1-o)+k*(N-1-i)+E*(j-1-(a*U-c))+I*t;for(let e=0;e<O;++e)A+=b[s+e]*S[l+e]}}}h[f*e+g*n+m*a+y*p+t]=A}}}return n.makeTensorInfo(d.shape,d.dtype,d.values)}},_M=NA(Jh,e=>Math.cos(e)),wM={kernelName:Jh,backendName:"cpu",kernelFunc:_M},xM=NA(Zh,e=>Math.cosh(e)),SM={kernelName:Zh,backendName:"cpu",kernelFunc:xM},vM={kernelName:ef,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{image:o,boxes:i,boxInd:a}=t,{cropSize:s,method:l,extrapolationValue:u}=r,[p,c,d,h]=o.shape,f=i.shape[0],[g,m]=s,y=db([f,g,m,h],"float32"),b=n.data.get(i.dataId).values,$=n.data.get(a.dataId).values,_=n.data.get(o.dataId).values,w=Zd(o.shape),x=Zd(y.shape);for(let e=0;e<f;e++){const t=4*e,n=b[t],r=b[t+1],o=b[t+2],i=b[t+3],a=$[e];if(a>=p)continue;const s=g>1?(o-n)*(c-1)/(g-1):0,f=m>1?(i-r)*(d-1)/(m-1):0;for(let t=0;t<g;t++){const p=g>1?n*(c-1)+t*s:.5*(n+o)*(c-1);if(p<0||p>c-1)for(let n=0;n<m;n++)for(let r=0;r<h;r++){const o=r+n*x[2]+t*x[1]+e*x[0];y.values[o]=u}else if("bilinear"===l){const n=Math.floor(p),o=Math.ceil(p),s=p-n;for(let l=0;l<m;l++){const p=m>1?r*(d-1)+l*f:.5*(r+i)*(d-1);if(p<0||p>d-1){for(let n=0;n<h;n++){const r=n+l*x[2]+t*x[1]+e*x[0];y.values[r]=u}continue}const c=Math.floor(p),g=Math.ceil(p),b=p-c;for(let r=0;r<h;r++){let i=r+c*w[2]+n*w[1]+a*w[0];const u=_[i];i=r+g*w[2]+n*w[1]+a*w[0];const p=_[i];i=r+c*w[2]+o*w[1]+a*w[0];const d=_[i];i=r+g*w[2]+o*w[1]+a*w[0];const h=u+(p-u)*b,f=d+(_[i]-d)*b;i=r+l*x[2]+t*x[1]+e*x[0],y.values[i]=h+(f-h)*s}}}else for(let n=0;n<m;++n){const o=m>1?r*(d-1)+n*f:.5*(r+i)*(d-1);if(o<0||o>d-1){for(let r=0;r<h;r++){const o=r+n*x[2]+t*x[1]+e*x[0];y.values[o]=u}continue}const s=Math.round(o),l=Math.round(p);for(let r=0;r<h;r++){const o=r+s*w[2]+l*w[1]+a*w[0],i=r+n*x[2]+t*x[1]+e*x[0];y.values[i]=_[o]}}}}return n.makeTensorInfo(y.shape,y.dtype,y.values)}},kM={kernelName:Qh,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{axis:i,exclusive:a,reverse:s}=r;IA(o,"cumsum");const l=c_([i],o.shape.length);let u=o;null!=l&&(u=SC({inputs:{x:o},backend:n,attrs:{perm:l}}));const p=h_(1,o.shape.length)[0];if(p!==u.shape.length-1)throw new Error(`backend.cumsum in CPU expects an inner-most axis=${u.shape.length-1} but got axis=${p}`);const c=py(u.dtype,"int32"),d=nh(Bd(u.shape),c),h=n.data.get(u.dataId).values,f=u.shape[u.shape.length-1],g=s?(e,t)=>e+f-t-1:(e,t)=>e+t;for(let e=0;e<h.length;e+=f)for(let t=0;t<f;t++){const n=g(e,t);if(0===t)d[n]=a?0:h[n];else{const r=g(e,t-1);d[n]=a?h[r]+d[r]:h[n]+d[r]}}const m=n.makeTensorInfo(u.shape,c,d);if(null!=l){const e=SC({inputs:{x:m},backend:n,attrs:{perm:d_(l)}});return n.disposeIntermediateTensorInfo(m),n.disposeIntermediateTensorInfo(u),e}return m}},EM={kernelName:tf,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o,weights:i}=t,{size:a,binaryOutput:s}=r;if(1===o.shape.length){const e=ZC(n.data.get(o.dataId).values,n.data.get(i.dataId).values,i.dtype,i.shape,a);return n.makeTensorInfo([a],i.dtype,e)}if(2===o.shape.length){const e=QC(n.bufferSync(o),n.bufferSync(i),a,s);return n.makeTensorInfo(e.shape,i.dtype,e.values)}throw new Error(`Error in denseBincount: input must be at most rank 2, but got rank${o.shape.length}.`)}},IM={kernelName:nf,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{blockSize:i,dataFormat:a}=r;Md("NHWC"===a,()=>`Only NHWC dataFormat supported on CPU for depthToSpace. Got ${a}`),Md(i>1,()=>`blockSize should be > 1 for depthToSpace, but was: ${i}`);const s=o.shape[0],l=o.shape[1],u=o.shape[2],p=o.shape[3],c=l*i,d=u*i,h=p/(i*i),f=n.data.get(o.dataId).values,g=new Float32Array(s*c*d*h);let m=0;for(let e=0;e<s;++e)for(let t=0;t<c;++t){const n=Math.floor(t/i),r=t%i;for(let t=0;t<d;++t){const o=Math.floor(t/i),a=(r*i+t%i)*h;for(let t=0;t<h;++t){const r=t+a+p*(o+u*(n+l*e));g[m++]=f[r]}}}return n.makeTensorInfo([s,c,d,h],o.dtype,g)}};function TM(e){const{inputs:t,backend:n,attrs:r}=e,{x:o,filter:i}=t,{strides:a,pad:s,dilations:l,dimRoundingMode:u}=r;IA([o,i],"depthwiseConv2DNative");const p=Zd(o.shape),c=Zd(i.shape);let d=l;null==d&&(d=[1,1]),Md(s$(a,d),()=>`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${a} and dilations '${d}'`);const h=Qb(o.shape,i.shape,a,d,s,u,!0),{filterHeight:f,filterWidth:g,dilationHeight:m,dilationWidth:y,padInfo:b}=h,$=b.left,_=b.top,w=h.outChannels/h.inChannels,x=new Zm(h.outShape,o.dtype),S=n.data.get(o.dataId).values,v=n.data.get(i.dataId).values,k=x.values;for(let e=0;e<h.batchSize;++e){const t=e*p[0],n=e*x.strides[0];for(let e=0;e<h.outHeight;++e){const r=n+e*x.strides[1],o=e*h.strideHeight-_;for(let e=0;e<f;++e){const n=o+e*m;if(n<0||n>=h.inHeight)continue;const i=e*c[0],a=t+n*p[1];for(let e=0;e<h.outWidth;++e){const t=r+e*x.strides[2],n=e*h.strideWidth-$;for(let e=0;e<g;++e){const r=n+e*y;if(r<0||r>=h.inWidth)continue;const o=i+e*c[1],s=a+r*h.inChannels;let l=t,u=o;for(let e=0;e<h.inChannels;++e){const t=S[s+e];for(let e=0;e<w;++e)k[l+e]+=t*v[u+e];l+=w,u+=w}}}}}}return n.makeTensorInfo(x.shape,x.dtype,x.values)}const FM={kernelName:rf,backendName:"cpu",kernelFunc:TM},NM={kernelName:of,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o,dy:i}=t,{strides:a,dilations:s,pad:l,dimRoundingMode:u,filterShape:p}=r;IA([o,i],"depthwiseConv2dNativeBackpropFilter");const c=Qb(o.shape,p,a,s,l,u,!0),{strideHeight:d,strideWidth:h,filterHeight:f,filterWidth:g}=c,m=new Zm(c.filterShape,"float32"),y=c.padInfo.left,b=c.padInfo.top,$=c.outChannels/c.inChannels,_=n.data.get(o.dataId).values,w=new Zm(o.shape,o.dtype,_),x=n.data.get(i.dataId).values,S=new Zm(i.shape,i.dtype,x);for(let e=0;e<f;++e){const t=Math.max(0,Math.ceil((b-e)/d)),n=Math.min(c.outHeight,(c.inHeight+b-e)/d);for(let r=0;r<g;++r){const o=Math.max(0,Math.ceil((y-r)/h)),i=Math.min(c.outWidth,(c.inWidth+y-r)/h);for(let a=0;a<c.outChannels;++a){const s=Math.trunc(a/$),l=a%$;let u=0;for(let l=0;l<c.batchSize;++l)for(let p=t;p<n;++p){const t=e+p*d-b;for(let e=o;e<i;++e){const n=r+e*h-y;u+=w.get(l,t,n,s)*S.get(l,p,e,a)}}m.set(u,e,r,s,l)}}}return n.makeTensorInfo(m.shape,m.dtype,m.values)}},jM={kernelName:af,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{dy:o,filter:i}=t,{strides:a,dilations:s,pad:l,dimRoundingMode:u,inputShape:p}=r;IA([o,i],"depthwiseConv2DNativeBackpropInput");const c=Zd(o.shape),d=Zd(i.shape),h=Qb(p,i.shape,a,s,l,u,!0),f=new Zm(h.inShape,"float32"),g=f.values,[m,y,b]=f.strides,$=n.data.get(o.dataId).values,[_,w,x]=c,S=n.data.get(i.dataId).values,[v,k,E]=d,{batchSize:I,filterHeight:T,filterWidth:F,inChannels:N,inHeight:j,inWidth:A,outChannels:C,outHeight:M,outWidth:D,strideHeight:O,strideWidth:R}=h,B=T-1-h.padInfo.top,P=F-1-h.padInfo.left,L=C/N;for(let e=0;e<I;++e)for(let t=0;t<N;++t)for(let n=0;n<j;++n){const r=n-B,o=Math.max(0,Math.ceil(r/O)),i=Math.min(M,(T+r)/O);for(let a=0;a<A;++a){const s=a-P,l=Math.max(0,Math.ceil(s/R)),u=Math.min(D,(F+s)/R);let p=0;for(let n=o;n<i;++n){const o=n*O-r;for(let r=l;r<u;++r){const i=_*e+w*n+x*r,a=v*(T-1-o)+k*(F-1-(r*R-s))+E*t;for(let e=0;e<L;++e)p+=$[i+(t*L+e)]*S[a+e]}}g[m*e+y*n+b*a+t]=p}}return n.makeTensorInfo(f.shape,f.dtype,f.values)}},AM={kernelName:"Diag",backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n}=e,{x:r}=t,o=Bd(r.shape),i=n.data.get(r.dataId).values,a=db([o,o],r.dtype),s=a.values;for(let e=0;e<i.length;e++)s[e*o+e]=i[e];const l=[...r.shape,...r.shape];return n.makeTensorInfo(l,a.dtype,a.values)}},CM={kernelName:sf,backendName:"cpu",kernelFunc:({inputs:e,backend:t,attrs:n})=>{const{x:r,filter:o}=e,{strides:i,pad:a,dilations:s}=n,l=t,u=l.data.get(r.dataId).values,p=r.shape.length,c=l.data.get(o.dataId).values,d=o.shape.length,{batchSize:h,inHeight:f,inWidth:g,inChannels:m,outHeight:y,outWidth:b,padInfo:$,strideHeight:_,strideWidth:w,filterHeight:x,filterWidth:S,dilationHeight:v,dilationWidth:k,outShape:E}=Yb(r.shape,o.shape,i,a,"NHWC",s),I=Bd(E),T=E.length,F=Hd(r.dtype,I);for(let e=0;e<h;++e)for(let t=0;t<y;++t){const n=t*_-$.top;for(let i=0;i<b;++i){const a=i*w-$.left;for(let s=0;s<m;++s){let l=Number.MIN_SAFE_INTEGER;for(let t=0;t<x;++t){const i=n+t*v;if(i>=0&&i<f)for(let n=0;n<S;++n){const h=a+n*k;if(h>=0&&h<g){const a=ih([e,i,h,s],p,Zd(r.shape)),f=ih([t,n,s],d,Zd(o.shape)),g=u[a]+c[f];g>l&&(l=g)}}}F[ih([e,t,i,s],T,Zd(E))]=l}}}return{dataId:l.write(Lm(F,r.dtype),E,r.dtype),shape:E,dtype:r.dtype}}},MM={kernelName:uf,backendName:"cpu",kernelFunc:({inputs:e,backend:t,attrs:n})=>{const{x:r,filter:o,dy:i}=e,{strides:a,pad:s,dilations:l}=n,u=t,p=eh(r.shape,u.data.get(r.dataId).values),c=eh(o.shape,u.data.get(o.dataId).values),{batchSize:d,inHeight:h,inWidth:f,inChannels:g,outHeight:m,outWidth:y,padInfo:b,strideHeight:$,strideWidth:_,filterHeight:w,filterWidth:x,dilationHeight:S,dilationWidth:v,outShape:k}=Yb(r.shape,o.shape,a,s,"NHWC",l);Md(i.rank===k.length,()=>`Error in ${uf}, dy must have the same rank as output ${k.length}, but got ${i.rank}`);const E=eh(k,u.data.get(i.dataId).values),I=rh(o.shape,o.dtype);for(let e=0;e<d;++e)for(let t=0;t<m;++t){const n=t*$-b.top;for(let r=0;r<y;++r){const o=r*_-b.left;for(let i=0;i<g;++i){let a=Number.MIN_SAFE_INTEGER,s=0,l=0;for(let t=0;t<w;++t){const r=n+t*S;if(r>=0&&r<h)for(let n=0;n<x;++n){const u=o+n*v;if(u>=0&&u<f){const o=p[e][r][u][i]+c[t][n][i];o>a&&(a=o,s=t,l=n)}}}I[s][l][i]+=E[e][t][r][i]}}}return{dataId:u.write(Lm(I,r.dtype),o.shape,o.dtype),shape:o.shape,dtype:o.dtype}}},DM={kernelName:lf,backendName:"cpu",kernelFunc:({inputs:e,backend:t,attrs:n})=>{const{x:r,filter:o,dy:i}=e,{strides:a,pad:s,dilations:l}=n,u=t,p=eh(r.shape,u.data.get(r.dataId).values),c=eh(o.shape,u.data.get(o.dataId).values),{batchSize:d,inHeight:h,inWidth:f,inChannels:g,outHeight:m,outWidth:y,padInfo:b,strideHeight:$,strideWidth:_,filterHeight:w,filterWidth:x,dilationHeight:S,dilationWidth:v,outShape:k}=Yb(r.shape,o.shape,a,s,"NHWC",l);Md(i.rank===k.length,()=>`Error in ${lf}, dy must have the same rank as output ${k.length}, but got ${i.rank}`);const E=eh(k,u.data.get(i.dataId).values),I=rh(r.shape,r.dtype);for(let e=0;e<d;++e)for(let t=0;t<m;++t){const n=t*$-b.top;for(let r=0;r<y;++r){const o=r*_-b.left;for(let i=0;i<g;++i){let a=Number.MIN_SAFE_INTEGER,s=n<0?0:n,l=o<0?0:o;for(let t=0;t<w;++t){const r=n+t*S;if(r>=0&&r<h)for(let n=0;n<x;++n){const u=o+n*v;if(u>=0&&u<f){const o=p[e][r][u][i]+c[t][n][i];o>a&&(a=o,s=r,l=u)}}}I[e][s][l][i]+=E[e][t][r][i]}}}return{dataId:u.write(Lm(I,r.dtype),r.shape,r.dtype),shape:r.shape,dtype:r.dtype}}},OM=BA((e,t)=>e*t),RM=iC((e,t,n,r)=>({real:e*n-t*r,imag:e*r+t*n})),BM=oC(og,OM,RM),PM={kernelName:og,backendName:"cpu",kernelFunc:BM};function LM(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{axis:i,keepDims:a}=r;let s;IA(o,"sum"),s="bool"===o.dtype?nC({inputs:{x:o},backend:n,attrs:{dtype:"int32"}}):MA({inputs:{x:o},backend:n});const l=s.shape.length,u=zd(i,s.shape),p=c_(u,l);let c=u,d=s;null!=p&&(d=SC({inputs:{x:s},backend:n,attrs:{perm:p}}),c=h_(c.length,l)),p_("sum",c,d.shape.length);const[h,f]=l_(d.shape,c);let g=QA(n,h,py(d.dtype,"int32"));const m=Bd(f),y=n.data.get(g.dataId).values,b=n.data.get(d.dataId).values;for(let e=0;e<y.length;++e){const t=e*m;let n=0;for(let e=0;e<m;++e)n+=b[t+e];y[e]=n}if(a){const e=g;g=pC({inputs:{x:g},backend:n,attrs:{shape:u_(g.shape,u)}}),n.disposeIntermediateTensorInfo(e)}return n.disposeIntermediateTensorInfo(s),null!=p&&n.disposeIntermediateTensorInfo(d),g}const WM={kernelName:Lg,backendName:"cpu",kernelFunc:LM},UM={kernelName:cf,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{equation:o}=r,i=t,{allDims:a,summedDims:s,idDims:l}=function(e,t){const n=((e=e.replace(/\s/g,"")).length-e.replace(Wx,"").length)/2;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 ("->").');const[r,o]=e.split("->");Md(-1===r.indexOf("..."),()=>'The ellipsis notation ("...") is not supported yet.');const i=r.split(","),a=i.length;if(t!==a)throw new Error(`Expected ${a} input tensors, received ${t}`);if(a>2)throw new Error("Support for more than 2 input tensors is not implemented yet.");const s=[];for(let e=0;e<o.length;++e){const t=o[e];if(!i.some(e=>-1!==e.indexOf(t)))throw new Error(`Output subscripts contain the label ${t} not present in the input subscripts.`);-1===s.indexOf(t)&&s.push(t)}for(let e=0;e<r.length;++e){const t=r[e];-1===s.indexOf(t)&&","!==t&&s.push(t)}const l=new Array(i.length);for(let e=0;e<a;++e){if(new Set(i[e].split("")).size!==i[e].length)throw new Error(`Found duplicate axes in input component ${i[e]}. Support for duplicate axes in input is not implemented yet.`);l[e]=[];for(let t=0;t<i[e].length;++t)l[e].push(s.indexOf(i[e][t]))}const u=s.length,p=[];for(let e=o.length;e<u;++e)p.push(e);return{allDims:s,summedDims:p,idDims:l}}(o,i.length);!function(e,t,n){const r=new Array(e);for(let e=0;e<n.length;++e){const o=n[e].shape;for(let n=0;n<t[e].length;++n)void 0===r[t[e][n]]?r[t[e][n]]=o[n]:Md(r[t[e][n]]===o[n],()=>`Expected dimension ${r[t[e][n]]} at axis ${n} of input shaped ${JSON.stringify(o)}, but got dimension ${o[n]}`)}}(a.length,l,i);const{path:u,steps:p}=function(e,t){const n=e,r=[];let o=0;0===e.length&&n.push(-1),o=e.length+1;for(let e=0;e<o;++e)r.push([]);const i=[];for(let e=0;e<n.length;++e){const o=Vx(t,n[e]);for(const t of o)-1===i.indexOf(t)&&(r[e].push(t),i.push(t))}return{path:n,steps:r}}(s,l),c=p.length;let d=null,h=a.length;const f=[];for(let e=0;e<c;++e){for(const t of p[e]){const{permutationIndices:e,expandDims:r}=Ux(h,l[t]);let o;zx(e)?o=i[t]:(o=SC({inputs:{x:i[t]},backend:n,attrs:{perm:e}}),f.push(o));const a=o.shape.slice();for(let e=0;e<r.length;++e)a.splice(r[e],0,1);Pd(o.shape,a)||(o=pC({inputs:{x:o},backend:n,attrs:{shape:a}}),f.push(o)),null===d?d=o:(d=BM({inputs:{a:o,b:d},backend:n}),f.push(d))}e<c-1&&(u[e]>=0&&(d=LM({inputs:{x:d},backend:n,attrs:{axis:u[e]-(a.length-h),keepDims:!1}}),f.push(d)),h--)}for(const e of f)e!==d&&n.disposeIntermediateTensorInfo(e);return d}},zM={kernelName:hf,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n}=e,{dy:r,y:o}=t;IA([r,o],"eluGrad");const i=new Float32Array(Bd(o.shape)),a=n.data.get(o.dataId).values,s=n.data.get(r.dataId).values;for(let e=0;e<a.length;++e){const t=a[e];i[e]=t>=1?s[e]:s[e]*(t+1)}return n.makeTensorInfo(o.shape,"float32",i)}},VM=BA((e,t)=>e===t?1:0),HM=oC(gf,VM,null,"bool"),GM={kernelName:gf,backendName:"cpu",kernelFunc:HM},qM=NA(ff,e=>{const t=Math.sign(e),n=Math.abs(e),r=1/(1+.3275911*n);return t*(1-((((1.061405429*r-1.453152027)*r+1.421413741)*r-.284496736)*r+.254829592)*r*Math.exp(-n*n))}),KM={kernelName:ff,backendName:"cpu",kernelFunc:qM},XM=GA(e=>Math.exp(e)),YM=jA(mf,XM),JM={kernelName:mf,backendName:"cpu",kernelFunc:YM};function ZM(e){const{inputs:t,backend:n,attrs:r}=e,{input:o}=t,{dim:i}=r,a=o.shape.length,s=o.shape.slice();let l=i;return i<0&&(Md(-(a+1)<=i,()=>`Axis must be in the interval [${-(a+1)}, ${a}]`),l=a+i+1),s.splice(l,0,1),pC({inputs:{x:o},backend:n,attrs:{shape:s}})}const QM={kernelName:yf,backendName:"cpu",kernelFunc:ZM},eD=GA(e=>Math.expm1(e)),tD=jA(bf,eD),nD={kernelName:bf,backendName:"cpu",kernelFunc:tD},rD=BA((e,t)=>e/t),oD=oC(pf,rD),iD={kernelName:pf,backendName:"cpu",kernelFunc:oD},aD=BA((e,t)=>e-t),sD=iC((e,t,n,r)=>({real:e-n,imag:t-r})),lD=oC(tm,aD,sD),uD={kernelName:tm,backendName:"cpu",kernelFunc:lD};function pD(e,t,n){const r=e.shape,o=r[0],i=r[1],a=n.data.get(e.dataId),s=a.complexTensorInfos.real,l=a.complexTensorInfos.imag,u=[o,i],p=Bd(u),c=Vd("float32",p),d=Vd("float32",p);for(let e=0;e<o;e++){const r=XC({inputs:{x:s},backend:n,attrs:{begin:[e,0],size:[1,i]}}),o=XC({inputs:{x:l},backend:n,attrs:{begin:[e,0],size:[1,i]}}),a=JA({inputs:{real:r,imag:o},backend:n}),{real:u,imag:p}=cD(a,t,n),h=Rx(u,p);for(let t=0;t<i;t++){const n=Bx(h,t);c[e*i+t]=n.real,d[e*i+t]=n.imag}n.disposeIntermediateTensorInfo(r),n.disposeIntermediateTensorInfo(o),n.disposeIntermediateTensorInfo(a)}const h=n.makeTensorInfo(u,"float32",c),f=n.makeTensorInfo(u,"float32",d),g=JA({inputs:{real:h,imag:f},backend:n});return n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(f),g}function cD(e,t,n){const r=Bd(e.shape),o=n.data.get(e.dataId),i=n.data.get(o.complexTensorInfos.real.dataId).values,a=n.data.get(o.complexTensorInfos.imag.dataId).values;if((s=r)&s-1){const e=function(e,t,n){const r=new Float32Array(2*t);for(let o=0;o<t;o++){let i=0,a=0;for(let r=0;r<t;r++){const s=Lx(o*r,t,n),l=Bx(e,r);i+=l.real*s.real-l.imag*s.imag,a+=l.real*s.imag+l.imag*s.real}n&&(i/=t,a/=t),Px(r,i,a,o)}return r}(Rx(i,a),r,t);return function(e){const t=new Float32Array(e.length/2),n=new Float32Array(e.length/2);for(let r=0;r<e.length;r+=2)t[r/2]=e[r],n[r/2]=e[r+1];return{real:t,imag:n}}(e)}{const o=dD(i,a,r,t,n),s=[e.shape[0],e.shape[1]];if(t){const e=n.makeTensorInfo(s,"float32",o.real),t=n.makeTensorInfo(s,"float32",o.imag),i=n.makeTensorInfo([],"float32",Pm(r,"float32")),a=MA({inputs:{x:i},backend:n}),l=iD.kernelFunc({inputs:{a:e,b:i},backend:n}),u=iD.kernelFunc({inputs:{a:t,b:a},backend:n}),p=n.data.get(l.dataId).values,c=n.data.get(u.dataId).values;return n.disposeIntermediateTensorInfo(e),n.disposeIntermediateTensorInfo(t),n.disposeIntermediateTensorInfo(i),n.disposeIntermediateTensorInfo(a),n.disposeIntermediateTensorInfo(l),n.disposeIntermediateTensorInfo(u),{real:p,imag:c}}return o}var s}function dD(e,t,n,r,o){if(1===n)return{real:e,imag:t};const i=Rx(e,t),a=n/2,s=function(e){const t=Math.ceil(e.length/4),n=new Float32Array(t),r=new Float32Array(t);for(let t=0;t<e.length;t+=4)n[Math.floor(t/4)]=e[t],r[Math.floor(t/4)]=e[t+1];return{real:n,imag:r}}(i),l=s.real,u=s.imag,p=[l.length],c=o.makeTensorInfo(p,"float32",l),d=o.makeTensorInfo(p,"float32",u),h=JA({inputs:{real:c,imag:d},backend:o}),f=function(e){const t=Math.floor(e.length/4),n=new Float32Array(t),r=new Float32Array(t);for(let t=2;t<e.length;t+=4)n[Math.floor(t/4)]=e[t],r[Math.floor(t/4)]=e[t+1];return{real:n,imag:r}}(i),g=f.real,m=f.imag,y=[g.length],b=o.makeTensorInfo(y,"float32",g),$=o.makeTensorInfo(y,"float32",m),_=JA({inputs:{real:b,imag:$},backend:o}),w=dD(l,u,a,r,o),x=w.real,S=w.imag,v=[x.length],k=o.makeTensorInfo(v,"float32",x),E=o.makeTensorInfo(v,"float32",S),I=JA({inputs:{real:k,imag:E},backend:o}),T=dD(g,m,a,r,o),F=T.real,N=T.imag,j=[F.length],A=o.makeTensorInfo(j,"float32",F),C=o.makeTensorInfo(j,"float32",N),M=JA({inputs:{real:A,imag:C},backend:o}),D=function(e,t){const n=new Float32Array(e/2),r=new Float32Array(e/2);for(let o=0;o<Math.ceil(e/2);o++){const i=(t?2:-2)*Math.PI*(o/e);n[o]=Math.cos(i),r[o]=Math.sin(i)}return{real:n,imag:r}}(n,r),O=[D.real.length],R=o.makeTensorInfo(O,"float32",D.real),B=o.makeTensorInfo(O,"float32",D.imag),P=JA({inputs:{real:R,imag:B},backend:o}),L=BM({inputs:{a:P,b:M},backend:o}),W=lC({inputs:{a:I,b:L},backend:o}),U=lD({inputs:{a:I,b:L},backend:o}),z=eC({inputs:{input:W},backend:o}),V=eC({inputs:{input:U},backend:o}),H=uM({inputs:{input:W},backend:o}),G=uM({inputs:{input:U},backend:o}),q=cM({inputs:[z,V],backend:o,attrs:{axis:0}}),K=cM({inputs:[H,G],backend:o,attrs:{axis:0}}),X=o.data.get(q.dataId).values,Y=o.data.get(K.dataId).values;return o.disposeIntermediateTensorInfo(c),o.disposeIntermediateTensorInfo(d),o.disposeIntermediateTensorInfo(h),o.disposeIntermediateTensorInfo(b),o.disposeIntermediateTensorInfo($),o.disposeIntermediateTensorInfo(_),o.disposeIntermediateTensorInfo(k),o.disposeIntermediateTensorInfo(E),o.disposeIntermediateTensorInfo(I),o.disposeIntermediateTensorInfo(A),o.disposeIntermediateTensorInfo(C),o.disposeIntermediateTensorInfo(M),o.disposeIntermediateTensorInfo(R),o.disposeIntermediateTensorInfo(B),o.disposeIntermediateTensorInfo(P),o.disposeIntermediateTensorInfo(L),o.disposeIntermediateTensorInfo(W),o.disposeIntermediateTensorInfo(U),o.disposeIntermediateTensorInfo(z),o.disposeIntermediateTensorInfo(H),o.disposeIntermediateTensorInfo(V),o.disposeIntermediateTensorInfo(G),o.disposeIntermediateTensorInfo(q),o.disposeIntermediateTensorInfo(K),{real:X,imag:Y}}const hD={kernelName:"FFT",backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n}=e,{input:r}=t,o=Bd(r.shape),i=r.shape[r.shape.length-1],a=pC({inputs:{x:r},backend:n,attrs:{shape:[o/i,i]}}),s=pD(a,!1,n),l=pC({inputs:{x:s},backend:n,attrs:{shape:r.shape}});return n.disposeIntermediateTensorInfo(a),n.disposeIntermediateTensorInfo(s),l}};function fD(e){const{backend:t,attrs:n}=e,{shape:r,value:o,dtype:i}=n,a=i||Yd(o),s=Hd(a,Bd(r));return function(e,t){e.fill(t)}(s,o),t.makeTensorInfo(r,a,s)}const gD={kernelName:$f,backendName:"cpu",kernelFunc:fD},mD={kernelName:_f,backendName:"cpu",kernelFunc:({inputs:e,attrs:t,backend:n})=>{const{image:r}=e,o=n,i=Vd(r.dtype,Bd(r.shape)),[a,s,l,u]=r.shape,p=o.data.get(r.dataId).values;for(let e=0;e<a;e++){const t=e*l*s*u;for(let e=0;e<s;e++){const n=e*(l*u);for(let e=0;e<l;e++){const r=e*u;for(let o=0;o<u;o++){const a=Math.round(l-e-1),s=t+n+r+o;let c=p[s];a>=0&&a<l&&(c=p[t+n+a*u+o]),i[s]=c}}}}return{dataId:o.write(i,r.shape,r.dtype),shape:r.shape,dtype:r.dtype}}},yD=GA(e=>Math.floor(e)),bD=jA(wf,yD),$D={kernelName:wf,backendName:"cpu",kernelFunc:bD},_D=BA((e,t)=>Math.floor(e/t)),wD=oC(xf,_D,null,"int32"),xD={kernelName:xf,backendName:"cpu",kernelFunc:wD},SD={kernelName:mm,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o,filter:i,bias:a,preluActivationWeights:s}=t,{strides:l,pad:u,dataFormat:p,dilations:c,dimRoundingMode:d,activation:h,leakyreluAlpha:f}=r;let g=hM({inputs:{x:o,filter:i},backend:n,attrs:{strides:l,pad:u,dataFormat:p,dilations:c,dimRoundingMode:d}});if(a){const e=g;g=lC({inputs:{a:g,b:a},backend:n}),n.disposeIntermediateTensorInfo(e)}if(h){const e=g;g=YA(n,g,h,s,f),n.disposeIntermediateTensorInfo(e)}return g}},vD={kernelName:ym,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o,filter:i,bias:a,preluActivationWeights:s}=t,{strides:l,pad:u,dataFormat:p,dilations:c,dimRoundingMode:d,activation:h,leakyreluAlpha:f}=r;let g=TM({inputs:{x:o,filter:i},backend:n,attrs:{strides:l,pad:u,dataFormat:p,dilations:c,dimRoundingMode:d}});if(a){const e=g;g=lC({inputs:{a:g,b:a},backend:n}),n.disposeIntermediateTensorInfo(e)}if(h){const e=g;g=YA(n,g,h,s,f),n.disposeIntermediateTensorInfo(e)}return g}};function kD(e,t,n,r,o,i,a,s,l){const u=db([r,i],n);for(let n=0;n<r;n++){const r=[];let p=0;for(let t=0;t<o;t++){const i=e[n*o+t];p+=i*a[t],r.push(i)}if(p<0||p>=l/i)throw new Error(`Invalid indices: ${r} does not index into ${s}`);for(let e=0;e<i;e++)u.values[n*i+e]=t.get(...t.indexToLoc(p*i+e))}return u}const ED={kernelName:kf,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n}=e,{params:r,indices:o}=t,i=Bd(r.shape),a=o.shape,s=a[a.length-1],[l,u,p,c]=Eb(r,o);if(0===u)return n.makeTensorInfo(l,r.dtype,[]);const d=kD(n.data.get(o.dataId).values,n.bufferSync(r),r.dtype,u,s,p,c,r.shape,i);return n.makeTensorInfo(l,r.dtype,d.values)}};
2function ID(e,t,n){const r=db(n,e.dtype);for(let n=0;n<r.size;++n){const o=r.indexToLoc(n).slice(),i=o[0],a=o[2],s=t.locToIndex([i,a]);o[2]=t.values[s];const l=e.locToIndex(o);r.values[n]=e.values[l]}return r}const TD={kernelName:vf,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o,indices:i}=t,{axis:a,batchDims:s}=r;IA([o,i],"gatherV2");let l=s;null==s&&(l=0);const u=Bd(i.shape),p=Gx(o,i,zd(a,o.shape)[0],l),c=pC({inputs:{x:o},backend:n,attrs:{shape:[p.batchSize,p.outerSize,p.dimSize,p.sliceSize]}}),d=pC({inputs:{x:i},backend:n,attrs:{shape:[p.batchSize,u/p.batchSize]}}),h=[p.batchSize,p.outerSize,u/p.batchSize,p.sliceSize],f=n.bufferSync(d),g=ID(n.bufferSync(c),f,h);return n.disposeIntermediateTensorInfo(c),n.disposeIntermediateTensorInfo(d),n.makeTensorInfo(p.outputShape,g.dtype,g.values)}},FD=BA((e,t)=>e>t?1:0),ND=oC(Ef,FD,null,"bool"),jD={kernelName:Ef,backendName:"cpu",kernelFunc:ND},AD=BA((e,t)=>e>=t?1:0),CD=oC(If,AD,null,"bool"),MD={kernelName:If,backendName:"cpu",kernelFunc:CD},DD={kernelName:Ff,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n}=e,{input:r}=t,o=Bd(r.shape),i=r.shape[r.shape.length-1],a=pC({inputs:{x:r},backend:n,attrs:{shape:[o/i,i]}}),s=pD(a,!0,n),l=pC({inputs:{x:s},backend:n,attrs:{shape:r.shape}});return n.disposeIntermediateTensorInfo(a),n.disposeIntermediateTensorInfo(s),l}},OD={kernelName:jf,backendName:"cpu",kernelFunc:NA(jf,e=>Number.isFinite(e)?1:0,"bool")},RD={kernelName:Af,backendName:"cpu",kernelFunc:NA(Af,e=>Math.abs(e)===1/0?1:0,"bool")},BD=NA(Cf,e=>Number.isNaN(e)?1:0,"bool"),PD={kernelName:Cf,backendName:"cpu",kernelFunc:BD},LD=BA((e,t)=>e<t?1:0),WD=oC(Df,LD,null,"bool"),UD={kernelName:Df,backendName:"cpu",kernelFunc:WD},zD=BA((e,t)=>e<=t?1:0),VD=oC(Of,zD,null,"bool"),HD={kernelName:Of,backendName:"cpu",kernelFunc:VD};function GD(e,t,n){const r=(t-e)/(n-1),o=nh(n,"float32");o[0]=e;for(let e=1;e<o.length;e++)o[e]=o[e-1]+r;return o}const qD={kernelName:Rf,backendName:"cpu",kernelFunc:function(e){const{backend:t,attrs:n}=e,{start:r,stop:o,num:i}=n,a=GD(r,o,i);return t.makeTensorInfo([a.length],"float32",a)}},KD=GA(e=>Math.log(e)),XD=jA(Bf,KD),YD={kernelName:Bf,backendName:"cpu",kernelFunc:XD},JD=NA(Pf,e=>Math.log1p(e)),ZD={kernelName:Pf,backendName:"cpu",kernelFunc:JD},QD=BA((e,t)=>e&&t),eO=oC(Lf,QD,null,"bool"),tO={kernelName:Lf,backendName:"cpu",kernelFunc:eO},nO=NA(Wf,e=>e?0:1,"bool"),rO={kernelName:Wf,backendName:"cpu",kernelFunc:nO},oO=BA((e,t)=>e||t),iO=oC(Uf,oO,null,"bool"),aO={kernelName:Uf,backendName:"cpu",kernelFunc:iO},sO={kernelName:zf,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{depthRadius:i,bias:a,alpha:s,beta:l}=r;IA(o,"LRN");const u=o.shape[3],p=u-1,c=n.data.get(o.dataId).values,d=Bd(o.shape),h=new Float32Array(d);function f(e){const t=e%u;let n=e-t+Math.max(0,t-i);const r=e-t+Math.min(t+i,p);let o=0;for(;n<=r;n++){const e=c[n];o+=e*e}return o}for(let e=0;e<d;e++){const t=f(e),n=c[e]*Math.pow(a+s*t,-l);h[e]=n}return n.makeTensorInfo(o.shape,o.dtype,h)}},lO={kernelName:Vf,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o,y:i,dy:a}=t,{depthRadius:s,bias:l,alpha:u,beta:p}=r;IA(a,"LRNGrad");const c=Bd(a.shape),d=a.shape[3],h=n.data.get(a.dataId).values,f=n.data.get(o.dataId).values,g=n.data.get(i.dataId).values,m=new Float32Array(c),y=c;for(let e=0;e<y;e++){const t=e%d,n=e-t+Math.max(0,t-s),r=e-t+Math.min(d,t+s+1);let o=0;for(let e=n;e<r;e++)o+=Math.pow(f[e],2);o=u*o+l;for(let t=n;t<r;t++){let n=-2*u*p*f[t]*g[e]/o;e===t&&(n+=Math.pow(o,-p)),n*=h[e],m[t]+=n}}return n.makeTensorInfo(a.shape,o.dtype,m)}};function uO(e,t,n,r){const o=Vd(r,Bd(n));for(let n=0;n<o.length;++n){const r=n*t;let i=e[r];for(let n=0;n<t;++n){const t=e[r+n];(Number.isNaN(t)||t>i)&&(i=t)}o[n]=i}return o}function pO(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{reductionIndices:i,keepDims:a}=r,s=n;let l=o.shape;const u=l.length,p=zd(i,l);let c=p;const d=c_(c,u);let h=s.data.get(o.dataId).values;if(null!=d){const e=new Array(u);for(let t=0;t<e.length;t++)e[t]=l[d[t]];h=xC(h,l,o.dtype,d,e),c=h_(c.length,u),l=e}IA(o,"max"),p_("max",c,u);const[f,g]=l_(l,c),m=uO(h,Bd(g),f,o.dtype),y=s.write(m,f,o.dtype);let b=f;return a&&(b=u_(f,p)),{dataId:y,shape:b,dtype:o.dtype}}const cO={kernelName:Hf,backendName:"cpu",kernelFunc:pO},dO=BA((e,t)=>
vendor: 4,723 bytes, line 2
2Math.max(e,t)),hO=oC(Gf,dO),fO={kernelName:Gf,backendName:"cpu",kernelFunc:hO},gO={kernelName:qf,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t;IA(o,"maxPool");const{filterSize:i,strides:a,pad:s,dimRoundingMode:l}=r;Md(s$(a,1),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${a} and dilations '1'`);const u=Jb(o.shape,i,a,1,s,l);let p;if(1===u.filterWidth&&1===u.filterHeight&&Pd(u.inShape,u.outShape))p=MA({inputs:{x:o},backend:n});else{const e=n.data.get(o.dataId).values,t=Zd(o.shape),r=LC(e,o.shape,o.dtype,t,u,"max");p=n.makeTensorInfo(u.outShape,o.dtype,r.values)}return p}},mO={kernelName:Xf,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{filterSize:i,strides:a,pad:s,dimRoundingMode:l,dataFormat:u}=r;IA(o,"maxPool3d");const p=Zb(o.shape,i,a,1,s,l,u),c=UC(n.data.get(o.dataId).values,o.shape,o.dtype,Zd(o.shape),p,"max");return n.makeTensorInfo(c.shape,"float32",c.values)}},yO={kernelName:Yf,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{dy:o,input:i}=t,{filterSize:a,strides:s,pad:l,dimRoundingMode:u}=r;IA([o,i],"maxPool3DGrad");const p=Zb(i.shape,a,s,1,l,u),c=function(e,t){const n=db(t.outShape,"int32"),r=t.strideDepth,o=t.strideHeight,i=t.strideWidth,a=t.dilationDepth,s=t.dilationHeight,l=t.dilationWidth,u=t.effectiveFilterDepth,p=t.effectiveFilterHeight,c=t.effectiveFilterWidth,d=t.padInfo.front,h=t.padInfo.top,f=t.padInfo.left;for(let g=0;g<t.batchSize;++g)for(let m=0;m<t.inChannels;++m)for(let y=0;y<t.outDepth;++y){const b=y*r-d;let $=b;for(;$<0;)$+=a;const _=Math.min(t.inDepth,u+b);for(let r=0;r<t.outHeight;++r){const u=r*o-h;let d=u;for(;d<0;)d+=s;const w=Math.min(t.inHeight,p+u);for(let o=0;o<t.outWidth;++o){const h=o*i-f;let x=h;for(;x<0;)x+=l;const S=Math.min(t.inWidth,c+h);let v=Number.NEGATIVE_INFINITY,k=-1;for(let t=$;t<_;t+=a){const n=t-b;for(let r=d;r<w;r+=s){const o=r-u;for(let i=x;i<S;i+=l){const a=i-h,s=e.get(g,t,r,i,m);s>=v&&(v=s,k=n*p*c+o*p+a)}}}n.set(k,g,y,r,o,m)}}}return n}(n.bufferSync(i),p),d=p.strideDepth,h=p.strideHeight,f=p.strideWidth,g=p.dilationDepth,m=p.dilationHeight,y=p.dilationWidth,b=p.effectiveFilterDepth,$=p.effectiveFilterHeight,_=p.effectiveFilterWidth,w=b-1-p.padInfo.front,x=_-1-p.padInfo.left,S=$-1-p.padInfo.top,v=db(i.shape,"float32"),k=n.bufferSync(o);for(let e=0;e<p.batchSize;++e)for(let t=0;t<p.inChannels;++t)for(let n=0;n<p.inDepth;++n)for(let r=0;r<p.inHeight;++r)for(let o=0;o<p.inWidth;++o){const i=n-w,a=r-S,s=o-x;let l=0;for(let n=0;n<b;n+=g){const r=(i+n)/d;if(!(r<0||r>=p.outDepth||Math.floor(r)!==r))for(let o=0;o<$;o+=m){const i=(a+o)/h;if(!(i<0||i>=p.outHeight||Math.floor(i)!==i))for(let a=0;a<_;a+=y){const u=(s+a)/f;if(u<0||u>=p.outWidth||Math.floor(u)!==u)continue;const d=b*$*_-1-c.get(e,r,i,u,t)===n*$*_+o*_+a?1:0;0!==d&&(l+=k.get(e,r,i,u,t)*d)}}}v.set(l,e,n,r,o,t)}return n.makeTensorInfo(v.shape,v.dtype,v.values)}},bO={kernelName:Kf,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{dy:o,input:i,output:a}=t,s=i;IA([i,a],"maxPoolGrad");const{filterSize:l,strides:u,pad:p,dimRoundingMode:c}=r,d=Jb(s.shape,l,u,1,p,c),h=n.data.get(s.dataId).values,f=db(d.outShape,s.dtype,WC(h,s.shape,s.dtype,d).values),g=d.strideHeight,m=d.strideWidth,y=d.dilationHeight,b=d.dilationWidth,$=d.effectiveFilterHeight,_=d.effectiveFilterWidth,w=_-1-d.padInfo.left,x=$-1-d.padInfo.top,S=db(s.shape,"float32"),v=n.data.get(o.dataId).values,k=db(o.shape,"float32",v);for(let e=0;e<d.batchSize;++e)for(let t=0;t<d.inChannels;++t)for(let n=0;n<d.inHeight;++n)for(let r=0;r<d.inWidth;++r){const o=n-x,i=r-w;let a=0;for(let n=0;n<$;n+=y){const r=(o+n)/g;if(!(r<0||r>=d.outHeight||Math.floor(r)!==r))for(let o=0;o<_;o+=b){const s=(i+o)/m;if(s<0||s>=d.outWidth||Math.floor(s)!==s)continue;const l=$*_-1-f.get(e,r,s,t)===n*_+o?1:0;0!==l&&(a+=k.get(e,r,s,t)*l)}}S.set(a,e,n,r,t)}return n.makeTensorInfo(S.shape,S.dtype,S.values)}},$O={kernelName:Jf,backendName:"cpu",kernelFunc:({inputs:e,attrs:t,backend:n})=>{const{x:r}=e,{filterSize:o,strides:i,pad:a,includeBatchInIndex:s}=t,l=n;IA(r,"MaxPoolWithArgmax");const u=l.data.get(r.dataId).values,p=Jb(r.shape,o,i,[1,1],a),[c,d]=function(e,t,n,r,o){const i=LC(e,0,n,Zd(t),o,"max"),a=WC(e,t,n,o,!0,r);return[i.values,a.values]}(u,r.shape,r.dtype,s,p),h=l.write(c,p.outShape,r.dtype),f=l.write(d,p.outShape,r.dtype);return[{dataId:h,shape:p.outShape,dtype:r.dtype},{dataId:f,shape:p.outShape,dtype:"int32"}]}},_O={kernelName:Zf,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{axis:i,keepDims:a}=r,s=zd(i,o.shape),l=Bd(l_(o.shape,s)[1]),u=[],p=n.makeTensorInfo([],"float32",new Float32Array([l]));u.push(p);
2const c=nC({inputs:{x:o},backend:n,attrs:{dtype:"float32"}});u.push(c);const d=oD({inputs:{a:c,b:p},backend:n});u.push(d);const h=LM({inputs:{x:d},backend:n,attrs:{axis:i,keepDims:a}});return u.forEach(e=>n.disposeIntermediateTensorInfo(e)),h}},wO={kernelName:Qf,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{axis:i,keepDims:a}=r;IA(o,"min");const s=zd(i,o.shape);let l=s;const u=c_(l,o.shape.length);let p=o;null!=u&&(p=SC({inputs:{x:o},backend:n,attrs:{perm:u}}),l=h_(l.length,o.shape.length)),p_("min",l,p.shape.length);const[c,d]=l_(p.shape,l),h=Bd(d),f=nh(Bd(c),p.dtype),g=n.data.get(p.dataId).values;for(let e=0;e<f.length;++e){const t=e*h;let n=g[t];for(let e=0;e<h;++e){const r=g[t+e];(Number.isNaN(r)||r<n)&&(n=r)}f[e]=n}null!=u&&n.disposeIntermediateTensorInfo(p);const m=n.makeTensorInfo(c,p.dtype,f);if(a){const e=pC({inputs:{x:m},backend:n,attrs:{shape:u_(c,s)}});return n.disposeIntermediateTensorInfo(m),e}return m}},xO=BA((e,t)=>Math.min(e,t)),SO=oC(eg,xO),vO={kernelName:eg,backendName:"cpu",kernelFunc:SO},kO={kernelName:tg,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{paddings:i,mode:a}=r;IA(o,"mirrorPad");const s=i.map((e,t)=>e[0]+o.shape[t]+e[1]),l=i.map(e=>e[0]),u=i.map((e,t)=>e[0]+o.shape[t]),p="reflect"===a?0:1,c=n.data.get(o.dataId).values,d=o.shape.length,h=Zd(o.shape),f=Bd(s),g=s.length,m=Zd(s),y=Vd(o.dtype,f);for(let e=0;e<f;e++){let t=ah(e,g,m);for(let e=0;e<g;e++)t[e]<l[e]?t[e]=2*l[e]-t[e]-p:t[e]>=u[e]&&(t[e]=2*(u[e]-1)-t[e]+p);t=t.map((e,t)=>e-l[t]);const n=ih(t,d,h);y[e]=c[n]}return{dataId:n.write(y,s,o.dtype),shape:s,dtype:o.dtype}}},EO=BA((e,t)=>{const n=e%t;return e<0&&t<0||e>=0&&t>=0?n:(n+t)%t}),IO=oC(ng,EO),TO={kernelName:ng,backendName:"cpu",kernelFunc:IO};function FO(e){const{inputs:t,backend:n,attrs:r}=e,{logits:o}=t,{dim:i}=r,a=o.shape.length;let s=i;if(-1===s&&(s=a-1),s!==a-1)throw Error(`Softmax along a non-last dimension is not yet supported. Logits was rank ${a} and dim was ${s}`);const l=zd([s],o.shape),u=pO({inputs:{x:o},backend:n,attrs:{reductionIndices:l,keepDims:!1}}),p=u_(u.shape,l),c=pC({inputs:{x:u},backend:n,attrs:{shape:p}}),d=lD({inputs:{a:o,b:c},backend:n}),h=YM({inputs:{x:d},backend:n}),f=LM({inputs:{x:h},backend:n,attrs:{axis:l,keepDims:!1}}
vendor: 32,361 bytes, line 2
2),g=pC({inputs:{x:f},backend:n,attrs:{shape:p}}),m=oD({inputs:{a:h,b:g},backend:n});return n.disposeIntermediateTensorInfo(u),n.disposeIntermediateTensorInfo(c),n.disposeIntermediateTensorInfo(d),n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(g),m}const NO={kernelName:zg,backendName:"cpu",kernelFunc:FO},jO={kernelName:rg,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{logits:o}=t,{numSamples:i,seed:a,normalized:s}=r;IA(o,"multinomial");const l=s?o:FO({inputs:{logits:o},backend:n,attrs:{dim:-1}}),u=l.shape[0],p=l.shape[1],c=n.data.get(l.dataId).values,d=[u,i],h=nh(Bd(d),"int32");for(let e=0;e<u;++e){const t=e*p,n=new Float32Array(p-1);n[0]=c[t];for(let e=1;e<n.length;++e)n[e]=n[e-1]+c[t+e];const r=v_.alea(a.toString()),o=e*i;for(let e=0;e<i;++e){const t=r();h[o+e]=n.length;for(let r=0;r<n.length;r++)if(t<n[r]){h[o+e]=r;break}}}return s||n.disposeIntermediateTensorInfo(l),n.makeTensorInfo(d,"int32",h)}};function AO(e,t,n){const r=Pm(-1,n);return OM([],t,r,e,n)}const CO={kernelName:ig,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n}=e,{x:r}=t;IA(r,"neg");const o=n.data.get(r.dataId).values,[i,a]=AO(o,r.shape,r.dtype);return n.makeTensorInfo(a,r.dtype,i)}},MO=Nw,DO={kernelName:sg,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{boxes:o,scores:i}=t,{maxOutputSize:a,iouThreshold:s,scoreThreshold:l}=r;IA(o,"NonMaxSuppression");const u=n.data.get(o.dataId).values,p=n.data.get(i.dataId).values,{selectedIndices:c}=MO(u,p,a,s,l);return n.makeTensorInfo([c.length],"int32",new Int32Array(c))}},OO=jw,RO={kernelName:lg,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{boxes:o,scores:i}=t,{maxOutputSize:a,iouThreshold:s,scoreThreshold:l,padToMaxOutputSize:u}=r;IA(o,"NonMaxSuppressionPadded");const p=n.data.get(o.dataId).values,c=n.data.get(i.dataId).values,{selectedIndices:d,validOutputs:h}=OO(p,c,a,s,l,u);return[n.makeTensorInfo([d.length],"int32",new Int32Array(d)),n.makeTensorInfo([],"int32",new Int32Array([h]))]}},BO=Aw,PO={kernelName:ug,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{boxes:o,scores:i}=t,{maxOutputSize:a,iouThreshold:s,scoreThreshold:l,softNmsSigma:u}=r;IA(o,"NonMaxSuppressionWithScore");const p=n.data.get(o.dataId).values,c=n.data.get(i.dataId).values,d=a,h=s,f=l,g=u,{selectedIndices:m,selectedScores:y}=BO(p,c,d,h,f,g);return[n.makeTensorInfo([m.length],"int32",new Int32Array(m)),n.makeTensorInfo([y.length],"float32",new Float32Array(y))]}},LO=BA((e,t)=>e!==t?1:0),WO=oC(ag,LO,null,"bool"),UO={kernelName:ag,backendName:"cpu",kernelFunc:WO},zO={kernelName:cg,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{indices:o}=t,{depth:i,onValue:a,offValue:s}=r;IA(o,"oneHot");const l=Bd(o.shape),u=new Float32Array(l*i);u.fill(s);const p=n.data.get(o.dataId).values;for(let e=0;e<l;++e)p[e]>=0&&p[e]<i&&(u[e*i+p[e]]=a);return n.makeTensorInfo([...o.shape,i],"int32",u)}};function VO(e){const{inputs:t,backend:n}=e,{x:r}=t;if("string"===r.dtype)throw new Error("zerosLike is not supported for string tensors");if("complex64"===r.dtype){const e=eC({inputs:{input:r},backend:n}),t=VO({inputs:{x:e},backend:n}),o=uM({inputs:{input:r},backend:n}),i=VO({inputs:{x:o},backend:n}),a=JA({inputs:{real:t,imag:i},backend:n});return n.disposeIntermediateTensorInfo(e),n.disposeIntermediateTensorInfo(t),n.disposeIntermediateTensorInfo(o),n.disposeIntermediateTensorInfo(i),a}return fD({backend:n,attrs:{shape:r.shape,value:0,dtype:r.dtype}})}const HO={kernelName:cm,backendName:"cpu",kernelFunc:VO},GO={kernelName:pg,backendName:"cpu",kernelFunc:function e(t){const{inputs:n,backend:r}=t,{x:o}=n;if("string"===o.dtype)throw new Error("onesLike is not supported for string tensors");if("complex64"===o.dtype){const t=eC({inputs:{input:o},backend:r}),n=e({inputs:{x:t},backend:r}),i=uM({inputs:{input:o},backend:r}),a=VO({inputs:{x:i},backend:r}),s=JA({inputs:{real:n,imag:a},backend:r});return r.disposeIntermediateTensorInfo(t),r.disposeIntermediateTensorInfo(n),r.disposeIntermediateTensorInfo(i),r.disposeIntermediateTensorInfo(a),s}return fD({backend:r,attrs:{shape:o.shape,value:1,dtype:o.dtype}})}};function qO(e){const{inputs:t,backend:n,attrs:r}=e,{axis:o}=r;if(1===t.length)return ZM({inputs:{input:t[0]},backend:n,attrs:{dim:o}});const i=t[0].shape,a=t[0].dtype;t.forEach(e=>{Dd(i,e.shape,"All tensors passed to stack must have matching shapes"),Md(a===e.dtype,()=>"All tensors passed to stack must have matching dtypes")});const s=[],l=cM({inputs:t.map(e=>{const t=ZM({inputs:{input:e},backend:n,attrs:{dim:o}});return s.push(t),t}),backend:n,attrs:{axis:o}});return s.forEach(e=>n.disposeIntermediateTensorInfo(e)),l}const KO={kernelName:dg,backendName:"cpu",kernelFunc:qO},XO={kernelName:hg,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{paddings:i,constantValue:a}=r;IA(o,"pad");const s=i.map((e,t)=>e[0]+o.shape[t]+e[1]),l=i.map(e=>e[0]),u=n.data.get(o.dataId).values,p=Bd(o.shape),c=o.shape.length,d=Zd(o.shape),h=Bd(s),f=s.length,g=Zd(s),m=Vd(o.dtype,h);0!==a&&m.fill(a);for(let e=0;e<p;e++)m[ih(ah(e,c,d).map((e,t)=>e+l[t]),f,g)]=u[e];return{dataId:n.write(m,s,o.dtype),shape:s,dtype:o.dtype}}},YO=BA((e,t)=>Math.pow(e,t)),JO=oC(fg,YO),ZO={kernelName:fg,backendName:"cpu",kernelFunc:JO};function QO(e,t,n,r){const[o,i]=l_(e,r),a=py(t,"int32"),s=nh(Bd(o),a),l=Bd(i);for(let e=0;e<s.length;++e){const t=e*l;let r=1;for(let e=0;e<l;++e)r*=n[t+e];s[e]=r}return{outVals:s,outShape:o,outDtype:a}}const eR={kernelName:mg,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{axis:i,keepDims:a}=r;IA(o,"prod");const s=o.shape.length,l=zd(i,o.shape),u=c_(l,s);let p=l,c=o;const d=[];null!=u&&(c=SC({inputs:{x:o},backend:n,attrs:{perm:u}}),d.push(c),p=h_(p.length,s));const h=n.data.get(c.dataId).values,{outVals:f,outShape:g,outDtype:m}=QO(c.shape,c.dtype,h,p);let y=g;return a&&(y=u_(g,l)),d.forEach(e=>n.disposeIntermediateTensorInfo(e)),n.makeTensorInfo(y,m,f)}};function tR(e,t,n,r){if(e===t||e<t&&n<0||t<e&&n>1)return nh(0,r);const o=nh(Math.abs(Math.ceil((t-e)/n)),r);t<e&&1===n&&(n=-1),o[0]=e;for(let e=1;e<o.length;e++)o[e]=o[e-1]+n;return o}const nR={kernelName:yg,backendName:"cpu",kernelFunc:function(e){const{backend:t,attrs:n}=e,{start:r,stop:o,dtype:i,step:a}=n,s=tR(r,o,a,i);return t.makeTensorInfo([s.length],i,s)}},rR=NA($g,e=>1/e),oR={kernelName:$g,backendName:"cpu",kernelFunc:rR},iR={kernelName:vg,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{images:o}=t,{alignCorners:i,halfPixelCenters:a,size:s}=r;IA(o,"resizeBilinear");const l=Zd(o.shape),[u,p]=s,[c,d,h,f]=o.shape,g=n.data.get(o.dataId).values,m=new Float32Array(Bd([c,u,p,f])),y=[i&&u>1?d-1:d,i&&p>1?h-1:h],b=[i&&u>1?u-1:u,i&&p>1?p-1:p];let $=0;const _=y[0]/b[0],w=y[1]/b[1];for(let e=0;e<c;e++)for(let t=0;t<u;t++){let n;n=a?_*(t+.5)-.5:_*t;const r=Math.max(0,Math.floor(n)),o=n-r,i=Math.min(d-1,Math.ceil(n)),s=e*l[0]+r*l[1],u=e*l[0]+i*l[1];for(let e=0;e<p;e++){let t;t=a?w*(e+.5)-.5:w*e;const n=Math.max(0,Math.floor(t)),r=t-n,i=Math.min(h-1,Math.ceil(t)),p=s+n*l[2],c=u+n*l[2],d=s+i*l[2],y=u+i*l[2];for(let e=0;e<f;e++){const t=g[p+e],n=g[c+e],i=t+(g[d+e]-t)*r,a=i+(n+(g[y+e]-n)*r-i)*o;m[$++]=a}}}return n.makeTensorInfo([c,u,p,f],"float32",m)}},aR={kernelName:kg,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{images:o,dy:i}=t,{alignCorners:a}=r;IA([i,o],"resizeBilinearGrad");const s=Zd(o.shape),[l,u,p,c]=o.shape,[,d,h]=i.shape,f=new Float32Array(l*u*p*c),g=[a&&d>1?u-1:u,a&&h>1?p-1:p],m=[a&&d>1?d-1:d,a&&h>1?h-1:h],y=g[0]/m[0],b=g[1]/m[1],$=n.data.get(i.dataId).values;let _=0;for(let e=0;e<l;e++){const t=e*s[0];for(let e=0;e<d;e++){const n=e*y,r=Math.floor(n),o=Math.min(Math.ceil(n),u-1),i=t+r*s[1],a=t+o*s[1],l=n-r,d=1-l;for(let e=0;e<h;e++){const t=e*b,n=Math.floor(t),r=Math.min(Math.ceil(t),p-1),o=t-n,u=1-o,h=i+n*s[2],g=i+r*s[2],m=a+n*s[2],y=a+r*s[2],w=d*u,x=d*o,S=l*u,v=l*o;for(let e=0;e<c;e++){const t=$[_++];f[h+e]+=t*w,f[g+e]+=t*x,f[m+e]+=t*S,f[y+e]+=t*v}}}}return n.makeTensorInfo([l,p,u,c],"float32",f)}},sR={kernelName:xg,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{images:o}=t,{alignCorners:i,halfPixelCenters:a,size:s}=r;IA(o,"resizeNearestNeighbor");const l=Zd(o.shape),[u,p]=s,[c,d,h,f]=o.shape,g=n.data.get(o.dataId).values,m=new Float32Array(c*u*p*f),y=[i&&u>1?d-1:d,i&&p>1?h-1:h],b=[i&&u>1?u-1:u,i&&p>1?p-1:p],$=y[0]/b[0],_=y[1]/b[1];let w=0;for(let e=0;e<c;e++){const t=e*l[0];for(let e=0;e<u;e++){const n=a?$*(e+.5):$*e;let r=Math.min(d-1,i?Math.round(n):Math.floor(n));a&&(r=Math.max(0,r));const o=t+r*l[1];for(let e=0;e<p;e++){const t=a?_*(e+.5):_*e;let n=Math.min(h-1,i?Math.round(t):Math.floor(t));a&&(n=Math.max(0,n));const r=o+n*l[2];for(let e=0;e<f;e++){const t=g[r+e];m[w++]=t}}}}return n.makeTensorInfo([c,u,p,f],o.dtype,m)}},lR={kernelName:Sg,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{images:o,dy:i}=t,{alignCorners:a}=r;IA([i,o],"resizeNearestNeighborGrad");const s=Zd(o.shape),l=Zd(i.shape),[u,p,c,d]=o.shape,[,h,f]=i.shape,g=new Float32Array(u*p*c*d),m=n.data.get(i.dataId).values,y=[a&&h>1?p-1:p,a&&f>1?c-1:c],b=[a&&h>1?h-1:h,a&&f>1?f-1:f],$=y[0]/b[0],_=y[1]/b[1],w=1/$,x=1/_,S=2*Math.ceil(w)+2,v=2*Math.ceil(x)+2;for(let e=0;e<u;e++){const t=e*s[0];for(let e=0;e<p;e++){const n=t+e*s[1],r=Math.floor(e*w),o=Math.floor(r-S/2);for(let r=0;r<c;r++){const i=n+r*s[2],u=Math.floor(r*x),y=Math.floor(u-v/2);for(let n=0;n<d;n++){let s=0;for(let i=0;i<S;i++){const u=i+o;if(u<0||u>=h)continue;const d=t+u*l[1],g=u*$;if(e===Math.min(p-1,a?Math.round(g):Math.floor(g)))for(let e=0;e<v;e++){const t=e+y;if(t<0||t>=f)continue;const o=d+t*l[2],i=t*_;r===Math.min(c-1,a?Math.round(i):Math.floor(i))&&(s+=m[o+n])}}g[i+n]=s}}}}return n.makeTensorInfo(o.shape,o.dtype,g)}},uR={kernelName:Ig,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{dims:i}=r;IA(o,"reverse");const a=o.shape.length,s=zd(i,o.shape);if(0===a)return MA({inputs:{x:o},backend:n});const l=new Zm(o.shape,o.dtype),u=n.bufferSync(o);for(let e=0;e<l.size;e++){const t=l.indexToLoc(e),n=t.slice();s.forEach(e=>n[e]=o.shape[e]-1-n[e]),l.set(u.get(...n),...t)}return n.makeTensorInfo(l.shape,l.dtype,l.values)}},pR={kernelName:fm,backendName:"cpu",kernelFunc:({inputs:e,attrs:t,backend:n})=>{const{image:r}=e,{radians:o,fillValue:i,center:a}=t,s=n,l=Vd(r.dtype,Bd(r.shape)),[u,p,c,d]=r.shape,[h,f]=Fx(a,p,c),g=Math.sin(o),m=Math.cos(o),y=s.data.get(r.dataId).values;for(let e=0;e<u;e++){const t=e*c*p*d;for(let e=0;e<p;e++){const n=e*(c*d);for(let r=0;r<c;r++){const o=r*d;for(let a=0;a<d;a++){const s=[u,e,r,a],b=s[2],$=s[1];let _=(b-h)*m-($-f)*g,w=(b-h)*g+($-f)*m;_=Math.round(_+h),w=Math.round(w+f);let x=i;"number"!=typeof i&&(x=3===a?255:i[a]),_>=0&&_<c&&w>=0&&w<p&&(x=y[t+w*(c*d)+_*d+a]),l[t+n+o+a]=x}}}}return{dataId:s.write(l,r.shape,r.dtype),shape:r.shape,dtype:r.dtype}}},cR=NA(Tg,e=>{const t=Math.floor(e);return e-t<.5?Math.floor(e):e-t>.5?Math.ceil(e):t%2==0?t:t+1}),dR={kernelName:Tg,backendName:"cpu",kernelFunc:cR},hR=GA(e=>1/Math.sqrt(e)),fR=jA(Fg,hR),gR={kernelName:Fg,backendName:"cpu",kernelFunc:fR};function mR(e,t,n,r,o,i,a,s,l,u){const p=[r/o,o],c=e.values,d=t.values;if(0===r)return db(n,t.dtype);const h=db(p,t.dtype);h.values.fill(l);for(let e=0;e<i;e++){const i=[];let l=0;for(let t=0;t<a;t++){const n=c[e*a+t];i.push(n),l+=n*s[t]}if(l<0||l>=r/o)throw new Error(`Invalid indices: ${i} does not index into ${n}`);for(let n=0;n<o;n++)u?h.values[l*o+n]+=d[e*o+n]:h.values[l*o+n]=0===t.rank?d[0]:d[e*o+n]}return h}const yR={kernelName:Ng,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{indices:o,updates:i}=t,{shape:a}=r,{sliceRank:s,numUpdates:l,sliceSize:u,strides:p,outputSize:c}=Ib(0,o,a),d=mR(n.bufferSync(o),n.bufferSync(i),a,c,u,l,s,p,0,!0);return n.makeTensorInfo(a,d.dtype,d.values)}},bR={kernelName:jg,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n}=e,{condition:r,t:o,e:i}=t;IA([r,o,i],"select");const a=r.shape.length,s=n.data.get(r.dataId).values,l=n.data.get(o.dataId).values,u=n.data.get(i.dataId).values,p=py(o.dtype,i.dtype),c=nh(Bd(o.shape),p);let d=0;const h=0===a||a>1||1===o.shape.length?1:Bd(o.shape.slice(1));for(let e=0;e<s.length;e++)for(let t=0;t<h;t++)1===s[e]?c[d++]=l[e]:c[d++]=u[e];return n.makeTensorInfo(o.shape,p,c)}},$R=Dx,_R=Ox,wR=NA(Ag,e=>e>=0?_R*e:$R*(Math.exp(e)-1)),xR={kernelName:Ag,backendName:"cpu",kernelFunc:wR},SR=NA(Og,e=>e<0?-1:e>0?1:0),vR={kernelName:Og,backendName:"cpu",kernelFunc:SR},kR=NA(Mg,e=>Math.sin(e)),ER={kernelName:Mg,backendName:"cpu",kernelFunc:kR},IR=NA(Dg,e=>Math.sinh(e)),TR={kernelName:Dg,backendName:"cpu",kernelFunc:IR},FR=Math.log(1.1920928955078125e-7)+2,NR=NA(Bg,e=>{const t=e>-FR,n=e<FR,r=Math.exp(e);let o;return o=n?r:t?e:Math.log(1+r),o}),jR={kernelName:Bg,backendName:"cpu",kernelFunc:NR},AR={kernelName:Wg,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{blockShape:i,paddings:a}=r;IA([o],"spaceToBatchND");const s=Bd(i),l=[[0,0]];l.push(...a);for(let e=1+i.length;e<o.shape.length;++e)l.push([0,0]);const u=XO.kernelFunc({inputs:{x:o},backend:n,attrs:{paddings:l,constantValue:0}}),p=Nx(u.shape,i,s,!1),c=jx(p.length,i.length,!1),d=Ax(u.shape,i,s,!1),h=pC({inputs:{x:u},backend:n,attrs:{shape:p}}),f=SC({inputs:{x:h},backend:n,attrs:{perm:c}}),g=pC({inputs:{x:f},backend:n,attrs:{shape:d}});return n.disposeIntermediateTensorInfo(u),n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(f),g}};function CR(e,t,n,r,o,i,a){const s=t[0],l=i[0],u=new Array(l),p=new Array(s),c=t[1];if(0===l){if(0!==s)throw new Error(`Received SparseTensor with denseShape[0] = 0 but\n         indices.shape[0] = ${s}`);return[Hd(n,0),[0,c],Hd(o,0),u,p]}let d=!0,h=0;const f=new Array(l).fill(0);for(let t=0;t<s;++t){const n=e[t*c];if(n<0)throw new Error(`indices(${t}, 0) is invalid: ${n} < 0`);if(n>=l)throw new Error(`indices(${t}, 0) is invalid: ${n} >= ${l}`);++f[n],d=d&&n>=h,h=n}let g=!0;for(let e=0;e<l;++e){const t=0===f[e];u[e]=t,g=g&&!t,f[e]=Math.max(f[e],1),e>0&&(f[e]+=f[e-1])}if(g&&d){const t=e,n=r;for(let e=0;e<s;++e)p[e]=e;return[t,[s,c],n,u,p]}{const t=f[l-1],i=Hd(n,t*c),d=Hd(o,t),h=new Array(l).fill(0);for(let t=0;t<s;++t){const n=e[t*c],o=h[n],a=(0===n?0:f[n-1])+o;h[n]++;for(let n=0;n<c;++n)i[a*c+n]=e[t*c+n];d[a]=r[t],p[t]=a}for(let e=0;e<l;++e)if(0===h[e]){const t=0===e?0:f[e-1];i[t*c+0]=e;for(let e=1;e<c;++e)i[t*c+e]=0;d[t]=a}return[i,[t,c],d,u,p]}}const MR={kernelName:Vg,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n}=e,{indices:r,values:o,denseShape:i,defaultValue:a}=t;if(1!==i.shape.length)throw new Error(`Dense shape must be a vector, saw:\n        ${i.shape}`);if(2!==r.shape.length)throw new Error(`Indices must be a matrix, saw:\n        ${r.shape}`);if(1!==o.shape.length)throw new Error(`Values must be a vector, saw:\n        ${o.shape}`);if(0!==a.shape.length)throw new Error(`Default value must be a scalar, saw:\n        ${a.shape}`);const s=n.data.get(r.dataId).values,l=n.data.get(o.dataId).values,u=n.data.get(i.dataId).values,p=n.data.get(a.dataId).values[0],[c,d,h,f,g]=CR(s,r.shape,r.dtype,l,o.dtype,u,p);return[n.makeTensorInfo(d,r.dtype,c),n.makeTensorInfo([d[0]],o.dtype,h),n.makeTensorInfo([f.length],"bool",new Uint8Array(f.map(e=>Number(e)))),n.makeTensorInfo([g.length],r.dtype,new Int32Array(g))]}};function DR(e,t,n,r,o){const i=Bd(r),a=t[0],s=o.length,l=[];let u=1,p=-1;for(let e=0;e<s;++e){const t=o[e];if(-1===t){if(-1!==p)throw new Error(`only one output dimension may be -1, not both ${p} and ${e}`);p=e,l.push(1)}else{if(t<0)throw new Error(`size ${e} must be non-negative, not ${t}`);u*=t,l.push(t)}}if(-1!==p){if(u<=0)throw new Error("reshape cannot infer the missing input size for an empty tensor unless all specified input sizes are non-zero");const e=Math.trunc(i/u);if(u*e!==i)throw new Error(`Input to reshape is a SparseTensor with ${i}\n          dense values, but the requested shape requires a multiple of ${u}. inputShape=${r} outputShape= ${l}`);l[p]=e}const c=Bd(l);if(c!==i)throw new Error(`Input to reshape is a tensor with ${i} dense values, but the requested shape has ${c}. inputShape=${r} outputShape=${l}`);const d=r.length,h=[];if(d>0){h[d-1]=1;for(let e=d-2;e>=0;--e)h[e]=h[e+1]*r[e+1]}const f=[];if(s>0){f[s-1]=1;for(let e=s-2;e>=0;--e)f[e]=f[e+1]*l[e+1]}const g=Hd(n,a*s);for(let t=0;t<a;++t){let n=0;for(let r=0;r<d;++r)n+=e[t*d+r]*h[r];for(let e=0;e<s;++e)g[t*s+e]=Math.trunc(n/f[e]),n%=f[e]}return[g,[a,s],l]}const OR={kernelName:Hg,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n}=e,{inputIndices:r,inputShape:o,newShape:i}=t;if(2!==r.shape.length)throw new Error(`Input indices should be a matrix but received shape\n        ${r.shape}`);if(1!==o.shape.length)throw new Error(`Input shape should be a vector but received shape\n        ${o.shape}`);if(1!==i.shape.length)throw new Error(`Target shape should be a vector but received shape ${i.shape}`);const a=Array.from(n.data.get(o.dataId).values),s=n.data.get(r.dataId).values,l=Array.from(n.data.get(i.dataId).values),[u,p,c]=DR(s,r.shape,r.dtype,a,l);return[n.makeTensorInfo(p,r.dtype,u),n.makeTensorInfo([c.length],i.dtype,new Int32Array(c))]}};function RR(e,t,n,r,o,i=!1,a=0){const s=r.length;if(s!==o.length)throw new Error("segmentIds and indices should have same size.");const l=[t[0],e.length/t[0]],u=l[1],p=s>0?o[s-1]+1:0;if(p<0)throw new Error("segment ids must be >= 0");const c=t.slice();c[0]=p;const d=Hd(n,c.reduce((e,t)=>e*t,1));if(0===s)return p>0&&d.fill(a),[d,c];if(p<=0)throw new Error("segment ids must be >= 0");let h=0,f=1,g=0,m=o[h];for(;;){let t=0;if(f<s){if(t=o[f],m===t){++f;continue}if(m>=t)throw new Error("segment ids are not increasing")}if(m<0||m>=p)throw new Error(`Segment id ${m} out of range [0, ${p}), possibly because segmentIds input is not sorted.`);m>g&&d.fill(a,g*u,m*u);for(let t=h;t<f;++t){const n=r[t];if(n<0||n>=l[0])throw new Error(`Bad: indices[${t}] == ${r[t]} out of range [0, ${l[0]})`);for(let t=0;t<u;t++)d[m*u+t]+=e[n*u+t]}if(i)for(let e=0;e<u;e++)d[m*u+e]/=f-h;if(h=f,++f,g=m+1,m=t,f>s)break}return g<p&&d.fill(a,g*u,p*u),[d,c]}const BR={kernelName:Gg,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n}=e,{data:r,indices:o,segmentIds:i}=t;if(r.shape.length<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(1!==o.shape.length)throw new Error(`Indices should be a vector but received shape\n          ${o.shape}`);if(1!==i.shape.length)throw new Error(`Segment ids should be a vector but received shape\n          ${i.shape}`);const a=n.data.get(r.dataId).values,s=n.data.get(o.dataId).values,l=n.data.get(i.dataId).values,[u,p]=RR(a,r.shape,r.dtype,s,l,!0);return n.makeTensorInfo(p,r.dtype,u)}},PR={kernelName:qg,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n}=e,{data:r,indices:o,segmentIds:i}=t;if(r.shape.length<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(1!==o.shape.length)throw new Error(`Indices should be a vector but received shape\n         ${o.shape}`);if(1!==i.shape.length)throw new Error(`Segment ids should be a vector but received shape\n         ${i.shape}`);const a=n.data.get(r.dataId).values,s=n.data.get(o.dataId).values,l=n.data.get(i.dataId).values,[u,p]=RR(a,r.shape,r.dtype,s,l);return n.makeTensorInfo(p,r.dtype,u)}},LR={kernelName:Kg,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{sparseIndices:o,sparseValues:i,defaultValue:a}=t,{outputShape:s}=r,{sliceRank:l,numUpdates:u,sliceSize:p,strides:c,outputSize:d}=Ib(0,o,s),h=mR(n.bufferSync(o),n.bufferSync(i),s,d,p,u,l,c,n.data.get(a.dataId).values[0],!1);return n.makeTensorInfo(s,h.dtype,h.values)}},WR={kernelName:Ug,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{numOrSizeSplits:i,axis:a}=r,s=zd(a,o.shape)[0],l=Hx(o,i,s),u=new Array(o.shape.length).fill(0),p=o.shape.slice();return l.map(e=>{const t=[...p];t[s]=e;const r=XC({inputs:{x:o},backend:n,attrs:{begin:u,size:t}});return u[s]+=e,r})}},UR=GA(e=>Math.sqrt(e)),zR=NA(Pg,e=>Math.sqrt(e)),VR={kernelName:Pg,backendName:"cpu",kernelFunc:zR},HR={kernelName:Yg,backendName:"cpu",kernelFunc:({inputs:e,backend:t})=>{const{x:n}=e,r=t;IA(n,"square");const o=r.data.get(n.dataId).values,i=new Float32Array(o.length);for(let e=0;e<o.length;++e){const t=o[e];i[e]=t*t}return{dataId:r.write(i,n.shape,n.dtype),shape:n.shape,dtype:n.dtype}}},GR=BA((e,t)=>{const n=e-t;return n*n}),qR=oC(Xg,GR),KR={kernelName:Xg,backendName:"cpu",kernelFunc:qR},XR=NA(dm,(e,t)=>{const n=t;return isNaN(e)?NaN:e>0?1:n.alpha}),YR={kernelName:dm,backendName:"cpu",kernelFunc:XR};function JR(e,t,n,r){const o=db(e,t.dtype);for(let e=0;e<o.size;e++){const i=o.indexToLoc(e),a=new Array(i.length);for(let e=0;e<a.length;e++)a[e]=i[e]*n[e]+r[e];o.set(t.get(...a),...i)}return o}const ZR={kernelName:Jg,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{begin:i,end:a,strides:s,beginMask:l,endMask:u,ellipsisMask:p,newAxisMask:c,shrinkAxisMask:d}=r;IA(o,"stridedSlice");const{nonStrided:h,$begin:f,$strides:g,size:m,newShape:y,outShape:b}=jb(o.shape,i,a,s,l,u,p,c,d),$=pC({inputs:{x:o},backend:n,attrs:{shape:y}});let _;if(h){const e=XC({inputs:{x:$},backend:n,attrs:{begin:f,size:m}});_=pC({inputs:{x:e},backend:n,attrs:{shape:b}}),n.disposeIntermediateTensorInfo(e)}else if(b.some(e=>0===e))_=n.makeTensorInfo(b,o.dtype,[]);else{const e=JR(b,n.bufferSync($),g,f);_=n.makeTensorInfo(e.shape,e.dtype,e.values)}const w=pC({inputs:{x:_},backend:n,attrs:{shape:b}});return n.disposeIntermediateTensorInfo($),n.disposeIntermediateTensorInfo(_),w}};class QR{constructor(e,t,n,r,o,i){this.separator=Um(e),this.nGramWidths=t,this.leftPad=Um(n),this.rightPad=Um(r),this.padWidth=o,this.preserveShort=i}getPadWidth(e){return Math.min(this.padWidth<0?e-1:this.padWidth,e-1)}getNumNGrams(e,t){const n=this.getPadWidth(t);return Math.max(0,e+2*n-t+1)}createNGrams(e,t,n,r,o,i){for(let a=0;a<o;++a){const s=this.getPadWidth(i),l=Math.max(0,s-a),u=Math.max(0,s-(o-(a+1))),p=i-(l+u),c=t+(l>0?0:a-s);let d=0;d+=l*this.leftPad.length;for(let t=0;t<p;++t)d+=e[c+t].length;d+=u*this.rightPad.length,d+=(l+u+p-1)*this.separator.length,n[r+a]=new Uint8Array(d);const h=n[r+a];let f=0;const g=e=>e.forEach(e=>h[f++]=e);for(let e=0;e<l;++e)g(this.leftPad),g(this.separator);for(let t=0;t<p-1;++t)g(e[c+t]),g(this.separator);if(p>0){g(e[c+p-1]);for(let e=0;e<u;++e)g(this.separator),g(this.rightPad)}else{for(let e=0;e<u-1;++e)g(this.rightPad),g(this.separator);g(this.rightPad)}}}compute(e,t){const n=e.length,r=t.length;if(r>0){let e=t[0];if(0!==e)throw new Error(`First split value must be 0, got ${e}`);for(let o=1;o<r;++o){let r=t[o]>=e;if(r=r&&t[o]<=n,!r)throw new Error(`Invalid split value ${t[o]}, must be in [${e}, ${n}]`);e=t[o]}if(e!==n)throw new Error(`Last split value must be data size. Expected ${n}, got ${e}`)}const o=r-1,i=Hd("int32",r);if(0===n||0===r){const e=new Array(n);for(let e=0;e<=o;++e)i[e]=0;return[e,i]}i[0]=0;for(let e=1;e<=o;++e){const n=t[e]-t[e-1];let r=0;this.nGramWidths.forEach(e=>{r+=this.getNumNGrams(n,e)}),this.preserveShort&&n>0&&0===r&&(r=1),i[e]=i[e-1]+r}const a=new Array(i[o]);for(let n=0;n<o;++n){const r=t[n];let o=i[n];if(this.nGramWidths.forEach(i=>{const s=t[n+1]-t[n],l=this.getNumNGrams(s,i);this.createNGrams(e,r,a,o,l,i),o+=l}),this.preserveShort&&o===i[n]){const i=t[n+1]-t[n];if(0===i)continue;const s=i+2*this.padWidth,l=1;this.createNGrams(e,r,a,o,l,s)}}return[a,i]}}function eB(e,t,n,r,o,i,a,s){return new QR(n,r,o,i,a,s).compute(e,t)}const tB={kernelName:Zg,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{separator:o,nGramWidths:i,leftPad:a,rightPad:s,padWidth:l,preserveShortSequences:u}=r,{data:p,dataSplits:c}=t,d=n.data.get(p.dataId).values,h=n.data.get(c.dataId).values,[f,g]=eB(d,h,o,i,a,s,l,u);return[n.makeTensorInfo([f.length],"string",f),n.makeTensorInfo(c.shape,"int32",g)]}};function nB(e,t,n,r){if(!e.length)return;if(0===t.length){for(let t=0;t<e.length;++t)r.push(e.subarray(t,t+1));return}if(1===t.length){const o=t[0];let i=e.indexOf(o);for(;-1!==i;){const t=e.subarray(0,i);n&&0===t.length||r.push(t),i=(e=e.subarray(i+1)).indexOf(o)}return void(n&&0===e.length||r.push(e))}let o=0;for(let i=0;i<e.length+1;i++)if(i===e.length||-1!==t.indexOf(e[i])){const t=e.subarray(o,i);n&&0===t.length||r.push(t),o=i+1}}function rB(e,t,n){const r=e.length,o=[];let i=0,a=0;const s=new Array(r);for(let l=0;l<r;++l){const r=o.length;nB(e[l],t,n,o);const u=o.length-r;s[l]=u,i+=u,a=Math.max(a,u)}const l=Hd("int32",2*i),u=new Array(i),p=[r,a];let c=0;for(let e=0;e<r;++e)for(let t=0;t<s[e];++t)l[2*c]=e,l[2*c+1]=t,u[c]=o[c],++c;return[l,u,p]}const oB={kernelName:Qg,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{skipEmpty:o}=r,{input:i,delimiter:a}=t;if("string"!==i.dtype)throw new Error("Input must be of datatype string");if(1!==i.shape.length)throw new Error(`Input must be a vector, got shape: ${i.shape}`);if(0!==a.shape.length)throw new Error(`Delimiter must be a scalar, got shape: ${a.shape}`);const s=n.data.get(i.dataId).values,l=n.data.get(a.dataId).values[0],[u,p,c]=rB(s,l,o),d=p.length;return[n.makeTensorInfo([d,2],"int32",u),n.makeTensorInfo([d],"string",p),n.makeTensorInfo([2],"int32",new Int32Array(c))]}};function iB(e,t){const n=Hd("int32",e.length);for(let r=0;r<e.length;++r)n[r]=Bm(e[r]).modulo(t).getLowBitsUnsigned();return n}const aB={kernelName:em,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{numBuckets:o}=r,{input:i}=t;if("string"!==i.dtype)throw new Error("Input must be of datatype string");if(o<=0)throw new Error("Number of buckets must be at least 1");const a=iB(n.data.get(i.dataId).values,o);return n.makeTensorInfo(i.shape,"int32",a)}},sB=NA(nm,e=>Math.tan(e)),lB={kernelName:nm,backendName:"cpu",kernelFunc:sB},uB=NA(rm,e=>Math.tanh(e));function pB(e,t){const n=new Array(e.rank);for(let r=0;r<n.length;r++)n[r]=e.shape[r]*t[r];const r=db(n,e.dtype);for(let t=0;t<r.values.length;++t){const n=r.indexToLoc(t),o=new Array(e.rank);for(let t=0;t<o.length;t++)o[t]=n[t]%e.shape[t];const i=e.locToIndex(o);r.values[t]=e.values[i]}return r}const cB=(e,t)=>{const n=t.value-e.value;return 0===n?e.index-t.index:n};function dB(e,t,n=0,r=e.length-1){for(;r>n;){if(r-n>600){const o=r-n+1,i=t-n+1,a=Math.log(o),s=.5*Math.exp(2*a/3),l=.5*Math.sqrt(a*s*(o-s)/o)*Math.sign(i-o/2);dB(e,t,Math.max(n,Math.floor(t-i*s/o+l)),Math.min(r,Math.floor(t+(o-i)*s/o+l)))}const o=e[t];let i=n,a=r;for(Cd(e,n,t),cB(e[r],o)>0&&Cd(e,n,r);i<a;){for(Cd(e,i,a),i++,a--;cB(e[i],o)<0;)i+=1;for(;cB(e[a],o)>0;)a-=1}0===cB(e[n],o)?Cd(e,n,a):(a+=1,Cd(e,a,r)),a<=t&&(n=a+1),t<=a&&(r=a-1)}}function hB(e,t,n,r,o){const i=t[t.length-1],[a,s]=[e.length/i,i],l=Vd(n,a*r),u=Vd("int32",a*r);for(let t=0;t<a;t++){const n=t*s,i=e.subarray(n,n+s);let a=new Array(i.length);i.forEach((e,t)=>a[t]={value:e,index:t}),r<a.length&&(dB(a,r),a=a.slice(0,r)),o&&a.sort(cB);const p=t*r,c=l.subarray(p,p+r),d=u.subarray(p,p+r);for(let e=0;e<r;e++)c[e]=a[e].value,d[e]=a[e].index}const p=t.slice();return p[p.length-1]=r,[db(p,n,l),db(p,"int32",u)]}const fB={kernelName:am,backendName:"cpu",kernelFunc:function(e){const{inputs:t,attrs:n,backend:r}=e,{image:o,transforms:i}=t,{interpolation:a,fillMode:s,fillValue:l,outputShape:u}=n,[p,c,d,h]=o.shape,[f,g]=null!=u?u:[c,d],m=[p,f,g,h],y=Zd(o.shape),b=y[0],$=y[1],_=y[2],w=Vd(o.dtype,Bd(m));w.fill(l);const x=r.data.get(o.dataId).values,S=r.data.get(i.dataId).values;for(let e=0;e<p;++e){const t=1===i.shape[0]?S:S.subarray(8*e,8*e+8);for(let n=0;n<f;++n)for(let r=0;r<g;++r)for(let o=0;o<h;++o){let i;const u=t[6]*r+t[7]*n+1;if(0===u)continue;const p=(t[0]*r+t[1]*n+t[2])/u,h=(t[3]*r+t[4]*n+t[5])/u,f=gB(p,d,s),g=gB(h,c,s);switch(a){case"nearest":i=yB(x,c,d,b,$,_,e,g,f,o,l);break;case"bilinear":i=bB(x,c,d,b,$,_,e,g,f,o,l);break;default:throw new Error(`Error in Transform: Expect 'nearest' or 'bilinear', but got ${a}`)}w[e*b+n*$+r*_+o]=i}return r.makeTensorInfo(m,o.dtype,w)}return{dataId:r.write(w,m,o.dtype),shape:o.shape,dtype:o.dtype}}};function gB(e,t,n){switch(n){case"reflect":return function(e,t){let n=e;if(n<0)if(t<=1)n=0;else{const e=2*t;n<e&&(n=e*Math.trunc(-n/e)+n),n=n<-t?n+e:-n-1}else if(n>t-1)if(t<=1)n=0;else{const e=2*t;n-=e*Math.trunc(n/e),n>=t&&(n=e-n-1)}return Ad(0,n,t-1)}(e,t);case"wrap":return function(e,t){let n=e;if(n<0)if(t<=1)n=0;else{const e=t-1;n+=t*(Math.trunc(-n/e)+1)}else if(n>t-1)if(t<=1)n=0;else{const e=t-1;n-=t*Math.trunc(n/e)}return Ad(0,n,t-1)}(e,t);case"nearest":return function(e,t){return Ad(0,e,t-1)}(e,t);default:return e}}function mB(e,t,n,r,o,i,a,s,l,u,p){return 0<=s&&s<t&&0<=l&&l<n?e[a*r+s*o+l*i+u]:p}function yB(e,t,n,r,o,i,a,s,l,u,p){return mB(e,t,n,r,o,i,a,Math.round(s),Math.round(l),u,p)}function bB(e,t,n,r,o,i,a,s,l,u,p){const c=Math.floor(s),d=Math.floor(l),h=c+1,f=d+1;return(h-s)*((f-l)*mB(e,t,n,r,o,i,a,c,d,u,p)+(l-d)*mB(e,t,n,r,o,i,a,c,f,u,p))+(s-c)*((f-l)*mB(e,t,n,r,o,i,a,h,d,u,p)+(l-d)*mB(e,t,n,r,o,i,a,h,f,u,p))}function $B(e,t,n,r){const o=zd(t,n)[0],i=[1,n[0],1];for(let e=0;e<o;e++)i[0]*=n[e];i[1]=n[o];for(let e=o+1;e<n.length;e++)i[2]*=n[e];const a={},s=new Int32Array(n[o]),l=new Zm(i,r,e),u=[],p=1===i[0]&&1===i[2];for(let t=0;t<n[o];t++){let n;if(p)n=e[t].toString();else{const e=[];for(let n=0;n<i[0];n++)for(let r=0;r<i[2];r++)e.push(l.get(n,t,r));n=e.join(",")}if(void 0!==a[n])s[t]=a[n];else{const e=Object.keys(a).length;a[n]=e,s[t]=e,u.push(t)}}const c=i.slice();c[1]=Object.keys(a).length;const d=new Zm(c,r);u.forEach((e,t)=>{for(let n=0;n<i[0];n++)for(let r=0;r<i[2];r++)d.set(l.get(n,e,r),n,t,r)});const h=n.slice();return h[o]=c[1],{outputValues:d.values,outputShape:h,indices:s}}const _B={kernelName:pm,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o,segmentIds:i}=t,{numSegments:a}=r;IA(o,"unsortedSegmentSum");const s=[],l=[],u=o.shape.length-i.shape.length;let p=i;for(let e=0;e<u;++e){const t=ZM({inputs:{input:p},backend:n,attrs:{dim:e+1}});p=t,l.push(t)}for(let e=0;e<a;++e){const t=Pm(e,"int32"),r=n.makeTensorInfo([],"int32",t),i=HM({inputs:{a:r,b:p},backend:n}),a=nC({inputs:{x:i},backend:n,attrs:{dtype:"float32"}}),u=BM({inputs:{a,b:o},backend:n}),c=LM({inputs:{x:u},backend:n,attrs:{axis:0,keepDims:!1}});s.push(c),l.push(r),l.push(i),l.push(a),l.push(u),l.push(c)}const c=qO({inputs:s,backend:n,attrs:{axis:0}});return l.forEach(e=>n.disposeIntermediateTensorInfo(e)),c}},wB=[fC,mC,bC,_C,uC,wC,kC,EC,IC,TC,NC,AC,MC,RC,PC,zC,VC,HC,GC,hC,qC,JC,eM,tM,rC,oM,aM,ZA,sM,dM,gM,mM,fM,bM,$M,yM,wM,SM,vM,kM,EM,IM,FM,NM,jM,AM,CM,DM,MM,iD,UM,CA,zM,GM,KM,JM,QM,nD,hD,gD,mD,$D,xD,SD,vD,ED,TD,jD,MD,DA,DD,pM,OD,RD,PD,RA,UD,HD,qD,YD,ZD,tO,rO,aO,sO,lO,fO,gO,mO,yO,bO,$O,cO,_O,wO,vO,kO,TO,jO,PM,CO,DO,RO,PO,UO,zO,GO,KO,XO,ZO,WA,eR,nR,tC,oR,zA,HA,cC,iR,aR,sR,lR,uR,pR,dR,gR,yR,bR,xR,XA,vR,ER,TR,YC,NO,jR,AR,MR,OR,BR,PR,LR,WR,VR,HR,KR,YR,ZR,tB,oB,aB,uD,WM,lB,{kernelName:rm,backendName:"cpu",kernelFunc:uB},{kernelName:om,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{reps:i}=r;IA(o,"tile");const a=pB(n.bufferSync(o),i);return n.makeTensorInfo(a.shape,a.dtype,a.values)}},{kernelName:im,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{k:i,sorted:a}=r;IA(o,"topk");const s=n.data.get(o.dataId).values,[l,u]=hB(s,o.shape,o.dtype,i,a);return[n.makeTensorInfo(l.shape,l.dtype,l.values),n.makeTensorInfo(u.shape,u.dtype,u.values)]}},vC,fB,{kernelName:lm,backendName:"cpu",kernelFunc:function(e){const{inputs:t,attrs:n,backend:r}=e,{axis:o}=n,{x:i}=t;IA(i,"unique");const a=r.data.get(i.dataId).values,{outputValues:s,outputShape:l,indices:u}=$B(a,o,i.shape,i.dtype);return[r.makeTensorInfo(l,i.dtype,s),r.makeTensorInfo([u.length],"int32",u)]}},{kernelName:um,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{value:o}=t;let{axis:i}=r;i<0&&(i+=o.shape.length);const a=o.shape.length,s=o.shape[i],l=new Array(a-1);let u=0;for(let e=0;e<a;e++)e!==i&&(l[u++]=o.shape[e]);const p=new Array(a).fill(0),c=o.shape.slice();c[i]=1;const d=new Array(s);for(let e=0;e<d.length;e++){p[i]=e;
2const t=XC({inputs:{x:o},backend:n,attrs:{begin:p,size:c}});d[e]=pC({inputs:{x:t},backend:n,attrs:{shape:l}}),n.disposeIntermediateTensorInfo(t)}return d}},_B,HO];for(const e of wB)Sm(e);const xB={},SB={alpha:!1,antialias:!1,premultipliedAlpha:!1,preserveDrawingBuffer:!1,depth:!1,stencil:!1,failIfMajorPerformanceCaveat:!0};function vB(e){if(!(e in xB)){const t=function(e){if(1!==e&&2!==e)throw new Error("Cannot get WebGL rendering context, WebGL is disabled.");const t=function(e){if("undefined"!=typeof OffscreenCanvas&&2===e)return new OffscreenCanvas(300,150);if("undefined"!=typeof document)return document.createElement("canvas");throw new Error("Cannot create a canvas in this context")}(e);return t.addEventListener("webglcontextlost",t=>{t.preventDefault(),delete xB[e]},!1),1===e?t.getContext("webgl",SB)||t.getContext("experimental-webgl",SB):t.getContext("webgl2",SB)}(e);if(null===t)return console.log("Could not get context for WebGL version",e),null;xB[e]=t}const t=xB[e];return t.isContextLost()?(delete xB[e],vB(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),xB[e])}var kB,EB,IB;function TB(e,t){return[t,e]}function FB(e){const t=J(e);return ee(Math.ceil(t/4))}function NB(e,t){return[Math.max(1,Math.ceil(t/2)),Math.max(1,Math.ceil(e/2))]}function jB(e,t){const n=e;let r,o,i,a,s,l,u,p,c,d;return 2===ke().getNumber("WEBGL_VERSION")?(r=n.R32F,o=n.R16F,i=n.RGBA16F,a=n.RGBA32F,s=n.RED,u=4,p=1,c=n.HALF_FLOAT,d=n.FLOAT):(r=e.RGBA,o=e.RGBA,i=e.RGBA,a=n.RGBA,s=e.RGBA,u=4,p=4,c=null!=t?t.HALF_FLOAT_OES:null,d=e.FLOAT),l=e.RGBA,{internalFormatFloat:r,internalFormatHalfFloat:o,internalFormatPackedHalfFloat:i,internalFormatPackedFloat:a,textureFormatFloat:s,downloadTextureFormat:l,downloadUnpackNumChannels:u,defaultNumChannels:p,textureTypeHalfFloat:c,textureTypeFloat:d}}function AB(e,t){const n=t();return ke().getBool("DEBUG")&&function(e){const t=e.getError();if(t!==e.NO_ERROR)throw new Error("WebGL Error: "+function(e,t){switch(t){case e.NO_ERROR:return"NO_ERROR";case e.INVALID_ENUM:return"INVALID_ENUM";case e.INVALID_VALUE:return"INVALID_VALUE";case e.INVALID_OPERATION:return"INVALID_OPERATION";case e.INVALID_FRAMEBUFFER_OPERATION:return"INVALID_FRAMEBUFFER_OPERATION";case e.OUT_OF_MEMORY:return"OUT_OF_MEMORY";case e.CONTEXT_LOST_WEBGL:return"CONTEXT_LOST_WEBGL";default:return`Unknown error code ${t}`}}(e,t))}(e),n}function CB(e){return!!(ke().getBool("WEBGL_RENDER_FLOAT32_ENABLED")||0===e||5.96e-8<Math.abs(e)&&Math.abs(e)<65504)}function MB(e,t){return UB(e,()=>e.getExtension(t),'Extension "'+t+'" not supported on this browser.')}!function(e){e[e.DENSE=0]="DENSE",e[e.SHARED_BATCH=1]="SHARED_BATCH"}(kB||(kB={})),function(e){e[e.RENDER=0]="RENDER",e[e.UPLOAD=1]="UPLOAD",e[e.PIXELS=2]="PIXELS",e[e.DOWNLOAD=3]="DOWNLOAD"}(EB||(EB={})),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"}(IB||(IB={}));const DB=/ERROR: [0-9]+:([0-9]+):/g;function OB(e,t){if(AB(e,()=>e.validateProgram(t)),!1===e.getProgramParameter(t,e.VALIDATE_STATUS))throw console.log(e.getProgramInfoLog(t)),new Error("Shader program validation failed.")}function RB(e,t,n,r,o,i,a){const s=e.getAttribLocation(t,n);return-1!==s&&(AB(e,()=>e.bindBuffer(e.ARRAY_BUFFER,r)),AB(e,()=>e.vertexAttribPointer(s,o,e.FLOAT,!1,i,a)),AB(e,()=>e.enableVertexAttribArray(s)),!0)}function BB(e,t,n,r){AB(e,()=>function(e,t,n){(function(e,t){const n=e.MAX_COMBINED_TEXTURE_IMAGE_UNITS-1,r=t+e.TEXTURE0;if(r<e.TEXTURE0||r>n)throw new Error(`textureUnit must be in [gl.TEXTURE0, gl.TEXTURE${n}].`)})(e,n),AB(e,()=>e.activeTexture(e.TEXTURE0+n)),AB(e,()=>e.bindTexture(e.TEXTURE_2D,t))}(e,t,r)),AB(e,()=>e.uniform1i(n,r))}function PB(e,t,n){AB(e,()=>e.bindFramebuffer(e.FRAMEBUFFER,n)),AB(e,()=>e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0))}function LB(e,t){AB(e,()=>e.bindFramebuffer(e.FRAMEBUFFER,t)),AB(e,()=>e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,null,0))}function WB(e){const t=e.checkFramebufferStatus(e.FRAMEBUFFER);if(t!==e.FRAMEBUFFER_COMPLETE)throw new Error("Error binding framebuffer: "+function(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}`}}(e,t))}function UB(e,t,n){const r=AB(e,()=>t());if(null==r)throw new Error(n);return r}function zB(e,t=2){return J(e.slice(0,e.length-t))}function VB(e){if(0===e.length)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 HB(e){let t=[1,1,1];return 0===e.length||1===e.length&&1===e[0]||(t=[zB(e),...VB(e)]),t}function GB(e){return e%2==0}
2function qB(e,t){if(Z(e=e.slice(-2),t=t.slice(-2)))return!0;if(!e.length||!t.length)return!0;if(0===e[0]||0===e[1]||0===t[0]||0===t[1])return!0;if(e.length!==t.length){const n=e.slice(-1)[0],r=t.slice(-1)[0];if(n===r)return!0;if(GB(n)&&GB(r)&&(1===e[0]||1===t[0]))return!0}return e[1]===t[1]&&GB(e[0])&&GB(t[0])}let KB,XB;function YB(e,t){return null!=e.getExtension(t)}function JB(e){try{if(null!=vB(e))return!0}catch(e){return console.log("Error when getting WebGL context: ",e),!1}return!1}function ZB(e){const t=jB(e),n=e.createTexture();e.bindTexture(e.TEXTURE_2D,n),e.texImage2D(e.TEXTURE_2D,0,t.internalFormatFloat,1,1,0,t.textureFormatFloat,t.textureTypeFloat,null);const r=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,r),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,n,0);const o=e.checkFramebufferStatus(e.FRAMEBUFFER)===e.FRAMEBUFFER_COMPLETE;return e.bindTexture(e.TEXTURE_2D,null),e.bindFramebuffer(e.FRAMEBUFFER,null),e.deleteTexture(n),e.deleteFramebuffer(r),o}function QB(e,t){Array.isArray(e)||(e=[e]),e.forEach(e=>{null!=e&&q("complex64"!==e.dtype,()=>`${t} does not support complex64 tensors in the WebGL backend.`)})}const eP=ke();function tP(){let e,t,n,r,o,i,a,s,l,u;return 2===ke().getNumber("WEBGL_VERSION")?(e="#version 300 es",t="in",n="out",r="in",o="texture",i="outputColor",a="out vec4 outputColor;",s="\n      bool isnan_custom(float val) {\n        return (val > 0.0 || val < 0.0) ? false : val != 0.0;\n      }\n\n      bvec4 isnan_custom(vec4 val) {\n        return bvec4(isnan_custom(val.x),\n          isnan_custom(val.y), isnan_custom(val.z), isnan_custom(val.w));\n      }\n\n      #define isnan(value) isnan_custom(value)\n    ",l="",u="\n      #define round(value) newRound(value)\n      int newRound(float value) {\n        return int(floor(value + 0.5));\n      }\n\n      ivec4 newRound(vec4 value) {\n        return ivec4(floor(value + vec4(0.5)));\n      }\n    "):(e="",t="attribute",n="varying",r="varying",o="texture2D",i="gl_FragColor",a="",s="\n      #define isnan(value) isnan_custom(value)\n      bool isnan_custom(float val) {\n        return (val > 0. || val < 1. || val == 0.) ? false : true;\n      }\n      bvec4 isnan_custom(vec4 val) {\n        return bvec4(isnan(val.x), isnan(val.y), isnan(val.z), isnan(val.w));\n      }\n    ",l="\n      uniform float INFINITY;\n\n      bool isinf(float val) {\n        return abs(val) == INFINITY;\n      }\n      bvec4 isinf(vec4 val) {\n        return equal(abs(val), vec4(INFINITY));\n      }\n    ",u="\n      int round(float value) {\n        return int(floor(value + 0.5));\n      }\n\n      ivec4 round(vec4 value) {\n        return ivec4(floor(value + vec4(0.5)));\n      }\n    "),{version:e,attribute:t,varyingVs:n,varyingFs:r,texture2D:o,output:i,defineOutput:a,defineSpecialNaN:s,defineSpecialInf:l,defineRound:u}}function nP(e,t,n="index"){const r=he(t);return r.map((t,o)=>`int ${e[o]} = ${n} / ${t}; ${o===r.length-1?`int ${e[o+1]} = ${n} - ${e[o]} * ${t}`:`index -= ${e[o]} * ${t}`};`).join("")}function rP(e,t,n="index"){const r=he(t);return r.map((t,o)=>`int ${e[o]} = ${n} / outShapeStrides[${o}]; ${o===r.length-1?`int ${e[o+1]} = ${n} - ${e[o]} * outShapeStrides[${o}]`:`index -= ${e[o]} * outShapeStrides[${o}]`};`).join("")}function oP(e){const t=he(e).map(e=>e.toString());return`\n  int getFlatIndex(ivec3 coords) {\n    return coords.x * ${t[0]} + coords.y * ${t[1]} + coords.z;\n  }\n`}eP.registerFlag("HAS_WEBGL",()=>eP.getNumber("WEBGL_VERSION")>0),eP.registerFlag("WEBGL_VERSION",()=>JB(2)?2:JB(1)?1:0),eP.registerFlag("WEBGL_CHECK_NUMERICAL_PROBLEMS",()=>!1),eP.registerFlag("WEBGL_BUFFER_SUPPORTED",()=>2===eP.get("WEBGL_VERSION")),eP.registerFlag("WEBGL_CPU_FORWARD",()=>!0),eP.registerFlag("WEBGL_FORCE_F16_TEXTURES",()=>!1),eP.registerFlag("WEBGL_PACK",()=>eP.getBool("HAS_WEBGL")),eP.registerFlag("WEBGL_PACK_NORMALIZATION",()=>eP.getBool("WEBGL_PACK")),eP.registerFlag("WEBGL_PACK_CLIP",()=>eP.getBool("WEBGL_PACK")),eP.registerFlag("WEBGL_PACK_DEPTHWISECONV",()=>eP.getBool("WEBGL_PACK")),eP.registerFlag("WEBGL_PACK_BINARY_OPERATIONS",()=>eP.getBool("WEBGL_PACK")),eP.registerFlag("WEBGL_PACK_UNARY_OPERATIONS",()=>eP.getBool("WEBGL_PACK")),eP.registerFlag("WEBGL_PACK_ARRAY_OPERATIONS",()=>eP.getBool("WEBGL_PACK")),eP.registerFlag("WEBGL_PACK_IMAGE_OPERATIONS",()=>eP.getBool("WEBGL_PACK")),eP.registerFlag("WEBGL_PACK_REDUCE",()=>eP.getBool("WEBGL_PACK")),eP.registerFlag("WEBGL_LAZILY_UNPACK",()=>eP.getBool("WEBGL_PACK")),eP.registerFlag("WEBGL_CONV_IM2COL",()=>eP.getBool("WEBGL_PACK")),eP.registerFlag("WEBGL_MAX_TEXTURE_SIZE",()=>function(e){if(null==KB){const t=vB(e);KB=t.getParameter(t.MAX_TEXTURE_SIZE)}return KB}(eP.getNumber("WEBGL_VERSION"))),eP.registerFlag("WEBGL_MAX_TEXTURES_IN_SHADER",()=>function(e){if(null==XB){const t=vB(e);XB=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS)}return Math.min(16,XB)}(eP.getNumber("WEBGL_VERSION"))),eP.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION",()=>{const e=eP.getNumber("WEBGL_VERSION");return 0===e?0:function(e){if(0===e)return 0;let t;const n=vB(e);return t=YB(n,"EXT_disjoint_timer_query_webgl2")&&2===e?2:YB(n,"EXT_disjoint_timer_query")?1:0,t}(e)}),eP.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE",()=>eP.getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0&&!xo()),eP.registerFlag("WEBGL_RENDER_FLOAT32_CAPABLE",()=>function(e){if(0===e)return!1;const t=vB(e);if(1===e){if(!YB(t,"OES_texture_float"))return!1}else if(!YB(t,"EXT_color_buffer_float"))return!1;return ZB(t)}(eP.getNumber("WEBGL_VERSION"))),eP.registerFlag("WEBGL_RENDER_FLOAT32_ENABLED",()=>!eP.getBool("WEBGL_FORCE_F16_TEXTURES")&&eP.getBool("WEBGL_RENDER_FLOAT32_CAPABLE")),eP.registerFlag("WEBGL_DOWNLOAD_FLOAT_ENABLED",()=>function(e){if(0===e)return!1;const t=vB(e);if(1!==e){if(YB(t,"EXT_color_buffer_float"))return ZB(t);const e="EXT_color_buffer_half_float";if(YB(t,e)){const n=t.getExtension(e);return function(e,t){const n=jB(e,t),r=e.createTexture();e.bindTexture(e.TEXTURE_2D,r),e.texImage2D(e.TEXTURE_2D,0,n.internalFormatHalfFloat,1,1,0,n.textureFormatFloat,n.textureTypeHalfFloat,null);const o=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,o),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,r,0);const i=e.checkFramebufferStatus(e.FRAMEBUFFER)===e.FRAMEBUFFER_COMPLETE;return e.bindTexture(e.TEXTURE_2D,null),e.bindFramebuffer(e.FRAMEBUFFER,null),e.deleteTexture(r),e.deleteFramebuffer(o
2),i}(t,n)}return!1}return!!YB(t,"OES_texture_float")&&!!YB(t,"WEBGL_color_buffer_float")&&ZB(t)}(eP.getNumber("WEBGL_VERSION"))),eP.registerFlag("WEBGL_FENCE_API_ENABLED",()=>{return 2===(e=eP.getNumber("WEBGL_VERSION"))&&null!=vB(e).fenceSync;var e}),eP.registerFlag("WEBGL_SIZE_UPLOAD_UNIFORM",()=>eP.getBool("WEBGL_RENDER_FLOAT32_ENABLED")?4:0),eP.registerFlag("WEBGL_DELETE_TEXTURE_THRESHOLD",()=>-1,e=>{if(e<0&&-1!==e)throw new Error(`WEBGL_DELETE_TEXTURE_THRESHOLD must be -1 (indicating never delete) or at least 0, but got ${e}.`)}),eP.registerFlag("WEBGL_FLUSH_THRESHOLD",()=>xo()&&eP.getBool("IS_CHROME")?1:-1,e=>{if(e<0&&-1!==e)throw new Error(`WEBGL_FLUSH_THRESHOLD must be -1 (indicating never manual flush) or at least 0, but got ${e}.`)}),eP.registerFlag("CPU_HANDOFF_SIZE_THRESHOLD",()=>128),eP.registerFlag("WEBGL_USE_SHAPES_UNIFORMS",()=>!1),eP.registerFlag("TOPK_LAST_DIM_CPU_HANDOFF_SIZE_THRESHOLD",()=>1e5),eP.registerFlag("TOPK_K_CPU_HANDOFF_THRESHOLD",()=>128);const iP="\n  const float FLOAT_MAX = 1.70141184e38;\n  const float FLOAT_MIN = 1.17549435e-38;\n\n  lowp vec4 encode_float(highp float v) {\n    if (isnan(v)) {\n      return vec4(255, 255, 255, 255);\n    }\n\n    highp float av = abs(v);\n\n    if(av < FLOAT_MIN) {\n      return vec4(0.0, 0.0, 0.0, 0.0);\n    } else if(v > FLOAT_MAX) {\n      return vec4(0.0, 0.0, 128.0, 127.0) / 255.0;\n    } else if(v < -FLOAT_MAX) {\n      return vec4(0.0, 0.0,  128.0, 255.0) / 255.0;\n    }\n\n    highp vec4 c = vec4(0,0,0,0);\n\n    highp float e = floor(log2(av));\n    highp float m = exp2(fract(log2(av))) - 1.0;\n\n    c[2] = floor(128.0 * m);\n    m -= c[2] / 128.0;\n    c[1] = floor(32768.0 * m);\n    m -= c[1] / 32768.0;\n    c[0] = floor(8388608.0 * m);\n\n    highp float ebias = e + 127.0;\n    c[3] = floor(ebias / 2.0);\n    ebias -= c[3] * 2.0;\n    c[2] += floor(ebias) * 128.0;\n\n    c[3] += 128.0 * step(0.0, -v);\n\n    return c / 255.0;\n  }\n",{getBroadcastDims:aP}=n;function sP(e,t,n){const r=[];if(e.forEach(e=>{const t=J(e.shapeInfo.logicalShape);if(e.shapeInfo.isUniform?r.push(`uniform float ${e.name}${t>1?`[${t}]`:""};`):(r.push(`uniform sampler2D ${e.name};`),r.push(`uniform int offset${e.name};`)),n.enableShapeUniforms){const{uniformShape:t}=yP(n.packedInputs,e.shapeInfo.logicalShape,e.shapeInfo.texShape);switch(t.length){case 1:r.push(`uniform int ${e.name}Shape;`);break;case 2:r.push(`uniform ivec2 ${e.name}Shape;`);break;case 3:r.push(`uniform ivec3 ${e.name}Shape;`);break;case 4:r.push(`uniform ivec4 ${e.name}Shape;`)}r.push(`uniform ivec2 ${e.name}TexShape;`)}}),n.enableShapeUniforms){switch(t.logicalShape.length){case 1:r.push("uniform int outShape;");break;case 2:r.push("uniform ivec2 outShape;"),r.push("uniform int outShapeStrides;");break;case 3:r.push("uniform ivec3 outShape;"),r.push("uniform ivec2 outShapeStrides;");break;case 4:r.push("uniform ivec4 outShape;"),r.push("uniform ivec3 outShapeStrides;")}r.push("uniform ivec2 outTexShape;")}
2n.customUniforms&&n.customUniforms.forEach(e=>{r.push(`uniform ${e.type} ${e.name}${e.arrayIndex?`[${e.arrayIndex}]`:""};`)});const o=r.join("\n"),i=e.map(e=>function(e,t,n=!1,r){let o="";o+=n?uP(e,r):lP(e,r);const i=e.shapeInfo.logicalShape,a=t.logicalShape;return i.length<=a.length&&(o+=n?function(e,t){const n=e.name,r=n.charAt(0).toUpperCase()+n.slice(1),o="get"+r+"AtOutCoords",i=e.shapeInfo.logicalShape.length,a=t.logicalShape.length,s=aP(e.shapeInfo.logicalShape,t.logicalShape),l=mP(a),u=a-i;let p;const c=["x","y","z","w","u","v"];p=0===i?"":a<2&&s.length>=1?"coords = 0;":s.map(e=>`coords.${c[e+u]} = 0;`).join("\n");let d="";d=a<2&&i>0?"coords":e.shapeInfo.logicalShape.map((e,t)=>`coords.${c[t+u]}`).join(", ");let h="return outputValue;";const f=1===J(e.shapeInfo.logicalShape),g=1===J(t.logicalShape);if(1!==i||f||g){if(f&&!g)h=1===a?"\n        return vec4(outputValue.x, outputValue.x, 0., 0.);\n      ":"\n        return vec4(outputValue.x);\n      ";else if(s.length){const e=i-2,t=i-1;s.indexOf(e)>-1&&s.indexOf(t)>-1?h="return vec4(outputValue.x);":s.indexOf(e)>-1?h="return vec4(outputValue.x, outputValue.y, outputValue.x, outputValue.y);":s.indexOf(t)>-1&&(h="return vec4(outputValue.xx, outputValue.zz);")}}else h="\n      return vec4(outputValue.xy, outputValue.xy);\n    ";return`\n    vec4 ${o}() {\n      ${l} coords = getOutputCoords();\n      ${p}\n      vec4 outputValue = get${r}(${d});\n      ${h}\n    }\n  `}(e,t):function(e,t){const n=e.name,r=n.charAt(0).toUpperCase()+n.slice(1),o="get"+r+"AtOutCoords",i=t.texShape,a=e.shapeInfo.texShape,s=e.shapeInfo.logicalShape.length,l=t.logicalShape.length;if(!e.shapeInfo.isUniform&&s===l&&null==e.shapeInfo.flatOffset&&Z(a,i))return`\n      float ${o}() {\n        return sampleTexture(${n}, resultUV);\n      }\n    `;const u=mP(l),p=aP(e.shapeInfo.logicalShape,t.logicalShape),c=l-s;let d;const h=["x","y","z","w","u","v"];d=0===s?"":l<2&&p.length>=1?"coords = 0;":p.map(e=>`coords.${h[e+c]} = 0;`).join("\n");let f="";return f=l<2&&s>0?"coords":e.shapeInfo.logicalShape.map((e,t)=>`coords.${h[t+c]}`).join(", "),`\n    float ${o}() {\n      ${u} coords = getOutputCoords();\n      ${d}\n      return get${r}(${f});\n    }\n  `}(e,t)),o}(e,t,n.packedInputs,n.enableShapeUniforms)).join("\n"),a=t.texShape,s=tP(),l=function(e){return`\n    float sampleTexture(sampler2D textureSampler, vec2 uv) {\n      return ${e.texture2D}(textureSampler, uv).r;\n    }\n  `}(s);let u,p,c=function(e){return`${e.version}\n    precision highp float;\n    precision highp int;\n    precision highp sampler2D;\n    ${e.varyingFs} vec2 resultUV;\n    ${e.defineOutput}\n    const vec2 halfCR = vec2(0.5, 0.5);\n\n    struct ivec5\n    {\n      int x;\n      int y;\n      int z;\n      int w;\n      int u;\n    };\n\n    struct ivec6\n    {\n      int x;\n      int y;\n      int z;\n      int w;\n      int u;\n      int v;\n    };\n\n    uniform float NAN;\n    ${e.defineSpecialNaN}\n    ${e.defineSpecialInf}\n    ${e.defineRound}\n\n    int imod(int x, int y) {\n      return x - y * (x / y);\n    }\n\n    int idiv(int a, int b, float sign) {\n      int res = a / b;\n      int mod = imod(a, b);\n      if (sign < 0. && mod != 0) {\n        res -= 1;\n      }\n      return res;\n    }\n\n    //Based on the work of Dave Hoskins\n    //https://www.shadertoy.com/view/4djSRW\n    #define HASHSCALE1 443.8975\n    float random(float seed){\n      vec2 p = resultUV * seed;\n      vec3 p3  = fract(vec3(p.xyx) * HASHSCALE1);\n      p3 += dot(p3, p3.yzx + 19.19);\n      return fract((p3.x + p3.y) * p3.z);\n    }\n\n    ${pP}\n    ${cP}\n    ${dP}\n  `}(s);return t.isPacked?(u=function(e,t,n){switch(e.length){case 0:return"\n    int getOutputCoords() {\n      return 0;\n    }\n  ";case 1:return function(e,t,n){const r=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)];return 1===r[0]?n?"\n      int getOutputCoords() {\n        return 2 * int(resultUV.x * ceil(float(outTexShape[1]) / 2.0));\n      }\n    ":`\n      int getOutputCoords() {\n        return 2 * int(resultUV.x * ${r[1]}.0);\n      }\n    `:1===r[1]?n?"\n      int getOutputCoords() {\n        return 2 * int(resultUV.y * ceil(float(outTexShape[0]) / 2.0));\n      }\n    ":`\n      int getOutputCoords() {\n        return 2 * int(resultUV.y * ${r[0]}.0);\n      }\n    `:n?"\n    int getOutputCoords() {\n      ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0));
2\n      ivec2 resTexRC = ivec2(resultUV.yx *\n                             vec2(packedTexShape[0], packedTexShape[1]));\n      return 2 * (resTexRC.x * packedTexShape[1] + resTexRC.y);\n    }\n  ":`\n    int getOutputCoords() {\n      ivec2 resTexRC = ivec2(resultUV.yx *\n                             vec2(${r[0]}, ${r[1]}));\n      return 2 * (resTexRC.x * ${r[1]} + resTexRC.y);\n    }\n  `}(0,t,n);case 2:return function(e,t,n){const r=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)];if(Z(e,t))return n?"\n      ivec2 getOutputCoords() {\n        ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0));\n        return 2 * ivec2(resultUV.yx * vec2(packedTexShape[0], packedTexShape[1]));\n      }\n    ":`\n      ivec2 getOutputCoords() {\n        return 2 * ivec2(resultUV.yx * vec2(${r[0]}, ${r[1]}));\n      }\n    `;const o=Math.ceil(e[1]/2);return n?"\n    ivec2 getOutputCoords() {\n      ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0));\n      int texelsInLogicalRow = int(ceil(float(outShape[1]) / 2.0));\n      ivec2 resTexRC = ivec2(resultUV.yx *\n                             vec2(packedTexShape[0], packedTexShape[1]));\n\n      int index = resTexRC.x * packedTexShape[1] + resTexRC.y;\n      int r = 2 * (index / texelsInLogicalRow);\n      int c = imod(index, texelsInLogicalRow) * 2;\n\n      return ivec2(r, c);\n    }\n  ":`\n    ivec2 getOutputCoords() {\n      ivec2 resTexRC = ivec2(resultUV.yx *\n                             vec2(${r[0]}, ${r[1]}));\n\n      int index = resTexRC.x * ${r[1]} + resTexRC.y;\n      int r = 2 * (index / ${o});\n      int c = imod(index, ${o}) * 2;\n\n      return ivec2(r, c);\n    }\n  `}(e,t,n);case 3:return function(e,t,n){if(n)return"\n    ivec3 getOutputCoords() {\n      ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0));\n      int texelsInLogicalRow = int(ceil(float(outShape[2]) / 2.0));\n      int texelsInBatch = texelsInLogicalRow * int(ceil(float(outShape[1]) / 2.0));\n      ivec2 resTexRC = ivec2(resultUV.yx *\n                             vec2(packedTexShape[0], packedTexShape[1]));\n      int index = resTexRC.x * packedTexShape[1] + resTexRC.y;\n\n      int b = index / texelsInBatch;\n      index -= b * texelsInBatch;\n\n      int r = 2 * (index / texelsInLogicalRow);\n      int c = imod(index, texelsInLogicalRow) * 2;\n\n      return ivec3(b, r, c);\n    }\n  ";const r=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)],o=Math.ceil(e[2]/2),i=o*M
2ath.ceil(e[1]/2);return`\n    ivec3 getOutputCoords() {\n      ivec2 resTexRC = ivec2(resultUV.yx *\n                             vec2(${r[0]}, ${r[1]}));\n      int index = resTexRC.x * ${r[1]} + resTexRC.y;\n\n      int b = index / ${i};\n      index -= b * ${i};\n\n      int r = 2 * (index / ${o});\n      int c = imod(index, ${o}) * 2;\n\n      return ivec3(b, r, c);\n    }\n  `}(e,t,n);default:return function(e,t,n){if(n)return"\n    ivec4 getOutputCoords() {\n      ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0));\n      ivec2 resTexRC = ivec2(resultUV.yx *\n                             vec2(packedTexShape[0], packedTexShape[1]));\n      int index = resTexRC.x * packedTexShape[1] + resTexRC.y;\n\n      int texelsInLogicalRow = int(ceil(float(outShape[3]) / 2.0));\n      int texelsInBatch = texelsInLogicalRow * int(ceil(float(outShape[2]) / 2.0));\n      int texelsInBatchN = texelsInBatch * outShape[1];\n\n      int b2 = index / texelsInBatchN;\n      index -= b2 * texelsInBatchN;\n\n      int b = index / texelsInBatch;\n      index -= b * texelsInBatch;\n\n      int r = 2 * (index / texelsInLogicalRow);\n      int c = imod(index, texelsInLogicalRow) * 2;\n\n      return ivec4(b2, b, r, c);\n    }\n  ";const r=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)],o=Math.ceil(e[e.length-1]/2),i=o*Math.ceil(e[e.length-2]/2);let a=i,s="",l="b, r, c";for(let t=2;t<e.length-1;t++)a*=e[e.length-t-1],s=`\n      int b${t} = index / ${a};\n      index -= b${t} * ${a};\n    `+s,l=`b${t}, `+l;return`\n    ivec${e.length} getOutputCoords() {\n      ivec2 resTexRC = ivec2(resultUV.yx *\n                             vec2(${r[0]}, ${r[1]}));\n      int index = resTexRC.x * ${r[1]} + resTexRC.y;\n\n      ${s}\n\n      int b = index / ${i};\n      index -= b * ${i};\n\n      int r = 2 * (index / ${o});\n      int c = imod(index, ${o}) * 2;\n\n      return ivec${e.length}(${l});\n    }\n  `}(e,t,n)}}(t.logicalShape,a,n.enableShapeUniforms),p=function(e){return`\n    void setOutput(vec4 val) {\n      ${e.output} = val;\n    }\n  `}(s)):(u=function(e,t,n){switch(e.length){case 0:return"\n    int getOutputCoords() {\n      return 0;\n    }\n  ";case 1:return function(e,t,n){return 1===t[0]?n?"\n      int getOutputCoords() {\n        return int(resultUV.x * float(outTexShape[1]));\n      }\n    ":`\n      int getOutputCoords() {\n        return int(resultUV.x * ${t[1]}.0);\n      }\n    `:1===t[1]?n?"\n      int getOutputCoords() {\n        return int(resultUV.y * float(outTexShape[0]));\n      }\n    ":`\n      int getOutputCoords() {\n        return int(resultUV.y * ${t[0]}.0);\n      }\n    `:n?"\n    int getOutputCoords() {\n      ivec2 resTexRC = ivec2(resultUV.yx *\n                             vec2(outTexShape[0], outTexShape[1]));\n      return resTexRC.x * outTexShape[1] + resTexRC.y;\n    }\n  ":`\n    int getOutputCoords() {\n      ivec2 resTexRC = ivec2(resultUV.yx *\n                             vec2(${t[0]}, ${t[1]}));\n      return resTexRC.x * ${t[1]} + resTexRC.y;\n    }\n  `}(0,t,n);case 2:return function(e,t,n){return Z(e,t)?n?"\n      ivec2 getOutputCoords() {\n        return ivec2(resultUV.yx * vec2(outTexShape[0], outTexShape[1]));\n      }\n    ":`\n      ivec2 getOutputCoords() {\n        return ivec2(resultUV.yx * vec2(${t[0]}, ${t[1]}));\n      }\n    `:1===e[1]?n?"\n      ivec2 getOutputCoords() {\n        ivec2 resTexRC = ivec2(resultUV.yx *\n                               vec2(outTexShape[0], outTexShape[1]));\n        int index = resTexRC.x * outTexShape[1] + resTexRC.y;\n        return ivec2(index, 0);\n      }\n    ":`\n      ivec2 getOutputCoords() {\n        ivec2 resTexRC = ivec2(resultUV.yx *\n                               vec2(${t[0]}, ${t[1]}));\n        int index = resTexRC.x * ${t[1]} + resTexRC.y;\n        return ivec2(index, 0);\n      }\n    `:1===e[0]?n?"\n      ivec2 getOutputCoords() {\n        ivec2 resTexRC = ivec2(resultUV.yx *\n                               vec2(outTexShape[0], outTexShape[1]));\n        int index = resTexRC.x * outTexShape[1] + resTexRC.y;\n        return ivec2(0, index);\n      }\n    ":`\n      ivec2 getOutputCoords() {\n        ivec2 resTexRC = ive
2c2(resultUV.yx *\n                               vec2(${t[0]}, ${t[1]}));\n        int index = resTexRC.x * ${t[1]} + resTexRC.y;\n        return ivec2(0, index);\n      }\n    `:n?"\n    ivec2 getOutputCoords() {\n      ivec2 resTexRC = ivec2(resultUV.yx *\n                             vec2(outTexShape[0], outTexShape[1]));\n      int index = resTexRC.x * outTexShape[1] + resTexRC.y;\n      int r = index / outShape[1];\n      int c = index - r * outShape[1];\n      return ivec2(r, c);\n    }\n  ":`\n    ivec2 getOutputCoords() {\n      ivec2 resTexRC = ivec2(resultUV.yx *\n                             vec2(${t[0]}, ${t[1]}));\n      int index = resTexRC.x * ${t[1]} + resTexRC.y;\n      int r = index / ${e[1]};\n      int c = index - r * ${e[1]};\n      return ivec2(r, c);\n    }\n  `}(e,t,n);case 3:return function(e,t,n){if(n)return`\n  ivec3 getOutputCoords() {\n    ivec2 resTexRC = ivec2(resultUV.yx *\n                           vec2(outTexShape[0], outTexShape[1]));\n    int index = resTexRC.x * outTexShape[1] + resTexRC.y;\n    ${rP(["r","c","d"],e)}\n    return ivec3(r, c, d);\n  }\n`;const r=nP(["r","c","d"],e);return`\n    ivec3 getOutputCoords() {\n      ivec2 resTexRC = ivec2(resultUV.yx *\n                             vec2(${t[0]}, ${t[1]}));\n      int index = resTexRC.x * ${t[1]} + resTexRC.y;\n      ${r}\n      return ivec3(r, c, d);\n    }\n  `}(e,t,n);case 4:return function(e,t,n){if(n)return`\n    ivec4 getOutputCoords() {\n      ivec2 resTexRC = ivec2(resultUV.yx *\n        vec2(outTexShape[0], outTexShape[1]));\n      int index = resTexRC.x * outTexShape[1] + resTexRC.y;\n      ${rP(["r","c","d","d2"],e)}\n      return ivec4(r, c, d, d2);\n    }\n  `;const r=nP(["r","c","d","d2"],e);return`\n    ivec4 getOutputCoords() {\n      ivec2 resTexRC = ivec2(resultUV.yx *\n        vec2(${t[0]}, ${t[1]}));\n      int index = resTexRC.x * ${t[1]} + resTexRC.y;\n      ${r}\n      return ivec4(r, c, d, d2);\n    }\n  `}(e,t,n);case 5:return function(e,t){const n=nP(["r","c","d","d2","d3"],e);return`\n    ivec5 getOutputCoords() {\n      ivec2 resTexRC = ivec2(resultUV.yx * vec2(${t[0]},\n                             ${t[1]}));\n\n      int index = resTexRC.x * ${t[1]} + resTexRC.y;\n\n      ${n}\n\n      ivec5 outShape = ivec5(r, c, d, d2, d3);\n      return outShape;\n    }\n  `}(e,t);case 6:return function(e,t){const n=nP(["r","c","d","d2","d3","d4"],e);return`\n    ivec6 getOutputCoords() {\n      ivec2 resTexRC = ivec2(resultUV.yx *\n        vec2(${t[0]}, ${t[1]}));\n      int index = resTexRC.x * ${t[1]} + resTexRC.y;\n\n      ${n}\n\n      ivec6 result = ivec6(r, c, d, d2, d3, d4);\n      return result;\n    }\n  `}(e,t);default:throw new Error(`${e.length}-D output sampling is not yet supported`)}}(t.logicalShape,a,n.enableShapeUniforms),p=function(e){return`\n    void setOutput(float val) {\n      ${e.output} = vec4(val, 0, 0, 0);\n    }\n  `}(s)),n.packedInputs&&(c+=hP),[c,l,p,o,u,i,n.userCode].join("\n")}function lP(e,t=!1){const n=e.shapeInfo.logicalShape;switch(n.length){case 0:return function(e,t){const n=e.name,r="get"+n.charAt(0).toUpperCase()+n.slice(1);if(e.shapeInfo.isUniform)return`float ${r}() {return ${n};}`;const[o,i]=e.shapeInfo.texShape;if(1===o&&1===i)return`\n      float ${r}() {\n        return sampleTexture(${n}, halfCR);\n      }\n    `;const a=fP(n);if(t)return`\n    float ${r}() {\n      vec2 uv = uvFromFlat(${n}TexShape[0], ${n}TexShape[1], ${a});\n      return sampleTexture(${n}, uv);\n    }\n  `;const[s,l]=e.shapeInfo.texShape;return`\n    float ${r}() {\n      vec2 uv = uvFromFlat(${s}, ${l}, ${a});\n      return sampleTexture(${n}, uv);\n    }\n  `}(e,t);case 1:return function(e,t){const n=e.name,r="get"+n.charAt(0).toUpperCase()+n.slice(1);if(e.shapeInfo.isUniform)return`\n      float ${r}(int index) {\n        ${gP(e)}\n      }\n    `;const o=e.shapeInfo.texShape,i=o[0],a=o[1];if(1===a&&1===i)return`\n      float ${r}(int index) {\n        return sampleTexture(${n}, halfCR);\n      }\n    `;const s=fP(n);return 1===a?t?`\n      float ${r}(int index) {\n        vec2 uv = vec2(0.5, (float(index + ${s}) + 0.5) / float(${n}TexShape[0]));\n        return sampleTexture(${n}, uv);\n      }\n    `:`\n      float ${r}(int index) {\n        vec2 uv = vec2(0.5, (float(index + ${s}) + 0.5) / ${i}.0);\n        return sampleTexture(${n}, uv);\n      }\n    `:1===i?t?`\n      float ${r}(int index) {\n        vec2 uv = vec2((float(index + ${s}) + 0.5) / float(${n}TexShape[1]), 0.5);\n        return sampleTexture(${n}, uv);\n      }\n    `:`\n      float ${r}(int index) {\n        vec2 uv = vec2((float(index + ${s}) + 0.5) / ${a}.0, 0.5);\n        return sampleTexture(${n}, uv);\n      }\n    `:t?`\n    float ${r}(int index) {\n      vec2 uv = uvFromFlat(${n}TexShape[0], ${n}TexShape[1], index + ${s});\n      return sampleTexture(${n}, uv);\n    }\n  `:`\n    float ${r}(int index) {\n      vec2 uv = uvFromFlat(${i}, ${a}, index + ${s});\n      return sampleTexture(${n}, uv);\n    }\n  `}(e,t);case 2:return function(e,t){const n=e.shapeInfo.logicalShape,r=e.name,o="get"+r.charAt(0).toUpperCase()+r.slice(1),i=e.shapeInfo.texShape;if(null!=i&&Z(n,i)){if(t)return`\n      float ${o}(int row, int col) {\n        vec2 uv = (vec2(col, row) + halfCR) / vec2(${r}TexShape[1], ${r}TexShape[0]);\n        return sampleTexture(${r}, uv);\n      }\n    `;const e=i[0];return`\n    float ${o}(int row, int col) {\n      vec2 uv = (vec2(col, row) + halfCR) / vec2(${i[1]}.0, ${e}.0);\n      return sampleTexture(${r}, uv);\n    }\n  `}const{newShape:a,keptDims:s}=oe(n),l=a;if(l.length<n.length){const n=["row","col"];return`\n      ${lP(bP(e,l),t)}\n      float ${o}(int row, int col) {\n        return ${o}(${$P(n,s)});\n      }\n    `}if(e.shapeInfo.isUniform)return`\n      float ${o}(int row, int col) {\n        int index = round(dot(vec2(row, col), vec2(${n[1]}, 1)));\n        ${gP(e)}\n      }\n    `;const u=i[0],p=i[1],c=fP(r);return 1===p?t?`\n      float ${o}(int row, int col) {\n        float index = dot(vec3(row, col, ${c}), vec3(${r}Shape[1], 1, 1));\n        vec2 uv = vec2(0.5, (index + 0.5) / float(${r}TexShape[0]));\n        return sampleTexture(${r}, uv);\n      }\n    `:`\n    float ${o}(int row, int col) {\n      float index = dot(vec3(row, col, ${c}), vec3(${n[1]}, 1, 1));\n      vec2 uv = vec2(0.5, (index + 0.5) / ${u}.0);\n      return sampleTexture(${r}, uv);\n    }\n  `:1===u?t?`\n      float ${o}(int row, int col) {\n        float index = dot(vec3(row, col, ${c}), vec3(${r}Shape[1], 1, 1));\n        vec2 uv = vec2((index + 0.5) / float(${r}TexShape[1]), 0.5);\n        return sampleTexture(${r}, uv);\n      }\n    `:`\n    float ${o}(int row, int col) {\n      float index = dot(vec3(row, col, ${c}), vec3(${n[1]}, 1, 1));\n      vec2 uv = vec2((index + 0.5) / ${p}.0, 0.5);\n      return sampleTexture(${r}, uv);\n    }\n  `:t?`\n      float ${o}(int row, int col) {\n        // Explicitly use integer operations as dot() only w
2orks on floats.\n        int index = row * ${r}Shape[1] + col + ${c};\n        vec2 uv = uvFromFlat(${r}TexShape[0], ${r}TexShape[1], index);\n        return sampleTexture(${r}, uv);\n      }\n    `:`\n  float ${o}(int row, int col) {\n    // Explicitly use integer operations as dot() only works on floats.\n    int index = row * ${n[1]} + col + ${c};\n    vec2 uv = uvFromFlat(${u}, ${p}, index);\n    return sampleTexture(${r}, uv);\n  }\n`}(e,t);case 3:return function(e,t){const n=e.shapeInfo.logicalShape,r=e.name,o="get"+r.charAt(0).toUpperCase()+r.slice(1),i=n[1]*n[2],a=n[2],{newShape:s,keptDims:l}=oe(n),u=s;if(u.length<n.length){const n=["row","col","depth"];return`\n        ${lP(bP(e,u),t)}\n        float ${o}(int row, int col, int depth) {\n          return ${o}(${$P(n,l)});\n        }\n      `}if(e.shapeInfo.isUniform)return`\n      float ${o}(int row, int col, int depth) {\n        int index = round(dot(vec3(row, col, depth),\n                          vec3(${i}, ${a}, 1)));\n        ${gP(e)}\n      }\n    `;const p=e.shapeInfo.texShape,c=p[0],d=p[1],h=e.shapeInfo.flatOffset;if(d===i&&null==h)return t?`\n      float ${o}(int row, int col, int depth) {\n        int stride1 = ${r}Shape[2];\n        float texR = float(row);\n        float texC = dot(vec2(col, depth), vec2(stride1, 1));\n        vec2 uv = (vec2(texC, texR) + halfCR) /\n                   vec2(${r}TexShape[1], ${r}TexShape[0]);\n        return sampleTexture(${r}, uv);\n      }\n    `:`\n        float ${o}(int row, int col, int depth) {\n          float texR = float(row);\n          float texC = dot(vec2(col, depth), vec2(${a}, 1));\n          vec2 uv = (vec2(texC, texR) + halfCR) /\n                     vec2(${d}.0, ${c}.0);\n          return sampleTexture(${r}, uv);\n        }\n      `;if(d===a&&null==h)return t?`\n      float ${o}(int row, int col, int depth) {\n        float texR = dot(vec2(row, col), vec2(${r}Shape[1], 1));\n        float texC = float(depth);\n        vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${r}TexShape[1], ${r}TexShape[0]);\n        return sampleTexture(${r}, uv);\n      }\n    `:`\n    float ${o}(int row, int col, int depth) {\n      float texR = dot(vec2(row, col), vec2(${n[1]}, 1));\n      float texC = float(depth);\n      vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${d}.0, ${c}.0);\n      return sampleTexture(${r}, uv);\n    }\n  `;const f=fP(r);return t?`\n    float ${o}(int row, int col, int depth) {\n      // Explicitly use integer operations as dot() only works on floats.\n      int stride0 = ${r}Shape[1] * ${r}Shape[2];\n      int stride1 = ${r}Shape[2];\n      int index = row * ${i} + col * ${a} + depth + ${f};\n      vec2 uv = uvFromFlat(${r}TexShape[0], ${r}TexShape[1], index);\n      return sampleTexture(${r}, uv);\n    }\n    `:`\n      float ${o}(int row, int col, int depth) {\n        // Explicitly use integer operations as dot() only works on floats.\n        int index = row * ${i} + col * ${a} + depth + ${f};\n        vec2 uv = uvFromFlat(${c}, ${d}, index);\n        return sampleTexture(${r}, uv);\n      }\n  `}(e,t);case 4:return function(e,t){const n=e.shapeInfo.logicalShape,r=e.name,o="get"+r.charAt(0).toUpperCase()+r.slice(1),i=n[3],a=n[2]*i,s=n[1]*a,{newShape:l,keptDims:u}=oe(n);if(l.length<n.length){const n=["row","col","depth","depth2"];return`\n      ${lP(bP(e,l),t)}\n      float ${o}(int row, int col, int depth, int depth2) {\n        return ${o}(${$P(n,u)});\n      }\n    `}if(e.shapeInfo.isUniform)return`\n      float ${o}(int row, int col, int depth, int depth2) {\n        int index = round(dot(vec4(row, col, depth, depth2),\n                          vec4(${s}, ${a}, ${i}, 1)));\n        ${gP(e)}\n      }\n    `;const p=e.shapeInfo.flatOffset,c=e.shapeInfo.texShape,d=c[0],h=c[1],f=`int stride2 = ${r}Shape[3];`,g=`int stride1 = ${r}Shape[2] * stride2;`,m=`int stride0 = ${r}Shape[1] * stride1;`;if(h===s&&null==p)return t?`\n      float ${o}(int row, int col, int depth, int depth2) {\n        ${f}\n        ${g}\n        float texR = float(row);\n        float texC =\n            dot(vec3(col, depth, depth2),\n                vec3(stride1, str
2ide2, 1));\n        vec2 uv = (vec2(texC, texR) + halfCR) /\n                   vec2(${r}TexShape[1], ${r}TexShape[0]);\n        return sampleTexture(${r}, uv);\n      }\n    `:`\n      float ${o}(int row, int col, int depth, int depth2) {\n        float texR = float(row);\n        float texC =\n            dot(vec3(col, depth, depth2),\n                vec3(${a}, ${i}, 1));\n        vec2 uv = (vec2(texC, texR) + halfCR) /\n                   vec2(${h}.0, ${d}.0);\n        return sampleTexture(${r}, uv);\n      }\n    `;if(h===i&&null==p)return t?`\n      float ${o}(int row, int col, int depth, int depth2) {\n        float texR = dot(vec3(row, col, depth),\n                         vec3(${r}Shape[1] * ${r}Shape[2], ${r}Shape[2], 1));\n        float texC = float(depth2);\n        vec2 uv = (vec2(texC, texR) + halfCR) /\n                  vec2(${r}TexShape[1], ${r}TexShape[0]);\n        return sampleTexture(${r}, uv);\n      }\n    `:`\n      float ${o}(int row, int col, int depth, int depth2) {\n        float texR = dot(vec3(row, col, depth),\n                         vec3(${n[1]*n[2]}, ${n[2]}, 1));\n        float texC = float(depth2);\n        vec2 uv = (vec2(texC, texR) + halfCR) /\n                  vec2(${h}.0, ${d}.0);\n        return sampleTexture(${r}, uv);\n      }\n    `;const y=fP(r);return t?`\n    float ${o}(int row, int col, int depth, int depth2) {\n      // Explicitly use integer operations as dot() only works on floats.\n      ${f}\n      ${g}\n      ${m}\n      int index = row * stride0 + col * stride1 +\n          depth * stride2 + depth2;\n      vec2 uv = uvFromFlat(${r}TexShape[0], ${r}TexShape[1], index + ${y});\n      return sampleTexture(${r}, uv);\n    }\n  `:`\n    float ${o}(int row, int col, int depth, int depth2) {\n      // Explicitly use integer operations as dot() only works on floats.\n      int index = row * ${s} + col * ${a} +\n          depth * ${i} + depth2;\n      vec2 uv = uvFromFlat(${d}, ${h}, index + ${y});\n      return sampleTexture(${r}, uv);\n    }\n  `}(e,t);case 5:return function(e){const t=e.shapeInfo.logicalShape,n=e.name,r="get"+n.charAt(0).toUpperCase()+n.slice(1),o=t[4],i=t[3]*o,a=t[2]*i,s=t[1]*a,{newShape:l,keptDims:u}=oe(t);if(l.length<t.length){const t=["row","col","depth","depth2","depth3"];return`\n      ${lP(bP(e,l))}\n      float ${r}(int row, int col, int depth, int depth2, int depth3) {\n        return ${r}(${$P(t,u)});\n      }\n    `}if(e.shapeInfo.isUniform)return`\n      float ${r}(int row, int col, int depth, int depth2, int depth3) {\n        float index = dot(\n          vec4(row, col, depth, depth2),\n          vec4(${s}, ${a}, ${i}, ${o})) +\n          depth3;\n        ${gP(e)}\n      }\n    `;const p=e.shapeInfo.flatOffset,c=e.shapeInfo.texShape,d=c[0],h=c[1];if(h===s&&null==p)return`\n      float ${r}(int row, int col, int depth, int depth2, int depth3) {\n        int texR = row;\n        float texC = dot(vec4(col, depth, depth2, depth3),\n                         vec4(${a}, ${i}, ${o}, 1));\n        vec2 uv = (vec2(texC, texR) + halfCR) /\n                   vec2(${h}.0, ${d}.0);\n        return sampleTexture(${n}, uv);\n      }\n    `;if(h===o&&null==p)return`\n      float ${r}(int row, int col, int depth, int depth2, int depth3) {\n        float texR = dot(\n          vec4(row, col, depth, depth2),\n          vec4(${t[1]*t[2]*t[3]},\n               ${t[2]*t[3]}, ${t[3]}, 1));\n        int texC = depth3;\n        vec2 uv = (vec2(texC, texR) + halfCR) /\n                  vec2(${h}.0, ${d}.0);\n        return sampleTexture(${n}, uv);\n      }\n    `;return`\n    float ${r}(int row, int col, int depth, int depth2, int depth3) {\n      // Explicitly use integer operations as dot() only works on floats.\n      int index = row * ${s} + col * ${a} + depth * ${i} +\n          depth2 * ${o} + depth3 + ${fP(n)};\n      vec2 uv = uvFromFlat(${d}, ${h}, index);\n      return sampleTexture(${n}, uv);\n    }\n  `}(e);case 6:return function(e){const t=e.shapeInfo.logicalShape,n=e.name,r="get"+n.charAt(0).toUpperCase()+n.slice(1),{newShape:o,keptDims:i}=oe(t);if(o.length<t.length){const t=["row","col","depth","depth2","depth3","depth4"];return`\n      ${lP(bP(e,o))}\n      float ${r}(int row, int col, int depth,\n                    int depth2, int depth3, int depth4) {\n        return ${r}(${$P(t,i)});\n      }\n    `}const a=t[5],s=t[4]*a,l=t[3]*s,u=t[2]*l,p=t[1]*u;if(e.shapeInfo.isUniform)return`\n      float ${r}(int row, int col, int depth,\n                  int depth2, int depth3, int depth4) {\n        int index = round(dot(\n          vec4(row, col, depth, depth2),\n          vec4(${p}, ${u}, ${l}, ${s})) +\n          dot(\n            vec2(depth3, depth4),\n            vec2(${a}, 1)));\n        ${gP(e)}\n      }\n    `;const c=e.shapeInfo.flatOffset,d=e.shapeInfo.texShape,h=d[0],f=d[1];if(f===p&&null==c)return`\n      float ${r}(int row, int col, int depth,\n                    int depth2, int depth3, int depth4) {\n        int texR = row;\n        float texC = dot(vec4(col, depth, depth2, depth3),\n          vec4(${u}, ${l}, ${s}, ${a})) +\n               float(depth4);\n        vec2 uv = (vec2(texC, texR) + halfCR) /\n                   vec2(${f}.0, ${h}.0);\n        return sampleTexture(${n}, uv);\n      }\n    `;if(f===a&&null==c)return`\n      float ${r}(int row, int col, int depth,\n                    int depth2, int depth3, int depth4) {\n        float texR = dot
2(vec4(row, col, depth, depth2),\n          vec4(${t[1]*t[2]*t[3]*t[4]},\n               ${t[2]*t[3]*t[4]},\n               ${t[3]*t[4]},\n               ${t[4]})) + float(depth3);\n        int texC = depth4;\n        vec2 uv = (vec2(texC, texR) + halfCR) /\n                  vec2(${f}.0, ${h}.0);\n        return sampleTexture(${n}, uv);\n      }\n    `;return`\n    float ${r}(int row, int col, int depth,\n                  int depth2, int depth3, int depth4) {\n      // Explicitly use integer operations as dot() only works on floats.\n      int index = row * ${p} + col * ${u} + depth * ${l} +\n          depth2 * ${s} + depth3 * ${a} + depth4 + ${fP(n)};\n      vec2 uv = uvFromFlat(${h}, ${f}, index);\n      return sampleTexture(${n}, uv);\n    }\n  `}(e);default:throw new Error(`${n.length}-D input sampling is not yet supported`)}}function uP(e,t){switch(e.shapeInfo.logicalShape.length){case 0:return function(e){const t=e.name;return`\n    vec4 ${"get"+t.charAt(0).toUpperCase()+t.slice(1)}() {\n      return ${tP().texture2D}(${t}, halfCR);\n    }\n  `}(e);case 1:return function(e,t){const n=e.name,r="get"+n.charAt(0).toUpperCase()+n.slice(1),o=e.shapeInfo.texShape,i=tP();if(t)return`\n    vec4 ${r}(int index) {\n      ivec2 packedTexShape = ivec2(ceil(float(${n}TexShape[0]) / 2.0), ceil(float(${n}TexShape[1]) / 2.0));\n      vec2 uv = packedUVfrom1D(\n        packedTexShape[0], packedTexShape[1], index);\n      return ${i.texture2D}(${n}, uv);\n    }\n  `;const a=[Math.ceil(o[0]/2),Math.ceil(o[1]/2)];return`\n    vec4 ${r}(int index) {\n      vec2 uv = packedUVfrom1D(\n        ${a[0]}, ${a[1]}, index);\n      return ${i.texture2D}(${n}, uv);\n    }\n  `}(e,t);case 2:return function(e,t){const n=e.shapeInfo.logicalShape,r=e.name,o="get"+r.charAt(0).toUpperCase()+r.slice(1),i=e.shapeInfo.texShape,a=i[0],s=i[1],l=tP();if(null!=i&&Z(n,i))return t?`\n      vec4 ${o}(int row, int col) {\n        vec2 uv = (vec2(col, row) + halfCR) / vec2(${r}TexShape[1], ${r}TexShape[0]);\n\n        return ${l.texture2D}(${r}, uv);\n      }\n    `:`\n      vec4 ${o}(int row, int col) {\n        vec2 uv = (vec2(col, row) + halfCR) / vec2(${s}.0, ${a}.0);\n\n        return ${l.texture2D}(${r}, uv);\n      }\n    `;if(t)return`\n    vec4 ${o}(int row, int col) {\n      ivec2 packedTexShape = ivec2(ceil(float(${r}TexShape[0]) / 2.0), ceil(float(${r}TexShape[1]) / 2.0));\n      int valuesPerRow = int(ceil(float(${r}Shape[1]) / 2.0));\n      vec2 uv = packedUVfrom2D(valuesPerRow, packedTexShape[0], packedTexShape[1], row, col);\n      return ${l.texture2D}(${r}, uv);\n    }\n  `;const u=[Math.ceil(i[0]/2),Math.ceil(i[1]/2)];return`\n    vec4 ${o}(int row, int col) {\n      vec2 uv = packedUVfrom2D(${Math.ceil(n[1]/2)}, ${u[0]}, ${u[1]}, row, col);\n      return ${l.texture2D}(${r}, uv);\n    }\n  `}(e,t);case 3:return function(e,t){const n=e.shapeInfo.logicalShape,r=e.name,o="get"+r.charAt(0).toUpperCase()+r.slice(1),i=e.shapeInfo.texShape,a=[Math.ceil(i[0]/2),Math.ceil(i[1]/2)];if(1===n[0]){const r=[1,2],i=["b","row","col"];return`\n        ${uP(bP(e,n.slice(1)),t)}\n        vec4 ${o}(int b, int row, int col) {\n          return ${o}(${$P(i,r)});\n        }\n      `}const s=tP();if(t)return`\n    vec4 ${o}(int b, int row, int col) {\n      ivec2 packedTexShape = ivec2(ceil(float(${r}TexShape[0]) / 2.0), ceil(float(${r}TexShape[1]) / 2.0));\n      int valuesPerRow = int(ceil(float(${r}Shape[2]) / 2.0));\n      int texelsInBatch = valuesPerRow * int(ceil(float(${r}Shape[1]) / 2.0));\n      vec2 uv = packedUVfrom3D(\n        packedTexShape[0], packedTexShape[1], texelsInBatch, valuesPerRow, b, row, col);\n      return ${s.texture2D}(${r}, uv);\n    }\n  `;const l=a[0],u=a[1],p=Math.ceil(n[2]/2);return`\n    vec4 ${o}(int b, int row, int col) {\n      vec2 uv = packedUVfrom3D(\n        ${l}, ${u}, ${p*Math.ceil(n[1]/2)}, ${p}, b, row, col);\n      return ${s.texture2D}(${r}, uv);\n    }\n  `}(e,t);default:return function(e,t){const n=e.name,r="get"+n.charAt(0).toUpperCase()+n.slice(1),o=tP();if(t)return`\n    vec4 ${r}(int b2, int b, int row, int col) {\n      int valuesPerRow = int(ceil(float(${n}Shape[3]) / 2.0));\n      int texelsInBatch = valuesPerRow * int(ceil(float(${n}Shape[2]) / 2.0));\n      int index = b * texelsInBatch + (row / 2) * valuesPerRow + (col / 2);\n      texelsInBatch *= ${n}Shape[1];\n      index = b2 * texelsInBatch + index;\n      ivec2 packedTexShape = ivec2(ceil(float(${n}TexShape[0]) / 2.0), ceil(float(${n}TexShape[1]) / 2.0));\n      int texR = index / packedTexShape[1];\n      int texC = index - texR * packedTexShape[1];\n      vec2 uv = (vec2(texC, texR) + halfCR) / vec2(packedTexShape[1], packedTexShape[0]); return ${o.texture2D}(${n}, uv);\n    }\n  `;const i=e.shapeInfo.logicalShape,a=i.length,s=e.shapeInfo.texShape,l=[Math.ceil(s[0]/2),Math.ceil(s[1]/2)],u=l[0],p=l[1],c=Math.ceil(i[a-1]/2);let d=c*Math.ceil(i[a-2]/2),h="int b, int row, int col",f=`b * ${d} + (row / 2) * ${c} + (col / 2)`;for(let e=2;e<a-1;e++)h=`int b${e}, `+h,d*=i[a-e-1],f=`b${e} * ${d} + `+f;return`\n    vec4 ${r}(${h}) {\n      int index = ${f};\n      int texR = index / ${p};\n      int texC = index - texR * ${p};\n      vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${p}, ${u});\n      return ${o.texture2D}(${n}, uv);\n    }\n  `}(e,t)}}const pP="\nvec2 uvFromFlat(int texNumR, int texNumC, int index) {\n  int texR = index / texNumC;\n  int texC = index - texR * texNumC;\n  return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\nvec2 packedUVfrom1D(int texNumR, int texNumC, int index) {\n  int texelIndex = index / 2;\n  int texR = texelIndex / texNumC;\n  int texC = texelIndex - texR * texNumC;\n  return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n",cP="\nvec2 packedUVfrom2D(int texelsInLogicalRow, int texNumR,\n  int texNumC, int row, int col) {\n  int texelIndex = (row / 2) * texelsInLogicalRow + (col / 2);\n  int texR = texelIndex / texNumC;\n  int texC = texelIndex - texR * texNumC;\n  return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n",dP="\nvec2 packedUVfrom3D(int texNumR, int texNumC,\n    int texelsInBatch, int texelsInLogicalRow, int b,\n    int row, int col) {\n  int index = b * texelsInBatch + (row / 2) * texelsInLogicalRow + (col / 2);\n  int texR = index / texNumC;\n  int texC = index - texR * texNumC;\n  return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n",hP="\n  float getChannel(vec4 frag, vec2 innerDims) {\n    vec2 modCoord = mod(innerDims, 2.);\n    return modCoord.x == 0. ?\n      (modCoord.y == 0. ? frag.r : frag.g) :\n      (modCoord.y == 0. ? frag.b : frag.a);\n  }\n  float getChannel(vec4 frag, int dim) {\n    float modCoord = mod(float(dim), 2.);\n    return modCoord == 0. ? frag.r : frag.g;\n  }\n";function fP(e){return`offset${e}`}function gP(e){const t=e.name,n=J(e.shapeInfo.logicalShape);return n<2?`return ${t};`:`\n    for (int i = 0; i < ${n};
2 i++) {\n      if (i == index) {\n        return ${t}[i];\n      }\n    }\n  `}function mP(e){if(e<=1)return"int";if(2===e)return"ivec2";if(3===e)return"ivec3";if(4===e)return"ivec4";if(5===e)return"ivec5";if(6===e)return"ivec6";throw Error(`GPU for rank ${e} is not yet supported`)}function yP(e,t,n){const{newShape:r,keptDims:o}=oe(t),i=t.length,a=e&&3===i&&1===t[0],s=a?t.slice(1):r,l=!e&&i>1&&!Z(t,n)&&r.length<i||a;return{useSqueezeShape:l,uniformShape:l?s:t,keptDims:o}}function bP(e,t){const n=JSON.parse(JSON.stringify(e));return n.shapeInfo.logicalShape=t,n}function $P(e,t){return t.map(t=>e[t]).join(", ")}function _P(e,t){if(e.length!==t.length)throw Error(`Binary was compiled with ${e.length} inputs, but was executed with ${t.length} inputs`);e.forEach((e,n)=>{const r=e.logicalShape,o=t[n],i=o.shape;if(!Z(r,i))throw Error(`Binary was compiled with different shapes than the current args. Shapes ${r} and ${i} must match`);if(e.isUniform&&o.isUniform)return;const a=e.texShape,s=o.isUniform?null:o.texData.texShape;if(!Z(a,s))throw Error(`Binary was compiled with different texture shapes than the current args. Shape ${a} and ${s} must match`)})}function wP(e){return ke().getBool("WEBGL_USE_SHAPES_UNIFORMS")&&e<=4}class xP{constructor(e){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0,this.outPackingScheme=kB.DENSE,this.customUniforms=[{name:"texShape",type:"ivec2"}];const t=tP();this.outputShape=e,this.enableShapeUniforms=wP(this.outputShape.length),this.userCode=`\n      ivec3 outCoordsFromFlatIndex(int index) {\n        ${this.enableShapeUniforms?rP(["r","c","d"],e):nP(["r","c","d"],e)}\n        return ivec3(r, c, d);\n      }\n\n      void main() {\n        ivec2 resTexRC = ivec2(resultUV.yx * vec2(texShape[0], texShape[1]));\n        int index = 4 * (resTexRC.x * texShape[1] + resTexRC.y);\n\n        vec4 result = vec4(0.);\n\n        for (int i=0; i<4; i++) {\n          int flatIndex = index + i;\n          ivec3 rc = outCoordsFromFlatIndex(flatIndex);\n          result[i] = getA(rc.x, rc.y, rc.z);\n        }\n\n        ${t.output} = result;\n      }\n    `}}class SP{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outPackingScheme=kB.DENSE,this.customUniforms=[{name:"texShape",type:"ivec2"}];const t=tP();this.outputShape=e,this.enableShapeUniforms=wP(this.outputShape.length),this.userCode=`\n      ivec3 outCoordsFromFlatIndex(int index) {\n        ${this.enableShapeUniforms?rP(["r","c","d"],e):nP(["r","c","d"],e)}\n        return ivec3(r, c, d);\n      }\n\n      void main() {\n        ivec2 resTexRC = ivec2(resultUV.yx * vec2(texShape[0], texShape[1]));\n        int index = 4 * (resTexRC.x * texShape[1] + resTexRC.y);\n\n        vec4 result = vec4(0.);\n\n        for (int i=0; i<4; i++) {\n          int flatIndex = index + i;\n          ivec3 rc = outCoordsFromFlatIndex(flatIndex);\n          result[i] = getChannel(getA(rc.x, rc.y, rc.z), vec2(rc.y, rc.z));\n        }\n\n        ${t.output} = result;\n      }\n    `}}class vP{constructor(e){this.variableNames=["A"],this.outTexUsage=EB.DOWNLOAD;const t=tP();this.outputShape=e,this.userCode=`\n      ${iP}\n\n      void main() {\n        float x = getAAtOutCoords();\n        ${t.output} = encode_float(x);\n      }\n    `}}class kP{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!1,this.outTexUsage=EB.DOWNLOAD;const t=tP();this.outputShape=e,this.userCode=`\n      ${iP}\n\n      void main() {\n        ivec3 coords = getOutputCoords();\n        float x = getChannel(getAAtOutCoords(), vec2(coords.y, coords.z));\n        ${t.output} = encode_float(x);\n      }\n    `}}class EP{constructor(e,t=!1){this.variableNames=["A"],this.customUniforms=[{name:"texShape",type:"ivec2"}];const n=tP();this.outputShape=e,this.enableShapeUniforms=wP(this.outputShape.length);let r="result";t&&(r="floor(result * 255. + 0.5)"),this.userCode=`\n      ${this.enableShapeUniforms?"\n  int getFlatIndex(ivec3 coords) {\n    return coords.x * outShapeStrides[0] + coords.y * outShapeStrides[1] + coords.z;\n  }\n":oP(e)}\n\n      void main() {\n        ivec3 coords = getOutputCoords();\n\n        int flatIndex = getFlatIndex(coords);\n        int offset = imod(flatIndex, 4);\n\n        flatIndex = idiv(flatIndex, 4, 1.);\n\n        int r = flatIndex / texShape[1];\n        int c = imod(flatIndex, texShape[1]);\n        vec2 uv = (vec2(c, r) + halfCR) / vec2(texShape[1], texShape[0]);\n        vec4 values = ${n.texture2D}(A, uv);\n\n        float result;\n\n        if(offset == 0) {\n          result = values[0];\n        } else if(offset == 1) {\n          result = values[1];\n        } else if(offset == 2) {\n          result = values[2];\n        } else {\n          result = values[3];\n        }\n\n        ${n.output} = vec4(${r}, 0., 0., 0.);\n      }\n    `}}class IP{constructor(e,t=!1){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0,this.customUniforms=[{name:"texShape",type:"ivec2"}];const n=tP();this.outputShape=e,this.enableShapeUniforms=wP(this.outputShape.length);let r="",o="result";t&&(o="floor(result * 255. + 0.5)");for(let t=0;t<=1;t++)for(let o=0;o<=1;o++){const i=2*t+o;r+=`\n          localCoords = coords;\n          if(localCoords[2] + ${o} < ${this.enableShapeUniforms?"outShape[2]":`${e[2]}`}
2) {\n          localCoords[2] += ${o};\n          if (localCoords[1] + ${t} < ${this.enableShapeUniforms?"outShape[1]":`${e[1]}`}) {\n            localCoords[1] += ${t};\n\n            flatIndex = getFlatIndex(localCoords);\n            offset = imod(flatIndex, 4);\n\n            flatIndex = idiv(flatIndex, 4, 1.);\n\n            int r = flatIndex / texShape[1];\n            int c = imod(flatIndex, texShape[1]);\n            vec2 uv = (vec2(c, r) + halfCR) / vec2(texShape[1], texShape[0]);\n            values = ${n.texture2D}(A, uv);\n\n            if (offset == 0) {\n              result[${i}] = values[0];\n            } else if (offset == 1) {\n              result[${i}] = values[1];\n            } else if (offset == 2) {\n              result[${i}] = values[2];\n            } else {\n              result[${i}] = values[3];\n            }\n          }\n        }\n        `}this.userCode=`\n        ${this.enableShapeUniforms?"\n  int getFlatIndex(ivec3 coords) {\n    return coords.x * outShapeStrides[0] + coords.y * outShapeStrides[1] + coords.z;\n  }\n":oP(e)}\n\n        void main() {\n          ivec3 coords = getOutputCoords();\n\n          vec4 result = vec4(0.);\n          int flatIndex, r, c, offset;\n          ivec3 localCoords;\n          vec2 uv;\n          vec4 values;\n\n          ${r}\n\n          ${n.output} = ${o};\n        }\n    `}}function TP(e,t,n,r,o,i){!function(e,t){const n=ke().getNumber("WEBGL_MAX_TEXTURE_SIZE");if(e<=0||t<=0)throw new Error(`Requested texture size [${e}x${t}] is invalid.`);if(e>n||t>n)throw new Error(`Requested texture size [${e}x${t}] greater than WebGL maximum on this browser / GPU [${n}x${n}].`)}(t,n);const a=function(e){return UB(e,()=>e.createTexture(),"Unable to create WebGLTexture.")}(e),s=e.TEXTURE_2D;return AB(e,()=>e.bindTexture(s,a)),AB(e,()=>e.texParameteri(s,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE)),AB(e,()=>e.texParameteri(s,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE)),AB(e,()=>e.texParameteri(s,e.TEXTURE_MIN_FILTER,e.NEAREST)),AB(e,()=>e.texParameteri(s,e.TEXTURE_MAG_FILTER,e.NEAREST)),AB(e,()=>e.texImage2D(s,0,r,t,n,0,o,i,null)),AB(e,()=>e.bindTexture(e.TEXTURE_2D,null)),a}function FP(e){return e.internalFormatFloat}function NP(e){return e.internalFormatHalfFloat}function jP(e){return e.downloadTextureFormat}function AP(e){return e.internalFormatPackedFloat}function CP(e){return e.internalFormatPackedHalfFloat}class MP{constructor(e){this.outputTexture=null,this.program=null,this.disposed=!1,this.vertexAttrsAreBound=!1,this.itemsToPoll=[];const t=ke().getNumber("WEBGL_VERSION");null!=e?(this.gl=e,function(e,t){xB[e]=t}(t,e)):this.gl=vB(t);let n="WEBGL_color_buffer_float";const r="EXT_color_buffer_half_float";if(1===ke().getNumber("WEBGL_VERSION")){const e="OES_texture_float",t="OES_texture_half_float";if(this.textureFloatExtension=MB(this.gl,e),YB(this.gl,t))this.textureHalfFloatExtension=MB(this.gl,t);else if(ke().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),YB(this.gl,r))this.colorBufferHalfFloatExtension=MB(this.gl,r);else if(ke().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",YB(this.gl,n))this.colorBufferFloatExtension=this.gl.getExtension(n);else{if(!YB(this.gl,r))throw new Error("GL context does not support color renderable floats");this.colorBufferHalfFloatExtension=this.gl.getExtension(r)}this.vertexBuffer=function(e){return function(e,t){const n=UB(e,()=>e.createBuffer(),"Unable to create WebGLBuffer");return AB(e,()=>e.bindBuffer(e.ARRAY_BUFFER,n)),AB(e,()=>e.bufferData(e.ARRAY_BUFFER,t,e.STATIC_DRAW)),n}(e,new Float32Array([-1,1,0,0,1,-1,-1,0,0,0,1,1,0,1,1,1,-1,0,1,0]))}(this.gl),this.indexBuffer=function(e){return function(e,t){const n=UB(e,()=>e.createBuffer(),"Unable to create WebGLBuffer");return AB(e,()=>e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,n)),AB(e,()=>e.bufferData(e.ELEMENT_ARRAY_BUFFER,t,e.STATIC_DRAW)),n}(e,new Uint16Array([0,1,2,2,1,3]))}(this.gl),this.framebuffer=function(e){return UB(e,()=>e.createFramebuffer(),"Unable to create WebGLFramebuffer.")}(this.gl),this.textureConfig=jB(this.gl,this.textureHalfFloatExtension)}get debug(){return ke().getBool("DEBUG")}dispose(){if(this.disposed)return;null!=this.program&&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."),null!=this.outputTexture&&console.warn("Disposing a GPGPUContext that still has a bound output matrix texture.  This is probably a resource leak, delete the output matrix texture with GPGPUContext.deleteMatrixTexture before disposing.");const e=this.gl;AB(e,()=>e.finish()),AB(e,()=>e.bindFramebuffer(e.FRAMEBUFFER,null)),AB(e,()=>e.deleteFramebuffer(this.framebuffer)),AB(e,()=>e.bindBuffer(e.ARRAY_BUFFER,null)),AB(e,()=>e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null)),AB(e,()=>e.deleteBuffer(this.indexBuffer)),this.disposed=!0}createFloat32MatrixTexture(e,t){return this.throwIfDisposed(),function(e,t,n,r){const[o,i]=TB(t,n);return TP(e,o,i,FP(r),r.textureFormatFloat,e.FLOAT)}(this.gl,e,t,this.textureConfig)}createFloat16MatrixTexture(e,t){return this.throwIfDisposed(),function(e,t,n,r){const[o,i]=TB(t,n);return TP(e,o,i,NP(r),r.textureFormatFloat,r.textureTypeHalfFloat)}(this.gl,e,t,this.textureConfig)}createUnsignedBytesMatrixTexture(e,t){return this.throwIfDisposed(),function(e,t,n,r){const[o,i]=TB(t,n);return TP(e,o,i,jP(r),e.RGBA,e.UNSIGNED_BYTE)}(this.gl,e,t,this.textureConfig)}uploadPixelDataToTexture(e,t){this.throwIfDisposed(),function(e,t,n){AB(e,()=>e.bindTexture(e.TEXTURE_2D,t)),n.data instanceof Uint8Array?AB(e,()=>e.texImage2D(e.TEXTURE_2D,0,e.RGBA,n.width,n.height,0,e.RGBA,e.UNSIGNED_BYTE,n.data)):AB(e,()=>e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,n)),AB(e,()=>e.bindTexture(e.TEXTURE_2D,null))}(this.gl,e,t)}uploadDenseMatrixToTexture(e,t,n,r){this.throwIfDisposed(),function(e,t,n,r,o,i){let a,s,l;AB(e,()=>e.bindTexture(e.TEXTURE_2D,t)),o instanceof Uint8Array?(a=new Uint8Array(n*r*4),s=e.UNSIGNED_BYTE,l=e.RGBA):(a=new Float32Array(n*r*4),s=e.FLOAT,l=i.internalFormatPackedFloat),a.set(o),AB(e,()=>e.texImage2D(e.TEXTURE_2D,0,l,n,r,0,e.RGBA,s,a)),AB(e,()=>e.bindTexture(e.TEXTURE_2D,null))}(this.gl,e,t,n,r,this.textureConfig)}createFloat16PackedMatrixTexture(e,t){return this.throwIfDisposed(),function(e,t,n,r){const[o,i]=NB(t,n);return TP(e,o,i,CP(r),e.RGBA,r.textureTypeHalfFloat)}(this.gl,e,t,this.textureConfig)}createPackedMatrixTexture(e,t){return this.throwIfDisposed(),function(e,t,n,r){const[o,i]=NB(t,n);return TP(e,o,i,AP(r),e.RGBA,e.FLOAT)}(this.gl,e,t,this.textureConfig)}deleteMatrixTexture(e){this.throwIfDisposed(),this.outputTexture===e&&(LB(this.gl,this.framebuffer),this.outputTexture=null),AB(this.gl,()=>this.gl.deleteTexture(e))}downloadByteEncodedFloatMatrixFromOutputTexture(e,t,n){return this.downloadMatrixDriver(e,()=>function(e,t,n,r){const[o,i]=TB(t,n),a=new Uint8Array(t*n*4);return AB(e,()=>e.readPixels(0,0,o,i,r.downloadTextureFormat,e.UNSIGNED_BYTE,a)),new Float32Array(a.buffer)}(this.gl,t,n,this.textureConfig))}downloadPackedMatrixFromBuffer(e,t,n,r,o,i){return function(e,t,n,r,o,i,a){const s=e,l=new Float32Array(function(e,t){const[n,r]=NB(e,t);return n*r*4}(i,a));return s.bindBuffer(s.PIXEL_PACK_BUFFER,t),s.getBufferSubData(s.PIXEL_PACK_BUFFER,0,l),s.bindBuffer(s.PIXEL_PACK_BUFFER,null),l}(this.gl,e,0,0,0,o,i,this.textureConfig)}downloadFloat32MatrixFromBuffer(e,t){return function(e,t,n){const r=e,o=new Float32Array(n);return r.bindBuffer(r.PIXEL_PACK_BUFFER,t),r.getBufferSubData(r.PIXEL_PACK_BUFFER,0,o),r.bindBuffer(r.PIXEL_PACK_BUFFER,null),o}(this.gl,e,t)}createBufferFromTexture(e,t,n){this.bindTextureToFrameBuffer(e);const r=function(e,t,n){const r=e.createBuffer();AB(e,()=>e.bindBuffer(e.PIXEL_PACK_BUFFER,r));const o=16*t*n;return AB(e,()=>e.bufferData(e.PIXEL_PACK_BUFFER,o,e.STREAM_READ)),AB(e,()=>e.readPixels(0,0,n,t,e.RGBA,e.FLOAT,0)),AB(e,()=>e.bindBuffer(e.PIXEL_PACK_BUFFER,null)),r}(this.gl,t,n,this.textureConfig);return this.unbindTextureToFrameBuffer(),r}createAndWaitForFence(){const e=this.createFence(this.gl);
2return this.pollFence(e)}createFence(e){let t,n;if(ke().getBool("WEBGL_FENCE_API_ENABLED")){const r=e,o=r.fenceSync(r.SYNC_GPU_COMMANDS_COMPLETE,0);e.flush(),n=()=>{const e=r.clientWaitSync(o,0,0);return e===r.ALREADY_SIGNALED||e===r.CONDITION_SATISFIED},t=o}else ke().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0?(t=this.beginQuery(),this.endQuery(),n=()=>this.isQueryAvailable(t,ke().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))):n=()=>!0;return{query:t,isFencePassed:n}}downloadMatrixFromPackedTexture(e,t,n){return this.downloadMatrixDriver(e,()=>function(e,t,n){const r=new Float32Array(t*n*4);return AB(e,()=>e.readPixels(0,0,n,t,e.RGBA,e.FLOAT,r)),r}(this.gl,t,n))}createProgram(e){this.throwIfDisposed();const t=this.gl,n=function(e,t){const n=UB(e,()=>e.createShader(e.FRAGMENT_SHADER),"Unable to create fragment WebGLShader.");if(AB(e,()=>e.shaderSource(n,t)),AB(e,()=>e.compileShader(n)),!1===e.getShaderParameter(n,e.COMPILE_STATUS))throw function(e,t){const n=DB.exec(t);if(null==n)return console.log(`Couldn't parse line number in error: ${t}`),void console.log(e);const r=+n[1],o=e.split("\n"),i=o.length.toString().length+2,a=o.map((e,t)=>te((t+1).toString(),i)+e);let s=0;for(let e=0;e<a.length;e++)s=Math.max(a[e].length,s);const l=a.slice(0,r-1),u=a.slice(r-1,r),p=a.slice(r);console.log(l.join("\n")),console.log(t.split("\n")[0]),console.log(`%c ${te(u[0],s)}`,"border:1px solid red; background-color:#e3d2d2; color:#a61717"),console.log(p.join("\n"))}(t,e.getShaderInfoLog(n)),new Error("Failed to compile fragment shader.");return n}(t,e);null==this.vertexShader&&(this.vertexShader=function(e){const t=tP();return function(e,t){const n=UB(e,()=>e.createShader(e.VERTEX_SHADER),"Unable to create vertex WebGLShader.");if(AB(e,()=>e.shaderSource(n,t)),AB(e,()=>e.compileShader(n)),!1===e.getShaderParameter(n,e.COMPILE_STATUS))throw console.log(e.getShaderInfoLog(n)),new Error("Failed to compile vertex shader.");return n}(e,`${t.version}\n    precision highp float;\n    ${t.attribute} vec3 clipSpacePos;\n    ${t.attribute} vec2 uv;\n    ${t.varyingVs} vec2 resultUV;\n\n    void main() {\n      gl_Position = vec4(clipSpacePos, 1);\n      resultUV = uv;\n    }`)}(t));const r=function(e){return UB(e,()=>e.createProgram(),"Unable to create WebGLProgram.")}(t);return AB(t,()=>t.attachShader(r,this.vertexShader)),AB(t,()=>t.attachShader(r,n)),function(e,t){if(AB(e,()=>e.linkProgram(t)),!1===e.getProgramParameter(t,e.LINK_STATUS))throw console.log(e.getProgramInfoLog(t)),new Error("Failed to link vertex and fragment shaders.")}(t,r),this.debug&&OB(t,r),this.vertexAttrsAreBound||(this.setProgram(r),this.vertexAttrsAreBound=function(e,t,n){return AB(e,()=>e.bindBuffer(e.ARRAY_BUFFER,n)),RB(e,t,"clipSpacePos",n,3,20,0)&&RB(e,t,"uv",n,2,20,12)}(t,this.program,this.vertexBuffer)),r}deleteProgram(e){this.throwIfDisposed(),e===this.program&&(this.program=null),null!=e&&AB(this.gl,()=>this.gl.deleteProgram(e))}setProgram(e){this.throwIfDisposed(),this.program=e,null!=this.program&&this.debug&&OB(this.gl,this.program),AB(this.gl,()=>this.gl.useProgram(e))}getUniformLocation(e,t,n=!0){return this.throwIfDisposed(),n?function(e,t,n){return UB(e,()=>e.getUniformLocation(t,n),'uniform "'+n+'" not present in program.')}(this.gl,e,t):function(e,t,n){return e.getUniformLocation(t,n)}(this.gl,e,t)}getAttributeLocation(e,t){return this.throwIfDisposed(),AB(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(),BB(this.gl,e,t,n)}setOutputMatrixTexture(e,t,n){this.setOutputMatrixTextureDriver(e,n,t)}setOutputPackedMatrixTexture(e,t,n){this.throwIfDisposed();const[r,o]=NB(t,n);this.setOutputMatrixTextureDriver(e,r,o)}setOutputMatrixWriteRegion(e,t,n,r){this.setOutputMatrixWriteRegionDriver(n,e,r,t)}setOutputPackedMatrixWriteRegion(e,t,n,r){throw new Error("setOutputPackedMatrixWriteRegion not implemented.")}debugValidate(){null!=this.program&&OB(this.gl,this.program),WB(this.gl)}executeProgram(){this.throwIfDisposed(),this.throwIfNoProgram();const e=this.gl;this.debug&&this.debugValidate(),AB(e,()=>e.drawElements(e.TRIANGLES,6,e.UNSIGNED_SHORT,0))}blockUntilAllProgramsCompleted(){this.throwIfDisposed(),AB(this.gl,()=>this.gl.finish())}getQueryTimerExtension(){return null==this.disjointQueryTimerExtension&&(this.disjointQueryTimerExtension=MB(this.gl,2===ke().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")?"EXT_disjoint_timer_query_webgl2":"EXT_disjoint_timer_query")),this.disjointQueryTimerExtension}getQueryTimerExtensionWebGL2(){return this.getQueryTimerExtension()}getQueryTimerExtensionWebGL1(){return this.getQueryTimerExtension()}beginQuery(){if(2===ke().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")){const e=this.gl,t=this.getQueryTimerExtensionWebGL2(),n=e.createQuery();return e.beginQuery(t.TIME_ELAPSED_EXT,n),n}const e=this.getQueryTimerExtensionWebGL1(),t=e.createQueryEXT();return e.beginQueryEXT(e.TIME_ELAPSED_EXT,t),t}endQuery(){if(2===ke().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")){const e=this.gl,t=this.getQueryTimerExtensionWebGL2();return void e.endQuery(t.TIME_ELAPSED_EXT)}const e=this.getQueryTimerExtensionWebGL1();e.endQueryEXT(e.TIME_ELAPSED_EXT)}async waitForQueryAndGetTime(e){return await ne(()=>this.disposed||this.isQueryAvailable(e,ke().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))),this.getQueryTime(e,ke().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))}getQueryTime(e,t){if(0===t)return null;if(2===t){const t=this.gl;return t.getQueryParameter(e,t.QUERY_RESULT)/1e6}{const t=this.getQueryTimerExtensionWebGL1();return t.getQueryObjectEXT(e,t.QUERY_RESULT_EXT)/1e6}}isQueryAvailable(e,t){if(0===t)return!0;
vendor: 5,851 bytes, line 2
2if(2===t){const t=this.gl,n=this.getQueryTimerExtensionWebGL2(),r=t.getQueryParameter(e,t.QUERY_RESULT_AVAILABLE);return null==this.disjoint&&(this.disjoint=this.gl.getParameter(n.GPU_DISJOINT_EXT)),r&&!this.disjoint}{const t=this.getQueryTimerExtensionWebGL1(),n=t.getQueryObjectEXT(e,t.QUERY_RESULT_AVAILABLE_EXT);return null==this.disjoint&&(this.disjoint=this.gl.getParameter(t.GPU_DISJOINT_EXT)),n&&!this.disjoint}}pollFence(e){return new Promise(t=>{this.addItemToPoll(()=>e.isFencePassed(),()=>t())})}pollItems(){const e=function(e){let t=0;for(;t<e.length&&e[t]();++t);return t-1}(this.itemsToPoll.map(e=>e.isDoneFn));for(let t=0;t<=e;++t){const{resolveFn:e}=this.itemsToPoll[t];e()}this.itemsToPoll=this.itemsToPoll.slice(e+1)}addItemToPoll(e,t){this.itemsToPoll.push({isDoneFn:e,resolveFn:t}),this.itemsToPoll.length>1||ne(()=>(this.pollItems(),0===this.itemsToPoll.length))}bindTextureToFrameBuffer(e){this.throwIfDisposed(),PB(this.gl,e,this.framebuffer),this.debug&&WB(this.gl)}unbindTextureToFrameBuffer(){null!=this.outputTexture?(PB(this.gl,this.outputTexture,this.framebuffer),this.debug&&WB(this.gl)):LB(this.gl,this.framebuffer)}downloadMatrixDriver(e,t){this.bindTextureToFrameBuffer(e);const n=t();return this.unbindTextureToFrameBuffer(),n}setOutputMatrixTextureDriver(e,t,n){this.throwIfDisposed();const r=this.gl;PB(r,e,this.framebuffer),this.debug&&WB(r),this.outputTexture=e,AB(r,()=>r.viewport(0,0,t,n)),AB(r,()=>r.scissor(0,0,t,n))}setOutputMatrixWriteRegionDriver(e,t,n,r){this.throwIfDisposed(),AB(this.gl,()=>this.gl.scissor(e,t,n,r))}throwIfDisposed(){if(this.disposed)throw new Error("Attempted to use disposed GPGPUContext.")}throwIfNoProgram(){if(null==this.program)throw new Error("No GPU program is currently set.")}}const{mx:DP,XI:OP,Nk:RP,YG:BP,hH:PP,z3:LP,sG:WP,uM:UP,vS:zP,qB:VP,GG:HP,rq:GP,lg:qP,WR:KP,cu:XP,GE:YP,px:JP,jC:ZP,He:QP,hE:eL,BF:tL,Dk:nL,cl:rL,_B:oL,qy:iL,Zy:aL,zv:sL,dH:lL,HS:uL,yH:pL,l3:cL,z9:dL,x6:hL,eW:fL,GK:gL,SP:mL,f6:yL,dl:bL,Dw:$L,xT:_L,_X:wL,wz:xL}=x;function SL(e,t){return["x","y","z","w","u","v"].slice(0,t).map(t=>`${e}.${t}`)}function vL(e,t){return 1===t?[e]:SL(e,t)}class kL{constructor(e){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0,this.outputShape=e;const t=e.length;if(0===t)this.userCode="\n        void main() {\n          setOutput(vec4(getA(), 0., 0., 0.));\n        }\n      ";else{const n=vL("rc",t),r=mP(t),o=function(e,t,n){if(1===e)return`rc > ${t[0]}`;let r="";for(let o=e-2;o<e;o++)r+=`${n[o]} >= ${t[o]}`,o<e-1&&(r+="||");return r}(t,e,n),i=function(e,t,n,r){if(1===e)return"";const o=r.slice(-2);return`\n    int r = ${o[0]};\n    int c = ${o[1]};\n    int rp1 = r + 1;\n    int cp1 = c + 1;\n\n    bool cEdge = cp1 >= ${t};\n    bool rEdge = rp1 >= ${n};\n  `}(t,e[e.length-1],e[e.length-2],n),a=function(e,t){const n=e.length,r=function(e,t){const n=[];for(let r=0;r<=1;r++)for(let o=0;o<=1;o++){let i=`${0===r?"r":"rp1"}, ${0===o?"c":"cp1"}`;for(let n=2;n<e;n++)i=`${t[t.length-1-n]},`+i;n.push(i)}return n}(n,t);return 1===n?`getA(rc),\n            rc + 1 >= ${e[0]} ? 0. : getA(rc + 1),\n            0, 0`:`getA(${r[0]}),\n          cEdge ? 0. : getA(${r[1]}),\n          rEdge ? 0. : getA(${r[2]}),\n          rEdge || cEdge ? 0. : getA(${r[3]})`}(e,n);this.userCode=`\n        void main() {\n          ${r} rc = getOutputCoords();\n\n          if(${o}) {\n            setOutput(vec4(0));\n          } else {\n            ${i}\n\n            setOutput(vec4(${a}));\n          }\n        }\n      `}}}class EL{constructor(e,t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"inputShape",type:"ivec3"}],this.outputShape=e,this.enableShapeUniforms=wP(this.outputShape.length);let n="";for(let e=0;e<4;e++){let t="thisRC = rc;";e%2==1&&(t+="thisRC.z += 1;"),e>1&&(t+="thisRC.y += 1;"),n+=`\n        ${t}\n        ${e>0?"if(thisRC.y < rows && thisRC.z < cols){":""}\n          int flatIndex = getFlatIndex(thisRC);\n\n          ivec3 inputRC = inputCoordsFromReshapedOutCoords(flatIndex);\n          vec2 inputRCInnerDims = vec2(float(inputRC.y),float(inputRC.z));\n\n          result[${e}] =\n            getChannel(getA(inputRC.x, inputRC.y, inputRC.z), inputRCInnerDims);\n        ${e>0?"}":""}\n      `}var r,o;this.userCode=`\n      ${r=t,o=this.enableShapeUniforms,`\n    ivec3 inputCoordsFromReshapedOutCoords(int index) {\n      ${o?function(e,t,n="index"){const r=function(e,t){const n=e.length,r=e.map(e=>`${t}[${e}]`),o=new Array(n-1);o[n-2]=r[n-1];for(let e=n-3;e>=0;--e)o[e]=`(${o[e+1]} * ${r[e+1]})`;return o}(e.map((e,t)=>t),t);return r.map((t,o)=>`int ${e[o]} = ${n} / ${r[o]}; ${o===r.length-1?`int ${e[o+1]} = ${n} - ${e[o]} * ${r[o]}`:`index -= ${e[o]} * ${r[o]}`};`).join("")}(["r","c","d"],"inputShape"):nP(["r","c","d"],r)}\n      return ivec3(r, c, d);\n    }\n  `}\n      ${this.enableShapeUniforms?"\n  int getFlatIndex(ivec3 coords) {\n    return coords.x * outShapeStrides[0] + coords.y * outShapeStrides[1] + coords.z;\n  }\n":oP(e)}\n\n      void main() {\n        ivec3 rc = getOutputCoords();\n\n        vec4 result = vec4(0.);\n\n        ivec3 thisRC;\n        int rows = ${this.enableShapeUniforms?"outShape[1]":e[1]};\n        int cols = ${this.enableShapeUniforms?"outShape[2]":e[2]};\n\n        ${n}\n\n        setOutput(result);\n      }\n    `}}class IL{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){const r=FL(t,n),o=NL(e,r,n);o in this.freeTextures||(this.freeTextures[o]=[]),o in this.usedTextures||(this.usedTextures[o]=[]);const i=TL(e,r,this.gpgpu.gl,this.gpgpu.textureConfig,n);if(this.freeTextures[o].length>0){this.numFreeTextures--,this.numUsedTextures++,this._numBytesFree-=i,this.log(
vendor: 6,556 bytes, line 2
2);const e=this.freeTextures[o].shift();return this.usedTextures[o].push(e),e}let a;return r===IB.PACKED_2X2_FLOAT32?a=this.gpgpu.createPackedMatrixTexture(e[0],e[1]):r===IB.PACKED_2X2_FLOAT16?a=this.gpgpu.createFloat16PackedMatrixTexture(e[0],e[1]):r===IB.UNPACKED_FLOAT32?a=this.gpgpu.createFloat32MatrixTexture(e[0],e[1]):r===IB.UNPACKED_FLOAT16?a=this.gpgpu.createFloat16MatrixTexture(e[0],e[1]):r===IB.PACKED_4X1_UNSIGNED_BYTE&&(a=this.gpgpu.createUnsignedBytesMatrixTexture(e[0],e[1])),this.usedTextures[o].push(a),this.numUsedTextures++,this._numBytesAllocated+=i,this.log(),a}releaseTexture(e,t,n,r){if(null==this.freeTextures)return;const o=FL(n,r),i=NL(t,o,r);i in this.freeTextures||(this.freeTextures[i]=[]);const a=TL(t,o,this.gpgpu.gl,this.gpgpu.textureConfig,r),s=ke().get("WEBGL_DELETE_TEXTURE_THRESHOLD");-1!==s&&this._numBytesAllocated>s?(this.gpgpu.deleteMatrixTexture(e),this._numBytesAllocated-=a):(this.freeTextures[i].push(e),this.numFreeTextures++,this._numBytesFree+=a),this.numUsedTextures--;const l=this.usedTextures[i],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;const e=this.numFreeTextures+this.numUsedTextures;console.log("Free/Used",`${this.numFreeTextures} / ${this.numUsedTextures}`,`(${e})`);const t=this._numBytesFree/this._numBytesAllocated;console.log(`Bytes allocated: ${this._numBytesAllocated}`),console.log(`Bytes unused: ${this._numBytesFree} (${Math.round(100*t)}%)`)}get numBytesAllocated(){return this._numBytesAllocated}get numBytesFree(){return this._numBytesFree}getNumUsedTextures(){return this.numUsedTextures}getNumFreeTextures(){return this.numFreeTextures}dispose(){if(null!=this.freeTextures){for(const e in this.freeTextures)this.freeTextures[e].forEach(e=>{this.gpgpu.deleteMatrixTexture(e)});for(const e in this.usedTextures)this.usedTextures[e].forEach(e=>{this.gpgpu.deleteMatrixTexture(e)});this.freeTextures=null,this.usedTextures=null,this.numUsedTextures=0,this.numFreeTextures=0,this._numBytesAllocated=0,this._numBytesFree=0}}}function TL(e,t,n,r,o){const i=function(e,t){switch(e){case IB.PACKED_2X2_FLOAT32:return AP(t);case IB.PACKED_2X2_FLOAT16:return CP(t);case IB.UNPACKED_FLOAT32:return FP(t);case IB.UNPACKED_FLOAT16:return NP(t);case IB.PACKED_4X1_UNSIGNED_BYTE:return jP(t);default:throw new Error(`Unknown physical texture type ${e}`)}}(t,r);let a;if(o){const[t,n]=NB(e[0],e[1]);a=t*n}else{const[t,n]=TB(e[0],e[1]);a=t*n}const s=function(e,t){const n=e;if(t===n.R32F)return 4;if(t===n.R16F)return 2;if(t===n.RGBA32F)return 16;if(t===e.RGBA)return 16;if(t===n.RGBA16F)return 8;throw new Error(`Unknown internal format ${t}`)}(n,i);return a*s}function FL(e,t){if(e===EB.UPLOAD)return IB.PACKED_2X2_FLOAT32;if(e===EB.RENDER||null==e)return function(e){return ke().getBool("WEBGL_RENDER_FLOAT32_ENABLED")?e?IB.PACKED_2X2_FLOAT32:IB.UNPACKED_FLOAT32:e?IB.PACKED_2X2_FLOAT16:IB.UNPACKED_FLOAT16}(t);if(e===EB.DOWNLOAD||e===EB.PIXELS)return IB.PACKED_4X1_UNSIGNED_BYTE;throw new Error(`Unknown logical texture type ${e}`)}function NL(e,t,n){return`${e[0]}_${e[1]}_${t}_${n}`}class jL{constructor(e,t){this.variableNames=["A"],this.outputShape=e,this.enableShapeUniforms=wP(this.outputShape.length),this.userCode=`\n      float unaryOperation(float x) {\n        ${t}\n      }\n\n      void main() {\n        float x = getAAtOutCoords();\n        float y = unaryOperation(x);\n\n        setOutput(y);\n      }\n    `}}const AL="if (isnan(x)) return x;",CL="return abs(x);",ML=AL+"\n  return (x < 0.0) ? 0.0 : x;\n",DL=AL+"\n  return (x < 0.0) ? 0.0 : min(6.0, x);\n",OL="return x;";class RL{constructor(e,t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.enableShapeUniforms=wP(this.outputShape.length),this.userCode=`\n      vec4 unaryOperation(vec4 x) {\n        ${t}\n      }\n\n      void main() {\n        vec4 x = getAAtOutCoords();\n        vec4 y = unaryOperation(x);\n\n        setOutput(y);\n      }\n    `}}class BL{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!1,this.outputShape=e;const t=e.length,n=vL("rc",t),r=mP(t),o=function(e,t){if(1===e)return"rc";let n="";for(let r=0;r<e;r++)n+=t[r],r<e-1&&(n+=",");return n}(t,n),i=n.slice(-2),a=t<=1?"rc":`vec2(${i.join(",")})`;this.userCode=`\n      void main() {\n        ${r} rc = getOutputCoords();\n        vec4 packedInput = getA(${o});\n\n        setOutput(getChannel(packedInput, ${a}));\n      }\n    `}}const PL=uu,LL={},WL=ke().getNumber("CPU_HANDOFF_SIZE_THRESHOLD");class UL extends z{constructor(e){if(super(),this.pendingRead=new WeakMap,this.pendingDisposal=new WeakSet,this.dataRefCount=new WeakMap,this.numBytesInGPU=0,this.uploadWaitMs=0,this.downloadWaitMs=0,this.lastGlFlushTime=0,this.warnedAboutMemory=!1,this.pendingDeletes=0,this.disposed=!1,!ke().getBool("HAS_WEBGL"))throw new Error("WebGL is not supported on this device");if(null==e){const e=vB(ke().getNumber("WEBGL_VERSION"));this.binaryCache=((t=ke().getNumber("WEBGL_VERSION"))in LL||(LL[t]={}),LL[t]),this.gpgpu=new MP(e),this.canvas=e.canvas,this.gpgpuCreatedLocally=!0}else this.gpgpu=e,this.binaryCache={},this.gpgpuCreatedLocally=!1,this.canvas=e.gl.canvas;var t;this.textureManager=new IL(this.gpgpu),this.numMBBeforeWarning=null==ke().global.screen?1024:ke().global.screen.height*ke().global.screen.width*window.devicePixelRatio*600/1024/1024,this.texData=new U(this,gs())}nextDataId(){return UL.nextDataId++}numDataIds(){return this.texData.numDataIds()-this.pendingDeletes}write(e,t,n){if((ke().getBool("WEBGL_CHECK_NUMERICAL_PROBLEMS")||ke().getBool("DEBUG"))&&this.checkNumericalProblems(e),"complex64"===n&&null!=e)throw new Error("Cannot write to a complex64 dtype. Please use tf.complex(real, imag).");const r={id:this.nextDataId()};return this.texData.set(r,{shape:t,dtype:n,values:e,usage:EB.UPLOAD,refCount:1}),r}refCount(e){return this.texData.has(e)?this.texData.get(e).refCount:0}incRef(e){this.texData.get(e).refCount++}decRef(e){this.texData.has(e)&&this.texData.get(e).refCount--}move(e,t,n,r,o){if(ke().getBool("DEBUG")&&this.checkNumericalProblems(t),"complex64"===r)throw new Error("Cannot write to a complex64 dtype. Please use tf.complex(real, imag).");this.texData.set(e,{shape:n,dtype:r,values:t,usage:EB.UPLOAD,refCount:o})}disposeIntermediateTensorInfo(e){this.disposeData(e.dataId)}readSync(e){const t=this.texData.get(e),{values:n,dtype:r,complexTensorInfos:o,slice:i,shape:a,isPacked:s}=t;if(null!=i){let t;
2t=s?new RL(a,OL):new jL(a,OL);const n=this.runWebGLProgram(t,[{dataId:e,shape:a,dtype:r}],r),o=this.readSync(n.dataId);return this.disposeIntermediateTensorInfo(n),o}if(null!=n)return this.convertAndCacheOnCPU(e);if("string"===r)return n;const l=null!=this.activeTimers;let u,p;return l&&(u=Lr()),p="complex64"===r?Pl(this.readSync(o.real.dataId),this.readSync(o.imag.dataId)):this.getValuesFromTexture(e),l&&(this.downloadWaitMs+=Lr()-u),this.convertAndCacheOnCPU(e,p)}async read(e){if(this.pendingRead.has(e)){const t=this.pendingRead.get(e);return new Promise(e=>t.push(e))}const t=this.texData.get(e),{values:n,shape:r,slice:o,dtype:i,complexTensorInfos:a,isPacked:s}=t;if(null!=o){let t;t=s?new RL(r,OL):new jL(r,OL);const n=this.runWebGLProgram(t,[{dataId:e,shape:r,dtype:i}],i),o=this.read(n.dataId);return this.disposeIntermediateTensorInfo(n),o}if(null!=n)return this.convertAndCacheOnCPU(e);if(!ke().getBool("WEBGL_DOWNLOAD_FLOAT_ENABLED")&&2===ke().getNumber("WEBGL_VERSION"))throw new Error("tensor.data() with WEBGL_DOWNLOAD_FLOAT_ENABLED=false and WEBGL_VERSION=2 not yet supported.");let l,u,p=null;if("complex64"!==i&&ke().get("WEBGL_BUFFER_SUPPORTED")){l=this.decode(e);const t=this.texData.get(l.dataId);p=this.gpgpu.createBufferFromTexture(t.texture,...FB(r))}if(this.pendingRead.set(e,[]),"complex64"!==i&&await this.gpgpu.createAndWaitForFence(),"complex64"===i){const e=await Promise.all([this.read(a.real.dataId),this.read(a.imag.dataId)]);u=Pl(e[0],e[1])}else if(null==p)u=this.getValuesFromTexture(e);else{const e=J(r);u=this.gpgpu.downloadFloat32MatrixFromBuffer(p,e)}if(null!=l&&this.disposeIntermediateTensorInfo(l),null!=p){const e=this.gpgpu.gl;AB(e,()=>e.deleteBuffer(p))}const c=this.convertAndCacheOnCPU(e,u),d=this.pendingRead.get(e);return this.pendingRead.delete(e),d.forEach(e=>e(c)),this.pendingDisposal.has(e)&&(this.pendingDisposal.delete(e),this.disposeData(e)&&gs().removeDataId(e,this),this.pendingDeletes--),c}bufferSync(e){const t=this.readSync(e.dataId);let n=t;if("string"===e.dtype)try{n=t.map(e=>Ur(e))}catch(e){throw new Error("Failed to decode encoded string bytes into utf-8")}return di(e.shape,e.dtype,n)}checkNumericalProblems(e){if(null!=e)for(let t=0;t<e.length;t++){const n=e[t];if(!CB(n)){if(ke().getBool("WEBGL_RENDER_FLOAT32_CAPABLE"))throw Error(`The value ${n} cannot be represented with your current settings. Consider enabling float32 rendering: 'tf.env().set('WEBGL_RENDER_FLOAT32_ENABLED', true);'`);throw Error(`The value ${n} cannot be represented on this device.`)}}}getValuesFromTexture(e){const{shape:t,dtype:n,isPacked:r}=this.texData.get(e),o=J(t);if(ke().getBool("WEBGL_DOWNLOAD_FLOAT_ENABLED")){const n=this.decode(e),r=this.texData.get(n.dataId),i=this.gpgpu.downloadMatrixFromPackedTexture(r.texture,...FB(t)).subarray(0,o);return this.disposeIntermediateTensorInfo(n),i}const i=ke().getBool("WEBGL_PACK")&&!0===r,a=i?HB(t):t,s=i?new kP(a):new vP(a),l=this.runWebGLProgram(s,[{shape:a,dtype:n,dataId:e}],"float32"),u=this.texData.get(l.dataId),p=this.gpgpu.downloadByteEncodedFloatMatrixFromOutputTexture(u.texture,u.texShape[0],u.texShape[1]).subarray(0,o);return this.disposeIntermediateTensorInfo(l),p}timerAvailable(){return ke().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0}async time(e){const t=this.activeTimers,n=[];let r=!1;null==this.programTimersStack?(this.programTimersStack=n,r=!0):this.activeTimers.push(n),this.activeTimers=n,e();const o=Y(this.activeTimers.map(e=>e.query)).filter(e=>null!=e),i=Y(this.activeTimers.map(e=>e.name)).filter(e=>null!=e);this.activeTimers=t,r&&(this.programTimersStack=null);const a={uploadWaitMs:this.uploadWaitMs,downloadWaitMs:this.downloadWaitMs,kernelMs:null,wallMs:null};if(ke().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0){const e=await Promise.all(o);a.kernelMs=function(e){let t=0;for(let n=0;n<e.length;n++)t+=e[n];return t}(e),a.getExtraProfileInfo=()=>e.map((e,t)=>({name:i[t],ms:e})).map(e=>`${e.name}: ${e.ms}`).join(", ")}else a.kernelMs={error:"WebGL query timers are not supported in this environment."};return this.uploadWaitMs=0,this.downloadWaitMs=0,a}memory(){return{unreliable:!1,numBytesInGPU:this.numBytesInGPU,numBytesInGPUAllocated:this.textureManager.numBytesAllocated,numBytesInGPUFree:this.textureManager.numBytesFree}}startTimer(){return ke().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?this.gpgpu.beginQuery():{startMs:Lr(),endMs:null}}endTimer(e){return ke().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?(this.gpgpu.endQuery(),e):(e.endMs=Lr(),e)}async getQueryTime(e){if(ke().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0)return this.gpgpu.waitForQueryAndGetTime(e);const t=e;return t.endMs-t.startMs}disposeData(e,t=!1){if(this.pendingDisposal.has(e))return!1;if(!this.texData.has(e))return!0;
2if(t?this.texData.get(e).refCount=0:this.texData.get(e).refCount--,!t&&this.texData.get(e).refCount>0)return!1;if(this.pendingRead.has(e))return this.pendingDisposal.add(e),this.pendingDeletes++,!1;this.releaseGPUData(e);const{complexTensorInfos:n}=this.texData.get(e);return null!=n&&(this.disposeData(n.real.dataId,t),this.disposeData(n.imag.dataId,t)),this.texData.delete(e),!0}releaseGPUData(e){const{texture:t,dtype:n,texShape:r,usage:o,isPacked:i,slice:a}=this.texData.get(e),s=a&&a.origDataId||e,l=this.dataRefCount.get(s);l>1?this.dataRefCount.set(s,l-1):(this.dataRefCount.delete(s),null!=t&&(this.numBytesInGPU-=this.computeBytes(r,n),this.textureManager.releaseTexture(t,r,o,i)));const 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=WL){return ke().getBool("WEBGL_CPU_FORWARD")&&e.every(e=>null==this.texData.get(e.dataId).texture&&J(e.shape)<t)}getGPGPUContext(){return this.gpgpu}where(e){_e("tf.where() in webgl locks the UI thread. Call tf.whereAsync() instead");const t=e.dataSync();return PL(e.shape,t)}packedUnaryOp(e,t,n){const r=new RL(e.shape,t),o=this.compileAndRun(r,[e],n);return gs().makeTensorFromDataId(o.dataId,o.shape,o.dtype)}abs(e){if(this.shouldExecuteOnCPU([e])&&"complex64"!==e.dtype){const t=lL(this.texData.get(e.dataId).values);return this.makeOutput(e.shape,e.dtype,t)}if(ke().getBool("WEBGL_PACK_UNARY_OPERATIONS"))return this.packedUnaryOp(e,CL,e.dtype);const t=new jL(e.shape,CL),n=this.compileAndRun(t,[e]);return gs().makeTensorFromDataId(n.dataId,n.shape,n.dtype)}makeTensorInfo(e,t,n){let r;if("string"===t&&null!=n&&n.length>0&&ue(n[0])){const o=n.map(e=>Wr(e));r=this.write(o,e,t)}else r=this.write(n,e,t);return this.texData.get(r).usage=null,{dataId:r,shape:e,dtype:t}}makeOutput(e,t,n){const{dataId:r}=this.makeTensorInfo(e,t,n);return gs().makeTensorFromDataId(r,e,t,this)}unpackTensor(e){const t=new BL(e.shape);return this.runWebGLProgram(t,[e],e.dtype)}packTensor(e){const t=new kL(e.shape);return this.runWebGLProgram(t,[e],e.dtype,null,!0)}packedReshape(e,t){const n=[zB(e.shape),...VB(e.shape)],r={dtype:e.dtype,shape:n,dataId:e.dataId},o=[zB(t),...VB(t)],i=new EL(o,n),a=[n],s=this.runWebGLProgram(i,[r],e.dtype,a,!0);return{dataId:s.dataId,shape:t,dtype:s.dtype}}decode(e){const t=this.texData.get(e),{isPacked:n,shape:r,dtype:o}=t,i=HB(r);let a;const s=FB(i);a=n?new SP(i):new xP(i);const l=[s];return{dtype:o,shape:r,dataId:this.runWebGLProgram(a,[{shape:i,dtype:o,dataId:e}],o,l,!0).dataId}}runWebGLProgram(e,t,n,r,o=!1){const i=this.makeTensorInfo(e.outputShape,n),a=this.texData.get(i.dataId);if(e.packedOutput&&(a.isPacked=!0),e.outPackingScheme===kB.DENSE){const t=FB(e.outputShape);a.texShape=t.map(e=>2*e)}if(null!=e.outTexUsage&&(a.usage=e.outTexUsage),0===J(i.shape))return a.values=ie(i.dtype,0),i;const s=[],l=t.map(t=>{if("complex64"===t.dtype)throw new Error("GPGPUProgram does not support complex64 input. For complex64 dtypes, please separate the program into real and imaginary parts.");let n=this.texData.get(t.dataId);if(null==n.texture){if(!e.packedInputs&&J(t.shape)<=ke().getNumber("WEBGL_SIZE_UPLOAD_UNIFORM"))return{shape:t.shape,texData:null,isUniform:!0,uniformValues:n.values};e.packedInputs&&(n.isPacked=!0,n.shape=t.shape)}else if(!!n.isPacked!=!!e.packedInputs)t=n.isPacked?this.unpackTensor(t):this.packTensor(t),s.push(t),n=this.texData.get(t.dataId);else if(n.isPacked&&!qB(n.shape,t.shape)){const e=t,r=t.shape;t.shape=n.shape,t=this.packedReshape(t,r),s.push(t),n=this.texData.get(t.dataId),e.shape=r}return this.uploadToGPU(t.dataId),{shape:t.shape,texData:n,isUniform:!1}});this.uploadToGPU(i.dataId);const u={shape:i.shape,texData:a,isUniform:!1},p=function(e,t,n){let r="";t.concat(n).forEach(t=>{const o=null!=t.texData&&null!=t.texData.slice&&t.texData.slice.flatOffset>0;if(e.enableShapeUniforms&&!t.isUniform){const i=t.texData.texShape,{useSqueezeShape:a,uniformShape:s,keptDims:l}=yP(e.packedInputs,t.shape,i);let u="",p="",c="";if(1===s.length&&e.packedInputs){const e=[Math.ceil(i[0]/2),Math.ceil(i[1]/2)];u=`${e[0]>1}_${e[1]>1}`}else if(2!==s.length||e.packedInputs){if(s.length>2&&!e.packedInputs){const e=he(s);c=`${e[0]===i[1]}_${e[e.length-1]===i[1]}`}}else p=`${s[0]>1}_${s[1]>1}`;const d=t.shape.length,h=2===s.length&&Z(t.shape,i),f=1===J(t.shape),g=Ra(t.shape,n.shape),m=!e.packedInputs&&d===n.shape.length&&Z(i,n.texData.texShape),y=e.packedInputs||s.length>2?"":`${i[0]>1}_${i[1]>1}`;r+=`${d}_${m}_${a?l:""}_${s.length}_${f}_${g}_${h}_${u}_${p}_${c}_${y}_${o}`}else{const e=t.isUniform?"uniform":t.texData.texShape;r+=`${t.shape}_${e}_${o}`}});const o=e.userCode;let i=e.constructor.name;return i+="_"+r+"_"+o+`${ke().getNumber("WEBGL_VERSION")}`,i}(e,l,u),c=this.getAndSaveBinary(p,()=>function(e,t,n,r){const o=n.map((e,n)=>{const r={logicalShape:e.shape,texShape:e.isUniform?null:e.texData.texShape,isUniform:e.isUniform,isPacked:!e.isUniform&&e.texData.isPacked,flatOffset:null};return null!=e.texData&&null!=e.texData.slice&&e.texData.slice.flatOffset>0&&(r.flatOffset=e.texData.slice.flatOffset),{name:t.variableNames[n],shapeInfo:r}}),i=o.map(e=>e.shapeInfo),a={logicalShape:r.shape,texShape:r.texData.texShape,isUniform:!1,isPacked:r.texData.isPacked,flatOffset:null},s=sP(o,a,t),l=e.createProgram(s);let u=null;const p=e.getUniformLocation(l,"NAN",!1);1===ke().getNumber("WEBGL_VERSION")&&(u=e.getUniformLocation(l,"INFINITY",!1));const c=!1,d={},h={},f={};for(let n=0;n<t.variableNames.length;n++){const r=t.variableNames[n];d[r]=e.getUniformLocation(l,r,c),d[`offset${r}`]=e.getUniformLocation(l,`offset${r}`,c),t.enableShapeUniforms&&(h[`${r}Shape`]=e.getUniformLocation(l,`${r}Shape`,c),f[`${r}TexShape`]=e.getUniformLocation(l,`${r}TexShape`,c))}let g,m,y;t.enableShapeUniforms&&(g=e.getUniformLocation(l,"outShape",c),y=e.getUniformLocation(l,"outShapeStrides",c),m=e.getUniformLocation(l,"outTexShape",c));const b=[];
2return t.customUniforms&&t.customUniforms.forEach((t,n)=>{b[n]=e.getUniformLocation(l,t.name,c)}),{program:t,source:s,webGLProgram:l,uniformLocations:d,customUniformLocations:b,inShapeInfos:i,outShapeInfo:a,infLoc:u,nanLoc:p,inShapesLocations:h,inTexShapesLocations:f,outShapeLocation:g,outShapeStridesLocation:y,outTexShapeLocation:m}}(this.gpgpu,e,l,u)),d=null!=this.activeTimers;let h;d&&(h=this.startTimer()),function(e,t,n,r,o){t.program.enableShapeUniforms||(_P(t.inShapeInfos,n),_P([t.outShapeInfo],[r]));const i=r.texData.texture,a=r.texData.texShape;r.texData.isPacked?e.setOutputPackedMatrixTexture(i,a[0],a[1]):e.setOutputMatrixTexture(i,a[0],a[1]),e.setProgram(t.webGLProgram),1===ke().getNumber("WEBGL_VERSION")&&null!==t.infLoc&&e.gl.uniform1f(t.infLoc,1/0),null!==t.nanLoc&&e.gl.uniform1f(t.nanLoc,NaN),n.forEach((n,r)=>{const o=t.program.variableNames[r],i=t.uniformLocations[o],a=t.uniformLocations[`offset${o}`],s=t.inShapesLocations[`${o}Shape`],l=t.inTexShapesLocations[`${o}TexShape`];if(s){const{uniformShape:r}=yP(t.program.packedInputs,n.shape,n.texData.texShape);switch(r.length){case 1:e.gl.uniform1iv(s,new Int32Array(r));break;case 2:e.gl.uniform2iv(s,new Int32Array(r));break;case 3:e.gl.uniform3iv(s,new Int32Array(r));break;case 4:e.gl.uniform4iv(s,new Int32Array(r))}}if(l&&e.gl.uniform2i(l,n.texData.texShape[0],n.texData.texShape[1]),null!=i)if(n.isUniform)if(J(n.shape)<2)e.gl.uniform1f(i,n.uniformValues[0]);else{let t=n.uniformValues;t instanceof Float32Array||(t=new Float32Array(t)),e.gl.uniform1fv(i,t)}else null!=n.texData.slice&&null!=a&&e.gl.uniform1i(a,n.texData.slice.flatOffset),e.setInputMatrixTexture(n.texData.texture,i,r)});const s=t.outShapeLocation;if(s)switch(r.shape.length){case 1:e.gl.uniform1iv(s,new Int32Array(r.shape));break;case 2:e.gl.uniform2iv(s,new Int32Array(r.shape));break;case 3:e.gl.uniform3iv(s,new Int32Array(r.shape));break;case 4:e.gl.uniform4iv(s,new Int32Array(r.shape))}if(t.outShapeStridesLocation){const n=he(r.shape);switch(r.shape.length){case 2:e.gl.uniform1iv(t.outShapeStridesLocation,new Int32Array(n));break;case 3:e.gl.uniform2iv(t.outShapeStridesLocation,new Int32Array(n));break;case 4:e.gl.uniform3iv(t.outShapeStridesLocation,new Int32Array(n))}}t.outTexShapeLocation&&e.gl.uniform2i(t.outTexShapeLocation,r.texData.texShape[0],r.texData.texShape[1]),t.program.customUniforms&&o&&t.program.customUniforms.forEac
2h((n,r)=>{const i=t.customUniformLocations[r],a=o[r];if("float"===n.type)e.gl.uniform1fv(i,a);else if("vec2"===n.type)e.gl.uniform2fv(i,a);else if("vec3"===n.type)e.gl.uniform3fv(i,a);else if("vec4"===n.type)e.gl.uniform4fv(i,a);else if("int"===n.type)e.gl.uniform1iv(i,a);else if("ivec2"===n.type)e.gl.uniform2iv(i,a);else if("ivec3"===n.type)e.gl.uniform3iv(i,a);else{if("ivec4"!==n.type)throw Error(`uniform type ${n.type} is not supported yet.`);e.gl.uniform4iv(i,a)}}),e.executeProgram()}(this.gpgpu,c,l,u,r),s.forEach(e=>this.disposeIntermediateTensorInfo(e)),d&&(h=this.endTimer(h),this.activeTimers.push({name:e.constructor.name,query:this.getQueryTime(h)}));const f=ke().get("WEBGL_FLUSH_THRESHOLD");if(f>0){const e=Lr();e-this.lastGlFlushTime>f&&(this.gpgpu.gl.flush(),this.lastGlFlushTime=e)}if(!ke().getBool("WEBGL_LAZILY_UNPACK")&&a.isPacked&&!1===o){const e=this.unpackTensor(i);return this.disposeIntermediateTensorInfo(i),e}return i}compileAndRun(e,t,n,r,o=!1){return n=n||t[0].dtype,this.runWebGLProgram(e,t,n,r,o)}getAndSaveBinary(e,t){return e in this.binaryCache||(this.binaryCache[e]=t()),this.binaryCache[e]}getTextureManager(){return this.textureManager}dispose(){this.disposed||(ke().getBool("IS_TEST")||Object.keys(this.binaryCache).forEach(e=>{this.gpgpu.deleteProgram(this.binaryCache[e].webGLProgram),delete this.binaryCache[e]}),this.textureManager.dispose(),null!=this.canvas&&"undefined"!=typeof HTMLCanvasElement&&this.canvas instanceof HTMLCanvasElement?this.canvas.remove():this.canvas=null,this.gpgpuCreatedLocally&&(this.gpgpu.program=null,this.gpgpu.dispose()),this.disposed=!0)}floatPrecision(){return null==this.floatPrecisionValue&&(this.floatPrecisionValue=ms(()=>{if(!ke().get("WEBGL_RENDER_FLOAT32_ENABLED")){const e=ke().getBool("DEBUG");ke().set("DEBUG",!1);const t=this.abs(Yi(1e-8)).dataSync()[0];if(ke().set("DEBUG",e),t>0)return 32}return 16})),this.floatPrecisionValue}epsilon(){return 32===this.floatPrecision()?1e-7:1e-4}uploadToGPU(e){const t=this.texData.get(e),{shape:n,dtype:r,values:o,texture:i,usage:a,isPacked:s}=t;if(null!=i)return;const l=null!=this.activeTimers;let u;l&&(u=Lr());let p=t.texShape;if(null==p&&(p=function(e,t=!1){let n=ke().getNumber("WEBGL_MAX_TEXTURE_SIZE");if(t&&(n*=2,1===(e=e.map((t,n)=>n>=e.length-2?G(e[n]):e[n])).length&&(e=[2,e[0]])),2!==e.length){const t=oe(e);e=t.newShape}let r=J(e);if(e.length<=1&&r<=n)return[1,r];if(2===e.length&&e[0]<=n&&e[1]<=n)return e;if(3===e.length&&e[0]*e[1]<=n&&e[2]<=n)return[e[0]*e[1],e[2]];if(3===e.length&&e[0]<=n&&e[1]*e[2]<=n)return[e[0],e[1]*e[2]];if(4===e.length&&e[0]*e[1]*e[2]<=n&&e[3]<=n)return[e[0]*e[1]*e[2],e[3]];if(4===e.length&&e[0]<=n&&e[1]*e[2]*e[3]<=n)return[e[0],e[1]*e[2]*e[3]];if(t){const t=zB(e);let n=2,o=2;return e.length&&([n,o]=VB(e)),r=t*(n/2)*(o/2),ee(r).map(e=>2*e)}return ee(r)}(n,s),t.texShape=p),null!=o){const e=HB(n);let i,a=p[1],c=p[0];const d=o instanceof Uint8Array;s?([a,c]=NB(p[0],p[1]),i=new IP(e,d)):i=new EP(e,d);const h=this.makeTensorInfo([c,a],r);this.texData.get(h.dataId).usage=d?EB.PIXELS:EB.UPLOAD,this.gpgpu.uploadDenseMatrixToTexture(this.getTexture(h.dataId),a,c,o);const f=[[c,a]],g=!0,m=this.runWebGLProgram(i,[h],r,f,g),y=this.texData.get(m.dataId);t.texture=y.texture,t.texShape=y.texShape,t.isPacked=y.isPacked,t.usage=y.usage,this.disposeIntermediateTensorInfo(h),this.texData.delete(m.dataId),t.values=null,l&&(this.uploadWaitMs+=Lr()-u)}else{const e=this.acquireTexture(p,a,r,s);t.texture=e}}convertAndCacheOnCPU(e,t){const n=this.texData.get(e),{dtype:r}=n;return this.releaseGPUData(e),null!=t&&(n.values=function(e,t){if("float32"===t||"complex64"===t)return e;if("int32"===t||"bool"===t){const n="int32"===t?new Int32Array(e.length):new Uint8Array(e.length);for(let t=0;t<n.length;++t)n[t]=Math.round(e[t]);return n}throw new Error(`Unknown dtype ${t}`)}(t,r)),n.values}acquireTexture(e,t,n,r){if(this.numBytesInGPU+=this.computeBytes(e,n),!this.warnedAboutMemory&&this.numBytesInGPU>1024*this.numMBBeforeWarning*1024){const e=(this.numBytesInGPU/1024/1024).toFixed(2);this.warnedAboutMemory=!0,console.warn(`High memory usage in GPU: ${e} MB, most likely due to a memory leak`)}return this.textureManager.acquireTexture(e,t,r)}computeBytes(e,t){return e[0]*e[1]*le(t)}}UL.nextDataId=0,So()&&function(e,t,n=1){_o.registerBackend(e,t,n)}("webgl",()=>new UL,2);const zL="\n  if (isnan(a)) return a;\n  if (isnan(b)) return b;\n";class VL{constructor(e,t,n){this.variableNames=["A","B"],this.outputShape=Pa(t,n),this.enableShapeUniforms=wP(this.outputShape.length),this.userCode=`\n      float binaryOperation(float a, float b) {\n        ${e}\n      }\n\n      void main() {\n        float a = getAAtOutCoords();\n        float b = getBAtOutCoords();\n        setOutput(binaryOperation(a, b));\n      }\n    `}}const HL="\n  result.r = isNaN.r > 0. ? NAN : result.r;\n  result.g = isNaN.g > 0. ? NAN : result.g;\n  result.b = isNaN.b > 0. ? NAN : result.b;\n  result.a = isNaN.a > 0. ? NAN : result.a;\n";class GL{constructor(e,t,n,r=!1){this.variableNames=["A","B"],this.supportsBroadcasting=!0,this.packedInputs=!0,this.packedOutput=!0,this.outputShape=Pa(t,n);const o=this.outputShape.length;this.enableShapeUniforms=wP(o);let i="";if(r)if(0===o||1===J(this.outputShape))i="\n          result.y = 0.;\n          result.z = 0.;\n          result.w = 0.;\n        ";else if(i=`\n          ${mP(o)} coords = getOutputCoords();\n        `,1===o)this.enableShapeUniforms?i+="\n            result.y = (coords + 1) >= outShape ? 0. : result.y;\n            result.z = 0.;\n            result.w = 0.;\n          ":i+=`\n            result.y = (coords + 1) >= ${this.outputShape[0]} ? 0. : result.y;\n            result.z = 0.;\n            result.w = 0.;\n          `;else{const e=vL("coords",o);this.enableShapeUniforms?i+=`\n            bool nextRowOutOfBounds =\n              (${e[o-2]} + 1) >= outShape[${o} - 2];\n            bool nextColOutOfBounds =\n              (${e[o-1]} + 1) >= outShape[${o} - 1];\n            result.y = nextColOutOfBounds ? 0. : result.y;\n            result.z = nextRowOutOfBounds ? 0. : result.z;\n            result.w = nextColOutOfBounds || nextRowOutOfBounds ? 0. : result.w;\n          `:i+=`\n            bool nextRowOutOfBounds =\n              (${e[o-2]} + 1) >= ${this.outputShape[o-2]};\n            bool nextColOutOfBounds =\n              (${e[o-1]} + 1) >= ${this.outputShape[o-1]};\n            result.y = nextColOutOfBounds ? 0. : result.y;\n            result.z = nextRowOutOfBounds ? 0. : result.z;\n            result.w = nextColOutOfBounds || nextRowOutOfBounds ? 0. : result.w;\n          `}this.userCode=`\n      vec4 binaryOperation(vec4 a, vec4 b) {\n        ${e}\n      }\n\n      void main() {\n        vec4 a = getAAtOutCoords();\n        vec4 b = getBAtOutCoords();\n\n        vec4 result = binaryOperation(a, b);\n        ${i}\n\n        setOutput(result);\n      }\n    `}}function qL(e){const{inputs:t,backend:n}=e,{x:r}=t;return n.incRef(r.dataId),{dataId:r.dataId,shape:r.shape,dtype:r.dtype}}const KL={kernelName:Dt,backendName:"webgl",kernelFunc:qL};function XL(e){const{inputs:t,backend:n}=e,{real:r,imag:o}=t,i=n.makeTensorInfo(r.shape,"complex64"),a=n.texData.get(i.dataId),s=qL({inputs:{x:r},backend:n}),l=qL({inputs:{x:o},backend:n});return a.complexTensorInfos={real:s,imag:l},i}const YL={kernelName:Ze,backendName:"webgl",kernelFunc:XL},JL="return (a < 0.) ? b * a : a;",ZL="\n  vec4 aLessThanZero = vec4(lessThan(a, vec4(0.)));
2\n  return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a);\n",QL={kernelName:Wt,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{alpha:i}=r,a=n.makeTensorInfo([],"float32",Br(i,"float32")),s=ke().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new GL(ZL,o.shape,a.shape):new VL(JL,o.shape,a.shape),l=n.runWebGLProgram(s,[o,a],o.dtype);return n.disposeIntermediateTensorInfo(a),l}},eW="return (a < 0.) ? b * a : a;",tW="\n  vec4 aLessThanZero = vec4(lessThan(a, vec4(0.)));\n  return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a);\n",nW={kernelName:Sn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{x:r,alpha:o}=t,i=ke().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new GL(tW,r.shape,o.shape):new VL(eW,r.shape,o.shape);return n.runWebGLProgram(i,[r,o],r.dtype)}},rW="if (isnan(x)) return x;";function oW({opSnippet:e,packedOpSnippet:t,cpuKernelImpl:n,dtype:r}){return({inputs:o,backend:i})=>{const{x:a}=o,s=i,l=r||a.dtype;if(s.shouldExecuteOnCPU([a])&&null!=n){const e=s.texData.get(a.dataId),t=n(e.values,l);return s.makeTensorInfo(a.shape,l,t)}let u;return u=ke().getBool("WEBGL_PACK_UNARY_OPERATIONS")&&null!=t?new RL(a.shape,t):new jL(a.shape,e),s.runWebGLProgram(u,[a],l)}}function iW({opSnippet:e,packedOpSnippet:t,checkOutOfBounds:n=!1,supportsComplex:r=!1,cpuKernelImpl:o,dtype:i}){return({inputs:a,backend:s})=>{const{a:l,b:u}=a,p=s;if(r&&"complex64"===l.dtype){const t=p.texData.get(l.dataId),n=p.texData.get(u.dataId),[r,o]=[[t.complexTensorInfos.real,n.complexTensorInfos.real],[t.complexTensorInfos.imag,n.complexTensorInfos.imag]].map(t=>{const[n,r]=t,o={dataId:n.dataId,dtype:n.dtype,shape:l.shape},i={dataId:r.dataId,dtype:r.dtype,shape:u.shape},a=new VL(e,l.shape,u.shape);return p.runWebGLProgram(a,[o,i],po(n.dtype,r.dtype))}),i=XL({inputs:{real:r,imag:o},backend:p});return p.disposeIntermediateTensorInfo(r),p.disposeIntermediateTensorInfo(o),i}const c=i||po(l.dtype,u.dtype);if(("string"===l.dtype||"string"===u.dtype||p.shouldExecuteOnCPU([l,u]))&&null!=o){const e=p.texData.get(l.dataId).values,t=p.texData.get(u.dataId).values,n="string"===l.dtype?su(e):e,r="string"===l.dtype?su(t):t,[i,a]=o(l.shape,u.shape,n,r,c),s=p.makeTensorInfo(a,c);return p.texData.get(s.dataId).values=i,s}let d;return d=ke().getBool("WEBGL_PACK_BINARY_OPERATIONS")&&null!=t?new GL(t,l.shape,u.shape,n):new VL(e,l.shape,u.shape),p.runWebGLProgram(d,[l,u],c)}}function aW(e,t=!1){if("linear"===e)return"return x;";if("relu"===e)return t?"\n  vec4 result = x * vec4(greaterThanEqual(x, vec4(0.0)));\n  bvec4 isNaN = isnan(x);\n\n  result.r = isNaN.r ? x.r : result.r;\n  result.g = isNaN.g ? x.g : result.g;\n  result.b = isNaN.b ? x.b : result.b;\n  result.a = isNaN.a ? x.a : result.a;\n\n  return result;\n":ML;if("elu"===e)return t?"\n  vec4 result;\n\n  result.r = (x.r >= 0.0) ? x.r : (exp(x.r) - 1.0);\n  result.g = (x.g >= 0.0) ? x.g : (exp(x.g) - 1.0);\n  result.b = (x.b >= 0.0) ? x.b : (exp(x.b) - 1.0);\n  result.a = (x.a >= 0.0) ? x.a : (exp(x.a) - 1.0);\n\n  return result;\n":"return (x >= 0.0) ? x : (exp(x) - 1.0);";if("relu6"===e)return t?"\n  vec4 result = min(x, vec4(6.)) * vec4(greaterThanEqual(x, vec4(0.0)));\n  bvec4 isNaN = isnan(x);\n\n  result.r = isNaN.r ? x.r : result.r;\n  result.g = isNaN.g ? x.g : result.g;\n  result.b = isNaN.b ? x.b : result.b;\n  result.a = isNaN.a ? x.a : result.a;\n\n  return result;\n":DL;if("prelu"===e)return t?tW:eW;if("leakyrelu"===e)return t?ZL:JL;if("sigmoid"===e)return"return 1.0 / (1.0 + exp(-1.0 * x));";throw new Error(`Activation ${e} has not been implemented for the WebGL backend.`)}class sW{constructor(e,t,n,r=!1,o=!1,i=!1,a=null,s=!1,l=!1){this.variableNames=["matrixA","matrixB"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=n,this.enableShapeUniforms=wP(this.outputShape.length);const u=r?e[1]:e[2],p=Math.ceil(u/2),c=r?"i * 2, rc.y":"rc.y, i * 2",d=o?"rc.z, i * 2":"i * 2, rc.z",h=r?["a.xxyy","a.zzww"]:["a.xxzz","a.yyww"],f=o?["b.xzxz","b.ywyw"]:["b.xyxy","b.zwzw"];let g="",m="";a&&(g=s?`vec4 activation(vec4 a) {\n          vec4 b = getPreluActivationWeightsAtOutCoords();\n          ${a}\n        }`:l?`vec4 activation(vec4 a) {\n          vec4 b = getLeakyreluAlphaAtOutCoords();\n          ${a}\n        }
2`:`vec4 activation(vec4 x) {\n          ${a}\n        }`,m="result = activation(result);");const y=i?"result += getBiasAtOutCoords();":"";i&&this.variableNames.push("bias"),s&&this.variableNames.push("preluActivationWeights"),l&&this.variableNames.push("leakyreluAlpha");let b="rc.x",$="rc.x";e[0]<t[0]?b=`int(min(float(rc.x), ${e[0]-1}.))`:t[0]<e[0]&&($=`int(min(float(rc.x), ${t[0]-1}.))`),this.userCode=`\n      ${g}\n      // Don't use uniform for sharedDimensionPacked for performance.\n      const float sharedDimension = ${p}.0;\n\n      vec4 dot2x2ARowBCol(ivec3 rc) {\n        vec4 result = vec4(0);\n        for (int i = 0; i < ${p}; i++) {\n          int batchA = ${b};\n          int batchB = ${$};\n          vec4 a = getMatrixA(batchA, ${c});\n          vec4 b = getMatrixB(batchB, ${d});\n\n          // These swizzled products need to be separately added.\n          // See: https://github.com/tensorflow/tfjs/issues/1735\n          result += (${h[0]} * ${f[0]});\n          result += (${h[1]} * ${f[1]});\n        }\n        return result;\n      }\n\n      void main() {\n        ivec3 rc = getOutputCoords();\n        vec4 result = dot2x2ARowBCol(rc);\n\n        ${y}\n\n        ${m}\n\n        setOutput(result);\n      }\n    `}}class lW{constructor(e,t,n){this.variableNames=["AReal","AImag","BReal","BImag"],this.outputShape=Pa(t,n),this.userCode=`\n      float binaryOpComplex(\n          float areal, float aimag, float breal, float bimag) {\n        ${e}\n      }\n\n      void main() {\n        float areal = getARealAtOutCoords();\n        float aimag = getAImagAtOutCoords();\n        float breal = getBRealAtOutCoords();\n        float bimag = getBImagAtOutCoords();\n        setOutput(binaryOpComplex(areal, aimag, breal, bimag));\n      }\n    `}}const uW="return a * b;";function pW(e){const{inputs:t,backend:n}=e,{a:r,b:o}=t,i=po(r.dtype,o.dtype);if("complex64"===r.dtype){const e=n.texData.get(r.dataId),t=n.texData.get(o.dataId),i=new lW("return areal * breal - aimag * bimag;",r.shape,o.shape),a=new lW("return areal * bimag + aimag * breal;",r.shape,o.shape),s=[{dataId:e.complexTensorInfos.real.dataId,dtype:e.complexTensorInfos.real.dtype,shape:r.shape},{dataId:e.complexTensorInfos.imag.dataId,dtype:e.complexTensorInfos.imag.dtype,shape:r.shape},{dataId:t.complexTensorInfos.real.dataId,dtype:t.complexTensorInfos.real.dtype,shape:o.shape},{dataId:t.complexTensorInfos.imag.dataId,dtype:t.complexTensorInfos.imag.dtype,shape:o.shape}],l=n.runWebGLProgram(i,s,"float32"),u=n.runWebGLProgram(a,s,"float32"),p=XL({inputs:{real:l,imag:u},backend:n});return n.disposeIntermediateTensorInfo(l),n.disposeIntermediateTensorInfo(u),p}if(n.shouldExecuteOnCPU([r,o])){const e=n.texData.get(r.dataId),t=n.texData.get(o.dataId),[a,s]=tL(r.shape,o.shape,e.values,t.values,i),l=n.makeTensorInfo(s,i);return n.texData.get(l.dataId).values=a,l}let a;return a=ke().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new GL(uW,r.shape,o.shape):new VL(uW,r.shape,o.shape),n.runWebGLProgram(a,[r,o],i)}const cW={kernelName:dn,backendName:"webgl",kernelFunc:pW};function dW(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{shape:i}=r,a=n,s=J(o.shape),l=function(e,t){let n=1,r=-1;for(let t=0;t<e.length;++t)if(e[t]>=0)n*=e[t];else if(-1===e[t]){if(-1!==r)throw Error(`Shapes can only have 1 implicit size. Found -1 at dim ${r} and dim ${t}`);r=t}else if(e[t]<0)throw Error(`Shapes can not be < 0. Found ${e[t]} at dim ${t}`);if(-1===r){if(t>0&&t!==n)throw Error(`Size(${t}) must match the product of shape ${e}`);return e}if(0===n)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}`);const o=e.slice();return o[r]=t/n,o}(i,s),u=J(l);q(s===u,()=>`The new shape (${l}) has ${u} elements and the old shape (${o.shape}) has ${s} elements. The new shape and old shape must have the same number of elements.`);const p=a.texData.get(o.dataId);return!p.isPacked||qB(o.shape,l)||null!==p.texture&&qB(p.shape,l)?(a.incRef(o.dataId),{dataId:o.dataId,shape:l,dtype:o.dtype}):function(e,t,n){const r=[zB(e.shape),...VB(e.shape)],o={dtype:e.dtype,shape:r,dataId:e.dataId},i=[zB(t),...VB(t)],a=new EL(i,r),s=[r],l=n.runWebGLProgram(a,[o],e.dtype,s,!0);return{dataId:l.dataId,shape:t,dtype:l.dtype}}(o,l,a)}const hW={kernelName:Fn,backendName:"webgl",kernelFunc:dW};class fW{constructor(e,t){this.variableNames=["x"];const{windowSize:n,batchSize:r,inSize:o,outSize:i}=e;this.outputShape=[r,i];const a=4*Math.floor(n/4),s=n%4;let l="sumValue += dot(values, ones);";if(null!=t){const e=1/t;l=`sumValue += dot(values * ${Q(e)?e.toPrecision(2):e}, ones);`}let u="";o%n>0&&(u=`\n        if (inIdx < 0 || inIdx >= ${o}) {\n          return 0.0;\n        }\n      `),this.userCode=`\n      const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n      float getValue(int batch, int inIdx) {\n        ${u}\n        return getX(batch, inIdx);\n      }\n\n      void main() {\n        ivec2 coords = getOutputCoords();\n        int batch = coords[0];\n        int outIdx = coords[1];\n        int inOffset = outIdx * ${n};\n\n        float sumValue = 0.0;\n\n        for (int i = 0; i < ${a}; i += 4) {\n          int inIdx = inOffset + i;\n          vec4 values = vec4(\n            getValue(batch, inIdx),\n            getValue(batch, inIdx + 1),\n            getValue(batch, inIdx + 2),\n            getValue(batch, inIdx + 3)\n          );\n\n          ${l}\n        }\n\n        int inIdx = inOffset + ${a};\n        if (${1===s}) {\n          vec4 values = vec4(getValue(batch, inIdx), 0.0, 0.0, 0.0);\n\n          ${l}\n        } else if (${2===s}) {\n          vec4 values = vec4(\n            getValue(batch, inIdx),\n            getValue(batch, inIdx + 1), 0.0, 0.0);\n\n          ${l}\n        } else if (${3===s}) {\n          vec4 values = vec4(\n            getValue(batch, inIdx),\n            getValue(batch, inIdx + 1),\n            getValue(batch, inIdx + 2), 0.0);\n\n          ${l}\n        }\n        setOutput(sumValue);\n      }\n    `}}class gW{constructor(e,t){this.variableNames=["x"];const{windowSize:n,batchSize:r,inSize:o,outSize:i}=e;this.outputShape=[r,i];let a="0.0",s="";"prod"===t?a="1.0":"min"===t?(a="1.0 / 1e-20",s="min"):"max"===t&&(
vendor: 9,933 bytes, line 2
2a="-1.0 / 1e-20",s="max");let l=`${t}(${t}(${t}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;"sum"===t?l="sumValue":"prod"===t?l="prodValue":"all"===t?l="allValue":"any"===t&&(l="anyValue");const u=4*Math.floor(n/4),p=n%4;let c=`\n      if (${"sum"===t}) {\n        sumValue += dot(values, ones);\n      } else if (${"prod"===t}) {\n        vec2 tmp = vec2(values[0], values[1]) * vec2(values[2], values[3]);\n        prodValue *= tmp[0] * tmp[1];\n      } else {\n        minMaxValue = ${s}(values, minMaxValue);\n        if (${"min"===t} || ${"max"===t}) {\n          minMaxValue = ${s}(values, minMaxValue);\n          bvec4 isNaN = isnan(values);\n          if (isNaN.r || isNaN.g || isNaN.b || isNaN.a) {\n            minMaxValue = vec4(NAN);\n          }\n        }\n      }\n    `,d="vec4";"all"===t?(a="1.0",c="\n        bool reducedAllValue = all(values);\n        float floatedReducedAllValue = float(reducedAllValue);\n        allValue = float(allValue >= 1.0 && floatedReducedAllValue >= 1.0);\n      ",d="bvec4"):"any"===t&&(a="0.0",c="\n        bool reducedAnyValue = any(values);\n        float floatedReducedAnyValue = float(reducedAnyValue);\n        anyValue = float(anyValue >= 1.0 || floatedReducedAnyValue >= 1.0);\n      ",d="bvec4");let h="";o%n>0&&(h=`\n        if (inIdx < 0 || inIdx >= ${o}) {\n          return initializationValue;\n        }\n      `),this.userCode=`\n      const float initializationValue = ${a};\n      const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n      float getValue(int batch, int inIdx) {\n        ${h}\n        return getX(batch, inIdx);\n      }\n\n      void main() {\n        ivec2 coords = getOutputCoords();\n        int batch = coords[0];\n        int outIdx = coords[1];\n        int inOffset = outIdx * ${n};\n\n        vec4 minMaxValue = vec4(${a});\n        float prodValue = 1.0;\n        float sumValue = 0.0;\n        float allValue = 1.0;\n        float anyValue = 0.0;\n\n        for (int i = 0; i < ${u}; i += 4) {\n          int inIdx = inOffset + i;\n          ${d} values = ${d}(\n            getValue(batch, inIdx),\n            getValue(batch, inIdx + 1),\n            getValue(batch, inIdx + 2),\n            getValue(batch, inIdx + 3)\n          );\n\n          ${c}\n        }\n\n        int inIdx = inOffset + ${u};\n        if (${1===p}) {\n          ${d} values = ${d}(\n            getValue(batch, inIdx),\n            initializationValue,\n            initializationValue,\n            initializationValue\n          );\n\n          ${c}\n        } else if (${2===p}) {\n          ${d} values = ${d}(\n            getValue(batch, inIdx),\n            getValue(batch, inIdx + 1),\n            initializationValue,\n            initializationValue\n          );\n\n          ${c}\n        } else if (${3===p}) {\n          ${d} values = ${d}(\n            getValue(batch, inIdx),\n            getValue(batch, inIdx + 1),\n            getValue(batch, inIdx + 2),\n            initializationValue\n          );\n\n          ${c}\n        }\n        setOutput(${l});\n      }\n    `}}function mW(e,t,n,r){const o=function(e){const t=[];for(;0===t.length||1!==t[t.length-1].outSize;){const n=t.length?t[t.length-1].outSize:e[1],r=_l(n);t.push({inSize:n,windowSize:r,outSize:Math.ceil(n/r)})}return t}(e.shape);let i=e;for(let a=0;a<o.length;a++){const{inSize:s,windowSize:l,outSize:u}=o[a];let p,c;p="mean"===n?0===a?new fW({windowSize:l,inSize:s,batchSize:e.shape[0],outSize:u},s):new fW({windowSize:l,inSize:s,batchSize:e.shape[0],outSize:u}):new gW({windowSize:l,inSize:s,batchSize:e.shape[0],outSize:u},n),c=i,i=r.runWebGLProgram(p,[i],t),c.dataId!==e.dataId&&r.disposeIntermediateTensorInfo(c)}return i}class yW{constructor(e,t){this.variableNames=["A"];const n=new Array(e.length);for(let r=0;r<n.length;r++)n[r]=e[t[r]];this.outputShape=n,this.rank=n.length;const r=mP(this.rank),o=function(e){const t=e.length;if(t>6)throw Error(`Transpose for rank ${t} is not yet supported`);const n=["resRC.x","resRC.y","resRC.z","resRC.w","resRC.u","resRC.v"],r=new Array(t);for(let t=0;t<e.length;t++)r[e[t]]=n[t];return r.join()}(t);this.userCode=`\n    void main() {\n      ${r} resRC = getOutputCoords();\n      setOutput(getA(${o}));\n    }\n    `}}class bW{constructor(e,t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0;const n=new Array(e.length);for(let r=0;r<n.length;r++)n[r]=e[t[r]];if(this.outputShape=n,this.rank=n.length,this.rank>6)throw Error(`Packed transpose for rank ${this.rank} is not yet supported.`);const r=mP(this.rank),o=SL("rc",this.rank),i=new Array(this.rank);for(let e=0;e<t.length;e++)i[t[e]]=o[e];const a=`vec2(${i.slice(-2).join()})`,s=`++${o[this.rank-1]} < ${n[this.rank-1]}`,l=`getChannel(getA(${i.join()}), ${a})`;this.userCode=`\n    void main() {\n      ${r} rc = getOutputCoords();\n      vec4 result = vec4(0.);\n      result[0] = ${l};\n      if(${s}) {\n        result[1] = ${l};\n      }\n      --${o[this.rank-1]};\n      if(++${o[this.rank-2]} < ${n[this.rank-2]}) {\n        result[2] = ${l};\n        if(${s}) {\n          result[3] = ${l};\n        }\n      }\n      setOutput(result);\n    }\n    `}}function $W(e,t,n){const r=ke().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new bW(e.shape,t):new yW(e.shape,t);return n.runWebGLProgram(r,[e],e.dtype)}function _W(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{axis:i,keepDims:a}=r;return function(e,t,n,r){const o=t,i=e.shape.length,a=re(o,e.shape);let s=a;const l=os(s,i),u=null!=l;let p=e;u&&(p=$W(e,l,r),s=as(s.length,i)),rs("sum",s,i);const[c,d]=ts(p.shape,s);let h=c;n&&(h=ns(c,a));const f=J(d),g=dW({inputs:{x:p},attrs:{shape:[J(e.shape)/f,f]},backend:r}),m=mW(g,co(e.dtype),"sum",r),y=dW({inputs:{x:m},attrs:{shape:h},backend:r});return r.disposeIntermediateTensorInfo(g),r.disposeIntermediateTensorInfo(m),u&&r.disposeIntermediateTensorInfo(p),y}(o,i,a,n)}const wW={kernelName:Kn,backendName:"webgl",kernelFunc:_W};function xW(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{perm:i}=r,a=n,s=o.shape.length,l=new Array(s);for(let e=0;e<l.length;e++)l[e]=o.shape[i[e]];let u;if(a.shouldExecuteOnCPU([o])){const e=a.texData.get(o.dataId).values,t=wL(e,o.shape,o.dtype,i,l);u=a.makeTensorInfo(l,o.dtype),a.texData.get(u.dataId).values=t}else u=$W(o,i,a);return u}const SW={kernelName:gr,backendName:"webgl",kernelFunc:xW};function vW({a:e,b:t,transposeA:n,transposeB:r,backend:o,bias:i=null,preluActivationWeights:a=null,leakyreluAlpha:s=0,activation:l=null}){const u=e.shape.length,p=t.shape.length,c=n?e.shape[u-2]:e.shape[u-1],d=r?t.shape[p-1]:t.shape[p-2],h=n?e.shape[u-1]:e.shape[u-2],f=r?t.shape[p-2]:t.shape[p-1],g=e.shape.slice(0,-2),m=t.shape.slice(0,-2),y=J(g),b=J(m);q(u>=2&&p>=2&&(y===b||1===y||1===b),()=>`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 (${g}) and (${m}).`);const $=(y>b?e.shape.slice(0,-2):t.shape.slice(0,-2)).concat([h,f]);q(c===d,()=>`Error in matMul: inner shapes (${c}) and (${d}) of Tensors with shapes ${e.shape} and ${t.shape} and transposeA=${n} and transposeB=${r} must match.`);const _=n?[y,c,h]:[y,h,c],w=r?[b,f,d]:[b,d,f],x=dW({inputs:{x:e},backend:o,attrs:{shape:_}}),S=dW({inputs:{x:t},backend:o,attrs:{shape:w}}),v=[x,S],k=Math.max(y,b),E=n?x.shape[1]:x.shape[2],I=null!=i,T=null!=a,F="leakyrelu"===l,N=null!=l?aW(l,!0):null;let j;if((1===h||1===f)&&E>1e3&&!1===(I||T||F||null!=N)){let e=x,t=S;n&&(e=xW({inputs:{x},backend:o,attrs:{perm:[0,2,1]}}),v.push(e)),r&&(t=xW({inputs:{x:S},backend:o,attrs:{perm:[0,2,1]}}),v.push(t));const i=1===f;let a=e;1!==f&&(a=dW({inputs:{x:e},backend:o,attrs:{shape:[k,E,1]}}),v.push(a));const s=1===f?2:1;let l=t;i&&(l=dW({inputs:{x:t},backend:o,attrs:{shape:[k,1,E]}}),v.push(l));const u=pW({inputs:{a,b:l},backend:o});j=_W({inputs:{x:u},backend:o,attrs:{axis:s,keepDims:!0}}),v.push(u)}else{const l=po(e.dtype,t.dtype),u=new sW(_,w,[k,h,f],n,r,I,N,T,F),p=[x,S];if(null!=i&&p.push(i),T&&p.push(a),F){const e=o.makeTensorInfo([],"float32",Br(s,"float32"));p.push(e),v.push(e)}j=o.runWebGLProgram(u,p,l)}const A=dW({inputs:{x:j},backend:o,attrs:{shape:$}});v.push(j);for(const e of v)o.disposeIntermediateTensorInfo(e);return A}const kW={kernelName:Sr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{a:o,b:i,bias:a,preluActivationWeights:s}=t,{transposeA:l,transposeB:u,activation:p,leakyreluAlpha:c}=r;return vW({a:o,b:i,transposeA:l,transposeB:u,backend:n,bias:a,preluActivationWeights:s,leakyreluAlpha:c,activation:p})}},EW="return abs(x);",IW={kernelName:Ne,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{x:r}=t;if(n.shouldExecuteOnCPU([r])&&"complex64"!==r.dtype){const e=n.texData.get(r.dataId),t=lL(e.values);return n.makeTensorInfo(r.shape,r.dtype,t)}let o;return o=ke().getBool("WEBGL_PACK_UNARY_OPERATIONS")?new RL(r.shape,EW):new jL(r.shape,EW),n.runWebGLProgram(o,[r],r.dtype)}},TW=oW({opSnippet:AL+"\n  if (abs(x) > 1.) {\n    return NAN;\n  }\n  return acos(x);\n"}),FW={kernelName:je,backendName:"webgl",kernelFunc:TW},NW=oW({opSnippet:AL+"\n  if (x < 1.0) return NAN;\nreturn log(x + sqrt(x * x - 1.0));"}),jW={kernelName:Ae,backendName:"webgl",kernelFunc:NW},AW="return a + b;",CW=iW({opSnippet:AW,packedOpSnippet:AW,supportsComplex:!0,cpuKernelImpl:DP}),MW={kernelName:Ce,backendName:"webgl",kernelFunc:CW};class DW{constructor(e,t){this.outputShape=[],this.outputShape=e,this.variableNames=t.map((e,t)=>`T${t}`);const n=[];this.variableNames.forEach(e=>{n.push(`float v${e} = get${e}AtOutCoords();`)});const r=this.variableNames.map(e=>`v${e}`).join(" + ");this.userCode=`\n      void main() {\n        ${n.join("\n        ")}\n\n        float result = ${r};\n        setOutput(result);\n      }\n    `}}class OW{constructor(e,t){this.outputShape=[],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.variableNames=t.map((e,t)=>`T${t}`);const n=[];
vendor: 4,034 bytes, line 2
2this.variableNames.forEach(e=>{n.push(`vec4 v${e} = get${e}AtOutCoords();`)});const r=this.variableNames.map(e=>`v${e}`).join(" + ");this.userCode=`\n      void main() {\n        ${n.join("\n        ")}\n\n        vec4 result = ${r};\n        setOutput(result);\n      }\n    `}}const RW={kernelName:Me,backendName:"webgl",kernelFunc:function e(t){const{inputs:n,backend:r}=t,o=n;if(1===o.length)return qL({inputs:{x:o[0]},backend:r});if(o.length>ke().get("WEBGL_MAX_TEXTURES_IN_SHADER")){const t=Math.floor(o.length/2),n=e({inputs:o.slice(0,t),backend:r}),i=e({inputs:o.slice(t),backend:r});return e({inputs:[n,i],backend:r})}const i=o.map(e=>e.dtype).reduce((e,t)=>po(e,t)),a=o.map(e=>e.shape),s=ke().getBool("WEBGL_PACK")?new OW(o[0].shape,a):new DW(o[0].shape,a);return r.runWebGLProgram(s,o,i)}},BW={kernelName:"All",backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{axis:i,keepDims:a}=r,s=o.shape.length,l=re(i,o.shape);let u=l;const p=os(u,s);let c=o;null!=p&&(c=xW({inputs:{x:o},backend:n,attrs:{perm:p}}),u=as(u.length,s)),rs("all",u,s);const[d,h]=ts(c.shape,u),f=dW({inputs:{x:c},backend:n,attrs:{shape:[-1,J(h)]}}),g=mW(f,f.dtype,"all",n);let m;return m=dW(a?{inputs:{x:g},backend:n,attrs:{shape:ns(d,l)}}:{inputs:{x:g},backend:n,attrs:{shape:d}}),n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(g),null!=p&&n.disposeIntermediateTensorInfo(c),m}},PW={kernelName:"Any",backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{axis:i,keepDims:a}=r,s=o.shape.length,l=re(i,o.shape);let u=l;const p=os(u,s);let c=o;null!=p&&(c=xW({inputs:{x:o},backend:n,attrs:{perm:p}}),u=as(u.length,s)),rs("any",u,s);const[d,h]=ts(c.shape,u),f=dW({inputs:{x:c},backend:n,attrs:{shape:[-1,J(h)]}}),g=mW(f,f.dtype,"any",n);let m;return m=dW(a?{inputs:{x:g},backend:n,attrs:{shape:ns(d,l)}}:{inputs:{x:g},backend:n,attrs:{shape:d}}),n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(g),null!=p&&n.disposeIntermediateTensorInfo(c),m}};class LW{constructor(e,t,n){this.variableNames=["A"];const{windowSize:r,batchSize:o,outSize:i}=e;n||this.variableNames.push("bestIndicesA"),this.outputShape=[o,i];const a="max"===t?">":"<",s=n?"inOffset + i;":"round(getBestIndicesA(batch, inOffset + i));";this.userCode=`\n      void main() {\n        ivec2 coords = getOutputCoords();\n        int batch = coords[0];\n        int outIdx = coords[1];\n        int inOffset = outIdx * ${r};\n\n        int bestIndex = inOffset;\n        float bestValue = getA(batch, bestIndex);\n\n        for (int i = 0; i < ${r}; i++) {\n          int inIdx = ${s};\n          float candidate = getA(batch, inIdx);\n          if (candidate ${a} bestValue) {\n            bestValue = candidate;\n            bestIndex = inIdx;\n          }\n        }\n        setOutput(float(bestIndex));\n      }\n    `}}class WW{constructor(e,t,n,r){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,q(e.length>2,()=>`Packed arg${n.charAt(0).toUpperCase()+n.slice(1)} supports only inputs with rank above 2.`);const o=e[e.length-1],i=Math.ceil(o/t);this.outputShape=e.slice(0,-1),i>1&&this.outputShape.push(i),r||this.variableNames.push("bestIndicesA");const a=this.outputShape,s=a.length,l=mP(s),u=vL("coords",s);let p,c;if(1===i){c=s+1;const e=mP(c);p=`\n        ${e} sourceLocR = ${e}(${u.join()}, 0);\n        ++${u[s-1]};\n        ${e} sourceLocG = ${e}(${u.join()}, 0);\n        ++${u[s-2]};\n        ${e} sourceLocA = ${e}(${u.join()}, 0);\n        --${u[s-1]};\n        ${e} sourceLocB = ${e}(${u.join()}, 0);\n        --${u[s-2]};`}else c=s,p=`\n        ${l} sourceLocR = coords;\n        ++${u[s-1]};\n        ${l} sourceLocG = coords;\n        ++${u[s-2]};\n        ${l} sourceLocA = coords;\n        --${u[s-1]};\n        ${l} sourceLocB = coords;\n        --${u[s-2]};`;const d=["x","y","z","w","u","v"].slice(0,c),h="."+d[c-1],f=d.map(e=>"int "+e),g=vL("sourceLocR",c-1).concat("inIdx.r"),m=vL("sourceLocG",c-1).concat("inIdx.g"),y=vL("sourceLocB",c-1).c
vendor: 4,900 bytes, line 2
2oncat("inIdx.b"),b=vL("sourceLocA",c-1).concat("inIdx.a"),$="max"===n?"greaterThan":"lessThan",_=r?"":`\n          inIdx = round(vec4(getBestIndicesAChannel(${g.join()}),\n                             getBestIndicesAChannel(${m.join()}),\n                             getBestIndicesAChannel(${y.join()}),\n                             getBestIndicesAChannel(${b.join()})));`,w=`vec4(\n            getAChannel(${g.join()}),\n            hasNextCol ? getAChannel(${m.join()}) : 0.,\n            hasNextRow ? getAChannel(${y.join()}) : 0.,\n            hasNextRow && hasNextCol ? getAChannel(${b.join()}) : 0.)`,x=r?"":`\n      float getBestIndicesAChannel(${f.join()}) {\n        return getChannel(getBestIndicesA(${d.join()}),\n                                          vec2(${d.slice(-2).join()}));\n      }`;this.userCode=`\n      float getAChannel(${f.join()}) {\n        return getChannel(getA(${d.join()}),\n                               vec2(${d.slice(-2).join()}));\n      }\n      ${x}\n      void main() {\n        ${l} coords = getOutputCoords();\n        bool hasNextCol = ${u[s-1]} < ${a[s-1]-1};\n        bool hasNextRow = ${u[s-2]} < ${a[s-2]-1};\n        ${p}\n        ivec4 srcIdx = ivec4(sourceLocR${h}, sourceLocG${h},\n          sourceLocB${h}, sourceLocA${h}) * ${t};\n        ivec4 inIdx = srcIdx;\n        vec4 bestIndex = vec4(inIdx);\n        vec4 bestValue = ${w};\n\n        for (int i = 0; i < ${t}; i++) {\n          inIdx = srcIdx;\n          ${_}\n          vec4 candidate = ${w};\n          bvec4 nan = isnan(candidate);\n          bvec4 replace = bvec4(\n            vec4(${$}(candidate, bestValue)) * (vec4(1.0) - vec4(nan)));\n\n          bestValue = vec4(replace.x  ? candidate.x : bestValue.x,\n                           replace.y  ? candidate.y : bestValue.y,\n                           replace.z  ? candidate.z : bestValue.z,\n                           replace.w  ? candidate.w : bestValue.w);\n          bestIndex = mix(bestIndex, vec4(inIdx), vec4(replace));\n          srcIdx++;\n        }\n        setOutput(bestIndex);\n      }\n    `}}function UW(e,t,n,r=null){let o=t.shape[0],i=t.shape[1];null!=r&&(o=r.shape[0],i=r.shape[1]);const a=_l(i),s={windowSize:a,inSize:i,batchSize:o,outSize:Math.ceil(i/a)},l=new LW(s,n,null==r),u=[t];null!=r&&u.push(r);const p=e.runWebGLProgram(l,u,"int32");if(1===p.shape[1])return p;const c=UW(e,t,n,p);return e.disposeIntermediateTensorInfo(p),c}function zW(e,t,n,r=null){const o=null!=r?r.shape:t.shape,i=_l(o[o.length-1]),a=new WW(o,i,n,null==r),s=null==r?[t]:[t,r],l=e.runWebGLProgram(a,s,"int32");if(l.shape.length===t.shape.length){const r=zW(e,t,n,l);return e.disposeIntermediateTensorInfo(l),r}return l}function VW(e,t,n,r){const o=[n];if(rs("arg"+r.charAt(0).toUpperCase()+r.slice(1),o,t.shape.length),!ke().getBool("WEBGL_PACK_REDUCE")||t.shape.length<=2){const n=[],i=e.texData.get(t.dataId);let a=t;null!==i&&i.isPacked&&(a=e.unpackTensor(t),n.push(a));const[s,l]=ts(a.shape,o),u=J(l),p=dW({inputs:{x:a},backend:e,attrs:{shape:[-1,u]}});n.push(p);const c=UW(e,p,r);n.push(c);const d=dW({inputs:{x:c},backend:e,attrs:{shape:s}});return n.forEach(t=>e.disposeIntermediateTensorInfo(t)),d}return zW(e,t,r)}const HW={kernelName:De,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{axis:i}=r;let a=re(i,o.shape);const s=os(a,o.shape.length);let l=o;const u=[];null!=s&&(l=xW({inputs:{x:o},backend:n,attrs:{perm:s}}),u.push(l),a=as(a.length,l.shape.length)),rs("argMax",[a[0]],l.shape.length);const p=VW(n,l,a[0],"max");return u.forEach(e=>n.disposeIntermediateTensorInfo(e)),p}},GW={kernelName:Oe,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{axis:i}=r;let a=re(i,o.shape);const s=os(a,o.shape.length);let l=o;const u=[];null!=s&&(l=xW({inputs:{x:o},backend:n,attrs:{perm:s}}),u.push(l),a=as(a.length,l.shape.length)),rs("argMin",[a[0]],l.shape.length);const p=VW(n,l,a[0],"min");return u.forEach(e=>n.disposeIntermediateTensorInfo(e)),p}},qW=oW({opSnippet:AL+"\n  if (abs(x) > 1.) {\n    return NAN;\n  }\n  return asin(x);\n"}),KW={kernelName:Re,backendName:"webgl",kernelFunc:qW},XW=oW({opSnippet:AL+"return log(x + sqrt(x * x + 1.0));"}),YW={kernelName:Be,backendName:"webgl",kernelFunc:XW},JW=oW({opSnippet:AL+"\n  return atan(x);\n"}),ZW={kernelName:Pe,backendName:"webgl",kernelFunc:JW},QW=iW({opSnippet:"\n  if (isnan(a)) return a;\n  if (isnan(b)) return b;\n\n  return atan(a, b);\n",packedOpSnippet:"\n  vec4 result = atan(a, b);\n  vec4 isNaN = min(vec4(isnan(a)) + vec4(isnan(b)), vec4(1.0));\n  \n  result.r = isNaN.r > 0. ? NAN : result.r;\n  result.g = isNaN.g > 0. ? NAN : result.g;\n  result.b = isNaN.b > 0. ? NAN : result.b;\n  result.a = isNaN.a > 0. ? NAN : result.a;\n\n  return result;\n"}),eU={kernelName:We,backendName:"webgl",kernelFunc:QW},tU=oW({opSnippet:AL+"\n  if ((x < -1.0) || (x > 1.0)) return NAN;
2\nreturn (log(1.0 + x) - log(1.0 - x)) / 2.0;"}),nU={kernelName:Le,backendName:"webgl",kernelFunc:tU};class rU{constructor(e,t,n,r=!1,o=!1){if(this.variableNames=["x"],"avg"===t&&n)throw new Error("Cannot compute positions for average pool.");const i=e.filterWidth,a=e.strideHeight,s=e.strideWidth,l=e.dilationHeight,u=e.dilationWidth,p=e.effectiveFilterHeight,c=e.effectiveFilterWidth,d=e.padInfo.top,h=e.padInfo.left;this.outputShape=e.outShape;const f="avg"===t,g=`((batch  * ${e.inHeight} + xR) * ${e.inWidth} + xC) * ${e.inChannels} + d`,m=`(xR * ${e.inWidth} + xC) * ${e.inChannels} + d`;let y="0.0";if(f||(y="-1.0 / 1e-20"),n){const t=">=";return void(this.userCode=`\n        const ivec2 strides = ivec2(${a}, ${s});\n        const ivec2 pads = ivec2(${d}, ${h});\n\n        void main() {\n          ivec4 coords = getOutputCoords();\n          int batch = coords[0];\n          int d = coords[3];\n\n          ivec2 xRCCorner = coords.yz * strides - pads;\n          int xRCorner = xRCCorner.x;\n          int xCCorner = xRCCorner.y;\n\n          // max/min x(?, ?, d) to get y(yR, yC, d).\n          // ? = to be determined\n          float minMaxValue = 0.0;\n          float minMaxValueFound = 0.0;\n          int minMaxPosition = 0;\n          float avgValue = 0.0;\n\n          for (int wR = 0; wR < ${p};\n              wR += ${l}) {\n            int xR = xRCorner + wR;\n\n            if (xR < 0 || xR >= ${e.inHeight}) {\n              continue;\n            }\n\n            for (int wC = 0; wC < ${c};\n                wC += ${u}) {\n              int xC = xCCorner + wC;\n\n              if (xC < 0 || xC >= ${e.inWidth}) {\n                continue;\n              }\n\n              float value = getX(batch, xR, xC, d);\n\n              // If a min / max value has already been found, use it. If not,\n              // use the current value.\n              float currMinMaxValue = mix(\n                  value, minMaxValue, minMaxValueFound);\n              if (value ${t} currMinMaxValue) {\n                minMaxValue = value;\n                minMaxValueFound = 1.0;\n                minMaxPosition = ${r?o?g:m:`wR * ${c} + wC`};\n              }\n            }\n          }\n          setOutput(float(minMaxPosition));\n        }\n      `)}let b=`${t}(${t}(${t}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;"avg"===t&&(b="avgValue / count");const $=4*Math.floor(i/4),_=i%4,w=`\n      if (${f}) {\n        avgValue += dot(values, ones);\n      } else {\n        minMaxValue = max(values, minMaxValue);\n      }\n    `;this.userCode=`\n      const ivec2 strides = ivec2(${a}, ${s});\n      const ivec2 pads = ivec2(${d}, ${h});\n      const float initializationValue = ${y};\n      const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n      float count = 0.0;\n\n      float getValue(int batch, int xR, int xC, int d) {\n        if (xC < 0 || xC >= ${e.inWidth}) {\n          return initializationValue;\n        }\n        count += 1.0;\n        return getX(batch, xR, xC, d);\n      }\n\n      void main() {\n        ivec4 coords = getOutputCoords();\n        int batch = coords[0];\n        int d = coords[3];\n\n        ivec2 xRCCorner = coords.yz * strides - pads;\n        int xRCorner = xRCCorner.x;\n        int xCCorner = xRCCorner.y;\n\n        // max/min x(?, ?, d) to get y(yR, yC, d).\n        // ? = to be determined\n        vec4 minMaxValue = vec4(${y});\n        float avgValue = 0.0;\n        count = 0.0;\n\n        for (int wR = 0; wR < ${p};\n            wR += ${l}) {\n          int xR = xRCorner + wR;\n\n          if (xR < 0 || xR >= ${e.inHeight}) {\n            continue;\n          }\n\n          for (int wC = 0; wC < ${$}; wC += 4) {\n            int xC = xCCorner + wC * ${u};\n\n            vec4 values = vec4(\n              getValue(batch, xR, xC, d),\n              getValue(batch, xR, xC + ${u}, d),\n              getValue(batch, xR, xC + 2 * ${u}, d),\n              getValue(batch, xR, xC + 3 * ${u}, d)\n            );\n\n            ${w}\n          }\n\n          int xC = xCCorner + ${$};\n          if (${1===_}) {\n            vec4 values = vec4(\n              getValue(batch, xR, xC, d),\n              initializationValue,\n              initializationValue,\n              initializationValue\n            );\n\n            ${w}\n          } else if (${2===_}) {\n            vec4 values = vec4(\n              getValue(batch, xR, xC, d),\n              getValue(batch, xR, xC + ${u}, d),\n              initializationValue,\n              initializationValue\n            );\n\n            ${w}\n          } else if (${3===_}) {\n            vec4 values = vec4(\n              getValue(batch, xR, xC, d),\n              getValue(batch, xR, xC + ${u}, d),\n              getValue(batch, xR, xC + 2 * ${u}, d),\n              initializationValue\n            );\n\n            ${w}\n          }\n        }\n        setOutput(${b});\n      }\n    `}}class oU{constructor(e,t,n,r=!1,o=!1){if(this.variableNames=["x"],"avg"===t&&n)throw new Error("Cannot compute positions for average pool.");const i=e.filterWidth,a=e.strideDepth,s=e.strideHeight,l=e.strideWidth,u=e.dilationDepth,p=e.dilationHeight,c=e.dilationWidth,d=e.effectiveFilterDepth,h=e.effectiveFilterHeight,f=e.effectiveFilterWidth,g=e.padInfo.front,m=e.padInfo.top,y=e.padInfo.left;this.outputShape=e.outShape;const b="avg"===t;let $="0.0";if(b||($="-1.0 / 1e-20"),n){const t=">=";return void(this.userCode=`\n        const ivec3 strides =\n            ivec3(${a}, ${s}, ${l});\n        const ivec3 pads = ivec3(${g}, ${m}, ${y});\n\n        void main() {\n          ivec5 coords = getOutputCoords();\n          int batch = coords.x;\n          int ch = coords.u;\n\n          ivec3 xCorner = ivec3(coords.y, coords.z, coords.w) * strides - pads;\n          int xDCorner = xCorner.x;\n          int xRCorner = xCorner.y;\n          int xCCorner = xCorner.z;\n\n          // max/min x(?, ?, ?, ch) to get y(yD, yR, yC, ch).\n          // ? = to be determined\n          float minMaxValue = 0.0;\n          float minMaxValueFound = 0.0;\n          int minMaxPosition = 0;\n\n          for (int wD = 0; wD < ${d};\n              wD += ${u}) {\n            int xD = xDCorner + wD;\n\n            if (xD < 0 || xD >= ${e.inDepth}) {\n              continue;\n            }\n\n            for (int wR = 0; wR < ${h};\n                wR += ${p}) {\n              int xR = xRCorner + wR;\n\n              if (xR < 0 || xR >= ${e.inHeight}) {\n                continue;\n              }\n\n              for (int wC = 0; wC < ${f};\n                  wC += ${c}) {\n                int xC = xCCorner + wC;\n\n                if (xC < 0 || xC >= ${e.inWidth}) {\n                  continue;\n                }\n\n                float value = getX(batch, xD, xR, xC, ch);\n\n                // If a min / max value has already been found, use it. If not,\n                // use the current value.\n                float currMinMaxValue = mix(\n                    value, minMaxValue, minMaxValueFound);\n                if (value ${t} currMinMaxValue) {\n                  minMaxValue = value;\n                  minMaxValueFound = 1.0;\n                  minMaxPosition = ${r?o?`(((batch * ${e.inDepth} + xD) * ${e.inHeight} + xR) * ${e.inWidth} + xC) * ${e.inChannels} + ch`:`((xD * ${e.inHeight} + xR) * ${e.inWidth} + xC) * ${e.inChannels} + ch`:`wD * ${h} * ${f} +\n                      wR * ${f} + wC`};\n                }\n              }\n            }\n          }\n          setOutput(float(minMaxPosition));\n        }\n      `)}let _=`${t}(${t}(${t}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;"avg"===t&&(_="avgValue / count");const w=4*Math.floor(i/4),x=i%4,S=`\n      if (${b}
2) {\n        avgValue += dot(values, ones);\n      } else {\n        minMaxValue = max(values, minMaxValue);\n      }\n    `;this.userCode=`\n      const ivec3 strides =\n        ivec3(${a}, ${s}, ${l});\n      const ivec3 pads = ivec3(${g}, ${m}, ${y});\n      const float initializationValue = ${$};\n      const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n      float count = 0.0;\n\n      float getValue(int batch, int xD, int xR, int xC, int ch) {\n        if (xC < 0 || xC >= ${e.inWidth}) {\n          return initializationValue;\n        }\n        count += 1.0;\n        return getX(batch, xD, xR, xC, ch);\n      }\n\n      void main() {\n        ivec5 coords = getOutputCoords();\n        int batch = coords.x;\n        int ch = coords.u;\n\n        ivec3 xCorner = ivec3(coords.y, coords.z, coords.w) * strides - pads;\n        int xDCorner = xCorner.x;\n        int xRCorner = xCorner.y;\n        int xCCorner = xCorner.z;\n\n        // max/min x(?, ?, ?, d) to get y(yD, yR, yC, ch).\n        // ? = to be determined\n        vec4 minMaxValue = vec4(${$});\n        float avgValue = 0.0;\n        count = 0.0;\n\n        for (int wD = 0; wD < ${d};\n            wD += ${u}) {\n          int xD = xDCorner + wD;\n\n          if (xD < 0 || xD >= ${e.inDepth}) {\n            continue;\n          }\n\n          for (int wR = 0; wR < ${h};\n            wR += ${p}) {\n            int xR = xRCorner + wR;\n\n            if (xR < 0 || xR >= ${e.inHeight}) {\n              continue;\n            }\n\n            for (int wC = 0; wC < ${w}; wC += 4) {\n              int xC = xCCorner + wC * ${c};\n\n              vec4 values = vec4(\n                getValue(batch, xD, xR, xC, ch),\n                getValue(batch, xD, xR, xC + ${c}, ch),\n                getValue(batch, xD, xR, xC + 2 * ${c}, ch),\n                getValue(batch, xD, xR, xC + 3 * ${c}, ch)\n              );\n\n              ${S}\n            }\n\n            int xC = xCCorner + ${w};\n            if (${1===x}) {\n              vec4 values = vec4(\n                getValue(batch, xD, xR, xC, ch),\n                initializationValue,\n                initializationValue,\n                initializationValue\n              );\n\n              ${S}\n            } else if (${2===x}) {\n              vec4 values = vec4(\n                getValue(batch, xD, xR, xC, ch),\n                getValue(batch, xD, xR, xC + ${c}, ch),\n                initializationValue,\n                initializationValue\n              );\n\n              ${S}\n            } else if (${3===x}) {\n              vec4 values = vec4(\n                getValue(batch, xD, xR, xC, ch),\n                getValue(batch, xD, xR, xC + ${c}, ch),\n                getValue(batch, xD, xR, xC + 2 * ${c}, ch),\n                initializationValue\n              );\n\n              ${S}\n            }\n          }\n          setOutput(${_});\n        }\n      }\n    `}}const iU={kernelName:Ue,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t;QB(o,"avgPool");const{filterSize:i,strides:a,pad:s,dimRoundingMode:l}=r;q(sl(a,1),()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${a} and dilations '1'`);const u=Js(o.shape,i,a,1,s,l);if(1===u.filterWidth&&1===u.filterHeight&&Z(u.inShape,u.outShape))return qL({inputs:{x:o},backend:n});const p=new rU(u,"avg",!1);return n.runWebGLProgram(p,[o],"float32")}},aU={kernelName:Ve,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{filterSize:i,strides:a,pad:s,dimRoundingMode:l,dataFormat:u}=r,p=Zs(o.shape,i,a,[1,1,1],s,l,u),c=new oU(p,"avg",!1);return n.runWebGLProgram(c,[o],"float32")}};class sU{constructor(e){this.variableNames=["dy"],this.outputShape=e.inShape;const t=e.filterHeight,n=e.filterWidth,r=e.strideHeight,o=e.strideWidth,i=e.dilationHeight,a=e.dilationWidth,s=e.effectiveFilterHeight,l=e.effectiveFilterWidth,u=s-1-e.padInfo.top,p=l-1-e.padInfo.left,c=1/(t*n);this.userCode=`\n      const ivec2 pads = ivec2(${u}, ${p});\n      const float avgMultiplier = float(${c});\n\n      void main() {\n        ivec4 coords = getOutputCoords();\n        int b = coords[0];\n        int d = coords[3];\n\n        ivec2 dyRCCorner = coords.yz - pads;\n        int dyRCorner = dyRCCorner.x;\n        int dyCCorner = dyRCCorner.y;\n\n        // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d).\n        // ? = to be determined. : = across all values in that axis.\n        float dotProd = 0.0;\n        for (int wR = 0; wR < ${s};\n            wR += ${i}) {\n          float dyR = float(dyRCorner + wR) / ${r}.0;\n\n          if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) {\n            continue;\n          }\n          int idyR = int(dyR);\n\n          for (int wC = 0; wC < ${l};\n            wC+= ${a}) {\n            float dyC = float(dyCCorner + wC) / ${o}.0;\n\n            if (dyC < 0.0 || dyC >= ${e.outWidth}.0 ||\n                fract(dyC) > 0.0) {\n              continue;\n            }\n            int idyC = int(dyC);\n\n            float dyValue = getDy(b, idyR, idyC, d);\n\n            dotProd += dyValue * avgMultiplier;\n          }\n        }\n        setOutput(dotProd);\n      }\n    `}}class lU{constructor(e){this.variableNames=["dy"],this.outputShape=e.inShape;const t=e.filterDepth,n=e.filterHeight,r=e.filterWidth,o=e.strideDepth,i=e.strideHeight,a=e.strideWidth,s=e.dilationDepth,l=e.dilationHeight,u=e.dilationWidth,p=e.effectiveFilterDepth,c=e.effectiveFilterHeight,d=e.effectiveFilterWidth,h=p-1-e.padInfo.front,f=c-1-e.padInfo.top,g=d-1-e.padInfo.left,m=1/(t*n*r);this.userCode=`\n      const ivec3 pads = ivec3(${h}, ${f}, ${g});\n      const float avgMultiplier = float(${m});\n\n      void main() {\n        ivec5 coords = getOutputCoords();\n        int batch = coords.x;\n        int ch = coords.u;\n\n        ivec3 dyCorner = ivec3(coords.y, coords.z, coords.w) - pads;\n        int dyDCorner = dyCorner.x;\n        int dyRCorner = dyCorner.y;\n        int dyCCorner = dyCorner.z;\n\n        // Convolve dy(?, ?, ?, d) with pos mask(:, :, :, ch) to get\n        // dx(x
2D, xR, xC, ch).\n        // ? = to be determined. : = across all values in that axis.\n        float dotProd = 0.0;\n\n        for (int wD = 0; wD < ${p};\n            wD += ${s}) {\n          float dyD = float(dyDCorner + wD) / ${o}.0;\n\n          if (dyD < 0.0 || dyD >= ${e.outDepth}.0 || fract(dyD) > 0.0) {\n            continue;\n          }\n          int idyD = int(dyD);\n\n          for (int wR = 0; wR < ${c};\n              wR += ${l}) {\n            float dyR = float(dyRCorner + wR) / ${i}.0;\n\n            if (dyR < 0.0 || dyR >= ${e.outHeight}.0 ||\n                fract(dyR) > 0.0) {\n              continue;\n            }\n            int idyR = int(dyR);\n\n            for (int wC = 0; wC < ${d};\n                wC += ${u}) {\n              float dyC = float(dyCCorner + wC) / ${a}.0;\n\n              if (dyC < 0.0 || dyC >= ${e.outWidth}.0 ||\n                  fract(dyC) > 0.0) {\n                continue;\n              }\n              int idyC = int(dyC);\n\n              float dyValue = getDy(batch, idyD, idyR, idyC, ch);\n\n              dotProd += dyValue * avgMultiplier;\n            }\n          }\n        }\n        setOutput(dotProd);\n      }\n    `}}const uU={kernelName:He,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{dy:o,input:i}=t,a=i,{filterSize:s,strides:l,pad:u,dimRoundingMode:p}=r,c=Zs(a.shape,s,l,[1,1,1],u,p),d=new lU(c);return n.runWebGLProgram(d,[o],a.dtype)}},pU={kernelName:ze,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{dy:o,input:i}=t,a=i;QB([o,i],"avgPoolGrad");const{filterSize:s,strides:l,pad:u}=r,p=Js(a.shape,s,l,1,u),c=new sU(p);return n.runWebGLProgram(c,[o],a.dtype)}},cU={kernelName:Ge,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{a:o,b:i}=t,{transposeA:a,transposeB:s}=r;return vW({a:o,b:i,transposeA:a,transposeB:s,backend:n})}};class dU{constructor(e,t,n,r,o,i){this.outputShape=[],this.variableNames=["x","mean","variance"],Pa(e,t),Pa(e,n);let a="0.0";null!=r&&(Pa(e,r),this.variableNames.push("offset"),a="getOffsetAtOutCoords()");let s="1.0";null!=o&&(Pa(e,o),this.variableNames.push("scale"),s="getScaleAtOutCoords()"),this.outputShape=e,this.userCode=`\n      void main() {\n        float x = getXAtOutCoords();\n        float mean = getMeanAtOutCoords();\n        float variance = getVarianceAtOutCoords();\n        float offset = ${a};\n        float scale = ${s};\n        float inv = scale * inversesqrt(variance + float(${i}));\n        setOutput(dot(vec3(x, -mean, offset), vec3(inv, inv, 1)));\n      }\n    `}}class hU{constructor(e,t,n,r,o,i){this.packedInputs=!0,this.packedOutput=!0,this.variableNames=["x","mean","variance"],Pa(e,t),Pa(e,n);let a="vec4(0.0)";null!=r&&(Pa(e,r),this.variableNames.push("offset"),a="getOffsetAtOutCoords()");let s="vec4(1.0)";null!=o&&(Pa(e,o),this.variableNames.push("scale"),s="getScaleAtOutCoords()"),this.outputShape=e,this.userCode=`\n      void main() {\n        vec4 offset = ${a};\n        vec4 scale = ${s};\n\n        vec4 x = getXAtOutCoords();\n        vec4 mean = getMeanAtOutCoords();\n        vec4 variance = getVarianceAtOutCoords();\n\n        vec4 inv = scale * inversesqrt(variance + vec4(${i}));\n\n        setOutput((x - mean) * inv + offset);\n      }\n    `}}const fU={kernelName:Nt,backendName:"webgl",kernelFunc:({inputs:e,backend:t,attrs:n})=>{const{x:r,mean:o,variance:i,offset:a,scale:s}=e;q(o.shape.length===i.shape.length,()=>"Batch normalization gradient requires mean and variance to have equal ranks."),q(null==a||o.shape.length===a.shape.length,()=>"Batch normalization gradient requires mean and offset to have equal ranks."),q(null==s||o.shape.length===s.shape.length,()=>"Batch normalization gradient requires mean and scale to have equal ranks.");let{varianceEpsilon:l}=n;null==l&&(l=.001);const u=[r,o,i];let p=null;null!=a&&(p=a.shape,u.push(a));let c=null;null!=s&&(c=s.shape,u.push(s));const d=ke().getBool("WEBGL_PACK_NORMALIZATION")?new hU(r.shape,o.shape,i.shape,p,c,l):new dU(r.shape,o.shape,i.shape,p,c,l);return t.runWebGLProgram(d,u,u[0].dtype)}};class gU{constructor(e){this.variableNames=["source"],this.outputShape=e,this.rank=e.length;const t=mP(this.rank);this.customUniforms=[{name:"start",arrayIndex:this.rank,type:"int"}];const n=function(e){if(1===e)return"sourceLoc";if(e<=6)return mU.slice(0,e).map(e=>"sourceLoc."+e).join(",");throw Error(`Slicing for rank ${e} is not yet supported`)}(this.rank);let r;r=`\n        ${t} sourceLoc;\n        ${t} coords = getOutputCoords();\n        ${e.map((e,t)=>`sourceLoc.${mU[t]} = start[${t}] + coords.${mU[t]};`).join("\n")}\n      `,this.userCode=`\n      void main() {\n        ${r}\n        setOutput(getSource(${n}));\n      }\n    `}}const mU=["x","y","z","w","u","v"];class yU{constructor(e){this.variableNames=["source"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.rank=e.length,this.customUniforms=[{name:"start",arrayIndex:this.rank,type:"int"}];const t=mP(this.rank),n=vL("coords",this.rank),r=vL("sourceLoc",this.rank),o=1===this.rank?"sourceLoc":`vec2(${r.slice(-2).join()})`,i=`getChannel(getSource(${r.join()}), ${o})`,a=`\n      result.x = ${i};\n      if (++${n[this.rank-1]} < ${e[this.rank-1]}) {\n        ++${r[this.rank-1]};\n        result.y = ${i};\n        --${r[this.rank-1]};\n      }\n    `,s=1===this.rank?"":`\n      --${n[this.rank-1]};\n      if (++${n[this.rank-2]} < ${e[this.rank-2]}) {\n        ++${r[this.rank-2]};\n        result.z = ${i};\n        if (++${n[this.rank-1]} < ${e[this.rank-1]}) {\n          ++${r[this.rank-1]};\n          result.w = ${i};\n        }\n      }
2\n    `,l=this.rank<=4?`sourceLoc = coords +\n            ${t}(${e.map((e,t)=>`start[${t}]`).join()});`:e.map((e,t)=>`${r[t]} = ${n[t]} + start[${t}];`).join("\n");this.userCode=`\n      void main() {\n        ${t} coords = getOutputCoords();\n        ${t} sourceLoc;\n        ${l}\n        vec4 result = vec4(0.);\n        ${a}\n        ${s}\n        setOutput(result);\n      }\n    `}}function bU(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{begin:i,size:a}=r,[s,l]=Ui(o,i,a);if(Ti(o,s,l),0===J(l))return n.makeTensorInfo(l,o.dtype,[]);if(n.shouldExecuteOnCPU([o])||"string"===o.dtype){const e=n.texData.get(o.dataId),t=uL(e.values,s,l,o.shape,o.dtype);return n.makeTensorInfo(l,o.dtype,t)}const{isPacked:u}=n.texData.get(o.dataId),p=Li(o.shape,s,l);if(u||!p){const e=ke().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new yU(l):new gU(l),t=[s];return n.runWebGLProgram(e,[o],o.dtype,t)}return n.uploadToGPU(o.dataId),function(e,t,n,r){const o=r.texData.get(e.dataId),i=r.makeTensorInfo(n,e.dtype),a=r.texData.get(i.dataId);Object.assign(a,o),a.refCount=1,a.shape=n,a.dtype=e.dtype;let s=Wi(t,he(e.shape));o.slice&&(s+=o.slice.flatOffset),a.slice={flatOffset:s,origDataId:o.slice&&o.slice.origDataId||e.dataId};const l=r.dataRefCount.get(a.slice.origDataId)||1;return r.dataRefCount.set(a.slice.origDataId,l+1),i}(o,s,l,n)}const $U={kernelName:Wn,backendName:"webgl",kernelFunc:bU},_U={kernelName:qe,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{blockShape:i,crops:a}=r;q(o.shape.length<=4,()=>"batchToSpaceND for rank > 4 with a WebGL backend not implemented yet");const s=i.reduce((e,t)=>e*t),l=xl(o.shape,i,s),u=Sl(l.length,i.length),p=vl(o.shape,i,s),c=kl(a,i.length),d=El(p,a,i.length),h=[],f=dW({inputs:{x:o},backend:n,attrs:{shape:l}}),g=xW({inputs:{x:f},backend:n,attrs:{perm:u}}),m=dW({inputs:{x:g},backend:n,attrs:{shape:p}}),y=bU({inputs:{x:m},backend:n,attrs:{begin:c,size:d}});return h.push(f),h.push(g),h.push(m),h.forEach(e=>n.disposeIntermediateTensorInfo(e)),y}},wU={kernelName:Ke,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o,weights:i}=t,{size:a}=r,s=n.readSync(o.dataId),l=n.readSync(i.dataId),u=OP(s,l,i.dtype,i.shape,a);return n.makeTensorInfo([a],i.dtype,u)}},xU=iW({opSnippet:"return float(a != b);",cpuKernelImpl:rL,dtype:"bool"}),SU={kernelName:fn,backendName:"webgl",kernelFunc:xU};function vU(e){const{inputs:t,backend:n}=e,{input:r}=t;return qL({inputs:{x:n.texData.get(r.dataId).complexTensorInfos.real},backend:n})}const kU={kernelName:En,backendName:"webgl",kernelFunc:vU},EU={kernelName:Xe,backendName:"webgl",kernelFunc:function e(t){const{inputs:n,backend:r,attrs:o}=t,{x:i}=n,{dtype:a}=o;if("complex64"===a){if("complex64"===i.dtype)return qL({inputs:{x:i},backend:r});const t=ta(i.shape),n=e({inputs:{x:i},backend:r,attrs:{dtype:"float32"}}),o=XL({inputs:{real:n,imag:t},backend:r});return t.dispose(),r.disposeIntermediateTensorInfo(n),o}if("complex64"===i.dtype){const t=vU({inputs:{input:i},backend:r}),n=e({inputs:{x:t},backend:r,attrs:{dtype:a}});return r.disposeIntermediateTensorInfo(t),n}if(s=i.dtype,"complex64"===(l=a)||"float32"===l&&"complex64"!==s||"int32"===l&&"float32"!==s&&"complex64"!==s||"bool"===l&&"bool"===s){const e=qL({inputs:{x:i},backend:r});return{dataId:e.dataId,shape:e.shape,dtype:a}}var s,l;if("int32"===a)return function(e,t){const n=new jL(e.shape,"return float(int(x));"),r=t.runWebGLProgram(n,[e],"int32");return{dataId:r.dataId,shape:r.shape,dtype:r.dtype}}(i,r);if("bool"===a){const e=r.makeTensorInfo([],"bool",ie("bool",1)),t=xU({inputs:{a:i,b:e},backend:r});return r.disposeIntermediateTensorInfo(e),t}throw new Error(`Error in Cast: failed to cast ${i.dtype} to ${a}`)}},IU="return ceil(x);",TU=oW({opSnippet:IU,packedOpSnippet:IU,cpuKernelImpl:BP}),FU={kernelName:Ye,backendName:"webgl",kernelFunc:TU};class NU{constructor(e){this.variableNames=["A"],this.customUniforms=[{name:"minVal",type:"float"},{name:"maxVal",type:"float"}],this.outputShape=e,this.userCode="\n\n      void main() {\n        float value = getAAtOutCoords();\n        if (isnan(value)) {\n          setOutput(value);\n          return;\n        }\n\n        setOutput(clamp(value, minVal, maxVal));\n      }\n    "}}class jU{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"minVal",type:"float"},{name:"maxVal",type:"float"}],this.outputShape=e,this.userCode="\n      void main() {\n        vec4 value = getAAtOutCoords();\n\n        if (any(isnan(value))) {\n          setOutput(value);\n          return;\n        }\n\n        setOutput(clamp(value, vec4(minVal), vec4(maxVal)));\n      }\n    "}}const AU={kernelName:Je,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{clipValueMin:i,clipValueMax:a}=r;let s;s=ke().getBool("WEBGL_PACK_CLIP")?new jU(o.shape):new NU(o.shape);const l=[[i],[a]];return n.runWebGLProgram(s,[o],o.dtype,l)}};class CU{constructor(e){this.variableNames=["real","imag"],this.outputShape=e,this.userCode="\n      void main() {\n        float re = abs(getRealAtOutCoords());\n        float im = abs(getImagAtOutCoords());\n        float mx = max(re, im);\n\n        // sadly the length function in glsl is not underflow-safe\n        // (at least not on Intel GPUs). So the safe solution is\n        // to ensure underflow-safety in all cases.\n        setOutput(\n          mx == 0.0 ? 0.0 : mx * length(vec2(1, min(re, im)/mx))\n        );\n      }\n    "}}function MU(e,t){return{dataId:t.dataId,dtype:t.dtype,shape:e.shape}}const DU={kernelName:Qe,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{x:r}=t,o=n.texData.get(r.dataId),i=new CU(r.shape),a=[MU(r,o.complexTensorInfos.real),MU(r,o.complexTensorInfos.imag)];return n.runWebGLProgram(i,a,a[0].dtype)}};class OU{constructor(e){this.outputShape=[],this.outputShape=Xs(e,1),this.variableNames=e.map((e,t)=>`T${t}`);const t=new Array(e.length-1);t[0]=e[0][1];for(let n=1;n<t.length;n++)t[n]=t[n-1]+e[n][1];const n=[`if (yC < ${t[0]}) setOutput(getT0(yR, yC));`];for(let e=1;e<t.length;e++){const r=t[e-1];n.push(`else if (yC < ${t[e]}
2) setOutput(getT${e}(yR, yC-${r}));`)}const r=t.length,o=t[t.length-1];n.push(`else setOutput(getT${r}(yR, yC-${o}));`),this.userCode=`\n      void main() {\n        ivec2 coords = getOutputCoords();\n        int yR = coords.x;\n        int yC = coords.y;\n\n        ${n.join("\n        ")}\n      }\n    `}}class RU{constructor(e,t){this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[],this.outputShape=Xs(e,t);const n=this.outputShape,r=n.length,o=mP(r),i=vL("coords",r),a=["x","y","z","w","u","v"].slice(0,r);this.variableNames=e.map((e,t)=>`T${t}`);const s=new Array(e.length-1);s[0]=e[0][t];for(let n=1;n<s.length;n++)s[n]=s[n-1]+e[n][t];const l=a[t],u=a.slice(-2),p=a.join();let c=`if (${l} < ${s[0]}) {\n        return getChannel(\n            getT0(${p}), vec2(${u.join()}));\n        }`;for(let e=1;e<s.length;e++){const t=s[e-1];c+=`\n        if (${l} < ${s[e]}  && ${l} >= ${s[e-1]}) {\n          return getChannel(\n            getT${e}(${BU(a,l,t)}),\n            vec2(${BU(u,l,t)}));\n        }`}const d=s.length,h=s[s.length-1];c+=`\n        return getChannel(\n          getT${d}(${BU(a,l,h)}),\n          vec2(${BU(u,l,h)}));`,this.userCode=`\n      float getValue(${a.map(e=>"int "+e)}) {\n        ${c}\n      }\n\n      void main() {\n        ${o} coords = getOutputCoords();\n        vec4 result = vec4(getValue(${i}), 0., 0., 0.);\n\n        ${i[r-1]} = ${i[r-1]} + 1;\n        if (${i[r-1]} < ${n[r-1]}) {\n          result.g = getValue(${i});\n        }\n\n        ${i[r-2]} = ${i[r-2]} + 1;\n        if (${i[r-2]} < ${n[r-2]}) {\n          result.a = getValue(${i});\n        }\n\n        ${i[r-1]} = ${i[r-1]} - 1;\n        if (${i[r-2]} < ${n[r-2]} &&\n            ${i[r-1]} < ${n[r-1]}) {\n          result.b = getValue(${i});\n        }\n        setOutput(result);\n      }\n    `}}function BU(e,t,n){const r=e.indexOf(t);return e.map((e,t)=>t===r?`${e} - ${n}`:e).join()}function PU(e){const{inputs:t,backend:n}=e,{input:r}=t;return qL({inputs:{x:n.texData.get(r.dataId).complexTensorInfos.imag},backend:n})}const LU={kernelName:Rt,backendName:"webgl",kernelFunc:PU};function WU(e,t,n){const r=e[0].dtype;if("complex64"===r){const r=e.map(e=>vU({inputs:{input:e},backend:n})),o=e.map(e=>PU({inputs:{input:e},backend:n})),i=WU(r,t,n),a=WU(o,t,n),s=XL({inputs:{real:i,imag:a},backend:n});return r.forEach(e=>n.disposeIntermediateTensorInfo(e)),o.forEach(e=>n.disposeIntermediateTensorInfo(e)),n.disposeIntermediateTensorInfo(i),n.disposeIntermediateTensorInfo(a),s}let o=n.shouldExecuteOnCPU(e);if("string"===r&&(o=!0),o){const o=e.map(e=>{const r=J(e.shape.slice(t));return dW({inputs:{x:e},backend:n,attrs:{shape:[-1,r]}})}),i=o.map(e=>({vals:n.readSync(e.dataId),shape:e.shape})),a=Xs(o.map(e=>e.shape),1),s=1===o[0].shape[0],l=PP(i,a,r,s),u=Xs(e.map(e=>e.shape),t),p=n.makeTensorInfo(u,r,l);return o.forEach(e=>n.disposeIntermediateTensorInfo(e)),p}if(e.length>ke().getNumber("WEBGL_MAX_TEXTURES_IN_SHADER")){const r=Math.floor(e.length/2),o=WU(e.slice(0,r),t,n),i=WU(e.slice(r),t,n),a=WU([o,i],t,n);return n.disposeIntermediateTensorInfo(o),n.disposeIntermediateTensorInfo(i),a}if(ke().getBool("WEBGL_PACK_ARRAY_OPERATIONS")&&e[0].shape.length>1){const o=new RU(e.map(e=>e.shape),t);return n.runWebGLProgram(o,e,r)}const{tensors2D:i,outShape:a}=function(e,t,n){const r=Xs(e.map(e=>e.shape),t);return{tensors2D:e.map(e=>dW({inputs:{x:e},attrs:{shape:[-1,J(e.shape.slice(t))]},backend:n})),outShape:r}}(e,t,n),s=new OU(i.map(e=>e.shape)),l=n.runWebGLProgram(s,i,r);i.forEach(e=>n.disposeIntermediateTensorInfo(e));const u=dW({inputs:{x:l},attrs:{shape:a},backend:n});return n.disposeIntermediateTensorInfo(l),u}function UU(e){const{inputs:t,backend:n,attrs:r}=e,{axis:o}=r,i=re(o,t[0].shape)[0],a=Xs(t.map(e=>e.shape),i);if(0===J(a))return n.makeTensorInfo(a,t[0].dtype,[]);const s=t.filter(e=>J(e.shape)>0);return 1===s.length?qL({inputs:{x:s[0]},backend:n}):(Ks(s.map(e=>e.shape),i),WU(s,i,n))}const zU={kernelName:et,backendName:"webgl",kernelFunc:UU};class VU{constructor(e,t=!1,n=null,r=!1,o=!1){this.variableNames=["x","W"],this.outputShape=e.outShape;const i=e.padInfo.top,a=e.padInfo.left,s=e.strideHeight,l=e.strideWidth,u=e.dilationHeight,p=e.dilationWidth,c=e.filterHeight,d=e.filterWidth,h=4*Math.floor(e.inChannels/4),f=e.inChannels%4,g="channelsLast"===e.dataFormat,m=g?1:2,y=g?2:3,b=g?3:1;let $="",_="";n&&($=r?`float activation(float a) {\n          float b = getPreluActivationWeightsAtOutCoords();\n          ${n}\n        }`:o?`float activation(float a) {\n          float b = getLeakyreluAlphaAtOutCoords();\n          ${n}\n        }`:`\n          float activation(float x) {\n            ${n}\n          }\n        `,_="result = activation(result);");const w=t?"result += getBiasAtOutCoords();":"";t&&this.variableNames.push("bias"),r&&this.variableNames.push("preluActivationWeights"),o&&this.variableNames.push("leakyreluAlpha"),this.userCode=`\n      ${$}\n\n      const ivec2 strides = ivec2(${s}, ${l});\n      const ivec2 pads = ivec2(${i}, ${a});\n\n      void main() {\n        ivec4 coords = getOutputCoords();\n        int batch = coords[0];\n        int d2 = coords[${b}];\n\n        ivec2 xRCCorner =\n            ivec2(coords[${m}], coords[${y}]) * strides - pads;\n        int xRCorner = xRCCorner.x;\n        int xCCorner = xRCCorner.y;\n\n        // Convolve x(?, ?, d1) with w(:, :, d1, d2) to get y(yR, yC, d2).\n        // ? = to be determined. : = across all values in that axis.\n        float dotProd = 0.0;\n        for (int wR = 0; wR < ${c}; wR++) {\n          int xR = xRCorner + wR * ${u};\n\n          if (xR < 0 || xR >= ${e.inHeight}) {\n            continue;\n          }\n\n          for (int wC = 0; wC < ${d}; wC++) {\n            int xC = xCCorner + wC * ${p};\n\n            if (xC < 0 || xC >= ${e.inWidth}) {\n              continue;\n            }\n\n            for (int d1 = 0; d1 < ${h}; d1 += 4) {\n              vec4 wValues = vec4(\n                getW(wR, wC, d1, d2),\n                getW(wR, wC, d1 + 1, d2),\n                getW(wR, wC, d1 + 2, d2),\n                getW(wR, wC, d1 + 3, d2)\n              );\n\n              if (${g}
2) {\n                vec4 xValues = vec4(\n                  getX(batch, xR, xC, d1),\n                  getX(batch, xR, xC, d1 + 1),\n                  getX(batch, xR, xC, d1 + 2),\n                  getX(batch, xR, xC, d1 + 3)\n                );\n                dotProd += dot(xValues, wValues);\n              } else {\n                vec4 xValues = vec4(\n                  getX(batch, d1, xR, xC),\n                  getX(batch, d1 + 1, xR, xC),\n                  getX(batch, d1 + 2, xR, xC),\n                  getX(batch, d1 + 3, xR, xC)\n                );\n                dotProd += dot(xValues, wValues);\n              }\n            }\n\n            if (${1===f}) {\n\n              if (${g}) {\n                dotProd +=\n                    getX(batch, xR, xC, ${h}) *\n                    getW(wR, wC, ${h}, d2);\n              } else {\n                dotProd +=\n                    getX(batch, ${h}, xR, xC) *\n                    getW(wR, wC, ${h}, d2);\n              }\n\n            } else if (${2===f}) {\n              vec2 wValues = vec2(\n                getW(wR, wC, ${h}, d2),\n                getW(wR, wC, ${h} + 1, d2)\n              );\n\n              if (${g}) {\n                vec2 xValues = vec2(\n                  getX(batch, xR, xC, ${h}),\n                  getX(batch, xR, xC, ${h} + 1)\n                );\n                dotProd += dot(xValues, wValues);\n              } else {\n                vec2 xValues = vec2(\n                  getX(batch, ${h}, xR, xC),\n                  getX(batch, ${h} + 1, xR, xC)\n                );\n                dotProd += dot(xValues, wValues);\n              }\n\n            } else if (${3===f}) {\n              vec3 wValues = vec3(\n                getW(wR, wC, ${h}, d2),\n                getW(wR, wC, ${h} + 1, d2),\n                getW(wR, wC, ${h} + 2, d2)\n              );\n\n              if (${g}) {\n                vec3 xValues = vec3(\n                  getX(batch, xR, xC, ${h}),\n                  getX(batch, xR, xC, ${h} + 1),\n                  getX(batch, xR, xC, ${h} + 2)\n                );\n                dotProd += dot(xValues, wValues);\n              } else {\n                vec3 xValues = vec3(\n                  getX(batch, ${h}, xR, xC),\n                  getX(batch, ${h} + 1, xR, xC),\n                  getX(batch, ${h} + 2, xR, xC)\n                );\n                dotProd += dot(xValues, wValues);\n              }\n\n            }\n          }\n        }\n\n        float result = dotProd;\n        ${w}\n        ${_}\n        setOutput(result);\n      }\n    `}}class HU{constructor(e){this.variableNames=["x","W"],this.outputShape=e.outShape;const t=e.padInfo.front,n=e.padInfo.top,r=e.padInfo.left,o=e.strideDepth,i=e.strideHeight,a=e.strideWidth,s=e.dilationDepth,l=e.dilationHeight,u=e.dilationWidth,p=e.filterDepth,c=e.filterHeight,d=e.filterWidth,h=4*Math.floor(e.inChannels/4),f=e.inChannels%4;this.userCode=`\n      const ivec3 strides = ivec3(${o}, ${i}, ${a});\n      const ivec3 pads = ivec3(${t}, ${n}, ${r});\n\n      void main() {\n        ivec5 coords = getOutputCoords();\n        int batch = coords.x;\n        int d2 = coords.u;\n\n        ivec3 xFRCCorner = ivec3(coords.y, coords.z, coords.w) * strides - pads;\n        int xFCorner = xFRCCorner.x;\n        int xRCorner = xFRCCorner.y;\n        int xCCorner = xFRCCorner.z;\n\n        // Convolve x(?, ?, ?, d1) with w(:, :, :, d1, d2) to get\n        // y(yF, yR, yC, d2). ? = to be determined. : = across all\n        // values in that axis.\n        float dotProd = 0.0;\n        for (int wF = 0; wF < ${p}; wF++) {\n          int xF = xFCorner + wF * ${s};\n\n          if (xF < 0 || xF >= ${e.inDepth}) {\n            continue;\n          }\n\n          for (int wR = 0; wR < ${c}; wR++) {\n            int xR = xRCorner + wR * ${l};\n\n            if (xR < 0 || xR >= ${e.inHeight}) {\n              continue;\n            }\n\n            for (int wC = 0; wC < ${d}; wC++) {\n              int xC = xCCorner + wC * ${u};\n\n              if (xC < 0 || xC >= ${e.inWidth}) {\n                continue;\n              }\n\n              for (int d1 = 0; d1 < ${h}; d1 += 4) {\n                vec4 xValues = vec4(\n                  getX(batch, xF, xR, xC, d1),\n                  getX(batch, xF, xR, xC, d1 + 1),\n                  getX(batch, xF, xR, xC, d1 + 2),\n                  getX(batch, xF, xR, xC, d1 + 3)\n                );\n                vec4 wValues = vec4(\n                  getW(wF, wR, wC, d1, d2),\n                  getW(wF, wR, wC, d1 + 1, d2),\n                  getW(wF, wR, wC, d1 + 2, d2),\n                  getW(wF, wR, wC, d1 + 3, d2)\n                );\n\n                dotProd += dot(xValues, wValues);\n              }\n\n              if (${1===f}) {\n                dotProd +=\n                  getX(batch, xF, xR, xC, ${h}) *\n                  getW(wF, wR, wC, ${h}, d2);\n              } else if (${2===f}) {\n                vec2 xValues = vec2(\n                  getX(batch, xF, xR, xC, ${h}),\n                  getX(batch, xF, xR, xC, ${h} + 1)\n                );\n                vec2 wValues = vec2(\n                  getW(wF, wR, wC, ${h}, d2),\n                  getW(wF, wR, wC, ${h} + 1, d2)\n                );\n                dotProd += dot(xValues, wValues);\n              } else if (${3===f}) {\n                vec3 xValues = vec3(\n                  getX(batch, xF, xR, xC, ${h}),\n                  getX(batch, xF, xR, xC, ${h} + 1),\n                  getX(batch, xF, xR, xC, ${h} + 2)\n                );\n                vec3 wValues = vec3(\n                  getW(wF, wR, wC, ${h}, d2),\n                  getW(wF, wR, wC, ${h} + 1, d2),\n                  getW(wF, wR, wC, ${h} + 2, d2)\n                );\n                dotProd += dot(xValues, wValues);\n              }\n            }\n          }\n        }\n        setOutput(dotProd);\n      }\n    `}}class GU{constructor(e,t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"inputShape",type:"ivec3"},{name:"pad",type:"ivec2"},{name:"stride",type:"ivec2"},{name:"dilation",type:"ivec2"},{name:"inChannels",type:"int"},{name:"itemsPerBlockRow",type:"int"},{name:"outWidth",type:"int"}],this.outputShape=e,this.enableShapeUniforms=wP(this.outputShape.length);const{dataFormat:n}=t,r=tP(),o="channelsLast"===n,i=o?0:1,a=o?1:2,s=this.enableShapeUniforms?"if(blockIndex < outShape[1] && pos < outShape[0]) {":`if(blockIndex < ${e[1]} && pos < ${e[0]}) {`;let l="";for(let e=0;e<=1;e++)for(let t=0;t<=1;t++)l+=`\n          blockIndex = rc.y + ${t};\n          pos = rc.x + ${e};\n\n          ${s}\n            offsetY = int(blockIndex / outWidth) * stride[0] - pad[0];\n            d0 = offsetY + dilation[0] * (pos / itemsPerBlockRow);\n\n            if(d0 < inputShape[${i}] && d0 >= 0) {\n              // Use custom imod instead mod. On Intel GPU, mod may generate\n              // unexpected value.\n              // https://github.com/tensorflow/tfjs/issues/5447\n              offsetX = imod(blockIndex, outWidth) * stride[1] - pad[
21];\n              d1 = offsetX + dilation[1] * (imod(pos, itemsPerBlockRow) /\n                  inChannels);\n\n              if(d1 < inputShape[${a}] && d1 >= 0) {\n\n                ch = imod(pos, inChannels);\n\n                if (${o}) {\n                  innerDims = vec2(d1, ch);\n                  result[${2*e+t}] = getChannel(\n                    getA(d0, int(innerDims.x),\n                    int(innerDims.y)), innerDims);\n                } else {\n                  innerDims = vec2(d0, d1);\n                  result[${2*e+t}] = getChannel(\n                    getA(ch, int(innerDims.x),\n                    int(innerDims.y)), innerDims);\n                }\n              }\n            }\n          }\n        `;this.userCode=`\n      void main() {\n        ivec2 rc = getOutputCoords();\n\n        vec4 result = vec4(0);\n\n        int blockIndex, pos, offsetY, d0, offsetX, d1, ch;\n        vec2 innerDims;\n\n        ${l}\n\n        ${r.output} = result;\n      }\n    `}}function qU({x:e,filter:t,convInfo:n,backend:r,bias:o=null,preluActivationWeights:i=null,leakyreluAlpha:a=0,activation:s=null}){const l=e.shape,u=r.texData.get(e.dataId),p=n.inChannels,c=l[0]*l[1]*l[2],d=n.outChannels,h="channelsLast"===n.dataFormat,f=!1,g=!1;let m;const y=[];if((1!==c&&1!==d||!(p>1e3))&&u.isPacked&&h&&null!=u.texture&&l[2]%2!=0&&Z(u.shape.slice(-3),l.slice(-3))){const p=l[0]*l[1]*(l[2]+1),c={dataId:e.dataId,shape:[1,p,n.inChannels],dtype:e.dtype},d=u.shape;u.shape=u.shape.slice(),u.shape[u.shape.length-2]++,q(qB(u.shape,c.shape),()=>`packed reshape ${u.shape} to ${c.shape} isn't free`);const h=dW({inputs:{x:t},backend:r,attrs:{shape:[1,n.inChannels,n.outChannels]}});y.push(h);const b=vW({a:c,b:h,backend:r,transposeA:f,transposeB:g,bias:o,activation:s,preluActivationWeights:i,leakyreluAlpha:a}),$=r.texData.get(b.dataId);q($.isPacked,()=>"batchMatMul result is expected to be packed"),u.shape=d,$.shape=n.outShape,m=qL({inputs:{x:b},backend:r}),m.shape=n.outShape,y.push(b)}else{const u=dW({inputs:{x:e},backend:r,attrs:{shape:[1,h?l[0]*l[1]*l[2]:l[0]*l[2]*l[3],n.inChannels]}}),p=dW({inputs:{x:t},backend:r,attrs:{shape:[1,n.inChannels,n.outChannels]}}),c=vW({a:u,b:p,transposeA:f,transposeB:g,backend:r,bias:o,activation:s,preluActivationWeights:i,leakyreluAlpha:a});m=dW({inputs:{x:c},backend:r,attrs:{shape:n.outShape}}),y.push(u),y.push(p),y.push(c)}for(const e of y)r.disposeIntermediateTensorInfo(e);return m}function KU({x:e,filter:t,convInfo:n,backend:r,bias:o=null,preluActivationWeights:i=null,leakyreluAlpha:a=0,activation:s=null}){const{filterWidth:l,filterHeight:u,inChannels:p,outWidth:c,outHeight:d,dataFormat:h}=n,f="channelsLast"===h,g=l*u*p,m=d*c,y=[g,m],b=[],$=dW({inputs:{x:e},backend:r,attrs:{shape:e.shape.slice(1)}}),_=dW({inputs:{x:t},backend:r,attrs:{shape:[1,g,J(t.shape)/g]}});b.push($),b.push(_);const w=new GU(y,n),x=[$.shape,[n.padInfo.top,n.padInfo.left],[n.strideHeight,n.strideWidth],[n.dilationHeight,n.dilationWidth],[n.inChannels],[n.filterWidth*n.inChannels],[n.outWidth]],S=r.runWebGLProgram(w,[$],"float32",x),v=dW({inputs:{x:S},backend:r,attrs:{shape:[1,y[0],y[1]]}});b.push(S),b.push(v);const k=null!=o,E=null!=i,I="leakyrelu"===s,T=s?aW(s,!0):null,F=new sW(v.shape,_.shape,[1,m,n.outChannels],!0,!1,k,T,E,I),N=[v,_];if(o&&N.push(o),E&&N.push(i),I){const e=r.makeTensorInfo([],"float32",Br(a,"float32"));N.push(e),b.push(e)}const j=r.runWebGLProgram(F,N,"float32"),A=dW({inputs:{x:j},backend:r,attrs:{shape:f?[1,d,c,n.outChannels]:[1,n.outChannels,d,c]}});b.push(j);for(const e of b)r.disposeIntermediateTensorInfo(e);return A}const XU={kernelName:tt,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o,filter:i}=t,{strides:a,pad:s,dataFormat:l,dilations:u,dimRoundingMode:p}=r,c=ll(l),d=Qs(o.shape,i.shape,a,u,s,p,!1,c);let h;if(1!==d.filterHeight||1!==d.filterWidth||1!==d.dilationHeight||1!==d.dilationWidth||1!==d.strideHeight||1!==d.strideWidth||"SAME"!==d.padInfo.type&&"VALID"!==d.padInfo.type)if(ke().getBool("WEBGL_CONV_IM2COL")&&1===o.shape[0])h=KU({x:o,filter:i,convInfo:d,backend:n});else{const e=new VU(d);h=n.runWebGLProgram(e,[o,i],"float32")}else h=qU({x:o,filter:i,convInfo:d,backend:n});
vendor: 5,591 bytes, line 2
2const f=dW({inputs:{x:h},backend:n,attrs:{shape:d.outShape}});return n.disposeIntermediateTensorInfo(h),f}};class YU{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;const t=e.strideHeight,n=e.strideWidth,r=e.padInfo.top,o=e.padInfo.left,i="channelsLast"===e.dataFormat;this.userCode=`\n      void main() {\n        ivec4 coords = getOutputCoords();\n        int wR = coords.x;\n        int wC = coords.y;\n        int d1 = coords.z;\n        int d2 = coords.w;\n\n        // Convolve x(?, ?, d1) with dy(:, :, d2) to get dw(wR, wC, d1, d2).\n        // ? = to be determined. : = across all values in that axis.\n        float dotProd = 0.0;\n\n        for (int b = 0; b < ${e.batchSize}; b++) {\n          for (int yR = 0; yR < ${e.outHeight}; yR++) {\n            int xR = wR + yR * ${t} - ${r};\n\n            if (xR < 0 || xR >= ${e.inHeight}) {\n              continue;\n            }\n\n            for (int yC = 0; yC < ${e.outWidth}; yC++) {\n              int xC = wC + yC * ${n} - ${o};\n\n              if (xC < 0 || xC >= ${e.inWidth}) {\n                continue;\n              }\n\n              if (${i}) {\n                float dyValue = getDy(b, yR, yC, d2);\n                float xValue = getX(b, xR, xC, d1);\n                dotProd += (xValue * dyValue);\n              } else {\n                float dyValue = getDy(b, d2, yR, yC);\n                float xValue = getX(b, d1, xR, xC);\n                dotProd += (xValue * dyValue);\n              }\n\n            }\n          }\n        }\n        setOutput(dotProd);\n      }\n    `}}class JU{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;const t=e.filterHeight,n=e.filterWidth,r=e.strideHeight,o=e.strideWidth,i="channelsLast"===e.dataFormat,a=t-1-e.padInfo.top,s=n-1-e.padInfo.left,l=i?1:2,u=i?2:3,p=i?3:1;this.userCode=`\n      const ivec2 pads = ivec2(${a}, ${s});\n\n      void main() {\n        ivec4 coords = getOutputCoords();\n        int batch = coords[0];\n        int d1 = coords[${p}];\n\n        ivec2 dyCorner = ivec2(coords[${l}], coords[${u}]) - pads;\n        int dyRCorner = dyCorner.x;\n        int dyCCorner = dyCorner.y;\n\n        // Convolve dy(?, ?, d2) with w(:, :, d1, d2) to compute dx(xR, xC, d1).\n        // ? = to be determined. : = across all values in that axis.\n        float dotProd = 0.0;\n        for (int wR = 0; wR < ${t}; wR++) {\n          float dyR = float(dyRCorner + wR) / ${r}.0;\n\n          if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) {\n            continue;\n          }\n          int idyR = int(dyR);\n\n          int wRPerm = ${t} - 1 - wR;\n\n          for (int wC = 0; wC < ${n}; wC++) {\n            float dyC = float(dyCCorner + wC) / ${o}.0;\n\n            if (dyC < 0.0 || dyC >= ${e.outWidth}.0 ||\n                fract(dyC) > 0.0) {\n              continue;\n            }\n            int idyC = int(dyC);\n\n            int wCPerm = ${n} - 1 - wC;\n\n            for (int d2 = 0; d2 < ${e.outChannels}; d2++) {\n\n              if (${i}) {\n                float xValue = getDy(batch, idyR, idyC, d2);\n                float wValue = getW(wRPerm, wCPerm, d1, d2);\n                dotProd += xValue * wValue;\n              } else {\n                float xValue = getDy(batch, d2, idyR, idyC);\n                float wValue = getW(wRPerm, wCPerm, d1, d2);\n                dotProd += xValue * wValue;\n              }\n\n            }\n          }\n        }\n        setOutput(dotProd);\n      }\n    `}}class ZU{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;const t=e.strideDepth,n=e.strideHeight,r=e.strideWidth,o=e.padInfo.front,i=e.padInfo.top,a=e.padInfo.left;this.userCode=`\n      void main() {\n        ivec5 coords = getOutputCoords();\n        int wF = coords.x;\n        int wR = coords.y;\n        int wC = coords.z;\n        int d1 = coords.w;\n        int d2 = coords.u;\n\n        float dotProd = 0.0;\n\n        for (int b = 0; b < ${e.batchSize}; b++) {\n          for (int yF = 0; yF < ${e.outDepth}; yF++) {\n            int xF = wF + yF * ${t} - ${o};\n\n            if (xF < 0 || xF >= ${e.inDepth}) {\n              continue;\n            }\n\n            for (int yR = 0; yR < ${e.outHeight}; yR++) {\n              int xR = wR + yR * ${n} - ${i};\n\n              if (xR < 0 || xR >= ${e.inHeight}) {\n                continue;\n              }\n\n              for (int yC = 0; yC < ${e.outWidth}; yC++) {\n                int xC = wC + yC * ${r} - ${a};\n\n                if (xC < 0 || xC >= ${e.inWidth}) {\n                  continue;\n                }\n\n                float dyValue = getDy(b, yF, yR, yC, d2);\n                float xValue = getX(b, xF, xR, xC, d1);\n                dotProd += (xValue * dyValue);\n              }\n            }\n          }\n        }\n        setOutput(dotProd);\n      }\n    `}}class QU{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;const t=e.filterDepth,n=e.filterHeight,r=e.filterWidth,o=e.strideDepth,i=e.strideHeight,a=e.strideWidth,s=t-1-e.padInfo.front,l=n-1-e.padInfo.top,u=r-1-e.padInfo.left;this.userCode=`\n      const ivec3 pads = ivec3(${s}, ${l}, ${u});\n\n      void main() {\n        ivec5 coords = getOutputCoords();\n        int batch = coords.x;\n        int d1 = coords.u;\n\n\n        ivec3 dyCorner = ivec3(coords.y, coords.z, coords.w) - pads;\n        int dyFCorner = dyCorner.x;\n        int dyRCorner = dyCorner.y;\n        int dyCCorner = dyCorner.z;\n\n        float dotProd = 0.0;\n        for (int wF = 0; wF < ${t};
2 wF++) {\n          float dyF = float(dyFCorner + wF) / ${o}.0;\n\n          if (dyF < 0.0 || dyF >= ${e.outDepth}.0 || fract(dyF) > 0.0) {\n            continue;\n          }\n          int idyF = int(dyF);\n\n          int wFPerm = ${t} - 1 - wF;\n\n          for (int wR = 0; wR < ${n}; wR++) {\n            float dyR = float(dyRCorner + wR) / ${i}.0;\n\n            if (dyR < 0.0 || dyR >= ${e.outHeight}.0 ||\n              fract(dyR) > 0.0) {\n              continue;\n            }\n            int idyR = int(dyR);\n\n            int wRPerm = ${n} - 1 - wR;\n\n            for (int wC = 0; wC < ${r}; wC++) {\n              float dyC = float(dyCCorner + wC) / ${a}.0;\n\n              if (dyC < 0.0 || dyC >= ${e.outWidth}.0 ||\n                  fract(dyC) > 0.0) {\n                continue;\n              }\n              int idyC = int(dyC);\n\n              int wCPerm = ${r} - 1 - wC;\n\n              for (int d2 = 0; d2 < ${e.outChannels}; d2++) {\n                float xValue = getDy(batch, idyF, idyR, idyC, d2);\n                float wValue = getW(wFPerm, wRPerm, wCPerm, d1, d2);\n                dotProd += xValue * wValue;\n              }\n            }\n          }\n        }\n        setOutput(dotProd);\n      }\n    `}}const ez={kernelName:nt,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o,dy:i}=t,{strides:a,pad:s,dataFormat:l,dimRoundingMode:u,filterShape:p}=r,c=ll(l),d=Qs(o.shape,p,a,1,s,u,!1,c),h=new YU(d);return n.runWebGLProgram(h,[o,i],"float32")}},tz={kernelName:rt,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{dy:o,filter:i}=t,{inputShape:a,strides:s,pad:l,dataFormat:u,dimRoundingMode:p}=r,c=ll(u),d=Qs(a,i.shape,s,1,l,p,!1,c),h=new JU(d);return n.runWebGLProgram(h,[o,i],"float32")}},nz={kernelName:ot,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o,filter:i}=t,{strides:a,pad:s,dilations:l}=r,u=el(o.shape,i.shape,a,l,s),p=new HU(u);return n.runWebGLProgram(p,[o,i],"float32")}},rz={kernelName:it,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o,dy:i}=t,{strides:a,pad:s,filterShape:l}=r,u=el(o.shape,l,a,1,s),p=new ZU(u);return n.runWebGLProgram(p,[o,i],"float32")}},oz={kernelName:at,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{dy:o,filter:i}
vendor: 5,904 bytes, line 2
2=t,{pad:a,strides:s,inputShape:l}=r,u=el(l,i.shape,s,1,a),p=new QU(u);return n.runWebGLProgram(p,[o,i],"float32")}},iz=oW({opSnippet:rW+"\n  return cos(x);\n"}),az={kernelName:st,backendName:"webgl",kernelFunc:iz},sz=oW({opSnippet:"\n  float e2x = exp(-x);\n  return (e2x + 1.0 / e2x) / 2.0;\n"}),lz={kernelName:lt,backendName:"webgl",kernelFunc:sz};class uz{constructor(e,t,n,r,o){this.variableNames=["Image","Boxes","BoxInd"],this.outputShape=[];const[i,a,s,l]=e,[u]=t,[p,c]=n;this.outputShape=[u,p,c,l];const d="bilinear"===r?1:0,[h,f]=[a-1+".0",s-1+".0"],[g,m,y]=p>1?[""+(a-1)/(p-1),"(y2-y1) * height_ratio",`y1*${h} + float(y)*(height_scale)`]:["0.0","0.0",`0.5 * (y1+y2) * ${h}`],[b,$,_]=c>1?[""+(s-1)/(c-1),"(x2-x1) * width_ratio",`x1*${f} + float(x)*(width_scale)`]:["0.0","0.0",`0.5 * (x1+x2) * ${f}`];this.userCode=`\n      const float height_ratio = float(${g});\n      const float width_ratio = float(${b});\n      void main() {\n        ivec4 coords = getOutputCoords();\n        int b = coords[0];\n        int y = coords[1];\n        int x = coords[2];\n        int d = coords[3];\n\n        // get box vals\n        float y1 = getBoxes(b,0);\n        float x1 = getBoxes(b,1);\n        float y2 = getBoxes(b,2);\n        float x2 = getBoxes(b,3);\n\n        // get image in batch index\n        int bInd = round(getBoxInd(b));\n        if(bInd < 0 || bInd >= ${i}) {\n          return;\n        }\n\n        float height_scale = ${m};\n        float width_scale = ${$};\n\n        float in_y = ${y};\n        if( in_y < 0.0 || in_y > ${h} ) {\n          setOutput(float(${o}));\n          return;\n        }\n        float in_x = ${_};\n        if( in_x < 0.0 || in_x > ${f} ) {\n          setOutput(float(${o}));\n          return;\n        }\n\n        vec2 sourceFracIndexCR = vec2(in_x,in_y);\n        if(${d} == 1) {\n          // Compute the four integer indices.\n          ivec2 sourceFloorCR = ivec2(sourceFracIndexCR);\n          ivec2 sourceCeilCR = ivec2(ceil(sourceFracIndexCR));\n\n          float topLeft = getImage(b, sourceFloorCR.y, sourceFloorCR.x, d);\n          float bottomLeft = getImage(b, sourceCeilCR.y, sourceFloorCR.x, d);\n          float topRight = getImage(b, sourceFloorCR.y, sourceCeilCR.x, d);\n          float bottomRight = getImage(b, sourceCeilCR.y, sourceCeilCR.x, d);\n\n          vec2 fracCR = sourceFracIndexCR - vec2(sourceFloorCR);\n\n          float top = topLeft + (topRight - topLeft) * fracCR.x;\n          float bottom = bottomLeft + (bottomRight - bottomLeft) * fracCR.x;\n          float newValue = top + (bottom - top) * fracCR.y;\n          setOutput(newValue);\n        } else {\n          // Compute the coordinators of nearest neighbor point.\n          ivec2 sourceNearestCR = ivec2(floor(\n            sourceFracIndexCR + vec2(0.5,0.5)));\n          float newValue = getImage(b, sourceNearestCR.y, sourceNearestCR.x, d);\n          setOutput(newValue);\n        }\n      }\n    `}}const pz={kernelName:pt,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n,attrs:r}=e,{image:o,boxes:i,boxInd:a}=t,{cropSize:s,method:l,extrapolationValue:u}=r,p=new uz(o.shape,i.shape,s,l,u);return n.runWebGLProgram(p,[o,i,a],"float32")}};class cz{constructor(e,t,n){this.variableNames=["x"],this.customUniforms=[{name:"index",type:"float"}],this.outputShape=e;const r=e.length,o=t?"0.0":`getX(${dz(r,"coords")})`,i=e[e.length-1];let a="",s="";t?(a=n?"end != "+(i-1):"end != 0",s=n?"end + 1":"end - 1"):(a=n?`end + pow2 < ${i}`:"end >= pow2",s=n?"end + pow2":"end - pow2"),this.userCode=`\n      void main() {\n        ${mP(r)} coords = getOutputCoords();\n        int end = ${hz(r,"coords")};\n        float val = ${o};\n        int pow2 = int(pow(2.0, index));\n        if (${a}) {\n          int idx = ${s};\n          ${hz(r,"coords")} = idx;\n          val += getX(${dz(r,"coords")});\n        }\n        setOutput(val);\n      }\n    `}}function dz(e,t){if(1===e)return`${t}`;if(2===e)return`${t}.x, ${t}.y`;if(3===e)return`${t}.x, ${t}.y, ${t}.z`;if(4===e)return`${t}.x, ${t}.y, ${t}.z, ${t}.w`;throw Error(`Cumulative sum for rank ${e} is not yet supported`)}function hz(e,t){if(1===e)return`${t}`;if(2===e)return`${t}.y`;if(3===e)return`${t}.z`;if(4===e)return`${t}.w`;throw Error(`Cumulative sum for rank ${e} is not yet supported`)}const fz={kernelName:ut,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{axis:i,exclusive:a,reverse:s}=r,l=o.shape.length,u=os([i],l);let p=o;null!=u&&(p=xW({inputs:{x:o},backend:n,attrs:{perm:u}}));const c=as(1,l)[0];if(c!==l-1)throw new Error(`WebGL cumsum shader expects an inner-most axis=${o.shape.length-1} but got axis=${i}`);const d=p.shape[c];let h=qL({inputs:{x:p},backend:n});for(let e=0;e<=Math.ceil(Math.log2(d))-1;e++){const t=new cz(p.shape,!1,s),r=[[e]],o=h;h=n.runWebGLProgram(t,[h],h.dtype,r),n.disposeIntermediateTensorInfo(o)}if(a){const e=new cz(p.shape,a,s),t=h;h=n.runWebGLProgram(e,[h],h.dtype),n.disposeIntermediateTensorInfo(t)}if(null!=u){const e=xW({inputs:{x:h},backend:n,attrs:{perm:is(u)}});return n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(p),e}return h}},gz={kernelName:ct,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o,weights:i}=t,{size:a,binaryOutput:s}=r;if(1===o.shape.length){const e=n.readSync(o.dataId),t=n.readSync(i.dataId),r=OP(e,t,i.dtype,i.shape,a);return n.makeTensorInfo([a],i.dtype,r)}if(2===o.shape.length){const e=n.bufferSync(o),t=n.bufferSync(i),r=RP(e,t,a,s);return n.makeTensorInfo(r.shape,i.dtype,r.values)}throw new Error(`Error in denseBincount: input must be at most rank 2, but got rank${o.shape.length}.`)}};class mz{constructor(e,t,n){this.variableNames=["x"],this.outputShape=[],this.outputShape=e,this.blockSize=t,this.dataFormat=n,this.userCode=`\n    void main() {\n      ivec4 coords = getOutputCoords();\n      int b = coords[0];
2\n      int h = ${this.getHeightCoordString()};\n      int w = ${this.getWidthCoordString()};\n      int d = ${this.getDepthCoordString()};\n\n      int in_h = h / ${t};\n      int offset_h = imod(h, ${t});\n      int in_w = w / ${t};\n      int offset_w = imod(w, ${t});\n      int offset_d = (offset_h * ${t} + offset_w) *\n        ${this.getOutputDepthSize()};\n      int in_d = d + offset_d;\n\n      float result = ${this.getInputSamplingString()};\n      setOutput(result);\n    }\n  `}getHeightCoordString(){return"NHWC"===this.dataFormat?"coords[1]":"coords[2]"}getWidthCoordString(){return"NHWC"===this.dataFormat?"coords[2]":"coords[3]"}getDepthCoordString(){return"NHWC"===this.dataFormat?"coords[3]":"coords[1]"}getOutputDepthSize(){return"NHWC"===this.dataFormat?this.outputShape[3]:this.outputShape[1]}getInputSamplingString(){return"NHWC"===this.dataFormat?"getX(b, in_h, in_w, in_d)":"getX(b, in_d, in_h, in_w)"}}const yz={kernelName:dt,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{blockSize:i,dataFormat:a}=r;q(i>1,()=>`blockSize should be > 1 for depthToSpace, but was: ${i}`);const s=o.shape[0],l="NHWC"===a?o.shape[1]:o.shape[2],u="NHWC"===a?o.shape[2]:o.shape[3],p="NHWC"===a?o.shape[3]:o.shape[1],c=l*i,d=u*i,h=p/(i*i),f=new mz("NHWC"===a?[s,c,d,h]:[s,h,c,d],i,a);return n.runWebGLProgram(f,[o],o.dtype)}};class bz{constructor(e,t=!1,n=null,r=!1,o=!1){this.variableNames=["x","W"],this.customUniforms=[{name:"pads",type:"ivec2"},{name:"strides",type:"ivec2"},{name:"dilations",type:"ivec2"},{name:"inDims",type:"ivec2"}],this.outputShape=e.outShape,this.enableShapeUniforms=wP(this.outputShape.length);const i=e.filterHeight,a=e.filterWidth,s=e.outChannels/e.inChannels;let l="",u="";n&&(l=r?`float activation(float a) {\n          float b = getPreluActivationWeightsAtOutCoords();\n          ${n}\n        }`:o?`float activation(float a) {\n          float b = getLeakyreluAlphaAtOutCoords();\n          ${n}\n        }`:`\n          float activation(float x) {\n            ${n}\n          }\n        `,u="result = activation(result);");const p=t?"result += getBiasAtOutCoords();":"";t&&this.variableNames.push("bias"),r&&this.variableNames.push("preluActivationWeights"),o&&this.variableNames.push("leakyreluAlpha"),this.userCode=`\n      ${l}\n\n      void main() {\n        ivec4 coords = getOutputCoords();\n        int batch = coords.x;\n        ivec2 xRCCorner = coords.yz * strides - pads;\n        int d2 = coords.w;\n        int d1 = d2 / ${s};\n        int q = d2 - d1 * ${s};\n\n        int xRCorner = xRCCorner.x;\n        int xCCorner = xRCCorner.y;\n\n        // Convolve x(?, ?, d1) with w(:, :, d1, q) to get y(yR, yC, d2).\n        // ? = to be determined. : = across all values in that axis.\n        float dotProd = 0.0;\n        // TO DO(dsmilkov): Flatten the two for loops and vec4 the operations.\n        for (int wR = 0; wR < ${i}; wR++) {\n          int xR = xRCorner + wR * dilations[0];\n\n          if (xR < 0 || xR >= inDims[0]) {\n            continue;\n          }\n\n          for (int wC = 0; wC < ${a}; wC++) {\n            int xC = xCCorner + wC * dilations[1];\n\n            if (xC < 0 || xC >= inDims[1]) {\n              continue;\n            }\n\n            float xVal = getX(batch, xR, xC, d1);\n            float wVal = getW(wR, wC, d1, q);\n            dotProd += xVal * wVal;\n          }\n        }\n\n        float result = dotProd;\n        ${p}\n        ${u}\n        setOutput(result);\n      }\n    `}}class $z{constructor(e,t=!1,n=null,r=!1,o=!1){this.variableNames=["x","W"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"pads",type:"ivec2"},{name:"strides",type:"ivec2"},{name:"dilations",type:"ivec2"},{name:"inDims",type:"ivec2"}],this.outputShape=e.outShape,this.enableShapeUniforms=wP(this.outputShape.length);const i=e.outChannels/e.inChannels,a=e.padInfo.left,s=e.strideWidth,l=e.dilationWidth,u=e.filterHeight,p=e.filterWidth,c=p;let d="\n      int xR; int xC; int xCOffset;\n      vec4 wTexel; vec4 previous; vec4 final;";for(let e=0;e<p;e++)d+=`\n          vec4 xTexelC${2*e};\n          int xTexelC${2*e}Ready;\n          vec4 xTexelC${2*e+1};\n          int xTexelC${2*e+1}Ready;\n          vec4 xC${e};`;for(let e=0;e<u;e++){for(let e=0;e<p;e++)d+=`\n          xTexelC${2*e} = vec4(0.0);\n          xTexelC${2*e}Ready = 0;\n          xTexelC${2*e+1} = vec4(0.0);\n          xTexelC${2*e+1}Ready = 0;\n          xC${e} = vec4(0.0);`;d+=`\n        xR = xRCorner + ${e} * dilations[0];\n        if (xR >=0 && xR < inDims[0]) {\n      `;
vendor: 6,213 bytes, line 2
2for(let t=0;t<(c+1)/2;t++){const n=2*t;if(d+=`\n          xC = xCCorner + ${n*l};\n          `,1===s){if(n<p&&(a%2==1?(d+=`\n                xCOffset = xC + 1;\n                if (xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${n}Ready == 0) {\n                  xTexelC${n} = getX(batch, xR, xCOffset, d1);\n\n                  // Need to manually clear unused channels in case\n                  // we're reading from recycled texture.\n                  if (xCOffset + 1 >= inDims[1]) {\n                    xTexelC${n}.zw = vec2(0.0);\n                  }\n                  xTexelC${n}Ready = 1;\n                }\n              `,d+=1===l&&n>0?`\n                xC${n} = vec4(xTexelC${n-2}.zw, xTexelC${n}.xy);\n                `:`\n                  xCOffset = xC + 1 - 2;\n\n                  if (xCOffset >= 0 && xCOffset < inDims[1]) {\n                    previous = getX(batch, xR, xCOffset, d1);\n\n                    // Need to manually clear unused channels in case\n                    // we're reading from recycled texture.\n                    if (xCOffset + 1 >= inDims[1]) {\n                      previous.zw = vec2(0.0);\n                    }\n\n                    xC${n} = vec4(previous.zw, xTexelC${n}.xy);\n                  } else {\n                    xC${n} = vec4(0.0, 0.0, xTexelC${n}.xy);\n                  }\n                  `):d+=`\n                if (xC >= 0 && xC < inDims[1] && xTexelC${n}Ready == 0) {\n                  xTexelC${n} = getX(batch, xR, xC, d1);\n                  if (xC + 1 >= inDims[1]) {\n                    xTexelC${n}.zw = vec2(0.0);\n                  }\n                  xTexelC${n}Ready = 1;\n                }\n\n                xC${n} = xTexelC${n};\n                `,n+1<p)){const e=a%2==0?G(l):l;l%2==0&&a%2==1||l%2!=0&&a%2!=1?(d+=`\n                  xCOffset = xC + imod(pads[1], 2) + ${e};\n\n                  if (xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${n+1}Ready == 0) {\n                    xTexelC${n+1} = getX(batch, xR, xCOffset, d1);\n\n                    // Need to manually clear unused channels in case\n                    // we're reading from recycled texture.\n                    if (xCOffset + 1 >= inDims[1]) {\n                      xTexelC${n+1}.zw = vec2(0.0);\n                    }\n                    xTexelC${n+1}Ready = 1;\n                  }\n                  `,l>1&&(d+=`\n                    xCOffset -= 2;\n                    if (xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${n}Ready == 0) {\n                      xTexelC${n} = getX(batch, xR, xCOffset, d1);\n                      xTexelC${n}Ready = 1;\n                    }\n                    `),d+=`\n                  xC${n+1} = vec4(xTexelC${n}.zw, xTexelC${n+1}.xy);\n                  `):d+=1===e?`\n                    xC${n+1} = xTexelC${n};\n                    `:`\n                    xCOffset = xC + ${e};\n\n                    if (xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${n+1}Ready == 0) {\n                      xTexelC${n+1} = getX(batch, xR, xCOffset, d1);\n                      if (xCOffset + 1 >= inDims[1]) {\n                        xTexelC${n+1}.zw = vec2(0.0);\n                      }\n                      xTexelC${n+1}Ready = 1;\n                    }\n\n                    xC${n+1} = xTexelC${n+1};\n                    `}}else n<p&&(a%2==1?(d+=`\n                xCOffset = xC + 1 - strides[1];\n                if(xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${n}Ready == 0) {\n                  xTexelC${n} = getX(batch, xR, xCOffset, d1);\n                  // Need to manually clear unused channels in case\n                  // we're reading from recycled texture.\n                  if (xCOffset + 1 >= inDims[1]) {\n                    xTexelC${n}.zw = vec2(0.0);\n                  }\n                  xTexelC${n}Ready = 1;\n                }\n\n                if(xC + 1 >= 0 && xC + 1 < inDims[1] && xTexelC${n+1}Ready == 0) {\n                  xTexelC${n+1} = getX(batch, xR, xC + 1, d1);\n                  // Need to manually clear unused channels in case\n                  // we're reading from recycled texture.\n                  if (xC + 2 >= inDims[1]) {\n                    xTexelC${n+1}.zw = vec2(0.0);\n                  }\n                  xTexelC${n+1}Ready = 1;\n                }\n\n                xC${n} = vec4(xTexelC${n}.zw, xTexelC${n+1}.zw);\n              `,n+1<p&&(d+=`\n                  final = vec4(0.0);\n                  xCOffset = xC + 1 + strides[1];\n                  if(xCOffset >= 0 && xCOffset < inDims[1]) {\n                    final = getX(batch, xR, xCOffset, d1);\n                  }\n                  xC${n+1} = vec4(xTexelC${n+1}.xy, final.xy);\n                `)):(d+=`\n                if(xC >= 0 && xC < inDims[1] && xTexelC${n}Ready == 0) {\n                  xTexelC${n} = getX(batch, xR, xC, d1);\n                  if (xC + 1 >= inDims[1]) {\n                    xTexelC${n}.zw = vec2(0.0);\n                  }\n                  xTexelC${n}Ready = 1;\n                }\n\n                xCOffset = xC + strides[1];\n                if(xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${n+1}Ready == 0) {\n                  xTexelC${n+1} = getX(batch, xR, xCOffset, d1);\n                  if (xCOffset + 1 >= inDims[1]) {\n                    xTexelC${n+1}.zw = vec2(0.);\n                  }\n                  xTexelC${n+1}Ready = 1;\n                }\n\n                xC${n} = vec4(\n                  xTexelC${n}.xy, xTexelC${n+1}.xy);\n              `,n+1<p&&(d+=`\n                  xC${n+1} = vec4(xTexelC${n}.zw, xTexelC${n+1}.zw);\n                `)));n<p&&(d+=`\n            wTexel = getW(${e}, ${n}, d1, q);\n            dotProd += xC${n} * vec4(wTexel.xz, wTexel.xz);\n          `,n+1<p&&(d+=`\n              wTexel = getW(${e}, ${n+1}, d1, q);\n              dotProd += xC${n+1} * vec4(wTexel.xz, wTexel.xz);\n            `))}d+="\n        }\n      "}let h="",f="";n&&(h=r?`vec4 activation(vec4 a) {\n          vec4 b = getPreluActivationWeightsAtOutCoords();\n          ${n}\n        }`:o?`vec4 activation(vec4 a) {\n          vec4 b = getLeakyreluAlphaAtOutCoords();\n          ${n}\n        }
2`:`vec4 activation(vec4 x) {\n          ${n}\n        }`,f="result = activation(result);");const g=t?"result += getBiasAtOutCoords();":"";t&&this.variableNames.push("bias"),r&&this.variableNames.push("preluActivationWeights"),o&&this.variableNames.push("leakyreluAlpha"),this.userCode=`\n      ${h}\n\n      void main() {\n        ivec4 coords = getOutputCoords();\n        int batch = coords.x;\n        ivec2 xRCCorner = coords.yz * strides - pads;\n        int d2 = coords.w;\n        int d1 = d2 / ${i};\n        int q = d2 - d1 * ${i};\n        int xRCorner = xRCCorner.x;\n        int xCCorner = xRCCorner.y;\n\n        //intialize dotProd with a small epsilon seems to reduce GPU accuracy loss.\n        vec4 dotProd = vec4(0.000000000000001);\n\n        ${d}\n\n        vec4 result = dotProd - vec4(0.000000000000001);\n        ${g}\n        ${f}\n        setOutput(result);\n      }\n    `}}const _z={kernelName:ht,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o,filter:i}=t,{strides:a,pad:s,dilations:l,dimRoundingMode:u}=r;let p=l;null==p&&(p=[1,1]),q(sl(a,p),()=>`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${a} and dilations '${p}'`);const c=Qs(o.shape,i.shape,a,p,s,u,!0);let d;
vendor: 5,009 bytes, line 2
2d=ke().getBool("WEBGL_PACK_DEPTHWISECONV")&&c.strideWidth<=2&&c.outChannels/c.inChannels===1?new $z(c):new bz(c);const h=[[c.padInfo.top,c.padInfo.left],[c.strideHeight,c.strideWidth],[c.dilationHeight,c.dilationWidth],[c.inHeight,c.inWidth]];return n.runWebGLProgram(d,[o,i],"float32",h)}};class wz{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;const t=e.strideHeight,n=e.strideWidth,r=e.padInfo.top,o=e.padInfo.left,i=e.outChannels/e.inChannels;this.userCode=`\n      void main() {\n        ivec4 coords = getOutputCoords();\n        int wR = coords.x;\n        int wC = coords.y;\n        int d1 = coords.z;\n        int dm = coords.w;\n        int d2 = d1 * ${i} + dm;\n\n        float dotProd = 0.0;\n\n        // TO DO: Vec4 over the batch size\n        for (int b = 0; b < ${e.batchSize}; b++) {\n          for (int yR = 0; yR < ${e.outHeight}; yR++) {\n            int xR = wR + yR * ${t} - ${r};\n\n            if (xR < 0 || xR >= ${e.inHeight}) {\n              continue;\n            }\n\n            for (int yC = 0; yC < ${e.outWidth}; yC++) {\n              int xC = wC + yC * ${n} - ${o};\n\n              if (xC < 0 || xC >= ${e.inWidth}) {\n                continue;\n              }\n\n              float dyValue = getDy(b, yR, yC, d2);\n              float xValue = getX(b, xR, xC, d1);\n              dotProd += (xValue * dyValue);\n            }\n          }\n        }\n        setOutput(dotProd);\n      }\n    `}}class xz{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;const t=e.filterHeight,n=e.filterWidth,r=e.strideHeight,o=e.strideWidth,i=t-1-e.padInfo.top,a=n-1-e.padInfo.left,s=e.outChannels/e.inChannels;this.userCode=`\n      const ivec2 pads = ivec2(${i}, ${a});\n\n      void main() {\n        ivec4 coords = getOutputCoords();\n        int batch = coords[0];\n        int d1 = coords[3];\n        ivec2 dyCorner = coords.yz - pads;\n        int dyRCorner = dyCorner.x;\n        int dyCCorner = dyCorner.y;\n\n        float dotProd = 0.0;\n\n        for (int wR = 0; wR < ${t}; wR++) {\n          float dyR = float(dyRCorner + wR) / ${r}.0;\n\n          if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) {\n            continue;\n          }\n          int idyR = int(dyR);\n\n          int wRPerm = ${t} - 1 - wR;\n\n          for (int wC = 0; wC < ${n}; wC++) {\n            float dyC = float(dyCCorner + wC) / ${o}.0;\n\n            if (dyC < 0.0 || dyC >= ${e.outWidth}.0 ||\n                fract(dyC) > 0.0) {\n              continue;\n            }\n            int idyC = int(dyC);\n\n            int wCPerm = ${n} - 1 - wC;\n\n            // TO DO: Vec4 over the channelMul\n            for (int dm = 0; dm < ${s}; dm++) {\n              int d2 = d1 * ${s} + dm;\n              float xValue = getDy(batch, idyR, idyC, d2);\n              float wValue = getW(wRPerm, wCPerm, d1, dm);\n              dotProd += xValue * wValue;\n            }\n          }\n        }\n        setOutput(dotProd);\n      }\n    `}}const Sz={kernelName:ft,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o,dy:i}=t,{strides:a,dilations:s,pad:l,dimRoundingMode:u,filterShape:p}=r,c=Qs(o.shape,p,a,s,l,u,!0),d=new wz(c);return n.runWebGLProgram(d,[o,i],"float32")}},vz={kernelName:gt,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{dy:o,filter:i}=t,{strides:a,dilations:s,pad:l,dimRoundingMode:u,inputShape:p}=r,c=Qs(p,i.shape,a,s,l,u,!0),d=new xz(c);return n.runWebGLProgram(d,[o,i],"float32")}};class kz{constructor(e){this.variableNames=["X"],this.outputShape=[e,e],this.userCode="\n      void main() {\n          ivec2 coords = getOutputCoords();\n          float val = coords[0] == coords[1] ? getX(coords[0]) : 0.0;\n          setOutput(val);\n      }\n    "}}const Ez={kernelName:"Diag",backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{x:r}=t,o=[...r.shape,...r.shape],i=J(r.shape),a=dW({inputs:{x:r},backend:n,attrs:{shape:[i]}}),s=new kz(i),l=n.runWebGLProgram(s,[a],a.dtype),u=dW({inputs:{x:l},backend:n,attrs:{shape:o}});return n.disposeIntermediateTensorInfo(a),n.disposeIntermediateTensorInfo(l),u}};class Iz{constructor(e){this.variableNames=["x","W"],this.outputShape=e.outShape;const{inHeight:t,inWidth:n,padInfo:r,strideHeight:o,strideWidth:i,filterHeight:a,filterWidth:s,dilationHeight:l,dilationWidth:u}=e,{top:p,left:c}=r;this.userCode=`\n      const ivec2 strides = ivec2(${o}, ${i});\n      const ivec2 pads = ivec2(${p}, ${c});\n      const float neg_infinity = -3.4e38;\n\n      void main() {\n        ivec4 coords = getOutputCoords();\n        int batch = coords.x;\n        int d1 = coords.w;\n        ivec2 outTopLeftCorner =\n            coords.yz * strides - pads;\n        int hBeg = outTopLeftCorner.x;\n        int wBeg = outTopLeftCorner.y;\n\n        float curVal = neg_infinity;\n        for (int h = 0; h < ${a}; h++) {\n          int hIn = hBeg + h * ${l};\n\n          if (hIn >= 0 && hIn < ${t}
2) {\n            for (int w = 0; w < ${s}; w++) {\n              int wIn = wBeg + w * ${u};\n\n              if (wIn >= 0 && wIn < ${n}) {\n                float xVal = getX(batch, hIn, wIn, d1);\n                float wVal = getW(h, w, d1);\n\n                float val = xVal + wVal;\n                if (val > curVal) {\n                  curVal = val;\n                }\n              }\n            }\n          }\n        }\n\n        float result = curVal;\n        setOutput(result);\n      }\n    `}}const Tz={kernelName:mt,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o,filter:i}=t,{strides:a,pad:s,dilations:l}=r,u=Ys(o.shape,i.shape,a,s,"NHWC",l);let p;const c=new Iz(u);p=n.runWebGLProgram(c,[o,i],"float32");const d=dW({inputs:{x:p},backend:n,attrs:{shape:u.outShape}});return n.disposeIntermediateTensorInfo(p),d}},Fz={kernelName:bt,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{equation:o}=r,i=t,{allDims:a,summedDims:s,idDims:l}=Jl(o,i.length);Ql(a.length,l,i);const{path:u,steps:p}=eu(s,l),c=p.length;let d=null,h=a.length;const f=[];for(let e=0;e<c;++e){for(const t of p[e]){const{permutationIndices:e,expandDims:r}=Zl(h,l[t]);let o;tu(e)?o=i[t]:(o=xW({inputs:{x:i[t]},backend:n,attrs:{perm:e}}
vendor: 4,300 bytes, line 2
2),f.push(o));const a=o.shape.slice();for(let e=0;e<r.length;++e)a.splice(r[e],0,1);Z(o.shape,a)||(o=dW({inputs:{x:o},backend:n,attrs:{shape:a}}),f.push(o)),null===d?d=o:(d=pW({inputs:{a:o,b:d},backend:n}),f.push(d))}e<c-1&&(u[e]>=0&&(d=_W({inputs:{x:d},backend:n,attrs:{axis:u[e]-(a.length-h),keepDims:!1}}),f.push(d)),h--)}for(const e of f)e!==d&&n.disposeIntermediateTensorInfo(e);return d}},Nz=oW({opSnippet:"return (x >= 0.0) ? x : (exp(x) - 1.0);",packedOpSnippet:"\n  vec4 result;\n\n  result.r = (x.r >= 0.0) ? x.r : (exp(x.r) - 1.0);\n  result.g = (x.g >= 0.0) ? x.g : (exp(x.g) - 1.0);\n  result.b = (x.b >= 0.0) ? x.b : (exp(x.b) - 1.0);\n  result.a = (x.a >= 0.0) ? x.a : (exp(x.a) - 1.0);\n\n  return result;\n"}),jz={kernelName:$t,backendName:"webgl",kernelFunc:Nz},Az={kernelName:_t,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n}=e,{dy:r,y:o}=t,i=ke().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new GL("\n  vec4 bGTEZero = vec4(greaterThanEqual(b, vec4(0.)));\n  return (bGTEZero * a) + ((vec4(1.0) - bGTEZero) * (a * (b + vec4(1.0))));\n",r.shape,o.shape):new VL("return (b >= 1.0) ? a : a * (b + 1.0);",r.shape,o.shape);return n.runWebGLProgram(i,[r,o],r.dtype)}},Cz=iW({opSnippet:"return float(a == b);",packedOpSnippet:"\n  return vec4(equal(a, b));\n",dtype:"bool",cpuKernelImpl:LP}),Mz={kernelName:xt,backendName:"webgl",kernelFunc:Cz},Dz=oW({opSnippet:`\n  // Error function is calculated approximately with elementary function.\n  // See "Handbook of Mathematical Functions with Formulas,\n  // Graphs, and Mathematical Tables", Abramowitz and Stegun.\n  float p = ${Cl};\n  float a1 = ${Ml};\n  float a2 = ${Dl};\n  float a3 = ${Ol};\n  float a4 = ${Rl};\n  float a5 = ${Bl};\n\n  float sign = sign(x);\n  x = abs(x);\n  float t = 1.0 / (1.0 + p * x);\n  return sign * (1.0 - (((((a5*t + a4)*t) + a3)*t + a2)*t + a1)*t*exp(-x*x));\n`}),Oz={kernelName:wt,backendName:"webgl",kernelFunc:Dz},Rz="return exp(x);",Bz=oW({opSnippet:Rz,packedOpSnippet:Rz,cpuKernelImpl:WP}),Pz={kernelName:St,backendName:"webgl",kernelFunc:Bz};function Lz(e){const{inputs:t,attrs:n,backend:r}=e,{dim:o}=n,{input:i}=t,a=i.shape.length,s=i.shape.slice();let l=o;return o<0&&(q(-(a+1)<=o,()=>`Axis must be in the interval [${-(a+1)}, ${a}]`),l=a+o+1),s.splice(l,0,1),dW({inputs:{x:i},backend:r,attrs:{shape:s}})}const Wz={kernelName:vt,backendName:"webgl",kernelFunc:Lz},Uz="return exp(x) - 1.0;",zz=oW({opSnippet:Uz,packedOpSnippet:Uz,cpuKernelImpl:UP}),Vz={kernelName:kt,backendName:"webgl",kernelFunc:zz};class Hz{constructor(e,t,n){this.variableNames=["real","imag"];const r=t[1];this.outputShape=t;const o=n?`2.0 * ${Math.PI}`:`-2.0 * ${Math.PI}`,i=n?`${r}.0`:"1.0";let a;if("real"===e)a="return real * expR - imag * expI;";else{if("imag"!==e)throw new Error(`FFT component must be either "real" or "imag", got ${e}.`);a="return real * expI + imag * expR;"}this.userCode=`\n      const float exponentMultiplier = ${o};\n\n      float unaryOpComplex(float real, float expR, float imag, float expI) {\n        ${a}\n      }\n\n      float mulMatDFT(int batch, int index) {\n        float indexRatio = float(index) / float(${r});\n        float exponentMultiplierTimesIndexRatio =\n            exponentMultiplier * indexRatio;\n\n        float result = 0.0;\n\n        for (int i = 0; i < ${r}; i++) {\n          // x = (-2|2 * PI / N) * index * i;\n          float x = exponentMultiplierTimesIndexRatio * float(i);\n          float expR = cos(x);\n          float expI = sin(x);\n          float real = getReal(batch, i);\n          float imag = getImag(batch, i);\n\n          result +=\n              unaryOpComplex(real, expR, imag, expI) / ${i};\n        }\n\n        return result;\n      }\n\n      void main() {\n        ivec2 coords = getOutputCoords();\n        setOutput(mulMatDFT(coords[0], coords[1]));\n      }\n    `}}function Gz(e,t,n){const r=n.texData.get(e.dataId),o=J(e.shape),i=e.shape[e.shape.length-1],a=dW({inputs:{x:e},backend:n,attrs:{shape:[o/i,i]}}),s=a.shape,l=new Hz("real",s,t),u=new Hz("imag",s,t),p=[{dataId:r.complexTensorInfos.real.dataId,dtype:r.complexTensorInfos.real.dtype,shape:s},{dataId:r.complexTensorInfos.imag.dataId,dtype:r.complexTensorInfos.imag.dtype,shape:s}],c=n.runWebGLProgram(l,p,"float32"),d=n.runWebGLProgram(u,p,"float32"),h=XL({input
vendor: 1,263 bytes, line 2
2s:{real:c,imag:d},backend:n});n.disposeIntermediateTensorInfo(c),n.disposeIntermediateTensorInfo(d);const f=dW({inputs:{x:h},backend:n,attrs:{shape:e.shape}});return n.disposeIntermediateTensorInfo(a),n.disposeIntermediateTensorInfo(h),f}const qz={kernelName:"FFT",backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{input:r}=t;return Gz(r,!1,n)}};class Kz{constructor(e,t){this.outputShape=[],this.customUniforms=[{name:"value",type:"float"}],this.variableNames=["x"],this.outputShape=e,this.userCode="\n      void main() {\n        // Input can be obtained from uniform value.\n        setOutput(value);\n      }\n    "}}function Xz(e){const{backend:t,attrs:n}=e,{shape:r,value:o}=n;let{dtype:i}=n;if(i=i||pe(o),"string"===i){const e=ae(i,J(r));return e.fill(o),t.makeTensorInfo(r,i,e)}{const e=new Kz(r,o),n=[[o]];return t.runWebGLProgram(e,[],i,n)}}const Yz={kernelName:Et,backendName:"webgl",kernelFunc:Xz};class Jz{constructor(e){this.variableNames=["Image"],this.outputShape=[];const t=e[2];this.outputShape=e,this.userCode=`\n        void main() {\n          ivec4 coords = getOutputCoords();\n          int x = coords[2];\n\n          int coordX = ${t} - x - 1;\n          float outputValue;\n          if(coordX >= 0 && coordX < ${t}
2) {\n            outputValue = getImage(coords[0], coords[1], coordX, coords[3]);\n          } else {\n            outputValue = getImage(coords[0], coords[1], coords[2], coords[3]);\n          }\n          setOutput(outputValue);\n        }\n    `}}const Zz={kernelName:It,backendName:"webgl",kernelFunc:({inputs:e,backend:t})=>{const{image:n}=e,r=t,o=new Jz(n.shape);return r.runWebGLProgram(o,[n],n.dtype)}},Qz="return floor(x);",eV=oW({opSnippet:Qz,packedOpSnippet:Qz,cpuKernelImpl:zP}),tV={kernelName:Tt,backendName:"webgl",kernelFunc:eV},nV=iW({opSnippet:"\n  float s = sign(a) * sign(b);\n  int ia = round(a);\n  int ib = round(b);\n  if (ib != 0) {\n    // Windows (D3D) wants guaranteed non-zero int division at compile-time.\n    return float(idiv(ia, ib, s));\n  } else {\n    return NAN;\n  }\n",packedOpSnippet:"\n  ivec4 ia = round(a);\n  ivec4 ib = round(b);\n  bvec4 cond = notEqual(ib, ivec4(0));\n  ivec4 result = ivec4(0);\n  vec4 s = sign(a) * sign(b);\n\n  // Windows (D3D) wants guaranteed non-zero int division at compile-time.\n  if (cond[0]) {\n    result[0] = idiv(ia[0], ib[0], s[0]);\n  }\n  if (cond[1]) {\n    result[1] = idiv(ia[1], ib[1], s[1]);\n  }\n  if (cond[2]) {\n    result[2] = idiv(ia[2], ib[2], s[2]);\n  }\n  if (cond[3]) {\n    result[3] = idiv(ia[3], ib[3], s[3]);\n  }\n  return vec4(result);\n",dtype:"int32"}),rV={kernelName:Ft,backendName:"webgl",kernelFunc:nV};class oV{constructor(e){this.variableNames=["A"];const t=tP(),[n,r]=e;this.outputShape=e,this.userCode=`\n      void main() {\n        ivec3 coords = getOutputCoords();\n        int texR = coords[0];\n        int texC = coords[1];\n        int depth = coords[2];\n        vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${r}.0, ${n}.0);\n\n        vec4 values = ${t.texture2D}(A, uv);\n        float value;\n        if (depth == 0) {\n          value = values.r;\n        } else if (depth == 1) {\n          value = values.g;\n        } else if (depth == 2) {\n          value = values.b;\n        } else if (depth == 3) {\n          value = values.a;\n        }\n\n        setOutput(floor(value * 255.0 + 0.5));\n      }\n    `}}class iV{constructor(e){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0;const t=tP(),[n,r]=e;this.outputShape=e,this.userCode=`\n      void main() {\n        ivec3 coords = getOutputCoords();\n        int texR = coords[0];\n        int texC = coords[1];\n        int depth = coords[2];\n\n        vec4 result = vec4(0.);\n\n        for(int row=0; row<=1; row++) {\n          for(int col=0; col<=1; col++) {\n            texC = coords[1] + row;\n            depth = coords[2] + col;\n\n            vec2 uv = (vec2(texC, texR) + halfCR) /\n                       vec2(${r}.0, ${n}.0);\n            vec4 values = ${t.texture2D}(A, uv);\n            float value;\n            if (depth == 0) {\n              value = values.r;\n            } else if (depth == 1) {\n              value = values.g;\n            } else if (depth == 2) {\n              value = values.b;\n            } else if (depth == 3) {\n              value = values.a;\n            }\n\n            result[row * 2 + col] = floor(value * 255.0 + 0.5);\n          }\n        }\n\n        ${t.output} = result;\n      }\n    `}}const aV={kernelName:wr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e;let{pixels:o}=t;const{numChannels:i}=r,a="undefined"!=typeof HTMLVideoElement&&o instanceof HTMLVideoElement,s="undefined"!=typeof HTMLImageElement&&o instanceof HTMLImageElement,[l,u]=a?[o.videoWidth,o.videoHeight]:[o.width,o.height],p=[u,l],c=[u,l,i];(s||a)&&(null==sV&&(sV=document.createElement("canvas").getContext("2d")),sV.canvas.width=l,sV.canvas.height=u,sV.drawImage(o,0,0,l,u),o=sV.canvas);const d=n.makeTensorInfo(p,"int32");n.texData.get(d.dataId).usage=EB.PIXELS,n.gpgpu.uploadPixelDataToTexture(n.getTexture(d.dataId),o);const h=ke().getBool("WEBGL_PACK")?new iV(c):new oV(c),f=n.runWebGLProgram(h,[d],"int32");return n.disposeData(d.dataId),f}};let sV;const lV={kernelName:vr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o,filter:i,bias:a,preluActivationWeights:s}=t,{strides:l,pad:u,dataFormat:p,dilations:c,dimRoundingMode:d,activation:h,leakyreluAlpha:f}=r,g=ll(p),m=Qs(o.shape,i.shape,l,c,u,d,!1,g);let y;const b=[];if(1!==m.filterHeight||1!==m.filterWidth||1!==m.dilationHeight||1!==m.dilationWidth||1!==m.strideHeight||1!==m.strideWidth||"SAME"!==m.padInfo.type&&"VALID"!==m.padInfo.type)if(ke().getBool("WEBGL_CONV_IM2COL")&&1===o.shape[0])y=KU({x:o,filter:i,convInfo:m,backend:n,bias:a,activation:h,preluActivationWeights:s,leakyreluAlpha:f});else{const e=null!=a,t=null!=s,r="leakyrelu"===h,l=h?aW(h,!1):null,u=new VU(m,e,l,t,r),p=[o,i];if(a&&p.push(a),s&&p.push(s),r){const e=n.makeTensorInfo([],"float32",Br(f,"float32"));p.push(e),b.push(e)}y=n.runWebGLProgram(u,p,"float32")}else y=qU({x:o,filter:i,convInfo:m,backend:n,bias:a,activation:h,preluActivationWeights:s,leakyreluAlpha:f});const $=dW({inputs:{x:y},backend:n,attrs:{shape:m.outShape}});
vendor: 6,609 bytes, line 2
2return b.push(y),b.forEach(e=>n.disposeIntermediateTensorInfo(e)),$}},uV={kernelName:kr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o,filter:i,bias:a,preluActivationWeights:s}=t,{strides:l,pad:u,dilations:p,dimRoundingMode:c,activation:d,leakyreluAlpha:h}=r,f=[];let g=p;null==g&&(g=[1,1]),q(sl(l,g),()=>`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${l} and dilations '${g}'`);const m=Qs(o.shape,i.shape,l,g,u,c,!0),y=ke().getBool("WEBGL_PACK_DEPTHWISECONV")&&m.strideWidth<=2&&m.outChannels/m.inChannels===1,b=d?aW(d,y):null,$=[o,i],_=null!=a,w=null!=s,x="leakyrelu"===d;if(_&&$.push(a),w&&$.push(s),x){const e=n.makeTensorInfo([],"float32",Br(h,"float32"));$.push(e),f.push(e)}let S;S=y?new $z(m,_,b,w,x):new bz(m,_,b,w,x);const v=[[m.padInfo.top,m.padInfo.left],[m.strideHeight,m.strideWidth],[m.dilationHeight,m.dilationWidth],[m.inHeight,m.inWidth]],k=n.runWebGLProgram(S,$,"float32",v);return f.forEach(e=>n.disposeIntermediateTensorInfo(e)),k}};class pV{constructor(e,t,n){this.sliceDim=e,this.strides=t,this.variableNames=["x","indices"],this.outputShape=n;const r=mP(t.length),o=mP(n.length),i=this.sliceDim>1?"strides[j]":"strides";this.userCode=`\n        ${r} strides = ${r}(${this.strides});\n         void main() {\n          ${o} coords = getOutputCoords();\n          int flattenIndex = 0;\n          for (int j = 0; j < ${this.sliceDim}; j++) {\n            int index = round(getIndices(coords[0], j));\n            flattenIndex += index * ${i};\n          }\n          setOutput(getX(flattenIndex, coords[1]));\n        }\n      `}}const cV={kernelName:At,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{params:r,indices:o}=t,i=o.shape,a=i[i.length-1],s=J(r.shape),[l,u,p,c]=Il(r,o),d=dW({inputs:{x:o},backend:n,attrs:{shape:[u,a]}}),h=dW({inputs:{x:r},backend:n,attrs:{shape:[J(r.shape)/p,p]}});if(n.shouldExecuteOnCPU([r,o])||"string"===r.dtype){const e=n.readSync(o.dataId),t=n.bufferSync(r),i=VP(e,t,r.dtype,u,a,p,c,r.shape,s);return n.makeTensorInfo(l,r.dtype,i.values)}const f=new pV(a,c,[u,p]),g=n.runWebGLProgram(f,[h,d],h.dtype),m=dW({inputs:{x:g},backend:n,attrs:{shape:l}});return n.disposeIntermediateTensorInfo(d),n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(g),m}};class dV{constructor(e,t){this.variableNames=["A","indices"],this.outputShape=t,this.rank=t.length;const n=mP(this.rank),r=function(e){const t=["resRC.x","resRC.y","resRC.z","resRC.w"],n=[];for(let r=0;r<e.length;r++)2===r?n.push("int(getIndices(resRC.x, resRC.z))"):n.push(`${t[r]}`);return n.join()}(e);this.userCode=`\n      void main() {\n        ${n} resRC = getOutputCoords();\n        setOutput(getA(${r}));\n      }\n    `}}function hV(e){const{inputs:t,backend:n,attrs:r}=e,{x:o,indices:i}=t,{axis:a,batchDims:s}=r,l=au(o,i,re(a,o.shape)[0],s),u=J(i.shape),p=[],c=dW({inputs:{x:o},backend:n,attrs:{shape:[l.batchSize,l.outerSize,l.dimSize,l.sliceSize]}}),d=dW({inputs:{x:i},backend:n,attrs:{shape:[l.batchSize,u/l.batchSize]}});p.push(c),p.push(d);const h=[l.batchSize,l.outerSize,u/l.batchSize,l.sliceSize];if(n.shouldExecuteOnCPU([o,i])||"string"===o.dtype){const e=n.bufferSync(d),t=n.bufferSync(c),r=HP(t,e,h);return p.forEach(e=>n.disposeIntermediateTensorInfo(e)),n.makeTensorInfo(l.outputShape,r.dtype,r.values)}const f=new dV(c.shape,h),g=n.runWebGLProgram(f,[c,d],c.dtype);p.push(g);const m=dW({inputs:{x:g},backend:n,attrs:{shape:l.outputShape}});return p.forEach(e=>n.disposeIntermediateTensorInfo(e)),m}const fV={kernelName:jt,backendName:"webgl",kernelFunc:hV},gV=iW({opSnippet:"return float(a > b);",packedOpSnippet:"\n  return vec4(greaterThan(a, b));\n",cpuKernelImpl:GP,dtype:"bool"}),mV={kernelName:Ct,backendName:"webgl",kernelFunc:gV},yV=iW({opSnippet:"return float(a >= b);",packedOpSnippet:"\n  return vec4(greaterThanEqual(a, b));\n",dtype:"bool",cpuKernelImpl:qP}),bV={kernelName:Mt,backendName:"webgl",kernelFunc:yV},$V={kernelName:Ot,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{input:r}=t;return Gz(r,!0,n)}},_V=oW({opSnippet:"return float(!isnan(x) && !isinf(x));",dtype:"bool"}),wV={kernelName:Bt,backendName:"webgl",kernelFunc:_V},xV=oW({opSnippet:"return float(isinf(x));",dtype:"bool"}),SV={kernelName:Pt,backendName:"webgl",kernelFunc:xV},vV=oW({opSnippet:"return float(isnan(x));",dtype:"bool"}),kV={kernelName:Lt,backendName:"webgl",kernelFunc:vV},EV=iW({opSnippet:"return float(a < b);",packedOpSnippet:"\n  return vec4(lessThan(a, b));\n",cpuKernelImpl:KP,dtype:"bool"}),IV={kernelName:Ut,backendName:"webgl",kernelFunc:EV},TV=iW({opSnippet:"return float(a <= b);",packedOpSnippet:"\n  return vec4(lessThanEqual(a, b));\n",cpuKernelImpl:XP,dtype:"bool"}),FV={kernelName:zt,backendName:"webgl",kernelFunc:TV},NV={kernelName:Vt,backendName:"webgl",kernelFunc:function(e){const{backend:t,attrs:n}=e,{start:r,stop:o,num:i}=n,a=YP(r,o,i);return t.makeTensorInfo([a.length],"float32",a)}},jV=oW({opSnippet:"if (x < 0.0) return NAN;\n  return log(x);",packedOpSnippet:"\n  vec4 result = log(x);\n  vec4 isNaN = vec4(lessThan(x, vec4(0.0)));\n  result.r = isNaN.r == 1.0 ? NAN : result.r;\n  result.g = isNaN.g == 1.0 ? NAN : result.g;\n  result.b = isNaN.b == 1.0 ? NAN : result.b;\n  result.a = isNaN.a == 1.0 ? NAN : result.a;\n\n  return result;\n",cpuKernelImpl:JP}),AV={kernelName:Ht,backendName:"webgl",kernelFunc:jV},CV=oW({opSnippet:"return log(1.0 + x);"}),MV={kernelName:Gt,backendName:"webgl",kernelFunc:CV},DV=iW({opSnippet:"return float(a >= 1.0 && b >= 1.0);",packedOpSnippet:"\n  return vec4(\n    vec4(greaterThanEqual(a, vec4(1.0))) *\n    vec4(greaterThanEqual(b, vec4(1.0))));\n",dtype:"bool"}),OV={kernelName:qt,backendName:"webgl",kernelFunc:DV},RV=oW({opSnippet:"return float(!(x >= 1.0));"}),BV={kernelName:Kt,backendName:"webgl",kernelFunc:RV},PV=iW({opSnippet:"return float(a >= 1.0 || b >= 1.0);",packedOpSnippet:"\n  return min(\n    vec4(greaterThanEqual(a, vec4(1.0))) +\n    vec4(greaterThanEqual(b, vec4(1.0))),\n    vec4(1.0));\n",dtype:"bool"}),LV={kernelName:Xt,backendName:"webgl",kernelFunc:PV};class WV{constructor(e,t,n,r,o){this.variableNames=["x"],this.outputShape=[];const i=t,a=e[3]-1;let s;this.outputShape=e;const l=`float(${n}) + float(${r}) * sum`;s=.5===o?`inversesqrt(${l})`:1===o?`1.0/(${l})`:`exp(log(${l}) * float(-${o}));`,this.userCode=`\n      void main() {\n        ivec4 coords = getOutputCoords();\n        int b = coords[0];\n        int r = coords[1];\n        int c = coords[2];\n        int d = coords[3];\n        float x = getX(b, r, c, d);\n        float sum = 0.0;
2\n        for (int j = -${i}; j <= ${i}; j++) {\n          int idx = d + j;\n          if (idx >= 0 && idx <=  ${a}) {\n            float z = getX(b, r, c, idx);\n            sum += z * z;\n          }\n        }\n        float val = x * ${s};\n        setOutput(val);\n      }\n    `}}class UV{constructor(e,t,n,r,o){this.variableNames=["x"],this.outputShape=[],this.packedInputs=!0,this.packedOutput=!0;const i=t,a=e[3]-1;let s;this.outputShape=e;const l=`float(${n}) + float(${r}) * sum`;s=.5===o?`inversesqrt(${l})`:1===o?`1.0/(${l})`:`exp(log(${l}) * float(-${o}));`,this.userCode=`\n      void main() {\n        ivec4 coords = getOutputCoords();\n        int b = coords.x;\n        int r = coords.y;\n        int c = coords.z;\n        int d = coords.w;\n\n        bool hasNextCol = d < ${this.outputShape[3]};\n        bool hasNextRow = c < ${this.outputShape[2]};\n\n        vec4 sum = vec4(0.);\n        vec4 xFragAtOutputCoords = getX(b, r, c, d);\n\n        vec4 xAtOutputCoords = vec4(\n          getChannel(xFragAtOutputCoords, vec2(c, d)),\n          hasNextCol ?\n            getChannel(xFragAtOutputCoords, vec2(c, d + 1)) : 0.0,\n          hasNextRow ?\n            getChannel(xFragAtOutputCoords , vec2(c + 1, d)) : 0.0,\n          (hasNextRow && hasNextCol) ?\n            getChannel(xFragAtOutputCoords, vec2(c + 1, d + 1)) : 0.0\n        );\n\n        int firstChannel = d - ${i};\n        vec2 cache = vec2(0.);\n        if(firstChannel >= 0){\n          vec4 firstChannelFrag = getX(b, r, c, firstChannel);\n          cache.x = getChannel(firstChannelFrag, vec2(c, firstChannel));\n            if(hasNextRow){\n              cache.y = getChannel(firstChannelFrag, vec2(c + 1, firstChannel));\n            }\n        }\n\n        ivec2 depth = ivec2(d, d + 1);\n        for (int j = - ${i}; j <= ${i}; j++) {\n          ivec2 idx = depth + j;\n          bvec2 aboveLowerBound = greaterThanEqual(idx, ivec2(0));\n          bvec2 belowUpperBound = lessThanEqual(idx, ivec2(${a}));\n\n          bool depthInRange = aboveLowerBound.x && belowUpperBound.x;\n          bool depthPlusOneInRange = aboveLowerBound.y && belowUpperBound.y;\n\n          if(depthInRange || depthPlusOneInRange){\n            vec4 z = vec4(0.);\n            vec4 xFragAtCurrentDepth;\n            z.xz = cache.xy;\n            if(depthPlusOneInRange && hasNextCol){\n              xFragAtCurrentDepth = idx.y != d ?\n                getX(b, r, c, idx.y) : xFragAtOutputCoords;\n              z.y = getChannel(xFragAtCurrentDepth, vec2(c, idx.y));\n              if(hasNextRow){\n                z.w = getChannel(xFragAtCurrentDepth, vec2(c + 1, idx.y));\n              }\n            }\n            cache.xy = z.yw;\n            sum += z * z;\n          }\n        }\n        vec4 result = xAtOutputCoords * ${s};\n        setOutput(result);\n      }\n    `}}const zV={kernelName:Yt,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{depthRadius:i,bias:a,alpha:s,beta:l}=r,u=ke().getBool("WEBGL_PACK_NORMALIZATION")?new UV(o.shape,i,a,s,l):new WV(o.shape,i,a,s,l);return n.runWebGLProgram(u,[o],o.dtype)}};class VV{constructor(e,t,n,r,o){this.variableNames=["inputImage","outputImage","dy"],this.outputShape=[],this.outputShape=e,this.depth=e[3],this.depthRadius=t,this.bias=n,this.alpha=r,this.beta=o,this.userCode=`\n      void main() {\n        ivec4 coords = getOutputCoords();\n        int b = coords[0];\n        int r = coords[1];\n        int c = coords[2];\n\n        float result = 0.0;\n        for (int d = 0; d < ${this.depth}; ++d) {\n          int depthBegin = int(max(0.0, float(d - ${t})));\n          int depthEnd = int(min(float(${this.depth}),\n              float(d + ${t} + 1)));\n\n          const int MIN_DEPTH_BEGIN = 0;\n          const int MAX_DEPTH_END = ${this.depth};\n\n          float norm = 0.0;\n          for (int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k) {\n            if (k < depthBegin){\n              continue;\n            }\n            else if (k >= depthBegin && k < depthEnd) {\n              norm += getInputImage(b, r, c, k) * getIn
2putImage(b, r, c, k);\n            }\n            else {\n              break;\n            }\n          }\n\n          norm = float(${r}) * norm + float(${n});\n\n          for(int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k){\n            if (k < depthBegin){\n              continue;\n            }\n            else if (k >= depthBegin && k < depthEnd){\n              float dyi = -2.0 * float(${r})\n                * float(${o})\n                * getInputImage(b ,r ,c, k) * getOutputImage(b, r, c, d)\n                / norm;\n              if (k == d) {\n                dyi += pow(norm, -1.0 * ${o});\n              }\n              if (k == coords[3]) {\n                dyi *= getDy(b, r, c, d);\n                result += dyi;\n              }\n            }\n            else {\n              break;\n            }\n          }\n      }\n      setOutput(result);\n      }\n    `}}const HV={kernelName:Jt,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n,attrs:r}=e,{x:o,y:i,dy:a}=t,{depthRadius:s,bias:l,alpha:u,beta:p}=r,c=new VV(o.shape,s,l,u,p);return n.runWebGLProgram(c,[o,i,a],o.dtype)}};function GV(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{reductionIndices:i,keepDims:a}=r,s=o.shape.length,l=re(i,o.shape);let u=l;const p=os(u,s),c=null!=p,d=n.shouldExecuteOnCPU([o]);let h=o;if(c){if(d){const e=n.texData.get(h.dataId).values,t=new Array(s);for(let e=0;e<t.length;e++)t[e]=o.shape[p[e]];const r=wL(e,o.shape,o.dtype,p,t);h=n.makeTensorInfo(t,o.dtype),n.texData.get(h.dataId).values=r}else h=$W(o,p,n);u=as(u.length,s)}rs("max",u,s);const[f,g]=ts(h.shape,u);let m,y=f;if(a&&(y=ns(f,l)),d){const e=n.texData.get(h.dataId).values,t=ZP(e,J(g),y,o.dtype);m=n.makeTensorInfo(y,o.dtype),n.texData.get(m.dataId).values=t}else m=function(e,t,n,r){const o=J(t),i=dW({inputs:{x:e},attrs:{shape:[J(e.shape)/o,o]},backend:r}),a=mW(i,e.dtype,"max",r),s=dW({inputs:{x:a},attrs:{shape:n},backend:r});return r.disposeIntermediateTensorInfo(i),r.disposeIntermediateTensorInfo(a),s}(h,g,y,n);return c&&n.disposeIntermediateTensorInfo(h),m}const qV={kernelName:Zt,backendName:"webgl",kernelFunc:GV},KV=iW({opSnippet:zL+"\n  return max(a, b);\n",packedOpSnippet:"\n  vec4 result = vec4(max(a, b));\n  vec4 isNaN = min(vec4(isnan(a)) + vec4(isnan(b)), vec4(1.0));\n  "+HL+"\n  return result;\n",cpuKernelImpl:QP}),XV={kernelName:Qt,backendName:"webgl",kernelFunc:KV},YV={kernelName:en,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t;QB(o,"maxPool");const{filterSize:i,strides:a,pad:s,dimRoundingMode:l}=r;q(sl(a,1),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${a} and dilations '1'`);const u=Js(o.shape,i,a,1,s,l);if(1===u.filterWidth&&1===u.filterHeight&&Z(u.inShape,u.outShape))return qL({inputs:{x:o},backend:n});const p=new rU(u,"max",!1);return n.runWebGLProgram(p,[o],o.dtype)}},JV={kernelName:nn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{filterSize:i,strides:a,pad:s,dataFormat:l,dimRoundingMode:u}=r,p=Zs(o.shape,i,a,[1,1,1],s,u,l),c=new oU(p,"max",!1);return n.runWebGLProgram(c,[o],o.dtype)}};class ZV{constructor(e){this.variableNames=["dy","maxPos"],this.outputShape=e.inShape;const t=e.strideHeight,n=e.strideWidth,r=e.dilationHeight,o=e.effectiveFilterHeight,i=e.effectiveFilterWidth,a=o-1-e.padInfo.top,s=i-1-e.padInfo.left,l=o*i-1;this.userCode=`\n      const ivec2 pads = ivec2(${a}, ${s});\n\n      void main() {\n        ivec4 coords = getOutputCoords();\n        int b = coords[0];\n        int d = coords[3];\n\n        ivec2 dyRCCorner = coords.yz - pads;\n        int dyRCorner = dyRCCorner.x;\n        int dyCCorner = dyRCCorner.y;\n\n        // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d).\n        // ? = to be determined. : = across all values in that axis.\n        float dotProd = 0.0;\n        for (int wR = 0; wR < ${o};\n          wR += ${r}) {\n          float dyR = float(dyRCorner + wR) / ${t}.0;\n\n          if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) {\n            continue;\n          }\n          int idyR = int(dyR);\n\n          for (int wC = 0; wC < ${i}; wC++) {\n            float dyC = float(dyCCorner + wC) / ${n}.0;\n\n            if (dyC < 0.0 || dyC >= ${e.outWidth}.0 ||\n                fract(dyC) > 0.0) {\n              continue;\n            }\n            int idyC = int(dyC);\n\n            float dyValue = getDy(b, idyR, idyC, d);\n            int maxPosValue = ${l} - int(getMaxPos(b, idyR, idyC, d));\n\n            // Get the current value, check it against the value from the\n            // position matrix.\n            int curPosValue = wR * ${i} + wC;\n            float mask = float(maxPosValue == curPosValue ? 1.0 : 0.0);\n\n            dotProd += dyValue * mask;\n          }\n        }\n        setOutput(dotProd);\n      }\n    `}}class QV{constructor(e){this.variableNames=["dy","maxPos"],this.outputShape=e.inShape;const t=e.strideDepth,n=e.strideHeight,r=e.strideWidth,o=e.dilationDepth,i=e.dilationHeight,a=e.dilationWidth,s=e.effectiveFilterDepth,l=e.effectiveFilterHeight,u=e.effectiveFilterWidth,p=s-1-e.padInfo.front,c=l-1-e.padInfo.top,d=u-1-e.padInfo.left,h=s*l*u-1;this.userCode=`\n      const ivec3 pads = ivec3(${p}, ${c}, ${d});\n\n      void main() {\n        ivec5 coords = getOutputCoords();\n        int batch = coords.x;\n        int ch = coords.u;\n\n        ivec3 dyCorner = ivec3(coords.y, coords.z, coords.w) - pads;\n        int dyDCorner = dyCorner.x;\n        int dyRCorner = dyCorner.y;\n        int dyCCorner = dyCorner.z;\n\n        // Convolve dy(?, ?, ?, ch) with pos mask(:, :, :, d) to get\n        // dx(x
2D, xR, xC, ch).\n        // ? = to be determined. : = across all values in that axis.\n        float dotProd = 0.0;\n\n        for (int wD = 0; wD < ${s};\n           wD += ${o}) {\n          float dyD = float(dyDCorner + wD) / ${t}.0;\n\n          if (dyD < 0.0 || dyD >= ${e.outDepth}.0 || fract(dyD) > 0.0) {\n            continue;\n          }\n          int idyD = int(dyD);\n\n          for (int wR = 0; wR < ${l};\n              wR += ${i}) {\n            float dyR = float(dyRCorner + wR) / ${n}.0;\n\n            if (dyR < 0.0 || dyR >= ${e.outHeight}.0 ||\n                fract(dyR) > 0.0) {\n              continue;\n            }\n            int idyR = int(dyR);\n\n            for (int wC = 0; wC < ${u};\n                wC += ${a}) {\n              float dyC = float(dyCCorner + wC) / ${r}.0;\n\n              if (dyC < 0.0 || dyC >= ${e.outWidth}.0 ||\n                  fract(dyC) > 0.0) {\n                continue;\n              }\n              int idyC = int(dyC);\n\n              float dyValue = getDy(batch, idyD, idyR, idyC, ch);\n              int maxPosValue = ${h} -\n                  int(getMaxPos(batch, idyD, idyR, idyC, ch));\n\n              // Get the current value, check it against the value from the\n              // position matrix.\n              int curPosValue =\n                  wD * ${l} * ${u} +\n                  wR * ${u} + wC;\n              float mask = float(maxPosValue == curPosValue ? 1.0 : 0.0);\n\n              dotProd += dyValue * mask;\n            }\n          }\n        }\n        setOutput(dotProd);\n      }\n    `}}const eH={kernelName:rn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{dy:o,input:i}=t,a=i,{filterSize:s,strides:l,pad:u,dimRoundingMode:p}=r,c=Zs(a.shape,s,l,[1,1,1],u,p),d=new oU(c,"max",!0),h=n.runWebGLProgram(d,[a],a.dtype),f=new QV(c),g=n.runWebGLProgram(f,[o,h],a.dtype);return n.disposeIntermediateTensorInfo(h),g}},tH={kernelName:tn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{dy:o,input:i,output:a}=t,s=i;QB([i,a],"maxPoolGrad");const{filterSize:l,strides:u,pad:p,dimRoundingMode:c}=r,d=Js(s.shape,l,u,1,p,c),h=new rU(d,"max",!0),f=n.runWebGLProgram(h,[s],s.dtype),g=new ZV(d),m=n.runWebGLProgram(g,[o,f],s.dtype);return n.disposeIntermediateTensorInfo(f),m}},nH={kernelName:on,backendName:"webgl",kernelFunc:({inputs:e,attrs:t,backend:n})=>{const{x:r}=e,{filterSize:o,strides:i,pad:a,includeBatchInIndex:s}=t,l=n;q(4===r.shape.length,()=>`Error in maxPool: input must be rank 4 but got rank ${r.shape.length}.`);const u=[1,1];q(sl(i,u),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${i} and dilations '${u}'`);const p=Js(r.shape,o,i,u,a),[c,d]=function(e,t,n,r){let o=new rU(n,"max",!1);const i=r.runWebGLProgram(o,[e],"float32");return o=new rU(n,"max",!0,!0,t),[i,r.runWebGLProgram(o,[e],"float32")]}(r,s,p,l);return[c,d]}},rH={kernelName:an,backendName:"webgl",kernelFunc:({inputs:e,attrs:t,backend:n})=>{const{x:r}=e,{keepDims:o,axis:i}=t,a=n,s=r.shape.length,l=re(i,r.shape);let u=l;const p=os(u,s),c=null!=p,d=a.shouldExecuteOnCPU([r]),h=[];let f=r;if(c){if(d){const e=a.texData.get(f.dataId).values,t=new Array(s);for(let e=0;e<t.length;e++)t[e]=r.shape[p[e]];const n=wL(e,r.shape,r.dtype,p,t);f=a.makeTensorInfo(t,r.dtype),a.texData.get(f.dataId).values=n}else f=$W(r,p,a);h.push(f),u=as(u.length,s)}rs("sum",u,s);const[g,m]=ts(f.shape,u);let y=g;o&&(y=ns(g,l));const b=function(e,t,n,r){const o=J(t),i=dW({inputs:{x:e},attrs:{shape:[J(e.shape)/o,o]},backend:r}),a=mW(i,"float32","mean",r),s=dW({inputs:{x:a},attrs:{shape:n},backend:r});return r.disposeIntermediateTensorInfo(i),r.disposeIntermediateTensorInfo(a),s}(f,m,y,a);for(const e of h)a.disposeIntermediateTensorInfo(e);return b}},oH={kernelName:sn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{axis:i,keepDims:a}=r,s=o.shape.length,l=re(i,o.shape);let u=l;const p=os(u,s);let c=o;null!=p&&(c=xW({inputs:{x:o},backend:n,attrs:{perm:p}}),u=as(u.length,o.shape.length)),rs("min",u,s);const[d,h]=ts(c.shape,u),f=dW({inputs:{x:c},backend:n,attrs:{shape:[-1,J(h)]}}),g=mW(f,f.dtype,"min",n);let m;return m=dW(a?{inputs:{x:g},backend:n,attrs:{shape:ns(d,l)}}
2:{inputs:{x:g},backend:n,attrs:{shape:d}}),n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(g),null!=p&&n.disposeIntermediateTensorInfo(c),m}},iH=iW({opSnippet:zL+"\n  return min(a, b);\n",packedOpSnippet:"\n  vec4 result = vec4(min(a, b));\n  vec4 isNaN = min(vec4(isnan(a)) + vec4(isnan(b)), vec4(1.0));\n  "+HL+"\n  return result;\n",cpuKernelImpl:eL}),aH={kernelName:ln,backendName:"webgl",kernelFunc:iH};class sH{constructor(e,t,n){this.variableNames=["x"],this.outputShape=t.map((t,n)=>t[0]+e[n]+t[1]);const r=e.length,o=mP(r),i=t.map(e=>e[0]).join(","),a=t.map((t,n)=>t[0]+e[n]).join(","),s=["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,r),l="reflect"===n?0:1;this.userCode=1!==r?`\n      ${o} start = ${o}(${i});\n      ${o} end = ${o}(${a});\n\n      void main() {\n        ${o} outC = getOutputCoords();\n        for (int i = 0; i < ${r}; i++) {\n          if (outC[i] < start[i]) {\n            outC[i] = start[i] * 2 - outC[i] - ${l};\n          } else if(outC[i] >= end[i]) {\n            outC[i] = (end[i] - 1) * 2 - outC[i] + ${l};\n          }\n        }\n        ${o} coords = outC - start;\n        setOutput(getX(${s}));\n      }\n    `:`\n        int start = ${i};\n        int end = ${a};\n\n        void main() {\n          int outC = getOutputCoords();\n          if (outC < start) {\n            outC = start * 2 - outC - ${l};\n          } else if(outC >= end) {\n            outC = (end - 1) * 2 - outC + ${l};\n          }\n          setOutput(getX(outC - start));\n        }\n      `}}class lH{constructor(e,t,n){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=t.map((t,n)=>t[0]+e[n]+t[1]);const r=e.length,o=mP(r),i=t.map(e=>e[0]).join(","),a=t.map((t,n)=>t[0]+e[n]).join(","),s=vL("rc",r),l=vL("source",r),u=`${s[r-1]} < ${this.outputShape[r-1]}`,p=1===r?"source":`vec2(${l.slice(-2).join()})`,c="reflect"===n?0:1;let d="";if(1===r){const e=`\n        ${o} source = rc;\n        if (source < start) {\n          source = start * 2 - source - ${c};\n        } else if (source >= end) {\n          source = (end - 1) * 2 - source + ${c};\n        }\n        source -= start;\n      `;d=`\n        ${o} rc = outputLoc;\n        ${e}\n        result[0] = getChannel(getX(${l.join()}), ${p});\n        ${s[r-1]} += 1;\n        if(${u}) {\n          ${e}\n          result[1] = getChannel(getX(${l.join()}), ${p});\n        }\n      `}else{const e=`\n        ${o} source = rc;\n        ${o} lt = ${o}(lessThan(source, start));\n        ${o} gte = ${o}(greaterThanEqual(source, end));\n        ${o} orig = 1 - (lt + gte);\n        source = orig * source +\n                lt * (start * 2 - source - ${c}) +\n                gte * ((end - 1) * 2 - source + ${c});\n        source -= start;\n      `;d=`\n        ${o} rc = outputLoc;\n        ${e}\n        result[0] = getChannel(getX(${l.join()}), ${p});\n        ${s[r-1]} += 1;\n        if(${u}) {\n          ${e}\n          result[1] = getChannel(getX(${l.join()}), ${p});\n        }\n        rc = outputLoc;\n        ${s[r-2]} += 1;\n        if(${s[r-2]} < ${this.outputShape[r-2]}) {\n          ${e}\n          result[2] = getChannel(getX(${l.join()}), ${p});\n          ${s[r-1]} += 1;\n          if(${u}) {\n            ${e}\n            result[3] = getChannel(getX(${l.join()}), ${p});\n          }\n        }\n      `}this.userCode=`\n      const ${o} start = ${o}(${i});\n      const ${o} end = ${o}(${a});\n\n      void main() {\n        ${o} outputLoc = getOutputCoords();\n        vec4 result = vec4(0.);\n        ${d}\n        setOutput(result);\n      }\n    `}}const uH={kernelName:un,backendName:"webgl",kernelFunc:({inputs:e,backend:t,attrs:n})=>{const{x:r}=e,{paddings:o,mode:i}=n,a=ke().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new lH(r.shape,o,i):new sH(r.shape,o,i);return t.runWebGLProgram(a,[r],r.dtype)}},pH=iW({opSnippet:"if (b == 0.0) return NAN;\n  return mod(a, b);",packedOpSnippet:"\n  vec4 result = mod(a, b);\n  vec4 isNaN = vec4(equal(b, vec4(0.0)));\n  "+HL+"\n  return result;\n"}),cH={kernelName:pn,backendName:"webgl",kernelFunc:pH};class dH{constructor(e,t,n){this.variableNames=["probs"],this.customUniforms=[{name:"seed",type:"float"}],this.outputShape=[e,n],this.userCode=`\n      void main() {\n        ivec2 coords = getOutputCoords();\n        int batch = coords[0];\n\n        float r = random(seed);\n        float cdf = 0.0;\n\n        for (int i = 0; i < ${t-1};
2 i++) {\n          cdf += getProbs(batch, i);\n\n          if (r < cdf) {\n            setOutput(float(i));\n            return;\n          }\n        }\n\n        // If no other event happened, last event happened.\n        setOutput(float(${t-1}));\n      }\n    `}}const hH=iW({opSnippet:"\nif (a == b) {\n  return 1.0;\n};\nreturn a / b;",packedOpSnippet:"\n  // vec4 one = vec4(equal(a, b));\n  // return one + (vec4(1.0) - one) * a / b;\n  vec4 result = a / b;\n  if(a.x == b.x) {\n    result.x = 1.;\n  }\n  if(a.y == b.y) {\n    result.y = 1.;\n  }\n  if(a.z == b.z) {\n    result.z = 1.;\n  }\n  if(a.w == b.w) {\n    result.w = 1.;\n  }\n\n  return result;\n",checkOutOfBounds:!0}),fH={kernelName:yt,backendName:"webgl",kernelFunc:hH},gH="return a - b;",mH=iW({opSnippet:gH,packedOpSnippet:gH,supportsComplex:!0,cpuKernelImpl:bL}),yH={kernelName:ur,backendName:"webgl",kernelFunc:mH};function bH(e){const{inputs:t,backend:n,attrs:r}=e,{logits:o}=t,{dim:i}=r,a=re([i],o.shape),s=GV({inputs:{x:o},backend:n,attrs:{reductionIndices:a,keepDims:!1}}),l=ns(s.shape,a),u=dW({inputs:{x:s},backend:n,attrs:{shape:l}}),p=mH({inputs:{a:o,b:u},backend:n}),c=Bz({inputs:{x:p},backend:n}),d=_W({inputs:{x:c},backend:n,attrs:{axis:a,keepDims:!1}}),h=dW({inputs:{x:d},backend:n,attrs:{shape:l}}),f=hH({inputs:{a:c,b:h},backend:n});return n.disposeIntermediateTensorInfo(s),n.disposeIntermediateTensorInfo(u),n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(c),n.disposeIntermediateTensorInfo(d),n.disposeIntermediateTensorInfo(h),f}const $H={kernelName:Jn,backendName:"webgl",kernelFunc:bH},_H={kernelName:cn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{logits:o}=t,{numSamples:i,seed:a,normalized:s}=r,l=s?o:bH({inputs:{logits:o},backend:n,attrs:{dim:o.shape.length-1}}),u=l.shape[0],p=l.shape[1],c=new dH(u,p,i),d=[[a]],h=n.runWebGLProgram(c,[l],"int32",d);return s||n.disposeIntermediateTensorInfo(l),h}},wH="return -x;",xH={kernelName:hn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{x:r}=t;if(n.shouldExecuteOnCPU([r])){const e=n.texData.get(r.dataId),[t,o]=nL(e.values,r.shape,r.dtype);return n.makeTensorInfo(o,r.dtype,t)}let o;return o=ke().getBool("WEBGL_PACK_UNARY_OPERATIONS")?new RL(r.shape,wH):new jL(r.shape,wH),n.runWebGLProgram(o,[r],r.dtype)}},SH=ka,vH={kernelName:gn,backendName:"webgl",kernelFunc:function(e){_e("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");const{inputs:t,backend:n,attrs:r}=e,{boxes:o,scores:i}=t,{maxOutputSize:a,iouThreshold:s,scoreThreshold:l}=r,u=n.readSync(o.dataId),p=n.readSync(i.dataId),{selectedIndices:c}=SH(u,p,a,s,l);return n.makeTensorInfo([c.length],"int32",new Int32Array(c))}},kH=Ea,EH={kernelName:mn,backendName:"webgl",kernelFunc:function(e){_e("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");const{inputs:t,backend:n,attrs:r}=e,{boxes:o,scores:i}=t,{maxOutputSize:a,iouThreshold:s,scoreThreshold:l,padToMaxOutputSize:u}=r,p=n.readSync(o.dataId),c=n.readSync(i.dataId),{selectedIndices:d,validOutputs:h}=kH(p,c,a,s,l,u);return[n.makeTensorInfo([d.length],"int32",new Int32Array(d)),n.makeTensorInfo([],"int32",new Int32Array([h]))]}},IH=Ia,TH={kernelName:yn,backendName:"webgl",kernelFunc:function(e){_e("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");const{inputs:t,backend:n,attrs:r}=e,{boxes:o,scores:i}=t,{maxOutputSize:a,iouThreshold:s,scoreThreshold:l,softNmsSigma:u}=r,p=n.readSync(o.dataId),c=n.readSync(i.dataId),d=a,h=s,f=l,g=u,{selectedIndices:m,selectedScores:y}=IH(p,c,d,h,f,g);return[n.makeTensorInfo([m.length],"int32",new Int32Array(m)),n.makeTensorInfo([y.length],"float32",new Float32Array(y))]}};class FH{constructor(e,t,n,r){this.variableNames=["indices"],this.outputShape=[e,t],this.userCode=`\n      void main() {\n        ivec2 coords = getOutputCoords();\n        int index = round(getIndices(coords.x));\n        setOutput(mix(float(${r}), float(${n}),\n                      float(index == coords.y)));\n      }\n    `}}const NH={kernelName:$n,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n,attrs:r}=e,{indices:o}=t,{depth:i,onValue:a,offValue:s}=r,l=J(o.shape),u=new FH(l,i,a,s),p=dW({inputs:{x:o},backend:n,attrs:{shape:[l]}}),c=n.runWebGLProgram(u,[p],o.dtype);n.disposeIntermediateTensorInfo(p);const d=dW({inputs:{x:c},backend:n,attrs:{shape:[...o.shape,i]}});return n.disposeIntermediateTensorInfo(c),d}};function jH(e){const{inputs:t,backend:n}=e,{x:r}=t;if("complex64"===r.dtype){const e=vU({inputs:{input:r},backend:n}),t=jH({inputs:{x:e},backend:n}),o=PU({inputs:{input:r},backend:n}),i=jH({inputs:{x:o},backend:n}
2),a=XL({inputs:{real:t,imag:i},backend:n});return n.disposeIntermediateTensorInfo(e),n.disposeIntermediateTensorInfo(t),n.disposeIntermediateTensorInfo(o),n.disposeIntermediateTensorInfo(i),a}return Xz({attrs:{shape:r.shape,dtype:r.dtype,value:"string"===r.dtype?"":0},backend:n})}const AH={kernelName:$r,backendName:"webgl",kernelFunc:jH},CH={kernelName:bn,backendName:"webgl",kernelFunc:function e(t){const{inputs:n,backend:r}=t,{x:o}=n;if("string"===o.dtype)throw new Error("onesLike is not supported under string dtype");if("complex64"===o.dtype){const t=vU({inputs:{input:o},backend:r}),n=e({inputs:{x:t},backend:r}),i=PU({inputs:{input:o},backend:r}),a=jH({inputs:{x:i},backend:r}),s=XL({inputs:{real:n,imag:a},backend:r});return r.disposeIntermediateTensorInfo(t),r.disposeIntermediateTensorInfo(n),r.disposeIntermediateTensorInfo(i),r.disposeIntermediateTensorInfo(a),s}return Xz({attrs:{shape:o.shape,dtype:o.dtype,value:1},backend:r})}},MH={kernelName:_n,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{axis:o}=r;if(1===t.length)return Lz({inputs:{input:t[0]},backend:n,attrs:{dim:o}});const i=t[0].shape,a=t[0].dtype;t.forEach(e=>{K(i,e.shape,"All tensors passed to stack must have matching shapes"),q(a===e.dtype,()=>"All tensors passed to stack must have matching dtypes")});const s=[],l=UU({inputs:t.map(e=>{const t=Lz({inputs:{input:e},backend:n,attrs:{dim:o}});return s.push(t),t}),backend:n,attrs:{axis:o}});return s.forEach(e=>n.disposeIntermediateTensorInfo(e)),l}};class DH{constructor(e,t,n){this.variableNames=["x"],this.customUniforms=[{name:"value",type:"float"}],this.outputShape=t.map((t,n)=>t[0]+e[n]+t[1]);const r=e.length,o=mP(r),i=t.map(e=>e[0]).join(","),a=t.map((t,n)=>t[0]+e[n]).join(","),s=["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,r);this.userCode=1!==r?`\n      ${o} start = ${o}(${i});\n      ${o} end = ${o}(${a});\n\n      void main() {\n        ${o} outC = getOutputCoords();\n        if (any(lessThan(outC, start)) || any(greaterThanEqual(outC, end))) {\n          setOutput(value);\n        } else {\n          ${o} coords = outC - start;\n          setOutput(getX(${s}));\n        }\n      }\n    `:`\n        int start = ${i};\n        int end = ${a};\n\n        void main() {\n          int outC = getOutputCoords();\n          if (outC < start || outC >= end) {\n            setOutput(value);\n          } else {\n            setOutput(getX(outC - start));\n          }\n        }\n      `}}class OH{constructor(e,t,n){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"value",type:"float"}],this.outputShape=t.map((t,n)=>t[0]+e[n]+t[1]);const r=e.length,o=mP(r),i=t.map(e=>e[0]).join(","),a=t.map((t,n)=>t[0]+e[n]).join(","),s=vL("rc",r),l=vL("source",r),u=`${s[r-1]} < ${this.outputShape[r-1]}`,p=1===r?"source":`vec2(${l.slice(-2).join()})`,c=[`${o} rc = outputLoc;`,`${s[r-1]} += 1;\n       if(${u}) {\n      `,1===r?"":`}\n       rc = outputLoc;\n       ${s[r-2]} += 1;\n       if(${s[r-2]} < ${this.outputShape[r-2]}) {`,1===r?"":`  ${s[r-1]} += 1;\n         if(${u}) {`],d=1===r?"rc < start || rc >= end":"any(lessThan(rc, start)) || any(greaterThanEqual(rc, end))";let h="";for(let e=0,t=1===r?2:4;e<t;e++)h+=`\n        ${c[e]}\n        if (${d}) {\n          result[${e}] = float(value);\n        } else {\n          ${o} source = rc - start;\n          result[${e}] = getChannel(getX(${l.join()}), ${p});\n        }\n      `;h+=1===r?"} ":"}}",this.userCode=`\n      const ${o} start = ${o}(${i});\n      const ${o} end = ${o}(${a});\n\n      void main() {\n        ${o} outputLoc = getOutputCoords();\n        vec4 result = vec4(0.);\n        ${h}\n        setOutput(result);\n      }\n    `}}const RH=e=>{const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{paddings:i,constantValue:a}=r;if(0===J(o.shape)){return Xz({backend:n,attrs:{shape:i.map((e,t)=>e[0]+o.shape[t]+e[1]),value:a,dtype:o.dtype}})}const s=ke().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new OH(o.shape,i,a):new DH(o.shape,i,a),l=[[a]];return n.runWebGLProgram(s,[o],o.dtype,l)},BH={kernelName:wn,backendName:"webgl",kernelFunc:RH},PH=iW({opSnippet:"\n  if(a < 0.0 && floor(b) < b){\n    return NAN;\n  }\n  if (b == 0.0) {\n    return 1.0;\n  }\n  return (round(mod(b, 2.0)) != 1) ?\n      pow(abs(a), b) : sign(a) * pow(abs(a), b);\n",packedOpSnippet:"\n  // isModRound1 has 1 for components with round(mod(b, 2.0)) == 1, 0 otherwise.\n  vec4 isModRound1 = vec4(equal(round(mod(b, 2.0)), ivec4(1)));\n  vec4 multiplier = sign(a) * isModRound1 + (vec4(1.0) - isModRound1);\n  vec4 result = multiplier * pow(abs(a), b);\n\n  // Ensure that a^0 = 1, including 0^0 = 1 as this correspond to TF and JS\n  bvec4 isExpZero = equal(b, vec4(0.0));\n  result.r = isExpZero.r ? 1.0 : result.r;\n  result.g = isExpZero.g ? 1.0 : result.g;\n  result.b = isExpZero.b ? 1.0 : result.b;\n  result.a = isExpZero.a ? 1.0 : result.a;\n\n  vec4 isNaN = vec4(lessThan(a, vec4(0.0))) * vec4(lessThan(floor(b), b));\n  "+HL+"\n  return result;\n"}),LH={kernelName:xn,backendName:"webgl",kernelFunc:PH},WH={kernelName:vn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{axis:i,keepDims:a}=r,s=o.shape.length,l=[],u=re(i,o.shape);let p=u;const c=os(p,s);let d,h=o;if(null!=c&&(h=xW({inputs:{x:o},backend:n,attrs:{perm:c}}),p=as(p.length,s),l.push(h)),rs("prod",p,s),n.shouldExecuteOnCPU([h])){const e=n.texData.get(h.dataId).values,{outVals:t,outShape:r,outDtype:
vendor: 4,401 bytes, line 2
2o}=oL(h.shape,h.dtype,e,p);d=n.makeTensorInfo(r,o,t)}else{const[e,t]=ts(h.shape,p),r=J(t),i=dW({inputs:{x:h},backend:n,attrs:{shape:[-1,r]}}),a=mW(i,co(o.dtype),"prod",n);d=dW({inputs:{x:a},backend:n,attrs:{shape:e}}),l.push(i),l.push(a)}if(a){l.push(d);const e=ns(d.shape,u);d=dW({inputs:{x:d},backend:n,attrs:{shape:e}})}return l.forEach(e=>n.disposeIntermediateTensorInfo(e)),d}},UH=e=>{const{backend:t,attrs:n}=e,{start:r,stop:o,step:i,dtype:a}=n,s=iL(r,o,i,a);return t.makeTensorInfo([s.length],a,s)},zH={kernelName:kn,backendName:"webgl",kernelFunc:UH},VH=oW({opSnippet:"return 1.0 / x;"}),HH={kernelName:In,backendName:"webgl",kernelFunc:VH},GH=oW({opSnippet:AL+"\n  return (x < 0.0) ? 0.0 : x;\n",packedOpSnippet:"\n  vec4 result = x * vec4(greaterThanEqual(x, vec4(0.0)));\n  bvec4 isNaN = isnan(x);\n\n  result.r = isNaN.r ? x.r : result.r;\n  result.g = isNaN.g ? x.g : result.g;\n  result.b = isNaN.b ? x.b : result.b;\n  result.a = isNaN.a ? x.a : result.a;\n\n  return result;\n"}),qH={kernelName:Tn,backendName:"webgl",kernelFunc:GH},KH=oW({opSnippet:AL+"\n  return (x < 0.0) ? 0.0 : min(6.0, x);\n",packedOpSnippet:"\n  vec4 result = min(x, vec4(6.)) * vec4(greaterThanEqual(x, vec4(0.0)));\n  bvec4 isNaN = isnan(x);\n\n  result.r = isNaN.r ? x.r : result.r;\n  result.g = isNaN.g ? x.g : result.g;\n  result.b = isNaN.b ? x.b : result.b;\n  result.a = isNaN.a ? x.a : result.a;\n\n  return result;\n"}),XH={kernelName:Mn,backendName:"webgl",kernelFunc:KH};class YH{constructor(e,t,n,r,o){this.variableNames=["A"],this.outputShape=[];const[i,a,s,l]=e;this.outputShape=[i,t,n,l];const u=[r&&t>1?a-1:a,r&&n>1?s-1:s],p=[r&&t>1?t-1:t,r&&n>1?n-1:n];let c;c=o?"(vec2(yRC) + vec2(0.5)) * effectiveInputOverOutputRatioRC - vec2(0.5)":"vec2(yRC) * effectiveInputOverOutputRatioRC",this.userCode=`\n      const vec2 effectiveInputOverOutputRatioRC = vec2(\n          ${u[0]/p[0]},\n          ${u[1]/p[1]});\n      const vec2 inputShapeRC = vec2(${a}.0, ${s}.0);\n\n      void main() {\n        ivec4 coords = getOutputCoords();\n        int b = coords[0];\n        int d = coords[3];\n        ivec2 yRC = coords.yz;\n\n        // Fractional source index.\n        vec2 sourceFracIndexRC = ${c};\n\n        // Compute the four integer indices.\n        ivec2 sourceFloorRC = ivec2(max(sourceFracIndexRC, vec2(0.0)));\n        ivec2 sourceCeilRC = ivec2(\n          min(inputShapeRC - 1.0, ceil(sourceFracIndexRC)));\n\n        float topLeft = getA(b, sourceFloorRC.x, sourceFloorRC.y, d);\n        float bottomLeft = getA(b, sourceCeilRC.x, sourceFloorRC.y, d);\n        float topRight = getA(b, sourceFloorRC.x, sourceCeilRC.y, d);\n        float bottomRight = getA(b, sourceCeilRC.x, sourceCeilRC.y, d);\n\n        vec2 fracRC = sourceFracIndexRC - vec2(sourceFloorRC);\n\n        float top = topLeft + (topRight - topLeft) * fracRC.y;\n        float bottom = bottomLeft + (bottomRight - bottomLeft) * fracRC.y;\n        float newValue = top + (bottom - top) * fracRC.x;\n\n        setOutput(newValue);\n      }\n    `}}class JH{constructor(e,t,n,r,o){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[];const[i,a,s,l]=e;this.outputShape=[i,t,n,l];const u=[r&&t>1?a-1:a,r&&n>1?s-1:s],p=[r&&t>1?t-1:t,r&&n>1?n-1:n];let c;c=o?"(vec3(yRC) + vec3(0.5)) * effectiveInputOverOutputRatioRC - vec3(0.5)":"vec3(yRC) * effectiveInputOverOutputRatioRC",this.userCode=`\n      const vec3 effectiveInputOverOutputRatioRC = vec3(\n          ${u[0]/p[0]},\n          ${u[1]/p[1]},\n          ${u[1]/p[1]});\n      const vec3 inputShapeRC = vec3(${a}.0, ${s}.0,\n                                     ${s}.0);\n\n      float getAValue(int b, int r, int c, int d) {\n        return getChannel(getA(b, r, c, d), vec2(c, d));\n      }\n\n      void main() {\n        ivec4 coords = getOutputCoords();\n        int b = coords[0];\n        int d = coords[3];\n        // Calculate values for next column in yRC.z.\n        ivec3 yRC = coords.yzz + ivec3(0, 0, 1);\n\n        // Fractional source index.\n        vec3 sourceFracIndexRC = ${c};\n\n        // Compute the four integer indices.\n        ivec3 sourceFloorRC = ivec3(max(sourceFracIndexRC, vec3(0.0)));\n        ivec3 sourceCeilRC = ivec3(\n          min(inputShapeRC - 1.0, ceil(sourceFracIndexRC)));\n\n        // Should we calculate next column and row elements in 2x2 packed cell.\n        bool hasNextCol = d < ${l
vendor: 2,116 bytes, line 2
2-1};\n        bool hasNextRow = coords.z < ${n-1};\n\n        // In parallel, construct four corners for all four components in\n        // packed 2x2 cell.\n        vec4 topLeft = vec4(\n          getAValue(b, sourceFloorRC.x, sourceFloorRC.y, d),\n          hasNextCol ? getAValue(b, sourceFloorRC.x, sourceFloorRC.y, d + 1)\n                     : 0.0,\n          hasNextRow ? getAValue(b, sourceFloorRC.x, sourceFloorRC.z, d)\n                     : 0.0,\n          (hasNextRow && hasNextCol) ?\n            getAValue(b, sourceFloorRC.x, sourceFloorRC.z, d + 1) : 0.0);\n\n        vec4 bottomLeft = vec4(\n          getAValue(b, sourceCeilRC.x, sourceFloorRC.y, d),\n          hasNextCol ? getAValue(b, sourceCeilRC.x, sourceFloorRC.y, d + 1)\n                     : 0.0,\n          hasNextRow ? getAValue(b, sourceCeilRC.x, sourceFloorRC.z, d)\n                     : 0.0,\n          (hasNextRow && hasNextCol) ?\n            getAValue(b, sourceCeilRC.x, sourceFloorRC.z, d + 1) : 0.0);\n\n        vec4 topRight = vec4(\n          getAValue(b, sourceFloorRC.x, sourceCeilRC.y, d),\n          hasNextCol ? getAValue(b, sourceFloorRC.x, sourceCeilRC.y, d + 1)\n                     : 0.0,\n          hasNextRow ? getAValue(b, sourceFloorRC.x, sourceCeilRC.z, d)\n                     : 0.0,\n          (hasNextRow && hasNextCol) ?\n            getAValue(b, sourceFloorRC.x, sourceCeilRC.z, d + 1) : 0.0);\n\n        vec4 bottomRight = vec4(\n          getAValue(b, sourceCeilRC.x, sourceCeilRC.y, d),\n          hasNextCol ? getAValue(b, sourceCeilRC.x, sourceCeilRC.y, d + 1)\n                     : 0.0,\n          hasNextRow ? getAValue(b, sourceCeilRC.x, sourceCeilRC.z, d)\n                     : 0.0,\n          (hasNextRow && hasNextCol) ?\n            getAValue(b, sourceCeilRC.x, sourceCeilRC.z, d + 1) : 0.0);\n\n        vec3 fracRC = sourceFracIndexRC - vec3(sourceFloorRC);\n\n        vec4 top = mix(topLeft, topRight, fracRC.yyzz);\n        vec4 bottom = mix(bottomLeft, bottomRight, fracRC.yyzz);\n        vec4 newValue = mix(top, bottom, fracRC.x);\n\n        setOutput(newValue);\n      }\n    `}}
vendor: 6,002 bytes, line 2
2const ZH={kernelName:An,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{images:o}=t,{alignCorners:i,halfPixelCenters:a,size:s}=r,[l,u]=s,p=ke().getBool("WEBGL_PACK_IMAGE_OPERATIONS")?new JH(o.shape,l,u,i,a):new YH(o.shape,l,u,i,a);return n.runWebGLProgram(p,[o],"float32")}};class QH{constructor(e,t,n){this.variableNames=["dy"],this.outputShape=[],this.outputShape=t;const[,r,o]=t,[,i,a]=e,s=[n&&i>1?r-1:r,n&&a>1?o-1:o],l=[n&&i>1?i-1:i,n&&a>1?a-1:a],u=s[0]/l[0],p=s[1]/l[1],c=1/u,d=1/p,h=2*Math.ceil(c)+2,f=2*Math.ceil(d)+2;this.userCode=`\n      void main() {\n        ivec4 coords = getOutputCoords();\n        int b = coords[0];\n        int d = coords[3];\n        int r = coords[1];\n        int c = coords[2];\n\n        float accumulator = 0.0;\n\n        const float heightScale = float(${u});\n        const float widthScale = float(${p});\n\n        const float invHeightScale = float(${c});\n        const float invWidthScale = float(${d});\n\n        const int winHeight = int(${h});\n        const int winWidth = int(${f});\n\n        // Compute bounds for where in dy we will look\n        float startRLerp = floor(float(r) * invHeightScale);\n        int startDyR = int(startRLerp - float(winHeight / 2));\n\n        float startCLerp = floor(float(c) * invWidthScale);\n        int startDyC = int(startCLerp - float(winWidth / 2));\n\n        // Loop over dy\n        for (int dyROffset = 0; dyROffset < winHeight; dyROffset++) {\n          int dyR = dyROffset + startDyR;\n\n          // Guard against the window exceeding the bounds of dy\n          if (dyR < 0 || dyR >= ${i}) {\n            continue;\n          }\n\n          for (int dyCOffset = 0; dyCOffset < winWidth; dyCOffset++) {\n            int dyC = dyCOffset + startDyC;\n\n            // Guard against the window exceeding the bounds of dy\n            if (dyC < 0 || dyC >= ${a}) {\n              continue;\n            }\n\n            float dxR = float(dyR) * heightScale;\n            int topDxRIndex = int(floor(dxR));\n            int bottomDxRIndex = int(min(ceil(dxR), ${r-1}.0));\n            float dxRLerp = dxR - float(topDxRIndex);\n            float inverseDxRLerp = 1.0 - dxRLerp;\n\n            float dxC = float(dyC) * widthScale;\n            int leftDxCIndex = int(floor(dxC));\n            int rightDxCIndex = int(min(ceil(dxC), ${o-1}.0));\n            float dxCLerp = dxC - float(leftDxCIndex);\n            float inverseDxCLerp = 1.0 - dxCLerp;\n\n            if (r == topDxRIndex && c == leftDxCIndex) {\n              // topLeft\n              accumulator +=\n                getDy(b, dyR, dyC, d) * inverseDxRLerp * inverseDxCLerp;\n            }\n\n            if (r == topDxRIndex && c == rightDxCIndex) {\n              // topRight\n              accumulator += getDy(b, dyR, dyC, d) * inverseDxRLerp * dxCLerp;\n            }\n\n            if (r == bottomDxRIndex && c == leftDxCIndex) {\n              // bottomLeft\n              accumulator += getDy(b, dyR, dyC, d) * dxRLerp * inverseDxCLerp;\n            }\n\n            if (r == bottomDxRIndex && c == rightDxCIndex) {\n              // bottomRight\n              accumulator += getDy(b, dyR, dyC, d) * dxRLerp * dxCLerp;\n            }\n          }\n        }\n        // End loop over dy\n\n        setOutput(accumulator);\n      }\n    `}}const eG={kernelName:Cn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{images:o,dy:i}=t,{alignCorners:a}=r,s=new QH(i.shape,o.shape,a);return n.runWebGLProgram(s,[i],i.dtype)}};class tG{constructor(e,t,n,r,o){this.variableNames=["A"],this.outputShape=[];const[i,a,s,l]=e;this.outputShape=[i,t,n,l];const u=[r&&t>1?a-1:a,r&&n>1?s-1:s],p=[r&&t>1?t-1:t,r&&n>1?n-1:n],c=r?"0.5":"0.0";let d;d=o?"max((vec2(yRC) + vec2(0.5)) * effectiveInputOverOutputRatioRC, vec2(0.0))":"vec2(yRC) * effectiveInputOverOutputRatioRC",this.userCode=`\n      const vec2 effectiveInputOverOutputRatioRC = vec2(\n          ${u[0]/p[0]},\n          ${u[1]/p[1]});\n      const vec2 inputShapeRC = vec2(${a}.0, ${s}.0);\n\n      void main() {\n        ivec4 coords = getOutputCoords();\n        int b = coords[0];\n        int d = coords[3];\n        ivec2 yRC = coords.yz;\n\n        // Fractional source index.\n        vec2 sourceFracIndexRC = ${d};\n\n        // Compute the coordinators of nearest neighbor point.\n        ivec2 sourceNearestRC = ivec2(\n          min(inputShapeRC - 1.0, floor(sourceFracIndexRC + ${c})));\n        float newValue = getA(b, sourceNearestRC.x, sourceNearestRC.y, d);\n\n        setOutput(newValue);\n      }\n    `}}class nG{constructor(e,t,n,r,o){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[];const[i,a,s,l]=e;this.outputShape=[i,t,n,l];const u=[r&&t>1?a-1:a,r&&n>1?s-1:s],p=[r&&t>1?t-1:t,r&&n>1?n-1:n],c=r?"0.5":"0.0";let d;d=o?"max((vec3(yRC) + vec3(0.5)) * effectiveInputOverOutputRatioRC, vec3(0.0))":"vec3(yRC) * effectiveInputOverOutputRatioRC",this.userCode=`\n      const vec3 effectiveInputOverOutputRatioRC = vec3(\n          ${u[0]/p[0]},\n          ${u[1]/p[1]},\n          ${u[1]/p[1]});\n      const vec3 inputShapeRC = vec3(${a}.0, ${s}.0,\n                                     ${s}.0);\n\n      float getAValue(int b, int r, int c, int d) {\n        return getChannel(getA(b, r, c, d), vec2(c, d));\n      }\n\n      void main() {\n        ivec4 coords = getOutputCoords();\n        int b = coords[0];\n        int d = coords[3];\n        // Calculate values for next column in yRC.z.\n        ivec3 yRC = coords.yzz + ivec3(0, 0, 1);\n\n        // Fractional source index.\n        vec3 sourceFracIndexRC = ${d};\n\n        // Compute the coordinators of nearest neighbor point.\n        ivec3 sourceNearestRC = ivec3(\n          min(inputShapeRC - 1.0, floor(sourceFracIndexRC + ${c})));\n\n        // Should we calculate next column and row elements in 2x2 packed cell.\n        bool hasNextCol = d < ${l-1};\n        bool hasNextRow = coords.z < ${n-1};
2\n\n        vec4 newValue = vec4(\n          getAValue(b, sourceNearestRC.x, sourceNearestRC.y, d),\n          hasNextCol ? getAValue(b, sourceNearestRC.x, sourceNearestRC.y, d + 1)\n                     : 0.0,\n          hasNextRow ? getAValue(b, sourceNearestRC.x, sourceNearestRC.z, d)\n                     : 0.0,\n          (hasNextRow && hasNextCol) ?\n            getAValue(b, sourceNearestRC.x, sourceNearestRC.z, d + 1) : 0.0);\n\n        setOutput(newValue);\n      }\n    `}}const rG={kernelName:Nn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{images:o}=t,{alignCorners:i,halfPixelCenters:a,size:s}=r,[l,u]=s,p=ke().getBool("WEBGL_PACK_IMAGE_OPERATIONS")?new nG(o.shape,l,u,i,a):new tG(o.shape,l,u,i,a);return n.runWebGLProgram(p,[o],o.dtype)}};class oG{constructor(e,t,n){this.variableNames=["dy"],this.outputShape=[],this.outputShape=t;const[,r,o]=t,[,i,a]=e,s=[n&&i>1?r-1:r,n&&a>1?o-1:o],l=[n&&i>1?i-1:i,n&&a>1?a-1:a],u=s[0]/l[0],p=s[1]/l[1],c=1/u,d=1/p,h=2*Math.ceil(c)+2,f=2*Math.ceil(d)+2;this.userCode=`\n      void main() {\n        ivec4 coords = getOutputCoords();\n        int b = coords[0];\n        int d = coords[3];\n        int r = coords[1];\n        int c = coords[2];\n\n        float accumulator = 0.0;\n\n        const float heightScale = float(${u});\n        const float widthScale = float(${p});\n\n        const float invHeightScale = float(${c});\n        const float invWidthScale = float(${d});\n\n        const int winHeight = int(${h});\n        const int winWidth = int(${f});\n\n        // Compute bounds for where in dy we will look\n        float startRLerp = floor(float(r) * invHeightScale);\n        int startDyR = int(floor(startRLerp - float(winHeight / 2)));\n\n        float startCLerp = floor(float(c) * invWidthScale);\n        int startDyC = int(floor(startCLerp - float(winWidth / 2)));\n\n        // Loop over dy\n        for (int dyROffset = 0; dyROffset < winHeight; dyROffset++) {\n          int dyR = dyROffset + startDyR;\n\n          // Guard against the window exceeding the bounds of dy\n          if (dyR < 0 || dyR >= ${i}) {\n            continue;\n          }\n\n          for (int dyCOffset = 0; dyCOffset < winWidth; dyCOffset++) {\n            int dyC = dyCOffset + startDyC;\n\n            // Guard against the window exceeding the bounds of dy\n            if (dyC < 0 || dyC >= ${a}) {\n              continue;\n            }\n\n            float sourceFracRow =\n              float(${s[0]}) *\n                (float(dyR) / float(${l[0]}));\n\n            float sourceFracCol =\n                float(${s[1]}) *\n                  (float(dyC) / float(${l[1]}));\n\n            int sourceNearestRow = int(min(\n                float(int(${r}) - 1),\n                ${n} ? float(round(sourceFracRow)) :\n                                  float(floor(sourceFracRow))));\n\n            int sourceNearestCol = int(min(\n                float(int(${o}) - 1),\n                ${n} ? float(round(sourceFracCol)) :\n                                  float(floor(sourceFracCol))));\n\n            if (r == sourceNearestRow && c == sourceNearestCol) {\n              accumulator += getDy(b, dyR, dyC, d);\n            }\n          }\n        }\n        // End loop over dy\n\n        setOutput(accumulator);\n      }\n    `}}const iG={kernelName:jn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{images:o,dy:i}=t,{alignCorners:a}=r,s=new oG(i.shape,o.shape,a);return n.runWebGLProgram(s,[i],i.dtype)}};class aG{constructor(e,t){this.variableNames=["x"];const n=e.length;if(n>4)throw new Error(`WebGL backend: Reverse of rank-${n} tensor is not yet supported`);if(this.outputShape=e,1===n)return void(this.userCode=`\n        void main() {\n          int coord = getOutputCoords();\n          setOutput(getX(${e[0]} - coord - 1));\n        }\n      `);const r=e.map((n,r)=>(n=>-1!==t.indexOf(n)&&1!==e[n]?`${e[n]} - coords[${n}] - 1`:`coords[${n}]`)(r)).join(","),o=mP(n);this.userCode=`\n      void main() {\n        ${o} coords = getOutputCoords();\n        setOutput(getX(${r}));\n      }\n    `}}class sG{constructor(e,t){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0;const n=e.length;if(n>4)throw new Error(`WebGL backend: Reverse of rank-${n} tensor is not yet supported`);this.outputShape=e;const r=vL("rc",n),o=`${r[n-1]} + 1 < ${this.outputShape[n-1]}`,i=`${r[n-2]} + 1 < ${this.outputShape[n-2]}`,a=mP(n);function s(n){const r=e.map((r,o)=>function(n,r){return-1!==t.indexOf(n)&&1!==e[n]?`${e[n]} - ${r[n]} - 1`:`${r[n]}`}(o,n));return`getChannel(getX(${r.join(",")}), vec2(${r.slice(-2).join(",")}))`}this.userCode=1===n?`\n        void main(){\n          int rc = getOutputCoords();\n          vec4 result = vec4(0.);\n          result.r = getChannel(getX(${e[0]} - rc - 1),\n            ${e[0]} - rc - 1);\n          if(${o}){\n              result.g = getChannel(getX(${e[0]} - (rc  + 1) - 1),\n                ${e[0]} - (rc  + 1) - 1);\n          }\n          setOutput(result);\n        }\n      `:`\n        void main() {\n          ${a} rc = getOutputCoords();\n          vec4 result = vec4(0.);\n          result.r = ${function(e){return s(e)}(r.slice())};\n          if(${o}){\n            result.g = ${function(e){return e[n-1]="("+e[n-1]+" + 1)",s(e)}(r.slice())};\n          }\n          if(${i}) {\n            result.b = ${function(e){return e[n-2]="("+e[n-2]+" + 1)",s(e)}(r.slice())};\n            if(${o}) {\n              result.a = ${function(e){return e[n-1]="("+e[n-1]+" + 1)",e[n-2]="("+e[n-2]+" + 1)",s(e)}(r.slice())};\n            }\n          }\n          setOutput(result);\n        }\n    `}}const lG={kernelName:Dn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{dims:i}=r,a=o.shape.length,s=re(i,o.shape);if(0===a)return qL({inputs:{x:o},backend:n});const l=ke().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new sG(o.shape,s):new aG(o.shape,s);return n.runWebGLProgram(l,[o],o.dtype)}};class uG{constructor(e,t){this.variableNames=["Image"],this.outputShape=[],this.customUniforms=[{name:"params",type:"vec4"}];const n=e[1],r=e[2];this.outputShape=e;let o="";o="number"==typeof t?`float outputValue = ${t.toFixed(2)};`:`\n        vec3 fill = vec3(${t.join(",")});\n        float outputValue = fill[coords[3]];`,this.userCode=`\n        void main() {\n          ivec4 coords = getOutputCoords();\n          int x = coords[2];\n          int y = coords[1];\n          float coordXFloat = (float(x) - params[0]) * params[3] -\n            (float(y) - params[1]) * params[2];\n          float coordYFloat = (float(x) - params[0]) * params[2] +\n            (float(y) - params[1]) * params[3];
2\n          int coordX = int(round(coordXFloat + params[0]));\n          int coordY = int(round(coordYFloat + params[1]));\n          ${o}\n          if(coordX >= 0 && coordX < ${r} && coordY >= 0 && coordY < ${n}) {\n            outputValue = getImage(coords[0], coordY, coordX, coords[3]);\n          }\n          setOutput(outputValue);\n        }\n    `}}const pG={kernelName:xr,backendName:"webgl",kernelFunc:({inputs:e,attrs:t,backend:n})=>{const{image:r}=e,{radians:o,fillValue:i,center:a}=t,s=n,l=new uG(r.shape,i),[u,p]=wl(a,r.shape[1],r.shape[2]),c=[[u,p,Math.sin(o),Math.cos(o)]];return s.runWebGLProgram(l,[r],r.dtype,c)}},cG=oW({opSnippet:"\n  // OpenGL ES does not support round function.\n  // The algorithm is based on banker's rounding.\n  float base = floor(x);\n  if ((x - base) < 0.5) {\n    return floor(x);\n  } else if ((x - base) > 0.5) {\n    return ceil(x);\n  } else {\n    if (mod(base, 2.0) == 0.0) {\n      return base;\n    } else {\n      return base + 1.0;\n    }\n  }\n"}),dG={kernelName:On,backendName:"webgl",kernelFunc:cG},hG=oW({opSnippet:"return inversesqrt(x);",cpuKernelImpl:aL}),fG={kernelName:Rn,backendName:"webgl",kernelFunc:hG};class gG{constructor(e,t,n,r,o,i,a=!0){this.variableNames=["updates","indices","defaultValue"],this.outputShape=i;const s=mP(o.length),l=mP(i.length);let u="";1===n?u="i":2===n&&(u="i, j");const p=`getIndices(${u})`;let c="";1===r?c="i":2===r&&(c="i, coords[1]");const d=`getUpdates(${c})`,h=t>1?"strides[j]":"strides";this.userCode=`\n        ${s} strides = ${s}(${o});\n\n        void main() {\n          ${l} coords = getOutputCoords();\n          float sum = 0.0;\n          bool found = false;\n          for (int i = 0; i < ${e}; i++) {\n            int flattenedIndex = 0;\n            for (int j = 0; j < ${t}; j++) {\n              int index = round(${p});\n              flattenedIndex += index * ${h};\n            }\n            if (flattenedIndex == coords[0]) {\n              sum += ${d};\n              found = true;\n            }\n          }\n          setOutput(mix(getDefaultValue(), sum, float(found)));\n        }\n      `}}const mG={kernelName:Bn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{indices:o,updates:i}=t,{shape:a}=r,{sliceRank:s,numUpdates:l,sliceSize:u,strides:p,outputSize:c}=Nl(0,o,a),d=[c/u,u];if(0===c)return n.makeTensorInfo(a,o.dtype);const h=dW({inputs:{x:o},backend:n,attrs:{shape:[l,s]}}),f=dW({inputs:{x:i},backend:n,attrs:{shape:[l,u]}}),g=n.makeTensorInfo([],"float32",new Float32Array([0])),m=new gG(l,s,h.shape.length,f.shape.length,p,d),y=n.runWebGLProgram(m,[f,h,g],f.dtype),b=dW({inputs:{x:y},backend:n,attrs:{shape:a}});return n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(y),n.disposeIntermediateTensorInfo(g),b}};class yG{constructor(e,t,n){let r,o;if(this.variableNames=["c","a","b"],this.outputShape=t,n>4)throw Error(`Where for rank ${n} is not yet supported`);if(1===n)o="resRC",r="resRC";else{const n=["resRC.x","resRC.y","resRC.z","resRC.w"],i=[],a=[];for(let r=0;r<t.length;r++)a.push(`${n[r]}`),r<e&&i.push(`${n[r]}`);r=i.join(),o=a.join()}const i=mP(n);this.userCode=`\n      void main() {\n        ${i} resRC = getOutputCoords();\n        float cVal = getC(${r});\n        if (cVal >= 1.0) {\n          setOutput(getA(${o}));\n        } else {\n          setOutput(getB(${o}));\n        }\n      }\n    `}}const bG={kernelName:Pn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{condition:r,t:o,e:i}=t,a=new yG(r.shape.length,o.shape,o.shape.length);return n.runWebGLProgram(a,[r,o,i],po(o.dtype,i.dtype))}},$G=oW({opSnippet:`\n  // Stable and Attracting Fixed Point (0, 1) for Normalized Weights.\
2n  // see: https://arxiv.org/abs/1706.02515\n  float scaleAlpha = ${jl};\n  float scale = ${Al};\n  return (x >= 0.0) ? scale * x : scaleAlpha * (exp(x) - 1.0);\n`}),_G={kernelName:Ln,backendName:"webgl",kernelFunc:$G},wG="return 1.0 / (1.0 + exp(-1.0 * x));",xG=oW({opSnippet:wG,packedOpSnippet:wG,cpuKernelImpl:sL}),SG={kernelName:Hn,backendName:"webgl",kernelFunc:xG},vG=oW({opSnippet:"\n  if (isnan(x)) { return 0.0; }\n  return sign(x);\n"}),kG={kernelName:Vn,backendName:"webgl",kernelFunc:vG},EG=oW({opSnippet:rW+"\n  return sin(x);\n"}),IG={kernelName:Un,backendName:"webgl",kernelFunc:EG},TG=oW({opSnippet:"\n  float e2x = exp(x);\n  return (e2x - 1.0 / e2x) / 2.0;\n"}),FG={kernelName:zn,backendName:"webgl",kernelFunc:TG},NG=oW({opSnippet:"\n  float epsilon = 1.1920928955078125e-7;\n  float threshold = log(epsilon) + 2.0;\n\n  bool too_large = x > -threshold;\n  bool too_small = x < threshold;\n\n  float result;\n  float exp_x = exp(x);\n\n  if (too_large){\n    result = x;\n  }\n  else if (too_small){\n    result = exp_x;\n  }\n  else{\n    result = log(exp_x + 1.0);\n  }\n  return result;\n"}),jG={kernelName:Gn,backendName:"webgl",kernelFunc:NG},AG={kernelName:Xn,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{blockShape:i,paddings:a}=r;q(o.shape.length<=4,()=>"spaceToBatchND for rank > 4 with a WebGL backend not implemented yet");const s=i.reduce((e,t)=>e*t),l=[[0,0]];l.push(...a);for(let e=1+i.length;e<o.shape.length;++e)l.push([0,0]);const u=[],p=RH({inputs:{x:o},backend:n,attrs:{paddings:l,constantValue:0}}),c=xl(p.shape,i,s,!1),d=Sl(c.length,i.length,!1),h=vl(p.shape,i,s,!1),f=dW({inputs:{x:p},backend:n,attrs:{shape:c}}),g=xW({inputs:{x:f},backend:n,attrs:{perm:d}}),m=dW({inputs:{x:g},backend:n,attrs:{shape:h}});return u.push(p),u.push(f),u.push(g),u.forEach(e=>n.disposeIntermediateTensorInfo(e)),m}},CG={kernelName:Zn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{indices:r,values:o,denseShape:i,defaultValue:a}=t;if(1!==i.shape.length)throw new Error(`Dense shape must be a vector, saw:\n         ${i.shape}`);if(2!==r.shape.length)throw new Error(`Indices must be a matrix, saw:\n         ${r.shape}`);if(1!==o.shape.length)throw new Error(`Values must be a vector, saw:\n         ${o.shape}`);if(0!==a.shape.length)throw new Error(`Default value must be a scalar, saw:\n        ${a.shape}`);const s=n.readSync(r.dataId),l=n.readSync(o.dataId),u=n.readSync(i.dataId),p=n.readSync(a.dataId)[0],[c,d,h,f,g]=pL(s,r.shape,r.dtype,l,o.dtype,u,p);return[n.makeTensorInfo(d,r.dtype,c),n.makeTensorInfo([d[0]],o.dtype,h),n.makeTensorInfo([f.length],"bool",new Uint8Array(f.map(e=>Number(e)))),n.makeTensorInfo([g.length],r.dtype,new Int32Array(g))]}},MG={kernelName:Qn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{inputIndices:r,inputShape:o,newShape:i}=t;if(2!==r.shape.length)throw new Error(`Input indices should be a matrix but received shape ${r.shape}`);if(1!==o.shape.length)throw new Error(`Input shape should be a vector but received shape ${o.shape}`);if(1!==i.shape.length)throw new Error(`Target shape should be a vector but received shape ${i.shape}`);const a=Array.from(n.readSync(o.dataId)),s=n.readSync(r.dataId),l=Array.from(n.readSync(i.dataId)),[u,p,c]=cL(s,r.shape,r.dtype,a,l);return[n.makeTensorInfo(p,r.dtype,u),n.makeTensorInfo([c.length],i.dtype,new Int32Array(c))]}},DG={kernelName:er,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{data:r,indices:o,segmentIds:i}=t;if(r.shape.length<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(1!==o.shape.length)throw new Error(`Indices should be a vector but received shape\n              ${o.shape}`);if(1!==i.shape.length)throw new Error(`Segment ids should be a vector but received shape\n              ${i.shape}`);const a=n.readSync(r.dataId),s=n.readSync(o.dataId),l=n.readSync(i.dataId),[u,p]=dL(a,r.shape,r.dtype,s,l,!0);return n.makeTensorInfo(p,r.dtype,u)}},OG={kernelName:tr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{data:r,indices:o,segmentIds:i}=t;if(r.shape.length<1)throw new Error("Data should be at least 1 dimensional but received scalar");
vendor: 6,192 bytes, line 2
2if(1!==o.shape.length)throw new Error(`Indices should be a vector but received shape\n             ${o.shape}`);if(1!==i.shape.length)throw new Error(`Segment ids should be a vector but received shape\n             ${i.shape}`);const a=n.readSync(r.dataId),s=n.readSync(o.dataId),l=n.readSync(i.dataId),[u,p]=dL(a,r.shape,r.dtype,s,l);return n.makeTensorInfo(p,r.dtype,u)}},RG={kernelName:nr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{sparseIndices:o,sparseValues:i,defaultValue:a}=t,{outputShape:s}=r,{sliceRank:l,numUpdates:u,strides:p,outputSize:c}=Nl(0,o,s),d=new gG(u,l,o.shape.length,i.shape.length,p,[c,1],!1),h=n.runWebGLProgram(d,[i,o,a],i.dtype),f=dW({inputs:{x:h},backend:n,attrs:{shape:s}});return n.disposeIntermediateTensorInfo(h),f}},BG={kernelName:Yn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{numOrSizeSplits:i,axis:a}=r,s=re(a,o.shape)[0],l=ru(o,i,s),u=o.shape.length,p=new Array(u).fill(0),c=o.shape.slice();return l.map(e=>{const t=[...c];t[s]=e;const r=bU({inputs:{x:o},backend:n,attrs:{begin:p,size:t}});return p[s]+=e,r})}},PG="return sqrt(x);",LG=oW({opSnippet:PG,packedOpSnippet:PG,cpuKernelImpl:hL}),WG={kernelName:qn,backendName:"webgl",kernelFunc:LG},UG={kernelName:or,backendName:"webgl",kernelFunc:oW({opSnippet:"return x * x;"})},zG="return (a - b) * (a - b);",VG=iW({opSnippet:zG,packedOpSnippet:zG}),HG={kernelName:rr,backendName:"webgl",kernelFunc:VG},GG={kernelName:_r,backendName:"webgl",kernelFunc:function({inputs:e,attrs:t,backend:n}){const{x:r}=e,o=AL+`\n    return x > 0.0 ? 1.0 : float(${t.alpha});\n  `,i=new jL(r.shape,o);return n.runWebGLProgram(i,[r],r.dtype)}};class qG{constructor(e,t,n){this.variableNames=["x"],this.outputShape=n;const r=n.length,o=mP(n.length),i=mP(n.length);let a="";if(1===r)a="coords * strides + begin";else{let e=0;a=n.map((t,r)=>(e++,1===n.length?`coords * strides[${r}] + begin[${r}]`:`coords[${e-1}] * strides[${r}] + begin[${r}]`)).join(",")}this.userCode=`\n      ${o} begin = ${o}(${e});\n      ${o} strides = ${o}(${t});\n\n      void main() {\n        ${i} coords = getOutputCoords();\n        setOutput(getX(${a}));\n      }\n    `}}const KG={kernelName:ir,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{begin:i,end:a,strides:s,beginMask:l,endMask:u,ellipsisMask:p,newAxisMask:c,shrinkAxisMask:d}=r,{nonStrided:h,$begin:f,$strides:g,size:m,newShape:y,outShape:b}=zi(o.shape,i,a,s,l,u,p,c,d),$=dW({inputs:{x:o},backend:n,attrs:{shape:y}});let _;if(h){const e=bU({inputs:{x:$},backend:n,attrs:{begin:f,size:m}});_=dW({inputs:{x:e},backend:n,attrs:{shape:b}}),n.disposeIntermediateTensorInfo(e)}else if(b.some(e=>0===e))_=n.makeTensorInfo(b,o.dtype,[]);else if(n.shouldExecuteOnCPU([$])){const e=n.texData.get($.dataId).values,t=di($.shape,$.dtype,e),r=fL(b,t,g,f);_=n.makeTensorInfo(b,$.dtype,r.values)}else{const e=new qG(f,g,b);_=n.runWebGLProgram(e,[$],$.dtype)}const w=dW({inputs:{x:_},backend:n,attrs:{shape:b}});return n.disposeIntermediateTensorInfo($),n.disposeIntermediateTensorInfo(_),w}},XG={kernelName:ar,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{separator:o,nGramWidths:i,leftPad:a,rightPad:s,padWidth:l,preserveShortSequences:u}=r,{data:p,dataSplits:c}=t,d=n.readSync(p.dataId),h=n.readSync(c.dataId),[f,g]=gL(d,h,o,i,a,s,l,u);return[n.makeTensorInfo([f.length],"string",f),n.makeTensorInfo(c.shape,"int32",g)]}},YG={kernelName:sr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{skipEmpty:o}=r,{input:i,delimiter:a}=t;if("string"!==i.dtype)throw new Error("Input must be of datatype string");if(1!==i.shape.length)throw new Error(`Input must be a vector, got shape: ${i.shape}`);if(0!==a.shape.length)throw new Error(`Delimiter must be a scalar, got shape: ${a.shape}`);const s=n.readSync(i.dataId),l=n.readSync(a.dataId)[0],[u,p,c]=mL(s,l,o),d=p.length;return[n.makeTensorInfo([d,2],"int32",u),n.makeTensorInfo([d],"string",p),n.makeTensorInfo([2],"int32",new Int32Array(c))]}},JG={kernelName:lr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{numBuckets:o}=r,{input:i}=t;if("string"!==i.dtype)throw new Error("Input must be of datatype string");if(o<=0)throw new Error("Number of buckets must be at least 1");const a=n.readSync(i.dataId),s=yL(a,o);return n.makeTensorInfo(i.shape,"int32",s)}},ZG=oW({opSnippet:"return tan(x);"}),QG={kernelName:pr,backendName:"webgl",kernelFunc:ZG},eq=oW({opSnippet:"\n  float e2x = exp(-2.0 * abs(x));\n  return sign(x) * (1.0 - e2x) / (1.0 + e2x);\n"}),tq={kernelName:cr,backendName:"webgl",kernelFunc:eq};class nq{constructor(e,t){this.variableNames=["A"];const n=new Array(e.length);for(let r=0;r<n.length;r++)n[r]=e[r]*t[r];this.outputShape=n,this.rank=n.length;const r=mP(this.rank),o=function(e){const t=e.length;if(t>5)throw Error(`Tile for rank ${t} is not yet supported`);if(1===t)return`imod(resRC, ${e[0]})`;const n=["resRC.x","resRC.y","resRC.z","resRC.w","resRC.u"],r=[];for(let t=0;t<e.length;t++)r.push(`imod(${n[t]}, ${e[t]})`);return r.join()}(e);this.userCode=`\n      void main() {\n        ${r} resRC = getOutputCoords();\n        setOutput(getA(${o}));\n      }\n    `}}function rq(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{reps:i}=r;if("string"===o.dtype||o.shape.length>5){const e=n.readSync(o.dataId),t="string"===o.dtype?e.map(e=>Ur(e)):e,r=di(o.shape,o.dtype,t),a=$L(r,i);return n.makeTensorInfo(a.shape,a.dtype,a.values)}const a=new nq(o.shape,i);return n.runWebGLProgram(a,[o],o.dtype)}const oq={kernelName:dr,backendName:"webgl",kernelFunc:rq};class iq{constructor(e){this.variableNames=["x","indices"],this.customUniforms=[{name:"n",type:"int"},{name:"firstPass",type:"int"},{name:"negativeInf",type:"float"},{name:"dir",type:"int"},{name:"inc",type:"int"}],this.outputShape=e,this.userCode="\n       void main() {\n         ivec2 coords = getOutputCoords();\n         int batch = coords[0];\n         int elemIdx = coords[1];\n\n         // We compare elements pair-wise within a group of size 2 * inc.\n         // The comparing rule for each group alternates between ascending\n         // and desce
2nding. Within each group, we compare each pair at\n         // positions i and i+inc. To decide whether an element at position i\n         // is x0 or x1, we mod it by 2 * inc, if the result is smaller than\n         // inc, it is in the first half of the group, we denote it as x0,\n         // otherwise we denote it as x1.\n         // For example, as shown in the Bitonic top K paper referenced above,\n         // Figure5(a) shows that element[1] is in the\n         // second half of the group when group size is 2, but it is in the\n         // first half of the group when group size is 4.\n\n         bool isFirstInPair = imod(elemIdx, 2 * inc) < inc;\n         int i = isFirstInPair ? elemIdx : elemIdx - inc;\n\n         int i0 = firstPass == 1 ? i : int(getIndices(batch, i));\n         int i1 = firstPass == 1 ? i + inc : int(getIndices(batch, i + inc));\n         float x0 = i0 < n ? getX(batch, i0) : negativeInf;\n         float x1 = i1 < n ? getX(batch, i1) : negativeInf;\n\n         // Denotes which direction indices are in (ascending or descending).\n         bool reverse = imod(elemIdx, 2 * dir) >= dir;\n         bool isGreater = x0 > x1 || (x0 == x1 && i1 > i0);\n         if (reverse == isGreater) { // Elements in opposite order of direction\n           int iTemp = i0;\n           i0 = i1;\n           i1 = iTemp;\n         }\n         if (isFirstInPair) {\n            setOutput(float(i0));\n         } else {\n            setOutput(float(i1));\n         }\n       }\n     "}}class aq{constructor(e){this.variableNames=["x","indices"],this.customUniforms=[{name:"n",type:"int"},{name:"firstPass",type:"int"},{name:"k",type:"int"}],this.outputShape=e,this.userCode="\n    void main() {\n         // Takes max of indices (0, k), (1, k + 1), (2, k + 2) ...\n         ivec2 coords = getOutputCoords();\n         int batch = coords[0];\n         int elemIdx = coords[1];\n\n         // The output size is half of the previous size.\n         // If the previous sequence is | | | | _ _ _ _  | | | |  _ _ _ _ (k=4),\n         // we only need to output the indices at positions |, the indices at\n         // positions _ can be thrown away, see Figure5(b) After Phase 2\n         // (Merge phase) in the Bitonic Top K paper referenced above.\n         // For example, the paper shows we only need to output the orange bars.\n         // The output sequence should look like this | | | | | | | |.\n         // Because the sequence is halved, to map the output index back\n         // to the previous sequence to find the corresponding value,\n         // we need to double the index. When we double the index,\n         // we basically interpolate a position, so 2i looks like\n         // | _ | _ | _ | _ | _ | _ | _. We move the | to the first k position\n         // of each 2k positions by - elemIdx % k. E.g. for output at\n         // index 4,5,6,7, we want to get the corresponding element at\n         // original index 8,9,10,11, for output at index 8,9,10,11,\n         // we want to get the corresponding element at original index\n         // 16,17,18,19, so on and so forth.\n\n         int i = elemIdx < k ? elemIdx : (elemIdx * 2 - imod(elemIdx, k));\n         int i0 = firstPass == 1 ? i : int(getIndices(batch, i));\n         int i1 = firstPass == 1 ? i + k : int(getIndices(batch, i + k));\n\n         float x0 = getX(batch, i0);\n         float x1 = i1 < n ? getX(batch, i1) : x0;\n\n         setOutput(x0 >= x1 ? float(i0) : float(i1));\n       }\n     "}}function sq(e,t){null!==t&&e.disposeIntermediateTensorInfo(t)}function lq(e){let t=1;for(;t<e;)t*=2;return t}const uq={kernelName:hr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{k:i,sorted:a}=r,s=ke().getNumber("TOPK_LAST_DIM_CPU_HANDOFF_SIZE_THRESHOLD"),l=ke().getNumber("TOPK_K_CPU_HANDOFF_THRESHOLD"),u=o.shape,p=u[u.length-1];if(n.shouldExecuteOnCPU([o])||p<s||i>l){const e=n.readSync(o.dataId),[t,r]=_L(e,u,o.dtype,i,a);return[n.makeTensorInfo(t.shape,t.dtype,t.values),n.makeTensorInfo(r.shape,r.dtype,r.values)]}if(0===i)return u[u.length-1]=0,[n.makeTensorInfo(u,o.dtype,[]),n.makeTensorInfo(u,"int32",[])];if(1===p)return[o,Xz({attrs:{shape:u,dtype:"int32",value:0},backend:n})];const c=n.texData.get(o.dataId),d=null!==c&&c.isPacked,h=d?n.unpackTensor(o):o,f=J(u)/p,g=dW({inputs:{x:h},attrs:{shape:[f,p]},backend:n});d&&sq(n,h);const m=lq(i),y=lq(p);let b=null;const $=()=>null===b?[g,g]:[g,b],_=(e,t,r)=>
vendor: 3,109 bytes, line 2
2{const o=$(),i=new iq(r),a=[[p],[null===b?1:0],[Number.NEGATIVE_INFINITY],[e],[t]],s=b;b=n.runWebGLProgram(i,o,"int32",a),sq(n,s)};for(let e=1;e<m;e*=2){const t=2*e;for(let n=e;n>=1;n/=2)_(t,n,[f,y])}for(let e=y;e>m;e/=2){const t=$(),r=new aq([f,e/2]),o=[[p],[null===b?1:0],[m]],i=b;b=n.runWebGLProgram(r,t,"int32",o),sq(n,i);const a=m/2,s=2*a;for(let e=a;e>=1;e/=2)_(s,e,b.shape)}let w=b;b=bU({inputs:{x:b},backend:n,attrs:{begin:0,size:[f,i]}}),sq(n,w);let x=hV({inputs:{x:g,indices:b},backend:n,attrs:{axis:1,batchDims:1}});sq(n,g);const S=u.slice(0,-1);S.push(i),w=b,b=dW({inputs:{x:b},attrs:{shape:S},backend:n}),sq(n,w);const v=x;return x=dW({inputs:{x},attrs:{shape:S},backend:n}),sq(n,v),[x,b]}};class pq{constructor(e,t,n,r,o,i){this.variableNames=["Image","Transforms"],this.outputShape=i;const a="nearest"===n?1:2;let s;switch(r){case"constant":default:s=1;break;case"reflect":s=2;break;case"wrap":s=3;break;case"nearest":s=4}this.userCode=`\n            float mapCoord(float outCoord, float len) {\n              float inCoord = outCoord;\n              if(${s} == 2) {\n                if (inCoord < 0.0) {\n                  if (len <= 1.0) {\n                    inCoord = 0.0;\n                  } else {\n                    float sz2 = 2.0 * len;\n                    if (inCoord < sz2) {\n                      inCoord = sz2 * float(int(float(-inCoord / sz2))) +\n                      inCoord;\n                    }\n                    inCoord = inCoord < -len ? inCoord + sz2 : -inCoord - 1.0;\n                  }\n                } else if (inCoord > len - 1.0) {\n                  if (len <= 1.0) {\n                    inCoord = 0.0;\n                  } else {\n                    float sz2 = 2.0 * len;\n                    inCoord -= sz2 * float(int(float(inCoord / sz2)));\n                    if (inCoord >= len) {\n                      inCoord = sz2 - inCoord - 1.0;\n                    }\n                  }\n                }\n                return clamp(inCoord, 0.0, len - 1.0);\n              } else if (${s} == 3) {\n                if (inCoord < 0.0) {\n                  if (len <= 1.0) {\n                    inCoord = 0.0;\n                  } else {\n                    float sz = len - 1.0;\n                    inCoord += len * (float(int(float(-inCoord / sz))) + 1.0);\n                  }\n                } else if (inCoord > len - 1.0) {\n                  if (len <= 1.0) {\n                    inCoord = 0.0;\n                  } else {\n                    float sz = len - 1.0;\n                    inCoord -= len * float(int(float(inCoord / sz)));\n                  }\n                }\n                return clamp(inCoord, 0.0, len - 1.0);\n              } else if (${s} == 4) {\n                return clamp(outCoord, 0.0, len - 1.0);\n              } else {\n                return outCoord;\n              }\n            }\n\n            float readWithFillValue(int batch, int coordY, int coordX,\n              int channel) {\n              float outputValue;\n              if (0 <= coordY && coordY < ${e} && 0 <= coordX && coordX < ${t}
2) {\n                  outputValue = getImage(batch, coordY, coordX, channel);\n              } else {\n                outputValue = float(${o});\n              }\n              return outputValue;\n            }\n\n            void main() {\n              ivec4 coords = getOutputCoords();\n              float outputValue;\n              int batch = coords[0];\n              int x = coords[2];\n              int y = coords[1];\n              int channel = coords[3];\n              float xf = float(x);\n              float yf = float(y);\n              float a1 = getTransforms(batch, 0);\n              float a2 = getTransforms(batch, 1);\n              float a3 = getTransforms(batch, 2);\n              float b1 = getTransforms(batch, 3);\n              float b2 = getTransforms(batch, 4);\n              float b3 = getTransforms(batch, 5);\n              float c1 = getTransforms(batch, 6);\n              float c2 = getTransforms(batch, 7);\n              float projection = c1 * xf + c2 * yf + 1.0;\n              if (projection == 0.0) {\n                outputValue = float(${o});\n              } else {\n                float inX = (a1 * xf + a2 * yf + a3) / projection;\n                float inY = (b1 * xf + b2 * yf + b3) / projection;\n                float mapX = mapCoord(inX, float(${t}));\n                float mapY = mapCoord(inY, float(${e}));\n\n                if (${a} == 1) {\n                  int coordY = int(round(mapY));
2\n                  int coordX = int(round(mapX));\n                  outputValue = readWithFillValue(batch, coordY, coordX,\n                    channel);\n                } else {\n                  float yFloor = floor(mapY);\n                  float xFloor = floor(mapX);\n                  float yCeil = yFloor + 1.0;\n                  float xCeil = xFloor + 1.0;\n                  float valueYFloor = (xCeil - mapX) *\n                  readWithFillValue(batch, int(yFloor), int(xFloor), channel) +\n                  (mapX - xFloor) *\n                  readWithFillValue(batch, int(yFloor), int(xCeil), channel);\n                  float valueYCeil = (xCeil - mapX) *\n                  readWithFillValue(batch, int(yCeil), int(xFloor), channel) +\n                  (mapX - xFloor) *\n                  readWithFillValue(batch, int(yCeil), int(xCeil), channel);\n                  outputValue = (yCeil - mapY) * valueYFloor +\n                  (mapY - yFloor) * valueYCeil;\n                }\n              }\n              setOutput(outputValue);\n            }\n        `}}const cq={kernelName:fr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{image:o,transforms:i}=t,{interpolation:a,fillMode:s,fillValue:l,outputShape:u}=r,[p,c,d,h]=o.shape,[f,g]=null!=u?u:[c,d],m=new pq(c,d,a,s,l,[p,f,g,h]);return n.runWebGLProgram(m,[o,i],"float32")}},dq={kernelName:mr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,attrs:n,backend:r}=e,{axis:o}=n,{x:i}=t;QB(i,"unique"),console.warn("WARNING: ","UI might be locked temporarily as data is being downloaded");const a=r.readSync(i.dataId),{outputValues:s,outputShape:l,indices:u}=xL(a,o,i.shape,i.dtype);return[r.makeTensorInfo(l,i.dtype,s),r.makeTensorInfo([u.length],"int32",u)]}},hq={kernelName:yr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{value:o}=t;let{axis:i}=r;i<0&&(i+=o.shape.length);const a=o,s=a.shape.length,l=o.shape[i],u=new Array(s-1);let p=0;for(let e=0;e<s;e++)e!==i&&(u[p++]=a.shape[e]);const c=[],d=new Array(s).fill(0),h=a.shape.slice();h[i]=1;const f=new Array(l);for(let e=0;e<f.length;e++){d[i]=e;const t=bU({inputs:{x:a},backend:n,attrs:{begin:d,size:h}}),r=dW({inputs:{x:t},backend:n,attrs:{shape:u}});f[e]=r,c.push(t)}return c.forEach(e=>n.disposeIntermediateTensorInfo(e)),f}};class fq{constructor(e,t){this.variableNames=["x","segmentIds"];const n=e.windowSize,r=e.batchSize,o=e.inSize,i=e.numSegments,a=i*Math.ceil(o/n);this.outputShape=[r,a];const s=4*Math.floor(n/4),l=n%4,u="\n        sumValue += dot(values, segFilter);\n    ";let p="";o%n>0&&(p=`\n        if (inIdx < 0 || inIdx >= ${o}) {\n          return initializationValue;\n        }\n      `);let c="";o%n>0&&(c=`\n        if (inIdx < 0 || inIdx >= ${o}) {\n          return -1.0;\n        }\n      `),this.userCode=`\n      const float initializationValue = 0.0;\n\n      float getValue(int batch, int inIdx) {\n        ${p}\n        return getX(batch, inIdx);\n      }\n\n      float getSegmentIdAtIndex(int inIdx) {\n        ${c}\n        return getSegmentIds(inIdx);\n      }\n\n      void main() {\n        ivec2 coords = getOutputCoords();\n        int batch = coords[0];\n        int outIdx = coords[1];\n        int inOffset = int(floor(float(outIdx) / float(\n          ${i})) * float(${n}));\n        int currentSeg = int(mod(float(outIdx), float(${i})));\n\n        float sumValue = 0.0;\n\n        for (int i = 0; i < ${s}; i += 4) {\n          int inIdx = inOffset + i;\n          vec4 values = vec4(\n            getValue(batch, inIdx),\n            getValue(batch, inIdx + 1),\n            getValue(batch, inIdx + 2),\n            getValue(batch, inIdx + 3)\n          );\n\n          vec4 segFilter = vec4(\n            int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n            int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n            int(getSegmentIdAtIndex(inIdx + 2)) == currentSeg ? 1 : 0,\n            int(getSegmentIdAtIndex(inIdx + 3)) == currentSeg ? 1 : 0\n          );\n\n          ${u}\n        }\n\n        int inIdx = inOffset + ${s};\n        if (${1===l}) {\n          vec4 values = vec4(\n            getValue(batch, inIdx),\n            initializationValue,\n            initializationValue,\n            initializationValue\n          );\n\n          int inIdxSeg = int(getSegmentIdAtIndex(inIdx));\n\n          vec4 segFilter = vec4(\n            int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n            0,\n            0,\n            0\n          );\n\n          ${u}\n        } else if (${2===l}) {\n          vec4 values = vec4(\n            getValue(batch, inIdx),\n            getValue(batch, inIdx + 1),\n            initializationValue,\n            initializationValue\n          );\n\n          vec4 segFilter = vec4(\n            int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n            int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n              0,\n              0\n          );\n\n          ${u}\n        } else if (${3===l}) {\n          vec4 values = vec4(\n            getValue(batch, inIdx),\n            getValue(batch, inIdx + 1),\n            getValue(batch, inIdx + 2),\n            initializationValue\n          );\n\n          vec4 segFilter = vec4(\n            int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n            int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n            int(getSegmentIdAtIndex(inIdx + 2)) == currentSeg ? 1 : 0,\n            0\n          );\n\n          ${u}\n        }\n        setOutput(sumValue);\n      }\n    `}}const gq=[zV,HV,kW,IW,FW,jW,MW,RW,BW,PW,HW,GW,KW,YW,eU,ZW,nU,aU,iU,uU,pU,cU,fU,_U,wU,EU,FU,AU,DU,YL,zU,ez,tz,XU,rz,oz,nz,az,lz,pz,fz,gz,yz,Sz,vz,_z,Ez,Tz,Fz,jz,Az,Mz,Oz,Pz,Wz,Vz,qz,Yz,Zz,tV,rV,aV,lV,uV,cV,fV,mV,bV,KL,$V,LU,wV,SV,kV,QL,IV,FV,NV,MV,AV,OV,BV,LV,qV,JV,YV,eH,tH,nH,XV,rH,oH,aH,uH,cH,_H,cW,xH,vH,EH,TH,SU,NH,CH,MH,BH,LH,nW,WH,zH,kU,fH,HH,XH,qH,hW,ZH,eG,rG,iG,lG,pG,dG,fG,mG,bG,_G,SG,kG,IG,FG,$U,$H,jG,AG,CG,MG,DG,OG,RG,BG,WG,UG,HG,GG,KG,XG,YG,JG,yH,wW,QG,tq,oq,uq,cq,SW,dq,hq,{kernelName:br,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o,segmentIds:i}=t,{numSegments:a}=r,s=o.shape.length,l=[];let u=0;const p=os([u],s);let c=o;null!=p&&(c=xW({inputs:{x:o},backend:n,attrs:{perm:p}}),l.push(c),u=as(1,s)[0]);const d=iu(c.shape,u,a),h=J([c.shape[u]]),f=dW({inputs:{x:c},backend:n,attrs:{shape:[-1,h]}});l.push(f);const g=co(o.dtype),m=(e,t,r,o,i)=>{const a=e.shape[0],s=e.shape[1],u=ou(s,i),p=new fq({windowSize:u,inSize:s,batchSize:a,numSegments:i}
2,t),c=n.compileAndRun(p,[e,r],o);if(l.push(c),c.shape[1]===i)return c;const d=UH({backend:n,attrs:{start:0,stop:i,step:1,dtype:"float32"}}),h=rq({inputs:{x:d},backend:n,attrs:{reps:[s/u]}});return l.push(d),l.push(h),m(c,t,h,o,i)},y=dW({inputs:{x:m(f,"unsortedSegmentSum",i,g,a)},backend:n,attrs:{shape:d}});let b=y;if(null!=p){l.push(y);const e=is(p);b=xW({inputs:{x:b},backend:n,attrs:{perm:e}})}return l.forEach(e=>n.disposeIntermediateTensorInfo(e)),b}},AH];for(const e of gq)jr(e);var mq,yq;let bq;!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"}(mq||(mq={})),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",e[e.elu=6]="elu"}(yq||(yq={}));const $q={kernelName:gm,backendName:"wasm",setupFunc:function(e){bq=e.wasm.cwrap(gm,null,["number","array","number","number","array","number","number","number","number","number","number","number","number"])},kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{a:o,b:i,bias:a,preluActivationWeights:s}=t;if("float32"!==o.dtype||"float32"!==i.dtype)throw new Error("_FusedMatMul for non non-float32 tensors not yet supported.");const{transposeA:l,transposeB:u,activation:p,leakyreluAlpha:c}=r,d=n.dataIdMap.get(o.dataId).id,h=n.dataIdMap.get(i.dataId).id;let f=0;if(null!=a){const e=n.dataIdMap.get(a.dataId);if(1!==e.shape.length)throw new Error(`_FusedMatMul only supports rank-1 bias but got rank ${e.shape.length}.`);f=e.id}const g=null==s?0:n.dataIdMap.get(s.dataId).id,m=yq[p];if(null==m)throw new Error(`${p} activation not yet supported for FusedConv2D in the wasm backend.`);const y=l?o.shape[2]:o.shape[1],b=u?i.shape[1]:i.shape[2],$=o.shape[0],_=n.makeOutput([$,y,b],o.dtype),w=n.dataIdMap.get(_.dataId).id,x=new Uint8Array(new Int32Array(o.shape).buffer),S=new Uint8Array(new Int32Array(i.shape).buffer);return bq(d,x,o.shape.length,h,S,i.shape.length,l,u,m,f,g,c||0,w),_}};function _q(e,t){let n;return{kernelName:e,backendName:"wasm",setupFunc:function(t){n=t.wasm.cwrap(e,null,["number","number","number"])},kernelFunc:function(e){const{backend:r,inputs:{x:o}}=e,i=r.dataIdMap.get(o.dataId).id,a=r.makeOutput(o.shape,t||o.dtype),s=r.dataIdMap.get(a.dataId).id;return 0===Bd(a.shape)||n(i,mq[o.dtype],s),a}}}const wq=_q(yh);function xq(e,t,n){let r;return{kernelName:e,backendName:"wasm",setupFunc:function(t){r=t.wasm.cwrap(e,null,["number","array","number","number","array","number","number","number"])},kernelFunc:function(o){const{backend:i,inputs:a}=o,{a:s,b:l}=a,u=i.dataIdMap.get(s.dataId).id,p=i.dataIdMap.get(l.dataId).id,c=null!=n?n:s.dtype,d=D$(s.shape,l.shape),h=i.makeOutput(d,c);if(0===Bd(d))return h;const f=new Uint8Array(new Int32Array(s.shape).buffer),g=new Uint8Array(new Int32Array(l.shape).buffer),m=i.dataIdMap.get(h.dataId).id,y=()=>r(u,f,s.shape.length,p,g,l.shape.length,mq[s.dtype],m);if(t&&"float32"===s.dtype)return y(),h;const b=C$(s.shape,d),$=C$(l.shape,d),_=b.every((e,t)=>e===t),w=$.every((e,t)=>e===t);if(_&&w)return y(),h;throw new Error(`Broadcasting along outer dims is not yet supported for ${s.dtype} ${e}.`)}}}const Sq=xq(_h,!0);let vq;const kq={kernelName:wh,backendName:"wasm",setupFunc:function(e){vq=e.wasm.cwrap(wh,null,["array","number","number","number"])},kernelFunc:function(e){const{inputs:t,backend:n}=e,r=n.makeOutput(t[0].shape,t[0].dtype);if(0===Bd(r.shape))return r;const o=t.map(e=>n.dataIdMap.get(e.dataId).id),i=new Uint8Array(new Int32Array(o).buffer),a=n.dataIdMap.get(r.dataId).id;return vq(i,o.length,mq[r.dtype],a),r}};function Eq(e){const{inputs:{x:t},backend:n}=e,r=n.makeOutput(t.shape,t.dtype),o=n.typedArrayFromHeap(t);return n.typedArrayFromHeap(r).set(o),r}const Iq={kernelName:Tf,backendName:"wasm",kernelFunc:Eq};let Tq;function Fq(e){const{inputs:t,backend:n,attrs:r}=e,[o,i]=function(e,t){const n=[],r=[];for(let o=0;o<e.length;++o)1!==e[o]&&n.push(e[o]),1!==e[t[o]]&&r.push(t[o]);for(let e=0;e<r.length;++e){let t=-1;for(let n=0;n<r.length;++n)r[n]>=e&&(-1===t||r[t]>r[n])&&(t=n);r[t]=e}return[n,r]}(t.x.shape,r.perm);let a=!0;for(let e=0;e<i.length;e++)i[e]!==e&&(a=!1);const s=function(e,t){const n=new Array(e.length);for(let r=0;r<n.length;r++)n[r]=e[t[r]];return n}(t.x.shape,r.perm),l={dataId:t.x.dataId,shape:o,dtype:t.x.dtype};if(a){const e=Eq({inputs:t,backend:n});return e.shape=s,e}const u=n.makeOutput(s,l.dtype),p=n.dataIdMap.get(l.dataId).id,c=n.dataIdMap.get(u.dataId).id,d=new Uint8Array(new Int32Array(i).buffer),h=new Uint8Array(new Int32Array(l.shape).buffer);return Tq(p,h,l.shape.length,mq[l.dtype],c,d,i.length),u}const Nq={kernelName:sm,backendName:"wasm",kernelFunc:Fq,setupFunc:function(e){Tq=e.wasm.cwrap(sm,null,["number","array","number","number","number","array","number"])}};function jq(e,t,n){const r=e.shape,o=e.shape.length,i=zd(t,r);let a=i;const s=c_(a,o);let l=null,u=!1;if(null!=s){const t=new Array(o);for(let e=0;e<t.length;e++)t[e]=r[s[e]];a=h_(a.length,o),l=Fq({inputs:{x:e},attrs:{perm:s},backend:n});const i=n.dataIdMap.get(e.dataId).id;n.dataIdMap.get(l.dataId).id!==i&&(u=!0)}return{transposed:l,originalAxes:i,axes:a,inputWasTransposed:u}}let Aq;const Cq={kernelName:xh,backendName:"wasm",setupFunc:function(e){Aq=e.wasm.cwrap(xh,null,["number, number, number"])},kernelFunc:function(e){const{backend:t,inputs:n,attrs:r}=e,{axis:o,keepDims:i}=r,{x:a}=n;let s=t.dataIdMap.get(a.dataId).id,l=a;const{transposed:u,axes:p,originalAxes:c,inputWasTransposed:d}=jq(a,o,t);d&&(l=u,s=t.dataIdMap.get(u.dataId).id),p_("all",p,l.shape.length);const[h,f]=l_(l.shape,p),g=Bd(f),m=t.makeOutput(h,a.dtype);if(0!==Bd(l.shape)){const e=t.dataIdMap.get(m.dataId).id;Aq(s,g,e)}if(d&&t.disposeData(u.dataId),i){const e=u_(m.shape,c);m.shape=e}return m}};let Mq;const Dq={kernelName:Sh,backendName:"wasm",setupFunc:function(e){Mq=e.wasm.cwrap(Sh,null,["number, number, number"])},kernelFunc:function(e){const{backend:t,inputs:n,attrs:r}=e,{axis:o,keepDims:i}=r,{x:a}=n;let s=t.dataIdMap.get(a.dataId).id,l=a;const{transposed:u,axes:p,originalAxes:c,inputWasTransposed:d}=jq(a,o,t);d&&(l=u,s=t.dataIdMap.get(u.dataId).id),p_("any",p,l.shape.length);const[h,f]=l_(l.shape,p),g=Bd(f),m=t.makeOutput(h,a.dtype);if(0!==Bd(l.shape)){const e=t.dataIdMap.get(m.dataId).id;Mq(s,g,e)}
2if(d&&t.disposeData(u.dataId),i){const e=u_(m.shape,c);m.shape=e}return m}};let Oq;const Rq={kernelName:vh,backendName:"wasm",kernelFunc:function(e){const{backend:t,inputs:n,attrs:r}=e,{axis:o}=r,{x:i}=n,a=t.dataIdMap.get(i.dataId).id;let s=a,l=i;const{transposed:u,axes:p,inputWasTransposed:c}=jq(i,o,t);if(c){const e=t.dataIdMap.get(u.dataId).id;e!==a&&(l=u,s=e)}const d=l.shape.slice(0,-1),h=t.makeOutput(d,"int32"),f=t.dataIdMap.get(h.dataId).id,g=Bd(h.shape),m=l.shape[p[0]];return Oq(s,mq[l.dtype],g,m,f),c&&t.disposeData(u.dataId),h},setupFunc:function(e){Oq=e.wasm.cwrap(vh,null,["number","number","number","number","number"])}};let Bq;const Pq={kernelName:jh,backendName:"wasm",setupFunc:function(e){Bq=e.wasm.cwrap(jh,null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number"])},kernelFunc:function(e){const{inputs:t,attrs:n,backend:r}=e,o=t.x,i=r.dataIdMap.get(o.dataId).id,{filterSize:a,strides:s,pad:l,dimRoundingMode:u}=n,p=Jb(o.shape,a,s,1,l,u),c=p.filterHeight,d=p.filterWidth,h=p.padInfo.top,f=p.padInfo.right,g=p.padInfo.bottom,m=p.padInfo.left,y=p.strideHeight,b=p.strideWidth,$=p.inChannels;if("channelsLast"!==p.dataFormat)throw new Error(`wasm backend does not support dataFormat:'${p.dataFormat}'. Please use 'channelsLast'.`);if(1!==p.dilationWidth||1!==p.dilationHeight)throw new Error(`was backend only supports average pooling with dilation = [1, 1], got [${p.dilationHeight}, ${p.dilationWidth}].`);const _=r.makeOutput(p.outShape,"float32"),w=r.dataIdMap.get(_.dataId).id;return Bq(i,o.shape[0],o.shape[1],o.shape[2],c,d,h,f,g,m,y,b,$,w),_}};function Lq(e){const{inputs:t,attrs:n}=e,{x:r}=t,{shape:o}=n,i=Bd(r.shape),a=Ud(o,i);return Md(i===Bd(a),()=>`new shape: ${a}, old shape: ${r.shape}. New shape and old shape must have the same number of elements.`),e.backend.incRef(r.dataId),{dataId:r.dataId,shape:a,dtype:r.dtype}}const Wq={kernelName:wg,backendName:"wasm",kernelFunc:Lq};let Uq;const zq={kernelName:Dh,backendName:"wasm",setupFunc:function(e){Uq=e.wasm.cwrap(Dh,null,["number","array","number","number","array","number","number","number","number"])},kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{a:o,b:i}=t,{transposeA:a,transposeB:s}=r;if("float32"!==o.dtype||"float32"!==i.dtype)throw new Error("BatchMatMul for non non-float32 tensors not yet supported.");const l=o.shape.length,u=i.shape.length,p=a?o.shape[l-2]:o.shape[l-1],c=s?i.shape[u-1]:i.shape[u-2],d=a?o.shape[l-1]:o.shape[l-2],h=s?i.shape[u-2]:i.shape[u-1],f=o.shape.slice(0,-2),g=i.shape.slice(0,-2),m=Bd(f),y=Bd(g);Md(l>=2&&u>=2&&(m===y||1===m||1===y),()=>`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}).`);const b=(m>y?o.shape.slice(0,-2):i.shape.slice(0,-2)).concat([d,h]);Md(p===c,()=>`Error in matMul: inner shapes (${p}) and (${c}) of Tensors with shapes ${o.shape} and ${i.shape} and transposeA=${a} and transposeB=${s} must match.`);const $=s?[y,h,c]:[y,c,h],_=Lq({inputs:{x:o},backend:n,attrs:{shape:a?[m,p,d]:[m,d,p]}}),w=Lq({inputs:{x:i},backend:n,attrs:{shape:$}}),x=n.dataIdMap.get(_.dataId).id,S=n.dataIdMap.get(w.dataId).id,v=a?_.shape[2]:_.shape[1],k=s?w.shape[1]:w.shape[2],E=Math.max(m,y),I=n.makeOutput([E,v,k],_.dtype),T=n.dataIdMap.get(I.dataId).id,F=new Uint8Array(new Int32Array(_.shape).buffer),N=new Uint8Array(new Int32Array(w.shape).buffer);
vendor: 1,919 bytes, line 2
2return Uq(x,F,_.shape.length,S,N,w.shape.length,a,s,T),n.disposeData(_.dataId),n.disposeData(w.dataId),I.shape=b,I}};function Vq(e,t,n,r,o){const i=Tb(r,t,n),a=Bd(n),s=Zd(r);if(i){const n=Fb(t,s);return"string"===o?e.slice(n,n+a):e.subarray(n,n+a)}const l=db(r,o,"string"===o?qx(e):e),u=db(n,o);for(let e=0;e<u.size;++e){const n=u.indexToLoc(e),r=n.map((e,n)=>e+t[n]);u.set(l.get(...r),...n)}return"string"===o?Kx(u.values):u.values}function Hq(e){const{inputs:{x:t},attrs:{begin:n,size:r},backend:o}=e,[i,a]=Nb(t,n,r),s=Tb(t.shape,i,a),l=o.readSync(t.dataId),u=o.makeOutput(a,t.dtype),p=Zd(t.shape),c=o.dataIdMap.get(u.dataId);if(s){const e=Fb(i,p);return"string"===t.dtype?c.stringBytes=l.slice(e,e+Bd(a)):o.typedArrayFromHeap(u).set(l.subarray(e,e+Bd(a))),u}if("string"===t.dtype){const e=Vq(l,i,a,t.shape,t.dtype);return c.stringBytes=e,u}const d=o.typedArrayFromHeap(u),h=t.shape.length;if(2===h)!function(e,t,n,r,o){let i=0;const a=r[0],s=r[1],l=a+o[0];for(let r=a;r<l;r++){const a=r*t+s;n.set(e.subarray(a,a+o[1]),i),i+=o[1]}}(l,p[0],d,i,a);else if(3===h)!function(e,t,n,r,o,i){let a=0;const s=o[0],l=o[1],u=o[2],p=s+i[0],c=l+i[1];for(let o=s;o<p;o++)for(let s=l;s<c;s++){const l=o*t+s*n+u;r.set(e.subarray(l,l+i[2]),a),a+=i[2]}}(l,p[0],p[1],d,i,a);else if(4===h)!function(e,t,n,r,o,i,a){let s=0;const l=i[0],u=i[1],p=i[2],c=l+a[0],d=u+a[1],h=p+a[2],f=i[3];for(let i=l;i<c;i++)for(let l=u;l<d;l++)for(let u=p;u<h;u++){const p=i*t+l*n+u*r+f;o.set(e.subarray(p,p+a[3]),s),s+=a[3]}}(l,p[0],p[1],p[2],d,i,a);else{const e=Vq(l,i,a,t.shape,t.dtype);d.set(e)}return u}const Gq={kernelName:Cg,backendName:"wasm",kernelFunc:Hq},qq={kernelName:Oh,backendName:"wasm",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{blockShape:i,crops:a}=r,s=i.reduce((e,t)=>e*t),l=Nx(o.shape,i,s),u=jx(l.length,i.length),p=Ax(o.shape,i,s),c=Cx(a,i.length),d=Mx(p,a,i.length),h=Lq({inputs:{x:o},backend:n,attrs:{shape:l}}
2),f=Fq({inputs:{x:h},backend:n,attrs:{perm:u}}),g=Hq({inputs:{x:Lq({inputs:{x:f},backend:n,attrs:{shape:p}})},backend:n,attrs:{begin:c,size:d}});return n.disposeData(h.dataId),n.disposeData(f.dataId),n.disposeData(h.dataId),g}};function Kq(e){const{inputs:{x:t},attrs:{dtype:n},backend:r}=e,o=r.makeOutput(t.shape,n),i=r.typedArrayFromHeap(t);return r.typedArrayFromHeap(o).set(i),o}const Xq={kernelName:Ph,backendName:"wasm",kernelFunc:Kq},Yq=_q(Lh);let Jq;const Zq={kernelName:Wh,backendName:"wasm",setupFunc:function(e){Jq=e.wasm.cwrap(Wh,null,["number","number","number","number"])},kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{clipValueMin:i,clipValueMax:a}=r,s=n.dataIdMap.get(o.dataId).id,l=n.makeOutput(o.shape,o.dtype),u=n.dataIdMap.get(l.dataId).id;return Jq(s,i,a,u),l}};function Qq(e){const{inputs:t,backend:n}=e,r=zd(e.attrs.axis,t[0].shape)[0];let o=Tx(t.map(e=>e.shape),r);const i=t.filter(e=>Bd(e.shape)>0);if(1===i.length)return Eq({inputs:{x:i[0]},backend:n});const a=n.makeOutput(o,t[0].dtype);if(0===Bd(o))return a;if(Ix(i.map(e=>e.shape),r),"string"===i[0].dtype){const e=i.map(e=>{const t=Bd(e.shape.slice(r));return Lq({inputs:{x:e},backend:n,attrs:{shape:[-1,t]}})}),s=e.map(e=>({vals:n.readSync(e.dataId),shape:e.shape}));o=Tx(e.map(e=>e.shape),1);const l=1===e[0].shape[0],u=function(e,t,n,r){const o=Hd(n,Bd(t));if(r&&"string"!==n){let t=0;e.forEach(e=>{const n=Bd(e.shape);o.set(e.vals,t),t+=n})}else{let r=0;e.forEach(e=>{const i="string"===n?qx(e.vals):e.vals;let a=0;for(let n=0;n<e.shape[0];++n){const s=n*t[1]+r;for(let t=0;t<e.shape[1];++t)o[s+t]=i[a++]}r+=e.shape[1]})}return o}(s,o,t[0].dtype,l),p=Tx(i.map(e=>e.shape),r);return a.shape=p,n.dataIdMap.get(a.dataId).stringBytes=Kx(u),e.forEach(e=>n.disposeData(e.dataId)),a}const s=Bd(i[0].shape.slice(0,r));let l=0;const u=i.map(e=>{const t=Bd(e.shape.slice(r));return l+=t,t}),p=i.map(e=>n.typedArrayFromHeap(e)),c=n.typedArrayFromHeap(a);for(let e=0;e<s;e++){let t=e*l;for(let n=0;n<p.length;n++){const r=u[n],o=e*r,i=p[n].subarray(o,o+r);c.set(i,t),t+=r}}return a}const eK={kernelName:Vh,backendName:"wasm",kernelFunc:Qq};let tK;const nK={kernelName:Hh,backendName:"wasm",setupFunc:function(e){tK=e.wasm.cwrap(Hh,null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])},kernelFunc:function(e){const{inputs:t,attrs:n,backend:r}=e,{x:o,filter:i}=t,a=r.dataIdMap.get(o.dataId).id,s=r.dataIdMap.get(i.dataId).id,{strides:l,dilations:u,pad:p,dimRoundingMode:c,dataFormat:d}=n,h=l$(d),f=Qb(o.shape,i.shape,l,u,p,c,!1,h),g=f.filterHeight,m=f.filterWidth,y=f.padInfo.top,b=f.padInfo.right,$=f.padInfo.bottom,_=f.padInfo.left,w=f.dilationHeight,x=f.dilationWidth,S=f.strideHeight,v=f.strideWidth,k=f.inChannels,E=f.outChannels,I="SAME"===f.padInfo.type?1:0;if("channelsLast"!==f.dataFormat)throw new Error(`wasm backend Conv2D does not support dataFormat:'${f.dataFormat}'. Please use 'channelsLast'.`);const T=r.makeOutput(f.outShape,"float32"),F=r.dataIdMap.get(T.dataId).id;return tK(a,o.shape[0],o.shape[1],o.shape[2],s,g,m,y,b,$,_,I,w,x,S,v,k,E,F),T}};let rK;const oK={kernelName:qh,backendName:"wasm",setupFunc:function(e){rK=e.wasm.cwrap(qh,null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])},kernelFunc:function(e){const{backend:t,inputs:n,attrs:r}=e,{dy:o,filter:i}=n,{strides:a,pad:s,dataFormat:l,dimRoundingMode:u,inputShape:p}=r,c=l$(l),d=Qb(p,i.shape,a,1,s,u,!1,c),{batchSize:h,filterHeight:f,filterWidth:g,inChannels:m,inHeight:y,inWidth:b,outChannels:$,outHeight:_,outWidth:w,strideHeight:x,strideWidth:S}=d,v=f-1-d.padInfo.top,k=g-1-d.padInfo.left,E="channelsLast"===d.dataFormat,I=Zd(d.inShape),T=Zd(o.shape),[F,N,j]=Zd(i.shape),A=I[0],C=E?I[1]:I[2],M=E?I[2]:1,D=E?1:I[1],O=T[0],R=E?T[1]:T[2],B=E?T[2]:1,P=E?1:T[1],L=t.makeOutput(d.inShape,"float32"),W=t.dataIdMap.get(L.dataId).id,U=t.dataIdMap.get(o.dataId).id,z=t.dataIdMap.get(i.dataId).id;return rK(U,z,h,f,g,y,b,m,_,w,$,x,S,v,k,F,N,j,A,C,M,D,O,R,B,P,W),L}},iK=_q(Jh),aK=_q(Zh);var sK;let lK;!function(e){e[e.bilinear=0]="bilinear",e[e.nearest=1]="nearest"}(sK||(sK={}));const uK={kernelName:ef,backendName:"wasm",setupFunc:function(e){lK=e.wasm.cwrap(ef,null,["number","number","number","number","array","number","number","number","number","number"])},kernelFunc:function(e){const{backend:t,inputs:n,attrs:r}=e,{method:o,extrapolationValue:i,cropSize:a}=r,{image:s,boxes:l,boxInd:u}=n,p=l.shape[0],[c,d]=a,h=[p,c,d,s.shape[3]];let f,g=t.dataIdMap.get(s.dataId);"float32"!==s.dtype&&(f=Kq({backend:t,inputs:{x:s},attrs:{dtype:"float32"}}),g=t.dataIdMap.get(f.dataId));const m=g.id,y=t.dataIdMap.get(l.dataId).id,b=t.dataIdMap.get(u.dataId).id,$=t.makeOutput(h,"float32"),_=t.dataIdMap.get($.dataId).id,w=new Uint8Array(new Int32Array(s.shape).buffer);
2return lK(m,y,b,p,w,c,d,sK[o],i,_),null!=f&&t.disposeData(f.dataId),$}};let pK;const cK={kernelName:Qh,backendName:"wasm",setupFunc:function(e){pK=e.wasm.cwrap(Qh,null,["number","number","number","number","number","number"])},kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{axis:i,exclusive:a,reverse:s}=r,l=o.shape.length;Md("float32"===o.dtype||"int32"===o.dtype,()=>`cumsum does not support ${o.dtype} tensors in the WASM backend`);const u=c_([i],l);let p=o;null!==u&&(p=Fq({inputs:{x:o},attrs:{perm:u},backend:n}));const c=h_(1,l)[0];p_("cumsum",[c],l);const d=n.makeOutput(p.shape,p.dtype),h=p.shape[c],f=n.dataIdMap.get(p.dataId).id,g=n.dataIdMap.get(d.dataId).id;pK(f,a?1:0,s?1:0,h,g,mq[o.dtype]);let m=d;return null!==u&&(m=Fq({inputs:{x:d},attrs:{perm:d_(u)},backend:n}),n.disposeData(p.dataId),n.disposeData(d.dataId)),m}};let dK;const hK={kernelName:nf,backendName:"wasm",setupFunc:function(e){dK=e.wasm.cwrap(nf,null,["number","number","number","array","number","array","array","number","number"])},kernelFunc:function(e){const{backend:t,inputs:n,attrs:r}=e,{x:o}=n,{blockSize:i,dataFormat:a}=r,s=o.shape[0],l=("NHWC"===a?o.shape[1]:o.shape[2])*i,u=("NHWC"===a?o.shape[2]:o.shape[3])*i,p=("NHWC"===a?o.shape[3]:o.shape[1])/(i*i),c="NHWC"===a?[s,l,u,p]:[s,p,l,u],d=t.makeOutput(c,"float32"),h=t.dataIdMap.get(o.dataId).id,f=new Uint8Array(new Int32Array(Zd(o.shape)).buffer),g=new Uint8Array(new Int32Array(c).buffer),m=new Uint8Array(new Int32Array(Zd(c)).buffer),y=t.dataIdMap.get(d.dataId).id;return dK(h,i,"NHWC"===a?1:0,f,o.shape.length-1,g,m,c.length,y),d}};let fK;const gK={kernelName:rf,backendName:"wasm",setupFunc:function(e){fK=e.wasm.cwrap(rf,null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])},kernelFunc:function(e){const{inputs:t,attrs:n,backend:r}=e,{x:o,filter:i}=t,a=r.dataIdMap.get(o.dataId).id,s=r.dataIdMap.get(i.dataId).id,{strides:l,dilations:u,pad:p,dimRoundingMode:c}=n,d=null==u?[1,1]:u,h=Qb(o.shape,i.shape,l,d,p,c,!0),f=h.filterHeight,g=h.filterWidth,m=h.padInfo.top,y=h.padInfo.right,b=h.padInfo.bottom,$=h.padInfo.left,_=h.dilationHeight,w=h.dilationWidth,x=h.strideHeight,S=h.strideWidth,v=h.inChannels,k=h.outChannels,E="SAME"===h.padInfo.type?1:0;if("channelsLast"!==h.dataFormat)throw new Error(`wasm backend DepthwiseConv2dNative does not support dataFormat:'${h.dataFormat}'. Please use 'channelsLast'.`);const I=r.makeOutput(h.outShape,"float32"),T=r.dataIdMap.get(I.dataId).id;return fK(a,o.shape[0],o.shape[1],o.shape[2],s,f,g,m,y,b,$,E,_,w,x,S,v,k,T),I}},mK=_q(df),yK=xq(gf,!1,"bool"),bK=_q(mf,"float32");function $K(e){const{inputs:t,attrs:n,backend:r}=e,{input:o}=t,{dim:i}=n,a=o.shape.length,s=o.shape.slice();let l=i;return i<0&&(Md(-(a+1)<=i,()=>`Axis must be in the interval [${-(a+1)}, ${a}]`),l=a+i+1),s.splice(l,0,1),Lq({inputs:{x:o},backend:r,attrs:{shape:s}})}const _K={kernelName:yf,backendName:"wasm",kernelFunc:$K};function wK(e){const{attrs:{shape:t,value:n,dtype:r},backend:o}=e,i=o.makeOutput(t,r);return o.typedArrayFromHeap(i).fill(n),i}const xK={kernelName:$f,backendName:"wasm",kernelFunc:wK};let SK;const vK={kernelName:_f,backendName:"wasm",kernelFunc:function(e){const{inputs:t,backend:n}=e,{image:r}=t,o=n.makeOutput(r.shape,r.dtype),i=n.dataIdMap.get(r.dataId).id,a=n.dataIdMap.get(o.dataId).id,[s,l,u,p]=r.shape;return SK(i,s,l,u,p,a),o},setupFunc:function(e){SK=e.wasm.cwrap(_f,null,["number","number","number","number","number","number"])}},kK=_q(wf),EK=xq(xf,!1);let IK;const TK={kernelName:Sf,backendName:"wasm",setupFunc:function(e){IK=e.wasm.cwrap(Sf,null,["number","number","number","number","number","number","number"])},kernelFunc:function(e){const{backend:t,inputs:n,attrs:r}=e,{varianceEpsilon:o}=r,{x:i,mean:a,variance:s,offset:l,scale:u}=n,p=t.dataIdMap.get(i.dataId).id,c=t.dataIdMap.get(a.dataId).id,d=t.dataIdMap.get(s.dataId).id,h=null!=l?t.dataIdMap.get(l.dataId).id:0,f=null!=u?t.dataIdMap.get(u.dataId).id:0,g=t.makeOutput(i.shape,i.dtype);if(0===Bd(i.shape))return g;const m=t.dataIdMap.get(g.dataId).id;return IK(p,c,d,h,f,o,m),g}};let FK;const NK={kernelName:mm,backendName:"wasm",setupFunc:function(e){FK=e.wasm.cwrap(mm,null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])},kernelFunc:function(e){const{inputs:t,attrs:n,backend:r}=e,{x:o,filter:i,bias:a,preluActivationWeights:s}=t,{strides:l,pad:u,dilations:p,dataFormat:c,dimRoundingMode:d,activation:h,leakyreluAlpha:f}=n,g=Qb(o.shape,i.shape,l,p,u,d),m=yq[h];if(null==m)throw new Error(`${h} activation not yet supported for FusedConv2D in the wasm backend.`);const y=r.dataIdMap.get(o.dataId).id,b=r.dataIdMap.get(i.dataId).id,$=g.outChannels;let _=0;if(null!=a){const e=r.dataIdMap.get(a.dataId);if(1!==e.shape.length)throw new Error(`FusedConv2D only supports rank-1 bias but got rank ${e.shape.length}.`);if(e.shape[0]!==$)throw new Error(`FusedConv2D bias shape (${e.shape}) does not match the number of output channels (${$})`);_=e.id}const w=g.filterHeight,x=g.filterWidth,S=g.padInfo.top,v=g.padInfo.right,k=g.padInfo.bottom,E=g.padInfo.left,I=g.dilationHeight,T=g.dilationWidth,F=g.strideHeight,N=g.strideWidth,j=g.inChannels,A="SAME"===g.padInfo.type?1:0,C=g.batchSize,M=g.inHeight,D=g.inWidth;
vendor: 1,613 bytes, line 2
2if("NHWC"!==c)throw new Error(`wasm backend FusedConv2D does not support dataFormat:'${c}'. Please use 'NHWC'.`);const O=r.makeOutput(g.outShape,"float32"),R=r.dataIdMap.get(O.dataId).id,B=null==s?0:r.dataIdMap.get(s.dataId).id;return FK(y,C,M,D,b,w,x,_,S,v,k,E,A,I,T,F,N,j,$,m,B,f||0,R),O}};let jK;const AK={kernelName:ym,backendName:"wasm",setupFunc:function(e){jK=e.wasm.cwrap(ym,null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])},kernelFunc:function(e){const{inputs:t,attrs:n,backend:r}=e,{x:o,filter:i,bias:a,preluActivationWeights:s}=t,{strides:l,pad:u,dilations:p,dataFormat:c,dimRoundingMode:d,activation:h,leakyreluAlpha:f}=n,g=Qb(o.shape,i.shape,l,p,u,d,!0),m=yq[h];if(null==m)throw new Error(`${h} activation not yet supported for FusedDepthwiseConv2D in the wasm backend.`);const y=r.dataIdMap.get(o.dataId).id,b=r.dataIdMap.get(i.dataId).id,$=g.outChannels;let _=0;if(null!=a){const e=r.dataIdMap.get(a.dataId);if(1!==e.shape.length)throw new Error(`FusedDepthwiseConv2D only supports rank-1 bias but got rank ${e.shape.length}.`);if(e.shape[0]!==$)throw new Error(`FusedDepthwiseConv2D bias shape (${e.shape}) does not match the number of output channels (${$})`);_=e.id}const w=g.filterHeight,x=g.filterWidth,S=g.padInfo.top,v=g.padInfo.right,k=g.padInfo.bottom,E=g.padInfo.left,I=g.dilationHeight,T=g.dilationWidth,F=g.strideHeight,N=g.strideWidth,j=g.inChannels,A="SAME"===g.padInfo.type?1:0,C=g.batchSize,M=g.inHeight,D=g.inWidth;
2if("NHWC"!==c)throw new Error(`wasm backend FusedDepthwiseConv2D does not support dataFormat:'${c}'. Please use 'NHWC'.`);const O=r.makeOutput(g.outShape,"float32"),R=r.dataIdMap.get(O.dataId).id,B=null==s?0:r.dataIdMap.get(s.dataId).id;return jK(y,C,M,D,b,w,x,_,S,v,k,E,A,I,T,F,N,j,$,m,B,f||0,R),O}};let CK;const MK={kernelName:kf,backendName:"wasm",setupFunc:function(e){CK=e.wasm.cwrap(kf,null,["number","number","number","number","number","number","array","number"])},kernelFunc:function(e){const{backend:t,inputs:n}=e,{params:r,indices:o}=n,[i,a,s,l]=Eb(r,o),u=t.makeOutput(i,r.dtype);if(0===a)return u;const p=o.shape,c=p[p.length-1],d=t.dataIdMap.get(r.dataId).id,h=t.dataIdMap.get(o.dataId).id,f=new Uint8Array(new Int32Array(l).buffer),g=t.dataIdMap.get(u.dataId).id;return CK(d,mq[r.dtype],h,a,c,s,f,g),u}};let DK;const OK={kernelName:vf,backendName:"wasm",setupFunc:function(e){DK=e.wasm.cwrap("Gather",null,["number","number","array","number","number","number","array","number"])},kernelFunc:function(e){const{backend:t,inputs:n,attrs:r}=e,{x:o,indices:i}=n,{axis:a,batchDims:s}=r,l=zd(a,o.shape)[0],u=t.readSync(i.dataId),p=o.shape[l];for(let e=0;e<u.length;++e){const t=u[e];Md(t<=p-1&&t>=0,()=>`GatherV2: the index value ${t} is not in [0, ${p-1}]`)}const c=Gx(o,i,l,s),d=Lq({inputs:{x:o},attrs:{shape:[c.batchSize,c.outerSize,c.dimSize,c.sliceSize]},backend:t}),h=Bd(i.shape),f=Lq({inputs:{x:i},attrs:{shape:[c.batchSize,h/c.batchSize]},backend:t}),g=[c.batchSize,c.outerSize,h/c.batchSize,c.sliceSize],m=t.makeOutput(g,o.dtype);if(0===Bd(o.shape))return m;const y=d.shape.length-1,b=t.dataIdMap.get(d.dataId).id,$=t.dataIdMap.get(f.dataId).id,_=t.dataIdMap.get(m.dataId).id,w=new Uint8Array(new Int32Array(Zd(d.shape)).buffer),x=new Uint8Array(new Int32Array(Zd(g)).buffer);return DK(b,mq[o.dtype],w,y,$,c.batchSize,x,_),t.disposeData(d.dataId),t.disposeData(f.dataId),m.shape=c.outputShape,m}},RK=xq(Ef,!1,"bool"),BK=xq(If,!1,"bool");let PK;const LK={kernelName:Mf,backendName:"wasm",setupFunc:function(e){PK=e.wasm.cwrap(Mf,null,["number","number","number","number"])},kernelFunc:function(e){const{inputs:{x:t},attrs:{alpha:n},backend:r}=e,o=r.dataIdMap.get(t.dataId).id,i=r.makeOutput(t.shape,"float32");if(0!==Bd(t.shape)){const e=r.dataIdMap.get(i.dataId).id;PK(o,mq[t.dtype],n,e)}return i}},WK=xq(Df,!1,"bool"),UK=xq(Of,!1,"bool"),zK=_q(Bf),VK=xq(Lf,!1,"bool");let HK;const GK={kernelName:Hf,backendName:"wasm",setupFunc:function(e){HK=e.wasm.cwrap(Hf,null,["number","number","number","number"])},kernelFunc:function(e){const{backend:t,inputs:n,attrs:r}=e,{reductionIndices:o,keepDims:i}=r,{x:a}=n;let s=t.dataIdMap.get(a.dataId).id,l=a;const{transposed:u,axes:p,originalAxes:c,inputWasTransposed:d}=jq(a,o,t);d&&(l=u,s=t.dataIdMap.get(u.dataId).id),p_("max",p,l.shape.length);const[h,f]=l_(l.shape,p),g=Bd(f),m=t.makeOutput(h,a.dtype);if(0!==Bd(l.shape)){const e=t.dataIdMap.get(m.dataId).id;HK(s,mq[a.dtype],g,e)}if(d&&t.disposeData(u.dataId),i){const e=u_(m.shape,c);m.shape=e}return m}},qK=xq(Gf,!1);let KK;const XK={kernelName:qf,backendName:"wasm",setupFunc:function(e){KK=e.wasm.cwrap(qf,null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])},kernelFunc:function(e){const{inputs:t,attrs:n,backend:r}=e,o=t.x,i=r.dataIdMap.get(o.dataId).id;Md("float32"===o.dtype,()=>`Error in MaxPool: only float32 input is supported. Got ${o.dtype}.`);const{filterSize:a,strides:s,pad:l,dimRoundingMode:u}=n,p=Jb(o.shape,a,s,1,l,u),c=p.filterHeight,d=p.filterWidth,h=p.padInfo.top,f=p.padInfo.right,g=p.padInfo.bottom,m=p.padInfo.left,y=p.dilationHeight,b=p.dilationWidth,$=p.strideHeight,_=p.strideWidth,w=p.inChannels,x=p.outChannels;if("channelsLast"!==p.dataFormat)throw new Error(`wasm backend does not support dataFormat:'${p.dataFormat}'. Please use 'channelsLast'.`);const S=r.makeOutput(p.outShape,"float32"),v=r.dataIdMap.get(S.dataId).id;return KK(i,o.shape[0],o.shape[1],o.shape[2],c,d,h,f,g,m,y,b,$,_,w,x,v),S}};let YK;const JK={kernelName:Zf,backendName:"wasm",setupFunc:function(e){YK=e.wasm.cwrap(Zf,null,["number, number, number"])},kernelFunc:function(e){const{backend:t,inputs:n,attrs:r}=e,{axis:o,keepDims:i}=r,{x:a}=n,s=t.dataIdMap.get(a.dataId).id;let l=s,u=a;const{transposed:p,axes:c,originalAxes:d,inputWasTransposed:h}=jq(a,o,t);let f=c;if(h){const e=t.dataIdMap.get(p.dataId).id;e!==s&&(u=p,l=e,f=h_(f.length,u.shape.length))}p_("mean",f,u.shape.length);const[g,m]=l_(u.shape,f),y=Bd(m);let b=u;"float32"!==u.dtype&&(b=Kq({backend:t,inputs:{x:u},attrs:{dtype:"float32"}}),l=t.dataIdMap.get(b.dataId).id);const $=t.makeOutput(g,"float32");if(0!==Bd(u.shape)){const e=t.dataIdMap.get($.dataId).id;YK(l,y,e)}if(h&&t.disposeData(p.dataId),i){const e=u_($.shape,d);$.shape=e}return"float32"!==u.dtype&&t.disposeData(b.dataId),$}}
2;let ZK;const QK={kernelName:Qf,backendName:"wasm",setupFunc:function(e){ZK=e.wasm.cwrap(Qf,null,["number","number","number","number"])},kernelFunc:function(e){const{backend:t,inputs:n,attrs:r}=e,{axis:o,keepDims:i}=r,{x:a}=n,s=t.dataIdMap.get(a.dataId).id;let l=s,u=a;const{transposed:p,axes:c,originalAxes:d,inputWasTransposed:h}=jq(a,o,t);if(h){const e=t.dataIdMap.get(p.dataId).id;e!==s&&(u=p,l=e)}p_("min",c,u.shape.length);const[f,g]=l_(u.shape,c),m=Bd(g),y=t.makeOutput(f,u.dtype);if(0!==Bd(u.shape)){const e=t.dataIdMap.get(y.dataId).id;ZK(l,mq[a.dtype],m,e)}if(h&&t.disposeData(p.dataId),i){const e=u_(y.shape,d);y.shape=e}return y}},eX=xq(eg,!1);var tX;let nX;!function(e){e[e.reflect=0]="reflect",e[e.symmetric=1]="symmetric"}(tX||(tX={}));const rX={kernelName:tg,backendName:"wasm",kernelFunc:function(e){const{inputs:{x:t},backend:n,attrs:{paddings:r,mode:o}}=e,i=r.map((e,n)=>e[0]+t.shape[n]+e[1]),a=n.dataIdMap.get(t.dataId).id,s=n.makeOutput(i,t.dtype),l=n.dataIdMap.get(s.dataId).id,u=new Uint8Array(new Int32Array(t.shape).buffer),p=r.map(e=>e[0]),c=r.map(e=>e[1]),d=new Uint8Array(new Int32Array(p).buffer),h=new Uint8Array(new Int32Array(c).buffer);return nX(a,u,t.shape.length,mq[t.dtype],d,h,tX[o],l),s},setupFunc:function(e){nX=e.wasm.cwrap(tg,null,["number","array","number","number","array","array","number","number"])}},oX=xq(og,!0),iX=_q(ig);function aX(e,t){const n=new Int32Array(e.wasm.HEAPU8.buffer,t,4),r=n[0],o=n[1],i=n[2],a=n[3];return e.wasm._free(t),{pSelectedIndices:r,selectedSize:o,pSelectedScores:i,pValidOutputs:a}}let sX;const lX={kernelName:sg,backendName:"wasm",setupFunc:function(e){sX=e.wasm.cwrap(sg,"number",["number","number","number","number","number"])},kernelFunc:function(e){const{backend:t,inputs:n,attrs:r}=e,{iouThreshold:o,maxOutputSize:i,scoreThreshold:a}=r,{boxes:s,scores:l}=n,u=t.dataIdMap.get(s.dataId).id,p=t.dataIdMap.get(l.dataId).id,c=sX(u,p,i,o,a),{pSelectedIndices:d,selectedSize:h,pSelectedScores:f,pValidOutputs:g}=aX(t,c);return t.wasm._free(f),t.wasm._free(g),t.makeOutput([h],"int32",d)}};let uX;const pX={kernelName:lg,backendName:"wasm",setupFunc:function(e){uX=e.wasm.cwrap(lg,"number",["number","number","number","number","number","bool"])},kernelFunc:function(e){const{backend:t,inputs:n,attrs:r}=e,{iouThreshold:o,maxOutputSize:i,scoreThreshold:a,padToMaxOutputSize:s}=r,{boxes:l,scores:u}=n,p=t.dataIdMap.get(l.dataId).id,c=t.dataIdMap.get(u.dataId).id,d=uX(p,c,i,o,a,s),{pSelectedIndices:h,selectedSize:f,pSelectedScores:g,pValidOutputs:m}=aX(t,d);return t.wasm._free(g),[t.makeOutput([f],"int32",h),t.makeOutput([],"int32",m)]}};let cX;const dX={kernelName:ug,backendName:"wasm",setupFunc:function(e){cX=e.wasm.cwrap(ug,"number",["number","number","number","number","number","number"])},kernelFunc:function(e){const{backend:t,inputs:n,attrs:r}=e,{iouThreshold:o,maxOutputSize:i,scoreThreshold:a,softNmsSigma:s}=r,{boxes:l,scores:u}=n,p=t.dataIdMap.get(l.dataId).id,c=t.dataIdMap.get(u.dataId).id,d=cX(p,c,i,o,a,s),{pSelectedIndices:h,selectedSize:f,pSelectedScores:g,pValidOutputs:m}=aX(t,d);return t.wasm._free(m),[t.makeOutput([f],"int32",h),t.makeOutput([f],"float32",g)]}},hX=xq(ag,!1,"bool");let fX;const gX={kernelName:cg,backendName:"wasm",setupFunc:function(e){fX=e.wasm.cwrap(cg,null,["number","number","number","number","number"])},kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{indices:o}=t,{depth:i,onValue:a,offValue:s}=r,l=n.makeOutput([...o.shape,i],"int32"),u=n.dataIdMap.get(l.dataId).id,p=n.dataIdMap.get(o.dataId).id;return fX(p,i,a,s,u),l}},mX={kernelName:pg,backendName:"wasm",kernelFunc:function(e){const{inputs:{x:t},backend:n}=e,r=n.makeOutput(t.shape,t.dtype);return n.typedArrayFromHeap(r).fill(1),r}},yX={kernelName:dg,backendName:"wasm",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{axis:o}=r;if(1===t.length)return $K({inputs:{input:t[0]},backend:n,attrs:{dim:o}});const i=t[0].shape,a=t[0].dtype;t.forEach(e=>{Dd(i,e.shape,"All tensors passed to stack must have matching shapes"),Md(a===e.dtype,()=>"All tensors passed to stack must have matching dtypes")});const s=[],l=Qq({inputs:t.map(e=>{const t=$K({inputs:{input:e},backend:n,attrs:{dim:o}});return s.push(t),t}),backend:n,attrs:{axis:o}});
2return s.forEach(e=>n.disposeData(e.dataId)),l}};let bX;const $X={kernelName:hg,backendName:"wasm",kernelFunc:function(e){const{inputs:{x:t},backend:n,attrs:{paddings:r,constantValue:o}}=e,i=r.map((e,n)=>e[0]+t.shape[n]+e[1]);if(0===Bd(t.shape))return wK({backend:n,attrs:{shape:i,value:o,dtype:t.dtype}});const a=n.dataIdMap.get(t.dataId).id,s=n.makeOutput(i,t.dtype),l=n.dataIdMap.get(s.dataId).id,u=new Uint8Array(new Int32Array(t.shape).buffer),p=r.map(e=>e[0]),c=r.map(e=>e[1]),d=new Uint8Array(new Int32Array(p).buffer),h=new Uint8Array(new Int32Array(c).buffer);return bX(a,u,t.shape.length,mq[t.dtype],d,h,o,l),s},setupFunc:function(e){bX=e.wasm.cwrap(hg,null,["number","array","number","number","array","array","number","number"])}},_X=xq(fg,!1);let wX;const xX={kernelName:gg,backendName:"wasm",setupFunc:function(e){wX=e.wasm.cwrap(gg,null,["number","number","number"])},kernelFunc:function(e){const{inputs:t,backend:n}=e,{x:r,alpha:o}=t,i=n.dataIdMap.get(r.dataId).id,a=n.dataIdMap.get(o.dataId).id;let s=i;const l=r;let u=l;"float32"!==l.dtype&&(u=Kq({backend:n,inputs:{x:r},attrs:{dtype:"float32"}}),s=n.dataIdMap.get(u.dataId).id);const p=n.makeOutput(r.shape,"float32"),c=n.dataIdMap.get(p.dataId).id;return wX(s,a,c),"float32"!==l.dtype&&n.disposeData(u.dataId),p}};let SX;const vX={kernelName:mg,backendName:"wasm",setupFunc:function(e){SX=e.wasm.cwrap(mg,null,["number","number","number","number"])},kernelFunc:function(e){const{backend:t,inputs:n,attrs:r}=e,{axis:o,keepDims:i}=r,{x:a}=n,s=t.dataIdMap.get(a.dataId).id;let l=s,u=a;const{transposed:p,axes:c,originalAxes:d,inputWasTransposed:h}=jq(a,o,t);let f=c;if(h){const e=t.dataIdMap.get(p.dataId).id;e!==s&&(u=p,l=e,f=h_(f.length,u.shape.length))}p_("prod",f,u.shape.length);const[g,m]=l_(u.shape,f),y=Bd(m),b=t.makeOutput(g,u.dtype);if(0!==Bd(u.shape)){const e=t.dataIdMap.get(b.dataId).id;SX(l,y,mq[b.dtype],e)}if(h&&t.disposeData(p.dataId),i){const e=u_(b.shape,d);b.shape=e}return b}},kX={kernelName:yg,backendName:"wasm",kernelFunc:e=>{const{backend:t,attrs:n}=e,{start:r,stop:o,step:i,dtype:a}=n,s=function(e,t,n,r){if(e===t||e<t&&n<0||t<e&&n>1)return nh(0,r);const o=nh(Math.abs(Math.ceil((t-e)/n)),r);t<e&&1===n&&(n=-1),o[0]=e;for(let e=1;e<o.length;e++)o[e]=o[e-1]+n;return o}(r,o,i,a),l=t.makeOutput([s.length],a);return t.typedArrayFromHeap(l).set(s),l}},EX=xq(pf,!0),IX=_q(_g),TX=_q(Eg);let FX;const NX={kernelName:vg,backendName:"wasm",setupFunc:function(e){FX=e.wasm.cwrap(vg,null,["number","number","number","number","number","number","number","number","number","number"])},kernelFunc:function(e){const{backend:t,inputs:n,attrs:r}=e,{images:o}=n,{alignCorners:i,halfPixelCenters:a,size:s}=r,[l,u]=s,[p,c,d,h]=o.shape,f=[p,l,u,h];let g,m=t.dataIdMap.get(o.dataId);"float32"!==m.dtype&&(g=Kq({backend:t,inputs:{x:o},attrs:{dtype:"float32"}}),m=t.dataIdMap.get(g.dataId));const y=m.id,b=t.makeOutput(f,"float32");if(0===Bd(o.shape))return b;const $=t.dataIdMap.get(b.dataId).id;return FX(y,p,c,d,h,l,u,i?1:0,a?1:0,$),null!=g&&t.disposeData(g.dataId),b}};let jX;const AX={kernelName:Ig,backendName:"wasm",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{dims:i}=r,a=zd(i,o.shape);if(0===o.shape.length)return Eq({inputs:{x:o},backend:n});const s=n.makeOutput(o.shape,o.dtype),l=n.dataIdMap.get(o.dataId).id,u=n.dataIdMap.get(s.dataId).id,p=new Uint8Array(new Int32Array(a).buffer),c=new Uint8Array(new Int32Array(o.shape).buffer);jX(l,p,a.length,c,o.shape.length,u);const d=Lq({inputs:{x:s},attrs:{shape:o.shape},backend:n});return n.disposeData(s.dataId),d},setupFunc:function(e){jX=e.wasm.cwrap(Ig,null,["number","array","number","array","number","number"])}};let CX;const MX={kernelName:fm,backendName:"wasm",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{image:o}=t,{radians:i,fillValue:a,center:s}=r,l=n.makeOutput(o.shape,o.dtype),u=n.dataIdMap.get(o.dataId).id,p=n.dataIdMap.get(l.dataId).id,[c,d,h,f]=o.shape,[g,m]=Fx(s,d,h),y="number"==typeof a?[a,a,a,0===a?0:255]:[...a,255],b=new Uint8Array(new Int32Array(y).buffer);return CX(u,c,d,h,f,i,g,m,b,y.length,p),l},setupFunc:function(e){CX=e.wasm.cwrap(fm,null,["number","number","number","number","number","number","number","number","array","number","number"])}},DX=_q(Tg),OX=_q(Fg);let RX;const BX={kernelName:Ng,backendName:"wasm",setupFunc:function(e){RX=e.wasm.cwrap(Ng,null,["number","number","number","number","number","number","array","number","number"])},kernelFunc:function(e){const{backend:t,inputs:n,attrs:r}=e,{indices:o,updates:i}=n,{shape:a}=r,s=t.makeOutput(a,i.dtype);if(0===Bd(a))return s;const{sliceRank:l,numUpdates:u,sliceSize:p,strides:c,outputSize:d}=Ib(0,o,a),h=t.dataIdMap.get(o.dataId).id,f=t.dataIdMap.get(i.dataId).id,g=new Uint8Array(new Int32Array(c).buffer),m=t.dataIdMap.get(s.dataId).id;return RX(h,f,mq[i.dtype],l,u,p,g,d,m),s}};let PX;const LX={kernelName:jg,backendName:"wasm",kernelFunc:function(e){const{inputs:t,backend:n}=e,{condition:r,t:o,e:i}=t,a=n.dataIdMap.get(r.dataId).id,s=n.dataIdMap.get(o.dataId).id,l=n.dataIdMap.get(i.dataId).id,u=n.makeOutput(o.shape,o.dtype),p=n.dataIdMap.get(u.dataId).id,c=r.shape.length,d=o.shape.length,h=0===c||c>1||1===d?1:Bd(o.shape.slice(1));return PX(a,s,l,h,p),u},setupFunc:function(e){PX=e.wasm.cwrap("SelectV2",null,["number","number","number","number","number"])}};let WX;const UX={kernelName:"Sigmoid",backendName:"wasm",setupFunc:function(e){WX=e.wasm.cwrap(Rg,null,["number","number"])},kernelFunc:function(e){const{backend:t,inputs:{x:n}}=e,r=t.dataIdMap.get(n.dataId).id,o=t.makeOutput(n.shape,n.dtype),i=t.dataIdMap.get(o.dataId).id;return 0===Bd(o.shape)||WX(r,i),o}},zX=_q(Mg);let VX;const HX={kernelName:zg,backendName:"wasm",setupFunc:function(e){VX=e.wasm.cwrap(zg,null,["number","number","number","number"])},kernelFunc:function(e){const{backend:t,inputs:{logits:n},attrs:{dim:r}}=e,o=t.dataIdMap.get(n.dataId).id,i=t.makeOutput(n.shape,n.dtype),a=t.dataIdMap.get(i.dataId).id,s=n.shape[r],l=Bd(n.shape)/s;return 0===Bd(i.shape)||VX(o,a,s,l),i}},GX={kernelName:Wg,backendName:"wasm",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}
2=t,{blockShape:i,paddings:a}=r,s=Bd(i),l=[[0,0]];l.push(...a);for(let e=1+i.length;e<o.shape.length;++e)l.push([0,0]);const u=$X.kernelFunc({inputs:{x:o},backend:n,attrs:{paddings:l,constantValue:0}}),p=Nx(u.shape,i,s,!1),c=jx(p.length,i.length,!1),d=Ax(u.shape,i,s,!1),h=Lq({inputs:{x:u},backend:n,attrs:{shape:p}}),f=Fq({inputs:{x:h},backend:n,attrs:{perm:c}}),g=Lq({inputs:{x:f},backend:n,attrs:{shape:d}});return n.disposeData(u.dataId),n.disposeData(h.dataId),n.disposeData(f.dataId),g}},qX={kernelName:Ug,backendName:"wasm",kernelFunc:function(e){const{inputs:t,attrs:n,backend:r}=e,{x:o}=t,{numOrSizeSplits:i,axis:a}=n,s=zd(a,o.shape)[0],l=Hx(o,i,s),u=new Array(o.shape.length).fill(0),p=o.shape.slice();return l.map(e=>{const t=[...p];t[s]=e;const n=Hq({inputs:{x:o},attrs:{begin:u,size:t},backend:r});return u[s]+=e,n})}},KX=_q(Pg),XX=_q(Yg),YX=xq(Xg,!0);let JX;const ZX={kernelName:dm,backendName:"wasm",setupFunc:function(e){JX=e.wasm.cwrap(dm,null,["number","number","number","number"])},kernelFunc:function(e){const{backend:t,inputs:n,attrs:r}=e,{alpha:o}=r,{x:i}=n,a=t.dataIdMap.get(i.dataId).id,s=t.makeOutput(i.shape,i.dtype),l=t.dataIdMap.get(s.dataId).id;return JX(a,o,mq[i.dtype],l),s}};let QX;const eY={kernelName:Jg,backendName:"wasm",setupFunc:function(e){QX=e.wasm.cwrap(Jg,null,["number","array","number","array","array","array","array","array","number","number"])},kernelFunc:function(e){const{backend:t,inputs:n,attrs:r}=e,{x:o}=n,{begin:i,end:a,strides:s,beginMask:l,endMask:u,ellipsisMask:p,newAxisMask:c,shrinkAxisMask:d}=r,{finalShapeSparse:h,finalShape:f,isIdentity:g,sliceDim0:m,isSimpleSlice:y,begin:b,end:$,strides:_}=jb(o.shape,i,a,s,l,u,p,c,d);let w;if(g)w=Lq({inputs:{x:o},backend:t,attrs:{shape:f}});else if(m||y){Md(o.shape.length>=1,()=>`Input must have rank at least 1, got: ${o.shape.length}`);const e=function(e,t,n){const r=[];for(let o=0;o<e.length;o++)r[o]=Math.ceil((t[o]-e[o])/n[o]);return r}(b,$,_),n=Hq({inputs:{x:o},backend:t,attrs:{begin:b,size:e}});w=Lq({inputs:{x:n},backend:t,attrs:{shape:f}}),t.disposeData(n.dataId)}else{const e=t.makeOutput(h,"float32"),n=t.dataIdMap.get(o.dataId).id,r=new Uint8Array(new Int32Array(Zd(o.shape)).buffer),i=new Uint8Array(new Int32Array(b).buffer),a=new Uint8Array(new Int32Array($).buffer),s=new Uint8Array(new Int32Array(_).buffer),l=new Uint8Array(new Int32Array(h).buffer),u=new Uint8Array(new Int32Array(Zd(h)).buffer),p=t.dataIdMap.get(e.dataId).id;QX(n,r,o.shape.length,i,a,s,l,u,h.length,p),w=Lq({inputs:{x:e},backend:t,attrs:{shape:f}}),t.disposeData(e.dataId)}return w}},tY=xq(tm,!0);let nY;const rY={kernelName:Lg,backendName:"wasm",setupFunc:function(e){nY=e.wasm.cwrap(Lg,null,["number","number","number","number"])},kernelFunc:function(e){const{backend:t,inputs:n,attrs:r}=e,{axis:o,keepDims:i}=r,{x:a}=n,s=t.dataIdMap.get(a.dataId).id;let l=s,u=a;const{transposed:p,axes:c,originalAxes:d,inputWasTransposed:h}=jq(a,o,t);let f=c;if(h){const e=t.dataIdMap.get(p.dataId).id;e!==s&&(u=p,l=e,f=h_(f.length,u.shape.length))}p_("sum",f,u.shape.length);const[g,m]=l_(u.shape,f),y=Bd(m),b=t.makeOutput(g,u.dtype);if(0!==Bd(u.shape)){const e=t.dataIdMap.get(b.dataId).id;nY(l,y,mq[b.dtype],e)}if(h&&t.disposeData(p.dataId),i){const e=u_(b.shape,d);b.shape=e}return b}},oY=_q(nm),iY=_q(rm);let aY;let sY;let lY;const uY=[wq,Sq,kq,Cq,Dq,Rq,Pq,zq,qq,Xq,Yq,Zq,eK,nK,oK,iK,aK,uK,cK,hK,gK,mK,yK,bK,_K,xK,vK,kK,EK,$q,TK,NK,AK,MK,OK,RK,BK,Iq,LK,WK,UK,zK,VK,GK,qK,XK,JK,QK,eX,rX,oX,iX,lX,pX,dX,hX,gX,mX,yX,$X,_X,xX,vX,kX,EX,IX,TX,Wq,NX,AX,MX,OX,DX,BX,LX,UX,zX,Gq,HX,GX,qX,KX,XX,YX,ZX,eY,tY,rY,oY,iY,{kernelName:om,backendName:"wasm",setupFunc:function(e){aY=e.wasm.cwrap(om,null,["number","array","number","array","number","number"])},kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,i=n.dataIdMap.get(o.dataId).id,{reps:a}=r,s=new Array(o.shape.length);for(let e=0;e<s.length;e++)s[e]=o.shape[e]*a[e];const l=new Uint8Array(new Int32Array(o.shape).buffer),u=new Uint8Array(new Int32Array(s).buffer),p=n.makeOutput(s,o.dtype),c=n.dataIdMap.get(p.dataId).id;return aY(i,l,o.shape.length,u,s.length,mq[p.dtype],c),p}},{kernelName:im,backendName:"wasm",setupFunc:function(e){sY=e.wasm.cwrap(im,null,["number","array","number","number","number","bool","number","number"])}
vendor: 4,552 bytes, line 2
2,kernelFunc:({inputs:e,backend:t,attrs:n})=>{const{x:r}=e,{k:o,sorted:i}=n,a=t.dataIdMap.get(r.dataId).id,s=new Uint8Array(new Int32Array(r.shape).buffer),l=r.shape.slice();l[l.length-1]=o;const u=t.makeOutput(l,r.dtype),p=t.dataIdMap.get(u.dataId).id,c=t.makeOutput(l,"int32"),d=t.dataIdMap.get(c.dataId).id;return sY(a,s,r.shape.length,mq[r.dtype],o,i,p,d),[u,c]}},{kernelName:am,backendName:"wasm",setupFunc:function(e){lY=e.wasm.cwrap(am,null,["number","number","bool","number","number","number","number","number","number","array","number","number","number","number","number"])},kernelFunc:function(e){const{backend:t,inputs:n,attrs:r}=e,{image:o,transforms:i}=n,{interpolation:a,fillMode:s,fillValue:l,outputShape:u}=r,[p,c,d,h]=o.shape,[f,g]=null!=u?u:[c,d],m=[p,f,g,h],y=new Uint8Array(new Int32Array(Zd(o.shape)).buffer),b=t.makeOutput(m,o.dtype),$=t.dataIdMap.get(b.dataId).id,_=t.dataIdMap.get(o.dataId).id,w=t.dataIdMap.get(i.dataId).id,x="nearest"===a?1:2;let S;switch(s){case"constant":default:S=1;break;case"reflect":S=2;break;case"wrap":S=3;break;case"nearest":S=4}return lY(_,w,i.shape[0]>1,p,f,g,h,d,c,y,o.shape.length-1,x,S,l,$),b}},Nq,{kernelName:um,backendName:"wasm",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{value:o}=t;let{axis:i}=r;i<0&&(i+=o.shape.length);const a=o.shape[i],s=o.shape.length,l=new Array(s-1);let u=0;for(let e=0;e<s;e++)e!==i&&(l[u++]=o.shape[e]);const p=new Array(a),c=new Array(s).fill(0),d=o.shape.slice();d[i]=1;for(let e=0;e<p.length;e++)c[i]=e,p[e]=Hq({inputs:{x:o},attrs:{begin:c,size:d},backend:n});return p.map(({dataId:e,dtype:t})=>({dataId:e,dtype:t,shape:l}))}},{kernelName:cm,backendName:"wasm",kernelFunc:function(e){const{inputs:{x:t},backend:n}=e,r=n.makeOutput(t.shape,t.dtype);return n.typedArrayFromHeap(r).fill(0),r}}];for(const e of uY)Sm(e);const pY=dh();pY.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]))),pY.registerFlag("WASM_HAS_MULTITHREAD_SUPPORT",async()=>{if(pY.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 cY=__webpack_require__(417),dY=__webpack_require__.n(cY),hY=__webpack_require__(805),fY=__webpack_require__.n(hY);class gY extends Fd{constructor(e){super(),this.wasm=e,this.dataIdNextNumber=1,this.wasm.tfjs.initWithThreadsCount(vY),kY=this.wasm.tfjs.getThreadsCount(),this.dataIdMap=new Td(this,Ob())}write(e,t,n){const r={id:this.dataIdNextNumber++};return this.move(r,e,t,n,1),r}numDataIds(){return this.dataIdMap.numDataIds()}async time(e){const t=Wm();return e(),{kernelMs:Wm()-t}}move(e,t,n,r,o){const i=this.dataIdNextNumber++;if("string"===r){const a=t;return void this.dataIdMap.set(e,{id:i,stringBytes:a,shape:n,dtype:r,memoryOffset:null,refCount:o})}const a=Bd(n),s=a*qd(r),l=this.wasm._malloc(s);this.dataIdMap.set(e,{id:i,memoryOffset:l,shape:n,dtype:r,refCount:o}),this.wasm.tfjs.registerTensor(i,a,l),null!=t&&this.wasm.HEAPU8.set(new Uint8Array(t.buffer,t.byteOffset,s),l)}async read(e){return this.readSync(e)}readSync(e){const{memoryOffset:t,dtype:n,shape:r,stringBytes:o}=this.dataIdMap.get(e);return"string"===n?o:function(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}`)}}(this.wasm.HEAPU8.slice(t,t+Bd(r)*qd(n)).buffer,n)}disposeData(e,t=!1){if(this.dataIdMap.has(e)){const 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){const t=this.dataIdMap.get(e);null!=t&&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 r;if(null==n)r=this.write(null,e,t);else{const o=this.dataIdNextNumber++;r={id:o},this.dataIdMap.set(r,{id:o,memoryOffset:n,shape:e,dtype:t,refCount:1});const i=Bd(e);this.wasm.tfjs.registerTensor(o,i,n)}return{dataId:r,shape:e,dtype:t}}typedArrayFromHeap({shape:e,dtype:t,dataId:n}){const r=this.wasm.HEAPU8.buffer,{memoryOffset:o}=this.dataIdMap.get(n),i=Bd(e);
2switch(t){case"float32":return new Float32Array(r,o,i);case"int32":return new Int32Array(r,o,i);case"bool":return new Uint8Array(r,o,i);default:throw new Error(`Unknown dtype ${t}`)}}}function mY(e,t,n){if(null!=$Y)return $Y;let r="tfjs-backend-wasm.wasm";return e&&t?r="tfjs-backend-wasm-threaded-simd.wasm":e&&(r="tfjs-backend-wasm-simd.wasm"),null!=wY&&null!=wY[r]?wY[r]:n+r}async function yY(){const[e,t]=await Promise.all([dh().getAsync("WASM_HAS_SIMD_SUPPORT"),dh().getAsync("WASM_HAS_MULTITHREAD_SUPPORT")]);return new Promise((n,r)=>{const o={};var i;o.locateFile=(n,r)=>{if(n.endsWith(".worker.js")){const e=new Blob(['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()}}}}'],{type:"application/javascript"});return URL.createObjectURL(e)}return n.endsWith(".wasm")?mY(e,t,null!=_Y?_Y:r):r+n},SY&&(o.instantiateWasm=(i=mY(e,t,null!=_Y?_Y:""),(e,t)=>(function(e,t){return dh().platform.fetch(e,t)}(i,{credentials:"same-origin"}).then(n=>{n.ok||e.env.a(`failed to load wasm binary file at '${i}'`),n.arrayBuffer().then(n=>{WebAssembly.instantiate(n,e).then(e=>{t(e.instance,e.module)})})}),{})));let a,s=!1;o.onAbort=()=>{s||xY||(xY=!0,r({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"}))},t&&e&&null==$Y?(o.mainScriptUrlOrBlob=new Blob(["var WasmBackendModuleThreadedSimd = "+dY().toString()],{t
2ype:"text/javascript"}),a=dY()(o)):a=fY()(o),a.then(e=>{s=!0,xY=!1,e.tfjs={init:e.cwrap("init",null,[]),initWithThreadsCount:e.cwrap("init_with_threads_count",null,["number"]),getThreadsCount:e.cwrap("get_threads_count","number",[]),registerTensor:e.cwrap("register_tensor",null,["number","number","number"]),disposeData:e.cwrap("dispose_data",null,["number"]),dispose:e.cwrap("dispose",null,[])},n({wasm:e})})})}const bY=["tfjs-backend-wasm.wasm","tfjs-backend-wasm-simd.wasm","tfjs-backend-wasm-threaded-simd.wasm"];let $Y=null,_Y=null,wY={},xY=!1,SY=!1,vY=-1,kY=null;var EY,IY;Wb("wasm",async()=>{const{wasm:e}=await yY();return new gY(e)},2),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"}(EY||(EY={})),function(e){let t;!function(e){e[e.LEGACY=0]="LEGACY",e[e.V1=1]="V1",e[e.V2=2]="V2"}(t=e.CheckpointFormatVersion||(e.CheckpointFormatVersion={}))}(IY||(IY={}));const TY={};function FY(e){return TY[e]}function NY(e,t,n,r,o){const i=t.inputParams[e];if(i&&void 0!==i.inputIndexStart){const e=i.inputIndexStart,a=0===i.inputIndexEnd?void 0:void 0===i.inputIndexEnd?e+1:i.inputIndexEnd;if("tensor"===i.type)return jY(t.inputNames[i.inputIndexStart],n,r,o);if("tensors"===i.type)return t.inputNames.slice(e,a).map(e=>jY(e,n,r,o));const s=jY(t.inputNames.slice(e)[0],n,r,o),l=s.dataSync();return"number"===i.type?l[0]:eh(s.shape,l)}const a=t.attrParams[e];return a&&a.value}function jY(e,t,n,r){const[o,i]=MY(e);if(null!=r){const e=r.getHashTableHandleByName(o);if(null!=e)return e}const a=n.currentContextIds.find(e=>!!t[CY(o,e)]);return void 0!==a?t[CY(o,a)][i]:void 0}function AY(e,t){const[n,r,o]=MY(e);return[CY(n,t&&t.currentContextId),r,o]}function CY(e,t){return t?`${e}-${t}`:e}function MY(e){const t=e.split(":");if(1===t.length)return[e,0,void 0];const n=t[0],r=3===t.length?t[1]:void 0;return[n,Number(t[t.length-1]),r]}function DY(e,t,n){let r=NY("pad",e,t,n);if("explicit"===r){r=NY("explicitPaddings",e,t,n);const o=[[0,0],[0,0],[0,0],[0,0]];for(let e=0;e<4;e++)o[e][0]=r[2*e],o[e][1]=r[2*e+1];return o}return r}function OY(e){return e.kept?e:fb(e)}const RY=[{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}
2]},{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}]}],BY=[{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}
2,{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}
2]},{tfOpName:"IsNan",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}],PY=[{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"}]}
2,{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"}]}],LY=[{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}
2]},{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}
vendor: 4,588 bytes, line 2
2,{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"}]}],WY=[{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"}]}],UY=[{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}
2,{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}]}],zY=[{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"}]}],VY=[{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"}]}],HY=[{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"}
2],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"}]}],GY=[{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"}]}],qY=[{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}]}],KY=[{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}
2]},{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"}]}],XY=[{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}]}],YY=[{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"}]}],JY=[{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}
2]},{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}]}],ZY=[{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"}]}],QY=[{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}]}],eJ=[{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"}]}
2],tJ=[{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:[]},{tfOpName:"BroadcastArgs",category:"transformation",inputs:[{start:0,name:"s0",type:"tensor"},{start:1,name:"s1",type:"tensor"}],attrs:[]}];class nJ{static get Instance(){return this._instance||(this._instance=new this)}constructor(){const e=[].concat(...[S,v,k,E,I,T,F,N,j,A,C,M,D,O,R,B,P,L,W].map(e=>e.json));this.opMappers=e.reduce((e,t)=>(e[t.tfOpName]=t,e),{})}transformGraph(e,t={}){const n=e.node,r=[],o=[],i=[],a=n.reduce((e,t)=>(e[t.name]=this.mapNode(t),t.op.startsWith("Placeholder")?r.push(e[t.name]):"Const"===t.op?o.push(e[t.name]):null!=t.input&&0!==t.input.length||i.push(e[t.name]),e),{});let s=[];const l=[];let u={},p={};null!=t&&(u=this.mapSignatureEntries(t.inputs),p=this.mapSignatureEntries(t.outputs));const c=Object.keys(a);c.forEach(e=>{const t=a[e];t.inputNames.forEach((e,n)=>{const[r,,o]=AY(e),i=a[r];if(null!=i.outputs){const e=i.outputs.indexOf(o);if(-1!==e){const o=`${r}:${e}`;t.inputNames[n]=o}}t.inputs.push(i),i.children.push(t)})}
vendor: 5,863 bytes, line 2
2),0===Object.keys(p).length?c.forEach(e=>{const t=a[e];0===t.children.length&&l.push(t)}):Object.keys(p).forEach(e=>{const[t]=AY(e),n=a[t];null!=n&&(n.signatureKey=p[e],l.push(n))}),Object.keys(u).length>0?Object.keys(u).forEach(e=>{const[t]=AY(e),n=a[t];n&&(n.signatureKey=u[e],s.push(n))}):s=r;let d={};null!=e.library&&null!=e.library.function&&(d=e.library.function.reduce((e,t)=>(e[t.signature.name]=this.mapFunction(t),e),{}));const h={nodes:a,inputs:s,outputs:l,weights:o,placeholders:r,signature:t,functions:d};return i.length>0&&(h.initNodes=i),h}mapSignatureEntries(e){return Object.keys(e||{}).reduce((t,n)=>(t[e[n].name]=n,t),{})}mapNode(e){const t=FY(e.op)||this.opMappers[e.op]||{};null==e.attr&&(e.attr={});const n={name:e.name,op:e.op,category:t.category,inputNames:(e.input||[]).map(e=>e.startsWith("^")?e.substr(1):e),inputs:[],children:[],inputParams:{},attrParams:{},rawAttrs:e.attr,outputs:t.outputs};return null!=t.inputs&&(n.inputParams=t.inputs.reduce((e,t)=>(e[t.name]={type:t.type,inputIndexStart:t.start,inputIndexEnd:t.end},e),{})),null!=t.attrs&&(n.attrParams=t.attrs.reduce((t,n)=>{const r=n.type;let o;switch(n.type){case"string":o=oJ(e.attr,n.tfName,n.defaultValue),void 0===o&&n.tfDeprecatedName&&(o=oJ(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"string[]":o=fJ(e.attr,n.tfName,n.defaultValue),void 0===o&&n.tfDeprecatedName&&(o=fJ(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"number":o=aJ(e.attr,n.tfName,n.defaultValue||0),void 0===o&&n.tfDeprecatedName&&(o=aJ(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"number[]":o=hJ(e.attr,n.tfName,n.defaultValue),void 0===o&&n.tfDeprecatedName&&(o=hJ(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"bool":o=iJ(e.attr,n.tfName,n.defaultValue),void 0===o&&n.tfDeprecatedName&&(o=iJ(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"bool[]":o=mJ(e.attr,n.tfName,n.defaultValue),void 0===o&&n.tfDeprecatedName&&(o=mJ(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"shape":o=dJ(e.attr,n.tfName,n.defaultValue),void 0===o&&n.tfDeprecatedName&&(o=dJ(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"shape[]":o=gJ(e.attr,n.tfName,n.defaultValue),void 0===o&&n.tfDeprecatedName&&(o=gJ(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"dtype":o=uJ(e.attr,n.tfName,n.defaultValue),void 0===o&&n.tfDeprecatedName&&(o=uJ(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"dtype[]":o=pJ(e.attr,n.tfName,n.defaultValue),void 0===o&&n.tfDeprecatedName&&(o=pJ(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"func":o=lJ(e.attr,n.tfName,n.defaultValue),void 0===o&&n.tfDeprecatedName&&(o=lJ(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"tensor":case"tensors":break;default:throw new Error(`Unsupported param type: ${n.type} for op: ${e.op}`)}return t[n.name]={value:o,type:r},t},{})),n}mapFunction(e){const t=e.nodeDef,n=[];let r={};null!=t&&(r=t.reduce((e,t)=>(e[t.name]=this.mapNode(t),"Const"===t.op&&n.push(e[t.name]),e),{}));const o=[],i=[];e.signature.inputArg.forEach(e=>{const[t]=AY(e.name),n={name:t,op:"Placeholder",inputs:[],inputNames:[],category:"graph",inputParams:{},attrParams:{dtype:{value:sJ(e.type),type:"dtype"}},children:[]};n.signatureKey=e.name,o.push(n),r[t]=n}),Object.keys(r).forEach(e=>{const t=r[e];t.inputNames.forEach((e,n)=>{const[o,,i]=AY(e),a=r[o];if(null!=a.outputs){const e=a.outputs.indexOf(i);if(-1!==e){const r=`${o}:${e}`;t.inputNames[n]=r}}t.inputs.push(a),a.children.push(t)})});const a=e.ret;e.signature.outputArg.forEach(e=>{const[t,n]=AY(a[e.name]),o=r[t];null!=o&&(o.defaultOutput=n,i.push(o))});const s=this.mapArgsToSignature(e);return{nodes:r,inputs:o,outputs:i,weights:n,placeholders:[],signature:s}}mapArgsToSignature(e){return{methodName:e.signature.name,inputs:e.signature.inputArg.reduce((e,t)=>(e[t.name]=this.mapArgToTensorInfo(t),e),{}),outputs:e.signature.outputArg.reduce((t,n)=>(t[n.name]=this.mapArgToTensorInfo(n,e.ret),t),{})}}mapArgToTensorInfo(e,t){let n=e.name;return null!=t&&(n=t[n]),{name:n,dtype:e.type}}}function rJ(e,t){const n=Array.isArray(e)?String.fromCharCode.apply(null,e):function(e){const t=dh().global;if(void 0!==t.atob)return t.atob(e);if("undefined"!=typeof Buffer)return new Buffer(e,"base64").toString();throw new Error("Unable to decode base64 in this environment. Missing built-in atob() or Buffer()")}(e);return t?n:n.toLowerCase()}function oJ(e,t,n,r=!1){const o=e[t];return null!=o?rJ(o.s,r):n}function iJ(e,t,n){const r=e[t];return r?r.b:n}function aJ(e,t,n){const r=e[t]||{},o=null!=r.i?r.i:null!=r.f?r.f:n;return"number"==typeof o?o:parseInt(o,10)}function sJ(e){switch("string"==typeof e&&(e=EY[e]),e){case EY.DT_FLOAT:return"float32";case EY.DT_INT32:case EY.DT_INT64:case EY.DT_INT8:case EY.DT_UINT8:return"int32";case EY.DT_BOOL:return"bool";case EY.DT_DOUBLE:return"float32";case EY.DT_STRING:return"string";default:return null}}function lJ(e,t,n){const r=e[t];return r&&r.func?r.func.name:n}function uJ(e,t,n){const r=e[t];return r&&r.type?sJ(r.type):n}function pJ(e,t,n){const r=e[t];return r&&r.list&&r.list.type?r.list.type.map(e=>sJ(e)):n}function cJ(e){if(!e.unknownRank)return null!=e.dim?e.dim.map(e=>"number"==typeof e.size?e.size:parseInt(e.size,10)):[]}function dJ(e,t,n){const r=e[t];return r&&r.shape?cJ(r.shape):n}function hJ(e,t,n){const r=e[t];return r?((r.list.f&&r.list.f.length?r.list.f:r.list.i)||[]).map(e=>"number"==typeof e?e:parseInt(e,10)):n}function fJ(e,t,n,r=!1){const o=e[t];return o&&o.list&&o.list.s?o.list.s.map(e=>rJ(e,r)):n}function gJ(e,t,n){const r=e[t];return r&&r.list&&r.list.shape?r.list.shape.map(e=>cJ(e)):n}function mJ(e,t,n){const r=e[t];return r&&r.list&&r.list.b?r.list.b:n}class yJ{constructor(e,t,n){this.node=e,this.tensorMap=t,this.context=n,this.inputs=[],this.attrs={},this.inputs=e.inputNames.map(e=>this.getInput(e)),null!=e.rawAttrs&&(this.attrs=Object.keys(e.rawAttrs).reduce((e,t)=>
2(e[t]=this.getAttr(t),e),{}))}getInput(e){return jY(e,this.tensorMap,this.context)}getAttr(e,t){const n=this.node.rawAttrs[e];if(null!=n.tensor)return jY(e,this.tensorMap,this.context);if(null!=n.i||null!=n.f)return aJ(this.node.rawAttrs,e,t);if(null!=n.s)return oJ(this.node.rawAttrs,e,t);if(null!=n.b)return iJ(this.node.rawAttrs,e,t);if(null!=n.shape)return dJ(this.node.rawAttrs,e,t);if(null!=n.type)return uJ(this.node.rawAttrs,e,t);if(null!=n.list){if(null!=n.list.i||null!=n.list.f)return hJ(this.node.rawAttrs,e,t);if(null!=n.list.s)return fJ(this.node.rawAttrs,e,t);if(null!=n.list.shape)return gJ(this.node.rawAttrs,e,t);if(null!=n.list.b)return mJ(this.node.rawAttrs,e,t);if(null!=n.list.type)return pJ(this.node.rawAttrs,e,t)}return t}}const bJ=Iy({addN_:function(e){Md(Array.isArray(e),()=>"The argument passed to tf.addN() must be a list of tensors"),Md(e.length>=1,()=>`Must pass at least one tensor to tf.addN(), but got ${e.length}`);const t=e.map((e,t)=>ky(e,`tensors${t}`,"addN")),n=t[0];t.forEach(e=>{if(e.dtype!==n.dtype)throw new Error("All tensors passed to tf.addN() must have the same dtype")}),t.forEach(e=>{if(!Pd(e.shape,n.shape))throw new Error("All tensors passed to tf.addN() must have the same shape")});const r=t;return $y.runKernel(wh,r)}}),$J=Iy({mod_:function(e,t){let n=ky(e,"a","mod"),r=ky(t,"b","mod");[n,r]=cy(n,r);const o={a:n,b:r};return $y.runKernel(ng,o)}}),_J=Iy({divNoNan_:function(e,t){let n=ky(e,"a","div"),r=ky(t,"b","div");[n,r]=cy(n,r);const o=j$(n,r),i=Z_(o),a=O$(r,i);return J_(a,i,o)}}),wJ=Iy({acos_:function(e){const t={x:ky(e,"x","acos")};return $y.runKernel(bh,t)}}),xJ=Iy({acosh_:function(e){const t={x:ky(e,"x","acosh")};return $y.runKernel($h,t)}}),SJ=Iy({asin_:function(e){const t={x:ky(e,"x","asin")};return $y.runKernel(Eh,t)}}),vJ=Iy({asinh_:function(e){const t={x:ky(e,"x","asinh")};return $y.runKernel(Ih,t)}}),kJ=Iy({atan_:function(e){const t={x:ky(e,"x","atan")};return $y.runKernel(Th,t)}}),EJ=Iy({atan2_:function(e,t){let n=ky(e,"a","atan2"),r=ky(t,"b","atan2");[n,r]=cy(n,r);const o={a:n,b:r};return $y.runKernel(Nh,o)}}),IJ=Iy({atanh_:function(e){const t={x:ky(e,"x","atanh")};return $y.runKernel(Fh,t)}}),TJ=Iy({ceil_:function(e){const t={x:ky(e,"x","ceil","float32")};return $y.runKernel(Lh,t)}}),FJ=Iy({erf_:function(e){let t=ky(e,"x","erf");Md("int32"===t.dtype||"float32"===t.dtype,()=>"Input dtype must be `int32` or `float32`."),"int32"===t.dtype&&(t=hb(t,"float32"));const n={x:t};return $y.runKernel(ff,n)}}),NJ=Iy({expm1_:function(e){const t={x:ky(e,"x","expm1")};return $y.runKernel(bf,t)}}),jJ=Iy({reciprocal_:function(e){const t={x:ky(e,"x","reciprocal")};return $y.runKernel($g,t)}}),AJ=Iy({sign_:function(e){const t={x:ky(e,"x","sign")};return $y.runKernel(Og,t)}}),CJ=Iy({tan_:function(e){const t={x:ky(e,"x","tan","float32")};return $y.runKernel(nm,t)}}),MJ=Iy({prod_:function(e,t=null,n=!1){let r=ky(e,"x","prod");"bool"===r.dtype&&(r=hb(r,"int32"));const o={x:r},i={axis:t,keepDims:n};return $y.runKernel(mg,o,i)}}),DJ=Iy({isNaN_:function(e){const t={x:ky(e,"x","isNaN")};return $y.runKernel(Cf,t)}});function OJ(e,t,n=""){if("number"!=typeof e&&"number"!=typeof t){Md(e.length===t.length,()=>n+` Shapes ${e} and ${t} must match`);for(let r=0;r<e.length;r++){const o=e[r],i=t[r];Md(o<0||i<0||o===i,()=>n+` Shapes ${e} and ${t} must match`)}}}function RJ(e){return"number"!=typeof e&&!e.some(e=>e<0)}function BJ(e,t,n){let r=PJ(e,n);const o=!RJ(r);if(o&&0===t.length)throw new Error(`Tried to calculate elements of an empty list with non-fully-defined elementShape: ${r}`);if(o&&t.forEach(e=>{r=PJ(e.shape,r)}),!RJ(r))throw new Error(`Non-fully-defined elementShape: ${r}`);return r}function PJ(e,t){if("number"==typeof e)return t;if("number"==typeof t)return e;if(e.length!==t.length)throw new Error(`Incompatible ranks during merge: ${e} vs. ${t}`);const n=[];for(let r=0;r<e.length;++r){const o=e[r],i=t[r];if(o>=0&&i>=0&&o!==i)throw new Error(`Incompatible shape during merge: ${e} vs. ${t}`);n[r]=o>=0?o:i}return n}class LJ{constructor(e,t,n,r,o,i,a){this.name=e,this.dtype=t,this.maxSize=n,this.elementShape=r,this.identicalElementShapes=o,this.dynamicSize=i,this.clearAfterRead=a,this.tensors=[],this.closed_
vendor: 4,113 bytes, line 2
2=!1,this.idTensor=zb(0),Lb(this.idTensor)}get id(){return this.idTensor.id}get closed(){return this.closed_}clearAndClose(e){this.tensors.forEach(t=>{null!=e&&e.has(t.tensor.id)||t.tensor.dispose()}),this.tensors=[],this.closed_=!0,this.idTensor.dispose()}size(){return this.tensors.length}read(e){if(this.closed_)throw new Error(`TensorArray ${this.name} has already been closed.`);if(e<0||e>=this.size())throw new Error(`Tried to read from index ${e}, but array size is: ${this.size()}`);const t=this.tensors[e];if(t.cleared)throw new Error(`TensorArray ${this.name}: Could not read index ${e} twice because it was cleared after a previous read (perhaps try setting clear_after_read = false?).`);return this.clearAfterRead&&(t.cleared=!0),t.read=!0,t.tensor}readMany(e){return e.map(e=>this.read(e))}write(e,t){if(this.closed_)throw new Error(`TensorArray ${this.name} has already been closed.`);if(e<0||!this.dynamicSize&&e>=this.maxSize)throw new Error(`Tried to write to index ${e}, but array is not resizeable and size is: ${this.maxSize}`);const n=this.tensors[e]||{};if(t.dtype!==this.dtype)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e},\n          because the value dtype is ${t.dtype}, but TensorArray dtype is ${this.dtype}.`);if(0!==this.size()||null!=this.elementShape&&0!==this.elementShape.length||(this.elementShape=t.shape),OJ(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,Lb(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((e,n)=>this.write(e,t[n]))}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 t=0;t<this.size();t++)e.push(t)}if(0===e.length)return Ny([],[0].concat(this.elementShape));const n=this.readMany(e);return OJ(this.elementShape,n[0].shape,"TensorArray shape mismatch: "),V_(n,0)}concat(e){if(e&&e!==this.dtype)throw new Error(`TensorArray dtype is ${this.dtype} but concat requested dtype ${e}`);if(0===this.size())return Ny([],[0].concat(this.elementShape));const t=[];for(let e=0;e<this.size();e++)t.push(e);const n=this.readMany(t);return OJ(this.elementShape,n[0].shape,`TensorArray shape mismatch: tensor array shape (${this.elementShape}) vs first tensor shape (${n[0].shape})`),y$(n,0)}scatter(e,t){if(t.dtype!==this.dtype)throw new Error(`TensorArray dtype is ${this.dtype} but tensor has dtype ${t.dtype}`);if(e.length!==t.shape[0])throw new Error(`Expected len(indices) == tensor.shape[0], but saw: ${e.length} vs. ${t.shape[0]}`);const n=Math.max(...e);if(!this.dynamicSize&&n>=this.maxSize)throw new Error(`Max index must be < array size (${n}  vs. ${this.maxSize})`);this.writeMany(e,X_(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;const r=e.map(e=>(n+=e,n));if(n!==t.shape[0])throw new Error(`Expected sum of lengths to be equal to\n          tensor.shape[0], but sum of lengths is\n        ${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`);const o=0===n?0:t.size/n,i=[];Bb(()=>{t=u$(t,[1,n,o]);for(let n=0;n<e.length;++n){const a=[0,0===n?0:r[n-1],0],s=[1,e[n],o];i[n]=u$(M_(t,a,s),this.elementShape)}return i});const a=[];for(let t=0;t<e.length;t++)a[t]=t;this.writeMany(a,i)}}class WJ{constructor(e,t,n,r=-1){this.tensors=e,this.elementShape=t,this.elementDtype=n,null!=e&&e.forEach(e
2=>{if(n!==e.dtype)throw new Error(`Invalid data types; op elements ${n}, but list elements ${e.dtype}`);OJ(t,e.shape,"TensorList shape mismatch: "),Lb(e)}),this.idTensor=zb(0),this.maxNumElements=r,Lb(this.idTensor)}get id(){return this.idTensor.id}copy(){return new WJ([...this.tensors],this.elementShape,this.elementDtype)}clearAndClose(e){this.tensors.forEach(t=>{null!=e&&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(-1!==n&&this.tensors.length!==n)throw new Error(`Operation expected a list with ${n} elements but got a list with ${this.tensors.length} elements.`);OJ(e,this.elementShape,"TensorList shape mismatch: ");const r=BJ(this.elementShape,this.tensors,e);return Bb(()=>{const e=this.tensors.map(e=>u$(e,r));return V_(e,0)})}popBack(e,t){if(t!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t}, but list elements ${this.elementDtype}`);if(0===this.size())throw new Error("Trying to pop from an empty list.");const n=BJ(this.elementShape,this.tensors,e),r=this.tensors.pop();return OJ(r.shape,e,"TensorList shape mismatch: "),u$(r,n)}pushBack(e){if(e.dtype!==this.elementDtype)throw new Error(`Invalid data types; op elements ${e.dtype}, but list elements ${this.elementDtype}`);if(OJ(e.shape,this.elementShape,"TensorList shape mismatch: "),this.maxNumElements===this.size())throw new Error("Trying to push element into a full list.");Lb(e),this.tensors.push(e)}resize(e){if(e<0)throw new Error(`TensorListResize expects size to be non-negative. Got: ${e}`);if(-1!==this.maxNumElements&&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(null==this.tensors[e])throw new Error(`element at index ${e} is null.`);OJ(this.tensors[e].shape,t,"TensorList shape mismatch: ");const r=BJ(this.elementShape,this.tensors,t);return u$(this.tensors[e],r)}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||-1!==this.maxNumElements&&e>=this.maxNumElements)throw new Error(`Trying to set element ${e} in a list with max ${this.maxNumElements} elements.`);OJ(this.elementShape,t.shape,"TensorList shape mismatch: "),Lb(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}`);OJ(this.elementShape,n,"TensorList shape mismatch: "),e=e.slice(0,this.size());const r=BJ(this.elementShape,this.tensors,n);return 0===e.length?Ny([],[0].concat(r)):Bb(()=>{const t=e.map(e=>u$(this.tensors[e],r));return V_(t,0)})}concat(e,t){if(e&&e!==this.elementDtype)throw new Error(`TensorList dtype is ${this.elementDtype} but concat requested dtype ${e}`);OJ(this.elementShape,t,"TensorList shape mismatch: ");const n=BJ(this.elementShape,this.tensors,t);return 0===this.size()?Ny([],[0].concat(n)):Bb(()=>{const e=this.tensors.map(e=>u$(e,n));return y$(e,0)})}}const UJ=Iy({maxPoolWithArgmax_:function(e,t,n,r,o=!1){const i={x:ky(e,"x","maxPoolWithArgmax")},a={filterSize:t,strides:n,pad:r,includeBatchInIndex:o},s=$y.runKernel(Jf,i,a);return{result:s[0],indexes:s[1]}}}),zJ=Iy({dilation2d_:function(e,t,n,r,o=[1,1],i="NHWC"){const a=ky(e,"x","dilation2d"),s=ky(t,"filter","dilation2d");Md(3===a.rank||4===a.rank,()=>`Error in dilation2d: input must be rank 3 or 4, but got rank ${a.rank}.`),Md(3===s.rank,()=>`Error in dilation2d: filter must be rank 3, but got rank ${s.rank}.`),Md("NHWC"===i,()=>`Error in dilation2d: Only NHWC is currently supported, but got dataFormat of ${i}`);let l=a,u=!1;3===a.rank&&(l=u$(a,[1,a.shape[0],a.shape[1],a.shape[2]]),u=!0);const p={x:l,filter:s},c={strides:n,pad:r,dilations:o},d=$y.runKernel(sf,p,c);return u?u$(d,[d.shape[1],d.shape[2],d.shape[3]]):d}});function VJ(e,t,n){const[r,o]=NY("fusedOps",e,t,n),i="biasadd"===r,a=!i,s="prelu"===o,l="fusedbatchnorm"===r,u=NY("numArgs",e,t,n);if(i){if(s&&2!==u)throw new Error("FusedConv2d and DepthwiseConv2d with BiasAdd and Prelu must have two extra arguments: bias and alpha.");if(!s&&i&&1!==u)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");const p=NY("strides",e,t,n),c=DY(e,t,n),d=NY("dataFormat",e,t,n).toUpperCase(),h=NY("dilations",e,t,n);let[f,g]=NY("args",e,t,n);return a&&(g=f,f=void 0),{stride:p,pad:c,dataFormat:d,dilations:h,biasArg:f,preluArg:g,activationFunc:o,leakyreluAlpha:NY("leakyreluAlpha",e,t,n)}}function HJ(e,t,n){if(n<=0)throw new Error("The number of values should be positive.");const r={start:e,stop:t,num:n};return $y.runKernel(Rf,{},r)}const GJ=Iy({multinomial_:function(e,t,n,r=!1){const o=ky(e,"logits","multinomial"),i=o.size,a=o.rank;if(i<2)throw new Error(`Error in multinomial: you need at least 2 outcomes, but got ${i}.`);if(a>2)throw new Error(`Rank of probabilities must be 1 or 2, but is ${a}`);n=n||Math.random();const s={logits:1===a?u$(o,[1,-1]):o},l={numSamples:t,seed:n,normalized:r},u=$y.runKernel(rg,s,l);return 1===a?u$(u,[u.size]):u}}),qJ=async function(e){const t=ky(e,"condition","whereAsync","bool"),n=await t.data(),r=Xx(t.shape,n);
2return e!==t&&t.dispose(),r};function KJ(e,t,n){return{boxes:NY("boxes",e,t,n),scores:NY("scores",e,t,n),maxOutputSize:NY("maxOutputSize",e,t,n),iouThreshold:NY("iouThreshold",e,t,n),scoreThreshold:NY("scoreThreshold",e,t,n),softNmsSigma:NY("softNmsSigma",e,t,n)}}const XJ=Iy({topk_:function(e,t=1,n=!0){const r=ky(e,"x","topk");if(0===r.rank)throw new Error("topk() expects the input to be of rank 1 or higher");const o=r.shape[r.shape.length-1];if(t<0)throw new Error(`'k' passed to topk() must be >= 0 but got ${t}`);if(t>o)throw new Error(`'k' passed to topk() must be <= the last dimension (${o}) but got ${t}`);const i={x:r},a={k:t,sorted:n},[s,l]=$y.runKernel(im,i,a);return{values:s,indices:l}}}),YJ=Iy({unique_:function(e,t=0){const n=ky(e,"x","unique","string_or_numeric");Md(n.rank>0,()=>"The input tensor must be at least 1D");const r={x:n},o={axis:t},[i,a]=$y.runKernel(lm,r,o);return{values:i,indices:a}}});class JJ{constructor(e,t){this.keyDType=e,this.valueDType=t,this.handle=zb(0),this.tensorMap=new Map,Lb(this.handle)}get id(){return this.handle.id}clearAndClose(){this.tensorMap.forEach(e=>e.dispose()),this.tensorMap.clear(),this.handle.dispose()}size(){return this.tensorMap.size}tensorSize(){return zb(this.size(),"int32")}async import(e,t){this.checkKeyAndValueTensor(e,t);const n=await e.data();return this.tensorMap.forEach(e=>e.dispose()),this.tensorMap.clear(),Bb(()=>{const e=X_(t),r=n.length,o=e.length;Md(r===o,()=>`The number of elements doesn't match, keys has ${r} elements, the values has ${o} elements.`);for(let t=0;t<r;t++){const r=n[t],o=e[t];Lb(o),this.tensorMap.set(r,o)}return this.handle})}async find(e,t){this.checkKeyAndValueTensor(e,t);const n=await e.data();return Bb(()=>{const e=[];for(let r=0;r<n.length;r++){const o=n[r],i=this.findWithDefault(o,t);e.push(i)}return V_(e)})}findWithDefault(e,t){const n=this.tensorMap.get(e);return null!=n?n:t}checkKeyAndValueTensor(e,t){if(e.dtype!==this.keyDType)throw new Error(`Expect key dtype ${this.keyDType}, but got ${e.dtype}`);if(t.dtype!==this.valueDType)throw new Error(`Expect value dtype ${this.valueDType}, but got ${t.dtype}`)}}const ZJ=Iy({logicalOr_:function(e,t){const n=ky(e,"a","logicalOr","bool"),r=ky(t,"b","logicalOr","bool");D$(n.shape,r.shape);const o={a:n,b:r};return $y.runKernel(Uf,o)}}),QJ=Iy({einsum_:function(e,...t){const n=t.map((e,t)=>ky(e,`tensors${t}`,"einsum")),r={equation:e};return $y.runKernel(cf,n,r)}}),eZ=Iy({localResponseNormalization_:function(e,t=5,n=1,r=1,o=.5){const i=ky(e,"x","localResponseNormalization");Md(4===i.rank||3===i.rank,()=>`Error in localResponseNormalization: x must be rank 3 or 4 but got\n               rank ${i.rank}.`),Md(Ld(t),()=>`Error in localResponseNormalization: depthRadius must be an integer but got depthRadius ${t}.`);let a=i,s=!1;3===i.rank&&(s=!0,a=u$(i,[1,i.shape[0],i.shape[1],i.shape[2]]));const l={x:a},u={depthRadius:t,bias:n,alpha:r,beta:o},p=$y.runKernel(zf,l,u);return s?u$(p,[p.shape[1],p.shape[2],p.shape[3]]):p}}),tZ=Iy({sparseToDense_:function(e,t,n,r=0){const o=ky(e,"sparseIndices","sparseToDense","int32"),i=ky(t,"sparseValues","sparseToDense"),a=ky(r,"defaultValue","sparseToDense",i.dtype);!function(e,t,n,r){if("int32"!==e.dtype)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}.`);const o=e.rank>0?e.shape[0]:1,i=e.rank>1?e.shape[1]:1;if(n.length!==i)throw new Error(`outputShape has incorrect number of elements:, ${n.length}, should be: ${i}.`);const a=t.size;if(0!==t.rank&&(1!==t.rank||a!==o))throw new Error(`sparseValues has incorrect shape ${t.shape}, should be [] or [${o}]`);if(t.dtype!==r.dtype)throw new Error("sparseValues.dtype must match defaultValues.dtype")}(o,i,n,a);const s={sparseIndices:o,sparseValues:i,defaultValue:a},l={outputShape:n};return $y.runKernel(Kg,s,l)}}),nZ=Iy({argMin_:function(e,t=0){const n={x:ky(e,"x","argMin")},r={axis:t};return $y.runKernel(kh,n,r)}}),rZ=Iy({denseBincount_:function(e,t,n,r=!1){const o=ky(e,"x","denseBincount"),i=ky(t,"weights","denseBincount");Md("int32"===o.dtype,()=>`Error in denseBincount: input dtype must be int32, but got ${o.dtype}`),Md(o.rank<=2,()=>`Error in denseBincount: input must be at most rank 2, but got rank ${o.rank}.`),Md(n>=0,()=>`size must be non-negative, but got ${n}.`),Md(i.size===o.size||0===i.size,()=>`Error in denseBincount: weights must have the same shape as x or 0-length, but got x shape: ${o.shape}, weights shape: ${i.shape}.`);const a={x:o,weights:i},s={size:n,binaryOutput:r};return $y.runKernel(tf,a,s)}}),oZ=Iy({stridedSlice_:function(e,t,n,r,o=0,i=0,a=0,s=0,l=0){const u={x:ky(e,"x","stridedSlice","string_or_numeric")},p={begin:t,end:n,strides:r,beginMask:o,endMask:i,ellipsisMask:a,newAxisMask:s,shrinkAxisMask:l};return $y.runKernel(Jg,u,p)}}),iZ=Iy({scatterND_:function(e,t,n){const r=ky(e,"indices","scatterND","int32"),o=ky(t,"updates","scatterND");!function(e,t,n){if(t.rank<1)throw new Error(`tf.scatterND() expects the indices to be rank 1 or higher, but the rank was ${t.rank}.`);if(e.rank<1)throw new Error(`tf.scatterND() expects the updates to be rank 1 or higher, but the rank was ${e.rank}.`);if("int32"!==t.dtype)throw new Error(`The dtype of 'indices' should be int32, but got dtype: ${t.dtype}`);if(n.length<1)throw new Error(`Output rank must be greater or equal to 1, but got shape: ${n}`);if(0===n.length){if(0===t.size)throw new Error(`Indices specified for empty output. indices shape: ${t.shape}`);if(0===e.size)throw new Error(`Updates specified for empty output. updates shape: ${e.shape}`)}!function(e,t,n){const r=t.rank>1?t.shape[t.rank-1]:1,o=t.rank>1?t.rank-1:1,i=`Must have updates.shape = indices.shape[:batchDim] + shape[sliceDim:], got updates.shape: ${n.shape}, indices.shape: ${t.shape}, shape: ${e}, sliceDim: ${r}, and batchDim: ${o}.`;if(n.rank<o)throw new Error(i+` update.rank < ${o}. `);if(e.length<r+(n.rank-o))throw new Error(i+` Output shape length < ${r+(n.rank-o)}`);if(n.rank!==o+e.length-r)throw new Error(i+" update.rank != "+(o+e.length-r));for(let e=0;e<o;++e)if(n.shape[e]!==t.shape[e])throw new Error(i+` updates.shape[${e}] (${n.shape[e]}) != indices.shape[${e}] (${t.shape[e]}).`);for(let t=0;t<n.rank-o;++t)if(n.shape[t+o]!==e[t+r])throw new Error(i+` updates.shape[${t+o}] (${n.shape[t+o]}) != shape[${t+o}] (${e[t+o]})`)}(n,t,e)}(o,r,n);const i={indices:r,updates:o},a={shape:n};return $y.runKernel(Ng,i,a)}}),aZ=Iy({gatherND_:function(e,t){const n=ky(t,"indices","gatherND","int32"),r={params:ky(e,"x","gatherND","string_or_numeric"),indices:n};return $y.runKernel(kf,r)}}),sZ=Iy({mirrorPad_:function(e,t,n){Md("reflect"===n||"symmetric"===n,()=>`Invalid mode. Mode must be either reflect or symmetric. Got ${n}.`);const r=ky(e,"x","mirrorPad");if(0===r.rank)throw new Error("mirrorPad(scalar) is not defined. Pass non-scalar to mirrorPad");Md(t.length===r.rank,()=>`Padding doesn't match input. Must be ${r.rank}. Got ${t.length}.`);const o="reflect"===n?1:0;for(let e=0;e<r.rank;e++)Md(2===t[e].length,()=>"Invalid number of paddings. Must be length of 2 each."),Md(t[e][0]>=0&&t[e][0]<=r.shape[e]-o&&t[e][1]>=0&&t[e][1]<=r.shape[e]-o,()=>`Padding in dimension ${e} cannot be greater than or equal to ${r.shape[e]-o} or less than 0 for input of shape ${r.shape}`);const i={paddings:t,mode:n},a={x:r};return $y.runKernel(tg,a,i)}}),lZ=Iy({depthToSpace_:function(e,t,n="NHWC"){const r=ky(e,"x","depthToSpace","float32"),o="NHWC"===n?r.shape[1]:r.shape[2],i="NHWC"===n?r.shape[2]:r.shape[3],a="NHWC"===n?r.shape[3]:r.shape[1];Md(t>1,()=>`blockSize should be > 1 for depthToSpace, but was: ${t}`),Md(o*t>=0,()=>
2`Negative dimension size caused by overflow when multiplying\n    ${o} and ${t}  for depthToSpace with input shape\n    ${r.shape}`),Md(i*t>=0,()=>`Negative dimension size caused by overflow when multiplying\n    ${i} and ${t} for depthToSpace with input shape\n        ${r.shape}`),Md(a%(t*t)===0,()=>`Dimension size must be evenly divisible by ${t*t} but is ${a} for depthToSpace with input shape ${r.shape}`);const s={x:r},l={blockSize:t,dataFormat:n};return $y.runKernel(nf,s,l)}}),uZ=Iy({broadcastArgs_:function(e,t){const n=ky(e,"s0","broadcastArgs","int32"),r=ky(t,"s1","broadcastArgs","int32");if(1!==n.rank)throw new Error(`broadcastArgs(): first input must be a vector (rank=1). Has rank ${n.rank}`);if(1!==r.rank)throw new Error(`broadcastArgs(): second input must be a vector (rank=1). Has rank ${r.rank}`);const o={s0:n,s1:r};return $y.runKernel(Bh,o)}});function pZ(e,t,n,r){const o=((e,t,n)=>{switch(e.category){case"arithmetic":return Bb(()=>((e,t,n)=>{switch(e.op){case"BiasAdd":case"AddV2":case"Add":return[Gb(NY("a",e,t,n),NY("b",e,t,n))];case"AddN":return[bJ(NY("tensors",e,t,n))];case"FloorMod":case"Mod":return[$J(NY("a",e,t,n),NY("b",e,t,n))];case"Mul":return[Y$(NY("a",e,t,n),NY("b",e,t,n))];case"RealDiv":case"Div":return[j$(NY("a",e,t,n),NY("b",e,t,n))];case"DivNoNan":return[_J(NY("a",e,t,n),NY("b",e,t,n))];case"FloorDiv":return[N$(NY("a",e,t,n),NY("b",e,t,n))];case"Sub":return[J$(NY("a",e,t,n),NY("b",e,t,n))];case"Minimum":return[a_(NY("a",e,t,n),NY("b",e,t,n))];case"Maximum":return[o_(NY("a",e,t,n),NY("b",e,t,n))];case"Pow":return[Xw(NY("a",e,t,n),NY("b",e,t,n))];case"SquaredDifference":return[rx(NY("a",e,t,n),NY("b",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"basic_math":return Bb(()=>((e,t,n)=>{switch(e.op){case"Abs":case"ComplexAbs":return[Hb(NY("x",e,t,n))];case"Acos":return[wJ(NY("x",e,t,n))];case"Acosh":return[xJ(NY("x",e,t,n))];case"Asin":return[SJ(NY("x",e,t,n))];case"Asinh":return[vJ(NY("x",e,t,n))];case"Atan":return[kJ(NY("x",e,t,n))];case"Atan2":return[EJ(NY("x",e,t,n),NY("y",e,t,n))];case"Atanh":return[IJ(NY("x",e,t,n))];case"Ceil":return[TJ(NY("x",e,t,n))];case"Complex":return[Ty(NY("real",e,t,n),NY("imag",e,t,n))];case"Cos":return[Pv(NY("x",e,t,n))];case"Cosh":return[Wv(NY("x",e,t,n))];case"Elu":return[A$(NY("x",e,t,n))];case"Erf":return[FJ(NY("x",e,t,n))];case"Exp":return[R$(NY("x",e,t,n))];case"Expm1":return[NJ(NY("x",e,t,n))];case"Floor":return[U$(NY("x",e,t,n))];case"Log":return[q$(NY("x",e,t,n))];case"Log1p":return[K$(NY("x",e,t,n))];case"Imag":return[tw(NY("x",e,t,n))];case"Neg":return[m_(NY("x",e,t,n))];case"Reciprocal":return[jJ(NY("x",e,t,n))];case"Real":return[nw(NY("x",e,t,n))];case"Relu":return[F_(NY("x",e,t,n))];case"Round":return[zw(NY("x",e,t,n))];case"Selu":return[j_(NY("x",e,t,n))];case"Sigmoid":return[C_(NY("x",e,t,n))];case"Sin":return[kS(NY("x",e,t,n))];case"Sign":return[AJ(NY("x",e,t,n))];case"Sinh":return[IS(NY("x",e,t,n))];case"Softplus":return[L_(NY("x",e,t,n))];case"Sqrt":return[U_(NY("x",e,t,n))];case"Square":return[f_(NY("x",e,t,n))];case"Tanh":return[H_(NY("x",e,t,n))];case"Tan":return[CJ(NY("x",e,t,n))];case"ClipByValue":return[m$(NY("x",e,t,n),NY("clipValueMin",e,t,n),NY("clipValueMax",e,t,n))];case"Relu6":return[lw(NY("x",e,t,n))];case"Rsqrt":return[LS(jY(e.inputNames[0],t,n))];case"Prod":return[MJ(NY("x",e,t,n),NY("axes",e,t,n))];case"LeakyRelu":return[G$(NY("x",e,t,n),NY("alpha",e,t,n))];case"Prelu":return[S_(NY("x",e,t,n),NY("alpha",e,t,n))];case"IsNan":return[DJ(jY(e.inputNames[0],t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"control":return(async(e,t,n)=>{switch(e.op){case"If":case"StatelessIf":{const r=NY("thenBranch",e,t,n),o=NY("elseBranch",e,t,n),i=NY("cond",e,t,n),a=NY("args",e,t,n);return(await i.data())[0]?n.functionMap[r].executeFunctionAsync(a,n.tensorArrayMap,n.tensorListMap):n.functionMap[o].executeFunctionAsync(a,n.tensorArrayMap,n.tensorListMap)}case"While":case"StatelessWhile":{const r=NY("body",e,t,n),o=NY("cond",e,t,n),i=NY("args",e,t,n),a=await n.functionMap[o].executeFunctionAsync(i,n.tensorArrayMap,n.tensorListMap),s=i.map(e=>e.id);let l=await a[0].data();
vendor: 6,961 bytes, line 2
2a.forEach(e=>{e.kept||-1!==s.indexOf(e.id)||e.dispose()});let u=i;for(;l[0];){const e=u;u=await n.functionMap[r].executeFunctionAsync(u,n.tensorArrayMap,n.tensorListMap);const t=u.map(e=>e.id);e.forEach(e=>{e.kept||-1!==s.indexOf(e.id)||-1!==t.indexOf(e.id)||e.dispose()});const i=await n.functionMap[o].executeFunctionAsync(u,n.tensorArrayMap,n.tensorListMap);l=await i[0].data(),i.forEach(e=>{e.kept||-1!==s.indexOf(e.id)||-1!==t.indexOf(e.id)||e.dispose()})}return u}case"LoopCond":return[OY(NY("pred",e,t,n))];case"Switch":{const r=NY("pred",e,t,n);let o=NY("data",e,t,n);return o.kept||(o=OY(o)),(await r.data())[0]?[void 0,o]:[o,void 0]}case"Merge":{const r=e.inputNames.find(e=>void 0!==jY(e,t,n));return r?[OY(jY(r,t,n))]:void 0}case"Enter":{const r=NY("frameName",e,t,n),o=NY("tensor",e,t,n);return n.enterFrame(r),[OY(o)]}case"Exit":{const r=NY("tensor",e,t,n);return n.exitFrame(),[OY(r)]}case"NextIteration":{const r=NY("tensor",e,t,n);return n.nextIteration(),[OY(r)]}case"TensorArrayV3":{const r=NY("size",e,t,n),o=NY("dtype",e,t,n),i=NY("elementShape",e,t,n),a=NY("dynamicSize",e,t,n),s=NY("clearAfterRead",e,t,n),l=NY("identicalElementShapes",e,t,n),u=NY("name",e,t,n),p=new LJ(u,o,r,i,l,a,s);return n.addTensorArray(p),[p.idTensor,zb(1)]}case"TensorArrayWriteV3":{const r=NY("tensorArrayId",e,t,n),o=NY("index",e,t,n),i=NY("tensor",e,t,n),a=n.getTensorArray(r.id);return a.write(o,i),[a.idTensor]}case"TensorArrayReadV3":{const r=NY("tensorArrayId",e,t,n),o=NY("index",e,t,n);return[n.getTensorArray(r.id).read(o)]}case"TensorArrayGatherV3":{const r=NY("tensorArrayId",e,t,n),o=NY("indices",e,t,n),i=NY("dtype",e,t,n);return[n.getTensorArray(r.id).gather(o,i)]}case"TensorArrayScatterV3":{const r=NY("tensorArrayId",e,t,n),o=NY("indices",e,t,n),i=NY("tensor",e,t,n),a=n.getTensorArray(r.id);return a.scatter(o,i),[a.idTensor]}case"TensorArrayConcatV3":{const r=NY("tensorArrayId",e,t,n),o=n.getTensorArray(r.id),i=NY("dtype",e,t,n);return[o.concat(i)]}case"TensorArraySplitV3":{const r=NY("tensorArrayId",e,t,n),o=NY("tensor",e,t,n),i=NY("lengths",e,t,n),a=n.getTensorArray(r.id);return a.split(i,o),[a.idTensor]}case"TensorArraySizeV3":{const r=NY("tensorArrayId",e,t,n);return[zb(n.getTensorArray(r.id).size(),"int32")]}case"TensorArrayCloseV3":{const r=NY("tensorArrayId",e,t,n),o=n.getTensorArray(r.id);return o.clearAndClose(),[o.idTensor]}case"TensorListSetItem":{const r=NY("tensorListId",e,t,n),o=NY("index",e,t,n),i=NY("tensor",e,t,n),a=n.getTensorList(r.id);return a.setItem(o,i),[a.idTensor]}case"TensorListGetItem":{const r=NY("tensorListId",e,t,n),o=NY("index",e,t,n),i=NY("elementShape",e,t,n),a=NY("elementDType",e,t,n);return[n.getTensorList(r.id).getItem(o,i,a)]}case"TensorListScatterV2":case"TensorListScatter":{const r=NY("indices",e,t,n),o=function(e,t,n,r){if(t.length!==e.shape[0])throw new Error(`Expected len(indices) == tensor.shape[0], but saw: ${t.length} vs. ${e.shape[0]}`);const o=Math.max(...t);if(null!=r&&-1!==r&&o>=r)throw new Error(`Max index must be < array size (${o}  vs. ${r})`);const i=new WJ([],n,e.dtype,r),a=X_(e,0);return t.forEach((e,t)=>{i.setItem(e,a[t])}),i}(NY("tensor",e,t,n),r,NY("elementShape",e,t,n),NY("numElements",e,t,n));return n.addTensorList(o),[o.idTensor]}case"TensorListReserve":case"EmptyTensorList":{const r=NY("elementShape",e,t,n),o=NY("elementDType",e,t,n);let i;i="TensorListReserve"===e.op?"numElements":"maxNumElements";const a=function(e,t,n){return new WJ([],e,t,n)}(r,o,NY(i,e,t,n));return n.addTensorList(a),[a.idTensor]}case"TensorListGather":{const r=NY("tensorListId",e,t,n),o=NY("indices",e,t,n),i=NY("elementShape",e,t,n),a=NY("elementDType",e,t,n);return[n.getTensorList(r.id).gather(o,a,i)]}case"TensorListStack":{const r=NY("tensorListId",e,t,n),o=NY("elementShape",e,t,n),i=NY("elementDType",e,t,n),a=NY("numElements",e,t,n);return[n.getTensorList(r.id).stack(o,i,a)]}case"TensorListFromTensor":{const r=function(e,t,n){const r=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}`);OJ(e.shape.slice(1),t,"TensorList shape mismatch: ");const o=X_(e);return new WJ(o,t,r)}(NY("tensor",e,t,n),NY("elementShape",e,t,n),NY("elementDType",e,t,n));return n.addTensorList(r),[r.idTensor]}case"TensorListConcat":{const r=NY("tensorListId",e,t,n),o=n.getTensorList(r.id),i=NY("dtype",e,t,n),a=NY("elementShape",e,t,n);return[o.concat(i,a)]}case"TensorListPushBack":{const r=NY("tensorListId",e,t,n),o=NY("tensor",e,t,n),i=n.getTensorList(r.id);return i.pushBack(o),[i.idTensor]}case"TensorListPopBack":{const r=NY("tensorListId",e,t,n),o=NY("elementShape",e,t,n),i=NY("elementDType",e,t,n);return[n.getTensorList(r.id).popBack(o,i)]}case"TensorListSplit":{const r=NY("tensor",e,t,n),o=NY("elementShape",e,t,n),i=function(e,t,n){let r=0;const o=t.map(e=>(r+=e,r));if(r!==e.shape[0])throw new Error(`Expected sum of lengths to be equal to\n          tensor.shape[0], but sum of lengths is\n        ${r}, and tensor's shape is: ${e.shape}`);const i=PJ(e.shape.slice(1),n),a=0===r?0:e.size/r,s=Bb(()=>{const n=[];e=u$(e,[1,r,a]);for(let r=0;r<t.length;++r){const s=[0,0===r?0:o[r-1],0],l=[1,t[r],a];n[r]=u$(M_(e,s,l),i)}return e.dispose(),n}),l=new WJ([],n,e.dtype,t.length);for(let e=0;e<s.length;e++)l.setItem(e,s[e]);return l}(r,NY("lengths",e,t,n),o);return n.addTensorList(i),[i.idTensor]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n);case"convolution":return Bb(()=>((e,t,n)=>{switch(e.op){case"Conv1D":{const r=NY("stride",e,t,n),o=NY("pad",e,t,n),i=NY("dataFormat",e,t,n).toUpperCase(),a=NY("dilation",e,t,n);return[S$(NY("x",e,t,n),NY("filter",e,t,n),r,o,i,a)]}case"Conv2D":{const r=NY("strides",e,t,n),o=DY(e,t,n),i=NY("dataFormat",e,t,n).toUpperCase(),a=NY("dilations",e,t,n);return[x$(NY("x",e,t,n),NY("filter",e,t,n),[r[1],r[2]],o,i,[a[1],a[2]])]}case"_FusedConv2D":{const{stride:r,pad:o,dataFormat:i,dilations:a,biasArg:s,preluArg:l,activationFunc:u,leakyreluAlpha:p}=VJ(e,t,n);return[fw({x:NY("x",e,t,n),filter:NY("filter",e,t,n),strides:[r[1],r[2]],pad:o,dataFormat:i,dilations:[a[1],a[2]],bias:s,activation:u,preluActivationWeights:l,leakyreluAlpha:p})]}case"FusedDepthwiseConv2dNative":{const{stride:r,pad:o,dataFormat:i,dilations:a,biasArg:s,preluArg:l,activationFunc:u,leakyreluAlpha:p}=VJ(e,t,n);return[yw({x:NY("x",e,t,n),filter:NY("filter",e,t,n),strides:[r[1],r[2]],pad:o,dataFormat:i,dilations:[a[1],a[2]],bias:s,activation:u,preluActivationWeights:l,leakyreluAlpha:p})]}case"Conv2DBackpropInput":case"Conv2dTranspose":{const r=NY("outputShape",e,t,n),o=NY("strides",e,t,n),i=DY(e,t,n);return[k$(NY("x",e,t,n),NY("filter",e,t,n),r,[o[1],o[2]],i)]}case"DepthwiseConv2dNative":case"DepthwiseConv2d":{const r=NY("strides",e,t,n),o=DY(e,t,n),i=NY("dilations",e,t,n),a=NY("dataFormat",e,t,n).toUpperCase();return[F$(NY("input",e,t,n),NY("filter",e,t,n),[r[1],r[2]],o,a,[i[
21],i[2]])]}case"Conv3D":{const r=NY("strides",e,t,n),o=NY("pad",e,t,n),i=NY("dataFormat",e,t,n).toUpperCase(),a=NY("dilations",e,t,n);return[E$(NY("x",e,t,n),NY("filter",e,t,n),[r[1],r[2],r[3]],o,i,[a[1],a[2],a[3]])]}case"AvgPool":{const r=NY("strides",e,t,n),o=NY("pad",e,t,n),i=NY("kernelSize",e,t,n);return[p$(NY("x",e,t,n),[i[1],i[2]],[r[1],r[2]],o)]}case"MaxPool":{const r=NY("strides",e,t,n),o=NY("pad",e,t,n),i=NY("kernelSize",e,t,n);return[n_(NY("x",e,t,n),[i[1],i[2]],[r[1],r[2]],o)]}case"MaxPoolWithArgmax":{const r=NY("strides",e,t,n),o=NY("pad",e,t,n),i=NY("kernelSize",e,t,n),a=NY("includeBatchInIndex",e,t,n),{result:s,indexes:l}=UJ(NY("x",e,t,n),[i[1],i[2]],[r[1],r[2]],o,a);return[s,l]}case"AvgPool3D":{const r=NY("strides",e,t,n),o=NY("pad",e,t,n),i=NY("kernelSize",e,t,n);return[c$(NY("x",e,t,n),[i[1],i[2],i[3]],[r[1],r[2],r[3]],o)]}case"MaxPool3D":{const r=NY("strides",e,t,n),o=NY("pad",e,t,n),i=NY("kernelSize",e,t,n);return[r_(NY("x",e,t,n),[i[1],i[2],i[3]],[r[1],r[2],r[3]],o)]}case"Dilation2D":{const r=NY("strides",e,t,n),o=NY("pad",e,t,n),i=NY("dilations",e,t,n),a=r[1],s=r[2],l=i[1],u=i[2];return[zJ(NY("x",e,t,n),NY("filter",e,t,n),[a,s],o,[l,u],"NHWC")]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"creation":return Bb(()=>((e,t,n)=>{switch(e.op){case"Fill":{const r=NY("shape",e,t,n),o=NY("dtype",e,t,n);return[W$(r,NY("value",e,t,n),o)]}case"LinSpace":return[HJ(NY("start",e,t,n),NY("stop",e,t,n),NY("num",e,t,n))];case"Multinomial":{const r=NY("logits",e,t,n),o=NY("numSamples",e,t,n),i=NY("seed",e,t,n);return[GJ(r,o,i)]}case"OneHot":{const r=NY("indices",e,t,n),o=NY("depth",e,t,n),i=NY("onValue",e,t,n),a=NY("offValue",e,t,n);return[b_(r,o,i,a)]}case"Ones":return[__(NY("shape",e,t,n),NY("dtype",e,t,n))];case"OnesLike":return[w_(NY("x",e,t,n))];case"RandomUniform":return[T_(NY("shape",e,t,n),NY("minval",e,t,n),NY("maxval",e,t,n),NY("dtype",e,t,n))];case"Range":return[Vw(NY("start",e,t,n),NY("stop",e,t,n),NY("step",e,t,n),NY("dtype",e,t,n))];case"TruncatedNormal":{const r=NY("shape",e,t,n),o=NY("mean",e,t,n),i=NY("stdDev",e,t,n),a=NY("seed",e,t,n);return[K_(r,o,i,NY("dtype",e,t,n),a)]}case"Zeros":return[$_(NY("shape",e,t,n),NY("dtype",e,t,n))];case"ZerosLike":return[Z_(NY("x",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"dynamic":return(async(e,t,n)=>{switch(e.op){case"NonMaxSuppressionV5":{const{boxes:r,scores:o,maxOutputSize:i,iouThreshold:a,scoreThreshold:s,softNmsSigma:l}=KJ(e,t,n),u=await dx.nonMaxSuppressionWithScoreAsync(r,o,i,a,s,l);return[u.selectedIndices,u.selectedScores]}case"NonMaxSuppressionV4":{const{boxes:r,scores:o,maxOutputSize:i,iouThreshold:a,scoreThreshold:s}=KJ(e,t,n),l=NY("padToMaxOutputSize",e,t,n),u=await dx.nonMaxSuppressionPaddedAsync(r,o,i,a,s,l);return[u.selectedIndices,u.validOutputs]}case"NonMaxSuppressionV3":case"NonMaxSuppressionV2":{const{boxes:r,scores:o,maxOutputSize:i,iouThreshold:a,scoreThreshold:s}=KJ(e,t,n);return[await dx.nonMaxSuppressionAsync(r,o,i,a,s)]}case"Where":{const r=hb(NY("condition",e,t,n),"bool"),o=[await qJ(r)];return r.dispose(),o}case"ListDiff":return async function(e,t){const n=ky(e,"x","setdiff1d"),r=ky(t,"y","setdiff1d");Md(n.dtype===r.dtype,()=>`x and y should have the same dtype, but got x (${n.dtype}) and y (${r.dtype}).`),Md(1===n.rank,()=>`x should be 1D tensor, but got x (${n.shape}).`),Md(1===r.rank,()=>`y should be 1D tensor, but got y (${r.shape}).`);const o=await n.data(),i=await r.data(),a=new Set(i);let s=0;for(let e=0;e<o.length;e++)a.has(o[e])||s++;const l=new Zm([s],n.dtype),u=new Zm([s],"int32");for(let e=0,t=0;e<o.length;e++)a.has(o[e])||(l.values[t]=o[e],u.values[t]=e,t++);return[l.toTensor(),u.toTensor()]}(NY("x",e,t,n),NY("y",e,t,n));default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n);case"evaluation":return Bb(()=>((e,t,n)=>{switch(e.op){case"TopKV2":{const r=NY("x",e,t,n),o=NY("k",e,t,n),i=NY("sorted",e,t,n),a=XJ(r,o,i);return[a.values,a.indices]}case"Unique":{const r=NY("x",e,t,n),o=YJ(r);return[o.values,o.indices]}case"UniqueV2":{const r=NY("x",e,t,n),o=NY("axis",e,t,n),i=YJ(r,o);return[i.values,i.indices]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"image":return Bb(()=>((e,t,n)=>{switch(e.op){case"ResizeBilinear":{const r=NY("images",e,t,n),o=NY("size",e,t,n),i=NY("alignCorners",e,t,n),a=NY("halfPixelCenters",e,t,n);return[dx.resizeBilinear(r,[o[0],o[1]],i,a)]}case"ResizeNearestNeighbor":{const r=NY("images",e,t,n),o=NY("size",e,t,n),i=NY("alignCorners",e,t,n),a=NY("halfPixelCenters",e,t,n);return[dx.resizeNearestNeighbor(r,[o[0],o[1]],i,a)]}case"CropAndResize":{const r=NY("image",e,t,n),o=NY("boxes",e,t,n),i=NY("boxInd",e,t,n),a=NY("cropSize",e,t,n),s=NY("method",e,t,n),l=NY("extrapolationValue",e,t,n);return[dx.cropAndResize(r,o,i,a,s,l)]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"graph":return Bb(()=>((e,t,n)=>{switch(e.op){case"Const":return t[e.name];case"PlaceholderWithDefault":const r=NY("default",e,t,n);return[jY(e.name,t,n)||r];case"Placeholder":return[jY(e.name,t,n)];case"Identity":case"StopGradient":case"FakeQuantWithMinMaxVars":case"Snapshot":return[OY(NY("x",e,t,n))];case"IdentityN":return NY("x",e,t,n).map(e=>OY(e));case"Shape":return[G_(NY("x",e,t,n).shape,"int32")];case"ShapeN":return NY("x",e,t,n).map(e=>G_(e.shape));case"Size":return[zb(NY("x",e,t,n).size,"int32")];case"Rank":return[zb(NY("x",e,t,n).rank,"int32")];case"NoOp":return[zb(1)];case"Print":const o=NY("x",e,t,n),i=NY("data",e,t,n),a=NY("message",e,t,n),s=NY("summarize",e,t,n);console.warn("The graph has a tf.print() operation,usually used for debugging, which slows down performance."),console.log(a);for(let e=0;e<i.length;e++)console.log(Array.prototype.slice.call(i[e].dataSync()).slice(0,s));return[o];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"logical":return Bb(()=>((e,t,n)=>{switch(e.op){case"Equal":return[O$(NY("a",e,t,n),NY("b",e,t,n))];case"NotEqual":return[y_(NY("a",e,t,n),NY("b",e,t,n))];case"Greater":return[V$(NY("a",e,t,n),NY("b",e,t,n))];case"GreaterEqual":return[H$(NY("a",e,t,n),NY("b",e,t,n))];case"Less":return[iv(NY("a",e,t,n),NY("b",e,t,n))];case"LessEqual":return[Uw(NY("a",e,t,n),NY("b",e,t,n))];case"LogicalAnd":return[e_(NY("a",e,t,n),NY("b",e,t,n))];case"LogicalNot":return[Mv(NY("a",e,t,n))];case"LogicalOr":return[ZJ(NY("a",e,t,n),NY("b",e,t,n))];case"Select":case"SelectV2":return[J_(NY("condition",e,t,n),NY("a",e,t,n),NY("b",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"matrices":return Bb(()=>((e,t,n)=>{switch(e.op){case"BatchMatMul":case"BatchMatMulV2":case"MatMul":return[t_(NY("a",e,t,n),NY("b",e,t,n),NY("transposeA",e,t,n),NY("transposeB",e,t,n))];case"Einsum":return[QJ(NY("equation",e,t,n),...NY("tensors",e,t,n))];case"Transpose":return[Q_(NY("x",e,t,n),NY("perm",e,t,n))];case"_FusedMatMul":const[r,o]=NY("fusedOps",e,t,n),i="biasadd"===r,a="prelu"===o,s=NY("numArgs",e,t,n),l=NY("leakyreluAlpha",e,t,n);if(i){if(a&&2!==s)throw new Error("Fused MatMul with BiasAdd and Prelu must have two extra arguments: bias and alpha.");if(!a&&1!==s)throw new Error("Fused MatMul with BiasAdd must have one extra argument: bias.")}const[u,p]=NY("args",e,t,n);return[bw({a:NY("a",e,t,n),b:NY("b",e,t,n),transposeA:NY("transposeA",e,t,n),transposeB:NY("transposeB",e,t,n),bias:u,activation:o,preluActivationWeights:p,leakyreluAlpha:l})];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"normalization":return Bb(()=>((e,t,n)=>{switch(e.op){case"FusedBatchNorm":case"FusedBatchNormV2":case"FusedBatchNormV3":return[d$(NY("x",e,t,n),NY("mean",e,t,n),NY("variance",e,t,n),NY("offset",e,t,n),NY("scale",e,t,n),NY("epsilon",e,t,n))];case"LRN":return[eZ(NY("x",e,t,n),NY("radius",e,t,n),NY("bias",e,t,n),NY("alpha",e,t,n),NY("beta",e,t,n))];case"Softmax":return[P_(NY("x",e,t,n))];case"LogSoftmax":return[Q$(NY("x",e,t,n))];case"SparseToDense":return[tZ(NY("sparseIndices",e,t,n),NY("outputShape",e,t,n),NY("sparseValues",e,t,n),NY("defaultValue",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"reduction":return Bb(()=>((e,t,n)=>{switch(e.op){case"Max":{const r=NY("axis",e,t,n),o=NY("keepDims",e,t,n);
2return[X$(NY("x",e,t,n),r,o)]}case"Mean":{const r=NY("axis",e,t,n),o=NY("keepDims",e,t,n);return[i_(NY("x",e,t,n),r,o)]}case"Min":{const r=NY("axis",e,t,n),o=NY("keepDims",e,t,n);return[Kw(NY("x",e,t,n),r,o)]}case"Sum":{const r=NY("axis",e,t,n),o=NY("keepDims",e,t,n);return[Z$(NY("x",e,t,n),r,o)]}case"All":{const r=NY("axis",e,t,n),o=NY("keepDims",e,t,n);return[qb(NY("x",e,t,n),r,o)]}case"Any":{const r=NY("axis",e,t,n),o=NY("keepDims",e,t,n);return[Kb(NY("x",e,t,n),r,o)]}case"ArgMax":{const r=NY("axis",e,t,n);return[Xb(NY("x",e,t,n),r)]}case"ArgMin":{const r=NY("axis",e,t,n);return[nZ(NY("x",e,t,n),r)]}case"Prod":{const r=NY("axis",e,t,n),o=NY("keepDims",e,t,n);return[MJ(NY("x",e,t,n),r,o)]}case"Cumsum":{const r=NY("axis",e,t,n),o=NY("exclusive",e,t,n),i=NY("reverse",e,t,n);return[FS(NY("x",e,t,n),r,o,i)]}case"Bincount":const r=NY("x",e,t,n),o=NY("weights",e,t,n),i=NY("size",e,t,n);return[Ww(r,o,i)];case"DenseBincount":{const r=NY("x",e,t,n),o=NY("weights",e,t,n),i=NY("size",e,t,n),a=NY("binaryOutput",e,t,n);return[rZ(r,o,i,a)]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"slice_join":return Bb(()=>((e,t,n)=>{switch(e.op){case"ConcatV2":case"Concat":{const r=NY("n",e,t,n),o=NY("axis",e,t,n);let i=NY("tensors",e,t,n);return i=i.slice(0,r),[y$(i,o)]}case"Gather":{const r=NY("x",e,t,n),o=NY("indices",e,t,n);return[z$(r,hb(o,"int32"),0)]}case"GatherV2":{const r=NY("axis",e,t,n),o=NY("batchDims",e,t,n),i=NY("x",e,t,n),a=NY("indices",e,t,n);return[z$(i,hb(a,"int32"),r,o)]}case"Reverse":{const r=NY("dims",e,t,n),o=[];for(let e=0;e<r.length;e++)r[e]&&o.push(e);const i=NY("x",e,t,n);return[N_(i,o)]}case"ReverseV2":{const r=NY("axis",e,t,n),o=NY("x",e,t,n);return[N_(o,r)]}case"Slice":{const r=NY("begin",e,t,n),o=NY("size",e,t,n);return[M_(NY("x",e,t,n),r,o)]}case"StridedSlice":{const r=NY("begin",e,t,n),o=NY("end",e,t,n),i=NY("strides",e,t,n),a=NY("beginMask",e,t,n),s=NY("endMask",e,t,n),l=NY("ellipsisMask",e,t,n),u=NY("newAxisMask",e,t,n),p=NY("shrinkAxisMask",e,t,n),c=NY("x",e,t,n);return[oZ(c,r,o,i,a,s,l,u,p)]}case"Pack":return Bb(()=>{const r=NY("axis",e,t,n),o=NY("tensors",e,t,n),i=o[0].shape,a=z_(o[0]).shape,s=o.map(e=>{const t=Pd(e.shape,i);if(!t&&!Pd(z_(e).shape,a))throw new Error("the input tensors shape does not match");return t?e:u$(e,i)});return[V_(s,r)]});case"Unpack":{const r=NY("axis",e,t,n),o=NY("tensor",e,t,n);return X_(o,r)}case"Tile":{const r=NY("reps",e,t,n);return[P$(NY("x",e,t,n),r)]}case"Split":case"SplitV":{const r=NY("axis",e,t,n),o=NY("numOrSizeSplits",e,t,n),i=NY("x",e,t,n);return W_(i,o,r)}case"ScatterNd":{const r=NY("indices",e,t,n),o=NY("values",e,t,n),i=NY("shape",e,t,n);return[iZ(r,o,i)]}case"GatherNd":{const r=NY("x",e,t,n),o=NY("indices",e,t,n);return[aZ(r,o)]}case"SparseToDense":{const r=NY("sparseIndices",e,t,n),o=NY("outputShape",e,t,n),i=NY("sparseValues",e,t,n),a=NY("defaultValue",e,t,n);return[tZ(r,i,o,i.dtype===a.dtype?a:hb(a,i.dtype))]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"sparse":return Bb(()=>((e,t,n)=>{switch(e.op){case"SparseFillEmptyRows":{const{outputIndices:r,outputValues:o,emptyRowIndicator:i,reverseIndexMap:a}=fx.sparseFillEmptyRows(NY("indices",e,t,n),NY("values",e,t,n),NY("denseShape",e,t,n),NY("defaultValue",e,t,n));return[r,o,i,a]}case"SparseReshape":{const{outputIndices:r,outputShape:o}=fx.sparseReshape(NY("inputIndices",e,t,n),NY("inputShape",e,t,n),NY("newShape",e,t,n));return[r,o]}case"SparseSegmentMean":return[fx.sparseSegmentMean(NY("data",e,t,n),NY("indices",e,t,n),NY("segmentIds",e,t,n))];case"SparseSegmentSum":return[fx.sparseSegmentSum(NY("data",e,t,n),NY("indices",e,t,n),NY("segmentIds",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"spectral":return Bb(()=>((e,t,n)=>{switch(e.op){case"FFT":return[rw(NY("x",e,t,n))];case"IFFT":return[iw(NY("x",e,t,n))];case"RFFT":return[ow(NY("x",e,t,n))];case"IRFFT":return[aw(NY("x",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"string":return Bb(()=>((e,t,n)=>{switch(e.op){case"StringNGrams":{const{nGrams:r,nGramsSplits:o}=gx.stringNGrams(NY("data",e,t,n),NY("dataSplits",e,t,n),NY("separator",e,t,n),NY("nGramWidths",e,t,n),NY("leftPad",e,t,n),NY("rightPad",e,t,n),NY("padWidth",e,t,n),NY("preserveShortSequences",e,t,n));return[r,o]}case"StringSplit":{const{indices:r,values:o,shape:i}=gx.stringSplit(NY("input",e,t,n),NY("delimiter",e,t,n),NY("skipEmpty",e,t,n));return[r,o,i]}case"StringToHashBucketFast":return[gx.stringToHashBucketFast(NY("input",e,t,n),NY("numBuckets",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"transformation":return Bb(()=>((e,t,n)=>{switch(e.op){case"Cast":return[hb(NY("x",e,t,n),NY("dtype",e,t,n))];case"ExpandDims":{const r=NY("axis",e,t,n);return[B$(NY("x",e,t,n),r)]}case"Squeeze":{const r=NY("axis",e,t,n);return[z_(NY("x",e,t,n),r)]}case"Reshape":return[u$(NY("x",e,t,n),NY("shape",e,t,n))];case"MirrorPad":return[sZ(NY("x",e,t,n),NY("padding",e,t,n),NY("mode",e,t,n))];case"PadV2":case"Pad":return[x_(NY("x",e,t,n),NY("padding",e,t,n),NY("constantValue",e,t,n))];case"SpaceToBatchND":{const r=NY("blockShape",e,t,n),o=NY("paddings",e,t,n);return[hS(NY("x",e,t,n),r,o)]}case"BatchToSpaceND":{const r=NY("blockShape",e,t,n),o=NY("crops",e,t,n);return[Gv(NY("x",e,t,n),r,o)]}case"DepthToSpace":{const r=NY("blockSize",e,t,n),o=NY("dataFormat",e,t,n).toUpperCase();return[lZ(NY("x",e,t,n),r,o)]}case"BroadcastTo":return[Y_(NY("x",e,t,n),NY("shape",e,t,n))];case"BroadcastArgs":return[uZ(NY("s0",e,t,n),NY("s1",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"hash_table":return(async(e,t,n,r)=>{switch(e.op){case"HashTable":case"HashTableV2":{const o=NY("keyDType",e,t,n),i=NY("valueDType",e,t,n),a=new JJ(o,i);return r.addHashTable(e.name,a),[a.handle]}case"LookupTableImport":case"LookupTableImportV2":{const o=NY("tableHandle",e,t,n,r),i=NY("keys",e,t,n),a=NY("values",e,t,n),s=r.getHashTableById(o.id);return[await s.import(i,a)]}case"LookupTableFind":case"LookupTableFindV2":{const o=NY("tableHandle",e,t,n,r),i=NY("keys",e,t,n),a=NY("defaultValue",e,t,n),s=r.getHashTableById(o.id);return[await s.find(i,a)]}case"LookupTableSize":case"LookupTableSizeV2":{const o=NY("tableHandle",e,t,n,r);return[r.getHashTableById(o.id).tensorSize()]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n,r);
vendor: 8,985 bytes, line 2
2case"custom":const o=FY(e.op);if(o&&o.customExecutor)return o.customExecutor(new yJ(e,t,n));throw TypeError(`Custom op ${e.op} is not registered.`);default:throw TypeError(`Unknown op '${e.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 sh(o)?o.then(e=>[].concat(e)):[].concat(o)}class cZ{constructor(e={},t={},n={},r={}){this.weightMap=e,this.tensorArrayMap=t,this.tensorListMap=n,this.functionMap=r,this.rootContext={id:0,frameName:"",iterationId:0},this.contexts=[this.rootContext],this.lastId=0,this.generateCurrentContextIds()}newFrame(e,t){return{id:e,frameName:t,iterationId:0}}set currentContext(e){this.contexts!==e&&(this.contexts=e,this.generateCurrentContextIds())}get currentContext(){return this.contexts}get currentContextId(){return this._currentContextIds[0]}get currentContextIds(){return this._currentContextIds}generateCurrentContextIds(){const e=[];for(let t=0;t<this.contexts.length-1;t++){const n=this.contexts.slice(0,this.contexts.length-t);e.push(this.contextIdforContexts(n))}e.push(""),this._currentContextIds=e}contextIdforContexts(e){return e?e.map(e=>0===e.id&&0===e.iterationId?"":`${e.frameName}-${e.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))throw new Error("Cannot exit frame, the context is empty");this.contexts=this.contexts.slice(),this.contexts.splice(-1),this.currentContextIds.shift()}nextIteration(){if(!(this.contexts&&this.contexts.length>0))throw new Error("Cannot increase frame iteration, the context is empty");{this.contexts=this.contexts.slice(),this.lastId++;const e=Object.assign({},this.contexts[this.contexts.length-1]);e.iterationId+=1,e.id=this.lastId,this.contexts.splice(-1,1,e),this._currentContextIds.splice(0,1,this.contextIdforContexts(this.contexts))}}getWeight(e){return this.weightMap[e]}addTensorArray(e){this.tensorArrayMap[e.id]=e}getTensorArray(e){return this.tensorArrayMap[e]}addTensorList(e){this.tensorListMap[e.id]=e}getTensorList(e){return this.tensorListMap[e]}dispose(e){for(const t in this.tensorArrayMap)this.tensorArrayMap[t].clearAndClose(e);for(const t in this.tensorListMap)this.tensorListMap[t].clearAndClose(e)}}function dZ(e,t,n,r){const o=new Set,i=[];let a=null,s=null;const l=new Set,u=Object.keys(e).map(e=>MY(e)[0]);let p=[];null!=r&&(p=r.map(e=>MY(e.name)[0]));const c=[...t];for(;c.length>0;){const e=c.pop();(mZ(e)||yZ(e)||bZ(e))&&null==a&&(a=e,s=a.children.map(e=>e.name).filter(e=>o.has(e))),o.add(e.name),null==n[e.name]&&-1===u.indexOf(e.name)&&-1===p.indexOf(e.name)&&(0!==e.inputs.length?e.inputs.forEach(e=>{l.has(e.name)||(l.add(e.name),c.push(e))}):i.push(e.name))}return{inputs:e,outputs:t,usedNodes:o,missingInputs:i,dynamicNode:a,syncInputs:s}}const hZ=["Switch","Merge","Enter","Exit","NextIteration","StatelessIf","StatelessWhile","if","While"],fZ=["NonMaxSuppressionV2","NonMaxSuppressionV3","NonMaxSuppressionV5","Where"],gZ=["HashTable","HashTableV2","LookupTableImport","LookupTableImportV2","LookupTableFind","LookupTableFindV2","LookupTableSize","LookupTableSizeV2"];function mZ(e){return hZ.indexOf(e.op)>=0}function yZ(e){return fZ.indexOf(e.op)>=0}function bZ(e){return gZ.indexOf(e.op)>=0}class $Z{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,null!=e.functions&&Object.keys(e.functions).forEach(t=>{this._functionExecutorMap[t]=new $Z(e.functions[t],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){const t=Object.keys(e).map(t=>e[t].map(e=>e.id));this._weightIds=[].concat(...t),this._weightMap=e}set resourceManager(e){this._resourceManager=e}get inputs(){return this._inputs.map(e=>({name:e.name,shape:e.attrParams.shape?e.attrParams.shape.value:void 0,dtype:e.attrParams.dtype?e.attrParams.dtype.value:void 0}))}get outputs(){return this._outputs.map(e=>({name:e.name,shape:e.attrParams.shape?e.attrParams.shape.value:void 0,dtype:e.attrParams.dtype?e.attrParams.dtype.value:void 0}))}get inputNodes(){return this._inputs.map(e=>e.signatureKey||e.name)}get outputNodes(){return this._outputs.map(e=>{const t=e.signatureKey||e.name;return e.defaultOutput?`${t}:${e.defaultOutput}`:t})}get functions(){return Object.keys(this._functions).reduce((e,t)=>(e[t]=this._functions[t].signature,e),{})}getCompilationKey(e,t){const n=e.map(e=>e.name).sort(),r=t.map(e=>e.name).sort();return n.join(this.SEPERATOR)+"--"+r.join(this.SEPERATOR)}compile(e,t){const n=dZ(e,t,this.weightMap,this._initNodes),{missingInputs:r,dynamicNode:o,syncInputs:i}=n;if(null!=o)throw new Error(`This execution contains the node '${o.name}', which has the dynamic op '${o.op}'. Please use model.executeAsync() instead. Alternatively, to avoid the dynamic ops, specify the inputs [${i}]`);if(r.length>0){const n=t.map(e=>e.name),o=Object.keys(e);throw new Error(`Cannot compute the outputs [${n}] from the provided inputs [${o}]. Missing the following inputs: [${r}]`)}return function(e,t,n){const{usedNodes:r,inputs:o}=n,i=[],a=Object.keys(o).map(e=>MY(e)[0]).map(t=>e.nodes[t]),s=e.initNodes;a.forEach(e=>{r.has(e.name)&&i.push(e)}),e.weights.forEach(e=>{r.has(e.name)&&i.push(e)}),null!=s&&s.forEach(e=>{r.has(e.name)&&i.push(e)});const l=new Set,u=[];for(;i.length>0;){const e=i.pop();l.add(e.name),t[e.name]||u.push(e),e.children.forEach(e=>{!l.has(e.name)&&r.has(e.name)&&e.inputs.every(e=>l.has(e.name))&&i.push(e)})}return u}(this.graph,this.weightMap,n)}execute(e,t){e=this.mapInputs(e);const n=Object.keys(e).sort();this.checkInputs(e),this.checkInputShapeAndType(e),t=this.mapOutputs(t),this.checkOutputs(t);const r=n.map(e=>this.graph.nodes[MY(e)[0]]),o=t.map(e=>MY(e)[0]);let i=o.map(e=>this.graph.nodes[e]);0===i.length&&(i=this._outputs);const a=this.getCompilationKey(r,i);let s=this.compiledMap.get(a);null==s&&(s=this.compile(e,i),this.compiledMap.set(a,s));const l={},u={};return Bb(()=>{const n=new cZ(this.weightMap,l,u,this.functionExecutorMap),r=Object.assign({},this.weightMap);Object.keys(e).forEach(t=>{const[n,o]=MY(t),i=[];i[o]=e[t],r[n]=i});const i=this.getFrozenTensorIds(r),a={};for(let e=0;e<s.length;e++){const t=s[e];if(!r[t.name]){const e=pZ(t,r,n,this._resourceManager);if(sh(e))throw new Error(`The execution of the op '${t.op}' returned a promise. Please use model.executeAsync() instead.`);r[t.name]=e,this.checkTensorForDisposal(t.name,t,r,n,i,o,a)}}return null==this.parent&&n.dispose(i),t.map(e=>jY(e,r,n))})}getFrozenTensorIds(e){const t=[].concat.apply([],Object.keys(e).map(t=>e[t]).map(e=>e.map(e=>e.id)));return new Set(t)}checkTensorForDisposal(e,t,n,r,o,i,a){"control"!==t.category&&-1===i.indexOf(e)&&(n[e].forEach(e=>{null!=e&&(a[e.id]=(a[e.id]||0)+t.children.length)}),t.inputs.forEach(e=>{if("control"!==e.category){const t=function(e,t,n){return t[CY(e,n.currentContextId)]}(e.name,n,r);null!=t&&t.forEach(e=>{if(e&&!e.kept&&!o.has(e.id)){const t=a[e.id];1===t?(e.dispose(),delete a[e.id]):null!=t&&a[e.id]--}})}}))}async executeAsync(e,t){return this._executeAsync(e,t)}async _executeAsync(e,t,n=!1,r={},o={}){n||(e=this.mapInputs(e),this.checkInputs(e),this.checkInputShapeAndType(e),t=this.mapOutputs(t),this.checkOutputs(t));const i=new cZ(this.weightMap,r,o,this.functionExecutorMap),a=await this.executeWithControlFlow(e,i,t,n),s=t.map(e=>jY(e,a,i)),l=s.map(e=>e.id),u=Object.keys(e).map(t=>e[t].id),p=new Set([...l,...u,...this.weightIds]);return Object.keys(a).forEach(e=>{a[e].forEach(e=>{!e||e.kept||e.isDisposed||p.has(e.id)||e.dispose()})}),null==this.parent&&i.dispose(p),s}async executeFunctionAsync(e,t,n){const r=e.reduce((e,t,n)=>(e[this.inputs[n].name]=t,e),{});return this._executeAsync(r,this.outputNodes,!0,t,n)}async executeWithControlFlow(e,t,n,r){const o=Object.keys(e),i=o.map(e=>this.graph.nodes[MY(e)[0]]),a=n.map(e=>MY(e)[0]);let s=a.map(e=>this.graph.nodes[e]);0===s.length&&(s=this._outputs);const{usedNodes:l,missingInputs:u,dynamicNode:p,syncInputs:c}=dZ(e,s,this.weightMap,this._initNodes),d=[...i,...this.graph.weights,...this._initNodes||[]].map(e=>({node:e,contexts:t.currentContext})),h=Object.assign({},this.weightMap);Object.keys(e).forEach(t=>{const[n,r]=MY(t),o=[];o[r]=e[t],h[n]=o});const f={},g=this.getFrozenTensorIds(h),m={};for(;d.length>0;){const e=this.processStack(i,d,t,h,m,g,a,f,l);await Promise.all(e)}null!=p||r||console.warn("This model execution did not contain any no
2des with control flow or dynamic output shapes. You can use model.execute() instead.");const y=s.filter(e=>!mZ(e)&&!jY(e.name,h,t)).map(e=>e.name);if(y.length>0){let e="";throw null!=p&&(e=`Alternatively, to avoid the dynamic ops, use model.execute() and specify the inputs [${c}]`),new Error(`Cannot compute the outputs [${y}] from the provided inputs [${o}]. Consider providing the following inputs: [${u}]. ${e}`)}return h}processStack(e,t,n,r,o,i,a,s,l){const u=[];for(;t.length>0;){const e=t.pop();n.currentContext=e.contexts;let p="";if("Enter"===e.node.op&&NY("isConstant",e.node,r,n)&&([p]=AY(e.node.name,n)),null==r[e.node.name]){const c=pZ(e.node,r,n,this._resourceManager);p||([p]=AY(e.node.name,n));const d=n.currentContext;sh(c)?u.push(c.then(u=>(r[p]=u,n.currentContext=d,this.checkTensorForDisposal(p,e.node,r,n,i,a,s),this.processChildNodes(e.node,t,n,r,o,l),u))):(r[p]=c,this.checkTensorForDisposal(p,e.node,r,n,i,a,s),this.processChildNodes(e.node,t,n,r,o,l))}else this.processChildNodes(e.node,t,n,r,o,l)}return u}processChildNodes(e,t,n,r,o,i){e.children.forEach(e=>{const[a]=AY(e.name,n);!o[a]&&i.has(e.name)&&("Merge"===e.op?e.inputNames.some(e=>!!jY(e,r,n))&&(o[a]=!0,t.push({contexts:n.currentContext,node:e})):e.inputNames.every(e=>!!jY(e,r,n))&&(o[a]=!0,t.push({contexts:n.currentContext,node:e})))})}dispose(){Object.keys(this.weightMap).forEach(e=>this.weightMap[e].forEach(e=>e.dispose()))}checkInputShapeAndType(e){Object.keys(e).forEach(t=>{const n=e[t],[r]=MY(t),o=this.graph.nodes[r];if(o.attrParams.shape&&o.attrParams.shape.value){const e=o.attrParams.shape.value;Md(e.length===n.shape.length&&n.shape.every((t,n)=>-1===e[n]||e[n]===t),()=>`The shape of dict['${o.name}'] provided in model.execute(dict) must be [${e}], but was [${n.shape}]`)}o.attrParams.dtype&&o.attrParams.dtype.value&&Md(n.dtype===o.attrParams.dtype.value,()=>`The dtype of dict['${o.name}'] provided in model.execute(dict) must be ${o.attrParams.dtype.value}, but was ${n.dtype}`)})}mapInputs(e){const t={};for(const n in e)null!=this._signature&&null!=this._signature.inputs&&null!=this._signature.inputs[n]?t[this._signature.inputs[n].name]=e[n]:t[n]=e[n];return t}checkInputs(e){const t=Object.keys(e).filter(e=>{const[t]=MY(e);return null==this.graph.nodes[t]});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(e=>null!=this._signature&&null!=this._signature.outputs&&null!=this._signature.outputs[e]?this._signature.outputs[e].name:e,{})}checkOutputs(e){e.forEach(e=>{const[t]=MY(e);if(!this.graph.nodes[t])throw new Error(`The output '${e}' is not found in the graph`)})}}class _Z{constructor(e={},t={}){this.hashTableNameToHandle=e,this.hashTableMap=t}addHashTable(e,t){this.hashTableNameToHandle[e]=t.handle,this.hashTableMap[t.id]=t}getHashTableHandleByName(e){return this.hashTableNameToHandle[e]}getHashTableById(e){return this.hashTableMap[e]}dispose(){for(const e in this.hashTableMap)this.hashTableMap[e].clearAndClose(),delete this.hashTableMap[e];for(const e in this.hashTableNameToHandle)this.hashTableNameToHandle[e].dispose(),delete this.hashTableNameToHandle[e]}}class wZ{constructor(e,t={}){this.modelUrl=e,this.loadOptions=t,this.version="n/a",null==t&&(this.loadOptions={}),this.resourceManager=new _Z}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(){const e=this.modelUrl;if(null!=e.load)this.handler=e;else if(null!=this.loadOptions.requestInit)this.handler=Sb(e,this.loadOptions);else{const r=(t=e,n=this.loadOptions,Ly.getLoadHandlers(t,n));if(0===r.length)r.push(Sb(e,this.loadOptions));else if(r.length>1)throw new Error(`Found more than one (${r.length}) load handlers for URL '${[e]}'`);this.handler=r[0]}var t,n}async load(){if(this.findIOHandler(),null==this.handler.load)throw new Error("Cannot proceed with model loading because the IOHandler provided does not have the `load` method implemented.");const e=await this.handler.load();return this.loadSync(e)}loadSync(e){this.artifacts=e;const t=this.artifacts.modelTopology;let n;n=null!=this.artifacts.userDefinedMetadata&&null!=this.artifacts.userDefinedMetadata.signature?this.artifacts.userDefinedMetadata.signature:this.artifacts.signature,this.signature=n,this.version=`${t.versions.producer}.${t.versions.minConsumer}`;const r=function(e,t){const n={};let r,o=0;for(const i of t){const t=i.name,a=i.dtype,s=i.shape,l=Bd(s);let u;if("quantization"in i){const n=i.quantization;if("uint8"===n.dtype||"uint16"===n.dtype){if(!("min"in n)||!("scale"in n))throw new Error(`Weight ${i.name} with quantization ${n.dtype} doesn't have corresponding metadata min and scale.`)}else{if("float16"!==n.dtype)throw new Error(`Weight ${i.name} has unknown quantization dtype ${n.dtype}. Supported quantization dtypes are: 'uint8', 'uint16', and 'float16'.`);if("float32"!==a)throw new Error(`Weight ${i.name} is quantized with ${n.dtype} which only supports weights of type float32 not ${a}.`)}const s=jy[n.dtype],p=e.slice(o,o+l*s),c="uint8"===n.dtype?new Uint8Array(p):new Uint16Array(p);if("float32"===a)if("uint8"===n.dtype||"uint16"===n.dtype){u=new Float32Array(c.length);for(let e=0;e<c.length;e++){const t=c[e];u[e]=t*n.scale+n.min}}else{if("float16"!==n.dtype)throw new Error(`Unsupported quantization type ${n.dtype} for weight type float32.`);void 0===r&&(r=Py()),u=r(c)}else{if("int32"!==a)throw new Error(`Unsupported dtype in weight '${t}': ${a}`);if("uint8"!==n.dtype&&"uint16"!==n.dtype)throw new Error(`Unsupported quantization type ${n.dtype} for weight type int32.`);u=new Int32Array(c.length);for(let e=0;e<c.length;e++){const t=c[e];u[e]=Math.round(t*n.scale+n.min)}}o+=l*s}else if("string"===a){const t=Bd(i.shape);u=[];for(let n=0;n<t;n++){const t=new Uint32Array(e.slice(o,o+4))[0];o+=4;const n=new Uint8Array(e.slice(o,o+t));u.push(n),o+=t}}else{const r=jy[a],i=e.slice(o,o+l*r);if("float32"===a)u=new Float32Array(i);else if("int32"===a)u=new Int32Array(i);else if("bool"===a)u=new Uint8Array(i);else{if("complex64"!==a)throw new Error(`Unsupported dtype in weight '${t}': ${a}`);{u=new Float32Array(i);const e=new Float32Array(u.length/2),r=new Float32Array(u.length/2);for(let t=0;t<e.length;t++)e[t]=u[2*t],r[t]=u[2*t+1];const o=Ny(e,s,"float32"),a=Ny(r,s,"float32");n[t]=Ty(o,a),o.dispose(),a.dispose()}}o+=l*r}"complex64"!==a&&(n[t]=Ny(u,s,a))}return n}(this.artifacts.weightData,this.artifacts.weightSpecs);if(this.executor=new $Z(nJ.Instance.transformGraph(t,this.signature)),this.executor.weightMap=this.convertTensorMapToTensorsMap(r),this.executor.resourceManager=this.resourceManager,null!=e.modelInitializer&&null!=e.modelInitializer.node){const t=nJ.Instance.transformGraph(e.modelInitializer);this.initializer=new $Z(t),this.initializer.weightMap=this.executor.weightMap,this.initializer.resourceManager=this.resourceManager,this.initializer.executeAsync({},[])}return!0}async save(e,t){if("string"==typeof e){const t=Wy(e);if(0===t.length)throw new Error(`Cannot find any save handlers for URL '${e}'`);if(t.length>1)throw new Error(`Found more than one (${t.length}) save handlers for URL '${e}'`);e=t[0]}if(null==e.save)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 ny||Array.isArray(e)))return e;if((e=Array.isArray(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,r)=>(t[n]=e[r],t),{})}normalizeOutputs(e){return e=e||this.outputNodes,Array.isArray(e)?e:[e]}execute(e,t){e=this.normalizeInputs(e),t=this.normalizeOutputs(t);const 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);const 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 xZ(e,t={}){if(null==e)throw new Error("modelUrl in loadGraphModel() cannot be null. Please provide a url or an IOHandler that loads the model");null==t&&(t={}),t.fromTFHub&&null==e.load&&(e.endsWith("/")||(e+="/"),e=`${e}model.json?tfjs-format=file`);const n=new wZ(e,t);return await n.load(),n}
2function SZ(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}l((r=r.apply(e,t||[])).next())})}function vZ(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}var kZ=function(e){return{startEndTensor:e,startPoint:M_(e,[0,0],[-1,2]),endPoint:M_(e,[0,2],[-1,2])}},EZ={strides:[8,16],anchors:[2,6]};function IZ(e,t){var n,r,o;if(e.topLeft instanceof ny&&e.bottomRight instanceof ny){var i=Bb(function(){return[y$([M_(J$(t-1,e.topLeft),0,1),M_(e.topLeft,1,1)]),y$([J$(t-1,M_(e.bottomRight,0,1)),M_(e.bottomRight,1,1)])]});n=i[0],r=i[1],null!=e.landmarks&&(o=Bb(function(){var n=J$(G_([t-1,0]),e.landmarks),r=G_([1,-1]);return Y$(n,r)}))}else{var a=e.topLeft,s=a[0],l=a[1],u=e.bottomRight,p=u[0],c=u[1];n=[t-1-s,l],r=[t-1-p,c],null!=e.landmarks&&(o=e.landmarks.map(function(e){return[t-1-e[0],e[1]]}))}var d={topLeft:n,bottomRight:r};return null!=o&&(d.landmarks=o),null!=e.probability&&(d.probability=e.probability instanceof ny?e.probability.clone():e.probability),d}function TZ(e,t){return Bb(function(){var n;return n=e.hasOwnProperty("box")?e.box:e,z_(function(e,t){var n=Y$(e.startPoint,t),r=Y$(e.endPoint,t),o=$$([n,r],1);return kZ(o)}(n,t).startEndTensor)})}var FZ=function(){function e(e,t,n,r,o,i){this.blazeFaceModel=e,this.width=t,this.height=n,this.maxFaces=r,this.anchorsData=function(e,t,n){for(var r=[],o=0;o<n.strides.length;o++)for(var i=n.strides[o],a=Math.floor((t+i-1)/i),s=Math.floor((e+i-1)/i),l=n.anchors[o],u=0;u<a;u++)for(var p=i*(u+.5),c=0;c<s;c++)for(var d=i*(c+.5),h=0;h<l;h++)r.push([d,p]);return r}(t,n,EZ),this.anchors=q_(this.anchorsData),this.inputSizeData=[t,n],this.inputSize=G_([t,n]),this.iouThreshold=o,this.scoreThreshold=i}return e.prototype.getBoundingBoxes=function(e,t,n){return void 0===n&&(n=!0),SZ(this,void 0,void 0,function(){var r,o,i,a,s,l,u,p,c,d,h,f,g,m,y=this;return vZ(this,function(b){switch(b.label){case 0:return r=Bb(function(){var t=dx.resizeBilinear(e,[y.width,y.height]),n=Y$(J$(j$(t,255),.5),2),r=y.blazeFaceModel.predict(n),o=z_(r),i=function(e,t,n){var r=M_(e,[0,1],[-1,2]),o=Gb(r,t),i=M_(e,[0,3],[-1,2]),a=j$(i,n),s=j$(o,n),l=j$(a,2),u=J$(s,l),p=Gb(s,l),c=Y$(u,n),d=Y$(p,n);return $$([c,d],1)}(o,y.anchors,y.inputSize),a=M_(o,[0,0],[-1,1]);return[o,i,z_(C_(a))]}),o=r[0],i=r[1],a=r[2],s=console.warn,console.warn=function(){},l=dx.nonMaxSuppression(i,a,this.maxFaces,this.iouThreshold,this.scoreThreshold),console.warn=s,[4,l.array()];case 1:return u=b.sent(),l.dispose(),p=u.map(function(e){return M_(i,[e,0],[1,-1])}),t?[3,3]:[4,Promise.all(p.map(function(e){return SZ(y,void 0,void 0,function(){var t;return vZ(this,function(n){switch(n.label){case 0:return[4,e.array()];case 1:return t=n.sent(),e.dispose(),[2,t]}})})}))];case 2:p=b.sent(),b.label=3;case 3:for(c=e.shape[1],d=e.shape[2],h=t?j$([d,c],this.inputSize):[d/this.inputSizeData[0],c/this.inputSizeData[1]],f=[],g=function(e){var r=p[e],i=Bb(function(){var i=kZ(r instanceof ny?r:q_(r));if(!n)return i;var s,l=u[e];return s=t?M_(y.anchors,[l,0],[1,2]):y.anchorsData[l],{box:i,landmarks:u$(z_(M_(o,[l,5],[1,-1])),[6,-1]),probability:M_(a,[l],[1]),anchor:s}});f.push(i)},m=0;m<p.length;m++)g(m);
2return i.dispose(),a.dispose(),o.dispose(),[2,{boxes:f,scaleFactor:h}]}})})},e.prototype.estimateFaces=function(e,t,n,r){return void 0===t&&(t=!1),void 0===n&&(n=!1),void 0===r&&(r=!0),SZ(this,void 0,void 0,function(){var o,i,a,s,l,u,p=this;return vZ(this,function(c){switch(c.label){case 0:return o=function(e){return e instanceof ny?[e.shape[0],e.shape[1]]:[e.height,e.width]}(e),i=o[1],a=Bb(function(){return e instanceof ny||(e=kb(e)),B$(hb(e,"float32"),0)}),[4,this.getBoundingBoxes(a,t,r)];case 1:return s=c.sent(),l=s.boxes,u=s.scaleFactor,a.dispose(),t?[2,l.map(function(e){var t=TZ(e,u),o={topLeft:M_(t,[0],[2]),bottomRight:M_(t,[2],[2])};if(r){var a=e,s=a.landmarks,l=a.probability,p=a.anchor,c=Y$(Gb(s,p),u);o.landmarks=c,o.probability=l}return n&&(o=IZ(o,i)),o})]:[2,Promise.all(l.map(function(e){return SZ(p,void 0,void 0,function(){var t,o,a,s,l,p,c,d,h,f,g,m=this;return vZ(this,function(y){switch(y.label){case 0:return t=TZ(e,u),r?[3,2]:[4,t.array()];case 1:return l=y.sent(),o={topLeft:l.slice(0,2),bottomRight:l.slice(2)},[3,4];case 2:return[4,Promise.all([e.landmarks,t,e.probability].map(function(e){return SZ(m,void 0,void 0,function(){return vZ(this,function(t){return[2,e.array()]})})}))];case 3:a=y.sent(),s=a[0],l=a[1],p=a[2],c=e.anchor,h=(d=u)[0],f=d[1],g=s.map(function(e){return[(e[0]+c[0])*h,(e[1]+c[1])*f]}),o={topLeft:l.slice(0,2),bottomRight:l.slice(2),landmarks:g,probability:p},function(e){e.startEndTensor.dispose(),e.startPoint.dispose(),e.endPoint.dispose()}(e.box),e.landmarks.dispose(),e.probability.dispose(),y.label=4;case 4:return t.dispose(),n&&(o=IZ(o,i)),[2,o]}})})}))]}})})},e}(),NZ=__webpack_require__(770);const jZ=NZ.tfweb.tflite_web_api.setWasmPath;var AZ;NZ.tfweb.tflite_web_api.getWasmFeatures,function(e){e[e.CATEGORY_MASK=1]="CATEGORY_MASK",e[e.CONFIDENCE_MASK=2]="CONFIDENCE_MASK",e[e.UNSPECIFIED=0]="UNSPECIFIED"}(AZ||(AZ={}));var CZ=__webpack_require__(765),MZ=__webpack_require__.n(CZ);class DZ{constructor(e,t){this.x=e,this.y=t}}class OZ{constructor(e,t){this.queue=[],this.threshold=t,this.maxSize=e,this.r=null}process(e){return this.queue.length==this.maxSize?(this.checkMovementSafe(e)?(this.queue.shift(),this.r=this.avg(),this.queue.push(this.r)):(this.reset(),this.queue.push(e)),e):this.queue.length<this.maxSize?(this.queue.length>0&&!this.checkMovementSafe(e)&&this.reset(),this.queue.push(e),e):this.queue[this.queue.length-1]}avg(){let e=0,t=0;for(let n=0;n<this.queue.length;n++)e+=this.queue[n].x,t+=this.queue[n].y;return new DZ(e/this.queue.length,t/this.queue.length)}exponentialMovingAverage(){}reset(){this.queue=[]}distance(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}checkMovementSafe(e){let t=this.queue[this.queue.length-1];return!(this.distance(t,e)>=this.threshold)}}jZ("https://orbostorage1.blob.core.windows.net/wasmstore/tflite/"),function(e,t=!1){if(xY)throw new Error("The WASM backend was already initialized. Make sure you call `setWasmPaths()` before you call `tf.setBackend()` or `tf.ready()`");if("string"==typeof e)_Y=e;else{wY=e;const t=bY.filter(e=>null==wY[e]);if(t.length>0)throw new Error(`There were no entries found for the following binaries: ${t.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.`)}SY=t}({"tfjs-backend-wasm.wasm":"https://orbostorage1.blob.core.windows.net/wasmstore/tflite/tfjs-backend-wasm.wasm","tfjs-backend-wasm-simd.wasm":"https://orbostorage1.blob.core.windows.net/wasmstore/tflite/tfjs-backend-wasm-simd.wasm","tfjs-backend-wasm-threaded-simd.wasm":"https://orbostorage1.blob.core.windows.net/wasmstore/tflite/tfjs-backend-wasm-threaded-simd.wasm"});let RZ,BZ,PZ,LZ,WZ,UZ,zZ,VZ,HZ,GZ,qZ,KZ,XZ,YZ,JZ,ZZ,QZ,eQ,tQ,nQ,rQ,oQ,iQ,aQ,sQ,lQ,uQ,pQ,cQ="./assets/masks/",dQ=0,hQ=!1,fQ=!1,gQ=[],mQ=new class{constructor(e,t){this.n=106,this.smoothedLandmarks=[];for(let n=0;n<this.n;n++)this.smoothedLandmarks[n]=new OZ(e,t)}process(e){let t=this.bufferToLandmark(e),n=[];for(let e=0;e<this.n;e++)n.push(this.smoothedLandmarks[e].process(t[e]));return this.landmarkToBuffer(n)}bufferToLandmark(e){let t=[];for(let n=0;n<2*this.n;n+=2)t.push(new DZ(e[n],e[n+1]));return t}landmarkToBuffer(e){let t=new Float32Array(2*this.n);for(let n=0,r=0;n<2*this.n;n+=2,r++)t[n]=e[r].x,t[n+1]=e[r].y;return t}}(25,.025);class yQ{constructor(e,t,n){this.ptr=e,this.width=t,this.height=n}}let bQ,$Q={lipFinishes:[{id:0,mask:[cQ+"lipstick_pattern_masks/lips_closed_v3_5.png",cQ+"lipstick_pattern_masks/lips_open_v3_8.png"]},{id:1,mask:[cQ+"lipstick_pattern_masks/lips_closed_v3_5.png",cQ+"lipstick_pattern_masks/lips_open_v3_8.png"]},{id:2,mask:[cQ+"lipstick_pattern_masks/lips_closed_v3_5.png",cQ+"lipstick_pattern_masks/lips_open_v3_8.png"]},{id:3,mask:[cQ+"lipstick_pattern_masks/lips_closed_v3_5.png",cQ+"lipstick_pattern_masks/gloss_lip_mask_1.png"]},{id:4,mask:[cQ+"lipstick_pattern_masks/glitter_closed.png",cQ+"lipstick_pattern_masks/glitter_open.png"]},{id:5,mask:[cQ+"lipstick_pattern_masks/lips_closed_v3_5.png",cQ+"lipstick_pattern_masks/lips_open_v3_8.png"]}],lipPatterns:[{id:0,maskIntensity:.7,maskId:0,mask:[cQ+"lipstick_pattern_masks/lips_closed_v3_5.png",cQ+"lipstick_pattern_masks/lips_open_v3_8.png"]},{id:1,maskIntensity:[.5,.5],maskId:1,mask:[cQ+"lipstick_pattern_masks/style_2_trial_1(inside).png",cQ+"lipstick_pattern_masks/style_2_trial_1(outside).png"]},{id:2,maskIntensity:[.5,.5],maskId:2,mask:[cQ+"lipstick_pattern_masks/style_1_trial_
21(bottom).png",cQ+"lipstick_pattern_masks/style_1_trial_1(top).png"]}],esFinishes:[{id:0,mask:cQ+"eyeshadow_pattern_masks/glitter_shadow_1.png"},{id:1,mask:cQ+"eyeshadow_pattern_masks/eyeshadow_glitter_v3_3.png"},{id:2,mask:[cQ+"eyeshadow_pattern_masks/eyeshadow_v3_d_g_1_2_1.png"]},{id:3,mask:[cQ+"eyeshadow_pattern_masks/eyeshadow_v3_d_g_2_2_1.png"]},{id:4,mask:[cQ+"eyeshadow_pattern_masks/eyeshadow_v3_d_g_1_1_1.png"]},{id:5,mask:[cQ+"eyeshadow_pattern_masks/eyeshadow_v3_d_g_2_1_1.png"]},{id:6,mask:[cQ+"eyeshadow_pattern_masks/eyeshadow_v3_d_g_1_1_1.png",cQ+"eyeshadow_pattern_masks/eyeshadow_v3_d_g_1_2_1.png"]},{id:7,mask:[cQ+"eyeshadow_pattern_masks/eyeshadow_v3_d_g_2_1_1.png",cQ+"eyeshadow_pattern_masks/eyeshadow_v3_d_g_2_2_1.png"]}],esPatterns:[{id:0,maskIntensity:1,maskId:0,mask:cQ+"eyeshadow_pattern_masks/eyeshadow_v3_1_2.png"},{id:1,maskIntensity:.8,maskId:1,mask:cQ+"eyeshadow_pattern_masks/eyeshadow_v3_6_2.png"},{id:2,maskIntensity:[.7,.7],maskId:2,mask:[cQ+"eyeshadow_pattern_masks/eyeshadow_v3_d_1_1_1.png",cQ+"eyeshadow_pattern_masks/eyeshadow_v3_d_1_2_1.png"]},{id:3,maskIntensity:[.7,.7],maskId:3,mask:[cQ+"eyeshadow_pattern_masks/eyeshadow_v3_d_2_1_1.png",cQ+"eyeshadow_pattern_masks/eyeshadow_v3_d_2_2_1.png"]},{id:4,maskIntensity:[.7,.7,.7,.7],maskId:4,mask:[cQ+"eyeshadow_pattern_masks/eyeshadow_v3_4_1_1.png",cQ+"eyeshadow_pattern_masks/eyeshadow_v3_4_2_1.png",cQ+"eyeshadow_pattern_masks/eyeshadow_v3_4_3_1.png",cQ+"eyeshadow_pattern_masks/eyeshadow_v3_4_4_1.png"]},{id:5,maskIntensity:[.7,.7,.7,.7],maskId:5,mask:[cQ+"eyeshadow_pattern_masks/eyeshadow_v3_q_2_1_1.png",cQ+"eyeshadow_pattern_masks/eyeshadow_v3_q_2_2_1.png",cQ+"eyeshadow_pattern_masks/eyeshadow_v3_q_2_3_1.png",cQ+"eyeshadow_pattern_masks/eyeshadow_v3_q_2_4_1.png"]}],elinePatterns:[{id:0,maskIntensity:.8,maskId:0,mask:cQ+"eyeline_pattern_masks/eyeline_v3_3_4.png"},{id:1,maskIntensity:.8,maskId:1,mask:cQ+"eyeline_pattern_masks/eyeline_v3_6_2.png"}],kajalPatterns:[{id:0,maskIntensity:.8,maskId:0,mask:cQ+"kajal_pattern_masks/kajal_v3_1.png"}],eyebrowPencilPatterns:[{id:0,maskIntensity:.8,maskId:0,mask:cQ+"eyebrow_pencil_pattern_masks/eyebrow_v3_1.png"}],elashPatterns:[{id:0,maskIntensity:1,maskId:0,mask:cQ+"eyelash_pattern_masks/eyelash_v3_1_1.png"},{id:1,maskIntensity:1,maskId:1,mask:cQ+"eyelash_pattern_masks/eyelash_v3_6_1.png"},{id:2,maskIntensity:1,maskId:2,mask:cQ+"eyelash_pattern_masks/eyelash_v3_3_1.png"},{id:3,maskIntensity:1,maskId:3,mask:cQ+"eyelash_pattern_masks/eyelash_v3_4_1.png"}],fPatterns:[{id:0,maskIntensity:.5,maskId:0,mask:cQ+"foundation_masks/foundation_v3_1.png"}],bPatterns:[{id:0,maskIntensity:.7,maskId:0,mask:cQ+"blush_pattern_masks/blush_v3_1_4.png"},{id:1,maskIntensity:.7,maskId:1,mask:cQ+"blush_pattern_masks/blush_v3_3_5.png"}],concealerPatterns:[{id:0,maskIntensity:.7,maskId:0,mask:cQ+"concealer_masks/concealer_5_1.png"}],highlighterPatterns:[{id:0,maskIntensity:.7,maskId:0,mask:cQ+"highlighter_masks/highlighter_v3_6.png"}],contourPatterns:[{id:0,maskIntensity:.7,maskId:0,mask:cQ+"contour_masks/contour_v3_1_1.png"},{id:0,maskIntensity:.7,maskId:0,mask:cQ+"contour_masks/contour_v3_2_1.png"},{id:0,maskIntensity:.7,maskId:0,mask:cQ+"contour_masks/contour_v3_3_1.png"},{id:0,maskIntensity:.7,maskId:0,mask:cQ+"contour_masks/contour_v3_4_1.png"},{id:0,maskIntensity:.7,maskId:0,mask:cQ+"contour_masks/contour_v3_5_1.png"}],bronzerPatterns:[{id:0,maskIntensity:.7,maskId:0,mask:cQ+"bronzer_masks/bronzer_v3_1_1.png"},{id:0,maskIntensity:.7,maskId:0,mask:cQ+"bronzer_masks/bronzer_v3_2_1.png"}]};const _Q=e=>""+(e[0]+10*e[1]+100*e[2]),wQ=e=>parseInt(""+(e+1)),xQ=(e,t,n)=>parseInt(""+(e+1)+t+(e>1?_Q(n):""));let SQ=async()=>{if(null==UZ||null==WZ){UZ=await function(e){var t=void 0===e?{}:e,n=t.maxFaces,r=void 0===n?10:n,o=t.inputWidth,i=void 0===o?128:o,a=t.inputHeight,s=void 0===a?128:a,l=t.iouThreshold,u=void 0===l?.3:l,p=t.scoreThreshold,c=void 0===p?.75:p,d=t.modelUrl;return SZ(this,void 0,void 0,function(){var e;return vZ(this,function(t){switch(t.label){case 0:return null==d?[3,2]:[4,xZ(d)];case 1:return e=t.sent(),[3,4];case 2:return[4,xZ("https://tfhub.dev/tensorflow/tfjs-model/blazeface/1/default/1",{fromTFHub:!0})];case 3:e=t.sent(),t.label=4;case 4:return[2,new FZ(e,i,s,r,u,c)]}})})}({modelUrl:"https://makeup.sdk.orbo.ai/wasm-store/blazeface/model.json"});let e=RZ.getSc(),t=JSON.parse(new TextDecoder("utf-8").decode(e));const n={signature:t.signature},r=function(e,t,n,r){return 1===arguments.length?null!=e.modelTopology||null!=e.weightSpecs?new vi(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 vi({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 vi({modelTopology:e,weightSpecs:t,weightData:n,trainingConfig:r}))}({modelTopology:t.modelTopology,weightSpecs:t.weightsManifest[0].weights,weightData:function(e){for(var t=window.atob(e),n=t.length,r=new Uint8Array(n),o=0;o<n;o++)r[o]=t.charCodeAt(o);return r.buffer}(new TextDecoder("utf-8").decode(RZ.getW())),userDefinedMetadata:n});WZ=await async function(e,t={}){if(null==e)throw new Error("modelUrl in loadGraphModel() cannot be null. Please provide a url or an IOHandler that loads the model");null==t&&(t={}),t.fromTFHub&&null==e.load&&(e.endsWith("/")||(e+="/"),e=`${e}model.json?tfjs-format=file`);const n=new Yj(e,t);return await n.load(),n}(r)}PZ.play(),VZ=PZ.videoWidth+0,zZ=PZ.videoHeight,LZ.width=VZ,LZ.height=zZ,hQ=!1,(async()=>{let e,t,n,r,o,i,a,s,l=0,u=!0,p=!1,c=null,d=!1,h=!1;n=0,r=0,o=s-1,i=a-1;let f=new Float32Array(212);fQ=!0,uQ=document.getElementById("test"),pQ=uQ.getContext("2d",{alpha:!1,desynchronized:!0}),uQ.width=VZ,uQ.height=zZ,bQ=async()=>
2{if(hQ)return void(fQ=!1);let g,m,y,b;if(gs().startScope(),g=Ii(PZ),y=await Ei(g),a=zZ,s=VZ,u&&(gs().startScope(),m=await UZ.estimateFaces(g,!1,!1,!1),m.length>0?(n=parseInt(m[0].topLeft[0]),r=parseInt(m[0].topLeft[1]),o=parseInt(m[0].bottomRight[0]),i=parseInt(m[0].bottomRight[1]),n=n<0?0:n,r=r<0?0:r,o=o>s?s-1:o,i=i>a?a-1:i,p=!0):(u=!0,p=!1),m=null,gs().endScope()),p){let e=0;[b,n,r,o,i]=ms(()=>{const t=qi(g,255).slice([r,n],[i-r,o-n]),l=Hs.resizeBilinear(t,[512,512]).expandDims(0);let p=WZ.predict(l),f=new Float32Array(p.squeeze().reshape([106,2]).reshape([106,2]).dataSync());f=mQ.process(f),p=Co(f,[106,2],"float32"),f=null;let[m,y]=Zi(p,2,1);m=Vi(Ki(m,t.shape[1]),n).asType("float32"),y=Vi(Ki(y,t.shape[0]),r).asType("float32");const b=Hi([m,y],1);if(u)u=!1;else{const e=c.sub(b).abs().sum(0).div(g.shape[1],g.shape[0]),t=e.bufferSync().get([0]),n=e.bufferSync().get([1]);(t>3.5||n>3.5)&&(h=!0),c.dispose(),c=null}let $=m.min().bufferSync().get([0]),_=y.min().bufferSync().get([0]),w=m.max().bufferSync().get([0]),x=y.max().bufferSync().get([0]),S=m.slice([33],[73]).min().bufferSync().get([0]),v=y.slice([33],[73]).min().bufferSync().get([0]),k=m.slice([33],[73]).max().bufferSync().get([0]),E=y.slice([33],[73]).max().bufferSync().get([0]);const I=i-r,T=o-n;d=k>=VZ-2-e||E>=zZ-2-e||S<=e||v<=e;let F=.08;return $=parseInt($-T*F<0?0:$-T*F),_=parseInt(_-I*F<0?0:_-I*F),w=parseInt(w+T*F>=s?s:w+T*F),x=parseInt(x+I*F>=a?a:x+I*F),0!==T&&0!==I||(h=!0),d?(lQ.lipFlag=0,lQ.eyeShadowFlag=0,lQ.eyeLinerFlag=0,lQ.kajalFlag=0,lQ.eyebrowPencilFlag=0,lQ.eyeLashFlag=0,lQ.foundationFlag=0,lQ.concealerFlag=0,lQ.blushFlag=0,lQ.highlighterFlag=0,lQ.contourFlag=0,lQ.bronzerFlag=0,RZ.glUpdate(lQ),dQ=1):!d&&dQ&&(RZ.glUpdate(lQ),dQ=0),u=h,h=!1,null!==c&&(c.dispose(),c=null),c=bs(b.clone()),[new Float32Array(b.reshape([106,2]).dataSync().buffer),$,_,w,x]})}else b=f,u=!0;0===l&&(e=RZ._malloc(y.length),t=RZ._malloc(b.length*b.BYTES_PER_ELEMENT),l=1),RZ.HEAPU8.set(y,e),RZ.HEAPF32.set(b,t>>2);let $=RZ.glProcess(e,VZ,zZ,t),_=new ImageData(new Uint8ClampedArray($),VZ,zZ);pQ.putImageData(_,0,0),gs().endScope(),requestAnimationFrame(bQ)},requestAnimationFrame(bQ),RZ._free(e),RZ._free(t)})()};async function vQ(e){if(!e)return{data:[],width:0,height:0};let t,n,r;if("object"==typeof e){let o=[];for(let t=0;t<e.length;t++)o.push(o0(e[t]));o=await Promise.all(o),r=o[0].shape[0],n=o[0].shape[1],t=Hi(o,0),ys(o)}else t=await o0(e),r=t.shape[0],n=t.shape[1];let o=await Ei(t);return ys(t),{data:o,width:n,height:r}}const kQ=(e,t)=>{const n=typeof e;if(n!==typeof t)return!1;if("string"===n)return e===t;if(e.length!==t.length)return!1;let r=!0;for(let n=0;n<e.length;n++)if(e[n]!==t[n]){r=!1;break}return r};let EQ,IQ,TQ;let FQ,NQ,jQ;let AQ,CQ,MQ;let DQ,OQ,RQ;let BQ,PQ,LQ;let WQ,UQ,zQ,VQ,HQ,GQ,qQ,KQ,XQ,YQ,JQ,ZQ,QQ,e0,t0;const n0=async()=>{await(async()=>{const e=[];e.push((async()=>{gs().startScope();let e=await vQ($Q.fPatterns[0].mask);EQ=new Uint8Array(3),IQ=RZ._malloc(3);const t=RZ._malloc(e.data.length);TQ=new yQ(t,e.width,e.height),RZ.HEAPU8.set(e.data,TQ.ptr),gs().endScope()})()),e.push((async()=>{gs().startScope();let e=await vQ($Q.kajalPatterns[0].mask);FQ=new Uint8Array(3),NQ=RZ._malloc(3);const t=RZ._malloc(e.data.length);jQ=new yQ(t,e.width,e.height),RZ.HEAPU8.set(e.data,jQ.ptr),gs().endScope()})()),e.push((async()=>{gs().startScope();let e=await vQ($Q.eyebrowPencilPatterns[0].mask);AQ=new Uint8Array(3),CQ=RZ._malloc(3);const t=RZ._malloc(e.data.length);MQ=new yQ(t,e.width,e.height),RZ.HEAPU8.set(e.data,MQ.ptr),gs().endScope()})()),e.push((async()=>{gs().startScope();let e=await vQ($Q.highlighterPatterns[0].mask);DQ=new Uint8Array(3),OQ=RZ._malloc(3);const t=RZ._malloc(e.data.length);RQ=new yQ(t,e.width,e.height),RZ.HEAPU8.set(e.data,RQ.ptr),gs().endScope()})()),e.push((async()=>{gs().startScope();let e=await vQ($Q.concealerPatterns[0].mask);BQ=new Uint8Array(3),PQ=RZ._malloc(3);const t=RZ._malloc(e.data.length);LQ=new yQ(t,e.width,e.height),RZ.HEAPU8.set(e.data,LQ.ptr),gs().endScope()})()),await Promise.all(e)})(),(()=>{const e=216e4,t=64e4;WQ=RZ._malloc(864e4),UQ=RZ._malloc(432e4),zQ=RZ._malloc(432e4),VQ=RZ._malloc(932200),GQ=RZ._malloc(3),HQ=new Uint8Array(3),qZ=new Uint8Array(12),KZ=new Uint8Array(12),rQ=new Float32Array(4),oQ=new Float32Array(4),HZ=new Uint8Array(6),tQ=new Float32Array(2),GZ=RZ._malloc(6),ZZ=RZ._malloc(3),eQ=RZ._malloc(3),nQ=RZ._malloc(tQ.length*Float32Array.BYTES_PER_ELEMENT),qQ=RZ._malloc(432e4),KQ=RZ._malloc(e),XQ=RZ._malloc(e),JZ=new Uint8Array(3),QZ=new Uint8Array(3),XZ=RZ._malloc(12),YZ=RZ._malloc(12),iQ=RZ._malloc(rQ.length*Float32Array.BYTES_PER_ELEMENT),aQ=RZ._malloc(oQ.length*Float32Array.BYTES_PER_ELEMENT),JQ=new Uint8Array(3),YQ=RZ._malloc(t),ZQ=RZ._malloc(3),e0=new Uint8Array(3),QQ=RZ._malloc(t),t0=RZ._malloc(3)})()},r0=async function(e){const t=JSON.parse(JSON.stringify(e)),n=(e=>{const t=(e=>{const t={intensities:[],colors:[]};if(0===e.eyeShadowFinish)return t;const n=e.eyeShadowFinishIntensity||e.eyeShadowIntensity;if(2===e.eyeShadowColorNo)switch(e.eyeShadowFinish){case 2:case 3:t.intensities.push(n[1]),t.colors.push(e.eyeShadowColor[1]);break;case 4:case 5:t.intensities.push(n[0]),t.colors.push(e.eyeShadowColor[0]);break;case 6:case 7:t.intensities.push(n[0]),t.intensities.push(n[1]),t.colors.push(e.eyeShadowColor[0]),t.colors.push(e.eyeShadowColor[1])}else 1===e.eyeShadowColorNo?(t.colors.push(e.eyeShadowColor),t.intensities.push(n)):(t.colors.push(e.eyeShadowColor[0]),t.intensities.push(n[0]));return t})(e);return{finishColorNo:t.colors.length,finishColors:t.colors,finishIntensities:t.intensities}})(t);t.eyeShadowFinishColorNo=n.finishColorNo,1===n.finishColorNo?(t.eyeShadowFinishIntensity=n.finishIntensities[0],t.eyeShadowFinishColor=n.finishColors[0]):n.finishColorNo>1?(t.eyeShadowFinishIntensity=n.finishIntensities,t.eyeShadowFinishColor=n.finishColors):(t.eye
2ShadowFinishIntensity=0,t.eyeShadowFinishColor=[0,0,0]),t.lipMask=$Q.lipPatterns[t.lipMaskId].mask,t.lipFinishMask=$Q.lipFinishes[t.lipFinish].mask,t.eyeShadowMask=$Q.esPatterns[t.eyeShadowMaskId].mask,t.eyeShadowFinishMask=$Q.esFinishes[t.eyeShadowFinish].mask,t.eyeLineMask=$Q.elinePatterns[t.eyeLineMaskId].mask,t.kajalMask=$Q.kajalPatterns[t.kajalMaskId].mask,t.eyebrowPencilMask=$Q.eyebrowPencilPatterns[t.eyebrowPencilMaskId].mask,t.eyeLashMask=$Q.elashPatterns[t.eyeLashMaskId].mask,t.foundationMask=$Q.fPatterns[0].mask,t.blushMask=$Q.bPatterns[t.blushMaskId].mask,t.concealerMask=$Q.concealerPatterns[0].mask,t.highlighterMask=$Q.highlighterPatterns[0].mask,t.contourMask=$Q.contourPatterns[t.contourMaskId].mask,t.bronzerMask=$Q.bronzerPatterns[t.bronzerMaskId].mask,BZ=t;let r=t.eyeLineColor,o=t.kajalColor,i=t.eyebrowPencilColor,a=t.eyeLashColor,s=t.foundationColor,l=t.blushColor,u=t.concealerColor,p=t.highlighterColor,c=t.contourColor,d=t.bronzerColor;gs().startScope();let h=[];const f=null==sQ||!kQ(sQ.lipMask,t.lipMask),g=null==sQ||!kQ(sQ.eyeShadowMask,t.eyeShadowMask),m=null==sQ||!kQ(sQ.eyeShadowFinishMask,t.eyeShadowFinishMask);h.push(f?vQ(t.lipMask):null),h.push(g?vQ(t.eyeShadowMask):null),h.push(null==sQ||sQ.eyeLineMask!=t.eyeLineMask?vQ(t.eyeLineMask):null),h.push(null==sQ||sQ.eyeLashMask!=t.eyeLashMask?vQ(t.eyeLashMask):null),h.push(null==sQ||sQ.blushMask!=t.blushMask?vQ(t.blushMask):null),h.push(null!=sQ&&kQ(sQ.lipFinishMask,t.lipFinishMask)?null:vQ(t.lipFinishMask)),h.push(m?vQ(t.eyeShadowFinishMask):null),h.push(null!=sQ&&kQ(sQ.contourMask,t.contourMask)?null:vQ(t.contourMask)),h.push(null!=sQ&&kQ(sQ.bronzerMask,t.bronzerMask)?null:vQ(t.bronzerMask));let y=await Promise.all(h);h=[];const b=null!==y[0]?y[0]:gQ[0];gQ[0]=b;const $=null!==y[1]?y[1]:gQ[1];gQ[1]=$;const _=null!==y[2]?y[2]:gQ[2];gQ[2]=_;const w=null!==y[3]?y[3]:gQ[3];gQ[3]=w;const x=null!==y[4]?y[4]:gQ[4];gQ[4]=x;const S=null!==y[5]?y[5]:gQ[5];gQ[5]=S;const v=null!==y[6]?y[6]:gQ[6];gQ[6]=v;const k=null!==y[7]?y[7]:gQ[7];gQ[7]=k;const E=null!==y[8]?y[8]:gQ[8];if(gQ[8]=E,y=[],1===t.lipColorNo)HZ.set(t.lipColor);else for(let e=0;e<t.lipColor.length;e++)HZ.set(t.lipColor[e],3*e);if(1===t.eyeShadowColorNo)qZ.set(t.eyeShadowColor);else for(let e=0;e<t.eyeShadowColorNo;e++)qZ.set(t.eyeShadowColor[e],3*e);if(1===t.eyeShadowFinishColorNo)KZ.set(t.eyeShadowFinishColor);else for(let e=0;e<t.eyeShadowFinishColorNo;e++)KZ.set(t.eyeShadowFinishColor[e],3*e);JZ.set(r),FQ.set(o),AQ.set(i),QZ.set(a),EQ.set(s),HQ.set(l),BQ.set(u),DQ.set(p),rQ.set(1===t.eyeShadowColorNo?[t.eyeShadowIntensity]:t.eyeShadowIntensity),oQ.set(1===t.eyeShadowFinishColorNo?[t.eyeShadowFinishIntensity]:t.eyeShadowFinishIntensity),tQ.set(1===t.lipColorNo?[t.lipIntensity]:t.lipIntensity),JQ.set(c),e0.set(d);let I=new yQ(null,b.width,b.height),T=new yQ(null,S.width,S.height),F=new yQ(null,$.width,$.height),N=new yQ(VQ,x.width,x.height),j=new yQ(XQ,w.width,w.height),A=new yQ(KQ,_.width,_.height),C=new yQ(qQ,v.width,v.height);var M,D,O;f&&RZ.HEAPU8.set(b.data,UQ),RZ.HEAPU8.set(S.data,zQ),g&&RZ.HEAPU8.set($.data,WQ),m&&RZ.HEAPU8.set(v.data,C.ptr),RZ.HEAPU8.set(_.data,A.ptr),RZ.HEAPU8.set(w.data,j.ptr),RZ.HEAPU8.set(x.data,N.ptr),RZ.HEAPU8.set(HZ,GZ),RZ.HEAPU8.set(qZ,XZ),RZ.HEAPU8.set(KZ,YZ),RZ.HEAPU8.set(JZ,ZZ),RZ.HEAPU8.set(QZ,eQ),RZ.HEAPU8.set(HQ,GQ),RZ.HEAPU8.set(BQ,PQ),RZ.HEAPU8.set(DQ,OQ),RZ.HEAPU8.set(FQ,NQ),RZ.HEAPU8.set(AQ,CQ),RZ.HEAPU8.set(EQ,IQ),RZ.HEAPF32.set(tQ,nQ>>2),RZ.HEAPU8.set(JQ,ZQ),RZ.HEAPU8.set(k.data,YQ),RZ.HEAPU8.set(e0,t0),RZ.HEAPU8.set(E.data,QQ),RZ.HEAPF32.set(rQ,iQ>>2),RZ.HEAPF32.set(oQ,aQ>>2),lQ={width:PZ.videoWidth,height:PZ.videoHeight,lipstick:{lipFlag:t.lipFlag?(M=t.lipMaskId,D=t.lipFinish,O=t.lipColor,parseInt(""+(M+1)+D+(M>0?_Q(O):""))):0,lipIntensityPtr:nQ,lipColorPtr:GZ,lipFinish:t.lipFinish,lipColorNo:t.lipColorNo,lipMaskPtr:UQ,lipFinishMaskPtr:zQ,lipMaskWidth:I.width,lipMaskHeight:I.height,lipFinishMaskHeight:T.height,lipFinishMaskWidth:T.width},eyeshadow:{eyeShadowFlag:t.eyeShadowFlag?xQ(t.eyeShadowMaskId,t.eyeShadowFinish,t.eyeShadowColor):0,eyeShadowIntensityPtr:iQ,eyeShadowFinishIntensityPtr:aQ,eyeShadowColorPtr:XZ,eyeShadowFinishColorPtr:YZ,eyeShadowFinish:t.eye
2ShadowFinish,eyeShadowColorNo:t.eyeShadowColorNo,eyeShadowFinishColorNo:t.eyeShadowFinishColorNo,eyeShadowMaskPtr:WQ,eyeShadowFinishMaskPtr:C.ptr,eyeShadowMaskWidth:F.width||C.width,eyeShadowMaskHeight:F.height||C.height},eyeliner:{eyeLineFlag:t.eyeLineFlag?wQ(t.eyeLineMaskId):0,eyeLineIntensity:t.eyeLinerIntensity,eyeLineColorPtr:ZZ,eyeLineMaskPtr:A.ptr,eyeLineMaskWidth:A.width,eyeLineMaskHeight:A.height},kajal:{kajalFlag:t.kajalFlag,kajalIntensity:t.kajalIntensity,kajalColorPtr:NQ,kajalMaskPtr:jQ.ptr,kajalMaskWidth:jQ.width,kajalMaskHeight:jQ.height},eyebrowPencil:{eyebrowPencilFlag:t.eyebrowPencilFlag,eyebrowPencilIntensity:t.eyebrowPencilIntensity,eyebrowPencilColorPtr:CQ,eyebrowPencilMaskPtr:MQ.ptr,eyebrowPencilMaskWidth:MQ.width,eyebrowPencilMaskHeight:MQ.height},eyelash:{eyeLashFlag:t.eyeLashFlag?wQ(t.eyeLashMaskId):0,eyeLashIntensity:t.eyeLashIntensity,eyeLashColorPtr:eQ,eyeLashMaskPtr:j.ptr,eyeLashMaskWidth:j.width,eyeLashMaskHeight:j.height},foundation:{foundationFlag:t.foundationFlag,foundationIntensity:t.foundationIntensity,foundationColorPtr:IQ,foundationMaskPtr:TQ.ptr,foundationMaskWidth:TQ.width,foundationMaskHeight:TQ.height},concealer:{concealerFlag:t.concealerFlag,concealerIntensity:t.concealerIntensity,concealerColorPtr:PQ,concealerMaskPtr:LQ.ptr,concealerMaskWidth:LQ.width,concealerMaskHeight:LQ.height},blush:{blushFlag:t.blushFlag?wQ(t.blushMaskId):0,blushIntensity:t.blushIntensity,blushColorPtr:GQ,blushMaskPtr:N.ptr,blushMaskWidth:N.width,blushMaskHeight:N.height},highlighter:{highlighterFlag:t.highlighterFlag,highlighterIntensity:t.highlighterIntensity,highlighterColorPtr:OQ,highlighterMaskPtr:RQ.ptr,highlighterMaskWidth:RQ.width,highlighterMaskHeight:RQ.height},contour:{contourFlag:t.contourFlag,contourIntensity:t.contourIntensity,contourColorPtr:ZQ,contourMaskPtr:YQ,contourMaskWidth:k.width,contourMaskHeight:k.height},bronzer:{bronzerFlag:t.bronzerFlag,bronzerIntensity:t.bronzerIntensity,bronzerColorPtr:t0,bronzerMaskPtr:QQ,bronzerMaskWidth:E.width,bronzerMaskHeight:E.height}};try{RZ.glUpdate(lQ)}catch(e){console.error(e.message)}gs().endScope(),sQ=JSON.parse(JSON.stringify(t))};function o0(e){return new Promise((t,n)=>{let r=new Image;r.onload=()=>{let e=Ii(r,4);t(e)},r.onerror=n,r.src=e,r.setAttribute("crossOrigin","")})}function i0(){hQ=!0,RZ.glDestroy(),HZ=qZ=JZ=FQ=AQ=QZ=EQ=HQ=BQ=DQ=void 0,jQ=MQ=TQ=VQ=LQ=RQ=GZ=XZ=ZZ=eQ=IQ=GQ=PQ=OQ=void 0}const a0={initMakeup:async function(e,t,n,r,o,i,a){return fQ&&i0(),new Promise((t,n)=>{let s={clientProductId:i,sessionToken:a},l=new Headers;l.append("Content-Type","application/json"),fetch("https://test.api.v2.portal.orbo.ai/client-products",{method:"POST",headers:l,body:JSON.stringify(s)}).then(e=>e.json()).then(async i=>{if(!i.success)return console.error("URL NOT VALID"),i0(),void n(i.error);PZ=e,LZ=r,BZ=o,RZ=await async function(){return new Promise(async(e,t)=>{await _o.setBackend("wasm"),await _o.ready(),RZ={onRuntimeInitialized:async()=>{e(RZ)},onStatus:e=>console.log(e),onExit:()=>console.log("wasm exit"),locateFile:e=>"./assets/"+e,canvas:LZ},ke().set("PROD",!0),await MZ()(RZ)})}(),await async function(e){e.glInit(PZ.videoWidth,PZ.videoHeight),await n0(),r0(BZ),await SQ()}(RZ),t()}).catch(e=>{console.error("URL NOT VALID"),i0(),n(e)})})},updateMakeup:r0,stopMakeup:i0}})(),window.orbo=__webpack_exports__})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.