/** * @license * Copyright 2023 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).tf=e.tf||{})}(this,(function(e){"use strict";function t(e){var t,r;function a(t,r){try{var o=e[t](r),s=o.value,u=s instanceof n;Promise.resolve(u?s.v:s).then((function(n){if(u){var r="return"===t?"return":"next";if(!s.k||n.done)return a(r,n);n=e[r](n).value}i(o.done?"return":"normal",n)}),(function(e){a("throw",e)}))}catch(e){i("throw",e)}}function i(e,n){switch(e){case"return":t.resolve({value:n,done:!0});break;case"throw":t.reject(n);break;default:t.resolve({value:n,done:!1})}(t=t.next)?a(t.key,t.arg):r=null}this._invoke=function(e,n){return new Promise((function(i,o){var s={key:e,arg:n,resolve:i,reject:o,next:null};r?r=r.next=s:(t=r=s,a(e,n))}))},"function"!=typeof e.return&&(this.return=void 0)}function n(e,t){this.v=e,this.k=t}function r(){r=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var i=t&&t.prototype instanceof f?t:f,o=Object.create(i.prototype),s=new T(r||[]);return a(o,"_invoke",{value:w(e,n,s)}),o}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var p={};function f(){}function d(){}function v(){}var m={};c(m,o,(function(){return this}));var g=Object.getPrototypeOf,y=g&&g(g(C([])));y&&y!==t&&n.call(y,o)&&(m=y);var b=v.prototype=f.prototype=Object.create(m);function x(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){function r(a,i,o,s){var u=h(e[a],e,i);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==typeof l&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,o,s)}),(function(e){r("throw",e,o,s)})):t.resolve(l).then((function(e){c.value=e,o(c)}),(function(e){return r("throw",e,o,s)}))}s(u.arg)}var i;a(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,a){r(e,n,t,a)}))}return i=i?i.then(a,a):a()}})}function w(e,t,n){var r="suspendedStart";return function(a,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===a)throw i;return E()}for(n.method=a,n.arg=i;;){var o=n.delegate;if(o){var s=I(o,n);if(s){if(s===p)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=h(e,t,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===p)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}function I(e,t){var n=t.method,r=e.iterator[n];if(void 0===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,I(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),p;var a=h(r,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,p;var i=a.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,p):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function N(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(N,this),this.reset(!0)}function C(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,a=function t(){for(;++r=0;--a){var i=this.tryEntries[a],o=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(s&&u){if(this.prev=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),S(n),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var a=r.arg;S(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:C(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),p}},e}function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function i(e,t,n,r,a,i,o){try{var s=e[i](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,a)}function o(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function s(e){i(o,r,a,s,u,"next",e)}function u(e){i(o,r,a,s,u,"throw",e)}s(void 0)}))}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw i}}}}function R(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}t.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},t.prototype.next=function(e){return this._invoke("next",e)},t.prototype.throw=function(e){return this._invoke("throw",e)},t.prototype.return=function(e){return this._invoke("return",e)};var _="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function O(e,t){return e(t={exports:{}},t.exports),t.exports}var F,D,M=function(e){return e&&e.Math==Math&&e},L=M("object"==("undefined"==typeof globalThis?"undefined":a(globalThis))&&globalThis)||M("object"==("undefined"==typeof window?"undefined":a(window))&&window)||M("object"==("undefined"==typeof self?"undefined":a(self))&&self)||M("object"==a(_)&&_)||function(){return this}()||Function("return this")(),z=function(e){try{return!!e()}catch(e){return!0}},P=!z((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),B=!z((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),W=Function.prototype.call,V=B?W.bind(W):function(){return W.apply(W,arguments)},U={}.propertyIsEnumerable,G=Object.getOwnPropertyDescriptor,j=G&&!U.call({1:2},1)?function(e){var t=G(this,e);return!!t&&t.enumerable}:U,H={f:j},q=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},K=Function.prototype,X=K.call,Y=B&&K.bind.bind(X,X),J=B?Y:function(e){return function(){return X.apply(e,arguments)}},Z=J({}.toString),Q=J("".slice),$=function(e){return Q(Z(e),8,-1)},ee=Object,te=J("".split),ne=z((function(){return!ee("z").propertyIsEnumerable(0)}))?function(e){return"String"==$(e)?te(e,""):ee(e)}:ee,re=function(e){return null==e},ae=TypeError,ie=function(e){if(re(e))throw ae("Can't call method on "+e);return e},oe=function(e){return ne(ie(e))},se="object"==("undefined"==typeof document?"undefined":a(document))&&document.all,ue={all:se,IS_HTMLDDA:void 0===se&&void 0!==se},ce=ue.all,le=ue.IS_HTMLDDA?function(e){return"function"==typeof e||e===ce}:function(e){return"function"==typeof e},he=ue.all,pe=ue.IS_HTMLDDA?function(e){return"object"==a(e)?null!==e:le(e)||e===he}:function(e){return"object"==a(e)?null!==e:le(e)},fe=function(e){return le(e)?e:void 0},de=function(e,t){return arguments.length<2?fe(L[e]):L[e]&&L[e][t]},ve=J({}.isPrototypeOf),me="undefined"!=typeof navigator&&String(navigator.userAgent)||"",ge=L.process,ye=L.Deno,be=ge&&ge.versions||ye&&ye.version,xe=be&&be.v8;xe&&(D=(F=xe.split("."))[0]>0&&F[0]<4?1:+(F[0]+F[1])),!D&&me&&(!(F=me.match(/Edge\/(\d+)/))||F[1]>=74)&&(F=me.match(/Chrome\/(\d+)/))&&(D=+F[1]);var ke=D,we=!!Object.getOwnPropertySymbols&&!z((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&ke&&ke<41})),Ie=we&&!Symbol.sham&&"symbol"==a(Symbol.iterator),Ne=Object,Se=Ie?function(e){return"symbol"==a(e)}:function(e){var t=de("Symbol");return le(t)&&ve(t.prototype,Ne(e))},Te=String,Ce=function(e){try{return Te(e)}catch(e){return"Object"}},Ee=TypeError,Ae=function(e){if(le(e))return e;throw Ee(Ce(e)+" is not a function")},Re=function(e,t){var n=e[t];return re(n)?void 0:Ae(n)},_e=TypeError,Oe=function(e,t){var n,r;if("string"===t&&le(n=e.toString)&&!pe(r=V(n,e)))return r;if(le(n=e.valueOf)&&!pe(r=V(n,e)))return r;if("string"!==t&&le(n=e.toString)&&!pe(r=V(n,e)))return r;throw _e("Can't convert object to primitive value")},Fe=!1,De=Object.defineProperty,Me=function(e,t){try{De(L,e,{value:t,configurable:!0,writable:!0})}catch(n){L[e]=t}return t},Le="__core-js_shared__",ze=L[Le]||Me(Le,{}),Pe=O((function(e){(e.exports=function(e,t){return ze[e]||(ze[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.29.1",mode:"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.29.1/LICENSE",source:"https://github.com/zloirock/core-js"})})),Be=Object,We=function(e){return Be(ie(e))},Ve=J({}.hasOwnProperty),Ue=Object.hasOwn||function(e,t){return Ve(We(e),t)},Ge=0,je=Math.random(),He=J(1..toString),qe=function(e){return"Symbol("+(void 0===e?"":e)+")_"+He(++Ge+je,36)},Ke=L.Symbol,Xe=Pe("wks"),Ye=Ie?Ke.for||Ke:Ke&&Ke.withoutSetter||qe,Je=function(e){return Ue(Xe,e)||(Xe[e]=we&&Ue(Ke,e)?Ke[e]:Ye("Symbol."+e)),Xe[e]},Ze=TypeError,Qe=Je("toPrimitive"),$e=function(e,t){if(!pe(e)||Se(e))return e;var n,r=Re(e,Qe);if(r){if(void 0===t&&(t="default"),n=V(r,e,t),!pe(n)||Se(n))return n;throw Ze("Can't convert object to primitive value")}return void 0===t&&(t="number"),Oe(e,t)},et=function(e){var t=$e(e,"string");return Se(t)?t:t+""},tt=L.document,nt=pe(tt)&&pe(tt.createElement),rt=function(e){return nt?tt.createElement(e):{}},at=!P&&!z((function(){return 7!=Object.defineProperty(rt("div"),"a",{get:function(){return 7}}).a})),it=Object.getOwnPropertyDescriptor,ot={f:P?it:function(e,t){if(e=oe(e),t=et(t),at)try{return it(e,t)}catch(e){}if(Ue(e,t))return q(!V(H.f,e,t),e[t])}},st=P&&z((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),ut=String,ct=TypeError,lt=function(e){if(pe(e))return e;throw ct(ut(e)+" is not an object")},ht=TypeError,pt=Object.defineProperty,ft=Object.getOwnPropertyDescriptor,dt="enumerable",vt="configurable",mt="writable",gt={f:P?st?function(e,t,n){if(lt(e),t=et(t),lt(n),"function"==typeof e&&"prototype"===t&&"value"in n&&mt in n&&!n.writable){var r=ft(e,t);r&&r.writable&&(e[t]=n.value,n={configurable:vt in n?n.configurable:r.configurable,enumerable:dt in n?n.enumerable:r.enumerable,writable:!1})}return pt(e,t,n)}:pt:function(e,t,n){if(lt(e),t=et(t),lt(n),at)try{return pt(e,t,n)}catch(e){}if("get"in n||"set"in n)throw ht("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},yt=P?function(e,t,n){return gt.f(e,t,q(1,n))}:function(e,t,n){return e[t]=n,e},bt=Function.prototype,xt=P&&Object.getOwnPropertyDescriptor,kt=Ue(bt,"name"),wt={EXISTS:kt,PROPER:kt&&"something"===function(){}.name,CONFIGURABLE:kt&&(!P||P&&xt(bt,"name").configurable)},It=J(Function.toString);le(ze.inspectSource)||(ze.inspectSource=function(e){return It(e)});var Nt,St,Tt,Ct=ze.inspectSource,Et=L.WeakMap,At=le(Et)&&/native code/.test(String(Et)),Rt=Pe("keys"),_t=function(e){return Rt[e]||(Rt[e]=qe(e))},Ot={},Ft="Object already initialized",Dt=L.TypeError,Mt=L.WeakMap;if(At||ze.state){var Lt=ze.state||(ze.state=new Mt);Lt.get=Lt.get,Lt.has=Lt.has,Lt.set=Lt.set,Nt=function(e,t){if(Lt.has(e))throw Dt(Ft);return t.facade=e,Lt.set(e,t),t},St=function(e){return Lt.get(e)||{}},Tt=function(e){return Lt.has(e)}}else{var zt=_t("state");Ot[zt]=!0,Nt=function(e,t){if(Ue(e,zt))throw Dt(Ft);return t.facade=e,yt(e,zt,t),t},St=function(e){return Ue(e,zt)?e[zt]:{}},Tt=function(e){return Ue(e,zt)}}var Pt={set:Nt,get:St,has:Tt,enforce:function(e){return Tt(e)?St(e):Nt(e,{})},getterFor:function(e){return function(t){var n;if(!pe(t)||(n=St(t)).type!==e)throw Dt("Incompatible receiver, "+e+" required");return n}}},Bt=O((function(e){var t=wt.CONFIGURABLE,n=Pt.enforce,r=Pt.get,a=String,i=Object.defineProperty,o=J("".slice),s=J("".replace),u=J([].join),c=P&&!z((function(){return 8!==i((function(){}),"length",{value:8}).length})),l=String(String).split("String"),h=e.exports=function(e,r,h){"Symbol("===o(a(r),0,7)&&(r="["+s(a(r),/^Symbol\(([^)]*)\)/,"$1")+"]"),h&&h.getter&&(r="get "+r),h&&h.setter&&(r="set "+r),(!Ue(e,"name")||t&&e.name!==r)&&(P?i(e,"name",{value:r,configurable:!0}):e.name=r),c&&h&&Ue(h,"arity")&&e.length!==h.arity&&i(e,"length",{value:h.arity});try{h&&Ue(h,"constructor")&&h.constructor?P&&i(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var p=n(e);return Ue(p,"source")||(p.source=u(l,"string"==typeof r?r:"")),e};Function.prototype.toString=h((function(){return le(this)&&r(this).source||Ct(this)}),"toString")})),Wt=function(e,t,n,r){r||(r={});var a=r.enumerable,i=void 0!==r.name?r.name:t;if(le(n)&&Bt(n,i,r),r.global)a?e[t]=n:Me(t,n);else{try{r.unsafe?e[t]&&(a=!0):delete e[t]}catch(e){}a?e[t]=n:gt.f(e,t,{value:n,enumerable:!1,configurable:!r.nonConfigurable,writable:!r.nonWritable})}return e},Vt=Math.ceil,Ut=Math.floor,Gt=Math.trunc||function(e){var t=+e;return(t>0?Ut:Vt)(t)},jt=function(e){var t=+e;return t!=t||0===t?0:Gt(t)},Ht=Math.max,qt=Math.min,Kt=function(e,t){var n=jt(e);return n<0?Ht(n+t,0):qt(n,t)},Xt=Math.min,Yt=function(e){return e>0?Xt(jt(e),9007199254740991):0},Jt=function(e){return Yt(e.length)},Zt=function(e){return function(t,n,r){var a,i=oe(t),o=Jt(i),s=Kt(r,o);if(e&&n!=n){for(;o>s;)if((a=i[s++])!=a)return!0}else for(;o>s;s++)if((e||s in i)&&i[s]===n)return e||s||0;return!e&&-1}},Qt={includes:Zt(!0),indexOf:Zt(!1)},$t=Qt.indexOf,en=J([].push),tn=function(e,t){var n,r=oe(e),a=0,i=[];for(n in r)!Ue(Ot,n)&&Ue(r,n)&&en(i,n);for(;t.length>a;)Ue(r,n=t[a++])&&(~$t(i,n)||en(i,n));return i},nn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],rn=nn.concat("length","prototype"),an={f:Object.getOwnPropertyNames||function(e){return tn(e,rn)}},on={f:Object.getOwnPropertySymbols},sn=J([].concat),un=de("Reflect","ownKeys")||function(e){var t=an.f(lt(e)),n=on.f;return n?sn(t,n(e)):t},cn=function(e,t,n){for(var r=un(t),a=gt.f,i=ot.f,o=0;oo;)gt.f(e,n=a[o++],r[n]);return e},Rn={f:An},_n=de("document","documentElement"),On=_t("IE_PROTO"),Fn=function(){},Dn=function(e){return"