var Fo=Object.defineProperty;var No=(i,o,s)=>o in i?Fo(i,o,{enumerable:!0,configurable:!0,writable:!0,value:s}):i[o]=s;var fn=(i,o,s)=>(No(i,typeof o!="symbol"?o+"":o,s),s);function _mergeNamespaces(i,o){for(var s=0;sj[_e]})}}}return Object.freeze(Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}))}(function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const _e of document.querySelectorAll('link[rel="modulepreload"]'))j(_e);new MutationObserver(_e=>{for(const lt of _e)if(lt.type==="childList")for(const tt of lt.addedNodes)tt.tagName==="LINK"&&tt.rel==="modulepreload"&&j(tt)}).observe(document,{childList:!0,subtree:!0});function s(_e){const lt={};return _e.integrity&&(lt.integrity=_e.integrity),_e.referrerPolicy&&(lt.referrerPolicy=_e.referrerPolicy),_e.crossOrigin==="use-credentials"?lt.credentials="include":_e.crossOrigin==="anonymous"?lt.credentials="omit":lt.credentials="same-origin",lt}function j(_e){if(_e.ep)return;_e.ep=!0;const lt=s(_e);fetch(_e.href,lt)}})();function getDefaultExportFromCjs(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}function getAugmentedNamespace(i){if(i.__esModule)return i;var o=i.default;if(typeof o=="function"){var s=function j(){return this instanceof j?Reflect.construct(o,arguments,this.constructor):o.apply(this,arguments)};s.prototype=o.prototype}else s={};return Object.defineProperty(s,"__esModule",{value:!0}),Object.keys(i).forEach(function(j){var _e=Object.getOwnPropertyDescriptor(i,j);Object.defineProperty(s,j,_e.get?_e:{enumerable:!0,get:function(){return i[j]}})}),s}var react={exports:{}},react_production_min={};/** * @license React * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var l$3=Symbol.for("react.element"),n$3=Symbol.for("react.portal"),p$4=Symbol.for("react.fragment"),q$3=Symbol.for("react.strict_mode"),r$2=Symbol.for("react.profiler"),t$2=Symbol.for("react.provider"),u$1=Symbol.for("react.context"),v$3=Symbol.for("react.forward_ref"),w$1=Symbol.for("react.suspense"),x$1=Symbol.for("react.memo"),y$1=Symbol.for("react.lazy"),z$2=Symbol.iterator;function A$2(i){return i===null||typeof i!="object"?null:(i=z$2&&i[z$2]||i["@@iterator"],typeof i=="function"?i:null)}var B$1={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C$1=Object.assign,D$1={};function E$1(i,o,s){this.props=i,this.context=o,this.refs=D$1,this.updater=s||B$1}E$1.prototype.isReactComponent={};E$1.prototype.setState=function(i,o){if(typeof i!="object"&&typeof i!="function"&&i!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,i,o,"setState")};E$1.prototype.forceUpdate=function(i){this.updater.enqueueForceUpdate(this,i,"forceUpdate")};function F(){}F.prototype=E$1.prototype;function G$1(i,o,s){this.props=i,this.context=o,this.refs=D$1,this.updater=s||B$1}var H$1=G$1.prototype=new F;H$1.constructor=G$1;C$1(H$1,E$1.prototype);H$1.isPureReactComponent=!0;var I$1=Array.isArray,J=Object.prototype.hasOwnProperty,K$1={current:null},L$1={key:!0,ref:!0,__self:!0,__source:!0};function M$1(i,o,s){var j,_e={},lt=null,tt=null;if(o!=null)for(j in o.ref!==void 0&&(tt=o.ref),o.key!==void 0&&(lt=""+o.key),o)J.call(o,j)&&!L$1.hasOwnProperty(j)&&(_e[j]=o[j]);var ot=arguments.length-2;if(ot===1)_e.children=s;else if(1>>1,At=Jt[Et];if(0<_e(At,Ht))Jt[Et]=Ht,Jt[wt]=At,wt=Et;else break e}}function s(Jt){return Jt.length===0?null:Jt[0]}function j(Jt){if(Jt.length===0)return null;var Ht=Jt[0],wt=Jt.pop();if(wt!==Ht){Jt[0]=wt;e:for(var Et=0,At=Jt.length,Il=At>>>1;Et_e(jt,wt))Xl_e(Yl,jt)?(Jt[Et]=Yl,Jt[Xl]=wt,Et=Xl):(Jt[Et]=jt,Jt[Qt]=wt,Et=Qt);else if(Xl_e(Yl,wt))Jt[Et]=Yl,Jt[Xl]=wt,Et=Xl;else break e}}return Ht}function _e(Jt,Ht){var wt=Jt.sortIndex-Ht.sortIndex;return wt!==0?wt:Jt.id-Ht.id}if(typeof performance=="object"&&typeof performance.now=="function"){var lt=performance;i.unstable_now=function(){return lt.now()}}else{var tt=Date,ot=tt.now();i.unstable_now=function(){return tt.now()-ot}}var st=[],ct=[],it=1,$=null,a=3,et=!1,nt=!1,at=!1,rt=typeof setTimeout=="function"?setTimeout:null,dt=typeof clearTimeout=="function"?clearTimeout:null,ut=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function bt(Jt){for(var Ht=s(ct);Ht!==null;){if(Ht.callback===null)j(ct);else if(Ht.startTime<=Jt)j(ct),Ht.sortIndex=Ht.expirationTime,o(st,Ht);else break;Ht=s(ct)}}function mt(Jt){if(at=!1,bt(Jt),!nt)if(s(st)!==null)nt=!0,ft(pt);else{var Ht=s(ct);Ht!==null&&Ft(mt,Ht.startTime-Jt)}}function pt(Jt,Ht){nt=!1,at&&(at=!1,dt(Gt),Gt=-1),et=!0;var wt=a;try{for(bt(Ht),$=s(st);$!==null&&(!($.expirationTime>Ht)||Jt&&!Yt());){var Et=$.callback;if(typeof Et=="function"){$.callback=null,a=$.priorityLevel;var At=Et($.expirationTime<=Ht);Ht=i.unstable_now(),typeof At=="function"?$.callback=At:$===s(st)&&j(st),bt(Ht)}else j(st);$=s(st)}if($!==null)var Il=!0;else{var Qt=s(ct);Qt!==null&&Ft(mt,Qt.startTime-Ht),Il=!1}return Il}finally{$=null,a=wt,et=!1}}var Zt=!1,ht=null,Gt=-1,Xt=5,Vt=-1;function Yt(){return!(i.unstable_now()-VtJt||125Et?(Jt.sortIndex=wt,o(ct,Jt),s(st)===null&&Jt===s(ct)&&(at?(dt(Gt),Gt=-1):at=!0,Ft(mt,wt-Et))):(Jt.sortIndex=At,o(st,Jt),nt||et||(nt=!0,ft(pt))),Jt},i.unstable_shouldYield=Yt,i.unstable_wrapCallback=function(Jt){var Ht=a;return function(){var wt=a;a=Ht;try{return Jt.apply(this,arguments)}finally{a=wt}}}})(scheduler_production_min);scheduler.exports=scheduler_production_min;var schedulerExports=scheduler.exports;/** * @license React * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var aa=reactExports,ca=schedulerExports;function p$3(i){for(var o="https://reactjs.org/docs/error-decoder.html?invariant="+i,s=1;s"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ja=Object.prototype.hasOwnProperty,ka=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,la={},ma={};function oa(i){return ja.call(ma,i)?!0:ja.call(la,i)?!1:ka.test(i)?ma[i]=!0:(la[i]=!0,!1)}function pa(i,o,s,j){if(s!==null&&s.type===0)return!1;switch(typeof o){case"function":case"symbol":return!0;case"boolean":return j?!1:s!==null?!s.acceptsBooleans:(i=i.toLowerCase().slice(0,5),i!=="data-"&&i!=="aria-");default:return!1}}function qa(i,o,s,j){if(o===null||typeof o>"u"||pa(i,o,s,j))return!0;if(j)return!1;if(s!==null)switch(s.type){case 3:return!o;case 4:return o===!1;case 5:return isNaN(o);case 6:return isNaN(o)||1>o}return!1}function v$2(i,o,s,j,_e,lt,tt){this.acceptsBooleans=o===2||o===3||o===4,this.attributeName=j,this.attributeNamespace=_e,this.mustUseProperty=s,this.propertyName=i,this.type=o,this.sanitizeURL=lt,this.removeEmptyString=tt}var z$1={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(i){z$1[i]=new v$2(i,0,!1,i,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(i){var o=i[0];z$1[o]=new v$2(o,1,!1,i[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(i){z$1[i]=new v$2(i,2,!1,i.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(i){z$1[i]=new v$2(i,2,!1,i,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(i){z$1[i]=new v$2(i,3,!1,i.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(i){z$1[i]=new v$2(i,3,!0,i,null,!1,!1)});["capture","download"].forEach(function(i){z$1[i]=new v$2(i,4,!1,i,null,!1,!1)});["cols","rows","size","span"].forEach(function(i){z$1[i]=new v$2(i,6,!1,i,null,!1,!1)});["rowSpan","start"].forEach(function(i){z$1[i]=new v$2(i,5,!1,i.toLowerCase(),null,!1,!1)});var ra=/[\-:]([a-z])/g;function sa(i){return i[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(i){var o=i.replace(ra,sa);z$1[o]=new v$2(o,1,!1,i,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(i){var o=i.replace(ra,sa);z$1[o]=new v$2(o,1,!1,i,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(i){var o=i.replace(ra,sa);z$1[o]=new v$2(o,1,!1,i,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(i){z$1[i]=new v$2(i,1,!1,i.toLowerCase(),null,!1,!1)});z$1.xlinkHref=new v$2("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(i){z$1[i]=new v$2(i,1,!1,i.toLowerCase(),null,!0,!0)});function ta(i,o,s,j){var _e=z$1.hasOwnProperty(o)?z$1[o]:null;(_e!==null?_e.type!==0:j||!(2ot||_e[tt]!==lt[ot]){var st=` `+_e[tt].replace(" at new "," at ");return i.displayName&&st.includes("")&&(st=st.replace("",i.displayName)),st}while(1<=tt&&0<=ot);break}}}finally{Na=!1,Error.prepareStackTrace=s}return(i=i?i.displayName||i.name:"")?Ma(i):""}function Pa(i){switch(i.tag){case 5:return Ma(i.type);case 16:return Ma("Lazy");case 13:return Ma("Suspense");case 19:return Ma("SuspenseList");case 0:case 2:case 15:return i=Oa(i.type,!1),i;case 11:return i=Oa(i.type.render,!1),i;case 1:return i=Oa(i.type,!0),i;default:return""}}function Qa(i){if(i==null)return null;if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case ya:return"Fragment";case wa:return"Portal";case Aa:return"Profiler";case za:return"StrictMode";case Ea:return"Suspense";case Fa:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case Ca:return(i.displayName||"Context")+".Consumer";case Ba:return(i._context.displayName||"Context")+".Provider";case Da:var o=i.render;return i=i.displayName,i||(i=o.displayName||o.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case Ga:return o=i.displayName||null,o!==null?o:Qa(i.type)||"Memo";case Ha:o=i._payload,i=i._init;try{return Qa(i(o))}catch{}}return null}function Ra(i){var o=i.type;switch(i.tag){case 24:return"Cache";case 9:return(o.displayName||"Context")+".Consumer";case 10:return(o._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return i=o.render,i=i.displayName||i.name||"",o.displayName||(i!==""?"ForwardRef("+i+")":"ForwardRef");case 7:return"Fragment";case 5:return o;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Qa(o);case 8:return o===za?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o}return null}function Sa(i){switch(typeof i){case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function Ta(i){var o=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function Ua(i){var o=Ta(i)?"checked":"value",s=Object.getOwnPropertyDescriptor(i.constructor.prototype,o),j=""+i[o];if(!i.hasOwnProperty(o)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var _e=s.get,lt=s.set;return Object.defineProperty(i,o,{configurable:!0,get:function(){return _e.call(this)},set:function(tt){j=""+tt,lt.call(this,tt)}}),Object.defineProperty(i,o,{enumerable:s.enumerable}),{getValue:function(){return j},setValue:function(tt){j=""+tt},stopTracking:function(){i._valueTracker=null,delete i[o]}}}}function Va(i){i._valueTracker||(i._valueTracker=Ua(i))}function Wa(i){if(!i)return!1;var o=i._valueTracker;if(!o)return!0;var s=o.getValue(),j="";return i&&(j=Ta(i)?i.checked?"true":"false":i.value),i=j,i!==s?(o.setValue(i),!0):!1}function Xa(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}function Ya(i,o){var s=o.checked;return A$1({},o,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:s??i._wrapperState.initialChecked})}function Za(i,o){var s=o.defaultValue==null?"":o.defaultValue,j=o.checked!=null?o.checked:o.defaultChecked;s=Sa(o.value!=null?o.value:s),i._wrapperState={initialChecked:j,initialValue:s,controlled:o.type==="checkbox"||o.type==="radio"?o.checked!=null:o.value!=null}}function ab(i,o){o=o.checked,o!=null&&ta(i,"checked",o,!1)}function bb(i,o){ab(i,o);var s=Sa(o.value),j=o.type;if(s!=null)j==="number"?(s===0&&i.value===""||i.value!=s)&&(i.value=""+s):i.value!==""+s&&(i.value=""+s);else if(j==="submit"||j==="reset"){i.removeAttribute("value");return}o.hasOwnProperty("value")?cb(i,o.type,s):o.hasOwnProperty("defaultValue")&&cb(i,o.type,Sa(o.defaultValue)),o.checked==null&&o.defaultChecked!=null&&(i.defaultChecked=!!o.defaultChecked)}function db(i,o,s){if(o.hasOwnProperty("value")||o.hasOwnProperty("defaultValue")){var j=o.type;if(!(j!=="submit"&&j!=="reset"||o.value!==void 0&&o.value!==null))return;o=""+i._wrapperState.initialValue,s||o===i.value||(i.value=o),i.defaultValue=o}s=i.name,s!==""&&(i.name=""),i.defaultChecked=!!i._wrapperState.initialChecked,s!==""&&(i.name=s)}function cb(i,o,s){(o!=="number"||Xa(i.ownerDocument)!==i)&&(s==null?i.defaultValue=""+i._wrapperState.initialValue:i.defaultValue!==""+s&&(i.defaultValue=""+s))}var eb=Array.isArray;function fb(i,o,s,j){if(i=i.options,o){o={};for(var _e=0;_e"+o.valueOf().toString()+"",o=mb.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;o.firstChild;)i.appendChild(o.firstChild)}});function ob(i,o){if(o){var s=i.firstChild;if(s&&s===i.lastChild&&s.nodeType===3){s.nodeValue=o;return}}i.textContent=o}var pb={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},qb=["Webkit","ms","Moz","O"];Object.keys(pb).forEach(function(i){qb.forEach(function(o){o=o+i.charAt(0).toUpperCase()+i.substring(1),pb[o]=pb[i]})});function rb(i,o,s){return o==null||typeof o=="boolean"||o===""?"":s||typeof o!="number"||o===0||pb.hasOwnProperty(i)&&pb[i]?(""+o).trim():o+"px"}function sb(i,o){i=i.style;for(var s in o)if(o.hasOwnProperty(s)){var j=s.indexOf("--")===0,_e=rb(s,o[s],j);s==="float"&&(s="cssFloat"),j?i.setProperty(s,_e):i[s]=_e}}var tb=A$1({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ub(i,o){if(o){if(tb[i]&&(o.children!=null||o.dangerouslySetInnerHTML!=null))throw Error(p$3(137,i));if(o.dangerouslySetInnerHTML!=null){if(o.children!=null)throw Error(p$3(60));if(typeof o.dangerouslySetInnerHTML!="object"||!("__html"in o.dangerouslySetInnerHTML))throw Error(p$3(61))}if(o.style!=null&&typeof o.style!="object")throw Error(p$3(62))}}function vb(i,o){if(i.indexOf("-")===-1)return typeof o.is=="string";switch(i){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var wb=null;function xb(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var yb=null,zb=null,Ab=null;function Bb(i){if(i=Cb(i)){if(typeof yb!="function")throw Error(p$3(280));var o=i.stateNode;o&&(o=Db(o),yb(i.stateNode,i.type,o))}}function Eb(i){zb?Ab?Ab.push(i):Ab=[i]:zb=i}function Fb(){if(zb){var i=zb,o=Ab;if(Ab=zb=null,Bb(i),o)for(i=0;i>>=0,i===0?32:31-(pc(i)/qc|0)|0}var rc=64,sc=4194304;function tc(i){switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return i&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return i}}function uc(i,o){var s=i.pendingLanes;if(s===0)return 0;var j=0,_e=i.suspendedLanes,lt=i.pingedLanes,tt=s&268435455;if(tt!==0){var ot=tt&~_e;ot!==0?j=tc(ot):(lt&=tt,lt!==0&&(j=tc(lt)))}else tt=s&~_e,tt!==0?j=tc(tt):lt!==0&&(j=tc(lt));if(j===0)return 0;if(o!==0&&o!==j&&!(o&_e)&&(_e=j&-j,lt=o&-o,_e>=lt||_e===16&&(lt&4194240)!==0))return o;if(j&4&&(j|=s&16),o=i.entangledLanes,o!==0)for(i=i.entanglements,o&=j;0s;s++)o.push(i);return o}function Ac(i,o,s){i.pendingLanes|=o,o!==536870912&&(i.suspendedLanes=0,i.pingedLanes=0),i=i.eventTimes,o=31-oc(o),i[o]=s}function Bc(i,o){var s=i.pendingLanes&~o;i.pendingLanes=o,i.suspendedLanes=0,i.pingedLanes=0,i.expiredLanes&=o,i.mutableReadLanes&=o,i.entangledLanes&=o,o=i.entanglements;var j=i.eventTimes;for(i=i.expirationTimes;0=be),ee=" ",fe=!1;function ge(i,o){switch(i){case"keyup":return $d.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function he(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var ie=!1;function je(i,o){switch(i){case"compositionend":return he(o);case"keypress":return o.which!==32?null:(fe=!0,ee);case"textInput":return i=o.data,i===ee&&fe?null:i;default:return null}}function ke(i,o){if(ie)return i==="compositionend"||!ae&&ge(i,o)?(i=nd(),md=ld=kd=null,ie=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1=o)return{node:s,offset:o-i};i=j}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Je(s)}}function Le(i,o){return i&&o?i===o?!0:i&&i.nodeType===3?!1:o&&o.nodeType===3?Le(i,o.parentNode):"contains"in i?i.contains(o):i.compareDocumentPosition?!!(i.compareDocumentPosition(o)&16):!1:!1}function Me(){for(var i=window,o=Xa();o instanceof i.HTMLIFrameElement;){try{var s=typeof o.contentWindow.location.href=="string"}catch{s=!1}if(s)i=o.contentWindow;else break;o=Xa(i.document)}return o}function Ne(i){var o=i&&i.nodeName&&i.nodeName.toLowerCase();return o&&(o==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||o==="textarea"||i.contentEditable==="true")}function Oe(i){var o=Me(),s=i.focusedElem,j=i.selectionRange;if(o!==s&&s&&s.ownerDocument&&Le(s.ownerDocument.documentElement,s)){if(j!==null&&Ne(s)){if(o=j.start,i=j.end,i===void 0&&(i=o),"selectionStart"in s)s.selectionStart=o,s.selectionEnd=Math.min(i,s.value.length);else if(i=(o=s.ownerDocument||document)&&o.defaultView||window,i.getSelection){i=i.getSelection();var _e=s.textContent.length,lt=Math.min(j.start,_e);j=j.end===void 0?lt:Math.min(j.end,_e),!i.extend&<>j&&(_e=j,j=lt,lt=_e),_e=Ke(s,lt);var tt=Ke(s,j);_e&&tt&&(i.rangeCount!==1||i.anchorNode!==_e.node||i.anchorOffset!==_e.offset||i.focusNode!==tt.node||i.focusOffset!==tt.offset)&&(o=o.createRange(),o.setStart(_e.node,_e.offset),i.removeAllRanges(),lt>j?(i.addRange(o),i.extend(tt.node,tt.offset)):(o.setEnd(tt.node,tt.offset),i.addRange(o)))}}for(o=[],i=s;i=i.parentNode;)i.nodeType===1&&o.push({element:i,left:i.scrollLeft,top:i.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;s=document.documentMode,Qe=null,Re=null,Se=null,Te=!1;function Ue(i,o,s){var j=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Te||Qe==null||Qe!==Xa(j)||(j=Qe,"selectionStart"in j&&Ne(j)?j={start:j.selectionStart,end:j.selectionEnd}:(j=(j.ownerDocument&&j.ownerDocument.defaultView||window).getSelection(),j={anchorNode:j.anchorNode,anchorOffset:j.anchorOffset,focusNode:j.focusNode,focusOffset:j.focusOffset}),Se&&Ie(Se,j)||(Se=j,j=oe(Re,"onSelect"),0Tf||(i.current=Sf[Tf],Sf[Tf]=null,Tf--)}function G(i,o){Tf++,Sf[Tf]=i.current,i.current=o}var Vf={},H=Uf(Vf),Wf=Uf(!1),Xf=Vf;function Yf(i,o){var s=i.type.contextTypes;if(!s)return Vf;var j=i.stateNode;if(j&&j.__reactInternalMemoizedUnmaskedChildContext===o)return j.__reactInternalMemoizedMaskedChildContext;var _e={},lt;for(lt in s)_e[lt]=o[lt];return j&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=o,i.__reactInternalMemoizedMaskedChildContext=_e),_e}function Zf(i){return i=i.childContextTypes,i!=null}function $f(){E(Wf),E(H)}function ag(i,o,s){if(H.current!==Vf)throw Error(p$3(168));G(H,o),G(Wf,s)}function bg(i,o,s){var j=i.stateNode;if(o=o.childContextTypes,typeof j.getChildContext!="function")return s;j=j.getChildContext();for(var _e in j)if(!(_e in o))throw Error(p$3(108,Ra(i)||"Unknown",_e));return A$1({},s,j)}function cg(i){return i=(i=i.stateNode)&&i.__reactInternalMemoizedMergedChildContext||Vf,Xf=H.current,G(H,i),G(Wf,Wf.current),!0}function dg(i,o,s){var j=i.stateNode;if(!j)throw Error(p$3(169));s?(i=bg(i,o,Xf),j.__reactInternalMemoizedMergedChildContext=i,E(Wf),E(H),G(H,i)):E(Wf),G(Wf,s)}var eg=null,fg=!1,gg=!1;function hg(i){eg===null?eg=[i]:eg.push(i)}function ig(i){fg=!0,hg(i)}function jg(){if(!gg&&eg!==null){gg=!0;var i=0,o=C;try{var s=eg;for(C=1;i>=tt,_e-=tt,rg=1<<32-oc(o)+_e|s<<_e|j,sg=lt+i}else rg=1<Gt?(Xt=ht,ht=null):Xt=ht.sibling;var Vt=a(dt,ht,bt[Gt],mt);if(Vt===null){ht===null&&(ht=Xt);break}i&&ht&&Vt.alternate===null&&o(dt,ht),ut=lt(Vt,ut,Gt),Zt===null?pt=Vt:Zt.sibling=Vt,Zt=Vt,ht=Xt}if(Gt===bt.length)return s(dt,ht),I&&tg(dt,Gt),pt;if(ht===null){for(;GtGt?(Xt=ht,ht=null):Xt=ht.sibling;var Yt=a(dt,ht,Vt.value,mt);if(Yt===null){ht===null&&(ht=Xt);break}i&&ht&&Yt.alternate===null&&o(dt,ht),ut=lt(Yt,ut,Gt),Zt===null?pt=Yt:Zt.sibling=Yt,Zt=Yt,ht=Xt}if(Vt.done)return s(dt,ht),I&&tg(dt,Gt),pt;if(ht===null){for(;!Vt.done;Gt++,Vt=bt.next())Vt=$(dt,Vt.value,mt),Vt!==null&&(ut=lt(Vt,ut,Gt),Zt===null?pt=Vt:Zt.sibling=Vt,Zt=Vt);return I&&tg(dt,Gt),pt}for(ht=j(dt,ht);!Vt.done;Gt++,Vt=bt.next())Vt=et(ht,dt,Gt,Vt.value,mt),Vt!==null&&(i&&Vt.alternate!==null&&ht.delete(Vt.key===null?Gt:Vt.key),ut=lt(Vt,ut,Gt),Zt===null?pt=Vt:Zt.sibling=Vt,Zt=Vt);return i&&ht.forEach(function(St){return o(dt,St)}),I&&tg(dt,Gt),pt}function rt(dt,ut,bt,mt){if(typeof bt=="object"&&bt!==null&&bt.type===ya&&bt.key===null&&(bt=bt.props.children),typeof bt=="object"&&bt!==null){switch(bt.$$typeof){case va:e:{for(var pt=bt.key,Zt=ut;Zt!==null;){if(Zt.key===pt){if(pt=bt.type,pt===ya){if(Zt.tag===7){s(dt,Zt.sibling),ut=_e(Zt,bt.props.children),ut.return=dt,dt=ut;break e}}else if(Zt.elementType===pt||typeof pt=="object"&&pt!==null&&pt.$$typeof===Ha&&uh(pt)===Zt.type){s(dt,Zt.sibling),ut=_e(Zt,bt.props),ut.ref=sh(dt,Zt,bt),ut.return=dt,dt=ut;break e}s(dt,Zt);break}else o(dt,Zt);Zt=Zt.sibling}bt.type===ya?(ut=Ah(bt.props.children,dt.mode,mt,bt.key),ut.return=dt,dt=ut):(mt=yh(bt.type,bt.key,bt.props,null,dt.mode,mt),mt.ref=sh(dt,ut,bt),mt.return=dt,dt=mt)}return tt(dt);case wa:e:{for(Zt=bt.key;ut!==null;){if(ut.key===Zt)if(ut.tag===4&&ut.stateNode.containerInfo===bt.containerInfo&&ut.stateNode.implementation===bt.implementation){s(dt,ut.sibling),ut=_e(ut,bt.children||[]),ut.return=dt,dt=ut;break e}else{s(dt,ut);break}else o(dt,ut);ut=ut.sibling}ut=zh(bt,dt.mode,mt),ut.return=dt,dt=ut}return tt(dt);case Ha:return Zt=bt._init,rt(dt,ut,Zt(bt._payload),mt)}if(eb(bt))return nt(dt,ut,bt,mt);if(Ka(bt))return at(dt,ut,bt,mt);th(dt,bt)}return typeof bt=="string"&&bt!==""||typeof bt=="number"?(bt=""+bt,ut!==null&&ut.tag===6?(s(dt,ut.sibling),ut=_e(ut,bt),ut.return=dt,dt=ut):(s(dt,ut),ut=xh(bt,dt.mode,mt),ut.return=dt,dt=ut),tt(dt)):s(dt,ut)}return rt}var Bh=vh(!0),Ch=vh(!1),Dh={},Eh=Uf(Dh),Fh=Uf(Dh),Gh=Uf(Dh);function Hh(i){if(i===Dh)throw Error(p$3(174));return i}function Ih(i,o){switch(G(Gh,o),G(Fh,i),G(Eh,Dh),i=o.nodeType,i){case 9:case 11:o=(o=o.documentElement)?o.namespaceURI:lb(null,"");break;default:i=i===8?o.parentNode:o,o=i.namespaceURI||null,i=i.tagName,o=lb(o,i)}E(Eh),G(Eh,o)}function Jh(){E(Eh),E(Fh),E(Gh)}function Kh(i){Hh(Gh.current);var o=Hh(Eh.current),s=lb(o,i.type);o!==s&&(G(Fh,i),G(Eh,s))}function Lh(i){Fh.current===i&&(E(Eh),E(Fh))}var M=Uf(0);function Mh(i){for(var o=i;o!==null;){if(o.tag===13){var s=o.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||s.data==="$?"||s.data==="$!"))return o}else if(o.tag===19&&o.memoizedProps.revealOrder!==void 0){if(o.flags&128)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===i)break;for(;o.sibling===null;){if(o.return===null||o.return===i)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var Nh=[];function Oh(){for(var i=0;is?s:4,i(!0);var j=Qh.transition;Qh.transition={};try{i(!1),o()}finally{C=s,Qh.transition=j}}function Fi(){return di().memoizedState}function Gi(i,o,s){var j=lh(i);if(s={lane:j,action:s,hasEagerState:!1,eagerState:null,next:null},Hi(i))Ii(o,s);else if(s=Yg(i,o,s,j),s!==null){var _e=L();mh(s,i,j,_e),Ji(s,o,j)}}function ri(i,o,s){var j=lh(i),_e={lane:j,action:s,hasEagerState:!1,eagerState:null,next:null};if(Hi(i))Ii(o,_e);else{var lt=i.alternate;if(i.lanes===0&&(lt===null||lt.lanes===0)&&(lt=o.lastRenderedReducer,lt!==null))try{var tt=o.lastRenderedState,ot=lt(tt,s);if(_e.hasEagerState=!0,_e.eagerState=ot,He(ot,tt)){var st=o.interleaved;st===null?(_e.next=_e,Xg(o)):(_e.next=st.next,st.next=_e),o.interleaved=_e;return}}catch{}finally{}s=Yg(i,o,_e,j),s!==null&&(_e=L(),mh(s,i,j,_e),Ji(s,o,j))}}function Hi(i){var o=i.alternate;return i===N||o!==null&&o===N}function Ii(i,o){Th=Sh=!0;var s=i.pending;s===null?o.next=o:(o.next=s.next,s.next=o),i.pending=o}function Ji(i,o,s){if(s&4194240){var j=o.lanes;j&=i.pendingLanes,s|=j,o.lanes=s,Cc(i,s)}}var ai={readContext:Vg,useCallback:Q,useContext:Q,useEffect:Q,useImperativeHandle:Q,useInsertionEffect:Q,useLayoutEffect:Q,useMemo:Q,useReducer:Q,useRef:Q,useState:Q,useDebugValue:Q,useDeferredValue:Q,useTransition:Q,useMutableSource:Q,useSyncExternalStore:Q,useId:Q,unstable_isNewReconciler:!1},Yh={readContext:Vg,useCallback:function(i,o){return ci().memoizedState=[i,o===void 0?null:o],i},useContext:Vg,useEffect:vi,useImperativeHandle:function(i,o,s){return s=s!=null?s.concat([i]):null,ti(4194308,4,yi.bind(null,o,i),s)},useLayoutEffect:function(i,o){return ti(4194308,4,i,o)},useInsertionEffect:function(i,o){return ti(4,2,i,o)},useMemo:function(i,o){var s=ci();return o=o===void 0?null:o,i=i(),s.memoizedState=[i,o],i},useReducer:function(i,o,s){var j=ci();return o=s!==void 0?s(o):o,j.memoizedState=j.baseState=o,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:o},j.queue=i,i=i.dispatch=Gi.bind(null,N,i),[j.memoizedState,i]},useRef:function(i){var o=ci();return i={current:i},o.memoizedState=i},useState:qi,useDebugValue:Ai,useDeferredValue:function(i){return ci().memoizedState=i},useTransition:function(){var i=qi(!1),o=i[0];return i=Ei.bind(null,i[1]),ci().memoizedState=i,[o,i]},useMutableSource:function(){},useSyncExternalStore:function(i,o,s){var j=N,_e=ci();if(I){if(s===void 0)throw Error(p$3(407));s=s()}else{if(s=o(),R===null)throw Error(p$3(349));Rh&30||ni(j,o,s)}_e.memoizedState=s;var lt={value:s,getSnapshot:o};return _e.queue=lt,vi(ki.bind(null,j,lt,i),[i]),j.flags|=2048,li(9,mi.bind(null,j,lt,s,o),void 0,null),s},useId:function(){var i=ci(),o=R.identifierPrefix;if(I){var s=sg,j=rg;s=(j&~(1<<32-oc(j)-1)).toString(32)+s,o=":"+o+"R"+s,s=Uh++,0<\/script>",i=i.removeChild(i.firstChild)):typeof j.is=="string"?i=tt.createElement(s,{is:j.is}):(i=tt.createElement(s),s==="select"&&(tt=i,j.multiple?tt.multiple=!0:j.size&&(tt.size=j.size))):i=tt.createElementNS(i,s),i[Of]=o,i[Pf]=j,Aj(i,o,!1,!1),o.stateNode=i;e:{switch(tt=vb(s,j),s){case"dialog":D("cancel",i),D("close",i),_e=j;break;case"iframe":case"object":case"embed":D("load",i),_e=j;break;case"video":case"audio":for(_e=0;_eHj&&(o.flags|=128,j=!0,Ej(lt,!1),o.lanes=4194304)}else{if(!j)if(i=Mh(tt),i!==null){if(o.flags|=128,j=!0,s=i.updateQueue,s!==null&&(o.updateQueue=s,o.flags|=4),Ej(lt,!0),lt.tail===null&<.tailMode==="hidden"&&!tt.alternate&&!I)return S(o),null}else 2*B()-lt.renderingStartTime>Hj&&s!==1073741824&&(o.flags|=128,j=!0,Ej(lt,!1),o.lanes=4194304);lt.isBackwards?(tt.sibling=o.child,o.child=tt):(s=lt.last,s!==null?s.sibling=tt:o.child=tt,lt.last=tt)}return lt.tail!==null?(o=lt.tail,lt.rendering=o,lt.tail=o.sibling,lt.renderingStartTime=B(),o.sibling=null,s=M.current,G(M,j?s&1|2:s&1),o):(S(o),null);case 22:case 23:return Ij(),j=o.memoizedState!==null,i!==null&&i.memoizedState!==null!==j&&(o.flags|=8192),j&&o.mode&1?gj&1073741824&&(S(o),o.subtreeFlags&6&&(o.flags|=8192)):S(o),null;case 24:return null;case 25:return null}throw Error(p$3(156,o.tag))}function Jj(i,o){switch(wg(o),o.tag){case 1:return Zf(o.type)&&$f(),i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 3:return Jh(),E(Wf),E(H),Oh(),i=o.flags,i&65536&&!(i&128)?(o.flags=i&-65537|128,o):null;case 5:return Lh(o),null;case 13:if(E(M),i=o.memoizedState,i!==null&&i.dehydrated!==null){if(o.alternate===null)throw Error(p$3(340));Ig()}return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 19:return E(M),null;case 4:return Jh(),null;case 10:return Rg(o.type._context),null;case 22:case 23:return Ij(),null;case 24:return null;default:return null}}var Kj=!1,U=!1,Lj=typeof WeakSet=="function"?WeakSet:Set,V=null;function Mj(i,o){var s=i.ref;if(s!==null)if(typeof s=="function")try{s(null)}catch(j){W(i,o,j)}else s.current=null}function Nj(i,o,s){try{s()}catch(j){W(i,o,j)}}var Oj=!1;function Pj(i,o){if(Cf=dd,i=Me(),Ne(i)){if("selectionStart"in i)var s={start:i.selectionStart,end:i.selectionEnd};else e:{s=(s=i.ownerDocument)&&s.defaultView||window;var j=s.getSelection&&s.getSelection();if(j&&j.rangeCount!==0){s=j.anchorNode;var _e=j.anchorOffset,lt=j.focusNode;j=j.focusOffset;try{s.nodeType,lt.nodeType}catch{s=null;break e}var tt=0,ot=-1,st=-1,ct=0,it=0,$=i,a=null;t:for(;;){for(var et;$!==s||_e!==0&&$.nodeType!==3||(ot=tt+_e),$!==lt||j!==0&&$.nodeType!==3||(st=tt+j),$.nodeType===3&&(tt+=$.nodeValue.length),(et=$.firstChild)!==null;)a=$,$=et;for(;;){if($===i)break t;if(a===s&&++ct===_e&&(ot=tt),a===lt&&++it===j&&(st=tt),(et=$.nextSibling)!==null)break;$=a,a=$.parentNode}$=et}s=ot===-1||st===-1?null:{start:ot,end:st}}else s=null}s=s||{start:0,end:0}}else s=null;for(Df={focusedElem:i,selectionRange:s},dd=!1,V=o;V!==null;)if(o=V,i=o.child,(o.subtreeFlags&1028)!==0&&i!==null)i.return=o,V=i;else for(;V!==null;){o=V;try{var nt=o.alternate;if(o.flags&1024)switch(o.tag){case 0:case 11:case 15:break;case 1:if(nt!==null){var at=nt.memoizedProps,rt=nt.memoizedState,dt=o.stateNode,ut=dt.getSnapshotBeforeUpdate(o.elementType===o.type?at:Lg(o.type,at),rt);dt.__reactInternalSnapshotBeforeUpdate=ut}break;case 3:var bt=o.stateNode.containerInfo;bt.nodeType===1?bt.textContent="":bt.nodeType===9&&bt.documentElement&&bt.removeChild(bt.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(p$3(163))}}catch(mt){W(o,o.return,mt)}if(i=o.sibling,i!==null){i.return=o.return,V=i;break}V=o.return}return nt=Oj,Oj=!1,nt}function Qj(i,o,s){var j=o.updateQueue;if(j=j!==null?j.lastEffect:null,j!==null){var _e=j=j.next;do{if((_e.tag&i)===i){var lt=_e.destroy;_e.destroy=void 0,lt!==void 0&&Nj(o,s,lt)}_e=_e.next}while(_e!==j)}}function Rj(i,o){if(o=o.updateQueue,o=o!==null?o.lastEffect:null,o!==null){var s=o=o.next;do{if((s.tag&i)===i){var j=s.create;s.destroy=j()}s=s.next}while(s!==o)}}function Sj(i){var o=i.ref;if(o!==null){var s=i.stateNode;switch(i.tag){case 5:i=s;break;default:i=s}typeof o=="function"?o(i):o.current=i}}function Tj(i){var o=i.alternate;o!==null&&(i.alternate=null,Tj(o)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(o=i.stateNode,o!==null&&(delete o[Of],delete o[Pf],delete o[of],delete o[Qf],delete o[Rf])),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}function Uj(i){return i.tag===5||i.tag===3||i.tag===4}function Vj(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||Uj(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Wj(i,o,s){var j=i.tag;if(j===5||j===6)i=i.stateNode,o?s.nodeType===8?s.parentNode.insertBefore(i,o):s.insertBefore(i,o):(s.nodeType===8?(o=s.parentNode,o.insertBefore(i,s)):(o=s,o.appendChild(i)),s=s._reactRootContainer,s!=null||o.onclick!==null||(o.onclick=Bf));else if(j!==4&&(i=i.child,i!==null))for(Wj(i,o,s),i=i.sibling;i!==null;)Wj(i,o,s),i=i.sibling}function Xj(i,o,s){var j=i.tag;if(j===5||j===6)i=i.stateNode,o?s.insertBefore(i,o):s.appendChild(i);else if(j!==4&&(i=i.child,i!==null))for(Xj(i,o,s),i=i.sibling;i!==null;)Xj(i,o,s),i=i.sibling}var X=null,Yj=!1;function Zj(i,o,s){for(s=s.child;s!==null;)ak(i,o,s),s=s.sibling}function ak(i,o,s){if(lc&&typeof lc.onCommitFiberUnmount=="function")try{lc.onCommitFiberUnmount(kc,s)}catch{}switch(s.tag){case 5:U||Mj(s,o);case 6:var j=X,_e=Yj;X=null,Zj(i,o,s),X=j,Yj=_e,X!==null&&(Yj?(i=X,s=s.stateNode,i.nodeType===8?i.parentNode.removeChild(s):i.removeChild(s)):X.removeChild(s.stateNode));break;case 18:X!==null&&(Yj?(i=X,s=s.stateNode,i.nodeType===8?Kf(i.parentNode,s):i.nodeType===1&&Kf(i,s),bd(i)):Kf(X,s.stateNode));break;case 4:j=X,_e=Yj,X=s.stateNode.containerInfo,Yj=!0,Zj(i,o,s),X=j,Yj=_e;break;case 0:case 11:case 14:case 15:if(!U&&(j=s.updateQueue,j!==null&&(j=j.lastEffect,j!==null))){_e=j=j.next;do{var lt=_e,tt=lt.destroy;lt=lt.tag,tt!==void 0&&(lt&2||lt&4)&&Nj(s,o,tt),_e=_e.next}while(_e!==j)}Zj(i,o,s);break;case 1:if(!U&&(Mj(s,o),j=s.stateNode,typeof j.componentWillUnmount=="function"))try{j.props=s.memoizedProps,j.state=s.memoizedState,j.componentWillUnmount()}catch(ot){W(s,o,ot)}Zj(i,o,s);break;case 21:Zj(i,o,s);break;case 22:s.mode&1?(U=(j=U)||s.memoizedState!==null,Zj(i,o,s),U=j):Zj(i,o,s);break;default:Zj(i,o,s)}}function bk(i){var o=i.updateQueue;if(o!==null){i.updateQueue=null;var s=i.stateNode;s===null&&(s=i.stateNode=new Lj),o.forEach(function(j){var _e=ck.bind(null,i,j);s.has(j)||(s.add(j),j.then(_e,_e))})}}function dk(i,o){var s=o.deletions;if(s!==null)for(var j=0;j_e&&(_e=tt),j&=~lt}if(j=_e,j=B()-j,j=(120>j?120:480>j?480:1080>j?1080:1920>j?1920:3e3>j?3e3:4320>j?4320:1960*mk(j/1960))-j,10i?16:i,xk===null)var j=!1;else{if(i=xk,xk=null,yk=0,K&6)throw Error(p$3(331));var _e=K;for(K|=4,V=i.current;V!==null;){var lt=V,tt=lt.child;if(V.flags&16){var ot=lt.deletions;if(ot!==null){for(var st=0;stB()-gk?Lk(i,0):sk|=s),Ek(i,o)}function Zk(i,o){o===0&&(i.mode&1?(o=sc,sc<<=1,!(sc&130023424)&&(sc=4194304)):o=1);var s=L();i=Zg(i,o),i!==null&&(Ac(i,o,s),Ek(i,s))}function vj(i){var o=i.memoizedState,s=0;o!==null&&(s=o.retryLane),Zk(i,s)}function ck(i,o){var s=0;switch(i.tag){case 13:var j=i.stateNode,_e=i.memoizedState;_e!==null&&(s=_e.retryLane);break;case 19:j=i.stateNode;break;default:throw Error(p$3(314))}j!==null&&j.delete(o),Zk(i,s)}var Wk;Wk=function(i,o,s){if(i!==null)if(i.memoizedProps!==o.pendingProps||Wf.current)Ug=!0;else{if(!(i.lanes&s)&&!(o.flags&128))return Ug=!1,zj(i,o,s);Ug=!!(i.flags&131072)}else Ug=!1,I&&o.flags&1048576&&ug(o,ng,o.index);switch(o.lanes=0,o.tag){case 2:var j=o.type;jj(i,o),i=o.pendingProps;var _e=Yf(o,H.current);Tg(o,s),_e=Xh(null,o,j,i,_e,s);var lt=bi();return o.flags|=1,typeof _e=="object"&&_e!==null&&typeof _e.render=="function"&&_e.$$typeof===void 0?(o.tag=1,o.memoizedState=null,o.updateQueue=null,Zf(j)?(lt=!0,cg(o)):lt=!1,o.memoizedState=_e.state!==null&&_e.state!==void 0?_e.state:null,ah(o),_e.updater=nh,o.stateNode=_e,_e._reactInternals=o,rh(o,j,i,s),o=kj(null,o,j,!0,lt,s)):(o.tag=0,I&<&&vg(o),Yi(null,o,_e,s),o=o.child),o;case 16:j=o.elementType;e:{switch(jj(i,o),i=o.pendingProps,_e=j._init,j=_e(j._payload),o.type=j,_e=o.tag=$k(j),i=Lg(j,i),_e){case 0:o=dj(null,o,j,i,s);break e;case 1:o=ij(null,o,j,i,s);break e;case 11:o=Zi(null,o,j,i,s);break e;case 14:o=aj(null,o,j,Lg(j.type,i),s);break e}throw Error(p$3(306,j,""))}return o;case 0:return j=o.type,_e=o.pendingProps,_e=o.elementType===j?_e:Lg(j,_e),dj(i,o,j,_e,s);case 1:return j=o.type,_e=o.pendingProps,_e=o.elementType===j?_e:Lg(j,_e),ij(i,o,j,_e,s);case 3:e:{if(lj(o),i===null)throw Error(p$3(387));j=o.pendingProps,lt=o.memoizedState,_e=lt.element,bh(i,o),gh(o,j,null,s);var tt=o.memoizedState;if(j=tt.element,lt.isDehydrated)if(lt={element:j,isDehydrated:!1,cache:tt.cache,pendingSuspenseBoundaries:tt.pendingSuspenseBoundaries,transitions:tt.transitions},o.updateQueue.baseState=lt,o.memoizedState=lt,o.flags&256){_e=Ki(Error(p$3(423)),o),o=mj(i,o,j,s,_e);break e}else if(j!==_e){_e=Ki(Error(p$3(424)),o),o=mj(i,o,j,s,_e);break e}else for(yg=Lf(o.stateNode.containerInfo.firstChild),xg=o,I=!0,zg=null,s=Ch(o,null,j,s),o.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(Ig(),j===_e){o=$i(i,o,s);break e}Yi(i,o,j,s)}o=o.child}return o;case 5:return Kh(o),i===null&&Eg(o),j=o.type,_e=o.pendingProps,lt=i!==null?i.memoizedProps:null,tt=_e.children,Ef(j,_e)?tt=null:lt!==null&&Ef(j,lt)&&(o.flags|=32),hj(i,o),Yi(i,o,tt,s),o.child;case 6:return i===null&&Eg(o),null;case 13:return pj(i,o,s);case 4:return Ih(o,o.stateNode.containerInfo),j=o.pendingProps,i===null?o.child=Bh(o,null,j,s):Yi(i,o,j,s),o.child;case 11:return j=o.type,_e=o.pendingProps,_e=o.elementType===j?_e:Lg(j,_e),Zi(i,o,j,_e,s);case 7:return Yi(i,o,o.pendingProps,s),o.child;case 8:return Yi(i,o,o.pendingProps.children,s),o.child;case 12:return Yi(i,o,o.pendingProps.children,s),o.child;case 10:e:{if(j=o.type._context,_e=o.pendingProps,lt=o.memoizedProps,tt=_e.value,G(Mg,j._currentValue),j._currentValue=tt,lt!==null)if(He(lt.value,tt)){if(lt.children===_e.children&&!Wf.current){o=$i(i,o,s);break e}}else for(lt=o.child,lt!==null&&(lt.return=o);lt!==null;){var ot=lt.dependencies;if(ot!==null){tt=lt.child;for(var st=ot.firstContext;st!==null;){if(st.context===j){if(lt.tag===1){st=ch(-1,s&-s),st.tag=2;var ct=lt.updateQueue;if(ct!==null){ct=ct.shared;var it=ct.pending;it===null?st.next=st:(st.next=it.next,it.next=st),ct.pending=st}}lt.lanes|=s,st=lt.alternate,st!==null&&(st.lanes|=s),Sg(lt.return,s,o),ot.lanes|=s;break}st=st.next}}else if(lt.tag===10)tt=lt.type===o.type?null:lt.child;else if(lt.tag===18){if(tt=lt.return,tt===null)throw Error(p$3(341));tt.lanes|=s,ot=tt.alternate,ot!==null&&(ot.lanes|=s),Sg(tt,s,o),tt=lt.sibling}else tt=lt.child;if(tt!==null)tt.return=lt;else for(tt=lt;tt!==null;){if(tt===o){tt=null;break}if(lt=tt.sibling,lt!==null){lt.return=tt.return,tt=lt;break}tt=tt.return}lt=tt}Yi(i,o,_e.children,s),o=o.child}return o;case 9:return _e=o.type,j=o.pendingProps.children,Tg(o,s),_e=Vg(_e),j=j(_e),o.flags|=1,Yi(i,o,j,s),o.child;case 14:return j=o.type,_e=Lg(j,o.pendingProps),_e=Lg(j.type,_e),aj(i,o,j,_e,s);case 15:return cj(i,o,o.type,o.pendingProps,s);case 17:return j=o.type,_e=o.pendingProps,_e=o.elementType===j?_e:Lg(j,_e),jj(i,o),o.tag=1,Zf(j)?(i=!0,cg(o)):i=!1,Tg(o,s),ph(o,j,_e),rh(o,j,_e,s),kj(null,o,j,!0,i,s);case 19:return yj(i,o,s);case 22:return ej(i,o,s)}throw Error(p$3(156,o.tag))};function Gk(i,o){return ac(i,o)}function al(i,o,s,j){this.tag=i,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=j,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Bg(i,o,s,j){return new al(i,o,s,j)}function bj(i){return i=i.prototype,!(!i||!i.isReactComponent)}function $k(i){if(typeof i=="function")return bj(i)?1:0;if(i!=null){if(i=i.$$typeof,i===Da)return 11;if(i===Ga)return 14}return 2}function wh(i,o){var s=i.alternate;return s===null?(s=Bg(i.tag,o,i.key,i.mode),s.elementType=i.elementType,s.type=i.type,s.stateNode=i.stateNode,s.alternate=i,i.alternate=s):(s.pendingProps=o,s.type=i.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=i.flags&14680064,s.childLanes=i.childLanes,s.lanes=i.lanes,s.child=i.child,s.memoizedProps=i.memoizedProps,s.memoizedState=i.memoizedState,s.updateQueue=i.updateQueue,o=i.dependencies,s.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},s.sibling=i.sibling,s.index=i.index,s.ref=i.ref,s}function yh(i,o,s,j,_e,lt){var tt=2;if(j=i,typeof i=="function")bj(i)&&(tt=1);else if(typeof i=="string")tt=5;else e:switch(i){case ya:return Ah(s.children,_e,lt,o);case za:tt=8,_e|=8;break;case Aa:return i=Bg(12,s,o,_e|2),i.elementType=Aa,i.lanes=lt,i;case Ea:return i=Bg(13,s,o,_e),i.elementType=Ea,i.lanes=lt,i;case Fa:return i=Bg(19,s,o,_e),i.elementType=Fa,i.lanes=lt,i;case Ia:return qj(s,_e,lt,o);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case Ba:tt=10;break e;case Ca:tt=9;break e;case Da:tt=11;break e;case Ga:tt=14;break e;case Ha:tt=16,j=null;break e}throw Error(p$3(130,i==null?i:typeof i,""))}return o=Bg(tt,s,o,_e),o.elementType=i,o.type=j,o.lanes=lt,o}function Ah(i,o,s,j){return i=Bg(7,i,j,o),i.lanes=s,i}function qj(i,o,s,j){return i=Bg(22,i,j,o),i.elementType=Ia,i.lanes=s,i.stateNode={isHidden:!1},i}function xh(i,o,s){return i=Bg(6,i,null,o),i.lanes=s,i}function zh(i,o,s){return o=Bg(4,i.children!==null?i.children:[],i.key,o),o.lanes=s,o.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},o}function bl(i,o,s,j,_e){this.tag=o,this.containerInfo=i,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=zc(0),this.expirationTimes=zc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=zc(0),this.identifierPrefix=j,this.onRecoverableError=_e,this.mutableSourceEagerHydrationData=null}function cl(i,o,s,j,_e,lt,tt,ot,st){return i=new bl(i,o,s,ot,st),o===1?(o=1,lt===!0&&(o|=8)):o=0,lt=Bg(3,null,null,o),i.current=lt,lt.stateNode=i,lt.memoizedState={element:j,isDehydrated:s,cache:null,transitions:null,pendingSuspenseBoundaries:null},ah(lt),i}function dl(i,o,s){var j=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE)}catch(i){console.error(i)}}checkDCE(),reactDom.exports=reactDom_production_min;var reactDomExports=reactDom.exports;const ReactDOM=getDefaultExportFromCjs(reactDomExports);var m$3=reactDomExports;client.createRoot=m$3.createRoot,client.hydrateRoot=m$3.hydrateRoot;const common={black:"#000",white:"#fff"},common$1=common,red={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},red$1=red,purple={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},purple$1=purple,blue={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},blue$1=blue,lightBlue={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},lightBlue$1=lightBlue,green={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},green$1=green,orange={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},orange$1=orange,grey={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},grey$1=grey;function formatMuiErrorMessage$1(i){let o="https://mui.com/production-error/?code="+i;for(let s=1;s=0)&&(s[_e]=i[_e]);return s}function memoize$1(i){var o=Object.create(null);return function(s){return o[s]===void 0&&(o[s]=i(s)),o[s]}}var reactPropsRegex=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,isPropValid=memoize$1(function(i){return reactPropsRegex.test(i)||i.charCodeAt(0)===111&&i.charCodeAt(1)===110&&i.charCodeAt(2)<91});function sheetForTag(i){if(i.sheet)return i.sheet;for(var o=0;o0?charat(characters,--position):0,column--,character===10&&(column=1,line--),character}function next(){return character=position2||token(character)>3?"":" "}function escaping(i,o){for(;--o&&next()&&!(character<48||character>102||character>57&&character<65||character>70&&character<97););return slice(i,caret()+(o<6&&peek()==32&&next()==32))}function delimiter(i){for(;next();)switch(character){case i:return position;case 34:case 39:i!==34&&i!==39&&delimiter(character);break;case 40:i===41&&delimiter(i);break;case 92:next();break}return position}function commenter(i,o){for(;next()&&i+character!==57;)if(i+character===84&&peek()===47)break;return"/*"+slice(o,position-1)+"*"+from(i===47?i:next())}function identifier(i){for(;!token(peek());)next();return slice(i,position)}function compile(i){return dealloc(parse("",null,null,null,[""],i=alloc(i),0,[0],i))}function parse(i,o,s,j,_e,lt,tt,ot,st){for(var ct=0,it=0,$=tt,a=0,et=0,nt=0,at=1,rt=1,dt=1,ut=0,bt="",mt=_e,pt=lt,Zt=j,ht=bt;rt;)switch(nt=ut,ut=next()){case 40:if(nt!=108&&charat(ht,$-1)==58){indexof(ht+=replace(delimit(ut),"&","&\f"),"&\f")!=-1&&(dt=-1);break}case 34:case 39:case 91:ht+=delimit(ut);break;case 9:case 10:case 13:case 32:ht+=whitespace(nt);break;case 92:ht+=escaping(caret()-1,7);continue;case 47:switch(peek()){case 42:case 47:append(comment(commenter(next(),caret()),o,s),st);break;default:ht+="/"}break;case 123*at:ot[ct++]=strlen(ht)*dt;case 125*at:case 59:case 0:switch(ut){case 0:case 125:rt=0;case 59+it:dt==-1&&(ht=replace(ht,/\f/g,"")),et>0&&strlen(ht)-$&&append(et>32?declaration(ht+";",j,s,$-1):declaration(replace(ht," ","")+";",j,s,$-2),st);break;case 59:ht+=";";default:if(append(Zt=ruleset(ht,o,s,ct,it,_e,ot,bt,mt=[],pt=[],$),lt),ut===123)if(it===0)parse(ht,o,Zt,Zt,mt,lt,$,ot,pt);else switch(a===99&&charat(ht,3)===110?100:a){case 100:case 108:case 109:case 115:parse(i,Zt,Zt,j&&append(ruleset(i,Zt,Zt,0,0,_e,ot,bt,_e,mt=[],$),pt),_e,pt,$,ot,j?mt:pt);break;default:parse(ht,Zt,Zt,Zt,[""],pt,0,ot,pt)}}ct=it=et=0,at=dt=1,bt=ht="",$=tt;break;case 58:$=1+strlen(ht),et=nt;default:if(at<1){if(ut==123)--at;else if(ut==125&&at++==0&&prev()==125)continue}switch(ht+=from(ut),ut*at){case 38:dt=it>0?1:(ht+="\f",-1);break;case 44:ot[ct++]=(strlen(ht)-1)*dt,dt=1;break;case 64:peek()===45&&(ht+=delimit(next())),a=peek(),it=$=strlen(bt=ht+=identifier(caret())),ut++;break;case 45:nt===45&&strlen(ht)==2&&(at=0)}}return lt}function ruleset(i,o,s,j,_e,lt,tt,ot,st,ct,it){for(var $=_e-1,a=_e===0?lt:[""],et=sizeof(a),nt=0,at=0,rt=0;nt0?a[dt]+" "+ut:replace(ut,/&\f/g,a[dt])))&&(st[rt++]=bt);return node(i,o,s,_e===0?RULESET:ot,st,ct,it)}function comment(i,o,s){return node(i,o,s,COMMENT,from(char()),substr(i,2,-2),0)}function declaration(i,o,s,j){return node(i,o,s,DECLARATION,substr(i,0,j),substr(i,j+1,-1),j)}function serialize(i,o){for(var s="",j=sizeof(i),_e=0;_e6)switch(charat(i,o+1)){case 109:if(charat(i,o+4)!==45)break;case 102:return replace(i,/(.+:)(.+)-([^]+)/,"$1"+WEBKIT+"$2-$3$1"+MOZ+(charat(i,o+3)==108?"$3":"$2-$3"))+i;case 115:return~indexof(i,"stretch")?prefix(replace(i,"stretch","fill-available"),o)+i:i}break;case 4949:if(charat(i,o+1)!==115)break;case 6444:switch(charat(i,strlen(i)-3-(~indexof(i,"!important")&&10))){case 107:return replace(i,":",":"+WEBKIT)+i;case 101:return replace(i,/(.+:)([^;!]+)(;|!.+)?/,"$1"+WEBKIT+(charat(i,14)===45?"inline-":"")+"box$3$1"+WEBKIT+"$2$3$1"+MS+"$2box$3")+i}break;case 5936:switch(charat(i,o+11)){case 114:return WEBKIT+i+MS+replace(i,/[svh]\w+-[tblr]{2}/,"tb")+i;case 108:return WEBKIT+i+MS+replace(i,/[svh]\w+-[tblr]{2}/,"tb-rl")+i;case 45:return WEBKIT+i+MS+replace(i,/[svh]\w+-[tblr]{2}/,"lr")+i}return WEBKIT+i+MS+i+i}return i}var prefixer=function(o,s,j,_e){if(o.length>-1&&!o.return)switch(o.type){case DECLARATION:o.return=prefix(o.value,o.length);break;case KEYFRAMES:return serialize([copy(o,{value:replace(o.value,"@","@"+WEBKIT)})],_e);case RULESET:if(o.length)return combine(o.props,function(lt){switch(match(lt,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return serialize([copy(o,{props:[replace(lt,/:(read-\w+)/,":"+MOZ+"$1")]})],_e);case"::placeholder":return serialize([copy(o,{props:[replace(lt,/:(plac\w+)/,":"+WEBKIT+"input-$1")]}),copy(o,{props:[replace(lt,/:(plac\w+)/,":"+MOZ+"$1")]}),copy(o,{props:[replace(lt,/:(plac\w+)/,MS+"input-$1")]})],_e)}return""})}},defaultStylisPlugins=[prefixer],createCache=function(o){var s=o.key;if(s==="css"){var j=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(j,function(at){var rt=at.getAttribute("data-emotion");rt.indexOf(" ")!==-1&&(document.head.appendChild(at),at.setAttribute("data-s",""))})}var _e=o.stylisPlugins||defaultStylisPlugins,lt={},tt,ot=[];tt=o.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+s+' "]'),function(at){for(var rt=at.getAttribute("data-emotion").split(" "),dt=1;dt=4;++j,_e-=4)s=i.charCodeAt(j)&255|(i.charCodeAt(++j)&255)<<8|(i.charCodeAt(++j)&255)<<16|(i.charCodeAt(++j)&255)<<24,s=(s&65535)*1540483477+((s>>>16)*59797<<16),s^=s>>>24,o=(s&65535)*1540483477+((s>>>16)*59797<<16)^(o&65535)*1540483477+((o>>>16)*59797<<16);switch(_e){case 3:o^=(i.charCodeAt(j+2)&255)<<16;case 2:o^=(i.charCodeAt(j+1)&255)<<8;case 1:o^=i.charCodeAt(j)&255,o=(o&65535)*1540483477+((o>>>16)*59797<<16)}return o^=o>>>13,o=(o&65535)*1540483477+((o>>>16)*59797<<16),((o^o>>>15)>>>0).toString(36)}var unitlessKeys={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},hyphenateRegex=/[A-Z]|^ms/g,animationRegex=/_EMO_([^_]+?)_([^]*?)_EMO_/g,isCustomProperty=function(o){return o.charCodeAt(1)===45},isProcessableValue=function(o){return o!=null&&typeof o!="boolean"},processStyleName=memoize$1(function(i){return isCustomProperty(i)?i:i.replace(hyphenateRegex,"-$&").toLowerCase()}),processStyleValue=function(o,s){switch(o){case"animation":case"animationName":if(typeof s=="string")return s.replace(animationRegex,function(j,_e,lt){return cursor={name:_e,styles:lt,next:cursor},_e})}return unitlessKeys[o]!==1&&!isCustomProperty(o)&&typeof s=="number"&&s!==0?s+"px":s},noComponentSelectorMessage="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function handleInterpolation(i,o,s){if(s==null)return"";if(s.__emotion_styles!==void 0)return s;switch(typeof s){case"boolean":return"";case"object":{if(s.anim===1)return cursor={name:s.name,styles:s.styles,next:cursor},s.name;if(s.styles!==void 0){var j=s.next;if(j!==void 0)for(;j!==void 0;)cursor={name:j.name,styles:j.styles,next:cursor},j=j.next;var _e=s.styles+";";return _e}return createStringFromObject(i,o,s)}case"function":{if(i!==void 0){var lt=cursor,tt=s(i);return cursor=lt,handleInterpolation(i,o,tt)}break}}if(o==null)return s;var ot=o[s];return ot!==void 0?ot:s}function createStringFromObject(i,o,s){var j="";if(Array.isArray(s))for(var _e=0;_e96?testOmitPropsOnStringTag:testOmitPropsOnComponent},composeShouldForwardProps=function(o,s,j){var _e;if(s){var lt=s.shouldForwardProp;_e=o.__emotion_forwardProp&<?function(tt){return o.__emotion_forwardProp(tt)&<(tt)}:lt}return typeof _e!="function"&&j&&(_e=o.__emotion_forwardProp),_e},Insertion=function(o){var s=o.cache,j=o.serialized,_e=o.isStringTag;return registerStyles(s,j,_e),useInsertionEffectAlwaysWithSyncFallback(function(){return insertStyles(s,j,_e)}),null},createStyled$2=function i(o,s){var j=o.__emotion_real===o,_e=j&&o.__emotion_base||o,lt,tt;s!==void 0&&(lt=s.label,tt=s.target);var ot=composeShouldForwardProps(o,s,j),st=ot||getDefaultShouldForwardProp(_e),ct=!st("as");return function(){var it=arguments,$=j&&o.__emotion_styles!==void 0?o.__emotion_styles.slice(0):[];if(lt!==void 0&&$.push("label:"+lt+";"),it[0]==null||it[0].raw===void 0)$.push.apply($,it);else{$.push(it[0][0]);for(var a=it.length,et=1;eto(isEmpty$4(_e)?s:_e):o;return jsxRuntimeExports.jsx(Global,{styles:j})}function styled$1(i,o){return newStyled(i,o)}const internal_processStyles=(i,o)=>{Array.isArray(i.__emotion_styles)&&(i.__emotion_styles=o(i.__emotion_styles))},styledEngine=Object.freeze(Object.defineProperty({__proto__:null,GlobalStyles:GlobalStyles$2,StyledEngineProvider,ThemeContext,css,default:styled$1,internal_processStyles,keyframes},Symbol.toStringTag,{value:"Module"}));function isPlainObject(i){if(typeof i!="object"||i===null)return!1;const o=Object.getPrototypeOf(i);return(o===null||o===Object.prototype||Object.getPrototypeOf(o)===null)&&!(Symbol.toStringTag in i)&&!(Symbol.iterator in i)}function deepClone(i){if(!isPlainObject(i))return i;const o={};return Object.keys(i).forEach(s=>{o[s]=deepClone(i[s])}),o}function deepmerge$1(i,o,s={clone:!0}){const j=s.clone?_extends$1({},i):i;return isPlainObject(i)&&isPlainObject(o)&&Object.keys(o).forEach(_e=>{_e!=="__proto__"&&(isPlainObject(o[_e])&&_e in i&&isPlainObject(i[_e])?j[_e]=deepmerge$1(i[_e],o[_e],s):s.clone?j[_e]=isPlainObject(o[_e])?deepClone(o[_e]):o[_e]:j[_e]=o[_e])}),j}const deepmerge=Object.freeze(Object.defineProperty({__proto__:null,default:deepmerge$1,isPlainObject},Symbol.toStringTag,{value:"Module"})),_excluded$K=["values","unit","step"],sortBreakpointsValues=i=>{const o=Object.keys(i).map(s=>({key:s,val:i[s]}))||[];return o.sort((s,j)=>s.val-j.val),o.reduce((s,j)=>_extends$1({},s,{[j.key]:j.val}),{})};function createBreakpoints(i){const{values:o={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:s="px",step:j=5}=i,_e=_objectWithoutPropertiesLoose(i,_excluded$K),lt=sortBreakpointsValues(o),tt=Object.keys(lt);function ot(a){return`@media (min-width:${typeof o[a]=="number"?o[a]:a}${s})`}function st(a){return`@media (max-width:${(typeof o[a]=="number"?o[a]:a)-j/100}${s})`}function ct(a,et){const nt=tt.indexOf(et);return`@media (min-width:${typeof o[a]=="number"?o[a]:a}${s}) and (max-width:${(nt!==-1&&typeof o[tt[nt]]=="number"?o[tt[nt]]:et)-j/100}${s})`}function it(a){return tt.indexOf(a)+1`@media (min-width:${values$1[i]}px)`};function handleBreakpoints(i,o,s){const j=i.theme||{};if(Array.isArray(o)){const lt=j.breakpoints||defaultBreakpoints;return o.reduce((tt,ot,st)=>(tt[lt.up(lt.keys[st])]=s(o[st]),tt),{})}if(typeof o=="object"){const lt=j.breakpoints||defaultBreakpoints;return Object.keys(o).reduce((tt,ot)=>{if(Object.keys(lt.values||values$1).indexOf(ot)!==-1){const st=lt.up(ot);tt[st]=s(o[ot],ot)}else{const st=ot;tt[st]=o[st]}return tt},{})}return s(o)}function createEmptyBreakpointObject(i={}){var o;return((o=i.keys)==null?void 0:o.reduce((j,_e)=>{const lt=i.up(_e);return j[lt]={},j},{}))||{}}function removeUnusedBreakpoints(i,o){return i.reduce((s,j)=>{const _e=s[j];return(!_e||Object.keys(_e).length===0)&&delete s[j],s},o)}function capitalize$1(i){if(typeof i!="string")throw new Error(formatMuiErrorMessage$1(7));return i.charAt(0).toUpperCase()+i.slice(1)}const capitalize=Object.freeze(Object.defineProperty({__proto__:null,default:capitalize$1},Symbol.toStringTag,{value:"Module"}));function getPath(i,o,s=!0){if(!o||typeof o!="string")return null;if(i&&i.vars&&s){const j=`vars.${o}`.split(".").reduce((_e,lt)=>_e&&_e[lt]?_e[lt]:null,i);if(j!=null)return j}return o.split(".").reduce((j,_e)=>j&&j[_e]!=null?j[_e]:null,i)}function getStyleValue$1(i,o,s,j=s){let _e;return typeof i=="function"?_e=i(s):Array.isArray(i)?_e=i[s]||j:_e=getPath(i,s)||j,o&&(_e=o(_e,j,i)),_e}function style$1(i){const{prop:o,cssProperty:s=i.prop,themeKey:j,transform:_e}=i,lt=tt=>{if(tt[o]==null)return null;const ot=tt[o],st=tt.theme,ct=getPath(st,j)||{};return handleBreakpoints(tt,ot,$=>{let a=getStyleValue$1(ct,_e,$);return $===a&&typeof $=="string"&&(a=getStyleValue$1(ct,_e,`${o}${$==="default"?"":capitalize$1($)}`,$)),s===!1?a:{[s]:a}})};return lt.propTypes={},lt.filterProps=[o],lt}function memoize(i){const o={};return s=>(o[s]===void 0&&(o[s]=i(s)),o[s])}const properties={m:"margin",p:"padding"},directions={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},aliases={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},getCssProperties=memoize(i=>{if(i.length>2)if(aliases[i])i=aliases[i];else return[i];const[o,s]=i.split(""),j=properties[o],_e=directions[s]||"";return Array.isArray(_e)?_e.map(lt=>j+lt):[j+_e]}),marginKeys=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],paddingKeys=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...marginKeys,...paddingKeys];function createUnaryUnit(i,o,s,j){var _e;const lt=(_e=getPath(i,o,!1))!=null?_e:s;return typeof lt=="number"?tt=>typeof tt=="string"?tt:lt*tt:Array.isArray(lt)?tt=>typeof tt=="string"?tt:lt[tt]:typeof lt=="function"?lt:()=>{}}function createUnarySpacing(i){return createUnaryUnit(i,"spacing",8)}function getValue(i,o){if(typeof o=="string"||o==null)return o;const s=Math.abs(o),j=i(s);return o>=0?j:typeof j=="number"?-j:`-${j}`}function getStyleFromPropValue(i,o){return s=>i.reduce((j,_e)=>(j[_e]=getValue(o,s),j),{})}function resolveCssProperty(i,o,s,j){if(o.indexOf(s)===-1)return null;const _e=getCssProperties(s),lt=getStyleFromPropValue(_e,j),tt=i[s];return handleBreakpoints(i,tt,lt)}function style(i,o){const s=createUnarySpacing(i.theme);return Object.keys(i).map(j=>resolveCssProperty(i,o,j,s)).reduce(merge,{})}function margin(i){return style(i,marginKeys)}margin.propTypes={};margin.filterProps=marginKeys;function padding(i){return style(i,paddingKeys)}padding.propTypes={};padding.filterProps=paddingKeys;function createSpacing(i=8){if(i.mui)return i;const o=createUnarySpacing({spacing:i}),s=(...j)=>(j.length===0?[1]:j).map(lt=>{const tt=o(lt);return typeof tt=="number"?`${tt}px`:tt}).join(" ");return s.mui=!0,s}function compose(...i){const o=i.reduce((j,_e)=>(_e.filterProps.forEach(lt=>{j[lt]=_e}),j),{}),s=j=>Object.keys(j).reduce((_e,lt)=>o[lt]?merge(_e,o[lt](j)):_e,{});return s.propTypes={},s.filterProps=i.reduce((j,_e)=>j.concat(_e.filterProps),[]),s}function borderTransform(i){return typeof i!="number"?i:`${i}px solid`}function createBorderStyle(i,o){return style$1({prop:i,themeKey:"borders",transform:o})}const border=createBorderStyle("border",borderTransform),borderTop=createBorderStyle("borderTop",borderTransform),borderRight=createBorderStyle("borderRight",borderTransform),borderBottom=createBorderStyle("borderBottom",borderTransform),borderLeft=createBorderStyle("borderLeft",borderTransform),borderColor=createBorderStyle("borderColor"),borderTopColor=createBorderStyle("borderTopColor"),borderRightColor=createBorderStyle("borderRightColor"),borderBottomColor=createBorderStyle("borderBottomColor"),borderLeftColor=createBorderStyle("borderLeftColor"),outline=createBorderStyle("outline",borderTransform),outlineColor=createBorderStyle("outlineColor"),borderRadius=i=>{if(i.borderRadius!==void 0&&i.borderRadius!==null){const o=createUnaryUnit(i.theme,"shape.borderRadius",4),s=j=>({borderRadius:getValue(o,j)});return handleBreakpoints(i,i.borderRadius,s)}return null};borderRadius.propTypes={};borderRadius.filterProps=["borderRadius"];compose(border,borderTop,borderRight,borderBottom,borderLeft,borderColor,borderTopColor,borderRightColor,borderBottomColor,borderLeftColor,borderRadius,outline,outlineColor);const gap=i=>{if(i.gap!==void 0&&i.gap!==null){const o=createUnaryUnit(i.theme,"spacing",8),s=j=>({gap:getValue(o,j)});return handleBreakpoints(i,i.gap,s)}return null};gap.propTypes={};gap.filterProps=["gap"];const columnGap=i=>{if(i.columnGap!==void 0&&i.columnGap!==null){const o=createUnaryUnit(i.theme,"spacing",8),s=j=>({columnGap:getValue(o,j)});return handleBreakpoints(i,i.columnGap,s)}return null};columnGap.propTypes={};columnGap.filterProps=["columnGap"];const rowGap=i=>{if(i.rowGap!==void 0&&i.rowGap!==null){const o=createUnaryUnit(i.theme,"spacing",8),s=j=>({rowGap:getValue(o,j)});return handleBreakpoints(i,i.rowGap,s)}return null};rowGap.propTypes={};rowGap.filterProps=["rowGap"];const gridColumn=style$1({prop:"gridColumn"}),gridRow=style$1({prop:"gridRow"}),gridAutoFlow=style$1({prop:"gridAutoFlow"}),gridAutoColumns=style$1({prop:"gridAutoColumns"}),gridAutoRows=style$1({prop:"gridAutoRows"}),gridTemplateColumns=style$1({prop:"gridTemplateColumns"}),gridTemplateRows=style$1({prop:"gridTemplateRows"}),gridTemplateAreas=style$1({prop:"gridTemplateAreas"}),gridArea=style$1({prop:"gridArea"});compose(gap,columnGap,rowGap,gridColumn,gridRow,gridAutoFlow,gridAutoColumns,gridAutoRows,gridTemplateColumns,gridTemplateRows,gridTemplateAreas,gridArea);function paletteTransform(i,o){return o==="grey"?o:i}const color=style$1({prop:"color",themeKey:"palette",transform:paletteTransform}),bgcolor=style$1({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:paletteTransform}),backgroundColor=style$1({prop:"backgroundColor",themeKey:"palette",transform:paletteTransform});compose(color,bgcolor,backgroundColor);function sizingTransform(i){return i<=1&&i!==0?`${i*100}%`:i}const width=style$1({prop:"width",transform:sizingTransform}),maxWidth=i=>{if(i.maxWidth!==void 0&&i.maxWidth!==null){const o=s=>{var j,_e;const lt=((j=i.theme)==null||(j=j.breakpoints)==null||(j=j.values)==null?void 0:j[s])||values$1[s];return lt?((_e=i.theme)==null||(_e=_e.breakpoints)==null?void 0:_e.unit)!=="px"?{maxWidth:`${lt}${i.theme.breakpoints.unit}`}:{maxWidth:lt}:{maxWidth:sizingTransform(s)}};return handleBreakpoints(i,i.maxWidth,o)}return null};maxWidth.filterProps=["maxWidth"];const minWidth=style$1({prop:"minWidth",transform:sizingTransform}),height=style$1({prop:"height",transform:sizingTransform}),maxHeight=style$1({prop:"maxHeight",transform:sizingTransform}),minHeight=style$1({prop:"minHeight",transform:sizingTransform});style$1({prop:"size",cssProperty:"width",transform:sizingTransform});style$1({prop:"size",cssProperty:"height",transform:sizingTransform});const boxSizing=style$1({prop:"boxSizing"});compose(width,maxWidth,minWidth,height,maxHeight,minHeight,boxSizing);const defaultSxConfig={border:{themeKey:"borders",transform:borderTransform},borderTop:{themeKey:"borders",transform:borderTransform},borderRight:{themeKey:"borders",transform:borderTransform},borderBottom:{themeKey:"borders",transform:borderTransform},borderLeft:{themeKey:"borders",transform:borderTransform},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:borderTransform},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:borderRadius},color:{themeKey:"palette",transform:paletteTransform},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:paletteTransform},backgroundColor:{themeKey:"palette",transform:paletteTransform},p:{style:padding},pt:{style:padding},pr:{style:padding},pb:{style:padding},pl:{style:padding},px:{style:padding},py:{style:padding},padding:{style:padding},paddingTop:{style:padding},paddingRight:{style:padding},paddingBottom:{style:padding},paddingLeft:{style:padding},paddingX:{style:padding},paddingY:{style:padding},paddingInline:{style:padding},paddingInlineStart:{style:padding},paddingInlineEnd:{style:padding},paddingBlock:{style:padding},paddingBlockStart:{style:padding},paddingBlockEnd:{style:padding},m:{style:margin},mt:{style:margin},mr:{style:margin},mb:{style:margin},ml:{style:margin},mx:{style:margin},my:{style:margin},margin:{style:margin},marginTop:{style:margin},marginRight:{style:margin},marginBottom:{style:margin},marginLeft:{style:margin},marginX:{style:margin},marginY:{style:margin},marginInline:{style:margin},marginInlineStart:{style:margin},marginInlineEnd:{style:margin},marginBlock:{style:margin},marginBlockStart:{style:margin},marginBlockEnd:{style:margin},displayPrint:{cssProperty:!1,transform:i=>({"@media print":{display:i}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:gap},rowGap:{style:rowGap},columnGap:{style:columnGap},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:sizingTransform},maxWidth:{style:maxWidth},minWidth:{transform:sizingTransform},height:{transform:sizingTransform},maxHeight:{transform:sizingTransform},minHeight:{transform:sizingTransform},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}},defaultSxConfig$1=defaultSxConfig;function objectsHaveSameKeys(...i){const o=i.reduce((j,_e)=>j.concat(Object.keys(_e)),[]),s=new Set(o);return i.every(j=>s.size===Object.keys(j).length)}function callIfFn(i,o){return typeof i=="function"?i(o):i}function unstable_createStyleFunctionSx(){function i(s,j,_e,lt){const tt={[s]:j,theme:_e},ot=lt[s];if(!ot)return{[s]:j};const{cssProperty:st=s,themeKey:ct,transform:it,style:$}=ot;if(j==null)return null;if(ct==="typography"&&j==="inherit")return{[s]:j};const a=getPath(_e,ct)||{};return $?$(tt):handleBreakpoints(tt,j,nt=>{let at=getStyleValue$1(a,it,nt);return nt===at&&typeof nt=="string"&&(at=getStyleValue$1(a,it,`${s}${nt==="default"?"":capitalize$1(nt)}`,nt)),st===!1?at:{[st]:at}})}function o(s){var j;const{sx:_e,theme:lt={}}=s||{};if(!_e)return null;const tt=(j=lt.unstable_sxConfig)!=null?j:defaultSxConfig$1;function ot(st){let ct=st;if(typeof st=="function")ct=st(lt);else if(typeof st!="object")return st;if(!ct)return null;const it=createEmptyBreakpointObject(lt.breakpoints),$=Object.keys(it);let a=it;return Object.keys(ct).forEach(et=>{const nt=callIfFn(ct[et],lt);if(nt!=null)if(typeof nt=="object")if(tt[et])a=merge(a,i(et,nt,lt,tt));else{const at=handleBreakpoints({theme:lt},nt,rt=>({[et]:rt}));objectsHaveSameKeys(at,nt)?a[et]=o({sx:nt,theme:lt}):a=merge(a,at)}else a=merge(a,i(et,nt,lt,tt))}),removeUnusedBreakpoints($,a)}return Array.isArray(_e)?_e.map(ot):ot(_e)}return o}const styleFunctionSx$1=unstable_createStyleFunctionSx();styleFunctionSx$1.filterProps=["sx"];const styleFunctionSx$2=styleFunctionSx$1;function applyStyles$2(i,o){const s=this;return s.vars&&typeof s.getColorSchemeSelector=="function"?{[s.getColorSchemeSelector(i).replace(/(\[[^\]]+\])/,"*:where($1)")]:o}:s.palette.mode===i?o:{}}const _excluded$J=["breakpoints","palette","spacing","shape"];function createTheme$2(i={},...o){const{breakpoints:s={},palette:j={},spacing:_e,shape:lt={}}=i,tt=_objectWithoutPropertiesLoose(i,_excluded$J),ot=createBreakpoints(s),st=createSpacing(_e);let ct=deepmerge$1({breakpoints:ot,direction:"ltr",components:{},palette:_extends$1({mode:"light"},j),spacing:st,shape:_extends$1({},shape$1,lt)},tt);return ct.applyStyles=applyStyles$2,ct=o.reduce((it,$)=>deepmerge$1(it,$),ct),ct.unstable_sxConfig=_extends$1({},defaultSxConfig$1,tt==null?void 0:tt.unstable_sxConfig),ct.unstable_sx=function($){return styleFunctionSx$2({sx:$,theme:this})},ct}const createTheme$1=Object.freeze(Object.defineProperty({__proto__:null,default:createTheme$2,private_createBreakpoints:createBreakpoints,unstable_applyStyles:applyStyles$2},Symbol.toStringTag,{value:"Module"}));function isObjectEmpty$1(i){return Object.keys(i).length===0}function useTheme$3(i=null){const o=reactExports.useContext(ThemeContext);return!o||isObjectEmpty$1(o)?i:o}const systemDefaultTheme$1=createTheme$2();function useTheme$2(i=systemDefaultTheme$1){return useTheme$3(i)}function GlobalStyles$1({styles:i,themeId:o,defaultTheme:s={}}){const j=useTheme$2(s),_e=typeof i=="function"?i(o&&j[o]||j):i;return jsxRuntimeExports.jsx(GlobalStyles$2,{styles:_e})}const _excluded$I=["sx"],splitProps=i=>{var o,s;const j={systemProps:{},otherProps:{}},_e=(o=i==null||(s=i.theme)==null?void 0:s.unstable_sxConfig)!=null?o:defaultSxConfig$1;return Object.keys(i).forEach(lt=>{_e[lt]?j.systemProps[lt]=i[lt]:j.otherProps[lt]=i[lt]}),j};function extendSxProp(i){const{sx:o}=i,s=_objectWithoutPropertiesLoose(i,_excluded$I),{systemProps:j,otherProps:_e}=splitProps(s);let lt;return Array.isArray(o)?lt=[j,...o]:typeof o=="function"?lt=(...tt)=>{const ot=o(...tt);return isPlainObject(ot)?_extends$1({},j,ot):j}:lt=_extends$1({},j,o),_extends$1({},_e,{sx:lt})}const styleFunctionSx=Object.freeze(Object.defineProperty({__proto__:null,default:styleFunctionSx$2,extendSxProp,unstable_createStyleFunctionSx,unstable_defaultSxConfig:defaultSxConfig$1},Symbol.toStringTag,{value:"Module"})),defaultGenerator=i=>i,createClassNameGenerator=()=>{let i=defaultGenerator;return{configure(o){i=o},generate(o){return i(o)},reset(){i=defaultGenerator}}},ClassNameGenerator=createClassNameGenerator();function r(i){var o,s,j="";if(typeof i=="string"||typeof i=="number")j+=i;else if(typeof i=="object")if(Array.isArray(i)){var _e=i.length;for(o=0;o<_e;o++)i[o]&&(s=r(i[o]))&&(j&&(j+=" "),j+=s)}else for(s in i)i[s]&&(j&&(j+=" "),j+=s);return j}function clsx(){for(var i,o,s=0,j="",_e=arguments.length;s<_e;s++)(i=arguments[s])&&(o=r(i))&&(j&&(j+=" "),j+=o);return j}const globalStateClasses={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function generateUtilityClass$1(i,o,s="Mui"){const j=globalStateClasses[o];return j?`${s}-${j}`:`${ClassNameGenerator.generate(i)}-${o}`}function generateUtilityClasses$1(i,o,s="Mui"){const j={};return o.forEach(_e=>{j[_e]=generateUtilityClass$1(i,_e,s)}),j}var reactIs={exports:{}},reactIs_production_min={};/** * @license React * react-is.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var b=Symbol.for("react.element"),c=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),e=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),g=Symbol.for("react.provider"),h=Symbol.for("react.context"),k=Symbol.for("react.server_context"),l=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),n=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),q=Symbol.for("react.lazy"),t=Symbol.for("react.offscreen"),u;u=Symbol.for("react.module.reference");function v(i){if(typeof i=="object"&&i!==null){var o=i.$$typeof;switch(o){case b:switch(i=i.type,i){case d:case f:case e:case m:case n:return i;default:switch(i=i&&i.$$typeof,i){case k:case h:case l:case q:case p:case g:return i;default:return o}}case c:return o}}}reactIs_production_min.ContextConsumer=h;reactIs_production_min.ContextProvider=g;reactIs_production_min.Element=b;reactIs_production_min.ForwardRef=l;reactIs_production_min.Fragment=d;reactIs_production_min.Lazy=q;reactIs_production_min.Memo=p;reactIs_production_min.Portal=c;reactIs_production_min.Profiler=f;reactIs_production_min.StrictMode=e;reactIs_production_min.Suspense=m;reactIs_production_min.SuspenseList=n;reactIs_production_min.isAsyncMode=function(){return!1};reactIs_production_min.isConcurrentMode=function(){return!1};reactIs_production_min.isContextConsumer=function(i){return v(i)===h};reactIs_production_min.isContextProvider=function(i){return v(i)===g};reactIs_production_min.isElement=function(i){return typeof i=="object"&&i!==null&&i.$$typeof===b};reactIs_production_min.isForwardRef=function(i){return v(i)===l};reactIs_production_min.isFragment=function(i){return v(i)===d};reactIs_production_min.isLazy=function(i){return v(i)===q};reactIs_production_min.isMemo=function(i){return v(i)===p};reactIs_production_min.isPortal=function(i){return v(i)===c};reactIs_production_min.isProfiler=function(i){return v(i)===f};reactIs_production_min.isStrictMode=function(i){return v(i)===e};reactIs_production_min.isSuspense=function(i){return v(i)===m};reactIs_production_min.isSuspenseList=function(i){return v(i)===n};reactIs_production_min.isValidElementType=function(i){return typeof i=="string"||typeof i=="function"||i===d||i===f||i===e||i===m||i===n||i===t||typeof i=="object"&&i!==null&&(i.$$typeof===q||i.$$typeof===p||i.$$typeof===g||i.$$typeof===h||i.$$typeof===l||i.$$typeof===u||i.getModuleId!==void 0)};reactIs_production_min.typeOf=v;reactIs.exports=reactIs_production_min;var reactIsExports=reactIs.exports;const fnNameMatchRegex=/^\s*function(?:\s|\s*\/\*.*\*\/\s*)+([^(\s/]*)\s*/;function getFunctionName(i){const o=`${i}`.match(fnNameMatchRegex);return o&&o[1]||""}function getFunctionComponentName(i,o=""){return i.displayName||i.name||getFunctionName(i)||o}function getWrappedName(i,o,s){const j=getFunctionComponentName(o);return i.displayName||(j!==""?`${s}(${j})`:s)}function getDisplayName$1(i){if(i!=null){if(typeof i=="string")return i;if(typeof i=="function")return getFunctionComponentName(i,"Component");if(typeof i=="object")switch(i.$$typeof){case reactIsExports.ForwardRef:return getWrappedName(i,i.render,"ForwardRef");case reactIsExports.Memo:return getWrappedName(i,i.type,"memo");default:return}}}const getDisplayName=Object.freeze(Object.defineProperty({__proto__:null,default:getDisplayName$1,getFunctionName},Symbol.toStringTag,{value:"Module"}));function resolveProps(i,o){const s=_extends$1({},o);return Object.keys(i).forEach(j=>{if(j.toString().match(/^(components|slots)$/))s[j]=_extends$1({},i[j],s[j]);else if(j.toString().match(/^(componentsProps|slotProps)$/)){const _e=i[j]||{},lt=o[j];s[j]={},!lt||!Object.keys(lt)?s[j]=_e:!_e||!Object.keys(_e)?s[j]=lt:(s[j]=_extends$1({},lt),Object.keys(_e).forEach(tt=>{s[j][tt]=resolveProps(_e[tt],lt[tt])}))}else s[j]===void 0&&(s[j]=i[j])}),s}function getThemeProps(i){const{theme:o,name:s,props:j}=i;return!o||!o.components||!o.components[s]||!o.components[s].defaultProps?j:resolveProps(o.components[s].defaultProps,j)}function useThemeProps$2({props:i,name:o,defaultTheme:s,themeId:j}){let _e=useTheme$2(s);return j&&(_e=_e[j]||_e),getThemeProps({theme:_e,name:o,props:i})}const useEnhancedEffect=typeof window<"u"?reactExports.useLayoutEffect:reactExports.useEffect;function clamp$1(i,o=Number.MIN_SAFE_INTEGER,s=Number.MAX_SAFE_INTEGER){return Math.max(o,Math.min(i,s))}const clamp=Object.freeze(Object.defineProperty({__proto__:null,default:clamp$1},Symbol.toStringTag,{value:"Module"}));function createChainedFunction(...i){return i.reduce((o,s)=>s==null?o:function(..._e){o.apply(this,_e),s.apply(this,_e)},()=>{})}function debounce$1(i,o=166){let s;function j(..._e){const lt=()=>{i.apply(this,_e)};clearTimeout(s),s=setTimeout(lt,o)}return j.clear=()=>{clearTimeout(s)},j}function isMuiElement(i,o){var s,j;return reactExports.isValidElement(i)&&o.indexOf((s=i.type.muiName)!=null?s:(j=i.type)==null||(j=j._payload)==null||(j=j.value)==null?void 0:j.muiName)!==-1}function ownerDocument(i){return i&&i.ownerDocument||document}function ownerWindow(i){return ownerDocument(i).defaultView||window}function setRef(i,o){typeof i=="function"?i(o):i&&(i.current=o)}let globalId=0;function useGlobalId(i){const[o,s]=reactExports.useState(i),j=i||o;return reactExports.useEffect(()=>{o==null&&(globalId+=1,s(`mui-${globalId}`))},[o]),j}const maybeReactUseId=React$2.useId;function useId(i){if(maybeReactUseId!==void 0){const o=maybeReactUseId();return i??o}return useGlobalId(i)}function useControlled({controlled:i,default:o,name:s,state:j="value"}){const{current:_e}=reactExports.useRef(i!==void 0),[lt,tt]=reactExports.useState(o),ot=_e?i:lt,st=reactExports.useCallback(ct=>{_e||tt(ct)},[]);return[ot,st]}function useEventCallback(i){const o=reactExports.useRef(i);return useEnhancedEffect(()=>{o.current=i}),reactExports.useRef((...s)=>(0,o.current)(...s)).current}function useForkRef(...i){return reactExports.useMemo(()=>i.every(o=>o==null)?null:o=>{i.forEach(s=>{setRef(s,o)})},i)}const UNINITIALIZED={};function useLazyRef(i,o){const s=reactExports.useRef(UNINITIALIZED);return s.current===UNINITIALIZED&&(s.current=i(o)),s}const EMPTY=[];function useOnMount(i){reactExports.useEffect(i,EMPTY)}class Timeout{constructor(){this.currentId=null,this.clear=()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)},this.disposeEffect=()=>this.clear}static create(){return new Timeout}start(o,s){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,s()},o)}}function useTimeout(){const i=useLazyRef(Timeout.create).current;return useOnMount(i.disposeEffect),i}let hadKeyboardEvent=!0,hadFocusVisibleRecently=!1;const hadFocusVisibleRecentlyTimeout=new Timeout,inputTypesWhitelist={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function focusTriggersKeyboardModality(i){const{type:o,tagName:s}=i;return!!(s==="INPUT"&&inputTypesWhitelist[o]&&!i.readOnly||s==="TEXTAREA"&&!i.readOnly||i.isContentEditable)}function handleKeyDown(i){i.metaKey||i.altKey||i.ctrlKey||(hadKeyboardEvent=!0)}function handlePointerDown(){hadKeyboardEvent=!1}function handleVisibilityChange(){this.visibilityState==="hidden"&&hadFocusVisibleRecently&&(hadKeyboardEvent=!0)}function prepare(i){i.addEventListener("keydown",handleKeyDown,!0),i.addEventListener("mousedown",handlePointerDown,!0),i.addEventListener("pointerdown",handlePointerDown,!0),i.addEventListener("touchstart",handlePointerDown,!0),i.addEventListener("visibilitychange",handleVisibilityChange,!0)}function isFocusVisible(i){const{target:o}=i;try{return o.matches(":focus-visible")}catch{}return hadKeyboardEvent||focusTriggersKeyboardModality(o)}function useIsFocusVisible(){const i=reactExports.useCallback(_e=>{_e!=null&&prepare(_e.ownerDocument)},[]),o=reactExports.useRef(!1);function s(){return o.current?(hadFocusVisibleRecently=!0,hadFocusVisibleRecentlyTimeout.start(100,()=>{hadFocusVisibleRecently=!1}),o.current=!1,!0):!1}function j(_e){return isFocusVisible(_e)?(o.current=!0,!0):!1}return{isFocusVisibleRef:o,onFocus:j,onBlur:s,ref:i}}function getScrollbarSize(i){const o=i.documentElement.clientWidth;return Math.abs(window.innerWidth-o)}const usePreviousProps=i=>{const o=reactExports.useRef({});return reactExports.useEffect(()=>{o.current=i}),o.current};function composeClasses(i,o,s=void 0){const j={};return Object.keys(i).forEach(_e=>{j[_e]=i[_e].reduce((lt,tt)=>{if(tt){const ot=o(tt);ot!==""&<.push(ot),s&&s[tt]&<.push(s[tt])}return lt},[]).join(" ")}),j}const RtlContext=reactExports.createContext(),useRtl=()=>{const i=reactExports.useContext(RtlContext);return i??!1};function createMixins(i,o){return _extends$1({toolbar:{minHeight:56,[i.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[i.up("sm")]:{minHeight:64}}},o)}var colorManipulator={},interopRequireDefault={exports:{}};(function(i){function o(s){return s&&s.__esModule?s:{default:s}}i.exports=o,i.exports.__esModule=!0,i.exports.default=i.exports})(interopRequireDefault);var interopRequireDefaultExports=interopRequireDefault.exports;const require$$1$1=getAugmentedNamespace(formatMuiErrorMessage),require$$2=getAugmentedNamespace(clamp);var _interopRequireDefault$1=interopRequireDefaultExports;Object.defineProperty(colorManipulator,"__esModule",{value:!0});var alpha_1=colorManipulator.alpha=alpha;colorManipulator.blend=blend;colorManipulator.colorChannel=void 0;var darken_1=colorManipulator.darken=darken;colorManipulator.decomposeColor=decomposeColor;colorManipulator.emphasize=emphasize;var getContrastRatio_1=colorManipulator.getContrastRatio=getContrastRatio;colorManipulator.getLuminance=getLuminance;colorManipulator.hexToRgb=hexToRgb;colorManipulator.hslToRgb=hslToRgb;var lighten_1=colorManipulator.lighten=lighten;colorManipulator.private_safeAlpha=private_safeAlpha;colorManipulator.private_safeColorChannel=void 0;colorManipulator.private_safeDarken=private_safeDarken;colorManipulator.private_safeEmphasize=private_safeEmphasize;colorManipulator.private_safeLighten=private_safeLighten;colorManipulator.recomposeColor=recomposeColor;colorManipulator.rgbToHex=rgbToHex;var _formatMuiErrorMessage2=_interopRequireDefault$1(require$$1$1),_clamp=_interopRequireDefault$1(require$$2);function clampWrapper(i,o=0,s=1){return(0,_clamp.default)(i,o,s)}function hexToRgb(i){i=i.slice(1);const o=new RegExp(`.{1,${i.length>=6?2:1}}`,"g");let s=i.match(o);return s&&s[0].length===1&&(s=s.map(j=>j+j)),s?`rgb${s.length===4?"a":""}(${s.map((j,_e)=>_e<3?parseInt(j,16):Math.round(parseInt(j,16)/255*1e3)/1e3).join(", ")})`:""}function intToHex(i){const o=i.toString(16);return o.length===1?`0${o}`:o}function decomposeColor(i){if(i.type)return i;if(i.charAt(0)==="#")return decomposeColor(hexToRgb(i));const o=i.indexOf("("),s=i.substring(0,o);if(["rgb","rgba","hsl","hsla","color"].indexOf(s)===-1)throw new Error((0,_formatMuiErrorMessage2.default)(9,i));let j=i.substring(o+1,i.length-1),_e;if(s==="color"){if(j=j.split(" "),_e=j.shift(),j.length===4&&j[3].charAt(0)==="/"&&(j[3]=j[3].slice(1)),["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(_e)===-1)throw new Error((0,_formatMuiErrorMessage2.default)(10,_e))}else j=j.split(",");return j=j.map(lt=>parseFloat(lt)),{type:s,values:j,colorSpace:_e}}const colorChannel=i=>{const o=decomposeColor(i);return o.values.slice(0,3).map((s,j)=>o.type.indexOf("hsl")!==-1&&j!==0?`${s}%`:s).join(" ")};colorManipulator.colorChannel=colorChannel;const private_safeColorChannel=(i,o)=>{try{return colorChannel(i)}catch{return i}};colorManipulator.private_safeColorChannel=private_safeColorChannel;function recomposeColor(i){const{type:o,colorSpace:s}=i;let{values:j}=i;return o.indexOf("rgb")!==-1?j=j.map((_e,lt)=>lt<3?parseInt(_e,10):_e):o.indexOf("hsl")!==-1&&(j[1]=`${j[1]}%`,j[2]=`${j[2]}%`),o.indexOf("color")!==-1?j=`${s} ${j.join(" ")}`:j=`${j.join(", ")}`,`${o}(${j})`}function rgbToHex(i){if(i.indexOf("#")===0)return i;const{values:o}=decomposeColor(i);return`#${o.map((s,j)=>intToHex(j===3?Math.round(255*s):s)).join("")}`}function hslToRgb(i){i=decomposeColor(i);const{values:o}=i,s=o[0],j=o[1]/100,_e=o[2]/100,lt=j*Math.min(_e,1-_e),tt=(ct,it=(ct+s/30)%12)=>_e-lt*Math.max(Math.min(it-3,9-it,1),-1);let ot="rgb";const st=[Math.round(tt(0)*255),Math.round(tt(8)*255),Math.round(tt(4)*255)];return i.type==="hsla"&&(ot+="a",st.push(o[3])),recomposeColor({type:ot,values:st})}function getLuminance(i){i=decomposeColor(i);let o=i.type==="hsl"||i.type==="hsla"?decomposeColor(hslToRgb(i)).values:i.values;return o=o.map(s=>(i.type!=="color"&&(s/=255),s<=.03928?s/12.92:((s+.055)/1.055)**2.4)),Number((.2126*o[0]+.7152*o[1]+.0722*o[2]).toFixed(3))}function getContrastRatio(i,o){const s=getLuminance(i),j=getLuminance(o);return(Math.max(s,j)+.05)/(Math.min(s,j)+.05)}function alpha(i,o){return i=decomposeColor(i),o=clampWrapper(o),(i.type==="rgb"||i.type==="hsl")&&(i.type+="a"),i.type==="color"?i.values[3]=`/${o}`:i.values[3]=o,recomposeColor(i)}function private_safeAlpha(i,o,s){try{return alpha(i,o)}catch{return i}}function darken(i,o){if(i=decomposeColor(i),o=clampWrapper(o),i.type.indexOf("hsl")!==-1)i.values[2]*=1-o;else if(i.type.indexOf("rgb")!==-1||i.type.indexOf("color")!==-1)for(let s=0;s<3;s+=1)i.values[s]*=1-o;return recomposeColor(i)}function private_safeDarken(i,o,s){try{return darken(i,o)}catch{return i}}function lighten(i,o){if(i=decomposeColor(i),o=clampWrapper(o),i.type.indexOf("hsl")!==-1)i.values[2]+=(100-i.values[2])*o;else if(i.type.indexOf("rgb")!==-1)for(let s=0;s<3;s+=1)i.values[s]+=(255-i.values[s])*o;else if(i.type.indexOf("color")!==-1)for(let s=0;s<3;s+=1)i.values[s]+=(1-i.values[s])*o;return recomposeColor(i)}function private_safeLighten(i,o,s){try{return lighten(i,o)}catch{return i}}function emphasize(i,o=.15){return getLuminance(i)>.5?darken(i,o):lighten(i,o)}function private_safeEmphasize(i,o,s){try{return private_safeEmphasize(i,o)}catch{return i}}function blend(i,o,s,j=1){const _e=(st,ct)=>Math.round((st**(1/j)*(1-s)+ct**(1/j)*s)**j),lt=decomposeColor(i),tt=decomposeColor(o),ot=[_e(lt.values[0],tt.values[0]),_e(lt.values[1],tt.values[1]),_e(lt.values[2],tt.values[2])];return recomposeColor({type:"rgb",values:ot})}const _excluded$H=["mode","contrastThreshold","tonalOffset"],light={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:common$1.white,default:common$1.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},dark={text:{primary:common$1.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:common$1.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function addLightOrDark(i,o,s,j){const _e=j.light||j,lt=j.dark||j*1.5;i[o]||(i.hasOwnProperty(s)?i[o]=i[s]:o==="light"?i.light=lighten_1(i.main,_e):o==="dark"&&(i.dark=darken_1(i.main,lt)))}function getDefaultPrimary(i="light"){return i==="dark"?{main:blue$1[200],light:blue$1[50],dark:blue$1[400]}:{main:blue$1[700],light:blue$1[400],dark:blue$1[800]}}function getDefaultSecondary(i="light"){return i==="dark"?{main:purple$1[200],light:purple$1[50],dark:purple$1[400]}:{main:purple$1[500],light:purple$1[300],dark:purple$1[700]}}function getDefaultError(i="light"){return i==="dark"?{main:red$1[500],light:red$1[300],dark:red$1[700]}:{main:red$1[700],light:red$1[400],dark:red$1[800]}}function getDefaultInfo(i="light"){return i==="dark"?{main:lightBlue$1[400],light:lightBlue$1[300],dark:lightBlue$1[700]}:{main:lightBlue$1[700],light:lightBlue$1[500],dark:lightBlue$1[900]}}function getDefaultSuccess(i="light"){return i==="dark"?{main:green$1[400],light:green$1[300],dark:green$1[700]}:{main:green$1[800],light:green$1[500],dark:green$1[900]}}function getDefaultWarning(i="light"){return i==="dark"?{main:orange$1[400],light:orange$1[300],dark:orange$1[700]}:{main:"#ed6c02",light:orange$1[500],dark:orange$1[900]}}function createPalette(i){const{mode:o="light",contrastThreshold:s=3,tonalOffset:j=.2}=i,_e=_objectWithoutPropertiesLoose(i,_excluded$H),lt=i.primary||getDefaultPrimary(o),tt=i.secondary||getDefaultSecondary(o),ot=i.error||getDefaultError(o),st=i.info||getDefaultInfo(o),ct=i.success||getDefaultSuccess(o),it=i.warning||getDefaultWarning(o);function $(at){return getContrastRatio_1(at,dark.text.primary)>=s?dark.text.primary:light.text.primary}const a=({color:at,name:rt,mainShade:dt=500,lightShade:ut=300,darkShade:bt=700})=>{if(at=_extends$1({},at),!at.main&&at[dt]&&(at.main=at[dt]),!at.hasOwnProperty("main"))throw new Error(formatMuiErrorMessage$1(11,rt?` (${rt})`:"",dt));if(typeof at.main!="string")throw new Error(formatMuiErrorMessage$1(12,rt?` (${rt})`:"",JSON.stringify(at.main)));return addLightOrDark(at,"light",ut,j),addLightOrDark(at,"dark",bt,j),at.contrastText||(at.contrastText=$(at.main)),at},et={dark,light};return deepmerge$1(_extends$1({common:_extends$1({},common$1),mode:o,primary:a({color:lt,name:"primary"}),secondary:a({color:tt,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:a({color:ot,name:"error"}),warning:a({color:it,name:"warning"}),info:a({color:st,name:"info"}),success:a({color:ct,name:"success"}),grey:grey$1,contrastThreshold:s,getContrastText:$,augmentColor:a,tonalOffset:j},et[o]),_e)}const _excluded$G=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];function round$1(i){return Math.round(i*1e5)/1e5}const caseAllCaps={textTransform:"uppercase"},defaultFontFamily='"Roboto", "Helvetica", "Arial", sans-serif';function createTypography(i,o){const s=typeof o=="function"?o(i):o,{fontFamily:j=defaultFontFamily,fontSize:_e=14,fontWeightLight:lt=300,fontWeightRegular:tt=400,fontWeightMedium:ot=500,fontWeightBold:st=700,htmlFontSize:ct=16,allVariants:it,pxToRem:$}=s,a=_objectWithoutPropertiesLoose(s,_excluded$G),et=_e/14,nt=$||(dt=>`${dt/ct*et}rem`),at=(dt,ut,bt,mt,pt)=>_extends$1({fontFamily:j,fontWeight:dt,fontSize:nt(ut),lineHeight:bt},j===defaultFontFamily?{letterSpacing:`${round$1(mt/ut)}em`}:{},pt,it),rt={h1:at(lt,96,1.167,-1.5),h2:at(lt,60,1.2,-.5),h3:at(tt,48,1.167,0),h4:at(tt,34,1.235,.25),h5:at(tt,24,1.334,0),h6:at(ot,20,1.6,.15),subtitle1:at(tt,16,1.75,.15),subtitle2:at(ot,14,1.57,.1),body1:at(tt,16,1.5,.15),body2:at(tt,14,1.43,.15),button:at(ot,14,1.75,.4,caseAllCaps),caption:at(tt,12,1.66,.4),overline:at(tt,12,2.66,1,caseAllCaps),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return deepmerge$1(_extends$1({htmlFontSize:ct,pxToRem:nt,fontFamily:j,fontSize:_e,fontWeightLight:lt,fontWeightRegular:tt,fontWeightMedium:ot,fontWeightBold:st},rt),a,{clone:!1})}const shadowKeyUmbraOpacity=.2,shadowKeyPenumbraOpacity=.14,shadowAmbientShadowOpacity=.12;function createShadow(...i){return[`${i[0]}px ${i[1]}px ${i[2]}px ${i[3]}px rgba(0,0,0,${shadowKeyUmbraOpacity})`,`${i[4]}px ${i[5]}px ${i[6]}px ${i[7]}px rgba(0,0,0,${shadowKeyPenumbraOpacity})`,`${i[8]}px ${i[9]}px ${i[10]}px ${i[11]}px rgba(0,0,0,${shadowAmbientShadowOpacity})`].join(",")}const shadows=["none",createShadow(0,2,1,-1,0,1,1,0,0,1,3,0),createShadow(0,3,1,-2,0,2,2,0,0,1,5,0),createShadow(0,3,3,-2,0,3,4,0,0,1,8,0),createShadow(0,2,4,-1,0,4,5,0,0,1,10,0),createShadow(0,3,5,-1,0,5,8,0,0,1,14,0),createShadow(0,3,5,-1,0,6,10,0,0,1,18,0),createShadow(0,4,5,-2,0,7,10,1,0,2,16,1),createShadow(0,5,5,-3,0,8,10,1,0,3,14,2),createShadow(0,5,6,-3,0,9,12,1,0,3,16,2),createShadow(0,6,6,-3,0,10,14,1,0,4,18,3),createShadow(0,6,7,-4,0,11,15,1,0,4,20,3),createShadow(0,7,8,-4,0,12,17,2,0,5,22,4),createShadow(0,7,8,-4,0,13,19,2,0,5,24,4),createShadow(0,7,9,-4,0,14,21,2,0,5,26,4),createShadow(0,8,9,-5,0,15,22,2,0,6,28,5),createShadow(0,8,10,-5,0,16,24,2,0,6,30,5),createShadow(0,8,11,-5,0,17,26,2,0,6,32,5),createShadow(0,9,11,-5,0,18,28,2,0,7,34,6),createShadow(0,9,12,-6,0,19,29,2,0,7,36,6),createShadow(0,10,13,-6,0,20,31,3,0,8,38,7),createShadow(0,10,13,-6,0,21,33,3,0,8,40,7),createShadow(0,10,14,-6,0,22,35,3,0,8,42,7),createShadow(0,11,14,-7,0,23,36,3,0,9,44,8),createShadow(0,11,15,-7,0,24,38,3,0,9,46,8)],_excluded$F=["duration","easing","delay"],easing={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},duration={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function formatMs(i){return`${Math.round(i)}ms`}function getAutoHeightDuration(i){if(!i)return 0;const o=i/36;return Math.round((4+15*o**.25+o/5)*10)}function createTransitions(i){const o=_extends$1({},easing,i.easing),s=_extends$1({},duration,i.duration);return _extends$1({getAutoHeightDuration,create:(_e=["all"],lt={})=>{const{duration:tt=s.standard,easing:ot=o.easeInOut,delay:st=0}=lt;return _objectWithoutPropertiesLoose(lt,_excluded$F),(Array.isArray(_e)?_e:[_e]).map(ct=>`${ct} ${typeof tt=="string"?tt:formatMs(tt)} ${ot} ${typeof st=="string"?st:formatMs(st)}`).join(",")}},i,{easing:o,duration:s})}const zIndex={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},zIndex$1=zIndex,_excluded$E=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function createTheme(i={},...o){const{mixins:s={},palette:j={},transitions:_e={},typography:lt={}}=i,tt=_objectWithoutPropertiesLoose(i,_excluded$E);if(i.vars)throw new Error(formatMuiErrorMessage$1(18));const ot=createPalette(j),st=createTheme$2(i);let ct=deepmerge$1(st,{mixins:createMixins(st.breakpoints,s),palette:ot,shadows:shadows.slice(),typography:createTypography(ot,lt),transitions:createTransitions(_e),zIndex:_extends$1({},zIndex$1)});return ct=deepmerge$1(ct,tt),ct=o.reduce((it,$)=>deepmerge$1(it,$),ct),ct.unstable_sxConfig=_extends$1({},defaultSxConfig$1,tt==null?void 0:tt.unstable_sxConfig),ct.unstable_sx=function($){return styleFunctionSx$2({sx:$,theme:this})},ct}const defaultTheme=createTheme(),defaultTheme$1=defaultTheme;function useTheme$1(){const i=useTheme$2(defaultTheme$1);return i[THEME_ID]||i}function useThemeProps$1({props:i,name:o}){return useThemeProps$2({props:i,name:o,defaultTheme:defaultTheme$1,themeId:THEME_ID})}var createStyled$1={},objectWithoutPropertiesLoose={exports:{}},hasRequiredObjectWithoutPropertiesLoose;function requireObjectWithoutPropertiesLoose(){return hasRequiredObjectWithoutPropertiesLoose||(hasRequiredObjectWithoutPropertiesLoose=1,function(i){function o(s,j){if(s==null)return{};var _e={},lt=Object.keys(s),tt,ot;for(ot=0;ot=0)&&(_e[tt]=s[tt]);return _e}i.exports=o,i.exports.__esModule=!0,i.exports.default=i.exports}(objectWithoutPropertiesLoose)),objectWithoutPropertiesLoose.exports}const require$$1=getAugmentedNamespace(styledEngine),require$$4=getAugmentedNamespace(deepmerge),require$$5=getAugmentedNamespace(capitalize),require$$6=getAugmentedNamespace(getDisplayName),require$$7=getAugmentedNamespace(createTheme$1),require$$8=getAugmentedNamespace(styleFunctionSx);var _interopRequireDefault=interopRequireDefaultExports;Object.defineProperty(createStyled$1,"__esModule",{value:!0});var _default=createStyled$1.default=createStyled;createStyled$1.shouldForwardProp=shouldForwardProp;createStyled$1.systemDefaultTheme=void 0;var _extends2=_interopRequireDefault(require_extends()),_objectWithoutPropertiesLoose2=_interopRequireDefault(requireObjectWithoutPropertiesLoose()),_styledEngine$1=_interopRequireWildcard$1(require$$1),_deepmerge=require$$4;_interopRequireDefault(require$$5);_interopRequireDefault(require$$6);var _createTheme=_interopRequireDefault(require$$7),_styleFunctionSx=_interopRequireDefault(require$$8);const _excluded$D=["ownerState"],_excluded2$6=["variants"],_excluded3$1=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function _getRequireWildcardCache$1(i){if(typeof WeakMap!="function")return null;var o=new WeakMap,s=new WeakMap;return(_getRequireWildcardCache$1=function(j){return j?s:o})(i)}function _interopRequireWildcard$1(i,o){if(!o&&i&&i.__esModule)return i;if(i===null||typeof i!="object"&&typeof i!="function")return{default:i};var s=_getRequireWildcardCache$1(o);if(s&&s.has(i))return s.get(i);var j={__proto__:null},_e=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var lt in i)if(lt!=="default"&&Object.prototype.hasOwnProperty.call(i,lt)){var tt=_e?Object.getOwnPropertyDescriptor(i,lt):null;tt&&(tt.get||tt.set)?Object.defineProperty(j,lt,tt):j[lt]=i[lt]}return j.default=i,s&&s.set(i,j),j}function isEmpty$3(i){return Object.keys(i).length===0}function isStringTag(i){return typeof i=="string"&&i.charCodeAt(0)>96}function shouldForwardProp(i){return i!=="ownerState"&&i!=="theme"&&i!=="sx"&&i!=="as"}const systemDefaultTheme=createStyled$1.systemDefaultTheme=(0,_createTheme.default)(),lowercaseFirstLetter=i=>i&&i.charAt(0).toLowerCase()+i.slice(1);function resolveTheme({defaultTheme:i,theme:o,themeId:s}){return isEmpty$3(o)?i:o[s]||o}function defaultOverridesResolver(i){return i?(o,s)=>s[i]:null}function processStyleArg(i,o){let{ownerState:s}=o,j=(0,_objectWithoutPropertiesLoose2.default)(o,_excluded$D);const _e=typeof i=="function"?i((0,_extends2.default)({ownerState:s},j)):i;if(Array.isArray(_e))return _e.flatMap(lt=>processStyleArg(lt,(0,_extends2.default)({ownerState:s},j)));if(_e&&typeof _e=="object"&&Array.isArray(_e.variants)){const{variants:lt=[]}=_e;let ot=(0,_objectWithoutPropertiesLoose2.default)(_e,_excluded2$6);return lt.forEach(st=>{let ct=!0;typeof st.props=="function"?ct=st.props((0,_extends2.default)({ownerState:s},j,s)):Object.keys(st.props).forEach(it=>{(s==null?void 0:s[it])!==st.props[it]&&j[it]!==st.props[it]&&(ct=!1)}),ct&&(Array.isArray(ot)||(ot=[ot]),ot.push(typeof st.style=="function"?st.style((0,_extends2.default)({ownerState:s},j,s)):st.style))}),ot}return _e}function createStyled(i={}){const{themeId:o,defaultTheme:s=systemDefaultTheme,rootShouldForwardProp:j=shouldForwardProp,slotShouldForwardProp:_e=shouldForwardProp}=i,lt=tt=>(0,_styleFunctionSx.default)((0,_extends2.default)({},tt,{theme:resolveTheme((0,_extends2.default)({},tt,{defaultTheme:s,themeId:o}))}));return lt.__mui_systemSx=!0,(tt,ot={})=>{(0,_styledEngine$1.internal_processStyles)(tt,pt=>pt.filter(Zt=>!(Zt!=null&&Zt.__mui_systemSx)));const{name:st,slot:ct,skipVariantsResolver:it,skipSx:$,overridesResolver:a=defaultOverridesResolver(lowercaseFirstLetter(ct))}=ot,et=(0,_objectWithoutPropertiesLoose2.default)(ot,_excluded3$1),nt=it!==void 0?it:ct&&ct!=="Root"&&ct!=="root"||!1,at=$||!1;let rt,dt=shouldForwardProp;ct==="Root"||ct==="root"?dt=j:ct?dt=_e:isStringTag(tt)&&(dt=void 0);const ut=(0,_styledEngine$1.default)(tt,(0,_extends2.default)({shouldForwardProp:dt,label:rt},et)),bt=pt=>typeof pt=="function"&&pt.__emotion_real!==pt||(0,_deepmerge.isPlainObject)(pt)?Zt=>processStyleArg(pt,(0,_extends2.default)({},Zt,{theme:resolveTheme({theme:Zt.theme,defaultTheme:s,themeId:o})})):pt,mt=(pt,...Zt)=>{let ht=bt(pt);const Gt=Zt?Zt.map(bt):[];st&&a&&Gt.push(Yt=>{const St=resolveTheme((0,_extends2.default)({},Yt,{defaultTheme:s,themeId:o}));if(!St.components||!St.components[st]||!St.components[st].styleOverrides)return null;const Lt=St.components[st].styleOverrides,Ct={};return Object.entries(Lt).forEach(([Tt,ft])=>{Ct[Tt]=processStyleArg(ft,(0,_extends2.default)({},Yt,{theme:St}))}),a(Yt,Ct)}),st&&!nt&&Gt.push(Yt=>{var St;const Lt=resolveTheme((0,_extends2.default)({},Yt,{defaultTheme:s,themeId:o})),Ct=Lt==null||(St=Lt.components)==null||(St=St[st])==null?void 0:St.variants;return processStyleArg({variants:Ct},(0,_extends2.default)({},Yt,{theme:Lt}))}),at||Gt.push(lt);const Xt=Gt.length-Zt.length;if(Array.isArray(pt)&&Xt>0){const Yt=new Array(Xt).fill("");ht=[...pt,...Yt],ht.raw=[...pt.raw,...Yt]}const Vt=ut(ht,...Gt);return tt.muiName&&(Vt.muiName=tt.muiName),Vt};return ut.withConfig&&(mt.withConfig=ut.withConfig),mt}}function slotShouldForwardProp(i){return i!=="ownerState"&&i!=="theme"&&i!=="sx"&&i!=="as"}const rootShouldForwardProp=i=>slotShouldForwardProp(i)&&i!=="classes",rootShouldForwardProp$1=rootShouldForwardProp,styled=_default({themeId:THEME_ID,defaultTheme:defaultTheme$1,rootShouldForwardProp:rootShouldForwardProp$1}),getOverlayAlpha=i=>{let o;return i<1?o=5.11916*i**2:o=4.5*Math.log(i+1)+2,(o/100).toFixed(2)};function getSvgIconUtilityClass(i){return generateUtilityClass$1("MuiSvgIcon",i)}generateUtilityClasses$1("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const _excluded$C=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"],useUtilityClasses$u=i=>{const{color:o,fontSize:s,classes:j}=i,_e={root:["root",o!=="inherit"&&`color${capitalize$1(o)}`,`fontSize${capitalize$1(s)}`]};return composeClasses(_e,getSvgIconUtilityClass,j)},SvgIconRoot=styled("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(i,o)=>{const{ownerState:s}=i;return[o.root,s.color!=="inherit"&&o[`color${capitalize$1(s.color)}`],o[`fontSize${capitalize$1(s.fontSize)}`]]}})(({theme:i,ownerState:o})=>{var s,j,_e,lt,tt,ot,st,ct,it,$,a,et,nt;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:o.hasSvgAsChild?void 0:"currentColor",flexShrink:0,transition:(s=i.transitions)==null||(j=s.create)==null?void 0:j.call(s,"fill",{duration:(_e=i.transitions)==null||(_e=_e.duration)==null?void 0:_e.shorter}),fontSize:{inherit:"inherit",small:((lt=i.typography)==null||(tt=lt.pxToRem)==null?void 0:tt.call(lt,20))||"1.25rem",medium:((ot=i.typography)==null||(st=ot.pxToRem)==null?void 0:st.call(ot,24))||"1.5rem",large:((ct=i.typography)==null||(it=ct.pxToRem)==null?void 0:it.call(ct,35))||"2.1875rem"}[o.fontSize],color:($=(a=(i.vars||i).palette)==null||(a=a[o.color])==null?void 0:a.main)!=null?$:{action:(et=(i.vars||i).palette)==null||(et=et.action)==null?void 0:et.active,disabled:(nt=(i.vars||i).palette)==null||(nt=nt.action)==null?void 0:nt.disabled,inherit:void 0}[o.color]}}),SvgIcon=reactExports.forwardRef(function(o,s){const j=useThemeProps$1({props:o,name:"MuiSvgIcon"}),{children:_e,className:lt,color:tt="inherit",component:ot="svg",fontSize:st="medium",htmlColor:ct,inheritViewBox:it=!1,titleAccess:$,viewBox:a="0 0 24 24"}=j,et=_objectWithoutPropertiesLoose(j,_excluded$C),nt=reactExports.isValidElement(_e)&&_e.type==="svg",at=_extends$1({},j,{color:tt,component:ot,fontSize:st,instanceFontSize:o.fontSize,inheritViewBox:it,viewBox:a,hasSvgAsChild:nt}),rt={};it||(rt.viewBox=a);const dt=useUtilityClasses$u(at);return jsxRuntimeExports.jsxs(SvgIconRoot,_extends$1({as:ot,className:clsx(dt.root,lt),focusable:"false",color:ct,"aria-hidden":$?void 0:!0,role:$?"img":void 0,ref:s},rt,et,nt&&_e.props,{ownerState:at,children:[nt?_e.props.children:_e,$?jsxRuntimeExports.jsx("title",{children:$}):null]}))});SvgIcon.muiName="SvgIcon";function createSvgIcon(i,o){function s(j,_e){return jsxRuntimeExports.jsx(SvgIcon,_extends$1({"data-testid":`${o}Icon`,ref:_e},j,{children:i}))}return s.muiName=SvgIcon.muiName,reactExports.memo(reactExports.forwardRef(s))}function createUseThemeProps(i){return useThemeProps$1}function _setPrototypeOf(i,o){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(j,_e){return j.__proto__=_e,j},_setPrototypeOf(i,o)}function _inheritsLoose(i,o){i.prototype=Object.create(o.prototype),i.prototype.constructor=i,_setPrototypeOf(i,o)}const config={disabled:!1},TransitionGroupContext=React$1.createContext(null);var forceReflow=function(o){return o.scrollTop},UNMOUNTED="unmounted",EXITED="exited",ENTERING="entering",ENTERED="entered",EXITING="exiting",Transition=function(i){_inheritsLoose(o,i);function o(j,_e){var lt;lt=i.call(this,j,_e)||this;var tt=_e,ot=tt&&!tt.isMounting?j.enter:j.appear,st;return lt.appearStatus=null,j.in?ot?(st=EXITED,lt.appearStatus=ENTERING):st=ENTERED:j.unmountOnExit||j.mountOnEnter?st=UNMOUNTED:st=EXITED,lt.state={status:st},lt.nextCallback=null,lt}o.getDerivedStateFromProps=function(_e,lt){var tt=_e.in;return tt&<.status===UNMOUNTED?{status:EXITED}:null};var s=o.prototype;return s.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},s.componentDidUpdate=function(_e){var lt=null;if(_e!==this.props){var tt=this.state.status;this.props.in?tt!==ENTERING&&tt!==ENTERED&&(lt=ENTERING):(tt===ENTERING||tt===ENTERED)&&(lt=EXITING)}this.updateStatus(!1,lt)},s.componentWillUnmount=function(){this.cancelNextCallback()},s.getTimeouts=function(){var _e=this.props.timeout,lt,tt,ot;return lt=tt=ot=_e,_e!=null&&typeof _e!="number"&&(lt=_e.exit,tt=_e.enter,ot=_e.appear!==void 0?_e.appear:tt),{exit:lt,enter:tt,appear:ot}},s.updateStatus=function(_e,lt){if(_e===void 0&&(_e=!1),lt!==null)if(this.cancelNextCallback(),lt===ENTERING){if(this.props.unmountOnExit||this.props.mountOnEnter){var tt=this.props.nodeRef?this.props.nodeRef.current:ReactDOM.findDOMNode(this);tt&&forceReflow(tt)}this.performEnter(_e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===EXITED&&this.setState({status:UNMOUNTED})},s.performEnter=function(_e){var lt=this,tt=this.props.enter,ot=this.context?this.context.isMounting:_e,st=this.props.nodeRef?[ot]:[ReactDOM.findDOMNode(this),ot],ct=st[0],it=st[1],$=this.getTimeouts(),a=ot?$.appear:$.enter;if(!_e&&!tt||config.disabled){this.safeSetState({status:ENTERED},function(){lt.props.onEntered(ct)});return}this.props.onEnter(ct,it),this.safeSetState({status:ENTERING},function(){lt.props.onEntering(ct,it),lt.onTransitionEnd(a,function(){lt.safeSetState({status:ENTERED},function(){lt.props.onEntered(ct,it)})})})},s.performExit=function(){var _e=this,lt=this.props.exit,tt=this.getTimeouts(),ot=this.props.nodeRef?void 0:ReactDOM.findDOMNode(this);if(!lt||config.disabled){this.safeSetState({status:EXITED},function(){_e.props.onExited(ot)});return}this.props.onExit(ot),this.safeSetState({status:EXITING},function(){_e.props.onExiting(ot),_e.onTransitionEnd(tt.exit,function(){_e.safeSetState({status:EXITED},function(){_e.props.onExited(ot)})})})},s.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},s.safeSetState=function(_e,lt){lt=this.setNextCallback(lt),this.setState(_e,lt)},s.setNextCallback=function(_e){var lt=this,tt=!0;return this.nextCallback=function(ot){tt&&(tt=!1,lt.nextCallback=null,_e(ot))},this.nextCallback.cancel=function(){tt=!1},this.nextCallback},s.onTransitionEnd=function(_e,lt){this.setNextCallback(lt);var tt=this.props.nodeRef?this.props.nodeRef.current:ReactDOM.findDOMNode(this),ot=_e==null&&!this.props.addEndListener;if(!tt||ot){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var st=this.props.nodeRef?[this.nextCallback]:[tt,this.nextCallback],ct=st[0],it=st[1];this.props.addEndListener(ct,it)}_e!=null&&setTimeout(this.nextCallback,_e)},s.render=function(){var _e=this.state.status;if(_e===UNMOUNTED)return null;var lt=this.props,tt=lt.children;lt.in,lt.mountOnEnter,lt.unmountOnExit,lt.appear,lt.enter,lt.exit,lt.timeout,lt.addEndListener,lt.onEnter,lt.onEntering,lt.onEntered,lt.onExit,lt.onExiting,lt.onExited,lt.nodeRef;var ot=_objectWithoutPropertiesLoose(lt,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return React$1.createElement(TransitionGroupContext.Provider,{value:null},typeof tt=="function"?tt(_e,ot):React$1.cloneElement(React$1.Children.only(tt),ot))},o}(React$1.Component);Transition.contextType=TransitionGroupContext;Transition.propTypes={};function noop(){}Transition.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:noop,onEntering:noop,onEntered:noop,onExit:noop,onExiting:noop,onExited:noop};Transition.UNMOUNTED=UNMOUNTED;Transition.EXITED=EXITED;Transition.ENTERING=ENTERING;Transition.ENTERED=ENTERED;Transition.EXITING=EXITING;const Transition$1=Transition;function _assertThisInitialized(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function getChildMapping(i,o){var s=function(lt){return o&&reactExports.isValidElement(lt)?o(lt):lt},j=Object.create(null);return i&&reactExports.Children.map(i,function(_e){return _e}).forEach(function(_e){j[_e.key]=s(_e)}),j}function mergeChildMappings(i,o){i=i||{},o=o||{};function s(it){return it in o?o[it]:i[it]}var j=Object.create(null),_e=[];for(var lt in i)lt in o?_e.length&&(j[lt]=_e,_e=[]):_e.push(lt);var tt,ot={};for(var st in o){if(j[st])for(tt=0;tti.scrollTop;function getTransitionProps(i,o){var s,j;const{timeout:_e,easing:lt,style:tt={}}=i;return{duration:(s=tt.transitionDuration)!=null?s:typeof _e=="number"?_e:_e[o.mode]||0,easing:(j=tt.transitionTimingFunction)!=null?j:typeof lt=="object"?lt[o.mode]:lt,delay:tt.transitionDelay}}function getPaperUtilityClass(i){return generateUtilityClass$1("MuiPaper",i)}generateUtilityClasses$1("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);const _excluded$B=["className","component","elevation","square","variant"],useUtilityClasses$t=i=>{const{square:o,elevation:s,variant:j,classes:_e}=i,lt={root:["root",j,!o&&"rounded",j==="elevation"&&`elevation${s}`]};return composeClasses(lt,getPaperUtilityClass,_e)},PaperRoot=styled("div",{name:"MuiPaper",slot:"Root",overridesResolver:(i,o)=>{const{ownerState:s}=i;return[o.root,o[s.variant],!s.square&&o.rounded,s.variant==="elevation"&&o[`elevation${s.elevation}`]]}})(({theme:i,ownerState:o})=>{var s;return _extends$1({backgroundColor:(i.vars||i).palette.background.paper,color:(i.vars||i).palette.text.primary,transition:i.transitions.create("box-shadow")},!o.square&&{borderRadius:i.shape.borderRadius},o.variant==="outlined"&&{border:`1px solid ${(i.vars||i).palette.divider}`},o.variant==="elevation"&&_extends$1({boxShadow:(i.vars||i).shadows[o.elevation]},!i.vars&&i.palette.mode==="dark"&&{backgroundImage:`linear-gradient(${alpha_1("#fff",getOverlayAlpha(o.elevation))}, ${alpha_1("#fff",getOverlayAlpha(o.elevation))})`},i.vars&&{backgroundImage:(s=i.vars.overlays)==null?void 0:s[o.elevation]}))}),Paper=reactExports.forwardRef(function(o,s){const j=useThemeProps$1({props:o,name:"MuiPaper"}),{className:_e,component:lt="div",elevation:tt=1,square:ot=!1,variant:st="elevation"}=j,ct=_objectWithoutPropertiesLoose(j,_excluded$B),it=_extends$1({},j,{component:lt,elevation:tt,square:ot,variant:st}),$=useUtilityClasses$t(it);return jsxRuntimeExports.jsx(PaperRoot,_extends$1({as:lt,ownerState:it,className:clsx($.root,_e),ref:s},ct))}),Paper$1=Paper;function isHostComponent(i){return typeof i=="string"}function appendOwnerState(i,o,s){return i===void 0||isHostComponent(i)?o:_extends$1({},o,{ownerState:_extends$1({},o.ownerState,s)})}const defaultContextValue={disableDefaultClasses:!1},ClassNameConfiguratorContext=reactExports.createContext(defaultContextValue);function useClassNamesOverride(i){const{disableDefaultClasses:o}=reactExports.useContext(ClassNameConfiguratorContext);return s=>o?"":i(s)}function extractEventHandlers(i,o=[]){if(i===void 0)return{};const s={};return Object.keys(i).filter(j=>j.match(/^on[A-Z]/)&&typeof i[j]=="function"&&!o.includes(j)).forEach(j=>{s[j]=i[j]}),s}function resolveComponentProps(i,o,s){return typeof i=="function"?i(o,s):i}function omitEventHandlers(i){if(i===void 0)return{};const o={};return Object.keys(i).filter(s=>!(s.match(/^on[A-Z]/)&&typeof i[s]=="function")).forEach(s=>{o[s]=i[s]}),o}function mergeSlotProps(i){const{getSlotProps:o,additionalProps:s,externalSlotProps:j,externalForwardedProps:_e,className:lt}=i;if(!o){const et=clsx(s==null?void 0:s.className,lt,_e==null?void 0:_e.className,j==null?void 0:j.className),nt=_extends$1({},s==null?void 0:s.style,_e==null?void 0:_e.style,j==null?void 0:j.style),at=_extends$1({},s,_e,j);return et.length>0&&(at.className=et),Object.keys(nt).length>0&&(at.style=nt),{props:at,internalRef:void 0}}const tt=extractEventHandlers(_extends$1({},_e,j)),ot=omitEventHandlers(j),st=omitEventHandlers(_e),ct=o(tt),it=clsx(ct==null?void 0:ct.className,s==null?void 0:s.className,lt,_e==null?void 0:_e.className,j==null?void 0:j.className),$=_extends$1({},ct==null?void 0:ct.style,s==null?void 0:s.style,_e==null?void 0:_e.style,j==null?void 0:j.style),a=_extends$1({},ct,s,st,ot);return it.length>0&&(a.className=it),Object.keys($).length>0&&(a.style=$),{props:a,internalRef:ct.ref}}const _excluded$A=["elementType","externalSlotProps","ownerState","skipResolvingSlotProps"];function useSlotProps(i){var o;const{elementType:s,externalSlotProps:j,ownerState:_e,skipResolvingSlotProps:lt=!1}=i,tt=_objectWithoutPropertiesLoose(i,_excluded$A),ot=lt?{}:resolveComponentProps(j,_e),{props:st,internalRef:ct}=mergeSlotProps(_extends$1({},tt,{externalSlotProps:ot})),it=useForkRef(ct,ot==null?void 0:ot.ref,(o=i.additionalProps)==null?void 0:o.ref);return appendOwnerState(s,_extends$1({},st,{ref:it}),_e)}function Ripple(i){const{className:o,classes:s,pulsate:j=!1,rippleX:_e,rippleY:lt,rippleSize:tt,in:ot,onExited:st,timeout:ct}=i,[it,$]=reactExports.useState(!1),a=clsx(o,s.ripple,s.rippleVisible,j&&s.ripplePulsate),et={width:tt,height:tt,top:-(tt/2)+lt,left:-(tt/2)+_e},nt=clsx(s.child,it&&s.childLeaving,j&&s.childPulsate);return!ot&&!it&&$(!0),reactExports.useEffect(()=>{if(!ot&&st!=null){const at=setTimeout(st,ct);return()=>{clearTimeout(at)}}},[st,ot,ct]),jsxRuntimeExports.jsx("span",{className:a,style:et,children:jsxRuntimeExports.jsx("span",{className:nt})})}const touchRippleClasses=generateUtilityClasses$1("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),_excluded$z=["center","classes","className"];let _$1=i=>i,_t$1,_t2$1,_t3$1,_t4$1;const DURATION=550,DELAY_RIPPLE=80,enterKeyframe=keyframes(_t$1||(_t$1=_$1` 0% { transform: scale(0); opacity: 0.1; } 100% { transform: scale(1); opacity: 0.3; } `)),exitKeyframe=keyframes(_t2$1||(_t2$1=_$1` 0% { opacity: 1; } 100% { opacity: 0; } `)),pulsateKeyframe=keyframes(_t3$1||(_t3$1=_$1` 0% { transform: scale(1); } 50% { transform: scale(0.92); } 100% { transform: scale(1); } `)),TouchRippleRoot=styled("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),TouchRippleRipple=styled(Ripple,{name:"MuiTouchRipple",slot:"Ripple"})(_t4$1||(_t4$1=_$1` opacity: 0; position: absolute; &.${0} { opacity: 0.3; transform: scale(1); animation-name: ${0}; animation-duration: ${0}ms; animation-timing-function: ${0}; } &.${0} { animation-duration: ${0}ms; } & .${0} { opacity: 1; display: block; width: 100%; height: 100%; border-radius: 50%; background-color: currentColor; } & .${0} { opacity: 0; animation-name: ${0}; animation-duration: ${0}ms; animation-timing-function: ${0}; } & .${0} { position: absolute; /* @noflip */ left: 0px; top: 0; animation-name: ${0}; animation-duration: 2500ms; animation-timing-function: ${0}; animation-iteration-count: infinite; animation-delay: 200ms; } `),touchRippleClasses.rippleVisible,enterKeyframe,DURATION,({theme:i})=>i.transitions.easing.easeInOut,touchRippleClasses.ripplePulsate,({theme:i})=>i.transitions.duration.shorter,touchRippleClasses.child,touchRippleClasses.childLeaving,exitKeyframe,DURATION,({theme:i})=>i.transitions.easing.easeInOut,touchRippleClasses.childPulsate,pulsateKeyframe,({theme:i})=>i.transitions.easing.easeInOut),TouchRipple=reactExports.forwardRef(function(o,s){const j=useThemeProps$1({props:o,name:"MuiTouchRipple"}),{center:_e=!1,classes:lt={},className:tt}=j,ot=_objectWithoutPropertiesLoose(j,_excluded$z),[st,ct]=reactExports.useState([]),it=reactExports.useRef(0),$=reactExports.useRef(null);reactExports.useEffect(()=>{$.current&&($.current(),$.current=null)},[st]);const a=reactExports.useRef(!1),et=useTimeout(),nt=reactExports.useRef(null),at=reactExports.useRef(null),rt=reactExports.useCallback(mt=>{const{pulsate:pt,rippleX:Zt,rippleY:ht,rippleSize:Gt,cb:Xt}=mt;ct(Vt=>[...Vt,jsxRuntimeExports.jsx(TouchRippleRipple,{classes:{ripple:clsx(lt.ripple,touchRippleClasses.ripple),rippleVisible:clsx(lt.rippleVisible,touchRippleClasses.rippleVisible),ripplePulsate:clsx(lt.ripplePulsate,touchRippleClasses.ripplePulsate),child:clsx(lt.child,touchRippleClasses.child),childLeaving:clsx(lt.childLeaving,touchRippleClasses.childLeaving),childPulsate:clsx(lt.childPulsate,touchRippleClasses.childPulsate)},timeout:DURATION,pulsate:pt,rippleX:Zt,rippleY:ht,rippleSize:Gt},it.current)]),it.current+=1,$.current=Xt},[lt]),dt=reactExports.useCallback((mt={},pt={},Zt=()=>{})=>{const{pulsate:ht=!1,center:Gt=_e||pt.pulsate,fakeElement:Xt=!1}=pt;if((mt==null?void 0:mt.type)==="mousedown"&&a.current){a.current=!1;return}(mt==null?void 0:mt.type)==="touchstart"&&(a.current=!0);const Vt=Xt?null:at.current,Yt=Vt?Vt.getBoundingClientRect():{width:0,height:0,left:0,top:0};let St,Lt,Ct;if(Gt||mt===void 0||mt.clientX===0&&mt.clientY===0||!mt.clientX&&!mt.touches)St=Math.round(Yt.width/2),Lt=Math.round(Yt.height/2);else{const{clientX:Tt,clientY:ft}=mt.touches&&mt.touches.length>0?mt.touches[0]:mt;St=Math.round(Tt-Yt.left),Lt=Math.round(ft-Yt.top)}if(Gt)Ct=Math.sqrt((2*Yt.width**2+Yt.height**2)/3),Ct%2===0&&(Ct+=1);else{const Tt=Math.max(Math.abs((Vt?Vt.clientWidth:0)-St),St)*2+2,ft=Math.max(Math.abs((Vt?Vt.clientHeight:0)-Lt),Lt)*2+2;Ct=Math.sqrt(Tt**2+ft**2)}mt!=null&&mt.touches?nt.current===null&&(nt.current=()=>{rt({pulsate:ht,rippleX:St,rippleY:Lt,rippleSize:Ct,cb:Zt})},et.start(DELAY_RIPPLE,()=>{nt.current&&(nt.current(),nt.current=null)})):rt({pulsate:ht,rippleX:St,rippleY:Lt,rippleSize:Ct,cb:Zt})},[_e,rt,et]),ut=reactExports.useCallback(()=>{dt({},{pulsate:!0})},[dt]),bt=reactExports.useCallback((mt,pt)=>{if(et.clear(),(mt==null?void 0:mt.type)==="touchend"&&nt.current){nt.current(),nt.current=null,et.start(0,()=>{bt(mt,pt)});return}nt.current=null,ct(Zt=>Zt.length>0?Zt.slice(1):Zt),$.current=pt},[et]);return reactExports.useImperativeHandle(s,()=>({pulsate:ut,start:dt,stop:bt}),[ut,dt,bt]),jsxRuntimeExports.jsx(TouchRippleRoot,_extends$1({className:clsx(touchRippleClasses.root,lt.root,tt),ref:at},ot,{children:jsxRuntimeExports.jsx(TransitionGroup$1,{component:null,exit:!0,children:st})}))}),TouchRipple$1=TouchRipple;function getButtonBaseUtilityClass(i){return generateUtilityClass$1("MuiButtonBase",i)}const buttonBaseClasses=generateUtilityClasses$1("MuiButtonBase",["root","disabled","focusVisible"]),_excluded$y=["action","centerRipple","children","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","LinkComponent","onBlur","onClick","onContextMenu","onDragLeave","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","tabIndex","TouchRippleProps","touchRippleRef","type"],useUtilityClasses$s=i=>{const{disabled:o,focusVisible:s,focusVisibleClassName:j,classes:_e}=i,tt=composeClasses({root:["root",o&&"disabled",s&&"focusVisible"]},getButtonBaseUtilityClass,_e);return s&&j&&(tt.root+=` ${j}`),tt},ButtonBaseRoot=styled("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(i,o)=>o.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${buttonBaseClasses.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),ButtonBase=reactExports.forwardRef(function(o,s){const j=useThemeProps$1({props:o,name:"MuiButtonBase"}),{action:_e,centerRipple:lt=!1,children:tt,className:ot,component:st="button",disabled:ct=!1,disableRipple:it=!1,disableTouchRipple:$=!1,focusRipple:a=!1,LinkComponent:et="a",onBlur:nt,onClick:at,onContextMenu:rt,onDragLeave:dt,onFocus:ut,onFocusVisible:bt,onKeyDown:mt,onKeyUp:pt,onMouseDown:Zt,onMouseLeave:ht,onMouseUp:Gt,onTouchEnd:Xt,onTouchMove:Vt,onTouchStart:Yt,tabIndex:St=0,TouchRippleProps:Lt,touchRippleRef:Ct,type:Tt}=j,ft=_objectWithoutPropertiesLoose(j,_excluded$y),Ft=reactExports.useRef(null),Jt=reactExports.useRef(null),Ht=useForkRef(Jt,Ct),{isFocusVisibleRef:wt,onFocus:Et,onBlur:At,ref:Il}=useIsFocusVisible(),[Qt,jt]=reactExports.useState(!1);ct&&Qt&&jt(!1),reactExports.useImperativeHandle(_e,()=>({focusVisible:()=>{jt(!0),Ft.current.focus()}}),[]);const[Xl,Yl]=reactExports.useState(!1);reactExports.useEffect(()=>{Yl(!0)},[]);const Rl=Xl&&!it&&!ct;reactExports.useEffect(()=>{Qt&&a&&!it&&Xl&&Jt.current.pulsate()},[it,a,Qt,Xl]);function Tl(Ot,rn,yn=$){return useEventCallback(an=>(rn&&rn(an),!yn&&Jt.current&&Jt.current[Ot](an),!0))}const zl=Tl("start",Zt),Ll=Tl("stop",rt),Cl=Tl("stop",dt),yl=Tl("stop",Gt),Wl=Tl("stop",Ot=>{Qt&&Ot.preventDefault(),ht&&ht(Ot)}),xl=Tl("start",Yt),Gl=Tl("stop",Xt),sn=Tl("stop",Vt),Fl=Tl("stop",Ot=>{At(Ot),wt.current===!1&&jt(!1),nt&&nt(Ot)},!1),cn=useEventCallback(Ot=>{Ft.current||(Ft.current=Ot.currentTarget),Et(Ot),wt.current===!0&&(jt(!0),bt&&bt(Ot)),ut&&ut(Ot)}),Ol=()=>{const Ot=Ft.current;return st&&st!=="button"&&!(Ot.tagName==="A"&&Ot.href)},Ml=reactExports.useRef(!1),Ul=useEventCallback(Ot=>{a&&!Ml.current&&Qt&&Jt.current&&Ot.key===" "&&(Ml.current=!0,Jt.current.stop(Ot,()=>{Jt.current.start(Ot)})),Ot.target===Ot.currentTarget&&Ol()&&Ot.key===" "&&Ot.preventDefault(),mt&&mt(Ot),Ot.target===Ot.currentTarget&&Ol()&&Ot.key==="Enter"&&!ct&&(Ot.preventDefault(),at&&at(Ot))}),Ql=useEventCallback(Ot=>{a&&Ot.key===" "&&Jt.current&&Qt&&!Ot.defaultPrevented&&(Ml.current=!1,Jt.current.stop(Ot,()=>{Jt.current.pulsate(Ot)})),pt&&pt(Ot),at&&Ot.target===Ot.currentTarget&&Ol()&&Ot.key===" "&&!Ot.defaultPrevented&&at(Ot)});let El=st;El==="button"&&(ft.href||ft.to)&&(El=et);const Nl={};El==="button"?(Nl.type=Tt===void 0?"button":Tt,Nl.disabled=ct):(!ft.href&&!ft.to&&(Nl.role="button"),ct&&(Nl["aria-disabled"]=ct));const Zn=useForkRef(s,Il,Ft),bn=_extends$1({},j,{centerRipple:lt,component:st,disabled:ct,disableRipple:it,disableTouchRipple:$,focusRipple:a,tabIndex:St,focusVisible:Qt}),Bl=useUtilityClasses$s(bn);return jsxRuntimeExports.jsxs(ButtonBaseRoot,_extends$1({as:El,className:clsx(Bl.root,ot),ownerState:bn,onBlur:Fl,onClick:at,onContextMenu:Ll,onFocus:cn,onKeyDown:Ul,onKeyUp:Ql,onMouseDown:zl,onMouseLeave:Wl,onMouseUp:yl,onDragLeave:Cl,onTouchEnd:Gl,onTouchMove:sn,onTouchStart:xl,ref:Zn,tabIndex:ct?-1:St,type:Tt},Nl,ft,{children:[tt,Rl?jsxRuntimeExports.jsx(TouchRipple$1,_extends$1({ref:Ht,center:lt},Lt)):null]}))}),ButtonBase$1=ButtonBase;function getIconButtonUtilityClass(i){return generateUtilityClass$1("MuiIconButton",i)}const iconButtonClasses=generateUtilityClasses$1("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge"]),_excluded$x=["edge","children","className","color","disabled","disableFocusRipple","size"],useUtilityClasses$r=i=>{const{classes:o,disabled:s,color:j,edge:_e,size:lt}=i,tt={root:["root",s&&"disabled",j!=="default"&&`color${capitalize$1(j)}`,_e&&`edge${capitalize$1(_e)}`,`size${capitalize$1(lt)}`]};return composeClasses(tt,getIconButtonUtilityClass,o)},IconButtonRoot=styled(ButtonBase$1,{name:"MuiIconButton",slot:"Root",overridesResolver:(i,o)=>{const{ownerState:s}=i;return[o.root,s.color!=="default"&&o[`color${capitalize$1(s.color)}`],s.edge&&o[`edge${capitalize$1(s.edge)}`],o[`size${capitalize$1(s.size)}`]]}})(({theme:i,ownerState:o})=>_extends$1({textAlign:"center",flex:"0 0 auto",fontSize:i.typography.pxToRem(24),padding:8,borderRadius:"50%",overflow:"visible",color:(i.vars||i).palette.action.active,transition:i.transitions.create("background-color",{duration:i.transitions.duration.shortest})},!o.disableRipple&&{"&:hover":{backgroundColor:i.vars?`rgba(${i.vars.palette.action.activeChannel} / ${i.vars.palette.action.hoverOpacity})`:alpha_1(i.palette.action.active,i.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},o.edge==="start"&&{marginLeft:o.size==="small"?-3:-12},o.edge==="end"&&{marginRight:o.size==="small"?-3:-12}),({theme:i,ownerState:o})=>{var s;const j=(s=(i.vars||i).palette)==null?void 0:s[o.color];return _extends$1({},o.color==="inherit"&&{color:"inherit"},o.color!=="inherit"&&o.color!=="default"&&_extends$1({color:j==null?void 0:j.main},!o.disableRipple&&{"&:hover":_extends$1({},j&&{backgroundColor:i.vars?`rgba(${j.mainChannel} / ${i.vars.palette.action.hoverOpacity})`:alpha_1(j.main,i.palette.action.hoverOpacity)},{"@media (hover: none)":{backgroundColor:"transparent"}})}),o.size==="small"&&{padding:5,fontSize:i.typography.pxToRem(18)},o.size==="large"&&{padding:12,fontSize:i.typography.pxToRem(28)},{[`&.${iconButtonClasses.disabled}`]:{backgroundColor:"transparent",color:(i.vars||i).palette.action.disabled}})}),IconButton=reactExports.forwardRef(function(o,s){const j=useThemeProps$1({props:o,name:"MuiIconButton"}),{edge:_e=!1,children:lt,className:tt,color:ot="default",disabled:st=!1,disableFocusRipple:ct=!1,size:it="medium"}=j,$=_objectWithoutPropertiesLoose(j,_excluded$x),a=_extends$1({},j,{edge:_e,color:ot,disabled:st,disableFocusRipple:ct,size:it}),et=useUtilityClasses$r(a);return jsxRuntimeExports.jsx(IconButtonRoot,_extends$1({className:clsx(et.root,tt),centerRipple:!0,focusRipple:!ct,disabled:st,ref:s},$,{ownerState:a,children:lt}))}),IconButton$1=IconButton,ClearIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");function getTypographyUtilityClass(i){return generateUtilityClass$1("MuiTypography",i)}generateUtilityClasses$1("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const _excluded$w=["align","className","component","gutterBottom","noWrap","paragraph","variant","variantMapping"],useUtilityClasses$q=i=>{const{align:o,gutterBottom:s,noWrap:j,paragraph:_e,variant:lt,classes:tt}=i,ot={root:["root",lt,i.align!=="inherit"&&`align${capitalize$1(o)}`,s&&"gutterBottom",j&&"noWrap",_e&&"paragraph"]};return composeClasses(ot,getTypographyUtilityClass,tt)},TypographyRoot=styled("span",{name:"MuiTypography",slot:"Root",overridesResolver:(i,o)=>{const{ownerState:s}=i;return[o.root,s.variant&&o[s.variant],s.align!=="inherit"&&o[`align${capitalize$1(s.align)}`],s.noWrap&&o.noWrap,s.gutterBottom&&o.gutterBottom,s.paragraph&&o.paragraph]}})(({theme:i,ownerState:o})=>_extends$1({margin:0},o.variant==="inherit"&&{font:"inherit"},o.variant!=="inherit"&&i.typography[o.variant],o.align!=="inherit"&&{textAlign:o.align},o.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},o.gutterBottom&&{marginBottom:"0.35em"},o.paragraph&&{marginBottom:16})),defaultVariantMapping={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},colorTransformations$1={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},transformDeprecatedColors$1=i=>colorTransformations$1[i]||i,Typography=reactExports.forwardRef(function(o,s){const j=useThemeProps$1({props:o,name:"MuiTypography"}),_e=transformDeprecatedColors$1(j.color),lt=extendSxProp(_extends$1({},j,{color:_e})),{align:tt="inherit",className:ot,component:st,gutterBottom:ct=!1,noWrap:it=!1,paragraph:$=!1,variant:a="body1",variantMapping:et=defaultVariantMapping}=lt,nt=_objectWithoutPropertiesLoose(lt,_excluded$w),at=_extends$1({},lt,{align:tt,color:_e,className:ot,component:st,gutterBottom:ct,noWrap:it,paragraph:$,variant:a,variantMapping:et}),rt=st||($?"p":et[a]||defaultVariantMapping[a])||"span",dt=useUtilityClasses$q(at);return jsxRuntimeExports.jsx(TypographyRoot,_extends$1({as:rt,ref:s,ownerState:at,className:clsx(dt.root,ot)},nt))}),Typography$1=Typography,GLOBAL_CLASS_PREFIX="base";function buildStateClass(i){return`${GLOBAL_CLASS_PREFIX}--${i}`}function buildSlotClass(i,o){return`${GLOBAL_CLASS_PREFIX}-${i}-${o}`}function generateUtilityClass(i,o){const s=globalStateClasses[o];return s?buildStateClass(s):buildSlotClass(i,o)}function generateUtilityClasses(i,o){const s={};return o.forEach(j=>{s[j]=generateUtilityClass(i,j)}),s}const candidatesSelector=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function getTabIndex(i){const o=parseInt(i.getAttribute("tabindex")||"",10);return Number.isNaN(o)?i.contentEditable==="true"||(i.nodeName==="AUDIO"||i.nodeName==="VIDEO"||i.nodeName==="DETAILS")&&i.getAttribute("tabindex")===null?0:i.tabIndex:o}function isNonTabbableRadio(i){if(i.tagName!=="INPUT"||i.type!=="radio"||!i.name)return!1;const o=j=>i.ownerDocument.querySelector(`input[type="radio"]${j}`);let s=o(`[name="${i.name}"]:checked`);return s||(s=o(`[name="${i.name}"]`)),s!==i}function isNodeMatchingSelectorFocusable(i){return!(i.disabled||i.tagName==="INPUT"&&i.type==="hidden"||isNonTabbableRadio(i))}function defaultGetTabbable(i){const o=[],s=[];return Array.from(i.querySelectorAll(candidatesSelector)).forEach((j,_e)=>{const lt=getTabIndex(j);lt===-1||!isNodeMatchingSelectorFocusable(j)||(lt===0?o.push(j):s.push({documentOrder:_e,tabIndex:lt,node:j}))}),s.sort((j,_e)=>j.tabIndex===_e.tabIndex?j.documentOrder-_e.documentOrder:j.tabIndex-_e.tabIndex).map(j=>j.node).concat(o)}function defaultIsEnabled(){return!0}function FocusTrap(i){const{children:o,disableAutoFocus:s=!1,disableEnforceFocus:j=!1,disableRestoreFocus:_e=!1,getTabbable:lt=defaultGetTabbable,isEnabled:tt=defaultIsEnabled,open:ot}=i,st=reactExports.useRef(!1),ct=reactExports.useRef(null),it=reactExports.useRef(null),$=reactExports.useRef(null),a=reactExports.useRef(null),et=reactExports.useRef(!1),nt=reactExports.useRef(null),at=useForkRef(o.ref,nt),rt=reactExports.useRef(null);reactExports.useEffect(()=>{!ot||!nt.current||(et.current=!s)},[s,ot]),reactExports.useEffect(()=>{if(!ot||!nt.current)return;const bt=ownerDocument(nt.current);return nt.current.contains(bt.activeElement)||(nt.current.hasAttribute("tabIndex")||nt.current.setAttribute("tabIndex","-1"),et.current&&nt.current.focus()),()=>{_e||($.current&&$.current.focus&&(st.current=!0,$.current.focus()),$.current=null)}},[ot]),reactExports.useEffect(()=>{if(!ot||!nt.current)return;const bt=ownerDocument(nt.current),mt=ht=>{rt.current=ht,!(j||!tt()||ht.key!=="Tab")&&bt.activeElement===nt.current&&ht.shiftKey&&(st.current=!0,it.current&&it.current.focus())},pt=()=>{const ht=nt.current;if(ht===null)return;if(!bt.hasFocus()||!tt()||st.current){st.current=!1;return}if(ht.contains(bt.activeElement)||j&&bt.activeElement!==ct.current&&bt.activeElement!==it.current)return;if(bt.activeElement!==a.current)a.current=null;else if(a.current!==null)return;if(!et.current)return;let Gt=[];if((bt.activeElement===ct.current||bt.activeElement===it.current)&&(Gt=lt(nt.current)),Gt.length>0){var Xt,Vt;const Yt=!!((Xt=rt.current)!=null&&Xt.shiftKey&&((Vt=rt.current)==null?void 0:Vt.key)==="Tab"),St=Gt[0],Lt=Gt[Gt.length-1];typeof St!="string"&&typeof Lt!="string"&&(Yt?Lt.focus():St.focus())}else ht.focus()};bt.addEventListener("focusin",pt),bt.addEventListener("keydown",mt,!0);const Zt=setInterval(()=>{bt.activeElement&&bt.activeElement.tagName==="BODY"&&pt()},50);return()=>{clearInterval(Zt),bt.removeEventListener("focusin",pt),bt.removeEventListener("keydown",mt,!0)}},[s,j,_e,tt,ot,lt]);const dt=bt=>{$.current===null&&($.current=bt.relatedTarget),et.current=!0,a.current=bt.target;const mt=o.props.onFocus;mt&&mt(bt)},ut=bt=>{$.current===null&&($.current=bt.relatedTarget),et.current=!0};return jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{tabIndex:ot?0:-1,onFocus:ut,ref:ct,"data-testid":"sentinelStart"}),reactExports.cloneElement(o,{ref:at,onFocus:dt}),jsxRuntimeExports.jsx("div",{tabIndex:ot?0:-1,onFocus:ut,ref:it,"data-testid":"sentinelEnd"})]})}function getContainer$1(i){return typeof i=="function"?i():i}const Portal=reactExports.forwardRef(function(o,s){const{children:j,container:_e,disablePortal:lt=!1}=o,[tt,ot]=reactExports.useState(null),st=useForkRef(reactExports.isValidElement(j)?j.ref:null,s);if(useEnhancedEffect(()=>{lt||ot(getContainer$1(_e)||document.body)},[_e,lt]),useEnhancedEffect(()=>{if(tt&&!lt)return setRef(s,tt),()=>{setRef(s,null)}},[s,tt,lt]),lt){if(reactExports.isValidElement(j)){const ct={ref:st};return reactExports.cloneElement(j,ct)}return jsxRuntimeExports.jsx(reactExports.Fragment,{children:j})}return jsxRuntimeExports.jsx(reactExports.Fragment,{children:tt&&reactDomExports.createPortal(j,tt)})});function isOverflowing(i){const o=ownerDocument(i);return o.body===i?ownerWindow(i).innerWidth>o.documentElement.clientWidth:i.scrollHeight>i.clientHeight}function ariaHidden(i,o){o?i.setAttribute("aria-hidden","true"):i.removeAttribute("aria-hidden")}function getPaddingRight(i){return parseInt(ownerWindow(i).getComputedStyle(i).paddingRight,10)||0}function isAriaHiddenForbiddenOnElement(i){const s=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].indexOf(i.tagName)!==-1,j=i.tagName==="INPUT"&&i.getAttribute("type")==="hidden";return s||j}function ariaHiddenSiblings(i,o,s,j,_e){const lt=[o,s,...j];[].forEach.call(i.children,tt=>{const ot=lt.indexOf(tt)===-1,st=!isAriaHiddenForbiddenOnElement(tt);ot&&st&&ariaHidden(tt,_e)})}function findIndexOf(i,o){let s=-1;return i.some((j,_e)=>o(j)?(s=_e,!0):!1),s}function handleContainer(i,o){const s=[],j=i.container;if(!o.disableScrollLock){if(isOverflowing(j)){const tt=getScrollbarSize(ownerDocument(j));s.push({value:j.style.paddingRight,property:"padding-right",el:j}),j.style.paddingRight=`${getPaddingRight(j)+tt}px`;const ot=ownerDocument(j).querySelectorAll(".mui-fixed");[].forEach.call(ot,st=>{s.push({value:st.style.paddingRight,property:"padding-right",el:st}),st.style.paddingRight=`${getPaddingRight(st)+tt}px`})}let lt;if(j.parentNode instanceof DocumentFragment)lt=ownerDocument(j).body;else{const tt=j.parentElement,ot=ownerWindow(j);lt=(tt==null?void 0:tt.nodeName)==="HTML"&&ot.getComputedStyle(tt).overflowY==="scroll"?tt:j}s.push({value:lt.style.overflow,property:"overflow",el:lt},{value:lt.style.overflowX,property:"overflow-x",el:lt},{value:lt.style.overflowY,property:"overflow-y",el:lt}),lt.style.overflow="hidden"}return()=>{s.forEach(({value:lt,el:tt,property:ot})=>{lt?tt.style.setProperty(ot,lt):tt.style.removeProperty(ot)})}}function getHiddenSiblings(i){const o=[];return[].forEach.call(i.children,s=>{s.getAttribute("aria-hidden")==="true"&&o.push(s)}),o}class ModalManager{constructor(){this.containers=void 0,this.modals=void 0,this.modals=[],this.containers=[]}add(o,s){let j=this.modals.indexOf(o);if(j!==-1)return j;j=this.modals.length,this.modals.push(o),o.modalRef&&ariaHidden(o.modalRef,!1);const _e=getHiddenSiblings(s);ariaHiddenSiblings(s,o.mount,o.modalRef,_e,!0);const lt=findIndexOf(this.containers,tt=>tt.container===s);return lt!==-1?(this.containers[lt].modals.push(o),j):(this.containers.push({modals:[o],container:s,restore:null,hiddenSiblings:_e}),j)}mount(o,s){const j=findIndexOf(this.containers,lt=>lt.modals.indexOf(o)!==-1),_e=this.containers[j];_e.restore||(_e.restore=handleContainer(_e,s))}remove(o,s=!0){const j=this.modals.indexOf(o);if(j===-1)return j;const _e=findIndexOf(this.containers,tt=>tt.modals.indexOf(o)!==-1),lt=this.containers[_e];if(lt.modals.splice(lt.modals.indexOf(o),1),this.modals.splice(j,1),lt.modals.length===0)lt.restore&<.restore(),o.modalRef&&ariaHidden(o.modalRef,s),ariaHiddenSiblings(lt.container,o.mount,o.modalRef,lt.hiddenSiblings,!1),this.containers.splice(_e,1);else{const tt=lt.modals[lt.modals.length-1];tt.modalRef&&ariaHidden(tt.modalRef,!1)}return j}isTopModal(o){return this.modals.length>0&&this.modals[this.modals.length-1]===o}}function getContainer(i){return typeof i=="function"?i():i}function getHasTransition(i){return i?i.props.hasOwnProperty("in"):!1}const defaultManager=new ModalManager;function useModal(i){const{container:o,disableEscapeKeyDown:s=!1,disableScrollLock:j=!1,manager:_e=defaultManager,closeAfterTransition:lt=!1,onTransitionEnter:tt,onTransitionExited:ot,children:st,onClose:ct,open:it,rootRef:$}=i,a=reactExports.useRef({}),et=reactExports.useRef(null),nt=reactExports.useRef(null),at=useForkRef(nt,$),[rt,dt]=reactExports.useState(!it),ut=getHasTransition(st);let bt=!0;(i["aria-hidden"]==="false"||i["aria-hidden"]===!1)&&(bt=!1);const mt=()=>ownerDocument(et.current),pt=()=>(a.current.modalRef=nt.current,a.current.mount=et.current,a.current),Zt=()=>{_e.mount(pt(),{disableScrollLock:j}),nt.current&&(nt.current.scrollTop=0)},ht=useEventCallback(()=>{const ft=getContainer(o)||mt().body;_e.add(pt(),ft),nt.current&&Zt()}),Gt=reactExports.useCallback(()=>_e.isTopModal(pt()),[_e]),Xt=useEventCallback(ft=>{et.current=ft,ft&&(it&&Gt()?Zt():nt.current&&ariaHidden(nt.current,bt))}),Vt=reactExports.useCallback(()=>{_e.remove(pt(),bt)},[bt,_e]);reactExports.useEffect(()=>()=>{Vt()},[Vt]),reactExports.useEffect(()=>{it?ht():(!ut||!lt)&&Vt()},[it,Vt,ut,lt,ht]);const Yt=ft=>Ft=>{var Jt;(Jt=ft.onKeyDown)==null||Jt.call(ft,Ft),!(Ft.key!=="Escape"||Ft.which===229||!Gt())&&(s||(Ft.stopPropagation(),ct&&ct(Ft,"escapeKeyDown")))},St=ft=>Ft=>{var Jt;(Jt=ft.onClick)==null||Jt.call(ft,Ft),Ft.target===Ft.currentTarget&&ct&&ct(Ft,"backdropClick")};return{getRootProps:(ft={})=>{const Ft=extractEventHandlers(i);delete Ft.onTransitionEnter,delete Ft.onTransitionExited;const Jt=_extends$1({},Ft,ft);return _extends$1({role:"presentation"},Jt,{onKeyDown:Yt(Jt),ref:at})},getBackdropProps:(ft={})=>{const Ft=ft;return _extends$1({"aria-hidden":!0},Ft,{onClick:St(Ft),open:it})},getTransitionProps:()=>{const ft=()=>{dt(!1),tt&&tt()},Ft=()=>{dt(!0),ot&&ot(),lt&&Vt()};return{onEnter:createChainedFunction(ft,st==null?void 0:st.props.onEnter),onExited:createChainedFunction(Ft,st==null?void 0:st.props.onExited)}},rootRef:at,portalRef:Xt,isTopModal:Gt,exited:rt,hasTransition:ut}}var top="top",bottom="bottom",right="right",left="left",auto="auto",basePlacements=[top,bottom,right,left],start="start",end="end",clippingParents="clippingParents",viewport="viewport",popper="popper",reference="reference",variationPlacements=basePlacements.reduce(function(i,o){return i.concat([o+"-"+start,o+"-"+end])},[]),placements=[].concat(basePlacements,[auto]).reduce(function(i,o){return i.concat([o,o+"-"+start,o+"-"+end])},[]),beforeRead="beforeRead",read="read",afterRead="afterRead",beforeMain="beforeMain",main="main",afterMain="afterMain",beforeWrite="beforeWrite",write="write",afterWrite="afterWrite",modifierPhases=[beforeRead,read,afterRead,beforeMain,main,afterMain,beforeWrite,write,afterWrite];function getNodeName(i){return i?(i.nodeName||"").toLowerCase():null}function getWindow(i){if(i==null)return window;if(i.toString()!=="[object Window]"){var o=i.ownerDocument;return o&&o.defaultView||window}return i}function isElement(i){var o=getWindow(i).Element;return i instanceof o||i instanceof Element}function isHTMLElement$1(i){var o=getWindow(i).HTMLElement;return i instanceof o||i instanceof HTMLElement}function isShadowRoot(i){if(typeof ShadowRoot>"u")return!1;var o=getWindow(i).ShadowRoot;return i instanceof o||i instanceof ShadowRoot}function applyStyles(i){var o=i.state;Object.keys(o.elements).forEach(function(s){var j=o.styles[s]||{},_e=o.attributes[s]||{},lt=o.elements[s];!isHTMLElement$1(lt)||!getNodeName(lt)||(Object.assign(lt.style,j),Object.keys(_e).forEach(function(tt){var ot=_e[tt];ot===!1?lt.removeAttribute(tt):lt.setAttribute(tt,ot===!0?"":ot)}))})}function effect$2(i){var o=i.state,s={popper:{position:o.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(o.elements.popper.style,s.popper),o.styles=s,o.elements.arrow&&Object.assign(o.elements.arrow.style,s.arrow),function(){Object.keys(o.elements).forEach(function(j){var _e=o.elements[j],lt=o.attributes[j]||{},tt=Object.keys(o.styles.hasOwnProperty(j)?o.styles[j]:s[j]),ot=tt.reduce(function(st,ct){return st[ct]="",st},{});!isHTMLElement$1(_e)||!getNodeName(_e)||(Object.assign(_e.style,ot),Object.keys(lt).forEach(function(st){_e.removeAttribute(st)}))})}}const applyStyles$1={name:"applyStyles",enabled:!0,phase:"write",fn:applyStyles,effect:effect$2,requires:["computeStyles"]};function getBasePlacement(i){return i.split("-")[0]}var max$1=Math.max,min=Math.min,round=Math.round;function getUAString(){var i=navigator.userAgentData;return i!=null&&i.brands&&Array.isArray(i.brands)?i.brands.map(function(o){return o.brand+"/"+o.version}).join(" "):navigator.userAgent}function isLayoutViewport(){return!/^((?!chrome|android).)*safari/i.test(getUAString())}function getBoundingClientRect(i,o,s){o===void 0&&(o=!1),s===void 0&&(s=!1);var j=i.getBoundingClientRect(),_e=1,lt=1;o&&isHTMLElement$1(i)&&(_e=i.offsetWidth>0&&round(j.width)/i.offsetWidth||1,lt=i.offsetHeight>0&&round(j.height)/i.offsetHeight||1);var tt=isElement(i)?getWindow(i):window,ot=tt.visualViewport,st=!isLayoutViewport()&&s,ct=(j.left+(st&&ot?ot.offsetLeft:0))/_e,it=(j.top+(st&&ot?ot.offsetTop:0))/lt,$=j.width/_e,a=j.height/lt;return{width:$,height:a,top:it,right:ct+$,bottom:it+a,left:ct,x:ct,y:it}}function getLayoutRect(i){var o=getBoundingClientRect(i),s=i.offsetWidth,j=i.offsetHeight;return Math.abs(o.width-s)<=1&&(s=o.width),Math.abs(o.height-j)<=1&&(j=o.height),{x:i.offsetLeft,y:i.offsetTop,width:s,height:j}}function contains(i,o){var s=o.getRootNode&&o.getRootNode();if(i.contains(o))return!0;if(s&&isShadowRoot(s)){var j=o;do{if(j&&i.isSameNode(j))return!0;j=j.parentNode||j.host}while(j)}return!1}function getComputedStyle(i){return getWindow(i).getComputedStyle(i)}function isTableElement(i){return["table","td","th"].indexOf(getNodeName(i))>=0}function getDocumentElement(i){return((isElement(i)?i.ownerDocument:i.document)||window.document).documentElement}function getParentNode(i){return getNodeName(i)==="html"?i:i.assignedSlot||i.parentNode||(isShadowRoot(i)?i.host:null)||getDocumentElement(i)}function getTrueOffsetParent(i){return!isHTMLElement$1(i)||getComputedStyle(i).position==="fixed"?null:i.offsetParent}function getContainingBlock(i){var o=/firefox/i.test(getUAString()),s=/Trident/i.test(getUAString());if(s&&isHTMLElement$1(i)){var j=getComputedStyle(i);if(j.position==="fixed")return null}var _e=getParentNode(i);for(isShadowRoot(_e)&&(_e=_e.host);isHTMLElement$1(_e)&&["html","body"].indexOf(getNodeName(_e))<0;){var lt=getComputedStyle(_e);if(lt.transform!=="none"||lt.perspective!=="none"||lt.contain==="paint"||["transform","perspective"].indexOf(lt.willChange)!==-1||o&<.willChange==="filter"||o&<.filter&<.filter!=="none")return _e;_e=_e.parentNode}return null}function getOffsetParent(i){for(var o=getWindow(i),s=getTrueOffsetParent(i);s&&isTableElement(s)&&getComputedStyle(s).position==="static";)s=getTrueOffsetParent(s);return s&&(getNodeName(s)==="html"||getNodeName(s)==="body"&&getComputedStyle(s).position==="static")?o:s||getContainingBlock(i)||o}function getMainAxisFromPlacement(i){return["top","bottom"].indexOf(i)>=0?"x":"y"}function within(i,o,s){return max$1(i,min(o,s))}function withinMaxClamp(i,o,s){var j=within(i,o,s);return j>s?s:j}function getFreshSideObject(){return{top:0,right:0,bottom:0,left:0}}function mergePaddingObject(i){return Object.assign({},getFreshSideObject(),i)}function expandToHashMap(i,o){return o.reduce(function(s,j){return s[j]=i,s},{})}var toPaddingObject=function(o,s){return o=typeof o=="function"?o(Object.assign({},s.rects,{placement:s.placement})):o,mergePaddingObject(typeof o!="number"?o:expandToHashMap(o,basePlacements))};function arrow(i){var o,s=i.state,j=i.name,_e=i.options,lt=s.elements.arrow,tt=s.modifiersData.popperOffsets,ot=getBasePlacement(s.placement),st=getMainAxisFromPlacement(ot),ct=[left,right].indexOf(ot)>=0,it=ct?"height":"width";if(!(!lt||!tt)){var $=toPaddingObject(_e.padding,s),a=getLayoutRect(lt),et=st==="y"?top:left,nt=st==="y"?bottom:right,at=s.rects.reference[it]+s.rects.reference[st]-tt[st]-s.rects.popper[it],rt=tt[st]-s.rects.reference[st],dt=getOffsetParent(lt),ut=dt?st==="y"?dt.clientHeight||0:dt.clientWidth||0:0,bt=at/2-rt/2,mt=$[et],pt=ut-a[it]-$[nt],Zt=ut/2-a[it]/2+bt,ht=within(mt,Zt,pt),Gt=st;s.modifiersData[j]=(o={},o[Gt]=ht,o.centerOffset=ht-Zt,o)}}function effect$1(i){var o=i.state,s=i.options,j=s.element,_e=j===void 0?"[data-popper-arrow]":j;_e!=null&&(typeof _e=="string"&&(_e=o.elements.popper.querySelector(_e),!_e)||contains(o.elements.popper,_e)&&(o.elements.arrow=_e))}const arrow$1={name:"arrow",enabled:!0,phase:"main",fn:arrow,effect:effect$1,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function getVariation(i){return i.split("-")[1]}var unsetSides={top:"auto",right:"auto",bottom:"auto",left:"auto"};function roundOffsetsByDPR(i,o){var s=i.x,j=i.y,_e=o.devicePixelRatio||1;return{x:round(s*_e)/_e||0,y:round(j*_e)/_e||0}}function mapToStyles(i){var o,s=i.popper,j=i.popperRect,_e=i.placement,lt=i.variation,tt=i.offsets,ot=i.position,st=i.gpuAcceleration,ct=i.adaptive,it=i.roundOffsets,$=i.isFixed,a=tt.x,et=a===void 0?0:a,nt=tt.y,at=nt===void 0?0:nt,rt=typeof it=="function"?it({x:et,y:at}):{x:et,y:at};et=rt.x,at=rt.y;var dt=tt.hasOwnProperty("x"),ut=tt.hasOwnProperty("y"),bt=left,mt=top,pt=window;if(ct){var Zt=getOffsetParent(s),ht="clientHeight",Gt="clientWidth";if(Zt===getWindow(s)&&(Zt=getDocumentElement(s),getComputedStyle(Zt).position!=="static"&&ot==="absolute"&&(ht="scrollHeight",Gt="scrollWidth")),Zt=Zt,_e===top||(_e===left||_e===right)&<===end){mt=bottom;var Xt=$&&Zt===pt&&pt.visualViewport?pt.visualViewport.height:Zt[ht];at-=Xt-j.height,at*=st?1:-1}if(_e===left||(_e===top||_e===bottom)&<===end){bt=right;var Vt=$&&Zt===pt&&pt.visualViewport?pt.visualViewport.width:Zt[Gt];et-=Vt-j.width,et*=st?1:-1}}var Yt=Object.assign({position:ot},ct&&unsetSides),St=it===!0?roundOffsetsByDPR({x:et,y:at},getWindow(s)):{x:et,y:at};if(et=St.x,at=St.y,st){var Lt;return Object.assign({},Yt,(Lt={},Lt[mt]=ut?"0":"",Lt[bt]=dt?"0":"",Lt.transform=(pt.devicePixelRatio||1)<=1?"translate("+et+"px, "+at+"px)":"translate3d("+et+"px, "+at+"px, 0)",Lt))}return Object.assign({},Yt,(o={},o[mt]=ut?at+"px":"",o[bt]=dt?et+"px":"",o.transform="",o))}function computeStyles(i){var o=i.state,s=i.options,j=s.gpuAcceleration,_e=j===void 0?!0:j,lt=s.adaptive,tt=lt===void 0?!0:lt,ot=s.roundOffsets,st=ot===void 0?!0:ot,ct={placement:getBasePlacement(o.placement),variation:getVariation(o.placement),popper:o.elements.popper,popperRect:o.rects.popper,gpuAcceleration:_e,isFixed:o.options.strategy==="fixed"};o.modifiersData.popperOffsets!=null&&(o.styles.popper=Object.assign({},o.styles.popper,mapToStyles(Object.assign({},ct,{offsets:o.modifiersData.popperOffsets,position:o.options.strategy,adaptive:tt,roundOffsets:st})))),o.modifiersData.arrow!=null&&(o.styles.arrow=Object.assign({},o.styles.arrow,mapToStyles(Object.assign({},ct,{offsets:o.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:st})))),o.attributes.popper=Object.assign({},o.attributes.popper,{"data-popper-placement":o.placement})}const computeStyles$1={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:computeStyles,data:{}};var passive={passive:!0};function effect(i){var o=i.state,s=i.instance,j=i.options,_e=j.scroll,lt=_e===void 0?!0:_e,tt=j.resize,ot=tt===void 0?!0:tt,st=getWindow(o.elements.popper),ct=[].concat(o.scrollParents.reference,o.scrollParents.popper);return lt&&ct.forEach(function(it){it.addEventListener("scroll",s.update,passive)}),ot&&st.addEventListener("resize",s.update,passive),function(){lt&&ct.forEach(function(it){it.removeEventListener("scroll",s.update,passive)}),ot&&st.removeEventListener("resize",s.update,passive)}}const eventListeners={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect,data:{}};var hash$1={left:"right",right:"left",bottom:"top",top:"bottom"};function getOppositePlacement(i){return i.replace(/left|right|bottom|top/g,function(o){return hash$1[o]})}var hash={start:"end",end:"start"};function getOppositeVariationPlacement(i){return i.replace(/start|end/g,function(o){return hash[o]})}function getWindowScroll(i){var o=getWindow(i),s=o.pageXOffset,j=o.pageYOffset;return{scrollLeft:s,scrollTop:j}}function getWindowScrollBarX(i){return getBoundingClientRect(getDocumentElement(i)).left+getWindowScroll(i).scrollLeft}function getViewportRect(i,o){var s=getWindow(i),j=getDocumentElement(i),_e=s.visualViewport,lt=j.clientWidth,tt=j.clientHeight,ot=0,st=0;if(_e){lt=_e.width,tt=_e.height;var ct=isLayoutViewport();(ct||!ct&&o==="fixed")&&(ot=_e.offsetLeft,st=_e.offsetTop)}return{width:lt,height:tt,x:ot+getWindowScrollBarX(i),y:st}}function getDocumentRect(i){var o,s=getDocumentElement(i),j=getWindowScroll(i),_e=(o=i.ownerDocument)==null?void 0:o.body,lt=max$1(s.scrollWidth,s.clientWidth,_e?_e.scrollWidth:0,_e?_e.clientWidth:0),tt=max$1(s.scrollHeight,s.clientHeight,_e?_e.scrollHeight:0,_e?_e.clientHeight:0),ot=-j.scrollLeft+getWindowScrollBarX(i),st=-j.scrollTop;return getComputedStyle(_e||s).direction==="rtl"&&(ot+=max$1(s.clientWidth,_e?_e.clientWidth:0)-lt),{width:lt,height:tt,x:ot,y:st}}function isScrollParent(i){var o=getComputedStyle(i),s=o.overflow,j=o.overflowX,_e=o.overflowY;return/auto|scroll|overlay|hidden/.test(s+_e+j)}function getScrollParent(i){return["html","body","#document"].indexOf(getNodeName(i))>=0?i.ownerDocument.body:isHTMLElement$1(i)&&isScrollParent(i)?i:getScrollParent(getParentNode(i))}function listScrollParents(i,o){var s;o===void 0&&(o=[]);var j=getScrollParent(i),_e=j===((s=i.ownerDocument)==null?void 0:s.body),lt=getWindow(j),tt=_e?[lt].concat(lt.visualViewport||[],isScrollParent(j)?j:[]):j,ot=o.concat(tt);return _e?ot:ot.concat(listScrollParents(getParentNode(tt)))}function rectToClientRect(i){return Object.assign({},i,{left:i.x,top:i.y,right:i.x+i.width,bottom:i.y+i.height})}function getInnerBoundingClientRect(i,o){var s=getBoundingClientRect(i,!1,o==="fixed");return s.top=s.top+i.clientTop,s.left=s.left+i.clientLeft,s.bottom=s.top+i.clientHeight,s.right=s.left+i.clientWidth,s.width=i.clientWidth,s.height=i.clientHeight,s.x=s.left,s.y=s.top,s}function getClientRectFromMixedType(i,o,s){return o===viewport?rectToClientRect(getViewportRect(i,s)):isElement(o)?getInnerBoundingClientRect(o,s):rectToClientRect(getDocumentRect(getDocumentElement(i)))}function getClippingParents(i){var o=listScrollParents(getParentNode(i)),s=["absolute","fixed"].indexOf(getComputedStyle(i).position)>=0,j=s&&isHTMLElement$1(i)?getOffsetParent(i):i;return isElement(j)?o.filter(function(_e){return isElement(_e)&&contains(_e,j)&&getNodeName(_e)!=="body"}):[]}function getClippingRect(i,o,s,j){var _e=o==="clippingParents"?getClippingParents(i):[].concat(o),lt=[].concat(_e,[s]),tt=lt[0],ot=lt.reduce(function(st,ct){var it=getClientRectFromMixedType(i,ct,j);return st.top=max$1(it.top,st.top),st.right=min(it.right,st.right),st.bottom=min(it.bottom,st.bottom),st.left=max$1(it.left,st.left),st},getClientRectFromMixedType(i,tt,j));return ot.width=ot.right-ot.left,ot.height=ot.bottom-ot.top,ot.x=ot.left,ot.y=ot.top,ot}function computeOffsets(i){var o=i.reference,s=i.element,j=i.placement,_e=j?getBasePlacement(j):null,lt=j?getVariation(j):null,tt=o.x+o.width/2-s.width/2,ot=o.y+o.height/2-s.height/2,st;switch(_e){case top:st={x:tt,y:o.y-s.height};break;case bottom:st={x:tt,y:o.y+o.height};break;case right:st={x:o.x+o.width,y:ot};break;case left:st={x:o.x-s.width,y:ot};break;default:st={x:o.x,y:o.y}}var ct=_e?getMainAxisFromPlacement(_e):null;if(ct!=null){var it=ct==="y"?"height":"width";switch(lt){case start:st[ct]=st[ct]-(o[it]/2-s[it]/2);break;case end:st[ct]=st[ct]+(o[it]/2-s[it]/2);break}}return st}function detectOverflow(i,o){o===void 0&&(o={});var s=o,j=s.placement,_e=j===void 0?i.placement:j,lt=s.strategy,tt=lt===void 0?i.strategy:lt,ot=s.boundary,st=ot===void 0?clippingParents:ot,ct=s.rootBoundary,it=ct===void 0?viewport:ct,$=s.elementContext,a=$===void 0?popper:$,et=s.altBoundary,nt=et===void 0?!1:et,at=s.padding,rt=at===void 0?0:at,dt=mergePaddingObject(typeof rt!="number"?rt:expandToHashMap(rt,basePlacements)),ut=a===popper?reference:popper,bt=i.rects.popper,mt=i.elements[nt?ut:a],pt=getClippingRect(isElement(mt)?mt:mt.contextElement||getDocumentElement(i.elements.popper),st,it,tt),Zt=getBoundingClientRect(i.elements.reference),ht=computeOffsets({reference:Zt,element:bt,strategy:"absolute",placement:_e}),Gt=rectToClientRect(Object.assign({},bt,ht)),Xt=a===popper?Gt:Zt,Vt={top:pt.top-Xt.top+dt.top,bottom:Xt.bottom-pt.bottom+dt.bottom,left:pt.left-Xt.left+dt.left,right:Xt.right-pt.right+dt.right},Yt=i.modifiersData.offset;if(a===popper&&Yt){var St=Yt[_e];Object.keys(Vt).forEach(function(Lt){var Ct=[right,bottom].indexOf(Lt)>=0?1:-1,Tt=[top,bottom].indexOf(Lt)>=0?"y":"x";Vt[Lt]+=St[Tt]*Ct})}return Vt}function computeAutoPlacement(i,o){o===void 0&&(o={});var s=o,j=s.placement,_e=s.boundary,lt=s.rootBoundary,tt=s.padding,ot=s.flipVariations,st=s.allowedAutoPlacements,ct=st===void 0?placements:st,it=getVariation(j),$=it?ot?variationPlacements:variationPlacements.filter(function(nt){return getVariation(nt)===it}):basePlacements,a=$.filter(function(nt){return ct.indexOf(nt)>=0});a.length===0&&(a=$);var et=a.reduce(function(nt,at){return nt[at]=detectOverflow(i,{placement:at,boundary:_e,rootBoundary:lt,padding:tt})[getBasePlacement(at)],nt},{});return Object.keys(et).sort(function(nt,at){return et[nt]-et[at]})}function getExpandedFallbackPlacements(i){if(getBasePlacement(i)===auto)return[];var o=getOppositePlacement(i);return[getOppositeVariationPlacement(i),o,getOppositeVariationPlacement(o)]}function flip(i){var o=i.state,s=i.options,j=i.name;if(!o.modifiersData[j]._skip){for(var _e=s.mainAxis,lt=_e===void 0?!0:_e,tt=s.altAxis,ot=tt===void 0?!0:tt,st=s.fallbackPlacements,ct=s.padding,it=s.boundary,$=s.rootBoundary,a=s.altBoundary,et=s.flipVariations,nt=et===void 0?!0:et,at=s.allowedAutoPlacements,rt=o.options.placement,dt=getBasePlacement(rt),ut=dt===rt,bt=st||(ut||!nt?[getOppositePlacement(rt)]:getExpandedFallbackPlacements(rt)),mt=[rt].concat(bt).reduce(function(Qt,jt){return Qt.concat(getBasePlacement(jt)===auto?computeAutoPlacement(o,{placement:jt,boundary:it,rootBoundary:$,padding:ct,flipVariations:nt,allowedAutoPlacements:at}):jt)},[]),pt=o.rects.reference,Zt=o.rects.popper,ht=new Map,Gt=!0,Xt=mt[0],Vt=0;Vt=0,Tt=Ct?"width":"height",ft=detectOverflow(o,{placement:Yt,boundary:it,rootBoundary:$,altBoundary:a,padding:ct}),Ft=Ct?Lt?right:left:Lt?bottom:top;pt[Tt]>Zt[Tt]&&(Ft=getOppositePlacement(Ft));var Jt=getOppositePlacement(Ft),Ht=[];if(lt&&Ht.push(ft[St]<=0),ot&&Ht.push(ft[Ft]<=0,ft[Jt]<=0),Ht.every(function(Qt){return Qt})){Xt=Yt,Gt=!1;break}ht.set(Yt,Ht)}if(Gt)for(var wt=nt?3:1,Et=function(jt){var Xl=mt.find(function(Yl){var Rl=ht.get(Yl);if(Rl)return Rl.slice(0,jt).every(function(Tl){return Tl})});if(Xl)return Xt=Xl,"break"},At=wt;At>0;At--){var Il=Et(At);if(Il==="break")break}o.placement!==Xt&&(o.modifiersData[j]._skip=!0,o.placement=Xt,o.reset=!0)}}const flip$1={name:"flip",enabled:!0,phase:"main",fn:flip,requiresIfExists:["offset"],data:{_skip:!1}};function getSideOffsets(i,o,s){return s===void 0&&(s={x:0,y:0}),{top:i.top-o.height-s.y,right:i.right-o.width+s.x,bottom:i.bottom-o.height+s.y,left:i.left-o.width-s.x}}function isAnySideFullyClipped(i){return[top,right,bottom,left].some(function(o){return i[o]>=0})}function hide(i){var o=i.state,s=i.name,j=o.rects.reference,_e=o.rects.popper,lt=o.modifiersData.preventOverflow,tt=detectOverflow(o,{elementContext:"reference"}),ot=detectOverflow(o,{altBoundary:!0}),st=getSideOffsets(tt,j),ct=getSideOffsets(ot,_e,lt),it=isAnySideFullyClipped(st),$=isAnySideFullyClipped(ct);o.modifiersData[s]={referenceClippingOffsets:st,popperEscapeOffsets:ct,isReferenceHidden:it,hasPopperEscaped:$},o.attributes.popper=Object.assign({},o.attributes.popper,{"data-popper-reference-hidden":it,"data-popper-escaped":$})}const hide$1={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:hide};function distanceAndSkiddingToXY(i,o,s){var j=getBasePlacement(i),_e=[left,top].indexOf(j)>=0?-1:1,lt=typeof s=="function"?s(Object.assign({},o,{placement:i})):s,tt=lt[0],ot=lt[1];return tt=tt||0,ot=(ot||0)*_e,[left,right].indexOf(j)>=0?{x:ot,y:tt}:{x:tt,y:ot}}function offset(i){var o=i.state,s=i.options,j=i.name,_e=s.offset,lt=_e===void 0?[0,0]:_e,tt=placements.reduce(function(it,$){return it[$]=distanceAndSkiddingToXY($,o.rects,lt),it},{}),ot=tt[o.placement],st=ot.x,ct=ot.y;o.modifiersData.popperOffsets!=null&&(o.modifiersData.popperOffsets.x+=st,o.modifiersData.popperOffsets.y+=ct),o.modifiersData[j]=tt}const offset$1={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:offset};function popperOffsets(i){var o=i.state,s=i.name;o.modifiersData[s]=computeOffsets({reference:o.rects.reference,element:o.rects.popper,strategy:"absolute",placement:o.placement})}const popperOffsets$1={name:"popperOffsets",enabled:!0,phase:"read",fn:popperOffsets,data:{}};function getAltAxis(i){return i==="x"?"y":"x"}function preventOverflow(i){var o=i.state,s=i.options,j=i.name,_e=s.mainAxis,lt=_e===void 0?!0:_e,tt=s.altAxis,ot=tt===void 0?!1:tt,st=s.boundary,ct=s.rootBoundary,it=s.altBoundary,$=s.padding,a=s.tether,et=a===void 0?!0:a,nt=s.tetherOffset,at=nt===void 0?0:nt,rt=detectOverflow(o,{boundary:st,rootBoundary:ct,padding:$,altBoundary:it}),dt=getBasePlacement(o.placement),ut=getVariation(o.placement),bt=!ut,mt=getMainAxisFromPlacement(dt),pt=getAltAxis(mt),Zt=o.modifiersData.popperOffsets,ht=o.rects.reference,Gt=o.rects.popper,Xt=typeof at=="function"?at(Object.assign({},o.rects,{placement:o.placement})):at,Vt=typeof Xt=="number"?{mainAxis:Xt,altAxis:Xt}:Object.assign({mainAxis:0,altAxis:0},Xt),Yt=o.modifiersData.offset?o.modifiersData.offset[o.placement]:null,St={x:0,y:0};if(Zt){if(lt){var Lt,Ct=mt==="y"?top:left,Tt=mt==="y"?bottom:right,ft=mt==="y"?"height":"width",Ft=Zt[mt],Jt=Ft+rt[Ct],Ht=Ft-rt[Tt],wt=et?-Gt[ft]/2:0,Et=ut===start?ht[ft]:Gt[ft],At=ut===start?-Gt[ft]:-ht[ft],Il=o.elements.arrow,Qt=et&&Il?getLayoutRect(Il):{width:0,height:0},jt=o.modifiersData["arrow#persistent"]?o.modifiersData["arrow#persistent"].padding:getFreshSideObject(),Xl=jt[Ct],Yl=jt[Tt],Rl=within(0,ht[ft],Qt[ft]),Tl=bt?ht[ft]/2-wt-Rl-Xl-Vt.mainAxis:Et-Rl-Xl-Vt.mainAxis,zl=bt?-ht[ft]/2+wt+Rl+Yl+Vt.mainAxis:At+Rl+Yl+Vt.mainAxis,Ll=o.elements.arrow&&getOffsetParent(o.elements.arrow),Cl=Ll?mt==="y"?Ll.clientTop||0:Ll.clientLeft||0:0,yl=(Lt=Yt==null?void 0:Yt[mt])!=null?Lt:0,Wl=Ft+Tl-yl-Cl,xl=Ft+zl-yl,Gl=within(et?min(Jt,Wl):Jt,Ft,et?max$1(Ht,xl):Ht);Zt[mt]=Gl,St[mt]=Gl-Ft}if(ot){var sn,Fl=mt==="x"?top:left,cn=mt==="x"?bottom:right,Ol=Zt[pt],Ml=pt==="y"?"height":"width",Ul=Ol+rt[Fl],Ql=Ol-rt[cn],El=[top,left].indexOf(dt)!==-1,Nl=(sn=Yt==null?void 0:Yt[pt])!=null?sn:0,Zn=El?Ul:Ol-ht[Ml]-Gt[Ml]-Nl+Vt.altAxis,bn=El?Ol+ht[Ml]+Gt[Ml]-Nl-Vt.altAxis:Ql,Bl=et&&El?withinMaxClamp(Zn,Ol,bn):within(et?Zn:Ul,Ol,et?bn:Ql);Zt[pt]=Bl,St[pt]=Bl-Ol}o.modifiersData[j]=St}}const preventOverflow$1={name:"preventOverflow",enabled:!0,phase:"main",fn:preventOverflow,requiresIfExists:["offset"]};function getHTMLElementScroll(i){return{scrollLeft:i.scrollLeft,scrollTop:i.scrollTop}}function getNodeScroll(i){return i===getWindow(i)||!isHTMLElement$1(i)?getWindowScroll(i):getHTMLElementScroll(i)}function isElementScaled(i){var o=i.getBoundingClientRect(),s=round(o.width)/i.offsetWidth||1,j=round(o.height)/i.offsetHeight||1;return s!==1||j!==1}function getCompositeRect(i,o,s){s===void 0&&(s=!1);var j=isHTMLElement$1(o),_e=isHTMLElement$1(o)&&isElementScaled(o),lt=getDocumentElement(o),tt=getBoundingClientRect(i,_e,s),ot={scrollLeft:0,scrollTop:0},st={x:0,y:0};return(j||!j&&!s)&&((getNodeName(o)!=="body"||isScrollParent(lt))&&(ot=getNodeScroll(o)),isHTMLElement$1(o)?(st=getBoundingClientRect(o,!0),st.x+=o.clientLeft,st.y+=o.clientTop):lt&&(st.x=getWindowScrollBarX(lt))),{x:tt.left+ot.scrollLeft-st.x,y:tt.top+ot.scrollTop-st.y,width:tt.width,height:tt.height}}function order(i){var o=new Map,s=new Set,j=[];i.forEach(function(lt){o.set(lt.name,lt)});function _e(lt){s.add(lt.name);var tt=[].concat(lt.requires||[],lt.requiresIfExists||[]);tt.forEach(function(ot){if(!s.has(ot)){var st=o.get(ot);st&&_e(st)}}),j.push(lt)}return i.forEach(function(lt){s.has(lt.name)||_e(lt)}),j}function orderModifiers(i){var o=order(i);return modifierPhases.reduce(function(s,j){return s.concat(o.filter(function(_e){return _e.phase===j}))},[])}function debounce(i){var o;return function(){return o||(o=new Promise(function(s){Promise.resolve().then(function(){o=void 0,s(i())})})),o}}function mergeByName(i){var o=i.reduce(function(s,j){var _e=s[j.name];return s[j.name]=_e?Object.assign({},_e,j,{options:Object.assign({},_e.options,j.options),data:Object.assign({},_e.data,j.data)}):j,s},{});return Object.keys(o).map(function(s){return o[s]})}var DEFAULT_OPTIONS={placement:"bottom",modifiers:[],strategy:"absolute"};function areValidElements(){for(var i=arguments.length,o=new Array(i),s=0;scomposeClasses({root:["root"]},useClassNamesOverride(getPopperUtilityClass)),defaultPopperOptions={},PopperTooltip=reactExports.forwardRef(function(o,s){var j;const{anchorEl:_e,children:lt,direction:tt,disablePortal:ot,modifiers:st,open:ct,placement:it,popperOptions:$,popperRef:a,slotProps:et={},slots:nt={},TransitionProps:at}=o,rt=_objectWithoutPropertiesLoose(o,_excluded$v),dt=reactExports.useRef(null),ut=useForkRef(dt,s),bt=reactExports.useRef(null),mt=useForkRef(bt,a),pt=reactExports.useRef(mt);useEnhancedEffect(()=>{pt.current=mt},[mt]),reactExports.useImperativeHandle(a,()=>bt.current,[]);const Zt=flipPlacement(it,tt),[ht,Gt]=reactExports.useState(Zt),[Xt,Vt]=reactExports.useState(resolveAnchorEl$1(_e));reactExports.useEffect(()=>{bt.current&&bt.current.forceUpdate()}),reactExports.useEffect(()=>{_e&&Vt(resolveAnchorEl$1(_e))},[_e]),useEnhancedEffect(()=>{if(!Xt||!ct)return;const Tt=Jt=>{Gt(Jt.placement)};let ft=[{name:"preventOverflow",options:{altBoundary:ot}},{name:"flip",options:{altBoundary:ot}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:Jt})=>{Tt(Jt)}}];st!=null&&(ft=ft.concat(st)),$&&$.modifiers!=null&&(ft=ft.concat($.modifiers));const Ft=createPopper(Xt,dt.current,_extends$1({placement:Zt},$,{modifiers:ft}));return pt.current(Ft),()=>{Ft.destroy(),pt.current(null)}},[Xt,ot,st,ct,$,Zt]);const Yt={placement:ht};at!==null&&(Yt.TransitionProps=at);const St=useUtilityClasses$p(),Lt=(j=nt.root)!=null?j:"div",Ct=useSlotProps({elementType:Lt,externalSlotProps:et.root,externalForwardedProps:rt,additionalProps:{role:"tooltip",ref:ut},ownerState:o,className:St.root});return jsxRuntimeExports.jsx(Lt,_extends$1({},Ct,{children:typeof lt=="function"?lt(Yt):lt}))}),Popper$2=reactExports.forwardRef(function(o,s){const{anchorEl:j,children:_e,container:lt,direction:tt="ltr",disablePortal:ot=!1,keepMounted:st=!1,modifiers:ct,open:it,placement:$="bottom",popperOptions:a=defaultPopperOptions,popperRef:et,style:nt,transition:at=!1,slotProps:rt={},slots:dt={}}=o,ut=_objectWithoutPropertiesLoose(o,_excluded2$5),[bt,mt]=reactExports.useState(!0),pt=()=>{mt(!1)},Zt=()=>{mt(!0)};if(!st&&!it&&(!at||bt))return null;let ht;if(lt)ht=lt;else if(j){const Vt=resolveAnchorEl$1(j);ht=Vt&&isHTMLElement(Vt)?ownerDocument(Vt).body:ownerDocument(null).body}const Gt=!it&&st&&(!at||bt)?"none":void 0,Xt=at?{in:it,onEnter:pt,onExited:Zt}:void 0;return jsxRuntimeExports.jsx(Portal,{disablePortal:ot,container:ht,children:jsxRuntimeExports.jsx(PopperTooltip,_extends$1({anchorEl:j,direction:tt,disablePortal:ot,modifiers:ct,ref:s,open:at?!bt:it,placement:$,popperOptions:a,popperRef:et,slotProps:rt,slots:dt},ut,{style:_extends$1({position:"fixed",top:0,left:0,display:Gt},nt),TransitionProps:Xt,children:_e}))})}),_excluded$u=["onChange","maxRows","minRows","style","value"];function getStyleValue(i){return parseInt(i,10)||0}const styles$2={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function isEmpty$2(i){return i==null||Object.keys(i).length===0||i.outerHeightStyle===0&&!i.overflowing}const TextareaAutosize=reactExports.forwardRef(function(o,s){const{onChange:j,maxRows:_e,minRows:lt=1,style:tt,value:ot}=o,st=_objectWithoutPropertiesLoose(o,_excluded$u),{current:ct}=reactExports.useRef(ot!=null),it=reactExports.useRef(null),$=useForkRef(s,it),a=reactExports.useRef(null),et=reactExports.useCallback(()=>{const rt=it.current,ut=ownerWindow(rt).getComputedStyle(rt);if(ut.width==="0px")return{outerHeightStyle:0,overflowing:!1};const bt=a.current;bt.style.width=ut.width,bt.value=rt.value||o.placeholder||"x",bt.value.slice(-1)===` `&&(bt.value+=" ");const mt=ut.boxSizing,pt=getStyleValue(ut.paddingBottom)+getStyleValue(ut.paddingTop),Zt=getStyleValue(ut.borderBottomWidth)+getStyleValue(ut.borderTopWidth),ht=bt.scrollHeight;bt.value="x";const Gt=bt.scrollHeight;let Xt=ht;lt&&(Xt=Math.max(Number(lt)*Gt,Xt)),_e&&(Xt=Math.min(Number(_e)*Gt,Xt)),Xt=Math.max(Xt,Gt);const Vt=Xt+(mt==="border-box"?pt+Zt:0),Yt=Math.abs(Xt-ht)<=1;return{outerHeightStyle:Vt,overflowing:Yt}},[_e,lt,o.placeholder]),nt=reactExports.useCallback(()=>{const rt=et();if(isEmpty$2(rt))return;const dt=it.current;dt.style.height=`${rt.outerHeightStyle}px`,dt.style.overflow=rt.overflowing?"hidden":""},[et]);useEnhancedEffect(()=>{const rt=()=>{nt()};let dt;const ut=debounce$1(rt),bt=it.current,mt=ownerWindow(bt);mt.addEventListener("resize",ut);let pt;return typeof ResizeObserver<"u"&&(pt=new ResizeObserver(rt),pt.observe(bt)),()=>{ut.clear(),cancelAnimationFrame(dt),mt.removeEventListener("resize",ut),pt&&pt.disconnect()}},[et,nt]),useEnhancedEffect(()=>{nt()});const at=rt=>{ct||nt(),j&&j(rt)};return jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx("textarea",_extends$1({value:ot,onChange:at,ref:$,rows:lt,style:tt},st)),jsxRuntimeExports.jsx("textarea",{"aria-hidden":!0,className:o.className,readOnly:!0,ref:a,tabIndex:-1,style:_extends$1({},styles$2.shadow,tt,{paddingTop:0,paddingBottom:0})})]})});function stripDiacritics(i){return typeof i.normalize<"u"?i.normalize("NFD").replace(/[\u0300-\u036f]/g,""):i}function createFilterOptions(i={}){const{ignoreAccents:o=!0,ignoreCase:s=!0,limit:j,matchFrom:_e="any",stringify:lt,trim:tt=!1}=i;return(ot,{inputValue:st,getOptionLabel:ct})=>{let it=tt?st.trim():st;s&&(it=it.toLowerCase()),o&&(it=stripDiacritics(it));const $=it?ot.filter(a=>{let et=(lt||ct)(a);return s&&(et=et.toLowerCase()),o&&(et=stripDiacritics(et)),_e==="start"?et.indexOf(it)===0:et.indexOf(it)>-1}):ot;return typeof j=="number"?$.slice(0,j):$}}function findIndex(i,o){for(let s=0;s{var o;return i.current!==null&&((o=i.current.parentElement)==null?void 0:o.contains(document.activeElement))};function useAutocomplete(i){const{unstable_isActiveElementInListbox:o=defaultIsActiveElementInListbox,unstable_classNamePrefix:s="Mui",autoComplete:j=!1,autoHighlight:_e=!1,autoSelect:lt=!1,blurOnSelect:tt=!1,clearOnBlur:ot=!i.freeSolo,clearOnEscape:st=!1,componentName:ct="useAutocomplete",defaultValue:it=i.multiple?[]:null,disableClearable:$=!1,disableCloseOnSelect:a=!1,disabled:et,disabledItemsFocusable:nt=!1,disableListWrap:at=!1,filterOptions:rt=defaultFilterOptions,filterSelectedOptions:dt=!1,freeSolo:ut=!1,getOptionDisabled:bt,getOptionKey:mt,getOptionLabel:pt=Wt=>{var Rt;return(Rt=Wt.label)!=null?Rt:Wt},groupBy:Zt,handleHomeEndKeys:ht=!i.freeSolo,id:Gt,includeInputInList:Xt=!1,inputValue:Vt,isOptionEqualToValue:Yt=(Wt,Rt)=>Wt===Rt,multiple:St=!1,onChange:Lt,onClose:Ct,onHighlightChange:Tt,onInputChange:ft,onOpen:Ft,open:Jt,openOnFocus:Ht=!1,options:wt,readOnly:Et=!1,selectOnFocus:At=!i.freeSolo,value:Il}=i,Qt=useId(Gt);let jt=pt;jt=Wt=>{const Rt=pt(Wt);return typeof Rt!="string"?String(Rt):Rt};const Xl=reactExports.useRef(!1),Yl=reactExports.useRef(!0),Rl=reactExports.useRef(null),Tl=reactExports.useRef(null),[zl,Ll]=reactExports.useState(null),[Cl,yl]=reactExports.useState(-1),Wl=_e?0:-1,xl=reactExports.useRef(Wl),[Gl,sn]=useControlled({controlled:Il,default:it,name:ct}),[Fl,cn]=useControlled({controlled:Vt,default:"",name:ct,state:"inputValue"}),[Ol,Ml]=reactExports.useState(!1),Ul=reactExports.useCallback((Wt,Rt)=>{if(!(St?Gl.length!(dt&&(St?Gl:[Gl]).some(Rt=>Rt!==null&&Yt(Wt,Rt)))),{inputValue:bn&&Nl?"":Fl,getOptionLabel:jt}):[],rn=usePreviousProps({filteredOptions:Ot,value:Gl,inputValue:Fl});reactExports.useEffect(()=>{const Wt=Gl!==rn.value;Ol&&!Wt||ut&&!Wt||Ul(null,Gl)},[Gl,Ul,Ol,rn.value,ut]);const yn=Ql&&Ot.length>0&&!Et,an=useEventCallback(Wt=>{Wt===-1?Rl.current.focus():zl.querySelector(`[data-tag-index="${Wt}"]`).focus()});reactExports.useEffect(()=>{St&&Cl>Gl.length-1&&(yl(-1),an(-1))},[Gl,St,Cl,an]);function Vl(Wt,Rt){if(!Tl.current||Wt<0||Wt>=Ot.length)return-1;let Nt=Wt;for(;;){const Kt=Tl.current.querySelector(`[data-option-index="${Nt}"]`),kt=nt?!1:!Kt||Kt.disabled||Kt.getAttribute("aria-disabled")==="true";if(Kt&&Kt.hasAttribute("tabindex")&&!kt)return Nt;if(Rt==="next"?Nt=(Nt+1)%Ot.length:Nt=(Nt-1+Ot.length)%Ot.length,Nt===Wt)return-1}}const $t=useEventCallback(({event:Wt,index:Rt,reason:Nt="auto"})=>{if(xl.current=Rt,Rt===-1?Rl.current.removeAttribute("aria-activedescendant"):Rl.current.setAttribute("aria-activedescendant",`${Qt}-option-${Rt}`),Tt&&Tt(Wt,Rt===-1?null:Ot[Rt],Nt),!Tl.current)return;const Kt=Tl.current.querySelector(`[role="option"].${s}-focused`);Kt&&(Kt.classList.remove(`${s}-focused`),Kt.classList.remove(`${s}-focusVisible`));let kt=Tl.current;if(Tl.current.getAttribute("role")!=="listbox"&&(kt=Tl.current.parentElement.querySelector('[role="listbox"]')),!kt)return;if(Rt===-1){kt.scrollTop=0;return}const Pt=Tl.current.querySelector(`[data-option-index="${Rt}"]`);if(Pt&&(Pt.classList.add(`${s}-focused`),Nt==="keyboard"&&Pt.classList.add(`${s}-focusVisible`),kt.scrollHeight>kt.clientHeight&&Nt!=="mouse"&&Nt!=="touch")){const Zl=Pt,qt=kt.clientHeight+kt.scrollTop,Al=Zl.offsetTop+Zl.offsetHeight;Al>qt?kt.scrollTop=Al-kt.clientHeight:Zl.offsetTop-Zl.offsetHeight*(Zt?1.3:0){if(!Bl)return;const Pt=Vl((()=>{const Zl=Ot.length-1;if(Rt==="reset")return Wl;if(Rt==="start")return 0;if(Rt==="end")return Zl;const qt=xl.current+Rt;return qt<0?qt===-1&&Xt?-1:at&&xl.current!==-1||Math.abs(Rt)>1?0:Zl:qt>Zl?qt===Zl+1&&Xt?-1:at||Math.abs(Rt)>1?Zl:0:qt})(),Nt);if($t({index:Pt,reason:Kt,event:Wt}),j&&Rt!=="reset")if(Pt===-1)Rl.current.value=Fl;else{const Zl=jt(Ot[Pt]);Rl.current.value=Zl,Zl.toLowerCase().indexOf(Fl.toLowerCase())===0&&Fl.length>0&&Rl.current.setSelectionRange(Fl.length,Zl.length)}}),Vn=()=>{const Wt=(Rt,Nt)=>{const Kt=Rt?jt(Rt):"",kt=Nt?jt(Nt):"";return Kt===kt};if(xl.current!==-1&&rn.filteredOptions&&rn.filteredOptions.length!==Ot.length&&rn.inputValue===Fl&&(St?Gl.length===rn.value.length&&rn.value.every((Rt,Nt)=>jt(Gl[Nt])===jt(Rt)):Wt(rn.value,Gl))){const Rt=rn.filteredOptions[xl.current];if(Rt)return findIndex(Ot,Nt=>jt(Nt)===jt(Rt))}return-1},xn=reactExports.useCallback(()=>{if(!Bl)return;const Wt=Vn();if(Wt!==-1){xl.current=Wt;return}const Rt=St?Gl[0]:Gl;if(Ot.length===0||Rt==null){$l({diff:"reset"});return}if(Tl.current){if(Rt!=null){const Nt=Ot[xl.current];if(St&&Nt&&findIndex(Gl,kt=>Yt(Nt,kt))!==-1)return;const Kt=findIndex(Ot,kt=>Yt(kt,Rt));Kt===-1?$l({diff:"reset"}):$t({index:Kt});return}if(xl.current>=Ot.length-1){$t({index:Ot.length-1});return}$t({index:xl.current})}},[Ot.length,St?!1:Gl,dt,$l,$t,Bl,Fl,St]),Sn=useEventCallback(Wt=>{setRef(Tl,Wt),Wt&&xn()});reactExports.useEffect(()=>{xn()},[xn]);const Pl=Wt=>{Ql||(El(!0),Zn(!0),Ft&&Ft(Wt))},gn=(Wt,Rt)=>{Ql&&(El(!1),Ct&&Ct(Wt,Rt))},Rn=(Wt,Rt,Nt,Kt)=>{if(St){if(Gl.length===Rt.length&&Gl.every((kt,Pt)=>kt===Rt[Pt]))return}else if(Gl===Rt)return;Lt&&Lt(Wt,Rt,Nt,Kt),sn(Rt)},Yn=reactExports.useRef(!1),Jl=(Wt,Rt,Nt="selectOption",Kt="options")=>{let kt=Nt,Pt=Rt;if(St){Pt=Array.isArray(Gl)?Gl.slice():[];const Zl=findIndex(Pt,qt=>Yt(Rt,qt));Zl===-1?Pt.push(Rt):Kt!=="freeSolo"&&(Pt.splice(Zl,1),kt="removeOption")}Ul(Wt,Pt),Rn(Wt,Pt,kt,{option:Rt}),!a&&(!Wt||!Wt.ctrlKey&&!Wt.metaKey)&&gn(Wt,kt),(tt===!0||tt==="touch"&&Yn.current||tt==="mouse"&&!Yn.current)&&Rl.current.blur()};function Kl(Wt,Rt){if(Wt===-1)return-1;let Nt=Wt;for(;;){if(Rt==="next"&&Nt===Gl.length||Rt==="previous"&&Nt===-1)return-1;const Kt=zl.querySelector(`[data-tag-index="${Nt}"]`);if(!Kt||!Kt.hasAttribute("tabindex")||Kt.disabled||Kt.getAttribute("aria-disabled")==="true")Nt+=Rt==="next"?1:-1;else return Nt}}const Hl=(Wt,Rt)=>{if(!St)return;Fl===""&&gn(Wt,"toggleInput");let Nt=Cl;Cl===-1?Fl===""&&Rt==="previous"&&(Nt=Gl.length-1):(Nt+=Rt==="next"?1:-1,Nt<0&&(Nt=0),Nt===Gl.length&&(Nt=-1)),Nt=Kl(Nt,Rt),yl(Nt),an(Nt)},Jn=Wt=>{Xl.current=!0,cn(""),ft&&ft(Wt,"","clear"),Rn(Wt,St?[]:null,"clear")},vn=Wt=>Rt=>{if(Wt.onKeyDown&&Wt.onKeyDown(Rt),!Rt.defaultMuiPrevented&&(Cl!==-1&&["ArrowLeft","ArrowRight"].indexOf(Rt.key)===-1&&(yl(-1),an(-1)),Rt.which!==229))switch(Rt.key){case"Home":Bl&&ht&&(Rt.preventDefault(),$l({diff:"start",direction:"next",reason:"keyboard",event:Rt}));break;case"End":Bl&&ht&&(Rt.preventDefault(),$l({diff:"end",direction:"previous",reason:"keyboard",event:Rt}));break;case"PageUp":Rt.preventDefault(),$l({diff:-pageSize,direction:"previous",reason:"keyboard",event:Rt}),Pl(Rt);break;case"PageDown":Rt.preventDefault(),$l({diff:pageSize,direction:"next",reason:"keyboard",event:Rt}),Pl(Rt);break;case"ArrowDown":Rt.preventDefault(),$l({diff:1,direction:"next",reason:"keyboard",event:Rt}),Pl(Rt);break;case"ArrowUp":Rt.preventDefault(),$l({diff:-1,direction:"previous",reason:"keyboard",event:Rt}),Pl(Rt);break;case"ArrowLeft":Hl(Rt,"previous");break;case"ArrowRight":Hl(Rt,"next");break;case"Enter":if(xl.current!==-1&&Bl){const Nt=Ot[xl.current],Kt=bt?bt(Nt):!1;if(Rt.preventDefault(),Kt)return;Jl(Rt,Nt,"selectOption"),j&&Rl.current.setSelectionRange(Rl.current.value.length,Rl.current.value.length)}else ut&&Fl!==""&&bn===!1&&(St&&Rt.preventDefault(),Jl(Rt,Fl,"createOption","freeSolo"));break;case"Escape":Bl?(Rt.preventDefault(),Rt.stopPropagation(),gn(Rt,"escape")):st&&(Fl!==""||St&&Gl.length>0)&&(Rt.preventDefault(),Rt.stopPropagation(),Jn(Rt));break;case"Backspace":if(St&&!Et&&Fl===""&&Gl.length>0){const Nt=Cl===-1?Gl.length-1:Cl,Kt=Gl.slice();Kt.splice(Nt,1),Rn(Rt,Kt,"removeOption",{option:Gl[Nt]})}break;case"Delete":if(St&&!Et&&Fl===""&&Gl.length>0&&Cl!==-1){const Nt=Cl,Kt=Gl.slice();Kt.splice(Nt,1),Rn(Rt,Kt,"removeOption",{option:Gl[Nt]})}break}},Pn=Wt=>{Ml(!0),Ht&&!Xl.current&&Pl(Wt)},Fn=Wt=>{if(o(Tl)){Rl.current.focus();return}Ml(!1),Yl.current=!0,Xl.current=!1,lt&&xl.current!==-1&&Bl?Jl(Wt,Ot[xl.current],"blur"):lt&&ut&&Fl!==""?Jl(Wt,Fl,"blur","freeSolo"):ot&&Ul(Wt,Gl),gn(Wt,"blur")},hn=Wt=>{const Rt=Wt.target.value;Fl!==Rt&&(cn(Rt),Zn(!1),ft&&ft(Wt,Rt,"input")),Rt===""?!$&&!St&&Rn(Wt,null,"clear"):Pl(Wt)},mn=Wt=>{const Rt=Number(Wt.currentTarget.getAttribute("data-option-index"));xl.current!==Rt&&$t({event:Wt,index:Rt,reason:"mouse"})},In=Wt=>{$t({event:Wt,index:Number(Wt.currentTarget.getAttribute("data-option-index")),reason:"touch"}),Yn.current=!0},En=Wt=>{const Rt=Number(Wt.currentTarget.getAttribute("data-option-index"));Jl(Wt,Ot[Rt],"selectOption"),Yn.current=!1},Bn=Wt=>Rt=>{const Nt=Gl.slice();Nt.splice(Wt,1),Rn(Rt,Nt,"removeOption",{option:Gl[Wt]})},wn=Wt=>{Ql?gn(Wt,"toggleInput"):Pl(Wt)},zn=Wt=>{Wt.currentTarget.contains(Wt.target)&&Wt.target.getAttribute("id")!==Qt&&Wt.preventDefault()},Hn=Wt=>{Wt.currentTarget.contains(Wt.target)&&(Rl.current.focus(),At&&Yl.current&&Rl.current.selectionEnd-Rl.current.selectionStart===0&&Rl.current.select(),Yl.current=!1)},Tn=Wt=>{!et&&(Fl===""||!Ql)&&wn(Wt)};let Ln=ut&&Fl.length>0;Ln=Ln||(St?Gl.length>0:Gl!==null);let It=Ot;return Zt&&(It=Ot.reduce((Wt,Rt,Nt)=>{const Kt=Zt(Rt);return Wt.length>0&&Wt[Wt.length-1].group===Kt?Wt[Wt.length-1].options.push(Rt):Wt.push({key:Nt,index:Nt,group:Kt,options:[Rt]}),Wt},[])),et&&Ol&&Fn(),{getRootProps:(Wt={})=>_extends$1({"aria-owns":yn?`${Qt}-listbox`:null},Wt,{onKeyDown:vn(Wt),onMouseDown:zn,onClick:Hn}),getInputLabelProps:()=>({id:`${Qt}-label`,htmlFor:Qt}),getInputProps:()=>({id:Qt,value:Fl,onBlur:Fn,onFocus:Pn,onChange:hn,onMouseDown:Tn,"aria-activedescendant":Bl?"":null,"aria-autocomplete":j?"both":"list","aria-controls":yn?`${Qt}-listbox`:void 0,"aria-expanded":yn,autoComplete:"off",ref:Rl,autoCapitalize:"none",spellCheck:"false",role:"combobox",disabled:et}),getClearProps:()=>({tabIndex:-1,type:"button",onClick:Jn}),getPopupIndicatorProps:()=>({tabIndex:-1,type:"button",onClick:wn}),getTagProps:({index:Wt})=>_extends$1({key:Wt,"data-tag-index":Wt,tabIndex:-1},!Et&&{onDelete:Bn(Wt)}),getListboxProps:()=>({role:"listbox",id:`${Qt}-listbox`,"aria-labelledby":`${Qt}-label`,ref:Sn,onMouseDown:Wt=>{Wt.preventDefault()}}),getOptionProps:({index:Wt,option:Rt})=>{var Nt;const Kt=(St?Gl:[Gl]).some(Pt=>Pt!=null&&Yt(Rt,Pt)),kt=bt?bt(Rt):!1;return{key:(Nt=mt==null?void 0:mt(Rt))!=null?Nt:jt(Rt),tabIndex:-1,role:"option",id:`${Qt}-option-${Wt}`,onMouseMove:mn,onClick:En,onTouchStart:In,"data-option-index":Wt,"aria-disabled":kt,"aria-selected":Kt}},id:Qt,inputValue:Fl,value:Gl,dirty:Ln,expanded:Bl&&zl,popupOpen:Bl,focused:Ol||Cl!==-1,anchorEl:zl,setAnchorEl:Ll,focusedTag:Cl,groupedOptions:It}}var useThemeWithoutDefault={};Object.defineProperty(useThemeWithoutDefault,"__esModule",{value:!0});var default_1=useThemeWithoutDefault.default=void 0,React=_interopRequireWildcard(reactExports),_styledEngine=require$$1;function _getRequireWildcardCache(i){if(typeof WeakMap!="function")return null;var o=new WeakMap,s=new WeakMap;return(_getRequireWildcardCache=function(j){return j?s:o})(i)}function _interopRequireWildcard(i,o){if(!o&&i&&i.__esModule)return i;if(i===null||typeof i!="object"&&typeof i!="function")return{default:i};var s=_getRequireWildcardCache(o);if(s&&s.has(i))return s.get(i);var j={__proto__:null},_e=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var lt in i)if(lt!=="default"&&Object.prototype.hasOwnProperty.call(i,lt)){var tt=_e?Object.getOwnPropertyDescriptor(i,lt):null;tt&&(tt.get||tt.set)?Object.defineProperty(j,lt,tt):j[lt]=i[lt]}return j.default=i,s&&s.set(i,j),j}function isObjectEmpty(i){return Object.keys(i).length===0}function useTheme(i=null){const o=React.useContext(_styledEngine.ThemeContext);return!o||isObjectEmpty(o)?i:o}default_1=useThemeWithoutDefault.default=useTheme;const _excluded$t=["anchorEl","component","components","componentsProps","container","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","transition","slots","slotProps"],PopperRoot=styled(Popper$2,{name:"MuiPopper",slot:"Root",overridesResolver:(i,o)=>o.root})({}),Popper=reactExports.forwardRef(function(o,s){var j;const _e=default_1(),lt=useThemeProps$1({props:o,name:"MuiPopper"}),{anchorEl:tt,component:ot,components:st,componentsProps:ct,container:it,disablePortal:$,keepMounted:a,modifiers:et,open:nt,placement:at,popperOptions:rt,popperRef:dt,transition:ut,slots:bt,slotProps:mt}=lt,pt=_objectWithoutPropertiesLoose(lt,_excluded$t),Zt=(j=bt==null?void 0:bt.root)!=null?j:st==null?void 0:st.Root,ht=_extends$1({anchorEl:tt,container:it,disablePortal:$,keepMounted:a,modifiers:et,open:nt,placement:at,popperOptions:rt,popperRef:dt,transition:ut},pt);return jsxRuntimeExports.jsx(PopperRoot,_extends$1({as:ot,direction:_e==null?void 0:_e.direction,slots:{root:Zt},slotProps:mt??ct},ht,{ref:s}))}),Popper$1=Popper;function getListSubheaderUtilityClass(i){return generateUtilityClass$1("MuiListSubheader",i)}generateUtilityClasses$1("MuiListSubheader",["root","colorPrimary","colorInherit","gutters","inset","sticky"]);const _excluded$s=["className","color","component","disableGutters","disableSticky","inset"],useUtilityClasses$o=i=>{const{classes:o,color:s,disableGutters:j,inset:_e,disableSticky:lt}=i,tt={root:["root",s!=="default"&&`color${capitalize$1(s)}`,!j&&"gutters",_e&&"inset",!lt&&"sticky"]};return composeClasses(tt,getListSubheaderUtilityClass,o)},ListSubheaderRoot=styled("li",{name:"MuiListSubheader",slot:"Root",overridesResolver:(i,o)=>{const{ownerState:s}=i;return[o.root,s.color!=="default"&&o[`color${capitalize$1(s.color)}`],!s.disableGutters&&o.gutters,s.inset&&o.inset,!s.disableSticky&&o.sticky]}})(({theme:i,ownerState:o})=>_extends$1({boxSizing:"border-box",lineHeight:"48px",listStyle:"none",color:(i.vars||i).palette.text.secondary,fontFamily:i.typography.fontFamily,fontWeight:i.typography.fontWeightMedium,fontSize:i.typography.pxToRem(14)},o.color==="primary"&&{color:(i.vars||i).palette.primary.main},o.color==="inherit"&&{color:"inherit"},!o.disableGutters&&{paddingLeft:16,paddingRight:16},o.inset&&{paddingLeft:72},!o.disableSticky&&{position:"sticky",top:0,zIndex:1,backgroundColor:(i.vars||i).palette.background.paper})),ListSubheader=reactExports.forwardRef(function(o,s){const j=useThemeProps$1({props:o,name:"MuiListSubheader"}),{className:_e,color:lt="default",component:tt="li",disableGutters:ot=!1,disableSticky:st=!1,inset:ct=!1}=j,it=_objectWithoutPropertiesLoose(j,_excluded$s),$=_extends$1({},j,{color:lt,component:tt,disableGutters:ot,disableSticky:st,inset:ct}),a=useUtilityClasses$o($);return jsxRuntimeExports.jsx(ListSubheaderRoot,_extends$1({as:tt,className:clsx(a.root,_e),ref:s,ownerState:$},it))});ListSubheader.muiSkipListHighlight=!0;const ListSubheader$1=ListSubheader,CancelIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}),"Cancel");function getChipUtilityClass(i){return generateUtilityClass$1("MuiChip",i)}const chipClasses=generateUtilityClasses$1("MuiChip",["root","sizeSmall","sizeMedium","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","disabled","clickable","clickableColorPrimary","clickableColorSecondary","deletable","deletableColorPrimary","deletableColorSecondary","outlined","filled","outlinedPrimary","outlinedSecondary","filledPrimary","filledSecondary","avatar","avatarSmall","avatarMedium","avatarColorPrimary","avatarColorSecondary","icon","iconSmall","iconMedium","iconColorPrimary","iconColorSecondary","label","labelSmall","labelMedium","deleteIcon","deleteIconSmall","deleteIconMedium","deleteIconColorPrimary","deleteIconColorSecondary","deleteIconOutlinedColorPrimary","deleteIconOutlinedColorSecondary","deleteIconFilledColorPrimary","deleteIconFilledColorSecondary","focusVisible"]),chipClasses$1=chipClasses,_excluded$r=["avatar","className","clickable","color","component","deleteIcon","disabled","icon","label","onClick","onDelete","onKeyDown","onKeyUp","size","variant","tabIndex","skipFocusWhenDisabled"],useUtilityClasses$n=i=>{const{classes:o,disabled:s,size:j,color:_e,iconColor:lt,onDelete:tt,clickable:ot,variant:st}=i,ct={root:["root",st,s&&"disabled",`size${capitalize$1(j)}`,`color${capitalize$1(_e)}`,ot&&"clickable",ot&&`clickableColor${capitalize$1(_e)}`,tt&&"deletable",tt&&`deletableColor${capitalize$1(_e)}`,`${st}${capitalize$1(_e)}`],label:["label",`label${capitalize$1(j)}`],avatar:["avatar",`avatar${capitalize$1(j)}`,`avatarColor${capitalize$1(_e)}`],icon:["icon",`icon${capitalize$1(j)}`,`iconColor${capitalize$1(lt)}`],deleteIcon:["deleteIcon",`deleteIcon${capitalize$1(j)}`,`deleteIconColor${capitalize$1(_e)}`,`deleteIcon${capitalize$1(st)}Color${capitalize$1(_e)}`]};return composeClasses(ct,getChipUtilityClass,o)},ChipRoot=styled("div",{name:"MuiChip",slot:"Root",overridesResolver:(i,o)=>{const{ownerState:s}=i,{color:j,iconColor:_e,clickable:lt,onDelete:tt,size:ot,variant:st}=s;return[{[`& .${chipClasses$1.avatar}`]:o.avatar},{[`& .${chipClasses$1.avatar}`]:o[`avatar${capitalize$1(ot)}`]},{[`& .${chipClasses$1.avatar}`]:o[`avatarColor${capitalize$1(j)}`]},{[`& .${chipClasses$1.icon}`]:o.icon},{[`& .${chipClasses$1.icon}`]:o[`icon${capitalize$1(ot)}`]},{[`& .${chipClasses$1.icon}`]:o[`iconColor${capitalize$1(_e)}`]},{[`& .${chipClasses$1.deleteIcon}`]:o.deleteIcon},{[`& .${chipClasses$1.deleteIcon}`]:o[`deleteIcon${capitalize$1(ot)}`]},{[`& .${chipClasses$1.deleteIcon}`]:o[`deleteIconColor${capitalize$1(j)}`]},{[`& .${chipClasses$1.deleteIcon}`]:o[`deleteIcon${capitalize$1(st)}Color${capitalize$1(j)}`]},o.root,o[`size${capitalize$1(ot)}`],o[`color${capitalize$1(j)}`],lt&&o.clickable,lt&&j!=="default"&&o[`clickableColor${capitalize$1(j)})`],tt&&o.deletable,tt&&j!=="default"&&o[`deletableColor${capitalize$1(j)}`],o[st],o[`${st}${capitalize$1(j)}`]]}})(({theme:i,ownerState:o})=>{const s=i.palette.mode==="light"?i.palette.grey[700]:i.palette.grey[300];return _extends$1({maxWidth:"100%",fontFamily:i.typography.fontFamily,fontSize:i.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,color:(i.vars||i).palette.text.primary,backgroundColor:(i.vars||i).palette.action.selected,borderRadius:32/2,whiteSpace:"nowrap",transition:i.transitions.create(["background-color","box-shadow"]),cursor:"unset",outline:0,textDecoration:"none",border:0,padding:0,verticalAlign:"middle",boxSizing:"border-box",[`&.${chipClasses$1.disabled}`]:{opacity:(i.vars||i).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${chipClasses$1.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:i.vars?i.vars.palette.Chip.defaultAvatarColor:s,fontSize:i.typography.pxToRem(12)},[`& .${chipClasses$1.avatarColorPrimary}`]:{color:(i.vars||i).palette.primary.contrastText,backgroundColor:(i.vars||i).palette.primary.dark},[`& .${chipClasses$1.avatarColorSecondary}`]:{color:(i.vars||i).palette.secondary.contrastText,backgroundColor:(i.vars||i).palette.secondary.dark},[`& .${chipClasses$1.avatarSmall}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:i.typography.pxToRem(10)},[`& .${chipClasses$1.icon}`]:_extends$1({marginLeft:5,marginRight:-6},o.size==="small"&&{fontSize:18,marginLeft:4,marginRight:-4},o.iconColor===o.color&&_extends$1({color:i.vars?i.vars.palette.Chip.defaultIconColor:s},o.color!=="default"&&{color:"inherit"})),[`& .${chipClasses$1.deleteIcon}`]:_extends$1({WebkitTapHighlightColor:"transparent",color:i.vars?`rgba(${i.vars.palette.text.primaryChannel} / 0.26)`:alpha_1(i.palette.text.primary,.26),fontSize:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:i.vars?`rgba(${i.vars.palette.text.primaryChannel} / 0.4)`:alpha_1(i.palette.text.primary,.4)}},o.size==="small"&&{fontSize:16,marginRight:4,marginLeft:-4},o.color!=="default"&&{color:i.vars?`rgba(${i.vars.palette[o.color].contrastTextChannel} / 0.7)`:alpha_1(i.palette[o.color].contrastText,.7),"&:hover, &:active":{color:(i.vars||i).palette[o.color].contrastText}})},o.size==="small"&&{height:24},o.color!=="default"&&{backgroundColor:(i.vars||i).palette[o.color].main,color:(i.vars||i).palette[o.color].contrastText},o.onDelete&&{[`&.${chipClasses$1.focusVisible}`]:{backgroundColor:i.vars?`rgba(${i.vars.palette.action.selectedChannel} / calc(${i.vars.palette.action.selectedOpacity} + ${i.vars.palette.action.focusOpacity}))`:alpha_1(i.palette.action.selected,i.palette.action.selectedOpacity+i.palette.action.focusOpacity)}},o.onDelete&&o.color!=="default"&&{[`&.${chipClasses$1.focusVisible}`]:{backgroundColor:(i.vars||i).palette[o.color].dark}})},({theme:i,ownerState:o})=>_extends$1({},o.clickable&&{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover":{backgroundColor:i.vars?`rgba(${i.vars.palette.action.selectedChannel} / calc(${i.vars.palette.action.selectedOpacity} + ${i.vars.palette.action.hoverOpacity}))`:alpha_1(i.palette.action.selected,i.palette.action.selectedOpacity+i.palette.action.hoverOpacity)},[`&.${chipClasses$1.focusVisible}`]:{backgroundColor:i.vars?`rgba(${i.vars.palette.action.selectedChannel} / calc(${i.vars.palette.action.selectedOpacity} + ${i.vars.palette.action.focusOpacity}))`:alpha_1(i.palette.action.selected,i.palette.action.selectedOpacity+i.palette.action.focusOpacity)},"&:active":{boxShadow:(i.vars||i).shadows[1]}},o.clickable&&o.color!=="default"&&{[`&:hover, &.${chipClasses$1.focusVisible}`]:{backgroundColor:(i.vars||i).palette[o.color].dark}}),({theme:i,ownerState:o})=>_extends$1({},o.variant==="outlined"&&{backgroundColor:"transparent",border:i.vars?`1px solid ${i.vars.palette.Chip.defaultBorder}`:`1px solid ${i.palette.mode==="light"?i.palette.grey[400]:i.palette.grey[700]}`,[`&.${chipClasses$1.clickable}:hover`]:{backgroundColor:(i.vars||i).palette.action.hover},[`&.${chipClasses$1.focusVisible}`]:{backgroundColor:(i.vars||i).palette.action.focus},[`& .${chipClasses$1.avatar}`]:{marginLeft:4},[`& .${chipClasses$1.avatarSmall}`]:{marginLeft:2},[`& .${chipClasses$1.icon}`]:{marginLeft:4},[`& .${chipClasses$1.iconSmall}`]:{marginLeft:2},[`& .${chipClasses$1.deleteIcon}`]:{marginRight:5},[`& .${chipClasses$1.deleteIconSmall}`]:{marginRight:3}},o.variant==="outlined"&&o.color!=="default"&&{color:(i.vars||i).palette[o.color].main,border:`1px solid ${i.vars?`rgba(${i.vars.palette[o.color].mainChannel} / 0.7)`:alpha_1(i.palette[o.color].main,.7)}`,[`&.${chipClasses$1.clickable}:hover`]:{backgroundColor:i.vars?`rgba(${i.vars.palette[o.color].mainChannel} / ${i.vars.palette.action.hoverOpacity})`:alpha_1(i.palette[o.color].main,i.palette.action.hoverOpacity)},[`&.${chipClasses$1.focusVisible}`]:{backgroundColor:i.vars?`rgba(${i.vars.palette[o.color].mainChannel} / ${i.vars.palette.action.focusOpacity})`:alpha_1(i.palette[o.color].main,i.palette.action.focusOpacity)},[`& .${chipClasses$1.deleteIcon}`]:{color:i.vars?`rgba(${i.vars.palette[o.color].mainChannel} / 0.7)`:alpha_1(i.palette[o.color].main,.7),"&:hover, &:active":{color:(i.vars||i).palette[o.color].main}}})),ChipLabel=styled("span",{name:"MuiChip",slot:"Label",overridesResolver:(i,o)=>{const{ownerState:s}=i,{size:j}=s;return[o.label,o[`label${capitalize$1(j)}`]]}})(({ownerState:i})=>_extends$1({overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap"},i.variant==="outlined"&&{paddingLeft:11,paddingRight:11},i.size==="small"&&{paddingLeft:8,paddingRight:8},i.size==="small"&&i.variant==="outlined"&&{paddingLeft:7,paddingRight:7}));function isDeleteKeyboardEvent(i){return i.key==="Backspace"||i.key==="Delete"}const Chip=reactExports.forwardRef(function(o,s){const j=useThemeProps$1({props:o,name:"MuiChip"}),{avatar:_e,className:lt,clickable:tt,color:ot="default",component:st,deleteIcon:ct,disabled:it=!1,icon:$,label:a,onClick:et,onDelete:nt,onKeyDown:at,onKeyUp:rt,size:dt="medium",variant:ut="filled",tabIndex:bt,skipFocusWhenDisabled:mt=!1}=j,pt=_objectWithoutPropertiesLoose(j,_excluded$r),Zt=reactExports.useRef(null),ht=useForkRef(Zt,s),Gt=Ht=>{Ht.stopPropagation(),nt&&nt(Ht)},Xt=Ht=>{Ht.currentTarget===Ht.target&&isDeleteKeyboardEvent(Ht)&&Ht.preventDefault(),at&&at(Ht)},Vt=Ht=>{Ht.currentTarget===Ht.target&&(nt&&isDeleteKeyboardEvent(Ht)?nt(Ht):Ht.key==="Escape"&&Zt.current&&Zt.current.blur()),rt&&rt(Ht)},Yt=tt!==!1&&et?!0:tt,St=Yt||nt?ButtonBase$1:st||"div",Lt=_extends$1({},j,{component:St,disabled:it,size:dt,color:ot,iconColor:reactExports.isValidElement($)&&$.props.color||ot,onDelete:!!nt,clickable:Yt,variant:ut}),Ct=useUtilityClasses$n(Lt),Tt=St===ButtonBase$1?_extends$1({component:st||"div",focusVisibleClassName:Ct.focusVisible},nt&&{disableRipple:!0}):{};let ft=null;nt&&(ft=ct&&reactExports.isValidElement(ct)?reactExports.cloneElement(ct,{className:clsx(ct.props.className,Ct.deleteIcon),onClick:Gt}):jsxRuntimeExports.jsx(CancelIcon,{className:clsx(Ct.deleteIcon),onClick:Gt}));let Ft=null;_e&&reactExports.isValidElement(_e)&&(Ft=reactExports.cloneElement(_e,{className:clsx(Ct.avatar,_e.props.className)}));let Jt=null;return $&&reactExports.isValidElement($)&&(Jt=reactExports.cloneElement($,{className:clsx(Ct.icon,$.props.className)})),jsxRuntimeExports.jsxs(ChipRoot,_extends$1({as:St,className:clsx(Ct.root,lt),disabled:Yt&&it?!0:void 0,onClick:et,onKeyDown:Xt,onKeyUp:Vt,ref:ht,tabIndex:mt&&it?-1:bt,ownerState:Lt},Tt,pt,{children:[Ft||Jt,jsxRuntimeExports.jsx(ChipLabel,{className:clsx(Ct.label),ownerState:Lt,children:a}),ft]}))}),Chip$1=Chip;function formControlState({props:i,states:o,muiFormControl:s}){return o.reduce((j,_e)=>(j[_e]=i[_e],s&&typeof i[_e]>"u"&&(j[_e]=s[_e]),j),{})}const FormControlContext=reactExports.createContext(void 0),FormControlContext$1=FormControlContext;function useFormControl(){return reactExports.useContext(FormControlContext$1)}function GlobalStyles(i){return jsxRuntimeExports.jsx(GlobalStyles$1,_extends$1({},i,{defaultTheme:defaultTheme$1,themeId:THEME_ID}))}function hasValue(i){return i!=null&&!(Array.isArray(i)&&i.length===0)}function isFilled(i,o=!1){return i&&(hasValue(i.value)&&i.value!==""||o&&hasValue(i.defaultValue)&&i.defaultValue!=="")}function isAdornedStart(i){return i.startAdornment}function getInputBaseUtilityClass(i){return generateUtilityClass$1("MuiInputBase",i)}const inputBaseClasses=generateUtilityClasses$1("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]),inputBaseClasses$1=inputBaseClasses,_excluded$q=["aria-describedby","autoComplete","autoFocus","className","color","components","componentsProps","defaultValue","disabled","disableInjectingGlobalStyles","endAdornment","error","fullWidth","id","inputComponent","inputProps","inputRef","margin","maxRows","minRows","multiline","name","onBlur","onChange","onClick","onFocus","onKeyDown","onKeyUp","placeholder","readOnly","renderSuffix","rows","size","slotProps","slots","startAdornment","type","value"],rootOverridesResolver=(i,o)=>{const{ownerState:s}=i;return[o.root,s.formControl&&o.formControl,s.startAdornment&&o.adornedStart,s.endAdornment&&o.adornedEnd,s.error&&o.error,s.size==="small"&&o.sizeSmall,s.multiline&&o.multiline,s.color&&o[`color${capitalize$1(s.color)}`],s.fullWidth&&o.fullWidth,s.hiddenLabel&&o.hiddenLabel]},inputOverridesResolver=(i,o)=>{const{ownerState:s}=i;return[o.input,s.size==="small"&&o.inputSizeSmall,s.multiline&&o.inputMultiline,s.type==="search"&&o.inputTypeSearch,s.startAdornment&&o.inputAdornedStart,s.endAdornment&&o.inputAdornedEnd,s.hiddenLabel&&o.inputHiddenLabel]},useUtilityClasses$m=i=>{const{classes:o,color:s,disabled:j,error:_e,endAdornment:lt,focused:tt,formControl:ot,fullWidth:st,hiddenLabel:ct,multiline:it,readOnly:$,size:a,startAdornment:et,type:nt}=i,at={root:["root",`color${capitalize$1(s)}`,j&&"disabled",_e&&"error",st&&"fullWidth",tt&&"focused",ot&&"formControl",a&&a!=="medium"&&`size${capitalize$1(a)}`,it&&"multiline",et&&"adornedStart",lt&&"adornedEnd",ct&&"hiddenLabel",$&&"readOnly"],input:["input",j&&"disabled",nt==="search"&&"inputTypeSearch",it&&"inputMultiline",a==="small"&&"inputSizeSmall",ct&&"inputHiddenLabel",et&&"inputAdornedStart",lt&&"inputAdornedEnd",$&&"readOnly"]};return composeClasses(at,getInputBaseUtilityClass,o)},InputBaseRoot=styled("div",{name:"MuiInputBase",slot:"Root",overridesResolver:rootOverridesResolver})(({theme:i,ownerState:o})=>_extends$1({},i.typography.body1,{color:(i.vars||i).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${inputBaseClasses$1.disabled}`]:{color:(i.vars||i).palette.text.disabled,cursor:"default"}},o.multiline&&_extends$1({padding:"4px 0 5px"},o.size==="small"&&{paddingTop:1}),o.fullWidth&&{width:"100%"})),InputBaseComponent=styled("input",{name:"MuiInputBase",slot:"Input",overridesResolver:inputOverridesResolver})(({theme:i,ownerState:o})=>{const s=i.palette.mode==="light",j=_extends$1({color:"currentColor"},i.vars?{opacity:i.vars.opacity.inputPlaceholder}:{opacity:s?.42:.5},{transition:i.transitions.create("opacity",{duration:i.transitions.duration.shorter})}),_e={opacity:"0 !important"},lt=i.vars?{opacity:i.vars.opacity.inputPlaceholder}:{opacity:s?.42:.5};return _extends$1({font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%",animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&::-webkit-input-placeholder":j,"&::-moz-placeholder":j,"&:-ms-input-placeholder":j,"&::-ms-input-placeholder":j,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${inputBaseClasses$1.formControl} &`]:{"&::-webkit-input-placeholder":_e,"&::-moz-placeholder":_e,"&:-ms-input-placeholder":_e,"&::-ms-input-placeholder":_e,"&:focus::-webkit-input-placeholder":lt,"&:focus::-moz-placeholder":lt,"&:focus:-ms-input-placeholder":lt,"&:focus::-ms-input-placeholder":lt},[`&.${inputBaseClasses$1.disabled}`]:{opacity:1,WebkitTextFillColor:(i.vars||i).palette.text.disabled},"&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}},o.size==="small"&&{paddingTop:1},o.multiline&&{height:"auto",resize:"none",padding:0,paddingTop:0},o.type==="search"&&{MozAppearance:"textfield"})}),inputGlobalStyles=jsxRuntimeExports.jsx(GlobalStyles,{styles:{"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}}),InputBase=reactExports.forwardRef(function(o,s){var j;const _e=useThemeProps$1({props:o,name:"MuiInputBase"}),{"aria-describedby":lt,autoComplete:tt,autoFocus:ot,className:st,components:ct={},componentsProps:it={},defaultValue:$,disabled:a,disableInjectingGlobalStyles:et,endAdornment:nt,fullWidth:at=!1,id:rt,inputComponent:dt="input",inputProps:ut={},inputRef:bt,maxRows:mt,minRows:pt,multiline:Zt=!1,name:ht,onBlur:Gt,onChange:Xt,onClick:Vt,onFocus:Yt,onKeyDown:St,onKeyUp:Lt,placeholder:Ct,readOnly:Tt,renderSuffix:ft,rows:Ft,slotProps:Jt={},slots:Ht={},startAdornment:wt,type:Et="text",value:At}=_e,Il=_objectWithoutPropertiesLoose(_e,_excluded$q),Qt=ut.value!=null?ut.value:At,{current:jt}=reactExports.useRef(Qt!=null),Xl=reactExports.useRef(),Yl=reactExports.useCallback(Bl=>{},[]),Rl=useForkRef(Xl,bt,ut.ref,Yl),[Tl,zl]=reactExports.useState(!1),Ll=useFormControl(),Cl=formControlState({props:_e,muiFormControl:Ll,states:["color","disabled","error","hiddenLabel","size","required","filled"]});Cl.focused=Ll?Ll.focused:Tl,reactExports.useEffect(()=>{!Ll&&a&&Tl&&(zl(!1),Gt&&Gt())},[Ll,a,Tl,Gt]);const yl=Ll&&Ll.onFilled,Wl=Ll&&Ll.onEmpty,xl=reactExports.useCallback(Bl=>{isFilled(Bl)?yl&&yl():Wl&&Wl()},[yl,Wl]);useEnhancedEffect(()=>{jt&&xl({value:Qt})},[Qt,xl,jt]);const Gl=Bl=>{if(Cl.disabled){Bl.stopPropagation();return}Yt&&Yt(Bl),ut.onFocus&&ut.onFocus(Bl),Ll&&Ll.onFocus?Ll.onFocus(Bl):zl(!0)},sn=Bl=>{Gt&&Gt(Bl),ut.onBlur&&ut.onBlur(Bl),Ll&&Ll.onBlur?Ll.onBlur(Bl):zl(!1)},Fl=(Bl,...Ot)=>{if(!jt){const rn=Bl.target||Xl.current;if(rn==null)throw new Error(formatMuiErrorMessage$1(1));xl({value:rn.value})}ut.onChange&&ut.onChange(Bl,...Ot),Xt&&Xt(Bl,...Ot)};reactExports.useEffect(()=>{xl(Xl.current)},[]);const cn=Bl=>{Xl.current&&Bl.currentTarget===Bl.target&&Xl.current.focus(),Vt&&Vt(Bl)};let Ol=dt,Ml=ut;Zt&&Ol==="input"&&(Ft?Ml=_extends$1({type:void 0,minRows:Ft,maxRows:Ft},Ml):Ml=_extends$1({type:void 0,maxRows:mt,minRows:pt},Ml),Ol=TextareaAutosize);const Ul=Bl=>{xl(Bl.animationName==="mui-auto-fill-cancel"?Xl.current:{value:"x"})};reactExports.useEffect(()=>{Ll&&Ll.setAdornedStart(!!wt)},[Ll,wt]);const Ql=_extends$1({},_e,{color:Cl.color||"primary",disabled:Cl.disabled,endAdornment:nt,error:Cl.error,focused:Cl.focused,formControl:Ll,fullWidth:at,hiddenLabel:Cl.hiddenLabel,multiline:Zt,size:Cl.size,startAdornment:wt,type:Et}),El=useUtilityClasses$m(Ql),Nl=Ht.root||ct.Root||InputBaseRoot,Zn=Jt.root||it.root||{},bn=Ht.input||ct.Input||InputBaseComponent;return Ml=_extends$1({},Ml,(j=Jt.input)!=null?j:it.input),jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[!et&&inputGlobalStyles,jsxRuntimeExports.jsxs(Nl,_extends$1({},Zn,!isHostComponent(Nl)&&{ownerState:_extends$1({},Ql,Zn.ownerState)},{ref:s,onClick:cn},Il,{className:clsx(El.root,Zn.className,st,Tt&&"MuiInputBase-readOnly"),children:[wt,jsxRuntimeExports.jsx(FormControlContext$1.Provider,{value:null,children:jsxRuntimeExports.jsx(bn,_extends$1({ownerState:Ql,"aria-invalid":Cl.error,"aria-describedby":lt,autoComplete:tt,autoFocus:ot,defaultValue:$,disabled:Cl.disabled,id:rt,onAnimationStart:Ul,name:ht,placeholder:Ct,readOnly:Tt,required:Cl.required,rows:Ft,value:Qt,onKeyDown:St,onKeyUp:Lt,type:Et},Ml,!isHostComponent(bn)&&{as:Ol,ownerState:_extends$1({},Ql,Ml.ownerState)},{ref:Rl,className:clsx(El.input,Ml.className,Tt&&"MuiInputBase-readOnly"),onBlur:sn,onChange:Fl,onFocus:Gl}))}),nt,ft?ft(_extends$1({},Cl,{startAdornment:wt})):null]}))]})}),InputBase$1=InputBase;function getInputUtilityClass(i){return generateUtilityClass$1("MuiInput",i)}const inputClasses=_extends$1({},inputBaseClasses$1,generateUtilityClasses$1("MuiInput",["root","underline","input"]));function getOutlinedInputUtilityClass(i){return generateUtilityClass$1("MuiOutlinedInput",i)}const outlinedInputClasses=_extends$1({},inputBaseClasses$1,generateUtilityClasses$1("MuiOutlinedInput",["root","notchedOutline","input"])),outlinedInputClasses$1=outlinedInputClasses;function getFilledInputUtilityClass(i){return generateUtilityClass$1("MuiFilledInput",i)}const filledInputClasses=_extends$1({},inputBaseClasses$1,generateUtilityClasses$1("MuiFilledInput",["root","underline","input"])),filledInputClasses$1=filledInputClasses,ArrowDropDownIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown");function getAutocompleteUtilityClass(i){return generateUtilityClass$1("MuiAutocomplete",i)}const autocompleteClasses=generateUtilityClasses$1("MuiAutocomplete",["root","expanded","fullWidth","focused","focusVisible","tag","tagSizeSmall","tagSizeMedium","hasPopupIcon","hasClearIcon","inputRoot","input","inputFocused","endAdornment","clearIndicator","popupIndicator","popupIndicatorOpen","popper","popperDisablePortal","paper","listbox","loading","noOptions","option","groupLabel","groupUl"]);var _ClearIcon,_ArrowDropDownIcon;const _excluded$p=["autoComplete","autoHighlight","autoSelect","blurOnSelect","ChipProps","className","clearIcon","clearOnBlur","clearOnEscape","clearText","closeText","componentsProps","defaultValue","disableClearable","disableCloseOnSelect","disabled","disabledItemsFocusable","disableListWrap","disablePortal","filterOptions","filterSelectedOptions","forcePopupIcon","freeSolo","fullWidth","getLimitTagsText","getOptionDisabled","getOptionKey","getOptionLabel","isOptionEqualToValue","groupBy","handleHomeEndKeys","id","includeInputInList","inputValue","limitTags","ListboxComponent","ListboxProps","loading","loadingText","multiple","noOptionsText","onChange","onClose","onHighlightChange","onInputChange","onOpen","open","openOnFocus","openText","options","PaperComponent","PopperComponent","popupIcon","readOnly","renderGroup","renderInput","renderOption","renderTags","selectOnFocus","size","slotProps","value"],_excluded2$4=["ref"],useThemeProps=createUseThemeProps(),useUtilityClasses$l=i=>{const{classes:o,disablePortal:s,expanded:j,focused:_e,fullWidth:lt,hasClearIcon:tt,hasPopupIcon:ot,inputFocused:st,popupOpen:ct,size:it}=i,$={root:["root",j&&"expanded",_e&&"focused",lt&&"fullWidth",tt&&"hasClearIcon",ot&&"hasPopupIcon"],inputRoot:["inputRoot"],input:["input",st&&"inputFocused"],tag:["tag",`tagSize${capitalize$1(it)}`],endAdornment:["endAdornment"],clearIndicator:["clearIndicator"],popupIndicator:["popupIndicator",ct&&"popupIndicatorOpen"],popper:["popper",s&&"popperDisablePortal"],paper:["paper"],listbox:["listbox"],loading:["loading"],noOptions:["noOptions"],option:["option"],groupLabel:["groupLabel"],groupUl:["groupUl"]};return composeClasses($,getAutocompleteUtilityClass,o)},AutocompleteRoot=styled("div",{name:"MuiAutocomplete",slot:"Root",overridesResolver:(i,o)=>{const{ownerState:s}=i,{fullWidth:j,hasClearIcon:_e,hasPopupIcon:lt,inputFocused:tt,size:ot}=s;return[{[`& .${autocompleteClasses.tag}`]:o.tag},{[`& .${autocompleteClasses.tag}`]:o[`tagSize${capitalize$1(ot)}`]},{[`& .${autocompleteClasses.inputRoot}`]:o.inputRoot},{[`& .${autocompleteClasses.input}`]:o.input},{[`& .${autocompleteClasses.input}`]:tt&&o.inputFocused},o.root,j&&o.fullWidth,lt&&o.hasPopupIcon,_e&&o.hasClearIcon]}})({[`&.${autocompleteClasses.focused} .${autocompleteClasses.clearIndicator}`]:{visibility:"visible"},"@media (pointer: fine)":{[`&:hover .${autocompleteClasses.clearIndicator}`]:{visibility:"visible"}},[`& .${autocompleteClasses.tag}`]:{margin:3,maxWidth:"calc(100% - 6px)"},[`& .${autocompleteClasses.inputRoot}`]:{flexWrap:"wrap",[`.${autocompleteClasses.hasPopupIcon}&, .${autocompleteClasses.hasClearIcon}&`]:{paddingRight:30},[`.${autocompleteClasses.hasPopupIcon}.${autocompleteClasses.hasClearIcon}&`]:{paddingRight:56},[`& .${autocompleteClasses.input}`]:{width:0,minWidth:30}},[`& .${inputClasses.root}`]:{paddingBottom:1,"& .MuiInput-input":{padding:"4px 4px 4px 0px"}},[`& .${inputClasses.root}.${inputBaseClasses$1.sizeSmall}`]:{[`& .${inputClasses.input}`]:{padding:"2px 4px 3px 0"}},[`& .${outlinedInputClasses$1.root}`]:{padding:9,[`.${autocompleteClasses.hasPopupIcon}&, .${autocompleteClasses.hasClearIcon}&`]:{paddingRight:39},[`.${autocompleteClasses.hasPopupIcon}.${autocompleteClasses.hasClearIcon}&`]:{paddingRight:65},[`& .${autocompleteClasses.input}`]:{padding:"7.5px 4px 7.5px 5px"},[`& .${autocompleteClasses.endAdornment}`]:{right:9}},[`& .${outlinedInputClasses$1.root}.${inputBaseClasses$1.sizeSmall}`]:{paddingTop:6,paddingBottom:6,paddingLeft:6,[`& .${autocompleteClasses.input}`]:{padding:"2.5px 4px 2.5px 8px"}},[`& .${filledInputClasses$1.root}`]:{paddingTop:19,paddingLeft:8,[`.${autocompleteClasses.hasPopupIcon}&, .${autocompleteClasses.hasClearIcon}&`]:{paddingRight:39},[`.${autocompleteClasses.hasPopupIcon}.${autocompleteClasses.hasClearIcon}&`]:{paddingRight:65},[`& .${filledInputClasses$1.input}`]:{padding:"7px 4px"},[`& .${autocompleteClasses.endAdornment}`]:{right:9}},[`& .${filledInputClasses$1.root}.${inputBaseClasses$1.sizeSmall}`]:{paddingBottom:1,[`& .${filledInputClasses$1.input}`]:{padding:"2.5px 4px"}},[`& .${inputBaseClasses$1.hiddenLabel}`]:{paddingTop:8},[`& .${filledInputClasses$1.root}.${inputBaseClasses$1.hiddenLabel}`]:{paddingTop:0,paddingBottom:0,[`& .${autocompleteClasses.input}`]:{paddingTop:16,paddingBottom:17}},[`& .${filledInputClasses$1.root}.${inputBaseClasses$1.hiddenLabel}.${inputBaseClasses$1.sizeSmall}`]:{[`& .${autocompleteClasses.input}`]:{paddingTop:8,paddingBottom:9}},[`& .${autocompleteClasses.input}`]:{flexGrow:1,textOverflow:"ellipsis",opacity:0},variants:[{props:{fullWidth:!0},style:{width:"100%"}},{props:{size:"small"},style:{[`& .${autocompleteClasses.tag}`]:{margin:2,maxWidth:"calc(100% - 4px)"}}},{props:{inputFocused:!0},style:{[`& .${autocompleteClasses.input}`]:{opacity:1}}}]}),AutocompleteEndAdornment=styled("div",{name:"MuiAutocomplete",slot:"EndAdornment",overridesResolver:(i,o)=>o.endAdornment})({position:"absolute",right:0,top:"50%",transform:"translate(0, -50%)"}),AutocompleteClearIndicator=styled(IconButton$1,{name:"MuiAutocomplete",slot:"ClearIndicator",overridesResolver:(i,o)=>o.clearIndicator})({marginRight:-2,padding:4,visibility:"hidden"}),AutocompletePopupIndicator=styled(IconButton$1,{name:"MuiAutocomplete",slot:"PopupIndicator",overridesResolver:({ownerState:i},o)=>_extends$1({},o.popupIndicator,i.popupOpen&&o.popupIndicatorOpen)})({padding:2,marginRight:-2,variants:[{props:{popupOpen:!0},style:{transform:"rotate(180deg)"}}]}),AutocompletePopper=styled(Popper$1,{name:"MuiAutocomplete",slot:"Popper",overridesResolver:(i,o)=>{const{ownerState:s}=i;return[{[`& .${autocompleteClasses.option}`]:o.option},o.popper,s.disablePortal&&o.popperDisablePortal]}})(({theme:i})=>({zIndex:(i.vars||i).zIndex.modal,variants:[{props:{disablePortal:!0},style:{position:"absolute"}}]})),AutocompletePaper=styled(Paper$1,{name:"MuiAutocomplete",slot:"Paper",overridesResolver:(i,o)=>o.paper})(({theme:i})=>_extends$1({},i.typography.body1,{overflow:"auto"})),AutocompleteLoading=styled("div",{name:"MuiAutocomplete",slot:"Loading",overridesResolver:(i,o)=>o.loading})(({theme:i})=>({color:(i.vars||i).palette.text.secondary,padding:"14px 16px"})),AutocompleteNoOptions=styled("div",{name:"MuiAutocomplete",slot:"NoOptions",overridesResolver:(i,o)=>o.noOptions})(({theme:i})=>({color:(i.vars||i).palette.text.secondary,padding:"14px 16px"})),AutocompleteListbox=styled("div",{name:"MuiAutocomplete",slot:"Listbox",overridesResolver:(i,o)=>o.listbox})(({theme:i})=>({listStyle:"none",margin:0,padding:"8px 0",maxHeight:"40vh",overflow:"auto",position:"relative",[`& .${autocompleteClasses.option}`]:{minHeight:48,display:"flex",overflow:"hidden",justifyContent:"flex-start",alignItems:"center",cursor:"pointer",paddingTop:6,boxSizing:"border-box",outline:"0",WebkitTapHighlightColor:"transparent",paddingBottom:6,paddingLeft:16,paddingRight:16,[i.breakpoints.up("sm")]:{minHeight:"auto"},[`&.${autocompleteClasses.focused}`]:{backgroundColor:(i.vars||i).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},'&[aria-disabled="true"]':{opacity:(i.vars||i).palette.action.disabledOpacity,pointerEvents:"none"},[`&.${autocompleteClasses.focusVisible}`]:{backgroundColor:(i.vars||i).palette.action.focus},'&[aria-selected="true"]':{backgroundColor:i.vars?`rgba(${i.vars.palette.primary.mainChannel} / ${i.vars.palette.action.selectedOpacity})`:alpha_1(i.palette.primary.main,i.palette.action.selectedOpacity),[`&.${autocompleteClasses.focused}`]:{backgroundColor:i.vars?`rgba(${i.vars.palette.primary.mainChannel} / calc(${i.vars.palette.action.selectedOpacity} + ${i.vars.palette.action.hoverOpacity}))`:alpha_1(i.palette.primary.main,i.palette.action.selectedOpacity+i.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:(i.vars||i).palette.action.selected}},[`&.${autocompleteClasses.focusVisible}`]:{backgroundColor:i.vars?`rgba(${i.vars.palette.primary.mainChannel} / calc(${i.vars.palette.action.selectedOpacity} + ${i.vars.palette.action.focusOpacity}))`:alpha_1(i.palette.primary.main,i.palette.action.selectedOpacity+i.palette.action.focusOpacity)}}}})),AutocompleteGroupLabel=styled(ListSubheader$1,{name:"MuiAutocomplete",slot:"GroupLabel",overridesResolver:(i,o)=>o.groupLabel})(({theme:i})=>({backgroundColor:(i.vars||i).palette.background.paper,top:-8})),AutocompleteGroupUl=styled("ul",{name:"MuiAutocomplete",slot:"GroupUl",overridesResolver:(i,o)=>o.groupUl})({padding:0,[`& .${autocompleteClasses.option}`]:{paddingLeft:24}}),Autocomplete=reactExports.forwardRef(function(o,s){var j,_e,lt,tt;const ot=useThemeProps({props:o,name:"MuiAutocomplete"}),{autoComplete:st=!1,autoHighlight:ct=!1,autoSelect:it=!1,blurOnSelect:$=!1,ChipProps:a,className:et,clearIcon:nt=_ClearIcon||(_ClearIcon=jsxRuntimeExports.jsx(ClearIcon,{fontSize:"small"})),clearOnBlur:at=!ot.freeSolo,clearOnEscape:rt=!1,clearText:dt="Clear",closeText:ut="Close",componentsProps:bt={},defaultValue:mt=ot.multiple?[]:null,disableClearable:pt=!1,disableCloseOnSelect:Zt=!1,disabled:ht=!1,disabledItemsFocusable:Gt=!1,disableListWrap:Xt=!1,disablePortal:Vt=!1,filterSelectedOptions:Yt=!1,forcePopupIcon:St="auto",freeSolo:Lt=!1,fullWidth:Ct=!1,getLimitTagsText:Tt=Kt=>`+${Kt}`,getOptionLabel:ft,groupBy:Ft,handleHomeEndKeys:Jt=!ot.freeSolo,includeInputInList:Ht=!1,limitTags:wt=-1,ListboxComponent:Et="ul",ListboxProps:At,loading:Il=!1,loadingText:Qt="Loading…",multiple:jt=!1,noOptionsText:Xl="No options",openOnFocus:Yl=!1,openText:Rl="Open",PaperComponent:Tl=Paper$1,PopperComponent:zl=Popper$1,popupIcon:Ll=_ArrowDropDownIcon||(_ArrowDropDownIcon=jsxRuntimeExports.jsx(ArrowDropDownIcon,{})),readOnly:Cl=!1,renderGroup:yl,renderInput:Wl,renderOption:xl,renderTags:Gl,selectOnFocus:sn=!ot.freeSolo,size:Fl="medium",slotProps:cn={}}=ot,Ol=_objectWithoutPropertiesLoose(ot,_excluded$p),{getRootProps:Ml,getInputProps:Ul,getInputLabelProps:Ql,getPopupIndicatorProps:El,getClearProps:Nl,getTagProps:Zn,getListboxProps:bn,getOptionProps:Bl,value:Ot,dirty:rn,expanded:yn,id:an,popupOpen:Vl,focused:$t,focusedTag:$l,anchorEl:Vn,setAnchorEl:xn,inputValue:Sn,groupedOptions:Pl}=useAutocomplete(_extends$1({},ot,{componentName:"Autocomplete"})),gn=!pt&&!ht&&rn&&!Cl,Rn=(!Lt||St===!0)&&St!==!1,{onMouseDown:Yn}=Ul(),{ref:Jl}=At??{},Kl=bn(),{ref:Hl}=Kl,Jn=_objectWithoutPropertiesLoose(Kl,_excluded2$4),vn=useForkRef(Hl,Jl),Fn=ft||(Kt=>{var kt;return(kt=Kt.label)!=null?kt:Kt}),hn=_extends$1({},ot,{disablePortal:Vt,expanded:yn,focused:$t,fullWidth:Ct,getOptionLabel:Fn,hasClearIcon:gn,hasPopupIcon:Rn,inputFocused:$l===-1,popupOpen:Vl,size:Fl}),mn=useUtilityClasses$l(hn);let In;if(jt&&Ot.length>0){const Kt=kt=>_extends$1({className:mn.tag,disabled:ht},Zn(kt));Gl?In=Gl(Ot,Kt,hn):In=Ot.map((kt,Pt)=>jsxRuntimeExports.jsx(Chip$1,_extends$1({label:Fn(kt),size:Fl},Kt({index:Pt}),a)))}if(wt>-1&&Array.isArray(In)){const Kt=In.length-wt;!$t&&Kt>0&&(In=In.splice(0,wt),In.push(jsxRuntimeExports.jsx("span",{className:mn.tag,children:Tt(Kt)},In.length)))}const Bn=yl||(Kt=>jsxRuntimeExports.jsxs("li",{children:[jsxRuntimeExports.jsx(AutocompleteGroupLabel,{className:mn.groupLabel,ownerState:hn,component:"div",children:Kt.group}),jsxRuntimeExports.jsx(AutocompleteGroupUl,{className:mn.groupUl,ownerState:hn,children:Kt.children})]},Kt.key)),zn=xl||((Kt,kt)=>reactExports.createElement("li",_extends$1({},Kt,{key:Kt.key}),Fn(kt))),Hn=(Kt,kt)=>{const Pt=Bl({option:Kt,index:kt});return zn(_extends$1({},Pt,{className:mn.option}),Kt,{selected:Pt["aria-selected"],index:kt,inputValue:Sn},hn)},Tn=(j=cn.clearIndicator)!=null?j:bt.clearIndicator,Ln=(_e=cn.paper)!=null?_e:bt.paper,It=(lt=cn.popper)!=null?lt:bt.popper,Wt=(tt=cn.popupIndicator)!=null?tt:bt.popupIndicator,Rt=Kt=>jsxRuntimeExports.jsx(AutocompletePopper,_extends$1({as:zl,disablePortal:Vt,style:{width:Vn?Vn.clientWidth:null},ownerState:hn,role:"presentation",anchorEl:Vn,open:Vl},It,{className:clsx(mn.popper,It==null?void 0:It.className),children:jsxRuntimeExports.jsx(AutocompletePaper,_extends$1({ownerState:hn,as:Tl},Ln,{className:clsx(mn.paper,Ln==null?void 0:Ln.className),children:Kt}))}));let Nt=null;return!Il&&Pl.length>0?Nt=Rt(jsxRuntimeExports.jsx(AutocompleteListbox,_extends$1({as:Et,className:mn.listbox,ownerState:hn},Jn,At,{ref:vn,children:Pl.map((Kt,kt)=>Ft?Bn({key:Kt.key,group:Kt.group,children:Kt.options.map((Pt,Zl)=>Hn(Pt,Kt.index+Zl))}):Hn(Kt,kt))}))):Il&&Pl.length===0?Nt=Rt(jsxRuntimeExports.jsx(AutocompleteLoading,{className:mn.loading,ownerState:hn,children:Qt})):Pl.length===0&&!Lt&&!Il&&(Nt=Rt(jsxRuntimeExports.jsx(AutocompleteNoOptions,{className:mn.noOptions,ownerState:hn,role:"presentation",onMouseDown:Kt=>{Kt.preventDefault()},children:Xl}))),jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx(AutocompleteRoot,_extends$1({ref:s,className:clsx(mn.root,et),ownerState:hn},Ml(Ol),{children:Wl({id:an,disabled:ht,fullWidth:!0,size:Fl==="small"?"small":void 0,InputLabelProps:Ql(),InputProps:_extends$1({ref:xn,className:mn.inputRoot,startAdornment:In,onClick:Kt=>{Kt.target===Kt.currentTarget&&Yn(Kt)}},(gn||Rn)&&{endAdornment:jsxRuntimeExports.jsxs(AutocompleteEndAdornment,{className:mn.endAdornment,ownerState:hn,children:[gn?jsxRuntimeExports.jsx(AutocompleteClearIndicator,_extends$1({},Nl(),{"aria-label":dt,title:dt,ownerState:hn},Tn,{className:clsx(mn.clearIndicator,Tn==null?void 0:Tn.className),children:nt})):null,Rn?jsxRuntimeExports.jsx(AutocompletePopupIndicator,_extends$1({},El(),{disabled:ht,"aria-label":Vl?ut:Rl,title:Vl?ut:Rl,ownerState:hn},Wt,{className:clsx(mn.popupIndicator,Wt==null?void 0:Wt.className),children:Ll})):null]})}),inputProps:_extends$1({className:mn.input,disabled:ht,readOnly:Cl},Ul())})})),Vn?Nt:null]})}),Autocomplete$1=Autocomplete,_excluded$o=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"],styles$1={entering:{opacity:1},entered:{opacity:1}},Fade=reactExports.forwardRef(function(o,s){const j=useTheme$1(),_e={enter:j.transitions.duration.enteringScreen,exit:j.transitions.duration.leavingScreen},{addEndListener:lt,appear:tt=!0,children:ot,easing:st,in:ct,onEnter:it,onEntered:$,onEntering:a,onExit:et,onExited:nt,onExiting:at,style:rt,timeout:dt=_e,TransitionComponent:ut=Transition$1}=o,bt=_objectWithoutPropertiesLoose(o,_excluded$o),mt=reactExports.useRef(null),pt=useForkRef(mt,ot.ref,s),Zt=Ct=>Tt=>{if(Ct){const ft=mt.current;Tt===void 0?Ct(ft):Ct(ft,Tt)}},ht=Zt(a),Gt=Zt((Ct,Tt)=>{reflow(Ct);const ft=getTransitionProps({style:rt,timeout:dt,easing:st},{mode:"enter"});Ct.style.webkitTransition=j.transitions.create("opacity",ft),Ct.style.transition=j.transitions.create("opacity",ft),it&&it(Ct,Tt)}),Xt=Zt($),Vt=Zt(at),Yt=Zt(Ct=>{const Tt=getTransitionProps({style:rt,timeout:dt,easing:st},{mode:"exit"});Ct.style.webkitTransition=j.transitions.create("opacity",Tt),Ct.style.transition=j.transitions.create("opacity",Tt),et&&et(Ct)}),St=Zt(nt),Lt=Ct=>{lt&<(mt.current,Ct)};return jsxRuntimeExports.jsx(ut,_extends$1({appear:tt,in:ct,nodeRef:mt,onEnter:Gt,onEntered:Xt,onEntering:ht,onExit:Yt,onExited:St,onExiting:Vt,addEndListener:Lt,timeout:dt},bt,{children:(Ct,Tt)=>reactExports.cloneElement(ot,_extends$1({style:_extends$1({opacity:0,visibility:Ct==="exited"&&!ct?"hidden":void 0},styles$1[Ct],rt,ot.props.style),ref:pt},Tt))}))}),Fade$1=Fade;function getBackdropUtilityClass(i){return generateUtilityClass$1("MuiBackdrop",i)}generateUtilityClasses$1("MuiBackdrop",["root","invisible"]);const _excluded$n=["children","className","component","components","componentsProps","invisible","open","slotProps","slots","TransitionComponent","transitionDuration"],useUtilityClasses$k=i=>{const{classes:o,invisible:s}=i;return composeClasses({root:["root",s&&"invisible"]},getBackdropUtilityClass,o)},BackdropRoot=styled("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(i,o)=>{const{ownerState:s}=i;return[o.root,s.invisible&&o.invisible]}})(({ownerState:i})=>_extends$1({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent"},i.invisible&&{backgroundColor:"transparent"})),Backdrop=reactExports.forwardRef(function(o,s){var j,_e,lt;const tt=useThemeProps$1({props:o,name:"MuiBackdrop"}),{children:ot,className:st,component:ct="div",components:it={},componentsProps:$={},invisible:a=!1,open:et,slotProps:nt={},slots:at={},TransitionComponent:rt=Fade$1,transitionDuration:dt}=tt,ut=_objectWithoutPropertiesLoose(tt,_excluded$n),bt=_extends$1({},tt,{component:ct,invisible:a}),mt=useUtilityClasses$k(bt),pt=(j=nt.root)!=null?j:$.root;return jsxRuntimeExports.jsx(rt,_extends$1({in:et,timeout:dt},ut,{children:jsxRuntimeExports.jsx(BackdropRoot,_extends$1({"aria-hidden":!0},pt,{as:(_e=(lt=at.root)!=null?lt:it.Root)!=null?_e:ct,className:clsx(mt.root,st,pt==null?void 0:pt.className),ownerState:_extends$1({},bt,pt==null?void 0:pt.ownerState),classes:mt,ref:s,children:ot}))}))}),Backdrop$1=Backdrop;function getCircularProgressUtilityClass(i){return generateUtilityClass$1("MuiCircularProgress",i)}generateUtilityClasses$1("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const _excluded$m=["className","color","disableShrink","size","style","thickness","value","variant"];let _=i=>i,_t,_t2,_t3,_t4;const SIZE=44,circularRotateKeyframe=keyframes(_t||(_t=_` 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } `)),circularDashKeyframe=keyframes(_t2||(_t2=_` 0% { stroke-dasharray: 1px, 200px; stroke-dashoffset: 0; } 50% { stroke-dasharray: 100px, 200px; stroke-dashoffset: -15px; } 100% { stroke-dasharray: 100px, 200px; stroke-dashoffset: -125px; } `)),useUtilityClasses$j=i=>{const{classes:o,variant:s,color:j,disableShrink:_e}=i,lt={root:["root",s,`color${capitalize$1(j)}`],svg:["svg"],circle:["circle",`circle${capitalize$1(s)}`,_e&&"circleDisableShrink"]};return composeClasses(lt,getCircularProgressUtilityClass,o)},CircularProgressRoot=styled("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(i,o)=>{const{ownerState:s}=i;return[o.root,o[s.variant],o[`color${capitalize$1(s.color)}`]]}})(({ownerState:i,theme:o})=>_extends$1({display:"inline-block"},i.variant==="determinate"&&{transition:o.transitions.create("transform")},i.color!=="inherit"&&{color:(o.vars||o).palette[i.color].main}),({ownerState:i})=>i.variant==="indeterminate"&&css(_t3||(_t3=_` animation: ${0} 1.4s linear infinite; `),circularRotateKeyframe)),CircularProgressSVG=styled("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(i,o)=>o.svg})({display:"block"}),CircularProgressCircle=styled("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(i,o)=>{const{ownerState:s}=i;return[o.circle,o[`circle${capitalize$1(s.variant)}`],s.disableShrink&&o.circleDisableShrink]}})(({ownerState:i,theme:o})=>_extends$1({stroke:"currentColor"},i.variant==="determinate"&&{transition:o.transitions.create("stroke-dashoffset")},i.variant==="indeterminate"&&{strokeDasharray:"80px, 200px",strokeDashoffset:0}),({ownerState:i})=>i.variant==="indeterminate"&&!i.disableShrink&&css(_t4||(_t4=_` animation: ${0} 1.4s ease-in-out infinite; `),circularDashKeyframe)),CircularProgress=reactExports.forwardRef(function(o,s){const j=useThemeProps$1({props:o,name:"MuiCircularProgress"}),{className:_e,color:lt="primary",disableShrink:tt=!1,size:ot=40,style:st,thickness:ct=3.6,value:it=0,variant:$="indeterminate"}=j,a=_objectWithoutPropertiesLoose(j,_excluded$m),et=_extends$1({},j,{color:lt,disableShrink:tt,size:ot,thickness:ct,value:it,variant:$}),nt=useUtilityClasses$j(et),at={},rt={},dt={};if($==="determinate"){const ut=2*Math.PI*((SIZE-ct)/2);at.strokeDasharray=ut.toFixed(3),dt["aria-valuenow"]=Math.round(it),at.strokeDashoffset=`${((100-it)/100*ut).toFixed(3)}px`,rt.transform="rotate(-90deg)"}return jsxRuntimeExports.jsx(CircularProgressRoot,_extends$1({className:clsx(nt.root,_e),style:_extends$1({width:ot,height:ot},rt,st),ownerState:et,ref:s,role:"progressbar"},dt,a,{children:jsxRuntimeExports.jsx(CircularProgressSVG,{className:nt.svg,ownerState:et,viewBox:`${SIZE/2} ${SIZE/2} ${SIZE} ${SIZE}`,children:jsxRuntimeExports.jsx(CircularProgressCircle,{className:nt.circle,style:at,ownerState:et,cx:SIZE,cy:SIZE,r:(SIZE-ct)/2,fill:"none",strokeWidth:ct})})}))}),CircularProgress$1=CircularProgress;function getModalUtilityClass(i){return generateUtilityClass$1("MuiModal",i)}generateUtilityClasses$1("MuiModal",["root","hidden","backdrop"]);const _excluded$l=["BackdropComponent","BackdropProps","classes","className","closeAfterTransition","children","container","component","components","componentsProps","disableAutoFocus","disableEnforceFocus","disableEscapeKeyDown","disablePortal","disableRestoreFocus","disableScrollLock","hideBackdrop","keepMounted","onBackdropClick","onClose","onTransitionEnter","onTransitionExited","open","slotProps","slots","theme"],useUtilityClasses$i=i=>{const{open:o,exited:s,classes:j}=i;return composeClasses({root:["root",!o&&s&&"hidden"],backdrop:["backdrop"]},getModalUtilityClass,j)},ModalRoot=styled("div",{name:"MuiModal",slot:"Root",overridesResolver:(i,o)=>{const{ownerState:s}=i;return[o.root,!s.open&&s.exited&&o.hidden]}})(({theme:i,ownerState:o})=>_extends$1({position:"fixed",zIndex:(i.vars||i).zIndex.modal,right:0,bottom:0,top:0,left:0},!o.open&&o.exited&&{visibility:"hidden"})),ModalBackdrop=styled(Backdrop$1,{name:"MuiModal",slot:"Backdrop",overridesResolver:(i,o)=>o.backdrop})({zIndex:-1}),Modal=reactExports.forwardRef(function(o,s){var j,_e,lt,tt,ot,st;const ct=useThemeProps$1({name:"MuiModal",props:o}),{BackdropComponent:it=ModalBackdrop,BackdropProps:$,className:a,closeAfterTransition:et=!1,children:nt,container:at,component:rt,components:dt={},componentsProps:ut={},disableAutoFocus:bt=!1,disableEnforceFocus:mt=!1,disableEscapeKeyDown:pt=!1,disablePortal:Zt=!1,disableRestoreFocus:ht=!1,disableScrollLock:Gt=!1,hideBackdrop:Xt=!1,keepMounted:Vt=!1,onBackdropClick:Yt,open:St,slotProps:Lt,slots:Ct}=ct,Tt=_objectWithoutPropertiesLoose(ct,_excluded$l),ft=_extends$1({},ct,{closeAfterTransition:et,disableAutoFocus:bt,disableEnforceFocus:mt,disableEscapeKeyDown:pt,disablePortal:Zt,disableRestoreFocus:ht,disableScrollLock:Gt,hideBackdrop:Xt,keepMounted:Vt}),{getRootProps:Ft,getBackdropProps:Jt,getTransitionProps:Ht,portalRef:wt,isTopModal:Et,exited:At,hasTransition:Il}=useModal(_extends$1({},ft,{rootRef:s})),Qt=_extends$1({},ft,{exited:At}),jt=useUtilityClasses$i(Qt),Xl={};if(nt.props.tabIndex===void 0&&(Xl.tabIndex="-1"),Il){const{onEnter:yl,onExited:Wl}=Ht();Xl.onEnter=yl,Xl.onExited=Wl}const Yl=(j=(_e=Ct==null?void 0:Ct.root)!=null?_e:dt.Root)!=null?j:ModalRoot,Rl=(lt=(tt=Ct==null?void 0:Ct.backdrop)!=null?tt:dt.Backdrop)!=null?lt:it,Tl=(ot=Lt==null?void 0:Lt.root)!=null?ot:ut.root,zl=(st=Lt==null?void 0:Lt.backdrop)!=null?st:ut.backdrop,Ll=useSlotProps({elementType:Yl,externalSlotProps:Tl,externalForwardedProps:Tt,getSlotProps:Ft,additionalProps:{ref:s,as:rt},ownerState:Qt,className:clsx(a,Tl==null?void 0:Tl.className,jt==null?void 0:jt.root,!Qt.open&&Qt.exited&&(jt==null?void 0:jt.hidden))}),Cl=useSlotProps({elementType:Rl,externalSlotProps:zl,additionalProps:$,getSlotProps:yl=>Jt(_extends$1({},yl,{onClick:Wl=>{Yt&&Yt(Wl),yl!=null&&yl.onClick&&yl.onClick(Wl)}})),className:clsx(zl==null?void 0:zl.className,$==null?void 0:$.className,jt==null?void 0:jt.backdrop),ownerState:Qt});return!Vt&&!St&&(!Il||At)?null:jsxRuntimeExports.jsx(Portal,{ref:wt,container:at,disablePortal:Zt,children:jsxRuntimeExports.jsxs(Yl,_extends$1({},Ll,{children:[!Xt&&it?jsxRuntimeExports.jsx(Rl,_extends$1({},Cl)):null,jsxRuntimeExports.jsx(FocusTrap,{disableEnforceFocus:mt,disableAutoFocus:bt,disableRestoreFocus:ht,isEnabled:Et,open:St,children:reactExports.cloneElement(nt,Xl)})]}))})}),Modal$1=Modal,_excluded$k=["disableUnderline","components","componentsProps","fullWidth","hiddenLabel","inputComponent","multiline","slotProps","slots","type"],useUtilityClasses$h=i=>{const{classes:o,disableUnderline:s}=i,_e=composeClasses({root:["root",!s&&"underline"],input:["input"]},getFilledInputUtilityClass,o);return _extends$1({},o,_e)},FilledInputRoot=styled(InputBaseRoot,{shouldForwardProp:i=>rootShouldForwardProp$1(i)||i==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(i,o)=>{const{ownerState:s}=i;return[...rootOverridesResolver(i,o),!s.disableUnderline&&o.underline]}})(({theme:i,ownerState:o})=>{var s;const j=i.palette.mode==="light",_e=j?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",lt=j?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",tt=j?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",ot=j?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return _extends$1({position:"relative",backgroundColor:i.vars?i.vars.palette.FilledInput.bg:lt,borderTopLeftRadius:(i.vars||i).shape.borderRadius,borderTopRightRadius:(i.vars||i).shape.borderRadius,transition:i.transitions.create("background-color",{duration:i.transitions.duration.shorter,easing:i.transitions.easing.easeOut}),"&:hover":{backgroundColor:i.vars?i.vars.palette.FilledInput.hoverBg:tt,"@media (hover: none)":{backgroundColor:i.vars?i.vars.palette.FilledInput.bg:lt}},[`&.${filledInputClasses$1.focused}`]:{backgroundColor:i.vars?i.vars.palette.FilledInput.bg:lt},[`&.${filledInputClasses$1.disabled}`]:{backgroundColor:i.vars?i.vars.palette.FilledInput.disabledBg:ot}},!o.disableUnderline&&{"&::after":{borderBottom:`2px solid ${(s=(i.vars||i).palette[o.color||"primary"])==null?void 0:s.main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:i.transitions.create("transform",{duration:i.transitions.duration.shorter,easing:i.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${filledInputClasses$1.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${filledInputClasses$1.error}`]:{"&::before, &::after":{borderBottomColor:(i.vars||i).palette.error.main}},"&::before":{borderBottom:`1px solid ${i.vars?`rgba(${i.vars.palette.common.onBackgroundChannel} / ${i.vars.opacity.inputUnderline})`:_e}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:i.transitions.create("border-bottom-color",{duration:i.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${filledInputClasses$1.disabled}, .${filledInputClasses$1.error}):before`]:{borderBottom:`1px solid ${(i.vars||i).palette.text.primary}`},[`&.${filledInputClasses$1.disabled}:before`]:{borderBottomStyle:"dotted"}},o.startAdornment&&{paddingLeft:12},o.endAdornment&&{paddingRight:12},o.multiline&&_extends$1({padding:"25px 12px 8px"},o.size==="small"&&{paddingTop:21,paddingBottom:4},o.hiddenLabel&&{paddingTop:16,paddingBottom:17},o.hiddenLabel&&o.size==="small"&&{paddingTop:8,paddingBottom:9}))}),FilledInputInput=styled(InputBaseComponent,{name:"MuiFilledInput",slot:"Input",overridesResolver:inputOverridesResolver})(({theme:i,ownerState:o})=>_extends$1({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12},!i.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:i.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:i.palette.mode==="light"?null:"#fff",caretColor:i.palette.mode==="light"?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},i.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[i.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},o.size==="small"&&{paddingTop:21,paddingBottom:4},o.hiddenLabel&&{paddingTop:16,paddingBottom:17},o.startAdornment&&{paddingLeft:0},o.endAdornment&&{paddingRight:0},o.hiddenLabel&&o.size==="small"&&{paddingTop:8,paddingBottom:9},o.multiline&&{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0})),FilledInput=reactExports.forwardRef(function(o,s){var j,_e,lt,tt;const ot=useThemeProps$1({props:o,name:"MuiFilledInput"}),{components:st={},componentsProps:ct,fullWidth:it=!1,inputComponent:$="input",multiline:a=!1,slotProps:et,slots:nt={},type:at="text"}=ot,rt=_objectWithoutPropertiesLoose(ot,_excluded$k),dt=_extends$1({},ot,{fullWidth:it,inputComponent:$,multiline:a,type:at}),ut=useUtilityClasses$h(ot),bt={root:{ownerState:dt},input:{ownerState:dt}},mt=et??ct?deepmerge$1(bt,et??ct):bt,pt=(j=(_e=nt.root)!=null?_e:st.Root)!=null?j:FilledInputRoot,Zt=(lt=(tt=nt.input)!=null?tt:st.Input)!=null?lt:FilledInputInput;return jsxRuntimeExports.jsx(InputBase$1,_extends$1({slots:{root:pt,input:Zt},componentsProps:mt,fullWidth:it,inputComponent:$,multiline:a,ref:s,type:at},rt,{classes:ut}))});FilledInput.muiName="Input";const FilledInput$1=FilledInput;function getFormControlUtilityClasses(i){return generateUtilityClass$1("MuiFormControl",i)}generateUtilityClasses$1("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const _excluded$j=["children","className","color","component","disabled","error","focused","fullWidth","hiddenLabel","margin","required","size","variant"],useUtilityClasses$g=i=>{const{classes:o,margin:s,fullWidth:j}=i,_e={root:["root",s!=="none"&&`margin${capitalize$1(s)}`,j&&"fullWidth"]};return composeClasses(_e,getFormControlUtilityClasses,o)},FormControlRoot=styled("div",{name:"MuiFormControl",slot:"Root",overridesResolver:({ownerState:i},o)=>_extends$1({},o.root,o[`margin${capitalize$1(i.margin)}`],i.fullWidth&&o.fullWidth)})(({ownerState:i})=>_extends$1({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top"},i.margin==="normal"&&{marginTop:16,marginBottom:8},i.margin==="dense"&&{marginTop:8,marginBottom:4},i.fullWidth&&{width:"100%"})),FormControl=reactExports.forwardRef(function(o,s){const j=useThemeProps$1({props:o,name:"MuiFormControl"}),{children:_e,className:lt,color:tt="primary",component:ot="div",disabled:st=!1,error:ct=!1,focused:it,fullWidth:$=!1,hiddenLabel:a=!1,margin:et="none",required:nt=!1,size:at="medium",variant:rt="outlined"}=j,dt=_objectWithoutPropertiesLoose(j,_excluded$j),ut=_extends$1({},j,{color:tt,component:ot,disabled:st,error:ct,fullWidth:$,hiddenLabel:a,margin:et,required:nt,size:at,variant:rt}),bt=useUtilityClasses$g(ut),[mt,pt]=reactExports.useState(()=>{let Lt=!1;return _e&&reactExports.Children.forEach(_e,Ct=>{if(!isMuiElement(Ct,["Input","Select"]))return;const Tt=isMuiElement(Ct,["Select"])?Ct.props.input:Ct;Tt&&isAdornedStart(Tt.props)&&(Lt=!0)}),Lt}),[Zt,ht]=reactExports.useState(()=>{let Lt=!1;return _e&&reactExports.Children.forEach(_e,Ct=>{isMuiElement(Ct,["Input","Select"])&&(isFilled(Ct.props,!0)||isFilled(Ct.props.inputProps,!0))&&(Lt=!0)}),Lt}),[Gt,Xt]=reactExports.useState(!1);st&&Gt&&Xt(!1);const Vt=it!==void 0&&!st?it:Gt;let Yt;const St=reactExports.useMemo(()=>({adornedStart:mt,setAdornedStart:pt,color:tt,disabled:st,error:ct,filled:Zt,focused:Vt,fullWidth:$,hiddenLabel:a,size:at,onBlur:()=>{Xt(!1)},onEmpty:()=>{ht(!1)},onFilled:()=>{ht(!0)},onFocus:()=>{Xt(!0)},registerEffect:Yt,required:nt,variant:rt}),[mt,tt,st,ct,Zt,Vt,$,a,Yt,nt,at,rt]);return jsxRuntimeExports.jsx(FormControlContext$1.Provider,{value:St,children:jsxRuntimeExports.jsx(FormControlRoot,_extends$1({as:ot,ownerState:ut,className:clsx(bt.root,lt),ref:s},dt,{children:_e}))})}),FormControl$1=FormControl;function getFormHelperTextUtilityClasses(i){return generateUtilityClass$1("MuiFormHelperText",i)}const formHelperTextClasses=generateUtilityClasses$1("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]),formHelperTextClasses$1=formHelperTextClasses;var _span$2;const _excluded$i=["children","className","component","disabled","error","filled","focused","margin","required","variant"],useUtilityClasses$f=i=>{const{classes:o,contained:s,size:j,disabled:_e,error:lt,filled:tt,focused:ot,required:st}=i,ct={root:["root",_e&&"disabled",lt&&"error",j&&`size${capitalize$1(j)}`,s&&"contained",ot&&"focused",tt&&"filled",st&&"required"]};return composeClasses(ct,getFormHelperTextUtilityClasses,o)},FormHelperTextRoot=styled("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(i,o)=>{const{ownerState:s}=i;return[o.root,s.size&&o[`size${capitalize$1(s.size)}`],s.contained&&o.contained,s.filled&&o.filled]}})(({theme:i,ownerState:o})=>_extends$1({color:(i.vars||i).palette.text.secondary},i.typography.caption,{textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${formHelperTextClasses$1.disabled}`]:{color:(i.vars||i).palette.text.disabled},[`&.${formHelperTextClasses$1.error}`]:{color:(i.vars||i).palette.error.main}},o.size==="small"&&{marginTop:4},o.contained&&{marginLeft:14,marginRight:14})),FormHelperText=reactExports.forwardRef(function(o,s){const j=useThemeProps$1({props:o,name:"MuiFormHelperText"}),{children:_e,className:lt,component:tt="p"}=j,ot=_objectWithoutPropertiesLoose(j,_excluded$i),st=useFormControl(),ct=formControlState({props:j,muiFormControl:st,states:["variant","size","disabled","error","filled","focused","required"]}),it=_extends$1({},j,{component:tt,contained:ct.variant==="filled"||ct.variant==="outlined",variant:ct.variant,size:ct.size,disabled:ct.disabled,error:ct.error,filled:ct.filled,focused:ct.focused,required:ct.required}),$=useUtilityClasses$f(it);return jsxRuntimeExports.jsx(FormHelperTextRoot,_extends$1({as:tt,ownerState:it,className:clsx($.root,lt),ref:s},ot,{children:_e===" "?_span$2||(_span$2=jsxRuntimeExports.jsx("span",{className:"notranslate",children:"​"})):_e}))}),FormHelperText$1=FormHelperText;function getFormLabelUtilityClasses(i){return generateUtilityClass$1("MuiFormLabel",i)}const formLabelClasses=generateUtilityClasses$1("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),formLabelClasses$1=formLabelClasses,_excluded$h=["children","className","color","component","disabled","error","filled","focused","required"],useUtilityClasses$e=i=>{const{classes:o,color:s,focused:j,disabled:_e,error:lt,filled:tt,required:ot}=i,st={root:["root",`color${capitalize$1(s)}`,_e&&"disabled",lt&&"error",tt&&"filled",j&&"focused",ot&&"required"],asterisk:["asterisk",lt&&"error"]};return composeClasses(st,getFormLabelUtilityClasses,o)},FormLabelRoot=styled("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:({ownerState:i},o)=>_extends$1({},o.root,i.color==="secondary"&&o.colorSecondary,i.filled&&o.filled)})(({theme:i,ownerState:o})=>_extends$1({color:(i.vars||i).palette.text.secondary},i.typography.body1,{lineHeight:"1.4375em",padding:0,position:"relative",[`&.${formLabelClasses$1.focused}`]:{color:(i.vars||i).palette[o.color].main},[`&.${formLabelClasses$1.disabled}`]:{color:(i.vars||i).palette.text.disabled},[`&.${formLabelClasses$1.error}`]:{color:(i.vars||i).palette.error.main}})),AsteriskComponent=styled("span",{name:"MuiFormLabel",slot:"Asterisk",overridesResolver:(i,o)=>o.asterisk})(({theme:i})=>({[`&.${formLabelClasses$1.error}`]:{color:(i.vars||i).palette.error.main}})),FormLabel=reactExports.forwardRef(function(o,s){const j=useThemeProps$1({props:o,name:"MuiFormLabel"}),{children:_e,className:lt,component:tt="label"}=j,ot=_objectWithoutPropertiesLoose(j,_excluded$h),st=useFormControl(),ct=formControlState({props:j,muiFormControl:st,states:["color","required","focused","disabled","error","filled"]}),it=_extends$1({},j,{color:ct.color||"primary",component:tt,disabled:ct.disabled,error:ct.error,filled:ct.filled,focused:ct.focused,required:ct.required}),$=useUtilityClasses$e(it);return jsxRuntimeExports.jsxs(FormLabelRoot,_extends$1({as:tt,ownerState:it,className:clsx($.root,lt),ref:s},ot,{children:[_e,ct.required&&jsxRuntimeExports.jsxs(AsteriskComponent,{ownerState:it,"aria-hidden":!0,className:$.asterisk,children:[" ","*"]})]}))}),FormLabel$1=FormLabel,_excluded$g=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function getScale(i){return`scale(${i}, ${i**2})`}const styles={entering:{opacity:1,transform:getScale(1)},entered:{opacity:1,transform:"none"}},isWebKit154=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),Grow=reactExports.forwardRef(function(o,s){const{addEndListener:j,appear:_e=!0,children:lt,easing:tt,in:ot,onEnter:st,onEntered:ct,onEntering:it,onExit:$,onExited:a,onExiting:et,style:nt,timeout:at="auto",TransitionComponent:rt=Transition$1}=o,dt=_objectWithoutPropertiesLoose(o,_excluded$g),ut=useTimeout(),bt=reactExports.useRef(),mt=useTheme$1(),pt=reactExports.useRef(null),Zt=useForkRef(pt,lt.ref,s),ht=Tt=>ft=>{if(Tt){const Ft=pt.current;ft===void 0?Tt(Ft):Tt(Ft,ft)}},Gt=ht(it),Xt=ht((Tt,ft)=>{reflow(Tt);const{duration:Ft,delay:Jt,easing:Ht}=getTransitionProps({style:nt,timeout:at,easing:tt},{mode:"enter"});let wt;at==="auto"?(wt=mt.transitions.getAutoHeightDuration(Tt.clientHeight),bt.current=wt):wt=Ft,Tt.style.transition=[mt.transitions.create("opacity",{duration:wt,delay:Jt}),mt.transitions.create("transform",{duration:isWebKit154?wt:wt*.666,delay:Jt,easing:Ht})].join(","),st&&st(Tt,ft)}),Vt=ht(ct),Yt=ht(et),St=ht(Tt=>{const{duration:ft,delay:Ft,easing:Jt}=getTransitionProps({style:nt,timeout:at,easing:tt},{mode:"exit"});let Ht;at==="auto"?(Ht=mt.transitions.getAutoHeightDuration(Tt.clientHeight),bt.current=Ht):Ht=ft,Tt.style.transition=[mt.transitions.create("opacity",{duration:Ht,delay:Ft}),mt.transitions.create("transform",{duration:isWebKit154?Ht:Ht*.666,delay:isWebKit154?Ft:Ft||Ht*.333,easing:Jt})].join(","),Tt.style.opacity=0,Tt.style.transform=getScale(.75),$&&$(Tt)}),Lt=ht(a),Ct=Tt=>{at==="auto"&&ut.start(bt.current||0,Tt),j&&j(pt.current,Tt)};return jsxRuntimeExports.jsx(rt,_extends$1({appear:_e,in:ot,nodeRef:pt,onEnter:Xt,onEntered:Vt,onEntering:Gt,onExit:St,onExited:Lt,onExiting:Yt,addEndListener:Ct,timeout:at==="auto"?null:at},dt,{children:(Tt,ft)=>reactExports.cloneElement(lt,_extends$1({style:_extends$1({opacity:0,transform:getScale(.75),visibility:Tt==="exited"&&!ot?"hidden":void 0},styles[Tt],nt,lt.props.style),ref:Zt},ft))}))});Grow.muiSupportAuto=!0;const Grow$1=Grow,_excluded$f=["disableUnderline","components","componentsProps","fullWidth","inputComponent","multiline","slotProps","slots","type"],useUtilityClasses$d=i=>{const{classes:o,disableUnderline:s}=i,_e=composeClasses({root:["root",!s&&"underline"],input:["input"]},getInputUtilityClass,o);return _extends$1({},o,_e)},InputRoot=styled(InputBaseRoot,{shouldForwardProp:i=>rootShouldForwardProp$1(i)||i==="classes",name:"MuiInput",slot:"Root",overridesResolver:(i,o)=>{const{ownerState:s}=i;return[...rootOverridesResolver(i,o),!s.disableUnderline&&o.underline]}})(({theme:i,ownerState:o})=>{let j=i.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return i.vars&&(j=`rgba(${i.vars.palette.common.onBackgroundChannel} / ${i.vars.opacity.inputUnderline})`),_extends$1({position:"relative"},o.formControl&&{"label + &":{marginTop:16}},!o.disableUnderline&&{"&::after":{borderBottom:`2px solid ${(i.vars||i).palette[o.color].main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:i.transitions.create("transform",{duration:i.transitions.duration.shorter,easing:i.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${inputClasses.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${inputClasses.error}`]:{"&::before, &::after":{borderBottomColor:(i.vars||i).palette.error.main}},"&::before":{borderBottom:`1px solid ${j}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:i.transitions.create("border-bottom-color",{duration:i.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${inputClasses.disabled}, .${inputClasses.error}):before`]:{borderBottom:`2px solid ${(i.vars||i).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${j}`}},[`&.${inputClasses.disabled}:before`]:{borderBottomStyle:"dotted"}})}),InputInput=styled(InputBaseComponent,{name:"MuiInput",slot:"Input",overridesResolver:inputOverridesResolver})({}),Input=reactExports.forwardRef(function(o,s){var j,_e,lt,tt;const ot=useThemeProps$1({props:o,name:"MuiInput"}),{disableUnderline:st,components:ct={},componentsProps:it,fullWidth:$=!1,inputComponent:a="input",multiline:et=!1,slotProps:nt,slots:at={},type:rt="text"}=ot,dt=_objectWithoutPropertiesLoose(ot,_excluded$f),ut=useUtilityClasses$d(ot),mt={root:{ownerState:{disableUnderline:st}}},pt=nt??it?deepmerge$1(nt??it,mt):mt,Zt=(j=(_e=at.root)!=null?_e:ct.Root)!=null?j:InputRoot,ht=(lt=(tt=at.input)!=null?tt:ct.Input)!=null?lt:InputInput;return jsxRuntimeExports.jsx(InputBase$1,_extends$1({slots:{root:Zt,input:ht},slotProps:pt,fullWidth:$,inputComponent:a,multiline:et,ref:s,type:rt},dt,{classes:ut}))});Input.muiName="Input";const Input$1=Input;function getInputLabelUtilityClasses(i){return generateUtilityClass$1("MuiInputLabel",i)}generateUtilityClasses$1("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const _excluded$e=["disableAnimation","margin","shrink","variant","className"],useUtilityClasses$c=i=>{const{classes:o,formControl:s,size:j,shrink:_e,disableAnimation:lt,variant:tt,required:ot}=i,st={root:["root",s&&"formControl",!lt&&"animated",_e&&"shrink",j&&j!=="normal"&&`size${capitalize$1(j)}`,tt],asterisk:[ot&&"asterisk"]},ct=composeClasses(st,getInputLabelUtilityClasses,o);return _extends$1({},o,ct)},InputLabelRoot=styled(FormLabel$1,{shouldForwardProp:i=>rootShouldForwardProp$1(i)||i==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(i,o)=>{const{ownerState:s}=i;return[{[`& .${formLabelClasses$1.asterisk}`]:o.asterisk},o.root,s.formControl&&o.formControl,s.size==="small"&&o.sizeSmall,s.shrink&&o.shrink,!s.disableAnimation&&o.animated,s.focused&&o.focused,o[s.variant]]}})(({theme:i,ownerState:o})=>_extends$1({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},o.formControl&&{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"},o.size==="small"&&{transform:"translate(0, 17px) scale(1)"},o.shrink&&{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"},!o.disableAnimation&&{transition:i.transitions.create(["color","transform","max-width"],{duration:i.transitions.duration.shorter,easing:i.transitions.easing.easeOut})},o.variant==="filled"&&_extends$1({zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},o.size==="small"&&{transform:"translate(12px, 13px) scale(1)"},o.shrink&&_extends$1({userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"},o.size==="small"&&{transform:"translate(12px, 4px) scale(0.75)"})),o.variant==="outlined"&&_extends$1({zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},o.size==="small"&&{transform:"translate(14px, 9px) scale(1)"},o.shrink&&{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}))),InputLabel=reactExports.forwardRef(function(o,s){const j=useThemeProps$1({name:"MuiInputLabel",props:o}),{disableAnimation:_e=!1,shrink:lt,className:tt}=j,ot=_objectWithoutPropertiesLoose(j,_excluded$e),st=useFormControl();let ct=lt;typeof ct>"u"&&st&&(ct=st.filled||st.focused||st.adornedStart);const it=formControlState({props:j,muiFormControl:st,states:["size","variant","required","focused"]}),$=_extends$1({},j,{disableAnimation:_e,formControl:st,shrink:ct,size:it.size,variant:it.variant,required:it.required,focused:it.focused}),a=useUtilityClasses$c($);return jsxRuntimeExports.jsx(InputLabelRoot,_extends$1({"data-shrink":ct,ownerState:$,ref:s,className:clsx(a.root,tt)},ot,{classes:a}))}),InputLabel$1=InputLabel;function getLinkUtilityClass(i){return generateUtilityClass$1("MuiLink",i)}const linkClasses=generateUtilityClasses$1("MuiLink",["root","underlineNone","underlineHover","underlineAlways","button","focusVisible"]),linkClasses$1=linkClasses,colorTransformations={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},transformDeprecatedColors=i=>colorTransformations[i]||i,getTextDecoration=({theme:i,ownerState:o})=>{const s=transformDeprecatedColors(o.color),j=getPath(i,`palette.${s}`,!1)||o.color,_e=getPath(i,`palette.${s}Channel`);return"vars"in i&&_e?`rgba(${_e} / 0.4)`:alpha_1(j,.4)},_excluded$d=["className","color","component","onBlur","onFocus","TypographyClasses","underline","variant","sx"],useUtilityClasses$b=i=>{const{classes:o,component:s,focusVisible:j,underline:_e}=i,lt={root:["root",`underline${capitalize$1(_e)}`,s==="button"&&"button",j&&"focusVisible"]};return composeClasses(lt,getLinkUtilityClass,o)},LinkRoot=styled(Typography$1,{name:"MuiLink",slot:"Root",overridesResolver:(i,o)=>{const{ownerState:s}=i;return[o.root,o[`underline${capitalize$1(s.underline)}`],s.component==="button"&&o.button]}})(({theme:i,ownerState:o})=>_extends$1({},o.underline==="none"&&{textDecoration:"none"},o.underline==="hover"&&{textDecoration:"none","&:hover":{textDecoration:"underline"}},o.underline==="always"&&_extends$1({textDecoration:"underline"},o.color!=="inherit"&&{textDecorationColor:getTextDecoration({theme:i,ownerState:o})},{"&:hover":{textDecorationColor:"inherit"}}),o.component==="button"&&{position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none","&::-moz-focus-inner":{borderStyle:"none"},[`&.${linkClasses$1.focusVisible}`]:{outline:"auto"}})),Link=reactExports.forwardRef(function(o,s){const j=useThemeProps$1({props:o,name:"MuiLink"}),{className:_e,color:lt="primary",component:tt="a",onBlur:ot,onFocus:st,TypographyClasses:ct,underline:it="always",variant:$="inherit",sx:a}=j,et=_objectWithoutPropertiesLoose(j,_excluded$d),{isFocusVisibleRef:nt,onBlur:at,onFocus:rt,ref:dt}=useIsFocusVisible(),[ut,bt]=reactExports.useState(!1),mt=useForkRef(s,dt),pt=Xt=>{at(Xt),nt.current===!1&&bt(!1),ot&&ot(Xt)},Zt=Xt=>{rt(Xt),nt.current===!0&&bt(!0),st&&st(Xt)},ht=_extends$1({},j,{color:lt,component:tt,focusVisible:ut,underline:it,variant:$}),Gt=useUtilityClasses$b(ht);return jsxRuntimeExports.jsx(LinkRoot,_extends$1({color:lt,className:clsx(Gt.root,_e),classes:ct,component:tt,onBlur:pt,onFocus:Zt,ref:mt,ownerState:ht,variant:$,sx:[...Object.keys(colorTransformations).includes(lt)?[]:[{color:lt}],...Array.isArray(a)?a:[a]]},et))}),Link$1=Link,ListContext=reactExports.createContext({}),ListContext$1=ListContext;function getListUtilityClass(i){return generateUtilityClass$1("MuiList",i)}generateUtilityClasses$1("MuiList",["root","padding","dense","subheader"]);const _excluded$c=["children","className","component","dense","disablePadding","subheader"],useUtilityClasses$a=i=>{const{classes:o,disablePadding:s,dense:j,subheader:_e}=i;return composeClasses({root:["root",!s&&"padding",j&&"dense",_e&&"subheader"]},getListUtilityClass,o)},ListRoot=styled("ul",{name:"MuiList",slot:"Root",overridesResolver:(i,o)=>{const{ownerState:s}=i;return[o.root,!s.disablePadding&&o.padding,s.dense&&o.dense,s.subheader&&o.subheader]}})(({ownerState:i})=>_extends$1({listStyle:"none",margin:0,padding:0,position:"relative"},!i.disablePadding&&{paddingTop:8,paddingBottom:8},i.subheader&&{paddingTop:0})),List=reactExports.forwardRef(function(o,s){const j=useThemeProps$1({props:o,name:"MuiList"}),{children:_e,className:lt,component:tt="ul",dense:ot=!1,disablePadding:st=!1,subheader:ct}=j,it=_objectWithoutPropertiesLoose(j,_excluded$c),$=reactExports.useMemo(()=>({dense:ot}),[ot]),a=_extends$1({},j,{component:tt,dense:ot,disablePadding:st}),et=useUtilityClasses$a(a);return jsxRuntimeExports.jsx(ListContext$1.Provider,{value:$,children:jsxRuntimeExports.jsxs(ListRoot,_extends$1({as:tt,className:clsx(et.root,lt),ref:s,ownerState:a},it,{children:[ct,_e]}))})}),List$1=List;function getListItemUtilityClass(i){return generateUtilityClass$1("MuiListItem",i)}const listItemClasses=generateUtilityClasses$1("MuiListItem",["root","container","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","padding","button","secondaryAction","selected"]),listItemClasses$1=listItemClasses,listItemButtonClasses=generateUtilityClasses$1("MuiListItemButton",["root","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","selected"]),listItemButtonClasses$1=listItemButtonClasses;function getListItemSecondaryActionClassesUtilityClass(i){return generateUtilityClass$1("MuiListItemSecondaryAction",i)}generateUtilityClasses$1("MuiListItemSecondaryAction",["root","disableGutters"]);const _excluded$b=["className"],useUtilityClasses$9=i=>{const{disableGutters:o,classes:s}=i;return composeClasses({root:["root",o&&"disableGutters"]},getListItemSecondaryActionClassesUtilityClass,s)},ListItemSecondaryActionRoot=styled("div",{name:"MuiListItemSecondaryAction",slot:"Root",overridesResolver:(i,o)=>{const{ownerState:s}=i;return[o.root,s.disableGutters&&o.disableGutters]}})(({ownerState:i})=>_extends$1({position:"absolute",right:16,top:"50%",transform:"translateY(-50%)"},i.disableGutters&&{right:0})),ListItemSecondaryAction=reactExports.forwardRef(function(o,s){const j=useThemeProps$1({props:o,name:"MuiListItemSecondaryAction"}),{className:_e}=j,lt=_objectWithoutPropertiesLoose(j,_excluded$b),tt=reactExports.useContext(ListContext$1),ot=_extends$1({},j,{disableGutters:tt.disableGutters}),st=useUtilityClasses$9(ot);return jsxRuntimeExports.jsx(ListItemSecondaryActionRoot,_extends$1({className:clsx(st.root,_e),ownerState:ot,ref:s},lt))});ListItemSecondaryAction.muiName="ListItemSecondaryAction";const ListItemSecondaryAction$1=ListItemSecondaryAction,_excluded$a=["className"],_excluded2$3=["alignItems","autoFocus","button","children","className","component","components","componentsProps","ContainerComponent","ContainerProps","dense","disabled","disableGutters","disablePadding","divider","focusVisibleClassName","secondaryAction","selected","slotProps","slots"],overridesResolver=(i,o)=>{const{ownerState:s}=i;return[o.root,s.dense&&o.dense,s.alignItems==="flex-start"&&o.alignItemsFlexStart,s.divider&&o.divider,!s.disableGutters&&o.gutters,!s.disablePadding&&o.padding,s.button&&o.button,s.hasSecondaryAction&&o.secondaryAction]},useUtilityClasses$8=i=>{const{alignItems:o,button:s,classes:j,dense:_e,disabled:lt,disableGutters:tt,disablePadding:ot,divider:st,hasSecondaryAction:ct,selected:it}=i;return composeClasses({root:["root",_e&&"dense",!tt&&"gutters",!ot&&"padding",st&&"divider",lt&&"disabled",s&&"button",o==="flex-start"&&"alignItemsFlexStart",ct&&"secondaryAction",it&&"selected"],container:["container"]},getListItemUtilityClass,j)},ListItemRoot=styled("div",{name:"MuiListItem",slot:"Root",overridesResolver})(({theme:i,ownerState:o})=>_extends$1({display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",width:"100%",boxSizing:"border-box",textAlign:"left"},!o.disablePadding&&_extends$1({paddingTop:8,paddingBottom:8},o.dense&&{paddingTop:4,paddingBottom:4},!o.disableGutters&&{paddingLeft:16,paddingRight:16},!!o.secondaryAction&&{paddingRight:48}),!!o.secondaryAction&&{[`& > .${listItemButtonClasses$1.root}`]:{paddingRight:48}},{[`&.${listItemClasses$1.focusVisible}`]:{backgroundColor:(i.vars||i).palette.action.focus},[`&.${listItemClasses$1.selected}`]:{backgroundColor:i.vars?`rgba(${i.vars.palette.primary.mainChannel} / ${i.vars.palette.action.selectedOpacity})`:alpha_1(i.palette.primary.main,i.palette.action.selectedOpacity),[`&.${listItemClasses$1.focusVisible}`]:{backgroundColor:i.vars?`rgba(${i.vars.palette.primary.mainChannel} / calc(${i.vars.palette.action.selectedOpacity} + ${i.vars.palette.action.focusOpacity}))`:alpha_1(i.palette.primary.main,i.palette.action.selectedOpacity+i.palette.action.focusOpacity)}},[`&.${listItemClasses$1.disabled}`]:{opacity:(i.vars||i).palette.action.disabledOpacity}},o.alignItems==="flex-start"&&{alignItems:"flex-start"},o.divider&&{borderBottom:`1px solid ${(i.vars||i).palette.divider}`,backgroundClip:"padding-box"},o.button&&{transition:i.transitions.create("background-color",{duration:i.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(i.vars||i).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${listItemClasses$1.selected}:hover`]:{backgroundColor:i.vars?`rgba(${i.vars.palette.primary.mainChannel} / calc(${i.vars.palette.action.selectedOpacity} + ${i.vars.palette.action.hoverOpacity}))`:alpha_1(i.palette.primary.main,i.palette.action.selectedOpacity+i.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:i.vars?`rgba(${i.vars.palette.primary.mainChannel} / ${i.vars.palette.action.selectedOpacity})`:alpha_1(i.palette.primary.main,i.palette.action.selectedOpacity)}}},o.hasSecondaryAction&&{paddingRight:48})),ListItemContainer=styled("li",{name:"MuiListItem",slot:"Container",overridesResolver:(i,o)=>o.container})({position:"relative"}),ListItem=reactExports.forwardRef(function(o,s){const j=useThemeProps$1({props:o,name:"MuiListItem"}),{alignItems:_e="center",autoFocus:lt=!1,button:tt=!1,children:ot,className:st,component:ct,components:it={},componentsProps:$={},ContainerComponent:a="li",ContainerProps:{className:et}={},dense:nt=!1,disabled:at=!1,disableGutters:rt=!1,disablePadding:dt=!1,divider:ut=!1,focusVisibleClassName:bt,secondaryAction:mt,selected:pt=!1,slotProps:Zt={},slots:ht={}}=j,Gt=_objectWithoutPropertiesLoose(j.ContainerProps,_excluded$a),Xt=_objectWithoutPropertiesLoose(j,_excluded2$3),Vt=reactExports.useContext(ListContext$1),Yt=reactExports.useMemo(()=>({dense:nt||Vt.dense||!1,alignItems:_e,disableGutters:rt}),[_e,Vt.dense,nt,rt]),St=reactExports.useRef(null);useEnhancedEffect(()=>{lt&&St.current&&St.current.focus()},[lt]);const Lt=reactExports.Children.toArray(ot),Ct=Lt.length&&isMuiElement(Lt[Lt.length-1],["ListItemSecondaryAction"]),Tt=_extends$1({},j,{alignItems:_e,autoFocus:lt,button:tt,dense:Yt.dense,disabled:at,disableGutters:rt,disablePadding:dt,divider:ut,hasSecondaryAction:Ct,selected:pt}),ft=useUtilityClasses$8(Tt),Ft=useForkRef(St,s),Jt=ht.root||it.Root||ListItemRoot,Ht=Zt.root||$.root||{},wt=_extends$1({className:clsx(ft.root,Ht.className,st),disabled:at},Xt);let Et=ct||"li";return tt&&(wt.component=ct||"div",wt.focusVisibleClassName=clsx(listItemClasses$1.focusVisible,bt),Et=ButtonBase$1),Ct?(Et=!wt.component&&!ct?"div":Et,a==="li"&&(Et==="li"?Et="div":wt.component==="li"&&(wt.component="div")),jsxRuntimeExports.jsx(ListContext$1.Provider,{value:Yt,children:jsxRuntimeExports.jsxs(ListItemContainer,_extends$1({as:a,className:clsx(ft.container,et),ref:Ft,ownerState:Tt},Gt,{children:[jsxRuntimeExports.jsx(Jt,_extends$1({},Ht,!isHostComponent(Jt)&&{as:Et,ownerState:_extends$1({},Tt,Ht.ownerState)},wt,{children:Lt})),Lt.pop()]}))})):jsxRuntimeExports.jsx(ListContext$1.Provider,{value:Yt,children:jsxRuntimeExports.jsxs(Jt,_extends$1({},Ht,{as:Et,ref:Ft},!isHostComponent(Jt)&&{ownerState:_extends$1({},Tt,Ht.ownerState)},wt,{children:[Lt,mt&&jsxRuntimeExports.jsx(ListItemSecondaryAction$1,{children:mt})]}))})}),ListItem$1=ListItem;function getListItemTextUtilityClass(i){return generateUtilityClass$1("MuiListItemText",i)}const listItemTextClasses=generateUtilityClasses$1("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]),listItemTextClasses$1=listItemTextClasses,_excluded$9=["children","className","disableTypography","inset","primary","primaryTypographyProps","secondary","secondaryTypographyProps"],useUtilityClasses$7=i=>{const{classes:o,inset:s,primary:j,secondary:_e,dense:lt}=i;return composeClasses({root:["root",s&&"inset",lt&&"dense",j&&_e&&"multiline"],primary:["primary"],secondary:["secondary"]},getListItemTextUtilityClass,o)},ListItemTextRoot=styled("div",{name:"MuiListItemText",slot:"Root",overridesResolver:(i,o)=>{const{ownerState:s}=i;return[{[`& .${listItemTextClasses$1.primary}`]:o.primary},{[`& .${listItemTextClasses$1.secondary}`]:o.secondary},o.root,s.inset&&o.inset,s.primary&&s.secondary&&o.multiline,s.dense&&o.dense]}})(({ownerState:i})=>_extends$1({flex:"1 1 auto",minWidth:0,marginTop:4,marginBottom:4},i.primary&&i.secondary&&{marginTop:6,marginBottom:6},i.inset&&{paddingLeft:56})),ListItemText=reactExports.forwardRef(function(o,s){const j=useThemeProps$1({props:o,name:"MuiListItemText"}),{children:_e,className:lt,disableTypography:tt=!1,inset:ot=!1,primary:st,primaryTypographyProps:ct,secondary:it,secondaryTypographyProps:$}=j,a=_objectWithoutPropertiesLoose(j,_excluded$9),{dense:et}=reactExports.useContext(ListContext$1);let nt=st??_e,at=it;const rt=_extends$1({},j,{disableTypography:tt,inset:ot,primary:!!nt,secondary:!!at,dense:et}),dt=useUtilityClasses$7(rt);return nt!=null&&nt.type!==Typography$1&&!tt&&(nt=jsxRuntimeExports.jsx(Typography$1,_extends$1({variant:et?"body2":"body1",className:dt.primary,component:ct!=null&&ct.variant?void 0:"span",display:"block"},ct,{children:nt}))),at!=null&&at.type!==Typography$1&&!tt&&(at=jsxRuntimeExports.jsx(Typography$1,_extends$1({variant:"body2",className:dt.secondary,color:"text.secondary",display:"block"},$,{children:at}))),jsxRuntimeExports.jsxs(ListItemTextRoot,_extends$1({className:clsx(dt.root,lt),ownerState:rt,ref:s},a,{children:[nt,at]}))}),ListItemText$1=ListItemText,_excluded$8=["actions","autoFocus","autoFocusItem","children","className","disabledItemsFocusable","disableListWrap","onKeyDown","variant"];function nextItem(i,o,s){return i===o?i.firstChild:o&&o.nextElementSibling?o.nextElementSibling:s?null:i.firstChild}function previousItem(i,o,s){return i===o?s?i.firstChild:i.lastChild:o&&o.previousElementSibling?o.previousElementSibling:s?null:i.lastChild}function textCriteriaMatches(i,o){if(o===void 0)return!0;let s=i.innerText;return s===void 0&&(s=i.textContent),s=s.trim().toLowerCase(),s.length===0?!1:o.repeating?s[0]===o.keys[0]:s.indexOf(o.keys.join(""))===0}function moveFocus(i,o,s,j,_e,lt){let tt=!1,ot=_e(i,o,o?s:!1);for(;ot;){if(ot===i.firstChild){if(tt)return!1;tt=!0}const st=j?!1:ot.disabled||ot.getAttribute("aria-disabled")==="true";if(!ot.hasAttribute("tabindex")||!textCriteriaMatches(ot,lt)||st)ot=_e(i,ot,s);else return ot.focus(),!0}return!1}const MenuList=reactExports.forwardRef(function(o,s){const{actions:j,autoFocus:_e=!1,autoFocusItem:lt=!1,children:tt,className:ot,disabledItemsFocusable:st=!1,disableListWrap:ct=!1,onKeyDown:it,variant:$="selectedMenu"}=o,a=_objectWithoutPropertiesLoose(o,_excluded$8),et=reactExports.useRef(null),nt=reactExports.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});useEnhancedEffect(()=>{_e&&et.current.focus()},[_e]),reactExports.useImperativeHandle(j,()=>({adjustStyleForScrollbar:(bt,{direction:mt})=>{const pt=!et.current.style.width;if(bt.clientHeight{const mt=et.current,pt=bt.key,Zt=ownerDocument(mt).activeElement;if(pt==="ArrowDown")bt.preventDefault(),moveFocus(mt,Zt,ct,st,nextItem);else if(pt==="ArrowUp")bt.preventDefault(),moveFocus(mt,Zt,ct,st,previousItem);else if(pt==="Home")bt.preventDefault(),moveFocus(mt,null,ct,st,nextItem);else if(pt==="End")bt.preventDefault(),moveFocus(mt,null,ct,st,previousItem);else if(pt.length===1){const ht=nt.current,Gt=pt.toLowerCase(),Xt=performance.now();ht.keys.length>0&&(Xt-ht.lastTime>500?(ht.keys=[],ht.repeating=!0,ht.previousKeyMatched=!0):ht.repeating&&Gt!==ht.keys[0]&&(ht.repeating=!1)),ht.lastTime=Xt,ht.keys.push(Gt);const Vt=Zt&&!ht.repeating&&textCriteriaMatches(Zt,ht);ht.previousKeyMatched&&(Vt||moveFocus(mt,Zt,!1,st,nextItem,ht))?bt.preventDefault():ht.previousKeyMatched=!1}it&&it(bt)},rt=useForkRef(et,s);let dt=-1;reactExports.Children.forEach(tt,(bt,mt)=>{if(!reactExports.isValidElement(bt)){dt===mt&&(dt+=1,dt>=tt.length&&(dt=-1));return}bt.props.disabled||($==="selectedMenu"&&bt.props.selected||dt===-1)&&(dt=mt),dt===mt&&(bt.props.disabled||bt.props.muiSkipListHighlight||bt.type.muiSkipListHighlight)&&(dt+=1,dt>=tt.length&&(dt=-1))});const ut=reactExports.Children.map(tt,(bt,mt)=>{if(mt===dt){const pt={};return lt&&(pt.autoFocus=!0),bt.props.tabIndex===void 0&&$==="selectedMenu"&&(pt.tabIndex=0),reactExports.cloneElement(bt,pt)}return bt});return jsxRuntimeExports.jsx(List$1,_extends$1({role:"menu",ref:rt,className:ot,onKeyDown:at,tabIndex:_e?0:-1},a,{children:ut}))}),MenuList$1=MenuList;function getPopoverUtilityClass(i){return generateUtilityClass$1("MuiPopover",i)}generateUtilityClasses$1("MuiPopover",["root","paper"]);const _excluded$7=["onEntering"],_excluded2$2=["action","anchorEl","anchorOrigin","anchorPosition","anchorReference","children","className","container","elevation","marginThreshold","open","PaperProps","slots","slotProps","transformOrigin","TransitionComponent","transitionDuration","TransitionProps","disableScrollLock"],_excluded3=["slotProps"];function getOffsetTop(i,o){let s=0;return typeof o=="number"?s=o:o==="center"?s=i.height/2:o==="bottom"&&(s=i.height),s}function getOffsetLeft(i,o){let s=0;return typeof o=="number"?s=o:o==="center"?s=i.width/2:o==="right"&&(s=i.width),s}function getTransformOriginValue(i){return[i.horizontal,i.vertical].map(o=>typeof o=="number"?`${o}px`:o).join(" ")}function resolveAnchorEl(i){return typeof i=="function"?i():i}const useUtilityClasses$6=i=>{const{classes:o}=i;return composeClasses({root:["root"],paper:["paper"]},getPopoverUtilityClass,o)},PopoverRoot=styled(Modal$1,{name:"MuiPopover",slot:"Root",overridesResolver:(i,o)=>o.root})({}),PopoverPaper=styled(Paper$1,{name:"MuiPopover",slot:"Paper",overridesResolver:(i,o)=>o.paper})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),Popover=reactExports.forwardRef(function(o,s){var j,_e,lt;const tt=useThemeProps$1({props:o,name:"MuiPopover"}),{action:ot,anchorEl:st,anchorOrigin:ct={vertical:"top",horizontal:"left"},anchorPosition:it,anchorReference:$="anchorEl",children:a,className:et,container:nt,elevation:at=8,marginThreshold:rt=16,open:dt,PaperProps:ut={},slots:bt,slotProps:mt,transformOrigin:pt={vertical:"top",horizontal:"left"},TransitionComponent:Zt=Grow$1,transitionDuration:ht="auto",TransitionProps:{onEntering:Gt}={},disableScrollLock:Xt=!1}=tt,Vt=_objectWithoutPropertiesLoose(tt.TransitionProps,_excluded$7),Yt=_objectWithoutPropertiesLoose(tt,_excluded2$2),St=(j=mt==null?void 0:mt.paper)!=null?j:ut,Lt=reactExports.useRef(),Ct=useForkRef(Lt,St.ref),Tt=_extends$1({},tt,{anchorOrigin:ct,anchorReference:$,elevation:at,marginThreshold:rt,externalPaperSlotProps:St,transformOrigin:pt,TransitionComponent:Zt,transitionDuration:ht,TransitionProps:Vt}),ft=useUtilityClasses$6(Tt),Ft=reactExports.useCallback(()=>{if($==="anchorPosition")return it;const yl=resolveAnchorEl(st),xl=(yl&&yl.nodeType===1?yl:ownerDocument(Lt.current).body).getBoundingClientRect();return{top:xl.top+getOffsetTop(xl,ct.vertical),left:xl.left+getOffsetLeft(xl,ct.horizontal)}},[st,ct.horizontal,ct.vertical,it,$]),Jt=reactExports.useCallback(yl=>({vertical:getOffsetTop(yl,pt.vertical),horizontal:getOffsetLeft(yl,pt.horizontal)}),[pt.horizontal,pt.vertical]),Ht=reactExports.useCallback(yl=>{const Wl={width:yl.offsetWidth,height:yl.offsetHeight},xl=Jt(Wl);if($==="none")return{top:null,left:null,transformOrigin:getTransformOriginValue(xl)};const Gl=Ft();let sn=Gl.top-xl.vertical,Fl=Gl.left-xl.horizontal;const cn=sn+Wl.height,Ol=Fl+Wl.width,Ml=ownerWindow(resolveAnchorEl(st)),Ul=Ml.innerHeight-rt,Ql=Ml.innerWidth-rt;if(rt!==null&&snUl){const El=cn-Ul;sn-=El,xl.vertical+=El}if(rt!==null&&FlQl){const El=Ol-Ql;Fl-=El,xl.horizontal+=El}return{top:`${Math.round(sn)}px`,left:`${Math.round(Fl)}px`,transformOrigin:getTransformOriginValue(xl)}},[st,$,Ft,Jt,rt]),[wt,Et]=reactExports.useState(dt),At=reactExports.useCallback(()=>{const yl=Lt.current;if(!yl)return;const Wl=Ht(yl);Wl.top!==null&&(yl.style.top=Wl.top),Wl.left!==null&&(yl.style.left=Wl.left),yl.style.transformOrigin=Wl.transformOrigin,Et(!0)},[Ht]);reactExports.useEffect(()=>(Xt&&window.addEventListener("scroll",At),()=>window.removeEventListener("scroll",At)),[st,Xt,At]);const Il=(yl,Wl)=>{Gt&&Gt(yl,Wl),At()},Qt=()=>{Et(!1)};reactExports.useEffect(()=>{dt&&At()}),reactExports.useImperativeHandle(ot,()=>dt?{updatePosition:()=>{At()}}:null,[dt,At]),reactExports.useEffect(()=>{if(!dt)return;const yl=debounce$1(()=>{At()}),Wl=ownerWindow(st);return Wl.addEventListener("resize",yl),()=>{yl.clear(),Wl.removeEventListener("resize",yl)}},[st,dt,At]);let jt=ht;ht==="auto"&&!Zt.muiSupportAuto&&(jt=void 0);const Xl=nt||(st?ownerDocument(resolveAnchorEl(st)).body:void 0),Yl=(_e=bt==null?void 0:bt.root)!=null?_e:PopoverRoot,Rl=(lt=bt==null?void 0:bt.paper)!=null?lt:PopoverPaper,Tl=useSlotProps({elementType:Rl,externalSlotProps:_extends$1({},St,{style:wt?St.style:_extends$1({},St.style,{opacity:0})}),additionalProps:{elevation:at,ref:Ct},ownerState:Tt,className:clsx(ft.paper,St==null?void 0:St.className)}),zl=useSlotProps({elementType:Yl,externalSlotProps:(mt==null?void 0:mt.root)||{},externalForwardedProps:Yt,additionalProps:{ref:s,slotProps:{backdrop:{invisible:!0}},container:Xl,open:dt},ownerState:Tt,className:clsx(ft.root,et)}),{slotProps:Ll}=zl,Cl=_objectWithoutPropertiesLoose(zl,_excluded3);return jsxRuntimeExports.jsx(Yl,_extends$1({},Cl,!isHostComponent(Yl)&&{slotProps:Ll,disableScrollLock:Xt},{children:jsxRuntimeExports.jsx(Zt,_extends$1({appear:!0,in:dt,onEntering:Il,onExited:Qt,timeout:jt},Vt,{children:jsxRuntimeExports.jsx(Rl,_extends$1({},Tl,{children:a}))}))}))}),Popover$1=Popover;function getMenuUtilityClass(i){return generateUtilityClass$1("MuiMenu",i)}generateUtilityClasses$1("MuiMenu",["root","paper","list"]);const _excluded$6=["onEntering"],_excluded2$1=["autoFocus","children","className","disableAutoFocusItem","MenuListProps","onClose","open","PaperProps","PopoverClasses","transitionDuration","TransitionProps","variant","slots","slotProps"],RTL_ORIGIN={vertical:"top",horizontal:"right"},LTR_ORIGIN={vertical:"top",horizontal:"left"},useUtilityClasses$5=i=>{const{classes:o}=i;return composeClasses({root:["root"],paper:["paper"],list:["list"]},getMenuUtilityClass,o)},MenuRoot=styled(Popover$1,{shouldForwardProp:i=>rootShouldForwardProp$1(i)||i==="classes",name:"MuiMenu",slot:"Root",overridesResolver:(i,o)=>o.root})({}),MenuPaper=styled(PopoverPaper,{name:"MuiMenu",slot:"Paper",overridesResolver:(i,o)=>o.paper})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),MenuMenuList=styled(MenuList$1,{name:"MuiMenu",slot:"List",overridesResolver:(i,o)=>o.list})({outline:0}),Menu=reactExports.forwardRef(function(o,s){var j,_e;const lt=useThemeProps$1({props:o,name:"MuiMenu"}),{autoFocus:tt=!0,children:ot,className:st,disableAutoFocusItem:ct=!1,MenuListProps:it={},onClose:$,open:a,PaperProps:et={},PopoverClasses:nt,transitionDuration:at="auto",TransitionProps:{onEntering:rt}={},variant:dt="selectedMenu",slots:ut={},slotProps:bt={}}=lt,mt=_objectWithoutPropertiesLoose(lt.TransitionProps,_excluded$6),pt=_objectWithoutPropertiesLoose(lt,_excluded2$1),Zt=useRtl(),ht=_extends$1({},lt,{autoFocus:tt,disableAutoFocusItem:ct,MenuListProps:it,onEntering:rt,PaperProps:et,transitionDuration:at,TransitionProps:mt,variant:dt}),Gt=useUtilityClasses$5(ht),Xt=tt&&!ct&&a,Vt=reactExports.useRef(null),Yt=(Jt,Ht)=>{Vt.current&&Vt.current.adjustStyleForScrollbar(Jt,{direction:Zt?"rtl":"ltr"}),rt&&rt(Jt,Ht)},St=Jt=>{Jt.key==="Tab"&&(Jt.preventDefault(),$&&$(Jt,"tabKeyDown"))};let Lt=-1;reactExports.Children.map(ot,(Jt,Ht)=>{reactExports.isValidElement(Jt)&&(Jt.props.disabled||(dt==="selectedMenu"&&Jt.props.selected||Lt===-1)&&(Lt=Ht))});const Ct=(j=ut.paper)!=null?j:MenuPaper,Tt=(_e=bt.paper)!=null?_e:et,ft=useSlotProps({elementType:ut.root,externalSlotProps:bt.root,ownerState:ht,className:[Gt.root,st]}),Ft=useSlotProps({elementType:Ct,externalSlotProps:Tt,ownerState:ht,className:Gt.paper});return jsxRuntimeExports.jsx(MenuRoot,_extends$1({onClose:$,anchorOrigin:{vertical:"bottom",horizontal:Zt?"right":"left"},transformOrigin:Zt?RTL_ORIGIN:LTR_ORIGIN,slots:{paper:Ct,root:ut.root},slotProps:{root:ft,paper:Ft},open:a,ref:s,transitionDuration:at,TransitionProps:_extends$1({onEntering:Yt},mt),ownerState:ht},pt,{classes:nt,children:jsxRuntimeExports.jsx(MenuMenuList,_extends$1({onKeyDown:St,actions:Vt,autoFocus:tt&&(Lt===-1||ct),autoFocusItem:Xt,variant:dt},it,{className:clsx(Gt.list,it.className),children:ot}))}))}),Menu$1=Menu;function getNativeSelectUtilityClasses(i){return generateUtilityClass$1("MuiNativeSelect",i)}const nativeSelectClasses=generateUtilityClasses$1("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),nativeSelectClasses$1=nativeSelectClasses,_excluded$5=["className","disabled","error","IconComponent","inputRef","variant"],useUtilityClasses$4=i=>{const{classes:o,variant:s,disabled:j,multiple:_e,open:lt,error:tt}=i,ot={select:["select",s,j&&"disabled",_e&&"multiple",tt&&"error"],icon:["icon",`icon${capitalize$1(s)}`,lt&&"iconOpen",j&&"disabled"]};return composeClasses(ot,getNativeSelectUtilityClasses,o)},nativeSelectSelectStyles=({ownerState:i,theme:o})=>_extends$1({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":_extends$1({},o.vars?{backgroundColor:`rgba(${o.vars.palette.common.onBackgroundChannel} / 0.05)`}:{backgroundColor:o.palette.mode==="light"?"rgba(0, 0, 0, 0.05)":"rgba(255, 255, 255, 0.05)"},{borderRadius:0}),"&::-ms-expand":{display:"none"},[`&.${nativeSelectClasses$1.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(o.vars||o).palette.background.paper},"&&&":{paddingRight:24,minWidth:16}},i.variant==="filled"&&{"&&&":{paddingRight:32}},i.variant==="outlined"&&{borderRadius:(o.vars||o).shape.borderRadius,"&:focus":{borderRadius:(o.vars||o).shape.borderRadius},"&&&":{paddingRight:32}}),NativeSelectSelect=styled("select",{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:rootShouldForwardProp$1,overridesResolver:(i,o)=>{const{ownerState:s}=i;return[o.select,o[s.variant],s.error&&o.error,{[`&.${nativeSelectClasses$1.multiple}`]:o.multiple}]}})(nativeSelectSelectStyles),nativeSelectIconStyles=({ownerState:i,theme:o})=>_extends$1({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(o.vars||o).palette.action.active,[`&.${nativeSelectClasses$1.disabled}`]:{color:(o.vars||o).palette.action.disabled}},i.open&&{transform:"rotate(180deg)"},i.variant==="filled"&&{right:7},i.variant==="outlined"&&{right:7}),NativeSelectIcon=styled("svg",{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(i,o)=>{const{ownerState:s}=i;return[o.icon,s.variant&&o[`icon${capitalize$1(s.variant)}`],s.open&&o.iconOpen]}})(nativeSelectIconStyles),NativeSelectInput=reactExports.forwardRef(function(o,s){const{className:j,disabled:_e,error:lt,IconComponent:tt,inputRef:ot,variant:st="standard"}=o,ct=_objectWithoutPropertiesLoose(o,_excluded$5),it=_extends$1({},o,{disabled:_e,variant:st,error:lt}),$=useUtilityClasses$4(it);return jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx(NativeSelectSelect,_extends$1({ownerState:it,className:clsx($.select,j),disabled:_e,ref:ot||s},ct)),o.multiple?null:jsxRuntimeExports.jsx(NativeSelectIcon,{as:tt,ownerState:it,className:$.icon})]})}),NativeSelectInput$1=NativeSelectInput;var _span$1;const _excluded$4=["children","classes","className","label","notched"],NotchedOutlineRoot$1=styled("fieldset",{shouldForwardProp:rootShouldForwardProp$1})({textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%"}),NotchedOutlineLegend=styled("legend",{shouldForwardProp:rootShouldForwardProp$1})(({ownerState:i,theme:o})=>_extends$1({float:"unset",width:"auto",overflow:"hidden"},!i.withLabel&&{padding:0,lineHeight:"11px",transition:o.transitions.create("width",{duration:150,easing:o.transitions.easing.easeOut})},i.withLabel&&_extends$1({display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:o.transitions.create("max-width",{duration:50,easing:o.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}},i.notched&&{maxWidth:"100%",transition:o.transitions.create("max-width",{duration:100,easing:o.transitions.easing.easeOut,delay:50})})));function NotchedOutline(i){const{className:o,label:s,notched:j}=i,_e=_objectWithoutPropertiesLoose(i,_excluded$4),lt=s!=null&&s!=="",tt=_extends$1({},i,{notched:j,withLabel:lt});return jsxRuntimeExports.jsx(NotchedOutlineRoot$1,_extends$1({"aria-hidden":!0,className:o,ownerState:tt},_e,{children:jsxRuntimeExports.jsx(NotchedOutlineLegend,{ownerState:tt,children:lt?jsxRuntimeExports.jsx("span",{children:s}):_span$1||(_span$1=jsxRuntimeExports.jsx("span",{className:"notranslate",children:"​"}))})}))}const _excluded$3=["components","fullWidth","inputComponent","label","multiline","notched","slots","type"],useUtilityClasses$3=i=>{const{classes:o}=i,j=composeClasses({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},getOutlinedInputUtilityClass,o);return _extends$1({},o,j)},OutlinedInputRoot=styled(InputBaseRoot,{shouldForwardProp:i=>rootShouldForwardProp$1(i)||i==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:rootOverridesResolver})(({theme:i,ownerState:o})=>{const s=i.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return _extends$1({position:"relative",borderRadius:(i.vars||i).shape.borderRadius,[`&:hover .${outlinedInputClasses$1.notchedOutline}`]:{borderColor:(i.vars||i).palette.text.primary},"@media (hover: none)":{[`&:hover .${outlinedInputClasses$1.notchedOutline}`]:{borderColor:i.vars?`rgba(${i.vars.palette.common.onBackgroundChannel} / 0.23)`:s}},[`&.${outlinedInputClasses$1.focused} .${outlinedInputClasses$1.notchedOutline}`]:{borderColor:(i.vars||i).palette[o.color].main,borderWidth:2},[`&.${outlinedInputClasses$1.error} .${outlinedInputClasses$1.notchedOutline}`]:{borderColor:(i.vars||i).palette.error.main},[`&.${outlinedInputClasses$1.disabled} .${outlinedInputClasses$1.notchedOutline}`]:{borderColor:(i.vars||i).palette.action.disabled}},o.startAdornment&&{paddingLeft:14},o.endAdornment&&{paddingRight:14},o.multiline&&_extends$1({padding:"16.5px 14px"},o.size==="small"&&{padding:"8.5px 14px"}))}),NotchedOutlineRoot=styled(NotchedOutline,{name:"MuiOutlinedInput",slot:"NotchedOutline",overridesResolver:(i,o)=>o.notchedOutline})(({theme:i})=>{const o=i.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:i.vars?`rgba(${i.vars.palette.common.onBackgroundChannel} / 0.23)`:o}}),OutlinedInputInput=styled(InputBaseComponent,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:inputOverridesResolver})(({theme:i,ownerState:o})=>_extends$1({padding:"16.5px 14px"},!i.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:i.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:i.palette.mode==="light"?null:"#fff",caretColor:i.palette.mode==="light"?null:"#fff",borderRadius:"inherit"}},i.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[i.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},o.size==="small"&&{padding:"8.5px 14px"},o.multiline&&{padding:0},o.startAdornment&&{paddingLeft:0},o.endAdornment&&{paddingRight:0})),OutlinedInput=reactExports.forwardRef(function(o,s){var j,_e,lt,tt,ot;const st=useThemeProps$1({props:o,name:"MuiOutlinedInput"}),{components:ct={},fullWidth:it=!1,inputComponent:$="input",label:a,multiline:et=!1,notched:nt,slots:at={},type:rt="text"}=st,dt=_objectWithoutPropertiesLoose(st,_excluded$3),ut=useUtilityClasses$3(st),bt=useFormControl(),mt=formControlState({props:st,muiFormControl:bt,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),pt=_extends$1({},st,{color:mt.color||"primary",disabled:mt.disabled,error:mt.error,focused:mt.focused,formControl:bt,fullWidth:it,hiddenLabel:mt.hiddenLabel,multiline:et,size:mt.size,type:rt}),Zt=(j=(_e=at.root)!=null?_e:ct.Root)!=null?j:OutlinedInputRoot,ht=(lt=(tt=at.input)!=null?tt:ct.Input)!=null?lt:OutlinedInputInput;return jsxRuntimeExports.jsx(InputBase$1,_extends$1({slots:{root:Zt,input:ht},renderSuffix:Gt=>jsxRuntimeExports.jsx(NotchedOutlineRoot,{ownerState:pt,className:ut.notchedOutline,label:a!=null&&a!==""&&mt.required?ot||(ot=jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[a," ","*"]})):a,notched:typeof nt<"u"?nt:!!(Gt.startAdornment||Gt.filled||Gt.focused)}),fullWidth:it,inputComponent:$,multiline:et,ref:s,type:rt},dt,{classes:_extends$1({},ut,{notchedOutline:null})}))});OutlinedInput.muiName="Input";const OutlinedInput$1=OutlinedInput;function getSelectUtilityClasses(i){return generateUtilityClass$1("MuiSelect",i)}const selectClasses=generateUtilityClasses$1("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var _span;const _excluded$2=["aria-describedby","aria-label","autoFocus","autoWidth","children","className","defaultOpen","defaultValue","disabled","displayEmpty","error","IconComponent","inputRef","labelId","MenuProps","multiple","name","onBlur","onChange","onClose","onFocus","onOpen","open","readOnly","renderValue","SelectDisplayProps","tabIndex","type","value","variant"],SelectSelect=styled("div",{name:"MuiSelect",slot:"Select",overridesResolver:(i,o)=>{const{ownerState:s}=i;return[{[`&.${selectClasses.select}`]:o.select},{[`&.${selectClasses.select}`]:o[s.variant]},{[`&.${selectClasses.error}`]:o.error},{[`&.${selectClasses.multiple}`]:o.multiple}]}})(nativeSelectSelectStyles,{[`&.${selectClasses.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),SelectIcon=styled("svg",{name:"MuiSelect",slot:"Icon",overridesResolver:(i,o)=>{const{ownerState:s}=i;return[o.icon,s.variant&&o[`icon${capitalize$1(s.variant)}`],s.open&&o.iconOpen]}})(nativeSelectIconStyles),SelectNativeInput=styled("input",{shouldForwardProp:i=>slotShouldForwardProp(i)&&i!=="classes",name:"MuiSelect",slot:"NativeInput",overridesResolver:(i,o)=>o.nativeInput})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function areEqualValues(i,o){return typeof o=="object"&&o!==null?i===o:String(i)===String(o)}function isEmpty$1(i){return i==null||typeof i=="string"&&!i.trim()}const useUtilityClasses$2=i=>{const{classes:o,variant:s,disabled:j,multiple:_e,open:lt,error:tt}=i,ot={select:["select",s,j&&"disabled",_e&&"multiple",tt&&"error"],icon:["icon",`icon${capitalize$1(s)}`,lt&&"iconOpen",j&&"disabled"],nativeInput:["nativeInput"]};return composeClasses(ot,getSelectUtilityClasses,o)},SelectInput=reactExports.forwardRef(function(o,s){var j;const{"aria-describedby":_e,"aria-label":lt,autoFocus:tt,autoWidth:ot,children:st,className:ct,defaultOpen:it,defaultValue:$,disabled:a,displayEmpty:et,error:nt=!1,IconComponent:at,inputRef:rt,labelId:dt,MenuProps:ut={},multiple:bt,name:mt,onBlur:pt,onChange:Zt,onClose:ht,onFocus:Gt,onOpen:Xt,open:Vt,readOnly:Yt,renderValue:St,SelectDisplayProps:Lt={},tabIndex:Ct,value:Tt,variant:ft="standard"}=o,Ft=_objectWithoutPropertiesLoose(o,_excluded$2),[Jt,Ht]=useControlled({controlled:Tt,default:$,name:"Select"}),[wt,Et]=useControlled({controlled:Vt,default:it,name:"Select"}),At=reactExports.useRef(null),Il=reactExports.useRef(null),[Qt,jt]=reactExports.useState(null),{current:Xl}=reactExports.useRef(Vt!=null),[Yl,Rl]=reactExports.useState(),Tl=useForkRef(s,rt),zl=reactExports.useCallback(Vl=>{Il.current=Vl,Vl&&jt(Vl)},[]),Ll=Qt==null?void 0:Qt.parentNode;reactExports.useImperativeHandle(Tl,()=>({focus:()=>{Il.current.focus()},node:At.current,value:Jt}),[Jt]),reactExports.useEffect(()=>{it&&wt&&Qt&&!Xl&&(Rl(ot?null:Ll.clientWidth),Il.current.focus())},[Qt,ot]),reactExports.useEffect(()=>{tt&&Il.current.focus()},[tt]),reactExports.useEffect(()=>{if(!dt)return;const Vl=ownerDocument(Il.current).getElementById(dt);if(Vl){const $t=()=>{getSelection().isCollapsed&&Il.current.focus()};return Vl.addEventListener("click",$t),()=>{Vl.removeEventListener("click",$t)}}},[dt]);const Cl=(Vl,$t)=>{Vl?Xt&&Xt($t):ht&&ht($t),Xl||(Rl(ot?null:Ll.clientWidth),Et(Vl))},yl=Vl=>{Vl.button===0&&(Vl.preventDefault(),Il.current.focus(),Cl(!0,Vl))},Wl=Vl=>{Cl(!1,Vl)},xl=reactExports.Children.toArray(st),Gl=Vl=>{const $t=xl.find($l=>$l.props.value===Vl.target.value);$t!==void 0&&(Ht($t.props.value),Zt&&Zt(Vl,$t))},sn=Vl=>$t=>{let $l;if($t.currentTarget.hasAttribute("tabindex")){if(bt){$l=Array.isArray(Jt)?Jt.slice():[];const Vn=Jt.indexOf(Vl.props.value);Vn===-1?$l.push(Vl.props.value):$l.splice(Vn,1)}else $l=Vl.props.value;if(Vl.props.onClick&&Vl.props.onClick($t),Jt!==$l&&(Ht($l),Zt)){const Vn=$t.nativeEvent||$t,xn=new Vn.constructor(Vn.type,Vn);Object.defineProperty(xn,"target",{writable:!0,value:{value:$l,name:mt}}),Zt(xn,Vl)}bt||Cl(!1,$t)}},Fl=Vl=>{Yt||[" ","ArrowUp","ArrowDown","Enter"].indexOf(Vl.key)!==-1&&(Vl.preventDefault(),Cl(!0,Vl))},cn=Qt!==null&&wt,Ol=Vl=>{!cn&&pt&&(Object.defineProperty(Vl,"target",{writable:!0,value:{value:Jt,name:mt}}),pt(Vl))};delete Ft["aria-invalid"];let Ml,Ul;const Ql=[];let El=!1;(isFilled({value:Jt})||et)&&(St?Ml=St(Jt):El=!0);const Nl=xl.map(Vl=>{if(!reactExports.isValidElement(Vl))return null;let $t;if(bt){if(!Array.isArray(Jt))throw new Error(formatMuiErrorMessage$1(2));$t=Jt.some($l=>areEqualValues($l,Vl.props.value)),$t&&El&&Ql.push(Vl.props.children)}else $t=areEqualValues(Jt,Vl.props.value),$t&&El&&(Ul=Vl.props.children);return reactExports.cloneElement(Vl,{"aria-selected":$t?"true":"false",onClick:sn(Vl),onKeyUp:$l=>{$l.key===" "&&$l.preventDefault(),Vl.props.onKeyUp&&Vl.props.onKeyUp($l)},role:"option",selected:$t,value:void 0,"data-value":Vl.props.value})});El&&(bt?Ql.length===0?Ml=null:Ml=Ql.reduce((Vl,$t,$l)=>(Vl.push($t),$l{const{classes:o}=i;return o},styledRootConfig={name:"MuiSelect",overridesResolver:(i,o)=>o.root,shouldForwardProp:i=>rootShouldForwardProp$1(i)&&i!=="variant",slot:"Root"},StyledInput=styled(Input$1,styledRootConfig)(""),StyledOutlinedInput=styled(OutlinedInput$1,styledRootConfig)(""),StyledFilledInput=styled(FilledInput$1,styledRootConfig)(""),Select=reactExports.forwardRef(function(o,s){const j=useThemeProps$1({name:"MuiSelect",props:o}),{autoWidth:_e=!1,children:lt,classes:tt={},className:ot,defaultOpen:st=!1,displayEmpty:ct=!1,IconComponent:it=ArrowDropDownIcon,id:$,input:a,inputProps:et,label:nt,labelId:at,MenuProps:rt,multiple:dt=!1,native:ut=!1,onClose:bt,onOpen:mt,open:pt,renderValue:Zt,SelectDisplayProps:ht,variant:Gt="outlined"}=j,Xt=_objectWithoutPropertiesLoose(j,_excluded$1),Vt=ut?NativeSelectInput$1:SelectInput$1,Yt=useFormControl(),St=formControlState({props:j,muiFormControl:Yt,states:["variant","error"]}),Lt=St.variant||Gt,Ct=_extends$1({},j,{variant:Lt,classes:tt}),Tt=useUtilityClasses$1(Ct),ft=_objectWithoutPropertiesLoose(Tt,_excluded2),Ft=a||{standard:jsxRuntimeExports.jsx(StyledInput,{ownerState:Ct}),outlined:jsxRuntimeExports.jsx(StyledOutlinedInput,{label:nt,ownerState:Ct}),filled:jsxRuntimeExports.jsx(StyledFilledInput,{ownerState:Ct})}[Lt],Jt=useForkRef(s,Ft.ref);return jsxRuntimeExports.jsx(reactExports.Fragment,{children:reactExports.cloneElement(Ft,_extends$1({inputComponent:Vt,inputProps:_extends$1({children:lt,error:St.error,IconComponent:it,variant:Lt,type:void 0,multiple:dt},ut?{id:$}:{autoWidth:_e,defaultOpen:st,displayEmpty:ct,labelId:at,MenuProps:rt,onClose:bt,onOpen:mt,open:pt,renderValue:Zt,SelectDisplayProps:_extends$1({id:$},ht)},et,{classes:et?deepmerge$1(ft,et.classes):ft},a?a.props.inputProps:{})},(dt&&ut||ct)&&Lt==="outlined"?{notched:!0}:{},{ref:Jt,className:clsx(Ft.props.className,ot,Tt.root)},!a&&{variant:Lt},Xt))})});Select.muiName="Select";const Select$1=Select;function getTextFieldUtilityClass(i){return generateUtilityClass$1("MuiTextField",i)}generateUtilityClasses$1("MuiTextField",["root"]);const _excluded=["autoComplete","autoFocus","children","className","color","defaultValue","disabled","error","FormHelperTextProps","fullWidth","helperText","id","InputLabelProps","inputProps","InputProps","inputRef","label","maxRows","minRows","multiline","name","onBlur","onChange","onFocus","placeholder","required","rows","select","SelectProps","type","value","variant"],variantComponent={standard:Input$1,filled:FilledInput$1,outlined:OutlinedInput$1},useUtilityClasses=i=>{const{classes:o}=i;return composeClasses({root:["root"]},getTextFieldUtilityClass,o)},TextFieldRoot=styled(FormControl$1,{name:"MuiTextField",slot:"Root",overridesResolver:(i,o)=>o.root})({}),TextField=reactExports.forwardRef(function(o,s){const j=useThemeProps$1({props:o,name:"MuiTextField"}),{autoComplete:_e,autoFocus:lt=!1,children:tt,className:ot,color:st="primary",defaultValue:ct,disabled:it=!1,error:$=!1,FormHelperTextProps:a,fullWidth:et=!1,helperText:nt,id:at,InputLabelProps:rt,inputProps:dt,InputProps:ut,inputRef:bt,label:mt,maxRows:pt,minRows:Zt,multiline:ht=!1,name:Gt,onBlur:Xt,onChange:Vt,onFocus:Yt,placeholder:St,required:Lt=!1,rows:Ct,select:Tt=!1,SelectProps:ft,type:Ft,value:Jt,variant:Ht="outlined"}=j,wt=_objectWithoutPropertiesLoose(j,_excluded),Et=_extends$1({},j,{autoFocus:lt,color:st,disabled:it,error:$,fullWidth:et,multiline:ht,required:Lt,select:Tt,variant:Ht}),At=useUtilityClasses(Et),Il={};Ht==="outlined"&&(rt&&typeof rt.shrink<"u"&&(Il.notched=rt.shrink),Il.label=mt),Tt&&((!ft||!ft.native)&&(Il.id=void 0),Il["aria-describedby"]=void 0);const Qt=useId(at),jt=nt&&Qt?`${Qt}-helper-text`:void 0,Xl=mt&&Qt?`${Qt}-label`:void 0,Yl=variantComponent[Ht],Rl=jsxRuntimeExports.jsx(Yl,_extends$1({"aria-describedby":jt,autoComplete:_e,autoFocus:lt,defaultValue:ct,fullWidth:et,multiline:ht,name:Gt,rows:Ct,maxRows:pt,minRows:Zt,type:Ft,value:Jt,id:Qt,inputRef:bt,onBlur:Xt,onChange:Vt,onFocus:Yt,placeholder:St,inputProps:dt},Il,ut));return jsxRuntimeExports.jsxs(TextFieldRoot,_extends$1({className:clsx(At.root,ot),disabled:it,error:$,fullWidth:et,ref:s,required:Lt,color:st,variant:Ht,ownerState:Et},wt,{children:[mt!=null&&mt!==""&&jsxRuntimeExports.jsx(InputLabel$1,_extends$1({htmlFor:Qt,id:Xl},rt,{children:mt})),Tt?jsxRuntimeExports.jsx(Select$1,_extends$1({"aria-describedby":jt,id:Qt,labelId:Xl,value:Jt,input:Rl},ft,{children:tt})):Rl,nt&&jsxRuntimeExports.jsx(FormHelperText$1,_extends$1({id:jt},a,{children:nt}))]}))}),TextField$1=TextField;function dispatchCallback(i,o){i&&i(o)}function reverseDictionary(i){return Object.fromEntries(Object.entries(i).map(([o,s])=>[s,o]))}const Callable=class{constructor(){let i=function(...o){return i._call(...o)};return Object.setPrototypeOf(i,new.target.prototype)}_call(...i){throw Error("Must implement _call method in subclass")}};function isTypedArray(i){var o,s,j;return((j=(s=(o=i==null?void 0:i.prototype)==null?void 0:o.__proto__)==null?void 0:s.constructor)==null?void 0:j.name)==="TypedArray"}function isIntegralNumber(i){return Number.isInteger(i)||typeof i=="bigint"}function exists(i){return i!=null}function mergeArrays(...i){return Array.prototype.concat.apply([],i)}const sharp={},ONNX_NODE=Object.freeze(Object.defineProperty({__proto__:null,default:sharp},Symbol.toStringTag,{value:"Module"}));var ortWeb_min$1={exports:{}};const backends={},backendsSortedByPriority=[],registerBackend=(i,o,s)=>{if(o&&typeof o.init=="function"&&typeof o.createSessionHandler=="function"){const j=backends[i];if(j===void 0)backends[i]={backend:o,priority:s};else{if(j.priority>s)return;if(j.priority===s&&j.backend!==o)throw new Error(`cannot register backend "${i}" using priority ${s}`)}if(s>=0){const _e=backendsSortedByPriority.indexOf(i);_e!==-1&&backendsSortedByPriority.splice(_e,1);for(let lt=0;lt{const o=i.length===0?backendsSortedByPriority:i,s=[];for(const j of o){const _e=backends[j];if(_e){if(_e.initialized)return _e.backend;if(_e.aborted)continue;const lt=!!_e.initPromise;try{return lt||(_e.initPromise=_e.backend.init()),await _e.initPromise,_e.initialized=!0,_e.backend}catch(tt){lt||s.push({name:j,err:tt}),_e.aborted=!0}finally{delete _e.initPromise}}}throw new Error(`no available backend found. ERR: ${s.map(j=>`[${j.name}] ${j.err}`).join(", ")}`)};class EnvImpl{constructor(){this.wasm={},this.webgl={},this.logLevelInternal="warning"}set logLevel(o){if(o!==void 0){if(typeof o!="string"||["verbose","info","warning","error","fatal"].indexOf(o)===-1)throw new Error(`Unsupported logging level: ${o}`);this.logLevelInternal=o}}get logLevel(){return this.logLevelInternal}}const env$2=new EnvImpl,isBigInt64ArrayAvailable=typeof BigInt64Array<"u"&&typeof BigInt64Array.from=="function",isBigUint64ArrayAvailable=typeof BigUint64Array<"u"&&typeof BigUint64Array.from=="function",NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP=new Map([["float32",Float32Array],["uint8",Uint8Array],["int8",Int8Array],["uint16",Uint16Array],["int16",Int16Array],["int32",Int32Array],["bool",Uint8Array],["float64",Float64Array],["uint32",Uint32Array]]),NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP=new Map([[Float32Array,"float32"],[Uint8Array,"uint8"],[Int8Array,"int8"],[Uint16Array,"uint16"],[Int16Array,"int16"],[Int32Array,"int32"],[Float64Array,"float64"],[Uint32Array,"uint32"]]);isBigInt64ArrayAvailable&&(NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP.set("int64",BigInt64Array),NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP.set(BigInt64Array,"int64"));isBigUint64ArrayAvailable&&(NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP.set("uint64",BigUint64Array),NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP.set(BigUint64Array,"uint64"));const calculateSize=i=>{let o=1;for(let s=0;s{const $=document.createElement("canvas"),a=$.getContext("2d");if(!o||!a)return it();const et=new Image;et.crossOrigin="Anonymous",et.src=o,et.onload=()=>{$.width=et.width,$.height=et.height,a.drawImage(et,0,0,$.width,$.height);const nt=a.getImageData(0,0,$.width,$.height);if(s!==void 0){if(s.height!==void 0&&s.height!==$.height)throw new Error("Image input config height doesn't match ImageBitmap height");if(st.height=$.height,s.width!==void 0&&s.width!==$.width)throw new Error("Image input config width doesn't match ImageBitmap width");st.width=$.width}else st.height=$.height,st.width=$.width;ct(jn.bufferToTensor(nt.data,st))}});throw new Error("Input data provided is not supported - aborted tensor creation")}if(ot!==void 0)return jn.bufferToTensor(ot,st);throw new Error("Input data provided is not supported - aborted tensor creation")}toImageData(o){var s,j;const _e=document.createElement("canvas").getContext("2d");let lt;if(_e!=null){const tt=this.dims[3],ot=this.dims[2],st=this.dims[1],ct=o!==void 0&&o.format!==void 0?o.format:"RGB",it=o!==void 0&&((s=o.norm)===null||s===void 0?void 0:s.mean)!==void 0?o.norm.mean:255,$=o!==void 0&&((j=o.norm)===null||j===void 0?void 0:j.bias)!==void 0?o.norm.bias:0,a=ot*tt;if(o!==void 0){if(o.height!==void 0&&o.height!==ot)throw new Error("Image output config height doesn't match tensor height");if(o.width!==void 0&&o.width!==tt)throw new Error("Image output config width doesn't match tensor width");if(o.format!==void 0&&st===4&&o.format!=="RGBA"||st===3&&o.format!=="RGB"&&o.format!=="BGR")throw new Error("Tensor format doesn't match input tensor dims")}const et=4;let nt=0,at=1,rt=2,dt=3,ut=0,bt=a,mt=a*2,pt=-1;ct==="RGBA"?(ut=0,bt=a,mt=a*2,pt=a*3):ct==="RGB"?(ut=0,bt=a,mt=a*2):ct==="RBG"&&(ut=0,mt=a,bt=a*2),lt=_e.createImageData(tt,ot);for(let Zt=0;Zt"u")throw new Error(`input '${ct}' is missing in 'feeds'.`);if(tt)for(const ct of this.outputNames)_e[ct]=null;const ot=await this.handler.run(o,_e,lt),st={};for(const ct in ot)Object.hasOwnProperty.call(ot,ct)&&(st[ct]=new Tensor$1(ot[ct].type,ot[ct].data,ot[ct].dims));return st}static async create(o,s,j,_e){let lt,tt={};if(typeof o=="string"){if(lt=o,typeof s=="object"&&s!==null)tt=s;else if(typeof s<"u")throw new TypeError("'options' must be an object.")}else if(o instanceof Uint8Array){if(lt=o,typeof s=="object"&&s!==null)tt=s;else if(typeof s<"u")throw new TypeError("'options' must be an object.")}else if(o instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&o instanceof SharedArrayBuffer){const $=o;let a=0,et=o.byteLength;if(typeof s=="object"&&s!==null)tt=s;else if(typeof s=="number"){if(a=s,!Number.isSafeInteger(a))throw new RangeError("'byteOffset' must be an integer.");if(a<0||a>=$.byteLength)throw new RangeError(`'byteOffset' is out of range [0, ${$.byteLength}).`);if(et=o.byteLength-a,typeof j=="number"){if(et=j,!Number.isSafeInteger(et))throw new RangeError("'byteLength' must be an integer.");if(et<=0||a+et>$.byteLength)throw new RangeError(`'byteLength' is out of range (0, ${$.byteLength-a}].`);if(typeof _e=="object"&&_e!==null)tt=_e;else if(typeof _e<"u")throw new TypeError("'options' must be an object.")}else if(typeof j<"u")throw new TypeError("'byteLength' must be a number.")}else if(typeof s<"u")throw new TypeError("'options' must be an object.");lt=new Uint8Array($,a,et)}else throw new TypeError("Unexpected argument[0]: must be 'path' or 'buffer'.");const st=(tt.executionProviders||[]).map($=>typeof $=="string"?$:$.name),it=await(await resolveBackend(st)).createSessionHandler(lt,tt);return new xo(it)}startProfiling(){this.handler.startProfiling()}endProfiling(){this.handler.endProfiling()}get inputNames(){return this.handler.inputNames}get outputNames(){return this.handler.outputNames}};const InferenceSession$1=InferenceSession$2,lib=Object.freeze(Object.defineProperty({__proto__:null,InferenceSession:InferenceSession$1,Tensor:Tensor$1,env:env$2,registerBackend},Symbol.toStringTag,{value:"Module"})),require$$0=getAugmentedNamespace(lib);/*! * ONNX Runtime Web v1.14.0 * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. */(function(module,exports){(function(i,o){module.exports=o(require$$0)})(self,__WEBPACK_EXTERNAL_MODULE__1670__=>(()=>{var __webpack_modules__={3474:(i,o,s)=>{var j,_e=(j=(j=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(lt){function tt(){return Ht.buffer!=Et&&yl(Ht.buffer),At}function ot(){return Ht.buffer!=Et&&yl(Ht.buffer),Il}function st(){return Ht.buffer!=Et&&yl(Ht.buffer),Qt}function ct(){return Ht.buffer!=Et&&yl(Ht.buffer),jt}function it(){return Ht.buffer!=Et&&yl(Ht.buffer),Xl}var $,a,et;lt=lt||{},$||($=lt!==void 0?lt:{}),$.ready=new Promise(function(yt,gt){a=yt,et=gt});var nt,at,rt,dt,ut,bt,mt=Object.assign({},$),pt="./this.program",Zt=(yt,gt)=>{throw gt},ht=typeof window=="object",Gt=typeof importScripts=="function",Xt=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",Vt=$.ENVIRONMENT_IS_PTHREAD||!1,Yt="";function St(yt){return $.locateFile?$.locateFile(yt,Yt):Yt+yt}if(Xt){let yt;Yt=Gt?s(908).dirname(Yt)+"/":"//",bt=()=>{ut||(dt=s(1384),ut=s(908))},nt=function(gt,xt){return bt(),gt=ut.normalize(gt),dt.readFileSync(gt,xt?void 0:"utf8")},rt=gt=>((gt=nt(gt,!0)).buffer||(gt=new Uint8Array(gt)),gt),at=(gt,xt,vt)=>{bt(),gt=ut.normalize(gt),dt.readFile(gt,function(Bt,zt){Bt?vt(Bt):xt(zt.buffer)})},1{if(Ol())throw process.exitCode=gt,xt;xt instanceof Ot||Ft("exiting due to exception: "+xt),process.exit(gt)},$.inspect=function(){return"[Emscripten Module object]"};try{yt=s(9925)}catch(gt){throw console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?'),gt}s.g.Worker=yt.Worker}else(ht||Gt)&&(Gt?Yt=self.location.href:typeof document<"u"&&document.currentScript&&(Yt=document.currentScript.src),j&&(Yt=j),Yt=Yt.indexOf("blob:")!==0?Yt.substr(0,Yt.replace(/[?#].*/,"").lastIndexOf("/")+1):"",Xt||(nt=yt=>{var gt=new XMLHttpRequest;return gt.open("GET",yt,!1),gt.send(null),gt.responseText},Gt&&(rt=yt=>{var gt=new XMLHttpRequest;return gt.open("GET",yt,!1),gt.responseType="arraybuffer",gt.send(null),new Uint8Array(gt.response)}),at=(yt,gt,xt)=>{var vt=new XMLHttpRequest;vt.open("GET",yt,!0),vt.responseType="arraybuffer",vt.onload=()=>{vt.status==200||vt.status==0&&vt.response?gt(vt.response):xt()},vt.onerror=xt,vt.send(null)}));Xt&&typeof performance>"u"&&(s.g.performance=s(6953).performance);var Lt=console.log.bind(console),Ct=console.warn.bind(console);Xt&&(bt(),Lt=yt=>dt.writeSync(1,yt+` `),Ct=yt=>dt.writeSync(2,yt+` `));var Tt,ft=$.print||Lt,Ft=$.printErr||Ct;Object.assign($,mt),mt=null,$.thisProgram&&(pt=$.thisProgram),$.quit&&(Zt=$.quit),$.wasmBinary&&(Tt=$.wasmBinary);var Jt=$.noExitRuntime||!1;typeof WebAssembly!="object"&&Nl("no native wasm support detected");var Ht,wt,Et,At,Il,Qt,jt,Xl,Yl=!1,Rl=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function Tl(yt,gt,xt){var vt=(gt>>>=0)+xt;for(xt=gt;yt[xt]&&!(xt>=vt);)++xt;if(16(Bt=(240&Bt)==224?(15&Bt)<<12|zt<<6|Dt:(7&Bt)<<18|zt<<12|Dt<<6|63&yt[gt++])?vt+=String.fromCharCode(Bt):(Bt-=65536,vt+=String.fromCharCode(55296|Bt>>10,56320|1023&Bt))}}else vt+=String.fromCharCode(Bt)}return vt}function zl(yt,gt){return(yt>>>=0)?Tl(ot(),yt,gt):""}function Ll(yt,gt,xt,vt){if(!(0>>=0;vt=xt+vt-1;for(var zt=0;zt=Dt&&(Dt=65536+((1023&Dt)<<10)|1023&yt.charCodeAt(++zt)),127>=Dt){if(xt>=vt)break;gt[xt++>>>0]=Dt}else{if(2047>=Dt){if(xt+1>=vt)break;gt[xt++>>>0]=192|Dt>>6}else{if(65535>=Dt){if(xt+2>=vt)break;gt[xt++>>>0]=224|Dt>>12}else{if(xt+3>=vt)break;gt[xt++>>>0]=240|Dt>>18,gt[xt++>>>0]=128|Dt>>12&63}gt[xt++>>>0]=128|Dt>>6&63}gt[xt++>>>0]=128|63&Dt}}return gt[xt>>>0]=0,xt-Bt}function Cl(yt){for(var gt=0,xt=0;xt=vt?gt++:2047>=vt?gt+=2:55296<=vt&&57343>=vt?(gt+=4,++xt):gt+=3}return gt}function yl(yt){Et=yt,$.HEAP8=At=new Int8Array(yt),$.HEAP16=new Int16Array(yt),$.HEAP32=Qt=new Int32Array(yt),$.HEAPU8=Il=new Uint8Array(yt),$.HEAPU16=new Uint16Array(yt),$.HEAPU32=jt=new Uint32Array(yt),$.HEAPF32=new Float32Array(yt),$.HEAPF64=Xl=new Float64Array(yt)}Vt&&(Et=$.buffer);var Wl=$.INITIAL_MEMORY||16777216;if(Vt)Ht=$.wasmMemory,Et=$.buffer;else if($.wasmMemory)Ht=$.wasmMemory;else if(!((Ht=new WebAssembly.Memory({initial:Wl/65536,maximum:65536,shared:!0})).buffer instanceof SharedArrayBuffer))throw Ft("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"),Xt&&console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)"),Error("bad memory");Ht&&(Et=Ht.buffer),Wl=Et.byteLength,yl(Et);var xl,Gl=[],sn=[],Fl=[],cn=[];function Ol(){return Jt||!1}function Ml(){var yt=$.preRun.shift();Gl.unshift(yt)}var Ul,Ql=0,El=null;function Nl(yt){throw Vt?postMessage({cmd:"onAbort",arg:yt}):$.onAbort&&$.onAbort(yt),Ft(yt="Aborted("+yt+")"),Yl=!0,yt=new WebAssembly.RuntimeError(yt+". Build with -sASSERTIONS for more info."),et(yt),yt}function Zn(){return Ul.startsWith("data:application/octet-stream;base64,")}function bn(){var yt=Ul;try{if(yt==Ul&&Tt)return new Uint8Array(Tt);if(rt)return rt(yt);throw"both async and sync fetching of the wasm failed"}catch(gt){Nl(gt)}}Ul="ort-wasm-threaded.wasm",Zn()||(Ul=St(Ul));var Bl={};function Ot(yt){this.name="ExitStatus",this.message="Program terminated with exit("+yt+")",this.status=yt}function rn(yt){(yt=$t.Vb[yt])||Nl(),$t.mc(yt)}function yn(yt){var gt=$t.Cc();if(!gt)return 6;$t.ac.push(gt),$t.Vb[yt.Ub]=gt,gt.Ub=yt.Ub;var xt={cmd:"run",start_routine:yt.Ic,arg:yt.zc,pthread_ptr:yt.Ub};return gt.$b=()=>{xt.time=performance.now(),gt.postMessage(xt,yt.Nc)},gt.loaded&&(gt.$b(),delete gt.$b),0}function an(yt){if(Vt)return qt(1,1,yt);Ol()||($t.oc(),$.onExit&&$.onExit(yt),Yl=!0),Zt(yt,new Ot(yt))}function Vl(yt,gt){if(!gt&&Vt)throw xn(yt),"unwind";Ol()||Vt||(ao(),$l(Fl),so(0),$n[1].length&&qn(1,10),$n[2].length&&qn(2,10),$t.oc()),an(yt)}var $t={Yb:[],ac:[],qc:[],Vb:{},fc:function(){Vt&&$t.Ec()},Pc:function(){},Ec:function(){$t.receiveObjectTransfer=$t.Gc,$t.threadInitTLS=$t.pc,$t.setExitStatus=$t.nc,Jt=!1},nc:function(){},oc:function(){for(var yt of Object.values($t.Vb))$t.mc(yt);for(yt of $t.Yb)yt.terminate();$t.Yb=[]},mc:function(yt){var gt=yt.Ub;delete $t.Vb[gt],$t.Yb.push(yt),$t.ac.splice($t.ac.indexOf(yt),1),yt.Ub=0,eo(gt)},Gc:function(){},pc:function(){$t.qc.forEach(yt=>yt())},Fc:function(yt,gt){yt.onmessage=xt=>{var vt=(xt=xt.data).cmd;if(yt.Ub&&($t.Bc=yt.Ub),xt.targetThread&&xt.targetThread!=On()){var Bt=$t.Vb[xt.Qc];Bt?Bt.postMessage(xt,xt.transferList):Ft('Internal error! Worker sent a message "'+vt+'" to target pthread '+xt.targetThread+", but that thread no longer exists!")}else vt==="processProxyingQueue"?Rt(xt.queue):vt==="spawnThread"?yn(xt):vt==="cleanupThread"?rn(xt.thread):vt==="killThread"?(xt=xt.thread,vt=$t.Vb[xt],delete $t.Vb[xt],vt.terminate(),eo(xt),$t.ac.splice($t.ac.indexOf(vt),1),vt.Ub=0):vt==="cancelThread"?$t.Vb[xt.thread].postMessage({cmd:"cancel"}):vt==="loaded"?(yt.loaded=!0,gt&>(yt),yt.$b&&(yt.$b(),delete yt.$b)):vt==="print"?ft("Thread "+xt.threadId+": "+xt.text):vt==="printErr"?Ft("Thread "+xt.threadId+": "+xt.text):vt==="alert"?alert("Thread "+xt.threadId+": "+xt.text):xt.target==="setimmediate"?yt.postMessage(xt):vt==="onAbort"?$.onAbort&&$.onAbort(xt.arg):vt&&Ft("worker sent an unknown command "+vt);$t.Bc=void 0},yt.onerror=xt=>{throw Ft("worker sent an error! "+xt.filename+":"+xt.lineno+": "+xt.message),xt},Xt&&(yt.on("message",function(xt){yt.onmessage({data:xt})}),yt.on("error",function(xt){yt.onerror(xt)}),yt.on("detachedExit",function(){})),yt.postMessage({cmd:"load",urlOrBlob:$.mainScriptUrlOrBlob||j,wasmMemory:Ht,wasmModule:wt})},yc:function(){var yt=St("ort-wasm-threaded.worker.js");$t.Yb.push(new Worker(yt))},Cc:function(){return $t.Yb.length==0&&($t.yc(),$t.Fc($t.Yb[0])),$t.Yb.pop()}};function $l(yt){for(;0>2>>>0];yt=st()[yt+48>>2>>>0],po(gt,gt-yt),Dl(gt)};var Sn=[];function Pl(yt){var gt=Sn[yt];return gt||(yt>=Sn.length&&(Sn.length=yt+1),Sn[yt]=gt=xl.get(yt)),gt}$.invokeEntryPoint=function(yt,gt){yt=Pl(yt)(gt),Ol()?$t.nc(yt):mo(yt)};var gn,Rn,Yn=[],Jl=0,Kl=0;function Hl(yt){this.Zb=yt,this.Sb=yt-24,this.xc=function(gt){ct()[this.Sb+4>>2>>>0]=gt},this.bc=function(){return ct()[this.Sb+4>>2>>>0]},this.wc=function(gt){ct()[this.Sb+8>>2>>>0]=gt},this.Dc=function(){return ct()[this.Sb+8>>2>>>0]},this.rc=function(){st()[this.Sb>>2>>>0]=0},this.hc=function(gt){gt=gt?1:0,tt()[this.Sb+12>>0>>>0]=gt},this.uc=function(){return tt()[this.Sb+12>>0>>>0]!=0},this.ic=function(gt){gt=gt?1:0,tt()[this.Sb+13>>0>>>0]=gt},this.kc=function(){return tt()[this.Sb+13>>0>>>0]!=0},this.fc=function(gt,xt){this.cc(0),this.xc(gt),this.wc(xt),this.rc(),this.hc(!1),this.ic(!1)},this.sc=function(){Atomics.add(st(),this.Sb>>2,1)},this.Hc=function(){return Atomics.sub(st(),this.Sb>>2,1)===1},this.cc=function(gt){ct()[this.Sb+16>>2>>>0]=gt},this.tc=function(){return ct()[this.Sb+16>>2>>>0]},this.vc=function(){if(Zo(this.bc()))return ct()[this.Zb>>2>>>0];var gt=this.tc();return gt!==0?gt:this.Zb}}function Jn(yt){return co(new Hl(yt).Sb)}function vn(yt,gt,xt,vt){return Vt?qt(3,1,yt,gt,xt,vt):Pn(yt,gt,xt,vt)}function Pn(yt,gt,xt,vt){if(typeof SharedArrayBuffer>"u")return Ft("Current environment does not support SharedArrayBuffer, pthreads are not available!"),6;var Bt=[];return Vt&&Bt.length===0?vn(yt,gt,xt,vt):(yt={Ic:xt,Ub:yt,zc:vt,Nc:Bt},Vt?(yt.Oc="spawnThread",postMessage(yt,Bt),0):yn(yt))}function Fn(yt,gt,xt){return Vt?qt(4,1,yt,gt,xt):0}function hn(yt,gt){if(Vt)return qt(5,1,yt,gt)}function mn(yt,gt){if(Vt)return qt(6,1,yt,gt)}function In(yt,gt,xt){if(Vt)return qt(7,1,yt,gt,xt)}function En(yt,gt,xt){return Vt?qt(8,1,yt,gt,xt):0}function Bn(yt,gt){if(Vt)return qt(9,1,yt,gt)}function wn(yt,gt,xt){if(Vt)return qt(10,1,yt,gt,xt)}function zn(yt,gt,xt,vt){if(Vt)return qt(11,1,yt,gt,xt,vt)}function Hn(yt,gt,xt,vt){if(Vt)return qt(12,1,yt,gt,xt,vt)}function Tn(yt,gt,xt,vt){if(Vt)return qt(13,1,yt,gt,xt,vt)}function Ln(yt){if(Vt)return qt(14,1,yt)}function It(yt,gt){if(Vt)return qt(15,1,yt,gt)}function Wt(yt,gt,xt){if(Vt)return qt(16,1,yt,gt,xt)}function Rt(yt){Atomics.store(st(),yt>>2,1),On()&&bo(yt),Atomics.compareExchange(st(),yt>>2,1,0)}function Nt(yt){return ct()[yt>>>2]+4294967296*st()[yt+4>>>2]}function Kt(yt,gt,xt,vt,Bt,zt){return Vt?qt(17,1,yt,gt,xt,vt,Bt,zt):-52}function kt(yt,gt,xt,vt,Bt,zt){if(Vt)return qt(18,1,yt,gt,xt,vt,Bt,zt)}function Pt(yt){var gt=Cl(yt)+1,xt=_i(gt);return xt&&Ll(yt,tt(),xt,gt),xt}function Zl(yt,gt,xt){function vt(ln){return(ln=ln.toTimeString().match(/\(([A-Za-z ]+)\)$/))?ln[1]:"GMT"}if(Vt)return qt(19,1,yt,gt,xt);var Bt=new Date().getFullYear(),zt=new Date(Bt,0,1),Dt=new Date(Bt,6,1);Bt=zt.getTimezoneOffset();var Sl=Dt.getTimezoneOffset(),tn=Math.max(Bt,Sl);st()[yt>>2>>>0]=60*tn,st()[gt>>2>>>0]=+(Bt!=Sl),yt=vt(zt),gt=vt(Dt),yt=Pt(yt),gt=Pt(gt),Sl>2>>>0]=yt,ct()[xt+4>>2>>>0]=gt):(ct()[xt>>2>>>0]=gt,ct()[xt+4>>2>>>0]=yt)}function qt(yt,gt){var xt=arguments.length-2,vt=arguments;return Vn(()=>{for(var Bt=to(8*xt),zt=Bt>>3,Dt=0;Dt>>0]=Sl}return uo(yt,xt,Bt,gt)})}$.executeNotifiedProxyingQueue=Rt,Rn=Xt?()=>{var yt=process.hrtime();return 1e3*yt[0]+yt[1]/1e6}:Vt?()=>performance.now()-$.__performance_now_clock_drift:()=>performance.now();var Al,dn=[],Wn={};function Gn(){if(!Al){var yt,gt={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:pt||"./this.program"};for(yt in Wn)Wn[yt]===void 0?delete gt[yt]:gt[yt]=Wn[yt];var xt=[];for(yt in gt)xt.push(yt+"="+gt[yt]);Al=xt}return Al}function Mt(yt,gt){if(Vt)return qt(20,1,yt,gt);var xt=0;return Gn().forEach(function(vt,Bt){var zt=gt+xt;for(Bt=ct()[yt+4*Bt>>2>>>0]=zt,zt=0;zt>0>>>0]=vt.charCodeAt(zt);tt()[Bt>>0>>>0]=0,xt+=vt.length+1}),0}function nn(yt,gt){if(Vt)return qt(21,1,yt,gt);var xt=Gn();ct()[yt>>2>>>0]=xt.length;var vt=0;return xt.forEach(function(Bt){vt+=Bt.length+1}),ct()[gt>>2>>>0]=vt,0}function un(yt){return Vt?qt(22,1,yt):52}function Nn(yt,gt,xt,vt){return Vt?qt(23,1,yt,gt,xt,vt):52}function Mn(yt,gt,xt,vt,Bt){return Vt?qt(24,1,yt,gt,xt,vt,Bt):70}var $n=[null,[],[]];function qn(yt,gt){var xt=$n[yt];gt===0||gt===10?((yt===1?ft:Ft)(Tl(xt,0)),xt.length=0):xt.push(gt)}function lo(yt,gt,xt,vt){if(Vt)return qt(25,1,yt,gt,xt,vt);for(var Bt=0,zt=0;zt>2>>>0],Sl=ct()[gt+4>>2>>>0];gt+=8;for(var tn=0;tn>>0]);Bt+=Sl}return ct()[vt>>2>>>0]=Bt,0}var Cn=0;function Qn(yt){return yt%4==0&&(yt%100!=0||yt%400==0)}var no=[31,29,31,30,31,30,31,31,30,31,30,31],io=[31,28,31,30,31,30,31,31,30,31,30,31];function oo(yt,gt,xt,vt){function Bt(Ut,on,pn){for(Ut=typeof Ut=="number"?Ut.toString():Ut||"";Ut.lengthAn?-1:0Un-Ut.getDate())){Ut.setDate(Ut.getDate()+on);break}on-=Un-Ut.getDate()+1,Ut.setDate(1),11>pn?Ut.setMonth(pn+1):(Ut.setMonth(0),Ut.setFullYear(Ut.getFullYear()+1))}return pn=new Date(Ut.getFullYear()+1,0,4),on=Sl(new Date(Ut.getFullYear(),0,4)),pn=Sl(pn),0>=Dt(on,Ut)?0>=Dt(pn,Ut)?Ut.getFullYear()+1:Ut.getFullYear():Ut.getFullYear()-1}var ln=st()[vt+40>>2>>>0];for(var Xn in vt={Lc:st()[vt>>2>>>0],Kc:st()[vt+4>>2>>>0],dc:st()[vt+8>>2>>>0],jc:st()[vt+12>>2>>>0],ec:st()[vt+16>>2>>>0],Xb:st()[vt+20>>2>>>0],Tb:st()[vt+24>>2>>>0],Wb:st()[vt+28>>2>>>0],Rc:st()[vt+32>>2>>>0],Jc:st()[vt+36>>2>>>0],Mc:ln?zl(ln):""},xt=zl(xt),ln={"%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"})xt=xt.replace(new RegExp(Xn,"g"),ln[Xn]);var kn="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),Kn="January February March April May June July August September October November December".split(" ");for(Xn in ln={"%a":function(Ut){return kn[Ut.Tb].substring(0,3)},"%A":function(Ut){return kn[Ut.Tb]},"%b":function(Ut){return Kn[Ut.ec].substring(0,3)},"%B":function(Ut){return Kn[Ut.ec]},"%C":function(Ut){return zt((Ut.Xb+1900)/100|0,2)},"%d":function(Ut){return zt(Ut.jc,2)},"%e":function(Ut){return Bt(Ut.jc,2," ")},"%g":function(Ut){return tn(Ut).toString().substring(2)},"%G":function(Ut){return tn(Ut)},"%H":function(Ut){return zt(Ut.dc,2)},"%I":function(Ut){return(Ut=Ut.dc)==0?Ut=12:12Ut.dc?"AM":"PM"},"%S":function(Ut){return zt(Ut.Lc,2)},"%t":function(){return" "},"%u":function(Ut){return Ut.Tb||7},"%U":function(Ut){return zt(Math.floor((Ut.Wb+7-Ut.Tb)/7),2)},"%V":function(Ut){var on=Math.floor((Ut.Wb+7-(Ut.Tb+6)%7)/7);if(2>=(Ut.Tb+371-Ut.Wb-2)%7&&on++,on)on==53&&((pn=(Ut.Tb+371-Ut.Wb)%7)==4||pn==3&&Qn(Ut.Xb)||(on=1));else{on=52;var pn=(Ut.Tb+7-Ut.Wb-1)%7;(pn==4||pn==5&&Qn(Ut.Xb%400-1))&&on++}return zt(on,2)},"%w":function(Ut){return Ut.Tb},"%W":function(Ut){return zt(Math.floor((Ut.Wb+7-(Ut.Tb+6)%7)/7),2)},"%y":function(Ut){return(Ut.Xb+1900).toString().substring(2)},"%Y":function(Ut){return Ut.Xb+1900},"%z":function(Ut){var on=0<=(Ut=Ut.Jc);return Ut=Math.abs(Ut)/60,(on?"+":"-")+("0000"+(Ut/60*100+Ut%60)).slice(-4)},"%Z":function(Ut){return Ut.Mc},"%%":function(){return"%"}},xt=xt.replace(/%%/g,"\0\0"),ln)xt.includes(Xn)&&(xt=xt.replace(new RegExp(Xn,"g"),ln[Xn](vt)));return Xn=function(Ut){var on=Array(Cl(Ut)+1);return Ll(Ut,on,0,on.length),on}(xt=xt.replace(/\0\0/g,"%")),Xn.length>gt?0:(function(Ut,on){tt().set(Ut,on>>>0)}(Xn,yt),Xn.length-1)}$t.fc();var So=[null,an,xn,vn,Fn,hn,mn,In,En,Bn,wn,zn,Hn,Tn,Ln,It,Wt,Kt,kt,Zl,Mt,nn,un,Nn,Mn,lo],Lo={b:function(yt){return _i(yt+24)+24},n:function(yt){return(yt=new Hl(yt)).uc()||(yt.hc(!0),Jl--),yt.ic(!1),Yn.push(yt),yt.sc(),yt.vc()},ma:function(yt){throw Ft("Unexpected exception thrown, this is not properly supported - aborting"),Yl=!0,yt},x:function(){en(0);var yt=Yn.pop();if(yt.Hc()&&!yt.kc()){var gt=yt.Dc();gt&&Pl(gt)(yt.Zb),Jn(yt.Zb)}Kl=0},e:function(){var yt=Kl;if(!yt)return Cn=0;var gt=new Hl(yt);gt.cc(yt);var xt=gt.bc();if(!xt)return Cn=0,yt;for(var vt=Array.prototype.slice.call(arguments),Bt=0;BtRt(vt));else if(Vt)postMessage({targetThread:yt,cmd:"processProxyingQueue",queue:vt});else{if(!(yt=$t.Vb[yt]))return;yt.postMessage({cmd:"processProxyingQueue",queue:vt})}return 1},Ea:function(){return-1},Pa:function(yt,gt){yt=new Date(1e3*Nt(yt)),st()[gt>>2>>>0]=yt.getUTCSeconds(),st()[gt+4>>2>>>0]=yt.getUTCMinutes(),st()[gt+8>>2>>>0]=yt.getUTCHours(),st()[gt+12>>2>>>0]=yt.getUTCDate(),st()[gt+16>>2>>>0]=yt.getUTCMonth(),st()[gt+20>>2>>>0]=yt.getUTCFullYear()-1900,st()[gt+24>>2>>>0]=yt.getUTCDay(),yt=(yt.getTime()-Date.UTC(yt.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,st()[gt+28>>2>>>0]=yt},Qa:function(yt,gt){yt=new Date(1e3*Nt(yt)),st()[gt>>2>>>0]=yt.getSeconds(),st()[gt+4>>2>>>0]=yt.getMinutes(),st()[gt+8>>2>>>0]=yt.getHours(),st()[gt+12>>2>>>0]=yt.getDate(),st()[gt+16>>2>>>0]=yt.getMonth(),st()[gt+20>>2>>>0]=yt.getFullYear()-1900,st()[gt+24>>2>>>0]=yt.getDay();var xt=new Date(yt.getFullYear(),0,1),vt=(yt.getTime()-xt.getTime())/864e5|0;st()[gt+28>>2>>>0]=vt,st()[gt+36>>2>>>0]=-60*yt.getTimezoneOffset(),vt=new Date(yt.getFullYear(),6,1).getTimezoneOffset(),yt=0|(vt!=(xt=xt.getTimezoneOffset())&&yt.getTimezoneOffset()==Math.min(xt,vt)),st()[gt+32>>2>>>0]=yt},Ra:function(yt){var gt=new Date(st()[yt+20>>2>>>0]+1900,st()[yt+16>>2>>>0],st()[yt+12>>2>>>0],st()[yt+8>>2>>>0],st()[yt+4>>2>>>0],st()[yt>>2>>>0],0),xt=st()[yt+32>>2>>>0],vt=gt.getTimezoneOffset(),Bt=new Date(gt.getFullYear(),0,1),zt=new Date(gt.getFullYear(),6,1).getTimezoneOffset(),Dt=Bt.getTimezoneOffset(),Sl=Math.min(Dt,zt);return 0>xt?st()[yt+32>>2>>>0]=+(zt!=Dt&&Sl==vt):0>2>>>0]=gt.getDay(),xt=(gt.getTime()-Bt.getTime())/864e5|0,st()[yt+28>>2>>>0]=xt,st()[yt>>2>>>0]=gt.getSeconds(),st()[yt+4>>2>>>0]=gt.getMinutes(),st()[yt+8>>2>>>0]=gt.getHours(),st()[yt+12>>2>>>0]=gt.getDate(),st()[yt+16>>2>>>0]=gt.getMonth(),gt.getTime()/1e3|0},Aa:Kt,Ba:kt,Sa:function yt(gt,xt,vt){yt.Ac||(yt.Ac=!0,Zl(gt,xt,vt))},y:function(){Nl("")},U:function(){if(!Xt&&!Gt){var yt="Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread";gn||(gn={}),gn[yt]||(gn[yt]=1,Xt&&(yt="warning: "+yt),Ft(yt))}},ra:function(){return 4294901760},B:Rn,Ia:function(yt,gt,xt){ot().copyWithin(yt>>>0,gt>>>0,gt+xt>>>0)},F:function(){return Xt?s(3993).cpus().length:navigator.hardwareConcurrency},Da:function(yt,gt,xt){dn.length=gt,xt>>=3;for(var vt=0;vt>>0];return(0>yt?Bl[-yt-1]:So[yt]).apply(null,dn)},qa:function(yt){var gt=ot().length;if((yt>>>=0)<=gt||4294901760=xt;xt*=2){var vt=gt*(1+.2/xt);vt=Math.min(vt,yt+100663296);var Bt=Math;vt=Math.max(yt,vt),Bt=Bt.min.call(Bt,4294901760,vt+(65536-vt%65536)%65536);e:{try{Ht.grow(Bt-Et.byteLength+65535>>>16),yl(Ht.buffer);var zt=1;break e}catch{}zt=void 0}if(zt)return!0}return!1},Na:function(){throw"unwind"},Ga:Mt,Ha:nn,J:Vl,I:un,S:Nn,ga:Mn,R:lo,d:function(){return Cn},na:function yt(gt,xt){yt.lc||(yt.lc=function(){if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function"){var Bt=new Uint8Array(1);return()=>(crypto.getRandomValues(Bt),Bt[0])}if(Xt)try{var zt=s(Object(function(){var Dt=new Error("Cannot find module 'crypto'");throw Dt.code="MODULE_NOT_FOUND",Dt}()));return()=>zt.randomBytes(1)[0]}catch{}return()=>Nl("randomDevice")}());for(var vt=0;vt>0>>>0]=yt.lc();return 0},ia:function(yt,gt,xt){var vt=_l();try{return Pl(yt)(gt,xt)}catch(Bt){if(Dl(vt),Bt!==Bt+0)throw Bt;en(1,0)}},ja:function(yt,gt,xt){var vt=_l();try{return Pl(yt)(gt,xt)}catch(Bt){if(Dl(vt),Bt!==Bt+0)throw Bt;en(1,0)}},K:function(yt){var gt=_l();try{return Pl(yt)()}catch(xt){if(Dl(gt),xt!==xt+0)throw xt;en(1,0)}},f:function(yt,gt){var xt=_l();try{return Pl(yt)(gt)}catch(vt){if(Dl(xt),vt!==vt+0)throw vt;en(1,0)}},P:function(yt,gt,xt){var vt=_l();try{return Pl(yt)(gt,xt)}catch(Bt){if(Dl(vt),Bt!==Bt+0)throw Bt;en(1,0)}},Q:function(yt,gt,xt){var vt=_l();try{return Pl(yt)(gt,xt)}catch(Bt){if(Dl(vt),Bt!==Bt+0)throw Bt;en(1,0)}},k:function(yt,gt,xt){var vt=_l();try{return Pl(yt)(gt,xt)}catch(Bt){if(Dl(vt),Bt!==Bt+0)throw Bt;en(1,0)}},p:function(yt,gt,xt,vt){var Bt=_l();try{return Pl(yt)(gt,xt,vt)}catch(zt){if(Dl(Bt),zt!==zt+0)throw zt;en(1,0)}},q:function(yt,gt,xt,vt,Bt){var zt=_l();try{return Pl(yt)(gt,xt,vt,Bt)}catch(Dt){if(Dl(zt),Dt!==Dt+0)throw Dt;en(1,0)}},N:function(yt,gt,xt,vt,Bt,zt){var Dt=_l();try{return Pl(yt)(gt,xt,vt,Bt,zt)}catch(Sl){if(Dl(Dt),Sl!==Sl+0)throw Sl;en(1,0)}},s:function(yt,gt,xt,vt,Bt,zt){var Dt=_l();try{return Pl(yt)(gt,xt,vt,Bt,zt)}catch(Sl){if(Dl(Dt),Sl!==Sl+0)throw Sl;en(1,0)}},w:function(yt,gt,xt,vt,Bt,zt,Dt){var Sl=_l();try{return Pl(yt)(gt,xt,vt,Bt,zt,Dt)}catch(tn){if(Dl(Sl),tn!==tn+0)throw tn;en(1,0)}},L:function(yt,gt,xt,vt,Bt,zt,Dt,Sl){var tn=_l();try{return Pl(yt)(gt,xt,vt,Bt,zt,Dt,Sl)}catch(ln){if(Dl(tn),ln!==ln+0)throw ln;en(1,0)}},E:function(yt,gt,xt,vt,Bt,zt,Dt,Sl,tn,ln,Xn,kn){var Kn=_l();try{return Pl(yt)(gt,xt,vt,Bt,zt,Dt,Sl,tn,ln,Xn,kn)}catch(Ut){if(Dl(Kn),Ut!==Ut+0)throw Ut;en(1,0)}},aa:function(yt,gt,xt,vt,Bt,zt,Dt,Sl){var tn=_l();try{return Ro(yt,gt,xt,vt,Bt,zt,Dt,Sl)}catch(ln){if(Dl(tn),ln!==ln+0)throw ln;en(1,0)}},_:function(yt,gt,xt,vt,Bt,zt,Dt){var Sl=_l();try{return Xo(yt,gt,xt,vt,Bt,zt,Dt)}catch(tn){if(Dl(Sl),tn!==tn+0)throw tn;en(1,0)}},Z:function(yt,gt,xt,vt,Bt){var zt=_l();try{return fo(yt,gt,xt,vt,Bt)}catch(Dt){if(Dl(zt),Dt!==Dt+0)throw Dt;en(1,0)}},ca:function(yt,gt,xt,vt){var Bt=_l();try{return go(yt,gt,xt,vt)}catch(zt){if(Dl(Bt),zt!==zt+0)throw zt;en(1,0)}},$:function(yt){var gt=_l();try{return ho(yt)}catch(xt){if(Dl(gt),xt!==xt+0)throw xt;en(1,0)}},ba:function(yt,gt){var xt=_l();try{return Io(yt,gt)}catch(vt){if(Dl(xt),vt!==vt+0)throw vt;en(1,0)}},Y:function(yt,gt,xt){var vt=_l();try{return Go(yt,gt,xt)}catch(Bt){if(Dl(vt),Bt!==Bt+0)throw Bt;en(1,0)}},g:function(yt){var gt=_l();try{Pl(yt)()}catch(xt){if(Dl(gt),xt!==xt+0)throw xt;en(1,0)}},r:function(yt,gt){var xt=_l();try{Pl(yt)(gt)}catch(vt){if(Dl(xt),vt!==vt+0)throw vt;en(1,0)}},i:function(yt,gt,xt){var vt=_l();try{Pl(yt)(gt,xt)}catch(Bt){if(Dl(vt),Bt!==Bt+0)throw Bt;en(1,0)}},ha:function(yt,gt,xt,vt){var Bt=_l();try{Pl(yt)(gt,xt,vt)}catch(zt){if(Dl(Bt),zt!==zt+0)throw zt;en(1,0)}},m:function(yt,gt,xt,vt){var Bt=_l();try{Pl(yt)(gt,xt,vt)}catch(zt){if(Dl(Bt),zt!==zt+0)throw zt;en(1,0)}},v:function(yt,gt,xt,vt,Bt){var zt=_l();try{Pl(yt)(gt,xt,vt,Bt)}catch(Dt){if(Dl(zt),Dt!==Dt+0)throw Dt;en(1,0)}},u:function(yt,gt,xt,vt,Bt,zt){var Dt=_l();try{Pl(yt)(gt,xt,vt,Bt,zt)}catch(Sl){if(Dl(Dt),Sl!==Sl+0)throw Sl;en(1,0)}},O:function(yt,gt,xt,vt,Bt,zt,Dt){var Sl=_l();try{Pl(yt)(gt,xt,vt,Bt,zt,Dt)}catch(tn){if(Dl(Sl),tn!==tn+0)throw tn;en(1,0)}},A:function(yt,gt,xt,vt,Bt,zt,Dt,Sl){var tn=_l();try{Pl(yt)(gt,xt,vt,Bt,zt,Dt,Sl)}catch(ln){if(Dl(tn),ln!==ln+0)throw ln;en(1,0)}},ka:function(yt,gt,xt,vt,Bt,zt,Dt,Sl,tn){var ln=_l();try{Pl(yt)(gt,xt,vt,Bt,zt,Dt,Sl,tn)}catch(Xn){if(Dl(ln),Xn!==Xn+0)throw Xn;en(1,0)}},C:function(yt,gt,xt,vt,Bt,zt,Dt,Sl,tn,ln,Xn){var kn=_l();try{Pl(yt)(gt,xt,vt,Bt,zt,Dt,Sl,tn,ln,Xn)}catch(Kn){if(Dl(kn),Kn!==Kn+0)throw Kn;en(1,0)}},D:function(yt,gt,xt,vt,Bt,zt,Dt,Sl,tn,ln,Xn,kn,Kn,Ut,on,pn){var Un=_l();try{Pl(yt)(gt,xt,vt,Bt,zt,Dt,Sl,tn,ln,Xn,kn,Kn,Ut,on,pn)}catch(An){if(Dl(Un),An!==An+0)throw An;en(1,0)}},fa:function(yt,gt,xt,vt,Bt,zt,Dt,Sl){var tn=_l();try{yo(yt,gt,xt,vt,Bt,zt,Dt,Sl)}catch(ln){if(Dl(tn),ln!==ln+0)throw ln;en(1,0)}},da:function(yt,gt,xt,vt,Bt,zt,Dt,Sl,tn,ln,Xn,kn){var Kn=_l();try{Wo(yt,gt,xt,vt,Bt,zt,Dt,Sl,tn,ln,Xn,kn)}catch(Ut){if(Dl(Kn),Ut!==Ut+0)throw Ut;en(1,0)}},ea:function(yt,gt,xt,vt,Bt,zt){var Dt=_l();try{Vo(yt,gt,xt,vt,Bt,zt)}catch(Sl){if(Dl(Dt),Sl!==Sl+0)throw Sl;en(1,0)}},o:function(yt){return yt},a:Ht||$.wasmMemory,G:function(yt){Cn=yt},la:oo,z:function(yt,gt,xt,vt){return oo(yt,gt,xt,vt)}};(function(){function yt(Bt,zt){$.asm=Bt.exports,$t.qc.push($.asm.sb),xl=$.asm.ub,sn.unshift($.asm.Va),wt=zt,Vt||(Ql--,$.monitorRunDependencies&&$.monitorRunDependencies(Ql),Ql==0&&El&&(Bt=El,El=null,Bt()))}function gt(Bt){yt(Bt.instance,Bt.module)}function xt(Bt){return function(){if(!Tt&&(ht||Gt)){if(typeof fetch=="function"&&!Ul.startsWith("file://"))return fetch(Ul,{credentials:"same-origin"}).then(function(zt){if(!zt.ok)throw"failed to load wasm binary file at '"+Ul+"'";return zt.arrayBuffer()}).catch(function(){return bn()});if(at)return new Promise(function(zt,Dt){at(Ul,function(Sl){zt(new Uint8Array(Sl))},Dt)})}return Promise.resolve().then(function(){return bn()})}().then(function(zt){return WebAssembly.instantiate(zt,vt)}).then(function(zt){return zt}).then(Bt,function(zt){Ft("failed to asynchronously prepare wasm: "+zt),Nl(zt)})}var vt={a:Lo};if(Vt||(Ql++,$.monitorRunDependencies&&$.monitorRunDependencies(Ql)),$.instantiateWasm)try{return $.instantiateWasm(vt,yt)}catch(Bt){return Ft("Module.instantiateWasm callback failed with error: "+Bt),!1}(Tt||typeof WebAssembly.instantiateStreaming!="function"||Zn()||Ul.startsWith("file://")||Xt||typeof fetch!="function"?xt(gt):fetch(Ul,{credentials:"same-origin"}).then(function(Bt){return WebAssembly.instantiateStreaming(Bt,vt).then(gt,function(zt){return Ft("wasm streaming compile failed: "+zt),Ft("falling back to ArrayBuffer instantiation"),xt(gt)})})).catch(et)})(),$.___wasm_call_ctors=function(){return($.___wasm_call_ctors=$.asm.Va).apply(null,arguments)},$._OrtInit=function(){return($._OrtInit=$.asm.Wa).apply(null,arguments)},$._OrtCreateSessionOptions=function(){return($._OrtCreateSessionOptions=$.asm.Xa).apply(null,arguments)},$._OrtAppendExecutionProvider=function(){return($._OrtAppendExecutionProvider=$.asm.Ya).apply(null,arguments)},$._OrtAddSessionConfigEntry=function(){return($._OrtAddSessionConfigEntry=$.asm.Za).apply(null,arguments)},$._OrtReleaseSessionOptions=function(){return($._OrtReleaseSessionOptions=$.asm._a).apply(null,arguments)},$._OrtCreateSession=function(){return($._OrtCreateSession=$.asm.$a).apply(null,arguments)},$._OrtReleaseSession=function(){return($._OrtReleaseSession=$.asm.ab).apply(null,arguments)},$._OrtGetInputCount=function(){return($._OrtGetInputCount=$.asm.bb).apply(null,arguments)},$._OrtGetOutputCount=function(){return($._OrtGetOutputCount=$.asm.cb).apply(null,arguments)},$._OrtGetInputName=function(){return($._OrtGetInputName=$.asm.db).apply(null,arguments)},$._OrtGetOutputName=function(){return($._OrtGetOutputName=$.asm.eb).apply(null,arguments)},$._OrtFree=function(){return($._OrtFree=$.asm.fb).apply(null,arguments)},$._OrtCreateTensor=function(){return($._OrtCreateTensor=$.asm.gb).apply(null,arguments)},$._OrtGetTensorData=function(){return($._OrtGetTensorData=$.asm.hb).apply(null,arguments)},$._OrtReleaseTensor=function(){return($._OrtReleaseTensor=$.asm.ib).apply(null,arguments)},$._OrtCreateRunOptions=function(){return($._OrtCreateRunOptions=$.asm.jb).apply(null,arguments)},$._OrtAddRunConfigEntry=function(){return($._OrtAddRunConfigEntry=$.asm.kb).apply(null,arguments)},$._OrtReleaseRunOptions=function(){return($._OrtReleaseRunOptions=$.asm.lb).apply(null,arguments)},$._OrtRun=function(){return($._OrtRun=$.asm.mb).apply(null,arguments)},$._OrtEndProfiling=function(){return($._OrtEndProfiling=$.asm.nb).apply(null,arguments)};var On=$._pthread_self=function(){return(On=$._pthread_self=$.asm.ob).apply(null,arguments)},_i=$._malloc=function(){return(_i=$._malloc=$.asm.pb).apply(null,arguments)},co=$._free=function(){return(co=$._free=$.asm.qb).apply(null,arguments)},so=$._fflush=function(){return(so=$._fflush=$.asm.rb).apply(null,arguments)};$.__emscripten_tls_init=function(){return($.__emscripten_tls_init=$.asm.sb).apply(null,arguments)};var ao=$.___funcs_on_exit=function(){return(ao=$.___funcs_on_exit=$.asm.tb).apply(null,arguments)},ro=$.__emscripten_thread_init=function(){return(ro=$.__emscripten_thread_init=$.asm.vb).apply(null,arguments)};$.__emscripten_thread_crashed=function(){return($.__emscripten_thread_crashed=$.asm.wb).apply(null,arguments)};var Dn,uo=$._emscripten_run_in_main_runtime_thread_js=function(){return(uo=$._emscripten_run_in_main_runtime_thread_js=$.asm.xb).apply(null,arguments)},bo=$.__emscripten_proxy_execute_task_queue=function(){return(bo=$.__emscripten_proxy_execute_task_queue=$.asm.yb).apply(null,arguments)},eo=$.__emscripten_thread_free_data=function(){return(eo=$.__emscripten_thread_free_data=$.asm.zb).apply(null,arguments)},mo=$.__emscripten_thread_exit=function(){return(mo=$.__emscripten_thread_exit=$.asm.Ab).apply(null,arguments)},en=$._setThrew=function(){return(en=$._setThrew=$.asm.Bb).apply(null,arguments)},po=$._emscripten_stack_set_limits=function(){return(po=$._emscripten_stack_set_limits=$.asm.Cb).apply(null,arguments)},_l=$.stackSave=function(){return(_l=$.stackSave=$.asm.Db).apply(null,arguments)},Dl=$.stackRestore=function(){return(Dl=$.stackRestore=$.asm.Eb).apply(null,arguments)},to=$.stackAlloc=function(){return(to=$.stackAlloc=$.asm.Fb).apply(null,arguments)},_n=$.___cxa_can_catch=function(){return(_n=$.___cxa_can_catch=$.asm.Gb).apply(null,arguments)},Zo=$.___cxa_is_pointer_type=function(){return(Zo=$.___cxa_is_pointer_type=$.asm.Hb).apply(null,arguments)},ho=$.dynCall_j=function(){return(ho=$.dynCall_j=$.asm.Ib).apply(null,arguments)},Xo=$.dynCall_iiiiij=function(){return(Xo=$.dynCall_iiiiij=$.asm.Jb).apply(null,arguments)},Go=$.dynCall_jii=function(){return(Go=$.dynCall_jii=$.asm.Kb).apply(null,arguments)},yo=$.dynCall_viiiiij=function(){return(yo=$.dynCall_viiiiij=$.asm.Lb).apply(null,arguments)},Vo=$.dynCall_vjji=function(){return(Vo=$.dynCall_vjji=$.asm.Mb).apply(null,arguments)},Wo=$.dynCall_viiijjjii=function(){return(Wo=$.dynCall_viiijjjii=$.asm.Nb).apply(null,arguments)},go=$.dynCall_iij=function(){return(go=$.dynCall_iij=$.asm.Ob).apply(null,arguments)},Io=$.dynCall_ji=function(){return(Io=$.dynCall_ji=$.asm.Pb).apply(null,arguments)},Ro=$.dynCall_iiiiiij=function(){return(Ro=$.dynCall_iiiiiij=$.asm.Qb).apply(null,arguments)},fo=$.dynCall_iiij=function(){return(fo=$.dynCall_iiij=$.asm.Rb).apply(null,arguments)};function Yo(){function yt(){if(!Dn&&(Dn=!0,$.calledRun=!0,!Yl)&&(Vt||$l(sn),a($),$.onRuntimeInitialized&&$.onRuntimeInitialized(),!Vt)){if($.postRun)for(typeof $.postRun=="function"&&($.postRun=[$.postRun]);$.postRun.length;){var gt=$.postRun.shift();cn.unshift(gt)}$l(cn)}}if(!(0{var j,_e=(j=(j=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(lt){var tt,ot,st;lt=lt||{},tt||(tt=lt!==void 0?lt:{}),tt.ready=new Promise(function(It,Wt){ot=It,st=Wt});var ct,it,$,a,et,nt,at=Object.assign({},tt),rt="./this.program",dt=(It,Wt)=>{throw Wt},ut=typeof window=="object",bt=typeof importScripts=="function",mt=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",pt="";mt?(pt=bt?s(908).dirname(pt)+"/":"//",nt=()=>{et||(a=s(1384),et=s(908))},ct=function(It,Wt){return nt(),It=et.normalize(It),a.readFileSync(It,Wt?void 0:"utf8")},$=It=>((It=ct(It,!0)).buffer||(It=new Uint8Array(It)),It),it=(It,Wt,Rt)=>{nt(),It=et.normalize(It),a.readFile(It,function(Nt,Kt){Nt?Rt(Nt):Wt(Kt.buffer)})},1{if(Xt||0{var Wt=new XMLHttpRequest;return Wt.open("GET",It,!1),Wt.send(null),Wt.responseText},bt&&($=It=>{var Wt=new XMLHttpRequest;return Wt.open("GET",It,!1),Wt.responseType="arraybuffer",Wt.send(null),new Uint8Array(Wt.response)}),it=(It,Wt,Rt)=>{var Nt=new XMLHttpRequest;Nt.open("GET",It,!0),Nt.responseType="arraybuffer",Nt.onload=()=>{Nt.status==200||Nt.status==0&&Nt.response?Wt(Nt.response):Rt()},Nt.onerror=Rt,Nt.send(null)});var Zt,ht=tt.print||console.log.bind(console),Gt=tt.printErr||console.warn.bind(console);Object.assign(tt,at),at=null,tt.thisProgram&&(rt=tt.thisProgram),tt.quit&&(dt=tt.quit),tt.wasmBinary&&(Zt=tt.wasmBinary);var Xt=tt.noExitRuntime||!1;typeof WebAssembly!="object"&&yl("no native wasm support detected");var Vt,Yt,St,Lt,Ct,Tt,ft=!1,Ft=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function Jt(It,Wt,Rt){var Nt=(Wt>>>=0)+Rt;for(Rt=Wt;It[Rt]&&!(Rt>=Nt);)++Rt;if(16(Kt=(240&Kt)==224?(15&Kt)<<12|kt<<6|Pt:(7&Kt)<<18|kt<<12|Pt<<6|63&It[Wt++])?Nt+=String.fromCharCode(Kt):(Kt-=65536,Nt+=String.fromCharCode(55296|Kt>>10,56320|1023&Kt))}}else Nt+=String.fromCharCode(Kt)}return Nt}function Ht(It,Wt){return(It>>>=0)?Jt(Lt,It,Wt):""}function wt(It,Wt,Rt,Nt){if(!(0>>=0;Nt=Rt+Nt-1;for(var kt=0;kt=Pt&&(Pt=65536+((1023&Pt)<<10)|1023&It.charCodeAt(++kt)),127>=Pt){if(Rt>=Nt)break;Wt[Rt++>>>0]=Pt}else{if(2047>=Pt){if(Rt+1>=Nt)break;Wt[Rt++>>>0]=192|Pt>>6}else{if(65535>=Pt){if(Rt+2>=Nt)break;Wt[Rt++>>>0]=224|Pt>>12}else{if(Rt+3>=Nt)break;Wt[Rt++>>>0]=240|Pt>>18,Wt[Rt++>>>0]=128|Pt>>12&63}Wt[Rt++>>>0]=128|Pt>>6&63}Wt[Rt++>>>0]=128|63&Pt}}return Wt[Rt>>>0]=0,Rt-Kt}function Et(It){for(var Wt=0,Rt=0;Rt=Nt?Wt++:2047>=Nt?Wt+=2:55296<=Nt&&57343>=Nt?(Wt+=4,++Rt):Wt+=3}return Wt}function At(){var It=Vt.buffer;Yt=It,tt.HEAP8=St=new Int8Array(It),tt.HEAP16=new Int16Array(It),tt.HEAP32=Ct=new Int32Array(It),tt.HEAPU8=Lt=new Uint8Array(It),tt.HEAPU16=new Uint16Array(It),tt.HEAPU32=Tt=new Uint32Array(It),tt.HEAPF32=new Float32Array(It),tt.HEAPF64=new Float64Array(It)}var Il,Qt=[],jt=[],Xl=[],Yl=[],Rl=0;function Tl(){var It=tt.preRun.shift();Qt.unshift(It)}var zl,Ll=0,Cl=null;function yl(It){throw tt.onAbort&&tt.onAbort(It),Gt(It="Aborted("+It+")"),ft=!0,It=new WebAssembly.RuntimeError(It+". Build with -sASSERTIONS for more info."),st(It),It}function Wl(){return zl.startsWith("data:application/octet-stream;base64,")}if(zl="ort-wasm.wasm",!Wl()){var xl=zl;zl=tt.locateFile?tt.locateFile(xl,pt):pt+xl}function Gl(){var It=zl;try{if(It==zl&&Zt)return new Uint8Array(Zt);if($)return $(It);throw"both async and sync fetching of the wasm failed"}catch(Wt){yl(Wt)}}function sn(It){this.name="ExitStatus",this.message="Program terminated with exit("+It+")",this.status=It}function Fl(It){for(;0>2>>>0]=Wt},this.Eb=function(){return Tt[this.zb+4>>2>>>0]},this.Sb=function(Wt){Tt[this.zb+8>>2>>>0]=Wt},this.Wb=function(){return Tt[this.zb+8>>2>>>0]},this.Tb=function(){Ct[this.zb>>2>>>0]=0},this.Ib=function(Wt){St[this.zb+12>>0>>>0]=Wt?1:0},this.Pb=function(){return St[this.zb+12>>0>>>0]!=0},this.Jb=function(Wt){St[this.zb+13>>0>>>0]=Wt?1:0},this.Lb=function(){return St[this.zb+13>>0>>>0]!=0},this.Rb=function(Wt,Rt){this.Fb(0),this.Ub(Wt),this.Sb(Rt),this.Tb(),this.Ib(!1),this.Jb(!1)},this.Nb=function(){Ct[this.zb>>2>>>0]+=1},this.Xb=function(){var Wt=Ct[this.zb>>2>>>0];return Ct[this.zb>>2>>>0]=Wt-1,Wt===1},this.Fb=function(Wt){Tt[this.zb+16>>2>>>0]=Wt},this.Ob=function(){return Tt[this.zb+16>>2>>>0]},this.Qb=function(){if(Pn(this.Eb()))return Tt[this.Db>>2>>>0];var Wt=this.Ob();return Wt!==0?Wt:this.Db}}function Ql(It){return gn(new Ul(It).zb)}var El=[];function Nl(It){var Wt=El[It];return Wt||(It>=El.length&&(El.length=It+1),El[It]=Wt=Il.get(It)),Wt}function Zn(It){var Wt=Et(It)+1,Rt=Pl(Wt);return Rt&&wt(It,St,Rt,Wt),Rt}var bn={};function Bl(){if(!Ot){var It,Wt={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:rt||"./this.program"};for(It in bn)bn[It]===void 0?delete Wt[It]:Wt[It]=bn[It];var Rt=[];for(It in Wt)Rt.push(It+"="+Wt[It]);Ot=Rt}return Ot}var Ot,rn=[null,[],[]];function yn(It,Wt){var Rt=rn[It];Wt===0||Wt===10?((It===1?ht:Gt)(Jt(Rt,0)),Rt.length=0):Rt.push(Wt)}var an=0;function Vl(It){return It%4==0&&(It%100!=0||It%400==0)}var $t=[31,29,31,30,31,30,31,31,30,31,30,31],$l=[31,28,31,30,31,30,31,31,30,31,30,31];function Vn(It,Wt,Rt,Nt){function Kt(Mt,nn,un){for(Mt=typeof Mt=="number"?Mt.toString():Mt||"";Mt.lengthMn?-1:0Nn-Mt.getDate())){Mt.setDate(Mt.getDate()+nn);break}nn-=Nn-Mt.getDate()+1,Mt.setDate(1),11>un?Mt.setMonth(un+1):(Mt.setMonth(0),Mt.setFullYear(Mt.getFullYear()+1))}return un=new Date(Mt.getFullYear()+1,0,4),nn=Zl(new Date(Mt.getFullYear(),0,4)),un=Zl(un),0>=Pt(nn,Mt)?0>=Pt(un,Mt)?Mt.getFullYear()+1:Mt.getFullYear():Mt.getFullYear()-1}var Al=Ct[Nt+40>>2>>>0];for(var dn in Nt={$b:Ct[Nt>>2>>>0],Zb:Ct[Nt+4>>2>>>0],Gb:Ct[Nt+8>>2>>>0],Kb:Ct[Nt+12>>2>>>0],Hb:Ct[Nt+16>>2>>>0],Cb:Ct[Nt+20>>2>>>0],Ab:Ct[Nt+24>>2>>>0],Bb:Ct[Nt+28>>2>>>0],bc:Ct[Nt+32>>2>>>0],Yb:Ct[Nt+36>>2>>>0],ac:Al?Ht(Al):""},Rt=Ht(Rt),Al={"%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"})Rt=Rt.replace(new RegExp(dn,"g"),Al[dn]);var Wn="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),Gn="January February March April May June July August September October November December".split(" ");for(dn in Al={"%a":function(Mt){return Wn[Mt.Ab].substring(0,3)},"%A":function(Mt){return Wn[Mt.Ab]},"%b":function(Mt){return Gn[Mt.Hb].substring(0,3)},"%B":function(Mt){return Gn[Mt.Hb]},"%C":function(Mt){return kt((Mt.Cb+1900)/100|0,2)},"%d":function(Mt){return kt(Mt.Kb,2)},"%e":function(Mt){return Kt(Mt.Kb,2," ")},"%g":function(Mt){return qt(Mt).toString().substring(2)},"%G":function(Mt){return qt(Mt)},"%H":function(Mt){return kt(Mt.Gb,2)},"%I":function(Mt){return(Mt=Mt.Gb)==0?Mt=12:12Mt.Gb?"AM":"PM"},"%S":function(Mt){return kt(Mt.$b,2)},"%t":function(){return" "},"%u":function(Mt){return Mt.Ab||7},"%U":function(Mt){return kt(Math.floor((Mt.Bb+7-Mt.Ab)/7),2)},"%V":function(Mt){var nn=Math.floor((Mt.Bb+7-(Mt.Ab+6)%7)/7);if(2>=(Mt.Ab+371-Mt.Bb-2)%7&&nn++,nn)nn==53&&((un=(Mt.Ab+371-Mt.Bb)%7)==4||un==3&&Vl(Mt.Cb)||(nn=1));else{nn=52;var un=(Mt.Ab+7-Mt.Bb-1)%7;(un==4||un==5&&Vl(Mt.Cb%400-1))&&nn++}return kt(nn,2)},"%w":function(Mt){return Mt.Ab},"%W":function(Mt){return kt(Math.floor((Mt.Bb+7-(Mt.Ab+6)%7)/7),2)},"%y":function(Mt){return(Mt.Cb+1900).toString().substring(2)},"%Y":function(Mt){return Mt.Cb+1900},"%z":function(Mt){var nn=0<=(Mt=Mt.Yb);return Mt=Math.abs(Mt)/60,(nn?"+":"-")+("0000"+(Mt/60*100+Mt%60)).slice(-4)},"%Z":function(Mt){return Mt.ac},"%%":function(){return"%"}},Rt=Rt.replace(/%%/g,"\0\0"),Al)Rt.includes(dn)&&(Rt=Rt.replace(new RegExp(dn,"g"),Al[dn](Nt)));return dn=function(Mt){var nn=Array(Et(Mt)+1);return wt(Mt,nn,0,nn.length),nn}(Rt=Rt.replace(/\0\0/g,"%")),dn.length>Wt?0:(St.set(dn,It>>>0),dn.length-1)}var xn={a:function(It){return Pl(It+24)+24},m:function(It){return(It=new Ul(It)).Pb()||(It.Ib(!0),Ol--),It.Jb(!1),cn.push(It),It.Nb(),It.Qb()},ia:function(It){throw Gt("Unexpected exception thrown, this is not properly supported - aborting"),ft=!0,It},w:function(){Jl(0);var It=cn.pop();if(It.Xb()&&!It.Lb()){var Wt=It.Wb();Wt&&Nl(Wt)(It.Db),Ql(It.Db)}Ml=0},d:function(){var It=Ml;if(!It)return an=0;var Wt=new Ul(It);Wt.Fb(It);var Rt=Wt.Eb();if(!Rt)return an=0,It;for(var Nt=Array.prototype.slice.call(arguments),Kt=0;Kt>>2]+4294967296*Ct[It+4>>>2])),Ct[Wt>>2>>>0]=It.getUTCSeconds(),Ct[Wt+4>>2>>>0]=It.getUTCMinutes(),Ct[Wt+8>>2>>>0]=It.getUTCHours(),Ct[Wt+12>>2>>>0]=It.getUTCDate(),Ct[Wt+16>>2>>>0]=It.getUTCMonth(),Ct[Wt+20>>2>>>0]=It.getUTCFullYear()-1900,Ct[Wt+24>>2>>>0]=It.getUTCDay(),Ct[Wt+28>>2>>>0]=(It.getTime()-Date.UTC(It.getUTCFullYear(),0,1,0,0,0,0))/864e5|0},Ea:function(It,Wt){It=new Date(1e3*(Tt[It>>>2]+4294967296*Ct[It+4>>>2])),Ct[Wt>>2>>>0]=It.getSeconds(),Ct[Wt+4>>2>>>0]=It.getMinutes(),Ct[Wt+8>>2>>>0]=It.getHours(),Ct[Wt+12>>2>>>0]=It.getDate(),Ct[Wt+16>>2>>>0]=It.getMonth(),Ct[Wt+20>>2>>>0]=It.getFullYear()-1900,Ct[Wt+24>>2>>>0]=It.getDay();var Rt=new Date(It.getFullYear(),0,1);Ct[Wt+28>>2>>>0]=(It.getTime()-Rt.getTime())/864e5|0,Ct[Wt+36>>2>>>0]=-60*It.getTimezoneOffset();var Nt=new Date(It.getFullYear(),6,1).getTimezoneOffset();Rt=Rt.getTimezoneOffset(),Ct[Wt+32>>2>>>0]=0|(Nt!=Rt&&It.getTimezoneOffset()==Math.min(Rt,Nt))},Fa:function(It){var Wt=new Date(Ct[It+20>>2>>>0]+1900,Ct[It+16>>2>>>0],Ct[It+12>>2>>>0],Ct[It+8>>2>>>0],Ct[It+4>>2>>>0],Ct[It>>2>>>0],0),Rt=Ct[It+32>>2>>>0],Nt=Wt.getTimezoneOffset(),Kt=new Date(Wt.getFullYear(),0,1),kt=new Date(Wt.getFullYear(),6,1).getTimezoneOffset(),Pt=Kt.getTimezoneOffset(),Zl=Math.min(Pt,kt);return 0>Rt?Ct[It+32>>2>>>0]=+(kt!=Pt&&Zl==Nt):0>2>>>0]=Wt.getDay(),Ct[It+28>>2>>>0]=(Wt.getTime()-Kt.getTime())/864e5|0,Ct[It>>2>>>0]=Wt.getSeconds(),Ct[It+4>>2>>>0]=Wt.getMinutes(),Ct[It+8>>2>>>0]=Wt.getHours(),Ct[It+12>>2>>>0]=Wt.getDate(),Ct[It+16>>2>>>0]=Wt.getMonth(),Wt.getTime()/1e3|0},sa:function(){return-52},ta:function(){},Ga:function It(Wt,Rt,Nt){It.Vb||(It.Vb=!0,function(Kt,kt,Pt){function Zl(Gn){return(Gn=Gn.toTimeString().match(/\(([A-Za-z ]+)\)$/))?Gn[1]:"GMT"}var qt=new Date().getFullYear(),Al=new Date(qt,0,1),dn=new Date(qt,6,1);qt=Al.getTimezoneOffset();var Wn=dn.getTimezoneOffset();Ct[Kt>>2>>>0]=60*Math.max(qt,Wn),Ct[kt>>2>>>0]=+(qt!=Wn),Kt=Zl(Al),kt=Zl(dn),Kt=Zn(Kt),kt=Zn(kt),Wn>2>>>0]=Kt,Tt[Pt+4>>2>>>0]=kt):(Tt[Pt>>2>>>0]=kt,Tt[Pt+4>>2>>>0]=Kt)}(Wt,Rt,Nt))},B:function(){yl("")},ma:function(){return 4294901760},I:mt?()=>{var It=process.hrtime();return 1e3*It[0]+It[1]/1e6}:()=>performance.now(),xa:function(It,Wt,Rt){Lt.copyWithin(It>>>0,Wt>>>0,Wt+Rt>>>0)},G:function(It){var Wt=Lt.length;if(4294901760<(It>>>=0))return!1;for(var Rt=1;4>=Rt;Rt*=2){var Nt=Wt*(1+.2/Rt);Nt=Math.min(Nt,It+100663296);var Kt=Math;Nt=Math.max(It,Nt),Kt=Kt.min.call(Kt,4294901760,Nt+(65536-Nt%65536)%65536);e:{try{Vt.grow(Kt-Yt.byteLength+65535>>>16),At();var kt=1;break e}catch{}kt=void 0}if(kt)return!0}return!1},va:function(It,Wt){var Rt=0;return Bl().forEach(function(Nt,Kt){var kt=Wt+Rt;for(Kt=Tt[It+4*Kt>>2>>>0]=kt,kt=0;kt>0>>>0]=Nt.charCodeAt(kt);St[Kt>>0>>>0]=0,Rt+=Nt.length+1}),0},wa:function(It,Wt){var Rt=Bl();Tt[It>>2>>>0]=Rt.length;var Nt=0;return Rt.forEach(function(Kt){Nt+=Kt.length+1}),Tt[Wt>>2>>>0]=Nt,0},ba:function(It){Xt||0>2>>>0],Zl=Tt[Wt+4>>2>>>0];Wt+=8;for(var qt=0;qt>>0]);Kt+=Zl}return Tt[Nt>>2>>>0]=Kt,0},c:function(){return an},ja:function It(Wt,Rt){It.Mb||(It.Mb=function(){if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function"){var Kt=new Uint8Array(1);return()=>(crypto.getRandomValues(Kt),Kt[0])}if(mt)try{var kt=s(Object(function(){var Pt=new Error("Cannot find module 'crypto'");throw Pt.code="MODULE_NOT_FOUND",Pt}()));return()=>kt.randomBytes(1)[0]}catch{}return()=>yl("randomDevice")}());for(var Nt=0;Nt>0>>>0]=It.Mb();return 0},ea:function(It,Wt,Rt){var Nt=Kl();try{return Nl(It)(Wt,Rt)}catch(Kt){if(Hl(Nt),Kt!==Kt+0)throw Kt;Jl(1,0)}},fa:function(It,Wt,Rt){var Nt=Kl();try{return Nl(It)(Wt,Rt)}catch(Kt){if(Hl(Nt),Kt!==Kt+0)throw Kt;Jl(1,0)}},J:function(It){var Wt=Kl();try{return Nl(It)()}catch(Rt){if(Hl(Wt),Rt!==Rt+0)throw Rt;Jl(1,0)}},e:function(It,Wt){var Rt=Kl();try{return Nl(It)(Wt)}catch(Nt){if(Hl(Rt),Nt!==Nt+0)throw Nt;Jl(1,0)}},N:function(It,Wt,Rt){var Nt=Kl();try{return Nl(It)(Wt,Rt)}catch(Kt){if(Hl(Nt),Kt!==Kt+0)throw Kt;Jl(1,0)}},O:function(It,Wt,Rt){var Nt=Kl();try{return Nl(It)(Wt,Rt)}catch(Kt){if(Hl(Nt),Kt!==Kt+0)throw Kt;Jl(1,0)}},j:function(It,Wt,Rt){var Nt=Kl();try{return Nl(It)(Wt,Rt)}catch(Kt){if(Hl(Nt),Kt!==Kt+0)throw Kt;Jl(1,0)}},o:function(It,Wt,Rt,Nt){var Kt=Kl();try{return Nl(It)(Wt,Rt,Nt)}catch(kt){if(Hl(Kt),kt!==kt+0)throw kt;Jl(1,0)}},p:function(It,Wt,Rt,Nt,Kt){var kt=Kl();try{return Nl(It)(Wt,Rt,Nt,Kt)}catch(Pt){if(Hl(kt),Pt!==Pt+0)throw Pt;Jl(1,0)}},M:function(It,Wt,Rt,Nt,Kt,kt){var Pt=Kl();try{return Nl(It)(Wt,Rt,Nt,Kt,kt)}catch(Zl){if(Hl(Pt),Zl!==Zl+0)throw Zl;Jl(1,0)}},r:function(It,Wt,Rt,Nt,Kt,kt){var Pt=Kl();try{return Nl(It)(Wt,Rt,Nt,Kt,kt)}catch(Zl){if(Hl(Pt),Zl!==Zl+0)throw Zl;Jl(1,0)}},v:function(It,Wt,Rt,Nt,Kt,kt,Pt){var Zl=Kl();try{return Nl(It)(Wt,Rt,Nt,Kt,kt,Pt)}catch(qt){if(Hl(Zl),qt!==qt+0)throw qt;Jl(1,0)}},K:function(It,Wt,Rt,Nt,Kt,kt,Pt,Zl){var qt=Kl();try{return Nl(It)(Wt,Rt,Nt,Kt,kt,Pt,Zl)}catch(Al){if(Hl(qt),Al!==Al+0)throw Al;Jl(1,0)}},D:function(It,Wt,Rt,Nt,Kt,kt,Pt,Zl,qt,Al,dn,Wn){var Gn=Kl();try{return Nl(It)(Wt,Rt,Nt,Kt,kt,Pt,Zl,qt,Al,dn,Wn)}catch(Mt){if(Hl(Gn),Mt!==Mt+0)throw Mt;Jl(1,0)}},X:function(It,Wt,Rt,Nt,Kt,kt,Pt,Zl){var qt=Kl();try{return Hn(It,Wt,Rt,Nt,Kt,kt,Pt,Zl)}catch(Al){if(Hl(qt),Al!==Al+0)throw Al;Jl(1,0)}},V:function(It,Wt,Rt,Nt,Kt,kt,Pt){var Zl=Kl();try{return hn(It,Wt,Rt,Nt,Kt,kt,Pt)}catch(qt){if(Hl(Zl),qt!==qt+0)throw qt;Jl(1,0)}},U:function(It,Wt,Rt,Nt,Kt){var kt=Kl();try{return Tn(It,Wt,Rt,Nt,Kt)}catch(Pt){if(Hl(kt),Pt!==Pt+0)throw Pt;Jl(1,0)}},Z:function(It,Wt,Rt,Nt){var Kt=Kl();try{return wn(It,Wt,Rt,Nt)}catch(kt){if(Hl(Kt),kt!==kt+0)throw kt;Jl(1,0)}},W:function(It){var Wt=Kl();try{return Fn(It)}catch(Rt){if(Hl(Wt),Rt!==Rt+0)throw Rt;Jl(1,0)}},Y:function(It,Wt){var Rt=Kl();try{return zn(It,Wt)}catch(Nt){if(Hl(Rt),Nt!==Nt+0)throw Nt;Jl(1,0)}},T:function(It,Wt,Rt){var Nt=Kl();try{return mn(It,Wt,Rt)}catch(Kt){if(Hl(Nt),Kt!==Kt+0)throw Kt;Jl(1,0)}},f:function(It){var Wt=Kl();try{Nl(It)()}catch(Rt){if(Hl(Wt),Rt!==Rt+0)throw Rt;Jl(1,0)}},q:function(It,Wt){var Rt=Kl();try{Nl(It)(Wt)}catch(Nt){if(Hl(Rt),Nt!==Nt+0)throw Nt;Jl(1,0)}},h:function(It,Wt,Rt){var Nt=Kl();try{Nl(It)(Wt,Rt)}catch(Kt){if(Hl(Nt),Kt!==Kt+0)throw Kt;Jl(1,0)}},da:function(It,Wt,Rt,Nt){var Kt=Kl();try{Nl(It)(Wt,Rt,Nt)}catch(kt){if(Hl(Kt),kt!==kt+0)throw kt;Jl(1,0)}},l:function(It,Wt,Rt,Nt){var Kt=Kl();try{Nl(It)(Wt,Rt,Nt)}catch(kt){if(Hl(Kt),kt!==kt+0)throw kt;Jl(1,0)}},t:function(It,Wt,Rt,Nt,Kt){var kt=Kl();try{Nl(It)(Wt,Rt,Nt,Kt)}catch(Pt){if(Hl(kt),Pt!==Pt+0)throw Pt;Jl(1,0)}},u:function(It,Wt,Rt,Nt,Kt,kt){var Pt=Kl();try{Nl(It)(Wt,Rt,Nt,Kt,kt)}catch(Zl){if(Hl(Pt),Zl!==Zl+0)throw Zl;Jl(1,0)}},x:function(It,Wt,Rt,Nt,Kt,kt,Pt){var Zl=Kl();try{Nl(It)(Wt,Rt,Nt,Kt,kt,Pt)}catch(qt){if(Hl(Zl),qt!==qt+0)throw qt;Jl(1,0)}},z:function(It,Wt,Rt,Nt,Kt,kt,Pt,Zl){var qt=Kl();try{Nl(It)(Wt,Rt,Nt,Kt,kt,Pt,Zl)}catch(Al){if(Hl(qt),Al!==Al+0)throw Al;Jl(1,0)}},ga:function(It,Wt,Rt,Nt,Kt,kt,Pt,Zl,qt){var Al=Kl();try{Nl(It)(Wt,Rt,Nt,Kt,kt,Pt,Zl,qt)}catch(dn){if(Hl(Al),dn!==dn+0)throw dn;Jl(1,0)}},A:function(It,Wt,Rt,Nt,Kt,kt,Pt,Zl,qt,Al,dn){var Wn=Kl();try{Nl(It)(Wt,Rt,Nt,Kt,kt,Pt,Zl,qt,Al,dn)}catch(Gn){if(Hl(Wn),Gn!==Gn+0)throw Gn;Jl(1,0)}},C:function(It,Wt,Rt,Nt,Kt,kt,Pt,Zl,qt,Al,dn,Wn,Gn,Mt,nn,un){var Nn=Kl();try{Nl(It)(Wt,Rt,Nt,Kt,kt,Pt,Zl,qt,Al,dn,Wn,Gn,Mt,nn,un)}catch(Mn){if(Hl(Nn),Mn!==Mn+0)throw Mn;Jl(1,0)}},aa:function(It,Wt,Rt,Nt,Kt,kt,Pt,Zl){var qt=Kl();try{In(It,Wt,Rt,Nt,Kt,kt,Pt,Zl)}catch(Al){if(Hl(qt),Al!==Al+0)throw Al;Jl(1,0)}},_:function(It,Wt,Rt,Nt,Kt,kt,Pt,Zl,qt,Al,dn,Wn){var Gn=Kl();try{Bn(It,Wt,Rt,Nt,Kt,kt,Pt,Zl,qt,Al,dn,Wn)}catch(Mt){if(Hl(Gn),Mt!==Mt+0)throw Mt;Jl(1,0)}},$:function(It,Wt,Rt,Nt,Kt,kt){var Pt=Kl();try{En(It,Wt,Rt,Nt,Kt,kt)}catch(Zl){if(Hl(Pt),Zl!==Zl+0)throw Zl;Jl(1,0)}},n:function(It){return It},F:function(It){an=It},ha:Vn,y:function(It,Wt,Rt,Nt){return Vn(It,Wt,Rt,Nt)}};(function(){function It(Kt){tt.asm=Kt.exports,Vt=tt.asm.Ka,At(),Il=tt.asm.ib,jt.unshift(tt.asm.La),Ll--,tt.monitorRunDependencies&&tt.monitorRunDependencies(Ll),Ll==0&&Cl&&(Kt=Cl,Cl=null,Kt())}function Wt(Kt){It(Kt.instance)}function Rt(Kt){return function(){if(!Zt&&(ut||bt)){if(typeof fetch=="function"&&!zl.startsWith("file://"))return fetch(zl,{credentials:"same-origin"}).then(function(kt){if(!kt.ok)throw"failed to load wasm binary file at '"+zl+"'";return kt.arrayBuffer()}).catch(function(){return Gl()});if(it)return new Promise(function(kt,Pt){it(zl,function(Zl){kt(new Uint8Array(Zl))},Pt)})}return Promise.resolve().then(function(){return Gl()})}().then(function(kt){return WebAssembly.instantiate(kt,Nt)}).then(function(kt){return kt}).then(Kt,function(kt){Gt("failed to asynchronously prepare wasm: "+kt),yl(kt)})}var Nt={a:xn};if(Ll++,tt.monitorRunDependencies&&tt.monitorRunDependencies(Ll),tt.instantiateWasm)try{return tt.instantiateWasm(Nt,It)}catch(Kt){return Gt("Module.instantiateWasm callback failed with error: "+Kt),!1}(Zt||typeof WebAssembly.instantiateStreaming!="function"||Wl()||zl.startsWith("file://")||mt||typeof fetch!="function"?Rt(Wt):fetch(zl,{credentials:"same-origin"}).then(function(Kt){return WebAssembly.instantiateStreaming(Kt,Nt).then(Wt,function(kt){return Gt("wasm streaming compile failed: "+kt),Gt("falling back to ArrayBuffer instantiation"),Rt(Wt)})})).catch(st)})(),tt.___wasm_call_ctors=function(){return(tt.___wasm_call_ctors=tt.asm.La).apply(null,arguments)},tt._OrtInit=function(){return(tt._OrtInit=tt.asm.Ma).apply(null,arguments)},tt._OrtCreateSessionOptions=function(){return(tt._OrtCreateSessionOptions=tt.asm.Na).apply(null,arguments)},tt._OrtAppendExecutionProvider=function(){return(tt._OrtAppendExecutionProvider=tt.asm.Oa).apply(null,arguments)},tt._OrtAddSessionConfigEntry=function(){return(tt._OrtAddSessionConfigEntry=tt.asm.Pa).apply(null,arguments)},tt._OrtReleaseSessionOptions=function(){return(tt._OrtReleaseSessionOptions=tt.asm.Qa).apply(null,arguments)},tt._OrtCreateSession=function(){return(tt._OrtCreateSession=tt.asm.Ra).apply(null,arguments)},tt._OrtReleaseSession=function(){return(tt._OrtReleaseSession=tt.asm.Sa).apply(null,arguments)},tt._OrtGetInputCount=function(){return(tt._OrtGetInputCount=tt.asm.Ta).apply(null,arguments)},tt._OrtGetOutputCount=function(){return(tt._OrtGetOutputCount=tt.asm.Ua).apply(null,arguments)},tt._OrtGetInputName=function(){return(tt._OrtGetInputName=tt.asm.Va).apply(null,arguments)},tt._OrtGetOutputName=function(){return(tt._OrtGetOutputName=tt.asm.Wa).apply(null,arguments)},tt._OrtFree=function(){return(tt._OrtFree=tt.asm.Xa).apply(null,arguments)},tt._OrtCreateTensor=function(){return(tt._OrtCreateTensor=tt.asm.Ya).apply(null,arguments)},tt._OrtGetTensorData=function(){return(tt._OrtGetTensorData=tt.asm.Za).apply(null,arguments)},tt._OrtReleaseTensor=function(){return(tt._OrtReleaseTensor=tt.asm._a).apply(null,arguments)},tt._OrtCreateRunOptions=function(){return(tt._OrtCreateRunOptions=tt.asm.$a).apply(null,arguments)},tt._OrtAddRunConfigEntry=function(){return(tt._OrtAddRunConfigEntry=tt.asm.ab).apply(null,arguments)},tt._OrtReleaseRunOptions=function(){return(tt._OrtReleaseRunOptions=tt.asm.bb).apply(null,arguments)},tt._OrtRun=function(){return(tt._OrtRun=tt.asm.cb).apply(null,arguments)},tt._OrtEndProfiling=function(){return(tt._OrtEndProfiling=tt.asm.db).apply(null,arguments)};var Sn,Pl=tt._malloc=function(){return(Pl=tt._malloc=tt.asm.eb).apply(null,arguments)},gn=tt._free=function(){return(gn=tt._free=tt.asm.fb).apply(null,arguments)},Rn=tt._fflush=function(){return(Rn=tt._fflush=tt.asm.gb).apply(null,arguments)},Yn=tt.___funcs_on_exit=function(){return(Yn=tt.___funcs_on_exit=tt.asm.hb).apply(null,arguments)},Jl=tt._setThrew=function(){return(Jl=tt._setThrew=tt.asm.jb).apply(null,arguments)},Kl=tt.stackSave=function(){return(Kl=tt.stackSave=tt.asm.kb).apply(null,arguments)},Hl=tt.stackRestore=function(){return(Hl=tt.stackRestore=tt.asm.lb).apply(null,arguments)},Jn=tt.stackAlloc=function(){return(Jn=tt.stackAlloc=tt.asm.mb).apply(null,arguments)},vn=tt.___cxa_can_catch=function(){return(vn=tt.___cxa_can_catch=tt.asm.nb).apply(null,arguments)},Pn=tt.___cxa_is_pointer_type=function(){return(Pn=tt.___cxa_is_pointer_type=tt.asm.ob).apply(null,arguments)},Fn=tt.dynCall_j=function(){return(Fn=tt.dynCall_j=tt.asm.pb).apply(null,arguments)},hn=tt.dynCall_iiiiij=function(){return(hn=tt.dynCall_iiiiij=tt.asm.qb).apply(null,arguments)},mn=tt.dynCall_jii=function(){return(mn=tt.dynCall_jii=tt.asm.rb).apply(null,arguments)},In=tt.dynCall_viiiiij=function(){return(In=tt.dynCall_viiiiij=tt.asm.sb).apply(null,arguments)},En=tt.dynCall_vjji=function(){return(En=tt.dynCall_vjji=tt.asm.tb).apply(null,arguments)},Bn=tt.dynCall_viiijjjii=function(){return(Bn=tt.dynCall_viiijjjii=tt.asm.ub).apply(null,arguments)},wn=tt.dynCall_iij=function(){return(wn=tt.dynCall_iij=tt.asm.vb).apply(null,arguments)},zn=tt.dynCall_ji=function(){return(zn=tt.dynCall_ji=tt.asm.wb).apply(null,arguments)},Hn=tt.dynCall_iiiiiij=function(){return(Hn=tt.dynCall_iiiiiij=tt.asm.xb).apply(null,arguments)},Tn=tt.dynCall_iiij=function(){return(Tn=tt.dynCall_iiij=tt.asm.yb).apply(null,arguments)};function Ln(){function It(){if(!Sn&&(Sn=!0,tt.calledRun=!0,!ft)){if(Fl(jt),ot(tt),tt.onRuntimeInitialized&&tt.onRuntimeInitialized(),tt.postRun)for(typeof tt.postRun=="function"&&(tt.postRun=[tt.postRun]);tt.postRun.length;){var Wt=tt.postRun.shift();Yl.unshift(Wt)}Fl(Yl)}}if(!(0{i.exports=function(o,s){for(var j=new Array(arguments.length-1),_e=0,lt=2,tt=!0;lt{var s=o;s.length=function(ot){var st=ot.length;if(!st)return 0;for(var ct=0;--st%4>1&&ot.charAt(st)==="=";)++ct;return Math.ceil(3*ot.length)/4-ct};for(var j=new Array(64),_e=new Array(123),lt=0;lt<64;)_e[j[lt]=lt<26?lt+65:lt<52?lt+71:lt<62?lt-4:lt-59|43]=lt++;s.encode=function(ot,st,ct){for(var it,$=null,a=[],et=0,nt=0;st>2],it=(3&at)<<4,nt=1;break;case 1:a[et++]=j[it|at>>4],it=(15&at)<<2,nt=2;break;case 2:a[et++]=j[it|at>>6],a[et++]=j[63&at],nt=0}et>8191&&(($||($=[])).push(String.fromCharCode.apply(String,a)),et=0)}return nt&&(a[et++]=j[it],a[et++]=61,nt===1&&(a[et++]=61)),$?(et&&$.push(String.fromCharCode.apply(String,a.slice(0,et))),$.join("")):String.fromCharCode.apply(String,a.slice(0,et))};var tt="invalid encoding";s.decode=function(ot,st,ct){for(var it,$=ct,a=0,et=0;et1)break;if((nt=_e[nt])===void 0)throw Error(tt);switch(a){case 0:it=nt,a=1;break;case 1:st[ct++]=it<<2|(48&nt)>>4,it=nt,a=2;break;case 2:st[ct++]=(15&it)<<4|(60&nt)>>2,it=nt,a=3;break;case 3:st[ct++]=(3&it)<<6|nt,a=0}}if(a===1)throw Error(tt);return ct-$},s.test=function(ot){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(ot)}},9211:i=>{function o(){this._listeners={}}i.exports=o,o.prototype.on=function(s,j,_e){return(this._listeners[s]||(this._listeners[s]=[])).push({fn:j,ctx:_e||this}),this},o.prototype.off=function(s,j){if(s===void 0)this._listeners={};else if(j===void 0)this._listeners[s]=[];else for(var _e=this._listeners[s],lt=0;lt<_e.length;)_e[lt].fn===j?_e.splice(lt,1):++lt;return this},o.prototype.emit=function(s){var j=this._listeners[s];if(j){for(var _e=[],lt=1;lt{function o(tt){return typeof Float32Array<"u"?function(){var ot=new Float32Array([-0]),st=new Uint8Array(ot.buffer),ct=st[3]===128;function it(nt,at,rt){ot[0]=nt,at[rt]=st[0],at[rt+1]=st[1],at[rt+2]=st[2],at[rt+3]=st[3]}function $(nt,at,rt){ot[0]=nt,at[rt]=st[3],at[rt+1]=st[2],at[rt+2]=st[1],at[rt+3]=st[0]}function a(nt,at){return st[0]=nt[at],st[1]=nt[at+1],st[2]=nt[at+2],st[3]=nt[at+3],ot[0]}function et(nt,at){return st[3]=nt[at],st[2]=nt[at+1],st[1]=nt[at+2],st[0]=nt[at+3],ot[0]}tt.writeFloatLE=ct?it:$,tt.writeFloatBE=ct?$:it,tt.readFloatLE=ct?a:et,tt.readFloatBE=ct?et:a}():function(){function ot(ct,it,$,a){var et=it<0?1:0;if(et&&(it=-it),it===0)ct(1/it>0?0:2147483648,$,a);else if(isNaN(it))ct(2143289344,$,a);else if(it>34028234663852886e22)ct((et<<31|2139095040)>>>0,$,a);else if(it<11754943508222875e-54)ct((et<<31|Math.round(it/1401298464324817e-60))>>>0,$,a);else{var nt=Math.floor(Math.log(it)/Math.LN2);ct((et<<31|nt+127<<23|8388607&Math.round(it*Math.pow(2,-nt)*8388608))>>>0,$,a)}}function st(ct,it,$){var a=ct(it,$),et=2*(a>>31)+1,nt=a>>>23&255,at=8388607&a;return nt===255?at?NaN:et*(1/0):nt===0?1401298464324817e-60*et*at:et*Math.pow(2,nt-150)*(at+8388608)}tt.writeFloatLE=ot.bind(null,s),tt.writeFloatBE=ot.bind(null,j),tt.readFloatLE=st.bind(null,_e),tt.readFloatBE=st.bind(null,lt)}(),typeof Float64Array<"u"?function(){var ot=new Float64Array([-0]),st=new Uint8Array(ot.buffer),ct=st[7]===128;function it(nt,at,rt){ot[0]=nt,at[rt]=st[0],at[rt+1]=st[1],at[rt+2]=st[2],at[rt+3]=st[3],at[rt+4]=st[4],at[rt+5]=st[5],at[rt+6]=st[6],at[rt+7]=st[7]}function $(nt,at,rt){ot[0]=nt,at[rt]=st[7],at[rt+1]=st[6],at[rt+2]=st[5],at[rt+3]=st[4],at[rt+4]=st[3],at[rt+5]=st[2],at[rt+6]=st[1],at[rt+7]=st[0]}function a(nt,at){return st[0]=nt[at],st[1]=nt[at+1],st[2]=nt[at+2],st[3]=nt[at+3],st[4]=nt[at+4],st[5]=nt[at+5],st[6]=nt[at+6],st[7]=nt[at+7],ot[0]}function et(nt,at){return st[7]=nt[at],st[6]=nt[at+1],st[5]=nt[at+2],st[4]=nt[at+3],st[3]=nt[at+4],st[2]=nt[at+5],st[1]=nt[at+6],st[0]=nt[at+7],ot[0]}tt.writeDoubleLE=ct?it:$,tt.writeDoubleBE=ct?$:it,tt.readDoubleLE=ct?a:et,tt.readDoubleBE=ct?et:a}():function(){function ot(ct,it,$,a,et,nt){var at=a<0?1:0;if(at&&(a=-a),a===0)ct(0,et,nt+it),ct(1/a>0?0:2147483648,et,nt+$);else if(isNaN(a))ct(0,et,nt+it),ct(2146959360,et,nt+$);else if(a>17976931348623157e292)ct(0,et,nt+it),ct((at<<31|2146435072)>>>0,et,nt+$);else{var rt;if(a<22250738585072014e-324)ct((rt=a/5e-324)>>>0,et,nt+it),ct((at<<31|rt/4294967296)>>>0,et,nt+$);else{var dt=Math.floor(Math.log(a)/Math.LN2);dt===1024&&(dt=1023),ct(4503599627370496*(rt=a*Math.pow(2,-dt))>>>0,et,nt+it),ct((at<<31|dt+1023<<20|1048576*rt&1048575)>>>0,et,nt+$)}}}function st(ct,it,$,a,et){var nt=ct(a,et+it),at=ct(a,et+$),rt=2*(at>>31)+1,dt=at>>>20&2047,ut=4294967296*(1048575&at)+nt;return dt===2047?ut?NaN:rt*(1/0):dt===0?5e-324*rt*ut:rt*Math.pow(2,dt-1075)*(ut+4503599627370496)}tt.writeDoubleLE=ot.bind(null,s,0,4),tt.writeDoubleBE=ot.bind(null,j,4,0),tt.readDoubleLE=st.bind(null,_e,0,4),tt.readDoubleBE=st.bind(null,lt,4,0)}(),tt}function s(tt,ot,st){ot[st]=255&tt,ot[st+1]=tt>>>8&255,ot[st+2]=tt>>>16&255,ot[st+3]=tt>>>24}function j(tt,ot,st){ot[st]=tt>>>24,ot[st+1]=tt>>>16&255,ot[st+2]=tt>>>8&255,ot[st+3]=255&tt}function _e(tt,ot){return(tt[ot]|tt[ot+1]<<8|tt[ot+2]<<16|tt[ot+3]<<24)>>>0}function lt(tt,ot){return(tt[ot]<<24|tt[ot+1]<<16|tt[ot+2]<<8|tt[ot+3])>>>0}i.exports=o(o)},7199:module=>{function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(i){}return null}module.exports=inquire},6662:i=>{i.exports=function(o,s,j){var _e=j||8192,lt=_e>>>1,tt=null,ot=_e;return function(st){if(st<1||st>lt)return o(st);ot+st>_e&&(tt=o(_e),ot=0);var ct=s.call(tt,ot,ot+=st);return 7&ot&&(ot=1+(7|ot)),ct}}},4997:(i,o)=>{var s=o;s.length=function(j){for(var _e=0,lt=0,tt=0;tt191&&tt<224?st[ct++]=(31&tt)<<6|63&j[_e++]:tt>239&&tt<365?(tt=((7&tt)<<18|(63&j[_e++])<<12|(63&j[_e++])<<6|63&j[_e++])-65536,st[ct++]=55296+(tt>>10),st[ct++]=56320+(1023&tt)):st[ct++]=(15&tt)<<12|(63&j[_e++])<<6|63&j[_e++],ct>8191&&((ot||(ot=[])).push(String.fromCharCode.apply(String,st)),ct=0);return ot?(ct&&ot.push(String.fromCharCode.apply(String,st.slice(0,ct))),ot.join("")):String.fromCharCode.apply(String,st.slice(0,ct))},s.write=function(j,_e,lt){for(var tt,ot,st=lt,ct=0;ct>6|192,_e[lt++]=63&tt|128):(64512&tt)==55296&&(64512&(ot=j.charCodeAt(ct+1)))==56320?(tt=65536+((1023&tt)<<10)+(1023&ot),++ct,_e[lt++]=tt>>18|240,_e[lt++]=tt>>12&63|128,_e[lt++]=tt>>6&63|128,_e[lt++]=63&tt|128):(_e[lt++]=tt>>12|224,_e[lt++]=tt>>6&63|128,_e[lt++]=63&tt|128);return lt-st}},3442:(i,o)=>{o.__esModule=!0;var s=function(){function j(_e){if(!_e)throw new TypeError("Invalid argument; `value` has no value.");this.value=j.EMPTY,_e&&j.isGuid(_e)&&(this.value=_e)}return j.isGuid=function(_e){var lt=_e.toString();return _e&&(_e instanceof j||j.validator.test(lt))},j.create=function(){return new j([j.gen(2),j.gen(1),j.gen(1),j.gen(1),j.gen(3)].join("-"))},j.createEmpty=function(){return new j("emptyguid")},j.parse=function(_e){return new j(_e)},j.raw=function(){return[j.gen(2),j.gen(1),j.gen(1),j.gen(1),j.gen(3)].join("-")},j.gen=function(_e){for(var lt="",tt=0;tt<_e;tt++)lt+=(65536*(1+Math.random())|0).toString(16).substring(1);return lt},j.prototype.equals=function(_e){return j.isGuid(_e)&&this.value===_e.toString()},j.prototype.isEmpty=function(){return this.value===j.EMPTY},j.prototype.toString=function(){return this.value},j.prototype.toJSON=function(){return{value:this.value}},j.validator=new RegExp("^[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}$","i"),j.EMPTY="00000000-0000-0000-0000-000000000000",j}();o.Guid=s},3720:i=>{i.exports=s;var o=null;try{o=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function s(Xt,Vt,Yt){this.low=0|Xt,this.high=0|Vt,this.unsigned=!!Yt}function j(Xt){return(Xt&&Xt.__isLong__)===!0}s.prototype.__isLong__,Object.defineProperty(s.prototype,"__isLong__",{value:!0}),s.isLong=j;var _e={},lt={};function tt(Xt,Vt){var Yt,St,Lt;return Vt?(Lt=0<=(Xt>>>=0)&&Xt<256)&&(St=lt[Xt])?St:(Yt=st(Xt,(0|Xt)<0?-1:0,!0),Lt&&(lt[Xt]=Yt),Yt):(Lt=-128<=(Xt|=0)&&Xt<128)&&(St=_e[Xt])?St:(Yt=st(Xt,Xt<0?-1:0,!1),Lt&&(_e[Xt]=Yt),Yt)}function ot(Xt,Vt){if(isNaN(Xt))return Vt?dt:rt;if(Vt){if(Xt<0)return dt;if(Xt>=et)return Zt}else{if(Xt<=-nt)return ht;if(Xt+1>=nt)return pt}return Xt<0?ot(-Xt,Vt).neg():st(Xt%a|0,Xt/a|0,Vt)}function st(Xt,Vt,Yt){return new s(Xt,Vt,Yt)}s.fromInt=tt,s.fromNumber=ot,s.fromBits=st;var ct=Math.pow;function it(Xt,Vt,Yt){if(Xt.length===0)throw Error("empty string");if(Xt==="NaN"||Xt==="Infinity"||Xt==="+Infinity"||Xt==="-Infinity")return rt;if(typeof Vt=="number"?(Yt=Vt,Vt=!1):Vt=!!Vt,(Yt=Yt||10)<2||360)throw Error("interior hyphen");if(St===0)return it(Xt.substring(1),Vt,Yt).neg();for(var Lt=ot(ct(Yt,8)),Ct=rt,Tt=0;Tt>>0:this.low},Gt.toNumber=function(){return this.unsigned?(this.high>>>0)*a+(this.low>>>0):this.high*a+(this.low>>>0)},Gt.toString=function(Xt){if((Xt=Xt||10)<2||36>>0).toString(Xt);if((Ct=ft).isZero())return Ft+Tt;for(;Ft.length<6;)Ft="0"+Ft;Tt=""+Ft+Tt}},Gt.getHighBits=function(){return this.high},Gt.getHighBitsUnsigned=function(){return this.high>>>0},Gt.getLowBits=function(){return this.low},Gt.getLowBitsUnsigned=function(){return this.low>>>0},Gt.getNumBitsAbs=function(){if(this.isNegative())return this.eq(ht)?64:this.neg().getNumBitsAbs();for(var Xt=this.high!=0?this.high:this.low,Vt=31;Vt>0&&!(Xt&1<=0},Gt.isOdd=function(){return(1&this.low)==1},Gt.isEven=function(){return(1&this.low)==0},Gt.equals=function(Xt){return j(Xt)||(Xt=$(Xt)),(this.unsigned===Xt.unsigned||this.high>>>31!=1||Xt.high>>>31!=1)&&this.high===Xt.high&&this.low===Xt.low},Gt.eq=Gt.equals,Gt.notEquals=function(Xt){return!this.eq(Xt)},Gt.neq=Gt.notEquals,Gt.ne=Gt.notEquals,Gt.lessThan=function(Xt){return this.comp(Xt)<0},Gt.lt=Gt.lessThan,Gt.lessThanOrEqual=function(Xt){return this.comp(Xt)<=0},Gt.lte=Gt.lessThanOrEqual,Gt.le=Gt.lessThanOrEqual,Gt.greaterThan=function(Xt){return this.comp(Xt)>0},Gt.gt=Gt.greaterThan,Gt.greaterThanOrEqual=function(Xt){return this.comp(Xt)>=0},Gt.gte=Gt.greaterThanOrEqual,Gt.ge=Gt.greaterThanOrEqual,Gt.compare=function(Xt){if(j(Xt)||(Xt=$(Xt)),this.eq(Xt))return 0;var Vt=this.isNegative(),Yt=Xt.isNegative();return Vt&&!Yt?-1:!Vt&&Yt?1:this.unsigned?Xt.high>>>0>this.high>>>0||Xt.high===this.high&&Xt.low>>>0>this.low>>>0?-1:1:this.sub(Xt).isNegative()?-1:1},Gt.comp=Gt.compare,Gt.negate=function(){return!this.unsigned&&this.eq(ht)?ht:this.not().add(ut)},Gt.neg=Gt.negate,Gt.add=function(Xt){j(Xt)||(Xt=$(Xt));var Vt=this.high>>>16,Yt=65535&this.high,St=this.low>>>16,Lt=65535&this.low,Ct=Xt.high>>>16,Tt=65535&Xt.high,ft=Xt.low>>>16,Ft=0,Jt=0,Ht=0,wt=0;return Ht+=(wt+=Lt+(65535&Xt.low))>>>16,Jt+=(Ht+=St+ft)>>>16,Ft+=(Jt+=Yt+Tt)>>>16,Ft+=Vt+Ct,st((Ht&=65535)<<16|(wt&=65535),(Ft&=65535)<<16|(Jt&=65535),this.unsigned)},Gt.subtract=function(Xt){return j(Xt)||(Xt=$(Xt)),this.add(Xt.neg())},Gt.sub=Gt.subtract,Gt.multiply=function(Xt){if(this.isZero())return rt;if(j(Xt)||(Xt=$(Xt)),o)return st(o.mul(this.low,this.high,Xt.low,Xt.high),o.get_high(),this.unsigned);if(Xt.isZero())return rt;if(this.eq(ht))return Xt.isOdd()?ht:rt;if(Xt.eq(ht))return this.isOdd()?ht:rt;if(this.isNegative())return Xt.isNegative()?this.neg().mul(Xt.neg()):this.neg().mul(Xt).neg();if(Xt.isNegative())return this.mul(Xt.neg()).neg();if(this.lt(at)&&Xt.lt(at))return ot(this.toNumber()*Xt.toNumber(),this.unsigned);var Vt=this.high>>>16,Yt=65535&this.high,St=this.low>>>16,Lt=65535&this.low,Ct=Xt.high>>>16,Tt=65535&Xt.high,ft=Xt.low>>>16,Ft=65535&Xt.low,Jt=0,Ht=0,wt=0,Et=0;return wt+=(Et+=Lt*Ft)>>>16,Ht+=(wt+=St*Ft)>>>16,wt&=65535,Ht+=(wt+=Lt*ft)>>>16,Jt+=(Ht+=Yt*Ft)>>>16,Ht&=65535,Jt+=(Ht+=St*ft)>>>16,Ht&=65535,Jt+=(Ht+=Lt*Tt)>>>16,Jt+=Vt*Ft+Yt*ft+St*Tt+Lt*Ct,st((wt&=65535)<<16|(Et&=65535),(Jt&=65535)<<16|(Ht&=65535),this.unsigned)},Gt.mul=Gt.multiply,Gt.divide=function(Xt){if(j(Xt)||(Xt=$(Xt)),Xt.isZero())throw Error("division by zero");var Vt,Yt,St;if(o)return this.unsigned||this.high!==-2147483648||Xt.low!==-1||Xt.high!==-1?st((this.unsigned?o.div_u:o.div_s)(this.low,this.high,Xt.low,Xt.high),o.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?dt:rt;if(this.unsigned){if(Xt.unsigned||(Xt=Xt.toUnsigned()),Xt.gt(this))return dt;if(Xt.gt(this.shru(1)))return bt;St=dt}else{if(this.eq(ht))return Xt.eq(ut)||Xt.eq(mt)?ht:Xt.eq(ht)?ut:(Vt=this.shr(1).div(Xt).shl(1)).eq(rt)?Xt.isNegative()?ut:mt:(Yt=this.sub(Xt.mul(Vt)),St=Vt.add(Yt.div(Xt)));if(Xt.eq(ht))return this.unsigned?dt:rt;if(this.isNegative())return Xt.isNegative()?this.neg().div(Xt.neg()):this.neg().div(Xt).neg();if(Xt.isNegative())return this.div(Xt.neg()).neg();St=rt}for(Yt=this;Yt.gte(Xt);){Vt=Math.max(1,Math.floor(Yt.toNumber()/Xt.toNumber()));for(var Lt=Math.ceil(Math.log(Vt)/Math.LN2),Ct=Lt<=48?1:ct(2,Lt-48),Tt=ot(Vt),ft=Tt.mul(Xt);ft.isNegative()||ft.gt(Yt);)ft=(Tt=ot(Vt-=Ct,this.unsigned)).mul(Xt);Tt.isZero()&&(Tt=ut),St=St.add(Tt),Yt=Yt.sub(ft)}return St},Gt.div=Gt.divide,Gt.modulo=function(Xt){return j(Xt)||(Xt=$(Xt)),o?st((this.unsigned?o.rem_u:o.rem_s)(this.low,this.high,Xt.low,Xt.high),o.get_high(),this.unsigned):this.sub(this.div(Xt).mul(Xt))},Gt.mod=Gt.modulo,Gt.rem=Gt.modulo,Gt.not=function(){return st(~this.low,~this.high,this.unsigned)},Gt.and=function(Xt){return j(Xt)||(Xt=$(Xt)),st(this.low&Xt.low,this.high&Xt.high,this.unsigned)},Gt.or=function(Xt){return j(Xt)||(Xt=$(Xt)),st(this.low|Xt.low,this.high|Xt.high,this.unsigned)},Gt.xor=function(Xt){return j(Xt)||(Xt=$(Xt)),st(this.low^Xt.low,this.high^Xt.high,this.unsigned)},Gt.shiftLeft=function(Xt){return j(Xt)&&(Xt=Xt.toInt()),(Xt&=63)==0?this:Xt<32?st(this.low<>>32-Xt,this.unsigned):st(0,this.low<>>Xt|this.high<<32-Xt,this.high>>Xt,this.unsigned):st(this.high>>Xt-32,this.high>=0?0:-1,this.unsigned)},Gt.shr=Gt.shiftRight,Gt.shiftRightUnsigned=function(Xt){if(j(Xt)&&(Xt=Xt.toInt()),(Xt&=63)==0)return this;var Vt=this.high;return Xt<32?st(this.low>>>Xt|Vt<<32-Xt,Vt>>>Xt,this.unsigned):st(Xt===32?Vt:Vt>>>Xt-32,0,this.unsigned)},Gt.shru=Gt.shiftRightUnsigned,Gt.shr_u=Gt.shiftRightUnsigned,Gt.toSigned=function(){return this.unsigned?st(this.low,this.high,!1):this},Gt.toUnsigned=function(){return this.unsigned?this:st(this.low,this.high,!0)},Gt.toBytes=function(Xt){return Xt?this.toBytesLE():this.toBytesBE()},Gt.toBytesLE=function(){var Xt=this.high,Vt=this.low;return[255&Vt,Vt>>>8&255,Vt>>>16&255,Vt>>>24,255&Xt,Xt>>>8&255,Xt>>>16&255,Xt>>>24]},Gt.toBytesBE=function(){var Xt=this.high,Vt=this.low;return[Xt>>>24,Xt>>>16&255,Xt>>>8&255,255&Xt,Vt>>>24,Vt>>>16&255,Vt>>>8&255,255&Vt]},s.fromBytes=function(Xt,Vt,Yt){return Yt?s.fromBytesLE(Xt,Vt):s.fromBytesBE(Xt,Vt)},s.fromBytesLE=function(Xt,Vt){return new s(Xt[0]|Xt[1]<<8|Xt[2]<<16|Xt[3]<<24,Xt[4]|Xt[5]<<8|Xt[6]<<16|Xt[7]<<24,Vt)},s.fromBytesBE=function(Xt,Vt){return new s(Xt[4]<<24|Xt[5]<<16|Xt[6]<<8|Xt[7],Xt[0]<<24|Xt[1]<<16|Xt[2]<<8|Xt[3],Vt)}},1446:(i,o,s)=>{var j,_e,lt,tt=s(2100),ot=tt.Reader,st=tt.Writer,ct=tt.util,it=tt.roots.default||(tt.roots.default={});it.onnx=((lt={}).Version=(j={},(_e=Object.create(j))[j[0]="_START_VERSION"]=0,_e[j[1]="IR_VERSION_2017_10_10"]=1,_e[j[2]="IR_VERSION_2017_10_30"]=2,_e[j[3]="IR_VERSION_2017_11_3"]=3,_e[j[4]="IR_VERSION_2019_1_22"]=4,_e[j[5]="IR_VERSION"]=5,_e),lt.AttributeProto=function(){function $(a){if(this.floats=[],this.ints=[],this.strings=[],this.tensors=[],this.graphs=[],a)for(var et=Object.keys(a),nt=0;nt>>3){case 1:at.name=a.string();break;case 21:at.refAttrName=a.string();break;case 13:at.docString=a.string();break;case 20:at.type=a.int32();break;case 2:at.f=a.float();break;case 3:at.i=a.int64();break;case 4:at.s=a.bytes();break;case 5:at.t=it.onnx.TensorProto.decode(a,a.uint32());break;case 6:at.g=it.onnx.GraphProto.decode(a,a.uint32());break;case 7:if(at.floats&&at.floats.length||(at.floats=[]),(7&rt)==2)for(var dt=a.uint32()+a.pos;a.pos>>0,a.i.high>>>0).toNumber())),a.s!=null&&(typeof a.s=="string"?ct.base64.decode(a.s,et.s=ct.newBuffer(ct.base64.length(a.s)),0):a.s.length&&(et.s=a.s)),a.t!=null){if(typeof a.t!="object")throw TypeError(".onnx.AttributeProto.t: object expected");et.t=it.onnx.TensorProto.fromObject(a.t)}if(a.g!=null){if(typeof a.g!="object")throw TypeError(".onnx.AttributeProto.g: object expected");et.g=it.onnx.GraphProto.fromObject(a.g)}if(a.floats){if(!Array.isArray(a.floats))throw TypeError(".onnx.AttributeProto.floats: array expected");et.floats=[];for(var nt=0;nt>>0,a.ints[nt].high>>>0).toNumber())}if(a.strings){if(!Array.isArray(a.strings))throw TypeError(".onnx.AttributeProto.strings: array expected");for(et.strings=[],nt=0;nt>>0,a.i.high>>>0).toNumber():a.i),a.s!=null&&a.hasOwnProperty("s")&&(nt.s=et.bytes===String?ct.base64.encode(a.s,0,a.s.length):et.bytes===Array?Array.prototype.slice.call(a.s):a.s),a.t!=null&&a.hasOwnProperty("t")&&(nt.t=it.onnx.TensorProto.toObject(a.t,et)),a.g!=null&&a.hasOwnProperty("g")&&(nt.g=it.onnx.GraphProto.toObject(a.g,et)),a.floats&&a.floats.length){nt.floats=[];for(var rt=0;rt>>0,a.ints[rt].high>>>0).toNumber():a.ints[rt];if(a.strings&&a.strings.length)for(nt.strings=[],rt=0;rt>>3){case 1:at.name=a.string();break;case 2:at.type=it.onnx.TypeProto.decode(a,a.uint32());break;case 3:at.docString=a.string();break;default:a.skipType(7&rt)}}return at},$.decodeDelimited=function(a){return a instanceof ot||(a=new ot(a)),this.decode(a,a.uint32())},$.verify=function(a){if(typeof a!="object"||a===null)return"object expected";if(a.name!=null&&a.hasOwnProperty("name")&&!ct.isString(a.name))return"name: string expected";if(a.type!=null&&a.hasOwnProperty("type")){var et=it.onnx.TypeProto.verify(a.type);if(et)return"type."+et}return a.docString!=null&&a.hasOwnProperty("docString")&&!ct.isString(a.docString)?"docString: string expected":null},$.fromObject=function(a){if(a instanceof it.onnx.ValueInfoProto)return a;var et=new it.onnx.ValueInfoProto;if(a.name!=null&&(et.name=String(a.name)),a.type!=null){if(typeof a.type!="object")throw TypeError(".onnx.ValueInfoProto.type: object expected");et.type=it.onnx.TypeProto.fromObject(a.type)}return a.docString!=null&&(et.docString=String(a.docString)),et},$.toObject=function(a,et){et||(et={});var nt={};return et.defaults&&(nt.name="",nt.type=null,nt.docString=""),a.name!=null&&a.hasOwnProperty("name")&&(nt.name=a.name),a.type!=null&&a.hasOwnProperty("type")&&(nt.type=it.onnx.TypeProto.toObject(a.type,et)),a.docString!=null&&a.hasOwnProperty("docString")&&(nt.docString=a.docString),nt},$.prototype.toJSON=function(){return this.constructor.toObject(this,tt.util.toJSONOptions)},$}(),lt.NodeProto=function(){function $(a){if(this.input=[],this.output=[],this.attribute=[],a)for(var et=Object.keys(a),nt=0;nt>>3){case 1:at.input&&at.input.length||(at.input=[]),at.input.push(a.string());break;case 2:at.output&&at.output.length||(at.output=[]),at.output.push(a.string());break;case 3:at.name=a.string();break;case 4:at.opType=a.string();break;case 7:at.domain=a.string();break;case 5:at.attribute&&at.attribute.length||(at.attribute=[]),at.attribute.push(it.onnx.AttributeProto.decode(a,a.uint32()));break;case 6:at.docString=a.string();break;default:a.skipType(7&rt)}}return at},$.decodeDelimited=function(a){return a instanceof ot||(a=new ot(a)),this.decode(a,a.uint32())},$.verify=function(a){if(typeof a!="object"||a===null)return"object expected";if(a.input!=null&&a.hasOwnProperty("input")){if(!Array.isArray(a.input))return"input: array expected";for(var et=0;et>>3){case 1:at.irVersion=a.int64();break;case 8:at.opsetImport&&at.opsetImport.length||(at.opsetImport=[]),at.opsetImport.push(it.onnx.OperatorSetIdProto.decode(a,a.uint32()));break;case 2:at.producerName=a.string();break;case 3:at.producerVersion=a.string();break;case 4:at.domain=a.string();break;case 5:at.modelVersion=a.int64();break;case 6:at.docString=a.string();break;case 7:at.graph=it.onnx.GraphProto.decode(a,a.uint32());break;case 14:at.metadataProps&&at.metadataProps.length||(at.metadataProps=[]),at.metadataProps.push(it.onnx.StringStringEntryProto.decode(a,a.uint32()));break;default:a.skipType(7&rt)}}return at},$.decodeDelimited=function(a){return a instanceof ot||(a=new ot(a)),this.decode(a,a.uint32())},$.verify=function(a){if(typeof a!="object"||a===null)return"object expected";if(a.irVersion!=null&&a.hasOwnProperty("irVersion")&&!(ct.isInteger(a.irVersion)||a.irVersion&&ct.isInteger(a.irVersion.low)&&ct.isInteger(a.irVersion.high)))return"irVersion: integer|Long expected";if(a.opsetImport!=null&&a.hasOwnProperty("opsetImport")){if(!Array.isArray(a.opsetImport))return"opsetImport: array expected";for(var et=0;et>>0,a.irVersion.high>>>0).toNumber())),a.opsetImport){if(!Array.isArray(a.opsetImport))throw TypeError(".onnx.ModelProto.opsetImport: array expected");et.opsetImport=[];for(var nt=0;nt>>0,a.modelVersion.high>>>0).toNumber())),a.docString!=null&&(et.docString=String(a.docString)),a.graph!=null){if(typeof a.graph!="object")throw TypeError(".onnx.ModelProto.graph: object expected");et.graph=it.onnx.GraphProto.fromObject(a.graph)}if(a.metadataProps){if(!Array.isArray(a.metadataProps))throw TypeError(".onnx.ModelProto.metadataProps: array expected");for(et.metadataProps=[],nt=0;nt>>0,a.irVersion.high>>>0).toNumber():a.irVersion),a.producerName!=null&&a.hasOwnProperty("producerName")&&(nt.producerName=a.producerName),a.producerVersion!=null&&a.hasOwnProperty("producerVersion")&&(nt.producerVersion=a.producerVersion),a.domain!=null&&a.hasOwnProperty("domain")&&(nt.domain=a.domain),a.modelVersion!=null&&a.hasOwnProperty("modelVersion")&&(typeof a.modelVersion=="number"?nt.modelVersion=et.longs===String?String(a.modelVersion):a.modelVersion:nt.modelVersion=et.longs===String?ct.Long.prototype.toString.call(a.modelVersion):et.longs===Number?new ct.LongBits(a.modelVersion.low>>>0,a.modelVersion.high>>>0).toNumber():a.modelVersion),a.docString!=null&&a.hasOwnProperty("docString")&&(nt.docString=a.docString),a.graph!=null&&a.hasOwnProperty("graph")&&(nt.graph=it.onnx.GraphProto.toObject(a.graph,et)),a.opsetImport&&a.opsetImport.length){nt.opsetImport=[];for(var rt=0;rt>>3){case 1:at.key=a.string();break;case 2:at.value=a.string();break;default:a.skipType(7&rt)}}return at},$.decodeDelimited=function(a){return a instanceof ot||(a=new ot(a)),this.decode(a,a.uint32())},$.verify=function(a){return typeof a!="object"||a===null?"object expected":a.key!=null&&a.hasOwnProperty("key")&&!ct.isString(a.key)?"key: string expected":a.value!=null&&a.hasOwnProperty("value")&&!ct.isString(a.value)?"value: string expected":null},$.fromObject=function(a){if(a instanceof it.onnx.StringStringEntryProto)return a;var et=new it.onnx.StringStringEntryProto;return a.key!=null&&(et.key=String(a.key)),a.value!=null&&(et.value=String(a.value)),et},$.toObject=function(a,et){et||(et={});var nt={};return et.defaults&&(nt.key="",nt.value=""),a.key!=null&&a.hasOwnProperty("key")&&(nt.key=a.key),a.value!=null&&a.hasOwnProperty("value")&&(nt.value=a.value),nt},$.prototype.toJSON=function(){return this.constructor.toObject(this,tt.util.toJSONOptions)},$}(),lt.TensorAnnotation=function(){function $(a){if(this.quantParameterTensorNames=[],a)for(var et=Object.keys(a),nt=0;nt>>3){case 1:at.tensorName=a.string();break;case 2:at.quantParameterTensorNames&&at.quantParameterTensorNames.length||(at.quantParameterTensorNames=[]),at.quantParameterTensorNames.push(it.onnx.StringStringEntryProto.decode(a,a.uint32()));break;default:a.skipType(7&rt)}}return at},$.decodeDelimited=function(a){return a instanceof ot||(a=new ot(a)),this.decode(a,a.uint32())},$.verify=function(a){if(typeof a!="object"||a===null)return"object expected";if(a.tensorName!=null&&a.hasOwnProperty("tensorName")&&!ct.isString(a.tensorName))return"tensorName: string expected";if(a.quantParameterTensorNames!=null&&a.hasOwnProperty("quantParameterTensorNames")){if(!Array.isArray(a.quantParameterTensorNames))return"quantParameterTensorNames: array expected";for(var et=0;et>>3){case 1:at.node&&at.node.length||(at.node=[]),at.node.push(it.onnx.NodeProto.decode(a,a.uint32()));break;case 2:at.name=a.string();break;case 5:at.initializer&&at.initializer.length||(at.initializer=[]),at.initializer.push(it.onnx.TensorProto.decode(a,a.uint32()));break;case 10:at.docString=a.string();break;case 11:at.input&&at.input.length||(at.input=[]),at.input.push(it.onnx.ValueInfoProto.decode(a,a.uint32()));break;case 12:at.output&&at.output.length||(at.output=[]),at.output.push(it.onnx.ValueInfoProto.decode(a,a.uint32()));break;case 13:at.valueInfo&&at.valueInfo.length||(at.valueInfo=[]),at.valueInfo.push(it.onnx.ValueInfoProto.decode(a,a.uint32()));break;case 14:at.quantizationAnnotation&&at.quantizationAnnotation.length||(at.quantizationAnnotation=[]),at.quantizationAnnotation.push(it.onnx.TensorAnnotation.decode(a,a.uint32()));break;default:a.skipType(7&rt)}}return at},$.decodeDelimited=function(a){return a instanceof ot||(a=new ot(a)),this.decode(a,a.uint32())},$.verify=function(a){if(typeof a!="object"||a===null)return"object expected";if(a.node!=null&&a.hasOwnProperty("node")){if(!Array.isArray(a.node))return"node: array expected";for(var et=0;et>>3){case 1:if(at.dims&&at.dims.length||(at.dims=[]),(7&rt)==2)for(var dt=a.uint32()+a.pos;a.pos>>0,a.dims[nt].high>>>0).toNumber())}if(a.dataType!=null&&(et.dataType=0|a.dataType),a.segment!=null){if(typeof a.segment!="object")throw TypeError(".onnx.TensorProto.segment: object expected");et.segment=it.onnx.TensorProto.Segment.fromObject(a.segment)}if(a.floatData){if(!Array.isArray(a.floatData))throw TypeError(".onnx.TensorProto.floatData: array expected");for(et.floatData=[],nt=0;nt>>0,a.int64Data[nt].high>>>0).toNumber())}if(a.name!=null&&(et.name=String(a.name)),a.docString!=null&&(et.docString=String(a.docString)),a.rawData!=null&&(typeof a.rawData=="string"?ct.base64.decode(a.rawData,et.rawData=ct.newBuffer(ct.base64.length(a.rawData)),0):a.rawData.length&&(et.rawData=a.rawData)),a.externalData){if(!Array.isArray(a.externalData))throw TypeError(".onnx.TensorProto.externalData: array expected");for(et.externalData=[],nt=0;nt>>0,a.uint64Data[nt].high>>>0).toNumber(!0))}return et},$.toObject=function(a,et){et||(et={});var nt={};if((et.arrays||et.defaults)&&(nt.dims=[],nt.floatData=[],nt.int32Data=[],nt.stringData=[],nt.int64Data=[],nt.doubleData=[],nt.uint64Data=[],nt.externalData=[]),et.defaults&&(nt.dataType=0,nt.segment=null,nt.name="",et.bytes===String?nt.rawData="":(nt.rawData=[],et.bytes!==Array&&(nt.rawData=ct.newBuffer(nt.rawData))),nt.docString="",nt.dataLocation=et.enums===String?"DEFAULT":0),a.dims&&a.dims.length){nt.dims=[];for(var at=0;at>>0,a.dims[at].high>>>0).toNumber():a.dims[at]}if(a.dataType!=null&&a.hasOwnProperty("dataType")&&(nt.dataType=a.dataType),a.segment!=null&&a.hasOwnProperty("segment")&&(nt.segment=it.onnx.TensorProto.Segment.toObject(a.segment,et)),a.floatData&&a.floatData.length)for(nt.floatData=[],at=0;at>>0,a.int64Data[at].high>>>0).toNumber():a.int64Data[at];if(a.name!=null&&a.hasOwnProperty("name")&&(nt.name=a.name),a.rawData!=null&&a.hasOwnProperty("rawData")&&(nt.rawData=et.bytes===String?ct.base64.encode(a.rawData,0,a.rawData.length):et.bytes===Array?Array.prototype.slice.call(a.rawData):a.rawData),a.doubleData&&a.doubleData.length)for(nt.doubleData=[],at=0;at>>0,a.uint64Data[at].high>>>0).toNumber(!0):a.uint64Data[at];if(a.docString!=null&&a.hasOwnProperty("docString")&&(nt.docString=a.docString),a.externalData&&a.externalData.length)for(nt.externalData=[],at=0;at>>3){case 1:rt.begin=et.int64();break;case 2:rt.end=et.int64();break;default:et.skipType(7&dt)}}return rt},a.decodeDelimited=function(et){return et instanceof ot||(et=new ot(et)),this.decode(et,et.uint32())},a.verify=function(et){return typeof et!="object"||et===null?"object expected":et.begin!=null&&et.hasOwnProperty("begin")&&!(ct.isInteger(et.begin)||et.begin&&ct.isInteger(et.begin.low)&&ct.isInteger(et.begin.high))?"begin: integer|Long expected":et.end!=null&&et.hasOwnProperty("end")&&!(ct.isInteger(et.end)||et.end&&ct.isInteger(et.end.low)&&ct.isInteger(et.end.high))?"end: integer|Long expected":null},a.fromObject=function(et){if(et instanceof it.onnx.TensorProto.Segment)return et;var nt=new it.onnx.TensorProto.Segment;return et.begin!=null&&(ct.Long?(nt.begin=ct.Long.fromValue(et.begin)).unsigned=!1:typeof et.begin=="string"?nt.begin=parseInt(et.begin,10):typeof et.begin=="number"?nt.begin=et.begin:typeof et.begin=="object"&&(nt.begin=new ct.LongBits(et.begin.low>>>0,et.begin.high>>>0).toNumber())),et.end!=null&&(ct.Long?(nt.end=ct.Long.fromValue(et.end)).unsigned=!1:typeof et.end=="string"?nt.end=parseInt(et.end,10):typeof et.end=="number"?nt.end=et.end:typeof et.end=="object"&&(nt.end=new ct.LongBits(et.end.low>>>0,et.end.high>>>0).toNumber())),nt},a.toObject=function(et,nt){nt||(nt={});var at={};if(nt.defaults){if(ct.Long){var rt=new ct.Long(0,0,!1);at.begin=nt.longs===String?rt.toString():nt.longs===Number?rt.toNumber():rt}else at.begin=nt.longs===String?"0":0;ct.Long?(rt=new ct.Long(0,0,!1),at.end=nt.longs===String?rt.toString():nt.longs===Number?rt.toNumber():rt):at.end=nt.longs===String?"0":0}return et.begin!=null&&et.hasOwnProperty("begin")&&(typeof et.begin=="number"?at.begin=nt.longs===String?String(et.begin):et.begin:at.begin=nt.longs===String?ct.Long.prototype.toString.call(et.begin):nt.longs===Number?new ct.LongBits(et.begin.low>>>0,et.begin.high>>>0).toNumber():et.begin),et.end!=null&&et.hasOwnProperty("end")&&(typeof et.end=="number"?at.end=nt.longs===String?String(et.end):et.end:at.end=nt.longs===String?ct.Long.prototype.toString.call(et.end):nt.longs===Number?new ct.LongBits(et.end.low>>>0,et.end.high>>>0).toNumber():et.end),at},a.prototype.toJSON=function(){return this.constructor.toObject(this,tt.util.toJSONOptions)},a}(),$.DataLocation=function(){var a={},et=Object.create(a);return et[a[0]="DEFAULT"]=0,et[a[1]="EXTERNAL"]=1,et}(),$}(),lt.TensorShapeProto=function(){function $(a){if(this.dim=[],a)for(var et=Object.keys(a),nt=0;nt>>3==1?(at.dim&&at.dim.length||(at.dim=[]),at.dim.push(it.onnx.TensorShapeProto.Dimension.decode(a,a.uint32()))):a.skipType(7&rt)}return at},$.decodeDelimited=function(a){return a instanceof ot||(a=new ot(a)),this.decode(a,a.uint32())},$.verify=function(a){if(typeof a!="object"||a===null)return"object expected";if(a.dim!=null&&a.hasOwnProperty("dim")){if(!Array.isArray(a.dim))return"dim: array expected";for(var et=0;et>>3){case 1:dt.dimValue=nt.int64();break;case 2:dt.dimParam=nt.string();break;case 3:dt.denotation=nt.string();break;default:nt.skipType(7&ut)}}return dt},a.decodeDelimited=function(nt){return nt instanceof ot||(nt=new ot(nt)),this.decode(nt,nt.uint32())},a.verify=function(nt){if(typeof nt!="object"||nt===null)return"object expected";var at={};if(nt.dimValue!=null&&nt.hasOwnProperty("dimValue")&&(at.value=1,!(ct.isInteger(nt.dimValue)||nt.dimValue&&ct.isInteger(nt.dimValue.low)&&ct.isInteger(nt.dimValue.high))))return"dimValue: integer|Long expected";if(nt.dimParam!=null&&nt.hasOwnProperty("dimParam")){if(at.value===1)return"value: multiple values";if(at.value=1,!ct.isString(nt.dimParam))return"dimParam: string expected"}return nt.denotation!=null&&nt.hasOwnProperty("denotation")&&!ct.isString(nt.denotation)?"denotation: string expected":null},a.fromObject=function(nt){if(nt instanceof it.onnx.TensorShapeProto.Dimension)return nt;var at=new it.onnx.TensorShapeProto.Dimension;return nt.dimValue!=null&&(ct.Long?(at.dimValue=ct.Long.fromValue(nt.dimValue)).unsigned=!1:typeof nt.dimValue=="string"?at.dimValue=parseInt(nt.dimValue,10):typeof nt.dimValue=="number"?at.dimValue=nt.dimValue:typeof nt.dimValue=="object"&&(at.dimValue=new ct.LongBits(nt.dimValue.low>>>0,nt.dimValue.high>>>0).toNumber())),nt.dimParam!=null&&(at.dimParam=String(nt.dimParam)),nt.denotation!=null&&(at.denotation=String(nt.denotation)),at},a.toObject=function(nt,at){at||(at={});var rt={};return at.defaults&&(rt.denotation=""),nt.dimValue!=null&&nt.hasOwnProperty("dimValue")&&(typeof nt.dimValue=="number"?rt.dimValue=at.longs===String?String(nt.dimValue):nt.dimValue:rt.dimValue=at.longs===String?ct.Long.prototype.toString.call(nt.dimValue):at.longs===Number?new ct.LongBits(nt.dimValue.low>>>0,nt.dimValue.high>>>0).toNumber():nt.dimValue,at.oneofs&&(rt.value="dimValue")),nt.dimParam!=null&&nt.hasOwnProperty("dimParam")&&(rt.dimParam=nt.dimParam,at.oneofs&&(rt.value="dimParam")),nt.denotation!=null&&nt.hasOwnProperty("denotation")&&(rt.denotation=nt.denotation),rt},a.prototype.toJSON=function(){return this.constructor.toObject(this,tt.util.toJSONOptions)},a}(),$}(),lt.TypeProto=function(){function $(et){if(et)for(var nt=Object.keys(et),at=0;at>>3){case 1:rt.tensorType=it.onnx.TypeProto.Tensor.decode(et,et.uint32());break;case 6:rt.denotation=et.string();break;default:et.skipType(7&dt)}}return rt},$.decodeDelimited=function(et){return et instanceof ot||(et=new ot(et)),this.decode(et,et.uint32())},$.verify=function(et){if(typeof et!="object"||et===null)return"object expected";if(et.tensorType!=null&&et.hasOwnProperty("tensorType")){var nt=it.onnx.TypeProto.Tensor.verify(et.tensorType);if(nt)return"tensorType."+nt}return et.denotation!=null&&et.hasOwnProperty("denotation")&&!ct.isString(et.denotation)?"denotation: string expected":null},$.fromObject=function(et){if(et instanceof it.onnx.TypeProto)return et;var nt=new it.onnx.TypeProto;if(et.tensorType!=null){if(typeof et.tensorType!="object")throw TypeError(".onnx.TypeProto.tensorType: object expected");nt.tensorType=it.onnx.TypeProto.Tensor.fromObject(et.tensorType)}return et.denotation!=null&&(nt.denotation=String(et.denotation)),nt},$.toObject=function(et,nt){nt||(nt={});var at={};return nt.defaults&&(at.denotation=""),et.tensorType!=null&&et.hasOwnProperty("tensorType")&&(at.tensorType=it.onnx.TypeProto.Tensor.toObject(et.tensorType,nt),nt.oneofs&&(at.value="tensorType")),et.denotation!=null&&et.hasOwnProperty("denotation")&&(at.denotation=et.denotation),at},$.prototype.toJSON=function(){return this.constructor.toObject(this,tt.util.toJSONOptions)},$.Tensor=function(){function et(nt){if(nt)for(var at=Object.keys(nt),rt=0;rt>>3){case 1:dt.elemType=nt.int32();break;case 2:dt.shape=it.onnx.TensorShapeProto.decode(nt,nt.uint32());break;default:nt.skipType(7&ut)}}return dt},et.decodeDelimited=function(nt){return nt instanceof ot||(nt=new ot(nt)),this.decode(nt,nt.uint32())},et.verify=function(nt){if(typeof nt!="object"||nt===null)return"object expected";if(nt.elemType!=null&&nt.hasOwnProperty("elemType")&&!ct.isInteger(nt.elemType))return"elemType: integer expected";if(nt.shape!=null&&nt.hasOwnProperty("shape")){var at=it.onnx.TensorShapeProto.verify(nt.shape);if(at)return"shape."+at}return null},et.fromObject=function(nt){if(nt instanceof it.onnx.TypeProto.Tensor)return nt;var at=new it.onnx.TypeProto.Tensor;if(nt.elemType!=null&&(at.elemType=0|nt.elemType),nt.shape!=null){if(typeof nt.shape!="object")throw TypeError(".onnx.TypeProto.Tensor.shape: object expected");at.shape=it.onnx.TensorShapeProto.fromObject(nt.shape)}return at},et.toObject=function(nt,at){at||(at={});var rt={};return at.defaults&&(rt.elemType=0,rt.shape=null),nt.elemType!=null&&nt.hasOwnProperty("elemType")&&(rt.elemType=nt.elemType),nt.shape!=null&&nt.hasOwnProperty("shape")&&(rt.shape=it.onnx.TensorShapeProto.toObject(nt.shape,at)),rt},et.prototype.toJSON=function(){return this.constructor.toObject(this,tt.util.toJSONOptions)},et}(),$}(),lt.OperatorSetIdProto=function(){function $(a){if(a)for(var et=Object.keys(a),nt=0;nt>>3){case 1:at.domain=a.string();break;case 2:at.version=a.int64();break;default:a.skipType(7&rt)}}return at},$.decodeDelimited=function(a){return a instanceof ot||(a=new ot(a)),this.decode(a,a.uint32())},$.verify=function(a){return typeof a!="object"||a===null?"object expected":a.domain!=null&&a.hasOwnProperty("domain")&&!ct.isString(a.domain)?"domain: string expected":a.version!=null&&a.hasOwnProperty("version")&&!(ct.isInteger(a.version)||a.version&&ct.isInteger(a.version.low)&&ct.isInteger(a.version.high))?"version: integer|Long expected":null},$.fromObject=function(a){if(a instanceof it.onnx.OperatorSetIdProto)return a;var et=new it.onnx.OperatorSetIdProto;return a.domain!=null&&(et.domain=String(a.domain)),a.version!=null&&(ct.Long?(et.version=ct.Long.fromValue(a.version)).unsigned=!1:typeof a.version=="string"?et.version=parseInt(a.version,10):typeof a.version=="number"?et.version=a.version:typeof a.version=="object"&&(et.version=new ct.LongBits(a.version.low>>>0,a.version.high>>>0).toNumber())),et},$.toObject=function(a,et){et||(et={});var nt={};if(et.defaults)if(nt.domain="",ct.Long){var at=new ct.Long(0,0,!1);nt.version=et.longs===String?at.toString():et.longs===Number?at.toNumber():at}else nt.version=et.longs===String?"0":0;return a.domain!=null&&a.hasOwnProperty("domain")&&(nt.domain=a.domain),a.version!=null&&a.hasOwnProperty("version")&&(typeof a.version=="number"?nt.version=et.longs===String?String(a.version):a.version:nt.version=et.longs===String?ct.Long.prototype.toString.call(a.version):et.longs===Number?new ct.LongBits(a.version.low>>>0,a.version.high>>>0).toNumber():a.version),nt},$.prototype.toJSON=function(){return this.constructor.toObject(this,tt.util.toJSONOptions)},$}(),lt),i.exports=it},2100:(i,o,s)=>{i.exports=s(9482)},9482:(i,o,s)=>{var j=o;function _e(){j.util._configure(),j.Writer._configure(j.BufferWriter),j.Reader._configure(j.BufferReader)}j.build="minimal",j.Writer=s(1173),j.BufferWriter=s(3155),j.Reader=s(1408),j.BufferReader=s(593),j.util=s(9693),j.rpc=s(5994),j.roots=s(5054),j.configure=_e,_e()},1408:(i,o,s)=>{i.exports=st;var j,_e=s(9693),lt=_e.LongBits,tt=_e.utf8;function ot(at,rt){return RangeError("index out of range: "+at.pos+" + "+(rt||1)+" > "+at.len)}function st(at){this.buf=at,this.pos=0,this.len=at.length}var ct,it=typeof Uint8Array<"u"?function(at){if(at instanceof Uint8Array||Array.isArray(at))return new st(at);throw Error("illegal buffer")}:function(at){if(Array.isArray(at))return new st(at);throw Error("illegal buffer")},$=function(){return _e.Buffer?function(at){return(st.create=function(rt){return _e.Buffer.isBuffer(rt)?new j(rt):it(rt)})(at)}:it};function a(){var at=new lt(0,0),rt=0;if(!(this.len-this.pos>4)){for(;rt<3;++rt){if(this.pos>=this.len)throw ot(this);if(at.lo=(at.lo|(127&this.buf[this.pos])<<7*rt)>>>0,this.buf[this.pos++]<128)return at}return at.lo=(at.lo|(127&this.buf[this.pos++])<<7*rt)>>>0,at}for(;rt<4;++rt)if(at.lo=(at.lo|(127&this.buf[this.pos])<<7*rt)>>>0,this.buf[this.pos++]<128)return at;if(at.lo=(at.lo|(127&this.buf[this.pos])<<28)>>>0,at.hi=(at.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return at;if(rt=0,this.len-this.pos>4){for(;rt<5;++rt)if(at.hi=(at.hi|(127&this.buf[this.pos])<<7*rt+3)>>>0,this.buf[this.pos++]<128)return at}else for(;rt<5;++rt){if(this.pos>=this.len)throw ot(this);if(at.hi=(at.hi|(127&this.buf[this.pos])<<7*rt+3)>>>0,this.buf[this.pos++]<128)return at}throw Error("invalid varint encoding")}function et(at,rt){return(at[rt-4]|at[rt-3]<<8|at[rt-2]<<16|at[rt-1]<<24)>>>0}function nt(){if(this.pos+8>this.len)throw ot(this,8);return new lt(et(this.buf,this.pos+=4),et(this.buf,this.pos+=4))}st.create=$(),st.prototype._slice=_e.Array.prototype.subarray||_e.Array.prototype.slice,st.prototype.uint32=(ct=4294967295,function(){if(ct=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128||(ct=(ct|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)||(ct=(ct|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)||(ct=(ct|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)||(ct=(ct|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128))return ct;if((this.pos+=5)>this.len)throw this.pos=this.len,ot(this,10);return ct}),st.prototype.int32=function(){return 0|this.uint32()},st.prototype.sint32=function(){var at=this.uint32();return at>>>1^-(1&at)|0},st.prototype.bool=function(){return this.uint32()!==0},st.prototype.fixed32=function(){if(this.pos+4>this.len)throw ot(this,4);return et(this.buf,this.pos+=4)},st.prototype.sfixed32=function(){if(this.pos+4>this.len)throw ot(this,4);return 0|et(this.buf,this.pos+=4)},st.prototype.float=function(){if(this.pos+4>this.len)throw ot(this,4);var at=_e.float.readFloatLE(this.buf,this.pos);return this.pos+=4,at},st.prototype.double=function(){if(this.pos+8>this.len)throw ot(this,4);var at=_e.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,at},st.prototype.bytes=function(){var at=this.uint32(),rt=this.pos,dt=this.pos+at;if(dt>this.len)throw ot(this,at);return this.pos+=at,Array.isArray(this.buf)?this.buf.slice(rt,dt):rt===dt?new this.buf.constructor(0):this._slice.call(this.buf,rt,dt)},st.prototype.string=function(){var at=this.bytes();return tt.read(at,0,at.length)},st.prototype.skip=function(at){if(typeof at=="number"){if(this.pos+at>this.len)throw ot(this,at);this.pos+=at}else do if(this.pos>=this.len)throw ot(this);while(128&this.buf[this.pos++]);return this},st.prototype.skipType=function(at){switch(at){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(at=7&this.uint32())!=4;)this.skipType(at);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+at+" at offset "+this.pos)}return this},st._configure=function(at){j=at,st.create=$(),j._configure();var rt=_e.Long?"toLong":"toNumber";_e.merge(st.prototype,{int64:function(){return a.call(this)[rt](!1)},uint64:function(){return a.call(this)[rt](!0)},sint64:function(){return a.call(this).zzDecode()[rt](!1)},fixed64:function(){return nt.call(this)[rt](!0)},sfixed64:function(){return nt.call(this)[rt](!1)}})}},593:(i,o,s)=>{i.exports=lt;var j=s(1408);(lt.prototype=Object.create(j.prototype)).constructor=lt;var _e=s(9693);function lt(tt){j.call(this,tt)}lt._configure=function(){_e.Buffer&&(lt.prototype._slice=_e.Buffer.prototype.slice)},lt.prototype.string=function(){var tt=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+tt,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+tt,this.len))},lt._configure()},5054:i=>{i.exports={}},5994:(i,o,s)=>{o.Service=s(7948)},7948:(i,o,s)=>{i.exports=_e;var j=s(9693);function _e(lt,tt,ot){if(typeof lt!="function")throw TypeError("rpcImpl must be a function");j.EventEmitter.call(this),this.rpcImpl=lt,this.requestDelimited=!!tt,this.responseDelimited=!!ot}(_e.prototype=Object.create(j.EventEmitter.prototype)).constructor=_e,_e.prototype.rpcCall=function lt(tt,ot,st,ct,it){if(!ct)throw TypeError("request must be specified");var $=this;if(!it)return j.asPromise(lt,$,tt,ot,st,ct);if($.rpcImpl)try{return $.rpcImpl(tt,ot[$.requestDelimited?"encodeDelimited":"encode"](ct).finish(),function(a,et){if(a)return $.emit("error",a,tt),it(a);if(et!==null){if(!(et instanceof st))try{et=st[$.responseDelimited?"decodeDelimited":"decode"](et)}catch(nt){return $.emit("error",nt,tt),it(nt)}return $.emit("data",et,tt),it(null,et)}$.end(!0)})}catch(a){return $.emit("error",a,tt),void setTimeout(function(){it(a)},0)}else setTimeout(function(){it(Error("already ended"))},0)},_e.prototype.end=function(lt){return this.rpcImpl&&(lt||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},1945:(i,o,s)=>{i.exports=_e;var j=s(9693);function _e(st,ct){this.lo=st>>>0,this.hi=ct>>>0}var lt=_e.zero=new _e(0,0);lt.toNumber=function(){return 0},lt.zzEncode=lt.zzDecode=function(){return this},lt.length=function(){return 1};var tt=_e.zeroHash="\0\0\0\0\0\0\0\0";_e.fromNumber=function(st){if(st===0)return lt;var ct=st<0;ct&&(st=-st);var it=st>>>0,$=(st-it)/4294967296>>>0;return ct&&($=~$>>>0,it=~it>>>0,++it>4294967295&&(it=0,++$>4294967295&&($=0))),new _e(it,$)},_e.from=function(st){if(typeof st=="number")return _e.fromNumber(st);if(j.isString(st)){if(!j.Long)return _e.fromNumber(parseInt(st,10));st=j.Long.fromString(st)}return st.low||st.high?new _e(st.low>>>0,st.high>>>0):lt},_e.prototype.toNumber=function(st){if(!st&&this.hi>>>31){var ct=1+~this.lo>>>0,it=~this.hi>>>0;return ct||(it=it+1>>>0),-(ct+4294967296*it)}return this.lo+4294967296*this.hi},_e.prototype.toLong=function(st){return j.Long?new j.Long(0|this.lo,0|this.hi,!!st):{low:0|this.lo,high:0|this.hi,unsigned:!!st}};var ot=String.prototype.charCodeAt;_e.fromHash=function(st){return st===tt?lt:new _e((ot.call(st,0)|ot.call(st,1)<<8|ot.call(st,2)<<16|ot.call(st,3)<<24)>>>0,(ot.call(st,4)|ot.call(st,5)<<8|ot.call(st,6)<<16|ot.call(st,7)<<24)>>>0)},_e.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)},_e.prototype.zzEncode=function(){var st=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^st)>>>0,this.lo=(this.lo<<1^st)>>>0,this},_e.prototype.zzDecode=function(){var st=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^st)>>>0,this.hi=(this.hi>>>1^st)>>>0,this},_e.prototype.length=function(){var st=this.lo,ct=(this.lo>>>28|this.hi<<4)>>>0,it=this.hi>>>24;return it===0?ct===0?st<16384?st<128?1:2:st<2097152?3:4:ct<16384?ct<128?5:6:ct<2097152?7:8:it<128?9:10}},9693:function(i,o,s){var j=o;function _e(tt,ot,st){for(var ct=Object.keys(ot),it=0;it0)},j.Buffer=function(){try{var tt=j.inquire("buffer").Buffer;return tt.prototype.utf8Write?tt:null}catch{return null}}(),j._Buffer_from=null,j._Buffer_allocUnsafe=null,j.newBuffer=function(tt){return typeof tt=="number"?j.Buffer?j._Buffer_allocUnsafe(tt):new j.Array(tt):j.Buffer?j._Buffer_from(tt):typeof Uint8Array>"u"?tt:new Uint8Array(tt)},j.Array=typeof Uint8Array<"u"?Uint8Array:Array,j.Long=j.global.dcodeIO&&j.global.dcodeIO.Long||j.global.Long||j.inquire("long"),j.key2Re=/^true|false|0|1$/,j.key32Re=/^-?(?:0|[1-9][0-9]*)$/,j.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,j.longToHash=function(tt){return tt?j.LongBits.from(tt).toHash():j.LongBits.zeroHash},j.longFromHash=function(tt,ot){var st=j.LongBits.fromHash(tt);return j.Long?j.Long.fromBits(st.lo,st.hi,ot):st.toNumber(!!ot)},j.merge=_e,j.lcFirst=function(tt){return tt.charAt(0).toLowerCase()+tt.substring(1)},j.newError=lt,j.ProtocolError=lt("ProtocolError"),j.oneOfGetter=function(tt){for(var ot={},st=0;st-1;--it)if(ot[ct[it]]===1&&this[ct[it]]!==void 0&&this[ct[it]]!==null)return ct[it]}},j.oneOfSetter=function(tt){return function(ot){for(var st=0;st{i.exports=$;var j,_e=s(9693),lt=_e.LongBits,tt=_e.base64,ot=_e.utf8;function st(ut,bt,mt){this.fn=ut,this.len=bt,this.next=void 0,this.val=mt}function ct(){}function it(ut){this.head=ut.head,this.tail=ut.tail,this.len=ut.len,this.next=ut.states}function $(){this.len=0,this.head=new st(ct,0,0),this.tail=this.head,this.states=null}var a=function(){return _e.Buffer?function(){return($.create=function(){return new j})()}:function(){return new $}};function et(ut,bt,mt){bt[mt]=255&ut}function nt(ut,bt){this.len=ut,this.next=void 0,this.val=bt}function at(ut,bt,mt){for(;ut.hi;)bt[mt++]=127&ut.lo|128,ut.lo=(ut.lo>>>7|ut.hi<<25)>>>0,ut.hi>>>=7;for(;ut.lo>127;)bt[mt++]=127&ut.lo|128,ut.lo=ut.lo>>>7;bt[mt++]=ut.lo}function rt(ut,bt,mt){bt[mt]=255&ut,bt[mt+1]=ut>>>8&255,bt[mt+2]=ut>>>16&255,bt[mt+3]=ut>>>24}$.create=a(),$.alloc=function(ut){return new _e.Array(ut)},_e.Array!==Array&&($.alloc=_e.pool($.alloc,_e.Array.prototype.subarray)),$.prototype._push=function(ut,bt,mt){return this.tail=this.tail.next=new st(ut,bt,mt),this.len+=bt,this},nt.prototype=Object.create(st.prototype),nt.prototype.fn=function(ut,bt,mt){for(;ut>127;)bt[mt++]=127&ut|128,ut>>>=7;bt[mt]=ut},$.prototype.uint32=function(ut){return this.len+=(this.tail=this.tail.next=new nt((ut>>>=0)<128?1:ut<16384?2:ut<2097152?3:ut<268435456?4:5,ut)).len,this},$.prototype.int32=function(ut){return ut<0?this._push(at,10,lt.fromNumber(ut)):this.uint32(ut)},$.prototype.sint32=function(ut){return this.uint32((ut<<1^ut>>31)>>>0)},$.prototype.uint64=function(ut){var bt=lt.from(ut);return this._push(at,bt.length(),bt)},$.prototype.int64=$.prototype.uint64,$.prototype.sint64=function(ut){var bt=lt.from(ut).zzEncode();return this._push(at,bt.length(),bt)},$.prototype.bool=function(ut){return this._push(et,1,ut?1:0)},$.prototype.fixed32=function(ut){return this._push(rt,4,ut>>>0)},$.prototype.sfixed32=$.prototype.fixed32,$.prototype.fixed64=function(ut){var bt=lt.from(ut);return this._push(rt,4,bt.lo)._push(rt,4,bt.hi)},$.prototype.sfixed64=$.prototype.fixed64,$.prototype.float=function(ut){return this._push(_e.float.writeFloatLE,4,ut)},$.prototype.double=function(ut){return this._push(_e.float.writeDoubleLE,8,ut)};var dt=_e.Array.prototype.set?function(ut,bt,mt){bt.set(ut,mt)}:function(ut,bt,mt){for(var pt=0;pt>>0;if(!bt)return this._push(et,1,0);if(_e.isString(ut)){var mt=$.alloc(bt=tt.length(ut));tt.decode(ut,mt,0),ut=mt}return this.uint32(bt)._push(dt,bt,ut)},$.prototype.string=function(ut){var bt=ot.length(ut);return bt?this.uint32(bt)._push(ot.write,bt,ut):this._push(et,1,0)},$.prototype.fork=function(){return this.states=new it(this),this.head=this.tail=new st(ct,0,0),this.len=0,this},$.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 st(ct,0,0),this.len=0),this},$.prototype.ldelim=function(){var ut=this.head,bt=this.tail,mt=this.len;return this.reset().uint32(mt),mt&&(this.tail.next=ut.next,this.tail=bt,this.len+=mt),this},$.prototype.finish=function(){for(var ut=this.head.next,bt=this.constructor.alloc(this.len),mt=0;ut;)ut.fn(ut.val,bt,mt),mt+=ut.len,ut=ut.next;return bt},$._configure=function(ut){j=ut,$.create=a(),j._configure()}},3155:(i,o,s)=>{i.exports=lt;var j=s(1173);(lt.prototype=Object.create(j.prototype)).constructor=lt;var _e=s(9693);function lt(){j.call(this)}function tt(ot,st,ct){ot.length<40?_e.utf8.write(ot,st,ct):st.utf8Write?st.utf8Write(ot,ct):st.write(ot,ct)}lt._configure=function(){lt.alloc=_e._Buffer_allocUnsafe,lt.writeBytesBuffer=_e.Buffer&&_e.Buffer.prototype instanceof Uint8Array&&_e.Buffer.prototype.set.name==="set"?function(ot,st,ct){st.set(ot,ct)}:function(ot,st,ct){if(ot.copy)ot.copy(st,ct,0,ot.length);else for(var it=0;it>>0;return this.uint32(st),st&&this._push(lt.writeBytesBuffer,st,ot),this},lt.prototype.string=function(ot){var st=_e.Buffer.byteLength(ot);return this.uint32(st),st&&this._push(tt,st,ot),this},lt._configure()},7714:(i,o,s)=>{o.R=void 0;const j=s(6919),_e=s(7448);o.R=new class{async init(){}async createSessionHandler(lt,tt){const ot=new j.Session(tt);return await ot.loadModel(lt),new _e.OnnxjsSessionHandler(ot)}}},4200:(i,o,s)=>{o.c8=o.rX=void 0;const j=s(1670),_e=s(5381),lt=s(2157),tt=s(2306);o.rX=()=>{if((typeof j.env.wasm.initTimeout!="number"||j.env.wasm.initTimeout<0)&&(j.env.wasm.initTimeout=0),typeof j.env.wasm.simd!="boolean"&&(j.env.wasm.simd=!0),typeof j.env.wasm.proxy!="boolean"&&(j.env.wasm.proxy=!1),typeof j.env.wasm.numThreads!="number"||!Number.isInteger(j.env.wasm.numThreads)||j.env.wasm.numThreads<=0){const ot=typeof navigator>"u"?(0,_e.cpus)().length:navigator.hardwareConcurrency;j.env.wasm.numThreads=Math.min(4,Math.ceil((ot||1)/2))}},o.c8=new class{async init(){(0,o.rX)(),await(0,lt.initWasm)()}async createSessionHandler(ot,st){const ct=new tt.OnnxruntimeWebAssemblySessionHandler;return await ct.loadModel(ot,st),Promise.resolve(ct)}}},6018:function(i,o,s){var j=this&&this.__createBinding||(Object.create?function(tt,ot,st,ct){ct===void 0&&(ct=st);var it=Object.getOwnPropertyDescriptor(ot,st);it&&!("get"in it?!ot.__esModule:it.writable||it.configurable)||(it={enumerable:!0,get:function(){return ot[st]}}),Object.defineProperty(tt,ct,it)}:function(tt,ot,st,ct){ct===void 0&&(ct=st),tt[ct]=ot[st]}),_e=this&&this.__exportStar||function(tt,ot){for(var st in tt)st==="default"||Object.prototype.hasOwnProperty.call(ot,st)||j(ot,tt,st)};Object.defineProperty(o,"__esModule",{value:!0}),_e(s(1670),o);const lt=s(1670);{const tt=s(7714).R;(0,lt.registerBackend)("webgl",tt,-10)}{const tt=s(4200).c8;(0,lt.registerBackend)("cpu",tt,10),(0,lt.registerBackend)("wasm",tt,10),(0,lt.registerBackend)("xnnpack",tt,9)}},246:(i,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createAttributeWithCacheKey=void 0;class s{constructor(_e){Object.assign(this,_e)}get cacheKey(){return this._cacheKey||(this._cacheKey=Object.getOwnPropertyNames(this).sort().map(_e=>`${this[_e]}`).join(";")),this._cacheKey}}o.createAttributeWithCacheKey=j=>new s(j)},7778:(i,o,s)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Attribute=void 0;const j=s(1446),_e=s(9395),lt=s(9162),tt=s(2517);var ot=_e.onnxruntime.experimental.fbs;class st{constructor(it){if(this._attributes=new Map,it!=null){for(const $ of it)$ instanceof j.onnx.AttributeProto?this._attributes.set($.name,[st.getValue($),st.getType($)]):$ instanceof ot.Attribute&&this._attributes.set($.name(),[st.getValue($),st.getType($)]);if(this._attributes.sizelt.Tensor.fromProto(et));if(it instanceof ot.Attribute)return a.map(et=>lt.Tensor.fromOrtTensor(et))}if($===j.onnx.AttributeProto.AttributeType.STRING&&it instanceof j.onnx.AttributeProto){const et=a;return(0,tt.decodeUtf8String)(et)}return $===j.onnx.AttributeProto.AttributeType.STRINGS&&it instanceof j.onnx.AttributeProto?a.map(tt.decodeUtf8String):a}static getValueNoCheck(it){return it instanceof j.onnx.AttributeProto?this.getValueNoCheckFromOnnxFormat(it):this.getValueNoCheckFromOrtFormat(it)}static getValueNoCheckFromOnnxFormat(it){switch(it.type){case j.onnx.AttributeProto.AttributeType.FLOAT:return it.f;case j.onnx.AttributeProto.AttributeType.INT:return it.i;case j.onnx.AttributeProto.AttributeType.STRING:return it.s;case j.onnx.AttributeProto.AttributeType.TENSOR:return it.t;case j.onnx.AttributeProto.AttributeType.GRAPH:return it.g;case j.onnx.AttributeProto.AttributeType.FLOATS:return it.floats;case j.onnx.AttributeProto.AttributeType.INTS:return it.ints;case j.onnx.AttributeProto.AttributeType.STRINGS:return it.strings;case j.onnx.AttributeProto.AttributeType.TENSORS:return it.tensors;case j.onnx.AttributeProto.AttributeType.GRAPHS:return it.graphs;default:throw new Error(`unsupported attribute type: ${j.onnx.AttributeProto.AttributeType[it.type]}`)}}static getValueNoCheckFromOrtFormat(it){switch(it.type()){case ot.AttributeType.FLOAT:return it.f();case ot.AttributeType.INT:return it.i();case ot.AttributeType.STRING:return it.s();case ot.AttributeType.TENSOR:return it.t();case ot.AttributeType.GRAPH:return it.g();case ot.AttributeType.FLOATS:return it.floatsArray();case ot.AttributeType.INTS:{const $=[];for(let a=0;a{Object.defineProperty(o,"__esModule",{value:!0}),o.resolveBackend=o.backend=void 0;const j=s(5038),_e=new Map;async function lt(tt){const ot=o.backend;if(ot[tt]!==void 0&&function(st){const ct=st;return"initialize"in ct&&typeof ct.initialize=="function"&&"createSessionHandler"in ct&&typeof ct.createSessionHandler=="function"&&"dispose"in ct&&typeof ct.dispose=="function"}(ot[tt])){const st=ot[tt];let ct=st.initialize();if(typeof ct=="object"&&"then"in ct&&(ct=await ct),ct)return _e.set(tt,st),st}}o.backend={webgl:new j.WebGLBackend},o.resolveBackend=async function tt(ot){if(!ot)return tt(["webgl"]);{const st=typeof ot=="string"?[ot]:ot;for(const ct of st){const it=_e.get(ct);if(it)return it;const $=await lt(ct);if($)return $}}throw new Error("no available backend to use")}},5038:(i,o,s)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WebGLBackend=void 0;const j=s(1670),_e=s(6231),lt=s(6416),tt=s(7305);o.WebGLBackend=class{get contextId(){return j.env.webgl.contextId}set contextId(ot){j.env.webgl.contextId=ot}get matmulMaxBatchSize(){return j.env.webgl.matmulMaxBatchSize}set matmulMaxBatchSize(ot){j.env.webgl.matmulMaxBatchSize=ot}get textureCacheMode(){return j.env.webgl.textureCacheMode}set textureCacheMode(ot){j.env.webgl.textureCacheMode=ot}get pack(){return j.env.webgl.pack}set pack(ot){j.env.webgl.pack=ot}get async(){return j.env.webgl.async}set async(ot){j.env.webgl.async=ot}initialize(){try{return this.glContext=(0,tt.createWebGLContext)(this.contextId),typeof this.matmulMaxBatchSize!="number"&&(this.matmulMaxBatchSize=16),typeof this.textureCacheMode!="string"&&(this.textureCacheMode="full"),typeof this.pack!="boolean"&&(this.pack=!1),typeof this.async!="boolean"&&(this.async=!1),_e.Logger.setWithEnv(j.env),_e.Logger.verbose("WebGLBackend",`Created WebGLContext: ${typeof this.glContext} with matmulMaxBatchSize: ${this.matmulMaxBatchSize}; textureCacheMode: ${this.textureCacheMode}; pack: ${this.pack}; async: ${this.async}.`),!0}catch(ot){return _e.Logger.warning("WebGLBackend",`Unable to initialize WebGLBackend. ${ot}`),!1}}createSessionHandler(ot){return new lt.WebGLSessionHandler(this,ot)}dispose(){this.glContext.dispose()}}},5107:(i,o,s)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoordsGlslLib=void 0;const j=s(2517),_e=s(8520),lt=s(5060),tt=s(7859),ot=s(9390);class st extends _e.GlslLib{constructor(it){super(it)}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 _e.GlslLibRoutine(` vec2 offsetToCoords(int offset, int width, int height) { int t = offset / width; int s = offset - t*width; vec2 coords = (vec2(s,t) + vec2(0.5,0.5)) / vec2(width, height); return coords; } `)}}coordsToOffset(){return{coordsToOffset:new _e.GlslLibRoutine(` int coordsToOffset(vec2 coords, int width, int height) { float s = coords.s * float(width); float t = coords.t * float(height); int offset = int(t) * width + int(s); return offset; } `)}}getOutputSamplingSnippet(){const it=this.context.outputTextureLayout;return it.isPacked?this.getPackedOutputSamplingSnippet(it):this.getUnpackedOutputSamplingSnippet(it)}getPackedOutputSamplingSnippet(it){const $=it.unpackedShape,a=[it.width,it.height],et={},nt="getOutputCoords";switch($.length){case 0:et[nt]=this.getOutputScalarCoords();break;case 1:et[nt]=this.getOutputPacked1DCoords($,a);break;case 2:et[nt]=this.getOutputPacked2DCoords($,a);break;case 3:et[nt]=this.getOutputPacked3DCoords($,a);break;default:et[nt]=this.getOutputPackedNDCoords($,a)}const at=` void setOutput(vec4 val) { ${(0,lt.getGlsl)(this.context.glContext.version).output} = val; } `;return et.floatTextureSetRGBA=new _e.GlslLibRoutine(at),et}getUnpackedOutputSamplingSnippet(it){const $=it.unpackedShape,a=[it.width,it.height],et={},nt="getOutputCoords";switch($.length){case 0:et[nt]=this.getOutputScalarCoords();break;case 1:et[nt]=this.getOutputUnpacked1DCoords($,a);break;case 2:et[nt]=this.getOutputUnpacked2DCoords($,a);break;case 3:et[nt]=this.getOutputUnpacked3DCoords($,a);break;case 4:et[nt]=this.getOutputUnpacked4DCoords($,a);break;case 5:et[nt]=this.getOutputUnpacked5DCoords($,a);break;case 6:et[nt]=this.getOutputUnpacked6DCoords($,a);break;default:throw new Error(`Unsupported output dimensionality: ${$.length}`)}const at=` void setOutput(float val) { ${(0,lt.getGlsl)(this.context.glContext.version).output} = vec4(val, 0, 0, 0); } `;return et.floatTextureSetR=new _e.GlslLibRoutine(at),et}getOutputScalarCoords(){return new _e.GlslLibRoutine(` int getOutputCoords() { return 0; } `)}getOutputPacked1DCoords(it,$){const a=$;let et="";return a[0]===1?(et=` int getOutputCoords() { return 2 * int(TexCoords.y * ${a[1]}.0); } `,new _e.GlslLibRoutine(et)):a[1]===1?(et=` int getOutputCoords() { return 2 * int(TexCoords.x * ${a[0]}.0); } `,new _e.GlslLibRoutine(et)):(et=` int getOutputCoords() { ivec2 resTexRC = ivec2(TexCoords.xy * vec2(${a[0]}, ${a[1]})); return 2 * (resTexRC.y * ${a[0]} + resTexRC.x); } `,new _e.GlslLibRoutine(et))}getOutputPacked2DCoords(it,$){let a="";if(j.ArrayUtil.arraysEqual(it,$))return a=` ivec2 getOutputCoords() { return 2 * ivec2(TexCoords.xy * vec2(${$[0]}, ${$[1]})); } `,new _e.GlslLibRoutine(a);const et=$,nt=Math.ceil(it[1]/2);return a=` ivec2 getOutputCoords() { ivec2 resTexRC = ivec2(TexCoords.xy * vec2(${et[0]}, ${et[1]})); int index = resTexRC.y * ${et[0]} + resTexRC.x; // reverse r and c order for packed texture int r = imod(index, ${nt}) * 2; int c = 2 * (index / ${nt}); return ivec2(r, c); } `,new _e.GlslLibRoutine(a)}getOutputPacked3DCoords(it,$){const a=[$[0],$[1]],et=Math.ceil(it[2]/2),nt=et*Math.ceil(it[1]/2),at=` ivec3 getOutputCoords() { ivec2 resTexRC = ivec2(TexCoords.xy * vec2(${a[0]}, ${a[1]})); int index = resTexRC.y * ${a[0]} + resTexRC.x; int b = index / ${nt}; index -= b * ${nt}; // reverse r and c order for packed texture int r = imod(index, ${et}) * 2; int c = 2 * (index / ${et}); return ivec3(b, r, c); } `;return new _e.GlslLibRoutine(at)}getOutputPackedNDCoords(it,$){const a=[$[0],$[1]],et=Math.ceil(it[it.length-1]/2),nt=et*Math.ceil(it[it.length-2]/2);let at=nt,rt="",dt="b, r, c";for(let bt=2;bt=0;--dt)nt[dt]=nt[dt+1]*it[dt+1];const at=["r","c","d"],rt=nt.map((dt,ut)=>`int ${at[ut]} = index / ${dt}; ${ut===nt.length-1?`int ${at[ut+1]} = index - ${at[ut]} * ${dt}`:`index -= ${at[ut]} * ${dt}`};`).join("");return a=` ivec3 getOutputCoords() { ivec2 resTexRC = ivec2(TexCoords.xy * vec2(${$[0]}, ${$[1]})); int index = resTexRC.y * ${$[0]} + resTexRC.x; ${rt} return ivec3(r, c, d); } `,new _e.GlslLibRoutine(a)}getOutputUnpacked4DCoords(it,$){let a="";const et=it.length;let nt=null;et<2&&(nt=[]),nt=new Array(et-1),nt[et-2]=it[et-1];for(let dt=et-3;dt>=0;--dt)nt[dt]=nt[dt+1]*it[dt+1];const at=["r","c","d","d2"],rt=nt.map((dt,ut)=>`int ${at[ut]} = index / ${dt}; ${ut===nt.length-1?`int ${at[ut+1]} = index - ${at[ut]} * ${dt}`:`index -= ${at[ut]} * ${dt}`};`).join("");return a=` ivec4 getOutputCoords() { ivec2 resTexRC = ivec2(TexCoords.xy * vec2(${$[0]}, ${$[1]})); int index = resTexRC.y * ${$[0]} + resTexRC.x; ${rt} return ivec4(r, c, d, d2); } `,new _e.GlslLibRoutine(a)}getOutputUnpacked5DCoords(it,$){let a="";const et=it.length;let nt=null;et<2&&(nt=[]),nt=new Array(et-1),nt[et-2]=it[et-1];for(let dt=et-3;dt>=0;--dt)nt[dt]=nt[dt+1]*it[dt+1];const at=["r","c","d","d2","d3"],rt=nt.map((dt,ut)=>`int ${at[ut]} = index / ${dt}; ${ut===nt.length-1?`int ${at[ut+1]} = index - ${at[ut]} * ${dt}`:`index -= ${at[ut]} * ${dt}`};`).join("");return a=` ivec5 getOutputCoords() { ivec2 resTexRC = ivec2(TexCoords.xy * vec2(${$[0]}, ${$[1]})); int index = resTexRC.y * ${$[0]} + resTexRC.x; ${rt} return ivec5(r, c, d, d2, d3); } `,new _e.GlslLibRoutine(a)}getOutputUnpacked6DCoords(it,$){let a="";const et=it.length;let nt=null;et<2&&(nt=[]),nt=new Array(et-1),nt[et-2]=it[et-1];for(let dt=et-3;dt>=0;--dt)nt[dt]=nt[dt+1]*it[dt+1];const at=["r","c","d","d2","d3","d4"],rt=nt.map((dt,ut)=>`int ${at[ut]} = index / ${dt}; ${ut===nt.length-1?`int ${at[ut+1]} = index - ${at[ut]} * ${dt}`:`index -= ${at[ut]} * ${dt}`};`).join("");return a=` ivec6 getOutputCoords() { ivec2 resTexRC = ivec2(TexCoords.xy * vec2(${$[0]}, ${$[1]})); int index = resTexRC.y * ${$[0]} + resTexRC.x; ${rt} return ivec6(r, c, d, d2, d3, d4); } `,new _e.GlslLibRoutine(a)}getCommonUtilFuncs(){const it={};let $="uvFromFlat";it[$]=new _e.GlslLibRoutine(` vec2 uvFromFlat(int texNumR, int texNumC, int index) { int texC = index / texNumR; int texR = index - texC * texNumR; // TODO: swap texR, texC order in following function so row is corresponding to u and column is corresponding to // v. return (vec2(texR, texC) + halfCR) / vec2(texNumR, texNumC); } `),$="packedUVfrom1D",it[$]=new _e.GlslLibRoutine(` vec2 packedUVfrom1D(int texNumR, int texNumC, int index) { int texelIndex = index / 2; int texR = texelIndex / texNumC; int texC = texelIndex - texR * texNumC; return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR); } `),$="packedUVfrom2D",it[$]=new _e.GlslLibRoutine(` vec2 packedUVfrom2D(int texNumR, int texNumC, int texelsInLogicalRow, int row, int col) { int texelIndex = (row / 2) * texelsInLogicalRow + (col / 2); int texR = texelIndex / texNumC; int texC = texelIndex - texR * texNumC; return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR); } `),$="packedUVfrom3D",it[$]=new _e.GlslLibRoutine(` vec2 packedUVfrom3D(int texNumR, int texNumC, int texelsInBatch, int texelsInLogicalRow, int b, int row, int col) { int index = b * texelsInBatch + (row / 2) * texelsInLogicalRow + (col / 2); int texR = index / texNumC; int texC = index - texR * texNumC; return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR); } `),$="sampleTexture";const a=(0,lt.getGlsl)(this.context.glContext.version);return it[$]=new _e.GlslLibRoutine(` float sampleTexture(sampler2D textureSampler, vec2 uv) { return ${a.texture2D}(textureSampler, uv).r; }`),it}getInputsSamplingSnippets(){const it={},$=this.context.outputTextureLayout;return this.context.programInfo.inputNames.forEach((a,et)=>{const nt=this.context.inputTextureLayouts[et],at=(0,ot.generateShaderFuncNameFromInputSamplerName)(a);nt.isPacked?it[at]=this.getPackedSamplerFromInput(at,a,nt):it[at]=this.getUnpackedSamplerFromInput(at,a,nt);const rt=(0,ot.generateShaderFuncNameFromInputSamplerNameAtOutCoords)(a);nt.unpackedShape.length<=$.unpackedShape.length&&(nt.isPacked?it[rt]=this.getPackedSamplerAtOutputCoords(rt,nt,$,a):it[rt]=this.getUnpackedSamplerAtOutputCoords(rt,nt,$,a))}),it}getPackedSamplerAtOutputCoords(it,$,a,et){const nt=$.unpackedShape,at=a.unpackedShape,rt=et,dt=(0,ot.generateShaderFuncNameFromInputSamplerName)(rt),ut=nt.length,bt=at.length,mt=j.BroadcastUtil.getBroadcastDims(nt,at),pt=(0,ot.getCoordsDataType)(bt),Zt=bt-ut;let ht;const Gt=(0,ot.getGlChannels)();ht=ut===0?"":bt<2&&mt.length>=1?"coords = 0;":mt.map(Ct=>`coords.${Gt[Ct+Zt]} = 0;`).join(` `);let Xt="";Xt=bt<2&&ut>0?"coords":nt.map((Ct,Tt)=>`coords.${Gt[Tt+Zt]}`).join(", ");let Vt="return outputValue;";const Yt=j.ShapeUtil.size(nt)===1,St=j.ShapeUtil.size(at)===1;if(ut!==1||Yt||St){if(Yt&&!St)Vt=bt===1?` return vec4(outputValue.x, outputValue.x, 0., 0.); `:` return vec4(outputValue.x); `;else if(mt.length){const Ct=ut-2,Tt=ut-1;mt.indexOf(Ct)>-1&&mt.indexOf(Tt)>-1?Vt="return vec4(outputValue.x);":mt.indexOf(Ct)>-1?Vt="return vec4(outputValue.x, outputValue.y, outputValue.x, outputValue.y);":mt.indexOf(Tt)>-1&&(Vt="return vec4(outputValue.xx, outputValue.zz);")}}else Vt=` return vec4(outputValue.xy, outputValue.xy); `;const Lt=` vec4 ${it}() { ${pt} coords = getOutputCoords(); int lastDim = coords.${Gt[bt-1]}; coords.${Gt[bt-1]} = coords.${Gt[bt-2]}; coords.${Gt[bt-2]} = lastDim; ${ht} vec4 outputValue = ${dt}(${Xt}); ${Vt} } `;return new _e.GlslLibRoutine(Lt,["coordinates.getOutputCoords"])}getUnpackedSamplerAtOutputCoords(it,$,a,et){const nt=[a.width,a.height],at=[$.width,$.height],rt=$.unpackedShape.length,dt=a.unpackedShape.length,ut=$.unpackedShape,bt=a.unpackedShape,mt=(0,ot.generateShaderFuncNameFromInputSamplerName)(et);if(rt===dt&&j.ArrayUtil.arraysEqual(at,nt)){const St=` float ${it}() { return sampleTexture(${et}, TexCoords); } `;return new _e.GlslLibRoutine(St,["coordinates.sampleTexture"])}const pt=(0,ot.getCoordsDataType)(dt),Zt=j.BroadcastUtil.getBroadcastDims(ut,bt),ht=dt-rt;let Gt;const Xt=(0,ot.getGlChannels)();Gt=rt===0?"":dt<2&&Zt.length>=1?"coords = 0;":Zt.map(St=>`coords.${Xt[St+ht]} = 0;`).join(` `);let Vt="";Vt=dt<2&&rt>0?"coords":$.unpackedShape.map((St,Lt)=>`coords.${Xt[Lt+ht]}`).join(", ");const Yt=` float ${it}() { ${pt} coords = getOutputCoords(); ${Gt} return ${mt}(${Vt}); } `;return new _e.GlslLibRoutine(Yt,["coordinates.getOutputCoords"])}getPackedSamplerFromInput(it,$,a){switch(a.unpackedShape.length){case 0:return this.getPackedSamplerScalar(it,$);case 1:return this.getPackedSampler1D(it,$,a);case 2:return this.getPackedSampler2D(it,$,a);case 3:return this.getPackedSampler3D(it,$,a);default:return this.getPackedSamplerND(it,$,a)}}getUnpackedSamplerFromInput(it,$,a){const et=a.unpackedShape;switch(et.length){case 0:return this.getUnpackedSamplerScalar(it,$,a);case 1:return this.getUnpackedSampler1D(it,$,a);case 2:return this.getUnpackedSampler2D(it,$,a);case 3:return this.getUnpackedSampler3D(it,$,a);case 4:return this.getUnpackedSampler4D(it,$,a);case 5:return this.getUnpackedSampler5D(it,$,a);case 6:return this.getUnpackedSampler6D(it,$,a);default:throw new Error(`Unsupported dimension ${et.length}-D`)}}getPackedSamplerScalar(it,$){const a=` vec4 ${it}() { return ${(0,lt.getGlsl)(this.context.glContext.version).texture2D}(${$}, halfCR); } `;return new _e.GlslLibRoutine(a)}getPackedSampler1D(it,$,a){const et=[a.width,a.height],nt=[et[1],et[0]],at=(0,lt.getGlsl)(this.context.glContext.version),rt=`vec4 ${it}(int index) { vec2 uv = packedUVfrom1D( ${nt[0]}, ${nt[1]}, index); return ${at.texture2D}(${$}, uv); }`;return new _e.GlslLibRoutine(rt,["coordinates.packedUVfrom1D"])}getPackedSampler2D(it,$,a){const et=a.unpackedShape,nt=[a.width,a.height],at=(0,lt.getGlsl)(this.context.glContext.version),rt=nt[0],dt=nt[1];if(nt!=null&&j.ArrayUtil.arraysEqual(et,nt)){const pt=`vec4 ${it}(int row, int col) { vec2 uv = (vec2(col, row) + halfCR) / vec2(${dt}.0, ${rt}.0); return ${at.texture2D}(${$}, uv); }`;return new _e.GlslLibRoutine(pt)}const ut=nt,bt=Math.ceil(et[1]/2),mt=`vec4 ${it}(int row, int col) { vec2 uv = packedUVfrom2D(${ut[1]}, ${ut[0]}, ${bt}, row, col); return ${at.texture2D}(${$}, uv); }`;return new _e.GlslLibRoutine(mt,["coordinates.packedUVfrom2D"])}getPackedSampler3D(it,$,a){const et=a.unpackedShape,nt=[a.width,a.height],at=[nt[0],nt[1]],rt=(0,lt.getGlsl)(this.context.glContext.version);if(et[0]===1){const pt=et.slice(1),Zt=[1,2],ht=(0,ot.squeezeInputShape)(et,pt),Gt=["b","row","col"],Xt=JSON.parse(JSON.stringify(a));Xt.unpackedShape=ht;const Vt=this.getPackedSamplerFromInput(it,$,Xt),Yt=`${Vt.routineBody} vec4 ${it}(int b, int row, int col) { return ${it}(${(0,ot.getSqueezedParams)(Gt,Zt)}); } `;return new _e.GlslLibRoutine(Yt,Vt.dependencies)}const dt=at[0],ut=at[1],bt=Math.ceil(et[2]/2),mt=`vec4 ${it}(int b, int row, int col) { vec2 uv = packedUVfrom3D( ${ut}, ${dt}, ${bt*Math.ceil(et[1]/2)}, ${bt}, b, row, col); return ${rt.texture2D}(${$}, uv);}`;return new _e.GlslLibRoutine(mt,["coordinates.packedUVfrom3D"])}getPackedSamplerND(it,$,a){const et=a.unpackedShape,nt=et.length,at=[a.width,a.height],rt=(0,lt.getGlsl)(this.context.glContext.version),dt=[at[0],at[1]],ut=dt[1],bt=dt[0],mt=Math.ceil(et[nt-1]/2);let pt=mt*Math.ceil(et[nt-2]/2),Zt="int b, int row, int col",ht=`b * ${pt} + (row / 2) * ${mt} + (col / 2)`;for(let Xt=2;Xt{const et=this.context.inputTextureLayouts[a],nt=(et.unpackedShape.length>0?et.unpackedShape:et.shape).length;let at=`_${$}`;it[at]=new _e.GlslLibRoutine(this.getValueFromSingle($,nt,et.width,et.height,!1),[`shapeUtils.indicesToOffset${at}`,"coordinates.offsetToCoords","fragcolor.getColorAsFloat"]),at+="_T",it[at]=new _e.GlslLibRoutine(this.getValueFromSingle($,nt,et.width,et.height,!0),[`shapeUtils.indicesToOffset${at}`,"coordinates.offsetToCoords","fragcolor.getColorAsFloat"])}),it}getValueFromSingle(it,$,a,et,nt){let at=`_${it}`;return nt&&(at+="_T"),` float ${at}(int m[${$}]) { int offset = indicesToOffset${at}(m); vec2 coords = offsetToCoords(offset, ${a}, ${et}); float value = getColorAsFloat(${(0,lt.getGlsl)(this.context.glContext.version).texture2D}(${it}, coords)); return value; } `}getPackedValueFrom(it,$,a,et,nt){let at=`_${it}_Pack`;return nt&&(at+="_T"),` vec4 ${at}(int m[${$}]) { int offset = indicesToOffset_${it}(m); vec2 coords = offsetToCoords(offset, ${a}, ${et}); return ${(0,lt.getGlsl)(this.context.glContext.version).texture2D}(${it}, coords); } `}}o.CoordsGlslLib=st},8520:(i,o)=>{var s;Object.defineProperty(o,"__esModule",{value:!0}),o.TopologicalSortGlslRoutines=o.GlslLibRoutineNode=o.GlslLibRoutine=o.GlslLib=o.GlslContext=o.FunctionType=void 0,(s=o.FunctionType||(o.FunctionType={}))[s.ValueBased=0]="ValueBased",s[s.Positional=1]="Positional",o.GlslContext=class{constructor(j,_e,lt,tt){this.glContext=j,this.programInfo=_e,this.inputTextureLayouts=lt,this.outputTextureLayout=tt}},o.GlslLib=class{constructor(j){this.context=j}},o.GlslLibRoutine=class{constructor(j,_e){this.routineBody=j,this.dependencies=_e}},o.GlslLibRoutineNode=class{constructor(j,_e,lt){this.name=j,this.dependencies=lt||[],_e&&(this.routineBody=_e)}addDependency(j){j&&this.dependencies.push(j)}},o.TopologicalSortGlslRoutines=class{static returnOrderedNodes(j){if(!j||j.length===0)return[];if(j.length===1)return j;const _e=new Set,lt=new Set,tt=new Array;return this.createOrderedNodes(j,_e,lt,tt),tt}static createOrderedNodes(j,_e,lt,tt){for(let ot=0;ot0)for(let st=0;st{Object.defineProperty(o,"__esModule",{value:!0}),o.EncodingGlslLib=void 0;const j=s(8520);class _e extends j.GlslLib{constructor(tt){super(tt)}getFunctions(){return Object.assign(Object.assign({},this.encodeFloat32()),this.decodeFloat32())}getCustomTypes(){return{}}encodeFloat32(){return{encode:new j.GlslLibRoutine(`highp vec4 encode(highp float f) { return vec4(f, 0.0, 0.0, 0.0); } `)}}decodeFloat32(){return{decode:new j.GlslLibRoutine(`highp float decode(highp vec4 rgba) { return rgba.r; } `)}}encodeUint8(){const tt=_e.isLittleEndian()?"rgba.rgba=rgba.abgr;":"";return{encode:new j.GlslLibRoutine(` highp vec4 encode(highp float f) { highp float F = abs(f); highp float Sign = step(0.0,-f); highp float Exponent = floor(log2(F)); highp float Mantissa = (exp2(- Exponent) * F); Exponent = floor(log2(F) + 127.0) + floor(log2(Mantissa)); highp vec4 rgba; rgba[0] = 128.0 * Sign + floor(Exponent*exp2(-1.0)); rgba[1] = 128.0 * mod(Exponent,2.0) + mod(floor(Mantissa*128.0),128.0); rgba[2] = floor(mod(floor(Mantissa*exp2(23.0 -8.0)),exp2(8.0))); rgba[3] = floor(exp2(23.0)*mod(Mantissa,exp2(-15.0))); ${tt} rgba = rgba / 255.0; // values need to be normalized to [0,1] return rgba; } `)}}decodeUint8(){const tt=_e.isLittleEndian()?"rgba.rgba=rgba.abgr;":"";return{decode:new j.GlslLibRoutine(` highp float decode(highp vec4 rgba) { rgba = rgba * 255.0; // values need to be de-normalized from [0,1] to [0,255] ${tt} highp float Sign = 1.0 - step(128.0,rgba[0])*2.0; highp float Exponent = 2.0 * mod(rgba[0],128.0) + step(128.0,rgba[1]) - 127.0; highp float Mantissa = mod(rgba[1],128.0)*65536.0 + rgba[2]*256.0 +rgba[3] + float(0x800000); highp float Result = Sign * exp2(Exponent) * (Mantissa * exp2(-23.0 )); return Result; } `)}}static isLittleEndian(){const tt=new ArrayBuffer(4),ot=new Uint32Array(tt),st=new Uint8Array(tt);if(ot[0]=3735928559,st[0]===239)return!0;if(st[0]===222)return!1;throw new Error("unknown endianness")}}o.EncodingGlslLib=_e},9894:(i,o,s)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.FragColorGlslLib=void 0;const j=s(8520),_e=s(5060);class lt extends j.GlslLib{constructor(ot){super(ot)}getFunctions(){return Object.assign(Object.assign({},this.setFragColor()),this.getColorAsFloat())}getCustomTypes(){return{}}setFragColor(){const ot=(0,_e.getGlsl)(this.context.glContext.version);return{setFragColor:new j.GlslLibRoutine(` void setFragColor(float value) { ${ot.output} = encode(value); } `,["encoding.encode"])}}getColorAsFloat(){return{getColorAsFloat:new j.GlslLibRoutine(` float getColorAsFloat(vec4 color) { return decode(color); } `,["encoding.decode"])}}}o.FragColorGlslLib=lt},2848:(i,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.replaceInlines=void 0;const s=/@inline[\s\n\r]+(\w+)[\s\n\r]+([0-9a-zA-Z_]+)\s*\(([^)]*)\)\s*{(([^}]|[\n\r])*)}/gm;o.replaceInlines=function(j){const _e={};let lt;for(;(lt=s.exec(j))!==null;){const tt=lt[3].split(",").map(ot=>{const st=ot.trim().split(" ");return st&&st.length===2?{type:st[0],name:st[1]}:null}).filter(ot=>ot!==null);_e[lt[2]]={params:tt,body:lt[4]}}for(const tt in _e){const ot="(\\w+)?\\s+([_0-9a-zA-Z]+)\\s+=\\s+__FUNC__\\((.*)\\)\\s*;".replace("__FUNC__",tt),st=new RegExp(ot,"gm");for(;(lt=st.exec(j))!==null;){const ct=lt[1],it=lt[2],$=lt[3].split(","),a=ct?`${ct} ${it};`:"";let et=_e[tt].body,nt="";_e[tt].params.forEach((rt,dt)=>{rt&&(nt+=`${rt.type} ${rt.name} = ${$[dt]}; `)}),et=`${nt} ${et}`,et=et.replace("return",`${it} = `);const at=` ${a} { ${et} } `;j=j.replace(lt[0],at)}}return j.replace(s,"")}},8879:(i,o,s)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.GlslPreprocessor=void 0;const j=s(8520),_e=s(2848),lt=s(5483),tt=s(5060);o.GlslPreprocessor=class{constructor(ot,st,ct,it){this.libs={},this.glslLibRoutineDependencyGraph={},this.context=new j.GlslContext(ot,st,ct,it),Object.keys(lt.glslRegistry).forEach(a=>{const et=new lt.glslRegistry[a](this.context);this.libs[a]=et});const $=this.glslLibRoutineDependencyGraph;for(const a in this.libs){const et=this.libs[a].getFunctions();for(const nt in et){const at=a+"."+nt;let rt;$[at]?(rt=$[at],rt.routineBody=et[nt].routineBody):(rt=new j.GlslLibRoutineNode(at,et[nt].routineBody),$[at]=rt);const dt=et[nt].dependencies;if(dt)for(let ut=0;ut{const it=ct.split(".")[1];ot.indexOf(it)!==-1&&st.push(this.glslLibRoutineDependencyGraph[ct])}),j.TopologicalSortGlslRoutines.returnOrderedNodes(st)}getUniforms(ot,st){const ct=[];if(ot)for(const it of ot)ct.push(`uniform sampler2D ${it};`);if(st)for(const it of st)ct.push(`uniform ${it.type} ${it.name}${it.arrayLength?`[${it.arrayLength}]`:""};`);return ct.join(` `)}}},5483:(i,o,s)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.glslRegistry=void 0;const j=s(5107),_e=s(7341),lt=s(9894),tt=s(2655),ot=s(3891);o.glslRegistry={encoding:_e.EncodingGlslLib,fragcolor:lt.FragColorGlslLib,vec:ot.VecGlslLib,shapeUtils:tt.ShapeUtilsGlslLib,coordinates:j.CoordsGlslLib}},2655:(i,o,s)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ShapeUtilsGlslLib=void 0;const j=s(8520);class _e extends j.GlslLib{constructor(tt){super(tt)}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 tt=this.context.outputTextureLayout.shape.length,ot={};return this.context.programInfo.inputNames.forEach((st,ct)=>{const it=this.context.inputTextureLayouts[ct].unpackedShape;if(it.length<=tt){const $=it.length,a=tt-$,et=`bcastIndices_${st}`;let nt="";for(let rt=0;rt<$;++rt)nt+=` realIndices[${rt}] = int( mod(float(bcastedIndices[${a+rt}]), ${it[rt]}.0) ); `;const at=` void ${et} (int bcastedIndices[${tt}], out int realIndices[${$}]) { ${nt} } `;ot[et]=new j.GlslLibRoutine(at)}}),ot}bcastMatmulIndex(){const tt=this.context.outputTextureLayout.shape.length,ot={};return this.context.programInfo.inputNames.forEach((st,ct)=>{const it=this.context.inputTextureLayouts[ct].shape;if(!(it.length<2||it.length>tt)){const $=it.length,a=tt-$,et=`bcastMatmulIndices_${st}`;let nt="";for(let rt=0;rt<$-2;++rt)nt+=` realIndices[${rt}] = int( mod(float(bcastedIndices[${a+rt}]), ${it[rt]}.0) ); `;const at=` void ${et}(int bcastedIndices[${tt}], out int realIndices[${$}]) { ${nt} realIndices[${$-1}] = bcastedIndices[${tt-1}]; realIndices[${$-2}] = bcastedIndices[${tt-2}]; } `;ot[et]=new j.GlslLibRoutine(at)}}),ot}indicesToOffset(){const tt={};return this.context.programInfo.inputNames.forEach((ot,st)=>{const ct=this.context.inputTextureLayouts[st].shape,it=this.context.inputTextureLayouts[st].strides,$=ct.length;let a=`indicesToOffset_${ot}`;tt[a]=new j.GlslLibRoutine(_e.indexToOffsetSingle(a,$,it)),a=`indicesToOffset_${ot}_T`,tt[a]=new j.GlslLibRoutine(_e.indexToOffsetSingle(a,$,it.slice().reverse()))}),tt}static indexToOffsetSingle(tt,ot,st){let ct="";for(let it=ot-1;it>=0;--it)ct+=` offset += indices[${it}] * ${st[it]}; `;return` int ${tt}(int indices[${ot}]) { int offset = 0; ${ct} return offset; } `}offsetToIndices(){const tt={};return this.context.programInfo.inputNames.forEach((ot,st)=>{const ct=this.context.inputTextureLayouts[st].shape,it=this.context.inputTextureLayouts[st].strides,$=ct.length;let a=`offsetToIndices_${ot}`;tt[a]=new j.GlslLibRoutine(_e.offsetToIndicesSingle(a,$,it)),a=`offsetToIndices_${ot}_T`,tt[a]=new j.GlslLibRoutine(_e.offsetToIndicesSingle(a,$,it.slice().reverse()))}),tt}static offsetToIndicesSingle(tt,ot,st){const ct=[];for(let it=0;it{const ct=this.context.inputTextureLayouts[st].shape,it=ct.length,$=`incrementIndices_${ot}`;let a="";for(let nt=0;nt= 0; --i) { if(i > axis) continue; indices[i] += 1; if(indices[i] < shape[i]) { break; } indices[i] = 0; } } `;tt[$]=new j.GlslLibRoutine(et)}),tt}}o.ShapeUtilsGlslLib=_e},5060:(i,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.getDefaultFragShaderMain=o.getFragShaderPreamble=o.getVertexShaderSource=o.getGlsl=void 0;const s={version:"",attribute:"attribute",varyingVertex:"varying",varyingFrag:"varying",texture2D:"texture2D",output:"gl_FragColor",outputDeclaration:""},j={version:"#version 300 es",attribute:"in",varyingVertex:"out",varyingFrag:"in",texture2D:"texture",output:"outputColor",outputDeclaration:"out vec4 outputColor;"};function _e(lt){return lt===1?s:j}o.getGlsl=_e,o.getVertexShaderSource=function(lt){const tt=_e(lt);return`${tt.version} precision highp float; ${tt.attribute} vec3 position; ${tt.attribute} vec2 textureCoord; ${tt.varyingVertex} vec2 TexCoords; void main() { gl_Position = vec4(position, 1.0); TexCoords = textureCoord; }`},o.getFragShaderPreamble=function(lt){const tt=_e(lt);return`${tt.version} precision highp float; precision highp int; precision highp sampler2D; ${tt.varyingFrag} vec2 TexCoords; ${tt.outputDeclaration} const vec2 halfCR = vec2(0.5, 0.5); // Custom vector types to handle higher dimenalities. struct ivec5 { int x; int y; int z; int w; int u; }; struct ivec6 { int x; int y; int z; int w; int u; int v; }; int imod(int x, int y) { return x - y * (x / y); } `},o.getDefaultFragShaderMain=function(lt,tt){return` void main() { int indices[${tt}]; toVec(TexCoords, indices); vec4 result = vec4(process(indices)); ${_e(lt).output} = result; } `}},3891:(i,o,s)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.VecGlslLib=void 0;const j=s(8520);class _e extends j.GlslLib{constructor(tt){super(tt)}getCustomTypes(){return{}}getFunctions(){return Object.assign(Object.assign(Object.assign(Object.assign({},this.binaryVecFunctions()),this.copyVec()),this.setVecItem()),this.getVecItem())}binaryVecFunctions(){const tt=this.context.outputTextureLayout.shape.length,ot={add:"+=",sub:"-=",mul:"*=",div:"/="},st={};for(const ct in ot){const it=`${ct}Vec`;let $="";for(let et=0;et{Object.defineProperty(o,"__esModule",{value:!0}),o.WebGLInferenceHandler=void 0;const j=s(6231),_e=s(9162),lt=s(2517),tt=s(2403),ot=s(7019),st=s(8710),ct=s(5611),it=s(4057),$=s(2039);o.WebGLInferenceHandler=class{constructor(a){this.session=a,this.packedTextureDataCache=new Map,this.unpackedTextureDataCache=new Map}calculateTextureWidthAndHeight(a,et){return(0,it.calculateTextureWidthAndHeight)(this.session.layoutStrategy,a,et)}executeProgram(a,et){if(et.length{const Zt=pt.map(Gt=>`${Gt.unpackedShape.join(",")};${Gt.width}x${Gt.height}`).join("_");let ht=mt.name;return mt.cacheHint&&(ht+="["+mt.cacheHint+"]"),ht+=":"+Zt,ht})(a,nt);let rt=this.session.programManager.getArtifact(at);const dt=rt?rt.programInfo:typeof a.get=="function"?a.get():a,ut=(0,it.createTextureLayoutFromTextureType)(this.session.layoutStrategy,dt.output.dims,dt.output.textureType),bt=this.createTextureData(ut,dt.output.type);return rt||(rt=this.session.programManager.build(dt,nt,bt),this.session.programManager.setArtifact(at,rt)),this.runProgram(rt,nt,bt),bt}run(a,et){return this.executeProgram(a,et).tensor}runProgram(a,et,nt){for(let at=0;atthis.readTexture(dt),async ut=>this.readTextureAsync(dt),void 0,rt),texture:nt});return this.setTextureData(dt.tensor.dataId,dt,a.isPacked),dt}getTextureData(a,et=!1){return this.session.isInitializer(a)?this.session.getTextureData(a,et):et?this.packedTextureDataCache.get(a):this.unpackedTextureDataCache.get(a)}setTextureData(a,et,nt=!1){this.session.isInitializer(a)?this.session.setTextureData(a,et,nt):(nt?this.packedTextureDataCache:this.unpackedTextureDataCache).set(a,et)}isTextureLayoutCached(a,et=!1){return!!this.getTextureData(a.dataId,et)}dispose(){this.session.textureManager.clearActiveTextures(),this.packedTextureDataCache.forEach(a=>this.session.textureManager.releaseTexture(a)),this.packedTextureDataCache=new Map,this.unpackedTextureDataCache.forEach(a=>this.session.textureManager.releaseTexture(a)),this.unpackedTextureDataCache=new Map}readTexture(a){return a.isPacked?this.readTexture(this.unpack(a)):this.session.backend.glContext.isFloat32DownloadSupported?this.session.textureManager.readTexture(a,a.tensor.type,a.channels):this.session.textureManager.readUint8TextureAsFloat((0,st.encodeAsUint8)(this,a))}async readTextureAsync(a){return a.isPacked?this.readTextureAsync(this.unpack(a)):this.session.backend.glContext.isFloat32DownloadSupported?this.session.textureManager.readTextureAsync(a,a.tensor.type,a.channels):this.session.textureManager.readUint8TextureAsFloat((0,st.encodeAsUint8)(this,a))}pack(a){return this.executeProgram((0,tt.createPackProgramInfoLoader)(this,a.tensor),[a.tensor])}unpack(a){return this.executeProgram((0,ct.createUnpackProgramInfoLoader)(this,a.tensor),[a.tensor])}}},1640:function(i,o,s){var j=this&&this.__createBinding||(Object.create?function(Ht,wt,Et,At){At===void 0&&(At=Et);var Il=Object.getOwnPropertyDescriptor(wt,Et);Il&&!("get"in Il?!wt.__esModule:Il.writable||Il.configurable)||(Il={enumerable:!0,get:function(){return wt[Et]}}),Object.defineProperty(Ht,At,Il)}:function(Ht,wt,Et,At){At===void 0&&(At=Et),Ht[At]=wt[Et]}),_e=this&&this.__setModuleDefault||(Object.create?function(Ht,wt){Object.defineProperty(Ht,"default",{enumerable:!0,value:wt})}:function(Ht,wt){Ht.default=wt}),lt=this&&this.__importStar||function(Ht){if(Ht&&Ht.__esModule)return Ht;var wt={};if(Ht!=null)for(var Et in Ht)Et!=="default"&&Object.prototype.hasOwnProperty.call(Ht,Et)&&j(wt,Ht,Et);return _e(wt,Ht),wt};Object.defineProperty(o,"__esModule",{value:!0}),o.WEBGL_OP_RESOLVE_RULES=void 0;const tt=s(2898),ot=lt(s(7839)),st=s(4196),ct=s(2069),it=s(8138),$=s(9663),a=s(5193),et=s(7992),nt=s(1253),at=s(4776),rt=s(6572),dt=s(3346),ut=s(5623),bt=s(2870),mt=s(2143),pt=s(4939),Zt=s(718),ht=s(2268),Gt=s(8117),Xt=s(2278),Vt=s(5524),Yt=s(5975),St=s(3933),Lt=s(6558),Ct=s(5723),Tt=s(3738),ft=lt(s(4909)),Ft=s(8428),Jt=s(9793);o.WEBGL_OP_RESOLVE_RULES=[["Abs","","6+",ft.abs],["Acos","","7+",ft.acos],["Add","","7+",ot.add],["And","","7+",ot.and],["Asin","","7+",ft.asin],["Atan","","7+",ft.atan],["AveragePool","","7+",mt.averagePool,mt.parseAveragePoolAttributes],["BatchNormalization","","7+",tt.batchNormalization,tt.parseBatchNormalizationAttributes],["Cast","","6+",st.cast,st.parseCastAttributes],["Ceil","","6+",ft.ceil],["Clip","","6-10",ft.clip,ft.parseClipAttributes],["Clip","","11+",ft.clipV11],["Concat","","4+",ct.concat,ct.parseConcatAttributes],["Conv","","1+",it.conv,it.parseConvAttributes],["ConvTranspose","","1+",$.convTranspose,$.parseConvTransposeAttributes],["Cos","","7+",ft.cos],["Div","","7+",ot.div],["Dropout","","7+",ft.identity],["DepthToSpace","","1+",a.depthToSpace,a.parseDepthToSpaceAttributes],["Equal","","7+",ot.equal],["Elu","","6+",ft.elu,ft.parseEluAttributes],["Exp","","6+",ft.exp],["Flatten","","1+",et.flatten,et.parseFlattenAttributes],["Floor","","6+",ft.floor],["FusedConv","com.microsoft","1+",it.conv,it.parseConvAttributes],["Gather","","1+",nt.gather,nt.parseGatherAttributes],["Gemm","","7-10",at.gemm,at.parseGemmAttributesV7],["Gemm","","11+",at.gemm,at.parseGemmAttributesV11],["GlobalAveragePool","","1+",mt.globalAveragePool,mt.parseGlobalAveragePoolAttributes],["GlobalMaxPool","","1+",mt.globalMaxPool],["Greater","","7+",ot.greater],["Identity","","1+",ft.identity],["ImageScaler","","1+",rt.imageScaler,rt.parseImageScalerAttributes],["InstanceNormalization","","6+",dt.instanceNormalization,dt.parseInstanceNormalizationAttributes],["LeakyRelu","","6+",ft.leakyRelu,ft.parseLeakyReluAttributes],["Less","","7+",ot.less],["Log","","6+",ft.log],["MatMul","","1+",ut.matMul,ut.parseMatMulAttributes],["MaxPool","","1+",mt.maxPool,mt.parseMaxPoolAttributes],["Mul","","7+",ot.mul],["Neg","","6+",ft.neg],["Not","","1+",ft.not],["Or","","7+",ot.or],["Pad","","2-10",bt.padV2,bt.parsePadAttributesV2],["Pad","","11+",bt.padV11,bt.parsePadAttributesV11],["Pow","","7+",ot.pow],["PRelu","","7+",ot.pRelu],["ReduceLogSum","","1+",pt.reduceLogSum,pt.parseReduceAttributes],["ReduceMax","","1+",pt.reduceMax,pt.parseReduceAttributes],["ReduceMean","","1+",pt.reduceMean,pt.parseReduceAttributes],["ReduceMin","","1+",pt.reduceMin,pt.parseReduceAttributes],["ReduceProd","","1+",pt.reduceProd,pt.parseReduceAttributes],["ReduceSum","","1-12",pt.reduceSum,pt.parseReduceAttributes],["ReduceSumSquare","","1+",pt.reduceLogSumSquare,pt.parseReduceAttributes],["Relu","","6+",ft.relu],["Reshape","","5+",Zt.reshape],["Resize","","10",ht.resize,ht.parseResizeAttributesV10],["Resize","","11+",ht.resize,ht.parseResizeAttributesV11],["Shape","","1+",Gt.shape],["Sigmoid","","6+",ft.sigmoid],["Sin","","7+",ft.sin],["Slice","","10+",Xt.sliceV10],["Slice","","1-9",Xt.slice,Xt.parseSliceAttributes],["Softmax","","1-12",Vt.softmax,Vt.parseSoftmaxAttributes],["Softmax","","13+",Vt.softmaxV13,Vt.parseSoftmaxAttributesV13],["Split","","2-12",Yt.split,Yt.parseSplitAttributes],["Sqrt","","6+",ft.sqrt],["Squeeze","","1-12",St.squeeze,St.parseSqueezeAttributes],["Squeeze","","13+",St.squeezeV13],["Sub","","7+",ot.sub],["Sum","","6+",Lt.sum],["Tan","","7+",ft.tan],["Tanh","","6+",ft.tanh],["Tile","","6+",Ct.tile],["Transpose","","1+",Tt.transpose,Tt.parseTransposeAttributes],["Upsample","","7-8",Jt.upsample,Jt.parseUpsampleAttributesV7],["Upsample","","9",Jt.upsample,Jt.parseUpsampleAttributesV9],["Unsqueeze","","1-12",Ft.unsqueeze,Ft.parseUnsqueezeAttributes],["Unsqueeze","","13+",Ft.unsqueezeV13],["Xor","","7+",ot.xor]]},2898:(i,o,s)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.parseBatchNormalizationAttributes=o.batchNormalization=void 0;const j=s(246),_e=s(5060),lt=s(2039),tt={name:"BatchNormalization",inputNames:["A","Scale","B","Mean","Variance"],inputTypes:[lt.TextureType.unpacked,lt.TextureType.unpacked,lt.TextureType.unpacked,lt.TextureType.unpacked,lt.TextureType.unpacked]};o.batchNormalization=(ct,it,$)=>(st(it),[ct.run(Object.assign(Object.assign({},tt),{cacheHint:$.cacheKey,get:()=>ot(ct,it,$)}),it)]),o.parseBatchNormalizationAttributes=ct=>{const it=ct.attributes.getFloat("epsilon",1e-5),$=ct.attributes.getFloat("momentum",.9),a=ct.attributes.getInt("spatial",1);return(0,j.createAttributeWithCacheKey)({epsilon:it,momentum:$,spatial:a})};const ot=(ct,it,$)=>{const a=(0,_e.getGlsl)(ct.session.backend.glContext.version),et=it[0].dims.length,[nt,at]=ct.calculateTextureWidthAndHeight(it[1].dims,lt.TextureType.unpacked),rt=` float process(int[${et}] indices) { vec2 position = offsetToCoords(indices[1], ${nt}, ${at}); float scale = getColorAsFloat(${a.texture2D}(Scale, position)); float mean = getColorAsFloat(${a.texture2D}(Mean, position)); float variance = getColorAsFloat(${a.texture2D}(Variance, position)); float b = getColorAsFloat(${a.texture2D}(B, position)); return scale * ( (_A(indices) - mean) / sqrt(variance + float(${$.epsilon})) ) + b; }`;return Object.assign(Object.assign({},tt),{output:{dims:it[0].dims,type:it[0].type,textureType:lt.TextureType.unpacked},shaderSource:rt})},st=ct=>{if(!ct||ct.length!==5)throw new Error("BatchNormalization requires 5 inputs.");const it=ct[0],$=ct[1],a=ct[2],et=ct[3],nt=ct[4];if(it.dims.length<3||$.dims.length!==1||a.dims.length!==1||et.dims.length!==1||nt.dims.length!==1)throw new Error("invalid input shape.");if($.dims[0]!==it.dims[1]||a.dims[0]!==it.dims[1]||et.dims[0]!==it.dims[1]||nt.dims[0]!==it.dims[1])throw new Error("invalid input shape.");if(it.type!=="float32"&&it.type!=="float64"||$.type!=="float32"&&$.type!=="float64"||a.type!=="float32"&&a.type!=="float64"||et.type!=="float32"&&et.type!=="float64"||nt.type!=="float32"&&nt.type!=="float64")throw new Error("invalid input tensor types.")}},7839:(i,o,s)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.xor=o.sub=o.pRelu=o.pow=o.or=o.mul=o.less=o.greater=o.equal=o.div=o.and=o.add=o.glslPRelu=o.glslPow=o.glslXor=o.glslOr=o.glslAnd=o.glslLess=o.glslGreater=o.glslEqual=o.glslSub=o.glslMul=o.glslDiv=o.glslAdd=void 0;const j=s(2517),_e=s(8520),lt=s(5060),tt=s(2039);function ot(){const pt="add_";return{body:` float ${pt}(float a, float b) { return a + b; } vec4 ${pt}(vec4 v1, vec4 v2) { return v1 + v2; } `,name:pt,type:_e.FunctionType.ValueBased}}function st(){const pt="div_";return{body:` float ${pt}(float a, float b) { return a / b; } vec4 ${pt}(vec4 v1, vec4 v2) { return v1 / v2; } `,name:pt,type:_e.FunctionType.ValueBased}}function ct(){const pt="mul_";return{body:` float ${pt}(float a, float b) { return a * b; } vec4 ${pt}(vec4 v1, vec4 v2) { return v1 * v2; } `,name:pt,type:_e.FunctionType.ValueBased}}function it(){const pt="sub_";return{body:` float ${pt}(float a, float b) { return a - b; } vec4 ${pt}(vec4 v1, vec4 v2) { return v1 - v2; } `,name:pt,type:_e.FunctionType.ValueBased}}function $(){const pt="equal_";return{body:` float ${pt}(float a, float b) { return float(a == b); } vec4 ${pt}(vec4 v1, vec4 v2) { return vec4(equal(v1, v2)); } `,name:pt,type:_e.FunctionType.ValueBased}}function a(){const pt="greater_";return{body:` float ${pt}(float a, float b) { return float(a > b); } vec4 ${pt}(vec4 v1, vec4 v2) { return vec4( v1.r > v2.r , v1.g > v2.g, v1.b > v2.b, v1.a > v2.a ); } `,name:pt,type:_e.FunctionType.ValueBased}}function et(){const pt="less_";return{body:` float ${pt}(float a, float b) { return float(a < b); } vec4 ${pt}(vec4 v1, vec4 v2) { return vec4( v1.r < v2.r , v1.g < v2.g, v1.b < v2.b, v1.a < v2.a ); } `,name:pt,type:_e.FunctionType.ValueBased}}function nt(){const pt="and_";return{body:` float ${pt}(float a, float b) { return float( bool(a) && bool(b) ); } vec4 ${pt}(vec4 v1, vec4 v2) { bvec4 b1 = bvec4(v1); bvec4 b2 = bvec4(v2); return vec4( b1.r && b2.r , b1.g && b2.g, b1.b && b2.b, b1.a && b2.a ); } `,name:pt,type:_e.FunctionType.ValueBased}}function at(){const pt="or_";return{body:` float ${pt}(float a, float b) { return float( bool(a) || bool(b) ); } vec4 ${pt}(vec4 v1, vec4 v2) { bvec4 b1 = bvec4(v1); bvec4 b2 = bvec4(v2); return vec4( b1.r || b2.r , b1.g || b2.g, b1.b || b2.b, b1.a || b2.a ); } `,name:pt,type:_e.FunctionType.ValueBased}}function rt(){const pt="xor_";return{body:` float ${pt}(float a, float b) { return float( bool(a) ^^ bool(b) ); } vec4 ${pt}(vec4 v1, vec4 v2) { bvec4 b1 = bvec4(v1); bvec4 b2 = bvec4(v2); return vec4( b1.r ^^ b2.r , b1.g ^^ b2.g, b1.b ^^ b2.b, b1.a ^^ b2.a ); } `,name:pt,type:_e.FunctionType.ValueBased}}function dt(){return function(pt){const Zt=`${pt}_`;return{body:` float ${Zt}(float a, float b) { return ${pt}(a, b); } vec4 ${Zt}(vec4 v1, vec4 v2) { return ${pt}(v1, v2); } `,name:Zt,type:_e.FunctionType.ValueBased}}("pow")}function ut(){const pt="prelu_";return{body:` float ${pt}(float a, float b) { return a < 0.0 ? a * b: a; } vec4 ${pt}(vec4 v1, vec4 v2) { return vec4( v1.r < 0.0 ? v1.r * v2.r: v1.r, v1.g < 0.0 ? v1.g * v2.g: v1.g, v1.b < 0.0 ? v1.b * v2.b: v1.b, v1.a < 0.0 ? v1.a * v2.a: v1.a ); } `,name:pt,type:_e.FunctionType.ValueBased}}o.glslAdd=ot,o.glslDiv=st,o.glslMul=ct,o.glslSub=it,o.glslEqual=$,o.glslGreater=a,o.glslLess=et,o.glslAnd=nt,o.glslOr=at,o.glslXor=rt,o.glslPow=dt,o.glslPRelu=ut;const bt=(pt,Zt,ht,Gt=Zt[0].type,Xt)=>{const Vt=pt.session.pack?tt.TextureType.packed:tt.TextureType.unpacked;return{name:ht.name,inputNames:["A","B"],inputTypes:[Vt,Vt],cacheHint:Xt,get:()=>mt(pt,Zt,ht,Gt)}},mt=(pt,Zt,ht,Gt=Zt[0].type)=>{const Xt=pt.session.pack?tt.TextureType.packed:tt.TextureType.unpacked,Vt=!j.ShapeUtil.areEqual(Zt[0].dims,Zt[1].dims);let Yt=Zt[0].dims;const St=pt.session.pack;if(Vt){const Tt=j.BroadcastUtil.calcShape(Zt[0].dims,Zt[1].dims,!1);if(!Tt)throw new Error("Can't perform binary op on the given tensors");Yt=Tt;const ft=Yt.length,Ft=Zt[0].dims.length!==0?Zt[0].dims.length:1,Jt=Zt[1].dims.length!==0?Zt[1].dims.length:1,Ht=Zt[0].dims.length!==0?"bcastIndices_A(indices, aindices);":"aindices[0] = 0;",wt=Zt[1].dims.length!==0?"bcastIndices_B(indices, bindices);":"bindices[0] = 0;",Et=(0,lt.getGlsl)(pt.session.backend.glContext.version),At=St?` ${ht.body} void main() { vec4 a = getAAtOutCoords(); vec4 b = getBAtOutCoords(); vec4 result = ${ht.name}(a, b); ${Et.output} = result; }`:` ${ht.body} float process(int indices[${ft}]) { int aindices[${Ft}]; int bindices[${Jt}]; ${Ht} ${wt} return ${ht.name}(_A(aindices), _B(bindices)); }`;return{name:ht.name,inputNames:["A","B"],inputTypes:[Xt,Xt],output:{dims:Yt,type:Gt,textureType:Xt},shaderSource:At,hasMain:St}}const Lt=(0,lt.getGlsl)(pt.session.backend.glContext.version),Ct=` ${ht.body} void main() { vec4 v1 = ${Lt.texture2D}(A, TexCoords); vec4 v2 = ${Lt.texture2D}(B, TexCoords); vec4 result = ${ht.name}(v1, v2); ${Lt.output} = result; } `;return{name:ht.name,inputNames:["A","B"],inputTypes:[Xt,Xt],output:{dims:Zt[0].dims,type:Gt,textureType:Xt},shaderSource:Ct,hasMain:!0}};o.add=(pt,Zt)=>[pt.run(bt(pt,Zt,ot()),Zt)],o.and=(pt,Zt)=>[pt.run(bt(pt,Zt,nt(),"bool"),Zt)],o.div=(pt,Zt)=>[pt.run(bt(pt,Zt,st()),Zt)],o.equal=(pt,Zt)=>[pt.run(bt(pt,Zt,$(),"bool"),Zt)],o.greater=(pt,Zt)=>[pt.run(bt(pt,Zt,a(),"bool"),Zt)],o.less=(pt,Zt)=>[pt.run(bt(pt,Zt,et(),"bool"),Zt)],o.mul=(pt,Zt)=>[pt.run(bt(pt,Zt,ct()),Zt)],o.or=(pt,Zt)=>[pt.run(bt(pt,Zt,at(),"bool"),Zt)],o.pow=(pt,Zt)=>[pt.run(bt(pt,Zt,dt()),Zt)],o.pRelu=(pt,Zt)=>[pt.run(bt(pt,Zt,ut()),Zt)],o.sub=(pt,Zt)=>[pt.run(bt(pt,Zt,it()),Zt)],o.xor=(pt,Zt)=>[pt.run(bt(pt,Zt,rt(),"bool"),Zt)]},4196:(i,o,s)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.parseCastAttributes=o.cast=void 0;const j=s(2517);o.cast=(lt,tt,ot)=>(_e(tt),[lt.cast(tt[0],ot)]),o.parseCastAttributes=lt=>j.ProtoUtil.tensorDataTypeFromProto(lt.attributes.getInt("to"));const _e=lt=>{if(!lt||lt.length!==1)throw new Error("Cast requires 1 input.");if(lt[0].type==="string")throw new Error("Invalid input type.")}},1163:(i,o,s)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createPackedConcatProgramInfoLoader=void 0;const j=s(5060),_e=s(2039),lt=s(9390),tt=s(2827);o.createPackedConcatProgramInfoLoader=(st,ct,it)=>{const $=(a=ct.length,et=it.cacheKey,{name:"Concat (packed)",inputNames:Array.from({length:a},(nt,at)=>`X${at}`),inputTypes:Array(a).fill(_e.TextureType.packed),cacheHint:et});var a,et;return Object.assign(Object.assign({},$),{get:()=>((nt,at,rt,dt)=>{const ut=rt[0].dims.slice();if(dt>=ut.length||dt<-1*ut.length)throw new Error("axis specified for concat doesn't match input dimensionality");dt<0&&(dt=ut.length+dt);const bt=ut.slice(0);for(let Ht=1;HtHt.dims),Xt=(0,lt.getGlChannels)(mt),Vt=new Array(Gt.length-1);Vt[0]=Gt[0][dt];for(let Ht=1;Ht= ${Vt[Ht-1]}) { return getChannel( getX${Ht}(${ot(Xt,Yt,wt)}), vec2(${ot(St,Yt,wt)})); }`}const Tt=Vt.length,ft=Vt[Vt.length-1];Ct+=` return getChannel( getX${Tt}(${ot(Xt,Yt,ft)}), vec2(${ot(St,Yt,ft)}));`;const Ft=(0,j.getGlsl)(nt.session.backend.glContext.version),Jt=` ${ht} float getValue(${Xt.map(Ht=>"int "+Ht)}) { ${Ct} } void main() { ${Zt} coords = getOutputCoords(); int lastDim = coords.${Xt[mt-1]}; coords.${Xt[mt-1]} = coords.${Xt[mt-2]}; coords.${Xt[mt-2]} = lastDim; vec4 result = vec4(getValue(${pt}), 0., 0., 0.); ${pt[mt-1]} = ${pt[mt-1]} + 1; if (${pt[mt-1]} < ${bt[mt-1]}) { result.g = getValue(${pt}); } ${pt[mt-2]} = ${pt[mt-2]} + 1; if (${pt[mt-2]} < ${bt[mt-2]}) { result.a = getValue(${pt}); } ${pt[mt-1]} = ${pt[mt-1]} - 1; if (${pt[mt-2]} < ${bt[mt-2]} && ${pt[mt-1]} < ${bt[mt-1]}) { result.b = getValue(${pt}); } ${Ft.output} = result; } `;return Object.assign(Object.assign({},at),{output:{dims:bt,type:rt[0].type,textureType:_e.TextureType.packed},shaderSource:Jt,hasMain:!0})})(st,$,ct,it.axis)})};const ot=(st,ct,it)=>{const $=st.indexOf(ct);return st.map((a,et)=>et===$?`${a} - ${it}`:a).join()}},2069:(i,o,s)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.parseConcatAttributes=o.concat=void 0;const j=s(246),_e=s(2039),lt=s(1163);o.concat=(a,et,nt)=>($(et),a.session.pack&&et[0].dims.length>1?[a.run((0,lt.createPackedConcatProgramInfoLoader)(a,et,nt),et)]:[a.run(tt(a,et,nt),et)]);const tt=(a,et,nt)=>{const at=(rt=et.length,dt=nt.cacheKey,{name:"Concat",inputNames:Array.from({length:rt},(ut,bt)=>`X${bt}`),inputTypes:Array(rt).fill(_e.TextureType.unpacked),cacheHint:dt});var rt,dt;return Object.assign(Object.assign({},at),{get:()=>((ut,bt,mt,pt)=>{const Zt=mt[0].dims.slice();if(pt>=Zt.length||pt<-1*Zt.length)throw new Error("axis specified for concat doesn't match input dimensionality");pt<0&&(pt=Zt.length+pt);const ht=Zt.slice(0);for(let Lt=1;Lt`int getTextureWhereDataResides(int index) { ${a.map((et,nt)=>`if(index<${et}) {return ${nt};} `).join("")} }`,st=a=>ot(a),ct=(a,et)=>{const nt=[`float fetchDataFromCorrectTexture(int textureIndex, int indices[${et}]) {`];for(let at=0;at{const et=["int getSizeInConcatAxisValueFromIndex(int index) {"];for(let nt=0;nt(0,j.createAttributeWithCacheKey)({axis:a.attributes.getInt("axis")});const $=a=>{if(!a||a.length<1)throw new Error("too few inputs");const et=a[0].type,nt=a[0].dims.length;if(et==="string")throw new Error("string tensor is not supported yet");for(const at of a){if(at.type!==et)throw new Error("input tensors should be one type");if(at.dims.length!==nt)throw new Error("input tensors should have the same shape")}}},4770:(i,o,s)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createUnpackedGroupedConvProgramInfoLoader=void 0;const j=s(6231),_e=s(5060),lt=s(2039),tt=s(8138),ot=s(2823);o.createUnpackedGroupedConvProgramInfoLoader=(st,ct,it)=>{const $=(a=ct.length>2,et=it.cacheKey,{name:"GroupedConv",inputNames:a?["X","W","Bias"]:["X","W"],inputTypes:a?[lt.TextureType.unpacked,lt.TextureType.unpacked,lt.TextureType.unpacked]:[lt.TextureType.unpacked,lt.TextureType.unpacked],cacheHint:et});var a,et;return Object.assign(Object.assign({},$),{get:()=>((nt,at,rt,dt)=>{const ut=at.length>2?"value += getBias(output_channel);":"",bt=at[0].dims.slice(),mt=at[1].dims.slice(),pt=mt[0]/dt.group;j.Logger.verbose("GroupedConv",`autpPad:${dt.autoPad}, dilations:${dt.dilations}, group:${dt.group}, kernelShape:${dt.kernelShape}, pads:${dt.pads}, strides:${dt.strides}`);const Zt=(0,tt.calculateOutputShape)(bt,mt,dt.dilations,dt.pads,dt.strides),ht=(0,_e.getGlsl)(nt.session.backend.glContext.version),{activationFunction:Gt,applyActivation:Xt}=(0,ot.getActivationSnippet)(dt),Vt=` const ivec2 strides = ivec2(${dt.strides[0]}, ${dt.strides[1]}); const ivec2 pads = ivec2(${dt.pads[0]}, ${dt.pads[1]}); ${Gt} void main() { ivec4 coords = getOutputCoords(); int batch = coords.x; int output_channel = coords.y; ivec2 xRCCorner = coords.zw * strides - pads; int group_id = output_channel / ${pt}; float value = 0.0; for (int wInChannel = 0; wInChannel < ${mt[1]}; wInChannel++) { int input_channel = group_id * ${mt[1]} + wInChannel; for (int wHeight = 0; wHeight < ${mt[2]}; wHeight++) { int xHeight = xRCCorner.x + wHeight * ${dt.dilations[0]}; if (xHeight < 0 || xHeight >= ${bt[2]}) { continue; } for (int wWidth = 0; wWidth < ${mt[3]}; wWidth++) { int xWidth = xRCCorner.y + wWidth * ${dt.dilations[1]}; if (xWidth < 0 || xWidth >= ${bt[3]}) { continue; } float xVal = getX(batch, input_channel, xWidth, xHeight); float wVal = getW(output_channel, wInChannel, wWidth, wHeight); value += xVal*wVal; } } } ${ut} ${Xt} ${ht.output} = vec4(value, .0, .0, .0); } `;return Object.assign(Object.assign({},rt),{output:{dims:Zt,type:at[0].type,textureType:lt.TextureType.unpacked},shaderSource:Vt,hasMain:!0})})(st,ct,$,it)})}},1386:(i,o,s)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.conv2DPacked=o.conv2DPackedPointwise=void 0;const j=s(8138),_e=s(8555),lt=s(708);o.conv2DPackedPointwise=(tt,ot,st)=>{const ct=ot[0].dims,it=ot[1].dims,$=(0,j.calculateOutputShape)(ct,it,st.dilations,st.pads,st.strides),a=tt.reshapePacked(ot[0],[ct[1],ct[2]*ct[3]]),et=tt.reshapePacked(ot[1],[it[0],it[1]]),nt=ot.length>2?[et,a,ot[2]]:[et,a],at=tt.run((0,lt.createPackedMatmulProgramInfoLoader)(tt,nt,st),nt);return tt.reshapePacked(at,$)},o.conv2DPacked=(tt,ot,st)=>{const ct=ot[0].dims,it=ot[1].dims,$=(0,j.calculateOutputShape)(ct,it,st.dilations,st.pads,st.strides),a=tt.run((0,_e.createPackedIm2ColProgramInfoLoader)(tt,ot[0],ot[1],$,st),[ot[0]]),et=tt.reshapePacked(ot[1],[it[0],it[1]*it[2]*it[3]]),nt=ot.length===3?[et,a,ot[2]]:[et,a],at=tt.run((0,lt.createPackedMatmulProgramInfoLoader)(tt,nt,st),nt);return tt.reshapePacked(at,$)}},9663:(i,o,s)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.parseConvTransposeAttributes=o.convTranspose=void 0;const j=s(246),_e=s(5060),lt=s(2039),tt=s(2823),ot=(et,nt,at,rt,dt,ut)=>(et-1)*nt+at+(rt-1)*dt+1-ut,st=(et,nt,at,rt,dt)=>{const ut=Math.floor(et/2);nt==="SAME_UPPER"?(at[rt]=ut,at[dt]=et-ut):nt==="SAME_LOWER"&&(at[rt]=et-ut,at[dt]=ut)};o.convTranspose=(et,nt,at)=>(a(nt,at),ct(et,nt,at));const ct=(et,nt,at)=>{const rt=$(at,nt);return[it(et,nt,rt)]},it=(et,nt,at)=>et.run(((rt,dt,ut)=>{const bt=(mt=dt.length>2,pt=ut.cacheKey,{name:"ConvTranspose",inputNames:mt?["X","W","B"]:["X","W"],inputTypes:mt?[lt.TextureType.unpacked,lt.TextureType.unpacked,lt.TextureType.unpacked]:[lt.TextureType.unpacked,lt.TextureType.unpacked],cacheHint:pt});var mt,pt;return Object.assign(Object.assign({},bt),{get:()=>((Zt,ht,Gt,Xt)=>{const Vt=ht.length>2?"getB(output_channel)":"0.0",Yt=ht[0].dims,St=ht[1].dims,Lt=St[1],Ct=St[0]/Xt.group,Tt=[ht[0].dims[0],ht[1].dims[1]*Xt.group,...Xt.outputShape],ft=(0,_e.getGlsl)(Zt.session.backend.glContext.version),{activationFunction:Ft,applyActivation:Jt}=(0,tt.getActivationSnippet)(Xt),Ht=` const ivec2 strides = ivec2(${Xt.strides[0]}, ${Xt.strides[1]}); const ivec2 pads = ivec2(${Xt.pads[0]}, ${Xt.pads[1]}); ${Ft} void main() { ivec4 coords = getOutputCoords(); int batch = coords.x; int output_channel = coords.y; ivec2 loc = coords.zw + pads; int group_id = output_channel / ${Lt}; int wOutChannel = output_channel - group_id * ${Lt}; float value = ${Vt}; for (int inChannelOffset = 0; inChannelOffset < ${Ct}; inChannelOffset++) { int input_channel = group_id * ${Ct} + inChannelOffset; for (int wWOff = 0; wWOff < ${St[2]}; wWOff++) { for (int wHOff = 0; wHOff < ${St[3]}; wHOff++) { ivec2 wOff = ivec2(wWOff * ${Xt.dilations[0]}, wHOff * ${Xt.dilations[1]}); ivec2 wLoc = loc - wOff; ivec2 wLocIn = wLoc / strides; if ( wLocIn * strides == wLoc && wLocIn.x >= 0 && wLocIn.x < ${Yt[2]} && wLocIn.y >= 0 && wLocIn.y < ${Yt[3]} ) { float xVal = getX(batch, input_channel, wLocIn.y, wLocIn.x); float wVal = getW(input_channel, wOutChannel, wHOff, wWOff); value += xVal * wVal; } } } } ${Jt} ${ft.output} = vec4(value, .0, .0, .0); } `;return Object.assign(Object.assign({},Gt),{output:{dims:Tt,type:ht[0].type,textureType:lt.TextureType.unpacked},shaderSource:Ht,hasMain:!0})})(rt,dt,bt,ut)})})(et,nt,at),nt),$=(et,nt)=>{const at=et.kernelShape.slice();if(et.kernelShape.length===0)for(let bt=2;bt{const Yt=bt.length-2,St=Vt.length===0;for(let Lt=0;Lt{const nt=et.attributes,at=(0,tt.parseInternalActivationAttributes)(nt),rt=nt.getString("auto_pad","NOTSET"),dt=nt.getInts("dilations",[1,1]),ut=nt.getInt("group",1),bt=nt.getInts("kernel_shape",[]),mt=nt.getInts("output_padding",[0,0]),pt=nt.getInts("output_shape",[]),Zt=nt.getInts("pads",[0,0,0,0]),ht=nt.getInts("strides",[1,1]);return(0,j.createAttributeWithCacheKey)(Object.assign({autoPad:rt,dilations:dt,group:ut,kernelShape:bt,outputPadding:mt,outputShape:pt,pads:Zt,strides:ht},at))};const a=(et,nt)=>{if(!et||et.length!==2&&et.length!==3)throw new Error("Conv requires 2 or 3 inputs");if(et[0].dims.length!==4||et[1].dims.length!==4)throw new Error("currently only support 2-dimensional conv");if(et[0].dims[1]!==et[1].dims[0])throw new Error("FILTER_IN_CHANNEL should be equal to DATA_CHANNEL");const at=et[1].dims[1]*nt.group;if(et.length===3&&(et[2].dims.length!==1||et[2].dims[0]!==at))throw new Error("invalid bias");const rt=et[0].dims.length-2;if(nt.dilations.length!==rt)throw new Error(`dilations should be ${rt}D`);if(nt.strides.length!==rt)throw new Error(`strides should be ${rt}D`);if(nt.pads.length!==2*rt)throw new Error(`pads should be ${2*rt}D`);if(nt.outputPadding.length!==rt)throw new Error(`output_padding should be ${rt}D`);if(nt.kernelShape.length!==0&&nt.kernelShape.length!==et[1].dims.length-2)throw new Error("invalid kernel shape");if(nt.outputShape.length!==0&&nt.outputShape.length!==et[0].dims.length-2)throw new Error("invalid output shape");if(et[0].type!=="float32"||et[1].type!=="float32")throw new Error("ConvTranspose input(X,W) should be float tensor");if(et.length===3&&et[2].type!=="float32")throw new Error("ConvTranspose input(bias) should be float tensor")}},8138:(i,o,s)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.parseConvAttributes=o.conv=o.calculateOutputShape=void 0;const j=s(246),_e=s(2517),lt=s(4770),tt=s(1386),ot=s(9828),st=s(2823),ct=s(3248),it=s(5623);o.calculateOutputShape=(rt,dt,ut,bt,mt)=>{const pt=rt[0],Zt=rt.slice(2),ht=Zt.length,Gt=dt[0],Xt=dt.slice(2).map((Yt,St)=>Yt+(Yt-1)*(ut[St]-1)),Vt=Zt.map((Yt,St)=>Yt+bt[St]+bt[St+ht]).map((Yt,St)=>Math.floor((Yt-Xt[St]+mt[St])/mt[St]));return[pt,Gt].concat(...Vt)},o.conv=(rt,dt,ut)=>(at(dt,ut),$(rt,dt,ut));const $=(rt,dt,ut)=>{const bt=nt(ut,dt),mt=rt.session.pack,pt=bt.kernelShape[0]===1&&bt.kernelShape[1]===1;return bt.group>1?[rt.run((0,lt.createUnpackedGroupedConvProgramInfoLoader)(rt,dt,bt),dt)]:pt&&mt?[a(rt,dt,bt)]:mt&&dt[0].dims.length===4&&dt[0].dims[0]===1&&!pt?[(0,tt.conv2DPacked)(rt,dt,bt)]:[et(rt,dt,bt)]},a=(rt,dt,ut)=>{const bt=dt[0].dims,mt=dt[1].dims,pt=(0,o.calculateOutputShape)(bt,mt,ut.dilations,ut.pads,ut.strides),Zt=rt.reshapeUnpacked(dt[0],[bt[1],bt[2]*bt[3]]),ht=rt.reshapeUnpacked(dt[1],[mt[0],mt[1]]),Gt=dt.length>2?[ht,Zt,dt[2]]:[ht,Zt],Xt=rt.run((0,it.createMatmulProgramInfoLoader)(Gt,ut),Gt);return rt.reshapeUnpacked(Xt,pt)},et=(rt,dt,ut)=>{const bt=dt[0].dims,mt=dt[1].dims,pt=(0,o.calculateOutputShape)(bt,mt,ut.dilations,ut.pads,ut.strides),Zt=rt.run((0,ct.createIm2ColProgramInfoLoader)(rt,dt[0],dt[1],pt,ut),[dt[0]]),ht=dt.length===3?[Zt,dt[1],dt[2]]:[Zt,dt[1]];return rt.run((0,ot.createDotProductProgramInfoLoader)(rt,dt,pt,ut),ht)},nt=(rt,dt)=>{const ut=rt.kernelShape.slice();if(rt.kernelShape.length===0)for(let pt=2;pt{const dt=rt.attributes,ut=(0,st.parseInternalActivationAttributes)(dt),bt=dt.getString("auto_pad","NOTSET"),mt=dt.getInts("dilations",[1,1]),pt=dt.getInt("group",1),Zt=dt.getInts("kernel_shape",[]),ht=dt.getInts("pads",[0,0,0,0]),Gt=dt.getInts("strides",[1,1]);return(0,j.createAttributeWithCacheKey)(Object.assign({autoPad:bt,dilations:mt,group:pt,kernelShape:Zt,pads:ht,strides:Gt},ut))};const at=(rt,dt)=>{if(!rt||rt.length!==2&&rt.length!==3)throw new Error("Conv requires 2 or 3 inputs");if(rt[0].dims.length!==4||rt[1].dims.length!==4)throw new Error("currently only support 2-dimensional conv");if(rt[0].dims[1]!==rt[1].dims[1]*dt.group)throw new Error("FILTER_IN_CHANNEL should be equal to DATA_CHANNEL");if(rt.length===3&&(rt[2].dims.length!==1||rt[1].dims[0]!==rt[2].dims[0]))throw new Error("invalid bias");const ut=rt[0].dims.length-2;if(dt.dilations.length!==ut)throw new Error(`dilations should be ${ut}D`);if(dt.strides.length!==ut)throw new Error(`strides should be ${ut}D`);if(dt.pads.length!==2*ut)throw new Error(`pads should be ${2*ut}D`);if(dt.kernelShape.length!==0&&dt.kernelShape.length!==rt[1].dims.length-2)throw new Error("invalid kernel shape");if(rt[0].type!=="float32"||rt[1].type!=="float32")throw new Error("Conv input(X,W) should be float tensor");if(rt.length===3&&rt[2].type!=="float32")throw new Error("Conv input(bias) should be float tensor")}},5193:(i,o,s)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.parseDepthToSpaceAttributes=o.depthToSpace=void 0;const j=s(3738);o.depthToSpace=(lt,tt,ot)=>{_e(tt);const st=ot.blocksize,ct=st*st,it=ot.mode==="DCR"?[0,3,4,1,5,2]:[0,1,4,2,5,3],$=ot.mode==="DCR"?[tt[0].dims[0],st,st,tt[0].dims[1]/ct,tt[0].dims[2],tt[0].dims[3]]:[tt[0].dims[0],tt[0].dims[1]/ct,st,st,tt[0].dims[2],tt[0].dims[3]],a=lt.reshapeUnpacked(tt[0],$),et={perm:it,cacheKey:`${it}`},[nt]=(0,j.transpose)(lt,[a],et),at=[tt[0].dims[0],tt[0].dims[1]/ct,tt[0].dims[2]*st,tt[0].dims[3]*st];return[lt.reshapeUnpacked(nt,at)]},o.parseDepthToSpaceAttributes=lt=>{const tt=lt.attributes.getInt("blocksize");if(tt<1)throw new Error(`blocksize must be >= 1, but got : ${tt} for DepthToSpace`);const ot=lt.attributes.getString("mode","DCR");if(ot!=="DCR"&&ot!=="CRD")throw new Error(`unrecognized mode: ${ot} for DepthToSpace`);return{mode:ot,blocksize:tt}};const _e=lt=>{if(lt.length!==1)throw new Error(`DepthToSpace expect 1 inputs, but got ${lt.length}`);if(lt[0].type==="string"||lt[0].dims.length!==4)throw new TypeError("DepthToSpace input should be a 4-D numeric tensor")}},9828:(i,o,s)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createDotProductProgramInfoLoader=void 0;const j=s(2517),_e=s(5060),lt=s(2039),tt=s(2823),ot=s(3248);o.createDotProductProgramInfoLoader=(st,ct,it,$)=>{const a=((et,nt)=>({name:"ConvDotProduct",inputNames:et?["Im2Col","K","B"]:["Im2Col","K"],inputTypes:et?[lt.TextureType.unpacked,lt.TextureType.packedLastDimension,lt.TextureType.unpacked]:[lt.TextureType.unpacked,lt.TextureType.packedLastDimension],cacheKey:nt.activationCacheKey}))(ct.length>2,$);return Object.assign(Object.assign({},a),{get:()=>((et,nt,at,rt,dt)=>{const ut=at[0].dims,bt=at[1].dims,mt=[bt[0],Math.ceil(ut[1]*bt[2]*bt[3]/4)],pt=(0,ot.calculateIm2ColDims)(ut,bt,rt),[Zt,ht]=et.calculateTextureWidthAndHeight(mt,lt.TextureType.packedLastDimension),Gt=j.ShapeUtil.computeStrides(pt),[Xt,Vt]=et.calculateTextureWidthAndHeight(pt,lt.TextureType.packedLastDimension),Yt=rt.length,St=at.length<3?"0.0":"_B(b)",Lt=Math.ceil(ut[1]*bt[2]*bt[3]/4),{activationFunction:Ct,applyActivation:Tt}=(0,tt.getActivationSnippet)(dt),ft=(0,_e.getGlsl)(et.session.backend.glContext.version),Ft=` ${Ct} float process(int indices[${Yt}]) { int b[1]; b[0] = indices[1]; int im2col[4]; im2col[0] = indices[0]; im2col[1] = indices[2]; im2col[2] = indices[3]; int im2colOffset = im2col[0] * ${Gt[0]} + im2col[1] * ${Gt[1]} + im2col[2] * ${Gt[2]}; int kernelOffset = indices[1] * ${mt[1]}; float value = ${St}; for (int i = 0; i < ${Lt}; ++i) { vec2 im2colCoords = offsetToCoords(im2colOffset, ${Xt}, ${Vt}); vec2 kernelCoords = offsetToCoords(kernelOffset, ${Zt}, ${ht}); value += dot(${ft.texture2D}(Im2Col, im2colCoords), ${ft.texture2D}(K, kernelCoords)); ++im2colOffset; ++kernelOffset; } ${Tt} return value; }`;return Object.assign(Object.assign({},nt),{output:{dims:rt,type:at[0].type,textureType:lt.TextureType.unpacked},shaderSource:Ft})})(st,a,ct,it,$)})}},7992:(i,o,s)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.parseFlattenAttributes=o.flatten=void 0;const j=s(2517);o.flatten=(lt,tt,ot)=>{_e(tt,ot);const st=j.ShapeUtil.flattenShape(tt[0].dims,ot);return[lt.reshapeUnpacked(tt[0],st)]},o.parseFlattenAttributes=lt=>lt.attributes.getInt("axis",1);const _e=(lt,tt)=>{if(!lt||lt.length!==1)throw new Error("Flatten requires 1 input.");const ot=lt[0].dims.length;if(ot===0)throw new Error("scalar tensor is not supported.");if(tt<-ot||tt>ot)throw new Error("Invalid axis");if(lt[0].type==="string")throw new Error("string tensor is not supported.")}},2823:(i,o,s)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.parseInternalActivationAttributes=o.getActivationSnippet=void 0;const j=s(2517),_e=s(4909);o.getActivationSnippet=function(lt){let tt;switch(lt.activation){case"Relu":tt=(0,_e.glslRelu)();break;case"Sigmoid":tt=(0,_e.glslSigmoid)();break;case"Clip":tt=(0,_e.glslClip)(lt.clipMin,lt.clipMax);break;default:return{activationFunction:"",applyActivation:""}}const ot=tt.name;return{activationFunction:tt.body,applyActivation:`value = ${ot}_(value);`}},o.parseInternalActivationAttributes=lt=>{const tt=lt.getString("activation","");if(tt==="Clip"){const[ot,st]=lt.getFloats("activation_params",[j.MIN_CLIP,j.MAX_CLIP]);return{activation:tt,clipMax:st,clipMin:ot,activationCacheKey:`${tt}:${ot},${st}`}}return{activation:tt,activationCacheKey:tt}}},1253:(i,o,s)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.parseGatherAttributes=o.gather=void 0;const j=s(246),_e=s(782),lt=s(2517),tt=s(2039);o.gather=(it,$,a)=>(ct($,a.axis),[it.run(st(it,$,a),$)]),o.parseGatherAttributes=it=>(0,j.createAttributeWithCacheKey)({axis:it.attributes.getInt("axis",0)});const ot={name:"Gather",inputNames:["A","B"],inputTypes:[tt.TextureType.unpacked,tt.TextureType.unpacked]},st=(it,$,a)=>{const et=Object.assign(Object.assign({},ot),{cacheHint:a.cacheKey});return Object.assign(Object.assign({},et),{get:()=>((nt,at,rt,dt)=>{const ut=rt[0].dims.slice(),bt=rt[1].dims.slice(),mt=new Array(ut.length+bt.length-1);dt=lt.ShapeUtil.normalizeAxis(dt,ut.length);const pt=[];for(let ht=0;ht{if(!it||it.length!==2)throw new Error("Gather requires 2 inputs.");const a=it[0].dims.length;if(a<1)throw new Error("Invalid input shape.");if($<-a||$>a-1)throw new Error("Invalid axis.");if(_e.NUMBER_TYPES.indexOf(it[0].type)===-1)throw new Error("Invaid input type.");if(it[1].type!=="int32"&&it[1].type!=="int16")throw new Error("Invaid input type.")}},4776:(i,o,s)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.parseGemmAttributesV11=o.parseGemmAttributesV7=o.gemm=void 0;const j=s(246),_e=s(2517),lt=s(2039);o.gemm=(it,$,a)=>(ct($,a),[it.run(ot($,a),$)]);const tt=(it,$)=>{const a=it.attributes.getInt("transA",0)!==0,et=it.attributes.getInt("transB",0)!==0,nt=it.attributes.getFloat("alpha",1),at=it.attributes.getFloat("beta",1);return(0,j.createAttributeWithCacheKey)({transA:a,transB:et,alpha:nt,beta:at,isOptionalC:$})};o.parseGemmAttributesV7=it=>tt(it,!1),o.parseGemmAttributesV11=it=>tt(it,!0);const ot=(it,$)=>{const a={name:"Gemm",inputNames:it.length===3?["A","B","C"]:["A","B"],inputTypes:it.length===3?[lt.TextureType.unpacked,lt.TextureType.unpacked,lt.TextureType.unpacked]:[lt.TextureType.unpacked,lt.TextureType.unpacked],key:$.cacheKey};return Object.assign(Object.assign({},a),{get:()=>st(a,it,$)})},st=(it,$,a)=>{const et=$[0].dims.slice(),nt=$[1].dims.slice(),[at,rt]=_e.GemmUtil.getShapeOfGemmResult(et,a.transA,nt,a.transB,$.length===3?$[2].dims:void 0),dt=[at,rt];if(!dt)throw new Error("Can't use gemm on the given tensors");let ut=et[et.length-1],bt="";a.transA&&(ut=et[0]),a.transA&&a.transB?bt="value += _A_T(a) * _B_T(b);":a.transA&&!a.transB?bt="value += _A_T(a) * _B(b);":!a.transA&&a.transB?bt="value += _A(a) * _B_T(b);":a.transA||a.transB||(bt="value += _A(a) * _B(b);");const mt=dt.length,pt=` float process(int indices[${mt}]) { int a[${mt}]; int b[${mt}]; ${$.length===3?`int c[${$[2].dims.length}];`:""} copyVec(indices, a); copyVec(indices, b); ${$.length===3?"bcastIndices_C(indices, c);":""} float value = 0.0; for (int k=0; k<${ut}; ++k) { a[${mt-1}] = k; b[${mt-2}] = k; ${bt} } value = value * alpha; ${$.length===3?"value += beta * _C(c);":""} return value; }`;return Object.assign(Object.assign({},it),{output:{dims:dt,type:$[0].type,textureType:lt.TextureType.unpacked},variables:[{name:"alpha",type:"float",data:a.alpha},{name:"beta",type:"float",data:a.beta}],shaderSource:pt})},ct=(it,$)=>{if(!it)throw new Error("Input is missing");if($.isOptionalC&&(it.length<2||it.length>3))throw new Error("Invaid input shape.");if(!$.isOptionalC&&it.length!==3)throw new Error("Gemm requires 3 inputs");if(it.length===3&&it[2].dims.length!==1&&it[2].dims.length!==2)throw new Error("Invalid input shape of C");if(it[0].type!=="float32"&&it[0].type!=="float64"||it[1].type!=="float32"&&it[1].type!=="float64"||it.length===3&&it[2].type!=="float32"&&it[2].type!=="float64")throw new Error("Invalid input type.");if(it[0].type!==it[1].type||it.length===3&&it[0].type!==it[2].type)throw new Error("Input types are mismatched")}},8555:(i,o,s)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createPackedIm2ColProgramInfoLoader=void 0;const j=s(5060),_e=s(2039),lt=s(2827);o.createPackedIm2ColProgramInfoLoader=(tt,ot,st,ct,it)=>{const $=(a=it.cacheKey,{name:"Im2Col (packed)",inputNames:["A"],inputTypes:[_e.TextureType.packed],cacheHint:a});var a;return Object.assign(Object.assign({},$),{get:()=>((et,nt,at,rt,dt,ut)=>{const bt=at.dims,mt=rt.dims,pt=dt.length,Zt=[mt[1]*mt[2]*mt[3],dt[2]*dt[3]],ht=mt[2]*mt[3],Gt=(0,lt.unpackFromChannel)(),Xt=(0,j.getGlsl)(et.session.backend.glContext.version);let Vt="";for(let St=0;St<=1;St++)for(let Lt=0;Lt<=1;Lt++)Vt+=` blockIndex = rc.x + ${Lt}; pos = rc.y + ${St}; if(blockIndex < ${Zt[1]} && pos < ${Zt[0]}) { offsetY = int(blockIndex / (${dt[pt-1]})) * ${ut.strides[0]} - ${ut.pads[0]}; d0 = offsetY + ${ut.dilations[0]} * (imod(pos, ${ht}) / ${mt[2]}); if(d0 < ${bt[2]} && d0 >= 0) { offsetX = imod(blockIndex, ${dt[pt-1]}) * ${ut.strides[1]} - ${ut.pads[1]}; d1 = offsetX + ${ut.dilations[1]} * imod(imod(pos, ${ht}), ${mt[2]}); if(d1 < ${bt[3]} && d1 >= 0) { ch = int(float(pos)/ ${ht}.); innerDims = vec2(d0, d1); result[${2*St+Lt}] = getChannel( getA(0, ch, int(innerDims.x), int(innerDims.y)), innerDims); } } } `;const Yt=` ${Gt} void main() { ivec2 rc = getOutputCoords(); vec4 result = vec4(0.0); int blockIndex, pos, offsetY, d0, offsetX, d1, ch; vec2 innerDims; ${Vt} ${Xt.output} = result; } `;return Object.assign(Object.assign({},nt),{output:{dims:Zt,type:at.type,textureType:_e.TextureType.packed},shaderSource:Yt,hasMain:!0})})(tt,$,ot,st,ct,it)})}},3248:(i,o,s)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.calculateIm2ColDims=o.createIm2ColProgramInfoLoader=void 0;const j=s(2039);o.createIm2ColProgramInfoLoader=(_e,lt,tt,ot,st)=>{const ct=(it=st.cacheKey,{name:"Im2Col",inputNames:["X"],inputTypes:[j.TextureType.unpacked],cacheHint:it});var it;return Object.assign(Object.assign({},ct),{get:()=>(($,a,et,nt,at,rt)=>{const dt=et.dims,ut=nt.dims,bt=at.length,mt=(0,o.calculateIm2ColDims)(dt,ut,at,4),pt=` const int XC = ${dt[1]}; const int XH = ${dt[2]}; const int XW = ${dt[3]}; const int KH = ${rt.kernelShape[0]}; const int KW = ${rt.kernelShape[1]}; const int dilationH = ${rt.dilations[0]}; const int dilationW = ${rt.dilations[1]}; const int strideH = ${rt.strides[0]}; const int strideW = ${rt.strides[1]}; const int padH = ${rt.pads[0]}; const int padW = ${rt.pads[1]}; const int KHKW = KH*KW; const int XCKHKW = XC * KHKW; const int outputChannels = 4; vec4 process(int indices[${bt}]) { int b = indices[0]; // batch size int oh = indices[1] * strideH - padH; //output height int ow = indices[2] * strideW - padW; //output width int p = indices[3] * outputChannels; //patch vec4 value = vec4(0.0); for(int i=0; i < outputChannels; ++i) { if(p < XCKHKW) { int patchC = p / KHKW; int patchH = (p - patchC*KHKW) / KW; int patchW = (p - patchC*KHKW) - patchH * KW; int xh2 = oh + patchH * dilationH; int xw2 = ow + patchW * dilationW; int x[${dt.length}]; x[0] = b; x[1] = patchC; x[2] = xh2; x[3] = xw2; if(xh2 >= 0 && xh2 < XH && xw2 >= 0 && xw2 < XW) { value[i] = _X(x); } } ++p; } return value; } `;return Object.assign(Object.assign({},a),{output:{dims:mt,type:et.type,textureType:j.TextureType.packedLastDimension},shaderSource:pt})})(0,ct,lt,tt,ot,st)})},o.calculateIm2ColDims=(_e,lt,tt,ot=4)=>[tt[0],tt[2],tt[3],Math.ceil(_e[1]*lt[2]*lt[3]/ot)]},6572:(i,o,s)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.parseImageScalerAttributes=o.imageScaler=void 0;const j=s(246),_e=s(2039);o.imageScaler=(ct,it,$)=>(st(it),[ct.run(tt(ct,it,$),it)]),o.parseImageScalerAttributes=ct=>{const it=ct.attributes.getFloat("scale"),$=ct.attributes.getFloats("bias");return(0,j.createAttributeWithCacheKey)({scale:it,bias:$})};const lt={name:"ImageScaler",inputNames:["X"],inputTypes:[_e.TextureType.unpacked]},tt=(ct,it,$)=>{const a=Object.assign(Object.assign({},lt),{cacheHint:$.cacheKey});return Object.assign(Object.assign({},a),{get:()=>((et,nt,at,rt)=>{const dt=at[0].dims.slice(),ut=dt.length,bt=` ${ot(rt.bias.length)} float process(int indices[${ut}]) { return _X(indices) * scale + getBias(bias, indices[1]); }`;return Object.assign(Object.assign({},nt),{output:{dims:dt,type:at[0].type,textureType:_e.TextureType.unpacked},variables:[{name:"bias",type:"float",arrayLength:rt.bias.length,data:rt.bias},{name:"scale",type:"float",data:rt.scale}],shaderSource:bt})})(0,a,it,$)})},ot=ct=>{const it=[`float getBias(float bias[${ct}], int channel) {`];for(let $=0;${if(!ct||ct.length!==1)throw new Error("ImageScaler requires 1 input.");if(ct[0].dims.length!==4)throw new Error("Invalid input shape.");if(ct[0].type!=="float32"&&ct[0].type!=="float64")throw new Error("Invalid input type.")}},3346:(i,o,s)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.parseInstanceNormalizationAttributes=o.instanceNormalization=void 0;const j=s(5060),_e=s(2039);o.instanceNormalization=(it,$,a)=>{ct($);const et=it.run(tt($[0]),$);return[it.run(st(it,$[0],a,et.dims),[$[0],et,$[1],$[2]])]},o.parseInstanceNormalizationAttributes=it=>it.attributes.getFloat("epsilon",1e-5);const lt={name:"InstanceNormalization_MeanAndVariance",inputNames:["X"],inputTypes:[_e.TextureType.unpacked]},tt=it=>Object.assign(Object.assign({},lt),{get:()=>(($,a)=>{const et=a.dims.slice(),nt=et[1],at=et[2]*et[3],rt=[et[0],nt],dt=` vec4 process(int[2] indices) { vec4 v = vec4(0.0); int a[4]; a[0] = indices[0]; a[1] = indices[1]; float temp = 0.0; for(int a2=0; a2<${et[2]}; a2++) { a[2] = a2; for(int a3=0; a3<${et[3]}; a3++) { a[3] = a3; float x = _X(a); temp += x; } } float mean = temp / float(${at}); temp = 0.0; for(int a2=0; a2<${et[2]}; a2++) { a[2] = a2; for(int a3=0; a3<${et[3]}; a3++) { a[3] = a3; float x = _X(a); temp += (x - mean) * (x - mean); } } v.r = mean; v.g = temp / float(${at}); return v; }`;return Object.assign(Object.assign({},$),{output:{dims:rt,type:a.type,textureType:_e.TextureType.packedLastDimension},shaderSource:dt})})(lt,it)}),ot={name:"InstanceNormalization_ComputeOutput",inputNames:["X","MeanAndVariance","Scale","B"],inputTypes:[_e.TextureType.unpacked,_e.TextureType.packedLastDimension,_e.TextureType.unpacked,_e.TextureType.unpacked]},st=(it,$,a,et)=>{const nt=Object.assign(Object.assign({},ot),{cacheHint:`${a}`});return Object.assign(Object.assign({},nt),{get:()=>((at,rt,dt,ut,bt)=>{const mt=(0,j.getGlsl)(at.session.backend.glContext.version),[pt,Zt]=at.calculateTextureWidthAndHeight(bt,_e.TextureType.packedLastDimension),[ht,Gt]=[pt/4,Zt],Xt=` vec4 get_MeanAndVariance(int[2] mv) { int offset = indicesToOffset_MeanAndVariance(mv); vec2 coords = offsetToCoords(offset, ${ht}, ${Gt}); return ${mt.texture2D}(MeanAndVariance, coords); } float process(int[4] indices) { int mv[2]; mv[0] = indices[0]; mv[1] = indices[1]; vec4 mean_and_variance = get_MeanAndVariance(mv); float mean = mean_and_variance.r; float variance = mean_and_variance.g; int sb[1]; sb[0] = indices[1]; float scale = _Scale(sb); float b = _B(sb); return scale * (_X(indices) - mean) / sqrt(variance + epsilon) + b; }`;return Object.assign(Object.assign({},rt),{output:{dims:dt.dims,type:dt.type,textureType:_e.TextureType.unpacked},variables:[{name:"epsilon",type:"float",data:ut}],shaderSource:Xt})})(it,nt,$,a,et)})},ct=it=>{if(!it||it.length!==3)throw new Error("InstanceNormalization requires 3 inputs.");const $=it[0],a=it[1],et=it[2];if($.dims.length<3||a.dims.length!==1||et.dims.length!==1)throw new Error("Invalid input shape.");if(a.dims[0]!==$.dims[1]||et.dims[0]!==$.dims[1])throw new Error("Input shapes are mismatched.");if($.type!=="float32"&&$.type!=="float64"||a.type!=="float32"&&a.type!=="float64"||et.type!=="float32"&&et.type!=="float64")throw new Error("Invalid input type.");if(it[0].dims.length!==4)throw new Error("Only support 4-D input shape.")}},708:(i,o,s)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createPackedMatmulProgramInfoLoader=void 0;const j=s(2517),_e=s(5060),lt=s(2039),tt=s(9390),ot=s(2823),st=s(5623);o.createPackedMatmulProgramInfoLoader=(ct,it,$)=>{const a=(et=it.length>2,nt=$.activationCacheKey,{name:"MatMul (packed)",inputNames:et?["A","B","Bias"]:["A","B"],inputTypes:et?[lt.TextureType.packed,lt.TextureType.packed,lt.TextureType.packed]:[lt.TextureType.packed,lt.TextureType.packed],cacheHint:nt});var et,nt;return Object.assign(Object.assign({},a),{get:()=>((at,rt,dt,ut)=>{const bt=dt.length>2,mt=bt?"value += getBiasForMatmul();":"",pt=dt[0].dims,Zt=dt[1].dims,ht=j.BroadcastUtil.calcShape(pt,Zt,!0),Gt=!j.ShapeUtil.areEqual(dt[0].dims,dt[1].dims);if(!ht)throw new Error("Can't use matmul on the given tensors");const Xt=pt[pt.length-1],Vt=Math.ceil(Xt/2),Yt=pt.length,St=Zt.length,Lt=(0,_e.getGlsl)(at.session.backend.glContext.version),Ct=(0,tt.getCoordsDataType)(ht.length),Tt=ht.length,ft=(0,tt.getGlChannels)(),{activationFunction:Ft,applyActivation:Jt}=(0,ot.getActivationSnippet)(ut),Ht=bt?`${(0,st.getBiasForMatmul)(Ct,ft,dt[2].dims,ht,!0)}`:"",wt=Gt?`${function(Qt,jt,Xl,Yl){let Rl=[],Tl=[];const zl=Xl[0].dims,Ll=Xl[1].dims,Cl=zl.length,yl=Ll.length,Wl=Yl.length,xl=Wl-Cl,Gl=Wl-yl;Rl=zl.map((Ul,Ql)=>`coords.${jt[Ql+xl]}`),Rl[Cl-1]="i*2",Rl.join(", "),Tl=Ll.map((Ul,Ql)=>`coords.${jt[Ql+Gl]}`),Tl[yl-2]="i*2",Tl.join(", ");const sn=j.BroadcastUtil.getBroadcastDims(zl,Yl),Fl=j.BroadcastUtil.getBroadcastDims(Ll,Yl),cn=sn.map(Ul=>`coords.${jt[Ul+xl]} = 0;`).join(` `),Ol=Fl.map(Ul=>`coords.${jt[Ul+Gl]} = 0;`).join(` `),Ml=`int lastDim = coords.${jt[Wl-1]}; coords.${jt[Wl-1]} = coords.${jt[Wl-2]}; coords.${jt[Wl-2]} = lastDim;`;return` vec4 getAAtOutCoordsMatmul(int i) { ${Qt} coords = getOutputCoords(); ${Ml} ${cn} vec4 outputValue = getA(${Rl}); return outputValue; } vec4 getBAtOutCoordsMatmul(int i) { ${Qt} coords = getOutputCoords(); ${Ml} ${Ol} vec4 outputValue = getB(${Tl}); return outputValue; }`}(Ct,ft,dt,ht)}`:"",Et=Gt?"getAAtOutCoordsMatmul(i)":`getA(${function(Qt,jt){let Xl="";for(let Yl=0;Yl{Object.defineProperty(o,"__esModule",{value:!0}),o.getBiasForMatmul=o.createMatmulProgramInfoLoader=o.parseMatMulAttributes=o.matMul=void 0;const j=s(2517),_e=s(2039),lt=s(9390),tt=s(2823),ot=s(708);function st($,a){const et=(nt=$.length>2,at=a.activationCacheKey,{name:"MatMul",inputNames:nt?["A","B","Bias"]:["A","B"],inputTypes:nt?[_e.TextureType.unpacked,_e.TextureType.unpacked,_e.TextureType.unpacked]:[_e.TextureType.unpacked,_e.TextureType.unpacked],cacheHint:at});var nt,at;return Object.assign(Object.assign({},et),{get:()=>function(rt,dt,ut){const bt=dt[0].dims,mt=dt[1].dims,pt=j.BroadcastUtil.calcShape(bt,mt,!0);if(!pt)throw new Error("Can't use matmul on the given tensors");const Zt=(0,lt.getCoordsDataType)(pt.length),ht=(0,lt.getGlChannels)(),{activationFunction:Gt,applyActivation:Xt}=(0,tt.getActivationSnippet)(ut),Vt=dt.length>2,Yt=Vt?"value += getBiasForMatmul();":"",St=Vt?`${it(Zt,ht,dt[2].dims,pt,!1)}`:"",Lt=pt.length,Ct=bt.length,Tt=mt.length,ft=` ${Gt} ${St} float process(int indices[${Lt}]) { int a[${Ct}]; int b[${Tt}]; bcastMatmulIndices_A(indices, a); bcastMatmulIndices_B(indices, b); float value; for (int k=0; k<${bt[bt.length-1]}; ++k) { a[${Ct-1}] = k; b[${Tt-2}] = k; value += _A(a) * _B(b); } ${Yt} ${Xt} return value; }`;return Object.assign(Object.assign({},rt),{output:{dims:pt,type:dt[0].type,textureType:_e.TextureType.unpacked},shaderSource:ft})}(et,$,a)})}o.matMul=($,a,et)=>(ct(a),$.session.pack?[$.run((0,ot.createPackedMatmulProgramInfoLoader)($,a,et),a)]:[$.run(st(a,et),a)]),o.parseMatMulAttributes=$=>(0,tt.parseInternalActivationAttributes)($.attributes),o.createMatmulProgramInfoLoader=st;const ct=$=>{if(!$||$.length!==2)throw new Error("MatMul requires 2 inputs.");if($[0].dims[$[0].dims.length-1]!==$[1].dims[$[1].dims.length-2])throw new Error("shared dimension does not match.");if($[0].type!=="float32"&&$[0].type!=="float64"||$[1].type!=="float32"&&$[1].type!=="float64")throw new Error("inputs should be float type");if($[0].type!==$[1].type)throw new Error("inputs types should match")};function it($,a,et,nt,at){let rt="";const dt=et.length,ut=nt.length,bt=ut-dt;rt=ut<2&&dt>0?"coords":et.map((Zt,ht)=>`coords.${a[ht+bt]}`).join(", ");const mt=j.BroadcastUtil.getBroadcastDims(et,nt).map(Zt=>`coords.${a[Zt+bt]} = 0;`).join(` `);let pt="vec4(outputValue.xx, outputValue.yy)";return j.ShapeUtil.size(et)===1&&(pt="vec4(outputValue.x)"),at?` vec4 getBiasForMatmul() { ${$} coords = getOutputCoords(); ${mt} vec4 outputValue = getBias(${rt}); return ${pt}; }`:` float getBiasForMatmul() { ${$} coords = getOutputCoords(); ${mt} return getBias(coords.x); }`}o.getBiasForMatmul=it},2403:(i,o,s)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createPackProgramInfoLoader=void 0;const j=s(5060),_e=s(2039),lt=s(9390),tt=s(2827),ot={name:"pack",inputNames:["A"],inputTypes:[_e.TextureType.unpackedReversed]};o.createPackProgramInfoLoader=(st,ct)=>Object.assign(Object.assign({},ot),{get:()=>((it,$)=>{const a=(0,j.getGlsl)(it.session.backend.glContext.version),et=$.dims,nt=et.length,at=$.dims.length,rt=(0,lt.getCoordsDataType)(at),dt=(0,tt.getChannels)("rc",at),ut=(bt=at,mt=dt,pt=et[et.length-2],Zt=et[et.length-1],bt===0||bt===1?"":` int r = ${mt[bt-2]}; int c = ${mt[bt-1]}; int rp1 = ${mt[bt-2]} + 1; int cp1 = ${mt[bt-1]} + 1; bool rEdge = rp1 >= ${Zt}; bool cEdge = cp1 >= ${pt}; `);var bt,mt,pt,Zt;let ht;ht=nt===0?[1,1]:nt===1?[et[0],1]:[et[at-1],et[at-2]];const Gt=function(Yt,St,Lt){if(Yt===0)return"false";if(Yt===1)return`rc > ${St[0]}`;let Ct="";for(let Tt=Yt-2;Tt= ${St[Tt-Yt+2]}`,Tt= ${Yt[0]} ? 0. : getA(rc + 1), 0, 0`;let Ct="";if(Lt>2)for(let Tt=0;Tt{Object.defineProperty(o,"__esModule",{value:!0}),o.unpackFromChannel=o.getChannels=o.getVecChannels=void 0;const j=s(9390);function _e(lt,tt){return(0,j.getGlChannels)(tt).map(ot=>`${lt}.${ot}`)}o.getVecChannels=_e,o.getChannels=function(lt,tt){return tt===1?[lt]:_e(lt,tt)},o.unpackFromChannel=function(){return` float getChannel(vec4 frag, int dim) { int modCoord = imod(dim, 2); return modCoord == 0 ? frag.r : frag.g; } float getChannel(vec4 frag, vec2 innerDims) { vec2 modCoord = mod(innerDims, 2.); return modCoord.x == 0. ? (modCoord.y == 0. ? frag.r : frag.g) : (modCoord.y == 0. ? frag.b : frag.a); } `}},2870:(i,o,s)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.parsePadAttributesV11=o.padV11=o.parsePadAttributesV2=o.padV2=void 0;const j=s(246),_e=s(2517),lt=s(5060),tt=s(2039),ot={name:"Pad",inputNames:["A"],inputTypes:[tt.TextureType.unpacked]};o.padV2=(rt,dt,ut)=>(it(dt),[rt.run(Object.assign(Object.assign({},ot),{cacheHint:ut.cacheKey,get:()=>ct(rt,dt[0],ut)}),dt)]),o.parsePadAttributesV2=rt=>{const dt=rt.attributes.getString("mode","constant"),ut=rt.attributes.getFloat("value",0),bt=rt.attributes.getInts("pads");return(0,j.createAttributeWithCacheKey)({mode:dt,value:ut,pads:bt})},o.padV11=(rt,dt,ut)=>{$(dt);const bt=st(rt,dt,ut);return(0,o.padV2)(rt,[dt[0]],bt)},o.parsePadAttributesV11=rt=>rt.attributes.getString("mode","constant");const st=(rt,dt,ut)=>{if(!rt.session.isInitializer(dt[1].dataId)||dt.length>=3&&!rt.session.isInitializer(dt[2].dataId))throw new Error("dynamic pad attributes are not allowed");const bt=Array.from(dt[1].integerData),mt=dt.length>=3?dt[2].floatData[0]:0;return(0,j.createAttributeWithCacheKey)({mode:ut,pads:bt,value:mt})},ct=(rt,dt,ut)=>{const bt=_e.ShapeUtil.padShape(dt.dims.slice(),ut.pads),mt=bt.length,pt=` ${a(rt,dt,ut)} float process(int[${mt}] indices) { return padA(indices); }`;return{name:"Pad",inputNames:["A"],inputTypes:[tt.TextureType.unpacked],output:{dims:bt,type:dt.type,textureType:tt.TextureType.unpacked},shaderSource:pt}},it=rt=>{if(!rt||rt.length!==1)throw new Error("Pad requires 1 input");if(rt[0].type!=="float32"&&rt[0].type!=="float64")throw new Error("Invalid input type.")},$=rt=>{if(!rt||rt.length!==2&&rt.length!==3)throw new Error("Pad requires 2 or 3 inputs");if(rt[1].type!=="int32")throw new Error("Invalid input type.");if(rt.length>=3&&rt[2].type==="string")throw new Error("Invalid input type.")},a=(rt,dt,ut)=>{const bt=(0,lt.getGlsl)(rt.session.backend.glContext.version),[mt,pt]=rt.calculateTextureWidthAndHeight(dt.dims,tt.TextureType.unpacked),Zt=_e.ShapeUtil.computeStrides(dt.dims);switch(ut.mode){case"constant":return et(bt,dt.dims,Zt,mt,pt,ut.pads,ut.value);case"reflect":return nt(bt,dt.dims,Zt,mt,pt,ut.pads);case"edge":return at(bt,dt.dims,Zt,mt,pt,ut.pads);default:throw new Error("Invalid mode")}},et=(rt,dt,ut,bt,mt,pt,Zt)=>{const ht=dt.length;let Gt="";for(let Xt=ht-1;Xt>=0;--Xt)Gt+=` k = m[${Xt}] - ${pt[Xt]}; if (k < 0) return constant; if (k >= ${dt[Xt]}) return constant; offset += k * ${ut[Xt]}; `;return` float padA(int m[${ht}]) { const float constant = float(${Zt}); int offset = 0; int k = 0; ${Gt} vec2 coords = offsetToCoords(offset, ${bt}, ${mt}); float value = getColorAsFloat(${rt.texture2D}(A, coords)); return value; } `},nt=(rt,dt,ut,bt,mt,pt)=>{const Zt=dt.length;let ht="";for(let Gt=Zt-1;Gt>=0;--Gt)ht+=` k = m[${Gt}] - ${pt[Gt]}; if (k < 0) { k = -k; } { const int _2n_1 = ${2*(dt[Gt]-1)}; k = int( mod( float(k), float(_2n_1) ) ) ; if(k >= ${dt[Gt]}) { k = _2n_1 - k; } } offset += k * ${ut[Gt]}; `;return` float padA(int m[${Zt}]) { int offset = 0; int k = 0; ${ht} vec2 coords = offsetToCoords(offset, ${bt}, ${mt}); float value = getColorAsFloat(${rt.texture2D}(A, coords)); return value; } `},at=(rt,dt,ut,bt,mt,pt)=>{const Zt=dt.length;let ht="";for(let Gt=Zt-1;Gt>=0;--Gt)ht+=` k = m[${Gt}] - ${pt[Gt]}; if (k < 0) k = 0; if (k >= ${dt[Gt]}) k = ${dt[Gt]-1}; offset += k * ${ut[Gt]}; `;return` float padA(int m[${Zt}]) { int offset = 0; int k = 0; ${ht} vec2 coords = offsetToCoords(offset, ${bt}, ${mt}); float value = getColorAsFloat(${rt.texture2D}(A, coords)); return value; } `}},2143:(i,o,s)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.globalMaxPool=o.parseMaxPoolAttributes=o.maxPool=o.parseGlobalAveragePoolAttributes=o.globalAveragePool=o.parseAveragePoolAttributes=o.averagePool=void 0;const j=s(246),_e=s(2517),lt=s(2039);o.averagePool=(at,rt,dt)=>{$(rt);const ut={name:"AveragePool",inputNames:["X"],inputTypes:[lt.TextureType.unpacked],cacheHint:dt.cacheKey};return[at.run(Object.assign(Object.assign({},ut),{get:()=>tt(rt,ut,!1,dt)}),rt)]},o.parseAveragePoolAttributes=at=>{const rt=at.attributes.getString("auto_pad","NOTSET"),dt=at.attributes.getInt("ceil_mode",0),ut=at.attributes.getInt("count_include_pad",0)!==0,bt=at.attributes.getInts("kernel_shape"),mt=at.attributes.getInts("strides",[]),pt=at.attributes.getInts("pads",[]);if(dt!==0)throw new Error("using ceil() in shape computation is not yet supported for AveragePool");return(0,j.createAttributeWithCacheKey)({autoPad:rt,ceilMode:dt,countIncludePad:ut,kernelShape:bt,strides:mt,pads:pt})};const tt=(at,rt,dt,ut)=>{const[bt,mt]=st(at,ut,dt),pt=_e.ShapeUtil.size(bt.kernelShape);let Zt="";bt.countIncludePad?Zt+=`value /= float(${pt});`:Zt+=`value /= float(${pt} - pad);`;const ht=` ${a(at[0].dims,bt,"value += _X(x);",Zt,"0.0")} `;return Object.assign(Object.assign({},rt),{output:{dims:mt,type:at[0].type,textureType:lt.TextureType.unpacked},shaderSource:ht})};o.globalAveragePool=(at,rt,dt)=>{$(rt);const ut={name:"GlobalAveragePool",inputNames:["X"],inputTypes:[lt.TextureType.unpacked],cacheHint:`${dt.countIncludePad}`};return[at.run(Object.assign(Object.assign({},ut),{get:()=>tt(rt,ut,!0,dt)}),rt)]},o.parseGlobalAveragePoolAttributes=at=>{const rt=at.attributes.getInt("count_include_pad",0)!==0;return(0,j.createAttributeWithCacheKey)({autoPad:"",ceilMode:0,countIncludePad:rt,kernelShape:[],strides:[],pads:[]})},o.maxPool=(at,rt,dt)=>{$(rt);const ut={name:"MaxPool",inputNames:["X"],inputTypes:[lt.TextureType.unpacked],cacheHint:dt.cacheKey};return[at.run(Object.assign(Object.assign({},ut),{get:()=>ot(rt,ut,!1,dt)}),rt)]},o.parseMaxPoolAttributes=at=>{const rt=at.attributes.getString("auto_pad","NOTSET"),dt=at.attributes.getInt("ceil_mode",0),ut=at.attributes.getInts("kernel_shape"),bt=at.attributes.getInts("strides",[]),mt=at.attributes.getInts("pads",[]),pt=at.attributes.getInt("storage_order",0),Zt=at.attributes.getInts("dilations",[]);if(pt!==0)throw new Error("column major storage order is not yet supported for MaxPool");if(dt!==0)throw new Error("using ceil() in shape computation is not yet supported for MaxPool");return(0,j.createAttributeWithCacheKey)({autoPad:rt,ceilMode:dt,countIncludePad:!1,kernelShape:ut,strides:bt,pads:mt,storageOrder:pt,dilations:Zt})};const ot=(at,rt,dt,ut)=>{const[bt,mt]=st(at,ut,dt),pt=` ${a(at[0].dims,bt,` value = max(_X(x), value); `,"","-1e5")} `;return Object.assign(Object.assign({},rt),{output:{dims:mt,type:at[0].type,textureType:lt.TextureType.unpacked},shaderSource:pt})},st=(at,rt,dt)=>{const ut=at[0].dims.slice(),bt=Object.hasOwnProperty.call(rt,"dilations"),mt=rt.kernelShape.slice(),pt=rt.strides.slice(),Zt=bt?rt.dilations.slice():[],ht=rt.pads.slice();_e.PoolConvUtil.adjustPoolAttributes(dt,ut,mt,pt,Zt,ht);const Gt=_e.PoolConvUtil.computePoolOutputShape(dt,ut,pt,Zt,mt,ht,rt.autoPad),Xt=Object.assign({},rt);return bt?Object.assign(Xt,{kernelShape:mt,strides:pt,pads:ht,dilations:Zt,cacheKey:rt.cacheKey}):Object.assign(Xt,{kernelShape:mt,strides:pt,pads:ht,cacheKey:rt.cacheKey}),[Xt,Gt]},ct={autoPad:"",ceilMode:0,countIncludePad:!1,kernelShape:[],strides:[],pads:[],storageOrder:0,dilations:[],cacheKey:""},it={name:"GlobalMaxPool",inputNames:["X"],inputTypes:[lt.TextureType.unpacked]};o.globalMaxPool=(at,rt)=>($(rt),[at.run(Object.assign(Object.assign({},it),{get:()=>ot(rt,it,!0,ct)}),rt)]);const $=at=>{if(!at||at.length!==1)throw new Error("Pool ops requires 1 input.");if(at[0].type!=="float32"&&at[0].type!=="float64")throw new Error("Invalid input type.")},a=(at,rt,dt,ut,bt)=>{const mt=at.length;if(rt.kernelShape.length<=2){const pt=rt.kernelShape[rt.kernelShape.length-1],Zt=rt.strides[rt.strides.length-1],ht=rt.pads[rt.pads.length/2-1],Gt=rt.pads[rt.pads.length-1],Xt=at[mt-1];let Vt="",Yt="",St="";if(Vt=ht+Gt!==0?` for (int i = 0; i < ${pt}; i++) { x[${mt} - 1] = indices[${mt} - 1] * ${Zt} - ${ht} + i; if (x[${mt} - 1] < 0 || x[${mt} - 1] >= ${Xt}) { pad++; continue; } ${dt} }`:` for (int i = 0; i < ${pt}; i++) { x[${mt} - 1] = indices[${mt} - 1] * ${Zt} - ${ht} + i; ${dt} }`,rt.kernelShape.length===2){const Lt=rt.kernelShape[rt.kernelShape.length-2],Ct=rt.strides[rt.strides.length-2],Tt=rt.pads[rt.pads.length/2-2],ft=rt.pads[rt.pads.length-2],Ft=at[mt-2];Yt=Tt+ft!==0?` for (int j = 0; j < ${Lt}; j++) { x[${mt} - 2] = indices[${mt} - 2] * ${Ct} - ${Tt} + j; if (x[${mt} - 2] < 0 || x[${mt} - 2] >= ${Ft}) { pad+= ${pt}; continue; } `:` for (int j = 0; j < ${Lt}; j++) { x[${mt} - 2] = indices[${mt} - 2] * ${Ct} - ${Tt} + j; `,St=` } `}return` float process(int indices[${mt}]) { int x[${mt}]; copyVec(indices, x); float value = ${bt}; int pad = 0; ${Yt} ${Vt} ${St} ${ut} return value; } `}{const pt=_e.ShapeUtil.size(rt.kernelShape),Zt=_e.ShapeUtil.computeStrides(rt.kernelShape),ht=Zt.length,Gt=rt.pads.length,Xt=nt(ht),Vt=et(at,"inputDims"),Yt=et(rt.pads,"pads"),St=et(Zt,"kernelStrides"),Lt=et(rt.strides,"strides");let Ct="";return Ct=rt.pads.reduce((Tt,ft)=>Tt+ft)?` if (x[j] >= inputDims[j] || x[j] < 0) { pad++; isPad = true; break; } } if (!isPad) { ${dt} }`:` } ${dt} `,` ${Xt} float process(int indices[${mt}]) { int x[${mt}]; copyVec(indices, x); int offset[${ht}]; int pads[${Gt}]; int inputDims[${mt}]; int kernelStrides[${ht}]; int strides[${ht}]; ${Yt} ${Vt} ${Lt} ${St} float value = ${bt}; int pad = 0; bool isPad = false; for (int i = 0; i < ${pt}; i++) { offsetToIndices(i, kernelStrides, offset); isPad = false; for (int j = ${mt} - ${ht}; j < ${mt}; j++) { x[j] = indices[j] * strides[j - ${mt} + ${ht}] + offset[j - ${mt} + ${ht}] - pads[j - 2]; ${Ct} } ${ut} return value; } `}},et=(at,rt)=>{let dt="";for(let ut=0;ut` void offsetToIndices(int offset, int[${at}] strides, out int[${at}] indices) { if (${at} == 0) { return; } for (int i = 0; i < ${at} - 1; ++i) { indices[i] = offset / strides[i]; offset -= indices[i] * strides[i]; } indices[${at} - 1] = offset; }`},4939:(i,o,s)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.reduceLogSumSquare=o.reduceLogSum=o.reduceProd=o.reduceMin=o.reduceMax=o.reduceMean=o.reduceSum=o.parseReduceAttributes=void 0;const j=s(246),_e=s(782),lt=s(2517),tt=s(2039),ot=(it,$,a,et,nt)=>{ct($);const at={name:et,inputNames:["A"],inputTypes:[tt.TextureType.unpacked]};return[it.run(Object.assign(Object.assign({},at),{cacheHint:a.cacheKey,get:()=>st(it,$,a,et,nt,at)}),$)]};o.parseReduceAttributes=it=>{const $=it.attributes.getInts("axes",[]),a=it.attributes.getInt("keepdims",1)===1;return(0,j.createAttributeWithCacheKey)({axes:$,keepDims:a})};const st=(it,$,a,et,nt,at)=>{const rt=[],dt=$[0].dims.length||1,ut=[],bt=lt.ShapeUtil.normalizeAxes(a.axes,$[0].dims.length),mt=nt($,bt);let pt=mt[1];for(let ht=0;ht<$[0].dims.length;ht++)bt.indexOf(ht)>=0||bt.length===0?(a.keepDims&&rt.push(1),pt=` for(int j${ht} = 0; j${ht} < ${$[0].dims[ht]}; j${ht}++) { inputIdx[${ht}] = j${ht}; ${pt} }`):(ut.push(`inputIdx[${ht}] = outputIdx[${rt.length}];`),rt.push($[0].dims[ht]));const Zt=` float process(int outputIdx[${rt.length||1}]) { float value; // final result int inputIdx[${dt}]; // addressing input data ${ut.join(` `)} ${mt[0]} // init ops for reduce max/min ${pt} ${mt[2]} // final computation for reduce mean return value; }`;return Object.assign(Object.assign({},at),{output:{dims:rt,type:$[0].type,textureType:tt.TextureType.unpacked},shaderSource:Zt})},ct=it=>{if(!it||it.length!==1)throw new Error("Reduce op requires 1 input.");if(_e.NUMBER_TYPES.indexOf(it[0].type)===-1)throw new Error("Invalid input type.")};o.reduceSum=(it,$,a)=>ot(it,$,a,"ReduceSum",()=>["value = 0.0;","value += _A(inputIdx);",""]),o.reduceMean=(it,$,a)=>ot(it,$,a,"ReduceMean",(et,nt)=>{let at=1;for(let rt=0;rt=0||nt.length===0)&&(at*=et[0].dims[rt]);return["value = 0.0;","value += _A(inputIdx);",`value /= ${at}.;`]}),o.reduceMax=(it,$,a)=>ot(it,$,a,"ReduceMax",(et,nt)=>{const at=[];for(let rt=0;rt=0||nt.length===0)&&at.push(`inputIdx[${rt}] = 0;`);return[`${at.join(` `)} value = _A(inputIdx);`,"value = max(value, _A(inputIdx));",""]}),o.reduceMin=(it,$,a)=>ot(it,$,a,"ReduceMin",(et,nt)=>{const at=[];for(let rt=0;rt=0||nt.length===0)&&at.push(`inputIdx[${rt}] = 0;`);return[`${at.join(` `)} value = _A(inputIdx);`,"value = min(value, _A(inputIdx));",""]}),o.reduceProd=(it,$,a)=>ot(it,$,a,"ReduceProd",()=>["value = 1.0;","value *= _A(inputIdx);",""]),o.reduceLogSum=(it,$,a)=>ot(it,$,a,"ReduceLogSum",()=>["value = 0.0;","value += _A(inputIdx);","value = log(value);"]),o.reduceLogSumSquare=(it,$,a)=>ot(it,$,a,"ReduceLogSumSquare",()=>["float t; value = 0.0;","t = _A(inputIdx); value += t * t;",""])},7019:(i,o,s)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.isReshapeCheap=o.processDims3D=o.createPackedReshape3DProgramInfoLoader=void 0;const j=s(2517),_e=s(5060),lt=s(2039),tt=s(2827);o.createPackedReshape3DProgramInfoLoader=(ot,st,ct)=>{const it=($=>({name:"Reshape (packed)",inputTypes:[lt.TextureType.packed],inputNames:["A"],cacheHint:`${$}`}))(ct);return Object.assign(Object.assign({},it),{get:()=>(($,a,et,nt)=>{const at=a.dims,rt=nt;let dt="";for(let mt=0;mt<4;mt++){let pt="";switch(mt){case 0:pt="outputCoords = rc;";break;case 1:pt="outputCoords = ivec3(rc.x, rc.y+1, rc.z);";break;case 2:pt="outputCoords = ivec3(rc.x, rc.y, rc.z+1);";break;case 3:pt="outputCoords = ivec3(rc.x, rc.y+1, rc.z+1);";break;default:throw new Error}dt+=` ${pt} ${mt>0?"if(outputCoords.y < rows && outputCoords.z < cols){":""} int flattenedIndex = getFlattenedIndex(outputCoords); ivec3 inputRC = inputCoordsFromReshapedOutCoords(flattenedIndex); vec2 innerDims = vec2(float(inputRC.y),float(inputRC.z)); result[${mt}] = getChannel(getA(inputRC.x, inputRC.y, inputRC.z), innerDims); ${mt>0?"}":""} `}const ut=(0,_e.getGlsl)($.session.backend.glContext.version),bt=` ${function(mt){const pt=j.ShapeUtil.computeStrides(mt),Zt=["b","r","c"],ht="index";return` ivec3 inputCoordsFromReshapedOutCoords(int index) { ${pt.map((Gt,Xt)=>`int ${Zt[Xt]} = ${ht} / ${Gt}; ${Xt===pt.length-1?`int ${Zt[Xt+1]} = ${ht} - ${Zt[Xt]} * ${Gt}`:`index -= ${Zt[Xt]} * ${Gt}`};`).join("")} return ivec3(b, r, c); } `}(at)} ${function(mt){const pt=j.ShapeUtil.computeStrides(mt);return` int getFlattenedIndex(ivec3 coords) { // reverse y, z order return coords.x * ${pt[0]} + coords.z * ${pt[1]} + coords.y; } `}(rt)} ${(0,tt.unpackFromChannel)()} void main() { ivec3 rc = getOutputCoords(); vec4 result = vec4(0.0); ivec3 outputCoords; int rows = ${rt[2]}; int cols = ${rt[1]}; ${dt} ${ut.output} = result; } `;return Object.assign(Object.assign({},et),{output:{dims:rt,type:a.type,textureType:lt.TextureType.packed},shaderSource:bt,hasMain:!0})})(ot,st,it,ct)})},o.processDims3D=function(ot){if(ot.length===0)return[1,1,1];let st=1;for(let ct=0;ct1?ot[ot.length-2]:1,ot[ot.length-1]]},o.isReshapeCheap=function(ot,st){let ct=!1;return ct=ot.length===0||st.length===0||(ot.length<2||st.length<2?ot[ot.length-1]===st[st.length-1]:ot[ot.length-1]===st[st.length-1]&&ot[ot.length-2]===st[st.length-2]),ct}},718:(i,o,s)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.reshape=void 0;const j=s(2517);o.reshape=(_e,lt)=>{const tt=j.ShapeUtil.calculateReshapedDims(lt[0].dims,lt[1].integerData);return _e.session.pack?[_e.reshapePacked(lt[0],tt)]:[_e.reshapeUnpacked(lt[0],tt)]}},2268:(i,o,s)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.parseResizeAttributesV11=o.parseResizeAttributesV10=o.resize=void 0;const j=s(5060),_e=s(2039),lt=s(9390),tt=s(2827),ot=s(9793),st={name:"Resize",inputNames:["A"],inputTypes:[_e.TextureType.packed]};o.resize=(et,nt,at)=>((0,ot.validateInputs)(nt,at),[et.run(Object.assign(Object.assign({},st),{cacheHint:at.cacheKey,get:()=>ct(et,nt,at)}),nt)]),o.parseResizeAttributesV10=et=>(0,ot.parseUpsampleAttributes)(et,10),o.parseResizeAttributesV11=et=>(0,ot.parseUpsampleAttributes)(et,11);const ct=(et,nt,at)=>{const rt=(0,j.getGlsl)(et.session.backend.glContext.version),[dt,ut]=it(nt,at);if(dt.every(Ct=>Ct===1)&&at.coordinateTransformMode!=="tf_crop_and_resize")return Object.assign(Object.assign({},st),{output:{dims:ut,type:nt[0].type,textureType:_e.TextureType.packed},hasMain:!0,shaderSource:`void main() { vec4 v = ${rt.texture2D}(X, TexCoords); ${rt.output} = v; }`});const bt=ut.length;if(bt<2)throw new Error(`output dimension should be at least 2, but got ${bt}`);const mt=ut[bt-2],pt=ut[bt-1],Zt=nt[0].dims;if(bt!==Zt.length)throw new Error(`output dimension should match input ${Zt.length}, but got ${bt}`);const ht=Zt[bt-2],Gt=Zt[bt-1],Xt=dt[bt-2],Vt=dt[bt-1];let Yt="";if(at.mode!=="linear")throw new Error(`resize (packed) does not support mode: '${at.mode}'`);switch(at.coordinateTransformMode){case"asymmetric":Yt=` vec4 getSourceFracIndex(ivec4 coords) { return vec4(coords) / scaleWHWH; } `;break;case"half_pixel":Yt=` vec4 getSourceFracIndex(ivec4 coords) { return (vec4(coords) + 0.5) / scaleWHWH - 0.5; } `;break;case"pytorch_half_pixel":Yt=` vec4 getSourceFracIndex(ivec4 coords) { vec4 fcoords = vec4(coords); return vec4( ${pt}.0 > 1.0 ? (fcoords.x + 0.5) / scaleWHWH.x - 0.5 : 0.0, ${mt}.0 > 1.0 ? (fcoords.y + 0.5) / scaleWHWH.y - 0.5 : 0.0, ${pt}.0 > 1.0 ? (fcoords.z + 0.5) / scaleWHWH.z - 0.5 : 0.0, ${mt}.0 > 1.0 ? (fcoords.w + 0.5) / scaleWHWH.w - 0.5 : 0.0 ); } `;break;case"align_corners":Yt=` vec4 getSourceFracIndex(ivec4 coords) { vec4 resized = vec4(${pt}.0 - 1.0, ${mt}.0 - 1.0, ${pt}.0 - 1.0, ${mt}.0 - 1.0); vec4 original = vec4(${Gt}.0 - 1.0, ${ht}.0 - 1.0, ${Gt}.0 - 1.0, ${ht}.0 - 1.0); vec4 new_scale = original / resized; return vec4(coords) * new_scale; } `;break;default:throw new Error(`resize (packed) does not support coordinateTransformMode: '${at.coordinateTransformMode}'`)}const St=(0,lt.getCoordsDataType)(bt),Lt=` const vec2 inputWH = vec2(${ht}.0, ${Gt}.0); const vec4 scaleWHWH = vec4(float(${Xt}), float(${Vt}), float(${Xt}), float(${Vt})); ${(0,tt.unpackFromChannel)()} ${Yt} float getAValue(int x10, int r, int c, int d) { return getChannel(getA(x10, r, c, d), vec2(c, d)); } void main() { ${St} rc = getOutputCoords(); int batch = rc[0]; int depth = rc[1]; // retrieve the 4 coordinates that is used in the 4 packed output values. ivec4 coords = ivec4(rc.wz, rc.w + 1, rc.z + 1); // calculate the source index in fraction vec4 sourceFrac = getSourceFracIndex(coords); // get the lower and upper bound of the 4 values that will be packed into one texel. ivec4 x00 = ivec4(max(sourceFrac.xy, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.xy))); ivec4 x01 = ivec4(max(sourceFrac.xw, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.xw))); ivec4 x10 = ivec4(max(sourceFrac.zy, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.zy))); ivec4 x11 = ivec4(max(sourceFrac.zw, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.zw))); bool hasNextRow = rc.w < ${mt-1}; bool hasNextCol = rc.z < ${pt-1}; // pack x00, x01, x10, x11's top-left corner into one vec4 structure vec4 topLeft = vec4( getAValue(batch, depth, x00.x, x00.y), hasNextCol ? getAValue(batch, depth, x01.x, x01.y) : 0.0, hasNextRow ? getAValue(batch, depth, x10.x, x10.y) : 0.0, (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.x, x11.y) : 0.0); // pack x00, x01, x10, x11's top-right corner into one vec4 structure vec4 topRight = vec4( getAValue(batch, depth, x00.x, x00.w), hasNextCol ? getAValue(batch, depth, x01.x, x01.w) : 0.0, hasNextRow ? getAValue(batch, depth, x10.x, x10.w) : 0.0, (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.x, x11.w) : 0.0); // pack x00, x01, x10, x11's bottom-left corner into one vec4 structure vec4 bottomLeft = vec4( getAValue(batch, depth, x00.z, x00.y), hasNextCol ? getAValue(batch, depth, x01.z, x01.y) : 0.0, hasNextRow ? getAValue(batch, depth, x10.z, x10.y) : 0.0, (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.z, x11.y) : 0.0); // pack x00, x01, x10, x11's bottom-right corner into one vec4 structure vec4 bottomRight = vec4( getAValue(batch, depth, x00.z, x00.w), hasNextCol ? getAValue(batch, depth, x01.z, x01.w) : 0.0, hasNextRow ? getAValue(batch, depth, x10.z, x10.w) : 0.0, (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.z, x11.w) : 0.0); // calculate the interpolation fraction on u and v direction vec4 frac = vec4(sourceFrac) - floor(sourceFrac); vec4 clampFrac = clamp(frac, vec4(0.0), vec4(1.0)); vec4 top = mix(topLeft, topRight, clampFrac.ywyw); vec4 bottom = mix(bottomLeft, bottomRight, clampFrac.ywyw); vec4 newValue = mix(top, bottom, clampFrac.xxzz); ${rt.output} = vec4(newValue); } `;return Object.assign(Object.assign({},st),{output:{dims:ut,type:nt[0].type,textureType:_e.TextureType.packed},hasMain:!0,shaderSource:Lt})},it=(et,nt)=>{const at=et[0].dims;let rt,dt=nt.scales;if(dt.length===0){const bt=et[nt.scalesInputIdx];if(bt&&bt.size!==0){if(et[nt.sizesInputIdx])throw new Error("Only one of scales or sizes must be provided as input.");dt=$(bt,nt.mode,nt.isResize)}else{const mt=et[nt.sizesInputIdx];if(!mt||mt.size===0)throw new Error("Either scales or sizes MUST be provided as input.");rt=Array.from(mt.integerData),dt=a(rt,at,nt.mode,nt.isResize)}}else if(et[nt.sizesInputIdx])throw new Error("Only one of scales or sizes must be provided as input.");const ut=rt||at.map((bt,mt)=>Math.floor(bt*dt[mt]));return[dt,ut]},$=(et,nt,at)=>{const rt=Array.from(et.floatData);return(0,ot.scalesValidation)(rt,nt,at),rt},a=(et,nt,at,rt)=>{const dt=nt.length,ut=new Array(dt);for(let bt=0,mt=dt;bt{Object.defineProperty(o,"__esModule",{value:!0}),o.shape=void 0;const j=s(9162);o.shape=(lt,tt)=>(_e(tt),[new j.Tensor([tt[0].dims.length],"int32",void 0,void 0,new Int32Array(tt[0].dims))]);const _e=lt=>{if(!lt||lt.length!==1)throw new Error("Shape requires 1 input.")}},2278:(i,o,s)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.sliceV10=o.parseSliceAttributes=o.slice=void 0;const j=s(246),_e=s(782),lt=s(2517),tt=s(2039),ot={name:"Slice",inputNames:["A"],inputTypes:[tt.TextureType.unpacked]};o.slice=(a,et,nt)=>(ct(et),[a.run(Object.assign(Object.assign({},ot),{cacheHint:nt.cacheKey,get:()=>st(a,et[0],nt)}),et)]),o.parseSliceAttributes=a=>{const et=a.attributes.getInts("starts"),nt=a.attributes.getInts("ends"),at=a.attributes.getInts("axes",[]);return(0,j.createAttributeWithCacheKey)({starts:et,ends:nt,axes:at})};const st=(a,et,nt)=>{const at=nt.axes.length===0?et.dims.slice(0).map((Zt,ht)=>ht):nt.axes,rt=lt.ShapeUtil.normalizeAxes(at,et.dims.length),dt=nt.starts.map((Zt,ht)=>Zt>et.dims[rt[ht]]-1?et.dims[rt[ht]]:lt.ShapeUtil.normalizeAxis(Zt,et.dims[rt[ht]])),ut=nt.ends.map((Zt,ht)=>Zt>et.dims[rt[ht]]-1?et.dims[rt[ht]]:lt.ShapeUtil.normalizeAxis(Zt,et.dims[rt[ht]])),bt=et.dims.slice(),mt=[];for(let Zt=0;Zt0&&mt.push(`outputIdx[${rt[Zt]}] += ${dt[Zt]};`);const pt=` float process(int outputIdx[${bt.length}]) { ${mt.join(` `)} return _A(outputIdx); }`;return Object.assign(Object.assign({},ot),{output:{dims:bt,type:et.type,textureType:tt.TextureType.unpacked},shaderSource:pt})},ct=a=>{if(!a||a.length!==1)throw new Error("Slice requires 1 input.");if(_e.NUMBER_TYPES.indexOf(a[0].type)===-1)throw new Error("Invalid input type.")};o.sliceV10=(a,et)=>{$(et);const nt=it(a,et);return[a.run(Object.assign(Object.assign({},ot),{cacheHint:nt.cacheKey,get:()=>st(a,et[0],nt)}),[et[0]])]};const it=(a,et)=>{if(!a.session.isInitializer(et[1].dataId)||!a.session.isInitializer(et[2].dataId)||et.length>=4&&!a.session.isInitializer(et[3].dataId)||et.length>=5&&!a.session.isInitializer(et[4].dataId))throw new Error("dynamic slice attributes are not allowed");if(et.length>=5&&et[4].integerData.some(dt=>dt!==1))throw new Error("currently non-1 steps is not supported for Slice");const nt=Array.from(et[1].integerData),at=Array.from(et[2].integerData),rt=et.length>=4?Array.from(et[3].integerData):[];return{starts:nt,ends:at,axes:rt,cacheKey:`${rt};${nt};${at}`}},$=a=>{if(!a||a.length<3||a.length>5)throw new Error("Invalid input number.");if(a[1].type!=="int32"||a[1].dims.length!==1)throw new Error("Invalid input type.");if(a[2].type!=="int32"||a[2].dims.length!==1)throw new Error("Invalid input type.");if(a.length>=4&&(a[3].type!=="int32"||a[3].dims.length!==1))throw new Error("Invalid input type.");if(a.length>=5&&(a[4].type!=="int32"||a[4].dims.length!==1))throw new Error("Invalid input type.")}},5524:(i,o,s)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.softmaxV13=o.parseSoftmaxAttributesV13=o.parseSoftmaxAttributes=o.softmax=void 0;const j=s(246),_e=s(2517),lt=s(5060),tt=s(2039),ot=s(3738),st={name:"SoftmaxComputeMax",inputNames:["A"],inputTypes:[tt.TextureType.unpacked]},ct={name:"SoftmaxComputeScale",inputNames:["A","Max"],inputTypes:[tt.TextureType.unpacked,tt.TextureType.unpacked]},it={name:"SoftMax",inputNames:["A","Max","Norm"],inputTypes:[tt.TextureType.unpacked,tt.TextureType.unpacked,tt.TextureType.unpacked]};o.softmax=(rt,dt,ut)=>{at(dt);const bt=dt[0].dims.slice(),mt=_e.ShapeUtil.normalizeAxis(ut.axis,bt.length),pt=_e.ShapeUtil.sizeToDimension(bt,mt),Zt=_e.ShapeUtil.sizeFromDimension(bt,mt);return $(rt,dt,ut,pt,Zt)},o.parseSoftmaxAttributes=rt=>(0,j.createAttributeWithCacheKey)({axis:rt.attributes.getInt("axis",1)}),o.parseSoftmaxAttributesV13=rt=>(0,j.createAttributeWithCacheKey)({axis:rt.attributes.getInt("axis",-1)}),o.softmaxV13=(rt,dt,ut)=>{at(dt);const bt=dt[0].dims.slice(),mt=_e.ShapeUtil.normalizeAxis(ut.axis,bt.length),pt=bt.length,Zt=mt!==pt-1,ht=[];let Gt,Xt=[],Vt=[];Zt&&(Xt=Array.from({length:pt}).map((Ct,Tt)=>Tt),Xt[mt]=pt-1,Xt[pt-1]=mt,Xt.map(Ct=>ht.push(bt[Ct])),Gt=(0,j.createAttributeWithCacheKey)({perm:Xt}),Vt=(0,ot.transpose)(rt,dt,Gt));const Yt=Zt?_e.ShapeUtil.sizeToDimension(ht,pt-1):_e.ShapeUtil.sizeToDimension(bt,pt-1),St=Zt?_e.ShapeUtil.sizeFromDimension(ht,pt-1):_e.ShapeUtil.sizeFromDimension(bt,pt-1),Lt=$(rt,Zt?Vt:dt,ut,Yt,St);return Zt?(0,ot.transpose)(rt,Lt,Gt):Lt};const $=(rt,dt,ut,bt,mt)=>{const pt=a(rt,dt[0],bt,mt,[bt]),Zt=rt.run(Object.assign(Object.assign({},st),{cacheHint:ut.cacheKey,get:()=>pt}),dt),ht=et(rt,dt[0],bt,mt,pt.output.dims,[bt]),Gt=rt.run(Object.assign(Object.assign({},ct),{cacheHint:ut.cacheKey,get:()=>ht}),[dt[0],Zt]),Xt=nt(rt,dt[0],bt,mt,pt.output.dims,ht.output.dims);return[rt.run(Object.assign(Object.assign({},it),{cacheHint:ut.cacheKey,get:()=>Xt}),[dt[0],Zt,Gt])]},a=(rt,dt,ut,bt,mt)=>{const[pt,Zt]=rt.calculateTextureWidthAndHeight(dt.dims,tt.TextureType.unpacked),ht=mt.length;if(ut<1||bt<1)throw new Error("Logical row count N and feature count D must be greater than or equal to 1");if(mt.length!==1)throw new Error("Dimensionality of the output should be 1");if(mt[0]!==ut)throw new Error("Shape of the output should be equal to logical row count");const Gt=(0,lt.getGlsl)(rt.session.backend.glContext.version),Xt=` float process(int[${ht}] indices) { int logical_row_start_offset = indices[0] * ${bt}; float max = getColorAsFloat(${Gt.texture2D}(A, offsetToCoords(logical_row_start_offset, ${pt}, ${Zt} ))); for(int i=1; i<${bt}; ++i) { float current = getColorAsFloat(${Gt.texture2D}(A, offsetToCoords(logical_row_start_offset + i, ${pt}, ${Zt}))); if(current > max) max = current; } return max; }`;return Object.assign(Object.assign({},st),{output:{dims:mt,type:dt.type,textureType:tt.TextureType.unpacked},shaderSource:Xt})},et=(rt,dt,ut,bt,mt,pt)=>{const[Zt,ht]=rt.calculateTextureWidthAndHeight(dt.dims,tt.TextureType.unpacked),Gt=pt.length;if(ut<1||bt<1)throw new Error("Logical row count N and feature count D must be greater than or equal to 1");if(pt.length!==1)throw new Error("Dimensionality of the output should be 1");if(pt[0]!==ut)throw new Error("Shape of the output should be equal to logical row count");if(mt.length!==1)throw new Error("Dimensionality of the intermediate results should be 1");if(mt[0]!==ut)throw new Error("Shape of the intermediate results should be equal to logical row count");const Xt=` float process(int[${Gt}] indices) { int logical_row_start_offset = indices[0] * ${bt}; float norm_factor = 0.0; float max = _Max(indices); for(int i=0; i<${bt}; ++i) { norm_factor += exp(getColorAsFloat(${(0,lt.getGlsl)(rt.session.backend.glContext.version).texture2D}(A, offsetToCoords(logical_row_start_offset + i, ${Zt}, ${ht}))) - max); } return norm_factor; }`;return Object.assign(Object.assign({},ct),{output:{dims:pt,type:dt.type,textureType:tt.TextureType.unpacked},shaderSource:Xt})},nt=(rt,dt,ut,bt,mt,pt)=>{const[Zt,ht]=rt.calculateTextureWidthAndHeight(dt.dims,tt.TextureType.unpacked),Gt=dt.dims.length;if(ut<1||bt<1)throw new Error("Logical row count N and feature count D must be greater than or equal to 1");if(mt.length!==1||pt.length!==1)throw new Error("Dimensionality of the intermediate results should be 1");if(mt[0]!==ut||pt[0]!==ut)throw new Error("Shape of the intermediate results should be equal to logical row count");const Xt=` float process(int[${Gt}] indices) { // get offset of current logical tensor index from the 2-D texture coordinates (TexCoords) int offset = coordsToOffset(TexCoords, ${Zt}, ${ht}); //determine the logical row for this index int logical_row_index[1]; logical_row_index[0] = offset / ${bt}; float norm_factor = _Norm(logical_row_index); // avoid possible division by 0 // if norm_facor is 0, all elements are zero // if so, return 0 if(norm_factor == 0.0) return 0.0; return exp(_A(indices) - _Max(logical_row_index)) / norm_factor; }`;return Object.assign(Object.assign({},it),{output:{dims:dt.dims,type:dt.type,textureType:tt.TextureType.unpacked},shaderSource:Xt})},at=rt=>{if(!rt||rt.length!==1)throw new Error("Softmax requires 1 input.");if(rt[0].type!=="float32"&&rt[0].type!=="float64")throw new Error("Invalid input type")}},5975:(i,o,s)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.parseSplitAttributes=o.split=void 0;const j=s(246),_e=s(2517),lt=s(2039),tt={name:"Split",inputNames:["A"],inputTypes:[lt.TextureType.unpacked]};o.split=(it,$,a)=>{ct($);const et=_e.ShapeUtil.normalizeAxis(a.axis,$[0].dims.length),nt=ot(it,$,et,a),at=[];for(let rt=0;rtst(it,$[0],a,et,rt)}),$));return at},o.parseSplitAttributes=it=>{const $=it.attributes.getInt("axis",0),a=it.attributes.getInts("split",[]),et=it.outputs.length;return(0,j.createAttributeWithCacheKey)({axis:$,split:a,numOutputs:et})};const ot=(it,$,a,et)=>{const[,nt]=_e.SplitUtil.splitShape($[0].dims,a,et.split,et.numOutputs);return nt.length},st=(it,$,a,et,nt)=>{const[at,rt]=_e.SplitUtil.splitShape($.dims,et,a.split,a.numOutputs),dt=rt[nt],ut=at[nt],bt=` float process(int indices[${ut.length}]) { indices[${et}] += ${dt}; return _A(indices); } `;return Object.assign(Object.assign({},tt),{cacheHint:`${a.cacheKey}:${nt}`,output:{dims:ut,type:$.type,textureType:lt.TextureType.unpacked},shaderSource:bt})},ct=it=>{if(!it||it.length!==1)throw new Error("Split requires one input.");if(it[0].type!=="int8"&&it[0].type!=="uint8"&&it[0].type!=="int16"&&it[0].type!=="uint16"&&it[0].type!=="int32"&&it[0].type!=="uint32"&&it[0].type!=="float32"&&it[0].type!=="float64"&&it[0].type!=="bool")throw new Error("Invalid input type.")}},3933:(i,o,s)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.parseSqueezeAttributes=o.squeezeV13=o.squeeze=void 0;const j=s(2517);o.squeeze=(tt,ot,st)=>{_e(ot);const ct=j.ShapeUtil.squeezeShape(ot[0].dims,st);return[tt.reshapeUnpacked(ot[0],ct)]},o.squeezeV13=(tt,ot)=>(lt(ot),(0,o.squeeze)(tt,[ot[0]],Array.from(ot[1].integerData))),o.parseSqueezeAttributes=tt=>tt.attributes.getInts("axes");const _e=tt=>{if(!tt||tt.length!==1)throw new Error("Squeeze requires 1 input.");if(tt[0].type==="string")throw new Error("invalid input tensor types.")},lt=tt=>{if(!tt||tt.length!==2)throw new Error("Squeeze requires 2 inputs.");if(tt[1].type!=="int32")throw new Error("Invalid input type.")}},6558:(i,o,s)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.sum=void 0;const j=s(5060),_e=s(2039);o.sum=(ot,st)=>{tt(st);const ct={name:"Sum",inputNames:st.map((it,$)=>`X${$}`),inputTypes:new Array(st.length).fill(_e.TextureType.unpacked)};return[ot.run(Object.assign(Object.assign({},ct),{get:()=>lt(ot,st,ct)}),st)]};const lt=(ot,st,ct)=>{const it=(0,j.getGlsl)(ot.session.backend.glContext.version),$=st[0].dims.slice(),a=` void main() { vec4 result = ${st.map((et,nt)=>`${it.texture2D}(X${nt},TexCoords)`).join(" + ")}; ${it.output} = result; } `;return Object.assign(Object.assign({},ct),{output:{dims:$,type:st[0].type,textureType:_e.TextureType.unpacked},hasMain:!0,shaderSource:a})},tt=ot=>{if(!ot||ot.length===0)throw new Error("Sum requires inputs.");const st=ot[0].dims.length;for(let ct=1;ct{Object.defineProperty(o,"__esModule",{value:!0}),o.tile=void 0;const j=s(782),_e=s(2039);o.tile=(ot,st)=>{tt(st);const ct={name:"Tile",inputNames:["A"],inputTypes:[_e.TextureType.unpacked]};return[ot.run(Object.assign(Object.assign({},ct),{get:()=>lt(ot,st,ct)}),st)]};const lt=(ot,st,ct)=>{const it=st[0].dims.slice(),$=new Array(it.length),a=[];for(let at=0;at{if(!ot||ot.length!==2)throw new Error("Tile requires 2 input.");if(ot[1].dims.length!==1)throw new Error("The second input shape must 1 dimension.");if(ot[1].dims[0]!==ot[0].dims.length)throw new Error("Invalid input shape.");if(j.NUMBER_TYPES.indexOf(ot[0].type)===-1)throw new Error("Invalid input type.");if(ot[1].type!=="int32"&&ot[1].type!=="int16")throw new Error("Invalid repeat type.")}},3738:(i,o,s)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.parseTransposeAttributes=o.transpose=void 0;const j=s(246),_e=s(2517),lt=s(2039),tt={name:"Transpose",inputNames:["A"],inputTypes:[lt.TextureType.unpacked]};o.transpose=(a,et,nt)=>($(et),[a.run(Object.assign(Object.assign({},tt),{cacheHint:nt.cacheKey,get:()=>ot(a,et[0],nt.perm)}),et)]),o.parseTransposeAttributes=a=>(0,j.createAttributeWithCacheKey)({perm:a.attributes.getInts("perm",[])});const ot=(a,et,nt)=>{const at=et.dims;nt=st(at,nt);const rt=ct(at,nt),dt=at.length,ut=` ${it("perm",nt,dt)} float process(int indices[${dt}]) { int a[${dt}]; perm(a, indices); return _A(a); }`;return Object.assign(Object.assign({},tt),{output:{dims:rt,type:et.type,textureType:lt.TextureType.unpacked},shaderSource:ut})},st=(a,et)=>(et&&et.length!==a.length&&(et=[...a.keys()].reverse()),et),ct=(a,et)=>(et=st(a,et),_e.ShapeUtil.sortBasedOnPerm(a,et)),it=(a,et,nt)=>{const at=[];at.push(`void ${a}(out int a[${nt}], int src[${nt}]) {`);for(let rt=0;rt{if(!a||a.length!==1)throw new Error("Transpose requires 1 input.");if(a[0].type!=="float32"&&a[0].type!=="float64")throw new Error("input should be float tensor")}},8710:(i,o,s)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.encodeAsUint8=void 0;const j=s(5060),_e=s(2039);o.encodeAsUint8=(lt,tt)=>{const ot=tt.shape,st=(0,j.getGlsl)(lt.session.backend.glContext.version),ct=` const float FLOAT_MAX = 1.70141184e38; const float FLOAT_MIN = 1.17549435e-38; bool isNaN(float val) { return (val < 1.0 || 0.0 < val || val == 0.0) ? false : true; } highp vec4 encodeAsUint8(highp float v) { if (isNaN(v)) { return vec4(255, 255, 255, 255); } highp float av = abs(v); if(av < FLOAT_MIN) { return vec4(0.0, 0.0, 0.0, 0.0); } else if(v > FLOAT_MAX) { return vec4(0.0, 0.0, 128.0, 127.0) / 255.0; } else if(v < -FLOAT_MAX) { return vec4(0.0, 0.0, 128.0, 255.0) / 255.0; } highp vec4 c = vec4(0,0,0,0); highp float e = floor(log2(av)); highp float m = exp2(fract(log2(av))) - 1.0; c[2] = floor(128.0 * m); m -= c[2] / 128.0; c[1] = floor(32768.0 * m); m -= c[1] / 32768.0; c[0] = floor(8388608.0 * m); highp float ebias = e + 127.0; c[3] = floor(ebias / 2.0); ebias -= c[3] * 2.0; c[2] += floor(ebias) * 128.0; c[3] += 128.0 * step(0.0, -v); return c / 255.0; } void main() { float value = ${st.texture2D}(X,TexCoords).r; ${st.output} = encodeAsUint8(value); }`,it={name:"Uint8Encode",inputTypes:[_e.TextureType.unpacked],inputNames:["X"],output:{dims:ot,type:tt.tensor.type,textureType:_e.TextureType.downloadUint8AsFloat},shaderSource:ct,hasMain:!0};return lt.executeProgram(it,[tt.tensor])}},4909:(i,o,s)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.tanh=o.tan=o.sqrt=o.sin=o.sigmoid=o.relu=o.not=o.neg=o.log=o.parseLeakyReluAttributes=o.leakyRelu=o.identity=o.floor=o.exp=o.parseEluAttributes=o.elu=o.cos=o.ceil=o.clipV11=o.parseClipAttributes=o.clip=o.atan=o.asin=o.acos=o.abs=o.glslTanh=o.glslTan=o.glslSqrt=o.glslSigmoid=o.glslRelu=o.glslSin=o.glslNot=o.glslNeg=o.glslLog=o.glslLeakyRelu=o.glslIdentity=o.glslClip=o.glslFloor=o.glslExp=o.glslElu=o.glslCos=o.glslCeil=o.glslAtan=o.glslAsin=o.glslAcos=o.glslAbs=void 0;const j=s(246),_e=s(2517),lt=s(8520),tt=s(5060),ot=s(2039);function st(){return Lt("abs")}function ct(){return Lt("acos")}function it(){return Lt("asin")}function $(){return Lt("atan")}function a(){return Lt("ceil")}function et(){return Lt("cos")}function nt(ft){const Ft="elu";return{body:` const float alpha = float(${ft}); float ${Ft}_(float a) { return a >= 0.0 ? a: (exp(a) - 1.0) * alpha; } vec4 ${Ft}_(vec4 v) { return vec4(${Ft}_(v.x), ${Ft}_(v.y), ${Ft}_(v.z), ${Ft}_(v.w)); } `,name:Ft,type:lt.FunctionType.ValueBased}}function at(){return Lt("exp")}function rt(){return Lt("floor")}function dt(ft,Ft){const Jt="clip";return{body:` const float min = float(${ft}); const float max = float(${Ft}); float ${Jt}_(float a) { return clamp(a, min, max); } vec4 ${Jt}_(vec4 v) { return clamp(v, min, max); } `,name:Jt,type:lt.FunctionType.ValueBased}}function ut(){const ft="indentity";return{body:` float ${ft}_(float a) { return a; } vec4 ${ft}_(vec4 v) { return v; } `,name:ft,type:lt.FunctionType.ValueBased}}function bt(ft){const Ft="leakyRelu";return{body:` const float alpha = float(${ft}); float ${Ft}_(float a) { return a < 0.0 ? a * alpha : a; } vec4 ${Ft}_(vec4 v) { return vec4(${Ft}_(v.x), ${Ft}_(v.y), ${Ft}_(v.z), ${Ft}_(v.w)); } `,name:Ft,type:lt.FunctionType.ValueBased}}function mt(){return Lt("log")}function pt(){const ft="neg";return{body:` float ${ft}_(float a) { return -a; } vec4 ${ft}_(vec4 v) { return -v; } `,name:ft,type:lt.FunctionType.ValueBased}}function Zt(){const ft="not";return{body:` float ${ft}_(float a) { return float( ! bool(a) ); } bool ${ft}_(bool a) { return !a; } vec4 ${ft}_(vec4 v) { return vec4(!bool(v.x), !bool(v.y), !bool(v.z), !bool(v.w)); } bvec4 ${ft}_(bvec4 v) { return bvec4(!v.x, !v.y, !v.z, !v.w); } `,name:ft,type:lt.FunctionType.ValueBased}}function ht(){return Lt("sin")}function Gt(){const ft="relu";return{body:` float ${ft}_(float a) { return max( a, 0.0 ); } vec4 ${ft}_(vec4 v) { return max( v, 0.0 ); } `,name:ft,type:lt.FunctionType.ValueBased}}function Xt(){const ft="sigmoid";return{body:` float ${ft}_(float a) { return 1.0 / (1.0 + exp(-a)); } vec4 ${ft}_(vec4 v) { return 1.0 / (1.0 + exp(-v)); } `,name:ft,type:lt.FunctionType.ValueBased}}function Vt(){return Lt("sqrt")}function Yt(){return Lt("tan")}function St(){const ft="tanh";return{body:` float ${ft}_(float a) { a = clamp(a, -10., 10.); a = exp(2.*a); return (a - 1.) / (a + 1.); } vec4 ${ft}_(vec4 v) { v = clamp(v, -10., 10.); v = exp(2.*v); return (v - 1.) / (v + 1.); } `,name:ft,type:lt.FunctionType.ValueBased}}function Lt(ft){return{body:` float ${ft}_(float a) { return ${ft}(a); } vec4 ${ft}_(vec4 v) { return ${ft}(v); } `,name:ft,type:lt.FunctionType.ValueBased}}o.glslAbs=st,o.glslAcos=ct,o.glslAsin=it,o.glslAtan=$,o.glslCeil=a,o.glslCos=et,o.glslElu=nt,o.glslExp=at,o.glslFloor=rt,o.glslClip=dt,o.glslIdentity=ut,o.glslLeakyRelu=bt,o.glslLog=mt,o.glslNeg=pt,o.glslNot=Zt,o.glslSin=ht,o.glslRelu=Gt,o.glslSigmoid=Xt,o.glslSqrt=Vt,o.glslTan=Yt,o.glslTanh=St;const Ct=(ft,Ft,Jt,Ht)=>{const wt=ft.session.pack?ot.TextureType.packed:ot.TextureType.unpacked,Et={name:Jt.name,inputTypes:[wt],inputNames:["A"],cacheHint:Ht};return Object.assign(Object.assign({},Et),{get:()=>((At,Il,Qt,jt)=>{const Xl=At.session.pack?ot.TextureType.packed:ot.TextureType.unpacked,Yl=(0,tt.getGlsl)(At.session.backend.glContext.version);return Object.assign(Object.assign({},Il),{output:{dims:Qt.dims,type:Qt.type,textureType:Xl},shaderSource:` ${jt.body} void main() { vec4 v = ${Yl.texture2D}(A, TexCoords); v = ${jt.name}_(v); ${Yl.output} = v; } `,hasMain:!0})})(ft,Et,Ft,Jt)})};o.abs=(ft,Ft)=>[ft.run(Ct(ft,Ft[0],st()),Ft)],o.acos=(ft,Ft)=>[ft.run(Ct(ft,Ft[0],ct()),Ft)],o.asin=(ft,Ft)=>[ft.run(Ct(ft,Ft[0],it()),Ft)],o.atan=(ft,Ft)=>[ft.run(Ct(ft,Ft[0],$()),Ft)],o.clip=(ft,Ft,Jt)=>[ft.run(Ct(ft,Ft[0],dt(Jt.min,Jt.max),Jt.cacheKey),Ft)],o.parseClipAttributes=ft=>(0,j.createAttributeWithCacheKey)({min:ft.attributes.getFloat("min",_e.MIN_CLIP),max:ft.attributes.getFloat("max",_e.MAX_CLIP)}),o.clipV11=(ft,Ft)=>{const Jt=Tt(ft,Ft);return(0,o.clip)(ft,[Ft[0]],Jt)};const Tt=(ft,Ft)=>{if(Ft.length>=3&&(!ft.session.isInitializer(Ft[1].dataId)||!ft.session.isInitializer(Ft[2].dataId)))throw new Error("dynamic clip attributes are not allowed");const Jt=Ft.length>=3?Ft[1].numberData[0]:_e.MIN_CLIP,Ht=Ft.length>=3?Ft[2].numberData[0]:_e.MAX_CLIP;return(0,j.createAttributeWithCacheKey)({min:Jt,max:Ht})};o.ceil=(ft,Ft)=>[ft.run(Ct(ft,Ft[0],a()),Ft)],o.cos=(ft,Ft)=>[ft.run(Ct(ft,Ft[0],et()),Ft)],o.elu=(ft,Ft,Jt)=>[ft.run(Ct(ft,Ft[0],nt(Jt.alpha),Jt.cacheKey),Ft)],o.parseEluAttributes=ft=>(0,j.createAttributeWithCacheKey)({alpha:ft.attributes.getFloat("alpha",1)}),o.exp=(ft,Ft)=>[ft.run(Ct(ft,Ft[0],at()),Ft)],o.floor=(ft,Ft)=>[ft.run(Ct(ft,Ft[0],rt()),Ft)],o.identity=(ft,Ft)=>[ft.run(Ct(ft,Ft[0],ut()),Ft)],o.leakyRelu=(ft,Ft,Jt)=>[ft.run(Ct(ft,Ft[0],bt(Jt.alpha),Jt.cacheKey),Ft)],o.parseLeakyReluAttributes=ft=>(0,j.createAttributeWithCacheKey)({alpha:ft.attributes.getFloat("alpha",.01)}),o.log=(ft,Ft)=>[ft.run(Ct(ft,Ft[0],mt()),Ft)],o.neg=(ft,Ft)=>[ft.run(Ct(ft,Ft[0],pt()),Ft)],o.not=(ft,Ft)=>[ft.run(Ct(ft,Ft[0],Zt()),Ft)],o.relu=(ft,Ft)=>[ft.run(Ct(ft,Ft[0],Gt()),Ft)],o.sigmoid=(ft,Ft)=>[ft.run(Ct(ft,Ft[0],Xt()),Ft)],o.sin=(ft,Ft)=>[ft.run(Ct(ft,Ft[0],ht()),Ft)],o.sqrt=(ft,Ft)=>[ft.run(Ct(ft,Ft[0],Vt()),Ft)],o.tan=(ft,Ft)=>[ft.run(Ct(ft,Ft[0],Yt()),Ft)],o.tanh=(ft,Ft)=>[ft.run(Ct(ft,Ft[0],St()),Ft)]},5611:(i,o,s)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createUnpackProgramInfoLoader=o.createUnpackProgramInfo=void 0;const j=s(5060),_e=s(2039),lt=s(9390),tt=s(2827),ot={name:"unpack",inputNames:["A"],inputTypes:[_e.TextureType.packed]};o.createUnpackProgramInfo=(st,ct)=>{const it=ct.dims.length,$=(0,tt.getChannels)("rc",it),a=$.slice(-2),et=(0,lt.getCoordsDataType)(it),nt=(0,tt.unpackFromChannel)(),at=ct.dims.length===0?"":function(ut,bt){if(ut===1)return"rc";let mt="";for(let pt=0;ptObject.assign(Object.assign({},ot),{get:()=>(0,o.createUnpackProgramInfo)(st,ct)})},8428:(i,o,s)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.parseUnsqueezeAttributes=o.unsqueezeV13=o.unsqueeze=void 0;const j=s(2517);o.unsqueeze=(tt,ot,st)=>{_e(ot);const ct=j.ShapeUtil.unsqueezeShape(ot[0].dims,st);return[tt.reshapeUnpacked(ot[0],ct)]},o.unsqueezeV13=(tt,ot)=>(lt(ot),(0,o.unsqueeze)(tt,[ot[0]],Array.from(ot[1].integerData))),o.parseUnsqueezeAttributes=tt=>tt.attributes.getInts("axes");const _e=tt=>{if(!tt||tt.length!==1)throw new Error("Unsqueeze requires 1 input.");if(tt[0].type==="string")throw new Error("invalid input tensor types.")},lt=tt=>{if(!tt||tt.length!==2)throw new Error("Unsqueeze requires 2 inputs.");if(tt[1].type!=="int32")throw new Error("Invalid input type.")}},9793:(i,o,s)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.scalesValidation=o.validateInputs=o.parseUpsampleAttributes=o.parseUpsampleAttributesV9=o.parseUpsampleAttributesV7=o.upsample=void 0;const j=s(246),_e=s(5060),lt=s(2039),tt={name:"Upsample",inputNames:["X"],inputTypes:[lt.TextureType.unpacked]};o.upsample=(st,ct,it)=>((0,o.validateInputs)(ct,it),[st.run(Object.assign(Object.assign({},tt),{cacheHint:it.cacheKey,get:()=>ot(st,ct,it)}),ct)]),o.parseUpsampleAttributesV7=st=>(0,o.parseUpsampleAttributes)(st,7),o.parseUpsampleAttributesV9=st=>(0,o.parseUpsampleAttributes)(st,9),o.parseUpsampleAttributes=(st,ct)=>{const it=ct>=10,$=st.attributes.getString("mode","nearest");if($!=="nearest"&&$!=="linear"&&(ct<11||$!=="cubic"))throw new Error(`unrecognized mode: ${$}`);let a=[];ct<9&&(a=st.attributes.getFloats("scales"),(0,o.scalesValidation)(a,$,it));const et=st.attributes.getFloat("extrapolation_value",0),nt=ct>10?st.attributes.getString("coordinate_transformation_mode","half_pixel"):"asymmetric";if(["asymmetric","pytorch_half_pixel","tf_half_pixel_for_nn","align_corners","tf_crop_and_resize","half_pixel"].indexOf(nt)===-1)throw new Error(`coordinate_transform_mode '${nt}' is not supported`);const at=nt==="tf_crop_and_resize",rt=at,dt=$==="nearest"&&ct>=11?st.attributes.getString("nearest_mode","round_prefer_floor"):"";if(["round_prefer_floor","round_prefer_ceil","floor","ceil",""].indexOf(dt)===-1)throw new Error(`nearest_mode '${dt}' is not supported`);const ut=st.attributes.getFloat("cubic_coeff_a",-.75),bt=st.attributes.getInt("exclude_outside",0)!==0;if(bt&&$!=="cubic")throw new Error("exclude_outside can be set to 1 only when mode is CUBIC.");const mt=ct<11||$==="nearest"&&nt==="asymmetric"&&dt==="floor";let pt=0,Zt=0,ht=0;return ct>10?st.inputs.length>2?(pt=1,Zt=2,ht=3):(Zt=1,ht=2):ct===9&&(Zt=1),(0,j.createAttributeWithCacheKey)({opset:ct,isResize:it,mode:$,scales:a,extrapolationValue:et,coordinateTransformMode:nt,useExtrapolation:rt,needRoiInput:at,nearestMode:dt,cubicCoefficientA:ut,excludeOutside:bt,useNearest2xOptimization:mt,roiInputIdx:pt,scalesInputIdx:Zt,sizesInputIdx:ht})};const ot=(st,ct,it)=>{const $=(0,_e.getGlsl)(st.session.backend.glContext.version),[a,et]=st.calculateTextureWidthAndHeight(ct[0].dims,lt.TextureType.unpacked),nt=ct[0].dims.map((ht,Gt)=>Math.floor(ht*it.scales[Gt])),[at,rt]=st.calculateTextureWidthAndHeight(nt,lt.TextureType.unpacked),dt=nt.length,ut=new Array(dt),bt=new Array(dt);let mt=` int output_pitches[${dt}]; int input_pitches[${dt}]; `;for(let ht=dt-1;ht>=0;ht--)ut[ht]=ht===dt-1?1:ut[ht+1]*nt[ht+1],bt[ht]=ht===dt-1?1:bt[ht+1]*ct[0].dims[ht+1],mt+=` output_pitches[${ht}] = ${ut[ht]}; input_pitches[${ht}] = ${bt[ht]}; `;const pt=` float getInputFloat(int index) { vec2 coords = offsetToCoords(index, ${a}, ${et}); float value = getColorAsFloat(${$.texture2D}(X, coords)); return value; } `,Zt=it.mode==="nearest"?` ${pt} float process(int indices[${dt}]) { int input_index = 0; int output_index = coordsToOffset(TexCoords, ${at}, ${rt}); ${mt} int d, m; for (int dim = 0; dim < ${dt}; ++dim) { d = output_index / output_pitches[dim]; m = output_index - d * output_pitches[dim]; output_index = m; if (scales[dim] != 1 && d > 0) { int d2 = d / scales[dim]; m = d - d2 * scales[dim]; d = d2; } input_index += input_pitches[dim] * d; } return getInputFloat(input_index); }`:dt===4?` ${pt} float process(int indices[4]) { int input_index = 0; int output_index = coordsToOffset(TexCoords, ${at}, ${rt}); ${mt} int m; int index_of_dim0, index_of_dim1, index_of_dim2, index_of_dim3; index_of_dim0 = output_index / output_pitches[0]; m = output_index - index_of_dim0 * output_pitches[0]; index_of_dim1 = m / output_pitches[1]; m = m - index_of_dim1 * output_pitches[1]; index_of_dim2 = m / output_pitches[2]; m = m - index_of_dim2 * output_pitches[2]; index_of_dim3 = m; int index_of_input_dim2, index_of_input_dim3, x_offset, y_offset; index_of_input_dim2 = index_of_dim2 / scales[2]; y_offset = index_of_dim2 - index_of_input_dim2 * scales[2]; index_of_input_dim3 = index_of_dim3 / scales[3]; x_offset = index_of_dim3 - index_of_input_dim3 * scales[3]; input_index = index_of_dim0 * input_pitches[0] + index_of_dim1 * input_pitches[1] + index_of_input_dim2 * input_pitches[2] + index_of_input_dim3; float x00 = getInputFloat(input_index); float x10, x01, x11; bool end_of_dim2 = false; if (index_of_input_dim2 == (${ct[0].dims[2]} - 1)) { // It's the end in dimension 2 x01 = x00; end_of_dim2 = true; } else { x01 = getInputFloat(input_index + input_pitches[2]); } if (index_of_input_dim3 == (input_pitches[2] - 1)) { // It's the end in dimension 3 x10 = x00; x11 = x01; } else { x10 = getInputFloat(input_index + 1); x11 = end_of_dim2 ? x10 : getInputFloat(input_index + input_pitches[2] + 1); } float y0 = x00 + float(y_offset) * (x01 - x00) / float(scales[2]); float y1 = x10 + float(y_offset) * (x11 - x10) / float(scales[2]); return y0 + float(x_offset) * (y1 - y0) / float(scales[3]); }`:` ${pt} float process(int indices[2]) { int input_index = 0; int output_index = coordsToOffset(TexCoords, ${at}, ${rt}); ${mt} int m; int index_of_dim0, index_of_dim1; index_of_dim0 = output_index / output_pitches[0]; m = output_index - index_of_dim0 * output_pitches[0]; index_of_dim1 = m; int index_of_input_dim0, index_of_input_dim1, x_offset, y_offset; index_of_input_dim0 = index_of_dim0 / scales[0]; y_offset = index_of_dim0 - index_of_input_dim0 * scales[0]; index_of_input_dim1 = index_of_dim1 / scales[1]; x_offset = index_of_dim1 - index_of_input_dim1 * scales[1]; input_index = index_of_input_dim0 * input_pitches[0] + index_of_input_dim1; float x00 = getInputFloat(input_index); float x10, x01, x11; bool end_of_dim0 = false; if (index_of_input_dim0 == (${ct[0].dims[0]} - 1)) { // It's the end in dimension 0 x01 = x00; end_of_dim0 = true; } else { x01 = getInputFloat(input_index + input_pitches[0]); } if (index_of_input_dim1 == (input_pitches[0] - 1)) { // It's the end in dimension 1 x10 = x00; x11 = x01; } else { x10 = getInputFloat(input_index + 1); x11 = end_of_dim0 ? x10 : getInputFloat(input_index + input_pitches[0] + 1); } float y0 = x00 + float(y_offset) * (x01 - x00) / float(scales[0]); float y1 = x10 + float(y_offset) * (x11 - x10) / float(scales[0]); return y0 + float(x_offset) * (y1 - y0) / float(scales[1]); }`;return Object.assign(Object.assign({},tt),{output:{dims:nt,type:ct[0].type,textureType:lt.TextureType.unpacked},shaderSource:Zt,variables:[{name:"scales",type:"int",arrayLength:it.scales.length,data:it.scales.map(ht=>Math.ceil(ht))}]})};o.validateInputs=(st,ct)=>{if(!st||ct.opset<9&&st.length!==1||ct.opset>=9&&ct.opset<11&&st.length!==2||ct.opset>=11&&st.length<2)throw new Error("invalid inputs.");if(ct.scales.length>0&&st[0].dims.length!==ct.scales.length)throw new Error("Invalid input shape.");if(st[0].type==="string")throw new Error("Invalid input tensor types.")},o.scalesValidation=(st,ct,it)=>{if(it){for(const $ of st)if($<=0)throw new Error("Scale value should be greater than 0.")}else for(const $ of st)if($<1)throw new Error("Scale value should be greater than or equal to 1.");if(!(ct!=="linear"&&ct!=="cubic"||st.length===2||st.length===4&&st[0]===1&&st[1]===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 ${it?"Resize":"Upsample"} opeartor.`)}},1958:(i,o,s)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ProgramManager=void 0;const j=s(1670),_e=s(6231),lt=s(8879),tt=s(5060);o.ProgramManager=class{constructor(ot,st,ct){this.profiler=ot,this.glContext=st,this.textureLayoutStrategy=ct,this.repo=new Map,this.attributesBound=!1}getArtifact(ot){return this.repo.get(ot)}setArtifact(ot,st){this.repo.set(ot,st)}run(ot,st,ct){var it;this.profiler.event("op",`ProgramManager.run ${(it=ot.programInfo.name)!==null&&it!==void 0?it:"unknown kernel"}`,()=>{var $;const a=this.glContext.gl,et=ot.program;a.useProgram(et);try{this.bindOutput(ct),this.attributesBound||this.bindAttributes(ot.attribLocations),this.bindUniforms(ot.uniformLocations,($=ot.programInfo.variables)!==null&&$!==void 0?$:[],st)}catch(nt){throw _e.Logger.error("ProgramManager",ot.programInfo.shaderSource),nt}this.profiler.event("backend","GlContext.draw()",()=>{this.glContext.draw()})},this.glContext)}dispose(){this.vertexShader&&this.glContext.deleteShader(this.vertexShader),this.repo.forEach(ot=>this.glContext.deleteProgram(ot.program))}build(ot,st,ct){return this.profiler.event("backend","ProgramManager.build",()=>{const it=new lt.GlslPreprocessor(this.glContext,ot,st,ct),$=it.preprocess(),a=this.compile($);return{programInfo:ot,program:a,uniformLocations:this.getUniformLocations(a,it.context.programInfo.inputNames,it.context.programInfo.variables),attribLocations:this.getAttribLocations(a)}})}compile(ot){if(!this.vertexShader){_e.Logger.verbose("ProrgramManager","Compiling and caching Vertex shader for the first time");const it=(0,tt.getVertexShaderSource)(this.glContext.version);this.vertexShader=this.glContext.compileShader(it,this.glContext.gl.VERTEX_SHADER)}j.env.debug&&_e.Logger.verbose("ProrgramManager",`FragShader: ${ot} `);const st=this.glContext.compileShader(ot,this.glContext.gl.FRAGMENT_SHADER),ct=this.glContext.createProgram(this.vertexShader,st);return this.glContext.deleteShader(st),ct}bindOutput(ot){const st=ot.width,ct=ot.height;_e.Logger.verbose("ProrgramManager",`Binding output texture to Framebuffer: w/h=${st}/${ct}, shape=${ot.shape}, type=${ot.tensor.type}`),this.glContext.attachFramebuffer(ot.texture,st,ct)}bindAttributes(ot){const st=ot.position,ct=ot.textureCoord;this.glContext.setVertexAttributes(st,ct),this.attributesBound=!0}bindUniforms(ot,st,ct){var it;const $=this.glContext.gl;let a=0;for(const{name:et,type:nt,location:at,arrayLength:rt}of ot){const dt=(it=st.find(ut=>ut.name===et))===null||it===void 0?void 0:it.data;if(nt!=="sampler2D"&&!dt)throw new Error(`variable '${et}' does not have data defined in program info`);switch(nt){case"sampler2D":this.bindTexture(ct[a],at,a),a++;break;case"float":rt?$.uniform1fv(at,dt):$.uniform1f(at,dt);break;case"int":rt?$.uniform1iv(at,dt):$.uniform1i(at,dt);break;default:throw new Error(`Uniform not implemented: ${nt}`)}}}bindTexture(ot,st,ct){this.glContext.bindTextureToUniform(ot.texture,ct,st)}getAttribLocations(ot){return{position:this.getAttribLocation(ot,"position"),textureCoord:this.getAttribLocation(ot,"textureCoord")}}getUniformLocations(ot,st,ct){const it=[];if(st)for(const $ of st)it.push({name:$,type:"sampler2D",location:this.getUniformLocation(ot,$)});if(ct)for(const $ of ct)it.push(Object.assign(Object.assign({},$),{location:this.getUniformLocation(ot,$.name)}));return it}getUniformLocation(ot,st){const ct=this.glContext.gl.getUniformLocation(ot,st);if(ct===null)throw new Error(`Uniform ${st} not found.`);return ct}getAttribLocation(ot,st){return this.glContext.gl.getAttribLocation(ot,st)}}},6416:(i,o,s)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WebGLSessionHandler=void 0;const j=s(6231),_e=s(1047),lt=s(8316),tt=s(1640),ot=s(1958),st=s(7859),ct=s(5702);o.WebGLSessionHandler=class{constructor(it,$){this.backend=it,this.context=$,this.layoutStrategy=new st.PreferLogicalStrategy(it.glContext.maxTextureSize),this.programManager=new ot.ProgramManager(this.context.profiler,it.glContext,this.layoutStrategy),this.textureManager=new ct.TextureManager(it.glContext,this.layoutStrategy,this.context.profiler,{reuseTextures:it.textureCacheMode==="full"}),this.packedTextureDataCache=new Map,this.unpackedTextureDataCache=new Map,this.pack=it.pack,this.pack2unpackMap=new Map,this.unpack2packMap=new Map}createInferenceHandler(){return new lt.WebGLInferenceHandler(this)}onGraphInitialized(it){const $=it.getValues().filter(a=>a.from===-1&&a.tensor).map(a=>a.tensor.dataId);this.initializers=new Set($)}isInitializer(it){return!!this.initializers&&this.initializers.has(it)}addInitializer(it){this.initializers.add(it)}getTextureData(it,$){return $?this.packedTextureDataCache.get(it):this.unpackedTextureDataCache.get(it)}setTextureData(it,$,a=!1){j.Logger.verbose("WebGLSessionHandler","Storing Texture data in cache"),a?this.packedTextureDataCache.set(it,$):this.unpackedTextureDataCache.set(it,$)}dispose(){this.programManager.dispose(),this.textureManager.clearActiveTextures(),this.packedTextureDataCache.forEach(it=>this.textureManager.releaseTexture(it,!0)),this.packedTextureDataCache=new Map,this.unpackedTextureDataCache.forEach(it=>this.textureManager.releaseTexture(it,!0)),this.unpackedTextureDataCache=new Map}resolve(it,$,a){const et=(0,_e.resolveOperator)(it,$,tt.WEBGL_OP_RESOLVE_RULES);return{impl:et.opImpl,context:et.opInit?et.opInit(it,a):it}}}},7769:(i,o,s)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Uint8DataEncoder=o.RGBAFloatDataEncoder=o.RedFloat32DataEncoder=void 0;const j=s(6231);o.RedFloat32DataEncoder=class{constructor(_e,lt=1){if(lt===1)this.internalFormat=_e.R32F,this.format=_e.RED,this.textureType=_e.FLOAT,this.channelSize=lt;else{if(lt!==4)throw new Error(`Invalid number of channels: ${lt}`);this.internalFormat=_e.RGBA32F,this.format=_e.RGBA,this.textureType=_e.FLOAT,this.channelSize=lt}}encode(_e,lt){let tt,ot;return _e.constructor!==Float32Array&&(j.Logger.warning("Encoder","data was not of type Float32; creating new Float32Array"),ot=new Float32Array(_e)),lt*this.channelSize>_e.length?(j.Logger.warning("Encoder","Source data too small. Allocating larger array"),ot=_e,tt=this.allocate(lt*this.channelSize),ot.forEach((st,ct)=>tt[ct]=st)):(ot=_e,tt=ot),tt}allocate(_e){return new Float32Array(4*_e)}decode(_e,lt){return this.channelSize===1?_e.filter((tt,ot)=>ot%4==0).subarray(0,lt):_e.subarray(0,lt)}},o.RGBAFloatDataEncoder=class{constructor(_e,lt=1,tt){if(lt!==1&<!==4)throw new Error(`Invalid number of channels: ${lt}`);this.internalFormat=_e.RGBA,this.format=_e.RGBA,this.channelSize=lt,this.textureType=tt||_e.FLOAT}encode(_e,lt){let tt=_e;return this.channelSize===1&&(j.Logger.verbose("Encoder","Exploding into a larger array"),tt=this.allocate(lt),_e.forEach((ot,st)=>tt[4*st]=ot)),tt}allocate(_e){return new Float32Array(4*_e)}decode(_e,lt){return this.channelSize===1?_e.filter((tt,ot)=>ot%4==0).subarray(0,lt):_e.subarray(0,lt)}},o.Uint8DataEncoder=class{constructor(_e,lt=1){if(this.channelSize=4,lt===1)this.internalFormat=_e.ALPHA,this.format=_e.ALPHA,this.textureType=_e.UNSIGNED_BYTE,this.channelSize=lt;else{if(lt!==4)throw new Error(`Invalid number of channels: ${lt}`);this.internalFormat=_e.RGBA,this.format=_e.RGBA,this.textureType=_e.UNSIGNED_BYTE,this.channelSize=lt}}encode(_e,lt){return new Uint8Array(_e.buffer,_e.byteOffset,_e.byteLength)}allocate(_e){return new Uint8Array(_e*this.channelSize)}decode(_e,lt){if(_e instanceof Uint8Array)return _e.subarray(0,lt);throw new Error(`Invalid array type: ${_e.constructor}`)}}},7859:(i,o,s)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.getBatchDim=o.sizeToSquarishShape=o.getRowsCols=o.sizeFromShape=o.isInt=o.parseAxisParam=o.squeezeShape=o.PreferLogicalStrategy=o.AlwaysKeepOriginalSizeStrategy=void 0;const j=s(6231),_e=s(2517);function lt(it,$){const a=[],et=[],nt=$!=null&&Array.isArray($)&&$.length===0,at=$==null||nt?null:tt($,it).sort();let rt=0;for(let dt=0;dtdt)&&it[dt]===1&&(a.push(it[dt]),et.push(dt)),at[rt]<=dt&&rt++}it[dt]!==1&&(a.push(it[dt]),et.push(dt))}return{newShape:a,keptDims:et}}function tt(it,$){const a=$.length;return it=it==null?$.map((et,nt)=>nt):[].concat(it),(0,_e.assert)(it.every(et=>et>=-a&&et`All values in axis param must be in range [-${a}, ${a}) but got axis ${it}`),(0,_e.assert)(it.every(ot),()=>`All values in axis param must be integers but got axis ${it}`),it.map(et=>et<0?a+et:et)}function ot(it){return it%1==0}function st(it){if(it.length===0)return 1;let $=it[0];for(let a=1;a=it.length?1:it.slice($.breakAxis).reduce((dt,ut)=>dt*ut),rt=$.breakAxis<=0?1:it.slice(0,$.breakAxis).reduce((dt,ut)=>dt*ut);if(!(at>a||rt>a))return[at,rt];j.Logger.verbose("TextureLayout",`Given width/height preferences were unattainable: shape:${it}, breakAxis:${$.breakAxis}`)}const et=it.reduce((at,rt)=>at*rt);let nt=Math.floor(Math.sqrt(et));for(;nt=a||et%nt!=0)throw new Error(`The given dimensions are outside this GPU's boundaries: ${it}`);return[nt,et/nt]}},o.PreferLogicalStrategy=class{constructor(it){this.maxTextureSize=it}computeTextureWH(it,$){const a=this.computeTexture(it,$);return $&&$.isPacked&&(a[0]/=2,a[1]/=2),$&&$.reverseWH?[a[1],a[0]]:a}computeTexture(it,$){const a=$&&$.isPacked;if(it.length===0)return a?[2,2]:[1,1];let et=this.maxTextureSize;if($&&$.breakAxis!==void 0){const rt=$.breakAxis>=it.length?1:it.slice($.breakAxis).reduce((ut,bt)=>ut*bt),dt=$.breakAxis<=0?1:it.slice(0,$.breakAxis).reduce((ut,bt)=>ut*bt);if(!(rt>et||dt>et))return[rt,dt];j.Logger.verbose("TextureLayout",`Given width/height preferences were unattainable: shape:${it}, breakAxis:${$.breakAxis}`)}let nt=it.slice(0);a&&(et*=2,nt=nt.map((rt,dt)=>dt>=nt.length-2?nt[dt]%2==0?nt[dt]:nt[dt]+1:nt[dt]),nt.length===1&&(nt=[2,nt[0]])),nt.length!==2&&(nt=lt(nt).newShape);const at=st(nt);return nt.length<=1&&at<=et?[1,at]:nt.length===2&&nt[0]<=et&&nt[1]<=et?nt:nt.length===3&&nt[0]*nt[1]<=et&&nt[2]<=et?[nt[0]*nt[1],nt[2]]:nt.length===3&&nt[0]<=et&&nt[1]*nt[2]<=et?[nt[0],nt[1]*nt[2]]:nt.length===4&&nt[0]*nt[1]*nt[2]<=et&&nt[3]<=et?[nt[0]*nt[1]*nt[2],nt[3]]:nt.length===4&&nt[0]<=et&&nt[1]*nt[2]*nt[3]<=et?[nt[0],nt[1]*nt[2]*nt[3]]:a?ct(at/4).map(rt=>2*rt):ct(at)}},o.squeezeShape=lt,o.parseAxisParam=tt,o.isInt=ot,o.sizeFromShape=st,o.getRowsCols=function(it){if(it.length===0)throw Error("Cannot get rows and columns of an empty shape array.");return[it.length>1?it[it.length-2]:1,it[it.length-1]]},o.sizeToSquarishShape=ct,o.getBatchDim=function(it,$=2){return st(it.slice(0,it.length-$))}},4057:(i,o,s)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createTextureLayoutFromShape=o.calculateTextureWidthAndHeight=o.createTextureLayoutFromTextureType=void 0;const j=s(2517),_e=s(2039);o.createTextureLayoutFromTextureType=(lt,tt,ot)=>{const st=ot===_e.TextureType.unpacked||ot===_e.TextureType.unpackedReversed?1:4,ct=ot===_e.TextureType.packed,it=ot===_e.TextureType.unpackedReversed||ot===_e.TextureType.packed,$=ot===_e.TextureType.packedLastDimension?tt.length-1:void 0,a=ot===_e.TextureType.packedLastDimension?tt.map((et,nt)=>nt===tt.length-1?4*et:et):void 0;return(0,o.createTextureLayoutFromShape)(lt,tt,st,a,{isPacked:ct,reverseWH:it,breakAxis:$})},o.calculateTextureWidthAndHeight=(lt,tt,ot)=>{const st=(0,o.createTextureLayoutFromTextureType)(lt,tt,ot);return[st.width,st.height]},o.createTextureLayoutFromShape=(lt,tt,ot=1,st,ct)=>{const it=!(!ct||!ct.isPacked),[$,a]=lt.computeTextureWH(it&&st||tt,ct),et=tt.length;let nt=tt.slice(0);if(et===0&&(nt=[1]),ot===1)st=tt;else if(it){if(ot!==4)throw new Error("a packed texture must be 4-channel");st=tt,et>0&&(nt[et-1]=Math.ceil(nt[et-1]/2)),et>1&&(nt[et-2]=Math.ceil(nt[et-2]/2))}else if(!st)throw new Error("Unpacked shape is needed when using channels > 1");return{width:$,height:a,channels:ot,isPacked:it,shape:nt,strides:j.ShapeUtil.computeStrides(nt),unpackedShape:st,reversedWH:ct&&ct.reverseWH}}},5702:(i,o,s)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TextureManager=void 0;const j=s(6231);o.TextureManager=class{constructor(_e,lt,tt,ot){this.glContext=_e,this.layoutStrategy=lt,this.profiler=tt,this.config=ot,this.pendingRead=new Map,ot.reuseTextures&&(this.inUseTextures=new Map,this.idleTextures=new Map,this.textureLookup=new Map)}createTextureFromLayout(_e,lt,tt,ot){const st=this.toEncoderType(_e),ct=this.glContext.getEncoder(st,lt.channels||1,ot);if(lt.isPacked&&ot===1)throw new Error("not implemented");const it=lt.width,$=lt.height;let a,et;if(this.config.reuseTextures){a=`${it}x${$}_${ct.format}_${ct.internalFormat}_${ct.textureType}`,et=this.inUseTextures.get(a),et||(et=[],this.inUseTextures.set(a,et));const at=this.idleTextures.get(a);if(at&&at.length>0){const rt=at.pop();return et.push(rt),ot===1&&this.glContext.updateTexture(rt,it,$,ct,this.toTextureData(_e,tt)),rt}}j.Logger.verbose("TextureManager",`Creating new texture of size ${lt.width}x${lt.height}`);const nt=this.glContext.allocateTexture(it,$,ct,this.toTextureData(_e,tt));return this.config.reuseTextures&&(et.push(nt),this.textureLookup.set(nt,a)),nt}readTexture(_e,lt,tt){return tt||(tt=1),this.profiler.event("backend","TextureManager.readTexture",()=>{const ot=_e.shape.reduce((ct,it)=>ct*it)*tt,st=this.glContext.readTexture(_e.texture,_e.width,_e.height,ot,this.toEncoderType(lt),tt);return this.toTensorData(lt,st)})}async readTextureAsync(_e,lt,tt){const ot=_e.tensor.dataId;if(tt||(tt=1),this.pendingRead.has(ot)){const st=this.pendingRead.get(ot);return new Promise(ct=>st==null?void 0:st.push(ct))}return this.profiler.event("backend","TextureManager.readTextureAsync",async()=>{this.pendingRead.set(ot,[]);const st=_e.shape.reduce((a,et)=>a*et)*tt;await this.glContext.createAndWaitForFence();const ct=this.glContext.readTexture(_e.texture,_e.width,_e.height,st,this.toEncoderType(lt),tt),it=this.toTensorData(lt,ct),$=this.pendingRead.get(ot);return this.pendingRead.delete(ot),$==null||$.forEach(a=>a(it)),it})}readUint8TextureAsFloat(_e){return this.profiler.event("backend","TextureManager.readUint8TextureAsFloat",()=>{const lt=_e.shape.reduce((ot,st)=>ot*st),tt=this.glContext.readTexture(_e.texture,_e.width,_e.height,4*lt,"byte",4);return new Float32Array(tt.buffer,tt.byteOffset,lt)})}releaseTexture(_e,lt){let tt;if(this.config.reuseTextures&&(tt=this.textureLookup.get(_e.texture),tt)){lt&&this.textureLookup.delete(tt);const ot=this.inUseTextures.get(tt);if(ot){const st=ot.indexOf(_e.texture);if(st!==-1){ot.splice(st,1);let ct=this.idleTextures.get(tt);ct||(ct=[],this.idleTextures.set(tt,ct)),ct.push(_e.texture)}}}tt&&!lt||(j.Logger.verbose("TextureManager",`Deleting texture of size ${_e.width}x${_e.height}`),this.glContext.deleteTexture(_e.texture))}toTensorData(_e,lt){switch(_e){case"int16":return lt instanceof Int16Array?lt:Int16Array.from(lt);case"int32":return lt instanceof Int32Array?lt:Int32Array.from(lt);case"int8":return lt instanceof Int8Array?lt:Int8Array.from(lt);case"uint16":return lt instanceof Uint16Array?lt:Uint16Array.from(lt);case"uint32":return lt instanceof Uint32Array?lt:Uint32Array.from(lt);case"uint8":case"bool":return lt instanceof Uint8Array?lt:Uint8Array.from(lt);case"float32":return lt instanceof Float32Array?lt:Float32Array.from(lt);case"float64":return lt instanceof Float64Array?lt:Float64Array.from(lt);default:throw new Error(`TensorData type ${_e} is not supported`)}}toTextureData(_e,lt){if(lt)return lt instanceof Float32Array?lt:new Float32Array(lt)}toEncoderType(_e){return"float"}clearActiveTextures(){this.glContext.clearActiveTextures()}}},2039:(i,o)=>{var s;Object.defineProperty(o,"__esModule",{value:!0}),o.TextureType=void 0,(s=o.TextureType||(o.TextureType={}))[s.unpacked=0]="unpacked",s[s.unpackedReversed=1]="unpackedReversed",s[s.packed=2]="packed",s[s.downloadUint8AsFloat=3]="downloadUint8AsFloat",s[s.packedLastDimension=4]="packedLastDimension"},9390:(i,o,s)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.getGlChannels=o.getCoordsDataType=o.getSqueezedParams=o.squeezeInputShape=o.generateShaderFuncNameFromInputSamplerNameAtOutCoords=o.generateShaderFuncNameFromInputSamplerName=o.repeatedTry=o.getPackedShape=void 0;const j=s(2517);o.getPackedShape=function(_e){const lt=_e.length;return _e.slice(0,lt-1).concat(_e[lt-1]/4)},o.repeatedTry=async function(_e,lt=ot=>0,tt){return new Promise((ot,st)=>{let ct=0;const it=()=>{if(_e())return void ot();ct++;const $=lt(ct);tt!=null&&ct>=tt?st():setTimeout(it,$)};it()})},o.generateShaderFuncNameFromInputSamplerName=function(_e){return(0,j.assert)(_e!==void 0&&_e.length!==0,()=>"empty string found for sampler name"),"get"+_e.charAt(0).toUpperCase()+_e.slice(1)},o.generateShaderFuncNameFromInputSamplerNameAtOutCoords=function(_e){return(0,j.assert)(_e!==void 0&&_e.length!==0,()=>"empty string found for sampler name"),"get"+_e.charAt(0).toUpperCase()+_e.slice(1)+"AtOutCoords"},o.squeezeInputShape=function(_e,lt){let tt=JSON.parse(JSON.stringify(_e));return tt=lt,tt},o.getSqueezedParams=function(_e,lt){return lt.map(tt=>_e[tt]).join(", ")},o.getCoordsDataType=function(_e){if(_e<=1)return"int";if(_e===2)return"ivec2";if(_e===3)return"ivec3";if(_e===4)return"ivec4";if(_e===5)return"ivec5";if(_e===6)return"ivec6";throw Error(`GPU for rank ${_e} is not yet supported`)},o.getGlChannels=function(_e=6){return["x","y","z","w","u","v"].slice(0,_e)}},7305:(i,o,s)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createNewWebGLContext=o.createWebGLContext=void 0;const j=s(6231),_e=s(1713),lt={};function tt(ot){const st=function(){if(typeof document>"u"){if(typeof OffscreenCanvas>"u")throw new TypeError("failed to create canvas: OffscreenCanvas is not supported");return new OffscreenCanvas(1,1)}const $=document.createElement("canvas");return $.width=1,$.height=1,$}();let ct;const it={alpha:!1,depth:!1,antialias:!1,stencil:!1,preserveDrawingBuffer:!1,premultipliedAlpha:!1,failIfMajorPerformanceCaveat:!1};if((!ot||ot==="webgl2")&&(ct=st.getContext("webgl2",it),ct))try{return new _e.WebGLContext(ct,2)}catch($){j.Logger.warning("GlContextFactory",`failed to create WebGLContext using contextId 'webgl2'. Error: ${$}`)}if((!ot||ot==="webgl")&&(ct=st.getContext("webgl",it)||st.getContext("experimental-webgl",it),ct))try{return new _e.WebGLContext(ct,1)}catch($){j.Logger.warning("GlContextFactory",`failed to create WebGLContext using contextId 'webgl' or 'experimental-webgl'. Error: ${$}`)}throw new Error("WebGL is not supported")}o.createWebGLContext=function ot(st){let ct;st&&st!=="webgl2"||!("webgl2"in lt)?st&&st!=="webgl"||!("webgl"in lt)||(ct=lt.webgl):ct=lt.webgl2,ct=ct||tt(st),st=st||ct.version===1?"webgl":"webgl2";const it=ct.gl;return lt[st]=ct,it.isContextLost()?(delete lt[st],ot(st)):(it.disable(it.DEPTH_TEST),it.disable(it.STENCIL_TEST),it.disable(it.BLEND),it.disable(it.DITHER),it.disable(it.POLYGON_OFFSET_FILL),it.disable(it.SAMPLE_COVERAGE),it.enable(it.SCISSOR_TEST),it.enable(it.CULL_FACE),it.cullFace(it.BACK),ct)},o.createNewWebGLContext=tt},1713:function(i,o,s){var j=this&&this.__createBinding||(Object.create?function(it,$,a,et){et===void 0&&(et=a);var nt=Object.getOwnPropertyDescriptor($,a);nt&&!("get"in nt?!$.__esModule:nt.writable||nt.configurable)||(nt={enumerable:!0,get:function(){return $[a]}}),Object.defineProperty(it,et,nt)}:function(it,$,a,et){et===void 0&&(et=a),it[et]=$[a]}),_e=this&&this.__setModuleDefault||(Object.create?function(it,$){Object.defineProperty(it,"default",{enumerable:!0,value:$})}:function(it,$){it.default=$}),lt=this&&this.__importStar||function(it){if(it&&it.__esModule)return it;var $={};if(it!=null)for(var a in it)a!=="default"&&Object.prototype.hasOwnProperty.call(it,a)&&j($,it,a);return _e($,it),$};Object.defineProperty(o,"__esModule",{value:!0}),o.WebGLContext=o.linearSearchLastTrue=void 0;const tt=s(1670),ot=lt(s(7769)),st=s(9390);function ct(it){let $=0;for(;$this.isTimerResultAvailable(it)),this.getTimerResult(it)}async createAndWaitForFence(){const it=this.createFence(this.gl);return this.pollFence(it)}createFence(it){let $;const a=it,et=a.fenceSync(a.SYNC_GPU_COMMANDS_COMPLETE,0);return it.flush(),$=et===null?()=>!0:()=>{const nt=a.clientWaitSync(et,0,0);return nt===a.ALREADY_SIGNALED||nt===a.CONDITION_SATISFIED},{query:et,isFencePassed:$}}async pollFence(it){return new Promise($=>{this.addItemToPoll(()=>it.isFencePassed(),()=>$())})}pollItems(){const it=ct(this.itemsToPoll.map($=>$.isDoneFn));for(let $=0;$<=it;++$){const{resolveFn:a}=this.itemsToPoll[$];a()}this.itemsToPoll=this.itemsToPoll.slice(it+1)}async addItemToPoll(it,$){this.itemsToPoll.push({isDoneFn:it,resolveFn:$}),this.itemsToPoll.length>1||await(0,st.repeatedTry)(()=>(this.pollItems(),this.itemsToPoll.length===0))}}},1036:(i,o,s)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ExecutionPlan=void 0;const j=s(6231);class _e{constructor(tt,ot){this.op=tt,this.node=ot}}o.ExecutionPlan=class{constructor(lt,tt,ot){this.graph=lt,this.profiler=ot,this.initialize(tt)}initialize(lt){this.profiler.event("session","ExecutionPlan.initialize",()=>{const tt=this.graph.getNodes();if(tt.length!==lt.length)throw new Error("The size of nodes and OPs do not match.");this._ops=lt.map((ot,st)=>new _e(ot,tt[st])),this.reset(),this._starter=[],this._ops.forEach((ot,st)=>{let ct=!0;for(const it of ot.node.inputs)if(!this._values[it]&&this.graph.getInputIndices().indexOf(it)===-1){ct=!1;break}ct&&this._starter.push(st)})})}reset(){this._values=this.graph.getValues().map(lt=>lt.tensor)}async execute(lt,tt){return this.profiler.event("session","ExecutionPlan.execute",async()=>{this.reset();const ot=lt.createInferenceHandler(),st=this.graph.getInputIndices();if(tt.length!==st.length)throw new Error(`number of input tensors don't match the number of inputs to the model: actual: ${tt.length} expected: ${st.length}`);tt.forEach((nt,at)=>{const rt=st[at];this._values[rt]=nt});const ct=this._starter.slice(0),it=this.graph.getValues(),$=this.graph.getNodes();let a=0;for(;athis._values[mt]);if(rt.indexOf(void 0)!==-1)throw new Error(`unresolved input detected: op: ${at.node}`);const dt=rt;j.Logger.verbose("ExecPlan",`Runing op:${at.node.name} (${dt.map((mt,pt)=>`'${at.node.inputs[pt]}': ${mt.type}[${mt.dims.join(",")}]`).join(", ")})`);const ut=await this.profiler.event("node",at.node.name,async()=>at.op.impl(ot,dt,at.op.context));if(ut.length!==at.node.outputs.length)throw new Error("the size of output does not match model definition.");ut.forEach((mt,pt)=>{const Zt=at.node.outputs[pt];if(this._values[Zt])throw new Error(`output [${Zt}] already has value: op:${at.node.name}`);this._values[Zt]=mt});const bt=new Set;ut.forEach((mt,pt)=>{const Zt=at.node.outputs[pt];for(const ht of it[Zt].to){const Gt=$[ht];let Xt=!0;for(const Vt of Gt.inputs)if(!this._values[Vt]){Xt=!1;break}Xt&&bt.add(ht)}}),ct.push(...bt)}const et=[];for(let nt=0;nt{Object.defineProperty(o,"__esModule",{value:!0}),o.Graph=void 0;const j=s(1446),_e=s(7778),lt=s(9395),tt=s(9162),ot=s(2517);var st=lt.onnxruntime.experimental.fbs;o.Graph={from:(a,et)=>new $(a,et)};class ct{constructor(et){this._from=void 0,this._to=[],this.tensor=void 0,this.type=void 0,et&&(this.type=ot.ProtoUtil.tensorValueTypeFromProto(et.type.tensorType))}get from(){return this._from}get to(){return this._to}}class it{constructor(et,nt){et instanceof j.onnx.NodeProto?(this.name=et.name,this.opType=et.opType,this.attributes=new _e.Attribute(et.attribute)):et instanceof st.Node&&(this.name=nt??et.name(),this.opType=et.opType(),this.attributes=new _e.Attribute(ot.ProtoUtil.tensorAttributesFromORTFormat(et))),this.inputs=[],this.outputs=[],this.executeNode=!0}}class ${constructor(et,nt){if(!et)throw new TypeError("graph is empty");this.buildGraph(et),this.transformGraph(nt),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(et){if(et instanceof j.onnx.GraphProto)this.buildGraphFromOnnxFormat(et);else{if(!(et instanceof st.Graph))throw new TypeError("Graph type is not supported.");this.buildGraphFromOrtFormat(et)}}buildGraphFromOnnxFormat(et){const nt=new Map;this._allData=[],this._allInputIndices=[],this._allInputNames=[],this._allOutputIndices=[],this._allOutputNames=[],this._nodes=[];const at=new Map;if(!et.input)throw new Error("missing information in graph: input");const rt=[];for(const dt of et.input){if(nt.has(dt.name))throw new Error(`duplicated input name: ${dt.name}`);const ut=this._allData.push(new ct(dt))-1;nt.set(dt.name,ut),rt.push(dt.name)}if(!et.initializer)throw new Error("missing information in graph: initializer");for(const dt of et.initializer){let ut=nt.get(dt.name);if(ut===void 0){const bt=new ct;bt.type={shape:{dims:ot.ProtoUtil.tensorDimsFromProto(dt.dims)},tensorType:ot.ProtoUtil.tensorDataTypeFromProto(dt.dataType)},ut=this._allData.push(bt)-1,nt.set(dt.name,ut)}this._allData[ut]._from=-1,this._allData[ut].tensor=tt.Tensor.fromProto(dt)}for(let dt=0;dt{this._allData[rt]._to.forEach(dt=>{et.add(dt)})});const nt=Array.from(et),at=new Array(this._nodes.length).fill("white");for(;nt.length>0;){const rt=nt.pop();at[rt]==="gray"?at[rt]="black":(nt.push(rt),at[rt]="gray",this._nodes[rt].outputs.forEach(dt=>{const ut=this._allData[dt];if(ut.tensor!==void 0)throw new Error("node outputs should not be initialized");if(ut._from!==rt)throw new Error("from property of the Value object doesn't match index of Node being processed");ut._to.forEach(bt=>{if(at[bt]==="gray")throw new Error("model graph is cyclic");at[bt]==="white"&&nt.push(bt)})}))}}transformGraph(et){this.removeAllIdentityNodes(),this.removeAllDropoutNodes(),this.fuseConvActivationNodes(),et&&et.transformGraph(this),this.finalizeGraph()}finalizeGraph(){let et=0;for(let nt=0;nt0&&(this._nodes[nt].inputs.forEach(at=>{const rt=this._allData[at]._to.indexOf(nt+et);rt!==-1&&(this._allData[at]._to[rt]=nt)}),this._nodes[nt].outputs.forEach(at=>{this._allData[at]._from&&this._allData[at]._from===nt+et&&(this._allData[at]._from=nt)})):(et++,this._nodes[nt].outputs.forEach(at=>{this._allData[at]._from=-2}),this._nodes.splice(nt,1),nt--);et=0;for(let nt=0;nt0){let at=-1;this._allData[nt].from!==void 0&&this._allData[nt].from!==-1?(at=this._nodes[this._allData[nt].from].outputs.indexOf(nt+et),at!==-1&&(this._nodes[this._allData[nt].from].outputs[at]=nt)):(at=this._allInputIndices.indexOf(nt+et),at!==-1&&(this._allInputIndices[at]=nt)),this._allData[nt].to.forEach(rt=>{at=this._nodes[rt].inputs.indexOf(nt+et),at!==-1&&(this._nodes[rt].inputs[at]=nt)}),this._allData[nt].to.length===0&&(at=this._allOutputIndices.indexOf(nt+et),at!==-1&&(this._allOutputIndices[at]=nt))}}else et++,this._allData.splice(nt,1),nt--}deleteNode(et){const nt=this._nodes[et];if(nt.outputs.length>1){for(let mt=1;mt0)throw new Error("Node deletion with more than one output connected to other nodes is not supported. ")}nt.executeNode=!1;const at=nt.inputs[0],rt=nt.outputs[0],dt=this._allData[rt].to,ut=this._allData[at].to.indexOf(et);if(ut===-1)throw new Error("The Value object doesn't have the current Node in it's 'to' property ");this._allData[at].to.splice(ut,1),this._allData[rt]._to=[];const bt=this._allOutputIndices.indexOf(rt);if(bt!==-1&&(this._allOutputIndices[bt]=at),dt&&dt.length>0)for(const mt of dt){const pt=this._nodes[mt].inputs.indexOf(rt);if(pt===-1)throw new Error("The Node object doesn't have the output Value in it's 'inputs' property ");this._nodes[mt].inputs[pt]=at,this._allData[at].to.push(mt)}}removeAllDropoutNodes(){let et=0;for(const nt of this._nodes){if(nt.opType==="Dropout"){if(nt.inputs.length!==1)throw new Error("Dropout nodes should only contain one input. ");if(nt.outputs.length!==1&&nt.outputs.length!==2)throw new Error("Dropout nodes should contain either 1 or 2 output(s)");if(nt.outputs.length===2&&this._allData[nt.outputs[1]]._to.length!==0)throw new Error("Dropout nodes's second output should not be referenced by other nodes");this.deleteNode(et)}et++}}removeAllIdentityNodes(){let et=0;for(const nt of this._nodes)nt.opType==="Identity"&&this.deleteNode(et),et++}isActivation(et){switch(et.opType){case"Relu":case"Sigmoid":case"Clip":return!0;default:return!1}}fuseConvActivationNodes(){for(const et of this._nodes)if(et.opType==="Conv"){const nt=this._allData[et.outputs[0]]._to;if(nt.length===1&&this.isActivation(this._nodes[nt[0]])){const at=this._nodes[nt[0]];if(at.opType==="Clip")if(at.inputs.length===1)try{et.attributes.set("activation_params","floats",[at.attributes.getFloat("min"),at.attributes.getFloat("max")])}catch{et.attributes.set("activation_params","floats",[ot.MIN_CLIP,ot.MAX_CLIP])}else{if(!(at.inputs.length>=3&&this._allData[at.inputs[1]].tensor!==void 0&&this._allData[at.inputs[2]].tensor!==void 0))continue;et.attributes.set("activation_params","floats",[this._allData[at.inputs[1]].tensor.floatData[0],this._allData[at.inputs[2]].tensor.floatData[0]])}et.attributes.set("activation","string",at.opType),this.deleteNode(nt[0])}}}}},6231:(i,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.now=o.Profiler=o.Logger=void 0;const s={verbose:1e3,info:2e3,warning:4e3,error:5e3,fatal:6e3},j={none:new class{log(it,$,a){}},console:new class{log(it,$,a){console.log(`${this.color(it)} ${a?"\x1B[35m"+a+"\x1B[0m ":""}${$}`)}color(it){switch(it){case"verbose":return"\x1B[34;40mv\x1B[0m";case"info":return"\x1B[32mi\x1B[0m";case"warning":return"\x1B[30;43mw\x1B[0m";case"error":return"\x1B[31;40me\x1B[0m";case"fatal":return"\x1B[101mf\x1B[0m";default:throw new Error(`unsupported severity: ${it}`)}}}},_e={provider:"console",minimalSeverity:"warning",logDateTime:!0,logSourceLocation:!1};let lt={"":_e};function tt(it,$,a,et){if($===void 0)return nt=it,{verbose:tt.verbose.bind(null,nt),info:tt.info.bind(null,nt),warning:tt.warning.bind(null,nt),error:tt.error.bind(null,nt),fatal:tt.fatal.bind(null,nt)};if(a===void 0)ot(it,$);else if(typeof a=="number"&&et===void 0)ot(it,$);else if(typeof a=="string"&&et===void 0)ot(it,a,0,$);else{if(typeof a!="string"||typeof et!="number")throw new TypeError("input is valid");ot(it,a,0,$)}var nt}function ot(it,$,a,et){const nt=lt[et||""]||lt[""];s[it]{rt.then(async bt=>{nt&&await nt.end(),dt(bt)},async bt=>{nt&&await nt.end(),ut(bt)})});if(!at&&nt){const dt=nt.end();if(dt&&typeof dt.then=="function")return new Promise((ut,bt)=>{dt.then(()=>{ut(rt)},mt=>{bt(mt)})})}return rt}begin(it,$,a){if(!this._started)throw new Error("profiler is not started yet");if(a===void 0){const et=(0,o.now)();return this.flush(et),new st(it,$,et,nt=>this.endSync(nt))}{const et=a.beginTimer();return new st(it,$,0,async nt=>this.end(nt),et,a)}}async end(it){const $=await it.checkTimer();this._timingEvents.length=this._flushBatchSize||it-this._flushTime>=this._flushIntervalInMilliseconds){for(const $=this._flushPointer;this._flushPointer<$+this._flushBatchSize&&this._flushPointerperformance.now():Date.now},2644:(i,o,s)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Model=void 0;const j=s(5686),_e=s(1446),lt=s(7070),tt=s(9395),ot=s(2517);var st=tt.onnxruntime.experimental.fbs;o.Model=class{constructor(){}load(ct,it,$){if(!$)try{return void this.loadFromOnnxFormat(ct,it)}catch(a){if($!==void 0)throw a}this.loadFromOrtFormat(ct,it)}loadFromOnnxFormat(ct,it){const $=_e.onnx.ModelProto.decode(ct);if(ot.LongUtil.longToNumber($.irVersion)<3)throw new Error("only support ONNX model with IR_VERSION>=3");this._opsets=$.opsetImport.map(a=>({domain:a.domain,version:ot.LongUtil.longToNumber(a.version)})),this._graph=lt.Graph.from($.graph,it)}loadFromOrtFormat(ct,it){const $=new j.flatbuffers.ByteBuffer(ct),a=st.InferenceSession.getRootAsInferenceSession($).model();if(ot.LongUtil.longToNumber(a.irVersion())<3)throw new Error("only support ONNX model with IR_VERSION>=3");this._opsets=[];for(let et=0;et{Object.defineProperty(o,"__esModule",{value:!0}),o.FLOAT_TYPES=o.INT_TYPES=o.NUMBER_TYPES=void 0,o.NUMBER_TYPES=["float32","float64","int32","int16","int8","uint16","uint32","uint8"],o.INT_TYPES=["int32","int16","int8","uint16","uint32","uint8"],o.FLOAT_TYPES=["float32","float64"]},1047:(i,o)=>{function s(j,_e){if(_e.endsWith("+")){const lt=Number.parseInt(_e.substring(0,_e.length-1),10);return!isNaN(lt)&<<=j}if(_e.split("-").length===2){const lt=_e.split("-"),tt=Number.parseInt(lt[0],10),ot=Number.parseInt(lt[1],10);return!isNaN(tt)&&!isNaN(ot)&&tt<=j&&j<=ot}return Number.parseInt(_e,10)===j}Object.defineProperty(o,"__esModule",{value:!0}),o.resolveOperator=void 0,o.resolveOperator=function(j,_e,lt){for(const tt of lt){const ot=tt[0],st=tt[1],ct=tt[2],it=tt[3],$=tt[4];if(j.opType===ot){for(const a of _e)if((a.domain===st||a.domain==="ai.onnx"&&st==="")&&s(a.version,ct))return{opImpl:it,opInit:$}}}throw new TypeError(`cannot resolve operator '${j.opType}' with opsets: ${_e.map(tt=>`${tt.domain||"ai.onnx"} v${tt.version}`).join(", ")}`)}},9395:(i,o,s)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.onnxruntime=void 0;const j=s(5686);var _e,lt;_e=o.onnxruntime||(o.onnxruntime={}),function(tt){(function(ot){ot[ot.UNDEFINED=0]="UNDEFINED",ot[ot.FLOAT=1]="FLOAT",ot[ot.INT=2]="INT",ot[ot.STRING=3]="STRING",ot[ot.TENSOR=4]="TENSOR",ot[ot.GRAPH=5]="GRAPH",ot[ot.FLOATS=6]="FLOATS",ot[ot.INTS=7]="INTS",ot[ot.STRINGS=8]="STRINGS",ot[ot.TENSORS=9]="TENSORS",ot[ot.GRAPHS=10]="GRAPHS",ot[ot.SPARSE_TENSOR=11]="SPARSE_TENSOR",ot[ot.SPARSE_TENSORS=12]="SPARSE_TENSORS"})(tt.AttributeType||(tt.AttributeType={}))}((lt=_e.experimental||(_e.experimental={})).fbs||(lt.fbs={})),function(tt){(function(ot){(function(st){(function(ct){ct[ct.UNKNOWN=0]="UNKNOWN",ct[ct.VALUE=1]="VALUE",ct[ct.PARAM=2]="PARAM"})(st.DimensionValueType||(st.DimensionValueType={}))})(ot.fbs||(ot.fbs={}))})(tt.experimental||(tt.experimental={}))}(o.onnxruntime||(o.onnxruntime={})),function(tt){(function(ot){(function(st){(function(ct){ct[ct.UNDEFINED=0]="UNDEFINED",ct[ct.FLOAT=1]="FLOAT",ct[ct.UINT8=2]="UINT8",ct[ct.INT8=3]="INT8",ct[ct.UINT16=4]="UINT16",ct[ct.INT16=5]="INT16",ct[ct.INT32=6]="INT32",ct[ct.INT64=7]="INT64",ct[ct.STRING=8]="STRING",ct[ct.BOOL=9]="BOOL",ct[ct.FLOAT16=10]="FLOAT16",ct[ct.DOUBLE=11]="DOUBLE",ct[ct.UINT32=12]="UINT32",ct[ct.UINT64=13]="UINT64",ct[ct.COMPLEX64=14]="COMPLEX64",ct[ct.COMPLEX128=15]="COMPLEX128",ct[ct.BFLOAT16=16]="BFLOAT16"})(st.TensorDataType||(st.TensorDataType={}))})(ot.fbs||(ot.fbs={}))})(tt.experimental||(tt.experimental={}))}(o.onnxruntime||(o.onnxruntime={})),function(tt){(function(ot){(function(st){(function(ct){ct[ct.Primitive=0]="Primitive",ct[ct.Fused=1]="Fused"})(st.NodeType||(st.NodeType={}))})(ot.fbs||(ot.fbs={}))})(tt.experimental||(tt.experimental={}))}(o.onnxruntime||(o.onnxruntime={})),function(tt){(function(ot){(function(st){(function(ct){ct[ct.NONE=0]="NONE",ct[ct.tensor_type=1]="tensor_type",ct[ct.sequence_type=2]="sequence_type",ct[ct.map_type=3]="map_type"})(st.TypeInfoValue||(st.TypeInfoValue={}))})(ot.fbs||(ot.fbs={}))})(tt.experimental||(tt.experimental={}))}(o.onnxruntime||(o.onnxruntime={})),function(tt){(function(ot){(function(st){class ct{constructor(){this.bb=null,this.bb_pos=0}__init($,a){return this.bb_pos=$,this.bb=a,this}static getRootAsShape($,a){return(a||new ct).__init($.readInt32($.position())+$.position(),$)}static getSizePrefixedRootAsShape($,a){return $.setPosition($.position()+j.flatbuffers.SIZE_PREFIX_LENGTH),(a||new ct).__init($.readInt32($.position())+$.position(),$)}dim($,a){let et=this.bb.__offset(this.bb_pos,4);return et?(a||new tt.experimental.fbs.Dimension).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+et)+4*$),this.bb):null}dimLength(){let $=this.bb.__offset(this.bb_pos,4);return $?this.bb.__vector_len(this.bb_pos+$):0}static startShape($){$.startObject(1)}static addDim($,a){$.addFieldOffset(0,a,0)}static createDimVector($,a){$.startVector(4,a.length,4);for(let et=a.length-1;et>=0;et--)$.addOffset(a[et]);return $.endVector()}static startDimVector($,a){$.startVector(4,a,4)}static endShape($){return $.endObject()}static createShape($,a){return ct.startShape($),ct.addDim($,a),ct.endShape($)}}st.Shape=ct})(ot.fbs||(ot.fbs={}))})(tt.experimental||(tt.experimental={}))}(o.onnxruntime||(o.onnxruntime={})),function(tt){(function(ot){(function(st){class ct{constructor(){this.bb=null,this.bb_pos=0}__init($,a){return this.bb_pos=$,this.bb=a,this}static getRootAsDimension($,a){return(a||new ct).__init($.readInt32($.position())+$.position(),$)}static getSizePrefixedRootAsDimension($,a){return $.setPosition($.position()+j.flatbuffers.SIZE_PREFIX_LENGTH),(a||new ct).__init($.readInt32($.position())+$.position(),$)}value($){let a=this.bb.__offset(this.bb_pos,4);return a?($||new tt.experimental.fbs.DimensionValue).__init(this.bb.__indirect(this.bb_pos+a),this.bb):null}denotation($){let a=this.bb.__offset(this.bb_pos,6);return a?this.bb.__string(this.bb_pos+a,$):null}static startDimension($){$.startObject(2)}static addValue($,a){$.addFieldOffset(0,a,0)}static addDenotation($,a){$.addFieldOffset(1,a,0)}static endDimension($){return $.endObject()}static createDimension($,a,et){return ct.startDimension($),ct.addValue($,a),ct.addDenotation($,et),ct.endDimension($)}}st.Dimension=ct})(ot.fbs||(ot.fbs={}))})(tt.experimental||(tt.experimental={}))}(o.onnxruntime||(o.onnxruntime={})),function(tt){(function(ot){(function(st){class ct{constructor(){this.bb=null,this.bb_pos=0}__init($,a){return this.bb_pos=$,this.bb=a,this}static getRootAsDimensionValue($,a){return(a||new ct).__init($.readInt32($.position())+$.position(),$)}static getSizePrefixedRootAsDimensionValue($,a){return $.setPosition($.position()+j.flatbuffers.SIZE_PREFIX_LENGTH),(a||new ct).__init($.readInt32($.position())+$.position(),$)}dimType(){let $=this.bb.__offset(this.bb_pos,4);return $?this.bb.readInt8(this.bb_pos+$):tt.experimental.fbs.DimensionValueType.UNKNOWN}dimValue(){let $=this.bb.__offset(this.bb_pos,6);return $?this.bb.readInt64(this.bb_pos+$):this.bb.createLong(0,0)}dimParam($){let a=this.bb.__offset(this.bb_pos,8);return a?this.bb.__string(this.bb_pos+a,$):null}static startDimensionValue($){$.startObject(3)}static addDimType($,a){$.addFieldInt8(0,a,tt.experimental.fbs.DimensionValueType.UNKNOWN)}static addDimValue($,a){$.addFieldInt64(1,a,$.createLong(0,0))}static addDimParam($,a){$.addFieldOffset(2,a,0)}static endDimensionValue($){return $.endObject()}static createDimensionValue($,a,et,nt){return ct.startDimensionValue($),ct.addDimType($,a),ct.addDimValue($,et),ct.addDimParam($,nt),ct.endDimensionValue($)}}st.DimensionValue=ct})(ot.fbs||(ot.fbs={}))})(tt.experimental||(tt.experimental={}))}(o.onnxruntime||(o.onnxruntime={})),function(tt){(function(ot){(function(st){class ct{constructor(){this.bb=null,this.bb_pos=0}__init($,a){return this.bb_pos=$,this.bb=a,this}static getRootAsTensorTypeAndShape($,a){return(a||new ct).__init($.readInt32($.position())+$.position(),$)}static getSizePrefixedRootAsTensorTypeAndShape($,a){return $.setPosition($.position()+j.flatbuffers.SIZE_PREFIX_LENGTH),(a||new ct).__init($.readInt32($.position())+$.position(),$)}elemType(){let $=this.bb.__offset(this.bb_pos,4);return $?this.bb.readInt32(this.bb_pos+$):tt.experimental.fbs.TensorDataType.UNDEFINED}shape($){let a=this.bb.__offset(this.bb_pos,6);return a?($||new tt.experimental.fbs.Shape).__init(this.bb.__indirect(this.bb_pos+a),this.bb):null}static startTensorTypeAndShape($){$.startObject(2)}static addElemType($,a){$.addFieldInt32(0,a,tt.experimental.fbs.TensorDataType.UNDEFINED)}static addShape($,a){$.addFieldOffset(1,a,0)}static endTensorTypeAndShape($){return $.endObject()}static createTensorTypeAndShape($,a,et){return ct.startTensorTypeAndShape($),ct.addElemType($,a),ct.addShape($,et),ct.endTensorTypeAndShape($)}}st.TensorTypeAndShape=ct})(ot.fbs||(ot.fbs={}))})(tt.experimental||(tt.experimental={}))}(o.onnxruntime||(o.onnxruntime={})),function(tt){(function(ot){(function(st){class ct{constructor(){this.bb=null,this.bb_pos=0}__init($,a){return this.bb_pos=$,this.bb=a,this}static getRootAsMapType($,a){return(a||new ct).__init($.readInt32($.position())+$.position(),$)}static getSizePrefixedRootAsMapType($,a){return $.setPosition($.position()+j.flatbuffers.SIZE_PREFIX_LENGTH),(a||new ct).__init($.readInt32($.position())+$.position(),$)}keyType(){let $=this.bb.__offset(this.bb_pos,4);return $?this.bb.readInt32(this.bb_pos+$):tt.experimental.fbs.TensorDataType.UNDEFINED}valueType($){let a=this.bb.__offset(this.bb_pos,6);return a?($||new tt.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+a),this.bb):null}static startMapType($){$.startObject(2)}static addKeyType($,a){$.addFieldInt32(0,a,tt.experimental.fbs.TensorDataType.UNDEFINED)}static addValueType($,a){$.addFieldOffset(1,a,0)}static endMapType($){return $.endObject()}static createMapType($,a,et){return ct.startMapType($),ct.addKeyType($,a),ct.addValueType($,et),ct.endMapType($)}}st.MapType=ct})(ot.fbs||(ot.fbs={}))})(tt.experimental||(tt.experimental={}))}(o.onnxruntime||(o.onnxruntime={})),function(tt){(function(ot){(function(st){class ct{constructor(){this.bb=null,this.bb_pos=0}__init($,a){return this.bb_pos=$,this.bb=a,this}static getRootAsSequenceType($,a){return(a||new ct).__init($.readInt32($.position())+$.position(),$)}static getSizePrefixedRootAsSequenceType($,a){return $.setPosition($.position()+j.flatbuffers.SIZE_PREFIX_LENGTH),(a||new ct).__init($.readInt32($.position())+$.position(),$)}elemType($){let a=this.bb.__offset(this.bb_pos,4);return a?($||new tt.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+a),this.bb):null}static startSequenceType($){$.startObject(1)}static addElemType($,a){$.addFieldOffset(0,a,0)}static endSequenceType($){return $.endObject()}static createSequenceType($,a){return ct.startSequenceType($),ct.addElemType($,a),ct.endSequenceType($)}}st.SequenceType=ct})(ot.fbs||(ot.fbs={}))})(tt.experimental||(tt.experimental={}))}(o.onnxruntime||(o.onnxruntime={})),function(tt){(function(ot){(ot.fbs||(ot.fbs={})).EdgeEnd=class{constructor(){this.bb=null,this.bb_pos=0}__init(st,ct){return this.bb_pos=st,this.bb=ct,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(st,ct,it,$){return st.prep(4,12),st.writeInt32($),st.writeInt32(it),st.writeInt32(ct),st.offset()}}})(tt.experimental||(tt.experimental={}))}(o.onnxruntime||(o.onnxruntime={})),function(tt){(function(ot){(function(st){class ct{constructor(){this.bb=null,this.bb_pos=0}__init($,a){return this.bb_pos=$,this.bb=a,this}static getRootAsNodeEdge($,a){return(a||new ct).__init($.readInt32($.position())+$.position(),$)}static getSizePrefixedRootAsNodeEdge($,a){return $.setPosition($.position()+j.flatbuffers.SIZE_PREFIX_LENGTH),(a||new ct).__init($.readInt32($.position())+$.position(),$)}nodeIndex(){let $=this.bb.__offset(this.bb_pos,4);return $?this.bb.readUint32(this.bb_pos+$):0}inputEdges($,a){let et=this.bb.__offset(this.bb_pos,6);return et?(a||new tt.experimental.fbs.EdgeEnd).__init(this.bb.__vector(this.bb_pos+et)+12*$,this.bb):null}inputEdgesLength(){let $=this.bb.__offset(this.bb_pos,6);return $?this.bb.__vector_len(this.bb_pos+$):0}outputEdges($,a){let et=this.bb.__offset(this.bb_pos,8);return et?(a||new tt.experimental.fbs.EdgeEnd).__init(this.bb.__vector(this.bb_pos+et)+12*$,this.bb):null}outputEdgesLength(){let $=this.bb.__offset(this.bb_pos,8);return $?this.bb.__vector_len(this.bb_pos+$):0}static startNodeEdge($){$.startObject(3)}static addNodeIndex($,a){$.addFieldInt32(0,a,0)}static addInputEdges($,a){$.addFieldOffset(1,a,0)}static startInputEdgesVector($,a){$.startVector(12,a,4)}static addOutputEdges($,a){$.addFieldOffset(2,a,0)}static startOutputEdgesVector($,a){$.startVector(12,a,4)}static endNodeEdge($){return $.endObject()}static createNodeEdge($,a,et,nt){return ct.startNodeEdge($),ct.addNodeIndex($,a),ct.addInputEdges($,et),ct.addOutputEdges($,nt),ct.endNodeEdge($)}}st.NodeEdge=ct})(ot.fbs||(ot.fbs={}))})(tt.experimental||(tt.experimental={}))}(o.onnxruntime||(o.onnxruntime={})),function(tt){(function(ot){(function(st){class ct{constructor(){this.bb=null,this.bb_pos=0}__init($,a){return this.bb_pos=$,this.bb=a,this}static getRootAsNode($,a){return(a||new ct).__init($.readInt32($.position())+$.position(),$)}static getSizePrefixedRootAsNode($,a){return $.setPosition($.position()+j.flatbuffers.SIZE_PREFIX_LENGTH),(a||new ct).__init($.readInt32($.position())+$.position(),$)}name($){let a=this.bb.__offset(this.bb_pos,4);return a?this.bb.__string(this.bb_pos+a,$):null}docString($){let a=this.bb.__offset(this.bb_pos,6);return a?this.bb.__string(this.bb_pos+a,$):null}domain($){let a=this.bb.__offset(this.bb_pos,8);return a?this.bb.__string(this.bb_pos+a,$):null}sinceVersion(){let $=this.bb.__offset(this.bb_pos,10);return $?this.bb.readInt32(this.bb_pos+$):0}index(){let $=this.bb.__offset(this.bb_pos,12);return $?this.bb.readUint32(this.bb_pos+$):0}opType($){let a=this.bb.__offset(this.bb_pos,14);return a?this.bb.__string(this.bb_pos+a,$):null}type(){let $=this.bb.__offset(this.bb_pos,16);return $?this.bb.readInt32(this.bb_pos+$):tt.experimental.fbs.NodeType.Primitive}executionProviderType($){let a=this.bb.__offset(this.bb_pos,18);return a?this.bb.__string(this.bb_pos+a,$):null}inputs($,a){let et=this.bb.__offset(this.bb_pos,20);return et?this.bb.__string(this.bb.__vector(this.bb_pos+et)+4*$,a):null}inputsLength(){let $=this.bb.__offset(this.bb_pos,20);return $?this.bb.__vector_len(this.bb_pos+$):0}outputs($,a){let et=this.bb.__offset(this.bb_pos,22);return et?this.bb.__string(this.bb.__vector(this.bb_pos+et)+4*$,a):null}outputsLength(){let $=this.bb.__offset(this.bb_pos,22);return $?this.bb.__vector_len(this.bb_pos+$):0}attributes($,a){let et=this.bb.__offset(this.bb_pos,24);return et?(a||new tt.experimental.fbs.Attribute).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+et)+4*$),this.bb):null}attributesLength(){let $=this.bb.__offset(this.bb_pos,24);return $?this.bb.__vector_len(this.bb_pos+$):0}inputArgCounts($){let a=this.bb.__offset(this.bb_pos,26);return a?this.bb.readInt32(this.bb.__vector(this.bb_pos+a)+4*$):0}inputArgCountsLength(){let $=this.bb.__offset(this.bb_pos,26);return $?this.bb.__vector_len(this.bb_pos+$):0}inputArgCountsArray(){let $=this.bb.__offset(this.bb_pos,26);return $?new Int32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+$),this.bb.__vector_len(this.bb_pos+$)):null}implicitInputs($,a){let et=this.bb.__offset(this.bb_pos,28);return et?this.bb.__string(this.bb.__vector(this.bb_pos+et)+4*$,a):null}implicitInputsLength(){let $=this.bb.__offset(this.bb_pos,28);return $?this.bb.__vector_len(this.bb_pos+$):0}static startNode($){$.startObject(13)}static addName($,a){$.addFieldOffset(0,a,0)}static addDocString($,a){$.addFieldOffset(1,a,0)}static addDomain($,a){$.addFieldOffset(2,a,0)}static addSinceVersion($,a){$.addFieldInt32(3,a,0)}static addIndex($,a){$.addFieldInt32(4,a,0)}static addOpType($,a){$.addFieldOffset(5,a,0)}static addType($,a){$.addFieldInt32(6,a,tt.experimental.fbs.NodeType.Primitive)}static addExecutionProviderType($,a){$.addFieldOffset(7,a,0)}static addInputs($,a){$.addFieldOffset(8,a,0)}static createInputsVector($,a){$.startVector(4,a.length,4);for(let et=a.length-1;et>=0;et--)$.addOffset(a[et]);return $.endVector()}static startInputsVector($,a){$.startVector(4,a,4)}static addOutputs($,a){$.addFieldOffset(9,a,0)}static createOutputsVector($,a){$.startVector(4,a.length,4);for(let et=a.length-1;et>=0;et--)$.addOffset(a[et]);return $.endVector()}static startOutputsVector($,a){$.startVector(4,a,4)}static addAttributes($,a){$.addFieldOffset(10,a,0)}static createAttributesVector($,a){$.startVector(4,a.length,4);for(let et=a.length-1;et>=0;et--)$.addOffset(a[et]);return $.endVector()}static startAttributesVector($,a){$.startVector(4,a,4)}static addInputArgCounts($,a){$.addFieldOffset(11,a,0)}static createInputArgCountsVector($,a){$.startVector(4,a.length,4);for(let et=a.length-1;et>=0;et--)$.addInt32(a[et]);return $.endVector()}static startInputArgCountsVector($,a){$.startVector(4,a,4)}static addImplicitInputs($,a){$.addFieldOffset(12,a,0)}static createImplicitInputsVector($,a){$.startVector(4,a.length,4);for(let et=a.length-1;et>=0;et--)$.addOffset(a[et]);return $.endVector()}static startImplicitInputsVector($,a){$.startVector(4,a,4)}static endNode($){return $.endObject()}static createNode($,a,et,nt,at,rt,dt,ut,bt,mt,pt,Zt,ht,Gt){return ct.startNode($),ct.addName($,a),ct.addDocString($,et),ct.addDomain($,nt),ct.addSinceVersion($,at),ct.addIndex($,rt),ct.addOpType($,dt),ct.addType($,ut),ct.addExecutionProviderType($,bt),ct.addInputs($,mt),ct.addOutputs($,pt),ct.addAttributes($,Zt),ct.addInputArgCounts($,ht),ct.addImplicitInputs($,Gt),ct.endNode($)}}st.Node=ct})(ot.fbs||(ot.fbs={}))})(tt.experimental||(tt.experimental={}))}(o.onnxruntime||(o.onnxruntime={})),function(tt){(function(ot){(function(st){class ct{constructor(){this.bb=null,this.bb_pos=0}__init($,a){return this.bb_pos=$,this.bb=a,this}static getRootAsValueInfo($,a){return(a||new ct).__init($.readInt32($.position())+$.position(),$)}static getSizePrefixedRootAsValueInfo($,a){return $.setPosition($.position()+j.flatbuffers.SIZE_PREFIX_LENGTH),(a||new ct).__init($.readInt32($.position())+$.position(),$)}name($){let a=this.bb.__offset(this.bb_pos,4);return a?this.bb.__string(this.bb_pos+a,$):null}docString($){let a=this.bb.__offset(this.bb_pos,6);return a?this.bb.__string(this.bb_pos+a,$):null}type($){let a=this.bb.__offset(this.bb_pos,8);return a?($||new tt.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+a),this.bb):null}static startValueInfo($){$.startObject(3)}static addName($,a){$.addFieldOffset(0,a,0)}static addDocString($,a){$.addFieldOffset(1,a,0)}static addType($,a){$.addFieldOffset(2,a,0)}static endValueInfo($){return $.endObject()}static createValueInfo($,a,et,nt){return ct.startValueInfo($),ct.addName($,a),ct.addDocString($,et),ct.addType($,nt),ct.endValueInfo($)}}st.ValueInfo=ct})(ot.fbs||(ot.fbs={}))})(tt.experimental||(tt.experimental={}))}(o.onnxruntime||(o.onnxruntime={})),function(tt){(function(ot){(function(st){class ct{constructor(){this.bb=null,this.bb_pos=0}__init($,a){return this.bb_pos=$,this.bb=a,this}static getRootAsTypeInfo($,a){return(a||new ct).__init($.readInt32($.position())+$.position(),$)}static getSizePrefixedRootAsTypeInfo($,a){return $.setPosition($.position()+j.flatbuffers.SIZE_PREFIX_LENGTH),(a||new ct).__init($.readInt32($.position())+$.position(),$)}denotation($){let a=this.bb.__offset(this.bb_pos,4);return a?this.bb.__string(this.bb_pos+a,$):null}valueType(){let $=this.bb.__offset(this.bb_pos,6);return $?this.bb.readUint8(this.bb_pos+$):tt.experimental.fbs.TypeInfoValue.NONE}value($){let a=this.bb.__offset(this.bb_pos,8);return a?this.bb.__union($,this.bb_pos+a):null}static startTypeInfo($){$.startObject(3)}static addDenotation($,a){$.addFieldOffset(0,a,0)}static addValueType($,a){$.addFieldInt8(1,a,tt.experimental.fbs.TypeInfoValue.NONE)}static addValue($,a){$.addFieldOffset(2,a,0)}static endTypeInfo($){return $.endObject()}static createTypeInfo($,a,et,nt){return ct.startTypeInfo($),ct.addDenotation($,a),ct.addValueType($,et),ct.addValue($,nt),ct.endTypeInfo($)}}st.TypeInfo=ct})(ot.fbs||(ot.fbs={}))})(tt.experimental||(tt.experimental={}))}(o.onnxruntime||(o.onnxruntime={})),function(tt){(function(ot){(function(st){class ct{constructor(){this.bb=null,this.bb_pos=0}__init($,a){return this.bb_pos=$,this.bb=a,this}static getRootAsOperatorSetId($,a){return(a||new ct).__init($.readInt32($.position())+$.position(),$)}static getSizePrefixedRootAsOperatorSetId($,a){return $.setPosition($.position()+j.flatbuffers.SIZE_PREFIX_LENGTH),(a||new ct).__init($.readInt32($.position())+$.position(),$)}domain($){let a=this.bb.__offset(this.bb_pos,4);return a?this.bb.__string(this.bb_pos+a,$):null}version(){let $=this.bb.__offset(this.bb_pos,6);return $?this.bb.readInt64(this.bb_pos+$):this.bb.createLong(0,0)}static startOperatorSetId($){$.startObject(2)}static addDomain($,a){$.addFieldOffset(0,a,0)}static addVersion($,a){$.addFieldInt64(1,a,$.createLong(0,0))}static endOperatorSetId($){return $.endObject()}static createOperatorSetId($,a,et){return ct.startOperatorSetId($),ct.addDomain($,a),ct.addVersion($,et),ct.endOperatorSetId($)}}st.OperatorSetId=ct})(ot.fbs||(ot.fbs={}))})(tt.experimental||(tt.experimental={}))}(o.onnxruntime||(o.onnxruntime={})),function(tt){(function(ot){(function(st){class ct{constructor(){this.bb=null,this.bb_pos=0}__init($,a){return this.bb_pos=$,this.bb=a,this}static getRootAsTensor($,a){return(a||new ct).__init($.readInt32($.position())+$.position(),$)}static getSizePrefixedRootAsTensor($,a){return $.setPosition($.position()+j.flatbuffers.SIZE_PREFIX_LENGTH),(a||new ct).__init($.readInt32($.position())+$.position(),$)}name($){let a=this.bb.__offset(this.bb_pos,4);return a?this.bb.__string(this.bb_pos+a,$):null}docString($){let a=this.bb.__offset(this.bb_pos,6);return a?this.bb.__string(this.bb_pos+a,$):null}dims($){let a=this.bb.__offset(this.bb_pos,8);return a?this.bb.readInt64(this.bb.__vector(this.bb_pos+a)+8*$):this.bb.createLong(0,0)}dimsLength(){let $=this.bb.__offset(this.bb_pos,8);return $?this.bb.__vector_len(this.bb_pos+$):0}dataType(){let $=this.bb.__offset(this.bb_pos,10);return $?this.bb.readInt32(this.bb_pos+$):tt.experimental.fbs.TensorDataType.UNDEFINED}rawData($){let a=this.bb.__offset(this.bb_pos,12);return a?this.bb.readUint8(this.bb.__vector(this.bb_pos+a)+$):0}rawDataLength(){let $=this.bb.__offset(this.bb_pos,12);return $?this.bb.__vector_len(this.bb_pos+$):0}rawDataArray(){let $=this.bb.__offset(this.bb_pos,12);return $?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+$),this.bb.__vector_len(this.bb_pos+$)):null}stringData($,a){let et=this.bb.__offset(this.bb_pos,14);return et?this.bb.__string(this.bb.__vector(this.bb_pos+et)+4*$,a):null}stringDataLength(){let $=this.bb.__offset(this.bb_pos,14);return $?this.bb.__vector_len(this.bb_pos+$):0}static startTensor($){$.startObject(6)}static addName($,a){$.addFieldOffset(0,a,0)}static addDocString($,a){$.addFieldOffset(1,a,0)}static addDims($,a){$.addFieldOffset(2,a,0)}static createDimsVector($,a){$.startVector(8,a.length,8);for(let et=a.length-1;et>=0;et--)$.addInt64(a[et]);return $.endVector()}static startDimsVector($,a){$.startVector(8,a,8)}static addDataType($,a){$.addFieldInt32(3,a,tt.experimental.fbs.TensorDataType.UNDEFINED)}static addRawData($,a){$.addFieldOffset(4,a,0)}static createRawDataVector($,a){$.startVector(1,a.length,1);for(let et=a.length-1;et>=0;et--)$.addInt8(a[et]);return $.endVector()}static startRawDataVector($,a){$.startVector(1,a,1)}static addStringData($,a){$.addFieldOffset(5,a,0)}static createStringDataVector($,a){$.startVector(4,a.length,4);for(let et=a.length-1;et>=0;et--)$.addOffset(a[et]);return $.endVector()}static startStringDataVector($,a){$.startVector(4,a,4)}static endTensor($){return $.endObject()}static createTensor($,a,et,nt,at,rt,dt){return ct.startTensor($),ct.addName($,a),ct.addDocString($,et),ct.addDims($,nt),ct.addDataType($,at),ct.addRawData($,rt),ct.addStringData($,dt),ct.endTensor($)}}st.Tensor=ct})(ot.fbs||(ot.fbs={}))})(tt.experimental||(tt.experimental={}))}(o.onnxruntime||(o.onnxruntime={})),function(tt){(function(ot){(function(st){class ct{constructor(){this.bb=null,this.bb_pos=0}__init($,a){return this.bb_pos=$,this.bb=a,this}static getRootAsSparseTensor($,a){return(a||new ct).__init($.readInt32($.position())+$.position(),$)}static getSizePrefixedRootAsSparseTensor($,a){return $.setPosition($.position()+j.flatbuffers.SIZE_PREFIX_LENGTH),(a||new ct).__init($.readInt32($.position())+$.position(),$)}values($){let a=this.bb.__offset(this.bb_pos,4);return a?($||new tt.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+a),this.bb):null}indices($){let a=this.bb.__offset(this.bb_pos,6);return a?($||new tt.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+a),this.bb):null}dims($){let a=this.bb.__offset(this.bb_pos,8);return a?this.bb.readInt64(this.bb.__vector(this.bb_pos+a)+8*$):this.bb.createLong(0,0)}dimsLength(){let $=this.bb.__offset(this.bb_pos,8);return $?this.bb.__vector_len(this.bb_pos+$):0}static startSparseTensor($){$.startObject(3)}static addValues($,a){$.addFieldOffset(0,a,0)}static addIndices($,a){$.addFieldOffset(1,a,0)}static addDims($,a){$.addFieldOffset(2,a,0)}static createDimsVector($,a){$.startVector(8,a.length,8);for(let et=a.length-1;et>=0;et--)$.addInt64(a[et]);return $.endVector()}static startDimsVector($,a){$.startVector(8,a,8)}static endSparseTensor($){return $.endObject()}static createSparseTensor($,a,et,nt){return ct.startSparseTensor($),ct.addValues($,a),ct.addIndices($,et),ct.addDims($,nt),ct.endSparseTensor($)}}st.SparseTensor=ct})(ot.fbs||(ot.fbs={}))})(tt.experimental||(tt.experimental={}))}(o.onnxruntime||(o.onnxruntime={})),function(tt){(function(ot){(function(st){class ct{constructor(){this.bb=null,this.bb_pos=0}__init($,a){return this.bb_pos=$,this.bb=a,this}static getRootAsAttribute($,a){return(a||new ct).__init($.readInt32($.position())+$.position(),$)}static getSizePrefixedRootAsAttribute($,a){return $.setPosition($.position()+j.flatbuffers.SIZE_PREFIX_LENGTH),(a||new ct).__init($.readInt32($.position())+$.position(),$)}name($){let a=this.bb.__offset(this.bb_pos,4);return a?this.bb.__string(this.bb_pos+a,$):null}docString($){let a=this.bb.__offset(this.bb_pos,6);return a?this.bb.__string(this.bb_pos+a,$):null}type(){let $=this.bb.__offset(this.bb_pos,8);return $?this.bb.readInt32(this.bb_pos+$):tt.experimental.fbs.AttributeType.UNDEFINED}f(){let $=this.bb.__offset(this.bb_pos,10);return $?this.bb.readFloat32(this.bb_pos+$):0}i(){let $=this.bb.__offset(this.bb_pos,12);return $?this.bb.readInt64(this.bb_pos+$):this.bb.createLong(0,0)}s($){let a=this.bb.__offset(this.bb_pos,14);return a?this.bb.__string(this.bb_pos+a,$):null}t($){let a=this.bb.__offset(this.bb_pos,16);return a?($||new tt.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+a),this.bb):null}g($){let a=this.bb.__offset(this.bb_pos,18);return a?($||new tt.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb_pos+a),this.bb):null}floats($){let a=this.bb.__offset(this.bb_pos,20);return a?this.bb.readFloat32(this.bb.__vector(this.bb_pos+a)+4*$):0}floatsLength(){let $=this.bb.__offset(this.bb_pos,20);return $?this.bb.__vector_len(this.bb_pos+$):0}floatsArray(){let $=this.bb.__offset(this.bb_pos,20);return $?new Float32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+$),this.bb.__vector_len(this.bb_pos+$)):null}ints($){let a=this.bb.__offset(this.bb_pos,22);return a?this.bb.readInt64(this.bb.__vector(this.bb_pos+a)+8*$):this.bb.createLong(0,0)}intsLength(){let $=this.bb.__offset(this.bb_pos,22);return $?this.bb.__vector_len(this.bb_pos+$):0}strings($,a){let et=this.bb.__offset(this.bb_pos,24);return et?this.bb.__string(this.bb.__vector(this.bb_pos+et)+4*$,a):null}stringsLength(){let $=this.bb.__offset(this.bb_pos,24);return $?this.bb.__vector_len(this.bb_pos+$):0}tensors($,a){let et=this.bb.__offset(this.bb_pos,26);return et?(a||new tt.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+et)+4*$),this.bb):null}tensorsLength(){let $=this.bb.__offset(this.bb_pos,26);return $?this.bb.__vector_len(this.bb_pos+$):0}graphs($,a){let et=this.bb.__offset(this.bb_pos,28);return et?(a||new tt.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+et)+4*$),this.bb):null}graphsLength(){let $=this.bb.__offset(this.bb_pos,28);return $?this.bb.__vector_len(this.bb_pos+$):0}static startAttribute($){$.startObject(13)}static addName($,a){$.addFieldOffset(0,a,0)}static addDocString($,a){$.addFieldOffset(1,a,0)}static addType($,a){$.addFieldInt32(2,a,tt.experimental.fbs.AttributeType.UNDEFINED)}static addF($,a){$.addFieldFloat32(3,a,0)}static addI($,a){$.addFieldInt64(4,a,$.createLong(0,0))}static addS($,a){$.addFieldOffset(5,a,0)}static addT($,a){$.addFieldOffset(6,a,0)}static addG($,a){$.addFieldOffset(7,a,0)}static addFloats($,a){$.addFieldOffset(8,a,0)}static createFloatsVector($,a){$.startVector(4,a.length,4);for(let et=a.length-1;et>=0;et--)$.addFloat32(a[et]);return $.endVector()}static startFloatsVector($,a){$.startVector(4,a,4)}static addInts($,a){$.addFieldOffset(9,a,0)}static createIntsVector($,a){$.startVector(8,a.length,8);for(let et=a.length-1;et>=0;et--)$.addInt64(a[et]);return $.endVector()}static startIntsVector($,a){$.startVector(8,a,8)}static addStrings($,a){$.addFieldOffset(10,a,0)}static createStringsVector($,a){$.startVector(4,a.length,4);for(let et=a.length-1;et>=0;et--)$.addOffset(a[et]);return $.endVector()}static startStringsVector($,a){$.startVector(4,a,4)}static addTensors($,a){$.addFieldOffset(11,a,0)}static createTensorsVector($,a){$.startVector(4,a.length,4);for(let et=a.length-1;et>=0;et--)$.addOffset(a[et]);return $.endVector()}static startTensorsVector($,a){$.startVector(4,a,4)}static addGraphs($,a){$.addFieldOffset(12,a,0)}static createGraphsVector($,a){$.startVector(4,a.length,4);for(let et=a.length-1;et>=0;et--)$.addOffset(a[et]);return $.endVector()}static startGraphsVector($,a){$.startVector(4,a,4)}static endAttribute($){return $.endObject()}static createAttribute($,a,et,nt,at,rt,dt,ut,bt,mt,pt,Zt,ht,Gt){return ct.startAttribute($),ct.addName($,a),ct.addDocString($,et),ct.addType($,nt),ct.addF($,at),ct.addI($,rt),ct.addS($,dt),ct.addT($,ut),ct.addG($,bt),ct.addFloats($,mt),ct.addInts($,pt),ct.addStrings($,Zt),ct.addTensors($,ht),ct.addGraphs($,Gt),ct.endAttribute($)}}st.Attribute=ct})(ot.fbs||(ot.fbs={}))})(tt.experimental||(tt.experimental={}))}(o.onnxruntime||(o.onnxruntime={})),function(tt){(function(ot){(function(st){class ct{constructor(){this.bb=null,this.bb_pos=0}__init($,a){return this.bb_pos=$,this.bb=a,this}static getRootAsGraph($,a){return(a||new ct).__init($.readInt32($.position())+$.position(),$)}static getSizePrefixedRootAsGraph($,a){return $.setPosition($.position()+j.flatbuffers.SIZE_PREFIX_LENGTH),(a||new ct).__init($.readInt32($.position())+$.position(),$)}initializers($,a){let et=this.bb.__offset(this.bb_pos,4);return et?(a||new tt.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+et)+4*$),this.bb):null}initializersLength(){let $=this.bb.__offset(this.bb_pos,4);return $?this.bb.__vector_len(this.bb_pos+$):0}nodeArgs($,a){let et=this.bb.__offset(this.bb_pos,6);return et?(a||new tt.experimental.fbs.ValueInfo).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+et)+4*$),this.bb):null}nodeArgsLength(){let $=this.bb.__offset(this.bb_pos,6);return $?this.bb.__vector_len(this.bb_pos+$):0}nodes($,a){let et=this.bb.__offset(this.bb_pos,8);return et?(a||new tt.experimental.fbs.Node).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+et)+4*$),this.bb):null}nodesLength(){let $=this.bb.__offset(this.bb_pos,8);return $?this.bb.__vector_len(this.bb_pos+$):0}maxNodeIndex(){let $=this.bb.__offset(this.bb_pos,10);return $?this.bb.readUint32(this.bb_pos+$):0}nodeEdges($,a){let et=this.bb.__offset(this.bb_pos,12);return et?(a||new tt.experimental.fbs.NodeEdge).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+et)+4*$),this.bb):null}nodeEdgesLength(){let $=this.bb.__offset(this.bb_pos,12);return $?this.bb.__vector_len(this.bb_pos+$):0}inputs($,a){let et=this.bb.__offset(this.bb_pos,14);return et?this.bb.__string(this.bb.__vector(this.bb_pos+et)+4*$,a):null}inputsLength(){let $=this.bb.__offset(this.bb_pos,14);return $?this.bb.__vector_len(this.bb_pos+$):0}outputs($,a){let et=this.bb.__offset(this.bb_pos,16);return et?this.bb.__string(this.bb.__vector(this.bb_pos+et)+4*$,a):null}outputsLength(){let $=this.bb.__offset(this.bb_pos,16);return $?this.bb.__vector_len(this.bb_pos+$):0}sparseInitializers($,a){let et=this.bb.__offset(this.bb_pos,18);return et?(a||new tt.experimental.fbs.SparseTensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+et)+4*$),this.bb):null}sparseInitializersLength(){let $=this.bb.__offset(this.bb_pos,18);return $?this.bb.__vector_len(this.bb_pos+$):0}static startGraph($){$.startObject(8)}static addInitializers($,a){$.addFieldOffset(0,a,0)}static createInitializersVector($,a){$.startVector(4,a.length,4);for(let et=a.length-1;et>=0;et--)$.addOffset(a[et]);return $.endVector()}static startInitializersVector($,a){$.startVector(4,a,4)}static addNodeArgs($,a){$.addFieldOffset(1,a,0)}static createNodeArgsVector($,a){$.startVector(4,a.length,4);for(let et=a.length-1;et>=0;et--)$.addOffset(a[et]);return $.endVector()}static startNodeArgsVector($,a){$.startVector(4,a,4)}static addNodes($,a){$.addFieldOffset(2,a,0)}static createNodesVector($,a){$.startVector(4,a.length,4);for(let et=a.length-1;et>=0;et--)$.addOffset(a[et]);return $.endVector()}static startNodesVector($,a){$.startVector(4,a,4)}static addMaxNodeIndex($,a){$.addFieldInt32(3,a,0)}static addNodeEdges($,a){$.addFieldOffset(4,a,0)}static createNodeEdgesVector($,a){$.startVector(4,a.length,4);for(let et=a.length-1;et>=0;et--)$.addOffset(a[et]);return $.endVector()}static startNodeEdgesVector($,a){$.startVector(4,a,4)}static addInputs($,a){$.addFieldOffset(5,a,0)}static createInputsVector($,a){$.startVector(4,a.length,4);for(let et=a.length-1;et>=0;et--)$.addOffset(a[et]);return $.endVector()}static startInputsVector($,a){$.startVector(4,a,4)}static addOutputs($,a){$.addFieldOffset(6,a,0)}static createOutputsVector($,a){$.startVector(4,a.length,4);for(let et=a.length-1;et>=0;et--)$.addOffset(a[et]);return $.endVector()}static startOutputsVector($,a){$.startVector(4,a,4)}static addSparseInitializers($,a){$.addFieldOffset(7,a,0)}static createSparseInitializersVector($,a){$.startVector(4,a.length,4);for(let et=a.length-1;et>=0;et--)$.addOffset(a[et]);return $.endVector()}static startSparseInitializersVector($,a){$.startVector(4,a,4)}static endGraph($){return $.endObject()}static createGraph($,a,et,nt,at,rt,dt,ut,bt){return ct.startGraph($),ct.addInitializers($,a),ct.addNodeArgs($,et),ct.addNodes($,nt),ct.addMaxNodeIndex($,at),ct.addNodeEdges($,rt),ct.addInputs($,dt),ct.addOutputs($,ut),ct.addSparseInitializers($,bt),ct.endGraph($)}}st.Graph=ct})(ot.fbs||(ot.fbs={}))})(tt.experimental||(tt.experimental={}))}(o.onnxruntime||(o.onnxruntime={})),function(tt){(function(ot){(function(st){class ct{constructor(){this.bb=null,this.bb_pos=0}__init($,a){return this.bb_pos=$,this.bb=a,this}static getRootAsModel($,a){return(a||new ct).__init($.readInt32($.position())+$.position(),$)}static getSizePrefixedRootAsModel($,a){return $.setPosition($.position()+j.flatbuffers.SIZE_PREFIX_LENGTH),(a||new ct).__init($.readInt32($.position())+$.position(),$)}irVersion(){let $=this.bb.__offset(this.bb_pos,4);return $?this.bb.readInt64(this.bb_pos+$):this.bb.createLong(0,0)}opsetImport($,a){let et=this.bb.__offset(this.bb_pos,6);return et?(a||new tt.experimental.fbs.OperatorSetId).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+et)+4*$),this.bb):null}opsetImportLength(){let $=this.bb.__offset(this.bb_pos,6);return $?this.bb.__vector_len(this.bb_pos+$):0}producerName($){let a=this.bb.__offset(this.bb_pos,8);return a?this.bb.__string(this.bb_pos+a,$):null}producerVersion($){let a=this.bb.__offset(this.bb_pos,10);return a?this.bb.__string(this.bb_pos+a,$):null}domain($){let a=this.bb.__offset(this.bb_pos,12);return a?this.bb.__string(this.bb_pos+a,$):null}modelVersion(){let $=this.bb.__offset(this.bb_pos,14);return $?this.bb.readInt64(this.bb_pos+$):this.bb.createLong(0,0)}docString($){let a=this.bb.__offset(this.bb_pos,16);return a?this.bb.__string(this.bb_pos+a,$):null}graph($){let a=this.bb.__offset(this.bb_pos,18);return a?($||new tt.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb_pos+a),this.bb):null}graphDocString($){let a=this.bb.__offset(this.bb_pos,20);return a?this.bb.__string(this.bb_pos+a,$):null}static startModel($){$.startObject(9)}static addIrVersion($,a){$.addFieldInt64(0,a,$.createLong(0,0))}static addOpsetImport($,a){$.addFieldOffset(1,a,0)}static createOpsetImportVector($,a){$.startVector(4,a.length,4);for(let et=a.length-1;et>=0;et--)$.addOffset(a[et]);return $.endVector()}static startOpsetImportVector($,a){$.startVector(4,a,4)}static addProducerName($,a){$.addFieldOffset(2,a,0)}static addProducerVersion($,a){$.addFieldOffset(3,a,0)}static addDomain($,a){$.addFieldOffset(4,a,0)}static addModelVersion($,a){$.addFieldInt64(5,a,$.createLong(0,0))}static addDocString($,a){$.addFieldOffset(6,a,0)}static addGraph($,a){$.addFieldOffset(7,a,0)}static addGraphDocString($,a){$.addFieldOffset(8,a,0)}static endModel($){return $.endObject()}static createModel($,a,et,nt,at,rt,dt,ut,bt,mt){return ct.startModel($),ct.addIrVersion($,a),ct.addOpsetImport($,et),ct.addProducerName($,nt),ct.addProducerVersion($,at),ct.addDomain($,rt),ct.addModelVersion($,dt),ct.addDocString($,ut),ct.addGraph($,bt),ct.addGraphDocString($,mt),ct.endModel($)}}st.Model=ct})(ot.fbs||(ot.fbs={}))})(tt.experimental||(tt.experimental={}))}(o.onnxruntime||(o.onnxruntime={})),function(tt){(function(ot){(function(st){class ct{constructor(){this.bb=null,this.bb_pos=0}__init($,a){return this.bb_pos=$,this.bb=a,this}static getRootAsKernelCreateInfos($,a){return(a||new ct).__init($.readInt32($.position())+$.position(),$)}static getSizePrefixedRootAsKernelCreateInfos($,a){return $.setPosition($.position()+j.flatbuffers.SIZE_PREFIX_LENGTH),(a||new ct).__init($.readInt32($.position())+$.position(),$)}nodeIndices($){let a=this.bb.__offset(this.bb_pos,4);return a?this.bb.readUint32(this.bb.__vector(this.bb_pos+a)+4*$):0}nodeIndicesLength(){let $=this.bb.__offset(this.bb_pos,4);return $?this.bb.__vector_len(this.bb_pos+$):0}nodeIndicesArray(){let $=this.bb.__offset(this.bb_pos,4);return $?new Uint32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+$),this.bb.__vector_len(this.bb_pos+$)):null}kernelDefHashes($){let a=this.bb.__offset(this.bb_pos,6);return a?this.bb.readUint64(this.bb.__vector(this.bb_pos+a)+8*$):this.bb.createLong(0,0)}kernelDefHashesLength(){let $=this.bb.__offset(this.bb_pos,6);return $?this.bb.__vector_len(this.bb_pos+$):0}static startKernelCreateInfos($){$.startObject(2)}static addNodeIndices($,a){$.addFieldOffset(0,a,0)}static createNodeIndicesVector($,a){$.startVector(4,a.length,4);for(let et=a.length-1;et>=0;et--)$.addInt32(a[et]);return $.endVector()}static startNodeIndicesVector($,a){$.startVector(4,a,4)}static addKernelDefHashes($,a){$.addFieldOffset(1,a,0)}static createKernelDefHashesVector($,a){$.startVector(8,a.length,8);for(let et=a.length-1;et>=0;et--)$.addInt64(a[et]);return $.endVector()}static startKernelDefHashesVector($,a){$.startVector(8,a,8)}static endKernelCreateInfos($){return $.endObject()}static createKernelCreateInfos($,a,et){return ct.startKernelCreateInfos($),ct.addNodeIndices($,a),ct.addKernelDefHashes($,et),ct.endKernelCreateInfos($)}}st.KernelCreateInfos=ct})(ot.fbs||(ot.fbs={}))})(tt.experimental||(tt.experimental={}))}(o.onnxruntime||(o.onnxruntime={})),function(tt){(function(ot){(function(st){class ct{constructor(){this.bb=null,this.bb_pos=0}__init($,a){return this.bb_pos=$,this.bb=a,this}static getRootAsSubGraphSessionState($,a){return(a||new ct).__init($.readInt32($.position())+$.position(),$)}static getSizePrefixedRootAsSubGraphSessionState($,a){return $.setPosition($.position()+j.flatbuffers.SIZE_PREFIX_LENGTH),(a||new ct).__init($.readInt32($.position())+$.position(),$)}graphId($){let a=this.bb.__offset(this.bb_pos,4);return a?this.bb.__string(this.bb_pos+a,$):null}sessionState($){let a=this.bb.__offset(this.bb_pos,6);return a?($||new tt.experimental.fbs.SessionState).__init(this.bb.__indirect(this.bb_pos+a),this.bb):null}static startSubGraphSessionState($){$.startObject(2)}static addGraphId($,a){$.addFieldOffset(0,a,0)}static addSessionState($,a){$.addFieldOffset(1,a,0)}static endSubGraphSessionState($){let a=$.endObject();return $.requiredField(a,4),a}static createSubGraphSessionState($,a,et){return ct.startSubGraphSessionState($),ct.addGraphId($,a),ct.addSessionState($,et),ct.endSubGraphSessionState($)}}st.SubGraphSessionState=ct})(ot.fbs||(ot.fbs={}))})(tt.experimental||(tt.experimental={}))}(o.onnxruntime||(o.onnxruntime={})),function(tt){(function(ot){(function(st){class ct{constructor(){this.bb=null,this.bb_pos=0}__init($,a){return this.bb_pos=$,this.bb=a,this}static getRootAsSessionState($,a){return(a||new ct).__init($.readInt32($.position())+$.position(),$)}static getSizePrefixedRootAsSessionState($,a){return $.setPosition($.position()+j.flatbuffers.SIZE_PREFIX_LENGTH),(a||new ct).__init($.readInt32($.position())+$.position(),$)}kernels($){let a=this.bb.__offset(this.bb_pos,4);return a?($||new tt.experimental.fbs.KernelCreateInfos).__init(this.bb.__indirect(this.bb_pos+a),this.bb):null}subGraphSessionStates($,a){let et=this.bb.__offset(this.bb_pos,6);return et?(a||new tt.experimental.fbs.SubGraphSessionState).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+et)+4*$),this.bb):null}subGraphSessionStatesLength(){let $=this.bb.__offset(this.bb_pos,6);return $?this.bb.__vector_len(this.bb_pos+$):0}static startSessionState($){$.startObject(2)}static addKernels($,a){$.addFieldOffset(0,a,0)}static addSubGraphSessionStates($,a){$.addFieldOffset(1,a,0)}static createSubGraphSessionStatesVector($,a){$.startVector(4,a.length,4);for(let et=a.length-1;et>=0;et--)$.addOffset(a[et]);return $.endVector()}static startSubGraphSessionStatesVector($,a){$.startVector(4,a,4)}static endSessionState($){return $.endObject()}static createSessionState($,a,et){return ct.startSessionState($),ct.addKernels($,a),ct.addSubGraphSessionStates($,et),ct.endSessionState($)}}st.SessionState=ct})(ot.fbs||(ot.fbs={}))})(tt.experimental||(tt.experimental={}))}(o.onnxruntime||(o.onnxruntime={})),function(tt){(function(ot){(function(st){class ct{constructor(){this.bb=null,this.bb_pos=0}__init($,a){return this.bb_pos=$,this.bb=a,this}static getRootAsInferenceSession($,a){return(a||new ct).__init($.readInt32($.position())+$.position(),$)}static getSizePrefixedRootAsInferenceSession($,a){return $.setPosition($.position()+j.flatbuffers.SIZE_PREFIX_LENGTH),(a||new ct).__init($.readInt32($.position())+$.position(),$)}static bufferHasIdentifier($){return $.__has_identifier("ORTM")}ortVersion($){let a=this.bb.__offset(this.bb_pos,4);return a?this.bb.__string(this.bb_pos+a,$):null}model($){let a=this.bb.__offset(this.bb_pos,6);return a?($||new tt.experimental.fbs.Model).__init(this.bb.__indirect(this.bb_pos+a),this.bb):null}sessionState($){let a=this.bb.__offset(this.bb_pos,8);return a?($||new tt.experimental.fbs.SessionState).__init(this.bb.__indirect(this.bb_pos+a),this.bb):null}static startInferenceSession($){$.startObject(3)}static addOrtVersion($,a){$.addFieldOffset(0,a,0)}static addModel($,a){$.addFieldOffset(1,a,0)}static addSessionState($,a){$.addFieldOffset(2,a,0)}static endInferenceSession($){return $.endObject()}static finishInferenceSessionBuffer($,a){$.finish(a,"ORTM")}static finishSizePrefixedInferenceSessionBuffer($,a){$.finish(a,"ORTM",!0)}static createInferenceSession($,a,et,nt){return ct.startInferenceSession($),ct.addOrtVersion($,a),ct.addModel($,et),ct.addSessionState($,nt),ct.endInferenceSession($)}}st.InferenceSession=ct})(ot.fbs||(ot.fbs={}))})(tt.experimental||(tt.experimental={}))}(o.onnxruntime||(o.onnxruntime={}))},7448:(i,o,s)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OnnxjsSessionHandler=void 0;const j=s(1670),_e=s(9162);o.OnnxjsSessionHandler=class{constructor(lt){this.session=lt,this.inputNames=this.session.inputNames,this.outputNames=this.session.outputNames}async dispose(){}async run(lt,tt,ot){const st=new Map;for(const $ in lt)if(Object.hasOwnProperty.call(lt,$)){const a=lt[$];st.set($,new _e.Tensor(a.dims,a.type,void 0,void 0,a.data))}const ct=await this.session.run(st),it={};return ct.forEach(($,a)=>{it[a]=new j.Tensor($.type,$.data,$.dims)}),it}startProfiling(){this.session.startProfiling()}endProfiling(){this.session.endProfiling()}}},6919:(i,o,s)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Session=void 0;const j=s(7067),_e=s(1296),lt=s(7091),tt=s(1036),ot=s(6231),st=s(2644);o.Session=class{constructor(ct={}){this._initialized=!1,this.backendHint=ct.backendHint,this.profiler=ot.Profiler.create(ct.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(ct,it,$){await this.profiler.event("session","Session.loadModel",async()=>{const a=await(0,lt.resolveBackend)(this.backendHint);if(this.sessionHandler=a.createSessionHandler(this.context),this._model=new st.Model,typeof ct=="string"){const et=ct.endsWith(".ort");if(typeof fetch>"u"){const nt=await(0,_e.promisify)(j.readFile)(ct);this.initialize(nt,et)}else{const nt=await fetch(ct),at=await nt.arrayBuffer();this.initialize(new Uint8Array(at),et)}}else if(ArrayBuffer.isView(ct))this.initialize(ct);else{const et=new Uint8Array(ct,it||0,$||ct.byteLength);this.initialize(et)}})}initialize(ct,it){if(this._initialized)throw new Error("already initialized");this.profiler.event("session","Session.initialize",()=>{const $=this.sessionHandler.transformGraph?this.sessionHandler:void 0;this._model.load(ct,$,it),this.sessionHandler.onGraphInitialized&&this.sessionHandler.onGraphInitialized(this._model.graph),this.initializeOps(this._model.graph),this._executionPlan=new tt.ExecutionPlan(this._model.graph,this._ops,this.profiler)}),this._initialized=!0}async run(ct){if(!this._initialized)throw new Error("session not initialized yet");return this.profiler.event("session","Session.run",async()=>{const it=this.normalizeAndValidateInputs(ct),$=await this._executionPlan.execute(this.sessionHandler,it);return this.createOutput($)})}normalizeAndValidateInputs(ct){const it=this._model.graph.getInputNames();if(Array.isArray(ct)){if(ct.length!==it.length)throw new Error(`incorrect input array length: expected ${it.length} but got ${ct.length}`)}else{if(ct.size!==it.length)throw new Error(`incorrect input map size: expected ${it.length} but got ${ct.size}`);const $=new Array(ct.size);let a=0;for(let et=0;ettypeof Gt=="string")))throw new TypeError("cache should be a string array");ht&&(this.cache=new Array(Zt))}else{if(mt!==void 0){const Gt=a(dt);if(!(mt instanceof Gt))throw new TypeError(`cache should be type ${Gt.name}`)}if(ht){const Gt=new ArrayBuffer(Zt*function(Xt){switch(Xt){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 ${Xt}`)}}(dt));this.cache=function(Xt,Vt){return new(a(Vt))(Xt)}(Gt,dt)}}}static fromProto(rt){if(!rt)throw new Error("cannot construct Value from an empty tensor");const dt=st.ProtoUtil.tensorDataTypeFromProto(rt.dataType),ut=st.ProtoUtil.tensorDimsFromProto(rt.dims),bt=new it(ut,dt);if(dt==="string")rt.stringData.forEach((mt,pt)=>{bt.data[pt]=(0,st.decodeUtf8String)(mt)});else if(rt.rawData&&typeof rt.rawData.byteLength=="number"&&rt.rawData.byteLength>0){const mt=bt.data,pt=new DataView(rt.rawData.buffer,rt.rawData.byteOffset,rt.rawData.byteLength),Zt=$(rt.dataType),ht=rt.rawData.byteLength/Zt;if(rt.rawData.byteLength%Zt!=0)throw new Error("invalid buffer length");if(mt.length!==ht)throw new Error("buffer length mismatch");for(let Gt=0;Gt0){const mt=bt.data,pt=new DataView(rt.rawDataArray().buffer,rt.rawDataArray().byteOffset,rt.rawDataLength()),Zt=$(rt.dataType()),ht=rt.rawDataLength()/Zt;if(rt.rawDataLength()%Zt!=0)throw new Error("invalid buffer length");if(mt.length!==ht)throw new Error("buffer length mismatch");for(let Gt=0;Gt1&&Vt>1)return;ht[Zt-Gt]=Math.max(Xt,Vt)}return ht}static index(dt,ut){const bt=new Array(ut.length);return ct.fillIndex(dt,ut,bt),bt}static fillIndex(dt,ut,bt){const mt=dt.length-ut.length;for(let pt=0;pt=0;Jt--)Xt[Jt]=St%Zt[Jt],St=Math.floor(St/Zt[Jt]);Tt||(ct.fillIndex(Xt,dt.dims,Vt),Lt=dt.get(Vt)),ft||(ct.fillIndex(Xt,ut.dims,Yt),Ct=ut.get(Yt)),Gt.set(Xt,bt(Lt,Ct))}}return Gt}}static isValidBroadcast(dt,ut){const bt=dt.length,mt=ut.length;if(bt>mt)return!1;for(let pt=1;pt<=bt;pt++)if(dt[bt-pt]!==1&&dt[bt-pt]!==ut[mt-pt])return!1;return!0}static getBroadcastDims(dt,ut){const bt=dt.length,mt=[];for(let pt=0;pt1&&ht===1&&mt.unshift(Zt)}return mt}}o.BroadcastUtil=ct,o.arrayCopyHelper=function(rt,dt,ut,bt,mt){if(bt<0||bt>=dt.length)throw new Error("sourceIndex out of bounds");if(ut<0||ut>=rt.length)throw new Error("targetIndex out of bounds");if(bt+mt>dt.length)throw new Error("source indices to be copied are outside bounds");if(ut+mt>rt.length)throw new Error("target array is too small to hold result");for(let pt=0;ptlt.default.isLong(ut)?ut.toNumber():ut)}static tensorValueTypeFromProto(dt){return{tensorType:it.tensorDataTypeFromProto(dt.elemType),shape:{dims:it.tensorDimsFromProto(dt.shape.dim.map(ut=>ut.dimValue))}}}static tensorDimsFromORTFormat(dt){const ut=[];for(let bt=0;btdt.length)throw new Error(`invalid dimension of ${ut} for sizeFromDimension as Tensor has ${dt.length} dimensions.`);return a.getSizeFromDimensionRange(dt,ut,dt.length)}static sizeToDimension(dt,ut){if(ut<0||ut>dt.length)throw new Error(`invalid dimension of ${ut} for sizeToDimension as Tensor has ${dt.length} dimensions.`);return a.getSizeFromDimensionRange(dt,0,ut)}static getSizeFromDimensionRange(dt,ut,bt){let mt=1;for(let pt=ut;pt=0;--mt)bt[mt]=bt[mt+1]*dt[mt+1];return bt}static transpose(dt){return dt.slice().reverse()}static indicesToOffset(dt,ut,bt){bt===void 0&&(bt=dt.length);let mt=0;for(let pt=0;pt=ut)throw new Error("unsupported axis for this operation.");return dt<0?dt+ut:dt}static normalizeAxes(dt,ut){return dt.map(bt=>this.normalizeAxis(bt,ut))}static incrementIndex(dt,ut,bt){if(ut.length===0||dt.length===0)throw new Error("Index incrementing unsupported for scalar Tensor");if(bt===void 0)bt=ut.length;else if(bt<=0||bt>ut.length)throw new Error("Incorrect axis to increment on");for(let mt=bt-1;mt>=0&&(dt[mt]++,!(dt[mt]=dt.length)throw new Error("the dimension with value zero exceeds the dimension size of the input tensor");mt[Gt]=dt[Gt]}else mt[Gt]=ut[Gt];Zt*=mt[Gt]}}const ht=a.size(dt);if(pt!==-1){if(ht%Zt!=0)throw new Error(`the input tensor cannot be reshaped to the requested shape. Input shape: [${dt}] Output shape: [${ut}]`);mt[pt]=ht/Zt}else if(Zt!==ht)throw new Error("reshapedDims and originalDims don't have matching sizes");return mt}static sortBasedOnPerm(dt,ut){return ut?ut.map(bt=>dt[bt]):dt.slice().reverse()}static padShape(dt,ut){const bt=dt.length;return dt.map((mt,pt)=>mt+ut[pt]+ut[pt+bt])}static areEqual(dt,ut){return dt.length===ut.length&&dt.every((bt,mt)=>bt===ut[mt])}static validateDimsAndCalcSize(dt){if(dt.length>6)throw new TypeError("Only rank 0 to 6 is supported for tensor shape.");let ut=1;for(const bt of dt){if(!Number.isInteger(bt))throw new TypeError(`Invalid shape: ${bt} is not an integer`);if(bt<0||bt>2147483647)throw new TypeError(`Invalid shape: length ${bt} is not allowed`);ut*=bt}return ut}static flattenShape(dt,ut){ut<0&&(ut+=dt.length);const bt=dt.reduce((pt,Zt)=>pt*Zt,1),mt=dt.slice(ut).reduce((pt,Zt)=>pt*Zt,1);return[bt/mt,mt]}static squeezeShape(dt,ut){const bt=new Array;ut=a.normalizeAxes(ut,dt.length);for(let mt=0;mt=0;if(pt&&dt[mt]!==1)throw new Error("squeeze an axis of size different than 1");(ut.length===0&&dt[mt]>1||ut.length>0&&!pt)&&bt.push(dt[mt])}return bt}static unsqueezeShape(dt,ut){const bt=new Array(dt.length+ut.length);bt.fill(0);for(let pt=0;pt=bt.length)throw new Error("'axes' has an out of range axis");if(bt[Zt]!==0)throw new Error("'axes' has a duplicate axis");bt[Zt]=1}let mt=0;for(let pt=0;pt=dt.length)throw new Error("sourceIndex out of bounds");if(ut<0||ut>=rt.length)throw new Error("targetIndex out of bounds");if(bt+mt>dt.length)throw new Error("source indices to be copied are outside bounds");if(ut+mt>rt.length)throw new Error("target array is too small to hold result");for(let pt=0;pt=dt.length)throw new Error("sourceIndex out of bounds");if(ut<0||ut>=rt.length)throw new Error("targetIndex out of bounds");if(bt+mt>dt.length)throw new Error("source indices to be copied are outside bounds");if(ut+mt>rt.length)throw new Error("target array is too small to hold result");for(let Zt=0;Zt=dt.length)throw new Error("sourceIndex out of bounds");if(ut<0||ut>=rt.length)throw new Error("targetIndex out of bounds");if(bt+mt>dt.length)throw new Error("source indices to be copied are outside bounds");if(ut+mt>rt.length)throw new Error("target array is too small to hold result");for(let Zt=0;Zt=dt.length)throw new Error("sourceIndex out of bounds");if(ut<0||ut>=rt.length)throw new Error("targetIndex out of bounds");if(bt+mt>dt.length)throw new Error("source indices to be copied are outside bounds");if(ut+mt>rt.length)throw new Error("target array is too small to hold result");for(let pt=0;ptut.push(Ct));const ht=nt.calcReduceShape(Zt,ut,!0),Gt=a.size(ht),Xt=new ot.Tensor(ht,dt.type),Vt=a.computeStrides(ht),Yt=a.computeStrides(Zt),St=new Array(Zt.length);for(let Lt=0;Lt=ut.length)return Zt(dt[pt]);const Xt=ut[mt],Vt=Xt>=bt.length?1:a.size(bt.slice(Xt+1));for(let Yt=0;Ytpt!==0)}}o.ReduceUtil=nt;class at{static adjustPoolAttributes(dt,ut,bt,mt,pt,Zt){if(!dt&&bt.length!==ut.length-2)throw new Error("length of specified kernel shapes should be 2 less than length of input dimensions");if(dt)for(let ht=0;ht=bt.length?bt.push(ut[ht+2]):bt[ht]=ut[ht+2];for(let ht=0;ht=bt[ht]||Zt[ht+bt.length]>=bt[ht])throw new Error("pads should be smaller than kernel")}}static adjustPadsBasedOnAutoPad(dt,ut,bt,mt,pt,Zt){if(Zt){if(pt.length!==2*(dt.length-2))throw new Error("length of pads should be twice the length of data dimensions");if(ut.length!==dt.length-2)throw new Error("length of strides should be the length of data dimensions");if(mt.length!==dt.length-2)throw new Error("length of kernel shapes should be the length of data dimensions");for(let ht=0;ht{Object.defineProperty(o,"__esModule",{value:!0}),o.iterateExtraOptions=void 0,o.iterateExtraOptions=(s,j,_e,lt)=>{if(typeof s=="object"&&s!==null){if(_e.has(s))throw new Error("Circular reference in options");_e.add(s)}Object.entries(s).forEach(([tt,ot])=>{const st=j?j+tt:tt;if(typeof ot=="object")(0,o.iterateExtraOptions)(ot,st+".",_e,lt);else if(typeof ot=="string"||typeof ot=="number")lt(st,ot.toString());else{if(typeof ot!="boolean")throw new Error("Can't handle extra config type: "+typeof ot);lt(st,ot?"1":"0")}})}},2157:function(i,o,s){var j,_e=this&&this.__createBinding||(Object.create?function(Vt,Yt,St,Lt){Lt===void 0&&(Lt=St);var Ct=Object.getOwnPropertyDescriptor(Yt,St);Ct&&!("get"in Ct?!Yt.__esModule:Ct.writable||Ct.configurable)||(Ct={enumerable:!0,get:function(){return Yt[St]}}),Object.defineProperty(Vt,Lt,Ct)}:function(Vt,Yt,St,Lt){Lt===void 0&&(Lt=St),Vt[Lt]=Yt[St]}),lt=this&&this.__setModuleDefault||(Object.create?function(Vt,Yt){Object.defineProperty(Vt,"default",{enumerable:!0,value:Yt})}:function(Vt,Yt){Vt.default=Yt}),tt=this&&this.__importStar||function(Vt){if(Vt&&Vt.__esModule)return Vt;var Yt={};if(Vt!=null)for(var St in Vt)St!=="default"&&Object.prototype.hasOwnProperty.call(Vt,St)&&_e(Yt,Vt,St);return lt(Yt,Vt),Yt};Object.defineProperty(o,"__esModule",{value:!0}),o.endProfiling=o.run=o.releaseSession=o.createSession=o.createSessionFinalize=o.createSessionAllocate=o.initOrt=o.initWasm=void 0;const ot=s(1670),st=tt(s(349)),ct=s(6361),it=()=>!!ot.env.wasm.proxy&&typeof document<"u";let $,a,et,nt=!1,at=!1,rt=!1;const dt=[],ut=[],bt=[],mt=[],pt=[],Zt=[],ht=()=>{if(nt||!at||rt||!$)throw new Error("worker not ready")},Gt=Vt=>{switch(Vt.data.type){case"init-wasm":nt=!1,Vt.data.err?(rt=!0,a[1](Vt.data.err)):(at=!0,a[0]());break;case"init-ort":Vt.data.err?et[1](Vt.data.err):et[0]();break;case"create_allocate":Vt.data.err?dt.shift()[1](Vt.data.err):dt.shift()[0](Vt.data.out);break;case"create_finalize":Vt.data.err?ut.shift()[1](Vt.data.err):ut.shift()[0](Vt.data.out);break;case"create":Vt.data.err?bt.shift()[1](Vt.data.err):bt.shift()[0](Vt.data.out);break;case"release":Vt.data.err?mt.shift()[1](Vt.data.err):mt.shift()[0]();break;case"run":Vt.data.err?pt.shift()[1](Vt.data.err):pt.shift()[0](Vt.data.out);break;case"end-profiling":Vt.data.err?Zt.shift()[1](Vt.data.err):Zt.shift()[0]()}},Xt=typeof document<"u"?(j=document==null?void 0:document.currentScript)===null||j===void 0?void 0:j.src:void 0;o.initWasm=async()=>{if(it()){if(at)return;if(nt)throw new Error("multiple calls to 'initWasm()' detected.");if(rt)throw new Error("previous call to 'initWasm()' failed.");return nt=!0,ot.env.wasm.wasmPaths===void 0&&Xt&&Xt.indexOf("blob:")!==0&&(ot.env.wasm.wasmPaths=Xt.substr(0,+Xt.lastIndexOf("/")+1)),new Promise((Vt,Yt)=>{$==null||$.terminate(),$=s(9710).Z(),$.onmessage=Gt,a=[Vt,Yt];const St={type:"init-wasm",in:ot.env.wasm};$.postMessage(St)})}return(0,ct.initializeWebAssembly)(ot.env.wasm)},o.initOrt=async(Vt,Yt)=>{if(it())return ht(),new Promise((St,Lt)=>{et=[St,Lt];const Ct={type:"init-ort",in:{numThreads:Vt,loggingLevel:Yt}};$.postMessage(Ct)});st.initOrt(Vt,Yt)},o.createSessionAllocate=async Vt=>it()?(ht(),new Promise((Yt,St)=>{dt.push([Yt,St]);const Lt={type:"create_allocate",in:{model:Vt}};$.postMessage(Lt,[Vt.buffer])})):st.createSessionAllocate(Vt),o.createSessionFinalize=async(Vt,Yt)=>it()?(ht(),new Promise((St,Lt)=>{ut.push([St,Lt]);const Ct={type:"create_finalize",in:{modeldata:Vt,options:Yt}};$.postMessage(Ct)})):st.createSessionFinalize(Vt,Yt),o.createSession=async(Vt,Yt)=>it()?(ht(),new Promise((St,Lt)=>{bt.push([St,Lt]);const Ct={type:"create",in:{model:Vt,options:Yt}};$.postMessage(Ct,[Vt.buffer])})):st.createSession(Vt,Yt),o.releaseSession=async Vt=>{if(it())return ht(),new Promise((Yt,St)=>{mt.push([Yt,St]);const Lt={type:"release",in:Vt};$.postMessage(Lt)});st.releaseSession(Vt)},o.run=async(Vt,Yt,St,Lt,Ct)=>it()?(ht(),new Promise((Tt,ft)=>{pt.push([Tt,ft]);const Ft={type:"run",in:{sessionId:Vt,inputIndices:Yt,inputs:St,outputIndices:Lt,options:Ct}};$.postMessage(Ft,st.extractTransferableBuffers(St))})):st.run(Vt,Yt,St,Lt,Ct),o.endProfiling=async Vt=>{if(it())return ht(),new Promise((Yt,St)=>{Zt.push([Yt,St]);const Lt={type:"end-profiling",in:Vt};$.postMessage(Lt)});st.endProfiling(Vt)}},586:(i,o,s)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.setRunOptions=void 0;const j=s(7967),_e=s(4983),lt=s(6361);o.setRunOptions=tt=>{const ot=(0,lt.getInstance)();let st=0;const ct=[],it=tt||{};try{if((tt==null?void 0:tt.logSeverityLevel)===void 0)it.logSeverityLevel=2;else if(typeof tt.logSeverityLevel!="number"||!Number.isInteger(tt.logSeverityLevel)||tt.logSeverityLevel<0||tt.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${tt.logSeverityLevel}`);if((tt==null?void 0:tt.logVerbosityLevel)===void 0)it.logVerbosityLevel=0;else if(typeof tt.logVerbosityLevel!="number"||!Number.isInteger(tt.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${tt.logVerbosityLevel}`);(tt==null?void 0:tt.terminate)===void 0&&(it.terminate=!1);let $=0;if((tt==null?void 0:tt.tag)!==void 0&&($=(0,_e.allocWasmString)(tt.tag,ct)),st=ot._OrtCreateRunOptions(it.logSeverityLevel,it.logVerbosityLevel,!!it.terminate,$),st===0)throw new Error("Can't create run options");return(tt==null?void 0:tt.extra)!==void 0&&(0,j.iterateExtraOptions)(tt.extra,"",new WeakSet,(a,et)=>{const nt=(0,_e.allocWasmString)(a,ct),at=(0,_e.allocWasmString)(et,ct);if(ot._OrtAddRunConfigEntry(st,nt,at)!==0)throw new Error(`Can't set a run config entry: ${a} - ${et}`)}),[st,ct]}catch($){throw st!==0&&ot._OrtReleaseRunOptions(st),ct.forEach(ot._free),$}}},2306:(i,o,s)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OnnxruntimeWebAssemblySessionHandler=void 0;const j=s(2806),_e=s(1670),lt=s(2850),tt=s(2157);let ot;o.OnnxruntimeWebAssemblySessionHandler=class{async createSessionAllocate(st){const ct=await fetch(st),it=await ct.arrayBuffer();return(0,tt.createSessionAllocate)(new Uint8Array(it))}async loadModel(st,ct){if(ot||(await(0,tt.initOrt)(_e.env.wasm.numThreads,(it=>{switch(it){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: ${it}`)}})(_e.env.logLevel)),ot=!0),typeof st=="string")if(typeof fetch>"u"){const it=await(0,lt.promisify)(j.readFile)(st);[this.sessionId,this.inputNames,this.outputNames]=await(0,tt.createSession)(it,ct)}else{const it=await this.createSessionAllocate(st);[this.sessionId,this.inputNames,this.outputNames]=await(0,tt.createSessionFinalize)(it,ct)}else[this.sessionId,this.inputNames,this.outputNames]=await(0,tt.createSession)(st,ct)}async dispose(){return(0,tt.releaseSession)(this.sessionId)}async run(st,ct,it){const $=[],a=[];Object.entries(st).forEach(rt=>{const dt=rt[0],ut=rt[1],bt=this.inputNames.indexOf(dt);if(bt===-1)throw new Error(`invalid input '${dt}'`);$.push(ut),a.push(bt)});const et=[];Object.entries(ct).forEach(rt=>{const dt=rt[0],ut=this.outputNames.indexOf(dt);if(ut===-1)throw new Error(`invalid output '${dt}'`);et.push(ut)});const nt=await(0,tt.run)(this.sessionId,a,$.map(rt=>[rt.type,rt.dims,rt.data]),et,it),at={};for(let rt=0;rt{Object.defineProperty(o,"__esModule",{value:!0}),o.setSessionOptions=void 0;const j=s(7967),_e=s(4983),lt=s(6361);o.setSessionOptions=tt=>{const ot=(0,lt.getInstance)();let st=0;const ct=[],it=tt||{};($=>{$.extra||($.extra={}),$.extra.session||($.extra.session={});const a=$.extra.session;a.use_ort_model_bytes_directly||(a.use_ort_model_bytes_directly="1")})(it);try{(tt==null?void 0:tt.graphOptimizationLevel)===void 0&&(it.graphOptimizationLevel="all");const $=(nt=>{switch(nt){case"disabled":return 0;case"basic":return 1;case"extended":return 2;case"all":return 99;default:throw new Error(`unsupported graph optimization level: ${nt}`)}})(it.graphOptimizationLevel);(tt==null?void 0:tt.enableCpuMemArena)===void 0&&(it.enableCpuMemArena=!0),(tt==null?void 0:tt.enableMemPattern)===void 0&&(it.enableMemPattern=!0),(tt==null?void 0:tt.executionMode)===void 0&&(it.executionMode="sequential");const a=(nt=>{switch(nt){case"sequential":return 0;case"parallel":return 1;default:throw new Error(`unsupported execution mode: ${nt}`)}})(it.executionMode);let et=0;if((tt==null?void 0:tt.logId)!==void 0&&(et=(0,_e.allocWasmString)(tt.logId,ct)),(tt==null?void 0:tt.logSeverityLevel)===void 0)it.logSeverityLevel=2;else if(typeof tt.logSeverityLevel!="number"||!Number.isInteger(tt.logSeverityLevel)||tt.logSeverityLevel<0||tt.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${tt.logSeverityLevel}`);if((tt==null?void 0:tt.logVerbosityLevel)===void 0)it.logVerbosityLevel=0;else if(typeof tt.logVerbosityLevel!="number"||!Number.isInteger(tt.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${tt.logVerbosityLevel}`);if((tt==null?void 0:tt.enableProfiling)===void 0&&(it.enableProfiling=!1),st=ot._OrtCreateSessionOptions($,!!it.enableCpuMemArena,!!it.enableMemPattern,a,!!it.enableProfiling,0,et,it.logSeverityLevel,it.logVerbosityLevel),st===0)throw new Error("Can't create session options");return tt!=null&&tt.executionProviders&&((nt,at,rt)=>{for(const dt of at){let ut=typeof dt=="string"?dt:dt.name;switch(ut){case"xnnpack":ut="XNNPACK";break;case"wasm":case"cpu":continue;default:throw new Error(`not supported EP: ${ut}`)}const bt=(0,_e.allocWasmString)(ut,rt);if((0,lt.getInstance)()._OrtAppendExecutionProvider(nt,bt)!==0)throw new Error(`Can't append execution provider: ${ut}`)}})(st,tt.executionProviders,ct),(tt==null?void 0:tt.extra)!==void 0&&(0,j.iterateExtraOptions)(tt.extra,"",new WeakSet,(nt,at)=>{const rt=(0,_e.allocWasmString)(nt,ct),dt=(0,_e.allocWasmString)(at,ct);if(ot._OrtAddSessionConfigEntry(st,rt,dt)!==0)throw new Error(`Can't set a session config entry: ${nt} - ${at}`)}),[st,ct]}catch($){throw st!==0&&ot._OrtReleaseSessionOptions(st),ct.forEach(ot._free),$}}},4983:(i,o,s)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.allocWasmString=void 0;const j=s(6361);o.allocWasmString=(_e,lt)=>{const tt=(0,j.getInstance)(),ot=tt.lengthBytesUTF8(_e)+1,st=tt._malloc(ot);return tt.stringToUTF8(_e,st,ot),lt.push(st),st}},349:(i,o,s)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.extractTransferableBuffers=o.endProfiling=o.run=o.releaseSession=o.createSession=o.createSessionFinalize=o.createSessionAllocate=o.initOrt=void 0;const j=s(586),_e=s(4919),lt=s(4983),tt=s(6361);o.initOrt=($,a)=>{const et=(0,tt.getInstance)()._OrtInit($,a);if(et!==0)throw new Error(`Can't initialize onnxruntime. error code = ${et}`)};const ot=new Map;o.createSessionAllocate=$=>{const a=(0,tt.getInstance)(),et=a._malloc($.byteLength);return a.HEAPU8.set($,et),[et,$.byteLength]},o.createSessionFinalize=($,a)=>{const et=(0,tt.getInstance)();let nt=0,at=0,rt=[];try{if([at,rt]=(0,_e.setSessionOptions)(a),nt=et._OrtCreateSession($[0],$[1],at),nt===0)throw new Error("Can't create a session")}finally{et._free($[0]),et._OrtReleaseSessionOptions(at),rt.forEach(et._free)}const dt=et._OrtGetInputCount(nt),ut=et._OrtGetOutputCount(nt),bt=[],mt=[],pt=[],Zt=[];for(let ht=0;ht{const et=(0,o.createSessionAllocate)($);return(0,o.createSessionFinalize)(et,a)},o.releaseSession=$=>{const a=(0,tt.getInstance)(),et=ot.get($);if(!et)throw new Error("invalid session id");const nt=et[0],at=et[1],rt=et[2];at.forEach(a._OrtFree),rt.forEach(a._OrtFree),a._OrtReleaseSession(nt),ot.delete($)};const st=$=>{switch($){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: ${$}`)}},ct=$=>{switch($){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: ${$}`)}},it=$=>{switch($){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: ${$}`)}};o.run=($,a,et,nt,at)=>{const rt=(0,tt.getInstance)(),dt=ot.get($);if(!dt)throw new Error("invalid session id");const ut=dt[0],bt=dt[1],mt=dt[2],pt=a.length,Zt=nt.length;let ht=0,Gt=[];const Xt=[],Vt=[];try{[ht,Gt]=(0,j.setRunOptions)(at);for(let ft=0;ftrt.HEAP32[Qt++]=Xl);const jt=rt._OrtCreateTensor(st(Ft),wt,Et,Il,Jt.length);if(jt===0)throw new Error("Can't create a tensor");Xt.push(jt)}finally{rt.stackRestore(At)}}const Yt=rt.stackSave(),St=rt.stackAlloc(4*pt),Lt=rt.stackAlloc(4*pt),Ct=rt.stackAlloc(4*Zt),Tt=rt.stackAlloc(4*Zt);try{let ft=St/4,Ft=Lt/4,Jt=Ct/4,Ht=Tt/4;for(let At=0;AtWl*xl);if(Xl=ct(Tl),Xl==="string"){const Wl=[];let xl=Yl/4;for(let Gl=0;Gl{const a=(0,tt.getInstance)(),et=ot.get($);if(!et)throw new Error("invalid session id");const nt=et[0],at=a._OrtEndProfiling(nt);if(at===0)throw new Error("Can't get an profile file name");a._OrtFree(at)},o.extractTransferableBuffers=$=>{const a=[];for(const et of $){const nt=et[2];!Array.isArray(nt)&&nt.buffer&&a.push(nt.buffer)}return a}},6361:function(i,o,s){var j=this&&this.__createBinding||(Object.create?function(at,rt,dt,ut){ut===void 0&&(ut=dt);var bt=Object.getOwnPropertyDescriptor(rt,dt);bt&&!("get"in bt?!rt.__esModule:bt.writable||bt.configurable)||(bt={enumerable:!0,get:function(){return rt[dt]}}),Object.defineProperty(at,ut,bt)}:function(at,rt,dt,ut){ut===void 0&&(ut=dt),at[ut]=rt[dt]}),_e=this&&this.__setModuleDefault||(Object.create?function(at,rt){Object.defineProperty(at,"default",{enumerable:!0,value:rt})}:function(at,rt){at.default=rt}),lt=this&&this.__importStar||function(at){if(at&&at.__esModule)return at;var rt={};if(at!=null)for(var dt in at)dt!=="default"&&Object.prototype.hasOwnProperty.call(at,dt)&&j(rt,at,dt);return _e(rt,at),rt},tt=this&&this.__importDefault||function(at){return at&&at.__esModule?at:{default:at}};Object.defineProperty(o,"__esModule",{value:!0}),o.dispose=o.getInstance=o.initializeWebAssembly=void 0;const ot=lt(s(6449)),st=tt(s(932)),ct=s(3474);let it,$=!1,a=!1,et=!1;const nt=(at,rt)=>rt?at?"ort-wasm-simd-threaded.wasm":"ort-wasm-threaded.wasm":at?"ort-wasm-simd.wasm":"ort-wasm.wasm";o.initializeWebAssembly=async at=>{if($)return Promise.resolve();if(a)throw new Error("multiple calls to 'initializeWebAssembly()' detected.");if(et)throw new Error("previous call to 'initializeWebAssembly()' failed.");a=!0;const rt=at.initTimeout,dt=at.numThreads,ut=at.simd,bt=dt>1&&(()=>{try{return typeof SharedArrayBuffer<"u"&&(typeof MessageChannel<"u"&&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{return!1}})(),mt=ut&&(()=>{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{return!1}})(),pt=typeof at.wasmPaths=="string"?at.wasmPaths:void 0,Zt=nt(!1,bt),ht=nt(mt,bt),Gt=typeof at.wasmPaths=="object"?at.wasmPaths[ht]:void 0;let Xt=!1;const Vt=[];if(rt>0&&Vt.push(new Promise(Yt=>{setTimeout(()=>{Xt=!0,Yt()},rt)})),Vt.push(new Promise((Yt,St)=>{const Lt=bt?ct:st.default,Ct={locateFile:(Tt,ft)=>bt&&Tt.endsWith(".worker.js")&&typeof Blob<"u"?URL.createObjectURL(new Blob([s(4154)],{type:"text/javascript"})):Tt===Zt?Gt??(pt??ft)+ht:ft+Tt};if(bt)if(typeof Blob>"u")Ct.mainScriptUrlOrBlob=ot.join("/","ort-wasm-threaded.js");else{const Tt=`var ortWasmThreaded=(function(){var _scriptDir;return ${Lt.toString()}})();`;Ct.mainScriptUrlOrBlob=new Blob([Tt],{type:"text/javascript"})}Lt(Ct).then(Tt=>{a=!1,$=!0,it=Tt,Yt()},Tt=>{a=!1,et=!0,St(Tt)})})),await Promise.race(Vt),Xt)throw new Error(`WebAssembly backend initializing failed due to timeout: ${rt}ms`)},o.getInstance=()=>{if($&&it)return it;throw new Error("WebAssembly is not initialized yet.")},o.dispose=()=>{var at;!$||a||et||(a=!0,(at=it.PThread)===null||at===void 0||at.terminateAllThreads(),it=void 0,a=!1,$=!1,et=!0)}},9710:(i,o,s)=>{s.d(o,{Z:()=>lt});var j=s(477),_e=s.n(j);function lt(){return _e()('/*!\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{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(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>>=0;r=n+r-1;for(var i=0;i=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=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>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>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>>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>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>2>>>0],s=i()[e+4>>2>>>0];e+=8;for(var l=0;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.lengtht?-1:0r-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:12t.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&>(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;azt(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>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>>0];return(0>t?ut[-t-1]:fe[t]).apply(null,Xt)},qa:function(t){var e=r().length;if((t>>>=0)<=e||4294901760=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>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{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{if(_||0{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(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>>=0;r=n+r-1;for(var i=0;i=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=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>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.lengtht?-1:0r-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:12t.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>>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>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>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>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>2>>>0],u=M[e+4>>2>>>0];e+=8;for(var c=0;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>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{"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{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;tp.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;tt*e));if(a=s(o),"string"===a){const t=[];let e=i/4;for(let n=0;n{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:i=>{i.exports=function(o,s,j,_e){var lt=self||window;try{try{var tt;try{tt=new lt.Blob([o])}catch{(tt=new(lt.BlobBuilder||lt.WebKitBlobBuilder||lt.MozBlobBuilder||lt.MSBlobBuilder)).append(o),tt=tt.getBlob()}var ot=lt.URL||lt.webkitURL,st=ot.createObjectURL(tt),ct=new lt[s](st,j);return ot.revokeObjectURL(st),ct}catch{return new lt[s]("data:application/javascript,".concat(encodeURIComponent(o)),j)}}catch{if(!_e)throw Error("Inline worker is not supported");return new lt[s](_e,j)}}},4154:i=>{i.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}}; `},1670:i=>{i.exports=__WEBPACK_EXTERNAL_MODULE__1670__},7067:()=>{},1296:()=>{},1384:()=>{},3993:()=>{},908:()=>{},6953:()=>{},9925:()=>{},2806:()=>{},6449:()=>{},2850:()=>{},5381:()=>{},5686:(i,o,s)=>{s.r(o),s.d(o,{flatbuffers:()=>j});var j={};j.Offset,j.Table,j.SIZEOF_SHORT=2,j.SIZEOF_INT=4,j.FILE_IDENTIFIER_LENGTH=4,j.SIZE_PREFIX_LENGTH=4,j.Encoding={UTF8_BYTES:1,UTF16_STRING:2},j.int32=new Int32Array(2),j.float32=new Float32Array(j.int32.buffer),j.float64=new Float64Array(j.int32.buffer),j.isLittleEndian=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1,j.Long=function(_e,lt){this.low=0|_e,this.high=0|lt},j.Long.create=function(_e,lt){return _e==0&<==0?j.Long.ZERO:new j.Long(_e,lt)},j.Long.prototype.toFloat64=function(){return(this.low>>>0)+4294967296*this.high},j.Long.prototype.equals=function(_e){return this.low==_e.low&&this.high==_e.high},j.Long.ZERO=new j.Long(0,0),j.Builder=function(_e){if(_e)lt=_e;else var lt=1024;this.bb=j.ByteBuffer.allocate(lt),this.space=lt,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},j.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},j.Builder.prototype.forceDefaults=function(_e){this.force_defaults=_e},j.Builder.prototype.dataBuffer=function(){return this.bb},j.Builder.prototype.asUint8Array=function(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())},j.Builder.prototype.prep=function(_e,lt){_e>this.minalign&&(this.minalign=_e);for(var tt=1+~(this.bb.capacity()-this.space+lt)&_e-1;this.space=0&&this.vtable[lt]==0;lt--);for(var tt=lt+1;lt>=0;lt--)this.addInt16(this.vtable[lt]!=0?_e-this.vtable[lt]:0);this.addInt16(_e-this.object_start);var ot=(tt+2)*j.SIZEOF_SHORT;this.addInt16(ot);var st=0,ct=this.space;e:for(lt=0;lt=0;ct--)this.writeInt8(st.charCodeAt(ct))}this.prep(this.minalign,j.SIZEOF_INT+ot),this.addOffset(_e),ot&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)},j.Builder.prototype.finishSizePrefixed=function(_e,lt){this.finish(_e,lt,!0)},j.Builder.prototype.requiredField=function(_e,lt){var tt=this.bb.capacity()-_e,ot=tt-this.bb.readInt32(tt);if(this.bb.readInt16(ot+lt)==0)throw new Error("FlatBuffers: field "+lt+" must be set")},j.Builder.prototype.startVector=function(_e,lt,tt){this.notNested(),this.vector_num_elems=lt,this.prep(j.SIZEOF_INT,_e*lt),this.prep(tt,_e*lt)},j.Builder.prototype.endVector=function(){return this.writeInt32(this.vector_num_elems),this.offset()},j.Builder.prototype.createString=function(_e){if(_e instanceof Uint8Array)var lt=_e;else{lt=[];for(var tt=0;tt<_e.length;){var ot,st=_e.charCodeAt(tt++);(ot=st<55296||st>=56320?st:(st<<10)+_e.charCodeAt(tt++)+-56613888)<128?lt.push(ot):(ot<2048?lt.push(ot>>6&31|192):(ot<65536?lt.push(ot>>12&15|224):lt.push(ot>>18&7|240,ot>>12&63|128),lt.push(ot>>6&63|128)),lt.push(63&ot|128))}}this.addInt8(0),this.startVector(1,lt.length,1),this.bb.setPosition(this.space-=lt.length),tt=0;for(var ct=this.space,it=this.bb.bytes();tt>24},j.ByteBuffer.prototype.readUint8=function(_e){return this.bytes_[_e]},j.ByteBuffer.prototype.readInt16=function(_e){return this.readUint16(_e)<<16>>16},j.ByteBuffer.prototype.readUint16=function(_e){return this.bytes_[_e]|this.bytes_[_e+1]<<8},j.ByteBuffer.prototype.readInt32=function(_e){return this.bytes_[_e]|this.bytes_[_e+1]<<8|this.bytes_[_e+2]<<16|this.bytes_[_e+3]<<24},j.ByteBuffer.prototype.readUint32=function(_e){return this.readInt32(_e)>>>0},j.ByteBuffer.prototype.readInt64=function(_e){return new j.Long(this.readInt32(_e),this.readInt32(_e+4))},j.ByteBuffer.prototype.readUint64=function(_e){return new j.Long(this.readUint32(_e),this.readUint32(_e+4))},j.ByteBuffer.prototype.readFloat32=function(_e){return j.int32[0]=this.readInt32(_e),j.float32[0]},j.ByteBuffer.prototype.readFloat64=function(_e){return j.int32[j.isLittleEndian?0:1]=this.readInt32(_e),j.int32[j.isLittleEndian?1:0]=this.readInt32(_e+4),j.float64[0]},j.ByteBuffer.prototype.writeInt8=function(_e,lt){this.bytes_[_e]=lt},j.ByteBuffer.prototype.writeUint8=function(_e,lt){this.bytes_[_e]=lt},j.ByteBuffer.prototype.writeInt16=function(_e,lt){this.bytes_[_e]=lt,this.bytes_[_e+1]=lt>>8},j.ByteBuffer.prototype.writeUint16=function(_e,lt){this.bytes_[_e]=lt,this.bytes_[_e+1]=lt>>8},j.ByteBuffer.prototype.writeInt32=function(_e,lt){this.bytes_[_e]=lt,this.bytes_[_e+1]=lt>>8,this.bytes_[_e+2]=lt>>16,this.bytes_[_e+3]=lt>>24},j.ByteBuffer.prototype.writeUint32=function(_e,lt){this.bytes_[_e]=lt,this.bytes_[_e+1]=lt>>8,this.bytes_[_e+2]=lt>>16,this.bytes_[_e+3]=lt>>24},j.ByteBuffer.prototype.writeInt64=function(_e,lt){this.writeInt32(_e,lt.low),this.writeInt32(_e+4,lt.high)},j.ByteBuffer.prototype.writeUint64=function(_e,lt){this.writeUint32(_e,lt.low),this.writeUint32(_e+4,lt.high)},j.ByteBuffer.prototype.writeFloat32=function(_e,lt){j.float32[0]=lt,this.writeInt32(_e,j.int32[0])},j.ByteBuffer.prototype.writeFloat64=function(_e,lt){j.float64[0]=lt,this.writeInt32(_e,j.int32[j.isLittleEndian?0:1]),this.writeInt32(_e+4,j.int32[j.isLittleEndian?1:0])},j.ByteBuffer.prototype.getBufferIdentifier=function(){if(this.bytes_.length>10),56320+(1023&ct)))}return ot},j.ByteBuffer.prototype.__indirect=function(_e){return _e+this.readInt32(_e)},j.ByteBuffer.prototype.__vector=function(_e){return _e+this.readInt32(_e)+j.SIZEOF_INT},j.ByteBuffer.prototype.__vector_len=function(_e){return this.readInt32(_e+this.readInt32(_e))},j.ByteBuffer.prototype.__has_identifier=function(_e){if(_e.length!=j.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+j.FILE_IDENTIFIER_LENGTH);for(var lt=0;lt{var o=i&&i.__esModule?()=>i.default:()=>i;return __webpack_require__.d(o,{a:o}),o},__webpack_require__.d=(i,o)=>{for(var s in o)__webpack_require__.o(o,s)&&!__webpack_require__.o(i,s)&&Object.defineProperty(i,s,{enumerable:!0,get:o[s]})},__webpack_require__.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),__webpack_require__.o=(i,o)=>Object.prototype.hasOwnProperty.call(i,o),__webpack_require__.r=i=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})};var __webpack_exports__=__webpack_require__(6018);return __webpack_exports__})())})(ortWeb_min$1);var ortWeb_minExports=ortWeb_min$1.exports;const ortWeb_min=getDefaultExportFromCjs(ortWeb_minExports),ONNX_WEB=_mergeNamespaces({__proto__:null,default:ortWeb_min},[ortWeb_minExports]);let ONNX;const executionProviders=["wasm"];var Co;typeof process<"u"&&((Co=process==null?void 0:process.release)==null?void 0:Co.name)==="node"?(ONNX=sharp??ONNX_NODE,executionProviders.unshift("cpu")):(ONNX=ortWeb_min??ONNX_WEB,typeof navigator<"u"&&/iP(hone|od|ad).+16_4.+AppleWebKit/.test(navigator.userAgent)&&(ONNX.env.wasm.simd=!1));const{env:onnx_env}=ONNX,VERSION="2.16.1",WEB_CACHE_AVAILABLE=typeof self<"u"&&"caches"in self,FS_AVAILABLE=!isEmpty(sharp),PATH_AVAILABLE=!isEmpty(sharp),RUNNING_LOCALLY=FS_AVAILABLE&&PATH_AVAILABLE,__dirname=RUNNING_LOCALLY?sharp.dirname(sharp.dirname(sharp.fileURLToPath(import.meta.url))):"./",DEFAULT_CACHE_DIR=RUNNING_LOCALLY?sharp.join(__dirname,"/.cache/"):null,DEFAULT_LOCAL_MODEL_PATH="/models/",localModelPath=RUNNING_LOCALLY?sharp.join(__dirname,DEFAULT_LOCAL_MODEL_PATH):DEFAULT_LOCAL_MODEL_PATH;onnx_env!=null&&onnx_env.wasm&&(onnx_env.wasm.wasmPaths=RUNNING_LOCALLY?sharp.join(__dirname,"/dist/"):`https://cdn.jsdelivr.net/npm/@xenova/transformers@${VERSION}/dist/`);const env$1={backends:{onnx:onnx_env,tfjs:{}},__dirname,version:VERSION,allowRemoteModels:!0,remoteHost:"https://huggingface.co/",remotePathTemplate:"{model}/resolve/{revision}/",allowLocalModels:!0,localModelPath,useFS:FS_AVAILABLE,useBrowserCache:WEB_CACHE_AVAILABLE,useFSCache:FS_AVAILABLE,cacheDir:DEFAULT_CACHE_DIR,useCustomCache:!1,customCache:null};function isEmpty(i){return Object.keys(i).length===0}var define_process_env_default={};globalThis.ReadableStream||(globalThis.ReadableStream=sharp.ReadableStream);class FileResponse{constructor(o){fn(this,"_CONTENT_TYPE_MAP",{txt:"text/plain",html:"text/html",css:"text/css",js:"text/javascript",json:"application/json",png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif"});if(this.filePath=o,this.headers=new Headers,this.exists=sharp.existsSync(o),this.exists){this.status=200,this.statusText="OK";let s=sharp.statSync(o);this.headers.set("content-length",s.size.toString()),this.updateContentType();let j=this;this.body=new ReadableStream({start(_e){j.arrayBuffer().then(lt=>{_e.enqueue(new Uint8Array(lt)),_e.close()})}})}else this.status=404,this.statusText="Not Found",this.body=null}updateContentType(){const o=this.filePath.toString().split(".").pop().toLowerCase();this.headers.set("content-type",this._CONTENT_TYPE_MAP[o]??"application/octet-stream")}clone(){let o=new FileResponse(this.filePath);return o.exists=this.exists,o.status=this.status,o.statusText=this.statusText,o.headers=new Headers(this.headers),o}async arrayBuffer(){return(await sharp.promises.readFile(this.filePath)).buffer}async blob(){const o=await sharp.promises.readFile(this.filePath);return new Blob([o],{type:this.headers.get("content-type")})}async text(){return await sharp.promises.readFile(this.filePath,"utf8")}async json(){return JSON.parse(await this.text())}}function isValidHttpUrl(i,o=null){let s;try{s=new URL(i)}catch{return!1}return o&&!o.includes(s.hostname)?!1:s.protocol==="http:"||s.protocol==="https:"}async function getFile(i){var o;if(env$1.useFS&&!isValidHttpUrl(i))return new FileResponse(i);if(typeof process<"u"&&((o=process==null?void 0:process.release)==null?void 0:o.name)==="node"){const s=!!(define_process_env_default!=null&&define_process_env_default.TESTING_REMOTELY),j=env$1.version,_e=new Headers;if(_e.set("User-Agent",`transformers.js/${j}; is_ci/${s};`),isValidHttpUrl(i,["huggingface.co","hf.co"])){const tt=(define_process_env_default==null?void 0:define_process_env_default.HF_TOKEN)??(define_process_env_default==null?void 0:define_process_env_default.HF_ACCESS_TOKEN);tt&&_e.set("Authorization",`Bearer ${tt}`)}return fetch(i,{headers:_e})}else return fetch(i)}const ERROR_MAPPING={400:"Bad request error occurred while trying to load file",401:"Unauthorized access to file",403:"Forbidden access to file",404:"Could not locate file",408:"Request timeout error occurred while trying to load file",500:"Internal server error error occurred while trying to load file",502:"Bad gateway error occurred while trying to load file",503:"Service unavailable error occurred while trying to load file",504:"Gateway timeout error occurred while trying to load file"};function handleError(i,o,s){if(!s)return null;const j=ERROR_MAPPING[i]??`Error (${i}) occurred while trying to load file`;throw Error(`${j}: "${o}".`)}class FileCache{constructor(o){this.path=o}async match(o){let s=sharp.join(this.path,o),j=new FileResponse(s);if(j.exists)return j}async put(o,s){const j=Buffer.from(await s.arrayBuffer());let _e=sharp.join(this.path,o);try{await sharp.promises.mkdir(sharp.dirname(_e),{recursive:!0}),await sharp.promises.writeFile(_e,j)}catch(lt){console.warn("An error occurred while writing the file to cache:",lt)}}}async function tryCache(i,...o){for(let s of o)try{let j=await i.match(s);if(j)return j}catch{continue}}async function getModelFile(i,o,s=!0,j={}){dispatchCallback(j.progress_callback,{status:"initiate",name:i,file:o});let _e;if(!_e&&env$1.useBrowserCache){if(typeof caches>"u")throw Error("Browser cache is not available in this environment.");try{_e=await caches.open("transformers-cache")}catch(dt){console.warn("An error occurred while opening the browser cache:",dt)}}if(!_e&&env$1.useFSCache&&(_e=new FileCache(j.cache_dir??env$1.cacheDir)),!_e&&env$1.useCustomCache)throw Error("`env.useCustomCache=true`, but `env.customCache` is not defined.");const lt=j.revision??"main";let tt=pathJoin(i,o),ot=pathJoin(env$1.localModelPath,tt),st=pathJoin(env$1.remoteHost,env$1.remotePathTemplate.replaceAll("{model}",i).replaceAll("{revision}",encodeURIComponent(lt)),o),ct=lt==="main"?tt:pathJoin(i,lt,o),it,$=_e instanceof FileCache?ct:st,a=!1,et;_e&&(et=await tryCache(_e,ot,$));const nt=et!==void 0;if(et===void 0){if(isValidHttpUrl(tt)){if(j.local_files_only)throw new Error(`\`local_files_only=true\`, but attempted to load a remote file from: ${tt}.`)}else try{et=await getFile(ot),it=ot}catch(ut){console.warn(`Unable to load from local path "${ot}": "${ut}"`)}if(et===void 0||et.status===404){if(j.local_files_only||!env$1.allowRemoteModels){if(s)throw Error(`\`local_files_only=true\` or \`env.allowRemoteModels=false\` and file was not found locally at "${ot}".`);return null}if(et=await getFile(st),et.status!==200)return handleError(et.status,st,s);it=$}a=_e&&typeof Response<"u"&&et instanceof Response&&et.status===200}dispatchCallback(j.progress_callback,{status:"download",name:i,file:o});const at={status:"progress",name:i,file:o};let rt;return j.progress_callback?nt&&typeof navigator<"u"&&/firefox/i.test(navigator.userAgent)?(rt=new Uint8Array(await et.arrayBuffer()),dispatchCallback(j.progress_callback,{...at,progress:100,loaded:rt.length,total:rt.length})):rt=await readResponse(et,dt=>{dispatchCallback(j.progress_callback,{...at,...dt})}):rt=new Uint8Array(await et.arrayBuffer()),a&&it&&await _e.match(it)===void 0&&await _e.put(it,new Response(rt,{headers:et.headers})).catch(dt=>{console.warn(`Unable to add response to browser cache: ${dt}.`)}),dispatchCallback(j.progress_callback,{status:"done",name:i,file:o}),rt}async function getModelJSON(i,o,s=!0,j={}){let _e=await getModelFile(i,o,s,j);if(_e===null)return{};let tt=new TextDecoder("utf-8").decode(_e);return JSON.parse(tt)}async function readResponse(i,o){const s=i.headers.get("Content-Length");s===null&&console.warn("Unable to determine content-length from response headers. Will expand buffer when needed.");let j=parseInt(s??"0"),_e=new Uint8Array(j),lt=0;const tt=i.body.getReader();async function ot(){const{done:st,value:ct}=await tt.read();if(st)return;let it=lt+ct.length;if(it>j){j=it;let a=new Uint8Array(j);a.set(_e),_e=a}_e.set(ct,lt),lt=it;const $=lt/j*100;return o({progress:$,loaded:lt,total:j}),ot()}return await ot(),_e}function pathJoin(...i){return i=i.map((o,s)=>(s&&(o=o.replace(new RegExp("^/"),"")),s!==i.length-1&&(o=o.replace(new RegExp("/$"),"")),o)),i.join("/")}function permute_data(i,o,s){const j=new Array(s.length),_e=new Array(s.length);for(let ot=s.length-1,st=1;ot>=0;--ot)_e[ot]=st,j[ot]=o[s[ot]],st*=j[ot];const lt=s.map((ot,st)=>_e[s.indexOf(st)]),tt=new i.constructor(i.length);for(let ot=0;ot=0;--ct)st+=it%o[ct]*lt[ct],it=Math.floor(it/o[ct]);tt[st]=i[ot]}return[tt,j]}function softmax(i){const o=max(i)[0],s=i.map(lt=>Math.exp(lt-o)),j=s.reduce((lt,tt)=>lt+tt,0);return s.map(lt=>lt/j)}function log_softmax(i){return softmax(i).map(j=>Math.log(j))}function dot(i,o){return i.reduce((s,j,_e)=>s+j*o[_e],0)}function getTopItems(i,o=0){return i=Array.from(i).map((s,j)=>[j,s]).sort((s,j)=>j[1]-s[1]),o!==null&&o>0&&(i=i.slice(0,o)),i}function cos_sim(i,o){const s=dot(i,o),j=magnitude(i),_e=magnitude(o);return s/(j*_e)}function magnitude(i){return Math.sqrt(i.reduce((o,s)=>o+s*s,0))}function max(i){if(i.length===0)throw Error("Array must not be empty");let o=i[0],s=0;for(let j=1;jo&&(o=i[j],s=j);return[Number(o),s]}function medianFilter(i,o){if(o%2===0||o<=0)throw new Error("Window size must be a positive odd number");const s=new i.constructor(i.length),j=new i.constructor(o),_e=Math.floor(o/2);for(let lt=0;lt=i.length&&(st=2*(i.length-1)-st),j[tt++]=i[st]}j.sort(),s[lt]=j[_e]}return s}const DataTypeMap=Object.freeze({float32:Float32Array,float64:Float64Array,string:Array,int8:Int8Array,uint8:Uint8Array,int16:Int16Array,uint16:Uint16Array,int32:Int32Array,uint32:Uint32Array,int64:BigInt64Array,uint64:BigUint64Array,bool:Uint8Array}),ONNXTensor$1=ONNX.Tensor;class Tensor{constructor(...o){fn(this,"dims");fn(this,"type");fn(this,"data");fn(this,"size");return o[0]instanceof ONNXTensor$1?Object.assign(this,o[0]):Object.assign(this,new ONNXTensor$1(o[0],o[1],o[2])),new Proxy(this,{get:(s,j)=>{if(typeof j=="string"){let _e=Number(j);if(Number.isInteger(_e))return s._getitem(_e)}return s[j]},set:(s,j,_e)=>s[j]=_e})}*[Symbol.iterator](){const[o,...s]=this.dims;if(s.length>0){const j=s.reduce((_e,lt)=>_e*lt);for(let _e=0;_e0){const _e=j.reduce((lt,tt)=>lt*tt);return this._subarray(o,_e,j)}else return new Tensor(this.type,[this.data[o]],j)}indexOf(o){for(let s=0;sct[1])throw new Error(`Invalid slice: ${ct}`);let it=[Math.max(ct[0],0),Math.min(ct[1],this.dims[st])];j.push(it),s.push(it[1]-it[0])}else throw new Error(`Invalid slice: ${ct}`)}let _e=j.map(([st,ct])=>ct-st),lt=_e.reduce((st,ct)=>st*ct),tt=new this.data.constructor(lt);const ot=this.stride();for(let st=0;st=0;--it){const a=_e[it];ct+=($%a+j[it][0])*ot[it],$=Math.floor($/a)}tt[st]=this.data[ct]}return new Tensor(this.type,tt,s)}permute(...o){return permute(this,o)}transpose(...o){return this.permute(...o)}sum(o=null,s=!1){return this.norm(1,o,s)}norm(o="fro",s=null,j=!1){if(o==="fro")o=2;else if(typeof o=="string")throw Error(`Unsupported norm: ${o}`);if(s===null){let tt=this.data.reduce((ot,st)=>ot+st**o,0)**(1/o);return new Tensor(this.type,[tt],[])}s=safeIndex(s,this.dims.length);const _e=this.dims.slice();_e[s]=1;const lt=new this.data.constructor(this.data.length/this.dims[s]);for(let tt=0;tt=0;--st){const $=this.dims[st];if(st!==s){const a=ct%$;ot+=a*it,it*=_e[st]}ct=Math.floor(ct/$)}lt[ot]+=this.data[tt]**o}if(o!==1)for(let tt=0;tt=0;--tt){const ct=this.dims[tt];if(tt!==s){const it=ot%ct;lt+=it*st,st*=this.dims[tt]}ot=Math.floor(ot/ct)}this.data[_e]/=j.data[lt]}return this}normalize(o=2,s=1){return this.clone().normalize_(o,s)}stride(){return dimsToStride(this.dims)}squeeze(o=null){return new Tensor(this.type,this.data,calc_squeeze_dims(this.dims,o))}squeeze_(o=null){return this.dims=calc_squeeze_dims(this.dims,o),this}unsqueeze(o=null){return new Tensor(this.type,this.data,calc_unsqueeze_dims(this.dims,o))}unsqueeze_(o=null){return this.dims=calc_unsqueeze_dims(this.dims,o),this}flatten_(o=0,s=-1){s=(s+this.dims.length)%this.dims.length;let j=this.dims.slice(0,o),_e=this.dims.slice(o,s+1),lt=this.dims.slice(s+1);return this.dims=[...j,_e.reduce((tt,ot)=>tt*ot,1),...lt],this}flatten(o=0,s=-1){return this.clone().flatten_(o,s)}view(...o){let s=-1;for(let j=0;jtt!==s?_e*lt:_e,1);o[s]=this.data.length/j}return new Tensor(this.type,this.data,o)}neg_(){for(let o=0;olt*tt);if(s!==j)throw Error(`cannot reshape array of size ${s} into shape (${o})`);let _e=i;for(let lt=o.length-1;lt>=0;lt--)_e=_e.reduce((tt,ot)=>{let st=tt[tt.length-1];return st.lengths!==1):typeof o=="number"?i[o]===1&&i.splice(o,1):Array.isArray(o)&&(i=i.filter((s,j)=>s!==1||!o.includes(j))),i}function calc_unsqueeze_dims(i,o){return o=safeIndex(o,i.length+1),i=i.slice(),i.splice(o,0,1),i}function safeIndex(i,o,s=null){if(i<-o||i>=o)throw new Error(`IndexError: index ${i} is out of bounds for dimension${s===null?"":" "+s} with size ${o}`);return i<0&&(i=(i%o+o)%o),i}function cat(i,o=0){o=safeIndex(o,i[0].dims.length);const s=i[0].dims.slice();s[o]=i.reduce((tt,ot)=>tt+ot.dims[o],0);const j=s.reduce((tt,ot)=>tt*ot,1),_e=new i[0].data.constructor(j),lt=i[0].type;if(o===0){let tt=0;for(let ot of i)_e.set(ot.data,tt),tt+=ot.data.length}else{let tt=0;for(let ot=0;ot=0;--$){const nt=st.dims[$];let at=a%nt;$===o&&(at+=tt),it+=at*et,et*=s[$],a=Math.floor(a/nt)}_e[it]=st.data[ct]}tt+=st.dims[o]}}return new Tensor(lt,_e,s)}function stack(i,o=0){return cat(i.map(s=>s.unsqueeze(o)),o)}function std_mean(i,o=null,s=1,j=!1){if(o===null){const ct=i.data.reduce((et,nt)=>et+nt,0)/i.data.length,it=Math.sqrt(i.data.reduce((et,nt)=>et+(nt-ct)**2,0)/(i.data.length-s)),$=new Tensor(i.type,[ct],[]);return[new Tensor(i.type,[it],[]),$]}o=safeIndex(o,i.dims.length);const _e=mean(i,o,j),lt=i.dims.slice();lt[o]=1;const tt=new i.data.constructor(i.data.length/i.dims[o]);for(let st=0;st=0;--it){const et=i.dims[it];if(it!==o){const nt=$%et;ct+=nt*a,a*=lt[it]}$=Math.floor($/et)}tt[ct]+=(i.data[st]-_e.data[ct])**2}for(let st=0;sttt+ot,0);return new Tensor(i.type,[lt/i.data.length],[])}o=safeIndex(o,i.dims.length);const j=i.dims.slice();j[o]=1;const _e=new i.data.constructor(i.data.length/i.dims[o]);for(let lt=0;lt=0;--ot){const it=i.dims[ot];if(ot!==o){const $=st%it;tt+=$*ct,ct*=j[ot]}st=Math.floor(st/it)}_e[tt]+=i.data[lt]}if(i.dims[o]!==1)for(let lt=0;lt<_e.length;++lt)_e[lt]=_e[lt]/i.dims[o];return s||j.splice(o,1),new Tensor(i.type,_e,j)}function dynamicTimeWarping(i){const[o,s]=i.dims,j=[o+1,s+1],_e=new Tensor("float32",new Float32Array(j[0]*j[1]).fill(1/0),j),lt=new Tensor("float32",new Float32Array(j[0]*j[1]).fill(-1),j);_e[0].data[0]=0;for(let it=1;it0||ot>0;)switch(st.push(tt-1),ct.push(ot-1),lt[tt][ot].item()){case 0:--tt,--ot;break;case 1:--tt;break;case 2:--ot;break;default:throw new Error(`Internal error in dynamic time warping. Unexpected trace[${tt}, ${ot}]. Please file a bug report.`)}return st.reverse(),ct.reverse(),[st,ct]}function dimsToStride(i){const o=new Array(i.length);for(let s=i.length-1,j=1;s>=0;--s)o[s]=j,j*=i[s];return o}function ones(i){const o=i.reduce((s,j)=>s*j,1);return new Tensor("int64",new BigInt64Array(o).fill(1n),i)}function ones_like(i){return ones(i.dims)}var TOKEN_TYPES=Object.freeze({Text:"Text",NumericLiteral:"NumericLiteral",BooleanLiteral:"BooleanLiteral",StringLiteral:"StringLiteral",Identifier:"Identifier",Equals:"Equals",OpenParen:"OpenParen",CloseParen:"CloseParen",OpenStatement:"OpenStatement",CloseStatement:"CloseStatement",OpenExpression:"OpenExpression",CloseExpression:"CloseExpression",OpenSquareBracket:"OpenSquareBracket",CloseSquareBracket:"CloseSquareBracket",OpenCurlyBracket:"OpenCurlyBracket",CloseCurlyBracket:"CloseCurlyBracket",Comma:"Comma",Dot:"Dot",Colon:"Colon",Pipe:"Pipe",CallOperator:"CallOperator",AdditiveBinaryOperator:"AdditiveBinaryOperator",MultiplicativeBinaryOperator:"MultiplicativeBinaryOperator",ComparisonBinaryOperator:"ComparisonBinaryOperator",UnaryOperator:"UnaryOperator",Set:"Set",If:"If",For:"For",In:"In",Is:"Is",NotIn:"NotIn",Else:"Else",EndIf:"EndIf",ElseIf:"ElseIf",EndFor:"EndFor",And:"And",Or:"Or",Not:"UnaryOperator"});Object.freeze({set:TOKEN_TYPES.Set,for:TOKEN_TYPES.For,in:TOKEN_TYPES.In,is:TOKEN_TYPES.Is,if:TOKEN_TYPES.If,else:TOKEN_TYPES.Else,endif:TOKEN_TYPES.EndIf,elif:TOKEN_TYPES.ElseIf,endfor:TOKEN_TYPES.EndFor,and:TOKEN_TYPES.And,or:TOKEN_TYPES.Or,not:TOKEN_TYPES.Not,"not in":TOKEN_TYPES.NotIn,true:TOKEN_TYPES.BooleanLiteral,false:TOKEN_TYPES.BooleanLiteral});TOKEN_TYPES.OpenStatement,TOKEN_TYPES.CloseStatement,TOKEN_TYPES.OpenExpression,TOKEN_TYPES.CloseExpression,TOKEN_TYPES.OpenParen,TOKEN_TYPES.CloseParen,TOKEN_TYPES.OpenCurlyBracket,TOKEN_TYPES.CloseCurlyBracket,TOKEN_TYPES.OpenSquareBracket,TOKEN_TYPES.CloseSquareBracket,TOKEN_TYPES.Comma,TOKEN_TYPES.Dot,TOKEN_TYPES.Colon,TOKEN_TYPES.Pipe,TOKEN_TYPES.ComparisonBinaryOperator,TOKEN_TYPES.ComparisonBinaryOperator,TOKEN_TYPES.ComparisonBinaryOperator,TOKEN_TYPES.ComparisonBinaryOperator,TOKEN_TYPES.ComparisonBinaryOperator,TOKEN_TYPES.ComparisonBinaryOperator,TOKEN_TYPES.AdditiveBinaryOperator,TOKEN_TYPES.AdditiveBinaryOperator,TOKEN_TYPES.MultiplicativeBinaryOperator,TOKEN_TYPES.MultiplicativeBinaryOperator,TOKEN_TYPES.MultiplicativeBinaryOperator,TOKEN_TYPES.Equals;const BYTES_TO_UNICODE=(()=>{const i=[...Array.from({length:94},(_e,lt)=>lt+33),...Array.from({length:12},(_e,lt)=>lt+161),...Array.from({length:82},(_e,lt)=>lt+174)],o=i.slice();let s=0;for(let _e=0;_e<256;++_e)i.includes(_e)||(i.push(_e),o.push(256+s),s+=1);const j=o.map(_e=>String.fromCharCode(_e));return Object.fromEntries(i.map((_e,lt)=>[_e,j[lt]]))})();reverseDictionary(BYTES_TO_UNICODE);const WHISPER_LANGUAGES=[["en","english"],["zh","chinese"],["de","german"],["es","spanish"],["ru","russian"],["ko","korean"],["fr","french"],["ja","japanese"],["pt","portuguese"],["tr","turkish"],["pl","polish"],["ca","catalan"],["nl","dutch"],["ar","arabic"],["sv","swedish"],["it","italian"],["id","indonesian"],["hi","hindi"],["fi","finnish"],["vi","vietnamese"],["he","hebrew"],["uk","ukrainian"],["el","greek"],["ms","malay"],["cs","czech"],["ro","romanian"],["da","danish"],["hu","hungarian"],["ta","tamil"],["no","norwegian"],["th","thai"],["ur","urdu"],["hr","croatian"],["bg","bulgarian"],["lt","lithuanian"],["la","latin"],["mi","maori"],["ml","malayalam"],["cy","welsh"],["sk","slovak"],["te","telugu"],["fa","persian"],["lv","latvian"],["bn","bengali"],["sr","serbian"],["az","azerbaijani"],["sl","slovenian"],["kn","kannada"],["et","estonian"],["mk","macedonian"],["br","breton"],["eu","basque"],["is","icelandic"],["hy","armenian"],["ne","nepali"],["mn","mongolian"],["bs","bosnian"],["kk","kazakh"],["sq","albanian"],["sw","swahili"],["gl","galician"],["mr","marathi"],["pa","punjabi"],["si","sinhala"],["km","khmer"],["sn","shona"],["yo","yoruba"],["so","somali"],["af","afrikaans"],["oc","occitan"],["ka","georgian"],["be","belarusian"],["tg","tajik"],["sd","sindhi"],["gu","gujarati"],["am","amharic"],["yi","yiddish"],["lo","lao"],["uz","uzbek"],["fo","faroese"],["ht","haitian creole"],["ps","pashto"],["tk","turkmen"],["nn","nynorsk"],["mt","maltese"],["sa","sanskrit"],["lb","luxembourgish"],["my","myanmar"],["bo","tibetan"],["tl","tagalog"],["mg","malagasy"],["as","assamese"],["tt","tatar"],["haw","hawaiian"],["ln","lingala"],["ha","hausa"],["ba","bashkir"],["jw","javanese"],["su","sundanese"]];new Map(WHISPER_LANGUAGES);async function loadConfig(i,o){return await getModelJSON(i,"config.json",!0,o)}class PretrainedConfig{constructor(o){this.model_type=null,this.is_encoder_decoder=!1,Object.assign(this,o)}static async from_pretrained(o,{progress_callback:s=null,config:j=null,cache_dir:_e=null,local_files_only:lt=!1,revision:tt="main"}={}){let ot=j??await loadConfig(o,{progress_callback:s,config:j,cache_dir:_e,local_files_only:lt,revision:tt});return new this(ot)}}class AutoConfig{static async from_pretrained(...o){return PretrainedConfig.from_pretrained(...o)}}class LogitsProcessorList extends Callable{constructor(){super(),this.processors=[]}push(o){this.processors.push(o)}extend(o){this.processors.push(...o)}_call(o,s){for(let j of s)this.processors.forEach(_e=>_e(o,j))}[Symbol.iterator](){return this.processors.values()}}class LogitsProcessor extends Callable{_call(o,s){throw Error("`_call` should be implemented in a subclass")}}class ForceTokensLogitsProcessor extends LogitsProcessor{constructor(o){super(),this.force_token_map=Object.fromEntries(o??[])}_call(o,s){let j=this.force_token_map[o.length];return exists(j)&&(s.data.fill(-1/0),s.data[j]=0),s}}class ForcedBOSTokenLogitsProcessor extends LogitsProcessor{constructor(o){super(),this.bos_token_id=o}_call(o,s){return o.length===1&&(s.data.fill(-1/0),s.data[this.bos_token_id]=0),s}}class ForcedEOSTokenLogitsProcessor extends LogitsProcessor{constructor(o,s){super(),this.max_length=o,this.forced_eos_token_id=s}_call(o,s){}}class SuppressTokensAtBeginLogitsProcessor extends LogitsProcessor{constructor(o,s){super(),this.begin_suppress_tokens=o,this.begin_index=s}_call(o,s){if(o.length===this.begin_index)for(let j of this.begin_suppress_tokens)s.data[j]=-1/0;return s}}class WhisperTimeStampLogitsProcessor extends LogitsProcessor{constructor(o){super(),this.eos_token_id=o.eos_token_id,this.no_timestamps_token_id=o.no_timestamps_token_id,this.timestamp_begin=this.no_timestamps_token_id+1,this.begin_index=(o.forced_decoder_ids||[]).length+2,o.forced_decoder_ids.slice(-1)[0][1]===this.no_timestamps_token_id&&(this.begin_index-=1),this.max_initial_timestamp_index=o.max_initial_timestamp_index}_call(o,s){const j=s.data;if(j[this.no_timestamps_token_id]=-1/0,o.length===this.begin_index-1)return j.fill(-1/0),j[this.timestamp_begin]=0,s;const _e=o.slice(this.begin_index),lt=_e.length>=1&&_e[_e.length-1]>=this.timestamp_begin,tt=_e.length<2||_e[_e.length-2]>=this.timestamp_begin;if(lt&&(tt?j.subarray(this.timestamp_begin).fill(-1/0):j.subarray(0,this.eos_token_id).fill(-1/0)),o.length===this.begin_index&&this.max_initial_timestamp_index!==null){const it=this.timestamp_begin+this.max_initial_timestamp_index;j.subarray(it+1).fill(-1/0)}const ot=log_softmax(j),st=Math.log(ot.subarray(this.timestamp_begin).map(Math.exp).reduce((it,$)=>it+$)),ct=max(ot.subarray(0,this.timestamp_begin))[0];return st>ct&&j.subarray(0,this.timestamp_begin).fill(-1/0),s}}class NoRepeatNGramLogitsProcessor extends LogitsProcessor{constructor(o){super(),this.no_repeat_ngram_size=o}getNgrams(o){const s=o.length,j=[];for(let lt=0;lt0&&(_e=_e.map(lt=>lt/this.generation_config.temperature)),_e}randomSelect(o){let s=o.reduce((_e,lt)=>_e+lt,0),j=Math.random()*s;for(let _e=0;_e1)return new BeamSearchSampler(o);if(o.num_return_sequences>1)throw Error(`num_return_sequences has to be 1 when doing greedy search, but is ${o.num_return_sequences}.`);return new GreedySampler(o)}}class GreedySampler extends Sampler{sample(o,s=-1){let j=this.getLogits(o,s);return[[max(j)[1],0]]}}class MultinomialSampler extends Sampler{sample(o,s=-1){let j=o.dims.at(-1);this.generation_config.top_k>0&&(j=Math.min(this.generation_config.top_k,j));const _e=this.getLogits(o,s),lt=getTopItems(_e,j),tt=softmax(lt.map(ot=>ot[1]));return Array.from({length:this.generation_config.num_beams},()=>{const ot=this.randomSelect(tt);return[lt[ot][0],Math.log(tt[ot])]})}}class BeamSearchSampler extends Sampler{sample(o,s=-1){let j=o.dims.at(-1);this.generation_config.top_k>0&&(j=Math.min(this.generation_config.top_k,j));const _e=this.getLogits(o,s),lt=getTopItems(_e,j),tt=softmax(lt.map(ot=>ot[1]));return Array.from({length:this.generation_config.num_beams},(ot,st)=>[lt[st][0],Math.log(tt[st])])}}const{InferenceSession,Tensor:ONNXTensor,env}=ONNX,MODEL_TYPES={EncoderOnly:0,EncoderDecoder:1,Seq2Seq:2,Vision2Seq:3,DecoderOnly:4,MaskGeneration:5},MODEL_TYPE_MAPPING=new Map,MODEL_NAME_TO_CLASS_MAPPING=new Map,MODEL_CLASS_TO_NAME_MAPPING=new Map;async function constructSession(i,o,s){let j=`onnx/${o}${s.quantized?"_quantized":""}.onnx`,_e=await getModelFile(i,j,!0,s);try{return await InferenceSession.create(_e,{executionProviders})}catch(lt){if(executionProviders.length===1&&executionProviders[0]==="wasm")throw lt;return console.warn(lt),console.warn("Something went wrong during model construction (most likely a missing operation). Using `wasm` as a fallback. "),await InferenceSession.create(_e,{executionProviders:["wasm"]})}}function validateInputs(i,o){const s=Object.create(null),j=[];for(const tt of i.inputNames){const ot=o[tt];if(!(ot instanceof Tensor)){j.push(tt);continue}s[tt]=env.wasm.proxy?ot.clone():ot}if(j.length>0)throw new Error(`An error occurred during model execution: "Missing the following inputs: ${j.join(", ")}.`);const _e=Object.keys(o).length,lt=i.inputNames.length;if(_e>lt){let tt=Object.keys(o).filter(ot=>!i.inputNames.includes(ot));console.warn(`WARNING: Too many inputs were provided (${_e} > ${lt}). The following inputs will be ignored: "${tt.join(", ")}".`)}return s}async function sessionRun(i,o){const s=validateInputs(i,o);try{let j=await i.run(s);return j=replaceTensors(j),j}catch(j){throw console.error(`An error occurred during model execution: "${j}".`),console.error("Inputs given to model:",s),j}}function replaceTensors(i){for(let o in i)i[o]instanceof ONNXTensor?i[o]=new Tensor(i[o]):typeof i[o]=="object"&&replaceTensors(i[o]);return i}function toI64Tensor(i){if(i instanceof Tensor)return i;if(i.length===0)throw Error("items must be non-empty");if(Array.isArray(i[0])){if(i.some(o=>o.length!==i[0].length))throw Error("Unable to create tensor, you should probably activate truncation and/or padding with 'padding=True' and/or 'truncation=True' to have batched tensors with the same length.");return new Tensor("int64",BigInt64Array.from(i.flat().map(o=>BigInt(o))),[i.length,i[0].length])}else return new Tensor("int64",BigInt64Array.from(i.map(o=>BigInt(o))),[1,i.length])}function prepareAttentionMask(i,o){let s=i.config.pad_token_id??null,j=i.config.eos_token_id??null;isIntegralNumber(j)&&(j=[j]);let _e=o.indexOf(s)!==-1,lt=j===null||!j.includes(s);if(_e&<){let tt=BigInt64Array.from(o.data.map(ot=>ot!=s));return new Tensor("int64",tt,o.dims)}else return ones_like(o)}function preparePositionIds(i,o,s){if(!i.inputNames.includes("position_ids"))return;const j=new BigInt64Array(o.attention_mask.data.length);for(let _e=0;_e0&<.push(new NoRepeatNGramLogitsProcessor(s.no_repeat_ngram_size)),s.bad_words_ids!==null&<.push(new NoBadWordsLogitsProcessor(s.bad_words_ids,s.eos_token_id)),s.min_length!==null&&s.eos_token_id!==null&&s.min_length>0&<.push(new MinLengthLogitsProcessor(s.min_length,s.eos_token_id)),s.min_new_tokens!==null&&s.eos_token_id!==null&&s.min_new_tokens>0&<.push(new MinNewTokensLengthLogitsProcessor(j,s.min_new_tokens,s.eos_token_id)),s.forced_bos_token_id!==null&<.push(new ForcedBOSTokenLogitsProcessor(s.forced_bos_token_id)),s.forced_eos_token_id!==null&<.push(new ForcedEOSTokenLogitsProcessor(s.max_length,s.forced_eos_token_id)),s.begin_suppress_tokens!==null){let tt=j>1||s.forced_bos_token_id===null?j:j+1;s.forced_decoder_ids!==null&&(tt+=s.forced_decoder_ids[s.forced_decoder_ids.length-1][0]),lt.push(new SuppressTokensAtBeginLogitsProcessor(s.begin_suppress_tokens,tt))}return s.forced_decoder_ids!==null&<.push(new ForceTokensLogitsProcessor(s.forced_decoder_ids)),_e!==null&<.extend(_e),lt}_get_generation_config(s){let j=new GenerationConfig(this.config);return"generation_config"in this&&Object.assign(j,this.generation_config),s!==null&&Object.assign(j,s),j}async generate(s,j=null,_e=null,{inputs_attention_mask:lt=null}={}){if(!this.can_generate){let dt=`The current model class (${MODEL_CLASS_TO_NAME_MAPPING.get(this.constructor)}) is not compatible with \`.generate()\`, as it doesn't have a language model head.`;const ut=this.config.model_type,bt=MODEL_WITH_LM_HEAD_MAPPING_NAMES.get(ut)??MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING_NAMES.get(ut)??MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING_NAMES.get(ut)??MODEL_FOR_VISION_2_SEQ_MAPPING_NAMES.get(ut);throw bt&&(dt+=` Please use the following class instead: '${bt[0]}'`),Error(dt)}if(!(s instanceof Tensor)&&!isTypedArray(s)&&!Array.isArray(s))throw Error(`\`inputs\` must be a Tensor, TypedArray, or Array, but is "${s.constructor.name}".`);let tt;if(this.config.is_encoder_decoder)tt=0;else if(tt=s instanceof Tensor?s.dims.at(-1):s.length,tt===0)throw Error("Must supply a non-empty array of input token ids.");j=this._get_generation_config(j),_e=_e??new LogitsProcessorList,_e=this._get_logits_processor(j,tt,_e);let ot=j.eos_token_id;ot!==null&&!Array.isArray(ot)&&(ot=[ot]);let st=1;const ct=st+(j.max_new_tokens??1/0),it=Number.isInteger(j.max_length)&&(j.max_new_tokens??null)===null;let $=Sampler.getSampler(j),a=this.getStartBeams(s,j,st,lt);for(;a.some(rt=>!rt.done)&&st=j.max_length){dt.done=!0,rt.push(dt);continue}let ut=await this.runBeam(dt);j.output_attentions&&this.addAttentionsToBeam(dt,ut),j.output_scores;let bt=ut.logits.slice(null,-1,null);_e(dt.output_token_ids,bt);let mt=$(bt);for(let[pt,Zt]of mt){let ht={...dt};this.updateBeam(ht,pt),ht.score+=Zt,ot&&ot.includes(pt)&&(ht.done=!0),rt.push(ht)}}++st,rt=this.groupBeams(rt).map(dt=>dt.sort((ut,bt)=>bt.score-ut.score).slice(0,j.num_beams)),a=rt.flat(),j.callback_function&&j.callback_function(a)}const et=this.groupBeams(a),nt=rt=>et.map(dt=>j.num_return_sequences>1?dt.slice(0,j.num_return_sequences).map(ut=>ut[rt]):[dt[0][rt]]).flat(),at=nt("output_token_ids");if(j.return_dict_in_generate){const rt=nt("decoder_attentions"),dt=nt("cross_attentions");return{sequences:at,decoder_attentions:rt,cross_attentions:dt}}else return at}addAttentionsToBeam(s,j){if(this.config.is_encoder_decoder){if(!j.cross_attentions||j.cross_attentions.length===0)throw Error("`output_attentions` is true, but the model did not produce cross-attentions. This is most likely because the model was not exported with `output_attentions=True`.");s.cross_attentions||(s.cross_attentions=[]),s.cross_attentions.push(j.cross_attentions)}if(!j.decoder_attentions||j.decoder_attentions.length===0)throw Error("`output_attentions` is true, but the model did not produce decoder-attentions. This is most likely because the model was not exported with `output_attentions=True`.");s.decoder_attentions||(s.decoder_attentions=[]),s.decoder_attentions.push(j.decoder_attentions)}groupBeams(s){const j=Object.create(null);for(const _e of s)j[_e.id]===void 0?j[_e.id]=[_e]:j[_e.id].push(_e);return Object.values(j)}getPastKeyValues(s,j){const _e=Object.create(null);for(const lt in s)if(lt.startsWith("present")){let tt=lt.replace("present","past_key_values");j&<.includes("encoder")?_e[tt]=j[tt]:_e[tt]=s[lt]}return _e}getAttentions(s){const j=Object.create(null);for(const _e of["cross_attentions","decoder_attentions"]){const lt=[];for(const tt in s)if(tt.startsWith(_e)){const ot=tt.split(".").pop();lt[ot]=s[tt]}j[_e]=lt}return j}addPastKeyValues(s,j){if(j)Object.assign(s,j);else if(this.config.is_encoder_decoder&&(this.add_encoder_pkv??!0)){let lt=[1,this.num_encoder_heads,0,this.encoder_dim_kv],tt=[1,this.num_decoder_heads,0,this.decoder_dim_kv];for(let ot=0;ot{let $=Array.from({length:this.config.decoder_layers},(dt,ut)=>cat(it.map(bt=>bt[ut]),2)),a=stack(j.map(([dt,ut])=>_e?$[dt].slice(null,ut,null,[0,_e]):$[dt].slice(null,ut)));a=a.transpose(1,0,2,3);let[et,nt]=std_mean(a,-2,0,!0),at=a.clone();for(let dt=0;dta[ut+1]-a[ut]),at=mergeArrays([1],nt).map(dt=>!!dt),rt=[];for(let dt=0;dt_e*lt,1);o.input_labels=new Tensor("int64",new BigInt64Array(j).fill(1n),s)}return await sessionRun(this.prompt_encoder_mask_decoder,{input_points:o.input_points,input_labels:o.input_labels,image_embeddings:o.image_embeddings,image_positional_embeddings:o.image_positional_embeddings})}async _call(o){return new SamImageSegmentationOutput(await super._call(o))}}class SamImageSegmentationOutput extends ModelOutput{constructor({iou_scores:o,pred_masks:s}){super(),this.iou_scores=o,this.pred_masks=s}}class MarianPreTrainedModel extends PreTrainedModel{}class MarianModel extends MarianPreTrainedModel{}class MarianMTModel extends MarianPreTrainedModel{constructor(o,s,j,_e){super(o,s),this.decoder_merged_session=j,this.generation_config=_e,this.num_decoder_layers=this.config.decoder_layers,this.num_decoder_heads=this.config.decoder_attention_heads,this.decoder_dim_kv=this.config.d_model/this.num_decoder_heads,this.num_encoder_layers=this.config.encoder_layers,this.num_encoder_heads=this.config.encoder_attention_heads,this.encoder_dim_kv=this.config.d_model/this.num_encoder_heads}}class M2M100PreTrainedModel extends PreTrainedModel{}class M2M100Model extends M2M100PreTrainedModel{}class M2M100ForConditionalGeneration extends M2M100PreTrainedModel{constructor(o,s,j,_e){super(o,s),this.decoder_merged_session=j,this.generation_config=_e,this.num_decoder_layers=this.config.decoder_layers,this.num_decoder_heads=this.config.decoder_attention_heads,this.decoder_dim_kv=this.config.d_model/this.num_decoder_heads,this.num_encoder_layers=this.config.encoder_layers,this.num_encoder_heads=this.config.encoder_attention_heads,this.encoder_dim_kv=this.config.d_model/this.num_encoder_heads}}class Wav2Vec2PreTrainedModel extends PreTrainedModel{}class Wav2Vec2Model extends Wav2Vec2PreTrainedModel{}class Wav2Vec2ForCTC extends Wav2Vec2PreTrainedModel{async _call(o){return new CausalLMOutput(await super._call(o))}}class Wav2Vec2ForSequenceClassification extends Wav2Vec2PreTrainedModel{async _call(o){return new SequenceClassifierOutput(await super._call(o))}}class Wav2Vec2ForAudioFrameClassification extends Wav2Vec2PreTrainedModel{async _call(o){return new TokenClassifierOutput(await super._call(o))}}class UniSpeechPreTrainedModel extends PreTrainedModel{}class UniSpeechModel extends UniSpeechPreTrainedModel{}class UniSpeechForCTC extends UniSpeechPreTrainedModel{async _call(o){return new CausalLMOutput(await super._call(o))}}class UniSpeechForSequenceClassification extends UniSpeechPreTrainedModel{async _call(o){return new SequenceClassifierOutput(await super._call(o))}}class UniSpeechSatPreTrainedModel extends PreTrainedModel{}class UniSpeechSatModel extends UniSpeechSatPreTrainedModel{}class UniSpeechSatForCTC extends UniSpeechSatPreTrainedModel{async _call(o){return new CausalLMOutput(await super._call(o))}}class UniSpeechSatForSequenceClassification extends UniSpeechSatPreTrainedModel{async _call(o){return new SequenceClassifierOutput(await super._call(o))}}class UniSpeechSatForAudioFrameClassification extends UniSpeechSatPreTrainedModel{async _call(o){return new TokenClassifierOutput(await super._call(o))}}class Wav2Vec2BertPreTrainedModel extends PreTrainedModel{}class Wav2Vec2BertModel extends Wav2Vec2BertPreTrainedModel{}class Wav2Vec2BertForCTC extends Wav2Vec2BertPreTrainedModel{async _call(o){return new CausalLMOutput(await super._call(o))}}class Wav2Vec2BertForSequenceClassification extends Wav2Vec2BertPreTrainedModel{async _call(o){return new SequenceClassifierOutput(await super._call(o))}}class HubertModel extends Wav2Vec2PreTrainedModel{}class HubertForCTC extends Wav2Vec2PreTrainedModel{async _call(o){return new CausalLMOutput(await super._call(o))}}class HubertForSequenceClassification extends Wav2Vec2PreTrainedModel{async _call(o){return new SequenceClassifierOutput(await super._call(o))}}class WavLMPreTrainedModel extends PreTrainedModel{}class WavLMModel extends WavLMPreTrainedModel{}class WavLMForCTC extends WavLMPreTrainedModel{async _call(o){return new CausalLMOutput(await super._call(o))}}class WavLMForSequenceClassification extends WavLMPreTrainedModel{async _call(o){return new SequenceClassifierOutput(await super._call(o))}}class WavLMForXVector extends WavLMPreTrainedModel{async _call(o){return new XVectorOutput(await super._call(o))}}class WavLMForAudioFrameClassification extends WavLMPreTrainedModel{async _call(o){return new TokenClassifierOutput(await super._call(o))}}class SpeechT5PreTrainedModel extends PreTrainedModel{}class SpeechT5ForSpeechToText extends SpeechT5PreTrainedModel{}class SpeechT5ForTextToSpeech extends SpeechT5PreTrainedModel{constructor(o,s,j,_e){super(o,s),this.decoder_merged_session=j,this.generation_config=_e,this.num_decoder_layers=this.config.decoder_layers,this.num_decoder_heads=this.config.decoder_attention_heads,this.decoder_dim_kv=this.config.hidden_size/this.num_decoder_heads,this.num_encoder_layers=this.config.encoder_layers,this.num_encoder_heads=this.config.encoder_attention_heads,this.encoder_dim_kv=this.config.hidden_size/this.num_encoder_heads}async generate_speech(o,s,{threshold:j=.5,minlenratio:_e=0,maxlenratio:lt=20,vocoder:tt=null}={}){const ot={input_ids:o},{encoder_outputs:st,encoder_attention_mask:ct}=await encoderForward(this,ot),it=st.dims[1]/this.config.reduction_factor,$=Math.floor(it*lt),a=Math.floor(it*_e),et=this.config.num_mel_bins;let nt=[],at=null,rt=null,dt=0;for(;;){++dt;const mt=boolTensor(!!rt);let pt;rt?pt=rt.output_sequence_out:pt=new Tensor("float32",new Float32Array(et),[1,1,et]);let Zt={use_cache_branch:mt,output_sequence:pt,encoder_attention_mask:ct,speaker_embeddings:s,encoder_hidden_states:st};this.addPastKeyValues(Zt,at),rt=await sessionRun(this.decoder_merged_session,Zt),at=this.getPastKeyValues(rt,at);const{prob:ht,spectrum:Gt}=rt;if(nt.push(Gt),dt>=a&&(Array.from(ht.data).filter(Xt=>Xt>=j).length>0||dt>=$))break}const ut=cat(nt),{waveform:bt}=await sessionRun(tt.session,{spectrogram:ut});return{spectrogram:ut,waveform:bt}}}class SpeechT5HifiGan extends PreTrainedModel{constructor(){super(...arguments);fn(this,"main_input_name","spectrogram")}}class TrOCRPreTrainedModel extends PreTrainedModel{constructor(o,s,j){super(o,s),this.generation_config=j,this.config.pad_token_id=this.config.eos_token_id,this.num_encoder_layers=this.num_decoder_layers=this.config.decoder_layers,this.num_encoder_heads=this.num_decoder_heads=this.config.decoder_attention_heads,this.encoder_dim_kv=this.decoder_dim_kv=this.config.d_model/this.num_decoder_heads}}class TrOCRForCausalLM extends TrOCRPreTrainedModel{}class MistralPreTrainedModel extends PreTrainedModel{constructor(o,s,j){super(o,s),this.generation_config=j,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.num_key_value_heads,this.num_layers=this.config.num_hidden_layers,this.dim_kv=this.config.hidden_size/this.config.num_attention_heads}}class MistralModel extends MistralPreTrainedModel{}class MistralForCausalLM extends MistralPreTrainedModel{}class Starcoder2PreTrainedModel extends PreTrainedModel{constructor(o,s,j){super(o,s),this.generation_config=j,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.num_key_value_heads,this.num_layers=this.config.num_hidden_layers,this.dim_kv=this.config.hidden_size/this.config.num_attention_heads}}class Starcoder2Model extends Starcoder2PreTrainedModel{}class Starcoder2ForCausalLM extends Starcoder2PreTrainedModel{}class FalconPreTrainedModel extends PreTrainedModel{constructor(o,s,j){super(o,s),this.generation_config=j,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.num_attention_heads,this.num_layers=this.config.num_hidden_layers,this.dim_kv=this.config.hidden_size/this.config.num_attention_heads}}class FalconModel extends FalconPreTrainedModel{}class FalconForCausalLM extends FalconPreTrainedModel{}class ClapPreTrainedModel extends PreTrainedModel{}class ClapModel extends ClapPreTrainedModel{}class ClapTextModelWithProjection extends ClapPreTrainedModel{static async from_pretrained(o,s={}){return s.model_file_name??(s.model_file_name="text_model"),super.from_pretrained(o,s)}}class ClapAudioModelWithProjection extends ClapPreTrainedModel{static async from_pretrained(o,s={}){return s.model_file_name??(s.model_file_name="audio_model"),super.from_pretrained(o,s)}}class VitsPreTrainedModel extends PreTrainedModel{}class VitsModel extends VitsPreTrainedModel{async _call(o){return new VitsModelOutput(await super._call(o))}}class SegformerPreTrainedModel extends PreTrainedModel{}class SegformerForImageClassification extends SegformerPreTrainedModel{}class SegformerForSemanticSegmentation extends SegformerPreTrainedModel{}class StableLmPreTrainedModel extends PreTrainedModel{constructor(o,s,j){super(o,s),this.generation_config=j,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.num_attention_heads,this.num_layers=this.config.num_hidden_layers,this.dim_kv=this.config.hidden_size/this.num_heads}}class StableLmForCausalLM extends StableLmPreTrainedModel{}class EfficientNetPreTrainedModel extends PreTrainedModel{}class EfficientNetModel extends EfficientNetPreTrainedModel{}class EfficientNetForImageClassification extends EfficientNetPreTrainedModel{async _call(o){return new SequenceClassifierOutput(await super._call(o))}}class PretrainedMixin{static async from_pretrained(o,{quantized:s=!0,progress_callback:j=null,config:_e=null,cache_dir:lt=null,local_files_only:tt=!1,revision:ot="main",model_file_name:st=null}={}){let ct={quantized:s,progress_callback:j,config:_e,cache_dir:lt,local_files_only:tt,revision:ot,model_file_name:st};if(_e=await AutoConfig.from_pretrained(o,ct),ct.config||(ct.config=_e),!this.MODEL_CLASS_MAPPINGS)throw new Error("`MODEL_CLASS_MAPPINGS` not implemented for this type of `AutoClass`: "+this.name);for(let it of this.MODEL_CLASS_MAPPINGS){const $=it.get(_e.model_type);if($)return await $[1].from_pretrained(o,ct)}if(this.BASE_IF_FAIL)return console.warn(`Unknown model class "${_e.model_type}", attempting to construct from base class.`),await PreTrainedModel.from_pretrained(o,ct);throw Error(`Unsupported model type: ${_e.model_type}`)}}fn(PretrainedMixin,"MODEL_CLASS_MAPPINGS",null),fn(PretrainedMixin,"BASE_IF_FAIL",!1);const MODEL_MAPPING_NAMES_ENCODER_ONLY=new Map([["bert",["BertModel",BertModel]],["nomic_bert",["NomicBertModel",NomicBertModel]],["roformer",["RoFormerModel",RoFormerModel]],["electra",["ElectraModel",ElectraModel]],["esm",["EsmModel",EsmModel]],["convbert",["ConvBertModel",ConvBertModel]],["camembert",["CamembertModel",CamembertModel]],["deberta",["DebertaModel",DebertaModel]],["deberta-v2",["DebertaV2Model",DebertaV2Model]],["mpnet",["MPNetModel",MPNetModel]],["albert",["AlbertModel",AlbertModel]],["distilbert",["DistilBertModel",DistilBertModel]],["roberta",["RobertaModel",RobertaModel]],["xlm",["XLMModel",XLMModel]],["xlm-roberta",["XLMRobertaModel",XLMRobertaModel]],["clap",["ClapModel",ClapModel]],["clip",["CLIPModel",CLIPModel]],["clipseg",["CLIPSegModel",CLIPSegModel]],["chinese_clip",["ChineseCLIPModel",ChineseCLIPModel]],["siglip",["SiglipModel",SiglipModel]],["mobilebert",["MobileBertModel",MobileBertModel]],["squeezebert",["SqueezeBertModel",SqueezeBertModel]],["wav2vec2",["Wav2Vec2Model",Wav2Vec2Model]],["wav2vec2-bert",["Wav2Vec2BertModel",Wav2Vec2BertModel]],["unispeech",["UniSpeechModel",UniSpeechModel]],["unispeech-sat",["UniSpeechSatModel",UniSpeechSatModel]],["hubert",["HubertModel",HubertModel]],["wavlm",["WavLMModel",WavLMModel]],["audio-spectrogram-transformer",["ASTModel",ASTModel]],["vits",["VitsModel",VitsModel]],["detr",["DetrModel",DetrModel]],["table-transformer",["TableTransformerModel",TableTransformerModel]],["vit",["ViTModel",ViTModel]],["mobilevit",["MobileViTModel",MobileViTModel]],["owlvit",["OwlViTModel",OwlViTModel]],["owlv2",["Owlv2Model",Owlv2Model]],["beit",["BeitModel",BeitModel]],["deit",["DeiTModel",DeiTModel]],["convnext",["ConvNextModel",ConvNextModel]],["convnextv2",["ConvNextV2Model",ConvNextV2Model]],["dinov2",["Dinov2Model",Dinov2Model]],["resnet",["ResNetModel",ResNetModel]],["swin",["SwinModel",SwinModel]],["swin2sr",["Swin2SRModel",Swin2SRModel]],["donut-swin",["DonutSwinModel",DonutSwinModel]],["yolos",["YolosModel",YolosModel]],["dpt",["DPTModel",DPTModel]],["glpn",["GLPNModel",GLPNModel]],["hifigan",["SpeechT5HifiGan",SpeechT5HifiGan]],["efficientnet",["EfficientNetModel",EfficientNetModel]]]),MODEL_MAPPING_NAMES_ENCODER_DECODER=new Map([["t5",["T5Model",T5Model]],["longt5",["LongT5Model",LongT5Model]],["mt5",["MT5Model",MT5Model]],["bart",["BartModel",BartModel]],["mbart",["MBartModel",MBartModel]],["marian",["MarianModel",MarianModel]],["whisper",["WhisperModel",WhisperModel]],["m2m_100",["M2M100Model",M2M100Model]],["blenderbot",["BlenderbotModel",BlenderbotModel]],["blenderbot-small",["BlenderbotSmallModel",BlenderbotSmallModel]]]),MODEL_MAPPING_NAMES_DECODER_ONLY=new Map([["bloom",["BloomModel",BloomModel]],["gpt2",["GPT2Model",GPT2Model]],["gptj",["GPTJModel",GPTJModel]],["gpt_bigcode",["GPTBigCodeModel",GPTBigCodeModel]],["gpt_neo",["GPTNeoModel",GPTNeoModel]],["gpt_neox",["GPTNeoXModel",GPTNeoXModel]],["codegen",["CodeGenModel",CodeGenModel]],["llama",["LlamaModel",LlamaModel]],["qwen2",["Qwen2Model",Qwen2Model]],["phi",["PhiModel",PhiModel]],["mpt",["MptModel",MptModel]],["opt",["OPTModel",OPTModel]],["mistral",["MistralModel",MistralModel]],["starcoder2",["Starcoder2Model",Starcoder2Model]],["falcon",["FalconModel",FalconModel]]]),MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING_NAMES=new Map([["speecht5",["SpeechT5ForSpeechToText",SpeechT5ForSpeechToText]],["whisper",["WhisperForConditionalGeneration",WhisperForConditionalGeneration]]]),MODEL_FOR_TEXT_TO_SPECTROGRAM_MAPPING_NAMES=new Map([["speecht5",["SpeechT5ForTextToSpeech",SpeechT5ForTextToSpeech]]]),MODEL_FOR_TEXT_TO_WAVEFORM_MAPPING_NAMES=new Map([["vits",["VitsModel",VitsModel]]]),MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING_NAMES=new Map([["bert",["BertForSequenceClassification",BertForSequenceClassification]],["roformer",["RoFormerForSequenceClassification",RoFormerForSequenceClassification]],["electra",["ElectraForSequenceClassification",ElectraForSequenceClassification]],["esm",["EsmForSequenceClassification",EsmForSequenceClassification]],["convbert",["ConvBertForSequenceClassification",ConvBertForSequenceClassification]],["camembert",["CamembertForSequenceClassification",CamembertForSequenceClassification]],["deberta",["DebertaForSequenceClassification",DebertaForSequenceClassification]],["deberta-v2",["DebertaV2ForSequenceClassification",DebertaV2ForSequenceClassification]],["mpnet",["MPNetForSequenceClassification",MPNetForSequenceClassification]],["albert",["AlbertForSequenceClassification",AlbertForSequenceClassification]],["distilbert",["DistilBertForSequenceClassification",DistilBertForSequenceClassification]],["roberta",["RobertaForSequenceClassification",RobertaForSequenceClassification]],["xlm",["XLMForSequenceClassification",XLMForSequenceClassification]],["xlm-roberta",["XLMRobertaForSequenceClassification",XLMRobertaForSequenceClassification]],["bart",["BartForSequenceClassification",BartForSequenceClassification]],["mbart",["MBartForSequenceClassification",MBartForSequenceClassification]],["mobilebert",["MobileBertForSequenceClassification",MobileBertForSequenceClassification]],["squeezebert",["SqueezeBertForSequenceClassification",SqueezeBertForSequenceClassification]]]),MODEL_FOR_TOKEN_CLASSIFICATION_MAPPING_NAMES=new Map([["bert",["BertForTokenClassification",BertForTokenClassification]],["roformer",["RoFormerForTokenClassification",RoFormerForTokenClassification]],["electra",["ElectraForTokenClassification",ElectraForTokenClassification]],["esm",["EsmForTokenClassification",EsmForTokenClassification]],["convbert",["ConvBertForTokenClassification",ConvBertForTokenClassification]],["camembert",["CamembertForTokenClassification",CamembertForTokenClassification]],["deberta",["DebertaForTokenClassification",DebertaForTokenClassification]],["deberta-v2",["DebertaV2ForTokenClassification",DebertaV2ForTokenClassification]],["mpnet",["MPNetForTokenClassification",MPNetForTokenClassification]],["distilbert",["DistilBertForTokenClassification",DistilBertForTokenClassification]],["roberta",["RobertaForTokenClassification",RobertaForTokenClassification]],["xlm",["XLMForTokenClassification",XLMForTokenClassification]],["xlm-roberta",["XLMRobertaForTokenClassification",XLMRobertaForTokenClassification]]]),MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING_NAMES=new Map([["t5",["T5ForConditionalGeneration",T5ForConditionalGeneration]],["longt5",["LongT5ForConditionalGeneration",LongT5ForConditionalGeneration]],["mt5",["MT5ForConditionalGeneration",MT5ForConditionalGeneration]],["bart",["BartForConditionalGeneration",BartForConditionalGeneration]],["mbart",["MBartForConditionalGeneration",MBartForConditionalGeneration]],["marian",["MarianMTModel",MarianMTModel]],["m2m_100",["M2M100ForConditionalGeneration",M2M100ForConditionalGeneration]],["blenderbot",["BlenderbotForConditionalGeneration",BlenderbotForConditionalGeneration]],["blenderbot-small",["BlenderbotSmallForConditionalGeneration",BlenderbotSmallForConditionalGeneration]]]),MODEL_WITH_LM_HEAD_MAPPING_NAMES=new Map([["bloom",["BloomForCausalLM",BloomForCausalLM]],["gpt2",["GPT2LMHeadModel",GPT2LMHeadModel]],["gptj",["GPTJForCausalLM",GPTJForCausalLM]],["gpt_bigcode",["GPTBigCodeForCausalLM",GPTBigCodeForCausalLM]],["gpt_neo",["GPTNeoForCausalLM",GPTNeoForCausalLM]],["gpt_neox",["GPTNeoXForCausalLM",GPTNeoXForCausalLM]],["codegen",["CodeGenForCausalLM",CodeGenForCausalLM]],["llama",["LlamaForCausalLM",LlamaForCausalLM]],["qwen2",["Qwen2ForCausalLM",Qwen2ForCausalLM]],["phi",["PhiForCausalLM",PhiForCausalLM]],["mpt",["MptForCausalLM",MptForCausalLM]],["opt",["OPTForCausalLM",OPTForCausalLM]],["mbart",["MBartForCausalLM",MBartForCausalLM]],["mistral",["MistralForCausalLM",MistralForCausalLM]],["starcoder2",["Starcoder2ForCausalLM",Starcoder2ForCausalLM]],["falcon",["FalconForCausalLM",FalconForCausalLM]],["trocr",["TrOCRForCausalLM",TrOCRForCausalLM]],["stablelm",["StableLmForCausalLM",StableLmForCausalLM]]]),MODEL_FOR_MASKED_LM_MAPPING_NAMES=new Map([["bert",["BertForMaskedLM",BertForMaskedLM]],["roformer",["RoFormerForMaskedLM",RoFormerForMaskedLM]],["electra",["ElectraForMaskedLM",ElectraForMaskedLM]],["esm",["EsmForMaskedLM",EsmForMaskedLM]],["convbert",["ConvBertForMaskedLM",ConvBertForMaskedLM]],["camembert",["CamembertForMaskedLM",CamembertForMaskedLM]],["deberta",["DebertaForMaskedLM",DebertaForMaskedLM]],["deberta-v2",["DebertaV2ForMaskedLM",DebertaV2ForMaskedLM]],["mpnet",["MPNetForMaskedLM",MPNetForMaskedLM]],["albert",["AlbertForMaskedLM",AlbertForMaskedLM]],["distilbert",["DistilBertForMaskedLM",DistilBertForMaskedLM]],["roberta",["RobertaForMaskedLM",RobertaForMaskedLM]],["xlm",["XLMWithLMHeadModel",XLMWithLMHeadModel]],["xlm-roberta",["XLMRobertaForMaskedLM",XLMRobertaForMaskedLM]],["mobilebert",["MobileBertForMaskedLM",MobileBertForMaskedLM]],["squeezebert",["SqueezeBertForMaskedLM",SqueezeBertForMaskedLM]]]),MODEL_FOR_QUESTION_ANSWERING_MAPPING_NAMES=new Map([["bert",["BertForQuestionAnswering",BertForQuestionAnswering]],["roformer",["RoFormerForQuestionAnswering",RoFormerForQuestionAnswering]],["electra",["ElectraForQuestionAnswering",ElectraForQuestionAnswering]],["convbert",["ConvBertForQuestionAnswering",ConvBertForQuestionAnswering]],["camembert",["CamembertForQuestionAnswering",CamembertForQuestionAnswering]],["deberta",["DebertaForQuestionAnswering",DebertaForQuestionAnswering]],["deberta-v2",["DebertaV2ForQuestionAnswering",DebertaV2ForQuestionAnswering]],["mpnet",["MPNetForQuestionAnswering",MPNetForQuestionAnswering]],["albert",["AlbertForQuestionAnswering",AlbertForQuestionAnswering]],["distilbert",["DistilBertForQuestionAnswering",DistilBertForQuestionAnswering]],["roberta",["RobertaForQuestionAnswering",RobertaForQuestionAnswering]],["xlm",["XLMForQuestionAnswering",XLMForQuestionAnswering]],["xlm-roberta",["XLMRobertaForQuestionAnswering",XLMRobertaForQuestionAnswering]],["mobilebert",["MobileBertForQuestionAnswering",MobileBertForQuestionAnswering]],["squeezebert",["SqueezeBertForQuestionAnswering",SqueezeBertForQuestionAnswering]]]),MODEL_FOR_VISION_2_SEQ_MAPPING_NAMES=new Map([["vision-encoder-decoder",["VisionEncoderDecoderModel",VisionEncoderDecoderModel]]]),MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING_NAMES=new Map([["vit",["ViTForImageClassification",ViTForImageClassification]],["mobilevit",["MobileViTForImageClassification",MobileViTForImageClassification]],["beit",["BeitForImageClassification",BeitForImageClassification]],["deit",["DeiTForImageClassification",DeiTForImageClassification]],["convnext",["ConvNextForImageClassification",ConvNextForImageClassification]],["convnextv2",["ConvNextV2ForImageClassification",ConvNextV2ForImageClassification]],["dinov2",["Dinov2ForImageClassification",Dinov2ForImageClassification]],["resnet",["ResNetForImageClassification",ResNetForImageClassification]],["swin",["SwinForImageClassification",SwinForImageClassification]],["segformer",["SegformerForImageClassification",SegformerForImageClassification]],["efficientnet",["EfficientNetForImageClassification",EfficientNetForImageClassification]]]),MODEL_FOR_OBJECT_DETECTION_MAPPING_NAMES=new Map([["detr",["DetrForObjectDetection",DetrForObjectDetection]],["table-transformer",["TableTransformerForObjectDetection",TableTransformerForObjectDetection]],["yolos",["YolosForObjectDetection",YolosForObjectDetection]]]),MODEL_FOR_ZERO_SHOT_OBJECT_DETECTION_MAPPING_NAMES=new Map([["owlvit",["OwlViTForObjectDetection",OwlViTForObjectDetection]],["owlv2",["Owlv2ForObjectDetection",Owlv2ForObjectDetection]]]),MODEL_FOR_IMAGE_SEGMENTATION_MAPPING_NAMES=new Map([["detr",["DetrForSegmentation",DetrForSegmentation]],["clipseg",["CLIPSegForImageSegmentation",CLIPSegForImageSegmentation]]]),MODEL_FOR_SEMANTIC_SEGMENTATION_MAPPING_NAMES=new Map([["segformer",["SegformerForSemanticSegmentation",SegformerForSemanticSegmentation]]]),MODEL_FOR_MASK_GENERATION_MAPPING_NAMES=new Map([["sam",["SamModel",SamModel]]]),MODEL_FOR_CTC_MAPPING_NAMES=new Map([["wav2vec2",["Wav2Vec2ForCTC",Wav2Vec2ForCTC]],["wav2vec2-bert",["Wav2Vec2BertForCTC",Wav2Vec2BertForCTC]],["unispeech",["UniSpeechForCTC",UniSpeechForCTC]],["unispeech-sat",["UniSpeechSatForCTC",UniSpeechSatForCTC]],["wavlm",["WavLMForCTC",WavLMForCTC]],["hubert",["HubertForCTC",HubertForCTC]]]),MODEL_FOR_AUDIO_CLASSIFICATION_MAPPING_NAMES=new Map([["wav2vec2",["Wav2Vec2ForSequenceClassification",Wav2Vec2ForSequenceClassification]],["wav2vec2-bert",["Wav2Vec2BertForSequenceClassification",Wav2Vec2BertForSequenceClassification]],["unispeech",["UniSpeechForSequenceClassification",UniSpeechForSequenceClassification]],["unispeech-sat",["UniSpeechSatForSequenceClassification",UniSpeechSatForSequenceClassification]],["wavlm",["WavLMForSequenceClassification",WavLMForSequenceClassification]],["hubert",["HubertForSequenceClassification",HubertForSequenceClassification]],["audio-spectrogram-transformer",["ASTForAudioClassification",ASTForAudioClassification]]]),MODEL_FOR_AUDIO_XVECTOR_MAPPING_NAMES=new Map([["wavlm",["WavLMForXVector",WavLMForXVector]]]),MODEL_FOR_AUDIO_FRAME_CLASSIFICATION_MAPPING_NAMES=new Map([["unispeech-sat",["UniSpeechSatForAudioFrameClassification",UniSpeechSatForAudioFrameClassification]],["wavlm",["WavLMForAudioFrameClassification",WavLMForAudioFrameClassification]],["wav2vec2",["Wav2Vec2ForAudioFrameClassification",Wav2Vec2ForAudioFrameClassification]]]),MODEL_FOR_IMAGE_MATTING_MAPPING_NAMES=new Map([["vitmatte",["VitMatteForImageMatting",VitMatteForImageMatting]]]),MODEL_FOR_IMAGE_TO_IMAGE_MAPPING_NAMES=new Map([["swin2sr",["Swin2SRForImageSuperResolution",Swin2SRForImageSuperResolution]]]),MODEL_FOR_DEPTH_ESTIMATION_MAPPING_NAMES=new Map([["dpt",["DPTForDepthEstimation",DPTForDepthEstimation]],["depth_anything",["DepthAnythingForDepthEstimation",DepthAnythingForDepthEstimation]],["glpn",["GLPNForDepthEstimation",GLPNForDepthEstimation]]]),MODEL_FOR_IMAGE_FEATURE_EXTRACTION_MAPPING_NAMES=new Map([["clip",["CLIPVisionModelWithProjection",CLIPVisionModelWithProjection]],["siglip",["SiglipVisionModel",SiglipVisionModel]]]),MODEL_CLASS_TYPE_MAPPING=[[MODEL_MAPPING_NAMES_ENCODER_ONLY,MODEL_TYPES.EncoderOnly],[MODEL_MAPPING_NAMES_ENCODER_DECODER,MODEL_TYPES.EncoderDecoder],[MODEL_MAPPING_NAMES_DECODER_ONLY,MODEL_TYPES.DecoderOnly],[MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING_NAMES,MODEL_TYPES.EncoderOnly],[MODEL_FOR_TOKEN_CLASSIFICATION_MAPPING_NAMES,MODEL_TYPES.EncoderOnly],[MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING_NAMES,MODEL_TYPES.Seq2Seq],[MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING_NAMES,MODEL_TYPES.Seq2Seq],[MODEL_WITH_LM_HEAD_MAPPING_NAMES,MODEL_TYPES.DecoderOnly],[MODEL_FOR_MASKED_LM_MAPPING_NAMES,MODEL_TYPES.EncoderOnly],[MODEL_FOR_QUESTION_ANSWERING_MAPPING_NAMES,MODEL_TYPES.EncoderOnly],[MODEL_FOR_VISION_2_SEQ_MAPPING_NAMES,MODEL_TYPES.Vision2Seq],[MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING_NAMES,MODEL_TYPES.EncoderOnly],[MODEL_FOR_IMAGE_SEGMENTATION_MAPPING_NAMES,MODEL_TYPES.EncoderOnly],[MODEL_FOR_SEMANTIC_SEGMENTATION_MAPPING_NAMES,MODEL_TYPES.EncoderOnly],[MODEL_FOR_IMAGE_MATTING_MAPPING_NAMES,MODEL_TYPES.EncoderOnly],[MODEL_FOR_IMAGE_TO_IMAGE_MAPPING_NAMES,MODEL_TYPES.EncoderOnly],[MODEL_FOR_DEPTH_ESTIMATION_MAPPING_NAMES,MODEL_TYPES.EncoderOnly],[MODEL_FOR_OBJECT_DETECTION_MAPPING_NAMES,MODEL_TYPES.EncoderOnly],[MODEL_FOR_ZERO_SHOT_OBJECT_DETECTION_MAPPING_NAMES,MODEL_TYPES.EncoderOnly],[MODEL_FOR_MASK_GENERATION_MAPPING_NAMES,MODEL_TYPES.MaskGeneration],[MODEL_FOR_CTC_MAPPING_NAMES,MODEL_TYPES.EncoderOnly],[MODEL_FOR_AUDIO_CLASSIFICATION_MAPPING_NAMES,MODEL_TYPES.EncoderOnly],[MODEL_FOR_TEXT_TO_SPECTROGRAM_MAPPING_NAMES,MODEL_TYPES.Seq2Seq],[MODEL_FOR_TEXT_TO_WAVEFORM_MAPPING_NAMES,MODEL_TYPES.EncoderOnly],[MODEL_FOR_AUDIO_XVECTOR_MAPPING_NAMES,MODEL_TYPES.EncoderOnly],[MODEL_FOR_AUDIO_FRAME_CLASSIFICATION_MAPPING_NAMES,MODEL_TYPES.EncoderOnly],[MODEL_FOR_IMAGE_FEATURE_EXTRACTION_MAPPING_NAMES,MODEL_TYPES.EncoderOnly]];for(const[i,o]of MODEL_CLASS_TYPE_MAPPING)for(const[s,j]of i.values())MODEL_TYPE_MAPPING.set(s,o),MODEL_CLASS_TO_NAME_MAPPING.set(j,s),MODEL_NAME_TO_CLASS_MAPPING.set(s,j);const CUSTOM_MAPPING=[["CLIPTextModelWithProjection",CLIPTextModelWithProjection,MODEL_TYPES.EncoderOnly],["SiglipTextModel",SiglipTextModel,MODEL_TYPES.EncoderOnly],["ClapTextModelWithProjection",ClapTextModelWithProjection,MODEL_TYPES.EncoderOnly],["ClapAudioModelWithProjection",ClapAudioModelWithProjection,MODEL_TYPES.EncoderOnly]];for(const[i,o,s]of CUSTOM_MAPPING)MODEL_TYPE_MAPPING.set(i,s),MODEL_CLASS_TO_NAME_MAPPING.set(o,i),MODEL_NAME_TO_CLASS_MAPPING.set(i,o);class AutoModel extends PretrainedMixin{}fn(AutoModel,"MODEL_CLASS_MAPPINGS",MODEL_CLASS_TYPE_MAPPING.map(o=>o[0])),fn(AutoModel,"BASE_IF_FAIL",!0);class Seq2SeqLMOutput extends ModelOutput{constructor({logits:o,past_key_values:s,encoder_outputs:j,decoder_attentions:_e=null,cross_attentions:lt=null}){super(),this.logits=o,this.past_key_values=s,this.encoder_outputs=j,this.decoder_attentions=_e,this.cross_attentions=lt}}class SequenceClassifierOutput extends ModelOutput{constructor({logits:o}){super(),this.logits=o}}class XVectorOutput extends ModelOutput{constructor({logits:o,embeddings:s}){super(),this.logits=o,this.embeddings=s}}class TokenClassifierOutput extends ModelOutput{constructor({logits:o}){super(),this.logits=o}}class MaskedLMOutput extends ModelOutput{constructor({logits:o}){super(),this.logits=o}}class QuestionAnsweringModelOutput extends ModelOutput{constructor({start_logits:o,end_logits:s}){super(),this.start_logits=o,this.end_logits=s}}class CausalLMOutput extends ModelOutput{constructor({logits:o}){super(),this.logits=o}}class ImageMattingOutput extends ModelOutput{constructor({alphas:o}){super(),this.alphas=o}}class VitsModelOutput extends ModelOutput{constructor({waveform:o,spectrogram:s}){super(),this.waveform=o,this.spectrogram=s}}const BROWSER_ENV=typeof self<"u";if(!BROWSER_ENV){if(!sharp)throw new Error("Unable to load image processing library.")}const encodedJs="dmFyIGZuPU9iamVjdC5kZWZpbmVQcm9wZXJ0eTt2YXIgbW49KG50LGQsdCk9PmQgaW4gbnQ/Zm4obnQsZCx7ZW51bWVyYWJsZTohMCxjb25maWd1cmFibGU6ITAsd3JpdGFibGU6ITAsdmFsdWU6dH0pOm50W2RdPXQ7dmFyIEs9KG50LGQsdCk9PihtbihudCx0eXBlb2YgZCE9InN5bWJvbCI/ZCsiIjpkLHQpLHQpOyhmdW5jdGlvbigpeyJ1c2Ugc3RyaWN0Ijt2YXIgbnQ7ZnVuY3Rpb24gX21lcmdlTmFtZXNwYWNlcyhkLHQpe3JldHVybiB0LmZvckVhY2goZnVuY3Rpb24ocil7ciYmdHlwZW9mIHIhPSJzdHJpbmciJiYhQXJyYXkuaXNBcnJheShyKSYmT2JqZWN0LmtleXMocikuZm9yRWFjaChmdW5jdGlvbihvKXtpZihvIT09ImRlZmF1bHQiJiYhKG8gaW4gZCkpe3ZhciB1PU9iamVjdC5nZXRPd25Qcm9wZXJ0eURlc2NyaXB0b3IocixvKTtPYmplY3QuZGVmaW5lUHJvcGVydHkoZCxvLHUuZ2V0P3U6e2VudW1lcmFibGU6ITAsZ2V0OmZ1bmN0aW9uKCl7cmV0dXJuIHJbb119fSl9fSl9KSxPYmplY3QuZnJlZXplKGQpfWZ1bmN0aW9uIGRpc3BhdGNoQ2FsbGJhY2soZCx0KXtkJiZkKHQpfWZ1bmN0aW9uIHJldmVyc2VEaWN0aW9uYXJ5KGQpe3JldHVybiBPYmplY3QuZnJvbUVudHJpZX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HkgKgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2ZWMyKCR7ZVswXX0sICR7ZVsxXX0pKTsKICAgICAgICAgIHJldHVybiAyICogKHJlc1RleFJDLnkgKiAke2VbMF19ICsgcmVzVGV4UkMueCk7CiAgICAgICAgfQogICAgICBgLG5ldyB1Lkdsc2xMaWJSb3V0aW5lKGkpKX1nZXRPdXRwdXRQYWNrZWQyRENvb3JkcyhsLG4pe2xldCBlPSIiO2lmKG8uQXJyYXlVdGlsLmFycmF5c0VxdWFsKGwsbikpcmV0dXJuIGU9YAogICAgICAgIGl2ZWMyIGdldE91dHB1dENvb3JkcygpIHsKICAgICAgICAgIHJldHVybiAyICogaXZlYzIoVGV4Q29vcmRzLnh5ICogdmVjMigke25bMF19LCAke25bMV19KSk7CiAgICAgICAgfQogICAgICBgLG5ldyB1Lkdsc2xMaWJSb3V0aW5lKGUpO2NvbnN0IGk9bixzPU1hdGguY2VpbChsWzFdLzIpO3JldHVybiBlPWAKICAgICAgICBpdmVjMiBnZXRPdXRwdXRDb29yZHMoKSB7CiAgICAgICAgICBpdmVjMiByZXNUZXhSQyA9IGl2ZWMyKFRleENvb3Jkcy54eSAqCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmVjMigke2lbMF19LCAke2lbMV19KSk7CgogICAgICAgICAgaW50IGluZGV4ID0gcmVzVGV4UkMueSAqICR7aVswXX0gKyByZXNUZXhSQy54OwoKICAgICAgICAgIC8vIHJldmVyc2UgciBhbmQgYyBvcmRlciBmb3IgcGFja2VkIHRleHR1cmUKICAgICAgICAgIGludCByID0gaW1vZChpbmRleCwgJHtzfSkgKiAyOwogICAgICAgICAgaW50IGMgPSAyICogKGluZGV4IC8gJHtzfSk7CgogICAgICAgICAgcmV0dXJuIGl2ZWMyKHIsIGMpOwogICAgICAgIH0KICAgICAgYCxuZXcgdS5HbHNsTGliUm91dGluZShlKX1nZXRPdXRwdXRQYWNrZWQzRENvb3JkcyhsLG4pe2NvbnN0IGU9W25bMF0sblsxXV0saT1NYXRoLmNlaWwobFsyXS8yKSxzPWkqTWF0aC5jZWlsKGxbMV0vMiksZj1gCiAgICAgICAgaXZlYzMgZ2V0T3V0cHV0Q29vcmRzKCkgewogICAgICAgICAgaXZlYzIgcmVzVGV4UkMgPSBpdmVjMihUZXhDb29yZHMueHkgKgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZlYzIoJHtlWzBdfSwgJHtlWzFdfSkpOwogICAgICAgICAgaW50IGluZGV4ID0gcmVzVGV4UkMueSAqICR7ZVswXX0gKyByZXNUZXhSQy54OwoKICAgICAgICAgIGludCBiID0gaW5kZXggLyAke3N9OwogICAgICAgICAgaW5kZXggLT0gYiAqICR7c307CgogICAgICAgICAgLy8gcmV2ZXJzZSByIGFuZCBjIG9yZGVyIGZvciBwYWNrZWQgdGV4dHVyZQogICAgICAgICAgaW50IHIgPSBpbW9kKGluZGV4LCAke2l9KSAqIDI7CiAgICAgICAgICBpbnQgYyA9IDIgKiAoaW5kZXggLyAke2l9KTsKCiAgICAgICAgICByZXR1cm4gaXZlYzMoYiwgciwgYyk7CiAgICAgICAgfQogICAgICBgO3JldHVybiBuZXcgdS5HbHNsTGliUm91dGluZShmKX1nZXRPdXRwdXRQYWNrZWRORENvb3JkcyhsLG4pe2NvbnN0IGU9W25bMF0sblsxXV0saT1NYXRoLmNlaWwobFtsLmxlbmd0aC0xXS8yKSxzPWkqTWF0aC5jZWlsKGxbbC5sZW5ndGgtMl0vMik7bGV0IGY9cyxnPSIiLF89ImIsIHIsIGMiO2ZvcihsZXQgeT0yO3k8bC5sZW5ndGgtMTt5KyspZio9bFtsLmxlbmd0aC15LTFdLGc9YAogICAgICBpbnQgYiR7eX0gPSBpbmRleCAvICR7Zn07CiAgICAgIGluZGV4IC09IGIke3l9ICogJHtmfTsKICAgIGArZyxfPWBiJHt5fSwgYCtfO2NvbnN0IGI9YAogICAgICBpdmVjJHtsLmxlbmd0aH0gZ2V0T3V0cHV0Q29vcmRzKCkgewogICAgICAgIGl2ZWMyIHJlc1RleFJDID0gaXZlYzIoVGV4Q29vcmRzLnh5ICoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmVjMigke2VbMF19LCAke2VbMV19KSk7CiAgICAgICAgaW50IGluZGV4ID0gcmVzVGV4UkMueSAqICR7ZVswXX0gKyByZXNUZXhSQy54OwoKICAgICAgICAke2d9CgogICAgICAgIGludCBiID0gaW5kZXggLyAke3N9OwogICAgICAgIGluZGV4IC09IGIgKiAke3N9OwoKICAgICAgICAvLyByZXZlcnNlIHIgYW5kIGMgb3JkZXIgZm9yIHBhY2tlZCB0ZXh0dXJlCiAgICAgICAgaW50IHIgPSBpbW9kKGluZGV4LCAke2l9KSAqIDI7CiAgICAgICAgaW50IGMgPSAyICogKGluZGV4IC8gJHtpfSk7CgogICAgICAgIHJldHVybiBpdmVjJHtsLmxlbmd0aH0oJHtffSk7CiAgICAgIH0KICAgIGA7cmV0dXJuIG5ldyB1Lkdsc2xMaWJSb3V0aW5lKGIpfWdldE91dHB1dFVucGFja2VkMURDb29yZHMobCxuKXtjb25zdCBlPWAKICAgICAgICBpbnQgZ2V0T3V0cHV0Q29vcmRzKCkgewogICAgICAgICAgaXZlYzIgcmVzVGV4UkMgPSBpdmVjMihUZXhDb29yZHMueHkgKgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZlYzIoJHtuWzBdfSwgJHtuWzFdfSkpOwogICAgICAgICAgcmV0dXJuIHJlc1RleFJDLnkgKiAke25bMF19ICsgcmVzVGV4UkMueDsKICAgICAgICB9CiAgICAgIGA7cmV0dXJuIG5ldyB1Lkdsc2xMaWJSb3V0aW5lKGUpfWdldE91dHB1dFVucGFja2VkMkRDb29yZHMobCxuKXtjb25zdCBlPWAKICAgICAgICBpdmVjMiBnZXRPdXRwdXRDb29yZHMoKSB7CiAgICAgICAgICBpdmVjMiByZXNUZXhSQyA9IGl2ZWMyKFRleENvb3Jkcy54eSAqCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmVjMigke25bMF19LCAke25bMV19KSk7CiAgICAgICAgICBpbnQgaW5kZXggPSByZXNUZXhSQy55ICogJHtuWzBdfSArIHJlc1RleFJDLng7CiAgICAgICAgICBpbnQgciA9IGluZGV4IC8gJHtsWzFdfTsKICAgICAgICAgIGludCBjID0gaW5kZXggLSByICogJHtsWzFdfTsKICAgICAgICAgIHJldHVybiBpdmVjMihyLCBjKTsKICAgICAgICB9CiAgICAgIGA7cmV0dXJuIG5ldyB1Lkdsc2xMaWJSb3V0aW5lKGUpfWdldE91dHB1dFVucGFja2VkM0RDb29yZHMobCxuKXtsZXQgZT0iIjtjb25zdCBpPWwubGVuZ3RoO2xldCBzPW51bGw7aTwyJiYocz1bXSkscz1uZXcgQXJyYXkoaS0xKSxzW2ktMl09bFtpLTFdO2ZvcihsZXQgXz1pLTM7Xz49MDstLV8pc1tfXT1zW18rMV0qbFtfKzFdO2NvbnN0IGY9WyJyIiwiYyIsImQiXSxnPXMubWFwKChfLGIpPT5gaW50ICR7ZltiXX0gPSBpbmRleCAvICR7X307ICR7Yj09PXMubGVuZ3RoLTE/YGludCAke2ZbYisxXX0gPSBpbmRleCAtICR7ZltiXX0gKiAke199YDpgaW5kZXggLT0gJHtmW2JdfSAqICR7X31gfTtgKS5qb2luKCIiKTtyZXR1cm4gZT1gCiAgICAgICAgaXZlYzMgZ2V0T3V0cHV0Q29vcmRzKCkgewogICAgICAgICAgaXZlYzIgcmVzVGV4UkMgPSBpdmVjMihUZXhDb29yZHMueHkgKgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZlYzIoJHtuWzBdfSwgJHtuWzFdfSkpOwogICAgICAgICAgaW50IGluZGV4ID0gcmVzVGV4UkMueSAqICR7blswXX0gKyByZXNUZXhSQy54OwogICAgICAgICAgJHtnfQogICAgICAgICAgcmV0dXJuIGl2ZWMzKHIsIGMsIGQpOwogICAgICAgIH0KICAgICAgYCxuZXcgdS5HbHNsTGliUm91dGluZShlKX1nZXRPdXRwdXRVbnBhY2tlZDREQ29vcmRzKGwsbil7bGV0IGU9IiI7Y29uc3QgaT1sLmxlbmd0aDtsZXQgcz1udWxsO2k8MiYmKHM9W10pLHM9bmV3IEFycmF5KGktMSksc1tpLTJdPWxbaS0xXTtmb3IobGV0IF89aS0zO18+PTA7LS1fKXNbX109c1tfKzFdKmxbXysxXTtjb25zdCBmPVsiciIsImMiLCJkIiwiZDIiXSxnPXMubWFwKChfLGIpPT5gaW50ICR7ZltiXX0gPSBpbmRleCAvICR7X307ICR7Yj09PXMubGVuZ3RoLTE/YGludCAke2ZbYisxXX0gPSBpbmRleCAtICR7ZltiXX0gKiAke199YDpgaW5kZXggLT0gJHtmW2JdfSAqICR7X31gfTtgKS5qb2luKCIiKTtyZXR1cm4gZT1gCiAgICAgIGl2ZWM0IGdldE91dHB1dENvb3JkcygpIHsKICAgICAgICAgIGl2ZWMyIHJlc1RleFJDID0gaXZlYzIoVGV4Q29vcmRzLnh5ICoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2ZWMyKCR7blswXX0sICR7blsxXX0pKTsKICAgICAgICAgIGludCBpbmRleCA9IHJlc1RleFJDLnkgKiAke25bMF19ICsgcmVzVGV4UkMueDsKICAgICAgICAgICR7Z30KICAgICAgICAgIHJldHVybiBpdmVjNChyLCBjLCBkLCBkMik7CiAgICAgICAgfQogICAgICBgLG5ldyB1Lkdsc2xMaWJSb3V0aW5lKGUpfWdldE91dHB1dFVucGFja2VkNURDb29yZHMobCxuKXtsZXQgZT0iIjtjb25zdCBpPWwubGVuZ3RoO2xldCBzPW51bGw7aTwyJiYocz1bXSkscz1uZXcgQXJyYXkoaS0xKSxzW2ktMl09bFtpLTFdO2ZvcihsZXQgXz1pLTM7Xz49MDstLV8pc1tfXT1zW18rMV0qbFtfKzFdO2NvbnN0IGY9WyJyIiwiYyIsImQiLCJkMiIsImQzIl0sZz1zLm1hcCgoXyxiKT0+YGludCAke2ZbYl19ID0gaW5kZXggLyAke199OyAke2I9PT1zLmxlbmd0aC0xP2BpbnQgJHtmW2IrMV19ID0gaW5kZXggLSAke2ZbYl19ICogJHtffWA6YGluZGV4IC09ICR7ZltiXX0gKiAke199YH07YCkuam9pbigiIik7cmV0dXJuIGU9YAogICAgICBpdmVjNSBnZXRPdXRwdXRDb29yZHMoKSB7CiAgICAgICAgICBpdmVjMiByZXNUZXhSQyA9IGl2ZWMyKFRleENvb3Jkcy54eSAqCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmVjMigke25bMF19LCAke25bMV19KSk7CiAgICAgICAgICBpbnQgaW5kZXggPSByZXNUZXhSQy55ICogJHtuWzBdfSArIHJlc1RleFJDLng7CiAgICAgICAgICAke2d9CiAgICAgICAgICByZXR1cm4gaXZlYzUociwgYywgZCwgZDIsIGQzKTsKICAgICAgICB9CiAgICAgIGAsbmV3IHUuR2xzbExpYlJvdXRpbmUoZSl9Z2V0T3V0cHV0VW5wYWNrZWQ2RENvb3JkcyhsLG4pe2xldCBlPSIiO2NvbnN0IGk9bC5sZW5ndGg7bGV0IHM9bnVsbDtpPDImJihzPVtdKSxzPW5ldyBBcnJheShpLTEpLHNbaS0yXT1sW2ktMV07Zm9yKGxldCBfPWktMztfPj0wOy0tXylzW19dPXNbXysxXSpsW18rMV07Y29uc3QgZj1bInIiLCJjIiwiZCIsImQyIiwiZDMiLCJkNCJdLGc9cy5tYXAoKF8sYik9PmBpbnQgJHtmW2JdfSA9IGluZGV4IC8gJHtffTsgJHtiPT09cy5sZW5ndGgtMT9gaW50ICR7ZltiKzFdfSA9IGluZGV4IC0gJHtmW2JdfSAqICR7X31gOmBpbmRleCAtPSAke2ZbYl19ICogJHtffWB9O2ApLmpvaW4oIiIpO3JldHVybiBlPWAKICAgICBpdmVjNiBnZXRPdXRwdXRDb29yZHMoKSB7CiAgICAgICAgIGl2ZWMyIHJlc1RleFJDID0gaXZlYzIoVGV4Q29vcmRzLnh5ICoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH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51bUM7CiAgICAgICAgcmV0dXJuICh2ZWMyKHRleEMsIHRleFIpICsgaGFsZkNSKSAvIHZlYzIodGV4TnVtQywgdGV4TnVtUik7CiAgICAgIH0KICAgICAgYCksbj0icGFja2VkVVZmcm9tMkQiLGxbbl09bmV3IHUuR2xzbExpYlJvdXRpbmUoYAogICAgICB2ZWMyIHBhY2tlZFVWZnJvbTJEKGludCB0ZXhOdW1SLCBpbnQgdGV4TnVtQywgaW50IHRleGVsc0luTG9naWNhbFJvdywgaW50IHJvdywgaW50IGNvbCkgewogICAgICAgIGludCB0ZXhlbEluZGV4ID0gKHJvdyAvIDIpICogdGV4ZWxzSW5Mb2dpY2FsUm93ICsgKGNvbCAvIDIpOwogICAgICAgIGludCB0ZXhSID0gdGV4ZWxJbmRleCAvIHRleE51bUM7CiAgICAgICAgaW50IHRleEMgPSB0ZXhlbEluZGV4IC0gdGV4UiAqIHRleE51bUM7CiAgICAgICAgcmV0dXJuICh2ZWMyKHRleEMsIHRleFIpICsgaGFsZkNSKSAvIHZlYzIodGV4TnVtQywgdGV4TnVtUik7CiAgICAgIH0KICAgICAgYCksbj0icGFja2VkVVZmcm9tM0QiLGxbbl09bmV3IHUuR2xzbExpYlJvdXRpbmUoYAogICAgICB2ZWMyIHBhY2tlZFVWZnJvbTNEKGludCB0ZXhOdW1SLCBpbnQgdGV4TnVtQywKICAgICAgICAgIGludCB0ZXhlbHNJbkJhdGNoLCBpbnQgdGV4ZWxzSW5Mb2dpY2FsUm93LCBpbnQgYiwKICAgICAgICAgIGludCByb3csIGludCBjb2wpIHsKICAgICAgICBpbnQgaW5kZXggPSBiICogdGV4ZWxzSW5CYXRjaCArIChyb3cgLyAyKSAqIHRleGVsc0luTG9naWNhbFJvdyArIChjb2wgLyAyKTsKICAgICAgICBpbnQgdGV4UiA9IGluZGV4IC8gdGV4TnVtQzsKICAgICAgICBpbnQgdGV4QyA9IGluZGV4IC0gdGV4UiAqIHRleE51bUM7CiAgICAgICAgcmV0dXJuICh2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ldHVybiBzYW1wbGVUZXh0dXJlKCR7bn0sIHV2KTsKICAgICAgICAgIH0KICAgICAgICBgO3JldHVybiBuZXcgdS5HbHNsTGliUm91dGluZSh3LFsiY29vcmRpbmF0ZXMuc2FtcGxlVGV4dHVyZSIsImNvb3JkaW5hdGVzLmNvb3Jkc1RvT2Zmc2V0Il0pfWlmKGI9PT0xKXtjb25zdCB3PWAKICAgICAgICAgIGZsb2F0ICR7bH0oaW50IHJvdywgaW50IGNvbCkgewogICAgICAgICAgICBpbnQgb2Zmc2V0XyR7bn0gPSBjb29yZHNUb09mZnNldChUZXhDb29yZHMsICR7Yn0sICR7eX0pOwogICAgICAgICAgICBmbG9hdCBpbmRleCA9IGRvdCh2ZWMzKHJvdywgY29sLCBvZmZzZXRfJHtufSksIHZlYzMoJHtpWzFdfSwgMSwgMSkpOwogICAgICAgICAgICB2ZWMyIHV2ID0gdmVjMigoaW5kZXggKyAwLjUpIC8gJHt5fS4wLCAwLjUpOwogICAgICAgICAgICByZXR1cm4gc2FtcGxlVGV4dHVyZSgke259LCB1dik7CiAgICAgICAgICB9CiAgICAgICAgYDtyZXR1cm4gbmV3IHUuR2xzbExpYlJvdXRpbmUodyxbImNvb3JkaW5hdGVzLnNhbXBsZVRleHR1cmUiLCJjb29yZGluYXRlcy5jb29yZHNUb09mZnNldCJdKX1jb25zdCBUPWAKICAgICAgICBmbG9hdCAke2x9KGludCByb3csIGludCBjb2wpIHsKICAgICAgICAgIGludCBpbmRleCA9IGNvbCAqICR7aVsxXX0gKyByb3c7CiAgICAgICAgICB2ZWMyIHV2ID0gdXZGcm9tRmxhdCgke2J9LCAke3l9LCBpbmRleCk7CiAgICAgICAgICByZXR1cm4gc2FtcGxlVGV4dHVyZSgke259LCB1dik7CiAgICAgICAgfQogICAgICBgO3JldHVybiBuZXcgdS5HbHNsTGliUm91dGluZShULFsiY29vcmRpbmF0ZXMudXZGcm9tRmxhdCIsImNvb3JkaW5hdGVzLnNhbXBsZVRleHR1cmUiLCJ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fQogICAgICB9CiAgICAgIGB9aW5jcmVtZW50SW5kaWNlcygpe2NvbnN0IGE9e307cmV0dXJuIHRoaXMuY29udGV4dC5wcm9ncmFtSW5mby5pbnB1dE5hbWVzLmZvckVhY2goKHAsbSk9Pntjb25zdCBjPXRoaXMuY29udGV4dC5pbnB1dFRleHR1cmVMYXlvdXRzW21dLnNoYXBlLGw9Yy5sZW5ndGgsbj1gaW5jcmVtZW50SW5kaWNlc18ke3B9YDtsZXQgZT0iIjtmb3IobGV0IHM9MDtzPGw7KytzKWUrPWAKICAgICAgICBzaGFwZVske3N9XSA9ICR7Y1tzXX07YDtjb25zdCBpPWAKICAgICAgICB2b2lkICR7bn0oaW50IGF4aXMsIG91dCBpbnQgaW5kaWNlc1ske2x9XSkgewogICAgICAgICAgaW50IHNoYXBlWyR7bH1dOwogICAgICAgICAgJHtlfTsKICAgICAgICAgIGZvcihpbnQgaSA9ICR7bH0gLTEgOyBpID49IDA7IC0taSkgewogICAgICAgICAgICBpZihpID4gYXhpcykgY29udGludWU7CiAgICAgICAgICAgIGluZGljZXNbaV0gKz0gMTsKICAgICAgICAgICAgaWYoaW5kaWNlc1tpXSA8IHNoYXBlW2ldKSB7CiAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgaW5kaWNlc1tpXSA9IDA7CiAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGA7YVtuXT1uZXcgby5HbHNsTGliUm91dGluZShpKX0pLGF9fXQuU2hhcGVVdGlsc0dsc2xMaWI9dX0sNTA2MDooZCx0KT0+e09iamVjdC5kZWZpbmVQcm9wZXJ0eSh0LCJfX2VzTW9kdWxlIix7dmFsdWU6ITB9KSx0LmdldERlZmF1bHRGcmFnU2hhZGVyTWFpbj10LmdldEZyYWdTaGFkZXJQcmVhbWJsZT10LmdldFZlcnRleFNoYWRlclNvdXJjZT10LmdldEdsc2w9dm9pZCAwO2NvbnN0IHI9e3ZlcnNpb246IiIsYXR0cmlidXRl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wIHNhbXBsZXIyRDsKICAgICR7YS52YXJ5aW5nRnJhZ30gdmVjMiBUZXhDb29yZHM7CiAgICAke2Eub3V0cHV0RGVjbGFyYXRpb259CiAgICBjb25zdCB2ZWMyIGhhbGZDUiA9IHZlYzIoMC41LCAwLjUpOwoKICAgIC8vIEN1c3RvbSB2ZWN0b3IgdHlwZXMgdG8gaGFuZGxlIGhpZ2hlciBkaW1lbmFsaXRpZXMuCiAgICBzdHJ1Y3QgaXZlYzUKICAgIHsKICAgICAgaW50IHg7CiAgICAgIGludCB5OwogICAgICBpbnQgejsKICAgICAgaW50IHc7CiAgICAgIGludCB1OwogICAgfTsKCiAgICBzdHJ1Y3QgaXZlYzYKICAgIHsKICAgICAgaW50IHg7CiAgICAgIGludCB5OwogICAgICBpbnQgejsKICAgICAgaW50IHc7CiAgICAgIGludCB1OwogICAgICBpbnQgdjsKICAgIH07CgogICAgaW50IGltb2QoaW50IHgsIGludCB5KSB7CiAgICAgIHJldHVybiB4IC0geSAqICh4IC8geSk7CiAgICB9CgogICAgYH0sdC5nZXREZWZhdWx0RnJhZ1NoYWRlck1haW49ZnVuY3Rpb24oaCxhKXtyZXR1cm5gCiAgdm9pZCBtYWluKCkgewogICAgaW50IGluZGljZXNbJHthfV07CiAgICB0b1ZlYyhUZXhDb29yZHMsIGluZGljZXMpOwogICAgdmVjNCByZXN1bHQgPSB2ZWM0KHByb2Nlc3MoaW5kaWNlcykpOwogICAgJHt1KGgpLm91dHB1dH0gPSByZXN1bHQ7CiAgfQogIGB9fSwzODkxOihkLHQscik9PntPYmplY3QuZGVmaW5lUHJvcGVydHkodCwiX19lc01vZHVsZSIse3ZhbHVlOiEwfSksdC5WZWNHbHNsTGliPXZvaWQgMDtjb25zdCBvPXIoODUyMCk7Y2xhc3MgdSBleHRlbmRzIG8uR2xzbExpYntjb25zdHJ1Y3RvcihhKXtzdXBlcihhKX1nZXRDdXN0b21UeXBlcygpe3JldHVybnt9fWdldEZ1bmN0aW9ucygpe3JldHV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VGV4dHVyZUxheW91dC5zaGFwZS5sZW5ndGg7bGV0IHA9YAogICAgICAgIGlmKGluZGV4IDwgMCkKICAgICAgICAgICAgaW5kZXggPSR7YX0gKyBpbmRleDsKICAgICAgICBpZiAoaW5kZXggPT0gMCkKICAgICAgICAgICAgbVswXSA9IHZhbHVlOwogICAgICAgIGA7Zm9yKGxldCBjPTE7YzxhLTE7KytjKXArPWAKICAgICAgICBlbHNlIGlmIChpbmRleCA9PSAke2N9KQogICAgICAgICAgICBtWyR7Y31dID0gdmFsdWU7CiAgICAgICAgICAgIGA7cCs9YAogICAgICAgIGVsc2UKICAgICAgICAgICAgbVske2EtMX1dID0gdmFsdWU7CiAgICAgICAgYDtjb25zdCBtPWAKICAgICAgdm9pZCBzZXRWZWNJdGVtKG91dCBpbnQgbVske2F9XSwgaW50IGluZGV4LCBpbnQgdmFsdWUpIHsKICAgICAgICAke3B9CiAgICAgIH0KICAgICAgICBgO3JldHVybntzZXRWZWNJdGVtOm5ldyBvLkdsc2xMaWJSb3V0aW5lKG0pfX1nZXRWZWNJdGVtKCl7Y29uc3QgYT10aGlzLmNvbnRleHQub3V0cHV0VGV4dHVyZUxheW91dC5zaGFwZS5sZW5ndGg7bGV0IHA9YAogICAgICAgIGlmKGluZGV4IDwgMCkKICAgICAgICAgICAgaW5kZXggPSAke2F9ICsgaW5kZXg7CiAgICAgICAgaWYgKGluZGV4ID09IDApCiAgICAgICAgICAgIHJldHVybiBtWzBdOwogICAgICBgO2ZvcihsZXQgYz0xO2M8YS0xOysrYylwKz1gCiAgICAgICAgZWxzZSBpZiAoaW5kZXggPT0gJHtjfSkKICAgICAgICAgICAgcmV0dXJuIG1bJHtjfV07CiAgICAgIGA7cCs9YAogICAgICAgIGVsc2UKICAgICAgICAgICAgcmV0dXJuIG1bJHthLTF9XTsKICAgICAgICBgO2NvbnN0IG09YAogICAgICBpbnQgZ2V0VmVjSXRlbShpbnQgbVske2F9XSwgaW50IGluZGV4KSB7CiAgICAgICAgJHtw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gICAgICAgICAgIHJldHVybiBnZXRDaGFubmVsKAogICAgICAgICAgICAgICAgZ2V0WCR7R30oJHtwKHYsJCxlZSl9KSwKICAgICAgICAgICAgICAgIHZlYzIoJHtwKHosJCxlZSl9KSk7CiAgICAgICAgICAgIH1gfWNvbnN0IEQ9TS5sZW5ndGgsaz1NW00ubGVuZ3RoLTFdO04rPWAKICAgICAgICAgICAgcmV0dXJuIGdldENoYW5uZWwoCiAgICAgICAgICAgICAgZ2V0WCR7RH0oJHtwKHYsJCxrKX0pLAogICAgICAgICAgICAgIHZlYzIoJHtwKHosJCxrKX0pKTtgO2NvbnN0IEY9KDAsby5nZXRHbHNsKShzLnNlc3Npb24uYmFja2VuZC5nbENvbnRleHQudmVyc2lvbiksWD1gCiAgICAgICAgICAke0V9CiAgICAgICAgICBmbG9hdCBnZXRWYWx1ZSgke3YubWFwKEc9PiJpbnQgIitHKX0pIHsKICAgICAgICAgICAgJHtOfQogICAgICAgICAgfQoKICAgICAgICAgIHZvaWQgbWFpbigpIHsKICAgICAgICAgICAgJHt4fSBjb29yZHMgPSBnZXRPdXRwdXRDb29yZHMoKTsKICAgICAgICAgICAgaW50IGxhc3REaW0gPSBjb29yZHMuJHt2W1QtMV19OwogICAgICAgICAgICBjb29yZHMuJHt2W1QtMV19ID0gY29vcmRzLiR7dltULTJdfTsKICAgICAgICAgICAgY29vcmRzLiR7dltULTJdfSA9IGxhc3REaW07CgogICAgICAgICAgICB2ZWM0IHJlc3VsdCA9IHZlYzQoZ2V0VmFsdWUoJHt3fSksIDAuLCAwLiwgMC4pOwoKICAgICAgICAgICAgJHt3W1QtMV19ID0gJHt3W1QtMV19ICsgMTsKICAgICAgICAgICAgaWYgKCR7d1tULTFdfSA8ICR7eVtULTFdfSkgewogICAgICAgICAgICAgIHJlc3VsdC5nID0gZ2V0VmFsdWUoJHt3fSk7CiAgICAgICAgICAgIH0KCiAgICAgICAgICAgICR7d1tULTJdfSA9ICR7d1tULTJdfSArIDE7CiAgICAgICA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VsdChpLGUudHJhbnNBLHMsZS50cmFuc0Isbi5sZW5ndGg9PT0zP25bMl0uZGltczp2b2lkIDApLF89W2YsZ107aWYoIV8pdGhyb3cgbmV3IEVycm9yKCJDYW4ndCB1c2UgZ2VtbSBvbiB0aGUgZ2l2ZW4gdGVuc29ycyIpO2xldCBiPWlbaS5sZW5ndGgtMV0seT0iIjtlLnRyYW5zQSYmKGI9aVswXSksZS50cmFuc0EmJmUudHJhbnNCP3k9InZhbHVlICs9IF9BX1QoYSkgKiBfQl9UKGIpOyI6ZS50cmFuc0EmJiFlLnRyYW5zQj95PSJ2YWx1ZSArPSBfQV9UKGEpICogX0IoYik7IjohZS50cmFuc0EmJmUudHJhbnNCP3k9InZhbHVlICs9IF9BKGEpICogX0JfVChiKTsiOmUudHJhbnNBfHxlLnRyYW5zQnx8KHk9InZhbHVlICs9IF9BKGEpICogX0IoYik7Iik7Y29uc3QgVD1fLmxlbmd0aCx3PWAKICAgICAgZmxvYXQgcHJvY2VzcyhpbnQgaW5kaWNlc1ske1R9XSkgewogICAgICAgICAgaW50IGFbJHtUfV07CiAgICAgICAgICBpbnQgYlske1R9XTsKICAgICAgICAgICR7bi5sZW5ndGg9PT0zP2BpbnQgY1ske25bMl0uZGltcy5sZW5ndGh9XTtgOiIifQoKICAgICAgICAgIGNvcHlWZWMoaW5kaWNlcywgYSk7CiAgICAgICAgICBjb3B5VmVjKGluZGljZXMsIGIpOwogICAgICAgICAgJHtuLmxlbmd0aD09PTM/ImJjYXN0SW5kaWNlc19DKGluZGljZXMsIGMpOyI6IiJ9CgogICAgICAgICAgZmxvYXQgdmFsdWUgPSAwLjA7CiAgICAgICAgICBmb3IgKGludCBrPTA7IGs8JHtifTsgKytrKSB7CiAgICAgICAgICAgICAgYVske1QtMX1dID0gazsKICAgICAgICAgICAgICBiWyR7VC0yfV0gPSBrOwogICAgICAgICAgICAgICR7eX0KICAgICAgICAgIH0KCiAgICAgICAgICB2YWx1ZSA9IHZhbHVlICogYWxwaGE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R7eFswXX0pIHsKICAgICAgICAgICAgICBvZmZzZXRZID0gaW50KGJsb2NrSW5kZXggLyAoJHtfW3ctMV19KSkgKiAke2Iuc3RyaWRlc1swXX0gLQogICAgICAgICAgICAgICAgJHtiLnBhZHNbMF19OwogICAgICAgICAgICAgIGQwID0gb2Zmc2V0WSArICR7Yi5kaWxhdGlvbnNbMF19ICogKGltb2QocG9zLCAke0V9KSAvICR7VFsyXX0pOwoKICAgICAgICAgICAgICBpZihkMCA8ICR7eVsyXX0gJiYgZDAgPj0gMCkgewogICAgICAgICAgICAgICAgb2Zmc2V0WCA9IGltb2QoYmxvY2tJbmRleCwgJHtfW3ctMV19KSAqICR7Yi5zdHJpZGVzWzFdfSAtCiAgICAgICAgICAgICAgICAgICR7Yi5wYWRzWzFdfTsKICAgICAgICAgICAgICAgIGQxID0gb2Zmc2V0WCArICR7Yi5kaWxhdGlvbnNbMV19ICogaW1vZChpbW9kKHBvcywgJHtFfSksICR7VFsyXX0pOwoKICAgICAgICAgICAgICAgIGlmKGQxIDwgJHt5WzNdfSAmJiBkMSA+PSAwKSB7CgogICAgICAgICAgICAgICAgICBjaCA9IGludChmbG9hdChwb3MpLyAke0V9Lik7CiAgICAgICAgICAgICAgICAgICAgaW5uZXJEaW1zID0gdmVjMihkMCwgZDEpOwogICAgICAgICAgICAgICAgICAgIHJlc3VsdFskezIqeitCfV0gPSBnZXRDaGFubmVsKAogICAgICAgICAgICAgICAgICAgICAgZ2V0QSgwLCBjaCwgaW50KGlubmVyRGltcy54KSwKICAgICAgICAgICAgICAgICAgICAgIGludChpbm5lckRpbXMueSkpLCBpbm5lckRpbXMpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQoKICAgICAgICAgIGA7Y29uc3QgJD1gCiAgICAgICR7UH0KCiAgICAgIHZvaWQgbWFpbigpIHsKICAgICAgICBpdmVjMiByYyA9IGdldE91dHB1dENvb3JkcygpOwogICAgICAgICAgdmVjNCByZXN1bHQ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ICAgICAgICBpZihwIDwgWENLSEtXKSB7CiAgICAgICAgICAgICAgaW50IHBhdGNoQyA9IHAgLyBLSEtXOwogICAgICAgICAgICAgIGludCBwYXRjaEggPSAocCAtIHBhdGNoQypLSEtXKSAvIEtXOwogICAgICAgICAgICAgIGludCBwYXRjaFcgPSAocCAtIHBhdGNoQypLSEtXKSAtIHBhdGNoSCAqIEtXOwogICAgICAgICAgICAgIGludCB4aDIgPSBvaCArIHBhdGNoSCAqIGRpbGF0aW9uSDsKICAgICAgICAgICAgICBpbnQgeHcyID0gb3cgKyBwYXRjaFcgKiBkaWxhdGlvblc7CiAgICAgICAgICAgICAgaW50IHhbJHtfLmxlbmd0aH1dOwogICAgICAgICAgICAgIHhbMF0gPSBiOwogICAgICAgICAgICAgIHhbMV0gPSBwYXRjaEM7CiAgICAgICAgICAgICAgeFsyXSA9IHhoMjsKICAgICAgICAgICAgICB4WzNdID0geHcyOwogICAgICAgICAgICAgIGlmKHhoMiA+PSAwICYmCiAgICAgICAgICAgICAgICAgIHhoMiA8IFhIICYmCiAgICAgICAgICAgICAgICAgIHh3MiA+PSAwICYmCiAgICAgICAgICAgICAgICAgIHh3MiA8IFhXKSB7CiAgICAgICAgICAgICAgICB2YWx1ZVtpXSA9IF9YKHgpOwogICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgICAgICArK3A7CiAgICAgICAgICB9CiAgICAgICAgICByZXR1cm4gdmFsdWU7CiAgICAgICAgfQogICAgICAgIGA7cmV0dXJuIE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSxlKSx7b3V0cHV0OntkaW1zOlQsdHlwZTppLnR5cGUsdGV4dHVyZVR5cGU6by5UZXh0dXJlVHlwZS5wYWNrZWRMYXN0RGltZW5zaW9ufSxzaGFkZXJTb3VyY2U6d30pfSkoMCxjLGgsYSxwLG0pfSl9LHQuY2FsY3VsYXRlSW0yQ29sRGltcz0odSxoLGEscD00KT0+W2FbMF0sYVsyXSxhWzNdLE1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hdCgke2cudGV4dHVyZTJEfShBLCBjb29yZHMpKTsKICAgICAgICByZXR1cm4gdmFsdWU7CiAgICAgIH0KICAgICAgYH0scz0oZyxfLGIseSxULHcpPT57Y29uc3QgeD1fLmxlbmd0aDtsZXQgRT0iIjtmb3IobGV0IFA9eC0xO1A+PTA7LS1QKUUrPWAKICAgICAgICBrID0gbVske1B9XSAtICR7d1tQXX07CiAgICAgICAgaWYgKGsgPCAwKSB7IGsgPSAtazsgfQogICAgICAgIHsKICAgICAgICAgIGNvbnN0IGludCBfMm5fMSA9ICR7MiooX1tQXS0xKX07CiAgICAgICAgICBrID0gaW50KCBtb2QoIGZsb2F0KGspLCBmbG9hdChfMm5fMSkgKSApIDsKICAgICAgICAgIGlmKGsgPj0gJHtfW1BdfSkgeyBrID0gXzJuXzEgLSBrOyB9CiAgICAgICAgfQogICAgICAgIG9mZnNldCArPSBrICogJHtiW1BdfTsKICAgICAgICBgO3JldHVybmAKICAgICAgZmxvYXQgcGFkQShpbnQgbVske3h9XSkgewogICAgICAgIGludCBvZmZzZXQgPSAwOwogICAgICAgIGludCBrID0gMDsKICAgICAgICAke0V9CiAgICAgICAgdmVjMiBjb29yZHMgPSBvZmZzZXRUb0Nvb3JkcyhvZmZzZXQsICR7eX0sICR7VH0pOwogICAgICAgIGZsb2F0IHZhbHVlID0gZ2V0Q29sb3JBc0Zsb2F0KCR7Zy50ZXh0dXJlMkR9KEEsIGNvb3JkcykpOwogICAgICAgIHJldHVybiB2YWx1ZTsKICAgICAgfQogICAgICBgfSxmPShnLF8sYix5LFQsdyk9Pntjb25zdCB4PV8ubGVuZ3RoO2xldCBFPSIiO2ZvcihsZXQgUD14LTE7UD49MDstLVApRSs9YAogICAgICAgIGsgPSBtWyR7UH1dIC0gJHt3W1BdfTsKICAgICAgICBpZiAoayA8IDApICBrID0gMDsKICAgICAgICBpZiAoayA+PSAke19bUF19KSBrID0gJHtfW1BdLTF9OwogICAgICAgIG9mZnNldCArPSBrICogJHtiW1BdfT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BpbnB1dCB0eXBlLiIpfSxlPShmLGcsXyxiLHkpPT57Y29uc3QgVD1mLmxlbmd0aDtpZihnLmtlcm5lbFNoYXBlLmxlbmd0aDw9Mil7Y29uc3Qgdz1nLmtlcm5lbFNoYXBlW2cua2VybmVsU2hhcGUubGVuZ3RoLTFdLHg9Zy5zdHJpZGVzW2cuc3RyaWRlcy5sZW5ndGgtMV0sRT1nLnBhZHNbZy5wYWRzLmxlbmd0aC8yLTFdLFA9Zy5wYWRzW2cucGFkcy5sZW5ndGgtMV0sdj1mW1QtMV07bGV0IE09IiIsJD0iIix6PSIiO2lmKE09RStQIT09MD9gCiAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8ICR7d307IGkrKykgewogICAgICAgICAgICB4WyR7VH0gLSAxXSA9IGluZGljZXNbJHtUfSAtIDFdICogJHt4fSAtICR7RX0gKyBpOwogICAgICAgICAgICBpZiAoeFske1R9IC0gMV0gPCAwIHx8IHhbJHtUfSAtIDFdID49ICR7dn0pIHsKICAgICAgICAgICAgICBwYWQrKzsKICAgICAgICAgICAgICBjb250aW51ZTsKICAgICAgICAgICAgfQogICAgICAgICAgICAke199CiAgICAgICAgICB9YDpgCiAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8ICR7d307IGkrKykgewogICAgICAgICAgICB4WyR7VH0gLSAxXSA9IGluZGljZXNbJHtUfSAtIDFdICogJHt4fSAtICR7RX0gKyBpOwogICAgICAgICAgICAke199CiAgICAgICAgICB9YCxnLmtlcm5lbFNoYXBlLmxlbmd0aD09PTIpe2NvbnN0IEI9Zy5rZXJuZWxTaGFwZVtnLmtlcm5lbFNoYXBlLmxlbmd0aC0yXSxOPWcuc3RyaWRlc1tnLnN0cmlkZXMubGVuZ3RoLTJdLEQ9Zy5wYWRzW2cucGFkcy5sZW5ndGgvMi0yXSxrPWcucGFkc1tnLnBhZHMubGVuZ3RoLTJdLEY9ZltULTJdOyQ9RCtrIT09MD9gCiAgICAgICAgICAgIGZvciAoaW50IGogPSAwOyBqIDwgJHtCfTsgaisrKSB7CiAgICAgICAgICAgICAgeFske1R9IC0gMl0gPSBpbmRpY2VzWyR7VH0gLSAyXSAqICR7Tn0gLSAke0R9ICsgajsKICAgICAgICAgICAgICBpZiAoeFske1R9IC0gMl0gPCAwIHx8IHhbJHtUfSAtIDJdID49ICR7Rn0pIHsKICAgICAgICAgICAgICAgIHBhZCs9ICR7d307CiAgICAgICAgICAgICAgICBjb250aW51ZTsKICAgICAgICAgICAgICB9CiAgICAgICAgICBgOmAKICAgICAgICAgICAgZm9yIChpbnQgaiA9IDA7IGogPCAke0J9OyBqKyspIHsKICAgICAgICAgICAgICB4WyR7VH0gLSAyXSA9IGluZGljZXNbJHtUfSAtIDJdICogJHtOfSAtICR7RH0gKyBqOwogICAgICAgICAgICBgLHo9YAogICAgICAgICAgfQogICAgICAgIGB9cmV0dXJuYAogICAgICAgIGZsb2F0IHByb2Nlc3MoaW50IGluZGljZXNbJHtUfV0pIHsKICAgICAgICAgIGludCB4WyR7VH1dOwogICAgICAgICAgY29weVZlYyhpbmRpY2VzLCB4KTsKCiAgICAgICAgICBmbG9hdCB2YWx1ZSA9ICR7eX07CiAgICAgICAgICBpbnQgcGFkID0gMDsKICAgICAgICAgICR7JH0KICAgICAgICAgICR7TX0KICAgICAgICAgICR7en0KICAgICAgICAgICR7Yn0KICAgICAgICAgIHJldHVybiB2YWx1ZTsKICAgICAgICB9CiAgICAgIGB9e2NvbnN0IHc9dS5TaGFwZVV0aWwuc2l6ZShnLmtlcm5lbFNoYXBlKSx4PXUuU2hhcGVVdGlsLmNvbXB1dGVTdHJpZGVzKGcua2VybmVsU2hhcGUpLEU9eC5sZW5ndGgsUD1nLnBhZHMubGVuZ3RoLHY9cyhFKSxNPWkoZiwiaW5wdXREaW1zIiksJD1pKGcucGFkcywicGFkcyIpLHo9aSh4LCJrZXJuZWxTdHJpZGVzIiksQj1pKGcuc3RyaWRlcywic3RyaWRlcyIpO2xldCBOPSIiO3JldHVybiBOPWcucGFkcy5yZWR1Y2UoKEQsayk9PkQrayk/YAogICAgICAgICAgICBpZiAoeFtqXSA+PSBpbnB1dERpbXNbal0gfHwgeFtqXSA8IDApIHsKICAgICAgICAgICAgICBwYWQrKzsKICAgICAgICAgICAgICBpc1BhZCA9IHRydWU7CiAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgIH0KICAgICAgICAgIH0KICAgICAgICAgIGlmICghaXNQYWQpIHsKICAgICAgICAgICAgJHtffQogICAgICAgICAgfWA6YAogICAgICAgICAgfQogICAgICAgICAgJHtffQogICAgICAgIGAsYAogICAgICAgICR7dn0KICAgICAgICBmbG9hdCBwcm9jZXNzKGludCBpbmRpY2VzWyR7VH1dKSB7CiAgICAgICAgICBpbnQgeFske1R9XTsKICAgICAgICAgIGNvcHlWZWMoaW5kaWNlcywgeCk7CiAgICAgICAgICBpbnQgb2Zmc2V0WyR7RX1dOwogICAgICAgICAgaW50IHBhZHNbJHtQfV07CiAgICAgICAgICBpbnQgaW5wdXREaW1zWyR7VH1dOwogICAgICAgICAgaW50IGtlcm5lbFN0cmlkZXNbJHtFfV07CiAgICAgICAgICBpbnQgc3RyaWRlc1ske0V9XTsKICAgICAgICAgICR7JH0KICAgICAgICAgICR7TX0KICAgICAgICAgICR7Qn0KICAgICAgICAgICR7en0KCiAgICAgICAgICBmbG9hdCB2YWx1ZSA9ICR7eX07CiAgICAgICAgICBpbnQgcGFkID0gMDsKICAgICAgICAgIGJvb2wgaXNQYWQgPSBmYWxzZTsKICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgJHt3fTsgaSsrKSB7CiAgICAgICAgICAgIG9mZnNldFRvSW5kaWNlcyhpLCBrZXJuZWxTdHJpZGVzLCBvZmZzZXQpOwogICAgICAgICAgICBpc1BhZCA9IGZhbHNlOwogICAgICAgICAgICBmb3IgKGludCBqID0gJHtUfSAtICR7RX07IGogPCAke1R9OyBqKyspIHsKICAgICAgICAgICAgICB4W2pdID0gaW5kaWNlc1tqXSA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W3ktMl0sUD14W3ktMV0sdj1fW3ktMl0sTT1fW3ktMV07bGV0ICQ9IiI7aWYoZi5tb2RlIT09ImxpbmVhciIpdGhyb3cgbmV3IEVycm9yKGByZXNpemUgKHBhY2tlZCkgZG9lcyBub3Qgc3VwcG9ydCBtb2RlOiAnJHtmLm1vZGV9J2ApO3N3aXRjaChmLmNvb3JkaW5hdGVUcmFuc2Zvcm1Nb2RlKXtjYXNlImFzeW1tZXRyaWMiOiQ9YAogICAgICAgICAgICAgICAgICAgIHZlYzQgZ2V0U291cmNlRnJhY0luZGV4KGl2ZWM0IGNvb3JkcykgewogICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdmVjNChjb29yZHMpIC8gc2NhbGVXSFdIOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGA7YnJlYWs7Y2FzZSJoYWxmX3BpeGVsIjokPWAKICAgICAgICAgICAgICAgICAgICB2ZWM0IGdldFNvdXJjZUZyYWNJbmRleChpdmVjNCBjb29yZHMpIHsKICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICh2ZWM0KGNvb3JkcykgKyAwLjUpIC8gc2NhbGVXSFdIIC0gMC41OwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGA7YnJlYWs7Y2FzZSJweXRvcmNoX2hhbGZfcGl4ZWwiOiQ9YAogICAgICAgICAgICAgICAgICAgIHZlYzQgZ2V0U291cmNlRnJhY0luZGV4KGl2ZWM0IGNvb3JkcykgewogICAgICAgICAgICAgICAgICAgICAgICB2ZWM0IGZjb29yZHMgPSB2ZWM0KGNvb3Jkcyk7CiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB2ZWM0KAogICAgICAgICAgICAgICAgICAgICAgICAgICAgJHt3fS4wID4gMS4wID8gKGZjb29yZHMueCArIDAuNSkgLyBzY2FsZVdIV0gueCAtIDAuNSA6IDAuMCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICR7VH0uMCA+IDEuMCA/IChmY29vcmRzLnkgKyAwLjUpIC8gc2NhbGVXSFdILnkgLSAwLjUgOiAwLjAsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAke3d9LjAgPiAxLjAgPyAoZmNvb3Jkcy56ICsgMC41KSAvIHNjYWxlV0hXSC56IC0gMC41IDogMC4wLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgJHtUfS4wID4gMS4wID8gKGZjb29yZHMudyArIDAuNSkgLyBzY2FsZVdIV0gudyAtIDAuNSA6IDAuMAogICAgICAgICAgICAgICAgICAgICAgICAgICk7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgYDticmVhaztjYXNlImFsaWduX2Nvcm5lcnMiOiQ9YAogICAgICAgICAgICAgICAgICAgIHZlYzQgZ2V0U291cmNlRnJhY0luZGV4KGl2ZWM0IGNvb3JkcykgewogICAgICAgICAgICAgICAgICAgICAgICB2ZWM0IHJlc2l6ZWQgPSB2ZWM0KCR7d30uMCAtIDEuMCwgJHtUfS4wIC0gMS4wLCAke3d9LjAgLSAxLjAsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAke1R9LjAgLSAxLjApOwogICAgICAgICAgICAgICAgICAgICAgICB2ZWM0IG9yaWdpbmFsID0gdmVjNCgke1B9LjAgLSAxLjAsICR7RX0uMCAtIDEuMCwgJHtQfS4wIC0gMS4wLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgJHtFfS4wIC0gMS4wKTsKICAgICAgICAgICAgICAgICAgICAgICAgdmVjNCBuZXdfc2NhbGUgPSBvcmlnaW5hbCAvIHJlc2l6ZWQ7CiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB2ZWM0KGNvb3JkcykgKiBuZXdfc2NhbGU7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgYDticmVhaztkZWZhdWx0OnRocm93IG5ldyBFcnJvcihgcmVzaXplIChwYWNrZWQpIGRvZXMgbm90IHN1cHBvcnQgY29vcmRpbmF0ZVRyYW5zZm9ybU1vZGU6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJyR7Zi5jb29yZGluYXRlVHJhbnNmb3JtTW9kZX0nYCl9Y29uc3Qgej0oMCxoLmdldENvb3Jkc0RhdGFUeXBlKSh5KSxCPWAKICAgICAgICAgICAgY29uc3QgdmVjMiBpbnB1dFdIID0gdmVjMigke0V9LjAsICR7UH0uMCk7CiAgICAgICAgICAgIGNvbnN0IHZlYzQgc2NhbGVXSFdIID0gdmVjNChmbG9hdCgke3Z9KSwgZmxvYXQoJHtNfSksIGZsb2F0KCR7dn0pLCBmbG9hdCgke019KSk7CiAgICAgICAgICAgICR7KDAsYS51bnBhY2tGcm9tQ2hhbm5lbCkoKX0KICAgICAgICAgICAgJHskfQogICAgICAgICAgICBmbG9hdCBnZXRBVmFsdWUoaW50IHgxMCwgaW50IHIsIGludCBjLCBpbnQgZCkgewogICAgICAgICAgICAgICAgcmV0dXJuIGdldENoYW5uZWwoZ2V0QSh4MTAsIHIsIGMsIGQpLCB2ZWMyKGMsIGQpKTsKICAgICAgICAgICAgfQogICAgICAgICAgICB2b2lkIG1haW4oKSB7CiAgICAgICAgICAgICAgICAke3p9IHJjID0gZ2V0T3V0cHV0Q29vcmRzKCk7CgogICAgICAgICAgICAgICAgaW50IGJhdGNoID0gcmNbMF07CiAgICAgICAgICAgICAgICBpbnQgZGVwdGggPSByY1sxXTsKCiAgICAgICAgICAgICAgICAvLyByZXRyaWV2ZSB0aGUgNCBjb29yZGluYXRlcyB0aGF0IGlzIHVzZWQgaW4gdGhlIDQgcGFja2VkIG91dHB1dCB2YWx1ZXMuCiAgICAgICAgICAgICAgICBpdmVjNCBjb29yZHMgPSBpdmVjNChyYy53eiwgcmMudyArIDEsIHJjLnogKyAxKTsKCiAgICAgICAgICAgICAgICAvLyBjYWxjdWxhdGUgdGhlIHNvdXJjZSBpbmRleCBpbiBmcmFjdGlvbgogICAgICAgICAgICAgICAgdmVjNCBzb3VyY2VGcmFjID0gZ2V0U291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ICAgICAgICAgIGhhc05leHRDb2wgPyBnZXRBVmFsdWUoYmF0Y2gsIGRlcHRoLCB4MDEueCwgeDAxLnkpIDogMC4wLAogICAgICAgICAgICAgICAgICAgIGhhc05leHRSb3cgPyBnZXRBVmFsdWUoYmF0Y2gsIGRlcHRoLCB4MTAueCwgeDEwLnkpIDogMC4wLAogICAgICAgICAgICAgICAgICAgIChoYXNOZXh0Um93ICYmIGhhc05leHRDb2wpID8gZ2V0QVZhbHVlKGJhdGNoLCBkZXB0aCwgeDExLngsIHgxMS55KSA6IDAuMCk7CgogICAgICAgICAgICAgICAgLy8gcGFjayB4MDAsIHgwMSwgeDEwLCB4MTEncyB0b3AtcmlnaHQgY29ybmVyIGludG8gb25lIHZlYzQgc3RydWN0dXJlCiAgICAgICAgICAgICAgICB2ZWM0IHRvcFJpZ2h0ID0gdmVjNCgKICAgICAgICAgICAgICAgICAgICBnZXRBVmFsdWUoYmF0Y2gsIGRlcHRoLCB4MDAueCwgeDAwLncpLAogICAgICAgICAgICAgICAgICAgIGhhc05leHRDb2wgPyBnZXRBVmFsdWUoYmF0Y2gsIGRlcHRoLCB4MDEueCwgeDAxLncpIDogMC4wLAogICAgICAgICAgICAgICAgICAgIGhhc05leHRSb3cgPyBnZXRBVmFsdWUoYmF0Y2gsIGRlcHRoLCB4MTAueCwgeDEwLncpIDogMC4wLAogICAgICAgICAgICAgICAgICAgIChoYXNOZXh0Um93ICYmIGhhc05leHRDb2wpID8gZ2V0QVZhbHVlKGJhdGNoLCBkZXB0aCwgeDExLngsIHgxMS53KSA6IDAuMCk7CgogICAgICAgICAgICAgICAgLy8gcGFjayB4MDAsIHgwMSwgeDEwLCB4MTEncyBib3R0b20tbGVmdCBjb3JuZXIgaW50byBvbmUgdmVjNCBzdHJ1Y3R1cmUKICAgICAgICAgICAgICAgIHZlYzQgYm90dG9tTGVmdCA9IHZlYzQoCiAgICAgICAgICAgICAgICAgICAgZ2V0QVZhbHVlKGJhdGNoLCBkZXB0aCwgeDA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gaW50IGQyID0gZCAvIHNjYWxlc1tkaW1dOwogICAgICAgICAgbSA9IGQgLSBkMiAqIHNjYWxlc1tkaW1dOwogICAgICAgICAgZCA9IGQyOwogICAgICAgIH0KICAgICAgICBpbnB1dF9pbmRleCArPSBpbnB1dF9waXRjaGVzW2RpbV0gKiBkOwogICAgICB9CgogICAgICByZXR1cm4gZ2V0SW5wdXRGbG9hdChpbnB1dF9pbmRleCk7CiAgICB9YDpfPT09ND9gCiAgICAke3d9CiAgICBmbG9hdCBwcm9jZXNzKGludCBpbmRpY2VzWzRdKSB7CiAgICAgIGludCBpbnB1dF9pbmRleCA9IDA7CiAgICAgIGludCBvdXRwdXRfaW5kZXggPSBjb29yZHNUb09mZnNldChUZXhDb29yZHMsICR7Zn0sICR7Z30pOwoKICAgICAgJHtUfQoKICAgICAgaW50IG07CiAgICAgIGludCBpbmRleF9vZl9kaW0wLCBpbmRleF9vZl9kaW0xLCBpbmRleF9vZl9kaW0yLCBpbmRleF9vZl9kaW0zOwogICAgICBpbmRleF9vZl9kaW0wID0gb3V0cHV0X2luZGV4IC8gb3V0cHV0X3BpdGNoZXNbMF07CiAgICAgIG0gPSBvdXRwdXRfaW5kZXggLSBpbmRleF9vZl9kaW0wICogb3V0cHV0X3BpdGNoZXNbMF07CiAgICAgIGluZGV4X29mX2RpbTEgPSBtIC8gb3V0cHV0X3BpdGNoZXNbMV07CiAgICAgIG0gPSBtIC0gaW5kZXhfb2ZfZGltMSAqIG91dHB1dF9waXRjaGVzWzFdOwogICAgICBpbmRleF9vZl9kaW0yID0gbSAvIG91dHB1dF9waXRjaGVzWzJdOwogICAgICBtID0gbSAtIGluZGV4X29mX2RpbTIgKiBvdXRwdXRfcGl0Y2hlc1syXTsKICAgICAgaW5kZXhfb2ZfZGltMyA9IG07CgogICAgICBpbnQgaW5kZXhfb2ZfaW5wdXRfZGltMiwgaW5kZXhfb2ZfaW5wdXRfZGltMywgeF9vZmZzZXQsIHlfb2Zmc2V0OwogICAgICBpbm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uZ2V0SW5zdGFuY2UoKTtjb25zdCByPWQuZGF0YS5vcHRpb25zLm1hcChhc3luYyBoPT4oey4uLmgsZW1iZWRkaW5nczphd2FpdCB0KGgubGFiZWxTZW1BdXRvQ29tLGNvbmZpZ3MucGlwZWxpbmVQYXJhbXMpfSkpO2xldCB1PShhd2FpdCBQcm9taXNlLmFsbChyKSkubWFwKGg9Pih7Li4uaCxlbWJlZGRpbmdzOmguZW1iZWRkaW5ncy5kYXRhfSkpO3NlbGYucG9zdE1lc3NhZ2Uoe3N0YXR1czoiY29tcGxldGVPcHRpb25zIixvcHRpb25zV2l0aEVtYmVkZGluZ3M6dX0pO2JyZWFrfWNhc2UiY29tcHV0ZUlucHV0VGV4dCI6e2xldCByPWF3YWl0KGF3YWl0IE15RW1iZWRkaW5nc1BpcGVsaW5lLmdldEluc3RhbmNlKCkpKGQuZGF0YS50ZXh0LGNvbmZpZ3MucGlwZWxpbmVQYXJhbXMpO3NlbGYucG9zdE1lc3NhZ2Uoe3N0YXR1czoiY29tcGxldGVJbnB1dFRleHQiLGlucHV0VGV4dEVtYmVkZGluZ3M6ci5kYXRhLGlucHV0VGV4dDpkLmRhdGEudGV4dH0pO2JyZWFrfX19KX0pKCk7Cg==",decodeBase64=i=>Uint8Array.from(atob(i),o=>o.charCodeAt(0)),blob=typeof window<"u"&&window.Blob&&new Blob([decodeBase64(encodedJs)],{type:"text/javascript;charset=utf-8"});function WorkerWrapper(i){let o;try{if(o=blob&&(window.URL||window.webkitURL).createObjectURL(blob),!o)throw"";const s=new Worker(o,{name:i==null?void 0:i.name});return s.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(o)}),s}catch{return new Worker("data:text/javascript;base64,"+encodedJs,{name:i==null?void 0:i.name})}finally{o&&(window.URL||window.webkitURL).revokeObjectURL(o)}}const SemanticAutocomplete=React$1.forwardRef((i,o)=>{const{loading:s,onInputChange:j,onOpen:_e,onClose:lt}=i,{onResult:tt,threshold:ot,pipelineParams:st,model:ct,...it}=i,[$,a]=reactExports.useState([]),[et,nt]=reactExports.useState(!1),[at,rt]=reactExports.useState(!0),dt=reactExports.useRef(null),ut=reactExports.useRef([]),bt=reactExports.useRef(""),mt=s?!0:et&&at,pt=i.getOptionLabel||(Yt=>Yt.label);reactExports.useEffect(()=>{dt.current||(dt.current=new WorkerWrapper,dt.current.postMessage({type:"init",pipelineParams:st,model:ct}));const Yt=St=>{switch(St.data.status){case"completeOptions":ut.current=St.data.optionsWithEmbeddings,a(i.options),rt(!1),bt.current&&dt.current.postMessage({type:"computeInputText",text:bt.current});break;case"completeInputText":var Lt=ut.current.map(Ct=>({...Ct,sim:cos_sim(Ct.embeddings,St.data.inputTextEmbeddings)})).sort((Ct,Tt)=>{const ft=Zt(Ct.labelSemAutoCom,St.data.inputText),Ft=Zt(Tt.labelSemAutoCom,St.data.inputText);return ft==Ft?Tt.sim-Ct.sim:ft?-1:1});if(ot&&St.data.inputText){let Ct=Lt.findIndex(Tt=>Zt(Tt.labelSemAutoCom,St.data.inputText)==!1&&Tt.simdt.current.removeEventListener("message",Yt)}),reactExports.useEffect(()=>{rt(!0),dt.current.postMessage({type:"computeOptions",options:i.options.map(Yt=>({...Yt,labelSemAutoCom:pt(Yt)}))})},[i.options]);const Zt=(Yt,St)=>Yt.toLowerCase().includes(St.toLowerCase()),ht=(Yt,St,Lt)=>{bt.current=St,dt.current.postMessage({type:"computeInputText",text:St}),j&&j(Yt,St,Lt)},Gt=Yt=>{nt(!0),_e&&_e(Yt)},Xt=Yt=>{nt(!1),_e&<(Yt)},Vt=Yt=>React$1.createElement(TextField$1,{...Yt,InputProps:{...Yt.InputProps,endAdornment:React$1.createElement(React$1.Fragment,null,React$1.createElement(CircularProgress$1,{color:"inherit"}),Yt.InputProps.endAdornment)}});return React$1.createElement(Autocomplete$1,{...it,options:$,filterOptions:Yt=>Yt,onInputChange:ht,loading:mt,onOpen:Gt,onClose:Xt,ref:o,...mt?{renderInput:Vt}:{}})}),jsonData=[{label:"Word embeddings are a type of word representation that allows words to be represented as vectors in a continuous vector space. The primary goal is to capture the semantic meaning of words so that words with similar meanings are located close to each other in this space. This is achieved by transforming sparse, high-dimensional word vectors into lower-dimensional spaces while preserving semantic relationships.",value:1},{label:"Embeddings are used extensively across various NLP tasks. Some common applications include text classification, sentiment analysis, language modeling, and machine translation. They are also integral to more complex tasks like question-answering systems, chatbots, and content recommendation systems. Beyond NLP, embeddings find applications in image and video analysis, where they help in tasks like image classification and facial recognition.",value:2},{label:"Embeddings are used because they provide a dense and efficient representation of words, capturing complex patterns in language that are not apparent at the surface level. Unlike one-hot encoding, which treats words as isolated units without any notion of similarity, embeddings map words into a vector space based on their usage and context. This allows models to understand synonyms, analogies, and the overall semantics of text, leading to more nuanced and intelligent processing.",value:3},{label:"Embeddings are typically created using models like Word2Vec, GloVe, or FastText, which learn representations by analyzing word co-occurrences and relationships in large corpora of text. These models apply algorithms to adjust the position of each word in the vector space, such that the distance between vectors captures semantic relationships between words. For example, similar words are placed closer together, whereas unrelated words are positioned farther apart.",value:4},{label:"While embeddings are powerful, they also present challenges. One major concern is bias, as embeddings can perpetuate and amplify biases present in the training data. This requires careful consideration and mitigation strategies during model development and deployment. Additionally, creating and fine-tuning embeddings for specific domains or languages with limited resources can be challenging, necessitating innovative approaches to leverage embeddings effectively across diverse contexts.",value:5},{label:"Traditional word embeddings, like Word2Vec and GloVe, generate a single representation for each word, regardless of its context. This means that words with multiple meanings are represented by the same vector across different uses. Contextual embeddings, introduced by models such as BERT and ELMo, represent words as vectors that vary depending on the word's context within a sentence. This allows these models to capture the nuances of language more effectively, distinguishing between different meanings of a word based on its usage.",value:6},{label:"While primarily designed to capture semantic relationships between words, embeddings can also encode aspects of syntax and grammar to a certain extent. For example, embeddings can reflect syntactic categories like part of speech, and models trained on sentence-level tasks can learn representations that implicitly encode grammatical structures. However, explicit modeling of syntax and grammar often requires architectures designed specifically for these aspects, such as syntactic parsing models.",value:7},{label:"Embeddings are a cornerstone of transfer learning in NLP. Pre-trained embeddings, generated from large-scale language models on extensive corpora, can be used as the starting point for training on specific tasks. This approach allows models to leverage general linguistic knowledge learned from the broader language use, significantly improving performance on tasks with limited training data. Transfer learning with embeddings accelerates model development and enhances capabilities in domain-specific applications.",value:8},{label:'Evaluating the quality of embeddings involves assessing how well they capture semantic and syntactic relationships. This is often done through intrinsic methods, like analogy solving (e.g., "king" is to "man" as "queen" is to "woman") and similarity assessments, or through extrinsic methods, where embeddings are evaluated based on their performance in downstream tasks like text classification or sentiment analysis. Both approaches provide insights into the effectiveness of embeddings in encoding linguistic properties.',value:9},{label:"Significant efforts are underway to develop and refine embeddings for a wide range of languages beyond English. This includes both multilingual models, which learn embeddings capable of representing multiple languages in a single vector space, and language-specific models that cater to the unique characteristics of individual languages. Challenges in this area include dealing with low-resource languages and adapting models to capture linguistic features unique to each language.",value:10},{label:"Future developments in embeddings may focus on several areas, including improving the handling of polysemy and context, reducing biases in embeddings, and enhancing the efficiency and scalability of embedding models for large-scale applications. Additionally, there's a growing interest in cross-modal embeddings, which can represent data from different modalities (e.g., text and images) in a unified vector space, opening up new possibilities for multimodal applications and AI systems.",value:11},{label:"Graph embeddings aim to represent nodes, edges, and possibly whole subgraphs of a graph in a continuous vector space. These embeddings capture the structure of the graph as well as node-level and edge-level properties. Applications of graph embeddings include social network analysis, where they can predict connections or recommend content; knowledge graph completion, where they can infer missing relations; and in bioinformatics, for example, to predict protein interactions.",value:12},{label:"Embeddings can be adapted for time-series data by creating representations that capture temporal dynamics in addition to the underlying patterns. This involves training embeddings not just on the static features of data points but also on their changes over time, enabling models to understand periodic trends, anomalies, and long-term shifts in data. Applications include financial market analysis, weather forecasting, and predictive maintenance, where understanding the temporal dimension is crucial.",value:13},{label:"Scaling embedding models presents several challenges, including computational demands, memory requirements, and maintaining the quality of embeddings as the size of the data and the model increases. Solutions to these challenges include more efficient model architectures, quantization techniques to reduce the size of embeddings, and distributed computing strategies. Addressing these issues is key to enabling the application of embeddings to ever-larger datasets and more complex problems.",value:14}],SortedOptionsContext=reactExports.createContext(),SortedOptionsProvider=({children:i})=>{const[o,s]=reactExports.useState(jsonData);return React$1.createElement(SortedOptionsContext.Provider,{value:{sortedOptions:o,setSortedOptions:s}},i)},links=[{href:"https://github.com/Mihaiii/semantic-autocomplete",title:"GitHub"},{href:"https://www.npmjs.com/package/semantic-autocomplete",title:"npm"},{href:"https://huggingface.co/spaces/Mihaiii/semantic-autocomplete-demo-1",title:"Demo #1"},{href:"https://huggingface.co/spaces/Mihaiii/semantic-autocomplete-demo-2",title:"Demo #2"}],HorizontalLinkList=()=>{const i={display:"flex",flexDirection:"row",padding:0};return React$1.createElement(List$1,{style:i},links.map((o,s)=>React$1.createElement(React$1.Fragment,{key:o.href},React$1.createElement(ListItem$1,null,React$1.createElement(Link$1,{href:o.href,target:"_blank"},o.title)))))},SemanticAutocompleteMemoized=React$1.memo(SemanticAutocomplete);function App(){const i=reactExports.useMemo(()=>jsonData,[]),{sortedOptions:o,setSortedOptions:s}=reactExports.useContext(SortedOptionsContext),j=()=>React$1.createElement(List$1,null,o.map(_e=>React$1.createElement(ListItem$1,{key:_e.label+_e.value},React$1.createElement(ListItemText$1,{primary:_e.label}))));return React$1.createElement("div",null,React$1.createElement(HorizontalLinkList,null),React$1.createElement(SemanticAutocompleteMemoized,{freeSolo:!0,options:i,onResult:s,renderInput:_e=>React$1.createElement(TextField$1,{..._e,placeholder:"What are embeddings?"}),open:!1,popupIcon:null}),React$1.createElement(j,null))}client.createRoot(document.getElementById("root")).render(React$1.createElement(React$1.StrictMode,null,React$1.createElement(SortedOptionsProvider,null,React$1.createElement(App,null))));