scribe-widget 1.0.3 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -65,7 +65,7 @@
65
65
  * @return {boolean} True if the event is supported.
66
66
  * @internal
67
67
  * @license Modernizr 3.0.0pre (Custom Build) | MIT
68
- */function ps(e,t,n,r){Cn(r);var o=wl(t,"onChange");if(o.length>0){var a=new Oi("onChange","change",null,n,r);e.push({event:a,listeners:o})}}var hs=null,ms=null;function gs(e){fl(e,0)}function bs(e){if(et(Xu(e)))return e}function ys(e,t){if("change"===e)return t}var _s=!1;function vs(){hs&&(hs.detachEvent("onpropertychange",ws),hs=null,ms=null)}function ws(e){"value"===e.propertyName&&bs(ms)&&function(e){var t=[];ps(t,ms,e,On(e)),Fn(gs,t)}(e)}function Ss(e,t,n){"focusin"===e?(vs(),function(e,t){ms=t,(hs=e).attachEvent("onpropertychange",ws)}(t,n)):"focusout"===e&&vs()}function xs(e,t){if("selectionchange"===e||"keyup"===e||"keydown"===e)return bs(ms)}function Ts(e,t){if("click"===e)return bs(t)}function Es(e,t){if("input"===e||"change"===e)return bs(t)}function ks(e,t,n,r,o,a,i){var s,l,u,c,d,f,p=n?Xu(n):window;if("select"===(c=(u=p).nodeName&&u.nodeName.toLowerCase())||"input"===c&&"file"===u.type?s=ys:fs(p)?_s?s=Es:(s=xs,l=Ss):function(e){var t=e.nodeName;return t&&"input"===t.toLowerCase()&&("checkbox"===e.type||"radio"===e.type)}(p)&&(s=Ts),s){var h=s(t,n);if(h)return void ps(e,h,r,o)}l&&l(t,p,n),"focusout"===t&&(f=(d=p)._wrapperState)&&f.controlled&&"number"===d.type&&pt(d,"number",d.value)}function Ps(e,t,n,r,o,a,i){var s="mouseover"===t||"pointerover"===t,l="mouseout"===t||"pointerout"===t;if(s&&r!==En){var u=r.relatedTarget||r.fromElement;if(u&&(Yu(u)||Wu(u)))return}if(l||s){var c,d,f;if(o.window===o)c=o;else{var p=o.ownerDocument;c=p?p.defaultView||p.parentWindow:window}if(l){var h=r.relatedTarget||r.toElement;if(d=n,null!==(f=h?Yu(h):null))(f!==Tr(f)||5!==f.tag&&6!==f.tag)&&(f=null)}else d=null,f=n;if(d!==f){var m=Ii,g="onMouseLeave",b="onMouseEnter",y="mouse";"pointerout"!==t&&"pointerover"!==t||(m=qi,g="onPointerLeave",b="onPointerEnter",y="pointer");var _=null==d?c:Xu(d),v=null==f?c:Xu(f),w=new m(g,y+"leave",d,r,o);w.target=_,w.relatedTarget=v;var S=null;if(Yu(o)===n){var x=new m(b,y+"enter",f,r,o);x.target=v,x.relatedTarget=_,S=x}!function(e,t,n,r,o){var a=r&&o?function(e,t){for(var n=e,r=t,o=0,a=n;a;a=Sl(a))o++;for(var i=0,s=r;s;s=Sl(s))i++;for(;o-i>0;)n=Sl(n),o--;for(;i-o>0;)r=Sl(r),i--;var l=o;for(;l--;){if(n===r||null!==r&&n===r.alternate)return n;n=Sl(n),r=Sl(r)}return null}(r,o):null;null!==r&&xl(e,t,r,a,!1);null!==o&&null!==n&&xl(e,n,o,a,!0)}(e,w,S,d,f)}}}k&&(_s=function(e){if(!k)return!1;var t="on"+e,n=t in document;if(!n){var r=document.createElement("div");r.setAttribute(t,"return;"),n="function"==typeof r[t]}return n}("input")&&(!document.documentMode||document.documentMode>9));var Os="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t};function As(e,t){if(Os(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var o=0;o<n.length;o++){var a=n[o];if(!P.call(t,a)||!Os(e[a],t[a]))return!1}return!0}function $s(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Rs(e){for(;e;){if(e.nextSibling)return e.nextSibling;e=e.parentNode}}function Is(e,t){for(var n=$s(e),r=0,o=0;n;){if(3===n.nodeType){if(o=r+n.textContent.length,r<=t&&o>=t)return{node:n,offset:t-r};r=o}n=$s(Rs(n))}}function Cs(e){var t=e.ownerDocument,n=t&&t.defaultView||window,r=n.getSelection&&n.getSelection();if(!r||0===r.rangeCount)return null;var o=r.anchorNode,a=r.anchorOffset,i=r.focusNode,s=r.focusOffset;try{o.nodeType,i.nodeType}catch(rw){return null}return function(e,t,n,r,o){var a=0,i=-1,s=-1,l=0,u=0,c=e,d=null;e:for(;;){for(var f=null;c!==t||0!==n&&3!==c.nodeType||(i=a+n),c!==r||0!==o&&3!==c.nodeType||(s=a+o),3===c.nodeType&&(a+=c.nodeValue.length),null!==(f=c.firstChild);)d=c,c=f;for(;;){if(c===e)break e;if(d===t&&++l===n&&(i=a),d===r&&++u===o&&(s=a),null!==(f=c.nextSibling))break;d=(c=d).parentNode}c=f}if(-1===i||-1===s)return null;return{start:i,end:s}}(e,o,a,i,s)}function Ds(e){return e&&3===e.nodeType}function Ns(e,t){return!(!e||!t)&&(e===t||!Ds(e)&&(Ds(t)?Ns(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function Ms(e){return e&&e.ownerDocument&&Ns(e.ownerDocument.documentElement,e)}function Ls(e){try{return"string"==typeof e.contentWindow.location.href}catch(t){return!1}}function js(){for(var e=window,t=tt();t instanceof e.HTMLIFrameElement;){if(!Ls(t))return t;t=tt((e=t.contentWindow).document)}return t}function Fs(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}function Bs(e){var t=js(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&Ms(n)){null!==r&&Fs(n)&&function(e,t){var n=t.start,r=t.end;void 0===r&&(r=n);"selectionStart"in e?(e.selectionStart=n,e.selectionEnd=Math.min(r,e.value.length)):function(e,t){var n=e.ownerDocument||document,r=n&&n.defaultView||window;if(r.getSelection){var o=r.getSelection(),a=e.textContent.length,i=Math.min(t.start,a),s=void 0===t.end?i:Math.min(t.end,a);if(!o.extend&&i>s){var l=s;s=i,i=l}var u=Is(e,i),c=Is(e,s);if(u&&c){if(1===o.rangeCount&&o.anchorNode===u.node&&o.anchorOffset===u.offset&&o.focusNode===c.node&&o.focusOffset===c.offset)return;var d=n.createRange();d.setStart(u.node,u.offset),o.removeAllRanges(),i>s?(o.addRange(d),o.extend(c.node,c.offset)):(d.setEnd(c.node,c.offset),o.addRange(d))}}}(e,t)}(n,r);for(var o=[],a=n;a=a.parentNode;)1===a.nodeType&&o.push({element:a,left:a.scrollLeft,top:a.scrollTop});"function"==typeof n.focus&&n.focus();for(var i=0;i<o.length;i++){var s=o[i];s.element.scrollLeft=s.left,s.element.scrollTop=s.top}}}function Us(e){return("selectionStart"in e?{start:e.selectionStart,end:e.selectionEnd}:Cs(e))||{start:0,end:0}}var zs=k&&"documentMode"in document&&document.documentMode<=11;var Vs=null,Hs=null,qs=null,Gs=!1;function Ws(e,t,n){var r,o=(r=n).window===r?r.document:9===r.nodeType?r:r.ownerDocument;if(!Gs&&null!=Vs&&Vs===tt(o)){var a=function(e){if("selectionStart"in e&&Fs(e))return{start:e.selectionStart,end:e.selectionEnd};var t=(e.ownerDocument&&e.ownerDocument.defaultView||window).getSelection();return{anchorNode:t.anchorNode,anchorOffset:t.anchorOffset,focusNode:t.focusNode,focusOffset:t.focusOffset}}(Vs);if(!qs||!As(qs,a)){qs=a;var i=wl(Hs,"onSelect");if(i.length>0){var s=new Oi("onSelect","select",null,t,n);e.push({event:s,listeners:i}),s.target=Vs}}}}function Ys(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ks={animationend:Ys("Animation","AnimationEnd"),animationiteration:Ys("Animation","AnimationIteration"),animationstart:Ys("Animation","AnimationStart"),transitionend:Ys("Transition","TransitionEnd")},Xs={},Qs={};function Zs(e){if(Xs[e])return Xs[e];if(!Ks[e])return e;var t=Ks[e];for(var n in t)if(t.hasOwnProperty(n)&&n in Qs)return Xs[e]=t[n];return e}k&&(Qs=document.createElement("div").style,"AnimationEvent"in window||(delete Ks.animationend.animation,delete Ks.animationiteration.animation,delete Ks.animationstart.animation),"TransitionEvent"in window||delete Ks.transitionend.transition);var Js=Zs("animationend"),el=Zs("animationiteration"),tl=Zs("animationstart"),nl=Zs("transitionend"),rl=new Map,ol=["abort","auxClick","cancel","canPlay","canPlayThrough","click","close","contextMenu","copy","cut","drag","dragEnd","dragEnter","dragExit","dragLeave","dragOver","dragStart","drop","durationChange","emptied","encrypted","ended","error","gotPointerCapture","input","invalid","keyDown","keyPress","keyUp","load","loadedData","loadedMetadata","loadStart","lostPointerCapture","mouseDown","mouseMove","mouseOut","mouseOver","mouseUp","paste","pause","play","playing","pointerCancel","pointerDown","pointerMove","pointerOut","pointerOver","pointerUp","progress","rateChange","reset","resize","seeked","seeking","stalled","submit","suspend","timeUpdate","touchCancel","touchEnd","touchStart","volumeChange","scroll","toggle","touchMove","waiting","wheel"];function al(e,t){rl.set(e,t),T(t,[e])}function il(e,t,n,r,o,a,i){var s=rl.get(t);if(void 0!==s){var l=Oi,u=t;switch(t){case"keypress":if(0===vi(r))return;case"keydown":case"keyup":l=Hi;break;case"focusin":u="focus",l=Di;break;case"focusout":u="blur",l=Di;break;case"beforeblur":case"afterblur":l=Di;break;case"click":if(2===r.button)return;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":l=Ii;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":l=Ci;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":l=Gi;break;case Js:case el:case tl:l=Ni;break;case nl:l=Wi;break;case"scroll":l=$i;break;case"wheel":l=Yi;break;case"copy":case"cut":case"paste":l=Mi;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":l=qi}var c=!!(4&a),d=!c&&"scroll"===t,f=function(e,t,n,r,o){var a=null!==t?t+"Capture":null,i=r?a:t,s=[],l=e,u=null;for(;null!==l;){var c=l,d=c.stateNode;if(5===c.tag&&null!==d&&(u=d,null!==i)){var f=Bn(l,i);null!=f&&s.push(vl(l,f,u))}if(o)break;l=l.return}return s}(n,s,r.type,c,d);if(f.length>0){var p=new l(s,u,null,r,o);e.push({event:p,listeners:f})}}}function sl(e,t,n,r,o,a,i){il(e,t,n,r,o,a),!(7&a)&&(Ps(e,t,n,r,o),ks(e,t,n,r,o),function(e,t,n,r,o){var a=n?Xu(n):window;switch(t){case"focusin":(fs(a)||"true"===a.contentEditable)&&(Vs=a,Hs=n,qs=null);break;case"focusout":Vs=null,Hs=null,qs=null;break;case"mousedown":Gs=!0;break;case"contextmenu":case"mouseup":case"dragend":Gs=!1,Ws(e,r,o);break;case"selectionchange":if(zs)break;case"keydown":case"keyup":Ws(e,r,o)}}(e,t,n,r,o),function(e,t,n,r,o){ls(e,t,n,r,o),cs(e,t,n,r,o)}(e,t,n,r,o))}!function(){for(var e=0;e<ol.length;e++){var t=ol[e];al(t.toLowerCase(),"on"+(t[0].toUpperCase()+t.slice(1)))}al(Js,"onAnimationEnd"),al(el,"onAnimationIteration"),al(tl,"onAnimationStart"),al("dblclick","onDoubleClick"),al("focusin","onFocus"),al("focusout","onBlur"),al(nl,"onTransitionEnd")}(),E("onMouseEnter",["mouseout","mouseover"]),E("onMouseLeave",["mouseout","mouseover"]),E("onPointerEnter",["pointerout","pointerover"]),E("onPointerLeave",["pointerout","pointerover"]),T("onChange",["change","click","focusin","focusout","input","keydown","keyup","selectionchange"]),T("onSelect",["focusout","contextmenu","dragend","focusin","keydown","keyup","mousedown","mouseup","selectionchange"]),T("onBeforeInput",["compositionend","keypress","textInput","paste"]),T("onCompositionEnd",["compositionend","focusout","keydown","keypress","keyup","mousedown"]),T("onCompositionStart",["compositionstart","focusout","keydown","keypress","keyup","mousedown"]),T("onCompositionUpdate",["compositionupdate","focusout","keydown","keypress","keyup","mousedown"]);var ll=["abort","canplay","canplaythrough","durationchange","emptied","encrypted","ended","error","loadeddata","loadedmetadata","loadstart","pause","play","playing","progress","ratechange","resize","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting"],ul=new Set(["cancel","close","invalid","load","scroll","toggle"].concat(ll));function cl(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,function(e,t,n,r,o,a,i,s,l){if(Zn.apply(this,arguments),Wn){var u=Jn();Kn||(Kn=!0,Xn=u)}}(r,t,void 0,e),e.currentTarget=null}function dl(e,t,n){var r;if(n)for(var o=t.length-1;o>=0;o--){var a=t[o],i=a.instance,s=a.currentTarget,l=a.listener;if(i!==r&&e.isPropagationStopped())return;cl(e,l,s),r=i}else for(var u=0;u<t.length;u++){var c=t[u],d=c.instance,f=c.currentTarget,p=c.listener;if(d!==r&&e.isPropagationStopped())return;cl(e,p,f),r=d}}function fl(e,t){for(var n=!!(4&t),r=0;r<e.length;r++){var o=e[r];dl(o.event,o.listeners,n)}!function(){if(Kn){var e=Xn;throw Kn=!1,Xn=null,e}}()}function pl(e,t){ul.has(e)||a('Did not expect a listenToNonDelegatedEvent() call for "%s". This is a bug in React. Please file an issue.',e);var n=function(e){var t=e[Uu];void 0===t&&(t=e[Uu]=new Set);return t}(t),r=function(e){return e+"__bubble"}(e);n.has(r)||(bl(t,e,2,!1),n.add(r))}function hl(e,t,n){ul.has(e)&&!t&&a('Did not expect a listenToNativeEvent() call for "%s" in the bubble phase. This is a bug in React. Please file an issue.',e);var r=0;t&&(r|=4),bl(n,e,r,t)}var ml="_reactListening"+Math.random().toString(36).slice(2);function gl(e){if(!e[ml]){e[ml]=!0,w.forEach(function(t){"selectionchange"!==t&&(ul.has(t)||hl(t,!1,e),hl(t,!0,e))});var t=9===e.nodeType?e:e.ownerDocument;null!==t&&(t[ml]||(t[ml]=!0,hl("selectionchange",!1,t)))}}function bl(e,t,n,r,o){var a=function(e,t,n){var r;switch(hi(t)){case Ia:r=ui;break;case Ca:r=ci;break;default:r=di}return r.bind(null,t,n,e)}(e,t,n),i=void 0;Un&&("touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(i=!0)),r?void 0!==i?function(e,t,n,r){e.addEventListener(t,n,{capture:!0,passive:r})}(e,t,a,i):function(e,t,n){e.addEventListener(t,n,!0)}(e,t,a):void 0!==i?function(e,t,n,r){e.addEventListener(t,n,{passive:r})}(e,t,a,i):function(e,t,n){e.addEventListener(t,n,!1)}(e,t,a)}function yl(e,t){return e===t||8===e.nodeType&&e.parentNode===t}function _l(e,t,n,r,o){var a=r;if(!(1&t||2&t)){var i=o;if(null!==r){var s=r;e:for(;;){if(null===s)return;var l=s.tag;if(3===l||4===l){var u=s.stateNode.containerInfo;if(yl(u,i))break;if(4===l)for(var c=s.return;null!==c;){var d=c.tag;if(3===d||4===d)if(yl(c.stateNode.containerInfo,i))return;c=c.return}for(;null!==u;){var f=Yu(u);if(null===f)return;var p=f.tag;if(5===p||6===p){s=a=f;continue e}u=u.parentNode}}s=s.return}}}Fn(function(){return function(e,t,n,r){var o=[];sl(o,e,r,n,On(n),t),fl(o,t)}(e,t,n,a)})}function vl(e,t,n){return{instance:e,listener:t,currentTarget:n}}function wl(e,t){for(var n=t+"Capture",r=[],o=e;null!==o;){var a=o,i=a.stateNode;if(5===a.tag&&null!==i){var s=i,l=Bn(o,n);null!=l&&r.unshift(vl(o,l,s));var u=Bn(o,t);null!=u&&r.push(vl(o,u,s))}o=o.return}return r}function Sl(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag);return e||null}function xl(e,t,n,r,o){for(var a=t._reactName,i=[],s=n;null!==s&&s!==r;){var l=s,u=l.alternate,c=l.stateNode,d=l.tag;if(null!==u&&u===r)break;if(5===d&&null!==c){var f=c;if(o){var p=Bn(s,a);null!=p&&i.unshift(vl(s,p,f))}else if(!o){var h=Bn(s,a);null!=h&&i.push(vl(s,h,f))}}s=s.return}0!==i.length&&e.push({event:t,listeners:i})}var Tl,El,kl,Pl,Ol,Al,$l,Rl=!1,Il="dangerouslySetInnerHTML",Cl="suppressContentEditableWarning",Dl="suppressHydrationWarning",Nl="autoFocus",Ml="children",Ll="style",jl="__html";Tl={dialog:!0,webview:!0},El=function(e,t){gn(e,t),function(e,t){"input"!==e&&"textarea"!==e&&"select"!==e||null==t||null!==t.value||bn||(bn=!0,"select"===e&&t.multiple?a("`value` prop on `%s` should not be null. Consider using an empty array when `multiple` is set to `true` to clear the component or `undefined` for uncontrolled components.",e):a("`value` prop on `%s` should not be null. Consider using an empty string to clear the component or `undefined` for uncontrolled components.",e))}(e,t),Tn(e,t,{registrationNameDependencies:S,possibleRegistrationNames:x})},Al=k&&!document.documentMode,kl=function(e,t,n){if(!Rl){var r=Ul(n),o=Ul(t);o!==r&&(Rl=!0,a("Prop `%s` did not match. Server: %s Client: %s",e,JSON.stringify(o),JSON.stringify(r)))}},Pl=function(e){if(!Rl){Rl=!0;var t=[];e.forEach(function(e){t.push(e)}),a("Extra attributes from the server: %s",t)}},Ol=function(e,t){!1===t?a("Expected `%s` listener to be a function, instead got `false`.\n\nIf you used to conditionally omit it with %s={condition && value}, pass %s={condition ? value : undefined} instead.",e,e,e):a("Expected `%s` listener to be a function, instead got a value of `%s` type.",e,typeof t)},$l=function(e,t){var n=e.namespaceURI===Rt?e.ownerDocument.createElement(e.tagName):e.ownerDocument.createElementNS(e.namespaceURI,e.tagName);return n.innerHTML=t,n.innerHTML};var Fl=/\r\n?/g,Bl=/\u0000|\uFFFD/g;function Ul(e){return function(e){if(A(e))a("The provided HTML markup uses a value of unsupported type %s. This value must be coerced to a string before before using it here.",O(e)),$(e)}(e),("string"==typeof e?e:""+e).replace(Fl,"\n").replace(Bl,"")}function zl(e,t,n,r){var o=Ul(t),i=Ul(e);if(i!==o&&(r&&(Rl||(Rl=!0,a('Text content did not match. Server: "%s" Client: "%s"',i,o))),n))throw new Error("Text content does not match server-rendered HTML.")}function Vl(e){return 9===e.nodeType?e:e.ownerDocument}function Hl(){}function ql(e){e.onclick=Hl}function Gl(e,t,n,r){var o,a=un(t,n);switch(El(t,n),t){case"dialog":pl("cancel",e),pl("close",e),o=n;break;case"iframe":case"object":case"embed":pl("load",e),o=n;break;case"video":case"audio":for(var i=0;i<ll.length;i++)pl(ll[i],e);o=n;break;case"source":pl("error",e),o=n;break;case"img":case"image":case"link":pl("error",e),pl("load",e),o=n;break;case"details":pl("toggle",e),o=n;break;case"input":lt(e,n),o=st(e,n),pl("invalid",e);break;case"option":bt(0,n),o=n;break;case"select":Et(e,n),o=Tt(0,n),pl("invalid",e);break;case"textarea":Ot(e,n),o=Pt(e,n),pl("invalid",e);break;default:o=n}switch(ln(t,o),function(e,t,n,r,o){for(var a in r)if(r.hasOwnProperty(a)){var i=r[a];if(a===Ll)i&&Object.freeze(i),rn(t,i);else if(a===Il){var s=i?i[jl]:void 0;null!=s&&Lt(t,s)}else a===Ml?"string"==typeof i?("textarea"!==e||""!==i)&&jt(t,i):"number"==typeof i&&jt(t,""+i):a===Cl||a===Dl||a===Nl||(S.hasOwnProperty(a)?null!=i&&("function"!=typeof i&&Ol(a,i),"onScroll"===a&&pl("scroll",t)):null!=i&&Z(t,a,i,o))}}(t,e,0,o,a),t){case"input":Je(e),dt(e,n,!1);break;case"textarea":Je(e),$t(e);break;case"option":!function(e,t){null!=t.value&&e.setAttribute("value",We(Ye(t.value)))}(e,n);break;case"select":!function(e,t){var n=e;n.multiple=!!t.multiple;var r=t.value;null!=r?xt(n,!!t.multiple,r,!1):null!=t.defaultValue&&xt(n,!!t.multiple,t.defaultValue,!0)}(e,n);break;default:"function"==typeof o.onClick&&ql(e)}}function Wl(e,t,n,r,o){El(t,r);var i,s,l,u,c=null;switch(t){case"input":i=st(e,n),s=st(e,r),c=[];break;case"select":i=Tt(0,n),s=Tt(0,r),c=[];break;case"textarea":i=Pt(e,n),s=Pt(e,r),c=[];break;default:s=r,"function"!=typeof(i=n).onClick&&"function"==typeof s.onClick&&ql(e)}ln(t,s);var d=null;for(l in i)if(!s.hasOwnProperty(l)&&i.hasOwnProperty(l)&&null!=i[l])if(l===Ll){var f=i[l];for(u in f)f.hasOwnProperty(u)&&(d||(d={}),d[u]="")}else l===Il||l===Ml||l===Cl||l===Dl||l===Nl||(S.hasOwnProperty(l)?c||(c=[]):(c=c||[]).push(l,null));for(l in s){var p=s[l],h=null!=i?i[l]:void 0;if(s.hasOwnProperty(l)&&p!==h&&(null!=p||null!=h))if(l===Ll)if(p&&Object.freeze(p),h){for(u in h)!h.hasOwnProperty(u)||p&&p.hasOwnProperty(u)||(d||(d={}),d[u]="");for(u in p)p.hasOwnProperty(u)&&h[u]!==p[u]&&(d||(d={}),d[u]=p[u])}else d||(c||(c=[]),c.push(l,d)),d=p;else if(l===Il){var m=p?p[jl]:void 0,g=h?h[jl]:void 0;null!=m&&g!==m&&(c=c||[]).push(l,m)}else l===Ml?"string"!=typeof p&&"number"!=typeof p||(c=c||[]).push(l,""+p):l===Cl||l===Dl||(S.hasOwnProperty(l)?(null!=p&&("function"!=typeof p&&Ol(l,p),"onScroll"===l&&pl("scroll",e)),c||h===p||(c=[])):(c=c||[]).push(l,p))}return d&&(!function(e,t){if(t){var n=an(e),r=an(t),o={};for(var i in n){var s=n[i],l=r[i];if(l&&s!==l){var u=s+","+l;if(o[u])continue;o[u]=!0,a("%s a style property during rerender (%s) when a conflicting property is set (%s) can lead to styling bugs. To avoid this, don't mix shorthand and non-shorthand properties for the same value; instead, replace the shorthand with separate values.",on(e[s])?"Removing":"Updating",s,l)}}}}(d,s[Ll]),(c=c||[]).push(Ll,d)),c}function Yl(e,t,n,r,o){"input"===n&&"radio"===o.type&&null!=o.name&&ut(e,o);un(n,r);switch(function(e,t,n,r){for(var o=0;o<t.length;o+=2){var a=t[o],i=t[o+1];a===Ll?rn(e,i):a===Il?Lt(e,i):a===Ml?jt(e,i):Z(e,a,i,r)}}(e,t,0,un(n,o)),n){case"input":ct(e,o);break;case"textarea":At(e,o);break;case"select":!function(e,t){var n=e,r=n._wrapperState.wasMultiple;n._wrapperState.wasMultiple=!!t.multiple;var o=t.value;null!=o?xt(n,!!t.multiple,o,!1):r!==!!t.multiple&&(null!=t.defaultValue?xt(n,!!t.multiple,t.defaultValue,!0):xt(n,!!t.multiple,t.multiple?[]:"",!1))}(e,o)}}function Kl(e){var t=e.toLowerCase();return cn.hasOwnProperty(t)&&cn[t]||null}function Xl(e,t){Rl||(Rl=!0,a("Did not expect server HTML to contain a <%s> in <%s>.",t.nodeName.toLowerCase(),e.nodeName.toLowerCase()))}function Ql(e,t){Rl||(Rl=!0,a('Did not expect server HTML to contain the text node "%s" in <%s>.',t.nodeValue,e.nodeName.toLowerCase()))}function Zl(e,t,n){Rl||(Rl=!0,a("Expected server HTML to contain a matching <%s> in <%s>.",t,e.nodeName.toLowerCase()))}function Jl(e,t){""!==t&&(Rl||(Rl=!0,a('Expected server HTML to contain a matching text node for "%s" in <%s>.',t,e.nodeName.toLowerCase())))}var eu,tu,nu=["address","applet","area","article","aside","base","basefont","bgsound","blockquote","body","br","button","caption","center","col","colgroup","dd","details","dir","div","dl","dt","embed","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","iframe","img","input","isindex","li","link","listing","main","marquee","menu","menuitem","meta","nav","noembed","noframes","noscript","object","ol","p","param","plaintext","pre","script","section","select","source","style","summary","table","tbody","td","template","textarea","tfoot","th","thead","title","tr","track","ul","wbr","xmp"],ru=["applet","caption","html","table","td","th","marquee","object","template","foreignObject","desc","title"],ou=ru.concat(["button"]),au=["dd","dt","li","option","optgroup","p","rp","rt"],iu={current:null,formTag:null,aTagInScope:null,buttonTagInScope:null,nobrTagInScope:null,pTagInButtonScope:null,listItemTagAutoclosing:null,dlItemTagAutoclosing:null};tu=function(e,t){var n=we({},e||iu),r={tag:t};return-1!==ru.indexOf(t)&&(n.aTagInScope=null,n.buttonTagInScope=null,n.nobrTagInScope=null),-1!==ou.indexOf(t)&&(n.pTagInButtonScope=null),-1!==nu.indexOf(t)&&"address"!==t&&"div"!==t&&"p"!==t&&(n.listItemTagAutoclosing=null,n.dlItemTagAutoclosing=null),n.current=r,"form"===t&&(n.formTag=r),"a"===t&&(n.aTagInScope=r),"button"===t&&(n.buttonTagInScope=r),"nobr"===t&&(n.nobrTagInScope=r),"p"===t&&(n.pTagInButtonScope=r),"li"===t&&(n.listItemTagAutoclosing=r),"dd"!==t&&"dt"!==t||(n.dlItemTagAutoclosing=r),n};var su={};eu=function(e,t,n){var r=(n=n||iu).current,o=r&&r.tag;null!=t&&(null!=e&&a("validateDOMNesting: when childText is passed, childTag should be null"),e="#text");var i=function(e,t){switch(t){case"select":return"option"===e||"optgroup"===e||"#text"===e;case"optgroup":return"option"===e||"#text"===e;case"option":return"#text"===e;case"tr":return"th"===e||"td"===e||"style"===e||"script"===e||"template"===e;case"tbody":case"thead":case"tfoot":return"tr"===e||"style"===e||"script"===e||"template"===e;case"colgroup":return"col"===e||"template"===e;case"table":return"caption"===e||"colgroup"===e||"tbody"===e||"tfoot"===e||"thead"===e||"style"===e||"script"===e||"template"===e;case"head":return"base"===e||"basefont"===e||"bgsound"===e||"link"===e||"meta"===e||"title"===e||"noscript"===e||"noframes"===e||"style"===e||"script"===e||"template"===e;case"html":return"head"===e||"body"===e||"frameset"===e;case"frameset":return"frame"===e;case"#document":return"html"===e}switch(e){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":return"h1"!==t&&"h2"!==t&&"h3"!==t&&"h4"!==t&&"h5"!==t&&"h6"!==t;case"rp":case"rt":return-1===au.indexOf(t);case"body":case"caption":case"col":case"colgroup":case"frameset":case"frame":case"head":case"html":case"tbody":case"td":case"tfoot":case"th":case"thead":case"tr":return null==t}return!0}(e,o)?null:r,s=i?null:function(e,t){switch(e){case"address":case"article":case"aside":case"blockquote":case"center":case"details":case"dialog":case"dir":case"div":case"dl":case"fieldset":case"figcaption":case"figure":case"footer":case"header":case"hgroup":case"main":case"menu":case"nav":case"ol":case"p":case"section":case"summary":case"ul":case"pre":case"listing":case"table":case"hr":case"xmp":case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":return t.pTagInButtonScope;case"form":return t.formTag||t.pTagInButtonScope;case"li":return t.listItemTagAutoclosing;case"dd":case"dt":return t.dlItemTagAutoclosing;case"button":return t.buttonTagInScope;case"a":return t.aTagInScope;case"nobr":return t.nobrTagInScope}return null}(e,n),l=i||s;if(l){var u=l.tag,c=!!i+"|"+e+"|"+u;if(!su[c]){su[c]=!0;var d=e,f="";if("#text"===e?/\S/.test(t)?d="Text nodes":(d="Whitespace text nodes",f=" Make sure you don't have any extra whitespace between tags on each line of your source code."):d="<"+e+">",i){var p="";"table"===u&&"tr"===e&&(p+=" Add a <tbody>, <thead> or <tfoot> to your code to match the DOM tree generated by the browser."),a("validateDOMNesting(...): %s cannot appear as a child of <%s>.%s%s",d,u,f,p)}else a("validateDOMNesting(...): %s cannot appear as a descendant of <%s>.",d,u)}}};var lu="suppressHydrationWarning",uu="$",cu="/$",du="$?",fu="$!",pu=null,hu=null;function mu(e){var t;pu=si,t=js(),hu={focusedElem:t,selectionRange:Fs(t)?Us(t):null};return li(!1),null}function gu(e,t,n,r,o){var i=r;if(eu(e,null,i.ancestorInfo),"string"==typeof t.children||"number"==typeof t.children){var s=""+t.children,l=tu(i.ancestorInfo,e);eu(null,s,l)}var u=function(e,t,n,r){var o,i,s=Vl(n),l=r;if(l===Rt&&(l=Ct(e)),l===Rt){if((o=un(e,t))||e===e.toLowerCase()||a("<%s /> is using incorrect casing. Use PascalCase for React components, or lowercase for HTML elements.",e),"script"===e){var u=s.createElement("div");u.innerHTML="<script><\/script>";var c=u.firstChild;i=u.removeChild(c)}else if("string"==typeof t.is)i=s.createElement(e,{is:t.is});else if(i=s.createElement(e),"select"===e){var d=i;t.multiple?d.multiple=!0:t.size&&(d.size=t.size)}}else i=s.createElementNS(l,e);return l===Rt&&(o||"[object HTMLUnknownElement]"!==Object.prototype.toString.call(i)||P.call(Tl,e)||(Tl[e]=!0,a("The tag <%s> is unrecognized in this browser. If you meant to render a React component, start its name with an uppercase letter.",e))),i}(e,t,n,i.namespace);return Hu(o,u),Zu(u,t),u}function bu(e,t){e.appendChild(t)}function yu(e,t){return"textarea"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}function _u(e,t,n,r){eu(null,e,n.ancestorInfo);var o=function(e,t){return Vl(t).createTextNode(e)}(e,t);return Hu(r,o),o}var vu="function"==typeof setTimeout?setTimeout:void 0,wu="function"==typeof clearTimeout?clearTimeout:void 0,Su="function"==typeof Promise?Promise:void 0,xu="function"==typeof queueMicrotask?queueMicrotask:void 0!==Su?function(e){return Su.resolve(null).then(e).catch(Tu)}:vu;function Tu(e){setTimeout(function(){throw e})}function Eu(e){jt(e,"")}function ku(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&8===o.nodeType){var a=o.data;if(a===cu){if(0===r)return e.removeChild(o),void ai(t);r--}else a!==uu&&a!==du&&a!==fu||r++}n=o}while(n);ai(t)}function Pu(e){var t=e.style;"function"==typeof t.setProperty?t.setProperty("display","none","important"):t.display="none"}function Ou(e){e.nodeValue=""}function Au(e,t){var n=t.style,r=null!=n&&n.hasOwnProperty("display")?n.display:null;e.style.display=zt("display",r)}function $u(e,t){e.nodeValue=t}function Ru(e){return e.data===du}function Iu(e){return e.data===fu}function Cu(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){var n=e.data;if(n===uu||n===fu||n===du)break;if(n===cu)return null}}return e}function Du(e){return Cu(e.nextSibling)}function Nu(e,t,n,r,o,a,i){return Hu(a,e),Zu(e,n),function(e,t,n,r,o,a,i){var s,l;switch(s=un(t,n),El(t,n),t){case"dialog":pl("cancel",e),pl("close",e);break;case"iframe":case"object":case"embed":pl("load",e);break;case"video":case"audio":for(var u=0;u<ll.length;u++)pl(ll[u],e);break;case"source":pl("error",e);break;case"img":case"image":case"link":pl("error",e),pl("load",e);break;case"details":pl("toggle",e);break;case"input":lt(e,n),pl("invalid",e);break;case"option":bt(0,n);break;case"select":Et(e,n),pl("invalid",e);break;case"textarea":Ot(e,n),pl("invalid",e)}ln(t,n),l=new Set;for(var c=e.attributes,d=0;d<c.length;d++)switch(c[d].name.toLowerCase()){case"value":case"checked":case"selected":break;default:l.add(c[d].name)}var f=null;for(var p in n)if(n.hasOwnProperty(p)){var h=n[p];if(p===Ml)"string"==typeof h?e.textContent!==h&&(!0!==n[Dl]&&zl(e.textContent,h,a,i),f=[Ml,h]):"number"==typeof h&&e.textContent!==""+h&&(!0!==n[Dl]&&zl(e.textContent,h,a,i),f=[Ml,""+h]);else if(S.hasOwnProperty(p))null!=h&&("function"!=typeof h&&Ol(p,h),"onScroll"===p&&pl("scroll",e));else if(i&&"boolean"==typeof s){var m=void 0,g=z(p);if(!0===n[Dl]);else if(p===Cl||p===Dl||"value"===p||"checked"===p||"selected"===p);else if(p===Il){var b=e.innerHTML,y=h?h[jl]:void 0;if(null!=y){var _=$l(e,y);_!==b&&kl(p,b,_)}}else if(p===Ll){if(l.delete(p),Al){var v=nn(h);v!==(m=e.getAttribute("style"))&&kl(p,m,v)}}else if(s)l.delete(p.toLowerCase()),h!==(m=Q(e,p,h))&&kl(p,m,h);else if(!F(p,g,s)&&!U(p,h,g,s)){var w=!1;if(null!==g)l.delete(g.attributeName),m=X(e,p,h,g);else{var x=r;if(x===Rt&&(x=Ct(t)),x===Rt)l.delete(p.toLowerCase());else{var T=Kl(p);null!==T&&T!==p&&(w=!0,l.delete(T)),l.delete(p)}m=Q(e,p,h)}h===m||w||kl(p,m,h)}}}switch(i&&l.size>0&&!0!==n[Dl]&&Pl(l),t){case"input":Je(e),dt(e,n,!0);break;case"textarea":Je(e),$t(e);break;case"select":case"option":break;default:"function"==typeof n.onClick&&ql(e)}return f}(e,t,n,o.namespace,0,!!(1&a.mode),i)}function Mu(e){for(var t=e.previousSibling,n=0;t;){if(8===t.nodeType){var r=t.data;if(r===uu||r===fu||r===du){if(0===n)return t;n--}else r===cu&&n++}t=t.previousSibling}return null}var Lu=Math.random().toString(36).slice(2),ju="__reactFiber$"+Lu,Fu="__reactProps$"+Lu,Bu="__reactContainer$"+Lu,Uu="__reactEvents$"+Lu,zu="__reactListeners$"+Lu,Vu="__reactHandles$"+Lu;function Hu(e,t){t[ju]=e}function qu(e,t){t[Bu]=e}function Gu(e){e[Bu]=null}function Wu(e){return!!e[Bu]}function Yu(e){var t=e[ju];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Bu]||n[ju]){var r=t.alternate;if(null!==t.child||null!==r&&null!==r.child)for(var o=Mu(e);null!==o;){var a=o[ju];if(a)return a;o=Mu(o)}return t}n=(e=n).parentNode}return null}function Ku(e){var t=e[ju]||e[Bu];return t&&(5===t.tag||6===t.tag||t.tag===c||3===t.tag)?t:null}function Xu(e){if(5===e.tag||6===e.tag)return e.stateNode;throw new Error("getNodeFromInstance: Invalid argument.")}function Qu(e){return e[Fu]||null}function Zu(e,t){e[Fu]=t}var Ju={},ec=n.ReactDebugCurrentFrame;function tc(e){if(e){var t=e._owner,n=Ie(e.type,e._source,t?t.type:null);ec.setExtraStackFrame(n)}else ec.setExtraStackFrame(null)}function nc(e,t,n,r,o){var i=Function.call.bind(P);for(var s in e)if(i(e,s)){var l=void 0;try{if("function"!=typeof e[s]){var u=Error((r||"React class")+": "+n+" type `"+s+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[s]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw u.name="Invariant Violation",u}l=e[s](t,s,r,n,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(c){l=c}!l||l instanceof Error||(tc(o),a("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",r||"React class",n,s,typeof l),tc(null)),l instanceof Error&&!(l.message in Ju)&&(Ju[l.message]=!0,tc(o),a("Failed %s type: %s",n,l.message),tc(null))}}var rc,oc=[];rc=[];var ac,ic=-1;function sc(e){return{current:e}}function lc(e,t){ic<0?a("Unexpected pop."):(t!==rc[ic]&&a("Unexpected Fiber popped."),e.current=oc[ic],oc[ic]=null,rc[ic]=null,ic--)}function uc(e,t,n){ic++,oc[ic]=e.current,rc[ic]=n,e.current=t}ac={};var cc={};Object.freeze(cc);var dc=sc(cc),fc=sc(!1),pc=cc;function hc(e,t,n){return n&&yc(t)?pc:dc.current}function mc(e,t,n){var r=e.stateNode;r.__reactInternalMemoizedUnmaskedChildContext=t,r.__reactInternalMemoizedMaskedChildContext=n}function gc(e,t){var n=e.type.contextTypes;if(!n)return cc;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={};for(var a in n)o[a]=t[a];return nc(n,o,"context",je(e)||"Unknown"),r&&mc(e,t,o),o}function bc(){return fc.current}function yc(e){var t=e.childContextTypes;return null!=t}function _c(e){lc(fc,e),lc(dc,e)}function vc(e){lc(fc,e),lc(dc,e)}function wc(e,t,n){if(dc.current!==cc)throw new Error("Unexpected context found on stack. This error is likely caused by a bug in React. Please file an issue.");uc(dc,t,e),uc(fc,n,e)}function Sc(e,t,n){var r=e.stateNode,o=t.childContextTypes;if("function"!=typeof r.getChildContext){var i=je(e)||"Unknown";return ac[i]||(ac[i]=!0,a("%s.childContextTypes is specified but there is no getChildContext() method on the instance. You can either define getChildContext() on %s or remove childContextTypes from it.",i,i)),n}var s=r.getChildContext();for(var l in s)if(!(l in o))throw new Error((je(e)||"Unknown")+'.getChildContext(): key "'+l+'" is not defined in childContextTypes.');return nc(o,s,"child context",je(e)||"Unknown"),we({},n,s)}function xc(e){var t=e.stateNode,n=t&&t.__reactInternalMemoizedMergedChildContext||cc;return pc=dc.current,uc(dc,n,e),uc(fc,fc.current,e),!0}function Tc(e,t,n){var r=e.stateNode;if(!r)throw new Error("Expected to have an instance by this point. This error is likely caused by a bug in React. Please file an issue.");if(n){var o=Sc(e,t,pc);r.__reactInternalMemoizedMergedChildContext=o,lc(fc,e),lc(dc,e),uc(dc,o,e),uc(fc,n,e)}else lc(fc,e),uc(fc,n,e)}function Ec(e){if(!function(e){return Tr(e)===e}(e)||1!==e.tag)throw new Error("Expected subtree parent to be a mounted class component. This error is likely caused by a bug in React. Please file an issue.");var t=e;do{switch(t.tag){case 3:return t.stateNode.context;case 1:if(yc(t.type))return t.stateNode.__reactInternalMemoizedMergedChildContext}t=t.return}while(null!==t);throw new Error("Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue.")}var kc=null,Pc=!1,Oc=!1;function Ac(e){null===kc?kc=[e]:kc.push(e)}function $c(){Pc&&Rc()}function Rc(){if(!Oc&&null!==kc){Oc=!0;var e=0,t=La();try{var n=kc;for(ja(Ia);e<n.length;e++){var r=n[e];do{r=r(true)}while(null!==r)}kc=null,Pc=!1}catch(o){throw null!==kc&&(kc=kc.slice(e+1)),Cr(Fr,Rc),o}finally{ja(t),Oc=!1}}return null}var Ic=[],Cc=0,Dc=null,Nc=0,Mc=[],Lc=0,jc=null,Fc=1,Bc="";function Uc(){var e=Bc;return(Fc&~function(e){return 1<<qc(e)-1}(Fc)).toString(32)+e}function zc(e,t){Wc(),Ic[Cc++]=Nc,Ic[Cc++]=Dc,Dc=e,Nc=t}function Vc(e,t,n){Wc(),Mc[Lc++]=Fc,Mc[Lc++]=Bc,Mc[Lc++]=jc,jc=e;var r=Fc,o=Bc,a=qc(r)-1,i=r&~(1<<a),s=n+1,l=qc(t)+a;if(l>30){var u=a-a%5,c=(i&(1<<u)-1).toString(32),d=i>>u,f=a-u,p=qc(t)+f;Fc=1<<p|(s<<f|d),Bc=c+o}else{Fc=1<<l|(s<<a|i),Bc=o}}function Hc(e){if(Wc(),null!==e.return){zc(e,1),Vc(e,1,0)}}function qc(e){return 32-yo(e)}function Gc(e){for(;e===Dc;)Dc=Ic[--Cc],Ic[Cc]=null,Nc=Ic[--Cc],Ic[Cc]=null;for(;e===jc;)jc=Mc[--Lc],Mc[Lc]=null,Bc=Mc[--Lc],Mc[Lc]=null,Fc=Mc[--Lc],Mc[Lc]=null}function Wc(){yd()||a("Expected to be hydrating. This is a bug in React. Please file an issue.")}var Yc=null,Kc=null,Xc=!1,Qc=!1,Zc=null;function Jc(){Qc=!0}function ed(e){var t=e.stateNode.containerInfo;return Kc=Cu(t.firstChild),Yc=e,Xc=!0,Zc=null,Qc=!1,!0}function td(e,t,n){var r,o;return Kc=Cu(t.nextSibling),Yc=e,Xc=!0,Zc=null,Qc=!1,null!==n&&(r=e,o=n,Wc(),Mc[Lc++]=Fc,Mc[Lc++]=Bc,Mc[Lc++]=jc,Fc=o.id,Bc=o.overflow,jc=r),!0}function nd(e,t){switch(e.tag){case 3:!function(e,t){1===t.nodeType?Xl(e,t):8===t.nodeType||Ql(e,t)}(e.stateNode.containerInfo,t);break;case 5:var n=!!(1&e.mode);!function(e,t,n,r,o){(o||!0!==t[lu])&&(1===r.nodeType?Xl(n,r):8===r.nodeType||Ql(n,r))}(e.type,e.memoizedProps,e.stateNode,t,n);break;case c:var r=e.memoizedState;null!==r.dehydrated&&function(e,t){var n=e.parentNode;null!==n&&(1===t.nodeType?Xl(n,t):8===t.nodeType||Ql(n,t))}(r.dehydrated,t)}}function rd(e,t){nd(e,t);var n,r=((n=W_(5,null,null,0)).elementType="DELETED",n);r.stateNode=t,r.return=e;var o=e.deletions;null===o?(e.deletions=[r],e.flags|=tr):o.push(r)}function od(e,t){if(!Qc)switch(e.tag){case 3:var n=e.stateNode.containerInfo;switch(t.tag){case 5:var r=t.type;t.pendingProps,function(e,t){Zl(e,t)}(n,r);break;case 6:!function(e,t){Jl(e,t)}(n,t.pendingProps)}break;case 5:e.type;var o=e.memoizedProps,a=e.stateNode;switch(t.tag){case 5:var i=t.type;t.pendingProps;!function(e,t,n,r,o,a){(a||!0!==t[lu])&&Zl(n,r)}(0,o,a,i,0,!!(1&e.mode));break;case 6:!function(e,t,n,r,o){(o||!0!==t[lu])&&Jl(n,r)}(0,o,a,t.pendingProps,!!(1&e.mode))}break;case c:var s=e.memoizedState.dehydrated;if(null!==s)switch(t.tag){case 5:var l=t.type;t.pendingProps,function(e,t){var n=e.parentNode;null!==n&&Zl(n,t)}(s,l);break;case 6:!function(e,t){var n=e.parentNode;null!==n&&Jl(n,t)}(s,t.pendingProps)}break;default:return}}function ad(e,t){t.flags=-4097&t.flags|2,od(e,t)}function id(e,t){switch(e.tag){case 5:var n=e.type;e.pendingProps;var r=function(e,t){return 1!==e.nodeType||t.toLowerCase()!==e.nodeName.toLowerCase()?null:e}(t,n);return null!==r&&(e.stateNode=r,Yc=e,Kc=Cu(r.firstChild),!0);case 6:var o=function(e,t){return""===t||3!==e.nodeType?null:e}(t,e.pendingProps);return null!==o&&(e.stateNode=o,Yc=e,Kc=null,!0);case c:var a=function(e){return 8!==e.nodeType?null:e}(t);if(null!==a){var i={dehydrated:a,treeContext:(Wc(),null!==jc?{id:Fc,overflow:Bc}:null),retryLane:Zo};e.memoizedState=i;var s=function(e){var t=W_(h,null,null,0);return t.stateNode=e,t}(a);return s.return=e,e.child=s,Yc=e,Kc=null,!0}return!1;default:return!1}}function sd(e){return!!(1&e.mode)&&0===(e.flags&nr)}function ld(e){throw new Error("Hydration failed because the initial UI does not match what was rendered on the server.")}function ud(e){if(Xc){var t=Kc;if(!t)return sd(e)&&(od(Yc,e),ld()),ad(Yc,e),Xc=!1,void(Yc=e);var n=t;if(!id(e,t)){sd(e)&&(od(Yc,e),ld()),t=Du(n);var r=Yc;if(!t||!id(e,t))return ad(Yc,e),Xc=!1,void(Yc=e);rd(r,n)}}}function cd(e){var t=e.stateNode,n=e.memoizedProps,r=function(e,t,n){return Hu(n,e),n.mode,function(e,t){return e.nodeValue!==t}(e,t)}(t,n,e);if(r){var o=Yc;if(null!==o)switch(o.tag){case 3:o.stateNode.containerInfo;!function(e,t,n,r){zl(t.nodeValue,n,r,!0)}(0,t,n,!!(1&o.mode));break;case 5:o.type;var a=o.memoizedProps;o.stateNode;!function(e,t,n,r,o,a){!0!==t[lu]&&zl(r.nodeValue,o,a,!0)}(0,a,0,t,n,!!(1&o.mode))}}return r}function dd(e){var t=e.memoizedState,n=null!==t?t.dehydrated:null;if(!n)throw new Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");!function(e,t){Hu(t,e)}(n,e)}function fd(e){var t=e.memoizedState,n=null!==t?t.dehydrated:null;if(!n)throw new Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");return function(e){for(var t=e.nextSibling,n=0;t;){if(8===t.nodeType){var r=t.data;if(r===cu){if(0===n)return Du(t);n--}else r!==uu&&r!==fu&&r!==du||n++}t=t.nextSibling}return null}(n)}function pd(e){for(var t=e.return;null!==t&&5!==t.tag&&3!==t.tag&&t.tag!==c;)t=t.return;Yc=t}function hd(e){if(e!==Yc)return!1;if(!Xc)return pd(e),Xc=!0,!1;if(3!==e.tag&&(5!==e.tag||"head"!==(n=e.type)&&"body"!==n&&!yu(e.type,e.memoizedProps))){var t=Kc;if(t)if(sd(e))md(e),ld();else for(;t;)rd(e,t),t=Du(t)}var n;return pd(e),Kc=e.tag===c?fd(e):Yc?Du(e.stateNode):null,!0}function md(e){for(var t=Kc;t;)nd(e,t),t=Du(t)}function gd(){Yc=null,Kc=null,Xc=!1,Qc=!1}function bd(){null!==Zc&&(Hy(Zc),Zc=null)}function yd(){return Xc}function _d(e){null===Zc?Zc=[e]:Zc.push(e)}var vd=n.ReactCurrentBatchConfig;var wd={recordUnsafeLifecycleWarnings:function(e,t){},flushPendingUnsafeLifecycleWarnings:function(){},recordLegacyContextWarning:function(e,t){},flushLegacyContextWarning:function(){},discardPendingWarnings:function(){}},Sd=function(e){var t=[];return e.forEach(function(e){t.push(e)}),t.sort().join(", ")},xd=[],Td=[],Ed=[],kd=[],Pd=[],Od=[],Ad=new Set;wd.recordUnsafeLifecycleWarnings=function(e,t){Ad.has(e.type)||("function"==typeof t.componentWillMount&&!0!==t.componentWillMount.__suppressDeprecationWarning&&xd.push(e),8&e.mode&&"function"==typeof t.UNSAFE_componentWillMount&&Td.push(e),"function"==typeof t.componentWillReceiveProps&&!0!==t.componentWillReceiveProps.__suppressDeprecationWarning&&Ed.push(e),8&e.mode&&"function"==typeof t.UNSAFE_componentWillReceiveProps&&kd.push(e),"function"==typeof t.componentWillUpdate&&!0!==t.componentWillUpdate.__suppressDeprecationWarning&&Pd.push(e),8&e.mode&&"function"==typeof t.UNSAFE_componentWillUpdate&&Od.push(e))},wd.flushPendingUnsafeLifecycleWarnings=function(){var e=new Set;xd.length>0&&(xd.forEach(function(t){e.add(je(t)||"Component"),Ad.add(t.type)}),xd=[]);var t=new Set;Td.length>0&&(Td.forEach(function(e){t.add(je(e)||"Component"),Ad.add(e.type)}),Td=[]);var n=new Set;Ed.length>0&&(Ed.forEach(function(e){n.add(je(e)||"Component"),Ad.add(e.type)}),Ed=[]);var r=new Set;kd.length>0&&(kd.forEach(function(e){r.add(je(e)||"Component"),Ad.add(e.type)}),kd=[]);var i=new Set;Pd.length>0&&(Pd.forEach(function(e){i.add(je(e)||"Component"),Ad.add(e.type)}),Pd=[]);var s=new Set;(Od.length>0&&(Od.forEach(function(e){s.add(je(e)||"Component"),Ad.add(e.type)}),Od=[]),t.size>0)&&a("Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move code with side effects to componentDidMount, and set initial state in the constructor.\n\nPlease update the following components: %s",Sd(t));r.size>0&&a("Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move data fetching code or side effects to componentDidUpdate.\n* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state\n\nPlease update the following components: %s",Sd(r));s.size>0&&a("Using UNSAFE_componentWillUpdate in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move data fetching code or side effects to componentDidUpdate.\n\nPlease update the following components: %s",Sd(s));e.size>0&&o("componentWillMount has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move code with side effects to componentDidMount, and set initial state in the constructor.\n* Rename componentWillMount to UNSAFE_componentWillMount to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run `npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n\nPlease update the following components: %s",Sd(e));n.size>0&&o("componentWillReceiveProps has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move data fetching code or side effects to componentDidUpdate.\n* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state\n* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run `npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n\nPlease update the following components: %s",Sd(n));i.size>0&&o("componentWillUpdate has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move data fetching code or side effects to componentDidUpdate.\n* Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run `npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n\nPlease update the following components: %s",Sd(i))};var $d,Rd,Id,Cd,Dd,Nd=new Map,Md=new Set;wd.recordLegacyContextWarning=function(e,t){var n=function(e){for(var t=null,n=e;null!==n;)8&n.mode&&(t=n),n=n.return;return t}(e);if(null!==n){if(!Md.has(e.type)){var r=Nd.get(n);(null!=e.type.contextTypes||null!=e.type.childContextTypes||null!==t&&"function"==typeof t.getChildContext)&&(void 0===r&&(r=[],Nd.set(n,r)),r.push(e))}}else a("Expected to find a StrictMode component in a strict mode tree. This error is likely caused by a bug in React. Please file an issue.")},wd.flushLegacyContextWarning=function(){Nd.forEach(function(e,t){if(0!==e.length){var n=e[0],r=new Set;e.forEach(function(e){r.add(je(e)||"Component"),Md.add(e.type)});var o=Sd(r);try{qe(n),a("Legacy context API has been detected within a strict-mode tree.\n\nThe old API will be supported in all 16.x releases, but applications using it should migrate to the new version.\n\nPlease update the following components: %s\n\nLearn more about this warning here: https://reactjs.org/link/legacy-context",o)}finally{He()}}})},wd.discardPendingWarnings=function(){xd=[],Td=[],Ed=[],kd=[],Pd=[],Od=[],Nd=new Map};var Ld;function jd(e,t,n){var r,o=n.ref;if(null!==o&&"function"!=typeof o&&"object"!=typeof o){if(e.mode,!(n._owner&&n._self&&n._owner.stateNode!==n._self||n._owner&&1!==n._owner.tag)&&("function"!=typeof n.type||(r=n.type).prototype&&r.prototype.isReactComponent)&&n._owner){var i=je(e)||"Component";Id[i]||(a('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. We recommend using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',i,o),Id[i]=!0)}if(n._owner){var s,l=n._owner;if(l){var u=l;if(1!==u.tag)throw new Error("Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref");s=u.stateNode}if(!s)throw new Error("Missing owner for string ref "+o+". This error is likely caused by a bug in React. Please file an issue.");var c=s;!function(e,t){if(A(e))a("The provided `%s` prop is an unsupported type %s. This value must be coerced to a string before before using it here.",t,O(e)),$(e)}(o,"ref");var d=""+o;if(null!==t&&null!==t.ref&&"function"==typeof t.ref&&t.ref._stringRef===d)return t.ref;var f=function(e){var t=c.refs;null===e?delete t[d]:t[d]=e};return f._stringRef=d,f}if("string"!=typeof o)throw new Error("Expected ref to be a function, a string, an object returned by React.createRef(), or null.");if(!n._owner)throw new Error("Element ref was specified as a string ("+o+") but no owner was set. This could happen for one of the following reasons:\n1. You may be adding a ref to a function component\n2. You may be adding a ref to a component that was not created inside a component's render method\n3. You have multiple copies of React loaded\nSee https://reactjs.org/link/refs-must-have-owner for more information.")}return o}function Fd(e,t){var n=Object.prototype.toString.call(t);throw new Error("Objects are not valid as a React child (found: "+("[object Object]"===n?"object with keys {"+Object.keys(t).join(", ")+"}":n)+"). If you meant to render a collection of children, use an array instead.")}function Bd(e){var t=je(e)||"Component";Dd[t]||(Dd[t]=!0,a("Functions are not valid as a React child. This may happen if you return a Component instead of <Component /> from render. Or maybe you meant to call this function rather than return it."))}function Ud(e){var t=e._payload;return(0,e._init)(t)}function zd(e){function t(t,n){if(e){var r=t.deletions;null===r?(t.deletions=[n],t.flags|=tr):r.push(n)}}function n(n,r){if(!e)return null;for(var o=r;null!==o;)t(n,o),o=o.sibling;return null}function r(e,t){for(var n=new Map,r=t;null!==r;)null!==r.key?n.set(r.key,r):n.set(r.index,r),r=r.sibling;return n}function o(e,t){var n=K_(e,t);return n.index=0,n.sibling=null,n}function i(t,n,r){if(t.index=r,!e)return t.flags|=pr,n;var o=t.alternate;if(null!==o){var a=o.index;return a<n?(t.flags|=2,n):a}return t.flags|=2,n}function s(t){return e&&null===t.alternate&&(t.flags|=2),t}function l(e,t,n,r){if(null===t||6!==t.tag){var a=tv(n,e.mode,r);return a.return=e,a}var i=o(t,n);return i.return=e,i}function u(e,t,n,r){var a=n.type;if(a===te)return d(e,t,n.props.children,r,n.key);if(null!==t&&(t.elementType===a||j_(t,n)||"object"==typeof a&&null!==a&&a.$$typeof===ce&&Ud(a)===t.type)){var i=o(t,n.props);return i.ref=jd(e,t,n),i.return=e,i._debugSource=n._source,i._debugOwner=n._owner,i}var s=Z_(n,e.mode,r);return s.ref=jd(e,t,n),s.return=e,s}function c(e,t,n,r){if(null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation){var a=nv(n,e.mode,r);return a.return=e,a}var i=o(t,n.children||[]);return i.return=e,i}function d(e,t,n,r,a){if(null===t||7!==t.tag){var i=J_(n,e.mode,r,a);return i.return=e,i}var s=o(t,n);return s.return=e,s}function f(e,t,n){if("string"==typeof t&&""!==t||"number"==typeof t){var r=tv(""+t,e.mode,n);return r.return=e,r}if("object"==typeof t&&null!==t){switch(t.$$typeof){case J:var o=Z_(t,e.mode,n);return o.ref=jd(e,null,t),o.return=e,o;case ee:var a=nv(t,e.mode,n);return a.return=e,a;case ce:var i=t._payload;return f(e,(0,t._init)(i),n)}if(vt(t)||pe(t)){var s=J_(t,e.mode,n,null);return s.return=e,s}Fd(0,t)}return"function"==typeof t&&Bd(e),null}function p(e,t,n,r){var o=null!==t?t.key:null;if("string"==typeof n&&""!==n||"number"==typeof n)return null!==o?null:l(e,t,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case J:return n.key===o?u(e,t,n,r):null;case ee:return n.key===o?c(e,t,n,r):null;case ce:var a=n._payload;return p(e,t,(0,n._init)(a),r)}if(vt(n)||pe(n))return null!==o?null:d(e,t,n,r,null);Fd(0,n)}return"function"==typeof n&&Bd(e),null}function h(e,t,n,r,o){if("string"==typeof r&&""!==r||"number"==typeof r)return l(t,e.get(n)||null,""+r,o);if("object"==typeof r&&null!==r){switch(r.$$typeof){case J:return u(t,e.get(null===r.key?n:r.key)||null,r,o);case ee:return c(t,e.get(null===r.key?n:r.key)||null,r,o);case ce:var a=r._payload;return h(e,t,n,(0,r._init)(a),o)}if(vt(r)||pe(r))return d(t,e.get(n)||null,r,o,null);Fd(0,r)}return"function"==typeof r&&Bd(t),null}function m(e,t,n){if("object"!=typeof e||null===e)return t;switch(e.$$typeof){case J:case ee:Ld(e,n);var r=e.key;if("string"!=typeof r)break;if(null===t){(t=new Set).add(r);break}if(!t.has(r)){t.add(r);break}a("Encountered two children with the same key, `%s`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change in a future version.",r);break;case ce:var o=e._payload;m((0,e._init)(o),t,n)}return t}return function l(u,c,d,g){if("object"==typeof d&&null!==d&&d.type===te&&null===d.key&&(d=d.props.children),"object"==typeof d&&null!==d){switch(d.$$typeof){case J:return s(function(e,r,a,i){for(var s=a.key,l=r;null!==l;){if(l.key===s){var u=a.type;if(u===te){if(7===l.tag){n(e,l.sibling);var c=o(l,a.props.children);return c.return=e,c._debugSource=a._source,c._debugOwner=a._owner,c}}else if(l.elementType===u||j_(l,a)||"object"==typeof u&&null!==u&&u.$$typeof===ce&&Ud(u)===l.type){n(e,l.sibling);var d=o(l,a.props);return d.ref=jd(e,l,a),d.return=e,d._debugSource=a._source,d._debugOwner=a._owner,d}n(e,l);break}t(e,l),l=l.sibling}if(a.type===te){var f=J_(a.props.children,e.mode,i,a.key);return f.return=e,f}var p=Z_(a,e.mode,i);return p.ref=jd(e,r,a),p.return=e,p}(u,c,d,g));case ee:return s(function(e,r,a,i){for(var s=a.key,l=r;null!==l;){if(l.key===s){if(4===l.tag&&l.stateNode.containerInfo===a.containerInfo&&l.stateNode.implementation===a.implementation){n(e,l.sibling);var u=o(l,a.children||[]);return u.return=e,u}n(e,l);break}t(e,l),l=l.sibling}var c=nv(a,e.mode,i);return c.return=e,c}(u,c,d,g));case ce:var b=d._payload;return l(u,c,(0,d._init)(b),g)}if(vt(d))return function(o,a,s,l){for(var u=null,c=0;c<s.length;c++)u=m(s[c],u,o);for(var d=null,g=null,b=a,y=0,_=0,v=null;null!==b&&_<s.length;_++){b.index>_?(v=b,b=null):v=b.sibling;var w=p(o,b,s[_],l);if(null===w){null===b&&(b=v);break}e&&b&&null===w.alternate&&t(o,b),y=i(w,y,_),null===g?d=w:g.sibling=w,g=w,b=v}if(_===s.length)return n(o,b),yd()&&zc(o,_),d;if(null===b){for(;_<s.length;_++){var S=f(o,s[_],l);null!==S&&(y=i(S,y,_),null===g?d=S:g.sibling=S,g=S)}return yd()&&zc(o,_),d}for(var x=r(0,b);_<s.length;_++){var T=h(x,o,_,s[_],l);null!==T&&(e&&null!==T.alternate&&x.delete(null===T.key?_:T.key),y=i(T,y,_),null===g?d=T:g.sibling=T,g=T)}return e&&x.forEach(function(e){return t(o,e)}),yd()&&zc(o,_),d}(u,c,d,g);if(pe(d))return function(o,s,l,u){var c=pe(l);if("function"!=typeof c)throw new Error("An object is not an iterable. This error is likely caused by a bug in React. Please file an issue.");"function"==typeof Symbol&&"Generator"===l[Symbol.toStringTag]&&(Rd||a("Using Generators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You may convert it to an array with `Array.from()` or the `[...spread]` operator before rendering. Keep in mind you might need to polyfill these features for older browsers."),Rd=!0),l.entries===c&&($d||a("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),$d=!0);var d=c.call(l);if(d)for(var g=null,b=d.next();!b.done;b=d.next())g=m(b.value,g,o);var y=c.call(l);if(null==y)throw new Error("An iterable object provided no iterator.");for(var _=null,v=null,w=s,S=0,x=0,T=null,E=y.next();null!==w&&!E.done;x++,E=y.next()){w.index>x?(T=w,w=null):T=w.sibling;var k=p(o,w,E.value,u);if(null===k){null===w&&(w=T);break}e&&w&&null===k.alternate&&t(o,w),S=i(k,S,x),null===v?_=k:v.sibling=k,v=k,w=T}if(E.done)return n(o,w),yd()&&zc(o,x),_;if(null===w){for(;!E.done;x++,E=y.next()){var P=f(o,E.value,u);null!==P&&(S=i(P,S,x),null===v?_=P:v.sibling=P,v=P)}return yd()&&zc(o,x),_}for(var O=r(0,w);!E.done;x++,E=y.next()){var A=h(O,o,x,E.value,u);null!==A&&(e&&null!==A.alternate&&O.delete(null===A.key?x:A.key),S=i(A,S,x),null===v?_=A:v.sibling=A,v=A)}return e&&O.forEach(function(e){return t(o,e)}),yd()&&zc(o,x),_}(u,c,d,g);Fd(0,d)}return"string"==typeof d&&""!==d||"number"==typeof d?s(function(e,t,r,a){if(null!==t&&6===t.tag){n(e,t.sibling);var i=o(t,r);return i.return=e,i}n(e,t);var s=tv(r,e.mode,a);return s.return=e,s}(u,c,""+d,g)):("function"==typeof d&&Bd(u),n(u,c))}}$d=!1,Rd=!1,Id={},Cd={},Dd={},Ld=function(e,t){if(null!==e&&"object"==typeof e&&e._store&&!e._store.validated&&null==e.key){if("object"!=typeof e._store)throw new Error("React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue.");e._store.validated=!0;var n=je(t)||"Component";Cd[n]||(Cd[n]=!0,a('Each child in a list should have a unique "key" prop. See https://reactjs.org/link/warning-keys for more information.'))}};var Vd=zd(!0),Hd=zd(!1);function qd(e,t){for(var n=e.child;null!==n;)X_(n,t),n=n.sibling}var Gd,Wd=sc(null);Gd={};var Yd=null,Kd=null,Xd=null,Qd=!1;function Zd(){Yd=null,Kd=null,Xd=null,Qd=!1}function Jd(){Qd=!0}function ef(){Qd=!1}function tf(e,t,n){uc(Wd,t._currentValue,e),t._currentValue=n,void 0!==t._currentRenderer&&null!==t._currentRenderer&&t._currentRenderer!==Gd&&a("Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported."),t._currentRenderer=Gd}function nf(e,t){var n=Wd.current;lc(Wd,t),e._currentValue=n}function rf(e,t,n){for(var r=e;null!==r;){var o=r.alternate;if(ba(r.childLanes,t)?null===o||ba(o.childLanes,t)||(o.childLanes=ya(o.childLanes,t)):(r.childLanes=ya(r.childLanes,t),null!==o&&(o.childLanes=ya(o.childLanes,t))),r===n)break;r=r.return}r!==n&&a("Expected to find the propagation root when scheduling context work. This error is likely caused by a bug in React. Please file an issue.")}function of(e,t,n){!function(e,t,n){var r=e.child;null!==r&&(r.return=e);for(;null!==r;){var o=void 0,a=r.dependencies;if(null!==a){o=r.child;for(var i=a.firstContext;null!==i;){if(i.context===t){if(1===r.tag){var l=pa(n),u=wf(ea,l);u.tag=bf;var c=r.updateQueue;if(null===c);else{var d=c.shared,f=d.pending;null===f?u.next=u:(u.next=f.next,f.next=u),d.pending=u}}r.lanes=ya(r.lanes,n);var p=r.alternate;null!==p&&(p.lanes=ya(p.lanes,n)),rf(r.return,n,e),a.lanes=ya(a.lanes,n);break}i=i.next}}else if(r.tag===s)o=r.type===e.type?null:r.child;else if(r.tag===h){var m=r.return;if(null===m)throw new Error("We just came from a parent so we must have had a parent. This is a bug in React.");m.lanes=ya(m.lanes,n);var g=m.alternate;null!==g&&(g.lanes=ya(g.lanes,n)),rf(m,n,e),o=r.sibling}else o=r.child;if(null!==o)o.return=r;else for(o=r;null!==o;){if(o===e){o=null;break}var b=o.sibling;if(null!==b){b.return=o.return,o=b;break}o=o.return}r=o}}(e,t,n)}function af(e,t){Yd=e,Kd=null,Xd=null;var n=e.dependencies;null!==n&&(null!==n.firstContext&&(ga(n.lanes,t)&&mg(),n.firstContext=null))}function sf(e){Qd&&a("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().");var t=e._currentValue;if(Xd===e);else{var n={context:e,memoizedValue:t,next:null};if(null===Kd){if(null===Yd)throw new Error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().");Kd=n,Yd.dependencies={lanes:0,firstContext:n}}else Kd=Kd.next=n}return t}var lf=null;function uf(e){null===lf?lf=[e]:lf.push(e)}function cf(e,t,n,r){var o=t.interleaved;return null===o?(n.next=n,uf(t)):(n.next=o.next,o.next=n),t.interleaved=n,pf(e,r)}function df(e,t){return pf(e,t)}var ff=pf;function pf(e,t){e.lanes=ya(e.lanes,t);var n=e.alternate;null!==n&&(n.lanes=ya(n.lanes,t)),null===n&&4098&e.flags&&x_(e);for(var r=e,o=e.return;null!==o;)o.childLanes=ya(o.childLanes,t),null!==(n=o.alternate)?n.childLanes=ya(n.childLanes,t):4098&o.flags&&x_(e),r=o,o=o.return;return 3===r.tag?r.stateNode:null}var hf,mf,gf=0,bf=2,yf=!1;function _f(e){var t={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null};e.updateQueue=t}function vf(e,t){var n=t.updateQueue,r=e.updateQueue;if(n===r){var o={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,effects:r.effects};t.updateQueue=o}}function wf(e,t){return{eventTime:e,lane:t,tag:gf,payload:null,callback:null,next:null}}function Sf(e,t,n){var r=e.updateQueue;if(null===r)return null;var o=r.shared;if(mf!==o||hf||(a("An update (setState, replaceState, or forceUpdate) was scheduled from inside an update function. Update functions should be pure, with zero side-effects. Consider using componentDidUpdate or a callback."),hf=!0),(Qb&zb)!==Ub){var i=o.pending;return null===i?t.next=t:(t.next=i.next,i.next=t),o.pending=t,ff(e,n)}return function(e,t,n,r){var o=t.interleaved;return null===o?(n.next=n,uf(t)):(n.next=o.next,o.next=n),t.interleaved=n,pf(e,r)}(e,o,t,n)}function xf(e,t,n){var r=t.updateQueue;if(null!==r){var o=r.shared;if(ca(n)){var a=o.lanes,i=ya(a=va(a,e.pendingLanes),n);o.lanes=i,Ta(e,i)}}}function Tf(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r){var o=r.updateQueue;if(n===o){var a=null,i=null,s=n.firstBaseUpdate;if(null!==s){var l=s;do{var u={eventTime:l.eventTime,lane:l.lane,tag:l.tag,payload:l.payload,callback:l.callback,next:null};null===i?a=i=u:(i.next=u,i=u),l=l.next}while(null!==l);null===i?a=i=t:(i.next=t,i=t)}else a=i=t;return n={baseState:o.baseState,firstBaseUpdate:a,lastBaseUpdate:i,shared:o.shared,effects:o.effects},void(e.updateQueue=n)}}var c=n.lastBaseUpdate;null===c?n.firstBaseUpdate=t:c.next=t,n.lastBaseUpdate=t}function Ef(e,t,n,r,o,a){switch(n.tag){case 1:var i=n.payload;if("function"==typeof i){Jd();var s=i.call(a,r,o);if(8&e.mode){Qr(!0);try{i.call(a,r,o)}finally{Qr(!1)}}return ef(),s}return i;case 3:e.flags=-65537&e.flags|nr;case gf:var l,u=n.payload;if("function"==typeof u){if(Jd(),l=u.call(a,r,o),8&e.mode){Qr(!0);try{u.call(a,r,o)}finally{Qr(!1)}}ef()}else l=u;return null==l?r:we({},r,l);case bf:return yf=!0,r}return r}function kf(e,t,n,r){var o=e.updateQueue;yf=!1,mf=o.shared;var a=o.firstBaseUpdate,i=o.lastBaseUpdate,s=o.shared.pending;if(null!==s){o.shared.pending=null;var l=s,u=l.next;l.next=null,null===i?a=u:i.next=u,i=l;var c=e.alternate;if(null!==c){var d=c.updateQueue,f=d.lastBaseUpdate;f!==i&&(null===f?d.firstBaseUpdate=u:f.next=u,d.lastBaseUpdate=l)}}if(null!==a){for(var p=o.baseState,h=0,m=null,g=null,b=null,y=a;;){var _=y.lane,v=y.eventTime;if(ba(r,_)){if(null!==b){var w={eventTime:v,lane:0,tag:y.tag,payload:y.payload,callback:y.callback,next:null};b=b.next=w}if(p=Ef(e,0,y,p,t,n),null!==y.callback&&0!==y.lane){e.flags|=64;var S=o.effects;null===S?o.effects=[y]:S.push(y)}}else{var x={eventTime:v,lane:_,tag:y.tag,payload:y.payload,callback:y.callback,next:null};null===b?(g=b=x,m=p):b=b.next=x,h=ya(h,_)}if(null===(y=y.next)){if(null===(s=o.shared.pending))break;var T=s,E=T.next;T.next=null,y=E,o.lastBaseUpdate=T,o.shared.pending=null}}null===b&&(m=p),o.baseState=m,o.firstBaseUpdate=g,o.lastBaseUpdate=b;var k=o.shared.interleaved;if(null!==k){var P=k;do{h=ya(h,P.lane),P=P.next}while(P!==k)}else null===a&&(o.shared.lanes=0);n_(h),e.lanes=h,e.memoizedState=p}mf=null}function Pf(e,t){if("function"!=typeof e)throw new Error("Invalid argument passed as callback. Expected a function. Instead received: "+e);e.call(t)}function Of(){yf=!1}function Af(){return yf}function $f(e,t,n){var r=t.effects;if(t.effects=null,null!==r)for(var o=0;o<r.length;o++){var a=r[o],i=a.callback;null!==i&&(a.callback=null,Pf(i,n))}}hf=!1,mf=null;var Rf={},If=sc(Rf),Cf=sc(Rf),Df=sc(Rf);function Nf(e){if(e===Rf)throw new Error("Expected host context to exist. This error is likely caused by a bug in React. Please file an issue.");return e}function Mf(){return Nf(Df.current)}function Lf(e,t){uc(Df,t,e),uc(Cf,e,e),uc(If,Rf,e);var n=function(e){var t,n,r=e.nodeType;switch(r){case 9:case 11:t=9===r?"#document":"#fragment";var o=e.documentElement;n=o?o.namespaceURI:Dt(null,"");break;default:var a=8===r?e.parentNode:e;n=Dt(a.namespaceURI||null,t=a.tagName)}var i=t.toLowerCase();return{namespace:n,ancestorInfo:tu(null,i)}}(t);lc(If,e),uc(If,n,e)}function jf(e){lc(If,e),lc(Cf,e),lc(Df,e)}function Ff(){return Nf(If.current)}function Bf(e){Nf(Df.current);var t,n,r,o=Nf(If.current),a=(t=o,n=e.type,{namespace:Dt((r=t).namespace,n),ancestorInfo:tu(r.ancestorInfo,n)});o!==a&&(uc(Cf,e,e),uc(If,a,e))}function Uf(e){Cf.current===e&&(lc(If,e),lc(Cf,e))}var zf=sc(0);function Vf(e,t){return 0!==(e&t)}function Hf(e){return 1&e}function qf(e,t){return 1&e|t}function Gf(e,t){uc(zf,t,e)}function Wf(e){lc(zf,e)}function Yf(e,t){var n=e.memoizedState;return null!==n?null!==n.dehydrated:(e.memoizedProps,!0)}function Kf(e){for(var t=e;null!==t;){if(t.tag===c){var n=t.memoizedState;if(null!==n){var r=n.dehydrated;if(null===r||Ru(r)||Iu(r))return t}}else if(t.tag===m&&void 0!==t.memoizedProps.revealOrder){if(0!==(t.flags&nr))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)return null;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Xf=[];function Qf(){for(var e=0;e<Xf.length;e++){Xf[e]._workInProgressVersionPrimary=null}Xf.length=0}function Zf(e,t){var n=(0,t._getVersion)(t._source);null==e.mutableSourceEagerHydrationData?e.mutableSourceEagerHydrationData=[t,n]:e.mutableSourceEagerHydrationData.push(t,n)}var Jf,ep,tp=n.ReactCurrentDispatcher,np=n.ReactCurrentBatchConfig;Jf=new Set;var rp=0,op=null,ap=null,ip=null,sp=!1,lp=!1,up=0,cp=0,dp=null,fp=null,pp=-1,hp=!1;function mp(){var e=dp;null===fp?fp=[e]:fp.push(e)}function gp(){var e=dp;null!==fp&&(pp++,fp[pp]!==e&&function(e){var t=je(op);if(!Jf.has(t)&&(Jf.add(t),null!==fp)){for(var n="",r=30,o=0;o<=pp;o++){for(var i=fp[o],s=o===pp?e:i,l=o+1+". "+i;l.length<r;)l+=" ";n+=l+=s+"\n"}a("React has detected a change in the order of Hooks called by %s. This will lead to bugs and errors if not fixed. For more information, read the Rules of Hooks: https://reactjs.org/link/rules-of-hooks\n\n Previous render Next render\n ------------------------------------------------------\n%s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",t,n)}}(e))}function bp(e){null==e||vt(e)||a("%s received a final argument that is not an array (instead, received `%s`). When specified, the final argument must be an array.",dp,typeof e)}function yp(){throw new Error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.")}function _p(e,t){if(hp)return!1;if(null===t)return a("%s received a final argument during this render, but not during the previous render. Even though the final argument is optional, its type cannot change between renders.",dp),!1;e.length!==t.length&&a("The final argument passed to %s changed size between renders. The order and size of this array must remain constant.\n\nPrevious: %s\nIncoming: %s",dp,"["+t.join(", ")+"]","["+e.join(", ")+"]");for(var n=0;n<t.length&&n<e.length;n++)if(!Os(e[n],t[n]))return!1;return!0}function vp(e,t,n,r,o,i){rp=i,op=t,fp=null!==e?e._debugHookTypes:null,pp=-1,hp=null!==e&&e.type!==t.type,t.memoizedState=null,t.updateQueue=null,t.lanes=0,null!==e&&null!==e.memoizedState?tp.current=kh:tp.current=null!==fp?Eh:Th;var s=n(r,o);if(lp){var l=0;do{if(lp=!1,up=0,l>=25)throw new Error("Too many re-renders. React limits the number of renders to prevent an infinite loop.");l+=1,hp=!1,ap=null,ip=null,t.updateQueue=null,pp=-1,tp.current=Ph,s=n(r,o)}while(lp)}tp.current=xh,t._debugHookTypes=fp;var u=null!==ap&&null!==ap.next;if(rp=0,op=null,ap=null,ip=null,dp=null,fp=null,pp=-1,null!==e&&(e.flags&Sr)!==(t.flags&Sr)&&1&e.mode&&a("Internal React error: Expected static flag was missing. Please notify the React team."),sp=!1,u)throw new Error("Rendered fewer hooks than expected. This may be caused by an accidental early return statement.");return s}function wp(){var e=0!==up;return up=0,e}function Sp(e,t,n){t.updateQueue=e.updateQueue,0!==(t.mode&bo)?t.flags&=-50333701:t.flags&=-2053,e.lanes=_a(e.lanes,n)}function xp(){if(tp.current=xh,sp){for(var e=op.memoizedState;null!==e;){var t=e.queue;null!==t&&(t.pending=null),e=e.next}sp=!1}rp=0,op=null,ap=null,ip=null,fp=null,pp=-1,dp=null,hh=!1,lp=!1,up=0}function Tp(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===ip?op.memoizedState=ip=e:ip=ip.next=e,ip}function Ep(){var e,t;if(null===ap){var n=op.alternate;e=null!==n?n.memoizedState:null}else e=ap.next;if(null!==(t=null===ip?op.memoizedState:ip.next))t=(ip=t).next,ap=e;else{if(null===e)throw new Error("Rendered more hooks than during the previous render.");var r={memoizedState:(ap=e).memoizedState,baseState:ap.baseState,baseQueue:ap.baseQueue,queue:ap.queue,next:null};null===ip?op.memoizedState=ip=r:ip=ip.next=r}return ip}function kp(e,t){return"function"==typeof t?t(e):t}function Pp(e,t,n){var r,o=Tp();r=void 0!==n?n(t):t,o.memoizedState=o.baseState=r;var a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r};o.queue=a;var i=a.dispatch=bh.bind(null,op,a);return[o.memoizedState,i]}function Op(e,t,n){var r=Ep(),o=r.queue;if(null===o)throw new Error("Should have a queue. This is likely a bug in React. Please file an issue.");o.lastRenderedReducer=e;var i=ap,s=i.baseQueue,l=o.pending;if(null!==l){if(null!==s){var u=s.next,c=l.next;s.next=c,l.next=u}i.baseQueue!==s&&a("Internal error: Expected work-in-progress queue to be a clone. This is a bug in React."),i.baseQueue=s=l,o.pending=null}if(null!==s){var d=s.next,f=i.baseState,p=null,h=null,m=null,g=d;do{var b=g.lane;if(ba(rp,b)){if(null!==m){var y={lane:0,action:g.action,hasEagerState:g.hasEagerState,eagerState:g.eagerState,next:null};m=m.next=y}if(g.hasEagerState)f=g.eagerState;else f=e(f,g.action)}else{var _={lane:b,action:g.action,hasEagerState:g.hasEagerState,eagerState:g.eagerState,next:null};null===m?(h=m=_,p=f):m=m.next=_,op.lanes=ya(op.lanes,b),n_(b)}g=g.next}while(null!==g&&g!==d);null===m?p=f:m.next=h,Os(f,r.memoizedState)||mg(),r.memoizedState=f,r.baseState=p,r.baseQueue=m,o.lastRenderedState=f}var v=o.interleaved;if(null!==v){var w=v;do{var S=w.lane;op.lanes=ya(op.lanes,S),n_(S),w=w.next}while(w!==v)}else null===s&&(o.lanes=0);var x=o.dispatch;return[r.memoizedState,x]}function Ap(e,t,n){var r=Ep(),o=r.queue;if(null===o)throw new Error("Should have a queue. This is likely a bug in React. Please file an issue.");o.lastRenderedReducer=e;var a=o.dispatch,i=o.pending,s=r.memoizedState;if(null!==i){o.pending=null;var l=i.next,u=l;do{s=e(s,u.action),u=u.next}while(u!==l);Os(s,r.memoizedState)||mg(),r.memoizedState=s,null===r.baseQueue&&(r.baseState=s),o.lastRenderedState=s}return[s,a]}function $p(e,t,n){var r,o=op,i=Tp();if(yd()){if(void 0===n)throw new Error("Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering.");r=n(),ep||r!==n()&&(a("The result of getServerSnapshot should be cached to avoid an infinite loop"),ep=!0)}else{if(r=t(),!ep){var s=t();Os(r,s)||(a("The result of getSnapshot should be cached to avoid an infinite loop"),ep=!0)}var l=My();if(null===l)throw new Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");ua(0,rp)||Ip(o,t,r)}i.memoizedState=r;var u={value:r,getSnapshot:t};return i.queue=u,qp(Dp.bind(null,o,u,e),[e]),o.flags|=ir,Bp(9,Cp.bind(null,o,u,r,t),void 0,null),r}function Rp(e,t,n){var r=op,o=Ep(),i=t();if(!ep){var s=t();Os(i,s)||(a("The result of getSnapshot should be cached to avoid an infinite loop"),ep=!0)}var l=o.memoizedState,u=!Os(l,i);u&&(o.memoizedState=i,mg());var c=o.queue;if(Gp(Dp.bind(null,r,c,e),[e]),c.getSnapshot!==t||u||null!==ip&&1&ip.memoizedState.tag){r.flags|=ir,Bp(9,Cp.bind(null,r,c,i,t),void 0,null);var d=My();if(null===d)throw new Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");ua(0,rp)||Ip(r,t,i)}return i}function Ip(e,t,n){e.flags|=ur;var r={getSnapshot:t,value:n},o=op.updateQueue;if(null===o)o={lastEffect:null,stores:null},op.updateQueue=o,o.stores=[r];else{var a=o.stores;null===a?o.stores=[r]:a.push(r)}}function Cp(e,t,n,r){t.value=n,t.getSnapshot=r,Np(t)&&Mp(e)}function Dp(e,t,n){return n(function(){Np(t)&&Mp(e)})}function Np(e){var t=e.getSnapshot,n=e.value;try{var r=t();return!Os(n,r)}catch(o){return!0}}function Mp(e){var t=df(e,So);null!==t&&By(t,e,So,ea)}function Lp(e){var t=Tp();"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e;var n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:kp,lastRenderedState:e};t.queue=n;var r=n.dispatch=yh.bind(null,op,n);return[t.memoizedState,r]}function jp(e){return Op(kp)}function Fp(e){return Ap(kp)}function Bp(e,t,n,r){var o={tag:e,create:t,destroy:n,deps:r,next:null},a=op.updateQueue;if(null===a)a={lastEffect:null,stores:null},op.updateQueue=a,a.lastEffect=o.next=o;else{var i=a.lastEffect;if(null===i)a.lastEffect=o.next=o;else{var s=i.next;i.next=o,o.next=s,a.lastEffect=o}}return o}function Up(e){var t={current:e};return Tp().memoizedState=t,t}function zp(e){return Ep().memoizedState}function Vp(e,t,n,r){var o=Tp(),a=void 0===r?null:r;op.flags|=e,o.memoizedState=Bp(1|t,n,void 0,a)}function Hp(e,t,n,r){var o=Ep(),a=void 0===r?null:r,i=void 0;if(null!==ap){var s=ap.memoizedState;if(i=s.destroy,null!==a)if(_p(a,s.deps))return void(o.memoizedState=Bp(t,n,i,a))}op.flags|=e,o.memoizedState=Bp(1|t,n,i,a)}function qp(e,t){return 0!==(op.mode&bo)?Vp(41945088,8,e,t):Vp(8390656,8,e,t)}function Gp(e,t){return Hp(ir,8,e,t)}function Wp(e,t){return Vp(4,2,e,t)}function Yp(e,t){return Hp(4,2,e,t)}function Kp(e,t){var n=4;return n|=mr,0!==(op.mode&bo)&&(n|=gr),Vp(n,4,e,t)}function Xp(e,t){return Hp(4,4,e,t)}function Qp(e,t){if("function"==typeof t){var n=t,r=e();return n(r),function(){n(null)}}if(null!=t){var o=t;o.hasOwnProperty("current")||a("Expected useImperativeHandle() first argument to either be a ref callback or React.createRef() object. Instead received: %s.","an object with keys {"+Object.keys(o).join(", ")+"}");var i=e();return o.current=i,function(){o.current=null}}}function Zp(e,t,n){"function"!=typeof t&&a("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.",null!==t?typeof t:"null");var r=null!=n?n.concat([e]):null,o=4;return o|=mr,0!==(op.mode&bo)&&(o|=gr),Vp(o,4,Qp.bind(null,t,e),r)}function Jp(e,t,n){"function"!=typeof t&&a("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.",null!==t?typeof t:"null");var r=null!=n?n.concat([e]):null;return Hp(4,4,Qp.bind(null,t,e),r)}function eh(e,t){}var th=eh;function nh(e,t){var n=void 0===t?null:t;return Tp().memoizedState=[e,n],e}function rh(e,t){var n=Ep(),r=void 0===t?null:t,o=n.memoizedState;if(null!==o&&(null!==r&&_p(r,o[1])))return o[0];return n.memoizedState=[e,r],e}function oh(e,t){var n=Tp(),r=void 0===t?null:t,o=e();return n.memoizedState=[o,r],o}function ah(e,t){var n=Ep(),r=void 0===t?null:t,o=n.memoizedState;if(null!==o&&(null!==r&&_p(r,o[1])))return o[0];var a=e();return n.memoizedState=[a,r],a}function ih(e){return Tp().memoizedState=e,e}function sh(e){return uh(Ep(),ap.memoizedState,e)}function lh(e){var t=Ep();return null===ap?(t.memoizedState=e,e):uh(t,ap.memoizedState,e)}function uh(e,t,n){if(!(0===(rp&(So|To|ko)))){if(!Os(n,t)){var r=da();op.lanes=ya(op.lanes,r),n_(r),e.baseState=!0}return t}return e.baseState&&(e.baseState=!1,mg()),e.memoizedState=n,n}function ch(e,t,n){var r,a,i=La();ja((a=Ca,0!==(r=i)&&r<a?r:a)),e(!0);var s=np.transition;np.transition={};var l=np.transition;np.transition._updatedFibers=new Set;try{e(!1),t()}finally{if(ja(i),np.transition=s,null===s&&l._updatedFibers)l._updatedFibers.size>10&&o("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."),l._updatedFibers.clear()}}function dh(){var e=Lp(!1),t=e[0],n=e[1],r=ch.bind(null,n);return Tp().memoizedState=r,[t,r]}function fh(){return[jp()[0],Ep().memoizedState]}function ph(){return[Fp()[0],Ep().memoizedState]}var hh=!1;function mh(){var e,t=Tp(),n=My().identifierPrefix;if(yd()){e=":"+n+"R"+Uc();var r=up++;r>0&&(e+="H"+r.toString(32)),e+=":"}else{e=":"+n+"r"+(cp++).toString(32)+":"}return t.memoizedState=e,e}function gh(){return Ep().memoizedState}function bh(e,t,n){"function"==typeof arguments[3]&&a("State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect().");var r=jy(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(_h(e))vh(t,o);else{var i=cf(e,t,o,r);if(null!==i)By(i,e,r,Ly()),wh(i,t,r)}Sh(e,r)}function yh(e,t,n){"function"==typeof arguments[3]&&a("State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect().");var r=jy(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(_h(e))vh(t,o);else{var i=e.alternate;if(0===e.lanes&&(null===i||0===i.lanes)){var s=t.lastRenderedReducer;if(null!==s){var l;l=tp.current,tp.current=Ah;try{var u=t.lastRenderedState,c=s(u,n);if(o.hasEagerState=!0,o.eagerState=c,Os(c,u))return void function(e,t,n){var r=t.interleaved;null===r?(n.next=n,uf(t)):(n.next=r.next,r.next=n),t.interleaved=n}(0,t,o)}catch(f){}finally{tp.current=l}}}var d=cf(e,t,o,r);if(null!==d)By(d,e,r,Ly()),wh(d,t,r)}Sh(e,r)}function _h(e){var t=e.alternate;return e===op||null!==t&&t===op}function vh(e,t){lp=sp=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function wh(e,t,n){if(ca(n)){var r=t.lanes,o=ya(r=va(r,e.pendingLanes),n);t.lanes=o,Ta(e,o)}}function Sh(e,t,n){go(e,t)}var xh={readContext:sf,useCallback:yp,useContext:yp,useEffect:yp,useImperativeHandle:yp,useInsertionEffect:yp,useLayoutEffect:yp,useMemo:yp,useReducer:yp,useRef:yp,useState:yp,useDebugValue:yp,useDeferredValue:yp,useTransition:yp,useMutableSource:yp,useSyncExternalStore:yp,useId:yp,unstable_isNewReconciler:_},Th=null,Eh=null,kh=null,Ph=null,Oh=null,Ah=null,$h=null,Rh=function(){a("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().")},Ih=function(){a("Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. You can only call Hooks at the top level of your React function. For more information, see https://reactjs.org/link/rules-of-hooks")};Th={readContext:function(e){return sf(e)},useCallback:function(e,t){return dp="useCallback",mp(),bp(t),nh(e,t)},useContext:function(e){return dp="useContext",mp(),sf(e)},useEffect:function(e,t){return dp="useEffect",mp(),bp(t),qp(e,t)},useImperativeHandle:function(e,t,n){return dp="useImperativeHandle",mp(),bp(n),Zp(e,t,n)},useInsertionEffect:function(e,t){return dp="useInsertionEffect",mp(),bp(t),Wp(e,t)},useLayoutEffect:function(e,t){return dp="useLayoutEffect",mp(),bp(t),Kp(e,t)},useMemo:function(e,t){dp="useMemo",mp(),bp(t);var n=tp.current;tp.current=Oh;try{return oh(e,t)}finally{tp.current=n}},useReducer:function(e,t,n){dp="useReducer",mp();var r=tp.current;tp.current=Oh;try{return Pp(e,t,n)}finally{tp.current=r}},useRef:function(e){return dp="useRef",mp(),Up(e)},useState:function(e){dp="useState",mp();var t=tp.current;tp.current=Oh;try{return Lp(e)}finally{tp.current=t}},useDebugValue:function(e,t){dp="useDebugValue",mp()},useDeferredValue:function(e){return dp="useDeferredValue",mp(),ih(e)},useTransition:function(){return dp="useTransition",mp(),dh()},useMutableSource:function(e,t,n){dp="useMutableSource",mp()},useSyncExternalStore:function(e,t,n){return dp="useSyncExternalStore",mp(),$p(e,t,n)},useId:function(){return dp="useId",mp(),mh()},unstable_isNewReconciler:_},Eh={readContext:function(e){return sf(e)},useCallback:function(e,t){return dp="useCallback",gp(),nh(e,t)},useContext:function(e){return dp="useContext",gp(),sf(e)},useEffect:function(e,t){return dp="useEffect",gp(),qp(e,t)},useImperativeHandle:function(e,t,n){return dp="useImperativeHandle",gp(),Zp(e,t,n)},useInsertionEffect:function(e,t){return dp="useInsertionEffect",gp(),Wp(e,t)},useLayoutEffect:function(e,t){return dp="useLayoutEffect",gp(),Kp(e,t)},useMemo:function(e,t){dp="useMemo",gp();var n=tp.current;tp.current=Oh;try{return oh(e,t)}finally{tp.current=n}},useReducer:function(e,t,n){dp="useReducer",gp();var r=tp.current;tp.current=Oh;try{return Pp(e,t,n)}finally{tp.current=r}},useRef:function(e){return dp="useRef",gp(),Up(e)},useState:function(e){dp="useState",gp();var t=tp.current;tp.current=Oh;try{return Lp(e)}finally{tp.current=t}},useDebugValue:function(e,t){dp="useDebugValue",gp()},useDeferredValue:function(e){return dp="useDeferredValue",gp(),ih(e)},useTransition:function(){return dp="useTransition",gp(),dh()},useMutableSource:function(e,t,n){dp="useMutableSource",gp()},useSyncExternalStore:function(e,t,n){return dp="useSyncExternalStore",gp(),$p(e,t,n)},useId:function(){return dp="useId",gp(),mh()},unstable_isNewReconciler:_},kh={readContext:function(e){return sf(e)},useCallback:function(e,t){return dp="useCallback",gp(),rh(e,t)},useContext:function(e){return dp="useContext",gp(),sf(e)},useEffect:function(e,t){return dp="useEffect",gp(),Gp(e,t)},useImperativeHandle:function(e,t,n){return dp="useImperativeHandle",gp(),Jp(e,t,n)},useInsertionEffect:function(e,t){return dp="useInsertionEffect",gp(),Yp(e,t)},useLayoutEffect:function(e,t){return dp="useLayoutEffect",gp(),Xp(e,t)},useMemo:function(e,t){dp="useMemo",gp();var n=tp.current;tp.current=Ah;try{return ah(e,t)}finally{tp.current=n}},useReducer:function(e,t,n){dp="useReducer",gp();var r=tp.current;tp.current=Ah;try{return Op(e)}finally{tp.current=r}},useRef:function(e){return dp="useRef",gp(),zp()},useState:function(e){dp="useState",gp();var t=tp.current;tp.current=Ah;try{return jp()}finally{tp.current=t}},useDebugValue:function(e,t){return dp="useDebugValue",gp(),th()},useDeferredValue:function(e){return dp="useDeferredValue",gp(),sh(e)},useTransition:function(){return dp="useTransition",gp(),fh()},useMutableSource:function(e,t,n){dp="useMutableSource",gp()},useSyncExternalStore:function(e,t,n){return dp="useSyncExternalStore",gp(),Rp(e,t)},useId:function(){return dp="useId",gp(),gh()},unstable_isNewReconciler:_},Ph={readContext:function(e){return sf(e)},useCallback:function(e,t){return dp="useCallback",gp(),rh(e,t)},useContext:function(e){return dp="useContext",gp(),sf(e)},useEffect:function(e,t){return dp="useEffect",gp(),Gp(e,t)},useImperativeHandle:function(e,t,n){return dp="useImperativeHandle",gp(),Jp(e,t,n)},useInsertionEffect:function(e,t){return dp="useInsertionEffect",gp(),Yp(e,t)},useLayoutEffect:function(e,t){return dp="useLayoutEffect",gp(),Xp(e,t)},useMemo:function(e,t){dp="useMemo",gp();var n=tp.current;tp.current=$h;try{return ah(e,t)}finally{tp.current=n}},useReducer:function(e,t,n){dp="useReducer",gp();var r=tp.current;tp.current=$h;try{return Ap(e)}finally{tp.current=r}},useRef:function(e){return dp="useRef",gp(),zp()},useState:function(e){dp="useState",gp();var t=tp.current;tp.current=$h;try{return Fp()}finally{tp.current=t}},useDebugValue:function(e,t){return dp="useDebugValue",gp(),th()},useDeferredValue:function(e){return dp="useDeferredValue",gp(),lh(e)},useTransition:function(){return dp="useTransition",gp(),ph()},useMutableSource:function(e,t,n){dp="useMutableSource",gp()},useSyncExternalStore:function(e,t,n){return dp="useSyncExternalStore",gp(),Rp(e,t)},useId:function(){return dp="useId",gp(),gh()},unstable_isNewReconciler:_},Oh={readContext:function(e){return Rh(),sf(e)},useCallback:function(e,t){return dp="useCallback",Ih(),mp(),nh(e,t)},useContext:function(e){return dp="useContext",Ih(),mp(),sf(e)},useEffect:function(e,t){return dp="useEffect",Ih(),mp(),qp(e,t)},useImperativeHandle:function(e,t,n){return dp="useImperativeHandle",Ih(),mp(),Zp(e,t,n)},useInsertionEffect:function(e,t){return dp="useInsertionEffect",Ih(),mp(),Wp(e,t)},useLayoutEffect:function(e,t){return dp="useLayoutEffect",Ih(),mp(),Kp(e,t)},useMemo:function(e,t){dp="useMemo",Ih(),mp();var n=tp.current;tp.current=Oh;try{return oh(e,t)}finally{tp.current=n}},useReducer:function(e,t,n){dp="useReducer",Ih(),mp();var r=tp.current;tp.current=Oh;try{return Pp(e,t,n)}finally{tp.current=r}},useRef:function(e){return dp="useRef",Ih(),mp(),Up(e)},useState:function(e){dp="useState",Ih(),mp();var t=tp.current;tp.current=Oh;try{return Lp(e)}finally{tp.current=t}},useDebugValue:function(e,t){dp="useDebugValue",Ih(),mp()},useDeferredValue:function(e){return dp="useDeferredValue",Ih(),mp(),ih(e)},useTransition:function(){return dp="useTransition",Ih(),mp(),dh()},useMutableSource:function(e,t,n){dp="useMutableSource",Ih(),mp()},useSyncExternalStore:function(e,t,n){return dp="useSyncExternalStore",Ih(),mp(),$p(e,t,n)},useId:function(){return dp="useId",Ih(),mp(),mh()},unstable_isNewReconciler:_},Ah={readContext:function(e){return Rh(),sf(e)},useCallback:function(e,t){return dp="useCallback",Ih(),gp(),rh(e,t)},useContext:function(e){return dp="useContext",Ih(),gp(),sf(e)},useEffect:function(e,t){return dp="useEffect",Ih(),gp(),Gp(e,t)},useImperativeHandle:function(e,t,n){return dp="useImperativeHandle",Ih(),gp(),Jp(e,t,n)},useInsertionEffect:function(e,t){return dp="useInsertionEffect",Ih(),gp(),Yp(e,t)},useLayoutEffect:function(e,t){return dp="useLayoutEffect",Ih(),gp(),Xp(e,t)},useMemo:function(e,t){dp="useMemo",Ih(),gp();var n=tp.current;tp.current=Ah;try{return ah(e,t)}finally{tp.current=n}},useReducer:function(e,t,n){dp="useReducer",Ih(),gp();var r=tp.current;tp.current=Ah;try{return Op(e)}finally{tp.current=r}},useRef:function(e){return dp="useRef",Ih(),gp(),zp()},useState:function(e){dp="useState",Ih(),gp();var t=tp.current;tp.current=Ah;try{return jp()}finally{tp.current=t}},useDebugValue:function(e,t){return dp="useDebugValue",Ih(),gp(),th()},useDeferredValue:function(e){return dp="useDeferredValue",Ih(),gp(),sh(e)},useTransition:function(){return dp="useTransition",Ih(),gp(),fh()},useMutableSource:function(e,t,n){dp="useMutableSource",Ih(),gp()},useSyncExternalStore:function(e,t,n){return dp="useSyncExternalStore",Ih(),gp(),Rp(e,t)},useId:function(){return dp="useId",Ih(),gp(),gh()},unstable_isNewReconciler:_},$h={readContext:function(e){return Rh(),sf(e)},useCallback:function(e,t){return dp="useCallback",Ih(),gp(),rh(e,t)},useContext:function(e){return dp="useContext",Ih(),gp(),sf(e)},useEffect:function(e,t){return dp="useEffect",Ih(),gp(),Gp(e,t)},useImperativeHandle:function(e,t,n){return dp="useImperativeHandle",Ih(),gp(),Jp(e,t,n)},useInsertionEffect:function(e,t){return dp="useInsertionEffect",Ih(),gp(),Yp(e,t)},useLayoutEffect:function(e,t){return dp="useLayoutEffect",Ih(),gp(),Xp(e,t)},useMemo:function(e,t){dp="useMemo",Ih(),gp();var n=tp.current;tp.current=Ah;try{return ah(e,t)}finally{tp.current=n}},useReducer:function(e,t,n){dp="useReducer",Ih(),gp();var r=tp.current;tp.current=Ah;try{return Ap(e)}finally{tp.current=r}},useRef:function(e){return dp="useRef",Ih(),gp(),zp()},useState:function(e){dp="useState",Ih(),gp();var t=tp.current;tp.current=Ah;try{return Fp()}finally{tp.current=t}},useDebugValue:function(e,t){return dp="useDebugValue",Ih(),gp(),th()},useDeferredValue:function(e){return dp="useDeferredValue",Ih(),gp(),lh(e)},useTransition:function(){return dp="useTransition",Ih(),gp(),ph()},useMutableSource:function(e,t,n){dp="useMutableSource",Ih(),gp()},useSyncExternalStore:function(e,t,n){return dp="useSyncExternalStore",Ih(),gp(),Rp(e,t)},useId:function(){return dp="useId",Ih(),gp(),gh()},unstable_isNewReconciler:_};var Ch=t.unstable_now,Dh=0,Nh=-1,Mh=-1,Lh=-1,jh=!1,Fh=!1;function Bh(){return jh}function Uh(){return Dh}function zh(){Dh=Ch()}function Vh(e){Mh=Ch(),e.actualStartTime<0&&(e.actualStartTime=Ch())}function Hh(e){Mh=-1}function qh(e,t){if(Mh>=0){var n=Ch()-Mh;e.actualDuration+=n,t&&(e.selfBaseDuration=n),Mh=-1}}function Gh(e){if(Nh>=0){var t=Ch()-Nh;Nh=-1;for(var n=e.return;null!==n;){switch(n.tag){case 3:return void(n.stateNode.effectDuration+=t);case u:return void(n.stateNode.effectDuration+=t)}n=n.return}}}function Wh(e){if(Lh>=0){var t=Ch()-Lh;Lh=-1;for(var n=e.return;null!==n;){switch(n.tag){case 3:var r=n.stateNode;return void(null!==r&&(r.passiveEffectDuration+=t));case u:var o=n.stateNode;return void(null!==o&&(o.passiveEffectDuration+=t))}n=n.return}}}function Yh(){Nh=Ch()}function Kh(){Lh=Ch()}function Xh(e){for(var t=e.child;t;)e.actualDuration+=t.actualDuration,t=t.sibling}function Qh(e,t){if(e&&e.defaultProps){var n=we({},t),r=e.defaultProps;for(var o in r)void 0===n[o]&&(n[o]=r[o]);return n}return t}var Zh,Jh,em,tm,nm,rm,om,am,im,sm,lm,um={};Zh=new Set,Jh=new Set,em=new Set,tm=new Set,am=new Set,nm=new Set,im=new Set,sm=new Set,lm=new Set;var cm=new Set;function dm(e,t,n,r){var o=e.memoizedState,a=n(r,o);if(8&e.mode){Qr(!0);try{a=n(r,o)}finally{Qr(!1)}}rm(t,a);var i=null==a?o:we({},o,a);(e.memoizedState=i,0===e.lanes)&&(e.updateQueue.baseState=i)}om=function(e,t){if(null!==e&&"function"!=typeof e){var n=t+"_"+e;cm.has(n)||(cm.add(n),a("%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.",t,e))}},rm=function(e,t){if(void 0===t){var n=Me(e)||"Component";nm.has(n)||(nm.add(n),a("%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.",n))}},Object.defineProperty(um,"_processChildContext",{enumerable:!1,value:function(){throw new Error("_processChildContext is not available in React 16+. This likely means you have multiple copies of React and are attempting to nest a React 15 tree inside a React 16 tree using unstable_renderSubtreeIntoContainer, which isn't supported. Try to make sure you have only one copy of React (and ideally, switch to ReactDOM.createPortal).")}}),Object.freeze(um);var fm={isMounted:function(e){var t=xr.current;if(null!==t&&1===t.tag){var n=t,r=n.stateNode;r._warnedAboutRefsInRender||a("%s is accessing isMounted inside its render() function. render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.",je(n)||"A component"),r._warnedAboutRefsInRender=!0}var o=er(e);return!!o&&Tr(o)===o},enqueueSetState:function(e,t,n){var r=er(e),o=Ly(),a=jy(r),i=wf(o,a);i.payload=t,null!=n&&(om(n,"setState"),i.callback=n);var s=Sf(r,i,a);null!==s&&(By(s,r,a,o),xf(s,r,a)),go(r,a)},enqueueReplaceState:function(e,t,n){var r=er(e),o=Ly(),a=jy(r),i=wf(o,a);i.tag=1,i.payload=t,null!=n&&(om(n,"replaceState"),i.callback=n);var s=Sf(r,i,a);null!==s&&(By(s,r,a,o),xf(s,r,a)),go(r,a)},enqueueForceUpdate:function(e,t){var n=er(e),r=Ly(),o=jy(n),a=wf(r,o);a.tag=bf,null!=t&&(om(t,"forceUpdate"),a.callback=t);var i=Sf(n,a,o);null!==i&&(By(i,n,o,r),xf(i,n,o)),function(e,t){null!==Yr&&"function"==typeof Yr.markForceUpdateScheduled&&Yr.markForceUpdateScheduled(e,t)}(n,o)}};function pm(e,t,n,r,o,i,s){var l=e.stateNode;if("function"==typeof l.shouldComponentUpdate){var u=l.shouldComponentUpdate(r,i,s);if(8&e.mode){Qr(!0);try{u=l.shouldComponentUpdate(r,i,s)}finally{Qr(!1)}}return void 0===u&&a("%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.",Me(t)||"Component"),u}return!t.prototype||!t.prototype.isPureReactComponent||(!As(n,r)||!As(o,i))}function hm(e,t){var n;t.updater=fm,e.stateNode=t,n=e,t._reactInternals=n,t._reactInternalInstance=um}function mm(e,t,n){var r=!1,o=cc,i=cc,s=t.contextType;if("contextType"in t&&(!(null===s||void 0!==s&&s.$$typeof===ae&&void 0===s._context)&&!sm.has(t))){sm.add(t);var l="";l=void 0===s?" However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file.":"object"!=typeof s?" However, it is set to a "+typeof s+".":s.$$typeof===oe?" Did you accidentally pass the Context.Provider instead?":void 0!==s._context?" Did you accidentally pass the Context.Consumer instead?":" However, it is set to an object with keys {"+Object.keys(s).join(", ")+"}.",a("%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s",Me(t)||"Component",l)}if("object"==typeof s&&null!==s)i=sf(s);else{o=hc(0,t,!0);var u=t.contextTypes;i=(r=null!=u)?gc(e,o):cc}var c=new t(n,i);if(8&e.mode){Qr(!0);try{c=new t(n,i)}finally{Qr(!1)}}var d=e.memoizedState=null!==c.state&&void 0!==c.state?c.state:null;if(hm(e,c),"function"==typeof t.getDerivedStateFromProps&&null===d){var f=Me(t)||"Component";Jh.has(f)||(Jh.add(f),a("`%s` uses `getDerivedStateFromProps` but its initial state is %s. This is not recommended. Instead, define the initial state by assigning an object to `this.state` in the constructor of `%s`. This ensures that `getDerivedStateFromProps` arguments have a consistent shape.",f,null===c.state?"null":"undefined",f))}if("function"==typeof t.getDerivedStateFromProps||"function"==typeof c.getSnapshotBeforeUpdate){var p=null,h=null,m=null;if("function"==typeof c.componentWillMount&&!0!==c.componentWillMount.__suppressDeprecationWarning?p="componentWillMount":"function"==typeof c.UNSAFE_componentWillMount&&(p="UNSAFE_componentWillMount"),"function"==typeof c.componentWillReceiveProps&&!0!==c.componentWillReceiveProps.__suppressDeprecationWarning?h="componentWillReceiveProps":"function"==typeof c.UNSAFE_componentWillReceiveProps&&(h="UNSAFE_componentWillReceiveProps"),"function"==typeof c.componentWillUpdate&&!0!==c.componentWillUpdate.__suppressDeprecationWarning?m="componentWillUpdate":"function"==typeof c.UNSAFE_componentWillUpdate&&(m="UNSAFE_componentWillUpdate"),null!==p||null!==h||null!==m){var g=Me(t)||"Component",b="function"==typeof t.getDerivedStateFromProps?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";tm.has(g)||(tm.add(g),a("Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n%s uses %s but also contains the following legacy lifecycles:%s%s%s\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://reactjs.org/link/unsafe-component-lifecycles",g,b,null!==p?"\n "+p:"",null!==h?"\n "+h:"",null!==m?"\n "+m:""))}}return r&&mc(e,o,i),c}function gm(e,t,n,r){var o=t.state;if("function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==o){var i=je(e)||"Component";Zh.has(i)||(Zh.add(i),a("%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.",i)),fm.enqueueReplaceState(t,t.state,null)}}function bm(e,t,n,r){!function(e,t,n){var r=e.stateNode,o=Me(t)||"Component";r.render||(t.prototype&&"function"==typeof t.prototype.render?a("%s(...): No `render` method found on the returned component instance: did you accidentally return an object from the constructor?",o):a("%s(...): No `render` method found on the returned component instance: you may have forgotten to define `render`.",o)),!r.getInitialState||r.getInitialState.isReactClassApproved||r.state||a("getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?",o),r.getDefaultProps&&!r.getDefaultProps.isReactClassApproved&&a("getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.",o),r.propTypes&&a("propTypes was defined as an instance property on %s. Use a static property to define propTypes instead.",o),r.contextType&&a("contextType was defined as an instance property on %s. Use a static property to define contextType instead.",o),!t.childContextTypes||lm.has(t)||8&e.mode||(lm.add(t),a("%s uses the legacy childContextTypes API which is no longer supported and will be removed in the next major release. Use React.createContext() instead\n\n.Learn more about this warning here: https://reactjs.org/link/legacy-context",o)),!t.contextTypes||lm.has(t)||8&e.mode||(lm.add(t),a("%s uses the legacy contextTypes API which is no longer supported and will be removed in the next major release. Use React.createContext() with static contextType instead.\n\nLearn more about this warning here: https://reactjs.org/link/legacy-context",o)),r.contextTypes&&a("contextTypes was defined as an instance property on %s. Use a static property to define contextTypes instead.",o),t.contextType&&t.contextTypes&&!im.has(t)&&(im.add(t),a("%s declares both contextTypes and contextType static properties. The legacy contextTypes property will be ignored.",o)),"function"==typeof r.componentShouldUpdate&&a("%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.",o),t.prototype&&t.prototype.isPureReactComponent&&void 0!==r.shouldComponentUpdate&&a("%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.",Me(t)||"A pure component"),"function"==typeof r.componentDidUnmount&&a("%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?",o),"function"==typeof r.componentDidReceiveProps&&a("%s has a method called componentDidReceiveProps(). But there is no such lifecycle method. If you meant to update the state in response to changing props, use componentWillReceiveProps(). If you meant to fetch data or run side-effects or mutations after React has updated the UI, use componentDidUpdate().",o),"function"==typeof r.componentWillRecieveProps&&a("%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?",o),"function"==typeof r.UNSAFE_componentWillRecieveProps&&a("%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?",o);var i=r.props!==n;void 0!==r.props&&i&&a("%s(...): When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.",o,o),r.defaultProps&&a("Setting defaultProps as an instance property on %s is not supported and will be ignored. Instead, define defaultProps as a static property on %s.",o,o),"function"!=typeof r.getSnapshotBeforeUpdate||"function"==typeof r.componentDidUpdate||em.has(t)||(em.add(t),a("%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.",Me(t))),"function"==typeof r.getDerivedStateFromProps&&a("%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.",o),"function"==typeof r.getDerivedStateFromError&&a("%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.",o),"function"==typeof t.getSnapshotBeforeUpdate&&a("%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.",o);var s=r.state;s&&("object"!=typeof s||vt(s))&&a("%s.state: must be set to an object or null",o),"function"==typeof r.getChildContext&&"object"!=typeof t.childContextTypes&&a("%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().",o)}(e,t,n);var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs={},_f(e);var i=t.contextType;if("object"==typeof i&&null!==i)o.context=sf(i);else{var s=hc(0,t,!0);o.context=gc(e,s)}if(o.state===n){var l=Me(t)||"Component";am.has(l)||(am.add(l),a("%s: It is not recommended to assign props directly to state because updates to props won't be reflected in state. In most cases, it is better to use props directly.",l))}8&e.mode&&wd.recordLegacyContextWarning(e,o),wd.recordUnsafeLifecycleWarnings(e,o),o.state=e.memoizedState;var u=t.getDerivedStateFromProps;if("function"==typeof u&&(dm(e,t,u,n),o.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof o.getSnapshotBeforeUpdate||"function"!=typeof o.UNSAFE_componentWillMount&&"function"!=typeof o.componentWillMount||(!function(e,t){var n=t.state;"function"==typeof t.componentWillMount&&t.componentWillMount(),"function"==typeof t.UNSAFE_componentWillMount&&t.UNSAFE_componentWillMount(),n!==t.state&&(a("%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.",je(e)||"Component"),fm.enqueueReplaceState(t,t.state,null))}(e,o),kf(e,n,o,r),o.state=e.memoizedState),"function"==typeof o.componentDidMount){var c=4;c|=mr,0!==(e.mode&bo)&&(c|=gr),e.flags|=c}}function ym(e,t){return{value:e,source:t,stack:De(t),digest:null}}function _m(e,t,n){return{value:e,source:null,stack:null!=n?n:null,digest:null!=t?t:null}}function vm(e,t){try{0;var n=t.value,r=t.source,o=t.stack,a=null!==o?o:"";if(null!=n&&n._suppressLogging){if(1===e.tag)return;console.error(n)}var i=r?je(r):null,s=(i?"The above error occurred in the <"+i+"> component:":"The above error occurred in one of your React components:")+"\n"+a+"\n\n"+(3===e.tag?"Consider adding an error boundary to your tree to customize error handling behavior.\nVisit https://reactjs.org/link/error-boundaries to learn more about error boundaries.":"React will try to recreate this component tree from scratch using the error boundary you provided, "+(je(e)||"Anonymous")+".");console.error(s)}catch(rw){setTimeout(function(){throw rw})}}var wm="function"==typeof WeakMap?WeakMap:Map;function Sm(e,t,n){var r=wf(ea,n);r.tag=3,r.payload={element:null};var o=t.value;return r.callback=function(){f_(o),vm(e,t)},r}function xm(e,t,n){var r=wf(ea,n);r.tag=3;var o=e.type.getDerivedStateFromError;if("function"==typeof o){var i=t.value;r.payload=function(){return o(i)},r.callback=function(){F_(e),vm(e,t)}}var s=e.stateNode;return null!==s&&"function"==typeof s.componentDidCatch&&(r.callback=function(){var n;F_(e),vm(e,t),"function"!=typeof o&&(n=this,null===_y?_y=new Set([n]):_y.add(n));var r=t.value,i=t.stack;this.componentDidCatch(r,{componentStack:null!==i?i:""}),"function"!=typeof o&&(ga(e.lanes,So)||a("%s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.",je(e)||"Unknown"))}),r}function Tm(e,t,n){var r,o=e.pingCache;if(null===o?(o=e.pingCache=new wm,r=new Set,o.set(t,r)):void 0===(r=o.get(t))&&(r=new Set,o.set(t,r)),!r.has(n)){r.add(n);var a=m_.bind(null,e,t,n);Xr&&k_(e,n),t.then(a,a)}}function Em(e){var t=e;do{if(t.tag===c&&Yf(t))return t;t=t.return}while(null!==t);return null}function km(e,t,n,r,o){if(!(1&e.mode)){if(e===t)e.flags|=dr;else{if(e.flags|=nr,n.flags|=fr,n.flags&=-52805,1===n.tag)if(null===n.alternate)n.tag=p;else{var a=wf(ea,So);a.tag=bf,Sf(n,a,So)}n.lanes=ya(n.lanes,So)}return e}return e.flags|=dr,e.lanes=o,e}function Pm(e,t,n,r,o){if(n.flags|=cr,Xr&&k_(e,o),null!==r&&"object"==typeof r&&"function"==typeof r.then){var a=r;!function(e){var t=e.tag;if(!(1&e.mode||0!==t&&t!==l&&t!==f)){var n=e.alternate;n?(e.updateQueue=n.updateQueue,e.memoizedState=n.memoizedState,e.lanes=n.lanes):(e.updateQueue=null,e.memoizedState=null)}}(n),yd()&&1&n.mode&&Jc();var i=Em(t);if(null!==i)return i.flags&=-257,km(i,t,n,0,o),1&i.mode&&Tm(e,a,o),void function(e,t,n){var r=e.updateQueue;if(null===r){var o=new Set;o.add(n),e.updateQueue=o}else r.add(n)}(i,0,a);if(0===(o&So))return Tm(e,a,o),void r_();r=new Error("A component suspended while responding to synchronous input. This will cause the UI to be replaced with a loading indicator. To fix, updates that suspend should be wrapped with startTransition.")}else if(yd()&&1&n.mode){Jc();var s=Em(t);if(null!==s)return 0===(s.flags&dr)&&(s.flags|=rr),km(s,t,n,0,o),void _d(ym(r,n))}!function(e){ry!==Yb&&(ry=Gb);null===ly?ly=[e]:ly.push(e)}(r=ym(r,n));var u=t;do{switch(u.tag){case 3:var c=r;u.flags|=dr;var d=pa(o);return u.lanes=ya(u.lanes,d),void Tf(u,Sm(u,c,d));case 1:var p=r,h=u.type,m=u.stateNode;if(0===(u.flags&nr)&&("function"==typeof h.getDerivedStateFromError||null!==m&&"function"==typeof m.componentDidCatch&&!d_(m))){u.flags|=dr;var g=pa(o);return u.lanes=ya(u.lanes,g),void Tf(u,xm(u,p,g))}}u=u.return}while(null!==u)}var Om,Am,$m,Rm,Im,Cm,Dm,Nm,Mm,Lm=n.ReactCurrentOwner,jm=!1;function Fm(e,t,n,r){t.child=null===e?Hd(t,null,n,r):Vd(t,e.child,n,r)}function Bm(e,t,n,r,o){if(t.type!==t.elementType){var a=n.propTypes;a&&nc(a,r,"prop",Me(n))}var i,s,l=n.render,u=t.ref;if(af(t,o),to(t),Lm.current=t,Ge(!0),i=vp(e,t,l,r,u,o),s=wp(),8&t.mode){Qr(!0);try{i=vp(e,t,l,r,u,o),s=wp()}finally{Qr(!1)}}return Ge(!1),no(),null===e||jm?(yd()&&s&&Hc(t),t.flags|=1,Fm(e,t,i,o),t.child):(Sp(e,t,o),bg(e,t,o))}function Um(e,t,n,r,o){if(null===e){var i=n.type;if(function(e){return"function"==typeof e&&!Y_(e)&&void 0===e.defaultProps}(i)&&null===n.compare&&void 0===n.defaultProps){var s;return s=N_(i),t.tag=f,t.type=s,Qm(t,i),zm(e,t,s,r,o)}var l=i.propTypes;if(l&&nc(l,r,"prop",Me(i)),void 0!==n.defaultProps){var u=Me(i)||"Unknown";Mm[u]||(a("%s: Support for defaultProps will be removed from memo components in a future major release. Use JavaScript default parameters instead.",u),Mm[u]=!0)}var c=Q_(n.type,null,r,t,t.mode,o);return c.ref=t.ref,c.return=t,t.child=c,c}var d=n.type,p=d.propTypes;p&&nc(p,r,"prop",Me(d));var h=e.child;if(!yg(e,o)){var m=h.memoizedProps,g=n.compare;if((g=null!==g?g:As)(m,r)&&e.ref===t.ref)return bg(e,t,o)}t.flags|=1;var b=K_(h,r);return b.ref=t.ref,b.return=t,t.child=b,b}function zm(e,t,n,r,o){if(t.type!==t.elementType){var a=t.elementType;if(a.$$typeof===ce){var i=a,s=i._payload,l=i._init;try{a=l(s)}catch(d){a=null}var u=a&&a.propTypes;u&&nc(u,r,"prop",Me(a))}}if(null!==e){var c=e.memoizedProps;if(As(c,r)&&e.ref===t.ref&&t.type===e.type){if(jm=!1,t.pendingProps=r=c,!yg(e,o))return t.lanes=e.lanes,bg(e,t,o);0!==(e.flags&fr)&&(jm=!0)}}return qm(e,t,n,r,o)}function Vm(e,t,n){var r,o=t.pendingProps,a=o.children,i=null!==e?e.memoizedState:null;if("hidden"===o.mode)if(1&t.mode){if(!ga(n,Zo)){var s;if(null!==i)s=ya(i.baseLanes,n);else s=n;t.lanes=t.childLanes=Zo;var l={baseLanes:s,cachePool:null,transitions:null};return t.memoizedState=l,t.updateQueue=null,Xy(t,s),null}var u={baseLanes:0,cachePool:null,transitions:null};t.memoizedState=u,Xy(t,null!==i?i.baseLanes:n)}else{var c={baseLanes:0,cachePool:null,transitions:null};t.memoizedState=c,Xy(t,n)}else null!==i?(r=ya(i.baseLanes,n),t.memoizedState=null):r=n,Xy(t,r);return Fm(e,t,a,n),t.child}function Hm(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=or,t.flags|=hr)}function qm(e,t,n,r,o){if(t.type!==t.elementType){var a=n.propTypes;a&&nc(a,r,"prop",Me(n))}var i,s,l;if(i=gc(t,hc(0,n,!0)),af(t,o),to(t),Lm.current=t,Ge(!0),s=vp(e,t,n,r,i,o),l=wp(),8&t.mode){Qr(!0);try{s=vp(e,t,n,r,i,o),l=wp()}finally{Qr(!1)}}return Ge(!1),no(),null===e||jm?(yd()&&l&&Hc(t),t.flags|=1,Fm(e,t,s,o),t.child):(Sp(e,t,o),bg(e,t,o))}function Gm(e,t,n,r,o){switch(yv(t)){case!1:var i=t.stateNode,s=new(0,t.type)(t.memoizedProps,i.context).state;i.updater.enqueueSetState(i,s,null);break;case!0:t.flags|=nr,t.flags|=dr;var l=new Error("Simulated error coming from DevTools"),u=pa(o);t.lanes=ya(t.lanes,u),Tf(t,xm(t,ym(l,t),u))}if(t.type!==t.elementType){var c=n.propTypes;c&&nc(c,r,"prop",Me(n))}var d,f;yc(n)?(d=!0,xc(t)):d=!1,af(t,o),null===t.stateNode?(gg(e,t),mm(t,n,r),bm(t,n,r,o),f=!0):f=null===e?function(e,t,n,r){var o=e.stateNode,a=e.memoizedProps;o.props=a;var i=o.context,s=t.contextType,l=cc;l="object"==typeof s&&null!==s?sf(s):gc(e,hc(0,t,!0));var u=t.getDerivedStateFromProps,c="function"==typeof u||"function"==typeof o.getSnapshotBeforeUpdate;c||"function"!=typeof o.UNSAFE_componentWillReceiveProps&&"function"!=typeof o.componentWillReceiveProps||a===n&&i===l||gm(e,o,n,l),Of();var d=e.memoizedState,f=o.state=d;if(kf(e,n,o,r),f=e.memoizedState,a===n&&d===f&&!bc()&&!Af()){if("function"==typeof o.componentDidMount){var p=4;p|=mr,0!==(e.mode&bo)&&(p|=gr),e.flags|=p}return!1}"function"==typeof u&&(dm(e,t,u,n),f=e.memoizedState);var h=Af()||pm(e,t,a,n,d,f,l);if(h){if(c||"function"!=typeof o.UNSAFE_componentWillMount&&"function"!=typeof o.componentWillMount||("function"==typeof o.componentWillMount&&o.componentWillMount(),"function"==typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount()),"function"==typeof o.componentDidMount){var m=4;m|=mr,0!==(e.mode&bo)&&(m|=gr),e.flags|=m}}else{if("function"==typeof o.componentDidMount){var g=4;g|=mr,0!==(e.mode&bo)&&(g|=gr),e.flags|=g}e.memoizedProps=n,e.memoizedState=f}return o.props=n,o.state=f,o.context=l,h}(t,n,r,o):function(e,t,n,r,o){var a=t.stateNode;vf(e,t);var i=t.memoizedProps,s=t.type===t.elementType?i:Qh(t.type,i);a.props=s;var l=t.pendingProps,u=a.context,c=n.contextType,d=cc;d="object"==typeof c&&null!==c?sf(c):gc(t,hc(0,n,!0));var f=n.getDerivedStateFromProps,p="function"==typeof f||"function"==typeof a.getSnapshotBeforeUpdate;p||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||i===l&&u===d||gm(t,a,r,d),Of();var h=t.memoizedState,m=a.state=h;if(kf(t,r,a,o),m=t.memoizedState,i===l&&h===m&&!bc()&&!Af())return"function"==typeof a.componentDidUpdate&&(i===e.memoizedProps&&h===e.memoizedState||(t.flags|=4)),"function"==typeof a.getSnapshotBeforeUpdate&&(i===e.memoizedProps&&h===e.memoizedState||(t.flags|=ar)),!1;"function"==typeof f&&(dm(t,n,f,r),m=t.memoizedState);var g=Af()||pm(t,n,s,r,h,m,d)||v;return g?(p||"function"!=typeof a.UNSAFE_componentWillUpdate&&"function"!=typeof a.componentWillUpdate||("function"==typeof a.componentWillUpdate&&a.componentWillUpdate(r,m,d),"function"==typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(r,m,d)),"function"==typeof a.componentDidUpdate&&(t.flags|=4),"function"==typeof a.getSnapshotBeforeUpdate&&(t.flags|=ar)):("function"==typeof a.componentDidUpdate&&(i===e.memoizedProps&&h===e.memoizedState||(t.flags|=4)),"function"==typeof a.getSnapshotBeforeUpdate&&(i===e.memoizedProps&&h===e.memoizedState||(t.flags|=ar)),t.memoizedProps=r,t.memoizedState=m),a.props=r,a.state=m,a.context=d,g}(e,t,n,r,o);var p=Wm(e,t,n,f,d,o),h=t.stateNode;return f&&h.props!==r&&(Cm||a("It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.",je(t)||"a component"),Cm=!0),p}function Wm(e,t,n,r,o,a){Hm(e,t);var i=0!==(t.flags&nr);if(!r&&!i)return o&&Tc(t,n,!1),bg(e,t,a);var s,l=t.stateNode;if(Lm.current=t,i&&"function"!=typeof n.getDerivedStateFromError)s=null,Hh();else{if(to(t),Ge(!0),s=l.render(),8&t.mode){Qr(!0);try{l.render()}finally{Qr(!1)}}Ge(!1),no()}return t.flags|=1,null!==e&&i?function(e,t,n,r){t.child=Vd(t,e.child,null,r),t.child=Vd(t,null,n,r)}(e,t,s,a):Fm(e,t,s,a),t.memoizedState=l.state,o&&Tc(t,n,!0),t.child}function Ym(e){var t=e.stateNode;t.pendingContext?wc(e,t.pendingContext,t.pendingContext!==t.context):t.context&&wc(e,t.context,!1),Lf(e,t.containerInfo)}function Km(e,t,n,r,o){return gd(),_d(o),t.flags|=rr,Fm(e,t,n,r),t.child}function Xm(e,t,n,r){gg(e,t);var o=t.pendingProps,a=n,i=a._payload,s=(0,a._init)(i);t.type=s;var u=t.tag=function(e){if("function"==typeof e)return Y_(e)?1:0;if(null!=e){var t=e.$$typeof;if(t===ie)return l;if(t===ue)return d}return 2}(s),c=Qh(s,o);switch(u){case 0:return Qm(t,s),t.type=s=N_(s),qm(null,t,s,c,r);case 1:return t.type=s=M_(s),Gm(null,t,s,c,r);case l:return t.type=s=L_(s),Bm(null,t,s,c,r);case d:if(t.type!==t.elementType){var f=s.propTypes;f&&nc(f,c,"prop",Me(s))}return Um(null,t,s,Qh(s.type,c),r)}var p="";throw null!==s&&"object"==typeof s&&s.$$typeof===ce&&(p=" Did you wrap a component in React.lazy() more than once?"),new Error("Element type is invalid. Received a promise that resolves to: "+s+". Lazy element type must resolve to a class or function."+p)}function Qm(e,t){if(t&&t.childContextTypes&&a("%s(...): childContextTypes cannot be defined on a function component.",t.displayName||t.name||"Component"),null!==e.ref){var n="",r=ze();r&&(n+="\n\nCheck the render method of `"+r+"`.");var o=r||"",i=e._debugSource;i&&(o=i.fileName+":"+i.lineNumber),Im[o]||(Im[o]=!0,a("Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?%s",n))}if(void 0!==t.defaultProps){var s=Me(t)||"Unknown";Mm[s]||(a("%s: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.",s),Mm[s]=!0)}if("function"==typeof t.getDerivedStateFromProps){var l=Me(t)||"Unknown";Rm[l]||(a("%s: Function components do not support getDerivedStateFromProps.",l),Rm[l]=!0)}if("object"==typeof t.contextType&&null!==t.contextType){var u=Me(t)||"Unknown";$m[u]||(a("%s: Function components do not support contextType.",u),$m[u]=!0)}}Om={},Am={},$m={},Rm={},Im={},Cm=!1,Dm={},Nm={},Mm={};var Zm={dehydrated:null,treeContext:null,retryLane:0};function Jm(e){return{baseLanes:e,cachePool:null,transitions:null}}function eg(e,t,n){var r=t.pendingProps;_v(t)&&(t.flags|=nr);var o=zf.current,i=!1,s=0!==(t.flags&nr);if(s||function(e,t){return(null===t||null!==t.memoizedState)&&Vf(e,2)}(o,e)?(i=!0,t.flags&=-129):null!==e&&null===e.memoizedState||(o=o|1),Gf(t,o=Hf(o)),null===e){ud(t);var l=t.memoizedState;if(null!==l){var u=l.dehydrated;if(null!==u)return function(e,t){1&e.mode?Iu(t)?e.lanes=Eo:e.lanes=Zo:(a("Cannot hydrate Suspense in legacy mode. Switch from ReactDOM.hydrate(element, container) to ReactDOMClient.hydrateRoot(container, <App />).render(element) or remove the Suspense components from the server rendered components."),e.lanes=So);return null}(t,u)}var c=r.children,d=r.fallback;if(i){var f=function(e,t,n,r){var o,a,i=e.mode,s=e.child,l={mode:"hidden",children:t};1&i||null===s?(o=ng(l,i),a=J_(n,i,r,null)):((o=s).childLanes=0,o.pendingProps=l,2&e.mode&&(o.actualDuration=0,o.actualStartTime=-1,o.selfBaseDuration=0,o.treeBaseDuration=0),a=J_(n,i,r,null));return o.return=e,a.return=e,o.sibling=a,e.child=o,a}(t,c,d,n);return t.child.memoizedState=Jm(n),t.memoizedState=Zm,f}return tg(t,c)}var p=e.memoizedState;if(null!==p){var h=p.dehydrated;if(null!==h)return function(e,t,n,r,o,i,s){if(n){if(t.flags&rr)return t.flags&=-257,og(e,t,s,_m(new Error("There was an error while hydrating this Suspense boundary. Switched to client rendering.")));if(null!==t.memoizedState)return t.child=e.child,t.flags|=nr,null;var l=function(e,t,n,r,o){var a=t.mode,i={mode:"visible",children:n},s=ng(i,a),l=J_(r,a,o,null);l.flags|=2,s.return=t,l.return=t,s.sibling=l,t.child=s,!(1&t.mode)||Vd(t,e.child,null,o);return l}(e,t,r.children,r.fallback,s);return t.child.memoizedState=Jm(s),t.memoizedState=Zm,l}if(Xc&&a("We should not be hydrating here. This is a bug in React. Please file a bug."),!(1&t.mode))return og(e,t,s,null);if(Iu(o)){var u,c,d,f=function(e){var t,n,r,o=e.nextSibling&&e.nextSibling.dataset;return o&&(t=o.dgst,n=o.msg,r=o.stck),{message:n,digest:t,stack:r}}(o);return u=f.digest,c=f.message,d=f.stack,og(e,t,s,_m(c?new Error(c):new Error("The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering."),u,d))}var p=ga(s,e.childLanes);if(jm||p){var h=My();if(null!==h){var m=function(e,t){var n;switch(fa(t)){case To:n=xo;break;case ko:n=Eo;break;case 64:case 128:case 256:case 512:case Ao:case $o:case Ro:case Io:case Co:case Do:case No:case Mo:case Lo:case jo:case Fo:case Bo:case zo:case Vo:case Ho:case qo:case Go:n=Po;break;case Qo:n=Xo;break;default:n=0}return 0!==(n&(e.suspendedLanes|t))?0:n}(h,s);if(0!==m&&m!==i.retryLane){i.retryLane=m;var g=ea;df(e,m),By(h,e,m,g)}}return r_(),og(e,t,s,_m(new Error("This Suspense boundary received an update before it finished hydrating. This caused the boundary to switch to client rendering. The usual way to fix this is to wrap the original update in startTransition.")))}if(Ru(o)){t.flags|=nr,t.child=e.child;var b=b_.bind(null,e);return _=b,o._reactRetry=_,null}td(t,o,i.treeContext);var y=tg(t,r.children);return y.flags|=sr,y;var _}(e,t,s,r,h,p,n)}if(i){var m=r.fallback,g=function(e,t,n,r,o){var a,i,s=t.mode,l=e.child,u=l.sibling,c={mode:"hidden",children:n};if(1&s||t.child===l)(a=rg(l,c)).subtreeFlags=l.subtreeFlags&Sr;else{(a=t.child).childLanes=0,a.pendingProps=c,2&t.mode&&(a.actualDuration=0,a.actualStartTime=-1,a.selfBaseDuration=l.selfBaseDuration,a.treeBaseDuration=l.treeBaseDuration),t.deletions=null}null!==u?i=K_(u,r):(i=J_(r,s,o,null)).flags|=2;return i.return=t,a.return=t,a.sibling=i,t.child=a,i}(e,t,r.children,m,n),b=t.child,y=e.child.memoizedState;return b.memoizedState=null===y?Jm(n):function(e,t){return{baseLanes:ya(e.baseLanes,t),cachePool:null,transitions:e.transitions}}(y,n),b.childLanes=function(e,t){return _a(e.childLanes,t)}(e,n),t.memoizedState=Zm,g}var _=function(e,t,n,r){var o=e.child,a=o.sibling,i=rg(o,{mode:"visible",children:n});1&t.mode||(i.lanes=r);if(i.return=t,i.sibling=null,null!==a){var s=t.deletions;null===s?(t.deletions=[a],t.flags|=tr):s.push(a)}return t.child=i,i}(e,t,r.children,n);return t.memoizedState=null,_}function tg(e,t,n){var r=ng({mode:"visible",children:t},e.mode);return r.return=e,e.child=r,r}function ng(e,t,n){return ev(e,t,0,null)}function rg(e,t){return K_(e,t)}function og(e,t,n,r){null!==r&&_d(r),Vd(t,e.child,null,n);var o=tg(t,t.pendingProps.children);return o.flags|=2,t.memoizedState=null,o}function ag(e,t,n){e.lanes=ya(e.lanes,t);var r=e.alternate;null!==r&&(r.lanes=ya(r.lanes,t)),rf(e.return,t,n)}function ig(e,t){var n=vt(e),r=!n&&"function"==typeof pe(e);if(n||r){var o=n?"array":"iterable";return a("A nested %s was passed to row #%s in <SuspenseList />. Wrap it in an additional SuspenseList to configure its revealOrder: <SuspenseList revealOrder=...> ... <SuspenseList revealOrder=...>{%s}</SuspenseList> ... </SuspenseList>",o,t,o),!1}return!0}function sg(e,t,n,r,o){var a=e.memoizedState;null===a?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=o)}function lg(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail,s=r.children;!function(e){if(void 0!==e&&"forwards"!==e&&"backwards"!==e&&"together"!==e&&!Dm[e])if(Dm[e]=!0,"string"==typeof e)switch(e.toLowerCase()){case"together":case"forwards":case"backwards":a('"%s" is not a valid value for revealOrder on <SuspenseList />. Use lowercase "%s" instead.',e,e.toLowerCase());break;case"forward":case"backward":a('"%s" is not a valid value for revealOrder on <SuspenseList />. React uses the -s suffix in the spelling. Use "%ss" instead.',e,e.toLowerCase());break;default:a('"%s" is not a supported revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?',e)}else a('%s is not a supported value for revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?',e)}(o),function(e,t){void 0===e||Nm[e]||("collapsed"!==e&&"hidden"!==e?(Nm[e]=!0,a('"%s" is not a supported value for tail on <SuspenseList />. Did you mean "collapsed" or "hidden"?',e)):"forwards"!==t&&"backwards"!==t&&(Nm[e]=!0,a('<SuspenseList tail="%s" /> is only valid if revealOrder is "forwards" or "backwards". Did you mean to specify revealOrder="forwards"?',e)))}(i,o),function(e,t){if(("forwards"===t||"backwards"===t)&&null!=e&&!1!==e)if(vt(e)){for(var n=0;n<e.length;n++)if(!ig(e[n],n))return}else{var r=pe(e);if("function"==typeof r){var o=r.call(e);if(o)for(var i=o.next(),s=0;!i.done;i=o.next()){if(!ig(i.value,s))return;s++}}else a('A single row was passed to a <SuspenseList revealOrder="%s" />. This is not useful since it needs multiple rows. Did you mean to pass multiple children or an array?',t)}}(s,o),Fm(e,t,s,n);var l=zf.current;Vf(l,2)?(l=qf(l,2),t.flags|=nr):(null!==e&&0!==(e.flags&nr)&&function(e,t,n){for(var r=t;null!==r;){if(r.tag===c)null!==r.memoizedState&&ag(r,n,e);else if(r.tag===m)ag(r,n,e);else if(null!==r.child){r.child.return=r,r=r.child;continue}if(r===e)return;for(;null===r.sibling;){if(null===r.return||r.return===e)return;r=r.return}r.sibling.return=r.return,r=r.sibling}}(t,t.child,n),l=Hf(l));if(Gf(t,l),1&t.mode)switch(o){case"forwards":var u,d=function(e){for(var t=e,n=null;null!==t;){var r=t.alternate;null!==r&&null===Kf(r)&&(n=t),t=t.sibling}return n}(t.child);null===d?(u=t.child,t.child=null):(u=d.sibling,d.sibling=null),sg(t,!1,u,d,i);break;case"backwards":var f=null,p=t.child;for(t.child=null;null!==p;){var h=p.alternate;if(null!==h&&null===Kf(h)){t.child=p;break}var g=p.sibling;p.sibling=f,f=p,p=g}sg(t,!0,f,null,i);break;case"together":sg(t,!1,null,null,void 0);break;default:t.memoizedState=null}else t.memoizedState=null;return t.child}var ug=!1;var cg,dg,fg,pg,hg=!1;function mg(){jm=!0}function gg(e,t){1&t.mode||null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function bg(e,t,n){return null!==e&&(t.dependencies=e.dependencies),Hh(),n_(t.lanes),ga(n,t.childLanes)?(function(e,t){if(null!==e&&t.child!==e.child)throw new Error("Resuming work not yet implemented.");if(null!==t.child){var n=t.child,r=K_(n,n.pendingProps);for(t.child=r,r.return=t;null!==n.sibling;)n=n.sibling,(r=r.sibling=K_(n,n.pendingProps)).return=t;r.sibling=null}}(e,t),t.child):null}function yg(e,t){return!!ga(e.lanes,t)}function _g(e,t,n){if(t._debugNeedsRemount&&null!==e)return function(e,t,n){var r=t.return;if(null===r)throw new Error("Cannot swap the root fiber.");if(e.alternate=null,t.alternate=null,n.index=t.index,n.sibling=t.sibling,n.return=t.return,n.ref=t.ref,t===r.child)r.child=n;else{var o=r.child;if(null===o)throw new Error("Expected parent to have a child.");for(;o.sibling!==t;)if(null===(o=o.sibling))throw new Error("Expected to find the previous sibling.");o.sibling=n}var a=r.deletions;return null===a?(r.deletions=[e],r.flags|=tr):a.push(e),n.flags|=2,n}(e,t,Q_(t.type,t.key,t.pendingProps,t._debugOwner||null,t.mode,t.lanes));if(null!==e)if(e.memoizedProps!==t.pendingProps||bc()||t.type!==e.type)jm=!0;else{if(!yg(e,n)&&0===(t.flags&nr))return jm=!1,function(e,t,n){switch(t.tag){case 3:Ym(t),t.stateNode,gd();break;case 5:Bf(t);break;case 1:yc(t.type)&&xc(t);break;case 4:Lf(t,t.stateNode.containerInfo);break;case s:var r=t.memoizedProps.value;tf(t,t.type._context,r);break;case u:ga(n,t.childLanes)&&(t.flags|=4);var o=t.stateNode;o.effectDuration=0,o.passiveEffectDuration=0;break;case c:var a=t.memoizedState;if(null!==a){if(null!==a.dehydrated)return Gf(t,Hf(zf.current)),t.flags|=nr,null;if(ga(n,t.child.childLanes))return eg(e,t,n);Gf(t,Hf(zf.current));var i=bg(e,t,n);return null!==i?i.sibling:null}Gf(t,Hf(zf.current));break;case m:var l=0!==(e.flags&nr),d=ga(n,t.childLanes);if(l){if(d)return lg(e,t,n);t.flags|=nr}var f=t.memoizedState;if(null!==f&&(f.rendering=null,f.tail=null,f.lastEffect=null),Gf(t,zf.current),d)break;return null;case b:case y:return t.lanes=0,Vm(e,t,n)}return bg(e,t,n)}(e,t,n);jm=0!==(e.flags&fr)}else if(jm=!1,yd()&&function(e){return Wc(),0!==(e.flags&pr)}(t)){var r=t.index;Vc(t,(Wc(),Nc),r)}switch(t.lanes=0,t.tag){case 2:return function(e,t,n,r){gg(e,t);var o,i,s,l=t.pendingProps;if(o=gc(t,hc(0,n,!1)),af(t,r),to(t),n.prototype&&"function"==typeof n.prototype.render){var u=Me(n)||"Unknown";Om[u]||(a("The <%s /> component appears to have a render method, but doesn't extend React.Component. This is likely to cause errors. Change %s to extend React.Component instead.",u,u),Om[u]=!0)}if(8&t.mode&&wd.recordLegacyContextWarning(t,null),Ge(!0),Lm.current=t,i=vp(null,t,n,l,o,r),s=wp(),Ge(!1),no(),t.flags|=1,"object"==typeof i&&null!==i&&"function"==typeof i.render&&void 0===i.$$typeof){var c=Me(n)||"Unknown";Am[c]||(a("The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.",c,c,c),Am[c]=!0)}if("object"==typeof i&&null!==i&&"function"==typeof i.render&&void 0===i.$$typeof){var d=Me(n)||"Unknown";Am[d]||(a("The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.",d,d,d),Am[d]=!0),t.tag=1,t.memoizedState=null,t.updateQueue=null;var f=!1;return yc(n)?(f=!0,xc(t)):f=!1,t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,_f(t),hm(t,i),bm(t,n,l,r),Wm(null,t,n,!0,f,r)}if(t.tag=0,8&t.mode){Qr(!0);try{i=vp(null,t,n,l,o,r),s=wp()}finally{Qr(!1)}}return yd()&&s&&Hc(t),Fm(null,t,i,r),Qm(t,n),t.child}(e,t,t.type,n);case 16:return Xm(e,t,t.elementType,n);case 0:var o=t.type,i=t.pendingProps;return qm(e,t,o,t.elementType===o?i:Qh(o,i),n);case 1:var h=t.type,_=t.pendingProps;return Gm(e,t,h,t.elementType===h?_:Qh(h,_),n);case 3:return function(e,t,n){if(Ym(t),null===e)throw new Error("Should have a current fiber. This is a bug in React.");var r=t.pendingProps,o=t.memoizedState,a=o.element;vf(e,t),kf(t,r,null,n);var i=t.memoizedState;t.stateNode;var s=i.element;if(o.isDehydrated){var l={element:s,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions};if(t.updateQueue.baseState=l,t.memoizedState=l,t.flags&rr)return Km(e,t,s,n,ym(new Error("There was an error while hydrating. Because the error happened outside of a Suspense boundary, the entire root will switch to client rendering."),t));if(s!==a)return Km(e,t,s,n,ym(new Error("This root received an early update, before anything was able hydrate. Switched the entire root to client rendering."),t));ed(t);var u=Hd(t,null,s,n);t.child=u;for(var c=u;c;)c.flags=-3&c.flags|sr,c=c.sibling}else{if(gd(),s===a)return bg(e,t,n);Fm(e,t,s,n)}return t.child}(e,t,n);case 5:return function(e,t,n){Bf(t),null===e&&ud(t);var r=t.type,o=t.pendingProps,a=null!==e?e.memoizedProps:null,i=o.children;return yu(r,o)?i=null:null!==a&&yu(r,a)&&(t.flags|=32),Hm(e,t),Fm(e,t,i,n),t.child}(e,t,n);case 6:return function(e,t){return null===e&&ud(t),null}(e,t);case c:return eg(e,t,n);case 4:return function(e,t,n){Lf(t,t.stateNode.containerInfo);var r=t.pendingProps;return null===e?t.child=Vd(t,null,r,n):Fm(e,t,r,n),t.child}(e,t,n);case l:var v=t.type,w=t.pendingProps;return Bm(e,t,v,t.elementType===v?w:Qh(v,w),n);case 7:return function(e,t,n){return Fm(e,t,t.pendingProps,n),t.child}(e,t,n);case 8:return function(e,t,n){return Fm(e,t,t.pendingProps.children,n),t.child}(e,t,n);case u:return function(e,t,n){t.flags|=4;var r=t.stateNode;return r.effectDuration=0,r.passiveEffectDuration=0,Fm(e,t,t.pendingProps.children,n),t.child}(e,t,n);case s:return function(e,t,n){var r=t.type._context,o=t.pendingProps,i=t.memoizedProps,s=o.value;"value"in o||ug||(ug=!0,a("The `value` prop is required for the `<Context.Provider>`. Did you misspell it or forget to pass it?"));var l=t.type.propTypes;if(l&&nc(l,o,"prop","Context.Provider"),tf(t,r,s),null!==i){var u=i.value;if(Os(u,s)){if(i.children===o.children&&!bc())return bg(e,t,n)}else of(t,r,n)}return Fm(e,t,o.children,n),t.child}(e,t,n);case 9:return function(e,t,n){var r=t.type;void 0===r._context?r!==r.Consumer&&(hg||(hg=!0,a("Rendering <Context> directly is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?"))):r=r._context;var o=t.pendingProps.children;"function"!=typeof o&&a("A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it."),af(t,n);var i,s=sf(r);return to(t),Lm.current=t,Ge(!0),i=o(s),Ge(!1),no(),t.flags|=1,Fm(e,t,i,n),t.child}(e,t,n);case d:var S=t.type,x=Qh(S,t.pendingProps);if(t.type!==t.elementType){var T=S.propTypes;T&&nc(T,x,"prop",Me(S))}return Um(e,t,S,x=Qh(S.type,x),n);case f:return zm(e,t,t.type,t.pendingProps,n);case p:var E=t.type,k=t.pendingProps;return function(e,t,n,r,o){var a;return gg(e,t),t.tag=1,yc(n)?(a=!0,xc(t)):a=!1,af(t,o),mm(t,n,r),bm(t,n,r,o),Wm(null,t,n,!0,a,o)}(e,t,E,t.elementType===E?k:Qh(E,k),n);case m:return lg(e,t,n);case g:break;case b:return Vm(e,t,n)}throw new Error("Unknown unit of work tag ("+t.tag+"). This error is likely caused by a bug in React. Please file an issue.")}function vg(e){e.flags|=4}function wg(e){e.flags|=or,e.flags|=hr}function Sg(e,t){if(!yd())switch(e.tailMode){case"hidden":for(var n=e.tail,r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?e.tail=null:r.sibling=null;break;case"collapsed":for(var o=e.tail,a=null;null!==o;)null!==o.alternate&&(a=o),o=o.sibling;null===a?t||null===e.tail?e.tail=null:e.tail.sibling=null:a.sibling=null}}function xg(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t){if(2&e.mode){for(var o=e.selfBaseDuration,a=e.child;null!==a;)n=ya(n,ya(a.lanes,a.childLanes)),r|=a.subtreeFlags&Sr,r|=a.flags&Sr,o+=a.treeBaseDuration,a=a.sibling;e.treeBaseDuration=o}else for(var i=e.child;null!==i;)n=ya(n,ya(i.lanes,i.childLanes)),r|=i.subtreeFlags&Sr,r|=i.flags&Sr,i.return=e,i=i.sibling;e.subtreeFlags|=r}else{if(2&e.mode){for(var s=e.actualDuration,l=e.selfBaseDuration,u=e.child;null!==u;)n=ya(n,ya(u.lanes,u.childLanes)),r|=u.subtreeFlags,r|=u.flags,s+=u.actualDuration,l+=u.treeBaseDuration,u=u.sibling;e.actualDuration=s,e.treeBaseDuration=l}else for(var c=e.child;null!==c;)n=ya(n,ya(c.lanes,c.childLanes)),r|=c.subtreeFlags,r|=c.flags,c.return=e,c=c.sibling;e.subtreeFlags|=r}return e.childLanes=n,t}function Tg(e,t,n){if(Xc&&null!==Kc&&1&t.mode&&0===(t.flags&nr))return md(t),gd(),t.flags|=98560,!1;var r=hd(t);if(null!==n&&null!==n.dehydrated){if(null===e){if(!r)throw new Error("A dehydrated suspense component was completed without a hydrated node. This is probably a bug in React.");if(dd(t),xg(t),2&t.mode)if(null!==n){var o=t.child;null!==o&&(t.treeBaseDuration-=o.treeBaseDuration)}return!1}if(gd(),0===(t.flags&nr)&&(t.memoizedState=null),t.flags|=4,xg(t),2&t.mode&&null!==n){var a=t.child;null!==a&&(t.treeBaseDuration-=a.treeBaseDuration)}return!1}return bd(),!0}function Eg(e,t,n){var r=t.pendingProps;switch(Gc(t),t.tag){case 2:case 16:case f:case 0:case l:case 7:case 8:case u:case 9:case d:return xg(t),null;case 1:return yc(t.type)&&_c(t),xg(t),null;case 3:var o=t.stateNode;if(jf(t),vc(t),Qf(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),null===e||null===e.child)if(hd(t))vg(t);else if(null!==e)e.memoizedState.isDehydrated&&0===(t.flags&rr)||(t.flags|=ar,bd());return dg(e,t),xg(t),null;case 5:Uf(t);var a=Mf(),i=t.type;if(null!==e&&null!=t.stateNode)fg(e,t,i,r,a),e.ref!==t.ref&&wg(t);else{if(!r){if(null===t.stateNode)throw new Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");return xg(t),null}var h=Ff();if(hd(t))(function(e,t,n){var r=e.stateNode,o=!Qc,a=Nu(r,e.type,e.memoizedProps,0,n,e,o);return e.updateQueue=a,null!==a})(t,0,h)&&vg(t);else{var _=gu(i,r,a,h,t);cg(_,t,!1,!1),t.stateNode=_,function(e,t,n){switch(Gl(e,t,n),t){case"button":case"input":case"select":case"textarea":return!!n.autoFocus;case"img":return!0;default:return!1}}(_,i,r)&&vg(t)}null!==t.ref&&wg(t)}return xg(t),null;case 6:var v=r;if(e&&null!=t.stateNode){var w=e.memoizedProps;pg(e,t,w,v)}else{if("string"!=typeof v&&null===t.stateNode)throw new Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");var S=Mf(),x=Ff();hd(t)?cd(t)&&vg(t):t.stateNode=_u(v,S,x,t)}return xg(t),null;case c:Wf(t);var T=t.memoizedState;if(null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated)if(!Tg(e,t,T))return t.flags&dr?t:null;if(0!==(t.flags&nr))return t.lanes=n,2&t.mode&&Xh(t),t;var E=null!==T;if(E!==(null!==e&&null!==e.memoizedState))if(E)if(t.child.flags|=lr,1&t.mode)null===e&&(!0!==t.memoizedProps.unstable_avoidThisFallback||!0)||Vf(zf.current,1)?ry===Hb&&(ry=Wb):r_();if(null!==t.updateQueue&&(t.flags|=4),xg(t),2&t.mode&&E){var k=t.child;null!==k&&(t.treeBaseDuration-=k.treeBaseDuration)}return null;case 4:return jf(t),dg(e,t),null===e&&gl(t.stateNode.containerInfo),xg(t),null;case s:return nf(t.type._context,t),xg(t),null;case p:return yc(t.type)&&_c(t),xg(t),null;case m:Wf(t);var P=t.memoizedState;if(null===P)return xg(t),null;var O=0!==(t.flags&nr),A=P.rendering;if(null===A)if(O)Sg(P,!1);else{if(!(ry===Hb&&(null===e||0===(e.flags&nr))))for(var $=t.child;null!==$;){var R=Kf($);if(null!==R){O=!0,t.flags|=nr,Sg(P,!1);var I=R.updateQueue;return null!==I&&(t.updateQueue=I,t.flags|=4),t.subtreeFlags=0,qd(t,n),Gf(t,qf(zf.current,2)),t.child}$=$.sibling}null!==P.tail&&Lr()>gy()&&(t.flags|=nr,O=!0,Sg(P,!1),t.lanes=Wo)}else{if(!O){var C=Kf(A);if(null!==C){t.flags|=nr,O=!0;var D=C.updateQueue;if(null!==D&&(t.updateQueue=D,t.flags|=4),Sg(P,!0),null===P.tail&&"hidden"===P.tailMode&&!A.alternate&&!yd())return xg(t),null}else 2*Lr()-P.renderingStartTime>gy()&&n!==Zo&&(t.flags|=nr,O=!0,Sg(P,!1),t.lanes=Wo)}if(P.isBackwards)A.sibling=t.child,t.child=A;else{var N=P.last;null!==N?N.sibling=A:t.child=A,P.last=A}}if(null!==P.tail){var M=P.tail;P.rendering=M,P.tail=M.sibling,P.renderingStartTime=Lr(),M.sibling=null;var L=zf.current;return Gf(t,L=O?qf(L,2):Hf(L)),M}return xg(t),null;case g:break;case b:case y:Qy(t);var j=null!==t.memoizedState;if(null!==e)null!==e.memoizedState!==j&&(t.flags|=lr);return j&&1&t.mode?ga(ty,Zo)&&(xg(t),6&t.subtreeFlags&&(t.flags|=lr)):xg(t),null;case 24:case 25:return null}throw new Error("Unknown unit of work tag ("+t.tag+"). This error is likely caused by a bug in React. Please file an issue.")}function kg(e,t,n){switch(Gc(t),t.tag){case 1:yc(t.type)&&_c(t);var r=t.flags;return r&dr?(t.flags=-65537&r|nr,2&t.mode&&Xh(t),t):null;case 3:t.stateNode,jf(t),vc(t),Qf();var o=t.flags;return 0!==(o&dr)&&0===(o&nr)?(t.flags=-65537&o|nr,t):null;case 5:return Uf(t),null;case c:Wf(t);var a=t.memoizedState;if(null!==a&&null!==a.dehydrated){if(null===t.alternate)throw new Error("Threw in newly mounted dehydrated component. This is likely a bug in React. Please file an issue.");gd()}var i=t.flags;return i&dr?(t.flags=-65537&i|nr,2&t.mode&&Xh(t),t):null;case m:return Wf(t),null;case 4:return jf(t),null;case s:return nf(t.type._context,t),null;case b:case y:return Qy(t),null;default:return null}}function Pg(e,t,n){switch(Gc(t),t.tag){case 1:var r=t.type.childContextTypes;null!=r&&_c(t);break;case 3:t.stateNode,jf(t),vc(t),Qf();break;case 5:Uf(t);break;case 4:jf(t);break;case c:case m:Wf(t);break;case s:nf(t.type._context,t);break;case b:case y:Qy(t)}}cg=function(e,t,n,r){for(var o=t.child;null!==o;){if(5===o.tag||6===o.tag)bu(e,o.stateNode);else if(4===o.tag);else if(null!==o.child){o.child.return=o,o=o.child;continue}if(o===t)return;for(;null===o.sibling;){if(null===o.return||o.return===t)return;o=o.return}o.sibling.return=o.return,o=o.sibling}},dg=function(e,t){},fg=function(e,t,n,r,o){var a=e.memoizedProps;if(a!==r){var i=function(e,t,n,r,o,a){var i=a;if(typeof r.children!=typeof n.children&&("string"==typeof r.children||"number"==typeof r.children)){var s=""+r.children,l=tu(i.ancestorInfo,t);eu(null,s,l)}return Wl(e,t,n,r)}(t.stateNode,n,a,r,0,Ff());t.updateQueue=i,i&&vg(t)}},pg=function(e,t,n,r){n!==r&&vg(t)};var Og=null;Og=new Set;var Ag=!1,$g=!1,Rg="function"==typeof WeakSet?WeakSet:Set,Ig=null,Cg=null,Dg=null;var Ng=function(e,t){if(t.props=e.memoizedProps,t.state=e.memoizedState,2&e.mode)try{Yh(),t.componentWillUnmount()}finally{Gh(e)}else t.componentWillUnmount()};function Mg(e,t){try{Gg(4,e)}catch(n){h_(e,t,n)}}function Lg(e,t,n){try{Ng(e,n)}catch(r){h_(e,t,r)}}function jg(e,t){try{Xg(e)}catch(n){h_(e,t,n)}}function Fg(e,t){var n=e.ref;if(null!==n)if("function"==typeof n){var r;try{if(2&e.mode)try{Yh(),r=n(null)}finally{Gh(e)}else r=n(null)}catch(o){h_(e,t,o)}"function"==typeof r&&a("Unexpected return value from a callback ref in %s. A callback ref should not return a function.",je(e))}else n.current=null}function Bg(e,t,n){try{n()}catch(r){h_(e,t,r)}}var Ug=!1;function zg(e,t){mu(e.containerInfo),Ig=t,function(){for(;null!==Ig;){var e=Ig,t=e.child;0!==(e.subtreeFlags&yr)&&null!==t?(t.return=e,Ig=t):Vg()}}();var n=Ug;return Ug=!1,n}function Vg(){for(;null!==Ig;){var e=Ig;qe(e);try{Hg(e)}catch(n){h_(e,e.return,n)}He();var t=e.sibling;if(null!==t)return t.return=e.return,void(Ig=t);Ig=e.return}}function Hg(e){var t,n=e.alternate;if(0!==(e.flags&ar)){switch(qe(e),e.tag){case 0:case l:case f:break;case 1:if(null!==n){var r=n.memoizedProps,o=n.memoizedState,i=e.stateNode;e.type!==e.elementType||Cm||(i.props!==e.memoizedProps&&a("Expected %s props to match memoized props before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",je(e)||"instance"),i.state!==e.memoizedState&&a("Expected %s state to match memoized state before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",je(e)||"instance"));var s=i.getSnapshotBeforeUpdate(e.elementType===e.type?r:Qh(e.type,r),o),u=Og;void 0!==s||u.has(e.type)||(u.add(e.type),a("%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.",je(e))),i.__reactInternalSnapshotBeforeUpdate=s}break;case 3:var c=e.stateNode;1===(t=c.containerInfo).nodeType?t.textContent="":9===t.nodeType&&t.documentElement&&t.removeChild(t.documentElement);break;case 5:case 6:case 4:case p:break;default:throw new Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.")}He()}}function qg(e,t,n){var r=t.updateQueue,o=null!==r?r.lastEffect:null;if(null!==o){var a=o.next,i=a;do{if((i.tag&e)===e){var s=i.destroy;i.destroy=void 0,void 0!==s&&(8&e?ao(t):4&e&&uo(t),2&e&&R_(!0),Bg(t,n,s),2&e&&R_(!1),8&e?io():4&e&&co())}i=i.next}while(i!==a)}}function Gg(e,t){var n=t.updateQueue,r=null!==n?n.lastEffect:null;if(null!==r){var o=r.next,i=o;do{if((i.tag&e)===e){8&e?ro(t):4&e&&so(t);var s=i.create;2&e&&R_(!0),i.destroy=s(),2&e&&R_(!1),8&e?oo():4&e&&lo();var l=i.destroy;if(void 0!==l&&"function"!=typeof l){var u=void 0;a("%s must not return anything besides a function, which is used for clean-up.%s",u=4&i.tag?"useLayoutEffect":2&i.tag?"useInsertionEffect":"useEffect",null===l?" You returned null. If your effect does not require clean up, return undefined (or nothing).":"function"==typeof l.then?"\n\nIt looks like you wrote "+u+"(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:\n\n"+u+"(() => {\n async function fetchData() {\n // You can await here\n const response = await MyAPI.getData(someId);\n // ...\n }\n fetchData();\n}, [someId]); // Or [] if effect doesn't need props or state\n\nLearn more about data fetching with Hooks: https://reactjs.org/link/hooks-data-fetching":" You returned: "+l)}}i=i.next}while(i!==o)}}function Wg(e,t){if(4&t.flags&&t.tag===u){var n=t.stateNode.passiveEffectDuration,r=t.memoizedProps,o=r.id,a=r.onPostCommit,i=Uh(),s=null===t.alternate?"mount":"update";Bh()&&(s="nested-update"),"function"==typeof a&&a(o,s,n,i);var l=t.return;e:for(;null!==l;){switch(l.tag){case 3:l.stateNode.passiveEffectDuration+=n;break e;case u:l.stateNode.passiveEffectDuration+=n;break e}l=l.return}}}function Yg(e,t,n,r){if(0!==(n.flags&vr))switch(n.tag){case 0:case l:case f:if(!$g)if(2&n.mode)try{Yh(),Gg(5,n)}finally{Gh(n)}else Gg(5,n);break;case 1:var o=n.stateNode;if(4&n.flags&&!$g)if(null===t)if(n.type!==n.elementType||Cm||(o.props!==n.memoizedProps&&a("Expected %s props to match memoized props before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",je(n)||"instance"),o.state!==n.memoizedState&&a("Expected %s state to match memoized state before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",je(n)||"instance")),2&n.mode)try{Yh(),o.componentDidMount()}finally{Gh(n)}else o.componentDidMount();else{var i=n.elementType===n.type?t.memoizedProps:Qh(n.type,t.memoizedProps),s=t.memoizedState;if(n.type!==n.elementType||Cm||(o.props!==n.memoizedProps&&a("Expected %s props to match memoized props before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",je(n)||"instance"),o.state!==n.memoizedState&&a("Expected %s state to match memoized state before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",je(n)||"instance")),2&n.mode)try{Yh(),o.componentDidUpdate(i,s,o.__reactInternalSnapshotBeforeUpdate)}finally{Gh(n)}else o.componentDidUpdate(i,s,o.__reactInternalSnapshotBeforeUpdate)}var d=n.updateQueue;null!==d&&(n.type!==n.elementType||Cm||(o.props!==n.memoizedProps&&a("Expected %s props to match memoized props before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",je(n)||"instance"),o.state!==n.memoizedState&&a("Expected %s state to match memoized state before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",je(n)||"instance")),$f(0,d,o));break;case 3:var h=n.updateQueue;if(null!==h){var _=null;if(null!==n.child)switch(n.child.tag){case 5:case 1:_=n.child.stateNode}$f(0,h,_)}break;case 5:var v=n.stateNode;if(null===t&&4&n.flags)!function(e,t,n){switch(t){case"button":case"input":case"select":case"textarea":return void(n.autoFocus&&e.focus());case"img":n.src&&(e.src=n.src)}}(v,n.type,n.memoizedProps);break;case 6:case 4:break;case u:var w=n.memoizedProps,S=w.onCommit,x=w.onRender,T=n.stateNode.effectDuration,E=Uh(),k=null===t?"mount":"update";Bh()&&(k="nested-update"),"function"==typeof x&&x(n.memoizedProps.id,k,n.actualDuration,n.treeBaseDuration,n.actualStartTime,E),"function"==typeof S&&S(n.memoizedProps.id,k,T,E),O=n,xy.push(O),vy||(vy=!0,O_(Ur,function(){return c_(),null}));var P=n.return;e:for(;null!==P;){switch(P.tag){case 3:P.stateNode.effectDuration+=T;break e;case u:P.stateNode.effectDuration+=T;break e}P=P.return}break;case c:!function(e,t){var n=t.memoizedState;if(null===n){var r=t.alternate;if(null!==r){var o=r.memoizedState;if(null!==o){var a=o.dehydrated;null!==a&&function(e){ai(e)}(a)}}}}(0,n);break;case m:case p:case g:case b:case y:case 25:break;default:throw new Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.")}var O;$g||n.flags&or&&Xg(n)}function Kg(e){switch(e.tag){case 0:case l:case f:if(2&e.mode)try{Yh(),Mg(e,e.return)}finally{Gh(e)}else Mg(e,e.return);break;case 1:var t=e.stateNode;"function"==typeof t.componentDidMount&&function(e,t,n){try{n.componentDidMount()}catch(r){h_(e,t,r)}}(e,e.return,t),jg(e,e.return);break;case 5:jg(e,e.return)}}function Xg(e){var t=e.ref;if(null!==t){var n,r=e.stateNode;if(e.tag,n=r,"function"==typeof t){var o;if(2&e.mode)try{Yh(),o=t(n)}finally{Gh(e)}else o=t(n);"function"==typeof o&&a("Unexpected return value from a callback ref in %s. A callback ref should not return a function.",je(e))}else t.hasOwnProperty("current")||a("Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().",je(e)),t.current=n}}function Qg(e){var t,n=e.alternate;if(null!==n&&(e.alternate=null,Qg(n)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag){var r=e.stateNode;null!==r&&(delete(t=r)[ju],delete t[Fu],delete t[Uu],delete t[zu],delete t[Vu])}e.stateNode=null,e._debugOwner=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Zg(e){return 5===e.tag||3===e.tag||4===e.tag}function Jg(e){var t=e;e:for(;;){for(;null===t.sibling;){if(null===t.return||Zg(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;5!==t.tag&&6!==t.tag&&t.tag!==h;){if(2&t.flags)continue e;if(null===t.child||4===t.tag)continue e;t.child.return=t,t=t.child}if(!(2&t.flags))return t.stateNode}}function eb(e){var t=function(e){for(var t=e.return;null!==t;){if(Zg(t))return t;t=t.return}throw new Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.")}(e);switch(t.tag){case 5:var n=t.stateNode;32&t.flags&&(Eu(n),t.flags&=-33),nb(e,Jg(e),n);break;case 3:case 4:var r=t.stateNode.containerInfo;tb(e,Jg(e),r);break;default:throw new Error("Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue.")}}function tb(e,t,n){var r=e.tag;if(5===r||6===r){var o=e.stateNode;t?function(e,t,n){8===e.nodeType?e.parentNode.insertBefore(t,n):e.insertBefore(t,n)}(n,o,t):function(e,t){var n;8===e.nodeType?(n=e.parentNode).insertBefore(t,e):(n=e).appendChild(t),null==e._reactRootContainer&&null===n.onclick&&ql(n)}(n,o)}else if(4===r);else{var a=e.child;if(null!==a){tb(a,t,n);for(var i=a.sibling;null!==i;)tb(i,t,n),i=i.sibling}}}function nb(e,t,n){var r=e.tag;if(5===r||6===r){var o=e.stateNode;t?function(e,t,n){e.insertBefore(t,n)}(n,o,t):function(e,t){e.appendChild(t)}(n,o)}else if(4===r);else{var a=e.child;if(null!==a){nb(a,t,n);for(var i=a.sibling;null!==i;)nb(i,t,n),i=i.sibling}}}var rb=null,ob=!1;function ab(e,t,n){var r,o,a=t;e:for(;null!==a;){switch(a.tag){case 5:rb=a.stateNode,ob=!1;break e;case 3:case 4:rb=a.stateNode.containerInfo,ob=!0;break e}a=a.return}if(null===rb)throw new Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.");sb(e,t,n),rb=null,ob=!1,null!==(o=(r=n).alternate)&&(o.return=null),r.return=null}function ib(e,t,n){for(var r=n.child;null!==r;)sb(e,t,r),r=r.sibling}function sb(e,t,n){switch(function(e){if(Wr&&"function"==typeof Wr.onCommitFiberUnmount)try{Wr.onCommitFiberUnmount(Gr,e)}catch(t){Kr||(Kr=!0,a("React instrumentation encountered an error: %s",t))}}(n),n.tag){case 5:$g||Fg(n,t);case 6:var r=rb,o=ob;return rb=null,ib(e,t,n),ob=o,void(null!==(rb=r)&&(ob?(x=rb,T=n.stateNode,8===x.nodeType?x.parentNode.removeChild(T):x.removeChild(T)):function(e,t){e.removeChild(t)}(rb,n.stateNode)));case h:return void(null!==rb&&(ob?function(e,t){8===e.nodeType?ku(e.parentNode,t):1===e.nodeType&&ku(e,t),ai(e)}(rb,n.stateNode):ku(rb,n.stateNode)));case 4:var i=rb,s=ob;return rb=n.stateNode.containerInfo,ob=!0,ib(e,t,n),rb=i,void(ob=s);case 0:case l:case d:case f:if(!$g){var u=n.updateQueue;if(null!==u){var c=u.lastEffect;if(null!==c){var p=c.next,m=p;do{var y=m,_=y.destroy,v=y.tag;void 0!==_&&(2&v?Bg(n,t,_):4&v&&(uo(n),2&n.mode?(Yh(),Bg(n,t,_),Gh(n)):Bg(n,t,_),co())),m=m.next}while(m!==p)}}}return void ib(e,t,n);case 1:if(!$g){Fg(n,t);var w=n.stateNode;"function"==typeof w.componentWillUnmount&&Lg(n,t,w)}return void ib(e,t,n);case g:return void ib(e,t,n);case b:if(1&n.mode){var S=$g;$g=S||null!==n.memoizedState,ib(e,t,n),$g=S}else ib(e,t,n);break;default:return void ib(e,t,n)}var x,T}function lb(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new Rg),t.forEach(function(t){var r=y_.bind(null,e,t);if(!n.has(t)){if(n.add(t),Xr){if(null===Cg||null===Dg)throw Error("Expected finished root and lanes to be set. This is a bug in React.");k_(Dg,Cg)}t.then(r,r)}})}}function ub(e,t,n){var r=t.deletions;if(null!==r)for(var o=0;o<r.length;o++){var a=r[o];try{ab(e,t,a)}catch(l){h_(a,t,l)}}var i=Be;if(t.subtreeFlags&_r)for(var s=t.child;null!==s;)qe(s),cb(s,e),s=s.sibling;qe(i)}function cb(e,t,n){var r=e.alternate,o=e.flags;switch(e.tag){case 0:case l:case d:case f:if(ub(t,e),db(e),4&o){try{qg(3,e,e.return),Gg(3,e)}catch($){h_(e,e.return,$)}if(2&e.mode){try{Yh(),qg(5,e,e.return)}catch($){h_(e,e.return,$)}Gh(e)}else try{qg(5,e,e.return)}catch($){h_(e,e.return,$)}}return;case 1:return ub(t,e),db(e),void(o&or&&null!==r&&Fg(r,r.return));case 5:if(ub(t,e),db(e),o&or&&null!==r&&Fg(r,r.return),32&e.flags){var a=e.stateNode;try{Eu(a)}catch($){h_(e,e.return,$)}}if(4&o){var i=e.stateNode;if(null!=i){var s=e.memoizedProps,u=null!==r?r.memoizedProps:s,p=e.type,h=e.updateQueue;if(e.updateQueue=null,null!==h)try{!function(e,t,n,r,o){Yl(e,t,n,r,o),Zu(e,o)}(i,h,p,u,s)}catch($){h_(e,e.return,$)}}}return;case 6:if(ub(t,e),db(e),4&o){if(null===e.stateNode)throw new Error("This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue.");var _=e.stateNode,v=e.memoizedProps;null!==r&&r.memoizedProps;try{!function(e,t,n){e.nodeValue=n}(_,0,v)}catch($){h_(e,e.return,$)}}return;case 3:if(ub(t,e),db(e),4&o)if(null!==r)if(r.memoizedState.isDehydrated)try{ai(t.containerInfo)}catch($){h_(e,e.return,$)}return;case 4:return ub(t,e),void db(e);case c:ub(t,e),db(e);var w=e.child;if(w.flags&lr){var S=w.stateNode,x=null!==w.memoizedState;if(S.isHidden=x,x)null!==w.alternate&&null!==w.alternate.memoizedState||(cy=Lr())}if(4&o){try{!function(e){e.memoizedState}(e)}catch($){h_(e,e.return,$)}lb(e)}return;case b:var T=null!==r&&null!==r.memoizedState;if(1&e.mode){var E=$g;$g=E||T,ub(t,e),$g=E}else ub(t,e);if(db(e),o&lr){var k=e.stateNode,P=null!==e.memoizedState,O=e;if(k.isHidden=P,P&&!T&&1&O.mode){Ig=O;for(var A=O.child;null!==A;)Ig=A,mb(A),A=A.sibling}!function(e,t){for(var n=null,r=e;;){if(5===r.tag){if(null===n){n=r;try{var o=r.stateNode;t?Pu(o):Au(r.stateNode,r.memoizedProps)}catch($){h_(e,e.return,$)}}}else if(6===r.tag){if(null===n)try{var a=r.stateNode;t?Ou(a):$u(a,r.memoizedProps)}catch($){h_(e,e.return,$)}}else if((r.tag!==b&&r.tag!==y||null===r.memoizedState||r===e)&&null!==r.child){r.child.return=r,r=r.child;continue}if(r===e)return;for(;null===r.sibling;){if(null===r.return||r.return===e)return;n===r&&(n=null),r=r.return}n===r&&(n=null),r.sibling.return=r.return,r=r.sibling}}(O,P)}return;case m:return ub(t,e),db(e),void(4&o&&lb(e));case g:return;default:return ub(t,e),void db(e)}}function db(e){var t=e.flags;if(2&t){try{eb(e)}catch(n){h_(e,e.return,n)}e.flags&=-3}t&sr&&(e.flags&=-4097)}function fb(e,t,n){Cg=n,Dg=t,Ig=e,pb(e,t,n),Cg=null,Dg=null}function pb(e,t,n){for(var r=!!(1&e.mode);null!==Ig;){var o=Ig,a=o.child;if(o.tag===b&&r){var i=null!==o.memoizedState||Ag;if(i){hb(e,t,n);continue}var s=o.alternate,l=null!==s&&null!==s.memoizedState,u=Ag,c=$g;Ag=i,($g=l||$g)&&!c&&(Ig=o,bb(o));for(var d=a;null!==d;)Ig=d,pb(d,t,n),d=d.sibling;Ig=o,Ag=u,$g=c,hb(e,t,n)}else 0!==(o.subtreeFlags&vr)&&null!==a?(a.return=o,Ig=a):hb(e,t,n)}}function hb(e,t,n){for(;null!==Ig;){var r=Ig;if(0!==(r.flags&vr)){var o=r.alternate;qe(r);try{Yg(0,o,r)}catch(i){h_(r,r.return,i)}He()}if(r===e)return void(Ig=null);var a=r.sibling;if(null!==a)return a.return=r.return,void(Ig=a);Ig=r.return}}function mb(e){for(;null!==Ig;){var t=Ig,n=t.child;switch(t.tag){case 0:case l:case d:case f:if(2&t.mode)try{Yh(),qg(4,t,t.return)}finally{Gh(t)}else qg(4,t,t.return);break;case 1:Fg(t,t.return);var r=t.stateNode;"function"==typeof r.componentWillUnmount&&Lg(t,t.return,r);break;case 5:Fg(t,t.return);break;case b:if(null!==t.memoizedState){gb(e);continue}}null!==n?(n.return=t,Ig=n):gb(e)}}function gb(e){for(;null!==Ig;){var t=Ig;if(t===e)return void(Ig=null);var n=t.sibling;if(null!==n)return n.return=t.return,void(Ig=n);Ig=t.return}}function bb(e){for(;null!==Ig;){var t=Ig,n=t.child;if(t.tag===b)if(null!==t.memoizedState){yb(e);continue}null!==n?(n.return=t,Ig=n):yb(e)}}function yb(e){for(;null!==Ig;){var t=Ig;qe(t);try{Kg(t)}catch(r){h_(t,t.return,r)}if(He(),t===e)return void(Ig=null);var n=t.sibling;if(null!==n)return n.return=t.return,void(Ig=n);Ig=t.return}}function _b(e,t,n,r){Ig=t,function(e,t,n,r){for(;null!==Ig;){var o=Ig,a=o.child;0!==(o.subtreeFlags&wr)&&null!==a?(a.return=o,Ig=a):vb(e,t,n,r)}}(t,e,n,r)}function vb(e,t,n,r){for(;null!==Ig;){var o=Ig;if(0!==(o.flags&ir)){qe(o);try{wb(t,o,n,r)}catch(i){h_(o,o.return,i)}He()}if(o===e)return void(Ig=null);var a=o.sibling;if(null!==a)return a.return=o.return,void(Ig=a);Ig=o.return}}function wb(e,t,n,r){switch(t.tag){case 0:case l:case f:if(2&t.mode){Kh();try{Gg(9,t)}finally{Wh(t)}}else Gg(9,t)}}function Sb(e){Ig=e,function(){for(;null!==Ig;){var e=Ig,t=e.child;if(0!==(Ig.flags&tr)){var n=e.deletions;if(null!==n){for(var r=0;r<n.length;r++){var o=n[r];Ig=o,Eb(o,e)}var a=e.alternate;if(null!==a){var i=a.child;if(null!==i){a.child=null;do{var s=i.sibling;i.sibling=null,i=s}while(null!==i)}}Ig=e}}0!==(e.subtreeFlags&wr)&&null!==t?(t.return=e,Ig=t):xb()}}()}function xb(){for(;null!==Ig;){var e=Ig;0!==(e.flags&ir)&&(qe(e),Tb(e),He());var t=e.sibling;if(null!==t)return t.return=e.return,void(Ig=t);Ig=e.return}}function Tb(e){switch(e.tag){case 0:case l:case f:2&e.mode?(Kh(),qg(9,e,e.return),Wh(e)):qg(9,e,e.return)}}function Eb(e,t){for(;null!==Ig;){var n=Ig;qe(n),Pb(n,t),He();var r=n.child;null!==r?(r.return=n,Ig=r):kb(e)}}function kb(e){for(;null!==Ig;){var t=Ig,n=t.sibling,r=t.return;if(Qg(t),t===e)return void(Ig=null);if(null!==n)return n.return=r,void(Ig=n);Ig=r}}function Pb(e,t){switch(e.tag){case 0:case l:case f:2&e.mode?(Kh(),qg(8,e,t),Wh(e)):qg(8,e,t)}}function Ob(e){switch(e.tag){case 0:case l:case f:try{Gg(5,e)}catch(n){h_(e,e.return,n)}break;case 1:var t=e.stateNode;try{t.componentDidMount()}catch(n){h_(e,e.return,n)}}}function Ab(e){switch(e.tag){case 0:case l:case f:try{Gg(9,e)}catch(t){h_(e,e.return,t)}}}function $b(e){switch(e.tag){case 0:case l:case f:try{qg(5,e,e.return)}catch(n){h_(e,e.return,n)}break;case 1:var t=e.stateNode;"function"==typeof t.componentWillUnmount&&Lg(e,e.return,t)}}function Rb(e){switch(e.tag){case 0:case l:case f:try{qg(9,e,e.return)}catch(t){h_(e,e.return,t)}}}if("function"==typeof Symbol&&Symbol.for){var Ib=Symbol.for;Ib("selector.component"),Ib("selector.has_pseudo_class"),Ib("selector.role"),Ib("selector.test_id"),Ib("selector.text")}var Cb=[];var Db=n.ReactCurrentActQueue;function Nb(){var e="undefined"!=typeof IS_REACT_ACT_ENVIRONMENT?IS_REACT_ACT_ENVIRONMENT:void 0;return e||null===Db.current||a("The current testing environment is not configured to support act(...)"),e}var Mb=Math.ceil,Lb=n.ReactCurrentDispatcher,jb=n.ReactCurrentOwner,Fb=n.ReactCurrentBatchConfig,Bb=n.ReactCurrentActQueue,Ub=0,zb=2,Vb=4,Hb=0,qb=1,Gb=2,Wb=3,Yb=4,Kb=5,Xb=6,Qb=Ub,Zb=null,Jb=null,ey=0,ty=0,ny=sc(0),ry=Hb,oy=null,ay=0,iy=0,sy=0,ly=null,uy=null,cy=0,dy=500,fy=1/0,py=500,hy=null;function my(){fy=Lr()+py}function gy(){return fy}var by=!1,yy=null,_y=null,vy=!1,wy=null,Sy=0,xy=[],Ty=null,Ey=50,ky=0,Py=null,Oy=!1,Ay=!1,$y=50,Ry=0,Iy=null,Cy=ea,Dy=0,Ny=!1;function My(){return Zb}function Ly(){return(Qb&(zb|Vb))!==Ub?Lr():Cy!==ea?Cy:Cy=Lr()}function jy(e){if(!(1&e.mode))return So;if((Qb&zb)!==Ub&&0!==ey)return pa(ey);if(null!==vd.transition){if(null!==Fb.transition){var t=Fb.transition;t._updatedFibers||(t._updatedFibers=new Set),t._updatedFibers.add(e)}return 0===Dy&&(Dy=da()),Dy}var n,r=La();return 0!==r?r:void 0===(n=window.event)?Da:hi(n.type)}function Fy(e){var t;return 1&e.mode?(t=na,!((na<<=1)&Uo)&&(na=zo),t):So}function By(e,t,n,r){!function(){if(ky>Ey)throw ky=0,Py=null,new Error("Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.");Ry>$y&&(Ry=0,Iy=null,a("Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render."))}(),Ny&&a("useInsertionEffect must not schedule updates."),Oy&&(Ay=!0),Sa(e,n,r),0!==(Qb&zb)&&e===Zb?function(e){if(Ue&&!hh)switch(e.tag){case 0:case l:case f:var t=Jb&&je(Jb)||"Unknown",n=t;if(!T_.has(n))T_.add(n),a("Cannot update a component (`%s`) while rendering a different component (`%s`). To locate the bad setState() call inside `%s`, follow the stack trace as described in https://reactjs.org/link/setstate-in-render",je(e)||"Unknown",t,t);break;case 1:E_||(a("Cannot update during an existing state transition (such as within `render`). Render methods should be a pure function of props and state."),E_=!0)}}(t):(Xr&&Ea(e,t,n),function(e){if(1&e.mode){if(!Nb())return}else{if(t="undefined"!=typeof IS_REACT_ACT_ENVIRONMENT?IS_REACT_ACT_ENVIRONMENT:void 0,"undefined"==typeof jest||!1===t)return;if(Qb!==Ub)return;if(0!==e.tag&&e.tag!==l&&e.tag!==f)return}var t;if(null===Bb.current){var n=Be;try{qe(e),a("An update to %s inside a test was not wrapped in act(...).\n\nWhen testing, code that causes React state updates should be wrapped into act(...):\n\nact(() => {\n /* fire events that update state */\n});\n/* assert on the output */\n\nThis ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act",je(e))}finally{n?qe(e):He()}}}(t),e===Zb&&((Qb&zb)===Ub&&(iy=ya(iy,n)),ry===Yb&&qy(e,ey)),Uy(e,r),n!==So||Qb!==Ub||1&t.mode||Bb.isBatchingLegacy||(my(),$c()))}function Uy(e,t){var n=e.callbackNode;!function(e,t){for(var n=e.pendingLanes,r=e.suspendedLanes,o=e.pingedLanes,a=e.expirationTimes,i=n;i>0;){var s=ha(i),l=1<<s,u=a[s];u===ea?0!==(l&r)&&0===(l&o)||(a[s]=aa(l,t)):u<=t&&(e.expiredLanes|=l),i&=~l}}(e,t);var r=oa(e,e===Zb?ey:0);if(0===r)return null!==n&&A_(n),e.callbackNode=null,void(e.callbackPriority=0);var o=fa(r),i=e.callbackPriority;if(i!==o||null!==Bb.current&&n!==P_){var s,l;if(null!=n&&A_(n),o===So)0===e.tag?(null!==Bb.isBatchingLegacy&&(Bb.didScheduleLegacyUpdate=!0),l=Gy.bind(null,e),Pc=!0,Ac(l)):Ac(Gy.bind(null,e)),null!==Bb.current?Bb.current.push(Rc):xu(function(){(Qb&(zb|Vb))===Ub&&Rc()}),s=null;else{var u;switch(Ba(r)){case Ia:u=Fr;break;case Ca:u=Br;break;case Da:u=Ur;break;case Na:u=Vr;break;default:u=Ur}s=O_(u,zy.bind(null,e))}e.callbackPriority=o,e.callbackNode=s}else null==n&&i!==So&&a("Expected scheduled callback to exist. This error is likely caused by a bug in React. Please file an issue.")}function zy(e,t){if(jh=!1,Fh=!1,Cy=ea,Dy=0,(Qb&(zb|Vb))!==Ub)throw new Error("Should not already be working.");var n=e.callbackNode;if(c_()&&e.callbackNode!==n)return null;var r=oa(e,e===Zb?ey:0);if(0===r)return null;var o=!ua(0,r)&&!function(e,t){return 0!==(t&e.expiredLanes)}(e,r)&&!t,a=o?function(e,t){var n=Qb;Qb|=zb;var r=e_();if(Zb!==e||ey!==t){if(Xr){var o=e.memoizedUpdaters;o.size>0&&(k_(e,ey),o.clear()),ka(e,t)}hy=null,my(),Zy(e,t)}ho(t);for(;;)try{i_();break}catch(a){Jy(e,a)}return Zd(),t_(r),Qb=n,null!==Jb?(null!==Yr&&"function"==typeof Yr.markRenderYielded&&Yr.markRenderYielded(),Hb):(mo(),Zb=null,ey=0,ry)}(e,r):o_(e,r);if(a!==Hb){if(a===Gb){var i=ia(e);0!==i&&(r=i,a=Vy(e,i))}if(a===qb){var s=oy;throw Zy(e,0),qy(e,r),Uy(e,Lr()),s}if(a===Xb)qy(e,r);else{var l=!ua(0,r),u=e.current.alternate;if(l&&!function(e){var t=e;for(;;){if(t.flags&ur){var n=t.updateQueue;if(null!==n){var r=n.stores;if(null!==r)for(var o=0;o<r.length;o++){var a=r[o],i=a.getSnapshot,s=a.value;try{if(!Os(i(),s))return!1}catch(u){return!1}}}}var l=t.child;if(t.subtreeFlags&ur&&null!==l)l.return=t,t=l;else{if(t===e)return!0;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}(u)){if((a=o_(e,r))===Gb){var c=ia(e);0!==c&&(r=c,a=Vy(e,c))}if(a===qb){var d=oy;throw Zy(e,0),qy(e,r),Uy(e,Lr()),d}}e.finishedWork=u,e.finishedLanes=r,function(e,t,n){switch(t){case Hb:case qb:throw new Error("Root did not complete. This is a bug in React.");case Gb:u_(e,uy,hy);break;case Wb:if(qy(e,n),la(n)&&!$_()){var r=cy+dy-Lr();if(r>10){if(0!==oa(e,0))break;var o=e.suspendedLanes;if(!ba(o,n)){Ly(),xa(e,o);break}e.timeoutHandle=vu(u_.bind(null,e,uy,hy),r);break}}u_(e,uy,hy);break;case Yb:if(qy(e,n),function(e){return(e&Oo)===e}(n))break;if(!$_()){var a=function(e,t){for(var n=e.eventTimes,r=ea;t>0;){var o=ha(t),a=1<<o,i=n[o];i>r&&(r=i),t&=~a}return r}(e,n),i=a,s=Lr()-i,l=((u=s)<120?120:u<480?480:u<1080?1080:u<1920?1920:u<3e3?3e3:u<4320?4320:1960*Mb(u/1960))-s;if(l>10){e.timeoutHandle=vu(u_.bind(null,e,uy,hy),l);break}}u_(e,uy,hy);break;case Kb:u_(e,uy,hy);break;default:throw new Error("Unknown root exit status.")}var u}(e,a,r)}}return Uy(e,Lr()),e.callbackNode===n?zy.bind(null,e):null}function Vy(e,t){var n=ly;Ua(e)&&(Zy(e,t).flags|=rr,a("An error occurred during hydration. The server HTML was replaced with client content in <%s>.",e.containerInfo.nodeName.toLowerCase()));var r=o_(e,t);if(r!==Gb){var o=uy;uy=n,null!==o&&Hy(o)}return r}function Hy(e){null===uy?uy=e:uy.push.apply(uy,e)}function qy(e,t){t=_a(t,sy),function(e,t){e.suspendedLanes|=t,e.pingedLanes&=~t;for(var n=e.expirationTimes,r=t;r>0;){var o=ha(r),a=1<<o;n[o]=ea,r&=~a}}(e,t=_a(t,iy))}function Gy(e){if(jh=Fh,Fh=!1,(Qb&(zb|Vb))!==Ub)throw new Error("Should not already be working.");c_();var t=oa(e,0);if(!ga(t,So))return Uy(e,Lr()),null;var n=o_(e,t);if(0!==e.tag&&n===Gb){var r=ia(e);0!==r&&(t=r,n=Vy(e,r))}if(n===qb){var o=oy;throw Zy(e,0),qy(e,t),Uy(e,Lr()),o}if(n===Xb)throw new Error("Root did not complete. This is a bug in React.");var a=e.current.alternate;return e.finishedWork=a,e.finishedLanes=t,u_(e,uy,hy),Uy(e,Lr()),null}function Wy(e,t){var n=Qb;Qb|=1;try{return e(t)}finally{(Qb=n)!==Ub||Bb.isBatchingLegacy||(my(),$c())}}function Yy(e){null!==wy&&0===wy.tag&&(Qb&(zb|Vb))===Ub&&c_();var t=Qb;Qb|=1;var n=Fb.transition,r=La();try{return Fb.transition=null,ja(Ia),e?e():void 0}finally{ja(r),Fb.transition=n,((Qb=t)&(zb|Vb))===Ub&&Rc()}}function Ky(){return(Qb&(zb|Vb))!==Ub}function Xy(e,t){uc(ny,ty,e),ty=ya(ty,t)}function Qy(e){ty=ny.current,lc(ny,e)}function Zy(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,wu(n)),null!==Jb)for(var r=Jb.return;null!==r;){r.alternate;Pg(0,r),r=r.return}Zb=e;var o=K_(e.current,null);return Jb=o,ey=ty=t,ry=Hb,oy=null,ay=0,iy=0,sy=0,ly=null,uy=null,function(){if(null!==lf){for(var e=0;e<lf.length;e++){var t=lf[e],n=t.interleaved;if(null!==n){t.interleaved=null;var r=n.next,o=t.pending;if(null!==o){var a=o.next;o.next=r,n.next=a}t.pending=n}}lf=null}}(),wd.discardPendingWarnings(),o}function Jy(e,t){for(;;){var n=Jb;try{if(Zd(),xp(),He(),jb.current=null,null===n||null===n.return)return ry=qb,oy=t,void(Jb=null);2&n.mode&&qh(n,!0),no(),null!==t&&"object"==typeof t&&"function"==typeof t.then?po(n,t,ey):fo(n,t,ey),Pm(e,n.return,n,t,ey),l_(n)}catch(r){t=r,Jb===n&&null!==n?(n=n.return,Jb=n):n=Jb;continue}return}}function e_(){var e=Lb.current;return Lb.current=xh,null===e?xh:e}function t_(e){Lb.current=e}function n_(e){ay=ya(e,ay)}function r_(){ry!==Hb&&ry!==Wb&&ry!==Gb||(ry=Yb),null!==Zb&&(sa(ay)||sa(iy))&&qy(Zb,ey)}function o_(e,t){var n=Qb;Qb|=zb;var r=e_();if(Zb!==e||ey!==t){if(Xr){var o=e.memoizedUpdaters;o.size>0&&(k_(e,ey),o.clear()),ka(e,t)}hy=null,Zy(e,t)}for(ho(t);;)try{a_();break}catch(a){Jy(e,a)}if(Zd(),Qb=n,t_(r),null!==Jb)throw new Error("Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue.");return mo(),Zb=null,ey=0,ry}function a_(){for(;null!==Jb;)s_(Jb)}function i_(){for(;null!==Jb&&!Nr();)s_(Jb)}function s_(e){var t,n=e.alternate;qe(e),2&e.mode?(Vh(e),t=w_(n,e,ty),qh(e,!0)):t=w_(n,e,ty),He(),e.memoizedProps=e.pendingProps,null===t?l_(e):Jb=t,jb.current=null}function l_(e){var t=e;do{var n=t.alternate,r=t.return;if(0===(t.flags&cr)){qe(t);var o=void 0;if(2&t.mode?(Vh(t),o=Eg(n,t,ty),qh(t,!1)):o=Eg(n,t,ty),He(),null!==o)return void(Jb=o)}else{var a=kg(0,t);if(null!==a)return a.flags&=32767,void(Jb=a);if(2&t.mode){qh(t,!1);for(var i=t.actualDuration,s=t.child;null!==s;)i+=s.actualDuration,s=s.sibling;t.actualDuration=i}if(null===r)return ry=Xb,void(Jb=null);r.flags|=cr,r.subtreeFlags=0,r.deletions=null}var l=t.sibling;if(null!==l)return void(Jb=l);Jb=t=r}while(null!==t);ry===Hb&&(ry=Kb)}function u_(e,t,n){var r=La(),o=Fb.transition;try{Fb.transition=null,ja(Ia),function(e,t,n,r){do{c_()}while(null!==wy);if(function(){wd.flushLegacyContextWarning(),wd.flushPendingUnsafeLifecycleWarnings()}(),(Qb&(zb|Vb))!==Ub)throw new Error("Should not already be working.");var o=e.finishedWork,i=e.finishedLanes;if(function(e){null!==Yr&&"function"==typeof Yr.markCommitStarted&&Yr.markCommitStarted(e)}(i),null===o)return eo(),null;0===i&&a("root.finishedLanes should not be empty during a commit. This is a bug in React.");if(e.finishedWork=null,e.finishedLanes=0,o===e.current)throw new Error("Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue.");e.callbackNode=null,e.callbackPriority=0;var s=ya(o.lanes,o.childLanes);(function(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t;for(var r=e.entanglements,o=e.eventTimes,a=e.expirationTimes,i=n;i>0;){var s=ha(i),l=1<<s;r[s]=0,o[s]=ea,a[s]=ea,i&=~l}})(e,s),e===Zb&&(Zb=null,Jb=null,ey=0);0===(o.subtreeFlags&wr)&&0===(o.flags&wr)||vy||(vy=!0,Ty=n,O_(Ur,function(){return c_(),null}));var l=!!(15990&o.subtreeFlags),u=!!(15990&o.flags);if(l||u){var c=Fb.transition;Fb.transition=null;var d=La();ja(Ia);var f=Qb;Qb|=Vb,jb.current=null,zg(e,o),zh(),function(e,t,n){Cg=n,Dg=e,qe(t),cb(t,e),qe(t),Cg=null,Dg=null}(e,o,i),e.containerInfo,Bs(hu),li(pu),pu=null,hu=null,e.current=o,function(e){null!==Yr&&"function"==typeof Yr.markLayoutEffectsStarted&&Yr.markLayoutEffectsStarted(e)}(i),fb(o,e,i),null!==Yr&&"function"==typeof Yr.markLayoutEffectsStopped&&Yr.markLayoutEffectsStopped(),Mr(),Qb=f,ja(d),Fb.transition=c}else e.current=o,zh();var p=vy;vy?(vy=!1,wy=e,Sy=i):(Ry=0,Iy=null);s=e.pendingLanes,0===s&&(_y=null);p||__(e.current,!1);(function(e,t){if(Wr&&"function"==typeof Wr.onCommitFiberRoot)try{var n,r=(e.current.flags&nr)===nr;switch(t){case Ia:n=Fr;break;case Ca:n=Br;break;case Da:n=Ur;break;case Na:n=Vr;break;default:n=Ur}Wr.onCommitFiberRoot(Gr,e,n,r)}catch(o){Kr||(Kr=!0,a("React instrumentation encountered an error: %s",o))}})(o.stateNode,r),Xr&&e.memoizedUpdaters.clear();if(function(){Cb.forEach(function(e){return e()})}(),Uy(e,Lr()),null!==t)for(var h=e.onRecoverableError,m=0;m<t.length;m++){var g=t[m],b=g.stack,y=g.digest;h(g.value,{componentStack:b,digest:y})}if(by){by=!1;var _=yy;throw yy=null,_}ga(Sy,So)&&0!==e.tag&&c_();s=e.pendingLanes,ga(s,So)?(Fh=!0,e===Py?ky++:(ky=0,Py=e)):ky=0;Rc(),eo()}(e,t,n,r)}finally{Fb.transition=o,ja(r)}return null}function c_(){if(null!==wy){var e=Ba(Sy),t=(o=Da)>(i=e)?o:i,n=Fb.transition,r=La();try{return Fb.transition=null,ja(t),function(){if(null===wy)return!1;var e=Ty;Ty=null;var t=wy,n=Sy;if(wy=null,Sy=0,(Qb&(zb|Vb))!==Ub)throw new Error("Cannot flush passive effects while already rendering.");Oy=!0,Ay=!1,function(e){null!==Yr&&"function"==typeof Yr.markPassiveEffectsStarted&&Yr.markPassiveEffectsStarted(e)}(n);var r=Qb;Qb|=Vb,Sb(t.current),_b(t,t.current,n,e);var o=xy;xy=[];for(var i=0;i<o.length;i++){Wg(0,o[i])}void(null!==Yr&&"function"==typeof Yr.markPassiveEffectsStopped&&Yr.markPassiveEffectsStopped()),__(t.current,!0),Qb=r,Rc(),Ay?t===Iy?Ry++:(Ry=0,Iy=t):Ry=0;Oy=!1,Ay=!1,function(e){if(Wr&&"function"==typeof Wr.onPostCommitFiberRoot)try{Wr.onPostCommitFiberRoot(Gr,e)}catch(t){Kr||(Kr=!0,a("React instrumentation encountered an error: %s",t))}}(t);var s=t.current.stateNode;return s.effectDuration=0,s.passiveEffectDuration=0,!0}()}finally{ja(r),Fb.transition=n}}var o,i;return!1}function d_(e){return null!==_y&&_y.has(e)}var f_=function(e){by||(by=!0,yy=e)};function p_(e,t,n){var r=Sf(e,Sm(e,ym(n,t),So),So),o=Ly();null!==r&&(Sa(r,So,o),Uy(r,o))}function h_(e,t,n){var r;if(r=n,Zn(null,function(){throw r}),Jn(),R_(!1),3!==e.tag){var o=null;for(o=t;null!==o;){if(3===o.tag)return void p_(o,e,n);if(1===o.tag){var i=o.type,s=o.stateNode;if("function"==typeof i.getDerivedStateFromError||"function"==typeof s.componentDidCatch&&!d_(s)){var l=Sf(o,xm(o,ym(n,e),So),So),u=Ly();return void(null!==l&&(Sa(l,So,u),Uy(l,u)))}}o=o.return}a("Internal React error: Attempted to capture a commit phase error inside a detached tree. This indicates a bug in React. Likely causes include deleting the same fiber more than once, committing an already-finished tree, or an inconsistent return pointer.\n\nError message:\n\n%s",n)}else p_(e,e,n)}function m_(e,t,n){var r=e.pingCache;null!==r&&r.delete(t);var o=Ly();xa(e,n),function(e){0!==e.tag&&Nb()&&null===Bb.current&&a("A suspended resource finished loading inside a test, but the event was not wrapped in act(...).\n\nWhen testing, code that resolves suspended data should be wrapped into act(...):\n\nact(() => {\n /* finish loading suspended data */\n});\n/* assert on the output */\n\nThis ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act")}(e),Zb===e&&ba(ey,n)&&(ry===Yb||ry===Wb&&la(ey)&&Lr()-cy<dy?Zy(e,0):sy=ya(sy,n)),Uy(e,o)}function g_(e,t){0===t&&(t=Fy(e));var n=Ly(),r=df(e,t);null!==r&&(Sa(r,t,n),Uy(r,n))}function b_(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),g_(e,n)}function y_(e,t){var n,r=0;switch(e.tag){case c:n=e.stateNode;var o=e.memoizedState;null!==o&&(r=o.retryLane);break;case m:n=e.stateNode;break;default:throw new Error("Pinged unknown suspense boundary type. This is probably a bug in React.")}null!==n&&n.delete(t),g_(e,r)}function __(e,t){qe(e),v_(e,gr,$b),t&&v_(e,br,Rb),v_(e,gr,Ob),t&&v_(e,br,Ab),He()}function v_(e,t,n){for(var r=e,o=null;null!==r;){var a=r.subtreeFlags&t;r!==o&&null!==r.child&&0!==a?r=r.child:(0!==(r.flags&t)&&n(r),r=null!==r.sibling?r.sibling:o=r.return)}}var w_,S_=null;function x_(e){if((Qb&zb)===Ub&&1&e.mode){var t=e.tag;if(2===t||3===t||1===t||0===t||t===l||t===d||t===f){var n=je(e)||"ReactComponent";if(null!==S_){if(S_.has(n))return;S_.add(n)}else S_=new Set([n]);var r=Be;try{qe(e),a("Can't perform a React state update on a component that hasn't mounted yet. This indicates that you have a side-effect in your render function that asynchronously later calls tries to update the component. Move this work to useEffect instead.")}finally{r?qe(e):He()}}}}w_=function(e,t,n){var r=rv(null,t);try{return _g(e,t,n)}catch(a){if(Qc||null!==a&&"object"==typeof a&&"function"==typeof a.then)throw a;if(Zd(),xp(),Pg(0,t),rv(t,r),2&t.mode&&Vh(t),Zn(null,_g,null,e,t,n),Wn){var o=Jn();"object"==typeof o&&null!==o&&o._suppressLogging&&"object"==typeof a&&null!==a&&!a._suppressLogging&&(a._suppressLogging=!0)}throw a}};var T_,E_=!1;function k_(e,t){Xr&&e.memoizedUpdaters.forEach(function(n){Ea(e,n,t)})}T_=new Set;var P_={};function O_(e,t){var n=Bb.current;return null!==n?(n.push(t),P_):Cr(e,t)}function A_(e){if(e!==P_)return Dr(e)}function $_(){return null!==Bb.current}function R_(e){Ny=e}var I_=null,C_=null,D_=function(e){I_=e};function N_(e){if(null===I_)return e;var t=I_(e);return void 0===t?e:t.current}function M_(e){return N_(e)}function L_(e){if(null===I_)return e;var t=I_(e);if(void 0===t){if(null!=e&&"function"==typeof e.render){var n=N_(e.render);if(e.render!==n){var r={$$typeof:ie,render:n};return void 0!==e.displayName&&(r.displayName=e.displayName),r}}return e}return t.current}function j_(e,t){if(null===I_)return!1;var n=e.elementType,r=t.type,o=!1,a="object"==typeof r&&null!==r?r.$$typeof:null;switch(e.tag){case 1:"function"==typeof r&&(o=!0);break;case 0:("function"==typeof r||a===ce)&&(o=!0);break;case l:(a===ie||a===ce)&&(o=!0);break;case d:case f:(a===ue||a===ce)&&(o=!0);break;default:return!1}if(o){var i=I_(n);if(void 0!==i&&i===I_(r))return!0}return!1}function F_(e){null!==I_&&"function"==typeof WeakSet&&(null===C_&&(C_=new WeakSet),C_.add(e))}var B_=function(e,t){if(null!==I_){var n=t.staleFamilies,r=t.updatedFamilies;c_(),Yy(function(){z_(e.current,r,n)})}},U_=function(e,t){e.context===cc&&(c_(),Yy(function(){pv(t,e,null,null)}))};function z_(e,t,n){var r=e.alternate,o=e.child,a=e.sibling,i=e.tag,s=e.type,u=null;switch(i){case 0:case f:case 1:u=s;break;case l:u=s.render}if(null===I_)throw new Error("Expected resolveFamily to be set during hot reload.");var c=!1,d=!1;if(null!==u){var p=I_(u);void 0!==p&&(n.has(p)?d=!0:t.has(p)&&(1===i?d=!0:c=!0))}if(null!==C_&&(C_.has(e)||null!==r&&C_.has(r))&&(d=!0),d&&(e._debugNeedsRemount=!0),d||c){var h=df(e,So);null!==h&&By(h,e,So,ea)}null===o||d||z_(o,t,n),null!==a&&z_(a,t,n)}var V_,H_=function(e,t){var n=new Set,r=new Set(t.map(function(e){return e.current}));return q_(e.current,r,n),n};function q_(e,t,n){var r=e.child,o=e.sibling,a=e.tag,i=e.type,s=null;switch(a){case 0:case f:case 1:s=i;break;case l:s=i.render}var u=!1;null!==s&&t.has(s)&&(u=!0),u?function(e,t){var n=function(e,t){var n=e,r=!1;for(;;){if(5===n.tag)r=!0,t.add(n.stateNode);else if(null!==n.child){n.child.return=n,n=n.child;continue}if(n===e)return r;for(;null===n.sibling;){if(null===n.return||n.return===e)return r;n=n.return}n.sibling.return=n.return,n=n.sibling}return!1}(e,t);if(n)return;var r=e;for(;;){switch(r.tag){case 5:return void t.add(r.stateNode);case 4:case 3:return void t.add(r.stateNode.containerInfo)}if(null===r.return)throw new Error("Expected to reach root first.");r=r.return}}(e,n):null!==r&&q_(r,t,n),null!==o&&q_(o,t,n)}V_=!1;try{Object.preventExtensions({})}catch(rw){V_=!0}function G_(e,t,n,r){this.tag=e,this.key=n,this.elementType=null,this.type=null,this.stateNode=null,this.return=null,this.child=null,this.sibling=null,this.index=0,this.ref=null,this.pendingProps=t,this.memoizedProps=null,this.updateQueue=null,this.memoizedState=null,this.dependencies=null,this.mode=r,this.flags=0,this.subtreeFlags=0,this.deletions=null,this.lanes=0,this.childLanes=0,this.alternate=null,this.actualDuration=Number.NaN,this.actualStartTime=Number.NaN,this.selfBaseDuration=Number.NaN,this.treeBaseDuration=Number.NaN,this.actualDuration=0,this.actualStartTime=-1,this.selfBaseDuration=0,this.treeBaseDuration=0,this._debugSource=null,this._debugOwner=null,this._debugNeedsRemount=!1,this._debugHookTypes=null,V_||"function"!=typeof Object.preventExtensions||Object.preventExtensions(this)}var W_=function(e,t,n,r){return new G_(e,t,n,r)};function Y_(e){var t=e.prototype;return!(!t||!t.isReactComponent)}function K_(e,t){var n=e.alternate;null===n?((n=W_(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n._debugSource=e._debugSource,n._debugOwner=e._debugOwner,n._debugHookTypes=e._debugHookTypes,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null,n.actualDuration=0,n.actualStartTime=-1),n.flags=e.flags&Sr,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue;var r=e.dependencies;switch(n.dependencies=null===r?null:{lanes:r.lanes,firstContext:r.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.selfBaseDuration=e.selfBaseDuration,n.treeBaseDuration=e.treeBaseDuration,n._debugNeedsRemount=e._debugNeedsRemount,n.tag){case 2:case 0:case f:n.type=N_(e.type);break;case 1:n.type=M_(e.type);break;case l:n.type=L_(e.type)}return n}function X_(e,t){e.flags&=14680066;var n=e.alternate;if(null===n)e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null,e.selfBaseDuration=0,e.treeBaseDuration=0;else{e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type;var r=n.dependencies;e.dependencies=null===r?null:{lanes:r.lanes,firstContext:r.firstContext},e.selfBaseDuration=n.selfBaseDuration,e.treeBaseDuration=n.treeBaseDuration}return e}function Q_(e,t,n,r,o,i){var f=2,p=e;if("function"==typeof e)Y_(e)?(f=1,p=M_(p)):p=N_(p);else if("string"==typeof e)f=5;else e:switch(e){case te:return J_(n.children,o,i,t);case ne:f=8,1&(o|=8)&&(o|=bo);break;case re:return function(e,t,n,r){"string"!=typeof e.id&&a('Profiler must specify an "id" of type `string` as a prop. Received the type `%s` instead.',typeof e.id);var o=W_(u,e,r,2|t);return o.elementType=re,o.lanes=n,o.stateNode={effectDuration:0,passiveEffectDuration:0},o}(n,o,i,t);case se:return function(e,t,n,r){var o=W_(c,e,r,t);return o.elementType=se,o.lanes=n,o}(n,o,i,t);case le:return function(e,t,n,r){var o=W_(m,e,r,t);return o.elementType=le,o.lanes=n,o}(n,o,i,t);case de:return ev(n,o,i,t);default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case oe:f=s;break e;case ae:f=9;break e;case ie:f=l,p=L_(p);break e;case ue:f=d;break e;case ce:f=16,p=null;break e}var h="";(void 0===e||"object"==typeof e&&null!==e&&0===Object.keys(e).length)&&(h+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var g=r?je(r):null;throw g&&(h+="\n\nCheck the render method of `"+g+"`."),new Error("Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: "+(null==e?e:typeof e)+"."+h)}var b=W_(f,n,t,o);return b.elementType=e,b.type=p,b.lanes=i,b._debugOwner=r,b}function Z_(e,t,n){var r;r=e._owner;var o=Q_(e.type,e.key,e.props,r,t,n);return o._debugSource=e._source,o._debugOwner=e._owner,o}function J_(e,t,n,r){var o=W_(7,e,r,t);return o.lanes=n,o}function ev(e,t,n,r){var o=W_(b,e,r,t);o.elementType=de,o.lanes=n;return o.stateNode={isHidden:!1},o}function tv(e,t,n){var r=W_(6,e,null,t);return r.lanes=n,r}function nv(e,t,n){var r=null!==e.children?e.children:[],o=W_(4,r,e.key,t);return o.lanes=n,o.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},o}function rv(e,t){return null===e&&(e=W_(2,null,null,0)),e.tag=t.tag,e.key=t.key,e.elementType=t.elementType,e.type=t.type,e.stateNode=t.stateNode,e.return=t.return,e.child=t.child,e.sibling=t.sibling,e.index=t.index,e.ref=t.ref,e.pendingProps=t.pendingProps,e.memoizedProps=t.memoizedProps,e.updateQueue=t.updateQueue,e.memoizedState=t.memoizedState,e.dependencies=t.dependencies,e.mode=t.mode,e.flags=t.flags,e.subtreeFlags=t.subtreeFlags,e.deletions=t.deletions,e.lanes=t.lanes,e.childLanes=t.childLanes,e.alternate=t.alternate,e.actualDuration=t.actualDuration,e.actualStartTime=t.actualStartTime,e.selfBaseDuration=t.selfBaseDuration,e.treeBaseDuration=t.treeBaseDuration,e._debugSource=t._debugSource,e._debugOwner=t._debugOwner,e._debugNeedsRemount=t._debugNeedsRemount,e._debugHookTypes=t._debugHookTypes,e}function ov(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.pendingChildren=null,this.current=null,this.pingCache=null,this.finishedWork=null,this.timeoutHandle=-1,this.context=null,this.pendingContext=null,this.callbackNode=null,this.callbackPriority=0,this.eventTimes=wa(0),this.expirationTimes=wa(ea),this.pendingLanes=0,this.suspendedLanes=0,this.pingedLanes=0,this.expiredLanes=0,this.mutableReadLanes=0,this.finishedLanes=0,this.entangledLanes=0,this.entanglements=wa(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null,this.effectDuration=0,this.passiveEffectDuration=0,this.memoizedUpdaters=new Set;for(var a=this.pendingUpdatersLaneMap=[],i=0;i<wo;i++)a.push(new Set);switch(t){case 1:this._debugRootType=n?"hydrateRoot()":"createRoot()";break;case 0:this._debugRootType=n?"hydrate()":"render()"}}function av(e,t,n,r,o,a,i,s,l,u){var c=new ov(e,t,n,s,l),d=function(e,t){var n;return 1===e?(n=1,!0===t&&(n|=8,n|=bo)):n=0,Xr&&(n|=2),W_(3,null,null,n)}(t,a);c.current=d,d.stateNode=c;var f={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null};return d.memoizedState=f,_f(d),c}var iv,sv,lv="18.3.1";function uv(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return function(e){if(A(e))a("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",O(e)),$(e)}(r),{$$typeof:ee,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}function cv(e){if(!e)return cc;var t=er(e),n=Ec(t);if(1===t.tag){var r=t.type;if(yc(r))return Sc(t,r,n)}return n}function dv(e,t,n,r,o,a,i,s){return av(e,t,!1,null,0,r,0,a,i)}function fv(e,t,n,r,o,a,i,s,l,u){var c=av(n,r,!0,e,0,a,0,s,l);c.context=cv(null);var d=c.current,f=Ly(),p=jy(d),h=wf(f,p);return h.callback=null!=t?t:null,Sf(d,h,p),function(e,t,n){e.current.lanes=t,Sa(e,t,n),Uy(e,n)}(c,p,f),c}function pv(e,t,n,r){!function(e,t){if(Wr&&"function"==typeof Wr.onScheduleFiberRoot)try{Wr.onScheduleFiberRoot(Gr,e,t)}catch(n){Kr||(Kr=!0,a("React instrumentation encountered an error: %s",n))}}(t,e);var o=t.current,i=Ly(),s=jy(o);!function(e){null!==Yr&&"function"==typeof Yr.markRenderScheduled&&Yr.markRenderScheduled(e)}(s);var l=cv(n);null===t.context?t.context=l:t.pendingContext=l,Ue&&null!==Be&&!iv&&(iv=!0,a("Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate.\n\nCheck the render method of %s.",je(Be)||"Unknown"));var u=wf(i,s);u.payload={element:e},null!==(r=void 0===r?null:r)&&("function"!=typeof r&&a("render(...): Expected the last optional `callback` argument to be a function. Instead received: %s.",r),u.callback=r);var c=Sf(o,u,s);return null!==c&&(By(c,o,s,i),xf(c,o,s)),s}function hv(e){var t=e.current;return t.child?(t.child.tag,t.child.stateNode):null}function mv(e,t){var n,r,o=e.memoizedState;null!==o&&null!==o.dehydrated&&(o.retryLane=(n=o.retryLane,r=t,0!==n&&n<r?n:r))}function gv(e,t){mv(e,t);var n=e.alternate;n&&mv(n,t)}function bv(e){var t=Rr(e);return null===t?null:t.stateNode}iv=!1,sv={};var yv=function(e){return null};var _v=function(e){return!1};var vv,wv,Sv,xv,Tv,Ev,kv,Pv,Ov,Av=function(e,t,n){var r=t[n],o=vt(e)?e.slice():we({},e);return n+1===t.length?(vt(o)?o.splice(r,1):delete o[r],o):(o[r]=Av(e[r],t,n+1),o)},$v=function(e,t){return Av(e,t,0)},Rv=function(e,t,n,r){var o=t[r],a=vt(e)?e.slice():we({},e);r+1===t.length?(a[n[r]]=a[o],vt(a)?a.splice(o,1):delete a[o]):a[o]=Rv(e[o],t,n,r+1);return a},Iv=function(e,t,n){if(t.length===n.length){for(var r=0;r<n.length-1;r++)if(t[r]!==n[r])return void o("copyWithRename() expects paths to be the same except for the deepest key");return Rv(e,t,n,0)}o("copyWithRename() expects paths of the same length")},Cv=function(e,t,n,r){if(n>=t.length)return r;var o=t[n],a=vt(e)?e.slice():we({},e);return a[o]=Cv(e[o],t,n+1,r),a},Dv=function(e,t,n){return Cv(e,t,0,n)},Nv=function(e,t){for(var n=e.memoizedState;null!==n&&t>0;)n=n.next,t--;return n};function Mv(e){var t=Ar(e);return null===t?null:t.stateNode}function Lv(e){return null}function jv(){return Be}vv=function(e,t,n,r){var o=Nv(e,t);if(null!==o){var a=Dv(o.memoizedState,n,r);o.memoizedState=a,o.baseState=a,e.memoizedProps=we({},e.memoizedProps);var i=df(e,So);null!==i&&By(i,e,So,ea)}},wv=function(e,t,n){var r=Nv(e,t);if(null!==r){var o=$v(r.memoizedState,n);r.memoizedState=o,r.baseState=o,e.memoizedProps=we({},e.memoizedProps);var a=df(e,So);null!==a&&By(a,e,So,ea)}},Sv=function(e,t,n,r){var o=Nv(e,t);if(null!==o){var a=Iv(o.memoizedState,n,r);o.memoizedState=a,o.baseState=a,e.memoizedProps=we({},e.memoizedProps);var i=df(e,So);null!==i&&By(i,e,So,ea)}},xv=function(e,t,n){e.pendingProps=Dv(e.memoizedProps,t,n),e.alternate&&(e.alternate.pendingProps=e.pendingProps);var r=df(e,So);null!==r&&By(r,e,So,ea)},Tv=function(e,t){e.pendingProps=$v(e.memoizedProps,t),e.alternate&&(e.alternate.pendingProps=e.pendingProps);var n=df(e,So);null!==n&&By(n,e,So,ea)},Ev=function(e,t,n){e.pendingProps=Iv(e.memoizedProps,t,n),e.alternate&&(e.alternate.pendingProps=e.pendingProps);var r=df(e,So);null!==r&&By(r,e,So,ea)},kv=function(e){var t=df(e,So);null!==t&&By(t,e,So,ea)},Pv=function(e){yv=e},Ov=function(e){_v=e};var Fv="function"==typeof reportError?reportError:function(e){console.error(e)};function Bv(e){this._internalRoot=e}function Uv(e){this._internalRoot=e}function zv(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}function Vv(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function Hv(e){1===e.nodeType&&e.tagName&&"BODY"===e.tagName.toUpperCase()&&a("createRoot(): Creating roots directly with document.body is discouraged, since its children are often manipulated by third-party scripts and browser extensions. This may lead to subtle reconciliation issues. Try using a container element created for your app."),Wu(e)&&(e._reactRootContainer?a("You are calling ReactDOMClient.createRoot() on a container that was previously passed to ReactDOM.render(). This is not supported."):a("You are calling ReactDOMClient.createRoot() on a container that has already been passed to createRoot() before. Instead, call root.render() on the existing root instead if you want to update it."))}Uv.prototype.render=Bv.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw new Error("Cannot update an unmounted root.");"function"==typeof arguments[1]?a("render(...): does not support the second callback argument. To execute a side effect after rendering, declare it in a component body with useEffect()."):zv(arguments[1])?a("You passed a container to the second argument of root.render(...). You don't need to pass it again since you already passed it to create the root."):void 0!==arguments[1]&&a("You passed a second argument to root.render(...) but it only accepts one argument.");var n=t.containerInfo;if(8!==n.nodeType){var r=bv(t.current);r&&r.parentNode!==n&&a("render(...): It looks like the React-rendered content of the root container was removed without using React. This is not supported and will cause errors. Instead, call root.unmount() to empty a root's container.")}pv(e,t,null,null)},Uv.prototype.unmount=Bv.prototype.unmount=function(){"function"==typeof arguments[0]&&a("unmount(...): does not support a callback argument. To execute a side effect after rendering, declare it in a component body with useEffect().");var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;Ky()&&a("Attempted to synchronously unmount a root while React was already rendering. React cannot finish unmounting the root until the current render has completed, which may lead to a race condition."),Yy(function(){pv(null,e,null,null)}),Gu(t)}},Uv.prototype.unstable_scheduleHydration=function(e){e&&function(e){for(var t=$a(),n={blockedOn:null,target:e,priority:t},r=0;r<Xa.length&&Fa(t,Xa[r].priority);r++);Xa.splice(r,0,n),0===r&&ei(n)}(e)};var qv,Gv=n.ReactCurrentOwner;function Wv(e){return e?9===e.nodeType?e.documentElement:e.firstChild:null}function Yv(){}function Kv(e,t,n,r,o){qv(n),function(e,t){null!==e&&"function"!=typeof e&&a("%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.",t,e)}(void 0===o?null:o,"render");var i,s=n._reactRootContainer;if(s){if("function"==typeof o){var l=o;o=function(){var e=hv(i);l.call(e)}}pv(t,i=s,e,o)}else i=function(e,t,n,r,o){if(o){if("function"==typeof r){var a=r;r=function(){var e=hv(i);a.call(e)}}var i=fv(t,r,e,0,0,!1,0,"",Yv);return e._reactRootContainer=i,qu(i.current,e),gl(8===e.nodeType?e.parentNode:e),Yy(),i}for(var s;s=e.lastChild;)e.removeChild(s);if("function"==typeof r){var l=r;r=function(){var e=hv(u);l.call(e)}}var u=dv(e,0,0,!1,0,"",Yv);return e._reactRootContainer=u,qu(u.current,e),gl(8===e.nodeType?e.parentNode:e),Yy(function(){pv(t,u,n,r)}),u}(n,t,e,o,r);return hv(i)}qv=function(e){if(e._reactRootContainer&&8!==e.nodeType){var t=bv(e._reactRootContainer.current);t&&t.parentNode!==e&&a("render(...): It looks like the React-rendered content of this container was removed without using React. This is not supported and will cause errors. Instead, call ReactDOM.unmountComponentAtNode to empty a container.")}var n=!!e._reactRootContainer,r=Wv(e);!(!r||!Ku(r))&&!n&&a("render(...): Replacing React-rendered children with a new root component. If you intended to update the children of this node, you should instead have the existing children update their state and render the new components instead of calling ReactDOM.render."),1===e.nodeType&&e.tagName&&"BODY"===e.tagName.toUpperCase()&&a("render(): Rendering components directly into document.body is discouraged, since its children are often manipulated by third-party scripts and browser extensions. This may lead to subtle reconciliation issues. Try rendering into a container element created for your app.")};var Xv=!1;var Qv=!1;Pa=function(e){switch(e.tag){case 3:var t=e.stateNode;if(Ua(t)){var n=function(e){return ra(e.pendingLanes)}(t);!function(e,t){0!==t&&(Ta(e,ya(t,So)),Uy(e,Lr()),(Qb&(zb|Vb))===Ub&&(my(),Rc()))}(t,n)}break;case c:Yy(function(){var t=df(e,So);if(null!==t){var n=Ly();By(t,e,So,n)}}),gv(e,So)}},function(e){Oa=e}(function(e){if(e.tag===c){var t=Yo,n=df(e,t);if(null!==n)By(n,e,t,Ly());gv(e,t)}}),function(e){Aa=e}(function(e){if(e.tag===c){var t=jy(e),n=df(e,t);if(null!==n)By(n,e,t,Ly());gv(e,t)}}),function(e){$a=e}(La),function(e){Ra=e}(function(e,t){var n=Ma;try{return Ma=e,t()}finally{Ma=n}}),"function"==typeof Map&&null!=Map.prototype&&"function"==typeof Map.prototype.forEach&&"function"==typeof Set&&null!=Set.prototype&&"function"==typeof Set.prototype.clear&&"function"==typeof Set.prototype.forEach||a("React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),An=function(e,t,n){switch(t){case"input":return void ft(e,n);case"textarea":return void function(e,t){At(e,t)}(e,n);case"select":return void function(e,t){var n=e,r=t.value;null!=r&&xt(n,!!t.multiple,r,!1)}(e,n)}},Nn=Wy,Mn=Yy;var Zv,Jv,ew,tw={usingClientEntryPoint:!1,Events:[Ku,Xu,Qu,Cn,Dn,Wy]};if(!(Jv=(Zv={findFiberByHostInstance:Yu,bundleType:1,version:lv,rendererPackageName:"react-dom"}).findFiberByHostInstance,ew=n.ReactCurrentDispatcher,function(e){if("undefined"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)return!1;var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t.isDisabled)return!0;if(!t.supportsFiber)return a("The installed version of React DevTools is too old and will not work with the current version of React. Please update React DevTools. https://reactjs.org/link/react-devtools"),!0;try{e=we({},e,{getLaneLabelMap:Jr,injectProfilingHooks:Zr}),Gr=t.inject(e),Wr=t}catch(n){a("React instrumentation encountered an error: %s.",n)}return!!t.checkDCE}({bundleType:Zv.bundleType,version:Zv.version,rendererPackageName:Zv.rendererPackageName,rendererConfig:Zv.rendererConfig,overrideHookState:vv,overrideHookStateDeletePath:wv,overrideHookStateRenamePath:Sv,overrideProps:xv,overridePropsDeletePath:Tv,overridePropsRenamePath:Ev,setErrorHandler:Pv,setSuspenseHandler:Ov,scheduleUpdate:kv,currentDispatcherRef:ew,findHostInstanceByFiber:Mv,findFiberByHostInstance:Jv||Lv,findHostInstancesForRefresh:H_,scheduleRefresh:B_,scheduleRoot:U_,setRefreshHandler:D_,getCurrentFiber:jv,reconcilerVersion:lv}))&&k&&window.top===window.self&&(navigator.userAgent.indexOf("Chrome")>-1&&-1===navigator.userAgent.indexOf("Edge")||navigator.userAgent.indexOf("Firefox")>-1)){var nw=window.location.protocol;/^(https?|file):$/.test(nw)&&console.info("%cDownload the React DevTools for a better development experience: https://reactjs.org/link/react-devtools"+("file:"===nw?"\nYou might need to use a local HTTP server (instead of file://): https://reactjs.org/link/react-devtools-faq":""),"font-weight:bold")}reactDom_development.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=tw,reactDom_development.createPortal=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!zv(t))throw new Error("Target container is not a DOM element.");return uv(e,t,null,n)},reactDom_development.createRoot=function(e,t){return tw.usingClientEntryPoint||a('You are importing createRoot from "react-dom" which is not supported. You should instead import it from "react-dom/client".'),function(e,t){if(!zv(e))throw new Error("createRoot(...): Target container is not a DOM element.");Hv(e);var n=!1,r="",i=Fv;null!=t&&(t.hydrate?o("hydrate through createRoot is deprecated. Use ReactDOMClient.hydrateRoot(container, <App />) instead."):"object"==typeof t&&null!==t&&t.$$typeof===J&&a("You passed a JSX element to createRoot. You probably meant to call root.render instead. Example usage:\n\n let root = createRoot(domContainer);\n root.render(<App />);"),!0===t.unstable_strictMode&&(n=!0),void 0!==t.identifierPrefix&&(r=t.identifierPrefix),void 0!==t.onRecoverableError&&(i=t.onRecoverableError),void 0!==t.transitionCallbacks&&t.transitionCallbacks);var s=dv(e,1,0,n,0,r,i);return qu(s.current,e),gl(8===e.nodeType?e.parentNode:e),new Bv(s)}(e,t)},reactDom_development.findDOMNode=function(e){Xv||(Xv=!0,a("findDOMNode is deprecated and will be removed in the next major release. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node"));var t=Gv.current;return null!==t&&null!==t.stateNode&&(t.stateNode._warnedAboutRefsInRender||a("%s is accessing findDOMNode inside its render(). render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.",Me(t.type)||"A component"),t.stateNode._warnedAboutRefsInRender=!0),null==e?null:1===e.nodeType?e:function(e,t){var n=er(e);if(void 0===n){if("function"==typeof e.render)throw new Error("Unable to find node on an unmounted component.");var r=Object.keys(e).join(",");throw new Error("Argument appears to not be a ReactComponent. Keys: "+r)}var o=Ar(n);if(null===o)return null;if(8&o.mode){var i=je(n)||"Component";if(!sv[i]){sv[i]=!0;var s=Be;try{qe(o),8&n.mode?a("%s is deprecated in StrictMode. %s was passed an instance of %s which is inside StrictMode. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node",t,t,i):a("%s is deprecated in StrictMode. %s was passed an instance of %s which renders StrictMode children. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node",t,t,i)}finally{s?qe(s):He()}}}return o.stateNode}(e,"findDOMNode")},reactDom_development.flushSync=function(e){return Ky()&&a("flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task."),Yy(e)},reactDom_development.hydrate=function(e,t,n){if(a("ReactDOM.hydrate is no longer supported in React 18. Use hydrateRoot instead. Until you switch to the new API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot"),!Vv(t))throw new Error("Target container is not a DOM element.");return Wu(t)&&void 0===t._reactRootContainer&&a("You are calling ReactDOM.hydrate() on a container that was previously passed to ReactDOMClient.createRoot(). This is not supported. Did you mean to call hydrateRoot(container, element)?"),Kv(null,e,t,!0,n)},reactDom_development.hydrateRoot=function(e,t,n){return tw.usingClientEntryPoint||a('You are importing hydrateRoot from "react-dom" which is not supported. You should instead import it from "react-dom/client".'),function(e,t,n){if(!zv(e))throw new Error("hydrateRoot(...): Target container is not a DOM element.");Hv(e),void 0===t&&a("Must provide initial children as second argument to hydrateRoot. Example usage: hydrateRoot(domContainer, <App />)");var r=null!=n&&n.hydratedSources||null,o=!1,i="",s=Fv;null!=n&&(!0===n.unstable_strictMode&&(o=!0),void 0!==n.identifierPrefix&&(i=n.identifierPrefix),void 0!==n.onRecoverableError&&(s=n.onRecoverableError));var l=fv(t,null,e,1,0,o,0,i,s);if(qu(l.current,e),gl(e),r)for(var u=0;u<r.length;u++)Zf(l,r[u]);return new Uv(l)}(e,t,n)},reactDom_development.render=function(e,t,n){if(a("ReactDOM.render is no longer supported in React 18. Use createRoot instead. Until you switch to the new API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot"),!Vv(t))throw new Error("Target container is not a DOM element.");return Wu(t)&&void 0===t._reactRootContainer&&a("You are calling ReactDOM.render() on a container that was previously passed to ReactDOMClient.createRoot(). This is not supported. Did you mean to call root.render(element)?"),Kv(null,e,t,!1,n)},reactDom_development.unmountComponentAtNode=function(e){if(Qv||(Qv=!0,a("unmountComponentAtNode is deprecated and will be removed in the next major release. Switch to the createRoot API. Learn more: https://reactjs.org/link/switch-to-createroot")),!Vv(e))throw new Error("unmountComponentAtNode(...): Target container is not a DOM element.");if(Wu(e)&&void 0===e._reactRootContainer&&a("You are calling ReactDOM.unmountComponentAtNode() on a container that was previously passed to ReactDOMClient.createRoot(). This is not supported. Did you mean to call root.unmount()?"),e._reactRootContainer){var t=Wv(e);return t&&!Ku(t)&&a("unmountComponentAtNode(): The node you're attempting to unmount was rendered by another copy of React."),Yy(function(){Kv(null,null,e,!1,function(){e._reactRootContainer=null,Gu(e)})}),!0}var n=Wv(e),r=!(!n||!Ku(n)),o=1===e.nodeType&&Vv(e.parentNode)&&!!e.parentNode._reactRootContainer;return r&&a("unmountComponentAtNode(): The node you're attempting to unmount was rendered by React and is not a top-level container. %s",o?"You may have accidentally passed in a React root node instead of its container.":"Instead, have the parent component update its state and rerender in order to remove this component."),!1},reactDom_development.unstable_batchedUpdates=Wy,reactDom_development.unstable_renderSubtreeIntoContainer=function(e,t,n,r){return function(e,t,n,r){if(a("ReactDOM.unstable_renderSubtreeIntoContainer() is no longer supported in React 18. Consider using a portal instead. Until you switch to the createRoot API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot"),!Vv(n))throw new Error("Target container is not a DOM element.");if(null==e||void 0===e._reactInternals)throw new Error("parentComponent must be a valid React Component");return Kv(e,t,n,!1,r)}(e,t,n,r)},reactDom_development.version=lv,"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),reactDom_development}function checkDCE(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE){if("production"!==process.env.NODE_ENV)throw new Error("^_^");try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE)}catch(e){console.error(e)}}}"production"===process.env.NODE_ENV?(checkDCE(),reactDom.exports=requireReactDom_production_min()):reactDom.exports=requireReactDom_development();var reactDomExports=reactDom.exports,createRoot,m=reactDomExports;if("production"===process.env.NODE_ENV)createRoot=m.createRoot,m.hydrateRoot;else{var i=m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;createRoot=function(e,t){i.usingClientEntryPoint=!0;try{return m.createRoot(e,t)}finally{i.usingClientEntryPoint=!1}}}var reactExports=requireReact();const LogoIcon=()=>jsxRuntimeExports.jsxs("svg",{viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("path",{d:"M16 4C9.37 4 4 9.37 4 16s5.37 12 12 12 12-5.37 12-12S22.63 4 16 4z",fill:"#2563eb"}),jsxRuntimeExports.jsx("path",{d:"M16 8c-2.2 0-4 1.8-4 4v4c0 2.2 1.8 4 4 4s4-1.8 4-4v-4c0-2.2-1.8-4-4-4z",fill:"white"}),jsxRuntimeExports.jsx("path",{d:"M22 16c0 3.3-2.7 6-6 6s-6-2.7-6-6H8c0 4.1 3.1 7.5 7 7.9V26h2v-2.1c3.9-.4 7-3.8 7-7.9h-2z",fill:"white"})]}),MicIcon=()=>jsxRuntimeExports.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z"}),jsxRuntimeExports.jsx("path",{d:"M19 10v2a7 7 0 0 1-14 0v-2"}),jsxRuntimeExports.jsx("line",{x1:"12",x2:"12",y1:"19",y2:"22"})]}),CloseIcon=()=>jsxRuntimeExports.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),jsxRuntimeExports.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),MinimizeIcon=()=>jsxRuntimeExports.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),jsxRuntimeExports.jsx("path",{d:"M9 3v18"})]}),ErrorIcon=()=>jsxRuntimeExports.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("circle",{cx:"12",cy:"12",r:"10"}),jsxRuntimeExports.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),jsxRuntimeExports.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}),ChatIcon=()=>jsxRuntimeExports.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntimeExports.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})});function FloatingPanel({children:e,position:t,onClose:n,onMinimize:r}){const o=reactExports.useRef(null),a=reactExports.useRef(!1),i=reactExports.useRef({x:0,y:0,right:20,bottom:20}),s=reactExports.useCallback(e=>{if(e.target.closest("button"))return;a.current=!0;const t=o.current;t&&(i.current={x:e.clientX,y:e.clientY,right:parseInt(t.style.right||"20"),bottom:parseInt(t.style.bottom||"20")})},[]);reactExports.useEffect(()=>{const e=e=>{if(!a.current||!o.current)return;const t=i.current.x-e.clientX,n=i.current.y-e.clientY;o.current.style.right=`${i.current.right+t}px`,o.current.style.bottom=`${i.current.bottom+n}px`},t=()=>{a.current=!1};return document.addEventListener("mousemove",e),document.addEventListener("mouseup",t),()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t)}},[]);const l={bottom:(null==t?void 0:t.bottom)??20,right:(null==t?void 0:t.right)??20,...void 0!==(null==t?void 0:t.top)&&{top:t.top,bottom:"auto"},...void 0!==(null==t?void 0:t.left)&&{left:t.left,right:"auto"}};return jsxRuntimeExports.jsxs("div",{ref:o,className:"scribe-panel",style:l,children:[jsxRuntimeExports.jsxs("div",{className:"panel-header",onMouseDown:s,children:[jsxRuntimeExports.jsxs("div",{className:"drag-handle",children:[jsxRuntimeExports.jsx("span",{}),jsxRuntimeExports.jsx("span",{}),jsxRuntimeExports.jsx("span",{}),jsxRuntimeExports.jsx("span",{}),jsxRuntimeExports.jsx("span",{}),jsxRuntimeExports.jsx("span",{})]}),jsxRuntimeExports.jsxs("div",{className:"header-actions",children:[jsxRuntimeExports.jsx("button",{className:"header-btn",onClick:r,title:"Minimize",children:jsxRuntimeExports.jsx(MinimizeIcon,{})}),jsxRuntimeExports.jsx("button",{className:"header-btn",onClick:n,title:"Close",children:jsxRuntimeExports.jsx(CloseIcon,{})})]})]}),jsxRuntimeExports.jsx("div",{className:"panel-content",children:e})]})}function ConfigState({onSubmit:e,initialApiKey:t="",initialBaseUrl:n=""}){const[r,o]=reactExports.useState(t),[a,i]=reactExports.useState(n),[s,l]=reactExports.useState("");return jsxRuntimeExports.jsxs("div",{className:"config-state",children:[jsxRuntimeExports.jsxs("div",{className:"logo",children:[jsxRuntimeExports.jsx("div",{className:"logo-icon",children:jsxRuntimeExports.jsx(LogoIcon,{})}),jsxRuntimeExports.jsx("span",{className:"logo-text",children:"eka.scribe"})]}),jsxRuntimeExports.jsxs("form",{className:"config-form",onSubmit:t=>{t.preventDefault(),a.trim()?(l(""),e(r.trim(),a.trim())):l("Base URL is required")},children:[jsxRuntimeExports.jsxs("div",{className:"form-group",children:[jsxRuntimeExports.jsx("label",{htmlFor:"eka-api-key",children:"API Key"}),jsxRuntimeExports.jsx("input",{id:"eka-api-key",type:"text",value:r,onChange:e=>o(e.target.value),placeholder:"Enter your API key (optional)"})]}),jsxRuntimeExports.jsxs("div",{className:"form-group",children:[jsxRuntimeExports.jsx("label",{htmlFor:"eka-base-url",children:"Base URL"}),jsxRuntimeExports.jsx("input",{id:"eka-base-url",type:"text",value:a,onChange:e=>i(e.target.value),placeholder:"https://api.eka.care",required:!0})]}),s&&jsxRuntimeExports.jsx("p",{className:"config-error",children:s}),jsxRuntimeExports.jsx("button",{type:"submit",className:"config-submit-btn",children:"Continue"})]})]})}function IdleState({onStartRecording:e}){return jsxRuntimeExports.jsxs("div",{className:"idle-state",children:[jsxRuntimeExports.jsxs("div",{className:"logo",children:[jsxRuntimeExports.jsx("div",{className:"logo-icon",children:jsxRuntimeExports.jsx(LogoIcon,{})}),jsxRuntimeExports.jsx("span",{className:"logo-text",children:"eka.scribe"})]}),jsxRuntimeExports.jsxs("button",{className:"start-btn",onClick:e,children:["Start Recording",jsxRuntimeExports.jsx("span",{className:"mic-icon",children:jsxRuntimeExports.jsx(MicIcon,{})})]})]})}function PermissionState({onRequestPermission:e}){return jsxRuntimeExports.jsxs("div",{className:"permission-state",children:[jsxRuntimeExports.jsx("div",{className:"permission-icon",children:jsxRuntimeExports.jsx(MicIcon,{})}),jsxRuntimeExports.jsxs("p",{className:"permission-text",children:["Microphone access is required to record audio.",jsxRuntimeExports.jsx("br",{}),"Please allow access when prompted."]}),jsxRuntimeExports.jsx("button",{className:"permission-btn",onClick:e,children:"Allow Microphone"})]})}function formatTime(e){const t=e%60;return`${Math.floor(e/60).toString().padStart(2,"0")}:${t.toString().padStart(2,"0")}`}function RecordingState({elapsedTime:e,isPaused:t,onPause:n,onResume:r,onStop:o}){return jsxRuntimeExports.jsxs("div",{className:"recording-state",children:[jsxRuntimeExports.jsxs("div",{className:"recording-indicator",children:[jsxRuntimeExports.jsx("div",{className:"recording-icon "+(t?"":"active"),children:jsxRuntimeExports.jsx(ChatIcon,{})}),jsxRuntimeExports.jsx("span",{className:"timer",children:formatTime(e)})]}),jsxRuntimeExports.jsxs("div",{className:"recording-actions",children:[t?jsxRuntimeExports.jsx("button",{className:"resume-btn",onClick:r,children:"Resume"}):jsxRuntimeExports.jsx("button",{className:"pause-btn",onClick:n,children:"Pause"}),jsxRuntimeExports.jsx("button",{className:"stop-btn",onClick:o,title:"Stop recording",children:jsxRuntimeExports.jsx("div",{className:"stop-icon"})})]})]})}function ProcessingState(){return jsxRuntimeExports.jsxs("div",{className:"processing-state",children:[jsxRuntimeExports.jsx("div",{className:"spinner"}),jsxRuntimeExports.jsx("p",{className:"processing-text",children:"Processing your recording..."})]})}function ResultsState({result:e,onNewRecording:t}){return jsxRuntimeExports.jsxs("div",{className:"results-state",children:[jsxRuntimeExports.jsxs("div",{className:"results-header",children:[jsxRuntimeExports.jsx("span",{className:"results-title",children:"Recording Complete"}),jsxRuntimeExports.jsx("button",{className:"new-recording-btn",onClick:t,children:"New Recording"})]}),jsxRuntimeExports.jsx("div",{className:"results-content",children:jsxRuntimeExports.jsxs("div",{className:"transcript-section",children:[jsxRuntimeExports.jsx("div",{className:"section-title",children:"Transcript"}),jsxRuntimeExports.jsx("div",{className:"transcript-text",children:e.transcript||"No transcript available."})]})})]})}function ErrorState({message:e,onRetry:t}){return jsxRuntimeExports.jsxs("div",{className:"error-state",children:[jsxRuntimeExports.jsx("div",{className:"error-icon",children:jsxRuntimeExports.jsx(ErrorIcon,{})}),jsxRuntimeExports.jsx("p",{className:"error-message",children:e}),jsxRuntimeExports.jsx("button",{className:"retry-btn",onClick:t,children:"Try Again"})]})}const WELL_KNOWN_PATH="/.well-known/medscribealliance";var SessionStatus,SessionStatus2,TemplateStatus,TemplateStatus2,UploadType,UploadType2,ErrorCode,ErrorCode2,HttpStatus,HttpStatus2;SessionStatus2=SessionStatus||(SessionStatus={}),SessionStatus2.CREATED="created",SessionStatus2.PROCESSING="processing",SessionStatus2.COMPLETED="completed",SessionStatus2.PARTIAL="partial",SessionStatus2.FAILED="failed",TemplateStatus2=TemplateStatus||(TemplateStatus={}),TemplateStatus2.SUCCESS="success",TemplateStatus2.FAILED="failed",UploadType2=UploadType||(UploadType={}),UploadType2.CHUNKED="chunked",UploadType2.SINGLE="single",ErrorCode2=ErrorCode||(ErrorCode={}),ErrorCode2.AUTHENTICATION_FAILED="authentication_failed",ErrorCode2.TOKEN_EXPIRED="token_expired",ErrorCode2.INVALID_API_KEY="invalid_api_key",ErrorCode2.FORBIDDEN="forbidden",ErrorCode2.RATE_LIMIT_EXCEEDED="rate_limit_exceeded",ErrorCode2.SESSION_NOT_FOUND="session_not_found",ErrorCode2.TEMPLATE_NOT_FOUND="template_not_found",ErrorCode2.WEBHOOK_NOT_FOUND="webhook_not_found",ErrorCode2.SESSION_EXPIRED="session_expired",ErrorCode2.INVALID_REQUEST="invalid_request",ErrorCode2.INVALID_AUDIO_FORMAT="invalid_audio_format",ErrorCode2.CHUNK_TOO_LARGE="chunk_too_large",ErrorCode2.INVALID_TEMPLATE="invalid_template",ErrorCode2.MISSING_REQUIRED_FIELD="missing_required_field",ErrorCode2.PROCESSING_FAILED="processing_failed",ErrorCode2.AUDIO_QUALITY_POOR="audio_quality_poor",ErrorCode2.AUDIO_TOO_SHORT="audio_too_short",ErrorCode2.LANGUAGE_UNSUPPORTED="language_unsupported",ErrorCode2.INTERNAL_ERROR="internal_error",ErrorCode2.SERVICE_UNAVAILABLE="service_unavailable",HttpStatus2=HttpStatus||(HttpStatus={}),HttpStatus2[HttpStatus2.OK=200]="OK",HttpStatus2[HttpStatus2.CREATED=201]="CREATED",HttpStatus2[HttpStatus2.ACCEPTED=202]="ACCEPTED",HttpStatus2[HttpStatus2.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",HttpStatus2[HttpStatus2.BAD_REQUEST=400]="BAD_REQUEST",HttpStatus2[HttpStatus2.UNAUTHORIZED=401]="UNAUTHORIZED",HttpStatus2[HttpStatus2.FORBIDDEN=403]="FORBIDDEN",HttpStatus2[HttpStatus2.NOT_FOUND=404]="NOT_FOUND",HttpStatus2[HttpStatus2.GONE=410]="GONE",HttpStatus2[HttpStatus2.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",HttpStatus2[HttpStatus2.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",HttpStatus2[HttpStatus2.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",HttpStatus2[HttpStatus2.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE";class DiscoveryAPI{constructor(e){this.cachedDiscovery=null,this.cacheTimestamp=0,this.cacheDuration=36e5,this.httpClient=e}async getDiscovery(e,t=!1){const n=Date.now();if(!t&&this.cachedDiscovery&&n-this.cacheTimestamp<this.cacheDuration)return this.cachedDiscovery;const r=e+WELL_KNOWN_PATH,o=await this.httpClient.get(r);return this.cachedDiscovery=o,this.cacheTimestamp=n,o}clearCache(){this.cachedDiscovery=null,this.cacheTimestamp=0}getCachedDiscovery(){const e=Date.now();return this.cachedDiscovery&&e-this.cacheTimestamp<this.cacheDuration?this.cachedDiscovery:null}}var ajv={exports:{}},core$2={},validate={},boolSchema={},errors={},codegen={},code$1={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class n extends t{constructor(t){if(super(),!e.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=n;class r extends t{constructor(e){super(),this._items="string"==typeof e?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const e=this._items[0];return""===e||'""'===e}get str(){var e;return null!==(e=this._str)&&void 0!==e?e:this._str=this._items.reduce((e,t)=>`${e}${t}`,"")}get names(){var e;return null!==(e=this._names)&&void 0!==e?e:this._names=this._items.reduce((e,t)=>(t instanceof n&&(e[t.str]=(e[t.str]||0)+1),e),{})}}function o(e,...t){const n=[e[0]];let o=0;for(;o<t.length;)s(n,t[o]),n.push(e[++o]);return new r(n)}e._Code=r,e.nil=new r(""),e._=o;const a=new r("+");function i(e,...t){const n=[u(e[0])];let o=0;for(;o<t.length;)n.push(a),s(n,t[o]),n.push(a,u(e[++o]));return function(e){let t=1;for(;t<e.length-1;){if(e[t]===a){const n=l(e[t-1],e[t+1]);if(void 0!==n){e.splice(t-1,3,n);continue}e[t++]="+"}t++}}(n),new r(n)}function s(e,t){var o;t instanceof r?e.push(...t._items):t instanceof n?e.push(t):e.push("number"==typeof(o=t)||"boolean"==typeof o||null===o?o:u(Array.isArray(o)?o.join(","):o))}function l(e,t){if('""'===t)return e;if('""'===e)return t;if("string"==typeof e){if(t instanceof n||'"'!==e[e.length-1])return;return"string"!=typeof t?`${e.slice(0,-1)}${t}"`:'"'===t[0]?e.slice(0,-1)+t.slice(1):void 0}return"string"!=typeof t||'"'!==t[0]||e instanceof n?void 0:`"${e}${t.slice(1)}`}function u(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.str=i,e.addCodeArg=s,e.strConcat=function(e,t){return t.emptyStr()?e:e.emptyStr()?t:i`${e}${t}`},e.stringify=function(e){return new r(u(e))},e.safeStringify=u,e.getProperty=function(t){return"string"==typeof t&&e.IDENTIFIER.test(t)?new r(`.${t}`):o`[${t}]`},e.getEsmExportName=function(t){if("string"==typeof t&&e.IDENTIFIER.test(t))return new r(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)},e.regexpCode=function(e){return new r(e.toString())}}(code$1);var scope={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=code$1;class n extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}}var r,o;(o=r||(e.UsedValueState=r={}))[o.Started=0]="Started",o[o.Completed=1]="Completed",e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class a{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof t.Name?e:this.name(e)}name(e){return new t.Name(this._newName(e))}_newName(e){return`${e}${(this._names[e]||this._nameGroup(e)).index++}`}_nameGroup(e){var t,n;if((null===(n=null===(t=this._parent)||void 0===t?void 0:t._prefixes)||void 0===n?void 0:n.has(e))||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}e.Scope=a;class i extends t.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:n,itemIndex:r}){this.value=e,this.scopePath=t._`.${new t.Name(n)}[${r}]`}}e.ValueScopeName=i;const s=t._`\n`;e.ValueScope=class extends a{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?s:t.nil}}get(){return this._scope}name(e){return new i(e,this._newName(e))}value(e,t){var n;if(void 0===t.ref)throw new Error("CodeGen: ref must be passed in value");const r=this.toName(e),{prefix:o}=r,a=null!==(n=t.key)&&void 0!==n?n:t.ref;let i=this._values[o];if(i){const e=i.get(a);if(e)return e}else i=this._values[o]=new Map;i.set(a,r);const s=this._scope[o]||(this._scope[o]=[]),l=s.length;return s[l]=t.ref,r.setValue(t,{property:o,itemIndex:l}),r}getValue(e,t){const n=this._values[e];if(n)return n.get(t)}scopeRefs(e,n=this._values){return this._reduceValues(n,n=>{if(void 0===n.scopePath)throw new Error(`CodeGen: name "${n}" has no value`);return t._`${e}${n.scopePath}`})}scopeCode(e=this._values,t,n){return this._reduceValues(e,e=>{if(void 0===e.value)throw new Error(`CodeGen: name "${e}" has no value`);return e.value.code},t,n)}_reduceValues(o,a,i={},s){let l=t.nil;for(const u in o){const c=o[u];if(!c)continue;const d=i[u]=i[u]||new Map;c.forEach(o=>{if(d.has(o))return;d.set(o,r.Started);let i=a(o);if(i){const n=this.opts.es5?e.varKinds.var:e.varKinds.const;l=t._`${l}${n} ${o} = ${i};${this.opts._n}`}else{if(!(i=null==s?void 0:s(o)))throw new n(o);l=t._`${l}${i}${this.opts._n}`}d.set(o,r.Completed)})}return l}}}(scope),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=code$1,n=scope;var r=code$1;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return r.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return r.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return r.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}});var o=scope;Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return o.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return o.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return o.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return o.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class a{optimizeNodes(){return this}optimizeNames(e,t){return this}}class i extends a{constructor(e,t,n){super(),this.varKind=e,this.name=t,this.rhs=n}render({es5:e,_n:t}){const r=e?n.varKinds.var:this.varKind,o=void 0===this.rhs?"":` = ${this.rhs}`;return`${r} ${this.name}${o};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=A(this.rhs,e,t)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class s extends a{constructor(e,t,n){super(),this.lhs=e,this.rhs=t,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,n){if(!(this.lhs instanceof t.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=A(this.rhs,e,n),this}get names(){return O(this.lhs instanceof t.Name?{}:{...this.lhs.names},this.rhs)}}class l extends s{constructor(e,t,n,r){super(e,n,r),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class u extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class c extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class d extends a{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class f extends a{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=A(this.code,e,t),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class p extends a{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((t,n)=>t+n.render(e),"")}optimizeNodes(){const{nodes:e}=this;let t=e.length;for(;t--;){const n=e[t].optimizeNodes();Array.isArray(n)?e.splice(t,1,...n):n?e[t]=n:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){const{nodes:n}=this;let r=n.length;for(;r--;){const o=n[r];o.optimizeNames(e,t)||($(e,o.names),n.splice(r,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>P(e,t.names),{})}}class h extends p{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class m extends p{}class g extends h{}g.kind="else";class b extends h{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();const e=this.condition;if(!0===e)return this.nodes;let t=this.else;if(t){const e=t.optimizeNodes();t=this.else=Array.isArray(e)?new g(e):e}return t?!1===e?t instanceof b?t:t.nodes:this.nodes.length?this:new b(R(e),t instanceof b?[t]:t.nodes):!1!==e&&this.nodes.length?this:void 0}optimizeNames(e,t){var n;if(this.else=null===(n=this.else)||void 0===n?void 0:n.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=A(this.condition,e,t),this}get names(){const e=super.names;return O(e,this.condition),this.else&&P(e,this.else.names),e}}b.kind="if";class y extends h{}y.kind="for";class _ extends y{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=A(this.iteration,e,t),this}get names(){return P(super.names,this.iteration.names)}}class v extends y{constructor(e,t,n,r){super(),this.varKind=e,this.name=t,this.from=n,this.to=r}render(e){const t=e.es5?n.varKinds.var:this.varKind,{name:r,from:o,to:a}=this;return`for(${t} ${r}=${o}; ${r}<${a}; ${r}++)`+super.render(e)}get names(){const e=O(super.names,this.from);return O(e,this.to)}}class w extends y{constructor(e,t,n,r){super(),this.loop=e,this.varKind=t,this.name=n,this.iterable=r}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=A(this.iterable,e,t),this}get names(){return P(super.names,this.iterable.names)}}class S extends h{constructor(e,t,n){super(),this.name=e,this.args=t,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}S.kind="func";class x extends p{render(e){return"return "+super.render(e)}}x.kind="return";class T extends h{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null===(e=this.catch)||void 0===e||e.optimizeNodes(),null===(t=this.finally)||void 0===t||t.optimizeNodes(),this}optimizeNames(e,t){var n,r;return super.optimizeNames(e,t),null===(n=this.catch)||void 0===n||n.optimizeNames(e,t),null===(r=this.finally)||void 0===r||r.optimizeNames(e,t),this}get names(){const e=super.names;return this.catch&&P(e,this.catch.names),this.finally&&P(e,this.finally.names),e}}class E extends h{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}E.kind="catch";class k extends h{render(e){return"finally"+super.render(e)}}k.kind="finally";function P(e,t){for(const n in t)e[n]=(e[n]||0)+(t[n]||0);return e}function O(e,n){return n instanceof t._CodeOrName?P(e,n.names):e}function A(e,n,r){return e instanceof t.Name?a(e):(o=e)instanceof t._Code&&o._items.some(e=>e instanceof t.Name&&1===n[e.str]&&void 0!==r[e.str])?new t._Code(e._items.reduce((e,n)=>(n instanceof t.Name&&(n=a(n)),n instanceof t._Code?e.push(...n._items):e.push(n),e),[])):e;var o;function a(e){const t=r[e.str];return void 0===t||1!==n[e.str]?e:(delete n[e.str],t)}}function $(e,t){for(const n in t)e[n]=(e[n]||0)-(t[n]||0)}function R(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:t._`!${N(e)}`}e.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new n.Scope({parent:e}),this._nodes=[new m]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){const n=this._extScope.value(e,t);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,n,r){const o=this._scope.toName(t);return void 0!==n&&r&&(this._constants[o.str]=n),this._leafNode(new i(e,o,n)),o}const(e,t,r){return this._def(n.varKinds.const,e,t,r)}let(e,t,r){return this._def(n.varKinds.let,e,t,r)}var(e,t,r){return this._def(n.varKinds.var,e,t,r)}assign(e,t,n){return this._leafNode(new s(e,t,n))}add(t,n){return this._leafNode(new l(t,e.operators.ADD,n))}code(e){return"function"==typeof e?e():e!==t.nil&&this._leafNode(new f(e)),this}object(...e){const n=["{"];for(const[r,o]of e)n.length>1&&n.push(","),n.push(r),(r!==o||this.opts.es5)&&(n.push(":"),(0,t.addCodeArg)(n,o));return n.push("}"),new t._Code(n)}if(e,t,n){if(this._blockNode(new b(e)),t&&n)this.code(t).else().code(n).endIf();else if(t)this.code(t).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new b(e))}else(){return this._elseNode(new g)}endIf(){return this._endBlockNode(b,g)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new _(e),t)}forRange(e,t,r,o,a=(this.opts.es5?n.varKinds.var:n.varKinds.let)){const i=this._scope.toName(e);return this._for(new v(a,i,t,r),()=>o(i))}forOf(e,r,o,a=n.varKinds.const){const i=this._scope.toName(e);if(this.opts.es5){const e=r instanceof t.Name?r:this.var("_arr",r);return this.forRange("_i",0,t._`${e}.length`,n=>{this.var(i,t._`${e}[${n}]`),o(i)})}return this._for(new w("of",a,i,r),()=>o(i))}forIn(e,r,o,a=(this.opts.es5?n.varKinds.var:n.varKinds.const)){if(this.opts.ownProperties)return this.forOf(e,t._`Object.keys(${r})`,o);const i=this._scope.toName(e);return this._for(new w("in",a,i,r),()=>o(i))}endFor(){return this._endBlockNode(y)}label(e){return this._leafNode(new u(e))}break(e){return this._leafNode(new c(e))}return(e){const t=new x;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(x)}try(e,t,n){if(!t&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');const r=new T;if(this._blockNode(r),this.code(e),t){const e=this.name("e");this._currNode=r.catch=new E(e),t(e)}return n&&(this._currNode=r.finally=new k,this.code(n)),this._endBlockNode(E,k)}throw(e){return this._leafNode(new d(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){const t=this._blockStarts.pop();if(void 0===t)throw new Error("CodeGen: not in self-balancing block");const n=this._nodes.length-t;if(n<0||void 0!==e&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=t,this}func(e,n=t.nil,r,o){return this._blockNode(new S(e,n,r)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(S)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){const n=this._currNode;if(n instanceof e||t&&n instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){const t=this._currNode;if(!(t instanceof b))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){const e=this._nodes;return e[e.length-1]}set _currNode(e){const t=this._nodes;t[t.length-1]=e}},e.not=R;const I=D(e.operators.AND);e.and=function(...e){return e.reduce(I)};const C=D(e.operators.OR);function D(e){return(n,r)=>n===t.nil?r:r===t.nil?n:t._`${N(n)} ${e} ${N(r)}`}function N(e){return e instanceof t.Name?e:t._`(${e})`}e.or=function(...e){return e.reduce(C)}}(codegen);var util={};Object.defineProperty(util,"__esModule",{value:!0}),util.checkStrictMode=util.getErrorPath=util.Type=util.useFunc=util.setEvaluated=util.evaluatedPropsToName=util.mergeEvaluated=util.eachItem=util.unescapeJsonPointer=util.escapeJsonPointer=util.escapeFragment=util.unescapeFragment=util.schemaRefOrVal=util.schemaHasRulesButRef=util.schemaHasRules=util.checkUnknownRules=util.alwaysValidSchema=util.toHash=void 0;const codegen_1$v=codegen,code_1$a=code$1;function toHash(e){const t={};for(const n of e)t[n]=!0;return t}function alwaysValidSchema(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(checkUnknownRules(e,t),!schemaHasRules(t,e.self.RULES.all))}function checkUnknownRules(e,t=e.schema){const{opts:n,self:r}=e;if(!n.strictSchema)return;if("boolean"==typeof t)return;const o=r.RULES.keywords;for(const a in t)o[a]||checkStrictMode(e,`unknown keyword: "${a}"`)}function schemaHasRules(e,t){if("boolean"==typeof e)return!e;for(const n in e)if(t[n])return!0;return!1}function schemaHasRulesButRef(e,t){if("boolean"==typeof e)return!e;for(const n in e)if("$ref"!==n&&t.all[n])return!0;return!1}function schemaRefOrVal({topSchemaRef:e,schemaPath:t},n,r,o){if(!o){if("number"==typeof n||"boolean"==typeof n)return n;if("string"==typeof n)return codegen_1$v._`${n}`}return codegen_1$v._`${e}${t}${(0,codegen_1$v.getProperty)(r)}`}function unescapeFragment(e){return unescapeJsonPointer(decodeURIComponent(e))}function escapeFragment(e){return encodeURIComponent(escapeJsonPointer(e))}function escapeJsonPointer(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function unescapeJsonPointer(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function eachItem(e,t){if(Array.isArray(e))for(const n of e)t(n);else t(e)}function makeMergeEvaluated({mergeNames:e,mergeToName:t,mergeValues:n,resultToName:r}){return(o,a,i,s)=>{const l=void 0===i?a:i instanceof codegen_1$v.Name?(a instanceof codegen_1$v.Name?e(o,a,i):t(o,a,i),i):a instanceof codegen_1$v.Name?(t(o,i,a),a):n(a,i);return s!==codegen_1$v.Name||l instanceof codegen_1$v.Name?l:r(o,l)}}function evaluatedPropsToName(e,t){if(!0===t)return e.var("props",!0);const n=e.var("props",codegen_1$v._`{}`);return void 0!==t&&setEvaluated(e,n,t),n}function setEvaluated(e,t,n){Object.keys(n).forEach(n=>e.assign(codegen_1$v._`${t}${(0,codegen_1$v.getProperty)(n)}`,!0))}util.toHash=toHash,util.alwaysValidSchema=alwaysValidSchema,util.checkUnknownRules=checkUnknownRules,util.schemaHasRules=schemaHasRules,util.schemaHasRulesButRef=schemaHasRulesButRef,util.schemaRefOrVal=schemaRefOrVal,util.unescapeFragment=unescapeFragment,util.escapeFragment=escapeFragment,util.escapeJsonPointer=escapeJsonPointer,util.unescapeJsonPointer=unescapeJsonPointer,util.eachItem=eachItem,util.mergeEvaluated={props:makeMergeEvaluated({mergeNames:(e,t,n)=>e.if(codegen_1$v._`${n} !== true && ${t} !== undefined`,()=>{e.if(codegen_1$v._`${t} === true`,()=>e.assign(n,!0),()=>e.assign(n,codegen_1$v._`${n} || {}`).code(codegen_1$v._`Object.assign(${n}, ${t})`))}),mergeToName:(e,t,n)=>e.if(codegen_1$v._`${n} !== true`,()=>{!0===t?e.assign(n,!0):(e.assign(n,codegen_1$v._`${n} || {}`),setEvaluated(e,n,t))}),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:evaluatedPropsToName}),items:makeMergeEvaluated({mergeNames:(e,t,n)=>e.if(codegen_1$v._`${n} !== true && ${t} !== undefined`,()=>e.assign(n,codegen_1$v._`${t} === true ? true : ${n} > ${t} ? ${n} : ${t}`)),mergeToName:(e,t,n)=>e.if(codegen_1$v._`${n} !== true`,()=>e.assign(n,!0===t||codegen_1$v._`${n} > ${t} ? ${n} : ${t}`)),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},util.evaluatedPropsToName=evaluatedPropsToName,util.setEvaluated=setEvaluated;const snippets={};function useFunc(e,t){return e.scopeValue("func",{ref:t,code:snippets[t.code]||(snippets[t.code]=new code_1$a._Code(t.code))})}var Type,Type2;function getErrorPath(e,t,n){if(e instanceof codegen_1$v.Name){const r=t===Type.Num;return n?r?codegen_1$v._`"[" + ${e} + "]"`:codegen_1$v._`"['" + ${e} + "']"`:r?codegen_1$v._`"/" + ${e}`:codegen_1$v._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return n?(0,codegen_1$v.getProperty)(e).toString():"/"+escapeJsonPointer(e)}function checkStrictMode(e,t,n=e.opts.strictSchema){if(n){if(t=`strict mode: ${t}`,!0===n)throw new Error(t);e.self.logger.warn(t)}}util.useFunc=useFunc,Type2=Type||(util.Type=Type={}),Type2[Type2.Num=0]="Num",Type2[Type2.Str=1]="Str",util.getErrorPath=getErrorPath,util.checkStrictMode=checkStrictMode;var names$1={};Object.defineProperty(names$1,"__esModule",{value:!0});const codegen_1$u=codegen,names={data:new codegen_1$u.Name("data"),valCxt:new codegen_1$u.Name("valCxt"),instancePath:new codegen_1$u.Name("instancePath"),parentData:new codegen_1$u.Name("parentData"),parentDataProperty:new codegen_1$u.Name("parentDataProperty"),rootData:new codegen_1$u.Name("rootData"),dynamicAnchors:new codegen_1$u.Name("dynamicAnchors"),vErrors:new codegen_1$u.Name("vErrors"),errors:new codegen_1$u.Name("errors"),this:new codegen_1$u.Name("this"),self:new codegen_1$u.Name("self"),scope:new codegen_1$u.Name("scope"),json:new codegen_1$u.Name("json"),jsonPos:new codegen_1$u.Name("jsonPos"),jsonLen:new codegen_1$u.Name("jsonLen"),jsonPart:new codegen_1$u.Name("jsonPart")};names$1.default=names,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=codegen,n=util,r=names$1;function o(e,n){const o=e.const("err",n);e.if(t._`${r.default.vErrors} === null`,()=>e.assign(r.default.vErrors,t._`[${o}]`),t._`${r.default.vErrors}.push(${o})`),e.code(t._`${r.default.errors}++`)}function a(e,n){const{gen:r,validateName:o,schemaEnv:a}=e;a.$async?r.throw(t._`new ${e.ValidationError}(${n})`):(r.assign(t._`${o}.errors`,n),r.return(!1))}e.keywordError={message:({keyword:e})=>t.str`must pass "${e}" keyword validation`},e.keyword$DataError={message:({keyword:e,schemaType:n})=>n?t.str`"${e}" keyword must be ${n} ($data)`:t.str`"${e}" keyword is invalid ($data)`},e.reportError=function(n,r=e.keywordError,i,l){const{it:u}=n,{gen:c,compositeRule:d,allErrors:f}=u,p=s(n,r,i);(null!=l?l:d||f)?o(c,p):a(u,t._`[${p}]`)},e.reportExtraError=function(t,n=e.keywordError,i){const{it:l}=t,{gen:u,compositeRule:c,allErrors:d}=l;o(u,s(t,n,i)),c||d||a(l,r.default.vErrors)},e.resetErrorsCount=function(e,n){e.assign(r.default.errors,n),e.if(t._`${r.default.vErrors} !== null`,()=>e.if(n,()=>e.assign(t._`${r.default.vErrors}.length`,n),()=>e.assign(r.default.vErrors,null)))},e.extendErrors=function({gen:e,keyword:n,schemaValue:o,data:a,errsCount:i,it:s}){if(void 0===i)throw new Error("ajv implementation error");const l=e.name("err");e.forRange("i",i,r.default.errors,i=>{e.const(l,t._`${r.default.vErrors}[${i}]`),e.if(t._`${l}.instancePath === undefined`,()=>e.assign(t._`${l}.instancePath`,(0,t.strConcat)(r.default.instancePath,s.errorPath))),e.assign(t._`${l}.schemaPath`,t.str`${s.errSchemaPath}/${n}`),s.opts.verbose&&(e.assign(t._`${l}.schema`,o),e.assign(t._`${l}.data`,a))})};const i={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function s(e,n,o){const{createErrors:a}=e.it;return!1===a?t._`{}`:function(e,n,o={}){const{gen:a,it:s}=e,c=[l(s,o),u(e,o)];return function(e,{params:n,message:o},a){const{keyword:s,data:l,schemaValue:u,it:c}=e,{opts:d,propertyName:f,topSchemaRef:p,schemaPath:h}=c;a.push([i.keyword,s],[i.params,"function"==typeof n?n(e):n||t._`{}`]),d.messages&&a.push([i.message,"function"==typeof o?o(e):o]);d.verbose&&a.push([i.schema,u],[i.parentSchema,t._`${p}${h}`],[r.default.data,l]);f&&a.push([i.propertyName,f])}(e,n,c),a.object(...c)}(e,n,o)}function l({errorPath:e},{instancePath:o}){const a=o?t.str`${e}${(0,n.getErrorPath)(o,n.Type.Str)}`:e;return[r.default.instancePath,(0,t.strConcat)(r.default.instancePath,a)]}function u({keyword:e,it:{errSchemaPath:r}},{schemaPath:o,parentSchema:a}){let s=a?r:t.str`${r}/${e}`;return o&&(s=t.str`${s}${(0,n.getErrorPath)(o,n.Type.Str)}`),[i.schemaPath,s]}}(errors),Object.defineProperty(boolSchema,"__esModule",{value:!0}),boolSchema.boolOrEmptySchema=boolSchema.topBoolOrEmptySchema=void 0;const errors_1$3=errors,codegen_1$t=codegen,names_1$6=names$1,boolError={message:"boolean schema is false"};function topBoolOrEmptySchema(e){const{gen:t,schema:n,validateName:r}=e;!1===n?falseSchemaError(e,!1):"object"==typeof n&&!0===n.$async?t.return(names_1$6.default.data):(t.assign(codegen_1$t._`${r}.errors`,null),t.return(!0))}function boolOrEmptySchema(e,t){const{gen:n,schema:r}=e;!1===r?(n.var(t,!1),falseSchemaError(e)):n.var(t,!0)}function falseSchemaError(e,t){const{gen:n,data:r}=e,o={gen:n,keyword:"false schema",data:r,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,errors_1$3.reportError)(o,boolError,void 0,t)}boolSchema.topBoolOrEmptySchema=topBoolOrEmptySchema,boolSchema.boolOrEmptySchema=boolOrEmptySchema;var dataType={},rules={};Object.defineProperty(rules,"__esModule",{value:!0}),rules.getRules=rules.isJSONType=void 0;const _jsonTypes=["string","number","integer","boolean","null","object","array"],jsonTypes=new Set(_jsonTypes);function isJSONType(e){return"string"==typeof e&&jsonTypes.has(e)}function getRules(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}rules.isJSONType=isJSONType,rules.getRules=getRules;var applicability={};function schemaHasRulesForType({schema:e,self:t},n){const r=t.RULES.types[n];return r&&!0!==r&&shouldUseGroup(e,r)}function shouldUseGroup(e,t){return t.rules.some(t=>shouldUseRule(e,t))}function shouldUseRule(e,t){var n;return void 0!==e[t.keyword]||(null===(n=t.definition.implements)||void 0===n?void 0:n.some(t=>void 0!==e[t]))}Object.defineProperty(applicability,"__esModule",{value:!0}),applicability.shouldUseRule=applicability.shouldUseGroup=applicability.schemaHasRulesForType=void 0,applicability.schemaHasRulesForType=schemaHasRulesForType,applicability.shouldUseGroup=shouldUseGroup,applicability.shouldUseRule=shouldUseRule,Object.defineProperty(dataType,"__esModule",{value:!0}),dataType.reportTypeError=dataType.checkDataTypes=dataType.checkDataType=dataType.coerceAndCheckDataType=dataType.getJSONTypes=dataType.getSchemaTypes=dataType.DataType=void 0;const rules_1=rules,applicability_1$1=applicability,errors_1$2=errors,codegen_1$s=codegen,util_1$q=util;var DataType,DataType2;function getSchemaTypes(e){const t=getJSONTypes(e.type);if(t.includes("null")){if(!1===e.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&void 0!==e.nullable)throw new Error('"nullable" cannot be used without "type"');!0===e.nullable&&t.push("null")}return t}function getJSONTypes(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(rules_1.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}function coerceAndCheckDataType(e,t){const{gen:n,data:r,opts:o}=e,a=coerceToTypes(t,o.coerceTypes),i=t.length>0&&!(0===a.length&&1===t.length&&(0,applicability_1$1.schemaHasRulesForType)(e,t[0]));if(i){const i=checkDataTypes(t,r,o.strictNumbers,DataType.Wrong);n.if(i,()=>{a.length?coerceData(e,t,a):reportTypeError(e)})}return i}DataType2=DataType||(dataType.DataType=DataType={}),DataType2[DataType2.Correct=0]="Correct",DataType2[DataType2.Wrong=1]="Wrong",dataType.getSchemaTypes=getSchemaTypes,dataType.getJSONTypes=getJSONTypes,dataType.coerceAndCheckDataType=coerceAndCheckDataType;const COERCIBLE=new Set(["string","number","integer","boolean","null"]);function coerceToTypes(e,t){return t?e.filter(e=>COERCIBLE.has(e)||"array"===t&&"array"===e):[]}function coerceData(e,t,n){const{gen:r,data:o,opts:a}=e,i=r.let("dataType",codegen_1$s._`typeof ${o}`),s=r.let("coerced",codegen_1$s._`undefined`);"array"===a.coerceTypes&&r.if(codegen_1$s._`${i} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>r.assign(o,codegen_1$s._`${o}[0]`).assign(i,codegen_1$s._`typeof ${o}`).if(checkDataTypes(t,o,a.strictNumbers),()=>r.assign(s,o))),r.if(codegen_1$s._`${s} !== undefined`);for(const u of n)(COERCIBLE.has(u)||"array"===u&&"array"===a.coerceTypes)&&l(u);function l(e){switch(e){case"string":return void r.elseIf(codegen_1$s._`${i} == "number" || ${i} == "boolean"`).assign(s,codegen_1$s._`"" + ${o}`).elseIf(codegen_1$s._`${o} === null`).assign(s,codegen_1$s._`""`);case"number":return void r.elseIf(codegen_1$s._`${i} == "boolean" || ${o} === null
68
+ */function ps(e,t,n,r){Cn(r);var o=wl(t,"onChange");if(o.length>0){var a=new Oi("onChange","change",null,n,r);e.push({event:a,listeners:o})}}var hs=null,ms=null;function gs(e){fl(e,0)}function bs(e){if(et(Xu(e)))return e}function ys(e,t){if("change"===e)return t}var _s=!1;function vs(){hs&&(hs.detachEvent("onpropertychange",ws),hs=null,ms=null)}function ws(e){"value"===e.propertyName&&bs(ms)&&function(e){var t=[];ps(t,ms,e,On(e)),Fn(gs,t)}(e)}function Ss(e,t,n){"focusin"===e?(vs(),function(e,t){ms=t,(hs=e).attachEvent("onpropertychange",ws)}(t,n)):"focusout"===e&&vs()}function xs(e,t){if("selectionchange"===e||"keyup"===e||"keydown"===e)return bs(ms)}function Ts(e,t){if("click"===e)return bs(t)}function Es(e,t){if("input"===e||"change"===e)return bs(t)}function ks(e,t,n,r,o,a,i){var s,l,u,c,d,f,p=n?Xu(n):window;if("select"===(c=(u=p).nodeName&&u.nodeName.toLowerCase())||"input"===c&&"file"===u.type?s=ys:fs(p)?_s?s=Es:(s=xs,l=Ss):function(e){var t=e.nodeName;return t&&"input"===t.toLowerCase()&&("checkbox"===e.type||"radio"===e.type)}(p)&&(s=Ts),s){var h=s(t,n);if(h)return void ps(e,h,r,o)}l&&l(t,p,n),"focusout"===t&&(f=(d=p)._wrapperState)&&f.controlled&&"number"===d.type&&pt(d,"number",d.value)}function Ps(e,t,n,r,o,a,i){var s="mouseover"===t||"pointerover"===t,l="mouseout"===t||"pointerout"===t;if(s&&r!==En){var u=r.relatedTarget||r.fromElement;if(u&&(Yu(u)||Wu(u)))return}if(l||s){var c,d,f;if(o.window===o)c=o;else{var p=o.ownerDocument;c=p?p.defaultView||p.parentWindow:window}if(l){var h=r.relatedTarget||r.toElement;if(d=n,null!==(f=h?Yu(h):null))(f!==Tr(f)||5!==f.tag&&6!==f.tag)&&(f=null)}else d=null,f=n;if(d!==f){var m=Ii,g="onMouseLeave",b="onMouseEnter",y="mouse";"pointerout"!==t&&"pointerover"!==t||(m=qi,g="onPointerLeave",b="onPointerEnter",y="pointer");var _=null==d?c:Xu(d),v=null==f?c:Xu(f),w=new m(g,y+"leave",d,r,o);w.target=_,w.relatedTarget=v;var S=null;if(Yu(o)===n){var x=new m(b,y+"enter",f,r,o);x.target=v,x.relatedTarget=_,S=x}!function(e,t,n,r,o){var a=r&&o?function(e,t){for(var n=e,r=t,o=0,a=n;a;a=Sl(a))o++;for(var i=0,s=r;s;s=Sl(s))i++;for(;o-i>0;)n=Sl(n),o--;for(;i-o>0;)r=Sl(r),i--;var l=o;for(;l--;){if(n===r||null!==r&&n===r.alternate)return n;n=Sl(n),r=Sl(r)}return null}(r,o):null;null!==r&&xl(e,t,r,a,!1);null!==o&&null!==n&&xl(e,n,o,a,!0)}(e,w,S,d,f)}}}k&&(_s=function(e){if(!k)return!1;var t="on"+e,n=t in document;if(!n){var r=document.createElement("div");r.setAttribute(t,"return;"),n="function"==typeof r[t]}return n}("input")&&(!document.documentMode||document.documentMode>9));var Os="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t};function As(e,t){if(Os(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var o=0;o<n.length;o++){var a=n[o];if(!P.call(t,a)||!Os(e[a],t[a]))return!1}return!0}function $s(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Rs(e){for(;e;){if(e.nextSibling)return e.nextSibling;e=e.parentNode}}function Is(e,t){for(var n=$s(e),r=0,o=0;n;){if(3===n.nodeType){if(o=r+n.textContent.length,r<=t&&o>=t)return{node:n,offset:t-r};r=o}n=$s(Rs(n))}}function Cs(e){var t=e.ownerDocument,n=t&&t.defaultView||window,r=n.getSelection&&n.getSelection();if(!r||0===r.rangeCount)return null;var o=r.anchorNode,a=r.anchorOffset,i=r.focusNode,s=r.focusOffset;try{o.nodeType,i.nodeType}catch(rw){return null}return function(e,t,n,r,o){var a=0,i=-1,s=-1,l=0,u=0,c=e,d=null;e:for(;;){for(var f=null;c!==t||0!==n&&3!==c.nodeType||(i=a+n),c!==r||0!==o&&3!==c.nodeType||(s=a+o),3===c.nodeType&&(a+=c.nodeValue.length),null!==(f=c.firstChild);)d=c,c=f;for(;;){if(c===e)break e;if(d===t&&++l===n&&(i=a),d===r&&++u===o&&(s=a),null!==(f=c.nextSibling))break;d=(c=d).parentNode}c=f}if(-1===i||-1===s)return null;return{start:i,end:s}}(e,o,a,i,s)}function Ds(e){return e&&3===e.nodeType}function Ns(e,t){return!(!e||!t)&&(e===t||!Ds(e)&&(Ds(t)?Ns(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function Ms(e){return e&&e.ownerDocument&&Ns(e.ownerDocument.documentElement,e)}function Ls(e){try{return"string"==typeof e.contentWindow.location.href}catch(t){return!1}}function js(){for(var e=window,t=tt();t instanceof e.HTMLIFrameElement;){if(!Ls(t))return t;t=tt((e=t.contentWindow).document)}return t}function Fs(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}function Bs(e){var t=js(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&Ms(n)){null!==r&&Fs(n)&&function(e,t){var n=t.start,r=t.end;void 0===r&&(r=n);"selectionStart"in e?(e.selectionStart=n,e.selectionEnd=Math.min(r,e.value.length)):function(e,t){var n=e.ownerDocument||document,r=n&&n.defaultView||window;if(r.getSelection){var o=r.getSelection(),a=e.textContent.length,i=Math.min(t.start,a),s=void 0===t.end?i:Math.min(t.end,a);if(!o.extend&&i>s){var l=s;s=i,i=l}var u=Is(e,i),c=Is(e,s);if(u&&c){if(1===o.rangeCount&&o.anchorNode===u.node&&o.anchorOffset===u.offset&&o.focusNode===c.node&&o.focusOffset===c.offset)return;var d=n.createRange();d.setStart(u.node,u.offset),o.removeAllRanges(),i>s?(o.addRange(d),o.extend(c.node,c.offset)):(d.setEnd(c.node,c.offset),o.addRange(d))}}}(e,t)}(n,r);for(var o=[],a=n;a=a.parentNode;)1===a.nodeType&&o.push({element:a,left:a.scrollLeft,top:a.scrollTop});"function"==typeof n.focus&&n.focus();for(var i=0;i<o.length;i++){var s=o[i];s.element.scrollLeft=s.left,s.element.scrollTop=s.top}}}function Us(e){return("selectionStart"in e?{start:e.selectionStart,end:e.selectionEnd}:Cs(e))||{start:0,end:0}}var zs=k&&"documentMode"in document&&document.documentMode<=11;var Vs=null,Hs=null,qs=null,Gs=!1;function Ws(e,t,n){var r,o=(r=n).window===r?r.document:9===r.nodeType?r:r.ownerDocument;if(!Gs&&null!=Vs&&Vs===tt(o)){var a=function(e){if("selectionStart"in e&&Fs(e))return{start:e.selectionStart,end:e.selectionEnd};var t=(e.ownerDocument&&e.ownerDocument.defaultView||window).getSelection();return{anchorNode:t.anchorNode,anchorOffset:t.anchorOffset,focusNode:t.focusNode,focusOffset:t.focusOffset}}(Vs);if(!qs||!As(qs,a)){qs=a;var i=wl(Hs,"onSelect");if(i.length>0){var s=new Oi("onSelect","select",null,t,n);e.push({event:s,listeners:i}),s.target=Vs}}}}function Ys(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ks={animationend:Ys("Animation","AnimationEnd"),animationiteration:Ys("Animation","AnimationIteration"),animationstart:Ys("Animation","AnimationStart"),transitionend:Ys("Transition","TransitionEnd")},Xs={},Qs={};function Zs(e){if(Xs[e])return Xs[e];if(!Ks[e])return e;var t=Ks[e];for(var n in t)if(t.hasOwnProperty(n)&&n in Qs)return Xs[e]=t[n];return e}k&&(Qs=document.createElement("div").style,"AnimationEvent"in window||(delete Ks.animationend.animation,delete Ks.animationiteration.animation,delete Ks.animationstart.animation),"TransitionEvent"in window||delete Ks.transitionend.transition);var Js=Zs("animationend"),el=Zs("animationiteration"),tl=Zs("animationstart"),nl=Zs("transitionend"),rl=new Map,ol=["abort","auxClick","cancel","canPlay","canPlayThrough","click","close","contextMenu","copy","cut","drag","dragEnd","dragEnter","dragExit","dragLeave","dragOver","dragStart","drop","durationChange","emptied","encrypted","ended","error","gotPointerCapture","input","invalid","keyDown","keyPress","keyUp","load","loadedData","loadedMetadata","loadStart","lostPointerCapture","mouseDown","mouseMove","mouseOut","mouseOver","mouseUp","paste","pause","play","playing","pointerCancel","pointerDown","pointerMove","pointerOut","pointerOver","pointerUp","progress","rateChange","reset","resize","seeked","seeking","stalled","submit","suspend","timeUpdate","touchCancel","touchEnd","touchStart","volumeChange","scroll","toggle","touchMove","waiting","wheel"];function al(e,t){rl.set(e,t),T(t,[e])}function il(e,t,n,r,o,a,i){var s=rl.get(t);if(void 0!==s){var l=Oi,u=t;switch(t){case"keypress":if(0===vi(r))return;case"keydown":case"keyup":l=Hi;break;case"focusin":u="focus",l=Di;break;case"focusout":u="blur",l=Di;break;case"beforeblur":case"afterblur":l=Di;break;case"click":if(2===r.button)return;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":l=Ii;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":l=Ci;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":l=Gi;break;case Js:case el:case tl:l=Ni;break;case nl:l=Wi;break;case"scroll":l=$i;break;case"wheel":l=Yi;break;case"copy":case"cut":case"paste":l=Mi;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":l=qi}var c=!!(4&a),d=!c&&"scroll"===t,f=function(e,t,n,r,o){var a=null!==t?t+"Capture":null,i=r?a:t,s=[],l=e,u=null;for(;null!==l;){var c=l,d=c.stateNode;if(5===c.tag&&null!==d&&(u=d,null!==i)){var f=Bn(l,i);null!=f&&s.push(vl(l,f,u))}if(o)break;l=l.return}return s}(n,s,r.type,c,d);if(f.length>0){var p=new l(s,u,null,r,o);e.push({event:p,listeners:f})}}}function sl(e,t,n,r,o,a,i){il(e,t,n,r,o,a),!(7&a)&&(Ps(e,t,n,r,o),ks(e,t,n,r,o),function(e,t,n,r,o){var a=n?Xu(n):window;switch(t){case"focusin":(fs(a)||"true"===a.contentEditable)&&(Vs=a,Hs=n,qs=null);break;case"focusout":Vs=null,Hs=null,qs=null;break;case"mousedown":Gs=!0;break;case"contextmenu":case"mouseup":case"dragend":Gs=!1,Ws(e,r,o);break;case"selectionchange":if(zs)break;case"keydown":case"keyup":Ws(e,r,o)}}(e,t,n,r,o),function(e,t,n,r,o){ls(e,t,n,r,o),cs(e,t,n,r,o)}(e,t,n,r,o))}!function(){for(var e=0;e<ol.length;e++){var t=ol[e];al(t.toLowerCase(),"on"+(t[0].toUpperCase()+t.slice(1)))}al(Js,"onAnimationEnd"),al(el,"onAnimationIteration"),al(tl,"onAnimationStart"),al("dblclick","onDoubleClick"),al("focusin","onFocus"),al("focusout","onBlur"),al(nl,"onTransitionEnd")}(),E("onMouseEnter",["mouseout","mouseover"]),E("onMouseLeave",["mouseout","mouseover"]),E("onPointerEnter",["pointerout","pointerover"]),E("onPointerLeave",["pointerout","pointerover"]),T("onChange",["change","click","focusin","focusout","input","keydown","keyup","selectionchange"]),T("onSelect",["focusout","contextmenu","dragend","focusin","keydown","keyup","mousedown","mouseup","selectionchange"]),T("onBeforeInput",["compositionend","keypress","textInput","paste"]),T("onCompositionEnd",["compositionend","focusout","keydown","keypress","keyup","mousedown"]),T("onCompositionStart",["compositionstart","focusout","keydown","keypress","keyup","mousedown"]),T("onCompositionUpdate",["compositionupdate","focusout","keydown","keypress","keyup","mousedown"]);var ll=["abort","canplay","canplaythrough","durationchange","emptied","encrypted","ended","error","loadeddata","loadedmetadata","loadstart","pause","play","playing","progress","ratechange","resize","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting"],ul=new Set(["cancel","close","invalid","load","scroll","toggle"].concat(ll));function cl(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,function(e,t,n,r,o,a,i,s,l){if(Zn.apply(this,arguments),Wn){var u=Jn();Kn||(Kn=!0,Xn=u)}}(r,t,void 0,e),e.currentTarget=null}function dl(e,t,n){var r;if(n)for(var o=t.length-1;o>=0;o--){var a=t[o],i=a.instance,s=a.currentTarget,l=a.listener;if(i!==r&&e.isPropagationStopped())return;cl(e,l,s),r=i}else for(var u=0;u<t.length;u++){var c=t[u],d=c.instance,f=c.currentTarget,p=c.listener;if(d!==r&&e.isPropagationStopped())return;cl(e,p,f),r=d}}function fl(e,t){for(var n=!!(4&t),r=0;r<e.length;r++){var o=e[r];dl(o.event,o.listeners,n)}!function(){if(Kn){var e=Xn;throw Kn=!1,Xn=null,e}}()}function pl(e,t){ul.has(e)||a('Did not expect a listenToNonDelegatedEvent() call for "%s". This is a bug in React. Please file an issue.',e);var n=function(e){var t=e[Uu];void 0===t&&(t=e[Uu]=new Set);return t}(t),r=function(e){return e+"__bubble"}(e);n.has(r)||(bl(t,e,2,!1),n.add(r))}function hl(e,t,n){ul.has(e)&&!t&&a('Did not expect a listenToNativeEvent() call for "%s" in the bubble phase. This is a bug in React. Please file an issue.',e);var r=0;t&&(r|=4),bl(n,e,r,t)}var ml="_reactListening"+Math.random().toString(36).slice(2);function gl(e){if(!e[ml]){e[ml]=!0,w.forEach(function(t){"selectionchange"!==t&&(ul.has(t)||hl(t,!1,e),hl(t,!0,e))});var t=9===e.nodeType?e:e.ownerDocument;null!==t&&(t[ml]||(t[ml]=!0,hl("selectionchange",!1,t)))}}function bl(e,t,n,r,o){var a=function(e,t,n){var r;switch(hi(t)){case Ia:r=ui;break;case Ca:r=ci;break;default:r=di}return r.bind(null,t,n,e)}(e,t,n),i=void 0;Un&&("touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(i=!0)),r?void 0!==i?function(e,t,n,r){e.addEventListener(t,n,{capture:!0,passive:r})}(e,t,a,i):function(e,t,n){e.addEventListener(t,n,!0)}(e,t,a):void 0!==i?function(e,t,n,r){e.addEventListener(t,n,{passive:r})}(e,t,a,i):function(e,t,n){e.addEventListener(t,n,!1)}(e,t,a)}function yl(e,t){return e===t||8===e.nodeType&&e.parentNode===t}function _l(e,t,n,r,o){var a=r;if(!(1&t||2&t)){var i=o;if(null!==r){var s=r;e:for(;;){if(null===s)return;var l=s.tag;if(3===l||4===l){var u=s.stateNode.containerInfo;if(yl(u,i))break;if(4===l)for(var c=s.return;null!==c;){var d=c.tag;if(3===d||4===d)if(yl(c.stateNode.containerInfo,i))return;c=c.return}for(;null!==u;){var f=Yu(u);if(null===f)return;var p=f.tag;if(5===p||6===p){s=a=f;continue e}u=u.parentNode}}s=s.return}}}Fn(function(){return function(e,t,n,r){var o=[];sl(o,e,r,n,On(n),t),fl(o,t)}(e,t,n,a)})}function vl(e,t,n){return{instance:e,listener:t,currentTarget:n}}function wl(e,t){for(var n=t+"Capture",r=[],o=e;null!==o;){var a=o,i=a.stateNode;if(5===a.tag&&null!==i){var s=i,l=Bn(o,n);null!=l&&r.unshift(vl(o,l,s));var u=Bn(o,t);null!=u&&r.push(vl(o,u,s))}o=o.return}return r}function Sl(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag);return e||null}function xl(e,t,n,r,o){for(var a=t._reactName,i=[],s=n;null!==s&&s!==r;){var l=s,u=l.alternate,c=l.stateNode,d=l.tag;if(null!==u&&u===r)break;if(5===d&&null!==c){var f=c;if(o){var p=Bn(s,a);null!=p&&i.unshift(vl(s,p,f))}else if(!o){var h=Bn(s,a);null!=h&&i.push(vl(s,h,f))}}s=s.return}0!==i.length&&e.push({event:t,listeners:i})}var Tl,El,kl,Pl,Ol,Al,$l,Rl=!1,Il="dangerouslySetInnerHTML",Cl="suppressContentEditableWarning",Dl="suppressHydrationWarning",Nl="autoFocus",Ml="children",Ll="style",jl="__html";Tl={dialog:!0,webview:!0},El=function(e,t){gn(e,t),function(e,t){"input"!==e&&"textarea"!==e&&"select"!==e||null==t||null!==t.value||bn||(bn=!0,"select"===e&&t.multiple?a("`value` prop on `%s` should not be null. Consider using an empty array when `multiple` is set to `true` to clear the component or `undefined` for uncontrolled components.",e):a("`value` prop on `%s` should not be null. Consider using an empty string to clear the component or `undefined` for uncontrolled components.",e))}(e,t),Tn(e,t,{registrationNameDependencies:S,possibleRegistrationNames:x})},Al=k&&!document.documentMode,kl=function(e,t,n){if(!Rl){var r=Ul(n),o=Ul(t);o!==r&&(Rl=!0,a("Prop `%s` did not match. Server: %s Client: %s",e,JSON.stringify(o),JSON.stringify(r)))}},Pl=function(e){if(!Rl){Rl=!0;var t=[];e.forEach(function(e){t.push(e)}),a("Extra attributes from the server: %s",t)}},Ol=function(e,t){!1===t?a("Expected `%s` listener to be a function, instead got `false`.\n\nIf you used to conditionally omit it with %s={condition && value}, pass %s={condition ? value : undefined} instead.",e,e,e):a("Expected `%s` listener to be a function, instead got a value of `%s` type.",e,typeof t)},$l=function(e,t){var n=e.namespaceURI===Rt?e.ownerDocument.createElement(e.tagName):e.ownerDocument.createElementNS(e.namespaceURI,e.tagName);return n.innerHTML=t,n.innerHTML};var Fl=/\r\n?/g,Bl=/\u0000|\uFFFD/g;function Ul(e){return function(e){if(A(e))a("The provided HTML markup uses a value of unsupported type %s. This value must be coerced to a string before before using it here.",O(e)),$(e)}(e),("string"==typeof e?e:""+e).replace(Fl,"\n").replace(Bl,"")}function zl(e,t,n,r){var o=Ul(t),i=Ul(e);if(i!==o&&(r&&(Rl||(Rl=!0,a('Text content did not match. Server: "%s" Client: "%s"',i,o))),n))throw new Error("Text content does not match server-rendered HTML.")}function Vl(e){return 9===e.nodeType?e:e.ownerDocument}function Hl(){}function ql(e){e.onclick=Hl}function Gl(e,t,n,r){var o,a=un(t,n);switch(El(t,n),t){case"dialog":pl("cancel",e),pl("close",e),o=n;break;case"iframe":case"object":case"embed":pl("load",e),o=n;break;case"video":case"audio":for(var i=0;i<ll.length;i++)pl(ll[i],e);o=n;break;case"source":pl("error",e),o=n;break;case"img":case"image":case"link":pl("error",e),pl("load",e),o=n;break;case"details":pl("toggle",e),o=n;break;case"input":lt(e,n),o=st(e,n),pl("invalid",e);break;case"option":bt(0,n),o=n;break;case"select":Et(e,n),o=Tt(0,n),pl("invalid",e);break;case"textarea":Ot(e,n),o=Pt(e,n),pl("invalid",e);break;default:o=n}switch(ln(t,o),function(e,t,n,r,o){for(var a in r)if(r.hasOwnProperty(a)){var i=r[a];if(a===Ll)i&&Object.freeze(i),rn(t,i);else if(a===Il){var s=i?i[jl]:void 0;null!=s&&Lt(t,s)}else a===Ml?"string"==typeof i?("textarea"!==e||""!==i)&&jt(t,i):"number"==typeof i&&jt(t,""+i):a===Cl||a===Dl||a===Nl||(S.hasOwnProperty(a)?null!=i&&("function"!=typeof i&&Ol(a,i),"onScroll"===a&&pl("scroll",t)):null!=i&&Z(t,a,i,o))}}(t,e,0,o,a),t){case"input":Je(e),dt(e,n,!1);break;case"textarea":Je(e),$t(e);break;case"option":!function(e,t){null!=t.value&&e.setAttribute("value",We(Ye(t.value)))}(e,n);break;case"select":!function(e,t){var n=e;n.multiple=!!t.multiple;var r=t.value;null!=r?xt(n,!!t.multiple,r,!1):null!=t.defaultValue&&xt(n,!!t.multiple,t.defaultValue,!0)}(e,n);break;default:"function"==typeof o.onClick&&ql(e)}}function Wl(e,t,n,r,o){El(t,r);var i,s,l,u,c=null;switch(t){case"input":i=st(e,n),s=st(e,r),c=[];break;case"select":i=Tt(0,n),s=Tt(0,r),c=[];break;case"textarea":i=Pt(e,n),s=Pt(e,r),c=[];break;default:s=r,"function"!=typeof(i=n).onClick&&"function"==typeof s.onClick&&ql(e)}ln(t,s);var d=null;for(l in i)if(!s.hasOwnProperty(l)&&i.hasOwnProperty(l)&&null!=i[l])if(l===Ll){var f=i[l];for(u in f)f.hasOwnProperty(u)&&(d||(d={}),d[u]="")}else l===Il||l===Ml||l===Cl||l===Dl||l===Nl||(S.hasOwnProperty(l)?c||(c=[]):(c=c||[]).push(l,null));for(l in s){var p=s[l],h=null!=i?i[l]:void 0;if(s.hasOwnProperty(l)&&p!==h&&(null!=p||null!=h))if(l===Ll)if(p&&Object.freeze(p),h){for(u in h)!h.hasOwnProperty(u)||p&&p.hasOwnProperty(u)||(d||(d={}),d[u]="");for(u in p)p.hasOwnProperty(u)&&h[u]!==p[u]&&(d||(d={}),d[u]=p[u])}else d||(c||(c=[]),c.push(l,d)),d=p;else if(l===Il){var m=p?p[jl]:void 0,g=h?h[jl]:void 0;null!=m&&g!==m&&(c=c||[]).push(l,m)}else l===Ml?"string"!=typeof p&&"number"!=typeof p||(c=c||[]).push(l,""+p):l===Cl||l===Dl||(S.hasOwnProperty(l)?(null!=p&&("function"!=typeof p&&Ol(l,p),"onScroll"===l&&pl("scroll",e)),c||h===p||(c=[])):(c=c||[]).push(l,p))}return d&&(!function(e,t){if(t){var n=an(e),r=an(t),o={};for(var i in n){var s=n[i],l=r[i];if(l&&s!==l){var u=s+","+l;if(o[u])continue;o[u]=!0,a("%s a style property during rerender (%s) when a conflicting property is set (%s) can lead to styling bugs. To avoid this, don't mix shorthand and non-shorthand properties for the same value; instead, replace the shorthand with separate values.",on(e[s])?"Removing":"Updating",s,l)}}}}(d,s[Ll]),(c=c||[]).push(Ll,d)),c}function Yl(e,t,n,r,o){"input"===n&&"radio"===o.type&&null!=o.name&&ut(e,o);un(n,r);switch(function(e,t,n,r){for(var o=0;o<t.length;o+=2){var a=t[o],i=t[o+1];a===Ll?rn(e,i):a===Il?Lt(e,i):a===Ml?jt(e,i):Z(e,a,i,r)}}(e,t,0,un(n,o)),n){case"input":ct(e,o);break;case"textarea":At(e,o);break;case"select":!function(e,t){var n=e,r=n._wrapperState.wasMultiple;n._wrapperState.wasMultiple=!!t.multiple;var o=t.value;null!=o?xt(n,!!t.multiple,o,!1):r!==!!t.multiple&&(null!=t.defaultValue?xt(n,!!t.multiple,t.defaultValue,!0):xt(n,!!t.multiple,t.multiple?[]:"",!1))}(e,o)}}function Kl(e){var t=e.toLowerCase();return cn.hasOwnProperty(t)&&cn[t]||null}function Xl(e,t){Rl||(Rl=!0,a("Did not expect server HTML to contain a <%s> in <%s>.",t.nodeName.toLowerCase(),e.nodeName.toLowerCase()))}function Ql(e,t){Rl||(Rl=!0,a('Did not expect server HTML to contain the text node "%s" in <%s>.',t.nodeValue,e.nodeName.toLowerCase()))}function Zl(e,t,n){Rl||(Rl=!0,a("Expected server HTML to contain a matching <%s> in <%s>.",t,e.nodeName.toLowerCase()))}function Jl(e,t){""!==t&&(Rl||(Rl=!0,a('Expected server HTML to contain a matching text node for "%s" in <%s>.',t,e.nodeName.toLowerCase())))}var eu,tu,nu=["address","applet","area","article","aside","base","basefont","bgsound","blockquote","body","br","button","caption","center","col","colgroup","dd","details","dir","div","dl","dt","embed","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","iframe","img","input","isindex","li","link","listing","main","marquee","menu","menuitem","meta","nav","noembed","noframes","noscript","object","ol","p","param","plaintext","pre","script","section","select","source","style","summary","table","tbody","td","template","textarea","tfoot","th","thead","title","tr","track","ul","wbr","xmp"],ru=["applet","caption","html","table","td","th","marquee","object","template","foreignObject","desc","title"],ou=ru.concat(["button"]),au=["dd","dt","li","option","optgroup","p","rp","rt"],iu={current:null,formTag:null,aTagInScope:null,buttonTagInScope:null,nobrTagInScope:null,pTagInButtonScope:null,listItemTagAutoclosing:null,dlItemTagAutoclosing:null};tu=function(e,t){var n=we({},e||iu),r={tag:t};return-1!==ru.indexOf(t)&&(n.aTagInScope=null,n.buttonTagInScope=null,n.nobrTagInScope=null),-1!==ou.indexOf(t)&&(n.pTagInButtonScope=null),-1!==nu.indexOf(t)&&"address"!==t&&"div"!==t&&"p"!==t&&(n.listItemTagAutoclosing=null,n.dlItemTagAutoclosing=null),n.current=r,"form"===t&&(n.formTag=r),"a"===t&&(n.aTagInScope=r),"button"===t&&(n.buttonTagInScope=r),"nobr"===t&&(n.nobrTagInScope=r),"p"===t&&(n.pTagInButtonScope=r),"li"===t&&(n.listItemTagAutoclosing=r),"dd"!==t&&"dt"!==t||(n.dlItemTagAutoclosing=r),n};var su={};eu=function(e,t,n){var r=(n=n||iu).current,o=r&&r.tag;null!=t&&(null!=e&&a("validateDOMNesting: when childText is passed, childTag should be null"),e="#text");var i=function(e,t){switch(t){case"select":return"option"===e||"optgroup"===e||"#text"===e;case"optgroup":return"option"===e||"#text"===e;case"option":return"#text"===e;case"tr":return"th"===e||"td"===e||"style"===e||"script"===e||"template"===e;case"tbody":case"thead":case"tfoot":return"tr"===e||"style"===e||"script"===e||"template"===e;case"colgroup":return"col"===e||"template"===e;case"table":return"caption"===e||"colgroup"===e||"tbody"===e||"tfoot"===e||"thead"===e||"style"===e||"script"===e||"template"===e;case"head":return"base"===e||"basefont"===e||"bgsound"===e||"link"===e||"meta"===e||"title"===e||"noscript"===e||"noframes"===e||"style"===e||"script"===e||"template"===e;case"html":return"head"===e||"body"===e||"frameset"===e;case"frameset":return"frame"===e;case"#document":return"html"===e}switch(e){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":return"h1"!==t&&"h2"!==t&&"h3"!==t&&"h4"!==t&&"h5"!==t&&"h6"!==t;case"rp":case"rt":return-1===au.indexOf(t);case"body":case"caption":case"col":case"colgroup":case"frameset":case"frame":case"head":case"html":case"tbody":case"td":case"tfoot":case"th":case"thead":case"tr":return null==t}return!0}(e,o)?null:r,s=i?null:function(e,t){switch(e){case"address":case"article":case"aside":case"blockquote":case"center":case"details":case"dialog":case"dir":case"div":case"dl":case"fieldset":case"figcaption":case"figure":case"footer":case"header":case"hgroup":case"main":case"menu":case"nav":case"ol":case"p":case"section":case"summary":case"ul":case"pre":case"listing":case"table":case"hr":case"xmp":case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":return t.pTagInButtonScope;case"form":return t.formTag||t.pTagInButtonScope;case"li":return t.listItemTagAutoclosing;case"dd":case"dt":return t.dlItemTagAutoclosing;case"button":return t.buttonTagInScope;case"a":return t.aTagInScope;case"nobr":return t.nobrTagInScope}return null}(e,n),l=i||s;if(l){var u=l.tag,c=!!i+"|"+e+"|"+u;if(!su[c]){su[c]=!0;var d=e,f="";if("#text"===e?/\S/.test(t)?d="Text nodes":(d="Whitespace text nodes",f=" Make sure you don't have any extra whitespace between tags on each line of your source code."):d="<"+e+">",i){var p="";"table"===u&&"tr"===e&&(p+=" Add a <tbody>, <thead> or <tfoot> to your code to match the DOM tree generated by the browser."),a("validateDOMNesting(...): %s cannot appear as a child of <%s>.%s%s",d,u,f,p)}else a("validateDOMNesting(...): %s cannot appear as a descendant of <%s>.",d,u)}}};var lu="suppressHydrationWarning",uu="$",cu="/$",du="$?",fu="$!",pu=null,hu=null;function mu(e){var t;pu=si,t=js(),hu={focusedElem:t,selectionRange:Fs(t)?Us(t):null};return li(!1),null}function gu(e,t,n,r,o){var i=r;if(eu(e,null,i.ancestorInfo),"string"==typeof t.children||"number"==typeof t.children){var s=""+t.children,l=tu(i.ancestorInfo,e);eu(null,s,l)}var u=function(e,t,n,r){var o,i,s=Vl(n),l=r;if(l===Rt&&(l=Ct(e)),l===Rt){if((o=un(e,t))||e===e.toLowerCase()||a("<%s /> is using incorrect casing. Use PascalCase for React components, or lowercase for HTML elements.",e),"script"===e){var u=s.createElement("div");u.innerHTML="<script><\/script>";var c=u.firstChild;i=u.removeChild(c)}else if("string"==typeof t.is)i=s.createElement(e,{is:t.is});else if(i=s.createElement(e),"select"===e){var d=i;t.multiple?d.multiple=!0:t.size&&(d.size=t.size)}}else i=s.createElementNS(l,e);return l===Rt&&(o||"[object HTMLUnknownElement]"!==Object.prototype.toString.call(i)||P.call(Tl,e)||(Tl[e]=!0,a("The tag <%s> is unrecognized in this browser. If you meant to render a React component, start its name with an uppercase letter.",e))),i}(e,t,n,i.namespace);return Hu(o,u),Zu(u,t),u}function bu(e,t){e.appendChild(t)}function yu(e,t){return"textarea"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}function _u(e,t,n,r){eu(null,e,n.ancestorInfo);var o=function(e,t){return Vl(t).createTextNode(e)}(e,t);return Hu(r,o),o}var vu="function"==typeof setTimeout?setTimeout:void 0,wu="function"==typeof clearTimeout?clearTimeout:void 0,Su="function"==typeof Promise?Promise:void 0,xu="function"==typeof queueMicrotask?queueMicrotask:void 0!==Su?function(e){return Su.resolve(null).then(e).catch(Tu)}:vu;function Tu(e){setTimeout(function(){throw e})}function Eu(e){jt(e,"")}function ku(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&8===o.nodeType){var a=o.data;if(a===cu){if(0===r)return e.removeChild(o),void ai(t);r--}else a!==uu&&a!==du&&a!==fu||r++}n=o}while(n);ai(t)}function Pu(e){var t=e.style;"function"==typeof t.setProperty?t.setProperty("display","none","important"):t.display="none"}function Ou(e){e.nodeValue=""}function Au(e,t){var n=t.style,r=null!=n&&n.hasOwnProperty("display")?n.display:null;e.style.display=zt("display",r)}function $u(e,t){e.nodeValue=t}function Ru(e){return e.data===du}function Iu(e){return e.data===fu}function Cu(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){var n=e.data;if(n===uu||n===fu||n===du)break;if(n===cu)return null}}return e}function Du(e){return Cu(e.nextSibling)}function Nu(e,t,n,r,o,a,i){return Hu(a,e),Zu(e,n),function(e,t,n,r,o,a,i){var s,l;switch(s=un(t,n),El(t,n),t){case"dialog":pl("cancel",e),pl("close",e);break;case"iframe":case"object":case"embed":pl("load",e);break;case"video":case"audio":for(var u=0;u<ll.length;u++)pl(ll[u],e);break;case"source":pl("error",e);break;case"img":case"image":case"link":pl("error",e),pl("load",e);break;case"details":pl("toggle",e);break;case"input":lt(e,n),pl("invalid",e);break;case"option":bt(0,n);break;case"select":Et(e,n),pl("invalid",e);break;case"textarea":Ot(e,n),pl("invalid",e)}ln(t,n),l=new Set;for(var c=e.attributes,d=0;d<c.length;d++)switch(c[d].name.toLowerCase()){case"value":case"checked":case"selected":break;default:l.add(c[d].name)}var f=null;for(var p in n)if(n.hasOwnProperty(p)){var h=n[p];if(p===Ml)"string"==typeof h?e.textContent!==h&&(!0!==n[Dl]&&zl(e.textContent,h,a,i),f=[Ml,h]):"number"==typeof h&&e.textContent!==""+h&&(!0!==n[Dl]&&zl(e.textContent,h,a,i),f=[Ml,""+h]);else if(S.hasOwnProperty(p))null!=h&&("function"!=typeof h&&Ol(p,h),"onScroll"===p&&pl("scroll",e));else if(i&&"boolean"==typeof s){var m=void 0,g=z(p);if(!0===n[Dl]);else if(p===Cl||p===Dl||"value"===p||"checked"===p||"selected"===p);else if(p===Il){var b=e.innerHTML,y=h?h[jl]:void 0;if(null!=y){var _=$l(e,y);_!==b&&kl(p,b,_)}}else if(p===Ll){if(l.delete(p),Al){var v=nn(h);v!==(m=e.getAttribute("style"))&&kl(p,m,v)}}else if(s)l.delete(p.toLowerCase()),h!==(m=Q(e,p,h))&&kl(p,m,h);else if(!F(p,g,s)&&!U(p,h,g,s)){var w=!1;if(null!==g)l.delete(g.attributeName),m=X(e,p,h,g);else{var x=r;if(x===Rt&&(x=Ct(t)),x===Rt)l.delete(p.toLowerCase());else{var T=Kl(p);null!==T&&T!==p&&(w=!0,l.delete(T)),l.delete(p)}m=Q(e,p,h)}h===m||w||kl(p,m,h)}}}switch(i&&l.size>0&&!0!==n[Dl]&&Pl(l),t){case"input":Je(e),dt(e,n,!0);break;case"textarea":Je(e),$t(e);break;case"select":case"option":break;default:"function"==typeof n.onClick&&ql(e)}return f}(e,t,n,o.namespace,0,!!(1&a.mode),i)}function Mu(e){for(var t=e.previousSibling,n=0;t;){if(8===t.nodeType){var r=t.data;if(r===uu||r===fu||r===du){if(0===n)return t;n--}else r===cu&&n++}t=t.previousSibling}return null}var Lu=Math.random().toString(36).slice(2),ju="__reactFiber$"+Lu,Fu="__reactProps$"+Lu,Bu="__reactContainer$"+Lu,Uu="__reactEvents$"+Lu,zu="__reactListeners$"+Lu,Vu="__reactHandles$"+Lu;function Hu(e,t){t[ju]=e}function qu(e,t){t[Bu]=e}function Gu(e){e[Bu]=null}function Wu(e){return!!e[Bu]}function Yu(e){var t=e[ju];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Bu]||n[ju]){var r=t.alternate;if(null!==t.child||null!==r&&null!==r.child)for(var o=Mu(e);null!==o;){var a=o[ju];if(a)return a;o=Mu(o)}return t}n=(e=n).parentNode}return null}function Ku(e){var t=e[ju]||e[Bu];return t&&(5===t.tag||6===t.tag||t.tag===c||3===t.tag)?t:null}function Xu(e){if(5===e.tag||6===e.tag)return e.stateNode;throw new Error("getNodeFromInstance: Invalid argument.")}function Qu(e){return e[Fu]||null}function Zu(e,t){e[Fu]=t}var Ju={},ec=n.ReactDebugCurrentFrame;function tc(e){if(e){var t=e._owner,n=Ie(e.type,e._source,t?t.type:null);ec.setExtraStackFrame(n)}else ec.setExtraStackFrame(null)}function nc(e,t,n,r,o){var i=Function.call.bind(P);for(var s in e)if(i(e,s)){var l=void 0;try{if("function"!=typeof e[s]){var u=Error((r||"React class")+": "+n+" type `"+s+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[s]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw u.name="Invariant Violation",u}l=e[s](t,s,r,n,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(c){l=c}!l||l instanceof Error||(tc(o),a("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",r||"React class",n,s,typeof l),tc(null)),l instanceof Error&&!(l.message in Ju)&&(Ju[l.message]=!0,tc(o),a("Failed %s type: %s",n,l.message),tc(null))}}var rc,oc=[];rc=[];var ac,ic=-1;function sc(e){return{current:e}}function lc(e,t){ic<0?a("Unexpected pop."):(t!==rc[ic]&&a("Unexpected Fiber popped."),e.current=oc[ic],oc[ic]=null,rc[ic]=null,ic--)}function uc(e,t,n){ic++,oc[ic]=e.current,rc[ic]=n,e.current=t}ac={};var cc={};Object.freeze(cc);var dc=sc(cc),fc=sc(!1),pc=cc;function hc(e,t,n){return n&&yc(t)?pc:dc.current}function mc(e,t,n){var r=e.stateNode;r.__reactInternalMemoizedUnmaskedChildContext=t,r.__reactInternalMemoizedMaskedChildContext=n}function gc(e,t){var n=e.type.contextTypes;if(!n)return cc;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={};for(var a in n)o[a]=t[a];return nc(n,o,"context",je(e)||"Unknown"),r&&mc(e,t,o),o}function bc(){return fc.current}function yc(e){var t=e.childContextTypes;return null!=t}function _c(e){lc(fc,e),lc(dc,e)}function vc(e){lc(fc,e),lc(dc,e)}function wc(e,t,n){if(dc.current!==cc)throw new Error("Unexpected context found on stack. This error is likely caused by a bug in React. Please file an issue.");uc(dc,t,e),uc(fc,n,e)}function Sc(e,t,n){var r=e.stateNode,o=t.childContextTypes;if("function"!=typeof r.getChildContext){var i=je(e)||"Unknown";return ac[i]||(ac[i]=!0,a("%s.childContextTypes is specified but there is no getChildContext() method on the instance. You can either define getChildContext() on %s or remove childContextTypes from it.",i,i)),n}var s=r.getChildContext();for(var l in s)if(!(l in o))throw new Error((je(e)||"Unknown")+'.getChildContext(): key "'+l+'" is not defined in childContextTypes.');return nc(o,s,"child context",je(e)||"Unknown"),we({},n,s)}function xc(e){var t=e.stateNode,n=t&&t.__reactInternalMemoizedMergedChildContext||cc;return pc=dc.current,uc(dc,n,e),uc(fc,fc.current,e),!0}function Tc(e,t,n){var r=e.stateNode;if(!r)throw new Error("Expected to have an instance by this point. This error is likely caused by a bug in React. Please file an issue.");if(n){var o=Sc(e,t,pc);r.__reactInternalMemoizedMergedChildContext=o,lc(fc,e),lc(dc,e),uc(dc,o,e),uc(fc,n,e)}else lc(fc,e),uc(fc,n,e)}function Ec(e){if(!function(e){return Tr(e)===e}(e)||1!==e.tag)throw new Error("Expected subtree parent to be a mounted class component. This error is likely caused by a bug in React. Please file an issue.");var t=e;do{switch(t.tag){case 3:return t.stateNode.context;case 1:if(yc(t.type))return t.stateNode.__reactInternalMemoizedMergedChildContext}t=t.return}while(null!==t);throw new Error("Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue.")}var kc=null,Pc=!1,Oc=!1;function Ac(e){null===kc?kc=[e]:kc.push(e)}function $c(){Pc&&Rc()}function Rc(){if(!Oc&&null!==kc){Oc=!0;var e=0,t=La();try{var n=kc;for(ja(Ia);e<n.length;e++){var r=n[e];do{r=r(true)}while(null!==r)}kc=null,Pc=!1}catch(o){throw null!==kc&&(kc=kc.slice(e+1)),Cr(Fr,Rc),o}finally{ja(t),Oc=!1}}return null}var Ic=[],Cc=0,Dc=null,Nc=0,Mc=[],Lc=0,jc=null,Fc=1,Bc="";function Uc(){var e=Bc;return(Fc&~function(e){return 1<<qc(e)-1}(Fc)).toString(32)+e}function zc(e,t){Wc(),Ic[Cc++]=Nc,Ic[Cc++]=Dc,Dc=e,Nc=t}function Vc(e,t,n){Wc(),Mc[Lc++]=Fc,Mc[Lc++]=Bc,Mc[Lc++]=jc,jc=e;var r=Fc,o=Bc,a=qc(r)-1,i=r&~(1<<a),s=n+1,l=qc(t)+a;if(l>30){var u=a-a%5,c=(i&(1<<u)-1).toString(32),d=i>>u,f=a-u,p=qc(t)+f;Fc=1<<p|(s<<f|d),Bc=c+o}else{Fc=1<<l|(s<<a|i),Bc=o}}function Hc(e){if(Wc(),null!==e.return){zc(e,1),Vc(e,1,0)}}function qc(e){return 32-yo(e)}function Gc(e){for(;e===Dc;)Dc=Ic[--Cc],Ic[Cc]=null,Nc=Ic[--Cc],Ic[Cc]=null;for(;e===jc;)jc=Mc[--Lc],Mc[Lc]=null,Bc=Mc[--Lc],Mc[Lc]=null,Fc=Mc[--Lc],Mc[Lc]=null}function Wc(){yd()||a("Expected to be hydrating. This is a bug in React. Please file an issue.")}var Yc=null,Kc=null,Xc=!1,Qc=!1,Zc=null;function Jc(){Qc=!0}function ed(e){var t=e.stateNode.containerInfo;return Kc=Cu(t.firstChild),Yc=e,Xc=!0,Zc=null,Qc=!1,!0}function td(e,t,n){var r,o;return Kc=Cu(t.nextSibling),Yc=e,Xc=!0,Zc=null,Qc=!1,null!==n&&(r=e,o=n,Wc(),Mc[Lc++]=Fc,Mc[Lc++]=Bc,Mc[Lc++]=jc,Fc=o.id,Bc=o.overflow,jc=r),!0}function nd(e,t){switch(e.tag){case 3:!function(e,t){1===t.nodeType?Xl(e,t):8===t.nodeType||Ql(e,t)}(e.stateNode.containerInfo,t);break;case 5:var n=!!(1&e.mode);!function(e,t,n,r,o){(o||!0!==t[lu])&&(1===r.nodeType?Xl(n,r):8===r.nodeType||Ql(n,r))}(e.type,e.memoizedProps,e.stateNode,t,n);break;case c:var r=e.memoizedState;null!==r.dehydrated&&function(e,t){var n=e.parentNode;null!==n&&(1===t.nodeType?Xl(n,t):8===t.nodeType||Ql(n,t))}(r.dehydrated,t)}}function rd(e,t){nd(e,t);var n,r=((n=W_(5,null,null,0)).elementType="DELETED",n);r.stateNode=t,r.return=e;var o=e.deletions;null===o?(e.deletions=[r],e.flags|=tr):o.push(r)}function od(e,t){if(!Qc)switch(e.tag){case 3:var n=e.stateNode.containerInfo;switch(t.tag){case 5:var r=t.type;t.pendingProps,function(e,t){Zl(e,t)}(n,r);break;case 6:!function(e,t){Jl(e,t)}(n,t.pendingProps)}break;case 5:e.type;var o=e.memoizedProps,a=e.stateNode;switch(t.tag){case 5:var i=t.type;t.pendingProps;!function(e,t,n,r,o,a){(a||!0!==t[lu])&&Zl(n,r)}(0,o,a,i,0,!!(1&e.mode));break;case 6:!function(e,t,n,r,o){(o||!0!==t[lu])&&Jl(n,r)}(0,o,a,t.pendingProps,!!(1&e.mode))}break;case c:var s=e.memoizedState.dehydrated;if(null!==s)switch(t.tag){case 5:var l=t.type;t.pendingProps,function(e,t){var n=e.parentNode;null!==n&&Zl(n,t)}(s,l);break;case 6:!function(e,t){var n=e.parentNode;null!==n&&Jl(n,t)}(s,t.pendingProps)}break;default:return}}function ad(e,t){t.flags=-4097&t.flags|2,od(e,t)}function id(e,t){switch(e.tag){case 5:var n=e.type;e.pendingProps;var r=function(e,t){return 1!==e.nodeType||t.toLowerCase()!==e.nodeName.toLowerCase()?null:e}(t,n);return null!==r&&(e.stateNode=r,Yc=e,Kc=Cu(r.firstChild),!0);case 6:var o=function(e,t){return""===t||3!==e.nodeType?null:e}(t,e.pendingProps);return null!==o&&(e.stateNode=o,Yc=e,Kc=null,!0);case c:var a=function(e){return 8!==e.nodeType?null:e}(t);if(null!==a){var i={dehydrated:a,treeContext:(Wc(),null!==jc?{id:Fc,overflow:Bc}:null),retryLane:Zo};e.memoizedState=i;var s=function(e){var t=W_(h,null,null,0);return t.stateNode=e,t}(a);return s.return=e,e.child=s,Yc=e,Kc=null,!0}return!1;default:return!1}}function sd(e){return!!(1&e.mode)&&0===(e.flags&nr)}function ld(e){throw new Error("Hydration failed because the initial UI does not match what was rendered on the server.")}function ud(e){if(Xc){var t=Kc;if(!t)return sd(e)&&(od(Yc,e),ld()),ad(Yc,e),Xc=!1,void(Yc=e);var n=t;if(!id(e,t)){sd(e)&&(od(Yc,e),ld()),t=Du(n);var r=Yc;if(!t||!id(e,t))return ad(Yc,e),Xc=!1,void(Yc=e);rd(r,n)}}}function cd(e){var t=e.stateNode,n=e.memoizedProps,r=function(e,t,n){return Hu(n,e),n.mode,function(e,t){return e.nodeValue!==t}(e,t)}(t,n,e);if(r){var o=Yc;if(null!==o)switch(o.tag){case 3:o.stateNode.containerInfo;!function(e,t,n,r){zl(t.nodeValue,n,r,!0)}(0,t,n,!!(1&o.mode));break;case 5:o.type;var a=o.memoizedProps;o.stateNode;!function(e,t,n,r,o,a){!0!==t[lu]&&zl(r.nodeValue,o,a,!0)}(0,a,0,t,n,!!(1&o.mode))}}return r}function dd(e){var t=e.memoizedState,n=null!==t?t.dehydrated:null;if(!n)throw new Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");!function(e,t){Hu(t,e)}(n,e)}function fd(e){var t=e.memoizedState,n=null!==t?t.dehydrated:null;if(!n)throw new Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");return function(e){for(var t=e.nextSibling,n=0;t;){if(8===t.nodeType){var r=t.data;if(r===cu){if(0===n)return Du(t);n--}else r!==uu&&r!==fu&&r!==du||n++}t=t.nextSibling}return null}(n)}function pd(e){for(var t=e.return;null!==t&&5!==t.tag&&3!==t.tag&&t.tag!==c;)t=t.return;Yc=t}function hd(e){if(e!==Yc)return!1;if(!Xc)return pd(e),Xc=!0,!1;if(3!==e.tag&&(5!==e.tag||"head"!==(n=e.type)&&"body"!==n&&!yu(e.type,e.memoizedProps))){var t=Kc;if(t)if(sd(e))md(e),ld();else for(;t;)rd(e,t),t=Du(t)}var n;return pd(e),Kc=e.tag===c?fd(e):Yc?Du(e.stateNode):null,!0}function md(e){for(var t=Kc;t;)nd(e,t),t=Du(t)}function gd(){Yc=null,Kc=null,Xc=!1,Qc=!1}function bd(){null!==Zc&&(Hy(Zc),Zc=null)}function yd(){return Xc}function _d(e){null===Zc?Zc=[e]:Zc.push(e)}var vd=n.ReactCurrentBatchConfig;var wd={recordUnsafeLifecycleWarnings:function(e,t){},flushPendingUnsafeLifecycleWarnings:function(){},recordLegacyContextWarning:function(e,t){},flushLegacyContextWarning:function(){},discardPendingWarnings:function(){}},Sd=function(e){var t=[];return e.forEach(function(e){t.push(e)}),t.sort().join(", ")},xd=[],Td=[],Ed=[],kd=[],Pd=[],Od=[],Ad=new Set;wd.recordUnsafeLifecycleWarnings=function(e,t){Ad.has(e.type)||("function"==typeof t.componentWillMount&&!0!==t.componentWillMount.__suppressDeprecationWarning&&xd.push(e),8&e.mode&&"function"==typeof t.UNSAFE_componentWillMount&&Td.push(e),"function"==typeof t.componentWillReceiveProps&&!0!==t.componentWillReceiveProps.__suppressDeprecationWarning&&Ed.push(e),8&e.mode&&"function"==typeof t.UNSAFE_componentWillReceiveProps&&kd.push(e),"function"==typeof t.componentWillUpdate&&!0!==t.componentWillUpdate.__suppressDeprecationWarning&&Pd.push(e),8&e.mode&&"function"==typeof t.UNSAFE_componentWillUpdate&&Od.push(e))},wd.flushPendingUnsafeLifecycleWarnings=function(){var e=new Set;xd.length>0&&(xd.forEach(function(t){e.add(je(t)||"Component"),Ad.add(t.type)}),xd=[]);var t=new Set;Td.length>0&&(Td.forEach(function(e){t.add(je(e)||"Component"),Ad.add(e.type)}),Td=[]);var n=new Set;Ed.length>0&&(Ed.forEach(function(e){n.add(je(e)||"Component"),Ad.add(e.type)}),Ed=[]);var r=new Set;kd.length>0&&(kd.forEach(function(e){r.add(je(e)||"Component"),Ad.add(e.type)}),kd=[]);var i=new Set;Pd.length>0&&(Pd.forEach(function(e){i.add(je(e)||"Component"),Ad.add(e.type)}),Pd=[]);var s=new Set;(Od.length>0&&(Od.forEach(function(e){s.add(je(e)||"Component"),Ad.add(e.type)}),Od=[]),t.size>0)&&a("Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move code with side effects to componentDidMount, and set initial state in the constructor.\n\nPlease update the following components: %s",Sd(t));r.size>0&&a("Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move data fetching code or side effects to componentDidUpdate.\n* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state\n\nPlease update the following components: %s",Sd(r));s.size>0&&a("Using UNSAFE_componentWillUpdate in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move data fetching code or side effects to componentDidUpdate.\n\nPlease update the following components: %s",Sd(s));e.size>0&&o("componentWillMount has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move code with side effects to componentDidMount, and set initial state in the constructor.\n* Rename componentWillMount to UNSAFE_componentWillMount to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run `npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n\nPlease update the following components: %s",Sd(e));n.size>0&&o("componentWillReceiveProps has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move data fetching code or side effects to componentDidUpdate.\n* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state\n* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run `npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n\nPlease update the following components: %s",Sd(n));i.size>0&&o("componentWillUpdate has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move data fetching code or side effects to componentDidUpdate.\n* Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run `npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n\nPlease update the following components: %s",Sd(i))};var $d,Rd,Id,Cd,Dd,Nd=new Map,Md=new Set;wd.recordLegacyContextWarning=function(e,t){var n=function(e){for(var t=null,n=e;null!==n;)8&n.mode&&(t=n),n=n.return;return t}(e);if(null!==n){if(!Md.has(e.type)){var r=Nd.get(n);(null!=e.type.contextTypes||null!=e.type.childContextTypes||null!==t&&"function"==typeof t.getChildContext)&&(void 0===r&&(r=[],Nd.set(n,r)),r.push(e))}}else a("Expected to find a StrictMode component in a strict mode tree. This error is likely caused by a bug in React. Please file an issue.")},wd.flushLegacyContextWarning=function(){Nd.forEach(function(e,t){if(0!==e.length){var n=e[0],r=new Set;e.forEach(function(e){r.add(je(e)||"Component"),Md.add(e.type)});var o=Sd(r);try{qe(n),a("Legacy context API has been detected within a strict-mode tree.\n\nThe old API will be supported in all 16.x releases, but applications using it should migrate to the new version.\n\nPlease update the following components: %s\n\nLearn more about this warning here: https://reactjs.org/link/legacy-context",o)}finally{He()}}})},wd.discardPendingWarnings=function(){xd=[],Td=[],Ed=[],kd=[],Pd=[],Od=[],Nd=new Map};var Ld;function jd(e,t,n){var r,o=n.ref;if(null!==o&&"function"!=typeof o&&"object"!=typeof o){if(e.mode,!(n._owner&&n._self&&n._owner.stateNode!==n._self||n._owner&&1!==n._owner.tag)&&("function"!=typeof n.type||(r=n.type).prototype&&r.prototype.isReactComponent)&&n._owner){var i=je(e)||"Component";Id[i]||(a('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. We recommend using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',i,o),Id[i]=!0)}if(n._owner){var s,l=n._owner;if(l){var u=l;if(1!==u.tag)throw new Error("Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref");s=u.stateNode}if(!s)throw new Error("Missing owner for string ref "+o+". This error is likely caused by a bug in React. Please file an issue.");var c=s;!function(e,t){if(A(e))a("The provided `%s` prop is an unsupported type %s. This value must be coerced to a string before before using it here.",t,O(e)),$(e)}(o,"ref");var d=""+o;if(null!==t&&null!==t.ref&&"function"==typeof t.ref&&t.ref._stringRef===d)return t.ref;var f=function(e){var t=c.refs;null===e?delete t[d]:t[d]=e};return f._stringRef=d,f}if("string"!=typeof o)throw new Error("Expected ref to be a function, a string, an object returned by React.createRef(), or null.");if(!n._owner)throw new Error("Element ref was specified as a string ("+o+") but no owner was set. This could happen for one of the following reasons:\n1. You may be adding a ref to a function component\n2. You may be adding a ref to a component that was not created inside a component's render method\n3. You have multiple copies of React loaded\nSee https://reactjs.org/link/refs-must-have-owner for more information.")}return o}function Fd(e,t){var n=Object.prototype.toString.call(t);throw new Error("Objects are not valid as a React child (found: "+("[object Object]"===n?"object with keys {"+Object.keys(t).join(", ")+"}":n)+"). If you meant to render a collection of children, use an array instead.")}function Bd(e){var t=je(e)||"Component";Dd[t]||(Dd[t]=!0,a("Functions are not valid as a React child. This may happen if you return a Component instead of <Component /> from render. Or maybe you meant to call this function rather than return it."))}function Ud(e){var t=e._payload;return(0,e._init)(t)}function zd(e){function t(t,n){if(e){var r=t.deletions;null===r?(t.deletions=[n],t.flags|=tr):r.push(n)}}function n(n,r){if(!e)return null;for(var o=r;null!==o;)t(n,o),o=o.sibling;return null}function r(e,t){for(var n=new Map,r=t;null!==r;)null!==r.key?n.set(r.key,r):n.set(r.index,r),r=r.sibling;return n}function o(e,t){var n=K_(e,t);return n.index=0,n.sibling=null,n}function i(t,n,r){if(t.index=r,!e)return t.flags|=pr,n;var o=t.alternate;if(null!==o){var a=o.index;return a<n?(t.flags|=2,n):a}return t.flags|=2,n}function s(t){return e&&null===t.alternate&&(t.flags|=2),t}function l(e,t,n,r){if(null===t||6!==t.tag){var a=tv(n,e.mode,r);return a.return=e,a}var i=o(t,n);return i.return=e,i}function u(e,t,n,r){var a=n.type;if(a===te)return d(e,t,n.props.children,r,n.key);if(null!==t&&(t.elementType===a||j_(t,n)||"object"==typeof a&&null!==a&&a.$$typeof===ce&&Ud(a)===t.type)){var i=o(t,n.props);return i.ref=jd(e,t,n),i.return=e,i._debugSource=n._source,i._debugOwner=n._owner,i}var s=Z_(n,e.mode,r);return s.ref=jd(e,t,n),s.return=e,s}function c(e,t,n,r){if(null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation){var a=nv(n,e.mode,r);return a.return=e,a}var i=o(t,n.children||[]);return i.return=e,i}function d(e,t,n,r,a){if(null===t||7!==t.tag){var i=J_(n,e.mode,r,a);return i.return=e,i}var s=o(t,n);return s.return=e,s}function f(e,t,n){if("string"==typeof t&&""!==t||"number"==typeof t){var r=tv(""+t,e.mode,n);return r.return=e,r}if("object"==typeof t&&null!==t){switch(t.$$typeof){case J:var o=Z_(t,e.mode,n);return o.ref=jd(e,null,t),o.return=e,o;case ee:var a=nv(t,e.mode,n);return a.return=e,a;case ce:var i=t._payload;return f(e,(0,t._init)(i),n)}if(vt(t)||pe(t)){var s=J_(t,e.mode,n,null);return s.return=e,s}Fd(0,t)}return"function"==typeof t&&Bd(e),null}function p(e,t,n,r){var o=null!==t?t.key:null;if("string"==typeof n&&""!==n||"number"==typeof n)return null!==o?null:l(e,t,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case J:return n.key===o?u(e,t,n,r):null;case ee:return n.key===o?c(e,t,n,r):null;case ce:var a=n._payload;return p(e,t,(0,n._init)(a),r)}if(vt(n)||pe(n))return null!==o?null:d(e,t,n,r,null);Fd(0,n)}return"function"==typeof n&&Bd(e),null}function h(e,t,n,r,o){if("string"==typeof r&&""!==r||"number"==typeof r)return l(t,e.get(n)||null,""+r,o);if("object"==typeof r&&null!==r){switch(r.$$typeof){case J:return u(t,e.get(null===r.key?n:r.key)||null,r,o);case ee:return c(t,e.get(null===r.key?n:r.key)||null,r,o);case ce:var a=r._payload;return h(e,t,n,(0,r._init)(a),o)}if(vt(r)||pe(r))return d(t,e.get(n)||null,r,o,null);Fd(0,r)}return"function"==typeof r&&Bd(t),null}function m(e,t,n){if("object"!=typeof e||null===e)return t;switch(e.$$typeof){case J:case ee:Ld(e,n);var r=e.key;if("string"!=typeof r)break;if(null===t){(t=new Set).add(r);break}if(!t.has(r)){t.add(r);break}a("Encountered two children with the same key, `%s`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change in a future version.",r);break;case ce:var o=e._payload;m((0,e._init)(o),t,n)}return t}return function l(u,c,d,g){if("object"==typeof d&&null!==d&&d.type===te&&null===d.key&&(d=d.props.children),"object"==typeof d&&null!==d){switch(d.$$typeof){case J:return s(function(e,r,a,i){for(var s=a.key,l=r;null!==l;){if(l.key===s){var u=a.type;if(u===te){if(7===l.tag){n(e,l.sibling);var c=o(l,a.props.children);return c.return=e,c._debugSource=a._source,c._debugOwner=a._owner,c}}else if(l.elementType===u||j_(l,a)||"object"==typeof u&&null!==u&&u.$$typeof===ce&&Ud(u)===l.type){n(e,l.sibling);var d=o(l,a.props);return d.ref=jd(e,l,a),d.return=e,d._debugSource=a._source,d._debugOwner=a._owner,d}n(e,l);break}t(e,l),l=l.sibling}if(a.type===te){var f=J_(a.props.children,e.mode,i,a.key);return f.return=e,f}var p=Z_(a,e.mode,i);return p.ref=jd(e,r,a),p.return=e,p}(u,c,d,g));case ee:return s(function(e,r,a,i){for(var s=a.key,l=r;null!==l;){if(l.key===s){if(4===l.tag&&l.stateNode.containerInfo===a.containerInfo&&l.stateNode.implementation===a.implementation){n(e,l.sibling);var u=o(l,a.children||[]);return u.return=e,u}n(e,l);break}t(e,l),l=l.sibling}var c=nv(a,e.mode,i);return c.return=e,c}(u,c,d,g));case ce:var b=d._payload;return l(u,c,(0,d._init)(b),g)}if(vt(d))return function(o,a,s,l){for(var u=null,c=0;c<s.length;c++)u=m(s[c],u,o);for(var d=null,g=null,b=a,y=0,_=0,v=null;null!==b&&_<s.length;_++){b.index>_?(v=b,b=null):v=b.sibling;var w=p(o,b,s[_],l);if(null===w){null===b&&(b=v);break}e&&b&&null===w.alternate&&t(o,b),y=i(w,y,_),null===g?d=w:g.sibling=w,g=w,b=v}if(_===s.length)return n(o,b),yd()&&zc(o,_),d;if(null===b){for(;_<s.length;_++){var S=f(o,s[_],l);null!==S&&(y=i(S,y,_),null===g?d=S:g.sibling=S,g=S)}return yd()&&zc(o,_),d}for(var x=r(0,b);_<s.length;_++){var T=h(x,o,_,s[_],l);null!==T&&(e&&null!==T.alternate&&x.delete(null===T.key?_:T.key),y=i(T,y,_),null===g?d=T:g.sibling=T,g=T)}return e&&x.forEach(function(e){return t(o,e)}),yd()&&zc(o,_),d}(u,c,d,g);if(pe(d))return function(o,s,l,u){var c=pe(l);if("function"!=typeof c)throw new Error("An object is not an iterable. This error is likely caused by a bug in React. Please file an issue.");"function"==typeof Symbol&&"Generator"===l[Symbol.toStringTag]&&(Rd||a("Using Generators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You may convert it to an array with `Array.from()` or the `[...spread]` operator before rendering. Keep in mind you might need to polyfill these features for older browsers."),Rd=!0),l.entries===c&&($d||a("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),$d=!0);var d=c.call(l);if(d)for(var g=null,b=d.next();!b.done;b=d.next())g=m(b.value,g,o);var y=c.call(l);if(null==y)throw new Error("An iterable object provided no iterator.");for(var _=null,v=null,w=s,S=0,x=0,T=null,E=y.next();null!==w&&!E.done;x++,E=y.next()){w.index>x?(T=w,w=null):T=w.sibling;var k=p(o,w,E.value,u);if(null===k){null===w&&(w=T);break}e&&w&&null===k.alternate&&t(o,w),S=i(k,S,x),null===v?_=k:v.sibling=k,v=k,w=T}if(E.done)return n(o,w),yd()&&zc(o,x),_;if(null===w){for(;!E.done;x++,E=y.next()){var P=f(o,E.value,u);null!==P&&(S=i(P,S,x),null===v?_=P:v.sibling=P,v=P)}return yd()&&zc(o,x),_}for(var O=r(0,w);!E.done;x++,E=y.next()){var A=h(O,o,x,E.value,u);null!==A&&(e&&null!==A.alternate&&O.delete(null===A.key?x:A.key),S=i(A,S,x),null===v?_=A:v.sibling=A,v=A)}return e&&O.forEach(function(e){return t(o,e)}),yd()&&zc(o,x),_}(u,c,d,g);Fd(0,d)}return"string"==typeof d&&""!==d||"number"==typeof d?s(function(e,t,r,a){if(null!==t&&6===t.tag){n(e,t.sibling);var i=o(t,r);return i.return=e,i}n(e,t);var s=tv(r,e.mode,a);return s.return=e,s}(u,c,""+d,g)):("function"==typeof d&&Bd(u),n(u,c))}}$d=!1,Rd=!1,Id={},Cd={},Dd={},Ld=function(e,t){if(null!==e&&"object"==typeof e&&e._store&&!e._store.validated&&null==e.key){if("object"!=typeof e._store)throw new Error("React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue.");e._store.validated=!0;var n=je(t)||"Component";Cd[n]||(Cd[n]=!0,a('Each child in a list should have a unique "key" prop. See https://reactjs.org/link/warning-keys for more information.'))}};var Vd=zd(!0),Hd=zd(!1);function qd(e,t){for(var n=e.child;null!==n;)X_(n,t),n=n.sibling}var Gd,Wd=sc(null);Gd={};var Yd=null,Kd=null,Xd=null,Qd=!1;function Zd(){Yd=null,Kd=null,Xd=null,Qd=!1}function Jd(){Qd=!0}function ef(){Qd=!1}function tf(e,t,n){uc(Wd,t._currentValue,e),t._currentValue=n,void 0!==t._currentRenderer&&null!==t._currentRenderer&&t._currentRenderer!==Gd&&a("Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported."),t._currentRenderer=Gd}function nf(e,t){var n=Wd.current;lc(Wd,t),e._currentValue=n}function rf(e,t,n){for(var r=e;null!==r;){var o=r.alternate;if(ba(r.childLanes,t)?null===o||ba(o.childLanes,t)||(o.childLanes=ya(o.childLanes,t)):(r.childLanes=ya(r.childLanes,t),null!==o&&(o.childLanes=ya(o.childLanes,t))),r===n)break;r=r.return}r!==n&&a("Expected to find the propagation root when scheduling context work. This error is likely caused by a bug in React. Please file an issue.")}function of(e,t,n){!function(e,t,n){var r=e.child;null!==r&&(r.return=e);for(;null!==r;){var o=void 0,a=r.dependencies;if(null!==a){o=r.child;for(var i=a.firstContext;null!==i;){if(i.context===t){if(1===r.tag){var l=pa(n),u=wf(ea,l);u.tag=bf;var c=r.updateQueue;if(null===c);else{var d=c.shared,f=d.pending;null===f?u.next=u:(u.next=f.next,f.next=u),d.pending=u}}r.lanes=ya(r.lanes,n);var p=r.alternate;null!==p&&(p.lanes=ya(p.lanes,n)),rf(r.return,n,e),a.lanes=ya(a.lanes,n);break}i=i.next}}else if(r.tag===s)o=r.type===e.type?null:r.child;else if(r.tag===h){var m=r.return;if(null===m)throw new Error("We just came from a parent so we must have had a parent. This is a bug in React.");m.lanes=ya(m.lanes,n);var g=m.alternate;null!==g&&(g.lanes=ya(g.lanes,n)),rf(m,n,e),o=r.sibling}else o=r.child;if(null!==o)o.return=r;else for(o=r;null!==o;){if(o===e){o=null;break}var b=o.sibling;if(null!==b){b.return=o.return,o=b;break}o=o.return}r=o}}(e,t,n)}function af(e,t){Yd=e,Kd=null,Xd=null;var n=e.dependencies;null!==n&&(null!==n.firstContext&&(ga(n.lanes,t)&&mg(),n.firstContext=null))}function sf(e){Qd&&a("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().");var t=e._currentValue;if(Xd===e);else{var n={context:e,memoizedValue:t,next:null};if(null===Kd){if(null===Yd)throw new Error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().");Kd=n,Yd.dependencies={lanes:0,firstContext:n}}else Kd=Kd.next=n}return t}var lf=null;function uf(e){null===lf?lf=[e]:lf.push(e)}function cf(e,t,n,r){var o=t.interleaved;return null===o?(n.next=n,uf(t)):(n.next=o.next,o.next=n),t.interleaved=n,pf(e,r)}function df(e,t){return pf(e,t)}var ff=pf;function pf(e,t){e.lanes=ya(e.lanes,t);var n=e.alternate;null!==n&&(n.lanes=ya(n.lanes,t)),null===n&&4098&e.flags&&x_(e);for(var r=e,o=e.return;null!==o;)o.childLanes=ya(o.childLanes,t),null!==(n=o.alternate)?n.childLanes=ya(n.childLanes,t):4098&o.flags&&x_(e),r=o,o=o.return;return 3===r.tag?r.stateNode:null}var hf,mf,gf=0,bf=2,yf=!1;function _f(e){var t={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null};e.updateQueue=t}function vf(e,t){var n=t.updateQueue,r=e.updateQueue;if(n===r){var o={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,effects:r.effects};t.updateQueue=o}}function wf(e,t){return{eventTime:e,lane:t,tag:gf,payload:null,callback:null,next:null}}function Sf(e,t,n){var r=e.updateQueue;if(null===r)return null;var o=r.shared;if(mf!==o||hf||(a("An update (setState, replaceState, or forceUpdate) was scheduled from inside an update function. Update functions should be pure, with zero side-effects. Consider using componentDidUpdate or a callback."),hf=!0),(Qb&zb)!==Ub){var i=o.pending;return null===i?t.next=t:(t.next=i.next,i.next=t),o.pending=t,ff(e,n)}return function(e,t,n,r){var o=t.interleaved;return null===o?(n.next=n,uf(t)):(n.next=o.next,o.next=n),t.interleaved=n,pf(e,r)}(e,o,t,n)}function xf(e,t,n){var r=t.updateQueue;if(null!==r){var o=r.shared;if(ca(n)){var a=o.lanes,i=ya(a=va(a,e.pendingLanes),n);o.lanes=i,Ta(e,i)}}}function Tf(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r){var o=r.updateQueue;if(n===o){var a=null,i=null,s=n.firstBaseUpdate;if(null!==s){var l=s;do{var u={eventTime:l.eventTime,lane:l.lane,tag:l.tag,payload:l.payload,callback:l.callback,next:null};null===i?a=i=u:(i.next=u,i=u),l=l.next}while(null!==l);null===i?a=i=t:(i.next=t,i=t)}else a=i=t;return n={baseState:o.baseState,firstBaseUpdate:a,lastBaseUpdate:i,shared:o.shared,effects:o.effects},void(e.updateQueue=n)}}var c=n.lastBaseUpdate;null===c?n.firstBaseUpdate=t:c.next=t,n.lastBaseUpdate=t}function Ef(e,t,n,r,o,a){switch(n.tag){case 1:var i=n.payload;if("function"==typeof i){Jd();var s=i.call(a,r,o);if(8&e.mode){Qr(!0);try{i.call(a,r,o)}finally{Qr(!1)}}return ef(),s}return i;case 3:e.flags=-65537&e.flags|nr;case gf:var l,u=n.payload;if("function"==typeof u){if(Jd(),l=u.call(a,r,o),8&e.mode){Qr(!0);try{u.call(a,r,o)}finally{Qr(!1)}}ef()}else l=u;return null==l?r:we({},r,l);case bf:return yf=!0,r}return r}function kf(e,t,n,r){var o=e.updateQueue;yf=!1,mf=o.shared;var a=o.firstBaseUpdate,i=o.lastBaseUpdate,s=o.shared.pending;if(null!==s){o.shared.pending=null;var l=s,u=l.next;l.next=null,null===i?a=u:i.next=u,i=l;var c=e.alternate;if(null!==c){var d=c.updateQueue,f=d.lastBaseUpdate;f!==i&&(null===f?d.firstBaseUpdate=u:f.next=u,d.lastBaseUpdate=l)}}if(null!==a){for(var p=o.baseState,h=0,m=null,g=null,b=null,y=a;;){var _=y.lane,v=y.eventTime;if(ba(r,_)){if(null!==b){var w={eventTime:v,lane:0,tag:y.tag,payload:y.payload,callback:y.callback,next:null};b=b.next=w}if(p=Ef(e,0,y,p,t,n),null!==y.callback&&0!==y.lane){e.flags|=64;var S=o.effects;null===S?o.effects=[y]:S.push(y)}}else{var x={eventTime:v,lane:_,tag:y.tag,payload:y.payload,callback:y.callback,next:null};null===b?(g=b=x,m=p):b=b.next=x,h=ya(h,_)}if(null===(y=y.next)){if(null===(s=o.shared.pending))break;var T=s,E=T.next;T.next=null,y=E,o.lastBaseUpdate=T,o.shared.pending=null}}null===b&&(m=p),o.baseState=m,o.firstBaseUpdate=g,o.lastBaseUpdate=b;var k=o.shared.interleaved;if(null!==k){var P=k;do{h=ya(h,P.lane),P=P.next}while(P!==k)}else null===a&&(o.shared.lanes=0);n_(h),e.lanes=h,e.memoizedState=p}mf=null}function Pf(e,t){if("function"!=typeof e)throw new Error("Invalid argument passed as callback. Expected a function. Instead received: "+e);e.call(t)}function Of(){yf=!1}function Af(){return yf}function $f(e,t,n){var r=t.effects;if(t.effects=null,null!==r)for(var o=0;o<r.length;o++){var a=r[o],i=a.callback;null!==i&&(a.callback=null,Pf(i,n))}}hf=!1,mf=null;var Rf={},If=sc(Rf),Cf=sc(Rf),Df=sc(Rf);function Nf(e){if(e===Rf)throw new Error("Expected host context to exist. This error is likely caused by a bug in React. Please file an issue.");return e}function Mf(){return Nf(Df.current)}function Lf(e,t){uc(Df,t,e),uc(Cf,e,e),uc(If,Rf,e);var n=function(e){var t,n,r=e.nodeType;switch(r){case 9:case 11:t=9===r?"#document":"#fragment";var o=e.documentElement;n=o?o.namespaceURI:Dt(null,"");break;default:var a=8===r?e.parentNode:e;n=Dt(a.namespaceURI||null,t=a.tagName)}var i=t.toLowerCase();return{namespace:n,ancestorInfo:tu(null,i)}}(t);lc(If,e),uc(If,n,e)}function jf(e){lc(If,e),lc(Cf,e),lc(Df,e)}function Ff(){return Nf(If.current)}function Bf(e){Nf(Df.current);var t,n,r,o=Nf(If.current),a=(t=o,n=e.type,{namespace:Dt((r=t).namespace,n),ancestorInfo:tu(r.ancestorInfo,n)});o!==a&&(uc(Cf,e,e),uc(If,a,e))}function Uf(e){Cf.current===e&&(lc(If,e),lc(Cf,e))}var zf=sc(0);function Vf(e,t){return 0!==(e&t)}function Hf(e){return 1&e}function qf(e,t){return 1&e|t}function Gf(e,t){uc(zf,t,e)}function Wf(e){lc(zf,e)}function Yf(e,t){var n=e.memoizedState;return null!==n?null!==n.dehydrated:(e.memoizedProps,!0)}function Kf(e){for(var t=e;null!==t;){if(t.tag===c){var n=t.memoizedState;if(null!==n){var r=n.dehydrated;if(null===r||Ru(r)||Iu(r))return t}}else if(t.tag===m&&void 0!==t.memoizedProps.revealOrder){if(0!==(t.flags&nr))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)return null;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Xf=[];function Qf(){for(var e=0;e<Xf.length;e++){Xf[e]._workInProgressVersionPrimary=null}Xf.length=0}function Zf(e,t){var n=(0,t._getVersion)(t._source);null==e.mutableSourceEagerHydrationData?e.mutableSourceEagerHydrationData=[t,n]:e.mutableSourceEagerHydrationData.push(t,n)}var Jf,ep,tp=n.ReactCurrentDispatcher,np=n.ReactCurrentBatchConfig;Jf=new Set;var rp=0,op=null,ap=null,ip=null,sp=!1,lp=!1,up=0,cp=0,dp=null,fp=null,pp=-1,hp=!1;function mp(){var e=dp;null===fp?fp=[e]:fp.push(e)}function gp(){var e=dp;null!==fp&&(pp++,fp[pp]!==e&&function(e){var t=je(op);if(!Jf.has(t)&&(Jf.add(t),null!==fp)){for(var n="",r=30,o=0;o<=pp;o++){for(var i=fp[o],s=o===pp?e:i,l=o+1+". "+i;l.length<r;)l+=" ";n+=l+=s+"\n"}a("React has detected a change in the order of Hooks called by %s. This will lead to bugs and errors if not fixed. For more information, read the Rules of Hooks: https://reactjs.org/link/rules-of-hooks\n\n Previous render Next render\n ------------------------------------------------------\n%s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",t,n)}}(e))}function bp(e){null==e||vt(e)||a("%s received a final argument that is not an array (instead, received `%s`). When specified, the final argument must be an array.",dp,typeof e)}function yp(){throw new Error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.")}function _p(e,t){if(hp)return!1;if(null===t)return a("%s received a final argument during this render, but not during the previous render. Even though the final argument is optional, its type cannot change between renders.",dp),!1;e.length!==t.length&&a("The final argument passed to %s changed size between renders. The order and size of this array must remain constant.\n\nPrevious: %s\nIncoming: %s",dp,"["+t.join(", ")+"]","["+e.join(", ")+"]");for(var n=0;n<t.length&&n<e.length;n++)if(!Os(e[n],t[n]))return!1;return!0}function vp(e,t,n,r,o,i){rp=i,op=t,fp=null!==e?e._debugHookTypes:null,pp=-1,hp=null!==e&&e.type!==t.type,t.memoizedState=null,t.updateQueue=null,t.lanes=0,null!==e&&null!==e.memoizedState?tp.current=kh:tp.current=null!==fp?Eh:Th;var s=n(r,o);if(lp){var l=0;do{if(lp=!1,up=0,l>=25)throw new Error("Too many re-renders. React limits the number of renders to prevent an infinite loop.");l+=1,hp=!1,ap=null,ip=null,t.updateQueue=null,pp=-1,tp.current=Ph,s=n(r,o)}while(lp)}tp.current=xh,t._debugHookTypes=fp;var u=null!==ap&&null!==ap.next;if(rp=0,op=null,ap=null,ip=null,dp=null,fp=null,pp=-1,null!==e&&(e.flags&Sr)!==(t.flags&Sr)&&1&e.mode&&a("Internal React error: Expected static flag was missing. Please notify the React team."),sp=!1,u)throw new Error("Rendered fewer hooks than expected. This may be caused by an accidental early return statement.");return s}function wp(){var e=0!==up;return up=0,e}function Sp(e,t,n){t.updateQueue=e.updateQueue,0!==(t.mode&bo)?t.flags&=-50333701:t.flags&=-2053,e.lanes=_a(e.lanes,n)}function xp(){if(tp.current=xh,sp){for(var e=op.memoizedState;null!==e;){var t=e.queue;null!==t&&(t.pending=null),e=e.next}sp=!1}rp=0,op=null,ap=null,ip=null,fp=null,pp=-1,dp=null,hh=!1,lp=!1,up=0}function Tp(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===ip?op.memoizedState=ip=e:ip=ip.next=e,ip}function Ep(){var e,t;if(null===ap){var n=op.alternate;e=null!==n?n.memoizedState:null}else e=ap.next;if(null!==(t=null===ip?op.memoizedState:ip.next))t=(ip=t).next,ap=e;else{if(null===e)throw new Error("Rendered more hooks than during the previous render.");var r={memoizedState:(ap=e).memoizedState,baseState:ap.baseState,baseQueue:ap.baseQueue,queue:ap.queue,next:null};null===ip?op.memoizedState=ip=r:ip=ip.next=r}return ip}function kp(e,t){return"function"==typeof t?t(e):t}function Pp(e,t,n){var r,o=Tp();r=void 0!==n?n(t):t,o.memoizedState=o.baseState=r;var a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r};o.queue=a;var i=a.dispatch=bh.bind(null,op,a);return[o.memoizedState,i]}function Op(e,t,n){var r=Ep(),o=r.queue;if(null===o)throw new Error("Should have a queue. This is likely a bug in React. Please file an issue.");o.lastRenderedReducer=e;var i=ap,s=i.baseQueue,l=o.pending;if(null!==l){if(null!==s){var u=s.next,c=l.next;s.next=c,l.next=u}i.baseQueue!==s&&a("Internal error: Expected work-in-progress queue to be a clone. This is a bug in React."),i.baseQueue=s=l,o.pending=null}if(null!==s){var d=s.next,f=i.baseState,p=null,h=null,m=null,g=d;do{var b=g.lane;if(ba(rp,b)){if(null!==m){var y={lane:0,action:g.action,hasEagerState:g.hasEagerState,eagerState:g.eagerState,next:null};m=m.next=y}if(g.hasEagerState)f=g.eagerState;else f=e(f,g.action)}else{var _={lane:b,action:g.action,hasEagerState:g.hasEagerState,eagerState:g.eagerState,next:null};null===m?(h=m=_,p=f):m=m.next=_,op.lanes=ya(op.lanes,b),n_(b)}g=g.next}while(null!==g&&g!==d);null===m?p=f:m.next=h,Os(f,r.memoizedState)||mg(),r.memoizedState=f,r.baseState=p,r.baseQueue=m,o.lastRenderedState=f}var v=o.interleaved;if(null!==v){var w=v;do{var S=w.lane;op.lanes=ya(op.lanes,S),n_(S),w=w.next}while(w!==v)}else null===s&&(o.lanes=0);var x=o.dispatch;return[r.memoizedState,x]}function Ap(e,t,n){var r=Ep(),o=r.queue;if(null===o)throw new Error("Should have a queue. This is likely a bug in React. Please file an issue.");o.lastRenderedReducer=e;var a=o.dispatch,i=o.pending,s=r.memoizedState;if(null!==i){o.pending=null;var l=i.next,u=l;do{s=e(s,u.action),u=u.next}while(u!==l);Os(s,r.memoizedState)||mg(),r.memoizedState=s,null===r.baseQueue&&(r.baseState=s),o.lastRenderedState=s}return[s,a]}function $p(e,t,n){var r,o=op,i=Tp();if(yd()){if(void 0===n)throw new Error("Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering.");r=n(),ep||r!==n()&&(a("The result of getServerSnapshot should be cached to avoid an infinite loop"),ep=!0)}else{if(r=t(),!ep){var s=t();Os(r,s)||(a("The result of getSnapshot should be cached to avoid an infinite loop"),ep=!0)}var l=My();if(null===l)throw new Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");ua(0,rp)||Ip(o,t,r)}i.memoizedState=r;var u={value:r,getSnapshot:t};return i.queue=u,qp(Dp.bind(null,o,u,e),[e]),o.flags|=ir,Bp(9,Cp.bind(null,o,u,r,t),void 0,null),r}function Rp(e,t,n){var r=op,o=Ep(),i=t();if(!ep){var s=t();Os(i,s)||(a("The result of getSnapshot should be cached to avoid an infinite loop"),ep=!0)}var l=o.memoizedState,u=!Os(l,i);u&&(o.memoizedState=i,mg());var c=o.queue;if(Gp(Dp.bind(null,r,c,e),[e]),c.getSnapshot!==t||u||null!==ip&&1&ip.memoizedState.tag){r.flags|=ir,Bp(9,Cp.bind(null,r,c,i,t),void 0,null);var d=My();if(null===d)throw new Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");ua(0,rp)||Ip(r,t,i)}return i}function Ip(e,t,n){e.flags|=ur;var r={getSnapshot:t,value:n},o=op.updateQueue;if(null===o)o={lastEffect:null,stores:null},op.updateQueue=o,o.stores=[r];else{var a=o.stores;null===a?o.stores=[r]:a.push(r)}}function Cp(e,t,n,r){t.value=n,t.getSnapshot=r,Np(t)&&Mp(e)}function Dp(e,t,n){return n(function(){Np(t)&&Mp(e)})}function Np(e){var t=e.getSnapshot,n=e.value;try{var r=t();return!Os(n,r)}catch(o){return!0}}function Mp(e){var t=df(e,So);null!==t&&By(t,e,So,ea)}function Lp(e){var t=Tp();"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e;var n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:kp,lastRenderedState:e};t.queue=n;var r=n.dispatch=yh.bind(null,op,n);return[t.memoizedState,r]}function jp(e){return Op(kp)}function Fp(e){return Ap(kp)}function Bp(e,t,n,r){var o={tag:e,create:t,destroy:n,deps:r,next:null},a=op.updateQueue;if(null===a)a={lastEffect:null,stores:null},op.updateQueue=a,a.lastEffect=o.next=o;else{var i=a.lastEffect;if(null===i)a.lastEffect=o.next=o;else{var s=i.next;i.next=o,o.next=s,a.lastEffect=o}}return o}function Up(e){var t={current:e};return Tp().memoizedState=t,t}function zp(e){return Ep().memoizedState}function Vp(e,t,n,r){var o=Tp(),a=void 0===r?null:r;op.flags|=e,o.memoizedState=Bp(1|t,n,void 0,a)}function Hp(e,t,n,r){var o=Ep(),a=void 0===r?null:r,i=void 0;if(null!==ap){var s=ap.memoizedState;if(i=s.destroy,null!==a)if(_p(a,s.deps))return void(o.memoizedState=Bp(t,n,i,a))}op.flags|=e,o.memoizedState=Bp(1|t,n,i,a)}function qp(e,t){return 0!==(op.mode&bo)?Vp(41945088,8,e,t):Vp(8390656,8,e,t)}function Gp(e,t){return Hp(ir,8,e,t)}function Wp(e,t){return Vp(4,2,e,t)}function Yp(e,t){return Hp(4,2,e,t)}function Kp(e,t){var n=4;return n|=mr,0!==(op.mode&bo)&&(n|=gr),Vp(n,4,e,t)}function Xp(e,t){return Hp(4,4,e,t)}function Qp(e,t){if("function"==typeof t){var n=t,r=e();return n(r),function(){n(null)}}if(null!=t){var o=t;o.hasOwnProperty("current")||a("Expected useImperativeHandle() first argument to either be a ref callback or React.createRef() object. Instead received: %s.","an object with keys {"+Object.keys(o).join(", ")+"}");var i=e();return o.current=i,function(){o.current=null}}}function Zp(e,t,n){"function"!=typeof t&&a("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.",null!==t?typeof t:"null");var r=null!=n?n.concat([e]):null,o=4;return o|=mr,0!==(op.mode&bo)&&(o|=gr),Vp(o,4,Qp.bind(null,t,e),r)}function Jp(e,t,n){"function"!=typeof t&&a("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.",null!==t?typeof t:"null");var r=null!=n?n.concat([e]):null;return Hp(4,4,Qp.bind(null,t,e),r)}function eh(e,t){}var th=eh;function nh(e,t){var n=void 0===t?null:t;return Tp().memoizedState=[e,n],e}function rh(e,t){var n=Ep(),r=void 0===t?null:t,o=n.memoizedState;if(null!==o&&(null!==r&&_p(r,o[1])))return o[0];return n.memoizedState=[e,r],e}function oh(e,t){var n=Tp(),r=void 0===t?null:t,o=e();return n.memoizedState=[o,r],o}function ah(e,t){var n=Ep(),r=void 0===t?null:t,o=n.memoizedState;if(null!==o&&(null!==r&&_p(r,o[1])))return o[0];var a=e();return n.memoizedState=[a,r],a}function ih(e){return Tp().memoizedState=e,e}function sh(e){return uh(Ep(),ap.memoizedState,e)}function lh(e){var t=Ep();return null===ap?(t.memoizedState=e,e):uh(t,ap.memoizedState,e)}function uh(e,t,n){if(!(0===(rp&(So|To|ko)))){if(!Os(n,t)){var r=da();op.lanes=ya(op.lanes,r),n_(r),e.baseState=!0}return t}return e.baseState&&(e.baseState=!1,mg()),e.memoizedState=n,n}function ch(e,t,n){var r,a,i=La();ja((a=Ca,0!==(r=i)&&r<a?r:a)),e(!0);var s=np.transition;np.transition={};var l=np.transition;np.transition._updatedFibers=new Set;try{e(!1),t()}finally{if(ja(i),np.transition=s,null===s&&l._updatedFibers)l._updatedFibers.size>10&&o("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."),l._updatedFibers.clear()}}function dh(){var e=Lp(!1),t=e[0],n=e[1],r=ch.bind(null,n);return Tp().memoizedState=r,[t,r]}function fh(){return[jp()[0],Ep().memoizedState]}function ph(){return[Fp()[0],Ep().memoizedState]}var hh=!1;function mh(){var e,t=Tp(),n=My().identifierPrefix;if(yd()){e=":"+n+"R"+Uc();var r=up++;r>0&&(e+="H"+r.toString(32)),e+=":"}else{e=":"+n+"r"+(cp++).toString(32)+":"}return t.memoizedState=e,e}function gh(){return Ep().memoizedState}function bh(e,t,n){"function"==typeof arguments[3]&&a("State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect().");var r=jy(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(_h(e))vh(t,o);else{var i=cf(e,t,o,r);if(null!==i)By(i,e,r,Ly()),wh(i,t,r)}Sh(e,r)}function yh(e,t,n){"function"==typeof arguments[3]&&a("State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect().");var r=jy(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(_h(e))vh(t,o);else{var i=e.alternate;if(0===e.lanes&&(null===i||0===i.lanes)){var s=t.lastRenderedReducer;if(null!==s){var l;l=tp.current,tp.current=Ah;try{var u=t.lastRenderedState,c=s(u,n);if(o.hasEagerState=!0,o.eagerState=c,Os(c,u))return void function(e,t,n){var r=t.interleaved;null===r?(n.next=n,uf(t)):(n.next=r.next,r.next=n),t.interleaved=n}(0,t,o)}catch(f){}finally{tp.current=l}}}var d=cf(e,t,o,r);if(null!==d)By(d,e,r,Ly()),wh(d,t,r)}Sh(e,r)}function _h(e){var t=e.alternate;return e===op||null!==t&&t===op}function vh(e,t){lp=sp=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function wh(e,t,n){if(ca(n)){var r=t.lanes,o=ya(r=va(r,e.pendingLanes),n);t.lanes=o,Ta(e,o)}}function Sh(e,t,n){go(e,t)}var xh={readContext:sf,useCallback:yp,useContext:yp,useEffect:yp,useImperativeHandle:yp,useInsertionEffect:yp,useLayoutEffect:yp,useMemo:yp,useReducer:yp,useRef:yp,useState:yp,useDebugValue:yp,useDeferredValue:yp,useTransition:yp,useMutableSource:yp,useSyncExternalStore:yp,useId:yp,unstable_isNewReconciler:_},Th=null,Eh=null,kh=null,Ph=null,Oh=null,Ah=null,$h=null,Rh=function(){a("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().")},Ih=function(){a("Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. You can only call Hooks at the top level of your React function. For more information, see https://reactjs.org/link/rules-of-hooks")};Th={readContext:function(e){return sf(e)},useCallback:function(e,t){return dp="useCallback",mp(),bp(t),nh(e,t)},useContext:function(e){return dp="useContext",mp(),sf(e)},useEffect:function(e,t){return dp="useEffect",mp(),bp(t),qp(e,t)},useImperativeHandle:function(e,t,n){return dp="useImperativeHandle",mp(),bp(n),Zp(e,t,n)},useInsertionEffect:function(e,t){return dp="useInsertionEffect",mp(),bp(t),Wp(e,t)},useLayoutEffect:function(e,t){return dp="useLayoutEffect",mp(),bp(t),Kp(e,t)},useMemo:function(e,t){dp="useMemo",mp(),bp(t);var n=tp.current;tp.current=Oh;try{return oh(e,t)}finally{tp.current=n}},useReducer:function(e,t,n){dp="useReducer",mp();var r=tp.current;tp.current=Oh;try{return Pp(e,t,n)}finally{tp.current=r}},useRef:function(e){return dp="useRef",mp(),Up(e)},useState:function(e){dp="useState",mp();var t=tp.current;tp.current=Oh;try{return Lp(e)}finally{tp.current=t}},useDebugValue:function(e,t){dp="useDebugValue",mp()},useDeferredValue:function(e){return dp="useDeferredValue",mp(),ih(e)},useTransition:function(){return dp="useTransition",mp(),dh()},useMutableSource:function(e,t,n){dp="useMutableSource",mp()},useSyncExternalStore:function(e,t,n){return dp="useSyncExternalStore",mp(),$p(e,t,n)},useId:function(){return dp="useId",mp(),mh()},unstable_isNewReconciler:_},Eh={readContext:function(e){return sf(e)},useCallback:function(e,t){return dp="useCallback",gp(),nh(e,t)},useContext:function(e){return dp="useContext",gp(),sf(e)},useEffect:function(e,t){return dp="useEffect",gp(),qp(e,t)},useImperativeHandle:function(e,t,n){return dp="useImperativeHandle",gp(),Zp(e,t,n)},useInsertionEffect:function(e,t){return dp="useInsertionEffect",gp(),Wp(e,t)},useLayoutEffect:function(e,t){return dp="useLayoutEffect",gp(),Kp(e,t)},useMemo:function(e,t){dp="useMemo",gp();var n=tp.current;tp.current=Oh;try{return oh(e,t)}finally{tp.current=n}},useReducer:function(e,t,n){dp="useReducer",gp();var r=tp.current;tp.current=Oh;try{return Pp(e,t,n)}finally{tp.current=r}},useRef:function(e){return dp="useRef",gp(),Up(e)},useState:function(e){dp="useState",gp();var t=tp.current;tp.current=Oh;try{return Lp(e)}finally{tp.current=t}},useDebugValue:function(e,t){dp="useDebugValue",gp()},useDeferredValue:function(e){return dp="useDeferredValue",gp(),ih(e)},useTransition:function(){return dp="useTransition",gp(),dh()},useMutableSource:function(e,t,n){dp="useMutableSource",gp()},useSyncExternalStore:function(e,t,n){return dp="useSyncExternalStore",gp(),$p(e,t,n)},useId:function(){return dp="useId",gp(),mh()},unstable_isNewReconciler:_},kh={readContext:function(e){return sf(e)},useCallback:function(e,t){return dp="useCallback",gp(),rh(e,t)},useContext:function(e){return dp="useContext",gp(),sf(e)},useEffect:function(e,t){return dp="useEffect",gp(),Gp(e,t)},useImperativeHandle:function(e,t,n){return dp="useImperativeHandle",gp(),Jp(e,t,n)},useInsertionEffect:function(e,t){return dp="useInsertionEffect",gp(),Yp(e,t)},useLayoutEffect:function(e,t){return dp="useLayoutEffect",gp(),Xp(e,t)},useMemo:function(e,t){dp="useMemo",gp();var n=tp.current;tp.current=Ah;try{return ah(e,t)}finally{tp.current=n}},useReducer:function(e,t,n){dp="useReducer",gp();var r=tp.current;tp.current=Ah;try{return Op(e)}finally{tp.current=r}},useRef:function(e){return dp="useRef",gp(),zp()},useState:function(e){dp="useState",gp();var t=tp.current;tp.current=Ah;try{return jp()}finally{tp.current=t}},useDebugValue:function(e,t){return dp="useDebugValue",gp(),th()},useDeferredValue:function(e){return dp="useDeferredValue",gp(),sh(e)},useTransition:function(){return dp="useTransition",gp(),fh()},useMutableSource:function(e,t,n){dp="useMutableSource",gp()},useSyncExternalStore:function(e,t,n){return dp="useSyncExternalStore",gp(),Rp(e,t)},useId:function(){return dp="useId",gp(),gh()},unstable_isNewReconciler:_},Ph={readContext:function(e){return sf(e)},useCallback:function(e,t){return dp="useCallback",gp(),rh(e,t)},useContext:function(e){return dp="useContext",gp(),sf(e)},useEffect:function(e,t){return dp="useEffect",gp(),Gp(e,t)},useImperativeHandle:function(e,t,n){return dp="useImperativeHandle",gp(),Jp(e,t,n)},useInsertionEffect:function(e,t){return dp="useInsertionEffect",gp(),Yp(e,t)},useLayoutEffect:function(e,t){return dp="useLayoutEffect",gp(),Xp(e,t)},useMemo:function(e,t){dp="useMemo",gp();var n=tp.current;tp.current=$h;try{return ah(e,t)}finally{tp.current=n}},useReducer:function(e,t,n){dp="useReducer",gp();var r=tp.current;tp.current=$h;try{return Ap(e)}finally{tp.current=r}},useRef:function(e){return dp="useRef",gp(),zp()},useState:function(e){dp="useState",gp();var t=tp.current;tp.current=$h;try{return Fp()}finally{tp.current=t}},useDebugValue:function(e,t){return dp="useDebugValue",gp(),th()},useDeferredValue:function(e){return dp="useDeferredValue",gp(),lh(e)},useTransition:function(){return dp="useTransition",gp(),ph()},useMutableSource:function(e,t,n){dp="useMutableSource",gp()},useSyncExternalStore:function(e,t,n){return dp="useSyncExternalStore",gp(),Rp(e,t)},useId:function(){return dp="useId",gp(),gh()},unstable_isNewReconciler:_},Oh={readContext:function(e){return Rh(),sf(e)},useCallback:function(e,t){return dp="useCallback",Ih(),mp(),nh(e,t)},useContext:function(e){return dp="useContext",Ih(),mp(),sf(e)},useEffect:function(e,t){return dp="useEffect",Ih(),mp(),qp(e,t)},useImperativeHandle:function(e,t,n){return dp="useImperativeHandle",Ih(),mp(),Zp(e,t,n)},useInsertionEffect:function(e,t){return dp="useInsertionEffect",Ih(),mp(),Wp(e,t)},useLayoutEffect:function(e,t){return dp="useLayoutEffect",Ih(),mp(),Kp(e,t)},useMemo:function(e,t){dp="useMemo",Ih(),mp();var n=tp.current;tp.current=Oh;try{return oh(e,t)}finally{tp.current=n}},useReducer:function(e,t,n){dp="useReducer",Ih(),mp();var r=tp.current;tp.current=Oh;try{return Pp(e,t,n)}finally{tp.current=r}},useRef:function(e){return dp="useRef",Ih(),mp(),Up(e)},useState:function(e){dp="useState",Ih(),mp();var t=tp.current;tp.current=Oh;try{return Lp(e)}finally{tp.current=t}},useDebugValue:function(e,t){dp="useDebugValue",Ih(),mp()},useDeferredValue:function(e){return dp="useDeferredValue",Ih(),mp(),ih(e)},useTransition:function(){return dp="useTransition",Ih(),mp(),dh()},useMutableSource:function(e,t,n){dp="useMutableSource",Ih(),mp()},useSyncExternalStore:function(e,t,n){return dp="useSyncExternalStore",Ih(),mp(),$p(e,t,n)},useId:function(){return dp="useId",Ih(),mp(),mh()},unstable_isNewReconciler:_},Ah={readContext:function(e){return Rh(),sf(e)},useCallback:function(e,t){return dp="useCallback",Ih(),gp(),rh(e,t)},useContext:function(e){return dp="useContext",Ih(),gp(),sf(e)},useEffect:function(e,t){return dp="useEffect",Ih(),gp(),Gp(e,t)},useImperativeHandle:function(e,t,n){return dp="useImperativeHandle",Ih(),gp(),Jp(e,t,n)},useInsertionEffect:function(e,t){return dp="useInsertionEffect",Ih(),gp(),Yp(e,t)},useLayoutEffect:function(e,t){return dp="useLayoutEffect",Ih(),gp(),Xp(e,t)},useMemo:function(e,t){dp="useMemo",Ih(),gp();var n=tp.current;tp.current=Ah;try{return ah(e,t)}finally{tp.current=n}},useReducer:function(e,t,n){dp="useReducer",Ih(),gp();var r=tp.current;tp.current=Ah;try{return Op(e)}finally{tp.current=r}},useRef:function(e){return dp="useRef",Ih(),gp(),zp()},useState:function(e){dp="useState",Ih(),gp();var t=tp.current;tp.current=Ah;try{return jp()}finally{tp.current=t}},useDebugValue:function(e,t){return dp="useDebugValue",Ih(),gp(),th()},useDeferredValue:function(e){return dp="useDeferredValue",Ih(),gp(),sh(e)},useTransition:function(){return dp="useTransition",Ih(),gp(),fh()},useMutableSource:function(e,t,n){dp="useMutableSource",Ih(),gp()},useSyncExternalStore:function(e,t,n){return dp="useSyncExternalStore",Ih(),gp(),Rp(e,t)},useId:function(){return dp="useId",Ih(),gp(),gh()},unstable_isNewReconciler:_},$h={readContext:function(e){return Rh(),sf(e)},useCallback:function(e,t){return dp="useCallback",Ih(),gp(),rh(e,t)},useContext:function(e){return dp="useContext",Ih(),gp(),sf(e)},useEffect:function(e,t){return dp="useEffect",Ih(),gp(),Gp(e,t)},useImperativeHandle:function(e,t,n){return dp="useImperativeHandle",Ih(),gp(),Jp(e,t,n)},useInsertionEffect:function(e,t){return dp="useInsertionEffect",Ih(),gp(),Yp(e,t)},useLayoutEffect:function(e,t){return dp="useLayoutEffect",Ih(),gp(),Xp(e,t)},useMemo:function(e,t){dp="useMemo",Ih(),gp();var n=tp.current;tp.current=Ah;try{return ah(e,t)}finally{tp.current=n}},useReducer:function(e,t,n){dp="useReducer",Ih(),gp();var r=tp.current;tp.current=Ah;try{return Ap(e)}finally{tp.current=r}},useRef:function(e){return dp="useRef",Ih(),gp(),zp()},useState:function(e){dp="useState",Ih(),gp();var t=tp.current;tp.current=Ah;try{return Fp()}finally{tp.current=t}},useDebugValue:function(e,t){return dp="useDebugValue",Ih(),gp(),th()},useDeferredValue:function(e){return dp="useDeferredValue",Ih(),gp(),lh(e)},useTransition:function(){return dp="useTransition",Ih(),gp(),ph()},useMutableSource:function(e,t,n){dp="useMutableSource",Ih(),gp()},useSyncExternalStore:function(e,t,n){return dp="useSyncExternalStore",Ih(),gp(),Rp(e,t)},useId:function(){return dp="useId",Ih(),gp(),gh()},unstable_isNewReconciler:_};var Ch=t.unstable_now,Dh=0,Nh=-1,Mh=-1,Lh=-1,jh=!1,Fh=!1;function Bh(){return jh}function Uh(){return Dh}function zh(){Dh=Ch()}function Vh(e){Mh=Ch(),e.actualStartTime<0&&(e.actualStartTime=Ch())}function Hh(e){Mh=-1}function qh(e,t){if(Mh>=0){var n=Ch()-Mh;e.actualDuration+=n,t&&(e.selfBaseDuration=n),Mh=-1}}function Gh(e){if(Nh>=0){var t=Ch()-Nh;Nh=-1;for(var n=e.return;null!==n;){switch(n.tag){case 3:return void(n.stateNode.effectDuration+=t);case u:return void(n.stateNode.effectDuration+=t)}n=n.return}}}function Wh(e){if(Lh>=0){var t=Ch()-Lh;Lh=-1;for(var n=e.return;null!==n;){switch(n.tag){case 3:var r=n.stateNode;return void(null!==r&&(r.passiveEffectDuration+=t));case u:var o=n.stateNode;return void(null!==o&&(o.passiveEffectDuration+=t))}n=n.return}}}function Yh(){Nh=Ch()}function Kh(){Lh=Ch()}function Xh(e){for(var t=e.child;t;)e.actualDuration+=t.actualDuration,t=t.sibling}function Qh(e,t){if(e&&e.defaultProps){var n=we({},t),r=e.defaultProps;for(var o in r)void 0===n[o]&&(n[o]=r[o]);return n}return t}var Zh,Jh,em,tm,nm,rm,om,am,im,sm,lm,um={};Zh=new Set,Jh=new Set,em=new Set,tm=new Set,am=new Set,nm=new Set,im=new Set,sm=new Set,lm=new Set;var cm=new Set;function dm(e,t,n,r){var o=e.memoizedState,a=n(r,o);if(8&e.mode){Qr(!0);try{a=n(r,o)}finally{Qr(!1)}}rm(t,a);var i=null==a?o:we({},o,a);(e.memoizedState=i,0===e.lanes)&&(e.updateQueue.baseState=i)}om=function(e,t){if(null!==e&&"function"!=typeof e){var n=t+"_"+e;cm.has(n)||(cm.add(n),a("%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.",t,e))}},rm=function(e,t){if(void 0===t){var n=Me(e)||"Component";nm.has(n)||(nm.add(n),a("%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.",n))}},Object.defineProperty(um,"_processChildContext",{enumerable:!1,value:function(){throw new Error("_processChildContext is not available in React 16+. This likely means you have multiple copies of React and are attempting to nest a React 15 tree inside a React 16 tree using unstable_renderSubtreeIntoContainer, which isn't supported. Try to make sure you have only one copy of React (and ideally, switch to ReactDOM.createPortal).")}}),Object.freeze(um);var fm={isMounted:function(e){var t=xr.current;if(null!==t&&1===t.tag){var n=t,r=n.stateNode;r._warnedAboutRefsInRender||a("%s is accessing isMounted inside its render() function. render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.",je(n)||"A component"),r._warnedAboutRefsInRender=!0}var o=er(e);return!!o&&Tr(o)===o},enqueueSetState:function(e,t,n){var r=er(e),o=Ly(),a=jy(r),i=wf(o,a);i.payload=t,null!=n&&(om(n,"setState"),i.callback=n);var s=Sf(r,i,a);null!==s&&(By(s,r,a,o),xf(s,r,a)),go(r,a)},enqueueReplaceState:function(e,t,n){var r=er(e),o=Ly(),a=jy(r),i=wf(o,a);i.tag=1,i.payload=t,null!=n&&(om(n,"replaceState"),i.callback=n);var s=Sf(r,i,a);null!==s&&(By(s,r,a,o),xf(s,r,a)),go(r,a)},enqueueForceUpdate:function(e,t){var n=er(e),r=Ly(),o=jy(n),a=wf(r,o);a.tag=bf,null!=t&&(om(t,"forceUpdate"),a.callback=t);var i=Sf(n,a,o);null!==i&&(By(i,n,o,r),xf(i,n,o)),function(e,t){null!==Yr&&"function"==typeof Yr.markForceUpdateScheduled&&Yr.markForceUpdateScheduled(e,t)}(n,o)}};function pm(e,t,n,r,o,i,s){var l=e.stateNode;if("function"==typeof l.shouldComponentUpdate){var u=l.shouldComponentUpdate(r,i,s);if(8&e.mode){Qr(!0);try{u=l.shouldComponentUpdate(r,i,s)}finally{Qr(!1)}}return void 0===u&&a("%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.",Me(t)||"Component"),u}return!t.prototype||!t.prototype.isPureReactComponent||(!As(n,r)||!As(o,i))}function hm(e,t){var n;t.updater=fm,e.stateNode=t,n=e,t._reactInternals=n,t._reactInternalInstance=um}function mm(e,t,n){var r=!1,o=cc,i=cc,s=t.contextType;if("contextType"in t&&(!(null===s||void 0!==s&&s.$$typeof===ae&&void 0===s._context)&&!sm.has(t))){sm.add(t);var l="";l=void 0===s?" However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file.":"object"!=typeof s?" However, it is set to a "+typeof s+".":s.$$typeof===oe?" Did you accidentally pass the Context.Provider instead?":void 0!==s._context?" Did you accidentally pass the Context.Consumer instead?":" However, it is set to an object with keys {"+Object.keys(s).join(", ")+"}.",a("%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s",Me(t)||"Component",l)}if("object"==typeof s&&null!==s)i=sf(s);else{o=hc(0,t,!0);var u=t.contextTypes;i=(r=null!=u)?gc(e,o):cc}var c=new t(n,i);if(8&e.mode){Qr(!0);try{c=new t(n,i)}finally{Qr(!1)}}var d=e.memoizedState=null!==c.state&&void 0!==c.state?c.state:null;if(hm(e,c),"function"==typeof t.getDerivedStateFromProps&&null===d){var f=Me(t)||"Component";Jh.has(f)||(Jh.add(f),a("`%s` uses `getDerivedStateFromProps` but its initial state is %s. This is not recommended. Instead, define the initial state by assigning an object to `this.state` in the constructor of `%s`. This ensures that `getDerivedStateFromProps` arguments have a consistent shape.",f,null===c.state?"null":"undefined",f))}if("function"==typeof t.getDerivedStateFromProps||"function"==typeof c.getSnapshotBeforeUpdate){var p=null,h=null,m=null;if("function"==typeof c.componentWillMount&&!0!==c.componentWillMount.__suppressDeprecationWarning?p="componentWillMount":"function"==typeof c.UNSAFE_componentWillMount&&(p="UNSAFE_componentWillMount"),"function"==typeof c.componentWillReceiveProps&&!0!==c.componentWillReceiveProps.__suppressDeprecationWarning?h="componentWillReceiveProps":"function"==typeof c.UNSAFE_componentWillReceiveProps&&(h="UNSAFE_componentWillReceiveProps"),"function"==typeof c.componentWillUpdate&&!0!==c.componentWillUpdate.__suppressDeprecationWarning?m="componentWillUpdate":"function"==typeof c.UNSAFE_componentWillUpdate&&(m="UNSAFE_componentWillUpdate"),null!==p||null!==h||null!==m){var g=Me(t)||"Component",b="function"==typeof t.getDerivedStateFromProps?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";tm.has(g)||(tm.add(g),a("Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n%s uses %s but also contains the following legacy lifecycles:%s%s%s\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://reactjs.org/link/unsafe-component-lifecycles",g,b,null!==p?"\n "+p:"",null!==h?"\n "+h:"",null!==m?"\n "+m:""))}}return r&&mc(e,o,i),c}function gm(e,t,n,r){var o=t.state;if("function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==o){var i=je(e)||"Component";Zh.has(i)||(Zh.add(i),a("%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.",i)),fm.enqueueReplaceState(t,t.state,null)}}function bm(e,t,n,r){!function(e,t,n){var r=e.stateNode,o=Me(t)||"Component";r.render||(t.prototype&&"function"==typeof t.prototype.render?a("%s(...): No `render` method found on the returned component instance: did you accidentally return an object from the constructor?",o):a("%s(...): No `render` method found on the returned component instance: you may have forgotten to define `render`.",o)),!r.getInitialState||r.getInitialState.isReactClassApproved||r.state||a("getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?",o),r.getDefaultProps&&!r.getDefaultProps.isReactClassApproved&&a("getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.",o),r.propTypes&&a("propTypes was defined as an instance property on %s. Use a static property to define propTypes instead.",o),r.contextType&&a("contextType was defined as an instance property on %s. Use a static property to define contextType instead.",o),!t.childContextTypes||lm.has(t)||8&e.mode||(lm.add(t),a("%s uses the legacy childContextTypes API which is no longer supported and will be removed in the next major release. Use React.createContext() instead\n\n.Learn more about this warning here: https://reactjs.org/link/legacy-context",o)),!t.contextTypes||lm.has(t)||8&e.mode||(lm.add(t),a("%s uses the legacy contextTypes API which is no longer supported and will be removed in the next major release. Use React.createContext() with static contextType instead.\n\nLearn more about this warning here: https://reactjs.org/link/legacy-context",o)),r.contextTypes&&a("contextTypes was defined as an instance property on %s. Use a static property to define contextTypes instead.",o),t.contextType&&t.contextTypes&&!im.has(t)&&(im.add(t),a("%s declares both contextTypes and contextType static properties. The legacy contextTypes property will be ignored.",o)),"function"==typeof r.componentShouldUpdate&&a("%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.",o),t.prototype&&t.prototype.isPureReactComponent&&void 0!==r.shouldComponentUpdate&&a("%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.",Me(t)||"A pure component"),"function"==typeof r.componentDidUnmount&&a("%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?",o),"function"==typeof r.componentDidReceiveProps&&a("%s has a method called componentDidReceiveProps(). But there is no such lifecycle method. If you meant to update the state in response to changing props, use componentWillReceiveProps(). If you meant to fetch data or run side-effects or mutations after React has updated the UI, use componentDidUpdate().",o),"function"==typeof r.componentWillRecieveProps&&a("%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?",o),"function"==typeof r.UNSAFE_componentWillRecieveProps&&a("%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?",o);var i=r.props!==n;void 0!==r.props&&i&&a("%s(...): When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.",o,o),r.defaultProps&&a("Setting defaultProps as an instance property on %s is not supported and will be ignored. Instead, define defaultProps as a static property on %s.",o,o),"function"!=typeof r.getSnapshotBeforeUpdate||"function"==typeof r.componentDidUpdate||em.has(t)||(em.add(t),a("%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.",Me(t))),"function"==typeof r.getDerivedStateFromProps&&a("%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.",o),"function"==typeof r.getDerivedStateFromError&&a("%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.",o),"function"==typeof t.getSnapshotBeforeUpdate&&a("%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.",o);var s=r.state;s&&("object"!=typeof s||vt(s))&&a("%s.state: must be set to an object or null",o),"function"==typeof r.getChildContext&&"object"!=typeof t.childContextTypes&&a("%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().",o)}(e,t,n);var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs={},_f(e);var i=t.contextType;if("object"==typeof i&&null!==i)o.context=sf(i);else{var s=hc(0,t,!0);o.context=gc(e,s)}if(o.state===n){var l=Me(t)||"Component";am.has(l)||(am.add(l),a("%s: It is not recommended to assign props directly to state because updates to props won't be reflected in state. In most cases, it is better to use props directly.",l))}8&e.mode&&wd.recordLegacyContextWarning(e,o),wd.recordUnsafeLifecycleWarnings(e,o),o.state=e.memoizedState;var u=t.getDerivedStateFromProps;if("function"==typeof u&&(dm(e,t,u,n),o.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof o.getSnapshotBeforeUpdate||"function"!=typeof o.UNSAFE_componentWillMount&&"function"!=typeof o.componentWillMount||(!function(e,t){var n=t.state;"function"==typeof t.componentWillMount&&t.componentWillMount(),"function"==typeof t.UNSAFE_componentWillMount&&t.UNSAFE_componentWillMount(),n!==t.state&&(a("%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.",je(e)||"Component"),fm.enqueueReplaceState(t,t.state,null))}(e,o),kf(e,n,o,r),o.state=e.memoizedState),"function"==typeof o.componentDidMount){var c=4;c|=mr,0!==(e.mode&bo)&&(c|=gr),e.flags|=c}}function ym(e,t){return{value:e,source:t,stack:De(t),digest:null}}function _m(e,t,n){return{value:e,source:null,stack:null!=n?n:null,digest:null!=t?t:null}}function vm(e,t){try{0;var n=t.value,r=t.source,o=t.stack,a=null!==o?o:"";if(null!=n&&n._suppressLogging){if(1===e.tag)return;console.error(n)}var i=r?je(r):null,s=(i?"The above error occurred in the <"+i+"> component:":"The above error occurred in one of your React components:")+"\n"+a+"\n\n"+(3===e.tag?"Consider adding an error boundary to your tree to customize error handling behavior.\nVisit https://reactjs.org/link/error-boundaries to learn more about error boundaries.":"React will try to recreate this component tree from scratch using the error boundary you provided, "+(je(e)||"Anonymous")+".");console.error(s)}catch(rw){setTimeout(function(){throw rw})}}var wm="function"==typeof WeakMap?WeakMap:Map;function Sm(e,t,n){var r=wf(ea,n);r.tag=3,r.payload={element:null};var o=t.value;return r.callback=function(){f_(o),vm(e,t)},r}function xm(e,t,n){var r=wf(ea,n);r.tag=3;var o=e.type.getDerivedStateFromError;if("function"==typeof o){var i=t.value;r.payload=function(){return o(i)},r.callback=function(){F_(e),vm(e,t)}}var s=e.stateNode;return null!==s&&"function"==typeof s.componentDidCatch&&(r.callback=function(){var n;F_(e),vm(e,t),"function"!=typeof o&&(n=this,null===_y?_y=new Set([n]):_y.add(n));var r=t.value,i=t.stack;this.componentDidCatch(r,{componentStack:null!==i?i:""}),"function"!=typeof o&&(ga(e.lanes,So)||a("%s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.",je(e)||"Unknown"))}),r}function Tm(e,t,n){var r,o=e.pingCache;if(null===o?(o=e.pingCache=new wm,r=new Set,o.set(t,r)):void 0===(r=o.get(t))&&(r=new Set,o.set(t,r)),!r.has(n)){r.add(n);var a=m_.bind(null,e,t,n);Xr&&k_(e,n),t.then(a,a)}}function Em(e){var t=e;do{if(t.tag===c&&Yf(t))return t;t=t.return}while(null!==t);return null}function km(e,t,n,r,o){if(!(1&e.mode)){if(e===t)e.flags|=dr;else{if(e.flags|=nr,n.flags|=fr,n.flags&=-52805,1===n.tag)if(null===n.alternate)n.tag=p;else{var a=wf(ea,So);a.tag=bf,Sf(n,a,So)}n.lanes=ya(n.lanes,So)}return e}return e.flags|=dr,e.lanes=o,e}function Pm(e,t,n,r,o){if(n.flags|=cr,Xr&&k_(e,o),null!==r&&"object"==typeof r&&"function"==typeof r.then){var a=r;!function(e){var t=e.tag;if(!(1&e.mode||0!==t&&t!==l&&t!==f)){var n=e.alternate;n?(e.updateQueue=n.updateQueue,e.memoizedState=n.memoizedState,e.lanes=n.lanes):(e.updateQueue=null,e.memoizedState=null)}}(n),yd()&&1&n.mode&&Jc();var i=Em(t);if(null!==i)return i.flags&=-257,km(i,t,n,0,o),1&i.mode&&Tm(e,a,o),void function(e,t,n){var r=e.updateQueue;if(null===r){var o=new Set;o.add(n),e.updateQueue=o}else r.add(n)}(i,0,a);if(0===(o&So))return Tm(e,a,o),void r_();r=new Error("A component suspended while responding to synchronous input. This will cause the UI to be replaced with a loading indicator. To fix, updates that suspend should be wrapped with startTransition.")}else if(yd()&&1&n.mode){Jc();var s=Em(t);if(null!==s)return 0===(s.flags&dr)&&(s.flags|=rr),km(s,t,n,0,o),void _d(ym(r,n))}!function(e){ry!==Yb&&(ry=Gb);null===ly?ly=[e]:ly.push(e)}(r=ym(r,n));var u=t;do{switch(u.tag){case 3:var c=r;u.flags|=dr;var d=pa(o);return u.lanes=ya(u.lanes,d),void Tf(u,Sm(u,c,d));case 1:var p=r,h=u.type,m=u.stateNode;if(0===(u.flags&nr)&&("function"==typeof h.getDerivedStateFromError||null!==m&&"function"==typeof m.componentDidCatch&&!d_(m))){u.flags|=dr;var g=pa(o);return u.lanes=ya(u.lanes,g),void Tf(u,xm(u,p,g))}}u=u.return}while(null!==u)}var Om,Am,$m,Rm,Im,Cm,Dm,Nm,Mm,Lm=n.ReactCurrentOwner,jm=!1;function Fm(e,t,n,r){t.child=null===e?Hd(t,null,n,r):Vd(t,e.child,n,r)}function Bm(e,t,n,r,o){if(t.type!==t.elementType){var a=n.propTypes;a&&nc(a,r,"prop",Me(n))}var i,s,l=n.render,u=t.ref;if(af(t,o),to(t),Lm.current=t,Ge(!0),i=vp(e,t,l,r,u,o),s=wp(),8&t.mode){Qr(!0);try{i=vp(e,t,l,r,u,o),s=wp()}finally{Qr(!1)}}return Ge(!1),no(),null===e||jm?(yd()&&s&&Hc(t),t.flags|=1,Fm(e,t,i,o),t.child):(Sp(e,t,o),bg(e,t,o))}function Um(e,t,n,r,o){if(null===e){var i=n.type;if(function(e){return"function"==typeof e&&!Y_(e)&&void 0===e.defaultProps}(i)&&null===n.compare&&void 0===n.defaultProps){var s;return s=N_(i),t.tag=f,t.type=s,Qm(t,i),zm(e,t,s,r,o)}var l=i.propTypes;if(l&&nc(l,r,"prop",Me(i)),void 0!==n.defaultProps){var u=Me(i)||"Unknown";Mm[u]||(a("%s: Support for defaultProps will be removed from memo components in a future major release. Use JavaScript default parameters instead.",u),Mm[u]=!0)}var c=Q_(n.type,null,r,t,t.mode,o);return c.ref=t.ref,c.return=t,t.child=c,c}var d=n.type,p=d.propTypes;p&&nc(p,r,"prop",Me(d));var h=e.child;if(!yg(e,o)){var m=h.memoizedProps,g=n.compare;if((g=null!==g?g:As)(m,r)&&e.ref===t.ref)return bg(e,t,o)}t.flags|=1;var b=K_(h,r);return b.ref=t.ref,b.return=t,t.child=b,b}function zm(e,t,n,r,o){if(t.type!==t.elementType){var a=t.elementType;if(a.$$typeof===ce){var i=a,s=i._payload,l=i._init;try{a=l(s)}catch(d){a=null}var u=a&&a.propTypes;u&&nc(u,r,"prop",Me(a))}}if(null!==e){var c=e.memoizedProps;if(As(c,r)&&e.ref===t.ref&&t.type===e.type){if(jm=!1,t.pendingProps=r=c,!yg(e,o))return t.lanes=e.lanes,bg(e,t,o);0!==(e.flags&fr)&&(jm=!0)}}return qm(e,t,n,r,o)}function Vm(e,t,n){var r,o=t.pendingProps,a=o.children,i=null!==e?e.memoizedState:null;if("hidden"===o.mode)if(1&t.mode){if(!ga(n,Zo)){var s;if(null!==i)s=ya(i.baseLanes,n);else s=n;t.lanes=t.childLanes=Zo;var l={baseLanes:s,cachePool:null,transitions:null};return t.memoizedState=l,t.updateQueue=null,Xy(t,s),null}var u={baseLanes:0,cachePool:null,transitions:null};t.memoizedState=u,Xy(t,null!==i?i.baseLanes:n)}else{var c={baseLanes:0,cachePool:null,transitions:null};t.memoizedState=c,Xy(t,n)}else null!==i?(r=ya(i.baseLanes,n),t.memoizedState=null):r=n,Xy(t,r);return Fm(e,t,a,n),t.child}function Hm(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=or,t.flags|=hr)}function qm(e,t,n,r,o){if(t.type!==t.elementType){var a=n.propTypes;a&&nc(a,r,"prop",Me(n))}var i,s,l;if(i=gc(t,hc(0,n,!0)),af(t,o),to(t),Lm.current=t,Ge(!0),s=vp(e,t,n,r,i,o),l=wp(),8&t.mode){Qr(!0);try{s=vp(e,t,n,r,i,o),l=wp()}finally{Qr(!1)}}return Ge(!1),no(),null===e||jm?(yd()&&l&&Hc(t),t.flags|=1,Fm(e,t,s,o),t.child):(Sp(e,t,o),bg(e,t,o))}function Gm(e,t,n,r,o){switch(yv(t)){case!1:var i=t.stateNode,s=new(0,t.type)(t.memoizedProps,i.context).state;i.updater.enqueueSetState(i,s,null);break;case!0:t.flags|=nr,t.flags|=dr;var l=new Error("Simulated error coming from DevTools"),u=pa(o);t.lanes=ya(t.lanes,u),Tf(t,xm(t,ym(l,t),u))}if(t.type!==t.elementType){var c=n.propTypes;c&&nc(c,r,"prop",Me(n))}var d,f;yc(n)?(d=!0,xc(t)):d=!1,af(t,o),null===t.stateNode?(gg(e,t),mm(t,n,r),bm(t,n,r,o),f=!0):f=null===e?function(e,t,n,r){var o=e.stateNode,a=e.memoizedProps;o.props=a;var i=o.context,s=t.contextType,l=cc;l="object"==typeof s&&null!==s?sf(s):gc(e,hc(0,t,!0));var u=t.getDerivedStateFromProps,c="function"==typeof u||"function"==typeof o.getSnapshotBeforeUpdate;c||"function"!=typeof o.UNSAFE_componentWillReceiveProps&&"function"!=typeof o.componentWillReceiveProps||a===n&&i===l||gm(e,o,n,l),Of();var d=e.memoizedState,f=o.state=d;if(kf(e,n,o,r),f=e.memoizedState,a===n&&d===f&&!bc()&&!Af()){if("function"==typeof o.componentDidMount){var p=4;p|=mr,0!==(e.mode&bo)&&(p|=gr),e.flags|=p}return!1}"function"==typeof u&&(dm(e,t,u,n),f=e.memoizedState);var h=Af()||pm(e,t,a,n,d,f,l);if(h){if(c||"function"!=typeof o.UNSAFE_componentWillMount&&"function"!=typeof o.componentWillMount||("function"==typeof o.componentWillMount&&o.componentWillMount(),"function"==typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount()),"function"==typeof o.componentDidMount){var m=4;m|=mr,0!==(e.mode&bo)&&(m|=gr),e.flags|=m}}else{if("function"==typeof o.componentDidMount){var g=4;g|=mr,0!==(e.mode&bo)&&(g|=gr),e.flags|=g}e.memoizedProps=n,e.memoizedState=f}return o.props=n,o.state=f,o.context=l,h}(t,n,r,o):function(e,t,n,r,o){var a=t.stateNode;vf(e,t);var i=t.memoizedProps,s=t.type===t.elementType?i:Qh(t.type,i);a.props=s;var l=t.pendingProps,u=a.context,c=n.contextType,d=cc;d="object"==typeof c&&null!==c?sf(c):gc(t,hc(0,n,!0));var f=n.getDerivedStateFromProps,p="function"==typeof f||"function"==typeof a.getSnapshotBeforeUpdate;p||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||i===l&&u===d||gm(t,a,r,d),Of();var h=t.memoizedState,m=a.state=h;if(kf(t,r,a,o),m=t.memoizedState,i===l&&h===m&&!bc()&&!Af())return"function"==typeof a.componentDidUpdate&&(i===e.memoizedProps&&h===e.memoizedState||(t.flags|=4)),"function"==typeof a.getSnapshotBeforeUpdate&&(i===e.memoizedProps&&h===e.memoizedState||(t.flags|=ar)),!1;"function"==typeof f&&(dm(t,n,f,r),m=t.memoizedState);var g=Af()||pm(t,n,s,r,h,m,d)||v;return g?(p||"function"!=typeof a.UNSAFE_componentWillUpdate&&"function"!=typeof a.componentWillUpdate||("function"==typeof a.componentWillUpdate&&a.componentWillUpdate(r,m,d),"function"==typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(r,m,d)),"function"==typeof a.componentDidUpdate&&(t.flags|=4),"function"==typeof a.getSnapshotBeforeUpdate&&(t.flags|=ar)):("function"==typeof a.componentDidUpdate&&(i===e.memoizedProps&&h===e.memoizedState||(t.flags|=4)),"function"==typeof a.getSnapshotBeforeUpdate&&(i===e.memoizedProps&&h===e.memoizedState||(t.flags|=ar)),t.memoizedProps=r,t.memoizedState=m),a.props=r,a.state=m,a.context=d,g}(e,t,n,r,o);var p=Wm(e,t,n,f,d,o),h=t.stateNode;return f&&h.props!==r&&(Cm||a("It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.",je(t)||"a component"),Cm=!0),p}function Wm(e,t,n,r,o,a){Hm(e,t);var i=0!==(t.flags&nr);if(!r&&!i)return o&&Tc(t,n,!1),bg(e,t,a);var s,l=t.stateNode;if(Lm.current=t,i&&"function"!=typeof n.getDerivedStateFromError)s=null,Hh();else{if(to(t),Ge(!0),s=l.render(),8&t.mode){Qr(!0);try{l.render()}finally{Qr(!1)}}Ge(!1),no()}return t.flags|=1,null!==e&&i?function(e,t,n,r){t.child=Vd(t,e.child,null,r),t.child=Vd(t,null,n,r)}(e,t,s,a):Fm(e,t,s,a),t.memoizedState=l.state,o&&Tc(t,n,!0),t.child}function Ym(e){var t=e.stateNode;t.pendingContext?wc(e,t.pendingContext,t.pendingContext!==t.context):t.context&&wc(e,t.context,!1),Lf(e,t.containerInfo)}function Km(e,t,n,r,o){return gd(),_d(o),t.flags|=rr,Fm(e,t,n,r),t.child}function Xm(e,t,n,r){gg(e,t);var o=t.pendingProps,a=n,i=a._payload,s=(0,a._init)(i);t.type=s;var u=t.tag=function(e){if("function"==typeof e)return Y_(e)?1:0;if(null!=e){var t=e.$$typeof;if(t===ie)return l;if(t===ue)return d}return 2}(s),c=Qh(s,o);switch(u){case 0:return Qm(t,s),t.type=s=N_(s),qm(null,t,s,c,r);case 1:return t.type=s=M_(s),Gm(null,t,s,c,r);case l:return t.type=s=L_(s),Bm(null,t,s,c,r);case d:if(t.type!==t.elementType){var f=s.propTypes;f&&nc(f,c,"prop",Me(s))}return Um(null,t,s,Qh(s.type,c),r)}var p="";throw null!==s&&"object"==typeof s&&s.$$typeof===ce&&(p=" Did you wrap a component in React.lazy() more than once?"),new Error("Element type is invalid. Received a promise that resolves to: "+s+". Lazy element type must resolve to a class or function."+p)}function Qm(e,t){if(t&&t.childContextTypes&&a("%s(...): childContextTypes cannot be defined on a function component.",t.displayName||t.name||"Component"),null!==e.ref){var n="",r=ze();r&&(n+="\n\nCheck the render method of `"+r+"`.");var o=r||"",i=e._debugSource;i&&(o=i.fileName+":"+i.lineNumber),Im[o]||(Im[o]=!0,a("Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?%s",n))}if(void 0!==t.defaultProps){var s=Me(t)||"Unknown";Mm[s]||(a("%s: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.",s),Mm[s]=!0)}if("function"==typeof t.getDerivedStateFromProps){var l=Me(t)||"Unknown";Rm[l]||(a("%s: Function components do not support getDerivedStateFromProps.",l),Rm[l]=!0)}if("object"==typeof t.contextType&&null!==t.contextType){var u=Me(t)||"Unknown";$m[u]||(a("%s: Function components do not support contextType.",u),$m[u]=!0)}}Om={},Am={},$m={},Rm={},Im={},Cm=!1,Dm={},Nm={},Mm={};var Zm={dehydrated:null,treeContext:null,retryLane:0};function Jm(e){return{baseLanes:e,cachePool:null,transitions:null}}function eg(e,t,n){var r=t.pendingProps;_v(t)&&(t.flags|=nr);var o=zf.current,i=!1,s=0!==(t.flags&nr);if(s||function(e,t){return(null===t||null!==t.memoizedState)&&Vf(e,2)}(o,e)?(i=!0,t.flags&=-129):null!==e&&null===e.memoizedState||(o=o|1),Gf(t,o=Hf(o)),null===e){ud(t);var l=t.memoizedState;if(null!==l){var u=l.dehydrated;if(null!==u)return function(e,t){1&e.mode?Iu(t)?e.lanes=Eo:e.lanes=Zo:(a("Cannot hydrate Suspense in legacy mode. Switch from ReactDOM.hydrate(element, container) to ReactDOMClient.hydrateRoot(container, <App />).render(element) or remove the Suspense components from the server rendered components."),e.lanes=So);return null}(t,u)}var c=r.children,d=r.fallback;if(i){var f=function(e,t,n,r){var o,a,i=e.mode,s=e.child,l={mode:"hidden",children:t};1&i||null===s?(o=ng(l,i),a=J_(n,i,r,null)):((o=s).childLanes=0,o.pendingProps=l,2&e.mode&&(o.actualDuration=0,o.actualStartTime=-1,o.selfBaseDuration=0,o.treeBaseDuration=0),a=J_(n,i,r,null));return o.return=e,a.return=e,o.sibling=a,e.child=o,a}(t,c,d,n);return t.child.memoizedState=Jm(n),t.memoizedState=Zm,f}return tg(t,c)}var p=e.memoizedState;if(null!==p){var h=p.dehydrated;if(null!==h)return function(e,t,n,r,o,i,s){if(n){if(t.flags&rr)return t.flags&=-257,og(e,t,s,_m(new Error("There was an error while hydrating this Suspense boundary. Switched to client rendering.")));if(null!==t.memoizedState)return t.child=e.child,t.flags|=nr,null;var l=function(e,t,n,r,o){var a=t.mode,i={mode:"visible",children:n},s=ng(i,a),l=J_(r,a,o,null);l.flags|=2,s.return=t,l.return=t,s.sibling=l,t.child=s,!(1&t.mode)||Vd(t,e.child,null,o);return l}(e,t,r.children,r.fallback,s);return t.child.memoizedState=Jm(s),t.memoizedState=Zm,l}if(Xc&&a("We should not be hydrating here. This is a bug in React. Please file a bug."),!(1&t.mode))return og(e,t,s,null);if(Iu(o)){var u,c,d,f=function(e){var t,n,r,o=e.nextSibling&&e.nextSibling.dataset;return o&&(t=o.dgst,n=o.msg,r=o.stck),{message:n,digest:t,stack:r}}(o);return u=f.digest,c=f.message,d=f.stack,og(e,t,s,_m(c?new Error(c):new Error("The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering."),u,d))}var p=ga(s,e.childLanes);if(jm||p){var h=My();if(null!==h){var m=function(e,t){var n;switch(fa(t)){case To:n=xo;break;case ko:n=Eo;break;case 64:case 128:case 256:case 512:case Ao:case $o:case Ro:case Io:case Co:case Do:case No:case Mo:case Lo:case jo:case Fo:case Bo:case zo:case Vo:case Ho:case qo:case Go:n=Po;break;case Qo:n=Xo;break;default:n=0}return 0!==(n&(e.suspendedLanes|t))?0:n}(h,s);if(0!==m&&m!==i.retryLane){i.retryLane=m;var g=ea;df(e,m),By(h,e,m,g)}}return r_(),og(e,t,s,_m(new Error("This Suspense boundary received an update before it finished hydrating. This caused the boundary to switch to client rendering. The usual way to fix this is to wrap the original update in startTransition.")))}if(Ru(o)){t.flags|=nr,t.child=e.child;var b=b_.bind(null,e);return _=b,o._reactRetry=_,null}td(t,o,i.treeContext);var y=tg(t,r.children);return y.flags|=sr,y;var _}(e,t,s,r,h,p,n)}if(i){var m=r.fallback,g=function(e,t,n,r,o){var a,i,s=t.mode,l=e.child,u=l.sibling,c={mode:"hidden",children:n};if(1&s||t.child===l)(a=rg(l,c)).subtreeFlags=l.subtreeFlags&Sr;else{(a=t.child).childLanes=0,a.pendingProps=c,2&t.mode&&(a.actualDuration=0,a.actualStartTime=-1,a.selfBaseDuration=l.selfBaseDuration,a.treeBaseDuration=l.treeBaseDuration),t.deletions=null}null!==u?i=K_(u,r):(i=J_(r,s,o,null)).flags|=2;return i.return=t,a.return=t,a.sibling=i,t.child=a,i}(e,t,r.children,m,n),b=t.child,y=e.child.memoizedState;return b.memoizedState=null===y?Jm(n):function(e,t){return{baseLanes:ya(e.baseLanes,t),cachePool:null,transitions:e.transitions}}(y,n),b.childLanes=function(e,t){return _a(e.childLanes,t)}(e,n),t.memoizedState=Zm,g}var _=function(e,t,n,r){var o=e.child,a=o.sibling,i=rg(o,{mode:"visible",children:n});1&t.mode||(i.lanes=r);if(i.return=t,i.sibling=null,null!==a){var s=t.deletions;null===s?(t.deletions=[a],t.flags|=tr):s.push(a)}return t.child=i,i}(e,t,r.children,n);return t.memoizedState=null,_}function tg(e,t,n){var r=ng({mode:"visible",children:t},e.mode);return r.return=e,e.child=r,r}function ng(e,t,n){return ev(e,t,0,null)}function rg(e,t){return K_(e,t)}function og(e,t,n,r){null!==r&&_d(r),Vd(t,e.child,null,n);var o=tg(t,t.pendingProps.children);return o.flags|=2,t.memoizedState=null,o}function ag(e,t,n){e.lanes=ya(e.lanes,t);var r=e.alternate;null!==r&&(r.lanes=ya(r.lanes,t)),rf(e.return,t,n)}function ig(e,t){var n=vt(e),r=!n&&"function"==typeof pe(e);if(n||r){var o=n?"array":"iterable";return a("A nested %s was passed to row #%s in <SuspenseList />. Wrap it in an additional SuspenseList to configure its revealOrder: <SuspenseList revealOrder=...> ... <SuspenseList revealOrder=...>{%s}</SuspenseList> ... </SuspenseList>",o,t,o),!1}return!0}function sg(e,t,n,r,o){var a=e.memoizedState;null===a?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=o)}function lg(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail,s=r.children;!function(e){if(void 0!==e&&"forwards"!==e&&"backwards"!==e&&"together"!==e&&!Dm[e])if(Dm[e]=!0,"string"==typeof e)switch(e.toLowerCase()){case"together":case"forwards":case"backwards":a('"%s" is not a valid value for revealOrder on <SuspenseList />. Use lowercase "%s" instead.',e,e.toLowerCase());break;case"forward":case"backward":a('"%s" is not a valid value for revealOrder on <SuspenseList />. React uses the -s suffix in the spelling. Use "%ss" instead.',e,e.toLowerCase());break;default:a('"%s" is not a supported revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?',e)}else a('%s is not a supported value for revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?',e)}(o),function(e,t){void 0===e||Nm[e]||("collapsed"!==e&&"hidden"!==e?(Nm[e]=!0,a('"%s" is not a supported value for tail on <SuspenseList />. Did you mean "collapsed" or "hidden"?',e)):"forwards"!==t&&"backwards"!==t&&(Nm[e]=!0,a('<SuspenseList tail="%s" /> is only valid if revealOrder is "forwards" or "backwards". Did you mean to specify revealOrder="forwards"?',e)))}(i,o),function(e,t){if(("forwards"===t||"backwards"===t)&&null!=e&&!1!==e)if(vt(e)){for(var n=0;n<e.length;n++)if(!ig(e[n],n))return}else{var r=pe(e);if("function"==typeof r){var o=r.call(e);if(o)for(var i=o.next(),s=0;!i.done;i=o.next()){if(!ig(i.value,s))return;s++}}else a('A single row was passed to a <SuspenseList revealOrder="%s" />. This is not useful since it needs multiple rows. Did you mean to pass multiple children or an array?',t)}}(s,o),Fm(e,t,s,n);var l=zf.current;Vf(l,2)?(l=qf(l,2),t.flags|=nr):(null!==e&&0!==(e.flags&nr)&&function(e,t,n){for(var r=t;null!==r;){if(r.tag===c)null!==r.memoizedState&&ag(r,n,e);else if(r.tag===m)ag(r,n,e);else if(null!==r.child){r.child.return=r,r=r.child;continue}if(r===e)return;for(;null===r.sibling;){if(null===r.return||r.return===e)return;r=r.return}r.sibling.return=r.return,r=r.sibling}}(t,t.child,n),l=Hf(l));if(Gf(t,l),1&t.mode)switch(o){case"forwards":var u,d=function(e){for(var t=e,n=null;null!==t;){var r=t.alternate;null!==r&&null===Kf(r)&&(n=t),t=t.sibling}return n}(t.child);null===d?(u=t.child,t.child=null):(u=d.sibling,d.sibling=null),sg(t,!1,u,d,i);break;case"backwards":var f=null,p=t.child;for(t.child=null;null!==p;){var h=p.alternate;if(null!==h&&null===Kf(h)){t.child=p;break}var g=p.sibling;p.sibling=f,f=p,p=g}sg(t,!0,f,null,i);break;case"together":sg(t,!1,null,null,void 0);break;default:t.memoizedState=null}else t.memoizedState=null;return t.child}var ug=!1;var cg,dg,fg,pg,hg=!1;function mg(){jm=!0}function gg(e,t){1&t.mode||null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function bg(e,t,n){return null!==e&&(t.dependencies=e.dependencies),Hh(),n_(t.lanes),ga(n,t.childLanes)?(function(e,t){if(null!==e&&t.child!==e.child)throw new Error("Resuming work not yet implemented.");if(null!==t.child){var n=t.child,r=K_(n,n.pendingProps);for(t.child=r,r.return=t;null!==n.sibling;)n=n.sibling,(r=r.sibling=K_(n,n.pendingProps)).return=t;r.sibling=null}}(e,t),t.child):null}function yg(e,t){return!!ga(e.lanes,t)}function _g(e,t,n){if(t._debugNeedsRemount&&null!==e)return function(e,t,n){var r=t.return;if(null===r)throw new Error("Cannot swap the root fiber.");if(e.alternate=null,t.alternate=null,n.index=t.index,n.sibling=t.sibling,n.return=t.return,n.ref=t.ref,t===r.child)r.child=n;else{var o=r.child;if(null===o)throw new Error("Expected parent to have a child.");for(;o.sibling!==t;)if(null===(o=o.sibling))throw new Error("Expected to find the previous sibling.");o.sibling=n}var a=r.deletions;return null===a?(r.deletions=[e],r.flags|=tr):a.push(e),n.flags|=2,n}(e,t,Q_(t.type,t.key,t.pendingProps,t._debugOwner||null,t.mode,t.lanes));if(null!==e)if(e.memoizedProps!==t.pendingProps||bc()||t.type!==e.type)jm=!0;else{if(!yg(e,n)&&0===(t.flags&nr))return jm=!1,function(e,t,n){switch(t.tag){case 3:Ym(t),t.stateNode,gd();break;case 5:Bf(t);break;case 1:yc(t.type)&&xc(t);break;case 4:Lf(t,t.stateNode.containerInfo);break;case s:var r=t.memoizedProps.value;tf(t,t.type._context,r);break;case u:ga(n,t.childLanes)&&(t.flags|=4);var o=t.stateNode;o.effectDuration=0,o.passiveEffectDuration=0;break;case c:var a=t.memoizedState;if(null!==a){if(null!==a.dehydrated)return Gf(t,Hf(zf.current)),t.flags|=nr,null;if(ga(n,t.child.childLanes))return eg(e,t,n);Gf(t,Hf(zf.current));var i=bg(e,t,n);return null!==i?i.sibling:null}Gf(t,Hf(zf.current));break;case m:var l=0!==(e.flags&nr),d=ga(n,t.childLanes);if(l){if(d)return lg(e,t,n);t.flags|=nr}var f=t.memoizedState;if(null!==f&&(f.rendering=null,f.tail=null,f.lastEffect=null),Gf(t,zf.current),d)break;return null;case b:case y:return t.lanes=0,Vm(e,t,n)}return bg(e,t,n)}(e,t,n);jm=0!==(e.flags&fr)}else if(jm=!1,yd()&&function(e){return Wc(),0!==(e.flags&pr)}(t)){var r=t.index;Vc(t,(Wc(),Nc),r)}switch(t.lanes=0,t.tag){case 2:return function(e,t,n,r){gg(e,t);var o,i,s,l=t.pendingProps;if(o=gc(t,hc(0,n,!1)),af(t,r),to(t),n.prototype&&"function"==typeof n.prototype.render){var u=Me(n)||"Unknown";Om[u]||(a("The <%s /> component appears to have a render method, but doesn't extend React.Component. This is likely to cause errors. Change %s to extend React.Component instead.",u,u),Om[u]=!0)}if(8&t.mode&&wd.recordLegacyContextWarning(t,null),Ge(!0),Lm.current=t,i=vp(null,t,n,l,o,r),s=wp(),Ge(!1),no(),t.flags|=1,"object"==typeof i&&null!==i&&"function"==typeof i.render&&void 0===i.$$typeof){var c=Me(n)||"Unknown";Am[c]||(a("The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.",c,c,c),Am[c]=!0)}if("object"==typeof i&&null!==i&&"function"==typeof i.render&&void 0===i.$$typeof){var d=Me(n)||"Unknown";Am[d]||(a("The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.",d,d,d),Am[d]=!0),t.tag=1,t.memoizedState=null,t.updateQueue=null;var f=!1;return yc(n)?(f=!0,xc(t)):f=!1,t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,_f(t),hm(t,i),bm(t,n,l,r),Wm(null,t,n,!0,f,r)}if(t.tag=0,8&t.mode){Qr(!0);try{i=vp(null,t,n,l,o,r),s=wp()}finally{Qr(!1)}}return yd()&&s&&Hc(t),Fm(null,t,i,r),Qm(t,n),t.child}(e,t,t.type,n);case 16:return Xm(e,t,t.elementType,n);case 0:var o=t.type,i=t.pendingProps;return qm(e,t,o,t.elementType===o?i:Qh(o,i),n);case 1:var h=t.type,_=t.pendingProps;return Gm(e,t,h,t.elementType===h?_:Qh(h,_),n);case 3:return function(e,t,n){if(Ym(t),null===e)throw new Error("Should have a current fiber. This is a bug in React.");var r=t.pendingProps,o=t.memoizedState,a=o.element;vf(e,t),kf(t,r,null,n);var i=t.memoizedState;t.stateNode;var s=i.element;if(o.isDehydrated){var l={element:s,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions};if(t.updateQueue.baseState=l,t.memoizedState=l,t.flags&rr)return Km(e,t,s,n,ym(new Error("There was an error while hydrating. Because the error happened outside of a Suspense boundary, the entire root will switch to client rendering."),t));if(s!==a)return Km(e,t,s,n,ym(new Error("This root received an early update, before anything was able hydrate. Switched the entire root to client rendering."),t));ed(t);var u=Hd(t,null,s,n);t.child=u;for(var c=u;c;)c.flags=-3&c.flags|sr,c=c.sibling}else{if(gd(),s===a)return bg(e,t,n);Fm(e,t,s,n)}return t.child}(e,t,n);case 5:return function(e,t,n){Bf(t),null===e&&ud(t);var r=t.type,o=t.pendingProps,a=null!==e?e.memoizedProps:null,i=o.children;return yu(r,o)?i=null:null!==a&&yu(r,a)&&(t.flags|=32),Hm(e,t),Fm(e,t,i,n),t.child}(e,t,n);case 6:return function(e,t){return null===e&&ud(t),null}(e,t);case c:return eg(e,t,n);case 4:return function(e,t,n){Lf(t,t.stateNode.containerInfo);var r=t.pendingProps;return null===e?t.child=Vd(t,null,r,n):Fm(e,t,r,n),t.child}(e,t,n);case l:var v=t.type,w=t.pendingProps;return Bm(e,t,v,t.elementType===v?w:Qh(v,w),n);case 7:return function(e,t,n){return Fm(e,t,t.pendingProps,n),t.child}(e,t,n);case 8:return function(e,t,n){return Fm(e,t,t.pendingProps.children,n),t.child}(e,t,n);case u:return function(e,t,n){t.flags|=4;var r=t.stateNode;return r.effectDuration=0,r.passiveEffectDuration=0,Fm(e,t,t.pendingProps.children,n),t.child}(e,t,n);case s:return function(e,t,n){var r=t.type._context,o=t.pendingProps,i=t.memoizedProps,s=o.value;"value"in o||ug||(ug=!0,a("The `value` prop is required for the `<Context.Provider>`. Did you misspell it or forget to pass it?"));var l=t.type.propTypes;if(l&&nc(l,o,"prop","Context.Provider"),tf(t,r,s),null!==i){var u=i.value;if(Os(u,s)){if(i.children===o.children&&!bc())return bg(e,t,n)}else of(t,r,n)}return Fm(e,t,o.children,n),t.child}(e,t,n);case 9:return function(e,t,n){var r=t.type;void 0===r._context?r!==r.Consumer&&(hg||(hg=!0,a("Rendering <Context> directly is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?"))):r=r._context;var o=t.pendingProps.children;"function"!=typeof o&&a("A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it."),af(t,n);var i,s=sf(r);return to(t),Lm.current=t,Ge(!0),i=o(s),Ge(!1),no(),t.flags|=1,Fm(e,t,i,n),t.child}(e,t,n);case d:var S=t.type,x=Qh(S,t.pendingProps);if(t.type!==t.elementType){var T=S.propTypes;T&&nc(T,x,"prop",Me(S))}return Um(e,t,S,x=Qh(S.type,x),n);case f:return zm(e,t,t.type,t.pendingProps,n);case p:var E=t.type,k=t.pendingProps;return function(e,t,n,r,o){var a;return gg(e,t),t.tag=1,yc(n)?(a=!0,xc(t)):a=!1,af(t,o),mm(t,n,r),bm(t,n,r,o),Wm(null,t,n,!0,a,o)}(e,t,E,t.elementType===E?k:Qh(E,k),n);case m:return lg(e,t,n);case g:break;case b:return Vm(e,t,n)}throw new Error("Unknown unit of work tag ("+t.tag+"). This error is likely caused by a bug in React. Please file an issue.")}function vg(e){e.flags|=4}function wg(e){e.flags|=or,e.flags|=hr}function Sg(e,t){if(!yd())switch(e.tailMode){case"hidden":for(var n=e.tail,r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?e.tail=null:r.sibling=null;break;case"collapsed":for(var o=e.tail,a=null;null!==o;)null!==o.alternate&&(a=o),o=o.sibling;null===a?t||null===e.tail?e.tail=null:e.tail.sibling=null:a.sibling=null}}function xg(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t){if(2&e.mode){for(var o=e.selfBaseDuration,a=e.child;null!==a;)n=ya(n,ya(a.lanes,a.childLanes)),r|=a.subtreeFlags&Sr,r|=a.flags&Sr,o+=a.treeBaseDuration,a=a.sibling;e.treeBaseDuration=o}else for(var i=e.child;null!==i;)n=ya(n,ya(i.lanes,i.childLanes)),r|=i.subtreeFlags&Sr,r|=i.flags&Sr,i.return=e,i=i.sibling;e.subtreeFlags|=r}else{if(2&e.mode){for(var s=e.actualDuration,l=e.selfBaseDuration,u=e.child;null!==u;)n=ya(n,ya(u.lanes,u.childLanes)),r|=u.subtreeFlags,r|=u.flags,s+=u.actualDuration,l+=u.treeBaseDuration,u=u.sibling;e.actualDuration=s,e.treeBaseDuration=l}else for(var c=e.child;null!==c;)n=ya(n,ya(c.lanes,c.childLanes)),r|=c.subtreeFlags,r|=c.flags,c.return=e,c=c.sibling;e.subtreeFlags|=r}return e.childLanes=n,t}function Tg(e,t,n){if(Xc&&null!==Kc&&1&t.mode&&0===(t.flags&nr))return md(t),gd(),t.flags|=98560,!1;var r=hd(t);if(null!==n&&null!==n.dehydrated){if(null===e){if(!r)throw new Error("A dehydrated suspense component was completed without a hydrated node. This is probably a bug in React.");if(dd(t),xg(t),2&t.mode)if(null!==n){var o=t.child;null!==o&&(t.treeBaseDuration-=o.treeBaseDuration)}return!1}if(gd(),0===(t.flags&nr)&&(t.memoizedState=null),t.flags|=4,xg(t),2&t.mode&&null!==n){var a=t.child;null!==a&&(t.treeBaseDuration-=a.treeBaseDuration)}return!1}return bd(),!0}function Eg(e,t,n){var r=t.pendingProps;switch(Gc(t),t.tag){case 2:case 16:case f:case 0:case l:case 7:case 8:case u:case 9:case d:return xg(t),null;case 1:return yc(t.type)&&_c(t),xg(t),null;case 3:var o=t.stateNode;if(jf(t),vc(t),Qf(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),null===e||null===e.child)if(hd(t))vg(t);else if(null!==e)e.memoizedState.isDehydrated&&0===(t.flags&rr)||(t.flags|=ar,bd());return dg(e,t),xg(t),null;case 5:Uf(t);var a=Mf(),i=t.type;if(null!==e&&null!=t.stateNode)fg(e,t,i,r,a),e.ref!==t.ref&&wg(t);else{if(!r){if(null===t.stateNode)throw new Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");return xg(t),null}var h=Ff();if(hd(t))(function(e,t,n){var r=e.stateNode,o=!Qc,a=Nu(r,e.type,e.memoizedProps,0,n,e,o);return e.updateQueue=a,null!==a})(t,0,h)&&vg(t);else{var _=gu(i,r,a,h,t);cg(_,t,!1,!1),t.stateNode=_,function(e,t,n){switch(Gl(e,t,n),t){case"button":case"input":case"select":case"textarea":return!!n.autoFocus;case"img":return!0;default:return!1}}(_,i,r)&&vg(t)}null!==t.ref&&wg(t)}return xg(t),null;case 6:var v=r;if(e&&null!=t.stateNode){var w=e.memoizedProps;pg(e,t,w,v)}else{if("string"!=typeof v&&null===t.stateNode)throw new Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");var S=Mf(),x=Ff();hd(t)?cd(t)&&vg(t):t.stateNode=_u(v,S,x,t)}return xg(t),null;case c:Wf(t);var T=t.memoizedState;if(null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated)if(!Tg(e,t,T))return t.flags&dr?t:null;if(0!==(t.flags&nr))return t.lanes=n,2&t.mode&&Xh(t),t;var E=null!==T;if(E!==(null!==e&&null!==e.memoizedState))if(E)if(t.child.flags|=lr,1&t.mode)null===e&&(!0!==t.memoizedProps.unstable_avoidThisFallback||!0)||Vf(zf.current,1)?ry===Hb&&(ry=Wb):r_();if(null!==t.updateQueue&&(t.flags|=4),xg(t),2&t.mode&&E){var k=t.child;null!==k&&(t.treeBaseDuration-=k.treeBaseDuration)}return null;case 4:return jf(t),dg(e,t),null===e&&gl(t.stateNode.containerInfo),xg(t),null;case s:return nf(t.type._context,t),xg(t),null;case p:return yc(t.type)&&_c(t),xg(t),null;case m:Wf(t);var P=t.memoizedState;if(null===P)return xg(t),null;var O=0!==(t.flags&nr),A=P.rendering;if(null===A)if(O)Sg(P,!1);else{if(!(ry===Hb&&(null===e||0===(e.flags&nr))))for(var $=t.child;null!==$;){var R=Kf($);if(null!==R){O=!0,t.flags|=nr,Sg(P,!1);var I=R.updateQueue;return null!==I&&(t.updateQueue=I,t.flags|=4),t.subtreeFlags=0,qd(t,n),Gf(t,qf(zf.current,2)),t.child}$=$.sibling}null!==P.tail&&Lr()>gy()&&(t.flags|=nr,O=!0,Sg(P,!1),t.lanes=Wo)}else{if(!O){var C=Kf(A);if(null!==C){t.flags|=nr,O=!0;var D=C.updateQueue;if(null!==D&&(t.updateQueue=D,t.flags|=4),Sg(P,!0),null===P.tail&&"hidden"===P.tailMode&&!A.alternate&&!yd())return xg(t),null}else 2*Lr()-P.renderingStartTime>gy()&&n!==Zo&&(t.flags|=nr,O=!0,Sg(P,!1),t.lanes=Wo)}if(P.isBackwards)A.sibling=t.child,t.child=A;else{var N=P.last;null!==N?N.sibling=A:t.child=A,P.last=A}}if(null!==P.tail){var M=P.tail;P.rendering=M,P.tail=M.sibling,P.renderingStartTime=Lr(),M.sibling=null;var L=zf.current;return Gf(t,L=O?qf(L,2):Hf(L)),M}return xg(t),null;case g:break;case b:case y:Qy(t);var j=null!==t.memoizedState;if(null!==e)null!==e.memoizedState!==j&&(t.flags|=lr);return j&&1&t.mode?ga(ty,Zo)&&(xg(t),6&t.subtreeFlags&&(t.flags|=lr)):xg(t),null;case 24:case 25:return null}throw new Error("Unknown unit of work tag ("+t.tag+"). This error is likely caused by a bug in React. Please file an issue.")}function kg(e,t,n){switch(Gc(t),t.tag){case 1:yc(t.type)&&_c(t);var r=t.flags;return r&dr?(t.flags=-65537&r|nr,2&t.mode&&Xh(t),t):null;case 3:t.stateNode,jf(t),vc(t),Qf();var o=t.flags;return 0!==(o&dr)&&0===(o&nr)?(t.flags=-65537&o|nr,t):null;case 5:return Uf(t),null;case c:Wf(t);var a=t.memoizedState;if(null!==a&&null!==a.dehydrated){if(null===t.alternate)throw new Error("Threw in newly mounted dehydrated component. This is likely a bug in React. Please file an issue.");gd()}var i=t.flags;return i&dr?(t.flags=-65537&i|nr,2&t.mode&&Xh(t),t):null;case m:return Wf(t),null;case 4:return jf(t),null;case s:return nf(t.type._context,t),null;case b:case y:return Qy(t),null;default:return null}}function Pg(e,t,n){switch(Gc(t),t.tag){case 1:var r=t.type.childContextTypes;null!=r&&_c(t);break;case 3:t.stateNode,jf(t),vc(t),Qf();break;case 5:Uf(t);break;case 4:jf(t);break;case c:case m:Wf(t);break;case s:nf(t.type._context,t);break;case b:case y:Qy(t)}}cg=function(e,t,n,r){for(var o=t.child;null!==o;){if(5===o.tag||6===o.tag)bu(e,o.stateNode);else if(4===o.tag);else if(null!==o.child){o.child.return=o,o=o.child;continue}if(o===t)return;for(;null===o.sibling;){if(null===o.return||o.return===t)return;o=o.return}o.sibling.return=o.return,o=o.sibling}},dg=function(e,t){},fg=function(e,t,n,r,o){var a=e.memoizedProps;if(a!==r){var i=function(e,t,n,r,o,a){var i=a;if(typeof r.children!=typeof n.children&&("string"==typeof r.children||"number"==typeof r.children)){var s=""+r.children,l=tu(i.ancestorInfo,t);eu(null,s,l)}return Wl(e,t,n,r)}(t.stateNode,n,a,r,0,Ff());t.updateQueue=i,i&&vg(t)}},pg=function(e,t,n,r){n!==r&&vg(t)};var Og=null;Og=new Set;var Ag=!1,$g=!1,Rg="function"==typeof WeakSet?WeakSet:Set,Ig=null,Cg=null,Dg=null;var Ng=function(e,t){if(t.props=e.memoizedProps,t.state=e.memoizedState,2&e.mode)try{Yh(),t.componentWillUnmount()}finally{Gh(e)}else t.componentWillUnmount()};function Mg(e,t){try{Gg(4,e)}catch(n){h_(e,t,n)}}function Lg(e,t,n){try{Ng(e,n)}catch(r){h_(e,t,r)}}function jg(e,t){try{Xg(e)}catch(n){h_(e,t,n)}}function Fg(e,t){var n=e.ref;if(null!==n)if("function"==typeof n){var r;try{if(2&e.mode)try{Yh(),r=n(null)}finally{Gh(e)}else r=n(null)}catch(o){h_(e,t,o)}"function"==typeof r&&a("Unexpected return value from a callback ref in %s. A callback ref should not return a function.",je(e))}else n.current=null}function Bg(e,t,n){try{n()}catch(r){h_(e,t,r)}}var Ug=!1;function zg(e,t){mu(e.containerInfo),Ig=t,function(){for(;null!==Ig;){var e=Ig,t=e.child;0!==(e.subtreeFlags&yr)&&null!==t?(t.return=e,Ig=t):Vg()}}();var n=Ug;return Ug=!1,n}function Vg(){for(;null!==Ig;){var e=Ig;qe(e);try{Hg(e)}catch(n){h_(e,e.return,n)}He();var t=e.sibling;if(null!==t)return t.return=e.return,void(Ig=t);Ig=e.return}}function Hg(e){var t,n=e.alternate;if(0!==(e.flags&ar)){switch(qe(e),e.tag){case 0:case l:case f:break;case 1:if(null!==n){var r=n.memoizedProps,o=n.memoizedState,i=e.stateNode;e.type!==e.elementType||Cm||(i.props!==e.memoizedProps&&a("Expected %s props to match memoized props before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",je(e)||"instance"),i.state!==e.memoizedState&&a("Expected %s state to match memoized state before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",je(e)||"instance"));var s=i.getSnapshotBeforeUpdate(e.elementType===e.type?r:Qh(e.type,r),o),u=Og;void 0!==s||u.has(e.type)||(u.add(e.type),a("%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.",je(e))),i.__reactInternalSnapshotBeforeUpdate=s}break;case 3:var c=e.stateNode;1===(t=c.containerInfo).nodeType?t.textContent="":9===t.nodeType&&t.documentElement&&t.removeChild(t.documentElement);break;case 5:case 6:case 4:case p:break;default:throw new Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.")}He()}}function qg(e,t,n){var r=t.updateQueue,o=null!==r?r.lastEffect:null;if(null!==o){var a=o.next,i=a;do{if((i.tag&e)===e){var s=i.destroy;i.destroy=void 0,void 0!==s&&(8&e?ao(t):4&e&&uo(t),2&e&&R_(!0),Bg(t,n,s),2&e&&R_(!1),8&e?io():4&e&&co())}i=i.next}while(i!==a)}}function Gg(e,t){var n=t.updateQueue,r=null!==n?n.lastEffect:null;if(null!==r){var o=r.next,i=o;do{if((i.tag&e)===e){8&e?ro(t):4&e&&so(t);var s=i.create;2&e&&R_(!0),i.destroy=s(),2&e&&R_(!1),8&e?oo():4&e&&lo();var l=i.destroy;if(void 0!==l&&"function"!=typeof l){var u=void 0;a("%s must not return anything besides a function, which is used for clean-up.%s",u=4&i.tag?"useLayoutEffect":2&i.tag?"useInsertionEffect":"useEffect",null===l?" You returned null. If your effect does not require clean up, return undefined (or nothing).":"function"==typeof l.then?"\n\nIt looks like you wrote "+u+"(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:\n\n"+u+"(() => {\n async function fetchData() {\n // You can await here\n const response = await MyAPI.getData(someId);\n // ...\n }\n fetchData();\n}, [someId]); // Or [] if effect doesn't need props or state\n\nLearn more about data fetching with Hooks: https://reactjs.org/link/hooks-data-fetching":" You returned: "+l)}}i=i.next}while(i!==o)}}function Wg(e,t){if(4&t.flags&&t.tag===u){var n=t.stateNode.passiveEffectDuration,r=t.memoizedProps,o=r.id,a=r.onPostCommit,i=Uh(),s=null===t.alternate?"mount":"update";Bh()&&(s="nested-update"),"function"==typeof a&&a(o,s,n,i);var l=t.return;e:for(;null!==l;){switch(l.tag){case 3:l.stateNode.passiveEffectDuration+=n;break e;case u:l.stateNode.passiveEffectDuration+=n;break e}l=l.return}}}function Yg(e,t,n,r){if(0!==(n.flags&vr))switch(n.tag){case 0:case l:case f:if(!$g)if(2&n.mode)try{Yh(),Gg(5,n)}finally{Gh(n)}else Gg(5,n);break;case 1:var o=n.stateNode;if(4&n.flags&&!$g)if(null===t)if(n.type!==n.elementType||Cm||(o.props!==n.memoizedProps&&a("Expected %s props to match memoized props before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",je(n)||"instance"),o.state!==n.memoizedState&&a("Expected %s state to match memoized state before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",je(n)||"instance")),2&n.mode)try{Yh(),o.componentDidMount()}finally{Gh(n)}else o.componentDidMount();else{var i=n.elementType===n.type?t.memoizedProps:Qh(n.type,t.memoizedProps),s=t.memoizedState;if(n.type!==n.elementType||Cm||(o.props!==n.memoizedProps&&a("Expected %s props to match memoized props before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",je(n)||"instance"),o.state!==n.memoizedState&&a("Expected %s state to match memoized state before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",je(n)||"instance")),2&n.mode)try{Yh(),o.componentDidUpdate(i,s,o.__reactInternalSnapshotBeforeUpdate)}finally{Gh(n)}else o.componentDidUpdate(i,s,o.__reactInternalSnapshotBeforeUpdate)}var d=n.updateQueue;null!==d&&(n.type!==n.elementType||Cm||(o.props!==n.memoizedProps&&a("Expected %s props to match memoized props before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",je(n)||"instance"),o.state!==n.memoizedState&&a("Expected %s state to match memoized state before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",je(n)||"instance")),$f(0,d,o));break;case 3:var h=n.updateQueue;if(null!==h){var _=null;if(null!==n.child)switch(n.child.tag){case 5:case 1:_=n.child.stateNode}$f(0,h,_)}break;case 5:var v=n.stateNode;if(null===t&&4&n.flags)!function(e,t,n){switch(t){case"button":case"input":case"select":case"textarea":return void(n.autoFocus&&e.focus());case"img":n.src&&(e.src=n.src)}}(v,n.type,n.memoizedProps);break;case 6:case 4:break;case u:var w=n.memoizedProps,S=w.onCommit,x=w.onRender,T=n.stateNode.effectDuration,E=Uh(),k=null===t?"mount":"update";Bh()&&(k="nested-update"),"function"==typeof x&&x(n.memoizedProps.id,k,n.actualDuration,n.treeBaseDuration,n.actualStartTime,E),"function"==typeof S&&S(n.memoizedProps.id,k,T,E),O=n,xy.push(O),vy||(vy=!0,O_(Ur,function(){return c_(),null}));var P=n.return;e:for(;null!==P;){switch(P.tag){case 3:P.stateNode.effectDuration+=T;break e;case u:P.stateNode.effectDuration+=T;break e}P=P.return}break;case c:!function(e,t){var n=t.memoizedState;if(null===n){var r=t.alternate;if(null!==r){var o=r.memoizedState;if(null!==o){var a=o.dehydrated;null!==a&&function(e){ai(e)}(a)}}}}(0,n);break;case m:case p:case g:case b:case y:case 25:break;default:throw new Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.")}var O;$g||n.flags&or&&Xg(n)}function Kg(e){switch(e.tag){case 0:case l:case f:if(2&e.mode)try{Yh(),Mg(e,e.return)}finally{Gh(e)}else Mg(e,e.return);break;case 1:var t=e.stateNode;"function"==typeof t.componentDidMount&&function(e,t,n){try{n.componentDidMount()}catch(r){h_(e,t,r)}}(e,e.return,t),jg(e,e.return);break;case 5:jg(e,e.return)}}function Xg(e){var t=e.ref;if(null!==t){var n,r=e.stateNode;if(e.tag,n=r,"function"==typeof t){var o;if(2&e.mode)try{Yh(),o=t(n)}finally{Gh(e)}else o=t(n);"function"==typeof o&&a("Unexpected return value from a callback ref in %s. A callback ref should not return a function.",je(e))}else t.hasOwnProperty("current")||a("Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().",je(e)),t.current=n}}function Qg(e){var t,n=e.alternate;if(null!==n&&(e.alternate=null,Qg(n)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag){var r=e.stateNode;null!==r&&(delete(t=r)[ju],delete t[Fu],delete t[Uu],delete t[zu],delete t[Vu])}e.stateNode=null,e._debugOwner=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Zg(e){return 5===e.tag||3===e.tag||4===e.tag}function Jg(e){var t=e;e:for(;;){for(;null===t.sibling;){if(null===t.return||Zg(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;5!==t.tag&&6!==t.tag&&t.tag!==h;){if(2&t.flags)continue e;if(null===t.child||4===t.tag)continue e;t.child.return=t,t=t.child}if(!(2&t.flags))return t.stateNode}}function eb(e){var t=function(e){for(var t=e.return;null!==t;){if(Zg(t))return t;t=t.return}throw new Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.")}(e);switch(t.tag){case 5:var n=t.stateNode;32&t.flags&&(Eu(n),t.flags&=-33),nb(e,Jg(e),n);break;case 3:case 4:var r=t.stateNode.containerInfo;tb(e,Jg(e),r);break;default:throw new Error("Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue.")}}function tb(e,t,n){var r=e.tag;if(5===r||6===r){var o=e.stateNode;t?function(e,t,n){8===e.nodeType?e.parentNode.insertBefore(t,n):e.insertBefore(t,n)}(n,o,t):function(e,t){var n;8===e.nodeType?(n=e.parentNode).insertBefore(t,e):(n=e).appendChild(t),null==e._reactRootContainer&&null===n.onclick&&ql(n)}(n,o)}else if(4===r);else{var a=e.child;if(null!==a){tb(a,t,n);for(var i=a.sibling;null!==i;)tb(i,t,n),i=i.sibling}}}function nb(e,t,n){var r=e.tag;if(5===r||6===r){var o=e.stateNode;t?function(e,t,n){e.insertBefore(t,n)}(n,o,t):function(e,t){e.appendChild(t)}(n,o)}else if(4===r);else{var a=e.child;if(null!==a){nb(a,t,n);for(var i=a.sibling;null!==i;)nb(i,t,n),i=i.sibling}}}var rb=null,ob=!1;function ab(e,t,n){var r,o,a=t;e:for(;null!==a;){switch(a.tag){case 5:rb=a.stateNode,ob=!1;break e;case 3:case 4:rb=a.stateNode.containerInfo,ob=!0;break e}a=a.return}if(null===rb)throw new Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.");sb(e,t,n),rb=null,ob=!1,null!==(o=(r=n).alternate)&&(o.return=null),r.return=null}function ib(e,t,n){for(var r=n.child;null!==r;)sb(e,t,r),r=r.sibling}function sb(e,t,n){switch(function(e){if(Wr&&"function"==typeof Wr.onCommitFiberUnmount)try{Wr.onCommitFiberUnmount(Gr,e)}catch(t){Kr||(Kr=!0,a("React instrumentation encountered an error: %s",t))}}(n),n.tag){case 5:$g||Fg(n,t);case 6:var r=rb,o=ob;return rb=null,ib(e,t,n),ob=o,void(null!==(rb=r)&&(ob?(x=rb,T=n.stateNode,8===x.nodeType?x.parentNode.removeChild(T):x.removeChild(T)):function(e,t){e.removeChild(t)}(rb,n.stateNode)));case h:return void(null!==rb&&(ob?function(e,t){8===e.nodeType?ku(e.parentNode,t):1===e.nodeType&&ku(e,t),ai(e)}(rb,n.stateNode):ku(rb,n.stateNode)));case 4:var i=rb,s=ob;return rb=n.stateNode.containerInfo,ob=!0,ib(e,t,n),rb=i,void(ob=s);case 0:case l:case d:case f:if(!$g){var u=n.updateQueue;if(null!==u){var c=u.lastEffect;if(null!==c){var p=c.next,m=p;do{var y=m,_=y.destroy,v=y.tag;void 0!==_&&(2&v?Bg(n,t,_):4&v&&(uo(n),2&n.mode?(Yh(),Bg(n,t,_),Gh(n)):Bg(n,t,_),co())),m=m.next}while(m!==p)}}}return void ib(e,t,n);case 1:if(!$g){Fg(n,t);var w=n.stateNode;"function"==typeof w.componentWillUnmount&&Lg(n,t,w)}return void ib(e,t,n);case g:return void ib(e,t,n);case b:if(1&n.mode){var S=$g;$g=S||null!==n.memoizedState,ib(e,t,n),$g=S}else ib(e,t,n);break;default:return void ib(e,t,n)}var x,T}function lb(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new Rg),t.forEach(function(t){var r=y_.bind(null,e,t);if(!n.has(t)){if(n.add(t),Xr){if(null===Cg||null===Dg)throw Error("Expected finished root and lanes to be set. This is a bug in React.");k_(Dg,Cg)}t.then(r,r)}})}}function ub(e,t,n){var r=t.deletions;if(null!==r)for(var o=0;o<r.length;o++){var a=r[o];try{ab(e,t,a)}catch(l){h_(a,t,l)}}var i=Be;if(t.subtreeFlags&_r)for(var s=t.child;null!==s;)qe(s),cb(s,e),s=s.sibling;qe(i)}function cb(e,t,n){var r=e.alternate,o=e.flags;switch(e.tag){case 0:case l:case d:case f:if(ub(t,e),db(e),4&o){try{qg(3,e,e.return),Gg(3,e)}catch($){h_(e,e.return,$)}if(2&e.mode){try{Yh(),qg(5,e,e.return)}catch($){h_(e,e.return,$)}Gh(e)}else try{qg(5,e,e.return)}catch($){h_(e,e.return,$)}}return;case 1:return ub(t,e),db(e),void(o&or&&null!==r&&Fg(r,r.return));case 5:if(ub(t,e),db(e),o&or&&null!==r&&Fg(r,r.return),32&e.flags){var a=e.stateNode;try{Eu(a)}catch($){h_(e,e.return,$)}}if(4&o){var i=e.stateNode;if(null!=i){var s=e.memoizedProps,u=null!==r?r.memoizedProps:s,p=e.type,h=e.updateQueue;if(e.updateQueue=null,null!==h)try{!function(e,t,n,r,o){Yl(e,t,n,r,o),Zu(e,o)}(i,h,p,u,s)}catch($){h_(e,e.return,$)}}}return;case 6:if(ub(t,e),db(e),4&o){if(null===e.stateNode)throw new Error("This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue.");var _=e.stateNode,v=e.memoizedProps;null!==r&&r.memoizedProps;try{!function(e,t,n){e.nodeValue=n}(_,0,v)}catch($){h_(e,e.return,$)}}return;case 3:if(ub(t,e),db(e),4&o)if(null!==r)if(r.memoizedState.isDehydrated)try{ai(t.containerInfo)}catch($){h_(e,e.return,$)}return;case 4:return ub(t,e),void db(e);case c:ub(t,e),db(e);var w=e.child;if(w.flags&lr){var S=w.stateNode,x=null!==w.memoizedState;if(S.isHidden=x,x)null!==w.alternate&&null!==w.alternate.memoizedState||(cy=Lr())}if(4&o){try{!function(e){e.memoizedState}(e)}catch($){h_(e,e.return,$)}lb(e)}return;case b:var T=null!==r&&null!==r.memoizedState;if(1&e.mode){var E=$g;$g=E||T,ub(t,e),$g=E}else ub(t,e);if(db(e),o&lr){var k=e.stateNode,P=null!==e.memoizedState,O=e;if(k.isHidden=P,P&&!T&&1&O.mode){Ig=O;for(var A=O.child;null!==A;)Ig=A,mb(A),A=A.sibling}!function(e,t){for(var n=null,r=e;;){if(5===r.tag){if(null===n){n=r;try{var o=r.stateNode;t?Pu(o):Au(r.stateNode,r.memoizedProps)}catch($){h_(e,e.return,$)}}}else if(6===r.tag){if(null===n)try{var a=r.stateNode;t?Ou(a):$u(a,r.memoizedProps)}catch($){h_(e,e.return,$)}}else if((r.tag!==b&&r.tag!==y||null===r.memoizedState||r===e)&&null!==r.child){r.child.return=r,r=r.child;continue}if(r===e)return;for(;null===r.sibling;){if(null===r.return||r.return===e)return;n===r&&(n=null),r=r.return}n===r&&(n=null),r.sibling.return=r.return,r=r.sibling}}(O,P)}return;case m:return ub(t,e),db(e),void(4&o&&lb(e));case g:return;default:return ub(t,e),void db(e)}}function db(e){var t=e.flags;if(2&t){try{eb(e)}catch(n){h_(e,e.return,n)}e.flags&=-3}t&sr&&(e.flags&=-4097)}function fb(e,t,n){Cg=n,Dg=t,Ig=e,pb(e,t,n),Cg=null,Dg=null}function pb(e,t,n){for(var r=!!(1&e.mode);null!==Ig;){var o=Ig,a=o.child;if(o.tag===b&&r){var i=null!==o.memoizedState||Ag;if(i){hb(e,t,n);continue}var s=o.alternate,l=null!==s&&null!==s.memoizedState,u=Ag,c=$g;Ag=i,($g=l||$g)&&!c&&(Ig=o,bb(o));for(var d=a;null!==d;)Ig=d,pb(d,t,n),d=d.sibling;Ig=o,Ag=u,$g=c,hb(e,t,n)}else 0!==(o.subtreeFlags&vr)&&null!==a?(a.return=o,Ig=a):hb(e,t,n)}}function hb(e,t,n){for(;null!==Ig;){var r=Ig;if(0!==(r.flags&vr)){var o=r.alternate;qe(r);try{Yg(0,o,r)}catch(i){h_(r,r.return,i)}He()}if(r===e)return void(Ig=null);var a=r.sibling;if(null!==a)return a.return=r.return,void(Ig=a);Ig=r.return}}function mb(e){for(;null!==Ig;){var t=Ig,n=t.child;switch(t.tag){case 0:case l:case d:case f:if(2&t.mode)try{Yh(),qg(4,t,t.return)}finally{Gh(t)}else qg(4,t,t.return);break;case 1:Fg(t,t.return);var r=t.stateNode;"function"==typeof r.componentWillUnmount&&Lg(t,t.return,r);break;case 5:Fg(t,t.return);break;case b:if(null!==t.memoizedState){gb(e);continue}}null!==n?(n.return=t,Ig=n):gb(e)}}function gb(e){for(;null!==Ig;){var t=Ig;if(t===e)return void(Ig=null);var n=t.sibling;if(null!==n)return n.return=t.return,void(Ig=n);Ig=t.return}}function bb(e){for(;null!==Ig;){var t=Ig,n=t.child;if(t.tag===b)if(null!==t.memoizedState){yb(e);continue}null!==n?(n.return=t,Ig=n):yb(e)}}function yb(e){for(;null!==Ig;){var t=Ig;qe(t);try{Kg(t)}catch(r){h_(t,t.return,r)}if(He(),t===e)return void(Ig=null);var n=t.sibling;if(null!==n)return n.return=t.return,void(Ig=n);Ig=t.return}}function _b(e,t,n,r){Ig=t,function(e,t,n,r){for(;null!==Ig;){var o=Ig,a=o.child;0!==(o.subtreeFlags&wr)&&null!==a?(a.return=o,Ig=a):vb(e,t,n,r)}}(t,e,n,r)}function vb(e,t,n,r){for(;null!==Ig;){var o=Ig;if(0!==(o.flags&ir)){qe(o);try{wb(t,o,n,r)}catch(i){h_(o,o.return,i)}He()}if(o===e)return void(Ig=null);var a=o.sibling;if(null!==a)return a.return=o.return,void(Ig=a);Ig=o.return}}function wb(e,t,n,r){switch(t.tag){case 0:case l:case f:if(2&t.mode){Kh();try{Gg(9,t)}finally{Wh(t)}}else Gg(9,t)}}function Sb(e){Ig=e,function(){for(;null!==Ig;){var e=Ig,t=e.child;if(0!==(Ig.flags&tr)){var n=e.deletions;if(null!==n){for(var r=0;r<n.length;r++){var o=n[r];Ig=o,Eb(o,e)}var a=e.alternate;if(null!==a){var i=a.child;if(null!==i){a.child=null;do{var s=i.sibling;i.sibling=null,i=s}while(null!==i)}}Ig=e}}0!==(e.subtreeFlags&wr)&&null!==t?(t.return=e,Ig=t):xb()}}()}function xb(){for(;null!==Ig;){var e=Ig;0!==(e.flags&ir)&&(qe(e),Tb(e),He());var t=e.sibling;if(null!==t)return t.return=e.return,void(Ig=t);Ig=e.return}}function Tb(e){switch(e.tag){case 0:case l:case f:2&e.mode?(Kh(),qg(9,e,e.return),Wh(e)):qg(9,e,e.return)}}function Eb(e,t){for(;null!==Ig;){var n=Ig;qe(n),Pb(n,t),He();var r=n.child;null!==r?(r.return=n,Ig=r):kb(e)}}function kb(e){for(;null!==Ig;){var t=Ig,n=t.sibling,r=t.return;if(Qg(t),t===e)return void(Ig=null);if(null!==n)return n.return=r,void(Ig=n);Ig=r}}function Pb(e,t){switch(e.tag){case 0:case l:case f:2&e.mode?(Kh(),qg(8,e,t),Wh(e)):qg(8,e,t)}}function Ob(e){switch(e.tag){case 0:case l:case f:try{Gg(5,e)}catch(n){h_(e,e.return,n)}break;case 1:var t=e.stateNode;try{t.componentDidMount()}catch(n){h_(e,e.return,n)}}}function Ab(e){switch(e.tag){case 0:case l:case f:try{Gg(9,e)}catch(t){h_(e,e.return,t)}}}function $b(e){switch(e.tag){case 0:case l:case f:try{qg(5,e,e.return)}catch(n){h_(e,e.return,n)}break;case 1:var t=e.stateNode;"function"==typeof t.componentWillUnmount&&Lg(e,e.return,t)}}function Rb(e){switch(e.tag){case 0:case l:case f:try{qg(9,e,e.return)}catch(t){h_(e,e.return,t)}}}if("function"==typeof Symbol&&Symbol.for){var Ib=Symbol.for;Ib("selector.component"),Ib("selector.has_pseudo_class"),Ib("selector.role"),Ib("selector.test_id"),Ib("selector.text")}var Cb=[];var Db=n.ReactCurrentActQueue;function Nb(){var e="undefined"!=typeof IS_REACT_ACT_ENVIRONMENT?IS_REACT_ACT_ENVIRONMENT:void 0;return e||null===Db.current||a("The current testing environment is not configured to support act(...)"),e}var Mb=Math.ceil,Lb=n.ReactCurrentDispatcher,jb=n.ReactCurrentOwner,Fb=n.ReactCurrentBatchConfig,Bb=n.ReactCurrentActQueue,Ub=0,zb=2,Vb=4,Hb=0,qb=1,Gb=2,Wb=3,Yb=4,Kb=5,Xb=6,Qb=Ub,Zb=null,Jb=null,ey=0,ty=0,ny=sc(0),ry=Hb,oy=null,ay=0,iy=0,sy=0,ly=null,uy=null,cy=0,dy=500,fy=1/0,py=500,hy=null;function my(){fy=Lr()+py}function gy(){return fy}var by=!1,yy=null,_y=null,vy=!1,wy=null,Sy=0,xy=[],Ty=null,Ey=50,ky=0,Py=null,Oy=!1,Ay=!1,$y=50,Ry=0,Iy=null,Cy=ea,Dy=0,Ny=!1;function My(){return Zb}function Ly(){return(Qb&(zb|Vb))!==Ub?Lr():Cy!==ea?Cy:Cy=Lr()}function jy(e){if(!(1&e.mode))return So;if((Qb&zb)!==Ub&&0!==ey)return pa(ey);if(null!==vd.transition){if(null!==Fb.transition){var t=Fb.transition;t._updatedFibers||(t._updatedFibers=new Set),t._updatedFibers.add(e)}return 0===Dy&&(Dy=da()),Dy}var n,r=La();return 0!==r?r:void 0===(n=window.event)?Da:hi(n.type)}function Fy(e){var t;return 1&e.mode?(t=na,!((na<<=1)&Uo)&&(na=zo),t):So}function By(e,t,n,r){!function(){if(ky>Ey)throw ky=0,Py=null,new Error("Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.");Ry>$y&&(Ry=0,Iy=null,a("Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render."))}(),Ny&&a("useInsertionEffect must not schedule updates."),Oy&&(Ay=!0),Sa(e,n,r),0!==(Qb&zb)&&e===Zb?function(e){if(Ue&&!hh)switch(e.tag){case 0:case l:case f:var t=Jb&&je(Jb)||"Unknown",n=t;if(!T_.has(n))T_.add(n),a("Cannot update a component (`%s`) while rendering a different component (`%s`). To locate the bad setState() call inside `%s`, follow the stack trace as described in https://reactjs.org/link/setstate-in-render",je(e)||"Unknown",t,t);break;case 1:E_||(a("Cannot update during an existing state transition (such as within `render`). Render methods should be a pure function of props and state."),E_=!0)}}(t):(Xr&&Ea(e,t,n),function(e){if(1&e.mode){if(!Nb())return}else{if(t="undefined"!=typeof IS_REACT_ACT_ENVIRONMENT?IS_REACT_ACT_ENVIRONMENT:void 0,"undefined"==typeof jest||!1===t)return;if(Qb!==Ub)return;if(0!==e.tag&&e.tag!==l&&e.tag!==f)return}var t;if(null===Bb.current){var n=Be;try{qe(e),a("An update to %s inside a test was not wrapped in act(...).\n\nWhen testing, code that causes React state updates should be wrapped into act(...):\n\nact(() => {\n /* fire events that update state */\n});\n/* assert on the output */\n\nThis ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act",je(e))}finally{n?qe(e):He()}}}(t),e===Zb&&((Qb&zb)===Ub&&(iy=ya(iy,n)),ry===Yb&&qy(e,ey)),Uy(e,r),n!==So||Qb!==Ub||1&t.mode||Bb.isBatchingLegacy||(my(),$c()))}function Uy(e,t){var n=e.callbackNode;!function(e,t){for(var n=e.pendingLanes,r=e.suspendedLanes,o=e.pingedLanes,a=e.expirationTimes,i=n;i>0;){var s=ha(i),l=1<<s,u=a[s];u===ea?0!==(l&r)&&0===(l&o)||(a[s]=aa(l,t)):u<=t&&(e.expiredLanes|=l),i&=~l}}(e,t);var r=oa(e,e===Zb?ey:0);if(0===r)return null!==n&&A_(n),e.callbackNode=null,void(e.callbackPriority=0);var o=fa(r),i=e.callbackPriority;if(i!==o||null!==Bb.current&&n!==P_){var s,l;if(null!=n&&A_(n),o===So)0===e.tag?(null!==Bb.isBatchingLegacy&&(Bb.didScheduleLegacyUpdate=!0),l=Gy.bind(null,e),Pc=!0,Ac(l)):Ac(Gy.bind(null,e)),null!==Bb.current?Bb.current.push(Rc):xu(function(){(Qb&(zb|Vb))===Ub&&Rc()}),s=null;else{var u;switch(Ba(r)){case Ia:u=Fr;break;case Ca:u=Br;break;case Da:u=Ur;break;case Na:u=Vr;break;default:u=Ur}s=O_(u,zy.bind(null,e))}e.callbackPriority=o,e.callbackNode=s}else null==n&&i!==So&&a("Expected scheduled callback to exist. This error is likely caused by a bug in React. Please file an issue.")}function zy(e,t){if(jh=!1,Fh=!1,Cy=ea,Dy=0,(Qb&(zb|Vb))!==Ub)throw new Error("Should not already be working.");var n=e.callbackNode;if(c_()&&e.callbackNode!==n)return null;var r=oa(e,e===Zb?ey:0);if(0===r)return null;var o=!ua(0,r)&&!function(e,t){return 0!==(t&e.expiredLanes)}(e,r)&&!t,a=o?function(e,t){var n=Qb;Qb|=zb;var r=e_();if(Zb!==e||ey!==t){if(Xr){var o=e.memoizedUpdaters;o.size>0&&(k_(e,ey),o.clear()),ka(e,t)}hy=null,my(),Zy(e,t)}ho(t);for(;;)try{i_();break}catch(a){Jy(e,a)}return Zd(),t_(r),Qb=n,null!==Jb?(null!==Yr&&"function"==typeof Yr.markRenderYielded&&Yr.markRenderYielded(),Hb):(mo(),Zb=null,ey=0,ry)}(e,r):o_(e,r);if(a!==Hb){if(a===Gb){var i=ia(e);0!==i&&(r=i,a=Vy(e,i))}if(a===qb){var s=oy;throw Zy(e,0),qy(e,r),Uy(e,Lr()),s}if(a===Xb)qy(e,r);else{var l=!ua(0,r),u=e.current.alternate;if(l&&!function(e){var t=e;for(;;){if(t.flags&ur){var n=t.updateQueue;if(null!==n){var r=n.stores;if(null!==r)for(var o=0;o<r.length;o++){var a=r[o],i=a.getSnapshot,s=a.value;try{if(!Os(i(),s))return!1}catch(u){return!1}}}}var l=t.child;if(t.subtreeFlags&ur&&null!==l)l.return=t,t=l;else{if(t===e)return!0;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}(u)){if((a=o_(e,r))===Gb){var c=ia(e);0!==c&&(r=c,a=Vy(e,c))}if(a===qb){var d=oy;throw Zy(e,0),qy(e,r),Uy(e,Lr()),d}}e.finishedWork=u,e.finishedLanes=r,function(e,t,n){switch(t){case Hb:case qb:throw new Error("Root did not complete. This is a bug in React.");case Gb:u_(e,uy,hy);break;case Wb:if(qy(e,n),la(n)&&!$_()){var r=cy+dy-Lr();if(r>10){if(0!==oa(e,0))break;var o=e.suspendedLanes;if(!ba(o,n)){Ly(),xa(e,o);break}e.timeoutHandle=vu(u_.bind(null,e,uy,hy),r);break}}u_(e,uy,hy);break;case Yb:if(qy(e,n),function(e){return(e&Oo)===e}(n))break;if(!$_()){var a=function(e,t){for(var n=e.eventTimes,r=ea;t>0;){var o=ha(t),a=1<<o,i=n[o];i>r&&(r=i),t&=~a}return r}(e,n),i=a,s=Lr()-i,l=((u=s)<120?120:u<480?480:u<1080?1080:u<1920?1920:u<3e3?3e3:u<4320?4320:1960*Mb(u/1960))-s;if(l>10){e.timeoutHandle=vu(u_.bind(null,e,uy,hy),l);break}}u_(e,uy,hy);break;case Kb:u_(e,uy,hy);break;default:throw new Error("Unknown root exit status.")}var u}(e,a,r)}}return Uy(e,Lr()),e.callbackNode===n?zy.bind(null,e):null}function Vy(e,t){var n=ly;Ua(e)&&(Zy(e,t).flags|=rr,a("An error occurred during hydration. The server HTML was replaced with client content in <%s>.",e.containerInfo.nodeName.toLowerCase()));var r=o_(e,t);if(r!==Gb){var o=uy;uy=n,null!==o&&Hy(o)}return r}function Hy(e){null===uy?uy=e:uy.push.apply(uy,e)}function qy(e,t){t=_a(t,sy),function(e,t){e.suspendedLanes|=t,e.pingedLanes&=~t;for(var n=e.expirationTimes,r=t;r>0;){var o=ha(r),a=1<<o;n[o]=ea,r&=~a}}(e,t=_a(t,iy))}function Gy(e){if(jh=Fh,Fh=!1,(Qb&(zb|Vb))!==Ub)throw new Error("Should not already be working.");c_();var t=oa(e,0);if(!ga(t,So))return Uy(e,Lr()),null;var n=o_(e,t);if(0!==e.tag&&n===Gb){var r=ia(e);0!==r&&(t=r,n=Vy(e,r))}if(n===qb){var o=oy;throw Zy(e,0),qy(e,t),Uy(e,Lr()),o}if(n===Xb)throw new Error("Root did not complete. This is a bug in React.");var a=e.current.alternate;return e.finishedWork=a,e.finishedLanes=t,u_(e,uy,hy),Uy(e,Lr()),null}function Wy(e,t){var n=Qb;Qb|=1;try{return e(t)}finally{(Qb=n)!==Ub||Bb.isBatchingLegacy||(my(),$c())}}function Yy(e){null!==wy&&0===wy.tag&&(Qb&(zb|Vb))===Ub&&c_();var t=Qb;Qb|=1;var n=Fb.transition,r=La();try{return Fb.transition=null,ja(Ia),e?e():void 0}finally{ja(r),Fb.transition=n,((Qb=t)&(zb|Vb))===Ub&&Rc()}}function Ky(){return(Qb&(zb|Vb))!==Ub}function Xy(e,t){uc(ny,ty,e),ty=ya(ty,t)}function Qy(e){ty=ny.current,lc(ny,e)}function Zy(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,wu(n)),null!==Jb)for(var r=Jb.return;null!==r;){r.alternate;Pg(0,r),r=r.return}Zb=e;var o=K_(e.current,null);return Jb=o,ey=ty=t,ry=Hb,oy=null,ay=0,iy=0,sy=0,ly=null,uy=null,function(){if(null!==lf){for(var e=0;e<lf.length;e++){var t=lf[e],n=t.interleaved;if(null!==n){t.interleaved=null;var r=n.next,o=t.pending;if(null!==o){var a=o.next;o.next=r,n.next=a}t.pending=n}}lf=null}}(),wd.discardPendingWarnings(),o}function Jy(e,t){for(;;){var n=Jb;try{if(Zd(),xp(),He(),jb.current=null,null===n||null===n.return)return ry=qb,oy=t,void(Jb=null);2&n.mode&&qh(n,!0),no(),null!==t&&"object"==typeof t&&"function"==typeof t.then?po(n,t,ey):fo(n,t,ey),Pm(e,n.return,n,t,ey),l_(n)}catch(r){t=r,Jb===n&&null!==n?(n=n.return,Jb=n):n=Jb;continue}return}}function e_(){var e=Lb.current;return Lb.current=xh,null===e?xh:e}function t_(e){Lb.current=e}function n_(e){ay=ya(e,ay)}function r_(){ry!==Hb&&ry!==Wb&&ry!==Gb||(ry=Yb),null!==Zb&&(sa(ay)||sa(iy))&&qy(Zb,ey)}function o_(e,t){var n=Qb;Qb|=zb;var r=e_();if(Zb!==e||ey!==t){if(Xr){var o=e.memoizedUpdaters;o.size>0&&(k_(e,ey),o.clear()),ka(e,t)}hy=null,Zy(e,t)}for(ho(t);;)try{a_();break}catch(a){Jy(e,a)}if(Zd(),Qb=n,t_(r),null!==Jb)throw new Error("Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue.");return mo(),Zb=null,ey=0,ry}function a_(){for(;null!==Jb;)s_(Jb)}function i_(){for(;null!==Jb&&!Nr();)s_(Jb)}function s_(e){var t,n=e.alternate;qe(e),2&e.mode?(Vh(e),t=w_(n,e,ty),qh(e,!0)):t=w_(n,e,ty),He(),e.memoizedProps=e.pendingProps,null===t?l_(e):Jb=t,jb.current=null}function l_(e){var t=e;do{var n=t.alternate,r=t.return;if(0===(t.flags&cr)){qe(t);var o=void 0;if(2&t.mode?(Vh(t),o=Eg(n,t,ty),qh(t,!1)):o=Eg(n,t,ty),He(),null!==o)return void(Jb=o)}else{var a=kg(0,t);if(null!==a)return a.flags&=32767,void(Jb=a);if(2&t.mode){qh(t,!1);for(var i=t.actualDuration,s=t.child;null!==s;)i+=s.actualDuration,s=s.sibling;t.actualDuration=i}if(null===r)return ry=Xb,void(Jb=null);r.flags|=cr,r.subtreeFlags=0,r.deletions=null}var l=t.sibling;if(null!==l)return void(Jb=l);Jb=t=r}while(null!==t);ry===Hb&&(ry=Kb)}function u_(e,t,n){var r=La(),o=Fb.transition;try{Fb.transition=null,ja(Ia),function(e,t,n,r){do{c_()}while(null!==wy);if(function(){wd.flushLegacyContextWarning(),wd.flushPendingUnsafeLifecycleWarnings()}(),(Qb&(zb|Vb))!==Ub)throw new Error("Should not already be working.");var o=e.finishedWork,i=e.finishedLanes;if(function(e){null!==Yr&&"function"==typeof Yr.markCommitStarted&&Yr.markCommitStarted(e)}(i),null===o)return eo(),null;0===i&&a("root.finishedLanes should not be empty during a commit. This is a bug in React.");if(e.finishedWork=null,e.finishedLanes=0,o===e.current)throw new Error("Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue.");e.callbackNode=null,e.callbackPriority=0;var s=ya(o.lanes,o.childLanes);(function(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t;for(var r=e.entanglements,o=e.eventTimes,a=e.expirationTimes,i=n;i>0;){var s=ha(i),l=1<<s;r[s]=0,o[s]=ea,a[s]=ea,i&=~l}})(e,s),e===Zb&&(Zb=null,Jb=null,ey=0);0===(o.subtreeFlags&wr)&&0===(o.flags&wr)||vy||(vy=!0,Ty=n,O_(Ur,function(){return c_(),null}));var l=!!(15990&o.subtreeFlags),u=!!(15990&o.flags);if(l||u){var c=Fb.transition;Fb.transition=null;var d=La();ja(Ia);var f=Qb;Qb|=Vb,jb.current=null,zg(e,o),zh(),function(e,t,n){Cg=n,Dg=e,qe(t),cb(t,e),qe(t),Cg=null,Dg=null}(e,o,i),e.containerInfo,Bs(hu),li(pu),pu=null,hu=null,e.current=o,function(e){null!==Yr&&"function"==typeof Yr.markLayoutEffectsStarted&&Yr.markLayoutEffectsStarted(e)}(i),fb(o,e,i),null!==Yr&&"function"==typeof Yr.markLayoutEffectsStopped&&Yr.markLayoutEffectsStopped(),Mr(),Qb=f,ja(d),Fb.transition=c}else e.current=o,zh();var p=vy;vy?(vy=!1,wy=e,Sy=i):(Ry=0,Iy=null);s=e.pendingLanes,0===s&&(_y=null);p||__(e.current,!1);(function(e,t){if(Wr&&"function"==typeof Wr.onCommitFiberRoot)try{var n,r=(e.current.flags&nr)===nr;switch(t){case Ia:n=Fr;break;case Ca:n=Br;break;case Da:n=Ur;break;case Na:n=Vr;break;default:n=Ur}Wr.onCommitFiberRoot(Gr,e,n,r)}catch(o){Kr||(Kr=!0,a("React instrumentation encountered an error: %s",o))}})(o.stateNode,r),Xr&&e.memoizedUpdaters.clear();if(function(){Cb.forEach(function(e){return e()})}(),Uy(e,Lr()),null!==t)for(var h=e.onRecoverableError,m=0;m<t.length;m++){var g=t[m],b=g.stack,y=g.digest;h(g.value,{componentStack:b,digest:y})}if(by){by=!1;var _=yy;throw yy=null,_}ga(Sy,So)&&0!==e.tag&&c_();s=e.pendingLanes,ga(s,So)?(Fh=!0,e===Py?ky++:(ky=0,Py=e)):ky=0;Rc(),eo()}(e,t,n,r)}finally{Fb.transition=o,ja(r)}return null}function c_(){if(null!==wy){var e=Ba(Sy),t=(o=Da)>(i=e)?o:i,n=Fb.transition,r=La();try{return Fb.transition=null,ja(t),function(){if(null===wy)return!1;var e=Ty;Ty=null;var t=wy,n=Sy;if(wy=null,Sy=0,(Qb&(zb|Vb))!==Ub)throw new Error("Cannot flush passive effects while already rendering.");Oy=!0,Ay=!1,function(e){null!==Yr&&"function"==typeof Yr.markPassiveEffectsStarted&&Yr.markPassiveEffectsStarted(e)}(n);var r=Qb;Qb|=Vb,Sb(t.current),_b(t,t.current,n,e);var o=xy;xy=[];for(var i=0;i<o.length;i++){Wg(0,o[i])}void(null!==Yr&&"function"==typeof Yr.markPassiveEffectsStopped&&Yr.markPassiveEffectsStopped()),__(t.current,!0),Qb=r,Rc(),Ay?t===Iy?Ry++:(Ry=0,Iy=t):Ry=0;Oy=!1,Ay=!1,function(e){if(Wr&&"function"==typeof Wr.onPostCommitFiberRoot)try{Wr.onPostCommitFiberRoot(Gr,e)}catch(t){Kr||(Kr=!0,a("React instrumentation encountered an error: %s",t))}}(t);var s=t.current.stateNode;return s.effectDuration=0,s.passiveEffectDuration=0,!0}()}finally{ja(r),Fb.transition=n}}var o,i;return!1}function d_(e){return null!==_y&&_y.has(e)}var f_=function(e){by||(by=!0,yy=e)};function p_(e,t,n){var r=Sf(e,Sm(e,ym(n,t),So),So),o=Ly();null!==r&&(Sa(r,So,o),Uy(r,o))}function h_(e,t,n){var r;if(r=n,Zn(null,function(){throw r}),Jn(),R_(!1),3!==e.tag){var o=null;for(o=t;null!==o;){if(3===o.tag)return void p_(o,e,n);if(1===o.tag){var i=o.type,s=o.stateNode;if("function"==typeof i.getDerivedStateFromError||"function"==typeof s.componentDidCatch&&!d_(s)){var l=Sf(o,xm(o,ym(n,e),So),So),u=Ly();return void(null!==l&&(Sa(l,So,u),Uy(l,u)))}}o=o.return}a("Internal React error: Attempted to capture a commit phase error inside a detached tree. This indicates a bug in React. Likely causes include deleting the same fiber more than once, committing an already-finished tree, or an inconsistent return pointer.\n\nError message:\n\n%s",n)}else p_(e,e,n)}function m_(e,t,n){var r=e.pingCache;null!==r&&r.delete(t);var o=Ly();xa(e,n),function(e){0!==e.tag&&Nb()&&null===Bb.current&&a("A suspended resource finished loading inside a test, but the event was not wrapped in act(...).\n\nWhen testing, code that resolves suspended data should be wrapped into act(...):\n\nact(() => {\n /* finish loading suspended data */\n});\n/* assert on the output */\n\nThis ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act")}(e),Zb===e&&ba(ey,n)&&(ry===Yb||ry===Wb&&la(ey)&&Lr()-cy<dy?Zy(e,0):sy=ya(sy,n)),Uy(e,o)}function g_(e,t){0===t&&(t=Fy(e));var n=Ly(),r=df(e,t);null!==r&&(Sa(r,t,n),Uy(r,n))}function b_(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),g_(e,n)}function y_(e,t){var n,r=0;switch(e.tag){case c:n=e.stateNode;var o=e.memoizedState;null!==o&&(r=o.retryLane);break;case m:n=e.stateNode;break;default:throw new Error("Pinged unknown suspense boundary type. This is probably a bug in React.")}null!==n&&n.delete(t),g_(e,r)}function __(e,t){qe(e),v_(e,gr,$b),t&&v_(e,br,Rb),v_(e,gr,Ob),t&&v_(e,br,Ab),He()}function v_(e,t,n){for(var r=e,o=null;null!==r;){var a=r.subtreeFlags&t;r!==o&&null!==r.child&&0!==a?r=r.child:(0!==(r.flags&t)&&n(r),r=null!==r.sibling?r.sibling:o=r.return)}}var w_,S_=null;function x_(e){if((Qb&zb)===Ub&&1&e.mode){var t=e.tag;if(2===t||3===t||1===t||0===t||t===l||t===d||t===f){var n=je(e)||"ReactComponent";if(null!==S_){if(S_.has(n))return;S_.add(n)}else S_=new Set([n]);var r=Be;try{qe(e),a("Can't perform a React state update on a component that hasn't mounted yet. This indicates that you have a side-effect in your render function that asynchronously later calls tries to update the component. Move this work to useEffect instead.")}finally{r?qe(e):He()}}}}w_=function(e,t,n){var r=rv(null,t);try{return _g(e,t,n)}catch(a){if(Qc||null!==a&&"object"==typeof a&&"function"==typeof a.then)throw a;if(Zd(),xp(),Pg(0,t),rv(t,r),2&t.mode&&Vh(t),Zn(null,_g,null,e,t,n),Wn){var o=Jn();"object"==typeof o&&null!==o&&o._suppressLogging&&"object"==typeof a&&null!==a&&!a._suppressLogging&&(a._suppressLogging=!0)}throw a}};var T_,E_=!1;function k_(e,t){Xr&&e.memoizedUpdaters.forEach(function(n){Ea(e,n,t)})}T_=new Set;var P_={};function O_(e,t){var n=Bb.current;return null!==n?(n.push(t),P_):Cr(e,t)}function A_(e){if(e!==P_)return Dr(e)}function $_(){return null!==Bb.current}function R_(e){Ny=e}var I_=null,C_=null,D_=function(e){I_=e};function N_(e){if(null===I_)return e;var t=I_(e);return void 0===t?e:t.current}function M_(e){return N_(e)}function L_(e){if(null===I_)return e;var t=I_(e);if(void 0===t){if(null!=e&&"function"==typeof e.render){var n=N_(e.render);if(e.render!==n){var r={$$typeof:ie,render:n};return void 0!==e.displayName&&(r.displayName=e.displayName),r}}return e}return t.current}function j_(e,t){if(null===I_)return!1;var n=e.elementType,r=t.type,o=!1,a="object"==typeof r&&null!==r?r.$$typeof:null;switch(e.tag){case 1:"function"==typeof r&&(o=!0);break;case 0:("function"==typeof r||a===ce)&&(o=!0);break;case l:(a===ie||a===ce)&&(o=!0);break;case d:case f:(a===ue||a===ce)&&(o=!0);break;default:return!1}if(o){var i=I_(n);if(void 0!==i&&i===I_(r))return!0}return!1}function F_(e){null!==I_&&"function"==typeof WeakSet&&(null===C_&&(C_=new WeakSet),C_.add(e))}var B_=function(e,t){if(null!==I_){var n=t.staleFamilies,r=t.updatedFamilies;c_(),Yy(function(){z_(e.current,r,n)})}},U_=function(e,t){e.context===cc&&(c_(),Yy(function(){pv(t,e,null,null)}))};function z_(e,t,n){var r=e.alternate,o=e.child,a=e.sibling,i=e.tag,s=e.type,u=null;switch(i){case 0:case f:case 1:u=s;break;case l:u=s.render}if(null===I_)throw new Error("Expected resolveFamily to be set during hot reload.");var c=!1,d=!1;if(null!==u){var p=I_(u);void 0!==p&&(n.has(p)?d=!0:t.has(p)&&(1===i?d=!0:c=!0))}if(null!==C_&&(C_.has(e)||null!==r&&C_.has(r))&&(d=!0),d&&(e._debugNeedsRemount=!0),d||c){var h=df(e,So);null!==h&&By(h,e,So,ea)}null===o||d||z_(o,t,n),null!==a&&z_(a,t,n)}var V_,H_=function(e,t){var n=new Set,r=new Set(t.map(function(e){return e.current}));return q_(e.current,r,n),n};function q_(e,t,n){var r=e.child,o=e.sibling,a=e.tag,i=e.type,s=null;switch(a){case 0:case f:case 1:s=i;break;case l:s=i.render}var u=!1;null!==s&&t.has(s)&&(u=!0),u?function(e,t){var n=function(e,t){var n=e,r=!1;for(;;){if(5===n.tag)r=!0,t.add(n.stateNode);else if(null!==n.child){n.child.return=n,n=n.child;continue}if(n===e)return r;for(;null===n.sibling;){if(null===n.return||n.return===e)return r;n=n.return}n.sibling.return=n.return,n=n.sibling}return!1}(e,t);if(n)return;var r=e;for(;;){switch(r.tag){case 5:return void t.add(r.stateNode);case 4:case 3:return void t.add(r.stateNode.containerInfo)}if(null===r.return)throw new Error("Expected to reach root first.");r=r.return}}(e,n):null!==r&&q_(r,t,n),null!==o&&q_(o,t,n)}V_=!1;try{Object.preventExtensions({})}catch(rw){V_=!0}function G_(e,t,n,r){this.tag=e,this.key=n,this.elementType=null,this.type=null,this.stateNode=null,this.return=null,this.child=null,this.sibling=null,this.index=0,this.ref=null,this.pendingProps=t,this.memoizedProps=null,this.updateQueue=null,this.memoizedState=null,this.dependencies=null,this.mode=r,this.flags=0,this.subtreeFlags=0,this.deletions=null,this.lanes=0,this.childLanes=0,this.alternate=null,this.actualDuration=Number.NaN,this.actualStartTime=Number.NaN,this.selfBaseDuration=Number.NaN,this.treeBaseDuration=Number.NaN,this.actualDuration=0,this.actualStartTime=-1,this.selfBaseDuration=0,this.treeBaseDuration=0,this._debugSource=null,this._debugOwner=null,this._debugNeedsRemount=!1,this._debugHookTypes=null,V_||"function"!=typeof Object.preventExtensions||Object.preventExtensions(this)}var W_=function(e,t,n,r){return new G_(e,t,n,r)};function Y_(e){var t=e.prototype;return!(!t||!t.isReactComponent)}function K_(e,t){var n=e.alternate;null===n?((n=W_(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n._debugSource=e._debugSource,n._debugOwner=e._debugOwner,n._debugHookTypes=e._debugHookTypes,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null,n.actualDuration=0,n.actualStartTime=-1),n.flags=e.flags&Sr,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue;var r=e.dependencies;switch(n.dependencies=null===r?null:{lanes:r.lanes,firstContext:r.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.selfBaseDuration=e.selfBaseDuration,n.treeBaseDuration=e.treeBaseDuration,n._debugNeedsRemount=e._debugNeedsRemount,n.tag){case 2:case 0:case f:n.type=N_(e.type);break;case 1:n.type=M_(e.type);break;case l:n.type=L_(e.type)}return n}function X_(e,t){e.flags&=14680066;var n=e.alternate;if(null===n)e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null,e.selfBaseDuration=0,e.treeBaseDuration=0;else{e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type;var r=n.dependencies;e.dependencies=null===r?null:{lanes:r.lanes,firstContext:r.firstContext},e.selfBaseDuration=n.selfBaseDuration,e.treeBaseDuration=n.treeBaseDuration}return e}function Q_(e,t,n,r,o,i){var f=2,p=e;if("function"==typeof e)Y_(e)?(f=1,p=M_(p)):p=N_(p);else if("string"==typeof e)f=5;else e:switch(e){case te:return J_(n.children,o,i,t);case ne:f=8,1&(o|=8)&&(o|=bo);break;case re:return function(e,t,n,r){"string"!=typeof e.id&&a('Profiler must specify an "id" of type `string` as a prop. Received the type `%s` instead.',typeof e.id);var o=W_(u,e,r,2|t);return o.elementType=re,o.lanes=n,o.stateNode={effectDuration:0,passiveEffectDuration:0},o}(n,o,i,t);case se:return function(e,t,n,r){var o=W_(c,e,r,t);return o.elementType=se,o.lanes=n,o}(n,o,i,t);case le:return function(e,t,n,r){var o=W_(m,e,r,t);return o.elementType=le,o.lanes=n,o}(n,o,i,t);case de:return ev(n,o,i,t);default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case oe:f=s;break e;case ae:f=9;break e;case ie:f=l,p=L_(p);break e;case ue:f=d;break e;case ce:f=16,p=null;break e}var h="";(void 0===e||"object"==typeof e&&null!==e&&0===Object.keys(e).length)&&(h+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var g=r?je(r):null;throw g&&(h+="\n\nCheck the render method of `"+g+"`."),new Error("Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: "+(null==e?e:typeof e)+"."+h)}var b=W_(f,n,t,o);return b.elementType=e,b.type=p,b.lanes=i,b._debugOwner=r,b}function Z_(e,t,n){var r;r=e._owner;var o=Q_(e.type,e.key,e.props,r,t,n);return o._debugSource=e._source,o._debugOwner=e._owner,o}function J_(e,t,n,r){var o=W_(7,e,r,t);return o.lanes=n,o}function ev(e,t,n,r){var o=W_(b,e,r,t);o.elementType=de,o.lanes=n;return o.stateNode={isHidden:!1},o}function tv(e,t,n){var r=W_(6,e,null,t);return r.lanes=n,r}function nv(e,t,n){var r=null!==e.children?e.children:[],o=W_(4,r,e.key,t);return o.lanes=n,o.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},o}function rv(e,t){return null===e&&(e=W_(2,null,null,0)),e.tag=t.tag,e.key=t.key,e.elementType=t.elementType,e.type=t.type,e.stateNode=t.stateNode,e.return=t.return,e.child=t.child,e.sibling=t.sibling,e.index=t.index,e.ref=t.ref,e.pendingProps=t.pendingProps,e.memoizedProps=t.memoizedProps,e.updateQueue=t.updateQueue,e.memoizedState=t.memoizedState,e.dependencies=t.dependencies,e.mode=t.mode,e.flags=t.flags,e.subtreeFlags=t.subtreeFlags,e.deletions=t.deletions,e.lanes=t.lanes,e.childLanes=t.childLanes,e.alternate=t.alternate,e.actualDuration=t.actualDuration,e.actualStartTime=t.actualStartTime,e.selfBaseDuration=t.selfBaseDuration,e.treeBaseDuration=t.treeBaseDuration,e._debugSource=t._debugSource,e._debugOwner=t._debugOwner,e._debugNeedsRemount=t._debugNeedsRemount,e._debugHookTypes=t._debugHookTypes,e}function ov(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.pendingChildren=null,this.current=null,this.pingCache=null,this.finishedWork=null,this.timeoutHandle=-1,this.context=null,this.pendingContext=null,this.callbackNode=null,this.callbackPriority=0,this.eventTimes=wa(0),this.expirationTimes=wa(ea),this.pendingLanes=0,this.suspendedLanes=0,this.pingedLanes=0,this.expiredLanes=0,this.mutableReadLanes=0,this.finishedLanes=0,this.entangledLanes=0,this.entanglements=wa(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null,this.effectDuration=0,this.passiveEffectDuration=0,this.memoizedUpdaters=new Set;for(var a=this.pendingUpdatersLaneMap=[],i=0;i<wo;i++)a.push(new Set);switch(t){case 1:this._debugRootType=n?"hydrateRoot()":"createRoot()";break;case 0:this._debugRootType=n?"hydrate()":"render()"}}function av(e,t,n,r,o,a,i,s,l,u){var c=new ov(e,t,n,s,l),d=function(e,t){var n;return 1===e?(n=1,!0===t&&(n|=8,n|=bo)):n=0,Xr&&(n|=2),W_(3,null,null,n)}(t,a);c.current=d,d.stateNode=c;var f={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null};return d.memoizedState=f,_f(d),c}var iv,sv,lv="18.3.1";function uv(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return function(e){if(A(e))a("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",O(e)),$(e)}(r),{$$typeof:ee,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}function cv(e){if(!e)return cc;var t=er(e),n=Ec(t);if(1===t.tag){var r=t.type;if(yc(r))return Sc(t,r,n)}return n}function dv(e,t,n,r,o,a,i,s){return av(e,t,!1,null,0,r,0,a,i)}function fv(e,t,n,r,o,a,i,s,l,u){var c=av(n,r,!0,e,0,a,0,s,l);c.context=cv(null);var d=c.current,f=Ly(),p=jy(d),h=wf(f,p);return h.callback=null!=t?t:null,Sf(d,h,p),function(e,t,n){e.current.lanes=t,Sa(e,t,n),Uy(e,n)}(c,p,f),c}function pv(e,t,n,r){!function(e,t){if(Wr&&"function"==typeof Wr.onScheduleFiberRoot)try{Wr.onScheduleFiberRoot(Gr,e,t)}catch(n){Kr||(Kr=!0,a("React instrumentation encountered an error: %s",n))}}(t,e);var o=t.current,i=Ly(),s=jy(o);!function(e){null!==Yr&&"function"==typeof Yr.markRenderScheduled&&Yr.markRenderScheduled(e)}(s);var l=cv(n);null===t.context?t.context=l:t.pendingContext=l,Ue&&null!==Be&&!iv&&(iv=!0,a("Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate.\n\nCheck the render method of %s.",je(Be)||"Unknown"));var u=wf(i,s);u.payload={element:e},null!==(r=void 0===r?null:r)&&("function"!=typeof r&&a("render(...): Expected the last optional `callback` argument to be a function. Instead received: %s.",r),u.callback=r);var c=Sf(o,u,s);return null!==c&&(By(c,o,s,i),xf(c,o,s)),s}function hv(e){var t=e.current;return t.child?(t.child.tag,t.child.stateNode):null}function mv(e,t){var n,r,o=e.memoizedState;null!==o&&null!==o.dehydrated&&(o.retryLane=(n=o.retryLane,r=t,0!==n&&n<r?n:r))}function gv(e,t){mv(e,t);var n=e.alternate;n&&mv(n,t)}function bv(e){var t=Rr(e);return null===t?null:t.stateNode}iv=!1,sv={};var yv=function(e){return null};var _v=function(e){return!1};var vv,wv,Sv,xv,Tv,Ev,kv,Pv,Ov,Av=function(e,t,n){var r=t[n],o=vt(e)?e.slice():we({},e);return n+1===t.length?(vt(o)?o.splice(r,1):delete o[r],o):(o[r]=Av(e[r],t,n+1),o)},$v=function(e,t){return Av(e,t,0)},Rv=function(e,t,n,r){var o=t[r],a=vt(e)?e.slice():we({},e);r+1===t.length?(a[n[r]]=a[o],vt(a)?a.splice(o,1):delete a[o]):a[o]=Rv(e[o],t,n,r+1);return a},Iv=function(e,t,n){if(t.length===n.length){for(var r=0;r<n.length-1;r++)if(t[r]!==n[r])return void o("copyWithRename() expects paths to be the same except for the deepest key");return Rv(e,t,n,0)}o("copyWithRename() expects paths of the same length")},Cv=function(e,t,n,r){if(n>=t.length)return r;var o=t[n],a=vt(e)?e.slice():we({},e);return a[o]=Cv(e[o],t,n+1,r),a},Dv=function(e,t,n){return Cv(e,t,0,n)},Nv=function(e,t){for(var n=e.memoizedState;null!==n&&t>0;)n=n.next,t--;return n};function Mv(e){var t=Ar(e);return null===t?null:t.stateNode}function Lv(e){return null}function jv(){return Be}vv=function(e,t,n,r){var o=Nv(e,t);if(null!==o){var a=Dv(o.memoizedState,n,r);o.memoizedState=a,o.baseState=a,e.memoizedProps=we({},e.memoizedProps);var i=df(e,So);null!==i&&By(i,e,So,ea)}},wv=function(e,t,n){var r=Nv(e,t);if(null!==r){var o=$v(r.memoizedState,n);r.memoizedState=o,r.baseState=o,e.memoizedProps=we({},e.memoizedProps);var a=df(e,So);null!==a&&By(a,e,So,ea)}},Sv=function(e,t,n,r){var o=Nv(e,t);if(null!==o){var a=Iv(o.memoizedState,n,r);o.memoizedState=a,o.baseState=a,e.memoizedProps=we({},e.memoizedProps);var i=df(e,So);null!==i&&By(i,e,So,ea)}},xv=function(e,t,n){e.pendingProps=Dv(e.memoizedProps,t,n),e.alternate&&(e.alternate.pendingProps=e.pendingProps);var r=df(e,So);null!==r&&By(r,e,So,ea)},Tv=function(e,t){e.pendingProps=$v(e.memoizedProps,t),e.alternate&&(e.alternate.pendingProps=e.pendingProps);var n=df(e,So);null!==n&&By(n,e,So,ea)},Ev=function(e,t,n){e.pendingProps=Iv(e.memoizedProps,t,n),e.alternate&&(e.alternate.pendingProps=e.pendingProps);var r=df(e,So);null!==r&&By(r,e,So,ea)},kv=function(e){var t=df(e,So);null!==t&&By(t,e,So,ea)},Pv=function(e){yv=e},Ov=function(e){_v=e};var Fv="function"==typeof reportError?reportError:function(e){console.error(e)};function Bv(e){this._internalRoot=e}function Uv(e){this._internalRoot=e}function zv(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}function Vv(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function Hv(e){1===e.nodeType&&e.tagName&&"BODY"===e.tagName.toUpperCase()&&a("createRoot(): Creating roots directly with document.body is discouraged, since its children are often manipulated by third-party scripts and browser extensions. This may lead to subtle reconciliation issues. Try using a container element created for your app."),Wu(e)&&(e._reactRootContainer?a("You are calling ReactDOMClient.createRoot() on a container that was previously passed to ReactDOM.render(). This is not supported."):a("You are calling ReactDOMClient.createRoot() on a container that has already been passed to createRoot() before. Instead, call root.render() on the existing root instead if you want to update it."))}Uv.prototype.render=Bv.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw new Error("Cannot update an unmounted root.");"function"==typeof arguments[1]?a("render(...): does not support the second callback argument. To execute a side effect after rendering, declare it in a component body with useEffect()."):zv(arguments[1])?a("You passed a container to the second argument of root.render(...). You don't need to pass it again since you already passed it to create the root."):void 0!==arguments[1]&&a("You passed a second argument to root.render(...) but it only accepts one argument.");var n=t.containerInfo;if(8!==n.nodeType){var r=bv(t.current);r&&r.parentNode!==n&&a("render(...): It looks like the React-rendered content of the root container was removed without using React. This is not supported and will cause errors. Instead, call root.unmount() to empty a root's container.")}pv(e,t,null,null)},Uv.prototype.unmount=Bv.prototype.unmount=function(){"function"==typeof arguments[0]&&a("unmount(...): does not support a callback argument. To execute a side effect after rendering, declare it in a component body with useEffect().");var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;Ky()&&a("Attempted to synchronously unmount a root while React was already rendering. React cannot finish unmounting the root until the current render has completed, which may lead to a race condition."),Yy(function(){pv(null,e,null,null)}),Gu(t)}},Uv.prototype.unstable_scheduleHydration=function(e){e&&function(e){for(var t=$a(),n={blockedOn:null,target:e,priority:t},r=0;r<Xa.length&&Fa(t,Xa[r].priority);r++);Xa.splice(r,0,n),0===r&&ei(n)}(e)};var qv,Gv=n.ReactCurrentOwner;function Wv(e){return e?9===e.nodeType?e.documentElement:e.firstChild:null}function Yv(){}function Kv(e,t,n,r,o){qv(n),function(e,t){null!==e&&"function"!=typeof e&&a("%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.",t,e)}(void 0===o?null:o,"render");var i,s=n._reactRootContainer;if(s){if("function"==typeof o){var l=o;o=function(){var e=hv(i);l.call(e)}}pv(t,i=s,e,o)}else i=function(e,t,n,r,o){if(o){if("function"==typeof r){var a=r;r=function(){var e=hv(i);a.call(e)}}var i=fv(t,r,e,0,0,!1,0,"",Yv);return e._reactRootContainer=i,qu(i.current,e),gl(8===e.nodeType?e.parentNode:e),Yy(),i}for(var s;s=e.lastChild;)e.removeChild(s);if("function"==typeof r){var l=r;r=function(){var e=hv(u);l.call(e)}}var u=dv(e,0,0,!1,0,"",Yv);return e._reactRootContainer=u,qu(u.current,e),gl(8===e.nodeType?e.parentNode:e),Yy(function(){pv(t,u,n,r)}),u}(n,t,e,o,r);return hv(i)}qv=function(e){if(e._reactRootContainer&&8!==e.nodeType){var t=bv(e._reactRootContainer.current);t&&t.parentNode!==e&&a("render(...): It looks like the React-rendered content of this container was removed without using React. This is not supported and will cause errors. Instead, call ReactDOM.unmountComponentAtNode to empty a container.")}var n=!!e._reactRootContainer,r=Wv(e);!(!r||!Ku(r))&&!n&&a("render(...): Replacing React-rendered children with a new root component. If you intended to update the children of this node, you should instead have the existing children update their state and render the new components instead of calling ReactDOM.render."),1===e.nodeType&&e.tagName&&"BODY"===e.tagName.toUpperCase()&&a("render(): Rendering components directly into document.body is discouraged, since its children are often manipulated by third-party scripts and browser extensions. This may lead to subtle reconciliation issues. Try rendering into a container element created for your app.")};var Xv=!1;var Qv=!1;Pa=function(e){switch(e.tag){case 3:var t=e.stateNode;if(Ua(t)){var n=function(e){return ra(e.pendingLanes)}(t);!function(e,t){0!==t&&(Ta(e,ya(t,So)),Uy(e,Lr()),(Qb&(zb|Vb))===Ub&&(my(),Rc()))}(t,n)}break;case c:Yy(function(){var t=df(e,So);if(null!==t){var n=Ly();By(t,e,So,n)}}),gv(e,So)}},function(e){Oa=e}(function(e){if(e.tag===c){var t=Yo,n=df(e,t);if(null!==n)By(n,e,t,Ly());gv(e,t)}}),function(e){Aa=e}(function(e){if(e.tag===c){var t=jy(e),n=df(e,t);if(null!==n)By(n,e,t,Ly());gv(e,t)}}),function(e){$a=e}(La),function(e){Ra=e}(function(e,t){var n=Ma;try{return Ma=e,t()}finally{Ma=n}}),"function"==typeof Map&&null!=Map.prototype&&"function"==typeof Map.prototype.forEach&&"function"==typeof Set&&null!=Set.prototype&&"function"==typeof Set.prototype.clear&&"function"==typeof Set.prototype.forEach||a("React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),An=function(e,t,n){switch(t){case"input":return void ft(e,n);case"textarea":return void function(e,t){At(e,t)}(e,n);case"select":return void function(e,t){var n=e,r=t.value;null!=r&&xt(n,!!t.multiple,r,!1)}(e,n)}},Nn=Wy,Mn=Yy;var Zv,Jv,ew,tw={usingClientEntryPoint:!1,Events:[Ku,Xu,Qu,Cn,Dn,Wy]};if(!(Jv=(Zv={findFiberByHostInstance:Yu,bundleType:1,version:lv,rendererPackageName:"react-dom"}).findFiberByHostInstance,ew=n.ReactCurrentDispatcher,function(e){if("undefined"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)return!1;var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t.isDisabled)return!0;if(!t.supportsFiber)return a("The installed version of React DevTools is too old and will not work with the current version of React. Please update React DevTools. https://reactjs.org/link/react-devtools"),!0;try{e=we({},e,{getLaneLabelMap:Jr,injectProfilingHooks:Zr}),Gr=t.inject(e),Wr=t}catch(n){a("React instrumentation encountered an error: %s.",n)}return!!t.checkDCE}({bundleType:Zv.bundleType,version:Zv.version,rendererPackageName:Zv.rendererPackageName,rendererConfig:Zv.rendererConfig,overrideHookState:vv,overrideHookStateDeletePath:wv,overrideHookStateRenamePath:Sv,overrideProps:xv,overridePropsDeletePath:Tv,overridePropsRenamePath:Ev,setErrorHandler:Pv,setSuspenseHandler:Ov,scheduleUpdate:kv,currentDispatcherRef:ew,findHostInstanceByFiber:Mv,findFiberByHostInstance:Jv||Lv,findHostInstancesForRefresh:H_,scheduleRefresh:B_,scheduleRoot:U_,setRefreshHandler:D_,getCurrentFiber:jv,reconcilerVersion:lv}))&&k&&window.top===window.self&&(navigator.userAgent.indexOf("Chrome")>-1&&-1===navigator.userAgent.indexOf("Edge")||navigator.userAgent.indexOf("Firefox")>-1)){var nw=window.location.protocol;/^(https?|file):$/.test(nw)&&console.info("%cDownload the React DevTools for a better development experience: https://reactjs.org/link/react-devtools"+("file:"===nw?"\nYou might need to use a local HTTP server (instead of file://): https://reactjs.org/link/react-devtools-faq":""),"font-weight:bold")}reactDom_development.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=tw,reactDom_development.createPortal=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!zv(t))throw new Error("Target container is not a DOM element.");return uv(e,t,null,n)},reactDom_development.createRoot=function(e,t){return tw.usingClientEntryPoint||a('You are importing createRoot from "react-dom" which is not supported. You should instead import it from "react-dom/client".'),function(e,t){if(!zv(e))throw new Error("createRoot(...): Target container is not a DOM element.");Hv(e);var n=!1,r="",i=Fv;null!=t&&(t.hydrate?o("hydrate through createRoot is deprecated. Use ReactDOMClient.hydrateRoot(container, <App />) instead."):"object"==typeof t&&null!==t&&t.$$typeof===J&&a("You passed a JSX element to createRoot. You probably meant to call root.render instead. Example usage:\n\n let root = createRoot(domContainer);\n root.render(<App />);"),!0===t.unstable_strictMode&&(n=!0),void 0!==t.identifierPrefix&&(r=t.identifierPrefix),void 0!==t.onRecoverableError&&(i=t.onRecoverableError),void 0!==t.transitionCallbacks&&t.transitionCallbacks);var s=dv(e,1,0,n,0,r,i);return qu(s.current,e),gl(8===e.nodeType?e.parentNode:e),new Bv(s)}(e,t)},reactDom_development.findDOMNode=function(e){Xv||(Xv=!0,a("findDOMNode is deprecated and will be removed in the next major release. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node"));var t=Gv.current;return null!==t&&null!==t.stateNode&&(t.stateNode._warnedAboutRefsInRender||a("%s is accessing findDOMNode inside its render(). render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.",Me(t.type)||"A component"),t.stateNode._warnedAboutRefsInRender=!0),null==e?null:1===e.nodeType?e:function(e,t){var n=er(e);if(void 0===n){if("function"==typeof e.render)throw new Error("Unable to find node on an unmounted component.");var r=Object.keys(e).join(",");throw new Error("Argument appears to not be a ReactComponent. Keys: "+r)}var o=Ar(n);if(null===o)return null;if(8&o.mode){var i=je(n)||"Component";if(!sv[i]){sv[i]=!0;var s=Be;try{qe(o),8&n.mode?a("%s is deprecated in StrictMode. %s was passed an instance of %s which is inside StrictMode. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node",t,t,i):a("%s is deprecated in StrictMode. %s was passed an instance of %s which renders StrictMode children. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node",t,t,i)}finally{s?qe(s):He()}}}return o.stateNode}(e,"findDOMNode")},reactDom_development.flushSync=function(e){return Ky()&&a("flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task."),Yy(e)},reactDom_development.hydrate=function(e,t,n){if(a("ReactDOM.hydrate is no longer supported in React 18. Use hydrateRoot instead. Until you switch to the new API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot"),!Vv(t))throw new Error("Target container is not a DOM element.");return Wu(t)&&void 0===t._reactRootContainer&&a("You are calling ReactDOM.hydrate() on a container that was previously passed to ReactDOMClient.createRoot(). This is not supported. Did you mean to call hydrateRoot(container, element)?"),Kv(null,e,t,!0,n)},reactDom_development.hydrateRoot=function(e,t,n){return tw.usingClientEntryPoint||a('You are importing hydrateRoot from "react-dom" which is not supported. You should instead import it from "react-dom/client".'),function(e,t,n){if(!zv(e))throw new Error("hydrateRoot(...): Target container is not a DOM element.");Hv(e),void 0===t&&a("Must provide initial children as second argument to hydrateRoot. Example usage: hydrateRoot(domContainer, <App />)");var r=null!=n&&n.hydratedSources||null,o=!1,i="",s=Fv;null!=n&&(!0===n.unstable_strictMode&&(o=!0),void 0!==n.identifierPrefix&&(i=n.identifierPrefix),void 0!==n.onRecoverableError&&(s=n.onRecoverableError));var l=fv(t,null,e,1,0,o,0,i,s);if(qu(l.current,e),gl(e),r)for(var u=0;u<r.length;u++)Zf(l,r[u]);return new Uv(l)}(e,t,n)},reactDom_development.render=function(e,t,n){if(a("ReactDOM.render is no longer supported in React 18. Use createRoot instead. Until you switch to the new API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot"),!Vv(t))throw new Error("Target container is not a DOM element.");return Wu(t)&&void 0===t._reactRootContainer&&a("You are calling ReactDOM.render() on a container that was previously passed to ReactDOMClient.createRoot(). This is not supported. Did you mean to call root.render(element)?"),Kv(null,e,t,!1,n)},reactDom_development.unmountComponentAtNode=function(e){if(Qv||(Qv=!0,a("unmountComponentAtNode is deprecated and will be removed in the next major release. Switch to the createRoot API. Learn more: https://reactjs.org/link/switch-to-createroot")),!Vv(e))throw new Error("unmountComponentAtNode(...): Target container is not a DOM element.");if(Wu(e)&&void 0===e._reactRootContainer&&a("You are calling ReactDOM.unmountComponentAtNode() on a container that was previously passed to ReactDOMClient.createRoot(). This is not supported. Did you mean to call root.unmount()?"),e._reactRootContainer){var t=Wv(e);return t&&!Ku(t)&&a("unmountComponentAtNode(): The node you're attempting to unmount was rendered by another copy of React."),Yy(function(){Kv(null,null,e,!1,function(){e._reactRootContainer=null,Gu(e)})}),!0}var n=Wv(e),r=!(!n||!Ku(n)),o=1===e.nodeType&&Vv(e.parentNode)&&!!e.parentNode._reactRootContainer;return r&&a("unmountComponentAtNode(): The node you're attempting to unmount was rendered by React and is not a top-level container. %s",o?"You may have accidentally passed in a React root node instead of its container.":"Instead, have the parent component update its state and rerender in order to remove this component."),!1},reactDom_development.unstable_batchedUpdates=Wy,reactDom_development.unstable_renderSubtreeIntoContainer=function(e,t,n,r){return function(e,t,n,r){if(a("ReactDOM.unstable_renderSubtreeIntoContainer() is no longer supported in React 18. Consider using a portal instead. Until you switch to the createRoot API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot"),!Vv(n))throw new Error("Target container is not a DOM element.");if(null==e||void 0===e._reactInternals)throw new Error("parentComponent must be a valid React Component");return Kv(e,t,n,!1,r)}(e,t,n,r)},reactDom_development.version=lv,"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),reactDom_development}function checkDCE(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE){if("production"!==process.env.NODE_ENV)throw new Error("^_^");try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE)}catch(e){console.error(e)}}}"production"===process.env.NODE_ENV?(checkDCE(),reactDom.exports=requireReactDom_production_min()):reactDom.exports=requireReactDom_development();var reactDomExports=reactDom.exports,createRoot,m=reactDomExports;if("production"===process.env.NODE_ENV)createRoot=m.createRoot,m.hydrateRoot;else{var i=m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;createRoot=function(e,t){i.usingClientEntryPoint=!0;try{return m.createRoot(e,t)}finally{i.usingClientEntryPoint=!1}}}var reactExports=requireReact();const LogoIcon=()=>jsxRuntimeExports.jsxs("svg",{viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("path",{d:"M16 4C9.37 4 4 9.37 4 16s5.37 12 12 12 12-5.37 12-12S22.63 4 16 4z",fill:"#2563eb"}),jsxRuntimeExports.jsx("path",{d:"M16 8c-2.2 0-4 1.8-4 4v4c0 2.2 1.8 4 4 4s4-1.8 4-4v-4c0-2.2-1.8-4-4-4z",fill:"white"}),jsxRuntimeExports.jsx("path",{d:"M22 16c0 3.3-2.7 6-6 6s-6-2.7-6-6H8c0 4.1 3.1 7.5 7 7.9V26h2v-2.1c3.9-.4 7-3.8 7-7.9h-2z",fill:"white"})]}),MicIcon=()=>jsxRuntimeExports.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z"}),jsxRuntimeExports.jsx("path",{d:"M19 10v2a7 7 0 0 1-14 0v-2"}),jsxRuntimeExports.jsx("line",{x1:"12",x2:"12",y1:"19",y2:"22"})]}),CloseIcon=()=>jsxRuntimeExports.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),jsxRuntimeExports.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),MinimizeIcon=()=>jsxRuntimeExports.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),jsxRuntimeExports.jsx("path",{d:"M9 3v18"})]}),ErrorIcon=()=>jsxRuntimeExports.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("circle",{cx:"12",cy:"12",r:"10"}),jsxRuntimeExports.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),jsxRuntimeExports.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}),ChatIcon=()=>jsxRuntimeExports.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntimeExports.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})});function FloatingPanel({children:e,position:t,onClose:n,onMinimize:r}){const o=reactExports.useRef(null),a=reactExports.useRef(!1),i=reactExports.useRef({x:0,y:0,right:20,bottom:20}),s=reactExports.useCallback(e=>{if(e.target.closest("button"))return;a.current=!0;const t=o.current;t&&(i.current={x:e.clientX,y:e.clientY,right:parseInt(t.style.right||"20"),bottom:parseInt(t.style.bottom||"20")})},[]);reactExports.useEffect(()=>{const e=e=>{if(!a.current||!o.current)return;const t=i.current.x-e.clientX,n=i.current.y-e.clientY;o.current.style.right=`${i.current.right+t}px`,o.current.style.bottom=`${i.current.bottom+n}px`},t=()=>{a.current=!1};return document.addEventListener("mousemove",e),document.addEventListener("mouseup",t),()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t)}},[]);const l={bottom:(null==t?void 0:t.bottom)??20,right:(null==t?void 0:t.right)??20,...void 0!==(null==t?void 0:t.top)&&{top:t.top,bottom:"auto"},...void 0!==(null==t?void 0:t.left)&&{left:t.left,right:"auto"}};return jsxRuntimeExports.jsxs("div",{ref:o,className:"scribe-panel",style:l,children:[jsxRuntimeExports.jsxs("div",{className:"panel-header",onMouseDown:s,children:[jsxRuntimeExports.jsxs("div",{className:"drag-handle",children:[jsxRuntimeExports.jsx("span",{}),jsxRuntimeExports.jsx("span",{}),jsxRuntimeExports.jsx("span",{}),jsxRuntimeExports.jsx("span",{}),jsxRuntimeExports.jsx("span",{}),jsxRuntimeExports.jsx("span",{})]}),jsxRuntimeExports.jsxs("div",{className:"header-actions",children:[jsxRuntimeExports.jsx("button",{className:"header-btn",onClick:r,title:"Minimize",children:jsxRuntimeExports.jsx(MinimizeIcon,{})}),jsxRuntimeExports.jsx("button",{className:"header-btn",onClick:n,title:"Close",children:jsxRuntimeExports.jsx(CloseIcon,{})})]})]}),jsxRuntimeExports.jsx("div",{className:"panel-content",children:e})]})}function ConfigState({onSubmit:e,initialApiKey:t="",initialBaseUrl:n=""}){const[r,o]=reactExports.useState(t),[a,i]=reactExports.useState(n),[s,l]=reactExports.useState("");return jsxRuntimeExports.jsxs("div",{className:"config-state",style:{zIndex:9999},children:[jsxRuntimeExports.jsxs("div",{className:"logo",children:[jsxRuntimeExports.jsx("div",{className:"logo-icon",children:jsxRuntimeExports.jsx(LogoIcon,{})}),jsxRuntimeExports.jsx("span",{className:"logo-text",children:"eka.scribe"})]}),jsxRuntimeExports.jsxs("form",{className:"config-form",onSubmit:t=>{t.preventDefault(),a.trim()?(l(""),e(r.trim(),a.trim())):l("Base URL is required")},children:[jsxRuntimeExports.jsxs("div",{className:"form-group",children:[jsxRuntimeExports.jsx("label",{htmlFor:"eka-api-key",children:"API Key"}),jsxRuntimeExports.jsx("input",{id:"eka-api-key",type:"text",value:r,onChange:e=>o(e.target.value),placeholder:"Enter your API key (optional)"})]}),jsxRuntimeExports.jsxs("div",{className:"form-group",children:[jsxRuntimeExports.jsx("label",{htmlFor:"eka-base-url",children:"Base URL"}),jsxRuntimeExports.jsx("input",{id:"eka-base-url",type:"text",value:a,onChange:e=>i(e.target.value),placeholder:"https://api.eka.care",required:!0})]}),s&&jsxRuntimeExports.jsx("p",{className:"config-error",children:s}),jsxRuntimeExports.jsx("button",{type:"submit",className:"config-submit-btn",children:"Continue"})]})]})}function IdleState({onStartRecording:e}){return jsxRuntimeExports.jsxs("div",{className:"idle-state",children:[jsxRuntimeExports.jsxs("div",{className:"logo",children:[jsxRuntimeExports.jsx("div",{className:"logo-icon",children:jsxRuntimeExports.jsx(LogoIcon,{})}),jsxRuntimeExports.jsx("span",{className:"logo-text",children:"eka.scribe"})]}),jsxRuntimeExports.jsxs("button",{className:"start-btn",onClick:e,children:["Start Recording",jsxRuntimeExports.jsx("span",{className:"mic-icon",children:jsxRuntimeExports.jsx(MicIcon,{})})]})]})}function PermissionState({onRequestPermission:e}){return jsxRuntimeExports.jsxs("div",{className:"permission-state",children:[jsxRuntimeExports.jsx("div",{className:"permission-icon",children:jsxRuntimeExports.jsx(MicIcon,{})}),jsxRuntimeExports.jsxs("p",{className:"permission-text",children:["Microphone access is required to record audio.",jsxRuntimeExports.jsx("br",{}),"Please allow access when prompted."]}),jsxRuntimeExports.jsx("button",{className:"permission-btn",onClick:e,children:"Allow Microphone"})]})}function formatTime(e){const t=e%60;return`${Math.floor(e/60).toString().padStart(2,"0")}:${t.toString().padStart(2,"0")}`}function RecordingState({elapsedTime:e,isPaused:t,onPause:n,onResume:r,onStop:o}){return jsxRuntimeExports.jsxs("div",{className:"recording-state",children:[jsxRuntimeExports.jsxs("div",{className:"recording-indicator",children:[jsxRuntimeExports.jsx("div",{className:"recording-icon "+(t?"":"active"),children:jsxRuntimeExports.jsx(ChatIcon,{})}),jsxRuntimeExports.jsx("span",{className:"timer",children:formatTime(e)})]}),jsxRuntimeExports.jsxs("div",{className:"recording-actions",children:[t?jsxRuntimeExports.jsx("button",{className:"resume-btn",onClick:r,children:"Resume"}):jsxRuntimeExports.jsx("button",{className:"pause-btn",onClick:n,children:"Pause"}),jsxRuntimeExports.jsx("button",{className:"stop-btn",onClick:o,title:"Stop recording",children:jsxRuntimeExports.jsx("div",{className:"stop-icon"})})]})]})}function ProcessingState(){return jsxRuntimeExports.jsxs("div",{className:"processing-state",children:[jsxRuntimeExports.jsx("div",{className:"spinner"}),jsxRuntimeExports.jsx("p",{className:"processing-text",children:"Processing your recording..."})]})}function ResultsState({result:e,onNewRecording:t}){return jsxRuntimeExports.jsxs("div",{className:"results-state",children:[jsxRuntimeExports.jsxs("div",{className:"results-header",children:[jsxRuntimeExports.jsx("span",{className:"results-title",children:"Recording Complete"}),jsxRuntimeExports.jsx("button",{className:"new-recording-btn",onClick:t,children:"New Recording"})]}),jsxRuntimeExports.jsx("div",{className:"results-content",children:jsxRuntimeExports.jsxs("div",{className:"transcript-section",children:[jsxRuntimeExports.jsx("div",{className:"section-title",children:"Transcript"}),jsxRuntimeExports.jsx("div",{className:"transcript-text",children:e.transcript||"No transcript available."})]})})]})}function ErrorState({message:e,onRetry:t}){return jsxRuntimeExports.jsxs("div",{className:"error-state",children:[jsxRuntimeExports.jsx("div",{className:"error-icon",children:jsxRuntimeExports.jsx(ErrorIcon,{})}),jsxRuntimeExports.jsx("p",{className:"error-message",children:e}),jsxRuntimeExports.jsx("button",{className:"retry-btn",onClick:t,children:"Try Again"})]})}const WELL_KNOWN_PATH="/.well-known/medscribealliance";var SessionStatus,SessionStatus2,TemplateStatus,TemplateStatus2,UploadType,UploadType2,ErrorCode,ErrorCode2,HttpStatus,HttpStatus2;SessionStatus2=SessionStatus||(SessionStatus={}),SessionStatus2.CREATED="created",SessionStatus2.PROCESSING="processing",SessionStatus2.COMPLETED="completed",SessionStatus2.PARTIAL="partial",SessionStatus2.FAILED="failed",TemplateStatus2=TemplateStatus||(TemplateStatus={}),TemplateStatus2.SUCCESS="success",TemplateStatus2.FAILED="failed",UploadType2=UploadType||(UploadType={}),UploadType2.CHUNKED="chunked",UploadType2.SINGLE="single",ErrorCode2=ErrorCode||(ErrorCode={}),ErrorCode2.AUTHENTICATION_FAILED="authentication_failed",ErrorCode2.TOKEN_EXPIRED="token_expired",ErrorCode2.INVALID_API_KEY="invalid_api_key",ErrorCode2.FORBIDDEN="forbidden",ErrorCode2.RATE_LIMIT_EXCEEDED="rate_limit_exceeded",ErrorCode2.SESSION_NOT_FOUND="session_not_found",ErrorCode2.TEMPLATE_NOT_FOUND="template_not_found",ErrorCode2.WEBHOOK_NOT_FOUND="webhook_not_found",ErrorCode2.SESSION_EXPIRED="session_expired",ErrorCode2.INVALID_REQUEST="invalid_request",ErrorCode2.INVALID_AUDIO_FORMAT="invalid_audio_format",ErrorCode2.CHUNK_TOO_LARGE="chunk_too_large",ErrorCode2.INVALID_TEMPLATE="invalid_template",ErrorCode2.MISSING_REQUIRED_FIELD="missing_required_field",ErrorCode2.PROCESSING_FAILED="processing_failed",ErrorCode2.AUDIO_QUALITY_POOR="audio_quality_poor",ErrorCode2.AUDIO_TOO_SHORT="audio_too_short",ErrorCode2.LANGUAGE_UNSUPPORTED="language_unsupported",ErrorCode2.INTERNAL_ERROR="internal_error",ErrorCode2.SERVICE_UNAVAILABLE="service_unavailable",HttpStatus2=HttpStatus||(HttpStatus={}),HttpStatus2[HttpStatus2.OK=200]="OK",HttpStatus2[HttpStatus2.CREATED=201]="CREATED",HttpStatus2[HttpStatus2.ACCEPTED=202]="ACCEPTED",HttpStatus2[HttpStatus2.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",HttpStatus2[HttpStatus2.BAD_REQUEST=400]="BAD_REQUEST",HttpStatus2[HttpStatus2.UNAUTHORIZED=401]="UNAUTHORIZED",HttpStatus2[HttpStatus2.FORBIDDEN=403]="FORBIDDEN",HttpStatus2[HttpStatus2.NOT_FOUND=404]="NOT_FOUND",HttpStatus2[HttpStatus2.GONE=410]="GONE",HttpStatus2[HttpStatus2.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",HttpStatus2[HttpStatus2.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",HttpStatus2[HttpStatus2.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",HttpStatus2[HttpStatus2.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE";class DiscoveryAPI{constructor(e){this.cachedDiscovery=null,this.cacheTimestamp=0,this.cacheDuration=36e5,this.httpClient=e}async getDiscovery(e,t=!1){const n=Date.now();if(!t&&this.cachedDiscovery&&n-this.cacheTimestamp<this.cacheDuration)return this.cachedDiscovery;const r=e+WELL_KNOWN_PATH,o=await this.httpClient.get(r);return this.cachedDiscovery=o,this.cacheTimestamp=n,o}clearCache(){this.cachedDiscovery=null,this.cacheTimestamp=0}getCachedDiscovery(){const e=Date.now();return this.cachedDiscovery&&e-this.cacheTimestamp<this.cacheDuration?this.cachedDiscovery:null}}var ajv={exports:{}},core$2={},validate={},boolSchema={},errors={},codegen={},code$1={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class n extends t{constructor(t){if(super(),!e.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=n;class r extends t{constructor(e){super(),this._items="string"==typeof e?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const e=this._items[0];return""===e||'""'===e}get str(){var e;return null!==(e=this._str)&&void 0!==e?e:this._str=this._items.reduce((e,t)=>`${e}${t}`,"")}get names(){var e;return null!==(e=this._names)&&void 0!==e?e:this._names=this._items.reduce((e,t)=>(t instanceof n&&(e[t.str]=(e[t.str]||0)+1),e),{})}}function o(e,...t){const n=[e[0]];let o=0;for(;o<t.length;)s(n,t[o]),n.push(e[++o]);return new r(n)}e._Code=r,e.nil=new r(""),e._=o;const a=new r("+");function i(e,...t){const n=[u(e[0])];let o=0;for(;o<t.length;)n.push(a),s(n,t[o]),n.push(a,u(e[++o]));return function(e){let t=1;for(;t<e.length-1;){if(e[t]===a){const n=l(e[t-1],e[t+1]);if(void 0!==n){e.splice(t-1,3,n);continue}e[t++]="+"}t++}}(n),new r(n)}function s(e,t){var o;t instanceof r?e.push(...t._items):t instanceof n?e.push(t):e.push("number"==typeof(o=t)||"boolean"==typeof o||null===o?o:u(Array.isArray(o)?o.join(","):o))}function l(e,t){if('""'===t)return e;if('""'===e)return t;if("string"==typeof e){if(t instanceof n||'"'!==e[e.length-1])return;return"string"!=typeof t?`${e.slice(0,-1)}${t}"`:'"'===t[0]?e.slice(0,-1)+t.slice(1):void 0}return"string"!=typeof t||'"'!==t[0]||e instanceof n?void 0:`"${e}${t.slice(1)}`}function u(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.str=i,e.addCodeArg=s,e.strConcat=function(e,t){return t.emptyStr()?e:e.emptyStr()?t:i`${e}${t}`},e.stringify=function(e){return new r(u(e))},e.safeStringify=u,e.getProperty=function(t){return"string"==typeof t&&e.IDENTIFIER.test(t)?new r(`.${t}`):o`[${t}]`},e.getEsmExportName=function(t){if("string"==typeof t&&e.IDENTIFIER.test(t))return new r(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)},e.regexpCode=function(e){return new r(e.toString())}}(code$1);var scope={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=code$1;class n extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}}var r,o;(o=r||(e.UsedValueState=r={}))[o.Started=0]="Started",o[o.Completed=1]="Completed",e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class a{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof t.Name?e:this.name(e)}name(e){return new t.Name(this._newName(e))}_newName(e){return`${e}${(this._names[e]||this._nameGroup(e)).index++}`}_nameGroup(e){var t,n;if((null===(n=null===(t=this._parent)||void 0===t?void 0:t._prefixes)||void 0===n?void 0:n.has(e))||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}e.Scope=a;class i extends t.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:n,itemIndex:r}){this.value=e,this.scopePath=t._`.${new t.Name(n)}[${r}]`}}e.ValueScopeName=i;const s=t._`\n`;e.ValueScope=class extends a{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?s:t.nil}}get(){return this._scope}name(e){return new i(e,this._newName(e))}value(e,t){var n;if(void 0===t.ref)throw new Error("CodeGen: ref must be passed in value");const r=this.toName(e),{prefix:o}=r,a=null!==(n=t.key)&&void 0!==n?n:t.ref;let i=this._values[o];if(i){const e=i.get(a);if(e)return e}else i=this._values[o]=new Map;i.set(a,r);const s=this._scope[o]||(this._scope[o]=[]),l=s.length;return s[l]=t.ref,r.setValue(t,{property:o,itemIndex:l}),r}getValue(e,t){const n=this._values[e];if(n)return n.get(t)}scopeRefs(e,n=this._values){return this._reduceValues(n,n=>{if(void 0===n.scopePath)throw new Error(`CodeGen: name "${n}" has no value`);return t._`${e}${n.scopePath}`})}scopeCode(e=this._values,t,n){return this._reduceValues(e,e=>{if(void 0===e.value)throw new Error(`CodeGen: name "${e}" has no value`);return e.value.code},t,n)}_reduceValues(o,a,i={},s){let l=t.nil;for(const u in o){const c=o[u];if(!c)continue;const d=i[u]=i[u]||new Map;c.forEach(o=>{if(d.has(o))return;d.set(o,r.Started);let i=a(o);if(i){const n=this.opts.es5?e.varKinds.var:e.varKinds.const;l=t._`${l}${n} ${o} = ${i};${this.opts._n}`}else{if(!(i=null==s?void 0:s(o)))throw new n(o);l=t._`${l}${i}${this.opts._n}`}d.set(o,r.Completed)})}return l}}}(scope),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=code$1,n=scope;var r=code$1;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return r.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return r.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return r.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}});var o=scope;Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return o.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return o.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return o.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return o.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class a{optimizeNodes(){return this}optimizeNames(e,t){return this}}class i extends a{constructor(e,t,n){super(),this.varKind=e,this.name=t,this.rhs=n}render({es5:e,_n:t}){const r=e?n.varKinds.var:this.varKind,o=void 0===this.rhs?"":` = ${this.rhs}`;return`${r} ${this.name}${o};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=A(this.rhs,e,t)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class s extends a{constructor(e,t,n){super(),this.lhs=e,this.rhs=t,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,n){if(!(this.lhs instanceof t.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=A(this.rhs,e,n),this}get names(){return O(this.lhs instanceof t.Name?{}:{...this.lhs.names},this.rhs)}}class l extends s{constructor(e,t,n,r){super(e,n,r),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class u extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class c extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class d extends a{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class f extends a{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=A(this.code,e,t),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class p extends a{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((t,n)=>t+n.render(e),"")}optimizeNodes(){const{nodes:e}=this;let t=e.length;for(;t--;){const n=e[t].optimizeNodes();Array.isArray(n)?e.splice(t,1,...n):n?e[t]=n:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){const{nodes:n}=this;let r=n.length;for(;r--;){const o=n[r];o.optimizeNames(e,t)||($(e,o.names),n.splice(r,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>P(e,t.names),{})}}class h extends p{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class m extends p{}class g extends h{}g.kind="else";class b extends h{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();const e=this.condition;if(!0===e)return this.nodes;let t=this.else;if(t){const e=t.optimizeNodes();t=this.else=Array.isArray(e)?new g(e):e}return t?!1===e?t instanceof b?t:t.nodes:this.nodes.length?this:new b(R(e),t instanceof b?[t]:t.nodes):!1!==e&&this.nodes.length?this:void 0}optimizeNames(e,t){var n;if(this.else=null===(n=this.else)||void 0===n?void 0:n.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=A(this.condition,e,t),this}get names(){const e=super.names;return O(e,this.condition),this.else&&P(e,this.else.names),e}}b.kind="if";class y extends h{}y.kind="for";class _ extends y{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=A(this.iteration,e,t),this}get names(){return P(super.names,this.iteration.names)}}class v extends y{constructor(e,t,n,r){super(),this.varKind=e,this.name=t,this.from=n,this.to=r}render(e){const t=e.es5?n.varKinds.var:this.varKind,{name:r,from:o,to:a}=this;return`for(${t} ${r}=${o}; ${r}<${a}; ${r}++)`+super.render(e)}get names(){const e=O(super.names,this.from);return O(e,this.to)}}class w extends y{constructor(e,t,n,r){super(),this.loop=e,this.varKind=t,this.name=n,this.iterable=r}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=A(this.iterable,e,t),this}get names(){return P(super.names,this.iterable.names)}}class S extends h{constructor(e,t,n){super(),this.name=e,this.args=t,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}S.kind="func";class x extends p{render(e){return"return "+super.render(e)}}x.kind="return";class T extends h{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null===(e=this.catch)||void 0===e||e.optimizeNodes(),null===(t=this.finally)||void 0===t||t.optimizeNodes(),this}optimizeNames(e,t){var n,r;return super.optimizeNames(e,t),null===(n=this.catch)||void 0===n||n.optimizeNames(e,t),null===(r=this.finally)||void 0===r||r.optimizeNames(e,t),this}get names(){const e=super.names;return this.catch&&P(e,this.catch.names),this.finally&&P(e,this.finally.names),e}}class E extends h{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}E.kind="catch";class k extends h{render(e){return"finally"+super.render(e)}}k.kind="finally";function P(e,t){for(const n in t)e[n]=(e[n]||0)+(t[n]||0);return e}function O(e,n){return n instanceof t._CodeOrName?P(e,n.names):e}function A(e,n,r){return e instanceof t.Name?a(e):(o=e)instanceof t._Code&&o._items.some(e=>e instanceof t.Name&&1===n[e.str]&&void 0!==r[e.str])?new t._Code(e._items.reduce((e,n)=>(n instanceof t.Name&&(n=a(n)),n instanceof t._Code?e.push(...n._items):e.push(n),e),[])):e;var o;function a(e){const t=r[e.str];return void 0===t||1!==n[e.str]?e:(delete n[e.str],t)}}function $(e,t){for(const n in t)e[n]=(e[n]||0)-(t[n]||0)}function R(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:t._`!${N(e)}`}e.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new n.Scope({parent:e}),this._nodes=[new m]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){const n=this._extScope.value(e,t);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,n,r){const o=this._scope.toName(t);return void 0!==n&&r&&(this._constants[o.str]=n),this._leafNode(new i(e,o,n)),o}const(e,t,r){return this._def(n.varKinds.const,e,t,r)}let(e,t,r){return this._def(n.varKinds.let,e,t,r)}var(e,t,r){return this._def(n.varKinds.var,e,t,r)}assign(e,t,n){return this._leafNode(new s(e,t,n))}add(t,n){return this._leafNode(new l(t,e.operators.ADD,n))}code(e){return"function"==typeof e?e():e!==t.nil&&this._leafNode(new f(e)),this}object(...e){const n=["{"];for(const[r,o]of e)n.length>1&&n.push(","),n.push(r),(r!==o||this.opts.es5)&&(n.push(":"),(0,t.addCodeArg)(n,o));return n.push("}"),new t._Code(n)}if(e,t,n){if(this._blockNode(new b(e)),t&&n)this.code(t).else().code(n).endIf();else if(t)this.code(t).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new b(e))}else(){return this._elseNode(new g)}endIf(){return this._endBlockNode(b,g)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new _(e),t)}forRange(e,t,r,o,a=(this.opts.es5?n.varKinds.var:n.varKinds.let)){const i=this._scope.toName(e);return this._for(new v(a,i,t,r),()=>o(i))}forOf(e,r,o,a=n.varKinds.const){const i=this._scope.toName(e);if(this.opts.es5){const e=r instanceof t.Name?r:this.var("_arr",r);return this.forRange("_i",0,t._`${e}.length`,n=>{this.var(i,t._`${e}[${n}]`),o(i)})}return this._for(new w("of",a,i,r),()=>o(i))}forIn(e,r,o,a=(this.opts.es5?n.varKinds.var:n.varKinds.const)){if(this.opts.ownProperties)return this.forOf(e,t._`Object.keys(${r})`,o);const i=this._scope.toName(e);return this._for(new w("in",a,i,r),()=>o(i))}endFor(){return this._endBlockNode(y)}label(e){return this._leafNode(new u(e))}break(e){return this._leafNode(new c(e))}return(e){const t=new x;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(x)}try(e,t,n){if(!t&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');const r=new T;if(this._blockNode(r),this.code(e),t){const e=this.name("e");this._currNode=r.catch=new E(e),t(e)}return n&&(this._currNode=r.finally=new k,this.code(n)),this._endBlockNode(E,k)}throw(e){return this._leafNode(new d(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){const t=this._blockStarts.pop();if(void 0===t)throw new Error("CodeGen: not in self-balancing block");const n=this._nodes.length-t;if(n<0||void 0!==e&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=t,this}func(e,n=t.nil,r,o){return this._blockNode(new S(e,n,r)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(S)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){const n=this._currNode;if(n instanceof e||t&&n instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){const t=this._currNode;if(!(t instanceof b))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){const e=this._nodes;return e[e.length-1]}set _currNode(e){const t=this._nodes;t[t.length-1]=e}},e.not=R;const I=D(e.operators.AND);e.and=function(...e){return e.reduce(I)};const C=D(e.operators.OR);function D(e){return(n,r)=>n===t.nil?r:r===t.nil?n:t._`${N(n)} ${e} ${N(r)}`}function N(e){return e instanceof t.Name?e:t._`(${e})`}e.or=function(...e){return e.reduce(C)}}(codegen);var util={};Object.defineProperty(util,"__esModule",{value:!0}),util.checkStrictMode=util.getErrorPath=util.Type=util.useFunc=util.setEvaluated=util.evaluatedPropsToName=util.mergeEvaluated=util.eachItem=util.unescapeJsonPointer=util.escapeJsonPointer=util.escapeFragment=util.unescapeFragment=util.schemaRefOrVal=util.schemaHasRulesButRef=util.schemaHasRules=util.checkUnknownRules=util.alwaysValidSchema=util.toHash=void 0;const codegen_1$v=codegen,code_1$a=code$1;function toHash(e){const t={};for(const n of e)t[n]=!0;return t}function alwaysValidSchema(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(checkUnknownRules(e,t),!schemaHasRules(t,e.self.RULES.all))}function checkUnknownRules(e,t=e.schema){const{opts:n,self:r}=e;if(!n.strictSchema)return;if("boolean"==typeof t)return;const o=r.RULES.keywords;for(const a in t)o[a]||checkStrictMode(e,`unknown keyword: "${a}"`)}function schemaHasRules(e,t){if("boolean"==typeof e)return!e;for(const n in e)if(t[n])return!0;return!1}function schemaHasRulesButRef(e,t){if("boolean"==typeof e)return!e;for(const n in e)if("$ref"!==n&&t.all[n])return!0;return!1}function schemaRefOrVal({topSchemaRef:e,schemaPath:t},n,r,o){if(!o){if("number"==typeof n||"boolean"==typeof n)return n;if("string"==typeof n)return codegen_1$v._`${n}`}return codegen_1$v._`${e}${t}${(0,codegen_1$v.getProperty)(r)}`}function unescapeFragment(e){return unescapeJsonPointer(decodeURIComponent(e))}function escapeFragment(e){return encodeURIComponent(escapeJsonPointer(e))}function escapeJsonPointer(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function unescapeJsonPointer(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function eachItem(e,t){if(Array.isArray(e))for(const n of e)t(n);else t(e)}function makeMergeEvaluated({mergeNames:e,mergeToName:t,mergeValues:n,resultToName:r}){return(o,a,i,s)=>{const l=void 0===i?a:i instanceof codegen_1$v.Name?(a instanceof codegen_1$v.Name?e(o,a,i):t(o,a,i),i):a instanceof codegen_1$v.Name?(t(o,i,a),a):n(a,i);return s!==codegen_1$v.Name||l instanceof codegen_1$v.Name?l:r(o,l)}}function evaluatedPropsToName(e,t){if(!0===t)return e.var("props",!0);const n=e.var("props",codegen_1$v._`{}`);return void 0!==t&&setEvaluated(e,n,t),n}function setEvaluated(e,t,n){Object.keys(n).forEach(n=>e.assign(codegen_1$v._`${t}${(0,codegen_1$v.getProperty)(n)}`,!0))}util.toHash=toHash,util.alwaysValidSchema=alwaysValidSchema,util.checkUnknownRules=checkUnknownRules,util.schemaHasRules=schemaHasRules,util.schemaHasRulesButRef=schemaHasRulesButRef,util.schemaRefOrVal=schemaRefOrVal,util.unescapeFragment=unescapeFragment,util.escapeFragment=escapeFragment,util.escapeJsonPointer=escapeJsonPointer,util.unescapeJsonPointer=unescapeJsonPointer,util.eachItem=eachItem,util.mergeEvaluated={props:makeMergeEvaluated({mergeNames:(e,t,n)=>e.if(codegen_1$v._`${n} !== true && ${t} !== undefined`,()=>{e.if(codegen_1$v._`${t} === true`,()=>e.assign(n,!0),()=>e.assign(n,codegen_1$v._`${n} || {}`).code(codegen_1$v._`Object.assign(${n}, ${t})`))}),mergeToName:(e,t,n)=>e.if(codegen_1$v._`${n} !== true`,()=>{!0===t?e.assign(n,!0):(e.assign(n,codegen_1$v._`${n} || {}`),setEvaluated(e,n,t))}),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:evaluatedPropsToName}),items:makeMergeEvaluated({mergeNames:(e,t,n)=>e.if(codegen_1$v._`${n} !== true && ${t} !== undefined`,()=>e.assign(n,codegen_1$v._`${t} === true ? true : ${n} > ${t} ? ${n} : ${t}`)),mergeToName:(e,t,n)=>e.if(codegen_1$v._`${n} !== true`,()=>e.assign(n,!0===t||codegen_1$v._`${n} > ${t} ? ${n} : ${t}`)),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},util.evaluatedPropsToName=evaluatedPropsToName,util.setEvaluated=setEvaluated;const snippets={};function useFunc(e,t){return e.scopeValue("func",{ref:t,code:snippets[t.code]||(snippets[t.code]=new code_1$a._Code(t.code))})}var Type,Type2;function getErrorPath(e,t,n){if(e instanceof codegen_1$v.Name){const r=t===Type.Num;return n?r?codegen_1$v._`"[" + ${e} + "]"`:codegen_1$v._`"['" + ${e} + "']"`:r?codegen_1$v._`"/" + ${e}`:codegen_1$v._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return n?(0,codegen_1$v.getProperty)(e).toString():"/"+escapeJsonPointer(e)}function checkStrictMode(e,t,n=e.opts.strictSchema){if(n){if(t=`strict mode: ${t}`,!0===n)throw new Error(t);e.self.logger.warn(t)}}util.useFunc=useFunc,Type2=Type||(util.Type=Type={}),Type2[Type2.Num=0]="Num",Type2[Type2.Str=1]="Str",util.getErrorPath=getErrorPath,util.checkStrictMode=checkStrictMode;var names$1={};Object.defineProperty(names$1,"__esModule",{value:!0});const codegen_1$u=codegen,names={data:new codegen_1$u.Name("data"),valCxt:new codegen_1$u.Name("valCxt"),instancePath:new codegen_1$u.Name("instancePath"),parentData:new codegen_1$u.Name("parentData"),parentDataProperty:new codegen_1$u.Name("parentDataProperty"),rootData:new codegen_1$u.Name("rootData"),dynamicAnchors:new codegen_1$u.Name("dynamicAnchors"),vErrors:new codegen_1$u.Name("vErrors"),errors:new codegen_1$u.Name("errors"),this:new codegen_1$u.Name("this"),self:new codegen_1$u.Name("self"),scope:new codegen_1$u.Name("scope"),json:new codegen_1$u.Name("json"),jsonPos:new codegen_1$u.Name("jsonPos"),jsonLen:new codegen_1$u.Name("jsonLen"),jsonPart:new codegen_1$u.Name("jsonPart")};names$1.default=names,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=codegen,n=util,r=names$1;function o(e,n){const o=e.const("err",n);e.if(t._`${r.default.vErrors} === null`,()=>e.assign(r.default.vErrors,t._`[${o}]`),t._`${r.default.vErrors}.push(${o})`),e.code(t._`${r.default.errors}++`)}function a(e,n){const{gen:r,validateName:o,schemaEnv:a}=e;a.$async?r.throw(t._`new ${e.ValidationError}(${n})`):(r.assign(t._`${o}.errors`,n),r.return(!1))}e.keywordError={message:({keyword:e})=>t.str`must pass "${e}" keyword validation`},e.keyword$DataError={message:({keyword:e,schemaType:n})=>n?t.str`"${e}" keyword must be ${n} ($data)`:t.str`"${e}" keyword is invalid ($data)`},e.reportError=function(n,r=e.keywordError,i,l){const{it:u}=n,{gen:c,compositeRule:d,allErrors:f}=u,p=s(n,r,i);(null!=l?l:d||f)?o(c,p):a(u,t._`[${p}]`)},e.reportExtraError=function(t,n=e.keywordError,i){const{it:l}=t,{gen:u,compositeRule:c,allErrors:d}=l;o(u,s(t,n,i)),c||d||a(l,r.default.vErrors)},e.resetErrorsCount=function(e,n){e.assign(r.default.errors,n),e.if(t._`${r.default.vErrors} !== null`,()=>e.if(n,()=>e.assign(t._`${r.default.vErrors}.length`,n),()=>e.assign(r.default.vErrors,null)))},e.extendErrors=function({gen:e,keyword:n,schemaValue:o,data:a,errsCount:i,it:s}){if(void 0===i)throw new Error("ajv implementation error");const l=e.name("err");e.forRange("i",i,r.default.errors,i=>{e.const(l,t._`${r.default.vErrors}[${i}]`),e.if(t._`${l}.instancePath === undefined`,()=>e.assign(t._`${l}.instancePath`,(0,t.strConcat)(r.default.instancePath,s.errorPath))),e.assign(t._`${l}.schemaPath`,t.str`${s.errSchemaPath}/${n}`),s.opts.verbose&&(e.assign(t._`${l}.schema`,o),e.assign(t._`${l}.data`,a))})};const i={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function s(e,n,o){const{createErrors:a}=e.it;return!1===a?t._`{}`:function(e,n,o={}){const{gen:a,it:s}=e,c=[l(s,o),u(e,o)];return function(e,{params:n,message:o},a){const{keyword:s,data:l,schemaValue:u,it:c}=e,{opts:d,propertyName:f,topSchemaRef:p,schemaPath:h}=c;a.push([i.keyword,s],[i.params,"function"==typeof n?n(e):n||t._`{}`]),d.messages&&a.push([i.message,"function"==typeof o?o(e):o]);d.verbose&&a.push([i.schema,u],[i.parentSchema,t._`${p}${h}`],[r.default.data,l]);f&&a.push([i.propertyName,f])}(e,n,c),a.object(...c)}(e,n,o)}function l({errorPath:e},{instancePath:o}){const a=o?t.str`${e}${(0,n.getErrorPath)(o,n.Type.Str)}`:e;return[r.default.instancePath,(0,t.strConcat)(r.default.instancePath,a)]}function u({keyword:e,it:{errSchemaPath:r}},{schemaPath:o,parentSchema:a}){let s=a?r:t.str`${r}/${e}`;return o&&(s=t.str`${s}${(0,n.getErrorPath)(o,n.Type.Str)}`),[i.schemaPath,s]}}(errors),Object.defineProperty(boolSchema,"__esModule",{value:!0}),boolSchema.boolOrEmptySchema=boolSchema.topBoolOrEmptySchema=void 0;const errors_1$3=errors,codegen_1$t=codegen,names_1$6=names$1,boolError={message:"boolean schema is false"};function topBoolOrEmptySchema(e){const{gen:t,schema:n,validateName:r}=e;!1===n?falseSchemaError(e,!1):"object"==typeof n&&!0===n.$async?t.return(names_1$6.default.data):(t.assign(codegen_1$t._`${r}.errors`,null),t.return(!0))}function boolOrEmptySchema(e,t){const{gen:n,schema:r}=e;!1===r?(n.var(t,!1),falseSchemaError(e)):n.var(t,!0)}function falseSchemaError(e,t){const{gen:n,data:r}=e,o={gen:n,keyword:"false schema",data:r,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,errors_1$3.reportError)(o,boolError,void 0,t)}boolSchema.topBoolOrEmptySchema=topBoolOrEmptySchema,boolSchema.boolOrEmptySchema=boolOrEmptySchema;var dataType={},rules={};Object.defineProperty(rules,"__esModule",{value:!0}),rules.getRules=rules.isJSONType=void 0;const _jsonTypes=["string","number","integer","boolean","null","object","array"],jsonTypes=new Set(_jsonTypes);function isJSONType(e){return"string"==typeof e&&jsonTypes.has(e)}function getRules(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}rules.isJSONType=isJSONType,rules.getRules=getRules;var applicability={};function schemaHasRulesForType({schema:e,self:t},n){const r=t.RULES.types[n];return r&&!0!==r&&shouldUseGroup(e,r)}function shouldUseGroup(e,t){return t.rules.some(t=>shouldUseRule(e,t))}function shouldUseRule(e,t){var n;return void 0!==e[t.keyword]||(null===(n=t.definition.implements)||void 0===n?void 0:n.some(t=>void 0!==e[t]))}Object.defineProperty(applicability,"__esModule",{value:!0}),applicability.shouldUseRule=applicability.shouldUseGroup=applicability.schemaHasRulesForType=void 0,applicability.schemaHasRulesForType=schemaHasRulesForType,applicability.shouldUseGroup=shouldUseGroup,applicability.shouldUseRule=shouldUseRule,Object.defineProperty(dataType,"__esModule",{value:!0}),dataType.reportTypeError=dataType.checkDataTypes=dataType.checkDataType=dataType.coerceAndCheckDataType=dataType.getJSONTypes=dataType.getSchemaTypes=dataType.DataType=void 0;const rules_1=rules,applicability_1$1=applicability,errors_1$2=errors,codegen_1$s=codegen,util_1$q=util;var DataType,DataType2;function getSchemaTypes(e){const t=getJSONTypes(e.type);if(t.includes("null")){if(!1===e.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&void 0!==e.nullable)throw new Error('"nullable" cannot be used without "type"');!0===e.nullable&&t.push("null")}return t}function getJSONTypes(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(rules_1.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}function coerceAndCheckDataType(e,t){const{gen:n,data:r,opts:o}=e,a=coerceToTypes(t,o.coerceTypes),i=t.length>0&&!(0===a.length&&1===t.length&&(0,applicability_1$1.schemaHasRulesForType)(e,t[0]));if(i){const i=checkDataTypes(t,r,o.strictNumbers,DataType.Wrong);n.if(i,()=>{a.length?coerceData(e,t,a):reportTypeError(e)})}return i}DataType2=DataType||(dataType.DataType=DataType={}),DataType2[DataType2.Correct=0]="Correct",DataType2[DataType2.Wrong=1]="Wrong",dataType.getSchemaTypes=getSchemaTypes,dataType.getJSONTypes=getJSONTypes,dataType.coerceAndCheckDataType=coerceAndCheckDataType;const COERCIBLE=new Set(["string","number","integer","boolean","null"]);function coerceToTypes(e,t){return t?e.filter(e=>COERCIBLE.has(e)||"array"===t&&"array"===e):[]}function coerceData(e,t,n){const{gen:r,data:o,opts:a}=e,i=r.let("dataType",codegen_1$s._`typeof ${o}`),s=r.let("coerced",codegen_1$s._`undefined`);"array"===a.coerceTypes&&r.if(codegen_1$s._`${i} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>r.assign(o,codegen_1$s._`${o}[0]`).assign(i,codegen_1$s._`typeof ${o}`).if(checkDataTypes(t,o,a.strictNumbers),()=>r.assign(s,o))),r.if(codegen_1$s._`${s} !== undefined`);for(const u of n)(COERCIBLE.has(u)||"array"===u&&"array"===a.coerceTypes)&&l(u);function l(e){switch(e){case"string":return void r.elseIf(codegen_1$s._`${i} == "number" || ${i} == "boolean"`).assign(s,codegen_1$s._`"" + ${o}`).elseIf(codegen_1$s._`${o} === null`).assign(s,codegen_1$s._`""`);case"number":return void r.elseIf(codegen_1$s._`${i} == "boolean" || ${o} === null
69
69
  || (${i} == "string" && ${o} && ${o} == +${o})`).assign(s,codegen_1$s._`+${o}`);case"integer":return void r.elseIf(codegen_1$s._`${i} === "boolean" || ${o} === null
70
70
  || (${i} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(s,codegen_1$s._`+${o}`);case"boolean":return void r.elseIf(codegen_1$s._`${o} === "false" || ${o} === 0 || ${o} === null`).assign(s,!1).elseIf(codegen_1$s._`${o} === "true" || ${o} === 1`).assign(s,!0);case"null":return r.elseIf(codegen_1$s._`${o} === "" || ${o} === 0 || ${o} === false`),void r.assign(s,null);case"array":r.elseIf(codegen_1$s._`${i} === "string" || ${i} === "number"
71
71
  || ${i} === "boolean" || ${o} === null`).assign(s,codegen_1$s._`[${o}]`)}}r.else(),reportTypeError(e),r.endIf(),r.if(codegen_1$s._`${s} !== undefined`,()=>{r.assign(o,s),assignParentData(e,s)})}function assignParentData({gen:e,parentData:t,parentDataProperty:n},r){e.if(codegen_1$s._`${t} !== undefined`,()=>e.assign(codegen_1$s._`${t}[${n}]`,r))}function checkDataType(e,t,n,r=DataType.Correct){const o=r===DataType.Correct?codegen_1$s.operators.EQ:codegen_1$s.operators.NEQ;let a;switch(e){case"null":return codegen_1$s._`${t} ${o} null`;case"array":a=codegen_1$s._`Array.isArray(${t})`;break;case"object":a=codegen_1$s._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":a=i(codegen_1$s._`!(${t} % 1) && !isNaN(${t})`);break;case"number":a=i();break;default:return codegen_1$s._`typeof ${t} ${o} ${e}`}return r===DataType.Correct?a:(0,codegen_1$s.not)(a);function i(e=codegen_1$s.nil){return(0,codegen_1$s.and)(codegen_1$s._`typeof ${t} == "number"`,e,n?codegen_1$s._`isFinite(${t})`:codegen_1$s.nil)}}function checkDataTypes(e,t,n,r){if(1===e.length)return checkDataType(e[0],t,n,r);let o;const a=(0,util_1$q.toHash)(e);if(a.array&&a.object){const e=codegen_1$s._`typeof ${t} != "object"`;o=a.null?e:codegen_1$s._`!${t} || ${e}`,delete a.null,delete a.array,delete a.object}else o=codegen_1$s.nil;a.number&&delete a.integer;for(const i in a)o=(0,codegen_1$s.and)(o,checkDataType(i,t,n,r));return o}dataType.checkDataType=checkDataType,dataType.checkDataTypes=checkDataTypes;const typeError={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>"string"==typeof e?codegen_1$s._`{type: ${e}}`:codegen_1$s._`{type: ${t}}`};function reportTypeError(e){const t=getTypeErrorContext(e);(0,errors_1$2.reportError)(t,typeError)}function getTypeErrorContext(e){const{gen:t,data:n,schema:r}=e,o=(0,util_1$q.schemaRefOrVal)(e,r,"type");return{gen:t,keyword:"type",data:n,schema:r.type,schemaCode:o,schemaValue:o,parentSchema:r,params:{},it:e}}dataType.reportTypeError=reportTypeError;var defaults={};Object.defineProperty(defaults,"__esModule",{value:!0}),defaults.assignDefaults=void 0;const codegen_1$r=codegen,util_1$p=util;function assignDefaults(e,t){const{properties:n,items:r}=e.schema;if("object"===t&&n)for(const o in n)assignDefault(e,o,n[o].default);else"array"===t&&Array.isArray(r)&&r.forEach((t,n)=>assignDefault(e,n,t.default))}function assignDefault(e,t,n){const{gen:r,compositeRule:o,data:a,opts:i}=e;if(void 0===n)return;const s=codegen_1$r._`${a}${(0,codegen_1$r.getProperty)(t)}`;if(o)return void(0,util_1$p.checkStrictMode)(e,`default is ignored for: ${s}`);let l=codegen_1$r._`${s} === undefined`;"empty"===i.useDefaults&&(l=codegen_1$r._`${l} || ${s} === null || ${s} === ""`),r.if(l,codegen_1$r._`${s} = ${(0,codegen_1$r.stringify)(n)}`)}defaults.assignDefaults=assignDefaults;var keyword={},code={};Object.defineProperty(code,"__esModule",{value:!0}),code.validateUnion=code.validateArray=code.usePattern=code.callValidateCode=code.schemaProperties=code.allSchemaProperties=code.noPropertyInData=code.propertyInData=code.isOwnProperty=code.hasPropFunc=code.reportMissingProp=code.checkMissingProp=code.checkReportMissingProp=void 0;const codegen_1$q=codegen,util_1$o=util,names_1$5=names$1,util_2$1=util;function checkReportMissingProp(e,t){const{gen:n,data:r,it:o}=e;n.if(noPropertyInData(n,r,t,o.opts.ownProperties),()=>{e.setParams({missingProperty:codegen_1$q._`${t}`},!0),e.error()})}function checkMissingProp({gen:e,data:t,it:{opts:n}},r,o){return(0,codegen_1$q.or)(...r.map(r=>(0,codegen_1$q.and)(noPropertyInData(e,t,r,n.ownProperties),codegen_1$q._`${o} = ${r}`)))}function reportMissingProp(e,t){e.setParams({missingProperty:t},!0),e.error()}function hasPropFunc(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:codegen_1$q._`Object.prototype.hasOwnProperty`})}function isOwnProperty(e,t,n){return codegen_1$q._`${hasPropFunc(e)}.call(${t}, ${n})`}function propertyInData(e,t,n,r){const o=codegen_1$q._`${t}${(0,codegen_1$q.getProperty)(n)} !== undefined`;return r?codegen_1$q._`${o} && ${isOwnProperty(e,t,n)}`:o}function noPropertyInData(e,t,n,r){const o=codegen_1$q._`${t}${(0,codegen_1$q.getProperty)(n)} === undefined`;return r?(0,codegen_1$q.or)(o,(0,codegen_1$q.not)(isOwnProperty(e,t,n))):o}function allSchemaProperties(e){return e?Object.keys(e).filter(e=>"__proto__"!==e):[]}function schemaProperties(e,t){return allSchemaProperties(t).filter(n=>!(0,util_1$o.alwaysValidSchema)(e,t[n]))}function callValidateCode({schemaCode:e,data:t,it:{gen:n,topSchemaRef:r,schemaPath:o,errorPath:a},it:i},s,l,u){const c=u?codegen_1$q._`${e}, ${t}, ${r}${o}`:t,d=[[names_1$5.default.instancePath,(0,codegen_1$q.strConcat)(names_1$5.default.instancePath,a)],[names_1$5.default.parentData,i.parentData],[names_1$5.default.parentDataProperty,i.parentDataProperty],[names_1$5.default.rootData,names_1$5.default.rootData]];i.opts.dynamicRef&&d.push([names_1$5.default.dynamicAnchors,names_1$5.default.dynamicAnchors]);const f=codegen_1$q._`${c}, ${n.object(...d)}`;return l!==codegen_1$q.nil?codegen_1$q._`${s}.call(${l}, ${f})`:codegen_1$q._`${s}(${f})`}code.checkReportMissingProp=checkReportMissingProp,code.checkMissingProp=checkMissingProp,code.reportMissingProp=reportMissingProp,code.hasPropFunc=hasPropFunc,code.isOwnProperty=isOwnProperty,code.propertyInData=propertyInData,code.noPropertyInData=noPropertyInData,code.allSchemaProperties=allSchemaProperties,code.schemaProperties=schemaProperties,code.callValidateCode=callValidateCode;const newRegExp=codegen_1$q._`new RegExp`;function usePattern({gen:e,it:{opts:t}},n){const r=t.unicodeRegExp?"u":"",{regExp:o}=t.code,a=o(n,r);return e.scopeValue("pattern",{key:a.toString(),ref:a,code:codegen_1$q._`${"new RegExp"===o.code?newRegExp:(0,util_2$1.useFunc)(e,o)}(${n}, ${r})`})}function validateArray(e){const{gen:t,data:n,keyword:r,it:o}=e,a=t.name("valid");if(o.allErrors){const e=t.let("valid",!0);return i(()=>t.assign(e,!1)),e}return t.var(a,!0),i(()=>t.break()),a;function i(o){const i=t.const("len",codegen_1$q._`${n}.length`);t.forRange("i",0,i,n=>{e.subschema({keyword:r,dataProp:n,dataPropType:util_1$o.Type.Num},a),t.if((0,codegen_1$q.not)(a),o)})}}function validateUnion(e){const{gen:t,schema:n,keyword:r,it:o}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");if(n.some(e=>(0,util_1$o.alwaysValidSchema)(o,e))&&!o.opts.unevaluated)return;const a=t.let("valid",!1),i=t.name("_valid");t.block(()=>n.forEach((n,o)=>{const s=e.subschema({keyword:r,schemaProp:o,compositeRule:!0},i);t.assign(a,codegen_1$q._`${a} || ${i}`);e.mergeValidEvaluated(s,i)||t.if((0,codegen_1$q.not)(a))})),e.result(a,()=>e.reset(),()=>e.error(!0))}code.usePattern=usePattern,code.validateArray=validateArray,code.validateUnion=validateUnion,Object.defineProperty(keyword,"__esModule",{value:!0}),keyword.validateKeywordUsage=keyword.validSchemaType=keyword.funcKeywordCode=keyword.macroKeywordCode=void 0;const codegen_1$p=codegen,names_1$4=names$1,code_1$9=code,errors_1$1=errors;function macroKeywordCode(e,t){const{gen:n,keyword:r,schema:o,parentSchema:a,it:i}=e,s=t.macro.call(i.self,o,a,i),l=useKeyword(n,r,s);!1!==i.opts.validateSchema&&i.self.validateSchema(s,!0);const u=n.name("valid");e.subschema({schema:s,schemaPath:codegen_1$p.nil,errSchemaPath:`${i.errSchemaPath}/${r}`,topSchemaRef:l,compositeRule:!0},u),e.pass(u,()=>e.error(!0))}function funcKeywordCode(e,t){var n;const{gen:r,keyword:o,schema:a,parentSchema:i,$data:s,it:l}=e;checkAsyncKeyword(l,t);const u=!s&&t.compile?t.compile.call(l.self,a,i,l):t.validate,c=useKeyword(r,o,u),d=r.let("valid");function f(n=(t.async?codegen_1$p._`await `:codegen_1$p.nil)){const o=l.opts.passContext?names_1$4.default.this:names_1$4.default.self,a=!("compile"in t&&!s||!1===t.schema);r.assign(d,codegen_1$p._`${n}${(0,code_1$9.callValidateCode)(e,c,o,a)}`,t.modifying)}function p(e){var n;r.if((0,codegen_1$p.not)(null!==(n=t.valid)&&void 0!==n?n:d),e)}e.block$data(d,function(){if(!1===t.errors)f(),t.modifying&&modifyData(e),p(()=>e.error());else{const n=t.async?function(){const e=r.let("ruleErrs",null);return r.try(()=>f(codegen_1$p._`await `),t=>r.assign(d,!1).if(codegen_1$p._`${t} instanceof ${l.ValidationError}`,()=>r.assign(e,codegen_1$p._`${t}.errors`),()=>r.throw(t))),e}():function(){const e=codegen_1$p._`${c}.errors`;return r.assign(e,null),f(codegen_1$p.nil),e}();t.modifying&&modifyData(e),p(()=>addErrs(e,n))}}),e.ok(null!==(n=t.valid)&&void 0!==n?n:d)}function modifyData(e){const{gen:t,data:n,it:r}=e;t.if(r.parentData,()=>t.assign(n,codegen_1$p._`${r.parentData}[${r.parentDataProperty}]`))}function addErrs(e,t){const{gen:n}=e;n.if(codegen_1$p._`Array.isArray(${t})`,()=>{n.assign(names_1$4.default.vErrors,codegen_1$p._`${names_1$4.default.vErrors} === null ? ${t} : ${names_1$4.default.vErrors}.concat(${t})`).assign(names_1$4.default.errors,codegen_1$p._`${names_1$4.default.vErrors}.length`),(0,errors_1$1.extendErrors)(e)},()=>e.error())}function checkAsyncKeyword({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}function useKeyword(e,t,n){if(void 0===n)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword","function"==typeof n?{ref:n}:{ref:n,code:(0,codegen_1$p.stringify)(n)})}function validSchemaType(e,t,n=!1){return!t.length||t.some(t=>"array"===t?Array.isArray(e):"object"===t?e&&"object"==typeof e&&!Array.isArray(e):typeof e==t||n&&void 0===e)}function validateKeywordUsage({schema:e,opts:t,self:n,errSchemaPath:r},o,a){if(Array.isArray(o.keyword)?!o.keyword.includes(a):o.keyword!==a)throw new Error("ajv implementation error");const i=o.dependencies;if(null==i?void 0:i.some(t=>!Object.prototype.hasOwnProperty.call(e,t)))throw new Error(`parent schema must have dependencies of ${a}: ${i.join(",")}`);if(o.validateSchema){if(!o.validateSchema(e[a])){const e=`keyword "${a}" value is invalid at path "${r}": `+n.errorsText(o.validateSchema.errors);if("log"!==t.validateSchema)throw new Error(e);n.logger.error(e)}}}keyword.macroKeywordCode=macroKeywordCode,keyword.funcKeywordCode=funcKeywordCode,keyword.validSchemaType=validSchemaType,keyword.validateKeywordUsage=validateKeywordUsage;var subschema={};Object.defineProperty(subschema,"__esModule",{value:!0}),subschema.extendSubschemaMode=subschema.extendSubschemaData=subschema.getSubschema=void 0;const codegen_1$o=codegen,util_1$n=util;function getSubschema(e,{keyword:t,schemaProp:n,schema:r,schemaPath:o,errSchemaPath:a,topSchemaRef:i}){if(void 0!==t&&void 0!==r)throw new Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==t){const r=e.schema[t];return void 0===n?{schema:r,schemaPath:codegen_1$o._`${e.schemaPath}${(0,codegen_1$o.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:r[n],schemaPath:codegen_1$o._`${e.schemaPath}${(0,codegen_1$o.getProperty)(t)}${(0,codegen_1$o.getProperty)(n)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,util_1$n.escapeFragment)(n)}`}}if(void 0!==r){if(void 0===o||void 0===a||void 0===i)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:r,schemaPath:o,topSchemaRef:i,errSchemaPath:a}}throw new Error('either "keyword" or "schema" must be passed')}function extendSubschemaData(e,t,{dataProp:n,dataPropType:r,data:o,dataTypes:a,propertyName:i}){if(void 0!==o&&void 0!==n)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:s}=t;if(void 0!==n){const{errorPath:o,dataPathArr:a,opts:i}=t;l(s.let("data",codegen_1$o._`${t.data}${(0,codegen_1$o.getProperty)(n)}`,!0)),e.errorPath=codegen_1$o.str`${o}${(0,util_1$n.getErrorPath)(n,r,i.jsPropertySyntax)}`,e.parentDataProperty=codegen_1$o._`${n}`,e.dataPathArr=[...a,e.parentDataProperty]}if(void 0!==o){l(o instanceof codegen_1$o.Name?o:s.let("data",o,!0)),void 0!==i&&(e.propertyName=i)}function l(n){e.data=n,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,n]}a&&(e.dataTypes=a)}function extendSubschemaMode(e,{jtdDiscriminator:t,jtdMetadata:n,compositeRule:r,createErrors:o,allErrors:a}){void 0!==r&&(e.compositeRule=r),void 0!==o&&(e.createErrors=o),void 0!==a&&(e.allErrors=a),e.jtdDiscriminator=t,e.jtdMetadata=n}subschema.getSubschema=getSubschema,subschema.extendSubschemaData=extendSubschemaData,subschema.extendSubschemaMode=extendSubschemaMode;var resolve$2={},fastDeepEqual=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,o,a;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(o=r;0!==o--;)if(!e(t[o],n[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(a=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(o=r;0!==o--;)if(!Object.prototype.hasOwnProperty.call(n,a[o]))return!1;for(o=r;0!==o--;){var i=a[o];if(!e(t[i],n[i]))return!1}return!0}return t!=t&&n!=n},jsonSchemaTraverse={exports:{}},traverse$1=jsonSchemaTraverse.exports=function(e,t,n){"function"==typeof t&&(n=t,t={}),_traverse(t,"function"==typeof(n=t.cb||n)?n:n.pre||function(){},n.post||function(){},e,"",e)};function _traverse(e,t,n,r,o,a,i,s,l,u){if(r&&"object"==typeof r&&!Array.isArray(r)){for(var c in t(r,o,a,i,s,l,u),r){var d=r[c];if(Array.isArray(d)){if(c in traverse$1.arrayKeywords)for(var f=0;f<d.length;f++)_traverse(e,t,n,d[f],o+"/"+c+"/"+f,a,o,c,r,f)}else if(c in traverse$1.propsKeywords){if(d&&"object"==typeof d)for(var p in d)_traverse(e,t,n,d[p],o+"/"+c+"/"+escapeJsonPtr(p),a,o,c,r,p)}else(c in traverse$1.keywords||e.allKeys&&!(c in traverse$1.skipKeywords))&&_traverse(e,t,n,d,o+"/"+c,a,o,c,r)}n(r,o,a,i,s,l,u)}}function escapeJsonPtr(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}traverse$1.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},traverse$1.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},traverse$1.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},traverse$1.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};var jsonSchemaTraverseExports=jsonSchemaTraverse.exports;Object.defineProperty(resolve$2,"__esModule",{value:!0}),resolve$2.getSchemaRefs=resolve$2.resolveUrl=resolve$2.normalizeId=resolve$2._getFullPath=resolve$2.getFullPath=resolve$2.inlineRef=void 0;const util_1$m=util,equal$3=fastDeepEqual,traverse=jsonSchemaTraverseExports,SIMPLE_INLINED=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function inlineRef(e,t=!0){return"boolean"==typeof e||(!0===t?!hasRef(e):!!t&&countKeys(e)<=t)}resolve$2.inlineRef=inlineRef;const REF_KEYWORDS=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function hasRef(e){for(const t in e){if(REF_KEYWORDS.has(t))return!0;const n=e[t];if(Array.isArray(n)&&n.some(hasRef))return!0;if("object"==typeof n&&hasRef(n))return!0}return!1}function countKeys(e){let t=0;for(const n in e){if("$ref"===n)return 1/0;if(t++,!SIMPLE_INLINED.has(n)&&("object"==typeof e[n]&&(0,util_1$m.eachItem)(e[n],e=>t+=countKeys(e)),t===1/0))return 1/0}return t}function getFullPath(e,t="",n){!1!==n&&(t=normalizeId(t));const r=e.parse(t);return _getFullPath(e,r)}function _getFullPath(e,t){return e.serialize(t).split("#")[0]+"#"}resolve$2.getFullPath=getFullPath,resolve$2._getFullPath=_getFullPath;const TRAILING_SLASH_HASH=/#\/?$/;function normalizeId(e){return e?e.replace(TRAILING_SLASH_HASH,""):""}function resolveUrl(e,t,n){return n=normalizeId(n),e.resolve(t,n)}resolve$2.normalizeId=normalizeId,resolve$2.resolveUrl=resolveUrl;const ANCHOR=/^[a-z_][-a-z0-9._]*$/i;function getSchemaRefs(e,t){if("boolean"==typeof e)return{};const{schemaId:n,uriResolver:r}=this.opts,o=normalizeId(e[n]||t),a={"":o},i=getFullPath(r,o,!1),s={},l=new Set;return traverse(e,{allKeys:!0},(e,t,r,o)=>{if(void 0===o)return;const d=i+t;let f=a[o];function p(t){const n=this.opts.uriResolver.resolve;if(t=normalizeId(f?n(f,t):t),l.has(t))throw c(t);l.add(t);let r=this.refs[t];return"string"==typeof r&&(r=this.refs[r]),"object"==typeof r?u(e,r.schema,t):t!==normalizeId(d)&&("#"===t[0]?(u(e,s[t],t),s[t]=e):this.refs[t]=d),t}function h(e){if("string"==typeof e){if(!ANCHOR.test(e))throw new Error(`invalid anchor "${e}"`);p.call(this,`#${e}`)}}"string"==typeof e[n]&&(f=p.call(this,e[n])),h.call(this,e.$anchor),h.call(this,e.$dynamicAnchor),a[t]=f}),s;function u(e,t,n){if(void 0!==t&&!equal$3(e,t))throw c(n)}function c(e){return new Error(`reference "${e}" resolves to more than one schema`)}}resolve$2.getSchemaRefs=getSchemaRefs,Object.defineProperty(validate,"__esModule",{value:!0}),validate.getData=validate.KeywordCxt=validate.validateFunctionCode=void 0;const boolSchema_1=boolSchema,dataType_1$1=dataType,applicability_1=applicability,dataType_2=dataType,defaults_1=defaults,keyword_1=keyword,subschema_1=subschema,codegen_1$n=codegen,names_1$3=names$1,resolve_1$2=resolve$2,util_1$l=util,errors_1=errors;function validateFunctionCode(e){isSchemaObj(e)&&(checkKeywords(e),schemaCxtHasRules(e))?topSchemaObjCode(e):validateFunction(e,()=>(0,boolSchema_1.topBoolOrEmptySchema)(e))}function validateFunction({gen:e,validateName:t,schema:n,schemaEnv:r,opts:o},a){o.code.es5?e.func(t,codegen_1$n._`${names_1$3.default.data}, ${names_1$3.default.valCxt}`,r.$async,()=>{e.code(codegen_1$n._`"use strict"; ${funcSourceUrl(n,o)}`),destructureValCxtES5(e,o),e.code(a)}):e.func(t,codegen_1$n._`${names_1$3.default.data}, ${destructureValCxt(o)}`,r.$async,()=>e.code(funcSourceUrl(n,o)).code(a))}function destructureValCxt(e){return codegen_1$n._`{${names_1$3.default.instancePath}="", ${names_1$3.default.parentData}, ${names_1$3.default.parentDataProperty}, ${names_1$3.default.rootData}=${names_1$3.default.data}${e.dynamicRef?codegen_1$n._`, ${names_1$3.default.dynamicAnchors}={}`:codegen_1$n.nil}}={}`}function destructureValCxtES5(e,t){e.if(names_1$3.default.valCxt,()=>{e.var(names_1$3.default.instancePath,codegen_1$n._`${names_1$3.default.valCxt}.${names_1$3.default.instancePath}`),e.var(names_1$3.default.parentData,codegen_1$n._`${names_1$3.default.valCxt}.${names_1$3.default.parentData}`),e.var(names_1$3.default.parentDataProperty,codegen_1$n._`${names_1$3.default.valCxt}.${names_1$3.default.parentDataProperty}`),e.var(names_1$3.default.rootData,codegen_1$n._`${names_1$3.default.valCxt}.${names_1$3.default.rootData}`),t.dynamicRef&&e.var(names_1$3.default.dynamicAnchors,codegen_1$n._`${names_1$3.default.valCxt}.${names_1$3.default.dynamicAnchors}`)},()=>{e.var(names_1$3.default.instancePath,codegen_1$n._`""`),e.var(names_1$3.default.parentData,codegen_1$n._`undefined`),e.var(names_1$3.default.parentDataProperty,codegen_1$n._`undefined`),e.var(names_1$3.default.rootData,names_1$3.default.data),t.dynamicRef&&e.var(names_1$3.default.dynamicAnchors,codegen_1$n._`{}`)})}function topSchemaObjCode(e){const{schema:t,opts:n,gen:r}=e;validateFunction(e,()=>{n.$comment&&t.$comment&&commentKeyword(e),checkNoDefault(e),r.let(names_1$3.default.vErrors,null),r.let(names_1$3.default.errors,0),n.unevaluated&&resetEvaluated(e),typeAndKeywords(e),returnResults(e)})}function resetEvaluated(e){const{gen:t,validateName:n}=e;e.evaluated=t.const("evaluated",codegen_1$n._`${n}.evaluated`),t.if(codegen_1$n._`${e.evaluated}.dynamicProps`,()=>t.assign(codegen_1$n._`${e.evaluated}.props`,codegen_1$n._`undefined`)),t.if(codegen_1$n._`${e.evaluated}.dynamicItems`,()=>t.assign(codegen_1$n._`${e.evaluated}.items`,codegen_1$n._`undefined`))}function funcSourceUrl(e,t){const n="object"==typeof e&&e[t.schemaId];return n&&(t.code.source||t.code.process)?codegen_1$n._`/*# sourceURL=${n} */`:codegen_1$n.nil}function subschemaCode(e,t){isSchemaObj(e)&&(checkKeywords(e),schemaCxtHasRules(e))?subSchemaObjCode(e,t):(0,boolSchema_1.boolOrEmptySchema)(e,t)}function schemaCxtHasRules({schema:e,self:t}){if("boolean"==typeof e)return!e;for(const n in e)if(t.RULES.all[n])return!0;return!1}function isSchemaObj(e){return"boolean"!=typeof e.schema}function subSchemaObjCode(e,t){const{schema:n,gen:r,opts:o}=e;o.$comment&&n.$comment&&commentKeyword(e),updateContext(e),checkAsyncSchema(e);const a=r.const("_errs",names_1$3.default.errors);typeAndKeywords(e,a),r.var(t,codegen_1$n._`${a} === ${names_1$3.default.errors}`)}function checkKeywords(e){(0,util_1$l.checkUnknownRules)(e),checkRefsAndKeywords(e)}function typeAndKeywords(e,t){if(e.opts.jtd)return schemaKeywords(e,[],!1,t);const n=(0,dataType_1$1.getSchemaTypes)(e.schema);schemaKeywords(e,n,!(0,dataType_1$1.coerceAndCheckDataType)(e,n),t)}function checkRefsAndKeywords(e){const{schema:t,errSchemaPath:n,opts:r,self:o}=e;t.$ref&&r.ignoreKeywordsWithRef&&(0,util_1$l.schemaHasRulesButRef)(t,o.RULES)&&o.logger.warn(`$ref: keywords ignored in schema at path "${n}"`)}function checkNoDefault(e){const{schema:t,opts:n}=e;void 0!==t.default&&n.useDefaults&&n.strictSchema&&(0,util_1$l.checkStrictMode)(e,"default is ignored in the schema root")}function updateContext(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,resolve_1$2.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function checkAsyncSchema(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}function commentKeyword({gen:e,schemaEnv:t,schema:n,errSchemaPath:r,opts:o}){const a=n.$comment;if(!0===o.$comment)e.code(codegen_1$n._`${names_1$3.default.self}.logger.log(${a})`);else if("function"==typeof o.$comment){const n=codegen_1$n.str`${r}/$comment`,o=e.scopeValue("root",{ref:t.root});e.code(codegen_1$n._`${names_1$3.default.self}.opts.$comment(${a}, ${n}, ${o}.schema)`)}}function returnResults(e){const{gen:t,schemaEnv:n,validateName:r,ValidationError:o,opts:a}=e;n.$async?t.if(codegen_1$n._`${names_1$3.default.errors} === 0`,()=>t.return(names_1$3.default.data),()=>t.throw(codegen_1$n._`new ${o}(${names_1$3.default.vErrors})`)):(t.assign(codegen_1$n._`${r}.errors`,names_1$3.default.vErrors),a.unevaluated&&assignEvaluated(e),t.return(codegen_1$n._`${names_1$3.default.errors} === 0`))}function assignEvaluated({gen:e,evaluated:t,props:n,items:r}){n instanceof codegen_1$n.Name&&e.assign(codegen_1$n._`${t}.props`,n),r instanceof codegen_1$n.Name&&e.assign(codegen_1$n._`${t}.items`,r)}function schemaKeywords(e,t,n,r){const{gen:o,schema:a,data:i,allErrors:s,opts:l,self:u}=e,{RULES:c}=u;function d(u){(0,applicability_1.shouldUseGroup)(a,u)&&(u.type?(o.if((0,dataType_2.checkDataType)(u.type,i,l.strictNumbers)),iterateKeywords(e,u),1===t.length&&t[0]===u.type&&n&&(o.else(),(0,dataType_2.reportTypeError)(e)),o.endIf()):iterateKeywords(e,u),s||o.if(codegen_1$n._`${names_1$3.default.errors} === ${r||0}`))}!a.$ref||!l.ignoreKeywordsWithRef&&(0,util_1$l.schemaHasRulesButRef)(a,c)?(l.jtd||checkStrictTypes(e,t),o.block(()=>{for(const e of c.rules)d(e);d(c.post)})):o.block(()=>keywordCode(e,"$ref",c.all.$ref.definition))}function iterateKeywords(e,t){const{gen:n,schema:r,opts:{useDefaults:o}}=e;o&&(0,defaults_1.assignDefaults)(e,t.type),n.block(()=>{for(const n of t.rules)(0,applicability_1.shouldUseRule)(r,n)&&keywordCode(e,n.keyword,n.definition,t.type)})}function checkStrictTypes(e,t){!e.schemaEnv.meta&&e.opts.strictTypes&&(checkContextTypes(e,t),e.opts.allowUnionTypes||checkMultipleTypes(e,t),checkKeywordTypes(e,e.dataTypes))}function checkContextTypes(e,t){t.length&&(e.dataTypes.length?(t.forEach(t=>{includesType(e.dataTypes,t)||strictTypesError(e,`type "${t}" not allowed by context "${e.dataTypes.join(",")}"`)}),narrowSchemaTypes(e,t)):e.dataTypes=t)}function checkMultipleTypes(e,t){t.length>1&&(2!==t.length||!t.includes("null"))&&strictTypesError(e,"use allowUnionTypes to allow union type keyword")}function checkKeywordTypes(e,t){const n=e.self.RULES.all;for(const r in n){const o=n[r];if("object"==typeof o&&(0,applicability_1.shouldUseRule)(e.schema,o)){const{type:n}=o.definition;n.length&&!n.some(e=>hasApplicableType(t,e))&&strictTypesError(e,`missing type "${n.join(",")}" for keyword "${r}"`)}}}function hasApplicableType(e,t){return e.includes(t)||"number"===t&&e.includes("integer")}function includesType(e,t){return e.includes(t)||"integer"===t&&e.includes("number")}function narrowSchemaTypes(e,t){const n=[];for(const r of e.dataTypes)includesType(t,r)?n.push(r):t.includes("integer")&&"number"===r&&n.push("integer");e.dataTypes=n}function strictTypesError(e,t){t+=` at "${e.schemaEnv.baseId+e.errSchemaPath}" (strictTypes)`,(0,util_1$l.checkStrictMode)(e,t,e.opts.strictTypes)}validate.validateFunctionCode=validateFunctionCode;class KeywordCxt{constructor(e,t,n){if((0,keyword_1.validateKeywordUsage)(e,t,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,util_1$l.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",getData(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,keyword_1.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:!1!==t.errors)&&(this.errsCount=e.gen.const("_errs",names_1$3.default.errors))}result(e,t,n){this.failResult((0,codegen_1$n.not)(e),t,n)}failResult(e,t,n){this.gen.if(e),n?n():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,codegen_1$n.not)(e),void 0,t)}fail(e){if(void 0===e)return this.error(),void(this.allErrors||this.gen.if(!1));this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);const{schemaCode:t}=this;this.fail(codegen_1$n._`${t} !== undefined && (${(0,codegen_1$n.or)(this.invalid$data(),e)})`)}error(e,t,n){if(t)return this.setParams(t),this._error(e,n),void this.setParams({});this._error(e,n)}_error(e,t){(e?errors_1.reportExtraError:errors_1.reportError)(this,this.def.error,t)}$dataError(){(0,errors_1.reportError)(this,this.def.$dataError||errors_1.keyword$DataError)}reset(){if(void 0===this.errsCount)throw new Error('add "trackErrors" to keyword definition');(0,errors_1.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,n=codegen_1$n.nil){this.gen.block(()=>{this.check$data(e,n),t()})}check$data(e=codegen_1$n.nil,t=codegen_1$n.nil){if(!this.$data)return;const{gen:n,schemaCode:r,schemaType:o,def:a}=this;n.if((0,codegen_1$n.or)(codegen_1$n._`${r} === undefined`,t)),e!==codegen_1$n.nil&&n.assign(e,!0),(o.length||a.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==codegen_1$n.nil&&n.assign(e,!1)),n.else()}invalid$data(){const{gen:e,schemaCode:t,schemaType:n,def:r,it:o}=this;return(0,codegen_1$n.or)(function(){if(n.length){if(!(t instanceof codegen_1$n.Name))throw new Error("ajv implementation error");const e=Array.isArray(n)?n:[n];return codegen_1$n._`${(0,dataType_2.checkDataTypes)(e,t,o.opts.strictNumbers,dataType_2.DataType.Wrong)}`}return codegen_1$n.nil}(),function(){if(r.validateSchema){const n=e.scopeValue("validate$data",{ref:r.validateSchema});return codegen_1$n._`!${n}(${t})`}return codegen_1$n.nil}())}subschema(e,t){const n=(0,subschema_1.getSubschema)(this.it,e);(0,subschema_1.extendSubschemaData)(n,this.it,e),(0,subschema_1.extendSubschemaMode)(n,e);const r={...this.it,...n,items:void 0,props:void 0};return subschemaCode(r,t),r}mergeEvaluated(e,t){const{it:n,gen:r}=this;n.opts.unevaluated&&(!0!==n.props&&void 0!==e.props&&(n.props=util_1$l.mergeEvaluated.props(r,e.props,n.props,t)),!0!==n.items&&void 0!==e.items&&(n.items=util_1$l.mergeEvaluated.items(r,e.items,n.items,t)))}mergeValidEvaluated(e,t){const{it:n,gen:r}=this;if(n.opts.unevaluated&&(!0!==n.props||!0!==n.items))return r.if(t,()=>this.mergeEvaluated(e,codegen_1$n.Name)),!0}}function keywordCode(e,t,n,r){const o=new KeywordCxt(e,n,t);"code"in n?n.code(o,r):o.$data&&n.validate?(0,keyword_1.funcKeywordCode)(o,n):"macro"in n?(0,keyword_1.macroKeywordCode)(o,n):(n.compile||n.validate)&&(0,keyword_1.funcKeywordCode)(o,n)}validate.KeywordCxt=KeywordCxt;const JSON_POINTER=/^\/(?:[^~]|~0|~1)*$/,RELATIVE_JSON_POINTER=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function getData(e,{dataLevel:t,dataNames:n,dataPathArr:r}){let o,a;if(""===e)return names_1$3.default.rootData;if("/"===e[0]){if(!JSON_POINTER.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);o=e,a=names_1$3.default.rootData}else{const i=RELATIVE_JSON_POINTER.exec(e);if(!i)throw new Error(`Invalid JSON-pointer: ${e}`);const s=+i[1];if(o=i[2],"#"===o){if(s>=t)throw new Error(l("property/index",s));return r[t-s]}if(s>t)throw new Error(l("data",s));if(a=n[t-s],!o)return a}let i=a;const s=o.split("/");for(const u of s)u&&(a=codegen_1$n._`${a}${(0,codegen_1$n.getProperty)((0,util_1$l.unescapeJsonPointer)(u))}`,i=codegen_1$n._`${i} && ${a}`);return i;function l(e,n){return`Cannot access ${e} ${n} levels up, current level is ${t}`}}validate.getData=getData;var validation_error={};Object.defineProperty(validation_error,"__esModule",{value:!0});let ValidationError$1=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};validation_error.default=ValidationError$1;var ref_error={};Object.defineProperty(ref_error,"__esModule",{value:!0});const resolve_1$1=resolve$2;class MissingRefError extends Error{constructor(e,t,n,r){super(r||`can't resolve reference ${n} from id ${t}`),this.missingRef=(0,resolve_1$1.resolveUrl)(e,t,n),this.missingSchema=(0,resolve_1$1.normalizeId)((0,resolve_1$1.getFullPath)(e,this.missingRef))}}ref_error.default=MissingRefError;var compile={};Object.defineProperty(compile,"__esModule",{value:!0}),compile.resolveSchema=compile.getCompilingSchema=compile.resolveRef=compile.compileSchema=compile.SchemaEnv=void 0;const codegen_1$m=codegen,validation_error_1=validation_error,names_1$2=names$1,resolve_1=resolve$2,util_1$k=util,validate_1$1=validate;class SchemaEnv{constructor(e){var t;let n;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!==(t=e.baseId)&&void 0!==t?t:(0,resolve_1.normalizeId)(null==n?void 0:n[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null==n?void 0:n.$async,this.refs={}}}function compileSchema(e){const t=getCompilingSchema.call(this,e);if(t)return t;const n=(0,resolve_1.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:r,lines:o}=this.opts.code,{ownProperties:a}=this.opts,i=new codegen_1$m.CodeGen(this.scope,{es5:r,lines:o,ownProperties:a});let s;e.$async&&(s=i.scopeValue("Error",{ref:validation_error_1.default,code:codegen_1$m._`require("ajv/dist/runtime/validation_error").default`}));const l=i.scopeName("validate");e.validateName=l;const u={gen:i,allErrors:this.opts.allErrors,data:names_1$2.default.data,parentData:names_1$2.default.parentData,parentDataProperty:names_1$2.default.parentDataProperty,dataNames:[names_1$2.default.data],dataPathArr:[codegen_1$m.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:i.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,codegen_1$m.stringify)(e.schema)}:{ref:e.schema}),validateName:l,ValidationError:s,schema:e.schema,schemaEnv:e,rootId:n,baseId:e.baseId||n,schemaPath:codegen_1$m.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:codegen_1$m._`""`,opts:this.opts,self:this};let c;try{this._compilations.add(e),(0,validate_1$1.validateFunctionCode)(u),i.optimize(this.opts.code.optimize);const t=i.toString();c=`${i.scopeRefs(names_1$2.default.scope)}return ${t}`,this.opts.code.process&&(c=this.opts.code.process(c,e));const n=new Function(`${names_1$2.default.self}`,`${names_1$2.default.scope}`,c)(this,this.scope.get());if(this.scope.value(l,{ref:n}),n.errors=null,n.schema=e.schema,n.schemaEnv=e,e.$async&&(n.$async=!0),!0===this.opts.code.source&&(n.source={validateName:l,validateCode:t,scopeValues:i._values}),this.opts.unevaluated){const{props:e,items:t}=u;n.evaluated={props:e instanceof codegen_1$m.Name?void 0:e,items:t instanceof codegen_1$m.Name?void 0:t,dynamicProps:e instanceof codegen_1$m.Name,dynamicItems:t instanceof codegen_1$m.Name},n.source&&(n.source.evaluated=(0,codegen_1$m.stringify)(n.evaluated))}return e.validate=n,e}catch(d){throw delete e.validate,delete e.validateName,c&&this.logger.error("Error compiling schema, function code:",c),d}finally{this._compilations.delete(e)}}function resolveRef(e,t,n){var r;n=(0,resolve_1.resolveUrl)(this.opts.uriResolver,t,n);const o=e.refs[n];if(o)return o;let a=resolve$1.call(this,e,n);if(void 0===a){const o=null===(r=e.localRefs)||void 0===r?void 0:r[n],{schemaId:i}=this.opts;o&&(a=new SchemaEnv({schema:o,schemaId:i,root:e,baseId:t}))}return void 0!==a?e.refs[n]=inlineOrCompile.call(this,a):void 0}function inlineOrCompile(e){return(0,resolve_1.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:compileSchema.call(this,e)}function getCompilingSchema(e){for(const t of this._compilations)if(sameSchemaEnv(t,e))return t}function sameSchemaEnv(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function resolve$1(e,t){let n;for(;"string"==typeof(n=this.refs[t]);)t=n;return n||this.schemas[t]||resolveSchema.call(this,e,t)}function resolveSchema(e,t){const n=this.opts.uriResolver.parse(t),r=(0,resolve_1._getFullPath)(this.opts.uriResolver,n);let o=(0,resolve_1.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&r===o)return getJsonPointer.call(this,n,e);const a=(0,resolve_1.normalizeId)(r),i=this.refs[a]||this.schemas[a];if("string"==typeof i){const t=resolveSchema.call(this,e,i);if("object"!=typeof(null==t?void 0:t.schema))return;return getJsonPointer.call(this,n,t)}if("object"==typeof(null==i?void 0:i.schema)){if(i.validate||compileSchema.call(this,i),a===(0,resolve_1.normalizeId)(t)){const{schema:t}=i,{schemaId:n}=this.opts,r=t[n];return r&&(o=(0,resolve_1.resolveUrl)(this.opts.uriResolver,o,r)),new SchemaEnv({schema:t,schemaId:n,root:e,baseId:o})}return getJsonPointer.call(this,n,i)}}compile.SchemaEnv=SchemaEnv,compile.compileSchema=compileSchema,compile.resolveRef=resolveRef,compile.getCompilingSchema=getCompilingSchema,compile.resolveSchema=resolveSchema;const PREVENT_SCOPE_CHANGE=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function getJsonPointer(e,{baseId:t,schema:n,root:r}){var o;if("/"!==(null===(o=e.fragment)||void 0===o?void 0:o[0]))return;for(const s of e.fragment.slice(1).split("/")){if("boolean"==typeof n)return;const e=n[(0,util_1$k.unescapeFragment)(s)];if(void 0===e)return;const r="object"==typeof(n=e)&&n[this.opts.schemaId];!PREVENT_SCOPE_CHANGE.has(s)&&r&&(t=(0,resolve_1.resolveUrl)(this.opts.uriResolver,t,r))}let a;if("boolean"!=typeof n&&n.$ref&&!(0,util_1$k.schemaHasRulesButRef)(n,this.RULES)){const e=(0,resolve_1.resolveUrl)(this.opts.uriResolver,t,n.$ref);a=resolveSchema.call(this,r,e)}const{schemaId:i}=this.opts;return a=a||new SchemaEnv({schema:n,schemaId:i,root:r,baseId:t}),a.schema!==a.root.schema?a:void 0}const $id$1="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description="Meta-schema for $data reference (JSON AnySchema extension proposal)",type$1="object",required$1=["$data"],properties$2={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties$1=!1,require$$9={$id:$id$1,description:description,type:type$1,required:required$1,properties:properties$2,additionalProperties:additionalProperties$1};var uri$1={},fastUri$1={exports:{}};const isUUID$1=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),isIPv4$1=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function stringArrayToHexStripped(e){let t="",n=0,r=0;for(r=0;r<e.length;r++)if(n=e[r].charCodeAt(0),48!==n){if(!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return"";t+=e[r];break}for(r+=1;r<e.length;r++){if(n=e[r].charCodeAt(0),!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return"";t+=e[r]}return t}const nonSimpleDomain$1=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function consumeIsZone(e){return e.length=0,!0}function consumeHextets(e,t,n){if(e.length){const r=stringArrayToHexStripped(e);if(""===r)return n.error=!0,!1;t.push(r),e.length=0}return!0}function getIPV6(e){let t=0;const n={error:!1,address:"",zone:""},r=[],o=[];let a=!1,i=!1,s=consumeHextets;for(let l=0;l<e.length;l++){const u=e[l];if("["!==u&&"]"!==u)if(":"!==u)if("%"===u){if(!s(o,r,n))break;s=consumeIsZone}else o.push(u);else{if(!0===a&&(i=!0),!s(o,r,n))break;if(++t>7){n.error=!0;break}l>0&&":"===e[l-1]&&(a=!0),r.push(":")}}return o.length&&(s===consumeIsZone?n.zone=o.join(""):i?r.push(o.join("")):r.push(stringArrayToHexStripped(o))),n.address=r.join(""),n}function normalizeIPv6$1(e){if(findToken(e,":")<2)return{host:e,isIPV6:!1};const t=getIPV6(e);if(t.error)return{host:e,isIPV6:!1};{let e=t.address,n=t.address;return t.zone&&(e+="%"+t.zone,n+="%25"+t.zone),{host:e,isIPV6:!0,escapedHost:n}}}function findToken(e,t){let n=0;for(let r=0;r<e.length;r++)e[r]===t&&n++;return n}function removeDotSegments$1(e){let t=e;const n=[];let r=-1,o=0;for(;o=t.length;){if(1===o){if("."===t)break;if("/"===t){n.push("/");break}n.push(t);break}if(2===o){if("."===t[0]){if("."===t[1])break;if("/"===t[1]){t=t.slice(2);continue}}else if("/"===t[0]&&("."===t[1]||"/"===t[1])){n.push("/");break}}else if(3===o&&"/.."===t){0!==n.length&&n.pop(),n.push("/");break}if("."===t[0]){if("."===t[1]){if("/"===t[2]){t=t.slice(3);continue}}else if("/"===t[1]){t=t.slice(2);continue}}else if("/"===t[0]&&"."===t[1]){if("/"===t[2]){t=t.slice(2);continue}if("."===t[2]&&"/"===t[3]){t=t.slice(3),0!==n.length&&n.pop();continue}}if(-1===(r=t.indexOf("/",1))){n.push(t);break}n.push(t.slice(0,r)),t=t.slice(r)}return n.join("")}function normalizeComponentEncoding$1(e,t){const n=!0!==t?escape:unescape;return void 0!==e.scheme&&(e.scheme=n(e.scheme)),void 0!==e.userinfo&&(e.userinfo=n(e.userinfo)),void 0!==e.host&&(e.host=n(e.host)),void 0!==e.path&&(e.path=n(e.path)),void 0!==e.query&&(e.query=n(e.query)),void 0!==e.fragment&&(e.fragment=n(e.fragment)),e}function recomposeAuthority$1(e){const t=[];if(void 0!==e.userinfo&&(t.push(e.userinfo),t.push("@")),void 0!==e.host){let n=unescape(e.host);if(!isIPv4$1(n)){const t=normalizeIPv6$1(n);n=!0===t.isIPV6?`[${t.escapedHost}]`:e.host}t.push(n)}return"number"!=typeof e.port&&"string"!=typeof e.port||(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0}var utils$1={nonSimpleDomain:nonSimpleDomain$1,recomposeAuthority:recomposeAuthority$1,normalizeComponentEncoding:normalizeComponentEncoding$1,removeDotSegments:removeDotSegments$1,isIPv4:isIPv4$1,isUUID:isUUID$1,normalizeIPv6:normalizeIPv6$1};const{isUUID:isUUID}=utils$1,URN_REG=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function wsIsSecure(e){return!0===e.secure||!1!==e.secure&&(!!e.scheme&&!(3!==e.scheme.length||"w"!==e.scheme[0]&&"W"!==e.scheme[0]||"s"!==e.scheme[1]&&"S"!==e.scheme[1]||"s"!==e.scheme[2]&&"S"!==e.scheme[2]))}function httpParse(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function httpSerialize(e){const t="https"===String(e.scheme).toLowerCase();return e.port!==(t?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}function wsParse(e){return e.secure=wsIsSecure(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function wsSerialize(e){if(e.port!==(wsIsSecure(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){const[t,n]=e.resourceName.split("?");e.path=t&&"/"!==t?t:void 0,e.query=n,e.resourceName=void 0}return e.fragment=void 0,e}function urnParse(e,t){if(!e.path)return e.error="URN can not be parsed",e;const n=e.path.match(URN_REG);if(n){const r=t.scheme||e.scheme||"urn";e.nid=n[1].toLowerCase(),e.nss=n[2];const o=getSchemeHandler$1(`${r}:${t.nid||e.nid}`);e.path=void 0,o&&(e=o.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}function urnSerialize(e,t){if(void 0===e.nid)throw new Error("URN without nid cannot be serialized");const n=t.scheme||e.scheme||"urn",r=e.nid.toLowerCase(),o=getSchemeHandler$1(`${n}:${t.nid||r}`);o&&(e=o.serialize(e,t));const a=e,i=e.nss;return a.path=`${r||t.nid}:${i}`,t.skipEscape=!0,a}function urnuuidParse(e,t){const n=e;return n.uuid=n.nss,n.nss=void 0,t.tolerant||n.uuid&&isUUID(n.uuid)||(n.error=n.error||"UUID is not valid."),n}function urnuuidSerialize(e){const t=e;return t.nss=(e.uuid||"").toLowerCase(),t}const http={scheme:"http",domainHost:!0,parse:httpParse,serialize:httpSerialize},https={scheme:"https",domainHost:http.domainHost,parse:httpParse,serialize:httpSerialize},ws={scheme:"ws",domainHost:!0,parse:wsParse,serialize:wsSerialize},wss={scheme:"wss",domainHost:ws.domainHost,parse:ws.parse,serialize:ws.serialize},urn={scheme:"urn",parse:urnParse,serialize:urnSerialize,skipNormalize:!0},urnuuid={scheme:"urn:uuid",parse:urnuuidParse,serialize:urnuuidSerialize,skipNormalize:!0},SCHEMES$1={http:http,https:https,ws:ws,wss:wss,urn:urn,"urn:uuid":urnuuid};function getSchemeHandler$1(e){return e&&(SCHEMES$1[e]||SCHEMES$1[e.toLowerCase()])||void 0}Object.setPrototypeOf(SCHEMES$1,null);var schemes={SCHEMES:SCHEMES$1,getSchemeHandler:getSchemeHandler$1};const{normalizeIPv6:normalizeIPv6,removeDotSegments:removeDotSegments,recomposeAuthority:recomposeAuthority,normalizeComponentEncoding:normalizeComponentEncoding,isIPv4:isIPv4,nonSimpleDomain:nonSimpleDomain}=utils$1,{SCHEMES:SCHEMES,getSchemeHandler:getSchemeHandler}=schemes;function normalize(e,t){return"string"==typeof e?e=serialize(parse(e,t),t):"object"==typeof e&&(e=parse(serialize(e,t),t)),e}function resolve(e,t,n){const r=n?Object.assign({scheme:"null"},n):{scheme:"null"},o=resolveComponent(parse(e,r),parse(t,r),r,!0);return r.skipEscape=!0,serialize(o,r)}function resolveComponent(e,t,n,r){const o={};return r||(e=parse(serialize(e,n),n),t=parse(serialize(t,n),n)),!(n=n||{}).tolerant&&t.scheme?(o.scheme=t.scheme,o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=removeDotSegments(t.path||""),o.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=removeDotSegments(t.path||""),o.query=t.query):(t.path?("/"===t.path[0]?o.path=removeDotSegments(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?o.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:o.path=t.path:o.path="/"+t.path,o.path=removeDotSegments(o.path)),o.query=t.query):(o.path=e.path,void 0!==t.query?o.query=t.query:o.query=e.query),o.userinfo=e.userinfo,o.host=e.host,o.port=e.port),o.scheme=e.scheme),o.fragment=t.fragment,o}function equal$2(e,t,n){return"string"==typeof e?(e=unescape(e),e=serialize(normalizeComponentEncoding(parse(e,n),!0),{...n,skipEscape:!0})):"object"==typeof e&&(e=serialize(normalizeComponentEncoding(e,!0),{...n,skipEscape:!0})),"string"==typeof t?(t=unescape(t),t=serialize(normalizeComponentEncoding(parse(t,n),!0),{...n,skipEscape:!0})):"object"==typeof t&&(t=serialize(normalizeComponentEncoding(t,!0),{...n,skipEscape:!0})),e.toLowerCase()===t.toLowerCase()}function serialize(e,t){const n={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},r=Object.assign({},t),o=[],a=getSchemeHandler(r.scheme||n.scheme);a&&a.serialize&&a.serialize(n,r),void 0!==n.path&&(r.skipEscape?n.path=unescape(n.path):(n.path=escape(n.path),void 0!==n.scheme&&(n.path=n.path.split("%3A").join(":")))),"suffix"!==r.reference&&n.scheme&&o.push(n.scheme,":");const i=recomposeAuthority(n);if(void 0!==i&&("suffix"!==r.reference&&o.push("//"),o.push(i),n.path&&"/"!==n.path[0]&&o.push("/")),void 0!==n.path){let e=n.path;r.absolutePath||a&&a.absolutePath||(e=removeDotSegments(e)),void 0===i&&"/"===e[0]&&"/"===e[1]&&(e="/%2F"+e.slice(2)),o.push(e)}return void 0!==n.query&&o.push("?",n.query),void 0!==n.fragment&&o.push("#",n.fragment),o.join("")}const URI_PARSE=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function parse(e,t){const n=Object.assign({},t),r={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let o=!1;"suffix"===n.reference&&(e=n.scheme?n.scheme+":"+e:"//"+e);const a=e.match(URI_PARSE);if(a){if(r.scheme=a[1],r.userinfo=a[3],r.host=a[4],r.port=parseInt(a[5],10),r.path=a[6]||"",r.query=a[7],r.fragment=a[8],isNaN(r.port)&&(r.port=a[5]),r.host){if(!1===isIPv4(r.host)){const e=normalizeIPv6(r.host);r.host=e.host.toLowerCase(),o=e.isIPV6}else o=!0}void 0!==r.scheme||void 0!==r.userinfo||void 0!==r.host||void 0!==r.port||void 0!==r.query||r.path?void 0===r.scheme?r.reference="relative":void 0===r.fragment?r.reference="absolute":r.reference="uri":r.reference="same-document",n.reference&&"suffix"!==n.reference&&n.reference!==r.reference&&(r.error=r.error||"URI is not a "+n.reference+" reference.");const t=getSchemeHandler(n.scheme||r.scheme);if(!(n.unicodeSupport||t&&t.unicodeSupport)&&r.host&&(n.domainHost||t&&t.domainHost)&&!1===o&&nonSimpleDomain(r.host))try{r.host=URL.domainToASCII(r.host.toLowerCase())}catch(i){r.error=r.error||"Host's domain name can not be converted to ASCII: "+i}(!t||t&&!t.skipNormalize)&&(-1!==e.indexOf("%")&&(void 0!==r.scheme&&(r.scheme=unescape(r.scheme)),void 0!==r.host&&(r.host=unescape(r.host))),r.path&&(r.path=escape(unescape(r.path))),r.fragment&&(r.fragment=encodeURI(decodeURIComponent(r.fragment)))),t&&t.parse&&t.parse(r,n)}else r.error=r.error||"URI can not be parsed.";return r}const fastUri={SCHEMES:SCHEMES,normalize:normalize,resolve:resolve,resolveComponent:resolveComponent,equal:equal$2,serialize:serialize,parse:parse};fastUri$1.exports=fastUri,fastUri$1.exports.default=fastUri,fastUri$1.exports.fastUri=fastUri;var fastUriExports=fastUri$1.exports;Object.defineProperty(uri$1,"__esModule",{value:!0});const uri=fastUriExports;uri.code='require("ajv/dist/runtime/uri").default',uri$1.default=uri,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=validate;Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var n=codegen;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return n.CodeGen}});const r=validation_error,o=ref_error,a=rules,i=compile,s=codegen,l=resolve$2,u=dataType,c=util,d=require$$9,f=uri$1,p=(e,t)=>new RegExp(e,t);p.code="new RegExp";const h=["removeAdditional","useDefaults","coerceTypes"],m=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),g={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},b={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};function y(e){var t,n,r,o,a,i,s,l,u,c,d,h,m,g,b,y,_,v,w,S,x,T,E,k,P;const O=e.strict,A=null===(t=e.code)||void 0===t?void 0:t.optimize,$=!0===A||void 0===A?1:A||0,R=null!==(r=null===(n=e.code)||void 0===n?void 0:n.regExp)&&void 0!==r?r:p,I=null!==(o=e.uriResolver)&&void 0!==o?o:f.default;return{strictSchema:null===(i=null!==(a=e.strictSchema)&&void 0!==a?a:O)||void 0===i||i,strictNumbers:null===(l=null!==(s=e.strictNumbers)&&void 0!==s?s:O)||void 0===l||l,strictTypes:null!==(c=null!==(u=e.strictTypes)&&void 0!==u?u:O)&&void 0!==c?c:"log",strictTuples:null!==(h=null!==(d=e.strictTuples)&&void 0!==d?d:O)&&void 0!==h?h:"log",strictRequired:null!==(g=null!==(m=e.strictRequired)&&void 0!==m?m:O)&&void 0!==g&&g,code:e.code?{...e.code,optimize:$,regExp:R}:{optimize:$,regExp:R},loopRequired:null!==(b=e.loopRequired)&&void 0!==b?b:200,loopEnum:null!==(y=e.loopEnum)&&void 0!==y?y:200,meta:null===(_=e.meta)||void 0===_||_,messages:null===(v=e.messages)||void 0===v||v,inlineRefs:null===(w=e.inlineRefs)||void 0===w||w,schemaId:null!==(S=e.schemaId)&&void 0!==S?S:"$id",addUsedSchema:null===(x=e.addUsedSchema)||void 0===x||x,validateSchema:null===(T=e.validateSchema)||void 0===T||T,validateFormats:null===(E=e.validateFormats)||void 0===E||E,unicodeRegExp:null===(k=e.unicodeRegExp)||void 0===k||k,int32range:null===(P=e.int32range)||void 0===P||P,uriResolver:I}}class _{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...y(e)};const{es5:t,lines:n}=this.opts.code;this.scope=new s.ValueScope({scope:{},prefixes:m,es5:t,lines:n}),this.logger=function(e){if(!1===e)return k;if(void 0===e)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}(e.logger);const r=e.validateFormats;e.validateFormats=!1,this.RULES=(0,a.getRules)(),v.call(this,g,e,"NOT SUPPORTED"),v.call(this,b,e,"DEPRECATED","warn"),this._metaOpts=E.call(this),e.formats&&x.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&T.call(this,e.keywords),"object"==typeof e.meta&&this.addMetaSchema(e.meta),S.call(this),e.validateFormats=r}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:e,meta:t,schemaId:n}=this.opts;let r=d;"id"===n&&(r={...d},r.id=r.$id,delete r.$id),t&&e&&this.addMetaSchema(r,r[n],!1)}defaultMeta(){const{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta="object"==typeof e?e[t]||e:void 0}validate(e,t){let n;if("string"==typeof e){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);const r=n(t);return"$async"in n||(this.errors=n.errors),r}compile(e,t){const n=this._addSchema(e,t);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,t){if("function"!=typeof this.opts.loadSchema)throw new Error("options.loadSchema should be a function");const{loadSchema:n}=this.opts;return r.call(this,e,t);async function r(e,t){await a.call(this,e.$schema);const n=this._addSchema(e,t);return n.validate||i.call(this,n)}async function a(e){e&&!this.getSchema(e)&&await r.call(this,{$ref:e},!0)}async function i(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof o.default))throw t;return s.call(this,t),await l.call(this,t.missingSchema),i.call(this,e)}}function s({missingSchema:e,missingRef:t}){if(this.refs[e])throw new Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function l(e){const n=await u.call(this,e);this.refs[e]||await a.call(this,n.$schema),this.refs[e]||this.addSchema(n,e,t)}async function u(e){const t=this._loading[e];if(t)return t;try{return await(this._loading[e]=n(e))}finally{delete this._loading[e]}}}addSchema(e,t,n,r=this.opts.validateSchema){if(Array.isArray(e)){for(const t of e)this.addSchema(t,void 0,n,r);return this}let o;if("object"==typeof e){const{schemaId:t}=this.opts;if(o=e[t],void 0!==o&&"string"!=typeof o)throw new Error(`schema ${t} must be string`)}return t=(0,l.normalizeId)(t||o),this._checkUnique(t),this.schemas[t]=this._addSchema(e,n,t,r,!0),this}addMetaSchema(e,t,n=this.opts.validateSchema){return this.addSchema(e,t,!0,n),this}validateSchema(e,t){if("boolean"==typeof e)return!0;let n;if(n=e.$schema,void 0!==n&&"string"!=typeof n)throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const r=this.validate(n,e);if(!r&&t){const e="schema is invalid: "+this.errorsText();if("log"!==this.opts.validateSchema)throw new Error(e);this.logger.error(e)}return r}getSchema(e){let t;for(;"string"==typeof(t=w.call(this,e));)e=t;if(void 0===t){const{schemaId:n}=this.opts,r=new i.SchemaEnv({schema:{},schemaId:n});if(t=i.resolveSchema.call(this,r,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const t=w.call(this,e);return"object"==typeof t&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{const t=e;this._cache.delete(t);let n=e[this.opts.schemaId];return n&&(n=(0,l.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(const t of e)this.addKeyword(t);return this}addKeyword(e,t){let n;if("string"==typeof e)n=e,"object"==typeof t&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=n);else{if("object"!=typeof e||void 0!==t)throw new Error("invalid addKeywords parameters");if(n=(t=e).keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}if(O.call(this,n,t),!t)return(0,c.eachItem)(n,e=>A.call(this,e)),this;R.call(this,t);const r={...t,type:(0,u.getJSONTypes)(t.type),schemaType:(0,u.getJSONTypes)(t.schemaType)};return(0,c.eachItem)(n,0===r.type.length?e=>A.call(this,e,r):e=>r.type.forEach(t=>A.call(this,e,r,t))),this}getKeyword(e){const t=this.RULES.all[e];return"object"==typeof t?t.definition:!!t}removeKeyword(e){const{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(const n of t.rules){const t=n.rules.findIndex(t=>t.keyword===e);t>=0&&n.rules.splice(t,1)}return this}addFormat(e,t){return"string"==typeof t&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:n="data"}={}){return e&&0!==e.length?e.map(e=>`${n}${e.instancePath} ${e.message}`).reduce((e,n)=>e+t+n):"No errors"}$dataMetaSchema(e,t){const n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(const r of t){const t=r.split("/").slice(1);let o=e;for(const e of t)o=o[e];for(const e in n){const t=n[e];if("object"!=typeof t)continue;const{$data:r}=t.definition,a=o[e];r&&a&&(o[e]=C(a))}}return e}_removeAllSchemas(e,t){for(const n in e){const r=e[n];t&&!t.test(n)||("string"==typeof r?delete e[n]:r&&!r.meta&&(this._cache.delete(r.schema),delete e[n]))}}_addSchema(e,t,n,r=this.opts.validateSchema,o=this.opts.addUsedSchema){let a;const{schemaId:s}=this.opts;if("object"==typeof e)a=e[s];else{if(this.opts.jtd)throw new Error("schema must be object");if("boolean"!=typeof e)throw new Error("schema must be object or boolean")}let u=this._cache.get(e);if(void 0!==u)return u;n=(0,l.normalizeId)(a||n);const c=l.getSchemaRefs.call(this,e,n);return u=new i.SchemaEnv({schema:e,schemaId:s,meta:t,baseId:n,localRefs:c}),this._cache.set(u.schema,u),o&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=u),r&&this.validateSchema(e,!0),u}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):i.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){const t=this.opts;this.opts=this._metaOpts;try{i.compileSchema.call(this,e)}finally{this.opts=t}}}function v(e,t,n,r="error"){for(const o in e){const a=o;a in t&&this.logger[r](`${n}: option ${o}. ${e[a]}`)}}function w(e){return e=(0,l.normalizeId)(e),this.schemas[e]||this.refs[e]}function S(){const e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(const t in e)this.addSchema(e[t],t)}function x(){for(const e in this.opts.formats){const t=this.opts.formats[e];t&&this.addFormat(e,t)}}function T(e){if(Array.isArray(e))this.addVocabulary(e);else{this.logger.warn("keywords option as map is deprecated, pass array");for(const t in e){const n=e[t];n.keyword||(n.keyword=t),this.addKeyword(n)}}}function E(){const e={...this.opts};for(const t of h)delete e[t];return e}_.ValidationError=r.default,_.MissingRefError=o.default,e.default=_;const k={log(){},warn(){},error(){}};const P=/^[a-z_$][a-z0-9_$:-]*$/i;function O(e,t){const{RULES:n}=this;if((0,c.eachItem)(e,e=>{if(n.keywords[e])throw new Error(`Keyword ${e} is already defined`);if(!P.test(e))throw new Error(`Keyword ${e} has invalid name`)}),t&&t.$data&&!("code"in t)&&!("validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function A(e,t,n){var r;const o=null==t?void 0:t.post;if(n&&o)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:a}=this;let i=o?a.post:a.rules.find(({type:e})=>e===n);if(i||(i={type:n,rules:[]},a.rules.push(i)),a.keywords[e]=!0,!t)return;const s={keyword:e,definition:{...t,type:(0,u.getJSONTypes)(t.type),schemaType:(0,u.getJSONTypes)(t.schemaType)}};t.before?$.call(this,i,s,t.before):i.rules.push(s),a.all[e]=s,null===(r=t.implements)||void 0===r||r.forEach(e=>this.addKeyword(e))}function $(e,t,n){const r=e.rules.findIndex(e=>e.keyword===n);r>=0?e.rules.splice(r,0,t):(e.rules.push(t),this.logger.warn(`rule ${n} is not defined`))}function R(e){let{metaSchema:t}=e;void 0!==t&&(e.$data&&this.opts.$data&&(t=C(t)),e.validateSchema=this.compile(t,!0))}const I={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function C(e){return{anyOf:[e,I]}}}(core$2);var draft7={},core$1={},id={};Object.defineProperty(id,"__esModule",{value:!0});const def$s={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};id.default=def$s;var ref={};Object.defineProperty(ref,"__esModule",{value:!0}),ref.callRef=ref.getValidate=void 0;const ref_error_1$1=ref_error,code_1$8=code,codegen_1$l=codegen,names_1$1=names$1,compile_1$1=compile,util_1$j=util,def$r={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:n,it:r}=e,{baseId:o,schemaEnv:a,validateName:i,opts:s,self:l}=r,{root:u}=a;if(("#"===n||"#/"===n)&&o===u.baseId)return function(){if(a===u)return callRef(e,i,a,a.$async);const n=t.scopeValue("root",{ref:u});return callRef(e,codegen_1$l._`${n}.validate`,u,u.$async)}();const c=compile_1$1.resolveRef.call(l,u,o,n);if(void 0===c)throw new ref_error_1$1.default(r.opts.uriResolver,o,n);return c instanceof compile_1$1.SchemaEnv?function(t){const n=getValidate(e,t);callRef(e,n,t,t.$async)}(c):function(r){const o=t.scopeValue("schema",!0===s.code.source?{ref:r,code:(0,codegen_1$l.stringify)(r)}:{ref:r}),a=t.name("valid"),i=e.subschema({schema:r,dataTypes:[],schemaPath:codegen_1$l.nil,topSchemaRef:o,errSchemaPath:n},a);e.mergeEvaluated(i),e.ok(a)}(c)}};function getValidate(e,t){const{gen:n}=e;return t.validate?n.scopeValue("validate",{ref:t.validate}):codegen_1$l._`${n.scopeValue("wrapper",{ref:t})}.validate`}function callRef(e,t,n,r){const{gen:o,it:a}=e,{allErrors:i,schemaEnv:s,opts:l}=a,u=l.passContext?names_1$1.default.this:codegen_1$l.nil;function c(e){const t=codegen_1$l._`${e}.errors`;o.assign(names_1$1.default.vErrors,codegen_1$l._`${names_1$1.default.vErrors} === null ? ${t} : ${names_1$1.default.vErrors}.concat(${t})`),o.assign(names_1$1.default.errors,codegen_1$l._`${names_1$1.default.vErrors}.length`)}function d(e){var t;if(!a.opts.unevaluated)return;const r=null===(t=null==n?void 0:n.validate)||void 0===t?void 0:t.evaluated;if(!0!==a.props)if(r&&!r.dynamicProps)void 0!==r.props&&(a.props=util_1$j.mergeEvaluated.props(o,r.props,a.props));else{const t=o.var("props",codegen_1$l._`${e}.evaluated.props`);a.props=util_1$j.mergeEvaluated.props(o,t,a.props,codegen_1$l.Name)}if(!0!==a.items)if(r&&!r.dynamicItems)void 0!==r.items&&(a.items=util_1$j.mergeEvaluated.items(o,r.items,a.items));else{const t=o.var("items",codegen_1$l._`${e}.evaluated.items`);a.items=util_1$j.mergeEvaluated.items(o,t,a.items,codegen_1$l.Name)}}r?function(){if(!s.$async)throw new Error("async schema referenced by sync schema");const n=o.let("valid");o.try(()=>{o.code(codegen_1$l._`await ${(0,code_1$8.callValidateCode)(e,t,u)}`),d(t),i||o.assign(n,!0)},e=>{o.if(codegen_1$l._`!(${e} instanceof ${a.ValidationError})`,()=>o.throw(e)),c(e),i||o.assign(n,!1)}),e.ok(n)}():e.result((0,code_1$8.callValidateCode)(e,t,u),()=>d(t),()=>c(t))}ref.getValidate=getValidate,ref.callRef=callRef,ref.default=def$r,Object.defineProperty(core$1,"__esModule",{value:!0});const id_1=id,ref_1=ref,core=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",id_1.default,ref_1.default];core$1.default=core;var validation$1={},limitNumber={};Object.defineProperty(limitNumber,"__esModule",{value:!0});const codegen_1$k=codegen,ops=codegen_1$k.operators,KWDs={maximum:{okStr:"<=",ok:ops.LTE,fail:ops.GT},minimum:{okStr:">=",ok:ops.GTE,fail:ops.LT},exclusiveMaximum:{okStr:"<",ok:ops.LT,fail:ops.GTE},exclusiveMinimum:{okStr:">",ok:ops.GT,fail:ops.LTE}},error$i={message:({keyword:e,schemaCode:t})=>codegen_1$k.str`must be ${KWDs[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>codegen_1$k._`{comparison: ${KWDs[e].okStr}, limit: ${t}}`},def$q={keyword:Object.keys(KWDs),type:"number",schemaType:"number",$data:!0,error:error$i,code(e){const{keyword:t,data:n,schemaCode:r}=e;e.fail$data(codegen_1$k._`${n} ${KWDs[t].fail} ${r} || isNaN(${n})`)}};limitNumber.default=def$q;var multipleOf={};Object.defineProperty(multipleOf,"__esModule",{value:!0});const codegen_1$j=codegen,error$h={message:({schemaCode:e})=>codegen_1$j.str`must be multiple of ${e}`,params:({schemaCode:e})=>codegen_1$j._`{multipleOf: ${e}}`},def$p={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:error$h,code(e){const{gen:t,data:n,schemaCode:r,it:o}=e,a=o.opts.multipleOfPrecision,i=t.let("res"),s=a?codegen_1$j._`Math.abs(Math.round(${i}) - ${i}) > 1e-${a}`:codegen_1$j._`${i} !== parseInt(${i})`;e.fail$data(codegen_1$j._`(${r} === 0 || (${i} = ${n}/${r}, ${s}))`)}};multipleOf.default=def$p;var limitLength={},ucs2length$1={};function ucs2length(e){const t=e.length;let n,r=0,o=0;for(;o<t;)r++,n=e.charCodeAt(o++),n>=55296&&n<=56319&&o<t&&(n=e.charCodeAt(o),56320==(64512&n)&&o++);return r}Object.defineProperty(ucs2length$1,"__esModule",{value:!0}),ucs2length$1.default=ucs2length,ucs2length.code='require("ajv/dist/runtime/ucs2length").default',Object.defineProperty(limitLength,"__esModule",{value:!0});const codegen_1$i=codegen,util_1$i=util,ucs2length_1=ucs2length$1,error$g={message({keyword:e,schemaCode:t}){const n="maxLength"===e?"more":"fewer";return codegen_1$i.str`must NOT have ${n} than ${t} characters`},params:({schemaCode:e})=>codegen_1$i._`{limit: ${e}}`},def$o={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:error$g,code(e){const{keyword:t,data:n,schemaCode:r,it:o}=e,a="maxLength"===t?codegen_1$i.operators.GT:codegen_1$i.operators.LT,i=!1===o.opts.unicode?codegen_1$i._`${n}.length`:codegen_1$i._`${(0,util_1$i.useFunc)(e.gen,ucs2length_1.default)}(${n})`;e.fail$data(codegen_1$i._`${i} ${a} ${r}`)}};limitLength.default=def$o;var pattern={};Object.defineProperty(pattern,"__esModule",{value:!0});const code_1$7=code,codegen_1$h=codegen,error$f={message:({schemaCode:e})=>codegen_1$h.str`must match pattern "${e}"`,params:({schemaCode:e})=>codegen_1$h._`{pattern: ${e}}`},def$n={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:error$f,code(e){const{data:t,$data:n,schema:r,schemaCode:o,it:a}=e,i=a.opts.unicodeRegExp?"u":"",s=n?codegen_1$h._`(new RegExp(${o}, ${i}))`:(0,code_1$7.usePattern)(e,r);e.fail$data(codegen_1$h._`!${s}.test(${t})`)}};pattern.default=def$n;var limitProperties={};Object.defineProperty(limitProperties,"__esModule",{value:!0});const codegen_1$g=codegen,error$e={message({keyword:e,schemaCode:t}){const n="maxProperties"===e?"more":"fewer";return codegen_1$g.str`must NOT have ${n} than ${t} properties`},params:({schemaCode:e})=>codegen_1$g._`{limit: ${e}}`},def$m={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:error$e,code(e){const{keyword:t,data:n,schemaCode:r}=e,o="maxProperties"===t?codegen_1$g.operators.GT:codegen_1$g.operators.LT;e.fail$data(codegen_1$g._`Object.keys(${n}).length ${o} ${r}`)}};limitProperties.default=def$m;var required={};Object.defineProperty(required,"__esModule",{value:!0});const code_1$6=code,codegen_1$f=codegen,util_1$h=util,error$d={message:({params:{missingProperty:e}})=>codegen_1$f.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>codegen_1$f._`{missingProperty: ${e}}`},def$l={keyword:"required",type:"object",schemaType:"array",$data:!0,error:error$d,code(e){const{gen:t,schema:n,schemaCode:r,data:o,$data:a,it:i}=e,{opts:s}=i;if(!a&&0===n.length)return;const l=n.length>=s.loopRequired;if(i.allErrors?function(){if(l||a)e.block$data(codegen_1$f.nil,u);else for(const t of n)(0,code_1$6.checkReportMissingProp)(e,t)}():function(){const i=t.let("missing");if(l||a){const n=t.let("valid",!0);e.block$data(n,()=>function(n,a){e.setParams({missingProperty:n}),t.forOf(n,r,()=>{t.assign(a,(0,code_1$6.propertyInData)(t,o,n,s.ownProperties)),t.if((0,codegen_1$f.not)(a),()=>{e.error(),t.break()})},codegen_1$f.nil)}(i,n)),e.ok(n)}else t.if((0,code_1$6.checkMissingProp)(e,n,i)),(0,code_1$6.reportMissingProp)(e,i),t.else()}(),s.strictRequired){const t=e.parentSchema.properties,{definedProperties:r}=e.it;for(const e of n)if(void 0===(null==t?void 0:t[e])&&!r.has(e)){const t=`required property "${e}" is not defined at "${i.schemaEnv.baseId+i.errSchemaPath}" (strictRequired)`;(0,util_1$h.checkStrictMode)(i,t,i.opts.strictRequired)}}function u(){t.forOf("prop",r,n=>{e.setParams({missingProperty:n}),t.if((0,code_1$6.noPropertyInData)(t,o,n,s.ownProperties),()=>e.error())})}}};required.default=def$l;var limitItems={};Object.defineProperty(limitItems,"__esModule",{value:!0});const codegen_1$e=codegen,error$c={message({keyword:e,schemaCode:t}){const n="maxItems"===e?"more":"fewer";return codegen_1$e.str`must NOT have ${n} than ${t} items`},params:({schemaCode:e})=>codegen_1$e._`{limit: ${e}}`},def$k={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:error$c,code(e){const{keyword:t,data:n,schemaCode:r}=e,o="maxItems"===t?codegen_1$e.operators.GT:codegen_1$e.operators.LT;e.fail$data(codegen_1$e._`${n}.length ${o} ${r}`)}};limitItems.default=def$k;var uniqueItems={},equal$1={};Object.defineProperty(equal$1,"__esModule",{value:!0});const equal=fastDeepEqual;equal.code='require("ajv/dist/runtime/equal").default',equal$1.default=equal,Object.defineProperty(uniqueItems,"__esModule",{value:!0});const dataType_1=dataType,codegen_1$d=codegen,util_1$g=util,equal_1$2=equal$1,error$b={message:({params:{i:e,j:t}})=>codegen_1$d.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>codegen_1$d._`{i: ${e}, j: ${t}}`},def$j={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:error$b,code(e){const{gen:t,data:n,$data:r,schema:o,parentSchema:a,schemaCode:i,it:s}=e;if(!r&&!o)return;const l=t.let("valid"),u=a.items?(0,dataType_1.getSchemaTypes)(a.items):[];function c(r,o){const a=t.name("item"),i=(0,dataType_1.checkDataTypes)(u,a,s.opts.strictNumbers,dataType_1.DataType.Wrong),c=t.const("indices",codegen_1$d._`{}`);t.for(codegen_1$d._`;${r}--;`,()=>{t.let(a,codegen_1$d._`${n}[${r}]`),t.if(i,codegen_1$d._`continue`),u.length>1&&t.if(codegen_1$d._`typeof ${a} == "string"`,codegen_1$d._`${a} += "_"`),t.if(codegen_1$d._`typeof ${c}[${a}] == "number"`,()=>{t.assign(o,codegen_1$d._`${c}[${a}]`),e.error(),t.assign(l,!1).break()}).code(codegen_1$d._`${c}[${a}] = ${r}`)})}function d(r,o){const a=(0,util_1$g.useFunc)(t,equal_1$2.default),i=t.name("outer");t.label(i).for(codegen_1$d._`;${r}--;`,()=>t.for(codegen_1$d._`${o} = ${r}; ${o}--;`,()=>t.if(codegen_1$d._`${a}(${n}[${r}], ${n}[${o}])`,()=>{e.error(),t.assign(l,!1).break(i)})))}e.block$data(l,function(){const r=t.let("i",codegen_1$d._`${n}.length`),o=t.let("j");e.setParams({i:r,j:o}),t.assign(l,!0),t.if(codegen_1$d._`${r} > 1`,()=>(u.length>0&&!u.some(e=>"object"===e||"array"===e)?c:d)(r,o))},codegen_1$d._`${i} === false`),e.ok(l)}};uniqueItems.default=def$j;var _const={};Object.defineProperty(_const,"__esModule",{value:!0});const codegen_1$c=codegen,util_1$f=util,equal_1$1=equal$1,error$a={message:"must be equal to constant",params:({schemaCode:e})=>codegen_1$c._`{allowedValue: ${e}}`},def$i={keyword:"const",$data:!0,error:error$a,code(e){const{gen:t,data:n,$data:r,schemaCode:o,schema:a}=e;r||a&&"object"==typeof a?e.fail$data(codegen_1$c._`!${(0,util_1$f.useFunc)(t,equal_1$1.default)}(${n}, ${o})`):e.fail(codegen_1$c._`${a} !== ${n}`)}};_const.default=def$i;var _enum={};Object.defineProperty(_enum,"__esModule",{value:!0});const codegen_1$b=codegen,util_1$e=util,equal_1=equal$1,error$9={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>codegen_1$b._`{allowedValues: ${e}}`},def$h={keyword:"enum",schemaType:"array",$data:!0,error:error$9,code(e){const{gen:t,data:n,$data:r,schema:o,schemaCode:a,it:i}=e;if(!r&&0===o.length)throw new Error("enum must have non-empty array");const s=o.length>=i.opts.loopEnum;let l;const u=()=>null!=l?l:l=(0,util_1$e.useFunc)(t,equal_1.default);let c;if(s||r)c=t.let("valid"),e.block$data(c,function(){t.assign(c,!1),t.forOf("v",a,e=>t.if(codegen_1$b._`${u()}(${n}, ${e})`,()=>t.assign(c,!0).break()))});else{if(!Array.isArray(o))throw new Error("ajv implementation error");const e=t.const("vSchema",a);c=(0,codegen_1$b.or)(...o.map((t,r)=>function(e,t){const r=o[t];return"object"==typeof r&&null!==r?codegen_1$b._`${u()}(${n}, ${e}[${t}])`:codegen_1$b._`${n} === ${r}`}(e,r)))}e.pass(c)}};_enum.default=def$h,Object.defineProperty(validation$1,"__esModule",{value:!0});const limitNumber_1=limitNumber,multipleOf_1=multipleOf,limitLength_1=limitLength,pattern_1=pattern,limitProperties_1=limitProperties,required_1=required,limitItems_1=limitItems,uniqueItems_1=uniqueItems,const_1=_const,enum_1=_enum,validation=[limitNumber_1.default,multipleOf_1.default,limitLength_1.default,pattern_1.default,limitProperties_1.default,required_1.default,limitItems_1.default,uniqueItems_1.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},const_1.default,enum_1.default];validation$1.default=validation;var applicator={},additionalItems={};Object.defineProperty(additionalItems,"__esModule",{value:!0}),additionalItems.validateAdditionalItems=void 0;const codegen_1$a=codegen,util_1$d=util,error$8={message:({params:{len:e}})=>codegen_1$a.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>codegen_1$a._`{limit: ${e}}`},def$g={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:error$8,code(e){const{parentSchema:t,it:n}=e,{items:r}=t;Array.isArray(r)?validateAdditionalItems(e,r):(0,util_1$d.checkStrictMode)(n,'"additionalItems" is ignored when "items" is not an array of schemas')}};function validateAdditionalItems(e,t){const{gen:n,schema:r,data:o,keyword:a,it:i}=e;i.items=!0;const s=n.const("len",codegen_1$a._`${o}.length`);if(!1===r)e.setParams({len:t.length}),e.pass(codegen_1$a._`${s} <= ${t.length}`);else if("object"==typeof r&&!(0,util_1$d.alwaysValidSchema)(i,r)){const r=n.var("valid",codegen_1$a._`${s} <= ${t.length}`);n.if((0,codegen_1$a.not)(r),()=>function(r){n.forRange("i",t.length,s,t=>{e.subschema({keyword:a,dataProp:t,dataPropType:util_1$d.Type.Num},r),i.allErrors||n.if((0,codegen_1$a.not)(r),()=>n.break())})}(r)),e.ok(r)}}additionalItems.validateAdditionalItems=validateAdditionalItems,additionalItems.default=def$g;var prefixItems={},items={};Object.defineProperty(items,"__esModule",{value:!0}),items.validateTuple=void 0;const codegen_1$9=codegen,util_1$c=util,code_1$5=code,def$f={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:n}=e;if(Array.isArray(t))return validateTuple(e,"additionalItems",t);n.items=!0,(0,util_1$c.alwaysValidSchema)(n,t)||e.ok((0,code_1$5.validateArray)(e))}};function validateTuple(e,t,n=e.schema){const{gen:r,parentSchema:o,data:a,keyword:i,it:s}=e;!function(e){const{opts:r,errSchemaPath:o}=s,a=n.length,l=a===e.minItems&&(a===e.maxItems||!1===e[t]);if(r.strictTuples&&!l){const e=`"${i}" is ${a}-tuple, but minItems or maxItems/${t} are not specified or different at path "${o}"`;(0,util_1$c.checkStrictMode)(s,e,r.strictTuples)}}(o),s.opts.unevaluated&&n.length&&!0!==s.items&&(s.items=util_1$c.mergeEvaluated.items(r,n.length,s.items));const l=r.name("valid"),u=r.const("len",codegen_1$9._`${a}.length`);n.forEach((t,n)=>{(0,util_1$c.alwaysValidSchema)(s,t)||(r.if(codegen_1$9._`${u} > ${n}`,()=>e.subschema({keyword:i,schemaProp:n,dataProp:n},l)),e.ok(l))})}items.validateTuple=validateTuple,items.default=def$f,Object.defineProperty(prefixItems,"__esModule",{value:!0});const items_1$1=items,def$e={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,items_1$1.validateTuple)(e,"items")};prefixItems.default=def$e;var items2020={};Object.defineProperty(items2020,"__esModule",{value:!0});const codegen_1$8=codegen,util_1$b=util,code_1$4=code,additionalItems_1$1=additionalItems,error$7={message:({params:{len:e}})=>codegen_1$8.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>codegen_1$8._`{limit: ${e}}`},def$d={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:error$7,code(e){const{schema:t,parentSchema:n,it:r}=e,{prefixItems:o}=n;r.items=!0,(0,util_1$b.alwaysValidSchema)(r,t)||(o?(0,additionalItems_1$1.validateAdditionalItems)(e,o):e.ok((0,code_1$4.validateArray)(e)))}};items2020.default=def$d;var contains={};Object.defineProperty(contains,"__esModule",{value:!0});const codegen_1$7=codegen,util_1$a=util,error$6={message:({params:{min:e,max:t}})=>void 0===t?codegen_1$7.str`must contain at least ${e} valid item(s)`:codegen_1$7.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>void 0===t?codegen_1$7._`{minContains: ${e}}`:codegen_1$7._`{minContains: ${e}, maxContains: ${t}}`},def$c={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:error$6,code(e){const{gen:t,schema:n,parentSchema:r,data:o,it:a}=e;let i,s;const{minContains:l,maxContains:u}=r;a.opts.next?(i=void 0===l?1:l,s=u):i=1;const c=t.const("len",codegen_1$7._`${o}.length`);if(e.setParams({min:i,max:s}),void 0===s&&0===i)return void(0,util_1$a.checkStrictMode)(a,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==s&&i>s)return(0,util_1$a.checkStrictMode)(a,'"minContains" > "maxContains" is always invalid'),void e.fail();if((0,util_1$a.alwaysValidSchema)(a,n)){let t=codegen_1$7._`${c} >= ${i}`;return void 0!==s&&(t=codegen_1$7._`${t} && ${c} <= ${s}`),void e.pass(t)}a.items=!0;const d=t.name("valid");function f(){const e=t.name("_valid"),n=t.let("count",0);p(e,()=>t.if(e,()=>function(e){t.code(codegen_1$7._`${e}++`),void 0===s?t.if(codegen_1$7._`${e} >= ${i}`,()=>t.assign(d,!0).break()):(t.if(codegen_1$7._`${e} > ${s}`,()=>t.assign(d,!1).break()),1===i?t.assign(d,!0):t.if(codegen_1$7._`${e} >= ${i}`,()=>t.assign(d,!0)))}(n)))}function p(n,r){t.forRange("i",0,c,t=>{e.subschema({keyword:"contains",dataProp:t,dataPropType:util_1$a.Type.Num,compositeRule:!0},n),r()})}void 0===s&&1===i?p(d,()=>t.if(d,()=>t.break())):0===i?(t.let(d,!0),void 0!==s&&t.if(codegen_1$7._`${o}.length > 0`,f)):(t.let(d,!1),f()),e.result(d,()=>e.reset())}};contains.default=def$c;var dependencies={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=codegen,n=util,r=code;e.error={message:({params:{property:e,depsCount:n,deps:r}})=>{const o=1===n?"property":"properties";return t.str`must have ${o} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:n,deps:r,missingProperty:o}})=>t._`{property: ${e},
@@ -77,4 +77,4 @@
77
77
  * Copyright (c) Microsoft Corporation. All rights reserved.
78
78
  * Licensed under the MIT License.
79
79
  */
80
- (function(module,exports$1){var e;self,e=__WEBPACK_EXTERNAL_MODULE__1670__=>(()=>{var __webpack_modules__={3474:(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 I.buffer!=D&&G(I.buffer),N}function o(){return I.buffer!=D&&G(I.buffer),M}function a(){return I.buffer!=D&&G(I.buffer),L}function i(){return I.buffer!=D&&G(I.buffer),j}function s(){return I.buffer!=D&&G(I.buffer),F}var l,u,c;e=e||{},l||(l=void 0!==e?e:{}),l.ready=new Promise(function(e,t){u=e,c=t});var d,f,p,h,m,g,b=Object.assign({},l),y="./this.program",_=(e,t)=>{throw t},v="object"==typeof window,w="function"==typeof importScripts,S="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,x=l.ENVIRONMENT_IS_PTHREAD||!1,T="";function E(e){return l.locateFile?l.locateFile(e,T):T+e}if(S){let e;T=w?n(908).dirname(T)+"/":"//",g=()=>{m||(h=n(1384),m=n(908))},d=function(e,t){return g(),e=m.normalize(e),h.readFileSync(e,t?void 0:"utf8")},p=e=>((e=d(e,!0)).buffer||(e=new Uint8Array(e)),e),f=(e,t,n)=>{g(),e=m.normalize(e),h.readFile(e,function(e,r){e?n(e):t(r.buffer)})},1<process.argv.length&&(y=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),process.on("uncaughtException",function(e){if(!(e instanceof le))throw e}),process.on("unhandledRejection",function(e){throw e}),_=(e,t)=>{if(J())throw process.exitCode=e,t;t instanceof le||$("exiting due to exception: "+t),process.exit(e)},l.inspect=function(){return"[Emscripten Module object]"};try{e=n(9925)}catch(Ut){throw console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?'),Ut}n.g.Worker=e.Worker}else(v||w)&&(w?T=self.location.href:"undefined"!=typeof document&&document.currentScript&&(T=document.currentScript.src),r&&(T=r),T=0!==T.indexOf("blob:")?T.substr(0,T.replace(/[?#].*/,"").lastIndexOf("/")+1):"",S||(d=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},w&&(p=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),f=(e,t,n)=>{var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?t(r.response):n()},r.onerror=n,r.send(null)}));S&&"undefined"==typeof performance&&(n.g.performance=n(6953).performance);var k=console.log.bind(console),P=console.warn.bind(console);S&&(g(),k=e=>h.writeSync(1,e+"\n"),P=e=>h.writeSync(2,e+"\n"));var O,A=l.print||k,$=l.printErr||P;Object.assign(l,b),b=null,l.thisProgram&&(y=l.thisProgram),l.quit&&(_=l.quit),l.wasmBinary&&(O=l.wasmBinary);var R=l.noExitRuntime||!1;"object"!=typeof WebAssembly&&oe("no native wasm support detected");var I,C,D,N,M,L,j,F,B=!1,U="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function z(e,t,n){var r=(t>>>=0)+n;for(n=t;e[n]&&!(n>=r);)++n;if(16<n-t&&e.buffer&&U)return U.decode(e.buffer instanceof SharedArrayBuffer?e.slice(t,n):e.subarray(t,n));for(r="";t<n;){var o=e[t++];if(128&o){var a=63&e[t++];if(192==(224&o))r+=String.fromCharCode((31&o)<<6|a);else{var i=63&e[t++];65536>(o=224==(240&o)?(15&o)<<12|a<<6|i:(7&o)<<18|a<<12|i<<6|63&e[t++])?r+=String.fromCharCode(o):(o-=65536,r+=String.fromCharCode(55296|o>>10,56320|1023&o))}}else r+=String.fromCharCode(o)}return r}function V(e,t){return(e>>>=0)?z(o(),e,t):""}function H(e,t,n,r){if(!(0<r))return 0;var o=n>>>=0;r=n+r-1;for(var a=0;a<e.length;++a){var i=e.charCodeAt(a);if(55296<=i&&57343>=i&&(i=65536+((1023&i)<<10)|1023&e.charCodeAt(++a)),127>=i){if(n>=r)break;t[n++>>>0]=i}else{if(2047>=i){if(n+1>=r)break;t[n++>>>0]=192|i>>6}else{if(65535>=i){if(n+2>=r)break;t[n++>>>0]=224|i>>12}else{if(n+3>=r)break;t[n++>>>0]=240|i>>18,t[n++>>>0]=128|i>>12&63}t[n++>>>0]=128|i>>6&63}t[n++>>>0]=128|63&i}}return t[n>>>0]=0,n-o}function q(e){for(var t=0,n=0;n<e.length;++n){var r=e.charCodeAt(n);127>=r?t++:2047>=r?t+=2:55296<=r&&57343>=r?(t+=4,++n):t+=3}return t}function G(e){D=e,l.HEAP8=N=new Int8Array(e),l.HEAP16=new Int16Array(e),l.HEAP32=L=new Int32Array(e),l.HEAPU8=M=new Uint8Array(e),l.HEAPU16=new Uint16Array(e),l.HEAPU32=j=new Uint32Array(e),l.HEAPF32=new Float32Array(e),l.HEAPF64=F=new Float64Array(e)}x&&(D=l.buffer);var W=l.INITIAL_MEMORY||16777216;if(x)I=l.wasmMemory,D=l.buffer;else if(l.wasmMemory)I=l.wasmMemory;else if(!((I=new WebAssembly.Memory({initial:W/65536,maximum:65536,shared:!0})).buffer instanceof SharedArrayBuffer))throw $("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag"),S&&console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)"),Error("bad memory");I&&(D=I.buffer),W=D.byteLength,G(D);var Y,K=[],X=[],Q=[],Z=[];function J(){return R||!1}function ee(){var e=l.preRun.shift();K.unshift(e)}var te,ne=0,re=null;function oe(e){throw x?postMessage({cmd:"onAbort",arg:e}):l.onAbort&&l.onAbort(e),$(e="Aborted("+e+")"),B=!0,e=new WebAssembly.RuntimeError(e+". Build with -sASSERTIONS for more info."),c(e),e}function ae(){return te.startsWith("data:application/octet-stream;base64,")}function ie(){var e=te;try{if(e==te&&O)return new Uint8Array(O);if(p)return p(e);throw"both async and sync fetching of the wasm failed"}catch(t){oe(t)}}te="ort-wasm-threaded.wasm",ae()||(te=E(te));var se={};function le(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function ue(e){(e=pe.Vb[e])||oe(),pe.mc(e)}function ce(e){var t=pe.Cc();if(!t)return 6;pe.ac.push(t),pe.Vb[e.Ub]=t,t.Ub=e.Ub;var n={cmd:"run",start_routine:e.Ic,arg:e.zc,pthread_ptr:e.Ub};return t.$b=()=>{n.time=performance.now(),t.postMessage(n,e.Nc)},t.loaded&&(t.$b(),delete t.$b),0}function de(e){if(x)return Ge(1,1,e);J()||(pe.oc(),l.onExit&&l.onExit(e),B=!0),_(e,new le(e))}function fe(e,t){if(!t&&x)throw me(e),"unwind";J()||x||(gt(),he(Q),mt(0),nt[1].length&&rt(1,10),nt[2].length&&rt(2,10),pe.oc()),de(e)}var pe={Yb:[],ac:[],qc:[],Vb:{},fc:function(){x&&pe.Ec()},Pc:function(){},Ec:function(){pe.receiveObjectTransfer=pe.Gc,pe.threadInitTLS=pe.pc,pe.setExitStatus=pe.nc,R=!1},nc:function(){},oc:function(){for(var e of Object.values(pe.Vb))pe.mc(e);for(e of pe.Yb)e.terminate();pe.Yb=[]},mc:function(e){var t=e.Ub;delete pe.Vb[t],pe.Yb.push(e),pe.ac.splice(pe.ac.indexOf(e),1),e.Ub=0,wt(t)},Gc:function(){},pc:function(){pe.qc.forEach(e=>e())},Fc:function(e,t){e.onmessage=n=>{var r=(n=n.data).cmd;if(e.Ub&&(pe.Bc=e.Ub),n.targetThread&&n.targetThread!=ft()){var o=pe.Vb[n.Qc];o?o.postMessage(n,n.transferList):$('Internal error! Worker sent a message "'+r+'" to target pthread '+n.targetThread+", but that thread no longer exists!")}else"processProxyingQueue"===r?Be(n.queue):"spawnThread"===r?ce(n):"cleanupThread"===r?ue(n.thread):"killThread"===r?(n=n.thread,r=pe.Vb[n],delete pe.Vb[n],r.terminate(),wt(n),pe.ac.splice(pe.ac.indexOf(r),1),r.Ub=0):"cancelThread"===r?pe.Vb[n.thread].postMessage({cmd:"cancel"}):"loaded"===r?(e.loaded=!0,t&&t(e),e.$b&&(e.$b(),delete e.$b)):"print"===r?A("Thread "+n.threadId+": "+n.text):"printErr"===r?$("Thread "+n.threadId+": "+n.text):"alert"===r?alert("Thread "+n.threadId+": "+n.text):"setimmediate"===n.target?e.postMessage(n):"onAbort"===r?l.onAbort&&l.onAbort(n.arg):r&&$("worker sent an unknown command "+r);pe.Bc=void 0},e.onerror=e=>{throw $("worker sent an error! "+e.filename+":"+e.lineno+": "+e.message),e},S&&(e.on("message",function(t){e.onmessage({data:t})}),e.on("error",function(t){e.onerror(t)}),e.on("detachedExit",function(){})),e.postMessage({cmd:"load",urlOrBlob:l.mainScriptUrlOrBlob||r,wasmMemory:I,wasmModule:C})},yc:function(){var e=E("ort-wasm-threaded.worker.js");pe.Yb.push(new Worker(e))},Cc:function(){return 0==pe.Yb.length&&(pe.yc(),pe.Fc(pe.Yb[0])),pe.Yb.pop()}};function he(e){for(;0<e.length;)e.shift()(l)}function me(e){if(x)return Ge(2,0,e);try{fe(e)}catch(t){t instanceof le||"unwind"==t||_(1,t)}}l.PThread=pe,l.establishStackSpace=function(){var e=ft(),t=a()[e+44>>2>>>0];e=a()[e+48>>2>>>0],Tt(t,t-e),kt(t)};var ge=[];function be(e){var t=ge[e];return t||(e>=ge.length&&(ge.length=e+1),ge[e]=t=Y.get(e)),t}l.invokeEntryPoint=function(e,t){e=be(e)(t),J()?pe.nc(e):St(e)};var ye,_e,ve=[],we=0,Se=0;function xe(e){this.Zb=e,this.Sb=e-24,this.xc=function(e){i()[this.Sb+4>>2>>>0]=e},this.bc=function(){return i()[this.Sb+4>>2>>>0]},this.wc=function(e){i()[this.Sb+8>>2>>>0]=e},this.Dc=function(){return i()[this.Sb+8>>2>>>0]},this.rc=function(){a()[this.Sb>>2>>>0]=0},this.hc=function(e){e=e?1:0,t()[(this.Sb+12|0)>>>0]=e},this.uc=function(){return 0!=t()[(this.Sb+12|0)>>>0]},this.ic=function(e){e=e?1:0,t()[(this.Sb+13|0)>>>0]=e},this.kc=function(){return 0!=t()[(this.Sb+13|0)>>>0]},this.fc=function(e,t){this.cc(0),this.xc(e),this.wc(t),this.rc(),this.hc(!1),this.ic(!1)},this.sc=function(){Atomics.add(a(),this.Sb>>2,1)},this.Hc=function(){return 1===Atomics.sub(a(),this.Sb>>2,1)},this.cc=function(e){i()[this.Sb+16>>2>>>0]=e},this.tc=function(){return i()[this.Sb+16>>2>>>0]},this.vc=function(){if(At(this.bc()))return i()[this.Zb>>2>>>0];var e=this.tc();return 0!==e?e:this.Zb}}function Te(e){return ht(new xe(e).Sb)}function Ee(e,t,n,r){return x?Ge(3,1,e,t,n,r):ke(e,t,n,r)}function ke(e,t,n,r){if("undefined"==typeof SharedArrayBuffer)return $("Current environment does not support SharedArrayBuffer, pthreads are not available!"),6;var o=[];return x&&0===o.length?Ee(e,t,n,r):(e={Ic:n,Ub:e,zc:r,Nc:o},x?(e.Oc="spawnThread",postMessage(e,o),0):ce(e))}function Pe(e,t,n){return x?Ge(4,1,e,t,n):0}function Oe(e,t){if(x)return Ge(5,1,e,t)}function Ae(e,t){if(x)return Ge(6,1,e,t)}function $e(e,t,n){if(x)return Ge(7,1,e,t,n)}function Re(e,t,n){return x?Ge(8,1,e,t,n):0}function Ie(e,t){if(x)return Ge(9,1,e,t)}function Ce(e,t,n){if(x)return Ge(10,1,e,t,n)}function De(e,t,n,r){if(x)return Ge(11,1,e,t,n,r)}function Ne(e,t,n,r){if(x)return Ge(12,1,e,t,n,r)}function Me(e,t,n,r){if(x)return Ge(13,1,e,t,n,r)}function Le(e){if(x)return Ge(14,1,e)}function je(e,t){if(x)return Ge(15,1,e,t)}function Fe(e,t,n){if(x)return Ge(16,1,e,t,n)}function Be(e){Atomics.store(a(),e>>2,1),ft()&&vt(e),Atomics.compareExchange(a(),e>>2,1,0)}function Ue(e){return i()[e>>>2]+4294967296*a()[e+4>>>2]}function ze(e,t,n,r,o,a){return x?Ge(17,1,e,t,n,r,o,a):-52}function Ve(e,t,n,r,o,a){if(x)return Ge(18,1,e,t,n,r,o,a)}function He(e){var n=q(e)+1,r=pt(n);return r&&H(e,t(),r,n),r}function qe(e,t,n){function r(e){return(e=e.toTimeString().match(/\(([A-Za-z ]+)\)$/))?e[1]:"GMT"}if(x)return Ge(19,1,e,t,n);var o=(new Date).getFullYear(),s=new Date(o,0,1),l=new Date(o,6,1);o=s.getTimezoneOffset();var u=l.getTimezoneOffset(),c=Math.max(o,u);a()[e>>2>>>0]=60*c,a()[t>>2>>>0]=Number(o!=u),e=r(s),t=r(l),e=He(e),t=He(t),u<o?(i()[n>>2>>>0]=e,i()[n+4>>2>>>0]=t):(i()[n>>2>>>0]=t,i()[n+4>>2>>>0]=e)}function Ge(e,t){var n=arguments.length-2,r=arguments;return function(e){var t=Et();return e=e(),kt(t),e}(()=>{for(var o=Pt(8*n),a=o>>3,i=0;i<n;i++){var l=r[2+i];s()[a+i>>>0]=l}return _t(e,n,o,t)})}l.executeNotifiedProxyingQueue=Be,_e=S?()=>{var e=process.hrtime();return 1e3*e[0]+e[1]/1e6}:x?()=>performance.now()-l.__performance_now_clock_drift:()=>performance.now();var We,Ye=[],Ke={};function Xe(){if(!We){var e,t={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",_:y||"./this.program"};for(e in Ke)void 0===Ke[e]?delete t[e]:t[e]=Ke[e];var n=[];for(e in t)n.push(e+"="+t[e]);We=n}return We}function Qe(e,n){if(x)return Ge(20,1,e,n);var r=0;return Xe().forEach(function(o,a){var s=n+r;for(a=i()[e+4*a>>2>>>0]=s,s=0;s<o.length;++s)t()[(0|a++)>>>0]=o.charCodeAt(s);t()[(0|a)>>>0]=0,r+=o.length+1}),0}function Ze(e,t){if(x)return Ge(21,1,e,t);var n=Xe();i()[e>>2>>>0]=n.length;var r=0;return n.forEach(function(e){r+=e.length+1}),i()[t>>2>>>0]=r,0}function Je(e){return x?Ge(22,1,e):52}function et(e,t,n,r){return x?Ge(23,1,e,t,n,r):52}function tt(e,t,n,r,o){return x?Ge(24,1,e,t,n,r,o):70}var nt=[null,[],[]];function rt(e,t){var n=nt[e];0===t||10===t?((1===e?A:$)(z(n,0)),n.length=0):n.push(t)}function ot(e,t,n,r){if(x)return Ge(25,1,e,t,n,r);for(var a=0,s=0;s<n;s++){var l=i()[t>>2>>>0],u=i()[t+4>>2>>>0];t+=8;for(var c=0;c<u;c++)rt(e,o()[l+c>>>0]);a+=u}return i()[r>>2>>>0]=a,0}var at=0;function it(e){return 0==e%4&&(0!=e%100||0==e%400)}var st=[31,29,31,30,31,30,31,31,30,31,30,31],lt=[31,28,31,30,31,30,31,31,30,31,30,31];function ut(e,n,r,o){function i(e,t,n){for(e="number"==typeof e?e.toString():e||"";e.length<t;)e=n[0]+e;return e}function s(e,t){return i(e,t,"0")}function l(e,t){function n(e){return 0>e?-1:0<e?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 u(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 c(e){var t=e.Wb;for(e=new Date(new Date(e.Xb+1900,0,1).getTime());0<t;){var n=e.getMonth(),r=(it(e.getFullYear())?st:lt)[n];if(!(t>r-e.getDate())){e.setDate(e.getDate()+t);break}t-=r-e.getDate()+1,e.setDate(1),11>n?e.setMonth(n+1):(e.setMonth(0),e.setFullYear(e.getFullYear()+1))}return n=new Date(e.getFullYear()+1,0,4),t=u(new Date(e.getFullYear(),0,4)),n=u(n),0>=l(t,e)?0>=l(n,e)?e.getFullYear()+1:e.getFullYear():e.getFullYear()-1}var d=a()[o+40>>2>>>0];for(var f in o={Lc:a()[o>>2>>>0],Kc:a()[o+4>>2>>>0],dc:a()[o+8>>2>>>0],jc:a()[o+12>>2>>>0],ec:a()[o+16>>2>>>0],Xb:a()[o+20>>2>>>0],Tb:a()[o+24>>2>>>0],Wb:a()[o+28>>2>>>0],Rc:a()[o+32>>2>>>0],Jc:a()[o+36>>2>>>0],Mc:d?V(d):""},r=V(r),d={"%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"})r=r.replace(new RegExp(f,"g"),d[f]);var p,h,m="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),g="January February March April May June July August September October November December".split(" ");for(f in d={"%a":function(e){return m[e.Tb].substring(0,3)},"%A":function(e){return m[e.Tb]},"%b":function(e){return g[e.ec].substring(0,3)},"%B":function(e){return g[e.ec]},"%C":function(e){return s((e.Xb+1900)/100|0,2)},"%d":function(e){return s(e.jc,2)},"%e":function(e){return i(e.jc,2," ")},"%g":function(e){return c(e).toString().substring(2)},"%G":function(e){return c(e)},"%H":function(e){return s(e.dc,2)},"%I":function(e){return 0==(e=e.dc)?e=12:12<e&&(e-=12),s(e,2)},"%j":function(e){for(var t=0,n=0;n<=e.ec-1;t+=(it(e.Xb+1900)?st:lt)[n++]);return s(e.jc+t,3)},"%m":function(e){return s(e.ec+1,2)},"%M":function(e){return s(e.Kc,2)},"%n":function(){return"\n"},"%p":function(e){return 0<=e.dc&&12>e.dc?"AM":"PM"},"%S":function(e){return s(e.Lc,2)},"%t":function(){return"\t"},"%u":function(e){return e.Tb||7},"%U":function(e){return s(Math.floor((e.Wb+7-e.Tb)/7),2)},"%V":function(e){var t=Math.floor((e.Wb+7-(e.Tb+6)%7)/7);if(2>=(e.Tb+371-e.Wb-2)%7&&t++,t)53==t&&(4==(n=(e.Tb+371-e.Wb)%7)||3==n&&it(e.Xb)||(t=1));else{t=52;var n=(e.Tb+7-e.Wb-1)%7;(4==n||5==n&&it(e.Xb%400-1))&&t++}return s(t,2)},"%w":function(e){return e.Tb},"%W":function(e){return s(Math.floor((e.Wb+7-(e.Tb+6)%7)/7),2)},"%y":function(e){return(e.Xb+1900).toString().substring(2)},"%Y":function(e){return e.Xb+1900},"%z":function(e){var t=0<=(e=e.Jc);return e=Math.abs(e)/60,(t?"+":"-")+String("0000"+(e/60*100+e%60)).slice(-4)},"%Z":function(e){return e.Mc},"%%":function(){return"%"}},r=r.replace(/%%/g,"\0\0"),d)r.includes(f)&&(r=r.replace(new RegExp(f,"g"),d[f](o)));return p=r=r.replace(/\0\0/g,"%"),h=Array(q(p)+1),H(p,h,0,h.length),(f=h).length>n?0:(function(e,n){t().set(e,n>>>0)}(f,e),f.length-1)}pe.fc();var ct=[null,de,me,Ee,Pe,Oe,Ae,$e,Re,Ie,Ce,De,Ne,Me,Le,je,Fe,ze,Ve,qe,Qe,Ze,Je,et,tt,ot],dt={b:function(e){return pt(e+24)+24},n:function(e){return(e=new xe(e)).uc()||(e.hc(!0),we--),e.ic(!1),ve.push(e),e.sc(),e.vc()},ma:function(e){throw $("Unexpected exception thrown, this is not properly supported - aborting"),B=!0,e},x:function(){xt(0);var e=ve.pop();if(e.Hc()&&!e.kc()){var t=e.Dc();t&&be(t)(e.Zb),Te(e.Zb)}Se=0},e:function(){var e=Se;if(!e)return at=0;var t=new xe(e);t.cc(e);var n=t.bc();if(!n)return at=0,e;for(var r=Array.prototype.slice.call(arguments),o=0;o<r.length;o++){var a=r[o];if(0===a||a===n)break;if(Ot(a,n,t.Sb+16))return at=a,e}return at=n,e},l:function(){var e=Se;if(!e)return at=0;var t=new xe(e);t.cc(e);var n=t.bc();if(!n)return at=0,e;for(var r=Array.prototype.slice.call(arguments),o=0;o<r.length;o++){var a=r[o];if(0===a||a===n)break;if(Ot(a,n,t.Sb+16))return at=a,e}return at=n,e},h:function(){var e=Se;if(!e)return at=0;var t=new xe(e);t.cc(e);var n=t.bc();if(!n)return at=0,e;for(var r=Array.prototype.slice.call(arguments),o=0;o<r.length;o++){var a=r[o];if(0===a||a===n)break;if(Ot(a,n,t.Sb+16))return at=a,e}return at=n,e},t:Te,M:function(){var e=ve.pop();e||oe("no exception to throw");var t=e.Zb;throw e.kc()||(ve.push(e),e.ic(!0),e.hc(!1),we++),Se=t,t},c:function(e,t,n){throw new xe(e).fc(t,n),Se=e,we++,e},pa:function(){return we},Fa:function(e){bt(e,!w,1,!v),pe.pc()},T:function(e){x?postMessage({cmd:"cleanupThread",thread:e}):ue(e)},xa:ke,j:function(e){throw Se||(Se=e),e},H:Pe,Ma:Oe,ua:Ae,wa:$e,oa:Re,Ka:Ie,Ca:Ce,Ja:De,V:Ne,va:Me,sa:Le,La:je,ta:Fe,Ta:function(){},X:function(){oe("To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking")},Ua:function(){oe("To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking")},W:function(){return Date.now()},ya:function(){return 2097152},Oa:function(){return!0},za:function(e,t,n,r){if(e==t)setTimeout(()=>Be(r));else if(x)postMessage({targetThread:e,cmd:"processProxyingQueue",queue:r});else{if(!(e=pe.Vb[e]))return;e.postMessage({cmd:"processProxyingQueue",queue:r})}return 1},Ea:function(){return-1},Pa:function(e,t){e=new Date(1e3*Ue(e)),a()[t>>2>>>0]=e.getUTCSeconds(),a()[t+4>>2>>>0]=e.getUTCMinutes(),a()[t+8>>2>>>0]=e.getUTCHours(),a()[t+12>>2>>>0]=e.getUTCDate(),a()[t+16>>2>>>0]=e.getUTCMonth(),a()[t+20>>2>>>0]=e.getUTCFullYear()-1900,a()[t+24>>2>>>0]=e.getUTCDay(),e=(e.getTime()-Date.UTC(e.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,a()[t+28>>2>>>0]=e},Qa:function(e,t){e=new Date(1e3*Ue(e)),a()[t>>2>>>0]=e.getSeconds(),a()[t+4>>2>>>0]=e.getMinutes(),a()[t+8>>2>>>0]=e.getHours(),a()[t+12>>2>>>0]=e.getDate(),a()[t+16>>2>>>0]=e.getMonth(),a()[t+20>>2>>>0]=e.getFullYear()-1900,a()[t+24>>2>>>0]=e.getDay();var n=new Date(e.getFullYear(),0,1),r=(e.getTime()-n.getTime())/864e5|0;a()[t+28>>2>>>0]=r,a()[t+36>>2>>>0]=-60*e.getTimezoneOffset(),r=new Date(e.getFullYear(),6,1).getTimezoneOffset(),e=0|(r!=(n=n.getTimezoneOffset())&&e.getTimezoneOffset()==Math.min(n,r)),a()[t+32>>2>>>0]=e},Ra:function(e){var t=new Date(a()[e+20>>2>>>0]+1900,a()[e+16>>2>>>0],a()[e+12>>2>>>0],a()[e+8>>2>>>0],a()[e+4>>2>>>0],a()[e>>2>>>0],0),n=a()[e+32>>2>>>0],r=t.getTimezoneOffset(),o=new Date(t.getFullYear(),0,1),i=new Date(t.getFullYear(),6,1).getTimezoneOffset(),s=o.getTimezoneOffset(),l=Math.min(s,i);return 0>n?a()[e+32>>2>>>0]=Number(i!=s&&l==r):0<n!=(l==r)&&(i=Math.max(s,i),t.setTime(t.getTime()+6e4*((0<n?l:i)-r))),a()[e+24>>2>>>0]=t.getDay(),n=(t.getTime()-o.getTime())/864e5|0,a()[e+28>>2>>>0]=n,a()[e>>2>>>0]=t.getSeconds(),a()[e+4>>2>>>0]=t.getMinutes(),a()[e+8>>2>>>0]=t.getHours(),a()[e+12>>2>>>0]=t.getDate(),a()[e+16>>2>>>0]=t.getMonth(),t.getTime()/1e3|0},Aa:ze,Ba:Ve,Sa:function e(t,n,r){e.Ac||(e.Ac=!0,qe(t,n,r))},y:function(){oe("")},U:function(){if(!S&&!w){var e="Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread";ye||(ye={}),ye[e]||(ye[e]=1,S&&(e="warning: "+e),$(e))}},ra:function(){return 4294901760},B:_e,Ia:function(e,t,n){o().copyWithin(e>>>0,t>>>0,t+n>>>0)},F:function(){return S?n(3993).cpus().length:navigator.hardwareConcurrency},Da:function(e,t,n){Ye.length=t,n>>=3;for(var r=0;r<t;r++)Ye[r]=s()[n+r>>>0];return(0>e?se[-e-1]:ct[e]).apply(null,Ye)},qa:function(e){var t=o().length;if((e>>>=0)<=t||4294901760<e)return!1;for(var n=1;4>=n;n*=2){var r=t*(1+.2/n);r=Math.min(r,e+100663296);var a=Math;r=Math.max(e,r),a=a.min.call(a,4294901760,r+(65536-r%65536)%65536);e:{try{I.grow(a-D.byteLength+65535>>>16),G(I.buffer);var i=1;break e}catch(s){}i=void 0}if(i)return!0}return!1},Na:function(){throw"unwind"},Ga:Qe,Ha:Ze,J:fe,I:Je,S:et,ga:tt,R:ot,d:function(){return at},na:function e(r,o){e.lc||(e.lc=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var e=new Uint8Array(1);return()=>(crypto.getRandomValues(e),e[0])}if(S)try{var t=n(Object(function(){var e=new Error("Cannot find module 'crypto'");throw e.code="MODULE_NOT_FOUND",e}()));return()=>t.randomBytes(1)[0]}catch(r){}return()=>oe("randomDevice")}());for(var a=0;a<o;a++)t()[(r+a|0)>>>0]=e.lc();return 0},ia:function(e,t,n){var r=Et();try{return be(e)(t,n)}catch(o){if(kt(r),o!==o+0)throw o;xt(1,0)}},ja:function(e,t,n){var r=Et();try{return be(e)(t,n)}catch(o){if(kt(r),o!==o+0)throw o;xt(1,0)}},K:function(e){var t=Et();try{return be(e)()}catch(n){if(kt(t),n!==n+0)throw n;xt(1,0)}},f:function(e,t){var n=Et();try{return be(e)(t)}catch(r){if(kt(n),r!==r+0)throw r;xt(1,0)}},P:function(e,t,n){var r=Et();try{return be(e)(t,n)}catch(o){if(kt(r),o!==o+0)throw o;xt(1,0)}},Q:function(e,t,n){var r=Et();try{return be(e)(t,n)}catch(o){if(kt(r),o!==o+0)throw o;xt(1,0)}},k:function(e,t,n){var r=Et();try{return be(e)(t,n)}catch(o){if(kt(r),o!==o+0)throw o;xt(1,0)}},p:function(e,t,n,r){var o=Et();try{return be(e)(t,n,r)}catch(a){if(kt(o),a!==a+0)throw a;xt(1,0)}},q:function(e,t,n,r,o){var a=Et();try{return be(e)(t,n,r,o)}catch(i){if(kt(a),i!==i+0)throw i;xt(1,0)}},N:function(e,t,n,r,o,a){var i=Et();try{return be(e)(t,n,r,o,a)}catch(s){if(kt(i),s!==s+0)throw s;xt(1,0)}},s:function(e,t,n,r,o,a){var i=Et();try{return be(e)(t,n,r,o,a)}catch(s){if(kt(i),s!==s+0)throw s;xt(1,0)}},w:function(e,t,n,r,o,a,i){var s=Et();try{return be(e)(t,n,r,o,a,i)}catch(l){if(kt(s),l!==l+0)throw l;xt(1,0)}},L:function(e,t,n,r,o,a,i,s){var l=Et();try{return be(e)(t,n,r,o,a,i,s)}catch(u){if(kt(l),u!==u+0)throw u;xt(1,0)}},E:function(e,t,n,r,o,a,i,s,l,u,c,d){var f=Et();try{return be(e)(t,n,r,o,a,i,s,l,u,c,d)}catch(p){if(kt(f),p!==p+0)throw p;xt(1,0)}},aa:function(e,t,n,r,o,a,i,s){var l=Et();try{return jt(e,t,n,r,o,a,i,s)}catch(u){if(kt(l),u!==u+0)throw u;xt(1,0)}},_:function(e,t,n,r,o,a,i){var s=Et();try{return Rt(e,t,n,r,o,a,i)}catch(l){if(kt(s),l!==l+0)throw l;xt(1,0)}},Z:function(e,t,n,r,o){var a=Et();try{return Ft(e,t,n,r,o)}catch(i){if(kt(a),i!==i+0)throw i;xt(1,0)}},ca:function(e,t,n,r){var o=Et();try{return Mt(e,t,n,r)}catch(a){if(kt(o),a!==a+0)throw a;xt(1,0)}},$:function(e){var t=Et();try{return $t(e)}catch(n){if(kt(t),n!==n+0)throw n;xt(1,0)}},ba:function(e,t){var n=Et();try{return Lt(e,t)}catch(r){if(kt(n),r!==r+0)throw r;xt(1,0)}},Y:function(e,t,n){var r=Et();try{return It(e,t,n)}catch(o){if(kt(r),o!==o+0)throw o;xt(1,0)}},g:function(e){var t=Et();try{be(e)()}catch(n){if(kt(t),n!==n+0)throw n;xt(1,0)}},r:function(e,t){var n=Et();try{be(e)(t)}catch(r){if(kt(n),r!==r+0)throw r;xt(1,0)}},i:function(e,t,n){var r=Et();try{be(e)(t,n)}catch(o){if(kt(r),o!==o+0)throw o;xt(1,0)}},ha:function(e,t,n,r){var o=Et();try{be(e)(t,n,r)}catch(a){if(kt(o),a!==a+0)throw a;xt(1,0)}},m:function(e,t,n,r){var o=Et();try{be(e)(t,n,r)}catch(a){if(kt(o),a!==a+0)throw a;xt(1,0)}},v:function(e,t,n,r,o){var a=Et();try{be(e)(t,n,r,o)}catch(i){if(kt(a),i!==i+0)throw i;xt(1,0)}},u:function(e,t,n,r,o,a){var i=Et();try{be(e)(t,n,r,o,a)}catch(s){if(kt(i),s!==s+0)throw s;xt(1,0)}},O:function(e,t,n,r,o,a,i){var s=Et();try{be(e)(t,n,r,o,a,i)}catch(l){if(kt(s),l!==l+0)throw l;xt(1,0)}},A:function(e,t,n,r,o,a,i,s){var l=Et();try{be(e)(t,n,r,o,a,i,s)}catch(u){if(kt(l),u!==u+0)throw u;xt(1,0)}},ka:function(e,t,n,r,o,a,i,s,l){var u=Et();try{be(e)(t,n,r,o,a,i,s,l)}catch(c){if(kt(u),c!==c+0)throw c;xt(1,0)}},C:function(e,t,n,r,o,a,i,s,l,u,c){var d=Et();try{be(e)(t,n,r,o,a,i,s,l,u,c)}catch(f){if(kt(d),f!==f+0)throw f;xt(1,0)}},D:function(e,t,n,r,o,a,i,s,l,u,c,d,f,p,h,m){var g=Et();try{be(e)(t,n,r,o,a,i,s,l,u,c,d,f,p,h,m)}catch(b){if(kt(g),b!==b+0)throw b;xt(1,0)}},fa:function(e,t,n,r,o,a,i,s){var l=Et();try{Ct(e,t,n,r,o,a,i,s)}catch(u){if(kt(l),u!==u+0)throw u;xt(1,0)}},da:function(e,t,n,r,o,a,i,s,l,u,c,d){var f=Et();try{Nt(e,t,n,r,o,a,i,s,l,u,c,d)}catch(p){if(kt(f),p!==p+0)throw p;xt(1,0)}},ea:function(e,t,n,r,o,a){var i=Et();try{Dt(e,t,n,r,o,a)}catch(s){if(kt(i),s!==s+0)throw s;xt(1,0)}},o:function(e){return e},a:I||l.wasmMemory,G:function(e){at=e},la:ut,z:function(e,t,n,r){return ut(e,t,n,r)}};!function(){function e(e,t){l.asm=e.exports,pe.qc.push(l.asm.sb),Y=l.asm.ub,X.unshift(l.asm.Va),C=t,x||(ne--,l.monitorRunDependencies&&l.monitorRunDependencies(ne),0==ne&&re&&(e=re,re=null,e()))}function t(t){e(t.instance,t.module)}function n(e){return function(){if(!O&&(v||w)){if("function"==typeof fetch&&!te.startsWith("file://"))return fetch(te,{credentials:"same-origin"}).then(function(e){if(!e.ok)throw"failed to load wasm binary file at '"+te+"'";return e.arrayBuffer()}).catch(function(){return ie()});if(f)return new Promise(function(e,t){f(te,function(t){e(new Uint8Array(t))},t)})}return Promise.resolve().then(function(){return ie()})}().then(function(e){return WebAssembly.instantiate(e,r)}).then(function(e){return e}).then(e,function(e){$("failed to asynchronously prepare wasm: "+e),oe(e)})}var r={a:dt};if(x||(ne++,l.monitorRunDependencies&&l.monitorRunDependencies(ne)),l.instantiateWasm)try{return l.instantiateWasm(r,e)}catch(o){return $("Module.instantiateWasm callback failed with error: "+o),!1}(O||"function"!=typeof WebAssembly.instantiateStreaming||ae()||te.startsWith("file://")||S||"function"!=typeof fetch?n(t):fetch(te,{credentials:"same-origin"}).then(function(e){return WebAssembly.instantiateStreaming(e,r).then(t,function(e){return $("wasm streaming compile failed: "+e),$("falling back to ArrayBuffer instantiation"),n(t)})})).catch(c)}(),l.___wasm_call_ctors=function(){return(l.___wasm_call_ctors=l.asm.Va).apply(null,arguments)},l._OrtInit=function(){return(l._OrtInit=l.asm.Wa).apply(null,arguments)},l._OrtCreateSessionOptions=function(){return(l._OrtCreateSessionOptions=l.asm.Xa).apply(null,arguments)},l._OrtAppendExecutionProvider=function(){return(l._OrtAppendExecutionProvider=l.asm.Ya).apply(null,arguments)},l._OrtAddSessionConfigEntry=function(){return(l._OrtAddSessionConfigEntry=l.asm.Za).apply(null,arguments)},l._OrtReleaseSessionOptions=function(){return(l._OrtReleaseSessionOptions=l.asm._a).apply(null,arguments)},l._OrtCreateSession=function(){return(l._OrtCreateSession=l.asm.$a).apply(null,arguments)},l._OrtReleaseSession=function(){return(l._OrtReleaseSession=l.asm.ab).apply(null,arguments)},l._OrtGetInputCount=function(){return(l._OrtGetInputCount=l.asm.bb).apply(null,arguments)},l._OrtGetOutputCount=function(){return(l._OrtGetOutputCount=l.asm.cb).apply(null,arguments)},l._OrtGetInputName=function(){return(l._OrtGetInputName=l.asm.db).apply(null,arguments)},l._OrtGetOutputName=function(){return(l._OrtGetOutputName=l.asm.eb).apply(null,arguments)},l._OrtFree=function(){return(l._OrtFree=l.asm.fb).apply(null,arguments)},l._OrtCreateTensor=function(){return(l._OrtCreateTensor=l.asm.gb).apply(null,arguments)},l._OrtGetTensorData=function(){return(l._OrtGetTensorData=l.asm.hb).apply(null,arguments)},l._OrtReleaseTensor=function(){return(l._OrtReleaseTensor=l.asm.ib).apply(null,arguments)},l._OrtCreateRunOptions=function(){return(l._OrtCreateRunOptions=l.asm.jb).apply(null,arguments)},l._OrtAddRunConfigEntry=function(){return(l._OrtAddRunConfigEntry=l.asm.kb).apply(null,arguments)},l._OrtReleaseRunOptions=function(){return(l._OrtReleaseRunOptions=l.asm.lb).apply(null,arguments)},l._OrtRun=function(){return(l._OrtRun=l.asm.mb).apply(null,arguments)},l._OrtEndProfiling=function(){return(l._OrtEndProfiling=l.asm.nb).apply(null,arguments)};var ft=l._pthread_self=function(){return(ft=l._pthread_self=l.asm.ob).apply(null,arguments)},pt=l._malloc=function(){return(pt=l._malloc=l.asm.pb).apply(null,arguments)},ht=l._free=function(){return(ht=l._free=l.asm.qb).apply(null,arguments)},mt=l._fflush=function(){return(mt=l._fflush=l.asm.rb).apply(null,arguments)};l.__emscripten_tls_init=function(){return(l.__emscripten_tls_init=l.asm.sb).apply(null,arguments)};var gt=l.___funcs_on_exit=function(){return(gt=l.___funcs_on_exit=l.asm.tb).apply(null,arguments)},bt=l.__emscripten_thread_init=function(){return(bt=l.__emscripten_thread_init=l.asm.vb).apply(null,arguments)};l.__emscripten_thread_crashed=function(){return(l.__emscripten_thread_crashed=l.asm.wb).apply(null,arguments)};var yt,_t=l._emscripten_run_in_main_runtime_thread_js=function(){return(_t=l._emscripten_run_in_main_runtime_thread_js=l.asm.xb).apply(null,arguments)},vt=l.__emscripten_proxy_execute_task_queue=function(){return(vt=l.__emscripten_proxy_execute_task_queue=l.asm.yb).apply(null,arguments)},wt=l.__emscripten_thread_free_data=function(){return(wt=l.__emscripten_thread_free_data=l.asm.zb).apply(null,arguments)},St=l.__emscripten_thread_exit=function(){return(St=l.__emscripten_thread_exit=l.asm.Ab).apply(null,arguments)},xt=l._setThrew=function(){return(xt=l._setThrew=l.asm.Bb).apply(null,arguments)},Tt=l._emscripten_stack_set_limits=function(){return(Tt=l._emscripten_stack_set_limits=l.asm.Cb).apply(null,arguments)},Et=l.stackSave=function(){return(Et=l.stackSave=l.asm.Db).apply(null,arguments)},kt=l.stackRestore=function(){return(kt=l.stackRestore=l.asm.Eb).apply(null,arguments)},Pt=l.stackAlloc=function(){return(Pt=l.stackAlloc=l.asm.Fb).apply(null,arguments)},Ot=l.___cxa_can_catch=function(){return(Ot=l.___cxa_can_catch=l.asm.Gb).apply(null,arguments)},At=l.___cxa_is_pointer_type=function(){return(At=l.___cxa_is_pointer_type=l.asm.Hb).apply(null,arguments)},$t=l.dynCall_j=function(){return($t=l.dynCall_j=l.asm.Ib).apply(null,arguments)},Rt=l.dynCall_iiiiij=function(){return(Rt=l.dynCall_iiiiij=l.asm.Jb).apply(null,arguments)},It=l.dynCall_jii=function(){return(It=l.dynCall_jii=l.asm.Kb).apply(null,arguments)},Ct=l.dynCall_viiiiij=function(){return(Ct=l.dynCall_viiiiij=l.asm.Lb).apply(null,arguments)},Dt=l.dynCall_vjji=function(){return(Dt=l.dynCall_vjji=l.asm.Mb).apply(null,arguments)},Nt=l.dynCall_viiijjjii=function(){return(Nt=l.dynCall_viiijjjii=l.asm.Nb).apply(null,arguments)},Mt=l.dynCall_iij=function(){return(Mt=l.dynCall_iij=l.asm.Ob).apply(null,arguments)},Lt=l.dynCall_ji=function(){return(Lt=l.dynCall_ji=l.asm.Pb).apply(null,arguments)},jt=l.dynCall_iiiiiij=function(){return(jt=l.dynCall_iiiiiij=l.asm.Qb).apply(null,arguments)},Ft=l.dynCall_iiij=function(){return(Ft=l.dynCall_iiij=l.asm.Rb).apply(null,arguments)};function Bt(){function e(){if(!yt&&(yt=!0,l.calledRun=!0,!B)&&(x||he(X),u(l),l.onRuntimeInitialized&&l.onRuntimeInitialized(),!x)){if(l.postRun)for("function"==typeof l.postRun&&(l.postRun=[l.postRun]);l.postRun.length;){var e=l.postRun.shift();Z.unshift(e)}he(Z)}}if(!(0<ne))if(x)u(l),x||he(X),postMessage({cmd:"loaded"});else{if(l.preRun)for("function"==typeof l.preRun&&(l.preRun=[l.preRun]);l.preRun.length;)ee();he(K),0<ne||(l.setStatus?(l.setStatus("Running..."),setTimeout(function(){setTimeout(function(){l.setStatus("")},1),e()},1)):e())}}if(l.UTF8ToString=V,l.stringToUTF8=function(e,t,n){return H(e,o(),t,n)},l.lengthBytesUTF8=q,l.keepRuntimeAlive=J,l.wasmMemory=I,l.stackSave=Et,l.stackRestore=kt,l.stackAlloc=Pt,l.ExitStatus=le,l.PThread=pe,re=function e(){yt||Bt(),yt||(re=e)},l.preInit)for("function"==typeof l.preInit&&(l.preInit=[l.preInit]);0<l.preInit.length;)l.preInit.pop()();return Bt(),e.ready});e.exports=o},932:(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,a;e=e||{},t||(t=void 0!==e?e:{}),t.ready=new Promise(function(e,t){o=e,a=t});var i,s,l,u,c,d,f=Object.assign({},t),p="./this.program",h=(e,t)=>{throw t},m="object"==typeof window,g="function"==typeof importScripts,b="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,y="";b?(y=g?n(908).dirname(y)+"/":"//",d=()=>{c||(u=n(1384),c=n(908))},i=function(e,t){return d(),e=c.normalize(e),u.readFileSync(e,t?void 0:"utf8")},l=e=>((e=i(e,!0)).buffer||(e=new Uint8Array(e)),e),s=(e,t,n)=>{d(),e=c.normalize(e),u.readFile(e,function(e,r){e?n(e):t(r.buffer)})},1<process.argv.length&&(p=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),process.on("uncaughtException",function(e){if(!(e instanceof X))throw e}),process.on("unhandledRejection",function(e){throw e}),h=(e,t)=>{if(S||0<U)throw process.exitCode=e,t;t instanceof X||w("exiting due to exception: "+t),process.exit(e)},t.inspect=function(){return"[Emscripten Module object]"}):(m||g)&&(g?y=self.location.href:"undefined"!=typeof document&&document.currentScript&&(y=document.currentScript.src),r&&(y=r),y=0!==y.indexOf("blob:")?y.substr(0,y.replace(/[?#].*/,"").lastIndexOf("/")+1):"",i=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},g&&(l=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),s=(e,t,n)=>{var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?t(r.response):n()},r.onerror=n,r.send(null)});var _,v=t.print||console.log.bind(console),w=t.printErr||console.warn.bind(console);Object.assign(t,f),f=null,t.thisProgram&&(p=t.thisProgram),t.quit&&(h=t.quit),t.wasmBinary&&(_=t.wasmBinary);var S=t.noExitRuntime||!1;"object"!=typeof WebAssembly&&G("no native wasm support detected");var x,T,E,k,P,O,A=!1,$="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function R(e,t,n){var r=(t>>>=0)+n;for(n=t;e[n]&&!(n>=r);)++n;if(16<n-t&&e.buffer&&$)return $.decode(e.subarray(t,n));for(r="";t<n;){var o=e[t++];if(128&o){var a=63&e[t++];if(192==(224&o))r+=String.fromCharCode((31&o)<<6|a);else{var i=63&e[t++];65536>(o=224==(240&o)?(15&o)<<12|a<<6|i:(7&o)<<18|a<<12|i<<6|63&e[t++])?r+=String.fromCharCode(o):(o-=65536,r+=String.fromCharCode(55296|o>>10,56320|1023&o))}}else r+=String.fromCharCode(o)}return r}function I(e,t){return(e>>>=0)?R(k,e,t):""}function C(e,t,n,r){if(!(0<r))return 0;var o=n>>>=0;r=n+r-1;for(var a=0;a<e.length;++a){var i=e.charCodeAt(a);if(55296<=i&&57343>=i&&(i=65536+((1023&i)<<10)|1023&e.charCodeAt(++a)),127>=i){if(n>=r)break;t[n++>>>0]=i}else{if(2047>=i){if(n+1>=r)break;t[n++>>>0]=192|i>>6}else{if(65535>=i){if(n+2>=r)break;t[n++>>>0]=224|i>>12}else{if(n+3>=r)break;t[n++>>>0]=240|i>>18,t[n++>>>0]=128|i>>12&63}t[n++>>>0]=128|i>>6&63}t[n++>>>0]=128|63&i}}return t[n>>>0]=0,n-o}function D(e){for(var t=0,n=0;n<e.length;++n){var r=e.charCodeAt(n);127>=r?t++:2047>=r?t+=2:55296<=r&&57343>=r?(t+=4,++n):t+=3}return t}function N(){var e=x.buffer;T=e,t.HEAP8=E=new Int8Array(e),t.HEAP16=new Int16Array(e),t.HEAP32=P=new Int32Array(e),t.HEAPU8=k=new Uint8Array(e),t.HEAPU16=new Uint16Array(e),t.HEAPU32=O=new Uint32Array(e),t.HEAPF32=new Float32Array(e),t.HEAPF64=new Float64Array(e)}var M,L=[],j=[],F=[],B=[],U=0;function z(){var e=t.preRun.shift();L.unshift(e)}var V,H=0,q=null;function G(e){throw t.onAbort&&t.onAbort(e),w(e="Aborted("+e+")"),A=!0,e=new WebAssembly.RuntimeError(e+". Build with -sASSERTIONS for more info."),a(e),e}function W(){return V.startsWith("data:application/octet-stream;base64,")}if(V="ort-wasm.wasm",!W()){var Y=V;V=t.locateFile?t.locateFile(Y,y):y+Y}function K(){var e=V;try{if(e==V&&_)return new Uint8Array(_);if(l)return l(e);throw"both async and sync fetching of the wasm failed"}catch(t){G(t)}}function X(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function Q(e){for(;0<e.length;)e.shift()(t)}var Z=[],J=0,ee=0;function te(e){this.Db=e,this.zb=e-24,this.Ub=function(e){O[this.zb+4>>2>>>0]=e},this.Eb=function(){return O[this.zb+4>>2>>>0]},this.Sb=function(e){O[this.zb+8>>2>>>0]=e},this.Wb=function(){return O[this.zb+8>>2>>>0]},this.Tb=function(){P[this.zb>>2>>>0]=0},this.Ib=function(e){E[(this.zb+12|0)>>>0]=e?1:0},this.Pb=function(){return 0!=E[(this.zb+12|0)>>>0]},this.Jb=function(e){E[(this.zb+13|0)>>>0]=e?1:0},this.Lb=function(){return 0!=E[(this.zb+13|0)>>>0]},this.Rb=function(e,t){this.Fb(0),this.Ub(e),this.Sb(t),this.Tb(),this.Ib(!1),this.Jb(!1)},this.Nb=function(){P[this.zb>>2>>>0]+=1},this.Xb=function(){var e=P[this.zb>>2>>>0];return P[this.zb>>2>>>0]=e-1,1===e},this.Fb=function(e){O[this.zb+16>>2>>>0]=e},this.Ob=function(){return O[this.zb+16>>2>>>0]},this.Qb=function(){if(Pe(this.Eb()))return O[this.Db>>2>>>0];var e=this.Ob();return 0!==e?e:this.Db}}function ne(e){return _e(new te(e).zb)}var re=[];function oe(e){var t=re[e];return t||(e>=re.length&&(re.length=e+1),re[e]=t=M.get(e)),t}function ae(e){var t=D(e)+1,n=ye(t);return n&&C(e,E,n,t),n}var ie={};function se(){if(!le){var e,t={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",_:p||"./this.program"};for(e in ie)void 0===ie[e]?delete t[e]:t[e]=ie[e];var n=[];for(e in t)n.push(e+"="+t[e]);le=n}return le}var le,ue=[null,[],[]];function ce(e,t){var n=ue[e];0===t||10===t?((1===e?v:w)(R(n,0)),n.length=0):n.push(t)}var de=0;function fe(e){return 0==e%4&&(0!=e%100||0==e%400)}var pe=[31,29,31,30,31,30,31,31,30,31,30,31],he=[31,28,31,30,31,30,31,31,30,31,30,31];function me(e,t,n,r){function o(e,t,n){for(e="number"==typeof e?e.toString():e||"";e.length<t;)e=n[0]+e;return e}function a(e,t){return o(e,t,"0")}function i(e,t){function n(e){return 0>e?-1:0<e?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 s(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 l(e){var t=e.Bb;for(e=new Date(new Date(e.Cb+1900,0,1).getTime());0<t;){var n=e.getMonth(),r=(fe(e.getFullYear())?pe:he)[n];if(!(t>r-e.getDate())){e.setDate(e.getDate()+t);break}t-=r-e.getDate()+1,e.setDate(1),11>n?e.setMonth(n+1):(e.setMonth(0),e.setFullYear(e.getFullYear()+1))}return n=new Date(e.getFullYear()+1,0,4),t=s(new Date(e.getFullYear(),0,4)),n=s(n),0>=i(t,e)?0>=i(n,e)?e.getFullYear()+1:e.getFullYear():e.getFullYear()-1}var u=P[r+40>>2>>>0];for(var c in r={$b:P[r>>2>>>0],Zb:P[r+4>>2>>>0],Gb:P[r+8>>2>>>0],Kb:P[r+12>>2>>>0],Hb:P[r+16>>2>>>0],Cb:P[r+20>>2>>>0],Ab:P[r+24>>2>>>0],Bb:P[r+28>>2>>>0],bc:P[r+32>>2>>>0],Yb:P[r+36>>2>>>0],ac:u?I(u):""},n=I(n),u={"%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"})n=n.replace(new RegExp(c,"g"),u[c]);var d,f,p="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),h="January February March April May June July August September October November December".split(" ");for(c in u={"%a":function(e){return p[e.Ab].substring(0,3)},"%A":function(e){return p[e.Ab]},"%b":function(e){return h[e.Hb].substring(0,3)},"%B":function(e){return h[e.Hb]},"%C":function(e){return a((e.Cb+1900)/100|0,2)},"%d":function(e){return a(e.Kb,2)},"%e":function(e){return o(e.Kb,2," ")},"%g":function(e){return l(e).toString().substring(2)},"%G":function(e){return l(e)},"%H":function(e){return a(e.Gb,2)},"%I":function(e){return 0==(e=e.Gb)?e=12:12<e&&(e-=12),a(e,2)},"%j":function(e){for(var t=0,n=0;n<=e.Hb-1;t+=(fe(e.Cb+1900)?pe:he)[n++]);return a(e.Kb+t,3)},"%m":function(e){return a(e.Hb+1,2)},"%M":function(e){return a(e.Zb,2)},"%n":function(){return"\n"},"%p":function(e){return 0<=e.Gb&&12>e.Gb?"AM":"PM"},"%S":function(e){return a(e.$b,2)},"%t":function(){return"\t"},"%u":function(e){return e.Ab||7},"%U":function(e){return a(Math.floor((e.Bb+7-e.Ab)/7),2)},"%V":function(e){var t=Math.floor((e.Bb+7-(e.Ab+6)%7)/7);if(2>=(e.Ab+371-e.Bb-2)%7&&t++,t)53==t&&(4==(n=(e.Ab+371-e.Bb)%7)||3==n&&fe(e.Cb)||(t=1));else{t=52;var n=(e.Ab+7-e.Bb-1)%7;(4==n||5==n&&fe(e.Cb%400-1))&&t++}return a(t,2)},"%w":function(e){return e.Ab},"%W":function(e){return a(Math.floor((e.Bb+7-(e.Ab+6)%7)/7),2)},"%y":function(e){return(e.Cb+1900).toString().substring(2)},"%Y":function(e){return e.Cb+1900},"%z":function(e){var t=0<=(e=e.Yb);return e=Math.abs(e)/60,(t?"+":"-")+String("0000"+(e/60*100+e%60)).slice(-4)},"%Z":function(e){return e.ac},"%%":function(){return"%"}},n=n.replace(/%%/g,"\0\0"),u)n.includes(c)&&(n=n.replace(new RegExp(c,"g"),u[c](r)));return d=n=n.replace(/\0\0/g,"%"),f=Array(D(d)+1),C(d,f,0,f.length),(c=f).length>t?0:(E.set(c,e>>>0),c.length-1)}var ge={a:function(e){return ye(e+24)+24},m:function(e){return(e=new te(e)).Pb()||(e.Ib(!0),J--),e.Jb(!1),Z.push(e),e.Nb(),e.Qb()},ia:function(e){throw w("Unexpected exception thrown, this is not properly supported - aborting"),A=!0,e},w:function(){Se(0);var e=Z.pop();if(e.Xb()&&!e.Lb()){var t=e.Wb();t&&oe(t)(e.Db),ne(e.Db)}ee=0},d:function(){var e=ee;if(!e)return de=0;var t=new te(e);t.Fb(e);var n=t.Eb();if(!n)return de=0,e;for(var r=Array.prototype.slice.call(arguments),o=0;o<r.length;o++){var a=r[o];if(0===a||a===n)break;if(ke(a,n,t.zb+16))return de=a,e}return de=n,e},k:function(){var e=ee;if(!e)return de=0;var t=new te(e);t.Fb(e);var n=t.Eb();if(!n)return de=0,e;for(var r=Array.prototype.slice.call(arguments),o=0;o<r.length;o++){var a=r[o];if(0===a||a===n)break;if(ke(a,n,t.zb+16))return de=a,e}return de=n,e},g:function(){var e=ee;if(!e)return de=0;var t=new te(e);t.Fb(e);var n=t.Eb();if(!n)return de=0,e;for(var r=Array.prototype.slice.call(arguments),o=0;o<r.length;o++){var a=r[o];if(0===a||a===n)break;if(ke(a,n,t.zb+16))return de=a,e}return de=n,e},s:ne,L:function(){var e=Z.pop();e||G("no exception to throw");var t=e.Db;throw e.Lb()||(Z.push(e),e.Jb(!0),e.Ib(!1),J++),ee=t,t},b:function(e,t,n){throw new te(e).Rb(t,n),ee=e,J++,e},la:function(){return J},i:function(e){throw ee||(ee=e),e},H:function(){return 0},Ba:function(){},pa:function(){},ra:function(){},ka:function(){return 0},za:function(){},ua:function(){},ya:function(){},R:function(){},qa:function(){},na:function(){},Aa:function(){},oa:function(){},Ha:function(){},Ja:function(){G("To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking")},Ia:function(){G("To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking")},S:function(){return Date.now()},Ca:function(){return!0},Da:function(e,t){e=new Date(1e3*(O[e>>>2]+4294967296*P[e+4>>>2])),P[t>>2>>>0]=e.getUTCSeconds(),P[t+4>>2>>>0]=e.getUTCMinutes(),P[t+8>>2>>>0]=e.getUTCHours(),P[t+12>>2>>>0]=e.getUTCDate(),P[t+16>>2>>>0]=e.getUTCMonth(),P[t+20>>2>>>0]=e.getUTCFullYear()-1900,P[t+24>>2>>>0]=e.getUTCDay(),P[t+28>>2>>>0]=(e.getTime()-Date.UTC(e.getUTCFullYear(),0,1,0,0,0,0))/864e5|0},Ea:function(e,t){e=new Date(1e3*(O[e>>>2]+4294967296*P[e+4>>>2])),P[t>>2>>>0]=e.getSeconds(),P[t+4>>2>>>0]=e.getMinutes(),P[t+8>>2>>>0]=e.getHours(),P[t+12>>2>>>0]=e.getDate(),P[t+16>>2>>>0]=e.getMonth(),P[t+20>>2>>>0]=e.getFullYear()-1900,P[t+24>>2>>>0]=e.getDay();var n=new Date(e.getFullYear(),0,1);P[t+28>>2>>>0]=(e.getTime()-n.getTime())/864e5|0,P[t+36>>2>>>0]=-60*e.getTimezoneOffset();var r=new Date(e.getFullYear(),6,1).getTimezoneOffset();n=n.getTimezoneOffset(),P[t+32>>2>>>0]=0|(r!=n&&e.getTimezoneOffset()==Math.min(n,r))},Fa:function(e){var t=new Date(P[e+20>>2>>>0]+1900,P[e+16>>2>>>0],P[e+12>>2>>>0],P[e+8>>2>>>0],P[e+4>>2>>>0],P[e>>2>>>0],0),n=P[e+32>>2>>>0],r=t.getTimezoneOffset(),o=new Date(t.getFullYear(),0,1),a=new Date(t.getFullYear(),6,1).getTimezoneOffset(),i=o.getTimezoneOffset(),s=Math.min(i,a);return 0>n?P[e+32>>2>>>0]=Number(a!=i&&s==r):0<n!=(s==r)&&(a=Math.max(i,a),t.setTime(t.getTime()+6e4*((0<n?s:a)-r))),P[e+24>>2>>>0]=t.getDay(),P[e+28>>2>>>0]=(t.getTime()-o.getTime())/864e5|0,P[e>>2>>>0]=t.getSeconds(),P[e+4>>2>>>0]=t.getMinutes(),P[e+8>>2>>>0]=t.getHours(),P[e+12>>2>>>0]=t.getDate(),P[e+16>>2>>>0]=t.getMonth(),t.getTime()/1e3|0},sa:function(){return-52},ta:function(){},Ga:function e(t,n,r){e.Vb||(e.Vb=!0,function(e,t,n){function r(e){return(e=e.toTimeString().match(/\(([A-Za-z ]+)\)$/))?e[1]:"GMT"}var o=(new Date).getFullYear(),a=new Date(o,0,1),i=new Date(o,6,1);o=a.getTimezoneOffset();var s=i.getTimezoneOffset();P[e>>2>>>0]=60*Math.max(o,s),P[t>>2>>>0]=Number(o!=s),e=r(a),t=r(i),e=ae(e),t=ae(t),s<o?(O[n>>2>>>0]=e,O[n+4>>2>>>0]=t):(O[n>>2>>>0]=t,O[n+4>>2>>>0]=e)}(t,n,r))},B:function(){G("")},ma:function(){return 4294901760},I:b?()=>{var e=process.hrtime();return 1e3*e[0]+e[1]/1e6}:()=>performance.now(),xa:function(e,t,n){k.copyWithin(e>>>0,t>>>0,t+n>>>0)},G:function(e){var t=k.length;if(4294901760<(e>>>=0))return!1;for(var n=1;4>=n;n*=2){var r=t*(1+.2/n);r=Math.min(r,e+100663296);var o=Math;r=Math.max(e,r),o=o.min.call(o,4294901760,r+(65536-r%65536)%65536);e:{try{x.grow(o-T.byteLength+65535>>>16),N();var a=1;break e}catch(i){}a=void 0}if(a)return!0}return!1},va:function(e,t){var n=0;return se().forEach(function(r,o){var a=t+n;for(o=O[e+4*o>>2>>>0]=a,a=0;a<r.length;++a)E[(0|o++)>>>0]=r.charCodeAt(a);E[(0|o)>>>0]=0,n+=r.length+1}),0},wa:function(e,t){var n=se();O[e>>2>>>0]=n.length;var r=0;return n.forEach(function(e){r+=e.length+1}),O[t>>2>>>0]=r,0},ba:function(e){S||0<U||(we(),Q(F),ve(0),ue[1].length&&ce(1,10),ue[2].length&&ce(2,10)),S||0<U||(t.onExit&&t.onExit(e),A=!0),h(e,new X(e))},E:function(){return 52},Q:function(){return 52},ca:function(){return 70},P:function(e,t,n,r){for(var o=0,a=0;a<n;a++){var i=O[t>>2>>>0],s=O[t+4>>2>>>0];t+=8;for(var l=0;l<s;l++)ce(e,k[i+l>>>0]);o+=s}return O[r>>2>>>0]=o,0},c:function(){return de},ja:function e(t,r){e.Mb||(e.Mb=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var e=new Uint8Array(1);return()=>(crypto.getRandomValues(e),e[0])}if(b)try{var t=n(Object(function(){var e=new Error("Cannot find module 'crypto'");throw e.code="MODULE_NOT_FOUND",e}()));return()=>t.randomBytes(1)[0]}catch(r){}return()=>G("randomDevice")}());for(var o=0;o<r;o++)E[(t+o|0)>>>0]=e.Mb();return 0},ea:function(e,t,n){var r=xe();try{return oe(e)(t,n)}catch(o){if(Te(r),o!==o+0)throw o;Se(1,0)}},fa:function(e,t,n){var r=xe();try{return oe(e)(t,n)}catch(o){if(Te(r),o!==o+0)throw o;Se(1,0)}},J:function(e){var t=xe();try{return oe(e)()}catch(n){if(Te(t),n!==n+0)throw n;Se(1,0)}},e:function(e,t){var n=xe();try{return oe(e)(t)}catch(r){if(Te(n),r!==r+0)throw r;Se(1,0)}},N:function(e,t,n){var r=xe();try{return oe(e)(t,n)}catch(o){if(Te(r),o!==o+0)throw o;Se(1,0)}},O:function(e,t,n){var r=xe();try{return oe(e)(t,n)}catch(o){if(Te(r),o!==o+0)throw o;Se(1,0)}},j:function(e,t,n){var r=xe();try{return oe(e)(t,n)}catch(o){if(Te(r),o!==o+0)throw o;Se(1,0)}},o:function(e,t,n,r){var o=xe();try{return oe(e)(t,n,r)}catch(a){if(Te(o),a!==a+0)throw a;Se(1,0)}},p:function(e,t,n,r,o){var a=xe();try{return oe(e)(t,n,r,o)}catch(i){if(Te(a),i!==i+0)throw i;Se(1,0)}},M:function(e,t,n,r,o,a){var i=xe();try{return oe(e)(t,n,r,o,a)}catch(s){if(Te(i),s!==s+0)throw s;Se(1,0)}},r:function(e,t,n,r,o,a){var i=xe();try{return oe(e)(t,n,r,o,a)}catch(s){if(Te(i),s!==s+0)throw s;Se(1,0)}},v:function(e,t,n,r,o,a,i){var s=xe();try{return oe(e)(t,n,r,o,a,i)}catch(l){if(Te(s),l!==l+0)throw l;Se(1,0)}},K:function(e,t,n,r,o,a,i,s){var l=xe();try{return oe(e)(t,n,r,o,a,i,s)}catch(u){if(Te(l),u!==u+0)throw u;Se(1,0)}},D:function(e,t,n,r,o,a,i,s,l,u,c,d){var f=xe();try{return oe(e)(t,n,r,o,a,i,s,l,u,c,d)}catch(p){if(Te(f),p!==p+0)throw p;Se(1,0)}},X:function(e,t,n,r,o,a,i,s){var l=xe();try{return Me(e,t,n,r,o,a,i,s)}catch(u){if(Te(l),u!==u+0)throw u;Se(1,0)}},V:function(e,t,n,r,o,a,i){var s=xe();try{return Ae(e,t,n,r,o,a,i)}catch(l){if(Te(s),l!==l+0)throw l;Se(1,0)}},U:function(e,t,n,r,o){var a=xe();try{return Le(e,t,n,r,o)}catch(i){if(Te(a),i!==i+0)throw i;Se(1,0)}},Z:function(e,t,n,r){var o=xe();try{return De(e,t,n,r)}catch(a){if(Te(o),a!==a+0)throw a;Se(1,0)}},W:function(e){var t=xe();try{return Oe(e)}catch(n){if(Te(t),n!==n+0)throw n;Se(1,0)}},Y:function(e,t){var n=xe();try{return Ne(e,t)}catch(r){if(Te(n),r!==r+0)throw r;Se(1,0)}},T:function(e,t,n){var r=xe();try{return $e(e,t,n)}catch(o){if(Te(r),o!==o+0)throw o;Se(1,0)}},f:function(e){var t=xe();try{oe(e)()}catch(n){if(Te(t),n!==n+0)throw n;Se(1,0)}},q:function(e,t){var n=xe();try{oe(e)(t)}catch(r){if(Te(n),r!==r+0)throw r;Se(1,0)}},h:function(e,t,n){var r=xe();try{oe(e)(t,n)}catch(o){if(Te(r),o!==o+0)throw o;Se(1,0)}},da:function(e,t,n,r){var o=xe();try{oe(e)(t,n,r)}catch(a){if(Te(o),a!==a+0)throw a;Se(1,0)}},l:function(e,t,n,r){var o=xe();try{oe(e)(t,n,r)}catch(a){if(Te(o),a!==a+0)throw a;Se(1,0)}},t:function(e,t,n,r,o){var a=xe();try{oe(e)(t,n,r,o)}catch(i){if(Te(a),i!==i+0)throw i;Se(1,0)}},u:function(e,t,n,r,o,a){var i=xe();try{oe(e)(t,n,r,o,a)}catch(s){if(Te(i),s!==s+0)throw s;Se(1,0)}},x:function(e,t,n,r,o,a,i){var s=xe();try{oe(e)(t,n,r,o,a,i)}catch(l){if(Te(s),l!==l+0)throw l;Se(1,0)}},z:function(e,t,n,r,o,a,i,s){var l=xe();try{oe(e)(t,n,r,o,a,i,s)}catch(u){if(Te(l),u!==u+0)throw u;Se(1,0)}},ga:function(e,t,n,r,o,a,i,s,l){var u=xe();try{oe(e)(t,n,r,o,a,i,s,l)}catch(c){if(Te(u),c!==c+0)throw c;Se(1,0)}},A:function(e,t,n,r,o,a,i,s,l,u,c){var d=xe();try{oe(e)(t,n,r,o,a,i,s,l,u,c)}catch(f){if(Te(d),f!==f+0)throw f;Se(1,0)}},C:function(e,t,n,r,o,a,i,s,l,u,c,d,f,p,h,m){var g=xe();try{oe(e)(t,n,r,o,a,i,s,l,u,c,d,f,p,h,m)}catch(b){if(Te(g),b!==b+0)throw b;Se(1,0)}},aa:function(e,t,n,r,o,a,i,s){var l=xe();try{Re(e,t,n,r,o,a,i,s)}catch(u){if(Te(l),u!==u+0)throw u;Se(1,0)}},_:function(e,t,n,r,o,a,i,s,l,u,c,d){var f=xe();try{Ce(e,t,n,r,o,a,i,s,l,u,c,d)}catch(p){if(Te(f),p!==p+0)throw p;Se(1,0)}},$:function(e,t,n,r,o,a){var i=xe();try{Ie(e,t,n,r,o,a)}catch(s){if(Te(i),s!==s+0)throw s;Se(1,0)}},n:function(e){return e},F:function(e){de=e},ha:me,y:function(e,t,n,r){return me(e,t,n,r)}};!function(){function e(e){t.asm=e.exports,x=t.asm.Ka,N(),M=t.asm.ib,j.unshift(t.asm.La),H--,t.monitorRunDependencies&&t.monitorRunDependencies(H),0==H&&q&&(e=q,q=null,e())}function n(t){e(t.instance)}function r(e){return function(){if(!_&&(m||g)){if("function"==typeof fetch&&!V.startsWith("file://"))return fetch(V,{credentials:"same-origin"}).then(function(e){if(!e.ok)throw"failed to load wasm binary file at '"+V+"'";return e.arrayBuffer()}).catch(function(){return K()});if(s)return new Promise(function(e,t){s(V,function(t){e(new Uint8Array(t))},t)})}return Promise.resolve().then(function(){return K()})}().then(function(e){return WebAssembly.instantiate(e,o)}).then(function(e){return e}).then(e,function(e){w("failed to asynchronously prepare wasm: "+e),G(e)})}var o={a:ge};if(H++,t.monitorRunDependencies&&t.monitorRunDependencies(H),t.instantiateWasm)try{return t.instantiateWasm(o,e)}catch(i){return w("Module.instantiateWasm callback failed with error: "+i),!1}(_||"function"!=typeof WebAssembly.instantiateStreaming||W()||V.startsWith("file://")||b||"function"!=typeof fetch?r(n):fetch(V,{credentials:"same-origin"}).then(function(e){return WebAssembly.instantiateStreaming(e,o).then(n,function(e){return w("wasm streaming compile failed: "+e),w("falling back to ArrayBuffer instantiation"),r(n)})})).catch(a)}(),t.___wasm_call_ctors=function(){return(t.___wasm_call_ctors=t.asm.La).apply(null,arguments)},t._OrtInit=function(){return(t._OrtInit=t.asm.Ma).apply(null,arguments)},t._OrtCreateSessionOptions=function(){return(t._OrtCreateSessionOptions=t.asm.Na).apply(null,arguments)},t._OrtAppendExecutionProvider=function(){return(t._OrtAppendExecutionProvider=t.asm.Oa).apply(null,arguments)},t._OrtAddSessionConfigEntry=function(){return(t._OrtAddSessionConfigEntry=t.asm.Pa).apply(null,arguments)},t._OrtReleaseSessionOptions=function(){return(t._OrtReleaseSessionOptions=t.asm.Qa).apply(null,arguments)},t._OrtCreateSession=function(){return(t._OrtCreateSession=t.asm.Ra).apply(null,arguments)},t._OrtReleaseSession=function(){return(t._OrtReleaseSession=t.asm.Sa).apply(null,arguments)},t._OrtGetInputCount=function(){return(t._OrtGetInputCount=t.asm.Ta).apply(null,arguments)},t._OrtGetOutputCount=function(){return(t._OrtGetOutputCount=t.asm.Ua).apply(null,arguments)},t._OrtGetInputName=function(){return(t._OrtGetInputName=t.asm.Va).apply(null,arguments)},t._OrtGetOutputName=function(){return(t._OrtGetOutputName=t.asm.Wa).apply(null,arguments)},t._OrtFree=function(){return(t._OrtFree=t.asm.Xa).apply(null,arguments)},t._OrtCreateTensor=function(){return(t._OrtCreateTensor=t.asm.Ya).apply(null,arguments)},t._OrtGetTensorData=function(){return(t._OrtGetTensorData=t.asm.Za).apply(null,arguments)},t._OrtReleaseTensor=function(){return(t._OrtReleaseTensor=t.asm._a).apply(null,arguments)},t._OrtCreateRunOptions=function(){return(t._OrtCreateRunOptions=t.asm.$a).apply(null,arguments)},t._OrtAddRunConfigEntry=function(){return(t._OrtAddRunConfigEntry=t.asm.ab).apply(null,arguments)},t._OrtReleaseRunOptions=function(){return(t._OrtReleaseRunOptions=t.asm.bb).apply(null,arguments)},t._OrtRun=function(){return(t._OrtRun=t.asm.cb).apply(null,arguments)},t._OrtEndProfiling=function(){return(t._OrtEndProfiling=t.asm.db).apply(null,arguments)};var be,ye=t._malloc=function(){return(ye=t._malloc=t.asm.eb).apply(null,arguments)},_e=t._free=function(){return(_e=t._free=t.asm.fb).apply(null,arguments)},ve=t._fflush=function(){return(ve=t._fflush=t.asm.gb).apply(null,arguments)},we=t.___funcs_on_exit=function(){return(we=t.___funcs_on_exit=t.asm.hb).apply(null,arguments)},Se=t._setThrew=function(){return(Se=t._setThrew=t.asm.jb).apply(null,arguments)},xe=t.stackSave=function(){return(xe=t.stackSave=t.asm.kb).apply(null,arguments)},Te=t.stackRestore=function(){return(Te=t.stackRestore=t.asm.lb).apply(null,arguments)},Ee=t.stackAlloc=function(){return(Ee=t.stackAlloc=t.asm.mb).apply(null,arguments)},ke=t.___cxa_can_catch=function(){return(ke=t.___cxa_can_catch=t.asm.nb).apply(null,arguments)},Pe=t.___cxa_is_pointer_type=function(){return(Pe=t.___cxa_is_pointer_type=t.asm.ob).apply(null,arguments)},Oe=t.dynCall_j=function(){return(Oe=t.dynCall_j=t.asm.pb).apply(null,arguments)},Ae=t.dynCall_iiiiij=function(){return(Ae=t.dynCall_iiiiij=t.asm.qb).apply(null,arguments)},$e=t.dynCall_jii=function(){return($e=t.dynCall_jii=t.asm.rb).apply(null,arguments)},Re=t.dynCall_viiiiij=function(){return(Re=t.dynCall_viiiiij=t.asm.sb).apply(null,arguments)},Ie=t.dynCall_vjji=function(){return(Ie=t.dynCall_vjji=t.asm.tb).apply(null,arguments)},Ce=t.dynCall_viiijjjii=function(){return(Ce=t.dynCall_viiijjjii=t.asm.ub).apply(null,arguments)},De=t.dynCall_iij=function(){return(De=t.dynCall_iij=t.asm.vb).apply(null,arguments)},Ne=t.dynCall_ji=function(){return(Ne=t.dynCall_ji=t.asm.wb).apply(null,arguments)},Me=t.dynCall_iiiiiij=function(){return(Me=t.dynCall_iiiiiij=t.asm.xb).apply(null,arguments)},Le=t.dynCall_iiij=function(){return(Le=t.dynCall_iiij=t.asm.yb).apply(null,arguments)};function je(){function e(){if(!be&&(be=!0,t.calledRun=!0,!A)){if(Q(j),o(t),t.onRuntimeInitialized&&t.onRuntimeInitialized(),t.postRun)for("function"==typeof t.postRun&&(t.postRun=[t.postRun]);t.postRun.length;){var e=t.postRun.shift();B.unshift(e)}Q(B)}}if(!(0<H)){if(t.preRun)for("function"==typeof t.preRun&&(t.preRun=[t.preRun]);t.preRun.length;)z();Q(L),0<H||(t.setStatus?(t.setStatus("Running..."),setTimeout(function(){setTimeout(function(){t.setStatus("")},1),e()},1)):e())}}if(t.UTF8ToString=I,t.stringToUTF8=function(e,t,n){return C(e,k,t,n)},t.lengthBytesUTF8=D,t.stackSave=xe,t.stackRestore=Te,t.stackAlloc=Ee,q=function e(){be||je(),be||(q=e)},t.preInit)for("function"==typeof t.preInit&&(t.preInit=[t.preInit]);0<t.preInit.length;)t.preInit.pop()();return je(),e.ready});e.exports=o},4537:e=>{e.exports=function(e,t){for(var n=new Array(arguments.length-1),r=0,o=2,a=!0;o<arguments.length;)n[r++]=arguments[o++];return new Promise(function(o,i){n[r]=function(e){if(a)if(a=!1,e)i(e);else{for(var t=new Array(arguments.length-1),n=0;n<t.length;)t[n++]=arguments[n];o.apply(null,t)}};try{e.apply(t||null,n)}catch(s){a&&(a=!1,i(s))}})}},7419:(e,t)=>{var n=t;n.length=function(e){var t=e.length;if(!t)return 0;for(var n=0;--t%4>1&&"="===e.charAt(t);)++n;return Math.ceil(3*e.length)/4-n};for(var r=new Array(64),o=new Array(123),a=0;a<64;)o[r[a]=a<26?a+65:a<52?a+71:a<62?a-4:a-59|43]=a++;n.encode=function(e,t,n){for(var o,a=null,i=[],s=0,l=0;t<n;){var u=e[t++];switch(l){case 0:i[s++]=r[u>>2],o=(3&u)<<4,l=1;break;case 1:i[s++]=r[o|u>>4],o=(15&u)<<2,l=2;break;case 2:i[s++]=r[o|u>>6],i[s++]=r[63&u],l=0}s>8191&&((a||(a=[])).push(String.fromCharCode.apply(String,i)),s=0)}return l&&(i[s++]=r[o],i[s++]=61,1===l&&(i[s++]=61)),a?(s&&a.push(String.fromCharCode.apply(String,i.slice(0,s))),a.join("")):String.fromCharCode.apply(String,i.slice(0,s))};var i="invalid encoding";n.decode=function(e,t,n){for(var r,a=n,s=0,l=0;l<e.length;){var u=e.charCodeAt(l++);if(61===u&&s>1)break;if(void 0===(u=o[u]))throw Error(i);switch(s){case 0:r=u,s=1;break;case 1:t[n++]=r<<2|(48&u)>>4,r=u,s=2;break;case 2:t[n++]=(15&r)<<4|(60&u)>>2,r=u,s=3;break;case 3:t[n++]=(3&r)<<6|u,s=0}}if(1===s)throw Error(i);return n-a},n.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},9211:e=>{function t(){this._listeners={}}e.exports=t,t.prototype.on=function(e,t,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:n||this}),this},t.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var n=this._listeners[e],r=0;r<n.length;)n[r].fn===t?n.splice(r,1):++r;return this},t.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var n=[],r=1;r<arguments.length;)n.push(arguments[r++]);for(r=0;r<t.length;)t[r].fn.apply(t[r++].ctx,n)}return this}},945:e=>{function t(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),n=new Uint8Array(t.buffer),r=128===n[3];function o(e,r,o){t[0]=e,r[o]=n[0],r[o+1]=n[1],r[o+2]=n[2],r[o+3]=n[3]}function a(e,r,o){t[0]=e,r[o]=n[3],r[o+1]=n[2],r[o+2]=n[1],r[o+3]=n[0]}function i(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],t[0]}function s(e,r){return n[3]=e[r],n[2]=e[r+1],n[1]=e[r+2],n[0]=e[r+3],t[0]}e.writeFloatLE=r?o:a,e.writeFloatBE=r?a:o,e.readFloatLE=r?i:s,e.readFloatBE=r?s:i}():function(){function t(e,t,n,r){var o=t<0?1:0;if(o&&(t=-t),0===t)e(1/t>0?0:2147483648,n,r);else if(isNaN(t))e(2143289344,n,r);else if(t>34028234663852886e22)e((o<<31|2139095040)>>>0,n,r);else if(t<11754943508222875e-54)e((o<<31|Math.round(t/1401298464324817e-60))>>>0,n,r);else{var a=Math.floor(Math.log(t)/Math.LN2);e((o<<31|a+127<<23|8388607&Math.round(t*Math.pow(2,-a)*8388608))>>>0,n,r)}}function i(e,t,n){var r=e(t,n),o=2*(r>>31)+1,a=r>>>23&255,i=8388607&r;return 255===a?i?NaN:o*(1/0):0===a?1401298464324817e-60*o*i:o*Math.pow(2,a-150)*(i+8388608)}e.writeFloatLE=t.bind(null,n),e.writeFloatBE=t.bind(null,r),e.readFloatLE=i.bind(null,o),e.readFloatBE=i.bind(null,a)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),n=new Uint8Array(t.buffer),r=128===n[7];function o(e,r,o){t[0]=e,r[o]=n[0],r[o+1]=n[1],r[o+2]=n[2],r[o+3]=n[3],r[o+4]=n[4],r[o+5]=n[5],r[o+6]=n[6],r[o+7]=n[7]}function a(e,r,o){t[0]=e,r[o]=n[7],r[o+1]=n[6],r[o+2]=n[5],r[o+3]=n[4],r[o+4]=n[3],r[o+5]=n[2],r[o+6]=n[1],r[o+7]=n[0]}function i(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],n[4]=e[r+4],n[5]=e[r+5],n[6]=e[r+6],n[7]=e[r+7],t[0]}function s(e,r){return n[7]=e[r],n[6]=e[r+1],n[5]=e[r+2],n[4]=e[r+3],n[3]=e[r+4],n[2]=e[r+5],n[1]=e[r+6],n[0]=e[r+7],t[0]}e.writeDoubleLE=r?o:a,e.writeDoubleBE=r?a:o,e.readDoubleLE=r?i:s,e.readDoubleBE=r?s:i}():function(){function t(e,t,n,r,o,a){var i=r<0?1:0;if(i&&(r=-r),0===r)e(0,o,a+t),e(1/r>0?0:2147483648,o,a+n);else if(isNaN(r))e(0,o,a+t),e(2146959360,o,a+n);else if(r>17976931348623157e292)e(0,o,a+t),e((i<<31|2146435072)>>>0,o,a+n);else{var s;if(r<22250738585072014e-324)e((s=r/5e-324)>>>0,o,a+t),e((i<<31|s/4294967296)>>>0,o,a+n);else{var l=Math.floor(Math.log(r)/Math.LN2);1024===l&&(l=1023),e(4503599627370496*(s=r*Math.pow(2,-l))>>>0,o,a+t),e((i<<31|l+1023<<20|1048576*s&1048575)>>>0,o,a+n)}}}function i(e,t,n,r,o){var a=e(r,o+t),i=e(r,o+n),s=2*(i>>31)+1,l=i>>>20&2047,u=4294967296*(1048575&i)+a;return 2047===l?u?NaN:s*(1/0):0===l?5e-324*s*u:s*Math.pow(2,l-1075)*(u+4503599627370496)}e.writeDoubleLE=t.bind(null,n,0,4),e.writeDoubleBE=t.bind(null,r,4,0),e.readDoubleLE=i.bind(null,o,0,4),e.readDoubleBE=i.bind(null,a,4,0)}(),e}function n(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}function r(e,t,n){t[n]=e>>>24,t[n+1]=e>>>16&255,t[n+2]=e>>>8&255,t[n+3]=255&e}function o(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function a(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}e.exports=t(t)},7199:module=>{function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(t){}return null}module.exports=inquire},6662:e=>{e.exports=function(e,t,n){var r=n||8192,o=r>>>1,a=null,i=r;return function(n){if(n<1||n>o)return e(n);i+n>r&&(a=e(r),i=0);var s=t.call(a,i,i+=n);return 7&i&&(i=1+(7|i)),s}}},4997:(e,t)=>{var n=t;n.length=function(e){for(var t=0,n=0,r=0;r<e.length;++r)(n=e.charCodeAt(r))<128?t+=1:n<2048?t+=2:55296==(64512&n)&&56320==(64512&e.charCodeAt(r+1))?(++r,t+=4):t+=3;return t},n.read=function(e,t,n){if(n-t<1)return"";for(var r,o=null,a=[],i=0;t<n;)(r=e[t++])<128?a[i++]=r:r>191&&r<224?a[i++]=(31&r)<<6|63&e[t++]:r>239&&r<365?(r=((7&r)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,a[i++]=55296+(r>>10),a[i++]=56320+(1023&r)):a[i++]=(15&r)<<12|(63&e[t++])<<6|63&e[t++],i>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,a)),i=0);return o?(i&&o.push(String.fromCharCode.apply(String,a.slice(0,i))),o.join("")):String.fromCharCode.apply(String,a.slice(0,i))},n.write=function(e,t,n){for(var r,o,a=n,i=0;i<e.length;++i)(r=e.charCodeAt(i))<128?t[n++]=r:r<2048?(t[n++]=r>>6|192,t[n++]=63&r|128):55296==(64512&r)&&56320==(64512&(o=e.charCodeAt(i+1)))?(r=65536+((1023&r)<<10)+(1023&o),++i,t[n++]=r>>18|240,t[n++]=r>>12&63|128,t[n++]=r>>6&63|128,t[n++]=63&r|128):(t[n++]=r>>12|224,t[n++]=r>>6&63|128,t[n++]=63&r|128);return n-a}},3442:(e,t)=>{t.__esModule=!0;var n=function(){function e(t){if(!t)throw new TypeError("Invalid argument; `value` has no value.");this.value=e.EMPTY,t&&e.isGuid(t)&&(this.value=t)}return e.isGuid=function(t){var n=t.toString();return t&&(t instanceof e||e.validator.test(n))},e.create=function(){return new e([e.gen(2),e.gen(1),e.gen(1),e.gen(1),e.gen(3)].join("-"))},e.createEmpty=function(){return new e("emptyguid")},e.parse=function(t){return new e(t)},e.raw=function(){return[e.gen(2),e.gen(1),e.gen(1),e.gen(1),e.gen(3)].join("-")},e.gen=function(e){for(var t="",n=0;n<e;n++)t+=(65536*(1+Math.random())|0).toString(16).substring(1);return t},e.prototype.equals=function(t){return e.isGuid(t)&&this.value===t.toString()},e.prototype.isEmpty=function(){return this.value===e.EMPTY},e.prototype.toString=function(){return this.value},e.prototype.toJSON=function(){return{value:this.value}},e.validator=new RegExp("^[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}$","i"),e.EMPTY="00000000-0000-0000-0000-000000000000",e}();t.Guid=n},3720: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={},a={};function i(e,t){var n,r,i;return t?(i=0<=(e>>>=0)&&e<256)&&(r=a[e])?r:(n=l(e,(0|e)<0?-1:0,!0),i&&(a[e]=n),n):(i=-128<=(e|=0)&&e<128)&&(r=o[e])?r:(n=l(e,e<0?-1:0,!1),i&&(o[e]=n),n)}function s(e,t){if(isNaN(e))return t?b:g;if(t){if(e<0)return b;if(e>=p)return S}else{if(e<=-h)return x;if(e+1>=h)return w}return e<0?s(-e,t).neg():l(e%f|0,e/f|0,t)}function l(e,t,r){return new n(e,t,r)}n.fromInt=i,n.fromNumber=s,n.fromBits=l;var u=Math.pow;function c(e,t,n){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return g;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 c(e.substring(1),t,n).neg();for(var o=s(u(n,8)),a=g,i=0;i<e.length;i+=8){var l=Math.min(8,e.length-i),d=parseInt(e.substring(i,i+l),n);if(l<8){var f=s(u(n,l));a=a.mul(f).add(s(d))}else a=(a=a.mul(o)).add(s(d))}return a.unsigned=t,a}function d(e,t){return"number"==typeof e?s(e,t):"string"==typeof e?c(e,t):l(e.low,e.high,"boolean"==typeof t?t:e.unsigned)}n.fromString=c,n.fromValue=d;var f=4294967296,p=f*f,h=p/2,m=i(1<<24),g=i(0);n.ZERO=g;var b=i(0,!0);n.UZERO=b;var y=i(1);n.ONE=y;var _=i(1,!0);n.UONE=_;var v=i(-1);n.NEG_ONE=v;var w=l(-1,2147483647,!1);n.MAX_VALUE=w;var S=l(-1,-1,!0);n.MAX_UNSIGNED_VALUE=S;var x=l(0,-2147483648,!1);n.MIN_VALUE=x;var T=n.prototype;T.toInt=function(){return this.unsigned?this.low>>>0:this.low},T.toNumber=function(){return this.unsigned?(this.high>>>0)*f+(this.low>>>0):this.high*f+(this.low>>>0)},T.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(x)){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),a=this,i="";;){var l=a.div(o),c=(a.sub(l.mul(o)).toInt()>>>0).toString(e);if((a=l).isZero())return c+i;for(;c.length<6;)c="0"+c;i=""+c+i}},T.getHighBits=function(){return this.high},T.getHighBitsUnsigned=function(){return this.high>>>0},T.getLowBits=function(){return this.low},T.getLowBitsUnsigned=function(){return this.low>>>0},T.getNumBitsAbs=function(){if(this.isNegative())return this.eq(x)?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},T.isZero=function(){return 0===this.high&&0===this.low},T.eqz=T.isZero,T.isNegative=function(){return!this.unsigned&&this.high<0},T.isPositive=function(){return this.unsigned||this.high>=0},T.isOdd=function(){return!(1&~this.low)},T.isEven=function(){return!(1&this.low)},T.equals=function(e){return r(e)||(e=d(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low},T.eq=T.equals,T.notEquals=function(e){return!this.eq(e)},T.neq=T.notEquals,T.ne=T.notEquals,T.lessThan=function(e){return this.comp(e)<0},T.lt=T.lessThan,T.lessThanOrEqual=function(e){return this.comp(e)<=0},T.lte=T.lessThanOrEqual,T.le=T.lessThanOrEqual,T.greaterThan=function(e){return this.comp(e)>0},T.gt=T.greaterThan,T.greaterThanOrEqual=function(e){return this.comp(e)>=0},T.gte=T.greaterThanOrEqual,T.ge=T.greaterThanOrEqual,T.compare=function(e){if(r(e)||(e=d(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},T.comp=T.compare,T.negate=function(){return!this.unsigned&&this.eq(x)?x:this.not().add(y)},T.neg=T.negate,T.add=function(e){r(e)||(e=d(e));var t=this.high>>>16,n=65535&this.high,o=this.low>>>16,a=65535&this.low,i=e.high>>>16,s=65535&e.high,u=e.low>>>16,c=0,f=0,p=0,h=0;return p+=(h+=a+(65535&e.low))>>>16,f+=(p+=o+u)>>>16,c+=(f+=n+s)>>>16,c+=t+i,l((p&=65535)<<16|(h&=65535),(c&=65535)<<16|(f&=65535),this.unsigned)},T.subtract=function(e){return r(e)||(e=d(e)),this.add(e.neg())},T.sub=T.subtract,T.multiply=function(e){if(this.isZero())return g;if(r(e)||(e=d(e)),t)return l(t.mul(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(e.isZero())return g;if(this.eq(x))return e.isOdd()?x:g;if(e.eq(x))return this.isOdd()?x:g;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(m)&&e.lt(m))return s(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,o=65535&this.high,a=this.low>>>16,i=65535&this.low,u=e.high>>>16,c=65535&e.high,f=e.low>>>16,p=65535&e.low,h=0,b=0,y=0,_=0;return y+=(_+=i*p)>>>16,b+=(y+=a*p)>>>16,y&=65535,b+=(y+=i*f)>>>16,h+=(b+=o*p)>>>16,b&=65535,h+=(b+=a*f)>>>16,b&=65535,h+=(b+=i*c)>>>16,h+=n*p+o*f+a*c+i*u,l((y&=65535)<<16|(_&=65535),(h&=65535)<<16|(b&=65535),this.unsigned)},T.mul=T.multiply,T.divide=function(e){if(r(e)||(e=d(e)),e.isZero())throw Error("division by zero");var n,o,a;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?b:g;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return b;if(e.gt(this.shru(1)))return _;a=b}else{if(this.eq(x))return e.eq(y)||e.eq(v)?x:e.eq(x)?y:(n=this.shr(1).div(e).shl(1)).eq(g)?e.isNegative()?y:v:(o=this.sub(e.mul(n)),a=n.add(o.div(e)));if(e.eq(x))return this.unsigned?b:g;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();a=g}for(o=this;o.gte(e);){n=Math.max(1,Math.floor(o.toNumber()/e.toNumber()));for(var i=Math.ceil(Math.log(n)/Math.LN2),c=i<=48?1:u(2,i-48),f=s(n),p=f.mul(e);p.isNegative()||p.gt(o);)p=(f=s(n-=c,this.unsigned)).mul(e);f.isZero()&&(f=y),a=a.add(f),o=o.sub(p)}return a},T.div=T.divide,T.modulo=function(e){return r(e)||(e=d(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))},T.mod=T.modulo,T.rem=T.modulo,T.not=function(){return l(~this.low,~this.high,this.unsigned)},T.and=function(e){return r(e)||(e=d(e)),l(this.low&e.low,this.high&e.high,this.unsigned)},T.or=function(e){return r(e)||(e=d(e)),l(this.low|e.low,this.high|e.high,this.unsigned)},T.xor=function(e){return r(e)||(e=d(e)),l(this.low^e.low,this.high^e.high,this.unsigned)},T.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)},T.shl=T.shiftLeft,T.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)},T.shr=T.shiftRight,T.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)},T.shru=T.shiftRightUnsigned,T.shr_u=T.shiftRightUnsigned,T.toSigned=function(){return this.unsigned?l(this.low,this.high,!1):this},T.toUnsigned=function(){return this.unsigned?this:l(this.low,this.high,!0)},T.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},T.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]},T.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)}},1446:(e,t,n)=>{var r,o,a,i=n(2100),s=i.Reader,l=i.Writer,u=i.util,c=i.roots.default||(i.roots.default={});c.onnx=((a={}).Version=(r={},(o=Object.create(r))[r[0]="_START_VERSION"]=0,o[r[1]="IR_VERSION_2017_10_10"]=1,o[r[2]="IR_VERSION_2017_10_30"]=2,o[r[3]="IR_VERSION_2017_11_3"]=3,o[r[4]="IR_VERSION_2019_1_22"]=4,o[r[5]="IR_VERSION"]=5,o),a.AttributeProto=function(){function e(e){if(this.floats=[],this.ints=[],this.strings=[],this.tensors=[],this.graphs=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.name="",e.prototype.refAttrName="",e.prototype.docString="",e.prototype.type=0,e.prototype.f=0,e.prototype.i=u.Long?u.Long.fromBits(0,0,!1):0,e.prototype.s=u.newBuffer([]),e.prototype.t=null,e.prototype.g=null,e.prototype.floats=u.emptyArray,e.prototype.ints=u.emptyArray,e.prototype.strings=u.emptyArray,e.prototype.tensors=u.emptyArray,e.prototype.graphs=u.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=l.create()),null!=e.name&&e.hasOwnProperty("name")&&t.uint32(10).string(e.name),null!=e.f&&e.hasOwnProperty("f")&&t.uint32(21).float(e.f),null!=e.i&&e.hasOwnProperty("i")&&t.uint32(24).int64(e.i),null!=e.s&&e.hasOwnProperty("s")&&t.uint32(34).bytes(e.s),null!=e.t&&e.hasOwnProperty("t")&&c.onnx.TensorProto.encode(e.t,t.uint32(42).fork()).ldelim(),null!=e.g&&e.hasOwnProperty("g")&&c.onnx.GraphProto.encode(e.g,t.uint32(50).fork()).ldelim(),null!=e.floats&&e.floats.length){t.uint32(58).fork();for(var n=0;n<e.floats.length;++n)t.float(e.floats[n]);t.ldelim()}if(null!=e.ints&&e.ints.length){for(t.uint32(66).fork(),n=0;n<e.ints.length;++n)t.int64(e.ints[n]);t.ldelim()}if(null!=e.strings&&e.strings.length)for(n=0;n<e.strings.length;++n)t.uint32(74).bytes(e.strings[n]);if(null!=e.tensors&&e.tensors.length)for(n=0;n<e.tensors.length;++n)c.onnx.TensorProto.encode(e.tensors[n],t.uint32(82).fork()).ldelim();if(null!=e.graphs&&e.graphs.length)for(n=0;n<e.graphs.length;++n)c.onnx.GraphProto.encode(e.graphs[n],t.uint32(90).fork()).ldelim();return null!=e.docString&&e.hasOwnProperty("docString")&&t.uint32(106).string(e.docString),null!=e.type&&e.hasOwnProperty("type")&&t.uint32(160).int32(e.type),null!=e.refAttrName&&e.hasOwnProperty("refAttrName")&&t.uint32(170).string(e.refAttrName),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new c.onnx.AttributeProto;e.pos<n;){var o=e.uint32();switch(o>>>3){case 1:r.name=e.string();break;case 21:r.refAttrName=e.string();break;case 13:r.docString=e.string();break;case 20:r.type=e.int32();break;case 2:r.f=e.float();break;case 3:r.i=e.int64();break;case 4:r.s=e.bytes();break;case 5:r.t=c.onnx.TensorProto.decode(e,e.uint32());break;case 6:r.g=c.onnx.GraphProto.decode(e,e.uint32());break;case 7:if(r.floats&&r.floats.length||(r.floats=[]),2==(7&o))for(var a=e.uint32()+e.pos;e.pos<a;)r.floats.push(e.float());else r.floats.push(e.float());break;case 8:if(r.ints&&r.ints.length||(r.ints=[]),2==(7&o))for(a=e.uint32()+e.pos;e.pos<a;)r.ints.push(e.int64());else r.ints.push(e.int64());break;case 9:r.strings&&r.strings.length||(r.strings=[]),r.strings.push(e.bytes());break;case 10:r.tensors&&r.tensors.length||(r.tensors=[]),r.tensors.push(c.onnx.TensorProto.decode(e,e.uint32()));break;case 11:r.graphs&&r.graphs.length||(r.graphs=[]),r.graphs.push(c.onnx.GraphProto.decode(e,e.uint32()));break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!u.isString(e.name))return"name: string expected";if(null!=e.refAttrName&&e.hasOwnProperty("refAttrName")&&!u.isString(e.refAttrName))return"refAttrName: string expected";if(null!=e.docString&&e.hasOwnProperty("docString")&&!u.isString(e.docString))return"docString: string expected";if(null!=e.type&&e.hasOwnProperty("type"))switch(e.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:}if(null!=e.f&&e.hasOwnProperty("f")&&"number"!=typeof e.f)return"f: number expected";if(null!=e.i&&e.hasOwnProperty("i")&&!(u.isInteger(e.i)||e.i&&u.isInteger(e.i.low)&&u.isInteger(e.i.high)))return"i: integer|Long expected";if(null!=e.s&&e.hasOwnProperty("s")&&!(e.s&&"number"==typeof e.s.length||u.isString(e.s)))return"s: buffer expected";if(null!=e.t&&e.hasOwnProperty("t")&&(n=c.onnx.TensorProto.verify(e.t)))return"t."+n;if(null!=e.g&&e.hasOwnProperty("g")&&(n=c.onnx.GraphProto.verify(e.g)))return"g."+n;if(null!=e.floats&&e.hasOwnProperty("floats")){if(!Array.isArray(e.floats))return"floats: array expected";for(var t=0;t<e.floats.length;++t)if("number"!=typeof e.floats[t])return"floats: number[] expected"}if(null!=e.ints&&e.hasOwnProperty("ints")){if(!Array.isArray(e.ints))return"ints: array expected";for(t=0;t<e.ints.length;++t)if(!(u.isInteger(e.ints[t])||e.ints[t]&&u.isInteger(e.ints[t].low)&&u.isInteger(e.ints[t].high)))return"ints: integer|Long[] expected"}if(null!=e.strings&&e.hasOwnProperty("strings")){if(!Array.isArray(e.strings))return"strings: array expected";for(t=0;t<e.strings.length;++t)if(!(e.strings[t]&&"number"==typeof e.strings[t].length||u.isString(e.strings[t])))return"strings: buffer[] expected"}if(null!=e.tensors&&e.hasOwnProperty("tensors")){if(!Array.isArray(e.tensors))return"tensors: array expected";for(t=0;t<e.tensors.length;++t)if(n=c.onnx.TensorProto.verify(e.tensors[t]))return"tensors."+n}if(null!=e.graphs&&e.hasOwnProperty("graphs")){if(!Array.isArray(e.graphs))return"graphs: array expected";for(t=0;t<e.graphs.length;++t){var n;if(n=c.onnx.GraphProto.verify(e.graphs[t]))return"graphs."+n}}return null},e.fromObject=function(e){if(e instanceof c.onnx.AttributeProto)return e;var t=new c.onnx.AttributeProto;switch(null!=e.name&&(t.name=String(e.name)),null!=e.refAttrName&&(t.refAttrName=String(e.refAttrName)),null!=e.docString&&(t.docString=String(e.docString)),e.type){case"UNDEFINED":case 0:t.type=0;break;case"FLOAT":case 1:t.type=1;break;case"INT":case 2:t.type=2;break;case"STRING":case 3:t.type=3;break;case"TENSOR":case 4:t.type=4;break;case"GRAPH":case 5:t.type=5;break;case"FLOATS":case 6:t.type=6;break;case"INTS":case 7:t.type=7;break;case"STRINGS":case 8:t.type=8;break;case"TENSORS":case 9:t.type=9;break;case"GRAPHS":case 10:t.type=10}if(null!=e.f&&(t.f=Number(e.f)),null!=e.i&&(u.Long?(t.i=u.Long.fromValue(e.i)).unsigned=!1:"string"==typeof e.i?t.i=parseInt(e.i,10):"number"==typeof e.i?t.i=e.i:"object"==typeof e.i&&(t.i=new u.LongBits(e.i.low>>>0,e.i.high>>>0).toNumber())),null!=e.s&&("string"==typeof e.s?u.base64.decode(e.s,t.s=u.newBuffer(u.base64.length(e.s)),0):e.s.length&&(t.s=e.s)),null!=e.t){if("object"!=typeof e.t)throw TypeError(".onnx.AttributeProto.t: object expected");t.t=c.onnx.TensorProto.fromObject(e.t)}if(null!=e.g){if("object"!=typeof e.g)throw TypeError(".onnx.AttributeProto.g: object expected");t.g=c.onnx.GraphProto.fromObject(e.g)}if(e.floats){if(!Array.isArray(e.floats))throw TypeError(".onnx.AttributeProto.floats: array expected");t.floats=[];for(var n=0;n<e.floats.length;++n)t.floats[n]=Number(e.floats[n])}if(e.ints){if(!Array.isArray(e.ints))throw TypeError(".onnx.AttributeProto.ints: array expected");for(t.ints=[],n=0;n<e.ints.length;++n)u.Long?(t.ints[n]=u.Long.fromValue(e.ints[n])).unsigned=!1:"string"==typeof e.ints[n]?t.ints[n]=parseInt(e.ints[n],10):"number"==typeof e.ints[n]?t.ints[n]=e.ints[n]:"object"==typeof e.ints[n]&&(t.ints[n]=new u.LongBits(e.ints[n].low>>>0,e.ints[n].high>>>0).toNumber())}if(e.strings){if(!Array.isArray(e.strings))throw TypeError(".onnx.AttributeProto.strings: array expected");for(t.strings=[],n=0;n<e.strings.length;++n)"string"==typeof e.strings[n]?u.base64.decode(e.strings[n],t.strings[n]=u.newBuffer(u.base64.length(e.strings[n])),0):e.strings[n].length&&(t.strings[n]=e.strings[n])}if(e.tensors){if(!Array.isArray(e.tensors))throw TypeError(".onnx.AttributeProto.tensors: array expected");for(t.tensors=[],n=0;n<e.tensors.length;++n){if("object"!=typeof e.tensors[n])throw TypeError(".onnx.AttributeProto.tensors: object expected");t.tensors[n]=c.onnx.TensorProto.fromObject(e.tensors[n])}}if(e.graphs){if(!Array.isArray(e.graphs))throw TypeError(".onnx.AttributeProto.graphs: array expected");for(t.graphs=[],n=0;n<e.graphs.length;++n){if("object"!=typeof e.graphs[n])throw TypeError(".onnx.AttributeProto.graphs: object expected");t.graphs[n]=c.onnx.GraphProto.fromObject(e.graphs[n])}}return t},e.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.floats=[],n.ints=[],n.strings=[],n.tensors=[],n.graphs=[]),t.defaults){if(n.name="",n.f=0,u.Long){var r=new u.Long(0,0,!1);n.i=t.longs===String?r.toString():t.longs===Number?r.toNumber():r}else n.i=t.longs===String?"0":0;t.bytes===String?n.s="":(n.s=[],t.bytes!==Array&&(n.s=u.newBuffer(n.s))),n.t=null,n.g=null,n.docString="",n.type=t.enums===String?"UNDEFINED":0,n.refAttrName=""}if(null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.f&&e.hasOwnProperty("f")&&(n.f=t.json&&!isFinite(e.f)?String(e.f):e.f),null!=e.i&&e.hasOwnProperty("i")&&("number"==typeof e.i?n.i=t.longs===String?String(e.i):e.i:n.i=t.longs===String?u.Long.prototype.toString.call(e.i):t.longs===Number?new u.LongBits(e.i.low>>>0,e.i.high>>>0).toNumber():e.i),null!=e.s&&e.hasOwnProperty("s")&&(n.s=t.bytes===String?u.base64.encode(e.s,0,e.s.length):t.bytes===Array?Array.prototype.slice.call(e.s):e.s),null!=e.t&&e.hasOwnProperty("t")&&(n.t=c.onnx.TensorProto.toObject(e.t,t)),null!=e.g&&e.hasOwnProperty("g")&&(n.g=c.onnx.GraphProto.toObject(e.g,t)),e.floats&&e.floats.length){n.floats=[];for(var o=0;o<e.floats.length;++o)n.floats[o]=t.json&&!isFinite(e.floats[o])?String(e.floats[o]):e.floats[o]}if(e.ints&&e.ints.length)for(n.ints=[],o=0;o<e.ints.length;++o)"number"==typeof e.ints[o]?n.ints[o]=t.longs===String?String(e.ints[o]):e.ints[o]:n.ints[o]=t.longs===String?u.Long.prototype.toString.call(e.ints[o]):t.longs===Number?new u.LongBits(e.ints[o].low>>>0,e.ints[o].high>>>0).toNumber():e.ints[o];if(e.strings&&e.strings.length)for(n.strings=[],o=0;o<e.strings.length;++o)n.strings[o]=t.bytes===String?u.base64.encode(e.strings[o],0,e.strings[o].length):t.bytes===Array?Array.prototype.slice.call(e.strings[o]):e.strings[o];if(e.tensors&&e.tensors.length)for(n.tensors=[],o=0;o<e.tensors.length;++o)n.tensors[o]=c.onnx.TensorProto.toObject(e.tensors[o],t);if(e.graphs&&e.graphs.length)for(n.graphs=[],o=0;o<e.graphs.length;++o)n.graphs[o]=c.onnx.GraphProto.toObject(e.graphs[o],t);return null!=e.docString&&e.hasOwnProperty("docString")&&(n.docString=e.docString),null!=e.type&&e.hasOwnProperty("type")&&(n.type=t.enums===String?c.onnx.AttributeProto.AttributeType[e.type]:e.type),null!=e.refAttrName&&e.hasOwnProperty("refAttrName")&&(n.refAttrName=e.refAttrName),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.util.toJSONOptions)},e.AttributeType=(t={},(n=Object.create(t))[t[0]="UNDEFINED"]=0,n[t[1]="FLOAT"]=1,n[t[2]="INT"]=2,n[t[3]="STRING"]=3,n[t[4]="TENSOR"]=4,n[t[5]="GRAPH"]=5,n[t[6]="FLOATS"]=6,n[t[7]="INTS"]=7,n[t[8]="STRINGS"]=8,n[t[9]="TENSORS"]=9,n[t[10]="GRAPHS"]=10,n),e;var t,n}(),a.ValueInfoProto=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.name="",e.prototype.type=null,e.prototype.docString="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=l.create()),null!=e.name&&e.hasOwnProperty("name")&&t.uint32(10).string(e.name),null!=e.type&&e.hasOwnProperty("type")&&c.onnx.TypeProto.encode(e.type,t.uint32(18).fork()).ldelim(),null!=e.docString&&e.hasOwnProperty("docString")&&t.uint32(26).string(e.docString),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new c.onnx.ValueInfoProto;e.pos<n;){var o=e.uint32();switch(o>>>3){case 1:r.name=e.string();break;case 2:r.type=c.onnx.TypeProto.decode(e,e.uint32());break;case 3:r.docString=e.string();break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!u.isString(e.name))return"name: string expected";if(null!=e.type&&e.hasOwnProperty("type")){var t=c.onnx.TypeProto.verify(e.type);if(t)return"type."+t}return null!=e.docString&&e.hasOwnProperty("docString")&&!u.isString(e.docString)?"docString: string expected":null},e.fromObject=function(e){if(e instanceof c.onnx.ValueInfoProto)return e;var t=new c.onnx.ValueInfoProto;if(null!=e.name&&(t.name=String(e.name)),null!=e.type){if("object"!=typeof e.type)throw TypeError(".onnx.ValueInfoProto.type: object expected");t.type=c.onnx.TypeProto.fromObject(e.type)}return null!=e.docString&&(t.docString=String(e.docString)),t},e.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.name="",n.type=null,n.docString=""),null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.type&&e.hasOwnProperty("type")&&(n.type=c.onnx.TypeProto.toObject(e.type,t)),null!=e.docString&&e.hasOwnProperty("docString")&&(n.docString=e.docString),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.util.toJSONOptions)},e}(),a.NodeProto=function(){function e(e){if(this.input=[],this.output=[],this.attribute=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.input=u.emptyArray,e.prototype.output=u.emptyArray,e.prototype.name="",e.prototype.opType="",e.prototype.domain="",e.prototype.attribute=u.emptyArray,e.prototype.docString="",e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=l.create()),null!=e.input&&e.input.length)for(var n=0;n<e.input.length;++n)t.uint32(10).string(e.input[n]);if(null!=e.output&&e.output.length)for(n=0;n<e.output.length;++n)t.uint32(18).string(e.output[n]);if(null!=e.name&&e.hasOwnProperty("name")&&t.uint32(26).string(e.name),null!=e.opType&&e.hasOwnProperty("opType")&&t.uint32(34).string(e.opType),null!=e.attribute&&e.attribute.length)for(n=0;n<e.attribute.length;++n)c.onnx.AttributeProto.encode(e.attribute[n],t.uint32(42).fork()).ldelim();return null!=e.docString&&e.hasOwnProperty("docString")&&t.uint32(50).string(e.docString),null!=e.domain&&e.hasOwnProperty("domain")&&t.uint32(58).string(e.domain),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new c.onnx.NodeProto;e.pos<n;){var o=e.uint32();switch(o>>>3){case 1:r.input&&r.input.length||(r.input=[]),r.input.push(e.string());break;case 2:r.output&&r.output.length||(r.output=[]),r.output.push(e.string());break;case 3:r.name=e.string();break;case 4:r.opType=e.string();break;case 7:r.domain=e.string();break;case 5:r.attribute&&r.attribute.length||(r.attribute=[]),r.attribute.push(c.onnx.AttributeProto.decode(e,e.uint32()));break;case 6:r.docString=e.string();break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.input&&e.hasOwnProperty("input")){if(!Array.isArray(e.input))return"input: array expected";for(var t=0;t<e.input.length;++t)if(!u.isString(e.input[t]))return"input: string[] expected"}if(null!=e.output&&e.hasOwnProperty("output")){if(!Array.isArray(e.output))return"output: array expected";for(t=0;t<e.output.length;++t)if(!u.isString(e.output[t]))return"output: string[] expected"}if(null!=e.name&&e.hasOwnProperty("name")&&!u.isString(e.name))return"name: string expected";if(null!=e.opType&&e.hasOwnProperty("opType")&&!u.isString(e.opType))return"opType: string expected";if(null!=e.domain&&e.hasOwnProperty("domain")&&!u.isString(e.domain))return"domain: string expected";if(null!=e.attribute&&e.hasOwnProperty("attribute")){if(!Array.isArray(e.attribute))return"attribute: array expected";for(t=0;t<e.attribute.length;++t){var n=c.onnx.AttributeProto.verify(e.attribute[t]);if(n)return"attribute."+n}}return null!=e.docString&&e.hasOwnProperty("docString")&&!u.isString(e.docString)?"docString: string expected":null},e.fromObject=function(e){if(e instanceof c.onnx.NodeProto)return e;var t=new c.onnx.NodeProto;if(e.input){if(!Array.isArray(e.input))throw TypeError(".onnx.NodeProto.input: array expected");t.input=[];for(var n=0;n<e.input.length;++n)t.input[n]=String(e.input[n])}if(e.output){if(!Array.isArray(e.output))throw TypeError(".onnx.NodeProto.output: array expected");for(t.output=[],n=0;n<e.output.length;++n)t.output[n]=String(e.output[n])}if(null!=e.name&&(t.name=String(e.name)),null!=e.opType&&(t.opType=String(e.opType)),null!=e.domain&&(t.domain=String(e.domain)),e.attribute){if(!Array.isArray(e.attribute))throw TypeError(".onnx.NodeProto.attribute: array expected");for(t.attribute=[],n=0;n<e.attribute.length;++n){if("object"!=typeof e.attribute[n])throw TypeError(".onnx.NodeProto.attribute: object expected");t.attribute[n]=c.onnx.AttributeProto.fromObject(e.attribute[n])}}return null!=e.docString&&(t.docString=String(e.docString)),t},e.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.input=[],n.output=[],n.attribute=[]),t.defaults&&(n.name="",n.opType="",n.docString="",n.domain=""),e.input&&e.input.length){n.input=[];for(var r=0;r<e.input.length;++r)n.input[r]=e.input[r]}if(e.output&&e.output.length)for(n.output=[],r=0;r<e.output.length;++r)n.output[r]=e.output[r];if(null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.opType&&e.hasOwnProperty("opType")&&(n.opType=e.opType),e.attribute&&e.attribute.length)for(n.attribute=[],r=0;r<e.attribute.length;++r)n.attribute[r]=c.onnx.AttributeProto.toObject(e.attribute[r],t);return null!=e.docString&&e.hasOwnProperty("docString")&&(n.docString=e.docString),null!=e.domain&&e.hasOwnProperty("domain")&&(n.domain=e.domain),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.util.toJSONOptions)},e}(),a.ModelProto=function(){function e(e){if(this.opsetImport=[],this.metadataProps=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.irVersion=u.Long?u.Long.fromBits(0,0,!1):0,e.prototype.opsetImport=u.emptyArray,e.prototype.producerName="",e.prototype.producerVersion="",e.prototype.domain="",e.prototype.modelVersion=u.Long?u.Long.fromBits(0,0,!1):0,e.prototype.docString="",e.prototype.graph=null,e.prototype.metadataProps=u.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=l.create()),null!=e.irVersion&&e.hasOwnProperty("irVersion")&&t.uint32(8).int64(e.irVersion),null!=e.producerName&&e.hasOwnProperty("producerName")&&t.uint32(18).string(e.producerName),null!=e.producerVersion&&e.hasOwnProperty("producerVersion")&&t.uint32(26).string(e.producerVersion),null!=e.domain&&e.hasOwnProperty("domain")&&t.uint32(34).string(e.domain),null!=e.modelVersion&&e.hasOwnProperty("modelVersion")&&t.uint32(40).int64(e.modelVersion),null!=e.docString&&e.hasOwnProperty("docString")&&t.uint32(50).string(e.docString),null!=e.graph&&e.hasOwnProperty("graph")&&c.onnx.GraphProto.encode(e.graph,t.uint32(58).fork()).ldelim(),null!=e.opsetImport&&e.opsetImport.length)for(var n=0;n<e.opsetImport.length;++n)c.onnx.OperatorSetIdProto.encode(e.opsetImport[n],t.uint32(66).fork()).ldelim();if(null!=e.metadataProps&&e.metadataProps.length)for(n=0;n<e.metadataProps.length;++n)c.onnx.StringStringEntryProto.encode(e.metadataProps[n],t.uint32(114).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new c.onnx.ModelProto;e.pos<n;){var o=e.uint32();switch(o>>>3){case 1:r.irVersion=e.int64();break;case 8:r.opsetImport&&r.opsetImport.length||(r.opsetImport=[]),r.opsetImport.push(c.onnx.OperatorSetIdProto.decode(e,e.uint32()));break;case 2:r.producerName=e.string();break;case 3:r.producerVersion=e.string();break;case 4:r.domain=e.string();break;case 5:r.modelVersion=e.int64();break;case 6:r.docString=e.string();break;case 7:r.graph=c.onnx.GraphProto.decode(e,e.uint32());break;case 14:r.metadataProps&&r.metadataProps.length||(r.metadataProps=[]),r.metadataProps.push(c.onnx.StringStringEntryProto.decode(e,e.uint32()));break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.irVersion&&e.hasOwnProperty("irVersion")&&!(u.isInteger(e.irVersion)||e.irVersion&&u.isInteger(e.irVersion.low)&&u.isInteger(e.irVersion.high)))return"irVersion: integer|Long expected";if(null!=e.opsetImport&&e.hasOwnProperty("opsetImport")){if(!Array.isArray(e.opsetImport))return"opsetImport: array expected";for(var t=0;t<e.opsetImport.length;++t)if(n=c.onnx.OperatorSetIdProto.verify(e.opsetImport[t]))return"opsetImport."+n}if(null!=e.producerName&&e.hasOwnProperty("producerName")&&!u.isString(e.producerName))return"producerName: string expected";if(null!=e.producerVersion&&e.hasOwnProperty("producerVersion")&&!u.isString(e.producerVersion))return"producerVersion: string expected";if(null!=e.domain&&e.hasOwnProperty("domain")&&!u.isString(e.domain))return"domain: string expected";if(null!=e.modelVersion&&e.hasOwnProperty("modelVersion")&&!(u.isInteger(e.modelVersion)||e.modelVersion&&u.isInteger(e.modelVersion.low)&&u.isInteger(e.modelVersion.high)))return"modelVersion: integer|Long expected";if(null!=e.docString&&e.hasOwnProperty("docString")&&!u.isString(e.docString))return"docString: string expected";if(null!=e.graph&&e.hasOwnProperty("graph")&&(n=c.onnx.GraphProto.verify(e.graph)))return"graph."+n;if(null!=e.metadataProps&&e.hasOwnProperty("metadataProps")){if(!Array.isArray(e.metadataProps))return"metadataProps: array expected";for(t=0;t<e.metadataProps.length;++t){var n;if(n=c.onnx.StringStringEntryProto.verify(e.metadataProps[t]))return"metadataProps."+n}}return null},e.fromObject=function(e){if(e instanceof c.onnx.ModelProto)return e;var t=new c.onnx.ModelProto;if(null!=e.irVersion&&(u.Long?(t.irVersion=u.Long.fromValue(e.irVersion)).unsigned=!1:"string"==typeof e.irVersion?t.irVersion=parseInt(e.irVersion,10):"number"==typeof e.irVersion?t.irVersion=e.irVersion:"object"==typeof e.irVersion&&(t.irVersion=new u.LongBits(e.irVersion.low>>>0,e.irVersion.high>>>0).toNumber())),e.opsetImport){if(!Array.isArray(e.opsetImport))throw TypeError(".onnx.ModelProto.opsetImport: array expected");t.opsetImport=[];for(var n=0;n<e.opsetImport.length;++n){if("object"!=typeof e.opsetImport[n])throw TypeError(".onnx.ModelProto.opsetImport: object expected");t.opsetImport[n]=c.onnx.OperatorSetIdProto.fromObject(e.opsetImport[n])}}if(null!=e.producerName&&(t.producerName=String(e.producerName)),null!=e.producerVersion&&(t.producerVersion=String(e.producerVersion)),null!=e.domain&&(t.domain=String(e.domain)),null!=e.modelVersion&&(u.Long?(t.modelVersion=u.Long.fromValue(e.modelVersion)).unsigned=!1:"string"==typeof e.modelVersion?t.modelVersion=parseInt(e.modelVersion,10):"number"==typeof e.modelVersion?t.modelVersion=e.modelVersion:"object"==typeof e.modelVersion&&(t.modelVersion=new u.LongBits(e.modelVersion.low>>>0,e.modelVersion.high>>>0).toNumber())),null!=e.docString&&(t.docString=String(e.docString)),null!=e.graph){if("object"!=typeof e.graph)throw TypeError(".onnx.ModelProto.graph: object expected");t.graph=c.onnx.GraphProto.fromObject(e.graph)}if(e.metadataProps){if(!Array.isArray(e.metadataProps))throw TypeError(".onnx.ModelProto.metadataProps: array expected");for(t.metadataProps=[],n=0;n<e.metadataProps.length;++n){if("object"!=typeof e.metadataProps[n])throw TypeError(".onnx.ModelProto.metadataProps: object expected");t.metadataProps[n]=c.onnx.StringStringEntryProto.fromObject(e.metadataProps[n])}}return t},e.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.opsetImport=[],n.metadataProps=[]),t.defaults){if(u.Long){var r=new u.Long(0,0,!1);n.irVersion=t.longs===String?r.toString():t.longs===Number?r.toNumber():r}else n.irVersion=t.longs===String?"0":0;n.producerName="",n.producerVersion="",n.domain="",u.Long?(r=new u.Long(0,0,!1),n.modelVersion=t.longs===String?r.toString():t.longs===Number?r.toNumber():r):n.modelVersion=t.longs===String?"0":0,n.docString="",n.graph=null}if(null!=e.irVersion&&e.hasOwnProperty("irVersion")&&("number"==typeof e.irVersion?n.irVersion=t.longs===String?String(e.irVersion):e.irVersion:n.irVersion=t.longs===String?u.Long.prototype.toString.call(e.irVersion):t.longs===Number?new u.LongBits(e.irVersion.low>>>0,e.irVersion.high>>>0).toNumber():e.irVersion),null!=e.producerName&&e.hasOwnProperty("producerName")&&(n.producerName=e.producerName),null!=e.producerVersion&&e.hasOwnProperty("producerVersion")&&(n.producerVersion=e.producerVersion),null!=e.domain&&e.hasOwnProperty("domain")&&(n.domain=e.domain),null!=e.modelVersion&&e.hasOwnProperty("modelVersion")&&("number"==typeof e.modelVersion?n.modelVersion=t.longs===String?String(e.modelVersion):e.modelVersion:n.modelVersion=t.longs===String?u.Long.prototype.toString.call(e.modelVersion):t.longs===Number?new u.LongBits(e.modelVersion.low>>>0,e.modelVersion.high>>>0).toNumber():e.modelVersion),null!=e.docString&&e.hasOwnProperty("docString")&&(n.docString=e.docString),null!=e.graph&&e.hasOwnProperty("graph")&&(n.graph=c.onnx.GraphProto.toObject(e.graph,t)),e.opsetImport&&e.opsetImport.length){n.opsetImport=[];for(var o=0;o<e.opsetImport.length;++o)n.opsetImport[o]=c.onnx.OperatorSetIdProto.toObject(e.opsetImport[o],t)}if(e.metadataProps&&e.metadataProps.length)for(n.metadataProps=[],o=0;o<e.metadataProps.length;++o)n.metadataProps[o]=c.onnx.StringStringEntryProto.toObject(e.metadataProps[o],t);return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.util.toJSONOptions)},e}(),a.StringStringEntryProto=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.key="",e.prototype.value="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=l.create()),null!=e.key&&e.hasOwnProperty("key")&&t.uint32(10).string(e.key),null!=e.value&&e.hasOwnProperty("value")&&t.uint32(18).string(e.value),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new c.onnx.StringStringEntryProto;e.pos<n;){var o=e.uint32();switch(o>>>3){case 1:r.key=e.string();break;case 2:r.value=e.string();break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.key&&e.hasOwnProperty("key")&&!u.isString(e.key)?"key: string expected":null!=e.value&&e.hasOwnProperty("value")&&!u.isString(e.value)?"value: string expected":null},e.fromObject=function(e){if(e instanceof c.onnx.StringStringEntryProto)return e;var t=new c.onnx.StringStringEntryProto;return null!=e.key&&(t.key=String(e.key)),null!=e.value&&(t.value=String(e.value)),t},e.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.key="",n.value=""),null!=e.key&&e.hasOwnProperty("key")&&(n.key=e.key),null!=e.value&&e.hasOwnProperty("value")&&(n.value=e.value),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.util.toJSONOptions)},e}(),a.TensorAnnotation=function(){function e(e){if(this.quantParameterTensorNames=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.tensorName="",e.prototype.quantParameterTensorNames=u.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=l.create()),null!=e.tensorName&&e.hasOwnProperty("tensorName")&&t.uint32(10).string(e.tensorName),null!=e.quantParameterTensorNames&&e.quantParameterTensorNames.length)for(var n=0;n<e.quantParameterTensorNames.length;++n)c.onnx.StringStringEntryProto.encode(e.quantParameterTensorNames[n],t.uint32(18).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new c.onnx.TensorAnnotation;e.pos<n;){var o=e.uint32();switch(o>>>3){case 1:r.tensorName=e.string();break;case 2:r.quantParameterTensorNames&&r.quantParameterTensorNames.length||(r.quantParameterTensorNames=[]),r.quantParameterTensorNames.push(c.onnx.StringStringEntryProto.decode(e,e.uint32()));break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.tensorName&&e.hasOwnProperty("tensorName")&&!u.isString(e.tensorName))return"tensorName: string expected";if(null!=e.quantParameterTensorNames&&e.hasOwnProperty("quantParameterTensorNames")){if(!Array.isArray(e.quantParameterTensorNames))return"quantParameterTensorNames: array expected";for(var t=0;t<e.quantParameterTensorNames.length;++t){var n=c.onnx.StringStringEntryProto.verify(e.quantParameterTensorNames[t]);if(n)return"quantParameterTensorNames."+n}}return null},e.fromObject=function(e){if(e instanceof c.onnx.TensorAnnotation)return e;var t=new c.onnx.TensorAnnotation;if(null!=e.tensorName&&(t.tensorName=String(e.tensorName)),e.quantParameterTensorNames){if(!Array.isArray(e.quantParameterTensorNames))throw TypeError(".onnx.TensorAnnotation.quantParameterTensorNames: array expected");t.quantParameterTensorNames=[];for(var n=0;n<e.quantParameterTensorNames.length;++n){if("object"!=typeof e.quantParameterTensorNames[n])throw TypeError(".onnx.TensorAnnotation.quantParameterTensorNames: object expected");t.quantParameterTensorNames[n]=c.onnx.StringStringEntryProto.fromObject(e.quantParameterTensorNames[n])}}return t},e.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.quantParameterTensorNames=[]),t.defaults&&(n.tensorName=""),null!=e.tensorName&&e.hasOwnProperty("tensorName")&&(n.tensorName=e.tensorName),e.quantParameterTensorNames&&e.quantParameterTensorNames.length){n.quantParameterTensorNames=[];for(var r=0;r<e.quantParameterTensorNames.length;++r)n.quantParameterTensorNames[r]=c.onnx.StringStringEntryProto.toObject(e.quantParameterTensorNames[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.util.toJSONOptions)},e}(),a.GraphProto=function(){function e(e){if(this.node=[],this.initializer=[],this.input=[],this.output=[],this.valueInfo=[],this.quantizationAnnotation=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.node=u.emptyArray,e.prototype.name="",e.prototype.initializer=u.emptyArray,e.prototype.docString="",e.prototype.input=u.emptyArray,e.prototype.output=u.emptyArray,e.prototype.valueInfo=u.emptyArray,e.prototype.quantizationAnnotation=u.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=l.create()),null!=e.node&&e.node.length)for(var n=0;n<e.node.length;++n)c.onnx.NodeProto.encode(e.node[n],t.uint32(10).fork()).ldelim();if(null!=e.name&&e.hasOwnProperty("name")&&t.uint32(18).string(e.name),null!=e.initializer&&e.initializer.length)for(n=0;n<e.initializer.length;++n)c.onnx.TensorProto.encode(e.initializer[n],t.uint32(42).fork()).ldelim();if(null!=e.docString&&e.hasOwnProperty("docString")&&t.uint32(82).string(e.docString),null!=e.input&&e.input.length)for(n=0;n<e.input.length;++n)c.onnx.ValueInfoProto.encode(e.input[n],t.uint32(90).fork()).ldelim();if(null!=e.output&&e.output.length)for(n=0;n<e.output.length;++n)c.onnx.ValueInfoProto.encode(e.output[n],t.uint32(98).fork()).ldelim();if(null!=e.valueInfo&&e.valueInfo.length)for(n=0;n<e.valueInfo.length;++n)c.onnx.ValueInfoProto.encode(e.valueInfo[n],t.uint32(106).fork()).ldelim();if(null!=e.quantizationAnnotation&&e.quantizationAnnotation.length)for(n=0;n<e.quantizationAnnotation.length;++n)c.onnx.TensorAnnotation.encode(e.quantizationAnnotation[n],t.uint32(114).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new c.onnx.GraphProto;e.pos<n;){var o=e.uint32();switch(o>>>3){case 1:r.node&&r.node.length||(r.node=[]),r.node.push(c.onnx.NodeProto.decode(e,e.uint32()));break;case 2:r.name=e.string();break;case 5:r.initializer&&r.initializer.length||(r.initializer=[]),r.initializer.push(c.onnx.TensorProto.decode(e,e.uint32()));break;case 10:r.docString=e.string();break;case 11:r.input&&r.input.length||(r.input=[]),r.input.push(c.onnx.ValueInfoProto.decode(e,e.uint32()));break;case 12:r.output&&r.output.length||(r.output=[]),r.output.push(c.onnx.ValueInfoProto.decode(e,e.uint32()));break;case 13:r.valueInfo&&r.valueInfo.length||(r.valueInfo=[]),r.valueInfo.push(c.onnx.ValueInfoProto.decode(e,e.uint32()));break;case 14:r.quantizationAnnotation&&r.quantizationAnnotation.length||(r.quantizationAnnotation=[]),r.quantizationAnnotation.push(c.onnx.TensorAnnotation.decode(e,e.uint32()));break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.node&&e.hasOwnProperty("node")){if(!Array.isArray(e.node))return"node: array expected";for(var t=0;t<e.node.length;++t)if(n=c.onnx.NodeProto.verify(e.node[t]))return"node."+n}if(null!=e.name&&e.hasOwnProperty("name")&&!u.isString(e.name))return"name: string expected";if(null!=e.initializer&&e.hasOwnProperty("initializer")){if(!Array.isArray(e.initializer))return"initializer: array expected";for(t=0;t<e.initializer.length;++t)if(n=c.onnx.TensorProto.verify(e.initializer[t]))return"initializer."+n}if(null!=e.docString&&e.hasOwnProperty("docString")&&!u.isString(e.docString))return"docString: string expected";if(null!=e.input&&e.hasOwnProperty("input")){if(!Array.isArray(e.input))return"input: array expected";for(t=0;t<e.input.length;++t)if(n=c.onnx.ValueInfoProto.verify(e.input[t]))return"input."+n}if(null!=e.output&&e.hasOwnProperty("output")){if(!Array.isArray(e.output))return"output: array expected";for(t=0;t<e.output.length;++t)if(n=c.onnx.ValueInfoProto.verify(e.output[t]))return"output."+n}if(null!=e.valueInfo&&e.hasOwnProperty("valueInfo")){if(!Array.isArray(e.valueInfo))return"valueInfo: array expected";for(t=0;t<e.valueInfo.length;++t)if(n=c.onnx.ValueInfoProto.verify(e.valueInfo[t]))return"valueInfo."+n}if(null!=e.quantizationAnnotation&&e.hasOwnProperty("quantizationAnnotation")){if(!Array.isArray(e.quantizationAnnotation))return"quantizationAnnotation: array expected";for(t=0;t<e.quantizationAnnotation.length;++t){var n;if(n=c.onnx.TensorAnnotation.verify(e.quantizationAnnotation[t]))return"quantizationAnnotation."+n}}return null},e.fromObject=function(e){if(e instanceof c.onnx.GraphProto)return e;var t=new c.onnx.GraphProto;if(e.node){if(!Array.isArray(e.node))throw TypeError(".onnx.GraphProto.node: array expected");t.node=[];for(var n=0;n<e.node.length;++n){if("object"!=typeof e.node[n])throw TypeError(".onnx.GraphProto.node: object expected");t.node[n]=c.onnx.NodeProto.fromObject(e.node[n])}}if(null!=e.name&&(t.name=String(e.name)),e.initializer){if(!Array.isArray(e.initializer))throw TypeError(".onnx.GraphProto.initializer: array expected");for(t.initializer=[],n=0;n<e.initializer.length;++n){if("object"!=typeof e.initializer[n])throw TypeError(".onnx.GraphProto.initializer: object expected");t.initializer[n]=c.onnx.TensorProto.fromObject(e.initializer[n])}}if(null!=e.docString&&(t.docString=String(e.docString)),e.input){if(!Array.isArray(e.input))throw TypeError(".onnx.GraphProto.input: array expected");for(t.input=[],n=0;n<e.input.length;++n){if("object"!=typeof e.input[n])throw TypeError(".onnx.GraphProto.input: object expected");t.input[n]=c.onnx.ValueInfoProto.fromObject(e.input[n])}}if(e.output){if(!Array.isArray(e.output))throw TypeError(".onnx.GraphProto.output: array expected");for(t.output=[],n=0;n<e.output.length;++n){if("object"!=typeof e.output[n])throw TypeError(".onnx.GraphProto.output: object expected");t.output[n]=c.onnx.ValueInfoProto.fromObject(e.output[n])}}if(e.valueInfo){if(!Array.isArray(e.valueInfo))throw TypeError(".onnx.GraphProto.valueInfo: array expected");for(t.valueInfo=[],n=0;n<e.valueInfo.length;++n){if("object"!=typeof e.valueInfo[n])throw TypeError(".onnx.GraphProto.valueInfo: object expected");t.valueInfo[n]=c.onnx.ValueInfoProto.fromObject(e.valueInfo[n])}}if(e.quantizationAnnotation){if(!Array.isArray(e.quantizationAnnotation))throw TypeError(".onnx.GraphProto.quantizationAnnotation: array expected");for(t.quantizationAnnotation=[],n=0;n<e.quantizationAnnotation.length;++n){if("object"!=typeof e.quantizationAnnotation[n])throw TypeError(".onnx.GraphProto.quantizationAnnotation: object expected");t.quantizationAnnotation[n]=c.onnx.TensorAnnotation.fromObject(e.quantizationAnnotation[n])}}return t},e.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.node=[],n.initializer=[],n.input=[],n.output=[],n.valueInfo=[],n.quantizationAnnotation=[]),t.defaults&&(n.name="",n.docString=""),e.node&&e.node.length){n.node=[];for(var r=0;r<e.node.length;++r)n.node[r]=c.onnx.NodeProto.toObject(e.node[r],t)}if(null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),e.initializer&&e.initializer.length)for(n.initializer=[],r=0;r<e.initializer.length;++r)n.initializer[r]=c.onnx.TensorProto.toObject(e.initializer[r],t);if(null!=e.docString&&e.hasOwnProperty("docString")&&(n.docString=e.docString),e.input&&e.input.length)for(n.input=[],r=0;r<e.input.length;++r)n.input[r]=c.onnx.ValueInfoProto.toObject(e.input[r],t);if(e.output&&e.output.length)for(n.output=[],r=0;r<e.output.length;++r)n.output[r]=c.onnx.ValueInfoProto.toObject(e.output[r],t);if(e.valueInfo&&e.valueInfo.length)for(n.valueInfo=[],r=0;r<e.valueInfo.length;++r)n.valueInfo[r]=c.onnx.ValueInfoProto.toObject(e.valueInfo[r],t);if(e.quantizationAnnotation&&e.quantizationAnnotation.length)for(n.quantizationAnnotation=[],r=0;r<e.quantizationAnnotation.length;++r)n.quantizationAnnotation[r]=c.onnx.TensorAnnotation.toObject(e.quantizationAnnotation[r],t);return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.util.toJSONOptions)},e}(),a.TensorProto=function(){function e(e){if(this.dims=[],this.floatData=[],this.int32Data=[],this.stringData=[],this.int64Data=[],this.externalData=[],this.doubleData=[],this.uint64Data=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.dims=u.emptyArray,e.prototype.dataType=0,e.prototype.segment=null,e.prototype.floatData=u.emptyArray,e.prototype.int32Data=u.emptyArray,e.prototype.stringData=u.emptyArray,e.prototype.int64Data=u.emptyArray,e.prototype.name="",e.prototype.docString="",e.prototype.rawData=u.newBuffer([]),e.prototype.externalData=u.emptyArray,e.prototype.dataLocation=0,e.prototype.doubleData=u.emptyArray,e.prototype.uint64Data=u.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=l.create()),null!=e.dims&&e.dims.length){t.uint32(10).fork();for(var n=0;n<e.dims.length;++n)t.int64(e.dims[n]);t.ldelim()}if(null!=e.dataType&&e.hasOwnProperty("dataType")&&t.uint32(16).int32(e.dataType),null!=e.segment&&e.hasOwnProperty("segment")&&c.onnx.TensorProto.Segment.encode(e.segment,t.uint32(26).fork()).ldelim(),null!=e.floatData&&e.floatData.length){for(t.uint32(34).fork(),n=0;n<e.floatData.length;++n)t.float(e.floatData[n]);t.ldelim()}if(null!=e.int32Data&&e.int32Data.length){for(t.uint32(42).fork(),n=0;n<e.int32Data.length;++n)t.int32(e.int32Data[n]);t.ldelim()}if(null!=e.stringData&&e.stringData.length)for(n=0;n<e.stringData.length;++n)t.uint32(50).bytes(e.stringData[n]);if(null!=e.int64Data&&e.int64Data.length){for(t.uint32(58).fork(),n=0;n<e.int64Data.length;++n)t.int64(e.int64Data[n]);t.ldelim()}if(null!=e.name&&e.hasOwnProperty("name")&&t.uint32(66).string(e.name),null!=e.rawData&&e.hasOwnProperty("rawData")&&t.uint32(74).bytes(e.rawData),null!=e.doubleData&&e.doubleData.length){for(t.uint32(82).fork(),n=0;n<e.doubleData.length;++n)t.double(e.doubleData[n]);t.ldelim()}if(null!=e.uint64Data&&e.uint64Data.length){for(t.uint32(90).fork(),n=0;n<e.uint64Data.length;++n)t.uint64(e.uint64Data[n]);t.ldelim()}if(null!=e.docString&&e.hasOwnProperty("docString")&&t.uint32(98).string(e.docString),null!=e.externalData&&e.externalData.length)for(n=0;n<e.externalData.length;++n)c.onnx.StringStringEntryProto.encode(e.externalData[n],t.uint32(106).fork()).ldelim();return null!=e.dataLocation&&e.hasOwnProperty("dataLocation")&&t.uint32(112).int32(e.dataLocation),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new c.onnx.TensorProto;e.pos<n;){var o=e.uint32();switch(o>>>3){case 1:if(r.dims&&r.dims.length||(r.dims=[]),2==(7&o))for(var a=e.uint32()+e.pos;e.pos<a;)r.dims.push(e.int64());else r.dims.push(e.int64());break;case 2:r.dataType=e.int32();break;case 3:r.segment=c.onnx.TensorProto.Segment.decode(e,e.uint32());break;case 4:if(r.floatData&&r.floatData.length||(r.floatData=[]),2==(7&o))for(a=e.uint32()+e.pos;e.pos<a;)r.floatData.push(e.float());else r.floatData.push(e.float());break;case 5:if(r.int32Data&&r.int32Data.length||(r.int32Data=[]),2==(7&o))for(a=e.uint32()+e.pos;e.pos<a;)r.int32Data.push(e.int32());else r.int32Data.push(e.int32());break;case 6:r.stringData&&r.stringData.length||(r.stringData=[]),r.stringData.push(e.bytes());break;case 7:if(r.int64Data&&r.int64Data.length||(r.int64Data=[]),2==(7&o))for(a=e.uint32()+e.pos;e.pos<a;)r.int64Data.push(e.int64());else r.int64Data.push(e.int64());break;case 8:r.name=e.string();break;case 12:r.docString=e.string();break;case 9:r.rawData=e.bytes();break;case 13:r.externalData&&r.externalData.length||(r.externalData=[]),r.externalData.push(c.onnx.StringStringEntryProto.decode(e,e.uint32()));break;case 14:r.dataLocation=e.int32();break;case 10:if(r.doubleData&&r.doubleData.length||(r.doubleData=[]),2==(7&o))for(a=e.uint32()+e.pos;e.pos<a;)r.doubleData.push(e.double());else r.doubleData.push(e.double());break;case 11:if(r.uint64Data&&r.uint64Data.length||(r.uint64Data=[]),2==(7&o))for(a=e.uint32()+e.pos;e.pos<a;)r.uint64Data.push(e.uint64());else r.uint64Data.push(e.uint64());break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.dims&&e.hasOwnProperty("dims")){if(!Array.isArray(e.dims))return"dims: array expected";for(var t=0;t<e.dims.length;++t)if(!(u.isInteger(e.dims[t])||e.dims[t]&&u.isInteger(e.dims[t].low)&&u.isInteger(e.dims[t].high)))return"dims: integer|Long[] expected"}if(null!=e.dataType&&e.hasOwnProperty("dataType")&&!u.isInteger(e.dataType))return"dataType: integer expected";if(null!=e.segment&&e.hasOwnProperty("segment")&&(n=c.onnx.TensorProto.Segment.verify(e.segment)))return"segment."+n;if(null!=e.floatData&&e.hasOwnProperty("floatData")){if(!Array.isArray(e.floatData))return"floatData: array expected";for(t=0;t<e.floatData.length;++t)if("number"!=typeof e.floatData[t])return"floatData: number[] expected"}if(null!=e.int32Data&&e.hasOwnProperty("int32Data")){if(!Array.isArray(e.int32Data))return"int32Data: array expected";for(t=0;t<e.int32Data.length;++t)if(!u.isInteger(e.int32Data[t]))return"int32Data: integer[] expected"}if(null!=e.stringData&&e.hasOwnProperty("stringData")){if(!Array.isArray(e.stringData))return"stringData: array expected";for(t=0;t<e.stringData.length;++t)if(!(e.stringData[t]&&"number"==typeof e.stringData[t].length||u.isString(e.stringData[t])))return"stringData: buffer[] expected"}if(null!=e.int64Data&&e.hasOwnProperty("int64Data")){if(!Array.isArray(e.int64Data))return"int64Data: array expected";for(t=0;t<e.int64Data.length;++t)if(!(u.isInteger(e.int64Data[t])||e.int64Data[t]&&u.isInteger(e.int64Data[t].low)&&u.isInteger(e.int64Data[t].high)))return"int64Data: integer|Long[] expected"}if(null!=e.name&&e.hasOwnProperty("name")&&!u.isString(e.name))return"name: string expected";if(null!=e.docString&&e.hasOwnProperty("docString")&&!u.isString(e.docString))return"docString: string expected";if(null!=e.rawData&&e.hasOwnProperty("rawData")&&!(e.rawData&&"number"==typeof e.rawData.length||u.isString(e.rawData)))return"rawData: buffer expected";if(null!=e.externalData&&e.hasOwnProperty("externalData")){if(!Array.isArray(e.externalData))return"externalData: array expected";for(t=0;t<e.externalData.length;++t){var n;if(n=c.onnx.StringStringEntryProto.verify(e.externalData[t]))return"externalData."+n}}if(null!=e.dataLocation&&e.hasOwnProperty("dataLocation"))switch(e.dataLocation){default:return"dataLocation: enum value expected";case 0:case 1:}if(null!=e.doubleData&&e.hasOwnProperty("doubleData")){if(!Array.isArray(e.doubleData))return"doubleData: array expected";for(t=0;t<e.doubleData.length;++t)if("number"!=typeof e.doubleData[t])return"doubleData: number[] expected"}if(null!=e.uint64Data&&e.hasOwnProperty("uint64Data")){if(!Array.isArray(e.uint64Data))return"uint64Data: array expected";for(t=0;t<e.uint64Data.length;++t)if(!(u.isInteger(e.uint64Data[t])||e.uint64Data[t]&&u.isInteger(e.uint64Data[t].low)&&u.isInteger(e.uint64Data[t].high)))return"uint64Data: integer|Long[] expected"}return null},e.fromObject=function(e){if(e instanceof c.onnx.TensorProto)return e;var t=new c.onnx.TensorProto;if(e.dims){if(!Array.isArray(e.dims))throw TypeError(".onnx.TensorProto.dims: array expected");t.dims=[];for(var n=0;n<e.dims.length;++n)u.Long?(t.dims[n]=u.Long.fromValue(e.dims[n])).unsigned=!1:"string"==typeof e.dims[n]?t.dims[n]=parseInt(e.dims[n],10):"number"==typeof e.dims[n]?t.dims[n]=e.dims[n]:"object"==typeof e.dims[n]&&(t.dims[n]=new u.LongBits(e.dims[n].low>>>0,e.dims[n].high>>>0).toNumber())}if(null!=e.dataType&&(t.dataType=0|e.dataType),null!=e.segment){if("object"!=typeof e.segment)throw TypeError(".onnx.TensorProto.segment: object expected");t.segment=c.onnx.TensorProto.Segment.fromObject(e.segment)}if(e.floatData){if(!Array.isArray(e.floatData))throw TypeError(".onnx.TensorProto.floatData: array expected");for(t.floatData=[],n=0;n<e.floatData.length;++n)t.floatData[n]=Number(e.floatData[n])}if(e.int32Data){if(!Array.isArray(e.int32Data))throw TypeError(".onnx.TensorProto.int32Data: array expected");for(t.int32Data=[],n=0;n<e.int32Data.length;++n)t.int32Data[n]=0|e.int32Data[n]}if(e.stringData){if(!Array.isArray(e.stringData))throw TypeError(".onnx.TensorProto.stringData: array expected");for(t.stringData=[],n=0;n<e.stringData.length;++n)"string"==typeof e.stringData[n]?u.base64.decode(e.stringData[n],t.stringData[n]=u.newBuffer(u.base64.length(e.stringData[n])),0):e.stringData[n].length&&(t.stringData[n]=e.stringData[n])}if(e.int64Data){if(!Array.isArray(e.int64Data))throw TypeError(".onnx.TensorProto.int64Data: array expected");for(t.int64Data=[],n=0;n<e.int64Data.length;++n)u.Long?(t.int64Data[n]=u.Long.fromValue(e.int64Data[n])).unsigned=!1:"string"==typeof e.int64Data[n]?t.int64Data[n]=parseInt(e.int64Data[n],10):"number"==typeof e.int64Data[n]?t.int64Data[n]=e.int64Data[n]:"object"==typeof e.int64Data[n]&&(t.int64Data[n]=new u.LongBits(e.int64Data[n].low>>>0,e.int64Data[n].high>>>0).toNumber())}if(null!=e.name&&(t.name=String(e.name)),null!=e.docString&&(t.docString=String(e.docString)),null!=e.rawData&&("string"==typeof e.rawData?u.base64.decode(e.rawData,t.rawData=u.newBuffer(u.base64.length(e.rawData)),0):e.rawData.length&&(t.rawData=e.rawData)),e.externalData){if(!Array.isArray(e.externalData))throw TypeError(".onnx.TensorProto.externalData: array expected");for(t.externalData=[],n=0;n<e.externalData.length;++n){if("object"!=typeof e.externalData[n])throw TypeError(".onnx.TensorProto.externalData: object expected");t.externalData[n]=c.onnx.StringStringEntryProto.fromObject(e.externalData[n])}}switch(e.dataLocation){case"DEFAULT":case 0:t.dataLocation=0;break;case"EXTERNAL":case 1:t.dataLocation=1}if(e.doubleData){if(!Array.isArray(e.doubleData))throw TypeError(".onnx.TensorProto.doubleData: array expected");for(t.doubleData=[],n=0;n<e.doubleData.length;++n)t.doubleData[n]=Number(e.doubleData[n])}if(e.uint64Data){if(!Array.isArray(e.uint64Data))throw TypeError(".onnx.TensorProto.uint64Data: array expected");for(t.uint64Data=[],n=0;n<e.uint64Data.length;++n)u.Long?(t.uint64Data[n]=u.Long.fromValue(e.uint64Data[n])).unsigned=!0:"string"==typeof e.uint64Data[n]?t.uint64Data[n]=parseInt(e.uint64Data[n],10):"number"==typeof e.uint64Data[n]?t.uint64Data[n]=e.uint64Data[n]:"object"==typeof e.uint64Data[n]&&(t.uint64Data[n]=new u.LongBits(e.uint64Data[n].low>>>0,e.uint64Data[n].high>>>0).toNumber(!0))}return t},e.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.dims=[],n.floatData=[],n.int32Data=[],n.stringData=[],n.int64Data=[],n.doubleData=[],n.uint64Data=[],n.externalData=[]),t.defaults&&(n.dataType=0,n.segment=null,n.name="",t.bytes===String?n.rawData="":(n.rawData=[],t.bytes!==Array&&(n.rawData=u.newBuffer(n.rawData))),n.docString="",n.dataLocation=t.enums===String?"DEFAULT":0),e.dims&&e.dims.length){n.dims=[];for(var r=0;r<e.dims.length;++r)"number"==typeof e.dims[r]?n.dims[r]=t.longs===String?String(e.dims[r]):e.dims[r]:n.dims[r]=t.longs===String?u.Long.prototype.toString.call(e.dims[r]):t.longs===Number?new u.LongBits(e.dims[r].low>>>0,e.dims[r].high>>>0).toNumber():e.dims[r]}if(null!=e.dataType&&e.hasOwnProperty("dataType")&&(n.dataType=e.dataType),null!=e.segment&&e.hasOwnProperty("segment")&&(n.segment=c.onnx.TensorProto.Segment.toObject(e.segment,t)),e.floatData&&e.floatData.length)for(n.floatData=[],r=0;r<e.floatData.length;++r)n.floatData[r]=t.json&&!isFinite(e.floatData[r])?String(e.floatData[r]):e.floatData[r];if(e.int32Data&&e.int32Data.length)for(n.int32Data=[],r=0;r<e.int32Data.length;++r)n.int32Data[r]=e.int32Data[r];if(e.stringData&&e.stringData.length)for(n.stringData=[],r=0;r<e.stringData.length;++r)n.stringData[r]=t.bytes===String?u.base64.encode(e.stringData[r],0,e.stringData[r].length):t.bytes===Array?Array.prototype.slice.call(e.stringData[r]):e.stringData[r];if(e.int64Data&&e.int64Data.length)for(n.int64Data=[],r=0;r<e.int64Data.length;++r)"number"==typeof e.int64Data[r]?n.int64Data[r]=t.longs===String?String(e.int64Data[r]):e.int64Data[r]:n.int64Data[r]=t.longs===String?u.Long.prototype.toString.call(e.int64Data[r]):t.longs===Number?new u.LongBits(e.int64Data[r].low>>>0,e.int64Data[r].high>>>0).toNumber():e.int64Data[r];if(null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.rawData&&e.hasOwnProperty("rawData")&&(n.rawData=t.bytes===String?u.base64.encode(e.rawData,0,e.rawData.length):t.bytes===Array?Array.prototype.slice.call(e.rawData):e.rawData),e.doubleData&&e.doubleData.length)for(n.doubleData=[],r=0;r<e.doubleData.length;++r)n.doubleData[r]=t.json&&!isFinite(e.doubleData[r])?String(e.doubleData[r]):e.doubleData[r];if(e.uint64Data&&e.uint64Data.length)for(n.uint64Data=[],r=0;r<e.uint64Data.length;++r)"number"==typeof e.uint64Data[r]?n.uint64Data[r]=t.longs===String?String(e.uint64Data[r]):e.uint64Data[r]:n.uint64Data[r]=t.longs===String?u.Long.prototype.toString.call(e.uint64Data[r]):t.longs===Number?new u.LongBits(e.uint64Data[r].low>>>0,e.uint64Data[r].high>>>0).toNumber(!0):e.uint64Data[r];if(null!=e.docString&&e.hasOwnProperty("docString")&&(n.docString=e.docString),e.externalData&&e.externalData.length)for(n.externalData=[],r=0;r<e.externalData.length;++r)n.externalData[r]=c.onnx.StringStringEntryProto.toObject(e.externalData[r],t);return null!=e.dataLocation&&e.hasOwnProperty("dataLocation")&&(n.dataLocation=t.enums===String?c.onnx.TensorProto.DataLocation[e.dataLocation]:e.dataLocation),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.util.toJSONOptions)},e.DataType=(t={},(n=Object.create(t))[t[0]="UNDEFINED"]=0,n[t[1]="FLOAT"]=1,n[t[2]="UINT8"]=2,n[t[3]="INT8"]=3,n[t[4]="UINT16"]=4,n[t[5]="INT16"]=5,n[t[6]="INT32"]=6,n[t[7]="INT64"]=7,n[t[8]="STRING"]=8,n[t[9]="BOOL"]=9,n[t[10]="FLOAT16"]=10,n[t[11]="DOUBLE"]=11,n[t[12]="UINT32"]=12,n[t[13]="UINT64"]=13,n[t[14]="COMPLEX64"]=14,n[t[15]="COMPLEX128"]=15,n[t[16]="BFLOAT16"]=16,n),e.Segment=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.begin=u.Long?u.Long.fromBits(0,0,!1):0,e.prototype.end=u.Long?u.Long.fromBits(0,0,!1):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=l.create()),null!=e.begin&&e.hasOwnProperty("begin")&&t.uint32(8).int64(e.begin),null!=e.end&&e.hasOwnProperty("end")&&t.uint32(16).int64(e.end),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new c.onnx.TensorProto.Segment;e.pos<n;){var o=e.uint32();switch(o>>>3){case 1:r.begin=e.int64();break;case 2:r.end=e.int64();break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.begin&&e.hasOwnProperty("begin")&&!(u.isInteger(e.begin)||e.begin&&u.isInteger(e.begin.low)&&u.isInteger(e.begin.high))?"begin: integer|Long expected":null!=e.end&&e.hasOwnProperty("end")&&!(u.isInteger(e.end)||e.end&&u.isInteger(e.end.low)&&u.isInteger(e.end.high))?"end: integer|Long expected":null},e.fromObject=function(e){if(e instanceof c.onnx.TensorProto.Segment)return e;var t=new c.onnx.TensorProto.Segment;return null!=e.begin&&(u.Long?(t.begin=u.Long.fromValue(e.begin)).unsigned=!1:"string"==typeof e.begin?t.begin=parseInt(e.begin,10):"number"==typeof e.begin?t.begin=e.begin:"object"==typeof e.begin&&(t.begin=new u.LongBits(e.begin.low>>>0,e.begin.high>>>0).toNumber())),null!=e.end&&(u.Long?(t.end=u.Long.fromValue(e.end)).unsigned=!1:"string"==typeof e.end?t.end=parseInt(e.end,10):"number"==typeof e.end?t.end=e.end:"object"==typeof e.end&&(t.end=new u.LongBits(e.end.low>>>0,e.end.high>>>0).toNumber())),t},e.toObject=function(e,t){t||(t={});var n={};if(t.defaults){if(u.Long){var r=new u.Long(0,0,!1);n.begin=t.longs===String?r.toString():t.longs===Number?r.toNumber():r}else n.begin=t.longs===String?"0":0;u.Long?(r=new u.Long(0,0,!1),n.end=t.longs===String?r.toString():t.longs===Number?r.toNumber():r):n.end=t.longs===String?"0":0}return null!=e.begin&&e.hasOwnProperty("begin")&&("number"==typeof e.begin?n.begin=t.longs===String?String(e.begin):e.begin:n.begin=t.longs===String?u.Long.prototype.toString.call(e.begin):t.longs===Number?new u.LongBits(e.begin.low>>>0,e.begin.high>>>0).toNumber():e.begin),null!=e.end&&e.hasOwnProperty("end")&&("number"==typeof e.end?n.end=t.longs===String?String(e.end):e.end:n.end=t.longs===String?u.Long.prototype.toString.call(e.end):t.longs===Number?new u.LongBits(e.end.low>>>0,e.end.high>>>0).toNumber():e.end),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.util.toJSONOptions)},e}(),e.DataLocation=function(){var e={},t=Object.create(e);return t[e[0]="DEFAULT"]=0,t[e[1]="EXTERNAL"]=1,t}(),e;var t,n}(),a.TensorShapeProto=function(){function e(e){if(this.dim=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.dim=u.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=l.create()),null!=e.dim&&e.dim.length)for(var n=0;n<e.dim.length;++n)c.onnx.TensorShapeProto.Dimension.encode(e.dim[n],t.uint32(10).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new c.onnx.TensorShapeProto;e.pos<n;){var o=e.uint32();o>>>3==1?(r.dim&&r.dim.length||(r.dim=[]),r.dim.push(c.onnx.TensorShapeProto.Dimension.decode(e,e.uint32()))):e.skipType(7&o)}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.dim&&e.hasOwnProperty("dim")){if(!Array.isArray(e.dim))return"dim: array expected";for(var t=0;t<e.dim.length;++t){var n=c.onnx.TensorShapeProto.Dimension.verify(e.dim[t]);if(n)return"dim."+n}}return null},e.fromObject=function(e){if(e instanceof c.onnx.TensorShapeProto)return e;var t=new c.onnx.TensorShapeProto;if(e.dim){if(!Array.isArray(e.dim))throw TypeError(".onnx.TensorShapeProto.dim: array expected");t.dim=[];for(var n=0;n<e.dim.length;++n){if("object"!=typeof e.dim[n])throw TypeError(".onnx.TensorShapeProto.dim: object expected");t.dim[n]=c.onnx.TensorShapeProto.Dimension.fromObject(e.dim[n])}}return t},e.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.dim=[]),e.dim&&e.dim.length){n.dim=[];for(var r=0;r<e.dim.length;++r)n.dim[r]=c.onnx.TensorShapeProto.Dimension.toObject(e.dim[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.util.toJSONOptions)},e.Dimension=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}var t;return e.prototype.dimValue=u.Long?u.Long.fromBits(0,0,!1):0,e.prototype.dimParam="",e.prototype.denotation="",Object.defineProperty(e.prototype,"value",{get:u.oneOfGetter(t=["dimValue","dimParam"]),set:u.oneOfSetter(t)}),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=l.create()),null!=e.dimValue&&e.hasOwnProperty("dimValue")&&t.uint32(8).int64(e.dimValue),null!=e.dimParam&&e.hasOwnProperty("dimParam")&&t.uint32(18).string(e.dimParam),null!=e.denotation&&e.hasOwnProperty("denotation")&&t.uint32(26).string(e.denotation),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new c.onnx.TensorShapeProto.Dimension;e.pos<n;){var o=e.uint32();switch(o>>>3){case 1:r.dimValue=e.int64();break;case 2:r.dimParam=e.string();break;case 3:r.denotation=e.string();break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";var t={};if(null!=e.dimValue&&e.hasOwnProperty("dimValue")&&(t.value=1,!(u.isInteger(e.dimValue)||e.dimValue&&u.isInteger(e.dimValue.low)&&u.isInteger(e.dimValue.high))))return"dimValue: integer|Long expected";if(null!=e.dimParam&&e.hasOwnProperty("dimParam")){if(1===t.value)return"value: multiple values";if(t.value=1,!u.isString(e.dimParam))return"dimParam: string expected"}return null!=e.denotation&&e.hasOwnProperty("denotation")&&!u.isString(e.denotation)?"denotation: string expected":null},e.fromObject=function(e){if(e instanceof c.onnx.TensorShapeProto.Dimension)return e;var t=new c.onnx.TensorShapeProto.Dimension;return null!=e.dimValue&&(u.Long?(t.dimValue=u.Long.fromValue(e.dimValue)).unsigned=!1:"string"==typeof e.dimValue?t.dimValue=parseInt(e.dimValue,10):"number"==typeof e.dimValue?t.dimValue=e.dimValue:"object"==typeof e.dimValue&&(t.dimValue=new u.LongBits(e.dimValue.low>>>0,e.dimValue.high>>>0).toNumber())),null!=e.dimParam&&(t.dimParam=String(e.dimParam)),null!=e.denotation&&(t.denotation=String(e.denotation)),t},e.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.denotation=""),null!=e.dimValue&&e.hasOwnProperty("dimValue")&&("number"==typeof e.dimValue?n.dimValue=t.longs===String?String(e.dimValue):e.dimValue:n.dimValue=t.longs===String?u.Long.prototype.toString.call(e.dimValue):t.longs===Number?new u.LongBits(e.dimValue.low>>>0,e.dimValue.high>>>0).toNumber():e.dimValue,t.oneofs&&(n.value="dimValue")),null!=e.dimParam&&e.hasOwnProperty("dimParam")&&(n.dimParam=e.dimParam,t.oneofs&&(n.value="dimParam")),null!=e.denotation&&e.hasOwnProperty("denotation")&&(n.denotation=e.denotation),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.util.toJSONOptions)},e}(),e}(),a.TypeProto=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}var t;return e.prototype.tensorType=null,e.prototype.denotation="",Object.defineProperty(e.prototype,"value",{get:u.oneOfGetter(t=["tensorType"]),set:u.oneOfSetter(t)}),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=l.create()),null!=e.tensorType&&e.hasOwnProperty("tensorType")&&c.onnx.TypeProto.Tensor.encode(e.tensorType,t.uint32(10).fork()).ldelim(),null!=e.denotation&&e.hasOwnProperty("denotation")&&t.uint32(50).string(e.denotation),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new c.onnx.TypeProto;e.pos<n;){var o=e.uint32();switch(o>>>3){case 1:r.tensorType=c.onnx.TypeProto.Tensor.decode(e,e.uint32());break;case 6:r.denotation=e.string();break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.tensorType&&e.hasOwnProperty("tensorType")){var t=c.onnx.TypeProto.Tensor.verify(e.tensorType);if(t)return"tensorType."+t}return null!=e.denotation&&e.hasOwnProperty("denotation")&&!u.isString(e.denotation)?"denotation: string expected":null},e.fromObject=function(e){if(e instanceof c.onnx.TypeProto)return e;var t=new c.onnx.TypeProto;if(null!=e.tensorType){if("object"!=typeof e.tensorType)throw TypeError(".onnx.TypeProto.tensorType: object expected");t.tensorType=c.onnx.TypeProto.Tensor.fromObject(e.tensorType)}return null!=e.denotation&&(t.denotation=String(e.denotation)),t},e.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.denotation=""),null!=e.tensorType&&e.hasOwnProperty("tensorType")&&(n.tensorType=c.onnx.TypeProto.Tensor.toObject(e.tensorType,t),t.oneofs&&(n.value="tensorType")),null!=e.denotation&&e.hasOwnProperty("denotation")&&(n.denotation=e.denotation),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.util.toJSONOptions)},e.Tensor=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.elemType=0,e.prototype.shape=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=l.create()),null!=e.elemType&&e.hasOwnProperty("elemType")&&t.uint32(8).int32(e.elemType),null!=e.shape&&e.hasOwnProperty("shape")&&c.onnx.TensorShapeProto.encode(e.shape,t.uint32(18).fork()).ldelim(),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new c.onnx.TypeProto.Tensor;e.pos<n;){var o=e.uint32();switch(o>>>3){case 1:r.elemType=e.int32();break;case 2:r.shape=c.onnx.TensorShapeProto.decode(e,e.uint32());break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.elemType&&e.hasOwnProperty("elemType")&&!u.isInteger(e.elemType))return"elemType: integer expected";if(null!=e.shape&&e.hasOwnProperty("shape")){var t=c.onnx.TensorShapeProto.verify(e.shape);if(t)return"shape."+t}return null},e.fromObject=function(e){if(e instanceof c.onnx.TypeProto.Tensor)return e;var t=new c.onnx.TypeProto.Tensor;if(null!=e.elemType&&(t.elemType=0|e.elemType),null!=e.shape){if("object"!=typeof e.shape)throw TypeError(".onnx.TypeProto.Tensor.shape: object expected");t.shape=c.onnx.TensorShapeProto.fromObject(e.shape)}return t},e.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.elemType=0,n.shape=null),null!=e.elemType&&e.hasOwnProperty("elemType")&&(n.elemType=e.elemType),null!=e.shape&&e.hasOwnProperty("shape")&&(n.shape=c.onnx.TensorShapeProto.toObject(e.shape,t)),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.util.toJSONOptions)},e}(),e}(),a.OperatorSetIdProto=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.domain="",e.prototype.version=u.Long?u.Long.fromBits(0,0,!1):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=l.create()),null!=e.domain&&e.hasOwnProperty("domain")&&t.uint32(10).string(e.domain),null!=e.version&&e.hasOwnProperty("version")&&t.uint32(16).int64(e.version),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new c.onnx.OperatorSetIdProto;e.pos<n;){var o=e.uint32();switch(o>>>3){case 1:r.domain=e.string();break;case 2:r.version=e.int64();break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.domain&&e.hasOwnProperty("domain")&&!u.isString(e.domain)?"domain: string expected":null!=e.version&&e.hasOwnProperty("version")&&!(u.isInteger(e.version)||e.version&&u.isInteger(e.version.low)&&u.isInteger(e.version.high))?"version: integer|Long expected":null},e.fromObject=function(e){if(e instanceof c.onnx.OperatorSetIdProto)return e;var t=new c.onnx.OperatorSetIdProto;return null!=e.domain&&(t.domain=String(e.domain)),null!=e.version&&(u.Long?(t.version=u.Long.fromValue(e.version)).unsigned=!1:"string"==typeof e.version?t.version=parseInt(e.version,10):"number"==typeof e.version?t.version=e.version:"object"==typeof e.version&&(t.version=new u.LongBits(e.version.low>>>0,e.version.high>>>0).toNumber())),t},e.toObject=function(e,t){t||(t={});var n={};if(t.defaults)if(n.domain="",u.Long){var r=new u.Long(0,0,!1);n.version=t.longs===String?r.toString():t.longs===Number?r.toNumber():r}else n.version=t.longs===String?"0":0;return null!=e.domain&&e.hasOwnProperty("domain")&&(n.domain=e.domain),null!=e.version&&e.hasOwnProperty("version")&&("number"==typeof e.version?n.version=t.longs===String?String(e.version):e.version:n.version=t.longs===String?u.Long.prototype.toString.call(e.version):t.longs===Number?new u.LongBits(e.version.low>>>0,e.version.high>>>0).toNumber():e.version),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.util.toJSONOptions)},e}(),a),e.exports=c},2100:(e,t,n)=>{e.exports=n(9482)},9482:(e,t,n)=>{var r=t;function o(){r.util._configure(),r.Writer._configure(r.BufferWriter),r.Reader._configure(r.BufferReader)}r.build="minimal",r.Writer=n(1173),r.BufferWriter=n(3155),r.Reader=n(1408),r.BufferReader=n(593),r.util=n(9693),r.rpc=n(5994),r.roots=n(5054),r.configure=o,o()},1408:(e,t,n)=>{e.exports=l;var r,o=n(9693),a=o.LongBits,i=o.utf8;function s(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function l(e){this.buf=e,this.pos=0,this.len=e.length}var u,c="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new l(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new l(e);throw Error("illegal buffer")},d=function(){return o.Buffer?function(e){return(l.create=function(e){return o.Buffer.isBuffer(e)?new r(e):c(e)})(e)}:c};function f(){var e=new a(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw s(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw s(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function p(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function h(){if(this.pos+8>this.len)throw s(this,8);return new a(p(this.buf,this.pos+=4),p(this.buf,this.pos+=4))}l.create=d(),l.prototype._slice=o.Array.prototype.subarray||o.Array.prototype.slice,l.prototype.uint32=(u=4294967295,function(){if(u=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return u;if((this.pos+=5)>this.len)throw this.pos=this.len,s(this,10);return u}),l.prototype.int32=function(){return 0|this.uint32()},l.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)},l.prototype.bool=function(){return 0!==this.uint32()},l.prototype.fixed32=function(){if(this.pos+4>this.len)throw s(this,4);return p(this.buf,this.pos+=4)},l.prototype.sfixed32=function(){if(this.pos+4>this.len)throw s(this,4);return 0|p(this.buf,this.pos+=4)},l.prototype.float=function(){if(this.pos+4>this.len)throw s(this,4);var e=o.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},l.prototype.double=function(){if(this.pos+8>this.len)throw s(this,4);var e=o.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},l.prototype.bytes=function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw s(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,n):t===n?new this.buf.constructor(0):this._slice.call(this.buf,t,n)},l.prototype.string=function(){var e=this.bytes();return i.read(e,0,e.length)},l.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw s(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw s(this)}while(128&this.buf[this.pos++]);return this},l.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},l._configure=function(e){r=e,l.create=d(),r._configure();var t=o.Long?"toLong":"toNumber";o.merge(l.prototype,{int64:function(){return f.call(this)[t](!1)},uint64:function(){return f.call(this)[t](!0)},sint64:function(){return f.call(this).zzDecode()[t](!1)},fixed64:function(){return h.call(this)[t](!0)},sfixed64:function(){return h.call(this)[t](!1)}})}},593:(e,t,n)=>{e.exports=a;var r=n(1408);(a.prototype=Object.create(r.prototype)).constructor=a;var o=n(9693);function a(e){r.call(this,e)}a._configure=function(){o.Buffer&&(a.prototype._slice=o.Buffer.prototype.slice)},a.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},a._configure()},5054:e=>{e.exports={}},5994:(e,t,n)=>{t.Service=n(7948)},7948:(e,t,n)=>{e.exports=o;var r=n(9693);function o(e,t,n){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");r.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(n)}(o.prototype=Object.create(r.EventEmitter.prototype)).constructor=o,o.prototype.rpcCall=function e(t,n,o,a,i){if(!a)throw TypeError("request must be specified");var s=this;if(!i)return r.asPromise(e,s,t,n,o,a);if(s.rpcImpl)try{return s.rpcImpl(t,n[s.requestDelimited?"encodeDelimited":"encode"](a).finish(),function(e,n){if(e)return s.emit("error",e,t),i(e);if(null!==n){if(!(n instanceof o))try{n=o[s.responseDelimited?"decodeDelimited":"decode"](n)}catch(r){return s.emit("error",r,t),i(r)}return s.emit("data",n,t),i(null,n)}s.end(!0)})}catch(l){return s.emit("error",l,t),void setTimeout(function(){i(l)},0)}else setTimeout(function(){i(Error("already ended"))},0)},o.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},1945:(e,t,n)=>{e.exports=o;var r=n(9693);function o(e,t){this.lo=e>>>0,this.hi=t>>>0}var a=o.zero=new o(0,0);a.toNumber=function(){return 0},a.zzEncode=a.zzDecode=function(){return this},a.length=function(){return 1};var i=o.zeroHash="\0\0\0\0\0\0\0\0";o.fromNumber=function(e){if(0===e)return a;var t=e<0;t&&(e=-e);var n=e>>>0,r=(e-n)/4294967296>>>0;return t&&(r=~r>>>0,n=~n>>>0,++n>4294967295&&(n=0,++r>4294967295&&(r=0))),new o(n,r)},o.from=function(e){if("number"==typeof e)return o.fromNumber(e);if(r.isString(e)){if(!r.Long)return o.fromNumber(parseInt(e,10));e=r.Long.fromString(e)}return e.low||e.high?new o(e.low>>>0,e.high>>>0):a},o.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,n=~this.hi>>>0;return t||(n=n+1>>>0),-(t+4294967296*n)}return this.lo+4294967296*this.hi},o.prototype.toLong=function(e){return r.Long?new r.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var s=String.prototype.charCodeAt;o.fromHash=function(e){return e===i?a:new o((s.call(e,0)|s.call(e,1)<<8|s.call(e,2)<<16|s.call(e,3)<<24)>>>0,(s.call(e,4)|s.call(e,5)<<8|s.call(e,6)<<16|s.call(e,7)<<24)>>>0)},o.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},o.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},o.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},o.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return 0===n?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:n<128?9:10}},9693:function(e,t,n){var r=t;function o(e,t,n){for(var r=Object.keys(t),o=0;o<r.length;++o)void 0!==e[r[o]]&&n||(e[r[o]]=t[r[o]]);return e}function a(e){function t(e,n){if(!(this instanceof t))return new t(e,n);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),n&&o(this,n)}return(t.prototype=Object.create(Error.prototype)).constructor=t,Object.defineProperty(t.prototype,"name",{get:function(){return e}}),t.prototype.toString=function(){return this.name+": "+this.message},t}r.asPromise=n(4537),r.base64=n(7419),r.EventEmitter=n(9211),r.float=n(945),r.inquire=n(7199),r.utf8=n(4997),r.pool=n(6662),r.LongBits=n(1945),r.isNode=Boolean(void 0!==n.g&&n.g&&n.g.process&&n.g.process.versions&&n.g.process.versions.node),r.global=r.isNode&&n.g||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||this,r.emptyArray=Object.freeze?Object.freeze([]):[],r.emptyObject=Object.freeze?Object.freeze({}):{},r.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},r.isString=function(e){return"string"==typeof e||e instanceof String},r.isObject=function(e){return e&&"object"==typeof e},r.isset=r.isSet=function(e,t){var n=e[t];return!(null==n||!e.hasOwnProperty(t))&&("object"!=typeof n||(Array.isArray(n)?n.length:Object.keys(n).length)>0)},r.Buffer=function(){try{var e=r.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(t){return null}}(),r._Buffer_from=null,r._Buffer_allocUnsafe=null,r.newBuffer=function(e){return"number"==typeof e?r.Buffer?r._Buffer_allocUnsafe(e):new r.Array(e):r.Buffer?r._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},r.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,r.Long=r.global.dcodeIO&&r.global.dcodeIO.Long||r.global.Long||r.inquire("long"),r.key2Re=/^true|false|0|1$/,r.key32Re=/^-?(?:0|[1-9][0-9]*)$/,r.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,r.longToHash=function(e){return e?r.LongBits.from(e).toHash():r.LongBits.zeroHash},r.longFromHash=function(e,t){var n=r.LongBits.fromHash(e);return r.Long?r.Long.fromBits(n.lo,n.hi,t):n.toNumber(Boolean(t))},r.merge=o,r.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},r.newError=a,r.ProtocolError=a("ProtocolError"),r.oneOfGetter=function(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=1;return function(){for(var e=Object.keys(this),n=e.length-1;n>-1;--n)if(1===t[e[n]]&&void 0!==this[e[n]]&&null!==this[e[n]])return e[n]}},r.oneOfSetter=function(e){return function(t){for(var n=0;n<e.length;++n)e[n]!==t&&delete this[e[n]]}},r.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},r._configure=function(){var e=r.Buffer;e?(r._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,n){return new e(t,n)},r._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}):r._Buffer_from=r._Buffer_allocUnsafe=null}},1173:(e,t,n)=>{e.exports=d;var r,o=n(9693),a=o.LongBits,i=o.base64,s=o.utf8;function l(e,t,n){this.fn=e,this.len=t,this.next=void 0,this.val=n}function u(){}function c(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function d(){this.len=0,this.head=new l(u,0,0),this.tail=this.head,this.states=null}var f=function(){return o.Buffer?function(){return(d.create=function(){return new r})()}:function(){return new d}};function p(e,t,n){t[n]=255&e}function h(e,t){this.len=e,this.next=void 0,this.val=t}function m(e,t,n){for(;e.hi;)t[n++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[n++]=127&e.lo|128,e.lo=e.lo>>>7;t[n++]=e.lo}function g(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}d.create=f(),d.alloc=function(e){return new o.Array(e)},o.Array!==Array&&(d.alloc=o.pool(d.alloc,o.Array.prototype.subarray)),d.prototype._push=function(e,t,n){return this.tail=this.tail.next=new l(e,t,n),this.len+=t,this},h.prototype=Object.create(l.prototype),h.prototype.fn=function(e,t,n){for(;e>127;)t[n++]=127&e|128,e>>>=7;t[n]=e},d.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new h((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},d.prototype.int32=function(e){return e<0?this._push(m,10,a.fromNumber(e)):this.uint32(e)},d.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},d.prototype.uint64=function(e){var t=a.from(e);return this._push(m,t.length(),t)},d.prototype.int64=d.prototype.uint64,d.prototype.sint64=function(e){var t=a.from(e).zzEncode();return this._push(m,t.length(),t)},d.prototype.bool=function(e){return this._push(p,1,e?1:0)},d.prototype.fixed32=function(e){return this._push(g,4,e>>>0)},d.prototype.sfixed32=d.prototype.fixed32,d.prototype.fixed64=function(e){var t=a.from(e);return this._push(g,4,t.lo)._push(g,4,t.hi)},d.prototype.sfixed64=d.prototype.fixed64,d.prototype.float=function(e){return this._push(o.float.writeFloatLE,4,e)},d.prototype.double=function(e){return this._push(o.float.writeDoubleLE,8,e)};var b=o.Array.prototype.set?function(e,t,n){t.set(e,n)}:function(e,t,n){for(var r=0;r<e.length;++r)t[n+r]=e[r]};d.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(p,1,0);if(o.isString(e)){var n=d.alloc(t=i.length(e));i.decode(e,n,0),e=n}return this.uint32(t)._push(b,t,e)},d.prototype.string=function(e){var t=s.length(e);return t?this.uint32(t)._push(s.write,t,e):this._push(p,1,0)},d.prototype.fork=function(){return this.states=new c(this),this.head=this.tail=new l(u,0,0),this.len=0,this},d.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new l(u,0,0),this.len=0),this},d.prototype.ldelim=function(){var e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=t,this.len+=n),this},d.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),n=0;e;)e.fn(e.val,t,n),n+=e.len,e=e.next;return t},d._configure=function(e){r=e,d.create=f(),r._configure()}},3155:(e,t,n)=>{e.exports=a;var r=n(1173);(a.prototype=Object.create(r.prototype)).constructor=a;var o=n(9693);function a(){r.call(this)}function i(e,t,n){e.length<40?o.utf8.write(e,t,n):t.utf8Write?t.utf8Write(e,n):t.write(e,n)}a._configure=function(){a.alloc=o._Buffer_allocUnsafe,a.writeBytesBuffer=o.Buffer&&o.Buffer.prototype instanceof Uint8Array&&"set"===o.Buffer.prototype.set.name?function(e,t,n){t.set(e,n)}:function(e,t,n){if(e.copy)e.copy(t,n,0,e.length);else for(var r=0;r<e.length;)t[n++]=e[r++]}},a.prototype.bytes=function(e){o.isString(e)&&(e=o._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(a.writeBytesBuffer,t,e),this},a.prototype.string=function(e){var t=o.Buffer.byteLength(e);return this.uint32(t),t&&this._push(i,t,e),this},a._configure()},7714:(e,t,n)=>{t.R=void 0;const r=n(6919),o=n(7448);t.R=new class{async init(){}async createSessionHandler(e,t){const n=new r.Session(t);return await n.loadModel(e),new o.OnnxjsSessionHandler(n)}}},4200:(e,t,n)=>{t.c8=t.rX=void 0;const r=n(1670),o=n(5381),a=n(2157),i=n(2306);t.rX=()=>{if(("number"!=typeof r.env.wasm.initTimeout||r.env.wasm.initTimeout<0)&&(r.env.wasm.initTimeout=0),"boolean"!=typeof r.env.wasm.simd&&(r.env.wasm.simd=!0),"boolean"!=typeof r.env.wasm.proxy&&(r.env.wasm.proxy=!1),"number"!=typeof r.env.wasm.numThreads||!Number.isInteger(r.env.wasm.numThreads)||r.env.wasm.numThreads<=0){const e="undefined"==typeof navigator?(0,o.cpus)().length:navigator.hardwareConcurrency;r.env.wasm.numThreads=Math.min(4,Math.ceil((e||1)/2))}},t.c8=new class{async init(){(0,t.rX)(),await(0,a.initWasm)()}async createSessionHandler(e,t){const n=new i.OnnxruntimeWebAssemblySessionHandler;return await n.loadModel(e,t),Promise.resolve(n)}}},6018:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(1670),t);const a=n(1670);{const e=n(7714).R;(0,a.registerBackend)("webgl",e,-10)}{const e=n(4200).c8;(0,a.registerBackend)("cpu",e,10),(0,a.registerBackend)("wasm",e,10),(0,a.registerBackend)("xnnpack",e,9)}},246:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createAttributeWithCacheKey=void 0;class n{constructor(e){Object.assign(this,e)}get cacheKey(){return this._cacheKey||(this._cacheKey=Object.getOwnPropertyNames(this).sort().map(e=>`${this[e]}`).join(";")),this._cacheKey}}t.createAttributeWithCacheKey=e=>new n(e)},7778:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Attribute=void 0;const r=n(1446),o=n(9395),a=n(9162),i=n(2517);var s=o.onnxruntime.experimental.fbs;class l{constructor(e){if(this._attributes=new Map,null!=e){for(const t of e)t instanceof r.onnx.AttributeProto?this._attributes.set(t.name,[l.getValue(t),l.getType(t)]):t instanceof s.Attribute&&this._attributes.set(t.name(),[l.getValue(t),l.getType(t)]);if(this._attributes.size<e.length)throw new Error("duplicated attribute names")}}set(e,t,n){this._attributes.set(e,[n,t])}delete(e){this._attributes.delete(e)}getFloat(e,t){return this.get(e,"float",t)}getInt(e,t){return this.get(e,"int",t)}getString(e,t){return this.get(e,"string",t)}getTensor(e,t){return this.get(e,"tensor",t)}getFloats(e,t){return this.get(e,"floats",t)}getInts(e,t){return this.get(e,"ints",t)}getStrings(e,t){return this.get(e,"strings",t)}getTensors(e,t){return this.get(e,"tensors",t)}get(e,t,n){const r=this._attributes.get(e);if(void 0===r){if(void 0!==n)return n;throw new Error(`required attribute not found: ${e}`)}if(r[1]!==t)throw new Error(`type mismatch: expected ${t} but got ${r[1]}`);return r[0]}static getType(e){const t=e instanceof r.onnx.AttributeProto?e.type:e.type();switch(t){case r.onnx.AttributeProto.AttributeType.FLOAT:return"float";case r.onnx.AttributeProto.AttributeType.INT:return"int";case r.onnx.AttributeProto.AttributeType.STRING:return"string";case r.onnx.AttributeProto.AttributeType.TENSOR:return"tensor";case r.onnx.AttributeProto.AttributeType.FLOATS:return"floats";case r.onnx.AttributeProto.AttributeType.INTS:return"ints";case r.onnx.AttributeProto.AttributeType.STRINGS:return"strings";case r.onnx.AttributeProto.AttributeType.TENSORS:return"tensors";default:throw new Error(`attribute type is not supported yet: ${r.onnx.AttributeProto.AttributeType[t]}`)}}static getValue(e){const t=e instanceof r.onnx.AttributeProto?e.type:e.type();if(t===r.onnx.AttributeProto.AttributeType.GRAPH||t===r.onnx.AttributeProto.AttributeType.GRAPHS)throw new Error("graph attribute is not supported yet");const n=this.getValueNoCheck(e);if(t===r.onnx.AttributeProto.AttributeType.INT&&i.LongUtil.isLong(n))return i.LongUtil.longToNumber(n);if(t===r.onnx.AttributeProto.AttributeType.INTS){const e=n,t=new Array(e.length);for(let n=0;n<e.length;n++){const r=e[n];t[n]=i.LongUtil.longToNumber(r)}return t}if(t===r.onnx.AttributeProto.AttributeType.TENSOR)return e instanceof r.onnx.AttributeProto?a.Tensor.fromProto(n):a.Tensor.fromOrtTensor(n);if(t===r.onnx.AttributeProto.AttributeType.TENSORS){if(e instanceof r.onnx.AttributeProto)return n.map(e=>a.Tensor.fromProto(e));if(e instanceof s.Attribute)return n.map(e=>a.Tensor.fromOrtTensor(e))}if(t===r.onnx.AttributeProto.AttributeType.STRING&&e instanceof r.onnx.AttributeProto){const e=n;return(0,i.decodeUtf8String)(e)}return t===r.onnx.AttributeProto.AttributeType.STRINGS&&e instanceof r.onnx.AttributeProto?n.map(i.decodeUtf8String):n}static getValueNoCheck(e){return e instanceof r.onnx.AttributeProto?this.getValueNoCheckFromOnnxFormat(e):this.getValueNoCheckFromOrtFormat(e)}static getValueNoCheckFromOnnxFormat(e){switch(e.type){case r.onnx.AttributeProto.AttributeType.FLOAT:return e.f;case r.onnx.AttributeProto.AttributeType.INT:return e.i;case r.onnx.AttributeProto.AttributeType.STRING:return e.s;case r.onnx.AttributeProto.AttributeType.TENSOR:return e.t;case r.onnx.AttributeProto.AttributeType.GRAPH:return e.g;case r.onnx.AttributeProto.AttributeType.FLOATS:return e.floats;case r.onnx.AttributeProto.AttributeType.INTS:return e.ints;case r.onnx.AttributeProto.AttributeType.STRINGS:return e.strings;case r.onnx.AttributeProto.AttributeType.TENSORS:return e.tensors;case r.onnx.AttributeProto.AttributeType.GRAPHS:return e.graphs;default:throw new Error(`unsupported attribute type: ${r.onnx.AttributeProto.AttributeType[e.type]}`)}}static getValueNoCheckFromOrtFormat(e){switch(e.type()){case s.AttributeType.FLOAT:return e.f();case s.AttributeType.INT:return e.i();case s.AttributeType.STRING:return e.s();case s.AttributeType.TENSOR:return e.t();case s.AttributeType.GRAPH:return e.g();case s.AttributeType.FLOATS:return e.floatsArray();case s.AttributeType.INTS:{const t=[];for(let n=0;n<e.intsLength();n++)t.push(e.ints(n));return t}case s.AttributeType.STRINGS:{const t=[];for(let n=0;n<e.stringsLength();n++)t.push(e.strings(n));return t}case s.AttributeType.TENSORS:{const t=[];for(let n=0;n<e.tensorsLength();n++)t.push(e.tensors(n));return t}default:throw new Error(`unsupported attribute type: ${s.AttributeType[e.type()]}`)}}}t.Attribute=l},7091:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.resolveBackend=t.backend=void 0;const r=n(5038),o=new Map;async function a(e){const n=t.backend;if(void 0!==n[e]&&function(e){const t=e;return"initialize"in t&&"function"==typeof t.initialize&&"createSessionHandler"in t&&"function"==typeof t.createSessionHandler&&"dispose"in t&&"function"==typeof t.dispose}(n[e])){const t=n[e];let r=t.initialize();if("object"==typeof r&&"then"in r&&(r=await r),r)return o.set(e,t),t}}t.backend={webgl:new r.WebGLBackend},t.resolveBackend=async function e(t){if(!t)return e(["webgl"]);{const e="string"==typeof t?[t]:t;for(const t of e){const e=o.get(t);if(e)return e;const n=await a(t);if(n)return n}}throw new Error("no available backend to use")}},5038:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WebGLBackend=void 0;const r=n(1670),o=n(6231),a=n(6416),i=n(7305);t.WebGLBackend=class{get contextId(){return r.env.webgl.contextId}set contextId(e){r.env.webgl.contextId=e}get matmulMaxBatchSize(){return r.env.webgl.matmulMaxBatchSize}set matmulMaxBatchSize(e){r.env.webgl.matmulMaxBatchSize=e}get textureCacheMode(){return r.env.webgl.textureCacheMode}set textureCacheMode(e){r.env.webgl.textureCacheMode=e}get pack(){return r.env.webgl.pack}set pack(e){r.env.webgl.pack=e}get async(){return r.env.webgl.async}set async(e){r.env.webgl.async=e}initialize(){try{return this.glContext=(0,i.createWebGLContext)(this.contextId),"number"!=typeof this.matmulMaxBatchSize&&(this.matmulMaxBatchSize=16),"string"!=typeof this.textureCacheMode&&(this.textureCacheMode="full"),"boolean"!=typeof this.pack&&(this.pack=!1),"boolean"!=typeof this.async&&(this.async=!1),o.Logger.setWithEnv(r.env),o.Logger.verbose("WebGLBackend",`Created WebGLContext: ${typeof this.glContext} with matmulMaxBatchSize: ${this.matmulMaxBatchSize}; textureCacheMode: ${this.textureCacheMode}; pack: ${this.pack}; async: ${this.async}.`),!0}catch(e){return o.Logger.warning("WebGLBackend",`Unable to initialize WebGLBackend. ${e}`),!1}}createSessionHandler(e){return new a.WebGLSessionHandler(this,e)}dispose(){this.glContext.dispose()}}},5107:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CoordsGlslLib=void 0;const r=n(2517),o=n(8520),a=n(5060),i=n(7859),s=n(9390);class l extends o.GlslLib{constructor(e){super(e)}getFunctions(){return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},this.offsetToCoords()),this.coordsToOffset()),this.toVec()),this.valueFrom()),this.getCommonUtilFuncs()),this.getInputsSamplingSnippets()),this.getOutputSamplingSnippet())}getCustomTypes(){return{}}offsetToCoords(){return{offsetToCoords:new o.GlslLibRoutine("\n vec2 offsetToCoords(int offset, int width, int height) {\n int t = offset / width;\n int s = offset - t*width;\n vec2 coords = (vec2(s,t) + vec2(0.5,0.5)) / vec2(width, height);\n return coords;\n }\n ")}}coordsToOffset(){return{coordsToOffset:new o.GlslLibRoutine("\n int coordsToOffset(vec2 coords, int width, int height) {\n float s = coords.s * float(width);\n float t = coords.t * float(height);\n int offset = int(t) * width + int(s);\n return offset;\n }\n ")}}getOutputSamplingSnippet(){const e=this.context.outputTextureLayout;return e.isPacked?this.getPackedOutputSamplingSnippet(e):this.getUnpackedOutputSamplingSnippet(e)}getPackedOutputSamplingSnippet(e){const t=e.unpackedShape,n=[e.width,e.height],r={},i="getOutputCoords";switch(t.length){case 0:r[i]=this.getOutputScalarCoords();break;case 1:r[i]=this.getOutputPacked1DCoords(t,n);break;case 2:r[i]=this.getOutputPacked2DCoords(t,n);break;case 3:r[i]=this.getOutputPacked3DCoords(t,n);break;default:r[i]=this.getOutputPackedNDCoords(t,n)}const s=`\n void setOutput(vec4 val) {\n ${(0,a.getGlsl)(this.context.glContext.version).output} = val;\n }\n `;return r.floatTextureSetRGBA=new o.GlslLibRoutine(s),r}getUnpackedOutputSamplingSnippet(e){const t=e.unpackedShape,n=[e.width,e.height],r={},i="getOutputCoords";switch(t.length){case 0:r[i]=this.getOutputScalarCoords();break;case 1:r[i]=this.getOutputUnpacked1DCoords(t,n);break;case 2:r[i]=this.getOutputUnpacked2DCoords(t,n);break;case 3:r[i]=this.getOutputUnpacked3DCoords(t,n);break;case 4:r[i]=this.getOutputUnpacked4DCoords(t,n);break;case 5:r[i]=this.getOutputUnpacked5DCoords(t,n);break;case 6:r[i]=this.getOutputUnpacked6DCoords(t,n);break;default:throw new Error(`Unsupported output dimensionality: ${t.length}`)}const s=`\n void setOutput(float val) {\n ${(0,a.getGlsl)(this.context.glContext.version).output} = vec4(val, 0, 0, 0);\n }\n `;return r.floatTextureSetR=new o.GlslLibRoutine(s),r}getOutputScalarCoords(){return new o.GlslLibRoutine("\n int getOutputCoords() {\n return 0;\n }\n ")}getOutputPacked1DCoords(e,t){const n=t;let r="";return 1===n[0]?(r=`\n int getOutputCoords() {\n return 2 * int(TexCoords.y * ${n[1]}.0);\n }\n `,new o.GlslLibRoutine(r)):1===n[1]?(r=`\n int getOutputCoords() {\n return 2 * int(TexCoords.x * ${n[0]}.0);\n }\n `,new o.GlslLibRoutine(r)):(r=`\n int getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${n[0]}, ${n[1]}));\n return 2 * (resTexRC.y * ${n[0]} + resTexRC.x);\n }\n `,new o.GlslLibRoutine(r))}getOutputPacked2DCoords(e,t){let n="";if(r.ArrayUtil.arraysEqual(e,t))return n=`\n ivec2 getOutputCoords() {\n return 2 * ivec2(TexCoords.xy * vec2(${t[0]}, ${t[1]}));\n }\n `,new o.GlslLibRoutine(n);const a=t,i=Math.ceil(e[1]/2);return n=`\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${a[0]}, ${a[1]}));\n\n int index = resTexRC.y * ${a[0]} + resTexRC.x;\n\n // reverse r and c order for packed texture\n int r = imod(index, ${i}) * 2;\n int c = 2 * (index / ${i});\n\n return ivec2(r, c);\n }\n `,new o.GlslLibRoutine(n)}getOutputPacked3DCoords(e,t){const n=[t[0],t[1]],r=Math.ceil(e[2]/2),a=r*Math.ceil(e[1]/2),i=`\n ivec3 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${n[0]}, ${n[1]}));\n int index = resTexRC.y * ${n[0]} + resTexRC.x;\n\n int b = index / ${a};\n index -= b * ${a};\n\n // reverse r and c order for packed texture\n int r = imod(index, ${r}) * 2;\n int c = 2 * (index / ${r});\n\n return ivec3(b, r, c);\n }\n `;return new o.GlslLibRoutine(i)}getOutputPackedNDCoords(e,t){const n=[t[0],t[1]],r=Math.ceil(e[e.length-1]/2),a=r*Math.ceil(e[e.length-2]/2);let i=a,s="",l="b, r, c";for(let o=2;o<e.length-1;o++)i*=e[e.length-o-1],s=`\n int b${o} = index / ${i};\n index -= b${o} * ${i};\n `+s,l=`b${o}, `+l;const u=`\n ivec${e.length} getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${n[0]}, ${n[1]}));\n int index = resTexRC.y * ${n[0]} + resTexRC.x;\n\n ${s}\n\n int b = index / ${a};\n index -= b * ${a};\n\n // reverse r and c order for packed texture\n int r = imod(index, ${r}) * 2;\n int c = 2 * (index / ${r});\n\n return ivec${e.length}(${l});\n }\n `;return new o.GlslLibRoutine(u)}getOutputUnpacked1DCoords(e,t){const n=`\n int getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${t[0]}, ${t[1]}));\n return resTexRC.y * ${t[0]} + resTexRC.x;\n }\n `;return new o.GlslLibRoutine(n)}getOutputUnpacked2DCoords(e,t){const n=`\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${t[0]}, ${t[1]}));\n int index = resTexRC.y * ${t[0]} + resTexRC.x;\n int r = index / ${e[1]};\n int c = index - r * ${e[1]};\n return ivec2(r, c);\n }\n `;return new o.GlslLibRoutine(n)}getOutputUnpacked3DCoords(e,t){let n="";const r=e.length;let a=null;r<2&&(a=[]),a=new Array(r-1),a[r-2]=e[r-1];for(let o=r-3;o>=0;--o)a[o]=a[o+1]*e[o+1];const i=["r","c","d"],s=a.map((e,t)=>`int ${i[t]} = index / ${e}; ${t===a.length-1?`int ${i[t+1]} = index - ${i[t]} * ${e}`:`index -= ${i[t]} * ${e}`};`).join("");return n=`\n ivec3 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${t[0]}, ${t[1]}));\n int index = resTexRC.y * ${t[0]} + resTexRC.x;\n ${s}\n return ivec3(r, c, d);\n }\n `,new o.GlslLibRoutine(n)}getOutputUnpacked4DCoords(e,t){let n="";const r=e.length;let a=null;r<2&&(a=[]),a=new Array(r-1),a[r-2]=e[r-1];for(let o=r-3;o>=0;--o)a[o]=a[o+1]*e[o+1];const i=["r","c","d","d2"],s=a.map((e,t)=>`int ${i[t]} = index / ${e}; ${t===a.length-1?`int ${i[t+1]} = index - ${i[t]} * ${e}`:`index -= ${i[t]} * ${e}`};`).join("");return n=`\n ivec4 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${t[0]}, ${t[1]}));\n int index = resTexRC.y * ${t[0]} + resTexRC.x;\n ${s}\n return ivec4(r, c, d, d2);\n }\n `,new o.GlslLibRoutine(n)}getOutputUnpacked5DCoords(e,t){let n="";const r=e.length;let a=null;r<2&&(a=[]),a=new Array(r-1),a[r-2]=e[r-1];for(let o=r-3;o>=0;--o)a[o]=a[o+1]*e[o+1];const i=["r","c","d","d2","d3"],s=a.map((e,t)=>`int ${i[t]} = index / ${e}; ${t===a.length-1?`int ${i[t+1]} = index - ${i[t]} * ${e}`:`index -= ${i[t]} * ${e}`};`).join("");return n=`\n ivec5 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${t[0]}, ${t[1]}));\n int index = resTexRC.y * ${t[0]} + resTexRC.x;\n ${s}\n return ivec5(r, c, d, d2, d3);\n }\n `,new o.GlslLibRoutine(n)}getOutputUnpacked6DCoords(e,t){let n="";const r=e.length;let a=null;r<2&&(a=[]),a=new Array(r-1),a[r-2]=e[r-1];for(let o=r-3;o>=0;--o)a[o]=a[o+1]*e[o+1];const i=["r","c","d","d2","d3","d4"],s=a.map((e,t)=>`int ${i[t]} = index / ${e}; ${t===a.length-1?`int ${i[t+1]} = index - ${i[t]} * ${e}`:`index -= ${i[t]} * ${e}`};`).join("");return n=`\n ivec6 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${t[0]}, ${t[1]}));\n int index = resTexRC.y * ${t[0]} + resTexRC.x;\n ${s}\n return ivec6(r, c, d, d2, d3, d4);\n }\n `,new o.GlslLibRoutine(n)}getCommonUtilFuncs(){const e={};let t="uvFromFlat";e[t]=new o.GlslLibRoutine("\n vec2 uvFromFlat(int texNumR, int texNumC, int index) {\n int texC = index / texNumR;\n int texR = index - texC * texNumR;\n // TODO: swap texR, texC order in following function so row is corresponding to u and column is corresponding to\n // v.\n return (vec2(texR, texC) + halfCR) / vec2(texNumR, texNumC);\n }\n "),t="packedUVfrom1D",e[t]=new o.GlslLibRoutine("\n vec2 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 "),t="packedUVfrom2D",e[t]=new o.GlslLibRoutine("\n vec2 packedUVfrom2D(int texNumR, int texNumC, int texelsInLogicalRow, 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 "),t="packedUVfrom3D",e[t]=new o.GlslLibRoutine("\n vec2 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 "),t="sampleTexture";const n=(0,a.getGlsl)(this.context.glContext.version);return e[t]=new o.GlslLibRoutine(`\n float sampleTexture(sampler2D textureSampler, vec2 uv) {\n return ${n.texture2D}(textureSampler, uv).r;\n }`),e}getInputsSamplingSnippets(){const e={},t=this.context.outputTextureLayout;return this.context.programInfo.inputNames.forEach((n,r)=>{const o=this.context.inputTextureLayouts[r],a=(0,s.generateShaderFuncNameFromInputSamplerName)(n);o.isPacked?e[a]=this.getPackedSamplerFromInput(a,n,o):e[a]=this.getUnpackedSamplerFromInput(a,n,o);const i=(0,s.generateShaderFuncNameFromInputSamplerNameAtOutCoords)(n);o.unpackedShape.length<=t.unpackedShape.length&&(o.isPacked?e[i]=this.getPackedSamplerAtOutputCoords(i,o,t,n):e[i]=this.getUnpackedSamplerAtOutputCoords(i,o,t,n))}),e}getPackedSamplerAtOutputCoords(e,t,n,a){const i=t.unpackedShape,l=n.unpackedShape,u=a,c=(0,s.generateShaderFuncNameFromInputSamplerName)(u),d=i.length,f=l.length,p=r.BroadcastUtil.getBroadcastDims(i,l),h=(0,s.getCoordsDataType)(f),m=f-d;let g;const b=(0,s.getGlChannels)();g=0===d?"":f<2&&p.length>=1?"coords = 0;":p.map(e=>`coords.${b[e+m]} = 0;`).join("\n");let y="";y=f<2&&d>0?"coords":i.map((e,t)=>`coords.${b[t+m]}`).join(", ");let _="return outputValue;";const v=1===r.ShapeUtil.size(i),w=1===r.ShapeUtil.size(l);if(1!==d||v||w){if(v&&!w)_=1===f?"\n return vec4(outputValue.x, outputValue.x, 0., 0.);\n ":"\n return vec4(outputValue.x);\n ";else if(p.length){const e=d-2,t=d-1;p.indexOf(e)>-1&&p.indexOf(t)>-1?_="return vec4(outputValue.x);":p.indexOf(e)>-1?_="return vec4(outputValue.x, outputValue.y, outputValue.x, outputValue.y);":p.indexOf(t)>-1&&(_="return vec4(outputValue.xx, outputValue.zz);")}}else _="\n return vec4(outputValue.xy, outputValue.xy);\n ";const S=`\n vec4 ${e}() {\n ${h} coords = getOutputCoords();\n \n int lastDim = coords.${b[f-1]};\n coords.${b[f-1]} = coords.${b[f-2]};\n coords.${b[f-2]} = lastDim;\n \n ${g}\n vec4 outputValue = ${c}(${y});\n ${_}\n }\n `;return new o.GlslLibRoutine(S,["coordinates.getOutputCoords"])}getUnpackedSamplerAtOutputCoords(e,t,n,a){const i=[n.width,n.height],l=[t.width,t.height],u=t.unpackedShape.length,c=n.unpackedShape.length,d=t.unpackedShape,f=n.unpackedShape,p=(0,s.generateShaderFuncNameFromInputSamplerName)(a);if(u===c&&r.ArrayUtil.arraysEqual(l,i)){const t=`\n float ${e}() {\n return sampleTexture(${a}, TexCoords);\n }\n `;return new o.GlslLibRoutine(t,["coordinates.sampleTexture"])}const h=(0,s.getCoordsDataType)(c),m=r.BroadcastUtil.getBroadcastDims(d,f),g=c-u;let b;const y=(0,s.getGlChannels)();b=0===u?"":c<2&&m.length>=1?"coords = 0;":m.map(e=>`coords.${y[e+g]} = 0;`).join("\n");let _="";_=c<2&&u>0?"coords":t.unpackedShape.map((e,t)=>`coords.${y[t+g]}`).join(", ");const v=`\n float ${e}() {\n ${h} coords = getOutputCoords();\n ${b}\n return ${p}(${_});\n }\n `;return new o.GlslLibRoutine(v,["coordinates.getOutputCoords"])}getPackedSamplerFromInput(e,t,n){switch(n.unpackedShape.length){case 0:return this.getPackedSamplerScalar(e,t);case 1:return this.getPackedSampler1D(e,t,n);case 2:return this.getPackedSampler2D(e,t,n);case 3:return this.getPackedSampler3D(e,t,n);default:return this.getPackedSamplerND(e,t,n)}}getUnpackedSamplerFromInput(e,t,n){const r=n.unpackedShape;switch(r.length){case 0:return this.getUnpackedSamplerScalar(e,t,n);case 1:return this.getUnpackedSampler1D(e,t,n);case 2:return this.getUnpackedSampler2D(e,t,n);case 3:return this.getUnpackedSampler3D(e,t,n);case 4:return this.getUnpackedSampler4D(e,t,n);case 5:return this.getUnpackedSampler5D(e,t,n);case 6:return this.getUnpackedSampler6D(e,t,n);default:throw new Error(`Unsupported dimension ${r.length}-D`)}}getPackedSamplerScalar(e,t){const n=`\n vec4 ${e}() {\n return ${(0,a.getGlsl)(this.context.glContext.version).texture2D}(${t}, halfCR);\n }\n `;return new o.GlslLibRoutine(n)}getPackedSampler1D(e,t,n){const r=[n.width,n.height],i=[r[1],r[0]],s=(0,a.getGlsl)(this.context.glContext.version),l=`vec4 ${e}(int index) {\n vec2 uv = packedUVfrom1D(\n ${i[0]}, ${i[1]}, index);\n return ${s.texture2D}(${t}, uv);\n }`;return new o.GlslLibRoutine(l,["coordinates.packedUVfrom1D"])}getPackedSampler2D(e,t,n){const i=n.unpackedShape,s=[n.width,n.height],l=(0,a.getGlsl)(this.context.glContext.version),u=s[0],c=s[1];if(null!=s&&r.ArrayUtil.arraysEqual(i,s)){const n=`vec4 ${e}(int row, int col) {\n vec2 uv = (vec2(col, row) + halfCR) / vec2(${c}.0, ${u}.0);\n return ${l.texture2D}(${t}, uv);\n }`;return new o.GlslLibRoutine(n)}const d=s,f=Math.ceil(i[1]/2),p=`vec4 ${e}(int row, int col) {\n vec2 uv = packedUVfrom2D(${d[1]}, ${d[0]}, ${f}, row, col);\n return ${l.texture2D}(${t}, uv);\n }`;return new o.GlslLibRoutine(p,["coordinates.packedUVfrom2D"])}getPackedSampler3D(e,t,n){const r=n.unpackedShape,i=[n.width,n.height],l=[i[0],i[1]],u=(0,a.getGlsl)(this.context.glContext.version);if(1===r[0]){const a=r.slice(1),i=[1,2],l=(0,s.squeezeInputShape)(r,a),u=["b","row","col"],c=JSON.parse(JSON.stringify(n));c.unpackedShape=l;const d=this.getPackedSamplerFromInput(e,t,c),f=`${d.routineBody}\n vec4 ${e}(int b, int row, int col) {\n return ${e}(${(0,s.getSqueezedParams)(u,i)});\n } `;return new o.GlslLibRoutine(f,d.dependencies)}const c=l[0],d=l[1],f=Math.ceil(r[2]/2),p=`vec4 ${e}(int b, int row, int col) {\n vec2 uv = packedUVfrom3D(\n ${d}, ${c}, ${f*Math.ceil(r[1]/2)}, ${f}, b, row, col);\n return ${u.texture2D}(${t}, uv);}`;return new o.GlslLibRoutine(p,["coordinates.packedUVfrom3D"])}getPackedSamplerND(e,t,n){const r=n.unpackedShape,i=r.length,s=[n.width,n.height],l=(0,a.getGlsl)(this.context.glContext.version),u=[s[0],s[1]],c=u[1],d=u[0],f=Math.ceil(r[i-1]/2);let p=f*Math.ceil(r[i-2]/2),h="int b, int row, int col",m=`b * ${p} + (row / 2) * ${f} + (col / 2)`;for(let o=2;o<i-1;o++)h=`int b${o}, `+h,p*=r[i-o-1],m=`b${o} * ${p} + `+m;const g=`vec4 ${e}(${h}) {\n int index = ${m};\n int texR = index / ${d};\n int texC = index - texR * ${d};\n vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${d}, ${c});\n return ${l.texture2D}(${t}, uv);\n }`;return new o.GlslLibRoutine(g)}getUnpackedSamplerScalar(e,t,n){const[r,a]=[n.width,n.height];if(1===r&&1===a){const n=`\n float ${e}() {\n return sampleTexture(${t}, halfCR);\n }\n `;return new o.GlslLibRoutine(n,["coordinates.sampleTexture"])}const i=`\n float ${e}() {\n int offset_${t} = coordsToOffset(TexCoords, ${r}, ${a});\n vec2 uv = uvFromFlat(${r}, ${a}, offset_${t});\n return sampleTexture(${t}, uv);\n }\n `;return new o.GlslLibRoutine(i,["coordinates.uvFromFlat","coordinates.sampleTexture","coordinates.coordsToOffset"])}getUnpackedSampler1D(e,t,n){const r=n.width,a=n.height;if(1===a&&1===r){const n=`\n float ${e}(int index) {\n return sampleTexture(${t}, halfCR);\n }\n `;return new o.GlslLibRoutine(n,["coordinates.sampleTexture"])}if(1===a){const n=`\n float ${e}(int index) {\n vec2 uv = vec2((float(index) + 0.5) / ${r}.0, 0.5);\n return sampleTexture(${t}, uv);\n }\n `;return new o.GlslLibRoutine(n,["coordinates.sampleTexture"])}if(1===r){const n=`\n float ${e}(int index) {\n vec2 uv = vec2(0.5, (float(index) + 0.5) / ${a}.0);\n return sampleTexture(${t}, uv);\n }\n `;return new o.GlslLibRoutine(n,["coordinates.sampleTexture"])}const i=`\n float ${e}(int index) {\n vec2 uv = uvFromFlat(${r}, ${a}, index);\n return sampleTexture(${t}, uv);\n }\n `;return new o.GlslLibRoutine(i,["coordinates.uvFromFlat","coordinates.sampleTexture"])}getUnpackedSampler2D(e,t,n){const a=n.unpackedShape,l=[n.height,n.width];if(null!=l&&r.ArrayUtil.arraysEqual(a,l)){const n=`\n float ${e}(int row, int col) {\n vec2 uv = (vec2(row, col) + halfCR) / vec2(${l[1]}.0, ${l[0]}.0);\n return sampleTexture(${t}, uv);\n }\n `;return new o.GlslLibRoutine(n,["coordinates.sampleTexture"])}const{newShape:u,keptDims:c}=(0,i.squeezeShape)(a),d=u;if(d.length<a.length){const r=(0,s.squeezeInputShape)(a,d),i=JSON.parse(JSON.stringify(n));i.unpackedShape=r;const l=["col","row"],u=`\n ${this.getUnpackedSamplerFromInput(e,t,i).routineBody}\n float ${e}(int row, int col) {\n return ${e}(${(0,s.getSqueezedParams)(l,c)});\n }\n `;return new o.GlslLibRoutine(u,["coordinates.sampleTexture"])}const f=l[1],p=l[0];if(1===p){const n=`\n float ${e}(int row, int col) {\n int offset_${t} = coordsToOffset(TexCoords, ${f}, ${p});\n float index = dot(vec3(row, col, offset_${t}), vec3(${a[1]}, 1, 1));\n vec2 uv = vec2(0.5, (index + 0.5) / ${f}.0);\n return sampleTexture(${t}, uv);\n }\n `;return new o.GlslLibRoutine(n,["coordinates.sampleTexture","coordinates.coordsToOffset"])}if(1===f){const n=`\n float ${e}(int row, int col) {\n int offset_${t} = coordsToOffset(TexCoords, ${f}, ${p});\n float index = dot(vec3(row, col, offset_${t}), vec3(${a[1]}, 1, 1));\n vec2 uv = vec2((index + 0.5) / ${p}.0, 0.5);\n return sampleTexture(${t}, uv);\n }\n `;return new o.GlslLibRoutine(n,["coordinates.sampleTexture","coordinates.coordsToOffset"])}const h=`\n float ${e}(int row, int col) {\n int index = col * ${a[1]} + row;\n vec2 uv = uvFromFlat(${f}, ${p}, index);\n return sampleTexture(${t}, uv);\n }\n `;return new o.GlslLibRoutine(h,["coordinates.uvFromFlat","coordinates.sampleTexture","coordinates.coordsToOffset"])}getUnpackedSampler3D(e,t,n){const r=n.unpackedShape,a=r[1]*r[2],l=r[2],{newShape:u,keptDims:c}=(0,i.squeezeShape)(r),d=u;if(d.length<r.length){const a=(0,s.squeezeInputShape)(r,d),i=["batch","col","row"],l=JSON.parse(JSON.stringify(n));l.unpackedShape=a;const u=this.getUnpackedSamplerFromInput(e,t,l),f=c.reverse(),p=`\n ${u.routineBody}\n float ${e}(int batch, int row, int col) {\n return ${e}(${(0,s.getSqueezedParams)(i,f)});\n }\n `;return new o.GlslLibRoutine(p,u.dependencies)}const f=`\n float ${e}(int depth, int row, int col) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = depth * ${a} + col * ${l} + row;\n vec2 uv = uvFromFlat(${n.width}, ${n.height}, index);\n return sampleTexture(${t}, uv);\n }\n `;return new o.GlslLibRoutine(f,["coordinates.uvFromFlat","coordinates.sampleTexture","coordinates.coordsToOffset"])}getUnpackedSampler4D(e,t,n){const r=n.unpackedShape,a=r[3],i=r[2]*a,s=`\n float ${e}(int row, int col, int depth, int depth2) {\n int index = row * ${r[1]*i} + col * ${i} +\n depth2 * ${a} + depth;\n vec2 uv = uvFromFlat(${n.width}, ${n.height}, index);\n return sampleTexture(${t}, uv);\n }\n `;return new o.GlslLibRoutine(s,["coordinates.uvFromFlat","coordinates.sampleTexture"])}getUnpackedSampler5D(e,t,n){const r=n.unpackedShape,a=r[4],l=r[3]*a,u=r[2]*l,c=r[1]*u,{newShape:d,keptDims:f}=(0,i.squeezeShape)(r);if(d.length<r.length){const a=(0,s.squeezeInputShape)(r,d),i=["row","col","depth","depth2","depth3"],l=JSON.parse(JSON.stringify(n));l.unpackedShape=a;const u=`\n ${this.getUnpackedSamplerFromInput(e,t,l).routineBody}\n float ${e}(int row, int col, int depth, int depth2, int depth3) {\n return ${e}(${(0,s.getSqueezedParams)(i,f)});\n }\n `;return new o.GlslLibRoutine(u,["coordinates.sampleTexture","coordinates.uvFromFlat"])}const p=`\n float ${e}(int row, int col, int depth, int depth2, int depth3) {\n int index = row * ${c} + col * ${u} + depth * ${l} +\n depth3 * ${a} + depth2;\n vec2 uv = uvFromFlat(${n.width}, ${n.height}, index);\n return sampleTexture(${t}, uv);\n }\n `;return new o.GlslLibRoutine(p,["coordinates.sampleTexture","coordinates.uvFromFlat"])}getUnpackedSampler6D(e,t,n){const r=n.unpackedShape,a=r[5],l=r[4]*a,u=r[3]*l,c=r[2]*u,d=r[1]*c,{newShape:f,keptDims:p}=(0,i.squeezeShape)(r);if(f.length<r.length){const a=(0,s.squeezeInputShape)(r,f),i=["row","col","depth","depth2","depth3","depth4"],l=JSON.parse(JSON.stringify(n));l.unpackedShape=a;const u=`\n ${this.getUnpackedSamplerFromInput(e,t,l).routineBody}\n float ${e}(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n return ${e}(${(0,s.getSqueezedParams)(i,p)});\n }\n `;return new o.GlslLibRoutine(u,["coordinates.sampleTexture","coordinates.uvFromFlat"])}const h=`\n float ${e}(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n int index = row * ${d} + col * ${c} + depth * ${u} +\n depth2 * ${l} + depth3 * ${a} + depth4;\n vec2 uv = uvFromFlat(${n.width}, ${n.height}, index);\n return sampleTexture(${t}, uv);\n }\n `;return new o.GlslLibRoutine(h,["coordinates.uvFromFlat","coordinates.sampleTexture","coordinates.coordsToOffset"])}toVec(){const e=this.context.outputTextureLayout,t=e.shape.length,n=e.strides,r=e.width,a=e.height,i=[];for(let o=0;o<t-1;++o)i.push(`\n c[${o}] = offset / ${n[o]};`),i.push(`\n offset -= c[${o}] * ${n[o]};`);i.push(`\n c[${t-1}] = offset;`);const s=`\n void toVec(vec2 texCoords, out int c[${t}]) {\n int offset = coordsToOffset(texCoords, ${r}, ${a});\n ${i.join("")}\n }\n void toVec(int offset, out int c[${t}]) {\n ${i.join("")}\n }\n `;return{toVec:new o.GlslLibRoutine(s,["coordinates.coordsToOffset"])}}valueFrom(){const e={};return this.context.programInfo.inputNames.forEach((t,n)=>{const r=this.context.inputTextureLayouts[n],a=(r.unpackedShape.length>0?r.unpackedShape:r.shape).length;let i=`_${t}`;e[i]=new o.GlslLibRoutine(this.getValueFromSingle(t,a,r.width,r.height,!1),[`shapeUtils.indicesToOffset${i}`,"coordinates.offsetToCoords","fragcolor.getColorAsFloat"]),i+="_T",e[i]=new o.GlslLibRoutine(this.getValueFromSingle(t,a,r.width,r.height,!0),[`shapeUtils.indicesToOffset${i}`,"coordinates.offsetToCoords","fragcolor.getColorAsFloat"])}),e}getValueFromSingle(e,t,n,r,o){let i=`_${e}`;return o&&(i+="_T"),`\n float ${i}(int m[${t}]) {\n int offset = indicesToOffset${i}(m);\n vec2 coords = offsetToCoords(offset, ${n}, ${r});\n float value = getColorAsFloat(${(0,a.getGlsl)(this.context.glContext.version).texture2D}(${e}, coords));\n return value;\n }\n `}getPackedValueFrom(e,t,n,r,o){let i=`_${e}_Pack`;return o&&(i+="_T"),`\n vec4 ${i}(int m[${t}]) {\n int offset = indicesToOffset_${e}(m);\n vec2 coords = offsetToCoords(offset, ${n}, ${r});\n return ${(0,a.getGlsl)(this.context.glContext.version).texture2D}(${e}, coords);\n }\n `}}t.CoordsGlslLib=l},8520:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.TopologicalSortGlslRoutines=t.GlslLibRoutineNode=t.GlslLibRoutine=t.GlslLib=t.GlslContext=t.FunctionType=void 0,(n=t.FunctionType||(t.FunctionType={}))[n.ValueBased=0]="ValueBased",n[n.Positional=1]="Positional",t.GlslContext=class{constructor(e,t,n,r){this.glContext=e,this.programInfo=t,this.inputTextureLayouts=n,this.outputTextureLayout=r}},t.GlslLib=class{constructor(e){this.context=e}},t.GlslLibRoutine=class{constructor(e,t){this.routineBody=e,this.dependencies=t}},t.GlslLibRoutineNode=class{constructor(e,t,n){this.name=e,this.dependencies=n||[],t&&(this.routineBody=t)}addDependency(e){e&&this.dependencies.push(e)}},t.TopologicalSortGlslRoutines=class{static returnOrderedNodes(e){if(!e||0===e.length)return[];if(1===e.length)return e;const t=new Set,n=new Set,r=new Array;return this.createOrderedNodes(e,t,n,r),r}static createOrderedNodes(e,t,n,r){for(let o=0;o<e.length;++o)this.dfsTraverse(e[o],t,n,r)}static dfsTraverse(e,t,n,r){if(!e||n.has(e.name))return;if(t.has(e.name))throw new Error("Cyclic dependency detected. Can't topologically sort routines needed for shader.");t.add(e.name);const o=e.dependencies;if(o&&o.length>0)for(let a=0;a<o.length;++a)this.dfsTraverse(o[a],t,n,r);r.push(e),n.add(e.name),t.delete(e.name)}}},7341:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EncodingGlslLib=void 0;const r=n(8520);class o extends r.GlslLib{constructor(e){super(e)}getFunctions(){return Object.assign(Object.assign({},this.encodeFloat32()),this.decodeFloat32())}getCustomTypes(){return{}}encodeFloat32(){return{encode:new r.GlslLibRoutine("highp vec4 encode(highp float f) {\n return vec4(f, 0.0, 0.0, 0.0);\n }\n ")}}decodeFloat32(){return{decode:new r.GlslLibRoutine("highp float decode(highp vec4 rgba) {\n return rgba.r;\n }\n ")}}encodeUint8(){const e=o.isLittleEndian()?"rgba.rgba=rgba.abgr;":"";return{encode:new r.GlslLibRoutine(`\n highp vec4 encode(highp float f) {\n highp float F = abs(f);\n highp float Sign = step(0.0,-f);\n highp float Exponent = floor(log2(F));\n highp float Mantissa = (exp2(- Exponent) * F);\n Exponent = floor(log2(F) + 127.0) + floor(log2(Mantissa));\n highp vec4 rgba;\n rgba[0] = 128.0 * Sign + floor(Exponent*exp2(-1.0));\n rgba[1] = 128.0 * mod(Exponent,2.0) + mod(floor(Mantissa*128.0),128.0);\n rgba[2] = floor(mod(floor(Mantissa*exp2(23.0 -8.0)),exp2(8.0)));\n rgba[3] = floor(exp2(23.0)*mod(Mantissa,exp2(-15.0)));\n ${e}\n rgba = rgba / 255.0; // values need to be normalized to [0,1]\n return rgba;\n }\n `)}}decodeUint8(){const e=o.isLittleEndian()?"rgba.rgba=rgba.abgr;":"";return{decode:new r.GlslLibRoutine(`\n highp float decode(highp vec4 rgba) {\n rgba = rgba * 255.0; // values need to be de-normalized from [0,1] to [0,255]\n ${e}\n highp float Sign = 1.0 - step(128.0,rgba[0])*2.0;\n highp float Exponent = 2.0 * mod(rgba[0],128.0) + step(128.0,rgba[1]) - 127.0;\n highp float Mantissa = mod(rgba[1],128.0)*65536.0 + rgba[2]*256.0 +rgba[3] + float(0x800000);\n highp float Result = Sign * exp2(Exponent) * (Mantissa * exp2(-23.0 ));\n return Result;\n }\n `)}}static isLittleEndian(){const e=new ArrayBuffer(4),t=new Uint32Array(e),n=new Uint8Array(e);if(t[0]=3735928559,239===n[0])return!0;if(222===n[0])return!1;throw new Error("unknown endianness")}}t.EncodingGlslLib=o},9894:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FragColorGlslLib=void 0;const r=n(8520),o=n(5060);class a extends r.GlslLib{constructor(e){super(e)}getFunctions(){return Object.assign(Object.assign({},this.setFragColor()),this.getColorAsFloat())}getCustomTypes(){return{}}setFragColor(){const e=(0,o.getGlsl)(this.context.glContext.version);return{setFragColor:new r.GlslLibRoutine(`\n void setFragColor(float value) {\n ${e.output} = encode(value);\n }\n `,["encoding.encode"])}}getColorAsFloat(){return{getColorAsFloat:new r.GlslLibRoutine("\n float getColorAsFloat(vec4 color) {\n return decode(color);\n }\n ",["encoding.decode"])}}}t.FragColorGlslLib=a},2848:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.replaceInlines=void 0;const n=/@inline[\s\n\r]+(\w+)[\s\n\r]+([0-9a-zA-Z_]+)\s*\(([^)]*)\)\s*{(([^}]|[\n\r])*)}/gm;t.replaceInlines=function(e){const t={};let r;for(;null!==(r=n.exec(e));){const e=r[3].split(",").map(e=>{const t=e.trim().split(" ");return t&&2===t.length?{type:t[0],name:t[1]}:null}).filter(e=>null!==e);t[r[2]]={params:e,body:r[4]}}for(const n in t){const o="(\\w+)?\\s+([_0-9a-zA-Z]+)\\s+=\\s+__FUNC__\\((.*)\\)\\s*;".replace("__FUNC__",n),a=new RegExp(o,"gm");for(;null!==(r=a.exec(e));){const o=r[1],a=r[2],i=r[3].split(","),s=o?`${o} ${a};`:"";let l=t[n].body,u="";t[n].params.forEach((e,t)=>{e&&(u+=`${e.type} ${e.name} = ${i[t]};\n`)}),l=`${u}\n ${l}`,l=l.replace("return",`${a} = `);const c=`\n ${s}\n {\n ${l}\n }\n `;e=e.replace(r[0],c)}}return e.replace(n,"")}},8879:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.GlslPreprocessor=void 0;const r=n(8520),o=n(2848),a=n(5483),i=n(5060);t.GlslPreprocessor=class{constructor(e,t,n,o){this.libs={},this.glslLibRoutineDependencyGraph={},this.context=new r.GlslContext(e,t,n,o),Object.keys(a.glslRegistry).forEach(e=>{const t=new a.glslRegistry[e](this.context);this.libs[e]=t});const i=this.glslLibRoutineDependencyGraph;for(const a in this.libs){const e=this.libs[a].getFunctions();for(const t in e){const n=a+"."+t;let o;i[n]?(o=i[n],o.routineBody=e[t].routineBody):(o=new r.GlslLibRoutineNode(n,e[t].routineBody),i[n]=o);const s=e[t].dependencies;if(s)for(let e=0;e<s.length;++e)if(i[s[e]])o.addDependency(i[s[e]]);else{const t=new r.GlslLibRoutineNode(s[e]);i[s[e]]=t,o.addDependency(t)}}}}preprocess(){const e=this.context.programInfo;let t=e.shaderSource;return this.context.programInfo.hasMain||(t=`${t}\n ${(0,i.getDefaultFragShaderMain)(this.context.glContext.version,this.context.outputTextureLayout.shape.length)}`),t=(0,o.replaceInlines)(t),`${(0,i.getFragShaderPreamble)(this.context.glContext.version)}\n ${this.getUniforms(e.inputNames,e.variables)}\n ${this.getImports(t)}\n ${t}`}getImports(e){const t=this.selectGlslLibRoutinesToBeIncluded(e);if(0===t.length)return"";let n="";for(let r=0;r<t.length;++r){if(!t[r].routineBody)throw new Error(`Missing body for the Glsl Library routine: ${t[r].name}`);n+=t[r].routineBody+"\n"}return n}selectGlslLibRoutinesToBeIncluded(e){const t=[];return Object.keys(this.glslLibRoutineDependencyGraph).forEach(n=>{const r=n.split(".")[1];-1!==e.indexOf(r)&&t.push(this.glslLibRoutineDependencyGraph[n])}),r.TopologicalSortGlslRoutines.returnOrderedNodes(t)}getUniforms(e,t){const n=[];if(e)for(const r of e)n.push(`uniform sampler2D ${r};`);if(t)for(const r of t)n.push(`uniform ${r.type} ${r.name}${r.arrayLength?`[${r.arrayLength}]`:""};`);return n.join("\n")}}},5483:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.glslRegistry=void 0;const r=n(5107),o=n(7341),a=n(9894),i=n(2655),s=n(3891);t.glslRegistry={encoding:o.EncodingGlslLib,fragcolor:a.FragColorGlslLib,vec:s.VecGlslLib,shapeUtils:i.ShapeUtilsGlslLib,coordinates:r.CoordsGlslLib}},2655:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ShapeUtilsGlslLib=void 0;const r=n(8520);class o extends r.GlslLib{constructor(e){super(e)}getFunctions(){return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},this.bcastIndex()),this.bcastMatmulIndex()),this.offsetToIndices()),this.indicesToOffset()),this.incrementIndices())}getCustomTypes(){return{}}bcastIndex(){const e=this.context.outputTextureLayout.shape.length,t={};return this.context.programInfo.inputNames.forEach((n,o)=>{const a=this.context.inputTextureLayouts[o].unpackedShape;if(a.length<=e){const o=a.length,i=e-o,s=`bcastIndices_${n}`;let l="";for(let e=0;e<o;++e)l+=`\n realIndices[${e}] = int( mod(float(bcastedIndices[${i+e}]), ${a[e]}.0) );\n `;const u=`\n void ${s} (int bcastedIndices[${e}], out int realIndices[${o}]) {\n ${l}\n }\n `;t[s]=new r.GlslLibRoutine(u)}}),t}bcastMatmulIndex(){const e=this.context.outputTextureLayout.shape.length,t={};return this.context.programInfo.inputNames.forEach((n,o)=>{const a=this.context.inputTextureLayouts[o].shape;if(!(a.length<2||a.length>e)){const o=a.length,i=e-o,s=`bcastMatmulIndices_${n}`;let l="";for(let e=0;e<o-2;++e)l+=`\n realIndices[${e}] = int( mod(float(bcastedIndices[${i+e}]), ${a[e]}.0) );\n `;const u=`\n void ${s}(int bcastedIndices[${e}], out int realIndices[${o}]) {\n ${l}\n realIndices[${o-1}] = bcastedIndices[${e-1}];\n realIndices[${o-2}] = bcastedIndices[${e-2}];\n }\n `;t[s]=new r.GlslLibRoutine(u)}}),t}indicesToOffset(){const e={};return this.context.programInfo.inputNames.forEach((t,n)=>{const a=this.context.inputTextureLayouts[n].shape,i=this.context.inputTextureLayouts[n].strides,s=a.length;let l=`indicesToOffset_${t}`;e[l]=new r.GlslLibRoutine(o.indexToOffsetSingle(l,s,i)),l=`indicesToOffset_${t}_T`,e[l]=new r.GlslLibRoutine(o.indexToOffsetSingle(l,s,i.slice().reverse()))}),e}static indexToOffsetSingle(e,t,n){let r="";for(let o=t-1;o>=0;--o)r+=`\n offset += indices[${o}] * ${n[o]};\n `;return`\n int ${e}(int indices[${t}]) {\n int offset = 0;\n ${r}\n return offset;\n }\n `}offsetToIndices(){const e={};return this.context.programInfo.inputNames.forEach((t,n)=>{const a=this.context.inputTextureLayouts[n].shape,i=this.context.inputTextureLayouts[n].strides,s=a.length;let l=`offsetToIndices_${t}`;e[l]=new r.GlslLibRoutine(o.offsetToIndicesSingle(l,s,i)),l=`offsetToIndices_${t}_T`,e[l]=new r.GlslLibRoutine(o.offsetToIndicesSingle(l,s,i.slice().reverse()))}),e}static offsetToIndicesSingle(e,t,n){const r=[];for(let o=0;o<t-1;++o)r.push(`\n indices[${o}] = offset / ${n[o]};`),r.push(`\n offset -= indices[${o}] * ${n[o]};`);return r.push(`\n indices[${t-1}] = offset;`),`\n void ${e}(int offset, out int indices[${t}]) {\n ${r.join("")}\n }\n `}incrementIndices(){const e={};return this.context.programInfo.inputNames.forEach((t,n)=>{const o=this.context.inputTextureLayouts[n].shape,a=o.length,i=`incrementIndices_${t}`;let s="";for(let e=0;e<a;++e)s+=`\n shape[${e}] = ${o[e]};`;const l=`\n void ${i}(int axis, out int indices[${a}]) {\n int shape[${a}];\n ${s};\n for(int i = ${a} -1 ; i >= 0; --i) {\n if(i > axis) continue;\n indices[i] += 1;\n if(indices[i] < shape[i]) {\n break;\n }\n indices[i] = 0;\n }\n }\n `;e[i]=new r.GlslLibRoutine(l)}),e}}t.ShapeUtilsGlslLib=o},5060:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getDefaultFragShaderMain=t.getFragShaderPreamble=t.getVertexShaderSource=t.getGlsl=void 0;const n={version:"",attribute:"attribute",varyingVertex:"varying",varyingFrag:"varying",texture2D:"texture2D",output:"gl_FragColor",outputDeclaration:""},r={version:"#version 300 es",attribute:"in",varyingVertex:"out",varyingFrag:"in",texture2D:"texture",output:"outputColor",outputDeclaration:"out vec4 outputColor;"};function o(e){return 1===e?n:r}t.getGlsl=o,t.getVertexShaderSource=function(e){const t=o(e);return`${t.version}\n precision highp float;\n ${t.attribute} vec3 position;\n ${t.attribute} vec2 textureCoord;\n\n ${t.varyingVertex} vec2 TexCoords;\n\n void main()\n {\n gl_Position = vec4(position, 1.0);\n TexCoords = textureCoord;\n }`},t.getFragShaderPreamble=function(e){const t=o(e);return`${t.version}\n precision highp float;\n precision highp int;\n precision highp sampler2D;\n ${t.varyingFrag} vec2 TexCoords;\n ${t.outputDeclaration}\n const vec2 halfCR = vec2(0.5, 0.5);\n\n // Custom vector types to handle higher dimenalities.\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 int imod(int x, int y) {\n return x - y * (x / y);\n }\n\n `},t.getDefaultFragShaderMain=function(e,t){return`\n void main() {\n int indices[${t}];\n toVec(TexCoords, indices);\n vec4 result = vec4(process(indices));\n ${o(e).output} = result;\n }\n `}},3891:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VecGlslLib=void 0;const r=n(8520);class o extends r.GlslLib{constructor(e){super(e)}getCustomTypes(){return{}}getFunctions(){return Object.assign(Object.assign(Object.assign(Object.assign({},this.binaryVecFunctions()),this.copyVec()),this.setVecItem()),this.getVecItem())}binaryVecFunctions(){const e=this.context.outputTextureLayout.shape.length,t={add:"+=",sub:"-=",mul:"*=",div:"/="},n={};for(const o in t){const a=`${o}Vec`;let i="";for(let n=0;n<e;++n)i+=`\n dest[${n}] ${t[o]} src[${n}];\n `;const s=`\n void ${a}(int src[${e}], out int dest[${e}]) {\n ${i}\n }\n `;n[a]=new r.GlslLibRoutine(s)}return n}copyVec(){const e=this.context.outputTextureLayout.shape.length;let t="";for(let r=0;r<e;++r)t+=`\n dest[${r}] = src[${r}];\n `;const n=`\n void copyVec(int src[${e}], out int dest[${e}]) {\n ${t}\n }\n `;return{copyVec:new r.GlslLibRoutine(n)}}setVecItem(){const e=this.context.outputTextureLayout.shape.length;let t=`\n if(index < 0)\n index =${e} + index;\n if (index == 0)\n m[0] = value;\n `;for(let r=1;r<e-1;++r)t+=`\n else if (index == ${r})\n m[${r}] = value;\n `;t+=`\n else\n m[${e-1}] = value;\n `;const n=`\n void setVecItem(out int m[${e}], int index, int value) {\n ${t}\n }\n `;return{setVecItem:new r.GlslLibRoutine(n)}}getVecItem(){const e=this.context.outputTextureLayout.shape.length;let t=`\n if(index < 0)\n index = ${e} + index;\n if (index == 0)\n return m[0];\n `;for(let r=1;r<e-1;++r)t+=`\n else if (index == ${r})\n return m[${r}];\n `;t+=`\n else\n return m[${e-1}];\n `;const n=`\n int getVecItem(int m[${e}], int index) {\n ${t}\n }\n `;return{getVecItem:new r.GlslLibRoutine(n)}}}t.VecGlslLib=o},8316:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WebGLInferenceHandler=void 0;const r=n(6231),o=n(9162),a=n(2517),i=n(2403),s=n(7019),l=n(8710),u=n(5611),c=n(4057),d=n(2039);t.WebGLInferenceHandler=class{constructor(e){this.session=e,this.packedTextureDataCache=new Map,this.unpackedTextureDataCache=new Map}calculateTextureWidthAndHeight(e,t){return(0,c.calculateTextureWidthAndHeight)(this.session.layoutStrategy,e,t)}executeProgram(e,t){if(t.length<e.inputNames.length)throw new Error(`Input size mustn't be less than ${e.inputNames.length}.`);if(e.inputNames.length!==e.inputTypes.length)throw new Error("input names size does not match input types");const n=[];for(let l=0;l<e.inputNames.length;++l)n[l]=this.getOrCreateTextureData(t[l],e.inputTypes[l]);const r=((e,t)=>{const n=t.map(e=>`${e.unpackedShape.join(",")};${e.width}x${e.height}`).join("_");let r=e.name;return e.cacheHint&&(r+="["+e.cacheHint+"]"),r+=":"+n,r})(e,n);let o=this.session.programManager.getArtifact(r);const a=o?o.programInfo:"function"==typeof e.get?e.get():e,i=(0,c.createTextureLayoutFromTextureType)(this.session.layoutStrategy,a.output.dims,a.output.textureType),s=this.createTextureData(i,a.output.type);return o||(o=this.session.programManager.build(a,n,s),this.session.programManager.setArtifact(r,o)),this.runProgram(o,n,s),s}run(e,t){return this.executeProgram(e,t).tensor}runProgram(e,t,n){for(let r=0;r<t.length;++r)if(!!t[r].isPacked!=(e.programInfo.inputTypes[r]===d.TextureType.packed))throw new Error(`input[${r}] property packed inconsistent`);if(!!n.isPacked!=(e.programInfo.output.textureType===d.TextureType.packed))throw new Error("output property packed inconsistent");this.session.programManager.run(e,t,n)}getOrCreateTextureData(e,t){let n=this.getTextureData(e.dataId,t===d.TextureType.packed);if(!n&&(n=this.getTextureData(e.dataId,t!==d.TextureType.packed),n))return t===d.TextureType.packed?this.pack(n):this.unpack(n);if(!n){const r=(0,c.createTextureLayoutFromTextureType)(this.session.layoutStrategy,e.dims,t);if(t===d.TextureType.packedLastDimension){const n=1,r=4,o=e.dims;if(4===o.length){const a=[o[0],Math.ceil(o[1]*o[2]*o[3]/r)],i=(0,c.createTextureLayoutFromTextureType)(this.session.layoutStrategy,a,t);let s=e.numberData;if(o[1]*o[2]*o[3]%r!=0){const t=o[0],a=o[1]*o[2]*o[3],i=Math.ceil(a*n/r)*r;s=new Float32Array(t*i);for(let r=0;r<t;++r){const t=r*a,o=r*i+r%n*a;s.set(e.numberData.subarray(t,t+a),o)}}return this.createTextureData(i,e.type,s,e,1)}}if(t===d.TextureType.packed){const t=(0,c.createTextureLayoutFromShape)(this.session.layoutStrategy,e.dims,1,[],{reverseWH:!0}),r=this.createTextureData(t,e.type,e.numberData,e,1);n=this.pack(r)}else n=this.createTextureData(r,e.type,e.numberData,e,1)}return n}createTextureDataFromLayoutBindTensor(e,t,n,r){return this.createTextureData(e,t,n,r,1)}createTextureData(e,t,n,o,a){r.Logger.verbose("InferenceHandler",`Creating TextureData: layout:[${JSON.stringify(e)}]`);const i=this.session.textureManager.createTextureFromLayout(t,e,n,a);return this.createTextureDataFromTexture(e,t,i,o)}reshapeUnpacked(e,t){const n=this.getOrCreateTextureData(e,d.TextureType.unpacked),r={channels:n.channels,height:n.height,width:n.width,shape:0!==t.length?t:[1],strides:a.ShapeUtil.computeStrides(t),unpackedShape:t};return this.createTextureDataFromTexture(r,e.type,n.texture).tensor}reshapePacked(e,t){const n=this.getOrCreateTextureData(e,d.TextureType.packed);if((0,s.isReshapeCheap)(e.dims,t)){const r={channels:n.channels,height:n.height,width:n.width,shape:0!==t.length?t:[1],strides:a.ShapeUtil.computeStrides(t),unpackedShape:t,isPacked:!0};return this.createTextureDataFromTexture(r,e.type,n.texture).tensor}const r=(0,s.processDims3D)(e.dims),o=(0,s.processDims3D)(t),i=this.reshapePacked(e,r),l=this.run((0,s.createPackedReshape3DProgramInfoLoader)(this,i,o),[i]);return this.reshapePacked(l,t)}cast(e,t){const n=this.getOrCreateTextureData(e,d.TextureType.unpacked);return this.createTextureDataFromTexture(n,t,n.texture).tensor}createTextureDataFromTexture(e,t,n,r,a){const i=Object.assign(Object.assign({},e),{tensor:r||new o.Tensor(e.unpackedShape,t,e=>this.readTexture(i),async e=>this.readTextureAsync(i),void 0,a),texture:n});return this.setTextureData(i.tensor.dataId,i,e.isPacked),i}getTextureData(e,t=!1){return this.session.isInitializer(e)?this.session.getTextureData(e,t):t?this.packedTextureDataCache.get(e):this.unpackedTextureDataCache.get(e)}setTextureData(e,t,n=!1){this.session.isInitializer(e)?this.session.setTextureData(e,t,n):(n?this.packedTextureDataCache:this.unpackedTextureDataCache).set(e,t)}isTextureLayoutCached(e,t=!1){return!!this.getTextureData(e.dataId,t)}dispose(){this.session.textureManager.clearActiveTextures(),this.packedTextureDataCache.forEach(e=>this.session.textureManager.releaseTexture(e)),this.packedTextureDataCache=new Map,this.unpackedTextureDataCache.forEach(e=>this.session.textureManager.releaseTexture(e)),this.unpackedTextureDataCache=new Map}readTexture(e){return e.isPacked?this.readTexture(this.unpack(e)):this.session.backend.glContext.isFloat32DownloadSupported?this.session.textureManager.readTexture(e,e.tensor.type,e.channels):this.session.textureManager.readUint8TextureAsFloat((0,l.encodeAsUint8)(this,e))}async readTextureAsync(e){return e.isPacked?this.readTextureAsync(this.unpack(e)):this.session.backend.glContext.isFloat32DownloadSupported?this.session.textureManager.readTextureAsync(e,e.tensor.type,e.channels):this.session.textureManager.readUint8TextureAsFloat((0,l.encodeAsUint8)(this,e))}pack(e){return this.executeProgram((0,i.createPackProgramInfoLoader)(this,e.tensor),[e.tensor])}unpack(e){return this.executeProgram((0,u.createUnpackProgramInfoLoader)(this,e.tensor),[e.tensor])}}},1640:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.WEBGL_OP_RESOLVE_RULES=void 0;const i=n(2898),s=a(n(7839)),l=n(4196),u=n(2069),c=n(8138),d=n(9663),f=n(5193),p=n(7992),h=n(1253),m=n(4776),g=n(6572),b=n(3346),y=n(5623),_=n(2870),v=n(2143),w=n(4939),S=n(718),x=n(2268),T=n(8117),E=n(2278),k=n(5524),P=n(5975),O=n(3933),A=n(6558),$=n(5723),R=n(3738),I=a(n(4909)),C=n(8428),D=n(9793);t.WEBGL_OP_RESOLVE_RULES=[["Abs","","6+",I.abs],["Acos","","7+",I.acos],["Add","","7+",s.add],["And","","7+",s.and],["Asin","","7+",I.asin],["Atan","","7+",I.atan],["AveragePool","","7+",v.averagePool,v.parseAveragePoolAttributes],["BatchNormalization","","7+",i.batchNormalization,i.parseBatchNormalizationAttributes],["Cast","","6+",l.cast,l.parseCastAttributes],["Ceil","","6+",I.ceil],["Clip","","6-10",I.clip,I.parseClipAttributes],["Clip","","11+",I.clipV11],["Concat","","4+",u.concat,u.parseConcatAttributes],["Conv","","1+",c.conv,c.parseConvAttributes],["ConvTranspose","","1+",d.convTranspose,d.parseConvTransposeAttributes],["Cos","","7+",I.cos],["Div","","7+",s.div],["Dropout","","7+",I.identity],["DepthToSpace","","1+",f.depthToSpace,f.parseDepthToSpaceAttributes],["Equal","","7+",s.equal],["Elu","","6+",I.elu,I.parseEluAttributes],["Exp","","6+",I.exp],["Flatten","","1+",p.flatten,p.parseFlattenAttributes],["Floor","","6+",I.floor],["FusedConv","com.microsoft","1+",c.conv,c.parseConvAttributes],["Gather","","1+",h.gather,h.parseGatherAttributes],["Gemm","","7-10",m.gemm,m.parseGemmAttributesV7],["Gemm","","11+",m.gemm,m.parseGemmAttributesV11],["GlobalAveragePool","","1+",v.globalAveragePool,v.parseGlobalAveragePoolAttributes],["GlobalMaxPool","","1+",v.globalMaxPool],["Greater","","7+",s.greater],["Identity","","1+",I.identity],["ImageScaler","","1+",g.imageScaler,g.parseImageScalerAttributes],["InstanceNormalization","","6+",b.instanceNormalization,b.parseInstanceNormalizationAttributes],["LeakyRelu","","6+",I.leakyRelu,I.parseLeakyReluAttributes],["Less","","7+",s.less],["Log","","6+",I.log],["MatMul","","1+",y.matMul,y.parseMatMulAttributes],["MaxPool","","1+",v.maxPool,v.parseMaxPoolAttributes],["Mul","","7+",s.mul],["Neg","","6+",I.neg],["Not","","1+",I.not],["Or","","7+",s.or],["Pad","","2-10",_.padV2,_.parsePadAttributesV2],["Pad","","11+",_.padV11,_.parsePadAttributesV11],["Pow","","7+",s.pow],["PRelu","","7+",s.pRelu],["ReduceLogSum","","1+",w.reduceLogSum,w.parseReduceAttributes],["ReduceMax","","1+",w.reduceMax,w.parseReduceAttributes],["ReduceMean","","1+",w.reduceMean,w.parseReduceAttributes],["ReduceMin","","1+",w.reduceMin,w.parseReduceAttributes],["ReduceProd","","1+",w.reduceProd,w.parseReduceAttributes],["ReduceSum","","1-12",w.reduceSum,w.parseReduceAttributes],["ReduceSumSquare","","1+",w.reduceLogSumSquare,w.parseReduceAttributes],["Relu","","6+",I.relu],["Reshape","","5+",S.reshape],["Resize","","10",x.resize,x.parseResizeAttributesV10],["Resize","","11+",x.resize,x.parseResizeAttributesV11],["Shape","","1+",T.shape],["Sigmoid","","6+",I.sigmoid],["Sin","","7+",I.sin],["Slice","","10+",E.sliceV10],["Slice","","1-9",E.slice,E.parseSliceAttributes],["Softmax","","1-12",k.softmax,k.parseSoftmaxAttributes],["Softmax","","13+",k.softmaxV13,k.parseSoftmaxAttributesV13],["Split","","2-12",P.split,P.parseSplitAttributes],["Sqrt","","6+",I.sqrt],["Squeeze","","1-12",O.squeeze,O.parseSqueezeAttributes],["Squeeze","","13+",O.squeezeV13],["Sub","","7+",s.sub],["Sum","","6+",A.sum],["Tan","","7+",I.tan],["Tanh","","6+",I.tanh],["Tile","","6+",$.tile],["Transpose","","1+",R.transpose,R.parseTransposeAttributes],["Upsample","","7-8",D.upsample,D.parseUpsampleAttributesV7],["Upsample","","9",D.upsample,D.parseUpsampleAttributesV9],["Unsqueeze","","1-12",C.unsqueeze,C.parseUnsqueezeAttributes],["Unsqueeze","","13+",C.unsqueezeV13],["Xor","","7+",s.xor]]},2898:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseBatchNormalizationAttributes=t.batchNormalization=void 0;const r=n(246),o=n(5060),a=n(2039),i={name:"BatchNormalization",inputNames:["A","Scale","B","Mean","Variance"],inputTypes:[a.TextureType.unpacked,a.TextureType.unpacked,a.TextureType.unpacked,a.TextureType.unpacked,a.TextureType.unpacked]};t.batchNormalization=(e,t,n)=>(l(t),[e.run(Object.assign(Object.assign({},i),{cacheHint:n.cacheKey,get:()=>s(e,t,n)}),t)]),t.parseBatchNormalizationAttributes=e=>{const t=e.attributes.getFloat("epsilon",1e-5),n=e.attributes.getFloat("momentum",.9),o=e.attributes.getInt("spatial",1);return(0,r.createAttributeWithCacheKey)({epsilon:t,momentum:n,spatial:o})};const s=(e,t,n)=>{const r=(0,o.getGlsl)(e.session.backend.glContext.version),s=t[0].dims.length,[l,u]=e.calculateTextureWidthAndHeight(t[1].dims,a.TextureType.unpacked),c=`\n float process(int[${s}] indices) {\n vec2 position = offsetToCoords(indices[1], ${l}, ${u});\n float scale = getColorAsFloat(${r.texture2D}(Scale, position));\n float mean = getColorAsFloat(${r.texture2D}(Mean, position));\n float variance = getColorAsFloat(${r.texture2D}(Variance, position));\n float b = getColorAsFloat(${r.texture2D}(B, position));\n\n return scale * ( (_A(indices) - mean) / sqrt(variance + float(${n.epsilon})) ) + b;\n }`;return Object.assign(Object.assign({},i),{output:{dims:t[0].dims,type:t[0].type,textureType:a.TextureType.unpacked},shaderSource:c})},l=e=>{if(!e||5!==e.length)throw new Error("BatchNormalization requires 5 inputs.");const t=e[0],n=e[1],r=e[2],o=e[3],a=e[4];if(t.dims.length<3||1!==n.dims.length||1!==r.dims.length||1!==o.dims.length||1!==a.dims.length)throw new Error("invalid input shape.");if(n.dims[0]!==t.dims[1]||r.dims[0]!==t.dims[1]||o.dims[0]!==t.dims[1]||a.dims[0]!==t.dims[1])throw new Error("invalid input shape.");if("float32"!==t.type&&"float64"!==t.type||"float32"!==n.type&&"float64"!==n.type||"float32"!==r.type&&"float64"!==r.type||"float32"!==o.type&&"float64"!==o.type||"float32"!==a.type&&"float64"!==a.type)throw new Error("invalid input tensor types.")}},7839:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.xor=t.sub=t.pRelu=t.pow=t.or=t.mul=t.less=t.greater=t.equal=t.div=t.and=t.add=t.glslPRelu=t.glslPow=t.glslXor=t.glslOr=t.glslAnd=t.glslLess=t.glslGreater=t.glslEqual=t.glslSub=t.glslMul=t.glslDiv=t.glslAdd=void 0;const r=n(2517),o=n(8520),a=n(5060),i=n(2039);function s(){const e="add_";return{body:`\n float ${e}(float a, float b) {\n return a + b;\n }\n vec4 ${e}(vec4 v1, vec4 v2) {\n return v1 + v2;\n }\n `,name:e,type:o.FunctionType.ValueBased}}function l(){const e="div_";return{body:`\n float ${e}(float a, float b) {\n return a / b;\n }\n vec4 ${e}(vec4 v1, vec4 v2) {\n return v1 / v2;\n }\n `,name:e,type:o.FunctionType.ValueBased}}function u(){const e="mul_";return{body:`\n float ${e}(float a, float b) {\n return a * b;\n }\n vec4 ${e}(vec4 v1, vec4 v2) {\n return v1 * v2;\n }\n `,name:e,type:o.FunctionType.ValueBased}}function c(){const e="sub_";return{body:`\n float ${e}(float a, float b) {\n return a - b;\n }\n vec4 ${e}(vec4 v1, vec4 v2) {\n return v1 - v2;\n }\n `,name:e,type:o.FunctionType.ValueBased}}function d(){const e="equal_";return{body:`\n float ${e}(float a, float b) {\n return float(a == b);\n }\n vec4 ${e}(vec4 v1, vec4 v2) {\n return vec4(equal(v1, v2));\n }\n `,name:e,type:o.FunctionType.ValueBased}}function f(){const e="greater_";return{body:`\n float ${e}(float a, float b) {\n return float(a > b);\n }\n vec4 ${e}(vec4 v1, vec4 v2) {\n return vec4( v1.r > v2.r ,\n v1.g > v2.g,\n v1.b > v2.b,\n v1.a > v2.a );\n }\n `,name:e,type:o.FunctionType.ValueBased}}function p(){const e="less_";return{body:`\n float ${e}(float a, float b) {\n return float(a < b);\n }\n vec4 ${e}(vec4 v1, vec4 v2) {\n return vec4( v1.r < v2.r ,\n v1.g < v2.g,\n v1.b < v2.b,\n v1.a < v2.a );\n }\n `,name:e,type:o.FunctionType.ValueBased}}function h(){const e="and_";return{body:`\n float ${e}(float a, float b) {\n return float( bool(a) && bool(b) );\n }\n vec4 ${e}(vec4 v1, vec4 v2) {\n bvec4 b1 = bvec4(v1);\n bvec4 b2 = bvec4(v2);\n return vec4( b1.r && b2.r ,\n b1.g && b2.g,\n b1.b && b2.b,\n b1.a && b2.a );\n }\n `,name:e,type:o.FunctionType.ValueBased}}function m(){const e="or_";return{body:`\n float ${e}(float a, float b) {\n return float( bool(a) || bool(b) );\n }\n vec4 ${e}(vec4 v1, vec4 v2) {\n bvec4 b1 = bvec4(v1);\n bvec4 b2 = bvec4(v2);\n return vec4( b1.r || b2.r ,\n b1.g || b2.g,\n b1.b || b2.b,\n b1.a || b2.a );\n }\n `,name:e,type:o.FunctionType.ValueBased}}function g(){const e="xor_";return{body:`\n float ${e}(float a, float b) {\n return float( bool(a) ^^ bool(b) );\n }\n vec4 ${e}(vec4 v1, vec4 v2) {\n bvec4 b1 = bvec4(v1);\n bvec4 b2 = bvec4(v2);\n return vec4( b1.r ^^ b2.r ,\n b1.g ^^ b2.g,\n b1.b ^^ b2.b,\n b1.a ^^ b2.a );\n }\n `,name:e,type:o.FunctionType.ValueBased}}function b(){return function(e){const t=`${e}_`;return{body:`\n float ${t}(float a, float b) {\n return ${e}(a, b);\n }\n vec4 ${t}(vec4 v1, vec4 v2) {\n return ${e}(v1, v2);\n }\n `,name:t,type:o.FunctionType.ValueBased}}("pow")}function y(){const e="prelu_";return{body:`\n float ${e}(float a, float b) {\n return a < 0.0 ? a * b: a;\n }\n vec4 ${e}(vec4 v1, vec4 v2) {\n return vec4(\n v1.r < 0.0 ? v1.r * v2.r: v1.r,\n v1.g < 0.0 ? v1.g * v2.g: v1.g,\n v1.b < 0.0 ? v1.b * v2.b: v1.b,\n v1.a < 0.0 ? v1.a * v2.a: v1.a\n );\n }\n `,name:e,type:o.FunctionType.ValueBased}}t.glslAdd=s,t.glslDiv=l,t.glslMul=u,t.glslSub=c,t.glslEqual=d,t.glslGreater=f,t.glslLess=p,t.glslAnd=h,t.glslOr=m,t.glslXor=g,t.glslPow=b,t.glslPRelu=y;const _=(e,t,n,r=t[0].type,o)=>{const a=e.session.pack?i.TextureType.packed:i.TextureType.unpacked;return{name:n.name,inputNames:["A","B"],inputTypes:[a,a],cacheHint:o,get:()=>v(e,t,n,r)}},v=(e,t,n,o=t[0].type)=>{const s=e.session.pack?i.TextureType.packed:i.TextureType.unpacked,l=!r.ShapeUtil.areEqual(t[0].dims,t[1].dims);let u=t[0].dims;const c=e.session.pack;if(l){const i=r.BroadcastUtil.calcShape(t[0].dims,t[1].dims,!1);if(!i)throw new Error("Can't perform binary op on the given tensors");u=i;const l=u.length,d=0!==t[0].dims.length?t[0].dims.length:1,f=0!==t[1].dims.length?t[1].dims.length:1,p=0!==t[0].dims.length?"bcastIndices_A(indices, aindices);":"aindices[0] = 0;",h=0!==t[1].dims.length?"bcastIndices_B(indices, bindices);":"bindices[0] = 0;",m=(0,a.getGlsl)(e.session.backend.glContext.version),g=c?`\n ${n.body}\n void main() {\n vec4 a = getAAtOutCoords();\n vec4 b = getBAtOutCoords();\n vec4 result = ${n.name}(a, b);\n ${m.output} = result;\n }`:`\n ${n.body}\n float process(int indices[${l}]) {\n int aindices[${d}];\n int bindices[${f}];\n ${p}\n ${h}\n return ${n.name}(_A(aindices), _B(bindices));\n }`;return{name:n.name,inputNames:["A","B"],inputTypes:[s,s],output:{dims:u,type:o,textureType:s},shaderSource:g,hasMain:c}}const d=(0,a.getGlsl)(e.session.backend.glContext.version),f=`\n ${n.body}\n void main() {\n vec4 v1 = ${d.texture2D}(A, TexCoords);\n vec4 v2 = ${d.texture2D}(B, TexCoords);\n vec4 result = ${n.name}(v1, v2);\n ${d.output} = result;\n }\n `;return{name:n.name,inputNames:["A","B"],inputTypes:[s,s],output:{dims:t[0].dims,type:o,textureType:s},shaderSource:f,hasMain:!0}};t.add=(e,t)=>[e.run(_(e,t,s()),t)],t.and=(e,t)=>[e.run(_(e,t,h(),"bool"),t)],t.div=(e,t)=>[e.run(_(e,t,l()),t)],t.equal=(e,t)=>[e.run(_(e,t,d(),"bool"),t)],t.greater=(e,t)=>[e.run(_(e,t,f(),"bool"),t)],t.less=(e,t)=>[e.run(_(e,t,p(),"bool"),t)],t.mul=(e,t)=>[e.run(_(e,t,u()),t)],t.or=(e,t)=>[e.run(_(e,t,m(),"bool"),t)],t.pow=(e,t)=>[e.run(_(e,t,b()),t)],t.pRelu=(e,t)=>[e.run(_(e,t,y()),t)],t.sub=(e,t)=>[e.run(_(e,t,c()),t)],t.xor=(e,t)=>[e.run(_(e,t,g(),"bool"),t)]},4196:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseCastAttributes=t.cast=void 0;const r=n(2517);t.cast=(e,t,n)=>(o(t),[e.cast(t[0],n)]),t.parseCastAttributes=e=>r.ProtoUtil.tensorDataTypeFromProto(e.attributes.getInt("to"));const o=e=>{if(!e||1!==e.length)throw new Error("Cast requires 1 input.");if("string"===e[0].type)throw new Error("Invalid input type.")}},1163:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createPackedConcatProgramInfoLoader=void 0;const r=n(5060),o=n(2039),a=n(9390),i=n(2827);t.createPackedConcatProgramInfoLoader=(e,t,n)=>{const l=(u=t.length,c=n.cacheKey,{name:"Concat (packed)",inputNames:Array.from({length:u},(e,t)=>`X${t}`),inputTypes:Array(u).fill(o.TextureType.packed),cacheHint:c});var u,c;return Object.assign(Object.assign({},l),{get:()=>((e,t,n,l)=>{const u=n[0].dims.slice();if(l>=u.length||l<-1*u.length)throw new Error("axis specified for concat doesn't match input dimensionality");l<0&&(l=u.length+l);const c=u.slice(0);for(let r=1;r<n.length;r++){const e=n[r].dims.slice();for(let t=0;t<u.length;t++)if(t===l)c[l]+=e[t];else if(u[t]!==e[t])throw new Error("non concat dimensions must match")}const d=c.length,f=(0,i.getChannels)("coords",d),p=(0,a.getCoordsDataType)(d),h=(0,i.unpackFromChannel)(),m=n.map(e=>e.dims),g=(0,a.getGlChannels)(d),b=new Array(m.length-1);b[0]=m[0][l];for(let r=1;r<b.length;r++)b[r]=b[r-1]+m[r][l];const y=g[l],_=g.slice(-2),v=g.join();let w=`if (${y} < ${b[0]}) {\n return getChannel(\n getX0(${v}), vec2(${_.join()}));\n }`;for(let r=1;r<b.length;r++){const e=b[r-1];w+=`\n if (${y} < ${b[r]} && ${y} >= ${b[r-1]}) {\n return getChannel(\n getX${r}(${s(g,y,e)}),\n vec2(${s(_,y,e)}));\n }`}const S=b.length,x=b[b.length-1];w+=`\n return getChannel(\n getX${S}(${s(g,y,x)}),\n vec2(${s(_,y,x)}));`;const T=(0,r.getGlsl)(e.session.backend.glContext.version),E=`\n ${h}\n float getValue(${g.map(e=>"int "+e)}) {\n ${w}\n }\n\n void main() {\n ${p} coords = getOutputCoords();\n int lastDim = coords.${g[d-1]};\n coords.${g[d-1]} = coords.${g[d-2]};\n coords.${g[d-2]} = lastDim;\n\n vec4 result = vec4(getValue(${f}), 0., 0., 0.);\n\n ${f[d-1]} = ${f[d-1]} + 1;\n if (${f[d-1]} < ${c[d-1]}) {\n result.g = getValue(${f});\n }\n\n ${f[d-2]} = ${f[d-2]} + 1;\n if (${f[d-2]} < ${c[d-2]}) {\n result.a = getValue(${f});\n }\n\n ${f[d-1]} = ${f[d-1]} - 1;\n if (${f[d-2]} < ${c[d-2]} &&\n ${f[d-1]} < ${c[d-1]}) {\n result.b = getValue(${f});\n }\n ${T.output} = result;\n }\n `;return Object.assign(Object.assign({},t),{output:{dims:c,type:n[0].type,textureType:o.TextureType.packed},shaderSource:E,hasMain:!0})})(e,l,t,n.axis)})};const s=(e,t,n)=>{const r=e.indexOf(t);return e.map((e,t)=>t===r?`${e} - ${n}`:e).join()}},2069:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseConcatAttributes=t.concat=void 0;const r=n(246),o=n(2039),a=n(1163);t.concat=(e,t,n)=>(d(t),e.session.pack&&t[0].dims.length>1?[e.run((0,a.createPackedConcatProgramInfoLoader)(e,t,n),t)]:[e.run(i(e,t,n),t)]);const i=(e,t,n)=>{const r=(a=t.length,i=n.cacheKey,{name:"Concat",inputNames:Array.from({length:a},(e,t)=>`X${t}`),inputTypes:Array(a).fill(o.TextureType.unpacked),cacheHint:i});var a,i;return Object.assign(Object.assign({},r),{get:()=>((e,t,n,r)=>{const a=n[0].dims.slice();if(r>=a.length||r<-1*a.length)throw new Error("axis specified for concat doesn't match input dimensionality");r<0&&(r=a.length+r);const i=a.slice(0);for(let o=1;o<n.length;o++){const e=n[o].dims.slice();for(let t=0;t<a.length;t++)if(t===r)i[r]+=e[t];else if(a[t]!==e[t])throw new Error("non concat dimensions must match")}const d=i.length,f=new Array(n.length);let p=0;for(let o=0;o<f.length;++o)p+=n[o].dims[r],f[o]=p;let h="";h=n.length<5?s(f):l(f);const m=`\n ${u(n.length,d)}\n ${c(f)}\n ${h}\n float process(int indices[${d}]) {\n int textureIndex = getTextureWhereDataResides (indices[${r}]);\n\n if(textureIndex != 0) {\n indices[${r}] = indices[${r}] - int(getSizeInConcatAxisValueFromIndex(textureIndex-int(1)));\n }\n\n return fetchDataFromCorrectTexture(textureIndex, indices);\n }`;return Object.assign(Object.assign({},t),{output:{dims:i,type:n[0].type,textureType:o.TextureType.unpacked},shaderSource:m})})(0,r,t,n.axis)})},s=e=>`int getTextureWhereDataResides(int index) {\n ${e.map((e,t)=>`if(index<${e}) {return ${t};}\n`).join("")}\n }`,l=e=>s(e),u=(e,t)=>{const n=[`float fetchDataFromCorrectTexture(int textureIndex, int indices[${t}]) {`];for(let r=0;r<e;++r)0===r?n.push(`\tif (textureIndex == ${r}) { return _X${r}(indices); }`):r===e-1?n.push(`\telse { return _X${r}(indices); }`):n.push(`\telse if (textureIndex == ${r}) { return _X${r}(indices); }`);return n.push("\t}"),n.join("\n")},c=e=>{const t=["int getSizeInConcatAxisValueFromIndex(int index) {"];for(let n=0;n<e.length;++n)0===n?t.push(`\tif (index == ${n}) { return ${e[n]}; }`):n===e.length-1?t.push(`\telse { return ${e[n]}; }`):t.push(`\telse if (index == ${n}) { return ${e[n]}; }`);return t.push("\t}"),t.join("\n")};t.parseConcatAttributes=e=>(0,r.createAttributeWithCacheKey)({axis:e.attributes.getInt("axis")});const d=e=>{if(!e||e.length<1)throw new Error("too few inputs");const t=e[0].type,n=e[0].dims.length;if("string"===t)throw new Error("string tensor is not supported yet");for(const r of e){if(r.type!==t)throw new Error("input tensors should be one type");if(r.dims.length!==n)throw new Error("input tensors should have the same shape")}}},4770:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createUnpackedGroupedConvProgramInfoLoader=void 0;const r=n(6231),o=n(5060),a=n(2039),i=n(8138),s=n(2823);t.createUnpackedGroupedConvProgramInfoLoader=(e,t,n)=>{const l=(u=t.length>2,c=n.cacheKey,{name:"GroupedConv",inputNames:u?["X","W","Bias"]:["X","W"],inputTypes:u?[a.TextureType.unpacked,a.TextureType.unpacked,a.TextureType.unpacked]:[a.TextureType.unpacked,a.TextureType.unpacked],cacheHint:c});var u,c;return Object.assign(Object.assign({},l),{get:()=>((e,t,n,l)=>{const u=t.length>2?"value += getBias(output_channel);":"",c=t[0].dims.slice(),d=t[1].dims.slice(),f=d[0]/l.group;r.Logger.verbose("GroupedConv",`autpPad:${l.autoPad}, dilations:${l.dilations}, group:${l.group}, kernelShape:${l.kernelShape}, pads:${l.pads}, strides:${l.strides}`);const p=(0,i.calculateOutputShape)(c,d,l.dilations,l.pads,l.strides),h=(0,o.getGlsl)(e.session.backend.glContext.version),{activationFunction:m,applyActivation:g}=(0,s.getActivationSnippet)(l),b=`\n const ivec2 strides = ivec2(${l.strides[0]}, ${l.strides[1]});\n const ivec2 pads = ivec2(${l.pads[0]}, ${l.pads[1]});\n ${m}\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords.x;\n int output_channel = coords.y;\n ivec2 xRCCorner = coords.zw * strides - pads;\n int group_id = output_channel / ${f};\n\n float value = 0.0;\n for (int wInChannel = 0; wInChannel < ${d[1]}; wInChannel++) {\n int input_channel = group_id * ${d[1]} + wInChannel;\n for (int wHeight = 0; wHeight < ${d[2]}; wHeight++) {\n int xHeight = xRCCorner.x + wHeight * ${l.dilations[0]};\n\n if (xHeight < 0 || xHeight >= ${c[2]}) {\n continue;\n }\n\n for (int wWidth = 0; wWidth < ${d[3]}; wWidth++) {\n int xWidth = xRCCorner.y + wWidth * ${l.dilations[1]};\n if (xWidth < 0 || xWidth >= ${c[3]}) {\n continue;\n }\n\n float xVal = getX(batch, input_channel, xWidth, xHeight);\n float wVal = getW(output_channel, wInChannel, wWidth, wHeight);\n value += xVal*wVal;\n }\n }\n }\n ${u}\n ${g}\n ${h.output} = vec4(value, .0, .0, .0);\n }\n`;return Object.assign(Object.assign({},n),{output:{dims:p,type:t[0].type,textureType:a.TextureType.unpacked},shaderSource:b,hasMain:!0})})(e,t,l,n)})}},1386:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.conv2DPacked=t.conv2DPackedPointwise=void 0;const r=n(8138),o=n(8555),a=n(708);t.conv2DPackedPointwise=(e,t,n)=>{const o=t[0].dims,i=t[1].dims,s=(0,r.calculateOutputShape)(o,i,n.dilations,n.pads,n.strides),l=e.reshapePacked(t[0],[o[1],o[2]*o[3]]),u=e.reshapePacked(t[1],[i[0],i[1]]),c=t.length>2?[u,l,t[2]]:[u,l],d=e.run((0,a.createPackedMatmulProgramInfoLoader)(e,c,n),c);return e.reshapePacked(d,s)},t.conv2DPacked=(e,t,n)=>{const i=t[0].dims,s=t[1].dims,l=(0,r.calculateOutputShape)(i,s,n.dilations,n.pads,n.strides),u=e.run((0,o.createPackedIm2ColProgramInfoLoader)(e,t[0],t[1],l,n),[t[0]]),c=e.reshapePacked(t[1],[s[0],s[1]*s[2]*s[3]]),d=3===t.length?[c,u,t[2]]:[c,u],f=e.run((0,a.createPackedMatmulProgramInfoLoader)(e,d,n),d);return e.reshapePacked(f,l)}},9663:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseConvTransposeAttributes=t.convTranspose=void 0;const r=n(246),o=n(5060),a=n(2039),i=n(2823),s=(e,t,n,r,o,a)=>(e-1)*t+n+(r-1)*o+1-a,l=(e,t,n,r,o)=>{const a=Math.floor(e/2);"SAME_UPPER"===t?(n[r]=a,n[o]=e-a):"SAME_LOWER"===t&&(n[r]=e-a,n[o]=a)};t.convTranspose=(e,t,n)=>(f(t,n),u(e,t,n));const u=(e,t,n)=>{const r=d(n,t);return[c(e,t,r)]},c=(e,t,n)=>e.run(((e,t,n)=>{const r=(s=t.length>2,l=n.cacheKey,{name:"ConvTranspose",inputNames:s?["X","W","B"]:["X","W"],inputTypes:s?[a.TextureType.unpacked,a.TextureType.unpacked,a.TextureType.unpacked]:[a.TextureType.unpacked,a.TextureType.unpacked],cacheHint:l});var s,l;return Object.assign(Object.assign({},r),{get:()=>((e,t,n,r)=>{const s=t.length>2?"getB(output_channel)":"0.0",l=t[0].dims,u=t[1].dims,c=u[1],d=u[0]/r.group,f=[t[0].dims[0],t[1].dims[1]*r.group,...r.outputShape],p=(0,o.getGlsl)(e.session.backend.glContext.version),{activationFunction:h,applyActivation:m}=(0,i.getActivationSnippet)(r),g=`\n const ivec2 strides = ivec2(${r.strides[0]}, ${r.strides[1]});\n const ivec2 pads = ivec2(${r.pads[0]}, ${r.pads[1]});\n ${h}\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords.x;\n int output_channel = coords.y;\n\n ivec2 loc = coords.zw + pads;\n\n int group_id = output_channel / ${c};\n int wOutChannel = output_channel - group_id * ${c};\n\n float value = ${s};\n for (int inChannelOffset = 0; inChannelOffset < ${d}; inChannelOffset++) {\n int input_channel = group_id * ${d} + inChannelOffset;\n for (int wWOff = 0; wWOff < ${u[2]}; wWOff++) {\n for (int wHOff = 0; wHOff < ${u[3]}; wHOff++) {\n ivec2 wOff = ivec2(wWOff * ${r.dilations[0]}, wHOff * ${r.dilations[1]});\n ivec2 wLoc = loc - wOff;\n ivec2 wLocIn = wLoc / strides;\n if (\n wLocIn * strides == wLoc &&\n wLocIn.x >= 0 && wLocIn.x < ${l[2]} &&\n wLocIn.y >= 0 && wLocIn.y < ${l[3]}\n ) {\n float xVal = getX(batch, input_channel, wLocIn.y, wLocIn.x);\n float wVal = getW(input_channel, wOutChannel, wHOff, wWOff);\n value += xVal * wVal;\n }\n }\n }\n }\n ${m}\n ${p.output} = vec4(value, .0, .0, .0);\n }\n`;return Object.assign(Object.assign({},n),{output:{dims:f,type:t[0].type,textureType:a.TextureType.unpacked},shaderSource:g,hasMain:!0})})(e,t,r,n)})})(e,t,n),t),d=(e,t)=>{const n=e.kernelShape.slice();if(0===e.kernelShape.length)for(let i=2;i<t[1].dims.length;++i)n.push(t[1].dims[i]);const r=e.pads.slice(),o=e.outputShape.slice();((e,t,n,r,o,a,i,u)=>{const c=e.length-2,d=0===u.length;for(let f=0;f<c;++f){const p=d?e[f+2]*a[f]:u[f],h=s(e[f+2],a[f],o[f],t[f],n[f],p);l(h,r,o,f,f+c),d&&u.push(a[f]*(e[f+2]-1)+i[f]+(t[f]-1)*n[f]+1-o[f]-o[f+c])}})(t[0].dims,n,e.dilations,e.autoPad,r,e.strides,e.outputPadding,o);const a=Object.assign({},e);return Object.assign(a,{kernelShape:n,pads:r,outputShape:o,cacheKey:e.cacheKey}),a};t.parseConvTransposeAttributes=e=>{const t=e.attributes,n=(0,i.parseInternalActivationAttributes)(t),o=t.getString("auto_pad","NOTSET"),a=t.getInts("dilations",[1,1]),s=t.getInt("group",1),l=t.getInts("kernel_shape",[]),u=t.getInts("output_padding",[0,0]),c=t.getInts("output_shape",[]),d=t.getInts("pads",[0,0,0,0]),f=t.getInts("strides",[1,1]);return(0,r.createAttributeWithCacheKey)(Object.assign({autoPad:o,dilations:a,group:s,kernelShape:l,outputPadding:u,outputShape:c,pads:d,strides:f},n))};const f=(e,t)=>{if(!e||2!==e.length&&3!==e.length)throw new Error("Conv requires 2 or 3 inputs");if(4!==e[0].dims.length||4!==e[1].dims.length)throw new Error("currently only support 2-dimensional conv");if(e[0].dims[1]!==e[1].dims[0])throw new Error("FILTER_IN_CHANNEL should be equal to DATA_CHANNEL");const n=e[1].dims[1]*t.group;if(3===e.length&&(1!==e[2].dims.length||e[2].dims[0]!==n))throw new Error("invalid bias");const r=e[0].dims.length-2;if(t.dilations.length!==r)throw new Error(`dilations should be ${r}D`);if(t.strides.length!==r)throw new Error(`strides should be ${r}D`);if(t.pads.length!==2*r)throw new Error(`pads should be ${2*r}D`);if(t.outputPadding.length!==r)throw new Error(`output_padding should be ${r}D`);if(0!==t.kernelShape.length&&t.kernelShape.length!==e[1].dims.length-2)throw new Error("invalid kernel shape");if(0!==t.outputShape.length&&t.outputShape.length!==e[0].dims.length-2)throw new Error("invalid output shape");if("float32"!==e[0].type||"float32"!==e[1].type)throw new Error("ConvTranspose input(X,W) should be float tensor");if(3===e.length&&"float32"!==e[2].type)throw new Error("ConvTranspose input(bias) should be float tensor")}},8138:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseConvAttributes=t.conv=t.calculateOutputShape=void 0;const r=n(246),o=n(2517),a=n(4770),i=n(1386),s=n(9828),l=n(2823),u=n(3248),c=n(5623);t.calculateOutputShape=(e,t,n,r,o)=>{const a=e[0],i=e.slice(2),s=i.length,l=t[0],u=t.slice(2).map((e,t)=>e+(e-1)*(n[t]-1)),c=i.map((e,t)=>e+r[t]+r[t+s]).map((e,t)=>Math.floor((e-u[t]+o[t])/o[t]));return[a,l].concat(...c)},t.conv=(e,t,n)=>(m(t,n),d(e,t,n));const d=(e,t,n)=>{const r=h(n,t),o=e.session.pack,s=1===r.kernelShape[0]&&1===r.kernelShape[1];return r.group>1?[e.run((0,a.createUnpackedGroupedConvProgramInfoLoader)(e,t,r),t)]:s&&o?[f(e,t,r)]:o&&4===t[0].dims.length&&1===t[0].dims[0]&&!s?[(0,i.conv2DPacked)(e,t,r)]:[p(e,t,r)]},f=(e,n,r)=>{const o=n[0].dims,a=n[1].dims,i=(0,t.calculateOutputShape)(o,a,r.dilations,r.pads,r.strides),s=e.reshapeUnpacked(n[0],[o[1],o[2]*o[3]]),l=e.reshapeUnpacked(n[1],[a[0],a[1]]),u=n.length>2?[l,s,n[2]]:[l,s],d=e.run((0,c.createMatmulProgramInfoLoader)(u,r),u);return e.reshapeUnpacked(d,i)},p=(e,n,r)=>{const o=n[0].dims,a=n[1].dims,i=(0,t.calculateOutputShape)(o,a,r.dilations,r.pads,r.strides),l=e.run((0,u.createIm2ColProgramInfoLoader)(e,n[0],n[1],i,r),[n[0]]),c=3===n.length?[l,n[1],n[2]]:[l,n[1]];return e.run((0,s.createDotProductProgramInfoLoader)(e,n,i,r),c)},h=(e,t)=>{const n=e.kernelShape.slice();if(0===e.kernelShape.length)for(let o=2;o<t[1].dims.length;++o)n.push(t[1].dims[o]);const r=e.pads.slice();o.PoolConvUtil.adjustPadsBasedOnAutoPad(t[0].dims,e.strides,e.dilations,n,r,e.autoPad);const a=Object.assign({},e);return Object.assign(a,{kernelShape:n,pads:r,cacheKey:e.cacheKey}),a};t.parseConvAttributes=e=>{const t=e.attributes,n=(0,l.parseInternalActivationAttributes)(t),o=t.getString("auto_pad","NOTSET"),a=t.getInts("dilations",[1,1]),i=t.getInt("group",1),s=t.getInts("kernel_shape",[]),u=t.getInts("pads",[0,0,0,0]),c=t.getInts("strides",[1,1]);return(0,r.createAttributeWithCacheKey)(Object.assign({autoPad:o,dilations:a,group:i,kernelShape:s,pads:u,strides:c},n))};const m=(e,t)=>{if(!e||2!==e.length&&3!==e.length)throw new Error("Conv requires 2 or 3 inputs");if(4!==e[0].dims.length||4!==e[1].dims.length)throw new Error("currently only support 2-dimensional conv");if(e[0].dims[1]!==e[1].dims[1]*t.group)throw new Error("FILTER_IN_CHANNEL should be equal to DATA_CHANNEL");if(3===e.length&&(1!==e[2].dims.length||e[1].dims[0]!==e[2].dims[0]))throw new Error("invalid bias");const n=e[0].dims.length-2;if(t.dilations.length!==n)throw new Error(`dilations should be ${n}D`);if(t.strides.length!==n)throw new Error(`strides should be ${n}D`);if(t.pads.length!==2*n)throw new Error(`pads should be ${2*n}D`);if(0!==t.kernelShape.length&&t.kernelShape.length!==e[1].dims.length-2)throw new Error("invalid kernel shape");if("float32"!==e[0].type||"float32"!==e[1].type)throw new Error("Conv input(X,W) should be float tensor");if(3===e.length&&"float32"!==e[2].type)throw new Error("Conv input(bias) should be float tensor")}},5193:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseDepthToSpaceAttributes=t.depthToSpace=void 0;const r=n(3738);t.depthToSpace=(e,t,n)=>{o(t);const a=n.blocksize,i=a*a,s="DCR"===n.mode?[0,3,4,1,5,2]:[0,1,4,2,5,3],l="DCR"===n.mode?[t[0].dims[0],a,a,t[0].dims[1]/i,t[0].dims[2],t[0].dims[3]]:[t[0].dims[0],t[0].dims[1]/i,a,a,t[0].dims[2],t[0].dims[3]],u=e.reshapeUnpacked(t[0],l),c={perm:s,cacheKey:`${s}`},[d]=(0,r.transpose)(e,[u],c),f=[t[0].dims[0],t[0].dims[1]/i,t[0].dims[2]*a,t[0].dims[3]*a];return[e.reshapeUnpacked(d,f)]},t.parseDepthToSpaceAttributes=e=>{const t=e.attributes.getInt("blocksize");if(t<1)throw new Error(`blocksize must be >= 1, but got : ${t} for DepthToSpace`);const n=e.attributes.getString("mode","DCR");if("DCR"!==n&&"CRD"!==n)throw new Error(`unrecognized mode: ${n} for DepthToSpace`);return{mode:n,blocksize:t}};const o=e=>{if(1!==e.length)throw new Error(`DepthToSpace expect 1 inputs, but got ${e.length}`);if("string"===e[0].type||4!==e[0].dims.length)throw new TypeError("DepthToSpace input should be a 4-D numeric tensor")}},9828:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createDotProductProgramInfoLoader=void 0;const r=n(2517),o=n(5060),a=n(2039),i=n(2823),s=n(3248);t.createDotProductProgramInfoLoader=(e,t,n,l)=>{const u=(c=t.length>2,d=l,{name:"ConvDotProduct",inputNames:c?["Im2Col","K","B"]:["Im2Col","K"],inputTypes:c?[a.TextureType.unpacked,a.TextureType.packedLastDimension,a.TextureType.unpacked]:[a.TextureType.unpacked,a.TextureType.packedLastDimension],cacheKey:d.activationCacheKey});var c,d;return Object.assign(Object.assign({},u),{get:()=>((e,t,n,l,u)=>{const c=n[0].dims,d=n[1].dims,f=[d[0],Math.ceil(c[1]*d[2]*d[3]/4)],p=(0,s.calculateIm2ColDims)(c,d,l),[h,m]=e.calculateTextureWidthAndHeight(f,a.TextureType.packedLastDimension),g=r.ShapeUtil.computeStrides(p),[b,y]=e.calculateTextureWidthAndHeight(p,a.TextureType.packedLastDimension),_=l.length,v=n.length<3?"0.0":"_B(b)",w=Math.ceil(c[1]*d[2]*d[3]/4),{activationFunction:S,applyActivation:x}=(0,i.getActivationSnippet)(u),T=(0,o.getGlsl)(e.session.backend.glContext.version),E=`\n${S}\nfloat process(int indices[${_}]) {\n int b[1];\n b[0] = indices[1];\n int im2col[4];\n im2col[0] = indices[0];\n im2col[1] = indices[2];\n im2col[2] = indices[3];\n int im2colOffset = im2col[0] * ${g[0]} + im2col[1] * ${g[1]} + im2col[2] * ${g[2]};\n int kernelOffset = indices[1] * ${f[1]};\n float value = ${v};\n for (int i = 0; i < ${w}; ++i) {\n vec2 im2colCoords = offsetToCoords(im2colOffset, ${b}, ${y});\n vec2 kernelCoords = offsetToCoords(kernelOffset, ${h}, ${m});\n value += dot(${T.texture2D}(Im2Col, im2colCoords), ${T.texture2D}(K, kernelCoords));\n ++im2colOffset;\n ++kernelOffset;\n }\n ${x}\n return value;\n}`;return Object.assign(Object.assign({},t),{output:{dims:l,type:n[0].type,textureType:a.TextureType.unpacked},shaderSource:E})})(e,u,t,n,l)})}},7992:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseFlattenAttributes=t.flatten=void 0;const r=n(2517);t.flatten=(e,t,n)=>{o(t,n);const a=r.ShapeUtil.flattenShape(t[0].dims,n);return[e.reshapeUnpacked(t[0],a)]},t.parseFlattenAttributes=e=>e.attributes.getInt("axis",1);const o=(e,t)=>{if(!e||1!==e.length)throw new Error("Flatten requires 1 input.");const n=e[0].dims.length;if(0===n)throw new Error("scalar tensor is not supported.");if(t<-n||t>n)throw new Error("Invalid axis");if("string"===e[0].type)throw new Error("string tensor is not supported.")}},2823:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseInternalActivationAttributes=t.getActivationSnippet=void 0;const r=n(2517),o=n(4909);t.getActivationSnippet=function(e){let t;switch(e.activation){case"Relu":t=(0,o.glslRelu)();break;case"Sigmoid":t=(0,o.glslSigmoid)();break;case"Clip":t=(0,o.glslClip)(e.clipMin,e.clipMax);break;default:return{activationFunction:"",applyActivation:""}}const n=t.name;return{activationFunction:t.body,applyActivation:`value = ${n}_(value);`}},t.parseInternalActivationAttributes=e=>{const t=e.getString("activation","");if("Clip"===t){const[n,o]=e.getFloats("activation_params",[r.MIN_CLIP,r.MAX_CLIP]);return{activation:t,clipMax:o,clipMin:n,activationCacheKey:`${t}:${n},${o}`}}return{activation:t,activationCacheKey:t}}},1253:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseGatherAttributes=t.gather=void 0;const r=n(246),o=n(782),a=n(2517),i=n(2039);t.gather=(e,t,n)=>(u(t,n.axis),[e.run(l(e,t,n),t)]),t.parseGatherAttributes=e=>(0,r.createAttributeWithCacheKey)({axis:e.attributes.getInt("axis",0)});const s={name:"Gather",inputNames:["A","B"],inputTypes:[i.TextureType.unpacked,i.TextureType.unpacked]},l=(e,t,n)=>{const r=Object.assign(Object.assign({},s),{cacheHint:n.cacheKey});return Object.assign(Object.assign({},r),{get:()=>((e,t,n,r)=>{const o=n[0].dims.slice(),s=n[1].dims.slice(),l=new Array(o.length+s.length-1);r=a.ShapeUtil.normalizeAxis(r,o.length);const u=[];for(let a=0;a<l.length;a++)a<r?(l[a]=o[a],u.push(`inputIdx[${a}] = outputIdx[${a}];`)):a<r+s.length?(l[a]=s[a-r],u.push(`indexDataIdx[${a-r}] = outputIdx[${a}];`)):(l[a]=o[a-s.length+1],u.push(`inputIdx[${a-s.length+1}] = outputIdx[${a}];`));const c=`\n float process(int outputIdx[${l.length||1}]) {\n int inputIdx[${o.length}];\n int indexDataIdx[${s.length||1}];\n indexDataIdx[0] = 0;\n ${u.join("\n ")}\n int idx = int(_B(indexDataIdx));\n inputIdx[${r}] = idx < 0 ? idx + ${o[r]} : idx;\n return _A(inputIdx);\n }`;return Object.assign(Object.assign({},t),{output:{dims:l,type:n[0].type,textureType:i.TextureType.unpacked},shaderSource:c})})(0,r,t,n.axis)})},u=(e,t)=>{if(!e||2!==e.length)throw new Error("Gather requires 2 inputs.");const n=e[0].dims.length;if(n<1)throw new Error("Invalid input shape.");if(t<-n||t>n-1)throw new Error("Invalid axis.");if(-1===o.NUMBER_TYPES.indexOf(e[0].type))throw new Error("Invaid input type.");if("int32"!==e[1].type&&"int16"!==e[1].type)throw new Error("Invaid input type.")}},4776:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseGemmAttributesV11=t.parseGemmAttributesV7=t.gemm=void 0;const r=n(246),o=n(2517),a=n(2039);t.gemm=(e,t,n)=>(u(t,n),[e.run(s(t,n),t)]);const i=(e,t)=>{const n=0!==e.attributes.getInt("transA",0),o=0!==e.attributes.getInt("transB",0),a=e.attributes.getFloat("alpha",1),i=e.attributes.getFloat("beta",1);return(0,r.createAttributeWithCacheKey)({transA:n,transB:o,alpha:a,beta:i,isOptionalC:t})};t.parseGemmAttributesV7=e=>i(e,!1),t.parseGemmAttributesV11=e=>i(e,!0);const s=(e,t)=>{const n={name:"Gemm",inputNames:3===e.length?["A","B","C"]:["A","B"],inputTypes:3===e.length?[a.TextureType.unpacked,a.TextureType.unpacked,a.TextureType.unpacked]:[a.TextureType.unpacked,a.TextureType.unpacked],key:t.cacheKey};return Object.assign(Object.assign({},n),{get:()=>l(n,e,t)})},l=(e,t,n)=>{const r=t[0].dims.slice(),i=t[1].dims.slice(),[s,l]=o.GemmUtil.getShapeOfGemmResult(r,n.transA,i,n.transB,3===t.length?t[2].dims:void 0),u=[s,l];if(!u)throw new Error("Can't use gemm on the given tensors");let c=r[r.length-1],d="";n.transA&&(c=r[0]),n.transA&&n.transB?d="value += _A_T(a) * _B_T(b);":n.transA&&!n.transB?d="value += _A_T(a) * _B(b);":!n.transA&&n.transB?d="value += _A(a) * _B_T(b);":n.transA||n.transB||(d="value += _A(a) * _B(b);");const f=u.length,p=`\n float process(int indices[${f}]) {\n int a[${f}];\n int b[${f}];\n ${3===t.length?`int c[${t[2].dims.length}];`:""}\n\n copyVec(indices, a);\n copyVec(indices, b);\n ${3===t.length?"bcastIndices_C(indices, c);":""}\n\n float value = 0.0;\n for (int k=0; k<${c}; ++k) {\n a[${f-1}] = k;\n b[${f-2}] = k;\n ${d}\n }\n\n value = value * alpha;\n ${3===t.length?"value += beta * _C(c);":""}\n return value;\n }`;return Object.assign(Object.assign({},e),{output:{dims:u,type:t[0].type,textureType:a.TextureType.unpacked},variables:[{name:"alpha",type:"float",data:n.alpha},{name:"beta",type:"float",data:n.beta}],shaderSource:p})},u=(e,t)=>{if(!e)throw new Error("Input is missing");if(t.isOptionalC&&(e.length<2||e.length>3))throw new Error("Invaid input shape.");if(!t.isOptionalC&&3!==e.length)throw new Error("Gemm requires 3 inputs");if(3===e.length&&1!==e[2].dims.length&&2!==e[2].dims.length)throw new Error("Invalid input shape of C");if("float32"!==e[0].type&&"float64"!==e[0].type||"float32"!==e[1].type&&"float64"!==e[1].type||3===e.length&&"float32"!==e[2].type&&"float64"!==e[2].type)throw new Error("Invalid input type.");if(e[0].type!==e[1].type||3===e.length&&e[0].type!==e[2].type)throw new Error("Input types are mismatched")}},8555:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createPackedIm2ColProgramInfoLoader=void 0;const r=n(5060),o=n(2039),a=n(2827);t.createPackedIm2ColProgramInfoLoader=(e,t,n,i,s)=>{const l=(u=s.cacheKey,{name:"Im2Col (packed)",inputNames:["A"],inputTypes:[o.TextureType.packed],cacheHint:u});var u;return Object.assign(Object.assign({},l),{get:()=>((e,t,n,i,s,l)=>{const u=n.dims,c=i.dims,d=s.length,f=[c[1]*c[2]*c[3],s[2]*s[3]],p=c[2]*c[3],h=(0,a.unpackFromChannel)(),m=(0,r.getGlsl)(e.session.backend.glContext.version);let g="";for(let r=0;r<=1;r++)for(let e=0;e<=1;e++)g+=`\n blockIndex = rc.x + ${e};\n pos = rc.y + ${r};\n\n if(blockIndex < ${f[1]} && pos < ${f[0]}) {\n offsetY = int(blockIndex / (${s[d-1]})) * ${l.strides[0]} -\n ${l.pads[0]};\n d0 = offsetY + ${l.dilations[0]} * (imod(pos, ${p}) / ${c[2]});\n\n if(d0 < ${u[2]} && d0 >= 0) {\n offsetX = imod(blockIndex, ${s[d-1]}) * ${l.strides[1]} -\n ${l.pads[1]};\n d1 = offsetX + ${l.dilations[1]} * imod(imod(pos, ${p}), ${c[2]});\n\n if(d1 < ${u[3]} && d1 >= 0) {\n\n ch = int(float(pos)/ ${p}.);\n innerDims = vec2(d0, d1);\n result[${2*r+e}] = getChannel(\n getA(0, ch, int(innerDims.x),\n int(innerDims.y)), innerDims);\n }\n }\n }\n\n `;const b=`\n ${h}\n\n void main() {\n ivec2 rc = getOutputCoords();\n vec4 result = vec4(0.0);\n int blockIndex, pos, offsetY, d0, offsetX, d1, ch;\n vec2 innerDims;\n ${g}\n ${m.output} = result;\n }\n `;return Object.assign(Object.assign({},t),{output:{dims:f,type:n.type,textureType:o.TextureType.packed},shaderSource:b,hasMain:!0})})(e,l,t,n,i,s)})}},3248:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.calculateIm2ColDims=t.createIm2ColProgramInfoLoader=void 0;const r=n(2039);t.createIm2ColProgramInfoLoader=(e,n,o,a,i)=>{const s=(l=i.cacheKey,{name:"Im2Col",inputNames:["X"],inputTypes:[r.TextureType.unpacked],cacheHint:l});var l;return Object.assign(Object.assign({},s),{get:()=>((e,n,o,a,i,s)=>{const l=o.dims,u=a.dims,c=i.length,d=(0,t.calculateIm2ColDims)(l,u,i,4),f=`\n const int XC = ${l[1]};\n const int XH = ${l[2]};\n const int XW = ${l[3]};\n const int KH = ${s.kernelShape[0]};\n const int KW = ${s.kernelShape[1]};\n const int dilationH = ${s.dilations[0]};\n const int dilationW = ${s.dilations[1]};\n const int strideH = ${s.strides[0]};\n const int strideW = ${s.strides[1]};\n const int padH = ${s.pads[0]};\n const int padW = ${s.pads[1]};\n const int KHKW = KH*KW;\n const int XCKHKW = XC * KHKW;\n const int outputChannels = 4;\n vec4 process(int indices[${c}]) {\n int b = indices[0]; // batch size\n int oh = indices[1] * strideH - padH; //output height\n int ow = indices[2] * strideW - padW; //output width\n int p = indices[3] * outputChannels; //patch\n vec4 value = vec4(0.0);\n for(int i=0; i < outputChannels; ++i) {\n if(p < XCKHKW) {\n int patchC = p / KHKW;\n int patchH = (p - patchC*KHKW) / KW;\n int patchW = (p - patchC*KHKW) - patchH * KW;\n int xh2 = oh + patchH * dilationH;\n int xw2 = ow + patchW * dilationW;\n int x[${l.length}];\n x[0] = b;\n x[1] = patchC;\n x[2] = xh2;\n x[3] = xw2;\n if(xh2 >= 0 &&\n xh2 < XH &&\n xw2 >= 0 &&\n xw2 < XW) {\n value[i] = _X(x);\n }\n }\n ++p;\n }\n return value;\n }\n `;return Object.assign(Object.assign({},n),{output:{dims:d,type:o.type,textureType:r.TextureType.packedLastDimension},shaderSource:f})})(0,s,n,o,a,i)})},t.calculateIm2ColDims=(e,t,n,r=4)=>[n[0],n[2],n[3],Math.ceil(e[1]*t[2]*t[3]/r)]},6572:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseImageScalerAttributes=t.imageScaler=void 0;const r=n(246),o=n(2039);t.imageScaler=(e,t,n)=>(l(t),[e.run(i(e,t,n),t)]),t.parseImageScalerAttributes=e=>{const t=e.attributes.getFloat("scale"),n=e.attributes.getFloats("bias");return(0,r.createAttributeWithCacheKey)({scale:t,bias:n})};const a={name:"ImageScaler",inputNames:["X"],inputTypes:[o.TextureType.unpacked]},i=(e,t,n)=>{const r=Object.assign(Object.assign({},a),{cacheHint:n.cacheKey});return Object.assign(Object.assign({},r),{get:()=>((e,t,n,r)=>{const a=n[0].dims.slice(),i=a.length,l=`\n ${s(r.bias.length)}\n float process(int indices[${i}]) {\n return _X(indices) * scale + getBias(bias, indices[1]);\n }`;return Object.assign(Object.assign({},t),{output:{dims:a,type:n[0].type,textureType:o.TextureType.unpacked},variables:[{name:"bias",type:"float",arrayLength:r.bias.length,data:r.bias},{name:"scale",type:"float",data:r.scale}],shaderSource:l})})(0,r,t,n)})},s=e=>{const t=[`float getBias(float bias[${e}], int channel) {`];for(let n=0;n<e;++n)0===n?t.push(`\tif (channel == ${n}) { return bias[${n}]; }`):n===e-1?t.push(`\telse { return bias[${n}]; }`):t.push(`\telse if (channel == ${n}) { return bias[${n}]; }`);return t.push("\t}"),t.join("\n")},l=e=>{if(!e||1!==e.length)throw new Error("ImageScaler requires 1 input.");if(4!==e[0].dims.length)throw new Error("Invalid input shape.");if("float32"!==e[0].type&&"float64"!==e[0].type)throw new Error("Invalid input type.")}},3346:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseInstanceNormalizationAttributes=t.instanceNormalization=void 0;const r=n(5060),o=n(2039);t.instanceNormalization=(e,t,n)=>{u(t);const r=e.run(i(t[0]),t);return[e.run(l(e,t[0],n,r.dims),[t[0],r,t[1],t[2]])]},t.parseInstanceNormalizationAttributes=e=>e.attributes.getFloat("epsilon",1e-5);const a={name:"InstanceNormalization_MeanAndVariance",inputNames:["X"],inputTypes:[o.TextureType.unpacked]},i=e=>Object.assign(Object.assign({},a),{get:()=>((e,t)=>{const n=t.dims.slice(),r=n[1],a=n[2]*n[3],i=[n[0],r],s=`\n vec4 process(int[2] indices) {\n vec4 v = vec4(0.0);\n int a[4];\n a[0] = indices[0];\n a[1] = indices[1];\n float temp = 0.0;\n for(int a2=0; a2<${n[2]}; a2++) {\n a[2] = a2;\n for(int a3=0; a3<${n[3]}; a3++) {\n a[3] = a3;\n float x = _X(a);\n temp += x;\n }\n }\n float mean = temp / float(${a});\n temp = 0.0;\n for(int a2=0; a2<${n[2]}; a2++) {\n a[2] = a2;\n for(int a3=0; a3<${n[3]}; a3++) {\n a[3] = a3;\n float x = _X(a);\n temp += (x - mean) * (x - mean);\n }\n }\n v.r = mean;\n v.g = temp / float(${a});\n\n return v;\n }`;return Object.assign(Object.assign({},e),{output:{dims:i,type:t.type,textureType:o.TextureType.packedLastDimension},shaderSource:s})})(a,e)}),s={name:"InstanceNormalization_ComputeOutput",inputNames:["X","MeanAndVariance","Scale","B"],inputTypes:[o.TextureType.unpacked,o.TextureType.packedLastDimension,o.TextureType.unpacked,o.TextureType.unpacked]},l=(e,t,n,a)=>{const i=Object.assign(Object.assign({},s),{cacheHint:`${n}`});return Object.assign(Object.assign({},i),{get:()=>((e,t,n,a,i)=>{const s=(0,r.getGlsl)(e.session.backend.glContext.version),[l,u]=e.calculateTextureWidthAndHeight(i,o.TextureType.packedLastDimension),[c,d]=[l/4,u],f=`\n vec4 get_MeanAndVariance(int[2] mv) {\n int offset = indicesToOffset_MeanAndVariance(mv);\n vec2 coords = offsetToCoords(offset, ${c}, ${d});\n return ${s.texture2D}(MeanAndVariance, coords);\n }\n\n float process(int[4] indices) {\n int mv[2];\n mv[0] = indices[0];\n mv[1] = indices[1];\n vec4 mean_and_variance = get_MeanAndVariance(mv);\n float mean = mean_and_variance.r;\n float variance = mean_and_variance.g;\n\n int sb[1];\n sb[0] = indices[1];\n float scale = _Scale(sb);\n float b = _B(sb);\n\n return scale * (_X(indices) - mean) / sqrt(variance + epsilon) + b;\n }`;return Object.assign(Object.assign({},t),{output:{dims:n.dims,type:n.type,textureType:o.TextureType.unpacked},variables:[{name:"epsilon",type:"float",data:a}],shaderSource:f})})(e,i,t,n,a)})},u=e=>{if(!e||3!==e.length)throw new Error("InstanceNormalization requires 3 inputs.");const t=e[0],n=e[1],r=e[2];if(t.dims.length<3||1!==n.dims.length||1!==r.dims.length)throw new Error("Invalid input shape.");if(n.dims[0]!==t.dims[1]||r.dims[0]!==t.dims[1])throw new Error("Input shapes are mismatched.");if("float32"!==t.type&&"float64"!==t.type||"float32"!==n.type&&"float64"!==n.type||"float32"!==r.type&&"float64"!==r.type)throw new Error("Invalid input type.");if(4!==e[0].dims.length)throw new Error("Only support 4-D input shape.")}},708:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createPackedMatmulProgramInfoLoader=void 0;const r=n(2517),o=n(5060),a=n(2039),i=n(9390),s=n(2823),l=n(5623);t.createPackedMatmulProgramInfoLoader=(e,t,n)=>{const u=(c=t.length>2,d=n.activationCacheKey,{name:"MatMul (packed)",inputNames:c?["A","B","Bias"]:["A","B"],inputTypes:c?[a.TextureType.packed,a.TextureType.packed,a.TextureType.packed]:[a.TextureType.packed,a.TextureType.packed],cacheHint:d});var c,d;return Object.assign(Object.assign({},u),{get:()=>((e,t,n,u)=>{const c=n.length>2,d=c?"value += getBiasForMatmul();":"",f=n[0].dims,p=n[1].dims,h=r.BroadcastUtil.calcShape(f,p,!0),m=!r.ShapeUtil.areEqual(n[0].dims,n[1].dims);if(!h)throw new Error("Can't use matmul on the given tensors");const g=f[f.length-1],b=Math.ceil(g/2),y=f.length,_=p.length,v=(0,o.getGlsl)(e.session.backend.glContext.version),w=(0,i.getCoordsDataType)(h.length),S=h.length,x=(0,i.getGlChannels)(),{activationFunction:T,applyActivation:E}=(0,s.getActivationSnippet)(u),k=c?`${(0,l.getBiasForMatmul)(w,x,n[2].dims,h,!0)}`:"",P=m?`${function(e,t,n,o){let a=[],i=[];const s=n[0].dims,l=n[1].dims,u=s.length,c=l.length,d=o.length,f=d-u,p=d-c;a=s.map((e,n)=>`coords.${t[n+f]}`),a[u-1]="i*2",a.join(", "),i=l.map((e,n)=>`coords.${t[n+p]}`),i[c-2]="i*2",i.join(", ");const h=r.BroadcastUtil.getBroadcastDims(s,o),m=r.BroadcastUtil.getBroadcastDims(l,o),g=h.map(e=>`coords.${t[e+f]} = 0;`).join("\n"),b=m.map(e=>`coords.${t[e+p]} = 0;`).join("\n"),y=`int lastDim = coords.${t[d-1]};\n coords.${t[d-1]} = coords.${t[d-2]};\n coords.${t[d-2]} = lastDim;`;return`\nvec4 getAAtOutCoordsMatmul(int i) {\n ${e} coords = getOutputCoords();\n ${y}\n ${g}\n vec4 outputValue = getA(${a});\n return outputValue;\n}\n\nvec4 getBAtOutCoordsMatmul(int i) {\n ${e} coords = getOutputCoords();\n ${y}\n ${b}\n vec4 outputValue = getB(${i});\n return outputValue;\n}`}(w,x,n,h)}`:"",O=m?"getAAtOutCoordsMatmul(i)":`getA(${function(e,t){let n="";for(let r=0;r<t-2;r++)n+=`rc.${e[r]}, `;return n+=`rc.${e[t-2]}, i*2`,n}(x,y)})`,A=m?"getBAtOutCoordsMatmul(i)":`getB(${function(e,t){let n="";for(let r=0;r<t-2;r++)n+=`rc.${e[r]}, `;return n+=`i*2, rc.${e[t-1]}`,n}(x,_)})`,$=`\n ${P}\n ${k}\n ${T}\n void main() {\n ${m?"":`${w} rc =\n getOutputCoords(); int lastDim = rc.${x[S-1]}; rc.${x[S-1]} =\n rc.${x[S-2]}; rc.${x[S-2]} = lastDim;\n `}\n\n vec4 value = vec4(0);\n for (int i = 0; i < ${b}; i++) {\n vec4 a = ${O};\n vec4 b = ${A};\n\n value += (a.rrbb * b.rgrg);\n value += (a.ggaa * b.baba);\n }\n ${d}\n ${E}\n ${v.output} = value;\n }`;return Object.assign(Object.assign({},t),{output:{dims:h,type:n[0].type,textureType:a.TextureType.packed},shaderSource:$,hasMain:!0})})(e,u,t,n)})}},5623:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getBiasForMatmul=t.createMatmulProgramInfoLoader=t.parseMatMulAttributes=t.matMul=void 0;const r=n(2517),o=n(2039),a=n(9390),i=n(2823),s=n(708);function l(e,t){const n=(s=e.length>2,l=t.activationCacheKey,{name:"MatMul",inputNames:s?["A","B","Bias"]:["A","B"],inputTypes:s?[o.TextureType.unpacked,o.TextureType.unpacked,o.TextureType.unpacked]:[o.TextureType.unpacked,o.TextureType.unpacked],cacheHint:l});var s,l;return Object.assign(Object.assign({},n),{get:()=>function(e,t,n){const s=t[0].dims,l=t[1].dims,u=r.BroadcastUtil.calcShape(s,l,!0);if(!u)throw new Error("Can't use matmul on the given tensors");const d=(0,a.getCoordsDataType)(u.length),f=(0,a.getGlChannels)(),{activationFunction:p,applyActivation:h}=(0,i.getActivationSnippet)(n),m=t.length>2,g=m?"value += getBiasForMatmul();":"",b=m?`${c(d,f,t[2].dims,u,!1)}`:"",y=u.length,_=s.length,v=l.length,w=`\n ${p}\n ${b}\n float process(int indices[${y}]) {\n int a[${_}];\n int b[${v}];\n bcastMatmulIndices_A(indices, a);\n bcastMatmulIndices_B(indices, b);\n\n float value;\n for (int k=0; k<${s[s.length-1]}; ++k) {\n a[${_-1}] = k;\n b[${v-2}] = k;\n value += _A(a) * _B(b);\n }\n ${g}\n ${h}\n return value;\n }`;return Object.assign(Object.assign({},e),{output:{dims:u,type:t[0].type,textureType:o.TextureType.unpacked},shaderSource:w})}(n,e,t)})}t.matMul=(e,t,n)=>(u(t),e.session.pack?[e.run((0,s.createPackedMatmulProgramInfoLoader)(e,t,n),t)]:[e.run(l(t,n),t)]),t.parseMatMulAttributes=e=>(0,i.parseInternalActivationAttributes)(e.attributes),t.createMatmulProgramInfoLoader=l;const u=e=>{if(!e||2!==e.length)throw new Error("MatMul requires 2 inputs.");if(e[0].dims[e[0].dims.length-1]!==e[1].dims[e[1].dims.length-2])throw new Error("shared dimension does not match.");if("float32"!==e[0].type&&"float64"!==e[0].type||"float32"!==e[1].type&&"float64"!==e[1].type)throw new Error("inputs should be float type");if(e[0].type!==e[1].type)throw new Error("inputs types should match")};function c(e,t,n,o,a){let i="";const s=n.length,l=o.length,u=l-s;i=l<2&&s>0?"coords":n.map((e,n)=>`coords.${t[n+u]}`).join(", ");const c=r.BroadcastUtil.getBroadcastDims(n,o).map(e=>`coords.${t[e+u]} = 0;`).join("\n");let d="vec4(outputValue.xx, outputValue.yy)";return 1===r.ShapeUtil.size(n)&&(d="vec4(outputValue.x)"),a?`\nvec4 getBiasForMatmul() {\n ${e} coords = getOutputCoords();\n ${c}\n vec4 outputValue = getBias(${i});\n return ${d};\n}`:`\nfloat getBiasForMatmul() {\n ${e} coords = getOutputCoords();\n ${c}\n return getBias(coords.x);\n}`}t.getBiasForMatmul=c},2403:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createPackProgramInfoLoader=void 0;const r=n(5060),o=n(2039),a=n(9390),i=n(2827),s={name:"pack",inputNames:["A"],inputTypes:[o.TextureType.unpackedReversed]};t.createPackProgramInfoLoader=(e,t)=>Object.assign(Object.assign({},s),{get:()=>((e,t)=>{const n=(0,r.getGlsl)(e.session.backend.glContext.version),l=t.dims,u=l.length,c=t.dims.length,d=(0,a.getCoordsDataType)(c),f=(0,i.getChannels)("rc",c),p=(h=c,m=f,g=l[l.length-2],b=l[l.length-1],0===h||1===h?"":`\n int r = ${m[h-2]};\n int c = ${m[h-1]};\n int rp1 = ${m[h-2]} + 1;\n int cp1 = ${m[h-1]} + 1;\n bool rEdge = rp1 >= ${b};\n bool cEdge = cp1 >= ${g};\n `);var h,m,g,b;let y;y=0===u?[1,1]:1===u?[l[0],1]:[l[c-1],l[c-2]];const _=function(e,t,n){if(0===e)return"false";if(1===e)return`rc > ${t[0]}`;let r="";for(let o=e-2;o<e;o++)r+=`${n[o]} >= ${t[o-e+2]}`,o<e-1&&(r+="||");return r}(c,y,f),v=function(e,t){const n=e.length;if(0===n)return"getA(), 0, 0, 0";if(1===n)return`getA(rc),\n rc + 1 >= ${e[0]} ? 0. : getA(rc + 1),\n 0, 0`;let r="";if(n>2)for(let o=0;o<n-2;++o)r+=`${t[o]},`;return`getA(${r}r, c),\n rEdge ? 0. : getA(${r}rp1, c),\n cEdge ? 0. : getA(${r}r, cp1),\n rEdge || cEdge ? 0. : getA(${r}rp1, cp1)`}(l,f),w=`\n void main() {\n ${d} rc = getOutputCoords();\n\n if(${_}) {\n ${n.output} = vec4(0);\n } else {\n ${p}\n\n ${n.output} = vec4(${v});\n }\n }\n `;return Object.assign(Object.assign({},s),{hasMain:!0,output:{dims:t.dims,type:t.type,textureType:o.TextureType.packed},shaderSource:w})})(e,t)})},2827:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.unpackFromChannel=t.getChannels=t.getVecChannels=void 0;const r=n(9390);function o(e,t){return(0,r.getGlChannels)(t).map(t=>`${e}.${t}`)}t.getVecChannels=o,t.getChannels=function(e,t){return 1===t?[e]:o(e,t)},t.unpackFromChannel=function(){return"\n float getChannel(vec4 frag, int dim) {\n int modCoord = imod(dim, 2);\n return modCoord == 0 ? frag.r : frag.g;\n }\n\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 "}},2870:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parsePadAttributesV11=t.padV11=t.parsePadAttributesV2=t.padV2=void 0;const r=n(246),o=n(2517),a=n(5060),i=n(2039),s={name:"Pad",inputNames:["A"],inputTypes:[i.TextureType.unpacked]};t.padV2=(e,t,n)=>(c(t),[e.run(Object.assign(Object.assign({},s),{cacheHint:n.cacheKey,get:()=>u(e,t[0],n)}),t)]),t.parsePadAttributesV2=e=>{const t=e.attributes.getString("mode","constant"),n=e.attributes.getFloat("value",0),o=e.attributes.getInts("pads");return(0,r.createAttributeWithCacheKey)({mode:t,value:n,pads:o})},t.padV11=(e,n,r)=>{d(n);const o=l(e,n,r);return(0,t.padV2)(e,[n[0]],o)},t.parsePadAttributesV11=e=>e.attributes.getString("mode","constant");const l=(e,t,n)=>{if(!e.session.isInitializer(t[1].dataId)||t.length>=3&&!e.session.isInitializer(t[2].dataId))throw new Error("dynamic pad attributes are not allowed");const o=Array.from(t[1].integerData),a=t.length>=3?t[2].floatData[0]:0;return(0,r.createAttributeWithCacheKey)({mode:n,pads:o,value:a})},u=(e,t,n)=>{const r=o.ShapeUtil.padShape(t.dims.slice(),n.pads),a=r.length,s=`\n ${f(e,t,n)}\n float process(int[${a}] indices) {\n return padA(indices);\n }`;return{name:"Pad",inputNames:["A"],inputTypes:[i.TextureType.unpacked],output:{dims:r,type:t.type,textureType:i.TextureType.unpacked},shaderSource:s}},c=e=>{if(!e||1!==e.length)throw new Error("Pad requires 1 input");if("float32"!==e[0].type&&"float64"!==e[0].type)throw new Error("Invalid input type.")},d=e=>{if(!e||2!==e.length&&3!==e.length)throw new Error("Pad requires 2 or 3 inputs");if("int32"!==e[1].type)throw new Error("Invalid input type.");if(e.length>=3&&"string"===e[2].type)throw new Error("Invalid input type.")},f=(e,t,n)=>{const r=(0,a.getGlsl)(e.session.backend.glContext.version),[s,l]=e.calculateTextureWidthAndHeight(t.dims,i.TextureType.unpacked),u=o.ShapeUtil.computeStrides(t.dims);switch(n.mode){case"constant":return p(r,t.dims,u,s,l,n.pads,n.value);case"reflect":return h(r,t.dims,u,s,l,n.pads);case"edge":return m(r,t.dims,u,s,l,n.pads);default:throw new Error("Invalid mode")}},p=(e,t,n,r,o,a,i)=>{const s=t.length;let l="";for(let u=s-1;u>=0;--u)l+=`\n k = m[${u}] - ${a[u]};\n if (k < 0) return constant;\n if (k >= ${t[u]}) return constant;\n offset += k * ${n[u]};\n `;return`\n float padA(int m[${s}]) {\n const float constant = float(${i});\n int offset = 0;\n int k = 0;\n ${l}\n vec2 coords = offsetToCoords(offset, ${r}, ${o});\n float value = getColorAsFloat(${e.texture2D}(A, coords));\n return value;\n }\n `},h=(e,t,n,r,o,a)=>{const i=t.length;let s="";for(let l=i-1;l>=0;--l)s+=`\n k = m[${l}] - ${a[l]};\n if (k < 0) { k = -k; }\n {\n const int _2n_1 = ${2*(t[l]-1)};\n k = int( mod( float(k), float(_2n_1) ) ) ;\n if(k >= ${t[l]}) { k = _2n_1 - k; }\n }\n offset += k * ${n[l]};\n `;return`\n float padA(int m[${i}]) {\n int offset = 0;\n int k = 0;\n ${s}\n vec2 coords = offsetToCoords(offset, ${r}, ${o});\n float value = getColorAsFloat(${e.texture2D}(A, coords));\n return value;\n }\n `},m=(e,t,n,r,o,a)=>{const i=t.length;let s="";for(let l=i-1;l>=0;--l)s+=`\n k = m[${l}] - ${a[l]};\n if (k < 0) k = 0;\n if (k >= ${t[l]}) k = ${t[l]-1};\n offset += k * ${n[l]};\n `;return`\n float padA(int m[${i}]) {\n int offset = 0;\n int k = 0;\n ${s}\n vec2 coords = offsetToCoords(offset, ${r}, ${o});\n float value = getColorAsFloat(${e.texture2D}(A, coords));\n return value;\n }\n `}},2143:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.globalMaxPool=t.parseMaxPoolAttributes=t.maxPool=t.parseGlobalAveragePoolAttributes=t.globalAveragePool=t.parseAveragePoolAttributes=t.averagePool=void 0;const r=n(246),o=n(2517),a=n(2039);t.averagePool=(e,t,n)=>{d(t);const r={name:"AveragePool",inputNames:["X"],inputTypes:[a.TextureType.unpacked],cacheHint:n.cacheKey};return[e.run(Object.assign(Object.assign({},r),{get:()=>i(t,r,!1,n)}),t)]},t.parseAveragePoolAttributes=e=>{const t=e.attributes.getString("auto_pad","NOTSET"),n=e.attributes.getInt("ceil_mode",0),o=0!==e.attributes.getInt("count_include_pad",0),a=e.attributes.getInts("kernel_shape"),i=e.attributes.getInts("strides",[]),s=e.attributes.getInts("pads",[]);if(0!==n)throw new Error("using ceil() in shape computation is not yet supported for AveragePool");return(0,r.createAttributeWithCacheKey)({autoPad:t,ceilMode:n,countIncludePad:o,kernelShape:a,strides:i,pads:s})};const i=(e,t,n,r)=>{const[i,s]=l(e,r,n),u=o.ShapeUtil.size(i.kernelShape);let c="";i.countIncludePad?c+=`value /= float(${u});`:c+=`value /= float(${u} - pad);`;const d=`\n ${f(e[0].dims,i,"value += _X(x);",c,"0.0")}\n `;return Object.assign(Object.assign({},t),{output:{dims:s,type:e[0].type,textureType:a.TextureType.unpacked},shaderSource:d})};t.globalAveragePool=(e,t,n)=>{d(t);const r={name:"GlobalAveragePool",inputNames:["X"],inputTypes:[a.TextureType.unpacked],cacheHint:`${n.countIncludePad}`};return[e.run(Object.assign(Object.assign({},r),{get:()=>i(t,r,!0,n)}),t)]},t.parseGlobalAveragePoolAttributes=e=>{const t=0!==e.attributes.getInt("count_include_pad",0);return(0,r.createAttributeWithCacheKey)({autoPad:"",ceilMode:0,countIncludePad:t,kernelShape:[],strides:[],pads:[]})},t.maxPool=(e,t,n)=>{d(t);const r={name:"MaxPool",inputNames:["X"],inputTypes:[a.TextureType.unpacked],cacheHint:n.cacheKey};return[e.run(Object.assign(Object.assign({},r),{get:()=>s(t,r,!1,n)}),t)]},t.parseMaxPoolAttributes=e=>{const t=e.attributes.getString("auto_pad","NOTSET"),n=e.attributes.getInt("ceil_mode",0),o=e.attributes.getInts("kernel_shape"),a=e.attributes.getInts("strides",[]),i=e.attributes.getInts("pads",[]),s=e.attributes.getInt("storage_order",0),l=e.attributes.getInts("dilations",[]);if(0!==s)throw new Error("column major storage order is not yet supported for MaxPool");if(0!==n)throw new Error("using ceil() in shape computation is not yet supported for MaxPool");return(0,r.createAttributeWithCacheKey)({autoPad:t,ceilMode:n,countIncludePad:!1,kernelShape:o,strides:a,pads:i,storageOrder:s,dilations:l})};const s=(e,t,n,r)=>{const[o,i]=l(e,r,n),s=`\n ${f(e[0].dims,o,"\n value = max(_X(x), value);\n ","","-1e5")}\n `;return Object.assign(Object.assign({},t),{output:{dims:i,type:e[0].type,textureType:a.TextureType.unpacked},shaderSource:s})},l=(e,t,n)=>{const r=e[0].dims.slice(),a=Object.hasOwnProperty.call(t,"dilations"),i=t.kernelShape.slice(),s=t.strides.slice(),l=a?t.dilations.slice():[],u=t.pads.slice();o.PoolConvUtil.adjustPoolAttributes(n,r,i,s,l,u);const c=o.PoolConvUtil.computePoolOutputShape(n,r,s,l,i,u,t.autoPad),d=Object.assign({},t);return a?Object.assign(d,{kernelShape:i,strides:s,pads:u,dilations:l,cacheKey:t.cacheKey}):Object.assign(d,{kernelShape:i,strides:s,pads:u,cacheKey:t.cacheKey}),[d,c]},u={autoPad:"",ceilMode:0,countIncludePad:!1,kernelShape:[],strides:[],pads:[],storageOrder:0,dilations:[],cacheKey:""},c={name:"GlobalMaxPool",inputNames:["X"],inputTypes:[a.TextureType.unpacked]};t.globalMaxPool=(e,t)=>(d(t),[e.run(Object.assign(Object.assign({},c),{get:()=>s(t,c,!0,u)}),t)]);const d=e=>{if(!e||1!==e.length)throw new Error("Pool ops requires 1 input.");if("float32"!==e[0].type&&"float64"!==e[0].type)throw new Error("Invalid input type.")},f=(e,t,n,r,a)=>{const i=e.length;if(t.kernelShape.length<=2){const o=t.kernelShape[t.kernelShape.length-1],s=t.strides[t.strides.length-1],l=t.pads[t.pads.length/2-1],u=t.pads[t.pads.length-1],c=e[i-1];let d="",f="",p="";if(d=l+u!==0?`\n for (int i = 0; i < ${o}; i++) {\n x[${i} - 1] = indices[${i} - 1] * ${s} - ${l} + i;\n if (x[${i} - 1] < 0 || x[${i} - 1] >= ${c}) {\n pad++;\n continue;\n }\n ${n}\n }`:`\n for (int i = 0; i < ${o}; i++) {\n x[${i} - 1] = indices[${i} - 1] * ${s} - ${l} + i;\n ${n}\n }`,2===t.kernelShape.length){const n=t.kernelShape[t.kernelShape.length-2],r=t.strides[t.strides.length-2],a=t.pads[t.pads.length/2-2],s=t.pads[t.pads.length-2],l=e[i-2];f=a+s!==0?`\n for (int j = 0; j < ${n}; j++) {\n x[${i} - 2] = indices[${i} - 2] * ${r} - ${a} + j;\n if (x[${i} - 2] < 0 || x[${i} - 2] >= ${l}) {\n pad+= ${o};\n continue;\n }\n `:`\n for (int j = 0; j < ${n}; j++) {\n x[${i} - 2] = indices[${i} - 2] * ${r} - ${a} + j;\n `,p="\n }\n "}return`\n float process(int indices[${i}]) {\n int x[${i}];\n copyVec(indices, x);\n\n float value = ${a};\n int pad = 0;\n ${f}\n ${d}\n ${p}\n ${r}\n return value;\n }\n `}{const s=o.ShapeUtil.size(t.kernelShape),l=o.ShapeUtil.computeStrides(t.kernelShape),u=l.length,c=t.pads.length,d=h(u),f=p(e,"inputDims"),m=p(t.pads,"pads"),g=p(l,"kernelStrides"),b=p(t.strides,"strides");let y="";return y=t.pads.reduce((e,t)=>e+t)?`\n if (x[j] >= inputDims[j] || x[j] < 0) {\n pad++;\n isPad = true;\n break;\n }\n }\n if (!isPad) {\n ${n}\n }`:`\n }\n ${n}\n `,`\n ${d}\n float process(int indices[${i}]) {\n int x[${i}];\n copyVec(indices, x);\n int offset[${u}];\n int pads[${c}];\n int inputDims[${i}];\n int kernelStrides[${u}];\n int strides[${u}];\n ${m}\n ${f}\n ${b}\n ${g}\n\n float value = ${a};\n int pad = 0;\n bool isPad = false;\n for (int i = 0; i < ${s}; i++) {\n offsetToIndices(i, kernelStrides, offset);\n isPad = false;\n for (int j = ${i} - ${u}; j < ${i}; j++) {\n x[j] = indices[j] * strides[j - ${i} + ${u}]\n + offset[j - ${i} + ${u}] - pads[j - 2];\n ${y}\n }\n ${r}\n\n return value;\n }\n `}},p=(e,t)=>{let n="";for(let r=0;r<e.length;r++)n+=`\n ${t}[${r}] = ${e[r]};\n `;return n},h=e=>`\n void offsetToIndices(int offset, int[${e}] strides, out int[${e}] indices) {\n if (${e} == 0) {\n return;\n }\n for (int i = 0; i < ${e} - 1; ++i) {\n indices[i] = offset / strides[i];\n offset -= indices[i] * strides[i];\n }\n indices[${e} - 1] = offset;\n }`},4939:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.reduceLogSumSquare=t.reduceLogSum=t.reduceProd=t.reduceMin=t.reduceMax=t.reduceMean=t.reduceSum=t.parseReduceAttributes=void 0;const r=n(246),o=n(782),a=n(2517),i=n(2039),s=(e,t,n,r,o)=>{u(t);const a={name:r,inputNames:["A"],inputTypes:[i.TextureType.unpacked]};return[e.run(Object.assign(Object.assign({},a),{cacheHint:n.cacheKey,get:()=>l(e,t,n,r,o,a)}),t)]};t.parseReduceAttributes=e=>{const t=e.attributes.getInts("axes",[]),n=1===e.attributes.getInt("keepdims",1);return(0,r.createAttributeWithCacheKey)({axes:t,keepDims:n})};const l=(e,t,n,r,o,s)=>{const l=[],u=t[0].dims.length||1,c=[],d=a.ShapeUtil.normalizeAxes(n.axes,t[0].dims.length),f=o(t,d);let p=f[1];for(let a=0;a<t[0].dims.length;a++)d.indexOf(a)>=0||0===d.length?(n.keepDims&&l.push(1),p=`\n for(int j${a} = 0; j${a} < ${t[0].dims[a]}; j${a}++) {\n inputIdx[${a}] = j${a};\n ${p}\n }`):(c.push(`inputIdx[${a}] = outputIdx[${l.length}];`),l.push(t[0].dims[a]));const h=`\n float process(int outputIdx[${l.length||1}]) {\n float value; // final result\n int inputIdx[${u}]; // addressing input data\n ${c.join("\n")}\n ${f[0]} // init ops for reduce max/min\n ${p}\n ${f[2]} // final computation for reduce mean\n return value;\n }`;return Object.assign(Object.assign({},s),{output:{dims:l,type:t[0].type,textureType:i.TextureType.unpacked},shaderSource:h})},u=e=>{if(!e||1!==e.length)throw new Error("Reduce op requires 1 input.");if(-1===o.NUMBER_TYPES.indexOf(e[0].type))throw new Error("Invalid input type.")};t.reduceSum=(e,t,n)=>s(e,t,n,"ReduceSum",()=>["value = 0.0;","value += _A(inputIdx);",""]),t.reduceMean=(e,t,n)=>s(e,t,n,"ReduceMean",(e,t)=>{let n=1;for(let r=0;r<e[0].dims.length;r++)(t.indexOf(r)>=0||0===t.length)&&(n*=e[0].dims[r]);return["value = 0.0;","value += _A(inputIdx);",`value /= ${n}.;`]}),t.reduceMax=(e,t,n)=>s(e,t,n,"ReduceMax",(e,t)=>{const n=[];for(let r=0;r<e[0].dims.length;r++)(t.indexOf(r)>=0||0===t.length)&&n.push(`inputIdx[${r}] = 0;`);return[`${n.join("\n")}\nvalue = _A(inputIdx);`,"value = max(value, _A(inputIdx));",""]}),t.reduceMin=(e,t,n)=>s(e,t,n,"ReduceMin",(e,t)=>{const n=[];for(let r=0;r<e[0].dims.length;r++)(t.indexOf(r)>=0||0===t.length)&&n.push(`inputIdx[${r}] = 0;`);return[`${n.join("\n")}\nvalue = _A(inputIdx);`,"value = min(value, _A(inputIdx));",""]}),t.reduceProd=(e,t,n)=>s(e,t,n,"ReduceProd",()=>["value = 1.0;","value *= _A(inputIdx);",""]),t.reduceLogSum=(e,t,n)=>s(e,t,n,"ReduceLogSum",()=>["value = 0.0;","value += _A(inputIdx);","value = log(value);"]),t.reduceLogSumSquare=(e,t,n)=>s(e,t,n,"ReduceLogSumSquare",()=>["float t; value = 0.0;","t = _A(inputIdx); value += t * t;",""])},7019:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isReshapeCheap=t.processDims3D=t.createPackedReshape3DProgramInfoLoader=void 0;const r=n(2517),o=n(5060),a=n(2039),i=n(2827);t.createPackedReshape3DProgramInfoLoader=(e,t,n)=>{const s=(l=n,{name:"Reshape (packed)",inputTypes:[a.TextureType.packed],inputNames:["A"],cacheHint:`${l}`});var l;return Object.assign(Object.assign({},s),{get:()=>((e,t,n,s)=>{const l=t.dims,u=s;let c="";for(let r=0;r<4;r++){let e="";switch(r){case 0:e="outputCoords = rc;";break;case 1:e="outputCoords = ivec3(rc.x, rc.y+1, rc.z);";break;case 2:e="outputCoords = ivec3(rc.x, rc.y, rc.z+1);";break;case 3:e="outputCoords = ivec3(rc.x, rc.y+1, rc.z+1);";break;default:throw new Error}c+=`\n ${e}\n ${r>0?"if(outputCoords.y < rows && outputCoords.z < cols){":""}\n int flattenedIndex = getFlattenedIndex(outputCoords);\n\n ivec3 inputRC = inputCoordsFromReshapedOutCoords(flattenedIndex);\n vec2 innerDims = vec2(float(inputRC.y),float(inputRC.z));\n\n result[${r}] = getChannel(getA(inputRC.x, inputRC.y, inputRC.z), innerDims);\n\n ${r>0?"}":""}\n `}const d=(0,o.getGlsl)(e.session.backend.glContext.version),f=`\n ${function(e){const t=r.ShapeUtil.computeStrides(e),n=["b","r","c"],o="index";return`\n ivec3 inputCoordsFromReshapedOutCoords(int index) {\n ${t.map((e,r)=>`int ${n[r]} = ${o} / ${e}; ${r===t.length-1?`int ${n[r+1]} = ${o} - ${n[r]} * ${e}`:`index -= ${n[r]} * ${e}`};`).join("")}\n return ivec3(b, r, c);\n }\n `}(l)}\n ${function(e){const t=r.ShapeUtil.computeStrides(e);return`\n int getFlattenedIndex(ivec3 coords) {\n // reverse y, z order\n return coords.x * ${t[0]} + coords.z * ${t[1]} + coords.y;\n }\n`}(u)}\n ${(0,i.unpackFromChannel)()}\n\n void main() {\n ivec3 rc = getOutputCoords();\n\n vec4 result = vec4(0.0);\n\n ivec3 outputCoords;\n int rows = ${u[2]};\n int cols = ${u[1]};\n\n ${c}\n ${d.output} = result;\n }\n `;return Object.assign(Object.assign({},n),{output:{dims:u,type:t.type,textureType:a.TextureType.packed},shaderSource:f,hasMain:!0})})(e,t,s,n)})},t.processDims3D=function(e){if(0===e.length)return[1,1,1];let t=1;for(let n=0;n<e.length-2;++n)t*=e[n];return[t,e.length>1?e[e.length-2]:1,e[e.length-1]]},t.isReshapeCheap=function(e,t){let n=!1;return n=0===e.length||0===t.length||(e.length<2||t.length<2?e[e.length-1]===t[t.length-1]:e[e.length-1]===t[t.length-1]&&e[e.length-2]===t[t.length-2]),n}},718:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.reshape=void 0;const r=n(2517);t.reshape=(e,t)=>{const n=r.ShapeUtil.calculateReshapedDims(t[0].dims,t[1].integerData);return e.session.pack?[e.reshapePacked(t[0],n)]:[e.reshapeUnpacked(t[0],n)]}},2268:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseResizeAttributesV11=t.parseResizeAttributesV10=t.resize=void 0;const r=n(5060),o=n(2039),a=n(9390),i=n(2827),s=n(9793),l={name:"Resize",inputNames:["A"],inputTypes:[o.TextureType.packed]};t.resize=(e,t,n)=>((0,s.validateInputs)(t,n),[e.run(Object.assign(Object.assign({},l),{cacheHint:n.cacheKey,get:()=>u(e,t,n)}),t)]),t.parseResizeAttributesV10=e=>(0,s.parseUpsampleAttributes)(e,10),t.parseResizeAttributesV11=e=>(0,s.parseUpsampleAttributes)(e,11);const u=(e,t,n)=>{const s=(0,r.getGlsl)(e.session.backend.glContext.version),[u,d]=c(t,n);if(u.every(e=>1===e)&&"tf_crop_and_resize"!==n.coordinateTransformMode)return Object.assign(Object.assign({},l),{output:{dims:d,type:t[0].type,textureType:o.TextureType.packed},hasMain:!0,shaderSource:`void main() {\n vec4 v = ${s.texture2D}(X, TexCoords);\n ${s.output} = v;\n }`});const f=d.length;if(f<2)throw new Error(`output dimension should be at least 2, but got ${f}`);const p=d[f-2],h=d[f-1],m=t[0].dims;if(f!==m.length)throw new Error(`output dimension should match input ${m.length}, but got ${f}`);const g=m[f-2],b=m[f-1],y=u[f-2],_=u[f-1];let v="";if("linear"!==n.mode)throw new Error(`resize (packed) does not support mode: '${n.mode}'`);switch(n.coordinateTransformMode){case"asymmetric":v="\n vec4 getSourceFracIndex(ivec4 coords) {\n return vec4(coords) / scaleWHWH;\n }\n ";break;case"half_pixel":v="\n vec4 getSourceFracIndex(ivec4 coords) {\n return (vec4(coords) + 0.5) / scaleWHWH - 0.5;\n }\n ";break;case"pytorch_half_pixel":v=`\n vec4 getSourceFracIndex(ivec4 coords) {\n vec4 fcoords = vec4(coords);\n return vec4(\n ${h}.0 > 1.0 ? (fcoords.x + 0.5) / scaleWHWH.x - 0.5 : 0.0,\n ${p}.0 > 1.0 ? (fcoords.y + 0.5) / scaleWHWH.y - 0.5 : 0.0,\n ${h}.0 > 1.0 ? (fcoords.z + 0.5) / scaleWHWH.z - 0.5 : 0.0,\n ${p}.0 > 1.0 ? (fcoords.w + 0.5) / scaleWHWH.w - 0.5 : 0.0\n );\n }\n `;break;case"align_corners":v=`\n vec4 getSourceFracIndex(ivec4 coords) {\n vec4 resized = vec4(${h}.0 - 1.0, ${p}.0 - 1.0, ${h}.0 - 1.0,\n ${p}.0 - 1.0);\n vec4 original = vec4(${b}.0 - 1.0, ${g}.0 - 1.0, ${b}.0 - 1.0,\n ${g}.0 - 1.0);\n vec4 new_scale = original / resized;\n return vec4(coords) * new_scale;\n }\n `;break;default:throw new Error(`resize (packed) does not support coordinateTransformMode: '${n.coordinateTransformMode}'`)}const w=(0,a.getCoordsDataType)(f),S=`\n const vec2 inputWH = vec2(${g}.0, ${b}.0);\n const vec4 scaleWHWH = vec4(float(${y}), float(${_}), float(${y}), float(${_}));\n ${(0,i.unpackFromChannel)()}\n ${v}\n float getAValue(int x10, int r, int c, int d) {\n return getChannel(getA(x10, r, c, d), vec2(c, d));\n }\n void main() {\n ${w} rc = getOutputCoords();\n\n int batch = rc[0];\n int depth = rc[1];\n\n // retrieve the 4 coordinates that is used in the 4 packed output values.\n ivec4 coords = ivec4(rc.wz, rc.w + 1, rc.z + 1);\n\n // calculate the source index in fraction\n vec4 sourceFrac = getSourceFracIndex(coords);\n\n // get the lower and upper bound of the 4 values that will be packed into one texel.\n ivec4 x00 = ivec4(max(sourceFrac.xy, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.xy)));\n ivec4 x01 = ivec4(max(sourceFrac.xw, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.xw)));\n ivec4 x10 = ivec4(max(sourceFrac.zy, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.zy)));\n ivec4 x11 = ivec4(max(sourceFrac.zw, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.zw)));\n\n bool hasNextRow = rc.w < ${p-1};\n bool hasNextCol = rc.z < ${h-1};\n\n // pack x00, x01, x10, x11's top-left corner into one vec4 structure\n vec4 topLeft = vec4(\n getAValue(batch, depth, x00.x, x00.y),\n hasNextCol ? getAValue(batch, depth, x01.x, x01.y) : 0.0,\n hasNextRow ? getAValue(batch, depth, x10.x, x10.y) : 0.0,\n (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.x, x11.y) : 0.0);\n\n // pack x00, x01, x10, x11's top-right corner into one vec4 structure\n vec4 topRight = vec4(\n getAValue(batch, depth, x00.x, x00.w),\n hasNextCol ? getAValue(batch, depth, x01.x, x01.w) : 0.0,\n hasNextRow ? getAValue(batch, depth, x10.x, x10.w) : 0.0,\n (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.x, x11.w) : 0.0);\n\n // pack x00, x01, x10, x11's bottom-left corner into one vec4 structure\n vec4 bottomLeft = vec4(\n getAValue(batch, depth, x00.z, x00.y),\n hasNextCol ? getAValue(batch, depth, x01.z, x01.y) : 0.0,\n hasNextRow ? getAValue(batch, depth, x10.z, x10.y) : 0.0,\n (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.z, x11.y) : 0.0);\n\n // pack x00, x01, x10, x11's bottom-right corner into one vec4 structure\n vec4 bottomRight = vec4(\n getAValue(batch, depth, x00.z, x00.w),\n hasNextCol ? getAValue(batch, depth, x01.z, x01.w) : 0.0,\n hasNextRow ? getAValue(batch, depth, x10.z, x10.w) : 0.0,\n (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.z, x11.w) : 0.0);\n\n // calculate the interpolation fraction on u and v direction\n vec4 frac = vec4(sourceFrac) - floor(sourceFrac);\n vec4 clampFrac = clamp(frac, vec4(0.0), vec4(1.0));\n\n vec4 top = mix(topLeft, topRight, clampFrac.ywyw);\n vec4 bottom = mix(bottomLeft, bottomRight, clampFrac.ywyw);\n vec4 newValue = mix(top, bottom, clampFrac.xxzz);\n\n ${s.output} = vec4(newValue);\n }\n `;return Object.assign(Object.assign({},l),{output:{dims:d,type:t[0].type,textureType:o.TextureType.packed},hasMain:!0,shaderSource:S})},c=(e,t)=>{const n=e[0].dims;let r,o=t.scales;if(0===o.length){const a=e[t.scalesInputIdx];if(a&&0!==a.size){if(e[t.sizesInputIdx])throw new Error("Only one of scales or sizes must be provided as input.");o=d(a,t.mode,t.isResize)}else{const a=e[t.sizesInputIdx];if(!a||0===a.size)throw new Error("Either scales or sizes MUST be provided as input.");r=Array.from(a.integerData),o=f(r,n,t.mode,t.isResize)}}else if(e[t.sizesInputIdx])throw new Error("Only one of scales or sizes must be provided as input.");const a=r||n.map((e,t)=>Math.floor(e*o[t]));return[o,a]},d=(e,t,n)=>{const r=Array.from(e.floatData);return(0,s.scalesValidation)(r,t,n),r},f=(e,t,n,r)=>{const o=t.length,a=new Array(o);for(let i=0,s=o;i<s;i++)if(0===t[i]){if(0!==e[i])throw new Error("Input dim is zero but required output dim is non-zero.");a[i]=1}else a[i]=e[i]/t[i];return(0,s.scalesValidation)(a,n,r),a}},8117:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.shape=void 0;const r=n(9162);t.shape=(e,t)=>(o(t),[new r.Tensor([t[0].dims.length],"int32",void 0,void 0,new Int32Array(t[0].dims))]);const o=e=>{if(!e||1!==e.length)throw new Error("Shape requires 1 input.")}},2278:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.sliceV10=t.parseSliceAttributes=t.slice=void 0;const r=n(246),o=n(782),a=n(2517),i=n(2039),s={name:"Slice",inputNames:["A"],inputTypes:[i.TextureType.unpacked]};t.slice=(e,t,n)=>(u(t),[e.run(Object.assign(Object.assign({},s),{cacheHint:n.cacheKey,get:()=>l(e,t[0],n)}),t)]),t.parseSliceAttributes=e=>{const t=e.attributes.getInts("starts"),n=e.attributes.getInts("ends"),o=e.attributes.getInts("axes",[]);return(0,r.createAttributeWithCacheKey)({starts:t,ends:n,axes:o})};const l=(e,t,n)=>{const r=0===n.axes.length?t.dims.slice(0).map((e,t)=>t):n.axes,o=a.ShapeUtil.normalizeAxes(r,t.dims.length),l=n.starts.map((e,n)=>e>t.dims[o[n]]-1?t.dims[o[n]]:a.ShapeUtil.normalizeAxis(e,t.dims[o[n]])),u=n.ends.map((e,n)=>e>t.dims[o[n]]-1?t.dims[o[n]]:a.ShapeUtil.normalizeAxis(e,t.dims[o[n]])),c=t.dims.slice(),d=[];for(let a=0;a<o.length;a++)c[o[a]]=u[a]-l[a],l[a]>0&&d.push(`outputIdx[${o[a]}] += ${l[a]};`);const f=`\n float process(int outputIdx[${c.length}]) {\n ${d.join("\n ")}\n return _A(outputIdx);\n }`;return Object.assign(Object.assign({},s),{output:{dims:c,type:t.type,textureType:i.TextureType.unpacked},shaderSource:f})},u=e=>{if(!e||1!==e.length)throw new Error("Slice requires 1 input.");if(-1===o.NUMBER_TYPES.indexOf(e[0].type))throw new Error("Invalid input type.")};t.sliceV10=(e,t)=>{d(t);const n=c(e,t);return[e.run(Object.assign(Object.assign({},s),{cacheHint:n.cacheKey,get:()=>l(e,t[0],n)}),[t[0]])]};const c=(e,t)=>{if(!e.session.isInitializer(t[1].dataId)||!e.session.isInitializer(t[2].dataId)||t.length>=4&&!e.session.isInitializer(t[3].dataId)||t.length>=5&&!e.session.isInitializer(t[4].dataId))throw new Error("dynamic slice attributes are not allowed");if(t.length>=5&&t[4].integerData.some(e=>1!==e))throw new Error("currently non-1 steps is not supported for Slice");const n=Array.from(t[1].integerData),r=Array.from(t[2].integerData),o=t.length>=4?Array.from(t[3].integerData):[];return{starts:n,ends:r,axes:o,cacheKey:`${o};${n};${r}`}},d=e=>{if(!e||e.length<3||e.length>5)throw new Error("Invalid input number.");if("int32"!==e[1].type||1!==e[1].dims.length)throw new Error("Invalid input type.");if("int32"!==e[2].type||1!==e[2].dims.length)throw new Error("Invalid input type.");if(e.length>=4&&("int32"!==e[3].type||1!==e[3].dims.length))throw new Error("Invalid input type.");if(e.length>=5&&("int32"!==e[4].type||1!==e[4].dims.length))throw new Error("Invalid input type.")}},5524:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.softmaxV13=t.parseSoftmaxAttributesV13=t.parseSoftmaxAttributes=t.softmax=void 0;const r=n(246),o=n(2517),a=n(5060),i=n(2039),s=n(3738),l={name:"SoftmaxComputeMax",inputNames:["A"],inputTypes:[i.TextureType.unpacked]},u={name:"SoftmaxComputeScale",inputNames:["A","Max"],inputTypes:[i.TextureType.unpacked,i.TextureType.unpacked]},c={name:"SoftMax",inputNames:["A","Max","Norm"],inputTypes:[i.TextureType.unpacked,i.TextureType.unpacked,i.TextureType.unpacked]};t.softmax=(e,t,n)=>{m(t);const r=t[0].dims.slice(),a=o.ShapeUtil.normalizeAxis(n.axis,r.length),i=o.ShapeUtil.sizeToDimension(r,a),s=o.ShapeUtil.sizeFromDimension(r,a);return d(e,t,n,i,s)},t.parseSoftmaxAttributes=e=>(0,r.createAttributeWithCacheKey)({axis:e.attributes.getInt("axis",1)}),t.parseSoftmaxAttributesV13=e=>(0,r.createAttributeWithCacheKey)({axis:e.attributes.getInt("axis",-1)}),t.softmaxV13=(e,t,n)=>{m(t);const a=t[0].dims.slice(),i=o.ShapeUtil.normalizeAxis(n.axis,a.length),l=a.length,u=i!==l-1,c=[];let f,p=[],h=[];u&&(p=Array.from({length:l}).map((e,t)=>t),p[i]=l-1,p[l-1]=i,p.map(e=>c.push(a[e])),f=(0,r.createAttributeWithCacheKey)({perm:p}),h=(0,s.transpose)(e,t,f));const g=u?o.ShapeUtil.sizeToDimension(c,l-1):o.ShapeUtil.sizeToDimension(a,l-1),b=u?o.ShapeUtil.sizeFromDimension(c,l-1):o.ShapeUtil.sizeFromDimension(a,l-1),y=d(e,u?h:t,n,g,b);return u?(0,s.transpose)(e,y,f):y};const d=(e,t,n,r,o)=>{const a=f(e,t[0],r,o,[r]),i=e.run(Object.assign(Object.assign({},l),{cacheHint:n.cacheKey,get:()=>a}),t),s=p(e,t[0],r,o,a.output.dims,[r]),d=e.run(Object.assign(Object.assign({},u),{cacheHint:n.cacheKey,get:()=>s}),[t[0],i]),m=h(e,t[0],r,o,a.output.dims,s.output.dims);return[e.run(Object.assign(Object.assign({},c),{cacheHint:n.cacheKey,get:()=>m}),[t[0],i,d])]},f=(e,t,n,r,o)=>{const[s,u]=e.calculateTextureWidthAndHeight(t.dims,i.TextureType.unpacked),c=o.length;if(n<1||r<1)throw new Error("Logical row count N and feature count D must be greater than or equal to 1");if(1!==o.length)throw new Error("Dimensionality of the output should be 1");if(o[0]!==n)throw new Error("Shape of the output should be equal to logical row count");const d=(0,a.getGlsl)(e.session.backend.glContext.version),f=`\n float process(int[${c}] indices) {\n int logical_row_start_offset = indices[0] * ${r};\n\n float max = getColorAsFloat(${d.texture2D}(A, offsetToCoords(logical_row_start_offset, ${s},\n ${u} )));\n for(int i=1; i<${r}; ++i)\n {\n float current = getColorAsFloat(${d.texture2D}(A, offsetToCoords(logical_row_start_offset + i,\n ${s}, ${u})));\n if(current > max)\n max = current;\n }\n\n return max;\n }`;return Object.assign(Object.assign({},l),{output:{dims:o,type:t.type,textureType:i.TextureType.unpacked},shaderSource:f})},p=(e,t,n,r,o,s)=>{const[l,c]=e.calculateTextureWidthAndHeight(t.dims,i.TextureType.unpacked),d=s.length;if(n<1||r<1)throw new Error("Logical row count N and feature count D must be greater than or equal to 1");if(1!==s.length)throw new Error("Dimensionality of the output should be 1");if(s[0]!==n)throw new Error("Shape of the output should be equal to logical row count");if(1!==o.length)throw new Error("Dimensionality of the intermediate results should be 1");if(o[0]!==n)throw new Error("Shape of the intermediate results should be equal to logical row count");const f=`\n float process(int[${d}] indices) {\n int logical_row_start_offset = indices[0] * ${r};\n\n float norm_factor = 0.0;\n float max = _Max(indices);\n for(int i=0; i<${r}; ++i)\n {\n norm_factor += exp(getColorAsFloat(${(0,a.getGlsl)(e.session.backend.glContext.version).texture2D}(A, offsetToCoords(logical_row_start_offset + i,\n ${l}, ${c}))) - max);\n }\n\n return norm_factor;\n }`;return Object.assign(Object.assign({},u),{output:{dims:s,type:t.type,textureType:i.TextureType.unpacked},shaderSource:f})},h=(e,t,n,r,o,a)=>{const[s,l]=e.calculateTextureWidthAndHeight(t.dims,i.TextureType.unpacked),u=t.dims.length;if(n<1||r<1)throw new Error("Logical row count N and feature count D must be greater than or equal to 1");if(1!==o.length||1!==a.length)throw new Error("Dimensionality of the intermediate results should be 1");if(o[0]!==n||a[0]!==n)throw new Error("Shape of the intermediate results should be equal to logical row count");const d=`\n float process(int[${u}] indices) {\n\n // get offset of current logical tensor index from the 2-D texture coordinates (TexCoords)\n int offset = coordsToOffset(TexCoords, ${s}, ${l});\n\n //determine the logical row for this index\n int logical_row_index[1];\n logical_row_index[0] = offset / ${r};\n\n float norm_factor = _Norm(logical_row_index);\n\n // avoid possible division by 0\n // if norm_facor is 0, all elements are zero\n // if so, return 0\n if(norm_factor == 0.0)\n return 0.0;\n\n return exp(_A(indices) - _Max(logical_row_index)) / norm_factor;\n }`;return Object.assign(Object.assign({},c),{output:{dims:t.dims,type:t.type,textureType:i.TextureType.unpacked},shaderSource:d})},m=e=>{if(!e||1!==e.length)throw new Error("Softmax requires 1 input.");if("float32"!==e[0].type&&"float64"!==e[0].type)throw new Error("Invalid input type")}},5975:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseSplitAttributes=t.split=void 0;const r=n(246),o=n(2517),a=n(2039),i={name:"Split",inputNames:["A"],inputTypes:[a.TextureType.unpacked]};t.split=(e,t,n)=>{u(t);const r=o.ShapeUtil.normalizeAxis(n.axis,t[0].dims.length),a=s(e,t,r,n),c=[];for(let o=0;o<a;++o)c.push(e.run(Object.assign(Object.assign({},i),{cacheHint:`${n.cacheKey};${o}`,get:()=>l(e,t[0],n,r,o)}),t));return c},t.parseSplitAttributes=e=>{const t=e.attributes.getInt("axis",0),n=e.attributes.getInts("split",[]),o=e.outputs.length;return(0,r.createAttributeWithCacheKey)({axis:t,split:n,numOutputs:o})};const s=(e,t,n,r)=>{const[,a]=o.SplitUtil.splitShape(t[0].dims,n,r.split,r.numOutputs);return a.length},l=(e,t,n,r,s)=>{const[l,u]=o.SplitUtil.splitShape(t.dims,r,n.split,n.numOutputs),c=u[s],d=l[s],f=`\n float process(int indices[${d.length}]) {\n indices[${r}] += ${c};\n return _A(indices);\n }\n `;return Object.assign(Object.assign({},i),{cacheHint:`${n.cacheKey}:${s}`,output:{dims:d,type:t.type,textureType:a.TextureType.unpacked},shaderSource:f})},u=e=>{if(!e||1!==e.length)throw new Error("Split requires one input.");if("int8"!==e[0].type&&"uint8"!==e[0].type&&"int16"!==e[0].type&&"uint16"!==e[0].type&&"int32"!==e[0].type&&"uint32"!==e[0].type&&"float32"!==e[0].type&&"float64"!==e[0].type&&"bool"!==e[0].type)throw new Error("Invalid input type.")}},3933:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseSqueezeAttributes=t.squeezeV13=t.squeeze=void 0;const r=n(2517);t.squeeze=(e,t,n)=>{o(t);const a=r.ShapeUtil.squeezeShape(t[0].dims,n);return[e.reshapeUnpacked(t[0],a)]},t.squeezeV13=(e,n)=>(a(n),(0,t.squeeze)(e,[n[0]],Array.from(n[1].integerData))),t.parseSqueezeAttributes=e=>e.attributes.getInts("axes");const o=e=>{if(!e||1!==e.length)throw new Error("Squeeze requires 1 input.");if("string"===e[0].type)throw new Error("invalid input tensor types.")},a=e=>{if(!e||2!==e.length)throw new Error("Squeeze requires 2 inputs.");if("int32"!==e[1].type)throw new Error("Invalid input type.")}},6558:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.sum=void 0;const r=n(5060),o=n(2039);t.sum=(e,t)=>{i(t);const n={name:"Sum",inputNames:t.map((e,t)=>`X${t}`),inputTypes:new Array(t.length).fill(o.TextureType.unpacked)};return[e.run(Object.assign(Object.assign({},n),{get:()=>a(e,t,n)}),t)]};const a=(e,t,n)=>{const a=(0,r.getGlsl)(e.session.backend.glContext.version),i=t[0].dims.slice(),s=`\n void main() {\n vec4 result = ${t.map((e,t)=>`${a.texture2D}(X${t},TexCoords)`).join(" + ")};\n ${a.output} = result;\n }\n `;return Object.assign(Object.assign({},n),{output:{dims:i,type:t[0].type,textureType:o.TextureType.unpacked},hasMain:!0,shaderSource:s})},i=e=>{if(!e||0===e.length)throw new Error("Sum requires inputs.");const t=e[0].dims.length;for(let n=1;n<e.length;n++){if(t!==e[n].dims.length)throw new Error("Input shapes are mismatched.");for(let r=0;r<t;r++)if(e[0].dims[r]!==e[n].dims[r])throw new Error("Input shapes are not matched.")}if("float32"!==e[0].type&&"float64"!==e[0].type)throw new Error("Invalid input type.");for(let n=1;n<e.length;n++)if(e[0].type!==e[n].type)throw new Error("Input types are not matched.")}},5723:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.tile=void 0;const r=n(782),o=n(2039);t.tile=(e,t)=>{i(t);const n={name:"Tile",inputNames:["A"],inputTypes:[o.TextureType.unpacked]};return[e.run(Object.assign(Object.assign({},n),{get:()=>a(e,t,n)}),t)]};const a=(e,t,n)=>{const r=t[0].dims.slice(),a=new Array(r.length),i=[];for(let o=0;o<r.length;o++)a[o]=r[o]*t[1].numberData[o],i.push(`inputIdx[${o}] = int(mod(float(outputIdx[${o}]), ${r[o]}.));`);const s=a.length,l=`\n float process(int outputIdx[${s}]) {\n int inputIdx[${s}];\n ${i.join("\n")}\n return _A(inputIdx);\n }\n `;return Object.assign(Object.assign({},n),{output:{dims:a,type:t[0].type,textureType:o.TextureType.unpacked},shaderSource:l})},i=e=>{if(!e||2!==e.length)throw new Error("Tile requires 2 input.");if(1!==e[1].dims.length)throw new Error("The second input shape must 1 dimension.");if(e[1].dims[0]!==e[0].dims.length)throw new Error("Invalid input shape.");if(-1===r.NUMBER_TYPES.indexOf(e[0].type))throw new Error("Invalid input type.");if("int32"!==e[1].type&&"int16"!==e[1].type)throw new Error("Invalid repeat type.")}},3738:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseTransposeAttributes=t.transpose=void 0;const r=n(246),o=n(2517),a=n(2039),i={name:"Transpose",inputNames:["A"],inputTypes:[a.TextureType.unpacked]};t.transpose=(e,t,n)=>(d(t),[e.run(Object.assign(Object.assign({},i),{cacheHint:n.cacheKey,get:()=>s(e,t[0],n.perm)}),t)]),t.parseTransposeAttributes=e=>(0,r.createAttributeWithCacheKey)({perm:e.attributes.getInts("perm",[])});const s=(e,t,n)=>{const r=t.dims;n=l(r,n);const o=u(r,n),s=r.length,d=`\n ${c("perm",n,s)}\n float process(int indices[${s}]) {\n int a[${s}];\n perm(a, indices);\n return _A(a);\n }`;return Object.assign(Object.assign({},i),{output:{dims:o,type:t.type,textureType:a.TextureType.unpacked},shaderSource:d})},l=(e,t)=>(t&&t.length!==e.length&&(t=[...e.keys()].reverse()),t),u=(e,t)=>(t=l(e,t),o.ShapeUtil.sortBasedOnPerm(e,t)),c=(e,t,n)=>{const r=[];r.push(`void ${e}(out int a[${n}], int src[${n}]) {`);for(let o=0;o<n;++o)r.push(`\ta[${t[o]}]=src[${o}];`);return r.push("\t}"),r.join("\n")},d=e=>{if(!e||1!==e.length)throw new Error("Transpose requires 1 input.");if("float32"!==e[0].type&&"float64"!==e[0].type)throw new Error("input should be float tensor")}},8710:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.encodeAsUint8=void 0;const r=n(5060),o=n(2039);t.encodeAsUint8=(e,t)=>{const n=t.shape,a=(0,r.getGlsl)(e.session.backend.glContext.version),i=`\n const float FLOAT_MAX = 1.70141184e38;\n const float FLOAT_MIN = 1.17549435e-38;\n\n bool isNaN(float val) {\n return (val < 1.0 || 0.0 < val || val == 0.0) ? false : true;\n }\n\n highp vec4 encodeAsUint8(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\n void main() {\n float value = ${a.texture2D}(X,TexCoords).r;\n ${a.output} = encodeAsUint8(value);\n }`,s={name:"Uint8Encode",inputTypes:[o.TextureType.unpacked],inputNames:["X"],output:{dims:n,type:t.tensor.type,textureType:o.TextureType.downloadUint8AsFloat},shaderSource:i,hasMain:!0};return e.executeProgram(s,[t.tensor])}},4909:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.tanh=t.tan=t.sqrt=t.sin=t.sigmoid=t.relu=t.not=t.neg=t.log=t.parseLeakyReluAttributes=t.leakyRelu=t.identity=t.floor=t.exp=t.parseEluAttributes=t.elu=t.cos=t.ceil=t.clipV11=t.parseClipAttributes=t.clip=t.atan=t.asin=t.acos=t.abs=t.glslTanh=t.glslTan=t.glslSqrt=t.glslSigmoid=t.glslRelu=t.glslSin=t.glslNot=t.glslNeg=t.glslLog=t.glslLeakyRelu=t.glslIdentity=t.glslClip=t.glslFloor=t.glslExp=t.glslElu=t.glslCos=t.glslCeil=t.glslAtan=t.glslAsin=t.glslAcos=t.glslAbs=void 0;const r=n(246),o=n(2517),a=n(8520),i=n(5060),s=n(2039);function l(){return A("abs")}function u(){return A("acos")}function c(){return A("asin")}function d(){return A("atan")}function f(){return A("ceil")}function p(){return A("cos")}function h(e){const t="elu";return{body:`\n const float alpha = float(${e});\n\n float ${t}_(float a) {\n return a >= 0.0 ? a: (exp(a) - 1.0) * alpha;\n }\n vec4 ${t}_(vec4 v) {\n return vec4(${t}_(v.x), ${t}_(v.y), ${t}_(v.z), ${t}_(v.w));\n }\n `,name:t,type:a.FunctionType.ValueBased}}function m(){return A("exp")}function g(){return A("floor")}function b(e,t){const n="clip";return{body:`\n const float min = float(${e});\n const float max = float(${t});\n\n float ${n}_(float a) {\n return clamp(a, min, max);\n }\n vec4 ${n}_(vec4 v) {\n return clamp(v, min, max);\n }\n `,name:n,type:a.FunctionType.ValueBased}}function y(){const e="indentity";return{body:`\n float ${e}_(float a) {\n return a;\n }\n vec4 ${e}_(vec4 v) {\n return v;\n }\n `,name:e,type:a.FunctionType.ValueBased}}function _(e){const t="leakyRelu";return{body:`\n const float alpha = float(${e});\n\n float ${t}_(float a) {\n return a < 0.0 ? a * alpha : a;\n }\n vec4 ${t}_(vec4 v) {\n return vec4(${t}_(v.x), ${t}_(v.y), ${t}_(v.z), ${t}_(v.w));\n }\n `,name:t,type:a.FunctionType.ValueBased}}function v(){return A("log")}function w(){const e="neg";return{body:`\n float ${e}_(float a) {\n return -a;\n }\n vec4 ${e}_(vec4 v) {\n return -v;\n }\n `,name:e,type:a.FunctionType.ValueBased}}function S(){const e="not";return{body:`\n float ${e}_(float a) {\n return float( ! bool(a) );\n }\n bool ${e}_(bool a) {\n return !a;\n }\n vec4 ${e}_(vec4 v) {\n return vec4(!bool(v.x), !bool(v.y), !bool(v.z), !bool(v.w));\n }\n bvec4 ${e}_(bvec4 v) {\n return bvec4(!v.x, !v.y, !v.z, !v.w);\n }\n `,name:e,type:a.FunctionType.ValueBased}}function x(){return A("sin")}function T(){const e="relu";return{body:`\n float ${e}_(float a) {\n return max( a, 0.0 );\n }\n vec4 ${e}_(vec4 v) {\n return max( v, 0.0 );\n }\n `,name:e,type:a.FunctionType.ValueBased}}function E(){const e="sigmoid";return{body:`\n float ${e}_(float a) {\n return 1.0 / (1.0 + exp(-a));\n }\n vec4 ${e}_(vec4 v) {\n return 1.0 / (1.0 + exp(-v));\n }\n `,name:e,type:a.FunctionType.ValueBased}}function k(){return A("sqrt")}function P(){return A("tan")}function O(){const e="tanh";return{body:`\n float ${e}_(float a) {\n a = clamp(a, -10., 10.);\n a = exp(2.*a);\n return (a - 1.) / (a + 1.);\n }\n vec4 ${e}_(vec4 v) {\n v = clamp(v, -10., 10.);\n v = exp(2.*v);\n return (v - 1.) / (v + 1.);\n }\n `,name:e,type:a.FunctionType.ValueBased}}function A(e){return{body:`\n float ${e}_(float a) {\n return ${e}(a);\n }\n vec4 ${e}_(vec4 v) {\n return ${e}(v);\n }\n `,name:e,type:a.FunctionType.ValueBased}}t.glslAbs=l,t.glslAcos=u,t.glslAsin=c,t.glslAtan=d,t.glslCeil=f,t.glslCos=p,t.glslElu=h,t.glslExp=m,t.glslFloor=g,t.glslClip=b,t.glslIdentity=y,t.glslLeakyRelu=_,t.glslLog=v,t.glslNeg=w,t.glslNot=S,t.glslSin=x,t.glslRelu=T,t.glslSigmoid=E,t.glslSqrt=k,t.glslTan=P,t.glslTanh=O;const $=(e,t,n,r)=>{const o=e.session.pack?s.TextureType.packed:s.TextureType.unpacked,a={name:n.name,inputTypes:[o],inputNames:["A"],cacheHint:r};return Object.assign(Object.assign({},a),{get:()=>((e,t,n,r)=>{const o=e.session.pack?s.TextureType.packed:s.TextureType.unpacked,a=(0,i.getGlsl)(e.session.backend.glContext.version);return Object.assign(Object.assign({},t),{output:{dims:n.dims,type:n.type,textureType:o},shaderSource:`\n ${r.body}\n void main() {\n vec4 v = ${a.texture2D}(A, TexCoords);\n v = ${r.name}_(v);\n ${a.output} = v;\n }\n `,hasMain:!0})})(e,a,t,n)})};t.abs=(e,t)=>[e.run($(e,t[0],l()),t)],t.acos=(e,t)=>[e.run($(e,t[0],u()),t)],t.asin=(e,t)=>[e.run($(e,t[0],c()),t)],t.atan=(e,t)=>[e.run($(e,t[0],d()),t)],t.clip=(e,t,n)=>[e.run($(e,t[0],b(n.min,n.max),n.cacheKey),t)],t.parseClipAttributes=e=>(0,r.createAttributeWithCacheKey)({min:e.attributes.getFloat("min",o.MIN_CLIP),max:e.attributes.getFloat("max",o.MAX_CLIP)}),t.clipV11=(e,n)=>{const r=R(e,n);return(0,t.clip)(e,[n[0]],r)};const R=(e,t)=>{if(t.length>=3&&(!e.session.isInitializer(t[1].dataId)||!e.session.isInitializer(t[2].dataId)))throw new Error("dynamic clip attributes are not allowed");const n=t.length>=3?t[1].numberData[0]:o.MIN_CLIP,a=t.length>=3?t[2].numberData[0]:o.MAX_CLIP;return(0,r.createAttributeWithCacheKey)({min:n,max:a})};t.ceil=(e,t)=>[e.run($(e,t[0],f()),t)],t.cos=(e,t)=>[e.run($(e,t[0],p()),t)],t.elu=(e,t,n)=>[e.run($(e,t[0],h(n.alpha),n.cacheKey),t)],t.parseEluAttributes=e=>(0,r.createAttributeWithCacheKey)({alpha:e.attributes.getFloat("alpha",1)}),t.exp=(e,t)=>[e.run($(e,t[0],m()),t)],t.floor=(e,t)=>[e.run($(e,t[0],g()),t)],t.identity=(e,t)=>[e.run($(e,t[0],y()),t)],t.leakyRelu=(e,t,n)=>[e.run($(e,t[0],_(n.alpha),n.cacheKey),t)],t.parseLeakyReluAttributes=e=>(0,r.createAttributeWithCacheKey)({alpha:e.attributes.getFloat("alpha",.01)}),t.log=(e,t)=>[e.run($(e,t[0],v()),t)],t.neg=(e,t)=>[e.run($(e,t[0],w()),t)],t.not=(e,t)=>[e.run($(e,t[0],S()),t)],t.relu=(e,t)=>[e.run($(e,t[0],T()),t)],t.sigmoid=(e,t)=>[e.run($(e,t[0],E()),t)],t.sin=(e,t)=>[e.run($(e,t[0],x()),t)],t.sqrt=(e,t)=>[e.run($(e,t[0],k()),t)],t.tan=(e,t)=>[e.run($(e,t[0],P()),t)],t.tanh=(e,t)=>[e.run($(e,t[0],O()),t)]},5611:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createUnpackProgramInfoLoader=t.createUnpackProgramInfo=void 0;const r=n(5060),o=n(2039),a=n(9390),i=n(2827),s={name:"unpack",inputNames:["A"],inputTypes:[o.TextureType.packed]};t.createUnpackProgramInfo=(e,t)=>{const n=t.dims.length,l=(0,i.getChannels)("rc",n),u=l.slice(-2),c=(0,a.getCoordsDataType)(n),d=(0,i.unpackFromChannel)(),f=0===t.dims.length?"":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}(n,l),p=n<=1?"rc":`vec2(${u.join(",")})`,h=`\n ${d}\n void main() {\n ${c} rc = getOutputCoords();\n\n // Sample the texture with the coords to get the rgba channel value.\n vec4 packedInput = getA(${f});\n\n ${(0,r.getGlsl)(e.session.backend.glContext.version).output} = vec4(getChannel(packedInput, ${p}), 0, 0, 0);\n }\n `;return Object.assign(Object.assign({},s),{hasMain:!0,output:{dims:t.dims,type:t.type,textureType:o.TextureType.unpacked},shaderSource:h})},t.createUnpackProgramInfoLoader=(e,n)=>Object.assign(Object.assign({},s),{get:()=>(0,t.createUnpackProgramInfo)(e,n)})},8428:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseUnsqueezeAttributes=t.unsqueezeV13=t.unsqueeze=void 0;const r=n(2517);t.unsqueeze=(e,t,n)=>{o(t);const a=r.ShapeUtil.unsqueezeShape(t[0].dims,n);return[e.reshapeUnpacked(t[0],a)]},t.unsqueezeV13=(e,n)=>(a(n),(0,t.unsqueeze)(e,[n[0]],Array.from(n[1].integerData))),t.parseUnsqueezeAttributes=e=>e.attributes.getInts("axes");const o=e=>{if(!e||1!==e.length)throw new Error("Unsqueeze requires 1 input.");if("string"===e[0].type)throw new Error("invalid input tensor types.")},a=e=>{if(!e||2!==e.length)throw new Error("Unsqueeze requires 2 inputs.");if("int32"!==e[1].type)throw new Error("Invalid input type.")}},9793:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.scalesValidation=t.validateInputs=t.parseUpsampleAttributes=t.parseUpsampleAttributesV9=t.parseUpsampleAttributesV7=t.upsample=void 0;const r=n(246),o=n(5060),a=n(2039),i={name:"Upsample",inputNames:["X"],inputTypes:[a.TextureType.unpacked]};t.upsample=(e,n,r)=>((0,t.validateInputs)(n,r),[e.run(Object.assign(Object.assign({},i),{cacheHint:r.cacheKey,get:()=>s(e,n,r)}),n)]),t.parseUpsampleAttributesV7=e=>(0,t.parseUpsampleAttributes)(e,7),t.parseUpsampleAttributesV9=e=>(0,t.parseUpsampleAttributes)(e,9),t.parseUpsampleAttributes=(e,n)=>{const o=n>=10,a=e.attributes.getString("mode","nearest");if("nearest"!==a&&"linear"!==a&&(n<11||"cubic"!==a))throw new Error(`unrecognized mode: ${a}`);let i=[];n<9&&(i=e.attributes.getFloats("scales"),(0,t.scalesValidation)(i,a,o));const s=e.attributes.getFloat("extrapolation_value",0),l=n>10?e.attributes.getString("coordinate_transformation_mode","half_pixel"):"asymmetric";if(-1===["asymmetric","pytorch_half_pixel","tf_half_pixel_for_nn","align_corners","tf_crop_and_resize","half_pixel"].indexOf(l))throw new Error(`coordinate_transform_mode '${l}' is not supported`);const u="tf_crop_and_resize"===l,c=u,d="nearest"===a&&n>=11?e.attributes.getString("nearest_mode","round_prefer_floor"):"";if(-1===["round_prefer_floor","round_prefer_ceil","floor","ceil",""].indexOf(d))throw new Error(`nearest_mode '${d}' is not supported`);const f=e.attributes.getFloat("cubic_coeff_a",-.75),p=0!==e.attributes.getInt("exclude_outside",0);if(p&&"cubic"!==a)throw new Error("exclude_outside can be set to 1 only when mode is CUBIC.");const h=n<11||"nearest"===a&&"asymmetric"===l&&"floor"===d;let m=0,g=0,b=0;return n>10?e.inputs.length>2?(m=1,g=2,b=3):(g=1,b=2):9===n&&(g=1),(0,r.createAttributeWithCacheKey)({opset:n,isResize:o,mode:a,scales:i,extrapolationValue:s,coordinateTransformMode:l,useExtrapolation:c,needRoiInput:u,nearestMode:d,cubicCoefficientA:f,excludeOutside:p,useNearest2xOptimization:h,roiInputIdx:m,scalesInputIdx:g,sizesInputIdx:b})};const s=(e,t,n)=>{const r=(0,o.getGlsl)(e.session.backend.glContext.version),[s,l]=e.calculateTextureWidthAndHeight(t[0].dims,a.TextureType.unpacked),u=t[0].dims.map((e,t)=>Math.floor(e*n.scales[t])),[c,d]=e.calculateTextureWidthAndHeight(u,a.TextureType.unpacked),f=u.length,p=new Array(f),h=new Array(f);let m=`\n int output_pitches[${f}];\n int input_pitches[${f}];\n `;for(let o=f-1;o>=0;o--)p[o]=o===f-1?1:p[o+1]*u[o+1],h[o]=o===f-1?1:h[o+1]*t[0].dims[o+1],m+=`\n output_pitches[${o}] = ${p[o]};\n input_pitches[${o}] = ${h[o]};\n `;const g=`\n float getInputFloat(int index) {\n vec2 coords = offsetToCoords(index, ${s}, ${l});\n float value = getColorAsFloat(${r.texture2D}(X, coords));\n return value;\n }\n `,b="nearest"===n.mode?`\n ${g}\n float process(int indices[${f}]) {\n int input_index = 0;\n int output_index = coordsToOffset(TexCoords, ${c}, ${d});\n\n ${m}\n\n int d, m;\n for (int dim = 0; dim < ${f}; ++dim) {\n d = output_index / output_pitches[dim];\n m = output_index - d * output_pitches[dim];\n output_index = m;\n\n if (scales[dim] != 1 && d > 0) {\n int d2 = d / scales[dim];\n m = d - d2 * scales[dim];\n d = d2;\n }\n input_index += input_pitches[dim] * d;\n }\n\n return getInputFloat(input_index);\n }`:4===f?`\n ${g}\n float process(int indices[4]) {\n int input_index = 0;\n int output_index = coordsToOffset(TexCoords, ${c}, ${d});\n\n ${m}\n\n int m;\n int index_of_dim0, index_of_dim1, index_of_dim2, index_of_dim3;\n index_of_dim0 = output_index / output_pitches[0];\n m = output_index - index_of_dim0 * output_pitches[0];\n index_of_dim1 = m / output_pitches[1];\n m = m - index_of_dim1 * output_pitches[1];\n index_of_dim2 = m / output_pitches[2];\n m = m - index_of_dim2 * output_pitches[2];\n index_of_dim3 = m;\n\n int index_of_input_dim2, index_of_input_dim3, x_offset, y_offset;\n index_of_input_dim2 = index_of_dim2 / scales[2];\n y_offset = index_of_dim2 - index_of_input_dim2 * scales[2];\n index_of_input_dim3 = index_of_dim3 / scales[3];\n x_offset = index_of_dim3 - index_of_input_dim3 * scales[3];\n\n input_index = index_of_dim0 * input_pitches[0] +\n index_of_dim1 * input_pitches[1] +\n index_of_input_dim2 * input_pitches[2] +\n index_of_input_dim3;\n\n float x00 = getInputFloat(input_index);\n float x10, x01, x11;\n\n bool end_of_dim2 = false;\n if (index_of_input_dim2 == (${t[0].dims[2]} - 1)) {\n // It's the end in dimension 2\n x01 = x00;\n end_of_dim2 = true;\n } else {\n x01 = getInputFloat(input_index + input_pitches[2]);\n }\n\n if (index_of_input_dim3 == (input_pitches[2] - 1)) {\n // It's the end in dimension 3\n x10 = x00;\n x11 = x01;\n }\n else {\n x10 = getInputFloat(input_index + 1);\n x11 = end_of_dim2 ? x10 : getInputFloat(input_index + input_pitches[2] + 1);\n }\n\n float y0 = x00 + float(y_offset) * (x01 - x00) / float(scales[2]);\n float y1 = x10 + float(y_offset) * (x11 - x10) / float(scales[2]);\n return y0 + float(x_offset) * (y1 - y0) / float(scales[3]);\n }`:`\n ${g}\n float process(int indices[2]) {\n int input_index = 0;\n int output_index = coordsToOffset(TexCoords, ${c}, ${d});\n\n ${m}\n\n int m;\n int index_of_dim0, index_of_dim1;\n index_of_dim0 = output_index / output_pitches[0];\n m = output_index - index_of_dim0 * output_pitches[0];\n index_of_dim1 = m;\n\n int index_of_input_dim0, index_of_input_dim1, x_offset, y_offset;\n index_of_input_dim0 = index_of_dim0 / scales[0];\n y_offset = index_of_dim0 - index_of_input_dim0 * scales[0];\n index_of_input_dim1 = index_of_dim1 / scales[1];\n x_offset = index_of_dim1 - index_of_input_dim1 * scales[1];\n\n input_index = index_of_input_dim0 * input_pitches[0] + index_of_input_dim1;\n\n float x00 = getInputFloat(input_index);\n float x10, x01, x11;\n\n bool end_of_dim0 = false;\n if (index_of_input_dim0 == (${t[0].dims[0]} - 1)) {\n // It's the end in dimension 0\n x01 = x00;\n end_of_dim0 = true;\n } else {\n x01 = getInputFloat(input_index + input_pitches[0]);\n }\n\n if (index_of_input_dim1 == (input_pitches[0] - 1)) {\n // It's the end in dimension 1\n x10 = x00;\n x11 = x01;\n }\n else {\n x10 = getInputFloat(input_index + 1);\n x11 = end_of_dim0 ? x10 : getInputFloat(input_index + input_pitches[0] + 1);\n }\n\n float y0 = x00 + float(y_offset) * (x01 - x00) / float(scales[0]);\n float y1 = x10 + float(y_offset) * (x11 - x10) / float(scales[0]);\n return y0 + float(x_offset) * (y1 - y0) / float(scales[1]);\n }`;return Object.assign(Object.assign({},i),{output:{dims:u,type:t[0].type,textureType:a.TextureType.unpacked},shaderSource:b,variables:[{name:"scales",type:"int",arrayLength:n.scales.length,data:n.scales.map(e=>Math.ceil(e))}]})};t.validateInputs=(e,t)=>{if(!e||t.opset<9&&1!==e.length||t.opset>=9&&t.opset<11&&2!==e.length||t.opset>=11&&e.length<2)throw new Error("invalid inputs.");if(t.scales.length>0&&e[0].dims.length!==t.scales.length)throw new Error("Invalid input shape.");if("string"===e[0].type)throw new Error("Invalid input tensor types.")},t.scalesValidation=(e,t,n)=>{if(n){for(const r of e)if(r<=0)throw new Error("Scale value should be greater than 0.")}else for(const r of e)if(r<1)throw new Error("Scale value should be greater than or equal to 1.");if(!("linear"!==t&&"cubic"!==t||2===e.length||4===e.length&&1===e[0]&&1===e[1]))throw new Error(`'Linear' mode and 'Cubic' mode only support 2-D inputs ('Bilinear', 'Bicubic') or 4-D inputs with the corresponding outermost 2 scale values being 1 in the ${n?"Resize":"Upsample"} opeartor.`)}},1958:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ProgramManager=void 0;const r=n(1670),o=n(6231),a=n(8879),i=n(5060);t.ProgramManager=class{constructor(e,t,n){this.profiler=e,this.glContext=t,this.textureLayoutStrategy=n,this.repo=new Map,this.attributesBound=!1}getArtifact(e){return this.repo.get(e)}setArtifact(e,t){this.repo.set(e,t)}run(e,t,n){var r;this.profiler.event("op",`ProgramManager.run ${null!==(r=e.programInfo.name)&&void 0!==r?r:"unknown kernel"}`,()=>{var r;const a=this.glContext.gl,i=e.program;a.useProgram(i);try{this.bindOutput(n),this.attributesBound||this.bindAttributes(e.attribLocations),this.bindUniforms(e.uniformLocations,null!==(r=e.programInfo.variables)&&void 0!==r?r:[],t)}catch(s){throw o.Logger.error("ProgramManager",e.programInfo.shaderSource),s}this.profiler.event("backend","GlContext.draw()",()=>{this.glContext.draw()})},this.glContext)}dispose(){this.vertexShader&&this.glContext.deleteShader(this.vertexShader),this.repo.forEach(e=>this.glContext.deleteProgram(e.program))}build(e,t,n){return this.profiler.event("backend","ProgramManager.build",()=>{const r=new a.GlslPreprocessor(this.glContext,e,t,n),o=r.preprocess(),i=this.compile(o);return{programInfo:e,program:i,uniformLocations:this.getUniformLocations(i,r.context.programInfo.inputNames,r.context.programInfo.variables),attribLocations:this.getAttribLocations(i)}})}compile(e){if(!this.vertexShader){o.Logger.verbose("ProrgramManager","Compiling and caching Vertex shader for the first time");const e=(0,i.getVertexShaderSource)(this.glContext.version);this.vertexShader=this.glContext.compileShader(e,this.glContext.gl.VERTEX_SHADER)}r.env.debug&&o.Logger.verbose("ProrgramManager",`FragShader:\n${e}\n`);const t=this.glContext.compileShader(e,this.glContext.gl.FRAGMENT_SHADER),n=this.glContext.createProgram(this.vertexShader,t);return this.glContext.deleteShader(t),n}bindOutput(e){const t=e.width,n=e.height;o.Logger.verbose("ProrgramManager",`Binding output texture to Framebuffer: w/h=${t}/${n}, shape=${e.shape}, type=${e.tensor.type}`),this.glContext.attachFramebuffer(e.texture,t,n)}bindAttributes(e){const t=e.position,n=e.textureCoord;this.glContext.setVertexAttributes(t,n),this.attributesBound=!0}bindUniforms(e,t,n){var r;const o=this.glContext.gl;let a=0;for(const{name:i,type:s,location:l,arrayLength:u}of e){const e=null===(r=t.find(e=>e.name===i))||void 0===r?void 0:r.data;if("sampler2D"!==s&&!e)throw new Error(`variable '${i}' does not have data defined in program info`);switch(s){case"sampler2D":this.bindTexture(n[a],l,a),a++;break;case"float":u?o.uniform1fv(l,e):o.uniform1f(l,e);break;case"int":u?o.uniform1iv(l,e):o.uniform1i(l,e);break;default:throw new Error(`Uniform not implemented: ${s}`)}}}bindTexture(e,t,n){this.glContext.bindTextureToUniform(e.texture,n,t)}getAttribLocations(e){return{position:this.getAttribLocation(e,"position"),textureCoord:this.getAttribLocation(e,"textureCoord")}}getUniformLocations(e,t,n){const r=[];if(t)for(const o of t)r.push({name:o,type:"sampler2D",location:this.getUniformLocation(e,o)});if(n)for(const o of n)r.push(Object.assign(Object.assign({},o),{location:this.getUniformLocation(e,o.name)}));return r}getUniformLocation(e,t){const n=this.glContext.gl.getUniformLocation(e,t);if(null===n)throw new Error(`Uniform ${t} not found.`);return n}getAttribLocation(e,t){return this.glContext.gl.getAttribLocation(e,t)}}},6416:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WebGLSessionHandler=void 0;const r=n(6231),o=n(1047),a=n(8316),i=n(1640),s=n(1958),l=n(7859),u=n(5702);t.WebGLSessionHandler=class{constructor(e,t){this.backend=e,this.context=t,this.layoutStrategy=new l.PreferLogicalStrategy(e.glContext.maxTextureSize),this.programManager=new s.ProgramManager(this.context.profiler,e.glContext,this.layoutStrategy),this.textureManager=new u.TextureManager(e.glContext,this.layoutStrategy,this.context.profiler,{reuseTextures:"full"===e.textureCacheMode}),this.packedTextureDataCache=new Map,this.unpackedTextureDataCache=new Map,this.pack=e.pack,this.pack2unpackMap=new Map,this.unpack2packMap=new Map}createInferenceHandler(){return new a.WebGLInferenceHandler(this)}onGraphInitialized(e){const t=e.getValues().filter(e=>-1===e.from&&e.tensor).map(e=>e.tensor.dataId);this.initializers=new Set(t)}isInitializer(e){return!!this.initializers&&this.initializers.has(e)}addInitializer(e){this.initializers.add(e)}getTextureData(e,t){return t?this.packedTextureDataCache.get(e):this.unpackedTextureDataCache.get(e)}setTextureData(e,t,n=!1){r.Logger.verbose("WebGLSessionHandler","Storing Texture data in cache"),n?this.packedTextureDataCache.set(e,t):this.unpackedTextureDataCache.set(e,t)}dispose(){this.programManager.dispose(),this.textureManager.clearActiveTextures(),this.packedTextureDataCache.forEach(e=>this.textureManager.releaseTexture(e,!0)),this.packedTextureDataCache=new Map,this.unpackedTextureDataCache.forEach(e=>this.textureManager.releaseTexture(e,!0)),this.unpackedTextureDataCache=new Map}resolve(e,t,n){const r=(0,o.resolveOperator)(e,t,i.WEBGL_OP_RESOLVE_RULES);return{impl:r.opImpl,context:r.opInit?r.opInit(e,n):e}}}},7769:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Uint8DataEncoder=t.RGBAFloatDataEncoder=t.RedFloat32DataEncoder=void 0;const r=n(6231);t.RedFloat32DataEncoder=class{constructor(e,t=1){if(1===t)this.internalFormat=e.R32F,this.format=e.RED,this.textureType=e.FLOAT,this.channelSize=t;else{if(4!==t)throw new Error(`Invalid number of channels: ${t}`);this.internalFormat=e.RGBA32F,this.format=e.RGBA,this.textureType=e.FLOAT,this.channelSize=t}}encode(e,t){let n,o;return e.constructor!==Float32Array&&(r.Logger.warning("Encoder","data was not of type Float32; creating new Float32Array"),o=new Float32Array(e)),t*this.channelSize>e.length?(r.Logger.warning("Encoder","Source data too small. Allocating larger array"),o=e,n=this.allocate(t*this.channelSize),o.forEach((e,t)=>n[t]=e)):(o=e,n=o),n}allocate(e){return new Float32Array(4*e)}decode(e,t){return 1===this.channelSize?e.filter((e,t)=>t%4==0).subarray(0,t):e.subarray(0,t)}},t.RGBAFloatDataEncoder=class{constructor(e,t=1,n){if(1!==t&&4!==t)throw new Error(`Invalid number of channels: ${t}`);this.internalFormat=e.RGBA,this.format=e.RGBA,this.channelSize=t,this.textureType=n||e.FLOAT}encode(e,t){let n=e;return 1===this.channelSize&&(r.Logger.verbose("Encoder","Exploding into a larger array"),n=this.allocate(t),e.forEach((e,t)=>n[4*t]=e)),n}allocate(e){return new Float32Array(4*e)}decode(e,t){return 1===this.channelSize?e.filter((e,t)=>t%4==0).subarray(0,t):e.subarray(0,t)}},t.Uint8DataEncoder=class{constructor(e,t=1){if(this.channelSize=4,1===t)this.internalFormat=e.ALPHA,this.format=e.ALPHA,this.textureType=e.UNSIGNED_BYTE,this.channelSize=t;else{if(4!==t)throw new Error(`Invalid number of channels: ${t}`);this.internalFormat=e.RGBA,this.format=e.RGBA,this.textureType=e.UNSIGNED_BYTE,this.channelSize=t}}encode(e,t){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}allocate(e){return new Uint8Array(e*this.channelSize)}decode(e,t){if(e instanceof Uint8Array)return e.subarray(0,t);throw new Error(`Invalid array type: ${e.constructor}`)}}},7859:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getBatchDim=t.sizeToSquarishShape=t.getRowsCols=t.sizeFromShape=t.isInt=t.parseAxisParam=t.squeezeShape=t.PreferLogicalStrategy=t.AlwaysKeepOriginalSizeStrategy=void 0;const r=n(6231),o=n(2517);function a(e,t){const n=[],r=[],o=null!=t&&Array.isArray(t)&&0===t.length,a=null==t||o?null:i(t,e).sort();let s=0;for(let i=0;i<e.length;++i){if(null!=a){if(a[s]===i&&1!==e[i])throw new Error(`Can't squeeze axis ${i} since its dim '${e[i]}' is not 1`);(null==a[s]||a[s]>i)&&1===e[i]&&(n.push(e[i]),r.push(i)),a[s]<=i&&s++}1!==e[i]&&(n.push(e[i]),r.push(i))}return{newShape:n,keptDims:r}}function i(e,t){const n=t.length;return e=null==e?t.map((e,t)=>t):[].concat(e),(0,o.assert)(e.every(e=>e>=-n&&e<n),()=>`All values in axis param must be in range [-${n}, ${n}) but got axis ${e}`),(0,o.assert)(e.every(s),()=>`All values in axis param must be integers but got axis ${e}`),e.map(e=>e<0?n+e:e)}function s(e){return e%1==0}function l(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 u(e){const t=Math.ceil(Math.sqrt(e));return[t,Math.ceil(e/t)]}t.AlwaysKeepOriginalSizeStrategy=class{constructor(e){this.maxTextureSize=e}computeTextureWH(e,t){if(0===e.length)return[1,1];const n=this.maxTextureSize;if(t&&void 0!==t.breakAxis){const o=t.breakAxis>=e.length?1:e.slice(t.breakAxis).reduce((e,t)=>e*t),a=t.breakAxis<=0?1:e.slice(0,t.breakAxis).reduce((e,t)=>e*t);if(!(o>n||a>n))return[o,a];r.Logger.verbose("TextureLayout",`Given width/height preferences were unattainable: shape:${e}, breakAxis:${t.breakAxis}`)}const o=e.reduce((e,t)=>e*t);let a=Math.floor(Math.sqrt(o));for(;a<n&&a<o&&o%a!=0;a++);if(a>=n||o%a!=0)throw new Error(`The given dimensions are outside this GPU's boundaries: ${e}`);return[a,o/a]}},t.PreferLogicalStrategy=class{constructor(e){this.maxTextureSize=e}computeTextureWH(e,t){const n=this.computeTexture(e,t);return t&&t.isPacked&&(n[0]/=2,n[1]/=2),t&&t.reverseWH?[n[1],n[0]]:n}computeTexture(e,t){const n=t&&t.isPacked;if(0===e.length)return n?[2,2]:[1,1];let o=this.maxTextureSize;if(t&&void 0!==t.breakAxis){const n=t.breakAxis>=e.length?1:e.slice(t.breakAxis).reduce((e,t)=>e*t),a=t.breakAxis<=0?1:e.slice(0,t.breakAxis).reduce((e,t)=>e*t);if(!(n>o||a>o))return[n,a];r.Logger.verbose("TextureLayout",`Given width/height preferences were unattainable: shape:${e}, breakAxis:${t.breakAxis}`)}let i=e.slice(0);if(n&&(o*=2,i=i.map((e,t)=>t>=i.length-2?i[t]%2==0?i[t]:i[t]+1:i[t]),1===i.length&&(i=[2,i[0]])),2!==i.length){const e=a(i);i=e.newShape}const s=l(i);return i.length<=1&&s<=o?[1,s]:2===i.length&&i[0]<=o&&i[1]<=o?i:3===i.length&&i[0]*i[1]<=o&&i[2]<=o?[i[0]*i[1],i[2]]:3===i.length&&i[0]<=o&&i[1]*i[2]<=o?[i[0],i[1]*i[2]]:4===i.length&&i[0]*i[1]*i[2]<=o&&i[3]<=o?[i[0]*i[1]*i[2],i[3]]:4===i.length&&i[0]<=o&&i[1]*i[2]*i[3]<=o?[i[0],i[1]*i[2]*i[3]]:n?u(s/4).map(e=>2*e):u(s)}},t.squeezeShape=a,t.parseAxisParam=i,t.isInt=s,t.sizeFromShape=l,t.getRowsCols=function(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]]},t.sizeToSquarishShape=u,t.getBatchDim=function(e,t=2){return l(e.slice(0,e.length-t))}},4057:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createTextureLayoutFromShape=t.calculateTextureWidthAndHeight=t.createTextureLayoutFromTextureType=void 0;const r=n(2517),o=n(2039);t.createTextureLayoutFromTextureType=(e,n,r)=>{const a=r===o.TextureType.unpacked||r===o.TextureType.unpackedReversed?1:4,i=r===o.TextureType.packed,s=r===o.TextureType.unpackedReversed||r===o.TextureType.packed,l=r===o.TextureType.packedLastDimension?n.length-1:void 0,u=r===o.TextureType.packedLastDimension?n.map((e,t)=>t===n.length-1?4*e:e):void 0;return(0,t.createTextureLayoutFromShape)(e,n,a,u,{isPacked:i,reverseWH:s,breakAxis:l})},t.calculateTextureWidthAndHeight=(e,n,r)=>{const o=(0,t.createTextureLayoutFromTextureType)(e,n,r);return[o.width,o.height]},t.createTextureLayoutFromShape=(e,t,n=1,o,a)=>{const i=!(!a||!a.isPacked),[s,l]=e.computeTextureWH(i&&o||t,a),u=t.length;let c=t.slice(0);if(0===u&&(c=[1]),1===n)o=t;else if(i){if(4!==n)throw new Error("a packed texture must be 4-channel");o=t,u>0&&(c[u-1]=Math.ceil(c[u-1]/2)),u>1&&(c[u-2]=Math.ceil(c[u-2]/2))}else if(!o)throw new Error("Unpacked shape is needed when using channels > 1");return{width:s,height:l,channels:n,isPacked:i,shape:c,strides:r.ShapeUtil.computeStrides(c),unpackedShape:o,reversedWH:a&&a.reverseWH}}},5702:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextureManager=void 0;const r=n(6231);t.TextureManager=class{constructor(e,t,n,r){this.glContext=e,this.layoutStrategy=t,this.profiler=n,this.config=r,this.pendingRead=new Map,r.reuseTextures&&(this.inUseTextures=new Map,this.idleTextures=new Map,this.textureLookup=new Map)}createTextureFromLayout(e,t,n,o){const a=this.toEncoderType(e),i=this.glContext.getEncoder(a,t.channels||1,o);if(t.isPacked&&1===o)throw new Error("not implemented");const s=t.width,l=t.height;let u,c;if(this.config.reuseTextures){u=`${s}x${l}_${i.format}_${i.internalFormat}_${i.textureType}`,c=this.inUseTextures.get(u),c||(c=[],this.inUseTextures.set(u,c));const t=this.idleTextures.get(u);if(t&&t.length>0){const r=t.pop();return c.push(r),1===o&&this.glContext.updateTexture(r,s,l,i,this.toTextureData(e,n)),r}}r.Logger.verbose("TextureManager",`Creating new texture of size ${t.width}x${t.height}`);const d=this.glContext.allocateTexture(s,l,i,this.toTextureData(e,n));return this.config.reuseTextures&&(c.push(d),this.textureLookup.set(d,u)),d}readTexture(e,t,n){return n||(n=1),this.profiler.event("backend","TextureManager.readTexture",()=>{const r=e.shape.reduce((e,t)=>e*t)*n,o=this.glContext.readTexture(e.texture,e.width,e.height,r,this.toEncoderType(t),n);return this.toTensorData(t,o)})}async readTextureAsync(e,t,n){const r=e.tensor.dataId;if(n||(n=1),this.pendingRead.has(r)){const e=this.pendingRead.get(r);return new Promise(t=>null==e?void 0:e.push(t))}return this.profiler.event("backend","TextureManager.readTextureAsync",async()=>{this.pendingRead.set(r,[]);const o=e.shape.reduce((e,t)=>e*t)*n;await this.glContext.createAndWaitForFence();const a=this.glContext.readTexture(e.texture,e.width,e.height,o,this.toEncoderType(t),n),i=this.toTensorData(t,a),s=this.pendingRead.get(r);return this.pendingRead.delete(r),null==s||s.forEach(e=>e(i)),i})}readUint8TextureAsFloat(e){return this.profiler.event("backend","TextureManager.readUint8TextureAsFloat",()=>{const t=e.shape.reduce((e,t)=>e*t),n=this.glContext.readTexture(e.texture,e.width,e.height,4*t,"byte",4);return new Float32Array(n.buffer,n.byteOffset,t)})}releaseTexture(e,t){let n;if(this.config.reuseTextures&&(n=this.textureLookup.get(e.texture),n)){t&&this.textureLookup.delete(n);const r=this.inUseTextures.get(n);if(r){const t=r.indexOf(e.texture);if(-1!==t){r.splice(t,1);let o=this.idleTextures.get(n);o||(o=[],this.idleTextures.set(n,o)),o.push(e.texture)}}}n&&!t||(r.Logger.verbose("TextureManager",`Deleting texture of size ${e.width}x${e.height}`),this.glContext.deleteTexture(e.texture))}toTensorData(e,t){switch(e){case"int16":return t instanceof Int16Array?t:Int16Array.from(t);case"int32":return t instanceof Int32Array?t:Int32Array.from(t);case"int8":return t instanceof Int8Array?t:Int8Array.from(t);case"uint16":return t instanceof Uint16Array?t:Uint16Array.from(t);case"uint32":return t instanceof Uint32Array?t:Uint32Array.from(t);case"uint8":case"bool":return t instanceof Uint8Array?t:Uint8Array.from(t);case"float32":return t instanceof Float32Array?t:Float32Array.from(t);case"float64":return t instanceof Float64Array?t:Float64Array.from(t);default:throw new Error(`TensorData type ${e} is not supported`)}}toTextureData(e,t){if(t)return t instanceof Float32Array?t:new Float32Array(t)}toEncoderType(e){return"float"}clearActiveTextures(){this.glContext.clearActiveTextures()}}},2039:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.TextureType=void 0,(n=t.TextureType||(t.TextureType={}))[n.unpacked=0]="unpacked",n[n.unpackedReversed=1]="unpackedReversed",n[n.packed=2]="packed",n[n.downloadUint8AsFloat=3]="downloadUint8AsFloat",n[n.packedLastDimension=4]="packedLastDimension"},9390:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getGlChannels=t.getCoordsDataType=t.getSqueezedParams=t.squeezeInputShape=t.generateShaderFuncNameFromInputSamplerNameAtOutCoords=t.generateShaderFuncNameFromInputSamplerName=t.repeatedTry=t.getPackedShape=void 0;const r=n(2517);t.getPackedShape=function(e){const t=e.length;return e.slice(0,t-1).concat(e[t-1]/4)},t.repeatedTry=async function(e,t=e=>0,n){return new Promise((r,o)=>{let a=0;const i=()=>{if(e())return void r();a++;const s=t(a);null!=n&&a>=n?o():setTimeout(i,s)};i()})},t.generateShaderFuncNameFromInputSamplerName=function(e){return(0,r.assert)(void 0!==e&&0!==e.length,()=>"empty string found for sampler name"),"get"+e.charAt(0).toUpperCase()+e.slice(1)},t.generateShaderFuncNameFromInputSamplerNameAtOutCoords=function(e){return(0,r.assert)(void 0!==e&&0!==e.length,()=>"empty string found for sampler name"),"get"+e.charAt(0).toUpperCase()+e.slice(1)+"AtOutCoords"},t.squeezeInputShape=function(e,t){let n=JSON.parse(JSON.stringify(e));return n=t,n},t.getSqueezedParams=function(e,t){return t.map(t=>e[t]).join(", ")},t.getCoordsDataType=function(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`)},t.getGlChannels=function(e=6){return["x","y","z","w","u","v"].slice(0,e)}},7305:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createNewWebGLContext=t.createWebGLContext=void 0;const r=n(6231),o=n(1713),a={};function i(e){const t=function(){if("undefined"==typeof document){if("undefined"==typeof OffscreenCanvas)throw new TypeError("failed to create canvas: OffscreenCanvas is not supported");return new OffscreenCanvas(1,1)}const e=document.createElement("canvas");return e.width=1,e.height=1,e}();let n;const a={alpha:!1,depth:!1,antialias:!1,stencil:!1,preserveDrawingBuffer:!1,premultipliedAlpha:!1,failIfMajorPerformanceCaveat:!1};if((!e||"webgl2"===e)&&(n=t.getContext("webgl2",a),n))try{return new o.WebGLContext(n,2)}catch(i){r.Logger.warning("GlContextFactory",`failed to create WebGLContext using contextId 'webgl2'. Error: ${i}`)}if((!e||"webgl"===e)&&(n=t.getContext("webgl",a)||t.getContext("experimental-webgl",a),n))try{return new o.WebGLContext(n,1)}catch(i){r.Logger.warning("GlContextFactory",`failed to create WebGLContext using contextId 'webgl' or 'experimental-webgl'. Error: ${i}`)}throw new Error("WebGL is not supported")}t.createWebGLContext=function e(t){let n;t&&"webgl2"!==t||!("webgl2"in a)?t&&"webgl"!==t||!("webgl"in a)||(n=a.webgl):n=a.webgl2,n=n||i(t),t=t||1===n.version?"webgl":"webgl2";const r=n.gl;return a[t]=n,r.isContextLost()?(delete a[t],e(t)):(r.disable(r.DEPTH_TEST),r.disable(r.STENCIL_TEST),r.disable(r.BLEND),r.disable(r.DITHER),r.disable(r.POLYGON_OFFSET_FILL),r.disable(r.SAMPLE_COVERAGE),r.enable(r.SCISSOR_TEST),r.enable(r.CULL_FACE),r.cullFace(r.BACK),n)},t.createNewWebGLContext=i},1713:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.WebGLContext=t.linearSearchLastTrue=void 0;const i=n(1670),s=a(n(7769)),l=n(9390);function u(e){let t=0;for(;t<e.length&&e[t]();++t);return t-1}t.linearSearchLastTrue=u,t.WebGLContext=class{constructor(e,t){this.frameBufferBound=!1,this.itemsToPoll=[],this.gl=e,this.version=t,this.getExtensions(),this.vertexbuffer=this.createVertexbuffer(),this.framebuffer=this.createFramebuffer(),this.queryVitalParameters()}allocateTexture(e,t,n,r){const o=this.gl,a=o.createTexture();o.bindTexture(o.TEXTURE_2D,a),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,o.NEAREST),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,o.NEAREST),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,o.CLAMP_TO_EDGE),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,o.CLAMP_TO_EDGE);const i=r?n.encode(r,e*t):null;return o.texImage2D(o.TEXTURE_2D,0,n.internalFormat,e,t,0,n.format,n.textureType,i),this.checkError(),a}updateTexture(e,t,n,r,o){const a=this.gl;a.bindTexture(a.TEXTURE_2D,e);const i=r.encode(o,t*n);a.texSubImage2D(a.TEXTURE_2D,0,0,0,t,n,r.format,r.textureType,i),this.checkError()}attachFramebuffer(e,t,n){const r=this.gl;r.bindTexture(r.TEXTURE_2D,e),r.bindFramebuffer(r.FRAMEBUFFER,this.framebuffer),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,e,0),this.checkError(),r.viewport(0,0,t,n),r.scissor(0,0,t,n)}readTexture(e,t,n,r,o,a){const i=this.gl;a||(a=1),this.frameBufferBound||this.attachFramebuffer(e,t,n);const s=this.getEncoder(o,a),l=s.allocate(t*n);return i.bindTexture(i.TEXTURE_2D,e),i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,e,0),i.readPixels(0,0,t,n,i.RGBA,s.textureType,l),this.checkError(),s.decode(l,r)}isFramebufferReady(){return!0}getActiveTexture(){const e=this.gl;return"TEXTURE"+(e.getParameter(this.gl.ACTIVE_TEXTURE)-e.TEXTURE0)}getTextureBinding(){return this.gl.getParameter(this.gl.TEXTURE_BINDING_2D)}getFramebufferBinding(){return this.gl.getParameter(this.gl.FRAMEBUFFER_BINDING)}setVertexAttributes(e,t){const n=this.gl;n.vertexAttribPointer(e,3,n.FLOAT,!1,20,0),n.enableVertexAttribArray(e),-1!==t&&(n.vertexAttribPointer(t,2,n.FLOAT,!1,20,12),n.enableVertexAttribArray(t)),this.checkError()}createProgram(e,t){const n=this.gl,r=n.createProgram();return n.attachShader(r,e),n.attachShader(r,t),n.linkProgram(r),r}compileShader(e,t){const n=this.gl,r=n.createShader(t);if(!r)throw new Error(`createShader() returned null with type ${t}`);if(n.shaderSource(r,e),n.compileShader(r),!1===n.getShaderParameter(r,n.COMPILE_STATUS))throw new Error(`Failed to compile shader: ${n.getShaderInfoLog(r)}\nShader source:\n${e}`);return r}deleteShader(e){this.gl.deleteShader(e)}bindTextureToUniform(e,t,n){const r=this.gl;r.activeTexture(r.TEXTURE0+t),this.checkError(),r.bindTexture(r.TEXTURE_2D,e),this.checkError(),r.uniform1i(n,t),this.checkError()}draw(){this.gl.drawArrays(this.gl.TRIANGLE_STRIP,0,4),this.checkError()}checkError(){if(i.env.debug){const e=this.gl,t=e.getError();let n="";switch(t){case e.NO_ERROR:return;case e.INVALID_ENUM:n="INVALID_ENUM";break;case e.INVALID_VALUE:n="INVALID_VALUE";break;case e.INVALID_OPERATION:n="INVALID_OPERATION";break;case e.INVALID_FRAMEBUFFER_OPERATION:n="INVALID_FRAMEBUFFER_OPERATION";break;case e.OUT_OF_MEMORY:n="OUT_OF_MEMORY";break;case e.CONTEXT_LOST_WEBGL:n="CONTEXT_LOST_WEBGL";break;default:n=`Unknown WebGL Error: ${t.toString(16)}`}throw new Error(n)}}deleteTexture(e){this.gl.deleteTexture(e)}deleteProgram(e){this.gl.deleteProgram(e)}getEncoder(e,t,n=0){if(2===this.version)return new s.RedFloat32DataEncoder(this.gl,t);switch(e){case"float":return 1===n||this.isRenderFloat32Supported?new s.RGBAFloatDataEncoder(this.gl,t):new s.RGBAFloatDataEncoder(this.gl,t,this.textureHalfFloatExtension.HALF_FLOAT_OES);case"int":throw new Error("not implemented");case"byte":return new s.Uint8DataEncoder(this.gl,t);default:throw new Error(`Invalid dataType: ${e}`)}}clearActiveTextures(){const e=this.gl;for(let t=0;t<this.maxTextureImageUnits;++t)e.activeTexture(e.TEXTURE0+t),e.bindTexture(e.TEXTURE_2D,null)}dispose(){if(this.disposed)return;const e=this.gl;e.bindFramebuffer(e.FRAMEBUFFER,null),e.deleteFramebuffer(this.framebuffer),e.bindBuffer(e.ARRAY_BUFFER,null),e.deleteBuffer(this.vertexbuffer),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null),e.finish(),this.disposed=!0}createDefaultGeometry(){return new Float32Array([-1,1,0,0,1,-1,-1,0,0,0,1,1,0,1,1,1,-1,0,1,0])}createVertexbuffer(){const e=this.gl,t=e.createBuffer();if(!t)throw new Error("createBuffer() returned null");const n=this.createDefaultGeometry();return e.bindBuffer(e.ARRAY_BUFFER,t),e.bufferData(e.ARRAY_BUFFER,n,e.STATIC_DRAW),this.checkError(),t}createFramebuffer(){const e=this.gl.createFramebuffer();if(!e)throw new Error("createFramebuffer returned null");return e}queryVitalParameters(){const e=this.gl;if(this.isFloatTextureAttachableToFrameBuffer=this.checkFloatTextureAttachableToFrameBuffer(),this.isRenderFloat32Supported=this.checkRenderFloat32(),this.isFloat32DownloadSupported=this.checkFloat32Download(),1===this.version&&!this.textureHalfFloatExtension&&!this.isRenderFloat32Supported)throw new Error("both float32 and float16 TextureType are not supported");this.isBlendSupported=!this.isRenderFloat32Supported||this.checkFloat32Blend(),this.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE),this.maxTextureImageUnits=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),this.version}getExtensions(){2===this.version?(this.colorBufferFloatExtension=this.gl.getExtension("EXT_color_buffer_float"),this.disjointTimerQueryWebgl2Extension=this.gl.getExtension("EXT_disjoint_timer_query_webgl2")):(this.textureFloatExtension=this.gl.getExtension("OES_texture_float"),this.textureHalfFloatExtension=this.gl.getExtension("OES_texture_half_float"))}checkFloatTextureAttachableToFrameBuffer(){const e=this.gl,t=e.createTexture();e.bindTexture(e.TEXTURE_2D,t);const n=2===this.version?e.RGBA32F:e.RGBA;e.texImage2D(e.TEXTURE_2D,0,n,1,1,0,e.RGBA,e.FLOAT,null);const r=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,r),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0);const o=e.checkFramebufferStatus(e.FRAMEBUFFER)===e.FRAMEBUFFER_COMPLETE;return e.bindTexture(e.TEXTURE_2D,null),e.bindFramebuffer(e.FRAMEBUFFER,null),e.deleteTexture(t),e.deleteFramebuffer(r),o}checkRenderFloat32(){if(2===this.version){if(!this.colorBufferFloatExtension)return!1}else if(!this.textureFloatExtension)return!1;return this.isFloatTextureAttachableToFrameBuffer}checkFloat32Download(){if(2===this.version){if(!this.colorBufferFloatExtension)return!1}else{if(!this.textureFloatExtension)return!1;if(!this.gl.getExtension("WEBGL_color_buffer_float"))return!1}return this.isFloatTextureAttachableToFrameBuffer}checkFloat32Blend(){const e=this.gl;let t,n,r,o,a;try{t=e.createTexture(),n=e.createFramebuffer(),e.bindTexture(e.TEXTURE_2D,t);const i=2===this.version?e.RGBA32F:e.RGBA;return e.texImage2D(e.TEXTURE_2D,0,i,1,1,0,e.RGBA,e.FLOAT,null),e.bindFramebuffer(e.FRAMEBUFFER,n),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0),e.enable(e.BLEND),r=e.createShader(e.VERTEX_SHADER),!!r&&(e.shaderSource(r,"void main(){}"),e.compileShader(r),o=e.createShader(e.FRAGMENT_SHADER),!!o&&(e.shaderSource(o,"precision highp float;void main(){gl_FragColor=vec4(0.5);}"),e.compileShader(o),a=e.createProgram(),!!a&&(e.attachShader(a,r),e.attachShader(a,o),e.linkProgram(a),e.useProgram(a),e.drawArrays(e.POINTS,0,1),e.getError()===e.NO_ERROR)))}finally{e.disable(e.BLEND),a&&e.deleteProgram(a),r&&e.deleteShader(r),o&&e.deleteShader(o),n&&(e.bindFramebuffer(e.FRAMEBUFFER,null),e.deleteFramebuffer(n)),t&&(e.bindTexture(e.TEXTURE_2D,null),e.deleteTexture(t))}}beginTimer(){if(2===this.version&&this.disjointTimerQueryWebgl2Extension){const e=this.gl,t=this.disjointTimerQueryWebgl2Extension,n=e.createQuery();return e.beginQuery(t.TIME_ELAPSED_EXT,n),n}throw new Error("WebGL1 profiling currently not supported.")}endTimer(){if(2!==this.version||!this.disjointTimerQueryWebgl2Extension)throw new Error("WebGL1 profiling currently not supported");{const e=this.gl,t=this.disjointTimerQueryWebgl2Extension;e.endQuery(t.TIME_ELAPSED_EXT)}}isTimerResultAvailable(e){let t=!1,n=!1;if(2!==this.version||!this.disjointTimerQueryWebgl2Extension)throw new Error("WebGL1 profiling currently not supported");{const r=this.gl,o=this.disjointTimerQueryWebgl2Extension;t=r.getQueryParameter(e,r.QUERY_RESULT_AVAILABLE),n=r.getParameter(o.GPU_DISJOINT_EXT)}return t&&!n}getTimerResult(e){let t=0;if(2!==this.version)throw new Error("WebGL1 profiling currently not supported");{const n=this.gl;t=n.getQueryParameter(e,n.QUERY_RESULT),n.deleteQuery(e)}return t/1e6}async waitForQueryAndGetTime(e){return await(0,l.repeatedTry)(()=>this.isTimerResultAvailable(e)),this.getTimerResult(e)}async createAndWaitForFence(){const e=this.createFence(this.gl);return this.pollFence(e)}createFence(e){let t;const n=e,r=n.fenceSync(n.SYNC_GPU_COMMANDS_COMPLETE,0);return e.flush(),t=null===r?()=>!0:()=>{const e=n.clientWaitSync(r,0,0);return e===n.ALREADY_SIGNALED||e===n.CONDITION_SATISFIED},{query:r,isFencePassed:t}}async pollFence(e){return new Promise(t=>{this.addItemToPoll(()=>e.isFencePassed(),()=>t())})}pollItems(){const e=u(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)}async addItemToPoll(e,t){this.itemsToPoll.push({isDoneFn:e,resolveFn:t}),this.itemsToPoll.length>1||await(0,l.repeatedTry)(()=>(this.pollItems(),0===this.itemsToPoll.length))}}},1036:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ExecutionPlan=void 0;const r=n(6231);class o{constructor(e,t){this.op=e,this.node=t}}t.ExecutionPlan=class{constructor(e,t,n){this.graph=e,this.profiler=n,this.initialize(t)}initialize(e){this.profiler.event("session","ExecutionPlan.initialize",()=>{const t=this.graph.getNodes();if(t.length!==e.length)throw new Error("The size of nodes and OPs do not match.");this._ops=e.map((e,n)=>new o(e,t[n])),this.reset(),this._starter=[],this._ops.forEach((e,t)=>{let n=!0;for(const r of e.node.inputs)if(!this._values[r]&&-1===this.graph.getInputIndices().indexOf(r)){n=!1;break}n&&this._starter.push(t)})})}reset(){this._values=this.graph.getValues().map(e=>e.tensor)}async execute(e,t){return this.profiler.event("session","ExecutionPlan.execute",async()=>{this.reset();const n=e.createInferenceHandler(),o=this.graph.getInputIndices();if(t.length!==o.length)throw new Error(`number of input tensors don't match the number of inputs to the model: actual: ${t.length} expected: ${o.length}`);t.forEach((e,t)=>{const n=o[t];this._values[n]=e});const a=this._starter.slice(0),i=this.graph.getValues(),s=this.graph.getNodes();let l=0;for(;l<a.length;){const e=a[l++],t=this._ops[e],o=t.node.inputs.map(e=>this._values[e]);if(-1!==o.indexOf(void 0))throw new Error(`unresolved input detected: op: ${t.node}`);const u=o;r.Logger.verbose("ExecPlan",`Runing op:${t.node.name} (${u.map((e,n)=>`'${t.node.inputs[n]}': ${e.type}[${e.dims.join(",")}]`).join(", ")})`);const c=await this.profiler.event("node",t.node.name,async()=>t.op.impl(n,u,t.op.context));if(c.length!==t.node.outputs.length)throw new Error("the size of output does not match model definition.");c.forEach((e,n)=>{const r=t.node.outputs[n];if(this._values[r])throw new Error(`output [${r}] already has value: op:${t.node.name}`);this._values[r]=e});const d=new Set;c.forEach((e,n)=>{const r=t.node.outputs[n];for(const t of i[r].to){const e=s[t];let n=!0;for(const t of e.inputs)if(!this._values[t]){n=!1;break}n&&d.add(t)}}),a.push(...d)}const u=[];for(let e=0;e<this.graph.getOutputIndices().length;e++){const t=this.graph.getOutputIndices()[e],n=this._values[t];if(void 0===n)throw new Error(`required output [${t}] does not have value`);0===t?await n.getData():n.data,u.push(n)}return r.Logger.verbose("ExecPlan","disposing of inferenceHandler"),n.dispose(),u})}}},7070:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Graph=void 0;const r=n(1446),o=n(7778),a=n(9395),i=n(9162),s=n(2517);var l=a.onnxruntime.experimental.fbs;t.Graph={from:(e,t)=>new d(e,t)};class u{constructor(e){this._from=void 0,this._to=[],this.tensor=void 0,this.type=void 0,e&&(this.type=s.ProtoUtil.tensorValueTypeFromProto(e.type.tensorType))}get from(){return this._from}get to(){return this._to}}class c{constructor(e,t){e instanceof r.onnx.NodeProto?(this.name=e.name,this.opType=e.opType,this.attributes=new o.Attribute(e.attribute)):e instanceof l.Node&&(this.name=null!=t?t:e.name(),this.opType=e.opType(),this.attributes=new o.Attribute(s.ProtoUtil.tensorAttributesFromORTFormat(e))),this.inputs=[],this.outputs=[],this.executeNode=!0}}class d{constructor(e,t){if(!e)throw new TypeError("graph is empty");this.buildGraph(e),this.transformGraph(t),this.checkIsAcyclic()}getInputIndices(){return this._allInputIndices}getInputNames(){return this._allInputNames}getOutputIndices(){return this._allOutputIndices}getOutputNames(){return this._allOutputNames}getValues(){return this._allData}getNodes(){return this._nodes}buildGraph(e){if(e instanceof r.onnx.GraphProto)this.buildGraphFromOnnxFormat(e);else{if(!(e instanceof l.Graph))throw new TypeError("Graph type is not supported.");this.buildGraphFromOrtFormat(e)}}buildGraphFromOnnxFormat(e){const t=new Map;this._allData=[],this._allInputIndices=[],this._allInputNames=[],this._allOutputIndices=[],this._allOutputNames=[],this._nodes=[];const n=new Map;if(!e.input)throw new Error("missing information in graph: input");const r=[];for(const o of e.input){if(t.has(o.name))throw new Error(`duplicated input name: ${o.name}`);const e=this._allData.push(new u(o))-1;t.set(o.name,e),r.push(o.name)}if(!e.initializer)throw new Error("missing information in graph: initializer");for(const o of e.initializer){let e=t.get(o.name);if(void 0===e){const n=new u;n.type={shape:{dims:s.ProtoUtil.tensorDimsFromProto(o.dims)},tensorType:s.ProtoUtil.tensorDataTypeFromProto(o.dataType)},e=this._allData.push(n)-1,t.set(o.name,e)}this._allData[e]._from=-1,this._allData[e].tensor=i.Tensor.fromProto(o)}for(let o=0;o<this._allData.length;o++)this._allData[o].tensor||(this._allInputIndices.push(o),this._allInputNames.push(r[o]));if(!e.output)throw new Error("missing information in graph: output");for(const o of e.output){if(t.has(o.name))throw new Error(`duplicated output name: ${o.name}`);const e=this._allData.push(new u(o))-1;t.set(o.name,e),this._allOutputIndices.push(e),this._allOutputNames.push(o.name)}if(!e.node)throw new Error("missing information in graph: node");for(const o of e.node){if(!o.name)for(let t=0;;t++){const e=`unnamed_${o.opType}_${t}`;if(!n.has(e)){o.name=e;break}}if(n.has(o.name))throw new Error(`duplicated node name: ${o.name}`);const e=this._nodes.push(new c(o))-1;n.set(o.name,e)}for(let o=0;o<this._nodes.length;o++){const n=this._nodes[o],r=e.node[o];if(!r.output)throw new Error(`missing output for node: ${r.name}`);for(const e of r.output){let a=t.get(e);if(void 0===a&&(a=this._allData.push(new u)-1,t.set(e,a)),n.outputs.push(a),void 0!==this._allData[a]._from)throw new Error(`multiple nodes output to one data value: ${a}`);if(this._allData[a]._from=o,"Constant"===r.opType){if(!r.attribute||1!==r.attribute.length||!r.attribute[0].t)throw new Error("missing attributes or missing tensor value in attributes for this Constant operator");if(!r.output||1!==r.output.length)throw new Error("missing output or incorrect number of outputs for this Constant operator");n.outputs.pop(),n.executeNode=!1,this._allData[a]._from=-1,this._allData[a].tensor=i.Tensor.fromProto(r.attribute[0].t)}}}for(let o=0;o<this._nodes.length;o++){const n=this._nodes[o],r=e.node[o];if(!r.input)throw new Error(`missing input for node: ${r.name}`);for(const e of r.input){const a=t.get(e);if(void 0===a){if(""===e&&3===r.input.length&&"Resize"===r.opType)continue;throw new Error(`unrecognized input '${e}' for node: ${r.name}`)}n.inputs.push(a),this._allData[a]._to.push(o)}}return!0}buildGraphFromOrtFormat(e){var t,n,r;const o=new Map;this._allData=[],this._allInputIndices=[],this._allInputNames=[],this._allOutputIndices=[],this._allOutputNames=[],this._nodes=[];const a=new Map,d=[];for(let i=0;i<e.inputsLength();i++){const a=e.inputs(i);if(o.has(a))throw new Error(`duplicated input name: ${a}`);for(let i=0;i<e.nodeArgsLength();i++)if((null===(t=e.nodeArgs(i))||void 0===t?void 0:t.name())===a){const t=new u;if((null===(r=null===(n=e.nodeArgs(i))||void 0===n?void 0:n.type())||void 0===r?void 0:r.valueType())!==l.TypeInfoValue.tensor_type)throw new Error("Unexpected value type for the nodeArg.");const c=e.nodeArgs(i).type().value(new l.TensorTypeAndShape),f=s.ProtoUtil.tensorDataTypeFromProto(c.elemType()),p=c.shape(),h=[];for(let e=0;e<p.dimLength();e++)h.push(s.LongUtil.longToNumber(p.dim(e).value().dimValue()));t.type={shape:{dims:h},tensorType:f};const m=this._allData.push(t)-1;o.set(a,m),d.push(a)}}for(let l=0;l<e.initializersLength();l++){const t=e.initializers(l);let n=o.get(t.name());if(void 0===n){const e=new u,r=s.ProtoUtil.tensorDimsFromORTFormat(t),a=s.ProtoUtil.tensorDataTypeFromProto(t.dataType());e.type={shape:{dims:r},tensorType:a},n=this._allData.push(e)-1,o.set(t.name(),n)}this._allData[n]._from=-1,this._allData[n].tensor=i.Tensor.fromOrtTensor(t)}for(let i=0;i<this._allData.length;i++)this._allData[i].tensor||(this._allInputIndices.push(i),this._allInputNames.push(d[i]));for(let i=0;i<e.outputsLength();i++){const t=e.outputs(i);if(o.has(t))throw new Error(`duplicated output name: ${t}`);const n=this._allData.push(new u)-1;o.set(t,n),this._allOutputIndices.push(n),this._allOutputNames.push(t)}if(!e.nodes)throw new Error("missing information in graph: node");for(let i=0;i<e.nodesLength();i++){const t=e.nodes(i);let n=t.name();if(!n)for(let e=0;n=`unnamed_${t.opType()}_${e}`,a.has(n);e++);if(a.has(n))throw new Error(`duplicated node name: ${n}`);const r=this._nodes.push(new c(t,n))-1;a.set(n,r)}for(let s=0;s<this._nodes.length;s++){const t=this._nodes[s],n=e.nodes(s);if(null==n)throw new Error(`No node exists at index ${s}`);if(0===(null==n?void 0:n.outputsLength()))throw new Error(`missing output for node: ${n.name}`);for(let e=0;e<(null==n?void 0:n.outputsLength());e++){const r=null==n?void 0:n.outputs(e);let a=o.get(r);if(void 0===a&&(a=this._allData.push(new u)-1,o.set(r,a)),t.outputs.push(a),void 0!==this._allData[a]._from)throw new Error(`multiple nodes output to one data value: ${a}`);if(this._allData[a]._from=s,"Constant"===n.opType()){if(1!==n.attributesLength()||!n.attributes(0).t())throw new Error("missing attributes or missing tensor value in attributes for this Constant operator");if(1!==n.outputsLength())throw new Error("missing output or incorrect number of outputs for this Constant operator");t.outputs.pop(),t.executeNode=!1,this._allData[a]._from=-1,this._allData[a].tensor=i.Tensor.fromOrtTensor(n.attributes(0).t())}}}for(let i=0;i<this._nodes.length;i++){const t=this._nodes[i],n=e.nodes(i);if(0===n.inputsLength())throw new Error(`missing input for node: ${n.name}`);for(let e=0;e<n.inputsLength();e++){const r=n.inputs(e),a=o.get(r);if(void 0===a)throw new Error(`unrecognized input '${r}' for node: ${n.name()}`);t.inputs.push(a),this._allData[a]._to.push(i)}}}checkIsAcyclic(){const e=new Set;this._allInputIndices.forEach(t=>{this._allData[t]._to.forEach(t=>{e.add(t)})});const t=Array.from(e),n=new Array(this._nodes.length).fill("white");for(;t.length>0;){const e=t.pop();"gray"===n[e]?n[e]="black":(t.push(e),n[e]="gray",this._nodes[e].outputs.forEach(r=>{const o=this._allData[r];if(void 0!==o.tensor)throw new Error("node outputs should not be initialized");if(o._from!==e)throw new Error("from property of the Value object doesn't match index of Node being processed");o._to.forEach(e=>{if("gray"===n[e])throw new Error("model graph is cyclic");"white"===n[e]&&t.push(e)})}))}}transformGraph(e){this.removeAllIdentityNodes(),this.removeAllDropoutNodes(),this.fuseConvActivationNodes(),e&&e.transformGraph(this),this.finalizeGraph()}finalizeGraph(){let e=0;for(let t=0;t<this._nodes.length;t++)this._nodes[t].executeNode?e>0&&(this._nodes[t].inputs.forEach(n=>{const r=this._allData[n]._to.indexOf(t+e);-1!==r&&(this._allData[n]._to[r]=t)}),this._nodes[t].outputs.forEach(n=>{this._allData[n]._from&&this._allData[n]._from===t+e&&(this._allData[n]._from=t)})):(e++,this._nodes[t].outputs.forEach(e=>{this._allData[e]._from=-2}),this._nodes.splice(t,1),t--);e=0;for(let t=0;t<this._allData.length;t++)if(-2!==this._allData[t].from||-1!==this._allOutputIndices.indexOf(t+e)){if(e>0){let n=-1;void 0!==this._allData[t].from&&-1!==this._allData[t].from?(n=this._nodes[this._allData[t].from].outputs.indexOf(t+e),-1!==n&&(this._nodes[this._allData[t].from].outputs[n]=t)):(n=this._allInputIndices.indexOf(t+e),-1!==n&&(this._allInputIndices[n]=t)),this._allData[t].to.forEach(r=>{n=this._nodes[r].inputs.indexOf(t+e),-1!==n&&(this._nodes[r].inputs[n]=t)}),0===this._allData[t].to.length&&(n=this._allOutputIndices.indexOf(t+e),-1!==n&&(this._allOutputIndices[n]=t))}}else e++,this._allData.splice(t,1),t--}deleteNode(e){const t=this._nodes[e];if(t.outputs.length>1)for(let s=1;s<t.outputs.length;s++)if(this._allData[t.outputs[s]].to.length>0)throw new Error("Node deletion with more than one output connected to other nodes is not supported. ");t.executeNode=!1;const n=t.inputs[0],r=t.outputs[0],o=this._allData[r].to,a=this._allData[n].to.indexOf(e);if(-1===a)throw new Error("The Value object doesn't have the current Node in it's 'to' property ");this._allData[n].to.splice(a,1),this._allData[r]._to=[];const i=this._allOutputIndices.indexOf(r);if(-1!==i&&(this._allOutputIndices[i]=n),o&&o.length>0)for(const s of o){const e=this._nodes[s].inputs.indexOf(r);if(-1===e)throw new Error("The Node object doesn't have the output Value in it's 'inputs' property ");this._nodes[s].inputs[e]=n,this._allData[n].to.push(s)}}removeAllDropoutNodes(){let e=0;for(const t of this._nodes){if("Dropout"===t.opType){if(1!==t.inputs.length)throw new Error("Dropout nodes should only contain one input. ");if(1!==t.outputs.length&&2!==t.outputs.length)throw new Error("Dropout nodes should contain either 1 or 2 output(s)");if(2===t.outputs.length&&0!==this._allData[t.outputs[1]]._to.length)throw new Error("Dropout nodes's second output should not be referenced by other nodes");this.deleteNode(e)}e++}}removeAllIdentityNodes(){let e=0;for(const t of this._nodes)"Identity"===t.opType&&this.deleteNode(e),e++}isActivation(e){switch(e.opType){case"Relu":case"Sigmoid":case"Clip":return!0;default:return!1}}fuseConvActivationNodes(){for(const t of this._nodes)if("Conv"===t.opType){const n=this._allData[t.outputs[0]]._to;if(1===n.length&&this.isActivation(this._nodes[n[0]])){const r=this._nodes[n[0]];if("Clip"===r.opType)if(1===r.inputs.length)try{t.attributes.set("activation_params","floats",[r.attributes.getFloat("min"),r.attributes.getFloat("max")])}catch(e){t.attributes.set("activation_params","floats",[s.MIN_CLIP,s.MAX_CLIP])}else{if(!(r.inputs.length>=3&&void 0!==this._allData[r.inputs[1]].tensor&&void 0!==this._allData[r.inputs[2]].tensor))continue;t.attributes.set("activation_params","floats",[this._allData[r.inputs[1]].tensor.floatData[0],this._allData[r.inputs[2]].tensor.floatData[0]])}t.attributes.set("activation","string",r.opType),this.deleteNode(n[0])}}}}},6231:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.now=t.Profiler=t.Logger=void 0;const n={verbose:1e3,info:2e3,warning:4e3,error:5e3,fatal:6e3},r={none:new class{log(e,t,n){}},console:new class{log(e,t,n){console.log(`${this.color(e)} ${n?""+n+" ":""}${t}`)}color(e){switch(e){case"verbose":return"v";case"info":return"i";case"warning":return"w";case"error":return"e";case"fatal":return"f";default:throw new Error(`unsupported severity: ${e}`)}}}},o={provider:"console",minimalSeverity:"warning",logDateTime:!0,logSourceLocation:!1};let a={"":o};function i(e,t,n,r){if(void 0===t)return o=e,{verbose:i.verbose.bind(null,o),info:i.info.bind(null,o),warning:i.warning.bind(null,o),error:i.error.bind(null,o),fatal:i.fatal.bind(null,o)};if(void 0===n)s(e,t);else if("number"==typeof n&&void 0===r)s(e,t);else if("string"==typeof n&&void 0===r)s(e,n,0,t);else{if("string"!=typeof n||"number"!=typeof r)throw new TypeError("input is valid");s(e,n,0,t)}var o}function s(e,t,o,i){const s=a[i||""]||a[""];n[e]<n[s.minimalSeverity]||(s.logDateTime&&(t=`${(new Date).toISOString()}|${t}`),s.logSourceLocation,r[s.provider].log(e,t,i))}!function(e){function t(e){a={},n("",e||{})}function n(e,n){if("*"===e)t(n);else{const t=a[e]||o;a[e]={provider:n.provider||t.provider,minimalSeverity:n.minimalSeverity||t.minimalSeverity,logDateTime:void 0===n.logDateTime?t.logDateTime:n.logDateTime,logSourceLocation:void 0===n.logSourceLocation?t.logSourceLocation:n.logSourceLocation}}}e.verbose=function(t,n){e("verbose",t,n)},e.info=function(t,n){e("info",t,n)},e.warning=function(t,n){e("warning",t,n)},e.error=function(t,n){e("error",t,n)},e.fatal=function(t,n){e("fatal",t,n)},e.reset=t,e.set=n,e.setWithEnv=function(e){const t={};e.logLevel&&(t.minimalSeverity=e.logLevel),n("",t)}}(i||(i={})),t.Logger=i;class l{constructor(e,t,n,r,o,a){this.category=e,this.name=t,this.startTime=n,this.endCallback=r,this.timer=o,this.ctx=a}end(){return this.endCallback(this)}async checkTimer(){if(void 0===this.ctx||void 0===this.timer)throw new Error("No webgl timer found");return this.ctx.endTimer(),this.ctx.waitForQueryAndGetTime(this.timer)}}class u{constructor(e,t,n,r){this.category=e,this.name=t,this.startTime=n,this.endTime=r}}t.Profiler=class{static create(e){return void 0===e?new this:new this(e.maxNumberEvents,e.flushBatchSize,e.flushIntervalInMilliseconds)}constructor(e,t,n){this._started=!1,this._flushPointer=0,this._started=!1,this._maxNumberEvents=void 0===e?1e4:e,this._flushBatchSize=void 0===t?10:t,this._flushIntervalInMilliseconds=void 0===n?5e3:n}start(){this._started=!0,this._timingEvents=[],this._flushTime=(0,t.now)(),this._flushPointer=0}stop(){for(this._started=!1;this._flushPointer<this._timingEvents.length;this._flushPointer++)this.logOneEvent(this._timingEvents[this._flushPointer])}event(e,t,n,r){const o=this._started?this.begin(e,t,r):void 0;let a=!1;const i=n();if(i&&"function"==typeof i.then)return a=!0,new Promise((e,t)=>{i.then(async t=>{o&&await o.end(),e(t)},async e=>{o&&await o.end(),t(e)})});if(!a&&o){const e=o.end();if(e&&"function"==typeof e.then)return new Promise((t,n)=>{e.then(()=>{t(i)},e=>{n(e)})})}return i}begin(e,n,r){if(!this._started)throw new Error("profiler is not started yet");if(void 0===r){const r=(0,t.now)();return this.flush(r),new l(e,n,r,e=>this.endSync(e))}{const t=r.beginTimer();return new l(e,n,0,async e=>this.end(e),t,r)}}async end(e){const t=await e.checkTimer();this._timingEvents.length<this._maxNumberEvents&&(this._timingEvents.push(new u(e.category,e.name,e.startTime,t)),this.flush(t))}endSync(e){const n=(0,t.now)();this._timingEvents.length<this._maxNumberEvents&&(this._timingEvents.push(new u(e.category,e.name,e.startTime,n)),this.flush(n))}logOneEvent(e){t.Logger.verbose(`Profiler.${e.category}`,`${(e.endTime-e.startTime).toFixed(2)}ms on event '${e.name}' at ${e.endTime.toFixed(2)}`)}flush(e){if(this._timingEvents.length-this._flushPointer>=this._flushBatchSize||e-this._flushTime>=this._flushIntervalInMilliseconds){for(const e=this._flushPointer;this._flushPointer<e+this._flushBatchSize&&this._flushPointer<this._timingEvents.length;this._flushPointer++)this.logOneEvent(this._timingEvents[this._flushPointer]);this._flushTime=(0,t.now)()}}get started(){return this._started}},t.now="undefined"!=typeof performance&&performance.now?()=>performance.now():Date.now},2644:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Model=void 0;const r=n(5686),o=n(1446),a=n(7070),i=n(9395),s=n(2517);var l=i.onnxruntime.experimental.fbs;t.Model=class{constructor(){}load(e,t,n){if(!n)try{return void this.loadFromOnnxFormat(e,t)}catch(r){if(void 0!==n)throw r}this.loadFromOrtFormat(e,t)}loadFromOnnxFormat(e,t){const n=o.onnx.ModelProto.decode(e);if(s.LongUtil.longToNumber(n.irVersion)<3)throw new Error("only support ONNX model with IR_VERSION>=3");this._opsets=n.opsetImport.map(e=>({domain:e.domain,version:s.LongUtil.longToNumber(e.version)})),this._graph=a.Graph.from(n.graph,t)}loadFromOrtFormat(e,t){const n=new r.flatbuffers.ByteBuffer(e),o=l.InferenceSession.getRootAsInferenceSession(n).model();if(s.LongUtil.longToNumber(o.irVersion())<3)throw new Error("only support ONNX model with IR_VERSION>=3");this._opsets=[];for(let r=0;r<o.opsetImportLength();r++){const e=o.opsetImport(r);this._opsets.push({domain:null==e?void 0:e.domain(),version:s.LongUtil.longToNumber(e.version())})}this._graph=a.Graph.from(o.graph(),t)}get graph(){return this._graph}get opsets(){return this._opsets}}},782:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FLOAT_TYPES=t.INT_TYPES=t.NUMBER_TYPES=void 0,t.NUMBER_TYPES=["float32","float64","int32","int16","int8","uint16","uint32","uint8"],t.INT_TYPES=["int32","int16","int8","uint16","uint32","uint8"],t.FLOAT_TYPES=["float32","float64"]},1047:(e,t)=>{function n(e,t){if(t.endsWith("+")){const n=Number.parseInt(t.substring(0,t.length-1),10);return!isNaN(n)&&n<=e}if(2===t.split("-").length){const n=t.split("-"),r=Number.parseInt(n[0],10),o=Number.parseInt(n[1],10);return!isNaN(r)&&!isNaN(o)&&r<=e&&e<=o}return Number.parseInt(t,10)===e}Object.defineProperty(t,"__esModule",{value:!0}),t.resolveOperator=void 0,t.resolveOperator=function(e,t,r){for(const o of r){const r=o[0],a=o[1],i=o[2],s=o[3],l=o[4];if(e.opType===r)for(const e of t)if((e.domain===a||"ai.onnx"===e.domain&&""===a)&&n(e.version,i))return{opImpl:s,opInit:l}}throw new TypeError(`cannot resolve operator '${e.opType}' with opsets: ${t.map(e=>`${e.domain||"ai.onnx"} v${e.version}`).join(", ")}`)}},9395:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.onnxruntime=void 0;const r=n(5686);var o,a,i,s;o=t.onnxruntime||(t.onnxruntime={}),i=(a=o.experimental||(o.experimental={})).fbs||(a.fbs={}),(s=i.AttributeType||(i.AttributeType={}))[s.UNDEFINED=0]="UNDEFINED",s[s.FLOAT=1]="FLOAT",s[s.INT=2]="INT",s[s.STRING=3]="STRING",s[s.TENSOR=4]="TENSOR",s[s.GRAPH=5]="GRAPH",s[s.FLOATS=6]="FLOATS",s[s.INTS=7]="INTS",s[s.STRINGS=8]="STRINGS",s[s.TENSORS=9]="TENSORS",s[s.GRAPHS=10]="GRAPHS",s[s.SPARSE_TENSOR=11]="SPARSE_TENSOR",s[s.SPARSE_TENSORS=12]="SPARSE_TENSORS",function(e){!function(e){var t,n;t=e.fbs||(e.fbs={}),(n=t.DimensionValueType||(t.DimensionValueType={}))[n.UNKNOWN=0]="UNKNOWN",n[n.VALUE=1]="VALUE",n[n.PARAM=2]="PARAM"}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(e){var t,n;t=e.fbs||(e.fbs={}),(n=t.TensorDataType||(t.TensorDataType={}))[n.UNDEFINED=0]="UNDEFINED",n[n.FLOAT=1]="FLOAT",n[n.UINT8=2]="UINT8",n[n.INT8=3]="INT8",n[n.UINT16=4]="UINT16",n[n.INT16=5]="INT16",n[n.INT32=6]="INT32",n[n.INT64=7]="INT64",n[n.STRING=8]="STRING",n[n.BOOL=9]="BOOL",n[n.FLOAT16=10]="FLOAT16",n[n.DOUBLE=11]="DOUBLE",n[n.UINT32=12]="UINT32",n[n.UINT64=13]="UINT64",n[n.COMPLEX64=14]="COMPLEX64",n[n.COMPLEX128=15]="COMPLEX128",n[n.BFLOAT16=16]="BFLOAT16"}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(e){var t,n;t=e.fbs||(e.fbs={}),(n=t.NodeType||(t.NodeType={}))[n.Primitive=0]="Primitive",n[n.Fused=1]="Fused"}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(e){var t,n;t=e.fbs||(e.fbs={}),(n=t.TypeInfoValue||(t.TypeInfoValue={}))[n.NONE=0]="NONE",n[n.tensor_type=1]="tensor_type",n[n.sequence_type=2]="sequence_type",n[n.map_type=3]="map_type"}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){var t;!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsShape(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsShape(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}dim(t,n){let r=this.bb.__offset(this.bb_pos,4);return r?(n||new e.experimental.fbs.Dimension).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}dimLength(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__vector_len(this.bb_pos+e):0}static startShape(e){e.startObject(1)}static addDim(e,t){e.addFieldOffset(0,t,0)}static createDimVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startDimVector(e,t){e.startVector(4,t,4)}static endShape(e){return e.endObject()}static createShape(e,t){return n.startShape(e),n.addDim(e,t),n.endShape(e)}}t.Shape=n}((t=e.experimental||(e.experimental={})).fbs||(t.fbs={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){var t;!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDimension(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDimension(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}value(t){let n=this.bb.__offset(this.bb_pos,4);return n?(t||new e.experimental.fbs.DimensionValue).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}denotation(e){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__string(this.bb_pos+t,e):null}static startDimension(e){e.startObject(2)}static addValue(e,t){e.addFieldOffset(0,t,0)}static addDenotation(e,t){e.addFieldOffset(1,t,0)}static endDimension(e){return e.endObject()}static createDimension(e,t,r){return n.startDimension(e),n.addValue(e,t),n.addDenotation(e,r),n.endDimension(e)}}t.Dimension=n}((t=e.experimental||(e.experimental={})).fbs||(t.fbs={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){var t;!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDimensionValue(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDimensionValue(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}dimType(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt8(this.bb_pos+t):e.experimental.fbs.DimensionValueType.UNKNOWN}dimValue(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt64(this.bb_pos+e):this.bb.createLong(0,0)}dimParam(e){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__string(this.bb_pos+t,e):null}static startDimensionValue(e){e.startObject(3)}static addDimType(t,n){t.addFieldInt8(0,n,e.experimental.fbs.DimensionValueType.UNKNOWN)}static addDimValue(e,t){e.addFieldInt64(1,t,e.createLong(0,0))}static addDimParam(e,t){e.addFieldOffset(2,t,0)}static endDimensionValue(e){return e.endObject()}static createDimensionValue(e,t,r,o){return n.startDimensionValue(e),n.addDimType(e,t),n.addDimValue(e,r),n.addDimParam(e,o),n.endDimensionValue(e)}}t.DimensionValue=n}((t=e.experimental||(e.experimental={})).fbs||(t.fbs={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){var t;!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsTensorTypeAndShape(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsTensorTypeAndShape(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}elemType(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):e.experimental.fbs.TensorDataType.UNDEFINED}shape(t){let n=this.bb.__offset(this.bb_pos,6);return n?(t||new e.experimental.fbs.Shape).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}static startTensorTypeAndShape(e){e.startObject(2)}static addElemType(t,n){t.addFieldInt32(0,n,e.experimental.fbs.TensorDataType.UNDEFINED)}static addShape(e,t){e.addFieldOffset(1,t,0)}static endTensorTypeAndShape(e){return e.endObject()}static createTensorTypeAndShape(e,t,r){return n.startTensorTypeAndShape(e),n.addElemType(e,t),n.addShape(e,r),n.endTensorTypeAndShape(e)}}t.TensorTypeAndShape=n}((t=e.experimental||(e.experimental={})).fbs||(t.fbs={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){var t;!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsMapType(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsMapType(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}keyType(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):e.experimental.fbs.TensorDataType.UNDEFINED}valueType(t){let n=this.bb.__offset(this.bb_pos,6);return n?(t||new e.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}static startMapType(e){e.startObject(2)}static addKeyType(t,n){t.addFieldInt32(0,n,e.experimental.fbs.TensorDataType.UNDEFINED)}static addValueType(e,t){e.addFieldOffset(1,t,0)}static endMapType(e){return e.endObject()}static createMapType(e,t,r){return n.startMapType(e),n.addKeyType(e,t),n.addValueType(e,r),n.endMapType(e)}}t.MapType=n}((t=e.experimental||(e.experimental={})).fbs||(t.fbs={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){var t;!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsSequenceType(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsSequenceType(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}elemType(t){let n=this.bb.__offset(this.bb_pos,4);return n?(t||new e.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}static startSequenceType(e){e.startObject(1)}static addElemType(e,t){e.addFieldOffset(0,t,0)}static endSequenceType(e){return e.endObject()}static createSequenceType(e,t){return n.startSequenceType(e),n.addElemType(e,t),n.endSequenceType(e)}}t.SequenceType=n}((t=e.experimental||(e.experimental={})).fbs||(t.fbs={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(e){(e.fbs||(e.fbs={})).EdgeEnd=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}nodeIndex(){return this.bb.readUint32(this.bb_pos)}srcArgIndex(){return this.bb.readInt32(this.bb_pos+4)}dstArgIndex(){return this.bb.readInt32(this.bb_pos+8)}static createEdgeEnd(e,t,n,r){return e.prep(4,12),e.writeInt32(r),e.writeInt32(n),e.writeInt32(t),e.offset()}}}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){var t;!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsNodeEdge(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsNodeEdge(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}nodeIndex(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readUint32(this.bb_pos+e):0}inputEdges(t,n){let r=this.bb.__offset(this.bb_pos,6);return r?(n||new e.experimental.fbs.EdgeEnd).__init(this.bb.__vector(this.bb_pos+r)+12*t,this.bb):null}inputEdgesLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}outputEdges(t,n){let r=this.bb.__offset(this.bb_pos,8);return r?(n||new e.experimental.fbs.EdgeEnd).__init(this.bb.__vector(this.bb_pos+r)+12*t,this.bb):null}outputEdgesLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}static startNodeEdge(e){e.startObject(3)}static addNodeIndex(e,t){e.addFieldInt32(0,t,0)}static addInputEdges(e,t){e.addFieldOffset(1,t,0)}static startInputEdgesVector(e,t){e.startVector(12,t,4)}static addOutputEdges(e,t){e.addFieldOffset(2,t,0)}static startOutputEdgesVector(e,t){e.startVector(12,t,4)}static endNodeEdge(e){return e.endObject()}static createNodeEdge(e,t,r,o){return n.startNodeEdge(e),n.addNodeIndex(e,t),n.addInputEdges(e,r),n.addOutputEdges(e,o),n.endNodeEdge(e)}}t.NodeEdge=n}((t=e.experimental||(e.experimental={})).fbs||(t.fbs={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){var t;!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsNode(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsNode(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}name(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}docString(e){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__string(this.bb_pos+t,e):null}domain(e){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__string(this.bb_pos+t,e):null}sinceVersion(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt32(this.bb_pos+e):0}index(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.readUint32(this.bb_pos+e):0}opType(e){let t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__string(this.bb_pos+t,e):null}type(){let t=this.bb.__offset(this.bb_pos,16);return t?this.bb.readInt32(this.bb_pos+t):e.experimental.fbs.NodeType.Primitive}executionProviderType(e){let t=this.bb.__offset(this.bb_pos,18);return t?this.bb.__string(this.bb_pos+t,e):null}inputs(e,t){let n=this.bb.__offset(this.bb_pos,20);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*e,t):null}inputsLength(){let e=this.bb.__offset(this.bb_pos,20);return e?this.bb.__vector_len(this.bb_pos+e):0}outputs(e,t){let n=this.bb.__offset(this.bb_pos,22);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*e,t):null}outputsLength(){let e=this.bb.__offset(this.bb_pos,22);return e?this.bb.__vector_len(this.bb_pos+e):0}attributes(t,n){let r=this.bb.__offset(this.bb_pos,24);return r?(n||new e.experimental.fbs.Attribute).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}attributesLength(){let e=this.bb.__offset(this.bb_pos,24);return e?this.bb.__vector_len(this.bb_pos+e):0}inputArgCounts(e){let t=this.bb.__offset(this.bb_pos,26);return t?this.bb.readInt32(this.bb.__vector(this.bb_pos+t)+4*e):0}inputArgCountsLength(){let e=this.bb.__offset(this.bb_pos,26);return e?this.bb.__vector_len(this.bb_pos+e):0}inputArgCountsArray(){let e=this.bb.__offset(this.bb_pos,26);return e?new Int32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}implicitInputs(e,t){let n=this.bb.__offset(this.bb_pos,28);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*e,t):null}implicitInputsLength(){let e=this.bb.__offset(this.bb_pos,28);return e?this.bb.__vector_len(this.bb_pos+e):0}static startNode(e){e.startObject(13)}static addName(e,t){e.addFieldOffset(0,t,0)}static addDocString(e,t){e.addFieldOffset(1,t,0)}static addDomain(e,t){e.addFieldOffset(2,t,0)}static addSinceVersion(e,t){e.addFieldInt32(3,t,0)}static addIndex(e,t){e.addFieldInt32(4,t,0)}static addOpType(e,t){e.addFieldOffset(5,t,0)}static addType(t,n){t.addFieldInt32(6,n,e.experimental.fbs.NodeType.Primitive)}static addExecutionProviderType(e,t){e.addFieldOffset(7,t,0)}static addInputs(e,t){e.addFieldOffset(8,t,0)}static createInputsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startInputsVector(e,t){e.startVector(4,t,4)}static addOutputs(e,t){e.addFieldOffset(9,t,0)}static createOutputsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startOutputsVector(e,t){e.startVector(4,t,4)}static addAttributes(e,t){e.addFieldOffset(10,t,0)}static createAttributesVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startAttributesVector(e,t){e.startVector(4,t,4)}static addInputArgCounts(e,t){e.addFieldOffset(11,t,0)}static createInputArgCountsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addInt32(t[n]);return e.endVector()}static startInputArgCountsVector(e,t){e.startVector(4,t,4)}static addImplicitInputs(e,t){e.addFieldOffset(12,t,0)}static createImplicitInputsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startImplicitInputsVector(e,t){e.startVector(4,t,4)}static endNode(e){return e.endObject()}static createNode(e,t,r,o,a,i,s,l,u,c,d,f,p,h){return n.startNode(e),n.addName(e,t),n.addDocString(e,r),n.addDomain(e,o),n.addSinceVersion(e,a),n.addIndex(e,i),n.addOpType(e,s),n.addType(e,l),n.addExecutionProviderType(e,u),n.addInputs(e,c),n.addOutputs(e,d),n.addAttributes(e,f),n.addInputArgCounts(e,p),n.addImplicitInputs(e,h),n.endNode(e)}}t.Node=n}((t=e.experimental||(e.experimental={})).fbs||(t.fbs={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){var t;!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsValueInfo(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsValueInfo(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}name(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}docString(e){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__string(this.bb_pos+t,e):null}type(t){let n=this.bb.__offset(this.bb_pos,8);return n?(t||new e.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}static startValueInfo(e){e.startObject(3)}static addName(e,t){e.addFieldOffset(0,t,0)}static addDocString(e,t){e.addFieldOffset(1,t,0)}static addType(e,t){e.addFieldOffset(2,t,0)}static endValueInfo(e){return e.endObject()}static createValueInfo(e,t,r,o){return n.startValueInfo(e),n.addName(e,t),n.addDocString(e,r),n.addType(e,o),n.endValueInfo(e)}}t.ValueInfo=n}((t=e.experimental||(e.experimental={})).fbs||(t.fbs={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){var t;!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsTypeInfo(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsTypeInfo(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}denotation(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}valueType(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):e.experimental.fbs.TypeInfoValue.NONE}value(e){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__union(e,this.bb_pos+t):null}static startTypeInfo(e){e.startObject(3)}static addDenotation(e,t){e.addFieldOffset(0,t,0)}static addValueType(t,n){t.addFieldInt8(1,n,e.experimental.fbs.TypeInfoValue.NONE)}static addValue(e,t){e.addFieldOffset(2,t,0)}static endTypeInfo(e){return e.endObject()}static createTypeInfo(e,t,r,o){return n.startTypeInfo(e),n.addDenotation(e,t),n.addValueType(e,r),n.addValue(e,o),n.endTypeInfo(e)}}t.TypeInfo=n}((t=e.experimental||(e.experimental={})).fbs||(t.fbs={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(e){!function(e){class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsOperatorSetId(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsOperatorSetId(e,n){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(n||new t).__init(e.readInt32(e.position())+e.position(),e)}domain(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}version(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt64(this.bb_pos+e):this.bb.createLong(0,0)}static startOperatorSetId(e){e.startObject(2)}static addDomain(e,t){e.addFieldOffset(0,t,0)}static addVersion(e,t){e.addFieldInt64(1,t,e.createLong(0,0))}static endOperatorSetId(e){return e.endObject()}static createOperatorSetId(e,n,r){return t.startOperatorSetId(e),t.addDomain(e,n),t.addVersion(e,r),t.endOperatorSetId(e)}}e.OperatorSetId=t}(e.fbs||(e.fbs={}))}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){var t;!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsTensor(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsTensor(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}name(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}docString(e){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__string(this.bb_pos+t,e):null}dims(e){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readInt64(this.bb.__vector(this.bb_pos+t)+8*e):this.bb.createLong(0,0)}dimsLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}dataType(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt32(this.bb_pos+t):e.experimental.fbs.TensorDataType.UNDEFINED}rawData(e){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.readUint8(this.bb.__vector(this.bb_pos+t)+e):0}rawDataLength(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}rawDataArray(){let e=this.bb.__offset(this.bb_pos,12);return e?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}stringData(e,t){let n=this.bb.__offset(this.bb_pos,14);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*e,t):null}stringDataLength(){let e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__vector_len(this.bb_pos+e):0}static startTensor(e){e.startObject(6)}static addName(e,t){e.addFieldOffset(0,t,0)}static addDocString(e,t){e.addFieldOffset(1,t,0)}static addDims(e,t){e.addFieldOffset(2,t,0)}static createDimsVector(e,t){e.startVector(8,t.length,8);for(let n=t.length-1;n>=0;n--)e.addInt64(t[n]);return e.endVector()}static startDimsVector(e,t){e.startVector(8,t,8)}static addDataType(t,n){t.addFieldInt32(3,n,e.experimental.fbs.TensorDataType.UNDEFINED)}static addRawData(e,t){e.addFieldOffset(4,t,0)}static createRawDataVector(e,t){e.startVector(1,t.length,1);for(let n=t.length-1;n>=0;n--)e.addInt8(t[n]);return e.endVector()}static startRawDataVector(e,t){e.startVector(1,t,1)}static addStringData(e,t){e.addFieldOffset(5,t,0)}static createStringDataVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startStringDataVector(e,t){e.startVector(4,t,4)}static endTensor(e){return e.endObject()}static createTensor(e,t,r,o,a,i,s){return n.startTensor(e),n.addName(e,t),n.addDocString(e,r),n.addDims(e,o),n.addDataType(e,a),n.addRawData(e,i),n.addStringData(e,s),n.endTensor(e)}}t.Tensor=n}((t=e.experimental||(e.experimental={})).fbs||(t.fbs={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){var t;!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsSparseTensor(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsSparseTensor(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}values(t){let n=this.bb.__offset(this.bb_pos,4);return n?(t||new e.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}indices(t){let n=this.bb.__offset(this.bb_pos,6);return n?(t||new e.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}dims(e){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readInt64(this.bb.__vector(this.bb_pos+t)+8*e):this.bb.createLong(0,0)}dimsLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}static startSparseTensor(e){e.startObject(3)}static addValues(e,t){e.addFieldOffset(0,t,0)}static addIndices(e,t){e.addFieldOffset(1,t,0)}static addDims(e,t){e.addFieldOffset(2,t,0)}static createDimsVector(e,t){e.startVector(8,t.length,8);for(let n=t.length-1;n>=0;n--)e.addInt64(t[n]);return e.endVector()}static startDimsVector(e,t){e.startVector(8,t,8)}static endSparseTensor(e){return e.endObject()}static createSparseTensor(e,t,r,o){return n.startSparseTensor(e),n.addValues(e,t),n.addIndices(e,r),n.addDims(e,o),n.endSparseTensor(e)}}t.SparseTensor=n}((t=e.experimental||(e.experimental={})).fbs||(t.fbs={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){var t;!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsAttribute(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsAttribute(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}name(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}docString(e){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__string(this.bb_pos+t,e):null}type(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readInt32(this.bb_pos+t):e.experimental.fbs.AttributeType.UNDEFINED}f(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readFloat32(this.bb_pos+e):0}i(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.readInt64(this.bb_pos+e):this.bb.createLong(0,0)}s(e){let t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__string(this.bb_pos+t,e):null}t(t){let n=this.bb.__offset(this.bb_pos,16);return n?(t||new e.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}g(t){let n=this.bb.__offset(this.bb_pos,18);return n?(t||new e.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}floats(e){let t=this.bb.__offset(this.bb_pos,20);return t?this.bb.readFloat32(this.bb.__vector(this.bb_pos+t)+4*e):0}floatsLength(){let e=this.bb.__offset(this.bb_pos,20);return e?this.bb.__vector_len(this.bb_pos+e):0}floatsArray(){let e=this.bb.__offset(this.bb_pos,20);return e?new Float32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}ints(e){let t=this.bb.__offset(this.bb_pos,22);return t?this.bb.readInt64(this.bb.__vector(this.bb_pos+t)+8*e):this.bb.createLong(0,0)}intsLength(){let e=this.bb.__offset(this.bb_pos,22);return e?this.bb.__vector_len(this.bb_pos+e):0}strings(e,t){let n=this.bb.__offset(this.bb_pos,24);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*e,t):null}stringsLength(){let e=this.bb.__offset(this.bb_pos,24);return e?this.bb.__vector_len(this.bb_pos+e):0}tensors(t,n){let r=this.bb.__offset(this.bb_pos,26);return r?(n||new e.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}tensorsLength(){let e=this.bb.__offset(this.bb_pos,26);return e?this.bb.__vector_len(this.bb_pos+e):0}graphs(t,n){let r=this.bb.__offset(this.bb_pos,28);return r?(n||new e.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}graphsLength(){let e=this.bb.__offset(this.bb_pos,28);return e?this.bb.__vector_len(this.bb_pos+e):0}static startAttribute(e){e.startObject(13)}static addName(e,t){e.addFieldOffset(0,t,0)}static addDocString(e,t){e.addFieldOffset(1,t,0)}static addType(t,n){t.addFieldInt32(2,n,e.experimental.fbs.AttributeType.UNDEFINED)}static addF(e,t){e.addFieldFloat32(3,t,0)}static addI(e,t){e.addFieldInt64(4,t,e.createLong(0,0))}static addS(e,t){e.addFieldOffset(5,t,0)}static addT(e,t){e.addFieldOffset(6,t,0)}static addG(e,t){e.addFieldOffset(7,t,0)}static addFloats(e,t){e.addFieldOffset(8,t,0)}static createFloatsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addFloat32(t[n]);return e.endVector()}static startFloatsVector(e,t){e.startVector(4,t,4)}static addInts(e,t){e.addFieldOffset(9,t,0)}static createIntsVector(e,t){e.startVector(8,t.length,8);for(let n=t.length-1;n>=0;n--)e.addInt64(t[n]);return e.endVector()}static startIntsVector(e,t){e.startVector(8,t,8)}static addStrings(e,t){e.addFieldOffset(10,t,0)}static createStringsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startStringsVector(e,t){e.startVector(4,t,4)}static addTensors(e,t){e.addFieldOffset(11,t,0)}static createTensorsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startTensorsVector(e,t){e.startVector(4,t,4)}static addGraphs(e,t){e.addFieldOffset(12,t,0)}static createGraphsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startGraphsVector(e,t){e.startVector(4,t,4)}static endAttribute(e){return e.endObject()}static createAttribute(e,t,r,o,a,i,s,l,u,c,d,f,p,h){return n.startAttribute(e),n.addName(e,t),n.addDocString(e,r),n.addType(e,o),n.addF(e,a),n.addI(e,i),n.addS(e,s),n.addT(e,l),n.addG(e,u),n.addFloats(e,c),n.addInts(e,d),n.addStrings(e,f),n.addTensors(e,p),n.addGraphs(e,h),n.endAttribute(e)}}t.Attribute=n}((t=e.experimental||(e.experimental={})).fbs||(t.fbs={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){var t;!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsGraph(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsGraph(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}initializers(t,n){let r=this.bb.__offset(this.bb_pos,4);return r?(n||new e.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}initializersLength(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__vector_len(this.bb_pos+e):0}nodeArgs(t,n){let r=this.bb.__offset(this.bb_pos,6);return r?(n||new e.experimental.fbs.ValueInfo).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}nodeArgsLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}nodes(t,n){let r=this.bb.__offset(this.bb_pos,8);return r?(n||new e.experimental.fbs.Node).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}nodesLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}maxNodeIndex(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readUint32(this.bb_pos+e):0}nodeEdges(t,n){let r=this.bb.__offset(this.bb_pos,12);return r?(n||new e.experimental.fbs.NodeEdge).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}nodeEdgesLength(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}inputs(e,t){let n=this.bb.__offset(this.bb_pos,14);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*e,t):null}inputsLength(){let e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__vector_len(this.bb_pos+e):0}outputs(e,t){let n=this.bb.__offset(this.bb_pos,16);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*e,t):null}outputsLength(){let e=this.bb.__offset(this.bb_pos,16);return e?this.bb.__vector_len(this.bb_pos+e):0}sparseInitializers(t,n){let r=this.bb.__offset(this.bb_pos,18);return r?(n||new e.experimental.fbs.SparseTensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}sparseInitializersLength(){let e=this.bb.__offset(this.bb_pos,18);return e?this.bb.__vector_len(this.bb_pos+e):0}static startGraph(e){e.startObject(8)}static addInitializers(e,t){e.addFieldOffset(0,t,0)}static createInitializersVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startInitializersVector(e,t){e.startVector(4,t,4)}static addNodeArgs(e,t){e.addFieldOffset(1,t,0)}static createNodeArgsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startNodeArgsVector(e,t){e.startVector(4,t,4)}static addNodes(e,t){e.addFieldOffset(2,t,0)}static createNodesVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startNodesVector(e,t){e.startVector(4,t,4)}static addMaxNodeIndex(e,t){e.addFieldInt32(3,t,0)}static addNodeEdges(e,t){e.addFieldOffset(4,t,0)}static createNodeEdgesVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startNodeEdgesVector(e,t){e.startVector(4,t,4)}static addInputs(e,t){e.addFieldOffset(5,t,0)}static createInputsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startInputsVector(e,t){e.startVector(4,t,4)}static addOutputs(e,t){e.addFieldOffset(6,t,0)}static createOutputsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startOutputsVector(e,t){e.startVector(4,t,4)}static addSparseInitializers(e,t){e.addFieldOffset(7,t,0)}static createSparseInitializersVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startSparseInitializersVector(e,t){e.startVector(4,t,4)}static endGraph(e){return e.endObject()}static createGraph(e,t,r,o,a,i,s,l,u){return n.startGraph(e),n.addInitializers(e,t),n.addNodeArgs(e,r),n.addNodes(e,o),n.addMaxNodeIndex(e,a),n.addNodeEdges(e,i),n.addInputs(e,s),n.addOutputs(e,l),n.addSparseInitializers(e,u),n.endGraph(e)}}t.Graph=n}((t=e.experimental||(e.experimental={})).fbs||(t.fbs={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){var t;!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsModel(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsModel(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}irVersion(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt64(this.bb_pos+e):this.bb.createLong(0,0)}opsetImport(t,n){let r=this.bb.__offset(this.bb_pos,6);return r?(n||new e.experimental.fbs.OperatorSetId).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}opsetImportLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}producerName(e){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__string(this.bb_pos+t,e):null}producerVersion(e){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__string(this.bb_pos+t,e):null}domain(e){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__string(this.bb_pos+t,e):null}modelVersion(){let e=this.bb.__offset(this.bb_pos,14);return e?this.bb.readInt64(this.bb_pos+e):this.bb.createLong(0,0)}docString(e){let t=this.bb.__offset(this.bb_pos,16);return t?this.bb.__string(this.bb_pos+t,e):null}graph(t){let n=this.bb.__offset(this.bb_pos,18);return n?(t||new e.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}graphDocString(e){let t=this.bb.__offset(this.bb_pos,20);return t?this.bb.__string(this.bb_pos+t,e):null}static startModel(e){e.startObject(9)}static addIrVersion(e,t){e.addFieldInt64(0,t,e.createLong(0,0))}static addOpsetImport(e,t){e.addFieldOffset(1,t,0)}static createOpsetImportVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startOpsetImportVector(e,t){e.startVector(4,t,4)}static addProducerName(e,t){e.addFieldOffset(2,t,0)}static addProducerVersion(e,t){e.addFieldOffset(3,t,0)}static addDomain(e,t){e.addFieldOffset(4,t,0)}static addModelVersion(e,t){e.addFieldInt64(5,t,e.createLong(0,0))}static addDocString(e,t){e.addFieldOffset(6,t,0)}static addGraph(e,t){e.addFieldOffset(7,t,0)}static addGraphDocString(e,t){e.addFieldOffset(8,t,0)}static endModel(e){return e.endObject()}static createModel(e,t,r,o,a,i,s,l,u,c){return n.startModel(e),n.addIrVersion(e,t),n.addOpsetImport(e,r),n.addProducerName(e,o),n.addProducerVersion(e,a),n.addDomain(e,i),n.addModelVersion(e,s),n.addDocString(e,l),n.addGraph(e,u),n.addGraphDocString(e,c),n.endModel(e)}}t.Model=n}((t=e.experimental||(e.experimental={})).fbs||(t.fbs={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(e){!function(e){class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsKernelCreateInfos(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsKernelCreateInfos(e,n){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(n||new t).__init(e.readInt32(e.position())+e.position(),e)}nodeIndices(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readUint32(this.bb.__vector(this.bb_pos+t)+4*e):0}nodeIndicesLength(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__vector_len(this.bb_pos+e):0}nodeIndicesArray(){let e=this.bb.__offset(this.bb_pos,4);return e?new Uint32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}kernelDefHashes(e){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint64(this.bb.__vector(this.bb_pos+t)+8*e):this.bb.createLong(0,0)}kernelDefHashesLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}static startKernelCreateInfos(e){e.startObject(2)}static addNodeIndices(e,t){e.addFieldOffset(0,t,0)}static createNodeIndicesVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addInt32(t[n]);return e.endVector()}static startNodeIndicesVector(e,t){e.startVector(4,t,4)}static addKernelDefHashes(e,t){e.addFieldOffset(1,t,0)}static createKernelDefHashesVector(e,t){e.startVector(8,t.length,8);for(let n=t.length-1;n>=0;n--)e.addInt64(t[n]);return e.endVector()}static startKernelDefHashesVector(e,t){e.startVector(8,t,8)}static endKernelCreateInfos(e){return e.endObject()}static createKernelCreateInfos(e,n,r){return t.startKernelCreateInfos(e),t.addNodeIndices(e,n),t.addKernelDefHashes(e,r),t.endKernelCreateInfos(e)}}e.KernelCreateInfos=t}(e.fbs||(e.fbs={}))}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){var t;!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsSubGraphSessionState(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsSubGraphSessionState(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}graphId(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}sessionState(t){let n=this.bb.__offset(this.bb_pos,6);return n?(t||new e.experimental.fbs.SessionState).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}static startSubGraphSessionState(e){e.startObject(2)}static addGraphId(e,t){e.addFieldOffset(0,t,0)}static addSessionState(e,t){e.addFieldOffset(1,t,0)}static endSubGraphSessionState(e){let t=e.endObject();return e.requiredField(t,4),t}static createSubGraphSessionState(e,t,r){return n.startSubGraphSessionState(e),n.addGraphId(e,t),n.addSessionState(e,r),n.endSubGraphSessionState(e)}}t.SubGraphSessionState=n}((t=e.experimental||(e.experimental={})).fbs||(t.fbs={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){var t;!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsSessionState(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsSessionState(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}kernels(t){let n=this.bb.__offset(this.bb_pos,4);return n?(t||new e.experimental.fbs.KernelCreateInfos).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}subGraphSessionStates(t,n){let r=this.bb.__offset(this.bb_pos,6);return r?(n||new e.experimental.fbs.SubGraphSessionState).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}subGraphSessionStatesLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}static startSessionState(e){e.startObject(2)}static addKernels(e,t){e.addFieldOffset(0,t,0)}static addSubGraphSessionStates(e,t){e.addFieldOffset(1,t,0)}static createSubGraphSessionStatesVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startSubGraphSessionStatesVector(e,t){e.startVector(4,t,4)}static endSessionState(e){return e.endObject()}static createSessionState(e,t,r){return n.startSessionState(e),n.addKernels(e,t),n.addSubGraphSessionStates(e,r),n.endSessionState(e)}}t.SessionState=n}((t=e.experimental||(e.experimental={})).fbs||(t.fbs={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){var t;!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsInferenceSession(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsInferenceSession(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static bufferHasIdentifier(e){return e.__has_identifier("ORTM")}ortVersion(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}model(t){let n=this.bb.__offset(this.bb_pos,6);return n?(t||new e.experimental.fbs.Model).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}sessionState(t){let n=this.bb.__offset(this.bb_pos,8);return n?(t||new e.experimental.fbs.SessionState).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}static startInferenceSession(e){e.startObject(3)}static addOrtVersion(e,t){e.addFieldOffset(0,t,0)}static addModel(e,t){e.addFieldOffset(1,t,0)}static addSessionState(e,t){e.addFieldOffset(2,t,0)}static endInferenceSession(e){return e.endObject()}static finishInferenceSessionBuffer(e,t){e.finish(t,"ORTM")}static finishSizePrefixedInferenceSessionBuffer(e,t){e.finish(t,"ORTM",!0)}static createInferenceSession(e,t,r,o){return n.startInferenceSession(e),n.addOrtVersion(e,t),n.addModel(e,r),n.addSessionState(e,o),n.endInferenceSession(e)}}t.InferenceSession=n}((t=e.experimental||(e.experimental={})).fbs||(t.fbs={}))}(t.onnxruntime||(t.onnxruntime={}))},7448:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.OnnxjsSessionHandler=void 0;const r=n(1670),o=n(9162);t.OnnxjsSessionHandler=class{constructor(e){this.session=e,this.inputNames=this.session.inputNames,this.outputNames=this.session.outputNames}async dispose(){}async run(e,t,n){const a=new Map;for(const r in e)if(Object.hasOwnProperty.call(e,r)){const t=e[r];a.set(r,new o.Tensor(t.dims,t.type,void 0,void 0,t.data))}const i=await this.session.run(a),s={};return i.forEach((e,t)=>{s[t]=new r.Tensor(e.type,e.data,e.dims)}),s}startProfiling(){this.session.startProfiling()}endProfiling(){this.session.endProfiling()}}},6919:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Session=void 0;const r=n(7067),o=n(1296),a=n(7091),i=n(1036),s=n(6231),l=n(2644);t.Session=class{constructor(e={}){this._initialized=!1,this.backendHint=e.backendHint,this.profiler=s.Profiler.create(e.profiler),this.context={profiler:this.profiler,graphInputTypes:[],graphInputDims:[]}}get inputNames(){return this._model.graph.getInputNames()}get outputNames(){return this._model.graph.getOutputNames()}startProfiling(){this.profiler.start()}endProfiling(){this.profiler.stop()}async loadModel(e,t,n){await this.profiler.event("session","Session.loadModel",async()=>{const i=await(0,a.resolveBackend)(this.backendHint);if(this.sessionHandler=i.createSessionHandler(this.context),this._model=new l.Model,"string"==typeof e){const t=e.endsWith(".ort");if("undefined"==typeof fetch){const n=await(0,o.promisify)(r.readFile)(e);this.initialize(n,t)}else{const n=await fetch(e),r=await n.arrayBuffer();this.initialize(new Uint8Array(r),t)}}else if(ArrayBuffer.isView(e))this.initialize(e);else{const r=new Uint8Array(e,t||0,n||e.byteLength);this.initialize(r)}})}initialize(e,t){if(this._initialized)throw new Error("already initialized");this.profiler.event("session","Session.initialize",()=>{const n=this.sessionHandler.transformGraph?this.sessionHandler:void 0;this._model.load(e,n,t),this.sessionHandler.onGraphInitialized&&this.sessionHandler.onGraphInitialized(this._model.graph),this.initializeOps(this._model.graph),this._executionPlan=new i.ExecutionPlan(this._model.graph,this._ops,this.profiler)}),this._initialized=!0}async run(e){if(!this._initialized)throw new Error("session not initialized yet");return this.profiler.event("session","Session.run",async()=>{const t=this.normalizeAndValidateInputs(e),n=await this._executionPlan.execute(this.sessionHandler,t);return this.createOutput(n)})}normalizeAndValidateInputs(e){const t=this._model.graph.getInputNames();if(Array.isArray(e)){if(e.length!==t.length)throw new Error(`incorrect input array length: expected ${t.length} but got ${e.length}`)}else{if(e.size!==t.length)throw new Error(`incorrect input map size: expected ${t.length} but got ${e.size}`);const n=new Array(e.size);let r=0;for(let o=0;o<t.length;++o){const a=e.get(t[o]);if(!a)throw new Error(`missing input tensor for: '${name}'`);n[r++]=a}e=n}if(this.context.graphInputTypes&&0!==this.context.graphInputTypes.length&&this.context.graphInputDims&&0!==this.context.graphInputDims.length)this.validateInputTensorDims(this.context.graphInputDims,e,!1);else{const t=this._model.graph.getInputIndices(),n=this._model.graph.getValues(),r=new Array(t.length);for(let o=0;o<t.length;++o){const a=n[t[o]];r[o]=a.type.shape.dims,this.context.graphInputTypes.push(a.type.tensorType),this.context.graphInputDims.push(e[o].dims)}this.validateInputTensorDims(r,e,!0)}return this.validateInputTensorTypes(this.context.graphInputTypes,e),e}validateInputTensorTypes(e,t){for(let n=0;n<t.length;n++){const r=e[n],o=t[n].type;if(r!==o)throw new Error(`input tensor[${n}] check failed: expected type '${r}' but got ${o}`)}}validateInputTensorDims(e,t,n){for(let r=0;r<t.length;r++){const o=e[r],a=t[r].dims;if(!this.compareTensorDims(o,a,n))throw new Error(`input tensor[${r}] check failed: expected shape '[${o.join(",")}]' but got [${a.join(",")}]`)}}compareTensorDims(e,t,n){if(e.length!==t.length)return!1;for(let r=0;r<e.length;++r)if(e[r]!==t[r]&&(!n||0!==e[r]))return!1;return!0}createOutput(e){const t=this._model.graph.getOutputNames();if(e.length!==t.length)throw new Error("expected number of outputs do not match number of generated outputs");const n=new Map;for(let r=0;r<t.length;++r)n.set(t[r],e[r]);return n}initializeOps(e){const t=e.getNodes();this._ops=new Array(t.length);for(let n=0;n<t.length;n++)this._ops[n]=this.sessionHandler.resolve(t[n],this._model.opsets,e)}}},9162:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Tensor=void 0;const o=n(3442),a=r(n(3720)),i=n(1446),s=n(9395),l=n(2517);var u=s.onnxruntime.experimental.fbs;class c{get data(){if(void 0===this.cache){const e=this.dataProvider(this.dataId);if(e.length!==this.size)throw new Error("Length of data provided by the Data Provider is inconsistent with the dims of this Tensor.");this.cache=e}return this.cache}get stringData(){if("string"!==this.type)throw new TypeError("data type is not string");return this.data}get integerData(){switch(this.type){case"uint8":case"int8":case"uint16":case"int16":case"int32":case"uint32":case"bool":return this.data;default:throw new TypeError("data type is not integer (uint8, int8, uint16, int16, int32, uint32, bool)")}}get floatData(){switch(this.type){case"float32":case"float64":return this.data;default:throw new TypeError("data type is not float (float32, float64)")}}get numberData(){if("string"!==this.type)return this.data;throw new TypeError("type cannot be non-number (string)")}get(e){return this.data[l.ShapeUtil.indicesToOffset(e,this.strides)]}set(e,t){this.data[l.ShapeUtil.indicesToOffset(e,this.strides)]=t}async getData(){return void 0===this.cache&&(this.cache=await this.asyncDataProvider(this.dataId)),this.cache}get strides(){return this._strides||(this._strides=l.ShapeUtil.computeStrides(this.dims)),this._strides}constructor(e,t,n,r,a,i=o.Guid.create()){this.dims=e,this.type=t,this.dataProvider=n,this.asyncDataProvider=r,this.cache=a,this.dataId=i,this.size=l.ShapeUtil.validateDimsAndCalcSize(e);const s=this.size,u=void 0===n&&void 0===r&&void 0===a;if(void 0!==a&&a.length!==s)throw new RangeError("Input dims doesn't match data length.");if("string"===t){if(!(void 0===a||Array.isArray(a)&&a.every(e=>"string"==typeof e)))throw new TypeError("cache should be a string array");u&&(this.cache=new Array(s))}else{if(void 0!==a){const e=f(t);if(!(a instanceof e))throw new TypeError(`cache should be type ${e.name}`)}if(u){const e=new ArrayBuffer(s*function(e){switch(e){case"bool":case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;case"float64":return 8;default:throw new Error(`cannot calculate sizeof() on type ${e}`)}}(t));this.cache=(c=e,new(f(t))(c))}}var c}static fromProto(e){if(!e)throw new Error("cannot construct Value from an empty tensor");const t=l.ProtoUtil.tensorDataTypeFromProto(e.dataType),n=l.ProtoUtil.tensorDimsFromProto(e.dims),r=new c(n,t);if("string"===t)e.stringData.forEach((e,t)=>{r.data[t]=(0,l.decodeUtf8String)(e)});else if(e.rawData&&"number"==typeof e.rawData.byteLength&&e.rawData.byteLength>0){const t=r.data,n=new DataView(e.rawData.buffer,e.rawData.byteOffset,e.rawData.byteLength),o=d(e.dataType),a=e.rawData.byteLength/o;if(e.rawData.byteLength%o!=0)throw new Error("invalid buffer length");if(t.length!==a)throw new Error("buffer length mismatch");for(let r=0;r<a;r++){const a=h(n,e.dataType,r*o);t[r]=a}}else{let t;switch(e.dataType){case i.onnx.TensorProto.DataType.FLOAT:t=e.floatData;break;case i.onnx.TensorProto.DataType.INT32:case i.onnx.TensorProto.DataType.INT16:case i.onnx.TensorProto.DataType.UINT16:case i.onnx.TensorProto.DataType.INT8:case i.onnx.TensorProto.DataType.UINT8:case i.onnx.TensorProto.DataType.BOOL:t=e.int32Data;break;case i.onnx.TensorProto.DataType.INT64:t=e.int64Data;break;case i.onnx.TensorProto.DataType.DOUBLE:t=e.doubleData;break;case i.onnx.TensorProto.DataType.UINT32:case i.onnx.TensorProto.DataType.UINT64:t=e.uint64Data;break;default:throw new Error("unspecific error")}if(null==t)throw new Error("failed to populate data from a tensorproto value");const n=r.data;if(n.length!==t.length)throw new Error("array length mismatch");for(let r=0;r<t.length;r++){const o=t[r];a.default.isLong(o)?n[r]=p(o,e.dataType):n[r]=o}}return r}static fromData(e,t,n){return new c(t,n,void 0,void 0,e)}static fromOrtTensor(e){if(!e)throw new Error("cannot construct Value from an empty tensor");const t=l.ProtoUtil.tensorDimsFromORTFormat(e),n=l.ProtoUtil.tensorDataTypeFromProto(e.dataType()),r=new c(t,n);if("string"===n)for(let o=0;o<e.stringDataLength();o++)r.data[o]=e.stringData(o);else if(e.rawDataArray()&&"number"==typeof e.rawDataLength()&&e.rawDataLength()>0){const t=r.data,n=new DataView(e.rawDataArray().buffer,e.rawDataArray().byteOffset,e.rawDataLength()),o=d(e.dataType()),a=e.rawDataLength()/o;if(e.rawDataLength()%o!=0)throw new Error("invalid buffer length");if(t.length!==a)throw new Error("buffer length mismatch");for(let r=0;r<a;r++){const a=h(n,e.dataType(),r*o);t[r]=a}}return r}}function d(e){switch(e){case i.onnx.TensorProto.DataType.UINT8:case i.onnx.TensorProto.DataType.INT8:case i.onnx.TensorProto.DataType.BOOL:return 1;case i.onnx.TensorProto.DataType.UINT16:case i.onnx.TensorProto.DataType.INT16:return 2;case i.onnx.TensorProto.DataType.FLOAT:case i.onnx.TensorProto.DataType.INT32:case i.onnx.TensorProto.DataType.UINT32:return 4;case i.onnx.TensorProto.DataType.INT64:case i.onnx.TensorProto.DataType.DOUBLE:case i.onnx.TensorProto.DataType.UINT64:return 8;default:throw new Error(`cannot calculate sizeof() on type ${i.onnx.TensorProto.DataType[e]}`)}}function f(e){switch(e){case"bool":case"uint8":return Uint8Array;case"int8":return Int8Array;case"int16":return Int16Array;case"uint16":return Uint16Array;case"int32":return Int32Array;case"uint32":return Uint32Array;case"float32":return Float32Array;case"float64":return Float64Array;default:throw new Error("unspecified error")}}function p(e,t){if(t===i.onnx.TensorProto.DataType.INT64||t===u.TensorDataType.INT64){if(e.greaterThanOrEqual(2147483648)||e.lessThan(-2147483648))throw new TypeError("int64 is not supported")}else{if(t!==i.onnx.TensorProto.DataType.UINT32&&t!==u.TensorDataType.UINT32&&t!==i.onnx.TensorProto.DataType.UINT64&&t!==u.TensorDataType.UINT64)throw new TypeError(`not a LONG type: ${i.onnx.TensorProto.DataType[t]}`);if(e.greaterThanOrEqual(4294967296)||e.lessThan(0))throw new TypeError("uint64 is not supported")}return e.toNumber()}function h(e,t,n){switch(t){case i.onnx.TensorProto.DataType.BOOL:case i.onnx.TensorProto.DataType.UINT8:return e.getUint8(n);case i.onnx.TensorProto.DataType.INT8:return e.getInt8(n);case i.onnx.TensorProto.DataType.UINT16:return e.getUint16(n,!0);case i.onnx.TensorProto.DataType.INT16:return e.getInt16(n,!0);case i.onnx.TensorProto.DataType.FLOAT:return e.getFloat32(n,!0);case i.onnx.TensorProto.DataType.INT32:return e.getInt32(n,!0);case i.onnx.TensorProto.DataType.UINT32:return e.getUint32(n,!0);case i.onnx.TensorProto.DataType.INT64:return p(a.default.fromBits(e.getUint32(n,!0),e.getUint32(n+4,!0),!1),t);case i.onnx.TensorProto.DataType.DOUBLE:return e.getFloat64(n,!0);case i.onnx.TensorProto.DataType.UINT64:return p(a.default.fromBits(e.getUint32(n,!0),e.getUint32(n+4,!0),!0),t);default:throw new Error(`cannot read from DataView for type ${i.onnx.TensorProto.DataType[t]}`)}}t.Tensor=c},2517:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.decodeUtf8String=t.MAX_CLIP=t.MIN_CLIP=t.PoolConvUtil=t.ReduceUtil=t.SplitUtil=t.MathUtil=t.ShapeUtil=t.LongUtil=t.ProtoUtil=t.GemmUtil=t.arrayCopyHelper=t.BroadcastUtil=t.MatMulUtil=t.ArrayUtil=t.assert=t.checkInputsShape=void 0;const o=n(5686),a=r(n(3720)),i=n(1446),s=n(9162);t.checkInputsShape=function(e,...t){if(!e||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].dims||e[n].dims.length!==t[n])return!1;return!0},t.assert=function(e,t){if(!e)throw new Error("string"==typeof t?t:t())},t.ArrayUtil=class{static arraysEqual(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}};class l{static preprocessInputShapes(e,t){return[1===e.length?[1,e[0]]:e,1===t.length?[t[0],1]:t]}static postprocessOutputShape(e,t,n){1===t&&e.splice(e.length-2,1),1===n&&e.pop()}static calcMatMulShape(e,t){return e[1]!==t[0]?void 0:[e[0],t[1]]}}t.MatMulUtil=l;class u{static calcShape(e,t,n=!1){const r=e.length,o=t.length;if(0===r)return t;if(0===o)return e;const a=Math.max(e.length,t.length),i=new Array(a);if(n){if(r<2||o<2)return;const n=l.calcMatMulShape([e[r-2],e[r-1]],[t[o-2],t[o-1]]);if(void 0===n)return;[i[a-2],i[a-1]]=n}for(let s=n?3:1;s<=a;s++){const n=r-s<0?1:e[r-s],l=o-s<0?1:t[o-s];if(n!==l&&n>1&&l>1)return;i[a-s]=Math.max(n,l)}return i}static index(e,t){const n=new Array(t.length);return u.fillIndex(e,t,n),n}static fillIndex(e,t,n){const r=e.length-t.length;for(let o=0;o<t.length;o++)n[o]=e[r+o]%t[o]}static calc(e,t,n,r,o){const a=u.calcShape(e.dims,t.dims);if(a){if(r&&!f.areEqual(a,e.dims))return;const i=f.size(a),l=r?e:new s.Tensor(a,o||e.type);if(0===a.length)l.set([],n(e.get([]),t.get([])));else{const r=new Array(a.length),o=new Array(e.dims.length),s=new Array(t.dims.length);let c,d=0,f=0,p=!1,h=!1;0===e.dims.length&&(d=e.get([]),p=!0),0===t.dims.length&&(f=t.get([]),h=!0);for(let m=0;m<i;m++){c=m;for(let e=a.length-1;e>=0;e--)r[e]=c%a[e],c=Math.floor(c/a[e]);p||(u.fillIndex(r,e.dims,o),d=e.get(o)),h||(u.fillIndex(r,t.dims,s),f=t.get(s)),l.set(r,n(d,f))}}return l}}static isValidBroadcast(e,t){const n=e.length,r=t.length;if(n>r)return!1;for(let o=1;o<=n;o++)if(1!==e[n-o]&&e[n-o]!==t[r-o])return!1;return!0}static getBroadcastDims(e,t){const n=e.length,r=[];for(let o=0;o<n;o++){const a=n-1-o,i=e[a]||1;(t[t.length-1-o]||1)>1&&1===i&&r.unshift(a)}return r}}t.BroadcastUtil=u,t.arrayCopyHelper=function(e,t,n,r,o){if(r<0||r>=t.length)throw new Error("sourceIndex out of bounds");if(n<0||n>=e.length)throw new Error("targetIndex out of bounds");if(r+o>t.length)throw new Error("source indices to be copied are outside bounds");if(n+o>e.length)throw new Error("target array is too small to hold result");for(let a=0;a<o;a++)e[n+a]=t[r+a]},t.GemmUtil=class{static getShapeOfGemmResult(e,t,n,r,o){if(2!==e.length||2!==n.length)throw new Error("shape need to be of size 2");let a,i,s;t?(a=e[1],i=e[0]):(a=e[0],i=e[1]);let l=-1;if(r?(s=n[0],l=1):(s=n[1],l=0),n[l]!==i)throw new Error("dimension mismatch");if(a<=0||s<=0||i<=0)throw new Error("invalid shape specified");if(o&&!u.isValidBroadcast(o,[a,s]))throw new Error("gemm: invalid bias shape for broadcast");return[a,s,i]}};class c{static tensorDataTypeFromProto(e){switch(e){case i.onnx.TensorProto.DataType.INT8:return"int8";case i.onnx.TensorProto.DataType.UINT8:return"uint8";case i.onnx.TensorProto.DataType.BOOL:return"bool";case i.onnx.TensorProto.DataType.INT16:return"int16";case i.onnx.TensorProto.DataType.UINT16:return"uint16";case i.onnx.TensorProto.DataType.INT32:return"int32";case i.onnx.TensorProto.DataType.UINT32:return"uint32";case i.onnx.TensorProto.DataType.FLOAT:return"float32";case i.onnx.TensorProto.DataType.DOUBLE:return"float64";case i.onnx.TensorProto.DataType.STRING:return"string";case i.onnx.TensorProto.DataType.INT64:return"int32";case i.onnx.TensorProto.DataType.UINT64:return"uint32";default:throw new Error(`unsupported data type: ${i.onnx.TensorProto.DataType[e]}`)}}static tensorDataTypeStringToEnum(e){switch(e){case"int8":return i.onnx.TensorProto.DataType.INT8;case"uint8":return i.onnx.TensorProto.DataType.UINT8;case"bool":return i.onnx.TensorProto.DataType.BOOL;case"int16":return i.onnx.TensorProto.DataType.INT16;case"uint16":return i.onnx.TensorProto.DataType.UINT16;case"int32":return i.onnx.TensorProto.DataType.INT32;case"uint32":return i.onnx.TensorProto.DataType.UINT32;case"float32":return i.onnx.TensorProto.DataType.FLOAT;case"float64":return i.onnx.TensorProto.DataType.DOUBLE;case"string":return i.onnx.TensorProto.DataType.STRING;case"int64":return i.onnx.TensorProto.DataType.INT64;case"uint64":return i.onnx.TensorProto.DataType.UINT64;default:throw new Error(`unsupported data type: ${e}`)}}static tensorDimsFromProto(e){return e.map(e=>a.default.isLong(e)?e.toNumber():e)}static tensorValueTypeFromProto(e){return{tensorType:c.tensorDataTypeFromProto(e.elemType),shape:{dims:c.tensorDimsFromProto(e.shape.dim.map(e=>e.dimValue))}}}static tensorDimsFromORTFormat(e){const t=[];for(let n=0;n<e.dimsLength();n++)t.push(d.longToNumber(e.dims(n)));return t}static tensorAttributesFromORTFormat(e){const t=[];for(let n=0;n<e.attributesLength();n++)t.push(e.attributes(n));return t}}t.ProtoUtil=c;class d{static longToNumber(e,t){return a.default.isLong(e)?e.toNumber():e instanceof o.flatbuffers.Long?a.default.fromValue({low:e.low,high:e.high,unsigned:null!=t&&t}).toNumber():e}static isLong(e){return a.default.isLong(e)||e instanceof o.flatbuffers.Long}}t.LongUtil=d;class f{static size(e){return f.getSizeFromDimensionRange(e,0,e.length)}static sizeFromDimension(e,t){if(t<0||t>e.length)throw new Error(`invalid dimension of ${t} for sizeFromDimension as Tensor has ${e.length} dimensions.`);return f.getSizeFromDimensionRange(e,t,e.length)}static sizeToDimension(e,t){if(t<0||t>e.length)throw new Error(`invalid dimension of ${t} for sizeToDimension as Tensor has ${e.length} dimensions.`);return f.getSizeFromDimensionRange(e,0,t)}static getSizeFromDimensionRange(e,t,n){let r=1;for(let o=t;o<n;o++){if(e[o]<=0)throw new Error("cannot get valid size from specified dimension range. Most likely the range contains 0 or negative values in them.");r*=e[o]}return r}static computeStrides(e){const t=e.length;if(0===t)return[];if(1===t)return[1];const n=new Array(t);n[t-1]=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}static transpose(e){return e.slice().reverse()}static indicesToOffset(e,t,n){void 0===n&&(n=e.length);let r=0;for(let o=0;o<n;++o)r+=t[o]*e[o];return r}static offsetToIndices(e,t){const n=t.length;if(0===n)return[];if(1===n)return[e*t[0]];const r=new Array(t.length);for(let o=0;o<r.length-1;++o)r[o]=Math.floor(e/t[o]),e-=r[o]*t[o];return r[r.length-1]=e,r}static normalizeAxis(e,t){if(e<-t&&e>=t)throw new Error("unsupported axis for this operation.");return e<0?e+t:e}static normalizeAxes(e,t){return e.map(e=>this.normalizeAxis(e,t))}static incrementIndex(e,t,n){if(0===t.length||0===e.length)throw new Error("Index incrementing unsupported for scalar Tensor");if(void 0===n)n=t.length;else if(n<=0||n>t.length)throw new Error("Incorrect axis to increment on");for(let r=n-1;r>=0&&(e[r]++,!(e[r]<t[r]));--r)e[r]=0}static calculateReshapedDims(e,t){if(0===t.length){if(0===e.length||1===f.size(e))return[];throw new Error("cannot reshape to a scalar Tensor")}const n=t.length,r=new Array(n);let o=-1,a=1;for(let s=0;s<n;s++){if(t[s]<-1)throw new Error("a dimension in shape hints cannot be less than -1");if(-1===t[s]){if(-1!==o)throw new Error("at most one dimension in shape hints can be -1");o=s}else{if(0===t[s]){if(s>=e.length)throw new Error("the dimension with value zero exceeds the dimension size of the input tensor");r[s]=e[s]}else r[s]=t[s];a*=r[s]}}const i=f.size(e);if(-1!==o){if(i%a!=0)throw new Error(`the input tensor cannot be reshaped to the requested shape. Input shape: [${e}] Output shape: [${t}]`);r[o]=i/a}else if(a!==i)throw new Error("reshapedDims and originalDims don't have matching sizes");return r}static sortBasedOnPerm(e,t){return t?t.map(t=>e[t]):e.slice().reverse()}static padShape(e,t){const n=e.length;return e.map((e,r)=>e+t[r]+t[r+n])}static areEqual(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}static validateDimsAndCalcSize(e){if(e.length>6)throw new TypeError("Only rank 0 to 6 is supported for tensor shape.");let t=1;for(const n of e){if(!Number.isInteger(n))throw new TypeError(`Invalid shape: ${n} is not an integer`);if(n<0||n>2147483647)throw new TypeError(`Invalid shape: length ${n} is not allowed`);t*=n}return t}static flattenShape(e,t){t<0&&(t+=e.length);const n=e.reduce((e,t)=>e*t,1),r=e.slice(t).reduce((e,t)=>e*t,1);return[n/r,r]}static squeezeShape(e,t){const n=new Array;t=f.normalizeAxes(t,e.length);for(let r=0;r<e.length;r++){const o=t.indexOf(r)>=0;if(o&&1!==e[r])throw new Error("squeeze an axis of size different than 1");(0===t.length&&e[r]>1||t.length>0&&!o)&&n.push(e[r])}return n}static unsqueezeShape(e,t){const n=new Array(e.length+t.length);n.fill(0);for(let o=0;o<t.length;o++){const e=f.normalizeAxis(t[o],n.length);if(e>=n.length)throw new Error("'axes' has an out of range axis");if(0!==n[e])throw new Error("'axes' has a duplicate axis");n[e]=1}let r=0;for(let o=0;o<n.length;o++)0===n[o]&&(n[o]=e[r++]);if(r!==e.length)throw new Error("the unsqueezed dimension could not be established");return n}}t.ShapeUtil=f,t.MathUtil=class{static sqr(e,t,n,r,o){if(r<0||r>=t.length)throw new Error("sourceIndex out of bounds");if(n<0||n>=e.length)throw new Error("targetIndex out of bounds");if(r+o>t.length)throw new Error("source indices to be copied are outside bounds");if(n+o>e.length)throw new Error("target array is too small to hold result");for(let a=0;a<o;a++)e[n+a]+=Math.pow(t[r+a],2)}static axpy(e,t,n,r,o,a){if(r<0||r>=t.length)throw new Error("sourceIndex out of bounds");if(n<0||n>=e.length)throw new Error("targetIndex out of bounds");if(r+o>t.length)throw new Error("source indices to be copied are outside bounds");if(n+o>e.length)throw new Error("target array is too small to hold result");for(let i=0;i<o;i++)e[n+i]+=a*t[r+i]}static powx(e,t,n,r,o,a){if(r<0||r>=t.length)throw new Error("sourceIndex out of bounds");if(n<0||n>=e.length)throw new Error("targetIndex out of bounds");if(r+o>t.length)throw new Error("source indices to be copied are outside bounds");if(n+o>e.length)throw new Error("target array is too small to hold result");for(let i=0;i<o;i++)e[n+i]=Math.pow(t[r+i],a)}static mul(e,t,n,r,o){if(r<0||r>=t.length)throw new Error("sourceIndex out of bounds");if(n<0||n>=e.length)throw new Error("targetIndex out of bounds");if(r+o>t.length)throw new Error("source indices to be copied are outside bounds");if(n+o>e.length)throw new Error("target array is too small to hold result");for(let a=0;a<o;a++)e[n+a]=t[r+a]*e[n+a]}};class p{static splitShape(e,t,n,r){if(0===n.length){if(!r)throw new Error("need to know number of outputs when the 'split' attribute is not specified");p.determineSplit(e[t],r,n)}const o=[],a=[0];for(let i=0;i<n.length;++i){0!==i&&a.push(a[i-1]+n[i-1]);const r=e.slice();r[t]=n[i],o.push(r)}return[o,a]}static determineSplit(e,t,n){if(e%t!=0)throw new Error("cannot split tensor to equal sized parts");for(let r=0;r<t;++r)n.push(e/t)}}t.SplitUtil=p;class h{static calcReduce(e,t,n,r,o){const a=e.dims.slice(0);0===t.length&&a.forEach((e,n)=>t.push(n));const i=h.calcReduceShape(a,t,!0),l=f.size(i),c=new s.Tensor(i,e.type),d=f.computeStrides(i),p=f.computeStrides(a),m=new Array(a.length);for(let s=0;s<l;s++){const n=f.offsetToIndices(s,d);u.fillIndex(n,a,m),c.set(n,h.calcReduceByAxis(e.numberData,t,a,0,f.indicesToOffset(m,p),r,o))}return n?c:new s.Tensor(h.calcReduceShape(a,t,n),c.type,void 0,void 0,c.data,c.dataId)}static calcReduceByAxis(e,t,n,r,o,a,i){let s=0;if(r>=t.length)return a(e[o]);const l=t[r],u=l>=n.length?1:f.size(n.slice(l+1));for(let c=0;c<n[l];c++)s=0===c?h.calcReduceByAxis(e,t,n,r+1,o,a,i):i(s,h.calcReduceByAxis(e,t,n,r+1,o,a,i)),o+=u;return s}static calcReduceShape(e,t,n){const r=e.slice();for(let o=0;o<t.length;o++)r[t[o]]=n?1:0;return r.filter(e=>0!==e)}}t.ReduceUtil=h;class m{static adjustPoolAttributes(e,t,n,r,o,a){if(!e&&n.length!==t.length-2)throw new Error("length of specified kernel shapes should be 2 less than length of input dimensions");if(e)for(let i=0;i<t.length-2;i++)i>=n.length?n.push(t[i+2]):n[i]=t[i+2];for(let i=0;i<n.length;i++)if(i<r.length){if(r[i]<0)throw new Error("strides should be greater than or equal to 1")}else r.push(1);for(let i=0;i<n.length;i++)if(i<o.length){if(o[i]<0)throw new Error("dilations should be greater than or equal to 1")}else o.push(1);for(let i=0;i<2*n.length;i++)if(i<a.length){if(a[i]<0)throw new Error("pad should be greater than or equal to 1")}else a.push(0);for(let i=0;i<n.length;i++){if(n[i]<=0)throw new Error("kernel shapes need to be greater than 0");if(a[i]>=n[i]||a[i+n.length]>=n[i])throw new Error("pads should be smaller than kernel")}}static adjustPadsBasedOnAutoPad(e,t,n,r,o,a){if(a){if(o.length!==2*(e.length-2))throw new Error("length of pads should be twice the length of data dimensions");if(t.length!==e.length-2)throw new Error("length of strides should be the length of data dimensions");if(r.length!==e.length-2)throw new Error("length of kernel shapes should be the length of data dimensions");for(let i=0;i<e.length-2;i++)m.adjustPadAndReturnShape(e[i+2],t[i],n[i],r[i],o,i,i+e.length-2,a)}}static computePoolOutputShape(e,t,n,r,o,a,i){if(t.length<=0)throw new Error("input shape must be of size greater than 0");const s=[t[0],t[1]];return m.computeShapeHelper(e,t,s,n,r,o,a,i),s}static computeConvOutputShape(e,t,n,r,o,a,i){if(e.length<=0||t.length<=0)throw new Error("invalid input tensor dims or invalid filter tensor dims");const s=[e[0],t[0]];return m.computeShapeHelper(!1,e,s,n,r,o,a,i),s}static computeShapeHelper(e,t,n,r,o,a,i,s){if(e)for(let l=0;l<t.length-2;l++)n.push(1);else for(let l=0;l<t.length-2;l++)n.push(m.adjustPadAndReturnShape(t[l+2],r[l],o[l],a[l],i,l,l+t.length-2,s))}static adjustPadAndReturnShape(e,t,n,r,o,a,i,s){const l=n*(r-1)+1;if(!s||"NOTSET"===s)return Math.floor((e+o[a]+o[i]-l)/t+1);switch(s){case"VALID":return o[a]=0,o[i]=0,Math.floor((e-l)/t+1);case"SAME_LOWER":case"SAME_UPPER":if(1!==n)throw new Error("Dilation not supported for SAME_UPPER or SAME_LOWER");{const n=((e+t-1)/t-1)*t+r-e;return o[a]="SAME_LOWER"===s?Math.floor((n+1)/2):Math.floor(n/2),o[i]=n-o[a],Math.floor((e+n-r)/t+1)}default:throw new Error("Unsupported AutoPad type")}}}t.PoolConvUtil=m,t.MIN_CLIP=-34028234663852886e22,t.MAX_CLIP=34028234663852886e22,t.decodeUtf8String=function(e){return(new TextDecoder).decode(e)}},7967:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.iterateExtraOptions=void 0,t.iterateExtraOptions=(e,n,r,o)=>{if("object"==typeof e&&null!==e){if(r.has(e))throw new Error("Circular reference in options");r.add(e)}Object.entries(e).forEach(([e,a])=>{const i=n?n+e:e;if("object"==typeof a)(0,t.iterateExtraOptions)(a,i+".",r,o);else if("string"==typeof a||"number"==typeof a)o(i,a.toString());else{if("boolean"!=typeof a)throw new Error("Can't handle extra config type: "+typeof a);o(i,a?"1":"0")}})}},2157:function(e,t,n){var r,o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return a(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.endProfiling=t.run=t.releaseSession=t.createSession=t.createSessionFinalize=t.createSessionAllocate=t.initOrt=t.initWasm=void 0;const s=n(1670),l=i(n(349)),u=n(6361),c=()=>!!s.env.wasm.proxy&&"undefined"!=typeof document;let d,f,p,h=!1,m=!1,g=!1;const b=[],y=[],_=[],v=[],w=[],S=[],x=()=>{if(h||!m||g||!d)throw new Error("worker not ready")},T=e=>{switch(e.data.type){case"init-wasm":h=!1,e.data.err?(g=!0,f[1](e.data.err)):(m=!0,f[0]());break;case"init-ort":e.data.err?p[1](e.data.err):p[0]();break;case"create_allocate":e.data.err?b.shift()[1](e.data.err):b.shift()[0](e.data.out);break;case"create_finalize":e.data.err?y.shift()[1](e.data.err):y.shift()[0](e.data.out);break;case"create":e.data.err?_.shift()[1](e.data.err):_.shift()[0](e.data.out);break;case"release":e.data.err?v.shift()[1](e.data.err):v.shift()[0]();break;case"run":e.data.err?w.shift()[1](e.data.err):w.shift()[0](e.data.out);break;case"end-profiling":e.data.err?S.shift()[1](e.data.err):S.shift()[0]()}},E="undefined"!=typeof document?null===(r=null===document||void 0===document?void 0:document.currentScript)||void 0===r?void 0:r.src:void 0;t.initWasm=async()=>{if(c()){if(m)return;if(h)throw new Error("multiple calls to 'initWasm()' detected.");if(g)throw new Error("previous call to 'initWasm()' failed.");return h=!0,void 0===s.env.wasm.wasmPaths&&E&&0!==E.indexOf("blob:")&&(s.env.wasm.wasmPaths=E.substr(0,+E.lastIndexOf("/")+1)),new Promise((e,t)=>{null==d||d.terminate(),d=n(9710).Z(),d.onmessage=T,f=[e,t];const r={type:"init-wasm",in:s.env.wasm};d.postMessage(r)})}return(0,u.initializeWebAssembly)(s.env.wasm)},t.initOrt=async(e,t)=>{if(c())return x(),new Promise((n,r)=>{p=[n,r];const o={type:"init-ort",in:{numThreads:e,loggingLevel:t}};d.postMessage(o)});l.initOrt(e,t)},t.createSessionAllocate=async e=>c()?(x(),new Promise((t,n)=>{b.push([t,n]);const r={type:"create_allocate",in:{model:e}};d.postMessage(r,[e.buffer])})):l.createSessionAllocate(e),t.createSessionFinalize=async(e,t)=>c()?(x(),new Promise((n,r)=>{y.push([n,r]);const o={type:"create_finalize",in:{modeldata:e,options:t}};d.postMessage(o)})):l.createSessionFinalize(e,t),t.createSession=async(e,t)=>c()?(x(),new Promise((n,r)=>{_.push([n,r]);const o={type:"create",in:{model:e,options:t}};d.postMessage(o,[e.buffer])})):l.createSession(e,t),t.releaseSession=async e=>{if(c())return x(),new Promise((t,n)=>{v.push([t,n]);const r={type:"release",in:e};d.postMessage(r)});l.releaseSession(e)},t.run=async(e,t,n,r,o)=>c()?(x(),new Promise((a,i)=>{w.push([a,i]);const s={type:"run",in:{sessionId:e,inputIndices:t,inputs:n,outputIndices:r,options:o}};d.postMessage(s,l.extractTransferableBuffers(n))})):l.run(e,t,n,r,o),t.endProfiling=async e=>{if(c())return x(),new Promise((t,n)=>{S.push([t,n]);const r={type:"end-profiling",in:e};d.postMessage(r)});l.endProfiling(e)}},586:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.setRunOptions=void 0;const r=n(7967),o=n(4983),a=n(6361);t.setRunOptions=e=>{const t=(0,a.getInstance)();let n=0;const i=[],s=e||{};try{if(void 0===(null==e?void 0:e.logSeverityLevel))s.logSeverityLevel=2;else if("number"!=typeof e.logSeverityLevel||!Number.isInteger(e.logSeverityLevel)||e.logSeverityLevel<0||e.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${e.logSeverityLevel}`);if(void 0===(null==e?void 0:e.logVerbosityLevel))s.logVerbosityLevel=0;else if("number"!=typeof e.logVerbosityLevel||!Number.isInteger(e.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${e.logVerbosityLevel}`);void 0===(null==e?void 0:e.terminate)&&(s.terminate=!1);let a=0;if(void 0!==(null==e?void 0:e.tag)&&(a=(0,o.allocWasmString)(e.tag,i)),n=t._OrtCreateRunOptions(s.logSeverityLevel,s.logVerbosityLevel,!!s.terminate,a),0===n)throw new Error("Can't create run options");return void 0!==(null==e?void 0:e.extra)&&(0,r.iterateExtraOptions)(e.extra,"",new WeakSet,(e,r)=>{const a=(0,o.allocWasmString)(e,i),s=(0,o.allocWasmString)(r,i);if(0!==t._OrtAddRunConfigEntry(n,a,s))throw new Error(`Can't set a run config entry: ${e} - ${r}`)}),[n,i]}catch(l){throw 0!==n&&t._OrtReleaseRunOptions(n),i.forEach(t._free),l}}},2306:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.OnnxruntimeWebAssemblySessionHandler=void 0;const r=n(2806),o=n(1670),a=n(2850),i=n(2157);let s;t.OnnxruntimeWebAssemblySessionHandler=class{async createSessionAllocate(e){const t=await fetch(e),n=await t.arrayBuffer();return(0,i.createSessionAllocate)(new Uint8Array(n))}async loadModel(e,t){if(s||(await(0,i.initOrt)(o.env.wasm.numThreads,(e=>{switch(e){case"verbose":return 0;case"info":return 1;case"warning":return 2;case"error":return 3;case"fatal":return 4;default:throw new Error(`unsupported logging level: ${e}`)}})(o.env.logLevel)),s=!0),"string"==typeof e)if("undefined"==typeof fetch){const n=await(0,a.promisify)(r.readFile)(e);[this.sessionId,this.inputNames,this.outputNames]=await(0,i.createSession)(n,t)}else{const n=await this.createSessionAllocate(e);[this.sessionId,this.inputNames,this.outputNames]=await(0,i.createSessionFinalize)(n,t)}else[this.sessionId,this.inputNames,this.outputNames]=await(0,i.createSession)(e,t)}async dispose(){return(0,i.releaseSession)(this.sessionId)}async run(e,t,n){const r=[],a=[];Object.entries(e).forEach(e=>{const t=e[0],n=e[1],o=this.inputNames.indexOf(t);if(-1===o)throw new Error(`invalid input '${t}'`);r.push(n),a.push(o)});const s=[];Object.entries(t).forEach(e=>{const t=e[0],n=this.outputNames.indexOf(t);if(-1===n)throw new Error(`invalid output '${t}'`);s.push(n)});const l=await(0,i.run)(this.sessionId,a,r.map(e=>[e.type,e.dims,e.data]),s,n),u={};for(let i=0;i<l.length;i++)u[this.outputNames[s[i]]]=new o.Tensor(l[i][0],l[i][2],l[i][1]);return u}startProfiling(){}endProfiling(){(0,i.endProfiling)(this.sessionId)}}},4919:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.setSessionOptions=void 0;const r=n(7967),o=n(4983),a=n(6361);t.setSessionOptions=e=>{const t=(0,a.getInstance)();let n=0;const i=[],s=e||{};(e=>{e.extra||(e.extra={}),e.extra.session||(e.extra.session={});const t=e.extra.session;t.use_ort_model_bytes_directly||(t.use_ort_model_bytes_directly="1")})(s);try{void 0===(null==e?void 0:e.graphOptimizationLevel)&&(s.graphOptimizationLevel="all");const l=(e=>{switch(e){case"disabled":return 0;case"basic":return 1;case"extended":return 2;case"all":return 99;default:throw new Error(`unsupported graph optimization level: ${e}`)}})(s.graphOptimizationLevel);void 0===(null==e?void 0:e.enableCpuMemArena)&&(s.enableCpuMemArena=!0),void 0===(null==e?void 0:e.enableMemPattern)&&(s.enableMemPattern=!0),void 0===(null==e?void 0:e.executionMode)&&(s.executionMode="sequential");const u=(e=>{switch(e){case"sequential":return 0;case"parallel":return 1;default:throw new Error(`unsupported execution mode: ${e}`)}})(s.executionMode);let c=0;if(void 0!==(null==e?void 0:e.logId)&&(c=(0,o.allocWasmString)(e.logId,i)),void 0===(null==e?void 0:e.logSeverityLevel))s.logSeverityLevel=2;else if("number"!=typeof e.logSeverityLevel||!Number.isInteger(e.logSeverityLevel)||e.logSeverityLevel<0||e.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${e.logSeverityLevel}`);if(void 0===(null==e?void 0:e.logVerbosityLevel))s.logVerbosityLevel=0;else if("number"!=typeof e.logVerbosityLevel||!Number.isInteger(e.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${e.logVerbosityLevel}`);if(void 0===(null==e?void 0:e.enableProfiling)&&(s.enableProfiling=!1),n=t._OrtCreateSessionOptions(l,!!s.enableCpuMemArena,!!s.enableMemPattern,u,!!s.enableProfiling,0,c,s.logSeverityLevel,s.logVerbosityLevel),0===n)throw new Error("Can't create session options");return(null==e?void 0:e.executionProviders)&&((e,t,n)=>{for(const r of t){let t="string"==typeof r?r:r.name;switch(t){case"xnnpack":t="XNNPACK";break;case"wasm":case"cpu":continue;default:throw new Error(`not supported EP: ${t}`)}const i=(0,o.allocWasmString)(t,n);if(0!==(0,a.getInstance)()._OrtAppendExecutionProvider(e,i))throw new Error(`Can't append execution provider: ${t}`)}})(n,e.executionProviders,i),void 0!==(null==e?void 0:e.extra)&&(0,r.iterateExtraOptions)(e.extra,"",new WeakSet,(e,r)=>{const a=(0,o.allocWasmString)(e,i),s=(0,o.allocWasmString)(r,i);if(0!==t._OrtAddSessionConfigEntry(n,a,s))throw new Error(`Can't set a session config entry: ${e} - ${r}`)}),[n,i]}catch(l){throw 0!==n&&t._OrtReleaseSessionOptions(n),i.forEach(t._free),l}}},4983:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.allocWasmString=void 0;const r=n(6361);t.allocWasmString=(e,t)=>{const n=(0,r.getInstance)(),o=n.lengthBytesUTF8(e)+1,a=n._malloc(o);return n.stringToUTF8(e,a,o),t.push(a),a}},349:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.extractTransferableBuffers=t.endProfiling=t.run=t.releaseSession=t.createSession=t.createSessionFinalize=t.createSessionAllocate=t.initOrt=void 0;const r=n(586),o=n(4919),a=n(4983),i=n(6361);t.initOrt=(e,t)=>{const n=(0,i.getInstance)()._OrtInit(e,t);if(0!==n)throw new Error(`Can't initialize onnxruntime. error code = ${n}`)};const s=new Map;t.createSessionAllocate=e=>{const t=(0,i.getInstance)(),n=t._malloc(e.byteLength);return t.HEAPU8.set(e,n),[n,e.byteLength]},t.createSessionFinalize=(e,t)=>{const n=(0,i.getInstance)();let r=0,a=0,l=[];try{if([a,l]=(0,o.setSessionOptions)(t),r=n._OrtCreateSession(e[0],e[1],a),0===r)throw new Error("Can't create a session")}finally{n._free(e[0]),n._OrtReleaseSessionOptions(a),l.forEach(n._free)}const u=n._OrtGetInputCount(r),c=n._OrtGetOutputCount(r),d=[],f=[],p=[],h=[];for(let o=0;o<u;o++){const e=n._OrtGetInputName(r,o);if(0===e)throw new Error("Can't get an input name");f.push(e),d.push(n.UTF8ToString(e))}for(let o=0;o<c;o++){const e=n._OrtGetOutputName(r,o);if(0===e)throw new Error("Can't get an output name");h.push(e),p.push(n.UTF8ToString(e))}return s.set(r,[r,f,h]),[r,d,p]},t.createSession=(e,n)=>{const r=(0,t.createSessionAllocate)(e);return(0,t.createSessionFinalize)(r,n)},t.releaseSession=e=>{const t=(0,i.getInstance)(),n=s.get(e);if(!n)throw new Error("invalid session id");const r=n[0],o=n[1],a=n[2];o.forEach(t._OrtFree),a.forEach(t._OrtFree),t._OrtReleaseSession(r),s.delete(e)};const l=e=>{switch(e){case"int8":return 3;case"uint8":return 2;case"bool":return 9;case"int16":return 5;case"uint16":return 4;case"int32":return 6;case"uint32":return 12;case"float32":return 1;case"float64":return 11;case"string":return 8;case"int64":return 7;case"uint64":return 13;default:throw new Error(`unsupported data type: ${e}`)}},u=e=>{switch(e){case 3:return"int8";case 2:return"uint8";case 9:return"bool";case 5:return"int16";case 4:return"uint16";case 6:return"int32";case 12:return"uint32";case 1:return"float32";case 11:return"float64";case 8:return"string";case 7:return"int64";case 13:return"uint64";default:throw new Error(`unsupported data type: ${e}`)}},c=e=>{switch(e){case"float32":return Float32Array;case"uint8":case"bool":return Uint8Array;case"int8":return Int8Array;case"uint16":return Uint16Array;case"int16":return Int16Array;case"int32":return Int32Array;case"float64":return Float64Array;case"uint32":return Uint32Array;case"int64":return BigInt64Array;case"uint64":return BigUint64Array;default:throw new Error(`unsupported type: ${e}`)}};t.run=(e,t,n,o,d)=>{const f=(0,i.getInstance)(),p=s.get(e);if(!p)throw new Error("invalid session id");const h=p[0],m=p[1],g=p[2],b=t.length,y=o.length;let _=0,v=[];const w=[],S=[];try{[_,v]=(0,r.setRunOptions)(d);for(let t=0;t<b;t++){const e=n[t][0],r=n[t][1],o=n[t][2];let i,s;if(Array.isArray(o)){s=4*o.length,i=f._malloc(s),S.push(i);let e=i/4;for(let t=0;t<o.length;t++){if("string"!=typeof o[t])throw new TypeError(`tensor data at index ${t} is not a string`);f.HEAPU32[e++]=(0,a.allocWasmString)(o[t],S)}}else s=o.byteLength,i=f._malloc(s),S.push(i),f.HEAPU8.set(new Uint8Array(o.buffer,o.byteOffset,s),i);const u=f.stackSave(),c=f.stackAlloc(4*r.length);try{let t=c/4;r.forEach(e=>f.HEAP32[t++]=e);const n=f._OrtCreateTensor(l(e),i,s,c,r.length);if(0===n)throw new Error("Can't create a tensor");w.push(n)}finally{f.stackRestore(u)}}const e=f.stackSave(),i=f.stackAlloc(4*b),s=f.stackAlloc(4*b),p=f.stackAlloc(4*y),x=f.stackAlloc(4*y);try{let e=i/4,n=s/4,r=p/4,a=x/4;for(let o=0;o<b;o++)f.HEAPU32[e++]=w[o],f.HEAPU32[n++]=m[t[o]];for(let t=0;t<y;t++)f.HEAPU32[r++]=0,f.HEAPU32[a++]=g[o[t]];let l=f._OrtRun(h,s,i,b,x,y,p,_);const d=[];if(0===l)for(let t=0;t<y;t++){const e=f.HEAPU32[p/4+t],n=f.stackSave(),r=f.stackAlloc(16);let o,a=0;try{if(l=f._OrtGetTensorData(e,r,r+4,r+8,r+12),0!==l)throw new Error(`Can't access output tensor data. error code = ${l}`);let t=r/4;const n=f.HEAPU32[t++];a=f.HEAPU32[t++];const i=f.HEAPU32[t++],s=f.HEAPU32[t++],p=[];for(let e=0;e<s;e++)p.push(f.HEAPU32[i/4+e]);f._OrtFree(i);const h=0===p.length?1:p.reduce((e,t)=>e*t);if(o=u(n),"string"===o){const e=[];let t=a/4;for(let n=0;n<h;n++){const r=f.HEAPU32[t++],o=n===h-1?void 0:f.HEAPU32[t]-r;e.push(f.UTF8ToString(r,o))}d.push([o,p,e])}else{const e=new(c(o))(h);new Uint8Array(e.buffer,e.byteOffset,e.byteLength).set(f.HEAPU8.subarray(a,a+e.byteLength)),d.push([o,p,e])}}finally{f.stackRestore(n),"string"===o&&a&&f._free(a),f._OrtReleaseTensor(e)}}if(0===l)return d;throw new Error(`failed to call OrtRun(). error code = ${l}.`)}finally{f.stackRestore(e)}}finally{w.forEach(f._OrtReleaseTensor),S.forEach(f._free),f._OrtReleaseRunOptions(_),v.forEach(f._free)}},t.endProfiling=e=>{const t=(0,i.getInstance)(),n=s.get(e);if(!n)throw new Error("invalid session id");const r=n[0],o=t._OrtEndProfiling(r);if(0===o)throw new Error("Can't get an profile file name");t._OrtFree(o)},t.extractTransferableBuffers=e=>{const t=[];for(const n of e){const e=n[2];!Array.isArray(e)&&e.buffer&&t.push(e.buffer)}return t}},6361:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.dispose=t.getInstance=t.initializeWebAssembly=void 0;const s=a(n(6449)),l=i(n(932)),u=n(3474);let c,d=!1,f=!1,p=!1;const h=(e,t)=>t?e?"ort-wasm-simd-threaded.wasm":"ort-wasm-threaded.wasm":e?"ort-wasm-simd.wasm":"ort-wasm.wasm";t.initializeWebAssembly=async e=>{if(d)return Promise.resolve();if(f)throw new Error("multiple calls to 'initializeWebAssembly()' detected.");if(p)throw new Error("previous call to 'initializeWebAssembly()' failed.");f=!0;const t=e.initTimeout,r=e.numThreads,o=e.simd,a=r>1&&(()=>{try{return"undefined"!=typeof SharedArrayBuffer&&("undefined"!=typeof MessageChannel&&(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}})(),i=o&&(()=>{try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,30,1,28,0,65,0,253,15,253,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,253,186,1,26,11]))}catch(e){return!1}})(),m="string"==typeof e.wasmPaths?e.wasmPaths:void 0,g=h(!1,a),b=h(i,a),y="object"==typeof e.wasmPaths?e.wasmPaths[b]:void 0;let _=!1;const v=[];if(t>0&&v.push(new Promise(e=>{setTimeout(()=>{_=!0,e()},t)})),v.push(new Promise((e,t)=>{const r=a?u:l.default,o={locateFile:(e,t)=>a&&e.endsWith(".worker.js")&&"undefined"!=typeof Blob?URL.createObjectURL(new Blob([n(4154)],{type:"text/javascript"})):e===g?null!=y?y:(null!=m?m:t)+b:t+e};if(a)if("undefined"==typeof Blob)o.mainScriptUrlOrBlob=s.join("/","ort-wasm-threaded.js");else{const e=`var ortWasmThreaded=(function(){var _scriptDir;return ${r.toString()}})();`;o.mainScriptUrlOrBlob=new Blob([e],{type:"text/javascript"})}r(o).then(t=>{f=!1,d=!0,c=t,e()},e=>{f=!1,p=!0,t(e)})})),await Promise.race(v),_)throw new Error(`WebAssembly backend initializing failed due to timeout: ${t}ms`)},t.getInstance=()=>{if(d&&c)return c;throw new Error("WebAssembly is not initialized yet.")},t.dispose=()=>{var e;!d||f||p||(f=!0,null===(e=c.PThread)||void 0===e||e.terminateAllThreads(),c=void 0,f=!1,d=!1,p=!0)}},9710:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(477),o=n.n(r);function a(){return o()('/*!\n* ONNX Runtime Web v1.14.0\n* Copyright (c) Microsoft Corporation. All rights reserved.\n* Licensed under the MIT License.\n*/\n(()=>{var t={474:(t,e,n)=>{var _scriptDir,r=(_scriptDir=(_scriptDir="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(t){function e(){return j.buffer!=D&&N(j.buffer),P}function r(){return j.buffer!=D&&N(j.buffer),U}function a(){return j.buffer!=D&&N(j.buffer),F}function i(){return j.buffer!=D&&N(j.buffer),I}function o(){return j.buffer!=D&&N(j.buffer),W}var u,c,s;t=t||{},u||(u=void 0!==t?t:{}),u.ready=new Promise((function(t,e){c=t,s=e}));var l,f,p,h,d,y,b=Object.assign({},u),m="./this.program",g=(t,e)=>{throw e},v="object"==typeof window,w="function"==typeof importScripts,_="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,O=u.ENVIRONMENT_IS_PTHREAD||!1,A="";function S(t){return u.locateFile?u.locateFile(t,A):A+t}if(_){let e;A=w?n(908).dirname(A)+"/":"//",y=()=>{d||(h=n(384),d=n(908))},l=function(t,e){return y(),t=d.normalize(t),h.readFileSync(t,e?void 0:"utf8")},p=t=>((t=l(t,!0)).buffer||(t=new Uint8Array(t)),t),f=(t,e,n)=>{y(),t=d.normalize(t),h.readFile(t,(function(t,r){t?n(t):e(r.buffer)}))},1<process.argv.length&&(m=process.argv[1].replace(/\\\\/g,"/")),process.argv.slice(2),process.on("uncaughtException",(function(t){if(!(t instanceof ct))throw t})),process.on("unhandledRejection",(function(t){throw t})),g=(t,e)=>{if(Q())throw process.exitCode=t,e;e instanceof ct||x("exiting due to exception: "+e),process.exit(t)},u.inspect=function(){return"[Emscripten Module object]"};try{e=n(925)}catch(t){throw console.error(\'The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?\'),t}n.g.Worker=e.Worker}else(v||w)&&(w?A=self.location.href:"undefined"!=typeof document&&document.currentScript&&(A=document.currentScript.src),_scriptDir&&(A=_scriptDir),A=0!==A.indexOf("blob:")?A.substr(0,A.replace(/[?#].*/,"").lastIndexOf("/")+1):"",_||(l=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},w&&(p=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),f=(t,e,n)=>{var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?e(r.response):n()},r.onerror=n,r.send(null)}));_&&"undefined"==typeof performance&&(n.g.performance=n(953).performance);var T=console.log.bind(console),E=console.warn.bind(console);_&&(y(),T=t=>h.writeSync(1,t+"\\n"),E=t=>h.writeSync(2,t+"\\n"));var M,C=u.print||T,x=u.printErr||E;Object.assign(u,b),b=null,u.thisProgram&&(m=u.thisProgram),u.quit&&(g=u.quit),u.wasmBinary&&(M=u.wasmBinary);var R=u.noExitRuntime||!1;"object"!=typeof WebAssembly&&at("no native wasm support detected");var j,k,D,P,U,F,I,W,H=!1,L="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function z(t,e,n){var r=(e>>>=0)+n;for(n=e;t[n]&&!(n>=r);)++n;if(16<n-e&&t.buffer&&L)return L.decode(t.buffer instanceof SharedArrayBuffer?t.slice(e,n):t.subarray(e,n));for(r="";e<n;){var a=t[e++];if(128&a){var i=63&t[e++];if(192==(224&a))r+=String.fromCharCode((31&a)<<6|i);else{var o=63&t[e++];65536>(a=224==(240&a)?(15&a)<<12|i<<6|o:(7&a)<<18|i<<12|o<<6|63&t[e++])?r+=String.fromCharCode(a):(a-=65536,r+=String.fromCharCode(55296|a>>10,56320|1023&a))}}else r+=String.fromCharCode(a)}return r}function Y(t,e){return(t>>>=0)?z(r(),t,e):""}function B(t,e,n,r){if(!(0<r))return 0;var a=n>>>=0;r=n+r-1;for(var i=0;i<t.length;++i){var o=t.charCodeAt(i);if(55296<=o&&57343>=o&&(o=65536+((1023&o)<<10)|1023&t.charCodeAt(++i)),127>=o){if(n>=r)break;e[n++>>>0]=o}else{if(2047>=o){if(n+1>=r)break;e[n++>>>0]=192|o>>6}else{if(65535>=o){if(n+2>=r)break;e[n++>>>0]=224|o>>12}else{if(n+3>=r)break;e[n++>>>0]=240|o>>18,e[n++>>>0]=128|o>>12&63}e[n++>>>0]=128|o>>6&63}e[n++>>>0]=128|63&o}}return e[n>>>0]=0,n-a}function G(t){for(var e=0,n=0;n<t.length;++n){var r=t.charCodeAt(n);127>=r?e++:2047>=r?e+=2:55296<=r&&57343>=r?(e+=4,++n):e+=3}return e}function N(t){D=t,u.HEAP8=P=new Int8Array(t),u.HEAP16=new Int16Array(t),u.HEAP32=F=new Int32Array(t),u.HEAPU8=U=new Uint8Array(t),u.HEAPU16=new Uint16Array(t),u.HEAPU32=I=new Uint32Array(t),u.HEAPF32=new Float32Array(t),u.HEAPF64=W=new Float64Array(t)}O&&(D=u.buffer);var V=u.INITIAL_MEMORY||16777216;if(O)j=u.wasmMemory,D=u.buffer;else if(u.wasmMemory)j=u.wasmMemory;else if(!((j=new WebAssembly.Memory({initial:V/65536,maximum:65536,shared:!0})).buffer instanceof SharedArrayBuffer))throw x("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag"),_&&console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)"),Error("bad memory");j&&(D=j.buffer),V=D.byteLength,N(D);var $,q=[],X=[],J=[],Z=[];function Q(){return R||!1}function K(){var t=u.preRun.shift();q.unshift(t)}var tt,et=0,nt=null,rt=null;function at(t){throw O?postMessage({cmd:"onAbort",arg:t}):u.onAbort&&u.onAbort(t),x(t="Aborted("+t+")"),H=!0,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),s(t),t}function it(){return tt.startsWith("data:application/octet-stream;base64,")}function ot(){var t=tt;try{if(t==tt&&M)return new Uint8Array(M);if(p)return p(t);throw"both async and sync fetching of the wasm failed"}catch(t){at(t)}}tt="ort-wasm-threaded.wasm",it()||(tt=S(tt));var ut={};function ct(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function st(t){(t=ht.Vb[t])||at(),ht.mc(t)}function lt(t){var e=ht.Cc();if(!e)return 6;ht.ac.push(e),ht.Vb[t.Ub]=e,e.Ub=t.Ub;var n={cmd:"run",start_routine:t.Ic,arg:t.zc,pthread_ptr:t.Ub};return e.$b=()=>{n.time=performance.now(),e.postMessage(n,t.Nc)},e.loaded&&(e.$b(),delete e.$b),0}function ft(t){if(O)return $t(1,1,t);Q()||(ht.oc(),u.onExit&&u.onExit(t),H=!0),g(t,new ct(t))}function pt(t,e){if(!e&&O)throw bt(t),"unwind";Q()||O||(me(),dt(J),be(0),re[1].length&&ae(1,10),re[2].length&&ae(2,10),ht.oc()),ft(t)}var ht={Yb:[],ac:[],qc:[],Vb:{},fc:function(){O&&ht.Ec()},Pc:function(){},Ec:function(){ht.receiveObjectTransfer=ht.Gc,ht.threadInitTLS=ht.pc,ht.setExitStatus=ht.nc,R=!1},nc:function(){},oc:function(){for(var t of Object.values(ht.Vb))ht.mc(t);for(t of ht.Yb)t.terminate();ht.Yb=[]},mc:function(t){var e=t.Ub;delete ht.Vb[e],ht.Yb.push(t),ht.ac.splice(ht.ac.indexOf(t),1),t.Ub=0,Oe(e)},Gc:function(){},pc:function(){ht.qc.forEach((t=>t()))},Fc:function(t,e){t.onmessage=n=>{var r=(n=n.data).cmd;if(t.Ub&&(ht.Bc=t.Ub),n.targetThread&&n.targetThread!=he()){var a=ht.Vb[n.Qc];a?a.postMessage(n,n.transferList):x(\'Internal error! Worker sent a message "\'+r+\'" to target pthread \'+n.targetThread+", but that thread no longer exists!")}else"processProxyingQueue"===r?zt(n.queue):"spawnThread"===r?lt(n):"cleanupThread"===r?st(n.thread):"killThread"===r?(n=n.thread,r=ht.Vb[n],delete ht.Vb[n],r.terminate(),Oe(n),ht.ac.splice(ht.ac.indexOf(r),1),r.Ub=0):"cancelThread"===r?ht.Vb[n.thread].postMessage({cmd:"cancel"}):"loaded"===r?(t.loaded=!0,e&&e(t),t.$b&&(t.$b(),delete t.$b)):"print"===r?C("Thread "+n.threadId+": "+n.text):"printErr"===r?x("Thread "+n.threadId+": "+n.text):"alert"===r?alert("Thread "+n.threadId+": "+n.text):"setimmediate"===n.target?t.postMessage(n):"onAbort"===r?u.onAbort&&u.onAbort(n.arg):r&&x("worker sent an unknown command "+r);ht.Bc=void 0},t.onerror=t=>{throw x("worker sent an error! "+t.filename+":"+t.lineno+": "+t.message),t},_&&(t.on("message",(function(e){t.onmessage({data:e})})),t.on("error",(function(e){t.onerror(e)})),t.on("detachedExit",(function(){}))),t.postMessage({cmd:"load",urlOrBlob:u.mainScriptUrlOrBlob||_scriptDir,wasmMemory:j,wasmModule:k})},yc:function(){var t=S("ort-wasm-threaded.worker.js");ht.Yb.push(new Worker(t))},Cc:function(){return 0==ht.Yb.length&&(ht.yc(),ht.Fc(ht.Yb[0])),ht.Yb.pop()}};function dt(t){for(;0<t.length;)t.shift()(u)}function yt(t){var e=Ee();return t=t(),Me(e),t}function bt(t){if(O)return $t(2,0,t);try{pt(t)}catch(t){t instanceof ct||"unwind"==t||g(1,t)}}u.PThread=ht,u.establishStackSpace=function(){var t=he(),e=a()[t+44>>2>>>0];t=a()[t+48>>2>>>0],Te(e,e-t),Me(e)};var mt=[];function gt(t){var e=mt[t];return e||(t>=mt.length&&(mt.length=t+1),mt[t]=e=$.get(t)),e}u.invokeEntryPoint=function(t,e){t=gt(t)(e),Q()?ht.nc(t):Ae(t)};var vt,wt,_t=[],Ot=0,At=0;function St(t){this.Zb=t,this.Sb=t-24,this.xc=function(t){i()[this.Sb+4>>2>>>0]=t},this.bc=function(){return i()[this.Sb+4>>2>>>0]},this.wc=function(t){i()[this.Sb+8>>2>>>0]=t},this.Dc=function(){return i()[this.Sb+8>>2>>>0]},this.rc=function(){a()[this.Sb>>2>>>0]=0},this.hc=function(t){t=t?1:0,e()[this.Sb+12>>0>>>0]=t},this.uc=function(){return 0!=e()[this.Sb+12>>0>>>0]},this.ic=function(t){t=t?1:0,e()[this.Sb+13>>0>>>0]=t},this.kc=function(){return 0!=e()[this.Sb+13>>0>>>0]},this.fc=function(t,e){this.cc(0),this.xc(t),this.wc(e),this.rc(),this.hc(!1),this.ic(!1)},this.sc=function(){Atomics.add(a(),this.Sb>>2,1)},this.Hc=function(){return 1===Atomics.sub(a(),this.Sb>>2,1)},this.cc=function(t){i()[this.Sb+16>>2>>>0]=t},this.tc=function(){return i()[this.Sb+16>>2>>>0]},this.vc=function(){if(Re(this.bc()))return i()[this.Zb>>2>>>0];var t=this.tc();return 0!==t?t:this.Zb}}function Tt(t){return ye(new St(t).Sb)}function Et(t,e,n,r){return O?$t(3,1,t,e,n,r):Mt(t,e,n,r)}function Mt(t,e,n,r){if("undefined"==typeof SharedArrayBuffer)return x("Current environment does not support SharedArrayBuffer, pthreads are not available!"),6;var a=[];return O&&0===a.length?Et(t,e,n,r):(t={Ic:n,Ub:t,zc:r,Nc:a},O?(t.Oc="spawnThread",postMessage(t,a),0):lt(t))}function Ct(t,e,n){return O?$t(4,1,t,e,n):0}function xt(t,e){if(O)return $t(5,1,t,e)}function Rt(t,e){if(O)return $t(6,1,t,e)}function jt(t,e,n){if(O)return $t(7,1,t,e,n)}function kt(t,e,n){return O?$t(8,1,t,e,n):0}function Dt(t,e){if(O)return $t(9,1,t,e)}function Pt(t,e,n){if(O)return $t(10,1,t,e,n)}function Ut(t,e,n,r){if(O)return $t(11,1,t,e,n,r)}function Ft(t,e,n,r){if(O)return $t(12,1,t,e,n,r)}function It(t,e,n,r){if(O)return $t(13,1,t,e,n,r)}function Wt(t){if(O)return $t(14,1,t)}function Ht(t,e){if(O)return $t(15,1,t,e)}function Lt(t,e,n){if(O)return $t(16,1,t,e,n)}function zt(t){Atomics.store(a(),t>>2,1),he()&&_e(t),Atomics.compareExchange(a(),t>>2,1,0)}function Yt(t){return i()[t>>>2]+4294967296*a()[t+4>>>2]}function Bt(t,e,n,r,a,i){return O?$t(17,1,t,e,n,r,a,i):-52}function Gt(t,e,n,r,a,i){if(O)return $t(18,1,t,e,n,r,a,i)}function Nt(t){var n=G(t)+1,r=de(n);return r&&B(t,e(),r,n),r}function Vt(t,e,n){function r(t){return(t=t.toTimeString().match(/\\(([A-Za-z ]+)\\)$/))?t[1]:"GMT"}if(O)return $t(19,1,t,e,n);var o=(new Date).getFullYear(),u=new Date(o,0,1),c=new Date(o,6,1);o=u.getTimezoneOffset();var s=c.getTimezoneOffset(),l=Math.max(o,s);a()[t>>2>>>0]=60*l,a()[e>>2>>>0]=Number(o!=s),t=r(u),e=r(c),t=Nt(t),e=Nt(e),s<o?(i()[n>>2>>>0]=t,i()[n+4>>2>>>0]=e):(i()[n>>2>>>0]=e,i()[n+4>>2>>>0]=t)}function $t(t,e){var n=arguments.length-2,r=arguments;return yt((()=>{for(var a=Ce(8*n),i=a>>3,u=0;u<n;u++){var c=r[2+u];o()[i+u>>>0]=c}return we(t,n,a,e)}))}u.executeNotifiedProxyingQueue=zt,wt=_?()=>{var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:O?()=>performance.now()-u.__performance_now_clock_drift:()=>performance.now();var qt,Xt=[],Jt={};function Zt(){if(!qt){var t,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",_:m||"./this.program"};for(t in Jt)void 0===Jt[t]?delete e[t]:e[t]=Jt[t];var n=[];for(t in e)n.push(t+"="+e[t]);qt=n}return qt}function Qt(t,n){if(O)return $t(20,1,t,n);var r=0;return Zt().forEach((function(a,o){var u=n+r;for(o=i()[t+4*o>>2>>>0]=u,u=0;u<a.length;++u)e()[o++>>0>>>0]=a.charCodeAt(u);e()[o>>0>>>0]=0,r+=a.length+1})),0}function Kt(t,e){if(O)return $t(21,1,t,e);var n=Zt();i()[t>>2>>>0]=n.length;var r=0;return n.forEach((function(t){r+=t.length+1})),i()[e>>2>>>0]=r,0}function te(t){return O?$t(22,1,t):52}function ee(t,e,n,r){return O?$t(23,1,t,e,n,r):52}function ne(t,e,n,r,a){return O?$t(24,1,t,e,n,r,a):70}var re=[null,[],[]];function ae(t,e){var n=re[t];0===e||10===e?((1===t?C:x)(z(n,0)),n.length=0):n.push(e)}function ie(t,e,n,a){if(O)return $t(25,1,t,e,n,a);for(var o=0,u=0;u<n;u++){var c=i()[e>>2>>>0],s=i()[e+4>>2>>>0];e+=8;for(var l=0;l<s;l++)ae(t,r()[c+l>>>0]);o+=s}return i()[a>>2>>>0]=o,0}var oe=0;function ue(t){return 0==t%4&&(0!=t%100||0==t%400)}var ce=[31,29,31,30,31,30,31,31,30,31,30,31],se=[31,28,31,30,31,30,31,31,30,31,30,31];function le(t,n,r,i){function o(t,e,n){for(t="number"==typeof t?t.toString():t||"";t.length<e;)t=n[0]+t;return t}function u(t,e){return o(t,e,"0")}function c(t,e){function n(t){return 0>t?-1:0<t?1:0}var r;return 0===(r=n(t.getFullYear()-e.getFullYear()))&&0===(r=n(t.getMonth()-e.getMonth()))&&(r=n(t.getDate()-e.getDate())),r}function s(t){switch(t.getDay()){case 0:return new Date(t.getFullYear()-1,11,29);case 1:return t;case 2:return new Date(t.getFullYear(),0,3);case 3:return new Date(t.getFullYear(),0,2);case 4:return new Date(t.getFullYear(),0,1);case 5:return new Date(t.getFullYear()-1,11,31);case 6:return new Date(t.getFullYear()-1,11,30)}}function l(t){var e=t.Wb;for(t=new Date(new Date(t.Xb+1900,0,1).getTime());0<e;){var n=t.getMonth(),r=(ue(t.getFullYear())?ce:se)[n];if(!(e>r-t.getDate())){t.setDate(t.getDate()+e);break}e-=r-t.getDate()+1,t.setDate(1),11>n?t.setMonth(n+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return n=new Date(t.getFullYear()+1,0,4),e=s(new Date(t.getFullYear(),0,4)),n=s(n),0>=c(e,t)?0>=c(n,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var f=a()[i+40>>2>>>0];for(var p in i={Lc:a()[i>>2>>>0],Kc:a()[i+4>>2>>>0],dc:a()[i+8>>2>>>0],jc:a()[i+12>>2>>>0],ec:a()[i+16>>2>>>0],Xb:a()[i+20>>2>>>0],Tb:a()[i+24>>2>>>0],Wb:a()[i+28>>2>>>0],Rc:a()[i+32>>2>>>0],Jc:a()[i+36>>2>>>0],Mc:f?Y(f):""},r=Y(r),f={"%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"})r=r.replace(new RegExp(p,"g"),f[p]);var h="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),d="January February March April May June July August September October November December".split(" ");for(p in f={"%a":function(t){return h[t.Tb].substring(0,3)},"%A":function(t){return h[t.Tb]},"%b":function(t){return d[t.ec].substring(0,3)},"%B":function(t){return d[t.ec]},"%C":function(t){return u((t.Xb+1900)/100|0,2)},"%d":function(t){return u(t.jc,2)},"%e":function(t){return o(t.jc,2," ")},"%g":function(t){return l(t).toString().substring(2)},"%G":function(t){return l(t)},"%H":function(t){return u(t.dc,2)},"%I":function(t){return 0==(t=t.dc)?t=12:12<t&&(t-=12),u(t,2)},"%j":function(t){for(var e=0,n=0;n<=t.ec-1;e+=(ue(t.Xb+1900)?ce:se)[n++]);return u(t.jc+e,3)},"%m":function(t){return u(t.ec+1,2)},"%M":function(t){return u(t.Kc,2)},"%n":function(){return"\\n"},"%p":function(t){return 0<=t.dc&&12>t.dc?"AM":"PM"},"%S":function(t){return u(t.Lc,2)},"%t":function(){return"\\t"},"%u":function(t){return t.Tb||7},"%U":function(t){return u(Math.floor((t.Wb+7-t.Tb)/7),2)},"%V":function(t){var e=Math.floor((t.Wb+7-(t.Tb+6)%7)/7);if(2>=(t.Tb+371-t.Wb-2)%7&&e++,e)53==e&&(4==(n=(t.Tb+371-t.Wb)%7)||3==n&&ue(t.Xb)||(e=1));else{e=52;var n=(t.Tb+7-t.Wb-1)%7;(4==n||5==n&&ue(t.Xb%400-1))&&e++}return u(e,2)},"%w":function(t){return t.Tb},"%W":function(t){return u(Math.floor((t.Wb+7-(t.Tb+6)%7)/7),2)},"%y":function(t){return(t.Xb+1900).toString().substring(2)},"%Y":function(t){return t.Xb+1900},"%z":function(t){var e=0<=(t=t.Jc);return t=Math.abs(t)/60,(e?"+":"-")+String("0000"+(t/60*100+t%60)).slice(-4)},"%Z":function(t){return t.Mc},"%%":function(){return"%"}},r=r.replace(/%%/g,"\\0\\0"),f)r.includes(p)&&(r=r.replace(new RegExp(p,"g"),f[p](i)));return p=function(t){var e=Array(G(t)+1);return B(t,e,0,e.length),e}(r=r.replace(/\\0\\0/g,"%")),p.length>n?0:(function(t,n){e().set(t,n>>>0)}(p,t),p.length-1)}ht.fc();var fe=[null,ft,bt,Et,Ct,xt,Rt,jt,kt,Dt,Pt,Ut,Ft,It,Wt,Ht,Lt,Bt,Gt,Vt,Qt,Kt,te,ee,ne,ie],pe={b:function(t){return de(t+24)+24},n:function(t){return(t=new St(t)).uc()||(t.hc(!0),Ot--),t.ic(!1),_t.push(t),t.sc(),t.vc()},ma:function(t){throw x("Unexpected exception thrown, this is not properly supported - aborting"),H=!0,t},x:function(){Se(0);var t=_t.pop();if(t.Hc()&&!t.kc()){var e=t.Dc();e&&gt(e)(t.Zb),Tt(t.Zb)}At=0},e:function(){var t=At;if(!t)return oe=0;var e=new St(t);e.cc(t);var n=e.bc();if(!n)return oe=0,t;for(var r=Array.prototype.slice.call(arguments),a=0;a<r.length;a++){var i=r[a];if(0===i||i===n)break;if(xe(i,n,e.Sb+16))return oe=i,t}return oe=n,t},l:function(){var t=At;if(!t)return oe=0;var e=new St(t);e.cc(t);var n=e.bc();if(!n)return oe=0,t;for(var r=Array.prototype.slice.call(arguments),a=0;a<r.length;a++){var i=r[a];if(0===i||i===n)break;if(xe(i,n,e.Sb+16))return oe=i,t}return oe=n,t},h:function(){var t=At;if(!t)return oe=0;var e=new St(t);e.cc(t);var n=e.bc();if(!n)return oe=0,t;for(var r=Array.prototype.slice.call(arguments),a=0;a<r.length;a++){var i=r[a];if(0===i||i===n)break;if(xe(i,n,e.Sb+16))return oe=i,t}return oe=n,t},t:Tt,M:function(){var t=_t.pop();t||at("no exception to throw");var e=t.Zb;throw t.kc()||(_t.push(t),t.ic(!0),t.hc(!1),Ot++),At=e,e},c:function(t,e,n){throw new St(t).fc(e,n),At=t,Ot++,t},pa:function(){return Ot},Fa:function(t){ge(t,!w,1,!v),ht.pc()},T:function(t){O?postMessage({cmd:"cleanupThread",thread:t}):st(t)},xa:Mt,j:function(t){throw At||(At=t),t},H:Ct,Ma:xt,ua:Rt,wa:jt,oa:kt,Ka:Dt,Ca:Pt,Ja:Ut,V:Ft,va:It,sa:Wt,La:Ht,ta:Lt,Ta:function(){},X:function(){at("To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking")},Ua:function(){at("To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking")},W:function(){return Date.now()},ya:function(){return 2097152},Oa:function(){return!0},za:function(t,e,n,r){if(t==e)setTimeout((()=>zt(r)));else if(O)postMessage({targetThread:t,cmd:"processProxyingQueue",queue:r});else{if(!(t=ht.Vb[t]))return;t.postMessage({cmd:"processProxyingQueue",queue:r})}return 1},Ea:function(){return-1},Pa:function(t,e){t=new Date(1e3*Yt(t)),a()[e>>2>>>0]=t.getUTCSeconds(),a()[e+4>>2>>>0]=t.getUTCMinutes(),a()[e+8>>2>>>0]=t.getUTCHours(),a()[e+12>>2>>>0]=t.getUTCDate(),a()[e+16>>2>>>0]=t.getUTCMonth(),a()[e+20>>2>>>0]=t.getUTCFullYear()-1900,a()[e+24>>2>>>0]=t.getUTCDay(),t=(t.getTime()-Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,a()[e+28>>2>>>0]=t},Qa:function(t,e){t=new Date(1e3*Yt(t)),a()[e>>2>>>0]=t.getSeconds(),a()[e+4>>2>>>0]=t.getMinutes(),a()[e+8>>2>>>0]=t.getHours(),a()[e+12>>2>>>0]=t.getDate(),a()[e+16>>2>>>0]=t.getMonth(),a()[e+20>>2>>>0]=t.getFullYear()-1900,a()[e+24>>2>>>0]=t.getDay();var n=new Date(t.getFullYear(),0,1),r=(t.getTime()-n.getTime())/864e5|0;a()[e+28>>2>>>0]=r,a()[e+36>>2>>>0]=-60*t.getTimezoneOffset(),r=new Date(t.getFullYear(),6,1).getTimezoneOffset(),t=0|(r!=(n=n.getTimezoneOffset())&&t.getTimezoneOffset()==Math.min(n,r)),a()[e+32>>2>>>0]=t},Ra:function(t){var e=new Date(a()[t+20>>2>>>0]+1900,a()[t+16>>2>>>0],a()[t+12>>2>>>0],a()[t+8>>2>>>0],a()[t+4>>2>>>0],a()[t>>2>>>0],0),n=a()[t+32>>2>>>0],r=e.getTimezoneOffset(),i=new Date(e.getFullYear(),0,1),o=new Date(e.getFullYear(),6,1).getTimezoneOffset(),u=i.getTimezoneOffset(),c=Math.min(u,o);return 0>n?a()[t+32>>2>>>0]=Number(o!=u&&c==r):0<n!=(c==r)&&(o=Math.max(u,o),e.setTime(e.getTime()+6e4*((0<n?c:o)-r))),a()[t+24>>2>>>0]=e.getDay(),n=(e.getTime()-i.getTime())/864e5|0,a()[t+28>>2>>>0]=n,a()[t>>2>>>0]=e.getSeconds(),a()[t+4>>2>>>0]=e.getMinutes(),a()[t+8>>2>>>0]=e.getHours(),a()[t+12>>2>>>0]=e.getDate(),a()[t+16>>2>>>0]=e.getMonth(),e.getTime()/1e3|0},Aa:Bt,Ba:Gt,Sa:function t(e,n,r){t.Ac||(t.Ac=!0,Vt(e,n,r))},y:function(){at("")},U:function(){if(!_&&!w){var t="Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread";vt||(vt={}),vt[t]||(vt[t]=1,_&&(t="warning: "+t),x(t))}},ra:function(){return 4294901760},B:wt,Ia:function(t,e,n){r().copyWithin(t>>>0,e>>>0,e+n>>>0)},F:function(){return _?n(993).cpus().length:navigator.hardwareConcurrency},Da:function(t,e,n){Xt.length=e,n>>=3;for(var r=0;r<e;r++)Xt[r]=o()[n+r>>>0];return(0>t?ut[-t-1]:fe[t]).apply(null,Xt)},qa:function(t){var e=r().length;if((t>>>=0)<=e||4294901760<t)return!1;for(var n=1;4>=n;n*=2){var a=e*(1+.2/n);a=Math.min(a,t+100663296);var i=Math;a=Math.max(t,a),i=i.min.call(i,4294901760,a+(65536-a%65536)%65536);t:{try{j.grow(i-D.byteLength+65535>>>16),N(j.buffer);var o=1;break t}catch(t){}o=void 0}if(o)return!0}return!1},Na:function(){throw"unwind"},Ga:Qt,Ha:Kt,J:pt,I:te,S:ee,ga:ne,R:ie,d:function(){return oe},na:function t(r,a){t.lc||(t.lc=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var t=new Uint8Array(1);return()=>(crypto.getRandomValues(t),t[0])}if(_)try{var e=n(Object(function(){var t=new Error("Cannot find module \'crypto\'");throw t.code="MODULE_NOT_FOUND",t}()));return()=>e.randomBytes(1)[0]}catch(t){}return()=>at("randomDevice")}());for(var i=0;i<a;i++)e()[r+i>>0>>>0]=t.lc();return 0},ia:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},ja:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},K:function(t){var e=Ee();try{return gt(t)()}catch(t){if(Me(e),t!==t+0)throw t;Se(1,0)}},f:function(t,e){var n=Ee();try{return gt(t)(e)}catch(t){if(Me(n),t!==t+0)throw t;Se(1,0)}},P:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},Q:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},k:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},p:function(t,e,n,r){var a=Ee();try{return gt(t)(e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Se(1,0)}},q:function(t,e,n,r,a){var i=Ee();try{return gt(t)(e,n,r,a)}catch(t){if(Me(i),t!==t+0)throw t;Se(1,0)}},N:function(t,e,n,r,a,i){var o=Ee();try{return gt(t)(e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Se(1,0)}},s:function(t,e,n,r,a,i){var o=Ee();try{return gt(t)(e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Se(1,0)}},w:function(t,e,n,r,a,i,o){var u=Ee();try{return gt(t)(e,n,r,a,i,o)}catch(t){if(Me(u),t!==t+0)throw t;Se(1,0)}},L:function(t,e,n,r,a,i,o,u){var c=Ee();try{return gt(t)(e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Se(1,0)}},E:function(t,e,n,r,a,i,o,u,c,s,l,f){var p=Ee();try{return gt(t)(e,n,r,a,i,o,u,c,s,l,f)}catch(t){if(Me(p),t!==t+0)throw t;Se(1,0)}},aa:function(t,e,n,r,a,i,o,u){var c=Ee();try{return He(t,e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Se(1,0)}},_:function(t,e,n,r,a,i,o){var u=Ee();try{return ke(t,e,n,r,a,i,o)}catch(t){if(Me(u),t!==t+0)throw t;Se(1,0)}},Z:function(t,e,n,r,a){var i=Ee();try{return Le(t,e,n,r,a)}catch(t){if(Me(i),t!==t+0)throw t;Se(1,0)}},ca:function(t,e,n,r){var a=Ee();try{return Ie(t,e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Se(1,0)}},$:function(t){var e=Ee();try{return je(t)}catch(t){if(Me(e),t!==t+0)throw t;Se(1,0)}},ba:function(t,e){var n=Ee();try{return We(t,e)}catch(t){if(Me(n),t!==t+0)throw t;Se(1,0)}},Y:function(t,e,n){var r=Ee();try{return De(t,e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},g:function(t){var e=Ee();try{gt(t)()}catch(t){if(Me(e),t!==t+0)throw t;Se(1,0)}},r:function(t,e){var n=Ee();try{gt(t)(e)}catch(t){if(Me(n),t!==t+0)throw t;Se(1,0)}},i:function(t,e,n){var r=Ee();try{gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},ha:function(t,e,n,r){var a=Ee();try{gt(t)(e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Se(1,0)}},m:function(t,e,n,r){var a=Ee();try{gt(t)(e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Se(1,0)}},v:function(t,e,n,r,a){var i=Ee();try{gt(t)(e,n,r,a)}catch(t){if(Me(i),t!==t+0)throw t;Se(1,0)}},u:function(t,e,n,r,a,i){var o=Ee();try{gt(t)(e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Se(1,0)}},O:function(t,e,n,r,a,i,o){var u=Ee();try{gt(t)(e,n,r,a,i,o)}catch(t){if(Me(u),t!==t+0)throw t;Se(1,0)}},A:function(t,e,n,r,a,i,o,u){var c=Ee();try{gt(t)(e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Se(1,0)}},ka:function(t,e,n,r,a,i,o,u,c){var s=Ee();try{gt(t)(e,n,r,a,i,o,u,c)}catch(t){if(Me(s),t!==t+0)throw t;Se(1,0)}},C:function(t,e,n,r,a,i,o,u,c,s,l){var f=Ee();try{gt(t)(e,n,r,a,i,o,u,c,s,l)}catch(t){if(Me(f),t!==t+0)throw t;Se(1,0)}},D:function(t,e,n,r,a,i,o,u,c,s,l,f,p,h,d,y){var b=Ee();try{gt(t)(e,n,r,a,i,o,u,c,s,l,f,p,h,d,y)}catch(t){if(Me(b),t!==t+0)throw t;Se(1,0)}},fa:function(t,e,n,r,a,i,o,u){var c=Ee();try{Pe(t,e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Se(1,0)}},da:function(t,e,n,r,a,i,o,u,c,s,l,f){var p=Ee();try{Fe(t,e,n,r,a,i,o,u,c,s,l,f)}catch(t){if(Me(p),t!==t+0)throw t;Se(1,0)}},ea:function(t,e,n,r,a,i){var o=Ee();try{Ue(t,e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Se(1,0)}},o:function(t){return t},a:j||u.wasmMemory,G:function(t){oe=t},la:le,z:function(t,e,n,r){return le(t,e,n,r)}};!function(){function t(t,e){u.asm=t.exports,ht.qc.push(u.asm.sb),$=u.asm.ub,X.unshift(u.asm.Va),k=e,O||(et--,u.monitorRunDependencies&&u.monitorRunDependencies(et),0==et&&(null!==nt&&(clearInterval(nt),nt=null),rt&&(t=rt,rt=null,t())))}function e(e){t(e.instance,e.module)}function n(t){return function(){if(!M&&(v||w)){if("function"==typeof fetch&&!tt.startsWith("file://"))return fetch(tt,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at \'"+tt+"\'";return t.arrayBuffer()})).catch((function(){return ot()}));if(f)return new Promise((function(t,e){f(tt,(function(e){t(new Uint8Array(e))}),e)}))}return Promise.resolve().then((function(){return ot()}))}().then((function(t){return WebAssembly.instantiate(t,r)})).then((function(t){return t})).then(t,(function(t){x("failed to asynchronously prepare wasm: "+t),at(t)}))}var r={a:pe};if(O||(et++,u.monitorRunDependencies&&u.monitorRunDependencies(et)),u.instantiateWasm)try{return u.instantiateWasm(r,t)}catch(t){return x("Module.instantiateWasm callback failed with error: "+t),!1}(M||"function"!=typeof WebAssembly.instantiateStreaming||it()||tt.startsWith("file://")||_||"function"!=typeof fetch?n(e):fetch(tt,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,r).then(e,(function(t){return x("wasm streaming compile failed: "+t),x("falling back to ArrayBuffer instantiation"),n(e)}))}))).catch(s)}(),u.___wasm_call_ctors=function(){return(u.___wasm_call_ctors=u.asm.Va).apply(null,arguments)},u._OrtInit=function(){return(u._OrtInit=u.asm.Wa).apply(null,arguments)},u._OrtCreateSessionOptions=function(){return(u._OrtCreateSessionOptions=u.asm.Xa).apply(null,arguments)},u._OrtAppendExecutionProvider=function(){return(u._OrtAppendExecutionProvider=u.asm.Ya).apply(null,arguments)},u._OrtAddSessionConfigEntry=function(){return(u._OrtAddSessionConfigEntry=u.asm.Za).apply(null,arguments)},u._OrtReleaseSessionOptions=function(){return(u._OrtReleaseSessionOptions=u.asm._a).apply(null,arguments)},u._OrtCreateSession=function(){return(u._OrtCreateSession=u.asm.$a).apply(null,arguments)},u._OrtReleaseSession=function(){return(u._OrtReleaseSession=u.asm.ab).apply(null,arguments)},u._OrtGetInputCount=function(){return(u._OrtGetInputCount=u.asm.bb).apply(null,arguments)},u._OrtGetOutputCount=function(){return(u._OrtGetOutputCount=u.asm.cb).apply(null,arguments)},u._OrtGetInputName=function(){return(u._OrtGetInputName=u.asm.db).apply(null,arguments)},u._OrtGetOutputName=function(){return(u._OrtGetOutputName=u.asm.eb).apply(null,arguments)},u._OrtFree=function(){return(u._OrtFree=u.asm.fb).apply(null,arguments)},u._OrtCreateTensor=function(){return(u._OrtCreateTensor=u.asm.gb).apply(null,arguments)},u._OrtGetTensorData=function(){return(u._OrtGetTensorData=u.asm.hb).apply(null,arguments)},u._OrtReleaseTensor=function(){return(u._OrtReleaseTensor=u.asm.ib).apply(null,arguments)},u._OrtCreateRunOptions=function(){return(u._OrtCreateRunOptions=u.asm.jb).apply(null,arguments)},u._OrtAddRunConfigEntry=function(){return(u._OrtAddRunConfigEntry=u.asm.kb).apply(null,arguments)},u._OrtReleaseRunOptions=function(){return(u._OrtReleaseRunOptions=u.asm.lb).apply(null,arguments)},u._OrtRun=function(){return(u._OrtRun=u.asm.mb).apply(null,arguments)},u._OrtEndProfiling=function(){return(u._OrtEndProfiling=u.asm.nb).apply(null,arguments)};var he=u._pthread_self=function(){return(he=u._pthread_self=u.asm.ob).apply(null,arguments)},de=u._malloc=function(){return(de=u._malloc=u.asm.pb).apply(null,arguments)},ye=u._free=function(){return(ye=u._free=u.asm.qb).apply(null,arguments)},be=u._fflush=function(){return(be=u._fflush=u.asm.rb).apply(null,arguments)};u.__emscripten_tls_init=function(){return(u.__emscripten_tls_init=u.asm.sb).apply(null,arguments)};var me=u.___funcs_on_exit=function(){return(me=u.___funcs_on_exit=u.asm.tb).apply(null,arguments)},ge=u.__emscripten_thread_init=function(){return(ge=u.__emscripten_thread_init=u.asm.vb).apply(null,arguments)};u.__emscripten_thread_crashed=function(){return(u.__emscripten_thread_crashed=u.asm.wb).apply(null,arguments)};var ve,we=u._emscripten_run_in_main_runtime_thread_js=function(){return(we=u._emscripten_run_in_main_runtime_thread_js=u.asm.xb).apply(null,arguments)},_e=u.__emscripten_proxy_execute_task_queue=function(){return(_e=u.__emscripten_proxy_execute_task_queue=u.asm.yb).apply(null,arguments)},Oe=u.__emscripten_thread_free_data=function(){return(Oe=u.__emscripten_thread_free_data=u.asm.zb).apply(null,arguments)},Ae=u.__emscripten_thread_exit=function(){return(Ae=u.__emscripten_thread_exit=u.asm.Ab).apply(null,arguments)},Se=u._setThrew=function(){return(Se=u._setThrew=u.asm.Bb).apply(null,arguments)},Te=u._emscripten_stack_set_limits=function(){return(Te=u._emscripten_stack_set_limits=u.asm.Cb).apply(null,arguments)},Ee=u.stackSave=function(){return(Ee=u.stackSave=u.asm.Db).apply(null,arguments)},Me=u.stackRestore=function(){return(Me=u.stackRestore=u.asm.Eb).apply(null,arguments)},Ce=u.stackAlloc=function(){return(Ce=u.stackAlloc=u.asm.Fb).apply(null,arguments)},xe=u.___cxa_can_catch=function(){return(xe=u.___cxa_can_catch=u.asm.Gb).apply(null,arguments)},Re=u.___cxa_is_pointer_type=function(){return(Re=u.___cxa_is_pointer_type=u.asm.Hb).apply(null,arguments)},je=u.dynCall_j=function(){return(je=u.dynCall_j=u.asm.Ib).apply(null,arguments)},ke=u.dynCall_iiiiij=function(){return(ke=u.dynCall_iiiiij=u.asm.Jb).apply(null,arguments)},De=u.dynCall_jii=function(){return(De=u.dynCall_jii=u.asm.Kb).apply(null,arguments)},Pe=u.dynCall_viiiiij=function(){return(Pe=u.dynCall_viiiiij=u.asm.Lb).apply(null,arguments)},Ue=u.dynCall_vjji=function(){return(Ue=u.dynCall_vjji=u.asm.Mb).apply(null,arguments)},Fe=u.dynCall_viiijjjii=function(){return(Fe=u.dynCall_viiijjjii=u.asm.Nb).apply(null,arguments)},Ie=u.dynCall_iij=function(){return(Ie=u.dynCall_iij=u.asm.Ob).apply(null,arguments)},We=u.dynCall_ji=function(){return(We=u.dynCall_ji=u.asm.Pb).apply(null,arguments)},He=u.dynCall_iiiiiij=function(){return(He=u.dynCall_iiiiiij=u.asm.Qb).apply(null,arguments)},Le=u.dynCall_iiij=function(){return(Le=u.dynCall_iiij=u.asm.Rb).apply(null,arguments)};function ze(){function t(){if(!ve&&(ve=!0,u.calledRun=!0,!H)&&(O||dt(X),c(u),u.onRuntimeInitialized&&u.onRuntimeInitialized(),!O)){if(u.postRun)for("function"==typeof u.postRun&&(u.postRun=[u.postRun]);u.postRun.length;){var t=u.postRun.shift();Z.unshift(t)}dt(Z)}}if(!(0<et))if(O)c(u),O||dt(X),postMessage({cmd:"loaded"});else{if(u.preRun)for("function"==typeof u.preRun&&(u.preRun=[u.preRun]);u.preRun.length;)K();dt(q),0<et||(u.setStatus?(u.setStatus("Running..."),setTimeout((function(){setTimeout((function(){u.setStatus("")}),1),t()}),1)):t())}}if(u.UTF8ToString=Y,u.stringToUTF8=function(t,e,n){return B(t,r(),e,n)},u.lengthBytesUTF8=G,u.keepRuntimeAlive=Q,u.wasmMemory=j,u.stackSave=Ee,u.stackRestore=Me,u.stackAlloc=Ce,u.ExitStatus=ct,u.PThread=ht,rt=function t(){ve||ze(),ve||(rt=t)},u.preInit)for("function"==typeof u.preInit&&(u.preInit=[u.preInit]);0<u.preInit.length;)u.preInit.pop()();return ze(),t.ready});t.exports=r},932:(t,e,n)=>{var _scriptDir,r=(_scriptDir=(_scriptDir="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(t){var e,r,a;t=t||{},e||(e=void 0!==t?t:{}),e.ready=new Promise((function(t,e){r=t,a=e}));var i,o,u,c,s,l,f=Object.assign({},e),p="./this.program",h=(t,e)=>{throw e},d="object"==typeof window,y="function"==typeof importScripts,b="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,m="";b?(m=y?n(908).dirname(m)+"/":"//",l=()=>{s||(c=n(384),s=n(908))},i=function(t,e){return l(),t=s.normalize(t),c.readFileSync(t,e?void 0:"utf8")},u=t=>((t=i(t,!0)).buffer||(t=new Uint8Array(t)),t),o=(t,e,n)=>{l(),t=s.normalize(t),c.readFile(t,(function(t,r){t?n(t):e(r.buffer)}))},1<process.argv.length&&(p=process.argv[1].replace(/\\\\/g,"/")),process.argv.slice(2),process.on("uncaughtException",(function(t){if(!(t instanceof J))throw t})),process.on("unhandledRejection",(function(t){throw t})),h=(t,e)=>{if(_||0<L)throw process.exitCode=t,e;e instanceof J||w("exiting due to exception: "+e),process.exit(t)},e.inspect=function(){return"[Emscripten Module object]"}):(d||y)&&(y?m=self.location.href:"undefined"!=typeof document&&document.currentScript&&(m=document.currentScript.src),_scriptDir&&(m=_scriptDir),m=0!==m.indexOf("blob:")?m.substr(0,m.replace(/[?#].*/,"").lastIndexOf("/")+1):"",i=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},y&&(u=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),o=(t,e,n)=>{var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?e(r.response):n()},r.onerror=n,r.send(null)});var g,v=e.print||console.log.bind(console),w=e.printErr||console.warn.bind(console);Object.assign(e,f),f=null,e.thisProgram&&(p=e.thisProgram),e.quit&&(h=e.quit),e.wasmBinary&&(g=e.wasmBinary);var _=e.noExitRuntime||!1;"object"!=typeof WebAssembly&&V("no native wasm support detected");var O,A,S,T,E,M,C=!1,x="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function R(t,e,n){var r=(e>>>=0)+n;for(n=e;t[n]&&!(n>=r);)++n;if(16<n-e&&t.buffer&&x)return x.decode(t.subarray(e,n));for(r="";e<n;){var a=t[e++];if(128&a){var i=63&t[e++];if(192==(224&a))r+=String.fromCharCode((31&a)<<6|i);else{var o=63&t[e++];65536>(a=224==(240&a)?(15&a)<<12|i<<6|o:(7&a)<<18|i<<12|o<<6|63&t[e++])?r+=String.fromCharCode(a):(a-=65536,r+=String.fromCharCode(55296|a>>10,56320|1023&a))}}else r+=String.fromCharCode(a)}return r}function j(t,e){return(t>>>=0)?R(T,t,e):""}function k(t,e,n,r){if(!(0<r))return 0;var a=n>>>=0;r=n+r-1;for(var i=0;i<t.length;++i){var o=t.charCodeAt(i);if(55296<=o&&57343>=o&&(o=65536+((1023&o)<<10)|1023&t.charCodeAt(++i)),127>=o){if(n>=r)break;e[n++>>>0]=o}else{if(2047>=o){if(n+1>=r)break;e[n++>>>0]=192|o>>6}else{if(65535>=o){if(n+2>=r)break;e[n++>>>0]=224|o>>12}else{if(n+3>=r)break;e[n++>>>0]=240|o>>18,e[n++>>>0]=128|o>>12&63}e[n++>>>0]=128|o>>6&63}e[n++>>>0]=128|63&o}}return e[n>>>0]=0,n-a}function D(t){for(var e=0,n=0;n<t.length;++n){var r=t.charCodeAt(n);127>=r?e++:2047>=r?e+=2:55296<=r&&57343>=r?(e+=4,++n):e+=3}return e}function P(){var t=O.buffer;A=t,e.HEAP8=S=new Int8Array(t),e.HEAP16=new Int16Array(t),e.HEAP32=E=new Int32Array(t),e.HEAPU8=T=new Uint8Array(t),e.HEAPU16=new Uint16Array(t),e.HEAPU32=M=new Uint32Array(t),e.HEAPF32=new Float32Array(t),e.HEAPF64=new Float64Array(t)}var U,F=[],I=[],W=[],H=[],L=0;function z(){var t=e.preRun.shift();F.unshift(t)}var Y,B=0,G=null,N=null;function V(t){throw e.onAbort&&e.onAbort(t),w(t="Aborted("+t+")"),C=!0,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),a(t),t}function $(){return Y.startsWith("data:application/octet-stream;base64,")}if(Y="ort-wasm.wasm",!$()){var q=Y;Y=e.locateFile?e.locateFile(q,m):m+q}function X(){var t=Y;try{if(t==Y&&g)return new Uint8Array(g);if(u)return u(t);throw"both async and sync fetching of the wasm failed"}catch(t){V(t)}}function J(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function Z(t){for(;0<t.length;)t.shift()(e)}var Q=[],K=0,tt=0;function et(t){this.Db=t,this.zb=t-24,this.Ub=function(t){M[this.zb+4>>2>>>0]=t},this.Eb=function(){return M[this.zb+4>>2>>>0]},this.Sb=function(t){M[this.zb+8>>2>>>0]=t},this.Wb=function(){return M[this.zb+8>>2>>>0]},this.Tb=function(){E[this.zb>>2>>>0]=0},this.Ib=function(t){S[this.zb+12>>0>>>0]=t?1:0},this.Pb=function(){return 0!=S[this.zb+12>>0>>>0]},this.Jb=function(t){S[this.zb+13>>0>>>0]=t?1:0},this.Lb=function(){return 0!=S[this.zb+13>>0>>>0]},this.Rb=function(t,e){this.Fb(0),this.Ub(t),this.Sb(e),this.Tb(),this.Ib(!1),this.Jb(!1)},this.Nb=function(){E[this.zb>>2>>>0]+=1},this.Xb=function(){var t=E[this.zb>>2>>>0];return E[this.zb>>2>>>0]=t-1,1===t},this.Fb=function(t){M[this.zb+16>>2>>>0]=t},this.Ob=function(){return M[this.zb+16>>2>>>0]},this.Qb=function(){if(Mt(this.Eb()))return M[this.Db>>2>>>0];var t=this.Ob();return 0!==t?t:this.Db}}function nt(t){return vt(new et(t).zb)}var rt=[];function at(t){var e=rt[t];return e||(t>=rt.length&&(rt.length=t+1),rt[t]=e=U.get(t)),e}function it(t){var e=D(t)+1,n=gt(e);return n&&k(t,S,n,e),n}var ot={};function ut(){if(!ct){var t,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",_:p||"./this.program"};for(t in ot)void 0===ot[t]?delete e[t]:e[t]=ot[t];var n=[];for(t in e)n.push(t+"="+e[t]);ct=n}return ct}var ct,st=[null,[],[]];function lt(t,e){var n=st[t];0===e||10===e?((1===t?v:w)(R(n,0)),n.length=0):n.push(e)}var ft=0;function pt(t){return 0==t%4&&(0!=t%100||0==t%400)}var ht=[31,29,31,30,31,30,31,31,30,31,30,31],dt=[31,28,31,30,31,30,31,31,30,31,30,31];function yt(t,e,n,r){function a(t,e,n){for(t="number"==typeof t?t.toString():t||"";t.length<e;)t=n[0]+t;return t}function i(t,e){return a(t,e,"0")}function o(t,e){function n(t){return 0>t?-1:0<t?1:0}var r;return 0===(r=n(t.getFullYear()-e.getFullYear()))&&0===(r=n(t.getMonth()-e.getMonth()))&&(r=n(t.getDate()-e.getDate())),r}function u(t){switch(t.getDay()){case 0:return new Date(t.getFullYear()-1,11,29);case 1:return t;case 2:return new Date(t.getFullYear(),0,3);case 3:return new Date(t.getFullYear(),0,2);case 4:return new Date(t.getFullYear(),0,1);case 5:return new Date(t.getFullYear()-1,11,31);case 6:return new Date(t.getFullYear()-1,11,30)}}function c(t){var e=t.Bb;for(t=new Date(new Date(t.Cb+1900,0,1).getTime());0<e;){var n=t.getMonth(),r=(pt(t.getFullYear())?ht:dt)[n];if(!(e>r-t.getDate())){t.setDate(t.getDate()+e);break}e-=r-t.getDate()+1,t.setDate(1),11>n?t.setMonth(n+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return n=new Date(t.getFullYear()+1,0,4),e=u(new Date(t.getFullYear(),0,4)),n=u(n),0>=o(e,t)?0>=o(n,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var s=E[r+40>>2>>>0];for(var l in r={$b:E[r>>2>>>0],Zb:E[r+4>>2>>>0],Gb:E[r+8>>2>>>0],Kb:E[r+12>>2>>>0],Hb:E[r+16>>2>>>0],Cb:E[r+20>>2>>>0],Ab:E[r+24>>2>>>0],Bb:E[r+28>>2>>>0],bc:E[r+32>>2>>>0],Yb:E[r+36>>2>>>0],ac:s?j(s):""},n=j(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"})n=n.replace(new RegExp(l,"g"),s[l]);var f="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),p="January February March April May June July August September October November December".split(" ");for(l in s={"%a":function(t){return f[t.Ab].substring(0,3)},"%A":function(t){return f[t.Ab]},"%b":function(t){return p[t.Hb].substring(0,3)},"%B":function(t){return p[t.Hb]},"%C":function(t){return i((t.Cb+1900)/100|0,2)},"%d":function(t){return i(t.Kb,2)},"%e":function(t){return a(t.Kb,2," ")},"%g":function(t){return c(t).toString().substring(2)},"%G":function(t){return c(t)},"%H":function(t){return i(t.Gb,2)},"%I":function(t){return 0==(t=t.Gb)?t=12:12<t&&(t-=12),i(t,2)},"%j":function(t){for(var e=0,n=0;n<=t.Hb-1;e+=(pt(t.Cb+1900)?ht:dt)[n++]);return i(t.Kb+e,3)},"%m":function(t){return i(t.Hb+1,2)},"%M":function(t){return i(t.Zb,2)},"%n":function(){return"\\n"},"%p":function(t){return 0<=t.Gb&&12>t.Gb?"AM":"PM"},"%S":function(t){return i(t.$b,2)},"%t":function(){return"\\t"},"%u":function(t){return t.Ab||7},"%U":function(t){return i(Math.floor((t.Bb+7-t.Ab)/7),2)},"%V":function(t){var e=Math.floor((t.Bb+7-(t.Ab+6)%7)/7);if(2>=(t.Ab+371-t.Bb-2)%7&&e++,e)53==e&&(4==(n=(t.Ab+371-t.Bb)%7)||3==n&&pt(t.Cb)||(e=1));else{e=52;var n=(t.Ab+7-t.Bb-1)%7;(4==n||5==n&&pt(t.Cb%400-1))&&e++}return i(e,2)},"%w":function(t){return t.Ab},"%W":function(t){return i(Math.floor((t.Bb+7-(t.Ab+6)%7)/7),2)},"%y":function(t){return(t.Cb+1900).toString().substring(2)},"%Y":function(t){return t.Cb+1900},"%z":function(t){var e=0<=(t=t.Yb);return t=Math.abs(t)/60,(e?"+":"-")+String("0000"+(t/60*100+t%60)).slice(-4)},"%Z":function(t){return t.ac},"%%":function(){return"%"}},n=n.replace(/%%/g,"\\0\\0"),s)n.includes(l)&&(n=n.replace(new RegExp(l,"g"),s[l](r)));return l=function(t){var e=Array(D(t)+1);return k(t,e,0,e.length),e}(n=n.replace(/\\0\\0/g,"%")),l.length>e?0:(S.set(l,t>>>0),l.length-1)}var bt={a:function(t){return gt(t+24)+24},m:function(t){return(t=new et(t)).Pb()||(t.Ib(!0),K--),t.Jb(!1),Q.push(t),t.Nb(),t.Qb()},ia:function(t){throw w("Unexpected exception thrown, this is not properly supported - aborting"),C=!0,t},w:function(){Ot(0);var t=Q.pop();if(t.Xb()&&!t.Lb()){var e=t.Wb();e&&at(e)(t.Db),nt(t.Db)}tt=0},d:function(){var t=tt;if(!t)return ft=0;var e=new et(t);e.Fb(t);var n=e.Eb();if(!n)return ft=0,t;for(var r=Array.prototype.slice.call(arguments),a=0;a<r.length;a++){var i=r[a];if(0===i||i===n)break;if(Et(i,n,e.zb+16))return ft=i,t}return ft=n,t},k:function(){var t=tt;if(!t)return ft=0;var e=new et(t);e.Fb(t);var n=e.Eb();if(!n)return ft=0,t;for(var r=Array.prototype.slice.call(arguments),a=0;a<r.length;a++){var i=r[a];if(0===i||i===n)break;if(Et(i,n,e.zb+16))return ft=i,t}return ft=n,t},g:function(){var t=tt;if(!t)return ft=0;var e=new et(t);e.Fb(t);var n=e.Eb();if(!n)return ft=0,t;for(var r=Array.prototype.slice.call(arguments),a=0;a<r.length;a++){var i=r[a];if(0===i||i===n)break;if(Et(i,n,e.zb+16))return ft=i,t}return ft=n,t},s:nt,L:function(){var t=Q.pop();t||V("no exception to throw");var e=t.Db;throw t.Lb()||(Q.push(t),t.Jb(!0),t.Ib(!1),K++),tt=e,e},b:function(t,e,n){throw new et(t).Rb(e,n),tt=t,K++,t},la:function(){return K},i:function(t){throw tt||(tt=t),t},H:function(){return 0},Ba:function(){},pa:function(){},ra:function(){},ka:function(){return 0},za:function(){},ua:function(){},ya:function(){},R:function(){},qa:function(){},na:function(){},Aa:function(){},oa:function(){},Ha:function(){},Ja:function(){V("To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking")},Ia:function(){V("To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking")},S:function(){return Date.now()},Ca:function(){return!0},Da:function(t,e){t=new Date(1e3*(M[t>>>2]+4294967296*E[t+4>>>2])),E[e>>2>>>0]=t.getUTCSeconds(),E[e+4>>2>>>0]=t.getUTCMinutes(),E[e+8>>2>>>0]=t.getUTCHours(),E[e+12>>2>>>0]=t.getUTCDate(),E[e+16>>2>>>0]=t.getUTCMonth(),E[e+20>>2>>>0]=t.getUTCFullYear()-1900,E[e+24>>2>>>0]=t.getUTCDay(),E[e+28>>2>>>0]=(t.getTime()-Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0))/864e5|0},Ea:function(t,e){t=new Date(1e3*(M[t>>>2]+4294967296*E[t+4>>>2])),E[e>>2>>>0]=t.getSeconds(),E[e+4>>2>>>0]=t.getMinutes(),E[e+8>>2>>>0]=t.getHours(),E[e+12>>2>>>0]=t.getDate(),E[e+16>>2>>>0]=t.getMonth(),E[e+20>>2>>>0]=t.getFullYear()-1900,E[e+24>>2>>>0]=t.getDay();var n=new Date(t.getFullYear(),0,1);E[e+28>>2>>>0]=(t.getTime()-n.getTime())/864e5|0,E[e+36>>2>>>0]=-60*t.getTimezoneOffset();var r=new Date(t.getFullYear(),6,1).getTimezoneOffset();n=n.getTimezoneOffset(),E[e+32>>2>>>0]=0|(r!=n&&t.getTimezoneOffset()==Math.min(n,r))},Fa:function(t){var e=new Date(E[t+20>>2>>>0]+1900,E[t+16>>2>>>0],E[t+12>>2>>>0],E[t+8>>2>>>0],E[t+4>>2>>>0],E[t>>2>>>0],0),n=E[t+32>>2>>>0],r=e.getTimezoneOffset(),a=new Date(e.getFullYear(),0,1),i=new Date(e.getFullYear(),6,1).getTimezoneOffset(),o=a.getTimezoneOffset(),u=Math.min(o,i);return 0>n?E[t+32>>2>>>0]=Number(i!=o&&u==r):0<n!=(u==r)&&(i=Math.max(o,i),e.setTime(e.getTime()+6e4*((0<n?u:i)-r))),E[t+24>>2>>>0]=e.getDay(),E[t+28>>2>>>0]=(e.getTime()-a.getTime())/864e5|0,E[t>>2>>>0]=e.getSeconds(),E[t+4>>2>>>0]=e.getMinutes(),E[t+8>>2>>>0]=e.getHours(),E[t+12>>2>>>0]=e.getDate(),E[t+16>>2>>>0]=e.getMonth(),e.getTime()/1e3|0},sa:function(){return-52},ta:function(){},Ga:function t(e,n,r){t.Vb||(t.Vb=!0,function(t,e,n){function r(t){return(t=t.toTimeString().match(/\\(([A-Za-z ]+)\\)$/))?t[1]:"GMT"}var a=(new Date).getFullYear(),i=new Date(a,0,1),o=new Date(a,6,1);a=i.getTimezoneOffset();var u=o.getTimezoneOffset();E[t>>2>>>0]=60*Math.max(a,u),E[e>>2>>>0]=Number(a!=u),t=r(i),e=r(o),t=it(t),e=it(e),u<a?(M[n>>2>>>0]=t,M[n+4>>2>>>0]=e):(M[n>>2>>>0]=e,M[n+4>>2>>>0]=t)}(e,n,r))},B:function(){V("")},ma:function(){return 4294901760},I:b?()=>{var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:()=>performance.now(),xa:function(t,e,n){T.copyWithin(t>>>0,e>>>0,e+n>>>0)},G:function(t){var e=T.length;if(4294901760<(t>>>=0))return!1;for(var n=1;4>=n;n*=2){var r=e*(1+.2/n);r=Math.min(r,t+100663296);var a=Math;r=Math.max(t,r),a=a.min.call(a,4294901760,r+(65536-r%65536)%65536);t:{try{O.grow(a-A.byteLength+65535>>>16),P();var i=1;break t}catch(t){}i=void 0}if(i)return!0}return!1},va:function(t,e){var n=0;return ut().forEach((function(r,a){var i=e+n;for(a=M[t+4*a>>2>>>0]=i,i=0;i<r.length;++i)S[a++>>0>>>0]=r.charCodeAt(i);S[a>>0>>>0]=0,n+=r.length+1})),0},wa:function(t,e){var n=ut();M[t>>2>>>0]=n.length;var r=0;return n.forEach((function(t){r+=t.length+1})),M[e>>2>>>0]=r,0},ba:function(t){_||0<L||(_t(),Z(W),wt(0),st[1].length&&lt(1,10),st[2].length&&lt(2,10)),_||0<L||(e.onExit&&e.onExit(t),C=!0),h(t,new J(t))},E:function(){return 52},Q:function(){return 52},ca:function(){return 70},P:function(t,e,n,r){for(var a=0,i=0;i<n;i++){var o=M[e>>2>>>0],u=M[e+4>>2>>>0];e+=8;for(var c=0;c<u;c++)lt(t,T[o+c>>>0]);a+=u}return M[r>>2>>>0]=a,0},c:function(){return ft},ja:function t(e,r){t.Mb||(t.Mb=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var t=new Uint8Array(1);return()=>(crypto.getRandomValues(t),t[0])}if(b)try{var e=n(Object(function(){var t=new Error("Cannot find module \'crypto\'");throw t.code="MODULE_NOT_FOUND",t}()));return()=>e.randomBytes(1)[0]}catch(t){}return()=>V("randomDevice")}());for(var a=0;a<r;a++)S[e+a>>0>>>0]=t.Mb();return 0},ea:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},fa:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},J:function(t){var e=At();try{return at(t)()}catch(t){if(St(e),t!==t+0)throw t;Ot(1,0)}},e:function(t,e){var n=At();try{return at(t)(e)}catch(t){if(St(n),t!==t+0)throw t;Ot(1,0)}},N:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},O:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},j:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},o:function(t,e,n,r){var a=At();try{return at(t)(e,n,r)}catch(t){if(St(a),t!==t+0)throw t;Ot(1,0)}},p:function(t,e,n,r,a){var i=At();try{return at(t)(e,n,r,a)}catch(t){if(St(i),t!==t+0)throw t;Ot(1,0)}},M:function(t,e,n,r,a,i){var o=At();try{return at(t)(e,n,r,a,i)}catch(t){if(St(o),t!==t+0)throw t;Ot(1,0)}},r:function(t,e,n,r,a,i){var o=At();try{return at(t)(e,n,r,a,i)}catch(t){if(St(o),t!==t+0)throw t;Ot(1,0)}},v:function(t,e,n,r,a,i,o){var u=At();try{return at(t)(e,n,r,a,i,o)}catch(t){if(St(u),t!==t+0)throw t;Ot(1,0)}},K:function(t,e,n,r,a,i,o,u){var c=At();try{return at(t)(e,n,r,a,i,o,u)}catch(t){if(St(c),t!==t+0)throw t;Ot(1,0)}},D:function(t,e,n,r,a,i,o,u,c,s,l,f){var p=At();try{return at(t)(e,n,r,a,i,o,u,c,s,l,f)}catch(t){if(St(p),t!==t+0)throw t;Ot(1,0)}},X:function(t,e,n,r,a,i,o,u){var c=At();try{return Ft(t,e,n,r,a,i,o,u)}catch(t){if(St(c),t!==t+0)throw t;Ot(1,0)}},V:function(t,e,n,r,a,i,o){var u=At();try{return xt(t,e,n,r,a,i,o)}catch(t){if(St(u),t!==t+0)throw t;Ot(1,0)}},U:function(t,e,n,r,a){var i=At();try{return It(t,e,n,r,a)}catch(t){if(St(i),t!==t+0)throw t;Ot(1,0)}},Z:function(t,e,n,r){var a=At();try{return Pt(t,e,n,r)}catch(t){if(St(a),t!==t+0)throw t;Ot(1,0)}},W:function(t){var e=At();try{return Ct(t)}catch(t){if(St(e),t!==t+0)throw t;Ot(1,0)}},Y:function(t,e){var n=At();try{return Ut(t,e)}catch(t){if(St(n),t!==t+0)throw t;Ot(1,0)}},T:function(t,e,n){var r=At();try{return Rt(t,e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},f:function(t){var e=At();try{at(t)()}catch(t){if(St(e),t!==t+0)throw t;Ot(1,0)}},q:function(t,e){var n=At();try{at(t)(e)}catch(t){if(St(n),t!==t+0)throw t;Ot(1,0)}},h:function(t,e,n){var r=At();try{at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},da:function(t,e,n,r){var a=At();try{at(t)(e,n,r)}catch(t){if(St(a),t!==t+0)throw t;Ot(1,0)}},l:function(t,e,n,r){var a=At();try{at(t)(e,n,r)}catch(t){if(St(a),t!==t+0)throw t;Ot(1,0)}},t:function(t,e,n,r,a){var i=At();try{at(t)(e,n,r,a)}catch(t){if(St(i),t!==t+0)throw t;Ot(1,0)}},u:function(t,e,n,r,a,i){var o=At();try{at(t)(e,n,r,a,i)}catch(t){if(St(o),t!==t+0)throw t;Ot(1,0)}},x:function(t,e,n,r,a,i,o){var u=At();try{at(t)(e,n,r,a,i,o)}catch(t){if(St(u),t!==t+0)throw t;Ot(1,0)}},z:function(t,e,n,r,a,i,o,u){var c=At();try{at(t)(e,n,r,a,i,o,u)}catch(t){if(St(c),t!==t+0)throw t;Ot(1,0)}},ga:function(t,e,n,r,a,i,o,u,c){var s=At();try{at(t)(e,n,r,a,i,o,u,c)}catch(t){if(St(s),t!==t+0)throw t;Ot(1,0)}},A:function(t,e,n,r,a,i,o,u,c,s,l){var f=At();try{at(t)(e,n,r,a,i,o,u,c,s,l)}catch(t){if(St(f),t!==t+0)throw t;Ot(1,0)}},C:function(t,e,n,r,a,i,o,u,c,s,l,f,p,h,d,y){var b=At();try{at(t)(e,n,r,a,i,o,u,c,s,l,f,p,h,d,y)}catch(t){if(St(b),t!==t+0)throw t;Ot(1,0)}},aa:function(t,e,n,r,a,i,o,u){var c=At();try{jt(t,e,n,r,a,i,o,u)}catch(t){if(St(c),t!==t+0)throw t;Ot(1,0)}},_:function(t,e,n,r,a,i,o,u,c,s,l,f){var p=At();try{Dt(t,e,n,r,a,i,o,u,c,s,l,f)}catch(t){if(St(p),t!==t+0)throw t;Ot(1,0)}},$:function(t,e,n,r,a,i){var o=At();try{kt(t,e,n,r,a,i)}catch(t){if(St(o),t!==t+0)throw t;Ot(1,0)}},n:function(t){return t},F:function(t){ft=t},ha:yt,y:function(t,e,n,r){return yt(t,e,n,r)}};!function(){function t(t){e.asm=t.exports,O=e.asm.Ka,P(),U=e.asm.ib,I.unshift(e.asm.La),B--,e.monitorRunDependencies&&e.monitorRunDependencies(B),0==B&&(null!==G&&(clearInterval(G),G=null),N&&(t=N,N=null,t()))}function n(e){t(e.instance)}function r(t){return function(){if(!g&&(d||y)){if("function"==typeof fetch&&!Y.startsWith("file://"))return fetch(Y,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at \'"+Y+"\'";return t.arrayBuffer()})).catch((function(){return X()}));if(o)return new Promise((function(t,e){o(Y,(function(e){t(new Uint8Array(e))}),e)}))}return Promise.resolve().then((function(){return X()}))}().then((function(t){return WebAssembly.instantiate(t,i)})).then((function(t){return t})).then(t,(function(t){w("failed to asynchronously prepare wasm: "+t),V(t)}))}var i={a:bt};if(B++,e.monitorRunDependencies&&e.monitorRunDependencies(B),e.instantiateWasm)try{return e.instantiateWasm(i,t)}catch(t){return w("Module.instantiateWasm callback failed with error: "+t),!1}(g||"function"!=typeof WebAssembly.instantiateStreaming||$()||Y.startsWith("file://")||b||"function"!=typeof fetch?r(n):fetch(Y,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,i).then(n,(function(t){return w("wasm streaming compile failed: "+t),w("falling back to ArrayBuffer instantiation"),r(n)}))}))).catch(a)}(),e.___wasm_call_ctors=function(){return(e.___wasm_call_ctors=e.asm.La).apply(null,arguments)},e._OrtInit=function(){return(e._OrtInit=e.asm.Ma).apply(null,arguments)},e._OrtCreateSessionOptions=function(){return(e._OrtCreateSessionOptions=e.asm.Na).apply(null,arguments)},e._OrtAppendExecutionProvider=function(){return(e._OrtAppendExecutionProvider=e.asm.Oa).apply(null,arguments)},e._OrtAddSessionConfigEntry=function(){return(e._OrtAddSessionConfigEntry=e.asm.Pa).apply(null,arguments)},e._OrtReleaseSessionOptions=function(){return(e._OrtReleaseSessionOptions=e.asm.Qa).apply(null,arguments)},e._OrtCreateSession=function(){return(e._OrtCreateSession=e.asm.Ra).apply(null,arguments)},e._OrtReleaseSession=function(){return(e._OrtReleaseSession=e.asm.Sa).apply(null,arguments)},e._OrtGetInputCount=function(){return(e._OrtGetInputCount=e.asm.Ta).apply(null,arguments)},e._OrtGetOutputCount=function(){return(e._OrtGetOutputCount=e.asm.Ua).apply(null,arguments)},e._OrtGetInputName=function(){return(e._OrtGetInputName=e.asm.Va).apply(null,arguments)},e._OrtGetOutputName=function(){return(e._OrtGetOutputName=e.asm.Wa).apply(null,arguments)},e._OrtFree=function(){return(e._OrtFree=e.asm.Xa).apply(null,arguments)},e._OrtCreateTensor=function(){return(e._OrtCreateTensor=e.asm.Ya).apply(null,arguments)},e._OrtGetTensorData=function(){return(e._OrtGetTensorData=e.asm.Za).apply(null,arguments)},e._OrtReleaseTensor=function(){return(e._OrtReleaseTensor=e.asm._a).apply(null,arguments)},e._OrtCreateRunOptions=function(){return(e._OrtCreateRunOptions=e.asm.$a).apply(null,arguments)},e._OrtAddRunConfigEntry=function(){return(e._OrtAddRunConfigEntry=e.asm.ab).apply(null,arguments)},e._OrtReleaseRunOptions=function(){return(e._OrtReleaseRunOptions=e.asm.bb).apply(null,arguments)},e._OrtRun=function(){return(e._OrtRun=e.asm.cb).apply(null,arguments)},e._OrtEndProfiling=function(){return(e._OrtEndProfiling=e.asm.db).apply(null,arguments)};var mt,gt=e._malloc=function(){return(gt=e._malloc=e.asm.eb).apply(null,arguments)},vt=e._free=function(){return(vt=e._free=e.asm.fb).apply(null,arguments)},wt=e._fflush=function(){return(wt=e._fflush=e.asm.gb).apply(null,arguments)},_t=e.___funcs_on_exit=function(){return(_t=e.___funcs_on_exit=e.asm.hb).apply(null,arguments)},Ot=e._setThrew=function(){return(Ot=e._setThrew=e.asm.jb).apply(null,arguments)},At=e.stackSave=function(){return(At=e.stackSave=e.asm.kb).apply(null,arguments)},St=e.stackRestore=function(){return(St=e.stackRestore=e.asm.lb).apply(null,arguments)},Tt=e.stackAlloc=function(){return(Tt=e.stackAlloc=e.asm.mb).apply(null,arguments)},Et=e.___cxa_can_catch=function(){return(Et=e.___cxa_can_catch=e.asm.nb).apply(null,arguments)},Mt=e.___cxa_is_pointer_type=function(){return(Mt=e.___cxa_is_pointer_type=e.asm.ob).apply(null,arguments)},Ct=e.dynCall_j=function(){return(Ct=e.dynCall_j=e.asm.pb).apply(null,arguments)},xt=e.dynCall_iiiiij=function(){return(xt=e.dynCall_iiiiij=e.asm.qb).apply(null,arguments)},Rt=e.dynCall_jii=function(){return(Rt=e.dynCall_jii=e.asm.rb).apply(null,arguments)},jt=e.dynCall_viiiiij=function(){return(jt=e.dynCall_viiiiij=e.asm.sb).apply(null,arguments)},kt=e.dynCall_vjji=function(){return(kt=e.dynCall_vjji=e.asm.tb).apply(null,arguments)},Dt=e.dynCall_viiijjjii=function(){return(Dt=e.dynCall_viiijjjii=e.asm.ub).apply(null,arguments)},Pt=e.dynCall_iij=function(){return(Pt=e.dynCall_iij=e.asm.vb).apply(null,arguments)},Ut=e.dynCall_ji=function(){return(Ut=e.dynCall_ji=e.asm.wb).apply(null,arguments)},Ft=e.dynCall_iiiiiij=function(){return(Ft=e.dynCall_iiiiiij=e.asm.xb).apply(null,arguments)},It=e.dynCall_iiij=function(){return(It=e.dynCall_iiij=e.asm.yb).apply(null,arguments)};function Wt(){function t(){if(!mt&&(mt=!0,e.calledRun=!0,!C)){if(Z(I),r(e),e.onRuntimeInitialized&&e.onRuntimeInitialized(),e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;){var t=e.postRun.shift();H.unshift(t)}Z(H)}}if(!(0<B)){if(e.preRun)for("function"==typeof e.preRun&&(e.preRun=[e.preRun]);e.preRun.length;)z();Z(F),0<B||(e.setStatus?(e.setStatus("Running..."),setTimeout((function(){setTimeout((function(){e.setStatus("")}),1),t()}),1)):t())}}if(e.UTF8ToString=j,e.stringToUTF8=function(t,e,n){return k(t,T,e,n)},e.lengthBytesUTF8=D,e.stackSave=At,e.stackRestore=St,e.stackAlloc=Tt,N=function t(){mt||Wt(),mt||(N=t)},e.preInit)for("function"==typeof e.preInit&&(e.preInit=[e.preInit]);0<e.preInit.length;)e.preInit.pop()();return Wt(),t.ready});t.exports=r},967:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.iterateExtraOptions=void 0,e.iterateExtraOptions=(t,n,r,a)=>{if("object"==typeof t&&null!==t){if(r.has(t))throw new Error("Circular reference in options");r.add(t)}Object.entries(t).forEach((([t,i])=>{const o=n?n+t:t;if("object"==typeof i)(0,e.iterateExtraOptions)(i,o+".",r,a);else if("string"==typeof i||"number"==typeof i)a(o,i.toString());else{if("boolean"!=typeof i)throw new Error("Can\'t handle extra config type: "+typeof i);a(o,i?"1":"0")}}))}},586:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setRunOptions=void 0;const r=n(967),a=n(983),i=n(361);e.setRunOptions=t=>{const e=(0,i.getInstance)();let n=0;const o=[],u=t||{};try{if(void 0===(null==t?void 0:t.logSeverityLevel))u.logSeverityLevel=2;else if("number"!=typeof t.logSeverityLevel||!Number.isInteger(t.logSeverityLevel)||t.logSeverityLevel<0||t.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${t.logSeverityLevel}`);if(void 0===(null==t?void 0:t.logVerbosityLevel))u.logVerbosityLevel=0;else if("number"!=typeof t.logVerbosityLevel||!Number.isInteger(t.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${t.logVerbosityLevel}`);void 0===(null==t?void 0:t.terminate)&&(u.terminate=!1);let i=0;if(void 0!==(null==t?void 0:t.tag)&&(i=(0,a.allocWasmString)(t.tag,o)),n=e._OrtCreateRunOptions(u.logSeverityLevel,u.logVerbosityLevel,!!u.terminate,i),0===n)throw new Error("Can\'t create run options");return void 0!==(null==t?void 0:t.extra)&&(0,r.iterateExtraOptions)(t.extra,"",new WeakSet,((t,r)=>{const i=(0,a.allocWasmString)(t,o),u=(0,a.allocWasmString)(r,o);if(0!==e._OrtAddRunConfigEntry(n,i,u))throw new Error(`Can\'t set a run config entry: ${t} - ${r}`)})),[n,o]}catch(t){throw 0!==n&&e._OrtReleaseRunOptions(n),o.forEach(e._free),t}}},919:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setSessionOptions=void 0;const r=n(967),a=n(983),i=n(361);e.setSessionOptions=t=>{const e=(0,i.getInstance)();let n=0;const o=[],u=t||{};(t=>{t.extra||(t.extra={}),t.extra.session||(t.extra.session={});const e=t.extra.session;e.use_ort_model_bytes_directly||(e.use_ort_model_bytes_directly="1")})(u);try{void 0===(null==t?void 0:t.graphOptimizationLevel)&&(u.graphOptimizationLevel="all");const c=(t=>{switch(t){case"disabled":return 0;case"basic":return 1;case"extended":return 2;case"all":return 99;default:throw new Error(`unsupported graph optimization level: ${t}`)}})(u.graphOptimizationLevel);void 0===(null==t?void 0:t.enableCpuMemArena)&&(u.enableCpuMemArena=!0),void 0===(null==t?void 0:t.enableMemPattern)&&(u.enableMemPattern=!0),void 0===(null==t?void 0:t.executionMode)&&(u.executionMode="sequential");const s=(t=>{switch(t){case"sequential":return 0;case"parallel":return 1;default:throw new Error(`unsupported execution mode: ${t}`)}})(u.executionMode);let l=0;if(void 0!==(null==t?void 0:t.logId)&&(l=(0,a.allocWasmString)(t.logId,o)),void 0===(null==t?void 0:t.logSeverityLevel))u.logSeverityLevel=2;else if("number"!=typeof t.logSeverityLevel||!Number.isInteger(t.logSeverityLevel)||t.logSeverityLevel<0||t.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${t.logSeverityLevel}`);if(void 0===(null==t?void 0:t.logVerbosityLevel))u.logVerbosityLevel=0;else if("number"!=typeof t.logVerbosityLevel||!Number.isInteger(t.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${t.logVerbosityLevel}`);if(void 0===(null==t?void 0:t.enableProfiling)&&(u.enableProfiling=!1),n=e._OrtCreateSessionOptions(c,!!u.enableCpuMemArena,!!u.enableMemPattern,s,!!u.enableProfiling,0,l,u.logSeverityLevel,u.logVerbosityLevel),0===n)throw new Error("Can\'t create session options");return(null==t?void 0:t.executionProviders)&&((t,e,n)=>{for(const r of e){let e="string"==typeof r?r:r.name;switch(e){case"xnnpack":e="XNNPACK";break;case"wasm":case"cpu":continue;default:throw new Error(`not supported EP: ${e}`)}const o=(0,a.allocWasmString)(e,n);if(0!==(0,i.getInstance)()._OrtAppendExecutionProvider(t,o))throw new Error(`Can\'t append execution provider: ${e}`)}})(n,t.executionProviders,o),void 0!==(null==t?void 0:t.extra)&&(0,r.iterateExtraOptions)(t.extra,"",new WeakSet,((t,r)=>{const i=(0,a.allocWasmString)(t,o),u=(0,a.allocWasmString)(r,o);if(0!==e._OrtAddSessionConfigEntry(n,i,u))throw new Error(`Can\'t set a session config entry: ${t} - ${r}`)})),[n,o]}catch(t){throw 0!==n&&e._OrtReleaseSessionOptions(n),o.forEach(e._free),t}}},983:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.allocWasmString=void 0;const r=n(361);e.allocWasmString=(t,e)=>{const n=(0,r.getInstance)(),a=n.lengthBytesUTF8(t)+1,i=n._malloc(a);return n.stringToUTF8(t,i,a),e.push(i),i}},349:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.extractTransferableBuffers=e.endProfiling=e.run=e.releaseSession=e.createSession=e.createSessionFinalize=e.createSessionAllocate=e.initOrt=void 0;const r=n(586),a=n(919),i=n(983),o=n(361);e.initOrt=(t,e)=>{const n=(0,o.getInstance)()._OrtInit(t,e);if(0!==n)throw new Error(`Can\'t initialize onnxruntime. error code = ${n}`)};const u=new Map;e.createSessionAllocate=t=>{const e=(0,o.getInstance)(),n=e._malloc(t.byteLength);return e.HEAPU8.set(t,n),[n,t.byteLength]},e.createSessionFinalize=(t,e)=>{const n=(0,o.getInstance)();let r=0,i=0,c=[];try{if([i,c]=(0,a.setSessionOptions)(e),r=n._OrtCreateSession(t[0],t[1],i),0===r)throw new Error("Can\'t create a session")}finally{n._free(t[0]),n._OrtReleaseSessionOptions(i),c.forEach(n._free)}const s=n._OrtGetInputCount(r),l=n._OrtGetOutputCount(r),f=[],p=[],h=[],d=[];for(let t=0;t<s;t++){const e=n._OrtGetInputName(r,t);if(0===e)throw new Error("Can\'t get an input name");p.push(e),f.push(n.UTF8ToString(e))}for(let t=0;t<l;t++){const e=n._OrtGetOutputName(r,t);if(0===e)throw new Error("Can\'t get an output name");d.push(e),h.push(n.UTF8ToString(e))}return u.set(r,[r,p,d]),[r,f,h]},e.createSession=(t,n)=>{const r=(0,e.createSessionAllocate)(t);return(0,e.createSessionFinalize)(r,n)},e.releaseSession=t=>{const e=(0,o.getInstance)(),n=u.get(t);if(!n)throw new Error("invalid session id");const r=n[0],a=n[1],i=n[2];a.forEach(e._OrtFree),i.forEach(e._OrtFree),e._OrtReleaseSession(r),u.delete(t)};const c=t=>{switch(t){case"int8":return 3;case"uint8":return 2;case"bool":return 9;case"int16":return 5;case"uint16":return 4;case"int32":return 6;case"uint32":return 12;case"float32":return 1;case"float64":return 11;case"string":return 8;case"int64":return 7;case"uint64":return 13;default:throw new Error(`unsupported data type: ${t}`)}},s=t=>{switch(t){case 3:return"int8";case 2:return"uint8";case 9:return"bool";case 5:return"int16";case 4:return"uint16";case 6:return"int32";case 12:return"uint32";case 1:return"float32";case 11:return"float64";case 8:return"string";case 7:return"int64";case 13:return"uint64";default:throw new Error(`unsupported data type: ${t}`)}},l=t=>{switch(t){case"float32":return Float32Array;case"uint8":case"bool":return Uint8Array;case"int8":return Int8Array;case"uint16":return Uint16Array;case"int16":return Int16Array;case"int32":return Int32Array;case"float64":return Float64Array;case"uint32":return Uint32Array;case"int64":return BigInt64Array;case"uint64":return BigUint64Array;default:throw new Error(`unsupported type: ${t}`)}};e.run=(t,e,n,a,f)=>{const p=(0,o.getInstance)(),h=u.get(t);if(!h)throw new Error("invalid session id");const d=h[0],y=h[1],b=h[2],m=e.length,g=a.length;let v=0,w=[];const _=[],O=[];try{[v,w]=(0,r.setRunOptions)(f);for(let t=0;t<m;t++){const e=n[t][0],r=n[t][1],a=n[t][2];let o,u;if(Array.isArray(a)){u=4*a.length,o=p._malloc(u),O.push(o);let t=o/4;for(let e=0;e<a.length;e++){if("string"!=typeof a[e])throw new TypeError(`tensor data at index ${e} is not a string`);p.HEAPU32[t++]=(0,i.allocWasmString)(a[e],O)}}else u=a.byteLength,o=p._malloc(u),O.push(o),p.HEAPU8.set(new Uint8Array(a.buffer,a.byteOffset,u),o);const s=p.stackSave(),l=p.stackAlloc(4*r.length);try{let t=l/4;r.forEach((e=>p.HEAP32[t++]=e));const n=p._OrtCreateTensor(c(e),o,u,l,r.length);if(0===n)throw new Error("Can\'t create a tensor");_.push(n)}finally{p.stackRestore(s)}}const t=p.stackSave(),o=p.stackAlloc(4*m),u=p.stackAlloc(4*m),h=p.stackAlloc(4*g),A=p.stackAlloc(4*g);try{let n=o/4,r=u/4,i=h/4,c=A/4;for(let t=0;t<m;t++)p.HEAPU32[n++]=_[t],p.HEAPU32[r++]=y[e[t]];for(let t=0;t<g;t++)p.HEAPU32[i++]=0,p.HEAPU32[c++]=b[a[t]];let f=p._OrtRun(d,u,o,m,A,g,h,v);const w=[];if(0===f)for(let t=0;t<g;t++){const e=p.HEAPU32[h/4+t],n=p.stackSave(),r=p.stackAlloc(16);let a,i=0;try{if(f=p._OrtGetTensorData(e,r,r+4,r+8,r+12),0!==f)throw new Error(`Can\'t access output tensor data. error code = ${f}`);let t=r/4;const o=p.HEAPU32[t++];i=p.HEAPU32[t++];const u=p.HEAPU32[t++],c=p.HEAPU32[t++],h=[];for(let t=0;t<c;t++)h.push(p.HEAPU32[u/4+t]);p._OrtFree(u);const d=0===h.length?1:h.reduce(((t,e)=>t*e));if(a=s(o),"string"===a){const t=[];let e=i/4;for(let n=0;n<d;n++){const r=p.HEAPU32[e++],a=n===d-1?void 0:p.HEAPU32[e]-r;t.push(p.UTF8ToString(r,a))}w.push([a,h,t])}else{const t=new(l(a))(d);new Uint8Array(t.buffer,t.byteOffset,t.byteLength).set(p.HEAPU8.subarray(i,i+t.byteLength)),w.push([a,h,t])}}finally{p.stackRestore(n),"string"===a&&i&&p._free(i),p._OrtReleaseTensor(e)}}if(0===f)return w;throw new Error(`failed to call OrtRun(). error code = ${f}.`)}finally{p.stackRestore(t)}}finally{_.forEach(p._OrtReleaseTensor),O.forEach(p._free),p._OrtReleaseRunOptions(v),w.forEach(p._free)}},e.endProfiling=t=>{const e=(0,o.getInstance)(),n=u.get(t);if(!n)throw new Error("invalid session id");const r=n[0],a=e._OrtEndProfiling(r);if(0===a)throw new Error("Can\'t get an profile file name");e._OrtFree(a)},e.extractTransferableBuffers=t=>{const e=[];for(const n of t){const t=n[2];!Array.isArray(t)&&t.buffer&&e.push(t.buffer)}return e}},361:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var a=Object.getOwnPropertyDescriptor(e,n);a&&!("get"in a?!e.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,a)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),a=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&r(e,t,n);return a(e,t),e},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.dispose=e.getInstance=e.initializeWebAssembly=void 0;const u=i(n(449)),c=o(n(932)),s=n(474);let l,f=!1,p=!1,h=!1;const d=(t,e)=>e?t?"ort-wasm-simd-threaded.wasm":"ort-wasm-threaded.wasm":t?"ort-wasm-simd.wasm":"ort-wasm.wasm";e.initializeWebAssembly=async t=>{if(f)return Promise.resolve();if(p)throw new Error("multiple calls to \'initializeWebAssembly()\' detected.");if(h)throw new Error("previous call to \'initializeWebAssembly()\' failed.");p=!0;const e=t.initTimeout,r=t.numThreads,a=t.simd,i=r>1&&(()=>{try{return"undefined"!=typeof SharedArrayBuffer&&("undefined"!=typeof MessageChannel&&(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(t){return!1}})(),o=a&&(()=>{try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,30,1,28,0,65,0,253,15,253,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,253,186,1,26,11]))}catch(t){return!1}})(),y="string"==typeof t.wasmPaths?t.wasmPaths:void 0,b=d(!1,i),m=d(o,i),g="object"==typeof t.wasmPaths?t.wasmPaths[m]:void 0;let v=!1;const w=[];if(e>0&&w.push(new Promise((t=>{setTimeout((()=>{v=!0,t()}),e)}))),w.push(new Promise(((t,e)=>{const r=i?s:c.default,a={locateFile:(t,e)=>i&&t.endsWith(".worker.js")&&"undefined"!=typeof Blob?URL.createObjectURL(new Blob([n(154)],{type:"text/javascript"})):t===b?null!=g?g:(null!=y?y:e)+m:e+t};if(i)if("undefined"==typeof Blob)a.mainScriptUrlOrBlob=u.join("/","ort-wasm-threaded.js");else{const t=`var ortWasmThreaded=(function(){var _scriptDir;return ${r.toString()}})();`;a.mainScriptUrlOrBlob=new Blob([t],{type:"text/javascript"})}r(a).then((e=>{p=!1,f=!0,l=e,t()}),(t=>{p=!1,h=!0,e(t)}))}))),await Promise.race(w),v)throw new Error(`WebAssembly backend initializing failed due to timeout: ${e}ms`)},e.getInstance=()=>{if(f&&l)return l;throw new Error("WebAssembly is not initialized yet.")},e.dispose=()=>{var t;!f||p||h||(p=!0,null===(t=l.PThread)||void 0===t||t.terminateAllThreads(),l=void 0,p=!1,f=!1,h=!0)}},154:t=>{"use strict";t.exports=\'"use strict";var e={},t="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node;if(t){var r=require("worker_threads"),a=r.parentPort;a.on("message",(e=>onmessage({data:e})));var o=require("fs");Object.assign(global,{self:global,require:require,Module:e,location:{href:__filename},Worker:r.Worker,importScripts:function(e){(0,eval)(o.readFileSync(e,"utf8"))},postMessage:function(e){a.postMessage(e)},performance:global.performance||{now:function(){return Date.now()}}})}var s=!1,n=[],i=function(){var e=Array.prototype.slice.call(arguments).join(" ");t?o.writeSync(2,e+"\\\\n"):console.error(e)};self.alert=function(){var t=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:t,threadId:e._pthread_self()})},e.instantiateWasm=(t,r)=>{var a=new WebAssembly.Instance(e.wasmModule,t);return r(a),e.wasmModule=null,a.exports},self.onunhandledrejection=e=>{throw e.reason??e},self.onmessage=t=>{try{if("load"===t.data.cmd){if(e.wasmModule=t.data.wasmModule,e.wasmMemory=t.data.wasmMemory,e.buffer=e.wasmMemory.buffer,e.ENVIRONMENT_IS_PTHREAD=!0,"string"==typeof t.data.urlOrBlob)importScripts(t.data.urlOrBlob);else{var r=URL.createObjectURL(t.data.urlOrBlob);importScripts(r),URL.revokeObjectURL(r)}ortWasmThreaded(e).then((function(t){e=t}))}else if("run"===t.data.cmd){e.__performance_now_clock_drift=performance.now()-t.data.time,e.__emscripten_thread_init(t.data.pthread_ptr,0,0,1),e.establishStackSpace(),e.PThread.receiveObjectTransfer(t.data),e.PThread.threadInitTLS(),s||(n.forEach((t=>{e.executeNotifiedProxyingQueue(t)})),n=[],s=!0);try{e.invokeEntryPoint(t.data.start_routine,t.data.arg)}catch(t){if("unwind"!=t){if(!(t instanceof e.ExitStatus))throw t;e.keepRuntimeAlive()||e.__emscripten_thread_exit(t.status)}}}else"cancel"===t.data.cmd?e._pthread_self()&&e.__emscripten_thread_exit(-1):"setimmediate"===t.data.target||("processProxyingQueue"===t.data.cmd?s?e.executeNotifiedProxyingQueue(t.data.queue):n.push(t.data.queue):(i("worker.js received unknown command "+t.data.cmd),i(t.data)))}catch(t){throw i("worker.js onmessage() captured an uncaught exception: "+t),t&&t.stack&&i(t.stack),e.__emscripten_thread_crashed&&e.__emscripten_thread_crashed(),t}};\\n\'},384:()=>{},993:()=>{},908:()=>{},953:()=>{},925:()=>{},449:()=>{}},e={};function n(r){var a=e[r];if(void 0!==a)return a.exports;var i=e[r]={exports:{}};return t[r].call(i.exports,i,i.exports,n),i.exports}n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),(()=>{"use strict";const t=n(349),e=n(361);self.onmessage=n=>{switch(n.data.type){case"init-wasm":(0,e.initializeWebAssembly)(n.data.in).then((()=>postMessage({type:"init-wasm"})),(t=>postMessage({type:"init-wasm",err:t})));break;case"init-ort":try{const{numThreads:e,loggingLevel:r}=n.data.in;(0,t.initOrt)(e,r),postMessage({type:"init-ort"})}catch(t){postMessage({type:"init-ort",err:t})}break;case"create_allocate":try{const{model:e}=n.data.in,r=(0,t.createSessionAllocate)(e);postMessage({type:"create_allocate",out:r})}catch(t){postMessage({type:"create_allocate",err:t})}break;case"create_finalize":try{const{modeldata:e,options:r}=n.data.in,a=(0,t.createSessionFinalize)(e,r);postMessage({type:"create_finalize",out:a})}catch(t){postMessage({type:"create_finalize",err:t})}break;case"create":try{const{model:e,options:r}=n.data.in,a=(0,t.createSession)(e,r);postMessage({type:"create",out:a})}catch(t){postMessage({type:"create",err:t})}break;case"release":try{const e=n.data.in;(0,t.releaseSession)(e),postMessage({type:"release"})}catch(t){postMessage({type:"release",err:t})}break;case"run":try{const{sessionId:e,inputIndices:r,inputs:a,outputIndices:i,options:o}=n.data.in,u=(0,t.run)(e,r,a,i,o);postMessage({type:"run",out:u},(0,t.extractTransferableBuffers)(u))}catch(t){postMessage({type:"run",err:t})}break;case"end-profiling":try{const e=n.data.in;(0,t.endProfiling)(e),postMessage({type:"end-profiling"})}catch(t){postMessage({type:"end-profiling",err:t})}}}})()})();\n',"Worker",void 0,void 0)}},477:e=>{e.exports=function(e,t,n,r){var o=self||window;try{try{var a;try{a=new o.Blob([e])}catch(u){(a=new(o.BlobBuilder||o.WebKitBlobBuilder||o.MozBlobBuilder||o.MSBlobBuilder)).append(e),a=a.getBlob()}var i=o.URL||o.webkitURL,s=i.createObjectURL(a),l=new o[t](s,n);return i.revokeObjectURL(s),l}catch(c){return new o[t]("data:application/javascript,".concat(encodeURIComponent(e)),n)}}catch(d){if(!r)throw Error("Inline worker is not supported");return new o[t](r,n)}}},4154:e=>{e.exports='"use strict";var e={},t="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node;if(t){var r=require("worker_threads"),a=r.parentPort;a.on("message",(e=>onmessage({data:e})));var o=require("fs");Object.assign(global,{self:global,require:require,Module:e,location:{href:__filename},Worker:r.Worker,importScripts:function(e){(0,eval)(o.readFileSync(e,"utf8"))},postMessage:function(e){a.postMessage(e)},performance:global.performance||{now:function(){return Date.now()}}})}var s=!1,n=[],i=function(){var e=Array.prototype.slice.call(arguments).join(" ");t?o.writeSync(2,e+"\\n"):console.error(e)};self.alert=function(){var t=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:t,threadId:e._pthread_self()})},e.instantiateWasm=(t,r)=>{var a=new WebAssembly.Instance(e.wasmModule,t);return r(a),e.wasmModule=null,a.exports},self.onunhandledrejection=e=>{throw e.reason??e},self.onmessage=t=>{try{if("load"===t.data.cmd){if(e.wasmModule=t.data.wasmModule,e.wasmMemory=t.data.wasmMemory,e.buffer=e.wasmMemory.buffer,e.ENVIRONMENT_IS_PTHREAD=!0,"string"==typeof t.data.urlOrBlob)importScripts(t.data.urlOrBlob);else{var r=URL.createObjectURL(t.data.urlOrBlob);importScripts(r),URL.revokeObjectURL(r)}ortWasmThreaded(e).then((function(t){e=t}))}else if("run"===t.data.cmd){e.__performance_now_clock_drift=performance.now()-t.data.time,e.__emscripten_thread_init(t.data.pthread_ptr,0,0,1),e.establishStackSpace(),e.PThread.receiveObjectTransfer(t.data),e.PThread.threadInitTLS(),s||(n.forEach((t=>{e.executeNotifiedProxyingQueue(t)})),n=[],s=!0);try{e.invokeEntryPoint(t.data.start_routine,t.data.arg)}catch(t){if("unwind"!=t){if(!(t instanceof e.ExitStatus))throw t;e.keepRuntimeAlive()||e.__emscripten_thread_exit(t.status)}}}else"cancel"===t.data.cmd?e._pthread_self()&&e.__emscripten_thread_exit(-1):"setimmediate"===t.data.target||("processProxyingQueue"===t.data.cmd?s?e.executeNotifiedProxyingQueue(t.data.queue):n.push(t.data.queue):(i("worker.js received unknown command "+t.data.cmd),i(t.data)))}catch(t){throw i("worker.js onmessage() captured an uncaught exception: "+t),t&&t.stack&&i(t.stack),e.__emscripten_thread_crashed&&e.__emscripten_thread_crashed(),t}};\n'},1670:e=>{e.exports=__WEBPACK_EXTERNAL_MODULE__1670__},7067:()=>{},1296:()=>{},1384:()=>{},3993:()=>{},908:()=>{},6953:()=>{},9925:()=>{},2806:()=>{},6449:()=>{},2850:()=>{},5381:()=>{},5686:(e,t,n)=>{n.r(t),n.d(t,{flatbuffers:()=>r});var r={};r.Offset,r.Table,r.SIZEOF_SHORT=2,r.SIZEOF_INT=4,r.FILE_IDENTIFIER_LENGTH=4,r.SIZE_PREFIX_LENGTH=4,r.Encoding={UTF8_BYTES:1,UTF16_STRING:2},r.int32=new Int32Array(2),r.float32=new Float32Array(r.int32.buffer),r.float64=new Float64Array(r.int32.buffer),r.isLittleEndian=1===new Uint16Array(new Uint8Array([1,0]).buffer)[0],r.Long=function(e,t){this.low=0|e,this.high=0|t},r.Long.create=function(e,t){return 0==e&&0==t?r.Long.ZERO:new r.Long(e,t)},r.Long.prototype.toFloat64=function(){return(this.low>>>0)+4294967296*this.high},r.Long.prototype.equals=function(e){return this.low==e.low&&this.high==e.high},r.Long.ZERO=new r.Long(0,0),r.Builder=function(e){if(e)t=e;else var t=1024;this.bb=r.ByteBuffer.allocate(t),this.space=t,this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1},r.Builder.prototype.clear=function(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1},r.Builder.prototype.forceDefaults=function(e){this.force_defaults=e},r.Builder.prototype.dataBuffer=function(){return this.bb},r.Builder.prototype.asUint8Array=function(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())},r.Builder.prototype.prep=function(e,t){e>this.minalign&&(this.minalign=e);for(var n=1+~(this.bb.capacity()-this.space+t)&e-1;this.space<n+e+t;){var o=this.bb.capacity();this.bb=r.Builder.growByteBuffer(this.bb),this.space+=this.bb.capacity()-o}this.pad(n)},r.Builder.prototype.pad=function(e){for(var t=0;t<e;t++)this.bb.writeInt8(--this.space,0)},r.Builder.prototype.writeInt8=function(e){this.bb.writeInt8(this.space-=1,e)},r.Builder.prototype.writeInt16=function(e){this.bb.writeInt16(this.space-=2,e)},r.Builder.prototype.writeInt32=function(e){this.bb.writeInt32(this.space-=4,e)},r.Builder.prototype.writeInt64=function(e){this.bb.writeInt64(this.space-=8,e)},r.Builder.prototype.writeFloat32=function(e){this.bb.writeFloat32(this.space-=4,e)},r.Builder.prototype.writeFloat64=function(e){this.bb.writeFloat64(this.space-=8,e)},r.Builder.prototype.addInt8=function(e){this.prep(1,0),this.writeInt8(e)},r.Builder.prototype.addInt16=function(e){this.prep(2,0),this.writeInt16(e)},r.Builder.prototype.addInt32=function(e){this.prep(4,0),this.writeInt32(e)},r.Builder.prototype.addInt64=function(e){this.prep(8,0),this.writeInt64(e)},r.Builder.prototype.addFloat32=function(e){this.prep(4,0),this.writeFloat32(e)},r.Builder.prototype.addFloat64=function(e){this.prep(8,0),this.writeFloat64(e)},r.Builder.prototype.addFieldInt8=function(e,t,n){(this.force_defaults||t!=n)&&(this.addInt8(t),this.slot(e))},r.Builder.prototype.addFieldInt16=function(e,t,n){(this.force_defaults||t!=n)&&(this.addInt16(t),this.slot(e))},r.Builder.prototype.addFieldInt32=function(e,t,n){(this.force_defaults||t!=n)&&(this.addInt32(t),this.slot(e))},r.Builder.prototype.addFieldInt64=function(e,t,n){!this.force_defaults&&t.equals(n)||(this.addInt64(t),this.slot(e))},r.Builder.prototype.addFieldFloat32=function(e,t,n){(this.force_defaults||t!=n)&&(this.addFloat32(t),this.slot(e))},r.Builder.prototype.addFieldFloat64=function(e,t,n){(this.force_defaults||t!=n)&&(this.addFloat64(t),this.slot(e))},r.Builder.prototype.addFieldOffset=function(e,t,n){(this.force_defaults||t!=n)&&(this.addOffset(t),this.slot(e))},r.Builder.prototype.addFieldStruct=function(e,t,n){t!=n&&(this.nested(t),this.slot(e))},r.Builder.prototype.nested=function(e){if(e!=this.offset())throw new Error("FlatBuffers: struct must be serialized inline.")},r.Builder.prototype.notNested=function(){if(this.isNested)throw new Error("FlatBuffers: object serialization must not be nested.")},r.Builder.prototype.slot=function(e){this.vtable[e]=this.offset()},r.Builder.prototype.offset=function(){return this.bb.capacity()-this.space},r.Builder.growByteBuffer=function(e){var t=e.capacity();if(3221225472&t)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");var n=t<<1,o=r.ByteBuffer.allocate(n);return o.setPosition(n-t),o.bytes().set(e.bytes(),n-t),o},r.Builder.prototype.addOffset=function(e){this.prep(r.SIZEOF_INT,0),this.writeInt32(this.offset()-e+r.SIZEOF_INT)},r.Builder.prototype.startObject=function(e){this.notNested(),null==this.vtable&&(this.vtable=[]),this.vtable_in_use=e;for(var t=0;t<e;t++)this.vtable[t]=0;this.isNested=!0,this.object_start=this.offset()},r.Builder.prototype.endObject=function(){if(null==this.vtable||!this.isNested)throw new Error("FlatBuffers: endObject called without startObject");this.addInt32(0);for(var e=this.offset(),t=this.vtable_in_use-1;t>=0&&0==this.vtable[t];t--);for(var n=t+1;t>=0;t--)this.addInt16(0!=this.vtable[t]?e-this.vtable[t]:0);this.addInt16(e-this.object_start);var o=(n+2)*r.SIZEOF_SHORT;this.addInt16(o);var a=0,i=this.space;e:for(t=0;t<this.vtables.length;t++){var s=this.bb.capacity()-this.vtables[t];if(o==this.bb.readInt16(s)){for(var l=r.SIZEOF_SHORT;l<o;l+=r.SIZEOF_SHORT)if(this.bb.readInt16(i+l)!=this.bb.readInt16(s+l))continue e;a=this.vtables[t];break}}return a?(this.space=this.bb.capacity()-e,this.bb.writeInt32(this.space,a-e)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-e,this.offset()-e)),this.isNested=!1,e},r.Builder.prototype.finish=function(e,t,n){var o=n?r.SIZE_PREFIX_LENGTH:0;if(t){var a=t;if(this.prep(this.minalign,r.SIZEOF_INT+r.FILE_IDENTIFIER_LENGTH+o),a.length!=r.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+r.FILE_IDENTIFIER_LENGTH);for(var i=r.FILE_IDENTIFIER_LENGTH-1;i>=0;i--)this.writeInt8(a.charCodeAt(i))}this.prep(this.minalign,r.SIZEOF_INT+o),this.addOffset(e),o&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)},r.Builder.prototype.finishSizePrefixed=function(e,t){this.finish(e,t,!0)},r.Builder.prototype.requiredField=function(e,t){var n=this.bb.capacity()-e,r=n-this.bb.readInt32(n);if(0==this.bb.readInt16(r+t))throw new Error("FlatBuffers: field "+t+" must be set")},r.Builder.prototype.startVector=function(e,t,n){this.notNested(),this.vector_num_elems=t,this.prep(r.SIZEOF_INT,e*t),this.prep(n,e*t)},r.Builder.prototype.endVector=function(){return this.writeInt32(this.vector_num_elems),this.offset()},r.Builder.prototype.createString=function(e){if(e instanceof Uint8Array)var t=e;else{t=[];for(var n=0;n<e.length;){var r,o=e.charCodeAt(n++);(r=o<55296||o>=56320?o:(o<<10)+e.charCodeAt(n++)+-56613888)<128?t.push(r):(r<2048?t.push(r>>6&31|192):(r<65536?t.push(r>>12&15|224):t.push(r>>18&7|240,r>>12&63|128),t.push(r>>6&63|128)),t.push(63&r|128))}}this.addInt8(0),this.startVector(1,t.length,1),this.bb.setPosition(this.space-=t.length),n=0;for(var a=this.space,i=this.bb.bytes();n<t.length;n++)i[a++]=t[n];return this.endVector()},r.Builder.prototype.createLong=function(e,t){return r.Long.create(e,t)},r.ByteBuffer=function(e){this.bytes_=e,this.position_=0},r.ByteBuffer.allocate=function(e){return new r.ByteBuffer(new Uint8Array(e))},r.ByteBuffer.prototype.clear=function(){this.position_=0},r.ByteBuffer.prototype.bytes=function(){return this.bytes_},r.ByteBuffer.prototype.position=function(){return this.position_},r.ByteBuffer.prototype.setPosition=function(e){this.position_=e},r.ByteBuffer.prototype.capacity=function(){return this.bytes_.length},r.ByteBuffer.prototype.readInt8=function(e){return this.readUint8(e)<<24>>24},r.ByteBuffer.prototype.readUint8=function(e){return this.bytes_[e]},r.ByteBuffer.prototype.readInt16=function(e){return this.readUint16(e)<<16>>16},r.ByteBuffer.prototype.readUint16=function(e){return this.bytes_[e]|this.bytes_[e+1]<<8},r.ByteBuffer.prototype.readInt32=function(e){return this.bytes_[e]|this.bytes_[e+1]<<8|this.bytes_[e+2]<<16|this.bytes_[e+3]<<24},r.ByteBuffer.prototype.readUint32=function(e){return this.readInt32(e)>>>0},r.ByteBuffer.prototype.readInt64=function(e){return new r.Long(this.readInt32(e),this.readInt32(e+4))},r.ByteBuffer.prototype.readUint64=function(e){return new r.Long(this.readUint32(e),this.readUint32(e+4))},r.ByteBuffer.prototype.readFloat32=function(e){return r.int32[0]=this.readInt32(e),r.float32[0]},r.ByteBuffer.prototype.readFloat64=function(e){return r.int32[r.isLittleEndian?0:1]=this.readInt32(e),r.int32[r.isLittleEndian?1:0]=this.readInt32(e+4),r.float64[0]},r.ByteBuffer.prototype.writeInt8=function(e,t){this.bytes_[e]=t},r.ByteBuffer.prototype.writeUint8=function(e,t){this.bytes_[e]=t},r.ByteBuffer.prototype.writeInt16=function(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8},r.ByteBuffer.prototype.writeUint16=function(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8},r.ByteBuffer.prototype.writeInt32=function(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24},r.ByteBuffer.prototype.writeUint32=function(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24},r.ByteBuffer.prototype.writeInt64=function(e,t){this.writeInt32(e,t.low),this.writeInt32(e+4,t.high)},r.ByteBuffer.prototype.writeUint64=function(e,t){this.writeUint32(e,t.low),this.writeUint32(e+4,t.high)},r.ByteBuffer.prototype.writeFloat32=function(e,t){r.float32[0]=t,this.writeInt32(e,r.int32[0])},r.ByteBuffer.prototype.writeFloat64=function(e,t){r.float64[0]=t,this.writeInt32(e,r.int32[r.isLittleEndian?0:1]),this.writeInt32(e+4,r.int32[r.isLittleEndian?1:0])},r.ByteBuffer.prototype.getBufferIdentifier=function(){if(this.bytes_.length<this.position_+r.SIZEOF_INT+r.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");for(var e="",t=0;t<r.FILE_IDENTIFIER_LENGTH;t++)e+=String.fromCharCode(this.readInt8(this.position_+r.SIZEOF_INT+t));return e},r.ByteBuffer.prototype.__offset=function(e,t){var n=e-this.readInt32(e);return t<this.readInt16(n)?this.readInt16(n+t):0},r.ByteBuffer.prototype.__union=function(e,t){return e.bb_pos=t+this.readInt32(t),e.bb=this,e},r.ByteBuffer.prototype.__string=function(e,t){e+=this.readInt32(e);var n=this.readInt32(e),o="",a=0;if(e+=r.SIZEOF_INT,t===r.Encoding.UTF8_BYTES)return this.bytes_.subarray(e,e+n);for(;a<n;){var i,s=this.readUint8(e+a++);if(s<192)i=s;else{var l=this.readUint8(e+a++);if(s<224)i=(31&s)<<6|63&l;else{var u=this.readUint8(e+a++);i=s<240?(15&s)<<12|(63&l)<<6|63&u:(7&s)<<18|(63&l)<<12|(63&u)<<6|63&this.readUint8(e+a++)}}i<65536?o+=String.fromCharCode(i):(i-=65536,o+=String.fromCharCode(55296+(i>>10),56320+(1023&i)))}return o},r.ByteBuffer.prototype.__indirect=function(e){return e+this.readInt32(e)},r.ByteBuffer.prototype.__vector=function(e){return e+this.readInt32(e)+r.SIZEOF_INT},r.ByteBuffer.prototype.__vector_len=function(e){return this.readInt32(e+this.readInt32(e))},r.ByteBuffer.prototype.__has_identifier=function(e){if(e.length!=r.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+r.FILE_IDENTIFIER_LENGTH);for(var t=0;t<r.FILE_IDENTIFIER_LENGTH;t++)if(e.charCodeAt(t)!=this.readInt8(this.position_+r.SIZEOF_INT+t))return!1;return!0},r.ByteBuffer.prototype.createLong=function(e,t){return r.Long.create(e,t)}}},__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]={exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.exports}__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})};var __webpack_exports__=__webpack_require__(6018);return __webpack_exports__})(),module.exports=e(require$$0)})(ortWeb_min);var ortWeb_minExports=ortWeb_min.exports,assetPath={};Object.defineProperty(assetPath,"__esModule",{value:!0}),assetPath.baseAssetPath=void 0;const isWeb="undefined"!=typeof window&&void 0!==window.document,currentScript=isWeb?window.document.currentScript:null;let basePath="/";currentScript&&(basePath=currentScript.src.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")),assetPath.baseAssetPath=basePath;var defaultModelFetcher$1={};Object.defineProperty(defaultModelFetcher$1,"__esModule",{value:!0}),defaultModelFetcher$1.defaultModelFetcher=void 0;const defaultModelFetcher=e=>fetch(e).then(e=>e.arrayBuffer());defaultModelFetcher$1.defaultModelFetcher=defaultModelFetcher;var frameProcessor={},logging={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.log=e.LOG_PREFIX=void 0,e.LOG_PREFIX="[VAD]";const t=["error","debug","warn"].reduce((t,n)=>(t[n]=function(t){return(...n)=>{console[t](e.LOG_PREFIX,...n)}}(n),t),{});e.log=t}(logging);var messages={},Message,Message2;Object.defineProperty(messages,"__esModule",{value:!0}),messages.Message=void 0,Message2=Message||(messages.Message=Message={}),Message2.AudioFrame="AUDIO_FRAME",Message2.SpeechStart="SPEECH_START",Message2.VADMisfire="VAD_MISFIRE",Message2.SpeechEnd="SPEECH_END",Message2.SpeechStop="SPEECH_STOP",Object.defineProperty(frameProcessor,"__esModule",{value:!0}),frameProcessor.FrameProcessor=frameProcessor.validateOptions=frameProcessor.defaultV5FrameProcessorOptions=frameProcessor.defaultLegacyFrameProcessorOptions=void 0;const logging_1$3=logging,messages_1=messages,RECOMMENDED_FRAME_SAMPLES=[512,1024,1536];function validateOptions(e){RECOMMENDED_FRAME_SAMPLES.includes(e.frameSamples)||logging_1$3.log.warn("You are using an unusual frame size"),(e.positiveSpeechThreshold<0||e.positiveSpeechThreshold>1)&&logging_1$3.log.error("positiveSpeechThreshold should be a number between 0 and 1"),(e.negativeSpeechThreshold<0||e.negativeSpeechThreshold>e.positiveSpeechThreshold)&&logging_1$3.log.error("negativeSpeechThreshold should be between 0 and positiveSpeechThreshold"),e.preSpeechPadFrames<0&&logging_1$3.log.error("preSpeechPadFrames should be positive"),e.redemptionFrames<0&&logging_1$3.log.error("redemptionFrames should be positive")}frameProcessor.defaultLegacyFrameProcessorOptions={positiveSpeechThreshold:.5,negativeSpeechThreshold:.35,preSpeechPadFrames:1,redemptionFrames:8,frameSamples:1536,minSpeechFrames:3,submitUserSpeechOnPause:!1},frameProcessor.defaultV5FrameProcessorOptions={positiveSpeechThreshold:.5,negativeSpeechThreshold:.35,preSpeechPadFrames:3,redemptionFrames:24,frameSamples:512,minSpeechFrames:9,submitUserSpeechOnPause:!1},frameProcessor.validateOptions=validateOptions;const concatArrays=e=>{const t=e.reduce((e,t)=>(e.push(e.at(-1)+t.length),e),[0]),n=new Float32Array(t.at(-1));return e.forEach((e,r)=>{const o=t[r];n.set(e,o)}),n};class FrameProcessor{constructor(e,t,n){this.modelProcessFunc=e,this.modelResetFunc=t,this.options=n,this.speaking=!1,this.redemptionCounter=0,this.active=!1,this.reset=()=>{this.speaking=!1,this.audioBuffer=[],this.modelResetFunc(),this.redemptionCounter=0},this.pause=()=>(this.active=!1,this.options.submitUserSpeechOnPause?this.endSegment():(this.reset(),{})),this.resume=()=>{this.active=!0},this.endSegment=()=>{const e=this.audioBuffer;this.audioBuffer=[];const t=this.speaking;this.reset();const n=e.reduce((e,t)=>e+ +t.isSpeech,0);if(t){if(n>=this.options.minSpeechFrames){const t=concatArrays(e.map(e=>e.frame));return{msg:messages_1.Message.SpeechEnd,audio:t}}return{msg:messages_1.Message.VADMisfire}}return{}},this.process=async e=>{if(!this.active)return{};const t=await this.modelProcessFunc(e);if(this.audioBuffer.push({frame:e,isSpeech:t.isSpeech>=this.options.positiveSpeechThreshold}),t.isSpeech>=this.options.positiveSpeechThreshold&&this.redemptionCounter&&(this.redemptionCounter=0),t.isSpeech>=this.options.positiveSpeechThreshold&&!this.speaking)return this.speaking=!0,{probs:t,msg:messages_1.Message.SpeechStart,frame:e};if(t.isSpeech<this.options.negativeSpeechThreshold&&this.speaking&&++this.redemptionCounter>=this.options.redemptionFrames){this.redemptionCounter=0,this.speaking=!1;const n=this.audioBuffer;this.audioBuffer=[];if(n.reduce((e,t)=>e+ +t.isSpeech,0)>=this.options.minSpeechFrames){const r=concatArrays(n.map(e=>e.frame));return{probs:t,msg:messages_1.Message.SpeechEnd,audio:r,frame:e}}return{probs:t,msg:messages_1.Message.VADMisfire,frame:e}}if(!this.speaking)for(;this.audioBuffer.length>this.options.preSpeechPadFrames;)this.audioBuffer.shift();return{probs:t,frame:e}},this.audioBuffer=[],this.reset()}}frameProcessor.FrameProcessor=FrameProcessor;var nonRealTimeVad={},models={},common={};Object.defineProperty(common,"__esModule",{value:!0});var legacy={},_a$1;Object.defineProperty(legacy,"__esModule",{value:!0}),legacy.SileroLegacy=void 0;const logging_1$2=logging;class SileroLegacy{constructor(e,t,n,r,o){this.ortInstance=e,this._session=t,this._h=n,this._c=r,this._sr=o,this.reset_state=()=>{const e=Array(128).fill(0);this._h=new this.ortInstance.Tensor("float32",e,[2,1,64]),this._c=new this.ortInstance.Tensor("float32",e,[2,1,64])},this.process=async e=>{var t;const n={input:new this.ortInstance.Tensor("float32",e,[1,e.length]),h:this._h,c:this._c,sr:this._sr},r=await this._session.run(n);this._h=r.hn,this._c=r.cn;const[o]=null==(t=r.output)?void 0:t.data;return{notSpeech:1-o,isSpeech:o}}}}legacy.SileroLegacy=SileroLegacy,_a$1=SileroLegacy,SileroLegacy.new=async(e,t)=>{logging_1$2.log.debug("initializing vad");const n=await t(),r=await e.InferenceSession.create(n),o=new e.Tensor("int64",[16000n]),a=Array(128).fill(0),i=new e.Tensor("float32",a,[2,1,64]),s=new e.Tensor("float32",a,[2,1,64]);logging_1$2.log.debug("vad is initialized");return new _a$1(e,r,i,s,o)};var v5={},_a;Object.defineProperty(v5,"__esModule",{value:!0}),v5.SileroV5=void 0;const logging_1$1=logging;function getNewState(e){const t=Array(256).fill(0);return new e.Tensor("float32",t,[2,1,128])}class SileroV5{constructor(e,t,n,r){this._session=e,this._state=t,this._sr=n,this.ortInstance=r,this.reset_state=()=>{this._state=getNewState(this.ortInstance)},this.process=async e=>{var t;const n={input:new this.ortInstance.Tensor("float32",e,[1,e.length]),state:this._state,sr:this._sr},r=await this._session.run(n);this._state=r.stateN;const[o]=null==(t=r.output)?void 0:t.data;return{notSpeech:1-o,isSpeech:o}}}}v5.SileroV5=SileroV5,_a=SileroV5,SileroV5.new=async(e,t)=>{logging_1$1.log.debug("Loading VAD...");const n=await t(),r=await e.InferenceSession.create(n),o=new e.Tensor("int64",[16000n]),a=getNewState(e);return logging_1$1.log.debug("...finished loading VAD"),new _a(r,a,o,e)},function(e){var t=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=commonjsGlobal&&commonjsGlobal.__exportStar||function(e,n){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.SileroV5=e.SileroLegacy=void 0,n(common,e);var r=legacy;Object.defineProperty(e,"SileroLegacy",{enumerable:!0,get:function(){return r.SileroLegacy}});var o=v5;Object.defineProperty(e,"SileroV5",{enumerable:!0,get:function(){return o.SileroV5}})}(models);var resampler={};Object.defineProperty(resampler,"__esModule",{value:!0}),resampler.Resampler=void 0;const logging_1=logging;class Resampler{constructor(e){this.options=e,this.process=e=>{const t=[];for(const n of e)for(this.inputBuffer.push(n);this.hasEnoughDataForFrame();){const e=this.generateOutputFrame();t.push(e)}return t},this.stream=async function*(e){for(const t of e)for(this.inputBuffer.push(t);this.hasEnoughDataForFrame();){const e=this.generateOutputFrame();yield e}},e.nativeSampleRate<16e3&&logging_1.log.error("nativeSampleRate is too low. Should have 16000 = targetSampleRate <= nativeSampleRate"),this.inputBuffer=[]}hasEnoughDataForFrame(){return this.inputBuffer.length*this.options.targetSampleRate/this.options.nativeSampleRate>=this.options.targetFrameSize}generateOutputFrame(){const e=new Float32Array(this.options.targetFrameSize);let t=0,n=0;for(;t<this.options.targetFrameSize;){let r=0,o=0;for(;n<Math.min(this.inputBuffer.length,(t+1)*this.options.nativeSampleRate/this.options.targetSampleRate);){const e=this.inputBuffer[n];void 0!==e&&(r+=e,o++),n++}e[t]=r/o,t++}return this.inputBuffer=this.inputBuffer.slice(n),e}}resampler.Resampler=Resampler,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.PlatformAgnosticNonRealTimeVAD=e.defaultNonRealTimeVADOptions=void 0;const t=frameProcessor,n=messages,r=models,o=resampler;e.defaultNonRealTimeVADOptions={...t.defaultLegacyFrameProcessorOptions,ortConfig:void 0};e.PlatformAgnosticNonRealTimeVAD=class{static async _new(t,n,r={}){const o={...e.defaultNonRealTimeVADOptions,...r};void 0!==o.ortConfig&&o.ortConfig(n);const a=new this(t,n,o);return await a.init(),a}constructor(e,a,i){this.modelFetcher=e,this.ort=a,this.options=i,this.init=async()=>{const e=await r.SileroLegacy.new(this.ort,this.modelFetcher);this.frameProcessor=new t.FrameProcessor(e.process,e.reset_state,{frameSamples:this.options.frameSamples,positiveSpeechThreshold:this.options.positiveSpeechThreshold,negativeSpeechThreshold:this.options.negativeSpeechThreshold,redemptionFrames:this.options.redemptionFrames,preSpeechPadFrames:this.options.preSpeechPadFrames,minSpeechFrames:this.options.minSpeechFrames,submitUserSpeechOnPause:this.options.submitUserSpeechOnPause}),this.frameProcessor.resume()},this.run=async function*(e,t){const r={nativeSampleRate:t,targetSampleRate:16e3,targetFrameSize:this.options.frameSamples},a=new o.Resampler(r);let i=0,s=0,l=0;for await(const o of a.stream(e)){const{msg:e,audio:t}=await this.frameProcessor.process(o);switch(e){case n.Message.SpeechStart:i=l*this.options.frameSamples/16;break;case n.Message.SpeechEnd:s=(l+1)*this.options.frameSamples/16,yield{audio:t,start:i,end:s}}l++}const{msg:u,audio:c}=this.frameProcessor.endSegment();u==n.Message.SpeechEnd&&(yield{audio:c,start:i,end:l*this.options.frameSamples/16})},(0,t.validateOptions)(i)}}}(nonRealTimeVad);var utils={};function minFramesForTargetMS(e,t,n=16e3){return Math.ceil(e*n/1e3/t)}function arrayBufferToBase64(e){const t=new Uint8Array(e),n=t.byteLength,r=new Array(n);for(var o=0;o<n;o++){const e=t[o];if(void 0===e)break;r[o]=String.fromCharCode(e)}return btoa(r.join(""))}function encodeWAV(e,t=3,n=16e3,r=1,o=32){var a=o/8,i=r*a,s=new ArrayBuffer(44+e.length*a),l=new DataView(s);return writeString(l,0,"RIFF"),l.setUint32(4,36+e.length*a,!0),writeString(l,8,"WAVE"),writeString(l,12,"fmt "),l.setUint32(16,16,!0),l.setUint16(20,t,!0),l.setUint16(22,r,!0),l.setUint32(24,n,!0),l.setUint32(28,n*i,!0),l.setUint16(32,i,!0),l.setUint16(34,o,!0),writeString(l,36,"data"),l.setUint32(40,e.length*a,!0),1===t?floatTo16BitPCM(l,44,e):writeFloat32(l,44,e),s}function writeFloat32(e,t,n){for(var r=0;r<n.length;r++,t+=4)e.setFloat32(t,n[r],!0)}function floatTo16BitPCM(e,t,n){for(var r=0;r<n.length;r++,t+=2){var o=Math.max(-1,Math.min(1,n[r]));e.setInt16(t,o<0?32768*o:32767*o,!0)}}function writeString(e,t,n){for(var r=0;r<n.length;r++)e.setUint8(t+r,n.charCodeAt(r))}async function audioFileToArray(e){const t=new OfflineAudioContext(1,1,44100),n=new FileReader;let r=null;if(await new Promise(o=>{n.addEventListener("loadend",e=>{const a=n.result;t.decodeAudioData(a,e=>{r=e,t.startRendering().then(e=>{console.log("Rendering completed successfully"),o()}).catch(e=>{console.error(`Rendering failed: ${e}`)})},e=>{console.log(`Error with decoding audio data: ${e}`)})}),n.readAsArrayBuffer(e)}),null===r)throw Error("some shit");let o=r,a=new Float32Array(o.length);for(let i=0;i<o.length;i++)for(let e=0;e<o.numberOfChannels;e++)a[i]+=o.getChannelData(e)[i];return{audio:a,sampleRate:o.sampleRate}}Object.defineProperty(utils,"__esModule",{value:!0}),utils.audioFileToArray=utils.encodeWAV=utils.arrayBufferToBase64=utils.minFramesForTargetMS=void 0,utils.minFramesForTargetMS=minFramesForTargetMS,utils.arrayBufferToBase64=arrayBufferToBase64,utils.encodeWAV=encodeWAV,utils.audioFileToArray=audioFileToArray;var realTimeVad={};!function(e){var t=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=commonjsGlobal&&commonjsGlobal.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=commonjsGlobal&&commonjsGlobal.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var o in e)"default"!==o&&Object.prototype.hasOwnProperty.call(e,o)&&t(r,e,o);return n(r,e),r};Object.defineProperty(e,"__esModule",{value:!0}),e.AudioNodeVAD=e.MicVAD=e.getDefaultRealTimeVADOptions=e.ort=e.DEFAULT_MODEL=void 0;const o=r(ortWeb_minExports),a=defaultModelFetcher$1,i=frameProcessor,s=logging,l=messages,u=models,c=resampler;e.DEFAULT_MODEL="legacy",e.ort=o;e.getDefaultRealTimeVADOptions=t=>({..."v5"===t?i.defaultV5FrameProcessorOptions:i.defaultLegacyFrameProcessorOptions,onFrameProcessed:e=>{},onVADMisfire:()=>{s.log.debug("VAD misfire")},onSpeechStart:()=>{s.log.debug("Detected speech start")},onSpeechEnd:()=>{s.log.debug("Detected speech end")},baseAssetPath:"https://cdn.jsdelivr.net/npm/@ricky0123/vad-web@0.0.22/dist/",onnxWASMBasePath:"https://cdn.jsdelivr.net/npm/onnxruntime-web@1.14.0/dist/",stream:void 0,ortConfig:void 0,model:e.DEFAULT_MODEL,workletOptions:{}});class d{static async new(t={}){const n={...(0,e.getDefaultRealTimeVADOptions)(t.model??e.DEFAULT_MODEL),...t};let r;(0,i.validateOptions)(n),r=void 0===n.stream?await navigator.mediaDevices.getUserMedia({audio:{...n.additionalAudioConstraints,channelCount:1,echoCancellation:!0,autoGainControl:!0,noiseSuppression:!0}}):n.stream;const o=new AudioContext,a=new MediaStreamAudioSourceNode(o,{mediaStream:r}),s=await f.new(o,n);return s.receive(a),new d(n,o,r,s,a)}constructor(e,t,n,r,o,a=!1){this.options=e,this.audioContext=t,this.stream=n,this.audioNodeVAD=r,this.sourceNode=o,this.listening=a,this.pause=()=>{this.audioNodeVAD.pause(),this.listening=!1},this.start=()=>{this.audioNodeVAD.start(),this.listening=!0},this.destroy=()=>{this.listening&&this.pause(),void 0===this.options.stream&&this.stream.getTracks().forEach(e=>e.stop()),this.sourceNode.disconnect(),this.audioNodeVAD.destroy(),this.audioContext.close()}}}e.MicVAD=d;class f{static async new(t,n={}){const r={...(0,e.getDefaultRealTimeVADOptions)(n.model??e.DEFAULT_MODEL),...n};(0,i.validateOptions)(r),e.ort.env.wasm.wasmPaths=r.onnxWASMBasePath,void 0!==r.ortConfig&&r.ortConfig(e.ort);const o="v5"===r.model?"silero_vad_v5.onnx":"silero_vad_legacy.onnx",s=r.baseAssetPath+o,l="v5"===r.model?u.SileroV5.new:u.SileroLegacy.new;let c;try{c=await l(e.ort,()=>(0,a.defaultModelFetcher)(s))}catch(h){throw console.error(`Encountered an error while loading model file ${s}`),h}const d=new i.FrameProcessor(c.process,c.reset_state,{frameSamples:r.frameSamples,positiveSpeechThreshold:r.positiveSpeechThreshold,negativeSpeechThreshold:r.negativeSpeechThreshold,redemptionFrames:r.redemptionFrames,preSpeechPadFrames:r.preSpeechPadFrames,minSpeechFrames:r.minSpeechFrames,submitUserSpeechOnPause:r.submitUserSpeechOnPause}),p=new f(t,r,d);return await p.setupAudioNode(),p}constructor(e,t,n){this.ctx=e,this.options=t,this.bufferIndex=0,this.pause=()=>{const e=this.frameProcessor.pause();this.handleFrameProcessorEvent(e)},this.start=()=>{this.frameProcessor.resume()},this.receive=e=>{e.connect(this.audioNode)},this.processFrame=async e=>{const t=await this.frameProcessor.process(e);this.handleFrameProcessorEvent(t)},this.handleFrameProcessorEvent=e=>{switch(void 0!==e.probs&&this.options.onFrameProcessed(e.probs,e.frame),e.msg){case l.Message.SpeechStart:this.options.onSpeechStart();break;case l.Message.VADMisfire:this.options.onVADMisfire();break;case l.Message.SpeechEnd:this.options.onSpeechEnd(e.audio)}},this.destroy=()=>{var e;this.audioNode instanceof AudioWorkletNode&&this.audioNode.port.postMessage({message:l.Message.SpeechStop}),this.audioNode.disconnect(),null==(e=this.gainNode)||e.disconnect()},this.frameProcessor=n}async setupAudioNode(){if("audioWorklet"in this.ctx&&"function"==typeof AudioWorkletNode)try{const e=this.options.baseAssetPath+"vad.worklet.bundle.min.js";await this.ctx.audioWorklet.addModule(e);const t=this.options.workletOptions??{};return t.processorOptions={...t.processorOptions??{},frameSamples:this.options.frameSamples},this.audioNode=new AudioWorkletNode(this.ctx,"vad-helper-worklet",t),void(this.audioNode.port.onmessage=async e=>{var t;if((null==(t=e.data)?void 0:t.message)===l.Message.AudioFrame){let t=e.data.data;t instanceof ArrayBuffer||(t=new ArrayBuffer(e.data.data.byteLength),new Uint8Array(t).set(new Uint8Array(e.data.data)));const n=new Float32Array(t);await this.processFrame(n)}})}catch(t){console.log("AudioWorklet setup failed, falling back to ScriptProcessor",t)}this.resampler=new c.Resampler({nativeSampleRate:this.ctx.sampleRate,targetSampleRate:16e3,targetFrameSize:this.options.frameSamples??480});this.audioNode=this.ctx.createScriptProcessor(4096,1,1),this.gainNode=this.ctx.createGain(),this.gainNode.gain.value=0;let e=!1;this.audioNode.onaudioprocess=async t=>{if(!e){e=!0;try{const e=t.inputBuffer.getChannelData(0);if(t.outputBuffer.getChannelData(0).fill(0),this.resampler){const t=this.resampler.process(e);for(const e of t)await this.processFrame(e)}}catch(n){console.error("Error processing audio:",n)}finally{e=!1}}},this.audioNode.connect(this.gainNode),this.gainNode.connect(this.ctx.destination)}}e.AudioNodeVAD=f}(realTimeVad),function(e){var t=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=commonjsGlobal&&commonjsGlobal.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=commonjsGlobal&&commonjsGlobal.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var o in e)"default"!==o&&Object.prototype.hasOwnProperty.call(e,o)&&t(r,e,o);return n(r,e),r};Object.defineProperty(e,"__esModule",{value:!0}),e.NonRealTimeVAD=e.Message=e.FrameProcessor=e.getDefaultRealTimeVADOptions=e.MicVAD=e.DEFAULT_MODEL=e.AudioNodeVAD=e.utils=e.defaultNonRealTimeVADOptions=void 0;const o=r(ortWeb_minExports),a=assetPath,i=defaultModelFetcher$1,s=frameProcessor;Object.defineProperty(e,"FrameProcessor",{enumerable:!0,get:function(){return s.FrameProcessor}});const l=messages;Object.defineProperty(e,"Message",{enumerable:!0,get:function(){return l.Message}});const u=nonRealTimeVad,c=utils;e.defaultNonRealTimeVADOptions={modelURL:a.baseAssetPath+"silero_vad_legacy.onnx",modelFetcher:i.defaultModelFetcher};class d extends u.PlatformAgnosticNonRealTimeVAD{static async new(t={}){const{modelURL:n,modelFetcher:r}={...e.defaultNonRealTimeVADOptions,...t};return await this._new(()=>r(n),o,t)}}e.NonRealTimeVAD=d,e.utils={audioFileToArray:c.audioFileToArray,minFramesForTargetMS:c.minFramesForTargetMS,arrayBufferToBase64:c.arrayBufferToBase64,encodeWAV:c.encodeWAV};var f=realTimeVad;Object.defineProperty(e,"AudioNodeVAD",{enumerable:!0,get:function(){return f.AudioNodeVAD}}),Object.defineProperty(e,"DEFAULT_MODEL",{enumerable:!0,get:function(){return f.DEFAULT_MODEL}}),Object.defineProperty(e,"MicVAD",{enumerable:!0,get:function(){return f.MicVAD}}),Object.defineProperty(e,"getDefaultRealTimeVADOptions",{enumerable:!0,get:function(){return f.getDefaultRealTimeVADOptions}})}(dist);class VadWebClient{constructor(e,t,n,r,o,a){this.micStream=null,this.is_vad_loading=!0,this.noSpeechStartTime=null,this.recording_started=!1,this.lastWarningTime=null,this.warningCooldownPeriod=2e3,this.vad_past=[],this.last_clip_index=0,this.clip_points=[0],this.sil_duration_acc=0,this.pref_length_samples=e*r,this.desp_length_samples=t*r,this.max_length_samples=n*r,this.shor_thsld=SHORT_SILENCE_THRESHOLD*r,this.long_thsld=LONG_SILENCE_THRESHOLD*r,this.frame_size=FRAME_SIZE,this.speech_pad_frames=PRE_SPEECH_PAD_FRAMES,this.micVad={},this.audioFileManager=o,this.audioBufferManager=a}setDependencies(e,t){this.audioFileManager=e,this.audioBufferManager=t}setCallbacks(e,t,n){this.onVadFramesCallback=e,this.onVadFrameProcessedCallback=t,this.onUserSpeechCallback=n}stopMicStream(){var e,t;try{null==(t=null==(e=this.micStream)?void 0:e.getTracks)||t.call(e).forEach(e=>e.stop())}catch{}finally{this.micStream=null}}checkNoSpeech(e){if(!this.recording_started)return;const t=Date.now();if(0===e)if(null===this.noSpeechStartTime)this.noSpeechStartTime=t;else{t-this.noSpeechStartTime>=1e4&&(null===this.lastWarningTime||t-this.lastWarningTime>=this.warningCooldownPeriod)&&(this.onVadFramesCallback&&this.onVadFramesCallback({message:"No audio detected for a while. Please talk or stop the recording if done.",error_code:ErrorCode.AUDIO_QUALITY_POOR,status_code:HttpStatus.BAD_REQUEST}),this.lastWarningTime=t,this.noSpeechStartTime=t)}else this.noSpeechStartTime=null,this.lastWarningTime=null,this.onVadFramesCallback&&this.onVadFramesCallback({message:"Audio captured. Recording continues.",status_code:HttpStatus.OK})}getMicVad(){return this.micVad}isVadLoading(){return this.is_vad_loading}processVadFrame(e){let t=!1;this.vad_past.length>0&&(0===e&&(this.sil_duration_acc+=1),1===e&&(this.sil_duration_acc=0));const n=(this.vad_past.length-this.last_clip_index)*this.frame_size,r=this.sil_duration_acc*this.frame_size;return n>this.pref_length_samples&&r>this.long_thsld&&(this.last_clip_index=this.vad_past.length-Math.min(Math.floor(this.sil_duration_acc/2),5),this.clip_points.push(this.last_clip_index),this.sil_duration_acc=0,t=!0),n>this.desp_length_samples&&r>this.shor_thsld&&(this.last_clip_index=this.vad_past.length-Math.min(Math.floor(this.sil_duration_acc/2),5),this.clip_points.push(this.last_clip_index),this.sil_duration_acc=0,t=!0),n>=this.max_length_samples&&(this.last_clip_index=this.vad_past.length,this.clip_points.push(this.last_clip_index),this.sil_duration_acc=0,t=!0),this.vad_past.push(e),t?[!0,this.clip_points[this.clip_points.length-1]]:[!1,this.clip_points[this.clip_points.length-1]]}async initVad(e){let t;this.is_vad_loading=!0,this.stopMicStream();try{t=await navigator.mediaDevices.getUserMedia({audio:!e||{deviceId:{exact:e}}})}catch(n){if("OverconstrainedError"!==(null==n?void 0:n.name)&&"NotFoundError"!==(null==n?void 0:n.name))throw n;t=await navigator.mediaDevices.getUserMedia({audio:!0})}this.micStream=t;try{const e=await dist.MicVAD.new({stream:t,frameSamples:this.frame_size,preSpeechPadFrames:this.speech_pad_frames,onFrameProcessed:(e,t)=>{var n,r,o;if(this.onVadFrameProcessedCallback&&this.onVadFrameProcessedCallback({probabilities:e,frame:t}),!this.recording_started)return;null==(n=this.audioFileManager)||n.incrementTotalRawSamples(t),null==(r=this.audioBufferManager)||r.append(t);const{isSpeech:a}=e;let i=0;a>=.5&&(i=1),this.checkNoSpeech(i);const s=this.processVadFrame(i),l=s[0];if(console.log("is clip point:",l," at index:",s[1]),l){const e=null==(o=this.audioBufferManager)?void 0:o.getAudioData();console.log("Processing audio chunk at clip point:",e),e&&this.processAudioChunk({audioFrames:e})}},onSpeechStart:()=>{var e;null==(e=this.onUserSpeechCallback)||e.call(this,!0)},onSpeechEnd:()=>{var e;null==(e=this.onUserSpeechCallback)||e.call(this,!1)}});return this.is_vad_loading=!1,this.micVad=e,!this.is_vad_loading}catch(n){throw console.error("Error initializing VAD:",n),this.stopMicStream(),this.is_vad_loading=!1,n}}async reinitializeVad(e){return await this.initVad(e)}async processAudioChunk({audioFrames:e}){if(!e||!this.audioFileManager||!this.audioBufferManager)return;const t=`audio_${this.audioFileManager.audioChunks.length||0}.${OUTPUT_FORMAT}`,n=this.audioFileManager.getRawSampleDetails(),r=this.audioBufferManager.calculateChunkTimestamps(n.totalRawSamples);try{const n={fileName:t,timestamp:{st:r.start,et:r.end},status:"pending",audioFrames:e},o=this.audioFileManager.updateAudioInfo(n);this.audioFileManager.incrementInsertedSamples(this.audioBufferManager.getCurrentSampleLength(),this.audioBufferManager.getCurrentFrameLength()),this.audioBufferManager.resetBufferState(),console.log("Uploading audio chunk:",t," at index:",o-1),await this.audioFileManager.uploadAudio({audioFrames:e,fileName:t,chunkIndex:o-1})}catch(o){console.error("Error uploading audio chunk:",o)}}startVad(){this.micVad&&"function"==typeof this.micVad.start&&this.micVad.start(),this.recording_started=!0}pauseVad(){this.micVad&&"function"==typeof this.micVad.pause&&this.micVad.pause(),this.recording_started=!1}destroyVad(){this.micVad&&"function"==typeof this.micVad.destroy&&this.micVad.destroy(),this.stopMicStream(),this.recording_started=!1}resetVadWebInstance(){this.micVad&&"function"==typeof this.micVad.destroy&&this.micVad.destroy(),this.stopMicStream(),this.vad_past=[],this.last_clip_index=0,this.clip_points=[0],this.sil_duration_acc=0,this.noSpeechStartTime=null,this.lastWarningTime=null,this.recording_started=!1,this.is_vad_loading=!0}configureVadConstants({pref_length:e,desp_length:t,max_length:n,sr:r,frame_size:o,pre_speech_pad_frames:a,short_thsld:i,long_thsld:s}){this.pref_length_samples=e*r,this.desp_length_samples=t*r,this.max_length_samples=n*r,this.shor_thsld=i*r,this.long_thsld=s*r,this.frame_size=o,this.speech_pad_frames=a}}class ChunkedRecorder{constructor(e){this._isPaused=!1,this.eventEmitter=e,this.bufferManager=new AudioBufferManager(SAMPLING_RATE,AUDIO_BUFFER_SIZE_IN_S),this.fileManager=new AudioFileManager,this.vadClient=new VadWebClient(PREF_CHUNK_LENGTH,DESP_CHUNK_LENGTH,MAX_CHUNK_LENGTH,SAMPLING_RATE,this.fileManager,this.bufferManager),this.eventEmitter&&(this.fileManager.setUploadProgressCallback((e,t)=>{}),this.vadClient.setCallbacks(e=>{},e=>{},e=>{}))}initialize(e){if(!e.upload_url)throw new Error("Upload URL is required for chunked recording");this.fileManager.setSessionInfo({sessionId:e.session_id,uploadUrl:e.upload_url})}async start(e){await this.vadClient.initVad(e);const t=this.vadClient.getMicVad();if(this.vadClient.isVadLoading()||!t||0===Object.keys(t).length){if(await this.vadClient.reinitializeVad(e))throw new Error("VAD instance is not initialized.")}this.vadClient.startVad()}pause(){this._isPaused||(this.vadClient.pauseVad(),this._isPaused=!0)}resume(){this._isPaused&&(this.vadClient.startVad(),this._isPaused=!1)}isPaused(){return this._isPaused}async stop(){this._isPaused=!1,this.vadClient.resetVadWebInstance(),await this.fileManager.waitForAllUploads();return{failedUploads:await this.fileManager.retryFailedUploads(),totalFiles:this.fileManager.getTotalAudioChunks().length}}reset(){this._isPaused=!1,this.vadClient.resetVadWebInstance(),this.fileManager.resetFileManagerInstance(),this.bufferManager.resetBufferState()}}class SingleRecorder{constructor(e){this.mediaRecorder=null,this.audioChunks=[],this.uploadUrl="",this.stream=null,this._isPaused=!1,this.eventEmitter=e}initialize(e){if(!e.upload_url)throw new Error("Upload URL is required for single recording");this.uploadUrl=e.upload_url}async start(e){let t;this.audioChunks=[];try{t=await navigator.mediaDevices.getUserMedia({audio:!e||{deviceId:{exact:e}}})}catch(n){if("OverconstrainedError"!==(null==n?void 0:n.name)&&"NotFoundError"!==(null==n?void 0:n.name))throw n;t=await navigator.mediaDevices.getUserMedia({audio:!0})}this.stream=t,this.mediaRecorder=new MediaRecorder(t),this.mediaRecorder.ondataavailable=e=>{e.data.size>0&&this.audioChunks.push(e.data)},this.mediaRecorder.start()}pause(){this.mediaRecorder&&"recording"===this.mediaRecorder.state&&(this.mediaRecorder.pause(),this._isPaused=!0)}resume(){this.mediaRecorder&&"paused"===this.mediaRecorder.state&&(this.mediaRecorder.resume(),this._isPaused=!1)}isPaused(){return this._isPaused}async stop(){return this._isPaused=!1,new Promise(e=>{this.mediaRecorder?(this.mediaRecorder.onstop=async()=>{var t;const n=new Blob(this.audioChunks,{type:"audio/webm"}),r=`recording_${Date.now()}.webm`;(await uploadFileWithFormData(this.uploadUrl,r,n)).success?e({failedUploads:[],totalFiles:1}):e({failedUploads:[r],totalFiles:1}),null==(t=this.stream)||t.getTracks().forEach(e=>e.stop()),this.stream=null,this.mediaRecorder=null},this.mediaRecorder.stop()):e({failedUploads:[],totalFiles:0})})}reset(){var e;this._isPaused=!1,this.mediaRecorder&&"inactive"!==this.mediaRecorder.state&&this.mediaRecorder.stop(),null==(e=this.stream)||e.getTracks().forEach(e=>e.stop()),this.stream=null,this.mediaRecorder=null,this.audioChunks=[]}}class EventEmitter{constructor(){this.listeners=new Map}on(e,t){var n;this.listeners.has(e)||this.listeners.set(e,new Set),null==(n=this.listeners.get(e))||n.add(t)}off(e,t){var n;null==(n=this.listeners.get(e))||n.delete(t)}emit(e){var t;null==(t=this.listeners.get(e.type))||t.forEach(t=>{try{t(e)}catch(n){console.error("Error in event listener:",n)}})}}class ScribeClient{static getInstance(e){return ScribeClient.instance||(ScribeClient.instance=new ScribeClient(e)),ScribeClient.instance}static resetInstance(){ScribeClient.instance&&(ScribeClient.instance.reset().catch(()=>{}),ScribeClient.instance=null)}constructor(e){this.discoveryDocument=null,this.currentSession=null,this.isInitialized=!1,this.recorder=null,this.validateConfig(e),this.config={debug:!1,autoDiscovery:!0,...e},this.httpClient=new HttpClient(this.config.apiKey,this.config.debug),this.discoveryAPI=new DiscoveryAPI(this.httpClient),this.sessionAPI=new SessionAPI(this.httpClient,this.config.baseUrl||""),this.eventEmitter=new EventEmitter}async init(){if(this.isInitialized)this.config.debug&&console.log("[ScribeSDK] Already initialized");else{if(!this.config.baseUrl)throw new ValidationError("baseUrl is required for initialization");if(this.config.autoDiscovery)try{this.discoveryDocument=await this.discoveryAPI.getDiscovery(this.config.baseUrl),this.discoveryDocument.endpoints.base_url&&this.sessionAPI.setBaseUrl(this.discoveryDocument.endpoints.base_url),this.emitEvent({type:"discovery:complete",data:this.discoveryDocument}),this.config.debug&&console.log("[ScribeSDK] Discovery complete:",this.discoveryDocument)}catch(e){throw this.emitEvent({type:"error",error:e instanceof Error?e:new Error("Discovery failed")}),e}else this.sessionAPI.setBaseUrl(this.config.baseUrl);this.isInitialized=!0}}async startRecording(e){this.isInitialized||await this.init();if("granted"!==(await navigator.permissions.query({name:"microphone"})).state)throw new ValidationError("Microphone access is required to start recording.");try{const t={templates:e.templates,model:e.model,language_hint:e.languageHint,transcript_language:e.transcriptLanguage,upload_type:e.uploadType||UploadType.CHUNKED,communication_protocol:e.communicationProtocol||"http",additional_data:e.additionalData};return this.currentSession=await this.sessionAPI.createSession(t),this.emitEvent({type:"session:created",data:this.currentSession}),this.config.debug&&console.log("[ScribeSDK] Session created:",this.currentSession),e.uploadType===UploadType.SINGLE?this.recorder=new SingleRecorder(this.eventEmitter):this.recorder=new ChunkedRecorder(this.eventEmitter),this.recorder.initialize(this.currentSession),await this.recorder.start(e.deviceId),this.currentSession}catch(t){throw this.emitEvent({type:"error",error:t instanceof Error?t:new Error("Failed to start recording")}),t}}pauseRecording(){if(!this.recorder)throw new ValidationError("No active recording to pause");this.recorder.pause(),this.emitEvent({type:"recording:paused"}),this.config.debug&&console.log("[ScribeSDK] Recording paused")}resumeRecording(){if(!this.recorder)throw new ValidationError("No active recording to resume");this.recorder.resume(),this.emitEvent({type:"recording:resumed"}),this.config.debug&&console.log("[ScribeSDK] Recording resumed")}isRecordingPaused(){var e;return(null==(e=this.recorder)?void 0:e.isPaused())??!1}async endRecording(){if(!this.currentSession)throw new ValidationError("No active session to end");try{let e=0;if(this.recorder){const{failedUploads:t,totalFiles:n}=await this.recorder.stop();if(t.length>0)throw console.warn("Some audio files failed to upload:",t),new ScribeError(`Failed to upload audio recordings: ${t.join(", ")}`,"upload_failed");e=n||0,this.recorder=null}const t=await this.sessionAPI.endSession(this.currentSession.session_id,e);return this.emitEvent({type:"session:ended",data:t}),this.config.debug&&console.log("[ScribeSDK] Session ended:",t),t}catch(e){throw this.emitEvent({type:"error",error:e instanceof Error?e:new Error("Failed to end recording")}),e}}async reset(){this.recorder&&(await this.recorder.stop().catch(()=>{}),this.recorder=null),this.currentSession=null,this.discoveryAPI.clearCache(),this.discoveryDocument=null,this.isInitialized=!1}emitEvent(e){this.eventEmitter.emit(e)}async getOutputStatus(e){var t;const n=e||(null==(t=this.currentSession)?void 0:t.session_id);if(!n)throw new ValidationError("No session ID provided and no active session");try{const e=await this.sessionAPI.getSessionStatus(n);return this.emitEvent({type:"session:status_update",data:e}),this.config.debug&&console.log("[ScribeSDK] Session status:",e),e}catch(r){throw this.emitEvent({type:"error",error:r instanceof Error?r:new Error("Failed to get output status")}),r}}async pollForCompletion(e,t={}){var n;const r=e||(null==(n=this.currentSession)?void 0:n.session_id);if(!r)throw new ValidationError("No session ID provided and no active session");return this.sessionAPI.pollSessionStatus(r,{...t,onProgress:e=>{this.emitEvent({type:"session:status_update",data:e}),t.onProgress&&t.onProgress(e)}})}getCurrentSession(){return this.currentSession}getDiscoveryDocument(){return this.discoveryDocument}on(e,t){this.eventEmitter.on(e,t)}off(e,t){this.eventEmitter.off(e,t)}clearSession(){this.currentSession=null}validateConfig(e){if(!e.baseUrl)throw new ValidationError("baseUrl is required for initialization")}}function useScribeSession(e){const[t,n]=reactExports.useState("idle"),[r,o]=reactExports.useState(0),[a,i]=reactExports.useState(null),[s,l]=reactExports.useState(""),u=reactExports.useRef(null),c=reactExports.useRef(null),d=reactExports.useRef(0),f=reactExports.useRef(0),p=reactExports.useCallback((...t)=>{e.debug&&console.log("[EkaScribe]",...t)},[e.debug]);reactExports.useEffect(()=>{if(!e.baseUrl)return void p("Skipping SDK init - no baseUrl provided");return(async()=>{try{u.current=new ScribeClient({apiKey:e.apiKey,baseUrl:e.baseUrl,debug:e.debug}),await u.current.init(),p("SDK initialized")}catch(t){p("Failed to initialize SDK",t)}})(),()=>{c.current&&clearInterval(c.current)}},[e.apiKey,e.baseUrl,e.debug,p]);const h=reactExports.useCallback(()=>{c.current=window.setInterval(()=>{const e=Math.floor((Date.now()-d.current)/1e3);o(e)},1e3)},[]),m=reactExports.useCallback(()=>{c.current&&(clearInterval(c.current),c.current=null)},[]),g=reactExports.useCallback(e=>{l(e),n("error")},[]);return{state:t,elapsedTime:r,result:a,errorMessage:s,startRecording:reactExports.useCallback(async()=>{const t=await(async()=>{try{return(await navigator.permissions.query({name:"microphone"})).state}catch{return"prompt"}})();if("denied"!==t){if("prompt"===t){n("permission");if(!(await(async()=>{try{return(await navigator.mediaDevices.getUserMedia({audio:!0})).getTracks().forEach(e=>e.stop()),!0}catch(e){return p("Microphone permission denied",e),!1}})()))return void g("Microphone access is required to record.")}if(u.current)try{n("recording"),await u.current.startRecording({templates:e.templates||["soap"],languageHint:e.languageHint}),d.current=Date.now(),f.current=0,o(0),h(),p("Recording started")}catch(r){p("Failed to start recording",r),g("Failed to start recording. Please try again.")}else g("SDK not initialized. Please try again.")}else g("Microphone access is blocked. Please enable it in your browser settings.")},[e.templates,e.languageHint,p,g,h]),pauseRecording:reactExports.useCallback(()=>{u.current&&(u.current.pauseRecording(),n("paused"),f.current=Date.now(),m(),p("Recording paused"))},[p,m]),resumeRecording:reactExports.useCallback(()=>{u.current&&(u.current.resumeRecording(),n("recording"),f.current&&(d.current+=Date.now()-f.current,f.current=0),h(),p("Recording resumed"))},[p,h]),stopRecording:reactExports.useCallback(async()=>{if(u.current)try{m(),n("processing"),p("Stopping recording...");const t=await u.current.endRecording();p("Recording ended",t),p("Polling for completion...");const r=await u.current.pollForCompletion(void 0,{maxAttempts:60,intervalMs:2e3,onProgress:e=>{p("Status update:",e.status)}});i(r),p("Final result:",r),n("results"),e.onResult&&e.onResult(r)}catch(t){p("Failed to stop recording",t),g("Failed to process recording. Please try again."),e.onError&&t instanceof Error&&e.onError(t)}},[e,p,g,m]),reset:reactExports.useCallback(()=>{i(null),l(""),o(0),n("idle")},[])}}function App({config:e,onClose:t}){const[n,r]=reactExports.useState(!1),[o,a]=reactExports.useState(e.baseUrl?{apiKey:e.apiKey,baseUrl:e.baseUrl}:null),i=reactExports.useMemo(()=>o?{...e,apiKey:o.apiKey,baseUrl:o.baseUrl}:e,[e,o]),s=!o,{state:l,elapsedTime:u,result:c,errorMessage:d,startRecording:f,pauseRecording:p,resumeRecording:h,stopRecording:m,reset:g}=useScribeSession(i);if(n)return null;const b=(e,t)=>{a({apiKey:e,baseUrl:t})};return jsxRuntimeExports.jsx(FloatingPanel,{position:i.position,onClose:t,onMinimize:()=>r(!0),children:(()=>{if(s)return jsxRuntimeExports.jsx(ConfigState,{onSubmit:b,initialApiKey:e.apiKey||"",initialBaseUrl:e.baseUrl||""});switch(l){case"idle":default:return jsxRuntimeExports.jsx(IdleState,{onStartRecording:f});case"permission":return jsxRuntimeExports.jsx(PermissionState,{onRequestPermission:f});case"recording":case"paused":return jsxRuntimeExports.jsx(RecordingState,{elapsedTime:u,isPaused:"paused"===l,onPause:p,onResume:h,onStop:m});case"processing":return jsxRuntimeExports.jsx(ProcessingState,{});case"results":return c?jsxRuntimeExports.jsx(ResultsState,{result:c,onNewRecording:g}):null;case"error":return jsxRuntimeExports.jsx(ErrorState,{message:d,onRetry:g})}})()})}ScribeClient.instance=null;const widgetStyles=":host{all:initial;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,sans-serif}*{box-sizing:border-box;margin:0;padding:0}.scribe-panel{position:fixed;bottom:20px;right:20px;background:#fff;border-radius:16px;box-shadow:0 4px 24px #0000001f,0 0 0 1px #0000000d;z-index:2147483647;overflow:hidden;min-width:320px}.panel-header{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;background:#fafafa;border-bottom:1px solid #eee;cursor:grab}.panel-header:active{cursor:grabbing}.drag-handle{display:flex;gap:2px;flex-wrap:wrap;width:16px;opacity:.4}.drag-handle span{width:4px;height:4px;background:#666;border-radius:50%}.header-actions{display:flex;gap:8px}.header-btn{background:none;border:none;cursor:pointer;padding:4px;color:#666;display:flex;align-items:center;justify-content:center;width:24px;height:24px}.header-btn:hover{color:#333}.header-btn svg{width:16px;height:16px}.panel-content{padding:20px 24px}.idle-state{display:flex;align-items:center;gap:24px}.logo{display:flex;align-items:center;gap:8px}.logo-icon{width:32px;height:32px}.logo-icon svg{width:100%;height:100%}.logo-text{font-size:20px;font-weight:600;color:#2563eb}.start-btn{display:flex;align-items:center;gap:8px;background:#2563eb;color:#fff;border:none;padding:12px 24px;border-radius:24px;font-size:16px;font-weight:500;cursor:pointer;transition:background .2s}.start-btn:hover{background:#1d4ed8}.start-btn:disabled{background:#93c5fd;cursor:not-allowed}.mic-icon{width:20px;height:20px}.mic-icon svg{width:100%;height:100%}.recording-state{display:flex;align-items:center;gap:16px}.recording-indicator{display:flex;align-items:center;gap:12px;color:#666}.recording-icon{width:24px;height:24px;color:#666}.recording-icon svg{width:100%;height:100%}.recording-icon.active{color:#ef4444;animation:pulse 1.5s infinite}@keyframes pulse{0%,to{opacity:1}50%{opacity:.5}}.timer{font-size:20px;font-weight:500;font-variant-numeric:tabular-nums;color:#374151}.recording-actions{display:flex;gap:8px;margin-left:auto}.resume-btn{background:#fff;color:#2563eb;border:2px solid #2563eb;padding:10px 20px;border-radius:8px;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s}.resume-btn:hover{background:#eff6ff}.pause-btn{background:#fff;color:#f59e0b;border:2px solid #f59e0b;padding:10px 20px;border-radius:8px;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s}.pause-btn:hover{background:#fffbeb}.stop-btn{background:#ef4444;color:#fff;border:none;padding:10px 16px;border-radius:8px;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background .2s}.stop-btn:hover{background:#dc2626}.stop-icon{width:16px;height:16px;background:#fff;border-radius:2px}.processing-state{display:flex;flex-direction:column;align-items:center;gap:16px;padding:20px}.spinner{width:40px;height:40px;border:3px solid #e5e7eb;border-top-color:#2563eb;border-radius:50%;animation:spin 1s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.processing-text{color:#6b7280;font-size:14px}.results-state{display:flex;flex-direction:column;gap:16px;max-height:400px}.results-header{display:flex;align-items:center;justify-content:space-between}.results-title{font-size:16px;font-weight:600;color:#111827}.new-recording-btn{background:#2563eb;color:#fff;border:none;padding:8px 16px;border-radius:6px;font-size:13px;cursor:pointer;transition:background .2s}.new-recording-btn:hover{background:#1d4ed8}.results-content{overflow-y:auto;max-height:300px}.transcript-section{margin-bottom:16px}.section-title{font-size:13px;font-weight:600;color:#6b7280;text-transform:uppercase;letter-spacing:.05em;margin-bottom:8px}.transcript-text{font-size:14px;line-height:1.6;color:#374151;background:#f9fafb;padding:12px;border-radius:8px;white-space:pre-wrap}.error-state{display:flex;flex-direction:column;align-items:center;gap:12px;padding:20px;text-align:center}.error-icon{width:48px;height:48px;color:#ef4444}.error-icon svg{width:100%;height:100%}.error-message{color:#ef4444;font-size:14px}.retry-btn{background:#ef4444;color:#fff;border:none;padding:10px 20px;border-radius:8px;font-size:14px;cursor:pointer;transition:background .2s}.retry-btn:hover{background:#dc2626}.permission-state{display:flex;flex-direction:column;align-items:center;gap:16px;padding:20px;text-align:center}.permission-icon{width:48px;height:48px;color:#2563eb}.permission-icon svg{width:100%;height:100%}.permission-text{color:#374151;font-size:14px;line-height:1.5}.permission-btn{background:#2563eb;color:#fff;border:none;padding:12px 24px;border-radius:8px;font-size:14px;font-weight:500;cursor:pointer;transition:background .2s}.permission-btn:hover{background:#1d4ed8}.config-state{display:flex;flex-direction:column;gap:20px}.config-state .logo{justify-content:center}.config-form{display:flex;flex-direction:column;gap:12px}.config-form .form-group{display:flex;flex-direction:column;gap:4px}.config-form label{font-size:13px;font-weight:500;color:#374151}.config-form input{padding:10px 12px;border:1px solid #d1d5db;border-radius:8px;font-size:14px;color:#111827;background:#fff;transition:border-color .2s,box-shadow .2s}.config-form input:focus{outline:none;border-color:#2563eb;box-shadow:0 0 0 3px #2563eb1a}.config-form input::placeholder{color:#9ca3af}.config-error{color:#ef4444;font-size:13px;margin:0}.config-submit-btn{background:#2563eb;color:#fff;border:none;padding:12px 24px;border-radius:8px;font-size:14px;font-weight:500;cursor:pointer;transition:background .2s;margin-top:4px}.config-submit-btn:hover{background:#1d4ed8}";class ScribeWidget{constructor(e){__publicField(this,"container"),__publicField(this,"shadowRoot"),__publicField(this,"root",null),__publicField(this,"config"),__publicField(this,"visible",!0),this.config={templates:["soap"],languageHint:["en"],position:{bottom:20,right:20},...e},this.container=document.createElement("div"),this.container.id="eka-scribe-widget",this.shadowRoot=this.container.attachShadow({mode:"closed"});const t=document.createElement("style");t.textContent=widgetStyles,this.shadowRoot.appendChild(t);const n=document.createElement("div");n.id="eka-scribe-root",this.shadowRoot.appendChild(n),this.root=createRoot(n)}render(){this.root&&this.visible&&this.root.render(jsxRuntimeExports.jsx(App,{config:this.config,onClose:()=>this.hide()}))}mount(e){const t="string"==typeof e?document.querySelector(e):e||document.body;t&&(t.appendChild(this.container),this.render())}unmount(){this.root&&(this.root.unmount(),this.root=null),this.container.remove()}show(){this.visible=!0,this.container.style.display="block",this.render()}hide(){this.visible=!1,this.container.style.display="none"}isVisible(){return this.visible}}let widgetInstance=null;function init(e={}){return widgetInstance&&widgetInstance.unmount(),widgetInstance=new ScribeWidget(e),widgetInstance.mount(),widgetInstance}function getInstance(){return widgetInstance}const EkaScribe={init:init,getInstance:getInstance,Widget:ScribeWidget};if("undefined"!=typeof window&&"undefined"!=typeof document){const e=()=>{const e=document.currentScript||document.querySelector('script[src*="scribe-widget"]');(null==e?void 0:e.hasAttribute("data-no-auto-init"))||widgetInstance||init({})};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",e):e()}exports.ScribeWidget=ScribeWidget,exports.default=EkaScribe,exports.getInstance=getInstance,exports.init=init,Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
80
+ (function(module,exports$1){var e;self,e=__WEBPACK_EXTERNAL_MODULE__1670__=>(()=>{var __webpack_modules__={3474:(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 I.buffer!=D&&G(I.buffer),N}function o(){return I.buffer!=D&&G(I.buffer),M}function a(){return I.buffer!=D&&G(I.buffer),L}function i(){return I.buffer!=D&&G(I.buffer),j}function s(){return I.buffer!=D&&G(I.buffer),F}var l,u,c;e=e||{},l||(l=void 0!==e?e:{}),l.ready=new Promise(function(e,t){u=e,c=t});var d,f,p,h,m,g,b=Object.assign({},l),y="./this.program",_=(e,t)=>{throw t},v="object"==typeof window,w="function"==typeof importScripts,S="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,x=l.ENVIRONMENT_IS_PTHREAD||!1,T="";function E(e){return l.locateFile?l.locateFile(e,T):T+e}if(S){let e;T=w?n(908).dirname(T)+"/":"//",g=()=>{m||(h=n(1384),m=n(908))},d=function(e,t){return g(),e=m.normalize(e),h.readFileSync(e,t?void 0:"utf8")},p=e=>((e=d(e,!0)).buffer||(e=new Uint8Array(e)),e),f=(e,t,n)=>{g(),e=m.normalize(e),h.readFile(e,function(e,r){e?n(e):t(r.buffer)})},1<process.argv.length&&(y=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),process.on("uncaughtException",function(e){if(!(e instanceof le))throw e}),process.on("unhandledRejection",function(e){throw e}),_=(e,t)=>{if(J())throw process.exitCode=e,t;t instanceof le||$("exiting due to exception: "+t),process.exit(e)},l.inspect=function(){return"[Emscripten Module object]"};try{e=n(9925)}catch(Ut){throw console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?'),Ut}n.g.Worker=e.Worker}else(v||w)&&(w?T=self.location.href:"undefined"!=typeof document&&document.currentScript&&(T=document.currentScript.src),r&&(T=r),T=0!==T.indexOf("blob:")?T.substr(0,T.replace(/[?#].*/,"").lastIndexOf("/")+1):"",S||(d=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},w&&(p=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),f=(e,t,n)=>{var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?t(r.response):n()},r.onerror=n,r.send(null)}));S&&"undefined"==typeof performance&&(n.g.performance=n(6953).performance);var k=console.log.bind(console),P=console.warn.bind(console);S&&(g(),k=e=>h.writeSync(1,e+"\n"),P=e=>h.writeSync(2,e+"\n"));var O,A=l.print||k,$=l.printErr||P;Object.assign(l,b),b=null,l.thisProgram&&(y=l.thisProgram),l.quit&&(_=l.quit),l.wasmBinary&&(O=l.wasmBinary);var R=l.noExitRuntime||!1;"object"!=typeof WebAssembly&&oe("no native wasm support detected");var I,C,D,N,M,L,j,F,B=!1,U="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function z(e,t,n){var r=(t>>>=0)+n;for(n=t;e[n]&&!(n>=r);)++n;if(16<n-t&&e.buffer&&U)return U.decode(e.buffer instanceof SharedArrayBuffer?e.slice(t,n):e.subarray(t,n));for(r="";t<n;){var o=e[t++];if(128&o){var a=63&e[t++];if(192==(224&o))r+=String.fromCharCode((31&o)<<6|a);else{var i=63&e[t++];65536>(o=224==(240&o)?(15&o)<<12|a<<6|i:(7&o)<<18|a<<12|i<<6|63&e[t++])?r+=String.fromCharCode(o):(o-=65536,r+=String.fromCharCode(55296|o>>10,56320|1023&o))}}else r+=String.fromCharCode(o)}return r}function V(e,t){return(e>>>=0)?z(o(),e,t):""}function H(e,t,n,r){if(!(0<r))return 0;var o=n>>>=0;r=n+r-1;for(var a=0;a<e.length;++a){var i=e.charCodeAt(a);if(55296<=i&&57343>=i&&(i=65536+((1023&i)<<10)|1023&e.charCodeAt(++a)),127>=i){if(n>=r)break;t[n++>>>0]=i}else{if(2047>=i){if(n+1>=r)break;t[n++>>>0]=192|i>>6}else{if(65535>=i){if(n+2>=r)break;t[n++>>>0]=224|i>>12}else{if(n+3>=r)break;t[n++>>>0]=240|i>>18,t[n++>>>0]=128|i>>12&63}t[n++>>>0]=128|i>>6&63}t[n++>>>0]=128|63&i}}return t[n>>>0]=0,n-o}function q(e){for(var t=0,n=0;n<e.length;++n){var r=e.charCodeAt(n);127>=r?t++:2047>=r?t+=2:55296<=r&&57343>=r?(t+=4,++n):t+=3}return t}function G(e){D=e,l.HEAP8=N=new Int8Array(e),l.HEAP16=new Int16Array(e),l.HEAP32=L=new Int32Array(e),l.HEAPU8=M=new Uint8Array(e),l.HEAPU16=new Uint16Array(e),l.HEAPU32=j=new Uint32Array(e),l.HEAPF32=new Float32Array(e),l.HEAPF64=F=new Float64Array(e)}x&&(D=l.buffer);var W=l.INITIAL_MEMORY||16777216;if(x)I=l.wasmMemory,D=l.buffer;else if(l.wasmMemory)I=l.wasmMemory;else if(!((I=new WebAssembly.Memory({initial:W/65536,maximum:65536,shared:!0})).buffer instanceof SharedArrayBuffer))throw $("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag"),S&&console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)"),Error("bad memory");I&&(D=I.buffer),W=D.byteLength,G(D);var Y,K=[],X=[],Q=[],Z=[];function J(){return R||!1}function ee(){var e=l.preRun.shift();K.unshift(e)}var te,ne=0,re=null;function oe(e){throw x?postMessage({cmd:"onAbort",arg:e}):l.onAbort&&l.onAbort(e),$(e="Aborted("+e+")"),B=!0,e=new WebAssembly.RuntimeError(e+". Build with -sASSERTIONS for more info."),c(e),e}function ae(){return te.startsWith("data:application/octet-stream;base64,")}function ie(){var e=te;try{if(e==te&&O)return new Uint8Array(O);if(p)return p(e);throw"both async and sync fetching of the wasm failed"}catch(t){oe(t)}}te="ort-wasm-threaded.wasm",ae()||(te=E(te));var se={};function le(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function ue(e){(e=pe.Vb[e])||oe(),pe.mc(e)}function ce(e){var t=pe.Cc();if(!t)return 6;pe.ac.push(t),pe.Vb[e.Ub]=t,t.Ub=e.Ub;var n={cmd:"run",start_routine:e.Ic,arg:e.zc,pthread_ptr:e.Ub};return t.$b=()=>{n.time=performance.now(),t.postMessage(n,e.Nc)},t.loaded&&(t.$b(),delete t.$b),0}function de(e){if(x)return Ge(1,1,e);J()||(pe.oc(),l.onExit&&l.onExit(e),B=!0),_(e,new le(e))}function fe(e,t){if(!t&&x)throw me(e),"unwind";J()||x||(gt(),he(Q),mt(0),nt[1].length&&rt(1,10),nt[2].length&&rt(2,10),pe.oc()),de(e)}var pe={Yb:[],ac:[],qc:[],Vb:{},fc:function(){x&&pe.Ec()},Pc:function(){},Ec:function(){pe.receiveObjectTransfer=pe.Gc,pe.threadInitTLS=pe.pc,pe.setExitStatus=pe.nc,R=!1},nc:function(){},oc:function(){for(var e of Object.values(pe.Vb))pe.mc(e);for(e of pe.Yb)e.terminate();pe.Yb=[]},mc:function(e){var t=e.Ub;delete pe.Vb[t],pe.Yb.push(e),pe.ac.splice(pe.ac.indexOf(e),1),e.Ub=0,wt(t)},Gc:function(){},pc:function(){pe.qc.forEach(e=>e())},Fc:function(e,t){e.onmessage=n=>{var r=(n=n.data).cmd;if(e.Ub&&(pe.Bc=e.Ub),n.targetThread&&n.targetThread!=ft()){var o=pe.Vb[n.Qc];o?o.postMessage(n,n.transferList):$('Internal error! Worker sent a message "'+r+'" to target pthread '+n.targetThread+", but that thread no longer exists!")}else"processProxyingQueue"===r?Be(n.queue):"spawnThread"===r?ce(n):"cleanupThread"===r?ue(n.thread):"killThread"===r?(n=n.thread,r=pe.Vb[n],delete pe.Vb[n],r.terminate(),wt(n),pe.ac.splice(pe.ac.indexOf(r),1),r.Ub=0):"cancelThread"===r?pe.Vb[n.thread].postMessage({cmd:"cancel"}):"loaded"===r?(e.loaded=!0,t&&t(e),e.$b&&(e.$b(),delete e.$b)):"print"===r?A("Thread "+n.threadId+": "+n.text):"printErr"===r?$("Thread "+n.threadId+": "+n.text):"alert"===r?alert("Thread "+n.threadId+": "+n.text):"setimmediate"===n.target?e.postMessage(n):"onAbort"===r?l.onAbort&&l.onAbort(n.arg):r&&$("worker sent an unknown command "+r);pe.Bc=void 0},e.onerror=e=>{throw $("worker sent an error! "+e.filename+":"+e.lineno+": "+e.message),e},S&&(e.on("message",function(t){e.onmessage({data:t})}),e.on("error",function(t){e.onerror(t)}),e.on("detachedExit",function(){})),e.postMessage({cmd:"load",urlOrBlob:l.mainScriptUrlOrBlob||r,wasmMemory:I,wasmModule:C})},yc:function(){var e=E("ort-wasm-threaded.worker.js");pe.Yb.push(new Worker(e))},Cc:function(){return 0==pe.Yb.length&&(pe.yc(),pe.Fc(pe.Yb[0])),pe.Yb.pop()}};function he(e){for(;0<e.length;)e.shift()(l)}function me(e){if(x)return Ge(2,0,e);try{fe(e)}catch(t){t instanceof le||"unwind"==t||_(1,t)}}l.PThread=pe,l.establishStackSpace=function(){var e=ft(),t=a()[e+44>>2>>>0];e=a()[e+48>>2>>>0],Tt(t,t-e),kt(t)};var ge=[];function be(e){var t=ge[e];return t||(e>=ge.length&&(ge.length=e+1),ge[e]=t=Y.get(e)),t}l.invokeEntryPoint=function(e,t){e=be(e)(t),J()?pe.nc(e):St(e)};var ye,_e,ve=[],we=0,Se=0;function xe(e){this.Zb=e,this.Sb=e-24,this.xc=function(e){i()[this.Sb+4>>2>>>0]=e},this.bc=function(){return i()[this.Sb+4>>2>>>0]},this.wc=function(e){i()[this.Sb+8>>2>>>0]=e},this.Dc=function(){return i()[this.Sb+8>>2>>>0]},this.rc=function(){a()[this.Sb>>2>>>0]=0},this.hc=function(e){e=e?1:0,t()[(this.Sb+12|0)>>>0]=e},this.uc=function(){return 0!=t()[(this.Sb+12|0)>>>0]},this.ic=function(e){e=e?1:0,t()[(this.Sb+13|0)>>>0]=e},this.kc=function(){return 0!=t()[(this.Sb+13|0)>>>0]},this.fc=function(e,t){this.cc(0),this.xc(e),this.wc(t),this.rc(),this.hc(!1),this.ic(!1)},this.sc=function(){Atomics.add(a(),this.Sb>>2,1)},this.Hc=function(){return 1===Atomics.sub(a(),this.Sb>>2,1)},this.cc=function(e){i()[this.Sb+16>>2>>>0]=e},this.tc=function(){return i()[this.Sb+16>>2>>>0]},this.vc=function(){if(At(this.bc()))return i()[this.Zb>>2>>>0];var e=this.tc();return 0!==e?e:this.Zb}}function Te(e){return ht(new xe(e).Sb)}function Ee(e,t,n,r){return x?Ge(3,1,e,t,n,r):ke(e,t,n,r)}function ke(e,t,n,r){if("undefined"==typeof SharedArrayBuffer)return $("Current environment does not support SharedArrayBuffer, pthreads are not available!"),6;var o=[];return x&&0===o.length?Ee(e,t,n,r):(e={Ic:n,Ub:e,zc:r,Nc:o},x?(e.Oc="spawnThread",postMessage(e,o),0):ce(e))}function Pe(e,t,n){return x?Ge(4,1,e,t,n):0}function Oe(e,t){if(x)return Ge(5,1,e,t)}function Ae(e,t){if(x)return Ge(6,1,e,t)}function $e(e,t,n){if(x)return Ge(7,1,e,t,n)}function Re(e,t,n){return x?Ge(8,1,e,t,n):0}function Ie(e,t){if(x)return Ge(9,1,e,t)}function Ce(e,t,n){if(x)return Ge(10,1,e,t,n)}function De(e,t,n,r){if(x)return Ge(11,1,e,t,n,r)}function Ne(e,t,n,r){if(x)return Ge(12,1,e,t,n,r)}function Me(e,t,n,r){if(x)return Ge(13,1,e,t,n,r)}function Le(e){if(x)return Ge(14,1,e)}function je(e,t){if(x)return Ge(15,1,e,t)}function Fe(e,t,n){if(x)return Ge(16,1,e,t,n)}function Be(e){Atomics.store(a(),e>>2,1),ft()&&vt(e),Atomics.compareExchange(a(),e>>2,1,0)}function Ue(e){return i()[e>>>2]+4294967296*a()[e+4>>>2]}function ze(e,t,n,r,o,a){return x?Ge(17,1,e,t,n,r,o,a):-52}function Ve(e,t,n,r,o,a){if(x)return Ge(18,1,e,t,n,r,o,a)}function He(e){var n=q(e)+1,r=pt(n);return r&&H(e,t(),r,n),r}function qe(e,t,n){function r(e){return(e=e.toTimeString().match(/\(([A-Za-z ]+)\)$/))?e[1]:"GMT"}if(x)return Ge(19,1,e,t,n);var o=(new Date).getFullYear(),s=new Date(o,0,1),l=new Date(o,6,1);o=s.getTimezoneOffset();var u=l.getTimezoneOffset(),c=Math.max(o,u);a()[e>>2>>>0]=60*c,a()[t>>2>>>0]=Number(o!=u),e=r(s),t=r(l),e=He(e),t=He(t),u<o?(i()[n>>2>>>0]=e,i()[n+4>>2>>>0]=t):(i()[n>>2>>>0]=t,i()[n+4>>2>>>0]=e)}function Ge(e,t){var n=arguments.length-2,r=arguments;return function(e){var t=Et();return e=e(),kt(t),e}(()=>{for(var o=Pt(8*n),a=o>>3,i=0;i<n;i++){var l=r[2+i];s()[a+i>>>0]=l}return _t(e,n,o,t)})}l.executeNotifiedProxyingQueue=Be,_e=S?()=>{var e=process.hrtime();return 1e3*e[0]+e[1]/1e6}:x?()=>performance.now()-l.__performance_now_clock_drift:()=>performance.now();var We,Ye=[],Ke={};function Xe(){if(!We){var e,t={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",_:y||"./this.program"};for(e in Ke)void 0===Ke[e]?delete t[e]:t[e]=Ke[e];var n=[];for(e in t)n.push(e+"="+t[e]);We=n}return We}function Qe(e,n){if(x)return Ge(20,1,e,n);var r=0;return Xe().forEach(function(o,a){var s=n+r;for(a=i()[e+4*a>>2>>>0]=s,s=0;s<o.length;++s)t()[(0|a++)>>>0]=o.charCodeAt(s);t()[(0|a)>>>0]=0,r+=o.length+1}),0}function Ze(e,t){if(x)return Ge(21,1,e,t);var n=Xe();i()[e>>2>>>0]=n.length;var r=0;return n.forEach(function(e){r+=e.length+1}),i()[t>>2>>>0]=r,0}function Je(e){return x?Ge(22,1,e):52}function et(e,t,n,r){return x?Ge(23,1,e,t,n,r):52}function tt(e,t,n,r,o){return x?Ge(24,1,e,t,n,r,o):70}var nt=[null,[],[]];function rt(e,t){var n=nt[e];0===t||10===t?((1===e?A:$)(z(n,0)),n.length=0):n.push(t)}function ot(e,t,n,r){if(x)return Ge(25,1,e,t,n,r);for(var a=0,s=0;s<n;s++){var l=i()[t>>2>>>0],u=i()[t+4>>2>>>0];t+=8;for(var c=0;c<u;c++)rt(e,o()[l+c>>>0]);a+=u}return i()[r>>2>>>0]=a,0}var at=0;function it(e){return 0==e%4&&(0!=e%100||0==e%400)}var st=[31,29,31,30,31,30,31,31,30,31,30,31],lt=[31,28,31,30,31,30,31,31,30,31,30,31];function ut(e,n,r,o){function i(e,t,n){for(e="number"==typeof e?e.toString():e||"";e.length<t;)e=n[0]+e;return e}function s(e,t){return i(e,t,"0")}function l(e,t){function n(e){return 0>e?-1:0<e?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 u(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 c(e){var t=e.Wb;for(e=new Date(new Date(e.Xb+1900,0,1).getTime());0<t;){var n=e.getMonth(),r=(it(e.getFullYear())?st:lt)[n];if(!(t>r-e.getDate())){e.setDate(e.getDate()+t);break}t-=r-e.getDate()+1,e.setDate(1),11>n?e.setMonth(n+1):(e.setMonth(0),e.setFullYear(e.getFullYear()+1))}return n=new Date(e.getFullYear()+1,0,4),t=u(new Date(e.getFullYear(),0,4)),n=u(n),0>=l(t,e)?0>=l(n,e)?e.getFullYear()+1:e.getFullYear():e.getFullYear()-1}var d=a()[o+40>>2>>>0];for(var f in o={Lc:a()[o>>2>>>0],Kc:a()[o+4>>2>>>0],dc:a()[o+8>>2>>>0],jc:a()[o+12>>2>>>0],ec:a()[o+16>>2>>>0],Xb:a()[o+20>>2>>>0],Tb:a()[o+24>>2>>>0],Wb:a()[o+28>>2>>>0],Rc:a()[o+32>>2>>>0],Jc:a()[o+36>>2>>>0],Mc:d?V(d):""},r=V(r),d={"%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"})r=r.replace(new RegExp(f,"g"),d[f]);var p,h,m="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),g="January February March April May June July August September October November December".split(" ");for(f in d={"%a":function(e){return m[e.Tb].substring(0,3)},"%A":function(e){return m[e.Tb]},"%b":function(e){return g[e.ec].substring(0,3)},"%B":function(e){return g[e.ec]},"%C":function(e){return s((e.Xb+1900)/100|0,2)},"%d":function(e){return s(e.jc,2)},"%e":function(e){return i(e.jc,2," ")},"%g":function(e){return c(e).toString().substring(2)},"%G":function(e){return c(e)},"%H":function(e){return s(e.dc,2)},"%I":function(e){return 0==(e=e.dc)?e=12:12<e&&(e-=12),s(e,2)},"%j":function(e){for(var t=0,n=0;n<=e.ec-1;t+=(it(e.Xb+1900)?st:lt)[n++]);return s(e.jc+t,3)},"%m":function(e){return s(e.ec+1,2)},"%M":function(e){return s(e.Kc,2)},"%n":function(){return"\n"},"%p":function(e){return 0<=e.dc&&12>e.dc?"AM":"PM"},"%S":function(e){return s(e.Lc,2)},"%t":function(){return"\t"},"%u":function(e){return e.Tb||7},"%U":function(e){return s(Math.floor((e.Wb+7-e.Tb)/7),2)},"%V":function(e){var t=Math.floor((e.Wb+7-(e.Tb+6)%7)/7);if(2>=(e.Tb+371-e.Wb-2)%7&&t++,t)53==t&&(4==(n=(e.Tb+371-e.Wb)%7)||3==n&&it(e.Xb)||(t=1));else{t=52;var n=(e.Tb+7-e.Wb-1)%7;(4==n||5==n&&it(e.Xb%400-1))&&t++}return s(t,2)},"%w":function(e){return e.Tb},"%W":function(e){return s(Math.floor((e.Wb+7-(e.Tb+6)%7)/7),2)},"%y":function(e){return(e.Xb+1900).toString().substring(2)},"%Y":function(e){return e.Xb+1900},"%z":function(e){var t=0<=(e=e.Jc);return e=Math.abs(e)/60,(t?"+":"-")+String("0000"+(e/60*100+e%60)).slice(-4)},"%Z":function(e){return e.Mc},"%%":function(){return"%"}},r=r.replace(/%%/g,"\0\0"),d)r.includes(f)&&(r=r.replace(new RegExp(f,"g"),d[f](o)));return p=r=r.replace(/\0\0/g,"%"),h=Array(q(p)+1),H(p,h,0,h.length),(f=h).length>n?0:(function(e,n){t().set(e,n>>>0)}(f,e),f.length-1)}pe.fc();var ct=[null,de,me,Ee,Pe,Oe,Ae,$e,Re,Ie,Ce,De,Ne,Me,Le,je,Fe,ze,Ve,qe,Qe,Ze,Je,et,tt,ot],dt={b:function(e){return pt(e+24)+24},n:function(e){return(e=new xe(e)).uc()||(e.hc(!0),we--),e.ic(!1),ve.push(e),e.sc(),e.vc()},ma:function(e){throw $("Unexpected exception thrown, this is not properly supported - aborting"),B=!0,e},x:function(){xt(0);var e=ve.pop();if(e.Hc()&&!e.kc()){var t=e.Dc();t&&be(t)(e.Zb),Te(e.Zb)}Se=0},e:function(){var e=Se;if(!e)return at=0;var t=new xe(e);t.cc(e);var n=t.bc();if(!n)return at=0,e;for(var r=Array.prototype.slice.call(arguments),o=0;o<r.length;o++){var a=r[o];if(0===a||a===n)break;if(Ot(a,n,t.Sb+16))return at=a,e}return at=n,e},l:function(){var e=Se;if(!e)return at=0;var t=new xe(e);t.cc(e);var n=t.bc();if(!n)return at=0,e;for(var r=Array.prototype.slice.call(arguments),o=0;o<r.length;o++){var a=r[o];if(0===a||a===n)break;if(Ot(a,n,t.Sb+16))return at=a,e}return at=n,e},h:function(){var e=Se;if(!e)return at=0;var t=new xe(e);t.cc(e);var n=t.bc();if(!n)return at=0,e;for(var r=Array.prototype.slice.call(arguments),o=0;o<r.length;o++){var a=r[o];if(0===a||a===n)break;if(Ot(a,n,t.Sb+16))return at=a,e}return at=n,e},t:Te,M:function(){var e=ve.pop();e||oe("no exception to throw");var t=e.Zb;throw e.kc()||(ve.push(e),e.ic(!0),e.hc(!1),we++),Se=t,t},c:function(e,t,n){throw new xe(e).fc(t,n),Se=e,we++,e},pa:function(){return we},Fa:function(e){bt(e,!w,1,!v),pe.pc()},T:function(e){x?postMessage({cmd:"cleanupThread",thread:e}):ue(e)},xa:ke,j:function(e){throw Se||(Se=e),e},H:Pe,Ma:Oe,ua:Ae,wa:$e,oa:Re,Ka:Ie,Ca:Ce,Ja:De,V:Ne,va:Me,sa:Le,La:je,ta:Fe,Ta:function(){},X:function(){oe("To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking")},Ua:function(){oe("To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking")},W:function(){return Date.now()},ya:function(){return 2097152},Oa:function(){return!0},za:function(e,t,n,r){if(e==t)setTimeout(()=>Be(r));else if(x)postMessage({targetThread:e,cmd:"processProxyingQueue",queue:r});else{if(!(e=pe.Vb[e]))return;e.postMessage({cmd:"processProxyingQueue",queue:r})}return 1},Ea:function(){return-1},Pa:function(e,t){e=new Date(1e3*Ue(e)),a()[t>>2>>>0]=e.getUTCSeconds(),a()[t+4>>2>>>0]=e.getUTCMinutes(),a()[t+8>>2>>>0]=e.getUTCHours(),a()[t+12>>2>>>0]=e.getUTCDate(),a()[t+16>>2>>>0]=e.getUTCMonth(),a()[t+20>>2>>>0]=e.getUTCFullYear()-1900,a()[t+24>>2>>>0]=e.getUTCDay(),e=(e.getTime()-Date.UTC(e.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,a()[t+28>>2>>>0]=e},Qa:function(e,t){e=new Date(1e3*Ue(e)),a()[t>>2>>>0]=e.getSeconds(),a()[t+4>>2>>>0]=e.getMinutes(),a()[t+8>>2>>>0]=e.getHours(),a()[t+12>>2>>>0]=e.getDate(),a()[t+16>>2>>>0]=e.getMonth(),a()[t+20>>2>>>0]=e.getFullYear()-1900,a()[t+24>>2>>>0]=e.getDay();var n=new Date(e.getFullYear(),0,1),r=(e.getTime()-n.getTime())/864e5|0;a()[t+28>>2>>>0]=r,a()[t+36>>2>>>0]=-60*e.getTimezoneOffset(),r=new Date(e.getFullYear(),6,1).getTimezoneOffset(),e=0|(r!=(n=n.getTimezoneOffset())&&e.getTimezoneOffset()==Math.min(n,r)),a()[t+32>>2>>>0]=e},Ra:function(e){var t=new Date(a()[e+20>>2>>>0]+1900,a()[e+16>>2>>>0],a()[e+12>>2>>>0],a()[e+8>>2>>>0],a()[e+4>>2>>>0],a()[e>>2>>>0],0),n=a()[e+32>>2>>>0],r=t.getTimezoneOffset(),o=new Date(t.getFullYear(),0,1),i=new Date(t.getFullYear(),6,1).getTimezoneOffset(),s=o.getTimezoneOffset(),l=Math.min(s,i);return 0>n?a()[e+32>>2>>>0]=Number(i!=s&&l==r):0<n!=(l==r)&&(i=Math.max(s,i),t.setTime(t.getTime()+6e4*((0<n?l:i)-r))),a()[e+24>>2>>>0]=t.getDay(),n=(t.getTime()-o.getTime())/864e5|0,a()[e+28>>2>>>0]=n,a()[e>>2>>>0]=t.getSeconds(),a()[e+4>>2>>>0]=t.getMinutes(),a()[e+8>>2>>>0]=t.getHours(),a()[e+12>>2>>>0]=t.getDate(),a()[e+16>>2>>>0]=t.getMonth(),t.getTime()/1e3|0},Aa:ze,Ba:Ve,Sa:function e(t,n,r){e.Ac||(e.Ac=!0,qe(t,n,r))},y:function(){oe("")},U:function(){if(!S&&!w){var e="Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread";ye||(ye={}),ye[e]||(ye[e]=1,S&&(e="warning: "+e),$(e))}},ra:function(){return 4294901760},B:_e,Ia:function(e,t,n){o().copyWithin(e>>>0,t>>>0,t+n>>>0)},F:function(){return S?n(3993).cpus().length:navigator.hardwareConcurrency},Da:function(e,t,n){Ye.length=t,n>>=3;for(var r=0;r<t;r++)Ye[r]=s()[n+r>>>0];return(0>e?se[-e-1]:ct[e]).apply(null,Ye)},qa:function(e){var t=o().length;if((e>>>=0)<=t||4294901760<e)return!1;for(var n=1;4>=n;n*=2){var r=t*(1+.2/n);r=Math.min(r,e+100663296);var a=Math;r=Math.max(e,r),a=a.min.call(a,4294901760,r+(65536-r%65536)%65536);e:{try{I.grow(a-D.byteLength+65535>>>16),G(I.buffer);var i=1;break e}catch(s){}i=void 0}if(i)return!0}return!1},Na:function(){throw"unwind"},Ga:Qe,Ha:Ze,J:fe,I:Je,S:et,ga:tt,R:ot,d:function(){return at},na:function e(r,o){e.lc||(e.lc=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var e=new Uint8Array(1);return()=>(crypto.getRandomValues(e),e[0])}if(S)try{var t=n(Object(function(){var e=new Error("Cannot find module 'crypto'");throw e.code="MODULE_NOT_FOUND",e}()));return()=>t.randomBytes(1)[0]}catch(r){}return()=>oe("randomDevice")}());for(var a=0;a<o;a++)t()[(r+a|0)>>>0]=e.lc();return 0},ia:function(e,t,n){var r=Et();try{return be(e)(t,n)}catch(o){if(kt(r),o!==o+0)throw o;xt(1,0)}},ja:function(e,t,n){var r=Et();try{return be(e)(t,n)}catch(o){if(kt(r),o!==o+0)throw o;xt(1,0)}},K:function(e){var t=Et();try{return be(e)()}catch(n){if(kt(t),n!==n+0)throw n;xt(1,0)}},f:function(e,t){var n=Et();try{return be(e)(t)}catch(r){if(kt(n),r!==r+0)throw r;xt(1,0)}},P:function(e,t,n){var r=Et();try{return be(e)(t,n)}catch(o){if(kt(r),o!==o+0)throw o;xt(1,0)}},Q:function(e,t,n){var r=Et();try{return be(e)(t,n)}catch(o){if(kt(r),o!==o+0)throw o;xt(1,0)}},k:function(e,t,n){var r=Et();try{return be(e)(t,n)}catch(o){if(kt(r),o!==o+0)throw o;xt(1,0)}},p:function(e,t,n,r){var o=Et();try{return be(e)(t,n,r)}catch(a){if(kt(o),a!==a+0)throw a;xt(1,0)}},q:function(e,t,n,r,o){var a=Et();try{return be(e)(t,n,r,o)}catch(i){if(kt(a),i!==i+0)throw i;xt(1,0)}},N:function(e,t,n,r,o,a){var i=Et();try{return be(e)(t,n,r,o,a)}catch(s){if(kt(i),s!==s+0)throw s;xt(1,0)}},s:function(e,t,n,r,o,a){var i=Et();try{return be(e)(t,n,r,o,a)}catch(s){if(kt(i),s!==s+0)throw s;xt(1,0)}},w:function(e,t,n,r,o,a,i){var s=Et();try{return be(e)(t,n,r,o,a,i)}catch(l){if(kt(s),l!==l+0)throw l;xt(1,0)}},L:function(e,t,n,r,o,a,i,s){var l=Et();try{return be(e)(t,n,r,o,a,i,s)}catch(u){if(kt(l),u!==u+0)throw u;xt(1,0)}},E:function(e,t,n,r,o,a,i,s,l,u,c,d){var f=Et();try{return be(e)(t,n,r,o,a,i,s,l,u,c,d)}catch(p){if(kt(f),p!==p+0)throw p;xt(1,0)}},aa:function(e,t,n,r,o,a,i,s){var l=Et();try{return jt(e,t,n,r,o,a,i,s)}catch(u){if(kt(l),u!==u+0)throw u;xt(1,0)}},_:function(e,t,n,r,o,a,i){var s=Et();try{return Rt(e,t,n,r,o,a,i)}catch(l){if(kt(s),l!==l+0)throw l;xt(1,0)}},Z:function(e,t,n,r,o){var a=Et();try{return Ft(e,t,n,r,o)}catch(i){if(kt(a),i!==i+0)throw i;xt(1,0)}},ca:function(e,t,n,r){var o=Et();try{return Mt(e,t,n,r)}catch(a){if(kt(o),a!==a+0)throw a;xt(1,0)}},$:function(e){var t=Et();try{return $t(e)}catch(n){if(kt(t),n!==n+0)throw n;xt(1,0)}},ba:function(e,t){var n=Et();try{return Lt(e,t)}catch(r){if(kt(n),r!==r+0)throw r;xt(1,0)}},Y:function(e,t,n){var r=Et();try{return It(e,t,n)}catch(o){if(kt(r),o!==o+0)throw o;xt(1,0)}},g:function(e){var t=Et();try{be(e)()}catch(n){if(kt(t),n!==n+0)throw n;xt(1,0)}},r:function(e,t){var n=Et();try{be(e)(t)}catch(r){if(kt(n),r!==r+0)throw r;xt(1,0)}},i:function(e,t,n){var r=Et();try{be(e)(t,n)}catch(o){if(kt(r),o!==o+0)throw o;xt(1,0)}},ha:function(e,t,n,r){var o=Et();try{be(e)(t,n,r)}catch(a){if(kt(o),a!==a+0)throw a;xt(1,0)}},m:function(e,t,n,r){var o=Et();try{be(e)(t,n,r)}catch(a){if(kt(o),a!==a+0)throw a;xt(1,0)}},v:function(e,t,n,r,o){var a=Et();try{be(e)(t,n,r,o)}catch(i){if(kt(a),i!==i+0)throw i;xt(1,0)}},u:function(e,t,n,r,o,a){var i=Et();try{be(e)(t,n,r,o,a)}catch(s){if(kt(i),s!==s+0)throw s;xt(1,0)}},O:function(e,t,n,r,o,a,i){var s=Et();try{be(e)(t,n,r,o,a,i)}catch(l){if(kt(s),l!==l+0)throw l;xt(1,0)}},A:function(e,t,n,r,o,a,i,s){var l=Et();try{be(e)(t,n,r,o,a,i,s)}catch(u){if(kt(l),u!==u+0)throw u;xt(1,0)}},ka:function(e,t,n,r,o,a,i,s,l){var u=Et();try{be(e)(t,n,r,o,a,i,s,l)}catch(c){if(kt(u),c!==c+0)throw c;xt(1,0)}},C:function(e,t,n,r,o,a,i,s,l,u,c){var d=Et();try{be(e)(t,n,r,o,a,i,s,l,u,c)}catch(f){if(kt(d),f!==f+0)throw f;xt(1,0)}},D:function(e,t,n,r,o,a,i,s,l,u,c,d,f,p,h,m){var g=Et();try{be(e)(t,n,r,o,a,i,s,l,u,c,d,f,p,h,m)}catch(b){if(kt(g),b!==b+0)throw b;xt(1,0)}},fa:function(e,t,n,r,o,a,i,s){var l=Et();try{Ct(e,t,n,r,o,a,i,s)}catch(u){if(kt(l),u!==u+0)throw u;xt(1,0)}},da:function(e,t,n,r,o,a,i,s,l,u,c,d){var f=Et();try{Nt(e,t,n,r,o,a,i,s,l,u,c,d)}catch(p){if(kt(f),p!==p+0)throw p;xt(1,0)}},ea:function(e,t,n,r,o,a){var i=Et();try{Dt(e,t,n,r,o,a)}catch(s){if(kt(i),s!==s+0)throw s;xt(1,0)}},o:function(e){return e},a:I||l.wasmMemory,G:function(e){at=e},la:ut,z:function(e,t,n,r){return ut(e,t,n,r)}};!function(){function e(e,t){l.asm=e.exports,pe.qc.push(l.asm.sb),Y=l.asm.ub,X.unshift(l.asm.Va),C=t,x||(ne--,l.monitorRunDependencies&&l.monitorRunDependencies(ne),0==ne&&re&&(e=re,re=null,e()))}function t(t){e(t.instance,t.module)}function n(e){return function(){if(!O&&(v||w)){if("function"==typeof fetch&&!te.startsWith("file://"))return fetch(te,{credentials:"same-origin"}).then(function(e){if(!e.ok)throw"failed to load wasm binary file at '"+te+"'";return e.arrayBuffer()}).catch(function(){return ie()});if(f)return new Promise(function(e,t){f(te,function(t){e(new Uint8Array(t))},t)})}return Promise.resolve().then(function(){return ie()})}().then(function(e){return WebAssembly.instantiate(e,r)}).then(function(e){return e}).then(e,function(e){$("failed to asynchronously prepare wasm: "+e),oe(e)})}var r={a:dt};if(x||(ne++,l.monitorRunDependencies&&l.monitorRunDependencies(ne)),l.instantiateWasm)try{return l.instantiateWasm(r,e)}catch(o){return $("Module.instantiateWasm callback failed with error: "+o),!1}(O||"function"!=typeof WebAssembly.instantiateStreaming||ae()||te.startsWith("file://")||S||"function"!=typeof fetch?n(t):fetch(te,{credentials:"same-origin"}).then(function(e){return WebAssembly.instantiateStreaming(e,r).then(t,function(e){return $("wasm streaming compile failed: "+e),$("falling back to ArrayBuffer instantiation"),n(t)})})).catch(c)}(),l.___wasm_call_ctors=function(){return(l.___wasm_call_ctors=l.asm.Va).apply(null,arguments)},l._OrtInit=function(){return(l._OrtInit=l.asm.Wa).apply(null,arguments)},l._OrtCreateSessionOptions=function(){return(l._OrtCreateSessionOptions=l.asm.Xa).apply(null,arguments)},l._OrtAppendExecutionProvider=function(){return(l._OrtAppendExecutionProvider=l.asm.Ya).apply(null,arguments)},l._OrtAddSessionConfigEntry=function(){return(l._OrtAddSessionConfigEntry=l.asm.Za).apply(null,arguments)},l._OrtReleaseSessionOptions=function(){return(l._OrtReleaseSessionOptions=l.asm._a).apply(null,arguments)},l._OrtCreateSession=function(){return(l._OrtCreateSession=l.asm.$a).apply(null,arguments)},l._OrtReleaseSession=function(){return(l._OrtReleaseSession=l.asm.ab).apply(null,arguments)},l._OrtGetInputCount=function(){return(l._OrtGetInputCount=l.asm.bb).apply(null,arguments)},l._OrtGetOutputCount=function(){return(l._OrtGetOutputCount=l.asm.cb).apply(null,arguments)},l._OrtGetInputName=function(){return(l._OrtGetInputName=l.asm.db).apply(null,arguments)},l._OrtGetOutputName=function(){return(l._OrtGetOutputName=l.asm.eb).apply(null,arguments)},l._OrtFree=function(){return(l._OrtFree=l.asm.fb).apply(null,arguments)},l._OrtCreateTensor=function(){return(l._OrtCreateTensor=l.asm.gb).apply(null,arguments)},l._OrtGetTensorData=function(){return(l._OrtGetTensorData=l.asm.hb).apply(null,arguments)},l._OrtReleaseTensor=function(){return(l._OrtReleaseTensor=l.asm.ib).apply(null,arguments)},l._OrtCreateRunOptions=function(){return(l._OrtCreateRunOptions=l.asm.jb).apply(null,arguments)},l._OrtAddRunConfigEntry=function(){return(l._OrtAddRunConfigEntry=l.asm.kb).apply(null,arguments)},l._OrtReleaseRunOptions=function(){return(l._OrtReleaseRunOptions=l.asm.lb).apply(null,arguments)},l._OrtRun=function(){return(l._OrtRun=l.asm.mb).apply(null,arguments)},l._OrtEndProfiling=function(){return(l._OrtEndProfiling=l.asm.nb).apply(null,arguments)};var ft=l._pthread_self=function(){return(ft=l._pthread_self=l.asm.ob).apply(null,arguments)},pt=l._malloc=function(){return(pt=l._malloc=l.asm.pb).apply(null,arguments)},ht=l._free=function(){return(ht=l._free=l.asm.qb).apply(null,arguments)},mt=l._fflush=function(){return(mt=l._fflush=l.asm.rb).apply(null,arguments)};l.__emscripten_tls_init=function(){return(l.__emscripten_tls_init=l.asm.sb).apply(null,arguments)};var gt=l.___funcs_on_exit=function(){return(gt=l.___funcs_on_exit=l.asm.tb).apply(null,arguments)},bt=l.__emscripten_thread_init=function(){return(bt=l.__emscripten_thread_init=l.asm.vb).apply(null,arguments)};l.__emscripten_thread_crashed=function(){return(l.__emscripten_thread_crashed=l.asm.wb).apply(null,arguments)};var yt,_t=l._emscripten_run_in_main_runtime_thread_js=function(){return(_t=l._emscripten_run_in_main_runtime_thread_js=l.asm.xb).apply(null,arguments)},vt=l.__emscripten_proxy_execute_task_queue=function(){return(vt=l.__emscripten_proxy_execute_task_queue=l.asm.yb).apply(null,arguments)},wt=l.__emscripten_thread_free_data=function(){return(wt=l.__emscripten_thread_free_data=l.asm.zb).apply(null,arguments)},St=l.__emscripten_thread_exit=function(){return(St=l.__emscripten_thread_exit=l.asm.Ab).apply(null,arguments)},xt=l._setThrew=function(){return(xt=l._setThrew=l.asm.Bb).apply(null,arguments)},Tt=l._emscripten_stack_set_limits=function(){return(Tt=l._emscripten_stack_set_limits=l.asm.Cb).apply(null,arguments)},Et=l.stackSave=function(){return(Et=l.stackSave=l.asm.Db).apply(null,arguments)},kt=l.stackRestore=function(){return(kt=l.stackRestore=l.asm.Eb).apply(null,arguments)},Pt=l.stackAlloc=function(){return(Pt=l.stackAlloc=l.asm.Fb).apply(null,arguments)},Ot=l.___cxa_can_catch=function(){return(Ot=l.___cxa_can_catch=l.asm.Gb).apply(null,arguments)},At=l.___cxa_is_pointer_type=function(){return(At=l.___cxa_is_pointer_type=l.asm.Hb).apply(null,arguments)},$t=l.dynCall_j=function(){return($t=l.dynCall_j=l.asm.Ib).apply(null,arguments)},Rt=l.dynCall_iiiiij=function(){return(Rt=l.dynCall_iiiiij=l.asm.Jb).apply(null,arguments)},It=l.dynCall_jii=function(){return(It=l.dynCall_jii=l.asm.Kb).apply(null,arguments)},Ct=l.dynCall_viiiiij=function(){return(Ct=l.dynCall_viiiiij=l.asm.Lb).apply(null,arguments)},Dt=l.dynCall_vjji=function(){return(Dt=l.dynCall_vjji=l.asm.Mb).apply(null,arguments)},Nt=l.dynCall_viiijjjii=function(){return(Nt=l.dynCall_viiijjjii=l.asm.Nb).apply(null,arguments)},Mt=l.dynCall_iij=function(){return(Mt=l.dynCall_iij=l.asm.Ob).apply(null,arguments)},Lt=l.dynCall_ji=function(){return(Lt=l.dynCall_ji=l.asm.Pb).apply(null,arguments)},jt=l.dynCall_iiiiiij=function(){return(jt=l.dynCall_iiiiiij=l.asm.Qb).apply(null,arguments)},Ft=l.dynCall_iiij=function(){return(Ft=l.dynCall_iiij=l.asm.Rb).apply(null,arguments)};function Bt(){function e(){if(!yt&&(yt=!0,l.calledRun=!0,!B)&&(x||he(X),u(l),l.onRuntimeInitialized&&l.onRuntimeInitialized(),!x)){if(l.postRun)for("function"==typeof l.postRun&&(l.postRun=[l.postRun]);l.postRun.length;){var e=l.postRun.shift();Z.unshift(e)}he(Z)}}if(!(0<ne))if(x)u(l),x||he(X),postMessage({cmd:"loaded"});else{if(l.preRun)for("function"==typeof l.preRun&&(l.preRun=[l.preRun]);l.preRun.length;)ee();he(K),0<ne||(l.setStatus?(l.setStatus("Running..."),setTimeout(function(){setTimeout(function(){l.setStatus("")},1),e()},1)):e())}}if(l.UTF8ToString=V,l.stringToUTF8=function(e,t,n){return H(e,o(),t,n)},l.lengthBytesUTF8=q,l.keepRuntimeAlive=J,l.wasmMemory=I,l.stackSave=Et,l.stackRestore=kt,l.stackAlloc=Pt,l.ExitStatus=le,l.PThread=pe,re=function e(){yt||Bt(),yt||(re=e)},l.preInit)for("function"==typeof l.preInit&&(l.preInit=[l.preInit]);0<l.preInit.length;)l.preInit.pop()();return Bt(),e.ready});e.exports=o},932:(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,a;e=e||{},t||(t=void 0!==e?e:{}),t.ready=new Promise(function(e,t){o=e,a=t});var i,s,l,u,c,d,f=Object.assign({},t),p="./this.program",h=(e,t)=>{throw t},m="object"==typeof window,g="function"==typeof importScripts,b="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,y="";b?(y=g?n(908).dirname(y)+"/":"//",d=()=>{c||(u=n(1384),c=n(908))},i=function(e,t){return d(),e=c.normalize(e),u.readFileSync(e,t?void 0:"utf8")},l=e=>((e=i(e,!0)).buffer||(e=new Uint8Array(e)),e),s=(e,t,n)=>{d(),e=c.normalize(e),u.readFile(e,function(e,r){e?n(e):t(r.buffer)})},1<process.argv.length&&(p=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),process.on("uncaughtException",function(e){if(!(e instanceof X))throw e}),process.on("unhandledRejection",function(e){throw e}),h=(e,t)=>{if(S||0<U)throw process.exitCode=e,t;t instanceof X||w("exiting due to exception: "+t),process.exit(e)},t.inspect=function(){return"[Emscripten Module object]"}):(m||g)&&(g?y=self.location.href:"undefined"!=typeof document&&document.currentScript&&(y=document.currentScript.src),r&&(y=r),y=0!==y.indexOf("blob:")?y.substr(0,y.replace(/[?#].*/,"").lastIndexOf("/")+1):"",i=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},g&&(l=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),s=(e,t,n)=>{var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?t(r.response):n()},r.onerror=n,r.send(null)});var _,v=t.print||console.log.bind(console),w=t.printErr||console.warn.bind(console);Object.assign(t,f),f=null,t.thisProgram&&(p=t.thisProgram),t.quit&&(h=t.quit),t.wasmBinary&&(_=t.wasmBinary);var S=t.noExitRuntime||!1;"object"!=typeof WebAssembly&&G("no native wasm support detected");var x,T,E,k,P,O,A=!1,$="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function R(e,t,n){var r=(t>>>=0)+n;for(n=t;e[n]&&!(n>=r);)++n;if(16<n-t&&e.buffer&&$)return $.decode(e.subarray(t,n));for(r="";t<n;){var o=e[t++];if(128&o){var a=63&e[t++];if(192==(224&o))r+=String.fromCharCode((31&o)<<6|a);else{var i=63&e[t++];65536>(o=224==(240&o)?(15&o)<<12|a<<6|i:(7&o)<<18|a<<12|i<<6|63&e[t++])?r+=String.fromCharCode(o):(o-=65536,r+=String.fromCharCode(55296|o>>10,56320|1023&o))}}else r+=String.fromCharCode(o)}return r}function I(e,t){return(e>>>=0)?R(k,e,t):""}function C(e,t,n,r){if(!(0<r))return 0;var o=n>>>=0;r=n+r-1;for(var a=0;a<e.length;++a){var i=e.charCodeAt(a);if(55296<=i&&57343>=i&&(i=65536+((1023&i)<<10)|1023&e.charCodeAt(++a)),127>=i){if(n>=r)break;t[n++>>>0]=i}else{if(2047>=i){if(n+1>=r)break;t[n++>>>0]=192|i>>6}else{if(65535>=i){if(n+2>=r)break;t[n++>>>0]=224|i>>12}else{if(n+3>=r)break;t[n++>>>0]=240|i>>18,t[n++>>>0]=128|i>>12&63}t[n++>>>0]=128|i>>6&63}t[n++>>>0]=128|63&i}}return t[n>>>0]=0,n-o}function D(e){for(var t=0,n=0;n<e.length;++n){var r=e.charCodeAt(n);127>=r?t++:2047>=r?t+=2:55296<=r&&57343>=r?(t+=4,++n):t+=3}return t}function N(){var e=x.buffer;T=e,t.HEAP8=E=new Int8Array(e),t.HEAP16=new Int16Array(e),t.HEAP32=P=new Int32Array(e),t.HEAPU8=k=new Uint8Array(e),t.HEAPU16=new Uint16Array(e),t.HEAPU32=O=new Uint32Array(e),t.HEAPF32=new Float32Array(e),t.HEAPF64=new Float64Array(e)}var M,L=[],j=[],F=[],B=[],U=0;function z(){var e=t.preRun.shift();L.unshift(e)}var V,H=0,q=null;function G(e){throw t.onAbort&&t.onAbort(e),w(e="Aborted("+e+")"),A=!0,e=new WebAssembly.RuntimeError(e+". Build with -sASSERTIONS for more info."),a(e),e}function W(){return V.startsWith("data:application/octet-stream;base64,")}if(V="ort-wasm.wasm",!W()){var Y=V;V=t.locateFile?t.locateFile(Y,y):y+Y}function K(){var e=V;try{if(e==V&&_)return new Uint8Array(_);if(l)return l(e);throw"both async and sync fetching of the wasm failed"}catch(t){G(t)}}function X(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function Q(e){for(;0<e.length;)e.shift()(t)}var Z=[],J=0,ee=0;function te(e){this.Db=e,this.zb=e-24,this.Ub=function(e){O[this.zb+4>>2>>>0]=e},this.Eb=function(){return O[this.zb+4>>2>>>0]},this.Sb=function(e){O[this.zb+8>>2>>>0]=e},this.Wb=function(){return O[this.zb+8>>2>>>0]},this.Tb=function(){P[this.zb>>2>>>0]=0},this.Ib=function(e){E[(this.zb+12|0)>>>0]=e?1:0},this.Pb=function(){return 0!=E[(this.zb+12|0)>>>0]},this.Jb=function(e){E[(this.zb+13|0)>>>0]=e?1:0},this.Lb=function(){return 0!=E[(this.zb+13|0)>>>0]},this.Rb=function(e,t){this.Fb(0),this.Ub(e),this.Sb(t),this.Tb(),this.Ib(!1),this.Jb(!1)},this.Nb=function(){P[this.zb>>2>>>0]+=1},this.Xb=function(){var e=P[this.zb>>2>>>0];return P[this.zb>>2>>>0]=e-1,1===e},this.Fb=function(e){O[this.zb+16>>2>>>0]=e},this.Ob=function(){return O[this.zb+16>>2>>>0]},this.Qb=function(){if(Pe(this.Eb()))return O[this.Db>>2>>>0];var e=this.Ob();return 0!==e?e:this.Db}}function ne(e){return _e(new te(e).zb)}var re=[];function oe(e){var t=re[e];return t||(e>=re.length&&(re.length=e+1),re[e]=t=M.get(e)),t}function ae(e){var t=D(e)+1,n=ye(t);return n&&C(e,E,n,t),n}var ie={};function se(){if(!le){var e,t={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",_:p||"./this.program"};for(e in ie)void 0===ie[e]?delete t[e]:t[e]=ie[e];var n=[];for(e in t)n.push(e+"="+t[e]);le=n}return le}var le,ue=[null,[],[]];function ce(e,t){var n=ue[e];0===t||10===t?((1===e?v:w)(R(n,0)),n.length=0):n.push(t)}var de=0;function fe(e){return 0==e%4&&(0!=e%100||0==e%400)}var pe=[31,29,31,30,31,30,31,31,30,31,30,31],he=[31,28,31,30,31,30,31,31,30,31,30,31];function me(e,t,n,r){function o(e,t,n){for(e="number"==typeof e?e.toString():e||"";e.length<t;)e=n[0]+e;return e}function a(e,t){return o(e,t,"0")}function i(e,t){function n(e){return 0>e?-1:0<e?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 s(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 l(e){var t=e.Bb;for(e=new Date(new Date(e.Cb+1900,0,1).getTime());0<t;){var n=e.getMonth(),r=(fe(e.getFullYear())?pe:he)[n];if(!(t>r-e.getDate())){e.setDate(e.getDate()+t);break}t-=r-e.getDate()+1,e.setDate(1),11>n?e.setMonth(n+1):(e.setMonth(0),e.setFullYear(e.getFullYear()+1))}return n=new Date(e.getFullYear()+1,0,4),t=s(new Date(e.getFullYear(),0,4)),n=s(n),0>=i(t,e)?0>=i(n,e)?e.getFullYear()+1:e.getFullYear():e.getFullYear()-1}var u=P[r+40>>2>>>0];for(var c in r={$b:P[r>>2>>>0],Zb:P[r+4>>2>>>0],Gb:P[r+8>>2>>>0],Kb:P[r+12>>2>>>0],Hb:P[r+16>>2>>>0],Cb:P[r+20>>2>>>0],Ab:P[r+24>>2>>>0],Bb:P[r+28>>2>>>0],bc:P[r+32>>2>>>0],Yb:P[r+36>>2>>>0],ac:u?I(u):""},n=I(n),u={"%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"})n=n.replace(new RegExp(c,"g"),u[c]);var d,f,p="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),h="January February March April May June July August September October November December".split(" ");for(c in u={"%a":function(e){return p[e.Ab].substring(0,3)},"%A":function(e){return p[e.Ab]},"%b":function(e){return h[e.Hb].substring(0,3)},"%B":function(e){return h[e.Hb]},"%C":function(e){return a((e.Cb+1900)/100|0,2)},"%d":function(e){return a(e.Kb,2)},"%e":function(e){return o(e.Kb,2," ")},"%g":function(e){return l(e).toString().substring(2)},"%G":function(e){return l(e)},"%H":function(e){return a(e.Gb,2)},"%I":function(e){return 0==(e=e.Gb)?e=12:12<e&&(e-=12),a(e,2)},"%j":function(e){for(var t=0,n=0;n<=e.Hb-1;t+=(fe(e.Cb+1900)?pe:he)[n++]);return a(e.Kb+t,3)},"%m":function(e){return a(e.Hb+1,2)},"%M":function(e){return a(e.Zb,2)},"%n":function(){return"\n"},"%p":function(e){return 0<=e.Gb&&12>e.Gb?"AM":"PM"},"%S":function(e){return a(e.$b,2)},"%t":function(){return"\t"},"%u":function(e){return e.Ab||7},"%U":function(e){return a(Math.floor((e.Bb+7-e.Ab)/7),2)},"%V":function(e){var t=Math.floor((e.Bb+7-(e.Ab+6)%7)/7);if(2>=(e.Ab+371-e.Bb-2)%7&&t++,t)53==t&&(4==(n=(e.Ab+371-e.Bb)%7)||3==n&&fe(e.Cb)||(t=1));else{t=52;var n=(e.Ab+7-e.Bb-1)%7;(4==n||5==n&&fe(e.Cb%400-1))&&t++}return a(t,2)},"%w":function(e){return e.Ab},"%W":function(e){return a(Math.floor((e.Bb+7-(e.Ab+6)%7)/7),2)},"%y":function(e){return(e.Cb+1900).toString().substring(2)},"%Y":function(e){return e.Cb+1900},"%z":function(e){var t=0<=(e=e.Yb);return e=Math.abs(e)/60,(t?"+":"-")+String("0000"+(e/60*100+e%60)).slice(-4)},"%Z":function(e){return e.ac},"%%":function(){return"%"}},n=n.replace(/%%/g,"\0\0"),u)n.includes(c)&&(n=n.replace(new RegExp(c,"g"),u[c](r)));return d=n=n.replace(/\0\0/g,"%"),f=Array(D(d)+1),C(d,f,0,f.length),(c=f).length>t?0:(E.set(c,e>>>0),c.length-1)}var ge={a:function(e){return ye(e+24)+24},m:function(e){return(e=new te(e)).Pb()||(e.Ib(!0),J--),e.Jb(!1),Z.push(e),e.Nb(),e.Qb()},ia:function(e){throw w("Unexpected exception thrown, this is not properly supported - aborting"),A=!0,e},w:function(){Se(0);var e=Z.pop();if(e.Xb()&&!e.Lb()){var t=e.Wb();t&&oe(t)(e.Db),ne(e.Db)}ee=0},d:function(){var e=ee;if(!e)return de=0;var t=new te(e);t.Fb(e);var n=t.Eb();if(!n)return de=0,e;for(var r=Array.prototype.slice.call(arguments),o=0;o<r.length;o++){var a=r[o];if(0===a||a===n)break;if(ke(a,n,t.zb+16))return de=a,e}return de=n,e},k:function(){var e=ee;if(!e)return de=0;var t=new te(e);t.Fb(e);var n=t.Eb();if(!n)return de=0,e;for(var r=Array.prototype.slice.call(arguments),o=0;o<r.length;o++){var a=r[o];if(0===a||a===n)break;if(ke(a,n,t.zb+16))return de=a,e}return de=n,e},g:function(){var e=ee;if(!e)return de=0;var t=new te(e);t.Fb(e);var n=t.Eb();if(!n)return de=0,e;for(var r=Array.prototype.slice.call(arguments),o=0;o<r.length;o++){var a=r[o];if(0===a||a===n)break;if(ke(a,n,t.zb+16))return de=a,e}return de=n,e},s:ne,L:function(){var e=Z.pop();e||G("no exception to throw");var t=e.Db;throw e.Lb()||(Z.push(e),e.Jb(!0),e.Ib(!1),J++),ee=t,t},b:function(e,t,n){throw new te(e).Rb(t,n),ee=e,J++,e},la:function(){return J},i:function(e){throw ee||(ee=e),e},H:function(){return 0},Ba:function(){},pa:function(){},ra:function(){},ka:function(){return 0},za:function(){},ua:function(){},ya:function(){},R:function(){},qa:function(){},na:function(){},Aa:function(){},oa:function(){},Ha:function(){},Ja:function(){G("To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking")},Ia:function(){G("To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking")},S:function(){return Date.now()},Ca:function(){return!0},Da:function(e,t){e=new Date(1e3*(O[e>>>2]+4294967296*P[e+4>>>2])),P[t>>2>>>0]=e.getUTCSeconds(),P[t+4>>2>>>0]=e.getUTCMinutes(),P[t+8>>2>>>0]=e.getUTCHours(),P[t+12>>2>>>0]=e.getUTCDate(),P[t+16>>2>>>0]=e.getUTCMonth(),P[t+20>>2>>>0]=e.getUTCFullYear()-1900,P[t+24>>2>>>0]=e.getUTCDay(),P[t+28>>2>>>0]=(e.getTime()-Date.UTC(e.getUTCFullYear(),0,1,0,0,0,0))/864e5|0},Ea:function(e,t){e=new Date(1e3*(O[e>>>2]+4294967296*P[e+4>>>2])),P[t>>2>>>0]=e.getSeconds(),P[t+4>>2>>>0]=e.getMinutes(),P[t+8>>2>>>0]=e.getHours(),P[t+12>>2>>>0]=e.getDate(),P[t+16>>2>>>0]=e.getMonth(),P[t+20>>2>>>0]=e.getFullYear()-1900,P[t+24>>2>>>0]=e.getDay();var n=new Date(e.getFullYear(),0,1);P[t+28>>2>>>0]=(e.getTime()-n.getTime())/864e5|0,P[t+36>>2>>>0]=-60*e.getTimezoneOffset();var r=new Date(e.getFullYear(),6,1).getTimezoneOffset();n=n.getTimezoneOffset(),P[t+32>>2>>>0]=0|(r!=n&&e.getTimezoneOffset()==Math.min(n,r))},Fa:function(e){var t=new Date(P[e+20>>2>>>0]+1900,P[e+16>>2>>>0],P[e+12>>2>>>0],P[e+8>>2>>>0],P[e+4>>2>>>0],P[e>>2>>>0],0),n=P[e+32>>2>>>0],r=t.getTimezoneOffset(),o=new Date(t.getFullYear(),0,1),a=new Date(t.getFullYear(),6,1).getTimezoneOffset(),i=o.getTimezoneOffset(),s=Math.min(i,a);return 0>n?P[e+32>>2>>>0]=Number(a!=i&&s==r):0<n!=(s==r)&&(a=Math.max(i,a),t.setTime(t.getTime()+6e4*((0<n?s:a)-r))),P[e+24>>2>>>0]=t.getDay(),P[e+28>>2>>>0]=(t.getTime()-o.getTime())/864e5|0,P[e>>2>>>0]=t.getSeconds(),P[e+4>>2>>>0]=t.getMinutes(),P[e+8>>2>>>0]=t.getHours(),P[e+12>>2>>>0]=t.getDate(),P[e+16>>2>>>0]=t.getMonth(),t.getTime()/1e3|0},sa:function(){return-52},ta:function(){},Ga:function e(t,n,r){e.Vb||(e.Vb=!0,function(e,t,n){function r(e){return(e=e.toTimeString().match(/\(([A-Za-z ]+)\)$/))?e[1]:"GMT"}var o=(new Date).getFullYear(),a=new Date(o,0,1),i=new Date(o,6,1);o=a.getTimezoneOffset();var s=i.getTimezoneOffset();P[e>>2>>>0]=60*Math.max(o,s),P[t>>2>>>0]=Number(o!=s),e=r(a),t=r(i),e=ae(e),t=ae(t),s<o?(O[n>>2>>>0]=e,O[n+4>>2>>>0]=t):(O[n>>2>>>0]=t,O[n+4>>2>>>0]=e)}(t,n,r))},B:function(){G("")},ma:function(){return 4294901760},I:b?()=>{var e=process.hrtime();return 1e3*e[0]+e[1]/1e6}:()=>performance.now(),xa:function(e,t,n){k.copyWithin(e>>>0,t>>>0,t+n>>>0)},G:function(e){var t=k.length;if(4294901760<(e>>>=0))return!1;for(var n=1;4>=n;n*=2){var r=t*(1+.2/n);r=Math.min(r,e+100663296);var o=Math;r=Math.max(e,r),o=o.min.call(o,4294901760,r+(65536-r%65536)%65536);e:{try{x.grow(o-T.byteLength+65535>>>16),N();var a=1;break e}catch(i){}a=void 0}if(a)return!0}return!1},va:function(e,t){var n=0;return se().forEach(function(r,o){var a=t+n;for(o=O[e+4*o>>2>>>0]=a,a=0;a<r.length;++a)E[(0|o++)>>>0]=r.charCodeAt(a);E[(0|o)>>>0]=0,n+=r.length+1}),0},wa:function(e,t){var n=se();O[e>>2>>>0]=n.length;var r=0;return n.forEach(function(e){r+=e.length+1}),O[t>>2>>>0]=r,0},ba:function(e){S||0<U||(we(),Q(F),ve(0),ue[1].length&&ce(1,10),ue[2].length&&ce(2,10)),S||0<U||(t.onExit&&t.onExit(e),A=!0),h(e,new X(e))},E:function(){return 52},Q:function(){return 52},ca:function(){return 70},P:function(e,t,n,r){for(var o=0,a=0;a<n;a++){var i=O[t>>2>>>0],s=O[t+4>>2>>>0];t+=8;for(var l=0;l<s;l++)ce(e,k[i+l>>>0]);o+=s}return O[r>>2>>>0]=o,0},c:function(){return de},ja:function e(t,r){e.Mb||(e.Mb=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var e=new Uint8Array(1);return()=>(crypto.getRandomValues(e),e[0])}if(b)try{var t=n(Object(function(){var e=new Error("Cannot find module 'crypto'");throw e.code="MODULE_NOT_FOUND",e}()));return()=>t.randomBytes(1)[0]}catch(r){}return()=>G("randomDevice")}());for(var o=0;o<r;o++)E[(t+o|0)>>>0]=e.Mb();return 0},ea:function(e,t,n){var r=xe();try{return oe(e)(t,n)}catch(o){if(Te(r),o!==o+0)throw o;Se(1,0)}},fa:function(e,t,n){var r=xe();try{return oe(e)(t,n)}catch(o){if(Te(r),o!==o+0)throw o;Se(1,0)}},J:function(e){var t=xe();try{return oe(e)()}catch(n){if(Te(t),n!==n+0)throw n;Se(1,0)}},e:function(e,t){var n=xe();try{return oe(e)(t)}catch(r){if(Te(n),r!==r+0)throw r;Se(1,0)}},N:function(e,t,n){var r=xe();try{return oe(e)(t,n)}catch(o){if(Te(r),o!==o+0)throw o;Se(1,0)}},O:function(e,t,n){var r=xe();try{return oe(e)(t,n)}catch(o){if(Te(r),o!==o+0)throw o;Se(1,0)}},j:function(e,t,n){var r=xe();try{return oe(e)(t,n)}catch(o){if(Te(r),o!==o+0)throw o;Se(1,0)}},o:function(e,t,n,r){var o=xe();try{return oe(e)(t,n,r)}catch(a){if(Te(o),a!==a+0)throw a;Se(1,0)}},p:function(e,t,n,r,o){var a=xe();try{return oe(e)(t,n,r,o)}catch(i){if(Te(a),i!==i+0)throw i;Se(1,0)}},M:function(e,t,n,r,o,a){var i=xe();try{return oe(e)(t,n,r,o,a)}catch(s){if(Te(i),s!==s+0)throw s;Se(1,0)}},r:function(e,t,n,r,o,a){var i=xe();try{return oe(e)(t,n,r,o,a)}catch(s){if(Te(i),s!==s+0)throw s;Se(1,0)}},v:function(e,t,n,r,o,a,i){var s=xe();try{return oe(e)(t,n,r,o,a,i)}catch(l){if(Te(s),l!==l+0)throw l;Se(1,0)}},K:function(e,t,n,r,o,a,i,s){var l=xe();try{return oe(e)(t,n,r,o,a,i,s)}catch(u){if(Te(l),u!==u+0)throw u;Se(1,0)}},D:function(e,t,n,r,o,a,i,s,l,u,c,d){var f=xe();try{return oe(e)(t,n,r,o,a,i,s,l,u,c,d)}catch(p){if(Te(f),p!==p+0)throw p;Se(1,0)}},X:function(e,t,n,r,o,a,i,s){var l=xe();try{return Me(e,t,n,r,o,a,i,s)}catch(u){if(Te(l),u!==u+0)throw u;Se(1,0)}},V:function(e,t,n,r,o,a,i){var s=xe();try{return Ae(e,t,n,r,o,a,i)}catch(l){if(Te(s),l!==l+0)throw l;Se(1,0)}},U:function(e,t,n,r,o){var a=xe();try{return Le(e,t,n,r,o)}catch(i){if(Te(a),i!==i+0)throw i;Se(1,0)}},Z:function(e,t,n,r){var o=xe();try{return De(e,t,n,r)}catch(a){if(Te(o),a!==a+0)throw a;Se(1,0)}},W:function(e){var t=xe();try{return Oe(e)}catch(n){if(Te(t),n!==n+0)throw n;Se(1,0)}},Y:function(e,t){var n=xe();try{return Ne(e,t)}catch(r){if(Te(n),r!==r+0)throw r;Se(1,0)}},T:function(e,t,n){var r=xe();try{return $e(e,t,n)}catch(o){if(Te(r),o!==o+0)throw o;Se(1,0)}},f:function(e){var t=xe();try{oe(e)()}catch(n){if(Te(t),n!==n+0)throw n;Se(1,0)}},q:function(e,t){var n=xe();try{oe(e)(t)}catch(r){if(Te(n),r!==r+0)throw r;Se(1,0)}},h:function(e,t,n){var r=xe();try{oe(e)(t,n)}catch(o){if(Te(r),o!==o+0)throw o;Se(1,0)}},da:function(e,t,n,r){var o=xe();try{oe(e)(t,n,r)}catch(a){if(Te(o),a!==a+0)throw a;Se(1,0)}},l:function(e,t,n,r){var o=xe();try{oe(e)(t,n,r)}catch(a){if(Te(o),a!==a+0)throw a;Se(1,0)}},t:function(e,t,n,r,o){var a=xe();try{oe(e)(t,n,r,o)}catch(i){if(Te(a),i!==i+0)throw i;Se(1,0)}},u:function(e,t,n,r,o,a){var i=xe();try{oe(e)(t,n,r,o,a)}catch(s){if(Te(i),s!==s+0)throw s;Se(1,0)}},x:function(e,t,n,r,o,a,i){var s=xe();try{oe(e)(t,n,r,o,a,i)}catch(l){if(Te(s),l!==l+0)throw l;Se(1,0)}},z:function(e,t,n,r,o,a,i,s){var l=xe();try{oe(e)(t,n,r,o,a,i,s)}catch(u){if(Te(l),u!==u+0)throw u;Se(1,0)}},ga:function(e,t,n,r,o,a,i,s,l){var u=xe();try{oe(e)(t,n,r,o,a,i,s,l)}catch(c){if(Te(u),c!==c+0)throw c;Se(1,0)}},A:function(e,t,n,r,o,a,i,s,l,u,c){var d=xe();try{oe(e)(t,n,r,o,a,i,s,l,u,c)}catch(f){if(Te(d),f!==f+0)throw f;Se(1,0)}},C:function(e,t,n,r,o,a,i,s,l,u,c,d,f,p,h,m){var g=xe();try{oe(e)(t,n,r,o,a,i,s,l,u,c,d,f,p,h,m)}catch(b){if(Te(g),b!==b+0)throw b;Se(1,0)}},aa:function(e,t,n,r,o,a,i,s){var l=xe();try{Re(e,t,n,r,o,a,i,s)}catch(u){if(Te(l),u!==u+0)throw u;Se(1,0)}},_:function(e,t,n,r,o,a,i,s,l,u,c,d){var f=xe();try{Ce(e,t,n,r,o,a,i,s,l,u,c,d)}catch(p){if(Te(f),p!==p+0)throw p;Se(1,0)}},$:function(e,t,n,r,o,a){var i=xe();try{Ie(e,t,n,r,o,a)}catch(s){if(Te(i),s!==s+0)throw s;Se(1,0)}},n:function(e){return e},F:function(e){de=e},ha:me,y:function(e,t,n,r){return me(e,t,n,r)}};!function(){function e(e){t.asm=e.exports,x=t.asm.Ka,N(),M=t.asm.ib,j.unshift(t.asm.La),H--,t.monitorRunDependencies&&t.monitorRunDependencies(H),0==H&&q&&(e=q,q=null,e())}function n(t){e(t.instance)}function r(e){return function(){if(!_&&(m||g)){if("function"==typeof fetch&&!V.startsWith("file://"))return fetch(V,{credentials:"same-origin"}).then(function(e){if(!e.ok)throw"failed to load wasm binary file at '"+V+"'";return e.arrayBuffer()}).catch(function(){return K()});if(s)return new Promise(function(e,t){s(V,function(t){e(new Uint8Array(t))},t)})}return Promise.resolve().then(function(){return K()})}().then(function(e){return WebAssembly.instantiate(e,o)}).then(function(e){return e}).then(e,function(e){w("failed to asynchronously prepare wasm: "+e),G(e)})}var o={a:ge};if(H++,t.monitorRunDependencies&&t.monitorRunDependencies(H),t.instantiateWasm)try{return t.instantiateWasm(o,e)}catch(i){return w("Module.instantiateWasm callback failed with error: "+i),!1}(_||"function"!=typeof WebAssembly.instantiateStreaming||W()||V.startsWith("file://")||b||"function"!=typeof fetch?r(n):fetch(V,{credentials:"same-origin"}).then(function(e){return WebAssembly.instantiateStreaming(e,o).then(n,function(e){return w("wasm streaming compile failed: "+e),w("falling back to ArrayBuffer instantiation"),r(n)})})).catch(a)}(),t.___wasm_call_ctors=function(){return(t.___wasm_call_ctors=t.asm.La).apply(null,arguments)},t._OrtInit=function(){return(t._OrtInit=t.asm.Ma).apply(null,arguments)},t._OrtCreateSessionOptions=function(){return(t._OrtCreateSessionOptions=t.asm.Na).apply(null,arguments)},t._OrtAppendExecutionProvider=function(){return(t._OrtAppendExecutionProvider=t.asm.Oa).apply(null,arguments)},t._OrtAddSessionConfigEntry=function(){return(t._OrtAddSessionConfigEntry=t.asm.Pa).apply(null,arguments)},t._OrtReleaseSessionOptions=function(){return(t._OrtReleaseSessionOptions=t.asm.Qa).apply(null,arguments)},t._OrtCreateSession=function(){return(t._OrtCreateSession=t.asm.Ra).apply(null,arguments)},t._OrtReleaseSession=function(){return(t._OrtReleaseSession=t.asm.Sa).apply(null,arguments)},t._OrtGetInputCount=function(){return(t._OrtGetInputCount=t.asm.Ta).apply(null,arguments)},t._OrtGetOutputCount=function(){return(t._OrtGetOutputCount=t.asm.Ua).apply(null,arguments)},t._OrtGetInputName=function(){return(t._OrtGetInputName=t.asm.Va).apply(null,arguments)},t._OrtGetOutputName=function(){return(t._OrtGetOutputName=t.asm.Wa).apply(null,arguments)},t._OrtFree=function(){return(t._OrtFree=t.asm.Xa).apply(null,arguments)},t._OrtCreateTensor=function(){return(t._OrtCreateTensor=t.asm.Ya).apply(null,arguments)},t._OrtGetTensorData=function(){return(t._OrtGetTensorData=t.asm.Za).apply(null,arguments)},t._OrtReleaseTensor=function(){return(t._OrtReleaseTensor=t.asm._a).apply(null,arguments)},t._OrtCreateRunOptions=function(){return(t._OrtCreateRunOptions=t.asm.$a).apply(null,arguments)},t._OrtAddRunConfigEntry=function(){return(t._OrtAddRunConfigEntry=t.asm.ab).apply(null,arguments)},t._OrtReleaseRunOptions=function(){return(t._OrtReleaseRunOptions=t.asm.bb).apply(null,arguments)},t._OrtRun=function(){return(t._OrtRun=t.asm.cb).apply(null,arguments)},t._OrtEndProfiling=function(){return(t._OrtEndProfiling=t.asm.db).apply(null,arguments)};var be,ye=t._malloc=function(){return(ye=t._malloc=t.asm.eb).apply(null,arguments)},_e=t._free=function(){return(_e=t._free=t.asm.fb).apply(null,arguments)},ve=t._fflush=function(){return(ve=t._fflush=t.asm.gb).apply(null,arguments)},we=t.___funcs_on_exit=function(){return(we=t.___funcs_on_exit=t.asm.hb).apply(null,arguments)},Se=t._setThrew=function(){return(Se=t._setThrew=t.asm.jb).apply(null,arguments)},xe=t.stackSave=function(){return(xe=t.stackSave=t.asm.kb).apply(null,arguments)},Te=t.stackRestore=function(){return(Te=t.stackRestore=t.asm.lb).apply(null,arguments)},Ee=t.stackAlloc=function(){return(Ee=t.stackAlloc=t.asm.mb).apply(null,arguments)},ke=t.___cxa_can_catch=function(){return(ke=t.___cxa_can_catch=t.asm.nb).apply(null,arguments)},Pe=t.___cxa_is_pointer_type=function(){return(Pe=t.___cxa_is_pointer_type=t.asm.ob).apply(null,arguments)},Oe=t.dynCall_j=function(){return(Oe=t.dynCall_j=t.asm.pb).apply(null,arguments)},Ae=t.dynCall_iiiiij=function(){return(Ae=t.dynCall_iiiiij=t.asm.qb).apply(null,arguments)},$e=t.dynCall_jii=function(){return($e=t.dynCall_jii=t.asm.rb).apply(null,arguments)},Re=t.dynCall_viiiiij=function(){return(Re=t.dynCall_viiiiij=t.asm.sb).apply(null,arguments)},Ie=t.dynCall_vjji=function(){return(Ie=t.dynCall_vjji=t.asm.tb).apply(null,arguments)},Ce=t.dynCall_viiijjjii=function(){return(Ce=t.dynCall_viiijjjii=t.asm.ub).apply(null,arguments)},De=t.dynCall_iij=function(){return(De=t.dynCall_iij=t.asm.vb).apply(null,arguments)},Ne=t.dynCall_ji=function(){return(Ne=t.dynCall_ji=t.asm.wb).apply(null,arguments)},Me=t.dynCall_iiiiiij=function(){return(Me=t.dynCall_iiiiiij=t.asm.xb).apply(null,arguments)},Le=t.dynCall_iiij=function(){return(Le=t.dynCall_iiij=t.asm.yb).apply(null,arguments)};function je(){function e(){if(!be&&(be=!0,t.calledRun=!0,!A)){if(Q(j),o(t),t.onRuntimeInitialized&&t.onRuntimeInitialized(),t.postRun)for("function"==typeof t.postRun&&(t.postRun=[t.postRun]);t.postRun.length;){var e=t.postRun.shift();B.unshift(e)}Q(B)}}if(!(0<H)){if(t.preRun)for("function"==typeof t.preRun&&(t.preRun=[t.preRun]);t.preRun.length;)z();Q(L),0<H||(t.setStatus?(t.setStatus("Running..."),setTimeout(function(){setTimeout(function(){t.setStatus("")},1),e()},1)):e())}}if(t.UTF8ToString=I,t.stringToUTF8=function(e,t,n){return C(e,k,t,n)},t.lengthBytesUTF8=D,t.stackSave=xe,t.stackRestore=Te,t.stackAlloc=Ee,q=function e(){be||je(),be||(q=e)},t.preInit)for("function"==typeof t.preInit&&(t.preInit=[t.preInit]);0<t.preInit.length;)t.preInit.pop()();return je(),e.ready});e.exports=o},4537:e=>{e.exports=function(e,t){for(var n=new Array(arguments.length-1),r=0,o=2,a=!0;o<arguments.length;)n[r++]=arguments[o++];return new Promise(function(o,i){n[r]=function(e){if(a)if(a=!1,e)i(e);else{for(var t=new Array(arguments.length-1),n=0;n<t.length;)t[n++]=arguments[n];o.apply(null,t)}};try{e.apply(t||null,n)}catch(s){a&&(a=!1,i(s))}})}},7419:(e,t)=>{var n=t;n.length=function(e){var t=e.length;if(!t)return 0;for(var n=0;--t%4>1&&"="===e.charAt(t);)++n;return Math.ceil(3*e.length)/4-n};for(var r=new Array(64),o=new Array(123),a=0;a<64;)o[r[a]=a<26?a+65:a<52?a+71:a<62?a-4:a-59|43]=a++;n.encode=function(e,t,n){for(var o,a=null,i=[],s=0,l=0;t<n;){var u=e[t++];switch(l){case 0:i[s++]=r[u>>2],o=(3&u)<<4,l=1;break;case 1:i[s++]=r[o|u>>4],o=(15&u)<<2,l=2;break;case 2:i[s++]=r[o|u>>6],i[s++]=r[63&u],l=0}s>8191&&((a||(a=[])).push(String.fromCharCode.apply(String,i)),s=0)}return l&&(i[s++]=r[o],i[s++]=61,1===l&&(i[s++]=61)),a?(s&&a.push(String.fromCharCode.apply(String,i.slice(0,s))),a.join("")):String.fromCharCode.apply(String,i.slice(0,s))};var i="invalid encoding";n.decode=function(e,t,n){for(var r,a=n,s=0,l=0;l<e.length;){var u=e.charCodeAt(l++);if(61===u&&s>1)break;if(void 0===(u=o[u]))throw Error(i);switch(s){case 0:r=u,s=1;break;case 1:t[n++]=r<<2|(48&u)>>4,r=u,s=2;break;case 2:t[n++]=(15&r)<<4|(60&u)>>2,r=u,s=3;break;case 3:t[n++]=(3&r)<<6|u,s=0}}if(1===s)throw Error(i);return n-a},n.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},9211:e=>{function t(){this._listeners={}}e.exports=t,t.prototype.on=function(e,t,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:n||this}),this},t.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var n=this._listeners[e],r=0;r<n.length;)n[r].fn===t?n.splice(r,1):++r;return this},t.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var n=[],r=1;r<arguments.length;)n.push(arguments[r++]);for(r=0;r<t.length;)t[r].fn.apply(t[r++].ctx,n)}return this}},945:e=>{function t(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),n=new Uint8Array(t.buffer),r=128===n[3];function o(e,r,o){t[0]=e,r[o]=n[0],r[o+1]=n[1],r[o+2]=n[2],r[o+3]=n[3]}function a(e,r,o){t[0]=e,r[o]=n[3],r[o+1]=n[2],r[o+2]=n[1],r[o+3]=n[0]}function i(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],t[0]}function s(e,r){return n[3]=e[r],n[2]=e[r+1],n[1]=e[r+2],n[0]=e[r+3],t[0]}e.writeFloatLE=r?o:a,e.writeFloatBE=r?a:o,e.readFloatLE=r?i:s,e.readFloatBE=r?s:i}():function(){function t(e,t,n,r){var o=t<0?1:0;if(o&&(t=-t),0===t)e(1/t>0?0:2147483648,n,r);else if(isNaN(t))e(2143289344,n,r);else if(t>34028234663852886e22)e((o<<31|2139095040)>>>0,n,r);else if(t<11754943508222875e-54)e((o<<31|Math.round(t/1401298464324817e-60))>>>0,n,r);else{var a=Math.floor(Math.log(t)/Math.LN2);e((o<<31|a+127<<23|8388607&Math.round(t*Math.pow(2,-a)*8388608))>>>0,n,r)}}function i(e,t,n){var r=e(t,n),o=2*(r>>31)+1,a=r>>>23&255,i=8388607&r;return 255===a?i?NaN:o*(1/0):0===a?1401298464324817e-60*o*i:o*Math.pow(2,a-150)*(i+8388608)}e.writeFloatLE=t.bind(null,n),e.writeFloatBE=t.bind(null,r),e.readFloatLE=i.bind(null,o),e.readFloatBE=i.bind(null,a)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),n=new Uint8Array(t.buffer),r=128===n[7];function o(e,r,o){t[0]=e,r[o]=n[0],r[o+1]=n[1],r[o+2]=n[2],r[o+3]=n[3],r[o+4]=n[4],r[o+5]=n[5],r[o+6]=n[6],r[o+7]=n[7]}function a(e,r,o){t[0]=e,r[o]=n[7],r[o+1]=n[6],r[o+2]=n[5],r[o+3]=n[4],r[o+4]=n[3],r[o+5]=n[2],r[o+6]=n[1],r[o+7]=n[0]}function i(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],n[4]=e[r+4],n[5]=e[r+5],n[6]=e[r+6],n[7]=e[r+7],t[0]}function s(e,r){return n[7]=e[r],n[6]=e[r+1],n[5]=e[r+2],n[4]=e[r+3],n[3]=e[r+4],n[2]=e[r+5],n[1]=e[r+6],n[0]=e[r+7],t[0]}e.writeDoubleLE=r?o:a,e.writeDoubleBE=r?a:o,e.readDoubleLE=r?i:s,e.readDoubleBE=r?s:i}():function(){function t(e,t,n,r,o,a){var i=r<0?1:0;if(i&&(r=-r),0===r)e(0,o,a+t),e(1/r>0?0:2147483648,o,a+n);else if(isNaN(r))e(0,o,a+t),e(2146959360,o,a+n);else if(r>17976931348623157e292)e(0,o,a+t),e((i<<31|2146435072)>>>0,o,a+n);else{var s;if(r<22250738585072014e-324)e((s=r/5e-324)>>>0,o,a+t),e((i<<31|s/4294967296)>>>0,o,a+n);else{var l=Math.floor(Math.log(r)/Math.LN2);1024===l&&(l=1023),e(4503599627370496*(s=r*Math.pow(2,-l))>>>0,o,a+t),e((i<<31|l+1023<<20|1048576*s&1048575)>>>0,o,a+n)}}}function i(e,t,n,r,o){var a=e(r,o+t),i=e(r,o+n),s=2*(i>>31)+1,l=i>>>20&2047,u=4294967296*(1048575&i)+a;return 2047===l?u?NaN:s*(1/0):0===l?5e-324*s*u:s*Math.pow(2,l-1075)*(u+4503599627370496)}e.writeDoubleLE=t.bind(null,n,0,4),e.writeDoubleBE=t.bind(null,r,4,0),e.readDoubleLE=i.bind(null,o,0,4),e.readDoubleBE=i.bind(null,a,4,0)}(),e}function n(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}function r(e,t,n){t[n]=e>>>24,t[n+1]=e>>>16&255,t[n+2]=e>>>8&255,t[n+3]=255&e}function o(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function a(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}e.exports=t(t)},7199:module=>{function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(t){}return null}module.exports=inquire},6662:e=>{e.exports=function(e,t,n){var r=n||8192,o=r>>>1,a=null,i=r;return function(n){if(n<1||n>o)return e(n);i+n>r&&(a=e(r),i=0);var s=t.call(a,i,i+=n);return 7&i&&(i=1+(7|i)),s}}},4997:(e,t)=>{var n=t;n.length=function(e){for(var t=0,n=0,r=0;r<e.length;++r)(n=e.charCodeAt(r))<128?t+=1:n<2048?t+=2:55296==(64512&n)&&56320==(64512&e.charCodeAt(r+1))?(++r,t+=4):t+=3;return t},n.read=function(e,t,n){if(n-t<1)return"";for(var r,o=null,a=[],i=0;t<n;)(r=e[t++])<128?a[i++]=r:r>191&&r<224?a[i++]=(31&r)<<6|63&e[t++]:r>239&&r<365?(r=((7&r)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,a[i++]=55296+(r>>10),a[i++]=56320+(1023&r)):a[i++]=(15&r)<<12|(63&e[t++])<<6|63&e[t++],i>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,a)),i=0);return o?(i&&o.push(String.fromCharCode.apply(String,a.slice(0,i))),o.join("")):String.fromCharCode.apply(String,a.slice(0,i))},n.write=function(e,t,n){for(var r,o,a=n,i=0;i<e.length;++i)(r=e.charCodeAt(i))<128?t[n++]=r:r<2048?(t[n++]=r>>6|192,t[n++]=63&r|128):55296==(64512&r)&&56320==(64512&(o=e.charCodeAt(i+1)))?(r=65536+((1023&r)<<10)+(1023&o),++i,t[n++]=r>>18|240,t[n++]=r>>12&63|128,t[n++]=r>>6&63|128,t[n++]=63&r|128):(t[n++]=r>>12|224,t[n++]=r>>6&63|128,t[n++]=63&r|128);return n-a}},3442:(e,t)=>{t.__esModule=!0;var n=function(){function e(t){if(!t)throw new TypeError("Invalid argument; `value` has no value.");this.value=e.EMPTY,t&&e.isGuid(t)&&(this.value=t)}return e.isGuid=function(t){var n=t.toString();return t&&(t instanceof e||e.validator.test(n))},e.create=function(){return new e([e.gen(2),e.gen(1),e.gen(1),e.gen(1),e.gen(3)].join("-"))},e.createEmpty=function(){return new e("emptyguid")},e.parse=function(t){return new e(t)},e.raw=function(){return[e.gen(2),e.gen(1),e.gen(1),e.gen(1),e.gen(3)].join("-")},e.gen=function(e){for(var t="",n=0;n<e;n++)t+=(65536*(1+Math.random())|0).toString(16).substring(1);return t},e.prototype.equals=function(t){return e.isGuid(t)&&this.value===t.toString()},e.prototype.isEmpty=function(){return this.value===e.EMPTY},e.prototype.toString=function(){return this.value},e.prototype.toJSON=function(){return{value:this.value}},e.validator=new RegExp("^[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}$","i"),e.EMPTY="00000000-0000-0000-0000-000000000000",e}();t.Guid=n},3720: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={},a={};function i(e,t){var n,r,i;return t?(i=0<=(e>>>=0)&&e<256)&&(r=a[e])?r:(n=l(e,(0|e)<0?-1:0,!0),i&&(a[e]=n),n):(i=-128<=(e|=0)&&e<128)&&(r=o[e])?r:(n=l(e,e<0?-1:0,!1),i&&(o[e]=n),n)}function s(e,t){if(isNaN(e))return t?b:g;if(t){if(e<0)return b;if(e>=p)return S}else{if(e<=-h)return x;if(e+1>=h)return w}return e<0?s(-e,t).neg():l(e%f|0,e/f|0,t)}function l(e,t,r){return new n(e,t,r)}n.fromInt=i,n.fromNumber=s,n.fromBits=l;var u=Math.pow;function c(e,t,n){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return g;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 c(e.substring(1),t,n).neg();for(var o=s(u(n,8)),a=g,i=0;i<e.length;i+=8){var l=Math.min(8,e.length-i),d=parseInt(e.substring(i,i+l),n);if(l<8){var f=s(u(n,l));a=a.mul(f).add(s(d))}else a=(a=a.mul(o)).add(s(d))}return a.unsigned=t,a}function d(e,t){return"number"==typeof e?s(e,t):"string"==typeof e?c(e,t):l(e.low,e.high,"boolean"==typeof t?t:e.unsigned)}n.fromString=c,n.fromValue=d;var f=4294967296,p=f*f,h=p/2,m=i(1<<24),g=i(0);n.ZERO=g;var b=i(0,!0);n.UZERO=b;var y=i(1);n.ONE=y;var _=i(1,!0);n.UONE=_;var v=i(-1);n.NEG_ONE=v;var w=l(-1,2147483647,!1);n.MAX_VALUE=w;var S=l(-1,-1,!0);n.MAX_UNSIGNED_VALUE=S;var x=l(0,-2147483648,!1);n.MIN_VALUE=x;var T=n.prototype;T.toInt=function(){return this.unsigned?this.low>>>0:this.low},T.toNumber=function(){return this.unsigned?(this.high>>>0)*f+(this.low>>>0):this.high*f+(this.low>>>0)},T.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(x)){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),a=this,i="";;){var l=a.div(o),c=(a.sub(l.mul(o)).toInt()>>>0).toString(e);if((a=l).isZero())return c+i;for(;c.length<6;)c="0"+c;i=""+c+i}},T.getHighBits=function(){return this.high},T.getHighBitsUnsigned=function(){return this.high>>>0},T.getLowBits=function(){return this.low},T.getLowBitsUnsigned=function(){return this.low>>>0},T.getNumBitsAbs=function(){if(this.isNegative())return this.eq(x)?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},T.isZero=function(){return 0===this.high&&0===this.low},T.eqz=T.isZero,T.isNegative=function(){return!this.unsigned&&this.high<0},T.isPositive=function(){return this.unsigned||this.high>=0},T.isOdd=function(){return!(1&~this.low)},T.isEven=function(){return!(1&this.low)},T.equals=function(e){return r(e)||(e=d(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low},T.eq=T.equals,T.notEquals=function(e){return!this.eq(e)},T.neq=T.notEquals,T.ne=T.notEquals,T.lessThan=function(e){return this.comp(e)<0},T.lt=T.lessThan,T.lessThanOrEqual=function(e){return this.comp(e)<=0},T.lte=T.lessThanOrEqual,T.le=T.lessThanOrEqual,T.greaterThan=function(e){return this.comp(e)>0},T.gt=T.greaterThan,T.greaterThanOrEqual=function(e){return this.comp(e)>=0},T.gte=T.greaterThanOrEqual,T.ge=T.greaterThanOrEqual,T.compare=function(e){if(r(e)||(e=d(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},T.comp=T.compare,T.negate=function(){return!this.unsigned&&this.eq(x)?x:this.not().add(y)},T.neg=T.negate,T.add=function(e){r(e)||(e=d(e));var t=this.high>>>16,n=65535&this.high,o=this.low>>>16,a=65535&this.low,i=e.high>>>16,s=65535&e.high,u=e.low>>>16,c=0,f=0,p=0,h=0;return p+=(h+=a+(65535&e.low))>>>16,f+=(p+=o+u)>>>16,c+=(f+=n+s)>>>16,c+=t+i,l((p&=65535)<<16|(h&=65535),(c&=65535)<<16|(f&=65535),this.unsigned)},T.subtract=function(e){return r(e)||(e=d(e)),this.add(e.neg())},T.sub=T.subtract,T.multiply=function(e){if(this.isZero())return g;if(r(e)||(e=d(e)),t)return l(t.mul(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(e.isZero())return g;if(this.eq(x))return e.isOdd()?x:g;if(e.eq(x))return this.isOdd()?x:g;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(m)&&e.lt(m))return s(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,o=65535&this.high,a=this.low>>>16,i=65535&this.low,u=e.high>>>16,c=65535&e.high,f=e.low>>>16,p=65535&e.low,h=0,b=0,y=0,_=0;return y+=(_+=i*p)>>>16,b+=(y+=a*p)>>>16,y&=65535,b+=(y+=i*f)>>>16,h+=(b+=o*p)>>>16,b&=65535,h+=(b+=a*f)>>>16,b&=65535,h+=(b+=i*c)>>>16,h+=n*p+o*f+a*c+i*u,l((y&=65535)<<16|(_&=65535),(h&=65535)<<16|(b&=65535),this.unsigned)},T.mul=T.multiply,T.divide=function(e){if(r(e)||(e=d(e)),e.isZero())throw Error("division by zero");var n,o,a;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?b:g;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return b;if(e.gt(this.shru(1)))return _;a=b}else{if(this.eq(x))return e.eq(y)||e.eq(v)?x:e.eq(x)?y:(n=this.shr(1).div(e).shl(1)).eq(g)?e.isNegative()?y:v:(o=this.sub(e.mul(n)),a=n.add(o.div(e)));if(e.eq(x))return this.unsigned?b:g;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();a=g}for(o=this;o.gte(e);){n=Math.max(1,Math.floor(o.toNumber()/e.toNumber()));for(var i=Math.ceil(Math.log(n)/Math.LN2),c=i<=48?1:u(2,i-48),f=s(n),p=f.mul(e);p.isNegative()||p.gt(o);)p=(f=s(n-=c,this.unsigned)).mul(e);f.isZero()&&(f=y),a=a.add(f),o=o.sub(p)}return a},T.div=T.divide,T.modulo=function(e){return r(e)||(e=d(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))},T.mod=T.modulo,T.rem=T.modulo,T.not=function(){return l(~this.low,~this.high,this.unsigned)},T.and=function(e){return r(e)||(e=d(e)),l(this.low&e.low,this.high&e.high,this.unsigned)},T.or=function(e){return r(e)||(e=d(e)),l(this.low|e.low,this.high|e.high,this.unsigned)},T.xor=function(e){return r(e)||(e=d(e)),l(this.low^e.low,this.high^e.high,this.unsigned)},T.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)},T.shl=T.shiftLeft,T.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)},T.shr=T.shiftRight,T.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)},T.shru=T.shiftRightUnsigned,T.shr_u=T.shiftRightUnsigned,T.toSigned=function(){return this.unsigned?l(this.low,this.high,!1):this},T.toUnsigned=function(){return this.unsigned?this:l(this.low,this.high,!0)},T.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},T.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]},T.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)}},1446:(e,t,n)=>{var r,o,a,i=n(2100),s=i.Reader,l=i.Writer,u=i.util,c=i.roots.default||(i.roots.default={});c.onnx=((a={}).Version=(r={},(o=Object.create(r))[r[0]="_START_VERSION"]=0,o[r[1]="IR_VERSION_2017_10_10"]=1,o[r[2]="IR_VERSION_2017_10_30"]=2,o[r[3]="IR_VERSION_2017_11_3"]=3,o[r[4]="IR_VERSION_2019_1_22"]=4,o[r[5]="IR_VERSION"]=5,o),a.AttributeProto=function(){function e(e){if(this.floats=[],this.ints=[],this.strings=[],this.tensors=[],this.graphs=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.name="",e.prototype.refAttrName="",e.prototype.docString="",e.prototype.type=0,e.prototype.f=0,e.prototype.i=u.Long?u.Long.fromBits(0,0,!1):0,e.prototype.s=u.newBuffer([]),e.prototype.t=null,e.prototype.g=null,e.prototype.floats=u.emptyArray,e.prototype.ints=u.emptyArray,e.prototype.strings=u.emptyArray,e.prototype.tensors=u.emptyArray,e.prototype.graphs=u.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=l.create()),null!=e.name&&e.hasOwnProperty("name")&&t.uint32(10).string(e.name),null!=e.f&&e.hasOwnProperty("f")&&t.uint32(21).float(e.f),null!=e.i&&e.hasOwnProperty("i")&&t.uint32(24).int64(e.i),null!=e.s&&e.hasOwnProperty("s")&&t.uint32(34).bytes(e.s),null!=e.t&&e.hasOwnProperty("t")&&c.onnx.TensorProto.encode(e.t,t.uint32(42).fork()).ldelim(),null!=e.g&&e.hasOwnProperty("g")&&c.onnx.GraphProto.encode(e.g,t.uint32(50).fork()).ldelim(),null!=e.floats&&e.floats.length){t.uint32(58).fork();for(var n=0;n<e.floats.length;++n)t.float(e.floats[n]);t.ldelim()}if(null!=e.ints&&e.ints.length){for(t.uint32(66).fork(),n=0;n<e.ints.length;++n)t.int64(e.ints[n]);t.ldelim()}if(null!=e.strings&&e.strings.length)for(n=0;n<e.strings.length;++n)t.uint32(74).bytes(e.strings[n]);if(null!=e.tensors&&e.tensors.length)for(n=0;n<e.tensors.length;++n)c.onnx.TensorProto.encode(e.tensors[n],t.uint32(82).fork()).ldelim();if(null!=e.graphs&&e.graphs.length)for(n=0;n<e.graphs.length;++n)c.onnx.GraphProto.encode(e.graphs[n],t.uint32(90).fork()).ldelim();return null!=e.docString&&e.hasOwnProperty("docString")&&t.uint32(106).string(e.docString),null!=e.type&&e.hasOwnProperty("type")&&t.uint32(160).int32(e.type),null!=e.refAttrName&&e.hasOwnProperty("refAttrName")&&t.uint32(170).string(e.refAttrName),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new c.onnx.AttributeProto;e.pos<n;){var o=e.uint32();switch(o>>>3){case 1:r.name=e.string();break;case 21:r.refAttrName=e.string();break;case 13:r.docString=e.string();break;case 20:r.type=e.int32();break;case 2:r.f=e.float();break;case 3:r.i=e.int64();break;case 4:r.s=e.bytes();break;case 5:r.t=c.onnx.TensorProto.decode(e,e.uint32());break;case 6:r.g=c.onnx.GraphProto.decode(e,e.uint32());break;case 7:if(r.floats&&r.floats.length||(r.floats=[]),2==(7&o))for(var a=e.uint32()+e.pos;e.pos<a;)r.floats.push(e.float());else r.floats.push(e.float());break;case 8:if(r.ints&&r.ints.length||(r.ints=[]),2==(7&o))for(a=e.uint32()+e.pos;e.pos<a;)r.ints.push(e.int64());else r.ints.push(e.int64());break;case 9:r.strings&&r.strings.length||(r.strings=[]),r.strings.push(e.bytes());break;case 10:r.tensors&&r.tensors.length||(r.tensors=[]),r.tensors.push(c.onnx.TensorProto.decode(e,e.uint32()));break;case 11:r.graphs&&r.graphs.length||(r.graphs=[]),r.graphs.push(c.onnx.GraphProto.decode(e,e.uint32()));break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!u.isString(e.name))return"name: string expected";if(null!=e.refAttrName&&e.hasOwnProperty("refAttrName")&&!u.isString(e.refAttrName))return"refAttrName: string expected";if(null!=e.docString&&e.hasOwnProperty("docString")&&!u.isString(e.docString))return"docString: string expected";if(null!=e.type&&e.hasOwnProperty("type"))switch(e.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:}if(null!=e.f&&e.hasOwnProperty("f")&&"number"!=typeof e.f)return"f: number expected";if(null!=e.i&&e.hasOwnProperty("i")&&!(u.isInteger(e.i)||e.i&&u.isInteger(e.i.low)&&u.isInteger(e.i.high)))return"i: integer|Long expected";if(null!=e.s&&e.hasOwnProperty("s")&&!(e.s&&"number"==typeof e.s.length||u.isString(e.s)))return"s: buffer expected";if(null!=e.t&&e.hasOwnProperty("t")&&(n=c.onnx.TensorProto.verify(e.t)))return"t."+n;if(null!=e.g&&e.hasOwnProperty("g")&&(n=c.onnx.GraphProto.verify(e.g)))return"g."+n;if(null!=e.floats&&e.hasOwnProperty("floats")){if(!Array.isArray(e.floats))return"floats: array expected";for(var t=0;t<e.floats.length;++t)if("number"!=typeof e.floats[t])return"floats: number[] expected"}if(null!=e.ints&&e.hasOwnProperty("ints")){if(!Array.isArray(e.ints))return"ints: array expected";for(t=0;t<e.ints.length;++t)if(!(u.isInteger(e.ints[t])||e.ints[t]&&u.isInteger(e.ints[t].low)&&u.isInteger(e.ints[t].high)))return"ints: integer|Long[] expected"}if(null!=e.strings&&e.hasOwnProperty("strings")){if(!Array.isArray(e.strings))return"strings: array expected";for(t=0;t<e.strings.length;++t)if(!(e.strings[t]&&"number"==typeof e.strings[t].length||u.isString(e.strings[t])))return"strings: buffer[] expected"}if(null!=e.tensors&&e.hasOwnProperty("tensors")){if(!Array.isArray(e.tensors))return"tensors: array expected";for(t=0;t<e.tensors.length;++t)if(n=c.onnx.TensorProto.verify(e.tensors[t]))return"tensors."+n}if(null!=e.graphs&&e.hasOwnProperty("graphs")){if(!Array.isArray(e.graphs))return"graphs: array expected";for(t=0;t<e.graphs.length;++t){var n;if(n=c.onnx.GraphProto.verify(e.graphs[t]))return"graphs."+n}}return null},e.fromObject=function(e){if(e instanceof c.onnx.AttributeProto)return e;var t=new c.onnx.AttributeProto;switch(null!=e.name&&(t.name=String(e.name)),null!=e.refAttrName&&(t.refAttrName=String(e.refAttrName)),null!=e.docString&&(t.docString=String(e.docString)),e.type){case"UNDEFINED":case 0:t.type=0;break;case"FLOAT":case 1:t.type=1;break;case"INT":case 2:t.type=2;break;case"STRING":case 3:t.type=3;break;case"TENSOR":case 4:t.type=4;break;case"GRAPH":case 5:t.type=5;break;case"FLOATS":case 6:t.type=6;break;case"INTS":case 7:t.type=7;break;case"STRINGS":case 8:t.type=8;break;case"TENSORS":case 9:t.type=9;break;case"GRAPHS":case 10:t.type=10}if(null!=e.f&&(t.f=Number(e.f)),null!=e.i&&(u.Long?(t.i=u.Long.fromValue(e.i)).unsigned=!1:"string"==typeof e.i?t.i=parseInt(e.i,10):"number"==typeof e.i?t.i=e.i:"object"==typeof e.i&&(t.i=new u.LongBits(e.i.low>>>0,e.i.high>>>0).toNumber())),null!=e.s&&("string"==typeof e.s?u.base64.decode(e.s,t.s=u.newBuffer(u.base64.length(e.s)),0):e.s.length&&(t.s=e.s)),null!=e.t){if("object"!=typeof e.t)throw TypeError(".onnx.AttributeProto.t: object expected");t.t=c.onnx.TensorProto.fromObject(e.t)}if(null!=e.g){if("object"!=typeof e.g)throw TypeError(".onnx.AttributeProto.g: object expected");t.g=c.onnx.GraphProto.fromObject(e.g)}if(e.floats){if(!Array.isArray(e.floats))throw TypeError(".onnx.AttributeProto.floats: array expected");t.floats=[];for(var n=0;n<e.floats.length;++n)t.floats[n]=Number(e.floats[n])}if(e.ints){if(!Array.isArray(e.ints))throw TypeError(".onnx.AttributeProto.ints: array expected");for(t.ints=[],n=0;n<e.ints.length;++n)u.Long?(t.ints[n]=u.Long.fromValue(e.ints[n])).unsigned=!1:"string"==typeof e.ints[n]?t.ints[n]=parseInt(e.ints[n],10):"number"==typeof e.ints[n]?t.ints[n]=e.ints[n]:"object"==typeof e.ints[n]&&(t.ints[n]=new u.LongBits(e.ints[n].low>>>0,e.ints[n].high>>>0).toNumber())}if(e.strings){if(!Array.isArray(e.strings))throw TypeError(".onnx.AttributeProto.strings: array expected");for(t.strings=[],n=0;n<e.strings.length;++n)"string"==typeof e.strings[n]?u.base64.decode(e.strings[n],t.strings[n]=u.newBuffer(u.base64.length(e.strings[n])),0):e.strings[n].length&&(t.strings[n]=e.strings[n])}if(e.tensors){if(!Array.isArray(e.tensors))throw TypeError(".onnx.AttributeProto.tensors: array expected");for(t.tensors=[],n=0;n<e.tensors.length;++n){if("object"!=typeof e.tensors[n])throw TypeError(".onnx.AttributeProto.tensors: object expected");t.tensors[n]=c.onnx.TensorProto.fromObject(e.tensors[n])}}if(e.graphs){if(!Array.isArray(e.graphs))throw TypeError(".onnx.AttributeProto.graphs: array expected");for(t.graphs=[],n=0;n<e.graphs.length;++n){if("object"!=typeof e.graphs[n])throw TypeError(".onnx.AttributeProto.graphs: object expected");t.graphs[n]=c.onnx.GraphProto.fromObject(e.graphs[n])}}return t},e.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.floats=[],n.ints=[],n.strings=[],n.tensors=[],n.graphs=[]),t.defaults){if(n.name="",n.f=0,u.Long){var r=new u.Long(0,0,!1);n.i=t.longs===String?r.toString():t.longs===Number?r.toNumber():r}else n.i=t.longs===String?"0":0;t.bytes===String?n.s="":(n.s=[],t.bytes!==Array&&(n.s=u.newBuffer(n.s))),n.t=null,n.g=null,n.docString="",n.type=t.enums===String?"UNDEFINED":0,n.refAttrName=""}if(null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.f&&e.hasOwnProperty("f")&&(n.f=t.json&&!isFinite(e.f)?String(e.f):e.f),null!=e.i&&e.hasOwnProperty("i")&&("number"==typeof e.i?n.i=t.longs===String?String(e.i):e.i:n.i=t.longs===String?u.Long.prototype.toString.call(e.i):t.longs===Number?new u.LongBits(e.i.low>>>0,e.i.high>>>0).toNumber():e.i),null!=e.s&&e.hasOwnProperty("s")&&(n.s=t.bytes===String?u.base64.encode(e.s,0,e.s.length):t.bytes===Array?Array.prototype.slice.call(e.s):e.s),null!=e.t&&e.hasOwnProperty("t")&&(n.t=c.onnx.TensorProto.toObject(e.t,t)),null!=e.g&&e.hasOwnProperty("g")&&(n.g=c.onnx.GraphProto.toObject(e.g,t)),e.floats&&e.floats.length){n.floats=[];for(var o=0;o<e.floats.length;++o)n.floats[o]=t.json&&!isFinite(e.floats[o])?String(e.floats[o]):e.floats[o]}if(e.ints&&e.ints.length)for(n.ints=[],o=0;o<e.ints.length;++o)"number"==typeof e.ints[o]?n.ints[o]=t.longs===String?String(e.ints[o]):e.ints[o]:n.ints[o]=t.longs===String?u.Long.prototype.toString.call(e.ints[o]):t.longs===Number?new u.LongBits(e.ints[o].low>>>0,e.ints[o].high>>>0).toNumber():e.ints[o];if(e.strings&&e.strings.length)for(n.strings=[],o=0;o<e.strings.length;++o)n.strings[o]=t.bytes===String?u.base64.encode(e.strings[o],0,e.strings[o].length):t.bytes===Array?Array.prototype.slice.call(e.strings[o]):e.strings[o];if(e.tensors&&e.tensors.length)for(n.tensors=[],o=0;o<e.tensors.length;++o)n.tensors[o]=c.onnx.TensorProto.toObject(e.tensors[o],t);if(e.graphs&&e.graphs.length)for(n.graphs=[],o=0;o<e.graphs.length;++o)n.graphs[o]=c.onnx.GraphProto.toObject(e.graphs[o],t);return null!=e.docString&&e.hasOwnProperty("docString")&&(n.docString=e.docString),null!=e.type&&e.hasOwnProperty("type")&&(n.type=t.enums===String?c.onnx.AttributeProto.AttributeType[e.type]:e.type),null!=e.refAttrName&&e.hasOwnProperty("refAttrName")&&(n.refAttrName=e.refAttrName),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.util.toJSONOptions)},e.AttributeType=(t={},(n=Object.create(t))[t[0]="UNDEFINED"]=0,n[t[1]="FLOAT"]=1,n[t[2]="INT"]=2,n[t[3]="STRING"]=3,n[t[4]="TENSOR"]=4,n[t[5]="GRAPH"]=5,n[t[6]="FLOATS"]=6,n[t[7]="INTS"]=7,n[t[8]="STRINGS"]=8,n[t[9]="TENSORS"]=9,n[t[10]="GRAPHS"]=10,n),e;var t,n}(),a.ValueInfoProto=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.name="",e.prototype.type=null,e.prototype.docString="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=l.create()),null!=e.name&&e.hasOwnProperty("name")&&t.uint32(10).string(e.name),null!=e.type&&e.hasOwnProperty("type")&&c.onnx.TypeProto.encode(e.type,t.uint32(18).fork()).ldelim(),null!=e.docString&&e.hasOwnProperty("docString")&&t.uint32(26).string(e.docString),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new c.onnx.ValueInfoProto;e.pos<n;){var o=e.uint32();switch(o>>>3){case 1:r.name=e.string();break;case 2:r.type=c.onnx.TypeProto.decode(e,e.uint32());break;case 3:r.docString=e.string();break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!u.isString(e.name))return"name: string expected";if(null!=e.type&&e.hasOwnProperty("type")){var t=c.onnx.TypeProto.verify(e.type);if(t)return"type."+t}return null!=e.docString&&e.hasOwnProperty("docString")&&!u.isString(e.docString)?"docString: string expected":null},e.fromObject=function(e){if(e instanceof c.onnx.ValueInfoProto)return e;var t=new c.onnx.ValueInfoProto;if(null!=e.name&&(t.name=String(e.name)),null!=e.type){if("object"!=typeof e.type)throw TypeError(".onnx.ValueInfoProto.type: object expected");t.type=c.onnx.TypeProto.fromObject(e.type)}return null!=e.docString&&(t.docString=String(e.docString)),t},e.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.name="",n.type=null,n.docString=""),null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.type&&e.hasOwnProperty("type")&&(n.type=c.onnx.TypeProto.toObject(e.type,t)),null!=e.docString&&e.hasOwnProperty("docString")&&(n.docString=e.docString),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.util.toJSONOptions)},e}(),a.NodeProto=function(){function e(e){if(this.input=[],this.output=[],this.attribute=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.input=u.emptyArray,e.prototype.output=u.emptyArray,e.prototype.name="",e.prototype.opType="",e.prototype.domain="",e.prototype.attribute=u.emptyArray,e.prototype.docString="",e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=l.create()),null!=e.input&&e.input.length)for(var n=0;n<e.input.length;++n)t.uint32(10).string(e.input[n]);if(null!=e.output&&e.output.length)for(n=0;n<e.output.length;++n)t.uint32(18).string(e.output[n]);if(null!=e.name&&e.hasOwnProperty("name")&&t.uint32(26).string(e.name),null!=e.opType&&e.hasOwnProperty("opType")&&t.uint32(34).string(e.opType),null!=e.attribute&&e.attribute.length)for(n=0;n<e.attribute.length;++n)c.onnx.AttributeProto.encode(e.attribute[n],t.uint32(42).fork()).ldelim();return null!=e.docString&&e.hasOwnProperty("docString")&&t.uint32(50).string(e.docString),null!=e.domain&&e.hasOwnProperty("domain")&&t.uint32(58).string(e.domain),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new c.onnx.NodeProto;e.pos<n;){var o=e.uint32();switch(o>>>3){case 1:r.input&&r.input.length||(r.input=[]),r.input.push(e.string());break;case 2:r.output&&r.output.length||(r.output=[]),r.output.push(e.string());break;case 3:r.name=e.string();break;case 4:r.opType=e.string();break;case 7:r.domain=e.string();break;case 5:r.attribute&&r.attribute.length||(r.attribute=[]),r.attribute.push(c.onnx.AttributeProto.decode(e,e.uint32()));break;case 6:r.docString=e.string();break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.input&&e.hasOwnProperty("input")){if(!Array.isArray(e.input))return"input: array expected";for(var t=0;t<e.input.length;++t)if(!u.isString(e.input[t]))return"input: string[] expected"}if(null!=e.output&&e.hasOwnProperty("output")){if(!Array.isArray(e.output))return"output: array expected";for(t=0;t<e.output.length;++t)if(!u.isString(e.output[t]))return"output: string[] expected"}if(null!=e.name&&e.hasOwnProperty("name")&&!u.isString(e.name))return"name: string expected";if(null!=e.opType&&e.hasOwnProperty("opType")&&!u.isString(e.opType))return"opType: string expected";if(null!=e.domain&&e.hasOwnProperty("domain")&&!u.isString(e.domain))return"domain: string expected";if(null!=e.attribute&&e.hasOwnProperty("attribute")){if(!Array.isArray(e.attribute))return"attribute: array expected";for(t=0;t<e.attribute.length;++t){var n=c.onnx.AttributeProto.verify(e.attribute[t]);if(n)return"attribute."+n}}return null!=e.docString&&e.hasOwnProperty("docString")&&!u.isString(e.docString)?"docString: string expected":null},e.fromObject=function(e){if(e instanceof c.onnx.NodeProto)return e;var t=new c.onnx.NodeProto;if(e.input){if(!Array.isArray(e.input))throw TypeError(".onnx.NodeProto.input: array expected");t.input=[];for(var n=0;n<e.input.length;++n)t.input[n]=String(e.input[n])}if(e.output){if(!Array.isArray(e.output))throw TypeError(".onnx.NodeProto.output: array expected");for(t.output=[],n=0;n<e.output.length;++n)t.output[n]=String(e.output[n])}if(null!=e.name&&(t.name=String(e.name)),null!=e.opType&&(t.opType=String(e.opType)),null!=e.domain&&(t.domain=String(e.domain)),e.attribute){if(!Array.isArray(e.attribute))throw TypeError(".onnx.NodeProto.attribute: array expected");for(t.attribute=[],n=0;n<e.attribute.length;++n){if("object"!=typeof e.attribute[n])throw TypeError(".onnx.NodeProto.attribute: object expected");t.attribute[n]=c.onnx.AttributeProto.fromObject(e.attribute[n])}}return null!=e.docString&&(t.docString=String(e.docString)),t},e.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.input=[],n.output=[],n.attribute=[]),t.defaults&&(n.name="",n.opType="",n.docString="",n.domain=""),e.input&&e.input.length){n.input=[];for(var r=0;r<e.input.length;++r)n.input[r]=e.input[r]}if(e.output&&e.output.length)for(n.output=[],r=0;r<e.output.length;++r)n.output[r]=e.output[r];if(null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.opType&&e.hasOwnProperty("opType")&&(n.opType=e.opType),e.attribute&&e.attribute.length)for(n.attribute=[],r=0;r<e.attribute.length;++r)n.attribute[r]=c.onnx.AttributeProto.toObject(e.attribute[r],t);return null!=e.docString&&e.hasOwnProperty("docString")&&(n.docString=e.docString),null!=e.domain&&e.hasOwnProperty("domain")&&(n.domain=e.domain),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.util.toJSONOptions)},e}(),a.ModelProto=function(){function e(e){if(this.opsetImport=[],this.metadataProps=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.irVersion=u.Long?u.Long.fromBits(0,0,!1):0,e.prototype.opsetImport=u.emptyArray,e.prototype.producerName="",e.prototype.producerVersion="",e.prototype.domain="",e.prototype.modelVersion=u.Long?u.Long.fromBits(0,0,!1):0,e.prototype.docString="",e.prototype.graph=null,e.prototype.metadataProps=u.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=l.create()),null!=e.irVersion&&e.hasOwnProperty("irVersion")&&t.uint32(8).int64(e.irVersion),null!=e.producerName&&e.hasOwnProperty("producerName")&&t.uint32(18).string(e.producerName),null!=e.producerVersion&&e.hasOwnProperty("producerVersion")&&t.uint32(26).string(e.producerVersion),null!=e.domain&&e.hasOwnProperty("domain")&&t.uint32(34).string(e.domain),null!=e.modelVersion&&e.hasOwnProperty("modelVersion")&&t.uint32(40).int64(e.modelVersion),null!=e.docString&&e.hasOwnProperty("docString")&&t.uint32(50).string(e.docString),null!=e.graph&&e.hasOwnProperty("graph")&&c.onnx.GraphProto.encode(e.graph,t.uint32(58).fork()).ldelim(),null!=e.opsetImport&&e.opsetImport.length)for(var n=0;n<e.opsetImport.length;++n)c.onnx.OperatorSetIdProto.encode(e.opsetImport[n],t.uint32(66).fork()).ldelim();if(null!=e.metadataProps&&e.metadataProps.length)for(n=0;n<e.metadataProps.length;++n)c.onnx.StringStringEntryProto.encode(e.metadataProps[n],t.uint32(114).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new c.onnx.ModelProto;e.pos<n;){var o=e.uint32();switch(o>>>3){case 1:r.irVersion=e.int64();break;case 8:r.opsetImport&&r.opsetImport.length||(r.opsetImport=[]),r.opsetImport.push(c.onnx.OperatorSetIdProto.decode(e,e.uint32()));break;case 2:r.producerName=e.string();break;case 3:r.producerVersion=e.string();break;case 4:r.domain=e.string();break;case 5:r.modelVersion=e.int64();break;case 6:r.docString=e.string();break;case 7:r.graph=c.onnx.GraphProto.decode(e,e.uint32());break;case 14:r.metadataProps&&r.metadataProps.length||(r.metadataProps=[]),r.metadataProps.push(c.onnx.StringStringEntryProto.decode(e,e.uint32()));break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.irVersion&&e.hasOwnProperty("irVersion")&&!(u.isInteger(e.irVersion)||e.irVersion&&u.isInteger(e.irVersion.low)&&u.isInteger(e.irVersion.high)))return"irVersion: integer|Long expected";if(null!=e.opsetImport&&e.hasOwnProperty("opsetImport")){if(!Array.isArray(e.opsetImport))return"opsetImport: array expected";for(var t=0;t<e.opsetImport.length;++t)if(n=c.onnx.OperatorSetIdProto.verify(e.opsetImport[t]))return"opsetImport."+n}if(null!=e.producerName&&e.hasOwnProperty("producerName")&&!u.isString(e.producerName))return"producerName: string expected";if(null!=e.producerVersion&&e.hasOwnProperty("producerVersion")&&!u.isString(e.producerVersion))return"producerVersion: string expected";if(null!=e.domain&&e.hasOwnProperty("domain")&&!u.isString(e.domain))return"domain: string expected";if(null!=e.modelVersion&&e.hasOwnProperty("modelVersion")&&!(u.isInteger(e.modelVersion)||e.modelVersion&&u.isInteger(e.modelVersion.low)&&u.isInteger(e.modelVersion.high)))return"modelVersion: integer|Long expected";if(null!=e.docString&&e.hasOwnProperty("docString")&&!u.isString(e.docString))return"docString: string expected";if(null!=e.graph&&e.hasOwnProperty("graph")&&(n=c.onnx.GraphProto.verify(e.graph)))return"graph."+n;if(null!=e.metadataProps&&e.hasOwnProperty("metadataProps")){if(!Array.isArray(e.metadataProps))return"metadataProps: array expected";for(t=0;t<e.metadataProps.length;++t){var n;if(n=c.onnx.StringStringEntryProto.verify(e.metadataProps[t]))return"metadataProps."+n}}return null},e.fromObject=function(e){if(e instanceof c.onnx.ModelProto)return e;var t=new c.onnx.ModelProto;if(null!=e.irVersion&&(u.Long?(t.irVersion=u.Long.fromValue(e.irVersion)).unsigned=!1:"string"==typeof e.irVersion?t.irVersion=parseInt(e.irVersion,10):"number"==typeof e.irVersion?t.irVersion=e.irVersion:"object"==typeof e.irVersion&&(t.irVersion=new u.LongBits(e.irVersion.low>>>0,e.irVersion.high>>>0).toNumber())),e.opsetImport){if(!Array.isArray(e.opsetImport))throw TypeError(".onnx.ModelProto.opsetImport: array expected");t.opsetImport=[];for(var n=0;n<e.opsetImport.length;++n){if("object"!=typeof e.opsetImport[n])throw TypeError(".onnx.ModelProto.opsetImport: object expected");t.opsetImport[n]=c.onnx.OperatorSetIdProto.fromObject(e.opsetImport[n])}}if(null!=e.producerName&&(t.producerName=String(e.producerName)),null!=e.producerVersion&&(t.producerVersion=String(e.producerVersion)),null!=e.domain&&(t.domain=String(e.domain)),null!=e.modelVersion&&(u.Long?(t.modelVersion=u.Long.fromValue(e.modelVersion)).unsigned=!1:"string"==typeof e.modelVersion?t.modelVersion=parseInt(e.modelVersion,10):"number"==typeof e.modelVersion?t.modelVersion=e.modelVersion:"object"==typeof e.modelVersion&&(t.modelVersion=new u.LongBits(e.modelVersion.low>>>0,e.modelVersion.high>>>0).toNumber())),null!=e.docString&&(t.docString=String(e.docString)),null!=e.graph){if("object"!=typeof e.graph)throw TypeError(".onnx.ModelProto.graph: object expected");t.graph=c.onnx.GraphProto.fromObject(e.graph)}if(e.metadataProps){if(!Array.isArray(e.metadataProps))throw TypeError(".onnx.ModelProto.metadataProps: array expected");for(t.metadataProps=[],n=0;n<e.metadataProps.length;++n){if("object"!=typeof e.metadataProps[n])throw TypeError(".onnx.ModelProto.metadataProps: object expected");t.metadataProps[n]=c.onnx.StringStringEntryProto.fromObject(e.metadataProps[n])}}return t},e.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.opsetImport=[],n.metadataProps=[]),t.defaults){if(u.Long){var r=new u.Long(0,0,!1);n.irVersion=t.longs===String?r.toString():t.longs===Number?r.toNumber():r}else n.irVersion=t.longs===String?"0":0;n.producerName="",n.producerVersion="",n.domain="",u.Long?(r=new u.Long(0,0,!1),n.modelVersion=t.longs===String?r.toString():t.longs===Number?r.toNumber():r):n.modelVersion=t.longs===String?"0":0,n.docString="",n.graph=null}if(null!=e.irVersion&&e.hasOwnProperty("irVersion")&&("number"==typeof e.irVersion?n.irVersion=t.longs===String?String(e.irVersion):e.irVersion:n.irVersion=t.longs===String?u.Long.prototype.toString.call(e.irVersion):t.longs===Number?new u.LongBits(e.irVersion.low>>>0,e.irVersion.high>>>0).toNumber():e.irVersion),null!=e.producerName&&e.hasOwnProperty("producerName")&&(n.producerName=e.producerName),null!=e.producerVersion&&e.hasOwnProperty("producerVersion")&&(n.producerVersion=e.producerVersion),null!=e.domain&&e.hasOwnProperty("domain")&&(n.domain=e.domain),null!=e.modelVersion&&e.hasOwnProperty("modelVersion")&&("number"==typeof e.modelVersion?n.modelVersion=t.longs===String?String(e.modelVersion):e.modelVersion:n.modelVersion=t.longs===String?u.Long.prototype.toString.call(e.modelVersion):t.longs===Number?new u.LongBits(e.modelVersion.low>>>0,e.modelVersion.high>>>0).toNumber():e.modelVersion),null!=e.docString&&e.hasOwnProperty("docString")&&(n.docString=e.docString),null!=e.graph&&e.hasOwnProperty("graph")&&(n.graph=c.onnx.GraphProto.toObject(e.graph,t)),e.opsetImport&&e.opsetImport.length){n.opsetImport=[];for(var o=0;o<e.opsetImport.length;++o)n.opsetImport[o]=c.onnx.OperatorSetIdProto.toObject(e.opsetImport[o],t)}if(e.metadataProps&&e.metadataProps.length)for(n.metadataProps=[],o=0;o<e.metadataProps.length;++o)n.metadataProps[o]=c.onnx.StringStringEntryProto.toObject(e.metadataProps[o],t);return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.util.toJSONOptions)},e}(),a.StringStringEntryProto=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.key="",e.prototype.value="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=l.create()),null!=e.key&&e.hasOwnProperty("key")&&t.uint32(10).string(e.key),null!=e.value&&e.hasOwnProperty("value")&&t.uint32(18).string(e.value),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new c.onnx.StringStringEntryProto;e.pos<n;){var o=e.uint32();switch(o>>>3){case 1:r.key=e.string();break;case 2:r.value=e.string();break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.key&&e.hasOwnProperty("key")&&!u.isString(e.key)?"key: string expected":null!=e.value&&e.hasOwnProperty("value")&&!u.isString(e.value)?"value: string expected":null},e.fromObject=function(e){if(e instanceof c.onnx.StringStringEntryProto)return e;var t=new c.onnx.StringStringEntryProto;return null!=e.key&&(t.key=String(e.key)),null!=e.value&&(t.value=String(e.value)),t},e.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.key="",n.value=""),null!=e.key&&e.hasOwnProperty("key")&&(n.key=e.key),null!=e.value&&e.hasOwnProperty("value")&&(n.value=e.value),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.util.toJSONOptions)},e}(),a.TensorAnnotation=function(){function e(e){if(this.quantParameterTensorNames=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.tensorName="",e.prototype.quantParameterTensorNames=u.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=l.create()),null!=e.tensorName&&e.hasOwnProperty("tensorName")&&t.uint32(10).string(e.tensorName),null!=e.quantParameterTensorNames&&e.quantParameterTensorNames.length)for(var n=0;n<e.quantParameterTensorNames.length;++n)c.onnx.StringStringEntryProto.encode(e.quantParameterTensorNames[n],t.uint32(18).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new c.onnx.TensorAnnotation;e.pos<n;){var o=e.uint32();switch(o>>>3){case 1:r.tensorName=e.string();break;case 2:r.quantParameterTensorNames&&r.quantParameterTensorNames.length||(r.quantParameterTensorNames=[]),r.quantParameterTensorNames.push(c.onnx.StringStringEntryProto.decode(e,e.uint32()));break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.tensorName&&e.hasOwnProperty("tensorName")&&!u.isString(e.tensorName))return"tensorName: string expected";if(null!=e.quantParameterTensorNames&&e.hasOwnProperty("quantParameterTensorNames")){if(!Array.isArray(e.quantParameterTensorNames))return"quantParameterTensorNames: array expected";for(var t=0;t<e.quantParameterTensorNames.length;++t){var n=c.onnx.StringStringEntryProto.verify(e.quantParameterTensorNames[t]);if(n)return"quantParameterTensorNames."+n}}return null},e.fromObject=function(e){if(e instanceof c.onnx.TensorAnnotation)return e;var t=new c.onnx.TensorAnnotation;if(null!=e.tensorName&&(t.tensorName=String(e.tensorName)),e.quantParameterTensorNames){if(!Array.isArray(e.quantParameterTensorNames))throw TypeError(".onnx.TensorAnnotation.quantParameterTensorNames: array expected");t.quantParameterTensorNames=[];for(var n=0;n<e.quantParameterTensorNames.length;++n){if("object"!=typeof e.quantParameterTensorNames[n])throw TypeError(".onnx.TensorAnnotation.quantParameterTensorNames: object expected");t.quantParameterTensorNames[n]=c.onnx.StringStringEntryProto.fromObject(e.quantParameterTensorNames[n])}}return t},e.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.quantParameterTensorNames=[]),t.defaults&&(n.tensorName=""),null!=e.tensorName&&e.hasOwnProperty("tensorName")&&(n.tensorName=e.tensorName),e.quantParameterTensorNames&&e.quantParameterTensorNames.length){n.quantParameterTensorNames=[];for(var r=0;r<e.quantParameterTensorNames.length;++r)n.quantParameterTensorNames[r]=c.onnx.StringStringEntryProto.toObject(e.quantParameterTensorNames[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.util.toJSONOptions)},e}(),a.GraphProto=function(){function e(e){if(this.node=[],this.initializer=[],this.input=[],this.output=[],this.valueInfo=[],this.quantizationAnnotation=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.node=u.emptyArray,e.prototype.name="",e.prototype.initializer=u.emptyArray,e.prototype.docString="",e.prototype.input=u.emptyArray,e.prototype.output=u.emptyArray,e.prototype.valueInfo=u.emptyArray,e.prototype.quantizationAnnotation=u.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=l.create()),null!=e.node&&e.node.length)for(var n=0;n<e.node.length;++n)c.onnx.NodeProto.encode(e.node[n],t.uint32(10).fork()).ldelim();if(null!=e.name&&e.hasOwnProperty("name")&&t.uint32(18).string(e.name),null!=e.initializer&&e.initializer.length)for(n=0;n<e.initializer.length;++n)c.onnx.TensorProto.encode(e.initializer[n],t.uint32(42).fork()).ldelim();if(null!=e.docString&&e.hasOwnProperty("docString")&&t.uint32(82).string(e.docString),null!=e.input&&e.input.length)for(n=0;n<e.input.length;++n)c.onnx.ValueInfoProto.encode(e.input[n],t.uint32(90).fork()).ldelim();if(null!=e.output&&e.output.length)for(n=0;n<e.output.length;++n)c.onnx.ValueInfoProto.encode(e.output[n],t.uint32(98).fork()).ldelim();if(null!=e.valueInfo&&e.valueInfo.length)for(n=0;n<e.valueInfo.length;++n)c.onnx.ValueInfoProto.encode(e.valueInfo[n],t.uint32(106).fork()).ldelim();if(null!=e.quantizationAnnotation&&e.quantizationAnnotation.length)for(n=0;n<e.quantizationAnnotation.length;++n)c.onnx.TensorAnnotation.encode(e.quantizationAnnotation[n],t.uint32(114).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new c.onnx.GraphProto;e.pos<n;){var o=e.uint32();switch(o>>>3){case 1:r.node&&r.node.length||(r.node=[]),r.node.push(c.onnx.NodeProto.decode(e,e.uint32()));break;case 2:r.name=e.string();break;case 5:r.initializer&&r.initializer.length||(r.initializer=[]),r.initializer.push(c.onnx.TensorProto.decode(e,e.uint32()));break;case 10:r.docString=e.string();break;case 11:r.input&&r.input.length||(r.input=[]),r.input.push(c.onnx.ValueInfoProto.decode(e,e.uint32()));break;case 12:r.output&&r.output.length||(r.output=[]),r.output.push(c.onnx.ValueInfoProto.decode(e,e.uint32()));break;case 13:r.valueInfo&&r.valueInfo.length||(r.valueInfo=[]),r.valueInfo.push(c.onnx.ValueInfoProto.decode(e,e.uint32()));break;case 14:r.quantizationAnnotation&&r.quantizationAnnotation.length||(r.quantizationAnnotation=[]),r.quantizationAnnotation.push(c.onnx.TensorAnnotation.decode(e,e.uint32()));break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.node&&e.hasOwnProperty("node")){if(!Array.isArray(e.node))return"node: array expected";for(var t=0;t<e.node.length;++t)if(n=c.onnx.NodeProto.verify(e.node[t]))return"node."+n}if(null!=e.name&&e.hasOwnProperty("name")&&!u.isString(e.name))return"name: string expected";if(null!=e.initializer&&e.hasOwnProperty("initializer")){if(!Array.isArray(e.initializer))return"initializer: array expected";for(t=0;t<e.initializer.length;++t)if(n=c.onnx.TensorProto.verify(e.initializer[t]))return"initializer."+n}if(null!=e.docString&&e.hasOwnProperty("docString")&&!u.isString(e.docString))return"docString: string expected";if(null!=e.input&&e.hasOwnProperty("input")){if(!Array.isArray(e.input))return"input: array expected";for(t=0;t<e.input.length;++t)if(n=c.onnx.ValueInfoProto.verify(e.input[t]))return"input."+n}if(null!=e.output&&e.hasOwnProperty("output")){if(!Array.isArray(e.output))return"output: array expected";for(t=0;t<e.output.length;++t)if(n=c.onnx.ValueInfoProto.verify(e.output[t]))return"output."+n}if(null!=e.valueInfo&&e.hasOwnProperty("valueInfo")){if(!Array.isArray(e.valueInfo))return"valueInfo: array expected";for(t=0;t<e.valueInfo.length;++t)if(n=c.onnx.ValueInfoProto.verify(e.valueInfo[t]))return"valueInfo."+n}if(null!=e.quantizationAnnotation&&e.hasOwnProperty("quantizationAnnotation")){if(!Array.isArray(e.quantizationAnnotation))return"quantizationAnnotation: array expected";for(t=0;t<e.quantizationAnnotation.length;++t){var n;if(n=c.onnx.TensorAnnotation.verify(e.quantizationAnnotation[t]))return"quantizationAnnotation."+n}}return null},e.fromObject=function(e){if(e instanceof c.onnx.GraphProto)return e;var t=new c.onnx.GraphProto;if(e.node){if(!Array.isArray(e.node))throw TypeError(".onnx.GraphProto.node: array expected");t.node=[];for(var n=0;n<e.node.length;++n){if("object"!=typeof e.node[n])throw TypeError(".onnx.GraphProto.node: object expected");t.node[n]=c.onnx.NodeProto.fromObject(e.node[n])}}if(null!=e.name&&(t.name=String(e.name)),e.initializer){if(!Array.isArray(e.initializer))throw TypeError(".onnx.GraphProto.initializer: array expected");for(t.initializer=[],n=0;n<e.initializer.length;++n){if("object"!=typeof e.initializer[n])throw TypeError(".onnx.GraphProto.initializer: object expected");t.initializer[n]=c.onnx.TensorProto.fromObject(e.initializer[n])}}if(null!=e.docString&&(t.docString=String(e.docString)),e.input){if(!Array.isArray(e.input))throw TypeError(".onnx.GraphProto.input: array expected");for(t.input=[],n=0;n<e.input.length;++n){if("object"!=typeof e.input[n])throw TypeError(".onnx.GraphProto.input: object expected");t.input[n]=c.onnx.ValueInfoProto.fromObject(e.input[n])}}if(e.output){if(!Array.isArray(e.output))throw TypeError(".onnx.GraphProto.output: array expected");for(t.output=[],n=0;n<e.output.length;++n){if("object"!=typeof e.output[n])throw TypeError(".onnx.GraphProto.output: object expected");t.output[n]=c.onnx.ValueInfoProto.fromObject(e.output[n])}}if(e.valueInfo){if(!Array.isArray(e.valueInfo))throw TypeError(".onnx.GraphProto.valueInfo: array expected");for(t.valueInfo=[],n=0;n<e.valueInfo.length;++n){if("object"!=typeof e.valueInfo[n])throw TypeError(".onnx.GraphProto.valueInfo: object expected");t.valueInfo[n]=c.onnx.ValueInfoProto.fromObject(e.valueInfo[n])}}if(e.quantizationAnnotation){if(!Array.isArray(e.quantizationAnnotation))throw TypeError(".onnx.GraphProto.quantizationAnnotation: array expected");for(t.quantizationAnnotation=[],n=0;n<e.quantizationAnnotation.length;++n){if("object"!=typeof e.quantizationAnnotation[n])throw TypeError(".onnx.GraphProto.quantizationAnnotation: object expected");t.quantizationAnnotation[n]=c.onnx.TensorAnnotation.fromObject(e.quantizationAnnotation[n])}}return t},e.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.node=[],n.initializer=[],n.input=[],n.output=[],n.valueInfo=[],n.quantizationAnnotation=[]),t.defaults&&(n.name="",n.docString=""),e.node&&e.node.length){n.node=[];for(var r=0;r<e.node.length;++r)n.node[r]=c.onnx.NodeProto.toObject(e.node[r],t)}if(null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),e.initializer&&e.initializer.length)for(n.initializer=[],r=0;r<e.initializer.length;++r)n.initializer[r]=c.onnx.TensorProto.toObject(e.initializer[r],t);if(null!=e.docString&&e.hasOwnProperty("docString")&&(n.docString=e.docString),e.input&&e.input.length)for(n.input=[],r=0;r<e.input.length;++r)n.input[r]=c.onnx.ValueInfoProto.toObject(e.input[r],t);if(e.output&&e.output.length)for(n.output=[],r=0;r<e.output.length;++r)n.output[r]=c.onnx.ValueInfoProto.toObject(e.output[r],t);if(e.valueInfo&&e.valueInfo.length)for(n.valueInfo=[],r=0;r<e.valueInfo.length;++r)n.valueInfo[r]=c.onnx.ValueInfoProto.toObject(e.valueInfo[r],t);if(e.quantizationAnnotation&&e.quantizationAnnotation.length)for(n.quantizationAnnotation=[],r=0;r<e.quantizationAnnotation.length;++r)n.quantizationAnnotation[r]=c.onnx.TensorAnnotation.toObject(e.quantizationAnnotation[r],t);return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.util.toJSONOptions)},e}(),a.TensorProto=function(){function e(e){if(this.dims=[],this.floatData=[],this.int32Data=[],this.stringData=[],this.int64Data=[],this.externalData=[],this.doubleData=[],this.uint64Data=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.dims=u.emptyArray,e.prototype.dataType=0,e.prototype.segment=null,e.prototype.floatData=u.emptyArray,e.prototype.int32Data=u.emptyArray,e.prototype.stringData=u.emptyArray,e.prototype.int64Data=u.emptyArray,e.prototype.name="",e.prototype.docString="",e.prototype.rawData=u.newBuffer([]),e.prototype.externalData=u.emptyArray,e.prototype.dataLocation=0,e.prototype.doubleData=u.emptyArray,e.prototype.uint64Data=u.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=l.create()),null!=e.dims&&e.dims.length){t.uint32(10).fork();for(var n=0;n<e.dims.length;++n)t.int64(e.dims[n]);t.ldelim()}if(null!=e.dataType&&e.hasOwnProperty("dataType")&&t.uint32(16).int32(e.dataType),null!=e.segment&&e.hasOwnProperty("segment")&&c.onnx.TensorProto.Segment.encode(e.segment,t.uint32(26).fork()).ldelim(),null!=e.floatData&&e.floatData.length){for(t.uint32(34).fork(),n=0;n<e.floatData.length;++n)t.float(e.floatData[n]);t.ldelim()}if(null!=e.int32Data&&e.int32Data.length){for(t.uint32(42).fork(),n=0;n<e.int32Data.length;++n)t.int32(e.int32Data[n]);t.ldelim()}if(null!=e.stringData&&e.stringData.length)for(n=0;n<e.stringData.length;++n)t.uint32(50).bytes(e.stringData[n]);if(null!=e.int64Data&&e.int64Data.length){for(t.uint32(58).fork(),n=0;n<e.int64Data.length;++n)t.int64(e.int64Data[n]);t.ldelim()}if(null!=e.name&&e.hasOwnProperty("name")&&t.uint32(66).string(e.name),null!=e.rawData&&e.hasOwnProperty("rawData")&&t.uint32(74).bytes(e.rawData),null!=e.doubleData&&e.doubleData.length){for(t.uint32(82).fork(),n=0;n<e.doubleData.length;++n)t.double(e.doubleData[n]);t.ldelim()}if(null!=e.uint64Data&&e.uint64Data.length){for(t.uint32(90).fork(),n=0;n<e.uint64Data.length;++n)t.uint64(e.uint64Data[n]);t.ldelim()}if(null!=e.docString&&e.hasOwnProperty("docString")&&t.uint32(98).string(e.docString),null!=e.externalData&&e.externalData.length)for(n=0;n<e.externalData.length;++n)c.onnx.StringStringEntryProto.encode(e.externalData[n],t.uint32(106).fork()).ldelim();return null!=e.dataLocation&&e.hasOwnProperty("dataLocation")&&t.uint32(112).int32(e.dataLocation),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new c.onnx.TensorProto;e.pos<n;){var o=e.uint32();switch(o>>>3){case 1:if(r.dims&&r.dims.length||(r.dims=[]),2==(7&o))for(var a=e.uint32()+e.pos;e.pos<a;)r.dims.push(e.int64());else r.dims.push(e.int64());break;case 2:r.dataType=e.int32();break;case 3:r.segment=c.onnx.TensorProto.Segment.decode(e,e.uint32());break;case 4:if(r.floatData&&r.floatData.length||(r.floatData=[]),2==(7&o))for(a=e.uint32()+e.pos;e.pos<a;)r.floatData.push(e.float());else r.floatData.push(e.float());break;case 5:if(r.int32Data&&r.int32Data.length||(r.int32Data=[]),2==(7&o))for(a=e.uint32()+e.pos;e.pos<a;)r.int32Data.push(e.int32());else r.int32Data.push(e.int32());break;case 6:r.stringData&&r.stringData.length||(r.stringData=[]),r.stringData.push(e.bytes());break;case 7:if(r.int64Data&&r.int64Data.length||(r.int64Data=[]),2==(7&o))for(a=e.uint32()+e.pos;e.pos<a;)r.int64Data.push(e.int64());else r.int64Data.push(e.int64());break;case 8:r.name=e.string();break;case 12:r.docString=e.string();break;case 9:r.rawData=e.bytes();break;case 13:r.externalData&&r.externalData.length||(r.externalData=[]),r.externalData.push(c.onnx.StringStringEntryProto.decode(e,e.uint32()));break;case 14:r.dataLocation=e.int32();break;case 10:if(r.doubleData&&r.doubleData.length||(r.doubleData=[]),2==(7&o))for(a=e.uint32()+e.pos;e.pos<a;)r.doubleData.push(e.double());else r.doubleData.push(e.double());break;case 11:if(r.uint64Data&&r.uint64Data.length||(r.uint64Data=[]),2==(7&o))for(a=e.uint32()+e.pos;e.pos<a;)r.uint64Data.push(e.uint64());else r.uint64Data.push(e.uint64());break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.dims&&e.hasOwnProperty("dims")){if(!Array.isArray(e.dims))return"dims: array expected";for(var t=0;t<e.dims.length;++t)if(!(u.isInteger(e.dims[t])||e.dims[t]&&u.isInteger(e.dims[t].low)&&u.isInteger(e.dims[t].high)))return"dims: integer|Long[] expected"}if(null!=e.dataType&&e.hasOwnProperty("dataType")&&!u.isInteger(e.dataType))return"dataType: integer expected";if(null!=e.segment&&e.hasOwnProperty("segment")&&(n=c.onnx.TensorProto.Segment.verify(e.segment)))return"segment."+n;if(null!=e.floatData&&e.hasOwnProperty("floatData")){if(!Array.isArray(e.floatData))return"floatData: array expected";for(t=0;t<e.floatData.length;++t)if("number"!=typeof e.floatData[t])return"floatData: number[] expected"}if(null!=e.int32Data&&e.hasOwnProperty("int32Data")){if(!Array.isArray(e.int32Data))return"int32Data: array expected";for(t=0;t<e.int32Data.length;++t)if(!u.isInteger(e.int32Data[t]))return"int32Data: integer[] expected"}if(null!=e.stringData&&e.hasOwnProperty("stringData")){if(!Array.isArray(e.stringData))return"stringData: array expected";for(t=0;t<e.stringData.length;++t)if(!(e.stringData[t]&&"number"==typeof e.stringData[t].length||u.isString(e.stringData[t])))return"stringData: buffer[] expected"}if(null!=e.int64Data&&e.hasOwnProperty("int64Data")){if(!Array.isArray(e.int64Data))return"int64Data: array expected";for(t=0;t<e.int64Data.length;++t)if(!(u.isInteger(e.int64Data[t])||e.int64Data[t]&&u.isInteger(e.int64Data[t].low)&&u.isInteger(e.int64Data[t].high)))return"int64Data: integer|Long[] expected"}if(null!=e.name&&e.hasOwnProperty("name")&&!u.isString(e.name))return"name: string expected";if(null!=e.docString&&e.hasOwnProperty("docString")&&!u.isString(e.docString))return"docString: string expected";if(null!=e.rawData&&e.hasOwnProperty("rawData")&&!(e.rawData&&"number"==typeof e.rawData.length||u.isString(e.rawData)))return"rawData: buffer expected";if(null!=e.externalData&&e.hasOwnProperty("externalData")){if(!Array.isArray(e.externalData))return"externalData: array expected";for(t=0;t<e.externalData.length;++t){var n;if(n=c.onnx.StringStringEntryProto.verify(e.externalData[t]))return"externalData."+n}}if(null!=e.dataLocation&&e.hasOwnProperty("dataLocation"))switch(e.dataLocation){default:return"dataLocation: enum value expected";case 0:case 1:}if(null!=e.doubleData&&e.hasOwnProperty("doubleData")){if(!Array.isArray(e.doubleData))return"doubleData: array expected";for(t=0;t<e.doubleData.length;++t)if("number"!=typeof e.doubleData[t])return"doubleData: number[] expected"}if(null!=e.uint64Data&&e.hasOwnProperty("uint64Data")){if(!Array.isArray(e.uint64Data))return"uint64Data: array expected";for(t=0;t<e.uint64Data.length;++t)if(!(u.isInteger(e.uint64Data[t])||e.uint64Data[t]&&u.isInteger(e.uint64Data[t].low)&&u.isInteger(e.uint64Data[t].high)))return"uint64Data: integer|Long[] expected"}return null},e.fromObject=function(e){if(e instanceof c.onnx.TensorProto)return e;var t=new c.onnx.TensorProto;if(e.dims){if(!Array.isArray(e.dims))throw TypeError(".onnx.TensorProto.dims: array expected");t.dims=[];for(var n=0;n<e.dims.length;++n)u.Long?(t.dims[n]=u.Long.fromValue(e.dims[n])).unsigned=!1:"string"==typeof e.dims[n]?t.dims[n]=parseInt(e.dims[n],10):"number"==typeof e.dims[n]?t.dims[n]=e.dims[n]:"object"==typeof e.dims[n]&&(t.dims[n]=new u.LongBits(e.dims[n].low>>>0,e.dims[n].high>>>0).toNumber())}if(null!=e.dataType&&(t.dataType=0|e.dataType),null!=e.segment){if("object"!=typeof e.segment)throw TypeError(".onnx.TensorProto.segment: object expected");t.segment=c.onnx.TensorProto.Segment.fromObject(e.segment)}if(e.floatData){if(!Array.isArray(e.floatData))throw TypeError(".onnx.TensorProto.floatData: array expected");for(t.floatData=[],n=0;n<e.floatData.length;++n)t.floatData[n]=Number(e.floatData[n])}if(e.int32Data){if(!Array.isArray(e.int32Data))throw TypeError(".onnx.TensorProto.int32Data: array expected");for(t.int32Data=[],n=0;n<e.int32Data.length;++n)t.int32Data[n]=0|e.int32Data[n]}if(e.stringData){if(!Array.isArray(e.stringData))throw TypeError(".onnx.TensorProto.stringData: array expected");for(t.stringData=[],n=0;n<e.stringData.length;++n)"string"==typeof e.stringData[n]?u.base64.decode(e.stringData[n],t.stringData[n]=u.newBuffer(u.base64.length(e.stringData[n])),0):e.stringData[n].length&&(t.stringData[n]=e.stringData[n])}if(e.int64Data){if(!Array.isArray(e.int64Data))throw TypeError(".onnx.TensorProto.int64Data: array expected");for(t.int64Data=[],n=0;n<e.int64Data.length;++n)u.Long?(t.int64Data[n]=u.Long.fromValue(e.int64Data[n])).unsigned=!1:"string"==typeof e.int64Data[n]?t.int64Data[n]=parseInt(e.int64Data[n],10):"number"==typeof e.int64Data[n]?t.int64Data[n]=e.int64Data[n]:"object"==typeof e.int64Data[n]&&(t.int64Data[n]=new u.LongBits(e.int64Data[n].low>>>0,e.int64Data[n].high>>>0).toNumber())}if(null!=e.name&&(t.name=String(e.name)),null!=e.docString&&(t.docString=String(e.docString)),null!=e.rawData&&("string"==typeof e.rawData?u.base64.decode(e.rawData,t.rawData=u.newBuffer(u.base64.length(e.rawData)),0):e.rawData.length&&(t.rawData=e.rawData)),e.externalData){if(!Array.isArray(e.externalData))throw TypeError(".onnx.TensorProto.externalData: array expected");for(t.externalData=[],n=0;n<e.externalData.length;++n){if("object"!=typeof e.externalData[n])throw TypeError(".onnx.TensorProto.externalData: object expected");t.externalData[n]=c.onnx.StringStringEntryProto.fromObject(e.externalData[n])}}switch(e.dataLocation){case"DEFAULT":case 0:t.dataLocation=0;break;case"EXTERNAL":case 1:t.dataLocation=1}if(e.doubleData){if(!Array.isArray(e.doubleData))throw TypeError(".onnx.TensorProto.doubleData: array expected");for(t.doubleData=[],n=0;n<e.doubleData.length;++n)t.doubleData[n]=Number(e.doubleData[n])}if(e.uint64Data){if(!Array.isArray(e.uint64Data))throw TypeError(".onnx.TensorProto.uint64Data: array expected");for(t.uint64Data=[],n=0;n<e.uint64Data.length;++n)u.Long?(t.uint64Data[n]=u.Long.fromValue(e.uint64Data[n])).unsigned=!0:"string"==typeof e.uint64Data[n]?t.uint64Data[n]=parseInt(e.uint64Data[n],10):"number"==typeof e.uint64Data[n]?t.uint64Data[n]=e.uint64Data[n]:"object"==typeof e.uint64Data[n]&&(t.uint64Data[n]=new u.LongBits(e.uint64Data[n].low>>>0,e.uint64Data[n].high>>>0).toNumber(!0))}return t},e.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.dims=[],n.floatData=[],n.int32Data=[],n.stringData=[],n.int64Data=[],n.doubleData=[],n.uint64Data=[],n.externalData=[]),t.defaults&&(n.dataType=0,n.segment=null,n.name="",t.bytes===String?n.rawData="":(n.rawData=[],t.bytes!==Array&&(n.rawData=u.newBuffer(n.rawData))),n.docString="",n.dataLocation=t.enums===String?"DEFAULT":0),e.dims&&e.dims.length){n.dims=[];for(var r=0;r<e.dims.length;++r)"number"==typeof e.dims[r]?n.dims[r]=t.longs===String?String(e.dims[r]):e.dims[r]:n.dims[r]=t.longs===String?u.Long.prototype.toString.call(e.dims[r]):t.longs===Number?new u.LongBits(e.dims[r].low>>>0,e.dims[r].high>>>0).toNumber():e.dims[r]}if(null!=e.dataType&&e.hasOwnProperty("dataType")&&(n.dataType=e.dataType),null!=e.segment&&e.hasOwnProperty("segment")&&(n.segment=c.onnx.TensorProto.Segment.toObject(e.segment,t)),e.floatData&&e.floatData.length)for(n.floatData=[],r=0;r<e.floatData.length;++r)n.floatData[r]=t.json&&!isFinite(e.floatData[r])?String(e.floatData[r]):e.floatData[r];if(e.int32Data&&e.int32Data.length)for(n.int32Data=[],r=0;r<e.int32Data.length;++r)n.int32Data[r]=e.int32Data[r];if(e.stringData&&e.stringData.length)for(n.stringData=[],r=0;r<e.stringData.length;++r)n.stringData[r]=t.bytes===String?u.base64.encode(e.stringData[r],0,e.stringData[r].length):t.bytes===Array?Array.prototype.slice.call(e.stringData[r]):e.stringData[r];if(e.int64Data&&e.int64Data.length)for(n.int64Data=[],r=0;r<e.int64Data.length;++r)"number"==typeof e.int64Data[r]?n.int64Data[r]=t.longs===String?String(e.int64Data[r]):e.int64Data[r]:n.int64Data[r]=t.longs===String?u.Long.prototype.toString.call(e.int64Data[r]):t.longs===Number?new u.LongBits(e.int64Data[r].low>>>0,e.int64Data[r].high>>>0).toNumber():e.int64Data[r];if(null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.rawData&&e.hasOwnProperty("rawData")&&(n.rawData=t.bytes===String?u.base64.encode(e.rawData,0,e.rawData.length):t.bytes===Array?Array.prototype.slice.call(e.rawData):e.rawData),e.doubleData&&e.doubleData.length)for(n.doubleData=[],r=0;r<e.doubleData.length;++r)n.doubleData[r]=t.json&&!isFinite(e.doubleData[r])?String(e.doubleData[r]):e.doubleData[r];if(e.uint64Data&&e.uint64Data.length)for(n.uint64Data=[],r=0;r<e.uint64Data.length;++r)"number"==typeof e.uint64Data[r]?n.uint64Data[r]=t.longs===String?String(e.uint64Data[r]):e.uint64Data[r]:n.uint64Data[r]=t.longs===String?u.Long.prototype.toString.call(e.uint64Data[r]):t.longs===Number?new u.LongBits(e.uint64Data[r].low>>>0,e.uint64Data[r].high>>>0).toNumber(!0):e.uint64Data[r];if(null!=e.docString&&e.hasOwnProperty("docString")&&(n.docString=e.docString),e.externalData&&e.externalData.length)for(n.externalData=[],r=0;r<e.externalData.length;++r)n.externalData[r]=c.onnx.StringStringEntryProto.toObject(e.externalData[r],t);return null!=e.dataLocation&&e.hasOwnProperty("dataLocation")&&(n.dataLocation=t.enums===String?c.onnx.TensorProto.DataLocation[e.dataLocation]:e.dataLocation),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.util.toJSONOptions)},e.DataType=(t={},(n=Object.create(t))[t[0]="UNDEFINED"]=0,n[t[1]="FLOAT"]=1,n[t[2]="UINT8"]=2,n[t[3]="INT8"]=3,n[t[4]="UINT16"]=4,n[t[5]="INT16"]=5,n[t[6]="INT32"]=6,n[t[7]="INT64"]=7,n[t[8]="STRING"]=8,n[t[9]="BOOL"]=9,n[t[10]="FLOAT16"]=10,n[t[11]="DOUBLE"]=11,n[t[12]="UINT32"]=12,n[t[13]="UINT64"]=13,n[t[14]="COMPLEX64"]=14,n[t[15]="COMPLEX128"]=15,n[t[16]="BFLOAT16"]=16,n),e.Segment=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.begin=u.Long?u.Long.fromBits(0,0,!1):0,e.prototype.end=u.Long?u.Long.fromBits(0,0,!1):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=l.create()),null!=e.begin&&e.hasOwnProperty("begin")&&t.uint32(8).int64(e.begin),null!=e.end&&e.hasOwnProperty("end")&&t.uint32(16).int64(e.end),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new c.onnx.TensorProto.Segment;e.pos<n;){var o=e.uint32();switch(o>>>3){case 1:r.begin=e.int64();break;case 2:r.end=e.int64();break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.begin&&e.hasOwnProperty("begin")&&!(u.isInteger(e.begin)||e.begin&&u.isInteger(e.begin.low)&&u.isInteger(e.begin.high))?"begin: integer|Long expected":null!=e.end&&e.hasOwnProperty("end")&&!(u.isInteger(e.end)||e.end&&u.isInteger(e.end.low)&&u.isInteger(e.end.high))?"end: integer|Long expected":null},e.fromObject=function(e){if(e instanceof c.onnx.TensorProto.Segment)return e;var t=new c.onnx.TensorProto.Segment;return null!=e.begin&&(u.Long?(t.begin=u.Long.fromValue(e.begin)).unsigned=!1:"string"==typeof e.begin?t.begin=parseInt(e.begin,10):"number"==typeof e.begin?t.begin=e.begin:"object"==typeof e.begin&&(t.begin=new u.LongBits(e.begin.low>>>0,e.begin.high>>>0).toNumber())),null!=e.end&&(u.Long?(t.end=u.Long.fromValue(e.end)).unsigned=!1:"string"==typeof e.end?t.end=parseInt(e.end,10):"number"==typeof e.end?t.end=e.end:"object"==typeof e.end&&(t.end=new u.LongBits(e.end.low>>>0,e.end.high>>>0).toNumber())),t},e.toObject=function(e,t){t||(t={});var n={};if(t.defaults){if(u.Long){var r=new u.Long(0,0,!1);n.begin=t.longs===String?r.toString():t.longs===Number?r.toNumber():r}else n.begin=t.longs===String?"0":0;u.Long?(r=new u.Long(0,0,!1),n.end=t.longs===String?r.toString():t.longs===Number?r.toNumber():r):n.end=t.longs===String?"0":0}return null!=e.begin&&e.hasOwnProperty("begin")&&("number"==typeof e.begin?n.begin=t.longs===String?String(e.begin):e.begin:n.begin=t.longs===String?u.Long.prototype.toString.call(e.begin):t.longs===Number?new u.LongBits(e.begin.low>>>0,e.begin.high>>>0).toNumber():e.begin),null!=e.end&&e.hasOwnProperty("end")&&("number"==typeof e.end?n.end=t.longs===String?String(e.end):e.end:n.end=t.longs===String?u.Long.prototype.toString.call(e.end):t.longs===Number?new u.LongBits(e.end.low>>>0,e.end.high>>>0).toNumber():e.end),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.util.toJSONOptions)},e}(),e.DataLocation=function(){var e={},t=Object.create(e);return t[e[0]="DEFAULT"]=0,t[e[1]="EXTERNAL"]=1,t}(),e;var t,n}(),a.TensorShapeProto=function(){function e(e){if(this.dim=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.dim=u.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=l.create()),null!=e.dim&&e.dim.length)for(var n=0;n<e.dim.length;++n)c.onnx.TensorShapeProto.Dimension.encode(e.dim[n],t.uint32(10).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new c.onnx.TensorShapeProto;e.pos<n;){var o=e.uint32();o>>>3==1?(r.dim&&r.dim.length||(r.dim=[]),r.dim.push(c.onnx.TensorShapeProto.Dimension.decode(e,e.uint32()))):e.skipType(7&o)}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.dim&&e.hasOwnProperty("dim")){if(!Array.isArray(e.dim))return"dim: array expected";for(var t=0;t<e.dim.length;++t){var n=c.onnx.TensorShapeProto.Dimension.verify(e.dim[t]);if(n)return"dim."+n}}return null},e.fromObject=function(e){if(e instanceof c.onnx.TensorShapeProto)return e;var t=new c.onnx.TensorShapeProto;if(e.dim){if(!Array.isArray(e.dim))throw TypeError(".onnx.TensorShapeProto.dim: array expected");t.dim=[];for(var n=0;n<e.dim.length;++n){if("object"!=typeof e.dim[n])throw TypeError(".onnx.TensorShapeProto.dim: object expected");t.dim[n]=c.onnx.TensorShapeProto.Dimension.fromObject(e.dim[n])}}return t},e.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.dim=[]),e.dim&&e.dim.length){n.dim=[];for(var r=0;r<e.dim.length;++r)n.dim[r]=c.onnx.TensorShapeProto.Dimension.toObject(e.dim[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.util.toJSONOptions)},e.Dimension=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}var t;return e.prototype.dimValue=u.Long?u.Long.fromBits(0,0,!1):0,e.prototype.dimParam="",e.prototype.denotation="",Object.defineProperty(e.prototype,"value",{get:u.oneOfGetter(t=["dimValue","dimParam"]),set:u.oneOfSetter(t)}),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=l.create()),null!=e.dimValue&&e.hasOwnProperty("dimValue")&&t.uint32(8).int64(e.dimValue),null!=e.dimParam&&e.hasOwnProperty("dimParam")&&t.uint32(18).string(e.dimParam),null!=e.denotation&&e.hasOwnProperty("denotation")&&t.uint32(26).string(e.denotation),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new c.onnx.TensorShapeProto.Dimension;e.pos<n;){var o=e.uint32();switch(o>>>3){case 1:r.dimValue=e.int64();break;case 2:r.dimParam=e.string();break;case 3:r.denotation=e.string();break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";var t={};if(null!=e.dimValue&&e.hasOwnProperty("dimValue")&&(t.value=1,!(u.isInteger(e.dimValue)||e.dimValue&&u.isInteger(e.dimValue.low)&&u.isInteger(e.dimValue.high))))return"dimValue: integer|Long expected";if(null!=e.dimParam&&e.hasOwnProperty("dimParam")){if(1===t.value)return"value: multiple values";if(t.value=1,!u.isString(e.dimParam))return"dimParam: string expected"}return null!=e.denotation&&e.hasOwnProperty("denotation")&&!u.isString(e.denotation)?"denotation: string expected":null},e.fromObject=function(e){if(e instanceof c.onnx.TensorShapeProto.Dimension)return e;var t=new c.onnx.TensorShapeProto.Dimension;return null!=e.dimValue&&(u.Long?(t.dimValue=u.Long.fromValue(e.dimValue)).unsigned=!1:"string"==typeof e.dimValue?t.dimValue=parseInt(e.dimValue,10):"number"==typeof e.dimValue?t.dimValue=e.dimValue:"object"==typeof e.dimValue&&(t.dimValue=new u.LongBits(e.dimValue.low>>>0,e.dimValue.high>>>0).toNumber())),null!=e.dimParam&&(t.dimParam=String(e.dimParam)),null!=e.denotation&&(t.denotation=String(e.denotation)),t},e.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.denotation=""),null!=e.dimValue&&e.hasOwnProperty("dimValue")&&("number"==typeof e.dimValue?n.dimValue=t.longs===String?String(e.dimValue):e.dimValue:n.dimValue=t.longs===String?u.Long.prototype.toString.call(e.dimValue):t.longs===Number?new u.LongBits(e.dimValue.low>>>0,e.dimValue.high>>>0).toNumber():e.dimValue,t.oneofs&&(n.value="dimValue")),null!=e.dimParam&&e.hasOwnProperty("dimParam")&&(n.dimParam=e.dimParam,t.oneofs&&(n.value="dimParam")),null!=e.denotation&&e.hasOwnProperty("denotation")&&(n.denotation=e.denotation),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.util.toJSONOptions)},e}(),e}(),a.TypeProto=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}var t;return e.prototype.tensorType=null,e.prototype.denotation="",Object.defineProperty(e.prototype,"value",{get:u.oneOfGetter(t=["tensorType"]),set:u.oneOfSetter(t)}),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=l.create()),null!=e.tensorType&&e.hasOwnProperty("tensorType")&&c.onnx.TypeProto.Tensor.encode(e.tensorType,t.uint32(10).fork()).ldelim(),null!=e.denotation&&e.hasOwnProperty("denotation")&&t.uint32(50).string(e.denotation),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new c.onnx.TypeProto;e.pos<n;){var o=e.uint32();switch(o>>>3){case 1:r.tensorType=c.onnx.TypeProto.Tensor.decode(e,e.uint32());break;case 6:r.denotation=e.string();break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.tensorType&&e.hasOwnProperty("tensorType")){var t=c.onnx.TypeProto.Tensor.verify(e.tensorType);if(t)return"tensorType."+t}return null!=e.denotation&&e.hasOwnProperty("denotation")&&!u.isString(e.denotation)?"denotation: string expected":null},e.fromObject=function(e){if(e instanceof c.onnx.TypeProto)return e;var t=new c.onnx.TypeProto;if(null!=e.tensorType){if("object"!=typeof e.tensorType)throw TypeError(".onnx.TypeProto.tensorType: object expected");t.tensorType=c.onnx.TypeProto.Tensor.fromObject(e.tensorType)}return null!=e.denotation&&(t.denotation=String(e.denotation)),t},e.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.denotation=""),null!=e.tensorType&&e.hasOwnProperty("tensorType")&&(n.tensorType=c.onnx.TypeProto.Tensor.toObject(e.tensorType,t),t.oneofs&&(n.value="tensorType")),null!=e.denotation&&e.hasOwnProperty("denotation")&&(n.denotation=e.denotation),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.util.toJSONOptions)},e.Tensor=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.elemType=0,e.prototype.shape=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=l.create()),null!=e.elemType&&e.hasOwnProperty("elemType")&&t.uint32(8).int32(e.elemType),null!=e.shape&&e.hasOwnProperty("shape")&&c.onnx.TensorShapeProto.encode(e.shape,t.uint32(18).fork()).ldelim(),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new c.onnx.TypeProto.Tensor;e.pos<n;){var o=e.uint32();switch(o>>>3){case 1:r.elemType=e.int32();break;case 2:r.shape=c.onnx.TensorShapeProto.decode(e,e.uint32());break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.elemType&&e.hasOwnProperty("elemType")&&!u.isInteger(e.elemType))return"elemType: integer expected";if(null!=e.shape&&e.hasOwnProperty("shape")){var t=c.onnx.TensorShapeProto.verify(e.shape);if(t)return"shape."+t}return null},e.fromObject=function(e){if(e instanceof c.onnx.TypeProto.Tensor)return e;var t=new c.onnx.TypeProto.Tensor;if(null!=e.elemType&&(t.elemType=0|e.elemType),null!=e.shape){if("object"!=typeof e.shape)throw TypeError(".onnx.TypeProto.Tensor.shape: object expected");t.shape=c.onnx.TensorShapeProto.fromObject(e.shape)}return t},e.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.elemType=0,n.shape=null),null!=e.elemType&&e.hasOwnProperty("elemType")&&(n.elemType=e.elemType),null!=e.shape&&e.hasOwnProperty("shape")&&(n.shape=c.onnx.TensorShapeProto.toObject(e.shape,t)),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.util.toJSONOptions)},e}(),e}(),a.OperatorSetIdProto=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.domain="",e.prototype.version=u.Long?u.Long.fromBits(0,0,!1):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=l.create()),null!=e.domain&&e.hasOwnProperty("domain")&&t.uint32(10).string(e.domain),null!=e.version&&e.hasOwnProperty("version")&&t.uint32(16).int64(e.version),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new c.onnx.OperatorSetIdProto;e.pos<n;){var o=e.uint32();switch(o>>>3){case 1:r.domain=e.string();break;case 2:r.version=e.int64();break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.domain&&e.hasOwnProperty("domain")&&!u.isString(e.domain)?"domain: string expected":null!=e.version&&e.hasOwnProperty("version")&&!(u.isInteger(e.version)||e.version&&u.isInteger(e.version.low)&&u.isInteger(e.version.high))?"version: integer|Long expected":null},e.fromObject=function(e){if(e instanceof c.onnx.OperatorSetIdProto)return e;var t=new c.onnx.OperatorSetIdProto;return null!=e.domain&&(t.domain=String(e.domain)),null!=e.version&&(u.Long?(t.version=u.Long.fromValue(e.version)).unsigned=!1:"string"==typeof e.version?t.version=parseInt(e.version,10):"number"==typeof e.version?t.version=e.version:"object"==typeof e.version&&(t.version=new u.LongBits(e.version.low>>>0,e.version.high>>>0).toNumber())),t},e.toObject=function(e,t){t||(t={});var n={};if(t.defaults)if(n.domain="",u.Long){var r=new u.Long(0,0,!1);n.version=t.longs===String?r.toString():t.longs===Number?r.toNumber():r}else n.version=t.longs===String?"0":0;return null!=e.domain&&e.hasOwnProperty("domain")&&(n.domain=e.domain),null!=e.version&&e.hasOwnProperty("version")&&("number"==typeof e.version?n.version=t.longs===String?String(e.version):e.version:n.version=t.longs===String?u.Long.prototype.toString.call(e.version):t.longs===Number?new u.LongBits(e.version.low>>>0,e.version.high>>>0).toNumber():e.version),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.util.toJSONOptions)},e}(),a),e.exports=c},2100:(e,t,n)=>{e.exports=n(9482)},9482:(e,t,n)=>{var r=t;function o(){r.util._configure(),r.Writer._configure(r.BufferWriter),r.Reader._configure(r.BufferReader)}r.build="minimal",r.Writer=n(1173),r.BufferWriter=n(3155),r.Reader=n(1408),r.BufferReader=n(593),r.util=n(9693),r.rpc=n(5994),r.roots=n(5054),r.configure=o,o()},1408:(e,t,n)=>{e.exports=l;var r,o=n(9693),a=o.LongBits,i=o.utf8;function s(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function l(e){this.buf=e,this.pos=0,this.len=e.length}var u,c="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new l(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new l(e);throw Error("illegal buffer")},d=function(){return o.Buffer?function(e){return(l.create=function(e){return o.Buffer.isBuffer(e)?new r(e):c(e)})(e)}:c};function f(){var e=new a(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw s(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw s(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function p(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function h(){if(this.pos+8>this.len)throw s(this,8);return new a(p(this.buf,this.pos+=4),p(this.buf,this.pos+=4))}l.create=d(),l.prototype._slice=o.Array.prototype.subarray||o.Array.prototype.slice,l.prototype.uint32=(u=4294967295,function(){if(u=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return u;if((this.pos+=5)>this.len)throw this.pos=this.len,s(this,10);return u}),l.prototype.int32=function(){return 0|this.uint32()},l.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)},l.prototype.bool=function(){return 0!==this.uint32()},l.prototype.fixed32=function(){if(this.pos+4>this.len)throw s(this,4);return p(this.buf,this.pos+=4)},l.prototype.sfixed32=function(){if(this.pos+4>this.len)throw s(this,4);return 0|p(this.buf,this.pos+=4)},l.prototype.float=function(){if(this.pos+4>this.len)throw s(this,4);var e=o.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},l.prototype.double=function(){if(this.pos+8>this.len)throw s(this,4);var e=o.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},l.prototype.bytes=function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw s(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,n):t===n?new this.buf.constructor(0):this._slice.call(this.buf,t,n)},l.prototype.string=function(){var e=this.bytes();return i.read(e,0,e.length)},l.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw s(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw s(this)}while(128&this.buf[this.pos++]);return this},l.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},l._configure=function(e){r=e,l.create=d(),r._configure();var t=o.Long?"toLong":"toNumber";o.merge(l.prototype,{int64:function(){return f.call(this)[t](!1)},uint64:function(){return f.call(this)[t](!0)},sint64:function(){return f.call(this).zzDecode()[t](!1)},fixed64:function(){return h.call(this)[t](!0)},sfixed64:function(){return h.call(this)[t](!1)}})}},593:(e,t,n)=>{e.exports=a;var r=n(1408);(a.prototype=Object.create(r.prototype)).constructor=a;var o=n(9693);function a(e){r.call(this,e)}a._configure=function(){o.Buffer&&(a.prototype._slice=o.Buffer.prototype.slice)},a.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},a._configure()},5054:e=>{e.exports={}},5994:(e,t,n)=>{t.Service=n(7948)},7948:(e,t,n)=>{e.exports=o;var r=n(9693);function o(e,t,n){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");r.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(n)}(o.prototype=Object.create(r.EventEmitter.prototype)).constructor=o,o.prototype.rpcCall=function e(t,n,o,a,i){if(!a)throw TypeError("request must be specified");var s=this;if(!i)return r.asPromise(e,s,t,n,o,a);if(s.rpcImpl)try{return s.rpcImpl(t,n[s.requestDelimited?"encodeDelimited":"encode"](a).finish(),function(e,n){if(e)return s.emit("error",e,t),i(e);if(null!==n){if(!(n instanceof o))try{n=o[s.responseDelimited?"decodeDelimited":"decode"](n)}catch(r){return s.emit("error",r,t),i(r)}return s.emit("data",n,t),i(null,n)}s.end(!0)})}catch(l){return s.emit("error",l,t),void setTimeout(function(){i(l)},0)}else setTimeout(function(){i(Error("already ended"))},0)},o.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},1945:(e,t,n)=>{e.exports=o;var r=n(9693);function o(e,t){this.lo=e>>>0,this.hi=t>>>0}var a=o.zero=new o(0,0);a.toNumber=function(){return 0},a.zzEncode=a.zzDecode=function(){return this},a.length=function(){return 1};var i=o.zeroHash="\0\0\0\0\0\0\0\0";o.fromNumber=function(e){if(0===e)return a;var t=e<0;t&&(e=-e);var n=e>>>0,r=(e-n)/4294967296>>>0;return t&&(r=~r>>>0,n=~n>>>0,++n>4294967295&&(n=0,++r>4294967295&&(r=0))),new o(n,r)},o.from=function(e){if("number"==typeof e)return o.fromNumber(e);if(r.isString(e)){if(!r.Long)return o.fromNumber(parseInt(e,10));e=r.Long.fromString(e)}return e.low||e.high?new o(e.low>>>0,e.high>>>0):a},o.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,n=~this.hi>>>0;return t||(n=n+1>>>0),-(t+4294967296*n)}return this.lo+4294967296*this.hi},o.prototype.toLong=function(e){return r.Long?new r.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var s=String.prototype.charCodeAt;o.fromHash=function(e){return e===i?a:new o((s.call(e,0)|s.call(e,1)<<8|s.call(e,2)<<16|s.call(e,3)<<24)>>>0,(s.call(e,4)|s.call(e,5)<<8|s.call(e,6)<<16|s.call(e,7)<<24)>>>0)},o.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},o.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},o.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},o.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return 0===n?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:n<128?9:10}},9693:function(e,t,n){var r=t;function o(e,t,n){for(var r=Object.keys(t),o=0;o<r.length;++o)void 0!==e[r[o]]&&n||(e[r[o]]=t[r[o]]);return e}function a(e){function t(e,n){if(!(this instanceof t))return new t(e,n);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),n&&o(this,n)}return(t.prototype=Object.create(Error.prototype)).constructor=t,Object.defineProperty(t.prototype,"name",{get:function(){return e}}),t.prototype.toString=function(){return this.name+": "+this.message},t}r.asPromise=n(4537),r.base64=n(7419),r.EventEmitter=n(9211),r.float=n(945),r.inquire=n(7199),r.utf8=n(4997),r.pool=n(6662),r.LongBits=n(1945),r.isNode=Boolean(void 0!==n.g&&n.g&&n.g.process&&n.g.process.versions&&n.g.process.versions.node),r.global=r.isNode&&n.g||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||this,r.emptyArray=Object.freeze?Object.freeze([]):[],r.emptyObject=Object.freeze?Object.freeze({}):{},r.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},r.isString=function(e){return"string"==typeof e||e instanceof String},r.isObject=function(e){return e&&"object"==typeof e},r.isset=r.isSet=function(e,t){var n=e[t];return!(null==n||!e.hasOwnProperty(t))&&("object"!=typeof n||(Array.isArray(n)?n.length:Object.keys(n).length)>0)},r.Buffer=function(){try{var e=r.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(t){return null}}(),r._Buffer_from=null,r._Buffer_allocUnsafe=null,r.newBuffer=function(e){return"number"==typeof e?r.Buffer?r._Buffer_allocUnsafe(e):new r.Array(e):r.Buffer?r._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},r.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,r.Long=r.global.dcodeIO&&r.global.dcodeIO.Long||r.global.Long||r.inquire("long"),r.key2Re=/^true|false|0|1$/,r.key32Re=/^-?(?:0|[1-9][0-9]*)$/,r.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,r.longToHash=function(e){return e?r.LongBits.from(e).toHash():r.LongBits.zeroHash},r.longFromHash=function(e,t){var n=r.LongBits.fromHash(e);return r.Long?r.Long.fromBits(n.lo,n.hi,t):n.toNumber(Boolean(t))},r.merge=o,r.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},r.newError=a,r.ProtocolError=a("ProtocolError"),r.oneOfGetter=function(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=1;return function(){for(var e=Object.keys(this),n=e.length-1;n>-1;--n)if(1===t[e[n]]&&void 0!==this[e[n]]&&null!==this[e[n]])return e[n]}},r.oneOfSetter=function(e){return function(t){for(var n=0;n<e.length;++n)e[n]!==t&&delete this[e[n]]}},r.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},r._configure=function(){var e=r.Buffer;e?(r._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,n){return new e(t,n)},r._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}):r._Buffer_from=r._Buffer_allocUnsafe=null}},1173:(e,t,n)=>{e.exports=d;var r,o=n(9693),a=o.LongBits,i=o.base64,s=o.utf8;function l(e,t,n){this.fn=e,this.len=t,this.next=void 0,this.val=n}function u(){}function c(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function d(){this.len=0,this.head=new l(u,0,0),this.tail=this.head,this.states=null}var f=function(){return o.Buffer?function(){return(d.create=function(){return new r})()}:function(){return new d}};function p(e,t,n){t[n]=255&e}function h(e,t){this.len=e,this.next=void 0,this.val=t}function m(e,t,n){for(;e.hi;)t[n++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[n++]=127&e.lo|128,e.lo=e.lo>>>7;t[n++]=e.lo}function g(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}d.create=f(),d.alloc=function(e){return new o.Array(e)},o.Array!==Array&&(d.alloc=o.pool(d.alloc,o.Array.prototype.subarray)),d.prototype._push=function(e,t,n){return this.tail=this.tail.next=new l(e,t,n),this.len+=t,this},h.prototype=Object.create(l.prototype),h.prototype.fn=function(e,t,n){for(;e>127;)t[n++]=127&e|128,e>>>=7;t[n]=e},d.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new h((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},d.prototype.int32=function(e){return e<0?this._push(m,10,a.fromNumber(e)):this.uint32(e)},d.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},d.prototype.uint64=function(e){var t=a.from(e);return this._push(m,t.length(),t)},d.prototype.int64=d.prototype.uint64,d.prototype.sint64=function(e){var t=a.from(e).zzEncode();return this._push(m,t.length(),t)},d.prototype.bool=function(e){return this._push(p,1,e?1:0)},d.prototype.fixed32=function(e){return this._push(g,4,e>>>0)},d.prototype.sfixed32=d.prototype.fixed32,d.prototype.fixed64=function(e){var t=a.from(e);return this._push(g,4,t.lo)._push(g,4,t.hi)},d.prototype.sfixed64=d.prototype.fixed64,d.prototype.float=function(e){return this._push(o.float.writeFloatLE,4,e)},d.prototype.double=function(e){return this._push(o.float.writeDoubleLE,8,e)};var b=o.Array.prototype.set?function(e,t,n){t.set(e,n)}:function(e,t,n){for(var r=0;r<e.length;++r)t[n+r]=e[r]};d.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(p,1,0);if(o.isString(e)){var n=d.alloc(t=i.length(e));i.decode(e,n,0),e=n}return this.uint32(t)._push(b,t,e)},d.prototype.string=function(e){var t=s.length(e);return t?this.uint32(t)._push(s.write,t,e):this._push(p,1,0)},d.prototype.fork=function(){return this.states=new c(this),this.head=this.tail=new l(u,0,0),this.len=0,this},d.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new l(u,0,0),this.len=0),this},d.prototype.ldelim=function(){var e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=t,this.len+=n),this},d.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),n=0;e;)e.fn(e.val,t,n),n+=e.len,e=e.next;return t},d._configure=function(e){r=e,d.create=f(),r._configure()}},3155:(e,t,n)=>{e.exports=a;var r=n(1173);(a.prototype=Object.create(r.prototype)).constructor=a;var o=n(9693);function a(){r.call(this)}function i(e,t,n){e.length<40?o.utf8.write(e,t,n):t.utf8Write?t.utf8Write(e,n):t.write(e,n)}a._configure=function(){a.alloc=o._Buffer_allocUnsafe,a.writeBytesBuffer=o.Buffer&&o.Buffer.prototype instanceof Uint8Array&&"set"===o.Buffer.prototype.set.name?function(e,t,n){t.set(e,n)}:function(e,t,n){if(e.copy)e.copy(t,n,0,e.length);else for(var r=0;r<e.length;)t[n++]=e[r++]}},a.prototype.bytes=function(e){o.isString(e)&&(e=o._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(a.writeBytesBuffer,t,e),this},a.prototype.string=function(e){var t=o.Buffer.byteLength(e);return this.uint32(t),t&&this._push(i,t,e),this},a._configure()},7714:(e,t,n)=>{t.R=void 0;const r=n(6919),o=n(7448);t.R=new class{async init(){}async createSessionHandler(e,t){const n=new r.Session(t);return await n.loadModel(e),new o.OnnxjsSessionHandler(n)}}},4200:(e,t,n)=>{t.c8=t.rX=void 0;const r=n(1670),o=n(5381),a=n(2157),i=n(2306);t.rX=()=>{if(("number"!=typeof r.env.wasm.initTimeout||r.env.wasm.initTimeout<0)&&(r.env.wasm.initTimeout=0),"boolean"!=typeof r.env.wasm.simd&&(r.env.wasm.simd=!0),"boolean"!=typeof r.env.wasm.proxy&&(r.env.wasm.proxy=!1),"number"!=typeof r.env.wasm.numThreads||!Number.isInteger(r.env.wasm.numThreads)||r.env.wasm.numThreads<=0){const e="undefined"==typeof navigator?(0,o.cpus)().length:navigator.hardwareConcurrency;r.env.wasm.numThreads=Math.min(4,Math.ceil((e||1)/2))}},t.c8=new class{async init(){(0,t.rX)(),await(0,a.initWasm)()}async createSessionHandler(e,t){const n=new i.OnnxruntimeWebAssemblySessionHandler;return await n.loadModel(e,t),Promise.resolve(n)}}},6018:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(1670),t);const a=n(1670);{const e=n(7714).R;(0,a.registerBackend)("webgl",e,-10)}{const e=n(4200).c8;(0,a.registerBackend)("cpu",e,10),(0,a.registerBackend)("wasm",e,10),(0,a.registerBackend)("xnnpack",e,9)}},246:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createAttributeWithCacheKey=void 0;class n{constructor(e){Object.assign(this,e)}get cacheKey(){return this._cacheKey||(this._cacheKey=Object.getOwnPropertyNames(this).sort().map(e=>`${this[e]}`).join(";")),this._cacheKey}}t.createAttributeWithCacheKey=e=>new n(e)},7778:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Attribute=void 0;const r=n(1446),o=n(9395),a=n(9162),i=n(2517);var s=o.onnxruntime.experimental.fbs;class l{constructor(e){if(this._attributes=new Map,null!=e){for(const t of e)t instanceof r.onnx.AttributeProto?this._attributes.set(t.name,[l.getValue(t),l.getType(t)]):t instanceof s.Attribute&&this._attributes.set(t.name(),[l.getValue(t),l.getType(t)]);if(this._attributes.size<e.length)throw new Error("duplicated attribute names")}}set(e,t,n){this._attributes.set(e,[n,t])}delete(e){this._attributes.delete(e)}getFloat(e,t){return this.get(e,"float",t)}getInt(e,t){return this.get(e,"int",t)}getString(e,t){return this.get(e,"string",t)}getTensor(e,t){return this.get(e,"tensor",t)}getFloats(e,t){return this.get(e,"floats",t)}getInts(e,t){return this.get(e,"ints",t)}getStrings(e,t){return this.get(e,"strings",t)}getTensors(e,t){return this.get(e,"tensors",t)}get(e,t,n){const r=this._attributes.get(e);if(void 0===r){if(void 0!==n)return n;throw new Error(`required attribute not found: ${e}`)}if(r[1]!==t)throw new Error(`type mismatch: expected ${t} but got ${r[1]}`);return r[0]}static getType(e){const t=e instanceof r.onnx.AttributeProto?e.type:e.type();switch(t){case r.onnx.AttributeProto.AttributeType.FLOAT:return"float";case r.onnx.AttributeProto.AttributeType.INT:return"int";case r.onnx.AttributeProto.AttributeType.STRING:return"string";case r.onnx.AttributeProto.AttributeType.TENSOR:return"tensor";case r.onnx.AttributeProto.AttributeType.FLOATS:return"floats";case r.onnx.AttributeProto.AttributeType.INTS:return"ints";case r.onnx.AttributeProto.AttributeType.STRINGS:return"strings";case r.onnx.AttributeProto.AttributeType.TENSORS:return"tensors";default:throw new Error(`attribute type is not supported yet: ${r.onnx.AttributeProto.AttributeType[t]}`)}}static getValue(e){const t=e instanceof r.onnx.AttributeProto?e.type:e.type();if(t===r.onnx.AttributeProto.AttributeType.GRAPH||t===r.onnx.AttributeProto.AttributeType.GRAPHS)throw new Error("graph attribute is not supported yet");const n=this.getValueNoCheck(e);if(t===r.onnx.AttributeProto.AttributeType.INT&&i.LongUtil.isLong(n))return i.LongUtil.longToNumber(n);if(t===r.onnx.AttributeProto.AttributeType.INTS){const e=n,t=new Array(e.length);for(let n=0;n<e.length;n++){const r=e[n];t[n]=i.LongUtil.longToNumber(r)}return t}if(t===r.onnx.AttributeProto.AttributeType.TENSOR)return e instanceof r.onnx.AttributeProto?a.Tensor.fromProto(n):a.Tensor.fromOrtTensor(n);if(t===r.onnx.AttributeProto.AttributeType.TENSORS){if(e instanceof r.onnx.AttributeProto)return n.map(e=>a.Tensor.fromProto(e));if(e instanceof s.Attribute)return n.map(e=>a.Tensor.fromOrtTensor(e))}if(t===r.onnx.AttributeProto.AttributeType.STRING&&e instanceof r.onnx.AttributeProto){const e=n;return(0,i.decodeUtf8String)(e)}return t===r.onnx.AttributeProto.AttributeType.STRINGS&&e instanceof r.onnx.AttributeProto?n.map(i.decodeUtf8String):n}static getValueNoCheck(e){return e instanceof r.onnx.AttributeProto?this.getValueNoCheckFromOnnxFormat(e):this.getValueNoCheckFromOrtFormat(e)}static getValueNoCheckFromOnnxFormat(e){switch(e.type){case r.onnx.AttributeProto.AttributeType.FLOAT:return e.f;case r.onnx.AttributeProto.AttributeType.INT:return e.i;case r.onnx.AttributeProto.AttributeType.STRING:return e.s;case r.onnx.AttributeProto.AttributeType.TENSOR:return e.t;case r.onnx.AttributeProto.AttributeType.GRAPH:return e.g;case r.onnx.AttributeProto.AttributeType.FLOATS:return e.floats;case r.onnx.AttributeProto.AttributeType.INTS:return e.ints;case r.onnx.AttributeProto.AttributeType.STRINGS:return e.strings;case r.onnx.AttributeProto.AttributeType.TENSORS:return e.tensors;case r.onnx.AttributeProto.AttributeType.GRAPHS:return e.graphs;default:throw new Error(`unsupported attribute type: ${r.onnx.AttributeProto.AttributeType[e.type]}`)}}static getValueNoCheckFromOrtFormat(e){switch(e.type()){case s.AttributeType.FLOAT:return e.f();case s.AttributeType.INT:return e.i();case s.AttributeType.STRING:return e.s();case s.AttributeType.TENSOR:return e.t();case s.AttributeType.GRAPH:return e.g();case s.AttributeType.FLOATS:return e.floatsArray();case s.AttributeType.INTS:{const t=[];for(let n=0;n<e.intsLength();n++)t.push(e.ints(n));return t}case s.AttributeType.STRINGS:{const t=[];for(let n=0;n<e.stringsLength();n++)t.push(e.strings(n));return t}case s.AttributeType.TENSORS:{const t=[];for(let n=0;n<e.tensorsLength();n++)t.push(e.tensors(n));return t}default:throw new Error(`unsupported attribute type: ${s.AttributeType[e.type()]}`)}}}t.Attribute=l},7091:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.resolveBackend=t.backend=void 0;const r=n(5038),o=new Map;async function a(e){const n=t.backend;if(void 0!==n[e]&&function(e){const t=e;return"initialize"in t&&"function"==typeof t.initialize&&"createSessionHandler"in t&&"function"==typeof t.createSessionHandler&&"dispose"in t&&"function"==typeof t.dispose}(n[e])){const t=n[e];let r=t.initialize();if("object"==typeof r&&"then"in r&&(r=await r),r)return o.set(e,t),t}}t.backend={webgl:new r.WebGLBackend},t.resolveBackend=async function e(t){if(!t)return e(["webgl"]);{const e="string"==typeof t?[t]:t;for(const t of e){const e=o.get(t);if(e)return e;const n=await a(t);if(n)return n}}throw new Error("no available backend to use")}},5038:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WebGLBackend=void 0;const r=n(1670),o=n(6231),a=n(6416),i=n(7305);t.WebGLBackend=class{get contextId(){return r.env.webgl.contextId}set contextId(e){r.env.webgl.contextId=e}get matmulMaxBatchSize(){return r.env.webgl.matmulMaxBatchSize}set matmulMaxBatchSize(e){r.env.webgl.matmulMaxBatchSize=e}get textureCacheMode(){return r.env.webgl.textureCacheMode}set textureCacheMode(e){r.env.webgl.textureCacheMode=e}get pack(){return r.env.webgl.pack}set pack(e){r.env.webgl.pack=e}get async(){return r.env.webgl.async}set async(e){r.env.webgl.async=e}initialize(){try{return this.glContext=(0,i.createWebGLContext)(this.contextId),"number"!=typeof this.matmulMaxBatchSize&&(this.matmulMaxBatchSize=16),"string"!=typeof this.textureCacheMode&&(this.textureCacheMode="full"),"boolean"!=typeof this.pack&&(this.pack=!1),"boolean"!=typeof this.async&&(this.async=!1),o.Logger.setWithEnv(r.env),o.Logger.verbose("WebGLBackend",`Created WebGLContext: ${typeof this.glContext} with matmulMaxBatchSize: ${this.matmulMaxBatchSize}; textureCacheMode: ${this.textureCacheMode}; pack: ${this.pack}; async: ${this.async}.`),!0}catch(e){return o.Logger.warning("WebGLBackend",`Unable to initialize WebGLBackend. ${e}`),!1}}createSessionHandler(e){return new a.WebGLSessionHandler(this,e)}dispose(){this.glContext.dispose()}}},5107:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CoordsGlslLib=void 0;const r=n(2517),o=n(8520),a=n(5060),i=n(7859),s=n(9390);class l extends o.GlslLib{constructor(e){super(e)}getFunctions(){return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},this.offsetToCoords()),this.coordsToOffset()),this.toVec()),this.valueFrom()),this.getCommonUtilFuncs()),this.getInputsSamplingSnippets()),this.getOutputSamplingSnippet())}getCustomTypes(){return{}}offsetToCoords(){return{offsetToCoords:new o.GlslLibRoutine("\n vec2 offsetToCoords(int offset, int width, int height) {\n int t = offset / width;\n int s = offset - t*width;\n vec2 coords = (vec2(s,t) + vec2(0.5,0.5)) / vec2(width, height);\n return coords;\n }\n ")}}coordsToOffset(){return{coordsToOffset:new o.GlslLibRoutine("\n int coordsToOffset(vec2 coords, int width, int height) {\n float s = coords.s * float(width);\n float t = coords.t * float(height);\n int offset = int(t) * width + int(s);\n return offset;\n }\n ")}}getOutputSamplingSnippet(){const e=this.context.outputTextureLayout;return e.isPacked?this.getPackedOutputSamplingSnippet(e):this.getUnpackedOutputSamplingSnippet(e)}getPackedOutputSamplingSnippet(e){const t=e.unpackedShape,n=[e.width,e.height],r={},i="getOutputCoords";switch(t.length){case 0:r[i]=this.getOutputScalarCoords();break;case 1:r[i]=this.getOutputPacked1DCoords(t,n);break;case 2:r[i]=this.getOutputPacked2DCoords(t,n);break;case 3:r[i]=this.getOutputPacked3DCoords(t,n);break;default:r[i]=this.getOutputPackedNDCoords(t,n)}const s=`\n void setOutput(vec4 val) {\n ${(0,a.getGlsl)(this.context.glContext.version).output} = val;\n }\n `;return r.floatTextureSetRGBA=new o.GlslLibRoutine(s),r}getUnpackedOutputSamplingSnippet(e){const t=e.unpackedShape,n=[e.width,e.height],r={},i="getOutputCoords";switch(t.length){case 0:r[i]=this.getOutputScalarCoords();break;case 1:r[i]=this.getOutputUnpacked1DCoords(t,n);break;case 2:r[i]=this.getOutputUnpacked2DCoords(t,n);break;case 3:r[i]=this.getOutputUnpacked3DCoords(t,n);break;case 4:r[i]=this.getOutputUnpacked4DCoords(t,n);break;case 5:r[i]=this.getOutputUnpacked5DCoords(t,n);break;case 6:r[i]=this.getOutputUnpacked6DCoords(t,n);break;default:throw new Error(`Unsupported output dimensionality: ${t.length}`)}const s=`\n void setOutput(float val) {\n ${(0,a.getGlsl)(this.context.glContext.version).output} = vec4(val, 0, 0, 0);\n }\n `;return r.floatTextureSetR=new o.GlslLibRoutine(s),r}getOutputScalarCoords(){return new o.GlslLibRoutine("\n int getOutputCoords() {\n return 0;\n }\n ")}getOutputPacked1DCoords(e,t){const n=t;let r="";return 1===n[0]?(r=`\n int getOutputCoords() {\n return 2 * int(TexCoords.y * ${n[1]}.0);\n }\n `,new o.GlslLibRoutine(r)):1===n[1]?(r=`\n int getOutputCoords() {\n return 2 * int(TexCoords.x * ${n[0]}.0);\n }\n `,new o.GlslLibRoutine(r)):(r=`\n int getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${n[0]}, ${n[1]}));\n return 2 * (resTexRC.y * ${n[0]} + resTexRC.x);\n }\n `,new o.GlslLibRoutine(r))}getOutputPacked2DCoords(e,t){let n="";if(r.ArrayUtil.arraysEqual(e,t))return n=`\n ivec2 getOutputCoords() {\n return 2 * ivec2(TexCoords.xy * vec2(${t[0]}, ${t[1]}));\n }\n `,new o.GlslLibRoutine(n);const a=t,i=Math.ceil(e[1]/2);return n=`\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${a[0]}, ${a[1]}));\n\n int index = resTexRC.y * ${a[0]} + resTexRC.x;\n\n // reverse r and c order for packed texture\n int r = imod(index, ${i}) * 2;\n int c = 2 * (index / ${i});\n\n return ivec2(r, c);\n }\n `,new o.GlslLibRoutine(n)}getOutputPacked3DCoords(e,t){const n=[t[0],t[1]],r=Math.ceil(e[2]/2),a=r*Math.ceil(e[1]/2),i=`\n ivec3 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${n[0]}, ${n[1]}));\n int index = resTexRC.y * ${n[0]} + resTexRC.x;\n\n int b = index / ${a};\n index -= b * ${a};\n\n // reverse r and c order for packed texture\n int r = imod(index, ${r}) * 2;\n int c = 2 * (index / ${r});\n\n return ivec3(b, r, c);\n }\n `;return new o.GlslLibRoutine(i)}getOutputPackedNDCoords(e,t){const n=[t[0],t[1]],r=Math.ceil(e[e.length-1]/2),a=r*Math.ceil(e[e.length-2]/2);let i=a,s="",l="b, r, c";for(let o=2;o<e.length-1;o++)i*=e[e.length-o-1],s=`\n int b${o} = index / ${i};\n index -= b${o} * ${i};\n `+s,l=`b${o}, `+l;const u=`\n ivec${e.length} getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${n[0]}, ${n[1]}));\n int index = resTexRC.y * ${n[0]} + resTexRC.x;\n\n ${s}\n\n int b = index / ${a};\n index -= b * ${a};\n\n // reverse r and c order for packed texture\n int r = imod(index, ${r}) * 2;\n int c = 2 * (index / ${r});\n\n return ivec${e.length}(${l});\n }\n `;return new o.GlslLibRoutine(u)}getOutputUnpacked1DCoords(e,t){const n=`\n int getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${t[0]}, ${t[1]}));\n return resTexRC.y * ${t[0]} + resTexRC.x;\n }\n `;return new o.GlslLibRoutine(n)}getOutputUnpacked2DCoords(e,t){const n=`\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${t[0]}, ${t[1]}));\n int index = resTexRC.y * ${t[0]} + resTexRC.x;\n int r = index / ${e[1]};\n int c = index - r * ${e[1]};\n return ivec2(r, c);\n }\n `;return new o.GlslLibRoutine(n)}getOutputUnpacked3DCoords(e,t){let n="";const r=e.length;let a=null;r<2&&(a=[]),a=new Array(r-1),a[r-2]=e[r-1];for(let o=r-3;o>=0;--o)a[o]=a[o+1]*e[o+1];const i=["r","c","d"],s=a.map((e,t)=>`int ${i[t]} = index / ${e}; ${t===a.length-1?`int ${i[t+1]} = index - ${i[t]} * ${e}`:`index -= ${i[t]} * ${e}`};`).join("");return n=`\n ivec3 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${t[0]}, ${t[1]}));\n int index = resTexRC.y * ${t[0]} + resTexRC.x;\n ${s}\n return ivec3(r, c, d);\n }\n `,new o.GlslLibRoutine(n)}getOutputUnpacked4DCoords(e,t){let n="";const r=e.length;let a=null;r<2&&(a=[]),a=new Array(r-1),a[r-2]=e[r-1];for(let o=r-3;o>=0;--o)a[o]=a[o+1]*e[o+1];const i=["r","c","d","d2"],s=a.map((e,t)=>`int ${i[t]} = index / ${e}; ${t===a.length-1?`int ${i[t+1]} = index - ${i[t]} * ${e}`:`index -= ${i[t]} * ${e}`};`).join("");return n=`\n ivec4 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${t[0]}, ${t[1]}));\n int index = resTexRC.y * ${t[0]} + resTexRC.x;\n ${s}\n return ivec4(r, c, d, d2);\n }\n `,new o.GlslLibRoutine(n)}getOutputUnpacked5DCoords(e,t){let n="";const r=e.length;let a=null;r<2&&(a=[]),a=new Array(r-1),a[r-2]=e[r-1];for(let o=r-3;o>=0;--o)a[o]=a[o+1]*e[o+1];const i=["r","c","d","d2","d3"],s=a.map((e,t)=>`int ${i[t]} = index / ${e}; ${t===a.length-1?`int ${i[t+1]} = index - ${i[t]} * ${e}`:`index -= ${i[t]} * ${e}`};`).join("");return n=`\n ivec5 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${t[0]}, ${t[1]}));\n int index = resTexRC.y * ${t[0]} + resTexRC.x;\n ${s}\n return ivec5(r, c, d, d2, d3);\n }\n `,new o.GlslLibRoutine(n)}getOutputUnpacked6DCoords(e,t){let n="";const r=e.length;let a=null;r<2&&(a=[]),a=new Array(r-1),a[r-2]=e[r-1];for(let o=r-3;o>=0;--o)a[o]=a[o+1]*e[o+1];const i=["r","c","d","d2","d3","d4"],s=a.map((e,t)=>`int ${i[t]} = index / ${e}; ${t===a.length-1?`int ${i[t+1]} = index - ${i[t]} * ${e}`:`index -= ${i[t]} * ${e}`};`).join("");return n=`\n ivec6 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${t[0]}, ${t[1]}));\n int index = resTexRC.y * ${t[0]} + resTexRC.x;\n ${s}\n return ivec6(r, c, d, d2, d3, d4);\n }\n `,new o.GlslLibRoutine(n)}getCommonUtilFuncs(){const e={};let t="uvFromFlat";e[t]=new o.GlslLibRoutine("\n vec2 uvFromFlat(int texNumR, int texNumC, int index) {\n int texC = index / texNumR;\n int texR = index - texC * texNumR;\n // TODO: swap texR, texC order in following function so row is corresponding to u and column is corresponding to\n // v.\n return (vec2(texR, texC) + halfCR) / vec2(texNumR, texNumC);\n }\n "),t="packedUVfrom1D",e[t]=new o.GlslLibRoutine("\n vec2 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 "),t="packedUVfrom2D",e[t]=new o.GlslLibRoutine("\n vec2 packedUVfrom2D(int texNumR, int texNumC, int texelsInLogicalRow, 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 "),t="packedUVfrom3D",e[t]=new o.GlslLibRoutine("\n vec2 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 "),t="sampleTexture";const n=(0,a.getGlsl)(this.context.glContext.version);return e[t]=new o.GlslLibRoutine(`\n float sampleTexture(sampler2D textureSampler, vec2 uv) {\n return ${n.texture2D}(textureSampler, uv).r;\n }`),e}getInputsSamplingSnippets(){const e={},t=this.context.outputTextureLayout;return this.context.programInfo.inputNames.forEach((n,r)=>{const o=this.context.inputTextureLayouts[r],a=(0,s.generateShaderFuncNameFromInputSamplerName)(n);o.isPacked?e[a]=this.getPackedSamplerFromInput(a,n,o):e[a]=this.getUnpackedSamplerFromInput(a,n,o);const i=(0,s.generateShaderFuncNameFromInputSamplerNameAtOutCoords)(n);o.unpackedShape.length<=t.unpackedShape.length&&(o.isPacked?e[i]=this.getPackedSamplerAtOutputCoords(i,o,t,n):e[i]=this.getUnpackedSamplerAtOutputCoords(i,o,t,n))}),e}getPackedSamplerAtOutputCoords(e,t,n,a){const i=t.unpackedShape,l=n.unpackedShape,u=a,c=(0,s.generateShaderFuncNameFromInputSamplerName)(u),d=i.length,f=l.length,p=r.BroadcastUtil.getBroadcastDims(i,l),h=(0,s.getCoordsDataType)(f),m=f-d;let g;const b=(0,s.getGlChannels)();g=0===d?"":f<2&&p.length>=1?"coords = 0;":p.map(e=>`coords.${b[e+m]} = 0;`).join("\n");let y="";y=f<2&&d>0?"coords":i.map((e,t)=>`coords.${b[t+m]}`).join(", ");let _="return outputValue;";const v=1===r.ShapeUtil.size(i),w=1===r.ShapeUtil.size(l);if(1!==d||v||w){if(v&&!w)_=1===f?"\n return vec4(outputValue.x, outputValue.x, 0., 0.);\n ":"\n return vec4(outputValue.x);\n ";else if(p.length){const e=d-2,t=d-1;p.indexOf(e)>-1&&p.indexOf(t)>-1?_="return vec4(outputValue.x);":p.indexOf(e)>-1?_="return vec4(outputValue.x, outputValue.y, outputValue.x, outputValue.y);":p.indexOf(t)>-1&&(_="return vec4(outputValue.xx, outputValue.zz);")}}else _="\n return vec4(outputValue.xy, outputValue.xy);\n ";const S=`\n vec4 ${e}() {\n ${h} coords = getOutputCoords();\n \n int lastDim = coords.${b[f-1]};\n coords.${b[f-1]} = coords.${b[f-2]};\n coords.${b[f-2]} = lastDim;\n \n ${g}\n vec4 outputValue = ${c}(${y});\n ${_}\n }\n `;return new o.GlslLibRoutine(S,["coordinates.getOutputCoords"])}getUnpackedSamplerAtOutputCoords(e,t,n,a){const i=[n.width,n.height],l=[t.width,t.height],u=t.unpackedShape.length,c=n.unpackedShape.length,d=t.unpackedShape,f=n.unpackedShape,p=(0,s.generateShaderFuncNameFromInputSamplerName)(a);if(u===c&&r.ArrayUtil.arraysEqual(l,i)){const t=`\n float ${e}() {\n return sampleTexture(${a}, TexCoords);\n }\n `;return new o.GlslLibRoutine(t,["coordinates.sampleTexture"])}const h=(0,s.getCoordsDataType)(c),m=r.BroadcastUtil.getBroadcastDims(d,f),g=c-u;let b;const y=(0,s.getGlChannels)();b=0===u?"":c<2&&m.length>=1?"coords = 0;":m.map(e=>`coords.${y[e+g]} = 0;`).join("\n");let _="";_=c<2&&u>0?"coords":t.unpackedShape.map((e,t)=>`coords.${y[t+g]}`).join(", ");const v=`\n float ${e}() {\n ${h} coords = getOutputCoords();\n ${b}\n return ${p}(${_});\n }\n `;return new o.GlslLibRoutine(v,["coordinates.getOutputCoords"])}getPackedSamplerFromInput(e,t,n){switch(n.unpackedShape.length){case 0:return this.getPackedSamplerScalar(e,t);case 1:return this.getPackedSampler1D(e,t,n);case 2:return this.getPackedSampler2D(e,t,n);case 3:return this.getPackedSampler3D(e,t,n);default:return this.getPackedSamplerND(e,t,n)}}getUnpackedSamplerFromInput(e,t,n){const r=n.unpackedShape;switch(r.length){case 0:return this.getUnpackedSamplerScalar(e,t,n);case 1:return this.getUnpackedSampler1D(e,t,n);case 2:return this.getUnpackedSampler2D(e,t,n);case 3:return this.getUnpackedSampler3D(e,t,n);case 4:return this.getUnpackedSampler4D(e,t,n);case 5:return this.getUnpackedSampler5D(e,t,n);case 6:return this.getUnpackedSampler6D(e,t,n);default:throw new Error(`Unsupported dimension ${r.length}-D`)}}getPackedSamplerScalar(e,t){const n=`\n vec4 ${e}() {\n return ${(0,a.getGlsl)(this.context.glContext.version).texture2D}(${t}, halfCR);\n }\n `;return new o.GlslLibRoutine(n)}getPackedSampler1D(e,t,n){const r=[n.width,n.height],i=[r[1],r[0]],s=(0,a.getGlsl)(this.context.glContext.version),l=`vec4 ${e}(int index) {\n vec2 uv = packedUVfrom1D(\n ${i[0]}, ${i[1]}, index);\n return ${s.texture2D}(${t}, uv);\n }`;return new o.GlslLibRoutine(l,["coordinates.packedUVfrom1D"])}getPackedSampler2D(e,t,n){const i=n.unpackedShape,s=[n.width,n.height],l=(0,a.getGlsl)(this.context.glContext.version),u=s[0],c=s[1];if(null!=s&&r.ArrayUtil.arraysEqual(i,s)){const n=`vec4 ${e}(int row, int col) {\n vec2 uv = (vec2(col, row) + halfCR) / vec2(${c}.0, ${u}.0);\n return ${l.texture2D}(${t}, uv);\n }`;return new o.GlslLibRoutine(n)}const d=s,f=Math.ceil(i[1]/2),p=`vec4 ${e}(int row, int col) {\n vec2 uv = packedUVfrom2D(${d[1]}, ${d[0]}, ${f}, row, col);\n return ${l.texture2D}(${t}, uv);\n }`;return new o.GlslLibRoutine(p,["coordinates.packedUVfrom2D"])}getPackedSampler3D(e,t,n){const r=n.unpackedShape,i=[n.width,n.height],l=[i[0],i[1]],u=(0,a.getGlsl)(this.context.glContext.version);if(1===r[0]){const a=r.slice(1),i=[1,2],l=(0,s.squeezeInputShape)(r,a),u=["b","row","col"],c=JSON.parse(JSON.stringify(n));c.unpackedShape=l;const d=this.getPackedSamplerFromInput(e,t,c),f=`${d.routineBody}\n vec4 ${e}(int b, int row, int col) {\n return ${e}(${(0,s.getSqueezedParams)(u,i)});\n } `;return new o.GlslLibRoutine(f,d.dependencies)}const c=l[0],d=l[1],f=Math.ceil(r[2]/2),p=`vec4 ${e}(int b, int row, int col) {\n vec2 uv = packedUVfrom3D(\n ${d}, ${c}, ${f*Math.ceil(r[1]/2)}, ${f}, b, row, col);\n return ${u.texture2D}(${t}, uv);}`;return new o.GlslLibRoutine(p,["coordinates.packedUVfrom3D"])}getPackedSamplerND(e,t,n){const r=n.unpackedShape,i=r.length,s=[n.width,n.height],l=(0,a.getGlsl)(this.context.glContext.version),u=[s[0],s[1]],c=u[1],d=u[0],f=Math.ceil(r[i-1]/2);let p=f*Math.ceil(r[i-2]/2),h="int b, int row, int col",m=`b * ${p} + (row / 2) * ${f} + (col / 2)`;for(let o=2;o<i-1;o++)h=`int b${o}, `+h,p*=r[i-o-1],m=`b${o} * ${p} + `+m;const g=`vec4 ${e}(${h}) {\n int index = ${m};\n int texR = index / ${d};\n int texC = index - texR * ${d};\n vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${d}, ${c});\n return ${l.texture2D}(${t}, uv);\n }`;return new o.GlslLibRoutine(g)}getUnpackedSamplerScalar(e,t,n){const[r,a]=[n.width,n.height];if(1===r&&1===a){const n=`\n float ${e}() {\n return sampleTexture(${t}, halfCR);\n }\n `;return new o.GlslLibRoutine(n,["coordinates.sampleTexture"])}const i=`\n float ${e}() {\n int offset_${t} = coordsToOffset(TexCoords, ${r}, ${a});\n vec2 uv = uvFromFlat(${r}, ${a}, offset_${t});\n return sampleTexture(${t}, uv);\n }\n `;return new o.GlslLibRoutine(i,["coordinates.uvFromFlat","coordinates.sampleTexture","coordinates.coordsToOffset"])}getUnpackedSampler1D(e,t,n){const r=n.width,a=n.height;if(1===a&&1===r){const n=`\n float ${e}(int index) {\n return sampleTexture(${t}, halfCR);\n }\n `;return new o.GlslLibRoutine(n,["coordinates.sampleTexture"])}if(1===a){const n=`\n float ${e}(int index) {\n vec2 uv = vec2((float(index) + 0.5) / ${r}.0, 0.5);\n return sampleTexture(${t}, uv);\n }\n `;return new o.GlslLibRoutine(n,["coordinates.sampleTexture"])}if(1===r){const n=`\n float ${e}(int index) {\n vec2 uv = vec2(0.5, (float(index) + 0.5) / ${a}.0);\n return sampleTexture(${t}, uv);\n }\n `;return new o.GlslLibRoutine(n,["coordinates.sampleTexture"])}const i=`\n float ${e}(int index) {\n vec2 uv = uvFromFlat(${r}, ${a}, index);\n return sampleTexture(${t}, uv);\n }\n `;return new o.GlslLibRoutine(i,["coordinates.uvFromFlat","coordinates.sampleTexture"])}getUnpackedSampler2D(e,t,n){const a=n.unpackedShape,l=[n.height,n.width];if(null!=l&&r.ArrayUtil.arraysEqual(a,l)){const n=`\n float ${e}(int row, int col) {\n vec2 uv = (vec2(row, col) + halfCR) / vec2(${l[1]}.0, ${l[0]}.0);\n return sampleTexture(${t}, uv);\n }\n `;return new o.GlslLibRoutine(n,["coordinates.sampleTexture"])}const{newShape:u,keptDims:c}=(0,i.squeezeShape)(a),d=u;if(d.length<a.length){const r=(0,s.squeezeInputShape)(a,d),i=JSON.parse(JSON.stringify(n));i.unpackedShape=r;const l=["col","row"],u=`\n ${this.getUnpackedSamplerFromInput(e,t,i).routineBody}\n float ${e}(int row, int col) {\n return ${e}(${(0,s.getSqueezedParams)(l,c)});\n }\n `;return new o.GlslLibRoutine(u,["coordinates.sampleTexture"])}const f=l[1],p=l[0];if(1===p){const n=`\n float ${e}(int row, int col) {\n int offset_${t} = coordsToOffset(TexCoords, ${f}, ${p});\n float index = dot(vec3(row, col, offset_${t}), vec3(${a[1]}, 1, 1));\n vec2 uv = vec2(0.5, (index + 0.5) / ${f}.0);\n return sampleTexture(${t}, uv);\n }\n `;return new o.GlslLibRoutine(n,["coordinates.sampleTexture","coordinates.coordsToOffset"])}if(1===f){const n=`\n float ${e}(int row, int col) {\n int offset_${t} = coordsToOffset(TexCoords, ${f}, ${p});\n float index = dot(vec3(row, col, offset_${t}), vec3(${a[1]}, 1, 1));\n vec2 uv = vec2((index + 0.5) / ${p}.0, 0.5);\n return sampleTexture(${t}, uv);\n }\n `;return new o.GlslLibRoutine(n,["coordinates.sampleTexture","coordinates.coordsToOffset"])}const h=`\n float ${e}(int row, int col) {\n int index = col * ${a[1]} + row;\n vec2 uv = uvFromFlat(${f}, ${p}, index);\n return sampleTexture(${t}, uv);\n }\n `;return new o.GlslLibRoutine(h,["coordinates.uvFromFlat","coordinates.sampleTexture","coordinates.coordsToOffset"])}getUnpackedSampler3D(e,t,n){const r=n.unpackedShape,a=r[1]*r[2],l=r[2],{newShape:u,keptDims:c}=(0,i.squeezeShape)(r),d=u;if(d.length<r.length){const a=(0,s.squeezeInputShape)(r,d),i=["batch","col","row"],l=JSON.parse(JSON.stringify(n));l.unpackedShape=a;const u=this.getUnpackedSamplerFromInput(e,t,l),f=c.reverse(),p=`\n ${u.routineBody}\n float ${e}(int batch, int row, int col) {\n return ${e}(${(0,s.getSqueezedParams)(i,f)});\n }\n `;return new o.GlslLibRoutine(p,u.dependencies)}const f=`\n float ${e}(int depth, int row, int col) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = depth * ${a} + col * ${l} + row;\n vec2 uv = uvFromFlat(${n.width}, ${n.height}, index);\n return sampleTexture(${t}, uv);\n }\n `;return new o.GlslLibRoutine(f,["coordinates.uvFromFlat","coordinates.sampleTexture","coordinates.coordsToOffset"])}getUnpackedSampler4D(e,t,n){const r=n.unpackedShape,a=r[3],i=r[2]*a,s=`\n float ${e}(int row, int col, int depth, int depth2) {\n int index = row * ${r[1]*i} + col * ${i} +\n depth2 * ${a} + depth;\n vec2 uv = uvFromFlat(${n.width}, ${n.height}, index);\n return sampleTexture(${t}, uv);\n }\n `;return new o.GlslLibRoutine(s,["coordinates.uvFromFlat","coordinates.sampleTexture"])}getUnpackedSampler5D(e,t,n){const r=n.unpackedShape,a=r[4],l=r[3]*a,u=r[2]*l,c=r[1]*u,{newShape:d,keptDims:f}=(0,i.squeezeShape)(r);if(d.length<r.length){const a=(0,s.squeezeInputShape)(r,d),i=["row","col","depth","depth2","depth3"],l=JSON.parse(JSON.stringify(n));l.unpackedShape=a;const u=`\n ${this.getUnpackedSamplerFromInput(e,t,l).routineBody}\n float ${e}(int row, int col, int depth, int depth2, int depth3) {\n return ${e}(${(0,s.getSqueezedParams)(i,f)});\n }\n `;return new o.GlslLibRoutine(u,["coordinates.sampleTexture","coordinates.uvFromFlat"])}const p=`\n float ${e}(int row, int col, int depth, int depth2, int depth3) {\n int index = row * ${c} + col * ${u} + depth * ${l} +\n depth3 * ${a} + depth2;\n vec2 uv = uvFromFlat(${n.width}, ${n.height}, index);\n return sampleTexture(${t}, uv);\n }\n `;return new o.GlslLibRoutine(p,["coordinates.sampleTexture","coordinates.uvFromFlat"])}getUnpackedSampler6D(e,t,n){const r=n.unpackedShape,a=r[5],l=r[4]*a,u=r[3]*l,c=r[2]*u,d=r[1]*c,{newShape:f,keptDims:p}=(0,i.squeezeShape)(r);if(f.length<r.length){const a=(0,s.squeezeInputShape)(r,f),i=["row","col","depth","depth2","depth3","depth4"],l=JSON.parse(JSON.stringify(n));l.unpackedShape=a;const u=`\n ${this.getUnpackedSamplerFromInput(e,t,l).routineBody}\n float ${e}(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n return ${e}(${(0,s.getSqueezedParams)(i,p)});\n }\n `;return new o.GlslLibRoutine(u,["coordinates.sampleTexture","coordinates.uvFromFlat"])}const h=`\n float ${e}(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n int index = row * ${d} + col * ${c} + depth * ${u} +\n depth2 * ${l} + depth3 * ${a} + depth4;\n vec2 uv = uvFromFlat(${n.width}, ${n.height}, index);\n return sampleTexture(${t}, uv);\n }\n `;return new o.GlslLibRoutine(h,["coordinates.uvFromFlat","coordinates.sampleTexture","coordinates.coordsToOffset"])}toVec(){const e=this.context.outputTextureLayout,t=e.shape.length,n=e.strides,r=e.width,a=e.height,i=[];for(let o=0;o<t-1;++o)i.push(`\n c[${o}] = offset / ${n[o]};`),i.push(`\n offset -= c[${o}] * ${n[o]};`);i.push(`\n c[${t-1}] = offset;`);const s=`\n void toVec(vec2 texCoords, out int c[${t}]) {\n int offset = coordsToOffset(texCoords, ${r}, ${a});\n ${i.join("")}\n }\n void toVec(int offset, out int c[${t}]) {\n ${i.join("")}\n }\n `;return{toVec:new o.GlslLibRoutine(s,["coordinates.coordsToOffset"])}}valueFrom(){const e={};return this.context.programInfo.inputNames.forEach((t,n)=>{const r=this.context.inputTextureLayouts[n],a=(r.unpackedShape.length>0?r.unpackedShape:r.shape).length;let i=`_${t}`;e[i]=new o.GlslLibRoutine(this.getValueFromSingle(t,a,r.width,r.height,!1),[`shapeUtils.indicesToOffset${i}`,"coordinates.offsetToCoords","fragcolor.getColorAsFloat"]),i+="_T",e[i]=new o.GlslLibRoutine(this.getValueFromSingle(t,a,r.width,r.height,!0),[`shapeUtils.indicesToOffset${i}`,"coordinates.offsetToCoords","fragcolor.getColorAsFloat"])}),e}getValueFromSingle(e,t,n,r,o){let i=`_${e}`;return o&&(i+="_T"),`\n float ${i}(int m[${t}]) {\n int offset = indicesToOffset${i}(m);\n vec2 coords = offsetToCoords(offset, ${n}, ${r});\n float value = getColorAsFloat(${(0,a.getGlsl)(this.context.glContext.version).texture2D}(${e}, coords));\n return value;\n }\n `}getPackedValueFrom(e,t,n,r,o){let i=`_${e}_Pack`;return o&&(i+="_T"),`\n vec4 ${i}(int m[${t}]) {\n int offset = indicesToOffset_${e}(m);\n vec2 coords = offsetToCoords(offset, ${n}, ${r});\n return ${(0,a.getGlsl)(this.context.glContext.version).texture2D}(${e}, coords);\n }\n `}}t.CoordsGlslLib=l},8520:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.TopologicalSortGlslRoutines=t.GlslLibRoutineNode=t.GlslLibRoutine=t.GlslLib=t.GlslContext=t.FunctionType=void 0,(n=t.FunctionType||(t.FunctionType={}))[n.ValueBased=0]="ValueBased",n[n.Positional=1]="Positional",t.GlslContext=class{constructor(e,t,n,r){this.glContext=e,this.programInfo=t,this.inputTextureLayouts=n,this.outputTextureLayout=r}},t.GlslLib=class{constructor(e){this.context=e}},t.GlslLibRoutine=class{constructor(e,t){this.routineBody=e,this.dependencies=t}},t.GlslLibRoutineNode=class{constructor(e,t,n){this.name=e,this.dependencies=n||[],t&&(this.routineBody=t)}addDependency(e){e&&this.dependencies.push(e)}},t.TopologicalSortGlslRoutines=class{static returnOrderedNodes(e){if(!e||0===e.length)return[];if(1===e.length)return e;const t=new Set,n=new Set,r=new Array;return this.createOrderedNodes(e,t,n,r),r}static createOrderedNodes(e,t,n,r){for(let o=0;o<e.length;++o)this.dfsTraverse(e[o],t,n,r)}static dfsTraverse(e,t,n,r){if(!e||n.has(e.name))return;if(t.has(e.name))throw new Error("Cyclic dependency detected. Can't topologically sort routines needed for shader.");t.add(e.name);const o=e.dependencies;if(o&&o.length>0)for(let a=0;a<o.length;++a)this.dfsTraverse(o[a],t,n,r);r.push(e),n.add(e.name),t.delete(e.name)}}},7341:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EncodingGlslLib=void 0;const r=n(8520);class o extends r.GlslLib{constructor(e){super(e)}getFunctions(){return Object.assign(Object.assign({},this.encodeFloat32()),this.decodeFloat32())}getCustomTypes(){return{}}encodeFloat32(){return{encode:new r.GlslLibRoutine("highp vec4 encode(highp float f) {\n return vec4(f, 0.0, 0.0, 0.0);\n }\n ")}}decodeFloat32(){return{decode:new r.GlslLibRoutine("highp float decode(highp vec4 rgba) {\n return rgba.r;\n }\n ")}}encodeUint8(){const e=o.isLittleEndian()?"rgba.rgba=rgba.abgr;":"";return{encode:new r.GlslLibRoutine(`\n highp vec4 encode(highp float f) {\n highp float F = abs(f);\n highp float Sign = step(0.0,-f);\n highp float Exponent = floor(log2(F));\n highp float Mantissa = (exp2(- Exponent) * F);\n Exponent = floor(log2(F) + 127.0) + floor(log2(Mantissa));\n highp vec4 rgba;\n rgba[0] = 128.0 * Sign + floor(Exponent*exp2(-1.0));\n rgba[1] = 128.0 * mod(Exponent,2.0) + mod(floor(Mantissa*128.0),128.0);\n rgba[2] = floor(mod(floor(Mantissa*exp2(23.0 -8.0)),exp2(8.0)));\n rgba[3] = floor(exp2(23.0)*mod(Mantissa,exp2(-15.0)));\n ${e}\n rgba = rgba / 255.0; // values need to be normalized to [0,1]\n return rgba;\n }\n `)}}decodeUint8(){const e=o.isLittleEndian()?"rgba.rgba=rgba.abgr;":"";return{decode:new r.GlslLibRoutine(`\n highp float decode(highp vec4 rgba) {\n rgba = rgba * 255.0; // values need to be de-normalized from [0,1] to [0,255]\n ${e}\n highp float Sign = 1.0 - step(128.0,rgba[0])*2.0;\n highp float Exponent = 2.0 * mod(rgba[0],128.0) + step(128.0,rgba[1]) - 127.0;\n highp float Mantissa = mod(rgba[1],128.0)*65536.0 + rgba[2]*256.0 +rgba[3] + float(0x800000);\n highp float Result = Sign * exp2(Exponent) * (Mantissa * exp2(-23.0 ));\n return Result;\n }\n `)}}static isLittleEndian(){const e=new ArrayBuffer(4),t=new Uint32Array(e),n=new Uint8Array(e);if(t[0]=3735928559,239===n[0])return!0;if(222===n[0])return!1;throw new Error("unknown endianness")}}t.EncodingGlslLib=o},9894:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FragColorGlslLib=void 0;const r=n(8520),o=n(5060);class a extends r.GlslLib{constructor(e){super(e)}getFunctions(){return Object.assign(Object.assign({},this.setFragColor()),this.getColorAsFloat())}getCustomTypes(){return{}}setFragColor(){const e=(0,o.getGlsl)(this.context.glContext.version);return{setFragColor:new r.GlslLibRoutine(`\n void setFragColor(float value) {\n ${e.output} = encode(value);\n }\n `,["encoding.encode"])}}getColorAsFloat(){return{getColorAsFloat:new r.GlslLibRoutine("\n float getColorAsFloat(vec4 color) {\n return decode(color);\n }\n ",["encoding.decode"])}}}t.FragColorGlslLib=a},2848:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.replaceInlines=void 0;const n=/@inline[\s\n\r]+(\w+)[\s\n\r]+([0-9a-zA-Z_]+)\s*\(([^)]*)\)\s*{(([^}]|[\n\r])*)}/gm;t.replaceInlines=function(e){const t={};let r;for(;null!==(r=n.exec(e));){const e=r[3].split(",").map(e=>{const t=e.trim().split(" ");return t&&2===t.length?{type:t[0],name:t[1]}:null}).filter(e=>null!==e);t[r[2]]={params:e,body:r[4]}}for(const n in t){const o="(\\w+)?\\s+([_0-9a-zA-Z]+)\\s+=\\s+__FUNC__\\((.*)\\)\\s*;".replace("__FUNC__",n),a=new RegExp(o,"gm");for(;null!==(r=a.exec(e));){const o=r[1],a=r[2],i=r[3].split(","),s=o?`${o} ${a};`:"";let l=t[n].body,u="";t[n].params.forEach((e,t)=>{e&&(u+=`${e.type} ${e.name} = ${i[t]};\n`)}),l=`${u}\n ${l}`,l=l.replace("return",`${a} = `);const c=`\n ${s}\n {\n ${l}\n }\n `;e=e.replace(r[0],c)}}return e.replace(n,"")}},8879:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.GlslPreprocessor=void 0;const r=n(8520),o=n(2848),a=n(5483),i=n(5060);t.GlslPreprocessor=class{constructor(e,t,n,o){this.libs={},this.glslLibRoutineDependencyGraph={},this.context=new r.GlslContext(e,t,n,o),Object.keys(a.glslRegistry).forEach(e=>{const t=new a.glslRegistry[e](this.context);this.libs[e]=t});const i=this.glslLibRoutineDependencyGraph;for(const a in this.libs){const e=this.libs[a].getFunctions();for(const t in e){const n=a+"."+t;let o;i[n]?(o=i[n],o.routineBody=e[t].routineBody):(o=new r.GlslLibRoutineNode(n,e[t].routineBody),i[n]=o);const s=e[t].dependencies;if(s)for(let e=0;e<s.length;++e)if(i[s[e]])o.addDependency(i[s[e]]);else{const t=new r.GlslLibRoutineNode(s[e]);i[s[e]]=t,o.addDependency(t)}}}}preprocess(){const e=this.context.programInfo;let t=e.shaderSource;return this.context.programInfo.hasMain||(t=`${t}\n ${(0,i.getDefaultFragShaderMain)(this.context.glContext.version,this.context.outputTextureLayout.shape.length)}`),t=(0,o.replaceInlines)(t),`${(0,i.getFragShaderPreamble)(this.context.glContext.version)}\n ${this.getUniforms(e.inputNames,e.variables)}\n ${this.getImports(t)}\n ${t}`}getImports(e){const t=this.selectGlslLibRoutinesToBeIncluded(e);if(0===t.length)return"";let n="";for(let r=0;r<t.length;++r){if(!t[r].routineBody)throw new Error(`Missing body for the Glsl Library routine: ${t[r].name}`);n+=t[r].routineBody+"\n"}return n}selectGlslLibRoutinesToBeIncluded(e){const t=[];return Object.keys(this.glslLibRoutineDependencyGraph).forEach(n=>{const r=n.split(".")[1];-1!==e.indexOf(r)&&t.push(this.glslLibRoutineDependencyGraph[n])}),r.TopologicalSortGlslRoutines.returnOrderedNodes(t)}getUniforms(e,t){const n=[];if(e)for(const r of e)n.push(`uniform sampler2D ${r};`);if(t)for(const r of t)n.push(`uniform ${r.type} ${r.name}${r.arrayLength?`[${r.arrayLength}]`:""};`);return n.join("\n")}}},5483:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.glslRegistry=void 0;const r=n(5107),o=n(7341),a=n(9894),i=n(2655),s=n(3891);t.glslRegistry={encoding:o.EncodingGlslLib,fragcolor:a.FragColorGlslLib,vec:s.VecGlslLib,shapeUtils:i.ShapeUtilsGlslLib,coordinates:r.CoordsGlslLib}},2655:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ShapeUtilsGlslLib=void 0;const r=n(8520);class o extends r.GlslLib{constructor(e){super(e)}getFunctions(){return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},this.bcastIndex()),this.bcastMatmulIndex()),this.offsetToIndices()),this.indicesToOffset()),this.incrementIndices())}getCustomTypes(){return{}}bcastIndex(){const e=this.context.outputTextureLayout.shape.length,t={};return this.context.programInfo.inputNames.forEach((n,o)=>{const a=this.context.inputTextureLayouts[o].unpackedShape;if(a.length<=e){const o=a.length,i=e-o,s=`bcastIndices_${n}`;let l="";for(let e=0;e<o;++e)l+=`\n realIndices[${e}] = int( mod(float(bcastedIndices[${i+e}]), ${a[e]}.0) );\n `;const u=`\n void ${s} (int bcastedIndices[${e}], out int realIndices[${o}]) {\n ${l}\n }\n `;t[s]=new r.GlslLibRoutine(u)}}),t}bcastMatmulIndex(){const e=this.context.outputTextureLayout.shape.length,t={};return this.context.programInfo.inputNames.forEach((n,o)=>{const a=this.context.inputTextureLayouts[o].shape;if(!(a.length<2||a.length>e)){const o=a.length,i=e-o,s=`bcastMatmulIndices_${n}`;let l="";for(let e=0;e<o-2;++e)l+=`\n realIndices[${e}] = int( mod(float(bcastedIndices[${i+e}]), ${a[e]}.0) );\n `;const u=`\n void ${s}(int bcastedIndices[${e}], out int realIndices[${o}]) {\n ${l}\n realIndices[${o-1}] = bcastedIndices[${e-1}];\n realIndices[${o-2}] = bcastedIndices[${e-2}];\n }\n `;t[s]=new r.GlslLibRoutine(u)}}),t}indicesToOffset(){const e={};return this.context.programInfo.inputNames.forEach((t,n)=>{const a=this.context.inputTextureLayouts[n].shape,i=this.context.inputTextureLayouts[n].strides,s=a.length;let l=`indicesToOffset_${t}`;e[l]=new r.GlslLibRoutine(o.indexToOffsetSingle(l,s,i)),l=`indicesToOffset_${t}_T`,e[l]=new r.GlslLibRoutine(o.indexToOffsetSingle(l,s,i.slice().reverse()))}),e}static indexToOffsetSingle(e,t,n){let r="";for(let o=t-1;o>=0;--o)r+=`\n offset += indices[${o}] * ${n[o]};\n `;return`\n int ${e}(int indices[${t}]) {\n int offset = 0;\n ${r}\n return offset;\n }\n `}offsetToIndices(){const e={};return this.context.programInfo.inputNames.forEach((t,n)=>{const a=this.context.inputTextureLayouts[n].shape,i=this.context.inputTextureLayouts[n].strides,s=a.length;let l=`offsetToIndices_${t}`;e[l]=new r.GlslLibRoutine(o.offsetToIndicesSingle(l,s,i)),l=`offsetToIndices_${t}_T`,e[l]=new r.GlslLibRoutine(o.offsetToIndicesSingle(l,s,i.slice().reverse()))}),e}static offsetToIndicesSingle(e,t,n){const r=[];for(let o=0;o<t-1;++o)r.push(`\n indices[${o}] = offset / ${n[o]};`),r.push(`\n offset -= indices[${o}] * ${n[o]};`);return r.push(`\n indices[${t-1}] = offset;`),`\n void ${e}(int offset, out int indices[${t}]) {\n ${r.join("")}\n }\n `}incrementIndices(){const e={};return this.context.programInfo.inputNames.forEach((t,n)=>{const o=this.context.inputTextureLayouts[n].shape,a=o.length,i=`incrementIndices_${t}`;let s="";for(let e=0;e<a;++e)s+=`\n shape[${e}] = ${o[e]};`;const l=`\n void ${i}(int axis, out int indices[${a}]) {\n int shape[${a}];\n ${s};\n for(int i = ${a} -1 ; i >= 0; --i) {\n if(i > axis) continue;\n indices[i] += 1;\n if(indices[i] < shape[i]) {\n break;\n }\n indices[i] = 0;\n }\n }\n `;e[i]=new r.GlslLibRoutine(l)}),e}}t.ShapeUtilsGlslLib=o},5060:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getDefaultFragShaderMain=t.getFragShaderPreamble=t.getVertexShaderSource=t.getGlsl=void 0;const n={version:"",attribute:"attribute",varyingVertex:"varying",varyingFrag:"varying",texture2D:"texture2D",output:"gl_FragColor",outputDeclaration:""},r={version:"#version 300 es",attribute:"in",varyingVertex:"out",varyingFrag:"in",texture2D:"texture",output:"outputColor",outputDeclaration:"out vec4 outputColor;"};function o(e){return 1===e?n:r}t.getGlsl=o,t.getVertexShaderSource=function(e){const t=o(e);return`${t.version}\n precision highp float;\n ${t.attribute} vec3 position;\n ${t.attribute} vec2 textureCoord;\n\n ${t.varyingVertex} vec2 TexCoords;\n\n void main()\n {\n gl_Position = vec4(position, 1.0);\n TexCoords = textureCoord;\n }`},t.getFragShaderPreamble=function(e){const t=o(e);return`${t.version}\n precision highp float;\n precision highp int;\n precision highp sampler2D;\n ${t.varyingFrag} vec2 TexCoords;\n ${t.outputDeclaration}\n const vec2 halfCR = vec2(0.5, 0.5);\n\n // Custom vector types to handle higher dimenalities.\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 int imod(int x, int y) {\n return x - y * (x / y);\n }\n\n `},t.getDefaultFragShaderMain=function(e,t){return`\n void main() {\n int indices[${t}];\n toVec(TexCoords, indices);\n vec4 result = vec4(process(indices));\n ${o(e).output} = result;\n }\n `}},3891:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VecGlslLib=void 0;const r=n(8520);class o extends r.GlslLib{constructor(e){super(e)}getCustomTypes(){return{}}getFunctions(){return Object.assign(Object.assign(Object.assign(Object.assign({},this.binaryVecFunctions()),this.copyVec()),this.setVecItem()),this.getVecItem())}binaryVecFunctions(){const e=this.context.outputTextureLayout.shape.length,t={add:"+=",sub:"-=",mul:"*=",div:"/="},n={};for(const o in t){const a=`${o}Vec`;let i="";for(let n=0;n<e;++n)i+=`\n dest[${n}] ${t[o]} src[${n}];\n `;const s=`\n void ${a}(int src[${e}], out int dest[${e}]) {\n ${i}\n }\n `;n[a]=new r.GlslLibRoutine(s)}return n}copyVec(){const e=this.context.outputTextureLayout.shape.length;let t="";for(let r=0;r<e;++r)t+=`\n dest[${r}] = src[${r}];\n `;const n=`\n void copyVec(int src[${e}], out int dest[${e}]) {\n ${t}\n }\n `;return{copyVec:new r.GlslLibRoutine(n)}}setVecItem(){const e=this.context.outputTextureLayout.shape.length;let t=`\n if(index < 0)\n index =${e} + index;\n if (index == 0)\n m[0] = value;\n `;for(let r=1;r<e-1;++r)t+=`\n else if (index == ${r})\n m[${r}] = value;\n `;t+=`\n else\n m[${e-1}] = value;\n `;const n=`\n void setVecItem(out int m[${e}], int index, int value) {\n ${t}\n }\n `;return{setVecItem:new r.GlslLibRoutine(n)}}getVecItem(){const e=this.context.outputTextureLayout.shape.length;let t=`\n if(index < 0)\n index = ${e} + index;\n if (index == 0)\n return m[0];\n `;for(let r=1;r<e-1;++r)t+=`\n else if (index == ${r})\n return m[${r}];\n `;t+=`\n else\n return m[${e-1}];\n `;const n=`\n int getVecItem(int m[${e}], int index) {\n ${t}\n }\n `;return{getVecItem:new r.GlslLibRoutine(n)}}}t.VecGlslLib=o},8316:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WebGLInferenceHandler=void 0;const r=n(6231),o=n(9162),a=n(2517),i=n(2403),s=n(7019),l=n(8710),u=n(5611),c=n(4057),d=n(2039);t.WebGLInferenceHandler=class{constructor(e){this.session=e,this.packedTextureDataCache=new Map,this.unpackedTextureDataCache=new Map}calculateTextureWidthAndHeight(e,t){return(0,c.calculateTextureWidthAndHeight)(this.session.layoutStrategy,e,t)}executeProgram(e,t){if(t.length<e.inputNames.length)throw new Error(`Input size mustn't be less than ${e.inputNames.length}.`);if(e.inputNames.length!==e.inputTypes.length)throw new Error("input names size does not match input types");const n=[];for(let l=0;l<e.inputNames.length;++l)n[l]=this.getOrCreateTextureData(t[l],e.inputTypes[l]);const r=((e,t)=>{const n=t.map(e=>`${e.unpackedShape.join(",")};${e.width}x${e.height}`).join("_");let r=e.name;return e.cacheHint&&(r+="["+e.cacheHint+"]"),r+=":"+n,r})(e,n);let o=this.session.programManager.getArtifact(r);const a=o?o.programInfo:"function"==typeof e.get?e.get():e,i=(0,c.createTextureLayoutFromTextureType)(this.session.layoutStrategy,a.output.dims,a.output.textureType),s=this.createTextureData(i,a.output.type);return o||(o=this.session.programManager.build(a,n,s),this.session.programManager.setArtifact(r,o)),this.runProgram(o,n,s),s}run(e,t){return this.executeProgram(e,t).tensor}runProgram(e,t,n){for(let r=0;r<t.length;++r)if(!!t[r].isPacked!=(e.programInfo.inputTypes[r]===d.TextureType.packed))throw new Error(`input[${r}] property packed inconsistent`);if(!!n.isPacked!=(e.programInfo.output.textureType===d.TextureType.packed))throw new Error("output property packed inconsistent");this.session.programManager.run(e,t,n)}getOrCreateTextureData(e,t){let n=this.getTextureData(e.dataId,t===d.TextureType.packed);if(!n&&(n=this.getTextureData(e.dataId,t!==d.TextureType.packed),n))return t===d.TextureType.packed?this.pack(n):this.unpack(n);if(!n){const r=(0,c.createTextureLayoutFromTextureType)(this.session.layoutStrategy,e.dims,t);if(t===d.TextureType.packedLastDimension){const n=1,r=4,o=e.dims;if(4===o.length){const a=[o[0],Math.ceil(o[1]*o[2]*o[3]/r)],i=(0,c.createTextureLayoutFromTextureType)(this.session.layoutStrategy,a,t);let s=e.numberData;if(o[1]*o[2]*o[3]%r!=0){const t=o[0],a=o[1]*o[2]*o[3],i=Math.ceil(a*n/r)*r;s=new Float32Array(t*i);for(let r=0;r<t;++r){const t=r*a,o=r*i+r%n*a;s.set(e.numberData.subarray(t,t+a),o)}}return this.createTextureData(i,e.type,s,e,1)}}if(t===d.TextureType.packed){const t=(0,c.createTextureLayoutFromShape)(this.session.layoutStrategy,e.dims,1,[],{reverseWH:!0}),r=this.createTextureData(t,e.type,e.numberData,e,1);n=this.pack(r)}else n=this.createTextureData(r,e.type,e.numberData,e,1)}return n}createTextureDataFromLayoutBindTensor(e,t,n,r){return this.createTextureData(e,t,n,r,1)}createTextureData(e,t,n,o,a){r.Logger.verbose("InferenceHandler",`Creating TextureData: layout:[${JSON.stringify(e)}]`);const i=this.session.textureManager.createTextureFromLayout(t,e,n,a);return this.createTextureDataFromTexture(e,t,i,o)}reshapeUnpacked(e,t){const n=this.getOrCreateTextureData(e,d.TextureType.unpacked),r={channels:n.channels,height:n.height,width:n.width,shape:0!==t.length?t:[1],strides:a.ShapeUtil.computeStrides(t),unpackedShape:t};return this.createTextureDataFromTexture(r,e.type,n.texture).tensor}reshapePacked(e,t){const n=this.getOrCreateTextureData(e,d.TextureType.packed);if((0,s.isReshapeCheap)(e.dims,t)){const r={channels:n.channels,height:n.height,width:n.width,shape:0!==t.length?t:[1],strides:a.ShapeUtil.computeStrides(t),unpackedShape:t,isPacked:!0};return this.createTextureDataFromTexture(r,e.type,n.texture).tensor}const r=(0,s.processDims3D)(e.dims),o=(0,s.processDims3D)(t),i=this.reshapePacked(e,r),l=this.run((0,s.createPackedReshape3DProgramInfoLoader)(this,i,o),[i]);return this.reshapePacked(l,t)}cast(e,t){const n=this.getOrCreateTextureData(e,d.TextureType.unpacked);return this.createTextureDataFromTexture(n,t,n.texture).tensor}createTextureDataFromTexture(e,t,n,r,a){const i=Object.assign(Object.assign({},e),{tensor:r||new o.Tensor(e.unpackedShape,t,e=>this.readTexture(i),async e=>this.readTextureAsync(i),void 0,a),texture:n});return this.setTextureData(i.tensor.dataId,i,e.isPacked),i}getTextureData(e,t=!1){return this.session.isInitializer(e)?this.session.getTextureData(e,t):t?this.packedTextureDataCache.get(e):this.unpackedTextureDataCache.get(e)}setTextureData(e,t,n=!1){this.session.isInitializer(e)?this.session.setTextureData(e,t,n):(n?this.packedTextureDataCache:this.unpackedTextureDataCache).set(e,t)}isTextureLayoutCached(e,t=!1){return!!this.getTextureData(e.dataId,t)}dispose(){this.session.textureManager.clearActiveTextures(),this.packedTextureDataCache.forEach(e=>this.session.textureManager.releaseTexture(e)),this.packedTextureDataCache=new Map,this.unpackedTextureDataCache.forEach(e=>this.session.textureManager.releaseTexture(e)),this.unpackedTextureDataCache=new Map}readTexture(e){return e.isPacked?this.readTexture(this.unpack(e)):this.session.backend.glContext.isFloat32DownloadSupported?this.session.textureManager.readTexture(e,e.tensor.type,e.channels):this.session.textureManager.readUint8TextureAsFloat((0,l.encodeAsUint8)(this,e))}async readTextureAsync(e){return e.isPacked?this.readTextureAsync(this.unpack(e)):this.session.backend.glContext.isFloat32DownloadSupported?this.session.textureManager.readTextureAsync(e,e.tensor.type,e.channels):this.session.textureManager.readUint8TextureAsFloat((0,l.encodeAsUint8)(this,e))}pack(e){return this.executeProgram((0,i.createPackProgramInfoLoader)(this,e.tensor),[e.tensor])}unpack(e){return this.executeProgram((0,u.createUnpackProgramInfoLoader)(this,e.tensor),[e.tensor])}}},1640:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.WEBGL_OP_RESOLVE_RULES=void 0;const i=n(2898),s=a(n(7839)),l=n(4196),u=n(2069),c=n(8138),d=n(9663),f=n(5193),p=n(7992),h=n(1253),m=n(4776),g=n(6572),b=n(3346),y=n(5623),_=n(2870),v=n(2143),w=n(4939),S=n(718),x=n(2268),T=n(8117),E=n(2278),k=n(5524),P=n(5975),O=n(3933),A=n(6558),$=n(5723),R=n(3738),I=a(n(4909)),C=n(8428),D=n(9793);t.WEBGL_OP_RESOLVE_RULES=[["Abs","","6+",I.abs],["Acos","","7+",I.acos],["Add","","7+",s.add],["And","","7+",s.and],["Asin","","7+",I.asin],["Atan","","7+",I.atan],["AveragePool","","7+",v.averagePool,v.parseAveragePoolAttributes],["BatchNormalization","","7+",i.batchNormalization,i.parseBatchNormalizationAttributes],["Cast","","6+",l.cast,l.parseCastAttributes],["Ceil","","6+",I.ceil],["Clip","","6-10",I.clip,I.parseClipAttributes],["Clip","","11+",I.clipV11],["Concat","","4+",u.concat,u.parseConcatAttributes],["Conv","","1+",c.conv,c.parseConvAttributes],["ConvTranspose","","1+",d.convTranspose,d.parseConvTransposeAttributes],["Cos","","7+",I.cos],["Div","","7+",s.div],["Dropout","","7+",I.identity],["DepthToSpace","","1+",f.depthToSpace,f.parseDepthToSpaceAttributes],["Equal","","7+",s.equal],["Elu","","6+",I.elu,I.parseEluAttributes],["Exp","","6+",I.exp],["Flatten","","1+",p.flatten,p.parseFlattenAttributes],["Floor","","6+",I.floor],["FusedConv","com.microsoft","1+",c.conv,c.parseConvAttributes],["Gather","","1+",h.gather,h.parseGatherAttributes],["Gemm","","7-10",m.gemm,m.parseGemmAttributesV7],["Gemm","","11+",m.gemm,m.parseGemmAttributesV11],["GlobalAveragePool","","1+",v.globalAveragePool,v.parseGlobalAveragePoolAttributes],["GlobalMaxPool","","1+",v.globalMaxPool],["Greater","","7+",s.greater],["Identity","","1+",I.identity],["ImageScaler","","1+",g.imageScaler,g.parseImageScalerAttributes],["InstanceNormalization","","6+",b.instanceNormalization,b.parseInstanceNormalizationAttributes],["LeakyRelu","","6+",I.leakyRelu,I.parseLeakyReluAttributes],["Less","","7+",s.less],["Log","","6+",I.log],["MatMul","","1+",y.matMul,y.parseMatMulAttributes],["MaxPool","","1+",v.maxPool,v.parseMaxPoolAttributes],["Mul","","7+",s.mul],["Neg","","6+",I.neg],["Not","","1+",I.not],["Or","","7+",s.or],["Pad","","2-10",_.padV2,_.parsePadAttributesV2],["Pad","","11+",_.padV11,_.parsePadAttributesV11],["Pow","","7+",s.pow],["PRelu","","7+",s.pRelu],["ReduceLogSum","","1+",w.reduceLogSum,w.parseReduceAttributes],["ReduceMax","","1+",w.reduceMax,w.parseReduceAttributes],["ReduceMean","","1+",w.reduceMean,w.parseReduceAttributes],["ReduceMin","","1+",w.reduceMin,w.parseReduceAttributes],["ReduceProd","","1+",w.reduceProd,w.parseReduceAttributes],["ReduceSum","","1-12",w.reduceSum,w.parseReduceAttributes],["ReduceSumSquare","","1+",w.reduceLogSumSquare,w.parseReduceAttributes],["Relu","","6+",I.relu],["Reshape","","5+",S.reshape],["Resize","","10",x.resize,x.parseResizeAttributesV10],["Resize","","11+",x.resize,x.parseResizeAttributesV11],["Shape","","1+",T.shape],["Sigmoid","","6+",I.sigmoid],["Sin","","7+",I.sin],["Slice","","10+",E.sliceV10],["Slice","","1-9",E.slice,E.parseSliceAttributes],["Softmax","","1-12",k.softmax,k.parseSoftmaxAttributes],["Softmax","","13+",k.softmaxV13,k.parseSoftmaxAttributesV13],["Split","","2-12",P.split,P.parseSplitAttributes],["Sqrt","","6+",I.sqrt],["Squeeze","","1-12",O.squeeze,O.parseSqueezeAttributes],["Squeeze","","13+",O.squeezeV13],["Sub","","7+",s.sub],["Sum","","6+",A.sum],["Tan","","7+",I.tan],["Tanh","","6+",I.tanh],["Tile","","6+",$.tile],["Transpose","","1+",R.transpose,R.parseTransposeAttributes],["Upsample","","7-8",D.upsample,D.parseUpsampleAttributesV7],["Upsample","","9",D.upsample,D.parseUpsampleAttributesV9],["Unsqueeze","","1-12",C.unsqueeze,C.parseUnsqueezeAttributes],["Unsqueeze","","13+",C.unsqueezeV13],["Xor","","7+",s.xor]]},2898:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseBatchNormalizationAttributes=t.batchNormalization=void 0;const r=n(246),o=n(5060),a=n(2039),i={name:"BatchNormalization",inputNames:["A","Scale","B","Mean","Variance"],inputTypes:[a.TextureType.unpacked,a.TextureType.unpacked,a.TextureType.unpacked,a.TextureType.unpacked,a.TextureType.unpacked]};t.batchNormalization=(e,t,n)=>(l(t),[e.run(Object.assign(Object.assign({},i),{cacheHint:n.cacheKey,get:()=>s(e,t,n)}),t)]),t.parseBatchNormalizationAttributes=e=>{const t=e.attributes.getFloat("epsilon",1e-5),n=e.attributes.getFloat("momentum",.9),o=e.attributes.getInt("spatial",1);return(0,r.createAttributeWithCacheKey)({epsilon:t,momentum:n,spatial:o})};const s=(e,t,n)=>{const r=(0,o.getGlsl)(e.session.backend.glContext.version),s=t[0].dims.length,[l,u]=e.calculateTextureWidthAndHeight(t[1].dims,a.TextureType.unpacked),c=`\n float process(int[${s}] indices) {\n vec2 position = offsetToCoords(indices[1], ${l}, ${u});\n float scale = getColorAsFloat(${r.texture2D}(Scale, position));\n float mean = getColorAsFloat(${r.texture2D}(Mean, position));\n float variance = getColorAsFloat(${r.texture2D}(Variance, position));\n float b = getColorAsFloat(${r.texture2D}(B, position));\n\n return scale * ( (_A(indices) - mean) / sqrt(variance + float(${n.epsilon})) ) + b;\n }`;return Object.assign(Object.assign({},i),{output:{dims:t[0].dims,type:t[0].type,textureType:a.TextureType.unpacked},shaderSource:c})},l=e=>{if(!e||5!==e.length)throw new Error("BatchNormalization requires 5 inputs.");const t=e[0],n=e[1],r=e[2],o=e[3],a=e[4];if(t.dims.length<3||1!==n.dims.length||1!==r.dims.length||1!==o.dims.length||1!==a.dims.length)throw new Error("invalid input shape.");if(n.dims[0]!==t.dims[1]||r.dims[0]!==t.dims[1]||o.dims[0]!==t.dims[1]||a.dims[0]!==t.dims[1])throw new Error("invalid input shape.");if("float32"!==t.type&&"float64"!==t.type||"float32"!==n.type&&"float64"!==n.type||"float32"!==r.type&&"float64"!==r.type||"float32"!==o.type&&"float64"!==o.type||"float32"!==a.type&&"float64"!==a.type)throw new Error("invalid input tensor types.")}},7839:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.xor=t.sub=t.pRelu=t.pow=t.or=t.mul=t.less=t.greater=t.equal=t.div=t.and=t.add=t.glslPRelu=t.glslPow=t.glslXor=t.glslOr=t.glslAnd=t.glslLess=t.glslGreater=t.glslEqual=t.glslSub=t.glslMul=t.glslDiv=t.glslAdd=void 0;const r=n(2517),o=n(8520),a=n(5060),i=n(2039);function s(){const e="add_";return{body:`\n float ${e}(float a, float b) {\n return a + b;\n }\n vec4 ${e}(vec4 v1, vec4 v2) {\n return v1 + v2;\n }\n `,name:e,type:o.FunctionType.ValueBased}}function l(){const e="div_";return{body:`\n float ${e}(float a, float b) {\n return a / b;\n }\n vec4 ${e}(vec4 v1, vec4 v2) {\n return v1 / v2;\n }\n `,name:e,type:o.FunctionType.ValueBased}}function u(){const e="mul_";return{body:`\n float ${e}(float a, float b) {\n return a * b;\n }\n vec4 ${e}(vec4 v1, vec4 v2) {\n return v1 * v2;\n }\n `,name:e,type:o.FunctionType.ValueBased}}function c(){const e="sub_";return{body:`\n float ${e}(float a, float b) {\n return a - b;\n }\n vec4 ${e}(vec4 v1, vec4 v2) {\n return v1 - v2;\n }\n `,name:e,type:o.FunctionType.ValueBased}}function d(){const e="equal_";return{body:`\n float ${e}(float a, float b) {\n return float(a == b);\n }\n vec4 ${e}(vec4 v1, vec4 v2) {\n return vec4(equal(v1, v2));\n }\n `,name:e,type:o.FunctionType.ValueBased}}function f(){const e="greater_";return{body:`\n float ${e}(float a, float b) {\n return float(a > b);\n }\n vec4 ${e}(vec4 v1, vec4 v2) {\n return vec4( v1.r > v2.r ,\n v1.g > v2.g,\n v1.b > v2.b,\n v1.a > v2.a );\n }\n `,name:e,type:o.FunctionType.ValueBased}}function p(){const e="less_";return{body:`\n float ${e}(float a, float b) {\n return float(a < b);\n }\n vec4 ${e}(vec4 v1, vec4 v2) {\n return vec4( v1.r < v2.r ,\n v1.g < v2.g,\n v1.b < v2.b,\n v1.a < v2.a );\n }\n `,name:e,type:o.FunctionType.ValueBased}}function h(){const e="and_";return{body:`\n float ${e}(float a, float b) {\n return float( bool(a) && bool(b) );\n }\n vec4 ${e}(vec4 v1, vec4 v2) {\n bvec4 b1 = bvec4(v1);\n bvec4 b2 = bvec4(v2);\n return vec4( b1.r && b2.r ,\n b1.g && b2.g,\n b1.b && b2.b,\n b1.a && b2.a );\n }\n `,name:e,type:o.FunctionType.ValueBased}}function m(){const e="or_";return{body:`\n float ${e}(float a, float b) {\n return float( bool(a) || bool(b) );\n }\n vec4 ${e}(vec4 v1, vec4 v2) {\n bvec4 b1 = bvec4(v1);\n bvec4 b2 = bvec4(v2);\n return vec4( b1.r || b2.r ,\n b1.g || b2.g,\n b1.b || b2.b,\n b1.a || b2.a );\n }\n `,name:e,type:o.FunctionType.ValueBased}}function g(){const e="xor_";return{body:`\n float ${e}(float a, float b) {\n return float( bool(a) ^^ bool(b) );\n }\n vec4 ${e}(vec4 v1, vec4 v2) {\n bvec4 b1 = bvec4(v1);\n bvec4 b2 = bvec4(v2);\n return vec4( b1.r ^^ b2.r ,\n b1.g ^^ b2.g,\n b1.b ^^ b2.b,\n b1.a ^^ b2.a );\n }\n `,name:e,type:o.FunctionType.ValueBased}}function b(){return function(e){const t=`${e}_`;return{body:`\n float ${t}(float a, float b) {\n return ${e}(a, b);\n }\n vec4 ${t}(vec4 v1, vec4 v2) {\n return ${e}(v1, v2);\n }\n `,name:t,type:o.FunctionType.ValueBased}}("pow")}function y(){const e="prelu_";return{body:`\n float ${e}(float a, float b) {\n return a < 0.0 ? a * b: a;\n }\n vec4 ${e}(vec4 v1, vec4 v2) {\n return vec4(\n v1.r < 0.0 ? v1.r * v2.r: v1.r,\n v1.g < 0.0 ? v1.g * v2.g: v1.g,\n v1.b < 0.0 ? v1.b * v2.b: v1.b,\n v1.a < 0.0 ? v1.a * v2.a: v1.a\n );\n }\n `,name:e,type:o.FunctionType.ValueBased}}t.glslAdd=s,t.glslDiv=l,t.glslMul=u,t.glslSub=c,t.glslEqual=d,t.glslGreater=f,t.glslLess=p,t.glslAnd=h,t.glslOr=m,t.glslXor=g,t.glslPow=b,t.glslPRelu=y;const _=(e,t,n,r=t[0].type,o)=>{const a=e.session.pack?i.TextureType.packed:i.TextureType.unpacked;return{name:n.name,inputNames:["A","B"],inputTypes:[a,a],cacheHint:o,get:()=>v(e,t,n,r)}},v=(e,t,n,o=t[0].type)=>{const s=e.session.pack?i.TextureType.packed:i.TextureType.unpacked,l=!r.ShapeUtil.areEqual(t[0].dims,t[1].dims);let u=t[0].dims;const c=e.session.pack;if(l){const i=r.BroadcastUtil.calcShape(t[0].dims,t[1].dims,!1);if(!i)throw new Error("Can't perform binary op on the given tensors");u=i;const l=u.length,d=0!==t[0].dims.length?t[0].dims.length:1,f=0!==t[1].dims.length?t[1].dims.length:1,p=0!==t[0].dims.length?"bcastIndices_A(indices, aindices);":"aindices[0] = 0;",h=0!==t[1].dims.length?"bcastIndices_B(indices, bindices);":"bindices[0] = 0;",m=(0,a.getGlsl)(e.session.backend.glContext.version),g=c?`\n ${n.body}\n void main() {\n vec4 a = getAAtOutCoords();\n vec4 b = getBAtOutCoords();\n vec4 result = ${n.name}(a, b);\n ${m.output} = result;\n }`:`\n ${n.body}\n float process(int indices[${l}]) {\n int aindices[${d}];\n int bindices[${f}];\n ${p}\n ${h}\n return ${n.name}(_A(aindices), _B(bindices));\n }`;return{name:n.name,inputNames:["A","B"],inputTypes:[s,s],output:{dims:u,type:o,textureType:s},shaderSource:g,hasMain:c}}const d=(0,a.getGlsl)(e.session.backend.glContext.version),f=`\n ${n.body}\n void main() {\n vec4 v1 = ${d.texture2D}(A, TexCoords);\n vec4 v2 = ${d.texture2D}(B, TexCoords);\n vec4 result = ${n.name}(v1, v2);\n ${d.output} = result;\n }\n `;return{name:n.name,inputNames:["A","B"],inputTypes:[s,s],output:{dims:t[0].dims,type:o,textureType:s},shaderSource:f,hasMain:!0}};t.add=(e,t)=>[e.run(_(e,t,s()),t)],t.and=(e,t)=>[e.run(_(e,t,h(),"bool"),t)],t.div=(e,t)=>[e.run(_(e,t,l()),t)],t.equal=(e,t)=>[e.run(_(e,t,d(),"bool"),t)],t.greater=(e,t)=>[e.run(_(e,t,f(),"bool"),t)],t.less=(e,t)=>[e.run(_(e,t,p(),"bool"),t)],t.mul=(e,t)=>[e.run(_(e,t,u()),t)],t.or=(e,t)=>[e.run(_(e,t,m(),"bool"),t)],t.pow=(e,t)=>[e.run(_(e,t,b()),t)],t.pRelu=(e,t)=>[e.run(_(e,t,y()),t)],t.sub=(e,t)=>[e.run(_(e,t,c()),t)],t.xor=(e,t)=>[e.run(_(e,t,g(),"bool"),t)]},4196:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseCastAttributes=t.cast=void 0;const r=n(2517);t.cast=(e,t,n)=>(o(t),[e.cast(t[0],n)]),t.parseCastAttributes=e=>r.ProtoUtil.tensorDataTypeFromProto(e.attributes.getInt("to"));const o=e=>{if(!e||1!==e.length)throw new Error("Cast requires 1 input.");if("string"===e[0].type)throw new Error("Invalid input type.")}},1163:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createPackedConcatProgramInfoLoader=void 0;const r=n(5060),o=n(2039),a=n(9390),i=n(2827);t.createPackedConcatProgramInfoLoader=(e,t,n)=>{const l=(u=t.length,c=n.cacheKey,{name:"Concat (packed)",inputNames:Array.from({length:u},(e,t)=>`X${t}`),inputTypes:Array(u).fill(o.TextureType.packed),cacheHint:c});var u,c;return Object.assign(Object.assign({},l),{get:()=>((e,t,n,l)=>{const u=n[0].dims.slice();if(l>=u.length||l<-1*u.length)throw new Error("axis specified for concat doesn't match input dimensionality");l<0&&(l=u.length+l);const c=u.slice(0);for(let r=1;r<n.length;r++){const e=n[r].dims.slice();for(let t=0;t<u.length;t++)if(t===l)c[l]+=e[t];else if(u[t]!==e[t])throw new Error("non concat dimensions must match")}const d=c.length,f=(0,i.getChannels)("coords",d),p=(0,a.getCoordsDataType)(d),h=(0,i.unpackFromChannel)(),m=n.map(e=>e.dims),g=(0,a.getGlChannels)(d),b=new Array(m.length-1);b[0]=m[0][l];for(let r=1;r<b.length;r++)b[r]=b[r-1]+m[r][l];const y=g[l],_=g.slice(-2),v=g.join();let w=`if (${y} < ${b[0]}) {\n return getChannel(\n getX0(${v}), vec2(${_.join()}));\n }`;for(let r=1;r<b.length;r++){const e=b[r-1];w+=`\n if (${y} < ${b[r]} && ${y} >= ${b[r-1]}) {\n return getChannel(\n getX${r}(${s(g,y,e)}),\n vec2(${s(_,y,e)}));\n }`}const S=b.length,x=b[b.length-1];w+=`\n return getChannel(\n getX${S}(${s(g,y,x)}),\n vec2(${s(_,y,x)}));`;const T=(0,r.getGlsl)(e.session.backend.glContext.version),E=`\n ${h}\n float getValue(${g.map(e=>"int "+e)}) {\n ${w}\n }\n\n void main() {\n ${p} coords = getOutputCoords();\n int lastDim = coords.${g[d-1]};\n coords.${g[d-1]} = coords.${g[d-2]};\n coords.${g[d-2]} = lastDim;\n\n vec4 result = vec4(getValue(${f}), 0., 0., 0.);\n\n ${f[d-1]} = ${f[d-1]} + 1;\n if (${f[d-1]} < ${c[d-1]}) {\n result.g = getValue(${f});\n }\n\n ${f[d-2]} = ${f[d-2]} + 1;\n if (${f[d-2]} < ${c[d-2]}) {\n result.a = getValue(${f});\n }\n\n ${f[d-1]} = ${f[d-1]} - 1;\n if (${f[d-2]} < ${c[d-2]} &&\n ${f[d-1]} < ${c[d-1]}) {\n result.b = getValue(${f});\n }\n ${T.output} = result;\n }\n `;return Object.assign(Object.assign({},t),{output:{dims:c,type:n[0].type,textureType:o.TextureType.packed},shaderSource:E,hasMain:!0})})(e,l,t,n.axis)})};const s=(e,t,n)=>{const r=e.indexOf(t);return e.map((e,t)=>t===r?`${e} - ${n}`:e).join()}},2069:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseConcatAttributes=t.concat=void 0;const r=n(246),o=n(2039),a=n(1163);t.concat=(e,t,n)=>(d(t),e.session.pack&&t[0].dims.length>1?[e.run((0,a.createPackedConcatProgramInfoLoader)(e,t,n),t)]:[e.run(i(e,t,n),t)]);const i=(e,t,n)=>{const r=(a=t.length,i=n.cacheKey,{name:"Concat",inputNames:Array.from({length:a},(e,t)=>`X${t}`),inputTypes:Array(a).fill(o.TextureType.unpacked),cacheHint:i});var a,i;return Object.assign(Object.assign({},r),{get:()=>((e,t,n,r)=>{const a=n[0].dims.slice();if(r>=a.length||r<-1*a.length)throw new Error("axis specified for concat doesn't match input dimensionality");r<0&&(r=a.length+r);const i=a.slice(0);for(let o=1;o<n.length;o++){const e=n[o].dims.slice();for(let t=0;t<a.length;t++)if(t===r)i[r]+=e[t];else if(a[t]!==e[t])throw new Error("non concat dimensions must match")}const d=i.length,f=new Array(n.length);let p=0;for(let o=0;o<f.length;++o)p+=n[o].dims[r],f[o]=p;let h="";h=n.length<5?s(f):l(f);const m=`\n ${u(n.length,d)}\n ${c(f)}\n ${h}\n float process(int indices[${d}]) {\n int textureIndex = getTextureWhereDataResides (indices[${r}]);\n\n if(textureIndex != 0) {\n indices[${r}] = indices[${r}] - int(getSizeInConcatAxisValueFromIndex(textureIndex-int(1)));\n }\n\n return fetchDataFromCorrectTexture(textureIndex, indices);\n }`;return Object.assign(Object.assign({},t),{output:{dims:i,type:n[0].type,textureType:o.TextureType.unpacked},shaderSource:m})})(0,r,t,n.axis)})},s=e=>`int getTextureWhereDataResides(int index) {\n ${e.map((e,t)=>`if(index<${e}) {return ${t};}\n`).join("")}\n }`,l=e=>s(e),u=(e,t)=>{const n=[`float fetchDataFromCorrectTexture(int textureIndex, int indices[${t}]) {`];for(let r=0;r<e;++r)0===r?n.push(`\tif (textureIndex == ${r}) { return _X${r}(indices); }`):r===e-1?n.push(`\telse { return _X${r}(indices); }`):n.push(`\telse if (textureIndex == ${r}) { return _X${r}(indices); }`);return n.push("\t}"),n.join("\n")},c=e=>{const t=["int getSizeInConcatAxisValueFromIndex(int index) {"];for(let n=0;n<e.length;++n)0===n?t.push(`\tif (index == ${n}) { return ${e[n]}; }`):n===e.length-1?t.push(`\telse { return ${e[n]}; }`):t.push(`\telse if (index == ${n}) { return ${e[n]}; }`);return t.push("\t}"),t.join("\n")};t.parseConcatAttributes=e=>(0,r.createAttributeWithCacheKey)({axis:e.attributes.getInt("axis")});const d=e=>{if(!e||e.length<1)throw new Error("too few inputs");const t=e[0].type,n=e[0].dims.length;if("string"===t)throw new Error("string tensor is not supported yet");for(const r of e){if(r.type!==t)throw new Error("input tensors should be one type");if(r.dims.length!==n)throw new Error("input tensors should have the same shape")}}},4770:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createUnpackedGroupedConvProgramInfoLoader=void 0;const r=n(6231),o=n(5060),a=n(2039),i=n(8138),s=n(2823);t.createUnpackedGroupedConvProgramInfoLoader=(e,t,n)=>{const l=(u=t.length>2,c=n.cacheKey,{name:"GroupedConv",inputNames:u?["X","W","Bias"]:["X","W"],inputTypes:u?[a.TextureType.unpacked,a.TextureType.unpacked,a.TextureType.unpacked]:[a.TextureType.unpacked,a.TextureType.unpacked],cacheHint:c});var u,c;return Object.assign(Object.assign({},l),{get:()=>((e,t,n,l)=>{const u=t.length>2?"value += getBias(output_channel);":"",c=t[0].dims.slice(),d=t[1].dims.slice(),f=d[0]/l.group;r.Logger.verbose("GroupedConv",`autpPad:${l.autoPad}, dilations:${l.dilations}, group:${l.group}, kernelShape:${l.kernelShape}, pads:${l.pads}, strides:${l.strides}`);const p=(0,i.calculateOutputShape)(c,d,l.dilations,l.pads,l.strides),h=(0,o.getGlsl)(e.session.backend.glContext.version),{activationFunction:m,applyActivation:g}=(0,s.getActivationSnippet)(l),b=`\n const ivec2 strides = ivec2(${l.strides[0]}, ${l.strides[1]});\n const ivec2 pads = ivec2(${l.pads[0]}, ${l.pads[1]});\n ${m}\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords.x;\n int output_channel = coords.y;\n ivec2 xRCCorner = coords.zw * strides - pads;\n int group_id = output_channel / ${f};\n\n float value = 0.0;\n for (int wInChannel = 0; wInChannel < ${d[1]}; wInChannel++) {\n int input_channel = group_id * ${d[1]} + wInChannel;\n for (int wHeight = 0; wHeight < ${d[2]}; wHeight++) {\n int xHeight = xRCCorner.x + wHeight * ${l.dilations[0]};\n\n if (xHeight < 0 || xHeight >= ${c[2]}) {\n continue;\n }\n\n for (int wWidth = 0; wWidth < ${d[3]}; wWidth++) {\n int xWidth = xRCCorner.y + wWidth * ${l.dilations[1]};\n if (xWidth < 0 || xWidth >= ${c[3]}) {\n continue;\n }\n\n float xVal = getX(batch, input_channel, xWidth, xHeight);\n float wVal = getW(output_channel, wInChannel, wWidth, wHeight);\n value += xVal*wVal;\n }\n }\n }\n ${u}\n ${g}\n ${h.output} = vec4(value, .0, .0, .0);\n }\n`;return Object.assign(Object.assign({},n),{output:{dims:p,type:t[0].type,textureType:a.TextureType.unpacked},shaderSource:b,hasMain:!0})})(e,t,l,n)})}},1386:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.conv2DPacked=t.conv2DPackedPointwise=void 0;const r=n(8138),o=n(8555),a=n(708);t.conv2DPackedPointwise=(e,t,n)=>{const o=t[0].dims,i=t[1].dims,s=(0,r.calculateOutputShape)(o,i,n.dilations,n.pads,n.strides),l=e.reshapePacked(t[0],[o[1],o[2]*o[3]]),u=e.reshapePacked(t[1],[i[0],i[1]]),c=t.length>2?[u,l,t[2]]:[u,l],d=e.run((0,a.createPackedMatmulProgramInfoLoader)(e,c,n),c);return e.reshapePacked(d,s)},t.conv2DPacked=(e,t,n)=>{const i=t[0].dims,s=t[1].dims,l=(0,r.calculateOutputShape)(i,s,n.dilations,n.pads,n.strides),u=e.run((0,o.createPackedIm2ColProgramInfoLoader)(e,t[0],t[1],l,n),[t[0]]),c=e.reshapePacked(t[1],[s[0],s[1]*s[2]*s[3]]),d=3===t.length?[c,u,t[2]]:[c,u],f=e.run((0,a.createPackedMatmulProgramInfoLoader)(e,d,n),d);return e.reshapePacked(f,l)}},9663:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseConvTransposeAttributes=t.convTranspose=void 0;const r=n(246),o=n(5060),a=n(2039),i=n(2823),s=(e,t,n,r,o,a)=>(e-1)*t+n+(r-1)*o+1-a,l=(e,t,n,r,o)=>{const a=Math.floor(e/2);"SAME_UPPER"===t?(n[r]=a,n[o]=e-a):"SAME_LOWER"===t&&(n[r]=e-a,n[o]=a)};t.convTranspose=(e,t,n)=>(f(t,n),u(e,t,n));const u=(e,t,n)=>{const r=d(n,t);return[c(e,t,r)]},c=(e,t,n)=>e.run(((e,t,n)=>{const r=(s=t.length>2,l=n.cacheKey,{name:"ConvTranspose",inputNames:s?["X","W","B"]:["X","W"],inputTypes:s?[a.TextureType.unpacked,a.TextureType.unpacked,a.TextureType.unpacked]:[a.TextureType.unpacked,a.TextureType.unpacked],cacheHint:l});var s,l;return Object.assign(Object.assign({},r),{get:()=>((e,t,n,r)=>{const s=t.length>2?"getB(output_channel)":"0.0",l=t[0].dims,u=t[1].dims,c=u[1],d=u[0]/r.group,f=[t[0].dims[0],t[1].dims[1]*r.group,...r.outputShape],p=(0,o.getGlsl)(e.session.backend.glContext.version),{activationFunction:h,applyActivation:m}=(0,i.getActivationSnippet)(r),g=`\n const ivec2 strides = ivec2(${r.strides[0]}, ${r.strides[1]});\n const ivec2 pads = ivec2(${r.pads[0]}, ${r.pads[1]});\n ${h}\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords.x;\n int output_channel = coords.y;\n\n ivec2 loc = coords.zw + pads;\n\n int group_id = output_channel / ${c};\n int wOutChannel = output_channel - group_id * ${c};\n\n float value = ${s};\n for (int inChannelOffset = 0; inChannelOffset < ${d}; inChannelOffset++) {\n int input_channel = group_id * ${d} + inChannelOffset;\n for (int wWOff = 0; wWOff < ${u[2]}; wWOff++) {\n for (int wHOff = 0; wHOff < ${u[3]}; wHOff++) {\n ivec2 wOff = ivec2(wWOff * ${r.dilations[0]}, wHOff * ${r.dilations[1]});\n ivec2 wLoc = loc - wOff;\n ivec2 wLocIn = wLoc / strides;\n if (\n wLocIn * strides == wLoc &&\n wLocIn.x >= 0 && wLocIn.x < ${l[2]} &&\n wLocIn.y >= 0 && wLocIn.y < ${l[3]}\n ) {\n float xVal = getX(batch, input_channel, wLocIn.y, wLocIn.x);\n float wVal = getW(input_channel, wOutChannel, wHOff, wWOff);\n value += xVal * wVal;\n }\n }\n }\n }\n ${m}\n ${p.output} = vec4(value, .0, .0, .0);\n }\n`;return Object.assign(Object.assign({},n),{output:{dims:f,type:t[0].type,textureType:a.TextureType.unpacked},shaderSource:g,hasMain:!0})})(e,t,r,n)})})(e,t,n),t),d=(e,t)=>{const n=e.kernelShape.slice();if(0===e.kernelShape.length)for(let i=2;i<t[1].dims.length;++i)n.push(t[1].dims[i]);const r=e.pads.slice(),o=e.outputShape.slice();((e,t,n,r,o,a,i,u)=>{const c=e.length-2,d=0===u.length;for(let f=0;f<c;++f){const p=d?e[f+2]*a[f]:u[f],h=s(e[f+2],a[f],o[f],t[f],n[f],p);l(h,r,o,f,f+c),d&&u.push(a[f]*(e[f+2]-1)+i[f]+(t[f]-1)*n[f]+1-o[f]-o[f+c])}})(t[0].dims,n,e.dilations,e.autoPad,r,e.strides,e.outputPadding,o);const a=Object.assign({},e);return Object.assign(a,{kernelShape:n,pads:r,outputShape:o,cacheKey:e.cacheKey}),a};t.parseConvTransposeAttributes=e=>{const t=e.attributes,n=(0,i.parseInternalActivationAttributes)(t),o=t.getString("auto_pad","NOTSET"),a=t.getInts("dilations",[1,1]),s=t.getInt("group",1),l=t.getInts("kernel_shape",[]),u=t.getInts("output_padding",[0,0]),c=t.getInts("output_shape",[]),d=t.getInts("pads",[0,0,0,0]),f=t.getInts("strides",[1,1]);return(0,r.createAttributeWithCacheKey)(Object.assign({autoPad:o,dilations:a,group:s,kernelShape:l,outputPadding:u,outputShape:c,pads:d,strides:f},n))};const f=(e,t)=>{if(!e||2!==e.length&&3!==e.length)throw new Error("Conv requires 2 or 3 inputs");if(4!==e[0].dims.length||4!==e[1].dims.length)throw new Error("currently only support 2-dimensional conv");if(e[0].dims[1]!==e[1].dims[0])throw new Error("FILTER_IN_CHANNEL should be equal to DATA_CHANNEL");const n=e[1].dims[1]*t.group;if(3===e.length&&(1!==e[2].dims.length||e[2].dims[0]!==n))throw new Error("invalid bias");const r=e[0].dims.length-2;if(t.dilations.length!==r)throw new Error(`dilations should be ${r}D`);if(t.strides.length!==r)throw new Error(`strides should be ${r}D`);if(t.pads.length!==2*r)throw new Error(`pads should be ${2*r}D`);if(t.outputPadding.length!==r)throw new Error(`output_padding should be ${r}D`);if(0!==t.kernelShape.length&&t.kernelShape.length!==e[1].dims.length-2)throw new Error("invalid kernel shape");if(0!==t.outputShape.length&&t.outputShape.length!==e[0].dims.length-2)throw new Error("invalid output shape");if("float32"!==e[0].type||"float32"!==e[1].type)throw new Error("ConvTranspose input(X,W) should be float tensor");if(3===e.length&&"float32"!==e[2].type)throw new Error("ConvTranspose input(bias) should be float tensor")}},8138:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseConvAttributes=t.conv=t.calculateOutputShape=void 0;const r=n(246),o=n(2517),a=n(4770),i=n(1386),s=n(9828),l=n(2823),u=n(3248),c=n(5623);t.calculateOutputShape=(e,t,n,r,o)=>{const a=e[0],i=e.slice(2),s=i.length,l=t[0],u=t.slice(2).map((e,t)=>e+(e-1)*(n[t]-1)),c=i.map((e,t)=>e+r[t]+r[t+s]).map((e,t)=>Math.floor((e-u[t]+o[t])/o[t]));return[a,l].concat(...c)},t.conv=(e,t,n)=>(m(t,n),d(e,t,n));const d=(e,t,n)=>{const r=h(n,t),o=e.session.pack,s=1===r.kernelShape[0]&&1===r.kernelShape[1];return r.group>1?[e.run((0,a.createUnpackedGroupedConvProgramInfoLoader)(e,t,r),t)]:s&&o?[f(e,t,r)]:o&&4===t[0].dims.length&&1===t[0].dims[0]&&!s?[(0,i.conv2DPacked)(e,t,r)]:[p(e,t,r)]},f=(e,n,r)=>{const o=n[0].dims,a=n[1].dims,i=(0,t.calculateOutputShape)(o,a,r.dilations,r.pads,r.strides),s=e.reshapeUnpacked(n[0],[o[1],o[2]*o[3]]),l=e.reshapeUnpacked(n[1],[a[0],a[1]]),u=n.length>2?[l,s,n[2]]:[l,s],d=e.run((0,c.createMatmulProgramInfoLoader)(u,r),u);return e.reshapeUnpacked(d,i)},p=(e,n,r)=>{const o=n[0].dims,a=n[1].dims,i=(0,t.calculateOutputShape)(o,a,r.dilations,r.pads,r.strides),l=e.run((0,u.createIm2ColProgramInfoLoader)(e,n[0],n[1],i,r),[n[0]]),c=3===n.length?[l,n[1],n[2]]:[l,n[1]];return e.run((0,s.createDotProductProgramInfoLoader)(e,n,i,r),c)},h=(e,t)=>{const n=e.kernelShape.slice();if(0===e.kernelShape.length)for(let o=2;o<t[1].dims.length;++o)n.push(t[1].dims[o]);const r=e.pads.slice();o.PoolConvUtil.adjustPadsBasedOnAutoPad(t[0].dims,e.strides,e.dilations,n,r,e.autoPad);const a=Object.assign({},e);return Object.assign(a,{kernelShape:n,pads:r,cacheKey:e.cacheKey}),a};t.parseConvAttributes=e=>{const t=e.attributes,n=(0,l.parseInternalActivationAttributes)(t),o=t.getString("auto_pad","NOTSET"),a=t.getInts("dilations",[1,1]),i=t.getInt("group",1),s=t.getInts("kernel_shape",[]),u=t.getInts("pads",[0,0,0,0]),c=t.getInts("strides",[1,1]);return(0,r.createAttributeWithCacheKey)(Object.assign({autoPad:o,dilations:a,group:i,kernelShape:s,pads:u,strides:c},n))};const m=(e,t)=>{if(!e||2!==e.length&&3!==e.length)throw new Error("Conv requires 2 or 3 inputs");if(4!==e[0].dims.length||4!==e[1].dims.length)throw new Error("currently only support 2-dimensional conv");if(e[0].dims[1]!==e[1].dims[1]*t.group)throw new Error("FILTER_IN_CHANNEL should be equal to DATA_CHANNEL");if(3===e.length&&(1!==e[2].dims.length||e[1].dims[0]!==e[2].dims[0]))throw new Error("invalid bias");const n=e[0].dims.length-2;if(t.dilations.length!==n)throw new Error(`dilations should be ${n}D`);if(t.strides.length!==n)throw new Error(`strides should be ${n}D`);if(t.pads.length!==2*n)throw new Error(`pads should be ${2*n}D`);if(0!==t.kernelShape.length&&t.kernelShape.length!==e[1].dims.length-2)throw new Error("invalid kernel shape");if("float32"!==e[0].type||"float32"!==e[1].type)throw new Error("Conv input(X,W) should be float tensor");if(3===e.length&&"float32"!==e[2].type)throw new Error("Conv input(bias) should be float tensor")}},5193:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseDepthToSpaceAttributes=t.depthToSpace=void 0;const r=n(3738);t.depthToSpace=(e,t,n)=>{o(t);const a=n.blocksize,i=a*a,s="DCR"===n.mode?[0,3,4,1,5,2]:[0,1,4,2,5,3],l="DCR"===n.mode?[t[0].dims[0],a,a,t[0].dims[1]/i,t[0].dims[2],t[0].dims[3]]:[t[0].dims[0],t[0].dims[1]/i,a,a,t[0].dims[2],t[0].dims[3]],u=e.reshapeUnpacked(t[0],l),c={perm:s,cacheKey:`${s}`},[d]=(0,r.transpose)(e,[u],c),f=[t[0].dims[0],t[0].dims[1]/i,t[0].dims[2]*a,t[0].dims[3]*a];return[e.reshapeUnpacked(d,f)]},t.parseDepthToSpaceAttributes=e=>{const t=e.attributes.getInt("blocksize");if(t<1)throw new Error(`blocksize must be >= 1, but got : ${t} for DepthToSpace`);const n=e.attributes.getString("mode","DCR");if("DCR"!==n&&"CRD"!==n)throw new Error(`unrecognized mode: ${n} for DepthToSpace`);return{mode:n,blocksize:t}};const o=e=>{if(1!==e.length)throw new Error(`DepthToSpace expect 1 inputs, but got ${e.length}`);if("string"===e[0].type||4!==e[0].dims.length)throw new TypeError("DepthToSpace input should be a 4-D numeric tensor")}},9828:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createDotProductProgramInfoLoader=void 0;const r=n(2517),o=n(5060),a=n(2039),i=n(2823),s=n(3248);t.createDotProductProgramInfoLoader=(e,t,n,l)=>{const u=(c=t.length>2,d=l,{name:"ConvDotProduct",inputNames:c?["Im2Col","K","B"]:["Im2Col","K"],inputTypes:c?[a.TextureType.unpacked,a.TextureType.packedLastDimension,a.TextureType.unpacked]:[a.TextureType.unpacked,a.TextureType.packedLastDimension],cacheKey:d.activationCacheKey});var c,d;return Object.assign(Object.assign({},u),{get:()=>((e,t,n,l,u)=>{const c=n[0].dims,d=n[1].dims,f=[d[0],Math.ceil(c[1]*d[2]*d[3]/4)],p=(0,s.calculateIm2ColDims)(c,d,l),[h,m]=e.calculateTextureWidthAndHeight(f,a.TextureType.packedLastDimension),g=r.ShapeUtil.computeStrides(p),[b,y]=e.calculateTextureWidthAndHeight(p,a.TextureType.packedLastDimension),_=l.length,v=n.length<3?"0.0":"_B(b)",w=Math.ceil(c[1]*d[2]*d[3]/4),{activationFunction:S,applyActivation:x}=(0,i.getActivationSnippet)(u),T=(0,o.getGlsl)(e.session.backend.glContext.version),E=`\n${S}\nfloat process(int indices[${_}]) {\n int b[1];\n b[0] = indices[1];\n int im2col[4];\n im2col[0] = indices[0];\n im2col[1] = indices[2];\n im2col[2] = indices[3];\n int im2colOffset = im2col[0] * ${g[0]} + im2col[1] * ${g[1]} + im2col[2] * ${g[2]};\n int kernelOffset = indices[1] * ${f[1]};\n float value = ${v};\n for (int i = 0; i < ${w}; ++i) {\n vec2 im2colCoords = offsetToCoords(im2colOffset, ${b}, ${y});\n vec2 kernelCoords = offsetToCoords(kernelOffset, ${h}, ${m});\n value += dot(${T.texture2D}(Im2Col, im2colCoords), ${T.texture2D}(K, kernelCoords));\n ++im2colOffset;\n ++kernelOffset;\n }\n ${x}\n return value;\n}`;return Object.assign(Object.assign({},t),{output:{dims:l,type:n[0].type,textureType:a.TextureType.unpacked},shaderSource:E})})(e,u,t,n,l)})}},7992:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseFlattenAttributes=t.flatten=void 0;const r=n(2517);t.flatten=(e,t,n)=>{o(t,n);const a=r.ShapeUtil.flattenShape(t[0].dims,n);return[e.reshapeUnpacked(t[0],a)]},t.parseFlattenAttributes=e=>e.attributes.getInt("axis",1);const o=(e,t)=>{if(!e||1!==e.length)throw new Error("Flatten requires 1 input.");const n=e[0].dims.length;if(0===n)throw new Error("scalar tensor is not supported.");if(t<-n||t>n)throw new Error("Invalid axis");if("string"===e[0].type)throw new Error("string tensor is not supported.")}},2823:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseInternalActivationAttributes=t.getActivationSnippet=void 0;const r=n(2517),o=n(4909);t.getActivationSnippet=function(e){let t;switch(e.activation){case"Relu":t=(0,o.glslRelu)();break;case"Sigmoid":t=(0,o.glslSigmoid)();break;case"Clip":t=(0,o.glslClip)(e.clipMin,e.clipMax);break;default:return{activationFunction:"",applyActivation:""}}const n=t.name;return{activationFunction:t.body,applyActivation:`value = ${n}_(value);`}},t.parseInternalActivationAttributes=e=>{const t=e.getString("activation","");if("Clip"===t){const[n,o]=e.getFloats("activation_params",[r.MIN_CLIP,r.MAX_CLIP]);return{activation:t,clipMax:o,clipMin:n,activationCacheKey:`${t}:${n},${o}`}}return{activation:t,activationCacheKey:t}}},1253:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseGatherAttributes=t.gather=void 0;const r=n(246),o=n(782),a=n(2517),i=n(2039);t.gather=(e,t,n)=>(u(t,n.axis),[e.run(l(e,t,n),t)]),t.parseGatherAttributes=e=>(0,r.createAttributeWithCacheKey)({axis:e.attributes.getInt("axis",0)});const s={name:"Gather",inputNames:["A","B"],inputTypes:[i.TextureType.unpacked,i.TextureType.unpacked]},l=(e,t,n)=>{const r=Object.assign(Object.assign({},s),{cacheHint:n.cacheKey});return Object.assign(Object.assign({},r),{get:()=>((e,t,n,r)=>{const o=n[0].dims.slice(),s=n[1].dims.slice(),l=new Array(o.length+s.length-1);r=a.ShapeUtil.normalizeAxis(r,o.length);const u=[];for(let a=0;a<l.length;a++)a<r?(l[a]=o[a],u.push(`inputIdx[${a}] = outputIdx[${a}];`)):a<r+s.length?(l[a]=s[a-r],u.push(`indexDataIdx[${a-r}] = outputIdx[${a}];`)):(l[a]=o[a-s.length+1],u.push(`inputIdx[${a-s.length+1}] = outputIdx[${a}];`));const c=`\n float process(int outputIdx[${l.length||1}]) {\n int inputIdx[${o.length}];\n int indexDataIdx[${s.length||1}];\n indexDataIdx[0] = 0;\n ${u.join("\n ")}\n int idx = int(_B(indexDataIdx));\n inputIdx[${r}] = idx < 0 ? idx + ${o[r]} : idx;\n return _A(inputIdx);\n }`;return Object.assign(Object.assign({},t),{output:{dims:l,type:n[0].type,textureType:i.TextureType.unpacked},shaderSource:c})})(0,r,t,n.axis)})},u=(e,t)=>{if(!e||2!==e.length)throw new Error("Gather requires 2 inputs.");const n=e[0].dims.length;if(n<1)throw new Error("Invalid input shape.");if(t<-n||t>n-1)throw new Error("Invalid axis.");if(-1===o.NUMBER_TYPES.indexOf(e[0].type))throw new Error("Invaid input type.");if("int32"!==e[1].type&&"int16"!==e[1].type)throw new Error("Invaid input type.")}},4776:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseGemmAttributesV11=t.parseGemmAttributesV7=t.gemm=void 0;const r=n(246),o=n(2517),a=n(2039);t.gemm=(e,t,n)=>(u(t,n),[e.run(s(t,n),t)]);const i=(e,t)=>{const n=0!==e.attributes.getInt("transA",0),o=0!==e.attributes.getInt("transB",0),a=e.attributes.getFloat("alpha",1),i=e.attributes.getFloat("beta",1);return(0,r.createAttributeWithCacheKey)({transA:n,transB:o,alpha:a,beta:i,isOptionalC:t})};t.parseGemmAttributesV7=e=>i(e,!1),t.parseGemmAttributesV11=e=>i(e,!0);const s=(e,t)=>{const n={name:"Gemm",inputNames:3===e.length?["A","B","C"]:["A","B"],inputTypes:3===e.length?[a.TextureType.unpacked,a.TextureType.unpacked,a.TextureType.unpacked]:[a.TextureType.unpacked,a.TextureType.unpacked],key:t.cacheKey};return Object.assign(Object.assign({},n),{get:()=>l(n,e,t)})},l=(e,t,n)=>{const r=t[0].dims.slice(),i=t[1].dims.slice(),[s,l]=o.GemmUtil.getShapeOfGemmResult(r,n.transA,i,n.transB,3===t.length?t[2].dims:void 0),u=[s,l];if(!u)throw new Error("Can't use gemm on the given tensors");let c=r[r.length-1],d="";n.transA&&(c=r[0]),n.transA&&n.transB?d="value += _A_T(a) * _B_T(b);":n.transA&&!n.transB?d="value += _A_T(a) * _B(b);":!n.transA&&n.transB?d="value += _A(a) * _B_T(b);":n.transA||n.transB||(d="value += _A(a) * _B(b);");const f=u.length,p=`\n float process(int indices[${f}]) {\n int a[${f}];\n int b[${f}];\n ${3===t.length?`int c[${t[2].dims.length}];`:""}\n\n copyVec(indices, a);\n copyVec(indices, b);\n ${3===t.length?"bcastIndices_C(indices, c);":""}\n\n float value = 0.0;\n for (int k=0; k<${c}; ++k) {\n a[${f-1}] = k;\n b[${f-2}] = k;\n ${d}\n }\n\n value = value * alpha;\n ${3===t.length?"value += beta * _C(c);":""}\n return value;\n }`;return Object.assign(Object.assign({},e),{output:{dims:u,type:t[0].type,textureType:a.TextureType.unpacked},variables:[{name:"alpha",type:"float",data:n.alpha},{name:"beta",type:"float",data:n.beta}],shaderSource:p})},u=(e,t)=>{if(!e)throw new Error("Input is missing");if(t.isOptionalC&&(e.length<2||e.length>3))throw new Error("Invaid input shape.");if(!t.isOptionalC&&3!==e.length)throw new Error("Gemm requires 3 inputs");if(3===e.length&&1!==e[2].dims.length&&2!==e[2].dims.length)throw new Error("Invalid input shape of C");if("float32"!==e[0].type&&"float64"!==e[0].type||"float32"!==e[1].type&&"float64"!==e[1].type||3===e.length&&"float32"!==e[2].type&&"float64"!==e[2].type)throw new Error("Invalid input type.");if(e[0].type!==e[1].type||3===e.length&&e[0].type!==e[2].type)throw new Error("Input types are mismatched")}},8555:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createPackedIm2ColProgramInfoLoader=void 0;const r=n(5060),o=n(2039),a=n(2827);t.createPackedIm2ColProgramInfoLoader=(e,t,n,i,s)=>{const l=(u=s.cacheKey,{name:"Im2Col (packed)",inputNames:["A"],inputTypes:[o.TextureType.packed],cacheHint:u});var u;return Object.assign(Object.assign({},l),{get:()=>((e,t,n,i,s,l)=>{const u=n.dims,c=i.dims,d=s.length,f=[c[1]*c[2]*c[3],s[2]*s[3]],p=c[2]*c[3],h=(0,a.unpackFromChannel)(),m=(0,r.getGlsl)(e.session.backend.glContext.version);let g="";for(let r=0;r<=1;r++)for(let e=0;e<=1;e++)g+=`\n blockIndex = rc.x + ${e};\n pos = rc.y + ${r};\n\n if(blockIndex < ${f[1]} && pos < ${f[0]}) {\n offsetY = int(blockIndex / (${s[d-1]})) * ${l.strides[0]} -\n ${l.pads[0]};\n d0 = offsetY + ${l.dilations[0]} * (imod(pos, ${p}) / ${c[2]});\n\n if(d0 < ${u[2]} && d0 >= 0) {\n offsetX = imod(blockIndex, ${s[d-1]}) * ${l.strides[1]} -\n ${l.pads[1]};\n d1 = offsetX + ${l.dilations[1]} * imod(imod(pos, ${p}), ${c[2]});\n\n if(d1 < ${u[3]} && d1 >= 0) {\n\n ch = int(float(pos)/ ${p}.);\n innerDims = vec2(d0, d1);\n result[${2*r+e}] = getChannel(\n getA(0, ch, int(innerDims.x),\n int(innerDims.y)), innerDims);\n }\n }\n }\n\n `;const b=`\n ${h}\n\n void main() {\n ivec2 rc = getOutputCoords();\n vec4 result = vec4(0.0);\n int blockIndex, pos, offsetY, d0, offsetX, d1, ch;\n vec2 innerDims;\n ${g}\n ${m.output} = result;\n }\n `;return Object.assign(Object.assign({},t),{output:{dims:f,type:n.type,textureType:o.TextureType.packed},shaderSource:b,hasMain:!0})})(e,l,t,n,i,s)})}},3248:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.calculateIm2ColDims=t.createIm2ColProgramInfoLoader=void 0;const r=n(2039);t.createIm2ColProgramInfoLoader=(e,n,o,a,i)=>{const s=(l=i.cacheKey,{name:"Im2Col",inputNames:["X"],inputTypes:[r.TextureType.unpacked],cacheHint:l});var l;return Object.assign(Object.assign({},s),{get:()=>((e,n,o,a,i,s)=>{const l=o.dims,u=a.dims,c=i.length,d=(0,t.calculateIm2ColDims)(l,u,i,4),f=`\n const int XC = ${l[1]};\n const int XH = ${l[2]};\n const int XW = ${l[3]};\n const int KH = ${s.kernelShape[0]};\n const int KW = ${s.kernelShape[1]};\n const int dilationH = ${s.dilations[0]};\n const int dilationW = ${s.dilations[1]};\n const int strideH = ${s.strides[0]};\n const int strideW = ${s.strides[1]};\n const int padH = ${s.pads[0]};\n const int padW = ${s.pads[1]};\n const int KHKW = KH*KW;\n const int XCKHKW = XC * KHKW;\n const int outputChannels = 4;\n vec4 process(int indices[${c}]) {\n int b = indices[0]; // batch size\n int oh = indices[1] * strideH - padH; //output height\n int ow = indices[2] * strideW - padW; //output width\n int p = indices[3] * outputChannels; //patch\n vec4 value = vec4(0.0);\n for(int i=0; i < outputChannels; ++i) {\n if(p < XCKHKW) {\n int patchC = p / KHKW;\n int patchH = (p - patchC*KHKW) / KW;\n int patchW = (p - patchC*KHKW) - patchH * KW;\n int xh2 = oh + patchH * dilationH;\n int xw2 = ow + patchW * dilationW;\n int x[${l.length}];\n x[0] = b;\n x[1] = patchC;\n x[2] = xh2;\n x[3] = xw2;\n if(xh2 >= 0 &&\n xh2 < XH &&\n xw2 >= 0 &&\n xw2 < XW) {\n value[i] = _X(x);\n }\n }\n ++p;\n }\n return value;\n }\n `;return Object.assign(Object.assign({},n),{output:{dims:d,type:o.type,textureType:r.TextureType.packedLastDimension},shaderSource:f})})(0,s,n,o,a,i)})},t.calculateIm2ColDims=(e,t,n,r=4)=>[n[0],n[2],n[3],Math.ceil(e[1]*t[2]*t[3]/r)]},6572:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseImageScalerAttributes=t.imageScaler=void 0;const r=n(246),o=n(2039);t.imageScaler=(e,t,n)=>(l(t),[e.run(i(e,t,n),t)]),t.parseImageScalerAttributes=e=>{const t=e.attributes.getFloat("scale"),n=e.attributes.getFloats("bias");return(0,r.createAttributeWithCacheKey)({scale:t,bias:n})};const a={name:"ImageScaler",inputNames:["X"],inputTypes:[o.TextureType.unpacked]},i=(e,t,n)=>{const r=Object.assign(Object.assign({},a),{cacheHint:n.cacheKey});return Object.assign(Object.assign({},r),{get:()=>((e,t,n,r)=>{const a=n[0].dims.slice(),i=a.length,l=`\n ${s(r.bias.length)}\n float process(int indices[${i}]) {\n return _X(indices) * scale + getBias(bias, indices[1]);\n }`;return Object.assign(Object.assign({},t),{output:{dims:a,type:n[0].type,textureType:o.TextureType.unpacked},variables:[{name:"bias",type:"float",arrayLength:r.bias.length,data:r.bias},{name:"scale",type:"float",data:r.scale}],shaderSource:l})})(0,r,t,n)})},s=e=>{const t=[`float getBias(float bias[${e}], int channel) {`];for(let n=0;n<e;++n)0===n?t.push(`\tif (channel == ${n}) { return bias[${n}]; }`):n===e-1?t.push(`\telse { return bias[${n}]; }`):t.push(`\telse if (channel == ${n}) { return bias[${n}]; }`);return t.push("\t}"),t.join("\n")},l=e=>{if(!e||1!==e.length)throw new Error("ImageScaler requires 1 input.");if(4!==e[0].dims.length)throw new Error("Invalid input shape.");if("float32"!==e[0].type&&"float64"!==e[0].type)throw new Error("Invalid input type.")}},3346:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseInstanceNormalizationAttributes=t.instanceNormalization=void 0;const r=n(5060),o=n(2039);t.instanceNormalization=(e,t,n)=>{u(t);const r=e.run(i(t[0]),t);return[e.run(l(e,t[0],n,r.dims),[t[0],r,t[1],t[2]])]},t.parseInstanceNormalizationAttributes=e=>e.attributes.getFloat("epsilon",1e-5);const a={name:"InstanceNormalization_MeanAndVariance",inputNames:["X"],inputTypes:[o.TextureType.unpacked]},i=e=>Object.assign(Object.assign({},a),{get:()=>((e,t)=>{const n=t.dims.slice(),r=n[1],a=n[2]*n[3],i=[n[0],r],s=`\n vec4 process(int[2] indices) {\n vec4 v = vec4(0.0);\n int a[4];\n a[0] = indices[0];\n a[1] = indices[1];\n float temp = 0.0;\n for(int a2=0; a2<${n[2]}; a2++) {\n a[2] = a2;\n for(int a3=0; a3<${n[3]}; a3++) {\n a[3] = a3;\n float x = _X(a);\n temp += x;\n }\n }\n float mean = temp / float(${a});\n temp = 0.0;\n for(int a2=0; a2<${n[2]}; a2++) {\n a[2] = a2;\n for(int a3=0; a3<${n[3]}; a3++) {\n a[3] = a3;\n float x = _X(a);\n temp += (x - mean) * (x - mean);\n }\n }\n v.r = mean;\n v.g = temp / float(${a});\n\n return v;\n }`;return Object.assign(Object.assign({},e),{output:{dims:i,type:t.type,textureType:o.TextureType.packedLastDimension},shaderSource:s})})(a,e)}),s={name:"InstanceNormalization_ComputeOutput",inputNames:["X","MeanAndVariance","Scale","B"],inputTypes:[o.TextureType.unpacked,o.TextureType.packedLastDimension,o.TextureType.unpacked,o.TextureType.unpacked]},l=(e,t,n,a)=>{const i=Object.assign(Object.assign({},s),{cacheHint:`${n}`});return Object.assign(Object.assign({},i),{get:()=>((e,t,n,a,i)=>{const s=(0,r.getGlsl)(e.session.backend.glContext.version),[l,u]=e.calculateTextureWidthAndHeight(i,o.TextureType.packedLastDimension),[c,d]=[l/4,u],f=`\n vec4 get_MeanAndVariance(int[2] mv) {\n int offset = indicesToOffset_MeanAndVariance(mv);\n vec2 coords = offsetToCoords(offset, ${c}, ${d});\n return ${s.texture2D}(MeanAndVariance, coords);\n }\n\n float process(int[4] indices) {\n int mv[2];\n mv[0] = indices[0];\n mv[1] = indices[1];\n vec4 mean_and_variance = get_MeanAndVariance(mv);\n float mean = mean_and_variance.r;\n float variance = mean_and_variance.g;\n\n int sb[1];\n sb[0] = indices[1];\n float scale = _Scale(sb);\n float b = _B(sb);\n\n return scale * (_X(indices) - mean) / sqrt(variance + epsilon) + b;\n }`;return Object.assign(Object.assign({},t),{output:{dims:n.dims,type:n.type,textureType:o.TextureType.unpacked},variables:[{name:"epsilon",type:"float",data:a}],shaderSource:f})})(e,i,t,n,a)})},u=e=>{if(!e||3!==e.length)throw new Error("InstanceNormalization requires 3 inputs.");const t=e[0],n=e[1],r=e[2];if(t.dims.length<3||1!==n.dims.length||1!==r.dims.length)throw new Error("Invalid input shape.");if(n.dims[0]!==t.dims[1]||r.dims[0]!==t.dims[1])throw new Error("Input shapes are mismatched.");if("float32"!==t.type&&"float64"!==t.type||"float32"!==n.type&&"float64"!==n.type||"float32"!==r.type&&"float64"!==r.type)throw new Error("Invalid input type.");if(4!==e[0].dims.length)throw new Error("Only support 4-D input shape.")}},708:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createPackedMatmulProgramInfoLoader=void 0;const r=n(2517),o=n(5060),a=n(2039),i=n(9390),s=n(2823),l=n(5623);t.createPackedMatmulProgramInfoLoader=(e,t,n)=>{const u=(c=t.length>2,d=n.activationCacheKey,{name:"MatMul (packed)",inputNames:c?["A","B","Bias"]:["A","B"],inputTypes:c?[a.TextureType.packed,a.TextureType.packed,a.TextureType.packed]:[a.TextureType.packed,a.TextureType.packed],cacheHint:d});var c,d;return Object.assign(Object.assign({},u),{get:()=>((e,t,n,u)=>{const c=n.length>2,d=c?"value += getBiasForMatmul();":"",f=n[0].dims,p=n[1].dims,h=r.BroadcastUtil.calcShape(f,p,!0),m=!r.ShapeUtil.areEqual(n[0].dims,n[1].dims);if(!h)throw new Error("Can't use matmul on the given tensors");const g=f[f.length-1],b=Math.ceil(g/2),y=f.length,_=p.length,v=(0,o.getGlsl)(e.session.backend.glContext.version),w=(0,i.getCoordsDataType)(h.length),S=h.length,x=(0,i.getGlChannels)(),{activationFunction:T,applyActivation:E}=(0,s.getActivationSnippet)(u),k=c?`${(0,l.getBiasForMatmul)(w,x,n[2].dims,h,!0)}`:"",P=m?`${function(e,t,n,o){let a=[],i=[];const s=n[0].dims,l=n[1].dims,u=s.length,c=l.length,d=o.length,f=d-u,p=d-c;a=s.map((e,n)=>`coords.${t[n+f]}`),a[u-1]="i*2",a.join(", "),i=l.map((e,n)=>`coords.${t[n+p]}`),i[c-2]="i*2",i.join(", ");const h=r.BroadcastUtil.getBroadcastDims(s,o),m=r.BroadcastUtil.getBroadcastDims(l,o),g=h.map(e=>`coords.${t[e+f]} = 0;`).join("\n"),b=m.map(e=>`coords.${t[e+p]} = 0;`).join("\n"),y=`int lastDim = coords.${t[d-1]};\n coords.${t[d-1]} = coords.${t[d-2]};\n coords.${t[d-2]} = lastDim;`;return`\nvec4 getAAtOutCoordsMatmul(int i) {\n ${e} coords = getOutputCoords();\n ${y}\n ${g}\n vec4 outputValue = getA(${a});\n return outputValue;\n}\n\nvec4 getBAtOutCoordsMatmul(int i) {\n ${e} coords = getOutputCoords();\n ${y}\n ${b}\n vec4 outputValue = getB(${i});\n return outputValue;\n}`}(w,x,n,h)}`:"",O=m?"getAAtOutCoordsMatmul(i)":`getA(${function(e,t){let n="";for(let r=0;r<t-2;r++)n+=`rc.${e[r]}, `;return n+=`rc.${e[t-2]}, i*2`,n}(x,y)})`,A=m?"getBAtOutCoordsMatmul(i)":`getB(${function(e,t){let n="";for(let r=0;r<t-2;r++)n+=`rc.${e[r]}, `;return n+=`i*2, rc.${e[t-1]}`,n}(x,_)})`,$=`\n ${P}\n ${k}\n ${T}\n void main() {\n ${m?"":`${w} rc =\n getOutputCoords(); int lastDim = rc.${x[S-1]}; rc.${x[S-1]} =\n rc.${x[S-2]}; rc.${x[S-2]} = lastDim;\n `}\n\n vec4 value = vec4(0);\n for (int i = 0; i < ${b}; i++) {\n vec4 a = ${O};\n vec4 b = ${A};\n\n value += (a.rrbb * b.rgrg);\n value += (a.ggaa * b.baba);\n }\n ${d}\n ${E}\n ${v.output} = value;\n }`;return Object.assign(Object.assign({},t),{output:{dims:h,type:n[0].type,textureType:a.TextureType.packed},shaderSource:$,hasMain:!0})})(e,u,t,n)})}},5623:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getBiasForMatmul=t.createMatmulProgramInfoLoader=t.parseMatMulAttributes=t.matMul=void 0;const r=n(2517),o=n(2039),a=n(9390),i=n(2823),s=n(708);function l(e,t){const n=(s=e.length>2,l=t.activationCacheKey,{name:"MatMul",inputNames:s?["A","B","Bias"]:["A","B"],inputTypes:s?[o.TextureType.unpacked,o.TextureType.unpacked,o.TextureType.unpacked]:[o.TextureType.unpacked,o.TextureType.unpacked],cacheHint:l});var s,l;return Object.assign(Object.assign({},n),{get:()=>function(e,t,n){const s=t[0].dims,l=t[1].dims,u=r.BroadcastUtil.calcShape(s,l,!0);if(!u)throw new Error("Can't use matmul on the given tensors");const d=(0,a.getCoordsDataType)(u.length),f=(0,a.getGlChannels)(),{activationFunction:p,applyActivation:h}=(0,i.getActivationSnippet)(n),m=t.length>2,g=m?"value += getBiasForMatmul();":"",b=m?`${c(d,f,t[2].dims,u,!1)}`:"",y=u.length,_=s.length,v=l.length,w=`\n ${p}\n ${b}\n float process(int indices[${y}]) {\n int a[${_}];\n int b[${v}];\n bcastMatmulIndices_A(indices, a);\n bcastMatmulIndices_B(indices, b);\n\n float value;\n for (int k=0; k<${s[s.length-1]}; ++k) {\n a[${_-1}] = k;\n b[${v-2}] = k;\n value += _A(a) * _B(b);\n }\n ${g}\n ${h}\n return value;\n }`;return Object.assign(Object.assign({},e),{output:{dims:u,type:t[0].type,textureType:o.TextureType.unpacked},shaderSource:w})}(n,e,t)})}t.matMul=(e,t,n)=>(u(t),e.session.pack?[e.run((0,s.createPackedMatmulProgramInfoLoader)(e,t,n),t)]:[e.run(l(t,n),t)]),t.parseMatMulAttributes=e=>(0,i.parseInternalActivationAttributes)(e.attributes),t.createMatmulProgramInfoLoader=l;const u=e=>{if(!e||2!==e.length)throw new Error("MatMul requires 2 inputs.");if(e[0].dims[e[0].dims.length-1]!==e[1].dims[e[1].dims.length-2])throw new Error("shared dimension does not match.");if("float32"!==e[0].type&&"float64"!==e[0].type||"float32"!==e[1].type&&"float64"!==e[1].type)throw new Error("inputs should be float type");if(e[0].type!==e[1].type)throw new Error("inputs types should match")};function c(e,t,n,o,a){let i="";const s=n.length,l=o.length,u=l-s;i=l<2&&s>0?"coords":n.map((e,n)=>`coords.${t[n+u]}`).join(", ");const c=r.BroadcastUtil.getBroadcastDims(n,o).map(e=>`coords.${t[e+u]} = 0;`).join("\n");let d="vec4(outputValue.xx, outputValue.yy)";return 1===r.ShapeUtil.size(n)&&(d="vec4(outputValue.x)"),a?`\nvec4 getBiasForMatmul() {\n ${e} coords = getOutputCoords();\n ${c}\n vec4 outputValue = getBias(${i});\n return ${d};\n}`:`\nfloat getBiasForMatmul() {\n ${e} coords = getOutputCoords();\n ${c}\n return getBias(coords.x);\n}`}t.getBiasForMatmul=c},2403:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createPackProgramInfoLoader=void 0;const r=n(5060),o=n(2039),a=n(9390),i=n(2827),s={name:"pack",inputNames:["A"],inputTypes:[o.TextureType.unpackedReversed]};t.createPackProgramInfoLoader=(e,t)=>Object.assign(Object.assign({},s),{get:()=>((e,t)=>{const n=(0,r.getGlsl)(e.session.backend.glContext.version),l=t.dims,u=l.length,c=t.dims.length,d=(0,a.getCoordsDataType)(c),f=(0,i.getChannels)("rc",c),p=(h=c,m=f,g=l[l.length-2],b=l[l.length-1],0===h||1===h?"":`\n int r = ${m[h-2]};\n int c = ${m[h-1]};\n int rp1 = ${m[h-2]} + 1;\n int cp1 = ${m[h-1]} + 1;\n bool rEdge = rp1 >= ${b};\n bool cEdge = cp1 >= ${g};\n `);var h,m,g,b;let y;y=0===u?[1,1]:1===u?[l[0],1]:[l[c-1],l[c-2]];const _=function(e,t,n){if(0===e)return"false";if(1===e)return`rc > ${t[0]}`;let r="";for(let o=e-2;o<e;o++)r+=`${n[o]} >= ${t[o-e+2]}`,o<e-1&&(r+="||");return r}(c,y,f),v=function(e,t){const n=e.length;if(0===n)return"getA(), 0, 0, 0";if(1===n)return`getA(rc),\n rc + 1 >= ${e[0]} ? 0. : getA(rc + 1),\n 0, 0`;let r="";if(n>2)for(let o=0;o<n-2;++o)r+=`${t[o]},`;return`getA(${r}r, c),\n rEdge ? 0. : getA(${r}rp1, c),\n cEdge ? 0. : getA(${r}r, cp1),\n rEdge || cEdge ? 0. : getA(${r}rp1, cp1)`}(l,f),w=`\n void main() {\n ${d} rc = getOutputCoords();\n\n if(${_}) {\n ${n.output} = vec4(0);\n } else {\n ${p}\n\n ${n.output} = vec4(${v});\n }\n }\n `;return Object.assign(Object.assign({},s),{hasMain:!0,output:{dims:t.dims,type:t.type,textureType:o.TextureType.packed},shaderSource:w})})(e,t)})},2827:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.unpackFromChannel=t.getChannels=t.getVecChannels=void 0;const r=n(9390);function o(e,t){return(0,r.getGlChannels)(t).map(t=>`${e}.${t}`)}t.getVecChannels=o,t.getChannels=function(e,t){return 1===t?[e]:o(e,t)},t.unpackFromChannel=function(){return"\n float getChannel(vec4 frag, int dim) {\n int modCoord = imod(dim, 2);\n return modCoord == 0 ? frag.r : frag.g;\n }\n\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 "}},2870:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parsePadAttributesV11=t.padV11=t.parsePadAttributesV2=t.padV2=void 0;const r=n(246),o=n(2517),a=n(5060),i=n(2039),s={name:"Pad",inputNames:["A"],inputTypes:[i.TextureType.unpacked]};t.padV2=(e,t,n)=>(c(t),[e.run(Object.assign(Object.assign({},s),{cacheHint:n.cacheKey,get:()=>u(e,t[0],n)}),t)]),t.parsePadAttributesV2=e=>{const t=e.attributes.getString("mode","constant"),n=e.attributes.getFloat("value",0),o=e.attributes.getInts("pads");return(0,r.createAttributeWithCacheKey)({mode:t,value:n,pads:o})},t.padV11=(e,n,r)=>{d(n);const o=l(e,n,r);return(0,t.padV2)(e,[n[0]],o)},t.parsePadAttributesV11=e=>e.attributes.getString("mode","constant");const l=(e,t,n)=>{if(!e.session.isInitializer(t[1].dataId)||t.length>=3&&!e.session.isInitializer(t[2].dataId))throw new Error("dynamic pad attributes are not allowed");const o=Array.from(t[1].integerData),a=t.length>=3?t[2].floatData[0]:0;return(0,r.createAttributeWithCacheKey)({mode:n,pads:o,value:a})},u=(e,t,n)=>{const r=o.ShapeUtil.padShape(t.dims.slice(),n.pads),a=r.length,s=`\n ${f(e,t,n)}\n float process(int[${a}] indices) {\n return padA(indices);\n }`;return{name:"Pad",inputNames:["A"],inputTypes:[i.TextureType.unpacked],output:{dims:r,type:t.type,textureType:i.TextureType.unpacked},shaderSource:s}},c=e=>{if(!e||1!==e.length)throw new Error("Pad requires 1 input");if("float32"!==e[0].type&&"float64"!==e[0].type)throw new Error("Invalid input type.")},d=e=>{if(!e||2!==e.length&&3!==e.length)throw new Error("Pad requires 2 or 3 inputs");if("int32"!==e[1].type)throw new Error("Invalid input type.");if(e.length>=3&&"string"===e[2].type)throw new Error("Invalid input type.")},f=(e,t,n)=>{const r=(0,a.getGlsl)(e.session.backend.glContext.version),[s,l]=e.calculateTextureWidthAndHeight(t.dims,i.TextureType.unpacked),u=o.ShapeUtil.computeStrides(t.dims);switch(n.mode){case"constant":return p(r,t.dims,u,s,l,n.pads,n.value);case"reflect":return h(r,t.dims,u,s,l,n.pads);case"edge":return m(r,t.dims,u,s,l,n.pads);default:throw new Error("Invalid mode")}},p=(e,t,n,r,o,a,i)=>{const s=t.length;let l="";for(let u=s-1;u>=0;--u)l+=`\n k = m[${u}] - ${a[u]};\n if (k < 0) return constant;\n if (k >= ${t[u]}) return constant;\n offset += k * ${n[u]};\n `;return`\n float padA(int m[${s}]) {\n const float constant = float(${i});\n int offset = 0;\n int k = 0;\n ${l}\n vec2 coords = offsetToCoords(offset, ${r}, ${o});\n float value = getColorAsFloat(${e.texture2D}(A, coords));\n return value;\n }\n `},h=(e,t,n,r,o,a)=>{const i=t.length;let s="";for(let l=i-1;l>=0;--l)s+=`\n k = m[${l}] - ${a[l]};\n if (k < 0) { k = -k; }\n {\n const int _2n_1 = ${2*(t[l]-1)};\n k = int( mod( float(k), float(_2n_1) ) ) ;\n if(k >= ${t[l]}) { k = _2n_1 - k; }\n }\n offset += k * ${n[l]};\n `;return`\n float padA(int m[${i}]) {\n int offset = 0;\n int k = 0;\n ${s}\n vec2 coords = offsetToCoords(offset, ${r}, ${o});\n float value = getColorAsFloat(${e.texture2D}(A, coords));\n return value;\n }\n `},m=(e,t,n,r,o,a)=>{const i=t.length;let s="";for(let l=i-1;l>=0;--l)s+=`\n k = m[${l}] - ${a[l]};\n if (k < 0) k = 0;\n if (k >= ${t[l]}) k = ${t[l]-1};\n offset += k * ${n[l]};\n `;return`\n float padA(int m[${i}]) {\n int offset = 0;\n int k = 0;\n ${s}\n vec2 coords = offsetToCoords(offset, ${r}, ${o});\n float value = getColorAsFloat(${e.texture2D}(A, coords));\n return value;\n }\n `}},2143:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.globalMaxPool=t.parseMaxPoolAttributes=t.maxPool=t.parseGlobalAveragePoolAttributes=t.globalAveragePool=t.parseAveragePoolAttributes=t.averagePool=void 0;const r=n(246),o=n(2517),a=n(2039);t.averagePool=(e,t,n)=>{d(t);const r={name:"AveragePool",inputNames:["X"],inputTypes:[a.TextureType.unpacked],cacheHint:n.cacheKey};return[e.run(Object.assign(Object.assign({},r),{get:()=>i(t,r,!1,n)}),t)]},t.parseAveragePoolAttributes=e=>{const t=e.attributes.getString("auto_pad","NOTSET"),n=e.attributes.getInt("ceil_mode",0),o=0!==e.attributes.getInt("count_include_pad",0),a=e.attributes.getInts("kernel_shape"),i=e.attributes.getInts("strides",[]),s=e.attributes.getInts("pads",[]);if(0!==n)throw new Error("using ceil() in shape computation is not yet supported for AveragePool");return(0,r.createAttributeWithCacheKey)({autoPad:t,ceilMode:n,countIncludePad:o,kernelShape:a,strides:i,pads:s})};const i=(e,t,n,r)=>{const[i,s]=l(e,r,n),u=o.ShapeUtil.size(i.kernelShape);let c="";i.countIncludePad?c+=`value /= float(${u});`:c+=`value /= float(${u} - pad);`;const d=`\n ${f(e[0].dims,i,"value += _X(x);",c,"0.0")}\n `;return Object.assign(Object.assign({},t),{output:{dims:s,type:e[0].type,textureType:a.TextureType.unpacked},shaderSource:d})};t.globalAveragePool=(e,t,n)=>{d(t);const r={name:"GlobalAveragePool",inputNames:["X"],inputTypes:[a.TextureType.unpacked],cacheHint:`${n.countIncludePad}`};return[e.run(Object.assign(Object.assign({},r),{get:()=>i(t,r,!0,n)}),t)]},t.parseGlobalAveragePoolAttributes=e=>{const t=0!==e.attributes.getInt("count_include_pad",0);return(0,r.createAttributeWithCacheKey)({autoPad:"",ceilMode:0,countIncludePad:t,kernelShape:[],strides:[],pads:[]})},t.maxPool=(e,t,n)=>{d(t);const r={name:"MaxPool",inputNames:["X"],inputTypes:[a.TextureType.unpacked],cacheHint:n.cacheKey};return[e.run(Object.assign(Object.assign({},r),{get:()=>s(t,r,!1,n)}),t)]},t.parseMaxPoolAttributes=e=>{const t=e.attributes.getString("auto_pad","NOTSET"),n=e.attributes.getInt("ceil_mode",0),o=e.attributes.getInts("kernel_shape"),a=e.attributes.getInts("strides",[]),i=e.attributes.getInts("pads",[]),s=e.attributes.getInt("storage_order",0),l=e.attributes.getInts("dilations",[]);if(0!==s)throw new Error("column major storage order is not yet supported for MaxPool");if(0!==n)throw new Error("using ceil() in shape computation is not yet supported for MaxPool");return(0,r.createAttributeWithCacheKey)({autoPad:t,ceilMode:n,countIncludePad:!1,kernelShape:o,strides:a,pads:i,storageOrder:s,dilations:l})};const s=(e,t,n,r)=>{const[o,i]=l(e,r,n),s=`\n ${f(e[0].dims,o,"\n value = max(_X(x), value);\n ","","-1e5")}\n `;return Object.assign(Object.assign({},t),{output:{dims:i,type:e[0].type,textureType:a.TextureType.unpacked},shaderSource:s})},l=(e,t,n)=>{const r=e[0].dims.slice(),a=Object.hasOwnProperty.call(t,"dilations"),i=t.kernelShape.slice(),s=t.strides.slice(),l=a?t.dilations.slice():[],u=t.pads.slice();o.PoolConvUtil.adjustPoolAttributes(n,r,i,s,l,u);const c=o.PoolConvUtil.computePoolOutputShape(n,r,s,l,i,u,t.autoPad),d=Object.assign({},t);return a?Object.assign(d,{kernelShape:i,strides:s,pads:u,dilations:l,cacheKey:t.cacheKey}):Object.assign(d,{kernelShape:i,strides:s,pads:u,cacheKey:t.cacheKey}),[d,c]},u={autoPad:"",ceilMode:0,countIncludePad:!1,kernelShape:[],strides:[],pads:[],storageOrder:0,dilations:[],cacheKey:""},c={name:"GlobalMaxPool",inputNames:["X"],inputTypes:[a.TextureType.unpacked]};t.globalMaxPool=(e,t)=>(d(t),[e.run(Object.assign(Object.assign({},c),{get:()=>s(t,c,!0,u)}),t)]);const d=e=>{if(!e||1!==e.length)throw new Error("Pool ops requires 1 input.");if("float32"!==e[0].type&&"float64"!==e[0].type)throw new Error("Invalid input type.")},f=(e,t,n,r,a)=>{const i=e.length;if(t.kernelShape.length<=2){const o=t.kernelShape[t.kernelShape.length-1],s=t.strides[t.strides.length-1],l=t.pads[t.pads.length/2-1],u=t.pads[t.pads.length-1],c=e[i-1];let d="",f="",p="";if(d=l+u!==0?`\n for (int i = 0; i < ${o}; i++) {\n x[${i} - 1] = indices[${i} - 1] * ${s} - ${l} + i;\n if (x[${i} - 1] < 0 || x[${i} - 1] >= ${c}) {\n pad++;\n continue;\n }\n ${n}\n }`:`\n for (int i = 0; i < ${o}; i++) {\n x[${i} - 1] = indices[${i} - 1] * ${s} - ${l} + i;\n ${n}\n }`,2===t.kernelShape.length){const n=t.kernelShape[t.kernelShape.length-2],r=t.strides[t.strides.length-2],a=t.pads[t.pads.length/2-2],s=t.pads[t.pads.length-2],l=e[i-2];f=a+s!==0?`\n for (int j = 0; j < ${n}; j++) {\n x[${i} - 2] = indices[${i} - 2] * ${r} - ${a} + j;\n if (x[${i} - 2] < 0 || x[${i} - 2] >= ${l}) {\n pad+= ${o};\n continue;\n }\n `:`\n for (int j = 0; j < ${n}; j++) {\n x[${i} - 2] = indices[${i} - 2] * ${r} - ${a} + j;\n `,p="\n }\n "}return`\n float process(int indices[${i}]) {\n int x[${i}];\n copyVec(indices, x);\n\n float value = ${a};\n int pad = 0;\n ${f}\n ${d}\n ${p}\n ${r}\n return value;\n }\n `}{const s=o.ShapeUtil.size(t.kernelShape),l=o.ShapeUtil.computeStrides(t.kernelShape),u=l.length,c=t.pads.length,d=h(u),f=p(e,"inputDims"),m=p(t.pads,"pads"),g=p(l,"kernelStrides"),b=p(t.strides,"strides");let y="";return y=t.pads.reduce((e,t)=>e+t)?`\n if (x[j] >= inputDims[j] || x[j] < 0) {\n pad++;\n isPad = true;\n break;\n }\n }\n if (!isPad) {\n ${n}\n }`:`\n }\n ${n}\n `,`\n ${d}\n float process(int indices[${i}]) {\n int x[${i}];\n copyVec(indices, x);\n int offset[${u}];\n int pads[${c}];\n int inputDims[${i}];\n int kernelStrides[${u}];\n int strides[${u}];\n ${m}\n ${f}\n ${b}\n ${g}\n\n float value = ${a};\n int pad = 0;\n bool isPad = false;\n for (int i = 0; i < ${s}; i++) {\n offsetToIndices(i, kernelStrides, offset);\n isPad = false;\n for (int j = ${i} - ${u}; j < ${i}; j++) {\n x[j] = indices[j] * strides[j - ${i} + ${u}]\n + offset[j - ${i} + ${u}] - pads[j - 2];\n ${y}\n }\n ${r}\n\n return value;\n }\n `}},p=(e,t)=>{let n="";for(let r=0;r<e.length;r++)n+=`\n ${t}[${r}] = ${e[r]};\n `;return n},h=e=>`\n void offsetToIndices(int offset, int[${e}] strides, out int[${e}] indices) {\n if (${e} == 0) {\n return;\n }\n for (int i = 0; i < ${e} - 1; ++i) {\n indices[i] = offset / strides[i];\n offset -= indices[i] * strides[i];\n }\n indices[${e} - 1] = offset;\n }`},4939:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.reduceLogSumSquare=t.reduceLogSum=t.reduceProd=t.reduceMin=t.reduceMax=t.reduceMean=t.reduceSum=t.parseReduceAttributes=void 0;const r=n(246),o=n(782),a=n(2517),i=n(2039),s=(e,t,n,r,o)=>{u(t);const a={name:r,inputNames:["A"],inputTypes:[i.TextureType.unpacked]};return[e.run(Object.assign(Object.assign({},a),{cacheHint:n.cacheKey,get:()=>l(e,t,n,r,o,a)}),t)]};t.parseReduceAttributes=e=>{const t=e.attributes.getInts("axes",[]),n=1===e.attributes.getInt("keepdims",1);return(0,r.createAttributeWithCacheKey)({axes:t,keepDims:n})};const l=(e,t,n,r,o,s)=>{const l=[],u=t[0].dims.length||1,c=[],d=a.ShapeUtil.normalizeAxes(n.axes,t[0].dims.length),f=o(t,d);let p=f[1];for(let a=0;a<t[0].dims.length;a++)d.indexOf(a)>=0||0===d.length?(n.keepDims&&l.push(1),p=`\n for(int j${a} = 0; j${a} < ${t[0].dims[a]}; j${a}++) {\n inputIdx[${a}] = j${a};\n ${p}\n }`):(c.push(`inputIdx[${a}] = outputIdx[${l.length}];`),l.push(t[0].dims[a]));const h=`\n float process(int outputIdx[${l.length||1}]) {\n float value; // final result\n int inputIdx[${u}]; // addressing input data\n ${c.join("\n")}\n ${f[0]} // init ops for reduce max/min\n ${p}\n ${f[2]} // final computation for reduce mean\n return value;\n }`;return Object.assign(Object.assign({},s),{output:{dims:l,type:t[0].type,textureType:i.TextureType.unpacked},shaderSource:h})},u=e=>{if(!e||1!==e.length)throw new Error("Reduce op requires 1 input.");if(-1===o.NUMBER_TYPES.indexOf(e[0].type))throw new Error("Invalid input type.")};t.reduceSum=(e,t,n)=>s(e,t,n,"ReduceSum",()=>["value = 0.0;","value += _A(inputIdx);",""]),t.reduceMean=(e,t,n)=>s(e,t,n,"ReduceMean",(e,t)=>{let n=1;for(let r=0;r<e[0].dims.length;r++)(t.indexOf(r)>=0||0===t.length)&&(n*=e[0].dims[r]);return["value = 0.0;","value += _A(inputIdx);",`value /= ${n}.;`]}),t.reduceMax=(e,t,n)=>s(e,t,n,"ReduceMax",(e,t)=>{const n=[];for(let r=0;r<e[0].dims.length;r++)(t.indexOf(r)>=0||0===t.length)&&n.push(`inputIdx[${r}] = 0;`);return[`${n.join("\n")}\nvalue = _A(inputIdx);`,"value = max(value, _A(inputIdx));",""]}),t.reduceMin=(e,t,n)=>s(e,t,n,"ReduceMin",(e,t)=>{const n=[];for(let r=0;r<e[0].dims.length;r++)(t.indexOf(r)>=0||0===t.length)&&n.push(`inputIdx[${r}] = 0;`);return[`${n.join("\n")}\nvalue = _A(inputIdx);`,"value = min(value, _A(inputIdx));",""]}),t.reduceProd=(e,t,n)=>s(e,t,n,"ReduceProd",()=>["value = 1.0;","value *= _A(inputIdx);",""]),t.reduceLogSum=(e,t,n)=>s(e,t,n,"ReduceLogSum",()=>["value = 0.0;","value += _A(inputIdx);","value = log(value);"]),t.reduceLogSumSquare=(e,t,n)=>s(e,t,n,"ReduceLogSumSquare",()=>["float t; value = 0.0;","t = _A(inputIdx); value += t * t;",""])},7019:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isReshapeCheap=t.processDims3D=t.createPackedReshape3DProgramInfoLoader=void 0;const r=n(2517),o=n(5060),a=n(2039),i=n(2827);t.createPackedReshape3DProgramInfoLoader=(e,t,n)=>{const s=(l=n,{name:"Reshape (packed)",inputTypes:[a.TextureType.packed],inputNames:["A"],cacheHint:`${l}`});var l;return Object.assign(Object.assign({},s),{get:()=>((e,t,n,s)=>{const l=t.dims,u=s;let c="";for(let r=0;r<4;r++){let e="";switch(r){case 0:e="outputCoords = rc;";break;case 1:e="outputCoords = ivec3(rc.x, rc.y+1, rc.z);";break;case 2:e="outputCoords = ivec3(rc.x, rc.y, rc.z+1);";break;case 3:e="outputCoords = ivec3(rc.x, rc.y+1, rc.z+1);";break;default:throw new Error}c+=`\n ${e}\n ${r>0?"if(outputCoords.y < rows && outputCoords.z < cols){":""}\n int flattenedIndex = getFlattenedIndex(outputCoords);\n\n ivec3 inputRC = inputCoordsFromReshapedOutCoords(flattenedIndex);\n vec2 innerDims = vec2(float(inputRC.y),float(inputRC.z));\n\n result[${r}] = getChannel(getA(inputRC.x, inputRC.y, inputRC.z), innerDims);\n\n ${r>0?"}":""}\n `}const d=(0,o.getGlsl)(e.session.backend.glContext.version),f=`\n ${function(e){const t=r.ShapeUtil.computeStrides(e),n=["b","r","c"],o="index";return`\n ivec3 inputCoordsFromReshapedOutCoords(int index) {\n ${t.map((e,r)=>`int ${n[r]} = ${o} / ${e}; ${r===t.length-1?`int ${n[r+1]} = ${o} - ${n[r]} * ${e}`:`index -= ${n[r]} * ${e}`};`).join("")}\n return ivec3(b, r, c);\n }\n `}(l)}\n ${function(e){const t=r.ShapeUtil.computeStrides(e);return`\n int getFlattenedIndex(ivec3 coords) {\n // reverse y, z order\n return coords.x * ${t[0]} + coords.z * ${t[1]} + coords.y;\n }\n`}(u)}\n ${(0,i.unpackFromChannel)()}\n\n void main() {\n ivec3 rc = getOutputCoords();\n\n vec4 result = vec4(0.0);\n\n ivec3 outputCoords;\n int rows = ${u[2]};\n int cols = ${u[1]};\n\n ${c}\n ${d.output} = result;\n }\n `;return Object.assign(Object.assign({},n),{output:{dims:u,type:t.type,textureType:a.TextureType.packed},shaderSource:f,hasMain:!0})})(e,t,s,n)})},t.processDims3D=function(e){if(0===e.length)return[1,1,1];let t=1;for(let n=0;n<e.length-2;++n)t*=e[n];return[t,e.length>1?e[e.length-2]:1,e[e.length-1]]},t.isReshapeCheap=function(e,t){let n=!1;return n=0===e.length||0===t.length||(e.length<2||t.length<2?e[e.length-1]===t[t.length-1]:e[e.length-1]===t[t.length-1]&&e[e.length-2]===t[t.length-2]),n}},718:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.reshape=void 0;const r=n(2517);t.reshape=(e,t)=>{const n=r.ShapeUtil.calculateReshapedDims(t[0].dims,t[1].integerData);return e.session.pack?[e.reshapePacked(t[0],n)]:[e.reshapeUnpacked(t[0],n)]}},2268:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseResizeAttributesV11=t.parseResizeAttributesV10=t.resize=void 0;const r=n(5060),o=n(2039),a=n(9390),i=n(2827),s=n(9793),l={name:"Resize",inputNames:["A"],inputTypes:[o.TextureType.packed]};t.resize=(e,t,n)=>((0,s.validateInputs)(t,n),[e.run(Object.assign(Object.assign({},l),{cacheHint:n.cacheKey,get:()=>u(e,t,n)}),t)]),t.parseResizeAttributesV10=e=>(0,s.parseUpsampleAttributes)(e,10),t.parseResizeAttributesV11=e=>(0,s.parseUpsampleAttributes)(e,11);const u=(e,t,n)=>{const s=(0,r.getGlsl)(e.session.backend.glContext.version),[u,d]=c(t,n);if(u.every(e=>1===e)&&"tf_crop_and_resize"!==n.coordinateTransformMode)return Object.assign(Object.assign({},l),{output:{dims:d,type:t[0].type,textureType:o.TextureType.packed},hasMain:!0,shaderSource:`void main() {\n vec4 v = ${s.texture2D}(X, TexCoords);\n ${s.output} = v;\n }`});const f=d.length;if(f<2)throw new Error(`output dimension should be at least 2, but got ${f}`);const p=d[f-2],h=d[f-1],m=t[0].dims;if(f!==m.length)throw new Error(`output dimension should match input ${m.length}, but got ${f}`);const g=m[f-2],b=m[f-1],y=u[f-2],_=u[f-1];let v="";if("linear"!==n.mode)throw new Error(`resize (packed) does not support mode: '${n.mode}'`);switch(n.coordinateTransformMode){case"asymmetric":v="\n vec4 getSourceFracIndex(ivec4 coords) {\n return vec4(coords) / scaleWHWH;\n }\n ";break;case"half_pixel":v="\n vec4 getSourceFracIndex(ivec4 coords) {\n return (vec4(coords) + 0.5) / scaleWHWH - 0.5;\n }\n ";break;case"pytorch_half_pixel":v=`\n vec4 getSourceFracIndex(ivec4 coords) {\n vec4 fcoords = vec4(coords);\n return vec4(\n ${h}.0 > 1.0 ? (fcoords.x + 0.5) / scaleWHWH.x - 0.5 : 0.0,\n ${p}.0 > 1.0 ? (fcoords.y + 0.5) / scaleWHWH.y - 0.5 : 0.0,\n ${h}.0 > 1.0 ? (fcoords.z + 0.5) / scaleWHWH.z - 0.5 : 0.0,\n ${p}.0 > 1.0 ? (fcoords.w + 0.5) / scaleWHWH.w - 0.5 : 0.0\n );\n }\n `;break;case"align_corners":v=`\n vec4 getSourceFracIndex(ivec4 coords) {\n vec4 resized = vec4(${h}.0 - 1.0, ${p}.0 - 1.0, ${h}.0 - 1.0,\n ${p}.0 - 1.0);\n vec4 original = vec4(${b}.0 - 1.0, ${g}.0 - 1.0, ${b}.0 - 1.0,\n ${g}.0 - 1.0);\n vec4 new_scale = original / resized;\n return vec4(coords) * new_scale;\n }\n `;break;default:throw new Error(`resize (packed) does not support coordinateTransformMode: '${n.coordinateTransformMode}'`)}const w=(0,a.getCoordsDataType)(f),S=`\n const vec2 inputWH = vec2(${g}.0, ${b}.0);\n const vec4 scaleWHWH = vec4(float(${y}), float(${_}), float(${y}), float(${_}));\n ${(0,i.unpackFromChannel)()}\n ${v}\n float getAValue(int x10, int r, int c, int d) {\n return getChannel(getA(x10, r, c, d), vec2(c, d));\n }\n void main() {\n ${w} rc = getOutputCoords();\n\n int batch = rc[0];\n int depth = rc[1];\n\n // retrieve the 4 coordinates that is used in the 4 packed output values.\n ivec4 coords = ivec4(rc.wz, rc.w + 1, rc.z + 1);\n\n // calculate the source index in fraction\n vec4 sourceFrac = getSourceFracIndex(coords);\n\n // get the lower and upper bound of the 4 values that will be packed into one texel.\n ivec4 x00 = ivec4(max(sourceFrac.xy, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.xy)));\n ivec4 x01 = ivec4(max(sourceFrac.xw, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.xw)));\n ivec4 x10 = ivec4(max(sourceFrac.zy, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.zy)));\n ivec4 x11 = ivec4(max(sourceFrac.zw, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.zw)));\n\n bool hasNextRow = rc.w < ${p-1};\n bool hasNextCol = rc.z < ${h-1};\n\n // pack x00, x01, x10, x11's top-left corner into one vec4 structure\n vec4 topLeft = vec4(\n getAValue(batch, depth, x00.x, x00.y),\n hasNextCol ? getAValue(batch, depth, x01.x, x01.y) : 0.0,\n hasNextRow ? getAValue(batch, depth, x10.x, x10.y) : 0.0,\n (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.x, x11.y) : 0.0);\n\n // pack x00, x01, x10, x11's top-right corner into one vec4 structure\n vec4 topRight = vec4(\n getAValue(batch, depth, x00.x, x00.w),\n hasNextCol ? getAValue(batch, depth, x01.x, x01.w) : 0.0,\n hasNextRow ? getAValue(batch, depth, x10.x, x10.w) : 0.0,\n (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.x, x11.w) : 0.0);\n\n // pack x00, x01, x10, x11's bottom-left corner into one vec4 structure\n vec4 bottomLeft = vec4(\n getAValue(batch, depth, x00.z, x00.y),\n hasNextCol ? getAValue(batch, depth, x01.z, x01.y) : 0.0,\n hasNextRow ? getAValue(batch, depth, x10.z, x10.y) : 0.0,\n (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.z, x11.y) : 0.0);\n\n // pack x00, x01, x10, x11's bottom-right corner into one vec4 structure\n vec4 bottomRight = vec4(\n getAValue(batch, depth, x00.z, x00.w),\n hasNextCol ? getAValue(batch, depth, x01.z, x01.w) : 0.0,\n hasNextRow ? getAValue(batch, depth, x10.z, x10.w) : 0.0,\n (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.z, x11.w) : 0.0);\n\n // calculate the interpolation fraction on u and v direction\n vec4 frac = vec4(sourceFrac) - floor(sourceFrac);\n vec4 clampFrac = clamp(frac, vec4(0.0), vec4(1.0));\n\n vec4 top = mix(topLeft, topRight, clampFrac.ywyw);\n vec4 bottom = mix(bottomLeft, bottomRight, clampFrac.ywyw);\n vec4 newValue = mix(top, bottom, clampFrac.xxzz);\n\n ${s.output} = vec4(newValue);\n }\n `;return Object.assign(Object.assign({},l),{output:{dims:d,type:t[0].type,textureType:o.TextureType.packed},hasMain:!0,shaderSource:S})},c=(e,t)=>{const n=e[0].dims;let r,o=t.scales;if(0===o.length){const a=e[t.scalesInputIdx];if(a&&0!==a.size){if(e[t.sizesInputIdx])throw new Error("Only one of scales or sizes must be provided as input.");o=d(a,t.mode,t.isResize)}else{const a=e[t.sizesInputIdx];if(!a||0===a.size)throw new Error("Either scales or sizes MUST be provided as input.");r=Array.from(a.integerData),o=f(r,n,t.mode,t.isResize)}}else if(e[t.sizesInputIdx])throw new Error("Only one of scales or sizes must be provided as input.");const a=r||n.map((e,t)=>Math.floor(e*o[t]));return[o,a]},d=(e,t,n)=>{const r=Array.from(e.floatData);return(0,s.scalesValidation)(r,t,n),r},f=(e,t,n,r)=>{const o=t.length,a=new Array(o);for(let i=0,s=o;i<s;i++)if(0===t[i]){if(0!==e[i])throw new Error("Input dim is zero but required output dim is non-zero.");a[i]=1}else a[i]=e[i]/t[i];return(0,s.scalesValidation)(a,n,r),a}},8117:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.shape=void 0;const r=n(9162);t.shape=(e,t)=>(o(t),[new r.Tensor([t[0].dims.length],"int32",void 0,void 0,new Int32Array(t[0].dims))]);const o=e=>{if(!e||1!==e.length)throw new Error("Shape requires 1 input.")}},2278:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.sliceV10=t.parseSliceAttributes=t.slice=void 0;const r=n(246),o=n(782),a=n(2517),i=n(2039),s={name:"Slice",inputNames:["A"],inputTypes:[i.TextureType.unpacked]};t.slice=(e,t,n)=>(u(t),[e.run(Object.assign(Object.assign({},s),{cacheHint:n.cacheKey,get:()=>l(e,t[0],n)}),t)]),t.parseSliceAttributes=e=>{const t=e.attributes.getInts("starts"),n=e.attributes.getInts("ends"),o=e.attributes.getInts("axes",[]);return(0,r.createAttributeWithCacheKey)({starts:t,ends:n,axes:o})};const l=(e,t,n)=>{const r=0===n.axes.length?t.dims.slice(0).map((e,t)=>t):n.axes,o=a.ShapeUtil.normalizeAxes(r,t.dims.length),l=n.starts.map((e,n)=>e>t.dims[o[n]]-1?t.dims[o[n]]:a.ShapeUtil.normalizeAxis(e,t.dims[o[n]])),u=n.ends.map((e,n)=>e>t.dims[o[n]]-1?t.dims[o[n]]:a.ShapeUtil.normalizeAxis(e,t.dims[o[n]])),c=t.dims.slice(),d=[];for(let a=0;a<o.length;a++)c[o[a]]=u[a]-l[a],l[a]>0&&d.push(`outputIdx[${o[a]}] += ${l[a]};`);const f=`\n float process(int outputIdx[${c.length}]) {\n ${d.join("\n ")}\n return _A(outputIdx);\n }`;return Object.assign(Object.assign({},s),{output:{dims:c,type:t.type,textureType:i.TextureType.unpacked},shaderSource:f})},u=e=>{if(!e||1!==e.length)throw new Error("Slice requires 1 input.");if(-1===o.NUMBER_TYPES.indexOf(e[0].type))throw new Error("Invalid input type.")};t.sliceV10=(e,t)=>{d(t);const n=c(e,t);return[e.run(Object.assign(Object.assign({},s),{cacheHint:n.cacheKey,get:()=>l(e,t[0],n)}),[t[0]])]};const c=(e,t)=>{if(!e.session.isInitializer(t[1].dataId)||!e.session.isInitializer(t[2].dataId)||t.length>=4&&!e.session.isInitializer(t[3].dataId)||t.length>=5&&!e.session.isInitializer(t[4].dataId))throw new Error("dynamic slice attributes are not allowed");if(t.length>=5&&t[4].integerData.some(e=>1!==e))throw new Error("currently non-1 steps is not supported for Slice");const n=Array.from(t[1].integerData),r=Array.from(t[2].integerData),o=t.length>=4?Array.from(t[3].integerData):[];return{starts:n,ends:r,axes:o,cacheKey:`${o};${n};${r}`}},d=e=>{if(!e||e.length<3||e.length>5)throw new Error("Invalid input number.");if("int32"!==e[1].type||1!==e[1].dims.length)throw new Error("Invalid input type.");if("int32"!==e[2].type||1!==e[2].dims.length)throw new Error("Invalid input type.");if(e.length>=4&&("int32"!==e[3].type||1!==e[3].dims.length))throw new Error("Invalid input type.");if(e.length>=5&&("int32"!==e[4].type||1!==e[4].dims.length))throw new Error("Invalid input type.")}},5524:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.softmaxV13=t.parseSoftmaxAttributesV13=t.parseSoftmaxAttributes=t.softmax=void 0;const r=n(246),o=n(2517),a=n(5060),i=n(2039),s=n(3738),l={name:"SoftmaxComputeMax",inputNames:["A"],inputTypes:[i.TextureType.unpacked]},u={name:"SoftmaxComputeScale",inputNames:["A","Max"],inputTypes:[i.TextureType.unpacked,i.TextureType.unpacked]},c={name:"SoftMax",inputNames:["A","Max","Norm"],inputTypes:[i.TextureType.unpacked,i.TextureType.unpacked,i.TextureType.unpacked]};t.softmax=(e,t,n)=>{m(t);const r=t[0].dims.slice(),a=o.ShapeUtil.normalizeAxis(n.axis,r.length),i=o.ShapeUtil.sizeToDimension(r,a),s=o.ShapeUtil.sizeFromDimension(r,a);return d(e,t,n,i,s)},t.parseSoftmaxAttributes=e=>(0,r.createAttributeWithCacheKey)({axis:e.attributes.getInt("axis",1)}),t.parseSoftmaxAttributesV13=e=>(0,r.createAttributeWithCacheKey)({axis:e.attributes.getInt("axis",-1)}),t.softmaxV13=(e,t,n)=>{m(t);const a=t[0].dims.slice(),i=o.ShapeUtil.normalizeAxis(n.axis,a.length),l=a.length,u=i!==l-1,c=[];let f,p=[],h=[];u&&(p=Array.from({length:l}).map((e,t)=>t),p[i]=l-1,p[l-1]=i,p.map(e=>c.push(a[e])),f=(0,r.createAttributeWithCacheKey)({perm:p}),h=(0,s.transpose)(e,t,f));const g=u?o.ShapeUtil.sizeToDimension(c,l-1):o.ShapeUtil.sizeToDimension(a,l-1),b=u?o.ShapeUtil.sizeFromDimension(c,l-1):o.ShapeUtil.sizeFromDimension(a,l-1),y=d(e,u?h:t,n,g,b);return u?(0,s.transpose)(e,y,f):y};const d=(e,t,n,r,o)=>{const a=f(e,t[0],r,o,[r]),i=e.run(Object.assign(Object.assign({},l),{cacheHint:n.cacheKey,get:()=>a}),t),s=p(e,t[0],r,o,a.output.dims,[r]),d=e.run(Object.assign(Object.assign({},u),{cacheHint:n.cacheKey,get:()=>s}),[t[0],i]),m=h(e,t[0],r,o,a.output.dims,s.output.dims);return[e.run(Object.assign(Object.assign({},c),{cacheHint:n.cacheKey,get:()=>m}),[t[0],i,d])]},f=(e,t,n,r,o)=>{const[s,u]=e.calculateTextureWidthAndHeight(t.dims,i.TextureType.unpacked),c=o.length;if(n<1||r<1)throw new Error("Logical row count N and feature count D must be greater than or equal to 1");if(1!==o.length)throw new Error("Dimensionality of the output should be 1");if(o[0]!==n)throw new Error("Shape of the output should be equal to logical row count");const d=(0,a.getGlsl)(e.session.backend.glContext.version),f=`\n float process(int[${c}] indices) {\n int logical_row_start_offset = indices[0] * ${r};\n\n float max = getColorAsFloat(${d.texture2D}(A, offsetToCoords(logical_row_start_offset, ${s},\n ${u} )));\n for(int i=1; i<${r}; ++i)\n {\n float current = getColorAsFloat(${d.texture2D}(A, offsetToCoords(logical_row_start_offset + i,\n ${s}, ${u})));\n if(current > max)\n max = current;\n }\n\n return max;\n }`;return Object.assign(Object.assign({},l),{output:{dims:o,type:t.type,textureType:i.TextureType.unpacked},shaderSource:f})},p=(e,t,n,r,o,s)=>{const[l,c]=e.calculateTextureWidthAndHeight(t.dims,i.TextureType.unpacked),d=s.length;if(n<1||r<1)throw new Error("Logical row count N and feature count D must be greater than or equal to 1");if(1!==s.length)throw new Error("Dimensionality of the output should be 1");if(s[0]!==n)throw new Error("Shape of the output should be equal to logical row count");if(1!==o.length)throw new Error("Dimensionality of the intermediate results should be 1");if(o[0]!==n)throw new Error("Shape of the intermediate results should be equal to logical row count");const f=`\n float process(int[${d}] indices) {\n int logical_row_start_offset = indices[0] * ${r};\n\n float norm_factor = 0.0;\n float max = _Max(indices);\n for(int i=0; i<${r}; ++i)\n {\n norm_factor += exp(getColorAsFloat(${(0,a.getGlsl)(e.session.backend.glContext.version).texture2D}(A, offsetToCoords(logical_row_start_offset + i,\n ${l}, ${c}))) - max);\n }\n\n return norm_factor;\n }`;return Object.assign(Object.assign({},u),{output:{dims:s,type:t.type,textureType:i.TextureType.unpacked},shaderSource:f})},h=(e,t,n,r,o,a)=>{const[s,l]=e.calculateTextureWidthAndHeight(t.dims,i.TextureType.unpacked),u=t.dims.length;if(n<1||r<1)throw new Error("Logical row count N and feature count D must be greater than or equal to 1");if(1!==o.length||1!==a.length)throw new Error("Dimensionality of the intermediate results should be 1");if(o[0]!==n||a[0]!==n)throw new Error("Shape of the intermediate results should be equal to logical row count");const d=`\n float process(int[${u}] indices) {\n\n // get offset of current logical tensor index from the 2-D texture coordinates (TexCoords)\n int offset = coordsToOffset(TexCoords, ${s}, ${l});\n\n //determine the logical row for this index\n int logical_row_index[1];\n logical_row_index[0] = offset / ${r};\n\n float norm_factor = _Norm(logical_row_index);\n\n // avoid possible division by 0\n // if norm_facor is 0, all elements are zero\n // if so, return 0\n if(norm_factor == 0.0)\n return 0.0;\n\n return exp(_A(indices) - _Max(logical_row_index)) / norm_factor;\n }`;return Object.assign(Object.assign({},c),{output:{dims:t.dims,type:t.type,textureType:i.TextureType.unpacked},shaderSource:d})},m=e=>{if(!e||1!==e.length)throw new Error("Softmax requires 1 input.");if("float32"!==e[0].type&&"float64"!==e[0].type)throw new Error("Invalid input type")}},5975:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseSplitAttributes=t.split=void 0;const r=n(246),o=n(2517),a=n(2039),i={name:"Split",inputNames:["A"],inputTypes:[a.TextureType.unpacked]};t.split=(e,t,n)=>{u(t);const r=o.ShapeUtil.normalizeAxis(n.axis,t[0].dims.length),a=s(e,t,r,n),c=[];for(let o=0;o<a;++o)c.push(e.run(Object.assign(Object.assign({},i),{cacheHint:`${n.cacheKey};${o}`,get:()=>l(e,t[0],n,r,o)}),t));return c},t.parseSplitAttributes=e=>{const t=e.attributes.getInt("axis",0),n=e.attributes.getInts("split",[]),o=e.outputs.length;return(0,r.createAttributeWithCacheKey)({axis:t,split:n,numOutputs:o})};const s=(e,t,n,r)=>{const[,a]=o.SplitUtil.splitShape(t[0].dims,n,r.split,r.numOutputs);return a.length},l=(e,t,n,r,s)=>{const[l,u]=o.SplitUtil.splitShape(t.dims,r,n.split,n.numOutputs),c=u[s],d=l[s],f=`\n float process(int indices[${d.length}]) {\n indices[${r}] += ${c};\n return _A(indices);\n }\n `;return Object.assign(Object.assign({},i),{cacheHint:`${n.cacheKey}:${s}`,output:{dims:d,type:t.type,textureType:a.TextureType.unpacked},shaderSource:f})},u=e=>{if(!e||1!==e.length)throw new Error("Split requires one input.");if("int8"!==e[0].type&&"uint8"!==e[0].type&&"int16"!==e[0].type&&"uint16"!==e[0].type&&"int32"!==e[0].type&&"uint32"!==e[0].type&&"float32"!==e[0].type&&"float64"!==e[0].type&&"bool"!==e[0].type)throw new Error("Invalid input type.")}},3933:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseSqueezeAttributes=t.squeezeV13=t.squeeze=void 0;const r=n(2517);t.squeeze=(e,t,n)=>{o(t);const a=r.ShapeUtil.squeezeShape(t[0].dims,n);return[e.reshapeUnpacked(t[0],a)]},t.squeezeV13=(e,n)=>(a(n),(0,t.squeeze)(e,[n[0]],Array.from(n[1].integerData))),t.parseSqueezeAttributes=e=>e.attributes.getInts("axes");const o=e=>{if(!e||1!==e.length)throw new Error("Squeeze requires 1 input.");if("string"===e[0].type)throw new Error("invalid input tensor types.")},a=e=>{if(!e||2!==e.length)throw new Error("Squeeze requires 2 inputs.");if("int32"!==e[1].type)throw new Error("Invalid input type.")}},6558:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.sum=void 0;const r=n(5060),o=n(2039);t.sum=(e,t)=>{i(t);const n={name:"Sum",inputNames:t.map((e,t)=>`X${t}`),inputTypes:new Array(t.length).fill(o.TextureType.unpacked)};return[e.run(Object.assign(Object.assign({},n),{get:()=>a(e,t,n)}),t)]};const a=(e,t,n)=>{const a=(0,r.getGlsl)(e.session.backend.glContext.version),i=t[0].dims.slice(),s=`\n void main() {\n vec4 result = ${t.map((e,t)=>`${a.texture2D}(X${t},TexCoords)`).join(" + ")};\n ${a.output} = result;\n }\n `;return Object.assign(Object.assign({},n),{output:{dims:i,type:t[0].type,textureType:o.TextureType.unpacked},hasMain:!0,shaderSource:s})},i=e=>{if(!e||0===e.length)throw new Error("Sum requires inputs.");const t=e[0].dims.length;for(let n=1;n<e.length;n++){if(t!==e[n].dims.length)throw new Error("Input shapes are mismatched.");for(let r=0;r<t;r++)if(e[0].dims[r]!==e[n].dims[r])throw new Error("Input shapes are not matched.")}if("float32"!==e[0].type&&"float64"!==e[0].type)throw new Error("Invalid input type.");for(let n=1;n<e.length;n++)if(e[0].type!==e[n].type)throw new Error("Input types are not matched.")}},5723:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.tile=void 0;const r=n(782),o=n(2039);t.tile=(e,t)=>{i(t);const n={name:"Tile",inputNames:["A"],inputTypes:[o.TextureType.unpacked]};return[e.run(Object.assign(Object.assign({},n),{get:()=>a(e,t,n)}),t)]};const a=(e,t,n)=>{const r=t[0].dims.slice(),a=new Array(r.length),i=[];for(let o=0;o<r.length;o++)a[o]=r[o]*t[1].numberData[o],i.push(`inputIdx[${o}] = int(mod(float(outputIdx[${o}]), ${r[o]}.));`);const s=a.length,l=`\n float process(int outputIdx[${s}]) {\n int inputIdx[${s}];\n ${i.join("\n")}\n return _A(inputIdx);\n }\n `;return Object.assign(Object.assign({},n),{output:{dims:a,type:t[0].type,textureType:o.TextureType.unpacked},shaderSource:l})},i=e=>{if(!e||2!==e.length)throw new Error("Tile requires 2 input.");if(1!==e[1].dims.length)throw new Error("The second input shape must 1 dimension.");if(e[1].dims[0]!==e[0].dims.length)throw new Error("Invalid input shape.");if(-1===r.NUMBER_TYPES.indexOf(e[0].type))throw new Error("Invalid input type.");if("int32"!==e[1].type&&"int16"!==e[1].type)throw new Error("Invalid repeat type.")}},3738:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseTransposeAttributes=t.transpose=void 0;const r=n(246),o=n(2517),a=n(2039),i={name:"Transpose",inputNames:["A"],inputTypes:[a.TextureType.unpacked]};t.transpose=(e,t,n)=>(d(t),[e.run(Object.assign(Object.assign({},i),{cacheHint:n.cacheKey,get:()=>s(e,t[0],n.perm)}),t)]),t.parseTransposeAttributes=e=>(0,r.createAttributeWithCacheKey)({perm:e.attributes.getInts("perm",[])});const s=(e,t,n)=>{const r=t.dims;n=l(r,n);const o=u(r,n),s=r.length,d=`\n ${c("perm",n,s)}\n float process(int indices[${s}]) {\n int a[${s}];\n perm(a, indices);\n return _A(a);\n }`;return Object.assign(Object.assign({},i),{output:{dims:o,type:t.type,textureType:a.TextureType.unpacked},shaderSource:d})},l=(e,t)=>(t&&t.length!==e.length&&(t=[...e.keys()].reverse()),t),u=(e,t)=>(t=l(e,t),o.ShapeUtil.sortBasedOnPerm(e,t)),c=(e,t,n)=>{const r=[];r.push(`void ${e}(out int a[${n}], int src[${n}]) {`);for(let o=0;o<n;++o)r.push(`\ta[${t[o]}]=src[${o}];`);return r.push("\t}"),r.join("\n")},d=e=>{if(!e||1!==e.length)throw new Error("Transpose requires 1 input.");if("float32"!==e[0].type&&"float64"!==e[0].type)throw new Error("input should be float tensor")}},8710:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.encodeAsUint8=void 0;const r=n(5060),o=n(2039);t.encodeAsUint8=(e,t)=>{const n=t.shape,a=(0,r.getGlsl)(e.session.backend.glContext.version),i=`\n const float FLOAT_MAX = 1.70141184e38;\n const float FLOAT_MIN = 1.17549435e-38;\n\n bool isNaN(float val) {\n return (val < 1.0 || 0.0 < val || val == 0.0) ? false : true;\n }\n\n highp vec4 encodeAsUint8(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\n void main() {\n float value = ${a.texture2D}(X,TexCoords).r;\n ${a.output} = encodeAsUint8(value);\n }`,s={name:"Uint8Encode",inputTypes:[o.TextureType.unpacked],inputNames:["X"],output:{dims:n,type:t.tensor.type,textureType:o.TextureType.downloadUint8AsFloat},shaderSource:i,hasMain:!0};return e.executeProgram(s,[t.tensor])}},4909:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.tanh=t.tan=t.sqrt=t.sin=t.sigmoid=t.relu=t.not=t.neg=t.log=t.parseLeakyReluAttributes=t.leakyRelu=t.identity=t.floor=t.exp=t.parseEluAttributes=t.elu=t.cos=t.ceil=t.clipV11=t.parseClipAttributes=t.clip=t.atan=t.asin=t.acos=t.abs=t.glslTanh=t.glslTan=t.glslSqrt=t.glslSigmoid=t.glslRelu=t.glslSin=t.glslNot=t.glslNeg=t.glslLog=t.glslLeakyRelu=t.glslIdentity=t.glslClip=t.glslFloor=t.glslExp=t.glslElu=t.glslCos=t.glslCeil=t.glslAtan=t.glslAsin=t.glslAcos=t.glslAbs=void 0;const r=n(246),o=n(2517),a=n(8520),i=n(5060),s=n(2039);function l(){return A("abs")}function u(){return A("acos")}function c(){return A("asin")}function d(){return A("atan")}function f(){return A("ceil")}function p(){return A("cos")}function h(e){const t="elu";return{body:`\n const float alpha = float(${e});\n\n float ${t}_(float a) {\n return a >= 0.0 ? a: (exp(a) - 1.0) * alpha;\n }\n vec4 ${t}_(vec4 v) {\n return vec4(${t}_(v.x), ${t}_(v.y), ${t}_(v.z), ${t}_(v.w));\n }\n `,name:t,type:a.FunctionType.ValueBased}}function m(){return A("exp")}function g(){return A("floor")}function b(e,t){const n="clip";return{body:`\n const float min = float(${e});\n const float max = float(${t});\n\n float ${n}_(float a) {\n return clamp(a, min, max);\n }\n vec4 ${n}_(vec4 v) {\n return clamp(v, min, max);\n }\n `,name:n,type:a.FunctionType.ValueBased}}function y(){const e="indentity";return{body:`\n float ${e}_(float a) {\n return a;\n }\n vec4 ${e}_(vec4 v) {\n return v;\n }\n `,name:e,type:a.FunctionType.ValueBased}}function _(e){const t="leakyRelu";return{body:`\n const float alpha = float(${e});\n\n float ${t}_(float a) {\n return a < 0.0 ? a * alpha : a;\n }\n vec4 ${t}_(vec4 v) {\n return vec4(${t}_(v.x), ${t}_(v.y), ${t}_(v.z), ${t}_(v.w));\n }\n `,name:t,type:a.FunctionType.ValueBased}}function v(){return A("log")}function w(){const e="neg";return{body:`\n float ${e}_(float a) {\n return -a;\n }\n vec4 ${e}_(vec4 v) {\n return -v;\n }\n `,name:e,type:a.FunctionType.ValueBased}}function S(){const e="not";return{body:`\n float ${e}_(float a) {\n return float( ! bool(a) );\n }\n bool ${e}_(bool a) {\n return !a;\n }\n vec4 ${e}_(vec4 v) {\n return vec4(!bool(v.x), !bool(v.y), !bool(v.z), !bool(v.w));\n }\n bvec4 ${e}_(bvec4 v) {\n return bvec4(!v.x, !v.y, !v.z, !v.w);\n }\n `,name:e,type:a.FunctionType.ValueBased}}function x(){return A("sin")}function T(){const e="relu";return{body:`\n float ${e}_(float a) {\n return max( a, 0.0 );\n }\n vec4 ${e}_(vec4 v) {\n return max( v, 0.0 );\n }\n `,name:e,type:a.FunctionType.ValueBased}}function E(){const e="sigmoid";return{body:`\n float ${e}_(float a) {\n return 1.0 / (1.0 + exp(-a));\n }\n vec4 ${e}_(vec4 v) {\n return 1.0 / (1.0 + exp(-v));\n }\n `,name:e,type:a.FunctionType.ValueBased}}function k(){return A("sqrt")}function P(){return A("tan")}function O(){const e="tanh";return{body:`\n float ${e}_(float a) {\n a = clamp(a, -10., 10.);\n a = exp(2.*a);\n return (a - 1.) / (a + 1.);\n }\n vec4 ${e}_(vec4 v) {\n v = clamp(v, -10., 10.);\n v = exp(2.*v);\n return (v - 1.) / (v + 1.);\n }\n `,name:e,type:a.FunctionType.ValueBased}}function A(e){return{body:`\n float ${e}_(float a) {\n return ${e}(a);\n }\n vec4 ${e}_(vec4 v) {\n return ${e}(v);\n }\n `,name:e,type:a.FunctionType.ValueBased}}t.glslAbs=l,t.glslAcos=u,t.glslAsin=c,t.glslAtan=d,t.glslCeil=f,t.glslCos=p,t.glslElu=h,t.glslExp=m,t.glslFloor=g,t.glslClip=b,t.glslIdentity=y,t.glslLeakyRelu=_,t.glslLog=v,t.glslNeg=w,t.glslNot=S,t.glslSin=x,t.glslRelu=T,t.glslSigmoid=E,t.glslSqrt=k,t.glslTan=P,t.glslTanh=O;const $=(e,t,n,r)=>{const o=e.session.pack?s.TextureType.packed:s.TextureType.unpacked,a={name:n.name,inputTypes:[o],inputNames:["A"],cacheHint:r};return Object.assign(Object.assign({},a),{get:()=>((e,t,n,r)=>{const o=e.session.pack?s.TextureType.packed:s.TextureType.unpacked,a=(0,i.getGlsl)(e.session.backend.glContext.version);return Object.assign(Object.assign({},t),{output:{dims:n.dims,type:n.type,textureType:o},shaderSource:`\n ${r.body}\n void main() {\n vec4 v = ${a.texture2D}(A, TexCoords);\n v = ${r.name}_(v);\n ${a.output} = v;\n }\n `,hasMain:!0})})(e,a,t,n)})};t.abs=(e,t)=>[e.run($(e,t[0],l()),t)],t.acos=(e,t)=>[e.run($(e,t[0],u()),t)],t.asin=(e,t)=>[e.run($(e,t[0],c()),t)],t.atan=(e,t)=>[e.run($(e,t[0],d()),t)],t.clip=(e,t,n)=>[e.run($(e,t[0],b(n.min,n.max),n.cacheKey),t)],t.parseClipAttributes=e=>(0,r.createAttributeWithCacheKey)({min:e.attributes.getFloat("min",o.MIN_CLIP),max:e.attributes.getFloat("max",o.MAX_CLIP)}),t.clipV11=(e,n)=>{const r=R(e,n);return(0,t.clip)(e,[n[0]],r)};const R=(e,t)=>{if(t.length>=3&&(!e.session.isInitializer(t[1].dataId)||!e.session.isInitializer(t[2].dataId)))throw new Error("dynamic clip attributes are not allowed");const n=t.length>=3?t[1].numberData[0]:o.MIN_CLIP,a=t.length>=3?t[2].numberData[0]:o.MAX_CLIP;return(0,r.createAttributeWithCacheKey)({min:n,max:a})};t.ceil=(e,t)=>[e.run($(e,t[0],f()),t)],t.cos=(e,t)=>[e.run($(e,t[0],p()),t)],t.elu=(e,t,n)=>[e.run($(e,t[0],h(n.alpha),n.cacheKey),t)],t.parseEluAttributes=e=>(0,r.createAttributeWithCacheKey)({alpha:e.attributes.getFloat("alpha",1)}),t.exp=(e,t)=>[e.run($(e,t[0],m()),t)],t.floor=(e,t)=>[e.run($(e,t[0],g()),t)],t.identity=(e,t)=>[e.run($(e,t[0],y()),t)],t.leakyRelu=(e,t,n)=>[e.run($(e,t[0],_(n.alpha),n.cacheKey),t)],t.parseLeakyReluAttributes=e=>(0,r.createAttributeWithCacheKey)({alpha:e.attributes.getFloat("alpha",.01)}),t.log=(e,t)=>[e.run($(e,t[0],v()),t)],t.neg=(e,t)=>[e.run($(e,t[0],w()),t)],t.not=(e,t)=>[e.run($(e,t[0],S()),t)],t.relu=(e,t)=>[e.run($(e,t[0],T()),t)],t.sigmoid=(e,t)=>[e.run($(e,t[0],E()),t)],t.sin=(e,t)=>[e.run($(e,t[0],x()),t)],t.sqrt=(e,t)=>[e.run($(e,t[0],k()),t)],t.tan=(e,t)=>[e.run($(e,t[0],P()),t)],t.tanh=(e,t)=>[e.run($(e,t[0],O()),t)]},5611:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createUnpackProgramInfoLoader=t.createUnpackProgramInfo=void 0;const r=n(5060),o=n(2039),a=n(9390),i=n(2827),s={name:"unpack",inputNames:["A"],inputTypes:[o.TextureType.packed]};t.createUnpackProgramInfo=(e,t)=>{const n=t.dims.length,l=(0,i.getChannels)("rc",n),u=l.slice(-2),c=(0,a.getCoordsDataType)(n),d=(0,i.unpackFromChannel)(),f=0===t.dims.length?"":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}(n,l),p=n<=1?"rc":`vec2(${u.join(",")})`,h=`\n ${d}\n void main() {\n ${c} rc = getOutputCoords();\n\n // Sample the texture with the coords to get the rgba channel value.\n vec4 packedInput = getA(${f});\n\n ${(0,r.getGlsl)(e.session.backend.glContext.version).output} = vec4(getChannel(packedInput, ${p}), 0, 0, 0);\n }\n `;return Object.assign(Object.assign({},s),{hasMain:!0,output:{dims:t.dims,type:t.type,textureType:o.TextureType.unpacked},shaderSource:h})},t.createUnpackProgramInfoLoader=(e,n)=>Object.assign(Object.assign({},s),{get:()=>(0,t.createUnpackProgramInfo)(e,n)})},8428:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseUnsqueezeAttributes=t.unsqueezeV13=t.unsqueeze=void 0;const r=n(2517);t.unsqueeze=(e,t,n)=>{o(t);const a=r.ShapeUtil.unsqueezeShape(t[0].dims,n);return[e.reshapeUnpacked(t[0],a)]},t.unsqueezeV13=(e,n)=>(a(n),(0,t.unsqueeze)(e,[n[0]],Array.from(n[1].integerData))),t.parseUnsqueezeAttributes=e=>e.attributes.getInts("axes");const o=e=>{if(!e||1!==e.length)throw new Error("Unsqueeze requires 1 input.");if("string"===e[0].type)throw new Error("invalid input tensor types.")},a=e=>{if(!e||2!==e.length)throw new Error("Unsqueeze requires 2 inputs.");if("int32"!==e[1].type)throw new Error("Invalid input type.")}},9793:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.scalesValidation=t.validateInputs=t.parseUpsampleAttributes=t.parseUpsampleAttributesV9=t.parseUpsampleAttributesV7=t.upsample=void 0;const r=n(246),o=n(5060),a=n(2039),i={name:"Upsample",inputNames:["X"],inputTypes:[a.TextureType.unpacked]};t.upsample=(e,n,r)=>((0,t.validateInputs)(n,r),[e.run(Object.assign(Object.assign({},i),{cacheHint:r.cacheKey,get:()=>s(e,n,r)}),n)]),t.parseUpsampleAttributesV7=e=>(0,t.parseUpsampleAttributes)(e,7),t.parseUpsampleAttributesV9=e=>(0,t.parseUpsampleAttributes)(e,9),t.parseUpsampleAttributes=(e,n)=>{const o=n>=10,a=e.attributes.getString("mode","nearest");if("nearest"!==a&&"linear"!==a&&(n<11||"cubic"!==a))throw new Error(`unrecognized mode: ${a}`);let i=[];n<9&&(i=e.attributes.getFloats("scales"),(0,t.scalesValidation)(i,a,o));const s=e.attributes.getFloat("extrapolation_value",0),l=n>10?e.attributes.getString("coordinate_transformation_mode","half_pixel"):"asymmetric";if(-1===["asymmetric","pytorch_half_pixel","tf_half_pixel_for_nn","align_corners","tf_crop_and_resize","half_pixel"].indexOf(l))throw new Error(`coordinate_transform_mode '${l}' is not supported`);const u="tf_crop_and_resize"===l,c=u,d="nearest"===a&&n>=11?e.attributes.getString("nearest_mode","round_prefer_floor"):"";if(-1===["round_prefer_floor","round_prefer_ceil","floor","ceil",""].indexOf(d))throw new Error(`nearest_mode '${d}' is not supported`);const f=e.attributes.getFloat("cubic_coeff_a",-.75),p=0!==e.attributes.getInt("exclude_outside",0);if(p&&"cubic"!==a)throw new Error("exclude_outside can be set to 1 only when mode is CUBIC.");const h=n<11||"nearest"===a&&"asymmetric"===l&&"floor"===d;let m=0,g=0,b=0;return n>10?e.inputs.length>2?(m=1,g=2,b=3):(g=1,b=2):9===n&&(g=1),(0,r.createAttributeWithCacheKey)({opset:n,isResize:o,mode:a,scales:i,extrapolationValue:s,coordinateTransformMode:l,useExtrapolation:c,needRoiInput:u,nearestMode:d,cubicCoefficientA:f,excludeOutside:p,useNearest2xOptimization:h,roiInputIdx:m,scalesInputIdx:g,sizesInputIdx:b})};const s=(e,t,n)=>{const r=(0,o.getGlsl)(e.session.backend.glContext.version),[s,l]=e.calculateTextureWidthAndHeight(t[0].dims,a.TextureType.unpacked),u=t[0].dims.map((e,t)=>Math.floor(e*n.scales[t])),[c,d]=e.calculateTextureWidthAndHeight(u,a.TextureType.unpacked),f=u.length,p=new Array(f),h=new Array(f);let m=`\n int output_pitches[${f}];\n int input_pitches[${f}];\n `;for(let o=f-1;o>=0;o--)p[o]=o===f-1?1:p[o+1]*u[o+1],h[o]=o===f-1?1:h[o+1]*t[0].dims[o+1],m+=`\n output_pitches[${o}] = ${p[o]};\n input_pitches[${o}] = ${h[o]};\n `;const g=`\n float getInputFloat(int index) {\n vec2 coords = offsetToCoords(index, ${s}, ${l});\n float value = getColorAsFloat(${r.texture2D}(X, coords));\n return value;\n }\n `,b="nearest"===n.mode?`\n ${g}\n float process(int indices[${f}]) {\n int input_index = 0;\n int output_index = coordsToOffset(TexCoords, ${c}, ${d});\n\n ${m}\n\n int d, m;\n for (int dim = 0; dim < ${f}; ++dim) {\n d = output_index / output_pitches[dim];\n m = output_index - d * output_pitches[dim];\n output_index = m;\n\n if (scales[dim] != 1 && d > 0) {\n int d2 = d / scales[dim];\n m = d - d2 * scales[dim];\n d = d2;\n }\n input_index += input_pitches[dim] * d;\n }\n\n return getInputFloat(input_index);\n }`:4===f?`\n ${g}\n float process(int indices[4]) {\n int input_index = 0;\n int output_index = coordsToOffset(TexCoords, ${c}, ${d});\n\n ${m}\n\n int m;\n int index_of_dim0, index_of_dim1, index_of_dim2, index_of_dim3;\n index_of_dim0 = output_index / output_pitches[0];\n m = output_index - index_of_dim0 * output_pitches[0];\n index_of_dim1 = m / output_pitches[1];\n m = m - index_of_dim1 * output_pitches[1];\n index_of_dim2 = m / output_pitches[2];\n m = m - index_of_dim2 * output_pitches[2];\n index_of_dim3 = m;\n\n int index_of_input_dim2, index_of_input_dim3, x_offset, y_offset;\n index_of_input_dim2 = index_of_dim2 / scales[2];\n y_offset = index_of_dim2 - index_of_input_dim2 * scales[2];\n index_of_input_dim3 = index_of_dim3 / scales[3];\n x_offset = index_of_dim3 - index_of_input_dim3 * scales[3];\n\n input_index = index_of_dim0 * input_pitches[0] +\n index_of_dim1 * input_pitches[1] +\n index_of_input_dim2 * input_pitches[2] +\n index_of_input_dim3;\n\n float x00 = getInputFloat(input_index);\n float x10, x01, x11;\n\n bool end_of_dim2 = false;\n if (index_of_input_dim2 == (${t[0].dims[2]} - 1)) {\n // It's the end in dimension 2\n x01 = x00;\n end_of_dim2 = true;\n } else {\n x01 = getInputFloat(input_index + input_pitches[2]);\n }\n\n if (index_of_input_dim3 == (input_pitches[2] - 1)) {\n // It's the end in dimension 3\n x10 = x00;\n x11 = x01;\n }\n else {\n x10 = getInputFloat(input_index + 1);\n x11 = end_of_dim2 ? x10 : getInputFloat(input_index + input_pitches[2] + 1);\n }\n\n float y0 = x00 + float(y_offset) * (x01 - x00) / float(scales[2]);\n float y1 = x10 + float(y_offset) * (x11 - x10) / float(scales[2]);\n return y0 + float(x_offset) * (y1 - y0) / float(scales[3]);\n }`:`\n ${g}\n float process(int indices[2]) {\n int input_index = 0;\n int output_index = coordsToOffset(TexCoords, ${c}, ${d});\n\n ${m}\n\n int m;\n int index_of_dim0, index_of_dim1;\n index_of_dim0 = output_index / output_pitches[0];\n m = output_index - index_of_dim0 * output_pitches[0];\n index_of_dim1 = m;\n\n int index_of_input_dim0, index_of_input_dim1, x_offset, y_offset;\n index_of_input_dim0 = index_of_dim0 / scales[0];\n y_offset = index_of_dim0 - index_of_input_dim0 * scales[0];\n index_of_input_dim1 = index_of_dim1 / scales[1];\n x_offset = index_of_dim1 - index_of_input_dim1 * scales[1];\n\n input_index = index_of_input_dim0 * input_pitches[0] + index_of_input_dim1;\n\n float x00 = getInputFloat(input_index);\n float x10, x01, x11;\n\n bool end_of_dim0 = false;\n if (index_of_input_dim0 == (${t[0].dims[0]} - 1)) {\n // It's the end in dimension 0\n x01 = x00;\n end_of_dim0 = true;\n } else {\n x01 = getInputFloat(input_index + input_pitches[0]);\n }\n\n if (index_of_input_dim1 == (input_pitches[0] - 1)) {\n // It's the end in dimension 1\n x10 = x00;\n x11 = x01;\n }\n else {\n x10 = getInputFloat(input_index + 1);\n x11 = end_of_dim0 ? x10 : getInputFloat(input_index + input_pitches[0] + 1);\n }\n\n float y0 = x00 + float(y_offset) * (x01 - x00) / float(scales[0]);\n float y1 = x10 + float(y_offset) * (x11 - x10) / float(scales[0]);\n return y0 + float(x_offset) * (y1 - y0) / float(scales[1]);\n }`;return Object.assign(Object.assign({},i),{output:{dims:u,type:t[0].type,textureType:a.TextureType.unpacked},shaderSource:b,variables:[{name:"scales",type:"int",arrayLength:n.scales.length,data:n.scales.map(e=>Math.ceil(e))}]})};t.validateInputs=(e,t)=>{if(!e||t.opset<9&&1!==e.length||t.opset>=9&&t.opset<11&&2!==e.length||t.opset>=11&&e.length<2)throw new Error("invalid inputs.");if(t.scales.length>0&&e[0].dims.length!==t.scales.length)throw new Error("Invalid input shape.");if("string"===e[0].type)throw new Error("Invalid input tensor types.")},t.scalesValidation=(e,t,n)=>{if(n){for(const r of e)if(r<=0)throw new Error("Scale value should be greater than 0.")}else for(const r of e)if(r<1)throw new Error("Scale value should be greater than or equal to 1.");if(!("linear"!==t&&"cubic"!==t||2===e.length||4===e.length&&1===e[0]&&1===e[1]))throw new Error(`'Linear' mode and 'Cubic' mode only support 2-D inputs ('Bilinear', 'Bicubic') or 4-D inputs with the corresponding outermost 2 scale values being 1 in the ${n?"Resize":"Upsample"} opeartor.`)}},1958:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ProgramManager=void 0;const r=n(1670),o=n(6231),a=n(8879),i=n(5060);t.ProgramManager=class{constructor(e,t,n){this.profiler=e,this.glContext=t,this.textureLayoutStrategy=n,this.repo=new Map,this.attributesBound=!1}getArtifact(e){return this.repo.get(e)}setArtifact(e,t){this.repo.set(e,t)}run(e,t,n){var r;this.profiler.event("op",`ProgramManager.run ${null!==(r=e.programInfo.name)&&void 0!==r?r:"unknown kernel"}`,()=>{var r;const a=this.glContext.gl,i=e.program;a.useProgram(i);try{this.bindOutput(n),this.attributesBound||this.bindAttributes(e.attribLocations),this.bindUniforms(e.uniformLocations,null!==(r=e.programInfo.variables)&&void 0!==r?r:[],t)}catch(s){throw o.Logger.error("ProgramManager",e.programInfo.shaderSource),s}this.profiler.event("backend","GlContext.draw()",()=>{this.glContext.draw()})},this.glContext)}dispose(){this.vertexShader&&this.glContext.deleteShader(this.vertexShader),this.repo.forEach(e=>this.glContext.deleteProgram(e.program))}build(e,t,n){return this.profiler.event("backend","ProgramManager.build",()=>{const r=new a.GlslPreprocessor(this.glContext,e,t,n),o=r.preprocess(),i=this.compile(o);return{programInfo:e,program:i,uniformLocations:this.getUniformLocations(i,r.context.programInfo.inputNames,r.context.programInfo.variables),attribLocations:this.getAttribLocations(i)}})}compile(e){if(!this.vertexShader){o.Logger.verbose("ProrgramManager","Compiling and caching Vertex shader for the first time");const e=(0,i.getVertexShaderSource)(this.glContext.version);this.vertexShader=this.glContext.compileShader(e,this.glContext.gl.VERTEX_SHADER)}r.env.debug&&o.Logger.verbose("ProrgramManager",`FragShader:\n${e}\n`);const t=this.glContext.compileShader(e,this.glContext.gl.FRAGMENT_SHADER),n=this.glContext.createProgram(this.vertexShader,t);return this.glContext.deleteShader(t),n}bindOutput(e){const t=e.width,n=e.height;o.Logger.verbose("ProrgramManager",`Binding output texture to Framebuffer: w/h=${t}/${n}, shape=${e.shape}, type=${e.tensor.type}`),this.glContext.attachFramebuffer(e.texture,t,n)}bindAttributes(e){const t=e.position,n=e.textureCoord;this.glContext.setVertexAttributes(t,n),this.attributesBound=!0}bindUniforms(e,t,n){var r;const o=this.glContext.gl;let a=0;for(const{name:i,type:s,location:l,arrayLength:u}of e){const e=null===(r=t.find(e=>e.name===i))||void 0===r?void 0:r.data;if("sampler2D"!==s&&!e)throw new Error(`variable '${i}' does not have data defined in program info`);switch(s){case"sampler2D":this.bindTexture(n[a],l,a),a++;break;case"float":u?o.uniform1fv(l,e):o.uniform1f(l,e);break;case"int":u?o.uniform1iv(l,e):o.uniform1i(l,e);break;default:throw new Error(`Uniform not implemented: ${s}`)}}}bindTexture(e,t,n){this.glContext.bindTextureToUniform(e.texture,n,t)}getAttribLocations(e){return{position:this.getAttribLocation(e,"position"),textureCoord:this.getAttribLocation(e,"textureCoord")}}getUniformLocations(e,t,n){const r=[];if(t)for(const o of t)r.push({name:o,type:"sampler2D",location:this.getUniformLocation(e,o)});if(n)for(const o of n)r.push(Object.assign(Object.assign({},o),{location:this.getUniformLocation(e,o.name)}));return r}getUniformLocation(e,t){const n=this.glContext.gl.getUniformLocation(e,t);if(null===n)throw new Error(`Uniform ${t} not found.`);return n}getAttribLocation(e,t){return this.glContext.gl.getAttribLocation(e,t)}}},6416:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WebGLSessionHandler=void 0;const r=n(6231),o=n(1047),a=n(8316),i=n(1640),s=n(1958),l=n(7859),u=n(5702);t.WebGLSessionHandler=class{constructor(e,t){this.backend=e,this.context=t,this.layoutStrategy=new l.PreferLogicalStrategy(e.glContext.maxTextureSize),this.programManager=new s.ProgramManager(this.context.profiler,e.glContext,this.layoutStrategy),this.textureManager=new u.TextureManager(e.glContext,this.layoutStrategy,this.context.profiler,{reuseTextures:"full"===e.textureCacheMode}),this.packedTextureDataCache=new Map,this.unpackedTextureDataCache=new Map,this.pack=e.pack,this.pack2unpackMap=new Map,this.unpack2packMap=new Map}createInferenceHandler(){return new a.WebGLInferenceHandler(this)}onGraphInitialized(e){const t=e.getValues().filter(e=>-1===e.from&&e.tensor).map(e=>e.tensor.dataId);this.initializers=new Set(t)}isInitializer(e){return!!this.initializers&&this.initializers.has(e)}addInitializer(e){this.initializers.add(e)}getTextureData(e,t){return t?this.packedTextureDataCache.get(e):this.unpackedTextureDataCache.get(e)}setTextureData(e,t,n=!1){r.Logger.verbose("WebGLSessionHandler","Storing Texture data in cache"),n?this.packedTextureDataCache.set(e,t):this.unpackedTextureDataCache.set(e,t)}dispose(){this.programManager.dispose(),this.textureManager.clearActiveTextures(),this.packedTextureDataCache.forEach(e=>this.textureManager.releaseTexture(e,!0)),this.packedTextureDataCache=new Map,this.unpackedTextureDataCache.forEach(e=>this.textureManager.releaseTexture(e,!0)),this.unpackedTextureDataCache=new Map}resolve(e,t,n){const r=(0,o.resolveOperator)(e,t,i.WEBGL_OP_RESOLVE_RULES);return{impl:r.opImpl,context:r.opInit?r.opInit(e,n):e}}}},7769:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Uint8DataEncoder=t.RGBAFloatDataEncoder=t.RedFloat32DataEncoder=void 0;const r=n(6231);t.RedFloat32DataEncoder=class{constructor(e,t=1){if(1===t)this.internalFormat=e.R32F,this.format=e.RED,this.textureType=e.FLOAT,this.channelSize=t;else{if(4!==t)throw new Error(`Invalid number of channels: ${t}`);this.internalFormat=e.RGBA32F,this.format=e.RGBA,this.textureType=e.FLOAT,this.channelSize=t}}encode(e,t){let n,o;return e.constructor!==Float32Array&&(r.Logger.warning("Encoder","data was not of type Float32; creating new Float32Array"),o=new Float32Array(e)),t*this.channelSize>e.length?(r.Logger.warning("Encoder","Source data too small. Allocating larger array"),o=e,n=this.allocate(t*this.channelSize),o.forEach((e,t)=>n[t]=e)):(o=e,n=o),n}allocate(e){return new Float32Array(4*e)}decode(e,t){return 1===this.channelSize?e.filter((e,t)=>t%4==0).subarray(0,t):e.subarray(0,t)}},t.RGBAFloatDataEncoder=class{constructor(e,t=1,n){if(1!==t&&4!==t)throw new Error(`Invalid number of channels: ${t}`);this.internalFormat=e.RGBA,this.format=e.RGBA,this.channelSize=t,this.textureType=n||e.FLOAT}encode(e,t){let n=e;return 1===this.channelSize&&(r.Logger.verbose("Encoder","Exploding into a larger array"),n=this.allocate(t),e.forEach((e,t)=>n[4*t]=e)),n}allocate(e){return new Float32Array(4*e)}decode(e,t){return 1===this.channelSize?e.filter((e,t)=>t%4==0).subarray(0,t):e.subarray(0,t)}},t.Uint8DataEncoder=class{constructor(e,t=1){if(this.channelSize=4,1===t)this.internalFormat=e.ALPHA,this.format=e.ALPHA,this.textureType=e.UNSIGNED_BYTE,this.channelSize=t;else{if(4!==t)throw new Error(`Invalid number of channels: ${t}`);this.internalFormat=e.RGBA,this.format=e.RGBA,this.textureType=e.UNSIGNED_BYTE,this.channelSize=t}}encode(e,t){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}allocate(e){return new Uint8Array(e*this.channelSize)}decode(e,t){if(e instanceof Uint8Array)return e.subarray(0,t);throw new Error(`Invalid array type: ${e.constructor}`)}}},7859:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getBatchDim=t.sizeToSquarishShape=t.getRowsCols=t.sizeFromShape=t.isInt=t.parseAxisParam=t.squeezeShape=t.PreferLogicalStrategy=t.AlwaysKeepOriginalSizeStrategy=void 0;const r=n(6231),o=n(2517);function a(e,t){const n=[],r=[],o=null!=t&&Array.isArray(t)&&0===t.length,a=null==t||o?null:i(t,e).sort();let s=0;for(let i=0;i<e.length;++i){if(null!=a){if(a[s]===i&&1!==e[i])throw new Error(`Can't squeeze axis ${i} since its dim '${e[i]}' is not 1`);(null==a[s]||a[s]>i)&&1===e[i]&&(n.push(e[i]),r.push(i)),a[s]<=i&&s++}1!==e[i]&&(n.push(e[i]),r.push(i))}return{newShape:n,keptDims:r}}function i(e,t){const n=t.length;return e=null==e?t.map((e,t)=>t):[].concat(e),(0,o.assert)(e.every(e=>e>=-n&&e<n),()=>`All values in axis param must be in range [-${n}, ${n}) but got axis ${e}`),(0,o.assert)(e.every(s),()=>`All values in axis param must be integers but got axis ${e}`),e.map(e=>e<0?n+e:e)}function s(e){return e%1==0}function l(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 u(e){const t=Math.ceil(Math.sqrt(e));return[t,Math.ceil(e/t)]}t.AlwaysKeepOriginalSizeStrategy=class{constructor(e){this.maxTextureSize=e}computeTextureWH(e,t){if(0===e.length)return[1,1];const n=this.maxTextureSize;if(t&&void 0!==t.breakAxis){const o=t.breakAxis>=e.length?1:e.slice(t.breakAxis).reduce((e,t)=>e*t),a=t.breakAxis<=0?1:e.slice(0,t.breakAxis).reduce((e,t)=>e*t);if(!(o>n||a>n))return[o,a];r.Logger.verbose("TextureLayout",`Given width/height preferences were unattainable: shape:${e}, breakAxis:${t.breakAxis}`)}const o=e.reduce((e,t)=>e*t);let a=Math.floor(Math.sqrt(o));for(;a<n&&a<o&&o%a!=0;a++);if(a>=n||o%a!=0)throw new Error(`The given dimensions are outside this GPU's boundaries: ${e}`);return[a,o/a]}},t.PreferLogicalStrategy=class{constructor(e){this.maxTextureSize=e}computeTextureWH(e,t){const n=this.computeTexture(e,t);return t&&t.isPacked&&(n[0]/=2,n[1]/=2),t&&t.reverseWH?[n[1],n[0]]:n}computeTexture(e,t){const n=t&&t.isPacked;if(0===e.length)return n?[2,2]:[1,1];let o=this.maxTextureSize;if(t&&void 0!==t.breakAxis){const n=t.breakAxis>=e.length?1:e.slice(t.breakAxis).reduce((e,t)=>e*t),a=t.breakAxis<=0?1:e.slice(0,t.breakAxis).reduce((e,t)=>e*t);if(!(n>o||a>o))return[n,a];r.Logger.verbose("TextureLayout",`Given width/height preferences were unattainable: shape:${e}, breakAxis:${t.breakAxis}`)}let i=e.slice(0);if(n&&(o*=2,i=i.map((e,t)=>t>=i.length-2?i[t]%2==0?i[t]:i[t]+1:i[t]),1===i.length&&(i=[2,i[0]])),2!==i.length){const e=a(i);i=e.newShape}const s=l(i);return i.length<=1&&s<=o?[1,s]:2===i.length&&i[0]<=o&&i[1]<=o?i:3===i.length&&i[0]*i[1]<=o&&i[2]<=o?[i[0]*i[1],i[2]]:3===i.length&&i[0]<=o&&i[1]*i[2]<=o?[i[0],i[1]*i[2]]:4===i.length&&i[0]*i[1]*i[2]<=o&&i[3]<=o?[i[0]*i[1]*i[2],i[3]]:4===i.length&&i[0]<=o&&i[1]*i[2]*i[3]<=o?[i[0],i[1]*i[2]*i[3]]:n?u(s/4).map(e=>2*e):u(s)}},t.squeezeShape=a,t.parseAxisParam=i,t.isInt=s,t.sizeFromShape=l,t.getRowsCols=function(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]]},t.sizeToSquarishShape=u,t.getBatchDim=function(e,t=2){return l(e.slice(0,e.length-t))}},4057:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createTextureLayoutFromShape=t.calculateTextureWidthAndHeight=t.createTextureLayoutFromTextureType=void 0;const r=n(2517),o=n(2039);t.createTextureLayoutFromTextureType=(e,n,r)=>{const a=r===o.TextureType.unpacked||r===o.TextureType.unpackedReversed?1:4,i=r===o.TextureType.packed,s=r===o.TextureType.unpackedReversed||r===o.TextureType.packed,l=r===o.TextureType.packedLastDimension?n.length-1:void 0,u=r===o.TextureType.packedLastDimension?n.map((e,t)=>t===n.length-1?4*e:e):void 0;return(0,t.createTextureLayoutFromShape)(e,n,a,u,{isPacked:i,reverseWH:s,breakAxis:l})},t.calculateTextureWidthAndHeight=(e,n,r)=>{const o=(0,t.createTextureLayoutFromTextureType)(e,n,r);return[o.width,o.height]},t.createTextureLayoutFromShape=(e,t,n=1,o,a)=>{const i=!(!a||!a.isPacked),[s,l]=e.computeTextureWH(i&&o||t,a),u=t.length;let c=t.slice(0);if(0===u&&(c=[1]),1===n)o=t;else if(i){if(4!==n)throw new Error("a packed texture must be 4-channel");o=t,u>0&&(c[u-1]=Math.ceil(c[u-1]/2)),u>1&&(c[u-2]=Math.ceil(c[u-2]/2))}else if(!o)throw new Error("Unpacked shape is needed when using channels > 1");return{width:s,height:l,channels:n,isPacked:i,shape:c,strides:r.ShapeUtil.computeStrides(c),unpackedShape:o,reversedWH:a&&a.reverseWH}}},5702:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextureManager=void 0;const r=n(6231);t.TextureManager=class{constructor(e,t,n,r){this.glContext=e,this.layoutStrategy=t,this.profiler=n,this.config=r,this.pendingRead=new Map,r.reuseTextures&&(this.inUseTextures=new Map,this.idleTextures=new Map,this.textureLookup=new Map)}createTextureFromLayout(e,t,n,o){const a=this.toEncoderType(e),i=this.glContext.getEncoder(a,t.channels||1,o);if(t.isPacked&&1===o)throw new Error("not implemented");const s=t.width,l=t.height;let u,c;if(this.config.reuseTextures){u=`${s}x${l}_${i.format}_${i.internalFormat}_${i.textureType}`,c=this.inUseTextures.get(u),c||(c=[],this.inUseTextures.set(u,c));const t=this.idleTextures.get(u);if(t&&t.length>0){const r=t.pop();return c.push(r),1===o&&this.glContext.updateTexture(r,s,l,i,this.toTextureData(e,n)),r}}r.Logger.verbose("TextureManager",`Creating new texture of size ${t.width}x${t.height}`);const d=this.glContext.allocateTexture(s,l,i,this.toTextureData(e,n));return this.config.reuseTextures&&(c.push(d),this.textureLookup.set(d,u)),d}readTexture(e,t,n){return n||(n=1),this.profiler.event("backend","TextureManager.readTexture",()=>{const r=e.shape.reduce((e,t)=>e*t)*n,o=this.glContext.readTexture(e.texture,e.width,e.height,r,this.toEncoderType(t),n);return this.toTensorData(t,o)})}async readTextureAsync(e,t,n){const r=e.tensor.dataId;if(n||(n=1),this.pendingRead.has(r)){const e=this.pendingRead.get(r);return new Promise(t=>null==e?void 0:e.push(t))}return this.profiler.event("backend","TextureManager.readTextureAsync",async()=>{this.pendingRead.set(r,[]);const o=e.shape.reduce((e,t)=>e*t)*n;await this.glContext.createAndWaitForFence();const a=this.glContext.readTexture(e.texture,e.width,e.height,o,this.toEncoderType(t),n),i=this.toTensorData(t,a),s=this.pendingRead.get(r);return this.pendingRead.delete(r),null==s||s.forEach(e=>e(i)),i})}readUint8TextureAsFloat(e){return this.profiler.event("backend","TextureManager.readUint8TextureAsFloat",()=>{const t=e.shape.reduce((e,t)=>e*t),n=this.glContext.readTexture(e.texture,e.width,e.height,4*t,"byte",4);return new Float32Array(n.buffer,n.byteOffset,t)})}releaseTexture(e,t){let n;if(this.config.reuseTextures&&(n=this.textureLookup.get(e.texture),n)){t&&this.textureLookup.delete(n);const r=this.inUseTextures.get(n);if(r){const t=r.indexOf(e.texture);if(-1!==t){r.splice(t,1);let o=this.idleTextures.get(n);o||(o=[],this.idleTextures.set(n,o)),o.push(e.texture)}}}n&&!t||(r.Logger.verbose("TextureManager",`Deleting texture of size ${e.width}x${e.height}`),this.glContext.deleteTexture(e.texture))}toTensorData(e,t){switch(e){case"int16":return t instanceof Int16Array?t:Int16Array.from(t);case"int32":return t instanceof Int32Array?t:Int32Array.from(t);case"int8":return t instanceof Int8Array?t:Int8Array.from(t);case"uint16":return t instanceof Uint16Array?t:Uint16Array.from(t);case"uint32":return t instanceof Uint32Array?t:Uint32Array.from(t);case"uint8":case"bool":return t instanceof Uint8Array?t:Uint8Array.from(t);case"float32":return t instanceof Float32Array?t:Float32Array.from(t);case"float64":return t instanceof Float64Array?t:Float64Array.from(t);default:throw new Error(`TensorData type ${e} is not supported`)}}toTextureData(e,t){if(t)return t instanceof Float32Array?t:new Float32Array(t)}toEncoderType(e){return"float"}clearActiveTextures(){this.glContext.clearActiveTextures()}}},2039:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.TextureType=void 0,(n=t.TextureType||(t.TextureType={}))[n.unpacked=0]="unpacked",n[n.unpackedReversed=1]="unpackedReversed",n[n.packed=2]="packed",n[n.downloadUint8AsFloat=3]="downloadUint8AsFloat",n[n.packedLastDimension=4]="packedLastDimension"},9390:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getGlChannels=t.getCoordsDataType=t.getSqueezedParams=t.squeezeInputShape=t.generateShaderFuncNameFromInputSamplerNameAtOutCoords=t.generateShaderFuncNameFromInputSamplerName=t.repeatedTry=t.getPackedShape=void 0;const r=n(2517);t.getPackedShape=function(e){const t=e.length;return e.slice(0,t-1).concat(e[t-1]/4)},t.repeatedTry=async function(e,t=e=>0,n){return new Promise((r,o)=>{let a=0;const i=()=>{if(e())return void r();a++;const s=t(a);null!=n&&a>=n?o():setTimeout(i,s)};i()})},t.generateShaderFuncNameFromInputSamplerName=function(e){return(0,r.assert)(void 0!==e&&0!==e.length,()=>"empty string found for sampler name"),"get"+e.charAt(0).toUpperCase()+e.slice(1)},t.generateShaderFuncNameFromInputSamplerNameAtOutCoords=function(e){return(0,r.assert)(void 0!==e&&0!==e.length,()=>"empty string found for sampler name"),"get"+e.charAt(0).toUpperCase()+e.slice(1)+"AtOutCoords"},t.squeezeInputShape=function(e,t){let n=JSON.parse(JSON.stringify(e));return n=t,n},t.getSqueezedParams=function(e,t){return t.map(t=>e[t]).join(", ")},t.getCoordsDataType=function(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`)},t.getGlChannels=function(e=6){return["x","y","z","w","u","v"].slice(0,e)}},7305:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createNewWebGLContext=t.createWebGLContext=void 0;const r=n(6231),o=n(1713),a={};function i(e){const t=function(){if("undefined"==typeof document){if("undefined"==typeof OffscreenCanvas)throw new TypeError("failed to create canvas: OffscreenCanvas is not supported");return new OffscreenCanvas(1,1)}const e=document.createElement("canvas");return e.width=1,e.height=1,e}();let n;const a={alpha:!1,depth:!1,antialias:!1,stencil:!1,preserveDrawingBuffer:!1,premultipliedAlpha:!1,failIfMajorPerformanceCaveat:!1};if((!e||"webgl2"===e)&&(n=t.getContext("webgl2",a),n))try{return new o.WebGLContext(n,2)}catch(i){r.Logger.warning("GlContextFactory",`failed to create WebGLContext using contextId 'webgl2'. Error: ${i}`)}if((!e||"webgl"===e)&&(n=t.getContext("webgl",a)||t.getContext("experimental-webgl",a),n))try{return new o.WebGLContext(n,1)}catch(i){r.Logger.warning("GlContextFactory",`failed to create WebGLContext using contextId 'webgl' or 'experimental-webgl'. Error: ${i}`)}throw new Error("WebGL is not supported")}t.createWebGLContext=function e(t){let n;t&&"webgl2"!==t||!("webgl2"in a)?t&&"webgl"!==t||!("webgl"in a)||(n=a.webgl):n=a.webgl2,n=n||i(t),t=t||1===n.version?"webgl":"webgl2";const r=n.gl;return a[t]=n,r.isContextLost()?(delete a[t],e(t)):(r.disable(r.DEPTH_TEST),r.disable(r.STENCIL_TEST),r.disable(r.BLEND),r.disable(r.DITHER),r.disable(r.POLYGON_OFFSET_FILL),r.disable(r.SAMPLE_COVERAGE),r.enable(r.SCISSOR_TEST),r.enable(r.CULL_FACE),r.cullFace(r.BACK),n)},t.createNewWebGLContext=i},1713:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.WebGLContext=t.linearSearchLastTrue=void 0;const i=n(1670),s=a(n(7769)),l=n(9390);function u(e){let t=0;for(;t<e.length&&e[t]();++t);return t-1}t.linearSearchLastTrue=u,t.WebGLContext=class{constructor(e,t){this.frameBufferBound=!1,this.itemsToPoll=[],this.gl=e,this.version=t,this.getExtensions(),this.vertexbuffer=this.createVertexbuffer(),this.framebuffer=this.createFramebuffer(),this.queryVitalParameters()}allocateTexture(e,t,n,r){const o=this.gl,a=o.createTexture();o.bindTexture(o.TEXTURE_2D,a),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,o.NEAREST),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,o.NEAREST),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,o.CLAMP_TO_EDGE),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,o.CLAMP_TO_EDGE);const i=r?n.encode(r,e*t):null;return o.texImage2D(o.TEXTURE_2D,0,n.internalFormat,e,t,0,n.format,n.textureType,i),this.checkError(),a}updateTexture(e,t,n,r,o){const a=this.gl;a.bindTexture(a.TEXTURE_2D,e);const i=r.encode(o,t*n);a.texSubImage2D(a.TEXTURE_2D,0,0,0,t,n,r.format,r.textureType,i),this.checkError()}attachFramebuffer(e,t,n){const r=this.gl;r.bindTexture(r.TEXTURE_2D,e),r.bindFramebuffer(r.FRAMEBUFFER,this.framebuffer),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,e,0),this.checkError(),r.viewport(0,0,t,n),r.scissor(0,0,t,n)}readTexture(e,t,n,r,o,a){const i=this.gl;a||(a=1),this.frameBufferBound||this.attachFramebuffer(e,t,n);const s=this.getEncoder(o,a),l=s.allocate(t*n);return i.bindTexture(i.TEXTURE_2D,e),i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,e,0),i.readPixels(0,0,t,n,i.RGBA,s.textureType,l),this.checkError(),s.decode(l,r)}isFramebufferReady(){return!0}getActiveTexture(){const e=this.gl;return"TEXTURE"+(e.getParameter(this.gl.ACTIVE_TEXTURE)-e.TEXTURE0)}getTextureBinding(){return this.gl.getParameter(this.gl.TEXTURE_BINDING_2D)}getFramebufferBinding(){return this.gl.getParameter(this.gl.FRAMEBUFFER_BINDING)}setVertexAttributes(e,t){const n=this.gl;n.vertexAttribPointer(e,3,n.FLOAT,!1,20,0),n.enableVertexAttribArray(e),-1!==t&&(n.vertexAttribPointer(t,2,n.FLOAT,!1,20,12),n.enableVertexAttribArray(t)),this.checkError()}createProgram(e,t){const n=this.gl,r=n.createProgram();return n.attachShader(r,e),n.attachShader(r,t),n.linkProgram(r),r}compileShader(e,t){const n=this.gl,r=n.createShader(t);if(!r)throw new Error(`createShader() returned null with type ${t}`);if(n.shaderSource(r,e),n.compileShader(r),!1===n.getShaderParameter(r,n.COMPILE_STATUS))throw new Error(`Failed to compile shader: ${n.getShaderInfoLog(r)}\nShader source:\n${e}`);return r}deleteShader(e){this.gl.deleteShader(e)}bindTextureToUniform(e,t,n){const r=this.gl;r.activeTexture(r.TEXTURE0+t),this.checkError(),r.bindTexture(r.TEXTURE_2D,e),this.checkError(),r.uniform1i(n,t),this.checkError()}draw(){this.gl.drawArrays(this.gl.TRIANGLE_STRIP,0,4),this.checkError()}checkError(){if(i.env.debug){const e=this.gl,t=e.getError();let n="";switch(t){case e.NO_ERROR:return;case e.INVALID_ENUM:n="INVALID_ENUM";break;case e.INVALID_VALUE:n="INVALID_VALUE";break;case e.INVALID_OPERATION:n="INVALID_OPERATION";break;case e.INVALID_FRAMEBUFFER_OPERATION:n="INVALID_FRAMEBUFFER_OPERATION";break;case e.OUT_OF_MEMORY:n="OUT_OF_MEMORY";break;case e.CONTEXT_LOST_WEBGL:n="CONTEXT_LOST_WEBGL";break;default:n=`Unknown WebGL Error: ${t.toString(16)}`}throw new Error(n)}}deleteTexture(e){this.gl.deleteTexture(e)}deleteProgram(e){this.gl.deleteProgram(e)}getEncoder(e,t,n=0){if(2===this.version)return new s.RedFloat32DataEncoder(this.gl,t);switch(e){case"float":return 1===n||this.isRenderFloat32Supported?new s.RGBAFloatDataEncoder(this.gl,t):new s.RGBAFloatDataEncoder(this.gl,t,this.textureHalfFloatExtension.HALF_FLOAT_OES);case"int":throw new Error("not implemented");case"byte":return new s.Uint8DataEncoder(this.gl,t);default:throw new Error(`Invalid dataType: ${e}`)}}clearActiveTextures(){const e=this.gl;for(let t=0;t<this.maxTextureImageUnits;++t)e.activeTexture(e.TEXTURE0+t),e.bindTexture(e.TEXTURE_2D,null)}dispose(){if(this.disposed)return;const e=this.gl;e.bindFramebuffer(e.FRAMEBUFFER,null),e.deleteFramebuffer(this.framebuffer),e.bindBuffer(e.ARRAY_BUFFER,null),e.deleteBuffer(this.vertexbuffer),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null),e.finish(),this.disposed=!0}createDefaultGeometry(){return new Float32Array([-1,1,0,0,1,-1,-1,0,0,0,1,1,0,1,1,1,-1,0,1,0])}createVertexbuffer(){const e=this.gl,t=e.createBuffer();if(!t)throw new Error("createBuffer() returned null");const n=this.createDefaultGeometry();return e.bindBuffer(e.ARRAY_BUFFER,t),e.bufferData(e.ARRAY_BUFFER,n,e.STATIC_DRAW),this.checkError(),t}createFramebuffer(){const e=this.gl.createFramebuffer();if(!e)throw new Error("createFramebuffer returned null");return e}queryVitalParameters(){const e=this.gl;if(this.isFloatTextureAttachableToFrameBuffer=this.checkFloatTextureAttachableToFrameBuffer(),this.isRenderFloat32Supported=this.checkRenderFloat32(),this.isFloat32DownloadSupported=this.checkFloat32Download(),1===this.version&&!this.textureHalfFloatExtension&&!this.isRenderFloat32Supported)throw new Error("both float32 and float16 TextureType are not supported");this.isBlendSupported=!this.isRenderFloat32Supported||this.checkFloat32Blend(),this.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE),this.maxTextureImageUnits=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),this.version}getExtensions(){2===this.version?(this.colorBufferFloatExtension=this.gl.getExtension("EXT_color_buffer_float"),this.disjointTimerQueryWebgl2Extension=this.gl.getExtension("EXT_disjoint_timer_query_webgl2")):(this.textureFloatExtension=this.gl.getExtension("OES_texture_float"),this.textureHalfFloatExtension=this.gl.getExtension("OES_texture_half_float"))}checkFloatTextureAttachableToFrameBuffer(){const e=this.gl,t=e.createTexture();e.bindTexture(e.TEXTURE_2D,t);const n=2===this.version?e.RGBA32F:e.RGBA;e.texImage2D(e.TEXTURE_2D,0,n,1,1,0,e.RGBA,e.FLOAT,null);const r=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,r),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0);const o=e.checkFramebufferStatus(e.FRAMEBUFFER)===e.FRAMEBUFFER_COMPLETE;return e.bindTexture(e.TEXTURE_2D,null),e.bindFramebuffer(e.FRAMEBUFFER,null),e.deleteTexture(t),e.deleteFramebuffer(r),o}checkRenderFloat32(){if(2===this.version){if(!this.colorBufferFloatExtension)return!1}else if(!this.textureFloatExtension)return!1;return this.isFloatTextureAttachableToFrameBuffer}checkFloat32Download(){if(2===this.version){if(!this.colorBufferFloatExtension)return!1}else{if(!this.textureFloatExtension)return!1;if(!this.gl.getExtension("WEBGL_color_buffer_float"))return!1}return this.isFloatTextureAttachableToFrameBuffer}checkFloat32Blend(){const e=this.gl;let t,n,r,o,a;try{t=e.createTexture(),n=e.createFramebuffer(),e.bindTexture(e.TEXTURE_2D,t);const i=2===this.version?e.RGBA32F:e.RGBA;return e.texImage2D(e.TEXTURE_2D,0,i,1,1,0,e.RGBA,e.FLOAT,null),e.bindFramebuffer(e.FRAMEBUFFER,n),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0),e.enable(e.BLEND),r=e.createShader(e.VERTEX_SHADER),!!r&&(e.shaderSource(r,"void main(){}"),e.compileShader(r),o=e.createShader(e.FRAGMENT_SHADER),!!o&&(e.shaderSource(o,"precision highp float;void main(){gl_FragColor=vec4(0.5);}"),e.compileShader(o),a=e.createProgram(),!!a&&(e.attachShader(a,r),e.attachShader(a,o),e.linkProgram(a),e.useProgram(a),e.drawArrays(e.POINTS,0,1),e.getError()===e.NO_ERROR)))}finally{e.disable(e.BLEND),a&&e.deleteProgram(a),r&&e.deleteShader(r),o&&e.deleteShader(o),n&&(e.bindFramebuffer(e.FRAMEBUFFER,null),e.deleteFramebuffer(n)),t&&(e.bindTexture(e.TEXTURE_2D,null),e.deleteTexture(t))}}beginTimer(){if(2===this.version&&this.disjointTimerQueryWebgl2Extension){const e=this.gl,t=this.disjointTimerQueryWebgl2Extension,n=e.createQuery();return e.beginQuery(t.TIME_ELAPSED_EXT,n),n}throw new Error("WebGL1 profiling currently not supported.")}endTimer(){if(2!==this.version||!this.disjointTimerQueryWebgl2Extension)throw new Error("WebGL1 profiling currently not supported");{const e=this.gl,t=this.disjointTimerQueryWebgl2Extension;e.endQuery(t.TIME_ELAPSED_EXT)}}isTimerResultAvailable(e){let t=!1,n=!1;if(2!==this.version||!this.disjointTimerQueryWebgl2Extension)throw new Error("WebGL1 profiling currently not supported");{const r=this.gl,o=this.disjointTimerQueryWebgl2Extension;t=r.getQueryParameter(e,r.QUERY_RESULT_AVAILABLE),n=r.getParameter(o.GPU_DISJOINT_EXT)}return t&&!n}getTimerResult(e){let t=0;if(2!==this.version)throw new Error("WebGL1 profiling currently not supported");{const n=this.gl;t=n.getQueryParameter(e,n.QUERY_RESULT),n.deleteQuery(e)}return t/1e6}async waitForQueryAndGetTime(e){return await(0,l.repeatedTry)(()=>this.isTimerResultAvailable(e)),this.getTimerResult(e)}async createAndWaitForFence(){const e=this.createFence(this.gl);return this.pollFence(e)}createFence(e){let t;const n=e,r=n.fenceSync(n.SYNC_GPU_COMMANDS_COMPLETE,0);return e.flush(),t=null===r?()=>!0:()=>{const e=n.clientWaitSync(r,0,0);return e===n.ALREADY_SIGNALED||e===n.CONDITION_SATISFIED},{query:r,isFencePassed:t}}async pollFence(e){return new Promise(t=>{this.addItemToPoll(()=>e.isFencePassed(),()=>t())})}pollItems(){const e=u(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)}async addItemToPoll(e,t){this.itemsToPoll.push({isDoneFn:e,resolveFn:t}),this.itemsToPoll.length>1||await(0,l.repeatedTry)(()=>(this.pollItems(),0===this.itemsToPoll.length))}}},1036:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ExecutionPlan=void 0;const r=n(6231);class o{constructor(e,t){this.op=e,this.node=t}}t.ExecutionPlan=class{constructor(e,t,n){this.graph=e,this.profiler=n,this.initialize(t)}initialize(e){this.profiler.event("session","ExecutionPlan.initialize",()=>{const t=this.graph.getNodes();if(t.length!==e.length)throw new Error("The size of nodes and OPs do not match.");this._ops=e.map((e,n)=>new o(e,t[n])),this.reset(),this._starter=[],this._ops.forEach((e,t)=>{let n=!0;for(const r of e.node.inputs)if(!this._values[r]&&-1===this.graph.getInputIndices().indexOf(r)){n=!1;break}n&&this._starter.push(t)})})}reset(){this._values=this.graph.getValues().map(e=>e.tensor)}async execute(e,t){return this.profiler.event("session","ExecutionPlan.execute",async()=>{this.reset();const n=e.createInferenceHandler(),o=this.graph.getInputIndices();if(t.length!==o.length)throw new Error(`number of input tensors don't match the number of inputs to the model: actual: ${t.length} expected: ${o.length}`);t.forEach((e,t)=>{const n=o[t];this._values[n]=e});const a=this._starter.slice(0),i=this.graph.getValues(),s=this.graph.getNodes();let l=0;for(;l<a.length;){const e=a[l++],t=this._ops[e],o=t.node.inputs.map(e=>this._values[e]);if(-1!==o.indexOf(void 0))throw new Error(`unresolved input detected: op: ${t.node}`);const u=o;r.Logger.verbose("ExecPlan",`Runing op:${t.node.name} (${u.map((e,n)=>`'${t.node.inputs[n]}': ${e.type}[${e.dims.join(",")}]`).join(", ")})`);const c=await this.profiler.event("node",t.node.name,async()=>t.op.impl(n,u,t.op.context));if(c.length!==t.node.outputs.length)throw new Error("the size of output does not match model definition.");c.forEach((e,n)=>{const r=t.node.outputs[n];if(this._values[r])throw new Error(`output [${r}] already has value: op:${t.node.name}`);this._values[r]=e});const d=new Set;c.forEach((e,n)=>{const r=t.node.outputs[n];for(const t of i[r].to){const e=s[t];let n=!0;for(const t of e.inputs)if(!this._values[t]){n=!1;break}n&&d.add(t)}}),a.push(...d)}const u=[];for(let e=0;e<this.graph.getOutputIndices().length;e++){const t=this.graph.getOutputIndices()[e],n=this._values[t];if(void 0===n)throw new Error(`required output [${t}] does not have value`);0===t?await n.getData():n.data,u.push(n)}return r.Logger.verbose("ExecPlan","disposing of inferenceHandler"),n.dispose(),u})}}},7070:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Graph=void 0;const r=n(1446),o=n(7778),a=n(9395),i=n(9162),s=n(2517);var l=a.onnxruntime.experimental.fbs;t.Graph={from:(e,t)=>new d(e,t)};class u{constructor(e){this._from=void 0,this._to=[],this.tensor=void 0,this.type=void 0,e&&(this.type=s.ProtoUtil.tensorValueTypeFromProto(e.type.tensorType))}get from(){return this._from}get to(){return this._to}}class c{constructor(e,t){e instanceof r.onnx.NodeProto?(this.name=e.name,this.opType=e.opType,this.attributes=new o.Attribute(e.attribute)):e instanceof l.Node&&(this.name=null!=t?t:e.name(),this.opType=e.opType(),this.attributes=new o.Attribute(s.ProtoUtil.tensorAttributesFromORTFormat(e))),this.inputs=[],this.outputs=[],this.executeNode=!0}}class d{constructor(e,t){if(!e)throw new TypeError("graph is empty");this.buildGraph(e),this.transformGraph(t),this.checkIsAcyclic()}getInputIndices(){return this._allInputIndices}getInputNames(){return this._allInputNames}getOutputIndices(){return this._allOutputIndices}getOutputNames(){return this._allOutputNames}getValues(){return this._allData}getNodes(){return this._nodes}buildGraph(e){if(e instanceof r.onnx.GraphProto)this.buildGraphFromOnnxFormat(e);else{if(!(e instanceof l.Graph))throw new TypeError("Graph type is not supported.");this.buildGraphFromOrtFormat(e)}}buildGraphFromOnnxFormat(e){const t=new Map;this._allData=[],this._allInputIndices=[],this._allInputNames=[],this._allOutputIndices=[],this._allOutputNames=[],this._nodes=[];const n=new Map;if(!e.input)throw new Error("missing information in graph: input");const r=[];for(const o of e.input){if(t.has(o.name))throw new Error(`duplicated input name: ${o.name}`);const e=this._allData.push(new u(o))-1;t.set(o.name,e),r.push(o.name)}if(!e.initializer)throw new Error("missing information in graph: initializer");for(const o of e.initializer){let e=t.get(o.name);if(void 0===e){const n=new u;n.type={shape:{dims:s.ProtoUtil.tensorDimsFromProto(o.dims)},tensorType:s.ProtoUtil.tensorDataTypeFromProto(o.dataType)},e=this._allData.push(n)-1,t.set(o.name,e)}this._allData[e]._from=-1,this._allData[e].tensor=i.Tensor.fromProto(o)}for(let o=0;o<this._allData.length;o++)this._allData[o].tensor||(this._allInputIndices.push(o),this._allInputNames.push(r[o]));if(!e.output)throw new Error("missing information in graph: output");for(const o of e.output){if(t.has(o.name))throw new Error(`duplicated output name: ${o.name}`);const e=this._allData.push(new u(o))-1;t.set(o.name,e),this._allOutputIndices.push(e),this._allOutputNames.push(o.name)}if(!e.node)throw new Error("missing information in graph: node");for(const o of e.node){if(!o.name)for(let t=0;;t++){const e=`unnamed_${o.opType}_${t}`;if(!n.has(e)){o.name=e;break}}if(n.has(o.name))throw new Error(`duplicated node name: ${o.name}`);const e=this._nodes.push(new c(o))-1;n.set(o.name,e)}for(let o=0;o<this._nodes.length;o++){const n=this._nodes[o],r=e.node[o];if(!r.output)throw new Error(`missing output for node: ${r.name}`);for(const e of r.output){let a=t.get(e);if(void 0===a&&(a=this._allData.push(new u)-1,t.set(e,a)),n.outputs.push(a),void 0!==this._allData[a]._from)throw new Error(`multiple nodes output to one data value: ${a}`);if(this._allData[a]._from=o,"Constant"===r.opType){if(!r.attribute||1!==r.attribute.length||!r.attribute[0].t)throw new Error("missing attributes or missing tensor value in attributes for this Constant operator");if(!r.output||1!==r.output.length)throw new Error("missing output or incorrect number of outputs for this Constant operator");n.outputs.pop(),n.executeNode=!1,this._allData[a]._from=-1,this._allData[a].tensor=i.Tensor.fromProto(r.attribute[0].t)}}}for(let o=0;o<this._nodes.length;o++){const n=this._nodes[o],r=e.node[o];if(!r.input)throw new Error(`missing input for node: ${r.name}`);for(const e of r.input){const a=t.get(e);if(void 0===a){if(""===e&&3===r.input.length&&"Resize"===r.opType)continue;throw new Error(`unrecognized input '${e}' for node: ${r.name}`)}n.inputs.push(a),this._allData[a]._to.push(o)}}return!0}buildGraphFromOrtFormat(e){var t,n,r;const o=new Map;this._allData=[],this._allInputIndices=[],this._allInputNames=[],this._allOutputIndices=[],this._allOutputNames=[],this._nodes=[];const a=new Map,d=[];for(let i=0;i<e.inputsLength();i++){const a=e.inputs(i);if(o.has(a))throw new Error(`duplicated input name: ${a}`);for(let i=0;i<e.nodeArgsLength();i++)if((null===(t=e.nodeArgs(i))||void 0===t?void 0:t.name())===a){const t=new u;if((null===(r=null===(n=e.nodeArgs(i))||void 0===n?void 0:n.type())||void 0===r?void 0:r.valueType())!==l.TypeInfoValue.tensor_type)throw new Error("Unexpected value type for the nodeArg.");const c=e.nodeArgs(i).type().value(new l.TensorTypeAndShape),f=s.ProtoUtil.tensorDataTypeFromProto(c.elemType()),p=c.shape(),h=[];for(let e=0;e<p.dimLength();e++)h.push(s.LongUtil.longToNumber(p.dim(e).value().dimValue()));t.type={shape:{dims:h},tensorType:f};const m=this._allData.push(t)-1;o.set(a,m),d.push(a)}}for(let l=0;l<e.initializersLength();l++){const t=e.initializers(l);let n=o.get(t.name());if(void 0===n){const e=new u,r=s.ProtoUtil.tensorDimsFromORTFormat(t),a=s.ProtoUtil.tensorDataTypeFromProto(t.dataType());e.type={shape:{dims:r},tensorType:a},n=this._allData.push(e)-1,o.set(t.name(),n)}this._allData[n]._from=-1,this._allData[n].tensor=i.Tensor.fromOrtTensor(t)}for(let i=0;i<this._allData.length;i++)this._allData[i].tensor||(this._allInputIndices.push(i),this._allInputNames.push(d[i]));for(let i=0;i<e.outputsLength();i++){const t=e.outputs(i);if(o.has(t))throw new Error(`duplicated output name: ${t}`);const n=this._allData.push(new u)-1;o.set(t,n),this._allOutputIndices.push(n),this._allOutputNames.push(t)}if(!e.nodes)throw new Error("missing information in graph: node");for(let i=0;i<e.nodesLength();i++){const t=e.nodes(i);let n=t.name();if(!n)for(let e=0;n=`unnamed_${t.opType()}_${e}`,a.has(n);e++);if(a.has(n))throw new Error(`duplicated node name: ${n}`);const r=this._nodes.push(new c(t,n))-1;a.set(n,r)}for(let s=0;s<this._nodes.length;s++){const t=this._nodes[s],n=e.nodes(s);if(null==n)throw new Error(`No node exists at index ${s}`);if(0===(null==n?void 0:n.outputsLength()))throw new Error(`missing output for node: ${n.name}`);for(let e=0;e<(null==n?void 0:n.outputsLength());e++){const r=null==n?void 0:n.outputs(e);let a=o.get(r);if(void 0===a&&(a=this._allData.push(new u)-1,o.set(r,a)),t.outputs.push(a),void 0!==this._allData[a]._from)throw new Error(`multiple nodes output to one data value: ${a}`);if(this._allData[a]._from=s,"Constant"===n.opType()){if(1!==n.attributesLength()||!n.attributes(0).t())throw new Error("missing attributes or missing tensor value in attributes for this Constant operator");if(1!==n.outputsLength())throw new Error("missing output or incorrect number of outputs for this Constant operator");t.outputs.pop(),t.executeNode=!1,this._allData[a]._from=-1,this._allData[a].tensor=i.Tensor.fromOrtTensor(n.attributes(0).t())}}}for(let i=0;i<this._nodes.length;i++){const t=this._nodes[i],n=e.nodes(i);if(0===n.inputsLength())throw new Error(`missing input for node: ${n.name}`);for(let e=0;e<n.inputsLength();e++){const r=n.inputs(e),a=o.get(r);if(void 0===a)throw new Error(`unrecognized input '${r}' for node: ${n.name()}`);t.inputs.push(a),this._allData[a]._to.push(i)}}}checkIsAcyclic(){const e=new Set;this._allInputIndices.forEach(t=>{this._allData[t]._to.forEach(t=>{e.add(t)})});const t=Array.from(e),n=new Array(this._nodes.length).fill("white");for(;t.length>0;){const e=t.pop();"gray"===n[e]?n[e]="black":(t.push(e),n[e]="gray",this._nodes[e].outputs.forEach(r=>{const o=this._allData[r];if(void 0!==o.tensor)throw new Error("node outputs should not be initialized");if(o._from!==e)throw new Error("from property of the Value object doesn't match index of Node being processed");o._to.forEach(e=>{if("gray"===n[e])throw new Error("model graph is cyclic");"white"===n[e]&&t.push(e)})}))}}transformGraph(e){this.removeAllIdentityNodes(),this.removeAllDropoutNodes(),this.fuseConvActivationNodes(),e&&e.transformGraph(this),this.finalizeGraph()}finalizeGraph(){let e=0;for(let t=0;t<this._nodes.length;t++)this._nodes[t].executeNode?e>0&&(this._nodes[t].inputs.forEach(n=>{const r=this._allData[n]._to.indexOf(t+e);-1!==r&&(this._allData[n]._to[r]=t)}),this._nodes[t].outputs.forEach(n=>{this._allData[n]._from&&this._allData[n]._from===t+e&&(this._allData[n]._from=t)})):(e++,this._nodes[t].outputs.forEach(e=>{this._allData[e]._from=-2}),this._nodes.splice(t,1),t--);e=0;for(let t=0;t<this._allData.length;t++)if(-2!==this._allData[t].from||-1!==this._allOutputIndices.indexOf(t+e)){if(e>0){let n=-1;void 0!==this._allData[t].from&&-1!==this._allData[t].from?(n=this._nodes[this._allData[t].from].outputs.indexOf(t+e),-1!==n&&(this._nodes[this._allData[t].from].outputs[n]=t)):(n=this._allInputIndices.indexOf(t+e),-1!==n&&(this._allInputIndices[n]=t)),this._allData[t].to.forEach(r=>{n=this._nodes[r].inputs.indexOf(t+e),-1!==n&&(this._nodes[r].inputs[n]=t)}),0===this._allData[t].to.length&&(n=this._allOutputIndices.indexOf(t+e),-1!==n&&(this._allOutputIndices[n]=t))}}else e++,this._allData.splice(t,1),t--}deleteNode(e){const t=this._nodes[e];if(t.outputs.length>1)for(let s=1;s<t.outputs.length;s++)if(this._allData[t.outputs[s]].to.length>0)throw new Error("Node deletion with more than one output connected to other nodes is not supported. ");t.executeNode=!1;const n=t.inputs[0],r=t.outputs[0],o=this._allData[r].to,a=this._allData[n].to.indexOf(e);if(-1===a)throw new Error("The Value object doesn't have the current Node in it's 'to' property ");this._allData[n].to.splice(a,1),this._allData[r]._to=[];const i=this._allOutputIndices.indexOf(r);if(-1!==i&&(this._allOutputIndices[i]=n),o&&o.length>0)for(const s of o){const e=this._nodes[s].inputs.indexOf(r);if(-1===e)throw new Error("The Node object doesn't have the output Value in it's 'inputs' property ");this._nodes[s].inputs[e]=n,this._allData[n].to.push(s)}}removeAllDropoutNodes(){let e=0;for(const t of this._nodes){if("Dropout"===t.opType){if(1!==t.inputs.length)throw new Error("Dropout nodes should only contain one input. ");if(1!==t.outputs.length&&2!==t.outputs.length)throw new Error("Dropout nodes should contain either 1 or 2 output(s)");if(2===t.outputs.length&&0!==this._allData[t.outputs[1]]._to.length)throw new Error("Dropout nodes's second output should not be referenced by other nodes");this.deleteNode(e)}e++}}removeAllIdentityNodes(){let e=0;for(const t of this._nodes)"Identity"===t.opType&&this.deleteNode(e),e++}isActivation(e){switch(e.opType){case"Relu":case"Sigmoid":case"Clip":return!0;default:return!1}}fuseConvActivationNodes(){for(const t of this._nodes)if("Conv"===t.opType){const n=this._allData[t.outputs[0]]._to;if(1===n.length&&this.isActivation(this._nodes[n[0]])){const r=this._nodes[n[0]];if("Clip"===r.opType)if(1===r.inputs.length)try{t.attributes.set("activation_params","floats",[r.attributes.getFloat("min"),r.attributes.getFloat("max")])}catch(e){t.attributes.set("activation_params","floats",[s.MIN_CLIP,s.MAX_CLIP])}else{if(!(r.inputs.length>=3&&void 0!==this._allData[r.inputs[1]].tensor&&void 0!==this._allData[r.inputs[2]].tensor))continue;t.attributes.set("activation_params","floats",[this._allData[r.inputs[1]].tensor.floatData[0],this._allData[r.inputs[2]].tensor.floatData[0]])}t.attributes.set("activation","string",r.opType),this.deleteNode(n[0])}}}}},6231:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.now=t.Profiler=t.Logger=void 0;const n={verbose:1e3,info:2e3,warning:4e3,error:5e3,fatal:6e3},r={none:new class{log(e,t,n){}},console:new class{log(e,t,n){console.log(`${this.color(e)} ${n?""+n+" ":""}${t}`)}color(e){switch(e){case"verbose":return"v";case"info":return"i";case"warning":return"w";case"error":return"e";case"fatal":return"f";default:throw new Error(`unsupported severity: ${e}`)}}}},o={provider:"console",minimalSeverity:"warning",logDateTime:!0,logSourceLocation:!1};let a={"":o};function i(e,t,n,r){if(void 0===t)return o=e,{verbose:i.verbose.bind(null,o),info:i.info.bind(null,o),warning:i.warning.bind(null,o),error:i.error.bind(null,o),fatal:i.fatal.bind(null,o)};if(void 0===n)s(e,t);else if("number"==typeof n&&void 0===r)s(e,t);else if("string"==typeof n&&void 0===r)s(e,n,0,t);else{if("string"!=typeof n||"number"!=typeof r)throw new TypeError("input is valid");s(e,n,0,t)}var o}function s(e,t,o,i){const s=a[i||""]||a[""];n[e]<n[s.minimalSeverity]||(s.logDateTime&&(t=`${(new Date).toISOString()}|${t}`),s.logSourceLocation,r[s.provider].log(e,t,i))}!function(e){function t(e){a={},n("",e||{})}function n(e,n){if("*"===e)t(n);else{const t=a[e]||o;a[e]={provider:n.provider||t.provider,minimalSeverity:n.minimalSeverity||t.minimalSeverity,logDateTime:void 0===n.logDateTime?t.logDateTime:n.logDateTime,logSourceLocation:void 0===n.logSourceLocation?t.logSourceLocation:n.logSourceLocation}}}e.verbose=function(t,n){e("verbose",t,n)},e.info=function(t,n){e("info",t,n)},e.warning=function(t,n){e("warning",t,n)},e.error=function(t,n){e("error",t,n)},e.fatal=function(t,n){e("fatal",t,n)},e.reset=t,e.set=n,e.setWithEnv=function(e){const t={};e.logLevel&&(t.minimalSeverity=e.logLevel),n("",t)}}(i||(i={})),t.Logger=i;class l{constructor(e,t,n,r,o,a){this.category=e,this.name=t,this.startTime=n,this.endCallback=r,this.timer=o,this.ctx=a}end(){return this.endCallback(this)}async checkTimer(){if(void 0===this.ctx||void 0===this.timer)throw new Error("No webgl timer found");return this.ctx.endTimer(),this.ctx.waitForQueryAndGetTime(this.timer)}}class u{constructor(e,t,n,r){this.category=e,this.name=t,this.startTime=n,this.endTime=r}}t.Profiler=class{static create(e){return void 0===e?new this:new this(e.maxNumberEvents,e.flushBatchSize,e.flushIntervalInMilliseconds)}constructor(e,t,n){this._started=!1,this._flushPointer=0,this._started=!1,this._maxNumberEvents=void 0===e?1e4:e,this._flushBatchSize=void 0===t?10:t,this._flushIntervalInMilliseconds=void 0===n?5e3:n}start(){this._started=!0,this._timingEvents=[],this._flushTime=(0,t.now)(),this._flushPointer=0}stop(){for(this._started=!1;this._flushPointer<this._timingEvents.length;this._flushPointer++)this.logOneEvent(this._timingEvents[this._flushPointer])}event(e,t,n,r){const o=this._started?this.begin(e,t,r):void 0;let a=!1;const i=n();if(i&&"function"==typeof i.then)return a=!0,new Promise((e,t)=>{i.then(async t=>{o&&await o.end(),e(t)},async e=>{o&&await o.end(),t(e)})});if(!a&&o){const e=o.end();if(e&&"function"==typeof e.then)return new Promise((t,n)=>{e.then(()=>{t(i)},e=>{n(e)})})}return i}begin(e,n,r){if(!this._started)throw new Error("profiler is not started yet");if(void 0===r){const r=(0,t.now)();return this.flush(r),new l(e,n,r,e=>this.endSync(e))}{const t=r.beginTimer();return new l(e,n,0,async e=>this.end(e),t,r)}}async end(e){const t=await e.checkTimer();this._timingEvents.length<this._maxNumberEvents&&(this._timingEvents.push(new u(e.category,e.name,e.startTime,t)),this.flush(t))}endSync(e){const n=(0,t.now)();this._timingEvents.length<this._maxNumberEvents&&(this._timingEvents.push(new u(e.category,e.name,e.startTime,n)),this.flush(n))}logOneEvent(e){t.Logger.verbose(`Profiler.${e.category}`,`${(e.endTime-e.startTime).toFixed(2)}ms on event '${e.name}' at ${e.endTime.toFixed(2)}`)}flush(e){if(this._timingEvents.length-this._flushPointer>=this._flushBatchSize||e-this._flushTime>=this._flushIntervalInMilliseconds){for(const e=this._flushPointer;this._flushPointer<e+this._flushBatchSize&&this._flushPointer<this._timingEvents.length;this._flushPointer++)this.logOneEvent(this._timingEvents[this._flushPointer]);this._flushTime=(0,t.now)()}}get started(){return this._started}},t.now="undefined"!=typeof performance&&performance.now?()=>performance.now():Date.now},2644:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Model=void 0;const r=n(5686),o=n(1446),a=n(7070),i=n(9395),s=n(2517);var l=i.onnxruntime.experimental.fbs;t.Model=class{constructor(){}load(e,t,n){if(!n)try{return void this.loadFromOnnxFormat(e,t)}catch(r){if(void 0!==n)throw r}this.loadFromOrtFormat(e,t)}loadFromOnnxFormat(e,t){const n=o.onnx.ModelProto.decode(e);if(s.LongUtil.longToNumber(n.irVersion)<3)throw new Error("only support ONNX model with IR_VERSION>=3");this._opsets=n.opsetImport.map(e=>({domain:e.domain,version:s.LongUtil.longToNumber(e.version)})),this._graph=a.Graph.from(n.graph,t)}loadFromOrtFormat(e,t){const n=new r.flatbuffers.ByteBuffer(e),o=l.InferenceSession.getRootAsInferenceSession(n).model();if(s.LongUtil.longToNumber(o.irVersion())<3)throw new Error("only support ONNX model with IR_VERSION>=3");this._opsets=[];for(let r=0;r<o.opsetImportLength();r++){const e=o.opsetImport(r);this._opsets.push({domain:null==e?void 0:e.domain(),version:s.LongUtil.longToNumber(e.version())})}this._graph=a.Graph.from(o.graph(),t)}get graph(){return this._graph}get opsets(){return this._opsets}}},782:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FLOAT_TYPES=t.INT_TYPES=t.NUMBER_TYPES=void 0,t.NUMBER_TYPES=["float32","float64","int32","int16","int8","uint16","uint32","uint8"],t.INT_TYPES=["int32","int16","int8","uint16","uint32","uint8"],t.FLOAT_TYPES=["float32","float64"]},1047:(e,t)=>{function n(e,t){if(t.endsWith("+")){const n=Number.parseInt(t.substring(0,t.length-1),10);return!isNaN(n)&&n<=e}if(2===t.split("-").length){const n=t.split("-"),r=Number.parseInt(n[0],10),o=Number.parseInt(n[1],10);return!isNaN(r)&&!isNaN(o)&&r<=e&&e<=o}return Number.parseInt(t,10)===e}Object.defineProperty(t,"__esModule",{value:!0}),t.resolveOperator=void 0,t.resolveOperator=function(e,t,r){for(const o of r){const r=o[0],a=o[1],i=o[2],s=o[3],l=o[4];if(e.opType===r)for(const e of t)if((e.domain===a||"ai.onnx"===e.domain&&""===a)&&n(e.version,i))return{opImpl:s,opInit:l}}throw new TypeError(`cannot resolve operator '${e.opType}' with opsets: ${t.map(e=>`${e.domain||"ai.onnx"} v${e.version}`).join(", ")}`)}},9395:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.onnxruntime=void 0;const r=n(5686);var o,a,i,s;o=t.onnxruntime||(t.onnxruntime={}),i=(a=o.experimental||(o.experimental={})).fbs||(a.fbs={}),(s=i.AttributeType||(i.AttributeType={}))[s.UNDEFINED=0]="UNDEFINED",s[s.FLOAT=1]="FLOAT",s[s.INT=2]="INT",s[s.STRING=3]="STRING",s[s.TENSOR=4]="TENSOR",s[s.GRAPH=5]="GRAPH",s[s.FLOATS=6]="FLOATS",s[s.INTS=7]="INTS",s[s.STRINGS=8]="STRINGS",s[s.TENSORS=9]="TENSORS",s[s.GRAPHS=10]="GRAPHS",s[s.SPARSE_TENSOR=11]="SPARSE_TENSOR",s[s.SPARSE_TENSORS=12]="SPARSE_TENSORS",function(e){!function(e){var t,n;t=e.fbs||(e.fbs={}),(n=t.DimensionValueType||(t.DimensionValueType={}))[n.UNKNOWN=0]="UNKNOWN",n[n.VALUE=1]="VALUE",n[n.PARAM=2]="PARAM"}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(e){var t,n;t=e.fbs||(e.fbs={}),(n=t.TensorDataType||(t.TensorDataType={}))[n.UNDEFINED=0]="UNDEFINED",n[n.FLOAT=1]="FLOAT",n[n.UINT8=2]="UINT8",n[n.INT8=3]="INT8",n[n.UINT16=4]="UINT16",n[n.INT16=5]="INT16",n[n.INT32=6]="INT32",n[n.INT64=7]="INT64",n[n.STRING=8]="STRING",n[n.BOOL=9]="BOOL",n[n.FLOAT16=10]="FLOAT16",n[n.DOUBLE=11]="DOUBLE",n[n.UINT32=12]="UINT32",n[n.UINT64=13]="UINT64",n[n.COMPLEX64=14]="COMPLEX64",n[n.COMPLEX128=15]="COMPLEX128",n[n.BFLOAT16=16]="BFLOAT16"}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(e){var t,n;t=e.fbs||(e.fbs={}),(n=t.NodeType||(t.NodeType={}))[n.Primitive=0]="Primitive",n[n.Fused=1]="Fused"}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(e){var t,n;t=e.fbs||(e.fbs={}),(n=t.TypeInfoValue||(t.TypeInfoValue={}))[n.NONE=0]="NONE",n[n.tensor_type=1]="tensor_type",n[n.sequence_type=2]="sequence_type",n[n.map_type=3]="map_type"}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){var t;!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsShape(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsShape(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}dim(t,n){let r=this.bb.__offset(this.bb_pos,4);return r?(n||new e.experimental.fbs.Dimension).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}dimLength(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__vector_len(this.bb_pos+e):0}static startShape(e){e.startObject(1)}static addDim(e,t){e.addFieldOffset(0,t,0)}static createDimVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startDimVector(e,t){e.startVector(4,t,4)}static endShape(e){return e.endObject()}static createShape(e,t){return n.startShape(e),n.addDim(e,t),n.endShape(e)}}t.Shape=n}((t=e.experimental||(e.experimental={})).fbs||(t.fbs={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){var t;!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDimension(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDimension(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}value(t){let n=this.bb.__offset(this.bb_pos,4);return n?(t||new e.experimental.fbs.DimensionValue).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}denotation(e){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__string(this.bb_pos+t,e):null}static startDimension(e){e.startObject(2)}static addValue(e,t){e.addFieldOffset(0,t,0)}static addDenotation(e,t){e.addFieldOffset(1,t,0)}static endDimension(e){return e.endObject()}static createDimension(e,t,r){return n.startDimension(e),n.addValue(e,t),n.addDenotation(e,r),n.endDimension(e)}}t.Dimension=n}((t=e.experimental||(e.experimental={})).fbs||(t.fbs={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){var t;!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDimensionValue(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDimensionValue(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}dimType(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt8(this.bb_pos+t):e.experimental.fbs.DimensionValueType.UNKNOWN}dimValue(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt64(this.bb_pos+e):this.bb.createLong(0,0)}dimParam(e){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__string(this.bb_pos+t,e):null}static startDimensionValue(e){e.startObject(3)}static addDimType(t,n){t.addFieldInt8(0,n,e.experimental.fbs.DimensionValueType.UNKNOWN)}static addDimValue(e,t){e.addFieldInt64(1,t,e.createLong(0,0))}static addDimParam(e,t){e.addFieldOffset(2,t,0)}static endDimensionValue(e){return e.endObject()}static createDimensionValue(e,t,r,o){return n.startDimensionValue(e),n.addDimType(e,t),n.addDimValue(e,r),n.addDimParam(e,o),n.endDimensionValue(e)}}t.DimensionValue=n}((t=e.experimental||(e.experimental={})).fbs||(t.fbs={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){var t;!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsTensorTypeAndShape(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsTensorTypeAndShape(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}elemType(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):e.experimental.fbs.TensorDataType.UNDEFINED}shape(t){let n=this.bb.__offset(this.bb_pos,6);return n?(t||new e.experimental.fbs.Shape).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}static startTensorTypeAndShape(e){e.startObject(2)}static addElemType(t,n){t.addFieldInt32(0,n,e.experimental.fbs.TensorDataType.UNDEFINED)}static addShape(e,t){e.addFieldOffset(1,t,0)}static endTensorTypeAndShape(e){return e.endObject()}static createTensorTypeAndShape(e,t,r){return n.startTensorTypeAndShape(e),n.addElemType(e,t),n.addShape(e,r),n.endTensorTypeAndShape(e)}}t.TensorTypeAndShape=n}((t=e.experimental||(e.experimental={})).fbs||(t.fbs={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){var t;!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsMapType(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsMapType(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}keyType(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):e.experimental.fbs.TensorDataType.UNDEFINED}valueType(t){let n=this.bb.__offset(this.bb_pos,6);return n?(t||new e.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}static startMapType(e){e.startObject(2)}static addKeyType(t,n){t.addFieldInt32(0,n,e.experimental.fbs.TensorDataType.UNDEFINED)}static addValueType(e,t){e.addFieldOffset(1,t,0)}static endMapType(e){return e.endObject()}static createMapType(e,t,r){return n.startMapType(e),n.addKeyType(e,t),n.addValueType(e,r),n.endMapType(e)}}t.MapType=n}((t=e.experimental||(e.experimental={})).fbs||(t.fbs={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){var t;!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsSequenceType(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsSequenceType(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}elemType(t){let n=this.bb.__offset(this.bb_pos,4);return n?(t||new e.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}static startSequenceType(e){e.startObject(1)}static addElemType(e,t){e.addFieldOffset(0,t,0)}static endSequenceType(e){return e.endObject()}static createSequenceType(e,t){return n.startSequenceType(e),n.addElemType(e,t),n.endSequenceType(e)}}t.SequenceType=n}((t=e.experimental||(e.experimental={})).fbs||(t.fbs={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(e){(e.fbs||(e.fbs={})).EdgeEnd=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}nodeIndex(){return this.bb.readUint32(this.bb_pos)}srcArgIndex(){return this.bb.readInt32(this.bb_pos+4)}dstArgIndex(){return this.bb.readInt32(this.bb_pos+8)}static createEdgeEnd(e,t,n,r){return e.prep(4,12),e.writeInt32(r),e.writeInt32(n),e.writeInt32(t),e.offset()}}}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){var t;!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsNodeEdge(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsNodeEdge(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}nodeIndex(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readUint32(this.bb_pos+e):0}inputEdges(t,n){let r=this.bb.__offset(this.bb_pos,6);return r?(n||new e.experimental.fbs.EdgeEnd).__init(this.bb.__vector(this.bb_pos+r)+12*t,this.bb):null}inputEdgesLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}outputEdges(t,n){let r=this.bb.__offset(this.bb_pos,8);return r?(n||new e.experimental.fbs.EdgeEnd).__init(this.bb.__vector(this.bb_pos+r)+12*t,this.bb):null}outputEdgesLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}static startNodeEdge(e){e.startObject(3)}static addNodeIndex(e,t){e.addFieldInt32(0,t,0)}static addInputEdges(e,t){e.addFieldOffset(1,t,0)}static startInputEdgesVector(e,t){e.startVector(12,t,4)}static addOutputEdges(e,t){e.addFieldOffset(2,t,0)}static startOutputEdgesVector(e,t){e.startVector(12,t,4)}static endNodeEdge(e){return e.endObject()}static createNodeEdge(e,t,r,o){return n.startNodeEdge(e),n.addNodeIndex(e,t),n.addInputEdges(e,r),n.addOutputEdges(e,o),n.endNodeEdge(e)}}t.NodeEdge=n}((t=e.experimental||(e.experimental={})).fbs||(t.fbs={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){var t;!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsNode(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsNode(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}name(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}docString(e){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__string(this.bb_pos+t,e):null}domain(e){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__string(this.bb_pos+t,e):null}sinceVersion(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt32(this.bb_pos+e):0}index(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.readUint32(this.bb_pos+e):0}opType(e){let t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__string(this.bb_pos+t,e):null}type(){let t=this.bb.__offset(this.bb_pos,16);return t?this.bb.readInt32(this.bb_pos+t):e.experimental.fbs.NodeType.Primitive}executionProviderType(e){let t=this.bb.__offset(this.bb_pos,18);return t?this.bb.__string(this.bb_pos+t,e):null}inputs(e,t){let n=this.bb.__offset(this.bb_pos,20);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*e,t):null}inputsLength(){let e=this.bb.__offset(this.bb_pos,20);return e?this.bb.__vector_len(this.bb_pos+e):0}outputs(e,t){let n=this.bb.__offset(this.bb_pos,22);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*e,t):null}outputsLength(){let e=this.bb.__offset(this.bb_pos,22);return e?this.bb.__vector_len(this.bb_pos+e):0}attributes(t,n){let r=this.bb.__offset(this.bb_pos,24);return r?(n||new e.experimental.fbs.Attribute).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}attributesLength(){let e=this.bb.__offset(this.bb_pos,24);return e?this.bb.__vector_len(this.bb_pos+e):0}inputArgCounts(e){let t=this.bb.__offset(this.bb_pos,26);return t?this.bb.readInt32(this.bb.__vector(this.bb_pos+t)+4*e):0}inputArgCountsLength(){let e=this.bb.__offset(this.bb_pos,26);return e?this.bb.__vector_len(this.bb_pos+e):0}inputArgCountsArray(){let e=this.bb.__offset(this.bb_pos,26);return e?new Int32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}implicitInputs(e,t){let n=this.bb.__offset(this.bb_pos,28);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*e,t):null}implicitInputsLength(){let e=this.bb.__offset(this.bb_pos,28);return e?this.bb.__vector_len(this.bb_pos+e):0}static startNode(e){e.startObject(13)}static addName(e,t){e.addFieldOffset(0,t,0)}static addDocString(e,t){e.addFieldOffset(1,t,0)}static addDomain(e,t){e.addFieldOffset(2,t,0)}static addSinceVersion(e,t){e.addFieldInt32(3,t,0)}static addIndex(e,t){e.addFieldInt32(4,t,0)}static addOpType(e,t){e.addFieldOffset(5,t,0)}static addType(t,n){t.addFieldInt32(6,n,e.experimental.fbs.NodeType.Primitive)}static addExecutionProviderType(e,t){e.addFieldOffset(7,t,0)}static addInputs(e,t){e.addFieldOffset(8,t,0)}static createInputsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startInputsVector(e,t){e.startVector(4,t,4)}static addOutputs(e,t){e.addFieldOffset(9,t,0)}static createOutputsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startOutputsVector(e,t){e.startVector(4,t,4)}static addAttributes(e,t){e.addFieldOffset(10,t,0)}static createAttributesVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startAttributesVector(e,t){e.startVector(4,t,4)}static addInputArgCounts(e,t){e.addFieldOffset(11,t,0)}static createInputArgCountsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addInt32(t[n]);return e.endVector()}static startInputArgCountsVector(e,t){e.startVector(4,t,4)}static addImplicitInputs(e,t){e.addFieldOffset(12,t,0)}static createImplicitInputsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startImplicitInputsVector(e,t){e.startVector(4,t,4)}static endNode(e){return e.endObject()}static createNode(e,t,r,o,a,i,s,l,u,c,d,f,p,h){return n.startNode(e),n.addName(e,t),n.addDocString(e,r),n.addDomain(e,o),n.addSinceVersion(e,a),n.addIndex(e,i),n.addOpType(e,s),n.addType(e,l),n.addExecutionProviderType(e,u),n.addInputs(e,c),n.addOutputs(e,d),n.addAttributes(e,f),n.addInputArgCounts(e,p),n.addImplicitInputs(e,h),n.endNode(e)}}t.Node=n}((t=e.experimental||(e.experimental={})).fbs||(t.fbs={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){var t;!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsValueInfo(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsValueInfo(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}name(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}docString(e){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__string(this.bb_pos+t,e):null}type(t){let n=this.bb.__offset(this.bb_pos,8);return n?(t||new e.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}static startValueInfo(e){e.startObject(3)}static addName(e,t){e.addFieldOffset(0,t,0)}static addDocString(e,t){e.addFieldOffset(1,t,0)}static addType(e,t){e.addFieldOffset(2,t,0)}static endValueInfo(e){return e.endObject()}static createValueInfo(e,t,r,o){return n.startValueInfo(e),n.addName(e,t),n.addDocString(e,r),n.addType(e,o),n.endValueInfo(e)}}t.ValueInfo=n}((t=e.experimental||(e.experimental={})).fbs||(t.fbs={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){var t;!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsTypeInfo(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsTypeInfo(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}denotation(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}valueType(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):e.experimental.fbs.TypeInfoValue.NONE}value(e){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__union(e,this.bb_pos+t):null}static startTypeInfo(e){e.startObject(3)}static addDenotation(e,t){e.addFieldOffset(0,t,0)}static addValueType(t,n){t.addFieldInt8(1,n,e.experimental.fbs.TypeInfoValue.NONE)}static addValue(e,t){e.addFieldOffset(2,t,0)}static endTypeInfo(e){return e.endObject()}static createTypeInfo(e,t,r,o){return n.startTypeInfo(e),n.addDenotation(e,t),n.addValueType(e,r),n.addValue(e,o),n.endTypeInfo(e)}}t.TypeInfo=n}((t=e.experimental||(e.experimental={})).fbs||(t.fbs={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(e){!function(e){class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsOperatorSetId(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsOperatorSetId(e,n){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(n||new t).__init(e.readInt32(e.position())+e.position(),e)}domain(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}version(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt64(this.bb_pos+e):this.bb.createLong(0,0)}static startOperatorSetId(e){e.startObject(2)}static addDomain(e,t){e.addFieldOffset(0,t,0)}static addVersion(e,t){e.addFieldInt64(1,t,e.createLong(0,0))}static endOperatorSetId(e){return e.endObject()}static createOperatorSetId(e,n,r){return t.startOperatorSetId(e),t.addDomain(e,n),t.addVersion(e,r),t.endOperatorSetId(e)}}e.OperatorSetId=t}(e.fbs||(e.fbs={}))}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){var t;!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsTensor(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsTensor(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}name(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}docString(e){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__string(this.bb_pos+t,e):null}dims(e){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readInt64(this.bb.__vector(this.bb_pos+t)+8*e):this.bb.createLong(0,0)}dimsLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}dataType(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt32(this.bb_pos+t):e.experimental.fbs.TensorDataType.UNDEFINED}rawData(e){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.readUint8(this.bb.__vector(this.bb_pos+t)+e):0}rawDataLength(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}rawDataArray(){let e=this.bb.__offset(this.bb_pos,12);return e?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}stringData(e,t){let n=this.bb.__offset(this.bb_pos,14);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*e,t):null}stringDataLength(){let e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__vector_len(this.bb_pos+e):0}static startTensor(e){e.startObject(6)}static addName(e,t){e.addFieldOffset(0,t,0)}static addDocString(e,t){e.addFieldOffset(1,t,0)}static addDims(e,t){e.addFieldOffset(2,t,0)}static createDimsVector(e,t){e.startVector(8,t.length,8);for(let n=t.length-1;n>=0;n--)e.addInt64(t[n]);return e.endVector()}static startDimsVector(e,t){e.startVector(8,t,8)}static addDataType(t,n){t.addFieldInt32(3,n,e.experimental.fbs.TensorDataType.UNDEFINED)}static addRawData(e,t){e.addFieldOffset(4,t,0)}static createRawDataVector(e,t){e.startVector(1,t.length,1);for(let n=t.length-1;n>=0;n--)e.addInt8(t[n]);return e.endVector()}static startRawDataVector(e,t){e.startVector(1,t,1)}static addStringData(e,t){e.addFieldOffset(5,t,0)}static createStringDataVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startStringDataVector(e,t){e.startVector(4,t,4)}static endTensor(e){return e.endObject()}static createTensor(e,t,r,o,a,i,s){return n.startTensor(e),n.addName(e,t),n.addDocString(e,r),n.addDims(e,o),n.addDataType(e,a),n.addRawData(e,i),n.addStringData(e,s),n.endTensor(e)}}t.Tensor=n}((t=e.experimental||(e.experimental={})).fbs||(t.fbs={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){var t;!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsSparseTensor(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsSparseTensor(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}values(t){let n=this.bb.__offset(this.bb_pos,4);return n?(t||new e.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}indices(t){let n=this.bb.__offset(this.bb_pos,6);return n?(t||new e.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}dims(e){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readInt64(this.bb.__vector(this.bb_pos+t)+8*e):this.bb.createLong(0,0)}dimsLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}static startSparseTensor(e){e.startObject(3)}static addValues(e,t){e.addFieldOffset(0,t,0)}static addIndices(e,t){e.addFieldOffset(1,t,0)}static addDims(e,t){e.addFieldOffset(2,t,0)}static createDimsVector(e,t){e.startVector(8,t.length,8);for(let n=t.length-1;n>=0;n--)e.addInt64(t[n]);return e.endVector()}static startDimsVector(e,t){e.startVector(8,t,8)}static endSparseTensor(e){return e.endObject()}static createSparseTensor(e,t,r,o){return n.startSparseTensor(e),n.addValues(e,t),n.addIndices(e,r),n.addDims(e,o),n.endSparseTensor(e)}}t.SparseTensor=n}((t=e.experimental||(e.experimental={})).fbs||(t.fbs={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){var t;!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsAttribute(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsAttribute(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}name(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}docString(e){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__string(this.bb_pos+t,e):null}type(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readInt32(this.bb_pos+t):e.experimental.fbs.AttributeType.UNDEFINED}f(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readFloat32(this.bb_pos+e):0}i(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.readInt64(this.bb_pos+e):this.bb.createLong(0,0)}s(e){let t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__string(this.bb_pos+t,e):null}t(t){let n=this.bb.__offset(this.bb_pos,16);return n?(t||new e.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}g(t){let n=this.bb.__offset(this.bb_pos,18);return n?(t||new e.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}floats(e){let t=this.bb.__offset(this.bb_pos,20);return t?this.bb.readFloat32(this.bb.__vector(this.bb_pos+t)+4*e):0}floatsLength(){let e=this.bb.__offset(this.bb_pos,20);return e?this.bb.__vector_len(this.bb_pos+e):0}floatsArray(){let e=this.bb.__offset(this.bb_pos,20);return e?new Float32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}ints(e){let t=this.bb.__offset(this.bb_pos,22);return t?this.bb.readInt64(this.bb.__vector(this.bb_pos+t)+8*e):this.bb.createLong(0,0)}intsLength(){let e=this.bb.__offset(this.bb_pos,22);return e?this.bb.__vector_len(this.bb_pos+e):0}strings(e,t){let n=this.bb.__offset(this.bb_pos,24);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*e,t):null}stringsLength(){let e=this.bb.__offset(this.bb_pos,24);return e?this.bb.__vector_len(this.bb_pos+e):0}tensors(t,n){let r=this.bb.__offset(this.bb_pos,26);return r?(n||new e.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}tensorsLength(){let e=this.bb.__offset(this.bb_pos,26);return e?this.bb.__vector_len(this.bb_pos+e):0}graphs(t,n){let r=this.bb.__offset(this.bb_pos,28);return r?(n||new e.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}graphsLength(){let e=this.bb.__offset(this.bb_pos,28);return e?this.bb.__vector_len(this.bb_pos+e):0}static startAttribute(e){e.startObject(13)}static addName(e,t){e.addFieldOffset(0,t,0)}static addDocString(e,t){e.addFieldOffset(1,t,0)}static addType(t,n){t.addFieldInt32(2,n,e.experimental.fbs.AttributeType.UNDEFINED)}static addF(e,t){e.addFieldFloat32(3,t,0)}static addI(e,t){e.addFieldInt64(4,t,e.createLong(0,0))}static addS(e,t){e.addFieldOffset(5,t,0)}static addT(e,t){e.addFieldOffset(6,t,0)}static addG(e,t){e.addFieldOffset(7,t,0)}static addFloats(e,t){e.addFieldOffset(8,t,0)}static createFloatsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addFloat32(t[n]);return e.endVector()}static startFloatsVector(e,t){e.startVector(4,t,4)}static addInts(e,t){e.addFieldOffset(9,t,0)}static createIntsVector(e,t){e.startVector(8,t.length,8);for(let n=t.length-1;n>=0;n--)e.addInt64(t[n]);return e.endVector()}static startIntsVector(e,t){e.startVector(8,t,8)}static addStrings(e,t){e.addFieldOffset(10,t,0)}static createStringsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startStringsVector(e,t){e.startVector(4,t,4)}static addTensors(e,t){e.addFieldOffset(11,t,0)}static createTensorsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startTensorsVector(e,t){e.startVector(4,t,4)}static addGraphs(e,t){e.addFieldOffset(12,t,0)}static createGraphsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startGraphsVector(e,t){e.startVector(4,t,4)}static endAttribute(e){return e.endObject()}static createAttribute(e,t,r,o,a,i,s,l,u,c,d,f,p,h){return n.startAttribute(e),n.addName(e,t),n.addDocString(e,r),n.addType(e,o),n.addF(e,a),n.addI(e,i),n.addS(e,s),n.addT(e,l),n.addG(e,u),n.addFloats(e,c),n.addInts(e,d),n.addStrings(e,f),n.addTensors(e,p),n.addGraphs(e,h),n.endAttribute(e)}}t.Attribute=n}((t=e.experimental||(e.experimental={})).fbs||(t.fbs={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){var t;!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsGraph(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsGraph(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}initializers(t,n){let r=this.bb.__offset(this.bb_pos,4);return r?(n||new e.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}initializersLength(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__vector_len(this.bb_pos+e):0}nodeArgs(t,n){let r=this.bb.__offset(this.bb_pos,6);return r?(n||new e.experimental.fbs.ValueInfo).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}nodeArgsLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}nodes(t,n){let r=this.bb.__offset(this.bb_pos,8);return r?(n||new e.experimental.fbs.Node).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}nodesLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}maxNodeIndex(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readUint32(this.bb_pos+e):0}nodeEdges(t,n){let r=this.bb.__offset(this.bb_pos,12);return r?(n||new e.experimental.fbs.NodeEdge).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}nodeEdgesLength(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}inputs(e,t){let n=this.bb.__offset(this.bb_pos,14);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*e,t):null}inputsLength(){let e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__vector_len(this.bb_pos+e):0}outputs(e,t){let n=this.bb.__offset(this.bb_pos,16);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*e,t):null}outputsLength(){let e=this.bb.__offset(this.bb_pos,16);return e?this.bb.__vector_len(this.bb_pos+e):0}sparseInitializers(t,n){let r=this.bb.__offset(this.bb_pos,18);return r?(n||new e.experimental.fbs.SparseTensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}sparseInitializersLength(){let e=this.bb.__offset(this.bb_pos,18);return e?this.bb.__vector_len(this.bb_pos+e):0}static startGraph(e){e.startObject(8)}static addInitializers(e,t){e.addFieldOffset(0,t,0)}static createInitializersVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startInitializersVector(e,t){e.startVector(4,t,4)}static addNodeArgs(e,t){e.addFieldOffset(1,t,0)}static createNodeArgsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startNodeArgsVector(e,t){e.startVector(4,t,4)}static addNodes(e,t){e.addFieldOffset(2,t,0)}static createNodesVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startNodesVector(e,t){e.startVector(4,t,4)}static addMaxNodeIndex(e,t){e.addFieldInt32(3,t,0)}static addNodeEdges(e,t){e.addFieldOffset(4,t,0)}static createNodeEdgesVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startNodeEdgesVector(e,t){e.startVector(4,t,4)}static addInputs(e,t){e.addFieldOffset(5,t,0)}static createInputsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startInputsVector(e,t){e.startVector(4,t,4)}static addOutputs(e,t){e.addFieldOffset(6,t,0)}static createOutputsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startOutputsVector(e,t){e.startVector(4,t,4)}static addSparseInitializers(e,t){e.addFieldOffset(7,t,0)}static createSparseInitializersVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startSparseInitializersVector(e,t){e.startVector(4,t,4)}static endGraph(e){return e.endObject()}static createGraph(e,t,r,o,a,i,s,l,u){return n.startGraph(e),n.addInitializers(e,t),n.addNodeArgs(e,r),n.addNodes(e,o),n.addMaxNodeIndex(e,a),n.addNodeEdges(e,i),n.addInputs(e,s),n.addOutputs(e,l),n.addSparseInitializers(e,u),n.endGraph(e)}}t.Graph=n}((t=e.experimental||(e.experimental={})).fbs||(t.fbs={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){var t;!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsModel(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsModel(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}irVersion(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt64(this.bb_pos+e):this.bb.createLong(0,0)}opsetImport(t,n){let r=this.bb.__offset(this.bb_pos,6);return r?(n||new e.experimental.fbs.OperatorSetId).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}opsetImportLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}producerName(e){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__string(this.bb_pos+t,e):null}producerVersion(e){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__string(this.bb_pos+t,e):null}domain(e){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__string(this.bb_pos+t,e):null}modelVersion(){let e=this.bb.__offset(this.bb_pos,14);return e?this.bb.readInt64(this.bb_pos+e):this.bb.createLong(0,0)}docString(e){let t=this.bb.__offset(this.bb_pos,16);return t?this.bb.__string(this.bb_pos+t,e):null}graph(t){let n=this.bb.__offset(this.bb_pos,18);return n?(t||new e.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}graphDocString(e){let t=this.bb.__offset(this.bb_pos,20);return t?this.bb.__string(this.bb_pos+t,e):null}static startModel(e){e.startObject(9)}static addIrVersion(e,t){e.addFieldInt64(0,t,e.createLong(0,0))}static addOpsetImport(e,t){e.addFieldOffset(1,t,0)}static createOpsetImportVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startOpsetImportVector(e,t){e.startVector(4,t,4)}static addProducerName(e,t){e.addFieldOffset(2,t,0)}static addProducerVersion(e,t){e.addFieldOffset(3,t,0)}static addDomain(e,t){e.addFieldOffset(4,t,0)}static addModelVersion(e,t){e.addFieldInt64(5,t,e.createLong(0,0))}static addDocString(e,t){e.addFieldOffset(6,t,0)}static addGraph(e,t){e.addFieldOffset(7,t,0)}static addGraphDocString(e,t){e.addFieldOffset(8,t,0)}static endModel(e){return e.endObject()}static createModel(e,t,r,o,a,i,s,l,u,c){return n.startModel(e),n.addIrVersion(e,t),n.addOpsetImport(e,r),n.addProducerName(e,o),n.addProducerVersion(e,a),n.addDomain(e,i),n.addModelVersion(e,s),n.addDocString(e,l),n.addGraph(e,u),n.addGraphDocString(e,c),n.endModel(e)}}t.Model=n}((t=e.experimental||(e.experimental={})).fbs||(t.fbs={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(e){!function(e){class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsKernelCreateInfos(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsKernelCreateInfos(e,n){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(n||new t).__init(e.readInt32(e.position())+e.position(),e)}nodeIndices(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readUint32(this.bb.__vector(this.bb_pos+t)+4*e):0}nodeIndicesLength(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__vector_len(this.bb_pos+e):0}nodeIndicesArray(){let e=this.bb.__offset(this.bb_pos,4);return e?new Uint32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}kernelDefHashes(e){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint64(this.bb.__vector(this.bb_pos+t)+8*e):this.bb.createLong(0,0)}kernelDefHashesLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}static startKernelCreateInfos(e){e.startObject(2)}static addNodeIndices(e,t){e.addFieldOffset(0,t,0)}static createNodeIndicesVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addInt32(t[n]);return e.endVector()}static startNodeIndicesVector(e,t){e.startVector(4,t,4)}static addKernelDefHashes(e,t){e.addFieldOffset(1,t,0)}static createKernelDefHashesVector(e,t){e.startVector(8,t.length,8);for(let n=t.length-1;n>=0;n--)e.addInt64(t[n]);return e.endVector()}static startKernelDefHashesVector(e,t){e.startVector(8,t,8)}static endKernelCreateInfos(e){return e.endObject()}static createKernelCreateInfos(e,n,r){return t.startKernelCreateInfos(e),t.addNodeIndices(e,n),t.addKernelDefHashes(e,r),t.endKernelCreateInfos(e)}}e.KernelCreateInfos=t}(e.fbs||(e.fbs={}))}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){var t;!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsSubGraphSessionState(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsSubGraphSessionState(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}graphId(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}sessionState(t){let n=this.bb.__offset(this.bb_pos,6);return n?(t||new e.experimental.fbs.SessionState).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}static startSubGraphSessionState(e){e.startObject(2)}static addGraphId(e,t){e.addFieldOffset(0,t,0)}static addSessionState(e,t){e.addFieldOffset(1,t,0)}static endSubGraphSessionState(e){let t=e.endObject();return e.requiredField(t,4),t}static createSubGraphSessionState(e,t,r){return n.startSubGraphSessionState(e),n.addGraphId(e,t),n.addSessionState(e,r),n.endSubGraphSessionState(e)}}t.SubGraphSessionState=n}((t=e.experimental||(e.experimental={})).fbs||(t.fbs={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){var t;!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsSessionState(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsSessionState(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}kernels(t){let n=this.bb.__offset(this.bb_pos,4);return n?(t||new e.experimental.fbs.KernelCreateInfos).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}subGraphSessionStates(t,n){let r=this.bb.__offset(this.bb_pos,6);return r?(n||new e.experimental.fbs.SubGraphSessionState).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}subGraphSessionStatesLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}static startSessionState(e){e.startObject(2)}static addKernels(e,t){e.addFieldOffset(0,t,0)}static addSubGraphSessionStates(e,t){e.addFieldOffset(1,t,0)}static createSubGraphSessionStatesVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startSubGraphSessionStatesVector(e,t){e.startVector(4,t,4)}static endSessionState(e){return e.endObject()}static createSessionState(e,t,r){return n.startSessionState(e),n.addKernels(e,t),n.addSubGraphSessionStates(e,r),n.endSessionState(e)}}t.SessionState=n}((t=e.experimental||(e.experimental={})).fbs||(t.fbs={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){var t;!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsInferenceSession(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsInferenceSession(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static bufferHasIdentifier(e){return e.__has_identifier("ORTM")}ortVersion(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}model(t){let n=this.bb.__offset(this.bb_pos,6);return n?(t||new e.experimental.fbs.Model).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}sessionState(t){let n=this.bb.__offset(this.bb_pos,8);return n?(t||new e.experimental.fbs.SessionState).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}static startInferenceSession(e){e.startObject(3)}static addOrtVersion(e,t){e.addFieldOffset(0,t,0)}static addModel(e,t){e.addFieldOffset(1,t,0)}static addSessionState(e,t){e.addFieldOffset(2,t,0)}static endInferenceSession(e){return e.endObject()}static finishInferenceSessionBuffer(e,t){e.finish(t,"ORTM")}static finishSizePrefixedInferenceSessionBuffer(e,t){e.finish(t,"ORTM",!0)}static createInferenceSession(e,t,r,o){return n.startInferenceSession(e),n.addOrtVersion(e,t),n.addModel(e,r),n.addSessionState(e,o),n.endInferenceSession(e)}}t.InferenceSession=n}((t=e.experimental||(e.experimental={})).fbs||(t.fbs={}))}(t.onnxruntime||(t.onnxruntime={}))},7448:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.OnnxjsSessionHandler=void 0;const r=n(1670),o=n(9162);t.OnnxjsSessionHandler=class{constructor(e){this.session=e,this.inputNames=this.session.inputNames,this.outputNames=this.session.outputNames}async dispose(){}async run(e,t,n){const a=new Map;for(const r in e)if(Object.hasOwnProperty.call(e,r)){const t=e[r];a.set(r,new o.Tensor(t.dims,t.type,void 0,void 0,t.data))}const i=await this.session.run(a),s={};return i.forEach((e,t)=>{s[t]=new r.Tensor(e.type,e.data,e.dims)}),s}startProfiling(){this.session.startProfiling()}endProfiling(){this.session.endProfiling()}}},6919:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Session=void 0;const r=n(7067),o=n(1296),a=n(7091),i=n(1036),s=n(6231),l=n(2644);t.Session=class{constructor(e={}){this._initialized=!1,this.backendHint=e.backendHint,this.profiler=s.Profiler.create(e.profiler),this.context={profiler:this.profiler,graphInputTypes:[],graphInputDims:[]}}get inputNames(){return this._model.graph.getInputNames()}get outputNames(){return this._model.graph.getOutputNames()}startProfiling(){this.profiler.start()}endProfiling(){this.profiler.stop()}async loadModel(e,t,n){await this.profiler.event("session","Session.loadModel",async()=>{const i=await(0,a.resolveBackend)(this.backendHint);if(this.sessionHandler=i.createSessionHandler(this.context),this._model=new l.Model,"string"==typeof e){const t=e.endsWith(".ort");if("undefined"==typeof fetch){const n=await(0,o.promisify)(r.readFile)(e);this.initialize(n,t)}else{const n=await fetch(e),r=await n.arrayBuffer();this.initialize(new Uint8Array(r),t)}}else if(ArrayBuffer.isView(e))this.initialize(e);else{const r=new Uint8Array(e,t||0,n||e.byteLength);this.initialize(r)}})}initialize(e,t){if(this._initialized)throw new Error("already initialized");this.profiler.event("session","Session.initialize",()=>{const n=this.sessionHandler.transformGraph?this.sessionHandler:void 0;this._model.load(e,n,t),this.sessionHandler.onGraphInitialized&&this.sessionHandler.onGraphInitialized(this._model.graph),this.initializeOps(this._model.graph),this._executionPlan=new i.ExecutionPlan(this._model.graph,this._ops,this.profiler)}),this._initialized=!0}async run(e){if(!this._initialized)throw new Error("session not initialized yet");return this.profiler.event("session","Session.run",async()=>{const t=this.normalizeAndValidateInputs(e),n=await this._executionPlan.execute(this.sessionHandler,t);return this.createOutput(n)})}normalizeAndValidateInputs(e){const t=this._model.graph.getInputNames();if(Array.isArray(e)){if(e.length!==t.length)throw new Error(`incorrect input array length: expected ${t.length} but got ${e.length}`)}else{if(e.size!==t.length)throw new Error(`incorrect input map size: expected ${t.length} but got ${e.size}`);const n=new Array(e.size);let r=0;for(let o=0;o<t.length;++o){const a=e.get(t[o]);if(!a)throw new Error(`missing input tensor for: '${name}'`);n[r++]=a}e=n}if(this.context.graphInputTypes&&0!==this.context.graphInputTypes.length&&this.context.graphInputDims&&0!==this.context.graphInputDims.length)this.validateInputTensorDims(this.context.graphInputDims,e,!1);else{const t=this._model.graph.getInputIndices(),n=this._model.graph.getValues(),r=new Array(t.length);for(let o=0;o<t.length;++o){const a=n[t[o]];r[o]=a.type.shape.dims,this.context.graphInputTypes.push(a.type.tensorType),this.context.graphInputDims.push(e[o].dims)}this.validateInputTensorDims(r,e,!0)}return this.validateInputTensorTypes(this.context.graphInputTypes,e),e}validateInputTensorTypes(e,t){for(let n=0;n<t.length;n++){const r=e[n],o=t[n].type;if(r!==o)throw new Error(`input tensor[${n}] check failed: expected type '${r}' but got ${o}`)}}validateInputTensorDims(e,t,n){for(let r=0;r<t.length;r++){const o=e[r],a=t[r].dims;if(!this.compareTensorDims(o,a,n))throw new Error(`input tensor[${r}] check failed: expected shape '[${o.join(",")}]' but got [${a.join(",")}]`)}}compareTensorDims(e,t,n){if(e.length!==t.length)return!1;for(let r=0;r<e.length;++r)if(e[r]!==t[r]&&(!n||0!==e[r]))return!1;return!0}createOutput(e){const t=this._model.graph.getOutputNames();if(e.length!==t.length)throw new Error("expected number of outputs do not match number of generated outputs");const n=new Map;for(let r=0;r<t.length;++r)n.set(t[r],e[r]);return n}initializeOps(e){const t=e.getNodes();this._ops=new Array(t.length);for(let n=0;n<t.length;n++)this._ops[n]=this.sessionHandler.resolve(t[n],this._model.opsets,e)}}},9162:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Tensor=void 0;const o=n(3442),a=r(n(3720)),i=n(1446),s=n(9395),l=n(2517);var u=s.onnxruntime.experimental.fbs;class c{get data(){if(void 0===this.cache){const e=this.dataProvider(this.dataId);if(e.length!==this.size)throw new Error("Length of data provided by the Data Provider is inconsistent with the dims of this Tensor.");this.cache=e}return this.cache}get stringData(){if("string"!==this.type)throw new TypeError("data type is not string");return this.data}get integerData(){switch(this.type){case"uint8":case"int8":case"uint16":case"int16":case"int32":case"uint32":case"bool":return this.data;default:throw new TypeError("data type is not integer (uint8, int8, uint16, int16, int32, uint32, bool)")}}get floatData(){switch(this.type){case"float32":case"float64":return this.data;default:throw new TypeError("data type is not float (float32, float64)")}}get numberData(){if("string"!==this.type)return this.data;throw new TypeError("type cannot be non-number (string)")}get(e){return this.data[l.ShapeUtil.indicesToOffset(e,this.strides)]}set(e,t){this.data[l.ShapeUtil.indicesToOffset(e,this.strides)]=t}async getData(){return void 0===this.cache&&(this.cache=await this.asyncDataProvider(this.dataId)),this.cache}get strides(){return this._strides||(this._strides=l.ShapeUtil.computeStrides(this.dims)),this._strides}constructor(e,t,n,r,a,i=o.Guid.create()){this.dims=e,this.type=t,this.dataProvider=n,this.asyncDataProvider=r,this.cache=a,this.dataId=i,this.size=l.ShapeUtil.validateDimsAndCalcSize(e);const s=this.size,u=void 0===n&&void 0===r&&void 0===a;if(void 0!==a&&a.length!==s)throw new RangeError("Input dims doesn't match data length.");if("string"===t){if(!(void 0===a||Array.isArray(a)&&a.every(e=>"string"==typeof e)))throw new TypeError("cache should be a string array");u&&(this.cache=new Array(s))}else{if(void 0!==a){const e=f(t);if(!(a instanceof e))throw new TypeError(`cache should be type ${e.name}`)}if(u){const e=new ArrayBuffer(s*function(e){switch(e){case"bool":case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;case"float64":return 8;default:throw new Error(`cannot calculate sizeof() on type ${e}`)}}(t));this.cache=(c=e,new(f(t))(c))}}var c}static fromProto(e){if(!e)throw new Error("cannot construct Value from an empty tensor");const t=l.ProtoUtil.tensorDataTypeFromProto(e.dataType),n=l.ProtoUtil.tensorDimsFromProto(e.dims),r=new c(n,t);if("string"===t)e.stringData.forEach((e,t)=>{r.data[t]=(0,l.decodeUtf8String)(e)});else if(e.rawData&&"number"==typeof e.rawData.byteLength&&e.rawData.byteLength>0){const t=r.data,n=new DataView(e.rawData.buffer,e.rawData.byteOffset,e.rawData.byteLength),o=d(e.dataType),a=e.rawData.byteLength/o;if(e.rawData.byteLength%o!=0)throw new Error("invalid buffer length");if(t.length!==a)throw new Error("buffer length mismatch");for(let r=0;r<a;r++){const a=h(n,e.dataType,r*o);t[r]=a}}else{let t;switch(e.dataType){case i.onnx.TensorProto.DataType.FLOAT:t=e.floatData;break;case i.onnx.TensorProto.DataType.INT32:case i.onnx.TensorProto.DataType.INT16:case i.onnx.TensorProto.DataType.UINT16:case i.onnx.TensorProto.DataType.INT8:case i.onnx.TensorProto.DataType.UINT8:case i.onnx.TensorProto.DataType.BOOL:t=e.int32Data;break;case i.onnx.TensorProto.DataType.INT64:t=e.int64Data;break;case i.onnx.TensorProto.DataType.DOUBLE:t=e.doubleData;break;case i.onnx.TensorProto.DataType.UINT32:case i.onnx.TensorProto.DataType.UINT64:t=e.uint64Data;break;default:throw new Error("unspecific error")}if(null==t)throw new Error("failed to populate data from a tensorproto value");const n=r.data;if(n.length!==t.length)throw new Error("array length mismatch");for(let r=0;r<t.length;r++){const o=t[r];a.default.isLong(o)?n[r]=p(o,e.dataType):n[r]=o}}return r}static fromData(e,t,n){return new c(t,n,void 0,void 0,e)}static fromOrtTensor(e){if(!e)throw new Error("cannot construct Value from an empty tensor");const t=l.ProtoUtil.tensorDimsFromORTFormat(e),n=l.ProtoUtil.tensorDataTypeFromProto(e.dataType()),r=new c(t,n);if("string"===n)for(let o=0;o<e.stringDataLength();o++)r.data[o]=e.stringData(o);else if(e.rawDataArray()&&"number"==typeof e.rawDataLength()&&e.rawDataLength()>0){const t=r.data,n=new DataView(e.rawDataArray().buffer,e.rawDataArray().byteOffset,e.rawDataLength()),o=d(e.dataType()),a=e.rawDataLength()/o;if(e.rawDataLength()%o!=0)throw new Error("invalid buffer length");if(t.length!==a)throw new Error("buffer length mismatch");for(let r=0;r<a;r++){const a=h(n,e.dataType(),r*o);t[r]=a}}return r}}function d(e){switch(e){case i.onnx.TensorProto.DataType.UINT8:case i.onnx.TensorProto.DataType.INT8:case i.onnx.TensorProto.DataType.BOOL:return 1;case i.onnx.TensorProto.DataType.UINT16:case i.onnx.TensorProto.DataType.INT16:return 2;case i.onnx.TensorProto.DataType.FLOAT:case i.onnx.TensorProto.DataType.INT32:case i.onnx.TensorProto.DataType.UINT32:return 4;case i.onnx.TensorProto.DataType.INT64:case i.onnx.TensorProto.DataType.DOUBLE:case i.onnx.TensorProto.DataType.UINT64:return 8;default:throw new Error(`cannot calculate sizeof() on type ${i.onnx.TensorProto.DataType[e]}`)}}function f(e){switch(e){case"bool":case"uint8":return Uint8Array;case"int8":return Int8Array;case"int16":return Int16Array;case"uint16":return Uint16Array;case"int32":return Int32Array;case"uint32":return Uint32Array;case"float32":return Float32Array;case"float64":return Float64Array;default:throw new Error("unspecified error")}}function p(e,t){if(t===i.onnx.TensorProto.DataType.INT64||t===u.TensorDataType.INT64){if(e.greaterThanOrEqual(2147483648)||e.lessThan(-2147483648))throw new TypeError("int64 is not supported")}else{if(t!==i.onnx.TensorProto.DataType.UINT32&&t!==u.TensorDataType.UINT32&&t!==i.onnx.TensorProto.DataType.UINT64&&t!==u.TensorDataType.UINT64)throw new TypeError(`not a LONG type: ${i.onnx.TensorProto.DataType[t]}`);if(e.greaterThanOrEqual(4294967296)||e.lessThan(0))throw new TypeError("uint64 is not supported")}return e.toNumber()}function h(e,t,n){switch(t){case i.onnx.TensorProto.DataType.BOOL:case i.onnx.TensorProto.DataType.UINT8:return e.getUint8(n);case i.onnx.TensorProto.DataType.INT8:return e.getInt8(n);case i.onnx.TensorProto.DataType.UINT16:return e.getUint16(n,!0);case i.onnx.TensorProto.DataType.INT16:return e.getInt16(n,!0);case i.onnx.TensorProto.DataType.FLOAT:return e.getFloat32(n,!0);case i.onnx.TensorProto.DataType.INT32:return e.getInt32(n,!0);case i.onnx.TensorProto.DataType.UINT32:return e.getUint32(n,!0);case i.onnx.TensorProto.DataType.INT64:return p(a.default.fromBits(e.getUint32(n,!0),e.getUint32(n+4,!0),!1),t);case i.onnx.TensorProto.DataType.DOUBLE:return e.getFloat64(n,!0);case i.onnx.TensorProto.DataType.UINT64:return p(a.default.fromBits(e.getUint32(n,!0),e.getUint32(n+4,!0),!0),t);default:throw new Error(`cannot read from DataView for type ${i.onnx.TensorProto.DataType[t]}`)}}t.Tensor=c},2517:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.decodeUtf8String=t.MAX_CLIP=t.MIN_CLIP=t.PoolConvUtil=t.ReduceUtil=t.SplitUtil=t.MathUtil=t.ShapeUtil=t.LongUtil=t.ProtoUtil=t.GemmUtil=t.arrayCopyHelper=t.BroadcastUtil=t.MatMulUtil=t.ArrayUtil=t.assert=t.checkInputsShape=void 0;const o=n(5686),a=r(n(3720)),i=n(1446),s=n(9162);t.checkInputsShape=function(e,...t){if(!e||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].dims||e[n].dims.length!==t[n])return!1;return!0},t.assert=function(e,t){if(!e)throw new Error("string"==typeof t?t:t())},t.ArrayUtil=class{static arraysEqual(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}};class l{static preprocessInputShapes(e,t){return[1===e.length?[1,e[0]]:e,1===t.length?[t[0],1]:t]}static postprocessOutputShape(e,t,n){1===t&&e.splice(e.length-2,1),1===n&&e.pop()}static calcMatMulShape(e,t){return e[1]!==t[0]?void 0:[e[0],t[1]]}}t.MatMulUtil=l;class u{static calcShape(e,t,n=!1){const r=e.length,o=t.length;if(0===r)return t;if(0===o)return e;const a=Math.max(e.length,t.length),i=new Array(a);if(n){if(r<2||o<2)return;const n=l.calcMatMulShape([e[r-2],e[r-1]],[t[o-2],t[o-1]]);if(void 0===n)return;[i[a-2],i[a-1]]=n}for(let s=n?3:1;s<=a;s++){const n=r-s<0?1:e[r-s],l=o-s<0?1:t[o-s];if(n!==l&&n>1&&l>1)return;i[a-s]=Math.max(n,l)}return i}static index(e,t){const n=new Array(t.length);return u.fillIndex(e,t,n),n}static fillIndex(e,t,n){const r=e.length-t.length;for(let o=0;o<t.length;o++)n[o]=e[r+o]%t[o]}static calc(e,t,n,r,o){const a=u.calcShape(e.dims,t.dims);if(a){if(r&&!f.areEqual(a,e.dims))return;const i=f.size(a),l=r?e:new s.Tensor(a,o||e.type);if(0===a.length)l.set([],n(e.get([]),t.get([])));else{const r=new Array(a.length),o=new Array(e.dims.length),s=new Array(t.dims.length);let c,d=0,f=0,p=!1,h=!1;0===e.dims.length&&(d=e.get([]),p=!0),0===t.dims.length&&(f=t.get([]),h=!0);for(let m=0;m<i;m++){c=m;for(let e=a.length-1;e>=0;e--)r[e]=c%a[e],c=Math.floor(c/a[e]);p||(u.fillIndex(r,e.dims,o),d=e.get(o)),h||(u.fillIndex(r,t.dims,s),f=t.get(s)),l.set(r,n(d,f))}}return l}}static isValidBroadcast(e,t){const n=e.length,r=t.length;if(n>r)return!1;for(let o=1;o<=n;o++)if(1!==e[n-o]&&e[n-o]!==t[r-o])return!1;return!0}static getBroadcastDims(e,t){const n=e.length,r=[];for(let o=0;o<n;o++){const a=n-1-o,i=e[a]||1;(t[t.length-1-o]||1)>1&&1===i&&r.unshift(a)}return r}}t.BroadcastUtil=u,t.arrayCopyHelper=function(e,t,n,r,o){if(r<0||r>=t.length)throw new Error("sourceIndex out of bounds");if(n<0||n>=e.length)throw new Error("targetIndex out of bounds");if(r+o>t.length)throw new Error("source indices to be copied are outside bounds");if(n+o>e.length)throw new Error("target array is too small to hold result");for(let a=0;a<o;a++)e[n+a]=t[r+a]},t.GemmUtil=class{static getShapeOfGemmResult(e,t,n,r,o){if(2!==e.length||2!==n.length)throw new Error("shape need to be of size 2");let a,i,s;t?(a=e[1],i=e[0]):(a=e[0],i=e[1]);let l=-1;if(r?(s=n[0],l=1):(s=n[1],l=0),n[l]!==i)throw new Error("dimension mismatch");if(a<=0||s<=0||i<=0)throw new Error("invalid shape specified");if(o&&!u.isValidBroadcast(o,[a,s]))throw new Error("gemm: invalid bias shape for broadcast");return[a,s,i]}};class c{static tensorDataTypeFromProto(e){switch(e){case i.onnx.TensorProto.DataType.INT8:return"int8";case i.onnx.TensorProto.DataType.UINT8:return"uint8";case i.onnx.TensorProto.DataType.BOOL:return"bool";case i.onnx.TensorProto.DataType.INT16:return"int16";case i.onnx.TensorProto.DataType.UINT16:return"uint16";case i.onnx.TensorProto.DataType.INT32:return"int32";case i.onnx.TensorProto.DataType.UINT32:return"uint32";case i.onnx.TensorProto.DataType.FLOAT:return"float32";case i.onnx.TensorProto.DataType.DOUBLE:return"float64";case i.onnx.TensorProto.DataType.STRING:return"string";case i.onnx.TensorProto.DataType.INT64:return"int32";case i.onnx.TensorProto.DataType.UINT64:return"uint32";default:throw new Error(`unsupported data type: ${i.onnx.TensorProto.DataType[e]}`)}}static tensorDataTypeStringToEnum(e){switch(e){case"int8":return i.onnx.TensorProto.DataType.INT8;case"uint8":return i.onnx.TensorProto.DataType.UINT8;case"bool":return i.onnx.TensorProto.DataType.BOOL;case"int16":return i.onnx.TensorProto.DataType.INT16;case"uint16":return i.onnx.TensorProto.DataType.UINT16;case"int32":return i.onnx.TensorProto.DataType.INT32;case"uint32":return i.onnx.TensorProto.DataType.UINT32;case"float32":return i.onnx.TensorProto.DataType.FLOAT;case"float64":return i.onnx.TensorProto.DataType.DOUBLE;case"string":return i.onnx.TensorProto.DataType.STRING;case"int64":return i.onnx.TensorProto.DataType.INT64;case"uint64":return i.onnx.TensorProto.DataType.UINT64;default:throw new Error(`unsupported data type: ${e}`)}}static tensorDimsFromProto(e){return e.map(e=>a.default.isLong(e)?e.toNumber():e)}static tensorValueTypeFromProto(e){return{tensorType:c.tensorDataTypeFromProto(e.elemType),shape:{dims:c.tensorDimsFromProto(e.shape.dim.map(e=>e.dimValue))}}}static tensorDimsFromORTFormat(e){const t=[];for(let n=0;n<e.dimsLength();n++)t.push(d.longToNumber(e.dims(n)));return t}static tensorAttributesFromORTFormat(e){const t=[];for(let n=0;n<e.attributesLength();n++)t.push(e.attributes(n));return t}}t.ProtoUtil=c;class d{static longToNumber(e,t){return a.default.isLong(e)?e.toNumber():e instanceof o.flatbuffers.Long?a.default.fromValue({low:e.low,high:e.high,unsigned:null!=t&&t}).toNumber():e}static isLong(e){return a.default.isLong(e)||e instanceof o.flatbuffers.Long}}t.LongUtil=d;class f{static size(e){return f.getSizeFromDimensionRange(e,0,e.length)}static sizeFromDimension(e,t){if(t<0||t>e.length)throw new Error(`invalid dimension of ${t} for sizeFromDimension as Tensor has ${e.length} dimensions.`);return f.getSizeFromDimensionRange(e,t,e.length)}static sizeToDimension(e,t){if(t<0||t>e.length)throw new Error(`invalid dimension of ${t} for sizeToDimension as Tensor has ${e.length} dimensions.`);return f.getSizeFromDimensionRange(e,0,t)}static getSizeFromDimensionRange(e,t,n){let r=1;for(let o=t;o<n;o++){if(e[o]<=0)throw new Error("cannot get valid size from specified dimension range. Most likely the range contains 0 or negative values in them.");r*=e[o]}return r}static computeStrides(e){const t=e.length;if(0===t)return[];if(1===t)return[1];const n=new Array(t);n[t-1]=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}static transpose(e){return e.slice().reverse()}static indicesToOffset(e,t,n){void 0===n&&(n=e.length);let r=0;for(let o=0;o<n;++o)r+=t[o]*e[o];return r}static offsetToIndices(e,t){const n=t.length;if(0===n)return[];if(1===n)return[e*t[0]];const r=new Array(t.length);for(let o=0;o<r.length-1;++o)r[o]=Math.floor(e/t[o]),e-=r[o]*t[o];return r[r.length-1]=e,r}static normalizeAxis(e,t){if(e<-t&&e>=t)throw new Error("unsupported axis for this operation.");return e<0?e+t:e}static normalizeAxes(e,t){return e.map(e=>this.normalizeAxis(e,t))}static incrementIndex(e,t,n){if(0===t.length||0===e.length)throw new Error("Index incrementing unsupported for scalar Tensor");if(void 0===n)n=t.length;else if(n<=0||n>t.length)throw new Error("Incorrect axis to increment on");for(let r=n-1;r>=0&&(e[r]++,!(e[r]<t[r]));--r)e[r]=0}static calculateReshapedDims(e,t){if(0===t.length){if(0===e.length||1===f.size(e))return[];throw new Error("cannot reshape to a scalar Tensor")}const n=t.length,r=new Array(n);let o=-1,a=1;for(let s=0;s<n;s++){if(t[s]<-1)throw new Error("a dimension in shape hints cannot be less than -1");if(-1===t[s]){if(-1!==o)throw new Error("at most one dimension in shape hints can be -1");o=s}else{if(0===t[s]){if(s>=e.length)throw new Error("the dimension with value zero exceeds the dimension size of the input tensor");r[s]=e[s]}else r[s]=t[s];a*=r[s]}}const i=f.size(e);if(-1!==o){if(i%a!=0)throw new Error(`the input tensor cannot be reshaped to the requested shape. Input shape: [${e}] Output shape: [${t}]`);r[o]=i/a}else if(a!==i)throw new Error("reshapedDims and originalDims don't have matching sizes");return r}static sortBasedOnPerm(e,t){return t?t.map(t=>e[t]):e.slice().reverse()}static padShape(e,t){const n=e.length;return e.map((e,r)=>e+t[r]+t[r+n])}static areEqual(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}static validateDimsAndCalcSize(e){if(e.length>6)throw new TypeError("Only rank 0 to 6 is supported for tensor shape.");let t=1;for(const n of e){if(!Number.isInteger(n))throw new TypeError(`Invalid shape: ${n} is not an integer`);if(n<0||n>2147483647)throw new TypeError(`Invalid shape: length ${n} is not allowed`);t*=n}return t}static flattenShape(e,t){t<0&&(t+=e.length);const n=e.reduce((e,t)=>e*t,1),r=e.slice(t).reduce((e,t)=>e*t,1);return[n/r,r]}static squeezeShape(e,t){const n=new Array;t=f.normalizeAxes(t,e.length);for(let r=0;r<e.length;r++){const o=t.indexOf(r)>=0;if(o&&1!==e[r])throw new Error("squeeze an axis of size different than 1");(0===t.length&&e[r]>1||t.length>0&&!o)&&n.push(e[r])}return n}static unsqueezeShape(e,t){const n=new Array(e.length+t.length);n.fill(0);for(let o=0;o<t.length;o++){const e=f.normalizeAxis(t[o],n.length);if(e>=n.length)throw new Error("'axes' has an out of range axis");if(0!==n[e])throw new Error("'axes' has a duplicate axis");n[e]=1}let r=0;for(let o=0;o<n.length;o++)0===n[o]&&(n[o]=e[r++]);if(r!==e.length)throw new Error("the unsqueezed dimension could not be established");return n}}t.ShapeUtil=f,t.MathUtil=class{static sqr(e,t,n,r,o){if(r<0||r>=t.length)throw new Error("sourceIndex out of bounds");if(n<0||n>=e.length)throw new Error("targetIndex out of bounds");if(r+o>t.length)throw new Error("source indices to be copied are outside bounds");if(n+o>e.length)throw new Error("target array is too small to hold result");for(let a=0;a<o;a++)e[n+a]+=Math.pow(t[r+a],2)}static axpy(e,t,n,r,o,a){if(r<0||r>=t.length)throw new Error("sourceIndex out of bounds");if(n<0||n>=e.length)throw new Error("targetIndex out of bounds");if(r+o>t.length)throw new Error("source indices to be copied are outside bounds");if(n+o>e.length)throw new Error("target array is too small to hold result");for(let i=0;i<o;i++)e[n+i]+=a*t[r+i]}static powx(e,t,n,r,o,a){if(r<0||r>=t.length)throw new Error("sourceIndex out of bounds");if(n<0||n>=e.length)throw new Error("targetIndex out of bounds");if(r+o>t.length)throw new Error("source indices to be copied are outside bounds");if(n+o>e.length)throw new Error("target array is too small to hold result");for(let i=0;i<o;i++)e[n+i]=Math.pow(t[r+i],a)}static mul(e,t,n,r,o){if(r<0||r>=t.length)throw new Error("sourceIndex out of bounds");if(n<0||n>=e.length)throw new Error("targetIndex out of bounds");if(r+o>t.length)throw new Error("source indices to be copied are outside bounds");if(n+o>e.length)throw new Error("target array is too small to hold result");for(let a=0;a<o;a++)e[n+a]=t[r+a]*e[n+a]}};class p{static splitShape(e,t,n,r){if(0===n.length){if(!r)throw new Error("need to know number of outputs when the 'split' attribute is not specified");p.determineSplit(e[t],r,n)}const o=[],a=[0];for(let i=0;i<n.length;++i){0!==i&&a.push(a[i-1]+n[i-1]);const r=e.slice();r[t]=n[i],o.push(r)}return[o,a]}static determineSplit(e,t,n){if(e%t!=0)throw new Error("cannot split tensor to equal sized parts");for(let r=0;r<t;++r)n.push(e/t)}}t.SplitUtil=p;class h{static calcReduce(e,t,n,r,o){const a=e.dims.slice(0);0===t.length&&a.forEach((e,n)=>t.push(n));const i=h.calcReduceShape(a,t,!0),l=f.size(i),c=new s.Tensor(i,e.type),d=f.computeStrides(i),p=f.computeStrides(a),m=new Array(a.length);for(let s=0;s<l;s++){const n=f.offsetToIndices(s,d);u.fillIndex(n,a,m),c.set(n,h.calcReduceByAxis(e.numberData,t,a,0,f.indicesToOffset(m,p),r,o))}return n?c:new s.Tensor(h.calcReduceShape(a,t,n),c.type,void 0,void 0,c.data,c.dataId)}static calcReduceByAxis(e,t,n,r,o,a,i){let s=0;if(r>=t.length)return a(e[o]);const l=t[r],u=l>=n.length?1:f.size(n.slice(l+1));for(let c=0;c<n[l];c++)s=0===c?h.calcReduceByAxis(e,t,n,r+1,o,a,i):i(s,h.calcReduceByAxis(e,t,n,r+1,o,a,i)),o+=u;return s}static calcReduceShape(e,t,n){const r=e.slice();for(let o=0;o<t.length;o++)r[t[o]]=n?1:0;return r.filter(e=>0!==e)}}t.ReduceUtil=h;class m{static adjustPoolAttributes(e,t,n,r,o,a){if(!e&&n.length!==t.length-2)throw new Error("length of specified kernel shapes should be 2 less than length of input dimensions");if(e)for(let i=0;i<t.length-2;i++)i>=n.length?n.push(t[i+2]):n[i]=t[i+2];for(let i=0;i<n.length;i++)if(i<r.length){if(r[i]<0)throw new Error("strides should be greater than or equal to 1")}else r.push(1);for(let i=0;i<n.length;i++)if(i<o.length){if(o[i]<0)throw new Error("dilations should be greater than or equal to 1")}else o.push(1);for(let i=0;i<2*n.length;i++)if(i<a.length){if(a[i]<0)throw new Error("pad should be greater than or equal to 1")}else a.push(0);for(let i=0;i<n.length;i++){if(n[i]<=0)throw new Error("kernel shapes need to be greater than 0");if(a[i]>=n[i]||a[i+n.length]>=n[i])throw new Error("pads should be smaller than kernel")}}static adjustPadsBasedOnAutoPad(e,t,n,r,o,a){if(a){if(o.length!==2*(e.length-2))throw new Error("length of pads should be twice the length of data dimensions");if(t.length!==e.length-2)throw new Error("length of strides should be the length of data dimensions");if(r.length!==e.length-2)throw new Error("length of kernel shapes should be the length of data dimensions");for(let i=0;i<e.length-2;i++)m.adjustPadAndReturnShape(e[i+2],t[i],n[i],r[i],o,i,i+e.length-2,a)}}static computePoolOutputShape(e,t,n,r,o,a,i){if(t.length<=0)throw new Error("input shape must be of size greater than 0");const s=[t[0],t[1]];return m.computeShapeHelper(e,t,s,n,r,o,a,i),s}static computeConvOutputShape(e,t,n,r,o,a,i){if(e.length<=0||t.length<=0)throw new Error("invalid input tensor dims or invalid filter tensor dims");const s=[e[0],t[0]];return m.computeShapeHelper(!1,e,s,n,r,o,a,i),s}static computeShapeHelper(e,t,n,r,o,a,i,s){if(e)for(let l=0;l<t.length-2;l++)n.push(1);else for(let l=0;l<t.length-2;l++)n.push(m.adjustPadAndReturnShape(t[l+2],r[l],o[l],a[l],i,l,l+t.length-2,s))}static adjustPadAndReturnShape(e,t,n,r,o,a,i,s){const l=n*(r-1)+1;if(!s||"NOTSET"===s)return Math.floor((e+o[a]+o[i]-l)/t+1);switch(s){case"VALID":return o[a]=0,o[i]=0,Math.floor((e-l)/t+1);case"SAME_LOWER":case"SAME_UPPER":if(1!==n)throw new Error("Dilation not supported for SAME_UPPER or SAME_LOWER");{const n=((e+t-1)/t-1)*t+r-e;return o[a]="SAME_LOWER"===s?Math.floor((n+1)/2):Math.floor(n/2),o[i]=n-o[a],Math.floor((e+n-r)/t+1)}default:throw new Error("Unsupported AutoPad type")}}}t.PoolConvUtil=m,t.MIN_CLIP=-34028234663852886e22,t.MAX_CLIP=34028234663852886e22,t.decodeUtf8String=function(e){return(new TextDecoder).decode(e)}},7967:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.iterateExtraOptions=void 0,t.iterateExtraOptions=(e,n,r,o)=>{if("object"==typeof e&&null!==e){if(r.has(e))throw new Error("Circular reference in options");r.add(e)}Object.entries(e).forEach(([e,a])=>{const i=n?n+e:e;if("object"==typeof a)(0,t.iterateExtraOptions)(a,i+".",r,o);else if("string"==typeof a||"number"==typeof a)o(i,a.toString());else{if("boolean"!=typeof a)throw new Error("Can't handle extra config type: "+typeof a);o(i,a?"1":"0")}})}},2157:function(e,t,n){var r,o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return a(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.endProfiling=t.run=t.releaseSession=t.createSession=t.createSessionFinalize=t.createSessionAllocate=t.initOrt=t.initWasm=void 0;const s=n(1670),l=i(n(349)),u=n(6361),c=()=>!!s.env.wasm.proxy&&"undefined"!=typeof document;let d,f,p,h=!1,m=!1,g=!1;const b=[],y=[],_=[],v=[],w=[],S=[],x=()=>{if(h||!m||g||!d)throw new Error("worker not ready")},T=e=>{switch(e.data.type){case"init-wasm":h=!1,e.data.err?(g=!0,f[1](e.data.err)):(m=!0,f[0]());break;case"init-ort":e.data.err?p[1](e.data.err):p[0]();break;case"create_allocate":e.data.err?b.shift()[1](e.data.err):b.shift()[0](e.data.out);break;case"create_finalize":e.data.err?y.shift()[1](e.data.err):y.shift()[0](e.data.out);break;case"create":e.data.err?_.shift()[1](e.data.err):_.shift()[0](e.data.out);break;case"release":e.data.err?v.shift()[1](e.data.err):v.shift()[0]();break;case"run":e.data.err?w.shift()[1](e.data.err):w.shift()[0](e.data.out);break;case"end-profiling":e.data.err?S.shift()[1](e.data.err):S.shift()[0]()}},E="undefined"!=typeof document?null===(r=null===document||void 0===document?void 0:document.currentScript)||void 0===r?void 0:r.src:void 0;t.initWasm=async()=>{if(c()){if(m)return;if(h)throw new Error("multiple calls to 'initWasm()' detected.");if(g)throw new Error("previous call to 'initWasm()' failed.");return h=!0,void 0===s.env.wasm.wasmPaths&&E&&0!==E.indexOf("blob:")&&(s.env.wasm.wasmPaths=E.substr(0,+E.lastIndexOf("/")+1)),new Promise((e,t)=>{null==d||d.terminate(),d=n(9710).Z(),d.onmessage=T,f=[e,t];const r={type:"init-wasm",in:s.env.wasm};d.postMessage(r)})}return(0,u.initializeWebAssembly)(s.env.wasm)},t.initOrt=async(e,t)=>{if(c())return x(),new Promise((n,r)=>{p=[n,r];const o={type:"init-ort",in:{numThreads:e,loggingLevel:t}};d.postMessage(o)});l.initOrt(e,t)},t.createSessionAllocate=async e=>c()?(x(),new Promise((t,n)=>{b.push([t,n]);const r={type:"create_allocate",in:{model:e}};d.postMessage(r,[e.buffer])})):l.createSessionAllocate(e),t.createSessionFinalize=async(e,t)=>c()?(x(),new Promise((n,r)=>{y.push([n,r]);const o={type:"create_finalize",in:{modeldata:e,options:t}};d.postMessage(o)})):l.createSessionFinalize(e,t),t.createSession=async(e,t)=>c()?(x(),new Promise((n,r)=>{_.push([n,r]);const o={type:"create",in:{model:e,options:t}};d.postMessage(o,[e.buffer])})):l.createSession(e,t),t.releaseSession=async e=>{if(c())return x(),new Promise((t,n)=>{v.push([t,n]);const r={type:"release",in:e};d.postMessage(r)});l.releaseSession(e)},t.run=async(e,t,n,r,o)=>c()?(x(),new Promise((a,i)=>{w.push([a,i]);const s={type:"run",in:{sessionId:e,inputIndices:t,inputs:n,outputIndices:r,options:o}};d.postMessage(s,l.extractTransferableBuffers(n))})):l.run(e,t,n,r,o),t.endProfiling=async e=>{if(c())return x(),new Promise((t,n)=>{S.push([t,n]);const r={type:"end-profiling",in:e};d.postMessage(r)});l.endProfiling(e)}},586:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.setRunOptions=void 0;const r=n(7967),o=n(4983),a=n(6361);t.setRunOptions=e=>{const t=(0,a.getInstance)();let n=0;const i=[],s=e||{};try{if(void 0===(null==e?void 0:e.logSeverityLevel))s.logSeverityLevel=2;else if("number"!=typeof e.logSeverityLevel||!Number.isInteger(e.logSeverityLevel)||e.logSeverityLevel<0||e.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${e.logSeverityLevel}`);if(void 0===(null==e?void 0:e.logVerbosityLevel))s.logVerbosityLevel=0;else if("number"!=typeof e.logVerbosityLevel||!Number.isInteger(e.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${e.logVerbosityLevel}`);void 0===(null==e?void 0:e.terminate)&&(s.terminate=!1);let a=0;if(void 0!==(null==e?void 0:e.tag)&&(a=(0,o.allocWasmString)(e.tag,i)),n=t._OrtCreateRunOptions(s.logSeverityLevel,s.logVerbosityLevel,!!s.terminate,a),0===n)throw new Error("Can't create run options");return void 0!==(null==e?void 0:e.extra)&&(0,r.iterateExtraOptions)(e.extra,"",new WeakSet,(e,r)=>{const a=(0,o.allocWasmString)(e,i),s=(0,o.allocWasmString)(r,i);if(0!==t._OrtAddRunConfigEntry(n,a,s))throw new Error(`Can't set a run config entry: ${e} - ${r}`)}),[n,i]}catch(l){throw 0!==n&&t._OrtReleaseRunOptions(n),i.forEach(t._free),l}}},2306:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.OnnxruntimeWebAssemblySessionHandler=void 0;const r=n(2806),o=n(1670),a=n(2850),i=n(2157);let s;t.OnnxruntimeWebAssemblySessionHandler=class{async createSessionAllocate(e){const t=await fetch(e),n=await t.arrayBuffer();return(0,i.createSessionAllocate)(new Uint8Array(n))}async loadModel(e,t){if(s||(await(0,i.initOrt)(o.env.wasm.numThreads,(e=>{switch(e){case"verbose":return 0;case"info":return 1;case"warning":return 2;case"error":return 3;case"fatal":return 4;default:throw new Error(`unsupported logging level: ${e}`)}})(o.env.logLevel)),s=!0),"string"==typeof e)if("undefined"==typeof fetch){const n=await(0,a.promisify)(r.readFile)(e);[this.sessionId,this.inputNames,this.outputNames]=await(0,i.createSession)(n,t)}else{const n=await this.createSessionAllocate(e);[this.sessionId,this.inputNames,this.outputNames]=await(0,i.createSessionFinalize)(n,t)}else[this.sessionId,this.inputNames,this.outputNames]=await(0,i.createSession)(e,t)}async dispose(){return(0,i.releaseSession)(this.sessionId)}async run(e,t,n){const r=[],a=[];Object.entries(e).forEach(e=>{const t=e[0],n=e[1],o=this.inputNames.indexOf(t);if(-1===o)throw new Error(`invalid input '${t}'`);r.push(n),a.push(o)});const s=[];Object.entries(t).forEach(e=>{const t=e[0],n=this.outputNames.indexOf(t);if(-1===n)throw new Error(`invalid output '${t}'`);s.push(n)});const l=await(0,i.run)(this.sessionId,a,r.map(e=>[e.type,e.dims,e.data]),s,n),u={};for(let i=0;i<l.length;i++)u[this.outputNames[s[i]]]=new o.Tensor(l[i][0],l[i][2],l[i][1]);return u}startProfiling(){}endProfiling(){(0,i.endProfiling)(this.sessionId)}}},4919:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.setSessionOptions=void 0;const r=n(7967),o=n(4983),a=n(6361);t.setSessionOptions=e=>{const t=(0,a.getInstance)();let n=0;const i=[],s=e||{};(e=>{e.extra||(e.extra={}),e.extra.session||(e.extra.session={});const t=e.extra.session;t.use_ort_model_bytes_directly||(t.use_ort_model_bytes_directly="1")})(s);try{void 0===(null==e?void 0:e.graphOptimizationLevel)&&(s.graphOptimizationLevel="all");const l=(e=>{switch(e){case"disabled":return 0;case"basic":return 1;case"extended":return 2;case"all":return 99;default:throw new Error(`unsupported graph optimization level: ${e}`)}})(s.graphOptimizationLevel);void 0===(null==e?void 0:e.enableCpuMemArena)&&(s.enableCpuMemArena=!0),void 0===(null==e?void 0:e.enableMemPattern)&&(s.enableMemPattern=!0),void 0===(null==e?void 0:e.executionMode)&&(s.executionMode="sequential");const u=(e=>{switch(e){case"sequential":return 0;case"parallel":return 1;default:throw new Error(`unsupported execution mode: ${e}`)}})(s.executionMode);let c=0;if(void 0!==(null==e?void 0:e.logId)&&(c=(0,o.allocWasmString)(e.logId,i)),void 0===(null==e?void 0:e.logSeverityLevel))s.logSeverityLevel=2;else if("number"!=typeof e.logSeverityLevel||!Number.isInteger(e.logSeverityLevel)||e.logSeverityLevel<0||e.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${e.logSeverityLevel}`);if(void 0===(null==e?void 0:e.logVerbosityLevel))s.logVerbosityLevel=0;else if("number"!=typeof e.logVerbosityLevel||!Number.isInteger(e.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${e.logVerbosityLevel}`);if(void 0===(null==e?void 0:e.enableProfiling)&&(s.enableProfiling=!1),n=t._OrtCreateSessionOptions(l,!!s.enableCpuMemArena,!!s.enableMemPattern,u,!!s.enableProfiling,0,c,s.logSeverityLevel,s.logVerbosityLevel),0===n)throw new Error("Can't create session options");return(null==e?void 0:e.executionProviders)&&((e,t,n)=>{for(const r of t){let t="string"==typeof r?r:r.name;switch(t){case"xnnpack":t="XNNPACK";break;case"wasm":case"cpu":continue;default:throw new Error(`not supported EP: ${t}`)}const i=(0,o.allocWasmString)(t,n);if(0!==(0,a.getInstance)()._OrtAppendExecutionProvider(e,i))throw new Error(`Can't append execution provider: ${t}`)}})(n,e.executionProviders,i),void 0!==(null==e?void 0:e.extra)&&(0,r.iterateExtraOptions)(e.extra,"",new WeakSet,(e,r)=>{const a=(0,o.allocWasmString)(e,i),s=(0,o.allocWasmString)(r,i);if(0!==t._OrtAddSessionConfigEntry(n,a,s))throw new Error(`Can't set a session config entry: ${e} - ${r}`)}),[n,i]}catch(l){throw 0!==n&&t._OrtReleaseSessionOptions(n),i.forEach(t._free),l}}},4983:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.allocWasmString=void 0;const r=n(6361);t.allocWasmString=(e,t)=>{const n=(0,r.getInstance)(),o=n.lengthBytesUTF8(e)+1,a=n._malloc(o);return n.stringToUTF8(e,a,o),t.push(a),a}},349:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.extractTransferableBuffers=t.endProfiling=t.run=t.releaseSession=t.createSession=t.createSessionFinalize=t.createSessionAllocate=t.initOrt=void 0;const r=n(586),o=n(4919),a=n(4983),i=n(6361);t.initOrt=(e,t)=>{const n=(0,i.getInstance)()._OrtInit(e,t);if(0!==n)throw new Error(`Can't initialize onnxruntime. error code = ${n}`)};const s=new Map;t.createSessionAllocate=e=>{const t=(0,i.getInstance)(),n=t._malloc(e.byteLength);return t.HEAPU8.set(e,n),[n,e.byteLength]},t.createSessionFinalize=(e,t)=>{const n=(0,i.getInstance)();let r=0,a=0,l=[];try{if([a,l]=(0,o.setSessionOptions)(t),r=n._OrtCreateSession(e[0],e[1],a),0===r)throw new Error("Can't create a session")}finally{n._free(e[0]),n._OrtReleaseSessionOptions(a),l.forEach(n._free)}const u=n._OrtGetInputCount(r),c=n._OrtGetOutputCount(r),d=[],f=[],p=[],h=[];for(let o=0;o<u;o++){const e=n._OrtGetInputName(r,o);if(0===e)throw new Error("Can't get an input name");f.push(e),d.push(n.UTF8ToString(e))}for(let o=0;o<c;o++){const e=n._OrtGetOutputName(r,o);if(0===e)throw new Error("Can't get an output name");h.push(e),p.push(n.UTF8ToString(e))}return s.set(r,[r,f,h]),[r,d,p]},t.createSession=(e,n)=>{const r=(0,t.createSessionAllocate)(e);return(0,t.createSessionFinalize)(r,n)},t.releaseSession=e=>{const t=(0,i.getInstance)(),n=s.get(e);if(!n)throw new Error("invalid session id");const r=n[0],o=n[1],a=n[2];o.forEach(t._OrtFree),a.forEach(t._OrtFree),t._OrtReleaseSession(r),s.delete(e)};const l=e=>{switch(e){case"int8":return 3;case"uint8":return 2;case"bool":return 9;case"int16":return 5;case"uint16":return 4;case"int32":return 6;case"uint32":return 12;case"float32":return 1;case"float64":return 11;case"string":return 8;case"int64":return 7;case"uint64":return 13;default:throw new Error(`unsupported data type: ${e}`)}},u=e=>{switch(e){case 3:return"int8";case 2:return"uint8";case 9:return"bool";case 5:return"int16";case 4:return"uint16";case 6:return"int32";case 12:return"uint32";case 1:return"float32";case 11:return"float64";case 8:return"string";case 7:return"int64";case 13:return"uint64";default:throw new Error(`unsupported data type: ${e}`)}},c=e=>{switch(e){case"float32":return Float32Array;case"uint8":case"bool":return Uint8Array;case"int8":return Int8Array;case"uint16":return Uint16Array;case"int16":return Int16Array;case"int32":return Int32Array;case"float64":return Float64Array;case"uint32":return Uint32Array;case"int64":return BigInt64Array;case"uint64":return BigUint64Array;default:throw new Error(`unsupported type: ${e}`)}};t.run=(e,t,n,o,d)=>{const f=(0,i.getInstance)(),p=s.get(e);if(!p)throw new Error("invalid session id");const h=p[0],m=p[1],g=p[2],b=t.length,y=o.length;let _=0,v=[];const w=[],S=[];try{[_,v]=(0,r.setRunOptions)(d);for(let t=0;t<b;t++){const e=n[t][0],r=n[t][1],o=n[t][2];let i,s;if(Array.isArray(o)){s=4*o.length,i=f._malloc(s),S.push(i);let e=i/4;for(let t=0;t<o.length;t++){if("string"!=typeof o[t])throw new TypeError(`tensor data at index ${t} is not a string`);f.HEAPU32[e++]=(0,a.allocWasmString)(o[t],S)}}else s=o.byteLength,i=f._malloc(s),S.push(i),f.HEAPU8.set(new Uint8Array(o.buffer,o.byteOffset,s),i);const u=f.stackSave(),c=f.stackAlloc(4*r.length);try{let t=c/4;r.forEach(e=>f.HEAP32[t++]=e);const n=f._OrtCreateTensor(l(e),i,s,c,r.length);if(0===n)throw new Error("Can't create a tensor");w.push(n)}finally{f.stackRestore(u)}}const e=f.stackSave(),i=f.stackAlloc(4*b),s=f.stackAlloc(4*b),p=f.stackAlloc(4*y),x=f.stackAlloc(4*y);try{let e=i/4,n=s/4,r=p/4,a=x/4;for(let o=0;o<b;o++)f.HEAPU32[e++]=w[o],f.HEAPU32[n++]=m[t[o]];for(let t=0;t<y;t++)f.HEAPU32[r++]=0,f.HEAPU32[a++]=g[o[t]];let l=f._OrtRun(h,s,i,b,x,y,p,_);const d=[];if(0===l)for(let t=0;t<y;t++){const e=f.HEAPU32[p/4+t],n=f.stackSave(),r=f.stackAlloc(16);let o,a=0;try{if(l=f._OrtGetTensorData(e,r,r+4,r+8,r+12),0!==l)throw new Error(`Can't access output tensor data. error code = ${l}`);let t=r/4;const n=f.HEAPU32[t++];a=f.HEAPU32[t++];const i=f.HEAPU32[t++],s=f.HEAPU32[t++],p=[];for(let e=0;e<s;e++)p.push(f.HEAPU32[i/4+e]);f._OrtFree(i);const h=0===p.length?1:p.reduce((e,t)=>e*t);if(o=u(n),"string"===o){const e=[];let t=a/4;for(let n=0;n<h;n++){const r=f.HEAPU32[t++],o=n===h-1?void 0:f.HEAPU32[t]-r;e.push(f.UTF8ToString(r,o))}d.push([o,p,e])}else{const e=new(c(o))(h);new Uint8Array(e.buffer,e.byteOffset,e.byteLength).set(f.HEAPU8.subarray(a,a+e.byteLength)),d.push([o,p,e])}}finally{f.stackRestore(n),"string"===o&&a&&f._free(a),f._OrtReleaseTensor(e)}}if(0===l)return d;throw new Error(`failed to call OrtRun(). error code = ${l}.`)}finally{f.stackRestore(e)}}finally{w.forEach(f._OrtReleaseTensor),S.forEach(f._free),f._OrtReleaseRunOptions(_),v.forEach(f._free)}},t.endProfiling=e=>{const t=(0,i.getInstance)(),n=s.get(e);if(!n)throw new Error("invalid session id");const r=n[0],o=t._OrtEndProfiling(r);if(0===o)throw new Error("Can't get an profile file name");t._OrtFree(o)},t.extractTransferableBuffers=e=>{const t=[];for(const n of e){const e=n[2];!Array.isArray(e)&&e.buffer&&t.push(e.buffer)}return t}},6361:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.dispose=t.getInstance=t.initializeWebAssembly=void 0;const s=a(n(6449)),l=i(n(932)),u=n(3474);let c,d=!1,f=!1,p=!1;const h=(e,t)=>t?e?"ort-wasm-simd-threaded.wasm":"ort-wasm-threaded.wasm":e?"ort-wasm-simd.wasm":"ort-wasm.wasm";t.initializeWebAssembly=async e=>{if(d)return Promise.resolve();if(f)throw new Error("multiple calls to 'initializeWebAssembly()' detected.");if(p)throw new Error("previous call to 'initializeWebAssembly()' failed.");f=!0;const t=e.initTimeout,r=e.numThreads,o=e.simd,a=r>1&&(()=>{try{return"undefined"!=typeof SharedArrayBuffer&&("undefined"!=typeof MessageChannel&&(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}})(),i=o&&(()=>{try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,30,1,28,0,65,0,253,15,253,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,253,186,1,26,11]))}catch(e){return!1}})(),m="string"==typeof e.wasmPaths?e.wasmPaths:void 0,g=h(!1,a),b=h(i,a),y="object"==typeof e.wasmPaths?e.wasmPaths[b]:void 0;let _=!1;const v=[];if(t>0&&v.push(new Promise(e=>{setTimeout(()=>{_=!0,e()},t)})),v.push(new Promise((e,t)=>{const r=a?u:l.default,o={locateFile:(e,t)=>a&&e.endsWith(".worker.js")&&"undefined"!=typeof Blob?URL.createObjectURL(new Blob([n(4154)],{type:"text/javascript"})):e===g?null!=y?y:(null!=m?m:t)+b:t+e};if(a)if("undefined"==typeof Blob)o.mainScriptUrlOrBlob=s.join("/","ort-wasm-threaded.js");else{const e=`var ortWasmThreaded=(function(){var _scriptDir;return ${r.toString()}})();`;o.mainScriptUrlOrBlob=new Blob([e],{type:"text/javascript"})}r(o).then(t=>{f=!1,d=!0,c=t,e()},e=>{f=!1,p=!0,t(e)})})),await Promise.race(v),_)throw new Error(`WebAssembly backend initializing failed due to timeout: ${t}ms`)},t.getInstance=()=>{if(d&&c)return c;throw new Error("WebAssembly is not initialized yet.")},t.dispose=()=>{var e;!d||f||p||(f=!0,null===(e=c.PThread)||void 0===e||e.terminateAllThreads(),c=void 0,f=!1,d=!1,p=!0)}},9710:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(477),o=n.n(r);function a(){return o()('/*!\n* ONNX Runtime Web v1.14.0\n* Copyright (c) Microsoft Corporation. All rights reserved.\n* Licensed under the MIT License.\n*/\n(()=>{var t={474:(t,e,n)=>{var _scriptDir,r=(_scriptDir=(_scriptDir="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(t){function e(){return j.buffer!=D&&N(j.buffer),P}function r(){return j.buffer!=D&&N(j.buffer),U}function a(){return j.buffer!=D&&N(j.buffer),F}function i(){return j.buffer!=D&&N(j.buffer),I}function o(){return j.buffer!=D&&N(j.buffer),W}var u,c,s;t=t||{},u||(u=void 0!==t?t:{}),u.ready=new Promise((function(t,e){c=t,s=e}));var l,f,p,h,d,y,b=Object.assign({},u),m="./this.program",g=(t,e)=>{throw e},v="object"==typeof window,w="function"==typeof importScripts,_="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,O=u.ENVIRONMENT_IS_PTHREAD||!1,A="";function S(t){return u.locateFile?u.locateFile(t,A):A+t}if(_){let e;A=w?n(908).dirname(A)+"/":"//",y=()=>{d||(h=n(384),d=n(908))},l=function(t,e){return y(),t=d.normalize(t),h.readFileSync(t,e?void 0:"utf8")},p=t=>((t=l(t,!0)).buffer||(t=new Uint8Array(t)),t),f=(t,e,n)=>{y(),t=d.normalize(t),h.readFile(t,(function(t,r){t?n(t):e(r.buffer)}))},1<process.argv.length&&(m=process.argv[1].replace(/\\\\/g,"/")),process.argv.slice(2),process.on("uncaughtException",(function(t){if(!(t instanceof ct))throw t})),process.on("unhandledRejection",(function(t){throw t})),g=(t,e)=>{if(Q())throw process.exitCode=t,e;e instanceof ct||x("exiting due to exception: "+e),process.exit(t)},u.inspect=function(){return"[Emscripten Module object]"};try{e=n(925)}catch(t){throw console.error(\'The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?\'),t}n.g.Worker=e.Worker}else(v||w)&&(w?A=self.location.href:"undefined"!=typeof document&&document.currentScript&&(A=document.currentScript.src),_scriptDir&&(A=_scriptDir),A=0!==A.indexOf("blob:")?A.substr(0,A.replace(/[?#].*/,"").lastIndexOf("/")+1):"",_||(l=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},w&&(p=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),f=(t,e,n)=>{var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?e(r.response):n()},r.onerror=n,r.send(null)}));_&&"undefined"==typeof performance&&(n.g.performance=n(953).performance);var T=console.log.bind(console),E=console.warn.bind(console);_&&(y(),T=t=>h.writeSync(1,t+"\\n"),E=t=>h.writeSync(2,t+"\\n"));var M,C=u.print||T,x=u.printErr||E;Object.assign(u,b),b=null,u.thisProgram&&(m=u.thisProgram),u.quit&&(g=u.quit),u.wasmBinary&&(M=u.wasmBinary);var R=u.noExitRuntime||!1;"object"!=typeof WebAssembly&&at("no native wasm support detected");var j,k,D,P,U,F,I,W,H=!1,L="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function z(t,e,n){var r=(e>>>=0)+n;for(n=e;t[n]&&!(n>=r);)++n;if(16<n-e&&t.buffer&&L)return L.decode(t.buffer instanceof SharedArrayBuffer?t.slice(e,n):t.subarray(e,n));for(r="";e<n;){var a=t[e++];if(128&a){var i=63&t[e++];if(192==(224&a))r+=String.fromCharCode((31&a)<<6|i);else{var o=63&t[e++];65536>(a=224==(240&a)?(15&a)<<12|i<<6|o:(7&a)<<18|i<<12|o<<6|63&t[e++])?r+=String.fromCharCode(a):(a-=65536,r+=String.fromCharCode(55296|a>>10,56320|1023&a))}}else r+=String.fromCharCode(a)}return r}function Y(t,e){return(t>>>=0)?z(r(),t,e):""}function B(t,e,n,r){if(!(0<r))return 0;var a=n>>>=0;r=n+r-1;for(var i=0;i<t.length;++i){var o=t.charCodeAt(i);if(55296<=o&&57343>=o&&(o=65536+((1023&o)<<10)|1023&t.charCodeAt(++i)),127>=o){if(n>=r)break;e[n++>>>0]=o}else{if(2047>=o){if(n+1>=r)break;e[n++>>>0]=192|o>>6}else{if(65535>=o){if(n+2>=r)break;e[n++>>>0]=224|o>>12}else{if(n+3>=r)break;e[n++>>>0]=240|o>>18,e[n++>>>0]=128|o>>12&63}e[n++>>>0]=128|o>>6&63}e[n++>>>0]=128|63&o}}return e[n>>>0]=0,n-a}function G(t){for(var e=0,n=0;n<t.length;++n){var r=t.charCodeAt(n);127>=r?e++:2047>=r?e+=2:55296<=r&&57343>=r?(e+=4,++n):e+=3}return e}function N(t){D=t,u.HEAP8=P=new Int8Array(t),u.HEAP16=new Int16Array(t),u.HEAP32=F=new Int32Array(t),u.HEAPU8=U=new Uint8Array(t),u.HEAPU16=new Uint16Array(t),u.HEAPU32=I=new Uint32Array(t),u.HEAPF32=new Float32Array(t),u.HEAPF64=W=new Float64Array(t)}O&&(D=u.buffer);var V=u.INITIAL_MEMORY||16777216;if(O)j=u.wasmMemory,D=u.buffer;else if(u.wasmMemory)j=u.wasmMemory;else if(!((j=new WebAssembly.Memory({initial:V/65536,maximum:65536,shared:!0})).buffer instanceof SharedArrayBuffer))throw x("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag"),_&&console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)"),Error("bad memory");j&&(D=j.buffer),V=D.byteLength,N(D);var $,q=[],X=[],J=[],Z=[];function Q(){return R||!1}function K(){var t=u.preRun.shift();q.unshift(t)}var tt,et=0,nt=null,rt=null;function at(t){throw O?postMessage({cmd:"onAbort",arg:t}):u.onAbort&&u.onAbort(t),x(t="Aborted("+t+")"),H=!0,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),s(t),t}function it(){return tt.startsWith("data:application/octet-stream;base64,")}function ot(){var t=tt;try{if(t==tt&&M)return new Uint8Array(M);if(p)return p(t);throw"both async and sync fetching of the wasm failed"}catch(t){at(t)}}tt="ort-wasm-threaded.wasm",it()||(tt=S(tt));var ut={};function ct(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function st(t){(t=ht.Vb[t])||at(),ht.mc(t)}function lt(t){var e=ht.Cc();if(!e)return 6;ht.ac.push(e),ht.Vb[t.Ub]=e,e.Ub=t.Ub;var n={cmd:"run",start_routine:t.Ic,arg:t.zc,pthread_ptr:t.Ub};return e.$b=()=>{n.time=performance.now(),e.postMessage(n,t.Nc)},e.loaded&&(e.$b(),delete e.$b),0}function ft(t){if(O)return $t(1,1,t);Q()||(ht.oc(),u.onExit&&u.onExit(t),H=!0),g(t,new ct(t))}function pt(t,e){if(!e&&O)throw bt(t),"unwind";Q()||O||(me(),dt(J),be(0),re[1].length&&ae(1,10),re[2].length&&ae(2,10),ht.oc()),ft(t)}var ht={Yb:[],ac:[],qc:[],Vb:{},fc:function(){O&&ht.Ec()},Pc:function(){},Ec:function(){ht.receiveObjectTransfer=ht.Gc,ht.threadInitTLS=ht.pc,ht.setExitStatus=ht.nc,R=!1},nc:function(){},oc:function(){for(var t of Object.values(ht.Vb))ht.mc(t);for(t of ht.Yb)t.terminate();ht.Yb=[]},mc:function(t){var e=t.Ub;delete ht.Vb[e],ht.Yb.push(t),ht.ac.splice(ht.ac.indexOf(t),1),t.Ub=0,Oe(e)},Gc:function(){},pc:function(){ht.qc.forEach((t=>t()))},Fc:function(t,e){t.onmessage=n=>{var r=(n=n.data).cmd;if(t.Ub&&(ht.Bc=t.Ub),n.targetThread&&n.targetThread!=he()){var a=ht.Vb[n.Qc];a?a.postMessage(n,n.transferList):x(\'Internal error! Worker sent a message "\'+r+\'" to target pthread \'+n.targetThread+", but that thread no longer exists!")}else"processProxyingQueue"===r?zt(n.queue):"spawnThread"===r?lt(n):"cleanupThread"===r?st(n.thread):"killThread"===r?(n=n.thread,r=ht.Vb[n],delete ht.Vb[n],r.terminate(),Oe(n),ht.ac.splice(ht.ac.indexOf(r),1),r.Ub=0):"cancelThread"===r?ht.Vb[n.thread].postMessage({cmd:"cancel"}):"loaded"===r?(t.loaded=!0,e&&e(t),t.$b&&(t.$b(),delete t.$b)):"print"===r?C("Thread "+n.threadId+": "+n.text):"printErr"===r?x("Thread "+n.threadId+": "+n.text):"alert"===r?alert("Thread "+n.threadId+": "+n.text):"setimmediate"===n.target?t.postMessage(n):"onAbort"===r?u.onAbort&&u.onAbort(n.arg):r&&x("worker sent an unknown command "+r);ht.Bc=void 0},t.onerror=t=>{throw x("worker sent an error! "+t.filename+":"+t.lineno+": "+t.message),t},_&&(t.on("message",(function(e){t.onmessage({data:e})})),t.on("error",(function(e){t.onerror(e)})),t.on("detachedExit",(function(){}))),t.postMessage({cmd:"load",urlOrBlob:u.mainScriptUrlOrBlob||_scriptDir,wasmMemory:j,wasmModule:k})},yc:function(){var t=S("ort-wasm-threaded.worker.js");ht.Yb.push(new Worker(t))},Cc:function(){return 0==ht.Yb.length&&(ht.yc(),ht.Fc(ht.Yb[0])),ht.Yb.pop()}};function dt(t){for(;0<t.length;)t.shift()(u)}function yt(t){var e=Ee();return t=t(),Me(e),t}function bt(t){if(O)return $t(2,0,t);try{pt(t)}catch(t){t instanceof ct||"unwind"==t||g(1,t)}}u.PThread=ht,u.establishStackSpace=function(){var t=he(),e=a()[t+44>>2>>>0];t=a()[t+48>>2>>>0],Te(e,e-t),Me(e)};var mt=[];function gt(t){var e=mt[t];return e||(t>=mt.length&&(mt.length=t+1),mt[t]=e=$.get(t)),e}u.invokeEntryPoint=function(t,e){t=gt(t)(e),Q()?ht.nc(t):Ae(t)};var vt,wt,_t=[],Ot=0,At=0;function St(t){this.Zb=t,this.Sb=t-24,this.xc=function(t){i()[this.Sb+4>>2>>>0]=t},this.bc=function(){return i()[this.Sb+4>>2>>>0]},this.wc=function(t){i()[this.Sb+8>>2>>>0]=t},this.Dc=function(){return i()[this.Sb+8>>2>>>0]},this.rc=function(){a()[this.Sb>>2>>>0]=0},this.hc=function(t){t=t?1:0,e()[this.Sb+12>>0>>>0]=t},this.uc=function(){return 0!=e()[this.Sb+12>>0>>>0]},this.ic=function(t){t=t?1:0,e()[this.Sb+13>>0>>>0]=t},this.kc=function(){return 0!=e()[this.Sb+13>>0>>>0]},this.fc=function(t,e){this.cc(0),this.xc(t),this.wc(e),this.rc(),this.hc(!1),this.ic(!1)},this.sc=function(){Atomics.add(a(),this.Sb>>2,1)},this.Hc=function(){return 1===Atomics.sub(a(),this.Sb>>2,1)},this.cc=function(t){i()[this.Sb+16>>2>>>0]=t},this.tc=function(){return i()[this.Sb+16>>2>>>0]},this.vc=function(){if(Re(this.bc()))return i()[this.Zb>>2>>>0];var t=this.tc();return 0!==t?t:this.Zb}}function Tt(t){return ye(new St(t).Sb)}function Et(t,e,n,r){return O?$t(3,1,t,e,n,r):Mt(t,e,n,r)}function Mt(t,e,n,r){if("undefined"==typeof SharedArrayBuffer)return x("Current environment does not support SharedArrayBuffer, pthreads are not available!"),6;var a=[];return O&&0===a.length?Et(t,e,n,r):(t={Ic:n,Ub:t,zc:r,Nc:a},O?(t.Oc="spawnThread",postMessage(t,a),0):lt(t))}function Ct(t,e,n){return O?$t(4,1,t,e,n):0}function xt(t,e){if(O)return $t(5,1,t,e)}function Rt(t,e){if(O)return $t(6,1,t,e)}function jt(t,e,n){if(O)return $t(7,1,t,e,n)}function kt(t,e,n){return O?$t(8,1,t,e,n):0}function Dt(t,e){if(O)return $t(9,1,t,e)}function Pt(t,e,n){if(O)return $t(10,1,t,e,n)}function Ut(t,e,n,r){if(O)return $t(11,1,t,e,n,r)}function Ft(t,e,n,r){if(O)return $t(12,1,t,e,n,r)}function It(t,e,n,r){if(O)return $t(13,1,t,e,n,r)}function Wt(t){if(O)return $t(14,1,t)}function Ht(t,e){if(O)return $t(15,1,t,e)}function Lt(t,e,n){if(O)return $t(16,1,t,e,n)}function zt(t){Atomics.store(a(),t>>2,1),he()&&_e(t),Atomics.compareExchange(a(),t>>2,1,0)}function Yt(t){return i()[t>>>2]+4294967296*a()[t+4>>>2]}function Bt(t,e,n,r,a,i){return O?$t(17,1,t,e,n,r,a,i):-52}function Gt(t,e,n,r,a,i){if(O)return $t(18,1,t,e,n,r,a,i)}function Nt(t){var n=G(t)+1,r=de(n);return r&&B(t,e(),r,n),r}function Vt(t,e,n){function r(t){return(t=t.toTimeString().match(/\\(([A-Za-z ]+)\\)$/))?t[1]:"GMT"}if(O)return $t(19,1,t,e,n);var o=(new Date).getFullYear(),u=new Date(o,0,1),c=new Date(o,6,1);o=u.getTimezoneOffset();var s=c.getTimezoneOffset(),l=Math.max(o,s);a()[t>>2>>>0]=60*l,a()[e>>2>>>0]=Number(o!=s),t=r(u),e=r(c),t=Nt(t),e=Nt(e),s<o?(i()[n>>2>>>0]=t,i()[n+4>>2>>>0]=e):(i()[n>>2>>>0]=e,i()[n+4>>2>>>0]=t)}function $t(t,e){var n=arguments.length-2,r=arguments;return yt((()=>{for(var a=Ce(8*n),i=a>>3,u=0;u<n;u++){var c=r[2+u];o()[i+u>>>0]=c}return we(t,n,a,e)}))}u.executeNotifiedProxyingQueue=zt,wt=_?()=>{var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:O?()=>performance.now()-u.__performance_now_clock_drift:()=>performance.now();var qt,Xt=[],Jt={};function Zt(){if(!qt){var t,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",_:m||"./this.program"};for(t in Jt)void 0===Jt[t]?delete e[t]:e[t]=Jt[t];var n=[];for(t in e)n.push(t+"="+e[t]);qt=n}return qt}function Qt(t,n){if(O)return $t(20,1,t,n);var r=0;return Zt().forEach((function(a,o){var u=n+r;for(o=i()[t+4*o>>2>>>0]=u,u=0;u<a.length;++u)e()[o++>>0>>>0]=a.charCodeAt(u);e()[o>>0>>>0]=0,r+=a.length+1})),0}function Kt(t,e){if(O)return $t(21,1,t,e);var n=Zt();i()[t>>2>>>0]=n.length;var r=0;return n.forEach((function(t){r+=t.length+1})),i()[e>>2>>>0]=r,0}function te(t){return O?$t(22,1,t):52}function ee(t,e,n,r){return O?$t(23,1,t,e,n,r):52}function ne(t,e,n,r,a){return O?$t(24,1,t,e,n,r,a):70}var re=[null,[],[]];function ae(t,e){var n=re[t];0===e||10===e?((1===t?C:x)(z(n,0)),n.length=0):n.push(e)}function ie(t,e,n,a){if(O)return $t(25,1,t,e,n,a);for(var o=0,u=0;u<n;u++){var c=i()[e>>2>>>0],s=i()[e+4>>2>>>0];e+=8;for(var l=0;l<s;l++)ae(t,r()[c+l>>>0]);o+=s}return i()[a>>2>>>0]=o,0}var oe=0;function ue(t){return 0==t%4&&(0!=t%100||0==t%400)}var ce=[31,29,31,30,31,30,31,31,30,31,30,31],se=[31,28,31,30,31,30,31,31,30,31,30,31];function le(t,n,r,i){function o(t,e,n){for(t="number"==typeof t?t.toString():t||"";t.length<e;)t=n[0]+t;return t}function u(t,e){return o(t,e,"0")}function c(t,e){function n(t){return 0>t?-1:0<t?1:0}var r;return 0===(r=n(t.getFullYear()-e.getFullYear()))&&0===(r=n(t.getMonth()-e.getMonth()))&&(r=n(t.getDate()-e.getDate())),r}function s(t){switch(t.getDay()){case 0:return new Date(t.getFullYear()-1,11,29);case 1:return t;case 2:return new Date(t.getFullYear(),0,3);case 3:return new Date(t.getFullYear(),0,2);case 4:return new Date(t.getFullYear(),0,1);case 5:return new Date(t.getFullYear()-1,11,31);case 6:return new Date(t.getFullYear()-1,11,30)}}function l(t){var e=t.Wb;for(t=new Date(new Date(t.Xb+1900,0,1).getTime());0<e;){var n=t.getMonth(),r=(ue(t.getFullYear())?ce:se)[n];if(!(e>r-t.getDate())){t.setDate(t.getDate()+e);break}e-=r-t.getDate()+1,t.setDate(1),11>n?t.setMonth(n+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return n=new Date(t.getFullYear()+1,0,4),e=s(new Date(t.getFullYear(),0,4)),n=s(n),0>=c(e,t)?0>=c(n,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var f=a()[i+40>>2>>>0];for(var p in i={Lc:a()[i>>2>>>0],Kc:a()[i+4>>2>>>0],dc:a()[i+8>>2>>>0],jc:a()[i+12>>2>>>0],ec:a()[i+16>>2>>>0],Xb:a()[i+20>>2>>>0],Tb:a()[i+24>>2>>>0],Wb:a()[i+28>>2>>>0],Rc:a()[i+32>>2>>>0],Jc:a()[i+36>>2>>>0],Mc:f?Y(f):""},r=Y(r),f={"%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"})r=r.replace(new RegExp(p,"g"),f[p]);var h="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),d="January February March April May June July August September October November December".split(" ");for(p in f={"%a":function(t){return h[t.Tb].substring(0,3)},"%A":function(t){return h[t.Tb]},"%b":function(t){return d[t.ec].substring(0,3)},"%B":function(t){return d[t.ec]},"%C":function(t){return u((t.Xb+1900)/100|0,2)},"%d":function(t){return u(t.jc,2)},"%e":function(t){return o(t.jc,2," ")},"%g":function(t){return l(t).toString().substring(2)},"%G":function(t){return l(t)},"%H":function(t){return u(t.dc,2)},"%I":function(t){return 0==(t=t.dc)?t=12:12<t&&(t-=12),u(t,2)},"%j":function(t){for(var e=0,n=0;n<=t.ec-1;e+=(ue(t.Xb+1900)?ce:se)[n++]);return u(t.jc+e,3)},"%m":function(t){return u(t.ec+1,2)},"%M":function(t){return u(t.Kc,2)},"%n":function(){return"\\n"},"%p":function(t){return 0<=t.dc&&12>t.dc?"AM":"PM"},"%S":function(t){return u(t.Lc,2)},"%t":function(){return"\\t"},"%u":function(t){return t.Tb||7},"%U":function(t){return u(Math.floor((t.Wb+7-t.Tb)/7),2)},"%V":function(t){var e=Math.floor((t.Wb+7-(t.Tb+6)%7)/7);if(2>=(t.Tb+371-t.Wb-2)%7&&e++,e)53==e&&(4==(n=(t.Tb+371-t.Wb)%7)||3==n&&ue(t.Xb)||(e=1));else{e=52;var n=(t.Tb+7-t.Wb-1)%7;(4==n||5==n&&ue(t.Xb%400-1))&&e++}return u(e,2)},"%w":function(t){return t.Tb},"%W":function(t){return u(Math.floor((t.Wb+7-(t.Tb+6)%7)/7),2)},"%y":function(t){return(t.Xb+1900).toString().substring(2)},"%Y":function(t){return t.Xb+1900},"%z":function(t){var e=0<=(t=t.Jc);return t=Math.abs(t)/60,(e?"+":"-")+String("0000"+(t/60*100+t%60)).slice(-4)},"%Z":function(t){return t.Mc},"%%":function(){return"%"}},r=r.replace(/%%/g,"\\0\\0"),f)r.includes(p)&&(r=r.replace(new RegExp(p,"g"),f[p](i)));return p=function(t){var e=Array(G(t)+1);return B(t,e,0,e.length),e}(r=r.replace(/\\0\\0/g,"%")),p.length>n?0:(function(t,n){e().set(t,n>>>0)}(p,t),p.length-1)}ht.fc();var fe=[null,ft,bt,Et,Ct,xt,Rt,jt,kt,Dt,Pt,Ut,Ft,It,Wt,Ht,Lt,Bt,Gt,Vt,Qt,Kt,te,ee,ne,ie],pe={b:function(t){return de(t+24)+24},n:function(t){return(t=new St(t)).uc()||(t.hc(!0),Ot--),t.ic(!1),_t.push(t),t.sc(),t.vc()},ma:function(t){throw x("Unexpected exception thrown, this is not properly supported - aborting"),H=!0,t},x:function(){Se(0);var t=_t.pop();if(t.Hc()&&!t.kc()){var e=t.Dc();e&&gt(e)(t.Zb),Tt(t.Zb)}At=0},e:function(){var t=At;if(!t)return oe=0;var e=new St(t);e.cc(t);var n=e.bc();if(!n)return oe=0,t;for(var r=Array.prototype.slice.call(arguments),a=0;a<r.length;a++){var i=r[a];if(0===i||i===n)break;if(xe(i,n,e.Sb+16))return oe=i,t}return oe=n,t},l:function(){var t=At;if(!t)return oe=0;var e=new St(t);e.cc(t);var n=e.bc();if(!n)return oe=0,t;for(var r=Array.prototype.slice.call(arguments),a=0;a<r.length;a++){var i=r[a];if(0===i||i===n)break;if(xe(i,n,e.Sb+16))return oe=i,t}return oe=n,t},h:function(){var t=At;if(!t)return oe=0;var e=new St(t);e.cc(t);var n=e.bc();if(!n)return oe=0,t;for(var r=Array.prototype.slice.call(arguments),a=0;a<r.length;a++){var i=r[a];if(0===i||i===n)break;if(xe(i,n,e.Sb+16))return oe=i,t}return oe=n,t},t:Tt,M:function(){var t=_t.pop();t||at("no exception to throw");var e=t.Zb;throw t.kc()||(_t.push(t),t.ic(!0),t.hc(!1),Ot++),At=e,e},c:function(t,e,n){throw new St(t).fc(e,n),At=t,Ot++,t},pa:function(){return Ot},Fa:function(t){ge(t,!w,1,!v),ht.pc()},T:function(t){O?postMessage({cmd:"cleanupThread",thread:t}):st(t)},xa:Mt,j:function(t){throw At||(At=t),t},H:Ct,Ma:xt,ua:Rt,wa:jt,oa:kt,Ka:Dt,Ca:Pt,Ja:Ut,V:Ft,va:It,sa:Wt,La:Ht,ta:Lt,Ta:function(){},X:function(){at("To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking")},Ua:function(){at("To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking")},W:function(){return Date.now()},ya:function(){return 2097152},Oa:function(){return!0},za:function(t,e,n,r){if(t==e)setTimeout((()=>zt(r)));else if(O)postMessage({targetThread:t,cmd:"processProxyingQueue",queue:r});else{if(!(t=ht.Vb[t]))return;t.postMessage({cmd:"processProxyingQueue",queue:r})}return 1},Ea:function(){return-1},Pa:function(t,e){t=new Date(1e3*Yt(t)),a()[e>>2>>>0]=t.getUTCSeconds(),a()[e+4>>2>>>0]=t.getUTCMinutes(),a()[e+8>>2>>>0]=t.getUTCHours(),a()[e+12>>2>>>0]=t.getUTCDate(),a()[e+16>>2>>>0]=t.getUTCMonth(),a()[e+20>>2>>>0]=t.getUTCFullYear()-1900,a()[e+24>>2>>>0]=t.getUTCDay(),t=(t.getTime()-Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,a()[e+28>>2>>>0]=t},Qa:function(t,e){t=new Date(1e3*Yt(t)),a()[e>>2>>>0]=t.getSeconds(),a()[e+4>>2>>>0]=t.getMinutes(),a()[e+8>>2>>>0]=t.getHours(),a()[e+12>>2>>>0]=t.getDate(),a()[e+16>>2>>>0]=t.getMonth(),a()[e+20>>2>>>0]=t.getFullYear()-1900,a()[e+24>>2>>>0]=t.getDay();var n=new Date(t.getFullYear(),0,1),r=(t.getTime()-n.getTime())/864e5|0;a()[e+28>>2>>>0]=r,a()[e+36>>2>>>0]=-60*t.getTimezoneOffset(),r=new Date(t.getFullYear(),6,1).getTimezoneOffset(),t=0|(r!=(n=n.getTimezoneOffset())&&t.getTimezoneOffset()==Math.min(n,r)),a()[e+32>>2>>>0]=t},Ra:function(t){var e=new Date(a()[t+20>>2>>>0]+1900,a()[t+16>>2>>>0],a()[t+12>>2>>>0],a()[t+8>>2>>>0],a()[t+4>>2>>>0],a()[t>>2>>>0],0),n=a()[t+32>>2>>>0],r=e.getTimezoneOffset(),i=new Date(e.getFullYear(),0,1),o=new Date(e.getFullYear(),6,1).getTimezoneOffset(),u=i.getTimezoneOffset(),c=Math.min(u,o);return 0>n?a()[t+32>>2>>>0]=Number(o!=u&&c==r):0<n!=(c==r)&&(o=Math.max(u,o),e.setTime(e.getTime()+6e4*((0<n?c:o)-r))),a()[t+24>>2>>>0]=e.getDay(),n=(e.getTime()-i.getTime())/864e5|0,a()[t+28>>2>>>0]=n,a()[t>>2>>>0]=e.getSeconds(),a()[t+4>>2>>>0]=e.getMinutes(),a()[t+8>>2>>>0]=e.getHours(),a()[t+12>>2>>>0]=e.getDate(),a()[t+16>>2>>>0]=e.getMonth(),e.getTime()/1e3|0},Aa:Bt,Ba:Gt,Sa:function t(e,n,r){t.Ac||(t.Ac=!0,Vt(e,n,r))},y:function(){at("")},U:function(){if(!_&&!w){var t="Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread";vt||(vt={}),vt[t]||(vt[t]=1,_&&(t="warning: "+t),x(t))}},ra:function(){return 4294901760},B:wt,Ia:function(t,e,n){r().copyWithin(t>>>0,e>>>0,e+n>>>0)},F:function(){return _?n(993).cpus().length:navigator.hardwareConcurrency},Da:function(t,e,n){Xt.length=e,n>>=3;for(var r=0;r<e;r++)Xt[r]=o()[n+r>>>0];return(0>t?ut[-t-1]:fe[t]).apply(null,Xt)},qa:function(t){var e=r().length;if((t>>>=0)<=e||4294901760<t)return!1;for(var n=1;4>=n;n*=2){var a=e*(1+.2/n);a=Math.min(a,t+100663296);var i=Math;a=Math.max(t,a),i=i.min.call(i,4294901760,a+(65536-a%65536)%65536);t:{try{j.grow(i-D.byteLength+65535>>>16),N(j.buffer);var o=1;break t}catch(t){}o=void 0}if(o)return!0}return!1},Na:function(){throw"unwind"},Ga:Qt,Ha:Kt,J:pt,I:te,S:ee,ga:ne,R:ie,d:function(){return oe},na:function t(r,a){t.lc||(t.lc=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var t=new Uint8Array(1);return()=>(crypto.getRandomValues(t),t[0])}if(_)try{var e=n(Object(function(){var t=new Error("Cannot find module \'crypto\'");throw t.code="MODULE_NOT_FOUND",t}()));return()=>e.randomBytes(1)[0]}catch(t){}return()=>at("randomDevice")}());for(var i=0;i<a;i++)e()[r+i>>0>>>0]=t.lc();return 0},ia:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},ja:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},K:function(t){var e=Ee();try{return gt(t)()}catch(t){if(Me(e),t!==t+0)throw t;Se(1,0)}},f:function(t,e){var n=Ee();try{return gt(t)(e)}catch(t){if(Me(n),t!==t+0)throw t;Se(1,0)}},P:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},Q:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},k:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},p:function(t,e,n,r){var a=Ee();try{return gt(t)(e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Se(1,0)}},q:function(t,e,n,r,a){var i=Ee();try{return gt(t)(e,n,r,a)}catch(t){if(Me(i),t!==t+0)throw t;Se(1,0)}},N:function(t,e,n,r,a,i){var o=Ee();try{return gt(t)(e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Se(1,0)}},s:function(t,e,n,r,a,i){var o=Ee();try{return gt(t)(e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Se(1,0)}},w:function(t,e,n,r,a,i,o){var u=Ee();try{return gt(t)(e,n,r,a,i,o)}catch(t){if(Me(u),t!==t+0)throw t;Se(1,0)}},L:function(t,e,n,r,a,i,o,u){var c=Ee();try{return gt(t)(e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Se(1,0)}},E:function(t,e,n,r,a,i,o,u,c,s,l,f){var p=Ee();try{return gt(t)(e,n,r,a,i,o,u,c,s,l,f)}catch(t){if(Me(p),t!==t+0)throw t;Se(1,0)}},aa:function(t,e,n,r,a,i,o,u){var c=Ee();try{return He(t,e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Se(1,0)}},_:function(t,e,n,r,a,i,o){var u=Ee();try{return ke(t,e,n,r,a,i,o)}catch(t){if(Me(u),t!==t+0)throw t;Se(1,0)}},Z:function(t,e,n,r,a){var i=Ee();try{return Le(t,e,n,r,a)}catch(t){if(Me(i),t!==t+0)throw t;Se(1,0)}},ca:function(t,e,n,r){var a=Ee();try{return Ie(t,e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Se(1,0)}},$:function(t){var e=Ee();try{return je(t)}catch(t){if(Me(e),t!==t+0)throw t;Se(1,0)}},ba:function(t,e){var n=Ee();try{return We(t,e)}catch(t){if(Me(n),t!==t+0)throw t;Se(1,0)}},Y:function(t,e,n){var r=Ee();try{return De(t,e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},g:function(t){var e=Ee();try{gt(t)()}catch(t){if(Me(e),t!==t+0)throw t;Se(1,0)}},r:function(t,e){var n=Ee();try{gt(t)(e)}catch(t){if(Me(n),t!==t+0)throw t;Se(1,0)}},i:function(t,e,n){var r=Ee();try{gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},ha:function(t,e,n,r){var a=Ee();try{gt(t)(e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Se(1,0)}},m:function(t,e,n,r){var a=Ee();try{gt(t)(e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Se(1,0)}},v:function(t,e,n,r,a){var i=Ee();try{gt(t)(e,n,r,a)}catch(t){if(Me(i),t!==t+0)throw t;Se(1,0)}},u:function(t,e,n,r,a,i){var o=Ee();try{gt(t)(e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Se(1,0)}},O:function(t,e,n,r,a,i,o){var u=Ee();try{gt(t)(e,n,r,a,i,o)}catch(t){if(Me(u),t!==t+0)throw t;Se(1,0)}},A:function(t,e,n,r,a,i,o,u){var c=Ee();try{gt(t)(e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Se(1,0)}},ka:function(t,e,n,r,a,i,o,u,c){var s=Ee();try{gt(t)(e,n,r,a,i,o,u,c)}catch(t){if(Me(s),t!==t+0)throw t;Se(1,0)}},C:function(t,e,n,r,a,i,o,u,c,s,l){var f=Ee();try{gt(t)(e,n,r,a,i,o,u,c,s,l)}catch(t){if(Me(f),t!==t+0)throw t;Se(1,0)}},D:function(t,e,n,r,a,i,o,u,c,s,l,f,p,h,d,y){var b=Ee();try{gt(t)(e,n,r,a,i,o,u,c,s,l,f,p,h,d,y)}catch(t){if(Me(b),t!==t+0)throw t;Se(1,0)}},fa:function(t,e,n,r,a,i,o,u){var c=Ee();try{Pe(t,e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Se(1,0)}},da:function(t,e,n,r,a,i,o,u,c,s,l,f){var p=Ee();try{Fe(t,e,n,r,a,i,o,u,c,s,l,f)}catch(t){if(Me(p),t!==t+0)throw t;Se(1,0)}},ea:function(t,e,n,r,a,i){var o=Ee();try{Ue(t,e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Se(1,0)}},o:function(t){return t},a:j||u.wasmMemory,G:function(t){oe=t},la:le,z:function(t,e,n,r){return le(t,e,n,r)}};!function(){function t(t,e){u.asm=t.exports,ht.qc.push(u.asm.sb),$=u.asm.ub,X.unshift(u.asm.Va),k=e,O||(et--,u.monitorRunDependencies&&u.monitorRunDependencies(et),0==et&&(null!==nt&&(clearInterval(nt),nt=null),rt&&(t=rt,rt=null,t())))}function e(e){t(e.instance,e.module)}function n(t){return function(){if(!M&&(v||w)){if("function"==typeof fetch&&!tt.startsWith("file://"))return fetch(tt,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at \'"+tt+"\'";return t.arrayBuffer()})).catch((function(){return ot()}));if(f)return new Promise((function(t,e){f(tt,(function(e){t(new Uint8Array(e))}),e)}))}return Promise.resolve().then((function(){return ot()}))}().then((function(t){return WebAssembly.instantiate(t,r)})).then((function(t){return t})).then(t,(function(t){x("failed to asynchronously prepare wasm: "+t),at(t)}))}var r={a:pe};if(O||(et++,u.monitorRunDependencies&&u.monitorRunDependencies(et)),u.instantiateWasm)try{return u.instantiateWasm(r,t)}catch(t){return x("Module.instantiateWasm callback failed with error: "+t),!1}(M||"function"!=typeof WebAssembly.instantiateStreaming||it()||tt.startsWith("file://")||_||"function"!=typeof fetch?n(e):fetch(tt,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,r).then(e,(function(t){return x("wasm streaming compile failed: "+t),x("falling back to ArrayBuffer instantiation"),n(e)}))}))).catch(s)}(),u.___wasm_call_ctors=function(){return(u.___wasm_call_ctors=u.asm.Va).apply(null,arguments)},u._OrtInit=function(){return(u._OrtInit=u.asm.Wa).apply(null,arguments)},u._OrtCreateSessionOptions=function(){return(u._OrtCreateSessionOptions=u.asm.Xa).apply(null,arguments)},u._OrtAppendExecutionProvider=function(){return(u._OrtAppendExecutionProvider=u.asm.Ya).apply(null,arguments)},u._OrtAddSessionConfigEntry=function(){return(u._OrtAddSessionConfigEntry=u.asm.Za).apply(null,arguments)},u._OrtReleaseSessionOptions=function(){return(u._OrtReleaseSessionOptions=u.asm._a).apply(null,arguments)},u._OrtCreateSession=function(){return(u._OrtCreateSession=u.asm.$a).apply(null,arguments)},u._OrtReleaseSession=function(){return(u._OrtReleaseSession=u.asm.ab).apply(null,arguments)},u._OrtGetInputCount=function(){return(u._OrtGetInputCount=u.asm.bb).apply(null,arguments)},u._OrtGetOutputCount=function(){return(u._OrtGetOutputCount=u.asm.cb).apply(null,arguments)},u._OrtGetInputName=function(){return(u._OrtGetInputName=u.asm.db).apply(null,arguments)},u._OrtGetOutputName=function(){return(u._OrtGetOutputName=u.asm.eb).apply(null,arguments)},u._OrtFree=function(){return(u._OrtFree=u.asm.fb).apply(null,arguments)},u._OrtCreateTensor=function(){return(u._OrtCreateTensor=u.asm.gb).apply(null,arguments)},u._OrtGetTensorData=function(){return(u._OrtGetTensorData=u.asm.hb).apply(null,arguments)},u._OrtReleaseTensor=function(){return(u._OrtReleaseTensor=u.asm.ib).apply(null,arguments)},u._OrtCreateRunOptions=function(){return(u._OrtCreateRunOptions=u.asm.jb).apply(null,arguments)},u._OrtAddRunConfigEntry=function(){return(u._OrtAddRunConfigEntry=u.asm.kb).apply(null,arguments)},u._OrtReleaseRunOptions=function(){return(u._OrtReleaseRunOptions=u.asm.lb).apply(null,arguments)},u._OrtRun=function(){return(u._OrtRun=u.asm.mb).apply(null,arguments)},u._OrtEndProfiling=function(){return(u._OrtEndProfiling=u.asm.nb).apply(null,arguments)};var he=u._pthread_self=function(){return(he=u._pthread_self=u.asm.ob).apply(null,arguments)},de=u._malloc=function(){return(de=u._malloc=u.asm.pb).apply(null,arguments)},ye=u._free=function(){return(ye=u._free=u.asm.qb).apply(null,arguments)},be=u._fflush=function(){return(be=u._fflush=u.asm.rb).apply(null,arguments)};u.__emscripten_tls_init=function(){return(u.__emscripten_tls_init=u.asm.sb).apply(null,arguments)};var me=u.___funcs_on_exit=function(){return(me=u.___funcs_on_exit=u.asm.tb).apply(null,arguments)},ge=u.__emscripten_thread_init=function(){return(ge=u.__emscripten_thread_init=u.asm.vb).apply(null,arguments)};u.__emscripten_thread_crashed=function(){return(u.__emscripten_thread_crashed=u.asm.wb).apply(null,arguments)};var ve,we=u._emscripten_run_in_main_runtime_thread_js=function(){return(we=u._emscripten_run_in_main_runtime_thread_js=u.asm.xb).apply(null,arguments)},_e=u.__emscripten_proxy_execute_task_queue=function(){return(_e=u.__emscripten_proxy_execute_task_queue=u.asm.yb).apply(null,arguments)},Oe=u.__emscripten_thread_free_data=function(){return(Oe=u.__emscripten_thread_free_data=u.asm.zb).apply(null,arguments)},Ae=u.__emscripten_thread_exit=function(){return(Ae=u.__emscripten_thread_exit=u.asm.Ab).apply(null,arguments)},Se=u._setThrew=function(){return(Se=u._setThrew=u.asm.Bb).apply(null,arguments)},Te=u._emscripten_stack_set_limits=function(){return(Te=u._emscripten_stack_set_limits=u.asm.Cb).apply(null,arguments)},Ee=u.stackSave=function(){return(Ee=u.stackSave=u.asm.Db).apply(null,arguments)},Me=u.stackRestore=function(){return(Me=u.stackRestore=u.asm.Eb).apply(null,arguments)},Ce=u.stackAlloc=function(){return(Ce=u.stackAlloc=u.asm.Fb).apply(null,arguments)},xe=u.___cxa_can_catch=function(){return(xe=u.___cxa_can_catch=u.asm.Gb).apply(null,arguments)},Re=u.___cxa_is_pointer_type=function(){return(Re=u.___cxa_is_pointer_type=u.asm.Hb).apply(null,arguments)},je=u.dynCall_j=function(){return(je=u.dynCall_j=u.asm.Ib).apply(null,arguments)},ke=u.dynCall_iiiiij=function(){return(ke=u.dynCall_iiiiij=u.asm.Jb).apply(null,arguments)},De=u.dynCall_jii=function(){return(De=u.dynCall_jii=u.asm.Kb).apply(null,arguments)},Pe=u.dynCall_viiiiij=function(){return(Pe=u.dynCall_viiiiij=u.asm.Lb).apply(null,arguments)},Ue=u.dynCall_vjji=function(){return(Ue=u.dynCall_vjji=u.asm.Mb).apply(null,arguments)},Fe=u.dynCall_viiijjjii=function(){return(Fe=u.dynCall_viiijjjii=u.asm.Nb).apply(null,arguments)},Ie=u.dynCall_iij=function(){return(Ie=u.dynCall_iij=u.asm.Ob).apply(null,arguments)},We=u.dynCall_ji=function(){return(We=u.dynCall_ji=u.asm.Pb).apply(null,arguments)},He=u.dynCall_iiiiiij=function(){return(He=u.dynCall_iiiiiij=u.asm.Qb).apply(null,arguments)},Le=u.dynCall_iiij=function(){return(Le=u.dynCall_iiij=u.asm.Rb).apply(null,arguments)};function ze(){function t(){if(!ve&&(ve=!0,u.calledRun=!0,!H)&&(O||dt(X),c(u),u.onRuntimeInitialized&&u.onRuntimeInitialized(),!O)){if(u.postRun)for("function"==typeof u.postRun&&(u.postRun=[u.postRun]);u.postRun.length;){var t=u.postRun.shift();Z.unshift(t)}dt(Z)}}if(!(0<et))if(O)c(u),O||dt(X),postMessage({cmd:"loaded"});else{if(u.preRun)for("function"==typeof u.preRun&&(u.preRun=[u.preRun]);u.preRun.length;)K();dt(q),0<et||(u.setStatus?(u.setStatus("Running..."),setTimeout((function(){setTimeout((function(){u.setStatus("")}),1),t()}),1)):t())}}if(u.UTF8ToString=Y,u.stringToUTF8=function(t,e,n){return B(t,r(),e,n)},u.lengthBytesUTF8=G,u.keepRuntimeAlive=Q,u.wasmMemory=j,u.stackSave=Ee,u.stackRestore=Me,u.stackAlloc=Ce,u.ExitStatus=ct,u.PThread=ht,rt=function t(){ve||ze(),ve||(rt=t)},u.preInit)for("function"==typeof u.preInit&&(u.preInit=[u.preInit]);0<u.preInit.length;)u.preInit.pop()();return ze(),t.ready});t.exports=r},932:(t,e,n)=>{var _scriptDir,r=(_scriptDir=(_scriptDir="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(t){var e,r,a;t=t||{},e||(e=void 0!==t?t:{}),e.ready=new Promise((function(t,e){r=t,a=e}));var i,o,u,c,s,l,f=Object.assign({},e),p="./this.program",h=(t,e)=>{throw e},d="object"==typeof window,y="function"==typeof importScripts,b="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,m="";b?(m=y?n(908).dirname(m)+"/":"//",l=()=>{s||(c=n(384),s=n(908))},i=function(t,e){return l(),t=s.normalize(t),c.readFileSync(t,e?void 0:"utf8")},u=t=>((t=i(t,!0)).buffer||(t=new Uint8Array(t)),t),o=(t,e,n)=>{l(),t=s.normalize(t),c.readFile(t,(function(t,r){t?n(t):e(r.buffer)}))},1<process.argv.length&&(p=process.argv[1].replace(/\\\\/g,"/")),process.argv.slice(2),process.on("uncaughtException",(function(t){if(!(t instanceof J))throw t})),process.on("unhandledRejection",(function(t){throw t})),h=(t,e)=>{if(_||0<L)throw process.exitCode=t,e;e instanceof J||w("exiting due to exception: "+e),process.exit(t)},e.inspect=function(){return"[Emscripten Module object]"}):(d||y)&&(y?m=self.location.href:"undefined"!=typeof document&&document.currentScript&&(m=document.currentScript.src),_scriptDir&&(m=_scriptDir),m=0!==m.indexOf("blob:")?m.substr(0,m.replace(/[?#].*/,"").lastIndexOf("/")+1):"",i=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},y&&(u=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),o=(t,e,n)=>{var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?e(r.response):n()},r.onerror=n,r.send(null)});var g,v=e.print||console.log.bind(console),w=e.printErr||console.warn.bind(console);Object.assign(e,f),f=null,e.thisProgram&&(p=e.thisProgram),e.quit&&(h=e.quit),e.wasmBinary&&(g=e.wasmBinary);var _=e.noExitRuntime||!1;"object"!=typeof WebAssembly&&V("no native wasm support detected");var O,A,S,T,E,M,C=!1,x="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function R(t,e,n){var r=(e>>>=0)+n;for(n=e;t[n]&&!(n>=r);)++n;if(16<n-e&&t.buffer&&x)return x.decode(t.subarray(e,n));for(r="";e<n;){var a=t[e++];if(128&a){var i=63&t[e++];if(192==(224&a))r+=String.fromCharCode((31&a)<<6|i);else{var o=63&t[e++];65536>(a=224==(240&a)?(15&a)<<12|i<<6|o:(7&a)<<18|i<<12|o<<6|63&t[e++])?r+=String.fromCharCode(a):(a-=65536,r+=String.fromCharCode(55296|a>>10,56320|1023&a))}}else r+=String.fromCharCode(a)}return r}function j(t,e){return(t>>>=0)?R(T,t,e):""}function k(t,e,n,r){if(!(0<r))return 0;var a=n>>>=0;r=n+r-1;for(var i=0;i<t.length;++i){var o=t.charCodeAt(i);if(55296<=o&&57343>=o&&(o=65536+((1023&o)<<10)|1023&t.charCodeAt(++i)),127>=o){if(n>=r)break;e[n++>>>0]=o}else{if(2047>=o){if(n+1>=r)break;e[n++>>>0]=192|o>>6}else{if(65535>=o){if(n+2>=r)break;e[n++>>>0]=224|o>>12}else{if(n+3>=r)break;e[n++>>>0]=240|o>>18,e[n++>>>0]=128|o>>12&63}e[n++>>>0]=128|o>>6&63}e[n++>>>0]=128|63&o}}return e[n>>>0]=0,n-a}function D(t){for(var e=0,n=0;n<t.length;++n){var r=t.charCodeAt(n);127>=r?e++:2047>=r?e+=2:55296<=r&&57343>=r?(e+=4,++n):e+=3}return e}function P(){var t=O.buffer;A=t,e.HEAP8=S=new Int8Array(t),e.HEAP16=new Int16Array(t),e.HEAP32=E=new Int32Array(t),e.HEAPU8=T=new Uint8Array(t),e.HEAPU16=new Uint16Array(t),e.HEAPU32=M=new Uint32Array(t),e.HEAPF32=new Float32Array(t),e.HEAPF64=new Float64Array(t)}var U,F=[],I=[],W=[],H=[],L=0;function z(){var t=e.preRun.shift();F.unshift(t)}var Y,B=0,G=null,N=null;function V(t){throw e.onAbort&&e.onAbort(t),w(t="Aborted("+t+")"),C=!0,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),a(t),t}function $(){return Y.startsWith("data:application/octet-stream;base64,")}if(Y="ort-wasm.wasm",!$()){var q=Y;Y=e.locateFile?e.locateFile(q,m):m+q}function X(){var t=Y;try{if(t==Y&&g)return new Uint8Array(g);if(u)return u(t);throw"both async and sync fetching of the wasm failed"}catch(t){V(t)}}function J(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function Z(t){for(;0<t.length;)t.shift()(e)}var Q=[],K=0,tt=0;function et(t){this.Db=t,this.zb=t-24,this.Ub=function(t){M[this.zb+4>>2>>>0]=t},this.Eb=function(){return M[this.zb+4>>2>>>0]},this.Sb=function(t){M[this.zb+8>>2>>>0]=t},this.Wb=function(){return M[this.zb+8>>2>>>0]},this.Tb=function(){E[this.zb>>2>>>0]=0},this.Ib=function(t){S[this.zb+12>>0>>>0]=t?1:0},this.Pb=function(){return 0!=S[this.zb+12>>0>>>0]},this.Jb=function(t){S[this.zb+13>>0>>>0]=t?1:0},this.Lb=function(){return 0!=S[this.zb+13>>0>>>0]},this.Rb=function(t,e){this.Fb(0),this.Ub(t),this.Sb(e),this.Tb(),this.Ib(!1),this.Jb(!1)},this.Nb=function(){E[this.zb>>2>>>0]+=1},this.Xb=function(){var t=E[this.zb>>2>>>0];return E[this.zb>>2>>>0]=t-1,1===t},this.Fb=function(t){M[this.zb+16>>2>>>0]=t},this.Ob=function(){return M[this.zb+16>>2>>>0]},this.Qb=function(){if(Mt(this.Eb()))return M[this.Db>>2>>>0];var t=this.Ob();return 0!==t?t:this.Db}}function nt(t){return vt(new et(t).zb)}var rt=[];function at(t){var e=rt[t];return e||(t>=rt.length&&(rt.length=t+1),rt[t]=e=U.get(t)),e}function it(t){var e=D(t)+1,n=gt(e);return n&&k(t,S,n,e),n}var ot={};function ut(){if(!ct){var t,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",_:p||"./this.program"};for(t in ot)void 0===ot[t]?delete e[t]:e[t]=ot[t];var n=[];for(t in e)n.push(t+"="+e[t]);ct=n}return ct}var ct,st=[null,[],[]];function lt(t,e){var n=st[t];0===e||10===e?((1===t?v:w)(R(n,0)),n.length=0):n.push(e)}var ft=0;function pt(t){return 0==t%4&&(0!=t%100||0==t%400)}var ht=[31,29,31,30,31,30,31,31,30,31,30,31],dt=[31,28,31,30,31,30,31,31,30,31,30,31];function yt(t,e,n,r){function a(t,e,n){for(t="number"==typeof t?t.toString():t||"";t.length<e;)t=n[0]+t;return t}function i(t,e){return a(t,e,"0")}function o(t,e){function n(t){return 0>t?-1:0<t?1:0}var r;return 0===(r=n(t.getFullYear()-e.getFullYear()))&&0===(r=n(t.getMonth()-e.getMonth()))&&(r=n(t.getDate()-e.getDate())),r}function u(t){switch(t.getDay()){case 0:return new Date(t.getFullYear()-1,11,29);case 1:return t;case 2:return new Date(t.getFullYear(),0,3);case 3:return new Date(t.getFullYear(),0,2);case 4:return new Date(t.getFullYear(),0,1);case 5:return new Date(t.getFullYear()-1,11,31);case 6:return new Date(t.getFullYear()-1,11,30)}}function c(t){var e=t.Bb;for(t=new Date(new Date(t.Cb+1900,0,1).getTime());0<e;){var n=t.getMonth(),r=(pt(t.getFullYear())?ht:dt)[n];if(!(e>r-t.getDate())){t.setDate(t.getDate()+e);break}e-=r-t.getDate()+1,t.setDate(1),11>n?t.setMonth(n+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return n=new Date(t.getFullYear()+1,0,4),e=u(new Date(t.getFullYear(),0,4)),n=u(n),0>=o(e,t)?0>=o(n,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var s=E[r+40>>2>>>0];for(var l in r={$b:E[r>>2>>>0],Zb:E[r+4>>2>>>0],Gb:E[r+8>>2>>>0],Kb:E[r+12>>2>>>0],Hb:E[r+16>>2>>>0],Cb:E[r+20>>2>>>0],Ab:E[r+24>>2>>>0],Bb:E[r+28>>2>>>0],bc:E[r+32>>2>>>0],Yb:E[r+36>>2>>>0],ac:s?j(s):""},n=j(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"})n=n.replace(new RegExp(l,"g"),s[l]);var f="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),p="January February March April May June July August September October November December".split(" ");for(l in s={"%a":function(t){return f[t.Ab].substring(0,3)},"%A":function(t){return f[t.Ab]},"%b":function(t){return p[t.Hb].substring(0,3)},"%B":function(t){return p[t.Hb]},"%C":function(t){return i((t.Cb+1900)/100|0,2)},"%d":function(t){return i(t.Kb,2)},"%e":function(t){return a(t.Kb,2," ")},"%g":function(t){return c(t).toString().substring(2)},"%G":function(t){return c(t)},"%H":function(t){return i(t.Gb,2)},"%I":function(t){return 0==(t=t.Gb)?t=12:12<t&&(t-=12),i(t,2)},"%j":function(t){for(var e=0,n=0;n<=t.Hb-1;e+=(pt(t.Cb+1900)?ht:dt)[n++]);return i(t.Kb+e,3)},"%m":function(t){return i(t.Hb+1,2)},"%M":function(t){return i(t.Zb,2)},"%n":function(){return"\\n"},"%p":function(t){return 0<=t.Gb&&12>t.Gb?"AM":"PM"},"%S":function(t){return i(t.$b,2)},"%t":function(){return"\\t"},"%u":function(t){return t.Ab||7},"%U":function(t){return i(Math.floor((t.Bb+7-t.Ab)/7),2)},"%V":function(t){var e=Math.floor((t.Bb+7-(t.Ab+6)%7)/7);if(2>=(t.Ab+371-t.Bb-2)%7&&e++,e)53==e&&(4==(n=(t.Ab+371-t.Bb)%7)||3==n&&pt(t.Cb)||(e=1));else{e=52;var n=(t.Ab+7-t.Bb-1)%7;(4==n||5==n&&pt(t.Cb%400-1))&&e++}return i(e,2)},"%w":function(t){return t.Ab},"%W":function(t){return i(Math.floor((t.Bb+7-(t.Ab+6)%7)/7),2)},"%y":function(t){return(t.Cb+1900).toString().substring(2)},"%Y":function(t){return t.Cb+1900},"%z":function(t){var e=0<=(t=t.Yb);return t=Math.abs(t)/60,(e?"+":"-")+String("0000"+(t/60*100+t%60)).slice(-4)},"%Z":function(t){return t.ac},"%%":function(){return"%"}},n=n.replace(/%%/g,"\\0\\0"),s)n.includes(l)&&(n=n.replace(new RegExp(l,"g"),s[l](r)));return l=function(t){var e=Array(D(t)+1);return k(t,e,0,e.length),e}(n=n.replace(/\\0\\0/g,"%")),l.length>e?0:(S.set(l,t>>>0),l.length-1)}var bt={a:function(t){return gt(t+24)+24},m:function(t){return(t=new et(t)).Pb()||(t.Ib(!0),K--),t.Jb(!1),Q.push(t),t.Nb(),t.Qb()},ia:function(t){throw w("Unexpected exception thrown, this is not properly supported - aborting"),C=!0,t},w:function(){Ot(0);var t=Q.pop();if(t.Xb()&&!t.Lb()){var e=t.Wb();e&&at(e)(t.Db),nt(t.Db)}tt=0},d:function(){var t=tt;if(!t)return ft=0;var e=new et(t);e.Fb(t);var n=e.Eb();if(!n)return ft=0,t;for(var r=Array.prototype.slice.call(arguments),a=0;a<r.length;a++){var i=r[a];if(0===i||i===n)break;if(Et(i,n,e.zb+16))return ft=i,t}return ft=n,t},k:function(){var t=tt;if(!t)return ft=0;var e=new et(t);e.Fb(t);var n=e.Eb();if(!n)return ft=0,t;for(var r=Array.prototype.slice.call(arguments),a=0;a<r.length;a++){var i=r[a];if(0===i||i===n)break;if(Et(i,n,e.zb+16))return ft=i,t}return ft=n,t},g:function(){var t=tt;if(!t)return ft=0;var e=new et(t);e.Fb(t);var n=e.Eb();if(!n)return ft=0,t;for(var r=Array.prototype.slice.call(arguments),a=0;a<r.length;a++){var i=r[a];if(0===i||i===n)break;if(Et(i,n,e.zb+16))return ft=i,t}return ft=n,t},s:nt,L:function(){var t=Q.pop();t||V("no exception to throw");var e=t.Db;throw t.Lb()||(Q.push(t),t.Jb(!0),t.Ib(!1),K++),tt=e,e},b:function(t,e,n){throw new et(t).Rb(e,n),tt=t,K++,t},la:function(){return K},i:function(t){throw tt||(tt=t),t},H:function(){return 0},Ba:function(){},pa:function(){},ra:function(){},ka:function(){return 0},za:function(){},ua:function(){},ya:function(){},R:function(){},qa:function(){},na:function(){},Aa:function(){},oa:function(){},Ha:function(){},Ja:function(){V("To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking")},Ia:function(){V("To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking")},S:function(){return Date.now()},Ca:function(){return!0},Da:function(t,e){t=new Date(1e3*(M[t>>>2]+4294967296*E[t+4>>>2])),E[e>>2>>>0]=t.getUTCSeconds(),E[e+4>>2>>>0]=t.getUTCMinutes(),E[e+8>>2>>>0]=t.getUTCHours(),E[e+12>>2>>>0]=t.getUTCDate(),E[e+16>>2>>>0]=t.getUTCMonth(),E[e+20>>2>>>0]=t.getUTCFullYear()-1900,E[e+24>>2>>>0]=t.getUTCDay(),E[e+28>>2>>>0]=(t.getTime()-Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0))/864e5|0},Ea:function(t,e){t=new Date(1e3*(M[t>>>2]+4294967296*E[t+4>>>2])),E[e>>2>>>0]=t.getSeconds(),E[e+4>>2>>>0]=t.getMinutes(),E[e+8>>2>>>0]=t.getHours(),E[e+12>>2>>>0]=t.getDate(),E[e+16>>2>>>0]=t.getMonth(),E[e+20>>2>>>0]=t.getFullYear()-1900,E[e+24>>2>>>0]=t.getDay();var n=new Date(t.getFullYear(),0,1);E[e+28>>2>>>0]=(t.getTime()-n.getTime())/864e5|0,E[e+36>>2>>>0]=-60*t.getTimezoneOffset();var r=new Date(t.getFullYear(),6,1).getTimezoneOffset();n=n.getTimezoneOffset(),E[e+32>>2>>>0]=0|(r!=n&&t.getTimezoneOffset()==Math.min(n,r))},Fa:function(t){var e=new Date(E[t+20>>2>>>0]+1900,E[t+16>>2>>>0],E[t+12>>2>>>0],E[t+8>>2>>>0],E[t+4>>2>>>0],E[t>>2>>>0],0),n=E[t+32>>2>>>0],r=e.getTimezoneOffset(),a=new Date(e.getFullYear(),0,1),i=new Date(e.getFullYear(),6,1).getTimezoneOffset(),o=a.getTimezoneOffset(),u=Math.min(o,i);return 0>n?E[t+32>>2>>>0]=Number(i!=o&&u==r):0<n!=(u==r)&&(i=Math.max(o,i),e.setTime(e.getTime()+6e4*((0<n?u:i)-r))),E[t+24>>2>>>0]=e.getDay(),E[t+28>>2>>>0]=(e.getTime()-a.getTime())/864e5|0,E[t>>2>>>0]=e.getSeconds(),E[t+4>>2>>>0]=e.getMinutes(),E[t+8>>2>>>0]=e.getHours(),E[t+12>>2>>>0]=e.getDate(),E[t+16>>2>>>0]=e.getMonth(),e.getTime()/1e3|0},sa:function(){return-52},ta:function(){},Ga:function t(e,n,r){t.Vb||(t.Vb=!0,function(t,e,n){function r(t){return(t=t.toTimeString().match(/\\(([A-Za-z ]+)\\)$/))?t[1]:"GMT"}var a=(new Date).getFullYear(),i=new Date(a,0,1),o=new Date(a,6,1);a=i.getTimezoneOffset();var u=o.getTimezoneOffset();E[t>>2>>>0]=60*Math.max(a,u),E[e>>2>>>0]=Number(a!=u),t=r(i),e=r(o),t=it(t),e=it(e),u<a?(M[n>>2>>>0]=t,M[n+4>>2>>>0]=e):(M[n>>2>>>0]=e,M[n+4>>2>>>0]=t)}(e,n,r))},B:function(){V("")},ma:function(){return 4294901760},I:b?()=>{var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:()=>performance.now(),xa:function(t,e,n){T.copyWithin(t>>>0,e>>>0,e+n>>>0)},G:function(t){var e=T.length;if(4294901760<(t>>>=0))return!1;for(var n=1;4>=n;n*=2){var r=e*(1+.2/n);r=Math.min(r,t+100663296);var a=Math;r=Math.max(t,r),a=a.min.call(a,4294901760,r+(65536-r%65536)%65536);t:{try{O.grow(a-A.byteLength+65535>>>16),P();var i=1;break t}catch(t){}i=void 0}if(i)return!0}return!1},va:function(t,e){var n=0;return ut().forEach((function(r,a){var i=e+n;for(a=M[t+4*a>>2>>>0]=i,i=0;i<r.length;++i)S[a++>>0>>>0]=r.charCodeAt(i);S[a>>0>>>0]=0,n+=r.length+1})),0},wa:function(t,e){var n=ut();M[t>>2>>>0]=n.length;var r=0;return n.forEach((function(t){r+=t.length+1})),M[e>>2>>>0]=r,0},ba:function(t){_||0<L||(_t(),Z(W),wt(0),st[1].length&&lt(1,10),st[2].length&&lt(2,10)),_||0<L||(e.onExit&&e.onExit(t),C=!0),h(t,new J(t))},E:function(){return 52},Q:function(){return 52},ca:function(){return 70},P:function(t,e,n,r){for(var a=0,i=0;i<n;i++){var o=M[e>>2>>>0],u=M[e+4>>2>>>0];e+=8;for(var c=0;c<u;c++)lt(t,T[o+c>>>0]);a+=u}return M[r>>2>>>0]=a,0},c:function(){return ft},ja:function t(e,r){t.Mb||(t.Mb=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var t=new Uint8Array(1);return()=>(crypto.getRandomValues(t),t[0])}if(b)try{var e=n(Object(function(){var t=new Error("Cannot find module \'crypto\'");throw t.code="MODULE_NOT_FOUND",t}()));return()=>e.randomBytes(1)[0]}catch(t){}return()=>V("randomDevice")}());for(var a=0;a<r;a++)S[e+a>>0>>>0]=t.Mb();return 0},ea:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},fa:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},J:function(t){var e=At();try{return at(t)()}catch(t){if(St(e),t!==t+0)throw t;Ot(1,0)}},e:function(t,e){var n=At();try{return at(t)(e)}catch(t){if(St(n),t!==t+0)throw t;Ot(1,0)}},N:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},O:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},j:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},o:function(t,e,n,r){var a=At();try{return at(t)(e,n,r)}catch(t){if(St(a),t!==t+0)throw t;Ot(1,0)}},p:function(t,e,n,r,a){var i=At();try{return at(t)(e,n,r,a)}catch(t){if(St(i),t!==t+0)throw t;Ot(1,0)}},M:function(t,e,n,r,a,i){var o=At();try{return at(t)(e,n,r,a,i)}catch(t){if(St(o),t!==t+0)throw t;Ot(1,0)}},r:function(t,e,n,r,a,i){var o=At();try{return at(t)(e,n,r,a,i)}catch(t){if(St(o),t!==t+0)throw t;Ot(1,0)}},v:function(t,e,n,r,a,i,o){var u=At();try{return at(t)(e,n,r,a,i,o)}catch(t){if(St(u),t!==t+0)throw t;Ot(1,0)}},K:function(t,e,n,r,a,i,o,u){var c=At();try{return at(t)(e,n,r,a,i,o,u)}catch(t){if(St(c),t!==t+0)throw t;Ot(1,0)}},D:function(t,e,n,r,a,i,o,u,c,s,l,f){var p=At();try{return at(t)(e,n,r,a,i,o,u,c,s,l,f)}catch(t){if(St(p),t!==t+0)throw t;Ot(1,0)}},X:function(t,e,n,r,a,i,o,u){var c=At();try{return Ft(t,e,n,r,a,i,o,u)}catch(t){if(St(c),t!==t+0)throw t;Ot(1,0)}},V:function(t,e,n,r,a,i,o){var u=At();try{return xt(t,e,n,r,a,i,o)}catch(t){if(St(u),t!==t+0)throw t;Ot(1,0)}},U:function(t,e,n,r,a){var i=At();try{return It(t,e,n,r,a)}catch(t){if(St(i),t!==t+0)throw t;Ot(1,0)}},Z:function(t,e,n,r){var a=At();try{return Pt(t,e,n,r)}catch(t){if(St(a),t!==t+0)throw t;Ot(1,0)}},W:function(t){var e=At();try{return Ct(t)}catch(t){if(St(e),t!==t+0)throw t;Ot(1,0)}},Y:function(t,e){var n=At();try{return Ut(t,e)}catch(t){if(St(n),t!==t+0)throw t;Ot(1,0)}},T:function(t,e,n){var r=At();try{return Rt(t,e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},f:function(t){var e=At();try{at(t)()}catch(t){if(St(e),t!==t+0)throw t;Ot(1,0)}},q:function(t,e){var n=At();try{at(t)(e)}catch(t){if(St(n),t!==t+0)throw t;Ot(1,0)}},h:function(t,e,n){var r=At();try{at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},da:function(t,e,n,r){var a=At();try{at(t)(e,n,r)}catch(t){if(St(a),t!==t+0)throw t;Ot(1,0)}},l:function(t,e,n,r){var a=At();try{at(t)(e,n,r)}catch(t){if(St(a),t!==t+0)throw t;Ot(1,0)}},t:function(t,e,n,r,a){var i=At();try{at(t)(e,n,r,a)}catch(t){if(St(i),t!==t+0)throw t;Ot(1,0)}},u:function(t,e,n,r,a,i){var o=At();try{at(t)(e,n,r,a,i)}catch(t){if(St(o),t!==t+0)throw t;Ot(1,0)}},x:function(t,e,n,r,a,i,o){var u=At();try{at(t)(e,n,r,a,i,o)}catch(t){if(St(u),t!==t+0)throw t;Ot(1,0)}},z:function(t,e,n,r,a,i,o,u){var c=At();try{at(t)(e,n,r,a,i,o,u)}catch(t){if(St(c),t!==t+0)throw t;Ot(1,0)}},ga:function(t,e,n,r,a,i,o,u,c){var s=At();try{at(t)(e,n,r,a,i,o,u,c)}catch(t){if(St(s),t!==t+0)throw t;Ot(1,0)}},A:function(t,e,n,r,a,i,o,u,c,s,l){var f=At();try{at(t)(e,n,r,a,i,o,u,c,s,l)}catch(t){if(St(f),t!==t+0)throw t;Ot(1,0)}},C:function(t,e,n,r,a,i,o,u,c,s,l,f,p,h,d,y){var b=At();try{at(t)(e,n,r,a,i,o,u,c,s,l,f,p,h,d,y)}catch(t){if(St(b),t!==t+0)throw t;Ot(1,0)}},aa:function(t,e,n,r,a,i,o,u){var c=At();try{jt(t,e,n,r,a,i,o,u)}catch(t){if(St(c),t!==t+0)throw t;Ot(1,0)}},_:function(t,e,n,r,a,i,o,u,c,s,l,f){var p=At();try{Dt(t,e,n,r,a,i,o,u,c,s,l,f)}catch(t){if(St(p),t!==t+0)throw t;Ot(1,0)}},$:function(t,e,n,r,a,i){var o=At();try{kt(t,e,n,r,a,i)}catch(t){if(St(o),t!==t+0)throw t;Ot(1,0)}},n:function(t){return t},F:function(t){ft=t},ha:yt,y:function(t,e,n,r){return yt(t,e,n,r)}};!function(){function t(t){e.asm=t.exports,O=e.asm.Ka,P(),U=e.asm.ib,I.unshift(e.asm.La),B--,e.monitorRunDependencies&&e.monitorRunDependencies(B),0==B&&(null!==G&&(clearInterval(G),G=null),N&&(t=N,N=null,t()))}function n(e){t(e.instance)}function r(t){return function(){if(!g&&(d||y)){if("function"==typeof fetch&&!Y.startsWith("file://"))return fetch(Y,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at \'"+Y+"\'";return t.arrayBuffer()})).catch((function(){return X()}));if(o)return new Promise((function(t,e){o(Y,(function(e){t(new Uint8Array(e))}),e)}))}return Promise.resolve().then((function(){return X()}))}().then((function(t){return WebAssembly.instantiate(t,i)})).then((function(t){return t})).then(t,(function(t){w("failed to asynchronously prepare wasm: "+t),V(t)}))}var i={a:bt};if(B++,e.monitorRunDependencies&&e.monitorRunDependencies(B),e.instantiateWasm)try{return e.instantiateWasm(i,t)}catch(t){return w("Module.instantiateWasm callback failed with error: "+t),!1}(g||"function"!=typeof WebAssembly.instantiateStreaming||$()||Y.startsWith("file://")||b||"function"!=typeof fetch?r(n):fetch(Y,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,i).then(n,(function(t){return w("wasm streaming compile failed: "+t),w("falling back to ArrayBuffer instantiation"),r(n)}))}))).catch(a)}(),e.___wasm_call_ctors=function(){return(e.___wasm_call_ctors=e.asm.La).apply(null,arguments)},e._OrtInit=function(){return(e._OrtInit=e.asm.Ma).apply(null,arguments)},e._OrtCreateSessionOptions=function(){return(e._OrtCreateSessionOptions=e.asm.Na).apply(null,arguments)},e._OrtAppendExecutionProvider=function(){return(e._OrtAppendExecutionProvider=e.asm.Oa).apply(null,arguments)},e._OrtAddSessionConfigEntry=function(){return(e._OrtAddSessionConfigEntry=e.asm.Pa).apply(null,arguments)},e._OrtReleaseSessionOptions=function(){return(e._OrtReleaseSessionOptions=e.asm.Qa).apply(null,arguments)},e._OrtCreateSession=function(){return(e._OrtCreateSession=e.asm.Ra).apply(null,arguments)},e._OrtReleaseSession=function(){return(e._OrtReleaseSession=e.asm.Sa).apply(null,arguments)},e._OrtGetInputCount=function(){return(e._OrtGetInputCount=e.asm.Ta).apply(null,arguments)},e._OrtGetOutputCount=function(){return(e._OrtGetOutputCount=e.asm.Ua).apply(null,arguments)},e._OrtGetInputName=function(){return(e._OrtGetInputName=e.asm.Va).apply(null,arguments)},e._OrtGetOutputName=function(){return(e._OrtGetOutputName=e.asm.Wa).apply(null,arguments)},e._OrtFree=function(){return(e._OrtFree=e.asm.Xa).apply(null,arguments)},e._OrtCreateTensor=function(){return(e._OrtCreateTensor=e.asm.Ya).apply(null,arguments)},e._OrtGetTensorData=function(){return(e._OrtGetTensorData=e.asm.Za).apply(null,arguments)},e._OrtReleaseTensor=function(){return(e._OrtReleaseTensor=e.asm._a).apply(null,arguments)},e._OrtCreateRunOptions=function(){return(e._OrtCreateRunOptions=e.asm.$a).apply(null,arguments)},e._OrtAddRunConfigEntry=function(){return(e._OrtAddRunConfigEntry=e.asm.ab).apply(null,arguments)},e._OrtReleaseRunOptions=function(){return(e._OrtReleaseRunOptions=e.asm.bb).apply(null,arguments)},e._OrtRun=function(){return(e._OrtRun=e.asm.cb).apply(null,arguments)},e._OrtEndProfiling=function(){return(e._OrtEndProfiling=e.asm.db).apply(null,arguments)};var mt,gt=e._malloc=function(){return(gt=e._malloc=e.asm.eb).apply(null,arguments)},vt=e._free=function(){return(vt=e._free=e.asm.fb).apply(null,arguments)},wt=e._fflush=function(){return(wt=e._fflush=e.asm.gb).apply(null,arguments)},_t=e.___funcs_on_exit=function(){return(_t=e.___funcs_on_exit=e.asm.hb).apply(null,arguments)},Ot=e._setThrew=function(){return(Ot=e._setThrew=e.asm.jb).apply(null,arguments)},At=e.stackSave=function(){return(At=e.stackSave=e.asm.kb).apply(null,arguments)},St=e.stackRestore=function(){return(St=e.stackRestore=e.asm.lb).apply(null,arguments)},Tt=e.stackAlloc=function(){return(Tt=e.stackAlloc=e.asm.mb).apply(null,arguments)},Et=e.___cxa_can_catch=function(){return(Et=e.___cxa_can_catch=e.asm.nb).apply(null,arguments)},Mt=e.___cxa_is_pointer_type=function(){return(Mt=e.___cxa_is_pointer_type=e.asm.ob).apply(null,arguments)},Ct=e.dynCall_j=function(){return(Ct=e.dynCall_j=e.asm.pb).apply(null,arguments)},xt=e.dynCall_iiiiij=function(){return(xt=e.dynCall_iiiiij=e.asm.qb).apply(null,arguments)},Rt=e.dynCall_jii=function(){return(Rt=e.dynCall_jii=e.asm.rb).apply(null,arguments)},jt=e.dynCall_viiiiij=function(){return(jt=e.dynCall_viiiiij=e.asm.sb).apply(null,arguments)},kt=e.dynCall_vjji=function(){return(kt=e.dynCall_vjji=e.asm.tb).apply(null,arguments)},Dt=e.dynCall_viiijjjii=function(){return(Dt=e.dynCall_viiijjjii=e.asm.ub).apply(null,arguments)},Pt=e.dynCall_iij=function(){return(Pt=e.dynCall_iij=e.asm.vb).apply(null,arguments)},Ut=e.dynCall_ji=function(){return(Ut=e.dynCall_ji=e.asm.wb).apply(null,arguments)},Ft=e.dynCall_iiiiiij=function(){return(Ft=e.dynCall_iiiiiij=e.asm.xb).apply(null,arguments)},It=e.dynCall_iiij=function(){return(It=e.dynCall_iiij=e.asm.yb).apply(null,arguments)};function Wt(){function t(){if(!mt&&(mt=!0,e.calledRun=!0,!C)){if(Z(I),r(e),e.onRuntimeInitialized&&e.onRuntimeInitialized(),e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;){var t=e.postRun.shift();H.unshift(t)}Z(H)}}if(!(0<B)){if(e.preRun)for("function"==typeof e.preRun&&(e.preRun=[e.preRun]);e.preRun.length;)z();Z(F),0<B||(e.setStatus?(e.setStatus("Running..."),setTimeout((function(){setTimeout((function(){e.setStatus("")}),1),t()}),1)):t())}}if(e.UTF8ToString=j,e.stringToUTF8=function(t,e,n){return k(t,T,e,n)},e.lengthBytesUTF8=D,e.stackSave=At,e.stackRestore=St,e.stackAlloc=Tt,N=function t(){mt||Wt(),mt||(N=t)},e.preInit)for("function"==typeof e.preInit&&(e.preInit=[e.preInit]);0<e.preInit.length;)e.preInit.pop()();return Wt(),t.ready});t.exports=r},967:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.iterateExtraOptions=void 0,e.iterateExtraOptions=(t,n,r,a)=>{if("object"==typeof t&&null!==t){if(r.has(t))throw new Error("Circular reference in options");r.add(t)}Object.entries(t).forEach((([t,i])=>{const o=n?n+t:t;if("object"==typeof i)(0,e.iterateExtraOptions)(i,o+".",r,a);else if("string"==typeof i||"number"==typeof i)a(o,i.toString());else{if("boolean"!=typeof i)throw new Error("Can\'t handle extra config type: "+typeof i);a(o,i?"1":"0")}}))}},586:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setRunOptions=void 0;const r=n(967),a=n(983),i=n(361);e.setRunOptions=t=>{const e=(0,i.getInstance)();let n=0;const o=[],u=t||{};try{if(void 0===(null==t?void 0:t.logSeverityLevel))u.logSeverityLevel=2;else if("number"!=typeof t.logSeverityLevel||!Number.isInteger(t.logSeverityLevel)||t.logSeverityLevel<0||t.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${t.logSeverityLevel}`);if(void 0===(null==t?void 0:t.logVerbosityLevel))u.logVerbosityLevel=0;else if("number"!=typeof t.logVerbosityLevel||!Number.isInteger(t.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${t.logVerbosityLevel}`);void 0===(null==t?void 0:t.terminate)&&(u.terminate=!1);let i=0;if(void 0!==(null==t?void 0:t.tag)&&(i=(0,a.allocWasmString)(t.tag,o)),n=e._OrtCreateRunOptions(u.logSeverityLevel,u.logVerbosityLevel,!!u.terminate,i),0===n)throw new Error("Can\'t create run options");return void 0!==(null==t?void 0:t.extra)&&(0,r.iterateExtraOptions)(t.extra,"",new WeakSet,((t,r)=>{const i=(0,a.allocWasmString)(t,o),u=(0,a.allocWasmString)(r,o);if(0!==e._OrtAddRunConfigEntry(n,i,u))throw new Error(`Can\'t set a run config entry: ${t} - ${r}`)})),[n,o]}catch(t){throw 0!==n&&e._OrtReleaseRunOptions(n),o.forEach(e._free),t}}},919:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setSessionOptions=void 0;const r=n(967),a=n(983),i=n(361);e.setSessionOptions=t=>{const e=(0,i.getInstance)();let n=0;const o=[],u=t||{};(t=>{t.extra||(t.extra={}),t.extra.session||(t.extra.session={});const e=t.extra.session;e.use_ort_model_bytes_directly||(e.use_ort_model_bytes_directly="1")})(u);try{void 0===(null==t?void 0:t.graphOptimizationLevel)&&(u.graphOptimizationLevel="all");const c=(t=>{switch(t){case"disabled":return 0;case"basic":return 1;case"extended":return 2;case"all":return 99;default:throw new Error(`unsupported graph optimization level: ${t}`)}})(u.graphOptimizationLevel);void 0===(null==t?void 0:t.enableCpuMemArena)&&(u.enableCpuMemArena=!0),void 0===(null==t?void 0:t.enableMemPattern)&&(u.enableMemPattern=!0),void 0===(null==t?void 0:t.executionMode)&&(u.executionMode="sequential");const s=(t=>{switch(t){case"sequential":return 0;case"parallel":return 1;default:throw new Error(`unsupported execution mode: ${t}`)}})(u.executionMode);let l=0;if(void 0!==(null==t?void 0:t.logId)&&(l=(0,a.allocWasmString)(t.logId,o)),void 0===(null==t?void 0:t.logSeverityLevel))u.logSeverityLevel=2;else if("number"!=typeof t.logSeverityLevel||!Number.isInteger(t.logSeverityLevel)||t.logSeverityLevel<0||t.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${t.logSeverityLevel}`);if(void 0===(null==t?void 0:t.logVerbosityLevel))u.logVerbosityLevel=0;else if("number"!=typeof t.logVerbosityLevel||!Number.isInteger(t.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${t.logVerbosityLevel}`);if(void 0===(null==t?void 0:t.enableProfiling)&&(u.enableProfiling=!1),n=e._OrtCreateSessionOptions(c,!!u.enableCpuMemArena,!!u.enableMemPattern,s,!!u.enableProfiling,0,l,u.logSeverityLevel,u.logVerbosityLevel),0===n)throw new Error("Can\'t create session options");return(null==t?void 0:t.executionProviders)&&((t,e,n)=>{for(const r of e){let e="string"==typeof r?r:r.name;switch(e){case"xnnpack":e="XNNPACK";break;case"wasm":case"cpu":continue;default:throw new Error(`not supported EP: ${e}`)}const o=(0,a.allocWasmString)(e,n);if(0!==(0,i.getInstance)()._OrtAppendExecutionProvider(t,o))throw new Error(`Can\'t append execution provider: ${e}`)}})(n,t.executionProviders,o),void 0!==(null==t?void 0:t.extra)&&(0,r.iterateExtraOptions)(t.extra,"",new WeakSet,((t,r)=>{const i=(0,a.allocWasmString)(t,o),u=(0,a.allocWasmString)(r,o);if(0!==e._OrtAddSessionConfigEntry(n,i,u))throw new Error(`Can\'t set a session config entry: ${t} - ${r}`)})),[n,o]}catch(t){throw 0!==n&&e._OrtReleaseSessionOptions(n),o.forEach(e._free),t}}},983:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.allocWasmString=void 0;const r=n(361);e.allocWasmString=(t,e)=>{const n=(0,r.getInstance)(),a=n.lengthBytesUTF8(t)+1,i=n._malloc(a);return n.stringToUTF8(t,i,a),e.push(i),i}},349:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.extractTransferableBuffers=e.endProfiling=e.run=e.releaseSession=e.createSession=e.createSessionFinalize=e.createSessionAllocate=e.initOrt=void 0;const r=n(586),a=n(919),i=n(983),o=n(361);e.initOrt=(t,e)=>{const n=(0,o.getInstance)()._OrtInit(t,e);if(0!==n)throw new Error(`Can\'t initialize onnxruntime. error code = ${n}`)};const u=new Map;e.createSessionAllocate=t=>{const e=(0,o.getInstance)(),n=e._malloc(t.byteLength);return e.HEAPU8.set(t,n),[n,t.byteLength]},e.createSessionFinalize=(t,e)=>{const n=(0,o.getInstance)();let r=0,i=0,c=[];try{if([i,c]=(0,a.setSessionOptions)(e),r=n._OrtCreateSession(t[0],t[1],i),0===r)throw new Error("Can\'t create a session")}finally{n._free(t[0]),n._OrtReleaseSessionOptions(i),c.forEach(n._free)}const s=n._OrtGetInputCount(r),l=n._OrtGetOutputCount(r),f=[],p=[],h=[],d=[];for(let t=0;t<s;t++){const e=n._OrtGetInputName(r,t);if(0===e)throw new Error("Can\'t get an input name");p.push(e),f.push(n.UTF8ToString(e))}for(let t=0;t<l;t++){const e=n._OrtGetOutputName(r,t);if(0===e)throw new Error("Can\'t get an output name");d.push(e),h.push(n.UTF8ToString(e))}return u.set(r,[r,p,d]),[r,f,h]},e.createSession=(t,n)=>{const r=(0,e.createSessionAllocate)(t);return(0,e.createSessionFinalize)(r,n)},e.releaseSession=t=>{const e=(0,o.getInstance)(),n=u.get(t);if(!n)throw new Error("invalid session id");const r=n[0],a=n[1],i=n[2];a.forEach(e._OrtFree),i.forEach(e._OrtFree),e._OrtReleaseSession(r),u.delete(t)};const c=t=>{switch(t){case"int8":return 3;case"uint8":return 2;case"bool":return 9;case"int16":return 5;case"uint16":return 4;case"int32":return 6;case"uint32":return 12;case"float32":return 1;case"float64":return 11;case"string":return 8;case"int64":return 7;case"uint64":return 13;default:throw new Error(`unsupported data type: ${t}`)}},s=t=>{switch(t){case 3:return"int8";case 2:return"uint8";case 9:return"bool";case 5:return"int16";case 4:return"uint16";case 6:return"int32";case 12:return"uint32";case 1:return"float32";case 11:return"float64";case 8:return"string";case 7:return"int64";case 13:return"uint64";default:throw new Error(`unsupported data type: ${t}`)}},l=t=>{switch(t){case"float32":return Float32Array;case"uint8":case"bool":return Uint8Array;case"int8":return Int8Array;case"uint16":return Uint16Array;case"int16":return Int16Array;case"int32":return Int32Array;case"float64":return Float64Array;case"uint32":return Uint32Array;case"int64":return BigInt64Array;case"uint64":return BigUint64Array;default:throw new Error(`unsupported type: ${t}`)}};e.run=(t,e,n,a,f)=>{const p=(0,o.getInstance)(),h=u.get(t);if(!h)throw new Error("invalid session id");const d=h[0],y=h[1],b=h[2],m=e.length,g=a.length;let v=0,w=[];const _=[],O=[];try{[v,w]=(0,r.setRunOptions)(f);for(let t=0;t<m;t++){const e=n[t][0],r=n[t][1],a=n[t][2];let o,u;if(Array.isArray(a)){u=4*a.length,o=p._malloc(u),O.push(o);let t=o/4;for(let e=0;e<a.length;e++){if("string"!=typeof a[e])throw new TypeError(`tensor data at index ${e} is not a string`);p.HEAPU32[t++]=(0,i.allocWasmString)(a[e],O)}}else u=a.byteLength,o=p._malloc(u),O.push(o),p.HEAPU8.set(new Uint8Array(a.buffer,a.byteOffset,u),o);const s=p.stackSave(),l=p.stackAlloc(4*r.length);try{let t=l/4;r.forEach((e=>p.HEAP32[t++]=e));const n=p._OrtCreateTensor(c(e),o,u,l,r.length);if(0===n)throw new Error("Can\'t create a tensor");_.push(n)}finally{p.stackRestore(s)}}const t=p.stackSave(),o=p.stackAlloc(4*m),u=p.stackAlloc(4*m),h=p.stackAlloc(4*g),A=p.stackAlloc(4*g);try{let n=o/4,r=u/4,i=h/4,c=A/4;for(let t=0;t<m;t++)p.HEAPU32[n++]=_[t],p.HEAPU32[r++]=y[e[t]];for(let t=0;t<g;t++)p.HEAPU32[i++]=0,p.HEAPU32[c++]=b[a[t]];let f=p._OrtRun(d,u,o,m,A,g,h,v);const w=[];if(0===f)for(let t=0;t<g;t++){const e=p.HEAPU32[h/4+t],n=p.stackSave(),r=p.stackAlloc(16);let a,i=0;try{if(f=p._OrtGetTensorData(e,r,r+4,r+8,r+12),0!==f)throw new Error(`Can\'t access output tensor data. error code = ${f}`);let t=r/4;const o=p.HEAPU32[t++];i=p.HEAPU32[t++];const u=p.HEAPU32[t++],c=p.HEAPU32[t++],h=[];for(let t=0;t<c;t++)h.push(p.HEAPU32[u/4+t]);p._OrtFree(u);const d=0===h.length?1:h.reduce(((t,e)=>t*e));if(a=s(o),"string"===a){const t=[];let e=i/4;for(let n=0;n<d;n++){const r=p.HEAPU32[e++],a=n===d-1?void 0:p.HEAPU32[e]-r;t.push(p.UTF8ToString(r,a))}w.push([a,h,t])}else{const t=new(l(a))(d);new Uint8Array(t.buffer,t.byteOffset,t.byteLength).set(p.HEAPU8.subarray(i,i+t.byteLength)),w.push([a,h,t])}}finally{p.stackRestore(n),"string"===a&&i&&p._free(i),p._OrtReleaseTensor(e)}}if(0===f)return w;throw new Error(`failed to call OrtRun(). error code = ${f}.`)}finally{p.stackRestore(t)}}finally{_.forEach(p._OrtReleaseTensor),O.forEach(p._free),p._OrtReleaseRunOptions(v),w.forEach(p._free)}},e.endProfiling=t=>{const e=(0,o.getInstance)(),n=u.get(t);if(!n)throw new Error("invalid session id");const r=n[0],a=e._OrtEndProfiling(r);if(0===a)throw new Error("Can\'t get an profile file name");e._OrtFree(a)},e.extractTransferableBuffers=t=>{const e=[];for(const n of t){const t=n[2];!Array.isArray(t)&&t.buffer&&e.push(t.buffer)}return e}},361:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var a=Object.getOwnPropertyDescriptor(e,n);a&&!("get"in a?!e.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,a)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),a=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&r(e,t,n);return a(e,t),e},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.dispose=e.getInstance=e.initializeWebAssembly=void 0;const u=i(n(449)),c=o(n(932)),s=n(474);let l,f=!1,p=!1,h=!1;const d=(t,e)=>e?t?"ort-wasm-simd-threaded.wasm":"ort-wasm-threaded.wasm":t?"ort-wasm-simd.wasm":"ort-wasm.wasm";e.initializeWebAssembly=async t=>{if(f)return Promise.resolve();if(p)throw new Error("multiple calls to \'initializeWebAssembly()\' detected.");if(h)throw new Error("previous call to \'initializeWebAssembly()\' failed.");p=!0;const e=t.initTimeout,r=t.numThreads,a=t.simd,i=r>1&&(()=>{try{return"undefined"!=typeof SharedArrayBuffer&&("undefined"!=typeof MessageChannel&&(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(t){return!1}})(),o=a&&(()=>{try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,30,1,28,0,65,0,253,15,253,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,253,186,1,26,11]))}catch(t){return!1}})(),y="string"==typeof t.wasmPaths?t.wasmPaths:void 0,b=d(!1,i),m=d(o,i),g="object"==typeof t.wasmPaths?t.wasmPaths[m]:void 0;let v=!1;const w=[];if(e>0&&w.push(new Promise((t=>{setTimeout((()=>{v=!0,t()}),e)}))),w.push(new Promise(((t,e)=>{const r=i?s:c.default,a={locateFile:(t,e)=>i&&t.endsWith(".worker.js")&&"undefined"!=typeof Blob?URL.createObjectURL(new Blob([n(154)],{type:"text/javascript"})):t===b?null!=g?g:(null!=y?y:e)+m:e+t};if(i)if("undefined"==typeof Blob)a.mainScriptUrlOrBlob=u.join("/","ort-wasm-threaded.js");else{const t=`var ortWasmThreaded=(function(){var _scriptDir;return ${r.toString()}})();`;a.mainScriptUrlOrBlob=new Blob([t],{type:"text/javascript"})}r(a).then((e=>{p=!1,f=!0,l=e,t()}),(t=>{p=!1,h=!0,e(t)}))}))),await Promise.race(w),v)throw new Error(`WebAssembly backend initializing failed due to timeout: ${e}ms`)},e.getInstance=()=>{if(f&&l)return l;throw new Error("WebAssembly is not initialized yet.")},e.dispose=()=>{var t;!f||p||h||(p=!0,null===(t=l.PThread)||void 0===t||t.terminateAllThreads(),l=void 0,p=!1,f=!1,h=!0)}},154:t=>{"use strict";t.exports=\'"use strict";var e={},t="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node;if(t){var r=require("worker_threads"),a=r.parentPort;a.on("message",(e=>onmessage({data:e})));var o=require("fs");Object.assign(global,{self:global,require:require,Module:e,location:{href:__filename},Worker:r.Worker,importScripts:function(e){(0,eval)(o.readFileSync(e,"utf8"))},postMessage:function(e){a.postMessage(e)},performance:global.performance||{now:function(){return Date.now()}}})}var s=!1,n=[],i=function(){var e=Array.prototype.slice.call(arguments).join(" ");t?o.writeSync(2,e+"\\\\n"):console.error(e)};self.alert=function(){var t=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:t,threadId:e._pthread_self()})},e.instantiateWasm=(t,r)=>{var a=new WebAssembly.Instance(e.wasmModule,t);return r(a),e.wasmModule=null,a.exports},self.onunhandledrejection=e=>{throw e.reason??e},self.onmessage=t=>{try{if("load"===t.data.cmd){if(e.wasmModule=t.data.wasmModule,e.wasmMemory=t.data.wasmMemory,e.buffer=e.wasmMemory.buffer,e.ENVIRONMENT_IS_PTHREAD=!0,"string"==typeof t.data.urlOrBlob)importScripts(t.data.urlOrBlob);else{var r=URL.createObjectURL(t.data.urlOrBlob);importScripts(r),URL.revokeObjectURL(r)}ortWasmThreaded(e).then((function(t){e=t}))}else if("run"===t.data.cmd){e.__performance_now_clock_drift=performance.now()-t.data.time,e.__emscripten_thread_init(t.data.pthread_ptr,0,0,1),e.establishStackSpace(),e.PThread.receiveObjectTransfer(t.data),e.PThread.threadInitTLS(),s||(n.forEach((t=>{e.executeNotifiedProxyingQueue(t)})),n=[],s=!0);try{e.invokeEntryPoint(t.data.start_routine,t.data.arg)}catch(t){if("unwind"!=t){if(!(t instanceof e.ExitStatus))throw t;e.keepRuntimeAlive()||e.__emscripten_thread_exit(t.status)}}}else"cancel"===t.data.cmd?e._pthread_self()&&e.__emscripten_thread_exit(-1):"setimmediate"===t.data.target||("processProxyingQueue"===t.data.cmd?s?e.executeNotifiedProxyingQueue(t.data.queue):n.push(t.data.queue):(i("worker.js received unknown command "+t.data.cmd),i(t.data)))}catch(t){throw i("worker.js onmessage() captured an uncaught exception: "+t),t&&t.stack&&i(t.stack),e.__emscripten_thread_crashed&&e.__emscripten_thread_crashed(),t}};\\n\'},384:()=>{},993:()=>{},908:()=>{},953:()=>{},925:()=>{},449:()=>{}},e={};function n(r){var a=e[r];if(void 0!==a)return a.exports;var i=e[r]={exports:{}};return t[r].call(i.exports,i,i.exports,n),i.exports}n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),(()=>{"use strict";const t=n(349),e=n(361);self.onmessage=n=>{switch(n.data.type){case"init-wasm":(0,e.initializeWebAssembly)(n.data.in).then((()=>postMessage({type:"init-wasm"})),(t=>postMessage({type:"init-wasm",err:t})));break;case"init-ort":try{const{numThreads:e,loggingLevel:r}=n.data.in;(0,t.initOrt)(e,r),postMessage({type:"init-ort"})}catch(t){postMessage({type:"init-ort",err:t})}break;case"create_allocate":try{const{model:e}=n.data.in,r=(0,t.createSessionAllocate)(e);postMessage({type:"create_allocate",out:r})}catch(t){postMessage({type:"create_allocate",err:t})}break;case"create_finalize":try{const{modeldata:e,options:r}=n.data.in,a=(0,t.createSessionFinalize)(e,r);postMessage({type:"create_finalize",out:a})}catch(t){postMessage({type:"create_finalize",err:t})}break;case"create":try{const{model:e,options:r}=n.data.in,a=(0,t.createSession)(e,r);postMessage({type:"create",out:a})}catch(t){postMessage({type:"create",err:t})}break;case"release":try{const e=n.data.in;(0,t.releaseSession)(e),postMessage({type:"release"})}catch(t){postMessage({type:"release",err:t})}break;case"run":try{const{sessionId:e,inputIndices:r,inputs:a,outputIndices:i,options:o}=n.data.in,u=(0,t.run)(e,r,a,i,o);postMessage({type:"run",out:u},(0,t.extractTransferableBuffers)(u))}catch(t){postMessage({type:"run",err:t})}break;case"end-profiling":try{const e=n.data.in;(0,t.endProfiling)(e),postMessage({type:"end-profiling"})}catch(t){postMessage({type:"end-profiling",err:t})}}}})()})();\n',"Worker",void 0,void 0)}},477:e=>{e.exports=function(e,t,n,r){var o=self||window;try{try{var a;try{a=new o.Blob([e])}catch(u){(a=new(o.BlobBuilder||o.WebKitBlobBuilder||o.MozBlobBuilder||o.MSBlobBuilder)).append(e),a=a.getBlob()}var i=o.URL||o.webkitURL,s=i.createObjectURL(a),l=new o[t](s,n);return i.revokeObjectURL(s),l}catch(c){return new o[t]("data:application/javascript,".concat(encodeURIComponent(e)),n)}}catch(d){if(!r)throw Error("Inline worker is not supported");return new o[t](r,n)}}},4154:e=>{e.exports='"use strict";var e={},t="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node;if(t){var r=require("worker_threads"),a=r.parentPort;a.on("message",(e=>onmessage({data:e})));var o=require("fs");Object.assign(global,{self:global,require:require,Module:e,location:{href:__filename},Worker:r.Worker,importScripts:function(e){(0,eval)(o.readFileSync(e,"utf8"))},postMessage:function(e){a.postMessage(e)},performance:global.performance||{now:function(){return Date.now()}}})}var s=!1,n=[],i=function(){var e=Array.prototype.slice.call(arguments).join(" ");t?o.writeSync(2,e+"\\n"):console.error(e)};self.alert=function(){var t=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:t,threadId:e._pthread_self()})},e.instantiateWasm=(t,r)=>{var a=new WebAssembly.Instance(e.wasmModule,t);return r(a),e.wasmModule=null,a.exports},self.onunhandledrejection=e=>{throw e.reason??e},self.onmessage=t=>{try{if("load"===t.data.cmd){if(e.wasmModule=t.data.wasmModule,e.wasmMemory=t.data.wasmMemory,e.buffer=e.wasmMemory.buffer,e.ENVIRONMENT_IS_PTHREAD=!0,"string"==typeof t.data.urlOrBlob)importScripts(t.data.urlOrBlob);else{var r=URL.createObjectURL(t.data.urlOrBlob);importScripts(r),URL.revokeObjectURL(r)}ortWasmThreaded(e).then((function(t){e=t}))}else if("run"===t.data.cmd){e.__performance_now_clock_drift=performance.now()-t.data.time,e.__emscripten_thread_init(t.data.pthread_ptr,0,0,1),e.establishStackSpace(),e.PThread.receiveObjectTransfer(t.data),e.PThread.threadInitTLS(),s||(n.forEach((t=>{e.executeNotifiedProxyingQueue(t)})),n=[],s=!0);try{e.invokeEntryPoint(t.data.start_routine,t.data.arg)}catch(t){if("unwind"!=t){if(!(t instanceof e.ExitStatus))throw t;e.keepRuntimeAlive()||e.__emscripten_thread_exit(t.status)}}}else"cancel"===t.data.cmd?e._pthread_self()&&e.__emscripten_thread_exit(-1):"setimmediate"===t.data.target||("processProxyingQueue"===t.data.cmd?s?e.executeNotifiedProxyingQueue(t.data.queue):n.push(t.data.queue):(i("worker.js received unknown command "+t.data.cmd),i(t.data)))}catch(t){throw i("worker.js onmessage() captured an uncaught exception: "+t),t&&t.stack&&i(t.stack),e.__emscripten_thread_crashed&&e.__emscripten_thread_crashed(),t}};\n'},1670:e=>{e.exports=__WEBPACK_EXTERNAL_MODULE__1670__},7067:()=>{},1296:()=>{},1384:()=>{},3993:()=>{},908:()=>{},6953:()=>{},9925:()=>{},2806:()=>{},6449:()=>{},2850:()=>{},5381:()=>{},5686:(e,t,n)=>{n.r(t),n.d(t,{flatbuffers:()=>r});var r={};r.Offset,r.Table,r.SIZEOF_SHORT=2,r.SIZEOF_INT=4,r.FILE_IDENTIFIER_LENGTH=4,r.SIZE_PREFIX_LENGTH=4,r.Encoding={UTF8_BYTES:1,UTF16_STRING:2},r.int32=new Int32Array(2),r.float32=new Float32Array(r.int32.buffer),r.float64=new Float64Array(r.int32.buffer),r.isLittleEndian=1===new Uint16Array(new Uint8Array([1,0]).buffer)[0],r.Long=function(e,t){this.low=0|e,this.high=0|t},r.Long.create=function(e,t){return 0==e&&0==t?r.Long.ZERO:new r.Long(e,t)},r.Long.prototype.toFloat64=function(){return(this.low>>>0)+4294967296*this.high},r.Long.prototype.equals=function(e){return this.low==e.low&&this.high==e.high},r.Long.ZERO=new r.Long(0,0),r.Builder=function(e){if(e)t=e;else var t=1024;this.bb=r.ByteBuffer.allocate(t),this.space=t,this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1},r.Builder.prototype.clear=function(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1},r.Builder.prototype.forceDefaults=function(e){this.force_defaults=e},r.Builder.prototype.dataBuffer=function(){return this.bb},r.Builder.prototype.asUint8Array=function(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())},r.Builder.prototype.prep=function(e,t){e>this.minalign&&(this.minalign=e);for(var n=1+~(this.bb.capacity()-this.space+t)&e-1;this.space<n+e+t;){var o=this.bb.capacity();this.bb=r.Builder.growByteBuffer(this.bb),this.space+=this.bb.capacity()-o}this.pad(n)},r.Builder.prototype.pad=function(e){for(var t=0;t<e;t++)this.bb.writeInt8(--this.space,0)},r.Builder.prototype.writeInt8=function(e){this.bb.writeInt8(this.space-=1,e)},r.Builder.prototype.writeInt16=function(e){this.bb.writeInt16(this.space-=2,e)},r.Builder.prototype.writeInt32=function(e){this.bb.writeInt32(this.space-=4,e)},r.Builder.prototype.writeInt64=function(e){this.bb.writeInt64(this.space-=8,e)},r.Builder.prototype.writeFloat32=function(e){this.bb.writeFloat32(this.space-=4,e)},r.Builder.prototype.writeFloat64=function(e){this.bb.writeFloat64(this.space-=8,e)},r.Builder.prototype.addInt8=function(e){this.prep(1,0),this.writeInt8(e)},r.Builder.prototype.addInt16=function(e){this.prep(2,0),this.writeInt16(e)},r.Builder.prototype.addInt32=function(e){this.prep(4,0),this.writeInt32(e)},r.Builder.prototype.addInt64=function(e){this.prep(8,0),this.writeInt64(e)},r.Builder.prototype.addFloat32=function(e){this.prep(4,0),this.writeFloat32(e)},r.Builder.prototype.addFloat64=function(e){this.prep(8,0),this.writeFloat64(e)},r.Builder.prototype.addFieldInt8=function(e,t,n){(this.force_defaults||t!=n)&&(this.addInt8(t),this.slot(e))},r.Builder.prototype.addFieldInt16=function(e,t,n){(this.force_defaults||t!=n)&&(this.addInt16(t),this.slot(e))},r.Builder.prototype.addFieldInt32=function(e,t,n){(this.force_defaults||t!=n)&&(this.addInt32(t),this.slot(e))},r.Builder.prototype.addFieldInt64=function(e,t,n){!this.force_defaults&&t.equals(n)||(this.addInt64(t),this.slot(e))},r.Builder.prototype.addFieldFloat32=function(e,t,n){(this.force_defaults||t!=n)&&(this.addFloat32(t),this.slot(e))},r.Builder.prototype.addFieldFloat64=function(e,t,n){(this.force_defaults||t!=n)&&(this.addFloat64(t),this.slot(e))},r.Builder.prototype.addFieldOffset=function(e,t,n){(this.force_defaults||t!=n)&&(this.addOffset(t),this.slot(e))},r.Builder.prototype.addFieldStruct=function(e,t,n){t!=n&&(this.nested(t),this.slot(e))},r.Builder.prototype.nested=function(e){if(e!=this.offset())throw new Error("FlatBuffers: struct must be serialized inline.")},r.Builder.prototype.notNested=function(){if(this.isNested)throw new Error("FlatBuffers: object serialization must not be nested.")},r.Builder.prototype.slot=function(e){this.vtable[e]=this.offset()},r.Builder.prototype.offset=function(){return this.bb.capacity()-this.space},r.Builder.growByteBuffer=function(e){var t=e.capacity();if(3221225472&t)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");var n=t<<1,o=r.ByteBuffer.allocate(n);return o.setPosition(n-t),o.bytes().set(e.bytes(),n-t),o},r.Builder.prototype.addOffset=function(e){this.prep(r.SIZEOF_INT,0),this.writeInt32(this.offset()-e+r.SIZEOF_INT)},r.Builder.prototype.startObject=function(e){this.notNested(),null==this.vtable&&(this.vtable=[]),this.vtable_in_use=e;for(var t=0;t<e;t++)this.vtable[t]=0;this.isNested=!0,this.object_start=this.offset()},r.Builder.prototype.endObject=function(){if(null==this.vtable||!this.isNested)throw new Error("FlatBuffers: endObject called without startObject");this.addInt32(0);for(var e=this.offset(),t=this.vtable_in_use-1;t>=0&&0==this.vtable[t];t--);for(var n=t+1;t>=0;t--)this.addInt16(0!=this.vtable[t]?e-this.vtable[t]:0);this.addInt16(e-this.object_start);var o=(n+2)*r.SIZEOF_SHORT;this.addInt16(o);var a=0,i=this.space;e:for(t=0;t<this.vtables.length;t++){var s=this.bb.capacity()-this.vtables[t];if(o==this.bb.readInt16(s)){for(var l=r.SIZEOF_SHORT;l<o;l+=r.SIZEOF_SHORT)if(this.bb.readInt16(i+l)!=this.bb.readInt16(s+l))continue e;a=this.vtables[t];break}}return a?(this.space=this.bb.capacity()-e,this.bb.writeInt32(this.space,a-e)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-e,this.offset()-e)),this.isNested=!1,e},r.Builder.prototype.finish=function(e,t,n){var o=n?r.SIZE_PREFIX_LENGTH:0;if(t){var a=t;if(this.prep(this.minalign,r.SIZEOF_INT+r.FILE_IDENTIFIER_LENGTH+o),a.length!=r.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+r.FILE_IDENTIFIER_LENGTH);for(var i=r.FILE_IDENTIFIER_LENGTH-1;i>=0;i--)this.writeInt8(a.charCodeAt(i))}this.prep(this.minalign,r.SIZEOF_INT+o),this.addOffset(e),o&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)},r.Builder.prototype.finishSizePrefixed=function(e,t){this.finish(e,t,!0)},r.Builder.prototype.requiredField=function(e,t){var n=this.bb.capacity()-e,r=n-this.bb.readInt32(n);if(0==this.bb.readInt16(r+t))throw new Error("FlatBuffers: field "+t+" must be set")},r.Builder.prototype.startVector=function(e,t,n){this.notNested(),this.vector_num_elems=t,this.prep(r.SIZEOF_INT,e*t),this.prep(n,e*t)},r.Builder.prototype.endVector=function(){return this.writeInt32(this.vector_num_elems),this.offset()},r.Builder.prototype.createString=function(e){if(e instanceof Uint8Array)var t=e;else{t=[];for(var n=0;n<e.length;){var r,o=e.charCodeAt(n++);(r=o<55296||o>=56320?o:(o<<10)+e.charCodeAt(n++)+-56613888)<128?t.push(r):(r<2048?t.push(r>>6&31|192):(r<65536?t.push(r>>12&15|224):t.push(r>>18&7|240,r>>12&63|128),t.push(r>>6&63|128)),t.push(63&r|128))}}this.addInt8(0),this.startVector(1,t.length,1),this.bb.setPosition(this.space-=t.length),n=0;for(var a=this.space,i=this.bb.bytes();n<t.length;n++)i[a++]=t[n];return this.endVector()},r.Builder.prototype.createLong=function(e,t){return r.Long.create(e,t)},r.ByteBuffer=function(e){this.bytes_=e,this.position_=0},r.ByteBuffer.allocate=function(e){return new r.ByteBuffer(new Uint8Array(e))},r.ByteBuffer.prototype.clear=function(){this.position_=0},r.ByteBuffer.prototype.bytes=function(){return this.bytes_},r.ByteBuffer.prototype.position=function(){return this.position_},r.ByteBuffer.prototype.setPosition=function(e){this.position_=e},r.ByteBuffer.prototype.capacity=function(){return this.bytes_.length},r.ByteBuffer.prototype.readInt8=function(e){return this.readUint8(e)<<24>>24},r.ByteBuffer.prototype.readUint8=function(e){return this.bytes_[e]},r.ByteBuffer.prototype.readInt16=function(e){return this.readUint16(e)<<16>>16},r.ByteBuffer.prototype.readUint16=function(e){return this.bytes_[e]|this.bytes_[e+1]<<8},r.ByteBuffer.prototype.readInt32=function(e){return this.bytes_[e]|this.bytes_[e+1]<<8|this.bytes_[e+2]<<16|this.bytes_[e+3]<<24},r.ByteBuffer.prototype.readUint32=function(e){return this.readInt32(e)>>>0},r.ByteBuffer.prototype.readInt64=function(e){return new r.Long(this.readInt32(e),this.readInt32(e+4))},r.ByteBuffer.prototype.readUint64=function(e){return new r.Long(this.readUint32(e),this.readUint32(e+4))},r.ByteBuffer.prototype.readFloat32=function(e){return r.int32[0]=this.readInt32(e),r.float32[0]},r.ByteBuffer.prototype.readFloat64=function(e){return r.int32[r.isLittleEndian?0:1]=this.readInt32(e),r.int32[r.isLittleEndian?1:0]=this.readInt32(e+4),r.float64[0]},r.ByteBuffer.prototype.writeInt8=function(e,t){this.bytes_[e]=t},r.ByteBuffer.prototype.writeUint8=function(e,t){this.bytes_[e]=t},r.ByteBuffer.prototype.writeInt16=function(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8},r.ByteBuffer.prototype.writeUint16=function(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8},r.ByteBuffer.prototype.writeInt32=function(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24},r.ByteBuffer.prototype.writeUint32=function(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24},r.ByteBuffer.prototype.writeInt64=function(e,t){this.writeInt32(e,t.low),this.writeInt32(e+4,t.high)},r.ByteBuffer.prototype.writeUint64=function(e,t){this.writeUint32(e,t.low),this.writeUint32(e+4,t.high)},r.ByteBuffer.prototype.writeFloat32=function(e,t){r.float32[0]=t,this.writeInt32(e,r.int32[0])},r.ByteBuffer.prototype.writeFloat64=function(e,t){r.float64[0]=t,this.writeInt32(e,r.int32[r.isLittleEndian?0:1]),this.writeInt32(e+4,r.int32[r.isLittleEndian?1:0])},r.ByteBuffer.prototype.getBufferIdentifier=function(){if(this.bytes_.length<this.position_+r.SIZEOF_INT+r.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");for(var e="",t=0;t<r.FILE_IDENTIFIER_LENGTH;t++)e+=String.fromCharCode(this.readInt8(this.position_+r.SIZEOF_INT+t));return e},r.ByteBuffer.prototype.__offset=function(e,t){var n=e-this.readInt32(e);return t<this.readInt16(n)?this.readInt16(n+t):0},r.ByteBuffer.prototype.__union=function(e,t){return e.bb_pos=t+this.readInt32(t),e.bb=this,e},r.ByteBuffer.prototype.__string=function(e,t){e+=this.readInt32(e);var n=this.readInt32(e),o="",a=0;if(e+=r.SIZEOF_INT,t===r.Encoding.UTF8_BYTES)return this.bytes_.subarray(e,e+n);for(;a<n;){var i,s=this.readUint8(e+a++);if(s<192)i=s;else{var l=this.readUint8(e+a++);if(s<224)i=(31&s)<<6|63&l;else{var u=this.readUint8(e+a++);i=s<240?(15&s)<<12|(63&l)<<6|63&u:(7&s)<<18|(63&l)<<12|(63&u)<<6|63&this.readUint8(e+a++)}}i<65536?o+=String.fromCharCode(i):(i-=65536,o+=String.fromCharCode(55296+(i>>10),56320+(1023&i)))}return o},r.ByteBuffer.prototype.__indirect=function(e){return e+this.readInt32(e)},r.ByteBuffer.prototype.__vector=function(e){return e+this.readInt32(e)+r.SIZEOF_INT},r.ByteBuffer.prototype.__vector_len=function(e){return this.readInt32(e+this.readInt32(e))},r.ByteBuffer.prototype.__has_identifier=function(e){if(e.length!=r.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+r.FILE_IDENTIFIER_LENGTH);for(var t=0;t<r.FILE_IDENTIFIER_LENGTH;t++)if(e.charCodeAt(t)!=this.readInt8(this.position_+r.SIZEOF_INT+t))return!1;return!0},r.ByteBuffer.prototype.createLong=function(e,t){return r.Long.create(e,t)}}},__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]={exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.exports}__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})};var __webpack_exports__=__webpack_require__(6018);return __webpack_exports__})(),module.exports=e(require$$0)})(ortWeb_min);var ortWeb_minExports=ortWeb_min.exports,assetPath={};Object.defineProperty(assetPath,"__esModule",{value:!0}),assetPath.baseAssetPath=void 0;const isWeb="undefined"!=typeof window&&void 0!==window.document,currentScript=isWeb?window.document.currentScript:null;let basePath="/";currentScript&&(basePath=currentScript.src.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")),assetPath.baseAssetPath=basePath;var defaultModelFetcher$1={};Object.defineProperty(defaultModelFetcher$1,"__esModule",{value:!0}),defaultModelFetcher$1.defaultModelFetcher=void 0;const defaultModelFetcher=e=>fetch(e).then(e=>e.arrayBuffer());defaultModelFetcher$1.defaultModelFetcher=defaultModelFetcher;var frameProcessor={},logging={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.log=e.LOG_PREFIX=void 0,e.LOG_PREFIX="[VAD]";const t=["error","debug","warn"].reduce((t,n)=>(t[n]=function(t){return(...n)=>{console[t](e.LOG_PREFIX,...n)}}(n),t),{});e.log=t}(logging);var messages={},Message,Message2;Object.defineProperty(messages,"__esModule",{value:!0}),messages.Message=void 0,Message2=Message||(messages.Message=Message={}),Message2.AudioFrame="AUDIO_FRAME",Message2.SpeechStart="SPEECH_START",Message2.VADMisfire="VAD_MISFIRE",Message2.SpeechEnd="SPEECH_END",Message2.SpeechStop="SPEECH_STOP",Object.defineProperty(frameProcessor,"__esModule",{value:!0}),frameProcessor.FrameProcessor=frameProcessor.validateOptions=frameProcessor.defaultV5FrameProcessorOptions=frameProcessor.defaultLegacyFrameProcessorOptions=void 0;const logging_1$3=logging,messages_1=messages,RECOMMENDED_FRAME_SAMPLES=[512,1024,1536];function validateOptions(e){RECOMMENDED_FRAME_SAMPLES.includes(e.frameSamples)||logging_1$3.log.warn("You are using an unusual frame size"),(e.positiveSpeechThreshold<0||e.positiveSpeechThreshold>1)&&logging_1$3.log.error("positiveSpeechThreshold should be a number between 0 and 1"),(e.negativeSpeechThreshold<0||e.negativeSpeechThreshold>e.positiveSpeechThreshold)&&logging_1$3.log.error("negativeSpeechThreshold should be between 0 and positiveSpeechThreshold"),e.preSpeechPadFrames<0&&logging_1$3.log.error("preSpeechPadFrames should be positive"),e.redemptionFrames<0&&logging_1$3.log.error("redemptionFrames should be positive")}frameProcessor.defaultLegacyFrameProcessorOptions={positiveSpeechThreshold:.5,negativeSpeechThreshold:.35,preSpeechPadFrames:1,redemptionFrames:8,frameSamples:1536,minSpeechFrames:3,submitUserSpeechOnPause:!1},frameProcessor.defaultV5FrameProcessorOptions={positiveSpeechThreshold:.5,negativeSpeechThreshold:.35,preSpeechPadFrames:3,redemptionFrames:24,frameSamples:512,minSpeechFrames:9,submitUserSpeechOnPause:!1},frameProcessor.validateOptions=validateOptions;const concatArrays=e=>{const t=e.reduce((e,t)=>(e.push(e.at(-1)+t.length),e),[0]),n=new Float32Array(t.at(-1));return e.forEach((e,r)=>{const o=t[r];n.set(e,o)}),n};class FrameProcessor{constructor(e,t,n){this.modelProcessFunc=e,this.modelResetFunc=t,this.options=n,this.speaking=!1,this.redemptionCounter=0,this.active=!1,this.reset=()=>{this.speaking=!1,this.audioBuffer=[],this.modelResetFunc(),this.redemptionCounter=0},this.pause=()=>(this.active=!1,this.options.submitUserSpeechOnPause?this.endSegment():(this.reset(),{})),this.resume=()=>{this.active=!0},this.endSegment=()=>{const e=this.audioBuffer;this.audioBuffer=[];const t=this.speaking;this.reset();const n=e.reduce((e,t)=>e+ +t.isSpeech,0);if(t){if(n>=this.options.minSpeechFrames){const t=concatArrays(e.map(e=>e.frame));return{msg:messages_1.Message.SpeechEnd,audio:t}}return{msg:messages_1.Message.VADMisfire}}return{}},this.process=async e=>{if(!this.active)return{};const t=await this.modelProcessFunc(e);if(this.audioBuffer.push({frame:e,isSpeech:t.isSpeech>=this.options.positiveSpeechThreshold}),t.isSpeech>=this.options.positiveSpeechThreshold&&this.redemptionCounter&&(this.redemptionCounter=0),t.isSpeech>=this.options.positiveSpeechThreshold&&!this.speaking)return this.speaking=!0,{probs:t,msg:messages_1.Message.SpeechStart,frame:e};if(t.isSpeech<this.options.negativeSpeechThreshold&&this.speaking&&++this.redemptionCounter>=this.options.redemptionFrames){this.redemptionCounter=0,this.speaking=!1;const n=this.audioBuffer;this.audioBuffer=[];if(n.reduce((e,t)=>e+ +t.isSpeech,0)>=this.options.minSpeechFrames){const r=concatArrays(n.map(e=>e.frame));return{probs:t,msg:messages_1.Message.SpeechEnd,audio:r,frame:e}}return{probs:t,msg:messages_1.Message.VADMisfire,frame:e}}if(!this.speaking)for(;this.audioBuffer.length>this.options.preSpeechPadFrames;)this.audioBuffer.shift();return{probs:t,frame:e}},this.audioBuffer=[],this.reset()}}frameProcessor.FrameProcessor=FrameProcessor;var nonRealTimeVad={},models={},common={};Object.defineProperty(common,"__esModule",{value:!0});var legacy={},_a$1;Object.defineProperty(legacy,"__esModule",{value:!0}),legacy.SileroLegacy=void 0;const logging_1$2=logging;class SileroLegacy{constructor(e,t,n,r,o){this.ortInstance=e,this._session=t,this._h=n,this._c=r,this._sr=o,this.reset_state=()=>{const e=Array(128).fill(0);this._h=new this.ortInstance.Tensor("float32",e,[2,1,64]),this._c=new this.ortInstance.Tensor("float32",e,[2,1,64])},this.process=async e=>{var t;const n={input:new this.ortInstance.Tensor("float32",e,[1,e.length]),h:this._h,c:this._c,sr:this._sr},r=await this._session.run(n);this._h=r.hn,this._c=r.cn;const[o]=null==(t=r.output)?void 0:t.data;return{notSpeech:1-o,isSpeech:o}}}}legacy.SileroLegacy=SileroLegacy,_a$1=SileroLegacy,SileroLegacy.new=async(e,t)=>{logging_1$2.log.debug("initializing vad");const n=await t(),r=await e.InferenceSession.create(n),o=new e.Tensor("int64",[16000n]),a=Array(128).fill(0),i=new e.Tensor("float32",a,[2,1,64]),s=new e.Tensor("float32",a,[2,1,64]);logging_1$2.log.debug("vad is initialized");return new _a$1(e,r,i,s,o)};var v5={},_a;Object.defineProperty(v5,"__esModule",{value:!0}),v5.SileroV5=void 0;const logging_1$1=logging;function getNewState(e){const t=Array(256).fill(0);return new e.Tensor("float32",t,[2,1,128])}class SileroV5{constructor(e,t,n,r){this._session=e,this._state=t,this._sr=n,this.ortInstance=r,this.reset_state=()=>{this._state=getNewState(this.ortInstance)},this.process=async e=>{var t;const n={input:new this.ortInstance.Tensor("float32",e,[1,e.length]),state:this._state,sr:this._sr},r=await this._session.run(n);this._state=r.stateN;const[o]=null==(t=r.output)?void 0:t.data;return{notSpeech:1-o,isSpeech:o}}}}v5.SileroV5=SileroV5,_a=SileroV5,SileroV5.new=async(e,t)=>{logging_1$1.log.debug("Loading VAD...");const n=await t(),r=await e.InferenceSession.create(n),o=new e.Tensor("int64",[16000n]),a=getNewState(e);return logging_1$1.log.debug("...finished loading VAD"),new _a(r,a,o,e)},function(e){var t=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=commonjsGlobal&&commonjsGlobal.__exportStar||function(e,n){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.SileroV5=e.SileroLegacy=void 0,n(common,e);var r=legacy;Object.defineProperty(e,"SileroLegacy",{enumerable:!0,get:function(){return r.SileroLegacy}});var o=v5;Object.defineProperty(e,"SileroV5",{enumerable:!0,get:function(){return o.SileroV5}})}(models);var resampler={};Object.defineProperty(resampler,"__esModule",{value:!0}),resampler.Resampler=void 0;const logging_1=logging;class Resampler{constructor(e){this.options=e,this.process=e=>{const t=[];for(const n of e)for(this.inputBuffer.push(n);this.hasEnoughDataForFrame();){const e=this.generateOutputFrame();t.push(e)}return t},this.stream=async function*(e){for(const t of e)for(this.inputBuffer.push(t);this.hasEnoughDataForFrame();){const e=this.generateOutputFrame();yield e}},e.nativeSampleRate<16e3&&logging_1.log.error("nativeSampleRate is too low. Should have 16000 = targetSampleRate <= nativeSampleRate"),this.inputBuffer=[]}hasEnoughDataForFrame(){return this.inputBuffer.length*this.options.targetSampleRate/this.options.nativeSampleRate>=this.options.targetFrameSize}generateOutputFrame(){const e=new Float32Array(this.options.targetFrameSize);let t=0,n=0;for(;t<this.options.targetFrameSize;){let r=0,o=0;for(;n<Math.min(this.inputBuffer.length,(t+1)*this.options.nativeSampleRate/this.options.targetSampleRate);){const e=this.inputBuffer[n];void 0!==e&&(r+=e,o++),n++}e[t]=r/o,t++}return this.inputBuffer=this.inputBuffer.slice(n),e}}resampler.Resampler=Resampler,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.PlatformAgnosticNonRealTimeVAD=e.defaultNonRealTimeVADOptions=void 0;const t=frameProcessor,n=messages,r=models,o=resampler;e.defaultNonRealTimeVADOptions={...t.defaultLegacyFrameProcessorOptions,ortConfig:void 0};e.PlatformAgnosticNonRealTimeVAD=class{static async _new(t,n,r={}){const o={...e.defaultNonRealTimeVADOptions,...r};void 0!==o.ortConfig&&o.ortConfig(n);const a=new this(t,n,o);return await a.init(),a}constructor(e,a,i){this.modelFetcher=e,this.ort=a,this.options=i,this.init=async()=>{const e=await r.SileroLegacy.new(this.ort,this.modelFetcher);this.frameProcessor=new t.FrameProcessor(e.process,e.reset_state,{frameSamples:this.options.frameSamples,positiveSpeechThreshold:this.options.positiveSpeechThreshold,negativeSpeechThreshold:this.options.negativeSpeechThreshold,redemptionFrames:this.options.redemptionFrames,preSpeechPadFrames:this.options.preSpeechPadFrames,minSpeechFrames:this.options.minSpeechFrames,submitUserSpeechOnPause:this.options.submitUserSpeechOnPause}),this.frameProcessor.resume()},this.run=async function*(e,t){const r={nativeSampleRate:t,targetSampleRate:16e3,targetFrameSize:this.options.frameSamples},a=new o.Resampler(r);let i=0,s=0,l=0;for await(const o of a.stream(e)){const{msg:e,audio:t}=await this.frameProcessor.process(o);switch(e){case n.Message.SpeechStart:i=l*this.options.frameSamples/16;break;case n.Message.SpeechEnd:s=(l+1)*this.options.frameSamples/16,yield{audio:t,start:i,end:s}}l++}const{msg:u,audio:c}=this.frameProcessor.endSegment();u==n.Message.SpeechEnd&&(yield{audio:c,start:i,end:l*this.options.frameSamples/16})},(0,t.validateOptions)(i)}}}(nonRealTimeVad);var utils={};function minFramesForTargetMS(e,t,n=16e3){return Math.ceil(e*n/1e3/t)}function arrayBufferToBase64(e){const t=new Uint8Array(e),n=t.byteLength,r=new Array(n);for(var o=0;o<n;o++){const e=t[o];if(void 0===e)break;r[o]=String.fromCharCode(e)}return btoa(r.join(""))}function encodeWAV(e,t=3,n=16e3,r=1,o=32){var a=o/8,i=r*a,s=new ArrayBuffer(44+e.length*a),l=new DataView(s);return writeString(l,0,"RIFF"),l.setUint32(4,36+e.length*a,!0),writeString(l,8,"WAVE"),writeString(l,12,"fmt "),l.setUint32(16,16,!0),l.setUint16(20,t,!0),l.setUint16(22,r,!0),l.setUint32(24,n,!0),l.setUint32(28,n*i,!0),l.setUint16(32,i,!0),l.setUint16(34,o,!0),writeString(l,36,"data"),l.setUint32(40,e.length*a,!0),1===t?floatTo16BitPCM(l,44,e):writeFloat32(l,44,e),s}function writeFloat32(e,t,n){for(var r=0;r<n.length;r++,t+=4)e.setFloat32(t,n[r],!0)}function floatTo16BitPCM(e,t,n){for(var r=0;r<n.length;r++,t+=2){var o=Math.max(-1,Math.min(1,n[r]));e.setInt16(t,o<0?32768*o:32767*o,!0)}}function writeString(e,t,n){for(var r=0;r<n.length;r++)e.setUint8(t+r,n.charCodeAt(r))}async function audioFileToArray(e){const t=new OfflineAudioContext(1,1,44100),n=new FileReader;let r=null;if(await new Promise(o=>{n.addEventListener("loadend",e=>{const a=n.result;t.decodeAudioData(a,e=>{r=e,t.startRendering().then(e=>{console.log("Rendering completed successfully"),o()}).catch(e=>{console.error(`Rendering failed: ${e}`)})},e=>{console.log(`Error with decoding audio data: ${e}`)})}),n.readAsArrayBuffer(e)}),null===r)throw Error("some shit");let o=r,a=new Float32Array(o.length);for(let i=0;i<o.length;i++)for(let e=0;e<o.numberOfChannels;e++)a[i]+=o.getChannelData(e)[i];return{audio:a,sampleRate:o.sampleRate}}Object.defineProperty(utils,"__esModule",{value:!0}),utils.audioFileToArray=utils.encodeWAV=utils.arrayBufferToBase64=utils.minFramesForTargetMS=void 0,utils.minFramesForTargetMS=minFramesForTargetMS,utils.arrayBufferToBase64=arrayBufferToBase64,utils.encodeWAV=encodeWAV,utils.audioFileToArray=audioFileToArray;var realTimeVad={};!function(e){var t=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=commonjsGlobal&&commonjsGlobal.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=commonjsGlobal&&commonjsGlobal.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var o in e)"default"!==o&&Object.prototype.hasOwnProperty.call(e,o)&&t(r,e,o);return n(r,e),r};Object.defineProperty(e,"__esModule",{value:!0}),e.AudioNodeVAD=e.MicVAD=e.getDefaultRealTimeVADOptions=e.ort=e.DEFAULT_MODEL=void 0;const o=r(ortWeb_minExports),a=defaultModelFetcher$1,i=frameProcessor,s=logging,l=messages,u=models,c=resampler;e.DEFAULT_MODEL="legacy",e.ort=o;e.getDefaultRealTimeVADOptions=t=>({..."v5"===t?i.defaultV5FrameProcessorOptions:i.defaultLegacyFrameProcessorOptions,onFrameProcessed:e=>{},onVADMisfire:()=>{s.log.debug("VAD misfire")},onSpeechStart:()=>{s.log.debug("Detected speech start")},onSpeechEnd:()=>{s.log.debug("Detected speech end")},baseAssetPath:"https://cdn.jsdelivr.net/npm/@ricky0123/vad-web@0.0.22/dist/",onnxWASMBasePath:"https://cdn.jsdelivr.net/npm/onnxruntime-web@1.14.0/dist/",stream:void 0,ortConfig:void 0,model:e.DEFAULT_MODEL,workletOptions:{}});class d{static async new(t={}){const n={...(0,e.getDefaultRealTimeVADOptions)(t.model??e.DEFAULT_MODEL),...t};let r;(0,i.validateOptions)(n),r=void 0===n.stream?await navigator.mediaDevices.getUserMedia({audio:{...n.additionalAudioConstraints,channelCount:1,echoCancellation:!0,autoGainControl:!0,noiseSuppression:!0}}):n.stream;const o=new AudioContext,a=new MediaStreamAudioSourceNode(o,{mediaStream:r}),s=await f.new(o,n);return s.receive(a),new d(n,o,r,s,a)}constructor(e,t,n,r,o,a=!1){this.options=e,this.audioContext=t,this.stream=n,this.audioNodeVAD=r,this.sourceNode=o,this.listening=a,this.pause=()=>{this.audioNodeVAD.pause(),this.listening=!1},this.start=()=>{this.audioNodeVAD.start(),this.listening=!0},this.destroy=()=>{this.listening&&this.pause(),void 0===this.options.stream&&this.stream.getTracks().forEach(e=>e.stop()),this.sourceNode.disconnect(),this.audioNodeVAD.destroy(),this.audioContext.close()}}}e.MicVAD=d;class f{static async new(t,n={}){const r={...(0,e.getDefaultRealTimeVADOptions)(n.model??e.DEFAULT_MODEL),...n};(0,i.validateOptions)(r),e.ort.env.wasm.wasmPaths=r.onnxWASMBasePath,void 0!==r.ortConfig&&r.ortConfig(e.ort);const o="v5"===r.model?"silero_vad_v5.onnx":"silero_vad_legacy.onnx",s=r.baseAssetPath+o,l="v5"===r.model?u.SileroV5.new:u.SileroLegacy.new;let c;try{c=await l(e.ort,()=>(0,a.defaultModelFetcher)(s))}catch(h){throw console.error(`Encountered an error while loading model file ${s}`),h}const d=new i.FrameProcessor(c.process,c.reset_state,{frameSamples:r.frameSamples,positiveSpeechThreshold:r.positiveSpeechThreshold,negativeSpeechThreshold:r.negativeSpeechThreshold,redemptionFrames:r.redemptionFrames,preSpeechPadFrames:r.preSpeechPadFrames,minSpeechFrames:r.minSpeechFrames,submitUserSpeechOnPause:r.submitUserSpeechOnPause}),p=new f(t,r,d);return await p.setupAudioNode(),p}constructor(e,t,n){this.ctx=e,this.options=t,this.bufferIndex=0,this.pause=()=>{const e=this.frameProcessor.pause();this.handleFrameProcessorEvent(e)},this.start=()=>{this.frameProcessor.resume()},this.receive=e=>{e.connect(this.audioNode)},this.processFrame=async e=>{const t=await this.frameProcessor.process(e);this.handleFrameProcessorEvent(t)},this.handleFrameProcessorEvent=e=>{switch(void 0!==e.probs&&this.options.onFrameProcessed(e.probs,e.frame),e.msg){case l.Message.SpeechStart:this.options.onSpeechStart();break;case l.Message.VADMisfire:this.options.onVADMisfire();break;case l.Message.SpeechEnd:this.options.onSpeechEnd(e.audio)}},this.destroy=()=>{var e;this.audioNode instanceof AudioWorkletNode&&this.audioNode.port.postMessage({message:l.Message.SpeechStop}),this.audioNode.disconnect(),null==(e=this.gainNode)||e.disconnect()},this.frameProcessor=n}async setupAudioNode(){if("audioWorklet"in this.ctx&&"function"==typeof AudioWorkletNode)try{const e=this.options.baseAssetPath+"vad.worklet.bundle.min.js";await this.ctx.audioWorklet.addModule(e);const t=this.options.workletOptions??{};return t.processorOptions={...t.processorOptions??{},frameSamples:this.options.frameSamples},this.audioNode=new AudioWorkletNode(this.ctx,"vad-helper-worklet",t),void(this.audioNode.port.onmessage=async e=>{var t;if((null==(t=e.data)?void 0:t.message)===l.Message.AudioFrame){let t=e.data.data;t instanceof ArrayBuffer||(t=new ArrayBuffer(e.data.data.byteLength),new Uint8Array(t).set(new Uint8Array(e.data.data)));const n=new Float32Array(t);await this.processFrame(n)}})}catch(t){console.log("AudioWorklet setup failed, falling back to ScriptProcessor",t)}this.resampler=new c.Resampler({nativeSampleRate:this.ctx.sampleRate,targetSampleRate:16e3,targetFrameSize:this.options.frameSamples??480});this.audioNode=this.ctx.createScriptProcessor(4096,1,1),this.gainNode=this.ctx.createGain(),this.gainNode.gain.value=0;let e=!1;this.audioNode.onaudioprocess=async t=>{if(!e){e=!0;try{const e=t.inputBuffer.getChannelData(0);if(t.outputBuffer.getChannelData(0).fill(0),this.resampler){const t=this.resampler.process(e);for(const e of t)await this.processFrame(e)}}catch(n){console.error("Error processing audio:",n)}finally{e=!1}}},this.audioNode.connect(this.gainNode),this.gainNode.connect(this.ctx.destination)}}e.AudioNodeVAD=f}(realTimeVad),function(e){var t=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=commonjsGlobal&&commonjsGlobal.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=commonjsGlobal&&commonjsGlobal.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var o in e)"default"!==o&&Object.prototype.hasOwnProperty.call(e,o)&&t(r,e,o);return n(r,e),r};Object.defineProperty(e,"__esModule",{value:!0}),e.NonRealTimeVAD=e.Message=e.FrameProcessor=e.getDefaultRealTimeVADOptions=e.MicVAD=e.DEFAULT_MODEL=e.AudioNodeVAD=e.utils=e.defaultNonRealTimeVADOptions=void 0;const o=r(ortWeb_minExports),a=assetPath,i=defaultModelFetcher$1,s=frameProcessor;Object.defineProperty(e,"FrameProcessor",{enumerable:!0,get:function(){return s.FrameProcessor}});const l=messages;Object.defineProperty(e,"Message",{enumerable:!0,get:function(){return l.Message}});const u=nonRealTimeVad,c=utils;e.defaultNonRealTimeVADOptions={modelURL:a.baseAssetPath+"silero_vad_legacy.onnx",modelFetcher:i.defaultModelFetcher};class d extends u.PlatformAgnosticNonRealTimeVAD{static async new(t={}){const{modelURL:n,modelFetcher:r}={...e.defaultNonRealTimeVADOptions,...t};return await this._new(()=>r(n),o,t)}}e.NonRealTimeVAD=d,e.utils={audioFileToArray:c.audioFileToArray,minFramesForTargetMS:c.minFramesForTargetMS,arrayBufferToBase64:c.arrayBufferToBase64,encodeWAV:c.encodeWAV};var f=realTimeVad;Object.defineProperty(e,"AudioNodeVAD",{enumerable:!0,get:function(){return f.AudioNodeVAD}}),Object.defineProperty(e,"DEFAULT_MODEL",{enumerable:!0,get:function(){return f.DEFAULT_MODEL}}),Object.defineProperty(e,"MicVAD",{enumerable:!0,get:function(){return f.MicVAD}}),Object.defineProperty(e,"getDefaultRealTimeVADOptions",{enumerable:!0,get:function(){return f.getDefaultRealTimeVADOptions}})}(dist);class VadWebClient{constructor(e,t,n,r,o,a){this.micStream=null,this.is_vad_loading=!0,this.noSpeechStartTime=null,this.recording_started=!1,this.lastWarningTime=null,this.warningCooldownPeriod=2e3,this.vad_past=[],this.last_clip_index=0,this.clip_points=[0],this.sil_duration_acc=0,this.pref_length_samples=e*r,this.desp_length_samples=t*r,this.max_length_samples=n*r,this.shor_thsld=SHORT_SILENCE_THRESHOLD*r,this.long_thsld=LONG_SILENCE_THRESHOLD*r,this.frame_size=FRAME_SIZE,this.speech_pad_frames=PRE_SPEECH_PAD_FRAMES,this.micVad={},this.audioFileManager=o,this.audioBufferManager=a}setDependencies(e,t){this.audioFileManager=e,this.audioBufferManager=t}setCallbacks(e,t,n){this.onVadFramesCallback=e,this.onVadFrameProcessedCallback=t,this.onUserSpeechCallback=n}stopMicStream(){var e,t;try{null==(t=null==(e=this.micStream)?void 0:e.getTracks)||t.call(e).forEach(e=>e.stop())}catch{}finally{this.micStream=null}}checkNoSpeech(e){if(!this.recording_started)return;const t=Date.now();if(0===e)if(null===this.noSpeechStartTime)this.noSpeechStartTime=t;else{t-this.noSpeechStartTime>=1e4&&(null===this.lastWarningTime||t-this.lastWarningTime>=this.warningCooldownPeriod)&&(this.onVadFramesCallback&&this.onVadFramesCallback({message:"No audio detected for a while. Please talk or stop the recording if done.",error_code:ErrorCode.AUDIO_QUALITY_POOR,status_code:HttpStatus.BAD_REQUEST}),this.lastWarningTime=t,this.noSpeechStartTime=t)}else this.noSpeechStartTime=null,this.lastWarningTime=null,this.onVadFramesCallback&&this.onVadFramesCallback({message:"Audio captured. Recording continues.",status_code:HttpStatus.OK})}getMicVad(){return this.micVad}isVadLoading(){return this.is_vad_loading}processVadFrame(e){let t=!1;this.vad_past.length>0&&(0===e&&(this.sil_duration_acc+=1),1===e&&(this.sil_duration_acc=0));const n=(this.vad_past.length-this.last_clip_index)*this.frame_size,r=this.sil_duration_acc*this.frame_size;return n>this.pref_length_samples&&r>this.long_thsld&&(this.last_clip_index=this.vad_past.length-Math.min(Math.floor(this.sil_duration_acc/2),5),this.clip_points.push(this.last_clip_index),this.sil_duration_acc=0,t=!0),n>this.desp_length_samples&&r>this.shor_thsld&&(this.last_clip_index=this.vad_past.length-Math.min(Math.floor(this.sil_duration_acc/2),5),this.clip_points.push(this.last_clip_index),this.sil_duration_acc=0,t=!0),n>=this.max_length_samples&&(this.last_clip_index=this.vad_past.length,this.clip_points.push(this.last_clip_index),this.sil_duration_acc=0,t=!0),this.vad_past.push(e),t?[!0,this.clip_points[this.clip_points.length-1]]:[!1,this.clip_points[this.clip_points.length-1]]}async initVad(e){let t;this.is_vad_loading=!0,this.stopMicStream();try{t=await navigator.mediaDevices.getUserMedia({audio:!e||{deviceId:{exact:e}}})}catch(n){if("OverconstrainedError"!==(null==n?void 0:n.name)&&"NotFoundError"!==(null==n?void 0:n.name))throw n;t=await navigator.mediaDevices.getUserMedia({audio:!0})}this.micStream=t;try{const e=await dist.MicVAD.new({stream:t,frameSamples:this.frame_size,preSpeechPadFrames:this.speech_pad_frames,onFrameProcessed:(e,t)=>{var n,r,o;if(this.onVadFrameProcessedCallback&&this.onVadFrameProcessedCallback({probabilities:e,frame:t}),!this.recording_started)return;null==(n=this.audioFileManager)||n.incrementTotalRawSamples(t),null==(r=this.audioBufferManager)||r.append(t);const{isSpeech:a}=e;let i=0;a>=.5&&(i=1),this.checkNoSpeech(i);const s=this.processVadFrame(i),l=s[0];if(console.log("is clip point:",l," at index:",s[1]),l){const e=null==(o=this.audioBufferManager)?void 0:o.getAudioData();console.log("Processing audio chunk at clip point:",e),e&&this.processAudioChunk({audioFrames:e})}},onSpeechStart:()=>{var e;null==(e=this.onUserSpeechCallback)||e.call(this,!0)},onSpeechEnd:()=>{var e;null==(e=this.onUserSpeechCallback)||e.call(this,!1)}});return this.is_vad_loading=!1,this.micVad=e,!this.is_vad_loading}catch(n){throw console.error("Error initializing VAD:",n),this.stopMicStream(),this.is_vad_loading=!1,n}}async reinitializeVad(e){return await this.initVad(e)}async processAudioChunk({audioFrames:e}){if(!e||!this.audioFileManager||!this.audioBufferManager)return;const t=`audio_${this.audioFileManager.audioChunks.length||0}.${OUTPUT_FORMAT}`,n=this.audioFileManager.getRawSampleDetails(),r=this.audioBufferManager.calculateChunkTimestamps(n.totalRawSamples);try{const n={fileName:t,timestamp:{st:r.start,et:r.end},status:"pending",audioFrames:e},o=this.audioFileManager.updateAudioInfo(n);this.audioFileManager.incrementInsertedSamples(this.audioBufferManager.getCurrentSampleLength(),this.audioBufferManager.getCurrentFrameLength()),this.audioBufferManager.resetBufferState(),console.log("Uploading audio chunk:",t," at index:",o-1),await this.audioFileManager.uploadAudio({audioFrames:e,fileName:t,chunkIndex:o-1})}catch(o){console.error("Error uploading audio chunk:",o)}}startVad(){this.micVad&&"function"==typeof this.micVad.start&&this.micVad.start(),this.recording_started=!0}pauseVad(){this.micVad&&"function"==typeof this.micVad.pause&&this.micVad.pause(),this.recording_started=!1}destroyVad(){this.micVad&&"function"==typeof this.micVad.destroy&&this.micVad.destroy(),this.stopMicStream(),this.recording_started=!1}resetVadWebInstance(){this.micVad&&"function"==typeof this.micVad.destroy&&this.micVad.destroy(),this.stopMicStream(),this.vad_past=[],this.last_clip_index=0,this.clip_points=[0],this.sil_duration_acc=0,this.noSpeechStartTime=null,this.lastWarningTime=null,this.recording_started=!1,this.is_vad_loading=!0}configureVadConstants({pref_length:e,desp_length:t,max_length:n,sr:r,frame_size:o,pre_speech_pad_frames:a,short_thsld:i,long_thsld:s}){this.pref_length_samples=e*r,this.desp_length_samples=t*r,this.max_length_samples=n*r,this.shor_thsld=i*r,this.long_thsld=s*r,this.frame_size=o,this.speech_pad_frames=a}}class ChunkedRecorder{constructor(e){this._isPaused=!1,this.eventEmitter=e,this.bufferManager=new AudioBufferManager(SAMPLING_RATE,AUDIO_BUFFER_SIZE_IN_S),this.fileManager=new AudioFileManager,this.vadClient=new VadWebClient(PREF_CHUNK_LENGTH,DESP_CHUNK_LENGTH,MAX_CHUNK_LENGTH,SAMPLING_RATE,this.fileManager,this.bufferManager),this.eventEmitter&&(this.fileManager.setUploadProgressCallback((e,t)=>{}),this.vadClient.setCallbacks(e=>{},e=>{},e=>{}))}initialize(e){if(!e.upload_url)throw new Error("Upload URL is required for chunked recording");this.fileManager.setSessionInfo({sessionId:e.session_id,uploadUrl:e.upload_url})}async start(e){await this.vadClient.initVad(e);const t=this.vadClient.getMicVad();if(this.vadClient.isVadLoading()||!t||0===Object.keys(t).length){if(await this.vadClient.reinitializeVad(e))throw new Error("VAD instance is not initialized.")}this.vadClient.startVad()}pause(){this._isPaused||(this.vadClient.pauseVad(),this._isPaused=!0)}resume(){this._isPaused&&(this.vadClient.startVad(),this._isPaused=!1)}isPaused(){return this._isPaused}async stop(){this._isPaused=!1,this.vadClient.resetVadWebInstance(),await this.fileManager.waitForAllUploads();return{failedUploads:await this.fileManager.retryFailedUploads(),totalFiles:this.fileManager.getTotalAudioChunks().length}}reset(){this._isPaused=!1,this.vadClient.resetVadWebInstance(),this.fileManager.resetFileManagerInstance(),this.bufferManager.resetBufferState()}}class SingleRecorder{constructor(e){this.mediaRecorder=null,this.audioChunks=[],this.uploadUrl="",this.stream=null,this._isPaused=!1,this.eventEmitter=e}initialize(e){if(!e.upload_url)throw new Error("Upload URL is required for single recording");this.uploadUrl=e.upload_url}async start(e){let t;this.audioChunks=[];try{t=await navigator.mediaDevices.getUserMedia({audio:!e||{deviceId:{exact:e}}})}catch(n){if("OverconstrainedError"!==(null==n?void 0:n.name)&&"NotFoundError"!==(null==n?void 0:n.name))throw n;t=await navigator.mediaDevices.getUserMedia({audio:!0})}this.stream=t,this.mediaRecorder=new MediaRecorder(t),this.mediaRecorder.ondataavailable=e=>{e.data.size>0&&this.audioChunks.push(e.data)},this.mediaRecorder.start()}pause(){this.mediaRecorder&&"recording"===this.mediaRecorder.state&&(this.mediaRecorder.pause(),this._isPaused=!0)}resume(){this.mediaRecorder&&"paused"===this.mediaRecorder.state&&(this.mediaRecorder.resume(),this._isPaused=!1)}isPaused(){return this._isPaused}async stop(){return this._isPaused=!1,new Promise(e=>{this.mediaRecorder?(this.mediaRecorder.onstop=async()=>{var t;const n=new Blob(this.audioChunks,{type:"audio/webm"}),r=`recording_${Date.now()}.webm`;(await uploadFileWithFormData(this.uploadUrl,r,n)).success?e({failedUploads:[],totalFiles:1}):e({failedUploads:[r],totalFiles:1}),null==(t=this.stream)||t.getTracks().forEach(e=>e.stop()),this.stream=null,this.mediaRecorder=null},this.mediaRecorder.stop()):e({failedUploads:[],totalFiles:0})})}reset(){var e;this._isPaused=!1,this.mediaRecorder&&"inactive"!==this.mediaRecorder.state&&this.mediaRecorder.stop(),null==(e=this.stream)||e.getTracks().forEach(e=>e.stop()),this.stream=null,this.mediaRecorder=null,this.audioChunks=[]}}class EventEmitter{constructor(){this.listeners=new Map}on(e,t){var n;this.listeners.has(e)||this.listeners.set(e,new Set),null==(n=this.listeners.get(e))||n.add(t)}off(e,t){var n;null==(n=this.listeners.get(e))||n.delete(t)}emit(e){var t;null==(t=this.listeners.get(e.type))||t.forEach(t=>{try{t(e)}catch(n){console.error("Error in event listener:",n)}})}}class ScribeClient{static getInstance(e){return ScribeClient.instance||(ScribeClient.instance=new ScribeClient(e)),ScribeClient.instance}static resetInstance(){ScribeClient.instance&&(ScribeClient.instance.reset().catch(()=>{}),ScribeClient.instance=null)}constructor(e){this.discoveryDocument=null,this.currentSession=null,this.isInitialized=!1,this.recorder=null,this.validateConfig(e),this.config={debug:!1,autoDiscovery:!0,...e},this.httpClient=new HttpClient(this.config.apiKey,this.config.debug),this.discoveryAPI=new DiscoveryAPI(this.httpClient),this.sessionAPI=new SessionAPI(this.httpClient,this.config.baseUrl||""),this.eventEmitter=new EventEmitter}async init(){if(this.isInitialized)this.config.debug&&console.log("[ScribeSDK] Already initialized");else{if(!this.config.baseUrl)throw new ValidationError("baseUrl is required for initialization");if(this.config.autoDiscovery)try{this.discoveryDocument=await this.discoveryAPI.getDiscovery(this.config.baseUrl),this.discoveryDocument.endpoints.base_url&&this.sessionAPI.setBaseUrl(this.discoveryDocument.endpoints.base_url),this.emitEvent({type:"discovery:complete",data:this.discoveryDocument}),this.config.debug&&console.log("[ScribeSDK] Discovery complete:",this.discoveryDocument)}catch(e){throw this.emitEvent({type:"error",error:e instanceof Error?e:new Error("Discovery failed")}),e}else this.sessionAPI.setBaseUrl(this.config.baseUrl);this.isInitialized=!0}}async startRecording(e){this.isInitialized||await this.init();if("granted"!==(await navigator.permissions.query({name:"microphone"})).state)throw new ValidationError("Microphone access is required to start recording.");try{const t={templates:e.templates,model:e.model,language_hint:e.languageHint,transcript_language:e.transcriptLanguage,upload_type:e.uploadType||UploadType.CHUNKED,communication_protocol:e.communicationProtocol||"http",additional_data:e.additionalData};return this.currentSession=await this.sessionAPI.createSession(t),this.emitEvent({type:"session:created",data:this.currentSession}),this.config.debug&&console.log("[ScribeSDK] Session created:",this.currentSession),e.uploadType===UploadType.SINGLE?this.recorder=new SingleRecorder(this.eventEmitter):this.recorder=new ChunkedRecorder(this.eventEmitter),this.recorder.initialize(this.currentSession),await this.recorder.start(e.deviceId),this.currentSession}catch(t){throw this.emitEvent({type:"error",error:t instanceof Error?t:new Error("Failed to start recording")}),t}}pauseRecording(){if(!this.recorder)throw new ValidationError("No active recording to pause");this.recorder.pause(),this.emitEvent({type:"recording:paused"}),this.config.debug&&console.log("[ScribeSDK] Recording paused")}resumeRecording(){if(!this.recorder)throw new ValidationError("No active recording to resume");this.recorder.resume(),this.emitEvent({type:"recording:resumed"}),this.config.debug&&console.log("[ScribeSDK] Recording resumed")}isRecordingPaused(){var e;return(null==(e=this.recorder)?void 0:e.isPaused())??!1}async endRecording(){if(!this.currentSession)throw new ValidationError("No active session to end");try{let e=0;if(this.recorder){const{failedUploads:t,totalFiles:n}=await this.recorder.stop();if(t.length>0)throw console.warn("Some audio files failed to upload:",t),new ScribeError(`Failed to upload audio recordings: ${t.join(", ")}`,"upload_failed");e=n||0,this.recorder=null}const t=await this.sessionAPI.endSession(this.currentSession.session_id,e);return this.emitEvent({type:"session:ended",data:t}),this.config.debug&&console.log("[ScribeSDK] Session ended:",t),t}catch(e){throw this.emitEvent({type:"error",error:e instanceof Error?e:new Error("Failed to end recording")}),e}}async reset(){this.recorder&&(await this.recorder.stop().catch(()=>{}),this.recorder=null),this.currentSession=null,this.discoveryAPI.clearCache(),this.discoveryDocument=null,this.isInitialized=!1}emitEvent(e){this.eventEmitter.emit(e)}async getOutputStatus(e){var t;const n=e||(null==(t=this.currentSession)?void 0:t.session_id);if(!n)throw new ValidationError("No session ID provided and no active session");try{const e=await this.sessionAPI.getSessionStatus(n);return this.emitEvent({type:"session:status_update",data:e}),this.config.debug&&console.log("[ScribeSDK] Session status:",e),e}catch(r){throw this.emitEvent({type:"error",error:r instanceof Error?r:new Error("Failed to get output status")}),r}}async pollForCompletion(e,t={}){var n;const r=e||(null==(n=this.currentSession)?void 0:n.session_id);if(!r)throw new ValidationError("No session ID provided and no active session");return this.sessionAPI.pollSessionStatus(r,{...t,onProgress:e=>{this.emitEvent({type:"session:status_update",data:e}),t.onProgress&&t.onProgress(e)}})}getCurrentSession(){return this.currentSession}getDiscoveryDocument(){return this.discoveryDocument}on(e,t){this.eventEmitter.on(e,t)}off(e,t){this.eventEmitter.off(e,t)}clearSession(){this.currentSession=null}validateConfig(e){if(!e.baseUrl)throw new ValidationError("baseUrl is required for initialization")}}function useScribeSession(e){const[t,n]=reactExports.useState("idle"),[r,o]=reactExports.useState(0),[a,i]=reactExports.useState(null),[s,l]=reactExports.useState(""),u=reactExports.useRef(null),c=reactExports.useRef(null),d=reactExports.useRef(0),f=reactExports.useRef(0),p=reactExports.useCallback((...t)=>{e.debug&&console.log("[EkaScribe]",...t)},[e.debug]);reactExports.useEffect(()=>{if(!e.baseUrl)return void p("Skipping SDK init - no baseUrl provided");return(async()=>{try{u.current=new ScribeClient({apiKey:e.apiKey,baseUrl:e.baseUrl,debug:e.debug}),await u.current.init(),p("SDK initialized")}catch(t){p("Failed to initialize SDK",t)}})(),()=>{c.current&&clearInterval(c.current)}},[e.apiKey,e.baseUrl,e.debug,p]);const h=reactExports.useCallback(()=>{c.current=window.setInterval(()=>{const e=Math.floor((Date.now()-d.current)/1e3);o(e)},1e3)},[]),m=reactExports.useCallback(()=>{c.current&&(clearInterval(c.current),c.current=null)},[]),g=reactExports.useCallback(e=>{l(e),n("error")},[]);return{state:t,elapsedTime:r,result:a,errorMessage:s,startRecording:reactExports.useCallback(async()=>{const t=await(async()=>{try{return(await navigator.permissions.query({name:"microphone"})).state}catch{return"prompt"}})();if("denied"!==t){if("prompt"===t){n("permission");if(!(await(async()=>{try{return(await navigator.mediaDevices.getUserMedia({audio:!0})).getTracks().forEach(e=>e.stop()),!0}catch(e){return p("Microphone permission denied",e),!1}})()))return void g("Microphone access is required to record.")}if(u.current)try{n("recording"),await u.current.startRecording({templates:e.templates||["soap"],languageHint:e.languageHint}),d.current=Date.now(),f.current=0,o(0),h(),p("Recording started")}catch(r){p("Failed to start recording",r),g("Failed to start recording. Please try again.")}else g("SDK not initialized. Please try again.")}else g("Microphone access is blocked. Please enable it in your browser settings.")},[e.templates,e.languageHint,p,g,h]),pauseRecording:reactExports.useCallback(()=>{u.current&&(u.current.pauseRecording(),n("paused"),f.current=Date.now(),m(),p("Recording paused"))},[p,m]),resumeRecording:reactExports.useCallback(()=>{u.current&&(u.current.resumeRecording(),n("recording"),f.current&&(d.current+=Date.now()-f.current,f.current=0),h(),p("Recording resumed"))},[p,h]),stopRecording:reactExports.useCallback(async()=>{if(u.current)try{m(),n("processing"),p("Stopping recording...");const t=await u.current.endRecording();p("Recording ended",t),p("Polling for completion...");const r=await u.current.pollForCompletion(void 0,{maxAttempts:60,intervalMs:2e3,onProgress:e=>{p("Status update:",e.status)}});i(r),p("Final result:",r),n("results"),e.onResult&&e.onResult(r)}catch(t){p("Failed to stop recording",t),g("Failed to process recording. Please try again."),e.onError&&t instanceof Error&&e.onError(t)}},[e,p,g,m]),reset:reactExports.useCallback(()=>{i(null),l(""),o(0),n("idle")},[])}}function App({config:e,onClose:t}){const[n,r]=reactExports.useState(!1),[o,a]=reactExports.useState(e.baseUrl?{apiKey:e.apiKey,baseUrl:e.baseUrl}:null),i=reactExports.useMemo(()=>o?{...e,apiKey:o.apiKey,baseUrl:o.baseUrl}:e,[e,o]),s=!o,{state:l,elapsedTime:u,result:c,errorMessage:d,startRecording:f,pauseRecording:p,resumeRecording:h,stopRecording:m,reset:g}=useScribeSession(i);if(n)return null;const b=(e,t)=>{a({apiKey:e,baseUrl:t})};return jsxRuntimeExports.jsx(FloatingPanel,{position:i.position,onClose:t,onMinimize:()=>r(!0),children:(()=>{if(s)return jsxRuntimeExports.jsx(ConfigState,{onSubmit:b,initialApiKey:e.apiKey||"",initialBaseUrl:e.baseUrl||""});switch(l){case"idle":default:return jsxRuntimeExports.jsx(IdleState,{onStartRecording:f});case"permission":return jsxRuntimeExports.jsx(PermissionState,{onRequestPermission:f});case"recording":case"paused":return jsxRuntimeExports.jsx(RecordingState,{elapsedTime:u,isPaused:"paused"===l,onPause:p,onResume:h,onStop:m});case"processing":return jsxRuntimeExports.jsx(ProcessingState,{});case"results":return c?jsxRuntimeExports.jsx(ResultsState,{result:c,onNewRecording:g}):null;case"error":return jsxRuntimeExports.jsx(ErrorState,{message:d,onRetry:g})}})()})}ScribeClient.instance=null;const widgetStyles=":host{all:initial;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,sans-serif}*{box-sizing:border-box;margin:0;padding:0}.scribe-panel{position:fixed;bottom:20px;right:20px;background:#fff;border-radius:16px;box-shadow:0 4px 24px #0000001f,0 0 0 1px #0000000d;z-index:2147483647;overflow:hidden;min-width:320px}.panel-header{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;background:#fafafa;border-bottom:1px solid #eee;cursor:grab}.panel-header:active{cursor:grabbing}.drag-handle{display:flex;gap:2px;flex-wrap:wrap;width:16px;opacity:.4}.drag-handle span{width:4px;height:4px;background:#666;border-radius:50%}.header-actions{display:flex;gap:8px}.header-btn{background:none;border:none;cursor:pointer;padding:4px;color:#666;display:flex;align-items:center;justify-content:center;width:24px;height:24px}.header-btn:hover{color:#333}.header-btn svg{width:16px;height:16px}.panel-content{padding:20px 24px}.idle-state{display:flex;align-items:center;gap:24px}.logo{display:flex;align-items:center;gap:8px}.logo-icon{width:32px;height:32px}.logo-icon svg{width:100%;height:100%}.logo-text{font-size:20px;font-weight:600;color:#2563eb}.start-btn{display:flex;align-items:center;gap:8px;background:#2563eb;color:#fff;border:none;padding:12px 24px;border-radius:24px;font-size:16px;font-weight:500;cursor:pointer;transition:background .2s}.start-btn:hover{background:#1d4ed8}.start-btn:disabled{background:#93c5fd;cursor:not-allowed}.mic-icon{width:20px;height:20px}.mic-icon svg{width:100%;height:100%}.recording-state{display:flex;align-items:center;gap:16px}.recording-indicator{display:flex;align-items:center;gap:12px;color:#666}.recording-icon{width:24px;height:24px;color:#666}.recording-icon svg{width:100%;height:100%}.recording-icon.active{color:#ef4444;animation:pulse 1.5s infinite}@keyframes pulse{0%,to{opacity:1}50%{opacity:.5}}.timer{font-size:20px;font-weight:500;font-variant-numeric:tabular-nums;color:#374151}.recording-actions{display:flex;gap:8px;margin-left:auto}.resume-btn{background:#fff;color:#2563eb;border:2px solid #2563eb;padding:10px 20px;border-radius:8px;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s}.resume-btn:hover{background:#eff6ff}.pause-btn{background:#fff;color:#f59e0b;border:2px solid #f59e0b;padding:10px 20px;border-radius:8px;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s}.pause-btn:hover{background:#fffbeb}.stop-btn{background:#ef4444;color:#fff;border:none;padding:10px 16px;border-radius:8px;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background .2s}.stop-btn:hover{background:#dc2626}.stop-icon{width:16px;height:16px;background:#fff;border-radius:2px}.processing-state{display:flex;flex-direction:column;align-items:center;gap:16px;padding:20px}.spinner{width:40px;height:40px;border:3px solid #e5e7eb;border-top-color:#2563eb;border-radius:50%;animation:spin 1s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.processing-text{color:#6b7280;font-size:14px}.results-state{display:flex;flex-direction:column;gap:16px;max-height:400px}.results-header{display:flex;align-items:center;justify-content:space-between}.results-title{font-size:16px;font-weight:600;color:#111827}.new-recording-btn{background:#2563eb;color:#fff;border:none;padding:8px 16px;border-radius:6px;font-size:13px;cursor:pointer;transition:background .2s}.new-recording-btn:hover{background:#1d4ed8}.results-content{overflow-y:auto;max-height:300px}.transcript-section{margin-bottom:16px}.section-title{font-size:13px;font-weight:600;color:#6b7280;text-transform:uppercase;letter-spacing:.05em;margin-bottom:8px}.transcript-text{font-size:14px;line-height:1.6;color:#374151;background:#f9fafb;padding:12px;border-radius:8px;white-space:pre-wrap}.error-state{display:flex;flex-direction:column;align-items:center;gap:12px;padding:20px;text-align:center}.error-icon{width:48px;height:48px;color:#ef4444}.error-icon svg{width:100%;height:100%}.error-message{color:#ef4444;font-size:14px}.retry-btn{background:#ef4444;color:#fff;border:none;padding:10px 20px;border-radius:8px;font-size:14px;cursor:pointer;transition:background .2s}.retry-btn:hover{background:#dc2626}.permission-state{display:flex;flex-direction:column;align-items:center;gap:16px;padding:20px;text-align:center}.permission-icon{width:48px;height:48px;color:#2563eb}.permission-icon svg{width:100%;height:100%}.permission-text{color:#374151;font-size:14px;line-height:1.5}.permission-btn{background:#2563eb;color:#fff;border:none;padding:12px 24px;border-radius:8px;font-size:14px;font-weight:500;cursor:pointer;transition:background .2s}.permission-btn:hover{background:#1d4ed8}.config-state{display:flex;flex-direction:column;gap:20px}.config-state .logo{justify-content:center}.config-form{display:flex;flex-direction:column;gap:12px}.config-form .form-group{display:flex;flex-direction:column;gap:4px}.config-form label{font-size:13px;font-weight:500;color:#374151}.config-form input{padding:10px 12px;border:1px solid #d1d5db;border-radius:8px;font-size:14px;color:#111827;background:#fff;transition:border-color .2s,box-shadow .2s}.config-form input:focus{outline:none;border-color:#2563eb;box-shadow:0 0 0 3px #2563eb1a}.config-form input::placeholder{color:#9ca3af}.config-error{color:#ef4444;font-size:13px;margin:0}.config-submit-btn{background:#2563eb;color:#fff;border:none;padding:12px 24px;border-radius:8px;font-size:14px;font-weight:500;cursor:pointer;transition:background .2s;margin-top:4px}.config-submit-btn:hover{background:#1d4ed8}";class ScribeWidget{constructor(e){__publicField(this,"container"),__publicField(this,"shadowRoot"),__publicField(this,"root",null),__publicField(this,"config"),__publicField(this,"visible",!0),this.config={templates:["soap"],languageHint:["en"],position:{bottom:20,right:20},...e},this.container=document.createElement("div"),this.container.id="eka-scribe-widget",this.shadowRoot=this.container.attachShadow({mode:"closed"});const t=document.createElement("style");t.textContent=widgetStyles,this.shadowRoot.appendChild(t);const n=document.createElement("div");n.id="eka-scribe-root",this.shadowRoot.appendChild(n),this.root=createRoot(n)}render(){this.root&&this.visible&&this.root.render(jsxRuntimeExports.jsx(App,{config:this.config,onClose:()=>this.hide()}))}mount(e){const t="string"==typeof e?document.querySelector(e):e||document.body;t&&(t.appendChild(this.container),this.render())}unmount(){this.root&&(this.root.unmount(),this.root=null),this.container.remove()}show(){this.visible=!0,this.container.style.display="block",this.render()}hide(){this.visible=!1,this.container.style.display="none"}isVisible(){return this.visible}}let widgetInstance=null;function init(e={}){return widgetInstance&&widgetInstance.unmount(),console.log(e,"config - WIDGET"),widgetInstance=new ScribeWidget(e),widgetInstance.mount(),widgetInstance}function getInstance(){return widgetInstance}const EkaScribe={init:init,getInstance:getInstance,Widget:ScribeWidget};if("undefined"!=typeof window&&"undefined"!=typeof document){const e=()=>{const e=document.currentScript||document.querySelector('script[src*="scribe-widget"]');(null==e?void 0:e.hasAttribute("data-no-auto-init"))||(console.log(widgetInstance,"widget instance"),widgetInstance||init({}))};"loading"===document.readyState?document.addEventListener("DOMContentLoaded - WIDGET",e):(console.log("load document - WIDGET"),e())}exports.ScribeWidget=ScribeWidget,exports.default=EkaScribe,exports.getInstance=getInstance,exports.init=init,Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});