scribe-widget 1.0.7 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/scribe-widget.es.js +514 -509
- package/dist/scribe-widget.umd.js +15 -15
- package/package.json +1 -1
- package/src/App.tsx +6 -6
- package/src/components/ConfigState.tsx +10 -10
- package/src/hooks/useScribeSession.ts +14 -10
- package/src/index.tsx +3 -1
- package/src/types.ts +10 -3
|
@@ -37,18 +37,18 @@
|
|
|
37
37
|
`+h[_].replace(" at new "," at ");return i.displayName&&nt.includes("<anonymous>")&&(nt=nt.replace("<anonymous>",i.displayName)),nt}while(1<=_&&0<=j);break}}}finally{Na$1=!1,Error.prepareStackTrace=s}return(i=i?i.displayName||i.name:"")?Ma$1(i):""}function Pa$1(i){switch(i.tag){case 5:return Ma$1(i.type);case 16:return Ma$1("Lazy");case 13:return Ma$1("Suspense");case 19:return Ma$1("SuspenseList");case 0:case 2:case 15:return i=Oa$1(i.type,!1),i;case 11:return i=Oa$1(i.type.render,!1),i;case 1:return i=Oa$1(i.type,!0),i;default:return""}}function Qa$1(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$1:return"Fragment";case wa$1:return"Portal";case Aa$1:return"Profiler";case za$1:return"StrictMode";case Ea$1:return"Suspense";case Fa$1:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case Ca$1:return(i.displayName||"Context")+".Consumer";case Ba$1:return(i._context.displayName||"Context")+".Provider";case Da$1:var e=i.render;return i=i.displayName,i||(i=e.displayName||e.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case Ga$1:return e=i.displayName||null,e!==null?e:Qa$1(i.type)||"Memo";case Ha$1:e=i._payload,i=i._init;try{return Qa$1(i(e))}catch{}}return null}function Ra$1(i){var e=i.type;switch(i.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return i=e.render,i=i.displayName||i.name||"",e.displayName||(i!==""?"ForwardRef("+i+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Qa$1(e);case 8:return e===za$1?"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 e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Sa$1(i){switch(typeof i){case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function Ta$1(i){var e=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function Ua$1(i){var e=Ta$1(i)?"checked":"value",s=Object.getOwnPropertyDescriptor(i.constructor.prototype,e),c=""+i[e];if(!i.hasOwnProperty(e)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var h=s.get,$=s.set;return Object.defineProperty(i,e,{configurable:!0,get:function(){return h.call(this)},set:function(_){c=""+_,$.call(this,_)}}),Object.defineProperty(i,e,{enumerable:s.enumerable}),{getValue:function(){return c},setValue:function(_){c=""+_},stopTracking:function(){i._valueTracker=null,delete i[e]}}}}function Va$1(i){i._valueTracker||(i._valueTracker=Ua$1(i))}function Wa$1(i){if(!i)return!1;var e=i._valueTracker;if(!e)return!0;var s=e.getValue(),c="";return i&&(c=Ta$1(i)?i.checked?"true":"false":i.value),i=c,i!==s?(e.setValue(i),!0):!1}function Xa$1(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$1(i,e){var s=e.checked;return A({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:s??i._wrapperState.initialChecked})}function Za$1(i,e){var s=e.defaultValue==null?"":e.defaultValue,c=e.checked!=null?e.checked:e.defaultChecked;s=Sa$1(e.value!=null?e.value:s),i._wrapperState={initialChecked:c,initialValue:s,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function ab(i,e){e=e.checked,e!=null&&ta$1(i,"checked",e,!1)}function bb(i,e){ab(i,e);var s=Sa$1(e.value),c=e.type;if(s!=null)c==="number"?(s===0&&i.value===""||i.value!=s)&&(i.value=""+s):i.value!==""+s&&(i.value=""+s);else if(c==="submit"||c==="reset"){i.removeAttribute("value");return}e.hasOwnProperty("value")?cb(i,e.type,s):e.hasOwnProperty("defaultValue")&&cb(i,e.type,Sa$1(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(i.defaultChecked=!!e.defaultChecked)}function db(i,e,s){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var c=e.type;if(!(c!=="submit"&&c!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+i._wrapperState.initialValue,s||e===i.value||(i.value=e),i.defaultValue=e}s=i.name,s!==""&&(i.name=""),i.defaultChecked=!!i._wrapperState.initialChecked,s!==""&&(i.name=s)}function cb(i,e,s){(e!=="number"||Xa$1(i.ownerDocument)!==i)&&(s==null?i.defaultValue=""+i._wrapperState.initialValue:i.defaultValue!==""+s&&(i.defaultValue=""+s))}var eb=Array.isArray;function fb(i,e,s,c){if(i=i.options,e){e={};for(var h=0;h<s.length;h++)e["$"+s[h]]=!0;for(s=0;s<i.length;s++)h=e.hasOwnProperty("$"+i[s].value),i[s].selected!==h&&(i[s].selected=h),h&&c&&(i[s].defaultSelected=!0)}else{for(s=""+Sa$1(s),e=null,h=0;h<i.length;h++){if(i[h].value===s){i[h].selected=!0,c&&(i[h].defaultSelected=!0);return}e!==null||i[h].disabled||(e=i[h])}e!==null&&(e.selected=!0)}}function gb(i,e){if(e.dangerouslySetInnerHTML!=null)throw Error(p(91));return A({},e,{value:void 0,defaultValue:void 0,children:""+i._wrapperState.initialValue})}function hb(i,e){var s=e.value;if(s==null){if(s=e.children,e=e.defaultValue,s!=null){if(e!=null)throw Error(p(92));if(eb(s)){if(1<s.length)throw Error(p(93));s=s[0]}e=s}e==null&&(e=""),s=e}i._wrapperState={initialValue:Sa$1(s)}}function ib(i,e){var s=Sa$1(e.value),c=Sa$1(e.defaultValue);s!=null&&(s=""+s,s!==i.value&&(i.value=s),e.defaultValue==null&&i.defaultValue!==s&&(i.defaultValue=s)),c!=null&&(i.defaultValue=""+c)}function jb(i){var e=i.textContent;e===i._wrapperState.initialValue&&e!==""&&e!==null&&(i.value=e)}function kb(i){switch(i){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function lb(i,e){return i==null||i==="http://www.w3.org/1999/xhtml"?kb(e):i==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":i}var mb,nb=function(i){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,s,c,h){MSApp.execUnsafeLocalFunction(function(){return i(e,s,c,h)})}:i}(function(i,e){if(i.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in i)i.innerHTML=e;else{for(mb=mb||document.createElement("div"),mb.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=mb.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;e.firstChild;)i.appendChild(e.firstChild)}});function ob(i,e){if(e){var s=i.firstChild;if(s&&s===i.lastChild&&s.nodeType===3){s.nodeValue=e;return}}i.textContent=e}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(e){e=e+i.charAt(0).toUpperCase()+i.substring(1),pb[e]=pb[i]})});function rb(i,e,s){return e==null||typeof e=="boolean"||e===""?"":s||typeof e!="number"||e===0||pb.hasOwnProperty(i)&&pb[i]?(""+e).trim():e+"px"}function sb(i,e){i=i.style;for(var s in e)if(e.hasOwnProperty(s)){var c=s.indexOf("--")===0,h=rb(s,e[s],c);s==="float"&&(s="cssFloat"),c?i.setProperty(s,h):i[s]=h}}var tb=A({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,e){if(e){if(tb[i]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(p(137,i));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(p(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(p(61))}if(e.style!=null&&typeof e.style!="object")throw Error(p(62))}}function vb(i,e){if(i.indexOf("-")===-1)return typeof e.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(280));var e=i.stateNode;e&&(e=Db(e),yb(i.stateNode,i.type,e))}}function Eb(i){zb?Ab?Ab.push(i):Ab=[i]:zb=i}function Fb(){if(zb){var i=zb,e=Ab;if(Ab=zb=null,Bb(i),e)for(i=0;i<e.length;i++)Bb(e[i])}}function Gb(i,e){return i(e)}function Hb(){}var Ib=!1;function Jb(i,e,s){if(Ib)return i(e,s);Ib=!0;try{return Gb(i,e,s)}finally{Ib=!1,(zb!==null||Ab!==null)&&(Hb(),Fb())}}function Kb(i,e){var s=i.stateNode;if(s===null)return null;var c=Db(s);if(c===null)return null;s=c[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(c=!c.disabled)||(i=i.type,c=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!c;break e;default:i=!1}if(i)return null;if(s&&typeof s!="function")throw Error(p(231,e,typeof s));return s}var Lb=!1;if(ia$1)try{var Mb={};Object.defineProperty(Mb,"passive",{get:function(){Lb=!0}}),window.addEventListener("test",Mb,Mb),window.removeEventListener("test",Mb,Mb)}catch{Lb=!1}function Nb(i,e,s,c,h,$,_,j,nt){var et=Array.prototype.slice.call(arguments,3);try{e.apply(s,et)}catch(b){this.onError(b)}}var Ob=!1,Pb=null,Qb=!1,Rb=null,Sb={onError:function(i){Ob=!0,Pb=i}};function Tb(i,e,s,c,h,$,_,j,nt){Ob=!1,Pb=null,Nb.apply(Sb,arguments)}function Ub(i,e,s,c,h,$,_,j,nt){if(Tb.apply(this,arguments),Ob){if(Ob){var et=Pb;Ob=!1,Pb=null}else throw Error(p(198));Qb||(Qb=!0,Rb=et)}}function Vb(i){var e=i,s=i;if(i.alternate)for(;e.return;)e=e.return;else{i=e;do e=i,e.flags&4098&&(s=e.return),i=e.return;while(i)}return e.tag===3?s:null}function Wb(i){if(i.tag===13){var e=i.memoizedState;if(e===null&&(i=i.alternate,i!==null&&(e=i.memoizedState)),e!==null)return e.dehydrated}return null}function Xb(i){if(Vb(i)!==i)throw Error(p(188))}function Yb(i){var e=i.alternate;if(!e){if(e=Vb(i),e===null)throw Error(p(188));return e!==i?null:i}for(var s=i,c=e;;){var h=s.return;if(h===null)break;var $=h.alternate;if($===null){if(c=h.return,c!==null){s=c;continue}break}if(h.child===$.child){for($=h.child;$;){if($===s)return Xb(h),i;if($===c)return Xb(h),e;$=$.sibling}throw Error(p(188))}if(s.return!==c.return)s=h,c=$;else{for(var _=!1,j=h.child;j;){if(j===s){_=!0,s=h,c=$;break}if(j===c){_=!0,c=h,s=$;break}j=j.sibling}if(!_){for(j=$.child;j;){if(j===s){_=!0,s=$,c=h;break}if(j===c){_=!0,c=$,s=h;break}j=j.sibling}if(!_)throw Error(p(189))}}if(s.alternate!==c)throw Error(p(190))}if(s.tag!==3)throw Error(p(188));return s.stateNode.current===s?i:e}function Zb(i){return i=Yb(i),i!==null?$b(i):null}function $b(i){if(i.tag===5||i.tag===6)return i;for(i=i.child;i!==null;){var e=$b(i);if(e!==null)return e;i=i.sibling}return null}var ac=ca$1.unstable_scheduleCallback,bc=ca$1.unstable_cancelCallback,cc=ca$1.unstable_shouldYield,dc=ca$1.unstable_requestPaint,B=ca$1.unstable_now,ec=ca$1.unstable_getCurrentPriorityLevel,fc=ca$1.unstable_ImmediatePriority,gc=ca$1.unstable_UserBlockingPriority,hc=ca$1.unstable_NormalPriority,ic=ca$1.unstable_LowPriority,jc=ca$1.unstable_IdlePriority,kc=null,lc=null;function mc(i){if(lc&&typeof lc.onCommitFiberRoot=="function")try{lc.onCommitFiberRoot(kc,i,void 0,(i.current.flags&128)===128)}catch{}}var oc=Math.clz32?Math.clz32:nc,pc=Math.log,qc=Math.LN2;function nc(i){return 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,e){var s=i.pendingLanes;if(s===0)return 0;var c=0,h=i.suspendedLanes,$=i.pingedLanes,_=s&268435455;if(_!==0){var j=_&~h;j!==0?c=tc(j):($&=_,$!==0&&(c=tc($)))}else _=s&~h,_!==0?c=tc(_):$!==0&&(c=tc($));if(c===0)return 0;if(e!==0&&e!==c&&!(e&h)&&(h=c&-c,$=e&-e,h>=$||h===16&&($&4194240)!==0))return e;if(c&4&&(c|=s&16),e=i.entangledLanes,e!==0)for(i=i.entanglements,e&=c;0<e;)s=31-oc(e),h=1<<s,c|=i[s],e&=~h;return c}function vc(i,e){switch(i){case 1:case 2:case 4:return e+250;case 8:case 16:case 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 e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function wc(i,e){for(var s=i.suspendedLanes,c=i.pingedLanes,h=i.expirationTimes,$=i.pendingLanes;0<$;){var _=31-oc($),j=1<<_,nt=h[_];nt===-1?(!(j&s)||j&c)&&(h[_]=vc(j,e)):nt<=e&&(i.expiredLanes|=j),$&=~j}}function xc(i){return i=i.pendingLanes&-1073741825,i!==0?i:i&1073741824?1073741824:0}function yc(){var i=rc;return rc<<=1,!(rc&4194240)&&(rc=64),i}function zc(i){for(var e=[],s=0;31>s;s++)e.push(i);return e}function Ac(i,e,s){i.pendingLanes|=e,e!==536870912&&(i.suspendedLanes=0,i.pingedLanes=0),i=i.eventTimes,e=31-oc(e),i[e]=s}function Bc(i,e){var s=i.pendingLanes&~e;i.pendingLanes=e,i.suspendedLanes=0,i.pingedLanes=0,i.expiredLanes&=e,i.mutableReadLanes&=e,i.entangledLanes&=e,e=i.entanglements;var c=i.eventTimes;for(i=i.expirationTimes;0<s;){var h=31-oc(s),$=1<<h;e[h]=0,c[h]=-1,i[h]=-1,s&=~$}}function Cc(i,e){var s=i.entangledLanes|=e;for(i=i.entanglements;s;){var c=31-oc(s),h=1<<c;h&e|i[c]&e&&(i[c]|=e),s&=~h}}var C=0;function Dc(i){return i&=-i,1<i?4<i?i&268435455?16:536870912:4:1}var Ec,Fc,Gc,Hc,Ic,Jc=!1,Kc=[],Lc=null,Mc=null,Nc=null,Oc=new Map,Pc=new Map,Qc=[],Rc="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Sc(i,e){switch(i){case"focusin":case"focusout":Lc=null;break;case"dragenter":case"dragleave":Mc=null;break;case"mouseover":case"mouseout":Nc=null;break;case"pointerover":case"pointerout":Oc.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":Pc.delete(e.pointerId)}}function Tc(i,e,s,c,h,$){return i===null||i.nativeEvent!==$?(i={blockedOn:e,domEventName:s,eventSystemFlags:c,nativeEvent:$,targetContainers:[h]},e!==null&&(e=Cb(e),e!==null&&Fc(e)),i):(i.eventSystemFlags|=c,e=i.targetContainers,h!==null&&e.indexOf(h)===-1&&e.push(h),i)}function Uc(i,e,s,c,h){switch(e){case"focusin":return Lc=Tc(Lc,i,e,s,c,h),!0;case"dragenter":return Mc=Tc(Mc,i,e,s,c,h),!0;case"mouseover":return Nc=Tc(Nc,i,e,s,c,h),!0;case"pointerover":var $=h.pointerId;return Oc.set($,Tc(Oc.get($)||null,i,e,s,c,h)),!0;case"gotpointercapture":return $=h.pointerId,Pc.set($,Tc(Pc.get($)||null,i,e,s,c,h)),!0}return!1}function Vc(i){var e=Wc(i.target);if(e!==null){var s=Vb(e);if(s!==null){if(e=s.tag,e===13){if(e=Wb(s),e!==null){i.blockedOn=e,Ic(i.priority,function(){Gc(s)});return}}else if(e===3&&s.stateNode.current.memoizedState.isDehydrated){i.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}i.blockedOn=null}function Xc(i){if(i.blockedOn!==null)return!1;for(var e=i.targetContainers;0<e.length;){var s=Yc(i.domEventName,i.eventSystemFlags,e[0],i.nativeEvent);if(s===null){s=i.nativeEvent;var c=new s.constructor(s.type,s);wb=c,s.target.dispatchEvent(c),wb=null}else return e=Cb(s),e!==null&&Fc(e),i.blockedOn=s,!1;e.shift()}return!0}function Zc(i,e,s){Xc(i)&&s.delete(e)}function $c(){Jc=!1,Lc!==null&&Xc(Lc)&&(Lc=null),Mc!==null&&Xc(Mc)&&(Mc=null),Nc!==null&&Xc(Nc)&&(Nc=null),Oc.forEach(Zc),Pc.forEach(Zc)}function ad(i,e){i.blockedOn===e&&(i.blockedOn=null,Jc||(Jc=!0,ca$1.unstable_scheduleCallback(ca$1.unstable_NormalPriority,$c)))}function bd(i){function e(h){return ad(h,i)}if(0<Kc.length){ad(Kc[0],i);for(var s=1;s<Kc.length;s++){var c=Kc[s];c.blockedOn===i&&(c.blockedOn=null)}}for(Lc!==null&&ad(Lc,i),Mc!==null&&ad(Mc,i),Nc!==null&&ad(Nc,i),Oc.forEach(e),Pc.forEach(e),s=0;s<Qc.length;s++)c=Qc[s],c.blockedOn===i&&(c.blockedOn=null);for(;0<Qc.length&&(s=Qc[0],s.blockedOn===null);)Vc(s),s.blockedOn===null&&Qc.shift()}var cd=ua$1.ReactCurrentBatchConfig,dd=!0;function ed(i,e,s,c){var h=C,$=cd.transition;cd.transition=null;try{C=1,fd(i,e,s,c)}finally{C=h,cd.transition=$}}function gd(i,e,s,c){var h=C,$=cd.transition;cd.transition=null;try{C=4,fd(i,e,s,c)}finally{C=h,cd.transition=$}}function fd(i,e,s,c){if(dd){var h=Yc(i,e,s,c);if(h===null)hd(i,e,c,id$1,s),Sc(i,c);else if(Uc(h,i,e,s,c))c.stopPropagation();else if(Sc(i,c),e&4&&-1<Rc.indexOf(i)){for(;h!==null;){var $=Cb(h);if($!==null&&Ec($),$=Yc(i,e,s,c),$===null&&hd(i,e,c,id$1,s),$===h)break;h=$}h!==null&&c.stopPropagation()}else hd(i,e,c,null,s)}}var id$1=null;function Yc(i,e,s,c){if(id$1=null,i=xb(c),i=Wc(i),i!==null)if(e=Vb(i),e===null)i=null;else if(s=e.tag,s===13){if(i=Wb(e),i!==null)return i;i=null}else if(s===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;i=null}else e!==i&&(i=null);return id$1=i,null}function jd(i){switch(i){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(ec()){case fc:return 1;case gc:return 4;case hc:case ic:return 16;case jc:return 536870912;default:return 16}default:return 16}}var kd=null,ld=null,md=null;function nd(){if(md)return md;var i,e=ld,s=e.length,c,h="value"in kd?kd.value:kd.textContent,$=h.length;for(i=0;i<s&&e[i]===h[i];i++);var _=s-i;for(c=1;c<=_&&e[s-c]===h[$-c];c++);return md=h.slice(i,1<c?1-c:void 0)}function od(i){var e=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&e===13&&(i=13)):i=e,i===10&&(i=13),32<=i||i===13?i:0}function pd(){return!0}function qd(){return!1}function rd(i){function e(s,c,h,$,_){this._reactName=s,this._targetInst=h,this.type=c,this.nativeEvent=$,this.target=_,this.currentTarget=null;for(var j in i)i.hasOwnProperty(j)&&(s=i[j],this[j]=s?s($):$[j]);return this.isDefaultPrevented=($.defaultPrevented!=null?$.defaultPrevented:$.returnValue===!1)?pd:qd,this.isPropagationStopped=qd,this}return A(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=pd)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=pd)},persist:function(){},isPersistent:pd}),e}var sd={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},td=rd(sd),ud=A({},sd,{view:0,detail:0}),vd=rd(ud),wd,xd,yd,Ad=A({},ud,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:zd,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==yd&&(yd&&i.type==="mousemove"?(wd=i.screenX-yd.screenX,xd=i.screenY-yd.screenY):xd=wd=0,yd=i),wd)},movementY:function(i){return"movementY"in i?i.movementY:xd}}),Bd=rd(Ad),Cd=A({},Ad,{dataTransfer:0}),Dd=rd(Cd),Ed=A({},ud,{relatedTarget:0}),Fd=rd(Ed),Gd=A({},sd,{animationName:0,elapsedTime:0,pseudoElement:0}),Hd=rd(Gd),Id=A({},sd,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),Jd=rd(Id),Kd=A({},sd,{data:0}),Ld=rd(Kd),Md={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Nd={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Od={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Pd(i){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(i):(i=Od[i])?!!e[i]:!1}function zd(){return Pd}var Qd=A({},ud,{key:function(i){if(i.key){var e=Md[i.key]||i.key;if(e!=="Unidentified")return e}return i.type==="keypress"?(i=od(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?Nd[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:zd,charCode:function(i){return i.type==="keypress"?od(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?od(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),Rd=rd(Qd),Sd=A({},Ad,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Td=rd(Sd),Ud=A({},ud,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:zd}),Vd=rd(Ud),Wd=A({},sd,{propertyName:0,elapsedTime:0,pseudoElement:0}),Xd=rd(Wd),Yd=A({},Ad,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),Zd=rd(Yd),$d=[9,13,27,32],ae$1=ia$1&&"CompositionEvent"in window,be=null;ia$1&&"documentMode"in document&&(be=document.documentMode);var ce$1=ia$1&&"TextEvent"in window&&!be,de$1=ia$1&&(!ae$1||be&&8<be&&11>=be),ee$1=" ",fe=!1;function ge$1(i,e){switch(i){case"keyup":return $d.indexOf(e.keyCode)!==-1;case"keydown":return e.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=!1;function je$1(i,e){switch(i){case"compositionend":return he(e);case"keypress":return e.which!==32?null:(fe=!0,ee$1);case"textInput":return i=e.data,i===ee$1&&fe?null:i;default:return null}}function ke(i,e){if(ie$1)return i==="compositionend"||!ae$1&&ge$1(i,e)?(i=nd(),md=ld=kd=null,ie$1=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return de$1&&e.locale!=="ko"?null:e.data;default:return null}}var le={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function me(i){var e=i&&i.nodeName&&i.nodeName.toLowerCase();return e==="input"?!!le[i.type]:e==="textarea"}function ne$1(i,e,s,c){Eb(c),e=oe(e,"onChange"),0<e.length&&(s=new td("onChange","change",null,s,c),i.push({event:s,listeners:e}))}var pe$1=null,qe=null;function re$1(i){se$1(i,0)}function te$1(i){var e=ue(i);if(Wa$1(e))return i}function ve(i,e){if(i==="change")return e}var we$1=!1;if(ia$1){var xe$1;if(ia$1){var ye$1="oninput"in document;if(!ye$1){var ze$1=document.createElement("div");ze$1.setAttribute("oninput","return;"),ye$1=typeof ze$1.oninput=="function"}xe$1=ye$1}else xe$1=!1;we$1=xe$1&&(!document.documentMode||9<document.documentMode)}function Ae$1(){pe$1&&(pe$1.detachEvent("onpropertychange",Be$1),qe=pe$1=null)}function Be$1(i){if(i.propertyName==="value"&&te$1(qe)){var e=[];ne$1(e,qe,i,xb(i)),Jb(re$1,e)}}function Ce(i,e,s){i==="focusin"?(Ae$1(),pe$1=e,qe=s,pe$1.attachEvent("onpropertychange",Be$1)):i==="focusout"&&Ae$1()}function De$1(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return te$1(qe)}function Ee$1(i,e){if(i==="click")return te$1(e)}function Fe(i,e){if(i==="input"||i==="change")return te$1(e)}function Ge$1(i,e){return i===e&&(i!==0||1/i===1/e)||i!==i&&e!==e}var He$1=typeof Object.is=="function"?Object.is:Ge$1;function Ie$1(i,e){if(He$1(i,e))return!0;if(typeof i!="object"||i===null||typeof e!="object"||e===null)return!1;var s=Object.keys(i),c=Object.keys(e);if(s.length!==c.length)return!1;for(c=0;c<s.length;c++){var h=s[c];if(!ja$1.call(e,h)||!He$1(i[h],e[h]))return!1}return!0}function Je$1(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function Ke$1(i,e){var s=Je$1(i);i=0;for(var c;s;){if(s.nodeType===3){if(c=i+s.textContent.length,i<=e&&c>=e)return{node:s,offset:e-i};i=c}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Je$1(s)}}function Le$1(i,e){return i&&e?i===e?!0:i&&i.nodeType===3?!1:e&&e.nodeType===3?Le$1(i,e.parentNode):"contains"in i?i.contains(e):i.compareDocumentPosition?!!(i.compareDocumentPosition(e)&16):!1:!1}function Me$1(){for(var i=window,e=Xa$1();e instanceof i.HTMLIFrameElement;){try{var s=typeof e.contentWindow.location.href=="string"}catch{s=!1}if(s)i=e.contentWindow;else break;e=Xa$1(i.document)}return e}function Ne$1(i){var e=i&&i.nodeName&&i.nodeName.toLowerCase();return e&&(e==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||e==="textarea"||i.contentEditable==="true")}function Oe$1(i){var e=Me$1(),s=i.focusedElem,c=i.selectionRange;if(e!==s&&s&&s.ownerDocument&&Le$1(s.ownerDocument.documentElement,s)){if(c!==null&&Ne$1(s)){if(e=c.start,i=c.end,i===void 0&&(i=e),"selectionStart"in s)s.selectionStart=e,s.selectionEnd=Math.min(i,s.value.length);else if(i=(e=s.ownerDocument||document)&&e.defaultView||window,i.getSelection){i=i.getSelection();var h=s.textContent.length,$=Math.min(c.start,h);c=c.end===void 0?$:Math.min(c.end,h),!i.extend&&$>c&&(h=c,c=$,$=h),h=Ke$1(s,$);var _=Ke$1(s,c);h&&_&&(i.rangeCount!==1||i.anchorNode!==h.node||i.anchorOffset!==h.offset||i.focusNode!==_.node||i.focusOffset!==_.offset)&&(e=e.createRange(),e.setStart(h.node,h.offset),i.removeAllRanges(),$>c?(i.addRange(e),i.extend(_.node,_.offset)):(e.setEnd(_.node,_.offset),i.addRange(e)))}}for(e=[],i=s;i=i.parentNode;)i.nodeType===1&&e.push({element:i,left:i.scrollLeft,top:i.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;s<e.length;s++)i=e[s],i.element.scrollLeft=i.left,i.element.scrollTop=i.top}}var Pe$1=ia$1&&"documentMode"in document&&11>=document.documentMode,Qe$1=null,Re$1=null,Se$1=null,Te$1=!1;function Ue$1(i,e,s){var c=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Te$1||Qe$1==null||Qe$1!==Xa$1(c)||(c=Qe$1,"selectionStart"in c&&Ne$1(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),Se$1&&Ie$1(Se$1,c)||(Se$1=c,c=oe(Re$1,"onSelect"),0<c.length&&(e=new td("onSelect","select",null,e,s),i.push({event:e,listeners:c}),e.target=Qe$1)))}function Ve$1(i,e){var s={};return s[i.toLowerCase()]=e.toLowerCase(),s["Webkit"+i]="webkit"+e,s["Moz"+i]="moz"+e,s}var We$1={animationend:Ve$1("Animation","AnimationEnd"),animationiteration:Ve$1("Animation","AnimationIteration"),animationstart:Ve$1("Animation","AnimationStart"),transitionend:Ve$1("Transition","TransitionEnd")},Xe={},Ye={};ia$1&&(Ye=document.createElement("div").style,"AnimationEvent"in window||(delete We$1.animationend.animation,delete We$1.animationiteration.animation,delete We$1.animationstart.animation),"TransitionEvent"in window||delete We$1.transitionend.transition);function Ze$1(i){if(Xe[i])return Xe[i];if(!We$1[i])return i;var e=We$1[i],s;for(s in e)if(e.hasOwnProperty(s)&&s in Ye)return Xe[i]=e[s];return i}var $e$1=Ze$1("animationend"),af=Ze$1("animationiteration"),bf=Ze$1("animationstart"),cf=Ze$1("transitionend"),df=new Map,ef="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function ff(i,e){df.set(i,e),fa(e,[i])}for(var gf=0;gf<ef.length;gf++){var hf=ef[gf],jf=hf.toLowerCase(),kf=hf[0].toUpperCase()+hf.slice(1);ff(jf,"on"+kf)}ff($e$1,"onAnimationEnd"),ff(af,"onAnimationIteration"),ff(bf,"onAnimationStart"),ff("dblclick","onDoubleClick"),ff("focusin","onFocus"),ff("focusout","onBlur"),ff(cf,"onTransitionEnd"),ha$1("onMouseEnter",["mouseout","mouseover"]),ha$1("onMouseLeave",["mouseout","mouseover"]),ha$1("onPointerEnter",["pointerout","pointerover"]),ha$1("onPointerLeave",["pointerout","pointerover"]),fa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),fa("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),fa("onBeforeInput",["compositionend","keypress","textInput","paste"]),fa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),fa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),fa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var lf="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),mf=new Set("cancel close invalid load scroll toggle".split(" ").concat(lf));function nf(i,e,s){var c=i.type||"unknown-event";i.currentTarget=s,Ub(c,e,void 0,i),i.currentTarget=null}function se$1(i,e){e=(e&4)!==0;for(var s=0;s<i.length;s++){var c=i[s],h=c.event;c=c.listeners;e:{var $=void 0;if(e)for(var _=c.length-1;0<=_;_--){var j=c[_],nt=j.instance,et=j.currentTarget;if(j=j.listener,nt!==$&&h.isPropagationStopped())break e;nf(h,j,et),$=nt}else for(_=0;_<c.length;_++){if(j=c[_],nt=j.instance,et=j.currentTarget,j=j.listener,nt!==$&&h.isPropagationStopped())break e;nf(h,j,et),$=nt}}}if(Qb)throw i=Rb,Qb=!1,Rb=null,i}function D(i,e){var s=e[of];s===void 0&&(s=e[of]=new Set);var c=i+"__bubble";s.has(c)||(pf(e,i,2,!1),s.add(c))}function qf(i,e,s){var c=0;e&&(c|=4),pf(s,i,c,e)}var rf="_reactListening"+Math.random().toString(36).slice(2);function sf(i){if(!i[rf]){i[rf]=!0,da$1.forEach(function(s){s!=="selectionchange"&&(mf.has(s)||qf(s,!1,i),qf(s,!0,i))});var e=i.nodeType===9?i:i.ownerDocument;e===null||e[rf]||(e[rf]=!0,qf("selectionchange",!1,e))}}function pf(i,e,s,c){switch(jd(e)){case 1:var h=ed;break;case 4:h=gd;break;default:h=fd}s=h.bind(null,e,s,i),h=void 0,!Lb||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(h=!0),c?h!==void 0?i.addEventListener(e,s,{capture:!0,passive:h}):i.addEventListener(e,s,!0):h!==void 0?i.addEventListener(e,s,{passive:h}):i.addEventListener(e,s,!1)}function hd(i,e,s,c,h){var $=c;if(!(e&1)&&!(e&2)&&c!==null)e:for(;;){if(c===null)return;var _=c.tag;if(_===3||_===4){var j=c.stateNode.containerInfo;if(j===h||j.nodeType===8&&j.parentNode===h)break;if(_===4)for(_=c.return;_!==null;){var nt=_.tag;if((nt===3||nt===4)&&(nt=_.stateNode.containerInfo,nt===h||nt.nodeType===8&&nt.parentNode===h))return;_=_.return}for(;j!==null;){if(_=Wc(j),_===null)return;if(nt=_.tag,nt===5||nt===6){c=$=_;continue e}j=j.parentNode}}c=c.return}Jb(function(){var et=$,b=xb(s),a=[];e:{var o=df.get(i);if(o!==void 0){var d=td,g=i;switch(i){case"keypress":if(od(s)===0)break e;case"keydown":case"keyup":d=Rd;break;case"focusin":g="focus",d=Fd;break;case"focusout":g="blur",d=Fd;break;case"beforeblur":case"afterblur":d=Fd;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":d=Bd;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":d=Dd;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":d=Vd;break;case $e$1:case af:case bf:d=Hd;break;case cf:d=Xd;break;case"scroll":d=vd;break;case"wheel":d=Zd;break;case"copy":case"cut":case"paste":d=Jd;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":d=Td}var rt=(e&4)!==0,st=!rt&&i==="scroll",tt=rt?o!==null?o+"Capture":null:o;rt=[];for(var ot=et,it;ot!==null;){it=ot;var at=it.stateNode;if(it.tag===5&&at!==null&&(it=at,tt!==null&&(at=Kb(ot,tt),at!=null&&rt.push(tf(ot,at,it)))),st)break;ot=ot.return}0<rt.length&&(o=new d(o,g,null,s,b),a.push({event:o,listeners:rt}))}}if(!(e&7)){e:{if(o=i==="mouseover"||i==="pointerover",d=i==="mouseout"||i==="pointerout",o&&s!==wb&&(g=s.relatedTarget||s.fromElement)&&(Wc(g)||g[uf]))break e;if((d||o)&&(o=b.window===b?b:(o=b.ownerDocument)?o.defaultView||o.parentWindow:window,d?(g=s.relatedTarget||s.toElement,d=et,g=g?Wc(g):null,g!==null&&(st=Vb(g),g!==st||g.tag!==5&&g.tag!==6)&&(g=null)):(d=null,g=et),d!==g)){if(rt=Bd,at="onMouseLeave",tt="onMouseEnter",ot="mouse",(i==="pointerout"||i==="pointerover")&&(rt=Td,at="onPointerLeave",tt="onPointerEnter",ot="pointer"),st=d==null?o:ue(d),it=g==null?o:ue(g),o=new rt(at,ot+"leave",d,s,b),o.target=st,o.relatedTarget=it,at=null,Wc(b)===et&&(rt=new rt(tt,ot+"enter",g,s,b),rt.target=it,rt.relatedTarget=st,at=rt),st=at,d&&g)t:{for(rt=d,tt=g,ot=0,it=rt;it;it=vf(it))ot++;for(it=0,at=tt;at;at=vf(at))it++;for(;0<ot-it;)rt=vf(rt),ot--;for(;0<it-ot;)tt=vf(tt),it--;for(;ot--;){if(rt===tt||tt!==null&&rt===tt.alternate)break t;rt=vf(rt),tt=vf(tt)}rt=null}else rt=null;d!==null&&wf(a,o,d,rt,!1),g!==null&&st!==null&&wf(a,st,g,rt,!0)}}e:{if(o=et?ue(et):window,d=o.nodeName&&o.nodeName.toLowerCase(),d==="select"||d==="input"&&o.type==="file")var ut=ve;else if(me(o))if(we$1)ut=Fe;else{ut=De$1;var lt=Ce}else(d=o.nodeName)&&d.toLowerCase()==="input"&&(o.type==="checkbox"||o.type==="radio")&&(ut=Ee$1);if(ut&&(ut=ut(i,et))){ne$1(a,ut,s,b);break e}lt&<(i,o,et),i==="focusout"&&(lt=o._wrapperState)&<.controlled&&o.type==="number"&&cb(o,"number",o.value)}switch(lt=et?ue(et):window,i){case"focusin":(me(lt)||lt.contentEditable==="true")&&(Qe$1=lt,Re$1=et,Se$1=null);break;case"focusout":Se$1=Re$1=Qe$1=null;break;case"mousedown":Te$1=!0;break;case"contextmenu":case"mouseup":case"dragend":Te$1=!1,Ue$1(a,s,b);break;case"selectionchange":if(Pe$1)break;case"keydown":case"keyup":Ue$1(a,s,b)}var ct;if(ae$1)e:{switch(i){case"compositionstart":var ft="onCompositionStart";break e;case"compositionend":ft="onCompositionEnd";break e;case"compositionupdate":ft="onCompositionUpdate";break e}ft=void 0}else ie$1?ge$1(i,s)&&(ft="onCompositionEnd"):i==="keydown"&&s.keyCode===229&&(ft="onCompositionStart");ft&&(de$1&&s.locale!=="ko"&&(ie$1||ft!=="onCompositionStart"?ft==="onCompositionEnd"&&ie$1&&(ct=nd()):(kd=b,ld="value"in kd?kd.value:kd.textContent,ie$1=!0)),lt=oe(et,ft),0<lt.length&&(ft=new Ld(ft,i,null,s,b),a.push({event:ft,listeners:lt}),ct?ft.data=ct:(ct=he(s),ct!==null&&(ft.data=ct)))),(ct=ce$1?je$1(i,s):ke(i,s))&&(et=oe(et,"onBeforeInput"),0<et.length&&(b=new Ld("onBeforeInput","beforeinput",null,s,b),a.push({event:b,listeners:et}),b.data=ct))}se$1(a,e)})}function tf(i,e,s){return{instance:i,listener:e,currentTarget:s}}function oe(i,e){for(var s=e+"Capture",c=[];i!==null;){var h=i,$=h.stateNode;h.tag===5&&$!==null&&(h=$,$=Kb(i,s),$!=null&&c.unshift(tf(i,$,h)),$=Kb(i,e),$!=null&&c.push(tf(i,$,h))),i=i.return}return c}function vf(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5);return i||null}function wf(i,e,s,c,h){for(var $=e._reactName,_=[];s!==null&&s!==c;){var j=s,nt=j.alternate,et=j.stateNode;if(nt!==null&&nt===c)break;j.tag===5&&et!==null&&(j=et,h?(nt=Kb(s,$),nt!=null&&_.unshift(tf(s,nt,j))):h||(nt=Kb(s,$),nt!=null&&_.push(tf(s,nt,j)))),s=s.return}_.length!==0&&i.push({event:e,listeners:_})}var xf=/\r\n?/g,yf=/\u0000|\uFFFD/g;function zf(i){return(typeof i=="string"?i:""+i).replace(xf,`
|
|
38
38
|
`).replace(yf,"")}function Af(i,e,s){if(e=zf(e),zf(i)!==e&&s)throw Error(p(425))}function Bf(){}var Cf=null,Df=null;function Ef(i,e){return i==="textarea"||i==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var Ff=typeof setTimeout=="function"?setTimeout:void 0,Gf=typeof clearTimeout=="function"?clearTimeout:void 0,Hf=typeof Promise=="function"?Promise:void 0,Jf=typeof queueMicrotask=="function"?queueMicrotask:typeof Hf<"u"?function(i){return Hf.resolve(null).then(i).catch(If)}:Ff;function If(i){setTimeout(function(){throw i})}function Kf(i,e){var s=e,c=0;do{var h=s.nextSibling;if(i.removeChild(s),h&&h.nodeType===8)if(s=h.data,s==="/$"){if(c===0){i.removeChild(h),bd(e);return}c--}else s!=="$"&&s!=="$?"&&s!=="$!"||c++;s=h}while(s);bd(e)}function Lf(i){for(;i!=null;i=i.nextSibling){var e=i.nodeType;if(e===1||e===3)break;if(e===8){if(e=i.data,e==="$"||e==="$!"||e==="$?")break;if(e==="/$")return null}}return i}function Mf(i){i=i.previousSibling;for(var e=0;i;){if(i.nodeType===8){var s=i.data;if(s==="$"||s==="$!"||s==="$?"){if(e===0)return i;e--}else s==="/$"&&e++}i=i.previousSibling}return null}var Nf=Math.random().toString(36).slice(2),Of="__reactFiber$"+Nf,Pf="__reactProps$"+Nf,uf="__reactContainer$"+Nf,of="__reactEvents$"+Nf,Qf="__reactListeners$"+Nf,Rf="__reactHandles$"+Nf;function Wc(i){var e=i[Of];if(e)return e;for(var s=i.parentNode;s;){if(e=s[uf]||s[Of]){if(s=e.alternate,e.child!==null||s!==null&&s.child!==null)for(i=Mf(i);i!==null;){if(s=i[Of])return s;i=Mf(i)}return e}i=s,s=i.parentNode}return null}function Cb(i){return i=i[Of]||i[uf],!i||i.tag!==5&&i.tag!==6&&i.tag!==13&&i.tag!==3?null:i}function ue(i){if(i.tag===5||i.tag===6)return i.stateNode;throw Error(p(33))}function Db(i){return i[Pf]||null}var Sf=[],Tf=-1;function Uf(i){return{current:i}}function E(i){0>Tf||(i.current=Sf[Tf],Sf[Tf]=null,Tf--)}function G(i,e){Tf++,Sf[Tf]=i.current,i.current=e}var Vf={},H=Uf(Vf),Wf=Uf(!1),Xf=Vf;function Yf(i,e){var s=i.type.contextTypes;if(!s)return Vf;var c=i.stateNode;if(c&&c.__reactInternalMemoizedUnmaskedChildContext===e)return c.__reactInternalMemoizedMaskedChildContext;var h={},$;for($ in s)h[$]=e[$];return c&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=e,i.__reactInternalMemoizedMaskedChildContext=h),h}function Zf(i){return i=i.childContextTypes,i!=null}function $f(){E(Wf),E(H)}function ag(i,e,s){if(H.current!==Vf)throw Error(p(168));G(H,e),G(Wf,s)}function bg(i,e,s){var c=i.stateNode;if(e=e.childContextTypes,typeof c.getChildContext!="function")return s;c=c.getChildContext();for(var h in c)if(!(h in e))throw Error(p(108,Ra$1(i)||"Unknown",h));return A({},s,c)}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,e,s){var c=i.stateNode;if(!c)throw Error(p(169));s?(i=bg(i,e,Xf),c.__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,e=C;try{var s=eg;for(C=1;i<s.length;i++){var c=s[i];do c=c(!0);while(c!==null)}eg=null,fg=!1}catch(h){throw eg!==null&&(eg=eg.slice(i+1)),ac(fc,jg),h}finally{C=e,gg=!1}}return null}var kg=[],lg=0,mg=null,ng=0,og=[],pg=0,qg=null,rg=1,sg="";function tg(i,e){kg[lg++]=ng,kg[lg++]=mg,mg=i,ng=e}function ug(i,e,s){og[pg++]=rg,og[pg++]=sg,og[pg++]=qg,qg=i;var c=rg;i=sg;var h=32-oc(c)-1;c&=~(1<<h),s+=1;var $=32-oc(e)+h;if(30<$){var _=h-h%5;$=(c&(1<<_)-1).toString(32),c>>=_,h-=_,rg=1<<32-oc(e)+h|s<<h|c,sg=$+i}else rg=1<<$|s<<h|c,sg=i}function vg(i){i.return!==null&&(tg(i,1),ug(i,1,0))}function wg(i){for(;i===mg;)mg=kg[--lg],kg[lg]=null,ng=kg[--lg],kg[lg]=null;for(;i===qg;)qg=og[--pg],og[pg]=null,sg=og[--pg],og[pg]=null,rg=og[--pg],og[pg]=null}var xg=null,yg=null,I=!1,zg=null;function Ag(i,e){var s=Bg(5,null,null,0);s.elementType="DELETED",s.stateNode=e,s.return=i,e=i.deletions,e===null?(i.deletions=[s],i.flags|=16):e.push(s)}function Cg(i,e){switch(i.tag){case 5:var s=i.type;return e=e.nodeType!==1||s.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(i.stateNode=e,xg=i,yg=Lf(e.firstChild),!0):!1;case 6:return e=i.pendingProps===""||e.nodeType!==3?null:e,e!==null?(i.stateNode=e,xg=i,yg=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(s=qg!==null?{id:rg,overflow:sg}:null,i.memoizedState={dehydrated:e,treeContext:s,retryLane:1073741824},s=Bg(18,null,null,0),s.stateNode=e,s.return=i,i.child=s,xg=i,yg=null,!0):!1;default:return!1}}function Dg(i){return(i.mode&1)!==0&&(i.flags&128)===0}function Eg(i){if(I){var e=yg;if(e){var s=e;if(!Cg(i,e)){if(Dg(i))throw Error(p(418));e=Lf(s.nextSibling);var c=xg;e&&Cg(i,e)?Ag(c,s):(i.flags=i.flags&-4097|2,I=!1,xg=i)}}else{if(Dg(i))throw Error(p(418));i.flags=i.flags&-4097|2,I=!1,xg=i}}}function Fg(i){for(i=i.return;i!==null&&i.tag!==5&&i.tag!==3&&i.tag!==13;)i=i.return;xg=i}function Gg(i){if(i!==xg)return!1;if(!I)return Fg(i),I=!0,!1;var e;if((e=i.tag!==3)&&!(e=i.tag!==5)&&(e=i.type,e=e!=="head"&&e!=="body"&&!Ef(i.type,i.memoizedProps)),e&&(e=yg)){if(Dg(i))throw Hg(),Error(p(418));for(;e;)Ag(i,e),e=Lf(e.nextSibling)}if(Fg(i),i.tag===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(p(317));e:{for(i=i.nextSibling,e=0;i;){if(i.nodeType===8){var s=i.data;if(s==="/$"){if(e===0){yg=Lf(i.nextSibling);break e}e--}else s!=="$"&&s!=="$!"&&s!=="$?"||e++}i=i.nextSibling}yg=null}}else yg=xg?Lf(i.stateNode.nextSibling):null;return!0}function Hg(){for(var i=yg;i;)i=Lf(i.nextSibling)}function Ig(){yg=xg=null,I=!1}function Jg(i){zg===null?zg=[i]:zg.push(i)}var Kg=ua$1.ReactCurrentBatchConfig;function Lg(i,e,s){if(i=s.ref,i!==null&&typeof i!="function"&&typeof i!="object"){if(s._owner){if(s=s._owner,s){if(s.tag!==1)throw Error(p(309));var c=s.stateNode}if(!c)throw Error(p(147,i));var h=c,$=""+i;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===$?e.ref:(e=function(_){var j=h.refs;_===null?delete j[$]:j[$]=_},e._stringRef=$,e)}if(typeof i!="string")throw Error(p(284));if(!s._owner)throw Error(p(290,i))}return i}function Mg(i,e){throw i=Object.prototype.toString.call(e),Error(p(31,i==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":i))}function Ng(i){var e=i._init;return e(i._payload)}function Og(i){function e(tt,ot){if(i){var it=tt.deletions;it===null?(tt.deletions=[ot],tt.flags|=16):it.push(ot)}}function s(tt,ot){if(!i)return null;for(;ot!==null;)e(tt,ot),ot=ot.sibling;return null}function c(tt,ot){for(tt=new Map;ot!==null;)ot.key!==null?tt.set(ot.key,ot):tt.set(ot.index,ot),ot=ot.sibling;return tt}function h(tt,ot){return tt=Pg(tt,ot),tt.index=0,tt.sibling=null,tt}function $(tt,ot,it){return tt.index=it,i?(it=tt.alternate,it!==null?(it=it.index,it<ot?(tt.flags|=2,ot):it):(tt.flags|=2,ot)):(tt.flags|=1048576,ot)}function _(tt){return i&&tt.alternate===null&&(tt.flags|=2),tt}function j(tt,ot,it,at){return ot===null||ot.tag!==6?(ot=Qg(it,tt.mode,at),ot.return=tt,ot):(ot=h(ot,it),ot.return=tt,ot)}function nt(tt,ot,it,at){var ut=it.type;return ut===ya$1?b(tt,ot,it.props.children,at,it.key):ot!==null&&(ot.elementType===ut||typeof ut=="object"&&ut!==null&&ut.$$typeof===Ha$1&&Ng(ut)===ot.type)?(at=h(ot,it.props),at.ref=Lg(tt,ot,it),at.return=tt,at):(at=Rg(it.type,it.key,it.props,null,tt.mode,at),at.ref=Lg(tt,ot,it),at.return=tt,at)}function et(tt,ot,it,at){return ot===null||ot.tag!==4||ot.stateNode.containerInfo!==it.containerInfo||ot.stateNode.implementation!==it.implementation?(ot=Sg(it,tt.mode,at),ot.return=tt,ot):(ot=h(ot,it.children||[]),ot.return=tt,ot)}function b(tt,ot,it,at,ut){return ot===null||ot.tag!==7?(ot=Tg(it,tt.mode,at,ut),ot.return=tt,ot):(ot=h(ot,it),ot.return=tt,ot)}function a(tt,ot,it){if(typeof ot=="string"&&ot!==""||typeof ot=="number")return ot=Qg(""+ot,tt.mode,it),ot.return=tt,ot;if(typeof ot=="object"&&ot!==null){switch(ot.$$typeof){case va$1:return it=Rg(ot.type,ot.key,ot.props,null,tt.mode,it),it.ref=Lg(tt,null,ot),it.return=tt,it;case wa$1:return ot=Sg(ot,tt.mode,it),ot.return=tt,ot;case Ha$1:var at=ot._init;return a(tt,at(ot._payload),it)}if(eb(ot)||Ka$1(ot))return ot=Tg(ot,tt.mode,it,null),ot.return=tt,ot;Mg(tt,ot)}return null}function o(tt,ot,it,at){var ut=ot!==null?ot.key:null;if(typeof it=="string"&&it!==""||typeof it=="number")return ut!==null?null:j(tt,ot,""+it,at);if(typeof it=="object"&&it!==null){switch(it.$$typeof){case va$1:return it.key===ut?nt(tt,ot,it,at):null;case wa$1:return it.key===ut?et(tt,ot,it,at):null;case Ha$1:return ut=it._init,o(tt,ot,ut(it._payload),at)}if(eb(it)||Ka$1(it))return ut!==null?null:b(tt,ot,it,at,null);Mg(tt,it)}return null}function d(tt,ot,it,at,ut){if(typeof at=="string"&&at!==""||typeof at=="number")return tt=tt.get(it)||null,j(ot,tt,""+at,ut);if(typeof at=="object"&&at!==null){switch(at.$$typeof){case va$1:return tt=tt.get(at.key===null?it:at.key)||null,nt(ot,tt,at,ut);case wa$1:return tt=tt.get(at.key===null?it:at.key)||null,et(ot,tt,at,ut);case Ha$1:var lt=at._init;return d(tt,ot,it,lt(at._payload),ut)}if(eb(at)||Ka$1(at))return tt=tt.get(it)||null,b(ot,tt,at,ut,null);Mg(ot,at)}return null}function g(tt,ot,it,at){for(var ut=null,lt=null,ct=ot,ft=ot=0,dt=null;ct!==null&&ft<it.length;ft++){ct.index>ft?(dt=ct,ct=null):dt=ct.sibling;var yt=o(tt,ct,it[ft],at);if(yt===null){ct===null&&(ct=dt);break}i&&ct&&yt.alternate===null&&e(tt,ct),ot=$(yt,ot,ft),lt===null?ut=yt:lt.sibling=yt,lt=yt,ct=dt}if(ft===it.length)return s(tt,ct),I&&tg(tt,ft),ut;if(ct===null){for(;ft<it.length;ft++)ct=a(tt,it[ft],at),ct!==null&&(ot=$(ct,ot,ft),lt===null?ut=ct:lt.sibling=ct,lt=ct);return I&&tg(tt,ft),ut}for(ct=c(tt,ct);ft<it.length;ft++)dt=d(ct,tt,ft,it[ft],at),dt!==null&&(i&&dt.alternate!==null&&ct.delete(dt.key===null?ft:dt.key),ot=$(dt,ot,ft),lt===null?ut=dt:lt.sibling=dt,lt=dt);return i&&ct.forEach(function(St){return e(tt,St)}),I&&tg(tt,ft),ut}function rt(tt,ot,it,at){var ut=Ka$1(it);if(typeof ut!="function")throw Error(p(150));if(it=ut.call(it),it==null)throw Error(p(151));for(var lt=ut=null,ct=ot,ft=ot=0,dt=null,yt=it.next();ct!==null&&!yt.done;ft++,yt=it.next()){ct.index>ft?(dt=ct,ct=null):dt=ct.sibling;var St=o(tt,ct,yt.value,at);if(St===null){ct===null&&(ct=dt);break}i&&ct&&St.alternate===null&&e(tt,ct),ot=$(St,ot,ft),lt===null?ut=St:lt.sibling=St,lt=St,ct=dt}if(yt.done)return s(tt,ct),I&&tg(tt,ft),ut;if(ct===null){for(;!yt.done;ft++,yt=it.next())yt=a(tt,yt.value,at),yt!==null&&(ot=$(yt,ot,ft),lt===null?ut=yt:lt.sibling=yt,lt=yt);return I&&tg(tt,ft),ut}for(ct=c(tt,ct);!yt.done;ft++,yt=it.next())yt=d(ct,tt,ft,yt.value,at),yt!==null&&(i&&yt.alternate!==null&&ct.delete(yt.key===null?ft:yt.key),ot=$(yt,ot,ft),lt===null?ut=yt:lt.sibling=yt,lt=yt);return i&&ct.forEach(function(bt){return e(tt,bt)}),I&&tg(tt,ft),ut}function st(tt,ot,it,at){if(typeof it=="object"&&it!==null&&it.type===ya$1&&it.key===null&&(it=it.props.children),typeof it=="object"&&it!==null){switch(it.$$typeof){case va$1:e:{for(var ut=it.key,lt=ot;lt!==null;){if(lt.key===ut){if(ut=it.type,ut===ya$1){if(lt.tag===7){s(tt,lt.sibling),ot=h(lt,it.props.children),ot.return=tt,tt=ot;break e}}else if(lt.elementType===ut||typeof ut=="object"&&ut!==null&&ut.$$typeof===Ha$1&&Ng(ut)===lt.type){s(tt,lt.sibling),ot=h(lt,it.props),ot.ref=Lg(tt,lt,it),ot.return=tt,tt=ot;break e}s(tt,lt);break}else e(tt,lt);lt=lt.sibling}it.type===ya$1?(ot=Tg(it.props.children,tt.mode,at,it.key),ot.return=tt,tt=ot):(at=Rg(it.type,it.key,it.props,null,tt.mode,at),at.ref=Lg(tt,ot,it),at.return=tt,tt=at)}return _(tt);case wa$1:e:{for(lt=it.key;ot!==null;){if(ot.key===lt)if(ot.tag===4&&ot.stateNode.containerInfo===it.containerInfo&&ot.stateNode.implementation===it.implementation){s(tt,ot.sibling),ot=h(ot,it.children||[]),ot.return=tt,tt=ot;break e}else{s(tt,ot);break}else e(tt,ot);ot=ot.sibling}ot=Sg(it,tt.mode,at),ot.return=tt,tt=ot}return _(tt);case Ha$1:return lt=it._init,st(tt,ot,lt(it._payload),at)}if(eb(it))return g(tt,ot,it,at);if(Ka$1(it))return rt(tt,ot,it,at);Mg(tt,it)}return typeof it=="string"&&it!==""||typeof it=="number"?(it=""+it,ot!==null&&ot.tag===6?(s(tt,ot.sibling),ot=h(ot,it),ot.return=tt,tt=ot):(s(tt,ot),ot=Qg(it,tt.mode,at),ot.return=tt,tt=ot),_(tt)):s(tt,ot)}return st}var Ug=Og(!0),Vg=Og(!1),Wg=Uf(null),Xg=null,Yg=null,Zg=null;function $g(){Zg=Yg=Xg=null}function ah(i){var e=Wg.current;E(Wg),i._currentValue=e}function bh(i,e,s){for(;i!==null;){var c=i.alternate;if((i.childLanes&e)!==e?(i.childLanes|=e,c!==null&&(c.childLanes|=e)):c!==null&&(c.childLanes&e)!==e&&(c.childLanes|=e),i===s)break;i=i.return}}function ch(i,e){Xg=i,Zg=Yg=null,i=i.dependencies,i!==null&&i.firstContext!==null&&(i.lanes&e&&(dh=!0),i.firstContext=null)}function eh(i){var e=i._currentValue;if(Zg!==i)if(i={context:i,memoizedValue:e,next:null},Yg===null){if(Xg===null)throw Error(p(308));Yg=i,Xg.dependencies={lanes:0,firstContext:i}}else Yg=Yg.next=i;return e}var fh=null;function gh(i){fh===null?fh=[i]:fh.push(i)}function hh(i,e,s,c){var h=e.interleaved;return h===null?(s.next=s,gh(e)):(s.next=h.next,h.next=s),e.interleaved=s,ih(i,c)}function ih(i,e){i.lanes|=e;var s=i.alternate;for(s!==null&&(s.lanes|=e),s=i,i=i.return;i!==null;)i.childLanes|=e,s=i.alternate,s!==null&&(s.childLanes|=e),s=i,i=i.return;return s.tag===3?s.stateNode:null}var jh=!1;function kh(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function lh(i,e){i=i.updateQueue,e.updateQueue===i&&(e.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,effects:i.effects})}function mh(i,e){return{eventTime:i,lane:e,tag:0,payload:null,callback:null,next:null}}function nh(i,e,s){var c=i.updateQueue;if(c===null)return null;if(c=c.shared,K&2){var h=c.pending;return h===null?e.next=e:(e.next=h.next,h.next=e),c.pending=e,ih(i,s)}return h=c.interleaved,h===null?(e.next=e,gh(c)):(e.next=h.next,h.next=e),c.interleaved=e,ih(i,s)}function oh(i,e,s){if(e=e.updateQueue,e!==null&&(e=e.shared,(s&4194240)!==0)){var c=e.lanes;c&=i.pendingLanes,s|=c,e.lanes=s,Cc(i,s)}}function ph(i,e){var s=i.updateQueue,c=i.alternate;if(c!==null&&(c=c.updateQueue,s===c)){var h=null,$=null;if(s=s.firstBaseUpdate,s!==null){do{var _={eventTime:s.eventTime,lane:s.lane,tag:s.tag,payload:s.payload,callback:s.callback,next:null};$===null?h=$=_:$=$.next=_,s=s.next}while(s!==null);$===null?h=$=e:$=$.next=e}else h=$=e;s={baseState:c.baseState,firstBaseUpdate:h,lastBaseUpdate:$,shared:c.shared,effects:c.effects},i.updateQueue=s;return}i=s.lastBaseUpdate,i===null?s.firstBaseUpdate=e:i.next=e,s.lastBaseUpdate=e}function qh(i,e,s,c){var h=i.updateQueue;jh=!1;var $=h.firstBaseUpdate,_=h.lastBaseUpdate,j=h.shared.pending;if(j!==null){h.shared.pending=null;var nt=j,et=nt.next;nt.next=null,_===null?$=et:_.next=et,_=nt;var b=i.alternate;b!==null&&(b=b.updateQueue,j=b.lastBaseUpdate,j!==_&&(j===null?b.firstBaseUpdate=et:j.next=et,b.lastBaseUpdate=nt))}if($!==null){var a=h.baseState;_=0,b=et=nt=null,j=$;do{var o=j.lane,d=j.eventTime;if((c&o)===o){b!==null&&(b=b.next={eventTime:d,lane:0,tag:j.tag,payload:j.payload,callback:j.callback,next:null});e:{var g=i,rt=j;switch(o=e,d=s,rt.tag){case 1:if(g=rt.payload,typeof g=="function"){a=g.call(d,a,o);break e}a=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=rt.payload,o=typeof g=="function"?g.call(d,a,o):g,o==null)break e;a=A({},a,o);break e;case 2:jh=!0}}j.callback!==null&&j.lane!==0&&(i.flags|=64,o=h.effects,o===null?h.effects=[j]:o.push(j))}else d={eventTime:d,lane:o,tag:j.tag,payload:j.payload,callback:j.callback,next:null},b===null?(et=b=d,nt=a):b=b.next=d,_|=o;if(j=j.next,j===null){if(j=h.shared.pending,j===null)break;o=j,j=o.next,o.next=null,h.lastBaseUpdate=o,h.shared.pending=null}}while(!0);if(b===null&&(nt=a),h.baseState=nt,h.firstBaseUpdate=et,h.lastBaseUpdate=b,e=h.shared.interleaved,e!==null){h=e;do _|=h.lane,h=h.next;while(h!==e)}else $===null&&(h.shared.lanes=0);rh|=_,i.lanes=_,i.memoizedState=a}}function sh(i,e,s){if(i=e.effects,e.effects=null,i!==null)for(e=0;e<i.length;e++){var c=i[e],h=c.callback;if(h!==null){if(c.callback=null,c=s,typeof h!="function")throw Error(p(191,h));h.call(c)}}}var th={},uh=Uf(th),vh=Uf(th),wh=Uf(th);function xh(i){if(i===th)throw Error(p(174));return i}function yh(i,e){switch(G(wh,e),G(vh,i),G(uh,th),i=e.nodeType,i){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:lb(null,"");break;default:i=i===8?e.parentNode:e,e=i.namespaceURI||null,i=i.tagName,e=lb(e,i)}E(uh),G(uh,e)}function zh(){E(uh),E(vh),E(wh)}function Ah(i){xh(wh.current);var e=xh(uh.current),s=lb(e,i.type);e!==s&&(G(vh,i),G(uh,s))}function Bh(i){vh.current===i&&(E(uh),E(vh))}var L=Uf(0);function Ch(i){for(var e=i;e!==null;){if(e.tag===13){var s=e.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||s.data==="$?"||s.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===i)break;for(;e.sibling===null;){if(e.return===null||e.return===i)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var Dh=[];function Eh(){for(var i=0;i<Dh.length;i++)Dh[i]._workInProgressVersionPrimary=null;Dh.length=0}var Fh=ua$1.ReactCurrentDispatcher,Gh=ua$1.ReactCurrentBatchConfig,Hh=0,M=null,N=null,O=null,Ih=!1,Jh=!1,Kh=0,Lh=0;function P(){throw Error(p(321))}function Mh(i,e){if(e===null)return!1;for(var s=0;s<e.length&&s<i.length;s++)if(!He$1(i[s],e[s]))return!1;return!0}function Nh(i,e,s,c,h,$){if(Hh=$,M=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,Fh.current=i===null||i.memoizedState===null?Oh:Ph,i=s(c,h),Jh){$=0;do{if(Jh=!1,Kh=0,25<=$)throw Error(p(301));$+=1,O=N=null,e.updateQueue=null,Fh.current=Qh,i=s(c,h)}while(Jh)}if(Fh.current=Rh,e=N!==null&&N.next!==null,Hh=0,O=N=M=null,Ih=!1,e)throw Error(p(300));return i}function Sh(){var i=Kh!==0;return Kh=0,i}function Th(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return O===null?M.memoizedState=O=i:O=O.next=i,O}function Uh(){if(N===null){var i=M.alternate;i=i!==null?i.memoizedState:null}else i=N.next;var e=O===null?M.memoizedState:O.next;if(e!==null)O=e,N=i;else{if(i===null)throw Error(p(310));N=i,i={memoizedState:N.memoizedState,baseState:N.baseState,baseQueue:N.baseQueue,queue:N.queue,next:null},O===null?M.memoizedState=O=i:O=O.next=i}return O}function Vh(i,e){return typeof e=="function"?e(i):e}function Wh(i){var e=Uh(),s=e.queue;if(s===null)throw Error(p(311));s.lastRenderedReducer=i;var c=N,h=c.baseQueue,$=s.pending;if($!==null){if(h!==null){var _=h.next;h.next=$.next,$.next=_}c.baseQueue=h=$,s.pending=null}if(h!==null){$=h.next,c=c.baseState;var j=_=null,nt=null,et=$;do{var b=et.lane;if((Hh&b)===b)nt!==null&&(nt=nt.next={lane:0,action:et.action,hasEagerState:et.hasEagerState,eagerState:et.eagerState,next:null}),c=et.hasEagerState?et.eagerState:i(c,et.action);else{var a={lane:b,action:et.action,hasEagerState:et.hasEagerState,eagerState:et.eagerState,next:null};nt===null?(j=nt=a,_=c):nt=nt.next=a,M.lanes|=b,rh|=b}et=et.next}while(et!==null&&et!==$);nt===null?_=c:nt.next=j,He$1(c,e.memoizedState)||(dh=!0),e.memoizedState=c,e.baseState=_,e.baseQueue=nt,s.lastRenderedState=c}if(i=s.interleaved,i!==null){h=i;do $=h.lane,M.lanes|=$,rh|=$,h=h.next;while(h!==i)}else h===null&&(s.lanes=0);return[e.memoizedState,s.dispatch]}function Xh(i){var e=Uh(),s=e.queue;if(s===null)throw Error(p(311));s.lastRenderedReducer=i;var c=s.dispatch,h=s.pending,$=e.memoizedState;if(h!==null){s.pending=null;var _=h=h.next;do $=i($,_.action),_=_.next;while(_!==h);He$1($,e.memoizedState)||(dh=!0),e.memoizedState=$,e.baseQueue===null&&(e.baseState=$),s.lastRenderedState=$}return[$,c]}function Yh(){}function Zh(i,e){var s=M,c=Uh(),h=e(),$=!He$1(c.memoizedState,h);if($&&(c.memoizedState=h,dh=!0),c=c.queue,$h(ai.bind(null,s,c,i),[i]),c.getSnapshot!==e||$||O!==null&&O.memoizedState.tag&1){if(s.flags|=2048,bi(9,ci.bind(null,s,c,h,e),void 0,null),Q===null)throw Error(p(349));Hh&30||di(s,e,h)}return h}function di(i,e,s){i.flags|=16384,i={getSnapshot:e,value:s},e=M.updateQueue,e===null?(e={lastEffect:null,stores:null},M.updateQueue=e,e.stores=[i]):(s=e.stores,s===null?e.stores=[i]:s.push(i))}function ci(i,e,s,c){e.value=s,e.getSnapshot=c,ei(e)&&fi(i)}function ai(i,e,s){return s(function(){ei(e)&&fi(i)})}function ei(i){var e=i.getSnapshot;i=i.value;try{var s=e();return!He$1(i,s)}catch{return!0}}function fi(i){var e=ih(i,1);e!==null&&gi(e,i,1,-1)}function hi(i){var e=Th();return typeof i=="function"&&(i=i()),e.memoizedState=e.baseState=i,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Vh,lastRenderedState:i},e.queue=i,i=i.dispatch=ii.bind(null,M,i),[e.memoizedState,i]}function bi(i,e,s,c){return i={tag:i,create:e,destroy:s,deps:c,next:null},e=M.updateQueue,e===null?(e={lastEffect:null,stores:null},M.updateQueue=e,e.lastEffect=i.next=i):(s=e.lastEffect,s===null?e.lastEffect=i.next=i:(c=s.next,s.next=i,i.next=c,e.lastEffect=i)),i}function ji(){return Uh().memoizedState}function ki(i,e,s,c){var h=Th();M.flags|=i,h.memoizedState=bi(1|e,s,void 0,c===void 0?null:c)}function li(i,e,s,c){var h=Uh();c=c===void 0?null:c;var $=void 0;if(N!==null){var _=N.memoizedState;if($=_.destroy,c!==null&&Mh(c,_.deps)){h.memoizedState=bi(e,s,$,c);return}}M.flags|=i,h.memoizedState=bi(1|e,s,$,c)}function mi(i,e){return ki(8390656,8,i,e)}function $h(i,e){return li(2048,8,i,e)}function ni(i,e){return li(4,2,i,e)}function oi(i,e){return li(4,4,i,e)}function pi(i,e){if(typeof e=="function")return i=i(),e(i),function(){e(null)};if(e!=null)return i=i(),e.current=i,function(){e.current=null}}function qi(i,e,s){return s=s!=null?s.concat([i]):null,li(4,4,pi.bind(null,e,i),s)}function ri(){}function si(i,e){var s=Uh();e=e===void 0?null:e;var c=s.memoizedState;return c!==null&&e!==null&&Mh(e,c[1])?c[0]:(s.memoizedState=[i,e],i)}function ti(i,e){var s=Uh();e=e===void 0?null:e;var c=s.memoizedState;return c!==null&&e!==null&&Mh(e,c[1])?c[0]:(i=i(),s.memoizedState=[i,e],i)}function ui(i,e,s){return Hh&21?(He$1(s,e)||(s=yc(),M.lanes|=s,rh|=s,i.baseState=!0),e):(i.baseState&&(i.baseState=!1,dh=!0),i.memoizedState=s)}function vi(i,e){var s=C;C=s!==0&&4>s?s:4,i(!0);var c=Gh.transition;Gh.transition={};try{i(!1),e()}finally{C=s,Gh.transition=c}}function wi(){return Uh().memoizedState}function xi(i,e,s){var c=yi(i);if(s={lane:c,action:s,hasEagerState:!1,eagerState:null,next:null},zi(i))Ai(e,s);else if(s=hh(i,e,s,c),s!==null){var h=R();gi(s,i,c,h),Bi(s,e,c)}}function ii(i,e,s){var c=yi(i),h={lane:c,action:s,hasEagerState:!1,eagerState:null,next:null};if(zi(i))Ai(e,h);else{var $=i.alternate;if(i.lanes===0&&($===null||$.lanes===0)&&($=e.lastRenderedReducer,$!==null))try{var _=e.lastRenderedState,j=$(_,s);if(h.hasEagerState=!0,h.eagerState=j,He$1(j,_)){var nt=e.interleaved;nt===null?(h.next=h,gh(e)):(h.next=nt.next,nt.next=h),e.interleaved=h;return}}catch{}finally{}s=hh(i,e,h,c),s!==null&&(h=R(),gi(s,i,c,h),Bi(s,e,c))}}function zi(i){var e=i.alternate;return i===M||e!==null&&e===M}function Ai(i,e){Jh=Ih=!0;var s=i.pending;s===null?e.next=e:(e.next=s.next,s.next=e),i.pending=e}function Bi(i,e,s){if(s&4194240){var c=e.lanes;c&=i.pendingLanes,s|=c,e.lanes=s,Cc(i,s)}}var Rh={readContext:eh,useCallback:P,useContext:P,useEffect:P,useImperativeHandle:P,useInsertionEffect:P,useLayoutEffect:P,useMemo:P,useReducer:P,useRef:P,useState:P,useDebugValue:P,useDeferredValue:P,useTransition:P,useMutableSource:P,useSyncExternalStore:P,useId:P,unstable_isNewReconciler:!1},Oh={readContext:eh,useCallback:function(i,e){return Th().memoizedState=[i,e===void 0?null:e],i},useContext:eh,useEffect:mi,useImperativeHandle:function(i,e,s){return s=s!=null?s.concat([i]):null,ki(4194308,4,pi.bind(null,e,i),s)},useLayoutEffect:function(i,e){return ki(4194308,4,i,e)},useInsertionEffect:function(i,e){return ki(4,2,i,e)},useMemo:function(i,e){var s=Th();return e=e===void 0?null:e,i=i(),s.memoizedState=[i,e],i},useReducer:function(i,e,s){var c=Th();return e=s!==void 0?s(e):e,c.memoizedState=c.baseState=e,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:e},c.queue=i,i=i.dispatch=xi.bind(null,M,i),[c.memoizedState,i]},useRef:function(i){var e=Th();return i={current:i},e.memoizedState=i},useState:hi,useDebugValue:ri,useDeferredValue:function(i){return Th().memoizedState=i},useTransition:function(){var i=hi(!1),e=i[0];return i=vi.bind(null,i[1]),Th().memoizedState=i,[e,i]},useMutableSource:function(){},useSyncExternalStore:function(i,e,s){var c=M,h=Th();if(I){if(s===void 0)throw Error(p(407));s=s()}else{if(s=e(),Q===null)throw Error(p(349));Hh&30||di(c,e,s)}h.memoizedState=s;var $={value:s,getSnapshot:e};return h.queue=$,mi(ai.bind(null,c,$,i),[i]),c.flags|=2048,bi(9,ci.bind(null,c,$,s,e),void 0,null),s},useId:function(){var i=Th(),e=Q.identifierPrefix;if(I){var s=sg,c=rg;s=(c&~(1<<32-oc(c)-1)).toString(32)+s,e=":"+e+"R"+s,s=Kh++,0<s&&(e+="H"+s.toString(32)),e+=":"}else s=Lh++,e=":"+e+"r"+s.toString(32)+":";return i.memoizedState=e},unstable_isNewReconciler:!1},Ph={readContext:eh,useCallback:si,useContext:eh,useEffect:$h,useImperativeHandle:qi,useInsertionEffect:ni,useLayoutEffect:oi,useMemo:ti,useReducer:Wh,useRef:ji,useState:function(){return Wh(Vh)},useDebugValue:ri,useDeferredValue:function(i){var e=Uh();return ui(e,N.memoizedState,i)},useTransition:function(){var i=Wh(Vh)[0],e=Uh().memoizedState;return[i,e]},useMutableSource:Yh,useSyncExternalStore:Zh,useId:wi,unstable_isNewReconciler:!1},Qh={readContext:eh,useCallback:si,useContext:eh,useEffect:$h,useImperativeHandle:qi,useInsertionEffect:ni,useLayoutEffect:oi,useMemo:ti,useReducer:Xh,useRef:ji,useState:function(){return Xh(Vh)},useDebugValue:ri,useDeferredValue:function(i){var e=Uh();return N===null?e.memoizedState=i:ui(e,N.memoizedState,i)},useTransition:function(){var i=Xh(Vh)[0],e=Uh().memoizedState;return[i,e]},useMutableSource:Yh,useSyncExternalStore:Zh,useId:wi,unstable_isNewReconciler:!1};function Ci(i,e){if(i&&i.defaultProps){e=A({},e),i=i.defaultProps;for(var s in i)e[s]===void 0&&(e[s]=i[s]);return e}return e}function Di(i,e,s,c){e=i.memoizedState,s=s(c,e),s=s==null?e:A({},e,s),i.memoizedState=s,i.lanes===0&&(i.updateQueue.baseState=s)}var Ei={isMounted:function(i){return(i=i._reactInternals)?Vb(i)===i:!1},enqueueSetState:function(i,e,s){i=i._reactInternals;var c=R(),h=yi(i),$=mh(c,h);$.payload=e,s!=null&&($.callback=s),e=nh(i,$,h),e!==null&&(gi(e,i,h,c),oh(e,i,h))},enqueueReplaceState:function(i,e,s){i=i._reactInternals;var c=R(),h=yi(i),$=mh(c,h);$.tag=1,$.payload=e,s!=null&&($.callback=s),e=nh(i,$,h),e!==null&&(gi(e,i,h,c),oh(e,i,h))},enqueueForceUpdate:function(i,e){i=i._reactInternals;var s=R(),c=yi(i),h=mh(s,c);h.tag=2,e!=null&&(h.callback=e),e=nh(i,h,c),e!==null&&(gi(e,i,c,s),oh(e,i,c))}};function Fi(i,e,s,c,h,$,_){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(c,$,_):e.prototype&&e.prototype.isPureReactComponent?!Ie$1(s,c)||!Ie$1(h,$):!0}function Gi(i,e,s){var c=!1,h=Vf,$=e.contextType;return typeof $=="object"&&$!==null?$=eh($):(h=Zf(e)?Xf:H.current,c=e.contextTypes,$=(c=c!=null)?Yf(i,h):Vf),e=new e(s,$),i.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=Ei,i.stateNode=e,e._reactInternals=i,c&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=h,i.__reactInternalMemoizedMaskedChildContext=$),e}function Hi(i,e,s,c){i=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(s,c),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(s,c),e.state!==i&&Ei.enqueueReplaceState(e,e.state,null)}function Ii(i,e,s,c){var h=i.stateNode;h.props=s,h.state=i.memoizedState,h.refs={},kh(i);var $=e.contextType;typeof $=="object"&&$!==null?h.context=eh($):($=Zf(e)?Xf:H.current,h.context=Yf(i,$)),h.state=i.memoizedState,$=e.getDerivedStateFromProps,typeof $=="function"&&(Di(i,e,$,s),h.state=i.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(e=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),e!==h.state&&Ei.enqueueReplaceState(h,h.state,null),qh(i,s,h,c),h.state=i.memoizedState),typeof h.componentDidMount=="function"&&(i.flags|=4194308)}function Ji(i,e){try{var s="",c=e;do s+=Pa$1(c),c=c.return;while(c);var h=s}catch($){h=`
|
|
39
39
|
Error generating stack: `+$.message+`
|
|
40
|
-
`+$.stack}return{value:i,source:e,stack:h,digest:null}}function Ki(i,e,s){return{value:i,source:null,stack:s??null,digest:e??null}}function Li(i,e){try{console.error(e.value)}catch(s){setTimeout(function(){throw s})}}var Mi=typeof WeakMap=="function"?WeakMap:Map;function Ni(i,e,s){s=mh(-1,s),s.tag=3,s.payload={element:null};var c=e.value;return s.callback=function(){Oi||(Oi=!0,Pi=c),Li(i,e)},s}function Qi(i,e,s){s=mh(-1,s),s.tag=3;var c=i.type.getDerivedStateFromError;if(typeof c=="function"){var h=e.value;s.payload=function(){return c(h)},s.callback=function(){Li(i,e)}}var $=i.stateNode;return $!==null&&typeof $.componentDidCatch=="function"&&(s.callback=function(){Li(i,e),typeof c!="function"&&(Ri===null?Ri=new Set([this]):Ri.add(this));var _=e.stack;this.componentDidCatch(e.value,{componentStack:_!==null?_:""})}),s}function Si(i,e,s){var c=i.pingCache;if(c===null){c=i.pingCache=new Mi;var h=new Set;c.set(e,h)}else h=c.get(e),h===void 0&&(h=new Set,c.set(e,h));h.has(s)||(h.add(s),i=Ti.bind(null,i,e,s),e.then(i,i))}function Ui(i){do{var e;if((e=i.tag===13)&&(e=i.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return i;i=i.return}while(i!==null);return null}function Vi(i,e,s,c,h){return i.mode&1?(i.flags|=65536,i.lanes=h,i):(i===e?i.flags|=65536:(i.flags|=128,s.flags|=131072,s.flags&=-52805,s.tag===1&&(s.alternate===null?s.tag=17:(e=mh(-1,1),e.tag=2,nh(s,e,1))),s.lanes|=1),i)}var Wi=ua$1.ReactCurrentOwner,dh=!1;function Xi(i,e,s,c){e.child=i===null?Vg(e,null,s,c):Ug(e,i.child,s,c)}function Yi(i,e,s,c,h){s=s.render;var $=e.ref;return ch(e,h),c=Nh(i,e,s,c,$,h),s=Sh(),i!==null&&!dh?(e.updateQueue=i.updateQueue,e.flags&=-2053,i.lanes&=~h,Zi(i,e,h)):(I&&s&&vg(e),e.flags|=1,Xi(i,e,c,h),e.child)}function $i(i,e,s,c,h){if(i===null){var $=s.type;return typeof $=="function"&&!aj($)&&$.defaultProps===void 0&&s.compare===null&&s.defaultProps===void 0?(e.tag=15,e.type=$,bj(i,e,$,c,h)):(i=Rg(s.type,null,c,e,e.mode,h),i.ref=e.ref,i.return=e,e.child=i)}if($=i.child,!(i.lanes&h)){var _=$.memoizedProps;if(s=s.compare,s=s!==null?s:Ie$1,s(_,c)&&i.ref===e.ref)return Zi(i,e,h)}return e.flags|=1,i=Pg($,c),i.ref=e.ref,i.return=e,e.child=i}function bj(i,e,s,c,h){if(i!==null){var $=i.memoizedProps;if(Ie$1($,c)&&i.ref===e.ref)if(dh=!1,e.pendingProps=c=$,(i.lanes&h)!==0)i.flags&131072&&(dh=!0);else return e.lanes=i.lanes,Zi(i,e,h)}return cj(i,e,s,c,h)}function dj(i,e,s){var c=e.pendingProps,h=c.children,$=i!==null?i.memoizedState:null;if(c.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},G(ej,fj),fj|=s;else{if(!(s&1073741824))return i=$!==null?$.baseLanes|s:s,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:i,cachePool:null,transitions:null},e.updateQueue=null,G(ej,fj),fj|=i,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},c=$!==null?$.baseLanes:s,G(ej,fj),fj|=c}else $!==null?(c=$.baseLanes|s,e.memoizedState=null):c=s,G(ej,fj),fj|=c;return Xi(i,e,h,s),e.child}function gj(i,e){var s=e.ref;(i===null&&s!==null||i!==null&&i.ref!==s)&&(e.flags|=512,e.flags|=2097152)}function cj(i,e,s,c,h){var $=Zf(s)?Xf:H.current;return $=Yf(e,$),ch(e,h),s=Nh(i,e,s,c,$,h),c=Sh(),i!==null&&!dh?(e.updateQueue=i.updateQueue,e.flags&=-2053,i.lanes&=~h,Zi(i,e,h)):(I&&c&&vg(e),e.flags|=1,Xi(i,e,s,h),e.child)}function hj(i,e,s,c,h){if(Zf(s)){var $=!0;cg(e)}else $=!1;if(ch(e,h),e.stateNode===null)ij(i,e),Gi(e,s,c),Ii(e,s,c,h),c=!0;else if(i===null){var _=e.stateNode,j=e.memoizedProps;_.props=j;var nt=_.context,et=s.contextType;typeof et=="object"&&et!==null?et=eh(et):(et=Zf(s)?Xf:H.current,et=Yf(e,et));var b=s.getDerivedStateFromProps,a=typeof b=="function"||typeof _.getSnapshotBeforeUpdate=="function";a||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(j!==c||nt!==et)&&Hi(e,_,c,et),jh=!1;var o=e.memoizedState;_.state=o,qh(e,c,_,h),nt=e.memoizedState,j!==c||o!==nt||Wf.current||jh?(typeof b=="function"&&(Di(e,s,b,c),nt=e.memoizedState),(j=jh||Fi(e,s,j,c,o,nt,et))?(a||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount()),typeof _.componentDidMount=="function"&&(e.flags|=4194308)):(typeof _.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=c,e.memoizedState=nt),_.props=c,_.state=nt,_.context=et,c=j):(typeof _.componentDidMount=="function"&&(e.flags|=4194308),c=!1)}else{_=e.stateNode,lh(i,e),j=e.memoizedProps,et=e.type===e.elementType?j:Ci(e.type,j),_.props=et,a=e.pendingProps,o=_.context,nt=s.contextType,typeof nt=="object"&&nt!==null?nt=eh(nt):(nt=Zf(s)?Xf:H.current,nt=Yf(e,nt));var d=s.getDerivedStateFromProps;(b=typeof d=="function"||typeof _.getSnapshotBeforeUpdate=="function")||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(j!==a||o!==nt)&&Hi(e,_,c,nt),jh=!1,o=e.memoizedState,_.state=o,qh(e,c,_,h);var g=e.memoizedState;j!==a||o!==g||Wf.current||jh?(typeof d=="function"&&(Di(e,s,d,c),g=e.memoizedState),(et=jh||Fi(e,s,et,c,o,g,nt)||!1)?(b||typeof _.UNSAFE_componentWillUpdate!="function"&&typeof _.componentWillUpdate!="function"||(typeof _.componentWillUpdate=="function"&&_.componentWillUpdate(c,g,nt),typeof _.UNSAFE_componentWillUpdate=="function"&&_.UNSAFE_componentWillUpdate(c,g,nt)),typeof _.componentDidUpdate=="function"&&(e.flags|=4),typeof _.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof _.componentDidUpdate!="function"||j===i.memoizedProps&&o===i.memoizedState||(e.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||j===i.memoizedProps&&o===i.memoizedState||(e.flags|=1024),e.memoizedProps=c,e.memoizedState=g),_.props=c,_.state=g,_.context=nt,c=et):(typeof _.componentDidUpdate!="function"||j===i.memoizedProps&&o===i.memoizedState||(e.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||j===i.memoizedProps&&o===i.memoizedState||(e.flags|=1024),c=!1)}return jj(i,e,s,c,$,h)}function jj(i,e,s,c,h,$){gj(i,e);var _=(e.flags&128)!==0;if(!c&&!_)return h&&dg(e,s,!1),Zi(i,e,$);c=e.stateNode,Wi.current=e;var j=_&&typeof s.getDerivedStateFromError!="function"?null:c.render();return e.flags|=1,i!==null&&_?(e.child=Ug(e,i.child,null,$),e.child=Ug(e,null,j,$)):Xi(i,e,j,$),e.memoizedState=c.state,h&&dg(e,s,!0),e.child}function kj(i){var e=i.stateNode;e.pendingContext?ag(i,e.pendingContext,e.pendingContext!==e.context):e.context&&ag(i,e.context,!1),yh(i,e.containerInfo)}function lj(i,e,s,c,h){return Ig(),Jg(h),e.flags|=256,Xi(i,e,s,c),e.child}var mj={dehydrated:null,treeContext:null,retryLane:0};function nj(i){return{baseLanes:i,cachePool:null,transitions:null}}function oj(i,e,s){var c=e.pendingProps,h=L.current,$=!1,_=(e.flags&128)!==0,j;if((j=_)||(j=i!==null&&i.memoizedState===null?!1:(h&2)!==0),j?($=!0,e.flags&=-129):(i===null||i.memoizedState!==null)&&(h|=1),G(L,h&1),i===null)return Eg(e),i=e.memoizedState,i!==null&&(i=i.dehydrated,i!==null)?(e.mode&1?i.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(_=c.children,i=c.fallback,$?(c=e.mode,$=e.child,_={mode:"hidden",children:_},!(c&1)&&$!==null?($.childLanes=0,$.pendingProps=_):$=pj(_,c,0,null),i=Tg(i,c,s,null),$.return=e,i.return=e,$.sibling=i,e.child=$,e.child.memoizedState=nj(s),e.memoizedState=mj,i):qj(e,_));if(h=i.memoizedState,h!==null&&(j=h.dehydrated,j!==null))return rj(i,e,_,c,j,h,s);if($){$=c.fallback,_=e.mode,h=i.child,j=h.sibling;var nt={mode:"hidden",children:c.children};return!(_&1)&&e.child!==h?(c=e.child,c.childLanes=0,c.pendingProps=nt,e.deletions=null):(c=Pg(h,nt),c.subtreeFlags=h.subtreeFlags&14680064),j!==null?$=Pg(j,$):($=Tg($,_,s,null),$.flags|=2),$.return=e,c.return=e,c.sibling=$,e.child=c,c=$,$=e.child,_=i.child.memoizedState,_=_===null?nj(s):{baseLanes:_.baseLanes|s,cachePool:null,transitions:_.transitions},$.memoizedState=_,$.childLanes=i.childLanes&~s,e.memoizedState=mj,c}return $=i.child,i=$.sibling,c=Pg($,{mode:"visible",children:c.children}),!(e.mode&1)&&(c.lanes=s),c.return=e,c.sibling=null,i!==null&&(s=e.deletions,s===null?(e.deletions=[i],e.flags|=16):s.push(i)),e.child=c,e.memoizedState=null,c}function qj(i,e){return e=pj({mode:"visible",children:e},i.mode,0,null),e.return=i,i.child=e}function sj(i,e,s,c){return c!==null&&Jg(c),Ug(e,i.child,null,s),i=qj(e,e.pendingProps.children),i.flags|=2,e.memoizedState=null,i}function rj(i,e,s,c,h,$,_){if(s)return e.flags&256?(e.flags&=-257,c=Ki(Error(p(422))),sj(i,e,_,c)):e.memoizedState!==null?(e.child=i.child,e.flags|=128,null):($=c.fallback,h=e.mode,c=pj({mode:"visible",children:c.children},h,0,null),$=Tg($,h,_,null),$.flags|=2,c.return=e,$.return=e,c.sibling=$,e.child=c,e.mode&1&&Ug(e,i.child,null,_),e.child.memoizedState=nj(_),e.memoizedState=mj,$);if(!(e.mode&1))return sj(i,e,_,null);if(h.data==="$!"){if(c=h.nextSibling&&h.nextSibling.dataset,c)var j=c.dgst;return c=j,$=Error(p(419)),c=Ki($,c,void 0),sj(i,e,_,c)}if(j=(_&i.childLanes)!==0,dh||j){if(c=Q,c!==null){switch(_&-_){case 4:h=2;break;case 16:h=8;break;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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:h=32;break;case 536870912:h=268435456;break;default:h=0}h=h&(c.suspendedLanes|_)?0:h,h!==0&&h!==$.retryLane&&($.retryLane=h,ih(i,h),gi(c,i,h,-1))}return tj(),c=Ki(Error(p(421))),sj(i,e,_,c)}return h.data==="$?"?(e.flags|=128,e.child=i.child,e=uj.bind(null,i),h._reactRetry=e,null):(i=$.treeContext,yg=Lf(h.nextSibling),xg=e,I=!0,zg=null,i!==null&&(og[pg++]=rg,og[pg++]=sg,og[pg++]=qg,rg=i.id,sg=i.overflow,qg=e),e=qj(e,c.children),e.flags|=4096,e)}function vj(i,e,s){i.lanes|=e;var c=i.alternate;c!==null&&(c.lanes|=e),bh(i.return,e,s)}function wj(i,e,s,c,h){var $=i.memoizedState;$===null?i.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:c,tail:s,tailMode:h}:($.isBackwards=e,$.rendering=null,$.renderingStartTime=0,$.last=c,$.tail=s,$.tailMode=h)}function xj(i,e,s){var c=e.pendingProps,h=c.revealOrder,$=c.tail;if(Xi(i,e,c.children,s),c=L.current,c&2)c=c&1|2,e.flags|=128;else{if(i!==null&&i.flags&128)e:for(i=e.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&vj(i,s,e);else if(i.tag===19)vj(i,s,e);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===e)break e;for(;i.sibling===null;){if(i.return===null||i.return===e)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}c&=1}if(G(L,c),!(e.mode&1))e.memoizedState=null;else switch(h){case"forwards":for(s=e.child,h=null;s!==null;)i=s.alternate,i!==null&&Ch(i)===null&&(h=s),s=s.sibling;s=h,s===null?(h=e.child,e.child=null):(h=s.sibling,s.sibling=null),wj(e,!1,h,s,$);break;case"backwards":for(s=null,h=e.child,e.child=null;h!==null;){if(i=h.alternate,i!==null&&Ch(i)===null){e.child=h;break}i=h.sibling,h.sibling=s,s=h,h=i}wj(e,!0,s,null,$);break;case"together":wj(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function ij(i,e){!(e.mode&1)&&i!==null&&(i.alternate=null,e.alternate=null,e.flags|=2)}function Zi(i,e,s){if(i!==null&&(e.dependencies=i.dependencies),rh|=e.lanes,!(s&e.childLanes))return null;if(i!==null&&e.child!==i.child)throw Error(p(153));if(e.child!==null){for(i=e.child,s=Pg(i,i.pendingProps),e.child=s,s.return=e;i.sibling!==null;)i=i.sibling,s=s.sibling=Pg(i,i.pendingProps),s.return=e;s.sibling=null}return e.child}function yj(i,e,s){switch(e.tag){case 3:kj(e),Ig();break;case 5:Ah(e);break;case 1:Zf(e.type)&&cg(e);break;case 4:yh(e,e.stateNode.containerInfo);break;case 10:var c=e.type._context,h=e.memoizedProps.value;G(Wg,c._currentValue),c._currentValue=h;break;case 13:if(c=e.memoizedState,c!==null)return c.dehydrated!==null?(G(L,L.current&1),e.flags|=128,null):s&e.child.childLanes?oj(i,e,s):(G(L,L.current&1),i=Zi(i,e,s),i!==null?i.sibling:null);G(L,L.current&1);break;case 19:if(c=(s&e.childLanes)!==0,i.flags&128){if(c)return xj(i,e,s);e.flags|=128}if(h=e.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),G(L,L.current),c)break;return null;case 22:case 23:return e.lanes=0,dj(i,e,s)}return Zi(i,e,s)}var zj,Aj,Bj,Cj;zj=function(i,e){for(var s=e.child;s!==null;){if(s.tag===5||s.tag===6)i.appendChild(s.stateNode);else if(s.tag!==4&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===e)break;for(;s.sibling===null;){if(s.return===null||s.return===e)return;s=s.return}s.sibling.return=s.return,s=s.sibling}},Aj=function(){},Bj=function(i,e,s,c){var h=i.memoizedProps;if(h!==c){i=e.stateNode,xh(uh.current);var $=null;switch(s){case"input":h=Ya$1(i,h),c=Ya$1(i,c),$=[];break;case"select":h=A({},h,{value:void 0}),c=A({},c,{value:void 0}),$=[];break;case"textarea":h=gb(i,h),c=gb(i,c),$=[];break;default:typeof h.onClick!="function"&&typeof c.onClick=="function"&&(i.onclick=Bf)}ub(s,c);var _;s=null;for(et in h)if(!c.hasOwnProperty(et)&&h.hasOwnProperty(et)&&h[et]!=null)if(et==="style"){var j=h[et];for(_ in j)j.hasOwnProperty(_)&&(s||(s={}),s[_]="")}else et!=="dangerouslySetInnerHTML"&&et!=="children"&&et!=="suppressContentEditableWarning"&&et!=="suppressHydrationWarning"&&et!=="autoFocus"&&(ea$1.hasOwnProperty(et)?$||($=[]):($=$||[]).push(et,null));for(et in c){var nt=c[et];if(j=h!=null?h[et]:void 0,c.hasOwnProperty(et)&&nt!==j&&(nt!=null||j!=null))if(et==="style")if(j){for(_ in j)!j.hasOwnProperty(_)||nt&&nt.hasOwnProperty(_)||(s||(s={}),s[_]="");for(_ in nt)nt.hasOwnProperty(_)&&j[_]!==nt[_]&&(s||(s={}),s[_]=nt[_])}else s||($||($=[]),$.push(et,s)),s=nt;else et==="dangerouslySetInnerHTML"?(nt=nt?nt.__html:void 0,j=j?j.__html:void 0,nt!=null&&j!==nt&&($=$||[]).push(et,nt)):et==="children"?typeof nt!="string"&&typeof nt!="number"||($=$||[]).push(et,""+nt):et!=="suppressContentEditableWarning"&&et!=="suppressHydrationWarning"&&(ea$1.hasOwnProperty(et)?(nt!=null&&et==="onScroll"&&D("scroll",i),$||j===nt||($=[])):($=$||[]).push(et,nt))}s&&($=$||[]).push("style",s);var et=$;(e.updateQueue=et)&&(e.flags|=4)}},Cj=function(i,e,s,c){s!==c&&(e.flags|=4)};function Dj(i,e){if(!I)switch(i.tailMode){case"hidden":e=i.tail;for(var s=null;e!==null;)e.alternate!==null&&(s=e),e=e.sibling;s===null?i.tail=null:s.sibling=null;break;case"collapsed":s=i.tail;for(var c=null;s!==null;)s.alternate!==null&&(c=s),s=s.sibling;c===null?e||i.tail===null?i.tail=null:i.tail.sibling=null:c.sibling=null}}function S(i){var e=i.alternate!==null&&i.alternate.child===i.child,s=0,c=0;if(e)for(var h=i.child;h!==null;)s|=h.lanes|h.childLanes,c|=h.subtreeFlags&14680064,c|=h.flags&14680064,h.return=i,h=h.sibling;else for(h=i.child;h!==null;)s|=h.lanes|h.childLanes,c|=h.subtreeFlags,c|=h.flags,h.return=i,h=h.sibling;return i.subtreeFlags|=c,i.childLanes=s,e}function Ej(i,e,s){var c=e.pendingProps;switch(wg(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return S(e),null;case 1:return Zf(e.type)&&$f(),S(e),null;case 3:return c=e.stateNode,zh(),E(Wf),E(H),Eh(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(i===null||i.child===null)&&(Gg(e)?e.flags|=4:i===null||i.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,zg!==null&&(Fj(zg),zg=null))),Aj(i,e),S(e),null;case 5:Bh(e);var h=xh(wh.current);if(s=e.type,i!==null&&e.stateNode!=null)Bj(i,e,s,c,h),i.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!c){if(e.stateNode===null)throw Error(p(166));return S(e),null}if(i=xh(uh.current),Gg(e)){c=e.stateNode,s=e.type;var $=e.memoizedProps;switch(c[Of]=e,c[Pf]=$,i=(e.mode&1)!==0,s){case"dialog":D("cancel",c),D("close",c);break;case"iframe":case"object":case"embed":D("load",c);break;case"video":case"audio":for(h=0;h<lf.length;h++)D(lf[h],c);break;case"source":D("error",c);break;case"img":case"image":case"link":D("error",c),D("load",c);break;case"details":D("toggle",c);break;case"input":Za$1(c,$),D("invalid",c);break;case"select":c._wrapperState={wasMultiple:!!$.multiple},D("invalid",c);break;case"textarea":hb(c,$),D("invalid",c)}ub(s,$),h=null;for(var _ in $)if($.hasOwnProperty(_)){var j=$[_];_==="children"?typeof j=="string"?c.textContent!==j&&($.suppressHydrationWarning!==!0&&Af(c.textContent,j,i),h=["children",j]):typeof j=="number"&&c.textContent!==""+j&&($.suppressHydrationWarning!==!0&&Af(c.textContent,j,i),h=["children",""+j]):ea$1.hasOwnProperty(_)&&j!=null&&_==="onScroll"&&D("scroll",c)}switch(s){case"input":Va$1(c),db(c,$,!0);break;case"textarea":Va$1(c),jb(c);break;case"select":case"option":break;default:typeof $.onClick=="function"&&(c.onclick=Bf)}c=h,e.updateQueue=c,c!==null&&(e.flags|=4)}else{_=h.nodeType===9?h:h.ownerDocument,i==="http://www.w3.org/1999/xhtml"&&(i=kb(s)),i==="http://www.w3.org/1999/xhtml"?s==="script"?(i=_.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild)):typeof c.is=="string"?i=_.createElement(s,{is:c.is}):(i=_.createElement(s),s==="select"&&(_=i,c.multiple?_.multiple=!0:c.size&&(_.size=c.size))):i=_.createElementNS(i,s),i[Of]=e,i[Pf]=c,zj(i,e,!1,!1),e.stateNode=i;e:{switch(_=vb(s,c),s){case"dialog":D("cancel",i),D("close",i),h=c;break;case"iframe":case"object":case"embed":D("load",i),h=c;break;case"video":case"audio":for(h=0;h<lf.length;h++)D(lf[h],i);h=c;break;case"source":D("error",i),h=c;break;case"img":case"image":case"link":D("error",i),D("load",i),h=c;break;case"details":D("toggle",i),h=c;break;case"input":Za$1(i,c),h=Ya$1(i,c),D("invalid",i);break;case"option":h=c;break;case"select":i._wrapperState={wasMultiple:!!c.multiple},h=A({},c,{value:void 0}),D("invalid",i);break;case"textarea":hb(i,c),h=gb(i,c),D("invalid",i);break;default:h=c}ub(s,h),j=h;for($ in j)if(j.hasOwnProperty($)){var nt=j[$];$==="style"?sb(i,nt):$==="dangerouslySetInnerHTML"?(nt=nt?nt.__html:void 0,nt!=null&&nb(i,nt)):$==="children"?typeof nt=="string"?(s!=="textarea"||nt!=="")&&ob(i,nt):typeof nt=="number"&&ob(i,""+nt):$!=="suppressContentEditableWarning"&&$!=="suppressHydrationWarning"&&$!=="autoFocus"&&(ea$1.hasOwnProperty($)?nt!=null&&$==="onScroll"&&D("scroll",i):nt!=null&&ta$1(i,$,nt,_))}switch(s){case"input":Va$1(i),db(i,c,!1);break;case"textarea":Va$1(i),jb(i);break;case"option":c.value!=null&&i.setAttribute("value",""+Sa$1(c.value));break;case"select":i.multiple=!!c.multiple,$=c.value,$!=null?fb(i,!!c.multiple,$,!1):c.defaultValue!=null&&fb(i,!!c.multiple,c.defaultValue,!0);break;default:typeof h.onClick=="function"&&(i.onclick=Bf)}switch(s){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}}c&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return S(e),null;case 6:if(i&&e.stateNode!=null)Cj(i,e,i.memoizedProps,c);else{if(typeof c!="string"&&e.stateNode===null)throw Error(p(166));if(s=xh(wh.current),xh(uh.current),Gg(e)){if(c=e.stateNode,s=e.memoizedProps,c[Of]=e,($=c.nodeValue!==s)&&(i=xg,i!==null))switch(i.tag){case 3:Af(c.nodeValue,s,(i.mode&1)!==0);break;case 5:i.memoizedProps.suppressHydrationWarning!==!0&&Af(c.nodeValue,s,(i.mode&1)!==0)}$&&(e.flags|=4)}else c=(s.nodeType===9?s:s.ownerDocument).createTextNode(c),c[Of]=e,e.stateNode=c}return S(e),null;case 13:if(E(L),c=e.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(I&&yg!==null&&e.mode&1&&!(e.flags&128))Hg(),Ig(),e.flags|=98560,$=!1;else if($=Gg(e),c!==null&&c.dehydrated!==null){if(i===null){if(!$)throw Error(p(318));if($=e.memoizedState,$=$!==null?$.dehydrated:null,!$)throw Error(p(317));$[Of]=e}else Ig(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;S(e),$=!1}else zg!==null&&(Fj(zg),zg=null),$=!0;if(!$)return e.flags&65536?e:null}return e.flags&128?(e.lanes=s,e):(c=c!==null,c!==(i!==null&&i.memoizedState!==null)&&c&&(e.child.flags|=8192,e.mode&1&&(i===null||L.current&1?T===0&&(T=3):tj())),e.updateQueue!==null&&(e.flags|=4),S(e),null);case 4:return zh(),Aj(i,e),i===null&&sf(e.stateNode.containerInfo),S(e),null;case 10:return ah(e.type._context),S(e),null;case 17:return Zf(e.type)&&$f(),S(e),null;case 19:if(E(L),$=e.memoizedState,$===null)return S(e),null;if(c=(e.flags&128)!==0,_=$.rendering,_===null)if(c)Dj($,!1);else{if(T!==0||i!==null&&i.flags&128)for(i=e.child;i!==null;){if(_=Ch(i),_!==null){for(e.flags|=128,Dj($,!1),c=_.updateQueue,c!==null&&(e.updateQueue=c,e.flags|=4),e.subtreeFlags=0,c=s,s=e.child;s!==null;)$=s,i=c,$.flags&=14680066,_=$.alternate,_===null?($.childLanes=0,$.lanes=i,$.child=null,$.subtreeFlags=0,$.memoizedProps=null,$.memoizedState=null,$.updateQueue=null,$.dependencies=null,$.stateNode=null):($.childLanes=_.childLanes,$.lanes=_.lanes,$.child=_.child,$.subtreeFlags=0,$.deletions=null,$.memoizedProps=_.memoizedProps,$.memoizedState=_.memoizedState,$.updateQueue=_.updateQueue,$.type=_.type,i=_.dependencies,$.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),s=s.sibling;return G(L,L.current&1|2),e.child}i=i.sibling}$.tail!==null&&B()>Gj&&(e.flags|=128,c=!0,Dj($,!1),e.lanes=4194304)}else{if(!c)if(i=Ch(_),i!==null){if(e.flags|=128,c=!0,s=i.updateQueue,s!==null&&(e.updateQueue=s,e.flags|=4),Dj($,!0),$.tail===null&&$.tailMode==="hidden"&&!_.alternate&&!I)return S(e),null}else 2*B()-$.renderingStartTime>Gj&&s!==1073741824&&(e.flags|=128,c=!0,Dj($,!1),e.lanes=4194304);$.isBackwards?(_.sibling=e.child,e.child=_):(s=$.last,s!==null?s.sibling=_:e.child=_,$.last=_)}return $.tail!==null?(e=$.tail,$.rendering=e,$.tail=e.sibling,$.renderingStartTime=B(),e.sibling=null,s=L.current,G(L,c?s&1|2:s&1),e):(S(e),null);case 22:case 23:return Hj(),c=e.memoizedState!==null,i!==null&&i.memoizedState!==null!==c&&(e.flags|=8192),c&&e.mode&1?fj&1073741824&&(S(e),e.subtreeFlags&6&&(e.flags|=8192)):S(e),null;case 24:return null;case 25:return null}throw Error(p(156,e.tag))}function Ij(i,e){switch(wg(e),e.tag){case 1:return Zf(e.type)&&$f(),i=e.flags,i&65536?(e.flags=i&-65537|128,e):null;case 3:return zh(),E(Wf),E(H),Eh(),i=e.flags,i&65536&&!(i&128)?(e.flags=i&-65537|128,e):null;case 5:return Bh(e),null;case 13:if(E(L),i=e.memoizedState,i!==null&&i.dehydrated!==null){if(e.alternate===null)throw Error(p(340));Ig()}return i=e.flags,i&65536?(e.flags=i&-65537|128,e):null;case 19:return E(L),null;case 4:return zh(),null;case 10:return ah(e.type._context),null;case 22:case 23:return Hj(),null;case 24:return null;default:return null}}var Jj=!1,U=!1,Kj=typeof WeakSet=="function"?WeakSet:Set,V=null;function Lj(i,e){var s=i.ref;if(s!==null)if(typeof s=="function")try{s(null)}catch(c){W(i,e,c)}else s.current=null}function Mj(i,e,s){try{s()}catch(c){W(i,e,c)}}var Nj=!1;function Oj(i,e){if(Cf=dd,i=Me$1(),Ne$1(i)){if("selectionStart"in i)var s={start:i.selectionStart,end:i.selectionEnd};else e:{s=(s=i.ownerDocument)&&s.defaultView||window;var c=s.getSelection&&s.getSelection();if(c&&c.rangeCount!==0){s=c.anchorNode;var h=c.anchorOffset,$=c.focusNode;c=c.focusOffset;try{s.nodeType,$.nodeType}catch{s=null;break e}var _=0,j=-1,nt=-1,et=0,b=0,a=i,o=null;t:for(;;){for(var d;a!==s||h!==0&&a.nodeType!==3||(j=_+h),a!==$||c!==0&&a.nodeType!==3||(nt=_+c),a.nodeType===3&&(_+=a.nodeValue.length),(d=a.firstChild)!==null;)o=a,a=d;for(;;){if(a===i)break t;if(o===s&&++et===h&&(j=_),o===$&&++b===c&&(nt=_),(d=a.nextSibling)!==null)break;a=o,o=a.parentNode}a=d}s=j===-1||nt===-1?null:{start:j,end:nt}}else s=null}s=s||{start:0,end:0}}else s=null;for(Df={focusedElem:i,selectionRange:s},dd=!1,V=e;V!==null;)if(e=V,i=e.child,(e.subtreeFlags&1028)!==0&&i!==null)i.return=e,V=i;else for(;V!==null;){e=V;try{var g=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var rt=g.memoizedProps,st=g.memoizedState,tt=e.stateNode,ot=tt.getSnapshotBeforeUpdate(e.elementType===e.type?rt:Ci(e.type,rt),st);tt.__reactInternalSnapshotBeforeUpdate=ot}break;case 3:var it=e.stateNode.containerInfo;it.nodeType===1?it.textContent="":it.nodeType===9&&it.documentElement&&it.removeChild(it.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(p(163))}}catch(at){W(e,e.return,at)}if(i=e.sibling,i!==null){i.return=e.return,V=i;break}V=e.return}return g=Nj,Nj=!1,g}function Pj(i,e,s){var c=e.updateQueue;if(c=c!==null?c.lastEffect:null,c!==null){var h=c=c.next;do{if((h.tag&i)===i){var $=h.destroy;h.destroy=void 0,$!==void 0&&Mj(e,s,$)}h=h.next}while(h!==c)}}function Qj(i,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var s=e=e.next;do{if((s.tag&i)===i){var c=s.create;s.destroy=c()}s=s.next}while(s!==e)}}function Rj(i){var e=i.ref;if(e!==null){var s=i.stateNode;switch(i.tag){case 5:i=s;break;default:i=s}typeof e=="function"?e(i):e.current=i}}function Sj(i){var e=i.alternate;e!==null&&(i.alternate=null,Sj(e)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(e=i.stateNode,e!==null&&(delete e[Of],delete e[Pf],delete e[of],delete e[Qf],delete e[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 Tj(i){return i.tag===5||i.tag===3||i.tag===4}function Uj(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||Tj(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 Vj(i,e,s){var c=i.tag;if(c===5||c===6)i=i.stateNode,e?s.nodeType===8?s.parentNode.insertBefore(i,e):s.insertBefore(i,e):(s.nodeType===8?(e=s.parentNode,e.insertBefore(i,s)):(e=s,e.appendChild(i)),s=s._reactRootContainer,s!=null||e.onclick!==null||(e.onclick=Bf));else if(c!==4&&(i=i.child,i!==null))for(Vj(i,e,s),i=i.sibling;i!==null;)Vj(i,e,s),i=i.sibling}function Wj(i,e,s){var c=i.tag;if(c===5||c===6)i=i.stateNode,e?s.insertBefore(i,e):s.appendChild(i);else if(c!==4&&(i=i.child,i!==null))for(Wj(i,e,s),i=i.sibling;i!==null;)Wj(i,e,s),i=i.sibling}var X=null,Xj=!1;function Yj(i,e,s){for(s=s.child;s!==null;)Zj(i,e,s),s=s.sibling}function Zj(i,e,s){if(lc&&typeof lc.onCommitFiberUnmount=="function")try{lc.onCommitFiberUnmount(kc,s)}catch{}switch(s.tag){case 5:U||Lj(s,e);case 6:var c=X,h=Xj;X=null,Yj(i,e,s),X=c,Xj=h,X!==null&&(Xj?(i=X,s=s.stateNode,i.nodeType===8?i.parentNode.removeChild(s):i.removeChild(s)):X.removeChild(s.stateNode));break;case 18:X!==null&&(Xj?(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:c=X,h=Xj,X=s.stateNode.containerInfo,Xj=!0,Yj(i,e,s),X=c,Xj=h;break;case 0:case 11:case 14:case 15:if(!U&&(c=s.updateQueue,c!==null&&(c=c.lastEffect,c!==null))){h=c=c.next;do{var $=h,_=$.destroy;$=$.tag,_!==void 0&&($&2||$&4)&&Mj(s,e,_),h=h.next}while(h!==c)}Yj(i,e,s);break;case 1:if(!U&&(Lj(s,e),c=s.stateNode,typeof c.componentWillUnmount=="function"))try{c.props=s.memoizedProps,c.state=s.memoizedState,c.componentWillUnmount()}catch(j){W(s,e,j)}Yj(i,e,s);break;case 21:Yj(i,e,s);break;case 22:s.mode&1?(U=(c=U)||s.memoizedState!==null,Yj(i,e,s),U=c):Yj(i,e,s);break;default:Yj(i,e,s)}}function ak(i){var e=i.updateQueue;if(e!==null){i.updateQueue=null;var s=i.stateNode;s===null&&(s=i.stateNode=new Kj),e.forEach(function(c){var h=bk.bind(null,i,c);s.has(c)||(s.add(c),c.then(h,h))})}}function ck(i,e){var s=e.deletions;if(s!==null)for(var c=0;c<s.length;c++){var h=s[c];try{var $=i,_=e,j=_;e:for(;j!==null;){switch(j.tag){case 5:X=j.stateNode,Xj=!1;break e;case 3:X=j.stateNode.containerInfo,Xj=!0;break e;case 4:X=j.stateNode.containerInfo,Xj=!0;break e}j=j.return}if(X===null)throw Error(p(160));Zj($,_,h),X=null,Xj=!1;var nt=h.alternate;nt!==null&&(nt.return=null),h.return=null}catch(et){W(h,e,et)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)dk(e,i),e=e.sibling}function dk(i,e){var s=i.alternate,c=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:if(ck(e,i),ek(i),c&4){try{Pj(3,i,i.return),Qj(3,i)}catch(rt){W(i,i.return,rt)}try{Pj(5,i,i.return)}catch(rt){W(i,i.return,rt)}}break;case 1:ck(e,i),ek(i),c&512&&s!==null&&Lj(s,s.return);break;case 5:if(ck(e,i),ek(i),c&512&&s!==null&&Lj(s,s.return),i.flags&32){var h=i.stateNode;try{ob(h,"")}catch(rt){W(i,i.return,rt)}}if(c&4&&(h=i.stateNode,h!=null)){var $=i.memoizedProps,_=s!==null?s.memoizedProps:$,j=i.type,nt=i.updateQueue;if(i.updateQueue=null,nt!==null)try{j==="input"&&$.type==="radio"&&$.name!=null&&ab(h,$),vb(j,_);var et=vb(j,$);for(_=0;_<nt.length;_+=2){var b=nt[_],a=nt[_+1];b==="style"?sb(h,a):b==="dangerouslySetInnerHTML"?nb(h,a):b==="children"?ob(h,a):ta$1(h,b,a,et)}switch(j){case"input":bb(h,$);break;case"textarea":ib(h,$);break;case"select":var o=h._wrapperState.wasMultiple;h._wrapperState.wasMultiple=!!$.multiple;var d=$.value;d!=null?fb(h,!!$.multiple,d,!1):o!==!!$.multiple&&($.defaultValue!=null?fb(h,!!$.multiple,$.defaultValue,!0):fb(h,!!$.multiple,$.multiple?[]:"",!1))}h[Pf]=$}catch(rt){W(i,i.return,rt)}}break;case 6:if(ck(e,i),ek(i),c&4){if(i.stateNode===null)throw Error(p(162));h=i.stateNode,$=i.memoizedProps;try{h.nodeValue=$}catch(rt){W(i,i.return,rt)}}break;case 3:if(ck(e,i),ek(i),c&4&&s!==null&&s.memoizedState.isDehydrated)try{bd(e.containerInfo)}catch(rt){W(i,i.return,rt)}break;case 4:ck(e,i),ek(i);break;case 13:ck(e,i),ek(i),h=i.child,h.flags&8192&&($=h.memoizedState!==null,h.stateNode.isHidden=$,!$||h.alternate!==null&&h.alternate.memoizedState!==null||(fk=B())),c&4&&ak(i);break;case 22:if(b=s!==null&&s.memoizedState!==null,i.mode&1?(U=(et=U)||b,ck(e,i),U=et):ck(e,i),ek(i),c&8192){if(et=i.memoizedState!==null,(i.stateNode.isHidden=et)&&!b&&i.mode&1)for(V=i,b=i.child;b!==null;){for(a=V=b;V!==null;){switch(o=V,d=o.child,o.tag){case 0:case 11:case 14:case 15:Pj(4,o,o.return);break;case 1:Lj(o,o.return);var g=o.stateNode;if(typeof g.componentWillUnmount=="function"){c=o,s=o.return;try{e=c,g.props=e.memoizedProps,g.state=e.memoizedState,g.componentWillUnmount()}catch(rt){W(c,s,rt)}}break;case 5:Lj(o,o.return);break;case 22:if(o.memoizedState!==null){gk(a);continue}}d!==null?(d.return=o,V=d):gk(a)}b=b.sibling}e:for(b=null,a=i;;){if(a.tag===5){if(b===null){b=a;try{h=a.stateNode,et?($=h.style,typeof $.setProperty=="function"?$.setProperty("display","none","important"):$.display="none"):(j=a.stateNode,nt=a.memoizedProps.style,_=nt!=null&&nt.hasOwnProperty("display")?nt.display:null,j.style.display=rb("display",_))}catch(rt){W(i,i.return,rt)}}}else if(a.tag===6){if(b===null)try{a.stateNode.nodeValue=et?"":a.memoizedProps}catch(rt){W(i,i.return,rt)}}else if((a.tag!==22&&a.tag!==23||a.memoizedState===null||a===i)&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===i)break e;for(;a.sibling===null;){if(a.return===null||a.return===i)break e;b===a&&(b=null),a=a.return}b===a&&(b=null),a.sibling.return=a.return,a=a.sibling}}break;case 19:ck(e,i),ek(i),c&4&&ak(i);break;case 21:break;default:ck(e,i),ek(i)}}function ek(i){var e=i.flags;if(e&2){try{e:{for(var s=i.return;s!==null;){if(Tj(s)){var c=s;break e}s=s.return}throw Error(p(160))}switch(c.tag){case 5:var h=c.stateNode;c.flags&32&&(ob(h,""),c.flags&=-33);var $=Uj(i);Wj(i,$,h);break;case 3:case 4:var _=c.stateNode.containerInfo,j=Uj(i);Vj(i,j,_);break;default:throw Error(p(161))}}catch(nt){W(i,i.return,nt)}i.flags&=-3}e&4096&&(i.flags&=-4097)}function hk(i,e,s){V=i,ik(i)}function ik(i,e,s){for(var c=(i.mode&1)!==0;V!==null;){var h=V,$=h.child;if(h.tag===22&&c){var _=h.memoizedState!==null||Jj;if(!_){var j=h.alternate,nt=j!==null&&j.memoizedState!==null||U;j=Jj;var et=U;if(Jj=_,(U=nt)&&!et)for(V=h;V!==null;)_=V,nt=_.child,_.tag===22&&_.memoizedState!==null?jk(h):nt!==null?(nt.return=_,V=nt):jk(h);for(;$!==null;)V=$,ik($),$=$.sibling;V=h,Jj=j,U=et}kk(i)}else h.subtreeFlags&8772&&$!==null?($.return=h,V=$):kk(i)}}function kk(i){for(;V!==null;){var e=V;if(e.flags&8772){var s=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:U||Qj(5,e);break;case 1:var c=e.stateNode;if(e.flags&4&&!U)if(s===null)c.componentDidMount();else{var h=e.elementType===e.type?s.memoizedProps:Ci(e.type,s.memoizedProps);c.componentDidUpdate(h,s.memoizedState,c.__reactInternalSnapshotBeforeUpdate)}var $=e.updateQueue;$!==null&&sh(e,$,c);break;case 3:var _=e.updateQueue;if(_!==null){if(s=null,e.child!==null)switch(e.child.tag){case 5:s=e.child.stateNode;break;case 1:s=e.child.stateNode}sh(e,_,s)}break;case 5:var j=e.stateNode;if(s===null&&e.flags&4){s=j;var nt=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":nt.autoFocus&&s.focus();break;case"img":nt.src&&(s.src=nt.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var et=e.alternate;if(et!==null){var b=et.memoizedState;if(b!==null){var a=b.dehydrated;a!==null&&bd(a)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(p(163))}U||e.flags&512&&Rj(e)}catch(o){W(e,e.return,o)}}if(e===i){V=null;break}if(s=e.sibling,s!==null){s.return=e.return,V=s;break}V=e.return}}function gk(i){for(;V!==null;){var e=V;if(e===i){V=null;break}var s=e.sibling;if(s!==null){s.return=e.return,V=s;break}V=e.return}}function jk(i){for(;V!==null;){var e=V;try{switch(e.tag){case 0:case 11:case 15:var s=e.return;try{Qj(4,e)}catch(nt){W(e,s,nt)}break;case 1:var c=e.stateNode;if(typeof c.componentDidMount=="function"){var h=e.return;try{c.componentDidMount()}catch(nt){W(e,h,nt)}}var $=e.return;try{Rj(e)}catch(nt){W(e,$,nt)}break;case 5:var _=e.return;try{Rj(e)}catch(nt){W(e,_,nt)}}}catch(nt){W(e,e.return,nt)}if(e===i){V=null;break}var j=e.sibling;if(j!==null){j.return=e.return,V=j;break}V=e.return}}var lk=Math.ceil,mk=ua$1.ReactCurrentDispatcher,nk=ua$1.ReactCurrentOwner,ok=ua$1.ReactCurrentBatchConfig,K=0,Q=null,Y=null,Z=0,fj=0,ej=Uf(0),T=0,pk=null,rh=0,qk=0,rk=0,sk=null,tk=null,fk=0,Gj=1/0,uk=null,Oi=!1,Pi=null,Ri=null,vk=!1,wk=null,xk=0,yk=0,zk=null,Ak=-1,Bk=0;function R(){return K&6?B():Ak!==-1?Ak:Ak=B()}function yi(i){return i.mode&1?K&2&&Z!==0?Z&-Z:Kg.transition!==null?(Bk===0&&(Bk=yc()),Bk):(i=C,i!==0||(i=window.event,i=i===void 0?16:jd(i.type)),i):1}function gi(i,e,s,c){if(50<yk)throw yk=0,zk=null,Error(p(185));Ac(i,s,c),(!(K&2)||i!==Q)&&(i===Q&&(!(K&2)&&(qk|=s),T===4&&Ck(i,Z)),Dk(i,c),s===1&&K===0&&!(e.mode&1)&&(Gj=B()+500,fg&&jg()))}function Dk(i,e){var s=i.callbackNode;wc(i,e);var c=uc(i,i===Q?Z:0);if(c===0)s!==null&&bc(s),i.callbackNode=null,i.callbackPriority=0;else if(e=c&-c,i.callbackPriority!==e){if(s!=null&&bc(s),e===1)i.tag===0?ig(Ek.bind(null,i)):hg(Ek.bind(null,i)),Jf(function(){!(K&6)&&jg()}),s=null;else{switch(Dc(c)){case 1:s=fc;break;case 4:s=gc;break;case 16:s=hc;break;case 536870912:s=jc;break;default:s=hc}s=Fk(s,Gk.bind(null,i))}i.callbackPriority=e,i.callbackNode=s}}function Gk(i,e){if(Ak=-1,Bk=0,K&6)throw Error(p(327));var s=i.callbackNode;if(Hk()&&i.callbackNode!==s)return null;var c=uc(i,i===Q?Z:0);if(c===0)return null;if(c&30||c&i.expiredLanes||e)e=Ik(i,c);else{e=c;var h=K;K|=2;var $=Jk();(Q!==i||Z!==e)&&(uk=null,Gj=B()+500,Kk(i,e));do try{Lk();break}catch(j){Mk(i,j)}while(!0);$g(),mk.current=$,K=h,Y!==null?e=0:(Q=null,Z=0,e=T)}if(e!==0){if(e===2&&(h=xc(i),h!==0&&(c=h,e=Nk(i,h))),e===1)throw s=pk,Kk(i,0),Ck(i,c),Dk(i,B()),s;if(e===6)Ck(i,c);else{if(h=i.current.alternate,!(c&30)&&!Ok(h)&&(e=Ik(i,c),e===2&&($=xc(i),$!==0&&(c=$,e=Nk(i,$))),e===1))throw s=pk,Kk(i,0),Ck(i,c),Dk(i,B()),s;switch(i.finishedWork=h,i.finishedLanes=c,e){case 0:case 1:throw Error(p(345));case 2:Pk(i,tk,uk);break;case 3:if(Ck(i,c),(c&130023424)===c&&(e=fk+500-B(),10<e)){if(uc(i,0)!==0)break;if(h=i.suspendedLanes,(h&c)!==c){R(),i.pingedLanes|=i.suspendedLanes&h;break}i.timeoutHandle=Ff(Pk.bind(null,i,tk,uk),e);break}Pk(i,tk,uk);break;case 4:if(Ck(i,c),(c&4194240)===c)break;for(e=i.eventTimes,h=-1;0<c;){var _=31-oc(c);$=1<<_,_=e[_],_>h&&(h=_),c&=~$}if(c=h,c=B()-c,c=(120>c?120:480>c?480:1080>c?1080:1920>c?1920:3e3>c?3e3:4320>c?4320:1960*lk(c/1960))-c,10<c){i.timeoutHandle=Ff(Pk.bind(null,i,tk,uk),c);break}Pk(i,tk,uk);break;case 5:Pk(i,tk,uk);break;default:throw Error(p(329))}}}return Dk(i,B()),i.callbackNode===s?Gk.bind(null,i):null}function Nk(i,e){var s=sk;return i.current.memoizedState.isDehydrated&&(Kk(i,e).flags|=256),i=Ik(i,e),i!==2&&(e=tk,tk=s,e!==null&&Fj(e)),i}function Fj(i){tk===null?tk=i:tk.push.apply(tk,i)}function Ok(i){for(var e=i;;){if(e.flags&16384){var s=e.updateQueue;if(s!==null&&(s=s.stores,s!==null))for(var c=0;c<s.length;c++){var h=s[c],$=h.getSnapshot;h=h.value;try{if(!He$1($(),h))return!1}catch{return!1}}}if(s=e.child,e.subtreeFlags&16384&&s!==null)s.return=e,e=s;else{if(e===i)break;for(;e.sibling===null;){if(e.return===null||e.return===i)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function Ck(i,e){for(e&=~rk,e&=~qk,i.suspendedLanes|=e,i.pingedLanes&=~e,i=i.expirationTimes;0<e;){var s=31-oc(e),c=1<<s;i[s]=-1,e&=~c}}function Ek(i){if(K&6)throw Error(p(327));Hk();var e=uc(i,0);if(!(e&1))return Dk(i,B()),null;var s=Ik(i,e);if(i.tag!==0&&s===2){var c=xc(i);c!==0&&(e=c,s=Nk(i,c))}if(s===1)throw s=pk,Kk(i,0),Ck(i,e),Dk(i,B()),s;if(s===6)throw Error(p(345));return i.finishedWork=i.current.alternate,i.finishedLanes=e,Pk(i,tk,uk),Dk(i,B()),null}function Qk(i,e){var s=K;K|=1;try{return i(e)}finally{K=s,K===0&&(Gj=B()+500,fg&&jg())}}function Rk(i){wk!==null&&wk.tag===0&&!(K&6)&&Hk();var e=K;K|=1;var s=ok.transition,c=C;try{if(ok.transition=null,C=1,i)return i()}finally{C=c,ok.transition=s,K=e,!(K&6)&&jg()}}function Hj(){fj=ej.current,E(ej)}function Kk(i,e){i.finishedWork=null,i.finishedLanes=0;var s=i.timeoutHandle;if(s!==-1&&(i.timeoutHandle=-1,Gf(s)),Y!==null)for(s=Y.return;s!==null;){var c=s;switch(wg(c),c.tag){case 1:c=c.type.childContextTypes,c!=null&&$f();break;case 3:zh(),E(Wf),E(H),Eh();break;case 5:Bh(c);break;case 4:zh();break;case 13:E(L);break;case 19:E(L);break;case 10:ah(c.type._context);break;case 22:case 23:Hj()}s=s.return}if(Q=i,Y=i=Pg(i.current,null),Z=fj=e,T=0,pk=null,rk=qk=rh=0,tk=sk=null,fh!==null){for(e=0;e<fh.length;e++)if(s=fh[e],c=s.interleaved,c!==null){s.interleaved=null;var h=c.next,$=s.pending;if($!==null){var _=$.next;$.next=h,c.next=_}s.pending=c}fh=null}return i}function Mk(i,e){do{var s=Y;try{if($g(),Fh.current=Rh,Ih){for(var c=M.memoizedState;c!==null;){var h=c.queue;h!==null&&(h.pending=null),c=c.next}Ih=!1}if(Hh=0,O=N=M=null,Jh=!1,Kh=0,nk.current=null,s===null||s.return===null){T=1,pk=e,Y=null;break}e:{var $=i,_=s.return,j=s,nt=e;if(e=Z,j.flags|=32768,nt!==null&&typeof nt=="object"&&typeof nt.then=="function"){var et=nt,b=j,a=b.tag;if(!(b.mode&1)&&(a===0||a===11||a===15)){var o=b.alternate;o?(b.updateQueue=o.updateQueue,b.memoizedState=o.memoizedState,b.lanes=o.lanes):(b.updateQueue=null,b.memoizedState=null)}var d=Ui(_);if(d!==null){d.flags&=-257,Vi(d,_,j,$,e),d.mode&1&&Si($,et,e),e=d,nt=et;var g=e.updateQueue;if(g===null){var rt=new Set;rt.add(nt),e.updateQueue=rt}else g.add(nt);break e}else{if(!(e&1)){Si($,et,e),tj();break e}nt=Error(p(426))}}else if(I&&j.mode&1){var st=Ui(_);if(st!==null){!(st.flags&65536)&&(st.flags|=256),Vi(st,_,j,$,e),Jg(Ji(nt,j));break e}}$=nt=Ji(nt,j),T!==4&&(T=2),sk===null?sk=[$]:sk.push($),$=_;do{switch($.tag){case 3:$.flags|=65536,e&=-e,$.lanes|=e;var tt=Ni($,nt,e);ph($,tt);break e;case 1:j=nt;var ot=$.type,it=$.stateNode;if(!($.flags&128)&&(typeof ot.getDerivedStateFromError=="function"||it!==null&&typeof it.componentDidCatch=="function"&&(Ri===null||!Ri.has(it)))){$.flags|=65536,e&=-e,$.lanes|=e;var at=Qi($,j,e);ph($,at);break e}}$=$.return}while($!==null)}Sk(s)}catch(ut){e=ut,Y===s&&s!==null&&(Y=s=s.return);continue}break}while(!0)}function Jk(){var i=mk.current;return mk.current=Rh,i===null?Rh:i}function tj(){(T===0||T===3||T===2)&&(T=4),Q===null||!(rh&268435455)&&!(qk&268435455)||Ck(Q,Z)}function Ik(i,e){var s=K;K|=2;var c=Jk();(Q!==i||Z!==e)&&(uk=null,Kk(i,e));do try{Tk();break}catch(h){Mk(i,h)}while(!0);if($g(),K=s,mk.current=c,Y!==null)throw Error(p(261));return Q=null,Z=0,T}function Tk(){for(;Y!==null;)Uk(Y)}function Lk(){for(;Y!==null&&!cc();)Uk(Y)}function Uk(i){var e=Vk(i.alternate,i,fj);i.memoizedProps=i.pendingProps,e===null?Sk(i):Y=e,nk.current=null}function Sk(i){var e=i;do{var s=e.alternate;if(i=e.return,e.flags&32768){if(s=Ij(s,e),s!==null){s.flags&=32767,Y=s;return}if(i!==null)i.flags|=32768,i.subtreeFlags=0,i.deletions=null;else{T=6,Y=null;return}}else if(s=Ej(s,e,fj),s!==null){Y=s;return}if(e=e.sibling,e!==null){Y=e;return}Y=e=i}while(e!==null);T===0&&(T=5)}function Pk(i,e,s){var c=C,h=ok.transition;try{ok.transition=null,C=1,Wk(i,e,s,c)}finally{ok.transition=h,C=c}return null}function Wk(i,e,s,c){do Hk();while(wk!==null);if(K&6)throw Error(p(327));s=i.finishedWork;var h=i.finishedLanes;if(s===null)return null;if(i.finishedWork=null,i.finishedLanes=0,s===i.current)throw Error(p(177));i.callbackNode=null,i.callbackPriority=0;var $=s.lanes|s.childLanes;if(Bc(i,$),i===Q&&(Y=Q=null,Z=0),!(s.subtreeFlags&2064)&&!(s.flags&2064)||vk||(vk=!0,Fk(hc,function(){return Hk(),null})),$=(s.flags&15990)!==0,s.subtreeFlags&15990||$){$=ok.transition,ok.transition=null;var _=C;C=1;var j=K;K|=4,nk.current=null,Oj(i,s),dk(s,i),Oe$1(Df),dd=!!Cf,Df=Cf=null,i.current=s,hk(s),dc(),K=j,C=_,ok.transition=$}else i.current=s;if(vk&&(vk=!1,wk=i,xk=h),$=i.pendingLanes,$===0&&(Ri=null),mc(s.stateNode),Dk(i,B()),e!==null)for(c=i.onRecoverableError,s=0;s<e.length;s++)h=e[s],c(h.value,{componentStack:h.stack,digest:h.digest});if(Oi)throw Oi=!1,i=Pi,Pi=null,i;return xk&1&&i.tag!==0&&Hk(),$=i.pendingLanes,$&1?i===zk?yk++:(yk=0,zk=i):yk=0,jg(),null}function Hk(){if(wk!==null){var i=Dc(xk),e=ok.transition,s=C;try{if(ok.transition=null,C=16>i?16:i,wk===null)var c=!1;else{if(i=wk,wk=null,xk=0,K&6)throw Error(p(331));var h=K;for(K|=4,V=i.current;V!==null;){var $=V,_=$.child;if(V.flags&16){var j=$.deletions;if(j!==null){for(var nt=0;nt<j.length;nt++){var et=j[nt];for(V=et;V!==null;){var b=V;switch(b.tag){case 0:case 11:case 15:Pj(8,b,$)}var a=b.child;if(a!==null)a.return=b,V=a;else for(;V!==null;){b=V;var o=b.sibling,d=b.return;if(Sj(b),b===et){V=null;break}if(o!==null){o.return=d,V=o;break}V=d}}}var g=$.alternate;if(g!==null){var rt=g.child;if(rt!==null){g.child=null;do{var st=rt.sibling;rt.sibling=null,rt=st}while(rt!==null)}}V=$}}if($.subtreeFlags&2064&&_!==null)_.return=$,V=_;else e:for(;V!==null;){if($=V,$.flags&2048)switch($.tag){case 0:case 11:case 15:Pj(9,$,$.return)}var tt=$.sibling;if(tt!==null){tt.return=$.return,V=tt;break e}V=$.return}}var ot=i.current;for(V=ot;V!==null;){_=V;var it=_.child;if(_.subtreeFlags&2064&&it!==null)it.return=_,V=it;else e:for(_=ot;V!==null;){if(j=V,j.flags&2048)try{switch(j.tag){case 0:case 11:case 15:Qj(9,j)}}catch(ut){W(j,j.return,ut)}if(j===_){V=null;break e}var at=j.sibling;if(at!==null){at.return=j.return,V=at;break e}V=j.return}}if(K=h,jg(),lc&&typeof lc.onPostCommitFiberRoot=="function")try{lc.onPostCommitFiberRoot(kc,i)}catch{}c=!0}return c}finally{C=s,ok.transition=e}}return!1}function Xk(i,e,s){e=Ji(s,e),e=Ni(i,e,1),i=nh(i,e,1),e=R(),i!==null&&(Ac(i,1,e),Dk(i,e))}function W(i,e,s){if(i.tag===3)Xk(i,i,s);else for(;e!==null;){if(e.tag===3){Xk(e,i,s);break}else if(e.tag===1){var c=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(Ri===null||!Ri.has(c))){i=Ji(s,i),i=Qi(e,i,1),e=nh(e,i,1),i=R(),e!==null&&(Ac(e,1,i),Dk(e,i));break}}e=e.return}}function Ti(i,e,s){var c=i.pingCache;c!==null&&c.delete(e),e=R(),i.pingedLanes|=i.suspendedLanes&s,Q===i&&(Z&s)===s&&(T===4||T===3&&(Z&130023424)===Z&&500>B()-fk?Kk(i,0):rk|=s),Dk(i,e)}function Yk(i,e){e===0&&(i.mode&1?(e=sc,sc<<=1,!(sc&130023424)&&(sc=4194304)):e=1);var s=R();i=ih(i,e),i!==null&&(Ac(i,e,s),Dk(i,s))}function uj(i){var e=i.memoizedState,s=0;e!==null&&(s=e.retryLane),Yk(i,s)}function bk(i,e){var s=0;switch(i.tag){case 13:var c=i.stateNode,h=i.memoizedState;h!==null&&(s=h.retryLane);break;case 19:c=i.stateNode;break;default:throw Error(p(314))}c!==null&&c.delete(e),Yk(i,s)}var Vk;Vk=function(i,e,s){if(i!==null)if(i.memoizedProps!==e.pendingProps||Wf.current)dh=!0;else{if(!(i.lanes&s)&&!(e.flags&128))return dh=!1,yj(i,e,s);dh=!!(i.flags&131072)}else dh=!1,I&&e.flags&1048576&&ug(e,ng,e.index);switch(e.lanes=0,e.tag){case 2:var c=e.type;ij(i,e),i=e.pendingProps;var h=Yf(e,H.current);ch(e,s),h=Nh(null,e,c,i,h,s);var $=Sh();return e.flags|=1,typeof h=="object"&&h!==null&&typeof h.render=="function"&&h.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Zf(c)?($=!0,cg(e)):$=!1,e.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,kh(e),h.updater=Ei,e.stateNode=h,h._reactInternals=e,Ii(e,c,i,s),e=jj(null,e,c,!0,$,s)):(e.tag=0,I&&$&&vg(e),Xi(null,e,h,s),e=e.child),e;case 16:c=e.elementType;e:{switch(ij(i,e),i=e.pendingProps,h=c._init,c=h(c._payload),e.type=c,h=e.tag=Zk(c),i=Ci(c,i),h){case 0:e=cj(null,e,c,i,s);break e;case 1:e=hj(null,e,c,i,s);break e;case 11:e=Yi(null,e,c,i,s);break e;case 14:e=$i(null,e,c,Ci(c.type,i),s);break e}throw Error(p(306,c,""))}return e;case 0:return c=e.type,h=e.pendingProps,h=e.elementType===c?h:Ci(c,h),cj(i,e,c,h,s);case 1:return c=e.type,h=e.pendingProps,h=e.elementType===c?h:Ci(c,h),hj(i,e,c,h,s);case 3:e:{if(kj(e),i===null)throw Error(p(387));c=e.pendingProps,$=e.memoizedState,h=$.element,lh(i,e),qh(e,c,null,s);var _=e.memoizedState;if(c=_.element,$.isDehydrated)if($={element:c,isDehydrated:!1,cache:_.cache,pendingSuspenseBoundaries:_.pendingSuspenseBoundaries,transitions:_.transitions},e.updateQueue.baseState=$,e.memoizedState=$,e.flags&256){h=Ji(Error(p(423)),e),e=lj(i,e,c,s,h);break e}else if(c!==h){h=Ji(Error(p(424)),e),e=lj(i,e,c,s,h);break e}else for(yg=Lf(e.stateNode.containerInfo.firstChild),xg=e,I=!0,zg=null,s=Vg(e,null,c,s),e.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(Ig(),c===h){e=Zi(i,e,s);break e}Xi(i,e,c,s)}e=e.child}return e;case 5:return Ah(e),i===null&&Eg(e),c=e.type,h=e.pendingProps,$=i!==null?i.memoizedProps:null,_=h.children,Ef(c,h)?_=null:$!==null&&Ef(c,$)&&(e.flags|=32),gj(i,e),Xi(i,e,_,s),e.child;case 6:return i===null&&Eg(e),null;case 13:return oj(i,e,s);case 4:return yh(e,e.stateNode.containerInfo),c=e.pendingProps,i===null?e.child=Ug(e,null,c,s):Xi(i,e,c,s),e.child;case 11:return c=e.type,h=e.pendingProps,h=e.elementType===c?h:Ci(c,h),Yi(i,e,c,h,s);case 7:return Xi(i,e,e.pendingProps,s),e.child;case 8:return Xi(i,e,e.pendingProps.children,s),e.child;case 12:return Xi(i,e,e.pendingProps.children,s),e.child;case 10:e:{if(c=e.type._context,h=e.pendingProps,$=e.memoizedProps,_=h.value,G(Wg,c._currentValue),c._currentValue=_,$!==null)if(He$1($.value,_)){if($.children===h.children&&!Wf.current){e=Zi(i,e,s);break e}}else for($=e.child,$!==null&&($.return=e);$!==null;){var j=$.dependencies;if(j!==null){_=$.child;for(var nt=j.firstContext;nt!==null;){if(nt.context===c){if($.tag===1){nt=mh(-1,s&-s),nt.tag=2;var et=$.updateQueue;if(et!==null){et=et.shared;var b=et.pending;b===null?nt.next=nt:(nt.next=b.next,b.next=nt),et.pending=nt}}$.lanes|=s,nt=$.alternate,nt!==null&&(nt.lanes|=s),bh($.return,s,e),j.lanes|=s;break}nt=nt.next}}else if($.tag===10)_=$.type===e.type?null:$.child;else if($.tag===18){if(_=$.return,_===null)throw Error(p(341));_.lanes|=s,j=_.alternate,j!==null&&(j.lanes|=s),bh(_,s,e),_=$.sibling}else _=$.child;if(_!==null)_.return=$;else for(_=$;_!==null;){if(_===e){_=null;break}if($=_.sibling,$!==null){$.return=_.return,_=$;break}_=_.return}$=_}Xi(i,e,h.children,s),e=e.child}return e;case 9:return h=e.type,c=e.pendingProps.children,ch(e,s),h=eh(h),c=c(h),e.flags|=1,Xi(i,e,c,s),e.child;case 14:return c=e.type,h=Ci(c,e.pendingProps),h=Ci(c.type,h),$i(i,e,c,h,s);case 15:return bj(i,e,e.type,e.pendingProps,s);case 17:return c=e.type,h=e.pendingProps,h=e.elementType===c?h:Ci(c,h),ij(i,e),e.tag=1,Zf(c)?(i=!0,cg(e)):i=!1,ch(e,s),Gi(e,c,h),Ii(e,c,h,s),jj(null,e,c,!0,i,s);case 19:return xj(i,e,s);case 22:return dj(i,e,s)}throw Error(p(156,e.tag))};function Fk(i,e){return ac(i,e)}function $k(i,e,s,c){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=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Bg(i,e,s,c){return new $k(i,e,s,c)}function aj(i){return i=i.prototype,!(!i||!i.isReactComponent)}function Zk(i){if(typeof i=="function")return aj(i)?1:0;if(i!=null){if(i=i.$$typeof,i===Da$1)return 11;if(i===Ga$1)return 14}return 2}function Pg(i,e){var s=i.alternate;return s===null?(s=Bg(i.tag,e,i.key,i.mode),s.elementType=i.elementType,s.type=i.type,s.stateNode=i.stateNode,s.alternate=i,i.alternate=s):(s.pendingProps=e,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,e=i.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},s.sibling=i.sibling,s.index=i.index,s.ref=i.ref,s}function Rg(i,e,s,c,h,$){var _=2;if(c=i,typeof i=="function")aj(i)&&(_=1);else if(typeof i=="string")_=5;else e:switch(i){case ya$1:return Tg(s.children,h,$,e);case za$1:_=8,h|=8;break;case Aa$1:return i=Bg(12,s,e,h|2),i.elementType=Aa$1,i.lanes=$,i;case Ea$1:return i=Bg(13,s,e,h),i.elementType=Ea$1,i.lanes=$,i;case Fa$1:return i=Bg(19,s,e,h),i.elementType=Fa$1,i.lanes=$,i;case Ia$1:return pj(s,h,$,e);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case Ba$1:_=10;break e;case Ca$1:_=9;break e;case Da$1:_=11;break e;case Ga$1:_=14;break e;case Ha$1:_=16,c=null;break e}throw Error(p(130,i==null?i:typeof i,""))}return e=Bg(_,s,e,h),e.elementType=i,e.type=c,e.lanes=$,e}function Tg(i,e,s,c){return i=Bg(7,i,c,e),i.lanes=s,i}function pj(i,e,s,c){return i=Bg(22,i,c,e),i.elementType=Ia$1,i.lanes=s,i.stateNode={isHidden:!1},i}function Qg(i,e,s){return i=Bg(6,i,null,e),i.lanes=s,i}function Sg(i,e,s){return e=Bg(4,i.children!==null?i.children:[],i.key,e),e.lanes=s,e.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},e}function al(i,e,s,c,h){this.tag=e,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=c,this.onRecoverableError=h,this.mutableSourceEagerHydrationData=null}function bl(i,e,s,c,h,$,_,j,nt){return i=new al(i,e,s,j,nt),e===1?(e=1,$===!0&&(e|=8)):e=0,$=Bg(3,null,null,e),i.current=$,$.stateNode=i,$.memoizedState={element:c,isDehydrated:s,cache:null,transitions:null,pendingSuspenseBoundaries:null},kh($),i}function cl(i,e,s){var c=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:wa$1,key:c==null?null:""+c,children:i,containerInfo:e,implementation:s}}function dl(i){if(!i)return Vf;i=i._reactInternals;e:{if(Vb(i)!==i||i.tag!==1)throw Error(p(170));var e=i;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(Zf(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(p(171))}if(i.tag===1){var s=i.type;if(Zf(s))return bg(i,s,e)}return e}function el(i,e,s,c,h,$,_,j,nt){return i=bl(s,c,!0,i,h,$,_,j,nt),i.context=dl(null),s=i.current,c=R(),h=yi(s),$=mh(c,h),$.callback=e??null,nh(s,$,h),i.current.lanes=h,Ac(i,h,c),Dk(i,c),i}function fl(i,e,s,c){var h=e.current,$=R(),_=yi(h);return s=dl(s),e.context===null?e.context=s:e.pendingContext=s,e=mh($,_),e.payload={element:i},c=c===void 0?null:c,c!==null&&(e.callback=c),i=nh(h,e,_),i!==null&&(gi(i,h,_,$),oh(i,h,_)),_}function gl(i){if(i=i.current,!i.child)return null;switch(i.child.tag){case 5:return i.child.stateNode;default:return i.child.stateNode}}function hl(i,e){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var s=i.retryLane;i.retryLane=s!==0&&s<e?s:e}}function il(i,e){hl(i,e),(i=i.alternate)&&hl(i,e)}function jl(){return null}var kl=typeof reportError=="function"?reportError:function(i){console.error(i)};function ll(i){this._internalRoot=i}ml.prototype.render=ll.prototype.render=function(i){var e=this._internalRoot;if(e===null)throw Error(p(409));fl(i,e,null,null)},ml.prototype.unmount=ll.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var e=i.containerInfo;Rk(function(){fl(null,i,null,null)}),e[uf]=null}};function ml(i){this._internalRoot=i}ml.prototype.unstable_scheduleHydration=function(i){if(i){var e=Hc();i={blockedOn:null,target:i,priority:e};for(var s=0;s<Qc.length&&e!==0&&e<Qc[s].priority;s++);Qc.splice(s,0,i),s===0&&Vc(i)}};function nl(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function ol(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11&&(i.nodeType!==8||i.nodeValue!==" react-mount-point-unstable "))}function pl(){}function ql(i,e,s,c,h){if(h){if(typeof c=="function"){var $=c;c=function(){var et=gl(_);$.call(et)}}var _=el(e,c,i,0,null,!1,!1,"",pl);return i._reactRootContainer=_,i[uf]=_.current,sf(i.nodeType===8?i.parentNode:i),Rk(),_}for(;h=i.lastChild;)i.removeChild(h);if(typeof c=="function"){var j=c;c=function(){var et=gl(nt);j.call(et)}}var nt=bl(i,0,!1,null,null,!1,!1,"",pl);return i._reactRootContainer=nt,i[uf]=nt.current,sf(i.nodeType===8?i.parentNode:i),Rk(function(){fl(e,nt,s,c)}),nt}function rl(i,e,s,c,h){var $=s._reactRootContainer;if($){var _=$;if(typeof h=="function"){var j=h;h=function(){var nt=gl(_);j.call(nt)}}fl(e,_,i,h)}else _=ql(s,e,i,h,c);return gl(_)}Ec=function(i){switch(i.tag){case 3:var e=i.stateNode;if(e.current.memoizedState.isDehydrated){var s=tc(e.pendingLanes);s!==0&&(Cc(e,s|1),Dk(e,B()),!(K&6)&&(Gj=B()+500,jg()))}break;case 13:Rk(function(){var c=ih(i,1);if(c!==null){var h=R();gi(c,i,1,h)}}),il(i,1)}},Fc=function(i){if(i.tag===13){var e=ih(i,134217728);if(e!==null){var s=R();gi(e,i,134217728,s)}il(i,134217728)}},Gc=function(i){if(i.tag===13){var e=yi(i),s=ih(i,e);if(s!==null){var c=R();gi(s,i,e,c)}il(i,e)}},Hc=function(){return C},Ic=function(i,e){var s=C;try{return C=i,e()}finally{C=s}},yb=function(i,e,s){switch(e){case"input":if(bb(i,s),e=s.name,s.type==="radio"&&e!=null){for(s=i;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<s.length;e++){var c=s[e];if(c!==i&&c.form===i.form){var h=Db(c);if(!h)throw Error(p(90));Wa$1(c),bb(c,h)}}}break;case"textarea":ib(i,s);break;case"select":e=s.value,e!=null&&fb(i,!!s.multiple,e,!1)}},Gb=Qk,Hb=Rk;var sl={usingClientEntryPoint:!1,Events:[Cb,ue,Db,Eb,Fb,Qk]},tl={findFiberByHostInstance:Wc,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},ul={bundleType:tl.bundleType,version:tl.version,rendererPackageName:tl.rendererPackageName,rendererConfig:tl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ua$1.ReactCurrentDispatcher,findHostInstanceByFiber:function(i){return i=Zb(i),i===null?null:i.stateNode},findFiberByHostInstance:tl.findFiberByHostInstance||jl,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var vl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!vl.isDisabled&&vl.supportsFiber)try{kc=vl.inject(ul),lc=vl}catch{}}reactDom_production_min.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=sl,reactDom_production_min.createPortal=function(i,e){var s=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!nl(e))throw Error(p(200));return cl(i,e,null,s)},reactDom_production_min.createRoot=function(i,e){if(!nl(i))throw Error(p(299));var s=!1,c="",h=kl;return e!=null&&(e.unstable_strictMode===!0&&(s=!0),e.identifierPrefix!==void 0&&(c=e.identifierPrefix),e.onRecoverableError!==void 0&&(h=e.onRecoverableError)),e=bl(i,1,!1,null,null,s,!1,c,h),i[uf]=e.current,sf(i.nodeType===8?i.parentNode:i),new ll(e)},reactDom_production_min.findDOMNode=function(i){if(i==null)return null;if(i.nodeType===1)return i;var e=i._reactInternals;if(e===void 0)throw typeof i.render=="function"?Error(p(188)):(i=Object.keys(i).join(","),Error(p(268,i)));return i=Zb(e),i=i===null?null:i.stateNode,i},reactDom_production_min.flushSync=function(i){return Rk(i)},reactDom_production_min.hydrate=function(i,e,s){if(!ol(e))throw Error(p(200));return rl(null,i,e,!0,s)},reactDom_production_min.hydrateRoot=function(i,e,s){if(!nl(i))throw Error(p(405));var c=s!=null&&s.hydratedSources||null,h=!1,$="",_=kl;if(s!=null&&(s.unstable_strictMode===!0&&(h=!0),s.identifierPrefix!==void 0&&($=s.identifierPrefix),s.onRecoverableError!==void 0&&(_=s.onRecoverableError)),e=el(e,null,i,1,s??null,h,!1,$,_),i[uf]=e.current,sf(i),c)for(i=0;i<c.length;i++)s=c[i],h=s._getVersion,h=h(s._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[s,h]:e.mutableSourceEagerHydrationData.push(s,h);return new ml(e)},reactDom_production_min.render=function(i,e,s){if(!ol(e))throw Error(p(200));return rl(null,i,e,!1,s)},reactDom_production_min.unmountComponentAtNode=function(i){if(!ol(i))throw Error(p(40));return i._reactRootContainer?(Rk(function(){rl(null,null,i,!1,function(){i._reactRootContainer=null,i[uf]=null})}),!0):!1},reactDom_production_min.unstable_batchedUpdates=Qk,reactDom_production_min.unstable_renderSubtreeIntoContainer=function(i,e,s,c){if(!ol(s))throw Error(p(200));if(i==null||i._reactInternals===void 0)throw Error(p(38));return rl(i,e,s,!1,c)},reactDom_production_min.version="18.3.1-next-f1338f8080-20240426";function checkDCE(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"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,createRoot,m=reactDomExports;createRoot=m.createRoot,m.hydrateRoot;const LogoIcon=()=>jsxRuntimeExports.jsxs("svg",{viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("path",{d:"M16 4C9.37 4 4 9.37 4 16s5.37 12 12 12 12-5.37 12-12S22.63 4 16 4z",fill:"#2563eb"}),jsxRuntimeExports.jsx("path",{d:"M16 8c-2.2 0-4 1.8-4 4v4c0 2.2 1.8 4 4 4s4-1.8 4-4v-4c0-2.2-1.8-4-4-4z",fill:"white"}),jsxRuntimeExports.jsx("path",{d:"M22 16c0 3.3-2.7 6-6 6s-6-2.7-6-6H8c0 4.1 3.1 7.5 7 7.9V26h2v-2.1c3.9-.4 7-3.8 7-7.9h-2z",fill:"white"})]}),MicIcon=()=>jsxRuntimeExports.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z"}),jsxRuntimeExports.jsx("path",{d:"M19 10v2a7 7 0 0 1-14 0v-2"}),jsxRuntimeExports.jsx("line",{x1:"12",x2:"12",y1:"19",y2:"22"})]}),CloseIcon=()=>jsxRuntimeExports.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),jsxRuntimeExports.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),MinimizeIcon=()=>jsxRuntimeExports.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),jsxRuntimeExports.jsx("path",{d:"M9 3v18"})]}),ErrorIcon=()=>jsxRuntimeExports.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("circle",{cx:"12",cy:"12",r:"10"}),jsxRuntimeExports.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),jsxRuntimeExports.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}),ChatIcon=()=>jsxRuntimeExports.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntimeExports.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})});function FloatingPanel({children:i,position:e,onClose:s,onMinimize:c}){const h=reactExports.useRef(null),$=reactExports.useRef(!1),_=reactExports.useRef({x:0,y:0,right:20,bottom:20}),j=reactExports.useCallback(et=>{if(et.target.closest("button"))return;$.current=!0;const b=h.current;b&&(_.current={x:et.clientX,y:et.clientY,right:parseInt(b.style.right||"20"),bottom:parseInt(b.style.bottom||"20")})},[]);reactExports.useEffect(()=>{const et=a=>{if(!$.current||!h.current)return;const o=_.current.x-a.clientX,d=_.current.y-a.clientY;h.current.style.right=`${_.current.right+o}px`,h.current.style.bottom=`${_.current.bottom+d}px`},b=()=>{$.current=!1};return document.addEventListener("mousemove",et),document.addEventListener("mouseup",b),()=>{document.removeEventListener("mousemove",et),document.removeEventListener("mouseup",b)}},[]);const nt={bottom:(e==null?void 0:e.bottom)??20,right:(e==null?void 0:e.right)??20,...(e==null?void 0:e.top)!==void 0&&{top:e.top,bottom:"auto"},...(e==null?void 0:e.left)!==void 0&&{left:e.left,right:"auto"}};return jsxRuntimeExports.jsxs("div",{ref:h,className:"scribe-panel",style:nt,children:[jsxRuntimeExports.jsxs("div",{className:"panel-header",onMouseDown:j,children:[jsxRuntimeExports.jsxs("div",{className:"drag-handle",children:[jsxRuntimeExports.jsx("span",{}),jsxRuntimeExports.jsx("span",{}),jsxRuntimeExports.jsx("span",{}),jsxRuntimeExports.jsx("span",{}),jsxRuntimeExports.jsx("span",{}),jsxRuntimeExports.jsx("span",{})]}),jsxRuntimeExports.jsxs("div",{className:"header-actions",children:[jsxRuntimeExports.jsx("button",{className:"header-btn",onClick:c,title:"Minimize",children:jsxRuntimeExports.jsx(MinimizeIcon,{})}),jsxRuntimeExports.jsx("button",{className:"header-btn",onClick:s,title:"Close",children:jsxRuntimeExports.jsx(CloseIcon,{})})]})]}),jsxRuntimeExports.jsx("div",{className:"panel-content",children:i})]})}function ConfigState({onSubmit:i,initialApiKey:e="",initialBaseUrl:s=""}){const[c,h]=reactExports.useState(e),[$,_]=reactExports.useState(s),[j,nt]=reactExports.useState(""),et=b=>{if(b.preventDefault(),!$.trim()){nt("Base URL is required");return}nt(""),i(c.trim(),$.trim())};return jsxRuntimeExports.jsxs("div",{className:"config-state",style:{zIndex:9999},children:[jsxRuntimeExports.jsxs("div",{className:"logo",children:[jsxRuntimeExports.jsx("div",{className:"logo-icon",children:jsxRuntimeExports.jsx(LogoIcon,{})}),jsxRuntimeExports.jsx("span",{className:"logo-text",children:"eka.scribe"})]}),jsxRuntimeExports.jsxs("form",{className:"config-form",onSubmit:et,children:[jsxRuntimeExports.jsxs("div",{className:"form-group",children:[jsxRuntimeExports.jsx("label",{htmlFor:"eka-api-key",children:"API Key"}),jsxRuntimeExports.jsx("input",{id:"eka-api-key",type:"text",value:c,onChange:b=>h(b.target.value),placeholder:"Enter your API key (optional)"})]}),jsxRuntimeExports.jsxs("div",{className:"form-group",children:[jsxRuntimeExports.jsx("label",{htmlFor:"eka-base-url",children:"Base URL"}),jsxRuntimeExports.jsx("input",{id:"eka-base-url",type:"text",value:$,onChange:b=>_(b.target.value),placeholder:"https://api.eka.care",required:!0})]}),j&&jsxRuntimeExports.jsx("p",{className:"config-error",children:j}),jsxRuntimeExports.jsx("button",{type:"submit",className:"config-submit-btn",children:"Continue"})]})]})}function IdleState({onStartRecording:i}){return jsxRuntimeExports.jsxs("div",{className:"idle-state",children:[jsxRuntimeExports.jsxs("div",{className:"logo",children:[jsxRuntimeExports.jsx("div",{className:"logo-icon",children:jsxRuntimeExports.jsx(LogoIcon,{})}),jsxRuntimeExports.jsx("span",{className:"logo-text",children:"eka.scribe"})]}),jsxRuntimeExports.jsxs("button",{className:"start-btn",onClick:i,children:["Start Recording",jsxRuntimeExports.jsx("span",{className:"mic-icon",children:jsxRuntimeExports.jsx(MicIcon,{})})]})]})}function PermissionState({onRequestPermission:i}){return jsxRuntimeExports.jsxs("div",{className:"permission-state",children:[jsxRuntimeExports.jsx("div",{className:"permission-icon",children:jsxRuntimeExports.jsx(MicIcon,{})}),jsxRuntimeExports.jsxs("p",{className:"permission-text",children:["Microphone access is required to record audio.",jsxRuntimeExports.jsx("br",{}),"Please allow access when prompted."]}),jsxRuntimeExports.jsx("button",{className:"permission-btn",onClick:i,children:"Allow Microphone"})]})}function formatTime(i){const e=Math.floor(i/60),s=i%60;return`${e.toString().padStart(2,"0")}:${s.toString().padStart(2,"0")}`}function RecordingState({elapsedTime:i,isPaused:e,onPause:s,onResume:c,onStop:h}){return jsxRuntimeExports.jsxs("div",{className:"recording-state",children:[jsxRuntimeExports.jsxs("div",{className:"recording-indicator",children:[jsxRuntimeExports.jsx("div",{className:`recording-icon ${e?"":"active"}`,children:jsxRuntimeExports.jsx(ChatIcon,{})}),jsxRuntimeExports.jsx("span",{className:"timer",children:formatTime(i)})]}),jsxRuntimeExports.jsxs("div",{className:"recording-actions",children:[e?jsxRuntimeExports.jsx("button",{className:"resume-btn",onClick:c,children:"Resume"}):jsxRuntimeExports.jsx("button",{className:"pause-btn",onClick:s,children:"Pause"}),jsxRuntimeExports.jsx("button",{className:"stop-btn",onClick:h,title:"Stop recording",children:jsxRuntimeExports.jsx("div",{className:"stop-icon"})})]})]})}function ProcessingState(){return jsxRuntimeExports.jsxs("div",{className:"processing-state",children:[jsxRuntimeExports.jsx("div",{className:"spinner"}),jsxRuntimeExports.jsx("p",{className:"processing-text",children:"Processing your recording..."})]})}function ResultsState({result:i,onNewRecording:e}){return jsxRuntimeExports.jsxs("div",{className:"results-state",children:[jsxRuntimeExports.jsxs("div",{className:"results-header",children:[jsxRuntimeExports.jsx("span",{className:"results-title",children:"Recording Complete"}),jsxRuntimeExports.jsx("button",{className:"new-recording-btn",onClick:e,children:"New Recording"})]}),jsxRuntimeExports.jsx("div",{className:"results-content",children:jsxRuntimeExports.jsxs("div",{className:"transcript-section",children:[jsxRuntimeExports.jsx("div",{className:"section-title",children:"Transcript"}),jsxRuntimeExports.jsx("div",{className:"transcript-text",children:i.transcript||"No transcript available."})]})})]})}function ErrorState({message:i,onRetry:e}){return jsxRuntimeExports.jsxs("div",{className:"error-state",children:[jsxRuntimeExports.jsx("div",{className:"error-icon",children:jsxRuntimeExports.jsx(ErrorIcon,{})}),jsxRuntimeExports.jsx("p",{className:"error-message",children:i}),jsxRuntimeExports.jsx("button",{className:"retry-btn",onClick:e,children:"Try Again"})]})}const WELL_KNOWN_PATH="/.well-known/medscribealliance";var SessionStatus;(function(i){i.CREATED="created",i.PROCESSING="processing",i.COMPLETED="completed",i.PARTIAL="partial",i.FAILED="failed"})(SessionStatus||(SessionStatus={}));var TemplateStatus;(function(i){i.SUCCESS="success",i.FAILED="failed"})(TemplateStatus||(TemplateStatus={}));var UploadType;(function(i){i.CHUNKED="chunked",i.SINGLE="single"})(UploadType||(UploadType={}));var ErrorCode;(function(i){i.AUTHENTICATION_FAILED="authentication_failed",i.TOKEN_EXPIRED="token_expired",i.INVALID_API_KEY="invalid_api_key",i.FORBIDDEN="forbidden",i.RATE_LIMIT_EXCEEDED="rate_limit_exceeded",i.SESSION_NOT_FOUND="session_not_found",i.TEMPLATE_NOT_FOUND="template_not_found",i.WEBHOOK_NOT_FOUND="webhook_not_found",i.SESSION_EXPIRED="session_expired",i.INVALID_REQUEST="invalid_request",i.INVALID_AUDIO_FORMAT="invalid_audio_format",i.CHUNK_TOO_LARGE="chunk_too_large",i.INVALID_TEMPLATE="invalid_template",i.MISSING_REQUIRED_FIELD="missing_required_field",i.PROCESSING_FAILED="processing_failed",i.AUDIO_QUALITY_POOR="audio_quality_poor",i.AUDIO_TOO_SHORT="audio_too_short",i.LANGUAGE_UNSUPPORTED="language_unsupported",i.INTERNAL_ERROR="internal_error",i.SERVICE_UNAVAILABLE="service_unavailable"})(ErrorCode||(ErrorCode={}));var HttpStatus;(function(i){i[i.OK=200]="OK",i[i.CREATED=201]="CREATED",i[i.ACCEPTED=202]="ACCEPTED",i[i.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",i[i.BAD_REQUEST=400]="BAD_REQUEST",i[i.UNAUTHORIZED=401]="UNAUTHORIZED",i[i.FORBIDDEN=403]="FORBIDDEN",i[i.NOT_FOUND=404]="NOT_FOUND",i[i.GONE=410]="GONE",i[i.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",i[i.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",i[i.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",i[i.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE"})(HttpStatus||(HttpStatus={}));class DiscoveryAPI{constructor(e){this.cachedDiscovery=null,this.cacheTimestamp=0,this.cacheDuration=3600*1e3,this.httpClient=e}async getDiscovery(e,s=!1){const c=Date.now();if(!s&&this.cachedDiscovery&&c-this.cacheTimestamp<this.cacheDuration)return this.cachedDiscovery;const h=e+WELL_KNOWN_PATH,$=await this.httpClient.get(h);return this.cachedDiscovery=$,this.cacheTimestamp=c,$}clearCache(){this.cachedDiscovery=null,this.cacheTimestamp=0}getCachedDiscovery(){const e=Date.now();return this.cachedDiscovery&&e-this.cacheTimestamp<this.cacheDuration?this.cachedDiscovery:null}}var ajv={exports:{}},core$2={},validate={},boolSchema={},errors={},codegen={},code$1={};(function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.regexpCode=i.getEsmExportName=i.getProperty=i.safeStringify=i.stringify=i.strConcat=i.addCodeArg=i.str=i._=i.nil=i._Code=i.Name=i.IDENTIFIER=i._CodeOrName=void 0;class e{}i._CodeOrName=e,i.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class s extends e{constructor(ot){if(super(),!i.IDENTIFIER.test(ot))throw new Error("CodeGen: name must be a valid identifier");this.str=ot}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}i.Name=s;class c extends e{constructor(ot){super(),this._items=typeof ot=="string"?[ot]:ot}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const ot=this._items[0];return ot===""||ot==='""'}get str(){var ot;return(ot=this._str)!==null&&ot!==void 0?ot:this._str=this._items.reduce((it,at)=>`${it}${at}`,"")}get names(){var ot;return(ot=this._names)!==null&&ot!==void 0?ot:this._names=this._items.reduce((it,at)=>(at instanceof s&&(it[at.str]=(it[at.str]||0)+1),it),{})}}i._Code=c,i.nil=new c("");function h(tt,...ot){const it=[tt[0]];let at=0;for(;at<ot.length;)j(it,ot[at]),it.push(tt[++at]);return new c(it)}i._=h;const $=new c("+");function _(tt,...ot){const it=[d(tt[0])];let at=0;for(;at<ot.length;)it.push($),j(it,ot[at]),it.push($,d(tt[++at]));return nt(it),new c(it)}i.str=_;function j(tt,ot){ot instanceof c?tt.push(...ot._items):ot instanceof s?tt.push(ot):tt.push(a(ot))}i.addCodeArg=j;function nt(tt){let ot=1;for(;ot<tt.length-1;){if(tt[ot]===$){const it=et(tt[ot-1],tt[ot+1]);if(it!==void 0){tt.splice(ot-1,3,it);continue}tt[ot++]="+"}ot++}}function et(tt,ot){if(ot==='""')return tt;if(tt==='""')return ot;if(typeof tt=="string")return ot instanceof s||tt[tt.length-1]!=='"'?void 0:typeof ot!="string"?`${tt.slice(0,-1)}${ot}"`:ot[0]==='"'?tt.slice(0,-1)+ot.slice(1):void 0;if(typeof ot=="string"&&ot[0]==='"'&&!(tt instanceof s))return`"${tt}${ot.slice(1)}`}function b(tt,ot){return ot.emptyStr()?tt:tt.emptyStr()?ot:_`${tt}${ot}`}i.strConcat=b;function a(tt){return typeof tt=="number"||typeof tt=="boolean"||tt===null?tt:d(Array.isArray(tt)?tt.join(","):tt)}function o(tt){return new c(d(tt))}i.stringify=o;function d(tt){return JSON.stringify(tt).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}i.safeStringify=d;function g(tt){return typeof tt=="string"&&i.IDENTIFIER.test(tt)?new c(`.${tt}`):h`[${tt}]`}i.getProperty=g;function rt(tt){if(typeof tt=="string"&&i.IDENTIFIER.test(tt))return new c(`${tt}`);throw new Error(`CodeGen: invalid export name: ${tt}, use explicit $id name mapping`)}i.getEsmExportName=rt;function st(tt){return new c(tt.toString())}i.regexpCode=st})(code$1);var scope={};(function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.ValueScope=i.ValueScopeName=i.Scope=i.varKinds=i.UsedValueState=void 0;const e=code$1;class s extends Error{constructor(et){super(`CodeGen: "code" for ${et} not defined`),this.value=et.value}}var c;(function(nt){nt[nt.Started=0]="Started",nt[nt.Completed=1]="Completed"})(c||(i.UsedValueState=c={})),i.varKinds={const:new e.Name("const"),let:new e.Name("let"),var:new e.Name("var")};class h{constructor({prefixes:et,parent:b}={}){this._names={},this._prefixes=et,this._parent=b}toName(et){return et instanceof e.Name?et:this.name(et)}name(et){return new e.Name(this._newName(et))}_newName(et){const b=this._names[et]||this._nameGroup(et);return`${et}${b.index++}`}_nameGroup(et){var b,a;if(!((a=(b=this._parent)===null||b===void 0?void 0:b._prefixes)===null||a===void 0)&&a.has(et)||this._prefixes&&!this._prefixes.has(et))throw new Error(`CodeGen: prefix "${et}" is not allowed in this scope`);return this._names[et]={prefix:et,index:0}}}i.Scope=h;class $ extends e.Name{constructor(et,b){super(b),this.prefix=et}setValue(et,{property:b,itemIndex:a}){this.value=et,this.scopePath=(0,e._)`.${new e.Name(b)}[${a}]`}}i.ValueScopeName=$;const _=(0,e._)`\n`;class j extends h{constructor(et){super(et),this._values={},this._scope=et.scope,this.opts={...et,_n:et.lines?_:e.nil}}get(){return this._scope}name(et){return new $(et,this._newName(et))}value(et,b){var a;if(b.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const o=this.toName(et),{prefix:d}=o,g=(a=b.key)!==null&&a!==void 0?a:b.ref;let rt=this._values[d];if(rt){const ot=rt.get(g);if(ot)return ot}else rt=this._values[d]=new Map;rt.set(g,o);const st=this._scope[d]||(this._scope[d]=[]),tt=st.length;return st[tt]=b.ref,o.setValue(b,{property:d,itemIndex:tt}),o}getValue(et,b){const a=this._values[et];if(a)return a.get(b)}scopeRefs(et,b=this._values){return this._reduceValues(b,a=>{if(a.scopePath===void 0)throw new Error(`CodeGen: name "${a}" has no value`);return(0,e._)`${et}${a.scopePath}`})}scopeCode(et=this._values,b,a){return this._reduceValues(et,o=>{if(o.value===void 0)throw new Error(`CodeGen: name "${o}" has no value`);return o.value.code},b,a)}_reduceValues(et,b,a={},o){let d=e.nil;for(const g in et){const rt=et[g];if(!rt)continue;const st=a[g]=a[g]||new Map;rt.forEach(tt=>{if(st.has(tt))return;st.set(tt,c.Started);let ot=b(tt);if(ot){const it=this.opts.es5?i.varKinds.var:i.varKinds.const;d=(0,e._)`${d}${it} ${tt} = ${ot};${this.opts._n}`}else if(ot=o==null?void 0:o(tt))d=(0,e._)`${d}${ot}${this.opts._n}`;else throw new s(tt);st.set(tt,c.Completed)})}return d}}i.ValueScope=j})(scope),function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.or=i.and=i.not=i.CodeGen=i.operators=i.varKinds=i.ValueScopeName=i.ValueScope=i.Scope=i.Name=i.regexpCode=i.stringify=i.getProperty=i.nil=i.strConcat=i.str=i._=void 0;const e=code$1,s=scope;var c=code$1;Object.defineProperty(i,"_",{enumerable:!0,get:function(){return c._}}),Object.defineProperty(i,"str",{enumerable:!0,get:function(){return c.str}}),Object.defineProperty(i,"strConcat",{enumerable:!0,get:function(){return c.strConcat}}),Object.defineProperty(i,"nil",{enumerable:!0,get:function(){return c.nil}}),Object.defineProperty(i,"getProperty",{enumerable:!0,get:function(){return c.getProperty}}),Object.defineProperty(i,"stringify",{enumerable:!0,get:function(){return c.stringify}}),Object.defineProperty(i,"regexpCode",{enumerable:!0,get:function(){return c.regexpCode}}),Object.defineProperty(i,"Name",{enumerable:!0,get:function(){return c.Name}});var h=scope;Object.defineProperty(i,"Scope",{enumerable:!0,get:function(){return h.Scope}}),Object.defineProperty(i,"ValueScope",{enumerable:!0,get:function(){return h.ValueScope}}),Object.defineProperty(i,"ValueScopeName",{enumerable:!0,get:function(){return h.ValueScopeName}}),Object.defineProperty(i,"varKinds",{enumerable:!0,get:function(){return h.varKinds}}),i.operators={GT:new e._Code(">"),GTE:new e._Code(">="),LT:new e._Code("<"),LTE:new e._Code("<="),EQ:new e._Code("==="),NEQ:new e._Code("!=="),NOT:new e._Code("!"),OR:new e._Code("||"),AND:new e._Code("&&"),ADD:new e._Code("+")};class ${optimizeNodes(){return this}optimizeNames(pt,_t){return this}}class _ extends ${constructor(pt,_t,Ct){super(),this.varKind=pt,this.name=_t,this.rhs=Ct}render({es5:pt,_n:_t}){const Ct=pt?s.varKinds.var:this.varKind,zt=this.rhs===void 0?"":` = ${this.rhs}`;return`${Ct} ${this.name}${zt};`+_t}optimizeNames(pt,_t){if(pt[this.name.str])return this.rhs&&(this.rhs=vt(this.rhs,pt,_t)),this}get names(){return this.rhs instanceof e._CodeOrName?this.rhs.names:{}}}class j extends ${constructor(pt,_t,Ct){super(),this.lhs=pt,this.rhs=_t,this.sideEffects=Ct}render({_n:pt}){return`${this.lhs} = ${this.rhs};`+pt}optimizeNames(pt,_t){if(!(this.lhs instanceof e.Name&&!pt[this.lhs.str]&&!this.sideEffects))return this.rhs=vt(this.rhs,pt,_t),this}get names(){const pt=this.lhs instanceof e.Name?{}:{...this.lhs.names};return Tt(pt,this.rhs)}}class nt extends j{constructor(pt,_t,Ct,zt){super(pt,Ct,zt),this.op=_t}render({_n:pt}){return`${this.lhs} ${this.op}= ${this.rhs};`+pt}}class et extends ${constructor(pt){super(),this.label=pt,this.names={}}render({_n:pt}){return`${this.label}:`+pt}}class b extends ${constructor(pt){super(),this.label=pt,this.names={}}render({_n:pt}){return`break${this.label?` ${this.label}`:""};`+pt}}class a extends ${constructor(pt){super(),this.error=pt}render({_n:pt}){return`throw ${this.error};`+pt}get names(){return this.error.names}}class o extends ${constructor(pt){super(),this.code=pt}render({_n:pt}){return`${this.code};`+pt}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(pt,_t){return this.code=vt(this.code,pt,_t),this}get names(){return this.code instanceof e._CodeOrName?this.code.names:{}}}class d extends ${constructor(pt=[]){super(),this.nodes=pt}render(pt){return this.nodes.reduce((_t,Ct)=>_t+Ct.render(pt),"")}optimizeNodes(){const{nodes:pt}=this;let _t=pt.length;for(;_t--;){const Ct=pt[_t].optimizeNodes();Array.isArray(Ct)?pt.splice(_t,1,...Ct):Ct?pt[_t]=Ct:pt.splice(_t,1)}return pt.length>0?this:void 0}optimizeNames(pt,_t){const{nodes:Ct}=this;let zt=Ct.length;for(;zt--;){const Nt=Ct[zt];Nt.optimizeNames(pt,_t)||($t(pt,Nt.names),Ct.splice(zt,1))}return Ct.length>0?this:void 0}get names(){return this.nodes.reduce((pt,_t)=>bt(pt,_t.names),{})}}class g extends d{render(pt){return"{"+pt._n+super.render(pt)+"}"+pt._n}}class rt extends d{}class st extends g{}st.kind="else";class tt extends g{constructor(pt,_t){super(_t),this.condition=pt}render(pt){let _t=`if(${this.condition})`+super.render(pt);return this.else&&(_t+="else "+this.else.render(pt)),_t}optimizeNodes(){super.optimizeNodes();const pt=this.condition;if(pt===!0)return this.nodes;let _t=this.else;if(_t){const Ct=_t.optimizeNodes();_t=this.else=Array.isArray(Ct)?new st(Ct):Ct}if(_t)return pt===!1?_t instanceof tt?_t:_t.nodes:this.nodes.length?this:new tt(At(pt),_t instanceof tt?[_t]:_t.nodes);if(!(pt===!1||!this.nodes.length))return this}optimizeNames(pt,_t){var Ct;if(this.else=(Ct=this.else)===null||Ct===void 0?void 0:Ct.optimizeNames(pt,_t),!!(super.optimizeNames(pt,_t)||this.else))return this.condition=vt(this.condition,pt,_t),this}get names(){const pt=super.names;return Tt(pt,this.condition),this.else&&bt(pt,this.else.names),pt}}tt.kind="if";class ot extends g{}ot.kind="for";class it extends ot{constructor(pt){super(),this.iteration=pt}render(pt){return`for(${this.iteration})`+super.render(pt)}optimizeNames(pt,_t){if(super.optimizeNames(pt,_t))return this.iteration=vt(this.iteration,pt,_t),this}get names(){return bt(super.names,this.iteration.names)}}class at extends ot{constructor(pt,_t,Ct,zt){super(),this.varKind=pt,this.name=_t,this.from=Ct,this.to=zt}render(pt){const _t=pt.es5?s.varKinds.var:this.varKind,{name:Ct,from:zt,to:Nt}=this;return`for(${_t} ${Ct}=${zt}; ${Ct}<${Nt}; ${Ct}++)`+super.render(pt)}get names(){const pt=Tt(super.names,this.from);return Tt(pt,this.to)}}class ut extends ot{constructor(pt,_t,Ct,zt){super(),this.loop=pt,this.varKind=_t,this.name=Ct,this.iterable=zt}render(pt){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(pt)}optimizeNames(pt,_t){if(super.optimizeNames(pt,_t))return this.iterable=vt(this.iterable,pt,_t),this}get names(){return bt(super.names,this.iterable.names)}}class lt extends g{constructor(pt,_t,Ct){super(),this.name=pt,this.args=_t,this.async=Ct}render(pt){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(pt)}}lt.kind="func";class ct extends d{render(pt){return"return "+super.render(pt)}}ct.kind="return";class ft extends g{render(pt){let _t="try"+super.render(pt);return this.catch&&(_t+=this.catch.render(pt)),this.finally&&(_t+=this.finally.render(pt)),_t}optimizeNodes(){var pt,_t;return super.optimizeNodes(),(pt=this.catch)===null||pt===void 0||pt.optimizeNodes(),(_t=this.finally)===null||_t===void 0||_t.optimizeNodes(),this}optimizeNames(pt,_t){var Ct,zt;return super.optimizeNames(pt,_t),(Ct=this.catch)===null||Ct===void 0||Ct.optimizeNames(pt,_t),(zt=this.finally)===null||zt===void 0||zt.optimizeNames(pt,_t),this}get names(){const pt=super.names;return this.catch&&bt(pt,this.catch.names),this.finally&&bt(pt,this.finally.names),pt}}class dt extends g{constructor(pt){super(),this.error=pt}render(pt){return`catch(${this.error})`+super.render(pt)}}dt.kind="catch";class yt extends g{render(pt){return"finally"+super.render(pt)}}yt.kind="finally";class St{constructor(pt,_t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={..._t,_n:_t.lines?`
|
|
40
|
+
`+$.stack}return{value:i,source:e,stack:h,digest:null}}function Ki(i,e,s){return{value:i,source:null,stack:s??null,digest:e??null}}function Li(i,e){try{console.error(e.value)}catch(s){setTimeout(function(){throw s})}}var Mi=typeof WeakMap=="function"?WeakMap:Map;function Ni(i,e,s){s=mh(-1,s),s.tag=3,s.payload={element:null};var c=e.value;return s.callback=function(){Oi||(Oi=!0,Pi=c),Li(i,e)},s}function Qi(i,e,s){s=mh(-1,s),s.tag=3;var c=i.type.getDerivedStateFromError;if(typeof c=="function"){var h=e.value;s.payload=function(){return c(h)},s.callback=function(){Li(i,e)}}var $=i.stateNode;return $!==null&&typeof $.componentDidCatch=="function"&&(s.callback=function(){Li(i,e),typeof c!="function"&&(Ri===null?Ri=new Set([this]):Ri.add(this));var _=e.stack;this.componentDidCatch(e.value,{componentStack:_!==null?_:""})}),s}function Si(i,e,s){var c=i.pingCache;if(c===null){c=i.pingCache=new Mi;var h=new Set;c.set(e,h)}else h=c.get(e),h===void 0&&(h=new Set,c.set(e,h));h.has(s)||(h.add(s),i=Ti.bind(null,i,e,s),e.then(i,i))}function Ui(i){do{var e;if((e=i.tag===13)&&(e=i.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return i;i=i.return}while(i!==null);return null}function Vi(i,e,s,c,h){return i.mode&1?(i.flags|=65536,i.lanes=h,i):(i===e?i.flags|=65536:(i.flags|=128,s.flags|=131072,s.flags&=-52805,s.tag===1&&(s.alternate===null?s.tag=17:(e=mh(-1,1),e.tag=2,nh(s,e,1))),s.lanes|=1),i)}var Wi=ua$1.ReactCurrentOwner,dh=!1;function Xi(i,e,s,c){e.child=i===null?Vg(e,null,s,c):Ug(e,i.child,s,c)}function Yi(i,e,s,c,h){s=s.render;var $=e.ref;return ch(e,h),c=Nh(i,e,s,c,$,h),s=Sh(),i!==null&&!dh?(e.updateQueue=i.updateQueue,e.flags&=-2053,i.lanes&=~h,Zi(i,e,h)):(I&&s&&vg(e),e.flags|=1,Xi(i,e,c,h),e.child)}function $i(i,e,s,c,h){if(i===null){var $=s.type;return typeof $=="function"&&!aj($)&&$.defaultProps===void 0&&s.compare===null&&s.defaultProps===void 0?(e.tag=15,e.type=$,bj(i,e,$,c,h)):(i=Rg(s.type,null,c,e,e.mode,h),i.ref=e.ref,i.return=e,e.child=i)}if($=i.child,!(i.lanes&h)){var _=$.memoizedProps;if(s=s.compare,s=s!==null?s:Ie$1,s(_,c)&&i.ref===e.ref)return Zi(i,e,h)}return e.flags|=1,i=Pg($,c),i.ref=e.ref,i.return=e,e.child=i}function bj(i,e,s,c,h){if(i!==null){var $=i.memoizedProps;if(Ie$1($,c)&&i.ref===e.ref)if(dh=!1,e.pendingProps=c=$,(i.lanes&h)!==0)i.flags&131072&&(dh=!0);else return e.lanes=i.lanes,Zi(i,e,h)}return cj(i,e,s,c,h)}function dj(i,e,s){var c=e.pendingProps,h=c.children,$=i!==null?i.memoizedState:null;if(c.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},G(ej,fj),fj|=s;else{if(!(s&1073741824))return i=$!==null?$.baseLanes|s:s,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:i,cachePool:null,transitions:null},e.updateQueue=null,G(ej,fj),fj|=i,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},c=$!==null?$.baseLanes:s,G(ej,fj),fj|=c}else $!==null?(c=$.baseLanes|s,e.memoizedState=null):c=s,G(ej,fj),fj|=c;return Xi(i,e,h,s),e.child}function gj(i,e){var s=e.ref;(i===null&&s!==null||i!==null&&i.ref!==s)&&(e.flags|=512,e.flags|=2097152)}function cj(i,e,s,c,h){var $=Zf(s)?Xf:H.current;return $=Yf(e,$),ch(e,h),s=Nh(i,e,s,c,$,h),c=Sh(),i!==null&&!dh?(e.updateQueue=i.updateQueue,e.flags&=-2053,i.lanes&=~h,Zi(i,e,h)):(I&&c&&vg(e),e.flags|=1,Xi(i,e,s,h),e.child)}function hj(i,e,s,c,h){if(Zf(s)){var $=!0;cg(e)}else $=!1;if(ch(e,h),e.stateNode===null)ij(i,e),Gi(e,s,c),Ii(e,s,c,h),c=!0;else if(i===null){var _=e.stateNode,j=e.memoizedProps;_.props=j;var nt=_.context,et=s.contextType;typeof et=="object"&&et!==null?et=eh(et):(et=Zf(s)?Xf:H.current,et=Yf(e,et));var b=s.getDerivedStateFromProps,a=typeof b=="function"||typeof _.getSnapshotBeforeUpdate=="function";a||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(j!==c||nt!==et)&&Hi(e,_,c,et),jh=!1;var o=e.memoizedState;_.state=o,qh(e,c,_,h),nt=e.memoizedState,j!==c||o!==nt||Wf.current||jh?(typeof b=="function"&&(Di(e,s,b,c),nt=e.memoizedState),(j=jh||Fi(e,s,j,c,o,nt,et))?(a||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount()),typeof _.componentDidMount=="function"&&(e.flags|=4194308)):(typeof _.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=c,e.memoizedState=nt),_.props=c,_.state=nt,_.context=et,c=j):(typeof _.componentDidMount=="function"&&(e.flags|=4194308),c=!1)}else{_=e.stateNode,lh(i,e),j=e.memoizedProps,et=e.type===e.elementType?j:Ci(e.type,j),_.props=et,a=e.pendingProps,o=_.context,nt=s.contextType,typeof nt=="object"&&nt!==null?nt=eh(nt):(nt=Zf(s)?Xf:H.current,nt=Yf(e,nt));var d=s.getDerivedStateFromProps;(b=typeof d=="function"||typeof _.getSnapshotBeforeUpdate=="function")||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(j!==a||o!==nt)&&Hi(e,_,c,nt),jh=!1,o=e.memoizedState,_.state=o,qh(e,c,_,h);var g=e.memoizedState;j!==a||o!==g||Wf.current||jh?(typeof d=="function"&&(Di(e,s,d,c),g=e.memoizedState),(et=jh||Fi(e,s,et,c,o,g,nt)||!1)?(b||typeof _.UNSAFE_componentWillUpdate!="function"&&typeof _.componentWillUpdate!="function"||(typeof _.componentWillUpdate=="function"&&_.componentWillUpdate(c,g,nt),typeof _.UNSAFE_componentWillUpdate=="function"&&_.UNSAFE_componentWillUpdate(c,g,nt)),typeof _.componentDidUpdate=="function"&&(e.flags|=4),typeof _.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof _.componentDidUpdate!="function"||j===i.memoizedProps&&o===i.memoizedState||(e.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||j===i.memoizedProps&&o===i.memoizedState||(e.flags|=1024),e.memoizedProps=c,e.memoizedState=g),_.props=c,_.state=g,_.context=nt,c=et):(typeof _.componentDidUpdate!="function"||j===i.memoizedProps&&o===i.memoizedState||(e.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||j===i.memoizedProps&&o===i.memoizedState||(e.flags|=1024),c=!1)}return jj(i,e,s,c,$,h)}function jj(i,e,s,c,h,$){gj(i,e);var _=(e.flags&128)!==0;if(!c&&!_)return h&&dg(e,s,!1),Zi(i,e,$);c=e.stateNode,Wi.current=e;var j=_&&typeof s.getDerivedStateFromError!="function"?null:c.render();return e.flags|=1,i!==null&&_?(e.child=Ug(e,i.child,null,$),e.child=Ug(e,null,j,$)):Xi(i,e,j,$),e.memoizedState=c.state,h&&dg(e,s,!0),e.child}function kj(i){var e=i.stateNode;e.pendingContext?ag(i,e.pendingContext,e.pendingContext!==e.context):e.context&&ag(i,e.context,!1),yh(i,e.containerInfo)}function lj(i,e,s,c,h){return Ig(),Jg(h),e.flags|=256,Xi(i,e,s,c),e.child}var mj={dehydrated:null,treeContext:null,retryLane:0};function nj(i){return{baseLanes:i,cachePool:null,transitions:null}}function oj(i,e,s){var c=e.pendingProps,h=L.current,$=!1,_=(e.flags&128)!==0,j;if((j=_)||(j=i!==null&&i.memoizedState===null?!1:(h&2)!==0),j?($=!0,e.flags&=-129):(i===null||i.memoizedState!==null)&&(h|=1),G(L,h&1),i===null)return Eg(e),i=e.memoizedState,i!==null&&(i=i.dehydrated,i!==null)?(e.mode&1?i.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(_=c.children,i=c.fallback,$?(c=e.mode,$=e.child,_={mode:"hidden",children:_},!(c&1)&&$!==null?($.childLanes=0,$.pendingProps=_):$=pj(_,c,0,null),i=Tg(i,c,s,null),$.return=e,i.return=e,$.sibling=i,e.child=$,e.child.memoizedState=nj(s),e.memoizedState=mj,i):qj(e,_));if(h=i.memoizedState,h!==null&&(j=h.dehydrated,j!==null))return rj(i,e,_,c,j,h,s);if($){$=c.fallback,_=e.mode,h=i.child,j=h.sibling;var nt={mode:"hidden",children:c.children};return!(_&1)&&e.child!==h?(c=e.child,c.childLanes=0,c.pendingProps=nt,e.deletions=null):(c=Pg(h,nt),c.subtreeFlags=h.subtreeFlags&14680064),j!==null?$=Pg(j,$):($=Tg($,_,s,null),$.flags|=2),$.return=e,c.return=e,c.sibling=$,e.child=c,c=$,$=e.child,_=i.child.memoizedState,_=_===null?nj(s):{baseLanes:_.baseLanes|s,cachePool:null,transitions:_.transitions},$.memoizedState=_,$.childLanes=i.childLanes&~s,e.memoizedState=mj,c}return $=i.child,i=$.sibling,c=Pg($,{mode:"visible",children:c.children}),!(e.mode&1)&&(c.lanes=s),c.return=e,c.sibling=null,i!==null&&(s=e.deletions,s===null?(e.deletions=[i],e.flags|=16):s.push(i)),e.child=c,e.memoizedState=null,c}function qj(i,e){return e=pj({mode:"visible",children:e},i.mode,0,null),e.return=i,i.child=e}function sj(i,e,s,c){return c!==null&&Jg(c),Ug(e,i.child,null,s),i=qj(e,e.pendingProps.children),i.flags|=2,e.memoizedState=null,i}function rj(i,e,s,c,h,$,_){if(s)return e.flags&256?(e.flags&=-257,c=Ki(Error(p(422))),sj(i,e,_,c)):e.memoizedState!==null?(e.child=i.child,e.flags|=128,null):($=c.fallback,h=e.mode,c=pj({mode:"visible",children:c.children},h,0,null),$=Tg($,h,_,null),$.flags|=2,c.return=e,$.return=e,c.sibling=$,e.child=c,e.mode&1&&Ug(e,i.child,null,_),e.child.memoizedState=nj(_),e.memoizedState=mj,$);if(!(e.mode&1))return sj(i,e,_,null);if(h.data==="$!"){if(c=h.nextSibling&&h.nextSibling.dataset,c)var j=c.dgst;return c=j,$=Error(p(419)),c=Ki($,c,void 0),sj(i,e,_,c)}if(j=(_&i.childLanes)!==0,dh||j){if(c=Q,c!==null){switch(_&-_){case 4:h=2;break;case 16:h=8;break;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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:h=32;break;case 536870912:h=268435456;break;default:h=0}h=h&(c.suspendedLanes|_)?0:h,h!==0&&h!==$.retryLane&&($.retryLane=h,ih(i,h),gi(c,i,h,-1))}return tj(),c=Ki(Error(p(421))),sj(i,e,_,c)}return h.data==="$?"?(e.flags|=128,e.child=i.child,e=uj.bind(null,i),h._reactRetry=e,null):(i=$.treeContext,yg=Lf(h.nextSibling),xg=e,I=!0,zg=null,i!==null&&(og[pg++]=rg,og[pg++]=sg,og[pg++]=qg,rg=i.id,sg=i.overflow,qg=e),e=qj(e,c.children),e.flags|=4096,e)}function vj(i,e,s){i.lanes|=e;var c=i.alternate;c!==null&&(c.lanes|=e),bh(i.return,e,s)}function wj(i,e,s,c,h){var $=i.memoizedState;$===null?i.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:c,tail:s,tailMode:h}:($.isBackwards=e,$.rendering=null,$.renderingStartTime=0,$.last=c,$.tail=s,$.tailMode=h)}function xj(i,e,s){var c=e.pendingProps,h=c.revealOrder,$=c.tail;if(Xi(i,e,c.children,s),c=L.current,c&2)c=c&1|2,e.flags|=128;else{if(i!==null&&i.flags&128)e:for(i=e.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&vj(i,s,e);else if(i.tag===19)vj(i,s,e);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===e)break e;for(;i.sibling===null;){if(i.return===null||i.return===e)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}c&=1}if(G(L,c),!(e.mode&1))e.memoizedState=null;else switch(h){case"forwards":for(s=e.child,h=null;s!==null;)i=s.alternate,i!==null&&Ch(i)===null&&(h=s),s=s.sibling;s=h,s===null?(h=e.child,e.child=null):(h=s.sibling,s.sibling=null),wj(e,!1,h,s,$);break;case"backwards":for(s=null,h=e.child,e.child=null;h!==null;){if(i=h.alternate,i!==null&&Ch(i)===null){e.child=h;break}i=h.sibling,h.sibling=s,s=h,h=i}wj(e,!0,s,null,$);break;case"together":wj(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function ij(i,e){!(e.mode&1)&&i!==null&&(i.alternate=null,e.alternate=null,e.flags|=2)}function Zi(i,e,s){if(i!==null&&(e.dependencies=i.dependencies),rh|=e.lanes,!(s&e.childLanes))return null;if(i!==null&&e.child!==i.child)throw Error(p(153));if(e.child!==null){for(i=e.child,s=Pg(i,i.pendingProps),e.child=s,s.return=e;i.sibling!==null;)i=i.sibling,s=s.sibling=Pg(i,i.pendingProps),s.return=e;s.sibling=null}return e.child}function yj(i,e,s){switch(e.tag){case 3:kj(e),Ig();break;case 5:Ah(e);break;case 1:Zf(e.type)&&cg(e);break;case 4:yh(e,e.stateNode.containerInfo);break;case 10:var c=e.type._context,h=e.memoizedProps.value;G(Wg,c._currentValue),c._currentValue=h;break;case 13:if(c=e.memoizedState,c!==null)return c.dehydrated!==null?(G(L,L.current&1),e.flags|=128,null):s&e.child.childLanes?oj(i,e,s):(G(L,L.current&1),i=Zi(i,e,s),i!==null?i.sibling:null);G(L,L.current&1);break;case 19:if(c=(s&e.childLanes)!==0,i.flags&128){if(c)return xj(i,e,s);e.flags|=128}if(h=e.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),G(L,L.current),c)break;return null;case 22:case 23:return e.lanes=0,dj(i,e,s)}return Zi(i,e,s)}var zj,Aj,Bj,Cj;zj=function(i,e){for(var s=e.child;s!==null;){if(s.tag===5||s.tag===6)i.appendChild(s.stateNode);else if(s.tag!==4&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===e)break;for(;s.sibling===null;){if(s.return===null||s.return===e)return;s=s.return}s.sibling.return=s.return,s=s.sibling}},Aj=function(){},Bj=function(i,e,s,c){var h=i.memoizedProps;if(h!==c){i=e.stateNode,xh(uh.current);var $=null;switch(s){case"input":h=Ya$1(i,h),c=Ya$1(i,c),$=[];break;case"select":h=A({},h,{value:void 0}),c=A({},c,{value:void 0}),$=[];break;case"textarea":h=gb(i,h),c=gb(i,c),$=[];break;default:typeof h.onClick!="function"&&typeof c.onClick=="function"&&(i.onclick=Bf)}ub(s,c);var _;s=null;for(et in h)if(!c.hasOwnProperty(et)&&h.hasOwnProperty(et)&&h[et]!=null)if(et==="style"){var j=h[et];for(_ in j)j.hasOwnProperty(_)&&(s||(s={}),s[_]="")}else et!=="dangerouslySetInnerHTML"&&et!=="children"&&et!=="suppressContentEditableWarning"&&et!=="suppressHydrationWarning"&&et!=="autoFocus"&&(ea$1.hasOwnProperty(et)?$||($=[]):($=$||[]).push(et,null));for(et in c){var nt=c[et];if(j=h!=null?h[et]:void 0,c.hasOwnProperty(et)&&nt!==j&&(nt!=null||j!=null))if(et==="style")if(j){for(_ in j)!j.hasOwnProperty(_)||nt&&nt.hasOwnProperty(_)||(s||(s={}),s[_]="");for(_ in nt)nt.hasOwnProperty(_)&&j[_]!==nt[_]&&(s||(s={}),s[_]=nt[_])}else s||($||($=[]),$.push(et,s)),s=nt;else et==="dangerouslySetInnerHTML"?(nt=nt?nt.__html:void 0,j=j?j.__html:void 0,nt!=null&&j!==nt&&($=$||[]).push(et,nt)):et==="children"?typeof nt!="string"&&typeof nt!="number"||($=$||[]).push(et,""+nt):et!=="suppressContentEditableWarning"&&et!=="suppressHydrationWarning"&&(ea$1.hasOwnProperty(et)?(nt!=null&&et==="onScroll"&&D("scroll",i),$||j===nt||($=[])):($=$||[]).push(et,nt))}s&&($=$||[]).push("style",s);var et=$;(e.updateQueue=et)&&(e.flags|=4)}},Cj=function(i,e,s,c){s!==c&&(e.flags|=4)};function Dj(i,e){if(!I)switch(i.tailMode){case"hidden":e=i.tail;for(var s=null;e!==null;)e.alternate!==null&&(s=e),e=e.sibling;s===null?i.tail=null:s.sibling=null;break;case"collapsed":s=i.tail;for(var c=null;s!==null;)s.alternate!==null&&(c=s),s=s.sibling;c===null?e||i.tail===null?i.tail=null:i.tail.sibling=null:c.sibling=null}}function S(i){var e=i.alternate!==null&&i.alternate.child===i.child,s=0,c=0;if(e)for(var h=i.child;h!==null;)s|=h.lanes|h.childLanes,c|=h.subtreeFlags&14680064,c|=h.flags&14680064,h.return=i,h=h.sibling;else for(h=i.child;h!==null;)s|=h.lanes|h.childLanes,c|=h.subtreeFlags,c|=h.flags,h.return=i,h=h.sibling;return i.subtreeFlags|=c,i.childLanes=s,e}function Ej(i,e,s){var c=e.pendingProps;switch(wg(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return S(e),null;case 1:return Zf(e.type)&&$f(),S(e),null;case 3:return c=e.stateNode,zh(),E(Wf),E(H),Eh(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(i===null||i.child===null)&&(Gg(e)?e.flags|=4:i===null||i.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,zg!==null&&(Fj(zg),zg=null))),Aj(i,e),S(e),null;case 5:Bh(e);var h=xh(wh.current);if(s=e.type,i!==null&&e.stateNode!=null)Bj(i,e,s,c,h),i.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!c){if(e.stateNode===null)throw Error(p(166));return S(e),null}if(i=xh(uh.current),Gg(e)){c=e.stateNode,s=e.type;var $=e.memoizedProps;switch(c[Of]=e,c[Pf]=$,i=(e.mode&1)!==0,s){case"dialog":D("cancel",c),D("close",c);break;case"iframe":case"object":case"embed":D("load",c);break;case"video":case"audio":for(h=0;h<lf.length;h++)D(lf[h],c);break;case"source":D("error",c);break;case"img":case"image":case"link":D("error",c),D("load",c);break;case"details":D("toggle",c);break;case"input":Za$1(c,$),D("invalid",c);break;case"select":c._wrapperState={wasMultiple:!!$.multiple},D("invalid",c);break;case"textarea":hb(c,$),D("invalid",c)}ub(s,$),h=null;for(var _ in $)if($.hasOwnProperty(_)){var j=$[_];_==="children"?typeof j=="string"?c.textContent!==j&&($.suppressHydrationWarning!==!0&&Af(c.textContent,j,i),h=["children",j]):typeof j=="number"&&c.textContent!==""+j&&($.suppressHydrationWarning!==!0&&Af(c.textContent,j,i),h=["children",""+j]):ea$1.hasOwnProperty(_)&&j!=null&&_==="onScroll"&&D("scroll",c)}switch(s){case"input":Va$1(c),db(c,$,!0);break;case"textarea":Va$1(c),jb(c);break;case"select":case"option":break;default:typeof $.onClick=="function"&&(c.onclick=Bf)}c=h,e.updateQueue=c,c!==null&&(e.flags|=4)}else{_=h.nodeType===9?h:h.ownerDocument,i==="http://www.w3.org/1999/xhtml"&&(i=kb(s)),i==="http://www.w3.org/1999/xhtml"?s==="script"?(i=_.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild)):typeof c.is=="string"?i=_.createElement(s,{is:c.is}):(i=_.createElement(s),s==="select"&&(_=i,c.multiple?_.multiple=!0:c.size&&(_.size=c.size))):i=_.createElementNS(i,s),i[Of]=e,i[Pf]=c,zj(i,e,!1,!1),e.stateNode=i;e:{switch(_=vb(s,c),s){case"dialog":D("cancel",i),D("close",i),h=c;break;case"iframe":case"object":case"embed":D("load",i),h=c;break;case"video":case"audio":for(h=0;h<lf.length;h++)D(lf[h],i);h=c;break;case"source":D("error",i),h=c;break;case"img":case"image":case"link":D("error",i),D("load",i),h=c;break;case"details":D("toggle",i),h=c;break;case"input":Za$1(i,c),h=Ya$1(i,c),D("invalid",i);break;case"option":h=c;break;case"select":i._wrapperState={wasMultiple:!!c.multiple},h=A({},c,{value:void 0}),D("invalid",i);break;case"textarea":hb(i,c),h=gb(i,c),D("invalid",i);break;default:h=c}ub(s,h),j=h;for($ in j)if(j.hasOwnProperty($)){var nt=j[$];$==="style"?sb(i,nt):$==="dangerouslySetInnerHTML"?(nt=nt?nt.__html:void 0,nt!=null&&nb(i,nt)):$==="children"?typeof nt=="string"?(s!=="textarea"||nt!=="")&&ob(i,nt):typeof nt=="number"&&ob(i,""+nt):$!=="suppressContentEditableWarning"&&$!=="suppressHydrationWarning"&&$!=="autoFocus"&&(ea$1.hasOwnProperty($)?nt!=null&&$==="onScroll"&&D("scroll",i):nt!=null&&ta$1(i,$,nt,_))}switch(s){case"input":Va$1(i),db(i,c,!1);break;case"textarea":Va$1(i),jb(i);break;case"option":c.value!=null&&i.setAttribute("value",""+Sa$1(c.value));break;case"select":i.multiple=!!c.multiple,$=c.value,$!=null?fb(i,!!c.multiple,$,!1):c.defaultValue!=null&&fb(i,!!c.multiple,c.defaultValue,!0);break;default:typeof h.onClick=="function"&&(i.onclick=Bf)}switch(s){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}}c&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return S(e),null;case 6:if(i&&e.stateNode!=null)Cj(i,e,i.memoizedProps,c);else{if(typeof c!="string"&&e.stateNode===null)throw Error(p(166));if(s=xh(wh.current),xh(uh.current),Gg(e)){if(c=e.stateNode,s=e.memoizedProps,c[Of]=e,($=c.nodeValue!==s)&&(i=xg,i!==null))switch(i.tag){case 3:Af(c.nodeValue,s,(i.mode&1)!==0);break;case 5:i.memoizedProps.suppressHydrationWarning!==!0&&Af(c.nodeValue,s,(i.mode&1)!==0)}$&&(e.flags|=4)}else c=(s.nodeType===9?s:s.ownerDocument).createTextNode(c),c[Of]=e,e.stateNode=c}return S(e),null;case 13:if(E(L),c=e.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(I&&yg!==null&&e.mode&1&&!(e.flags&128))Hg(),Ig(),e.flags|=98560,$=!1;else if($=Gg(e),c!==null&&c.dehydrated!==null){if(i===null){if(!$)throw Error(p(318));if($=e.memoizedState,$=$!==null?$.dehydrated:null,!$)throw Error(p(317));$[Of]=e}else Ig(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;S(e),$=!1}else zg!==null&&(Fj(zg),zg=null),$=!0;if(!$)return e.flags&65536?e:null}return e.flags&128?(e.lanes=s,e):(c=c!==null,c!==(i!==null&&i.memoizedState!==null)&&c&&(e.child.flags|=8192,e.mode&1&&(i===null||L.current&1?T===0&&(T=3):tj())),e.updateQueue!==null&&(e.flags|=4),S(e),null);case 4:return zh(),Aj(i,e),i===null&&sf(e.stateNode.containerInfo),S(e),null;case 10:return ah(e.type._context),S(e),null;case 17:return Zf(e.type)&&$f(),S(e),null;case 19:if(E(L),$=e.memoizedState,$===null)return S(e),null;if(c=(e.flags&128)!==0,_=$.rendering,_===null)if(c)Dj($,!1);else{if(T!==0||i!==null&&i.flags&128)for(i=e.child;i!==null;){if(_=Ch(i),_!==null){for(e.flags|=128,Dj($,!1),c=_.updateQueue,c!==null&&(e.updateQueue=c,e.flags|=4),e.subtreeFlags=0,c=s,s=e.child;s!==null;)$=s,i=c,$.flags&=14680066,_=$.alternate,_===null?($.childLanes=0,$.lanes=i,$.child=null,$.subtreeFlags=0,$.memoizedProps=null,$.memoizedState=null,$.updateQueue=null,$.dependencies=null,$.stateNode=null):($.childLanes=_.childLanes,$.lanes=_.lanes,$.child=_.child,$.subtreeFlags=0,$.deletions=null,$.memoizedProps=_.memoizedProps,$.memoizedState=_.memoizedState,$.updateQueue=_.updateQueue,$.type=_.type,i=_.dependencies,$.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),s=s.sibling;return G(L,L.current&1|2),e.child}i=i.sibling}$.tail!==null&&B()>Gj&&(e.flags|=128,c=!0,Dj($,!1),e.lanes=4194304)}else{if(!c)if(i=Ch(_),i!==null){if(e.flags|=128,c=!0,s=i.updateQueue,s!==null&&(e.updateQueue=s,e.flags|=4),Dj($,!0),$.tail===null&&$.tailMode==="hidden"&&!_.alternate&&!I)return S(e),null}else 2*B()-$.renderingStartTime>Gj&&s!==1073741824&&(e.flags|=128,c=!0,Dj($,!1),e.lanes=4194304);$.isBackwards?(_.sibling=e.child,e.child=_):(s=$.last,s!==null?s.sibling=_:e.child=_,$.last=_)}return $.tail!==null?(e=$.tail,$.rendering=e,$.tail=e.sibling,$.renderingStartTime=B(),e.sibling=null,s=L.current,G(L,c?s&1|2:s&1),e):(S(e),null);case 22:case 23:return Hj(),c=e.memoizedState!==null,i!==null&&i.memoizedState!==null!==c&&(e.flags|=8192),c&&e.mode&1?fj&1073741824&&(S(e),e.subtreeFlags&6&&(e.flags|=8192)):S(e),null;case 24:return null;case 25:return null}throw Error(p(156,e.tag))}function Ij(i,e){switch(wg(e),e.tag){case 1:return Zf(e.type)&&$f(),i=e.flags,i&65536?(e.flags=i&-65537|128,e):null;case 3:return zh(),E(Wf),E(H),Eh(),i=e.flags,i&65536&&!(i&128)?(e.flags=i&-65537|128,e):null;case 5:return Bh(e),null;case 13:if(E(L),i=e.memoizedState,i!==null&&i.dehydrated!==null){if(e.alternate===null)throw Error(p(340));Ig()}return i=e.flags,i&65536?(e.flags=i&-65537|128,e):null;case 19:return E(L),null;case 4:return zh(),null;case 10:return ah(e.type._context),null;case 22:case 23:return Hj(),null;case 24:return null;default:return null}}var Jj=!1,U=!1,Kj=typeof WeakSet=="function"?WeakSet:Set,V=null;function Lj(i,e){var s=i.ref;if(s!==null)if(typeof s=="function")try{s(null)}catch(c){W(i,e,c)}else s.current=null}function Mj(i,e,s){try{s()}catch(c){W(i,e,c)}}var Nj=!1;function Oj(i,e){if(Cf=dd,i=Me$1(),Ne$1(i)){if("selectionStart"in i)var s={start:i.selectionStart,end:i.selectionEnd};else e:{s=(s=i.ownerDocument)&&s.defaultView||window;var c=s.getSelection&&s.getSelection();if(c&&c.rangeCount!==0){s=c.anchorNode;var h=c.anchorOffset,$=c.focusNode;c=c.focusOffset;try{s.nodeType,$.nodeType}catch{s=null;break e}var _=0,j=-1,nt=-1,et=0,b=0,a=i,o=null;t:for(;;){for(var d;a!==s||h!==0&&a.nodeType!==3||(j=_+h),a!==$||c!==0&&a.nodeType!==3||(nt=_+c),a.nodeType===3&&(_+=a.nodeValue.length),(d=a.firstChild)!==null;)o=a,a=d;for(;;){if(a===i)break t;if(o===s&&++et===h&&(j=_),o===$&&++b===c&&(nt=_),(d=a.nextSibling)!==null)break;a=o,o=a.parentNode}a=d}s=j===-1||nt===-1?null:{start:j,end:nt}}else s=null}s=s||{start:0,end:0}}else s=null;for(Df={focusedElem:i,selectionRange:s},dd=!1,V=e;V!==null;)if(e=V,i=e.child,(e.subtreeFlags&1028)!==0&&i!==null)i.return=e,V=i;else for(;V!==null;){e=V;try{var g=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var rt=g.memoizedProps,st=g.memoizedState,tt=e.stateNode,ot=tt.getSnapshotBeforeUpdate(e.elementType===e.type?rt:Ci(e.type,rt),st);tt.__reactInternalSnapshotBeforeUpdate=ot}break;case 3:var it=e.stateNode.containerInfo;it.nodeType===1?it.textContent="":it.nodeType===9&&it.documentElement&&it.removeChild(it.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(p(163))}}catch(at){W(e,e.return,at)}if(i=e.sibling,i!==null){i.return=e.return,V=i;break}V=e.return}return g=Nj,Nj=!1,g}function Pj(i,e,s){var c=e.updateQueue;if(c=c!==null?c.lastEffect:null,c!==null){var h=c=c.next;do{if((h.tag&i)===i){var $=h.destroy;h.destroy=void 0,$!==void 0&&Mj(e,s,$)}h=h.next}while(h!==c)}}function Qj(i,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var s=e=e.next;do{if((s.tag&i)===i){var c=s.create;s.destroy=c()}s=s.next}while(s!==e)}}function Rj(i){var e=i.ref;if(e!==null){var s=i.stateNode;switch(i.tag){case 5:i=s;break;default:i=s}typeof e=="function"?e(i):e.current=i}}function Sj(i){var e=i.alternate;e!==null&&(i.alternate=null,Sj(e)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(e=i.stateNode,e!==null&&(delete e[Of],delete e[Pf],delete e[of],delete e[Qf],delete e[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 Tj(i){return i.tag===5||i.tag===3||i.tag===4}function Uj(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||Tj(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 Vj(i,e,s){var c=i.tag;if(c===5||c===6)i=i.stateNode,e?s.nodeType===8?s.parentNode.insertBefore(i,e):s.insertBefore(i,e):(s.nodeType===8?(e=s.parentNode,e.insertBefore(i,s)):(e=s,e.appendChild(i)),s=s._reactRootContainer,s!=null||e.onclick!==null||(e.onclick=Bf));else if(c!==4&&(i=i.child,i!==null))for(Vj(i,e,s),i=i.sibling;i!==null;)Vj(i,e,s),i=i.sibling}function Wj(i,e,s){var c=i.tag;if(c===5||c===6)i=i.stateNode,e?s.insertBefore(i,e):s.appendChild(i);else if(c!==4&&(i=i.child,i!==null))for(Wj(i,e,s),i=i.sibling;i!==null;)Wj(i,e,s),i=i.sibling}var X=null,Xj=!1;function Yj(i,e,s){for(s=s.child;s!==null;)Zj(i,e,s),s=s.sibling}function Zj(i,e,s){if(lc&&typeof lc.onCommitFiberUnmount=="function")try{lc.onCommitFiberUnmount(kc,s)}catch{}switch(s.tag){case 5:U||Lj(s,e);case 6:var c=X,h=Xj;X=null,Yj(i,e,s),X=c,Xj=h,X!==null&&(Xj?(i=X,s=s.stateNode,i.nodeType===8?i.parentNode.removeChild(s):i.removeChild(s)):X.removeChild(s.stateNode));break;case 18:X!==null&&(Xj?(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:c=X,h=Xj,X=s.stateNode.containerInfo,Xj=!0,Yj(i,e,s),X=c,Xj=h;break;case 0:case 11:case 14:case 15:if(!U&&(c=s.updateQueue,c!==null&&(c=c.lastEffect,c!==null))){h=c=c.next;do{var $=h,_=$.destroy;$=$.tag,_!==void 0&&($&2||$&4)&&Mj(s,e,_),h=h.next}while(h!==c)}Yj(i,e,s);break;case 1:if(!U&&(Lj(s,e),c=s.stateNode,typeof c.componentWillUnmount=="function"))try{c.props=s.memoizedProps,c.state=s.memoizedState,c.componentWillUnmount()}catch(j){W(s,e,j)}Yj(i,e,s);break;case 21:Yj(i,e,s);break;case 22:s.mode&1?(U=(c=U)||s.memoizedState!==null,Yj(i,e,s),U=c):Yj(i,e,s);break;default:Yj(i,e,s)}}function ak(i){var e=i.updateQueue;if(e!==null){i.updateQueue=null;var s=i.stateNode;s===null&&(s=i.stateNode=new Kj),e.forEach(function(c){var h=bk.bind(null,i,c);s.has(c)||(s.add(c),c.then(h,h))})}}function ck(i,e){var s=e.deletions;if(s!==null)for(var c=0;c<s.length;c++){var h=s[c];try{var $=i,_=e,j=_;e:for(;j!==null;){switch(j.tag){case 5:X=j.stateNode,Xj=!1;break e;case 3:X=j.stateNode.containerInfo,Xj=!0;break e;case 4:X=j.stateNode.containerInfo,Xj=!0;break e}j=j.return}if(X===null)throw Error(p(160));Zj($,_,h),X=null,Xj=!1;var nt=h.alternate;nt!==null&&(nt.return=null),h.return=null}catch(et){W(h,e,et)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)dk(e,i),e=e.sibling}function dk(i,e){var s=i.alternate,c=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:if(ck(e,i),ek(i),c&4){try{Pj(3,i,i.return),Qj(3,i)}catch(rt){W(i,i.return,rt)}try{Pj(5,i,i.return)}catch(rt){W(i,i.return,rt)}}break;case 1:ck(e,i),ek(i),c&512&&s!==null&&Lj(s,s.return);break;case 5:if(ck(e,i),ek(i),c&512&&s!==null&&Lj(s,s.return),i.flags&32){var h=i.stateNode;try{ob(h,"")}catch(rt){W(i,i.return,rt)}}if(c&4&&(h=i.stateNode,h!=null)){var $=i.memoizedProps,_=s!==null?s.memoizedProps:$,j=i.type,nt=i.updateQueue;if(i.updateQueue=null,nt!==null)try{j==="input"&&$.type==="radio"&&$.name!=null&&ab(h,$),vb(j,_);var et=vb(j,$);for(_=0;_<nt.length;_+=2){var b=nt[_],a=nt[_+1];b==="style"?sb(h,a):b==="dangerouslySetInnerHTML"?nb(h,a):b==="children"?ob(h,a):ta$1(h,b,a,et)}switch(j){case"input":bb(h,$);break;case"textarea":ib(h,$);break;case"select":var o=h._wrapperState.wasMultiple;h._wrapperState.wasMultiple=!!$.multiple;var d=$.value;d!=null?fb(h,!!$.multiple,d,!1):o!==!!$.multiple&&($.defaultValue!=null?fb(h,!!$.multiple,$.defaultValue,!0):fb(h,!!$.multiple,$.multiple?[]:"",!1))}h[Pf]=$}catch(rt){W(i,i.return,rt)}}break;case 6:if(ck(e,i),ek(i),c&4){if(i.stateNode===null)throw Error(p(162));h=i.stateNode,$=i.memoizedProps;try{h.nodeValue=$}catch(rt){W(i,i.return,rt)}}break;case 3:if(ck(e,i),ek(i),c&4&&s!==null&&s.memoizedState.isDehydrated)try{bd(e.containerInfo)}catch(rt){W(i,i.return,rt)}break;case 4:ck(e,i),ek(i);break;case 13:ck(e,i),ek(i),h=i.child,h.flags&8192&&($=h.memoizedState!==null,h.stateNode.isHidden=$,!$||h.alternate!==null&&h.alternate.memoizedState!==null||(fk=B())),c&4&&ak(i);break;case 22:if(b=s!==null&&s.memoizedState!==null,i.mode&1?(U=(et=U)||b,ck(e,i),U=et):ck(e,i),ek(i),c&8192){if(et=i.memoizedState!==null,(i.stateNode.isHidden=et)&&!b&&i.mode&1)for(V=i,b=i.child;b!==null;){for(a=V=b;V!==null;){switch(o=V,d=o.child,o.tag){case 0:case 11:case 14:case 15:Pj(4,o,o.return);break;case 1:Lj(o,o.return);var g=o.stateNode;if(typeof g.componentWillUnmount=="function"){c=o,s=o.return;try{e=c,g.props=e.memoizedProps,g.state=e.memoizedState,g.componentWillUnmount()}catch(rt){W(c,s,rt)}}break;case 5:Lj(o,o.return);break;case 22:if(o.memoizedState!==null){gk(a);continue}}d!==null?(d.return=o,V=d):gk(a)}b=b.sibling}e:for(b=null,a=i;;){if(a.tag===5){if(b===null){b=a;try{h=a.stateNode,et?($=h.style,typeof $.setProperty=="function"?$.setProperty("display","none","important"):$.display="none"):(j=a.stateNode,nt=a.memoizedProps.style,_=nt!=null&&nt.hasOwnProperty("display")?nt.display:null,j.style.display=rb("display",_))}catch(rt){W(i,i.return,rt)}}}else if(a.tag===6){if(b===null)try{a.stateNode.nodeValue=et?"":a.memoizedProps}catch(rt){W(i,i.return,rt)}}else if((a.tag!==22&&a.tag!==23||a.memoizedState===null||a===i)&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===i)break e;for(;a.sibling===null;){if(a.return===null||a.return===i)break e;b===a&&(b=null),a=a.return}b===a&&(b=null),a.sibling.return=a.return,a=a.sibling}}break;case 19:ck(e,i),ek(i),c&4&&ak(i);break;case 21:break;default:ck(e,i),ek(i)}}function ek(i){var e=i.flags;if(e&2){try{e:{for(var s=i.return;s!==null;){if(Tj(s)){var c=s;break e}s=s.return}throw Error(p(160))}switch(c.tag){case 5:var h=c.stateNode;c.flags&32&&(ob(h,""),c.flags&=-33);var $=Uj(i);Wj(i,$,h);break;case 3:case 4:var _=c.stateNode.containerInfo,j=Uj(i);Vj(i,j,_);break;default:throw Error(p(161))}}catch(nt){W(i,i.return,nt)}i.flags&=-3}e&4096&&(i.flags&=-4097)}function hk(i,e,s){V=i,ik(i)}function ik(i,e,s){for(var c=(i.mode&1)!==0;V!==null;){var h=V,$=h.child;if(h.tag===22&&c){var _=h.memoizedState!==null||Jj;if(!_){var j=h.alternate,nt=j!==null&&j.memoizedState!==null||U;j=Jj;var et=U;if(Jj=_,(U=nt)&&!et)for(V=h;V!==null;)_=V,nt=_.child,_.tag===22&&_.memoizedState!==null?jk(h):nt!==null?(nt.return=_,V=nt):jk(h);for(;$!==null;)V=$,ik($),$=$.sibling;V=h,Jj=j,U=et}kk(i)}else h.subtreeFlags&8772&&$!==null?($.return=h,V=$):kk(i)}}function kk(i){for(;V!==null;){var e=V;if(e.flags&8772){var s=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:U||Qj(5,e);break;case 1:var c=e.stateNode;if(e.flags&4&&!U)if(s===null)c.componentDidMount();else{var h=e.elementType===e.type?s.memoizedProps:Ci(e.type,s.memoizedProps);c.componentDidUpdate(h,s.memoizedState,c.__reactInternalSnapshotBeforeUpdate)}var $=e.updateQueue;$!==null&&sh(e,$,c);break;case 3:var _=e.updateQueue;if(_!==null){if(s=null,e.child!==null)switch(e.child.tag){case 5:s=e.child.stateNode;break;case 1:s=e.child.stateNode}sh(e,_,s)}break;case 5:var j=e.stateNode;if(s===null&&e.flags&4){s=j;var nt=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":nt.autoFocus&&s.focus();break;case"img":nt.src&&(s.src=nt.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var et=e.alternate;if(et!==null){var b=et.memoizedState;if(b!==null){var a=b.dehydrated;a!==null&&bd(a)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(p(163))}U||e.flags&512&&Rj(e)}catch(o){W(e,e.return,o)}}if(e===i){V=null;break}if(s=e.sibling,s!==null){s.return=e.return,V=s;break}V=e.return}}function gk(i){for(;V!==null;){var e=V;if(e===i){V=null;break}var s=e.sibling;if(s!==null){s.return=e.return,V=s;break}V=e.return}}function jk(i){for(;V!==null;){var e=V;try{switch(e.tag){case 0:case 11:case 15:var s=e.return;try{Qj(4,e)}catch(nt){W(e,s,nt)}break;case 1:var c=e.stateNode;if(typeof c.componentDidMount=="function"){var h=e.return;try{c.componentDidMount()}catch(nt){W(e,h,nt)}}var $=e.return;try{Rj(e)}catch(nt){W(e,$,nt)}break;case 5:var _=e.return;try{Rj(e)}catch(nt){W(e,_,nt)}}}catch(nt){W(e,e.return,nt)}if(e===i){V=null;break}var j=e.sibling;if(j!==null){j.return=e.return,V=j;break}V=e.return}}var lk=Math.ceil,mk=ua$1.ReactCurrentDispatcher,nk=ua$1.ReactCurrentOwner,ok=ua$1.ReactCurrentBatchConfig,K=0,Q=null,Y=null,Z=0,fj=0,ej=Uf(0),T=0,pk=null,rh=0,qk=0,rk=0,sk=null,tk=null,fk=0,Gj=1/0,uk=null,Oi=!1,Pi=null,Ri=null,vk=!1,wk=null,xk=0,yk=0,zk=null,Ak=-1,Bk=0;function R(){return K&6?B():Ak!==-1?Ak:Ak=B()}function yi(i){return i.mode&1?K&2&&Z!==0?Z&-Z:Kg.transition!==null?(Bk===0&&(Bk=yc()),Bk):(i=C,i!==0||(i=window.event,i=i===void 0?16:jd(i.type)),i):1}function gi(i,e,s,c){if(50<yk)throw yk=0,zk=null,Error(p(185));Ac(i,s,c),(!(K&2)||i!==Q)&&(i===Q&&(!(K&2)&&(qk|=s),T===4&&Ck(i,Z)),Dk(i,c),s===1&&K===0&&!(e.mode&1)&&(Gj=B()+500,fg&&jg()))}function Dk(i,e){var s=i.callbackNode;wc(i,e);var c=uc(i,i===Q?Z:0);if(c===0)s!==null&&bc(s),i.callbackNode=null,i.callbackPriority=0;else if(e=c&-c,i.callbackPriority!==e){if(s!=null&&bc(s),e===1)i.tag===0?ig(Ek.bind(null,i)):hg(Ek.bind(null,i)),Jf(function(){!(K&6)&&jg()}),s=null;else{switch(Dc(c)){case 1:s=fc;break;case 4:s=gc;break;case 16:s=hc;break;case 536870912:s=jc;break;default:s=hc}s=Fk(s,Gk.bind(null,i))}i.callbackPriority=e,i.callbackNode=s}}function Gk(i,e){if(Ak=-1,Bk=0,K&6)throw Error(p(327));var s=i.callbackNode;if(Hk()&&i.callbackNode!==s)return null;var c=uc(i,i===Q?Z:0);if(c===0)return null;if(c&30||c&i.expiredLanes||e)e=Ik(i,c);else{e=c;var h=K;K|=2;var $=Jk();(Q!==i||Z!==e)&&(uk=null,Gj=B()+500,Kk(i,e));do try{Lk();break}catch(j){Mk(i,j)}while(!0);$g(),mk.current=$,K=h,Y!==null?e=0:(Q=null,Z=0,e=T)}if(e!==0){if(e===2&&(h=xc(i),h!==0&&(c=h,e=Nk(i,h))),e===1)throw s=pk,Kk(i,0),Ck(i,c),Dk(i,B()),s;if(e===6)Ck(i,c);else{if(h=i.current.alternate,!(c&30)&&!Ok(h)&&(e=Ik(i,c),e===2&&($=xc(i),$!==0&&(c=$,e=Nk(i,$))),e===1))throw s=pk,Kk(i,0),Ck(i,c),Dk(i,B()),s;switch(i.finishedWork=h,i.finishedLanes=c,e){case 0:case 1:throw Error(p(345));case 2:Pk(i,tk,uk);break;case 3:if(Ck(i,c),(c&130023424)===c&&(e=fk+500-B(),10<e)){if(uc(i,0)!==0)break;if(h=i.suspendedLanes,(h&c)!==c){R(),i.pingedLanes|=i.suspendedLanes&h;break}i.timeoutHandle=Ff(Pk.bind(null,i,tk,uk),e);break}Pk(i,tk,uk);break;case 4:if(Ck(i,c),(c&4194240)===c)break;for(e=i.eventTimes,h=-1;0<c;){var _=31-oc(c);$=1<<_,_=e[_],_>h&&(h=_),c&=~$}if(c=h,c=B()-c,c=(120>c?120:480>c?480:1080>c?1080:1920>c?1920:3e3>c?3e3:4320>c?4320:1960*lk(c/1960))-c,10<c){i.timeoutHandle=Ff(Pk.bind(null,i,tk,uk),c);break}Pk(i,tk,uk);break;case 5:Pk(i,tk,uk);break;default:throw Error(p(329))}}}return Dk(i,B()),i.callbackNode===s?Gk.bind(null,i):null}function Nk(i,e){var s=sk;return i.current.memoizedState.isDehydrated&&(Kk(i,e).flags|=256),i=Ik(i,e),i!==2&&(e=tk,tk=s,e!==null&&Fj(e)),i}function Fj(i){tk===null?tk=i:tk.push.apply(tk,i)}function Ok(i){for(var e=i;;){if(e.flags&16384){var s=e.updateQueue;if(s!==null&&(s=s.stores,s!==null))for(var c=0;c<s.length;c++){var h=s[c],$=h.getSnapshot;h=h.value;try{if(!He$1($(),h))return!1}catch{return!1}}}if(s=e.child,e.subtreeFlags&16384&&s!==null)s.return=e,e=s;else{if(e===i)break;for(;e.sibling===null;){if(e.return===null||e.return===i)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function Ck(i,e){for(e&=~rk,e&=~qk,i.suspendedLanes|=e,i.pingedLanes&=~e,i=i.expirationTimes;0<e;){var s=31-oc(e),c=1<<s;i[s]=-1,e&=~c}}function Ek(i){if(K&6)throw Error(p(327));Hk();var e=uc(i,0);if(!(e&1))return Dk(i,B()),null;var s=Ik(i,e);if(i.tag!==0&&s===2){var c=xc(i);c!==0&&(e=c,s=Nk(i,c))}if(s===1)throw s=pk,Kk(i,0),Ck(i,e),Dk(i,B()),s;if(s===6)throw Error(p(345));return i.finishedWork=i.current.alternate,i.finishedLanes=e,Pk(i,tk,uk),Dk(i,B()),null}function Qk(i,e){var s=K;K|=1;try{return i(e)}finally{K=s,K===0&&(Gj=B()+500,fg&&jg())}}function Rk(i){wk!==null&&wk.tag===0&&!(K&6)&&Hk();var e=K;K|=1;var s=ok.transition,c=C;try{if(ok.transition=null,C=1,i)return i()}finally{C=c,ok.transition=s,K=e,!(K&6)&&jg()}}function Hj(){fj=ej.current,E(ej)}function Kk(i,e){i.finishedWork=null,i.finishedLanes=0;var s=i.timeoutHandle;if(s!==-1&&(i.timeoutHandle=-1,Gf(s)),Y!==null)for(s=Y.return;s!==null;){var c=s;switch(wg(c),c.tag){case 1:c=c.type.childContextTypes,c!=null&&$f();break;case 3:zh(),E(Wf),E(H),Eh();break;case 5:Bh(c);break;case 4:zh();break;case 13:E(L);break;case 19:E(L);break;case 10:ah(c.type._context);break;case 22:case 23:Hj()}s=s.return}if(Q=i,Y=i=Pg(i.current,null),Z=fj=e,T=0,pk=null,rk=qk=rh=0,tk=sk=null,fh!==null){for(e=0;e<fh.length;e++)if(s=fh[e],c=s.interleaved,c!==null){s.interleaved=null;var h=c.next,$=s.pending;if($!==null){var _=$.next;$.next=h,c.next=_}s.pending=c}fh=null}return i}function Mk(i,e){do{var s=Y;try{if($g(),Fh.current=Rh,Ih){for(var c=M.memoizedState;c!==null;){var h=c.queue;h!==null&&(h.pending=null),c=c.next}Ih=!1}if(Hh=0,O=N=M=null,Jh=!1,Kh=0,nk.current=null,s===null||s.return===null){T=1,pk=e,Y=null;break}e:{var $=i,_=s.return,j=s,nt=e;if(e=Z,j.flags|=32768,nt!==null&&typeof nt=="object"&&typeof nt.then=="function"){var et=nt,b=j,a=b.tag;if(!(b.mode&1)&&(a===0||a===11||a===15)){var o=b.alternate;o?(b.updateQueue=o.updateQueue,b.memoizedState=o.memoizedState,b.lanes=o.lanes):(b.updateQueue=null,b.memoizedState=null)}var d=Ui(_);if(d!==null){d.flags&=-257,Vi(d,_,j,$,e),d.mode&1&&Si($,et,e),e=d,nt=et;var g=e.updateQueue;if(g===null){var rt=new Set;rt.add(nt),e.updateQueue=rt}else g.add(nt);break e}else{if(!(e&1)){Si($,et,e),tj();break e}nt=Error(p(426))}}else if(I&&j.mode&1){var st=Ui(_);if(st!==null){!(st.flags&65536)&&(st.flags|=256),Vi(st,_,j,$,e),Jg(Ji(nt,j));break e}}$=nt=Ji(nt,j),T!==4&&(T=2),sk===null?sk=[$]:sk.push($),$=_;do{switch($.tag){case 3:$.flags|=65536,e&=-e,$.lanes|=e;var tt=Ni($,nt,e);ph($,tt);break e;case 1:j=nt;var ot=$.type,it=$.stateNode;if(!($.flags&128)&&(typeof ot.getDerivedStateFromError=="function"||it!==null&&typeof it.componentDidCatch=="function"&&(Ri===null||!Ri.has(it)))){$.flags|=65536,e&=-e,$.lanes|=e;var at=Qi($,j,e);ph($,at);break e}}$=$.return}while($!==null)}Sk(s)}catch(ut){e=ut,Y===s&&s!==null&&(Y=s=s.return);continue}break}while(!0)}function Jk(){var i=mk.current;return mk.current=Rh,i===null?Rh:i}function tj(){(T===0||T===3||T===2)&&(T=4),Q===null||!(rh&268435455)&&!(qk&268435455)||Ck(Q,Z)}function Ik(i,e){var s=K;K|=2;var c=Jk();(Q!==i||Z!==e)&&(uk=null,Kk(i,e));do try{Tk();break}catch(h){Mk(i,h)}while(!0);if($g(),K=s,mk.current=c,Y!==null)throw Error(p(261));return Q=null,Z=0,T}function Tk(){for(;Y!==null;)Uk(Y)}function Lk(){for(;Y!==null&&!cc();)Uk(Y)}function Uk(i){var e=Vk(i.alternate,i,fj);i.memoizedProps=i.pendingProps,e===null?Sk(i):Y=e,nk.current=null}function Sk(i){var e=i;do{var s=e.alternate;if(i=e.return,e.flags&32768){if(s=Ij(s,e),s!==null){s.flags&=32767,Y=s;return}if(i!==null)i.flags|=32768,i.subtreeFlags=0,i.deletions=null;else{T=6,Y=null;return}}else if(s=Ej(s,e,fj),s!==null){Y=s;return}if(e=e.sibling,e!==null){Y=e;return}Y=e=i}while(e!==null);T===0&&(T=5)}function Pk(i,e,s){var c=C,h=ok.transition;try{ok.transition=null,C=1,Wk(i,e,s,c)}finally{ok.transition=h,C=c}return null}function Wk(i,e,s,c){do Hk();while(wk!==null);if(K&6)throw Error(p(327));s=i.finishedWork;var h=i.finishedLanes;if(s===null)return null;if(i.finishedWork=null,i.finishedLanes=0,s===i.current)throw Error(p(177));i.callbackNode=null,i.callbackPriority=0;var $=s.lanes|s.childLanes;if(Bc(i,$),i===Q&&(Y=Q=null,Z=0),!(s.subtreeFlags&2064)&&!(s.flags&2064)||vk||(vk=!0,Fk(hc,function(){return Hk(),null})),$=(s.flags&15990)!==0,s.subtreeFlags&15990||$){$=ok.transition,ok.transition=null;var _=C;C=1;var j=K;K|=4,nk.current=null,Oj(i,s),dk(s,i),Oe$1(Df),dd=!!Cf,Df=Cf=null,i.current=s,hk(s),dc(),K=j,C=_,ok.transition=$}else i.current=s;if(vk&&(vk=!1,wk=i,xk=h),$=i.pendingLanes,$===0&&(Ri=null),mc(s.stateNode),Dk(i,B()),e!==null)for(c=i.onRecoverableError,s=0;s<e.length;s++)h=e[s],c(h.value,{componentStack:h.stack,digest:h.digest});if(Oi)throw Oi=!1,i=Pi,Pi=null,i;return xk&1&&i.tag!==0&&Hk(),$=i.pendingLanes,$&1?i===zk?yk++:(yk=0,zk=i):yk=0,jg(),null}function Hk(){if(wk!==null){var i=Dc(xk),e=ok.transition,s=C;try{if(ok.transition=null,C=16>i?16:i,wk===null)var c=!1;else{if(i=wk,wk=null,xk=0,K&6)throw Error(p(331));var h=K;for(K|=4,V=i.current;V!==null;){var $=V,_=$.child;if(V.flags&16){var j=$.deletions;if(j!==null){for(var nt=0;nt<j.length;nt++){var et=j[nt];for(V=et;V!==null;){var b=V;switch(b.tag){case 0:case 11:case 15:Pj(8,b,$)}var a=b.child;if(a!==null)a.return=b,V=a;else for(;V!==null;){b=V;var o=b.sibling,d=b.return;if(Sj(b),b===et){V=null;break}if(o!==null){o.return=d,V=o;break}V=d}}}var g=$.alternate;if(g!==null){var rt=g.child;if(rt!==null){g.child=null;do{var st=rt.sibling;rt.sibling=null,rt=st}while(rt!==null)}}V=$}}if($.subtreeFlags&2064&&_!==null)_.return=$,V=_;else e:for(;V!==null;){if($=V,$.flags&2048)switch($.tag){case 0:case 11:case 15:Pj(9,$,$.return)}var tt=$.sibling;if(tt!==null){tt.return=$.return,V=tt;break e}V=$.return}}var ot=i.current;for(V=ot;V!==null;){_=V;var it=_.child;if(_.subtreeFlags&2064&&it!==null)it.return=_,V=it;else e:for(_=ot;V!==null;){if(j=V,j.flags&2048)try{switch(j.tag){case 0:case 11:case 15:Qj(9,j)}}catch(ut){W(j,j.return,ut)}if(j===_){V=null;break e}var at=j.sibling;if(at!==null){at.return=j.return,V=at;break e}V=j.return}}if(K=h,jg(),lc&&typeof lc.onPostCommitFiberRoot=="function")try{lc.onPostCommitFiberRoot(kc,i)}catch{}c=!0}return c}finally{C=s,ok.transition=e}}return!1}function Xk(i,e,s){e=Ji(s,e),e=Ni(i,e,1),i=nh(i,e,1),e=R(),i!==null&&(Ac(i,1,e),Dk(i,e))}function W(i,e,s){if(i.tag===3)Xk(i,i,s);else for(;e!==null;){if(e.tag===3){Xk(e,i,s);break}else if(e.tag===1){var c=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(Ri===null||!Ri.has(c))){i=Ji(s,i),i=Qi(e,i,1),e=nh(e,i,1),i=R(),e!==null&&(Ac(e,1,i),Dk(e,i));break}}e=e.return}}function Ti(i,e,s){var c=i.pingCache;c!==null&&c.delete(e),e=R(),i.pingedLanes|=i.suspendedLanes&s,Q===i&&(Z&s)===s&&(T===4||T===3&&(Z&130023424)===Z&&500>B()-fk?Kk(i,0):rk|=s),Dk(i,e)}function Yk(i,e){e===0&&(i.mode&1?(e=sc,sc<<=1,!(sc&130023424)&&(sc=4194304)):e=1);var s=R();i=ih(i,e),i!==null&&(Ac(i,e,s),Dk(i,s))}function uj(i){var e=i.memoizedState,s=0;e!==null&&(s=e.retryLane),Yk(i,s)}function bk(i,e){var s=0;switch(i.tag){case 13:var c=i.stateNode,h=i.memoizedState;h!==null&&(s=h.retryLane);break;case 19:c=i.stateNode;break;default:throw Error(p(314))}c!==null&&c.delete(e),Yk(i,s)}var Vk;Vk=function(i,e,s){if(i!==null)if(i.memoizedProps!==e.pendingProps||Wf.current)dh=!0;else{if(!(i.lanes&s)&&!(e.flags&128))return dh=!1,yj(i,e,s);dh=!!(i.flags&131072)}else dh=!1,I&&e.flags&1048576&&ug(e,ng,e.index);switch(e.lanes=0,e.tag){case 2:var c=e.type;ij(i,e),i=e.pendingProps;var h=Yf(e,H.current);ch(e,s),h=Nh(null,e,c,i,h,s);var $=Sh();return e.flags|=1,typeof h=="object"&&h!==null&&typeof h.render=="function"&&h.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Zf(c)?($=!0,cg(e)):$=!1,e.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,kh(e),h.updater=Ei,e.stateNode=h,h._reactInternals=e,Ii(e,c,i,s),e=jj(null,e,c,!0,$,s)):(e.tag=0,I&&$&&vg(e),Xi(null,e,h,s),e=e.child),e;case 16:c=e.elementType;e:{switch(ij(i,e),i=e.pendingProps,h=c._init,c=h(c._payload),e.type=c,h=e.tag=Zk(c),i=Ci(c,i),h){case 0:e=cj(null,e,c,i,s);break e;case 1:e=hj(null,e,c,i,s);break e;case 11:e=Yi(null,e,c,i,s);break e;case 14:e=$i(null,e,c,Ci(c.type,i),s);break e}throw Error(p(306,c,""))}return e;case 0:return c=e.type,h=e.pendingProps,h=e.elementType===c?h:Ci(c,h),cj(i,e,c,h,s);case 1:return c=e.type,h=e.pendingProps,h=e.elementType===c?h:Ci(c,h),hj(i,e,c,h,s);case 3:e:{if(kj(e),i===null)throw Error(p(387));c=e.pendingProps,$=e.memoizedState,h=$.element,lh(i,e),qh(e,c,null,s);var _=e.memoizedState;if(c=_.element,$.isDehydrated)if($={element:c,isDehydrated:!1,cache:_.cache,pendingSuspenseBoundaries:_.pendingSuspenseBoundaries,transitions:_.transitions},e.updateQueue.baseState=$,e.memoizedState=$,e.flags&256){h=Ji(Error(p(423)),e),e=lj(i,e,c,s,h);break e}else if(c!==h){h=Ji(Error(p(424)),e),e=lj(i,e,c,s,h);break e}else for(yg=Lf(e.stateNode.containerInfo.firstChild),xg=e,I=!0,zg=null,s=Vg(e,null,c,s),e.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(Ig(),c===h){e=Zi(i,e,s);break e}Xi(i,e,c,s)}e=e.child}return e;case 5:return Ah(e),i===null&&Eg(e),c=e.type,h=e.pendingProps,$=i!==null?i.memoizedProps:null,_=h.children,Ef(c,h)?_=null:$!==null&&Ef(c,$)&&(e.flags|=32),gj(i,e),Xi(i,e,_,s),e.child;case 6:return i===null&&Eg(e),null;case 13:return oj(i,e,s);case 4:return yh(e,e.stateNode.containerInfo),c=e.pendingProps,i===null?e.child=Ug(e,null,c,s):Xi(i,e,c,s),e.child;case 11:return c=e.type,h=e.pendingProps,h=e.elementType===c?h:Ci(c,h),Yi(i,e,c,h,s);case 7:return Xi(i,e,e.pendingProps,s),e.child;case 8:return Xi(i,e,e.pendingProps.children,s),e.child;case 12:return Xi(i,e,e.pendingProps.children,s),e.child;case 10:e:{if(c=e.type._context,h=e.pendingProps,$=e.memoizedProps,_=h.value,G(Wg,c._currentValue),c._currentValue=_,$!==null)if(He$1($.value,_)){if($.children===h.children&&!Wf.current){e=Zi(i,e,s);break e}}else for($=e.child,$!==null&&($.return=e);$!==null;){var j=$.dependencies;if(j!==null){_=$.child;for(var nt=j.firstContext;nt!==null;){if(nt.context===c){if($.tag===1){nt=mh(-1,s&-s),nt.tag=2;var et=$.updateQueue;if(et!==null){et=et.shared;var b=et.pending;b===null?nt.next=nt:(nt.next=b.next,b.next=nt),et.pending=nt}}$.lanes|=s,nt=$.alternate,nt!==null&&(nt.lanes|=s),bh($.return,s,e),j.lanes|=s;break}nt=nt.next}}else if($.tag===10)_=$.type===e.type?null:$.child;else if($.tag===18){if(_=$.return,_===null)throw Error(p(341));_.lanes|=s,j=_.alternate,j!==null&&(j.lanes|=s),bh(_,s,e),_=$.sibling}else _=$.child;if(_!==null)_.return=$;else for(_=$;_!==null;){if(_===e){_=null;break}if($=_.sibling,$!==null){$.return=_.return,_=$;break}_=_.return}$=_}Xi(i,e,h.children,s),e=e.child}return e;case 9:return h=e.type,c=e.pendingProps.children,ch(e,s),h=eh(h),c=c(h),e.flags|=1,Xi(i,e,c,s),e.child;case 14:return c=e.type,h=Ci(c,e.pendingProps),h=Ci(c.type,h),$i(i,e,c,h,s);case 15:return bj(i,e,e.type,e.pendingProps,s);case 17:return c=e.type,h=e.pendingProps,h=e.elementType===c?h:Ci(c,h),ij(i,e),e.tag=1,Zf(c)?(i=!0,cg(e)):i=!1,ch(e,s),Gi(e,c,h),Ii(e,c,h,s),jj(null,e,c,!0,i,s);case 19:return xj(i,e,s);case 22:return dj(i,e,s)}throw Error(p(156,e.tag))};function Fk(i,e){return ac(i,e)}function $k(i,e,s,c){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=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Bg(i,e,s,c){return new $k(i,e,s,c)}function aj(i){return i=i.prototype,!(!i||!i.isReactComponent)}function Zk(i){if(typeof i=="function")return aj(i)?1:0;if(i!=null){if(i=i.$$typeof,i===Da$1)return 11;if(i===Ga$1)return 14}return 2}function Pg(i,e){var s=i.alternate;return s===null?(s=Bg(i.tag,e,i.key,i.mode),s.elementType=i.elementType,s.type=i.type,s.stateNode=i.stateNode,s.alternate=i,i.alternate=s):(s.pendingProps=e,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,e=i.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},s.sibling=i.sibling,s.index=i.index,s.ref=i.ref,s}function Rg(i,e,s,c,h,$){var _=2;if(c=i,typeof i=="function")aj(i)&&(_=1);else if(typeof i=="string")_=5;else e:switch(i){case ya$1:return Tg(s.children,h,$,e);case za$1:_=8,h|=8;break;case Aa$1:return i=Bg(12,s,e,h|2),i.elementType=Aa$1,i.lanes=$,i;case Ea$1:return i=Bg(13,s,e,h),i.elementType=Ea$1,i.lanes=$,i;case Fa$1:return i=Bg(19,s,e,h),i.elementType=Fa$1,i.lanes=$,i;case Ia$1:return pj(s,h,$,e);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case Ba$1:_=10;break e;case Ca$1:_=9;break e;case Da$1:_=11;break e;case Ga$1:_=14;break e;case Ha$1:_=16,c=null;break e}throw Error(p(130,i==null?i:typeof i,""))}return e=Bg(_,s,e,h),e.elementType=i,e.type=c,e.lanes=$,e}function Tg(i,e,s,c){return i=Bg(7,i,c,e),i.lanes=s,i}function pj(i,e,s,c){return i=Bg(22,i,c,e),i.elementType=Ia$1,i.lanes=s,i.stateNode={isHidden:!1},i}function Qg(i,e,s){return i=Bg(6,i,null,e),i.lanes=s,i}function Sg(i,e,s){return e=Bg(4,i.children!==null?i.children:[],i.key,e),e.lanes=s,e.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},e}function al(i,e,s,c,h){this.tag=e,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=c,this.onRecoverableError=h,this.mutableSourceEagerHydrationData=null}function bl(i,e,s,c,h,$,_,j,nt){return i=new al(i,e,s,j,nt),e===1?(e=1,$===!0&&(e|=8)):e=0,$=Bg(3,null,null,e),i.current=$,$.stateNode=i,$.memoizedState={element:c,isDehydrated:s,cache:null,transitions:null,pendingSuspenseBoundaries:null},kh($),i}function cl(i,e,s){var c=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:wa$1,key:c==null?null:""+c,children:i,containerInfo:e,implementation:s}}function dl(i){if(!i)return Vf;i=i._reactInternals;e:{if(Vb(i)!==i||i.tag!==1)throw Error(p(170));var e=i;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(Zf(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(p(171))}if(i.tag===1){var s=i.type;if(Zf(s))return bg(i,s,e)}return e}function el(i,e,s,c,h,$,_,j,nt){return i=bl(s,c,!0,i,h,$,_,j,nt),i.context=dl(null),s=i.current,c=R(),h=yi(s),$=mh(c,h),$.callback=e??null,nh(s,$,h),i.current.lanes=h,Ac(i,h,c),Dk(i,c),i}function fl(i,e,s,c){var h=e.current,$=R(),_=yi(h);return s=dl(s),e.context===null?e.context=s:e.pendingContext=s,e=mh($,_),e.payload={element:i},c=c===void 0?null:c,c!==null&&(e.callback=c),i=nh(h,e,_),i!==null&&(gi(i,h,_,$),oh(i,h,_)),_}function gl(i){if(i=i.current,!i.child)return null;switch(i.child.tag){case 5:return i.child.stateNode;default:return i.child.stateNode}}function hl(i,e){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var s=i.retryLane;i.retryLane=s!==0&&s<e?s:e}}function il(i,e){hl(i,e),(i=i.alternate)&&hl(i,e)}function jl(){return null}var kl=typeof reportError=="function"?reportError:function(i){console.error(i)};function ll(i){this._internalRoot=i}ml.prototype.render=ll.prototype.render=function(i){var e=this._internalRoot;if(e===null)throw Error(p(409));fl(i,e,null,null)},ml.prototype.unmount=ll.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var e=i.containerInfo;Rk(function(){fl(null,i,null,null)}),e[uf]=null}};function ml(i){this._internalRoot=i}ml.prototype.unstable_scheduleHydration=function(i){if(i){var e=Hc();i={blockedOn:null,target:i,priority:e};for(var s=0;s<Qc.length&&e!==0&&e<Qc[s].priority;s++);Qc.splice(s,0,i),s===0&&Vc(i)}};function nl(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function ol(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11&&(i.nodeType!==8||i.nodeValue!==" react-mount-point-unstable "))}function pl(){}function ql(i,e,s,c,h){if(h){if(typeof c=="function"){var $=c;c=function(){var et=gl(_);$.call(et)}}var _=el(e,c,i,0,null,!1,!1,"",pl);return i._reactRootContainer=_,i[uf]=_.current,sf(i.nodeType===8?i.parentNode:i),Rk(),_}for(;h=i.lastChild;)i.removeChild(h);if(typeof c=="function"){var j=c;c=function(){var et=gl(nt);j.call(et)}}var nt=bl(i,0,!1,null,null,!1,!1,"",pl);return i._reactRootContainer=nt,i[uf]=nt.current,sf(i.nodeType===8?i.parentNode:i),Rk(function(){fl(e,nt,s,c)}),nt}function rl(i,e,s,c,h){var $=s._reactRootContainer;if($){var _=$;if(typeof h=="function"){var j=h;h=function(){var nt=gl(_);j.call(nt)}}fl(e,_,i,h)}else _=ql(s,e,i,h,c);return gl(_)}Ec=function(i){switch(i.tag){case 3:var e=i.stateNode;if(e.current.memoizedState.isDehydrated){var s=tc(e.pendingLanes);s!==0&&(Cc(e,s|1),Dk(e,B()),!(K&6)&&(Gj=B()+500,jg()))}break;case 13:Rk(function(){var c=ih(i,1);if(c!==null){var h=R();gi(c,i,1,h)}}),il(i,1)}},Fc=function(i){if(i.tag===13){var e=ih(i,134217728);if(e!==null){var s=R();gi(e,i,134217728,s)}il(i,134217728)}},Gc=function(i){if(i.tag===13){var e=yi(i),s=ih(i,e);if(s!==null){var c=R();gi(s,i,e,c)}il(i,e)}},Hc=function(){return C},Ic=function(i,e){var s=C;try{return C=i,e()}finally{C=s}},yb=function(i,e,s){switch(e){case"input":if(bb(i,s),e=s.name,s.type==="radio"&&e!=null){for(s=i;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<s.length;e++){var c=s[e];if(c!==i&&c.form===i.form){var h=Db(c);if(!h)throw Error(p(90));Wa$1(c),bb(c,h)}}}break;case"textarea":ib(i,s);break;case"select":e=s.value,e!=null&&fb(i,!!s.multiple,e,!1)}},Gb=Qk,Hb=Rk;var sl={usingClientEntryPoint:!1,Events:[Cb,ue,Db,Eb,Fb,Qk]},tl={findFiberByHostInstance:Wc,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},ul={bundleType:tl.bundleType,version:tl.version,rendererPackageName:tl.rendererPackageName,rendererConfig:tl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ua$1.ReactCurrentDispatcher,findHostInstanceByFiber:function(i){return i=Zb(i),i===null?null:i.stateNode},findFiberByHostInstance:tl.findFiberByHostInstance||jl,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var vl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!vl.isDisabled&&vl.supportsFiber)try{kc=vl.inject(ul),lc=vl}catch{}}reactDom_production_min.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=sl,reactDom_production_min.createPortal=function(i,e){var s=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!nl(e))throw Error(p(200));return cl(i,e,null,s)},reactDom_production_min.createRoot=function(i,e){if(!nl(i))throw Error(p(299));var s=!1,c="",h=kl;return e!=null&&(e.unstable_strictMode===!0&&(s=!0),e.identifierPrefix!==void 0&&(c=e.identifierPrefix),e.onRecoverableError!==void 0&&(h=e.onRecoverableError)),e=bl(i,1,!1,null,null,s,!1,c,h),i[uf]=e.current,sf(i.nodeType===8?i.parentNode:i),new ll(e)},reactDom_production_min.findDOMNode=function(i){if(i==null)return null;if(i.nodeType===1)return i;var e=i._reactInternals;if(e===void 0)throw typeof i.render=="function"?Error(p(188)):(i=Object.keys(i).join(","),Error(p(268,i)));return i=Zb(e),i=i===null?null:i.stateNode,i},reactDom_production_min.flushSync=function(i){return Rk(i)},reactDom_production_min.hydrate=function(i,e,s){if(!ol(e))throw Error(p(200));return rl(null,i,e,!0,s)},reactDom_production_min.hydrateRoot=function(i,e,s){if(!nl(i))throw Error(p(405));var c=s!=null&&s.hydratedSources||null,h=!1,$="",_=kl;if(s!=null&&(s.unstable_strictMode===!0&&(h=!0),s.identifierPrefix!==void 0&&($=s.identifierPrefix),s.onRecoverableError!==void 0&&(_=s.onRecoverableError)),e=el(e,null,i,1,s??null,h,!1,$,_),i[uf]=e.current,sf(i),c)for(i=0;i<c.length;i++)s=c[i],h=s._getVersion,h=h(s._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[s,h]:e.mutableSourceEagerHydrationData.push(s,h);return new ml(e)},reactDom_production_min.render=function(i,e,s){if(!ol(e))throw Error(p(200));return rl(null,i,e,!1,s)},reactDom_production_min.unmountComponentAtNode=function(i){if(!ol(i))throw Error(p(40));return i._reactRootContainer?(Rk(function(){rl(null,null,i,!1,function(){i._reactRootContainer=null,i[uf]=null})}),!0):!1},reactDom_production_min.unstable_batchedUpdates=Qk,reactDom_production_min.unstable_renderSubtreeIntoContainer=function(i,e,s,c){if(!ol(s))throw Error(p(200));if(i==null||i._reactInternals===void 0)throw Error(p(38));return rl(i,e,s,!1,c)},reactDom_production_min.version="18.3.1-next-f1338f8080-20240426";function checkDCE(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"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,createRoot,m=reactDomExports;createRoot=m.createRoot,m.hydrateRoot;const LogoIcon=()=>jsxRuntimeExports.jsxs("svg",{viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("path",{d:"M16 4C9.37 4 4 9.37 4 16s5.37 12 12 12 12-5.37 12-12S22.63 4 16 4z",fill:"#2563eb"}),jsxRuntimeExports.jsx("path",{d:"M16 8c-2.2 0-4 1.8-4 4v4c0 2.2 1.8 4 4 4s4-1.8 4-4v-4c0-2.2-1.8-4-4-4z",fill:"white"}),jsxRuntimeExports.jsx("path",{d:"M22 16c0 3.3-2.7 6-6 6s-6-2.7-6-6H8c0 4.1 3.1 7.5 7 7.9V26h2v-2.1c3.9-.4 7-3.8 7-7.9h-2z",fill:"white"})]}),MicIcon=()=>jsxRuntimeExports.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z"}),jsxRuntimeExports.jsx("path",{d:"M19 10v2a7 7 0 0 1-14 0v-2"}),jsxRuntimeExports.jsx("line",{x1:"12",x2:"12",y1:"19",y2:"22"})]}),CloseIcon=()=>jsxRuntimeExports.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),jsxRuntimeExports.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),MinimizeIcon=()=>jsxRuntimeExports.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),jsxRuntimeExports.jsx("path",{d:"M9 3v18"})]}),ErrorIcon=()=>jsxRuntimeExports.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("circle",{cx:"12",cy:"12",r:"10"}),jsxRuntimeExports.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),jsxRuntimeExports.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}),ChatIcon=()=>jsxRuntimeExports.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntimeExports.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})});function FloatingPanel({children:i,position:e,onClose:s,onMinimize:c}){const h=reactExports.useRef(null),$=reactExports.useRef(!1),_=reactExports.useRef({x:0,y:0,right:20,bottom:20}),j=reactExports.useCallback(et=>{if(et.target.closest("button"))return;$.current=!0;const b=h.current;b&&(_.current={x:et.clientX,y:et.clientY,right:parseInt(b.style.right||"20"),bottom:parseInt(b.style.bottom||"20")})},[]);reactExports.useEffect(()=>{const et=a=>{if(!$.current||!h.current)return;const o=_.current.x-a.clientX,d=_.current.y-a.clientY;h.current.style.right=`${_.current.right+o}px`,h.current.style.bottom=`${_.current.bottom+d}px`},b=()=>{$.current=!1};return document.addEventListener("mousemove",et),document.addEventListener("mouseup",b),()=>{document.removeEventListener("mousemove",et),document.removeEventListener("mouseup",b)}},[]);const nt={bottom:(e==null?void 0:e.bottom)??20,right:(e==null?void 0:e.right)??20,...(e==null?void 0:e.top)!==void 0&&{top:e.top,bottom:"auto"},...(e==null?void 0:e.left)!==void 0&&{left:e.left,right:"auto"}};return jsxRuntimeExports.jsxs("div",{ref:h,className:"scribe-panel",style:nt,children:[jsxRuntimeExports.jsxs("div",{className:"panel-header",onMouseDown:j,children:[jsxRuntimeExports.jsxs("div",{className:"drag-handle",children:[jsxRuntimeExports.jsx("span",{}),jsxRuntimeExports.jsx("span",{}),jsxRuntimeExports.jsx("span",{}),jsxRuntimeExports.jsx("span",{}),jsxRuntimeExports.jsx("span",{}),jsxRuntimeExports.jsx("span",{})]}),jsxRuntimeExports.jsxs("div",{className:"header-actions",children:[jsxRuntimeExports.jsx("button",{className:"header-btn",onClick:c,title:"Minimize",children:jsxRuntimeExports.jsx(MinimizeIcon,{})}),jsxRuntimeExports.jsx("button",{className:"header-btn",onClick:s,title:"Close",children:jsxRuntimeExports.jsx(CloseIcon,{})})]})]}),jsxRuntimeExports.jsx("div",{className:"panel-content",children:i})]})}function ConfigState({onSubmit:i,initialAccessToken:e="",initialBaseUrl:s=""}){const[c,h]=reactExports.useState(e),[$,_]=reactExports.useState(s),[j,nt]=reactExports.useState(""),et=b=>{if(b.preventDefault(),!$.trim()){nt("Base URL is required");return}nt(""),i(c.trim(),$.trim())};return jsxRuntimeExports.jsxs("div",{className:"config-state",style:{zIndex:9999},children:[jsxRuntimeExports.jsxs("div",{className:"logo",children:[jsxRuntimeExports.jsx("div",{className:"logo-icon",children:jsxRuntimeExports.jsx(LogoIcon,{})}),jsxRuntimeExports.jsx("span",{className:"logo-text",children:"eka.scribe"})]}),jsxRuntimeExports.jsxs("form",{className:"config-form",onSubmit:et,children:[jsxRuntimeExports.jsxs("div",{className:"form-group",children:[jsxRuntimeExports.jsx("label",{htmlFor:"eka-access-token",children:"Access Token"}),jsxRuntimeExports.jsx("input",{id:"eka-access-token",type:"text",value:c,onChange:b=>h(b.target.value),placeholder:"Enter your access token (optional)"})]}),jsxRuntimeExports.jsxs("div",{className:"form-group",children:[jsxRuntimeExports.jsx("label",{htmlFor:"eka-base-url",children:"Base URL"}),jsxRuntimeExports.jsx("input",{id:"eka-base-url",type:"text",value:$,onChange:b=>_(b.target.value),placeholder:"https://api.eka.care",required:!0})]}),j&&jsxRuntimeExports.jsx("p",{className:"config-error",children:j}),jsxRuntimeExports.jsx("button",{type:"submit",className:"config-submit-btn",children:"Continue"})]})]})}function IdleState({onStartRecording:i}){return jsxRuntimeExports.jsxs("div",{className:"idle-state",children:[jsxRuntimeExports.jsxs("div",{className:"logo",children:[jsxRuntimeExports.jsx("div",{className:"logo-icon",children:jsxRuntimeExports.jsx(LogoIcon,{})}),jsxRuntimeExports.jsx("span",{className:"logo-text",children:"eka.scribe"})]}),jsxRuntimeExports.jsxs("button",{className:"start-btn",onClick:i,children:["Start Recording",jsxRuntimeExports.jsx("span",{className:"mic-icon",children:jsxRuntimeExports.jsx(MicIcon,{})})]})]})}function PermissionState({onRequestPermission:i}){return jsxRuntimeExports.jsxs("div",{className:"permission-state",children:[jsxRuntimeExports.jsx("div",{className:"permission-icon",children:jsxRuntimeExports.jsx(MicIcon,{})}),jsxRuntimeExports.jsxs("p",{className:"permission-text",children:["Microphone access is required to record audio.",jsxRuntimeExports.jsx("br",{}),"Please allow access when prompted."]}),jsxRuntimeExports.jsx("button",{className:"permission-btn",onClick:i,children:"Allow Microphone"})]})}function formatTime(i){const e=Math.floor(i/60),s=i%60;return`${e.toString().padStart(2,"0")}:${s.toString().padStart(2,"0")}`}function RecordingState({elapsedTime:i,isPaused:e,onPause:s,onResume:c,onStop:h}){return jsxRuntimeExports.jsxs("div",{className:"recording-state",children:[jsxRuntimeExports.jsxs("div",{className:"recording-indicator",children:[jsxRuntimeExports.jsx("div",{className:`recording-icon ${e?"":"active"}`,children:jsxRuntimeExports.jsx(ChatIcon,{})}),jsxRuntimeExports.jsx("span",{className:"timer",children:formatTime(i)})]}),jsxRuntimeExports.jsxs("div",{className:"recording-actions",children:[e?jsxRuntimeExports.jsx("button",{className:"resume-btn",onClick:c,children:"Resume"}):jsxRuntimeExports.jsx("button",{className:"pause-btn",onClick:s,children:"Pause"}),jsxRuntimeExports.jsx("button",{className:"stop-btn",onClick:h,title:"Stop recording",children:jsxRuntimeExports.jsx("div",{className:"stop-icon"})})]})]})}function ProcessingState(){return jsxRuntimeExports.jsxs("div",{className:"processing-state",children:[jsxRuntimeExports.jsx("div",{className:"spinner"}),jsxRuntimeExports.jsx("p",{className:"processing-text",children:"Processing your recording..."})]})}function ResultsState({result:i,onNewRecording:e}){return jsxRuntimeExports.jsxs("div",{className:"results-state",children:[jsxRuntimeExports.jsxs("div",{className:"results-header",children:[jsxRuntimeExports.jsx("span",{className:"results-title",children:"Recording Complete"}),jsxRuntimeExports.jsx("button",{className:"new-recording-btn",onClick:e,children:"New Recording"})]}),jsxRuntimeExports.jsx("div",{className:"results-content",children:jsxRuntimeExports.jsxs("div",{className:"transcript-section",children:[jsxRuntimeExports.jsx("div",{className:"section-title",children:"Transcript"}),jsxRuntimeExports.jsx("div",{className:"transcript-text",children:i.transcript||"No transcript available."})]})})]})}function ErrorState({message:i,onRetry:e}){return jsxRuntimeExports.jsxs("div",{className:"error-state",children:[jsxRuntimeExports.jsx("div",{className:"error-icon",children:jsxRuntimeExports.jsx(ErrorIcon,{})}),jsxRuntimeExports.jsx("p",{className:"error-message",children:i}),jsxRuntimeExports.jsx("button",{className:"retry-btn",onClick:e,children:"Try Again"})]})}const WELL_KNOWN_PATH="/.well-known/medscribealliance";var SessionStatus;(function(i){i.CREATED="created",i.PROCESSING="processing",i.COMPLETED="completed",i.PARTIAL="partial",i.FAILED="failed"})(SessionStatus||(SessionStatus={}));var TemplateStatus;(function(i){i.SUCCESS="success",i.FAILED="failed"})(TemplateStatus||(TemplateStatus={}));var UploadType;(function(i){i.CHUNKED="chunked",i.SINGLE="single"})(UploadType||(UploadType={}));var ErrorCode;(function(i){i.AUTHENTICATION_FAILED="authentication_failed",i.TOKEN_EXPIRED="token_expired",i.INVALID_API_KEY="invalid_api_key",i.FORBIDDEN="forbidden",i.RATE_LIMIT_EXCEEDED="rate_limit_exceeded",i.SESSION_NOT_FOUND="session_not_found",i.TEMPLATE_NOT_FOUND="template_not_found",i.WEBHOOK_NOT_FOUND="webhook_not_found",i.SESSION_EXPIRED="session_expired",i.INVALID_REQUEST="invalid_request",i.INVALID_AUDIO_FORMAT="invalid_audio_format",i.CHUNK_TOO_LARGE="chunk_too_large",i.INVALID_TEMPLATE="invalid_template",i.MISSING_REQUIRED_FIELD="missing_required_field",i.PROCESSING_FAILED="processing_failed",i.AUDIO_QUALITY_POOR="audio_quality_poor",i.AUDIO_TOO_SHORT="audio_too_short",i.LANGUAGE_UNSUPPORTED="language_unsupported",i.INTERNAL_ERROR="internal_error",i.SERVICE_UNAVAILABLE="service_unavailable"})(ErrorCode||(ErrorCode={}));var HttpStatus;(function(i){i[i.OK=200]="OK",i[i.CREATED=201]="CREATED",i[i.ACCEPTED=202]="ACCEPTED",i[i.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",i[i.BAD_REQUEST=400]="BAD_REQUEST",i[i.UNAUTHORIZED=401]="UNAUTHORIZED",i[i.FORBIDDEN=403]="FORBIDDEN",i[i.NOT_FOUND=404]="NOT_FOUND",i[i.GONE=410]="GONE",i[i.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",i[i.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",i[i.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",i[i.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE"})(HttpStatus||(HttpStatus={}));class DiscoveryAPI{constructor(e){this.cachedDiscovery=null,this.cacheTimestamp=0,this.cacheDuration=3600*1e3,this.httpClient=e}async getDiscovery(e,s=!1){const c=Date.now();if(!s&&this.cachedDiscovery&&c-this.cacheTimestamp<this.cacheDuration)return this.cachedDiscovery;const h=e+WELL_KNOWN_PATH,$=await this.httpClient.get(h);return this.cachedDiscovery=$,this.cacheTimestamp=c,$}clearCache(){this.cachedDiscovery=null,this.cacheTimestamp=0}getCachedDiscovery(){const e=Date.now();return this.cachedDiscovery&&e-this.cacheTimestamp<this.cacheDuration?this.cachedDiscovery:null}}var ajv={exports:{}},core$2={},validate={},boolSchema={},errors={},codegen={},code$1={};(function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.regexpCode=i.getEsmExportName=i.getProperty=i.safeStringify=i.stringify=i.strConcat=i.addCodeArg=i.str=i._=i.nil=i._Code=i.Name=i.IDENTIFIER=i._CodeOrName=void 0;class e{}i._CodeOrName=e,i.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class s extends e{constructor(ot){if(super(),!i.IDENTIFIER.test(ot))throw new Error("CodeGen: name must be a valid identifier");this.str=ot}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}i.Name=s;class c extends e{constructor(ot){super(),this._items=typeof ot=="string"?[ot]:ot}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const ot=this._items[0];return ot===""||ot==='""'}get str(){var ot;return(ot=this._str)!==null&&ot!==void 0?ot:this._str=this._items.reduce((it,at)=>`${it}${at}`,"")}get names(){var ot;return(ot=this._names)!==null&&ot!==void 0?ot:this._names=this._items.reduce((it,at)=>(at instanceof s&&(it[at.str]=(it[at.str]||0)+1),it),{})}}i._Code=c,i.nil=new c("");function h(tt,...ot){const it=[tt[0]];let at=0;for(;at<ot.length;)j(it,ot[at]),it.push(tt[++at]);return new c(it)}i._=h;const $=new c("+");function _(tt,...ot){const it=[d(tt[0])];let at=0;for(;at<ot.length;)it.push($),j(it,ot[at]),it.push($,d(tt[++at]));return nt(it),new c(it)}i.str=_;function j(tt,ot){ot instanceof c?tt.push(...ot._items):ot instanceof s?tt.push(ot):tt.push(a(ot))}i.addCodeArg=j;function nt(tt){let ot=1;for(;ot<tt.length-1;){if(tt[ot]===$){const it=et(tt[ot-1],tt[ot+1]);if(it!==void 0){tt.splice(ot-1,3,it);continue}tt[ot++]="+"}ot++}}function et(tt,ot){if(ot==='""')return tt;if(tt==='""')return ot;if(typeof tt=="string")return ot instanceof s||tt[tt.length-1]!=='"'?void 0:typeof ot!="string"?`${tt.slice(0,-1)}${ot}"`:ot[0]==='"'?tt.slice(0,-1)+ot.slice(1):void 0;if(typeof ot=="string"&&ot[0]==='"'&&!(tt instanceof s))return`"${tt}${ot.slice(1)}`}function b(tt,ot){return ot.emptyStr()?tt:tt.emptyStr()?ot:_`${tt}${ot}`}i.strConcat=b;function a(tt){return typeof tt=="number"||typeof tt=="boolean"||tt===null?tt:d(Array.isArray(tt)?tt.join(","):tt)}function o(tt){return new c(d(tt))}i.stringify=o;function d(tt){return JSON.stringify(tt).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}i.safeStringify=d;function g(tt){return typeof tt=="string"&&i.IDENTIFIER.test(tt)?new c(`.${tt}`):h`[${tt}]`}i.getProperty=g;function rt(tt){if(typeof tt=="string"&&i.IDENTIFIER.test(tt))return new c(`${tt}`);throw new Error(`CodeGen: invalid export name: ${tt}, use explicit $id name mapping`)}i.getEsmExportName=rt;function st(tt){return new c(tt.toString())}i.regexpCode=st})(code$1);var scope={};(function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.ValueScope=i.ValueScopeName=i.Scope=i.varKinds=i.UsedValueState=void 0;const e=code$1;class s extends Error{constructor(et){super(`CodeGen: "code" for ${et} not defined`),this.value=et.value}}var c;(function(nt){nt[nt.Started=0]="Started",nt[nt.Completed=1]="Completed"})(c||(i.UsedValueState=c={})),i.varKinds={const:new e.Name("const"),let:new e.Name("let"),var:new e.Name("var")};class h{constructor({prefixes:et,parent:b}={}){this._names={},this._prefixes=et,this._parent=b}toName(et){return et instanceof e.Name?et:this.name(et)}name(et){return new e.Name(this._newName(et))}_newName(et){const b=this._names[et]||this._nameGroup(et);return`${et}${b.index++}`}_nameGroup(et){var b,a;if(!((a=(b=this._parent)===null||b===void 0?void 0:b._prefixes)===null||a===void 0)&&a.has(et)||this._prefixes&&!this._prefixes.has(et))throw new Error(`CodeGen: prefix "${et}" is not allowed in this scope`);return this._names[et]={prefix:et,index:0}}}i.Scope=h;class $ extends e.Name{constructor(et,b){super(b),this.prefix=et}setValue(et,{property:b,itemIndex:a}){this.value=et,this.scopePath=(0,e._)`.${new e.Name(b)}[${a}]`}}i.ValueScopeName=$;const _=(0,e._)`\n`;class j extends h{constructor(et){super(et),this._values={},this._scope=et.scope,this.opts={...et,_n:et.lines?_:e.nil}}get(){return this._scope}name(et){return new $(et,this._newName(et))}value(et,b){var a;if(b.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const o=this.toName(et),{prefix:d}=o,g=(a=b.key)!==null&&a!==void 0?a:b.ref;let rt=this._values[d];if(rt){const ot=rt.get(g);if(ot)return ot}else rt=this._values[d]=new Map;rt.set(g,o);const st=this._scope[d]||(this._scope[d]=[]),tt=st.length;return st[tt]=b.ref,o.setValue(b,{property:d,itemIndex:tt}),o}getValue(et,b){const a=this._values[et];if(a)return a.get(b)}scopeRefs(et,b=this._values){return this._reduceValues(b,a=>{if(a.scopePath===void 0)throw new Error(`CodeGen: name "${a}" has no value`);return(0,e._)`${et}${a.scopePath}`})}scopeCode(et=this._values,b,a){return this._reduceValues(et,o=>{if(o.value===void 0)throw new Error(`CodeGen: name "${o}" has no value`);return o.value.code},b,a)}_reduceValues(et,b,a={},o){let d=e.nil;for(const g in et){const rt=et[g];if(!rt)continue;const st=a[g]=a[g]||new Map;rt.forEach(tt=>{if(st.has(tt))return;st.set(tt,c.Started);let ot=b(tt);if(ot){const it=this.opts.es5?i.varKinds.var:i.varKinds.const;d=(0,e._)`${d}${it} ${tt} = ${ot};${this.opts._n}`}else if(ot=o==null?void 0:o(tt))d=(0,e._)`${d}${ot}${this.opts._n}`;else throw new s(tt);st.set(tt,c.Completed)})}return d}}i.ValueScope=j})(scope),function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.or=i.and=i.not=i.CodeGen=i.operators=i.varKinds=i.ValueScopeName=i.ValueScope=i.Scope=i.Name=i.regexpCode=i.stringify=i.getProperty=i.nil=i.strConcat=i.str=i._=void 0;const e=code$1,s=scope;var c=code$1;Object.defineProperty(i,"_",{enumerable:!0,get:function(){return c._}}),Object.defineProperty(i,"str",{enumerable:!0,get:function(){return c.str}}),Object.defineProperty(i,"strConcat",{enumerable:!0,get:function(){return c.strConcat}}),Object.defineProperty(i,"nil",{enumerable:!0,get:function(){return c.nil}}),Object.defineProperty(i,"getProperty",{enumerable:!0,get:function(){return c.getProperty}}),Object.defineProperty(i,"stringify",{enumerable:!0,get:function(){return c.stringify}}),Object.defineProperty(i,"regexpCode",{enumerable:!0,get:function(){return c.regexpCode}}),Object.defineProperty(i,"Name",{enumerable:!0,get:function(){return c.Name}});var h=scope;Object.defineProperty(i,"Scope",{enumerable:!0,get:function(){return h.Scope}}),Object.defineProperty(i,"ValueScope",{enumerable:!0,get:function(){return h.ValueScope}}),Object.defineProperty(i,"ValueScopeName",{enumerable:!0,get:function(){return h.ValueScopeName}}),Object.defineProperty(i,"varKinds",{enumerable:!0,get:function(){return h.varKinds}}),i.operators={GT:new e._Code(">"),GTE:new e._Code(">="),LT:new e._Code("<"),LTE:new e._Code("<="),EQ:new e._Code("==="),NEQ:new e._Code("!=="),NOT:new e._Code("!"),OR:new e._Code("||"),AND:new e._Code("&&"),ADD:new e._Code("+")};class ${optimizeNodes(){return this}optimizeNames(pt,_t){return this}}class _ extends ${constructor(pt,_t,Ct){super(),this.varKind=pt,this.name=_t,this.rhs=Ct}render({es5:pt,_n:_t}){const Ct=pt?s.varKinds.var:this.varKind,zt=this.rhs===void 0?"":` = ${this.rhs}`;return`${Ct} ${this.name}${zt};`+_t}optimizeNames(pt,_t){if(pt[this.name.str])return this.rhs&&(this.rhs=vt(this.rhs,pt,_t)),this}get names(){return this.rhs instanceof e._CodeOrName?this.rhs.names:{}}}class j extends ${constructor(pt,_t,Ct){super(),this.lhs=pt,this.rhs=_t,this.sideEffects=Ct}render({_n:pt}){return`${this.lhs} = ${this.rhs};`+pt}optimizeNames(pt,_t){if(!(this.lhs instanceof e.Name&&!pt[this.lhs.str]&&!this.sideEffects))return this.rhs=vt(this.rhs,pt,_t),this}get names(){const pt=this.lhs instanceof e.Name?{}:{...this.lhs.names};return Tt(pt,this.rhs)}}class nt extends j{constructor(pt,_t,Ct,zt){super(pt,Ct,zt),this.op=_t}render({_n:pt}){return`${this.lhs} ${this.op}= ${this.rhs};`+pt}}class et extends ${constructor(pt){super(),this.label=pt,this.names={}}render({_n:pt}){return`${this.label}:`+pt}}class b extends ${constructor(pt){super(),this.label=pt,this.names={}}render({_n:pt}){return`break${this.label?` ${this.label}`:""};`+pt}}class a extends ${constructor(pt){super(),this.error=pt}render({_n:pt}){return`throw ${this.error};`+pt}get names(){return this.error.names}}class o extends ${constructor(pt){super(),this.code=pt}render({_n:pt}){return`${this.code};`+pt}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(pt,_t){return this.code=vt(this.code,pt,_t),this}get names(){return this.code instanceof e._CodeOrName?this.code.names:{}}}class d extends ${constructor(pt=[]){super(),this.nodes=pt}render(pt){return this.nodes.reduce((_t,Ct)=>_t+Ct.render(pt),"")}optimizeNodes(){const{nodes:pt}=this;let _t=pt.length;for(;_t--;){const Ct=pt[_t].optimizeNodes();Array.isArray(Ct)?pt.splice(_t,1,...Ct):Ct?pt[_t]=Ct:pt.splice(_t,1)}return pt.length>0?this:void 0}optimizeNames(pt,_t){const{nodes:Ct}=this;let zt=Ct.length;for(;zt--;){const Nt=Ct[zt];Nt.optimizeNames(pt,_t)||($t(pt,Nt.names),Ct.splice(zt,1))}return Ct.length>0?this:void 0}get names(){return this.nodes.reduce((pt,_t)=>bt(pt,_t.names),{})}}class g extends d{render(pt){return"{"+pt._n+super.render(pt)+"}"+pt._n}}class rt extends d{}class st extends g{}st.kind="else";class tt extends g{constructor(pt,_t){super(_t),this.condition=pt}render(pt){let _t=`if(${this.condition})`+super.render(pt);return this.else&&(_t+="else "+this.else.render(pt)),_t}optimizeNodes(){super.optimizeNodes();const pt=this.condition;if(pt===!0)return this.nodes;let _t=this.else;if(_t){const Ct=_t.optimizeNodes();_t=this.else=Array.isArray(Ct)?new st(Ct):Ct}if(_t)return pt===!1?_t instanceof tt?_t:_t.nodes:this.nodes.length?this:new tt(At(pt),_t instanceof tt?[_t]:_t.nodes);if(!(pt===!1||!this.nodes.length))return this}optimizeNames(pt,_t){var Ct;if(this.else=(Ct=this.else)===null||Ct===void 0?void 0:Ct.optimizeNames(pt,_t),!!(super.optimizeNames(pt,_t)||this.else))return this.condition=vt(this.condition,pt,_t),this}get names(){const pt=super.names;return Tt(pt,this.condition),this.else&&bt(pt,this.else.names),pt}}tt.kind="if";class ot extends g{}ot.kind="for";class it extends ot{constructor(pt){super(),this.iteration=pt}render(pt){return`for(${this.iteration})`+super.render(pt)}optimizeNames(pt,_t){if(super.optimizeNames(pt,_t))return this.iteration=vt(this.iteration,pt,_t),this}get names(){return bt(super.names,this.iteration.names)}}class at extends ot{constructor(pt,_t,Ct,zt){super(),this.varKind=pt,this.name=_t,this.from=Ct,this.to=zt}render(pt){const _t=pt.es5?s.varKinds.var:this.varKind,{name:Ct,from:zt,to:Nt}=this;return`for(${_t} ${Ct}=${zt}; ${Ct}<${Nt}; ${Ct}++)`+super.render(pt)}get names(){const pt=Tt(super.names,this.from);return Tt(pt,this.to)}}class ut extends ot{constructor(pt,_t,Ct,zt){super(),this.loop=pt,this.varKind=_t,this.name=Ct,this.iterable=zt}render(pt){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(pt)}optimizeNames(pt,_t){if(super.optimizeNames(pt,_t))return this.iterable=vt(this.iterable,pt,_t),this}get names(){return bt(super.names,this.iterable.names)}}class lt extends g{constructor(pt,_t,Ct){super(),this.name=pt,this.args=_t,this.async=Ct}render(pt){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(pt)}}lt.kind="func";class ct extends d{render(pt){return"return "+super.render(pt)}}ct.kind="return";class ft extends g{render(pt){let _t="try"+super.render(pt);return this.catch&&(_t+=this.catch.render(pt)),this.finally&&(_t+=this.finally.render(pt)),_t}optimizeNodes(){var pt,_t;return super.optimizeNodes(),(pt=this.catch)===null||pt===void 0||pt.optimizeNodes(),(_t=this.finally)===null||_t===void 0||_t.optimizeNodes(),this}optimizeNames(pt,_t){var Ct,zt;return super.optimizeNames(pt,_t),(Ct=this.catch)===null||Ct===void 0||Ct.optimizeNames(pt,_t),(zt=this.finally)===null||zt===void 0||zt.optimizeNames(pt,_t),this}get names(){const pt=super.names;return this.catch&&bt(pt,this.catch.names),this.finally&&bt(pt,this.finally.names),pt}}class dt extends g{constructor(pt){super(),this.error=pt}render(pt){return`catch(${this.error})`+super.render(pt)}}dt.kind="catch";class yt extends g{render(pt){return"finally"+super.render(pt)}}yt.kind="finally";class St{constructor(pt,_t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={..._t,_n:_t.lines?`
|
|
41
41
|
`:""},this._extScope=pt,this._scope=new s.Scope({parent:pt}),this._nodes=[new rt]}toString(){return this._root.render(this.opts)}name(pt){return this._scope.name(pt)}scopeName(pt){return this._extScope.name(pt)}scopeValue(pt,_t){const Ct=this._extScope.value(pt,_t);return(this._values[Ct.prefix]||(this._values[Ct.prefix]=new Set)).add(Ct),Ct}getScopeValue(pt,_t){return this._extScope.getValue(pt,_t)}scopeRefs(pt){return this._extScope.scopeRefs(pt,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(pt,_t,Ct,zt){const Nt=this._scope.toName(_t);return Ct!==void 0&&zt&&(this._constants[Nt.str]=Ct),this._leafNode(new _(pt,Nt,Ct)),Nt}const(pt,_t,Ct){return this._def(s.varKinds.const,pt,_t,Ct)}let(pt,_t,Ct){return this._def(s.varKinds.let,pt,_t,Ct)}var(pt,_t,Ct){return this._def(s.varKinds.var,pt,_t,Ct)}assign(pt,_t,Ct){return this._leafNode(new j(pt,_t,Ct))}add(pt,_t){return this._leafNode(new nt(pt,i.operators.ADD,_t))}code(pt){return typeof pt=="function"?pt():pt!==e.nil&&this._leafNode(new o(pt)),this}object(...pt){const _t=["{"];for(const[Ct,zt]of pt)_t.length>1&&_t.push(","),_t.push(Ct),(Ct!==zt||this.opts.es5)&&(_t.push(":"),(0,e.addCodeArg)(_t,zt));return _t.push("}"),new e._Code(_t)}if(pt,_t,Ct){if(this._blockNode(new tt(pt)),_t&&Ct)this.code(_t).else().code(Ct).endIf();else if(_t)this.code(_t).endIf();else if(Ct)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(pt){return this._elseNode(new tt(pt))}else(){return this._elseNode(new st)}endIf(){return this._endBlockNode(tt,st)}_for(pt,_t){return this._blockNode(pt),_t&&this.code(_t).endFor(),this}for(pt,_t){return this._for(new it(pt),_t)}forRange(pt,_t,Ct,zt,Nt=this.opts.es5?s.varKinds.var:s.varKinds.let){const Ht=this._scope.toName(pt);return this._for(new at(Nt,Ht,_t,Ct),()=>zt(Ht))}forOf(pt,_t,Ct,zt=s.varKinds.const){const Nt=this._scope.toName(pt);if(this.opts.es5){const Ht=_t instanceof e.Name?_t:this.var("_arr",_t);return this.forRange("_i",0,(0,e._)`${Ht}.length`,Jt=>{this.var(Nt,(0,e._)`${Ht}[${Jt}]`),Ct(Nt)})}return this._for(new ut("of",zt,Nt,_t),()=>Ct(Nt))}forIn(pt,_t,Ct,zt=this.opts.es5?s.varKinds.var:s.varKinds.const){if(this.opts.ownProperties)return this.forOf(pt,(0,e._)`Object.keys(${_t})`,Ct);const Nt=this._scope.toName(pt);return this._for(new ut("in",zt,Nt,_t),()=>Ct(Nt))}endFor(){return this._endBlockNode(ot)}label(pt){return this._leafNode(new et(pt))}break(pt){return this._leafNode(new b(pt))}return(pt){const _t=new ct;if(this._blockNode(_t),this.code(pt),_t.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(ct)}try(pt,_t,Ct){if(!_t&&!Ct)throw new Error('CodeGen: "try" without "catch" and "finally"');const zt=new ft;if(this._blockNode(zt),this.code(pt),_t){const Nt=this.name("e");this._currNode=zt.catch=new dt(Nt),_t(Nt)}return Ct&&(this._currNode=zt.finally=new yt,this.code(Ct)),this._endBlockNode(dt,yt)}throw(pt){return this._leafNode(new a(pt))}block(pt,_t){return this._blockStarts.push(this._nodes.length),pt&&this.code(pt).endBlock(_t),this}endBlock(pt){const _t=this._blockStarts.pop();if(_t===void 0)throw new Error("CodeGen: not in self-balancing block");const Ct=this._nodes.length-_t;if(Ct<0||pt!==void 0&&Ct!==pt)throw new Error(`CodeGen: wrong number of nodes: ${Ct} vs ${pt} expected`);return this._nodes.length=_t,this}func(pt,_t=e.nil,Ct,zt){return this._blockNode(new lt(pt,_t,Ct)),zt&&this.code(zt).endFunc(),this}endFunc(){return this._endBlockNode(lt)}optimize(pt=1){for(;pt-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(pt){return this._currNode.nodes.push(pt),this}_blockNode(pt){this._currNode.nodes.push(pt),this._nodes.push(pt)}_endBlockNode(pt,_t){const Ct=this._currNode;if(Ct instanceof pt||_t&&Ct instanceof _t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${_t?`${pt.kind}/${_t.kind}`:pt.kind}"`)}_elseNode(pt){const _t=this._currNode;if(!(_t instanceof tt))throw new Error('CodeGen: "else" without "if"');return this._currNode=_t.else=pt,this}get _root(){return this._nodes[0]}get _currNode(){const pt=this._nodes;return pt[pt.length-1]}set _currNode(pt){const _t=this._nodes;_t[_t.length-1]=pt}}i.CodeGen=St;function bt(ht,pt){for(const _t in pt)ht[_t]=(ht[_t]||0)+(pt[_t]||0);return ht}function Tt(ht,pt){return pt instanceof e._CodeOrName?bt(ht,pt.names):ht}function vt(ht,pt,_t){if(ht instanceof e.Name)return Ct(ht);if(!zt(ht))return ht;return new e._Code(ht._items.reduce((Nt,Ht)=>(Ht instanceof e.Name&&(Ht=Ct(Ht)),Ht instanceof e._Code?Nt.push(...Ht._items):Nt.push(Ht),Nt),[]));function Ct(Nt){const Ht=_t[Nt.str];return Ht===void 0||pt[Nt.str]!==1?Nt:(delete pt[Nt.str],Ht)}function zt(Nt){return Nt instanceof e._Code&&Nt._items.some(Ht=>Ht instanceof e.Name&&pt[Ht.str]===1&&_t[Ht.str]!==void 0)}}function $t(ht,pt){for(const _t in pt)ht[_t]=(ht[_t]||0)-(pt[_t]||0)}function At(ht){return typeof ht=="boolean"||typeof ht=="number"||ht===null?!ht:(0,e._)`!${gt(ht)}`}i.not=At;const Ot=mt(i.operators.AND);function It(...ht){return ht.reduce(Ot)}i.and=It;const jt=mt(i.operators.OR);function Et(...ht){return ht.reduce(jt)}i.or=Et;function mt(ht){return(pt,_t)=>pt===e.nil?_t:_t===e.nil?pt:(0,e._)`${gt(pt)} ${ht} ${gt(_t)}`}function gt(ht){return ht instanceof e.Name?ht:(0,e._)`(${ht})`}}(codegen);var util={};Object.defineProperty(util,"__esModule",{value:!0}),util.checkStrictMode=util.getErrorPath=util.Type=util.useFunc=util.setEvaluated=util.evaluatedPropsToName=util.mergeEvaluated=util.eachItem=util.unescapeJsonPointer=util.escapeJsonPointer=util.escapeFragment=util.unescapeFragment=util.schemaRefOrVal=util.schemaHasRulesButRef=util.schemaHasRules=util.checkUnknownRules=util.alwaysValidSchema=util.toHash=void 0;const codegen_1$v=codegen,code_1$a=code$1;function toHash(i){const e={};for(const s of i)e[s]=!0;return e}util.toHash=toHash;function alwaysValidSchema(i,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(checkUnknownRules(i,e),!schemaHasRules(e,i.self.RULES.all))}util.alwaysValidSchema=alwaysValidSchema;function checkUnknownRules(i,e=i.schema){const{opts:s,self:c}=i;if(!s.strictSchema||typeof e=="boolean")return;const h=c.RULES.keywords;for(const $ in e)h[$]||checkStrictMode(i,`unknown keyword: "${$}"`)}util.checkUnknownRules=checkUnknownRules;function schemaHasRules(i,e){if(typeof i=="boolean")return!i;for(const s in i)if(e[s])return!0;return!1}util.schemaHasRules=schemaHasRules;function schemaHasRulesButRef(i,e){if(typeof i=="boolean")return!i;for(const s in i)if(s!=="$ref"&&e.all[s])return!0;return!1}util.schemaHasRulesButRef=schemaHasRulesButRef;function schemaRefOrVal({topSchemaRef:i,schemaPath:e},s,c,h){if(!h){if(typeof s=="number"||typeof s=="boolean")return s;if(typeof s=="string")return(0,codegen_1$v._)`${s}`}return(0,codegen_1$v._)`${i}${e}${(0,codegen_1$v.getProperty)(c)}`}util.schemaRefOrVal=schemaRefOrVal;function unescapeFragment(i){return unescapeJsonPointer(decodeURIComponent(i))}util.unescapeFragment=unescapeFragment;function escapeFragment(i){return encodeURIComponent(escapeJsonPointer(i))}util.escapeFragment=escapeFragment;function escapeJsonPointer(i){return typeof i=="number"?`${i}`:i.replace(/~/g,"~0").replace(/\//g,"~1")}util.escapeJsonPointer=escapeJsonPointer;function unescapeJsonPointer(i){return i.replace(/~1/g,"/").replace(/~0/g,"~")}util.unescapeJsonPointer=unescapeJsonPointer;function eachItem(i,e){if(Array.isArray(i))for(const s of i)e(s);else e(i)}util.eachItem=eachItem;function makeMergeEvaluated({mergeNames:i,mergeToName:e,mergeValues:s,resultToName:c}){return(h,$,_,j)=>{const nt=_===void 0?$:_ instanceof codegen_1$v.Name?($ instanceof codegen_1$v.Name?i(h,$,_):e(h,$,_),_):$ instanceof codegen_1$v.Name?(e(h,_,$),$):s($,_);return j===codegen_1$v.Name&&!(nt instanceof codegen_1$v.Name)?c(h,nt):nt}}util.mergeEvaluated={props:makeMergeEvaluated({mergeNames:(i,e,s)=>i.if((0,codegen_1$v._)`${s} !== true && ${e} !== undefined`,()=>{i.if((0,codegen_1$v._)`${e} === true`,()=>i.assign(s,!0),()=>i.assign(s,(0,codegen_1$v._)`${s} || {}`).code((0,codegen_1$v._)`Object.assign(${s}, ${e})`))}),mergeToName:(i,e,s)=>i.if((0,codegen_1$v._)`${s} !== true`,()=>{e===!0?i.assign(s,!0):(i.assign(s,(0,codegen_1$v._)`${s} || {}`),setEvaluated(i,s,e))}),mergeValues:(i,e)=>i===!0?!0:{...i,...e},resultToName:evaluatedPropsToName}),items:makeMergeEvaluated({mergeNames:(i,e,s)=>i.if((0,codegen_1$v._)`${s} !== true && ${e} !== undefined`,()=>i.assign(s,(0,codegen_1$v._)`${e} === true ? true : ${s} > ${e} ? ${s} : ${e}`)),mergeToName:(i,e,s)=>i.if((0,codegen_1$v._)`${s} !== true`,()=>i.assign(s,e===!0?!0:(0,codegen_1$v._)`${s} > ${e} ? ${s} : ${e}`)),mergeValues:(i,e)=>i===!0?!0:Math.max(i,e),resultToName:(i,e)=>i.var("items",e)})};function evaluatedPropsToName(i,e){if(e===!0)return i.var("props",!0);const s=i.var("props",(0,codegen_1$v._)`{}`);return e!==void 0&&setEvaluated(i,s,e),s}util.evaluatedPropsToName=evaluatedPropsToName;function setEvaluated(i,e,s){Object.keys(s).forEach(c=>i.assign((0,codegen_1$v._)`${e}${(0,codegen_1$v.getProperty)(c)}`,!0))}util.setEvaluated=setEvaluated;const snippets={};function useFunc(i,e){return i.scopeValue("func",{ref:e,code:snippets[e.code]||(snippets[e.code]=new code_1$a._Code(e.code))})}util.useFunc=useFunc;var Type;(function(i){i[i.Num=0]="Num",i[i.Str=1]="Str"})(Type||(util.Type=Type={}));function getErrorPath(i,e,s){if(i instanceof codegen_1$v.Name){const c=e===Type.Num;return s?c?(0,codegen_1$v._)`"[" + ${i} + "]"`:(0,codegen_1$v._)`"['" + ${i} + "']"`:c?(0,codegen_1$v._)`"/" + ${i}`:(0,codegen_1$v._)`"/" + ${i}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return s?(0,codegen_1$v.getProperty)(i).toString():"/"+escapeJsonPointer(i)}util.getErrorPath=getErrorPath;function checkStrictMode(i,e,s=i.opts.strictSchema){if(s){if(e=`strict mode: ${e}`,s===!0)throw new Error(e);i.self.logger.warn(e)}}util.checkStrictMode=checkStrictMode;var names$1={};Object.defineProperty(names$1,"__esModule",{value:!0});const codegen_1$u=codegen,names={data:new codegen_1$u.Name("data"),valCxt:new codegen_1$u.Name("valCxt"),instancePath:new codegen_1$u.Name("instancePath"),parentData:new codegen_1$u.Name("parentData"),parentDataProperty:new codegen_1$u.Name("parentDataProperty"),rootData:new codegen_1$u.Name("rootData"),dynamicAnchors:new codegen_1$u.Name("dynamicAnchors"),vErrors:new codegen_1$u.Name("vErrors"),errors:new codegen_1$u.Name("errors"),this:new codegen_1$u.Name("this"),self:new codegen_1$u.Name("self"),scope:new codegen_1$u.Name("scope"),json:new codegen_1$u.Name("json"),jsonPos:new codegen_1$u.Name("jsonPos"),jsonLen:new codegen_1$u.Name("jsonLen"),jsonPart:new codegen_1$u.Name("jsonPart")};names$1.default=names,function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.extendErrors=i.resetErrorsCount=i.reportExtraError=i.reportError=i.keyword$DataError=i.keywordError=void 0;const e=codegen,s=util,c=names$1;i.keywordError={message:({keyword:st})=>(0,e.str)`must pass "${st}" keyword validation`},i.keyword$DataError={message:({keyword:st,schemaType:tt})=>tt?(0,e.str)`"${st}" keyword must be ${tt} ($data)`:(0,e.str)`"${st}" keyword is invalid ($data)`};function h(st,tt=i.keywordError,ot,it){const{it:at}=st,{gen:ut,compositeRule:lt,allErrors:ct}=at,ft=a(st,tt,ot);it??(lt||ct)?nt(ut,ft):et(at,(0,e._)`[${ft}]`)}i.reportError=h;function $(st,tt=i.keywordError,ot){const{it}=st,{gen:at,compositeRule:ut,allErrors:lt}=it,ct=a(st,tt,ot);nt(at,ct),ut||lt||et(it,c.default.vErrors)}i.reportExtraError=$;function _(st,tt){st.assign(c.default.errors,tt),st.if((0,e._)`${c.default.vErrors} !== null`,()=>st.if(tt,()=>st.assign((0,e._)`${c.default.vErrors}.length`,tt),()=>st.assign(c.default.vErrors,null)))}i.resetErrorsCount=_;function j({gen:st,keyword:tt,schemaValue:ot,data:it,errsCount:at,it:ut}){if(at===void 0)throw new Error("ajv implementation error");const lt=st.name("err");st.forRange("i",at,c.default.errors,ct=>{st.const(lt,(0,e._)`${c.default.vErrors}[${ct}]`),st.if((0,e._)`${lt}.instancePath === undefined`,()=>st.assign((0,e._)`${lt}.instancePath`,(0,e.strConcat)(c.default.instancePath,ut.errorPath))),st.assign((0,e._)`${lt}.schemaPath`,(0,e.str)`${ut.errSchemaPath}/${tt}`),ut.opts.verbose&&(st.assign((0,e._)`${lt}.schema`,ot),st.assign((0,e._)`${lt}.data`,it))})}i.extendErrors=j;function nt(st,tt){const ot=st.const("err",tt);st.if((0,e._)`${c.default.vErrors} === null`,()=>st.assign(c.default.vErrors,(0,e._)`[${ot}]`),(0,e._)`${c.default.vErrors}.push(${ot})`),st.code((0,e._)`${c.default.errors}++`)}function et(st,tt){const{gen:ot,validateName:it,schemaEnv:at}=st;at.$async?ot.throw((0,e._)`new ${st.ValidationError}(${tt})`):(ot.assign((0,e._)`${it}.errors`,tt),ot.return(!1))}const b={keyword:new e.Name("keyword"),schemaPath:new e.Name("schemaPath"),params:new e.Name("params"),propertyName:new e.Name("propertyName"),message:new e.Name("message"),schema:new e.Name("schema"),parentSchema:new e.Name("parentSchema")};function a(st,tt,ot){const{createErrors:it}=st.it;return it===!1?(0,e._)`{}`:o(st,tt,ot)}function o(st,tt,ot={}){const{gen:it,it:at}=st,ut=[d(at,ot),g(st,ot)];return rt(st,tt,ut),it.object(...ut)}function d({errorPath:st},{instancePath:tt}){const ot=tt?(0,e.str)`${st}${(0,s.getErrorPath)(tt,s.Type.Str)}`:st;return[c.default.instancePath,(0,e.strConcat)(c.default.instancePath,ot)]}function g({keyword:st,it:{errSchemaPath:tt}},{schemaPath:ot,parentSchema:it}){let at=it?tt:(0,e.str)`${tt}/${st}`;return ot&&(at=(0,e.str)`${at}${(0,s.getErrorPath)(ot,s.Type.Str)}`),[b.schemaPath,at]}function rt(st,{params:tt,message:ot},it){const{keyword:at,data:ut,schemaValue:lt,it:ct}=st,{opts:ft,propertyName:dt,topSchemaRef:yt,schemaPath:St}=ct;it.push([b.keyword,at],[b.params,typeof tt=="function"?tt(st):tt||(0,e._)`{}`]),ft.messages&&it.push([b.message,typeof ot=="function"?ot(st):ot]),ft.verbose&&it.push([b.schema,lt],[b.parentSchema,(0,e._)`${yt}${St}`],[c.default.data,ut]),dt&&it.push([b.propertyName,dt])}}(errors),Object.defineProperty(boolSchema,"__esModule",{value:!0}),boolSchema.boolOrEmptySchema=boolSchema.topBoolOrEmptySchema=void 0;const errors_1$3=errors,codegen_1$t=codegen,names_1$6=names$1,boolError={message:"boolean schema is false"};function topBoolOrEmptySchema(i){const{gen:e,schema:s,validateName:c}=i;s===!1?falseSchemaError(i,!1):typeof s=="object"&&s.$async===!0?e.return(names_1$6.default.data):(e.assign((0,codegen_1$t._)`${c}.errors`,null),e.return(!0))}boolSchema.topBoolOrEmptySchema=topBoolOrEmptySchema;function boolOrEmptySchema(i,e){const{gen:s,schema:c}=i;c===!1?(s.var(e,!1),falseSchemaError(i)):s.var(e,!0)}boolSchema.boolOrEmptySchema=boolOrEmptySchema;function falseSchemaError(i,e){const{gen:s,data:c}=i,h={gen:s,keyword:"false schema",data:c,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:i};(0,errors_1$3.reportError)(h,boolError,void 0,e)}var dataType={},rules={};Object.defineProperty(rules,"__esModule",{value:!0}),rules.getRules=rules.isJSONType=void 0;const _jsonTypes=["string","number","integer","boolean","null","object","array"],jsonTypes=new Set(_jsonTypes);function isJSONType(i){return typeof i=="string"&&jsonTypes.has(i)}rules.isJSONType=isJSONType;function getRules(){const i={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...i,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},i.number,i.string,i.array,i.object],post:{rules:[]},all:{},keywords:{}}}rules.getRules=getRules;var applicability={};Object.defineProperty(applicability,"__esModule",{value:!0}),applicability.shouldUseRule=applicability.shouldUseGroup=applicability.schemaHasRulesForType=void 0;function schemaHasRulesForType({schema:i,self:e},s){const c=e.RULES.types[s];return c&&c!==!0&&shouldUseGroup(i,c)}applicability.schemaHasRulesForType=schemaHasRulesForType;function shouldUseGroup(i,e){return e.rules.some(s=>shouldUseRule(i,s))}applicability.shouldUseGroup=shouldUseGroup;function shouldUseRule(i,e){var s;return i[e.keyword]!==void 0||((s=e.definition.implements)===null||s===void 0?void 0:s.some(c=>i[c]!==void 0))}applicability.shouldUseRule=shouldUseRule,Object.defineProperty(dataType,"__esModule",{value:!0}),dataType.reportTypeError=dataType.checkDataTypes=dataType.checkDataType=dataType.coerceAndCheckDataType=dataType.getJSONTypes=dataType.getSchemaTypes=dataType.DataType=void 0;const rules_1=rules,applicability_1$1=applicability,errors_1$2=errors,codegen_1$s=codegen,util_1$q=util;var DataType;(function(i){i[i.Correct=0]="Correct",i[i.Wrong=1]="Wrong"})(DataType||(dataType.DataType=DataType={}));function getSchemaTypes(i){const e=getJSONTypes(i.type);if(e.includes("null")){if(i.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&i.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');i.nullable===!0&&e.push("null")}return e}dataType.getSchemaTypes=getSchemaTypes;function getJSONTypes(i){const e=Array.isArray(i)?i:i?[i]:[];if(e.every(rules_1.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}dataType.getJSONTypes=getJSONTypes;function coerceAndCheckDataType(i,e){const{gen:s,data:c,opts:h}=i,$=coerceToTypes(e,h.coerceTypes),_=e.length>0&&!($.length===0&&e.length===1&&(0,applicability_1$1.schemaHasRulesForType)(i,e[0]));if(_){const j=checkDataTypes(e,c,h.strictNumbers,DataType.Wrong);s.if(j,()=>{$.length?coerceData(i,e,$):reportTypeError(i)})}return _}dataType.coerceAndCheckDataType=coerceAndCheckDataType;const COERCIBLE=new Set(["string","number","integer","boolean","null"]);function coerceToTypes(i,e){return e?i.filter(s=>COERCIBLE.has(s)||e==="array"&&s==="array"):[]}function coerceData(i,e,s){const{gen:c,data:h,opts:$}=i,_=c.let("dataType",(0,codegen_1$s._)`typeof ${h}`),j=c.let("coerced",(0,codegen_1$s._)`undefined`);$.coerceTypes==="array"&&c.if((0,codegen_1$s._)`${_} == 'object' && Array.isArray(${h}) && ${h}.length == 1`,()=>c.assign(h,(0,codegen_1$s._)`${h}[0]`).assign(_,(0,codegen_1$s._)`typeof ${h}`).if(checkDataTypes(e,h,$.strictNumbers),()=>c.assign(j,h))),c.if((0,codegen_1$s._)`${j} !== undefined`);for(const et of s)(COERCIBLE.has(et)||et==="array"&&$.coerceTypes==="array")&&nt(et);c.else(),reportTypeError(i),c.endIf(),c.if((0,codegen_1$s._)`${j} !== undefined`,()=>{c.assign(h,j),assignParentData(i,j)});function nt(et){switch(et){case"string":c.elseIf((0,codegen_1$s._)`${_} == "number" || ${_} == "boolean"`).assign(j,(0,codegen_1$s._)`"" + ${h}`).elseIf((0,codegen_1$s._)`${h} === null`).assign(j,(0,codegen_1$s._)`""`);return;case"number":c.elseIf((0,codegen_1$s._)`${_} == "boolean" || ${h} === null
|
|
42
42
|
|| (${_} == "string" && ${h} && ${h} == +${h})`).assign(j,(0,codegen_1$s._)`+${h}`);return;case"integer":c.elseIf((0,codegen_1$s._)`${_} === "boolean" || ${h} === null
|
|
43
43
|
|| (${_} === "string" && ${h} && ${h} == +${h} && !(${h} % 1))`).assign(j,(0,codegen_1$s._)`+${h}`);return;case"boolean":c.elseIf((0,codegen_1$s._)`${h} === "false" || ${h} === 0 || ${h} === null`).assign(j,!1).elseIf((0,codegen_1$s._)`${h} === "true" || ${h} === 1`).assign(j,!0);return;case"null":c.elseIf((0,codegen_1$s._)`${h} === "" || ${h} === 0 || ${h} === false`),c.assign(j,null);return;case"array":c.elseIf((0,codegen_1$s._)`${_} === "string" || ${_} === "number"
|
|
44
|
-
|| ${_} === "boolean" || ${h} === null`).assign(j,(0,codegen_1$s._)`[${h}]`)}}}function assignParentData({gen:i,parentData:e,parentDataProperty:s},c){i.if((0,codegen_1$s._)`${e} !== undefined`,()=>i.assign((0,codegen_1$s._)`${e}[${s}]`,c))}function checkDataType(i,e,s,c=DataType.Correct){const h=c===DataType.Correct?codegen_1$s.operators.EQ:codegen_1$s.operators.NEQ;let $;switch(i){case"null":return(0,codegen_1$s._)`${e} ${h} null`;case"array":$=(0,codegen_1$s._)`Array.isArray(${e})`;break;case"object":$=(0,codegen_1$s._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":$=_((0,codegen_1$s._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":$=_();break;default:return(0,codegen_1$s._)`typeof ${e} ${h} ${i}`}return c===DataType.Correct?$:(0,codegen_1$s.not)($);function _(j=codegen_1$s.nil){return(0,codegen_1$s.and)((0,codegen_1$s._)`typeof ${e} == "number"`,j,s?(0,codegen_1$s._)`isFinite(${e})`:codegen_1$s.nil)}}dataType.checkDataType=checkDataType;function checkDataTypes(i,e,s,c){if(i.length===1)return checkDataType(i[0],e,s,c);let h;const $=(0,util_1$q.toHash)(i);if($.array&&$.object){const _=(0,codegen_1$s._)`typeof ${e} != "object"`;h=$.null?_:(0,codegen_1$s._)`!${e} || ${_}`,delete $.null,delete $.array,delete $.object}else h=codegen_1$s.nil;$.number&&delete $.integer;for(const _ in $)h=(0,codegen_1$s.and)(h,checkDataType(_,e,s,c));return h}dataType.checkDataTypes=checkDataTypes;const typeError={message:({schema:i})=>`must be ${i}`,params:({schema:i,schemaValue:e})=>typeof i=="string"?(0,codegen_1$s._)`{type: ${i}}`:(0,codegen_1$s._)`{type: ${e}}`};function reportTypeError(i){const e=getTypeErrorContext(i);(0,errors_1$2.reportError)(e,typeError)}dataType.reportTypeError=reportTypeError;function getTypeErrorContext(i){const{gen:e,data:s,schema:c}=i,h=(0,util_1$q.schemaRefOrVal)(i,c,"type");return{gen:e,keyword:"type",data:s,schema:c.type,schemaCode:h,schemaValue:h,parentSchema:c,params:{},it:i}}var defaults={};Object.defineProperty(defaults,"__esModule",{value:!0}),defaults.assignDefaults=void 0;const codegen_1$r=codegen,util_1$p=util;function assignDefaults(i,e){const{properties:s,items:c}=i.schema;if(e==="object"&&s)for(const h in s)assignDefault(i,h,s[h].default);else e==="array"&&Array.isArray(c)&&c.forEach((h,$)=>assignDefault(i,$,h.default))}defaults.assignDefaults=assignDefaults;function assignDefault(i,e,s){const{gen:c,compositeRule:h,data:$,opts:_}=i;if(s===void 0)return;const j=(0,codegen_1$r._)`${$}${(0,codegen_1$r.getProperty)(e)}`;if(h){(0,util_1$p.checkStrictMode)(i,`default is ignored for: ${j}`);return}let nt=(0,codegen_1$r._)`${j} === undefined`;_.useDefaults==="empty"&&(nt=(0,codegen_1$r._)`${nt} || ${j} === null || ${j} === ""`),c.if(nt,(0,codegen_1$r._)`${j} = ${(0,codegen_1$r.stringify)(s)}`)}var keyword={},code={};Object.defineProperty(code,"__esModule",{value:!0}),code.validateUnion=code.validateArray=code.usePattern=code.callValidateCode=code.schemaProperties=code.allSchemaProperties=code.noPropertyInData=code.propertyInData=code.isOwnProperty=code.hasPropFunc=code.reportMissingProp=code.checkMissingProp=code.checkReportMissingProp=void 0;const codegen_1$q=codegen,util_1$o=util,names_1$5=names$1,util_2$1=util;function checkReportMissingProp(i,e){const{gen:s,data:c,it:h}=i;s.if(noPropertyInData(s,c,e,h.opts.ownProperties),()=>{i.setParams({missingProperty:(0,codegen_1$q._)`${e}`},!0),i.error()})}code.checkReportMissingProp=checkReportMissingProp;function checkMissingProp({gen:i,data:e,it:{opts:s}},c,h){return(0,codegen_1$q.or)(...c.map($=>(0,codegen_1$q.and)(noPropertyInData(i,e,$,s.ownProperties),(0,codegen_1$q._)`${h} = ${$}`)))}code.checkMissingProp=checkMissingProp;function reportMissingProp(i,e){i.setParams({missingProperty:e},!0),i.error()}code.reportMissingProp=reportMissingProp;function hasPropFunc(i){return i.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,codegen_1$q._)`Object.prototype.hasOwnProperty`})}code.hasPropFunc=hasPropFunc;function isOwnProperty(i,e,s){return(0,codegen_1$q._)`${hasPropFunc(i)}.call(${e}, ${s})`}code.isOwnProperty=isOwnProperty;function propertyInData(i,e,s,c){const h=(0,codegen_1$q._)`${e}${(0,codegen_1$q.getProperty)(s)} !== undefined`;return c?(0,codegen_1$q._)`${h} && ${isOwnProperty(i,e,s)}`:h}code.propertyInData=propertyInData;function noPropertyInData(i,e,s,c){const h=(0,codegen_1$q._)`${e}${(0,codegen_1$q.getProperty)(s)} === undefined`;return c?(0,codegen_1$q.or)(h,(0,codegen_1$q.not)(isOwnProperty(i,e,s))):h}code.noPropertyInData=noPropertyInData;function allSchemaProperties(i){return i?Object.keys(i).filter(e=>e!=="__proto__"):[]}code.allSchemaProperties=allSchemaProperties;function schemaProperties(i,e){return allSchemaProperties(e).filter(s=>!(0,util_1$o.alwaysValidSchema)(i,e[s]))}code.schemaProperties=schemaProperties;function callValidateCode({schemaCode:i,data:e,it:{gen:s,topSchemaRef:c,schemaPath:h,errorPath:$},it:_},j,nt,et){const b=et?(0,codegen_1$q._)`${i}, ${e}, ${c}${h}`:e,a=[[names_1$5.default.instancePath,(0,codegen_1$q.strConcat)(names_1$5.default.instancePath,$)],[names_1$5.default.parentData,_.parentData],[names_1$5.default.parentDataProperty,_.parentDataProperty],[names_1$5.default.rootData,names_1$5.default.rootData]];_.opts.dynamicRef&&a.push([names_1$5.default.dynamicAnchors,names_1$5.default.dynamicAnchors]);const o=(0,codegen_1$q._)`${b}, ${s.object(...a)}`;return nt!==codegen_1$q.nil?(0,codegen_1$q._)`${j}.call(${nt}, ${o})`:(0,codegen_1$q._)`${j}(${o})`}code.callValidateCode=callValidateCode;const newRegExp=(0,codegen_1$q._)`new RegExp`;function usePattern({gen:i,it:{opts:e}},s){const c=e.unicodeRegExp?"u":"",{regExp:h}=e.code,$=h(s,c);return i.scopeValue("pattern",{key:$.toString(),ref:$,code:(0,codegen_1$q._)`${h.code==="new RegExp"?newRegExp:(0,util_2$1.useFunc)(i,h)}(${s}, ${c})`})}code.usePattern=usePattern;function validateArray(i){const{gen:e,data:s,keyword:c,it:h}=i,$=e.name("valid");if(h.allErrors){const j=e.let("valid",!0);return _(()=>e.assign(j,!1)),j}return e.var($,!0),_(()=>e.break()),$;function _(j){const nt=e.const("len",(0,codegen_1$q._)`${s}.length`);e.forRange("i",0,nt,et=>{i.subschema({keyword:c,dataProp:et,dataPropType:util_1$o.Type.Num},$),e.if((0,codegen_1$q.not)($),j)})}}code.validateArray=validateArray;function validateUnion(i){const{gen:e,schema:s,keyword:c,it:h}=i;if(!Array.isArray(s))throw new Error("ajv implementation error");if(s.some(nt=>(0,util_1$o.alwaysValidSchema)(h,nt))&&!h.opts.unevaluated)return;const _=e.let("valid",!1),j=e.name("_valid");e.block(()=>s.forEach((nt,et)=>{const b=i.subschema({keyword:c,schemaProp:et,compositeRule:!0},j);e.assign(_,(0,codegen_1$q._)`${_} || ${j}`),i.mergeValidEvaluated(b,j)||e.if((0,codegen_1$q.not)(_))})),i.result(_,()=>i.reset(),()=>i.error(!0))}code.validateUnion=validateUnion,Object.defineProperty(keyword,"__esModule",{value:!0}),keyword.validateKeywordUsage=keyword.validSchemaType=keyword.funcKeywordCode=keyword.macroKeywordCode=void 0;const codegen_1$p=codegen,names_1$4=names$1,code_1$9=code,errors_1$1=errors;function macroKeywordCode(i,e){const{gen:s,keyword:c,schema:h,parentSchema:$,it:_}=i,j=e.macro.call(_.self,h,$,_),nt=useKeyword(s,c,j);_.opts.validateSchema!==!1&&_.self.validateSchema(j,!0);const et=s.name("valid");i.subschema({schema:j,schemaPath:codegen_1$p.nil,errSchemaPath:`${_.errSchemaPath}/${c}`,topSchemaRef:nt,compositeRule:!0},et),i.pass(et,()=>i.error(!0))}keyword.macroKeywordCode=macroKeywordCode;function funcKeywordCode(i,e){var s;const{gen:c,keyword:h,schema:$,parentSchema:_,$data:j,it:nt}=i;checkAsyncKeyword(nt,e);const et=!j&&e.compile?e.compile.call(nt.self,$,_,nt):e.validate,b=useKeyword(c,h,et),a=c.let("valid");i.block$data(a,o),i.ok((s=e.valid)!==null&&s!==void 0?s:a);function o(){if(e.errors===!1)rt(),e.modifying&&modifyData(i),st(()=>i.error());else{const tt=e.async?d():g();e.modifying&&modifyData(i),st(()=>addErrs(i,tt))}}function d(){const tt=c.let("ruleErrs",null);return c.try(()=>rt((0,codegen_1$p._)`await `),ot=>c.assign(a,!1).if((0,codegen_1$p._)`${ot} instanceof ${nt.ValidationError}`,()=>c.assign(tt,(0,codegen_1$p._)`${ot}.errors`),()=>c.throw(ot))),tt}function g(){const tt=(0,codegen_1$p._)`${b}.errors`;return c.assign(tt,null),rt(codegen_1$p.nil),tt}function rt(tt=e.async?(0,codegen_1$p._)`await `:codegen_1$p.nil){const ot=nt.opts.passContext?names_1$4.default.this:names_1$4.default.self,it=!("compile"in e&&!j||e.schema===!1);c.assign(a,(0,codegen_1$p._)`${tt}${(0,code_1$9.callValidateCode)(i,b,ot,it)}`,e.modifying)}function st(tt){var ot;c.if((0,codegen_1$p.not)((ot=e.valid)!==null&&ot!==void 0?ot:a),tt)}}keyword.funcKeywordCode=funcKeywordCode;function modifyData(i){const{gen:e,data:s,it:c}=i;e.if(c.parentData,()=>e.assign(s,(0,codegen_1$p._)`${c.parentData}[${c.parentDataProperty}]`))}function addErrs(i,e){const{gen:s}=i;s.if((0,codegen_1$p._)`Array.isArray(${e})`,()=>{s.assign(names_1$4.default.vErrors,(0,codegen_1$p._)`${names_1$4.default.vErrors} === null ? ${e} : ${names_1$4.default.vErrors}.concat(${e})`).assign(names_1$4.default.errors,(0,codegen_1$p._)`${names_1$4.default.vErrors}.length`),(0,errors_1$1.extendErrors)(i)},()=>i.error())}function checkAsyncKeyword({schemaEnv:i},e){if(e.async&&!i.$async)throw new Error("async keyword in sync schema")}function useKeyword(i,e,s){if(s===void 0)throw new Error(`keyword "${e}" failed to compile`);return i.scopeValue("keyword",typeof s=="function"?{ref:s}:{ref:s,code:(0,codegen_1$p.stringify)(s)})}function validSchemaType(i,e,s=!1){return!e.length||e.some(c=>c==="array"?Array.isArray(i):c==="object"?i&&typeof i=="object"&&!Array.isArray(i):typeof i==c||s&&typeof i>"u")}keyword.validSchemaType=validSchemaType;function validateKeywordUsage({schema:i,opts:e,self:s,errSchemaPath:c},h,$){if(Array.isArray(h.keyword)?!h.keyword.includes($):h.keyword!==$)throw new Error("ajv implementation error");const _=h.dependencies;if(_!=null&&_.some(j=>!Object.prototype.hasOwnProperty.call(i,j)))throw new Error(`parent schema must have dependencies of ${$}: ${_.join(",")}`);if(h.validateSchema&&!h.validateSchema(i[$])){const nt=`keyword "${$}" value is invalid at path "${c}": `+s.errorsText(h.validateSchema.errors);if(e.validateSchema==="log")s.logger.error(nt);else throw new Error(nt)}}keyword.validateKeywordUsage=validateKeywordUsage;var subschema={};Object.defineProperty(subschema,"__esModule",{value:!0}),subschema.extendSubschemaMode=subschema.extendSubschemaData=subschema.getSubschema=void 0;const codegen_1$o=codegen,util_1$n=util;function getSubschema(i,{keyword:e,schemaProp:s,schema:c,schemaPath:h,errSchemaPath:$,topSchemaRef:_}){if(e!==void 0&&c!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){const j=i.schema[e];return s===void 0?{schema:j,schemaPath:(0,codegen_1$o._)`${i.schemaPath}${(0,codegen_1$o.getProperty)(e)}`,errSchemaPath:`${i.errSchemaPath}/${e}`}:{schema:j[s],schemaPath:(0,codegen_1$o._)`${i.schemaPath}${(0,codegen_1$o.getProperty)(e)}${(0,codegen_1$o.getProperty)(s)}`,errSchemaPath:`${i.errSchemaPath}/${e}/${(0,util_1$n.escapeFragment)(s)}`}}if(c!==void 0){if(h===void 0||$===void 0||_===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:c,schemaPath:h,topSchemaRef:_,errSchemaPath:$}}throw new Error('either "keyword" or "schema" must be passed')}subschema.getSubschema=getSubschema;function extendSubschemaData(i,e,{dataProp:s,dataPropType:c,data:h,dataTypes:$,propertyName:_}){if(h!==void 0&&s!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:j}=e;if(s!==void 0){const{errorPath:et,dataPathArr:b,opts:a}=e,o=j.let("data",(0,codegen_1$o._)`${e.data}${(0,codegen_1$o.getProperty)(s)}`,!0);nt(o),i.errorPath=(0,codegen_1$o.str)`${et}${(0,util_1$n.getErrorPath)(s,c,a.jsPropertySyntax)}`,i.parentDataProperty=(0,codegen_1$o._)`${s}`,i.dataPathArr=[...b,i.parentDataProperty]}if(h!==void 0){const et=h instanceof codegen_1$o.Name?h:j.let("data",h,!0);nt(et),_!==void 0&&(i.propertyName=_)}$&&(i.dataTypes=$);function nt(et){i.data=et,i.dataLevel=e.dataLevel+1,i.dataTypes=[],e.definedProperties=new Set,i.parentData=e.data,i.dataNames=[...e.dataNames,et]}}subschema.extendSubschemaData=extendSubschemaData;function extendSubschemaMode(i,{jtdDiscriminator:e,jtdMetadata:s,compositeRule:c,createErrors:h,allErrors:$}){c!==void 0&&(i.compositeRule=c),h!==void 0&&(i.createErrors=h),$!==void 0&&(i.allErrors=$),i.jtdDiscriminator=e,i.jtdMetadata=s}subschema.extendSubschemaMode=extendSubschemaMode;var resolve$2={},fastDeepEqual=function i(e,s){if(e===s)return!0;if(e&&s&&typeof e=="object"&&typeof s=="object"){if(e.constructor!==s.constructor)return!1;var c,h,$;if(Array.isArray(e)){if(c=e.length,c!=s.length)return!1;for(h=c;h--!==0;)if(!i(e[h],s[h]))return!1;return!0}if(e.constructor===RegExp)return e.source===s.source&&e.flags===s.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===s.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===s.toString();if($=Object.keys(e),c=$.length,c!==Object.keys(s).length)return!1;for(h=c;h--!==0;)if(!Object.prototype.hasOwnProperty.call(s,$[h]))return!1;for(h=c;h--!==0;){var _=$[h];if(!i(e[_],s[_]))return!1}return!0}return e!==e&&s!==s},jsonSchemaTraverse={exports:{}},traverse$1=jsonSchemaTraverse.exports=function(i,e,s){typeof e=="function"&&(s=e,e={}),s=e.cb||s;var c=typeof s=="function"?s:s.pre||function(){},h=s.post||function(){};_traverse(e,c,h,i,"",i)};traverse$1.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},traverse$1.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},traverse$1.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},traverse$1.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function _traverse(i,e,s,c,h,$,_,j,nt,et){if(c&&typeof c=="object"&&!Array.isArray(c)){e(c,h,$,_,j,nt,et);for(var b in c){var a=c[b];if(Array.isArray(a)){if(b in traverse$1.arrayKeywords)for(var o=0;o<a.length;o++)_traverse(i,e,s,a[o],h+"/"+b+"/"+o,$,h,b,c,o)}else if(b in traverse$1.propsKeywords){if(a&&typeof a=="object")for(var d in a)_traverse(i,e,s,a[d],h+"/"+b+"/"+escapeJsonPtr(d),$,h,b,c,d)}else(b in traverse$1.keywords||i.allKeys&&!(b in traverse$1.skipKeywords))&&_traverse(i,e,s,a,h+"/"+b,$,h,b,c)}s(c,h,$,_,j,nt,et)}}function escapeJsonPtr(i){return i.replace(/~/g,"~0").replace(/\//g,"~1")}var jsonSchemaTraverseExports=jsonSchemaTraverse.exports;Object.defineProperty(resolve$2,"__esModule",{value:!0}),resolve$2.getSchemaRefs=resolve$2.resolveUrl=resolve$2.normalizeId=resolve$2._getFullPath=resolve$2.getFullPath=resolve$2.inlineRef=void 0;const util_1$m=util,equal$3=fastDeepEqual,traverse=jsonSchemaTraverseExports,SIMPLE_INLINED=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function inlineRef(i,e=!0){return typeof i=="boolean"?!0:e===!0?!hasRef(i):e?countKeys(i)<=e:!1}resolve$2.inlineRef=inlineRef;const REF_KEYWORDS=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function hasRef(i){for(const e in i){if(REF_KEYWORDS.has(e))return!0;const s=i[e];if(Array.isArray(s)&&s.some(hasRef)||typeof s=="object"&&hasRef(s))return!0}return!1}function countKeys(i){let e=0;for(const s in i){if(s==="$ref")return 1/0;if(e++,!SIMPLE_INLINED.has(s)&&(typeof i[s]=="object"&&(0,util_1$m.eachItem)(i[s],c=>e+=countKeys(c)),e===1/0))return 1/0}return e}function getFullPath(i,e="",s){s!==!1&&(e=normalizeId(e));const c=i.parse(e);return _getFullPath(i,c)}resolve$2.getFullPath=getFullPath;function _getFullPath(i,e){return i.serialize(e).split("#")[0]+"#"}resolve$2._getFullPath=_getFullPath;const TRAILING_SLASH_HASH=/#\/?$/;function normalizeId(i){return i?i.replace(TRAILING_SLASH_HASH,""):""}resolve$2.normalizeId=normalizeId;function resolveUrl(i,e,s){return s=normalizeId(s),i.resolve(e,s)}resolve$2.resolveUrl=resolveUrl;const ANCHOR=/^[a-z_][-a-z0-9._]*$/i;function getSchemaRefs(i,e){if(typeof i=="boolean")return{};const{schemaId:s,uriResolver:c}=this.opts,h=normalizeId(i[s]||e),$={"":h},_=getFullPath(c,h,!1),j={},nt=new Set;return traverse(i,{allKeys:!0},(a,o,d,g)=>{if(g===void 0)return;const rt=_+o;let st=$[g];typeof a[s]=="string"&&(st=tt.call(this,a[s])),ot.call(this,a.$anchor),ot.call(this,a.$dynamicAnchor),$[o]=st;function tt(it){const at=this.opts.uriResolver.resolve;if(it=normalizeId(st?at(st,it):it),nt.has(it))throw b(it);nt.add(it);let ut=this.refs[it];return typeof ut=="string"&&(ut=this.refs[ut]),typeof ut=="object"?et(a,ut.schema,it):it!==normalizeId(rt)&&(it[0]==="#"?(et(a,j[it],it),j[it]=a):this.refs[it]=rt),it}function ot(it){if(typeof it=="string"){if(!ANCHOR.test(it))throw new Error(`invalid anchor "${it}"`);tt.call(this,`#${it}`)}}}),j;function et(a,o,d){if(o!==void 0&&!equal$3(a,o))throw b(d)}function b(a){return new Error(`reference "${a}" resolves to more than one schema`)}}resolve$2.getSchemaRefs=getSchemaRefs,Object.defineProperty(validate,"__esModule",{value:!0}),validate.getData=validate.KeywordCxt=validate.validateFunctionCode=void 0;const boolSchema_1=boolSchema,dataType_1$1=dataType,applicability_1=applicability,dataType_2=dataType,defaults_1=defaults,keyword_1=keyword,subschema_1=subschema,codegen_1$n=codegen,names_1$3=names$1,resolve_1$2=resolve$2,util_1$l=util,errors_1=errors;function validateFunctionCode(i){if(isSchemaObj(i)&&(checkKeywords(i),schemaCxtHasRules(i))){topSchemaObjCode(i);return}validateFunction(i,()=>(0,boolSchema_1.topBoolOrEmptySchema)(i))}validate.validateFunctionCode=validateFunctionCode;function validateFunction({gen:i,validateName:e,schema:s,schemaEnv:c,opts:h},$){h.code.es5?i.func(e,(0,codegen_1$n._)`${names_1$3.default.data}, ${names_1$3.default.valCxt}`,c.$async,()=>{i.code((0,codegen_1$n._)`"use strict"; ${funcSourceUrl(s,h)}`),destructureValCxtES5(i,h),i.code($)}):i.func(e,(0,codegen_1$n._)`${names_1$3.default.data}, ${destructureValCxt(h)}`,c.$async,()=>i.code(funcSourceUrl(s,h)).code($))}function destructureValCxt(i){return(0,codegen_1$n._)`{${names_1$3.default.instancePath}="", ${names_1$3.default.parentData}, ${names_1$3.default.parentDataProperty}, ${names_1$3.default.rootData}=${names_1$3.default.data}${i.dynamicRef?(0,codegen_1$n._)`, ${names_1$3.default.dynamicAnchors}={}`:codegen_1$n.nil}}={}`}function destructureValCxtES5(i,e){i.if(names_1$3.default.valCxt,()=>{i.var(names_1$3.default.instancePath,(0,codegen_1$n._)`${names_1$3.default.valCxt}.${names_1$3.default.instancePath}`),i.var(names_1$3.default.parentData,(0,codegen_1$n._)`${names_1$3.default.valCxt}.${names_1$3.default.parentData}`),i.var(names_1$3.default.parentDataProperty,(0,codegen_1$n._)`${names_1$3.default.valCxt}.${names_1$3.default.parentDataProperty}`),i.var(names_1$3.default.rootData,(0,codegen_1$n._)`${names_1$3.default.valCxt}.${names_1$3.default.rootData}`),e.dynamicRef&&i.var(names_1$3.default.dynamicAnchors,(0,codegen_1$n._)`${names_1$3.default.valCxt}.${names_1$3.default.dynamicAnchors}`)},()=>{i.var(names_1$3.default.instancePath,(0,codegen_1$n._)`""`),i.var(names_1$3.default.parentData,(0,codegen_1$n._)`undefined`),i.var(names_1$3.default.parentDataProperty,(0,codegen_1$n._)`undefined`),i.var(names_1$3.default.rootData,names_1$3.default.data),e.dynamicRef&&i.var(names_1$3.default.dynamicAnchors,(0,codegen_1$n._)`{}`)})}function topSchemaObjCode(i){const{schema:e,opts:s,gen:c}=i;validateFunction(i,()=>{s.$comment&&e.$comment&&commentKeyword(i),checkNoDefault(i),c.let(names_1$3.default.vErrors,null),c.let(names_1$3.default.errors,0),s.unevaluated&&resetEvaluated(i),typeAndKeywords(i),returnResults(i)})}function resetEvaluated(i){const{gen:e,validateName:s}=i;i.evaluated=e.const("evaluated",(0,codegen_1$n._)`${s}.evaluated`),e.if((0,codegen_1$n._)`${i.evaluated}.dynamicProps`,()=>e.assign((0,codegen_1$n._)`${i.evaluated}.props`,(0,codegen_1$n._)`undefined`)),e.if((0,codegen_1$n._)`${i.evaluated}.dynamicItems`,()=>e.assign((0,codegen_1$n._)`${i.evaluated}.items`,(0,codegen_1$n._)`undefined`))}function funcSourceUrl(i,e){const s=typeof i=="object"&&i[e.schemaId];return s&&(e.code.source||e.code.process)?(0,codegen_1$n._)`/*# sourceURL=${s} */`:codegen_1$n.nil}function subschemaCode(i,e){if(isSchemaObj(i)&&(checkKeywords(i),schemaCxtHasRules(i))){subSchemaObjCode(i,e);return}(0,boolSchema_1.boolOrEmptySchema)(i,e)}function schemaCxtHasRules({schema:i,self:e}){if(typeof i=="boolean")return!i;for(const s in i)if(e.RULES.all[s])return!0;return!1}function isSchemaObj(i){return typeof i.schema!="boolean"}function subSchemaObjCode(i,e){const{schema:s,gen:c,opts:h}=i;h.$comment&&s.$comment&&commentKeyword(i),updateContext(i),checkAsyncSchema(i);const $=c.const("_errs",names_1$3.default.errors);typeAndKeywords(i,$),c.var(e,(0,codegen_1$n._)`${$} === ${names_1$3.default.errors}`)}function checkKeywords(i){(0,util_1$l.checkUnknownRules)(i),checkRefsAndKeywords(i)}function typeAndKeywords(i,e){if(i.opts.jtd)return schemaKeywords(i,[],!1,e);const s=(0,dataType_1$1.getSchemaTypes)(i.schema),c=(0,dataType_1$1.coerceAndCheckDataType)(i,s);schemaKeywords(i,s,!c,e)}function checkRefsAndKeywords(i){const{schema:e,errSchemaPath:s,opts:c,self:h}=i;e.$ref&&c.ignoreKeywordsWithRef&&(0,util_1$l.schemaHasRulesButRef)(e,h.RULES)&&h.logger.warn(`$ref: keywords ignored in schema at path "${s}"`)}function checkNoDefault(i){const{schema:e,opts:s}=i;e.default!==void 0&&s.useDefaults&&s.strictSchema&&(0,util_1$l.checkStrictMode)(i,"default is ignored in the schema root")}function updateContext(i){const e=i.schema[i.opts.schemaId];e&&(i.baseId=(0,resolve_1$2.resolveUrl)(i.opts.uriResolver,i.baseId,e))}function checkAsyncSchema(i){if(i.schema.$async&&!i.schemaEnv.$async)throw new Error("async schema in sync schema")}function commentKeyword({gen:i,schemaEnv:e,schema:s,errSchemaPath:c,opts:h}){const $=s.$comment;if(h.$comment===!0)i.code((0,codegen_1$n._)`${names_1$3.default.self}.logger.log(${$})`);else if(typeof h.$comment=="function"){const _=(0,codegen_1$n.str)`${c}/$comment`,j=i.scopeValue("root",{ref:e.root});i.code((0,codegen_1$n._)`${names_1$3.default.self}.opts.$comment(${$}, ${_}, ${j}.schema)`)}}function returnResults(i){const{gen:e,schemaEnv:s,validateName:c,ValidationError:h,opts:$}=i;s.$async?e.if((0,codegen_1$n._)`${names_1$3.default.errors} === 0`,()=>e.return(names_1$3.default.data),()=>e.throw((0,codegen_1$n._)`new ${h}(${names_1$3.default.vErrors})`)):(e.assign((0,codegen_1$n._)`${c}.errors`,names_1$3.default.vErrors),$.unevaluated&&assignEvaluated(i),e.return((0,codegen_1$n._)`${names_1$3.default.errors} === 0`))}function assignEvaluated({gen:i,evaluated:e,props:s,items:c}){s instanceof codegen_1$n.Name&&i.assign((0,codegen_1$n._)`${e}.props`,s),c instanceof codegen_1$n.Name&&i.assign((0,codegen_1$n._)`${e}.items`,c)}function schemaKeywords(i,e,s,c){const{gen:h,schema:$,data:_,allErrors:j,opts:nt,self:et}=i,{RULES:b}=et;if($.$ref&&(nt.ignoreKeywordsWithRef||!(0,util_1$l.schemaHasRulesButRef)($,b))){h.block(()=>keywordCode(i,"$ref",b.all.$ref.definition));return}nt.jtd||checkStrictTypes(i,e),h.block(()=>{for(const o of b.rules)a(o);a(b.post)});function a(o){(0,applicability_1.shouldUseGroup)($,o)&&(o.type?(h.if((0,dataType_2.checkDataType)(o.type,_,nt.strictNumbers)),iterateKeywords(i,o),e.length===1&&e[0]===o.type&&s&&(h.else(),(0,dataType_2.reportTypeError)(i)),h.endIf()):iterateKeywords(i,o),j||h.if((0,codegen_1$n._)`${names_1$3.default.errors} === ${c||0}`))}}function iterateKeywords(i,e){const{gen:s,schema:c,opts:{useDefaults:h}}=i;h&&(0,defaults_1.assignDefaults)(i,e.type),s.block(()=>{for(const $ of e.rules)(0,applicability_1.shouldUseRule)(c,$)&&keywordCode(i,$.keyword,$.definition,e.type)})}function checkStrictTypes(i,e){i.schemaEnv.meta||!i.opts.strictTypes||(checkContextTypes(i,e),i.opts.allowUnionTypes||checkMultipleTypes(i,e),checkKeywordTypes(i,i.dataTypes))}function checkContextTypes(i,e){if(e.length){if(!i.dataTypes.length){i.dataTypes=e;return}e.forEach(s=>{includesType(i.dataTypes,s)||strictTypesError(i,`type "${s}" not allowed by context "${i.dataTypes.join(",")}"`)}),narrowSchemaTypes(i,e)}}function checkMultipleTypes(i,e){e.length>1&&!(e.length===2&&e.includes("null"))&&strictTypesError(i,"use allowUnionTypes to allow union type keyword")}function checkKeywordTypes(i,e){const s=i.self.RULES.all;for(const c in s){const h=s[c];if(typeof h=="object"&&(0,applicability_1.shouldUseRule)(i.schema,h)){const{type:$}=h.definition;$.length&&!$.some(_=>hasApplicableType(e,_))&&strictTypesError(i,`missing type "${$.join(",")}" for keyword "${c}"`)}}}function hasApplicableType(i,e){return i.includes(e)||e==="number"&&i.includes("integer")}function includesType(i,e){return i.includes(e)||e==="integer"&&i.includes("number")}function narrowSchemaTypes(i,e){const s=[];for(const c of i.dataTypes)includesType(e,c)?s.push(c):e.includes("integer")&&c==="number"&&s.push("integer");i.dataTypes=s}function strictTypesError(i,e){const s=i.schemaEnv.baseId+i.errSchemaPath;e+=` at "${s}" (strictTypes)`,(0,util_1$l.checkStrictMode)(i,e,i.opts.strictTypes)}class KeywordCxt{constructor(e,s,c){if((0,keyword_1.validateKeywordUsage)(e,s,c),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=c,this.data=e.data,this.schema=e.schema[c],this.$data=s.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,util_1$l.schemaRefOrVal)(e,this.schema,c,this.$data),this.schemaType=s.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=s,this.$data)this.schemaCode=e.gen.const("vSchema",getData(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,keyword_1.validSchemaType)(this.schema,s.schemaType,s.allowUndefined))throw new Error(`${c} value must be ${JSON.stringify(s.schemaType)}`);("code"in s?s.trackErrors:s.errors!==!1)&&(this.errsCount=e.gen.const("_errs",names_1$3.default.errors))}result(e,s,c){this.failResult((0,codegen_1$n.not)(e),s,c)}failResult(e,s,c){this.gen.if(e),c?c():this.error(),s?(this.gen.else(),s(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,s){this.failResult((0,codegen_1$n.not)(e),void 0,s)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);const{schemaCode:s}=this;this.fail((0,codegen_1$n._)`${s} !== undefined && (${(0,codegen_1$n.or)(this.invalid$data(),e)})`)}error(e,s,c){if(s){this.setParams(s),this._error(e,c),this.setParams({});return}this._error(e,c)}_error(e,s){(e?errors_1.reportExtraError:errors_1.reportError)(this,this.def.error,s)}$dataError(){(0,errors_1.reportError)(this,this.def.$dataError||errors_1.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,errors_1.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,s){s?Object.assign(this.params,e):this.params=e}block$data(e,s,c=codegen_1$n.nil){this.gen.block(()=>{this.check$data(e,c),s()})}check$data(e=codegen_1$n.nil,s=codegen_1$n.nil){if(!this.$data)return;const{gen:c,schemaCode:h,schemaType:$,def:_}=this;c.if((0,codegen_1$n.or)((0,codegen_1$n._)`${h} === undefined`,s)),e!==codegen_1$n.nil&&c.assign(e,!0),($.length||_.validateSchema)&&(c.elseIf(this.invalid$data()),this.$dataError(),e!==codegen_1$n.nil&&c.assign(e,!1)),c.else()}invalid$data(){const{gen:e,schemaCode:s,schemaType:c,def:h,it:$}=this;return(0,codegen_1$n.or)(_(),j());function _(){if(c.length){if(!(s instanceof codegen_1$n.Name))throw new Error("ajv implementation error");const nt=Array.isArray(c)?c:[c];return(0,codegen_1$n._)`${(0,dataType_2.checkDataTypes)(nt,s,$.opts.strictNumbers,dataType_2.DataType.Wrong)}`}return codegen_1$n.nil}function j(){if(h.validateSchema){const nt=e.scopeValue("validate$data",{ref:h.validateSchema});return(0,codegen_1$n._)`!${nt}(${s})`}return codegen_1$n.nil}}subschema(e,s){const c=(0,subschema_1.getSubschema)(this.it,e);(0,subschema_1.extendSubschemaData)(c,this.it,e),(0,subschema_1.extendSubschemaMode)(c,e);const h={...this.it,...c,items:void 0,props:void 0};return subschemaCode(h,s),h}mergeEvaluated(e,s){const{it:c,gen:h}=this;c.opts.unevaluated&&(c.props!==!0&&e.props!==void 0&&(c.props=util_1$l.mergeEvaluated.props(h,e.props,c.props,s)),c.items!==!0&&e.items!==void 0&&(c.items=util_1$l.mergeEvaluated.items(h,e.items,c.items,s)))}mergeValidEvaluated(e,s){const{it:c,gen:h}=this;if(c.opts.unevaluated&&(c.props!==!0||c.items!==!0))return h.if(s,()=>this.mergeEvaluated(e,codegen_1$n.Name)),!0}}validate.KeywordCxt=KeywordCxt;function keywordCode(i,e,s,c){const h=new KeywordCxt(i,s,e);"code"in s?s.code(h,c):h.$data&&s.validate?(0,keyword_1.funcKeywordCode)(h,s):"macro"in s?(0,keyword_1.macroKeywordCode)(h,s):(s.compile||s.validate)&&(0,keyword_1.funcKeywordCode)(h,s)}const JSON_POINTER=/^\/(?:[^~]|~0|~1)*$/,RELATIVE_JSON_POINTER=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function getData(i,{dataLevel:e,dataNames:s,dataPathArr:c}){let h,$;if(i==="")return names_1$3.default.rootData;if(i[0]==="/"){if(!JSON_POINTER.test(i))throw new Error(`Invalid JSON-pointer: ${i}`);h=i,$=names_1$3.default.rootData}else{const et=RELATIVE_JSON_POINTER.exec(i);if(!et)throw new Error(`Invalid JSON-pointer: ${i}`);const b=+et[1];if(h=et[2],h==="#"){if(b>=e)throw new Error(nt("property/index",b));return c[e-b]}if(b>e)throw new Error(nt("data",b));if($=s[e-b],!h)return $}let _=$;const j=h.split("/");for(const et of j)et&&($=(0,codegen_1$n._)`${$}${(0,codegen_1$n.getProperty)((0,util_1$l.unescapeJsonPointer)(et))}`,_=(0,codegen_1$n._)`${_} && ${$}`);return _;function nt(et,b){return`Cannot access ${et} ${b} levels up, current level is ${e}`}}validate.getData=getData;var validation_error={};Object.defineProperty(validation_error,"__esModule",{value:!0});let ValidationError$1=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};validation_error.default=ValidationError$1;var ref_error={};Object.defineProperty(ref_error,"__esModule",{value:!0});const resolve_1$1=resolve$2;class MissingRefError extends Error{constructor(e,s,c,h){super(h||`can't resolve reference ${c} from id ${s}`),this.missingRef=(0,resolve_1$1.resolveUrl)(e,s,c),this.missingSchema=(0,resolve_1$1.normalizeId)((0,resolve_1$1.getFullPath)(e,this.missingRef))}}ref_error.default=MissingRefError;var compile={};Object.defineProperty(compile,"__esModule",{value:!0}),compile.resolveSchema=compile.getCompilingSchema=compile.resolveRef=compile.compileSchema=compile.SchemaEnv=void 0;const codegen_1$m=codegen,validation_error_1=validation_error,names_1$2=names$1,resolve_1=resolve$2,util_1$k=util,validate_1$1=validate;class SchemaEnv{constructor(e){var s;this.refs={},this.dynamicAnchors={};let c;typeof e.schema=="object"&&(c=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(s=e.baseId)!==null&&s!==void 0?s:(0,resolve_1.normalizeId)(c==null?void 0:c[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=c==null?void 0:c.$async,this.refs={}}}compile.SchemaEnv=SchemaEnv;function compileSchema(i){const e=getCompilingSchema.call(this,i);if(e)return e;const s=(0,resolve_1.getFullPath)(this.opts.uriResolver,i.root.baseId),{es5:c,lines:h}=this.opts.code,{ownProperties:$}=this.opts,_=new codegen_1$m.CodeGen(this.scope,{es5:c,lines:h,ownProperties:$});let j;i.$async&&(j=_.scopeValue("Error",{ref:validation_error_1.default,code:(0,codegen_1$m._)`require("ajv/dist/runtime/validation_error").default`}));const nt=_.scopeName("validate");i.validateName=nt;const et={gen:_,allErrors:this.opts.allErrors,data:names_1$2.default.data,parentData:names_1$2.default.parentData,parentDataProperty:names_1$2.default.parentDataProperty,dataNames:[names_1$2.default.data],dataPathArr:[codegen_1$m.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:_.scopeValue("schema",this.opts.code.source===!0?{ref:i.schema,code:(0,codegen_1$m.stringify)(i.schema)}:{ref:i.schema}),validateName:nt,ValidationError:j,schema:i.schema,schemaEnv:i,rootId:s,baseId:i.baseId||s,schemaPath:codegen_1$m.nil,errSchemaPath:i.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,codegen_1$m._)`""`,opts:this.opts,self:this};let b;try{this._compilations.add(i),(0,validate_1$1.validateFunctionCode)(et),_.optimize(this.opts.code.optimize);const a=_.toString();b=`${_.scopeRefs(names_1$2.default.scope)}return ${a}`,this.opts.code.process&&(b=this.opts.code.process(b,i));const d=new Function(`${names_1$2.default.self}`,`${names_1$2.default.scope}`,b)(this,this.scope.get());if(this.scope.value(nt,{ref:d}),d.errors=null,d.schema=i.schema,d.schemaEnv=i,i.$async&&(d.$async=!0),this.opts.code.source===!0&&(d.source={validateName:nt,validateCode:a,scopeValues:_._values}),this.opts.unevaluated){const{props:g,items:rt}=et;d.evaluated={props:g instanceof codegen_1$m.Name?void 0:g,items:rt instanceof codegen_1$m.Name?void 0:rt,dynamicProps:g instanceof codegen_1$m.Name,dynamicItems:rt instanceof codegen_1$m.Name},d.source&&(d.source.evaluated=(0,codegen_1$m.stringify)(d.evaluated))}return i.validate=d,i}catch(a){throw delete i.validate,delete i.validateName,b&&this.logger.error("Error compiling schema, function code:",b),a}finally{this._compilations.delete(i)}}compile.compileSchema=compileSchema;function resolveRef(i,e,s){var c;s=(0,resolve_1.resolveUrl)(this.opts.uriResolver,e,s);const h=i.refs[s];if(h)return h;let $=resolve$1.call(this,i,s);if($===void 0){const _=(c=i.localRefs)===null||c===void 0?void 0:c[s],{schemaId:j}=this.opts;_&&($=new SchemaEnv({schema:_,schemaId:j,root:i,baseId:e}))}if($!==void 0)return i.refs[s]=inlineOrCompile.call(this,$)}compile.resolveRef=resolveRef;function inlineOrCompile(i){return(0,resolve_1.inlineRef)(i.schema,this.opts.inlineRefs)?i.schema:i.validate?i:compileSchema.call(this,i)}function getCompilingSchema(i){for(const e of this._compilations)if(sameSchemaEnv(e,i))return e}compile.getCompilingSchema=getCompilingSchema;function sameSchemaEnv(i,e){return i.schema===e.schema&&i.root===e.root&&i.baseId===e.baseId}function resolve$1(i,e){let s;for(;typeof(s=this.refs[e])=="string";)e=s;return s||this.schemas[e]||resolveSchema.call(this,i,e)}function resolveSchema(i,e){const s=this.opts.uriResolver.parse(e),c=(0,resolve_1._getFullPath)(this.opts.uriResolver,s);let h=(0,resolve_1.getFullPath)(this.opts.uriResolver,i.baseId,void 0);if(Object.keys(i.schema).length>0&&c===h)return getJsonPointer.call(this,s,i);const $=(0,resolve_1.normalizeId)(c),_=this.refs[$]||this.schemas[$];if(typeof _=="string"){const j=resolveSchema.call(this,i,_);return typeof(j==null?void 0:j.schema)!="object"?void 0:getJsonPointer.call(this,s,j)}if(typeof(_==null?void 0:_.schema)=="object"){if(_.validate||compileSchema.call(this,_),$===(0,resolve_1.normalizeId)(e)){const{schema:j}=_,{schemaId:nt}=this.opts,et=j[nt];return et&&(h=(0,resolve_1.resolveUrl)(this.opts.uriResolver,h,et)),new SchemaEnv({schema:j,schemaId:nt,root:i,baseId:h})}return getJsonPointer.call(this,s,_)}}compile.resolveSchema=resolveSchema;const PREVENT_SCOPE_CHANGE=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function getJsonPointer(i,{baseId:e,schema:s,root:c}){var h;if(((h=i.fragment)===null||h===void 0?void 0:h[0])!=="/")return;for(const j of i.fragment.slice(1).split("/")){if(typeof s=="boolean")return;const nt=s[(0,util_1$k.unescapeFragment)(j)];if(nt===void 0)return;s=nt;const et=typeof s=="object"&&s[this.opts.schemaId];!PREVENT_SCOPE_CHANGE.has(j)&&et&&(e=(0,resolve_1.resolveUrl)(this.opts.uriResolver,e,et))}let $;if(typeof s!="boolean"&&s.$ref&&!(0,util_1$k.schemaHasRulesButRef)(s,this.RULES)){const j=(0,resolve_1.resolveUrl)(this.opts.uriResolver,e,s.$ref);$=resolveSchema.call(this,c,j)}const{schemaId:_}=this.opts;if($=$||new SchemaEnv({schema:s,schemaId:_,root:c,baseId:e}),$.schema!==$.root.schema)return $}const $id$1="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description="Meta-schema for $data reference (JSON AnySchema extension proposal)",type$1="object",required$1=["$data"],properties$2={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties$1=!1,require$$9={$id:$id$1,description,type:type$1,required:required$1,properties:properties$2,additionalProperties:additionalProperties$1};var uri$1={},fastUri$1={exports:{}};const isUUID$1=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),isIPv4$1=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function stringArrayToHexStripped(i){let e="",s=0,c=0;for(c=0;c<i.length;c++)if(s=i[c].charCodeAt(0),s!==48){if(!(s>=48&&s<=57||s>=65&&s<=70||s>=97&&s<=102))return"";e+=i[c];break}for(c+=1;c<i.length;c++){if(s=i[c].charCodeAt(0),!(s>=48&&s<=57||s>=65&&s<=70||s>=97&&s<=102))return"";e+=i[c]}return e}const nonSimpleDomain$1=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function consumeIsZone(i){return i.length=0,!0}function consumeHextets(i,e,s){if(i.length){const c=stringArrayToHexStripped(i);if(c!=="")e.push(c);else return s.error=!0,!1;i.length=0}return!0}function getIPV6(i){let e=0;const s={error:!1,address:"",zone:""},c=[],h=[];let $=!1,_=!1,j=consumeHextets;for(let nt=0;nt<i.length;nt++){const et=i[nt];if(!(et==="["||et==="]"))if(et===":"){if($===!0&&(_=!0),!j(h,c,s))break;if(++e>7){s.error=!0;break}nt>0&&i[nt-1]===":"&&($=!0),c.push(":");continue}else if(et==="%"){if(!j(h,c,s))break;j=consumeIsZone}else{h.push(et);continue}}return h.length&&(j===consumeIsZone?s.zone=h.join(""):_?c.push(h.join("")):c.push(stringArrayToHexStripped(h))),s.address=c.join(""),s}function normalizeIPv6$1(i){if(findToken(i,":")<2)return{host:i,isIPV6:!1};const e=getIPV6(i);if(e.error)return{host:i,isIPV6:!1};{let s=e.address,c=e.address;return e.zone&&(s+="%"+e.zone,c+="%25"+e.zone),{host:s,isIPV6:!0,escapedHost:c}}}function findToken(i,e){let s=0;for(let c=0;c<i.length;c++)i[c]===e&&s++;return s}function removeDotSegments$1(i){let e=i;const s=[];let c=-1,h=0;for(;h=e.length;){if(h===1){if(e===".")break;if(e==="/"){s.push("/");break}else{s.push(e);break}}else if(h===2){if(e[0]==="."){if(e[1]===".")break;if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&(e[1]==="."||e[1]==="/")){s.push("/");break}}else if(h===3&&e==="/.."){s.length!==0&&s.pop(),s.push("/");break}if(e[0]==="."){if(e[1]==="."){if(e[2]==="/"){e=e.slice(3);continue}}else if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&e[1]==="."){if(e[2]==="/"){e=e.slice(2);continue}else if(e[2]==="."&&e[3]==="/"){e=e.slice(3),s.length!==0&&s.pop();continue}}if((c=e.indexOf("/",1))===-1){s.push(e);break}else s.push(e.slice(0,c)),e=e.slice(c)}return s.join("")}function normalizeComponentEncoding$1(i,e){const s=e!==!0?escape:unescape;return i.scheme!==void 0&&(i.scheme=s(i.scheme)),i.userinfo!==void 0&&(i.userinfo=s(i.userinfo)),i.host!==void 0&&(i.host=s(i.host)),i.path!==void 0&&(i.path=s(i.path)),i.query!==void 0&&(i.query=s(i.query)),i.fragment!==void 0&&(i.fragment=s(i.fragment)),i}function recomposeAuthority$1(i){const e=[];if(i.userinfo!==void 0&&(e.push(i.userinfo),e.push("@")),i.host!==void 0){let s=unescape(i.host);if(!isIPv4$1(s)){const c=normalizeIPv6$1(s);c.isIPV6===!0?s=`[${c.escapedHost}]`:s=i.host}e.push(s)}return(typeof i.port=="number"||typeof i.port=="string")&&(e.push(":"),e.push(String(i.port))),e.length?e.join(""):void 0}var utils$1={nonSimpleDomain:nonSimpleDomain$1,recomposeAuthority:recomposeAuthority$1,normalizeComponentEncoding:normalizeComponentEncoding$1,removeDotSegments:removeDotSegments$1,isIPv4:isIPv4$1,isUUID:isUUID$1,normalizeIPv6:normalizeIPv6$1};const{isUUID}=utils$1,URN_REG=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function wsIsSecure(i){return i.secure===!0?!0:i.secure===!1?!1:i.scheme?i.scheme.length===3&&(i.scheme[0]==="w"||i.scheme[0]==="W")&&(i.scheme[1]==="s"||i.scheme[1]==="S")&&(i.scheme[2]==="s"||i.scheme[2]==="S"):!1}function httpParse(i){return i.host||(i.error=i.error||"HTTP URIs must have a host."),i}function httpSerialize(i){const e=String(i.scheme).toLowerCase()==="https";return(i.port===(e?443:80)||i.port==="")&&(i.port=void 0),i.path||(i.path="/"),i}function wsParse(i){return i.secure=wsIsSecure(i),i.resourceName=(i.path||"/")+(i.query?"?"+i.query:""),i.path=void 0,i.query=void 0,i}function wsSerialize(i){if((i.port===(wsIsSecure(i)?443:80)||i.port==="")&&(i.port=void 0),typeof i.secure=="boolean"&&(i.scheme=i.secure?"wss":"ws",i.secure=void 0),i.resourceName){const[e,s]=i.resourceName.split("?");i.path=e&&e!=="/"?e:void 0,i.query=s,i.resourceName=void 0}return i.fragment=void 0,i}function urnParse(i,e){if(!i.path)return i.error="URN can not be parsed",i;const s=i.path.match(URN_REG);if(s){const c=e.scheme||i.scheme||"urn";i.nid=s[1].toLowerCase(),i.nss=s[2];const h=`${c}:${e.nid||i.nid}`,$=getSchemeHandler$1(h);i.path=void 0,$&&(i=$.parse(i,e))}else i.error=i.error||"URN can not be parsed.";return i}function urnSerialize(i,e){if(i.nid===void 0)throw new Error("URN without nid cannot be serialized");const s=e.scheme||i.scheme||"urn",c=i.nid.toLowerCase(),h=`${s}:${e.nid||c}`,$=getSchemeHandler$1(h);$&&(i=$.serialize(i,e));const _=i,j=i.nss;return _.path=`${c||e.nid}:${j}`,e.skipEscape=!0,_}function urnuuidParse(i,e){const s=i;return s.uuid=s.nss,s.nss=void 0,!e.tolerant&&(!s.uuid||!isUUID(s.uuid))&&(s.error=s.error||"UUID is not valid."),s}function urnuuidSerialize(i){const e=i;return e.nss=(i.uuid||"").toLowerCase(),e}const http={scheme:"http",domainHost:!0,parse:httpParse,serialize:httpSerialize},https={scheme:"https",domainHost:http.domainHost,parse:httpParse,serialize:httpSerialize},ws={scheme:"ws",domainHost:!0,parse:wsParse,serialize:wsSerialize},wss={scheme:"wss",domainHost:ws.domainHost,parse:ws.parse,serialize:ws.serialize},urn={scheme:"urn",parse:urnParse,serialize:urnSerialize,skipNormalize:!0},urnuuid={scheme:"urn:uuid",parse:urnuuidParse,serialize:urnuuidSerialize,skipNormalize:!0},SCHEMES$1={http,https,ws,wss,urn,"urn:uuid":urnuuid};Object.setPrototypeOf(SCHEMES$1,null);function getSchemeHandler$1(i){return i&&(SCHEMES$1[i]||SCHEMES$1[i.toLowerCase()])||void 0}var schemes={SCHEMES:SCHEMES$1,getSchemeHandler:getSchemeHandler$1};const{normalizeIPv6,removeDotSegments,recomposeAuthority,normalizeComponentEncoding,isIPv4,nonSimpleDomain}=utils$1,{SCHEMES,getSchemeHandler}=schemes;function normalize(i,e){return typeof i=="string"?i=serialize(parse(i,e),e):typeof i=="object"&&(i=parse(serialize(i,e),e)),i}function resolve(i,e,s){const c=s?Object.assign({scheme:"null"},s):{scheme:"null"},h=resolveComponent(parse(i,c),parse(e,c),c,!0);return c.skipEscape=!0,serialize(h,c)}function resolveComponent(i,e,s,c){const h={};return c||(i=parse(serialize(i,s),s),e=parse(serialize(e,s),s)),s=s||{},!s.tolerant&&e.scheme?(h.scheme=e.scheme,h.userinfo=e.userinfo,h.host=e.host,h.port=e.port,h.path=removeDotSegments(e.path||""),h.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(h.userinfo=e.userinfo,h.host=e.host,h.port=e.port,h.path=removeDotSegments(e.path||""),h.query=e.query):(e.path?(e.path[0]==="/"?h.path=removeDotSegments(e.path):((i.userinfo!==void 0||i.host!==void 0||i.port!==void 0)&&!i.path?h.path="/"+e.path:i.path?h.path=i.path.slice(0,i.path.lastIndexOf("/")+1)+e.path:h.path=e.path,h.path=removeDotSegments(h.path)),h.query=e.query):(h.path=i.path,e.query!==void 0?h.query=e.query:h.query=i.query),h.userinfo=i.userinfo,h.host=i.host,h.port=i.port),h.scheme=i.scheme),h.fragment=e.fragment,h}function equal$2(i,e,s){return typeof i=="string"?(i=unescape(i),i=serialize(normalizeComponentEncoding(parse(i,s),!0),{...s,skipEscape:!0})):typeof i=="object"&&(i=serialize(normalizeComponentEncoding(i,!0),{...s,skipEscape:!0})),typeof e=="string"?(e=unescape(e),e=serialize(normalizeComponentEncoding(parse(e,s),!0),{...s,skipEscape:!0})):typeof e=="object"&&(e=serialize(normalizeComponentEncoding(e,!0),{...s,skipEscape:!0})),i.toLowerCase()===e.toLowerCase()}function serialize(i,e){const s={host:i.host,scheme:i.scheme,userinfo:i.userinfo,port:i.port,path:i.path,query:i.query,nid:i.nid,nss:i.nss,uuid:i.uuid,fragment:i.fragment,reference:i.reference,resourceName:i.resourceName,secure:i.secure,error:""},c=Object.assign({},e),h=[],$=getSchemeHandler(c.scheme||s.scheme);$&&$.serialize&&$.serialize(s,c),s.path!==void 0&&(c.skipEscape?s.path=unescape(s.path):(s.path=escape(s.path),s.scheme!==void 0&&(s.path=s.path.split("%3A").join(":")))),c.reference!=="suffix"&&s.scheme&&h.push(s.scheme,":");const _=recomposeAuthority(s);if(_!==void 0&&(c.reference!=="suffix"&&h.push("//"),h.push(_),s.path&&s.path[0]!=="/"&&h.push("/")),s.path!==void 0){let j=s.path;!c.absolutePath&&(!$||!$.absolutePath)&&(j=removeDotSegments(j)),_===void 0&&j[0]==="/"&&j[1]==="/"&&(j="/%2F"+j.slice(2)),h.push(j)}return s.query!==void 0&&h.push("?",s.query),s.fragment!==void 0&&h.push("#",s.fragment),h.join("")}const URI_PARSE=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function parse(i,e){const s=Object.assign({},e),c={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let h=!1;s.reference==="suffix"&&(s.scheme?i=s.scheme+":"+i:i="//"+i);const $=i.match(URI_PARSE);if($){if(c.scheme=$[1],c.userinfo=$[3],c.host=$[4],c.port=parseInt($[5],10),c.path=$[6]||"",c.query=$[7],c.fragment=$[8],isNaN(c.port)&&(c.port=$[5]),c.host)if(isIPv4(c.host)===!1){const nt=normalizeIPv6(c.host);c.host=nt.host.toLowerCase(),h=nt.isIPV6}else h=!0;c.scheme===void 0&&c.userinfo===void 0&&c.host===void 0&&c.port===void 0&&c.query===void 0&&!c.path?c.reference="same-document":c.scheme===void 0?c.reference="relative":c.fragment===void 0?c.reference="absolute":c.reference="uri",s.reference&&s.reference!=="suffix"&&s.reference!==c.reference&&(c.error=c.error||"URI is not a "+s.reference+" reference.");const _=getSchemeHandler(s.scheme||c.scheme);if(!s.unicodeSupport&&(!_||!_.unicodeSupport)&&c.host&&(s.domainHost||_&&_.domainHost)&&h===!1&&nonSimpleDomain(c.host))try{c.host=URL.domainToASCII(c.host.toLowerCase())}catch(j){c.error=c.error||"Host's domain name can not be converted to ASCII: "+j}(!_||_&&!_.skipNormalize)&&(i.indexOf("%")!==-1&&(c.scheme!==void 0&&(c.scheme=unescape(c.scheme)),c.host!==void 0&&(c.host=unescape(c.host))),c.path&&(c.path=escape(unescape(c.path))),c.fragment&&(c.fragment=encodeURI(decodeURIComponent(c.fragment)))),_&&_.parse&&_.parse(c,s)}else c.error=c.error||"URI can not be parsed.";return c}const fastUri={SCHEMES,normalize,resolve,resolveComponent,equal:equal$2,serialize,parse};fastUri$1.exports=fastUri,fastUri$1.exports.default=fastUri,fastUri$1.exports.fastUri=fastUri;var fastUriExports=fastUri$1.exports;Object.defineProperty(uri$1,"__esModule",{value:!0});const uri=fastUriExports;uri.code='require("ajv/dist/runtime/uri").default',uri$1.default=uri,function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.CodeGen=i.Name=i.nil=i.stringify=i.str=i._=i.KeywordCxt=void 0;var e=validate;Object.defineProperty(i,"KeywordCxt",{enumerable:!0,get:function(){return e.KeywordCxt}});var s=codegen;Object.defineProperty(i,"_",{enumerable:!0,get:function(){return s._}}),Object.defineProperty(i,"str",{enumerable:!0,get:function(){return s.str}}),Object.defineProperty(i,"stringify",{enumerable:!0,get:function(){return s.stringify}}),Object.defineProperty(i,"nil",{enumerable:!0,get:function(){return s.nil}}),Object.defineProperty(i,"Name",{enumerable:!0,get:function(){return s.Name}}),Object.defineProperty(i,"CodeGen",{enumerable:!0,get:function(){return s.CodeGen}});const c=validation_error,h=ref_error,$=rules,_=compile,j=codegen,nt=resolve$2,et=dataType,b=util,a=require$$9,o=uri$1,d=(Et,mt)=>new RegExp(Et,mt);d.code="new RegExp";const g=["removeAdditional","useDefaults","coerceTypes"],rt=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),st={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},tt={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},ot=200;function it(Et){var mt,gt,ht,pt,_t,Ct,zt,Nt,Ht,Jt,un,yn,vn,mn,Tn,Pn,Gn,wr,xt,Pt,wn,bn,Dn,Rn,_n;const On=Et.strict,Ln=(mt=Et.code)===null||mt===void 0?void 0:mt.optimize,Nn=Ln===!0||Ln===void 0?1:Ln||0,Sn=(ht=(gt=Et.code)===null||gt===void 0?void 0:gt.regExp)!==null&&ht!==void 0?ht:d,qn=(pt=Et.uriResolver)!==null&&pt!==void 0?pt:o.default;return{strictSchema:(Ct=(_t=Et.strictSchema)!==null&&_t!==void 0?_t:On)!==null&&Ct!==void 0?Ct:!0,strictNumbers:(Nt=(zt=Et.strictNumbers)!==null&&zt!==void 0?zt:On)!==null&&Nt!==void 0?Nt:!0,strictTypes:(Jt=(Ht=Et.strictTypes)!==null&&Ht!==void 0?Ht:On)!==null&&Jt!==void 0?Jt:"log",strictTuples:(yn=(un=Et.strictTuples)!==null&&un!==void 0?un:On)!==null&&yn!==void 0?yn:"log",strictRequired:(mn=(vn=Et.strictRequired)!==null&&vn!==void 0?vn:On)!==null&&mn!==void 0?mn:!1,code:Et.code?{...Et.code,optimize:Nn,regExp:Sn}:{optimize:Nn,regExp:Sn},loopRequired:(Tn=Et.loopRequired)!==null&&Tn!==void 0?Tn:ot,loopEnum:(Pn=Et.loopEnum)!==null&&Pn!==void 0?Pn:ot,meta:(Gn=Et.meta)!==null&&Gn!==void 0?Gn:!0,messages:(wr=Et.messages)!==null&&wr!==void 0?wr:!0,inlineRefs:(xt=Et.inlineRefs)!==null&&xt!==void 0?xt:!0,schemaId:(Pt=Et.schemaId)!==null&&Pt!==void 0?Pt:"$id",addUsedSchema:(wn=Et.addUsedSchema)!==null&&wn!==void 0?wn:!0,validateSchema:(bn=Et.validateSchema)!==null&&bn!==void 0?bn:!0,validateFormats:(Dn=Et.validateFormats)!==null&&Dn!==void 0?Dn:!0,unicodeRegExp:(Rn=Et.unicodeRegExp)!==null&&Rn!==void 0?Rn:!0,int32range:(_n=Et.int32range)!==null&&_n!==void 0?_n:!0,uriResolver:qn}}class at{constructor(mt={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,mt=this.opts={...mt,...it(mt)};const{es5:gt,lines:ht}=this.opts.code;this.scope=new j.ValueScope({scope:{},prefixes:rt,es5:gt,lines:ht}),this.logger=bt(mt.logger);const pt=mt.validateFormats;mt.validateFormats=!1,this.RULES=(0,$.getRules)(),ut.call(this,st,mt,"NOT SUPPORTED"),ut.call(this,tt,mt,"DEPRECATED","warn"),this._metaOpts=yt.call(this),mt.formats&&ft.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),mt.keywords&&dt.call(this,mt.keywords),typeof mt.meta=="object"&&this.addMetaSchema(mt.meta),ct.call(this),mt.validateFormats=pt}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:mt,meta:gt,schemaId:ht}=this.opts;let pt=a;ht==="id"&&(pt={...a},pt.id=pt.$id,delete pt.$id),gt&&mt&&this.addMetaSchema(pt,pt[ht],!1)}defaultMeta(){const{meta:mt,schemaId:gt}=this.opts;return this.opts.defaultMeta=typeof mt=="object"?mt[gt]||mt:void 0}validate(mt,gt){let ht;if(typeof mt=="string"){if(ht=this.getSchema(mt),!ht)throw new Error(`no schema with key or ref "${mt}"`)}else ht=this.compile(mt);const pt=ht(gt);return"$async"in ht||(this.errors=ht.errors),pt}compile(mt,gt){const ht=this._addSchema(mt,gt);return ht.validate||this._compileSchemaEnv(ht)}compileAsync(mt,gt){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:ht}=this.opts;return pt.call(this,mt,gt);async function pt(Jt,un){await _t.call(this,Jt.$schema);const yn=this._addSchema(Jt,un);return yn.validate||Ct.call(this,yn)}async function _t(Jt){Jt&&!this.getSchema(Jt)&&await pt.call(this,{$ref:Jt},!0)}async function Ct(Jt){try{return this._compileSchemaEnv(Jt)}catch(un){if(!(un instanceof h.default))throw un;return zt.call(this,un),await Nt.call(this,un.missingSchema),Ct.call(this,Jt)}}function zt({missingSchema:Jt,missingRef:un}){if(this.refs[Jt])throw new Error(`AnySchema ${Jt} is loaded but ${un} cannot be resolved`)}async function Nt(Jt){const un=await Ht.call(this,Jt);this.refs[Jt]||await _t.call(this,un.$schema),this.refs[Jt]||this.addSchema(un,Jt,gt)}async function Ht(Jt){const un=this._loading[Jt];if(un)return un;try{return await(this._loading[Jt]=ht(Jt))}finally{delete this._loading[Jt]}}}addSchema(mt,gt,ht,pt=this.opts.validateSchema){if(Array.isArray(mt)){for(const Ct of mt)this.addSchema(Ct,void 0,ht,pt);return this}let _t;if(typeof mt=="object"){const{schemaId:Ct}=this.opts;if(_t=mt[Ct],_t!==void 0&&typeof _t!="string")throw new Error(`schema ${Ct} must be string`)}return gt=(0,nt.normalizeId)(gt||_t),this._checkUnique(gt),this.schemas[gt]=this._addSchema(mt,ht,gt,pt,!0),this}addMetaSchema(mt,gt,ht=this.opts.validateSchema){return this.addSchema(mt,gt,!0,ht),this}validateSchema(mt,gt){if(typeof mt=="boolean")return!0;let ht;if(ht=mt.$schema,ht!==void 0&&typeof ht!="string")throw new Error("$schema must be a string");if(ht=ht||this.opts.defaultMeta||this.defaultMeta(),!ht)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const pt=this.validate(ht,mt);if(!pt&>){const _t="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(_t);else throw new Error(_t)}return pt}getSchema(mt){let gt;for(;typeof(gt=lt.call(this,mt))=="string";)mt=gt;if(gt===void 0){const{schemaId:ht}=this.opts,pt=new _.SchemaEnv({schema:{},schemaId:ht});if(gt=_.resolveSchema.call(this,pt,mt),!gt)return;this.refs[mt]=gt}return gt.validate||this._compileSchemaEnv(gt)}removeSchema(mt){if(mt instanceof RegExp)return this._removeAllSchemas(this.schemas,mt),this._removeAllSchemas(this.refs,mt),this;switch(typeof mt){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const gt=lt.call(this,mt);return typeof gt=="object"&&this._cache.delete(gt.schema),delete this.schemas[mt],delete this.refs[mt],this}case"object":{const gt=mt;this._cache.delete(gt);let ht=mt[this.opts.schemaId];return ht&&(ht=(0,nt.normalizeId)(ht),delete this.schemas[ht],delete this.refs[ht]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(mt){for(const gt of mt)this.addKeyword(gt);return this}addKeyword(mt,gt){let ht;if(typeof mt=="string")ht=mt,typeof gt=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),gt.keyword=ht);else if(typeof mt=="object"&>===void 0){if(gt=mt,ht=gt.keyword,Array.isArray(ht)&&!ht.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(vt.call(this,ht,gt),!gt)return(0,b.eachItem)(ht,_t=>$t.call(this,_t)),this;Ot.call(this,gt);const pt={...gt,type:(0,et.getJSONTypes)(gt.type),schemaType:(0,et.getJSONTypes)(gt.schemaType)};return(0,b.eachItem)(ht,pt.type.length===0?_t=>$t.call(this,_t,pt):_t=>pt.type.forEach(Ct=>$t.call(this,_t,pt,Ct))),this}getKeyword(mt){const gt=this.RULES.all[mt];return typeof gt=="object"?gt.definition:!!gt}removeKeyword(mt){const{RULES:gt}=this;delete gt.keywords[mt],delete gt.all[mt];for(const ht of gt.rules){const pt=ht.rules.findIndex(_t=>_t.keyword===mt);pt>=0&&ht.rules.splice(pt,1)}return this}addFormat(mt,gt){return typeof gt=="string"&&(gt=new RegExp(gt)),this.formats[mt]=gt,this}errorsText(mt=this.errors,{separator:gt=", ",dataVar:ht="data"}={}){return!mt||mt.length===0?"No errors":mt.map(pt=>`${ht}${pt.instancePath} ${pt.message}`).reduce((pt,_t)=>pt+gt+_t)}$dataMetaSchema(mt,gt){const ht=this.RULES.all;mt=JSON.parse(JSON.stringify(mt));for(const pt of gt){const _t=pt.split("/").slice(1);let Ct=mt;for(const zt of _t)Ct=Ct[zt];for(const zt in ht){const Nt=ht[zt];if(typeof Nt!="object")continue;const{$data:Ht}=Nt.definition,Jt=Ct[zt];Ht&&Jt&&(Ct[zt]=jt(Jt))}}return mt}_removeAllSchemas(mt,gt){for(const ht in mt){const pt=mt[ht];(!gt||gt.test(ht))&&(typeof pt=="string"?delete mt[ht]:pt&&!pt.meta&&(this._cache.delete(pt.schema),delete mt[ht]))}}_addSchema(mt,gt,ht,pt=this.opts.validateSchema,_t=this.opts.addUsedSchema){let Ct;const{schemaId:zt}=this.opts;if(typeof mt=="object")Ct=mt[zt];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof mt!="boolean")throw new Error("schema must be object or boolean")}let Nt=this._cache.get(mt);if(Nt!==void 0)return Nt;ht=(0,nt.normalizeId)(Ct||ht);const Ht=nt.getSchemaRefs.call(this,mt,ht);return Nt=new _.SchemaEnv({schema:mt,schemaId:zt,meta:gt,baseId:ht,localRefs:Ht}),this._cache.set(Nt.schema,Nt),_t&&!ht.startsWith("#")&&(ht&&this._checkUnique(ht),this.refs[ht]=Nt),pt&&this.validateSchema(mt,!0),Nt}_checkUnique(mt){if(this.schemas[mt]||this.refs[mt])throw new Error(`schema with key or id "${mt}" already exists`)}_compileSchemaEnv(mt){if(mt.meta?this._compileMetaSchema(mt):_.compileSchema.call(this,mt),!mt.validate)throw new Error("ajv implementation error");return mt.validate}_compileMetaSchema(mt){const gt=this.opts;this.opts=this._metaOpts;try{_.compileSchema.call(this,mt)}finally{this.opts=gt}}}at.ValidationError=c.default,at.MissingRefError=h.default,i.default=at;function ut(Et,mt,gt,ht="error"){for(const pt in Et){const _t=pt;_t in mt&&this.logger[ht](`${gt}: option ${pt}. ${Et[_t]}`)}}function lt(Et){return Et=(0,nt.normalizeId)(Et),this.schemas[Et]||this.refs[Et]}function ct(){const Et=this.opts.schemas;if(Et)if(Array.isArray(Et))this.addSchema(Et);else for(const mt in Et)this.addSchema(Et[mt],mt)}function ft(){for(const Et in this.opts.formats){const mt=this.opts.formats[Et];mt&&this.addFormat(Et,mt)}}function dt(Et){if(Array.isArray(Et)){this.addVocabulary(Et);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const mt in Et){const gt=Et[mt];gt.keyword||(gt.keyword=mt),this.addKeyword(gt)}}function yt(){const Et={...this.opts};for(const mt of g)delete Et[mt];return Et}const St={log(){},warn(){},error(){}};function bt(Et){if(Et===!1)return St;if(Et===void 0)return console;if(Et.log&&Et.warn&&Et.error)return Et;throw new Error("logger must implement log, warn and error methods")}const Tt=/^[a-z_$][a-z0-9_$:-]*$/i;function vt(Et,mt){const{RULES:gt}=this;if((0,b.eachItem)(Et,ht=>{if(gt.keywords[ht])throw new Error(`Keyword ${ht} is already defined`);if(!Tt.test(ht))throw new Error(`Keyword ${ht} has invalid name`)}),!!mt&&mt.$data&&!("code"in mt||"validate"in mt))throw new Error('$data keyword must have "code" or "validate" function')}function $t(Et,mt,gt){var ht;const pt=mt==null?void 0:mt.post;if(gt&&pt)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:_t}=this;let Ct=pt?_t.post:_t.rules.find(({type:Nt})=>Nt===gt);if(Ct||(Ct={type:gt,rules:[]},_t.rules.push(Ct)),_t.keywords[Et]=!0,!mt)return;const zt={keyword:Et,definition:{...mt,type:(0,et.getJSONTypes)(mt.type),schemaType:(0,et.getJSONTypes)(mt.schemaType)}};mt.before?At.call(this,Ct,zt,mt.before):Ct.rules.push(zt),_t.all[Et]=zt,(ht=mt.implements)===null||ht===void 0||ht.forEach(Nt=>this.addKeyword(Nt))}function At(Et,mt,gt){const ht=Et.rules.findIndex(pt=>pt.keyword===gt);ht>=0?Et.rules.splice(ht,0,mt):(Et.rules.push(mt),this.logger.warn(`rule ${gt} is not defined`))}function Ot(Et){let{metaSchema:mt}=Et;mt!==void 0&&(Et.$data&&this.opts.$data&&(mt=jt(mt)),Et.validateSchema=this.compile(mt,!0))}const It={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function jt(Et){return{anyOf:[Et,It]}}}(core$2);var draft7={},core$1={},id={};Object.defineProperty(id,"__esModule",{value:!0});const def$s={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};id.default=def$s;var ref={};Object.defineProperty(ref,"__esModule",{value:!0}),ref.callRef=ref.getValidate=void 0;const ref_error_1$1=ref_error,code_1$8=code,codegen_1$l=codegen,names_1$1=names$1,compile_1$1=compile,util_1$j=util,def$r={keyword:"$ref",schemaType:"string",code(i){const{gen:e,schema:s,it:c}=i,{baseId:h,schemaEnv:$,validateName:_,opts:j,self:nt}=c,{root:et}=$;if((s==="#"||s==="#/")&&h===et.baseId)return a();const b=compile_1$1.resolveRef.call(nt,et,h,s);if(b===void 0)throw new ref_error_1$1.default(c.opts.uriResolver,h,s);if(b instanceof compile_1$1.SchemaEnv)return o(b);return d(b);function a(){if($===et)return callRef(i,_,$,$.$async);const g=e.scopeValue("root",{ref:et});return callRef(i,(0,codegen_1$l._)`${g}.validate`,et,et.$async)}function o(g){const rt=getValidate(i,g);callRef(i,rt,g,g.$async)}function d(g){const rt=e.scopeValue("schema",j.code.source===!0?{ref:g,code:(0,codegen_1$l.stringify)(g)}:{ref:g}),st=e.name("valid"),tt=i.subschema({schema:g,dataTypes:[],schemaPath:codegen_1$l.nil,topSchemaRef:rt,errSchemaPath:s},st);i.mergeEvaluated(tt),i.ok(st)}}};function getValidate(i,e){const{gen:s}=i;return e.validate?s.scopeValue("validate",{ref:e.validate}):(0,codegen_1$l._)`${s.scopeValue("wrapper",{ref:e})}.validate`}ref.getValidate=getValidate;function callRef(i,e,s,c){const{gen:h,it:$}=i,{allErrors:_,schemaEnv:j,opts:nt}=$,et=nt.passContext?names_1$1.default.this:codegen_1$l.nil;c?b():a();function b(){if(!j.$async)throw new Error("async schema referenced by sync schema");const g=h.let("valid");h.try(()=>{h.code((0,codegen_1$l._)`await ${(0,code_1$8.callValidateCode)(i,e,et)}`),d(e),_||h.assign(g,!0)},rt=>{h.if((0,codegen_1$l._)`!(${rt} instanceof ${$.ValidationError})`,()=>h.throw(rt)),o(rt),_||h.assign(g,!1)}),i.ok(g)}function a(){i.result((0,code_1$8.callValidateCode)(i,e,et),()=>d(e),()=>o(e))}function o(g){const rt=(0,codegen_1$l._)`${g}.errors`;h.assign(names_1$1.default.vErrors,(0,codegen_1$l._)`${names_1$1.default.vErrors} === null ? ${rt} : ${names_1$1.default.vErrors}.concat(${rt})`),h.assign(names_1$1.default.errors,(0,codegen_1$l._)`${names_1$1.default.vErrors}.length`)}function d(g){var rt;if(!$.opts.unevaluated)return;const st=(rt=s==null?void 0:s.validate)===null||rt===void 0?void 0:rt.evaluated;if($.props!==!0)if(st&&!st.dynamicProps)st.props!==void 0&&($.props=util_1$j.mergeEvaluated.props(h,st.props,$.props));else{const tt=h.var("props",(0,codegen_1$l._)`${g}.evaluated.props`);$.props=util_1$j.mergeEvaluated.props(h,tt,$.props,codegen_1$l.Name)}if($.items!==!0)if(st&&!st.dynamicItems)st.items!==void 0&&($.items=util_1$j.mergeEvaluated.items(h,st.items,$.items));else{const tt=h.var("items",(0,codegen_1$l._)`${g}.evaluated.items`);$.items=util_1$j.mergeEvaluated.items(h,tt,$.items,codegen_1$l.Name)}}}ref.callRef=callRef,ref.default=def$r,Object.defineProperty(core$1,"__esModule",{value:!0});const id_1=id,ref_1=ref,core=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",id_1.default,ref_1.default];core$1.default=core;var validation$1={},limitNumber={};Object.defineProperty(limitNumber,"__esModule",{value:!0});const codegen_1$k=codegen,ops=codegen_1$k.operators,KWDs={maximum:{okStr:"<=",ok:ops.LTE,fail:ops.GT},minimum:{okStr:">=",ok:ops.GTE,fail:ops.LT},exclusiveMaximum:{okStr:"<",ok:ops.LT,fail:ops.GTE},exclusiveMinimum:{okStr:">",ok:ops.GT,fail:ops.LTE}},error$i={message:({keyword:i,schemaCode:e})=>(0,codegen_1$k.str)`must be ${KWDs[i].okStr} ${e}`,params:({keyword:i,schemaCode:e})=>(0,codegen_1$k._)`{comparison: ${KWDs[i].okStr}, limit: ${e}}`},def$q={keyword:Object.keys(KWDs),type:"number",schemaType:"number",$data:!0,error:error$i,code(i){const{keyword:e,data:s,schemaCode:c}=i;i.fail$data((0,codegen_1$k._)`${s} ${KWDs[e].fail} ${c} || isNaN(${s})`)}};limitNumber.default=def$q;var multipleOf={};Object.defineProperty(multipleOf,"__esModule",{value:!0});const codegen_1$j=codegen,error$h={message:({schemaCode:i})=>(0,codegen_1$j.str)`must be multiple of ${i}`,params:({schemaCode:i})=>(0,codegen_1$j._)`{multipleOf: ${i}}`},def$p={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:error$h,code(i){const{gen:e,data:s,schemaCode:c,it:h}=i,$=h.opts.multipleOfPrecision,_=e.let("res"),j=$?(0,codegen_1$j._)`Math.abs(Math.round(${_}) - ${_}) > 1e-${$}`:(0,codegen_1$j._)`${_} !== parseInt(${_})`;i.fail$data((0,codegen_1$j._)`(${c} === 0 || (${_} = ${s}/${c}, ${j}))`)}};multipleOf.default=def$p;var limitLength={},ucs2length$1={};Object.defineProperty(ucs2length$1,"__esModule",{value:!0});function ucs2length(i){const e=i.length;let s=0,c=0,h;for(;c<e;)s++,h=i.charCodeAt(c++),h>=55296&&h<=56319&&c<e&&(h=i.charCodeAt(c),(h&64512)===56320&&c++);return s}ucs2length$1.default=ucs2length,ucs2length.code='require("ajv/dist/runtime/ucs2length").default',Object.defineProperty(limitLength,"__esModule",{value:!0});const codegen_1$i=codegen,util_1$i=util,ucs2length_1=ucs2length$1,error$g={message({keyword:i,schemaCode:e}){const s=i==="maxLength"?"more":"fewer";return(0,codegen_1$i.str)`must NOT have ${s} than ${e} characters`},params:({schemaCode:i})=>(0,codegen_1$i._)`{limit: ${i}}`},def$o={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:error$g,code(i){const{keyword:e,data:s,schemaCode:c,it:h}=i,$=e==="maxLength"?codegen_1$i.operators.GT:codegen_1$i.operators.LT,_=h.opts.unicode===!1?(0,codegen_1$i._)`${s}.length`:(0,codegen_1$i._)`${(0,util_1$i.useFunc)(i.gen,ucs2length_1.default)}(${s})`;i.fail$data((0,codegen_1$i._)`${_} ${$} ${c}`)}};limitLength.default=def$o;var pattern={};Object.defineProperty(pattern,"__esModule",{value:!0});const code_1$7=code,codegen_1$h=codegen,error$f={message:({schemaCode:i})=>(0,codegen_1$h.str)`must match pattern "${i}"`,params:({schemaCode:i})=>(0,codegen_1$h._)`{pattern: ${i}}`},def$n={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:error$f,code(i){const{data:e,$data:s,schema:c,schemaCode:h,it:$}=i,_=$.opts.unicodeRegExp?"u":"",j=s?(0,codegen_1$h._)`(new RegExp(${h}, ${_}))`:(0,code_1$7.usePattern)(i,c);i.fail$data((0,codegen_1$h._)`!${j}.test(${e})`)}};pattern.default=def$n;var limitProperties={};Object.defineProperty(limitProperties,"__esModule",{value:!0});const codegen_1$g=codegen,error$e={message({keyword:i,schemaCode:e}){const s=i==="maxProperties"?"more":"fewer";return(0,codegen_1$g.str)`must NOT have ${s} than ${e} properties`},params:({schemaCode:i})=>(0,codegen_1$g._)`{limit: ${i}}`},def$m={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:error$e,code(i){const{keyword:e,data:s,schemaCode:c}=i,h=e==="maxProperties"?codegen_1$g.operators.GT:codegen_1$g.operators.LT;i.fail$data((0,codegen_1$g._)`Object.keys(${s}).length ${h} ${c}`)}};limitProperties.default=def$m;var required={};Object.defineProperty(required,"__esModule",{value:!0});const code_1$6=code,codegen_1$f=codegen,util_1$h=util,error$d={message:({params:{missingProperty:i}})=>(0,codegen_1$f.str)`must have required property '${i}'`,params:({params:{missingProperty:i}})=>(0,codegen_1$f._)`{missingProperty: ${i}}`},def$l={keyword:"required",type:"object",schemaType:"array",$data:!0,error:error$d,code(i){const{gen:e,schema:s,schemaCode:c,data:h,$data:$,it:_}=i,{opts:j}=_;if(!$&&s.length===0)return;const nt=s.length>=j.loopRequired;if(_.allErrors?et():b(),j.strictRequired){const d=i.parentSchema.properties,{definedProperties:g}=i.it;for(const rt of s)if((d==null?void 0:d[rt])===void 0&&!g.has(rt)){const st=_.schemaEnv.baseId+_.errSchemaPath,tt=`required property "${rt}" is not defined at "${st}" (strictRequired)`;(0,util_1$h.checkStrictMode)(_,tt,_.opts.strictRequired)}}function et(){if(nt||$)i.block$data(codegen_1$f.nil,a);else for(const d of s)(0,code_1$6.checkReportMissingProp)(i,d)}function b(){const d=e.let("missing");if(nt||$){const g=e.let("valid",!0);i.block$data(g,()=>o(d,g)),i.ok(g)}else e.if((0,code_1$6.checkMissingProp)(i,s,d)),(0,code_1$6.reportMissingProp)(i,d),e.else()}function a(){e.forOf("prop",c,d=>{i.setParams({missingProperty:d}),e.if((0,code_1$6.noPropertyInData)(e,h,d,j.ownProperties),()=>i.error())})}function o(d,g){i.setParams({missingProperty:d}),e.forOf(d,c,()=>{e.assign(g,(0,code_1$6.propertyInData)(e,h,d,j.ownProperties)),e.if((0,codegen_1$f.not)(g),()=>{i.error(),e.break()})},codegen_1$f.nil)}}};required.default=def$l;var limitItems={};Object.defineProperty(limitItems,"__esModule",{value:!0});const codegen_1$e=codegen,error$c={message({keyword:i,schemaCode:e}){const s=i==="maxItems"?"more":"fewer";return(0,codegen_1$e.str)`must NOT have ${s} than ${e} items`},params:({schemaCode:i})=>(0,codegen_1$e._)`{limit: ${i}}`},def$k={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:error$c,code(i){const{keyword:e,data:s,schemaCode:c}=i,h=e==="maxItems"?codegen_1$e.operators.GT:codegen_1$e.operators.LT;i.fail$data((0,codegen_1$e._)`${s}.length ${h} ${c}`)}};limitItems.default=def$k;var uniqueItems={},equal$1={};Object.defineProperty(equal$1,"__esModule",{value:!0});const equal=fastDeepEqual;equal.code='require("ajv/dist/runtime/equal").default',equal$1.default=equal,Object.defineProperty(uniqueItems,"__esModule",{value:!0});const dataType_1=dataType,codegen_1$d=codegen,util_1$g=util,equal_1$2=equal$1,error$b={message:({params:{i,j:e}})=>(0,codegen_1$d.str)`must NOT have duplicate items (items ## ${e} and ${i} are identical)`,params:({params:{i,j:e}})=>(0,codegen_1$d._)`{i: ${i}, j: ${e}}`},def$j={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:error$b,code(i){const{gen:e,data:s,$data:c,schema:h,parentSchema:$,schemaCode:_,it:j}=i;if(!c&&!h)return;const nt=e.let("valid"),et=$.items?(0,dataType_1.getSchemaTypes)($.items):[];i.block$data(nt,b,(0,codegen_1$d._)`${_} === false`),i.ok(nt);function b(){const g=e.let("i",(0,codegen_1$d._)`${s}.length`),rt=e.let("j");i.setParams({i:g,j:rt}),e.assign(nt,!0),e.if((0,codegen_1$d._)`${g} > 1`,()=>(a()?o:d)(g,rt))}function a(){return et.length>0&&!et.some(g=>g==="object"||g==="array")}function o(g,rt){const st=e.name("item"),tt=(0,dataType_1.checkDataTypes)(et,st,j.opts.strictNumbers,dataType_1.DataType.Wrong),ot=e.const("indices",(0,codegen_1$d._)`{}`);e.for((0,codegen_1$d._)`;${g}--;`,()=>{e.let(st,(0,codegen_1$d._)`${s}[${g}]`),e.if(tt,(0,codegen_1$d._)`continue`),et.length>1&&e.if((0,codegen_1$d._)`typeof ${st} == "string"`,(0,codegen_1$d._)`${st} += "_"`),e.if((0,codegen_1$d._)`typeof ${ot}[${st}] == "number"`,()=>{e.assign(rt,(0,codegen_1$d._)`${ot}[${st}]`),i.error(),e.assign(nt,!1).break()}).code((0,codegen_1$d._)`${ot}[${st}] = ${g}`)})}function d(g,rt){const st=(0,util_1$g.useFunc)(e,equal_1$2.default),tt=e.name("outer");e.label(tt).for((0,codegen_1$d._)`;${g}--;`,()=>e.for((0,codegen_1$d._)`${rt} = ${g}; ${rt}--;`,()=>e.if((0,codegen_1$d._)`${st}(${s}[${g}], ${s}[${rt}])`,()=>{i.error(),e.assign(nt,!1).break(tt)})))}}};uniqueItems.default=def$j;var _const={};Object.defineProperty(_const,"__esModule",{value:!0});const codegen_1$c=codegen,util_1$f=util,equal_1$1=equal$1,error$a={message:"must be equal to constant",params:({schemaCode:i})=>(0,codegen_1$c._)`{allowedValue: ${i}}`},def$i={keyword:"const",$data:!0,error:error$a,code(i){const{gen:e,data:s,$data:c,schemaCode:h,schema:$}=i;c||$&&typeof $=="object"?i.fail$data((0,codegen_1$c._)`!${(0,util_1$f.useFunc)(e,equal_1$1.default)}(${s}, ${h})`):i.fail((0,codegen_1$c._)`${$} !== ${s}`)}};_const.default=def$i;var _enum={};Object.defineProperty(_enum,"__esModule",{value:!0});const codegen_1$b=codegen,util_1$e=util,equal_1=equal$1,error$9={message:"must be equal to one of the allowed values",params:({schemaCode:i})=>(0,codegen_1$b._)`{allowedValues: ${i}}`},def$h={keyword:"enum",schemaType:"array",$data:!0,error:error$9,code(i){const{gen:e,data:s,$data:c,schema:h,schemaCode:$,it:_}=i;if(!c&&h.length===0)throw new Error("enum must have non-empty array");const j=h.length>=_.opts.loopEnum;let nt;const et=()=>nt??(nt=(0,util_1$e.useFunc)(e,equal_1.default));let b;if(j||c)b=e.let("valid"),i.block$data(b,a);else{if(!Array.isArray(h))throw new Error("ajv implementation error");const d=e.const("vSchema",$);b=(0,codegen_1$b.or)(...h.map((g,rt)=>o(d,rt)))}i.pass(b);function a(){e.assign(b,!1),e.forOf("v",$,d=>e.if((0,codegen_1$b._)`${et()}(${s}, ${d})`,()=>e.assign(b,!0).break()))}function o(d,g){const rt=h[g];return typeof rt=="object"&&rt!==null?(0,codegen_1$b._)`${et()}(${s}, ${d}[${g}])`:(0,codegen_1$b._)`${s} === ${rt}`}}};_enum.default=def$h,Object.defineProperty(validation$1,"__esModule",{value:!0});const limitNumber_1=limitNumber,multipleOf_1=multipleOf,limitLength_1=limitLength,pattern_1=pattern,limitProperties_1=limitProperties,required_1=required,limitItems_1=limitItems,uniqueItems_1=uniqueItems,const_1=_const,enum_1=_enum,validation=[limitNumber_1.default,multipleOf_1.default,limitLength_1.default,pattern_1.default,limitProperties_1.default,required_1.default,limitItems_1.default,uniqueItems_1.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},const_1.default,enum_1.default];validation$1.default=validation;var applicator={},additionalItems={};Object.defineProperty(additionalItems,"__esModule",{value:!0}),additionalItems.validateAdditionalItems=void 0;const codegen_1$a=codegen,util_1$d=util,error$8={message:({params:{len:i}})=>(0,codegen_1$a.str)`must NOT have more than ${i} items`,params:({params:{len:i}})=>(0,codegen_1$a._)`{limit: ${i}}`},def$g={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:error$8,code(i){const{parentSchema:e,it:s}=i,{items:c}=e;if(!Array.isArray(c)){(0,util_1$d.checkStrictMode)(s,'"additionalItems" is ignored when "items" is not an array of schemas');return}validateAdditionalItems(i,c)}};function validateAdditionalItems(i,e){const{gen:s,schema:c,data:h,keyword:$,it:_}=i;_.items=!0;const j=s.const("len",(0,codegen_1$a._)`${h}.length`);if(c===!1)i.setParams({len:e.length}),i.pass((0,codegen_1$a._)`${j} <= ${e.length}`);else if(typeof c=="object"&&!(0,util_1$d.alwaysValidSchema)(_,c)){const et=s.var("valid",(0,codegen_1$a._)`${j} <= ${e.length}`);s.if((0,codegen_1$a.not)(et),()=>nt(et)),i.ok(et)}function nt(et){s.forRange("i",e.length,j,b=>{i.subschema({keyword:$,dataProp:b,dataPropType:util_1$d.Type.Num},et),_.allErrors||s.if((0,codegen_1$a.not)(et),()=>s.break())})}}additionalItems.validateAdditionalItems=validateAdditionalItems,additionalItems.default=def$g;var prefixItems={},items={};Object.defineProperty(items,"__esModule",{value:!0}),items.validateTuple=void 0;const codegen_1$9=codegen,util_1$c=util,code_1$5=code,def$f={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(i){const{schema:e,it:s}=i;if(Array.isArray(e))return validateTuple(i,"additionalItems",e);s.items=!0,!(0,util_1$c.alwaysValidSchema)(s,e)&&i.ok((0,code_1$5.validateArray)(i))}};function validateTuple(i,e,s=i.schema){const{gen:c,parentSchema:h,data:$,keyword:_,it:j}=i;b(h),j.opts.unevaluated&&s.length&&j.items!==!0&&(j.items=util_1$c.mergeEvaluated.items(c,s.length,j.items));const nt=c.name("valid"),et=c.const("len",(0,codegen_1$9._)`${$}.length`);s.forEach((a,o)=>{(0,util_1$c.alwaysValidSchema)(j,a)||(c.if((0,codegen_1$9._)`${et} > ${o}`,()=>i.subschema({keyword:_,schemaProp:o,dataProp:o},nt)),i.ok(nt))});function b(a){const{opts:o,errSchemaPath:d}=j,g=s.length,rt=g===a.minItems&&(g===a.maxItems||a[e]===!1);if(o.strictTuples&&!rt){const st=`"${_}" is ${g}-tuple, but minItems or maxItems/${e} are not specified or different at path "${d}"`;(0,util_1$c.checkStrictMode)(j,st,o.strictTuples)}}}items.validateTuple=validateTuple,items.default=def$f,Object.defineProperty(prefixItems,"__esModule",{value:!0});const items_1$1=items,def$e={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:i=>(0,items_1$1.validateTuple)(i,"items")};prefixItems.default=def$e;var items2020={};Object.defineProperty(items2020,"__esModule",{value:!0});const codegen_1$8=codegen,util_1$b=util,code_1$4=code,additionalItems_1$1=additionalItems,error$7={message:({params:{len:i}})=>(0,codegen_1$8.str)`must NOT have more than ${i} items`,params:({params:{len:i}})=>(0,codegen_1$8._)`{limit: ${i}}`},def$d={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:error$7,code(i){const{schema:e,parentSchema:s,it:c}=i,{prefixItems:h}=s;c.items=!0,!(0,util_1$b.alwaysValidSchema)(c,e)&&(h?(0,additionalItems_1$1.validateAdditionalItems)(i,h):i.ok((0,code_1$4.validateArray)(i)))}};items2020.default=def$d;var contains={};Object.defineProperty(contains,"__esModule",{value:!0});const codegen_1$7=codegen,util_1$a=util,error$6={message:({params:{min:i,max:e}})=>e===void 0?(0,codegen_1$7.str)`must contain at least ${i} valid item(s)`:(0,codegen_1$7.str)`must contain at least ${i} and no more than ${e} valid item(s)`,params:({params:{min:i,max:e}})=>e===void 0?(0,codegen_1$7._)`{minContains: ${i}}`:(0,codegen_1$7._)`{minContains: ${i}, maxContains: ${e}}`},def$c={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:error$6,code(i){const{gen:e,schema:s,parentSchema:c,data:h,it:$}=i;let _,j;const{minContains:nt,maxContains:et}=c;$.opts.next?(_=nt===void 0?1:nt,j=et):_=1;const b=e.const("len",(0,codegen_1$7._)`${h}.length`);if(i.setParams({min:_,max:j}),j===void 0&&_===0){(0,util_1$a.checkStrictMode)($,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(j!==void 0&&_>j){(0,util_1$a.checkStrictMode)($,'"minContains" > "maxContains" is always invalid'),i.fail();return}if((0,util_1$a.alwaysValidSchema)($,s)){let rt=(0,codegen_1$7._)`${b} >= ${_}`;j!==void 0&&(rt=(0,codegen_1$7._)`${rt} && ${b} <= ${j}`),i.pass(rt);return}$.items=!0;const a=e.name("valid");j===void 0&&_===1?d(a,()=>e.if(a,()=>e.break())):_===0?(e.let(a,!0),j!==void 0&&e.if((0,codegen_1$7._)`${h}.length > 0`,o)):(e.let(a,!1),o()),i.result(a,()=>i.reset());function o(){const rt=e.name("_valid"),st=e.let("count",0);d(rt,()=>e.if(rt,()=>g(st)))}function d(rt,st){e.forRange("i",0,b,tt=>{i.subschema({keyword:"contains",dataProp:tt,dataPropType:util_1$a.Type.Num,compositeRule:!0},rt),st()})}function g(rt){e.code((0,codegen_1$7._)`${rt}++`),j===void 0?e.if((0,codegen_1$7._)`${rt} >= ${_}`,()=>e.assign(a,!0).break()):(e.if((0,codegen_1$7._)`${rt} > ${j}`,()=>e.assign(a,!1).break()),_===1?e.assign(a,!0):e.if((0,codegen_1$7._)`${rt} >= ${_}`,()=>e.assign(a,!0)))}}};contains.default=def$c;var dependencies={};(function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.validateSchemaDeps=i.validatePropertyDeps=i.error=void 0;const e=codegen,s=util,c=code;i.error={message:({params:{property:nt,depsCount:et,deps:b}})=>{const a=et===1?"property":"properties";return(0,e.str)`must have ${a} ${b} when property ${nt} is present`},params:({params:{property:nt,depsCount:et,deps:b,missingProperty:a}})=>(0,e._)`{property: ${nt},
|
|
44
|
+
|| ${_} === "boolean" || ${h} === null`).assign(j,(0,codegen_1$s._)`[${h}]`)}}}function assignParentData({gen:i,parentData:e,parentDataProperty:s},c){i.if((0,codegen_1$s._)`${e} !== undefined`,()=>i.assign((0,codegen_1$s._)`${e}[${s}]`,c))}function checkDataType(i,e,s,c=DataType.Correct){const h=c===DataType.Correct?codegen_1$s.operators.EQ:codegen_1$s.operators.NEQ;let $;switch(i){case"null":return(0,codegen_1$s._)`${e} ${h} null`;case"array":$=(0,codegen_1$s._)`Array.isArray(${e})`;break;case"object":$=(0,codegen_1$s._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":$=_((0,codegen_1$s._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":$=_();break;default:return(0,codegen_1$s._)`typeof ${e} ${h} ${i}`}return c===DataType.Correct?$:(0,codegen_1$s.not)($);function _(j=codegen_1$s.nil){return(0,codegen_1$s.and)((0,codegen_1$s._)`typeof ${e} == "number"`,j,s?(0,codegen_1$s._)`isFinite(${e})`:codegen_1$s.nil)}}dataType.checkDataType=checkDataType;function checkDataTypes(i,e,s,c){if(i.length===1)return checkDataType(i[0],e,s,c);let h;const $=(0,util_1$q.toHash)(i);if($.array&&$.object){const _=(0,codegen_1$s._)`typeof ${e} != "object"`;h=$.null?_:(0,codegen_1$s._)`!${e} || ${_}`,delete $.null,delete $.array,delete $.object}else h=codegen_1$s.nil;$.number&&delete $.integer;for(const _ in $)h=(0,codegen_1$s.and)(h,checkDataType(_,e,s,c));return h}dataType.checkDataTypes=checkDataTypes;const typeError={message:({schema:i})=>`must be ${i}`,params:({schema:i,schemaValue:e})=>typeof i=="string"?(0,codegen_1$s._)`{type: ${i}}`:(0,codegen_1$s._)`{type: ${e}}`};function reportTypeError(i){const e=getTypeErrorContext(i);(0,errors_1$2.reportError)(e,typeError)}dataType.reportTypeError=reportTypeError;function getTypeErrorContext(i){const{gen:e,data:s,schema:c}=i,h=(0,util_1$q.schemaRefOrVal)(i,c,"type");return{gen:e,keyword:"type",data:s,schema:c.type,schemaCode:h,schemaValue:h,parentSchema:c,params:{},it:i}}var defaults={};Object.defineProperty(defaults,"__esModule",{value:!0}),defaults.assignDefaults=void 0;const codegen_1$r=codegen,util_1$p=util;function assignDefaults(i,e){const{properties:s,items:c}=i.schema;if(e==="object"&&s)for(const h in s)assignDefault(i,h,s[h].default);else e==="array"&&Array.isArray(c)&&c.forEach((h,$)=>assignDefault(i,$,h.default))}defaults.assignDefaults=assignDefaults;function assignDefault(i,e,s){const{gen:c,compositeRule:h,data:$,opts:_}=i;if(s===void 0)return;const j=(0,codegen_1$r._)`${$}${(0,codegen_1$r.getProperty)(e)}`;if(h){(0,util_1$p.checkStrictMode)(i,`default is ignored for: ${j}`);return}let nt=(0,codegen_1$r._)`${j} === undefined`;_.useDefaults==="empty"&&(nt=(0,codegen_1$r._)`${nt} || ${j} === null || ${j} === ""`),c.if(nt,(0,codegen_1$r._)`${j} = ${(0,codegen_1$r.stringify)(s)}`)}var keyword={},code={};Object.defineProperty(code,"__esModule",{value:!0}),code.validateUnion=code.validateArray=code.usePattern=code.callValidateCode=code.schemaProperties=code.allSchemaProperties=code.noPropertyInData=code.propertyInData=code.isOwnProperty=code.hasPropFunc=code.reportMissingProp=code.checkMissingProp=code.checkReportMissingProp=void 0;const codegen_1$q=codegen,util_1$o=util,names_1$5=names$1,util_2$1=util;function checkReportMissingProp(i,e){const{gen:s,data:c,it:h}=i;s.if(noPropertyInData(s,c,e,h.opts.ownProperties),()=>{i.setParams({missingProperty:(0,codegen_1$q._)`${e}`},!0),i.error()})}code.checkReportMissingProp=checkReportMissingProp;function checkMissingProp({gen:i,data:e,it:{opts:s}},c,h){return(0,codegen_1$q.or)(...c.map($=>(0,codegen_1$q.and)(noPropertyInData(i,e,$,s.ownProperties),(0,codegen_1$q._)`${h} = ${$}`)))}code.checkMissingProp=checkMissingProp;function reportMissingProp(i,e){i.setParams({missingProperty:e},!0),i.error()}code.reportMissingProp=reportMissingProp;function hasPropFunc(i){return i.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,codegen_1$q._)`Object.prototype.hasOwnProperty`})}code.hasPropFunc=hasPropFunc;function isOwnProperty(i,e,s){return(0,codegen_1$q._)`${hasPropFunc(i)}.call(${e}, ${s})`}code.isOwnProperty=isOwnProperty;function propertyInData(i,e,s,c){const h=(0,codegen_1$q._)`${e}${(0,codegen_1$q.getProperty)(s)} !== undefined`;return c?(0,codegen_1$q._)`${h} && ${isOwnProperty(i,e,s)}`:h}code.propertyInData=propertyInData;function noPropertyInData(i,e,s,c){const h=(0,codegen_1$q._)`${e}${(0,codegen_1$q.getProperty)(s)} === undefined`;return c?(0,codegen_1$q.or)(h,(0,codegen_1$q.not)(isOwnProperty(i,e,s))):h}code.noPropertyInData=noPropertyInData;function allSchemaProperties(i){return i?Object.keys(i).filter(e=>e!=="__proto__"):[]}code.allSchemaProperties=allSchemaProperties;function schemaProperties(i,e){return allSchemaProperties(e).filter(s=>!(0,util_1$o.alwaysValidSchema)(i,e[s]))}code.schemaProperties=schemaProperties;function callValidateCode({schemaCode:i,data:e,it:{gen:s,topSchemaRef:c,schemaPath:h,errorPath:$},it:_},j,nt,et){const b=et?(0,codegen_1$q._)`${i}, ${e}, ${c}${h}`:e,a=[[names_1$5.default.instancePath,(0,codegen_1$q.strConcat)(names_1$5.default.instancePath,$)],[names_1$5.default.parentData,_.parentData],[names_1$5.default.parentDataProperty,_.parentDataProperty],[names_1$5.default.rootData,names_1$5.default.rootData]];_.opts.dynamicRef&&a.push([names_1$5.default.dynamicAnchors,names_1$5.default.dynamicAnchors]);const o=(0,codegen_1$q._)`${b}, ${s.object(...a)}`;return nt!==codegen_1$q.nil?(0,codegen_1$q._)`${j}.call(${nt}, ${o})`:(0,codegen_1$q._)`${j}(${o})`}code.callValidateCode=callValidateCode;const newRegExp=(0,codegen_1$q._)`new RegExp`;function usePattern({gen:i,it:{opts:e}},s){const c=e.unicodeRegExp?"u":"",{regExp:h}=e.code,$=h(s,c);return i.scopeValue("pattern",{key:$.toString(),ref:$,code:(0,codegen_1$q._)`${h.code==="new RegExp"?newRegExp:(0,util_2$1.useFunc)(i,h)}(${s}, ${c})`})}code.usePattern=usePattern;function validateArray(i){const{gen:e,data:s,keyword:c,it:h}=i,$=e.name("valid");if(h.allErrors){const j=e.let("valid",!0);return _(()=>e.assign(j,!1)),j}return e.var($,!0),_(()=>e.break()),$;function _(j){const nt=e.const("len",(0,codegen_1$q._)`${s}.length`);e.forRange("i",0,nt,et=>{i.subschema({keyword:c,dataProp:et,dataPropType:util_1$o.Type.Num},$),e.if((0,codegen_1$q.not)($),j)})}}code.validateArray=validateArray;function validateUnion(i){const{gen:e,schema:s,keyword:c,it:h}=i;if(!Array.isArray(s))throw new Error("ajv implementation error");if(s.some(nt=>(0,util_1$o.alwaysValidSchema)(h,nt))&&!h.opts.unevaluated)return;const _=e.let("valid",!1),j=e.name("_valid");e.block(()=>s.forEach((nt,et)=>{const b=i.subschema({keyword:c,schemaProp:et,compositeRule:!0},j);e.assign(_,(0,codegen_1$q._)`${_} || ${j}`),i.mergeValidEvaluated(b,j)||e.if((0,codegen_1$q.not)(_))})),i.result(_,()=>i.reset(),()=>i.error(!0))}code.validateUnion=validateUnion,Object.defineProperty(keyword,"__esModule",{value:!0}),keyword.validateKeywordUsage=keyword.validSchemaType=keyword.funcKeywordCode=keyword.macroKeywordCode=void 0;const codegen_1$p=codegen,names_1$4=names$1,code_1$9=code,errors_1$1=errors;function macroKeywordCode(i,e){const{gen:s,keyword:c,schema:h,parentSchema:$,it:_}=i,j=e.macro.call(_.self,h,$,_),nt=useKeyword(s,c,j);_.opts.validateSchema!==!1&&_.self.validateSchema(j,!0);const et=s.name("valid");i.subschema({schema:j,schemaPath:codegen_1$p.nil,errSchemaPath:`${_.errSchemaPath}/${c}`,topSchemaRef:nt,compositeRule:!0},et),i.pass(et,()=>i.error(!0))}keyword.macroKeywordCode=macroKeywordCode;function funcKeywordCode(i,e){var s;const{gen:c,keyword:h,schema:$,parentSchema:_,$data:j,it:nt}=i;checkAsyncKeyword(nt,e);const et=!j&&e.compile?e.compile.call(nt.self,$,_,nt):e.validate,b=useKeyword(c,h,et),a=c.let("valid");i.block$data(a,o),i.ok((s=e.valid)!==null&&s!==void 0?s:a);function o(){if(e.errors===!1)rt(),e.modifying&&modifyData(i),st(()=>i.error());else{const tt=e.async?d():g();e.modifying&&modifyData(i),st(()=>addErrs(i,tt))}}function d(){const tt=c.let("ruleErrs",null);return c.try(()=>rt((0,codegen_1$p._)`await `),ot=>c.assign(a,!1).if((0,codegen_1$p._)`${ot} instanceof ${nt.ValidationError}`,()=>c.assign(tt,(0,codegen_1$p._)`${ot}.errors`),()=>c.throw(ot))),tt}function g(){const tt=(0,codegen_1$p._)`${b}.errors`;return c.assign(tt,null),rt(codegen_1$p.nil),tt}function rt(tt=e.async?(0,codegen_1$p._)`await `:codegen_1$p.nil){const ot=nt.opts.passContext?names_1$4.default.this:names_1$4.default.self,it=!("compile"in e&&!j||e.schema===!1);c.assign(a,(0,codegen_1$p._)`${tt}${(0,code_1$9.callValidateCode)(i,b,ot,it)}`,e.modifying)}function st(tt){var ot;c.if((0,codegen_1$p.not)((ot=e.valid)!==null&&ot!==void 0?ot:a),tt)}}keyword.funcKeywordCode=funcKeywordCode;function modifyData(i){const{gen:e,data:s,it:c}=i;e.if(c.parentData,()=>e.assign(s,(0,codegen_1$p._)`${c.parentData}[${c.parentDataProperty}]`))}function addErrs(i,e){const{gen:s}=i;s.if((0,codegen_1$p._)`Array.isArray(${e})`,()=>{s.assign(names_1$4.default.vErrors,(0,codegen_1$p._)`${names_1$4.default.vErrors} === null ? ${e} : ${names_1$4.default.vErrors}.concat(${e})`).assign(names_1$4.default.errors,(0,codegen_1$p._)`${names_1$4.default.vErrors}.length`),(0,errors_1$1.extendErrors)(i)},()=>i.error())}function checkAsyncKeyword({schemaEnv:i},e){if(e.async&&!i.$async)throw new Error("async keyword in sync schema")}function useKeyword(i,e,s){if(s===void 0)throw new Error(`keyword "${e}" failed to compile`);return i.scopeValue("keyword",typeof s=="function"?{ref:s}:{ref:s,code:(0,codegen_1$p.stringify)(s)})}function validSchemaType(i,e,s=!1){return!e.length||e.some(c=>c==="array"?Array.isArray(i):c==="object"?i&&typeof i=="object"&&!Array.isArray(i):typeof i==c||s&&typeof i>"u")}keyword.validSchemaType=validSchemaType;function validateKeywordUsage({schema:i,opts:e,self:s,errSchemaPath:c},h,$){if(Array.isArray(h.keyword)?!h.keyword.includes($):h.keyword!==$)throw new Error("ajv implementation error");const _=h.dependencies;if(_!=null&&_.some(j=>!Object.prototype.hasOwnProperty.call(i,j)))throw new Error(`parent schema must have dependencies of ${$}: ${_.join(",")}`);if(h.validateSchema&&!h.validateSchema(i[$])){const nt=`keyword "${$}" value is invalid at path "${c}": `+s.errorsText(h.validateSchema.errors);if(e.validateSchema==="log")s.logger.error(nt);else throw new Error(nt)}}keyword.validateKeywordUsage=validateKeywordUsage;var subschema={};Object.defineProperty(subschema,"__esModule",{value:!0}),subschema.extendSubschemaMode=subschema.extendSubschemaData=subschema.getSubschema=void 0;const codegen_1$o=codegen,util_1$n=util;function getSubschema(i,{keyword:e,schemaProp:s,schema:c,schemaPath:h,errSchemaPath:$,topSchemaRef:_}){if(e!==void 0&&c!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){const j=i.schema[e];return s===void 0?{schema:j,schemaPath:(0,codegen_1$o._)`${i.schemaPath}${(0,codegen_1$o.getProperty)(e)}`,errSchemaPath:`${i.errSchemaPath}/${e}`}:{schema:j[s],schemaPath:(0,codegen_1$o._)`${i.schemaPath}${(0,codegen_1$o.getProperty)(e)}${(0,codegen_1$o.getProperty)(s)}`,errSchemaPath:`${i.errSchemaPath}/${e}/${(0,util_1$n.escapeFragment)(s)}`}}if(c!==void 0){if(h===void 0||$===void 0||_===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:c,schemaPath:h,topSchemaRef:_,errSchemaPath:$}}throw new Error('either "keyword" or "schema" must be passed')}subschema.getSubschema=getSubschema;function extendSubschemaData(i,e,{dataProp:s,dataPropType:c,data:h,dataTypes:$,propertyName:_}){if(h!==void 0&&s!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:j}=e;if(s!==void 0){const{errorPath:et,dataPathArr:b,opts:a}=e,o=j.let("data",(0,codegen_1$o._)`${e.data}${(0,codegen_1$o.getProperty)(s)}`,!0);nt(o),i.errorPath=(0,codegen_1$o.str)`${et}${(0,util_1$n.getErrorPath)(s,c,a.jsPropertySyntax)}`,i.parentDataProperty=(0,codegen_1$o._)`${s}`,i.dataPathArr=[...b,i.parentDataProperty]}if(h!==void 0){const et=h instanceof codegen_1$o.Name?h:j.let("data",h,!0);nt(et),_!==void 0&&(i.propertyName=_)}$&&(i.dataTypes=$);function nt(et){i.data=et,i.dataLevel=e.dataLevel+1,i.dataTypes=[],e.definedProperties=new Set,i.parentData=e.data,i.dataNames=[...e.dataNames,et]}}subschema.extendSubschemaData=extendSubschemaData;function extendSubschemaMode(i,{jtdDiscriminator:e,jtdMetadata:s,compositeRule:c,createErrors:h,allErrors:$}){c!==void 0&&(i.compositeRule=c),h!==void 0&&(i.createErrors=h),$!==void 0&&(i.allErrors=$),i.jtdDiscriminator=e,i.jtdMetadata=s}subschema.extendSubschemaMode=extendSubschemaMode;var resolve$2={},fastDeepEqual=function i(e,s){if(e===s)return!0;if(e&&s&&typeof e=="object"&&typeof s=="object"){if(e.constructor!==s.constructor)return!1;var c,h,$;if(Array.isArray(e)){if(c=e.length,c!=s.length)return!1;for(h=c;h--!==0;)if(!i(e[h],s[h]))return!1;return!0}if(e.constructor===RegExp)return e.source===s.source&&e.flags===s.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===s.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===s.toString();if($=Object.keys(e),c=$.length,c!==Object.keys(s).length)return!1;for(h=c;h--!==0;)if(!Object.prototype.hasOwnProperty.call(s,$[h]))return!1;for(h=c;h--!==0;){var _=$[h];if(!i(e[_],s[_]))return!1}return!0}return e!==e&&s!==s},jsonSchemaTraverse={exports:{}},traverse$1=jsonSchemaTraverse.exports=function(i,e,s){typeof e=="function"&&(s=e,e={}),s=e.cb||s;var c=typeof s=="function"?s:s.pre||function(){},h=s.post||function(){};_traverse(e,c,h,i,"",i)};traverse$1.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},traverse$1.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},traverse$1.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},traverse$1.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function _traverse(i,e,s,c,h,$,_,j,nt,et){if(c&&typeof c=="object"&&!Array.isArray(c)){e(c,h,$,_,j,nt,et);for(var b in c){var a=c[b];if(Array.isArray(a)){if(b in traverse$1.arrayKeywords)for(var o=0;o<a.length;o++)_traverse(i,e,s,a[o],h+"/"+b+"/"+o,$,h,b,c,o)}else if(b in traverse$1.propsKeywords){if(a&&typeof a=="object")for(var d in a)_traverse(i,e,s,a[d],h+"/"+b+"/"+escapeJsonPtr(d),$,h,b,c,d)}else(b in traverse$1.keywords||i.allKeys&&!(b in traverse$1.skipKeywords))&&_traverse(i,e,s,a,h+"/"+b,$,h,b,c)}s(c,h,$,_,j,nt,et)}}function escapeJsonPtr(i){return i.replace(/~/g,"~0").replace(/\//g,"~1")}var jsonSchemaTraverseExports=jsonSchemaTraverse.exports;Object.defineProperty(resolve$2,"__esModule",{value:!0}),resolve$2.getSchemaRefs=resolve$2.resolveUrl=resolve$2.normalizeId=resolve$2._getFullPath=resolve$2.getFullPath=resolve$2.inlineRef=void 0;const util_1$m=util,equal$3=fastDeepEqual,traverse=jsonSchemaTraverseExports,SIMPLE_INLINED=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function inlineRef(i,e=!0){return typeof i=="boolean"?!0:e===!0?!hasRef(i):e?countKeys(i)<=e:!1}resolve$2.inlineRef=inlineRef;const REF_KEYWORDS=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function hasRef(i){for(const e in i){if(REF_KEYWORDS.has(e))return!0;const s=i[e];if(Array.isArray(s)&&s.some(hasRef)||typeof s=="object"&&hasRef(s))return!0}return!1}function countKeys(i){let e=0;for(const s in i){if(s==="$ref")return 1/0;if(e++,!SIMPLE_INLINED.has(s)&&(typeof i[s]=="object"&&(0,util_1$m.eachItem)(i[s],c=>e+=countKeys(c)),e===1/0))return 1/0}return e}function getFullPath(i,e="",s){s!==!1&&(e=normalizeId(e));const c=i.parse(e);return _getFullPath(i,c)}resolve$2.getFullPath=getFullPath;function _getFullPath(i,e){return i.serialize(e).split("#")[0]+"#"}resolve$2._getFullPath=_getFullPath;const TRAILING_SLASH_HASH=/#\/?$/;function normalizeId(i){return i?i.replace(TRAILING_SLASH_HASH,""):""}resolve$2.normalizeId=normalizeId;function resolveUrl(i,e,s){return s=normalizeId(s),i.resolve(e,s)}resolve$2.resolveUrl=resolveUrl;const ANCHOR=/^[a-z_][-a-z0-9._]*$/i;function getSchemaRefs(i,e){if(typeof i=="boolean")return{};const{schemaId:s,uriResolver:c}=this.opts,h=normalizeId(i[s]||e),$={"":h},_=getFullPath(c,h,!1),j={},nt=new Set;return traverse(i,{allKeys:!0},(a,o,d,g)=>{if(g===void 0)return;const rt=_+o;let st=$[g];typeof a[s]=="string"&&(st=tt.call(this,a[s])),ot.call(this,a.$anchor),ot.call(this,a.$dynamicAnchor),$[o]=st;function tt(it){const at=this.opts.uriResolver.resolve;if(it=normalizeId(st?at(st,it):it),nt.has(it))throw b(it);nt.add(it);let ut=this.refs[it];return typeof ut=="string"&&(ut=this.refs[ut]),typeof ut=="object"?et(a,ut.schema,it):it!==normalizeId(rt)&&(it[0]==="#"?(et(a,j[it],it),j[it]=a):this.refs[it]=rt),it}function ot(it){if(typeof it=="string"){if(!ANCHOR.test(it))throw new Error(`invalid anchor "${it}"`);tt.call(this,`#${it}`)}}}),j;function et(a,o,d){if(o!==void 0&&!equal$3(a,o))throw b(d)}function b(a){return new Error(`reference "${a}" resolves to more than one schema`)}}resolve$2.getSchemaRefs=getSchemaRefs,Object.defineProperty(validate,"__esModule",{value:!0}),validate.getData=validate.KeywordCxt=validate.validateFunctionCode=void 0;const boolSchema_1=boolSchema,dataType_1$1=dataType,applicability_1=applicability,dataType_2=dataType,defaults_1=defaults,keyword_1=keyword,subschema_1=subschema,codegen_1$n=codegen,names_1$3=names$1,resolve_1$2=resolve$2,util_1$l=util,errors_1=errors;function validateFunctionCode(i){if(isSchemaObj(i)&&(checkKeywords(i),schemaCxtHasRules(i))){topSchemaObjCode(i);return}validateFunction(i,()=>(0,boolSchema_1.topBoolOrEmptySchema)(i))}validate.validateFunctionCode=validateFunctionCode;function validateFunction({gen:i,validateName:e,schema:s,schemaEnv:c,opts:h},$){h.code.es5?i.func(e,(0,codegen_1$n._)`${names_1$3.default.data}, ${names_1$3.default.valCxt}`,c.$async,()=>{i.code((0,codegen_1$n._)`"use strict"; ${funcSourceUrl(s,h)}`),destructureValCxtES5(i,h),i.code($)}):i.func(e,(0,codegen_1$n._)`${names_1$3.default.data}, ${destructureValCxt(h)}`,c.$async,()=>i.code(funcSourceUrl(s,h)).code($))}function destructureValCxt(i){return(0,codegen_1$n._)`{${names_1$3.default.instancePath}="", ${names_1$3.default.parentData}, ${names_1$3.default.parentDataProperty}, ${names_1$3.default.rootData}=${names_1$3.default.data}${i.dynamicRef?(0,codegen_1$n._)`, ${names_1$3.default.dynamicAnchors}={}`:codegen_1$n.nil}}={}`}function destructureValCxtES5(i,e){i.if(names_1$3.default.valCxt,()=>{i.var(names_1$3.default.instancePath,(0,codegen_1$n._)`${names_1$3.default.valCxt}.${names_1$3.default.instancePath}`),i.var(names_1$3.default.parentData,(0,codegen_1$n._)`${names_1$3.default.valCxt}.${names_1$3.default.parentData}`),i.var(names_1$3.default.parentDataProperty,(0,codegen_1$n._)`${names_1$3.default.valCxt}.${names_1$3.default.parentDataProperty}`),i.var(names_1$3.default.rootData,(0,codegen_1$n._)`${names_1$3.default.valCxt}.${names_1$3.default.rootData}`),e.dynamicRef&&i.var(names_1$3.default.dynamicAnchors,(0,codegen_1$n._)`${names_1$3.default.valCxt}.${names_1$3.default.dynamicAnchors}`)},()=>{i.var(names_1$3.default.instancePath,(0,codegen_1$n._)`""`),i.var(names_1$3.default.parentData,(0,codegen_1$n._)`undefined`),i.var(names_1$3.default.parentDataProperty,(0,codegen_1$n._)`undefined`),i.var(names_1$3.default.rootData,names_1$3.default.data),e.dynamicRef&&i.var(names_1$3.default.dynamicAnchors,(0,codegen_1$n._)`{}`)})}function topSchemaObjCode(i){const{schema:e,opts:s,gen:c}=i;validateFunction(i,()=>{s.$comment&&e.$comment&&commentKeyword(i),checkNoDefault(i),c.let(names_1$3.default.vErrors,null),c.let(names_1$3.default.errors,0),s.unevaluated&&resetEvaluated(i),typeAndKeywords(i),returnResults(i)})}function resetEvaluated(i){const{gen:e,validateName:s}=i;i.evaluated=e.const("evaluated",(0,codegen_1$n._)`${s}.evaluated`),e.if((0,codegen_1$n._)`${i.evaluated}.dynamicProps`,()=>e.assign((0,codegen_1$n._)`${i.evaluated}.props`,(0,codegen_1$n._)`undefined`)),e.if((0,codegen_1$n._)`${i.evaluated}.dynamicItems`,()=>e.assign((0,codegen_1$n._)`${i.evaluated}.items`,(0,codegen_1$n._)`undefined`))}function funcSourceUrl(i,e){const s=typeof i=="object"&&i[e.schemaId];return s&&(e.code.source||e.code.process)?(0,codegen_1$n._)`/*# sourceURL=${s} */`:codegen_1$n.nil}function subschemaCode(i,e){if(isSchemaObj(i)&&(checkKeywords(i),schemaCxtHasRules(i))){subSchemaObjCode(i,e);return}(0,boolSchema_1.boolOrEmptySchema)(i,e)}function schemaCxtHasRules({schema:i,self:e}){if(typeof i=="boolean")return!i;for(const s in i)if(e.RULES.all[s])return!0;return!1}function isSchemaObj(i){return typeof i.schema!="boolean"}function subSchemaObjCode(i,e){const{schema:s,gen:c,opts:h}=i;h.$comment&&s.$comment&&commentKeyword(i),updateContext(i),checkAsyncSchema(i);const $=c.const("_errs",names_1$3.default.errors);typeAndKeywords(i,$),c.var(e,(0,codegen_1$n._)`${$} === ${names_1$3.default.errors}`)}function checkKeywords(i){(0,util_1$l.checkUnknownRules)(i),checkRefsAndKeywords(i)}function typeAndKeywords(i,e){if(i.opts.jtd)return schemaKeywords(i,[],!1,e);const s=(0,dataType_1$1.getSchemaTypes)(i.schema),c=(0,dataType_1$1.coerceAndCheckDataType)(i,s);schemaKeywords(i,s,!c,e)}function checkRefsAndKeywords(i){const{schema:e,errSchemaPath:s,opts:c,self:h}=i;e.$ref&&c.ignoreKeywordsWithRef&&(0,util_1$l.schemaHasRulesButRef)(e,h.RULES)&&h.logger.warn(`$ref: keywords ignored in schema at path "${s}"`)}function checkNoDefault(i){const{schema:e,opts:s}=i;e.default!==void 0&&s.useDefaults&&s.strictSchema&&(0,util_1$l.checkStrictMode)(i,"default is ignored in the schema root")}function updateContext(i){const e=i.schema[i.opts.schemaId];e&&(i.baseId=(0,resolve_1$2.resolveUrl)(i.opts.uriResolver,i.baseId,e))}function checkAsyncSchema(i){if(i.schema.$async&&!i.schemaEnv.$async)throw new Error("async schema in sync schema")}function commentKeyword({gen:i,schemaEnv:e,schema:s,errSchemaPath:c,opts:h}){const $=s.$comment;if(h.$comment===!0)i.code((0,codegen_1$n._)`${names_1$3.default.self}.logger.log(${$})`);else if(typeof h.$comment=="function"){const _=(0,codegen_1$n.str)`${c}/$comment`,j=i.scopeValue("root",{ref:e.root});i.code((0,codegen_1$n._)`${names_1$3.default.self}.opts.$comment(${$}, ${_}, ${j}.schema)`)}}function returnResults(i){const{gen:e,schemaEnv:s,validateName:c,ValidationError:h,opts:$}=i;s.$async?e.if((0,codegen_1$n._)`${names_1$3.default.errors} === 0`,()=>e.return(names_1$3.default.data),()=>e.throw((0,codegen_1$n._)`new ${h}(${names_1$3.default.vErrors})`)):(e.assign((0,codegen_1$n._)`${c}.errors`,names_1$3.default.vErrors),$.unevaluated&&assignEvaluated(i),e.return((0,codegen_1$n._)`${names_1$3.default.errors} === 0`))}function assignEvaluated({gen:i,evaluated:e,props:s,items:c}){s instanceof codegen_1$n.Name&&i.assign((0,codegen_1$n._)`${e}.props`,s),c instanceof codegen_1$n.Name&&i.assign((0,codegen_1$n._)`${e}.items`,c)}function schemaKeywords(i,e,s,c){const{gen:h,schema:$,data:_,allErrors:j,opts:nt,self:et}=i,{RULES:b}=et;if($.$ref&&(nt.ignoreKeywordsWithRef||!(0,util_1$l.schemaHasRulesButRef)($,b))){h.block(()=>keywordCode(i,"$ref",b.all.$ref.definition));return}nt.jtd||checkStrictTypes(i,e),h.block(()=>{for(const o of b.rules)a(o);a(b.post)});function a(o){(0,applicability_1.shouldUseGroup)($,o)&&(o.type?(h.if((0,dataType_2.checkDataType)(o.type,_,nt.strictNumbers)),iterateKeywords(i,o),e.length===1&&e[0]===o.type&&s&&(h.else(),(0,dataType_2.reportTypeError)(i)),h.endIf()):iterateKeywords(i,o),j||h.if((0,codegen_1$n._)`${names_1$3.default.errors} === ${c||0}`))}}function iterateKeywords(i,e){const{gen:s,schema:c,opts:{useDefaults:h}}=i;h&&(0,defaults_1.assignDefaults)(i,e.type),s.block(()=>{for(const $ of e.rules)(0,applicability_1.shouldUseRule)(c,$)&&keywordCode(i,$.keyword,$.definition,e.type)})}function checkStrictTypes(i,e){i.schemaEnv.meta||!i.opts.strictTypes||(checkContextTypes(i,e),i.opts.allowUnionTypes||checkMultipleTypes(i,e),checkKeywordTypes(i,i.dataTypes))}function checkContextTypes(i,e){if(e.length){if(!i.dataTypes.length){i.dataTypes=e;return}e.forEach(s=>{includesType(i.dataTypes,s)||strictTypesError(i,`type "${s}" not allowed by context "${i.dataTypes.join(",")}"`)}),narrowSchemaTypes(i,e)}}function checkMultipleTypes(i,e){e.length>1&&!(e.length===2&&e.includes("null"))&&strictTypesError(i,"use allowUnionTypes to allow union type keyword")}function checkKeywordTypes(i,e){const s=i.self.RULES.all;for(const c in s){const h=s[c];if(typeof h=="object"&&(0,applicability_1.shouldUseRule)(i.schema,h)){const{type:$}=h.definition;$.length&&!$.some(_=>hasApplicableType(e,_))&&strictTypesError(i,`missing type "${$.join(",")}" for keyword "${c}"`)}}}function hasApplicableType(i,e){return i.includes(e)||e==="number"&&i.includes("integer")}function includesType(i,e){return i.includes(e)||e==="integer"&&i.includes("number")}function narrowSchemaTypes(i,e){const s=[];for(const c of i.dataTypes)includesType(e,c)?s.push(c):e.includes("integer")&&c==="number"&&s.push("integer");i.dataTypes=s}function strictTypesError(i,e){const s=i.schemaEnv.baseId+i.errSchemaPath;e+=` at "${s}" (strictTypes)`,(0,util_1$l.checkStrictMode)(i,e,i.opts.strictTypes)}class KeywordCxt{constructor(e,s,c){if((0,keyword_1.validateKeywordUsage)(e,s,c),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=c,this.data=e.data,this.schema=e.schema[c],this.$data=s.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,util_1$l.schemaRefOrVal)(e,this.schema,c,this.$data),this.schemaType=s.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=s,this.$data)this.schemaCode=e.gen.const("vSchema",getData(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,keyword_1.validSchemaType)(this.schema,s.schemaType,s.allowUndefined))throw new Error(`${c} value must be ${JSON.stringify(s.schemaType)}`);("code"in s?s.trackErrors:s.errors!==!1)&&(this.errsCount=e.gen.const("_errs",names_1$3.default.errors))}result(e,s,c){this.failResult((0,codegen_1$n.not)(e),s,c)}failResult(e,s,c){this.gen.if(e),c?c():this.error(),s?(this.gen.else(),s(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,s){this.failResult((0,codegen_1$n.not)(e),void 0,s)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);const{schemaCode:s}=this;this.fail((0,codegen_1$n._)`${s} !== undefined && (${(0,codegen_1$n.or)(this.invalid$data(),e)})`)}error(e,s,c){if(s){this.setParams(s),this._error(e,c),this.setParams({});return}this._error(e,c)}_error(e,s){(e?errors_1.reportExtraError:errors_1.reportError)(this,this.def.error,s)}$dataError(){(0,errors_1.reportError)(this,this.def.$dataError||errors_1.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,errors_1.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,s){s?Object.assign(this.params,e):this.params=e}block$data(e,s,c=codegen_1$n.nil){this.gen.block(()=>{this.check$data(e,c),s()})}check$data(e=codegen_1$n.nil,s=codegen_1$n.nil){if(!this.$data)return;const{gen:c,schemaCode:h,schemaType:$,def:_}=this;c.if((0,codegen_1$n.or)((0,codegen_1$n._)`${h} === undefined`,s)),e!==codegen_1$n.nil&&c.assign(e,!0),($.length||_.validateSchema)&&(c.elseIf(this.invalid$data()),this.$dataError(),e!==codegen_1$n.nil&&c.assign(e,!1)),c.else()}invalid$data(){const{gen:e,schemaCode:s,schemaType:c,def:h,it:$}=this;return(0,codegen_1$n.or)(_(),j());function _(){if(c.length){if(!(s instanceof codegen_1$n.Name))throw new Error("ajv implementation error");const nt=Array.isArray(c)?c:[c];return(0,codegen_1$n._)`${(0,dataType_2.checkDataTypes)(nt,s,$.opts.strictNumbers,dataType_2.DataType.Wrong)}`}return codegen_1$n.nil}function j(){if(h.validateSchema){const nt=e.scopeValue("validate$data",{ref:h.validateSchema});return(0,codegen_1$n._)`!${nt}(${s})`}return codegen_1$n.nil}}subschema(e,s){const c=(0,subschema_1.getSubschema)(this.it,e);(0,subschema_1.extendSubschemaData)(c,this.it,e),(0,subschema_1.extendSubschemaMode)(c,e);const h={...this.it,...c,items:void 0,props:void 0};return subschemaCode(h,s),h}mergeEvaluated(e,s){const{it:c,gen:h}=this;c.opts.unevaluated&&(c.props!==!0&&e.props!==void 0&&(c.props=util_1$l.mergeEvaluated.props(h,e.props,c.props,s)),c.items!==!0&&e.items!==void 0&&(c.items=util_1$l.mergeEvaluated.items(h,e.items,c.items,s)))}mergeValidEvaluated(e,s){const{it:c,gen:h}=this;if(c.opts.unevaluated&&(c.props!==!0||c.items!==!0))return h.if(s,()=>this.mergeEvaluated(e,codegen_1$n.Name)),!0}}validate.KeywordCxt=KeywordCxt;function keywordCode(i,e,s,c){const h=new KeywordCxt(i,s,e);"code"in s?s.code(h,c):h.$data&&s.validate?(0,keyword_1.funcKeywordCode)(h,s):"macro"in s?(0,keyword_1.macroKeywordCode)(h,s):(s.compile||s.validate)&&(0,keyword_1.funcKeywordCode)(h,s)}const JSON_POINTER=/^\/(?:[^~]|~0|~1)*$/,RELATIVE_JSON_POINTER=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function getData(i,{dataLevel:e,dataNames:s,dataPathArr:c}){let h,$;if(i==="")return names_1$3.default.rootData;if(i[0]==="/"){if(!JSON_POINTER.test(i))throw new Error(`Invalid JSON-pointer: ${i}`);h=i,$=names_1$3.default.rootData}else{const et=RELATIVE_JSON_POINTER.exec(i);if(!et)throw new Error(`Invalid JSON-pointer: ${i}`);const b=+et[1];if(h=et[2],h==="#"){if(b>=e)throw new Error(nt("property/index",b));return c[e-b]}if(b>e)throw new Error(nt("data",b));if($=s[e-b],!h)return $}let _=$;const j=h.split("/");for(const et of j)et&&($=(0,codegen_1$n._)`${$}${(0,codegen_1$n.getProperty)((0,util_1$l.unescapeJsonPointer)(et))}`,_=(0,codegen_1$n._)`${_} && ${$}`);return _;function nt(et,b){return`Cannot access ${et} ${b} levels up, current level is ${e}`}}validate.getData=getData;var validation_error={};Object.defineProperty(validation_error,"__esModule",{value:!0});let ValidationError$1=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};validation_error.default=ValidationError$1;var ref_error={};Object.defineProperty(ref_error,"__esModule",{value:!0});const resolve_1$1=resolve$2;class MissingRefError extends Error{constructor(e,s,c,h){super(h||`can't resolve reference ${c} from id ${s}`),this.missingRef=(0,resolve_1$1.resolveUrl)(e,s,c),this.missingSchema=(0,resolve_1$1.normalizeId)((0,resolve_1$1.getFullPath)(e,this.missingRef))}}ref_error.default=MissingRefError;var compile={};Object.defineProperty(compile,"__esModule",{value:!0}),compile.resolveSchema=compile.getCompilingSchema=compile.resolveRef=compile.compileSchema=compile.SchemaEnv=void 0;const codegen_1$m=codegen,validation_error_1=validation_error,names_1$2=names$1,resolve_1=resolve$2,util_1$k=util,validate_1$1=validate;class SchemaEnv{constructor(e){var s;this.refs={},this.dynamicAnchors={};let c;typeof e.schema=="object"&&(c=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(s=e.baseId)!==null&&s!==void 0?s:(0,resolve_1.normalizeId)(c==null?void 0:c[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=c==null?void 0:c.$async,this.refs={}}}compile.SchemaEnv=SchemaEnv;function compileSchema(i){const e=getCompilingSchema.call(this,i);if(e)return e;const s=(0,resolve_1.getFullPath)(this.opts.uriResolver,i.root.baseId),{es5:c,lines:h}=this.opts.code,{ownProperties:$}=this.opts,_=new codegen_1$m.CodeGen(this.scope,{es5:c,lines:h,ownProperties:$});let j;i.$async&&(j=_.scopeValue("Error",{ref:validation_error_1.default,code:(0,codegen_1$m._)`require("ajv/dist/runtime/validation_error").default`}));const nt=_.scopeName("validate");i.validateName=nt;const et={gen:_,allErrors:this.opts.allErrors,data:names_1$2.default.data,parentData:names_1$2.default.parentData,parentDataProperty:names_1$2.default.parentDataProperty,dataNames:[names_1$2.default.data],dataPathArr:[codegen_1$m.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:_.scopeValue("schema",this.opts.code.source===!0?{ref:i.schema,code:(0,codegen_1$m.stringify)(i.schema)}:{ref:i.schema}),validateName:nt,ValidationError:j,schema:i.schema,schemaEnv:i,rootId:s,baseId:i.baseId||s,schemaPath:codegen_1$m.nil,errSchemaPath:i.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,codegen_1$m._)`""`,opts:this.opts,self:this};let b;try{this._compilations.add(i),(0,validate_1$1.validateFunctionCode)(et),_.optimize(this.opts.code.optimize);const a=_.toString();b=`${_.scopeRefs(names_1$2.default.scope)}return ${a}`,this.opts.code.process&&(b=this.opts.code.process(b,i));const d=new Function(`${names_1$2.default.self}`,`${names_1$2.default.scope}`,b)(this,this.scope.get());if(this.scope.value(nt,{ref:d}),d.errors=null,d.schema=i.schema,d.schemaEnv=i,i.$async&&(d.$async=!0),this.opts.code.source===!0&&(d.source={validateName:nt,validateCode:a,scopeValues:_._values}),this.opts.unevaluated){const{props:g,items:rt}=et;d.evaluated={props:g instanceof codegen_1$m.Name?void 0:g,items:rt instanceof codegen_1$m.Name?void 0:rt,dynamicProps:g instanceof codegen_1$m.Name,dynamicItems:rt instanceof codegen_1$m.Name},d.source&&(d.source.evaluated=(0,codegen_1$m.stringify)(d.evaluated))}return i.validate=d,i}catch(a){throw delete i.validate,delete i.validateName,b&&this.logger.error("Error compiling schema, function code:",b),a}finally{this._compilations.delete(i)}}compile.compileSchema=compileSchema;function resolveRef(i,e,s){var c;s=(0,resolve_1.resolveUrl)(this.opts.uriResolver,e,s);const h=i.refs[s];if(h)return h;let $=resolve$1.call(this,i,s);if($===void 0){const _=(c=i.localRefs)===null||c===void 0?void 0:c[s],{schemaId:j}=this.opts;_&&($=new SchemaEnv({schema:_,schemaId:j,root:i,baseId:e}))}if($!==void 0)return i.refs[s]=inlineOrCompile.call(this,$)}compile.resolveRef=resolveRef;function inlineOrCompile(i){return(0,resolve_1.inlineRef)(i.schema,this.opts.inlineRefs)?i.schema:i.validate?i:compileSchema.call(this,i)}function getCompilingSchema(i){for(const e of this._compilations)if(sameSchemaEnv(e,i))return e}compile.getCompilingSchema=getCompilingSchema;function sameSchemaEnv(i,e){return i.schema===e.schema&&i.root===e.root&&i.baseId===e.baseId}function resolve$1(i,e){let s;for(;typeof(s=this.refs[e])=="string";)e=s;return s||this.schemas[e]||resolveSchema.call(this,i,e)}function resolveSchema(i,e){const s=this.opts.uriResolver.parse(e),c=(0,resolve_1._getFullPath)(this.opts.uriResolver,s);let h=(0,resolve_1.getFullPath)(this.opts.uriResolver,i.baseId,void 0);if(Object.keys(i.schema).length>0&&c===h)return getJsonPointer.call(this,s,i);const $=(0,resolve_1.normalizeId)(c),_=this.refs[$]||this.schemas[$];if(typeof _=="string"){const j=resolveSchema.call(this,i,_);return typeof(j==null?void 0:j.schema)!="object"?void 0:getJsonPointer.call(this,s,j)}if(typeof(_==null?void 0:_.schema)=="object"){if(_.validate||compileSchema.call(this,_),$===(0,resolve_1.normalizeId)(e)){const{schema:j}=_,{schemaId:nt}=this.opts,et=j[nt];return et&&(h=(0,resolve_1.resolveUrl)(this.opts.uriResolver,h,et)),new SchemaEnv({schema:j,schemaId:nt,root:i,baseId:h})}return getJsonPointer.call(this,s,_)}}compile.resolveSchema=resolveSchema;const PREVENT_SCOPE_CHANGE=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function getJsonPointer(i,{baseId:e,schema:s,root:c}){var h;if(((h=i.fragment)===null||h===void 0?void 0:h[0])!=="/")return;for(const j of i.fragment.slice(1).split("/")){if(typeof s=="boolean")return;const nt=s[(0,util_1$k.unescapeFragment)(j)];if(nt===void 0)return;s=nt;const et=typeof s=="object"&&s[this.opts.schemaId];!PREVENT_SCOPE_CHANGE.has(j)&&et&&(e=(0,resolve_1.resolveUrl)(this.opts.uriResolver,e,et))}let $;if(typeof s!="boolean"&&s.$ref&&!(0,util_1$k.schemaHasRulesButRef)(s,this.RULES)){const j=(0,resolve_1.resolveUrl)(this.opts.uriResolver,e,s.$ref);$=resolveSchema.call(this,c,j)}const{schemaId:_}=this.opts;if($=$||new SchemaEnv({schema:s,schemaId:_,root:c,baseId:e}),$.schema!==$.root.schema)return $}const $id$1="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description="Meta-schema for $data reference (JSON AnySchema extension proposal)",type$1="object",required$1=["$data"],properties$2={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties$1=!1,require$$9={$id:$id$1,description,type:type$1,required:required$1,properties:properties$2,additionalProperties:additionalProperties$1};var uri$1={},fastUri$1={exports:{}};const isUUID$1=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),isIPv4$1=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function stringArrayToHexStripped(i){let e="",s=0,c=0;for(c=0;c<i.length;c++)if(s=i[c].charCodeAt(0),s!==48){if(!(s>=48&&s<=57||s>=65&&s<=70||s>=97&&s<=102))return"";e+=i[c];break}for(c+=1;c<i.length;c++){if(s=i[c].charCodeAt(0),!(s>=48&&s<=57||s>=65&&s<=70||s>=97&&s<=102))return"";e+=i[c]}return e}const nonSimpleDomain$1=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function consumeIsZone(i){return i.length=0,!0}function consumeHextets(i,e,s){if(i.length){const c=stringArrayToHexStripped(i);if(c!=="")e.push(c);else return s.error=!0,!1;i.length=0}return!0}function getIPV6(i){let e=0;const s={error:!1,address:"",zone:""},c=[],h=[];let $=!1,_=!1,j=consumeHextets;for(let nt=0;nt<i.length;nt++){const et=i[nt];if(!(et==="["||et==="]"))if(et===":"){if($===!0&&(_=!0),!j(h,c,s))break;if(++e>7){s.error=!0;break}nt>0&&i[nt-1]===":"&&($=!0),c.push(":");continue}else if(et==="%"){if(!j(h,c,s))break;j=consumeIsZone}else{h.push(et);continue}}return h.length&&(j===consumeIsZone?s.zone=h.join(""):_?c.push(h.join("")):c.push(stringArrayToHexStripped(h))),s.address=c.join(""),s}function normalizeIPv6$1(i){if(findToken(i,":")<2)return{host:i,isIPV6:!1};const e=getIPV6(i);if(e.error)return{host:i,isIPV6:!1};{let s=e.address,c=e.address;return e.zone&&(s+="%"+e.zone,c+="%25"+e.zone),{host:s,isIPV6:!0,escapedHost:c}}}function findToken(i,e){let s=0;for(let c=0;c<i.length;c++)i[c]===e&&s++;return s}function removeDotSegments$1(i){let e=i;const s=[];let c=-1,h=0;for(;h=e.length;){if(h===1){if(e===".")break;if(e==="/"){s.push("/");break}else{s.push(e);break}}else if(h===2){if(e[0]==="."){if(e[1]===".")break;if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&(e[1]==="."||e[1]==="/")){s.push("/");break}}else if(h===3&&e==="/.."){s.length!==0&&s.pop(),s.push("/");break}if(e[0]==="."){if(e[1]==="."){if(e[2]==="/"){e=e.slice(3);continue}}else if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&e[1]==="."){if(e[2]==="/"){e=e.slice(2);continue}else if(e[2]==="."&&e[3]==="/"){e=e.slice(3),s.length!==0&&s.pop();continue}}if((c=e.indexOf("/",1))===-1){s.push(e);break}else s.push(e.slice(0,c)),e=e.slice(c)}return s.join("")}function normalizeComponentEncoding$1(i,e){const s=e!==!0?escape:unescape;return i.scheme!==void 0&&(i.scheme=s(i.scheme)),i.userinfo!==void 0&&(i.userinfo=s(i.userinfo)),i.host!==void 0&&(i.host=s(i.host)),i.path!==void 0&&(i.path=s(i.path)),i.query!==void 0&&(i.query=s(i.query)),i.fragment!==void 0&&(i.fragment=s(i.fragment)),i}function recomposeAuthority$1(i){const e=[];if(i.userinfo!==void 0&&(e.push(i.userinfo),e.push("@")),i.host!==void 0){let s=unescape(i.host);if(!isIPv4$1(s)){const c=normalizeIPv6$1(s);c.isIPV6===!0?s=`[${c.escapedHost}]`:s=i.host}e.push(s)}return(typeof i.port=="number"||typeof i.port=="string")&&(e.push(":"),e.push(String(i.port))),e.length?e.join(""):void 0}var utils$1={nonSimpleDomain:nonSimpleDomain$1,recomposeAuthority:recomposeAuthority$1,normalizeComponentEncoding:normalizeComponentEncoding$1,removeDotSegments:removeDotSegments$1,isIPv4:isIPv4$1,isUUID:isUUID$1,normalizeIPv6:normalizeIPv6$1};const{isUUID}=utils$1,URN_REG=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function wsIsSecure(i){return i.secure===!0?!0:i.secure===!1?!1:i.scheme?i.scheme.length===3&&(i.scheme[0]==="w"||i.scheme[0]==="W")&&(i.scheme[1]==="s"||i.scheme[1]==="S")&&(i.scheme[2]==="s"||i.scheme[2]==="S"):!1}function httpParse(i){return i.host||(i.error=i.error||"HTTP URIs must have a host."),i}function httpSerialize(i){const e=String(i.scheme).toLowerCase()==="https";return(i.port===(e?443:80)||i.port==="")&&(i.port=void 0),i.path||(i.path="/"),i}function wsParse(i){return i.secure=wsIsSecure(i),i.resourceName=(i.path||"/")+(i.query?"?"+i.query:""),i.path=void 0,i.query=void 0,i}function wsSerialize(i){if((i.port===(wsIsSecure(i)?443:80)||i.port==="")&&(i.port=void 0),typeof i.secure=="boolean"&&(i.scheme=i.secure?"wss":"ws",i.secure=void 0),i.resourceName){const[e,s]=i.resourceName.split("?");i.path=e&&e!=="/"?e:void 0,i.query=s,i.resourceName=void 0}return i.fragment=void 0,i}function urnParse(i,e){if(!i.path)return i.error="URN can not be parsed",i;const s=i.path.match(URN_REG);if(s){const c=e.scheme||i.scheme||"urn";i.nid=s[1].toLowerCase(),i.nss=s[2];const h=`${c}:${e.nid||i.nid}`,$=getSchemeHandler$1(h);i.path=void 0,$&&(i=$.parse(i,e))}else i.error=i.error||"URN can not be parsed.";return i}function urnSerialize(i,e){if(i.nid===void 0)throw new Error("URN without nid cannot be serialized");const s=e.scheme||i.scheme||"urn",c=i.nid.toLowerCase(),h=`${s}:${e.nid||c}`,$=getSchemeHandler$1(h);$&&(i=$.serialize(i,e));const _=i,j=i.nss;return _.path=`${c||e.nid}:${j}`,e.skipEscape=!0,_}function urnuuidParse(i,e){const s=i;return s.uuid=s.nss,s.nss=void 0,!e.tolerant&&(!s.uuid||!isUUID(s.uuid))&&(s.error=s.error||"UUID is not valid."),s}function urnuuidSerialize(i){const e=i;return e.nss=(i.uuid||"").toLowerCase(),e}const http={scheme:"http",domainHost:!0,parse:httpParse,serialize:httpSerialize},https={scheme:"https",domainHost:http.domainHost,parse:httpParse,serialize:httpSerialize},ws={scheme:"ws",domainHost:!0,parse:wsParse,serialize:wsSerialize},wss={scheme:"wss",domainHost:ws.domainHost,parse:ws.parse,serialize:ws.serialize},urn={scheme:"urn",parse:urnParse,serialize:urnSerialize,skipNormalize:!0},urnuuid={scheme:"urn:uuid",parse:urnuuidParse,serialize:urnuuidSerialize,skipNormalize:!0},SCHEMES$1={http,https,ws,wss,urn,"urn:uuid":urnuuid};Object.setPrototypeOf(SCHEMES$1,null);function getSchemeHandler$1(i){return i&&(SCHEMES$1[i]||SCHEMES$1[i.toLowerCase()])||void 0}var schemes={SCHEMES:SCHEMES$1,getSchemeHandler:getSchemeHandler$1};const{normalizeIPv6,removeDotSegments,recomposeAuthority,normalizeComponentEncoding,isIPv4,nonSimpleDomain}=utils$1,{SCHEMES,getSchemeHandler}=schemes;function normalize(i,e){return typeof i=="string"?i=serialize(parse(i,e),e):typeof i=="object"&&(i=parse(serialize(i,e),e)),i}function resolve(i,e,s){const c=s?Object.assign({scheme:"null"},s):{scheme:"null"},h=resolveComponent(parse(i,c),parse(e,c),c,!0);return c.skipEscape=!0,serialize(h,c)}function resolveComponent(i,e,s,c){const h={};return c||(i=parse(serialize(i,s),s),e=parse(serialize(e,s),s)),s=s||{},!s.tolerant&&e.scheme?(h.scheme=e.scheme,h.userinfo=e.userinfo,h.host=e.host,h.port=e.port,h.path=removeDotSegments(e.path||""),h.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(h.userinfo=e.userinfo,h.host=e.host,h.port=e.port,h.path=removeDotSegments(e.path||""),h.query=e.query):(e.path?(e.path[0]==="/"?h.path=removeDotSegments(e.path):((i.userinfo!==void 0||i.host!==void 0||i.port!==void 0)&&!i.path?h.path="/"+e.path:i.path?h.path=i.path.slice(0,i.path.lastIndexOf("/")+1)+e.path:h.path=e.path,h.path=removeDotSegments(h.path)),h.query=e.query):(h.path=i.path,e.query!==void 0?h.query=e.query:h.query=i.query),h.userinfo=i.userinfo,h.host=i.host,h.port=i.port),h.scheme=i.scheme),h.fragment=e.fragment,h}function equal$2(i,e,s){return typeof i=="string"?(i=unescape(i),i=serialize(normalizeComponentEncoding(parse(i,s),!0),{...s,skipEscape:!0})):typeof i=="object"&&(i=serialize(normalizeComponentEncoding(i,!0),{...s,skipEscape:!0})),typeof e=="string"?(e=unescape(e),e=serialize(normalizeComponentEncoding(parse(e,s),!0),{...s,skipEscape:!0})):typeof e=="object"&&(e=serialize(normalizeComponentEncoding(e,!0),{...s,skipEscape:!0})),i.toLowerCase()===e.toLowerCase()}function serialize(i,e){const s={host:i.host,scheme:i.scheme,userinfo:i.userinfo,port:i.port,path:i.path,query:i.query,nid:i.nid,nss:i.nss,uuid:i.uuid,fragment:i.fragment,reference:i.reference,resourceName:i.resourceName,secure:i.secure,error:""},c=Object.assign({},e),h=[],$=getSchemeHandler(c.scheme||s.scheme);$&&$.serialize&&$.serialize(s,c),s.path!==void 0&&(c.skipEscape?s.path=unescape(s.path):(s.path=escape(s.path),s.scheme!==void 0&&(s.path=s.path.split("%3A").join(":")))),c.reference!=="suffix"&&s.scheme&&h.push(s.scheme,":");const _=recomposeAuthority(s);if(_!==void 0&&(c.reference!=="suffix"&&h.push("//"),h.push(_),s.path&&s.path[0]!=="/"&&h.push("/")),s.path!==void 0){let j=s.path;!c.absolutePath&&(!$||!$.absolutePath)&&(j=removeDotSegments(j)),_===void 0&&j[0]==="/"&&j[1]==="/"&&(j="/%2F"+j.slice(2)),h.push(j)}return s.query!==void 0&&h.push("?",s.query),s.fragment!==void 0&&h.push("#",s.fragment),h.join("")}const URI_PARSE=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function parse(i,e){const s=Object.assign({},e),c={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let h=!1;s.reference==="suffix"&&(s.scheme?i=s.scheme+":"+i:i="//"+i);const $=i.match(URI_PARSE);if($){if(c.scheme=$[1],c.userinfo=$[3],c.host=$[4],c.port=parseInt($[5],10),c.path=$[6]||"",c.query=$[7],c.fragment=$[8],isNaN(c.port)&&(c.port=$[5]),c.host)if(isIPv4(c.host)===!1){const nt=normalizeIPv6(c.host);c.host=nt.host.toLowerCase(),h=nt.isIPV6}else h=!0;c.scheme===void 0&&c.userinfo===void 0&&c.host===void 0&&c.port===void 0&&c.query===void 0&&!c.path?c.reference="same-document":c.scheme===void 0?c.reference="relative":c.fragment===void 0?c.reference="absolute":c.reference="uri",s.reference&&s.reference!=="suffix"&&s.reference!==c.reference&&(c.error=c.error||"URI is not a "+s.reference+" reference.");const _=getSchemeHandler(s.scheme||c.scheme);if(!s.unicodeSupport&&(!_||!_.unicodeSupport)&&c.host&&(s.domainHost||_&&_.domainHost)&&h===!1&&nonSimpleDomain(c.host))try{c.host=URL.domainToASCII(c.host.toLowerCase())}catch(j){c.error=c.error||"Host's domain name can not be converted to ASCII: "+j}(!_||_&&!_.skipNormalize)&&(i.indexOf("%")!==-1&&(c.scheme!==void 0&&(c.scheme=unescape(c.scheme)),c.host!==void 0&&(c.host=unescape(c.host))),c.path&&(c.path=escape(unescape(c.path))),c.fragment&&(c.fragment=encodeURI(decodeURIComponent(c.fragment)))),_&&_.parse&&_.parse(c,s)}else c.error=c.error||"URI can not be parsed.";return c}const fastUri={SCHEMES,normalize,resolve,resolveComponent,equal:equal$2,serialize,parse};fastUri$1.exports=fastUri,fastUri$1.exports.default=fastUri,fastUri$1.exports.fastUri=fastUri;var fastUriExports=fastUri$1.exports;Object.defineProperty(uri$1,"__esModule",{value:!0});const uri=fastUriExports;uri.code='require("ajv/dist/runtime/uri").default',uri$1.default=uri,function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.CodeGen=i.Name=i.nil=i.stringify=i.str=i._=i.KeywordCxt=void 0;var e=validate;Object.defineProperty(i,"KeywordCxt",{enumerable:!0,get:function(){return e.KeywordCxt}});var s=codegen;Object.defineProperty(i,"_",{enumerable:!0,get:function(){return s._}}),Object.defineProperty(i,"str",{enumerable:!0,get:function(){return s.str}}),Object.defineProperty(i,"stringify",{enumerable:!0,get:function(){return s.stringify}}),Object.defineProperty(i,"nil",{enumerable:!0,get:function(){return s.nil}}),Object.defineProperty(i,"Name",{enumerable:!0,get:function(){return s.Name}}),Object.defineProperty(i,"CodeGen",{enumerable:!0,get:function(){return s.CodeGen}});const c=validation_error,h=ref_error,$=rules,_=compile,j=codegen,nt=resolve$2,et=dataType,b=util,a=require$$9,o=uri$1,d=(Et,mt)=>new RegExp(Et,mt);d.code="new RegExp";const g=["removeAdditional","useDefaults","coerceTypes"],rt=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),st={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},tt={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},ot=200;function it(Et){var mt,gt,ht,pt,_t,Ct,zt,Nt,Ht,Jt,un,yn,vn,mn,Tn,kn,Gn,wr,xt,kt,wn,bn,Dn,Rn,_n;const On=Et.strict,Ln=(mt=Et.code)===null||mt===void 0?void 0:mt.optimize,Nn=Ln===!0||Ln===void 0?1:Ln||0,Sn=(ht=(gt=Et.code)===null||gt===void 0?void 0:gt.regExp)!==null&&ht!==void 0?ht:d,qn=(pt=Et.uriResolver)!==null&&pt!==void 0?pt:o.default;return{strictSchema:(Ct=(_t=Et.strictSchema)!==null&&_t!==void 0?_t:On)!==null&&Ct!==void 0?Ct:!0,strictNumbers:(Nt=(zt=Et.strictNumbers)!==null&&zt!==void 0?zt:On)!==null&&Nt!==void 0?Nt:!0,strictTypes:(Jt=(Ht=Et.strictTypes)!==null&&Ht!==void 0?Ht:On)!==null&&Jt!==void 0?Jt:"log",strictTuples:(yn=(un=Et.strictTuples)!==null&&un!==void 0?un:On)!==null&&yn!==void 0?yn:"log",strictRequired:(mn=(vn=Et.strictRequired)!==null&&vn!==void 0?vn:On)!==null&&mn!==void 0?mn:!1,code:Et.code?{...Et.code,optimize:Nn,regExp:Sn}:{optimize:Nn,regExp:Sn},loopRequired:(Tn=Et.loopRequired)!==null&&Tn!==void 0?Tn:ot,loopEnum:(kn=Et.loopEnum)!==null&&kn!==void 0?kn:ot,meta:(Gn=Et.meta)!==null&&Gn!==void 0?Gn:!0,messages:(wr=Et.messages)!==null&&wr!==void 0?wr:!0,inlineRefs:(xt=Et.inlineRefs)!==null&&xt!==void 0?xt:!0,schemaId:(kt=Et.schemaId)!==null&&kt!==void 0?kt:"$id",addUsedSchema:(wn=Et.addUsedSchema)!==null&&wn!==void 0?wn:!0,validateSchema:(bn=Et.validateSchema)!==null&&bn!==void 0?bn:!0,validateFormats:(Dn=Et.validateFormats)!==null&&Dn!==void 0?Dn:!0,unicodeRegExp:(Rn=Et.unicodeRegExp)!==null&&Rn!==void 0?Rn:!0,int32range:(_n=Et.int32range)!==null&&_n!==void 0?_n:!0,uriResolver:qn}}class at{constructor(mt={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,mt=this.opts={...mt,...it(mt)};const{es5:gt,lines:ht}=this.opts.code;this.scope=new j.ValueScope({scope:{},prefixes:rt,es5:gt,lines:ht}),this.logger=bt(mt.logger);const pt=mt.validateFormats;mt.validateFormats=!1,this.RULES=(0,$.getRules)(),ut.call(this,st,mt,"NOT SUPPORTED"),ut.call(this,tt,mt,"DEPRECATED","warn"),this._metaOpts=yt.call(this),mt.formats&&ft.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),mt.keywords&&dt.call(this,mt.keywords),typeof mt.meta=="object"&&this.addMetaSchema(mt.meta),ct.call(this),mt.validateFormats=pt}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:mt,meta:gt,schemaId:ht}=this.opts;let pt=a;ht==="id"&&(pt={...a},pt.id=pt.$id,delete pt.$id),gt&&mt&&this.addMetaSchema(pt,pt[ht],!1)}defaultMeta(){const{meta:mt,schemaId:gt}=this.opts;return this.opts.defaultMeta=typeof mt=="object"?mt[gt]||mt:void 0}validate(mt,gt){let ht;if(typeof mt=="string"){if(ht=this.getSchema(mt),!ht)throw new Error(`no schema with key or ref "${mt}"`)}else ht=this.compile(mt);const pt=ht(gt);return"$async"in ht||(this.errors=ht.errors),pt}compile(mt,gt){const ht=this._addSchema(mt,gt);return ht.validate||this._compileSchemaEnv(ht)}compileAsync(mt,gt){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:ht}=this.opts;return pt.call(this,mt,gt);async function pt(Jt,un){await _t.call(this,Jt.$schema);const yn=this._addSchema(Jt,un);return yn.validate||Ct.call(this,yn)}async function _t(Jt){Jt&&!this.getSchema(Jt)&&await pt.call(this,{$ref:Jt},!0)}async function Ct(Jt){try{return this._compileSchemaEnv(Jt)}catch(un){if(!(un instanceof h.default))throw un;return zt.call(this,un),await Nt.call(this,un.missingSchema),Ct.call(this,Jt)}}function zt({missingSchema:Jt,missingRef:un}){if(this.refs[Jt])throw new Error(`AnySchema ${Jt} is loaded but ${un} cannot be resolved`)}async function Nt(Jt){const un=await Ht.call(this,Jt);this.refs[Jt]||await _t.call(this,un.$schema),this.refs[Jt]||this.addSchema(un,Jt,gt)}async function Ht(Jt){const un=this._loading[Jt];if(un)return un;try{return await(this._loading[Jt]=ht(Jt))}finally{delete this._loading[Jt]}}}addSchema(mt,gt,ht,pt=this.opts.validateSchema){if(Array.isArray(mt)){for(const Ct of mt)this.addSchema(Ct,void 0,ht,pt);return this}let _t;if(typeof mt=="object"){const{schemaId:Ct}=this.opts;if(_t=mt[Ct],_t!==void 0&&typeof _t!="string")throw new Error(`schema ${Ct} must be string`)}return gt=(0,nt.normalizeId)(gt||_t),this._checkUnique(gt),this.schemas[gt]=this._addSchema(mt,ht,gt,pt,!0),this}addMetaSchema(mt,gt,ht=this.opts.validateSchema){return this.addSchema(mt,gt,!0,ht),this}validateSchema(mt,gt){if(typeof mt=="boolean")return!0;let ht;if(ht=mt.$schema,ht!==void 0&&typeof ht!="string")throw new Error("$schema must be a string");if(ht=ht||this.opts.defaultMeta||this.defaultMeta(),!ht)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const pt=this.validate(ht,mt);if(!pt&>){const _t="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(_t);else throw new Error(_t)}return pt}getSchema(mt){let gt;for(;typeof(gt=lt.call(this,mt))=="string";)mt=gt;if(gt===void 0){const{schemaId:ht}=this.opts,pt=new _.SchemaEnv({schema:{},schemaId:ht});if(gt=_.resolveSchema.call(this,pt,mt),!gt)return;this.refs[mt]=gt}return gt.validate||this._compileSchemaEnv(gt)}removeSchema(mt){if(mt instanceof RegExp)return this._removeAllSchemas(this.schemas,mt),this._removeAllSchemas(this.refs,mt),this;switch(typeof mt){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const gt=lt.call(this,mt);return typeof gt=="object"&&this._cache.delete(gt.schema),delete this.schemas[mt],delete this.refs[mt],this}case"object":{const gt=mt;this._cache.delete(gt);let ht=mt[this.opts.schemaId];return ht&&(ht=(0,nt.normalizeId)(ht),delete this.schemas[ht],delete this.refs[ht]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(mt){for(const gt of mt)this.addKeyword(gt);return this}addKeyword(mt,gt){let ht;if(typeof mt=="string")ht=mt,typeof gt=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),gt.keyword=ht);else if(typeof mt=="object"&>===void 0){if(gt=mt,ht=gt.keyword,Array.isArray(ht)&&!ht.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(vt.call(this,ht,gt),!gt)return(0,b.eachItem)(ht,_t=>$t.call(this,_t)),this;Ot.call(this,gt);const pt={...gt,type:(0,et.getJSONTypes)(gt.type),schemaType:(0,et.getJSONTypes)(gt.schemaType)};return(0,b.eachItem)(ht,pt.type.length===0?_t=>$t.call(this,_t,pt):_t=>pt.type.forEach(Ct=>$t.call(this,_t,pt,Ct))),this}getKeyword(mt){const gt=this.RULES.all[mt];return typeof gt=="object"?gt.definition:!!gt}removeKeyword(mt){const{RULES:gt}=this;delete gt.keywords[mt],delete gt.all[mt];for(const ht of gt.rules){const pt=ht.rules.findIndex(_t=>_t.keyword===mt);pt>=0&&ht.rules.splice(pt,1)}return this}addFormat(mt,gt){return typeof gt=="string"&&(gt=new RegExp(gt)),this.formats[mt]=gt,this}errorsText(mt=this.errors,{separator:gt=", ",dataVar:ht="data"}={}){return!mt||mt.length===0?"No errors":mt.map(pt=>`${ht}${pt.instancePath} ${pt.message}`).reduce((pt,_t)=>pt+gt+_t)}$dataMetaSchema(mt,gt){const ht=this.RULES.all;mt=JSON.parse(JSON.stringify(mt));for(const pt of gt){const _t=pt.split("/").slice(1);let Ct=mt;for(const zt of _t)Ct=Ct[zt];for(const zt in ht){const Nt=ht[zt];if(typeof Nt!="object")continue;const{$data:Ht}=Nt.definition,Jt=Ct[zt];Ht&&Jt&&(Ct[zt]=jt(Jt))}}return mt}_removeAllSchemas(mt,gt){for(const ht in mt){const pt=mt[ht];(!gt||gt.test(ht))&&(typeof pt=="string"?delete mt[ht]:pt&&!pt.meta&&(this._cache.delete(pt.schema),delete mt[ht]))}}_addSchema(mt,gt,ht,pt=this.opts.validateSchema,_t=this.opts.addUsedSchema){let Ct;const{schemaId:zt}=this.opts;if(typeof mt=="object")Ct=mt[zt];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof mt!="boolean")throw new Error("schema must be object or boolean")}let Nt=this._cache.get(mt);if(Nt!==void 0)return Nt;ht=(0,nt.normalizeId)(Ct||ht);const Ht=nt.getSchemaRefs.call(this,mt,ht);return Nt=new _.SchemaEnv({schema:mt,schemaId:zt,meta:gt,baseId:ht,localRefs:Ht}),this._cache.set(Nt.schema,Nt),_t&&!ht.startsWith("#")&&(ht&&this._checkUnique(ht),this.refs[ht]=Nt),pt&&this.validateSchema(mt,!0),Nt}_checkUnique(mt){if(this.schemas[mt]||this.refs[mt])throw new Error(`schema with key or id "${mt}" already exists`)}_compileSchemaEnv(mt){if(mt.meta?this._compileMetaSchema(mt):_.compileSchema.call(this,mt),!mt.validate)throw new Error("ajv implementation error");return mt.validate}_compileMetaSchema(mt){const gt=this.opts;this.opts=this._metaOpts;try{_.compileSchema.call(this,mt)}finally{this.opts=gt}}}at.ValidationError=c.default,at.MissingRefError=h.default,i.default=at;function ut(Et,mt,gt,ht="error"){for(const pt in Et){const _t=pt;_t in mt&&this.logger[ht](`${gt}: option ${pt}. ${Et[_t]}`)}}function lt(Et){return Et=(0,nt.normalizeId)(Et),this.schemas[Et]||this.refs[Et]}function ct(){const Et=this.opts.schemas;if(Et)if(Array.isArray(Et))this.addSchema(Et);else for(const mt in Et)this.addSchema(Et[mt],mt)}function ft(){for(const Et in this.opts.formats){const mt=this.opts.formats[Et];mt&&this.addFormat(Et,mt)}}function dt(Et){if(Array.isArray(Et)){this.addVocabulary(Et);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const mt in Et){const gt=Et[mt];gt.keyword||(gt.keyword=mt),this.addKeyword(gt)}}function yt(){const Et={...this.opts};for(const mt of g)delete Et[mt];return Et}const St={log(){},warn(){},error(){}};function bt(Et){if(Et===!1)return St;if(Et===void 0)return console;if(Et.log&&Et.warn&&Et.error)return Et;throw new Error("logger must implement log, warn and error methods")}const Tt=/^[a-z_$][a-z0-9_$:-]*$/i;function vt(Et,mt){const{RULES:gt}=this;if((0,b.eachItem)(Et,ht=>{if(gt.keywords[ht])throw new Error(`Keyword ${ht} is already defined`);if(!Tt.test(ht))throw new Error(`Keyword ${ht} has invalid name`)}),!!mt&&mt.$data&&!("code"in mt||"validate"in mt))throw new Error('$data keyword must have "code" or "validate" function')}function $t(Et,mt,gt){var ht;const pt=mt==null?void 0:mt.post;if(gt&&pt)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:_t}=this;let Ct=pt?_t.post:_t.rules.find(({type:Nt})=>Nt===gt);if(Ct||(Ct={type:gt,rules:[]},_t.rules.push(Ct)),_t.keywords[Et]=!0,!mt)return;const zt={keyword:Et,definition:{...mt,type:(0,et.getJSONTypes)(mt.type),schemaType:(0,et.getJSONTypes)(mt.schemaType)}};mt.before?At.call(this,Ct,zt,mt.before):Ct.rules.push(zt),_t.all[Et]=zt,(ht=mt.implements)===null||ht===void 0||ht.forEach(Nt=>this.addKeyword(Nt))}function At(Et,mt,gt){const ht=Et.rules.findIndex(pt=>pt.keyword===gt);ht>=0?Et.rules.splice(ht,0,mt):(Et.rules.push(mt),this.logger.warn(`rule ${gt} is not defined`))}function Ot(Et){let{metaSchema:mt}=Et;mt!==void 0&&(Et.$data&&this.opts.$data&&(mt=jt(mt)),Et.validateSchema=this.compile(mt,!0))}const It={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function jt(Et){return{anyOf:[Et,It]}}}(core$2);var draft7={},core$1={},id={};Object.defineProperty(id,"__esModule",{value:!0});const def$s={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};id.default=def$s;var ref={};Object.defineProperty(ref,"__esModule",{value:!0}),ref.callRef=ref.getValidate=void 0;const ref_error_1$1=ref_error,code_1$8=code,codegen_1$l=codegen,names_1$1=names$1,compile_1$1=compile,util_1$j=util,def$r={keyword:"$ref",schemaType:"string",code(i){const{gen:e,schema:s,it:c}=i,{baseId:h,schemaEnv:$,validateName:_,opts:j,self:nt}=c,{root:et}=$;if((s==="#"||s==="#/")&&h===et.baseId)return a();const b=compile_1$1.resolveRef.call(nt,et,h,s);if(b===void 0)throw new ref_error_1$1.default(c.opts.uriResolver,h,s);if(b instanceof compile_1$1.SchemaEnv)return o(b);return d(b);function a(){if($===et)return callRef(i,_,$,$.$async);const g=e.scopeValue("root",{ref:et});return callRef(i,(0,codegen_1$l._)`${g}.validate`,et,et.$async)}function o(g){const rt=getValidate(i,g);callRef(i,rt,g,g.$async)}function d(g){const rt=e.scopeValue("schema",j.code.source===!0?{ref:g,code:(0,codegen_1$l.stringify)(g)}:{ref:g}),st=e.name("valid"),tt=i.subschema({schema:g,dataTypes:[],schemaPath:codegen_1$l.nil,topSchemaRef:rt,errSchemaPath:s},st);i.mergeEvaluated(tt),i.ok(st)}}};function getValidate(i,e){const{gen:s}=i;return e.validate?s.scopeValue("validate",{ref:e.validate}):(0,codegen_1$l._)`${s.scopeValue("wrapper",{ref:e})}.validate`}ref.getValidate=getValidate;function callRef(i,e,s,c){const{gen:h,it:$}=i,{allErrors:_,schemaEnv:j,opts:nt}=$,et=nt.passContext?names_1$1.default.this:codegen_1$l.nil;c?b():a();function b(){if(!j.$async)throw new Error("async schema referenced by sync schema");const g=h.let("valid");h.try(()=>{h.code((0,codegen_1$l._)`await ${(0,code_1$8.callValidateCode)(i,e,et)}`),d(e),_||h.assign(g,!0)},rt=>{h.if((0,codegen_1$l._)`!(${rt} instanceof ${$.ValidationError})`,()=>h.throw(rt)),o(rt),_||h.assign(g,!1)}),i.ok(g)}function a(){i.result((0,code_1$8.callValidateCode)(i,e,et),()=>d(e),()=>o(e))}function o(g){const rt=(0,codegen_1$l._)`${g}.errors`;h.assign(names_1$1.default.vErrors,(0,codegen_1$l._)`${names_1$1.default.vErrors} === null ? ${rt} : ${names_1$1.default.vErrors}.concat(${rt})`),h.assign(names_1$1.default.errors,(0,codegen_1$l._)`${names_1$1.default.vErrors}.length`)}function d(g){var rt;if(!$.opts.unevaluated)return;const st=(rt=s==null?void 0:s.validate)===null||rt===void 0?void 0:rt.evaluated;if($.props!==!0)if(st&&!st.dynamicProps)st.props!==void 0&&($.props=util_1$j.mergeEvaluated.props(h,st.props,$.props));else{const tt=h.var("props",(0,codegen_1$l._)`${g}.evaluated.props`);$.props=util_1$j.mergeEvaluated.props(h,tt,$.props,codegen_1$l.Name)}if($.items!==!0)if(st&&!st.dynamicItems)st.items!==void 0&&($.items=util_1$j.mergeEvaluated.items(h,st.items,$.items));else{const tt=h.var("items",(0,codegen_1$l._)`${g}.evaluated.items`);$.items=util_1$j.mergeEvaluated.items(h,tt,$.items,codegen_1$l.Name)}}}ref.callRef=callRef,ref.default=def$r,Object.defineProperty(core$1,"__esModule",{value:!0});const id_1=id,ref_1=ref,core=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",id_1.default,ref_1.default];core$1.default=core;var validation$1={},limitNumber={};Object.defineProperty(limitNumber,"__esModule",{value:!0});const codegen_1$k=codegen,ops=codegen_1$k.operators,KWDs={maximum:{okStr:"<=",ok:ops.LTE,fail:ops.GT},minimum:{okStr:">=",ok:ops.GTE,fail:ops.LT},exclusiveMaximum:{okStr:"<",ok:ops.LT,fail:ops.GTE},exclusiveMinimum:{okStr:">",ok:ops.GT,fail:ops.LTE}},error$i={message:({keyword:i,schemaCode:e})=>(0,codegen_1$k.str)`must be ${KWDs[i].okStr} ${e}`,params:({keyword:i,schemaCode:e})=>(0,codegen_1$k._)`{comparison: ${KWDs[i].okStr}, limit: ${e}}`},def$q={keyword:Object.keys(KWDs),type:"number",schemaType:"number",$data:!0,error:error$i,code(i){const{keyword:e,data:s,schemaCode:c}=i;i.fail$data((0,codegen_1$k._)`${s} ${KWDs[e].fail} ${c} || isNaN(${s})`)}};limitNumber.default=def$q;var multipleOf={};Object.defineProperty(multipleOf,"__esModule",{value:!0});const codegen_1$j=codegen,error$h={message:({schemaCode:i})=>(0,codegen_1$j.str)`must be multiple of ${i}`,params:({schemaCode:i})=>(0,codegen_1$j._)`{multipleOf: ${i}}`},def$p={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:error$h,code(i){const{gen:e,data:s,schemaCode:c,it:h}=i,$=h.opts.multipleOfPrecision,_=e.let("res"),j=$?(0,codegen_1$j._)`Math.abs(Math.round(${_}) - ${_}) > 1e-${$}`:(0,codegen_1$j._)`${_} !== parseInt(${_})`;i.fail$data((0,codegen_1$j._)`(${c} === 0 || (${_} = ${s}/${c}, ${j}))`)}};multipleOf.default=def$p;var limitLength={},ucs2length$1={};Object.defineProperty(ucs2length$1,"__esModule",{value:!0});function ucs2length(i){const e=i.length;let s=0,c=0,h;for(;c<e;)s++,h=i.charCodeAt(c++),h>=55296&&h<=56319&&c<e&&(h=i.charCodeAt(c),(h&64512)===56320&&c++);return s}ucs2length$1.default=ucs2length,ucs2length.code='require("ajv/dist/runtime/ucs2length").default',Object.defineProperty(limitLength,"__esModule",{value:!0});const codegen_1$i=codegen,util_1$i=util,ucs2length_1=ucs2length$1,error$g={message({keyword:i,schemaCode:e}){const s=i==="maxLength"?"more":"fewer";return(0,codegen_1$i.str)`must NOT have ${s} than ${e} characters`},params:({schemaCode:i})=>(0,codegen_1$i._)`{limit: ${i}}`},def$o={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:error$g,code(i){const{keyword:e,data:s,schemaCode:c,it:h}=i,$=e==="maxLength"?codegen_1$i.operators.GT:codegen_1$i.operators.LT,_=h.opts.unicode===!1?(0,codegen_1$i._)`${s}.length`:(0,codegen_1$i._)`${(0,util_1$i.useFunc)(i.gen,ucs2length_1.default)}(${s})`;i.fail$data((0,codegen_1$i._)`${_} ${$} ${c}`)}};limitLength.default=def$o;var pattern={};Object.defineProperty(pattern,"__esModule",{value:!0});const code_1$7=code,codegen_1$h=codegen,error$f={message:({schemaCode:i})=>(0,codegen_1$h.str)`must match pattern "${i}"`,params:({schemaCode:i})=>(0,codegen_1$h._)`{pattern: ${i}}`},def$n={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:error$f,code(i){const{data:e,$data:s,schema:c,schemaCode:h,it:$}=i,_=$.opts.unicodeRegExp?"u":"",j=s?(0,codegen_1$h._)`(new RegExp(${h}, ${_}))`:(0,code_1$7.usePattern)(i,c);i.fail$data((0,codegen_1$h._)`!${j}.test(${e})`)}};pattern.default=def$n;var limitProperties={};Object.defineProperty(limitProperties,"__esModule",{value:!0});const codegen_1$g=codegen,error$e={message({keyword:i,schemaCode:e}){const s=i==="maxProperties"?"more":"fewer";return(0,codegen_1$g.str)`must NOT have ${s} than ${e} properties`},params:({schemaCode:i})=>(0,codegen_1$g._)`{limit: ${i}}`},def$m={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:error$e,code(i){const{keyword:e,data:s,schemaCode:c}=i,h=e==="maxProperties"?codegen_1$g.operators.GT:codegen_1$g.operators.LT;i.fail$data((0,codegen_1$g._)`Object.keys(${s}).length ${h} ${c}`)}};limitProperties.default=def$m;var required={};Object.defineProperty(required,"__esModule",{value:!0});const code_1$6=code,codegen_1$f=codegen,util_1$h=util,error$d={message:({params:{missingProperty:i}})=>(0,codegen_1$f.str)`must have required property '${i}'`,params:({params:{missingProperty:i}})=>(0,codegen_1$f._)`{missingProperty: ${i}}`},def$l={keyword:"required",type:"object",schemaType:"array",$data:!0,error:error$d,code(i){const{gen:e,schema:s,schemaCode:c,data:h,$data:$,it:_}=i,{opts:j}=_;if(!$&&s.length===0)return;const nt=s.length>=j.loopRequired;if(_.allErrors?et():b(),j.strictRequired){const d=i.parentSchema.properties,{definedProperties:g}=i.it;for(const rt of s)if((d==null?void 0:d[rt])===void 0&&!g.has(rt)){const st=_.schemaEnv.baseId+_.errSchemaPath,tt=`required property "${rt}" is not defined at "${st}" (strictRequired)`;(0,util_1$h.checkStrictMode)(_,tt,_.opts.strictRequired)}}function et(){if(nt||$)i.block$data(codegen_1$f.nil,a);else for(const d of s)(0,code_1$6.checkReportMissingProp)(i,d)}function b(){const d=e.let("missing");if(nt||$){const g=e.let("valid",!0);i.block$data(g,()=>o(d,g)),i.ok(g)}else e.if((0,code_1$6.checkMissingProp)(i,s,d)),(0,code_1$6.reportMissingProp)(i,d),e.else()}function a(){e.forOf("prop",c,d=>{i.setParams({missingProperty:d}),e.if((0,code_1$6.noPropertyInData)(e,h,d,j.ownProperties),()=>i.error())})}function o(d,g){i.setParams({missingProperty:d}),e.forOf(d,c,()=>{e.assign(g,(0,code_1$6.propertyInData)(e,h,d,j.ownProperties)),e.if((0,codegen_1$f.not)(g),()=>{i.error(),e.break()})},codegen_1$f.nil)}}};required.default=def$l;var limitItems={};Object.defineProperty(limitItems,"__esModule",{value:!0});const codegen_1$e=codegen,error$c={message({keyword:i,schemaCode:e}){const s=i==="maxItems"?"more":"fewer";return(0,codegen_1$e.str)`must NOT have ${s} than ${e} items`},params:({schemaCode:i})=>(0,codegen_1$e._)`{limit: ${i}}`},def$k={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:error$c,code(i){const{keyword:e,data:s,schemaCode:c}=i,h=e==="maxItems"?codegen_1$e.operators.GT:codegen_1$e.operators.LT;i.fail$data((0,codegen_1$e._)`${s}.length ${h} ${c}`)}};limitItems.default=def$k;var uniqueItems={},equal$1={};Object.defineProperty(equal$1,"__esModule",{value:!0});const equal=fastDeepEqual;equal.code='require("ajv/dist/runtime/equal").default',equal$1.default=equal,Object.defineProperty(uniqueItems,"__esModule",{value:!0});const dataType_1=dataType,codegen_1$d=codegen,util_1$g=util,equal_1$2=equal$1,error$b={message:({params:{i,j:e}})=>(0,codegen_1$d.str)`must NOT have duplicate items (items ## ${e} and ${i} are identical)`,params:({params:{i,j:e}})=>(0,codegen_1$d._)`{i: ${i}, j: ${e}}`},def$j={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:error$b,code(i){const{gen:e,data:s,$data:c,schema:h,parentSchema:$,schemaCode:_,it:j}=i;if(!c&&!h)return;const nt=e.let("valid"),et=$.items?(0,dataType_1.getSchemaTypes)($.items):[];i.block$data(nt,b,(0,codegen_1$d._)`${_} === false`),i.ok(nt);function b(){const g=e.let("i",(0,codegen_1$d._)`${s}.length`),rt=e.let("j");i.setParams({i:g,j:rt}),e.assign(nt,!0),e.if((0,codegen_1$d._)`${g} > 1`,()=>(a()?o:d)(g,rt))}function a(){return et.length>0&&!et.some(g=>g==="object"||g==="array")}function o(g,rt){const st=e.name("item"),tt=(0,dataType_1.checkDataTypes)(et,st,j.opts.strictNumbers,dataType_1.DataType.Wrong),ot=e.const("indices",(0,codegen_1$d._)`{}`);e.for((0,codegen_1$d._)`;${g}--;`,()=>{e.let(st,(0,codegen_1$d._)`${s}[${g}]`),e.if(tt,(0,codegen_1$d._)`continue`),et.length>1&&e.if((0,codegen_1$d._)`typeof ${st} == "string"`,(0,codegen_1$d._)`${st} += "_"`),e.if((0,codegen_1$d._)`typeof ${ot}[${st}] == "number"`,()=>{e.assign(rt,(0,codegen_1$d._)`${ot}[${st}]`),i.error(),e.assign(nt,!1).break()}).code((0,codegen_1$d._)`${ot}[${st}] = ${g}`)})}function d(g,rt){const st=(0,util_1$g.useFunc)(e,equal_1$2.default),tt=e.name("outer");e.label(tt).for((0,codegen_1$d._)`;${g}--;`,()=>e.for((0,codegen_1$d._)`${rt} = ${g}; ${rt}--;`,()=>e.if((0,codegen_1$d._)`${st}(${s}[${g}], ${s}[${rt}])`,()=>{i.error(),e.assign(nt,!1).break(tt)})))}}};uniqueItems.default=def$j;var _const={};Object.defineProperty(_const,"__esModule",{value:!0});const codegen_1$c=codegen,util_1$f=util,equal_1$1=equal$1,error$a={message:"must be equal to constant",params:({schemaCode:i})=>(0,codegen_1$c._)`{allowedValue: ${i}}`},def$i={keyword:"const",$data:!0,error:error$a,code(i){const{gen:e,data:s,$data:c,schemaCode:h,schema:$}=i;c||$&&typeof $=="object"?i.fail$data((0,codegen_1$c._)`!${(0,util_1$f.useFunc)(e,equal_1$1.default)}(${s}, ${h})`):i.fail((0,codegen_1$c._)`${$} !== ${s}`)}};_const.default=def$i;var _enum={};Object.defineProperty(_enum,"__esModule",{value:!0});const codegen_1$b=codegen,util_1$e=util,equal_1=equal$1,error$9={message:"must be equal to one of the allowed values",params:({schemaCode:i})=>(0,codegen_1$b._)`{allowedValues: ${i}}`},def$h={keyword:"enum",schemaType:"array",$data:!0,error:error$9,code(i){const{gen:e,data:s,$data:c,schema:h,schemaCode:$,it:_}=i;if(!c&&h.length===0)throw new Error("enum must have non-empty array");const j=h.length>=_.opts.loopEnum;let nt;const et=()=>nt??(nt=(0,util_1$e.useFunc)(e,equal_1.default));let b;if(j||c)b=e.let("valid"),i.block$data(b,a);else{if(!Array.isArray(h))throw new Error("ajv implementation error");const d=e.const("vSchema",$);b=(0,codegen_1$b.or)(...h.map((g,rt)=>o(d,rt)))}i.pass(b);function a(){e.assign(b,!1),e.forOf("v",$,d=>e.if((0,codegen_1$b._)`${et()}(${s}, ${d})`,()=>e.assign(b,!0).break()))}function o(d,g){const rt=h[g];return typeof rt=="object"&&rt!==null?(0,codegen_1$b._)`${et()}(${s}, ${d}[${g}])`:(0,codegen_1$b._)`${s} === ${rt}`}}};_enum.default=def$h,Object.defineProperty(validation$1,"__esModule",{value:!0});const limitNumber_1=limitNumber,multipleOf_1=multipleOf,limitLength_1=limitLength,pattern_1=pattern,limitProperties_1=limitProperties,required_1=required,limitItems_1=limitItems,uniqueItems_1=uniqueItems,const_1=_const,enum_1=_enum,validation=[limitNumber_1.default,multipleOf_1.default,limitLength_1.default,pattern_1.default,limitProperties_1.default,required_1.default,limitItems_1.default,uniqueItems_1.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},const_1.default,enum_1.default];validation$1.default=validation;var applicator={},additionalItems={};Object.defineProperty(additionalItems,"__esModule",{value:!0}),additionalItems.validateAdditionalItems=void 0;const codegen_1$a=codegen,util_1$d=util,error$8={message:({params:{len:i}})=>(0,codegen_1$a.str)`must NOT have more than ${i} items`,params:({params:{len:i}})=>(0,codegen_1$a._)`{limit: ${i}}`},def$g={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:error$8,code(i){const{parentSchema:e,it:s}=i,{items:c}=e;if(!Array.isArray(c)){(0,util_1$d.checkStrictMode)(s,'"additionalItems" is ignored when "items" is not an array of schemas');return}validateAdditionalItems(i,c)}};function validateAdditionalItems(i,e){const{gen:s,schema:c,data:h,keyword:$,it:_}=i;_.items=!0;const j=s.const("len",(0,codegen_1$a._)`${h}.length`);if(c===!1)i.setParams({len:e.length}),i.pass((0,codegen_1$a._)`${j} <= ${e.length}`);else if(typeof c=="object"&&!(0,util_1$d.alwaysValidSchema)(_,c)){const et=s.var("valid",(0,codegen_1$a._)`${j} <= ${e.length}`);s.if((0,codegen_1$a.not)(et),()=>nt(et)),i.ok(et)}function nt(et){s.forRange("i",e.length,j,b=>{i.subschema({keyword:$,dataProp:b,dataPropType:util_1$d.Type.Num},et),_.allErrors||s.if((0,codegen_1$a.not)(et),()=>s.break())})}}additionalItems.validateAdditionalItems=validateAdditionalItems,additionalItems.default=def$g;var prefixItems={},items={};Object.defineProperty(items,"__esModule",{value:!0}),items.validateTuple=void 0;const codegen_1$9=codegen,util_1$c=util,code_1$5=code,def$f={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(i){const{schema:e,it:s}=i;if(Array.isArray(e))return validateTuple(i,"additionalItems",e);s.items=!0,!(0,util_1$c.alwaysValidSchema)(s,e)&&i.ok((0,code_1$5.validateArray)(i))}};function validateTuple(i,e,s=i.schema){const{gen:c,parentSchema:h,data:$,keyword:_,it:j}=i;b(h),j.opts.unevaluated&&s.length&&j.items!==!0&&(j.items=util_1$c.mergeEvaluated.items(c,s.length,j.items));const nt=c.name("valid"),et=c.const("len",(0,codegen_1$9._)`${$}.length`);s.forEach((a,o)=>{(0,util_1$c.alwaysValidSchema)(j,a)||(c.if((0,codegen_1$9._)`${et} > ${o}`,()=>i.subschema({keyword:_,schemaProp:o,dataProp:o},nt)),i.ok(nt))});function b(a){const{opts:o,errSchemaPath:d}=j,g=s.length,rt=g===a.minItems&&(g===a.maxItems||a[e]===!1);if(o.strictTuples&&!rt){const st=`"${_}" is ${g}-tuple, but minItems or maxItems/${e} are not specified or different at path "${d}"`;(0,util_1$c.checkStrictMode)(j,st,o.strictTuples)}}}items.validateTuple=validateTuple,items.default=def$f,Object.defineProperty(prefixItems,"__esModule",{value:!0});const items_1$1=items,def$e={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:i=>(0,items_1$1.validateTuple)(i,"items")};prefixItems.default=def$e;var items2020={};Object.defineProperty(items2020,"__esModule",{value:!0});const codegen_1$8=codegen,util_1$b=util,code_1$4=code,additionalItems_1$1=additionalItems,error$7={message:({params:{len:i}})=>(0,codegen_1$8.str)`must NOT have more than ${i} items`,params:({params:{len:i}})=>(0,codegen_1$8._)`{limit: ${i}}`},def$d={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:error$7,code(i){const{schema:e,parentSchema:s,it:c}=i,{prefixItems:h}=s;c.items=!0,!(0,util_1$b.alwaysValidSchema)(c,e)&&(h?(0,additionalItems_1$1.validateAdditionalItems)(i,h):i.ok((0,code_1$4.validateArray)(i)))}};items2020.default=def$d;var contains={};Object.defineProperty(contains,"__esModule",{value:!0});const codegen_1$7=codegen,util_1$a=util,error$6={message:({params:{min:i,max:e}})=>e===void 0?(0,codegen_1$7.str)`must contain at least ${i} valid item(s)`:(0,codegen_1$7.str)`must contain at least ${i} and no more than ${e} valid item(s)`,params:({params:{min:i,max:e}})=>e===void 0?(0,codegen_1$7._)`{minContains: ${i}}`:(0,codegen_1$7._)`{minContains: ${i}, maxContains: ${e}}`},def$c={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:error$6,code(i){const{gen:e,schema:s,parentSchema:c,data:h,it:$}=i;let _,j;const{minContains:nt,maxContains:et}=c;$.opts.next?(_=nt===void 0?1:nt,j=et):_=1;const b=e.const("len",(0,codegen_1$7._)`${h}.length`);if(i.setParams({min:_,max:j}),j===void 0&&_===0){(0,util_1$a.checkStrictMode)($,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(j!==void 0&&_>j){(0,util_1$a.checkStrictMode)($,'"minContains" > "maxContains" is always invalid'),i.fail();return}if((0,util_1$a.alwaysValidSchema)($,s)){let rt=(0,codegen_1$7._)`${b} >= ${_}`;j!==void 0&&(rt=(0,codegen_1$7._)`${rt} && ${b} <= ${j}`),i.pass(rt);return}$.items=!0;const a=e.name("valid");j===void 0&&_===1?d(a,()=>e.if(a,()=>e.break())):_===0?(e.let(a,!0),j!==void 0&&e.if((0,codegen_1$7._)`${h}.length > 0`,o)):(e.let(a,!1),o()),i.result(a,()=>i.reset());function o(){const rt=e.name("_valid"),st=e.let("count",0);d(rt,()=>e.if(rt,()=>g(st)))}function d(rt,st){e.forRange("i",0,b,tt=>{i.subschema({keyword:"contains",dataProp:tt,dataPropType:util_1$a.Type.Num,compositeRule:!0},rt),st()})}function g(rt){e.code((0,codegen_1$7._)`${rt}++`),j===void 0?e.if((0,codegen_1$7._)`${rt} >= ${_}`,()=>e.assign(a,!0).break()):(e.if((0,codegen_1$7._)`${rt} > ${j}`,()=>e.assign(a,!1).break()),_===1?e.assign(a,!0):e.if((0,codegen_1$7._)`${rt} >= ${_}`,()=>e.assign(a,!0)))}}};contains.default=def$c;var dependencies={};(function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.validateSchemaDeps=i.validatePropertyDeps=i.error=void 0;const e=codegen,s=util,c=code;i.error={message:({params:{property:nt,depsCount:et,deps:b}})=>{const a=et===1?"property":"properties";return(0,e.str)`must have ${a} ${b} when property ${nt} is present`},params:({params:{property:nt,depsCount:et,deps:b,missingProperty:a}})=>(0,e._)`{property: ${nt},
|
|
45
45
|
missingProperty: ${a},
|
|
46
46
|
depsCount: ${et},
|
|
47
47
|
deps: ${b}}`};const h={keyword:"dependencies",type:"object",schemaType:"object",error:i.error,code(nt){const[et,b]=$(nt);_(nt,et),j(nt,b)}};function $({schema:nt}){const et={},b={};for(const a in nt){if(a==="__proto__")continue;const o=Array.isArray(nt[a])?et:b;o[a]=nt[a]}return[et,b]}function _(nt,et=nt.schema){const{gen:b,data:a,it:o}=nt;if(Object.keys(et).length===0)return;const d=b.let("missing");for(const g in et){const rt=et[g];if(rt.length===0)continue;const st=(0,c.propertyInData)(b,a,g,o.opts.ownProperties);nt.setParams({property:g,depsCount:rt.length,deps:rt.join(", ")}),o.allErrors?b.if(st,()=>{for(const tt of rt)(0,c.checkReportMissingProp)(nt,tt)}):(b.if((0,e._)`${st} && (${(0,c.checkMissingProp)(nt,rt,d)})`),(0,c.reportMissingProp)(nt,d),b.else())}}i.validatePropertyDeps=_;function j(nt,et=nt.schema){const{gen:b,data:a,keyword:o,it:d}=nt,g=b.name("valid");for(const rt in et)(0,s.alwaysValidSchema)(d,et[rt])||(b.if((0,c.propertyInData)(b,a,rt,d.opts.ownProperties),()=>{const st=nt.subschema({keyword:o,schemaProp:rt},g);nt.mergeValidEvaluated(st,g)},()=>b.var(g,!0)),nt.ok(g))}i.validateSchemaDeps=j,i.default=h})(dependencies);var propertyNames={};Object.defineProperty(propertyNames,"__esModule",{value:!0});const codegen_1$6=codegen,util_1$9=util,error$5={message:"property name must be valid",params:({params:i})=>(0,codegen_1$6._)`{propertyName: ${i.propertyName}}`},def$b={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:error$5,code(i){const{gen:e,schema:s,data:c,it:h}=i;if((0,util_1$9.alwaysValidSchema)(h,s))return;const $=e.name("valid");e.forIn("key",c,_=>{i.setParams({propertyName:_}),i.subschema({keyword:"propertyNames",data:_,dataTypes:["string"],propertyName:_,compositeRule:!0},$),e.if((0,codegen_1$6.not)($),()=>{i.error(!0),h.allErrors||e.break()})}),i.ok($)}};propertyNames.default=def$b;var additionalProperties={};Object.defineProperty(additionalProperties,"__esModule",{value:!0});const code_1$3=code,codegen_1$5=codegen,names_1=names$1,util_1$8=util,error$4={message:"must NOT have additional properties",params:({params:i})=>(0,codegen_1$5._)`{additionalProperty: ${i.additionalProperty}}`},def$a={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:error$4,code(i){const{gen:e,schema:s,parentSchema:c,data:h,errsCount:$,it:_}=i;if(!$)throw new Error("ajv implementation error");const{allErrors:j,opts:nt}=_;if(_.props=!0,nt.removeAdditional!=="all"&&(0,util_1$8.alwaysValidSchema)(_,s))return;const et=(0,code_1$3.allSchemaProperties)(c.properties),b=(0,code_1$3.allSchemaProperties)(c.patternProperties);a(),i.ok((0,codegen_1$5._)`${$} === ${names_1.default.errors}`);function a(){e.forIn("key",h,st=>{!et.length&&!b.length?g(st):e.if(o(st),()=>g(st))})}function o(st){let tt;if(et.length>8){const ot=(0,util_1$8.schemaRefOrVal)(_,c.properties,"properties");tt=(0,code_1$3.isOwnProperty)(e,ot,st)}else et.length?tt=(0,codegen_1$5.or)(...et.map(ot=>(0,codegen_1$5._)`${st} === ${ot}`)):tt=codegen_1$5.nil;return b.length&&(tt=(0,codegen_1$5.or)(tt,...b.map(ot=>(0,codegen_1$5._)`${(0,code_1$3.usePattern)(i,ot)}.test(${st})`))),(0,codegen_1$5.not)(tt)}function d(st){e.code((0,codegen_1$5._)`delete ${h}[${st}]`)}function g(st){if(nt.removeAdditional==="all"||nt.removeAdditional&&s===!1){d(st);return}if(s===!1){i.setParams({additionalProperty:st}),i.error(),j||e.break();return}if(typeof s=="object"&&!(0,util_1$8.alwaysValidSchema)(_,s)){const tt=e.name("valid");nt.removeAdditional==="failing"?(rt(st,tt,!1),e.if((0,codegen_1$5.not)(tt),()=>{i.reset(),d(st)})):(rt(st,tt),j||e.if((0,codegen_1$5.not)(tt),()=>e.break()))}}function rt(st,tt,ot){const it={keyword:"additionalProperties",dataProp:st,dataPropType:util_1$8.Type.Str};ot===!1&&Object.assign(it,{compositeRule:!0,createErrors:!1,allErrors:!1}),i.subschema(it,tt)}}};additionalProperties.default=def$a;var properties$1={};Object.defineProperty(properties$1,"__esModule",{value:!0});const validate_1=validate,code_1$2=code,util_1$7=util,additionalProperties_1$1=additionalProperties,def$9={keyword:"properties",type:"object",schemaType:"object",code(i){const{gen:e,schema:s,parentSchema:c,data:h,it:$}=i;$.opts.removeAdditional==="all"&&c.additionalProperties===void 0&&additionalProperties_1$1.default.code(new validate_1.KeywordCxt($,additionalProperties_1$1.default,"additionalProperties"));const _=(0,code_1$2.allSchemaProperties)(s);for(const a of _)$.definedProperties.add(a);$.opts.unevaluated&&_.length&&$.props!==!0&&($.props=util_1$7.mergeEvaluated.props(e,(0,util_1$7.toHash)(_),$.props));const j=_.filter(a=>!(0,util_1$7.alwaysValidSchema)($,s[a]));if(j.length===0)return;const nt=e.name("valid");for(const a of j)et(a)?b(a):(e.if((0,code_1$2.propertyInData)(e,h,a,$.opts.ownProperties)),b(a),$.allErrors||e.else().var(nt,!0),e.endIf()),i.it.definedProperties.add(a),i.ok(nt);function et(a){return $.opts.useDefaults&&!$.compositeRule&&s[a].default!==void 0}function b(a){i.subschema({keyword:"properties",schemaProp:a,dataProp:a},nt)}}};properties$1.default=def$9;var patternProperties={};Object.defineProperty(patternProperties,"__esModule",{value:!0});const code_1$1=code,codegen_1$4=codegen,util_1$6=util,util_2=util,def$8={keyword:"patternProperties",type:"object",schemaType:"object",code(i){const{gen:e,schema:s,data:c,parentSchema:h,it:$}=i,{opts:_}=$,j=(0,code_1$1.allSchemaProperties)(s),nt=j.filter(rt=>(0,util_1$6.alwaysValidSchema)($,s[rt]));if(j.length===0||nt.length===j.length&&(!$.opts.unevaluated||$.props===!0))return;const et=_.strictSchema&&!_.allowMatchingProperties&&h.properties,b=e.name("valid");$.props!==!0&&!($.props instanceof codegen_1$4.Name)&&($.props=(0,util_2.evaluatedPropsToName)(e,$.props));const{props:a}=$;o();function o(){for(const rt of j)et&&d(rt),$.allErrors?g(rt):(e.var(b,!0),g(rt),e.if(b))}function d(rt){for(const st in et)new RegExp(rt).test(st)&&(0,util_1$6.checkStrictMode)($,`property ${st} matches pattern ${rt} (use allowMatchingProperties)`)}function g(rt){e.forIn("key",c,st=>{e.if((0,codegen_1$4._)`${(0,code_1$1.usePattern)(i,rt)}.test(${st})`,()=>{const tt=nt.includes(rt);tt||i.subschema({keyword:"patternProperties",schemaProp:rt,dataProp:st,dataPropType:util_2.Type.Str},b),$.opts.unevaluated&&a!==!0?e.assign((0,codegen_1$4._)`${a}[${st}]`,!0):!tt&&!$.allErrors&&e.if((0,codegen_1$4.not)(b),()=>e.break())})})}}};patternProperties.default=def$8;var not={};Object.defineProperty(not,"__esModule",{value:!0});const util_1$5=util,def$7={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(i){const{gen:e,schema:s,it:c}=i;if((0,util_1$5.alwaysValidSchema)(c,s)){i.fail();return}const h=e.name("valid");i.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},h),i.failResult(h,()=>i.reset(),()=>i.error())},error:{message:"must NOT be valid"}};not.default=def$7;var anyOf={};Object.defineProperty(anyOf,"__esModule",{value:!0});const code_1=code,def$6={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:code_1.validateUnion,error:{message:"must match a schema in anyOf"}};anyOf.default=def$6;var oneOf={};Object.defineProperty(oneOf,"__esModule",{value:!0});const codegen_1$3=codegen,util_1$4=util,error$3={message:"must match exactly one schema in oneOf",params:({params:i})=>(0,codegen_1$3._)`{passingSchemas: ${i.passing}}`},def$5={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:error$3,code(i){const{gen:e,schema:s,parentSchema:c,it:h}=i;if(!Array.isArray(s))throw new Error("ajv implementation error");if(h.opts.discriminator&&c.discriminator)return;const $=s,_=e.let("valid",!1),j=e.let("passing",null),nt=e.name("_valid");i.setParams({passing:j}),e.block(et),i.result(_,()=>i.reset(),()=>i.error(!0));function et(){$.forEach((b,a)=>{let o;(0,util_1$4.alwaysValidSchema)(h,b)?e.var(nt,!0):o=i.subschema({keyword:"oneOf",schemaProp:a,compositeRule:!0},nt),a>0&&e.if((0,codegen_1$3._)`${nt} && ${_}`).assign(_,!1).assign(j,(0,codegen_1$3._)`[${j}, ${a}]`).else(),e.if(nt,()=>{e.assign(_,!0),e.assign(j,a),o&&i.mergeEvaluated(o,codegen_1$3.Name)})})}}};oneOf.default=def$5;var allOf={};Object.defineProperty(allOf,"__esModule",{value:!0});const util_1$3=util,def$4={keyword:"allOf",schemaType:"array",code(i){const{gen:e,schema:s,it:c}=i;if(!Array.isArray(s))throw new Error("ajv implementation error");const h=e.name("valid");s.forEach(($,_)=>{if((0,util_1$3.alwaysValidSchema)(c,$))return;const j=i.subschema({keyword:"allOf",schemaProp:_},h);i.ok(h),i.mergeEvaluated(j)})}};allOf.default=def$4;var _if={};Object.defineProperty(_if,"__esModule",{value:!0});const codegen_1$2=codegen,util_1$2=util,error$2={message:({params:i})=>(0,codegen_1$2.str)`must match "${i.ifClause}" schema`,params:({params:i})=>(0,codegen_1$2._)`{failingKeyword: ${i.ifClause}}`},def$3={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:error$2,code(i){const{gen:e,parentSchema:s,it:c}=i;s.then===void 0&&s.else===void 0&&(0,util_1$2.checkStrictMode)(c,'"if" without "then" and "else" is ignored');const h=hasSchema(c,"then"),$=hasSchema(c,"else");if(!h&&!$)return;const _=e.let("valid",!0),j=e.name("_valid");if(nt(),i.reset(),h&&$){const b=e.let("ifClause");i.setParams({ifClause:b}),e.if(j,et("then",b),et("else",b))}else h?e.if(j,et("then")):e.if((0,codegen_1$2.not)(j),et("else"));i.pass(_,()=>i.error(!0));function nt(){const b=i.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},j);i.mergeEvaluated(b)}function et(b,a){return()=>{const o=i.subschema({keyword:b},j);e.assign(_,j),i.mergeValidEvaluated(o,_),a?e.assign(a,(0,codegen_1$2._)`${b}`):i.setParams({ifClause:b})}}}};function hasSchema(i,e){const s=i.schema[e];return s!==void 0&&!(0,util_1$2.alwaysValidSchema)(i,s)}_if.default=def$3;var thenElse={};Object.defineProperty(thenElse,"__esModule",{value:!0});const util_1$1=util,def$2={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:i,parentSchema:e,it:s}){e.if===void 0&&(0,util_1$1.checkStrictMode)(s,`"${i}" without "if" is ignored`)}};thenElse.default=def$2,Object.defineProperty(applicator,"__esModule",{value:!0});const additionalItems_1=additionalItems,prefixItems_1=prefixItems,items_1=items,items2020_1=items2020,contains_1=contains,dependencies_1=dependencies,propertyNames_1=propertyNames,additionalProperties_1=additionalProperties,properties_1=properties$1,patternProperties_1=patternProperties,not_1=not,anyOf_1=anyOf,oneOf_1=oneOf,allOf_1=allOf,if_1=_if,thenElse_1=thenElse;function getApplicator(i=!1){const e=[not_1.default,anyOf_1.default,oneOf_1.default,allOf_1.default,if_1.default,thenElse_1.default,propertyNames_1.default,additionalProperties_1.default,dependencies_1.default,properties_1.default,patternProperties_1.default];return i?e.push(prefixItems_1.default,items2020_1.default):e.push(additionalItems_1.default,items_1.default),e.push(contains_1.default),e}applicator.default=getApplicator;var format$2={},format$1={};Object.defineProperty(format$1,"__esModule",{value:!0});const codegen_1$1=codegen,error$1={message:({schemaCode:i})=>(0,codegen_1$1.str)`must match format "${i}"`,params:({schemaCode:i})=>(0,codegen_1$1._)`{format: ${i}}`},def$1={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:error$1,code(i,e){const{gen:s,data:c,$data:h,schema:$,schemaCode:_,it:j}=i,{opts:nt,errSchemaPath:et,schemaEnv:b,self:a}=j;if(!nt.validateFormats)return;h?o():d();function o(){const g=s.scopeValue("formats",{ref:a.formats,code:nt.code.formats}),rt=s.const("fDef",(0,codegen_1$1._)`${g}[${_}]`),st=s.let("fType"),tt=s.let("format");s.if((0,codegen_1$1._)`typeof ${rt} == "object" && !(${rt} instanceof RegExp)`,()=>s.assign(st,(0,codegen_1$1._)`${rt}.type || "string"`).assign(tt,(0,codegen_1$1._)`${rt}.validate`),()=>s.assign(st,(0,codegen_1$1._)`"string"`).assign(tt,rt)),i.fail$data((0,codegen_1$1.or)(ot(),it()));function ot(){return nt.strictSchema===!1?codegen_1$1.nil:(0,codegen_1$1._)`${_} && !${tt}`}function it(){const at=b.$async?(0,codegen_1$1._)`(${rt}.async ? await ${tt}(${c}) : ${tt}(${c}))`:(0,codegen_1$1._)`${tt}(${c})`,ut=(0,codegen_1$1._)`(typeof ${tt} == "function" ? ${at} : ${tt}.test(${c}))`;return(0,codegen_1$1._)`${tt} && ${tt} !== true && ${st} === ${e} && !${ut}`}}function d(){const g=a.formats[$];if(!g){ot();return}if(g===!0)return;const[rt,st,tt]=it(g);rt===e&&i.pass(at());function ot(){if(nt.strictSchema===!1){a.logger.warn(ut());return}throw new Error(ut());function ut(){return`unknown format "${$}" ignored in schema at path "${et}"`}}function it(ut){const lt=ut instanceof RegExp?(0,codegen_1$1.regexpCode)(ut):nt.code.formats?(0,codegen_1$1._)`${nt.code.formats}${(0,codegen_1$1.getProperty)($)}`:void 0,ct=s.scopeValue("formats",{key:$,ref:ut,code:lt});return typeof ut=="object"&&!(ut instanceof RegExp)?[ut.type||"string",ut.validate,(0,codegen_1$1._)`${ct}.validate`]:["string",ut,ct]}function at(){if(typeof g=="object"&&!(g instanceof RegExp)&&g.async){if(!b.$async)throw new Error("async format in sync schema");return(0,codegen_1$1._)`await ${tt}(${c})`}return typeof st=="function"?(0,codegen_1$1._)`${tt}(${c})`:(0,codegen_1$1._)`${tt}.test(${c})`}}}};format$1.default=def$1,Object.defineProperty(format$2,"__esModule",{value:!0});const format_1$1=format$1,format=[format_1$1.default];format$2.default=format;var metadata={};Object.defineProperty(metadata,"__esModule",{value:!0}),metadata.contentVocabulary=metadata.metadataVocabulary=void 0,metadata.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],metadata.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"],Object.defineProperty(draft7,"__esModule",{value:!0});const core_1=core$1,validation_1=validation$1,applicator_1=applicator,format_1=format$2,metadata_1=metadata,draft7Vocabularies=[core_1.default,validation_1.default,(0,applicator_1.default)(),format_1.default,metadata_1.metadataVocabulary,metadata_1.contentVocabulary];draft7.default=draft7Vocabularies;var discriminator={},types={};Object.defineProperty(types,"__esModule",{value:!0}),types.DiscrError=void 0;var DiscrError;(function(i){i.Tag="tag",i.Mapping="mapping"})(DiscrError||(types.DiscrError=DiscrError={})),Object.defineProperty(discriminator,"__esModule",{value:!0});const codegen_1=codegen,types_1=types,compile_1=compile,ref_error_1=ref_error,util_1=util,error={message:({params:{discrError:i,tagName:e}})=>i===types_1.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:i,tag:e,tagName:s}})=>(0,codegen_1._)`{error: ${i}, tag: ${s}, tagValue: ${e}}`},def={keyword:"discriminator",type:"object",schemaType:"object",error,code(i){const{gen:e,data:s,schema:c,parentSchema:h,it:$}=i,{oneOf:_}=h;if(!$.opts.discriminator)throw new Error("discriminator: requires discriminator option");const j=c.propertyName;if(typeof j!="string")throw new Error("discriminator: requires propertyName");if(c.mapping)throw new Error("discriminator: mapping is not supported");if(!_)throw new Error("discriminator: requires oneOf keyword");const nt=e.let("valid",!1),et=e.const("tag",(0,codegen_1._)`${s}${(0,codegen_1.getProperty)(j)}`);e.if((0,codegen_1._)`typeof ${et} == "string"`,()=>b(),()=>i.error(!1,{discrError:types_1.DiscrError.Tag,tag:et,tagName:j})),i.ok(nt);function b(){const d=o();e.if(!1);for(const g in d)e.elseIf((0,codegen_1._)`${et} === ${g}`),e.assign(nt,a(d[g]));e.else(),i.error(!1,{discrError:types_1.DiscrError.Mapping,tag:et,tagName:j}),e.endIf()}function a(d){const g=e.name("valid"),rt=i.subschema({keyword:"oneOf",schemaProp:d},g);return i.mergeEvaluated(rt,codegen_1.Name),g}function o(){var d;const g={},rt=tt(h);let st=!0;for(let at=0;at<_.length;at++){let ut=_[at];if(ut!=null&&ut.$ref&&!(0,util_1.schemaHasRulesButRef)(ut,$.self.RULES)){const ct=ut.$ref;if(ut=compile_1.resolveRef.call($.self,$.schemaEnv.root,$.baseId,ct),ut instanceof compile_1.SchemaEnv&&(ut=ut.schema),ut===void 0)throw new ref_error_1.default($.opts.uriResolver,$.baseId,ct)}const lt=(d=ut==null?void 0:ut.properties)===null||d===void 0?void 0:d[j];if(typeof lt!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${j}"`);st=st&&(rt||tt(ut)),ot(lt,at)}if(!st)throw new Error(`discriminator: "${j}" must be required`);return g;function tt({required:at}){return Array.isArray(at)&&at.includes(j)}function ot(at,ut){if(at.const)it(at.const,ut);else if(at.enum)for(const lt of at.enum)it(lt,ut);else throw new Error(`discriminator: "properties/${j}" must have "const" or "enum"`)}function it(at,ut){if(typeof at!="string"||at in g)throw new Error(`discriminator: "${j}" values must be unique strings`);g[at]=ut}}}};discriminator.default=def;const $schema$1="http://json-schema.org/draft-07/schema#",$id="http://json-schema.org/draft-07/schema#",title="Core schema meta-schema",definitions$1={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type=["object","boolean"],properties={$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},require$$3={$schema:$schema$1,$id,title,definitions:definitions$1,type,properties,default:!0};(function(i,e){Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv=void 0;const s=core$2,c=draft7,h=discriminator,$=require$$3,_=["/properties"],j="http://json-schema.org/draft-07/schema";class nt extends s.default{_addVocabularies(){super._addVocabularies(),c.default.forEach(g=>this.addVocabulary(g)),this.opts.discriminator&&this.addKeyword(h.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const g=this.opts.$data?this.$dataMetaSchema($,_):$;this.addMetaSchema(g,j,!1),this.refs["http://json-schema.org/schema"]=j}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(j)?j:void 0)}}e.Ajv=nt,i.exports=e=nt,i.exports.Ajv=nt,Object.defineProperty(e,"__esModule",{value:!0}),e.default=nt;var et=validate;Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return et.KeywordCxt}});var b=codegen;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return b._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return b.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return b.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return b.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return b.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return b.CodeGen}});var a=validation_error;Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return a.default}});var o=ref_error;Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return o.default}})})(ajv,ajv.exports);var ajvExports=ajv.exports;const Ajv=getDefaultExportFromCjs(ajvExports);var dist$1={exports:{}},formats={};(function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.formatNames=i.fastFormats=i.fullFormats=void 0;function e(St,bt){return{validate:St,compare:bt}}i.fullFormats={date:e($,_),time:e(nt(!0),et),"date-time":e(o(!0),d),"iso-time":e(nt(),b),"iso-date-time":e(o(),g),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:tt,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:yt,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:it,int32:{type:"number",validate:lt},int64:{type:"number",validate:ct},float:{type:"number",validate:ft},double:{type:"number",validate:ft},password:!0,binary:!0},i.fastFormats={...i.fullFormats,date:e(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,_),time:e(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,et),"date-time":e(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,d),"iso-time":e(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,b),"iso-date-time":e(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,g),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},i.formatNames=Object.keys(i.fullFormats);function s(St){return St%4===0&&(St%100!==0||St%400===0)}const c=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,h=[0,31,28,31,30,31,30,31,31,30,31,30,31];function $(St){const bt=c.exec(St);if(!bt)return!1;const Tt=+bt[1],vt=+bt[2],$t=+bt[3];return vt>=1&&vt<=12&&$t>=1&&$t<=(vt===2&&s(Tt)?29:h[vt])}function _(St,bt){if(St&&bt)return St>bt?1:St<bt?-1:0}const j=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function nt(St){return function(Tt){const vt=j.exec(Tt);if(!vt)return!1;const $t=+vt[1],At=+vt[2],Ot=+vt[3],It=vt[4],jt=vt[5]==="-"?-1:1,Et=+(vt[6]||0),mt=+(vt[7]||0);if(Et>23||mt>59||St&&!It)return!1;if($t<=23&&At<=59&&Ot<60)return!0;const gt=At-mt*jt,ht=$t-Et*jt-(gt<0?1:0);return(ht===23||ht===-1)&&(gt===59||gt===-1)&&Ot<61}}function et(St,bt){if(!(St&&bt))return;const Tt=new Date("2020-01-01T"+St).valueOf(),vt=new Date("2020-01-01T"+bt).valueOf();if(Tt&&vt)return Tt-vt}function b(St,bt){if(!(St&&bt))return;const Tt=j.exec(St),vt=j.exec(bt);if(Tt&&vt)return St=Tt[1]+Tt[2]+Tt[3],bt=vt[1]+vt[2]+vt[3],St>bt?1:St<bt?-1:0}const a=/t|\s/i;function o(St){const bt=nt(St);return function(vt){const $t=vt.split(a);return $t.length===2&&$($t[0])&&bt($t[1])}}function d(St,bt){if(!(St&&bt))return;const Tt=new Date(St).valueOf(),vt=new Date(bt).valueOf();if(Tt&&vt)return Tt-vt}function g(St,bt){if(!(St&&bt))return;const[Tt,vt]=St.split(a),[$t,At]=bt.split(a),Ot=_(Tt,$t);if(Ot!==void 0)return Ot||et(vt,At)}const rt=/\/|:/,st=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function tt(St){return rt.test(St)&&st.test(St)}const ot=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function it(St){return ot.lastIndex=0,ot.test(St)}const at=-2147483648,ut=2**31-1;function lt(St){return Number.isInteger(St)&&St<=ut&&St>=at}function ct(St){return Number.isInteger(St)}function ft(){return!0}const dt=/[^\\]\\Z/;function yt(St){if(dt.test(St))return!1;try{return new RegExp(St),!0}catch{return!1}}})(formats);var limit={};(function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.formatLimitDefinition=void 0;const e=ajvExports,s=codegen,c=s.operators,h={formatMaximum:{okStr:"<=",ok:c.LTE,fail:c.GT},formatMinimum:{okStr:">=",ok:c.GTE,fail:c.LT},formatExclusiveMaximum:{okStr:"<",ok:c.LT,fail:c.GTE},formatExclusiveMinimum:{okStr:">",ok:c.GT,fail:c.LTE}},$={message:({keyword:j,schemaCode:nt})=>(0,s.str)`should be ${h[j].okStr} ${nt}`,params:({keyword:j,schemaCode:nt})=>(0,s._)`{comparison: ${h[j].okStr}, limit: ${nt}}`};i.formatLimitDefinition={keyword:Object.keys(h),type:"string",schemaType:"string",$data:!0,error:$,code(j){const{gen:nt,data:et,schemaCode:b,keyword:a,it:o}=j,{opts:d,self:g}=o;if(!d.validateFormats)return;const rt=new e.KeywordCxt(o,g.RULES.all.format.definition,"format");rt.$data?st():tt();function st(){const it=nt.scopeValue("formats",{ref:g.formats,code:d.code.formats}),at=nt.const("fmt",(0,s._)`${it}[${rt.schemaCode}]`);j.fail$data((0,s.or)((0,s._)`typeof ${at} != "object"`,(0,s._)`${at} instanceof RegExp`,(0,s._)`typeof ${at}.compare != "function"`,ot(at)))}function tt(){const it=rt.schema,at=g.formats[it];if(!at||at===!0)return;if(typeof at!="object"||at instanceof RegExp||typeof at.compare!="function")throw new Error(`"${a}": format "${it}" does not define "compare" function`);const ut=nt.scopeValue("formats",{key:it,ref:at,code:d.code.formats?(0,s._)`${d.code.formats}${(0,s.getProperty)(it)}`:void 0});j.fail$data(ot(ut))}function ot(it){return(0,s._)`${it}.compare(${et}, ${b}) ${h[a].fail} 0`}},dependencies:["format"]};const _=j=>(j.addKeyword(i.formatLimitDefinition),j);i.default=_})(limit),function(i,e){Object.defineProperty(e,"__esModule",{value:!0});const s=formats,c=limit,h=codegen,$=new h.Name("fullFormats"),_=new h.Name("fastFormats"),j=(et,b={keywords:!0})=>{if(Array.isArray(b))return nt(et,b,s.fullFormats,$),et;const[a,o]=b.mode==="fast"?[s.fastFormats,_]:[s.fullFormats,$],d=b.formats||s.formatNames;return nt(et,d,a,o),b.keywords&&(0,c.default)(et),et};j.get=(et,b="full")=>{const o=(b==="fast"?s.fastFormats:s.fullFormats)[et];if(!o)throw new Error(`Unknown format "${et}"`);return o};function nt(et,b,a,o){var d,g;(d=(g=et.opts.code).formats)!==null&&d!==void 0||(g.formats=(0,h._)`require("ajv-formats/dist/formats").${o}`);for(const rt of b)et.addFormat(rt,a[rt])}i.exports=e=j,Object.defineProperty(e,"__esModule",{value:!0}),e.default=j}(dist$1,dist$1.exports);var distExports=dist$1.exports;const addFormats=getDefaultExportFromCjs(distExports);class ScribeError extends Error{constructor(e,s=ErrorCode.INTERNAL_ERROR,c,h){super(e),this.name="ScribeError",this.code=s,this.httpStatus=c,this.details=h,Error.captureStackTrace&&Error.captureStackTrace(this,ScribeError)}static fromApiError(e,s){return new ScribeError(e.message,e.code,s,e.details)}toJSON(){return{name:this.name,message:this.message,code:this.code,httpStatus:this.httpStatus,details:this.details}}}class ValidationError extends ScribeError{constructor(e,s){super(e,ErrorCode.INVALID_REQUEST,HttpStatus.BAD_REQUEST,s),this.name="ValidationError"}}const $schema="http://json-schema.org/draft-07/schema#",definitions={CreateSessionRequest:{type:"object",required:["templates","upload_type","communication_protocol"],properties:{templates:{type:"array",items:{type:"string"},maxItems:2,description:"Derived from /templates api response in /.well-known/discovery. See discovery document for validations."},model:{type:"string",enum:["pro","lite"],default:"lite"},language_hint:{type:"array",items:{type:"string",maxLength:2},description:"IRC language codes. See discovery document for supported languages."},transcript_language:{type:"array",items:{type:"string",maxLength:2},default:["en"],description:"IRC language codes. See discovery document for supported languages."},upload_type:{type:"string",enum:["chunked","single","stream"]},communication_protocol:{type:"string",enum:["websocket","http","rpc"]},additional_data:{type:"object",additionalProperties:!0}}},SessionIdParam:{type:"string",pattern:"^ses_[a-zA-Z0-9]+$",description:"Unique session identifier"},CreateSessionResponse:{type:"object",required:["session_id","status","created_at","expires_at","upload_url"],properties:{session_id:{type:"string",minLength:16,maxLength:32,pattern:"^ses_[a-zA-Z0-9]+$",description:"Unique identifier for the session (16 or 32 bytes string)",example:"ses_abc123def456"},status:{type:"string",enum:["created","initialized","processing","completed","failed"],description:"Current status of the session",example:"created"},created_at:{type:"string",format:"date-time",description:"ISO 8601 timestamp when the session was created",example:"2025-01-19T10:30:00Z"},expires_at:{type:"string",format:"date-time",description:"ISO 8601 timestamp when the session will expire",example:"2025-01-19T11:30:00Z"},upload_url:{type:"string",format:"uri",description:"URL endpoint for uploading audio files to this session",example:"https://api.scribe.example.com/v1/sessions/ses_abc123def456/audio"}}},SessionProcessingResponse:{type:"object",required:["session_id","status","created_at","expires_at","audio_files_received","audio_files","additional_data","transcript"],properties:{session_id:{type:"string",minLength:16,maxLength:32,pattern:"^ses_[a-zA-Z0-9]+$"},status:{type:"string",enum:["created","initialized","processing","completed","failed"]},created_at:{type:"string",format:"date-time"},expires_at:{type:"string",format:"date-time"},audio_files_received:{type:"integer"},audio_files:{type:"array",items:{type:"string"}},additional_data:{type:"object",additionalProperties:!0},transcript:{type:"string"}}},SessionCompletedResponse:{type:"object",required:["session_id","status","created_at","audio_files_received","audio_files"],properties:{session_id:{type:"string",minLength:16,maxLength:32,pattern:"^ses_[a-zA-Z0-9]+$"},status:{type:"string",enum:["created","initialized","processing","completed","failed"]},created_at:{type:"string",format:"date-time"},completed_at:{type:"string",format:"date-time"},model_used:{type:"string",enum:["pro","lite"]},language_detected:{type:"string",minLength:2,maxLength:2},audio_files_received:{type:"integer",minimum:0},audio_files:{type:"array",items:{type:"string"}},additional_data:{type:"object",additionalProperties:!0},templates:{type:"object",additionalProperties:{$ref:"#/definitions/TemplateResult"}},transcript:{type:"string"}}},SessionPartialResponse:{type:"object",required:["session_id","status","created_at","audio_files_received","audio_files","audio_files_processed","templates"],properties:{session_id:{type:"string",minLength:16,maxLength:32,pattern:"^ses_[a-zA-Z0-9]+$"},status:{type:"string",enum:["created","processing","partial","completed","failed"]},created_at:{type:"string",format:"date-time"},completed_at:{type:["string","null"],format:"date-time"},model_used:{type:"string",enum:["pro","lite"]},language_detected:{type:"string",minLength:2,maxLength:5},audio_files_received:{type:"integer",minimum:0},audio_files_processed:{type:"integer",minimum:0},audio_files:{type:"array",items:{type:"string"}},additional_data:{type:"object",additionalProperties:!0},templates:{type:"object",additionalProperties:{$ref:"#/definitions/TemplateResult"}},transcript:{type:"string"},processing_errors:{type:"array",items:{$ref:"#/definitions/ProcessingError"}}}},EndSessionResponse:{type:"object",required:["session_id","status","message","audio_files_received","audio_files"],properties:{session_id:{type:"string",minLength:16,maxLength:32,pattern:"^ses_[a-zA-Z0-9]+$"},status:{type:"string",enum:["processing"]},message:{type:"string"},audio_files_received:{type:"integer",minimum:0},audio_files:{type:"array",items:{type:"string"}}}},ExpiredSessionResponse:{type:"object",required:["session_id","status","created_at","expired_at","message","audio_files_received","audio_files"],properties:{session_id:{type:"string",minLength:16,maxLength:32,pattern:"^ses_[a-zA-Z0-9]+$"},status:{type:"string",enum:["expired"]},created_at:{type:"string",format:"date-time"},expired_at:{type:"string",format:"date-time"},message:{type:"string"},audio_files_received:{type:"integer",minimum:0},audio_files:{type:"array",items:{type:"string"}},additional_data:{type:"object",additionalProperties:!0},templates:{type:"object",additionalProperties:{$ref:"#/definitions/TemplateResult"}},transcript:{type:["string","null"]},model_used:{type:"string",enum:["pro","lite"]},language_detected:{type:"string",minLength:2,maxLength:2},audio_files_processed:{type:"integer",minimum:0}}},TemplateResult:{type:"object",required:["status"],properties:{status:{type:"string",enum:["success","failed","processing"]},data:{oneOf:[{type:"object",additionalProperties:!0},{type:"array",items:{type:"object",additionalProperties:!0}}]},error:{$ref:"#/definitions/TemplateError"}}},TemplateError:{type:"object",required:["code","message"],properties:{code:{type:"string"},message:{type:"string"}}},ProcessingError:{type:"object",required:["type","message"],properties:{type:{type:"string"},message:{type:"string"},file:{type:"string"}}}},schemas={$schema,definitions};class SchemaValidator{constructor(){this.validators=new Map,this.ajv=new Ajv({allErrors:!0,strict:!0,validateFormats:!0}),addFormats(this.ajv),this.compileSchemas()}compileSchemas(){schemas.definitions&&Object.entries(schemas.definitions).forEach(([e,s])=>{try{const c=this.ajv.compile({...s,$schema:schemas.$schema,definitions:schemas.definitions});this.validators.set(e,c)}catch(c){console.error(`Failed to compile schema for ${e}:`,c)}})}validate(e,s){const c=this.validators.get(e);if(!c)throw new ValidationError(`Schema '${e}' not found`);if(!c(s)&&c.errors){const $=this.formatErrors(c.errors);throw new ValidationError(`Validation failed for ${e}:
|
|
48
48
|
${$}`)}}validateCreateSessionRequest(e){this.validate("CreateSessionRequest",e)}validateSessionId(e){this.validate("SessionIdParam",e)}formatErrors(e){return e.map(s=>{var $;let h=`${s.instancePath||"root"}: ${s.message}`;return s.keyword==="enum"?h+=` (allowed values: ${($=s.params.allowedValues)==null?void 0:$.join(", ")})`:s.keyword==="pattern"?h+=` (pattern: ${s.params.pattern})`:s.keyword==="required"?h+=` (missing property: ${s.params.missingProperty})`:s.keyword==="type"&&(h+=` (expected type: ${s.params.type})`),` - ${h}`}).join(`
|
|
49
|
-
`)}getValidator(e){return this.validators.get(e)}}const schemaValidator=new SchemaValidator;class SessionAPI{constructor(e,s){this.httpClient=e,this.baseUrl=s}setBaseUrl(e){this.baseUrl=e}async createSession(e){schemaValidator.validateCreateSessionRequest(e);const s=`${this.baseUrl}/sessions`;return this.httpClient.post(s,e)}async getSessionStatus(e){schemaValidator.validateSessionId(e);const s=`${this.baseUrl}/sessions/${e}`;return this.httpClient.get(s)}async endSession(e,s){const c=`${this.baseUrl}/sessions/${e}/end`,h=s!==void 0?{audio_files_sent:s}:void 0;return this.httpClient.post(c,h)}async pollSessionStatus(e,s={}){const{maxAttempts:c=60,intervalMs:h=2e3,onProgress:$}=s;for(let _=0;_<c;_++){const j=await this.getSessionStatus(e);if($&&$(j),j.status==="completed"||j.status==="partial"||j.status==="failed")return j;_<c-1&&await this.sleep(h)}throw new Error(`Polling timeout: session ${e} did not complete after ${c} attempts`)}sleep(e){return new Promise(s=>setTimeout(s,e))}}class HttpClient{constructor(e,s,c=!1){this.apiKey=e,this.debug=c,this.accessToken=s}async request(e,s){const c={"Content-Type":"application/json",Accept:"application/json",...s.headers};this.apiKey&&(c["X-API-Key"]=this.apiKey),this.accessToken&&(c.Authorization=`Bearer ${this.accessToken}`);const h={method:s.method,headers:c,credentials:"include"};s.body&&(h.body=JSON.stringify(s.body)),this.debug&&console.log("[ScribeSDK] Request:",{url:e,method:s.method,headers:c,body:s.body});try{const $=await fetch(e,h);if(this.debug&&console.log("[ScribeSDK] Response:",{status:$.status,statusText:$.statusText}),$.ok)return await $.json();throw await this.handleErrorResponse($),new ScribeError("Unexpected error occurred")}catch($){throw $ instanceof ScribeError?$:new ScribeError(`Network error: ${$ instanceof Error?$.message:"Unknown error"}`,"network_error")}}async handleErrorResponse(e){let s=null;try{s=await e.json()}catch{throw new ScribeError(`HTTP ${e.status}: ${e.statusText}`,"http_error",e.status)}throw s!=null&&s.error?ScribeError.fromApiError(s.error,e.status):new ScribeError(`HTTP ${e.status}: ${e.statusText}`,"http_error",e.status)}async get(e,s){return this.request(e,{method:"GET",headers:s})}async post(e,s,c){return this.request(e,{method:"POST",body:s,headers:c})}async put(e,s,c){return this.request(e,{method:"PUT",body:s,headers:c})}async patch(e,s,c){return this.request(e,{method:"PATCH",body:s,headers:c})}async delete(e,s){return this.request(e,{method:"DELETE",headers:s})}}const PREF_CHUNK_LENGTH=10,DESP_CHUNK_LENGTH=20,MAX_CHUNK_LENGTH=25,FRAME_SIZE=1024,SAMPLING_RATE=16e3,SHORT_SILENCE_THRESHOLD=.1,LONG_SILENCE_THRESHOLD=.5,PRE_SPEECH_PAD_FRAMES=20,BITRATE=128,AUDIO_BUFFER_SIZE_IN_S=DESP_CHUNK_LENGTH+5,OUTPUT_FORMAT="mp3",AUDIO_EXTENSION_TYPE_MAP={m4a:"audio/m4a",wav:"audio/wav",mp3:"audio/mpeg"};function Xa(i){return new Int8Array(i)}function ma(i){return new Int16Array(i)}function ba(i){return new Int32Array(i)}function ca(i){return new Float32Array(i)}function Ya(i){return new Float64Array(i)}function Sa(i){if(i.length==1)return ca(i[0]);var e=i[0];i=i.slice(1);for(var s=[],c=0;c<e;c++)s.push(Sa(i));return s}function da(i){if(i.length==1)return ba(i[0]);var e=i[0];i=i.slice(1);for(var s=[],c=0;c<e;c++)s.push(da(i));return s}function Aa(i){if(i.length==1)return ma(i[0]);var e=i[0];i=i.slice(1);for(var s=[],c=0;c<e;c++)s.push(Aa(i));return s}function Ra(i){if(i.length==1)return new Array(i[0]);var e=i[0];i=i.slice(1);for(var s=[],c=0;c<e;c++)s.push(Ra(i));return s}var xa={};xa.fill=function(i,e,s,c){if(arguments.length==2)for(var h=0;h<i.length;h++)i[h]=arguments[1];else for(var h=e;h<s;h++)i[h]=c};var W1={};W1.arraycopy=function(i,e,s,c,h){for(var $=e+h;e<$;)s[c++]=i[e++]},W1.out={},W1.out.println=function(i){console.log(i)},W1.out.printf=function(){console.log.apply(console,arguments)};var se={};se.SQRT2=1.4142135623730951,se.FAST_LOG10=function(i){return Math.log10(i)},se.FAST_LOG10_X=function(i,e){return Math.log10(i)*e};function B1(i){this.ordinal=i}B1.short_block_allowed=new B1(0),B1.short_block_coupled=new B1(1),B1.short_block_dispensed=new B1(2),B1.short_block_forced=new B1(3);var Ma={};Ma.MAX_VALUE=34028235e31;function u1(i){this.ordinal=i}u1.vbr_off=new u1(0),u1.vbr_mt=new u1(1),u1.vbr_rh=new u1(2),u1.vbr_abr=new u1(3),u1.vbr_mtrh=new u1(4),u1.vbr_default=u1.vbr_mtrh;var qa=function(i){},Q0={System:W1,VbrMode:u1,Float:Ma,ShortBlock:B1,Util:se,Arrays:xa,new_array_n:Ra,new_byte:Xa,new_double:Ya,new_float:ca,new_float_n:Sa,new_int:ba,new_int_n:da,new_short_n:Aa,assert:qa},ce,De;function Da(){if(De)return ce;De=1;var i=Q0,e=i.System,s=i.Util,c=i.Arrays,h=i.new_float,$=t1();function _(){var j=[-.1482523854003001,32.308141959636465,296.40344946382766,883.1344870032432,11113.947376231741,1057.2713659324597,305.7402417275812,30.825928907280012,3.8533188138216365,59.42900443849514,709.5899960123345,5281.91112291017,-5829.66483675846,-817.6293103748613,-76.91656988279972,-4.594269939176596,.9063471690191471,.1960342806591213,-.15466694054279598,34.324387823855965,301.8067566458425,817.599602898885,11573.795901679885,1181.2520595540152,321.59731579894424,31.232021761053772,3.7107095756221318,53.650946155329365,684.167428119626,5224.56624370173,-6366.391851890084,-908.9766368219582,-89.83068876699639,-5.411397422890401,.8206787908286602,.3901806440322567,-.16070888947830023,36.147034243915876,304.11815768187864,732.7429163887613,11989.60988270091,1300.012278487897,335.28490093152146,31.48816102859945,3.373875931311736,47.232241542899175,652.7371796173471,5132.414255594984,-6909.087078780055,-1001.9990371107289,-103.62185754286375,-6.104916304710272,.7416505462720353,.5805693545089249,-.16636367662261495,37.751650073343995,303.01103387567713,627.9747488785183,12358.763425278165,1412.2779918482834,346.7496836825721,31.598286663170416,3.1598635433980946,40.57878626349686,616.1671130880391,5007.833007176154,-7454.040671756168,-1095.7960341867115,-118.24411666465777,-6.818469345853504,.6681786379192989,.7653668647301797,-.1716176790982088,39.11551877123304,298.3413246578966,503.5259106886539,12679.589408408976,1516.5821921214542,355.9850766329023,31.395241710249053,2.9164211881972335,33.79716964664243,574.8943997801362,4853.234992253242,-7997.57021486075,-1189.7624067269965,-133.6444792601766,-7.7202770609839915,.5993769336819237,.9427934736519954,-.17645823955292173,40.21879108166477,289.9982036694474,359.3226160751053,12950.259102786438,1612.1013903507662,362.85067106591504,31.045922092242872,2.822222032597987,26.988862316190684,529.8996541764288,4671.371946949588,-8535.899136645805,-1282.5898586244496,-149.58553632943463,-8.643494270763135,.5345111359507916,1.111140466039205,-.36174739330527045,41.04429910497807,277.5463268268618,195.6386023135583,13169.43812144731,1697.6433561479398,367.40983966190305,30.557037410382826,2.531473372857427,20.070154905927314,481.50208566532336,4464.970341588308,-9065.36882077239,-1373.62841526722,-166.1660487028118,-9.58289321133207,.4729647758913199,1.268786568327291,-.36970682634889585,41.393213350082036,261.2935935556502,12.935476055240873,13336.131683328815,1772.508612059496,369.76534388639965,29.751323653701338,2.4023193045459172,13.304795348228817,430.5615775526625,4237.0568611071185,-9581.931701634761,-1461.6913552409758,-183.12733958476446,-10.718010163869403,.41421356237309503,1.414213562373095,-.37677560326535325,41.619486213528496,241.05423794991074,-187.94665032361226,13450.063605744153,1836.153896465782,369.4908799925761,29.001847876923147,2.0714759319987186,6.779591200894186,377.7767837205709,3990.386575512536,-10081.709459700915,-1545.947424837898,-200.3762958015653,-11.864482073055006,.3578057213145241,1.546020906725474,-.3829366947518991,41.1516456456653,216.47684307105183,-406.1569483347166,13511.136535077321,1887.8076599260432,367.3025214564151,28.136213436723654,1.913880671464418,.3829366947518991,323.85365704338597,3728.1472257487526,-10561.233882199509,-1625.2025997821418,-217.62525175416,-13.015432208941645,.3033466836073424,1.66293922460509,-.5822628872992417,40.35639251440489,188.20071124269245,-640.2706748618148,13519.21490106562,1927.6022433578062,362.8197642637487,26.968821921868447,1.7463817695935329,-5.62650678237171,269.3016715297017,3453.386536448852,-11016.145278780888,-1698.6569643425091,-234.7658734267683,-14.16351421663124,.2504869601913055,1.76384252869671,-.5887180101749253,39.23429103868072,155.76096234403798,-889.2492977967378,13475.470561874661,1955.0535223723712,356.4450994756727,25.894952980042156,1.5695032905781554,-11.181939564328772,214.80884394039484,3169.1640829158237,-11443.321309975563,-1765.1588461316153,-251.68908574481912,-15.49755935939164,.198912367379658,1.847759065022573,-.7912582233652842,37.39369355329111,119.699486012458,-1151.0956593239027,13380.446257078214,1970.3952110853447,348.01959814116185,24.731487364283044,1.3850130831637748,-16.421408865300393,161.05030052864092,2878.3322807850063,-11838.991423510031,-1823.985884688674,-268.2854986386903,-16.81724543849939,.1483359875383474,1.913880671464418,-.7960642926861912,35.2322109610459,80.01928065061526,-1424.0212633405113,13235.794061869668,1973.804052543835,337.9908651258184,23.289159354463873,1.3934255946442087,-21.099669467133474,108.48348407242611,2583.700758091299,-12199.726194855148,-1874.2780658979746,-284.2467154529415,-18.11369784385905,.09849140335716425,1.961570560806461,-.998795456205172,32.56307803611191,36.958364584370486,-1706.075448829146,13043.287458812016,1965.3831106103316,326.43182772364605,22.175018750622293,1.198638339011324,-25.371248002043963,57.53505923036915,2288.41886619975,-12522.674544337233,-1914.8400385312243,-299.26241273417224,-19.37805630698734,.04912684976946725,1.990369453344394,.035780907*s.SQRT2*.5/2384e-9,.017876148*s.SQRT2*.5/2384e-9,.003134727*s.SQRT2*.5/2384e-9,.002457142*s.SQRT2*.5/2384e-9,971317e-9*s.SQRT2*.5/2384e-9,218868e-9*s.SQRT2*.5/2384e-9,101566e-9*s.SQRT2*.5/2384e-9,13828e-9*s.SQRT2*.5/2384e-9,12804.797818791945,1945.5515939597317,313.4244966442953,20.801593959731544,1995.1556208053692,9.000838926174497,-29.20218120805369],nt=[[2382191739347913e-28,6423305872147834e-28,9400849094049688e-28,1122435026096556e-27,1183840321267481e-27,1122435026096556e-27,940084909404969e-27,6423305872147839e-28,2382191739347918e-28,5456116108943412e-27,4878985199565852e-27,4240448995017367e-27,3559909094758252e-27,2858043359288075e-27,2156177623817898e-27,1475637723558783e-27,8371015190102974e-28,2599706096327376e-28,-5456116108943412e-27,-4878985199565852e-27,-4240448995017367e-27,-3559909094758252e-27,-2858043359288076e-27,-2156177623817898e-27,-1475637723558783e-27,-8371015190102975e-28,-2599706096327376e-28,-2382191739347923e-28,-6423305872147843e-28,-9400849094049696e-28,-1122435026096556e-27,-1183840321267481e-27,-1122435026096556e-27,-9400849094049694e-28,-642330587214784e-27,-2382191739347918e-28],[2382191739347913e-28,6423305872147834e-28,9400849094049688e-28,1122435026096556e-27,1183840321267481e-27,1122435026096556e-27,9400849094049688e-28,6423305872147841e-28,2382191739347918e-28,5456116108943413e-27,4878985199565852e-27,4240448995017367e-27,3559909094758253e-27,2858043359288075e-27,2156177623817898e-27,1475637723558782e-27,8371015190102975e-28,2599706096327376e-28,-5461314069809755e-27,-4921085770524055e-27,-4343405037091838e-27,-3732668368707687e-27,-3093523840190885e-27,-2430835727329465e-27,-1734679010007751e-27,-974825365660928e-27,-2797435120168326e-28,0,0,0,0,0,0,-2283748241799531e-28,-4037858874020686e-28,-2146547464825323e-28],[.1316524975873958,.414213562373095,.7673269879789602,1.091308501069271,1.303225372841206,1.56968557711749,1.920982126971166,2.414213562373094,3.171594802363212,4.510708503662055,7.595754112725146,22.90376554843115,.984807753012208,.6427876096865394,.3420201433256688,.9396926207859084,-.1736481776669303,-.7660444431189779,.8660254037844387,.5,-.5144957554275265,-.4717319685649723,-.3133774542039019,-.1819131996109812,-.09457419252642064,-.04096558288530405,-.01419856857247115,-.003699974673760037,.8574929257125442,.8817419973177052,.9496286491027329,.9833145924917901,.9955178160675857,.9991605581781475,.999899195244447,.9999931550702802],[0,0,0,0,0,0,2283748241799531e-28,4037858874020686e-28,2146547464825323e-28,5461314069809755e-27,4921085770524055e-27,4343405037091838e-27,3732668368707687e-27,3093523840190885e-27,2430835727329466e-27,1734679010007751e-27,974825365660928e-27,2797435120168326e-28,-5456116108943413e-27,-4878985199565852e-27,-4240448995017367e-27,-3559909094758253e-27,-2858043359288075e-27,-2156177623817898e-27,-1475637723558782e-27,-8371015190102975e-28,-2599706096327376e-28,-2382191739347913e-28,-6423305872147834e-28,-9400849094049688e-28,-1122435026096556e-27,-1183840321267481e-27,-1122435026096556e-27,-9400849094049688e-28,-6423305872147841e-28,-2382191739347918e-28]],et=nt[$.SHORT_TYPE],b=nt[$.SHORT_TYPE],a=nt[$.SHORT_TYPE],o=nt[$.SHORT_TYPE],d=[0,1,16,17,8,9,24,25,4,5,20,21,12,13,28,29,2,3,18,19,10,11,26,27,6,7,22,23,14,15,30,31];function g(tt,ot,it){for(var at=10,ut=ot+238-14-286,lt=-15;lt<0;lt++){var ct,ft,dt;ct=j[at+-10],ft=tt[ut+-224]*ct,dt=tt[ot+224]*ct,ct=j[at+-9],ft+=tt[ut+-160]*ct,dt+=tt[ot+160]*ct,ct=j[at+-8],ft+=tt[ut+-96]*ct,dt+=tt[ot+96]*ct,ct=j[at+-7],ft+=tt[ut+-32]*ct,dt+=tt[ot+32]*ct,ct=j[at+-6],ft+=tt[ut+32]*ct,dt+=tt[ot+-32]*ct,ct=j[at+-5],ft+=tt[ut+96]*ct,dt+=tt[ot+-96]*ct,ct=j[at+-4],ft+=tt[ut+160]*ct,dt+=tt[ot+-160]*ct,ct=j[at+-3],ft+=tt[ut+224]*ct,dt+=tt[ot+-224]*ct,ct=j[at+-2],ft+=tt[ot+-256]*ct,dt-=tt[ut+256]*ct,ct=j[at+-1],ft+=tt[ot+-192]*ct,dt-=tt[ut+192]*ct,ct=j[at+0],ft+=tt[ot+-128]*ct,dt-=tt[ut+128]*ct,ct=j[at+1],ft+=tt[ot+-64]*ct,dt-=tt[ut+64]*ct,ct=j[at+2],ft+=tt[ot+0]*ct,dt-=tt[ut+0]*ct,ct=j[at+3],ft+=tt[ot+64]*ct,dt-=tt[ut+-64]*ct,ct=j[at+4],ft+=tt[ot+128]*ct,dt-=tt[ut+-128]*ct,ct=j[at+5],ft+=tt[ot+192]*ct,dt-=tt[ut+-192]*ct,ft*=j[at+6],ct=dt-ft,it[30+lt*2]=dt+ft,it[31+lt*2]=j[at+7]*ct,at+=18,ot--,ut++}{var ft,dt,yt,St;dt=tt[ot+-16]*j[at+-10],ft=tt[ot+-32]*j[at+-2],dt+=(tt[ot+-48]-tt[ot+16])*j[at+-9],ft+=tt[ot+-96]*j[at+-1],dt+=(tt[ot+-80]+tt[ot+48])*j[at+-8],ft+=tt[ot+-160]*j[at+0],dt+=(tt[ot+-112]-tt[ot+80])*j[at+-7],ft+=tt[ot+-224]*j[at+1],dt+=(tt[ot+-144]+tt[ot+112])*j[at+-6],ft-=tt[ot+32]*j[at+2],dt+=(tt[ot+-176]-tt[ot+144])*j[at+-5],ft-=tt[ot+96]*j[at+3],dt+=(tt[ot+-208]+tt[ot+176])*j[at+-4],ft-=tt[ot+160]*j[at+4],dt+=(tt[ot+-240]-tt[ot+208])*j[at+-3],ft-=tt[ot+224],yt=ft-dt,St=ft+dt,dt=it[14],ft=it[15]-dt,it[31]=St+dt,it[30]=yt+ft,it[15]=yt-ft,it[14]=St-dt}{var bt;bt=it[28]-it[0],it[0]+=it[28],it[28]=bt*j[at+-2*18+7],bt=it[29]-it[1],it[1]+=it[29],it[29]=bt*j[at+-2*18+7],bt=it[26]-it[2],it[2]+=it[26],it[26]=bt*j[at+-4*18+7],bt=it[27]-it[3],it[3]+=it[27],it[27]=bt*j[at+-4*18+7],bt=it[24]-it[4],it[4]+=it[24],it[24]=bt*j[at+-6*18+7],bt=it[25]-it[5],it[5]+=it[25],it[25]=bt*j[at+-6*18+7],bt=it[22]-it[6],it[6]+=it[22],it[22]=bt*s.SQRT2,bt=it[23]-it[7],it[7]+=it[23],it[23]=bt*s.SQRT2-it[7],it[7]-=it[6],it[22]-=it[7],it[23]-=it[22],bt=it[6],it[6]=it[31]-bt,it[31]=it[31]+bt,bt=it[7],it[7]=it[30]-bt,it[30]=it[30]+bt,bt=it[22],it[22]=it[15]-bt,it[15]=it[15]+bt,bt=it[23],it[23]=it[14]-bt,it[14]=it[14]+bt,bt=it[20]-it[8],it[8]+=it[20],it[20]=bt*j[at+-10*18+7],bt=it[21]-it[9],it[9]+=it[21],it[21]=bt*j[at+-10*18+7],bt=it[18]-it[10],it[10]+=it[18],it[18]=bt*j[at+-12*18+7],bt=it[19]-it[11],it[11]+=it[19],it[19]=bt*j[at+-12*18+7],bt=it[16]-it[12],it[12]+=it[16],it[16]=bt*j[at+-14*18+7],bt=it[17]-it[13],it[13]+=it[17],it[17]=bt*j[at+-14*18+7],bt=-it[20]+it[24],it[20]+=it[24],it[24]=bt*j[at+-12*18+7],bt=-it[21]+it[25],it[21]+=it[25],it[25]=bt*j[at+-12*18+7],bt=it[4]-it[8],it[4]+=it[8],it[8]=bt*j[at+-12*18+7],bt=it[5]-it[9],it[5]+=it[9],it[9]=bt*j[at+-12*18+7],bt=it[0]-it[12],it[0]+=it[12],it[12]=bt*j[at+-4*18+7],bt=it[1]-it[13],it[1]+=it[13],it[13]=bt*j[at+-4*18+7],bt=it[16]-it[28],it[16]+=it[28],it[28]=bt*j[at+-4*18+7],bt=-it[17]+it[29],it[17]+=it[29],it[29]=bt*j[at+-4*18+7],bt=s.SQRT2*(it[2]-it[10]),it[2]+=it[10],it[10]=bt,bt=s.SQRT2*(it[3]-it[11]),it[3]+=it[11],it[11]=bt,bt=s.SQRT2*(-it[18]+it[26]),it[18]+=it[26],it[26]=bt-it[18],bt=s.SQRT2*(-it[19]+it[27]),it[19]+=it[27],it[27]=bt-it[19],bt=it[2],it[19]-=it[3],it[3]-=bt,it[2]=it[31]-bt,it[31]+=bt,bt=it[3],it[11]-=it[19],it[18]-=bt,it[3]=it[30]-bt,it[30]+=bt,bt=it[18],it[27]-=it[11],it[19]-=bt,it[18]=it[15]-bt,it[15]+=bt,bt=it[19],it[10]-=bt,it[19]=it[14]-bt,it[14]+=bt,bt=it[10],it[11]-=bt,it[10]=it[23]-bt,it[23]+=bt,bt=it[11],it[26]-=bt,it[11]=it[22]-bt,it[22]+=bt,bt=it[26],it[27]-=bt,it[26]=it[7]-bt,it[7]+=bt,bt=it[27],it[27]=it[6]-bt,it[6]+=bt,bt=s.SQRT2*(it[0]-it[4]),it[0]+=it[4],it[4]=bt,bt=s.SQRT2*(it[1]-it[5]),it[1]+=it[5],it[5]=bt,bt=s.SQRT2*(it[16]-it[20]),it[16]+=it[20],it[20]=bt,bt=s.SQRT2*(it[17]-it[21]),it[17]+=it[21],it[21]=bt,bt=-s.SQRT2*(it[8]-it[12]),it[8]+=it[12],it[12]=bt-it[8],bt=-s.SQRT2*(it[9]-it[13]),it[9]+=it[13],it[13]=bt-it[9],bt=-s.SQRT2*(it[25]-it[29]),it[25]+=it[29],it[29]=bt-it[25],bt=-s.SQRT2*(it[24]+it[28]),it[24]-=it[28],it[28]=bt-it[24],bt=it[24]-it[16],it[24]=bt,bt=it[20]-bt,it[20]=bt,bt=it[28]-bt,it[28]=bt,bt=it[25]-it[17],it[25]=bt,bt=it[21]-bt,it[21]=bt,bt=it[29]-bt,it[29]=bt,bt=it[17]-it[1],it[17]=bt,bt=it[9]-bt,it[9]=bt,bt=it[25]-bt,it[25]=bt,bt=it[5]-bt,it[5]=bt,bt=it[21]-bt,it[21]=bt,bt=it[13]-bt,it[13]=bt,bt=it[29]-bt,it[29]=bt,bt=it[1]-it[0],it[1]=bt,bt=it[16]-bt,it[16]=bt,bt=it[17]-bt,it[17]=bt,bt=it[8]-bt,it[8]=bt,bt=it[9]-bt,it[9]=bt,bt=it[24]-bt,it[24]=bt,bt=it[25]-bt,it[25]=bt,bt=it[4]-bt,it[4]=bt,bt=it[5]-bt,it[5]=bt,bt=it[20]-bt,it[20]=bt,bt=it[21]-bt,it[21]=bt,bt=it[12]-bt,it[12]=bt,bt=it[13]-bt,it[13]=bt,bt=it[28]-bt,it[28]=bt,bt=it[29]-bt,it[29]=bt,bt=it[0],it[0]+=it[31],it[31]-=bt,bt=it[1],it[1]+=it[30],it[30]-=bt,bt=it[16],it[16]+=it[15],it[15]-=bt,bt=it[17],it[17]+=it[14],it[14]-=bt,bt=it[8],it[8]+=it[23],it[23]-=bt,bt=it[9],it[9]+=it[22],it[22]-=bt,bt=it[24],it[24]+=it[7],it[7]-=bt,bt=it[25],it[25]+=it[6],it[6]-=bt,bt=it[4],it[4]+=it[27],it[27]-=bt,bt=it[5],it[5]+=it[26],it[26]-=bt,bt=it[20],it[20]+=it[11],it[11]-=bt,bt=it[21],it[21]+=it[10],it[10]-=bt,bt=it[12],it[12]+=it[19],it[19]-=bt,bt=it[13],it[13]+=it[18],it[18]-=bt,bt=it[28],it[28]+=it[3],it[3]-=bt,bt=it[29],it[29]+=it[2],it[2]-=bt}}function rt(tt,ot){for(var it=0;it<3;it++){var at,ut,lt,ct,ft,dt;ct=tt[ot+2*3]*nt[$.SHORT_TYPE][0]-tt[ot+5*3],at=tt[ot+0*3]*nt[$.SHORT_TYPE][2]-tt[ot+3*3],ut=ct+at,lt=ct-at,ct=tt[ot+5*3]*nt[$.SHORT_TYPE][0]+tt[ot+2*3],at=tt[ot+3*3]*nt[$.SHORT_TYPE][2]+tt[ot+0*3],ft=ct+at,dt=-ct+at,at=(tt[ot+1*3]*nt[$.SHORT_TYPE][1]-tt[ot+4*3])*2069978111953089e-26,ct=(tt[ot+4*3]*nt[$.SHORT_TYPE][1]+tt[ot+1*3])*2069978111953089e-26,tt[ot+3*0]=ut*190752519173728e-25+at,tt[ot+3*5]=-ft*190752519173728e-25+ct,lt=lt*.8660254037844387*1907525191737281e-26,ft=ft*.5*1907525191737281e-26+ct,tt[ot+3*1]=lt-ft,tt[ot+3*2]=lt+ft,ut=ut*.5*1907525191737281e-26-at,dt=dt*.8660254037844387*1907525191737281e-26,tt[ot+3*3]=ut+dt,tt[ot+3*4]=ut-dt,ot++}}function st(tt,ot,it){var at,ut;{var lt,ct,ft,dt,yt,St,bt,Tt;lt=it[17]-it[9],ft=it[15]-it[11],dt=it[14]-it[12],yt=it[0]+it[8],St=it[1]+it[7],bt=it[2]+it[6],Tt=it[3]+it[5],tt[ot+17]=yt+bt-Tt-(St-it[4]),ut=(yt+bt-Tt)*b[19]+(St-it[4]),at=(lt-ft-dt)*b[18],tt[ot+5]=at+ut,tt[ot+6]=at-ut,ct=(it[16]-it[10])*b[18],St=St*b[19]+it[4],at=lt*b[12]+ct+ft*b[13]+dt*b[14],ut=-yt*b[16]+St-bt*b[17]+Tt*b[15],tt[ot+1]=at+ut,tt[ot+2]=at-ut,at=lt*b[13]-ct-ft*b[14]+dt*b[12],ut=-yt*b[17]+St-bt*b[15]+Tt*b[16],tt[ot+9]=at+ut,tt[ot+10]=at-ut,at=lt*b[14]-ct+ft*b[12]-dt*b[13],ut=yt*b[15]-St+bt*b[16]-Tt*b[17],tt[ot+13]=at+ut,tt[ot+14]=at-ut}{var vt,$t,At,Ot,It,jt,Et,mt;vt=it[8]-it[0],At=it[6]-it[2],Ot=it[5]-it[3],It=it[17]+it[9],jt=it[16]+it[10],Et=it[15]+it[11],mt=it[14]+it[12],tt[ot+0]=It+Et+mt+(jt+it[13]),at=(It+Et+mt)*b[19]-(jt+it[13]),ut=(vt-At+Ot)*b[18],tt[ot+11]=at+ut,tt[ot+12]=at-ut,$t=(it[7]-it[1])*b[18],jt=it[13]-jt*b[19],at=It*b[15]-jt+Et*b[16]+mt*b[17],ut=vt*b[14]+$t+At*b[12]+Ot*b[13],tt[ot+3]=at+ut,tt[ot+4]=at-ut,at=-It*b[17]+jt-Et*b[15]-mt*b[16],ut=vt*b[13]+$t-At*b[14]-Ot*b[12],tt[ot+7]=at+ut,tt[ot+8]=at-ut,at=-It*b[16]+jt-Et*b[17]-mt*b[15],ut=vt*b[12]-$t+At*b[13]-Ot*b[14],tt[ot+15]=at+ut,tt[ot+16]=at-ut}}this.mdct_sub48=function(tt,ot,it){for(var at=ot,ut=286,lt=0;lt<tt.channels_out;lt++){for(var ct=0;ct<tt.mode_gr;ct++){for(var ft,dt=tt.l3_side.tt[ct][lt],yt=dt.xr,St=0,bt=tt.sb_sample[lt][1-ct],Tt=0,vt=0;vt<18/2;vt++)for(g(at,ut,bt[Tt]),g(at,ut+32,bt[Tt+1]),Tt+=2,ut+=64,ft=1;ft<32;ft+=2)bt[Tt-1][ft]*=-1;for(ft=0;ft<32;ft++,St+=18){var $t=dt.block_type,At=tt.sb_sample[lt][ct],Ot=tt.sb_sample[lt][1-ct];if(dt.mixed_block_flag!=0&&ft<2&&($t=0),tt.amp_filter[ft]<1e-12)c.fill(yt,St+0,St+18,0);else{if(tt.amp_filter[ft]<1)for(var vt=0;vt<18;vt++)Ot[vt][d[ft]]*=tt.amp_filter[ft];if($t==$.SHORT_TYPE){for(var vt=-12/4;vt<0;vt++){var It=nt[$.SHORT_TYPE][vt+3];yt[St+vt*3+9]=At[9+vt][d[ft]]*It-At[8-vt][d[ft]],yt[St+vt*3+18]=At[14-vt][d[ft]]*It+At[15+vt][d[ft]],yt[St+vt*3+10]=At[15+vt][d[ft]]*It-At[14-vt][d[ft]],yt[St+vt*3+19]=Ot[2-vt][d[ft]]*It+Ot[3+vt][d[ft]],yt[St+vt*3+11]=Ot[3+vt][d[ft]]*It-Ot[2-vt][d[ft]],yt[St+vt*3+20]=Ot[8-vt][d[ft]]*It+Ot[9+vt][d[ft]]}rt(yt,St)}else{for(var jt=h(18),vt=-36/4;vt<0;vt++){var Et,mt;Et=nt[$t][vt+27]*Ot[vt+9][d[ft]]+nt[$t][vt+36]*Ot[8-vt][d[ft]],mt=nt[$t][vt+9]*At[vt+9][d[ft]]-nt[$t][vt+18]*At[8-vt][d[ft]],jt[vt+9]=Et-mt*et[3+vt+9],jt[vt+18]=Et*et[3+vt+9]+mt}st(yt,St,jt)}}if($t!=$.SHORT_TYPE&&ft!=0)for(var vt=7;vt>=0;--vt){var gt,ht;gt=yt[St+vt]*a[20+vt]+yt[St+-1-vt]*o[28+vt],ht=yt[St+vt]*o[28+vt]-yt[St+-1-vt]*a[20+vt],yt[St+-1-vt]=gt,yt[St+vt]=ht}}}if(at=it,ut=286,tt.mode_gr==1)for(var pt=0;pt<18;pt++)e.arraycopy(tt.sb_sample[lt][1][pt],0,tt.sb_sample[lt][0][pt],0,32)}}}return ce=_,ce}var Se,Ge;function Ea(){if(Ge)return Se;Ge=1;var i=t1(),e=Q0,s=e.System,c=e.new_float,h=e.new_float_n;function $(){this.l=c(i.SBMAX_l),this.s=h([i.SBMAX_s,3]);var _=this;this.assign=function(j){s.arraycopy(j.l,0,_.l,0,i.SBMAX_l);for(var nt=0;nt<i.SBMAX_s;nt++)for(var et=0;et<3;et++)_.s[nt][et]=j.s[nt][et]}}return Se=$,Se}var de,$e;function Ga(){if($e)return de;$e=1;var i=Ea();function e(){this.thm=new i,this.en=new i}return de=e,de}function R1(i){var e=i;this.ordinal=function(){return e}}R1.STEREO=new R1(0),R1.JOINT_STEREO=new R1(1),R1.DUAL_CHANNEL=new R1(2),R1.MONO=new R1(3),R1.NOT_SET=new R1(4);var j1=R1,Ae,Pe;function t1(){if(Pe)return Ae;Pe=1;var i=Q0,e=i.System,s=i.VbrMode,c=i.new_array_n,h=i.new_float,$=i.new_float_n,_=i.new_int,j=i.assert;nt.ENCDELAY=576,nt.POSTDELAY=1152,nt.MDCTDELAY=48,nt.FFTOFFSET=224+nt.MDCTDELAY,nt.DECDELAY=528,nt.SBLIMIT=32,nt.CBANDS=64,nt.SBPSY_l=21,nt.SBPSY_s=12,nt.SBMAX_l=22,nt.SBMAX_s=13,nt.PSFB21=6,nt.PSFB12=6,nt.BLKSIZE=1024,nt.HBLKSIZE=nt.BLKSIZE/2+1,nt.BLKSIZE_s=256,nt.HBLKSIZE_s=nt.BLKSIZE_s/2+1,nt.NORM_TYPE=0,nt.START_TYPE=1,nt.SHORT_TYPE=2,nt.STOP_TYPE=3,nt.MPG_MD_LR_LR=0,nt.MPG_MD_LR_I=1,nt.MPG_MD_MS_LR=2,nt.MPG_MD_MS_I=3,nt.fircoef=[-.0207887*5,-.0378413*5,-.0432472*5,-.031183*5,779609e-23*5,.0467745*5,.10091*5,.151365*5,.187098*5];function nt(){var et=Da(),b=Ga(),a=j1,o=nt.FFTOFFSET,d=nt.MPG_MD_MS_LR,g=null;this.psy=null;var rt=null,st=null,tt=null;this.setModules=function(lt,ct,ft,dt){g=lt,this.psy=ct,rt=ct,st=dt,tt=ft};var ot=new et;function it(lt){var ct,ft;if(lt.ATH.useAdjust==0){lt.ATH.adjust=1;return}if(ft=lt.loudness_sq[0][0],ct=lt.loudness_sq[1][0],lt.channels_out==2?(ft+=lt.loudness_sq[0][1],ct+=lt.loudness_sq[1][1]):(ft+=ft,ct+=ct),lt.mode_gr==2&&(ft=Math.max(ft,ct)),ft*=.5,ft*=lt.ATH.aaSensitivityP,ft>.03125)lt.ATH.adjust>=1?lt.ATH.adjust=1:lt.ATH.adjust<lt.ATH.adjustLimit&&(lt.ATH.adjust=lt.ATH.adjustLimit),lt.ATH.adjustLimit=1;else{var dt=31.98*ft+625e-6;lt.ATH.adjust>=dt?(lt.ATH.adjust*=dt*.075+.925,lt.ATH.adjust<dt&&(lt.ATH.adjust=dt)):lt.ATH.adjustLimit>=dt?lt.ATH.adjust=dt:lt.ATH.adjust<lt.ATH.adjustLimit&&(lt.ATH.adjust=lt.ATH.adjustLimit),lt.ATH.adjustLimit=dt}}function at(lt){var ct,ft;for(j(0<=lt.bitrate_index&<.bitrate_index<16),j(0<=lt.mode_ext&<.mode_ext<4),lt.bitrate_stereoMode_Hist[lt.bitrate_index][4]++,lt.bitrate_stereoMode_Hist[15][4]++,lt.channels_out==2&&(lt.bitrate_stereoMode_Hist[lt.bitrate_index][lt.mode_ext]++,lt.bitrate_stereoMode_Hist[15][lt.mode_ext]++),ct=0;ct<lt.mode_gr;++ct)for(ft=0;ft<lt.channels_out;++ft){var dt=lt.l3_side.tt[ct][ft].block_type|0;lt.l3_side.tt[ct][ft].mixed_block_flag!=0&&(dt=4),lt.bitrate_blockType_Hist[lt.bitrate_index][dt]++,lt.bitrate_blockType_Hist[lt.bitrate_index][5]++,lt.bitrate_blockType_Hist[15][dt]++,lt.bitrate_blockType_Hist[15][5]++}}function ut(lt,ct){var ft=lt.internal_flags,dt,yt;if(ft.lame_encode_frame_init==0){var St,bt,Tt=h(2014),vt=h(2014);for(ft.lame_encode_frame_init=1,St=0,bt=0;St<286+576*(1+ft.mode_gr);++St)St<576*ft.mode_gr?(Tt[St]=0,ft.channels_out==2&&(vt[St]=0)):(Tt[St]=ct[0][bt],ft.channels_out==2&&(vt[St]=ct[1][bt]),++bt);for(yt=0;yt<ft.mode_gr;yt++)for(dt=0;dt<ft.channels_out;dt++)ft.l3_side.tt[yt][dt].block_type=nt.SHORT_TYPE;ot.mdct_sub48(ft,Tt,vt),j(576>=nt.FFTOFFSET),j(ft.mf_size>=nt.BLKSIZE+lt.framesize-nt.FFTOFFSET),j(ft.mf_size>=512+lt.framesize-32)}}this.lame_encode_mp3_frame=function(lt,ct,ft,dt,yt,St){var bt,Tt=c([2,2]);Tt[0][0]=new b,Tt[0][1]=new b,Tt[1][0]=new b,Tt[1][1]=new b;var vt=c([2,2]);vt[0][0]=new b,vt[0][1]=new b,vt[1][0]=new b,vt[1][1]=new b;var $t,At=[null,null],Ot=lt.internal_flags,It=$([2,4]),jt=[.5,.5],Et=[[0,0],[0,0]],mt=[[0,0],[0,0]],gt,ht,pt;if(At[0]=ct,At[1]=ft,Ot.lame_encode_frame_init==0&&ut(lt,At),Ot.padding=0,(Ot.slot_lag-=Ot.frac_SpF)<0&&(Ot.slot_lag+=lt.out_samplerate,Ot.padding=1),Ot.psymodel!=0){var _t,Ct=[null,null],zt=0,Nt=_(2);for(pt=0;pt<Ot.mode_gr;pt++){for(ht=0;ht<Ot.channels_out;ht++)Ct[ht]=At[ht],zt=576+pt*576-nt.FFTOFFSET;if(lt.VBR==s.vbr_mtrh||lt.VBR==s.vbr_mt?_t=rt.L3psycho_anal_vbr(lt,Ct,zt,pt,Tt,vt,Et[pt],mt[pt],It[pt],Nt):_t=rt.L3psycho_anal_ns(lt,Ct,zt,pt,Tt,vt,Et[pt],mt[pt],It[pt],Nt),_t!=0)return-4;for(lt.mode==a.JOINT_STEREO&&(jt[pt]=It[pt][2]+It[pt][3],jt[pt]>0&&(jt[pt]=It[pt][3]/jt[pt])),ht=0;ht<Ot.channels_out;ht++){var Ht=Ot.l3_side.tt[pt][ht];Ht.block_type=Nt[ht],Ht.mixed_block_flag=0}}}else for(pt=0;pt<Ot.mode_gr;pt++)for(ht=0;ht<Ot.channels_out;ht++)Ot.l3_side.tt[pt][ht].block_type=nt.NORM_TYPE,Ot.l3_side.tt[pt][ht].mixed_block_flag=0,mt[pt][ht]=Et[pt][ht]=700;if(it(Ot),ot.mdct_sub48(Ot,At[0],At[1]),Ot.mode_ext=nt.MPG_MD_LR_LR,lt.force_ms)Ot.mode_ext=nt.MPG_MD_MS_LR;else if(lt.mode==a.JOINT_STEREO){var Jt=0,un=0;for(pt=0;pt<Ot.mode_gr;pt++)for(ht=0;ht<Ot.channels_out;ht++)Jt+=mt[pt][ht],un+=Et[pt][ht];if(Jt<=1*un){var yn=Ot.l3_side.tt[0],vn=Ot.l3_side.tt[Ot.mode_gr-1];yn[0].block_type==yn[1].block_type&&vn[0].block_type==vn[1].block_type&&(Ot.mode_ext=nt.MPG_MD_MS_LR)}}if(Ot.mode_ext==d?($t=vt,gt=mt):($t=Tt,gt=Et),lt.analysis&&Ot.pinfo!=null)for(pt=0;pt<Ot.mode_gr;pt++)for(ht=0;ht<Ot.channels_out;ht++)Ot.pinfo.ms_ratio[pt]=Ot.ms_ratio[pt],Ot.pinfo.ms_ener_ratio[pt]=jt[pt],Ot.pinfo.blocktype[pt][ht]=Ot.l3_side.tt[pt][ht].block_type,Ot.pinfo.pe[pt][ht]=gt[pt][ht],e.arraycopy(Ot.l3_side.tt[pt][ht].xr,0,Ot.pinfo.xr[pt][ht],0,576),Ot.mode_ext==d&&(Ot.pinfo.ers[pt][ht]=Ot.pinfo.ers[pt][ht+2],e.arraycopy(Ot.pinfo.energy[pt][ht+2],0,Ot.pinfo.energy[pt][ht],0,Ot.pinfo.energy[pt][ht].length));if(lt.VBR==s.vbr_off||lt.VBR==s.vbr_abr){var mn,Tn;for(mn=0;mn<18;mn++)Ot.nsPsy.pefirbuf[mn]=Ot.nsPsy.pefirbuf[mn+1];for(Tn=0,pt=0;pt<Ot.mode_gr;pt++)for(ht=0;ht<Ot.channels_out;ht++)Tn+=gt[pt][ht];for(Ot.nsPsy.pefirbuf[18]=Tn,Tn=Ot.nsPsy.pefirbuf[9],mn=0;mn<9;mn++)Tn+=(Ot.nsPsy.pefirbuf[mn]+Ot.nsPsy.pefirbuf[18-mn])*nt.fircoef[mn];for(Tn=670*5*Ot.mode_gr*Ot.channels_out/Tn,pt=0;pt<Ot.mode_gr;pt++)for(ht=0;ht<Ot.channels_out;ht++)gt[pt][ht]*=Tn}if(Ot.iteration_loop.iteration_loop(lt,gt,jt,$t),g.format_bitstream(lt),bt=g.copy_buffer(Ot,dt,yt,St,1),lt.bWriteVbrTag&&st.addVbrFrame(lt),lt.analysis&&Ot.pinfo!=null){for(ht=0;ht<Ot.channels_out;ht++){var Pn;for(Pn=0;Pn<o;Pn++)Ot.pinfo.pcmdata[ht][Pn]=Ot.pinfo.pcmdata[ht][Pn+lt.framesize];for(Pn=o;Pn<1600;Pn++)Ot.pinfo.pcmdata[ht][Pn]=At[ht][Pn-o]}tt.set_frame_pinfo(lt,$t)}return at(Ot),bt}}return Ae=nt,Ae}var Ba=Q0,Ze=Ba.Util,Ke=Ba.new_float,J0=t1();function $a(){var i=Ke(J0.BLKSIZE),e=Ke(J0.BLKSIZE_s/2),s=[.9238795325112867,.3826834323650898,.9951847266721969,.0980171403295606,.9996988186962042,.02454122852291229,.9999811752826011,.006135884649154475];function c($,_,j){var nt=0,et,b,a;j<<=1;var o=_+j;et=4;do{var d,g,rt,st,tt,ot,it;it=et>>1,st=et,tt=et<<1,ot=tt+st,et=tt<<1,b=_,a=b+it;do{var at,ut,lt,ct;ut=$[b+0]-$[b+st],at=$[b+0]+$[b+st],ct=$[b+tt]-$[b+ot],lt=$[b+tt]+$[b+ot],$[b+tt]=at-lt,$[b+0]=at+lt,$[b+ot]=ut-ct,$[b+st]=ut+ct,ut=$[a+0]-$[a+st],at=$[a+0]+$[a+st],ct=Ze.SQRT2*$[a+ot],lt=Ze.SQRT2*$[a+tt],$[a+tt]=at-lt,$[a+0]=at+lt,$[a+ot]=ut-ct,$[a+st]=ut+ct,a+=et,b+=et}while(b<o);for(g=s[nt+0],d=s[nt+1],rt=1;rt<it;rt++){var ft,dt;ft=1-2*d*d,dt=2*d*g,b=_+rt,a=_+st-rt;do{var yt,St,bt,at,ut,Tt,lt,vt,ct,$t;St=dt*$[b+st]-ft*$[a+st],yt=ft*$[b+st]+dt*$[a+st],ut=$[b+0]-yt,at=$[b+0]+yt,Tt=$[a+0]-St,bt=$[a+0]+St,St=dt*$[b+ot]-ft*$[a+ot],yt=ft*$[b+ot]+dt*$[a+ot],ct=$[b+tt]-yt,lt=$[b+tt]+yt,$t=$[a+tt]-St,vt=$[a+tt]+St,St=d*lt-g*$t,yt=g*lt+d*$t,$[b+tt]=at-yt,$[b+0]=at+yt,$[a+ot]=Tt-St,$[a+st]=Tt+St,St=g*vt-d*ct,yt=d*vt+g*ct,$[a+tt]=bt-yt,$[a+0]=bt+yt,$[b+ot]=ut-St,$[b+st]=ut+St,a+=et,b+=et}while(b<o);ft=g,g=ft*s[nt+0]-d*s[nt+1],d=ft*s[nt+1]+d*s[nt+0]}nt+=2}while(et<j)}var h=[0,128,64,192,32,160,96,224,16,144,80,208,48,176,112,240,8,136,72,200,40,168,104,232,24,152,88,216,56,184,120,248,4,132,68,196,36,164,100,228,20,148,84,212,52,180,116,244,12,140,76,204,44,172,108,236,28,156,92,220,60,188,124,252,2,130,66,194,34,162,98,226,18,146,82,210,50,178,114,242,10,138,74,202,42,170,106,234,26,154,90,218,58,186,122,250,6,134,70,198,38,166,102,230,22,150,86,214,54,182,118,246,14,142,78,206,46,174,110,238,30,158,94,222,62,190,126,254];this.fft_short=function($,_,j,nt,et){for(var b=0;b<3;b++){var a=J0.BLKSIZE_s/2,o=65535&576/3*(b+1),d=J0.BLKSIZE_s/8-1;do{var g,rt,st,tt,ot,it=h[d<<2]&255;g=e[it]*nt[j][et+it+o],ot=e[127-it]*nt[j][et+it+o+128],rt=g-ot,g=g+ot,st=e[it+64]*nt[j][et+it+o+64],ot=e[63-it]*nt[j][et+it+o+192],tt=st-ot,st=st+ot,a-=4,_[b][a+0]=g+st,_[b][a+2]=g-st,_[b][a+1]=rt+tt,_[b][a+3]=rt-tt,g=e[it+1]*nt[j][et+it+o+1],ot=e[126-it]*nt[j][et+it+o+129],rt=g-ot,g=g+ot,st=e[it+65]*nt[j][et+it+o+65],ot=e[62-it]*nt[j][et+it+o+193],tt=st-ot,st=st+ot,_[b][a+J0.BLKSIZE_s/2+0]=g+st,_[b][a+J0.BLKSIZE_s/2+2]=g-st,_[b][a+J0.BLKSIZE_s/2+1]=rt+tt,_[b][a+J0.BLKSIZE_s/2+3]=rt-tt}while(--d>=0);c(_[b],a,J0.BLKSIZE_s/2)}},this.fft_long=function($,_,j,nt,et){var b=J0.BLKSIZE/8-1,a=J0.BLKSIZE/2;do{var o,d,g,rt,st,tt=h[b]&255;o=i[tt]*nt[j][et+tt],st=i[tt+512]*nt[j][et+tt+512],d=o-st,o=o+st,g=i[tt+256]*nt[j][et+tt+256],st=i[tt+768]*nt[j][et+tt+768],rt=g-st,g=g+st,a-=4,_[a+0]=o+g,_[a+2]=o-g,_[a+1]=d+rt,_[a+3]=d-rt,o=i[tt+1]*nt[j][et+tt+1],st=i[tt+513]*nt[j][et+tt+513],d=o-st,o=o+st,g=i[tt+257]*nt[j][et+tt+257],st=i[tt+769]*nt[j][et+tt+769],rt=g-st,g=g+st,_[a+J0.BLKSIZE/2+0]=o+g,_[a+J0.BLKSIZE/2+2]=o-g,_[a+J0.BLKSIZE/2+1]=d+rt,_[a+J0.BLKSIZE/2+3]=d-rt}while(--b>=0);c(_,a,J0.BLKSIZE/2)},this.init_fft=function($){for(var _=0;_<J0.BLKSIZE;_++)i[_]=.42-.5*Math.cos(2*Math.PI*(_+.5)/J0.BLKSIZE)+.08*Math.cos(4*Math.PI*(_+.5)/J0.BLKSIZE);for(var _=0;_<J0.BLKSIZE_s/2;_++)e[_]=.5*(1-Math.cos(2*Math.PI*(_+.5)/J0.BLKSIZE_s))}}var Pa=$a,T1=Q0,C1=T1.VbrMode,Ue=T1.Float,F1=T1.ShortBlock,n1=T1.Util,Za=T1.Arrays,g0=T1.new_float,m1=T1.new_float_n,L1=T1.new_int,C0=T1.assert,Ka=Pa,r0=t1();function Ua(){var i=j1,e=new Ka,s=2.302585092994046,c=2,h=16,$=2,_=16,j=.34,nt=1/(14752*14752)/(r0.BLKSIZE/2),et=.01,b=.8,a=.6,o=.3,d=3.5,g=21,rt=.2302585093;function st(kt,Dt){for(var Lt=0,Ut=0;Ut<r0.BLKSIZE/2;++Ut)Lt+=kt[Ut]*Dt.ATH.eql_w[Ut];return Lt*=nt,Lt}function tt(kt,Dt,Lt,Ut,Kt,Ft,Yt,Wt,Xt,sn,en){var Qt=kt.internal_flags;if(Xt<2)e.fft_long(Qt,Ut[Kt],Xt,sn,en),e.fft_short(Qt,Ft[Yt],Xt,sn,en);else if(Xt==2){for(var ln=r0.BLKSIZE-1;ln>=0;--ln){var gn=Ut[Kt+0][ln],dn=Ut[Kt+1][ln];Ut[Kt+0][ln]=(gn+dn)*n1.SQRT2*.5,Ut[Kt+1][ln]=(gn-dn)*n1.SQRT2*.5}for(var Mn=2;Mn>=0;--Mn)for(var ln=r0.BLKSIZE_s-1;ln>=0;--ln){var gn=Ft[Yt+0][Mn][ln],dn=Ft[Yt+1][Mn][ln];Ft[Yt+0][Mn][ln]=(gn+dn)*n1.SQRT2*.5,Ft[Yt+1][Mn][ln]=(gn-dn)*n1.SQRT2*.5}}Dt[0]=Ut[Kt+0][0],Dt[0]*=Dt[0];for(var ln=r0.BLKSIZE/2-1;ln>=0;--ln){var rn=Ut[Kt+0][r0.BLKSIZE/2-ln],kn=Ut[Kt+0][r0.BLKSIZE/2+ln];Dt[r0.BLKSIZE/2-ln]=(rn*rn+kn*kn)*.5}for(var Mn=2;Mn>=0;--Mn){Lt[Mn][0]=Ft[Yt+0][Mn][0],Lt[Mn][0]*=Lt[Mn][0];for(var ln=r0.BLKSIZE_s/2-1;ln>=0;--ln){var rn=Ft[Yt+0][Mn][r0.BLKSIZE_s/2-ln],kn=Ft[Yt+0][Mn][r0.BLKSIZE_s/2+ln];Lt[Mn][r0.BLKSIZE_s/2-ln]=(rn*rn+kn*kn)*.5}}{for(var zn=0,ln=11;ln<r0.HBLKSIZE;ln++)zn+=Dt[ln];Qt.tot_ener[Xt]=zn}if(kt.analysis){for(var ln=0;ln<r0.HBLKSIZE;ln++)Qt.pinfo.energy[Wt][Xt][ln]=Qt.pinfo.energy_save[Xt][ln],Qt.pinfo.energy_save[Xt][ln]=Dt[ln];Qt.pinfo.pe[Wt][Xt]=Qt.pe[Xt]}kt.athaa_loudapprox==2&&Xt<2&&(Qt.loudness_sq[Wt][Xt]=Qt.loudness_sq_save[Xt],Qt.loudness_sq_save[Xt]=st(Dt,Qt))}var ot=8,it=23,at=15,ut,lt,ct,ft=[1,.79433,.63096,.63096,.63096,.63096,.63096,.25119,.11749];function dt(){ut=Math.pow(10,(ot+1)/16),lt=Math.pow(10,(it+1)/16),ct=Math.pow(10,at/10)}var yt=[3.3246*3.3246,3.23837*3.23837,3.15437*3.15437,3.00412*3.00412,2.86103*2.86103,2.65407*2.65407,2.46209*2.46209,2.284*2.284,2.11879*2.11879,1.96552*1.96552,1.82335*1.82335,1.69146*1.69146,1.56911*1.56911,1.46658*1.46658,1.37074*1.37074,1.31036*1.31036,1.25264*1.25264,1.20648*1.20648,1.16203*1.16203,1.12765*1.12765,1.09428*1.09428,1.0659*1.0659,1.03826*1.03826,1.01895*1.01895,1],St=[1.33352*1.33352,1.35879*1.35879,1.38454*1.38454,1.39497*1.39497,1.40548*1.40548,1.3537*1.3537,1.30382*1.30382,1.22321*1.22321,1.14758*1.14758,1],bt=[2.35364*2.35364,2.29259*2.29259,2.23313*2.23313,2.12675*2.12675,2.02545*2.02545,1.87894*1.87894,1.74303*1.74303,1.61695*1.61695,1.49999*1.49999,1.39148*1.39148,1.29083*1.29083,1.19746*1.19746,1.11084*1.11084,1.03826*1.03826];function Tt(kt,Dt,Lt,Ut,Kt,Ft){var Yt;if(Dt>kt)if(Dt<kt*lt)Yt=Dt/kt;else return kt+Dt;else{if(kt>=Dt*lt)return kt+Dt;Yt=kt/Dt}if(kt+=Dt,Ut+3<=6){if(Yt>=ut)return kt;var Wt=0|n1.FAST_LOG10_X(Yt,16);return kt*St[Wt]}var Wt=0|n1.FAST_LOG10_X(Yt,16);if(Dt=Kt.ATH.cb_l[Lt]*Kt.ATH.adjust,kt<ct*Dt){if(kt>Dt){var Xt,sn;return Xt=1,Wt<=13&&(Xt=bt[Wt]),sn=n1.FAST_LOG10_X(kt/Dt,10/15),kt*((yt[Wt]-Xt)*sn+Xt)}return Wt>13?kt:kt*bt[Wt]}return kt*yt[Wt]}var vt=[1.33352*1.33352,1.35879*1.35879,1.38454*1.38454,1.39497*1.39497,1.40548*1.40548,1.3537*1.3537,1.30382*1.30382,1.22321*1.22321,1.14758*1.14758,1];function $t(kt,Dt,Lt){var Ut;if(kt<0&&(kt=0),Dt<0&&(Dt=0),kt<=0)return Dt;if(Dt<=0)return kt;if(Dt>kt?Ut=Dt/kt:Ut=kt/Dt,-2<=Lt&&Lt<=2){if(Ut>=ut)return kt+Dt;var Kt=0|n1.FAST_LOG10_X(Ut,16);return(kt+Dt)*vt[Kt]}return Ut<lt?kt+Dt:(kt<Dt&&(kt=Dt),kt)}function At(kt,Dt){var Lt=kt.internal_flags;if(Lt.channels_out>1){for(var Ut=0;Ut<r0.SBMAX_l;Ut++){var Kt=Lt.thm[0].l[Ut],Ft=Lt.thm[1].l[Ut];Lt.thm[0].l[Ut]+=Ft*Dt,Lt.thm[1].l[Ut]+=Kt*Dt}for(var Ut=0;Ut<r0.SBMAX_s;Ut++)for(var Yt=0;Yt<3;Yt++){var Kt=Lt.thm[0].s[Ut][Yt],Ft=Lt.thm[1].s[Ut][Yt];Lt.thm[0].s[Ut][Yt]+=Ft*Dt,Lt.thm[1].s[Ut][Yt]+=Kt*Dt}}}function Ot(kt){for(var Dt=0;Dt<r0.SBMAX_l;Dt++)if(!(kt.thm[0].l[Dt]>1.58*kt.thm[1].l[Dt]||kt.thm[1].l[Dt]>1.58*kt.thm[0].l[Dt])){var Lt=kt.mld_l[Dt]*kt.en[3].l[Dt],Ut=Math.max(kt.thm[2].l[Dt],Math.min(kt.thm[3].l[Dt],Lt));Lt=kt.mld_l[Dt]*kt.en[2].l[Dt];var Kt=Math.max(kt.thm[3].l[Dt],Math.min(kt.thm[2].l[Dt],Lt));kt.thm[2].l[Dt]=Ut,kt.thm[3].l[Dt]=Kt}for(var Dt=0;Dt<r0.SBMAX_s;Dt++)for(var Ft=0;Ft<3;Ft++)if(!(kt.thm[0].s[Dt][Ft]>1.58*kt.thm[1].s[Dt][Ft]||kt.thm[1].s[Dt][Ft]>1.58*kt.thm[0].s[Dt][Ft])){var Lt=kt.mld_s[Dt]*kt.en[3].s[Dt][Ft],Ut=Math.max(kt.thm[2].s[Dt][Ft],Math.min(kt.thm[3].s[Dt][Ft],Lt));Lt=kt.mld_s[Dt]*kt.en[2].s[Dt][Ft];var Kt=Math.max(kt.thm[3].s[Dt][Ft],Math.min(kt.thm[2].s[Dt][Ft],Lt));kt.thm[2].s[Dt][Ft]=Ut,kt.thm[3].s[Dt][Ft]=Kt}}function It(kt,Dt,Lt){var Ut=Dt,Kt=Math.pow(10,Lt);Dt*=2,Ut*=2;for(var Ft=0;Ft<r0.SBMAX_l;Ft++){var Yt,Wt,Xt,sn;if(sn=kt.ATH.cb_l[kt.bm_l[Ft]]*Kt,Yt=Math.min(Math.max(kt.thm[0].l[Ft],sn),Math.max(kt.thm[1].l[Ft],sn)),Wt=Math.max(kt.thm[2].l[Ft],sn),Xt=Math.max(kt.thm[3].l[Ft],sn),Yt*Dt<Wt+Xt){var en=Yt*Ut/(Wt+Xt);Wt*=en,Xt*=en}kt.thm[2].l[Ft]=Math.min(Wt,kt.thm[2].l[Ft]),kt.thm[3].l[Ft]=Math.min(Xt,kt.thm[3].l[Ft])}Kt*=r0.BLKSIZE_s/r0.BLKSIZE;for(var Ft=0;Ft<r0.SBMAX_s;Ft++)for(var Qt=0;Qt<3;Qt++){var Yt,Wt,Xt,sn;if(sn=kt.ATH.cb_s[kt.bm_s[Ft]]*Kt,Yt=Math.min(Math.max(kt.thm[0].s[Ft][Qt],sn),Math.max(kt.thm[1].s[Ft][Qt],sn)),Wt=Math.max(kt.thm[2].s[Ft][Qt],sn),Xt=Math.max(kt.thm[3].s[Ft][Qt],sn),Yt*Dt<Wt+Xt){var en=Yt*Dt/(Wt+Xt);Wt*=en,Xt*=en}kt.thm[2].s[Ft][Qt]=Math.min(kt.thm[2].s[Ft][Qt],Wt),kt.thm[3].s[Ft][Qt]=Math.min(kt.thm[3].s[Ft][Qt],Xt)}}function jt(kt,Dt,Lt,Ut,Kt){var Ft,Yt,Wt=0,Xt=0;for(Ft=Yt=0;Ft<r0.SBMAX_s;++Yt,++Ft){for(var sn=kt.bo_s[Ft],en=kt.npart_s,Qt=sn<en?sn:en;Yt<Qt;)C0(Dt[Yt]>=0),C0(Lt[Yt]>=0),Wt+=Dt[Yt],Xt+=Lt[Yt],Yt++;if(kt.en[Ut].s[Ft][Kt]=Wt,kt.thm[Ut].s[Ft][Kt]=Xt,Yt>=en){++Ft;break}C0(Dt[Yt]>=0),C0(Lt[Yt]>=0);{var ln=kt.PSY.bo_s_weight[Ft],gn=1-ln;Wt=ln*Dt[Yt],Xt=ln*Lt[Yt],kt.en[Ut].s[Ft][Kt]+=Wt,kt.thm[Ut].s[Ft][Kt]+=Xt,Wt=gn*Dt[Yt],Xt=gn*Lt[Yt]}}for(;Ft<r0.SBMAX_s;++Ft)kt.en[Ut].s[Ft][Kt]=0,kt.thm[Ut].s[Ft][Kt]=0}function Et(kt,Dt,Lt,Ut){var Kt,Ft,Yt=0,Wt=0;for(Kt=Ft=0;Kt<r0.SBMAX_l;++Ft,++Kt){for(var Xt=kt.bo_l[Kt],sn=kt.npart_l,en=Xt<sn?Xt:sn;Ft<en;)C0(Dt[Ft]>=0),C0(Lt[Ft]>=0),Yt+=Dt[Ft],Wt+=Lt[Ft],Ft++;if(kt.en[Ut].l[Kt]=Yt,kt.thm[Ut].l[Kt]=Wt,Ft>=sn){++Kt;break}C0(Dt[Ft]>=0),C0(Lt[Ft]>=0);{var Qt=kt.PSY.bo_l_weight[Kt],ln=1-Qt;Yt=Qt*Dt[Ft],Wt=Qt*Lt[Ft],kt.en[Ut].l[Kt]+=Yt,kt.thm[Ut].l[Kt]+=Wt,Yt=ln*Dt[Ft],Wt=ln*Lt[Ft]}}for(;Kt<r0.SBMAX_l;++Kt)kt.en[Ut].l[Kt]=0,kt.thm[Ut].l[Kt]=0}function mt(kt,Dt,Lt,Ut,Kt,Ft){var Yt=kt.internal_flags,Wt,Xt;for(Xt=Wt=0;Xt<Yt.npart_s;++Xt){for(var sn=0,en=Yt.numlines_s[Xt],Qt=0;Qt<en;++Qt,++Wt){var ln=Dt[Ft][Wt];sn+=ln}Lt[Xt]=sn}for(C0(Xt==Yt.npart_s),Wt=Xt=0;Xt<Yt.npart_s;Xt++){var gn=Yt.s3ind_s[Xt][0],dn=Yt.s3_ss[Wt++]*Lt[gn];for(++gn;gn<=Yt.s3ind_s[Xt][1];)dn+=Yt.s3_ss[Wt]*Lt[gn],++Wt,++gn;{var Mn=$*Yt.nb_s1[Kt][Xt];Ut[Xt]=Math.min(dn,Mn)}if(Yt.blocktype_old[Kt&1]==r0.SHORT_TYPE){var Mn=_*Yt.nb_s2[Kt][Xt],rn=Ut[Xt];Ut[Xt]=Math.min(Mn,rn)}Yt.nb_s2[Kt][Xt]=Yt.nb_s1[Kt][Xt],Yt.nb_s1[Kt][Xt]=dn,C0(Ut[Xt]>=0)}for(;Xt<=r0.CBANDS;++Xt)Lt[Xt]=0,Ut[Xt]=0}function gt(kt,Dt,Lt,Ut){var Kt=kt.internal_flags;kt.short_blocks==F1.short_block_coupled&&!(Dt[0]!=0&&Dt[1]!=0)&&(Dt[0]=Dt[1]=0);for(var Ft=0;Ft<Kt.channels_out;Ft++)Ut[Ft]=r0.NORM_TYPE,kt.short_blocks==F1.short_block_dispensed&&(Dt[Ft]=1),kt.short_blocks==F1.short_block_forced&&(Dt[Ft]=0),Dt[Ft]!=0?(C0(Kt.blocktype_old[Ft]!=r0.START_TYPE),Kt.blocktype_old[Ft]==r0.SHORT_TYPE&&(Ut[Ft]=r0.STOP_TYPE)):(Ut[Ft]=r0.SHORT_TYPE,Kt.blocktype_old[Ft]==r0.NORM_TYPE&&(Kt.blocktype_old[Ft]=r0.START_TYPE),Kt.blocktype_old[Ft]==r0.STOP_TYPE&&(Kt.blocktype_old[Ft]=r0.SHORT_TYPE)),Lt[Ft]=Kt.blocktype_old[Ft],Kt.blocktype_old[Ft]=Ut[Ft]}function ht(kt,Dt,Lt){return Lt>=1?kt:Lt<=0?Dt:Dt>0?Math.pow(kt/Dt,Lt)*Dt:0}var pt=[11.8,13.6,17.2,32,46.5,51.3,57.5,67.1,71.5,84.6,97.6,130];function _t(kt,Dt){for(var Lt=309.07,Ut=0;Ut<r0.SBMAX_s-1;Ut++)for(var Kt=0;Kt<3;Kt++){var Ft=kt.thm.s[Ut][Kt];if(Ft>0){var Yt=Ft*Dt,Wt=kt.en.s[Ut][Kt];Wt>Yt&&(Wt>Yt*1e10?Lt+=pt[Ut]*(10*s):Lt+=pt[Ut]*n1.FAST_LOG10(Wt/Yt))}}return Lt}var Ct=[6.8,5.8,5.8,6.4,6.5,9.9,12.1,14.4,15,18.9,21.6,26.9,34.2,40.2,46.8,56.5,60.7,73.9,85.7,93.4,126.1];function zt(kt,Dt){for(var Lt=281.0575,Ut=0;Ut<r0.SBMAX_l-1;Ut++){var Kt=kt.thm.l[Ut];if(Kt>0){var Ft=Kt*Dt,Yt=kt.en.l[Ut];Yt>Ft&&(Yt>Ft*1e10?Lt+=Ct[Ut]*(10*s):Lt+=Ct[Ut]*n1.FAST_LOG10(Yt/Ft))}}return Lt}function Nt(kt,Dt,Lt,Ut,Kt){var Ft,Yt;for(Ft=Yt=0;Ft<kt.npart_l;++Ft){var Wt=0,Xt=0,sn;for(sn=0;sn<kt.numlines_l[Ft];++sn,++Yt){var en=Dt[Yt];Wt+=en,Xt<en&&(Xt=en)}Lt[Ft]=Wt,Ut[Ft]=Xt,Kt[Ft]=Wt*kt.rnumlines_l[Ft],C0(kt.rnumlines_l[Ft]>=0),C0(Lt[Ft]>=0),C0(Ut[Ft]>=0),C0(Kt[Ft]>=0)}}function Ht(kt,Dt,Lt,Ut){var Kt=ft.length-1,Ft=0,Yt=Lt[Ft]+Lt[Ft+1];if(Yt>0){var Wt=Dt[Ft];Wt<Dt[Ft+1]&&(Wt=Dt[Ft+1]),C0(kt.numlines_l[Ft]+kt.numlines_l[Ft+1]-1>0),Yt=20*(Wt*2-Yt)/(Yt*(kt.numlines_l[Ft]+kt.numlines_l[Ft+1]-1));var Xt=0|Yt;Xt>Kt&&(Xt=Kt),Ut[Ft]=Xt}else Ut[Ft]=0;for(Ft=1;Ft<kt.npart_l-1;Ft++)if(Yt=Lt[Ft-1]+Lt[Ft]+Lt[Ft+1],Yt>0){var Wt=Dt[Ft-1];Wt<Dt[Ft]&&(Wt=Dt[Ft]),Wt<Dt[Ft+1]&&(Wt=Dt[Ft+1]),C0(kt.numlines_l[Ft-1]+kt.numlines_l[Ft]+kt.numlines_l[Ft+1]-1>0),Yt=20*(Wt*3-Yt)/(Yt*(kt.numlines_l[Ft-1]+kt.numlines_l[Ft]+kt.numlines_l[Ft+1]-1));var Xt=0|Yt;Xt>Kt&&(Xt=Kt),Ut[Ft]=Xt}else Ut[Ft]=0;if(C0(Ft==kt.npart_l-1),Yt=Lt[Ft-1]+Lt[Ft],Yt>0){var Wt=Dt[Ft-1];Wt<Dt[Ft]&&(Wt=Dt[Ft]),C0(kt.numlines_l[Ft-1]+kt.numlines_l[Ft]-1>0),Yt=20*(Wt*2-Yt)/(Yt*(kt.numlines_l[Ft-1]+kt.numlines_l[Ft]-1));var Xt=0|Yt;Xt>Kt&&(Xt=Kt),Ut[Ft]=Xt}else Ut[Ft]=0;C0(Ft==kt.npart_l-1)}var Jt=[-865163e-23*2,-.00851586*2,-674764e-23*2,.0209036*2,-336639e-22*2,-.0438162*2,-154175e-22*2,.0931738*2,-552212e-22*2,-.313819*2];this.L3psycho_anal_ns=function(kt,Dt,Lt,Ut,Kt,Ft,Yt,Wt,Xt,sn){var en=kt.internal_flags,Qt=m1([2,r0.BLKSIZE]),ln=m1([2,3,r0.BLKSIZE_s]),gn=g0(r0.CBANDS+1),dn=g0(r0.CBANDS+1),Mn=g0(r0.CBANDS+2),rn=L1(2),kn=L1(2),zn,pn,In,hn,jn,pr,En,Bn,Hn=m1([2,576]),yr,Mt=L1(r0.CBANDS+2),Vt=L1(r0.CBANDS+2);for(Za.fill(Vt,0),zn=en.channels_out,kt.mode==i.JOINT_STEREO&&(zn=4),kt.VBR==C1.vbr_off?yr=en.ResvMax==0?0:en.ResvSize/en.ResvMax*.5:kt.VBR==C1.vbr_rh||kt.VBR==C1.vbr_mtrh||kt.VBR==C1.vbr_mt?yr=.6:yr=1,pn=0;pn<en.channels_out;pn++){var Gt=Dt[pn],Zt=Lt+576-350-g+192;for(hn=0;hn<576;hn++){var nn,on;for(nn=Gt[Zt+hn+10],on=0,jn=0;jn<(g-1)/2-1;jn+=2)nn+=Jt[jn]*(Gt[Zt+hn+jn]+Gt[Zt+hn+g-jn]),on+=Jt[jn+1]*(Gt[Zt+hn+jn+1]+Gt[Zt+hn+g-jn-1]);Hn[pn][hn]=nn+on}Kt[Ut][pn].en.assign(en.en[pn]),Kt[Ut][pn].thm.assign(en.thm[pn]),zn>2&&(Ft[Ut][pn].en.assign(en.en[pn+2]),Ft[Ut][pn].thm.assign(en.thm[pn+2]))}for(pn=0;pn<zn;pn++){var xn,Cn,$n=g0(12),Vn=[0,0,0,0],Jn=g0(12),Tr=1,Er,an=g0(r0.CBANDS),Xn=g0(r0.CBANDS),Un=[0,0,0,0],kr=g0(r0.HBLKSIZE),Ir=m1([3,r0.HBLKSIZE_s]);for(C0(en.npart_s<=r0.CBANDS),C0(en.npart_l<=r0.CBANDS),hn=0;hn<3;hn++)$n[hn]=en.nsPsy.last_en_subshort[pn][hn+6],C0(en.nsPsy.last_en_subshort[pn][hn+4]>0),Jn[hn]=$n[hn]/en.nsPsy.last_en_subshort[pn][hn+4],Vn[0]+=$n[hn];if(pn==2)for(hn=0;hn<576;hn++){var Br,Vr;Br=Hn[0][hn],Vr=Hn[1][hn],Hn[0][hn]=Br+Vr,Hn[1][hn]=Br-Vr}{var Zr=Hn[pn&1],Or=0;for(hn=0;hn<9;hn++){for(var Gr=Or+64,Ar=1;Or<Gr;Or++)Ar<Math.abs(Zr[Or])&&(Ar=Math.abs(Zr[Or]));en.nsPsy.last_en_subshort[pn][hn]=$n[hn+3]=Ar,Vn[1+hn/3]+=Ar,Ar>$n[hn+3-2]?(C0($n[hn+3-2]>0),Ar=Ar/$n[hn+3-2]):$n[hn+3-2]>Ar*10?Ar=$n[hn+3-2]/(Ar*10):Ar=0,Jn[hn+3]=Ar}}if(kt.analysis){var qr=Jn[0];for(hn=1;hn<12;hn++)qr<Jn[hn]&&(qr=Jn[hn]);en.pinfo.ers[Ut][pn]=en.pinfo.ers_save[pn],en.pinfo.ers_save[pn]=qr}for(Er=pn==3?en.nsPsy.attackthre_s:en.nsPsy.attackthre,hn=0;hn<12;hn++)Un[hn/3]==0&&Jn[hn]>Er&&(Un[hn/3]=hn%3+1);for(hn=1;hn<4;hn++){var Wr;Vn[hn-1]>Vn[hn]?(C0(Vn[hn]>0),Wr=Vn[hn-1]/Vn[hn]):(C0(Vn[hn-1]>0),Wr=Vn[hn]/Vn[hn-1]),Wr<1.7&&(Un[hn]=0,hn==1&&(Un[0]=0))}for(Un[0]!=0&&en.nsPsy.lastAttacks[pn]!=0&&(Un[0]=0),(en.nsPsy.lastAttacks[pn]==3||Un[0]+Un[1]+Un[2]+Un[3]!=0)&&(Tr=0,Un[1]!=0&&Un[0]!=0&&(Un[1]=0),Un[2]!=0&&Un[1]!=0&&(Un[2]=0),Un[3]!=0&&Un[2]!=0&&(Un[3]=0)),pn<2?kn[pn]=Tr:Tr==0&&(kn[0]=kn[1]=0),Xt[pn]=en.tot_ener[pn],Cn=ln,xn=Qt,tt(kt,kr,Ir,xn,pn&1,Cn,pn&1,Ut,pn,Dt,Lt),Nt(en,kr,gn,an,Xn),Ht(en,an,Xn,Mt),Bn=0;Bn<3;Bn++){var Jr,Pr;for(mt(kt,Ir,dn,Mn,pn,Bn),jt(en,dn,Mn,pn,Bn),En=0;En<r0.SBMAX_s;En++){if(Pr=en.thm[pn].s[En][Bn],Pr*=b,Un[Bn]>=2||Un[Bn+1]==1){var Mr=Bn!=0?Bn-1:2,Ar=ht(en.thm[pn].s[En][Mr],Pr,a*yr);Pr=Math.min(Pr,Ar)}if(Un[Bn]==1){var Mr=Bn!=0?Bn-1:2,Ar=ht(en.thm[pn].s[En][Mr],Pr,o*yr);Pr=Math.min(Pr,Ar)}else if(Bn!=0&&Un[Bn-1]==3||Bn==0&&en.nsPsy.lastAttacks[pn]==3){var Mr=Bn!=2?Bn+1:0,Ar=ht(en.thm[pn].s[En][Mr],Pr,o*yr);Pr=Math.min(Pr,Ar)}Jr=$n[Bn*3+3]+$n[Bn*3+4]+$n[Bn*3+5],$n[Bn*3+5]*6<Jr&&(Pr*=.5,$n[Bn*3+4]*6<Jr&&(Pr*=.5)),en.thm[pn].s[En][Bn]=Pr}}for(en.nsPsy.lastAttacks[pn]=Un[2],pr=0,In=0;In<en.npart_l;In++){for(var Dr=en.s3ind[In][0],Xr=gn[Dr]*ft[Mt[Dr]],Cr=en.s3_ll[pr++]*Xr;++Dr<=en.s3ind[In][1];)Xr=gn[Dr]*ft[Mt[Dr]],Cr=Tt(Cr,en.s3_ll[pr++]*Xr,Dr,Dr-In,en);Cr*=.158489319246111,en.blocktype_old[pn&1]==r0.SHORT_TYPE?Mn[In]=Cr:Mn[In]=ht(Math.min(Cr,Math.min(c*en.nb_1[pn][In],h*en.nb_2[pn][In])),Cr,yr),en.nb_2[pn][In]=en.nb_1[pn][In],en.nb_1[pn][In]=Cr}for(;In<=r0.CBANDS;++In)gn[In]=0,Mn[In]=0;Et(en,gn,Mn,pn)}if((kt.mode==i.STEREO||kt.mode==i.JOINT_STEREO)&&kt.interChRatio>0&&At(kt,kt.interChRatio),kt.mode==i.JOINT_STEREO){var Yr;Ot(en),Yr=kt.msfix,Math.abs(Yr)>0&&It(en,Yr,kt.ATHlower*en.ATH.adjust)}for(gt(kt,kn,sn,rn),pn=0;pn<zn;pn++){var Fr,Nr=0,Ur,zr;pn>1?(Fr=Wt,Nr=-2,Ur=r0.NORM_TYPE,(sn[0]==r0.SHORT_TYPE||sn[1]==r0.SHORT_TYPE)&&(Ur=r0.SHORT_TYPE),zr=Ft[Ut][pn-2]):(Fr=Yt,Nr=0,Ur=sn[pn],zr=Kt[Ut][pn]),Ur==r0.SHORT_TYPE?Fr[Nr+pn]=_t(zr,en.masking_lower):Fr[Nr+pn]=zt(zr,en.masking_lower),kt.analysis&&(en.pinfo.pe[Ut][pn]=Fr[Nr+pn])}return 0};function un(kt,Dt,Lt,Ut,Kt,Ft,Yt,Wt){var Xt=kt.internal_flags;if(Ut<2)e.fft_long(Xt,Yt[Wt],Ut,Dt,Lt);else if(Ut==2)for(var sn=r0.BLKSIZE-1;sn>=0;--sn){var en=Yt[Wt+0][sn],Qt=Yt[Wt+1][sn];Yt[Wt+0][sn]=(en+Qt)*n1.SQRT2*.5,Yt[Wt+1][sn]=(en-Qt)*n1.SQRT2*.5}Ft[0]=Yt[Wt+0][0],Ft[0]*=Ft[0];for(var sn=r0.BLKSIZE/2-1;sn>=0;--sn){var ln=Yt[Wt+0][r0.BLKSIZE/2-sn],gn=Yt[Wt+0][r0.BLKSIZE/2+sn];Ft[r0.BLKSIZE/2-sn]=(ln*ln+gn*gn)*.5}{for(var dn=0,sn=11;sn<r0.HBLKSIZE;sn++)dn+=Ft[sn];Xt.tot_ener[Ut]=dn}if(kt.analysis){for(var sn=0;sn<r0.HBLKSIZE;sn++)Xt.pinfo.energy[Kt][Ut][sn]=Xt.pinfo.energy_save[Ut][sn],Xt.pinfo.energy_save[Ut][sn]=Ft[sn];Xt.pinfo.pe[Kt][Ut]=Xt.pe[Ut]}}function yn(kt,Dt,Lt,Ut,Kt,Ft,Yt,Wt){var Xt=kt.internal_flags;if(Kt==0&&Ut<2&&e.fft_short(Xt,Yt[Wt],Ut,Dt,Lt),Ut==2)for(var sn=r0.BLKSIZE_s-1;sn>=0;--sn){var en=Yt[Wt+0][Kt][sn],Qt=Yt[Wt+1][Kt][sn];Yt[Wt+0][Kt][sn]=(en+Qt)*n1.SQRT2*.5,Yt[Wt+1][Kt][sn]=(en-Qt)*n1.SQRT2*.5}Ft[Kt][0]=Yt[Wt+0][Kt][0],Ft[Kt][0]*=Ft[Kt][0];for(var sn=r0.BLKSIZE_s/2-1;sn>=0;--sn){var ln=Yt[Wt+0][Kt][r0.BLKSIZE_s/2-sn],gn=Yt[Wt+0][Kt][r0.BLKSIZE_s/2+sn];Ft[Kt][r0.BLKSIZE_s/2-sn]=(ln*ln+gn*gn)*.5}}function vn(kt,Dt,Lt,Ut){var Kt=kt.internal_flags;kt.athaa_loudapprox==2&&Lt<2&&(Kt.loudness_sq[Dt][Lt]=Kt.loudness_sq_save[Lt],Kt.loudness_sq_save[Lt]=st(Ut,Kt))}var mn=[-865163e-23*2,-.00851586*2,-674764e-23*2,.0209036*2,-336639e-22*2,-.0438162*2,-154175e-22*2,.0931738*2,-552212e-22*2,-.313819*2];function Tn(kt,Dt,Lt,Ut,Kt,Ft,Yt,Wt,Xt,sn){for(var en=m1([2,576]),Qt=kt.internal_flags,ln=Qt.channels_out,gn=kt.mode==i.JOINT_STEREO?4:ln,dn=0;dn<ln;dn++){firbuf=Dt[dn];for(var Mn=Lt+576-350-g+192,rn=0;rn<576;rn++){var kn,zn;kn=firbuf[Mn+rn+10],zn=0;for(var pn=0;pn<(g-1)/2-1;pn+=2)kn+=mn[pn]*(firbuf[Mn+rn+pn]+firbuf[Mn+rn+g-pn]),zn+=mn[pn+1]*(firbuf[Mn+rn+pn+1]+firbuf[Mn+rn+g-pn-1]);en[dn][rn]=kn+zn}Kt[Ut][dn].en.assign(Qt.en[dn]),Kt[Ut][dn].thm.assign(Qt.thm[dn]),gn>2&&(Ft[Ut][dn].en.assign(Qt.en[dn+2]),Ft[Ut][dn].thm.assign(Qt.thm[dn+2]))}for(var dn=0;dn<gn;dn++){var In=g0(12),hn=g0(12),jn=[0,0,0,0],pr=en[dn&1],En=0,Bn=dn==3?Qt.nsPsy.attackthre_s:Qt.nsPsy.attackthre,Hn=1;if(dn==2)for(var rn=0,pn=576;pn>0;++rn,--pn){var yr=en[0][rn],Mt=en[1][rn];en[0][rn]=yr+Mt,en[1][rn]=yr-Mt}for(var rn=0;rn<3;rn++)hn[rn]=Qt.nsPsy.last_en_subshort[dn][rn+6],C0(Qt.nsPsy.last_en_subshort[dn][rn+4]>0),In[rn]=hn[rn]/Qt.nsPsy.last_en_subshort[dn][rn+4],jn[0]+=hn[rn];for(var rn=0;rn<9;rn++){for(var Vt=En+64,Gt=1;En<Vt;En++)Gt<Math.abs(pr[En])&&(Gt=Math.abs(pr[En]));Qt.nsPsy.last_en_subshort[dn][rn]=hn[rn+3]=Gt,jn[1+rn/3]+=Gt,Gt>hn[rn+3-2]?(C0(hn[rn+3-2]>0),Gt=Gt/hn[rn+3-2]):hn[rn+3-2]>Gt*10?Gt=hn[rn+3-2]/(Gt*10):Gt=0,In[rn+3]=Gt}for(var rn=0;rn<3;++rn){var Zt=hn[rn*3+3]+hn[rn*3+4]+hn[rn*3+5],nn=1;hn[rn*3+5]*6<Zt&&(nn*=.5,hn[rn*3+4]*6<Zt&&(nn*=.5)),Wt[dn][rn]=nn}if(kt.analysis){for(var on=In[0],rn=1;rn<12;rn++)on<In[rn]&&(on=In[rn]);Qt.pinfo.ers[Ut][dn]=Qt.pinfo.ers_save[dn],Qt.pinfo.ers_save[dn]=on}for(var rn=0;rn<12;rn++)Xt[dn][rn/3]==0&&In[rn]>Bn&&(Xt[dn][rn/3]=rn%3+1);for(var rn=1;rn<4;rn++){var xn=jn[rn-1],Cn=jn[rn],$n=Math.max(xn,Cn);$n<4e4&&xn<1.7*Cn&&Cn<1.7*xn&&(rn==1&&Xt[dn][0]<=Xt[dn][rn]&&(Xt[dn][0]=0),Xt[dn][rn]=0)}Xt[dn][0]<=Qt.nsPsy.lastAttacks[dn]&&(Xt[dn][0]=0),(Qt.nsPsy.lastAttacks[dn]==3||Xt[dn][0]+Xt[dn][1]+Xt[dn][2]+Xt[dn][3]!=0)&&(Hn=0,Xt[dn][1]!=0&&Xt[dn][0]!=0&&(Xt[dn][1]=0),Xt[dn][2]!=0&&Xt[dn][1]!=0&&(Xt[dn][2]=0),Xt[dn][3]!=0&&Xt[dn][2]!=0&&(Xt[dn][3]=0)),dn<2?sn[dn]=Hn:Hn==0&&(sn[0]=sn[1]=0),Yt[dn]=Qt.tot_ener[dn]}}function Pn(kt,Dt,Lt){if(Lt==0)for(var Ut=0;Ut<kt.npart_s;Ut++)kt.nb_s2[Dt][Ut]=kt.nb_s1[Dt][Ut],kt.nb_s1[Dt][Ut]=0}function Gn(kt,Dt){for(var Lt=0;Lt<kt.npart_l;Lt++)kt.nb_2[Dt][Lt]=kt.nb_1[Dt][Lt],kt.nb_1[Dt][Lt]=0}function wr(kt,Dt,Lt,Ut){var Kt=ft.length-1,Ft=0,Yt=Lt[Ft]+Lt[Ft+1];if(Yt>0){var Wt=Dt[Ft];Wt<Dt[Ft+1]&&(Wt=Dt[Ft+1]),C0(kt.numlines_s[Ft]+kt.numlines_s[Ft+1]-1>0),Yt=20*(Wt*2-Yt)/(Yt*(kt.numlines_s[Ft]+kt.numlines_s[Ft+1]-1));var Xt=0|Yt;Xt>Kt&&(Xt=Kt),Ut[Ft]=Xt}else Ut[Ft]=0;for(Ft=1;Ft<kt.npart_s-1;Ft++)if(Yt=Lt[Ft-1]+Lt[Ft]+Lt[Ft+1],C0(Ft+1<kt.npart_s),Yt>0){var Wt=Dt[Ft-1];Wt<Dt[Ft]&&(Wt=Dt[Ft]),Wt<Dt[Ft+1]&&(Wt=Dt[Ft+1]),C0(kt.numlines_s[Ft-1]+kt.numlines_s[Ft]+kt.numlines_s[Ft+1]-1>0),Yt=20*(Wt*3-Yt)/(Yt*(kt.numlines_s[Ft-1]+kt.numlines_s[Ft]+kt.numlines_s[Ft+1]-1));var Xt=0|Yt;Xt>Kt&&(Xt=Kt),Ut[Ft]=Xt}else Ut[Ft]=0;if(C0(Ft==kt.npart_s-1),Yt=Lt[Ft-1]+Lt[Ft],Yt>0){var Wt=Dt[Ft-1];Wt<Dt[Ft]&&(Wt=Dt[Ft]),C0(kt.numlines_s[Ft-1]+kt.numlines_s[Ft]-1>0),Yt=20*(Wt*2-Yt)/(Yt*(kt.numlines_s[Ft-1]+kt.numlines_s[Ft]-1));var Xt=0|Yt;Xt>Kt&&(Xt=Kt),Ut[Ft]=Xt}else Ut[Ft]=0;C0(Ft==kt.npart_s-1)}function xt(kt,Dt,Lt,Ut,Kt,Ft){var Yt=kt.internal_flags,Wt=new float[r0.CBANDS],Xt=g0(r0.CBANDS),sn,en,Qt,ln=new int[r0.CBANDS];for(Qt=en=0;Qt<Yt.npart_s;++Qt){var gn=0,dn=0,Mn=Yt.numlines_s[Qt];for(sn=0;sn<Mn;++sn,++en){var rn=Dt[Ft][en];gn+=rn,dn<rn&&(dn=rn)}Lt[Qt]=gn,Wt[Qt]=dn,Xt[Qt]=gn/Mn,C0(Xt[Qt]>=0)}for(C0(Qt==Yt.npart_s);Qt<r0.CBANDS;++Qt)Wt[Qt]=0,Xt[Qt]=0;for(wr(Yt,Wt,Xt,ln),en=Qt=0;Qt<Yt.npart_s;Qt++){var kn=Yt.s3ind_s[Qt][0],zn=Yt.s3ind_s[Qt][1],pn,In,hn,jn,pr;for(pn=ln[kn],In=1,jn=Yt.s3_ss[en]*Lt[kn]*ft[ln[kn]],++en,++kn;kn<=zn;)pn+=ln[kn],In+=1,hn=Yt.s3_ss[en]*Lt[kn]*ft[ln[kn]],jn=$t(jn,hn,kn-Qt),++en,++kn;pn=(1+2*pn)/(2*In),pr=ft[pn]*.5,jn*=pr,Ut[Qt]=jn,Yt.nb_s2[Kt][Qt]=Yt.nb_s1[Kt][Qt],Yt.nb_s1[Kt][Qt]=jn,hn=Wt[Qt],hn*=Yt.minval_s[Qt],hn*=pr,Ut[Qt]>hn&&(Ut[Qt]=hn),Yt.masking_lower>1&&(Ut[Qt]*=Yt.masking_lower),Ut[Qt]>Lt[Qt]&&(Ut[Qt]=Lt[Qt]),Yt.masking_lower<1&&(Ut[Qt]*=Yt.masking_lower),C0(Ut[Qt]>=0)}for(;Qt<r0.CBANDS;++Qt)Lt[Qt]=0,Ut[Qt]=0}function Pt(kt,Dt,Lt,Ut,Kt){var Ft=g0(r0.CBANDS),Yt=g0(r0.CBANDS),Wt=L1(r0.CBANDS+2),Xt;Nt(kt,Dt,Lt,Ft,Yt),Ht(kt,Ft,Yt,Wt);var sn=0;for(Xt=0;Xt<kt.npart_l;Xt++){var en,Qt,ln,gn,dn=kt.s3ind[Xt][0],Mn=kt.s3ind[Xt][1],rn=0,kn=0;for(rn=Wt[dn],kn+=1,Qt=kt.s3_ll[sn]*Lt[dn]*ft[Wt[dn]],++sn,++dn;dn<=Mn;)rn+=Wt[dn],kn+=1,en=kt.s3_ll[sn]*Lt[dn]*ft[Wt[dn]],gn=$t(Qt,en,dn-Xt),Qt=gn,++sn,++dn;if(rn=(1+2*rn)/(2*kn),ln=ft[rn]*.5,Qt*=ln,kt.blocktype_old[Kt&1]==r0.SHORT_TYPE){var zn=c*kt.nb_1[Kt][Xt];zn>0?Ut[Xt]=Math.min(Qt,zn):Ut[Xt]=Math.min(Qt,Lt[Xt]*o)}else{var pn=h*kt.nb_2[Kt][Xt],In=c*kt.nb_1[Kt][Xt],zn;pn<=0&&(pn=Qt),In<=0&&(In=Qt),kt.blocktype_old[Kt&1]==r0.NORM_TYPE?zn=Math.min(In,pn):zn=In,Ut[Xt]=Math.min(Qt,zn)}kt.nb_2[Kt][Xt]=kt.nb_1[Kt][Xt],kt.nb_1[Kt][Xt]=Qt,en=Ft[Xt],en*=kt.minval_l[Xt],en*=ln,Ut[Xt]>en&&(Ut[Xt]=en),kt.masking_lower>1&&(Ut[Xt]*=kt.masking_lower),Ut[Xt]>Lt[Xt]&&(Ut[Xt]=Lt[Xt]),kt.masking_lower<1&&(Ut[Xt]*=kt.masking_lower),C0(Ut[Xt]>=0)}for(;Xt<r0.CBANDS;++Xt)Lt[Xt]=0,Ut[Xt]=0}function wn(kt,Dt){var Lt=kt.internal_flags;kt.short_blocks==F1.short_block_coupled&&!(Dt[0]!=0&&Dt[1]!=0)&&(Dt[0]=Dt[1]=0);for(var Ut=0;Ut<Lt.channels_out;Ut++)kt.short_blocks==F1.short_block_dispensed&&(Dt[Ut]=1),kt.short_blocks==F1.short_block_forced&&(Dt[Ut]=0)}function bn(kt,Dt,Lt){for(var Ut=kt.internal_flags,Kt=0;Kt<Ut.channels_out;Kt++){var Ft=r0.NORM_TYPE;Dt[Kt]!=0?(C0(Ut.blocktype_old[Kt]!=r0.START_TYPE),Ut.blocktype_old[Kt]==r0.SHORT_TYPE&&(Ft=r0.STOP_TYPE)):(Ft=r0.SHORT_TYPE,Ut.blocktype_old[Kt]==r0.NORM_TYPE&&(Ut.blocktype_old[Kt]=r0.START_TYPE),Ut.blocktype_old[Kt]==r0.STOP_TYPE&&(Ut.blocktype_old[Kt]=r0.SHORT_TYPE)),Lt[Kt]=Ut.blocktype_old[Kt],Ut.blocktype_old[Kt]=Ft}}function Dn(kt,Dt,Lt,Ut,Kt,Ft,Yt){for(var Wt=Ft*2,Xt=Ft>0?Math.pow(10,Kt):1,sn,en,Qt=0;Qt<Yt;++Qt){var ln=kt[2][Qt],gn=kt[3][Qt],dn=Dt[0][Qt],Mn=Dt[1][Qt],rn=Dt[2][Qt],kn=Dt[3][Qt];if(dn<=1.58*Mn&&Mn<=1.58*dn){var zn=Lt[Qt]*gn,pn=Lt[Qt]*ln;en=Math.max(rn,Math.min(kn,zn)),sn=Math.max(kn,Math.min(rn,pn))}else en=rn,sn=kn;if(Ft>0){var In,hn,jn=Ut[Qt]*Xt;if(In=Math.min(Math.max(dn,jn),Math.max(Mn,jn)),rn=Math.max(en,jn),kn=Math.max(sn,jn),hn=rn+kn,hn>0&&In*Wt<hn){var pr=In*Wt/hn;rn*=pr,kn*=pr}en=Math.min(rn,en),sn=Math.min(kn,sn)}en>ln&&(en=ln),sn>gn&&(sn=gn),Dt[2][Qt]=en,Dt[3][Qt]=sn}}this.L3psycho_anal_vbr=function(kt,Dt,Lt,Ut,Kt,Ft,Yt,Wt,Xt,sn){var en=kt.internal_flags,Qt,ln,gn=g0(r0.HBLKSIZE),dn=m1([3,r0.HBLKSIZE_s]),Mn=m1([2,r0.BLKSIZE]),rn=m1([2,3,r0.BLKSIZE_s]),kn=m1([4,r0.CBANDS]),zn=m1([4,r0.CBANDS]),pn=m1([4,3]),In=.6,hn=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],jn=L1(2),pr=kt.mode==i.JOINT_STEREO?4:en.channels_out;Tn(kt,Dt,Lt,Ut,Kt,Ft,Xt,pn,hn,jn),wn(kt,jn);{for(var En=0;En<pr;En++){var Bn=En&1;Qt=Mn,un(kt,Dt,Lt,En,Ut,gn,Qt,Bn),vn(kt,Ut,En,gn),jn[Bn]!=0?Pt(en,gn,kn[En],zn[En],En):Gn(en,En)}jn[0]+jn[1]==2&&kt.mode==i.JOINT_STEREO&&Dn(kn,zn,en.mld_cb_l,en.ATH.cb_l,kt.ATHlower*en.ATH.adjust,kt.msfix,en.npart_l);for(var En=0;En<pr;En++){var Bn=En&1;jn[Bn]!=0&&Et(en,kn[En],zn[En],En)}}{for(var Hn=0;Hn<3;Hn++){for(var En=0;En<pr;++En){var Bn=En&1;jn[Bn]!=0?Pn(en,En,Hn):(ln=rn,yn(kt,Dt,Lt,En,Hn,dn,ln,Bn),xt(kt,dn,kn[En],zn[En],En,Hn))}jn[0]+jn[1]==0&&kt.mode==i.JOINT_STEREO&&Dn(kn,zn,en.mld_cb_s,en.ATH.cb_s,kt.ATHlower*en.ATH.adjust,kt.msfix,en.npart_s);for(var En=0;En<pr;++En){var Bn=En&1;jn[Bn]==0&&jt(en,kn[En],zn[En],En,Hn)}}for(var En=0;En<pr;En++){var Bn=En&1;if(jn[Bn]==0)for(var yr=0;yr<r0.SBMAX_s;yr++){for(var Mt=g0(3),Hn=0;Hn<3;Hn++){var Vt=en.thm[En].s[yr][Hn];if(Vt*=b,hn[En][Hn]>=2||hn[En][Hn+1]==1){var Gt=Hn!=0?Hn-1:2,Zt=ht(en.thm[En].s[yr][Gt],Vt,a*In);Vt=Math.min(Vt,Zt)}else if(hn[En][Hn]==1){var Gt=Hn!=0?Hn-1:2,Zt=ht(en.thm[En].s[yr][Gt],Vt,o*In);Vt=Math.min(Vt,Zt)}else if(Hn!=0&&hn[En][Hn-1]==3||Hn==0&&en.nsPsy.lastAttacks[En]==3){var Gt=Hn!=2?Hn+1:0,Zt=ht(en.thm[En].s[yr][Gt],Vt,o*In);Vt=Math.min(Vt,Zt)}Vt*=pn[En][Hn],Mt[Hn]=Vt}for(var Hn=0;Hn<3;Hn++)en.thm[En].s[yr][Hn]=Mt[Hn]}}}for(var En=0;En<pr;En++)en.nsPsy.lastAttacks[En]=hn[En][2];bn(kt,jn,sn);for(var En=0;En<pr;En++){var nn,on,xn,Cn;En>1?(nn=Wt,on=-2,xn=r0.NORM_TYPE,(sn[0]==r0.SHORT_TYPE||sn[1]==r0.SHORT_TYPE)&&(xn=r0.SHORT_TYPE),Cn=Ft[Ut][En-2]):(nn=Yt,on=0,xn=sn[En],Cn=Kt[Ut][En]),xn==r0.SHORT_TYPE?nn[on+En]=_t(Cn,en.masking_lower):nn[on+En]=zt(Cn,en.masking_lower),kt.analysis&&(en.pinfo.pe[Ut][En]=nn[on+En])}return 0};function Rn(kt,Dt){var Lt=kt,Ut;return Lt>=0?Ut=-Lt*27:Ut=Lt*Dt,Ut<=-72?0:Math.exp(Ut*rt)}function _n(kt){var Dt=0,Lt=0;{var Ut=0,Kt,Ft;for(Ut=0;Rn(Ut,kt)>1e-20;Ut-=1);for(Kt=Ut,Ft=0;Math.abs(Ft-Kt)>1e-12;)Ut=(Ft+Kt)/2,Rn(Ut,kt)>0?Ft=Ut:Kt=Ut;Dt=Kt}{var Ut=0,Kt,Ft;for(Ut=0;Rn(Ut,kt)>1e-20;Ut+=1);for(Kt=0,Ft=Ut;Math.abs(Ft-Kt)>1e-12;)Ut=(Ft+Kt)/2,Rn(Ut,kt)>0?Kt=Ut:Ft=Ut;Lt=Ft}{var Yt=0,Wt=1e3,Xt;for(Xt=0;Xt<=Wt;++Xt){var Ut=Dt+Xt*(Lt-Dt)/Wt,sn=Rn(Ut,kt);Yt+=sn}{var en=(Wt+1)/(Yt*(Lt-Dt));return en}}}function On(kt){var Dt,Lt,Ut,Kt;return Dt=kt,Dt>=0?Dt*=3:Dt*=1.5,Dt>=.5&&Dt<=2.5?(Kt=Dt-.5,Lt=8*(Kt*Kt-2*Kt)):Lt=0,Dt+=.474,Ut=15.811389+7.5*Dt-17.5*Math.sqrt(1+Dt*Dt),Ut<=-60?0:(Dt=Math.exp((Lt+Ut)*rt),Dt/=.6609193,Dt)}function Ln(kt){return kt<0&&(kt=0),kt=kt*.001,13*Math.atan(.76*kt)+3.5*Math.atan(kt*kt/(7.5*7.5))}function Nn(kt,Dt,Lt,Ut,Kt,Ft,Yt,Wt,Xt,sn,en,Qt){var ln=g0(r0.CBANDS+1),gn=Wt/(Qt>15?2*576:2*192),dn=L1(r0.HBLKSIZE),Mn;Wt/=Xt;var rn=0,kn=0;for(Mn=0;Mn<r0.CBANDS;Mn++){var zn,pn;for(zn=Ln(Wt*rn),ln[Mn]=Wt*rn,pn=rn;Ln(Wt*pn)-zn<j&&pn<=Xt/2;pn++);for(kt[Mn]=pn-rn,kn=Mn+1;rn<pn;)C0(rn<r0.HBLKSIZE),dn[rn++]=Mn;if(rn>Xt/2){rn=Xt/2,++Mn;break}}C0(Mn<r0.CBANDS),ln[Mn]=Wt*rn;for(var In=0;In<Qt;In++){var hn,jn,pr,En,Bn;pr=sn[In],En=sn[In+1],hn=0|Math.floor(.5+en*(pr-.5)),hn<0&&(hn=0),jn=0|Math.floor(.5+en*(En-.5)),jn>Xt/2&&(jn=Xt/2),Lt[In]=(dn[hn]+dn[jn])/2,Dt[In]=dn[jn];var Hn=gn*En;Yt[In]=(Hn-ln[Dt[In]])/(ln[Dt[In]+1]-ln[Dt[In]]),Yt[In]<0?Yt[In]=0:Yt[In]>1&&(Yt[In]=1),Bn=Ln(Wt*sn[In]*en),Bn=Math.min(Bn,15.5)/15.5,Ft[In]=Math.pow(10,1.25*(1-Math.cos(Math.PI*Bn))-2.5)}rn=0;for(var yr=0;yr<kn;yr++){var Mt=kt[yr],zn,Vt;zn=Ln(Wt*rn),Vt=Ln(Wt*(rn+Mt-1)),Ut[yr]=.5*(zn+Vt),zn=Ln(Wt*(rn-.5)),Vt=Ln(Wt*(rn+Mt-.5)),Kt[yr]=Vt-zn,rn+=Mt}return kn}function Sn(kt,Dt,Lt,Ut,Kt,Ft){var Yt=m1([r0.CBANDS,r0.CBANDS]),Wt,Xt=0;if(Ft)for(var sn=0;sn<Dt;sn++)for(Wt=0;Wt<Dt;Wt++){var en=On(Lt[sn]-Lt[Wt])*Ut[Wt];Yt[sn][Wt]=en*Kt[sn]}else for(Wt=0;Wt<Dt;Wt++)for(var Qt=15+Math.min(21/Lt[Wt],12),ln=_n(Qt),sn=0;sn<Dt;sn++){var en=ln*Rn(Lt[sn]-Lt[Wt],Qt)*Ut[Wt];Yt[sn][Wt]=en*Kt[sn]}for(var sn=0;sn<Dt;sn++){for(Wt=0;Wt<Dt&&!(Yt[sn][Wt]>0);Wt++);for(kt[sn][0]=Wt,Wt=Dt-1;Wt>0&&!(Yt[sn][Wt]>0);Wt--);kt[sn][1]=Wt,Xt+=kt[sn][1]-kt[sn][0]+1}for(var gn=g0(Xt),dn=0,sn=0;sn<Dt;sn++)for(Wt=kt[sn][0];Wt<=kt[sn][1];Wt++)gn[dn++]=Yt[sn][Wt];return gn}function qn(kt){var Dt=Ln(kt);return Dt=Math.min(Dt,15.5)/15.5,Math.pow(10,1.25*(1-Math.cos(Math.PI*Dt))-2.5)}this.psymodel_init=function(kt){var Dt=kt.internal_flags,Lt,Ut=!0,Kt=13,Ft=24,Yt=0,Wt=0,Xt=-8.25,sn=-4.5,en=g0(r0.CBANDS),Qt=g0(r0.CBANDS),ln=g0(r0.CBANDS),gn=kt.out_samplerate;switch(kt.experimentalZ){default:case 0:Ut=!0;break;case 1:Ut=!(kt.VBR==C1.vbr_mtrh||kt.VBR==C1.vbr_mt);break;case 2:Ut=!1;break;case 3:Kt=8,Yt=-1.75,Wt=-.0125,Xt=-8.25,sn=-2.25;break}for(Dt.ms_ener_ratio_old=.25,Dt.blocktype_old[0]=Dt.blocktype_old[1]=r0.NORM_TYPE,Lt=0;Lt<4;++Lt){for(var rn=0;rn<r0.CBANDS;++rn)Dt.nb_1[Lt][rn]=1e20,Dt.nb_2[Lt][rn]=1e20,Dt.nb_s1[Lt][rn]=Dt.nb_s2[Lt][rn]=1;for(var dn=0;dn<r0.SBMAX_l;dn++)Dt.en[Lt].l[dn]=1e20,Dt.thm[Lt].l[dn]=1e20;for(var rn=0;rn<3;++rn){for(var dn=0;dn<r0.SBMAX_s;dn++)Dt.en[Lt].s[dn][rn]=1e20,Dt.thm[Lt].s[dn][rn]=1e20;Dt.nsPsy.lastAttacks[Lt]=0}for(var rn=0;rn<9;rn++)Dt.nsPsy.last_en_subshort[Lt][rn]=10}for(Dt.loudness_sq_save[0]=Dt.loudness_sq_save[1]=0,Dt.npart_l=Nn(Dt.numlines_l,Dt.bo_l,Dt.bm_l,en,Qt,Dt.mld_l,Dt.PSY.bo_l_weight,gn,r0.BLKSIZE,Dt.scalefac_band.l,r0.BLKSIZE/(2*576),r0.SBMAX_l),C0(Dt.npart_l<r0.CBANDS),Lt=0;Lt<Dt.npart_l;Lt++){var Mn=Yt;en[Lt]>=Kt&&(Mn=Wt*(en[Lt]-Kt)/(Ft-Kt)+Yt*(Ft-en[Lt])/(Ft-Kt)),ln[Lt]=Math.pow(10,Mn/10),Dt.numlines_l[Lt]>0?Dt.rnumlines_l[Lt]=1/Dt.numlines_l[Lt]:Dt.rnumlines_l[Lt]=0}Dt.s3_ll=Sn(Dt.s3ind,Dt.npart_l,en,Qt,ln,Ut);var rn=0;for(Lt=0;Lt<Dt.npart_l;Lt++){var kn;kn=Ue.MAX_VALUE;for(var zn=0;zn<Dt.numlines_l[Lt];zn++,rn++){var pn=gn*rn/(1e3*r0.BLKSIZE),In;In=this.ATHformula(pn*1e3,kt)-20,In=Math.pow(10,.1*In),In*=Dt.numlines_l[Lt],kn>In&&(kn=In)}Dt.ATH.cb_l[Lt]=kn,kn=-20+en[Lt]*20/10,kn>6&&(kn=100),kn<-15&&(kn=-15),kn-=8,Dt.minval_l[Lt]=Math.pow(10,kn/10)*Dt.numlines_l[Lt]}for(Dt.npart_s=Nn(Dt.numlines_s,Dt.bo_s,Dt.bm_s,en,Qt,Dt.mld_s,Dt.PSY.bo_s_weight,gn,r0.BLKSIZE_s,Dt.scalefac_band.s,r0.BLKSIZE_s/(2*192),r0.SBMAX_s),C0(Dt.npart_s<r0.CBANDS),rn=0,Lt=0;Lt<Dt.npart_s;Lt++){var kn,Mn=Xt;en[Lt]>=Kt&&(Mn=sn*(en[Lt]-Kt)/(Ft-Kt)+Xt*(Ft-en[Lt])/(Ft-Kt)),ln[Lt]=Math.pow(10,Mn/10),kn=Ue.MAX_VALUE;for(var zn=0;zn<Dt.numlines_s[Lt];zn++,rn++){var pn=gn*rn/(1e3*r0.BLKSIZE_s),In;In=this.ATHformula(pn*1e3,kt)-20,In=Math.pow(10,.1*In),In*=Dt.numlines_s[Lt],kn>In&&(kn=In)}Dt.ATH.cb_s[Lt]=kn,kn=-7+en[Lt]*7/12,en[Lt]>12&&(kn*=1+Math.log(1+kn)*3.1),en[Lt]<12&&(kn*=1+Math.log(1-kn)*2.3),kn<-15&&(kn=-15),kn-=8,Dt.minval_s[Lt]=Math.pow(10,kn/10)*Dt.numlines_s[Lt]}Dt.s3_ss=Sn(Dt.s3ind_s,Dt.npart_s,en,Qt,ln,Ut),dt(),e.init_fft(Dt),Dt.decay=Math.exp(-1*s/(et*gn/192));{var hn;hn=d,kt.exp_nspsytune&2&&(hn=1),Math.abs(kt.msfix)>0&&(hn=kt.msfix),kt.msfix=hn;for(var jn=0;jn<Dt.npart_l;jn++)Dt.s3ind[jn][1]>Dt.npart_l-1&&(Dt.s3ind[jn][1]=Dt.npart_l-1)}var pr=576*Dt.mode_gr/gn;if(Dt.ATH.decay=Math.pow(10,-12/10*pr),Dt.ATH.adjust=.01,Dt.ATH.adjustLimit=1,C0(Dt.bo_l[r0.SBMAX_l-1]<=Dt.npart_l),C0(Dt.bo_s[r0.SBMAX_s-1]<=Dt.npart_s),kt.ATHtype!=-1){var pn,En=kt.out_samplerate/r0.BLKSIZE,Bn=0;for(pn=0,Lt=0;Lt<r0.BLKSIZE/2;++Lt)pn+=En,Dt.ATH.eql_w[Lt]=1/Math.pow(10,this.ATHformula(pn,kt)/10),Bn+=Dt.ATH.eql_w[Lt];for(Bn=1/Bn,Lt=r0.BLKSIZE/2;--Lt>=0;)Dt.ATH.eql_w[Lt]*=Bn}{for(var jn=rn=0;jn<Dt.npart_s;++jn)for(Lt=0;Lt<Dt.numlines_s[jn];++Lt)++rn;for(var jn=rn=0;jn<Dt.npart_l;++jn)for(Lt=0;Lt<Dt.numlines_l[jn];++Lt)++rn}for(rn=0,Lt=0;Lt<Dt.npart_l;Lt++){var pn=gn*(rn+Dt.numlines_l[Lt]/2)/(1*r0.BLKSIZE);Dt.mld_cb_l[Lt]=qn(pn),rn+=Dt.numlines_l[Lt]}for(;Lt<r0.CBANDS;++Lt)Dt.mld_cb_l[Lt]=1;for(rn=0,Lt=0;Lt<Dt.npart_s;Lt++){var pn=gn*(rn+Dt.numlines_s[Lt]/2)/(1*r0.BLKSIZE_s);Dt.mld_cb_s[Lt]=qn(pn),rn+=Dt.numlines_s[Lt]}for(;Lt<r0.CBANDS;++Lt)Dt.mld_cb_s[Lt]=1;return 0};function gr(kt,Dt){kt<-.3&&(kt=3410),kt/=1e3,kt=Math.max(.1,kt);var Lt=3.64*Math.pow(kt,-.8)-6.8*Math.exp(-.6*Math.pow(kt-3.4,2))+6*Math.exp(-.15*Math.pow(kt-8.7,2))+(.6+.04*Dt)*.001*Math.pow(kt,4);return Lt}this.ATHformula=function(kt,Dt){var Lt;switch(Dt.ATHtype){case 0:Lt=gr(kt,9);break;case 1:Lt=gr(kt,-1);break;case 2:Lt=gr(kt,0);break;case 3:Lt=gr(kt,1)+6;break;case 4:Lt=gr(kt,Dt.ATHcurve);break;default:Lt=gr(kt,0);break}return Lt}}var Qa=Ua,Wa=j1;function ja(){this.class_id=0,this.num_samples=0,this.num_channels=0,this.in_samplerate=0,this.out_samplerate=0,this.scale=0,this.scale_left=0,this.scale_right=0,this.analysis=!1,this.bWriteVbrTag=!1,this.decode_only=!1,this.quality=0,this.mode=Wa.STEREO,this.force_ms=!1,this.free_format=!1,this.findReplayGain=!1,this.decode_on_the_fly=!1,this.write_id3tag_automatic=!1,this.brate=0,this.compression_ratio=0,this.copyright=0,this.original=0,this.extension=0,this.emphasis=0,this.error_protection=0,this.strict_ISO=!1,this.disable_reservoir=!1,this.quant_comp=0,this.quant_comp_short=0,this.experimentalY=!1,this.experimentalZ=0,this.exp_nspsytune=0,this.preset=0,this.VBR=null,this.VBR_q_frac=0,this.VBR_q=0,this.VBR_mean_bitrate_kbps=0,this.VBR_min_bitrate_kbps=0,this.VBR_max_bitrate_kbps=0,this.VBR_hard_min=0,this.lowpassfreq=0,this.highpassfreq=0,this.lowpasswidth=0,this.highpasswidth=0,this.maskingadjust=0,this.maskingadjust_short=0,this.ATHonly=!1,this.ATHshort=!1,this.noATH=!1,this.ATHtype=0,this.ATHcurve=0,this.ATHlower=0,this.athaa_type=0,this.athaa_loudapprox=0,this.athaa_sensitivity=0,this.short_blocks=null,this.useTemporal=!1,this.interChRatio=0,this.msfix=0,this.tune=!1,this.tune_value_a=0,this.version=0,this.encoder_delay=0,this.encoder_padding=0,this.framesize=0,this.frameNum=0,this.lame_allocated_gfp=0,this.internal_flags=null}var za=ja,Ja=t1(),Ta={};Ta.SFBMAX=Ja.SBMAX_s*3;var ie=Ta,ya=Q0,ga=ya.new_float,N1=ya.new_int,Re=ie;function e2(){this.xr=ga(576),this.l3_enc=N1(576),this.scalefac=N1(Re.SFBMAX),this.xrpow_max=0,this.part2_3_length=0,this.big_values=0,this.count1=0,this.global_gain=0,this.scalefac_compress=0,this.block_type=0,this.mixed_block_flag=0,this.table_select=N1(3),this.subblock_gain=N1(4),this.region0_count=0,this.region1_count=0,this.preflag=0,this.scalefac_scale=0,this.count1table_select=0,this.part2_length=0,this.sfb_lmax=0,this.sfb_smin=0,this.psy_lmax=0,this.sfbmax=0,this.psymax=0,this.sfbdivide=0,this.width=N1(Re.SFBMAX),this.window=N1(Re.SFBMAX),this.count1bits=0,this.sfb_partition_table=null,this.slen=N1(4),this.max_nonzero_coeff=0;var i=this;function e(c){return new Int32Array(c)}function s(c){return new Float32Array(c)}this.assign=function(c){i.xr=s(c.xr),i.l3_enc=e(c.l3_enc),i.scalefac=e(c.scalefac),i.xrpow_max=c.xrpow_max,i.part2_3_length=c.part2_3_length,i.big_values=c.big_values,i.count1=c.count1,i.global_gain=c.global_gain,i.scalefac_compress=c.scalefac_compress,i.block_type=c.block_type,i.mixed_block_flag=c.mixed_block_flag,i.table_select=e(c.table_select),i.subblock_gain=e(c.subblock_gain),i.region0_count=c.region0_count,i.region1_count=c.region1_count,i.preflag=c.preflag,i.scalefac_scale=c.scalefac_scale,i.count1table_select=c.count1table_select,i.part2_length=c.part2_length,i.sfb_lmax=c.sfb_lmax,i.sfb_smin=c.sfb_smin,i.psy_lmax=c.psy_lmax,i.sfbmax=c.sfbmax,i.psymax=c.psymax,i.sfbdivide=c.sfbdivide,i.width=e(c.width),i.window=e(c.window),i.count1bits=c.count1bits,i.sfb_partition_table=c.sfb_partition_table.slice(0),i.slen=e(c.slen),i.max_nonzero_coeff=c.max_nonzero_coeff}}var Le=e2,a2=Q0,Qe=a2.new_int,r2=Le;function t2(){this.tt=[[null,null],[null,null]],this.main_data_begin=0,this.private_bits=0,this.resvDrain_pre=0,this.resvDrain_post=0,this.scfsi=[Qe(4),Qe(4)];for(var i=0;i<2;i++)for(var e=0;e<2;e++)this.tt[i][e]=new r2}var s2=t2,wa=Q0,g1=wa.System,ee=wa.new_int,ae=t1();function i2(i,e,s,c){this.l=ee(1+ae.SBMAX_l),this.s=ee(1+ae.SBMAX_s),this.psfb21=ee(1+ae.PSFB21),this.psfb12=ee(1+ae.PSFB12);var h=this.l,$=this.s;arguments.length==4&&(this.arrL=arguments[0],this.arrS=arguments[1],this.arr21=arguments[2],this.arr12=arguments[3],g1.arraycopy(this.arrL,0,h,0,Math.min(this.arrL.length,this.l.length)),g1.arraycopy(this.arrS,0,$,0,Math.min(this.arrS.length,this.s.length)),g1.arraycopy(this.arr21,0,this.psfb21,0,Math.min(this.arr21.length,this.psfb21.length)),g1.arraycopy(this.arr12,0,this.psfb12,0,Math.min(this.arr12.length,this.psfb12.length)))}var Ia=i2,Ne=Q0,xe=Ne.new_float,n2=Ne.new_float_n,_2=Ne.new_int,We=t1();function l2(){this.last_en_subshort=n2([4,9]),this.lastAttacks=_2(4),this.pefirbuf=xe(19),this.longfact=xe(We.SBMAX_l),this.shortfact=xe(We.SBMAX_s),this.attackthre=0,this.attackthre_s=0}var v2=l2;function o2(){this.sum=0,this.seen=0,this.want=0,this.pos=0,this.size=0,this.bag=null,this.nVbrNumFrames=0,this.nBytesWritten=0,this.TotalFrameSize=0}var h2=o2,Y1=Q0,u2=Y1.new_byte,f2=Y1.new_double,b1=Y1.new_float,p1=Y1.new_float_n,d1=Y1.new_int,re=Y1.new_int_n,m2=s2,b2=Ia,c2=v2,S2=h2,je=Ea(),W0=t1(),d2=ie;E1.MFSIZE=3*1152+W0.ENCDELAY-W0.MDCTDELAY,E1.MAX_HEADER_BUF=256,E1.MAX_BITS_PER_CHANNEL=4095,E1.MAX_BITS_PER_GRANULE=7680,E1.BPC=320;function E1(){var i=40;this.Class_ID=0,this.lame_encode_frame_init=0,this.iteration_init_init=0,this.fill_buffer_resample_init=0,this.mfbuf=p1([2,E1.MFSIZE]),this.mode_gr=0,this.channels_in=0,this.channels_out=0,this.resample_ratio=0,this.mf_samples_to_encode=0,this.mf_size=0,this.VBR_min_bitrate=0,this.VBR_max_bitrate=0,this.bitrate_index=0,this.samplerate_index=0,this.mode_ext=0,this.lowpass1=0,this.lowpass2=0,this.highpass1=0,this.highpass2=0,this.noise_shaping=0,this.noise_shaping_amp=0,this.substep_shaping=0,this.psymodel=0,this.noise_shaping_stop=0,this.subblock_gain=0,this.use_best_huffman=0,this.full_outer_loop=0,this.l3_side=new m2,this.ms_ratio=b1(2),this.padding=0,this.frac_SpF=0,this.slot_lag=0,this.tag_spec=null,this.nMusicCRC=0,this.OldValue=d1(2),this.CurrentStep=d1(2),this.masking_lower=0,this.bv_scf=d1(576),this.pseudohalf=d1(d2.SFBMAX),this.sfb21_extra=!1,this.inbuf_old=new Array(2),this.blackfilt=new Array(2*E1.BPC+1),this.itime=f2(2),this.sideinfo_len=0,this.sb_sample=p1([2,2,18,W0.SBLIMIT]),this.amp_filter=b1(32);function e(){this.write_timing=0,this.ptr=0,this.buf=u2(i)}this.header=new Array(E1.MAX_HEADER_BUF),this.h_ptr=0,this.w_ptr=0,this.ancillary_flag=0,this.ResvSize=0,this.ResvMax=0,this.scalefac_band=new b2,this.minval_l=b1(W0.CBANDS),this.minval_s=b1(W0.CBANDS),this.nb_1=p1([4,W0.CBANDS]),this.nb_2=p1([4,W0.CBANDS]),this.nb_s1=p1([4,W0.CBANDS]),this.nb_s2=p1([4,W0.CBANDS]),this.s3_ss=null,this.s3_ll=null,this.decay=0,this.thm=new Array(4),this.en=new Array(4),this.tot_ener=b1(4),this.loudness_sq=p1([2,2]),this.loudness_sq_save=b1(2),this.mld_l=b1(W0.SBMAX_l),this.mld_s=b1(W0.SBMAX_s),this.bm_l=d1(W0.SBMAX_l),this.bo_l=d1(W0.SBMAX_l),this.bm_s=d1(W0.SBMAX_s),this.bo_s=d1(W0.SBMAX_s),this.npart_l=0,this.npart_s=0,this.s3ind=re([W0.CBANDS,2]),this.s3ind_s=re([W0.CBANDS,2]),this.numlines_s=d1(W0.CBANDS),this.numlines_l=d1(W0.CBANDS),this.rnumlines_l=b1(W0.CBANDS),this.mld_cb_l=b1(W0.CBANDS),this.mld_cb_s=b1(W0.CBANDS),this.numlines_s_num1=0,this.numlines_l_num1=0,this.pe=b1(4),this.ms_ratio_s_old=0,this.ms_ratio_l_old=0,this.ms_ener_ratio_old=0,this.blocktype_old=d1(2),this.nsPsy=new c2,this.VBR_seek_table=new S2,this.ATH=null,this.PSY=null,this.nogap_total=0,this.nogap_current=0,this.decode_on_the_fly=!0,this.findReplayGain=!0,this.findPeakSample=!0,this.PeakSample=0,this.RadioGain=0,this.AudiophileGain=0,this.rgdata=null,this.noclipGainChange=0,this.noclipScale=0,this.bitrate_stereoMode_Hist=re([16,5]),this.bitrate_blockType_Hist=re([16,6]),this.pinfo=null,this.hip=null,this.in_buffer_nsamples=0,this.in_buffer_0=null,this.in_buffer_1=null,this.iteration_loop=null;for(var s=0;s<this.en.length;s++)this.en[s]=new je;for(var s=0;s<this.thm.length;s++)this.thm[s]=new je;for(var s=0;s<this.header.length;s++)this.header[s]=new e}var ne=E1,A2=Q0,H1=A2.new_float,V1=t1();function R2(){this.useAdjust=0,this.aaSensitivityP=0,this.adjust=0,this.adjustLimit=0,this.decay=0,this.floor=0,this.l=H1(V1.SBMAX_l),this.s=H1(V1.SBMAX_s),this.psfb21=H1(V1.PSFB21),this.psfb12=H1(V1.PSFB12),this.cb_l=H1(V1.CBANDS),this.cb_s=H1(V1.CBANDS),this.eql_w=H1(V1.BLKSIZE/2)}var x2=R2,La=Q0,_1=La.System,ze=La.Arrays;j0.STEPS_per_dB=100,j0.MAX_dB=120,j0.GAIN_NOT_ENOUGH_SAMPLES=-24601,j0.GAIN_ANALYSIS_ERROR=0,j0.GAIN_ANALYSIS_OK=1,j0.INIT_GAIN_ANALYSIS_ERROR=0,j0.INIT_GAIN_ANALYSIS_OK=1,j0.YULE_ORDER=10,j0.MAX_ORDER=j0.YULE_ORDER,j0.MAX_SAMP_FREQ=48e3,j0.RMS_WINDOW_TIME_NUMERATOR=1,j0.RMS_WINDOW_TIME_DENOMINATOR=20,j0.MAX_SAMPLES_PER_WINDOW=j0.MAX_SAMP_FREQ*j0.RMS_WINDOW_TIME_NUMERATOR/j0.RMS_WINDOW_TIME_DENOMINATOR+1;function j0(){var i=64.82,e=.95,s=j0.RMS_WINDOW_TIME_NUMERATOR,c=j0.RMS_WINDOW_TIME_DENOMINATOR,h=[[.038575994352,-3.84664617118067,-.02160367184185,7.81501653005538,-.00123395316851,-11.34170355132042,-9291677959e-14,13.05504219327545,-.01655260341619,-12.28759895145294,.02161526843274,9.4829380631979,-.02074045215285,-5.87257861775999,.00594298065125,2.75465861874613,.00306428023191,-.86984376593551,.00012025322027,.13919314567432,.00288463683916],[.0541865640643,-3.47845948550071,-.02911007808948,6.36317777566148,-.00848709379851,-8.54751527471874,-.00851165645469,9.4769360780128,-.00834990904936,-8.81498681370155,.02245293253339,6.85401540936998,-.02596338512915,-4.39470996079559,.01624864962975,2.19611684890774,-.00240879051584,-.75104302451432,.00674613682247,.13149317958808,-.00187763777362],[.15457299681924,-2.37898834973084,-.09331049056315,2.84868151156327,-.06247880153653,-2.64577170229825,.02163541888798,2.23697657451713,-.05588393329856,-1.67148153367602,.04781476674921,1.00595954808547,.00222312597743,-.45953458054983,.03174092540049,.16378164858596,-.01390589421898,-.05032077717131,.00651420667831,.0234789740702,-.00881362733839],[.30296907319327,-1.61273165137247,-.22613988682123,1.0797749225997,-.08587323730772,-.2565625775407,.03282930172664,-.1627671912044,-.00915702933434,-.22638893773906,-.02364141202522,.39120800788284,-.00584456039913,-.22138138954925,.06276101321749,.04500235387352,-828086748e-14,.02005851806501,.00205861885564,.00302439095741,-.02950134983287],[.33642304856132,-1.49858979367799,-.2557224142557,.87350271418188,-.11828570177555,.12205022308084,.11921148675203,-.80774944671438,-.07834489609479,.47854794562326,-.0046997791438,-.12453458140019,-.0058950022444,-.04067510197014,.05724228140351,.08333755284107,.00832043980773,-.04237348025746,-.0163538138454,.02977207319925,-.0176017656815],[.4491525660845,-.62820619233671,-.14351757464547,.29661783706366,-.22784394429749,-.372563729424,-.01419140100551,.00213767857124,.04078262797139,-.42029820170918,-.12398163381748,.22199650564824,.04097565135648,.00613424350682,.10478503600251,.06747620744683,-.01863887810927,.05784820375801,-.03193428438915,.03222754072173,.00541907748707],[.56619470757641,-1.04800335126349,-.75464456939302,.29156311971249,.1624213774223,-.26806001042947,.16744243493672,.00819999645858,-.18901604199609,.45054734505008,.3093178284183,-.33032403314006,-.27562961986224,.0673936833311,.00647310677246,-.04784254229033,.08647503780351,.01639907836189,-.0378898455484,.01807364323573,-.00588215443421],[.58100494960553,-.51035327095184,-.53174909058578,-.31863563325245,-.14289799034253,-.20256413484477,.17520704835522,.1472815413433,.02377945217615,.38952639978999,.15558449135573,-.23313271880868,-.25344790059353,-.05246019024463,.01628462406333,-.02505961724053,.06920467763959,.02442357316099,-.03721611395801,.01818801111503,-.00749618797172],[.53648789255105,-.2504987195602,-.42163034350696,-.43193942311114,-.00275953611929,-.03424681017675,.04267842219415,-.04678328784242,-.10214864179676,.26408300200955,.14590772289388,.15113130533216,-.02459864859345,-.17556493366449,-.11202315195388,-.18823009262115,-.04060034127,.05477720428674,.0478866554818,.0470440968812,-.02217936801134]],$=[[.98621192462708,-1.97223372919527,-1.97242384925416,.97261396931306,.98621192462708],[.98500175787242,-1.96977855582618,-1.97000351574484,.9702284756635,.98500175787242],[.97938932735214,-1.95835380975398,-1.95877865470428,.95920349965459,.97938932735214],[.97531843204928,-1.95002759149878,-1.95063686409857,.95124613669835,.97531843204928],[.97316523498161,-1.94561023566527,-1.94633046996323,.94705070426118,.97316523498161],[.96454515552826,-1.92783286977036,-1.92909031105652,.93034775234268,.96454515552826],[.96009142950541,-1.91858953033784,-1.92018285901082,.92177618768381,.96009142950541],[.95856916599601,-1.9154210807478,-1.91713833199203,.91885558323625,.95856916599601],[.94597685600279,-1.88903307939452,-1.89195371200558,.89487434461664,.94597685600279]];function _(a,o,d,g,rt,st){for(;rt--!=0;)d[g]=1e-10+a[o+0]*st[0]-d[g-1]*st[1]+a[o-1]*st[2]-d[g-2]*st[3]+a[o-2]*st[4]-d[g-3]*st[5]+a[o-3]*st[6]-d[g-4]*st[7]+a[o-4]*st[8]-d[g-5]*st[9]+a[o-5]*st[10]-d[g-6]*st[11]+a[o-6]*st[12]-d[g-7]*st[13]+a[o-7]*st[14]-d[g-8]*st[15]+a[o-8]*st[16]-d[g-9]*st[17]+a[o-9]*st[18]-d[g-10]*st[19]+a[o-10]*st[20],++g,++o}function j(a,o,d,g,rt,st){for(;rt--!=0;)d[g]=a[o+0]*st[0]-d[g-1]*st[1]+a[o-1]*st[2]-d[g-2]*st[3]+a[o-2]*st[4],++g,++o}function nt(a,o){for(var d=0;d<MAX_ORDER;d++)a.linprebuf[d]=a.lstepbuf[d]=a.loutbuf[d]=a.rinprebuf[d]=a.rstepbuf[d]=a.routbuf[d]=0;switch(0|o){case 48e3:a.reqindex=0;break;case 44100:a.reqindex=1;break;case 32e3:a.reqindex=2;break;case 24e3:a.reqindex=3;break;case 22050:a.reqindex=4;break;case 16e3:a.reqindex=5;break;case 12e3:a.reqindex=6;break;case 11025:a.reqindex=7;break;case 8e3:a.reqindex=8;break;default:return INIT_GAIN_ANALYSIS_ERROR}return a.sampleWindow=0|(o*s+c-1)/c,a.lsum=0,a.rsum=0,a.totsamp=0,ze.ill(a.A,0),INIT_GAIN_ANALYSIS_OK}this.InitGainAnalysis=function(a,o){return nt(a,o)!=INIT_GAIN_ANALYSIS_OK?INIT_GAIN_ANALYSIS_ERROR:(a.linpre=MAX_ORDER,a.rinpre=MAX_ORDER,a.lstep=MAX_ORDER,a.rstep=MAX_ORDER,a.lout=MAX_ORDER,a.rout=MAX_ORDER,ze.fill(a.B,0),INIT_GAIN_ANALYSIS_OK)};function et(a){return a*a}this.AnalyzeSamples=function(a,o,d,g,rt,st,tt){var ot,it,at,ut,lt,ct,ft;if(st==0)return GAIN_ANALYSIS_OK;switch(ft=0,lt=st,tt){case 1:g=o,rt=d;break;case 2:break;default:return GAIN_ANALYSIS_ERROR}for(st<MAX_ORDER?(_1.arraycopy(o,d,a.linprebuf,MAX_ORDER,st),_1.arraycopy(g,rt,a.rinprebuf,MAX_ORDER,st)):(_1.arraycopy(o,d,a.linprebuf,MAX_ORDER,MAX_ORDER),_1.arraycopy(g,rt,a.rinprebuf,MAX_ORDER,MAX_ORDER));lt>0;){ct=lt>a.sampleWindow-a.totsamp?a.sampleWindow-a.totsamp:lt,ft<MAX_ORDER?(ot=a.linpre+ft,it=a.linprebuf,at=a.rinpre+ft,ut=a.rinprebuf,ct>MAX_ORDER-ft&&(ct=MAX_ORDER-ft)):(ot=d+ft,it=o,at=rt+ft,ut=g),_(it,ot,a.lstepbuf,a.lstep+a.totsamp,ct,h[a.reqindex]),_(ut,at,a.rstepbuf,a.rstep+a.totsamp,ct,h[a.reqindex]),j(a.lstepbuf,a.lstep+a.totsamp,a.loutbuf,a.lout+a.totsamp,ct,$[a.reqindex]),j(a.rstepbuf,a.rstep+a.totsamp,a.routbuf,a.rout+a.totsamp,ct,$[a.reqindex]),ot=a.lout+a.totsamp,it=a.loutbuf,at=a.rout+a.totsamp,ut=a.routbuf;for(var dt=ct%8;dt--!=0;)a.lsum+=et(it[ot++]),a.rsum+=et(ut[at++]);for(dt=ct/8;dt--!=0;)a.lsum+=et(it[ot+0])+et(it[ot+1])+et(it[ot+2])+et(it[ot+3])+et(it[ot+4])+et(it[ot+5])+et(it[ot+6])+et(it[ot+7]),ot+=8,a.rsum+=et(ut[at+0])+et(ut[at+1])+et(ut[at+2])+et(ut[at+3])+et(ut[at+4])+et(ut[at+5])+et(ut[at+6])+et(ut[at+7]),at+=8;if(lt-=ct,ft+=ct,a.totsamp+=ct,a.totsamp==a.sampleWindow){var yt=j0.STEPS_per_dB*10*Math.log10((a.lsum+a.rsum)/a.totsamp*.5+1e-37),St=yt<=0?0:0|yt;St>=a.A.length&&(St=a.A.length-1),a.A[St]++,a.lsum=a.rsum=0,_1.arraycopy(a.loutbuf,a.totsamp,a.loutbuf,0,MAX_ORDER),_1.arraycopy(a.routbuf,a.totsamp,a.routbuf,0,MAX_ORDER),_1.arraycopy(a.lstepbuf,a.totsamp,a.lstepbuf,0,MAX_ORDER),_1.arraycopy(a.rstepbuf,a.totsamp,a.rstepbuf,0,MAX_ORDER),a.totsamp=0}if(a.totsamp>a.sampleWindow)return GAIN_ANALYSIS_ERROR}return st<MAX_ORDER?(_1.arraycopy(a.linprebuf,st,a.linprebuf,0,MAX_ORDER-st),_1.arraycopy(a.rinprebuf,st,a.rinprebuf,0,MAX_ORDER-st),_1.arraycopy(o,d,a.linprebuf,MAX_ORDER-st,st),_1.arraycopy(g,rt,a.rinprebuf,MAX_ORDER-st,st)):(_1.arraycopy(o,d+st-MAX_ORDER,a.linprebuf,0,MAX_ORDER),_1.arraycopy(g,rt+st-MAX_ORDER,a.rinprebuf,0,MAX_ORDER)),GAIN_ANALYSIS_OK};function b(a,o){var d,g=0;for(d=0;d<o;d++)g+=a[d];if(g==0)return GAIN_NOT_ENOUGH_SAMPLES;var rt=0|Math.ceil(g*(1-e));for(d=o;d-- >0&&!((rt-=a[d])<=0););return i-d/j0.STEPS_per_dB}this.GetTitleGain=function(a){for(var o=b(a.A,a.A.length),d=0;d<a.A.length;d++)a.B[d]+=a.A[d],a.A[d]=0;for(var d=0;d<MAX_ORDER;d++)a.linprebuf[d]=a.lstepbuf[d]=a.loutbuf[d]=a.rinprebuf[d]=a.rstepbuf[d]=a.routbuf[d]=0;return a.totsamp=0,a.lsum=a.rsum=0,o}}var Na=j0,pa=Q0,k1=pa.new_float,Je=pa.new_int,l1=Na;function M2(){this.linprebuf=k1(l1.MAX_ORDER*2),this.linpre=0,this.lstepbuf=k1(l1.MAX_SAMPLES_PER_WINDOW+l1.MAX_ORDER),this.lstep=0,this.loutbuf=k1(l1.MAX_SAMPLES_PER_WINDOW+l1.MAX_ORDER),this.lout=0,this.rinprebuf=k1(l1.MAX_ORDER*2),this.rinpre=0,this.rstepbuf=k1(l1.MAX_SAMPLES_PER_WINDOW+l1.MAX_ORDER),this.rstep=0,this.routbuf=k1(l1.MAX_SAMPLES_PER_WINDOW+l1.MAX_ORDER),this.rout=0,this.sampleWindow=0,this.totsamp=0,this.lsum=0,this.rsum=0,this.freqindex=0,this.first=0,this.A=Je(0|l1.STEPS_per_dB*l1.MAX_dB),this.B=Je(0|l1.STEPS_per_dB*l1.MAX_dB)}var E2=M2;function B2(i){this.bits=i}var Ha=B2,pe=Q0,ge=pe.new_float,T2=pe.new_int,ea=pe.assert,y2=Ha,aa=t1(),w2=ie,I2=ne;function L2(i){var e=i;this.quantize=e,this.iteration_loop=function(s,c,h,$){var _=s.internal_flags,j=ge(w2.SFBMAX),nt=ge(576),et=T2(2),b=0,a,o=_.l3_side,d=new y2(b);this.quantize.rv.ResvFrameBegin(s,d),b=d.bits;for(var g=0;g<_.mode_gr;g++){a=this.quantize.qupvt.on_pe(s,c,et,b,g,g),_.mode_ext==aa.MPG_MD_MS_LR&&(this.quantize.ms_convert(_.l3_side,g),this.quantize.qupvt.reduce_side(et,h[g],b,a));for(var rt=0;rt<_.channels_out;rt++){var st,tt,ot=o.tt[g][rt];ot.block_type!=aa.SHORT_TYPE?(st=0,tt=_.PSY.mask_adjust-st):(st=0,tt=_.PSY.mask_adjust_short-st),_.masking_lower=Math.pow(10,tt*.1),this.quantize.init_outer_loop(_,ot),this.quantize.init_xrpow(_,ot,nt)&&(this.quantize.qupvt.calc_xmin(s,$[g][rt],ot,j),this.quantize.outer_loop(s,ot,j,nt,rt,et[rt])),this.quantize.iteration_finish_one(_,g,rt),ea(ot.part2_3_length<=I2.MAX_BITS_PER_CHANNEL),ea(ot.part2_3_length<=et[rt])}}this.quantize.rv.ResvFrameEnd(_,b)}}var N2=L2;function q0(i,e,s,c){this.xlen=i,this.linmax=e,this.table=s,this.hlen=c}var o0={};o0.t1HB=[1,1,1,0],o0.t2HB=[1,2,1,3,1,1,3,2,0],o0.t3HB=[3,2,1,1,1,1,3,2,0],o0.t5HB=[1,2,6,5,3,1,4,4,7,5,7,1,6,1,1,0],o0.t6HB=[7,3,5,1,6,2,3,2,5,4,4,1,3,3,2,0],o0.t7HB=[1,2,10,19,16,10,3,3,7,10,5,3,11,4,13,17,8,4,12,11,18,15,11,2,7,6,9,14,3,1,6,4,5,3,2,0],o0.t8HB=[3,4,6,18,12,5,5,1,2,16,9,3,7,3,5,14,7,3,19,17,15,13,10,4,13,5,8,11,5,1,12,4,4,1,1,0],o0.t9HB=[7,5,9,14,15,7,6,4,5,5,6,7,7,6,8,8,8,5,15,6,9,10,5,1,11,7,9,6,4,1,14,4,6,2,6,0],o0.t10HB=[1,2,10,23,35,30,12,17,3,3,8,12,18,21,12,7,11,9,15,21,32,40,19,6,14,13,22,34,46,23,18,7,20,19,33,47,27,22,9,3,31,22,41,26,21,20,5,3,14,13,10,11,16,6,5,1,9,8,7,8,4,4,2,0],o0.t11HB=[3,4,10,24,34,33,21,15,5,3,4,10,32,17,11,10,11,7,13,18,30,31,20,5,25,11,19,59,27,18,12,5,35,33,31,58,30,16,7,5,28,26,32,19,17,15,8,14,14,12,9,13,14,9,4,1,11,4,6,6,6,3,2,0],o0.t12HB=[9,6,16,33,41,39,38,26,7,5,6,9,23,16,26,11,17,7,11,14,21,30,10,7,17,10,15,12,18,28,14,5,32,13,22,19,18,16,9,5,40,17,31,29,17,13,4,2,27,12,11,15,10,7,4,1,27,12,8,12,6,3,1,0],o0.t13HB=[1,5,14,21,34,51,46,71,42,52,68,52,67,44,43,19,3,4,12,19,31,26,44,33,31,24,32,24,31,35,22,14,15,13,23,36,59,49,77,65,29,40,30,40,27,33,42,16,22,20,37,61,56,79,73,64,43,76,56,37,26,31,25,14,35,16,60,57,97,75,114,91,54,73,55,41,48,53,23,24,58,27,50,96,76,70,93,84,77,58,79,29,74,49,41,17,47,45,78,74,115,94,90,79,69,83,71,50,59,38,36,15,72,34,56,95,92,85,91,90,86,73,77,65,51,44,43,42,43,20,30,44,55,78,72,87,78,61,46,54,37,30,20,16,53,25,41,37,44,59,54,81,66,76,57,54,37,18,39,11,35,33,31,57,42,82,72,80,47,58,55,21,22,26,38,22,53,25,23,38,70,60,51,36,55,26,34,23,27,14,9,7,34,32,28,39,49,75,30,52,48,40,52,28,18,17,9,5,45,21,34,64,56,50,49,45,31,19,12,15,10,7,6,3,48,23,20,39,36,35,53,21,16,23,13,10,6,1,4,2,16,15,17,27,25,20,29,11,17,12,16,8,1,1,0,1],o0.t15HB=[7,12,18,53,47,76,124,108,89,123,108,119,107,81,122,63,13,5,16,27,46,36,61,51,42,70,52,83,65,41,59,36,19,17,15,24,41,34,59,48,40,64,50,78,62,80,56,33,29,28,25,43,39,63,55,93,76,59,93,72,54,75,50,29,52,22,42,40,67,57,95,79,72,57,89,69,49,66,46,27,77,37,35,66,58,52,91,74,62,48,79,63,90,62,40,38,125,32,60,56,50,92,78,65,55,87,71,51,73,51,70,30,109,53,49,94,88,75,66,122,91,73,56,42,64,44,21,25,90,43,41,77,73,63,56,92,77,66,47,67,48,53,36,20,71,34,67,60,58,49,88,76,67,106,71,54,38,39,23,15,109,53,51,47,90,82,58,57,48,72,57,41,23,27,62,9,86,42,40,37,70,64,52,43,70,55,42,25,29,18,11,11,118,68,30,55,50,46,74,65,49,39,24,16,22,13,14,7,91,44,39,38,34,63,52,45,31,52,28,19,14,8,9,3,123,60,58,53,47,43,32,22,37,24,17,12,15,10,2,1,71,37,34,30,28,20,17,26,21,16,10,6,8,6,2,0],o0.t16HB=[1,5,14,44,74,63,110,93,172,149,138,242,225,195,376,17,3,4,12,20,35,62,53,47,83,75,68,119,201,107,207,9,15,13,23,38,67,58,103,90,161,72,127,117,110,209,206,16,45,21,39,69,64,114,99,87,158,140,252,212,199,387,365,26,75,36,68,65,115,101,179,164,155,264,246,226,395,382,362,9,66,30,59,56,102,185,173,265,142,253,232,400,388,378,445,16,111,54,52,100,184,178,160,133,257,244,228,217,385,366,715,10,98,48,91,88,165,157,148,261,248,407,397,372,380,889,884,8,85,84,81,159,156,143,260,249,427,401,392,383,727,713,708,7,154,76,73,141,131,256,245,426,406,394,384,735,359,710,352,11,139,129,67,125,247,233,229,219,393,743,737,720,885,882,439,4,243,120,118,115,227,223,396,746,742,736,721,712,706,223,436,6,202,224,222,218,216,389,386,381,364,888,443,707,440,437,1728,4,747,211,210,208,370,379,734,723,714,1735,883,877,876,3459,865,2,377,369,102,187,726,722,358,711,709,866,1734,871,3458,870,434,0,12,10,7,11,10,17,11,9,13,12,10,7,5,3,1,3],o0.t24HB=[15,13,46,80,146,262,248,434,426,669,653,649,621,517,1032,88,14,12,21,38,71,130,122,216,209,198,327,345,319,297,279,42,47,22,41,74,68,128,120,221,207,194,182,340,315,295,541,18,81,39,75,70,134,125,116,220,204,190,178,325,311,293,271,16,147,72,69,135,127,118,112,210,200,188,352,323,306,285,540,14,263,66,129,126,119,114,214,202,192,180,341,317,301,281,262,12,249,123,121,117,113,215,206,195,185,347,330,308,291,272,520,10,435,115,111,109,211,203,196,187,353,332,313,298,283,531,381,17,427,212,208,205,201,193,186,177,169,320,303,286,268,514,377,16,335,199,197,191,189,181,174,333,321,305,289,275,521,379,371,11,668,184,183,179,175,344,331,314,304,290,277,530,383,373,366,10,652,346,171,168,164,318,309,299,287,276,263,513,375,368,362,6,648,322,316,312,307,302,292,284,269,261,512,376,370,364,359,4,620,300,296,294,288,282,273,266,515,380,374,369,365,361,357,2,1033,280,278,274,267,264,259,382,378,372,367,363,360,358,356,0,43,20,19,17,15,13,11,9,7,6,4,7,5,3,1,3],o0.t32HB=[1,10,8,20,12,20,16,32,14,12,24,0,28,16,24,16],o0.t33HB=[15,28,26,48,22,40,36,64,14,24,20,32,12,16,8,0],o0.t1l=[1,4,3,5],o0.t2l=[1,4,7,4,5,7,6,7,8],o0.t3l=[2,3,7,4,4,7,6,7,8],o0.t5l=[1,4,7,8,4,5,8,9,7,8,9,10,8,8,9,10],o0.t6l=[3,4,6,8,4,4,6,7,5,6,7,8,7,7,8,9],o0.t7l=[1,4,7,9,9,10,4,6,8,9,9,10,7,7,9,10,10,11,8,9,10,11,11,11,8,9,10,11,11,12,9,10,11,12,12,12],o0.t8l=[2,4,7,9,9,10,4,4,6,10,10,10,7,6,8,10,10,11,9,10,10,11,11,12,9,9,10,11,12,12,10,10,11,11,13,13],o0.t9l=[3,4,6,7,9,10,4,5,6,7,8,10,5,6,7,8,9,10,7,7,8,9,9,10,8,8,9,9,10,11,9,9,10,10,11,11],o0.t10l=[1,4,7,9,10,10,10,11,4,6,8,9,10,11,10,10,7,8,9,10,11,12,11,11,8,9,10,11,12,12,11,12,9,10,11,12,12,12,12,12,10,11,12,12,13,13,12,13,9,10,11,12,12,12,13,13,10,10,11,12,12,13,13,13],o0.t11l=[2,4,6,8,9,10,9,10,4,5,6,8,10,10,9,10,6,7,8,9,10,11,10,10,8,8,9,11,10,12,10,11,9,10,10,11,11,12,11,12,9,10,11,12,12,13,12,13,9,9,9,10,11,12,12,12,9,9,10,11,12,12,12,12],o0.t12l=[4,4,6,8,9,10,10,10,4,5,6,7,9,9,10,10,6,6,7,8,9,10,9,10,7,7,8,8,9,10,10,10,8,8,9,9,10,10,10,11,9,9,10,10,10,11,10,11,9,9,9,10,10,11,11,12,10,10,10,11,11,11,11,12],o0.t13l=[1,5,7,8,9,10,10,11,10,11,12,12,13,13,14,14,4,6,8,9,10,10,11,11,11,11,12,12,13,14,14,14,7,8,9,10,11,11,12,12,11,12,12,13,13,14,15,15,8,9,10,11,11,12,12,12,12,13,13,13,13,14,15,15,9,9,11,11,12,12,13,13,12,13,13,14,14,15,15,16,10,10,11,12,12,12,13,13,13,13,14,13,15,15,16,16,10,11,12,12,13,13,13,13,13,14,14,14,15,15,16,16,11,11,12,13,13,13,14,14,14,14,15,15,15,16,18,18,10,10,11,12,12,13,13,14,14,14,14,15,15,16,17,17,11,11,12,12,13,13,13,15,14,15,15,16,16,16,18,17,11,12,12,13,13,14,14,15,14,15,16,15,16,17,18,19,12,12,12,13,14,14,14,14,15,15,15,16,17,17,17,18,12,13,13,14,14,15,14,15,16,16,17,17,17,18,18,18,13,13,14,15,15,15,16,16,16,16,16,17,18,17,18,18,14,14,14,15,15,15,17,16,16,19,17,17,17,19,18,18,13,14,15,16,16,16,17,16,17,17,18,18,21,20,21,18],o0.t15l=[3,5,6,8,8,9,10,10,10,11,11,12,12,12,13,14,5,5,7,8,9,9,10,10,10,11,11,12,12,12,13,13,6,7,7,8,9,9,10,10,10,11,11,12,12,13,13,13,7,8,8,9,9,10,10,11,11,11,12,12,12,13,13,13,8,8,9,9,10,10,11,11,11,11,12,12,12,13,13,13,9,9,9,10,10,10,11,11,11,11,12,12,13,13,13,14,10,9,10,10,10,11,11,11,11,12,12,12,13,13,14,14,10,10,10,11,11,11,11,12,12,12,12,12,13,13,13,14,10,10,10,11,11,11,11,12,12,12,12,13,13,14,14,14,10,10,11,11,11,11,12,12,12,13,13,13,13,14,14,14,11,11,11,11,12,12,12,12,12,13,13,13,13,14,15,14,11,11,11,11,12,12,12,12,13,13,13,13,14,14,14,15,12,12,11,12,12,12,13,13,13,13,13,13,14,14,15,15,12,12,12,12,12,13,13,13,13,14,14,14,14,14,15,15,13,13,13,13,13,13,13,13,14,14,14,14,15,15,14,15,13,13,13,13,13,13,13,14,14,14,14,14,15,15,15,15],o0.t16_5l=[1,5,7,9,10,10,11,11,12,12,12,13,13,13,14,11,4,6,8,9,10,11,11,11,12,12,12,13,14,13,14,11,7,8,9,10,11,11,12,12,13,12,13,13,13,14,14,12,9,9,10,11,11,12,12,12,13,13,14,14,14,15,15,13,10,10,11,11,12,12,13,13,13,14,14,14,15,15,15,12,10,10,11,11,12,13,13,14,13,14,14,15,15,15,16,13,11,11,11,12,13,13,13,13,14,14,14,14,15,15,16,13,11,11,12,12,13,13,13,14,14,15,15,15,15,17,17,13,11,12,12,13,13,13,14,14,15,15,15,15,16,16,16,13,12,12,12,13,13,14,14,15,15,15,15,16,15,16,15,14,12,13,12,13,14,14,14,14,15,16,16,16,17,17,16,13,13,13,13,13,14,14,15,16,16,16,16,16,16,15,16,14,13,14,14,14,14,15,15,15,15,17,16,16,16,16,18,14,15,14,14,14,15,15,16,16,16,18,17,17,17,19,17,14,14,15,13,14,16,16,15,16,16,17,18,17,19,17,16,14,11,11,11,12,12,13,13,13,14,14,14,14,14,14,14,12],o0.t16l=[1,5,7,9,10,10,11,11,12,12,12,13,13,13,14,10,4,6,8,9,10,11,11,11,12,12,12,13,14,13,14,10,7,8,9,10,11,11,12,12,13,12,13,13,13,14,14,11,9,9,10,11,11,12,12,12,13,13,14,14,14,15,15,12,10,10,11,11,12,12,13,13,13,14,14,14,15,15,15,11,10,10,11,11,12,13,13,14,13,14,14,15,15,15,16,12,11,11,11,12,13,13,13,13,14,14,14,14,15,15,16,12,11,11,12,12,13,13,13,14,14,15,15,15,15,17,17,12,11,12,12,13,13,13,14,14,15,15,15,15,16,16,16,12,12,12,12,13,13,14,14,15,15,15,15,16,15,16,15,13,12,13,12,13,14,14,14,14,15,16,16,16,17,17,16,12,13,13,13,13,14,14,15,16,16,16,16,16,16,15,16,13,13,14,14,14,14,15,15,15,15,17,16,16,16,16,18,13,15,14,14,14,15,15,16,16,16,18,17,17,17,19,17,13,14,15,13,14,16,16,15,16,16,17,18,17,19,17,16,13,10,10,10,11,11,12,12,12,13,13,13,13,13,13,13,10],o0.t24l=[4,5,7,8,9,10,10,11,11,12,12,12,12,12,13,10,5,6,7,8,9,10,10,11,11,11,12,12,12,12,12,10,7,7,8,9,9,10,10,11,11,11,11,12,12,12,13,9,8,8,9,9,10,10,10,11,11,11,11,12,12,12,12,9,9,9,9,10,10,10,10,11,11,11,12,12,12,12,13,9,10,9,10,10,10,10,11,11,11,11,12,12,12,12,12,9,10,10,10,10,10,11,11,11,11,12,12,12,12,12,13,9,11,10,10,10,11,11,11,11,12,12,12,12,12,13,13,10,11,11,11,11,11,11,11,11,11,12,12,12,12,13,13,10,11,11,11,11,11,11,11,12,12,12,12,12,13,13,13,10,12,11,11,11,11,12,12,12,12,12,12,13,13,13,13,10,12,12,11,11,11,12,12,12,12,12,12,13,13,13,13,10,12,12,12,12,12,12,12,12,12,12,13,13,13,13,13,10,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,10,13,12,12,12,12,12,12,13,13,13,13,13,13,13,13,10,9,9,9,9,9,9,9,9,9,9,9,10,10,10,10,6],o0.t32l=[1,5,5,7,5,8,7,9,5,7,7,9,7,9,9,10],o0.t33l=[4,5,5,6,5,6,6,7,5,6,6,7,6,7,7,8],o0.ht=[new q0(0,0,null,null),new q0(2,0,o0.t1HB,o0.t1l),new q0(3,0,o0.t2HB,o0.t2l),new q0(3,0,o0.t3HB,o0.t3l),new q0(0,0,null,null),new q0(4,0,o0.t5HB,o0.t5l),new q0(4,0,o0.t6HB,o0.t6l),new q0(6,0,o0.t7HB,o0.t7l),new q0(6,0,o0.t8HB,o0.t8l),new q0(6,0,o0.t9HB,o0.t9l),new q0(8,0,o0.t10HB,o0.t10l),new q0(8,0,o0.t11HB,o0.t11l),new q0(8,0,o0.t12HB,o0.t12l),new q0(16,0,o0.t13HB,o0.t13l),new q0(0,0,null,o0.t16_5l),new q0(16,0,o0.t15HB,o0.t15l),new q0(1,1,o0.t16HB,o0.t16l),new q0(2,3,o0.t16HB,o0.t16l),new q0(3,7,o0.t16HB,o0.t16l),new q0(4,15,o0.t16HB,o0.t16l),new q0(6,63,o0.t16HB,o0.t16l),new q0(8,255,o0.t16HB,o0.t16l),new q0(10,1023,o0.t16HB,o0.t16l),new q0(13,8191,o0.t16HB,o0.t16l),new q0(4,15,o0.t24HB,o0.t24l),new q0(5,31,o0.t24HB,o0.t24l),new q0(6,63,o0.t24HB,o0.t24l),new q0(7,127,o0.t24HB,o0.t24l),new q0(8,255,o0.t24HB,o0.t24l),new q0(9,511,o0.t24HB,o0.t24l),new q0(11,2047,o0.t24HB,o0.t24l),new q0(13,8191,o0.t24HB,o0.t24l),new q0(0,0,o0.t32HB,o0.t32l),new q0(0,0,o0.t33HB,o0.t33l)],o0.largetbl=[65540,327685,458759,589832,655369,655370,720906,720907,786443,786444,786444,851980,851980,851980,917517,655370,262149,393222,524295,589832,655369,720906,720906,720907,786443,786443,786444,851980,917516,851980,917516,655370,458759,524295,589832,655369,720905,720906,786442,786443,851979,786443,851979,851980,851980,917516,917517,720905,589832,589832,655369,720905,720906,786442,786442,786443,851979,851979,917515,917516,917516,983052,983052,786441,655369,655369,720905,720906,786442,786442,851978,851979,851979,917515,917516,917516,983052,983052,983053,720905,655370,655369,720906,720906,786442,851978,851979,917515,851979,917515,917516,983052,983052,983052,1048588,786441,720906,720906,720906,786442,851978,851979,851979,851979,917515,917516,917516,917516,983052,983052,1048589,786441,720907,720906,786442,786442,851979,851979,851979,917515,917516,983052,983052,983052,983052,1114125,1114125,786442,720907,786443,786443,851979,851979,851979,917515,917515,983051,983052,983052,983052,1048588,1048589,1048589,786442,786443,786443,786443,851979,851979,917515,917515,983052,983052,983052,983052,1048588,983053,1048589,983053,851978,786444,851979,786443,851979,917515,917516,917516,917516,983052,1048588,1048588,1048589,1114125,1114125,1048589,786442,851980,851980,851979,851979,917515,917516,983052,1048588,1048588,1048588,1048588,1048589,1048589,983053,1048589,851978,851980,917516,917516,917516,917516,983052,983052,983052,983052,1114124,1048589,1048589,1048589,1048589,1179661,851978,983052,917516,917516,917516,983052,983052,1048588,1048588,1048589,1179661,1114125,1114125,1114125,1245197,1114125,851978,917517,983052,851980,917516,1048588,1048588,983052,1048589,1048589,1114125,1179661,1114125,1245197,1114125,1048589,851978,655369,655369,655369,720905,720905,786441,786441,786441,851977,851977,851977,851978,851978,851978,851978,655366],o0.table23=[65538,262147,458759,262148,327684,458759,393222,458759,524296],o0.table56=[65539,262148,458758,524296,262148,327684,524294,589831,458757,524294,589831,655368,524295,524295,589832,655369],o0.bitrate_table=[[0,8,16,24,32,40,48,56,64,80,96,112,128,144,160,-1],[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,-1],[0,8,16,24,32,40,48,56,64,-1,-1,-1,-1,-1,-1,-1]],o0.samplerate_table=[[22050,24e3,16e3,-1],[44100,48e3,32e3,-1],[11025,12e3,8e3,-1]],o0.scfsi_band=[0,6,11,16,21];var He=o0,Me,ra;function Va(){if(ra)return Me;ra=1;var i=Ia,e=Q0,s=e.VbrMode,c=e.Float,h=e.Util,$=e.new_float,_=e.new_int,j=e.assert,nt=t1(),et=Ha,b=ne;a.Q_MAX=257,a.Q_MAX2=116,a.LARGE_BITS=1e5,a.IXMAX_VAL=8206;function a(){var o=Ve(),d=null,g=null,rt=null;this.setModules=function($t,At,Ot){d=$t,g=At,rt=Ot};function st($t){return j(0<=$t+a.Q_MAX2&&$t<a.Q_MAX),ft[$t+a.Q_MAX2]}this.IPOW20=function($t){return j(0<=$t&&$t<a.Q_MAX),dt[$t]};var tt=2220446049250313e-31,ot=a.IXMAX_VAL,it=ot+2,at=a.Q_MAX,ut=a.Q_MAX2;a.LARGE_BITS;var lt=100;this.nr_of_sfb_block=[[[6,5,5,5],[9,9,9,9],[6,9,9,9]],[[6,5,7,3],[9,9,12,6],[6,9,12,6]],[[11,10,0,0],[18,18,0,0],[15,18,0,0]],[[7,7,7,0],[12,12,12,0],[6,15,12,0]],[[6,6,6,3],[12,9,9,6],[6,12,9,6]],[[8,8,5,0],[15,12,9,0],[6,18,9,0]]];var ct=[0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,2,2,3,3,3,2,0];this.pretab=ct,this.sfBandIndex=[new i([0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576],[0,4,8,12,18,24,32,42,56,74,100,132,174,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new i([0,6,12,18,24,30,36,44,54,66,80,96,114,136,162,194,232,278,332,394,464,540,576],[0,4,8,12,18,26,36,48,62,80,104,136,180,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new i([0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576],[0,4,8,12,18,26,36,48,62,80,104,134,174,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new i([0,4,8,12,16,20,24,30,36,44,52,62,74,90,110,134,162,196,238,288,342,418,576],[0,4,8,12,16,22,30,40,52,66,84,106,136,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new i([0,4,8,12,16,20,24,30,36,42,50,60,72,88,106,128,156,190,230,276,330,384,576],[0,4,8,12,16,22,28,38,50,64,80,100,126,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new i([0,4,8,12,16,20,24,30,36,44,54,66,82,102,126,156,194,240,296,364,448,550,576],[0,4,8,12,16,22,30,42,58,78,104,138,180,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new i([0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576],[0/3,12/3,24/3,36/3,54/3,78/3,108/3,144/3,186/3,240/3,312/3,402/3,522/3,576/3],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new i([0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576],[0/3,12/3,24/3,36/3,54/3,78/3,108/3,144/3,186/3,240/3,312/3,402/3,522/3,576/3],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new i([0,12,24,36,48,60,72,88,108,132,160,192,232,280,336,400,476,566,568,570,572,574,576],[0/3,24/3,48/3,72/3,108/3,156/3,216/3,288/3,372/3,480/3,486/3,492/3,498/3,576/3],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0])];var ft=$(at+ut+1),dt=$(at),yt=$(it),St=$(it);this.adj43=St;function bt($t,At){var Ot=rt.ATHformula(At,$t);return Ot-=lt,Ot=Math.pow(10,Ot/10+$t.ATHlower),Ot}function Tt($t){for(var At=$t.internal_flags.ATH.l,Ot=$t.internal_flags.ATH.psfb21,It=$t.internal_flags.ATH.s,jt=$t.internal_flags.ATH.psfb12,Et=$t.internal_flags,mt=$t.out_samplerate,gt=0;gt<nt.SBMAX_l;gt++){var ht=Et.scalefac_band.l[gt],pt=Et.scalefac_band.l[gt+1];At[gt]=c.MAX_VALUE;for(var _t=ht;_t<pt;_t++){var Ct=_t*mt/1152,zt=bt($t,Ct);At[gt]=Math.min(At[gt],zt)}}for(var gt=0;gt<nt.PSFB21;gt++){var ht=Et.scalefac_band.psfb21[gt],pt=Et.scalefac_band.psfb21[gt+1];Ot[gt]=c.MAX_VALUE;for(var _t=ht;_t<pt;_t++){var Ct=_t*mt/1152,zt=bt($t,Ct);Ot[gt]=Math.min(Ot[gt],zt)}}for(var gt=0;gt<nt.SBMAX_s;gt++){var ht=Et.scalefac_band.s[gt],pt=Et.scalefac_band.s[gt+1];It[gt]=c.MAX_VALUE;for(var _t=ht;_t<pt;_t++){var Ct=_t*mt/384,zt=bt($t,Ct);It[gt]=Math.min(It[gt],zt)}It[gt]*=Et.scalefac_band.s[gt+1]-Et.scalefac_band.s[gt]}for(var gt=0;gt<nt.PSFB12;gt++){var ht=Et.scalefac_band.psfb12[gt],pt=Et.scalefac_band.psfb12[gt+1];jt[gt]=c.MAX_VALUE;for(var _t=ht;_t<pt;_t++){var Ct=_t*mt/384,zt=bt($t,Ct);jt[gt]=Math.min(jt[gt],zt)}jt[gt]*=Et.scalefac_band.s[13]-Et.scalefac_band.s[12]}if($t.noATH){for(var gt=0;gt<nt.SBMAX_l;gt++)At[gt]=1e-20;for(var gt=0;gt<nt.PSFB21;gt++)Ot[gt]=1e-20;for(var gt=0;gt<nt.SBMAX_s;gt++)It[gt]=1e-20;for(var gt=0;gt<nt.PSFB12;gt++)jt[gt]=1e-20}Et.ATH.floor=10*Math.log10(bt($t,-1))}this.iteration_init=function($t){var At=$t.internal_flags,Ot=At.l3_side,It;if(At.iteration_init_init==0){for(At.iteration_init_init=1,Ot.main_data_begin=0,Tt($t),yt[0]=0,It=1;It<it;It++)yt[It]=Math.pow(It,4/3);for(It=0;It<it-1;It++)St[It]=It+1-Math.pow(.5*(yt[It]+yt[It+1]),.75);for(St[It]=.5,It=0;It<at;It++)dt[It]=Math.pow(2,(It-210)*-.1875);for(It=0;It<=at+ut;It++)ft[It]=Math.pow(2,(It-210-ut)*.25);d.huffman_init(At);{var jt,Et,mt,gt;for(It=$t.exp_nspsytune>>2&63,It>=32&&(It-=64),jt=Math.pow(10,It/4/10),It=$t.exp_nspsytune>>8&63,It>=32&&(It-=64),Et=Math.pow(10,It/4/10),It=$t.exp_nspsytune>>14&63,It>=32&&(It-=64),mt=Math.pow(10,It/4/10),It=$t.exp_nspsytune>>20&63,It>=32&&(It-=64),gt=mt*Math.pow(10,It/4/10),It=0;It<nt.SBMAX_l;It++){var ht;It<=6?ht=jt:It<=13?ht=Et:It<=20?ht=mt:ht=gt,At.nsPsy.longfact[It]=ht}for(It=0;It<nt.SBMAX_s;It++){var ht;It<=5?ht=jt:It<=10?ht=Et:It<=11?ht=mt:ht=gt,At.nsPsy.shortfact[It]=ht}}}},this.on_pe=function($t,At,Ot,It,jt,Et){var mt=$t.internal_flags,gt=0,ht,pt=_(2),_t,Ct=new et(gt),zt=g.ResvMaxBits($t,It,Ct,Et);gt=Ct.bits;var Nt=gt+zt;for(Nt>b.MAX_BITS_PER_GRANULE&&(Nt=b.MAX_BITS_PER_GRANULE),ht=0,_t=0;_t<mt.channels_out;++_t)Ot[_t]=Math.min(b.MAX_BITS_PER_CHANNEL,gt/mt.channels_out),pt[_t]=0|Ot[_t]*At[jt][_t]/700-Ot[_t],pt[_t]>It*3/4&&(pt[_t]=It*3/4),pt[_t]<0&&(pt[_t]=0),pt[_t]+Ot[_t]>b.MAX_BITS_PER_CHANNEL&&(pt[_t]=Math.max(0,b.MAX_BITS_PER_CHANNEL-Ot[_t])),ht+=pt[_t];if(ht>zt)for(_t=0;_t<mt.channels_out;++_t)pt[_t]=zt*pt[_t]/ht;for(_t=0;_t<mt.channels_out;++_t)Ot[_t]+=pt[_t],zt-=pt[_t];for(ht=0,_t=0;_t<mt.channels_out;++_t)ht+=Ot[_t];if(ht>b.MAX_BITS_PER_GRANULE){var Ht=0;for(_t=0;_t<mt.channels_out;++_t)Ot[_t]*=b.MAX_BITS_PER_GRANULE,Ot[_t]/=ht,Ht+=Ot[_t]}return Nt},this.reduce_side=function($t,At,Ot,It){j($t[0]+$t[1]<=b.MAX_BITS_PER_GRANULE);var jt=.33*(.5-At)/.5;jt<0&&(jt=0),jt>.5&&(jt=.5);var Et=0|jt*.5*($t[0]+$t[1]);Et>b.MAX_BITS_PER_CHANNEL-$t[0]&&(Et=b.MAX_BITS_PER_CHANNEL-$t[0]),Et<0&&(Et=0),$t[1]>=125&&($t[1]-Et>125?($t[0]<Ot&&($t[0]+=Et),$t[1]-=Et):($t[0]+=$t[1]-125,$t[1]=125)),Et=$t[0]+$t[1],Et>It&&($t[0]=It*$t[0]/Et,$t[1]=It*$t[1]/Et),j($t[0]<=b.MAX_BITS_PER_CHANNEL),j($t[1]<=b.MAX_BITS_PER_CHANNEL),j($t[0]+$t[1]<=b.MAX_BITS_PER_GRANULE)},this.athAdjust=function($t,At,Ot){var It=90.30873362,jt=94.82444863,Et=h.FAST_LOG10_X(At,10),mt=$t*$t,gt=0;return Et-=Ot,mt>1e-20&&(gt=1+h.FAST_LOG10_X(mt,10/It)),gt<0&&(gt=0),Et*=gt,Et+=Ot+It-jt,Math.pow(10,.1*Et)},this.calc_xmin=function($t,At,Ot,It){var jt=0,Et=$t.internal_flags,mt,gt=0,ht=0,pt=Et.ATH,_t=Ot.xr,Ct=$t.VBR==s.vbr_mtrh?1:0,zt=Et.masking_lower;for(($t.VBR==s.vbr_mtrh||$t.VBR==s.vbr_mt)&&(zt=1),mt=0;mt<Ot.psy_lmax;mt++){var Nt,Ht,Jt,un,yn,vn;$t.VBR==s.vbr_rh||$t.VBR==s.vbr_mtrh?Ht=athAdjust(pt.adjust,pt.l[mt],pt.floor):Ht=pt.adjust*pt.l[mt],yn=Ot.width[mt],Jt=Ht/yn,un=tt,vn=yn>>1,Nt=0;do{var mn,Tn;mn=_t[gt]*_t[gt],Nt+=mn,un+=mn<Jt?mn:Jt,gt++,Tn=_t[gt]*_t[gt],Nt+=Tn,un+=Tn<Jt?Tn:Jt,gt++}while(--vn>0);if(Nt>Ht&&ht++,mt==nt.SBPSY_l){var Pn=Ht*Et.nsPsy.longfact[mt];un<Pn&&(un=Pn)}if(Ct!=0&&(Ht=un),!$t.ATHonly){var Gn=At.en.l[mt];if(Gn>0){var Pn;Pn=Nt*At.thm.l[mt]*zt/Gn,Ct!=0&&(Pn*=Et.nsPsy.longfact[mt]),Ht<Pn&&(Ht=Pn)}}Ct!=0?It[jt++]=Ht:It[jt++]=Ht*Et.nsPsy.longfact[mt]}var wr=575;if(Ot.block_type!=nt.SHORT_TYPE)for(var xt=576;xt--!=0&&o.EQ(_t[xt],0);)wr=xt;Ot.max_nonzero_coeff=wr;for(var Pt=Ot.sfb_smin;mt<Ot.psymax;Pt++,mt+=3){var yn,wn,bn;for($t.VBR==s.vbr_rh||$t.VBR==s.vbr_mtrh?bn=athAdjust(pt.adjust,pt.s[Pt],pt.floor):bn=pt.adjust*pt.s[Pt],yn=Ot.width[mt],wn=0;wn<3;wn++){var Nt=0,Ht,Jt,un,vn=yn>>1;Jt=bn/yn,un=tt;do{var mn,Tn;mn=_t[gt]*_t[gt],Nt+=mn,un+=mn<Jt?mn:Jt,gt++,Tn=_t[gt]*_t[gt],Nt+=Tn,un+=Tn<Jt?Tn:Jt,gt++}while(--vn>0);if(Nt>bn&&ht++,Pt==nt.SBPSY_s){var Pn=bn*Et.nsPsy.shortfact[Pt];un<Pn&&(un=Pn)}if(Ct!=0?Ht=un:Ht=bn,!$t.ATHonly&&!$t.ATHshort){var Gn=At.en.s[Pt][wn];if(Gn>0){var Pn;Pn=Nt*At.thm.s[Pt][wn]*zt/Gn,Ct!=0&&(Pn*=Et.nsPsy.shortfact[Pt]),Ht<Pn&&(Ht=Pn)}}Ct!=0?It[jt++]=Ht:It[jt++]=Ht*Et.nsPsy.shortfact[Pt]}$t.useTemporal&&(It[jt-3]>It[jt-3+1]&&(It[jt-3+1]+=(It[jt-3]-It[jt-3+1])*Et.decay),It[jt-3+1]>It[jt-3+2]&&(It[jt-3+2]+=(It[jt-3+1]-It[jt-3+2])*Et.decay))}return ht};function vt($t){this.s=$t}this.calc_noise_core=function($t,At,Ot,It){var jt=0,Et=At.s,mt=$t.l3_enc;if(Et>$t.count1)for(;Ot--!=0;){var gt;gt=$t.xr[Et],Et++,jt+=gt*gt,gt=$t.xr[Et],Et++,jt+=gt*gt}else if(Et>$t.big_values){var ht=$(2);for(ht[0]=0,ht[1]=It;Ot--!=0;){var gt;gt=Math.abs($t.xr[Et])-ht[mt[Et]],Et++,jt+=gt*gt,gt=Math.abs($t.xr[Et])-ht[mt[Et]],Et++,jt+=gt*gt}}else for(;Ot--!=0;){var gt;gt=Math.abs($t.xr[Et])-yt[mt[Et]]*It,Et++,jt+=gt*gt,gt=Math.abs($t.xr[Et])-yt[mt[Et]]*It,Et++,jt+=gt*gt}return At.s=Et,jt},this.calc_noise=function($t,At,Ot,It,jt){var Et=0,mt=0,gt,ht,pt=0,_t=0,Ct=0,zt=-20,Nt=0,Ht=$t.scalefac,Jt=0;for(It.over_SSD=0,gt=0;gt<$t.psymax;gt++){var un=$t.global_gain-(Ht[Jt++]+($t.preflag!=0?ct[gt]:0)<<$t.scalefac_scale+1)-$t.subblock_gain[$t.window[gt]]*8,yn=0;if(jt!=null&&jt.step[gt]==un)yn=jt.noise[gt],Nt+=$t.width[gt],Ot[Et++]=yn/At[mt++],yn=jt.noise_log[gt];else{var vn=st(un);if(ht=$t.width[gt]>>1,Nt+$t.width[gt]>$t.max_nonzero_coeff){var mn;mn=$t.max_nonzero_coeff-Nt+1,mn>0?ht=mn>>1:ht=0}var Tn=new vt(Nt);yn=this.calc_noise_core($t,Tn,ht,vn),Nt=Tn.s,jt!=null&&(jt.step[gt]=un,jt.noise[gt]=yn),yn=Ot[Et++]=yn/At[mt++],yn=h.FAST_LOG10(Math.max(yn,1e-20)),jt!=null&&(jt.noise_log[gt]=yn)}if(jt!=null&&(jt.global_gain=$t.global_gain),Ct+=yn,yn>0){var Pn;Pn=Math.max(0|yn*10+.5,1),It.over_SSD+=Pn*Pn,pt++,_t+=yn}zt=Math.max(zt,yn)}return It.over_count=pt,It.tot_noise=Ct,It.over_noise=_t,It.max_noise=zt,pt},this.set_pinfo=function($t,At,Ot,It,jt){var Et=$t.internal_flags,mt,gt,ht,pt,_t,Ct=At.scalefac_scale==0?.5:1,zt=At.scalefac,Nt=$(L3Side.SFBMAX),Ht=$(L3Side.SFBMAX),Jt=new CalcNoiseResult;calc_xmin($t,Ot,At,Nt),calc_noise(At,Nt,Ht,Jt,null);var un=0;for(gt=At.sfb_lmax,At.block_type!=nt.SHORT_TYPE&&At.mixed_block_flag==0&&(gt=22),mt=0;mt<gt;mt++){var yn=Et.scalefac_band.l[mt],vn=Et.scalefac_band.l[mt+1],mn=vn-yn;for(pt=0;un<vn;un++)pt+=At.xr[un]*At.xr[un];pt/=mn,_t=1e15,Et.pinfo.en[It][jt][mt]=_t*pt,Et.pinfo.xfsf[It][jt][mt]=_t*Nt[mt]*Ht[mt]/mn,Ot.en.l[mt]>0&&!$t.ATHonly?pt=pt/Ot.en.l[mt]:pt=0,Et.pinfo.thr[It][jt][mt]=_t*Math.max(pt*Ot.thm.l[mt],Et.ATH.l[mt]),Et.pinfo.LAMEsfb[It][jt][mt]=0,At.preflag!=0&&mt>=11&&(Et.pinfo.LAMEsfb[It][jt][mt]=-Ct*ct[mt]),mt<nt.SBPSY_l&&(j(zt[mt]>=0),Et.pinfo.LAMEsfb[It][jt][mt]-=Ct*zt[mt])}if(At.block_type==nt.SHORT_TYPE)for(gt=mt,mt=At.sfb_smin;mt<nt.SBMAX_s;mt++)for(var yn=Et.scalefac_band.s[mt],vn=Et.scalefac_band.s[mt+1],mn=vn-yn,Tn=0;Tn<3;Tn++){for(pt=0,ht=yn;ht<vn;ht++)pt+=At.xr[un]*At.xr[un],un++;pt=Math.max(pt/mn,1e-20),_t=1e15,Et.pinfo.en_s[It][jt][3*mt+Tn]=_t*pt,Et.pinfo.xfsf_s[It][jt][3*mt+Tn]=_t*Nt[gt]*Ht[gt]/mn,Ot.en.s[mt][Tn]>0?pt=pt/Ot.en.s[mt][Tn]:pt=0,($t.ATHonly||$t.ATHshort)&&(pt=0),Et.pinfo.thr_s[It][jt][3*mt+Tn]=_t*Math.max(pt*Ot.thm.s[mt][Tn],Et.ATH.s[mt]),Et.pinfo.LAMEsfb_s[It][jt][3*mt+Tn]=-2*At.subblock_gain[Tn],mt<nt.SBPSY_s&&(Et.pinfo.LAMEsfb_s[It][jt][3*mt+Tn]-=Ct*zt[gt]),gt++}Et.pinfo.LAMEqss[It][jt]=At.global_gain,Et.pinfo.LAMEmainbits[It][jt]=At.part2_3_length+At.part2_length,Et.pinfo.LAMEsfbits[It][jt]=At.part2_length,Et.pinfo.over[It][jt]=Jt.over_count,Et.pinfo.max_noise[It][jt]=Jt.max_noise*10,Et.pinfo.over_noise[It][jt]=Jt.over_noise*10,Et.pinfo.tot_noise[It][jt]=Jt.tot_noise*10,Et.pinfo.over_SSD[It][jt]=Jt.over_SSD}}return Me=a,Me}var Ee,ta;function Oa(){if(ta)return Ee;ta=1;var i=Q0,e=i.System,s=i.Arrays,c=i.new_int,h=i.assert,$=t1(),_=He,j=Le,nt=Va();function et(){var b=null;this.qupvt=null,this.setModules=function(Et){this.qupvt=Et,b=Et};function a(Et){this.bits=0|Et}var o=[[0,0],[0,0],[0,0],[0,0],[0,0],[0,1],[1,1],[1,1],[1,2],[2,2],[2,3],[2,3],[3,4],[3,4],[3,4],[4,5],[4,5],[4,6],[5,6],[5,6],[5,7],[6,7],[6,7]];function d(Et,mt,gt,ht,pt,_t){var Ct=.5946/mt;for(Et=Et>>1;Et--!=0;)pt[_t++]=Ct>gt[ht++]?0:1,pt[_t++]=Ct>gt[ht++]?0:1}function g(Et,mt,gt,ht,pt,_t){Et=Et>>1;var Ct=Et%2;for(Et=Et>>1;Et--!=0;){var zt,Nt,Ht,Jt,un,yn,vn,mn;zt=gt[ht++]*mt,Nt=gt[ht++]*mt,un=0|zt,Ht=gt[ht++]*mt,yn=0|Nt,Jt=gt[ht++]*mt,vn=0|Ht,zt+=b.adj43[un],mn=0|Jt,Nt+=b.adj43[yn],pt[_t++]=0|zt,Ht+=b.adj43[vn],pt[_t++]=0|Nt,Jt+=b.adj43[mn],pt[_t++]=0|Ht,pt[_t++]=0|Jt}if(Ct!=0){var zt,Nt,un,yn;zt=gt[ht++]*mt,Nt=gt[ht++]*mt,un=0|zt,yn=0|Nt,zt+=b.adj43[un],Nt+=b.adj43[yn],pt[_t++]=0|zt,pt[_t++]=0|Nt}}function rt(Et,mt,gt,ht,pt){var _t,Ct,zt=0,Nt,Ht=0,Jt=0,un=0,yn=mt,vn=0,mn=yn,Tn=0,Pn=Et,Gn=0;for(Nt=pt!=null&&ht.global_gain==pt.global_gain,ht.block_type==$.SHORT_TYPE?Ct=38:Ct=21,_t=0;_t<=Ct;_t++){var wr=-1;if((Nt||ht.block_type==$.NORM_TYPE)&&(wr=ht.global_gain-(ht.scalefac[_t]+(ht.preflag!=0?b.pretab[_t]:0)<<ht.scalefac_scale+1)-ht.subblock_gain[ht.window[_t]]*8),h(ht.width[_t]>=0),Nt&&pt.step[_t]==wr)Ht!=0&&(g(Ht,gt,Pn,Gn,mn,Tn),Ht=0),Jt!=0&&(d(Jt,gt,Pn,Gn,mn,Tn),Jt=0);else{var xt=ht.width[_t];if(zt+ht.width[_t]>ht.max_nonzero_coeff){var Pt;Pt=ht.max_nonzero_coeff-zt+1,s.fill(mt,ht.max_nonzero_coeff,576,0),xt=Pt,xt<0&&(xt=0),_t=Ct+1}if(Ht==0&&Jt==0&&(mn=yn,Tn=vn,Pn=Et,Gn=un),pt!=null&&pt.sfb_count1>0&&_t>=pt.sfb_count1&&pt.step[_t]>0&&wr>=pt.step[_t]?(Ht!=0&&(g(Ht,gt,Pn,Gn,mn,Tn),Ht=0,mn=yn,Tn=vn,Pn=Et,Gn=un),Jt+=xt):(Jt!=0&&(d(Jt,gt,Pn,Gn,mn,Tn),Jt=0,mn=yn,Tn=vn,Pn=Et,Gn=un),Ht+=xt),xt<=0){Jt!=0&&(d(Jt,gt,Pn,Gn,mn,Tn),Jt=0),Ht!=0&&(g(Ht,gt,Pn,Gn,mn,Tn),Ht=0);break}}_t<=Ct&&(vn+=ht.width[_t],un+=ht.width[_t],zt+=ht.width[_t])}Ht!=0&&(g(Ht,gt,Pn,Gn,mn,Tn),Ht=0),Jt!=0&&(d(Jt,gt,Pn,Gn,mn,Tn),Jt=0)}function st(Et,mt,gt){var ht=0,pt=0;do{var _t=Et[mt++],Ct=Et[mt++];ht<_t&&(ht=_t),pt<Ct&&(pt=Ct)}while(mt<gt);return ht<pt&&(ht=pt),ht}function tt(Et,mt,gt,ht,pt,_t){var Ct=_.ht[ht].xlen*65536+_.ht[pt].xlen,zt=0,Nt;do{var Ht=Et[mt++],Jt=Et[mt++];Ht!=0&&(Ht>14&&(Ht=15,zt+=Ct),Ht*=16),Jt!=0&&(Jt>14&&(Jt=15,zt+=Ct),Ht+=Jt),zt+=_.largetbl[Ht]}while(mt<gt);return Nt=zt&65535,zt>>=16,zt>Nt&&(zt=Nt,ht=pt),_t.bits+=zt,ht}function ot(Et,mt,gt,ht){var pt=0,_t=_.ht[1].hlen;do{var Ct=Et[mt+0]*2+Et[mt+1];mt+=2,pt+=_t[Ct]}while(mt<gt);return ht.bits+=pt,1}function it(Et,mt,gt,ht,pt){var _t=0,Ct,zt=_.ht[ht].xlen,Nt;ht==2?Nt=_.table23:Nt=_.table56;do{var Ht=Et[mt+0]*zt+Et[mt+1];mt+=2,_t+=Nt[Ht]}while(mt<gt);return Ct=_t&65535,_t>>=16,_t>Ct&&(_t=Ct,ht++),pt.bits+=_t,ht}function at(Et,mt,gt,ht,pt){var _t=0,Ct=0,zt=0,Nt=_.ht[ht].xlen,Ht=_.ht[ht].hlen,Jt=_.ht[ht+1].hlen,un=_.ht[ht+2].hlen;do{var yn=Et[mt+0]*Nt+Et[mt+1];mt+=2,_t+=Ht[yn],Ct+=Jt[yn],zt+=un[yn]}while(mt<gt);var vn=ht;return _t>Ct&&(_t=Ct,vn++),_t>zt&&(_t=zt,vn=ht+2),pt.bits+=_t,vn}var ut=[1,2,5,7,7,10,10,13,13,13,13,13,13,13,13];function lt(Et,mt,gt,ht){var pt=st(Et,mt,gt);switch(pt){case 0:return pt;case 1:return ot(Et,mt,gt,ht);case 2:case 3:return it(Et,mt,gt,ut[pt-1],ht);case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:return at(Et,mt,gt,ut[pt-1],ht);default:if(pt>nt.IXMAX_VAL)return ht.bits=nt.LARGE_BITS,-1;pt-=15;var _t;for(_t=24;_t<32&&!(_.ht[_t].linmax>=pt);_t++);var Ct;for(Ct=_t-8;Ct<24&&!(_.ht[Ct].linmax>=pt);Ct++);return tt(Et,mt,gt,Ct,_t,ht)}}this.noquant_count_bits=function(Et,mt,gt){var ht=mt.l3_enc,pt=Math.min(576,mt.max_nonzero_coeff+2>>1<<1);for(gt!=null&&(gt.sfb_count1=0);pt>1&&!(ht[pt-1]|ht[pt-2]);pt-=2);mt.count1=pt;for(var _t=0,Ct=0;pt>3;pt-=4){var zt;if(((ht[pt-1]|ht[pt-2]|ht[pt-3]|ht[pt-4])&2147483647)>1)break;zt=((ht[pt-4]*2+ht[pt-3])*2+ht[pt-2])*2+ht[pt-1],_t+=_.t32l[zt],Ct+=_.t33l[zt]}var Nt=_t;if(mt.count1table_select=0,_t>Ct&&(Nt=Ct,mt.count1table_select=1),mt.count1bits=Nt,mt.big_values=pt,pt==0)return Nt;if(mt.block_type==$.SHORT_TYPE)_t=3*Et.scalefac_band.s[3],_t>mt.big_values&&(_t=mt.big_values),Ct=mt.big_values;else if(mt.block_type==$.NORM_TYPE){if(_t=mt.region0_count=Et.bv_scf[pt-2],Ct=mt.region1_count=Et.bv_scf[pt-1],h(_t+Ct+2<$.SBPSY_l),Ct=Et.scalefac_band.l[_t+Ct+2],_t=Et.scalefac_band.l[_t+1],Ct<pt){var Ht=new a(Nt);mt.table_select[2]=lt(ht,Ct,pt,Ht),Nt=Ht.bits}}else mt.region0_count=7,mt.region1_count=$.SBMAX_l-1-7-1,_t=Et.scalefac_band.l[8],Ct=pt,_t>Ct&&(_t=Ct);if(_t=Math.min(_t,pt),Ct=Math.min(Ct,pt),0<_t){var Ht=new a(Nt);mt.table_select[0]=lt(ht,0,_t,Ht),Nt=Ht.bits}if(_t<Ct){var Ht=new a(Nt);mt.table_select[1]=lt(ht,_t,Ct,Ht),Nt=Ht.bits}if(Et.use_best_huffman==2&&(mt.part2_3_length=Nt,best_huffman_divide(Et,mt),Nt=mt.part2_3_length),gt!=null&&mt.block_type==$.NORM_TYPE){for(var Jt=0;Et.scalefac_band.l[Jt]<mt.big_values;)Jt++;gt.sfb_count1=Jt}return Nt},this.count_bits=function(Et,mt,gt,ht){var pt=gt.l3_enc,_t=nt.IXMAX_VAL/b.IPOW20(gt.global_gain);if(gt.xrpow_max>_t)return nt.LARGE_BITS;if(rt(mt,pt,b.IPOW20(gt.global_gain),gt,ht),Et.substep_shaping&2)for(var Ct=0,zt=gt.global_gain+gt.scalefac_scale,Nt=.634521682242439/b.IPOW20(zt),Ht=0;Ht<gt.sfbmax;Ht++){var Jt=gt.width[Ht];if(Et.pseudohalf[Ht]==0)Ct+=Jt;else{var un;for(un=Ct,Ct+=Jt;un<Ct;++un)pt[un]=mt[un]>=Nt?pt[un]:0}}return this.noquant_count_bits(Et,gt,ht)};function ct(Et,mt,gt,ht,pt,_t,Ct){for(var zt=mt.big_values,Nt=0;Nt<=22;Nt++)ht[Nt]=nt.LARGE_BITS;for(var Nt=0;Nt<16;Nt++){var Ht=Et.scalefac_band.l[Nt+1];if(Ht>=zt)break;var Jt=0,un=new a(Jt),yn=lt(gt,0,Ht,un);Jt=un.bits;for(var vn=0;vn<8;vn++){var mn=Et.scalefac_band.l[Nt+vn+2];if(mn>=zt)break;var Tn=Jt;un=new a(Tn);var Pn=lt(gt,Ht,mn,un);Tn=un.bits,ht[Nt+vn]>Tn&&(ht[Nt+vn]=Tn,pt[Nt+vn]=Nt,_t[Nt+vn]=yn,Ct[Nt+vn]=Pn)}}}function ft(Et,mt,gt,ht,pt,_t,Ct,zt){for(var Nt=mt.big_values,Ht=2;Ht<$.SBMAX_l+1;Ht++){var Jt=Et.scalefac_band.l[Ht];if(Jt>=Nt)break;var un=pt[Ht-2]+mt.count1bits;if(gt.part2_3_length<=un)break;var yn=new a(un),vn=lt(ht,Jt,Nt,yn);un=yn.bits,!(gt.part2_3_length<=un)&&(gt.assign(mt),gt.part2_3_length=un,gt.region0_count=_t[Ht-2],gt.region1_count=Ht-2-_t[Ht-2],gt.table_select[0]=Ct[Ht-2],gt.table_select[1]=zt[Ht-2],gt.table_select[2]=vn)}}this.best_huffman_divide=function(Et,mt){var gt=new j,ht=mt.l3_enc,pt=c(23),_t=c(23),Ct=c(23),zt=c(23);if(!(mt.block_type==$.SHORT_TYPE&&Et.mode_gr==1)){gt.assign(mt),mt.block_type==$.NORM_TYPE&&(ct(Et,mt,ht,pt,_t,Ct,zt),ft(Et,gt,mt,ht,pt,_t,Ct,zt));var Nt=gt.big_values;if(!(Nt==0||(ht[Nt-2]|ht[Nt-1])>1)&&(Nt=mt.count1+2,!(Nt>576))){gt.assign(mt),gt.count1=Nt;for(var Ht=0,Jt=0;Nt>gt.big_values;Nt-=4){var un=((ht[Nt-4]*2+ht[Nt-3])*2+ht[Nt-2])*2+ht[Nt-1];Ht+=_.t32l[un],Jt+=_.t33l[un]}if(gt.big_values=Nt,gt.count1table_select=0,Ht>Jt&&(Ht=Jt,gt.count1table_select=1),gt.count1bits=Ht,gt.block_type==$.NORM_TYPE)ft(Et,gt,mt,ht,pt,_t,Ct,zt);else{if(gt.part2_3_length=Ht,Ht=Et.scalefac_band.l[8],Ht>Nt&&(Ht=Nt),Ht>0){var yn=new a(gt.part2_3_length);gt.table_select[0]=lt(ht,0,Ht,yn),gt.part2_3_length=yn.bits}if(Nt>Ht){var yn=new a(gt.part2_3_length);gt.table_select[1]=lt(ht,Ht,Nt,yn),gt.part2_3_length=yn.bits}mt.part2_3_length>gt.part2_3_length&&mt.assign(gt)}}}};var dt=[1,1,1,1,8,2,2,2,4,4,4,8,8,8,16,16],yt=[1,2,4,8,1,2,4,8,2,4,8,2,4,8,4,8],St=[0,0,0,0,3,1,1,1,2,2,2,3,3,3,4,4],bt=[0,1,2,3,0,1,2,3,1,2,3,1,2,3,2,3];et.slen1_tab=St,et.slen2_tab=bt;function Tt(Et,mt){for(var gt,ht=mt.tt[1][Et],pt=mt.tt[0][Et],_t=0;_t<_.scfsi_band.length-1;_t++){for(gt=_.scfsi_band[_t];gt<_.scfsi_band[_t+1]&&!(pt.scalefac[gt]!=ht.scalefac[gt]&&ht.scalefac[gt]>=0);gt++);if(gt==_.scfsi_band[_t+1]){for(gt=_.scfsi_band[_t];gt<_.scfsi_band[_t+1];gt++)ht.scalefac[gt]=-1;mt.scfsi[Et][_t]=1}}var Ct=0,zt=0;for(gt=0;gt<11;gt++)ht.scalefac[gt]!=-1&&(zt++,Ct<ht.scalefac[gt]&&(Ct=ht.scalefac[gt]));for(var Nt=0,Ht=0;gt<$.SBPSY_l;gt++)ht.scalefac[gt]!=-1&&(Ht++,Nt<ht.scalefac[gt]&&(Nt=ht.scalefac[gt]));for(var _t=0;_t<16;_t++)if(Ct<dt[_t]&&Nt<yt[_t]){var Jt=St[_t]*zt+bt[_t]*Ht;ht.part2_length>Jt&&(ht.part2_length=Jt,ht.scalefac_compress=_t)}}this.best_scalefac_store=function(Et,mt,gt,ht){var pt=ht.tt[mt][gt],_t,Ct,zt,Nt,Ht=0;for(zt=0,_t=0;_t<pt.sfbmax;_t++){var Jt=pt.width[_t];for(zt+=Jt,Nt=-Jt;Nt<0&&pt.l3_enc[Nt+zt]==0;Nt++);Nt==0&&(pt.scalefac[_t]=Ht=-2)}if(pt.scalefac_scale==0&&pt.preflag==0){var un=0;for(_t=0;_t<pt.sfbmax;_t++)pt.scalefac[_t]>0&&(un|=pt.scalefac[_t]);if(!(un&1)&&un!=0){for(_t=0;_t<pt.sfbmax;_t++)pt.scalefac[_t]>0&&(pt.scalefac[_t]>>=1);pt.scalefac_scale=Ht=1}}if(pt.preflag==0&&pt.block_type!=$.SHORT_TYPE&&Et.mode_gr==2){for(_t=11;_t<$.SBPSY_l&&!(pt.scalefac[_t]<b.pretab[_t]&&pt.scalefac[_t]!=-2);_t++);if(_t==$.SBPSY_l){for(_t=11;_t<$.SBPSY_l;_t++)pt.scalefac[_t]>0&&(pt.scalefac[_t]-=b.pretab[_t]);pt.preflag=Ht=1}}for(Ct=0;Ct<4;Ct++)ht.scfsi[gt][Ct]=0;for(Et.mode_gr==2&&mt==1&&ht.tt[0][gt].block_type!=$.SHORT_TYPE&&ht.tt[1][gt].block_type!=$.SHORT_TYPE&&(Tt(gt,ht),Ht=0),_t=0;_t<pt.sfbmax;_t++)pt.scalefac[_t]==-2&&(pt.scalefac[_t]=0);Ht!=0&&(Et.mode_gr==2?this.scale_bitcount(pt):this.scale_bitcount_lsf(Et,pt))};function vt(Et,mt){for(var gt=0;gt<mt;++gt)if(Et[gt]<0)return!1;return!0}var $t=[0,18,36,54,54,36,54,72,54,72,90,72,90,108,108,126],At=[0,18,36,54,51,35,53,71,52,70,88,69,87,105,104,122],Ot=[0,10,20,30,33,21,31,41,32,42,52,43,53,63,64,74];this.scale_bitcount=function(Et){var mt,gt,ht=0,pt=0,_t,Ct=Et.scalefac;if(h(vt(Ct,Et.sfbmax)),Et.block_type==$.SHORT_TYPE)_t=$t,Et.mixed_block_flag!=0&&(_t=At);else if(_t=Ot,Et.preflag==0){for(gt=11;gt<$.SBPSY_l&&!(Ct[gt]<b.pretab[gt]);gt++);if(gt==$.SBPSY_l)for(Et.preflag=1,gt=11;gt<$.SBPSY_l;gt++)Ct[gt]-=b.pretab[gt]}for(gt=0;gt<Et.sfbdivide;gt++)ht<Ct[gt]&&(ht=Ct[gt]);for(;gt<Et.sfbmax;gt++)pt<Ct[gt]&&(pt=Ct[gt]);for(Et.part2_length=nt.LARGE_BITS,mt=0;mt<16;mt++)ht<dt[mt]&&pt<yt[mt]&&Et.part2_length>_t[mt]&&(Et.part2_length=_t[mt],Et.scalefac_compress=mt);return Et.part2_length==nt.LARGE_BITS};var It=[[15,15,7,7],[15,15,7,0],[7,3,0,0],[15,31,31,0],[7,7,7,0],[3,3,0,0]];this.scale_bitcount_lsf=function(Et,mt){var gt,ht,pt,_t,Ct,zt,Nt,Ht,Jt=c(4),un=mt.scalefac;for(mt.preflag!=0?gt=2:gt=0,Nt=0;Nt<4;Nt++)Jt[Nt]=0;if(mt.block_type==$.SHORT_TYPE){ht=1;var yn=b.nr_of_sfb_block[gt][ht];for(Ht=0,pt=0;pt<4;pt++)for(_t=yn[pt]/3,Nt=0;Nt<_t;Nt++,Ht++)for(Ct=0;Ct<3;Ct++)un[Ht*3+Ct]>Jt[pt]&&(Jt[pt]=un[Ht*3+Ct])}else{ht=0;var yn=b.nr_of_sfb_block[gt][ht];for(Ht=0,pt=0;pt<4;pt++)for(_t=yn[pt],Nt=0;Nt<_t;Nt++,Ht++)un[Ht]>Jt[pt]&&(Jt[pt]=un[Ht])}for(zt=!1,pt=0;pt<4;pt++)Jt[pt]>It[gt][pt]&&(zt=!0);if(!zt){var vn,mn,Tn,Pn;for(mt.sfb_partition_table=b.nr_of_sfb_block[gt][ht],pt=0;pt<4;pt++)mt.slen[pt]=jt[Jt[pt]];switch(vn=mt.slen[0],mn=mt.slen[1],Tn=mt.slen[2],Pn=mt.slen[3],gt){case 0:mt.scalefac_compress=(vn*5+mn<<4)+(Tn<<2)+Pn;break;case 1:mt.scalefac_compress=400+(vn*5+mn<<2)+Tn;break;case 2:mt.scalefac_compress=500+vn*3+mn;break;default:e.err.printf(`intensity stereo not implemented yet
|
|
49
|
+
`)}getValidator(e){return this.validators.get(e)}}const schemaValidator=new SchemaValidator;class SessionAPI{constructor(e,s){this.httpClient=e,this.baseUrl=s}setBaseUrl(e){this.baseUrl=e}async createSession(e){schemaValidator.validateCreateSessionRequest(e);const s=`${this.baseUrl}/sessions`;return this.httpClient.post(s,e)}async getSessionStatus(e){schemaValidator.validateSessionId(e);const s=`${this.baseUrl}/sessions/${e}`;return this.httpClient.get(s)}async endSession(e,s){const c=`${this.baseUrl}/sessions/${e}/end`,h=s!==void 0?{audio_files_sent:s}:void 0;return this.httpClient.post(c,h)}async pollSessionStatus(e,s={}){const{maxAttempts:c=60,intervalMs:h=2e3,onProgress:$}=s;for(let _=0;_<c;_++){const j=await this.getSessionStatus(e);if($&&$(j),j.status==="completed"||j.status==="partial"||j.status==="failed")return j;_<c-1&&await this.sleep(h)}throw new Error(`Polling timeout: session ${e} did not complete after ${c} attempts`)}sleep(e){return new Promise(s=>setTimeout(s,e))}}class HttpClient{constructor(e,s,c=!1){this.apiKey=e,this.debug=c,this.accessToken=s}async request(e,s){const c={"Content-Type":"application/json",Accept:"application/json",...s.headers};this.apiKey&&(c["X-API-Key"]=this.apiKey),this.accessToken&&(c.Authorization=`Bearer ${this.accessToken}`);const h={method:s.method,headers:c,credentials:"include"};s.body&&(h.body=JSON.stringify(s.body)),this.debug&&console.log("[ScribeSDK] Request:",{url:e,method:s.method,headers:c,body:s.body});try{const $=await fetch(e,h);if(this.debug&&console.log("[ScribeSDK] Response:",{status:$.status,statusText:$.statusText}),$.ok)return await $.json();throw await this.handleErrorResponse($),new ScribeError("Unexpected error occurred")}catch($){throw $ instanceof ScribeError?$:new ScribeError(`Network error: ${$ instanceof Error?$.message:"Unknown error"}`,"network_error")}}async handleErrorResponse(e){let s=null;try{s=await e.json()}catch{throw new ScribeError(`HTTP ${e.status}: ${e.statusText}`,"http_error",e.status)}throw s!=null&&s.error?ScribeError.fromApiError(s.error,e.status):new ScribeError(`HTTP ${e.status}: ${e.statusText}`,"http_error",e.status)}async get(e,s){return this.request(e,{method:"GET",headers:s})}async post(e,s,c){return this.request(e,{method:"POST",body:s,headers:c})}async put(e,s,c){return this.request(e,{method:"PUT",body:s,headers:c})}async patch(e,s,c){return this.request(e,{method:"PATCH",body:s,headers:c})}async delete(e,s){return this.request(e,{method:"DELETE",headers:s})}}const PREF_CHUNK_LENGTH=10,DESP_CHUNK_LENGTH=20,MAX_CHUNK_LENGTH=25,FRAME_SIZE=1024,SAMPLING_RATE=16e3,SHORT_SILENCE_THRESHOLD=.1,LONG_SILENCE_THRESHOLD=.5,PRE_SPEECH_PAD_FRAMES=20,BITRATE=128,AUDIO_BUFFER_SIZE_IN_S=DESP_CHUNK_LENGTH+5,OUTPUT_FORMAT="mp3",AUDIO_EXTENSION_TYPE_MAP={m4a:"audio/m4a",wav:"audio/wav",mp3:"audio/mpeg"};function Xa(i){return new Int8Array(i)}function ma(i){return new Int16Array(i)}function ba(i){return new Int32Array(i)}function ca(i){return new Float32Array(i)}function Ya(i){return new Float64Array(i)}function Sa(i){if(i.length==1)return ca(i[0]);var e=i[0];i=i.slice(1);for(var s=[],c=0;c<e;c++)s.push(Sa(i));return s}function da(i){if(i.length==1)return ba(i[0]);var e=i[0];i=i.slice(1);for(var s=[],c=0;c<e;c++)s.push(da(i));return s}function Aa(i){if(i.length==1)return ma(i[0]);var e=i[0];i=i.slice(1);for(var s=[],c=0;c<e;c++)s.push(Aa(i));return s}function Ra(i){if(i.length==1)return new Array(i[0]);var e=i[0];i=i.slice(1);for(var s=[],c=0;c<e;c++)s.push(Ra(i));return s}var xa={};xa.fill=function(i,e,s,c){if(arguments.length==2)for(var h=0;h<i.length;h++)i[h]=arguments[1];else for(var h=e;h<s;h++)i[h]=c};var W1={};W1.arraycopy=function(i,e,s,c,h){for(var $=e+h;e<$;)s[c++]=i[e++]},W1.out={},W1.out.println=function(i){console.log(i)},W1.out.printf=function(){console.log.apply(console,arguments)};var se={};se.SQRT2=1.4142135623730951,se.FAST_LOG10=function(i){return Math.log10(i)},se.FAST_LOG10_X=function(i,e){return Math.log10(i)*e};function B1(i){this.ordinal=i}B1.short_block_allowed=new B1(0),B1.short_block_coupled=new B1(1),B1.short_block_dispensed=new B1(2),B1.short_block_forced=new B1(3);var Ma={};Ma.MAX_VALUE=34028235e31;function u1(i){this.ordinal=i}u1.vbr_off=new u1(0),u1.vbr_mt=new u1(1),u1.vbr_rh=new u1(2),u1.vbr_abr=new u1(3),u1.vbr_mtrh=new u1(4),u1.vbr_default=u1.vbr_mtrh;var qa=function(i){},Q0={System:W1,VbrMode:u1,Float:Ma,ShortBlock:B1,Util:se,Arrays:xa,new_array_n:Ra,new_byte:Xa,new_double:Ya,new_float:ca,new_float_n:Sa,new_int:ba,new_int_n:da,new_short_n:Aa,assert:qa},ce,De;function Da(){if(De)return ce;De=1;var i=Q0,e=i.System,s=i.Util,c=i.Arrays,h=i.new_float,$=t1();function _(){var j=[-.1482523854003001,32.308141959636465,296.40344946382766,883.1344870032432,11113.947376231741,1057.2713659324597,305.7402417275812,30.825928907280012,3.8533188138216365,59.42900443849514,709.5899960123345,5281.91112291017,-5829.66483675846,-817.6293103748613,-76.91656988279972,-4.594269939176596,.9063471690191471,.1960342806591213,-.15466694054279598,34.324387823855965,301.8067566458425,817.599602898885,11573.795901679885,1181.2520595540152,321.59731579894424,31.232021761053772,3.7107095756221318,53.650946155329365,684.167428119626,5224.56624370173,-6366.391851890084,-908.9766368219582,-89.83068876699639,-5.411397422890401,.8206787908286602,.3901806440322567,-.16070888947830023,36.147034243915876,304.11815768187864,732.7429163887613,11989.60988270091,1300.012278487897,335.28490093152146,31.48816102859945,3.373875931311736,47.232241542899175,652.7371796173471,5132.414255594984,-6909.087078780055,-1001.9990371107289,-103.62185754286375,-6.104916304710272,.7416505462720353,.5805693545089249,-.16636367662261495,37.751650073343995,303.01103387567713,627.9747488785183,12358.763425278165,1412.2779918482834,346.7496836825721,31.598286663170416,3.1598635433980946,40.57878626349686,616.1671130880391,5007.833007176154,-7454.040671756168,-1095.7960341867115,-118.24411666465777,-6.818469345853504,.6681786379192989,.7653668647301797,-.1716176790982088,39.11551877123304,298.3413246578966,503.5259106886539,12679.589408408976,1516.5821921214542,355.9850766329023,31.395241710249053,2.9164211881972335,33.79716964664243,574.8943997801362,4853.234992253242,-7997.57021486075,-1189.7624067269965,-133.6444792601766,-7.7202770609839915,.5993769336819237,.9427934736519954,-.17645823955292173,40.21879108166477,289.9982036694474,359.3226160751053,12950.259102786438,1612.1013903507662,362.85067106591504,31.045922092242872,2.822222032597987,26.988862316190684,529.8996541764288,4671.371946949588,-8535.899136645805,-1282.5898586244496,-149.58553632943463,-8.643494270763135,.5345111359507916,1.111140466039205,-.36174739330527045,41.04429910497807,277.5463268268618,195.6386023135583,13169.43812144731,1697.6433561479398,367.40983966190305,30.557037410382826,2.531473372857427,20.070154905927314,481.50208566532336,4464.970341588308,-9065.36882077239,-1373.62841526722,-166.1660487028118,-9.58289321133207,.4729647758913199,1.268786568327291,-.36970682634889585,41.393213350082036,261.2935935556502,12.935476055240873,13336.131683328815,1772.508612059496,369.76534388639965,29.751323653701338,2.4023193045459172,13.304795348228817,430.5615775526625,4237.0568611071185,-9581.931701634761,-1461.6913552409758,-183.12733958476446,-10.718010163869403,.41421356237309503,1.414213562373095,-.37677560326535325,41.619486213528496,241.05423794991074,-187.94665032361226,13450.063605744153,1836.153896465782,369.4908799925761,29.001847876923147,2.0714759319987186,6.779591200894186,377.7767837205709,3990.386575512536,-10081.709459700915,-1545.947424837898,-200.3762958015653,-11.864482073055006,.3578057213145241,1.546020906725474,-.3829366947518991,41.1516456456653,216.47684307105183,-406.1569483347166,13511.136535077321,1887.8076599260432,367.3025214564151,28.136213436723654,1.913880671464418,.3829366947518991,323.85365704338597,3728.1472257487526,-10561.233882199509,-1625.2025997821418,-217.62525175416,-13.015432208941645,.3033466836073424,1.66293922460509,-.5822628872992417,40.35639251440489,188.20071124269245,-640.2706748618148,13519.21490106562,1927.6022433578062,362.8197642637487,26.968821921868447,1.7463817695935329,-5.62650678237171,269.3016715297017,3453.386536448852,-11016.145278780888,-1698.6569643425091,-234.7658734267683,-14.16351421663124,.2504869601913055,1.76384252869671,-.5887180101749253,39.23429103868072,155.76096234403798,-889.2492977967378,13475.470561874661,1955.0535223723712,356.4450994756727,25.894952980042156,1.5695032905781554,-11.181939564328772,214.80884394039484,3169.1640829158237,-11443.321309975563,-1765.1588461316153,-251.68908574481912,-15.49755935939164,.198912367379658,1.847759065022573,-.7912582233652842,37.39369355329111,119.699486012458,-1151.0956593239027,13380.446257078214,1970.3952110853447,348.01959814116185,24.731487364283044,1.3850130831637748,-16.421408865300393,161.05030052864092,2878.3322807850063,-11838.991423510031,-1823.985884688674,-268.2854986386903,-16.81724543849939,.1483359875383474,1.913880671464418,-.7960642926861912,35.2322109610459,80.01928065061526,-1424.0212633405113,13235.794061869668,1973.804052543835,337.9908651258184,23.289159354463873,1.3934255946442087,-21.099669467133474,108.48348407242611,2583.700758091299,-12199.726194855148,-1874.2780658979746,-284.2467154529415,-18.11369784385905,.09849140335716425,1.961570560806461,-.998795456205172,32.56307803611191,36.958364584370486,-1706.075448829146,13043.287458812016,1965.3831106103316,326.43182772364605,22.175018750622293,1.198638339011324,-25.371248002043963,57.53505923036915,2288.41886619975,-12522.674544337233,-1914.8400385312243,-299.26241273417224,-19.37805630698734,.04912684976946725,1.990369453344394,.035780907*s.SQRT2*.5/2384e-9,.017876148*s.SQRT2*.5/2384e-9,.003134727*s.SQRT2*.5/2384e-9,.002457142*s.SQRT2*.5/2384e-9,971317e-9*s.SQRT2*.5/2384e-9,218868e-9*s.SQRT2*.5/2384e-9,101566e-9*s.SQRT2*.5/2384e-9,13828e-9*s.SQRT2*.5/2384e-9,12804.797818791945,1945.5515939597317,313.4244966442953,20.801593959731544,1995.1556208053692,9.000838926174497,-29.20218120805369],nt=[[2382191739347913e-28,6423305872147834e-28,9400849094049688e-28,1122435026096556e-27,1183840321267481e-27,1122435026096556e-27,940084909404969e-27,6423305872147839e-28,2382191739347918e-28,5456116108943412e-27,4878985199565852e-27,4240448995017367e-27,3559909094758252e-27,2858043359288075e-27,2156177623817898e-27,1475637723558783e-27,8371015190102974e-28,2599706096327376e-28,-5456116108943412e-27,-4878985199565852e-27,-4240448995017367e-27,-3559909094758252e-27,-2858043359288076e-27,-2156177623817898e-27,-1475637723558783e-27,-8371015190102975e-28,-2599706096327376e-28,-2382191739347923e-28,-6423305872147843e-28,-9400849094049696e-28,-1122435026096556e-27,-1183840321267481e-27,-1122435026096556e-27,-9400849094049694e-28,-642330587214784e-27,-2382191739347918e-28],[2382191739347913e-28,6423305872147834e-28,9400849094049688e-28,1122435026096556e-27,1183840321267481e-27,1122435026096556e-27,9400849094049688e-28,6423305872147841e-28,2382191739347918e-28,5456116108943413e-27,4878985199565852e-27,4240448995017367e-27,3559909094758253e-27,2858043359288075e-27,2156177623817898e-27,1475637723558782e-27,8371015190102975e-28,2599706096327376e-28,-5461314069809755e-27,-4921085770524055e-27,-4343405037091838e-27,-3732668368707687e-27,-3093523840190885e-27,-2430835727329465e-27,-1734679010007751e-27,-974825365660928e-27,-2797435120168326e-28,0,0,0,0,0,0,-2283748241799531e-28,-4037858874020686e-28,-2146547464825323e-28],[.1316524975873958,.414213562373095,.7673269879789602,1.091308501069271,1.303225372841206,1.56968557711749,1.920982126971166,2.414213562373094,3.171594802363212,4.510708503662055,7.595754112725146,22.90376554843115,.984807753012208,.6427876096865394,.3420201433256688,.9396926207859084,-.1736481776669303,-.7660444431189779,.8660254037844387,.5,-.5144957554275265,-.4717319685649723,-.3133774542039019,-.1819131996109812,-.09457419252642064,-.04096558288530405,-.01419856857247115,-.003699974673760037,.8574929257125442,.8817419973177052,.9496286491027329,.9833145924917901,.9955178160675857,.9991605581781475,.999899195244447,.9999931550702802],[0,0,0,0,0,0,2283748241799531e-28,4037858874020686e-28,2146547464825323e-28,5461314069809755e-27,4921085770524055e-27,4343405037091838e-27,3732668368707687e-27,3093523840190885e-27,2430835727329466e-27,1734679010007751e-27,974825365660928e-27,2797435120168326e-28,-5456116108943413e-27,-4878985199565852e-27,-4240448995017367e-27,-3559909094758253e-27,-2858043359288075e-27,-2156177623817898e-27,-1475637723558782e-27,-8371015190102975e-28,-2599706096327376e-28,-2382191739347913e-28,-6423305872147834e-28,-9400849094049688e-28,-1122435026096556e-27,-1183840321267481e-27,-1122435026096556e-27,-9400849094049688e-28,-6423305872147841e-28,-2382191739347918e-28]],et=nt[$.SHORT_TYPE],b=nt[$.SHORT_TYPE],a=nt[$.SHORT_TYPE],o=nt[$.SHORT_TYPE],d=[0,1,16,17,8,9,24,25,4,5,20,21,12,13,28,29,2,3,18,19,10,11,26,27,6,7,22,23,14,15,30,31];function g(tt,ot,it){for(var at=10,ut=ot+238-14-286,lt=-15;lt<0;lt++){var ct,ft,dt;ct=j[at+-10],ft=tt[ut+-224]*ct,dt=tt[ot+224]*ct,ct=j[at+-9],ft+=tt[ut+-160]*ct,dt+=tt[ot+160]*ct,ct=j[at+-8],ft+=tt[ut+-96]*ct,dt+=tt[ot+96]*ct,ct=j[at+-7],ft+=tt[ut+-32]*ct,dt+=tt[ot+32]*ct,ct=j[at+-6],ft+=tt[ut+32]*ct,dt+=tt[ot+-32]*ct,ct=j[at+-5],ft+=tt[ut+96]*ct,dt+=tt[ot+-96]*ct,ct=j[at+-4],ft+=tt[ut+160]*ct,dt+=tt[ot+-160]*ct,ct=j[at+-3],ft+=tt[ut+224]*ct,dt+=tt[ot+-224]*ct,ct=j[at+-2],ft+=tt[ot+-256]*ct,dt-=tt[ut+256]*ct,ct=j[at+-1],ft+=tt[ot+-192]*ct,dt-=tt[ut+192]*ct,ct=j[at+0],ft+=tt[ot+-128]*ct,dt-=tt[ut+128]*ct,ct=j[at+1],ft+=tt[ot+-64]*ct,dt-=tt[ut+64]*ct,ct=j[at+2],ft+=tt[ot+0]*ct,dt-=tt[ut+0]*ct,ct=j[at+3],ft+=tt[ot+64]*ct,dt-=tt[ut+-64]*ct,ct=j[at+4],ft+=tt[ot+128]*ct,dt-=tt[ut+-128]*ct,ct=j[at+5],ft+=tt[ot+192]*ct,dt-=tt[ut+-192]*ct,ft*=j[at+6],ct=dt-ft,it[30+lt*2]=dt+ft,it[31+lt*2]=j[at+7]*ct,at+=18,ot--,ut++}{var ft,dt,yt,St;dt=tt[ot+-16]*j[at+-10],ft=tt[ot+-32]*j[at+-2],dt+=(tt[ot+-48]-tt[ot+16])*j[at+-9],ft+=tt[ot+-96]*j[at+-1],dt+=(tt[ot+-80]+tt[ot+48])*j[at+-8],ft+=tt[ot+-160]*j[at+0],dt+=(tt[ot+-112]-tt[ot+80])*j[at+-7],ft+=tt[ot+-224]*j[at+1],dt+=(tt[ot+-144]+tt[ot+112])*j[at+-6],ft-=tt[ot+32]*j[at+2],dt+=(tt[ot+-176]-tt[ot+144])*j[at+-5],ft-=tt[ot+96]*j[at+3],dt+=(tt[ot+-208]+tt[ot+176])*j[at+-4],ft-=tt[ot+160]*j[at+4],dt+=(tt[ot+-240]-tt[ot+208])*j[at+-3],ft-=tt[ot+224],yt=ft-dt,St=ft+dt,dt=it[14],ft=it[15]-dt,it[31]=St+dt,it[30]=yt+ft,it[15]=yt-ft,it[14]=St-dt}{var bt;bt=it[28]-it[0],it[0]+=it[28],it[28]=bt*j[at+-2*18+7],bt=it[29]-it[1],it[1]+=it[29],it[29]=bt*j[at+-2*18+7],bt=it[26]-it[2],it[2]+=it[26],it[26]=bt*j[at+-4*18+7],bt=it[27]-it[3],it[3]+=it[27],it[27]=bt*j[at+-4*18+7],bt=it[24]-it[4],it[4]+=it[24],it[24]=bt*j[at+-6*18+7],bt=it[25]-it[5],it[5]+=it[25],it[25]=bt*j[at+-6*18+7],bt=it[22]-it[6],it[6]+=it[22],it[22]=bt*s.SQRT2,bt=it[23]-it[7],it[7]+=it[23],it[23]=bt*s.SQRT2-it[7],it[7]-=it[6],it[22]-=it[7],it[23]-=it[22],bt=it[6],it[6]=it[31]-bt,it[31]=it[31]+bt,bt=it[7],it[7]=it[30]-bt,it[30]=it[30]+bt,bt=it[22],it[22]=it[15]-bt,it[15]=it[15]+bt,bt=it[23],it[23]=it[14]-bt,it[14]=it[14]+bt,bt=it[20]-it[8],it[8]+=it[20],it[20]=bt*j[at+-10*18+7],bt=it[21]-it[9],it[9]+=it[21],it[21]=bt*j[at+-10*18+7],bt=it[18]-it[10],it[10]+=it[18],it[18]=bt*j[at+-12*18+7],bt=it[19]-it[11],it[11]+=it[19],it[19]=bt*j[at+-12*18+7],bt=it[16]-it[12],it[12]+=it[16],it[16]=bt*j[at+-14*18+7],bt=it[17]-it[13],it[13]+=it[17],it[17]=bt*j[at+-14*18+7],bt=-it[20]+it[24],it[20]+=it[24],it[24]=bt*j[at+-12*18+7],bt=-it[21]+it[25],it[21]+=it[25],it[25]=bt*j[at+-12*18+7],bt=it[4]-it[8],it[4]+=it[8],it[8]=bt*j[at+-12*18+7],bt=it[5]-it[9],it[5]+=it[9],it[9]=bt*j[at+-12*18+7],bt=it[0]-it[12],it[0]+=it[12],it[12]=bt*j[at+-4*18+7],bt=it[1]-it[13],it[1]+=it[13],it[13]=bt*j[at+-4*18+7],bt=it[16]-it[28],it[16]+=it[28],it[28]=bt*j[at+-4*18+7],bt=-it[17]+it[29],it[17]+=it[29],it[29]=bt*j[at+-4*18+7],bt=s.SQRT2*(it[2]-it[10]),it[2]+=it[10],it[10]=bt,bt=s.SQRT2*(it[3]-it[11]),it[3]+=it[11],it[11]=bt,bt=s.SQRT2*(-it[18]+it[26]),it[18]+=it[26],it[26]=bt-it[18],bt=s.SQRT2*(-it[19]+it[27]),it[19]+=it[27],it[27]=bt-it[19],bt=it[2],it[19]-=it[3],it[3]-=bt,it[2]=it[31]-bt,it[31]+=bt,bt=it[3],it[11]-=it[19],it[18]-=bt,it[3]=it[30]-bt,it[30]+=bt,bt=it[18],it[27]-=it[11],it[19]-=bt,it[18]=it[15]-bt,it[15]+=bt,bt=it[19],it[10]-=bt,it[19]=it[14]-bt,it[14]+=bt,bt=it[10],it[11]-=bt,it[10]=it[23]-bt,it[23]+=bt,bt=it[11],it[26]-=bt,it[11]=it[22]-bt,it[22]+=bt,bt=it[26],it[27]-=bt,it[26]=it[7]-bt,it[7]+=bt,bt=it[27],it[27]=it[6]-bt,it[6]+=bt,bt=s.SQRT2*(it[0]-it[4]),it[0]+=it[4],it[4]=bt,bt=s.SQRT2*(it[1]-it[5]),it[1]+=it[5],it[5]=bt,bt=s.SQRT2*(it[16]-it[20]),it[16]+=it[20],it[20]=bt,bt=s.SQRT2*(it[17]-it[21]),it[17]+=it[21],it[21]=bt,bt=-s.SQRT2*(it[8]-it[12]),it[8]+=it[12],it[12]=bt-it[8],bt=-s.SQRT2*(it[9]-it[13]),it[9]+=it[13],it[13]=bt-it[9],bt=-s.SQRT2*(it[25]-it[29]),it[25]+=it[29],it[29]=bt-it[25],bt=-s.SQRT2*(it[24]+it[28]),it[24]-=it[28],it[28]=bt-it[24],bt=it[24]-it[16],it[24]=bt,bt=it[20]-bt,it[20]=bt,bt=it[28]-bt,it[28]=bt,bt=it[25]-it[17],it[25]=bt,bt=it[21]-bt,it[21]=bt,bt=it[29]-bt,it[29]=bt,bt=it[17]-it[1],it[17]=bt,bt=it[9]-bt,it[9]=bt,bt=it[25]-bt,it[25]=bt,bt=it[5]-bt,it[5]=bt,bt=it[21]-bt,it[21]=bt,bt=it[13]-bt,it[13]=bt,bt=it[29]-bt,it[29]=bt,bt=it[1]-it[0],it[1]=bt,bt=it[16]-bt,it[16]=bt,bt=it[17]-bt,it[17]=bt,bt=it[8]-bt,it[8]=bt,bt=it[9]-bt,it[9]=bt,bt=it[24]-bt,it[24]=bt,bt=it[25]-bt,it[25]=bt,bt=it[4]-bt,it[4]=bt,bt=it[5]-bt,it[5]=bt,bt=it[20]-bt,it[20]=bt,bt=it[21]-bt,it[21]=bt,bt=it[12]-bt,it[12]=bt,bt=it[13]-bt,it[13]=bt,bt=it[28]-bt,it[28]=bt,bt=it[29]-bt,it[29]=bt,bt=it[0],it[0]+=it[31],it[31]-=bt,bt=it[1],it[1]+=it[30],it[30]-=bt,bt=it[16],it[16]+=it[15],it[15]-=bt,bt=it[17],it[17]+=it[14],it[14]-=bt,bt=it[8],it[8]+=it[23],it[23]-=bt,bt=it[9],it[9]+=it[22],it[22]-=bt,bt=it[24],it[24]+=it[7],it[7]-=bt,bt=it[25],it[25]+=it[6],it[6]-=bt,bt=it[4],it[4]+=it[27],it[27]-=bt,bt=it[5],it[5]+=it[26],it[26]-=bt,bt=it[20],it[20]+=it[11],it[11]-=bt,bt=it[21],it[21]+=it[10],it[10]-=bt,bt=it[12],it[12]+=it[19],it[19]-=bt,bt=it[13],it[13]+=it[18],it[18]-=bt,bt=it[28],it[28]+=it[3],it[3]-=bt,bt=it[29],it[29]+=it[2],it[2]-=bt}}function rt(tt,ot){for(var it=0;it<3;it++){var at,ut,lt,ct,ft,dt;ct=tt[ot+2*3]*nt[$.SHORT_TYPE][0]-tt[ot+5*3],at=tt[ot+0*3]*nt[$.SHORT_TYPE][2]-tt[ot+3*3],ut=ct+at,lt=ct-at,ct=tt[ot+5*3]*nt[$.SHORT_TYPE][0]+tt[ot+2*3],at=tt[ot+3*3]*nt[$.SHORT_TYPE][2]+tt[ot+0*3],ft=ct+at,dt=-ct+at,at=(tt[ot+1*3]*nt[$.SHORT_TYPE][1]-tt[ot+4*3])*2069978111953089e-26,ct=(tt[ot+4*3]*nt[$.SHORT_TYPE][1]+tt[ot+1*3])*2069978111953089e-26,tt[ot+3*0]=ut*190752519173728e-25+at,tt[ot+3*5]=-ft*190752519173728e-25+ct,lt=lt*.8660254037844387*1907525191737281e-26,ft=ft*.5*1907525191737281e-26+ct,tt[ot+3*1]=lt-ft,tt[ot+3*2]=lt+ft,ut=ut*.5*1907525191737281e-26-at,dt=dt*.8660254037844387*1907525191737281e-26,tt[ot+3*3]=ut+dt,tt[ot+3*4]=ut-dt,ot++}}function st(tt,ot,it){var at,ut;{var lt,ct,ft,dt,yt,St,bt,Tt;lt=it[17]-it[9],ft=it[15]-it[11],dt=it[14]-it[12],yt=it[0]+it[8],St=it[1]+it[7],bt=it[2]+it[6],Tt=it[3]+it[5],tt[ot+17]=yt+bt-Tt-(St-it[4]),ut=(yt+bt-Tt)*b[19]+(St-it[4]),at=(lt-ft-dt)*b[18],tt[ot+5]=at+ut,tt[ot+6]=at-ut,ct=(it[16]-it[10])*b[18],St=St*b[19]+it[4],at=lt*b[12]+ct+ft*b[13]+dt*b[14],ut=-yt*b[16]+St-bt*b[17]+Tt*b[15],tt[ot+1]=at+ut,tt[ot+2]=at-ut,at=lt*b[13]-ct-ft*b[14]+dt*b[12],ut=-yt*b[17]+St-bt*b[15]+Tt*b[16],tt[ot+9]=at+ut,tt[ot+10]=at-ut,at=lt*b[14]-ct+ft*b[12]-dt*b[13],ut=yt*b[15]-St+bt*b[16]-Tt*b[17],tt[ot+13]=at+ut,tt[ot+14]=at-ut}{var vt,$t,At,Ot,It,jt,Et,mt;vt=it[8]-it[0],At=it[6]-it[2],Ot=it[5]-it[3],It=it[17]+it[9],jt=it[16]+it[10],Et=it[15]+it[11],mt=it[14]+it[12],tt[ot+0]=It+Et+mt+(jt+it[13]),at=(It+Et+mt)*b[19]-(jt+it[13]),ut=(vt-At+Ot)*b[18],tt[ot+11]=at+ut,tt[ot+12]=at-ut,$t=(it[7]-it[1])*b[18],jt=it[13]-jt*b[19],at=It*b[15]-jt+Et*b[16]+mt*b[17],ut=vt*b[14]+$t+At*b[12]+Ot*b[13],tt[ot+3]=at+ut,tt[ot+4]=at-ut,at=-It*b[17]+jt-Et*b[15]-mt*b[16],ut=vt*b[13]+$t-At*b[14]-Ot*b[12],tt[ot+7]=at+ut,tt[ot+8]=at-ut,at=-It*b[16]+jt-Et*b[17]-mt*b[15],ut=vt*b[12]-$t+At*b[13]-Ot*b[14],tt[ot+15]=at+ut,tt[ot+16]=at-ut}}this.mdct_sub48=function(tt,ot,it){for(var at=ot,ut=286,lt=0;lt<tt.channels_out;lt++){for(var ct=0;ct<tt.mode_gr;ct++){for(var ft,dt=tt.l3_side.tt[ct][lt],yt=dt.xr,St=0,bt=tt.sb_sample[lt][1-ct],Tt=0,vt=0;vt<18/2;vt++)for(g(at,ut,bt[Tt]),g(at,ut+32,bt[Tt+1]),Tt+=2,ut+=64,ft=1;ft<32;ft+=2)bt[Tt-1][ft]*=-1;for(ft=0;ft<32;ft++,St+=18){var $t=dt.block_type,At=tt.sb_sample[lt][ct],Ot=tt.sb_sample[lt][1-ct];if(dt.mixed_block_flag!=0&&ft<2&&($t=0),tt.amp_filter[ft]<1e-12)c.fill(yt,St+0,St+18,0);else{if(tt.amp_filter[ft]<1)for(var vt=0;vt<18;vt++)Ot[vt][d[ft]]*=tt.amp_filter[ft];if($t==$.SHORT_TYPE){for(var vt=-12/4;vt<0;vt++){var It=nt[$.SHORT_TYPE][vt+3];yt[St+vt*3+9]=At[9+vt][d[ft]]*It-At[8-vt][d[ft]],yt[St+vt*3+18]=At[14-vt][d[ft]]*It+At[15+vt][d[ft]],yt[St+vt*3+10]=At[15+vt][d[ft]]*It-At[14-vt][d[ft]],yt[St+vt*3+19]=Ot[2-vt][d[ft]]*It+Ot[3+vt][d[ft]],yt[St+vt*3+11]=Ot[3+vt][d[ft]]*It-Ot[2-vt][d[ft]],yt[St+vt*3+20]=Ot[8-vt][d[ft]]*It+Ot[9+vt][d[ft]]}rt(yt,St)}else{for(var jt=h(18),vt=-36/4;vt<0;vt++){var Et,mt;Et=nt[$t][vt+27]*Ot[vt+9][d[ft]]+nt[$t][vt+36]*Ot[8-vt][d[ft]],mt=nt[$t][vt+9]*At[vt+9][d[ft]]-nt[$t][vt+18]*At[8-vt][d[ft]],jt[vt+9]=Et-mt*et[3+vt+9],jt[vt+18]=Et*et[3+vt+9]+mt}st(yt,St,jt)}}if($t!=$.SHORT_TYPE&&ft!=0)for(var vt=7;vt>=0;--vt){var gt,ht;gt=yt[St+vt]*a[20+vt]+yt[St+-1-vt]*o[28+vt],ht=yt[St+vt]*o[28+vt]-yt[St+-1-vt]*a[20+vt],yt[St+-1-vt]=gt,yt[St+vt]=ht}}}if(at=it,ut=286,tt.mode_gr==1)for(var pt=0;pt<18;pt++)e.arraycopy(tt.sb_sample[lt][1][pt],0,tt.sb_sample[lt][0][pt],0,32)}}}return ce=_,ce}var Se,Ge;function Ea(){if(Ge)return Se;Ge=1;var i=t1(),e=Q0,s=e.System,c=e.new_float,h=e.new_float_n;function $(){this.l=c(i.SBMAX_l),this.s=h([i.SBMAX_s,3]);var _=this;this.assign=function(j){s.arraycopy(j.l,0,_.l,0,i.SBMAX_l);for(var nt=0;nt<i.SBMAX_s;nt++)for(var et=0;et<3;et++)_.s[nt][et]=j.s[nt][et]}}return Se=$,Se}var de,$e;function Ga(){if($e)return de;$e=1;var i=Ea();function e(){this.thm=new i,this.en=new i}return de=e,de}function R1(i){var e=i;this.ordinal=function(){return e}}R1.STEREO=new R1(0),R1.JOINT_STEREO=new R1(1),R1.DUAL_CHANNEL=new R1(2),R1.MONO=new R1(3),R1.NOT_SET=new R1(4);var j1=R1,Ae,Pe;function t1(){if(Pe)return Ae;Pe=1;var i=Q0,e=i.System,s=i.VbrMode,c=i.new_array_n,h=i.new_float,$=i.new_float_n,_=i.new_int,j=i.assert;nt.ENCDELAY=576,nt.POSTDELAY=1152,nt.MDCTDELAY=48,nt.FFTOFFSET=224+nt.MDCTDELAY,nt.DECDELAY=528,nt.SBLIMIT=32,nt.CBANDS=64,nt.SBPSY_l=21,nt.SBPSY_s=12,nt.SBMAX_l=22,nt.SBMAX_s=13,nt.PSFB21=6,nt.PSFB12=6,nt.BLKSIZE=1024,nt.HBLKSIZE=nt.BLKSIZE/2+1,nt.BLKSIZE_s=256,nt.HBLKSIZE_s=nt.BLKSIZE_s/2+1,nt.NORM_TYPE=0,nt.START_TYPE=1,nt.SHORT_TYPE=2,nt.STOP_TYPE=3,nt.MPG_MD_LR_LR=0,nt.MPG_MD_LR_I=1,nt.MPG_MD_MS_LR=2,nt.MPG_MD_MS_I=3,nt.fircoef=[-.0207887*5,-.0378413*5,-.0432472*5,-.031183*5,779609e-23*5,.0467745*5,.10091*5,.151365*5,.187098*5];function nt(){var et=Da(),b=Ga(),a=j1,o=nt.FFTOFFSET,d=nt.MPG_MD_MS_LR,g=null;this.psy=null;var rt=null,st=null,tt=null;this.setModules=function(lt,ct,ft,dt){g=lt,this.psy=ct,rt=ct,st=dt,tt=ft};var ot=new et;function it(lt){var ct,ft;if(lt.ATH.useAdjust==0){lt.ATH.adjust=1;return}if(ft=lt.loudness_sq[0][0],ct=lt.loudness_sq[1][0],lt.channels_out==2?(ft+=lt.loudness_sq[0][1],ct+=lt.loudness_sq[1][1]):(ft+=ft,ct+=ct),lt.mode_gr==2&&(ft=Math.max(ft,ct)),ft*=.5,ft*=lt.ATH.aaSensitivityP,ft>.03125)lt.ATH.adjust>=1?lt.ATH.adjust=1:lt.ATH.adjust<lt.ATH.adjustLimit&&(lt.ATH.adjust=lt.ATH.adjustLimit),lt.ATH.adjustLimit=1;else{var dt=31.98*ft+625e-6;lt.ATH.adjust>=dt?(lt.ATH.adjust*=dt*.075+.925,lt.ATH.adjust<dt&&(lt.ATH.adjust=dt)):lt.ATH.adjustLimit>=dt?lt.ATH.adjust=dt:lt.ATH.adjust<lt.ATH.adjustLimit&&(lt.ATH.adjust=lt.ATH.adjustLimit),lt.ATH.adjustLimit=dt}}function at(lt){var ct,ft;for(j(0<=lt.bitrate_index&<.bitrate_index<16),j(0<=lt.mode_ext&<.mode_ext<4),lt.bitrate_stereoMode_Hist[lt.bitrate_index][4]++,lt.bitrate_stereoMode_Hist[15][4]++,lt.channels_out==2&&(lt.bitrate_stereoMode_Hist[lt.bitrate_index][lt.mode_ext]++,lt.bitrate_stereoMode_Hist[15][lt.mode_ext]++),ct=0;ct<lt.mode_gr;++ct)for(ft=0;ft<lt.channels_out;++ft){var dt=lt.l3_side.tt[ct][ft].block_type|0;lt.l3_side.tt[ct][ft].mixed_block_flag!=0&&(dt=4),lt.bitrate_blockType_Hist[lt.bitrate_index][dt]++,lt.bitrate_blockType_Hist[lt.bitrate_index][5]++,lt.bitrate_blockType_Hist[15][dt]++,lt.bitrate_blockType_Hist[15][5]++}}function ut(lt,ct){var ft=lt.internal_flags,dt,yt;if(ft.lame_encode_frame_init==0){var St,bt,Tt=h(2014),vt=h(2014);for(ft.lame_encode_frame_init=1,St=0,bt=0;St<286+576*(1+ft.mode_gr);++St)St<576*ft.mode_gr?(Tt[St]=0,ft.channels_out==2&&(vt[St]=0)):(Tt[St]=ct[0][bt],ft.channels_out==2&&(vt[St]=ct[1][bt]),++bt);for(yt=0;yt<ft.mode_gr;yt++)for(dt=0;dt<ft.channels_out;dt++)ft.l3_side.tt[yt][dt].block_type=nt.SHORT_TYPE;ot.mdct_sub48(ft,Tt,vt),j(576>=nt.FFTOFFSET),j(ft.mf_size>=nt.BLKSIZE+lt.framesize-nt.FFTOFFSET),j(ft.mf_size>=512+lt.framesize-32)}}this.lame_encode_mp3_frame=function(lt,ct,ft,dt,yt,St){var bt,Tt=c([2,2]);Tt[0][0]=new b,Tt[0][1]=new b,Tt[1][0]=new b,Tt[1][1]=new b;var vt=c([2,2]);vt[0][0]=new b,vt[0][1]=new b,vt[1][0]=new b,vt[1][1]=new b;var $t,At=[null,null],Ot=lt.internal_flags,It=$([2,4]),jt=[.5,.5],Et=[[0,0],[0,0]],mt=[[0,0],[0,0]],gt,ht,pt;if(At[0]=ct,At[1]=ft,Ot.lame_encode_frame_init==0&&ut(lt,At),Ot.padding=0,(Ot.slot_lag-=Ot.frac_SpF)<0&&(Ot.slot_lag+=lt.out_samplerate,Ot.padding=1),Ot.psymodel!=0){var _t,Ct=[null,null],zt=0,Nt=_(2);for(pt=0;pt<Ot.mode_gr;pt++){for(ht=0;ht<Ot.channels_out;ht++)Ct[ht]=At[ht],zt=576+pt*576-nt.FFTOFFSET;if(lt.VBR==s.vbr_mtrh||lt.VBR==s.vbr_mt?_t=rt.L3psycho_anal_vbr(lt,Ct,zt,pt,Tt,vt,Et[pt],mt[pt],It[pt],Nt):_t=rt.L3psycho_anal_ns(lt,Ct,zt,pt,Tt,vt,Et[pt],mt[pt],It[pt],Nt),_t!=0)return-4;for(lt.mode==a.JOINT_STEREO&&(jt[pt]=It[pt][2]+It[pt][3],jt[pt]>0&&(jt[pt]=It[pt][3]/jt[pt])),ht=0;ht<Ot.channels_out;ht++){var Ht=Ot.l3_side.tt[pt][ht];Ht.block_type=Nt[ht],Ht.mixed_block_flag=0}}}else for(pt=0;pt<Ot.mode_gr;pt++)for(ht=0;ht<Ot.channels_out;ht++)Ot.l3_side.tt[pt][ht].block_type=nt.NORM_TYPE,Ot.l3_side.tt[pt][ht].mixed_block_flag=0,mt[pt][ht]=Et[pt][ht]=700;if(it(Ot),ot.mdct_sub48(Ot,At[0],At[1]),Ot.mode_ext=nt.MPG_MD_LR_LR,lt.force_ms)Ot.mode_ext=nt.MPG_MD_MS_LR;else if(lt.mode==a.JOINT_STEREO){var Jt=0,un=0;for(pt=0;pt<Ot.mode_gr;pt++)for(ht=0;ht<Ot.channels_out;ht++)Jt+=mt[pt][ht],un+=Et[pt][ht];if(Jt<=1*un){var yn=Ot.l3_side.tt[0],vn=Ot.l3_side.tt[Ot.mode_gr-1];yn[0].block_type==yn[1].block_type&&vn[0].block_type==vn[1].block_type&&(Ot.mode_ext=nt.MPG_MD_MS_LR)}}if(Ot.mode_ext==d?($t=vt,gt=mt):($t=Tt,gt=Et),lt.analysis&&Ot.pinfo!=null)for(pt=0;pt<Ot.mode_gr;pt++)for(ht=0;ht<Ot.channels_out;ht++)Ot.pinfo.ms_ratio[pt]=Ot.ms_ratio[pt],Ot.pinfo.ms_ener_ratio[pt]=jt[pt],Ot.pinfo.blocktype[pt][ht]=Ot.l3_side.tt[pt][ht].block_type,Ot.pinfo.pe[pt][ht]=gt[pt][ht],e.arraycopy(Ot.l3_side.tt[pt][ht].xr,0,Ot.pinfo.xr[pt][ht],0,576),Ot.mode_ext==d&&(Ot.pinfo.ers[pt][ht]=Ot.pinfo.ers[pt][ht+2],e.arraycopy(Ot.pinfo.energy[pt][ht+2],0,Ot.pinfo.energy[pt][ht],0,Ot.pinfo.energy[pt][ht].length));if(lt.VBR==s.vbr_off||lt.VBR==s.vbr_abr){var mn,Tn;for(mn=0;mn<18;mn++)Ot.nsPsy.pefirbuf[mn]=Ot.nsPsy.pefirbuf[mn+1];for(Tn=0,pt=0;pt<Ot.mode_gr;pt++)for(ht=0;ht<Ot.channels_out;ht++)Tn+=gt[pt][ht];for(Ot.nsPsy.pefirbuf[18]=Tn,Tn=Ot.nsPsy.pefirbuf[9],mn=0;mn<9;mn++)Tn+=(Ot.nsPsy.pefirbuf[mn]+Ot.nsPsy.pefirbuf[18-mn])*nt.fircoef[mn];for(Tn=670*5*Ot.mode_gr*Ot.channels_out/Tn,pt=0;pt<Ot.mode_gr;pt++)for(ht=0;ht<Ot.channels_out;ht++)gt[pt][ht]*=Tn}if(Ot.iteration_loop.iteration_loop(lt,gt,jt,$t),g.format_bitstream(lt),bt=g.copy_buffer(Ot,dt,yt,St,1),lt.bWriteVbrTag&&st.addVbrFrame(lt),lt.analysis&&Ot.pinfo!=null){for(ht=0;ht<Ot.channels_out;ht++){var kn;for(kn=0;kn<o;kn++)Ot.pinfo.pcmdata[ht][kn]=Ot.pinfo.pcmdata[ht][kn+lt.framesize];for(kn=o;kn<1600;kn++)Ot.pinfo.pcmdata[ht][kn]=At[ht][kn-o]}tt.set_frame_pinfo(lt,$t)}return at(Ot),bt}}return Ae=nt,Ae}var Ba=Q0,Ze=Ba.Util,Ke=Ba.new_float,J0=t1();function $a(){var i=Ke(J0.BLKSIZE),e=Ke(J0.BLKSIZE_s/2),s=[.9238795325112867,.3826834323650898,.9951847266721969,.0980171403295606,.9996988186962042,.02454122852291229,.9999811752826011,.006135884649154475];function c($,_,j){var nt=0,et,b,a;j<<=1;var o=_+j;et=4;do{var d,g,rt,st,tt,ot,it;it=et>>1,st=et,tt=et<<1,ot=tt+st,et=tt<<1,b=_,a=b+it;do{var at,ut,lt,ct;ut=$[b+0]-$[b+st],at=$[b+0]+$[b+st],ct=$[b+tt]-$[b+ot],lt=$[b+tt]+$[b+ot],$[b+tt]=at-lt,$[b+0]=at+lt,$[b+ot]=ut-ct,$[b+st]=ut+ct,ut=$[a+0]-$[a+st],at=$[a+0]+$[a+st],ct=Ze.SQRT2*$[a+ot],lt=Ze.SQRT2*$[a+tt],$[a+tt]=at-lt,$[a+0]=at+lt,$[a+ot]=ut-ct,$[a+st]=ut+ct,a+=et,b+=et}while(b<o);for(g=s[nt+0],d=s[nt+1],rt=1;rt<it;rt++){var ft,dt;ft=1-2*d*d,dt=2*d*g,b=_+rt,a=_+st-rt;do{var yt,St,bt,at,ut,Tt,lt,vt,ct,$t;St=dt*$[b+st]-ft*$[a+st],yt=ft*$[b+st]+dt*$[a+st],ut=$[b+0]-yt,at=$[b+0]+yt,Tt=$[a+0]-St,bt=$[a+0]+St,St=dt*$[b+ot]-ft*$[a+ot],yt=ft*$[b+ot]+dt*$[a+ot],ct=$[b+tt]-yt,lt=$[b+tt]+yt,$t=$[a+tt]-St,vt=$[a+tt]+St,St=d*lt-g*$t,yt=g*lt+d*$t,$[b+tt]=at-yt,$[b+0]=at+yt,$[a+ot]=Tt-St,$[a+st]=Tt+St,St=g*vt-d*ct,yt=d*vt+g*ct,$[a+tt]=bt-yt,$[a+0]=bt+yt,$[b+ot]=ut-St,$[b+st]=ut+St,a+=et,b+=et}while(b<o);ft=g,g=ft*s[nt+0]-d*s[nt+1],d=ft*s[nt+1]+d*s[nt+0]}nt+=2}while(et<j)}var h=[0,128,64,192,32,160,96,224,16,144,80,208,48,176,112,240,8,136,72,200,40,168,104,232,24,152,88,216,56,184,120,248,4,132,68,196,36,164,100,228,20,148,84,212,52,180,116,244,12,140,76,204,44,172,108,236,28,156,92,220,60,188,124,252,2,130,66,194,34,162,98,226,18,146,82,210,50,178,114,242,10,138,74,202,42,170,106,234,26,154,90,218,58,186,122,250,6,134,70,198,38,166,102,230,22,150,86,214,54,182,118,246,14,142,78,206,46,174,110,238,30,158,94,222,62,190,126,254];this.fft_short=function($,_,j,nt,et){for(var b=0;b<3;b++){var a=J0.BLKSIZE_s/2,o=65535&576/3*(b+1),d=J0.BLKSIZE_s/8-1;do{var g,rt,st,tt,ot,it=h[d<<2]&255;g=e[it]*nt[j][et+it+o],ot=e[127-it]*nt[j][et+it+o+128],rt=g-ot,g=g+ot,st=e[it+64]*nt[j][et+it+o+64],ot=e[63-it]*nt[j][et+it+o+192],tt=st-ot,st=st+ot,a-=4,_[b][a+0]=g+st,_[b][a+2]=g-st,_[b][a+1]=rt+tt,_[b][a+3]=rt-tt,g=e[it+1]*nt[j][et+it+o+1],ot=e[126-it]*nt[j][et+it+o+129],rt=g-ot,g=g+ot,st=e[it+65]*nt[j][et+it+o+65],ot=e[62-it]*nt[j][et+it+o+193],tt=st-ot,st=st+ot,_[b][a+J0.BLKSIZE_s/2+0]=g+st,_[b][a+J0.BLKSIZE_s/2+2]=g-st,_[b][a+J0.BLKSIZE_s/2+1]=rt+tt,_[b][a+J0.BLKSIZE_s/2+3]=rt-tt}while(--d>=0);c(_[b],a,J0.BLKSIZE_s/2)}},this.fft_long=function($,_,j,nt,et){var b=J0.BLKSIZE/8-1,a=J0.BLKSIZE/2;do{var o,d,g,rt,st,tt=h[b]&255;o=i[tt]*nt[j][et+tt],st=i[tt+512]*nt[j][et+tt+512],d=o-st,o=o+st,g=i[tt+256]*nt[j][et+tt+256],st=i[tt+768]*nt[j][et+tt+768],rt=g-st,g=g+st,a-=4,_[a+0]=o+g,_[a+2]=o-g,_[a+1]=d+rt,_[a+3]=d-rt,o=i[tt+1]*nt[j][et+tt+1],st=i[tt+513]*nt[j][et+tt+513],d=o-st,o=o+st,g=i[tt+257]*nt[j][et+tt+257],st=i[tt+769]*nt[j][et+tt+769],rt=g-st,g=g+st,_[a+J0.BLKSIZE/2+0]=o+g,_[a+J0.BLKSIZE/2+2]=o-g,_[a+J0.BLKSIZE/2+1]=d+rt,_[a+J0.BLKSIZE/2+3]=d-rt}while(--b>=0);c(_,a,J0.BLKSIZE/2)},this.init_fft=function($){for(var _=0;_<J0.BLKSIZE;_++)i[_]=.42-.5*Math.cos(2*Math.PI*(_+.5)/J0.BLKSIZE)+.08*Math.cos(4*Math.PI*(_+.5)/J0.BLKSIZE);for(var _=0;_<J0.BLKSIZE_s/2;_++)e[_]=.5*(1-Math.cos(2*Math.PI*(_+.5)/J0.BLKSIZE_s))}}var Pa=$a,T1=Q0,C1=T1.VbrMode,Ue=T1.Float,F1=T1.ShortBlock,n1=T1.Util,Za=T1.Arrays,g0=T1.new_float,m1=T1.new_float_n,L1=T1.new_int,C0=T1.assert,Ka=Pa,r0=t1();function Ua(){var i=j1,e=new Ka,s=2.302585092994046,c=2,h=16,$=2,_=16,j=.34,nt=1/(14752*14752)/(r0.BLKSIZE/2),et=.01,b=.8,a=.6,o=.3,d=3.5,g=21,rt=.2302585093;function st(Pt,Dt){for(var Lt=0,Ut=0;Ut<r0.BLKSIZE/2;++Ut)Lt+=Pt[Ut]*Dt.ATH.eql_w[Ut];return Lt*=nt,Lt}function tt(Pt,Dt,Lt,Ut,Kt,Ft,Yt,Wt,Xt,sn,en){var Qt=Pt.internal_flags;if(Xt<2)e.fft_long(Qt,Ut[Kt],Xt,sn,en),e.fft_short(Qt,Ft[Yt],Xt,sn,en);else if(Xt==2){for(var ln=r0.BLKSIZE-1;ln>=0;--ln){var gn=Ut[Kt+0][ln],dn=Ut[Kt+1][ln];Ut[Kt+0][ln]=(gn+dn)*n1.SQRT2*.5,Ut[Kt+1][ln]=(gn-dn)*n1.SQRT2*.5}for(var Mn=2;Mn>=0;--Mn)for(var ln=r0.BLKSIZE_s-1;ln>=0;--ln){var gn=Ft[Yt+0][Mn][ln],dn=Ft[Yt+1][Mn][ln];Ft[Yt+0][Mn][ln]=(gn+dn)*n1.SQRT2*.5,Ft[Yt+1][Mn][ln]=(gn-dn)*n1.SQRT2*.5}}Dt[0]=Ut[Kt+0][0],Dt[0]*=Dt[0];for(var ln=r0.BLKSIZE/2-1;ln>=0;--ln){var rn=Ut[Kt+0][r0.BLKSIZE/2-ln],Pn=Ut[Kt+0][r0.BLKSIZE/2+ln];Dt[r0.BLKSIZE/2-ln]=(rn*rn+Pn*Pn)*.5}for(var Mn=2;Mn>=0;--Mn){Lt[Mn][0]=Ft[Yt+0][Mn][0],Lt[Mn][0]*=Lt[Mn][0];for(var ln=r0.BLKSIZE_s/2-1;ln>=0;--ln){var rn=Ft[Yt+0][Mn][r0.BLKSIZE_s/2-ln],Pn=Ft[Yt+0][Mn][r0.BLKSIZE_s/2+ln];Lt[Mn][r0.BLKSIZE_s/2-ln]=(rn*rn+Pn*Pn)*.5}}{for(var zn=0,ln=11;ln<r0.HBLKSIZE;ln++)zn+=Dt[ln];Qt.tot_ener[Xt]=zn}if(Pt.analysis){for(var ln=0;ln<r0.HBLKSIZE;ln++)Qt.pinfo.energy[Wt][Xt][ln]=Qt.pinfo.energy_save[Xt][ln],Qt.pinfo.energy_save[Xt][ln]=Dt[ln];Qt.pinfo.pe[Wt][Xt]=Qt.pe[Xt]}Pt.athaa_loudapprox==2&&Xt<2&&(Qt.loudness_sq[Wt][Xt]=Qt.loudness_sq_save[Xt],Qt.loudness_sq_save[Xt]=st(Dt,Qt))}var ot=8,it=23,at=15,ut,lt,ct,ft=[1,.79433,.63096,.63096,.63096,.63096,.63096,.25119,.11749];function dt(){ut=Math.pow(10,(ot+1)/16),lt=Math.pow(10,(it+1)/16),ct=Math.pow(10,at/10)}var yt=[3.3246*3.3246,3.23837*3.23837,3.15437*3.15437,3.00412*3.00412,2.86103*2.86103,2.65407*2.65407,2.46209*2.46209,2.284*2.284,2.11879*2.11879,1.96552*1.96552,1.82335*1.82335,1.69146*1.69146,1.56911*1.56911,1.46658*1.46658,1.37074*1.37074,1.31036*1.31036,1.25264*1.25264,1.20648*1.20648,1.16203*1.16203,1.12765*1.12765,1.09428*1.09428,1.0659*1.0659,1.03826*1.03826,1.01895*1.01895,1],St=[1.33352*1.33352,1.35879*1.35879,1.38454*1.38454,1.39497*1.39497,1.40548*1.40548,1.3537*1.3537,1.30382*1.30382,1.22321*1.22321,1.14758*1.14758,1],bt=[2.35364*2.35364,2.29259*2.29259,2.23313*2.23313,2.12675*2.12675,2.02545*2.02545,1.87894*1.87894,1.74303*1.74303,1.61695*1.61695,1.49999*1.49999,1.39148*1.39148,1.29083*1.29083,1.19746*1.19746,1.11084*1.11084,1.03826*1.03826];function Tt(Pt,Dt,Lt,Ut,Kt,Ft){var Yt;if(Dt>Pt)if(Dt<Pt*lt)Yt=Dt/Pt;else return Pt+Dt;else{if(Pt>=Dt*lt)return Pt+Dt;Yt=Pt/Dt}if(Pt+=Dt,Ut+3<=6){if(Yt>=ut)return Pt;var Wt=0|n1.FAST_LOG10_X(Yt,16);return Pt*St[Wt]}var Wt=0|n1.FAST_LOG10_X(Yt,16);if(Dt=Kt.ATH.cb_l[Lt]*Kt.ATH.adjust,Pt<ct*Dt){if(Pt>Dt){var Xt,sn;return Xt=1,Wt<=13&&(Xt=bt[Wt]),sn=n1.FAST_LOG10_X(Pt/Dt,10/15),Pt*((yt[Wt]-Xt)*sn+Xt)}return Wt>13?Pt:Pt*bt[Wt]}return Pt*yt[Wt]}var vt=[1.33352*1.33352,1.35879*1.35879,1.38454*1.38454,1.39497*1.39497,1.40548*1.40548,1.3537*1.3537,1.30382*1.30382,1.22321*1.22321,1.14758*1.14758,1];function $t(Pt,Dt,Lt){var Ut;if(Pt<0&&(Pt=0),Dt<0&&(Dt=0),Pt<=0)return Dt;if(Dt<=0)return Pt;if(Dt>Pt?Ut=Dt/Pt:Ut=Pt/Dt,-2<=Lt&&Lt<=2){if(Ut>=ut)return Pt+Dt;var Kt=0|n1.FAST_LOG10_X(Ut,16);return(Pt+Dt)*vt[Kt]}return Ut<lt?Pt+Dt:(Pt<Dt&&(Pt=Dt),Pt)}function At(Pt,Dt){var Lt=Pt.internal_flags;if(Lt.channels_out>1){for(var Ut=0;Ut<r0.SBMAX_l;Ut++){var Kt=Lt.thm[0].l[Ut],Ft=Lt.thm[1].l[Ut];Lt.thm[0].l[Ut]+=Ft*Dt,Lt.thm[1].l[Ut]+=Kt*Dt}for(var Ut=0;Ut<r0.SBMAX_s;Ut++)for(var Yt=0;Yt<3;Yt++){var Kt=Lt.thm[0].s[Ut][Yt],Ft=Lt.thm[1].s[Ut][Yt];Lt.thm[0].s[Ut][Yt]+=Ft*Dt,Lt.thm[1].s[Ut][Yt]+=Kt*Dt}}}function Ot(Pt){for(var Dt=0;Dt<r0.SBMAX_l;Dt++)if(!(Pt.thm[0].l[Dt]>1.58*Pt.thm[1].l[Dt]||Pt.thm[1].l[Dt]>1.58*Pt.thm[0].l[Dt])){var Lt=Pt.mld_l[Dt]*Pt.en[3].l[Dt],Ut=Math.max(Pt.thm[2].l[Dt],Math.min(Pt.thm[3].l[Dt],Lt));Lt=Pt.mld_l[Dt]*Pt.en[2].l[Dt];var Kt=Math.max(Pt.thm[3].l[Dt],Math.min(Pt.thm[2].l[Dt],Lt));Pt.thm[2].l[Dt]=Ut,Pt.thm[3].l[Dt]=Kt}for(var Dt=0;Dt<r0.SBMAX_s;Dt++)for(var Ft=0;Ft<3;Ft++)if(!(Pt.thm[0].s[Dt][Ft]>1.58*Pt.thm[1].s[Dt][Ft]||Pt.thm[1].s[Dt][Ft]>1.58*Pt.thm[0].s[Dt][Ft])){var Lt=Pt.mld_s[Dt]*Pt.en[3].s[Dt][Ft],Ut=Math.max(Pt.thm[2].s[Dt][Ft],Math.min(Pt.thm[3].s[Dt][Ft],Lt));Lt=Pt.mld_s[Dt]*Pt.en[2].s[Dt][Ft];var Kt=Math.max(Pt.thm[3].s[Dt][Ft],Math.min(Pt.thm[2].s[Dt][Ft],Lt));Pt.thm[2].s[Dt][Ft]=Ut,Pt.thm[3].s[Dt][Ft]=Kt}}function It(Pt,Dt,Lt){var Ut=Dt,Kt=Math.pow(10,Lt);Dt*=2,Ut*=2;for(var Ft=0;Ft<r0.SBMAX_l;Ft++){var Yt,Wt,Xt,sn;if(sn=Pt.ATH.cb_l[Pt.bm_l[Ft]]*Kt,Yt=Math.min(Math.max(Pt.thm[0].l[Ft],sn),Math.max(Pt.thm[1].l[Ft],sn)),Wt=Math.max(Pt.thm[2].l[Ft],sn),Xt=Math.max(Pt.thm[3].l[Ft],sn),Yt*Dt<Wt+Xt){var en=Yt*Ut/(Wt+Xt);Wt*=en,Xt*=en}Pt.thm[2].l[Ft]=Math.min(Wt,Pt.thm[2].l[Ft]),Pt.thm[3].l[Ft]=Math.min(Xt,Pt.thm[3].l[Ft])}Kt*=r0.BLKSIZE_s/r0.BLKSIZE;for(var Ft=0;Ft<r0.SBMAX_s;Ft++)for(var Qt=0;Qt<3;Qt++){var Yt,Wt,Xt,sn;if(sn=Pt.ATH.cb_s[Pt.bm_s[Ft]]*Kt,Yt=Math.min(Math.max(Pt.thm[0].s[Ft][Qt],sn),Math.max(Pt.thm[1].s[Ft][Qt],sn)),Wt=Math.max(Pt.thm[2].s[Ft][Qt],sn),Xt=Math.max(Pt.thm[3].s[Ft][Qt],sn),Yt*Dt<Wt+Xt){var en=Yt*Dt/(Wt+Xt);Wt*=en,Xt*=en}Pt.thm[2].s[Ft][Qt]=Math.min(Pt.thm[2].s[Ft][Qt],Wt),Pt.thm[3].s[Ft][Qt]=Math.min(Pt.thm[3].s[Ft][Qt],Xt)}}function jt(Pt,Dt,Lt,Ut,Kt){var Ft,Yt,Wt=0,Xt=0;for(Ft=Yt=0;Ft<r0.SBMAX_s;++Yt,++Ft){for(var sn=Pt.bo_s[Ft],en=Pt.npart_s,Qt=sn<en?sn:en;Yt<Qt;)C0(Dt[Yt]>=0),C0(Lt[Yt]>=0),Wt+=Dt[Yt],Xt+=Lt[Yt],Yt++;if(Pt.en[Ut].s[Ft][Kt]=Wt,Pt.thm[Ut].s[Ft][Kt]=Xt,Yt>=en){++Ft;break}C0(Dt[Yt]>=0),C0(Lt[Yt]>=0);{var ln=Pt.PSY.bo_s_weight[Ft],gn=1-ln;Wt=ln*Dt[Yt],Xt=ln*Lt[Yt],Pt.en[Ut].s[Ft][Kt]+=Wt,Pt.thm[Ut].s[Ft][Kt]+=Xt,Wt=gn*Dt[Yt],Xt=gn*Lt[Yt]}}for(;Ft<r0.SBMAX_s;++Ft)Pt.en[Ut].s[Ft][Kt]=0,Pt.thm[Ut].s[Ft][Kt]=0}function Et(Pt,Dt,Lt,Ut){var Kt,Ft,Yt=0,Wt=0;for(Kt=Ft=0;Kt<r0.SBMAX_l;++Ft,++Kt){for(var Xt=Pt.bo_l[Kt],sn=Pt.npart_l,en=Xt<sn?Xt:sn;Ft<en;)C0(Dt[Ft]>=0),C0(Lt[Ft]>=0),Yt+=Dt[Ft],Wt+=Lt[Ft],Ft++;if(Pt.en[Ut].l[Kt]=Yt,Pt.thm[Ut].l[Kt]=Wt,Ft>=sn){++Kt;break}C0(Dt[Ft]>=0),C0(Lt[Ft]>=0);{var Qt=Pt.PSY.bo_l_weight[Kt],ln=1-Qt;Yt=Qt*Dt[Ft],Wt=Qt*Lt[Ft],Pt.en[Ut].l[Kt]+=Yt,Pt.thm[Ut].l[Kt]+=Wt,Yt=ln*Dt[Ft],Wt=ln*Lt[Ft]}}for(;Kt<r0.SBMAX_l;++Kt)Pt.en[Ut].l[Kt]=0,Pt.thm[Ut].l[Kt]=0}function mt(Pt,Dt,Lt,Ut,Kt,Ft){var Yt=Pt.internal_flags,Wt,Xt;for(Xt=Wt=0;Xt<Yt.npart_s;++Xt){for(var sn=0,en=Yt.numlines_s[Xt],Qt=0;Qt<en;++Qt,++Wt){var ln=Dt[Ft][Wt];sn+=ln}Lt[Xt]=sn}for(C0(Xt==Yt.npart_s),Wt=Xt=0;Xt<Yt.npart_s;Xt++){var gn=Yt.s3ind_s[Xt][0],dn=Yt.s3_ss[Wt++]*Lt[gn];for(++gn;gn<=Yt.s3ind_s[Xt][1];)dn+=Yt.s3_ss[Wt]*Lt[gn],++Wt,++gn;{var Mn=$*Yt.nb_s1[Kt][Xt];Ut[Xt]=Math.min(dn,Mn)}if(Yt.blocktype_old[Kt&1]==r0.SHORT_TYPE){var Mn=_*Yt.nb_s2[Kt][Xt],rn=Ut[Xt];Ut[Xt]=Math.min(Mn,rn)}Yt.nb_s2[Kt][Xt]=Yt.nb_s1[Kt][Xt],Yt.nb_s1[Kt][Xt]=dn,C0(Ut[Xt]>=0)}for(;Xt<=r0.CBANDS;++Xt)Lt[Xt]=0,Ut[Xt]=0}function gt(Pt,Dt,Lt,Ut){var Kt=Pt.internal_flags;Pt.short_blocks==F1.short_block_coupled&&!(Dt[0]!=0&&Dt[1]!=0)&&(Dt[0]=Dt[1]=0);for(var Ft=0;Ft<Kt.channels_out;Ft++)Ut[Ft]=r0.NORM_TYPE,Pt.short_blocks==F1.short_block_dispensed&&(Dt[Ft]=1),Pt.short_blocks==F1.short_block_forced&&(Dt[Ft]=0),Dt[Ft]!=0?(C0(Kt.blocktype_old[Ft]!=r0.START_TYPE),Kt.blocktype_old[Ft]==r0.SHORT_TYPE&&(Ut[Ft]=r0.STOP_TYPE)):(Ut[Ft]=r0.SHORT_TYPE,Kt.blocktype_old[Ft]==r0.NORM_TYPE&&(Kt.blocktype_old[Ft]=r0.START_TYPE),Kt.blocktype_old[Ft]==r0.STOP_TYPE&&(Kt.blocktype_old[Ft]=r0.SHORT_TYPE)),Lt[Ft]=Kt.blocktype_old[Ft],Kt.blocktype_old[Ft]=Ut[Ft]}function ht(Pt,Dt,Lt){return Lt>=1?Pt:Lt<=0?Dt:Dt>0?Math.pow(Pt/Dt,Lt)*Dt:0}var pt=[11.8,13.6,17.2,32,46.5,51.3,57.5,67.1,71.5,84.6,97.6,130];function _t(Pt,Dt){for(var Lt=309.07,Ut=0;Ut<r0.SBMAX_s-1;Ut++)for(var Kt=0;Kt<3;Kt++){var Ft=Pt.thm.s[Ut][Kt];if(Ft>0){var Yt=Ft*Dt,Wt=Pt.en.s[Ut][Kt];Wt>Yt&&(Wt>Yt*1e10?Lt+=pt[Ut]*(10*s):Lt+=pt[Ut]*n1.FAST_LOG10(Wt/Yt))}}return Lt}var Ct=[6.8,5.8,5.8,6.4,6.5,9.9,12.1,14.4,15,18.9,21.6,26.9,34.2,40.2,46.8,56.5,60.7,73.9,85.7,93.4,126.1];function zt(Pt,Dt){for(var Lt=281.0575,Ut=0;Ut<r0.SBMAX_l-1;Ut++){var Kt=Pt.thm.l[Ut];if(Kt>0){var Ft=Kt*Dt,Yt=Pt.en.l[Ut];Yt>Ft&&(Yt>Ft*1e10?Lt+=Ct[Ut]*(10*s):Lt+=Ct[Ut]*n1.FAST_LOG10(Yt/Ft))}}return Lt}function Nt(Pt,Dt,Lt,Ut,Kt){var Ft,Yt;for(Ft=Yt=0;Ft<Pt.npart_l;++Ft){var Wt=0,Xt=0,sn;for(sn=0;sn<Pt.numlines_l[Ft];++sn,++Yt){var en=Dt[Yt];Wt+=en,Xt<en&&(Xt=en)}Lt[Ft]=Wt,Ut[Ft]=Xt,Kt[Ft]=Wt*Pt.rnumlines_l[Ft],C0(Pt.rnumlines_l[Ft]>=0),C0(Lt[Ft]>=0),C0(Ut[Ft]>=0),C0(Kt[Ft]>=0)}}function Ht(Pt,Dt,Lt,Ut){var Kt=ft.length-1,Ft=0,Yt=Lt[Ft]+Lt[Ft+1];if(Yt>0){var Wt=Dt[Ft];Wt<Dt[Ft+1]&&(Wt=Dt[Ft+1]),C0(Pt.numlines_l[Ft]+Pt.numlines_l[Ft+1]-1>0),Yt=20*(Wt*2-Yt)/(Yt*(Pt.numlines_l[Ft]+Pt.numlines_l[Ft+1]-1));var Xt=0|Yt;Xt>Kt&&(Xt=Kt),Ut[Ft]=Xt}else Ut[Ft]=0;for(Ft=1;Ft<Pt.npart_l-1;Ft++)if(Yt=Lt[Ft-1]+Lt[Ft]+Lt[Ft+1],Yt>0){var Wt=Dt[Ft-1];Wt<Dt[Ft]&&(Wt=Dt[Ft]),Wt<Dt[Ft+1]&&(Wt=Dt[Ft+1]),C0(Pt.numlines_l[Ft-1]+Pt.numlines_l[Ft]+Pt.numlines_l[Ft+1]-1>0),Yt=20*(Wt*3-Yt)/(Yt*(Pt.numlines_l[Ft-1]+Pt.numlines_l[Ft]+Pt.numlines_l[Ft+1]-1));var Xt=0|Yt;Xt>Kt&&(Xt=Kt),Ut[Ft]=Xt}else Ut[Ft]=0;if(C0(Ft==Pt.npart_l-1),Yt=Lt[Ft-1]+Lt[Ft],Yt>0){var Wt=Dt[Ft-1];Wt<Dt[Ft]&&(Wt=Dt[Ft]),C0(Pt.numlines_l[Ft-1]+Pt.numlines_l[Ft]-1>0),Yt=20*(Wt*2-Yt)/(Yt*(Pt.numlines_l[Ft-1]+Pt.numlines_l[Ft]-1));var Xt=0|Yt;Xt>Kt&&(Xt=Kt),Ut[Ft]=Xt}else Ut[Ft]=0;C0(Ft==Pt.npart_l-1)}var Jt=[-865163e-23*2,-.00851586*2,-674764e-23*2,.0209036*2,-336639e-22*2,-.0438162*2,-154175e-22*2,.0931738*2,-552212e-22*2,-.313819*2];this.L3psycho_anal_ns=function(Pt,Dt,Lt,Ut,Kt,Ft,Yt,Wt,Xt,sn){var en=Pt.internal_flags,Qt=m1([2,r0.BLKSIZE]),ln=m1([2,3,r0.BLKSIZE_s]),gn=g0(r0.CBANDS+1),dn=g0(r0.CBANDS+1),Mn=g0(r0.CBANDS+2),rn=L1(2),Pn=L1(2),zn,pn,In,hn,jn,pr,En,Bn,Hn=m1([2,576]),yr,Mt=L1(r0.CBANDS+2),Vt=L1(r0.CBANDS+2);for(Za.fill(Vt,0),zn=en.channels_out,Pt.mode==i.JOINT_STEREO&&(zn=4),Pt.VBR==C1.vbr_off?yr=en.ResvMax==0?0:en.ResvSize/en.ResvMax*.5:Pt.VBR==C1.vbr_rh||Pt.VBR==C1.vbr_mtrh||Pt.VBR==C1.vbr_mt?yr=.6:yr=1,pn=0;pn<en.channels_out;pn++){var Gt=Dt[pn],Zt=Lt+576-350-g+192;for(hn=0;hn<576;hn++){var nn,on;for(nn=Gt[Zt+hn+10],on=0,jn=0;jn<(g-1)/2-1;jn+=2)nn+=Jt[jn]*(Gt[Zt+hn+jn]+Gt[Zt+hn+g-jn]),on+=Jt[jn+1]*(Gt[Zt+hn+jn+1]+Gt[Zt+hn+g-jn-1]);Hn[pn][hn]=nn+on}Kt[Ut][pn].en.assign(en.en[pn]),Kt[Ut][pn].thm.assign(en.thm[pn]),zn>2&&(Ft[Ut][pn].en.assign(en.en[pn+2]),Ft[Ut][pn].thm.assign(en.thm[pn+2]))}for(pn=0;pn<zn;pn++){var xn,Cn,$n=g0(12),Vn=[0,0,0,0],Jn=g0(12),Tr=1,Er,an=g0(r0.CBANDS),Xn=g0(r0.CBANDS),Un=[0,0,0,0],Pr=g0(r0.HBLKSIZE),Ir=m1([3,r0.HBLKSIZE_s]);for(C0(en.npart_s<=r0.CBANDS),C0(en.npart_l<=r0.CBANDS),hn=0;hn<3;hn++)$n[hn]=en.nsPsy.last_en_subshort[pn][hn+6],C0(en.nsPsy.last_en_subshort[pn][hn+4]>0),Jn[hn]=$n[hn]/en.nsPsy.last_en_subshort[pn][hn+4],Vn[0]+=$n[hn];if(pn==2)for(hn=0;hn<576;hn++){var Br,Vr;Br=Hn[0][hn],Vr=Hn[1][hn],Hn[0][hn]=Br+Vr,Hn[1][hn]=Br-Vr}{var Zr=Hn[pn&1],Or=0;for(hn=0;hn<9;hn++){for(var Gr=Or+64,Ar=1;Or<Gr;Or++)Ar<Math.abs(Zr[Or])&&(Ar=Math.abs(Zr[Or]));en.nsPsy.last_en_subshort[pn][hn]=$n[hn+3]=Ar,Vn[1+hn/3]+=Ar,Ar>$n[hn+3-2]?(C0($n[hn+3-2]>0),Ar=Ar/$n[hn+3-2]):$n[hn+3-2]>Ar*10?Ar=$n[hn+3-2]/(Ar*10):Ar=0,Jn[hn+3]=Ar}}if(Pt.analysis){var qr=Jn[0];for(hn=1;hn<12;hn++)qr<Jn[hn]&&(qr=Jn[hn]);en.pinfo.ers[Ut][pn]=en.pinfo.ers_save[pn],en.pinfo.ers_save[pn]=qr}for(Er=pn==3?en.nsPsy.attackthre_s:en.nsPsy.attackthre,hn=0;hn<12;hn++)Un[hn/3]==0&&Jn[hn]>Er&&(Un[hn/3]=hn%3+1);for(hn=1;hn<4;hn++){var Wr;Vn[hn-1]>Vn[hn]?(C0(Vn[hn]>0),Wr=Vn[hn-1]/Vn[hn]):(C0(Vn[hn-1]>0),Wr=Vn[hn]/Vn[hn-1]),Wr<1.7&&(Un[hn]=0,hn==1&&(Un[0]=0))}for(Un[0]!=0&&en.nsPsy.lastAttacks[pn]!=0&&(Un[0]=0),(en.nsPsy.lastAttacks[pn]==3||Un[0]+Un[1]+Un[2]+Un[3]!=0)&&(Tr=0,Un[1]!=0&&Un[0]!=0&&(Un[1]=0),Un[2]!=0&&Un[1]!=0&&(Un[2]=0),Un[3]!=0&&Un[2]!=0&&(Un[3]=0)),pn<2?Pn[pn]=Tr:Tr==0&&(Pn[0]=Pn[1]=0),Xt[pn]=en.tot_ener[pn],Cn=ln,xn=Qt,tt(Pt,Pr,Ir,xn,pn&1,Cn,pn&1,Ut,pn,Dt,Lt),Nt(en,Pr,gn,an,Xn),Ht(en,an,Xn,Mt),Bn=0;Bn<3;Bn++){var Jr,kr;for(mt(Pt,Ir,dn,Mn,pn,Bn),jt(en,dn,Mn,pn,Bn),En=0;En<r0.SBMAX_s;En++){if(kr=en.thm[pn].s[En][Bn],kr*=b,Un[Bn]>=2||Un[Bn+1]==1){var Mr=Bn!=0?Bn-1:2,Ar=ht(en.thm[pn].s[En][Mr],kr,a*yr);kr=Math.min(kr,Ar)}if(Un[Bn]==1){var Mr=Bn!=0?Bn-1:2,Ar=ht(en.thm[pn].s[En][Mr],kr,o*yr);kr=Math.min(kr,Ar)}else if(Bn!=0&&Un[Bn-1]==3||Bn==0&&en.nsPsy.lastAttacks[pn]==3){var Mr=Bn!=2?Bn+1:0,Ar=ht(en.thm[pn].s[En][Mr],kr,o*yr);kr=Math.min(kr,Ar)}Jr=$n[Bn*3+3]+$n[Bn*3+4]+$n[Bn*3+5],$n[Bn*3+5]*6<Jr&&(kr*=.5,$n[Bn*3+4]*6<Jr&&(kr*=.5)),en.thm[pn].s[En][Bn]=kr}}for(en.nsPsy.lastAttacks[pn]=Un[2],pr=0,In=0;In<en.npart_l;In++){for(var Dr=en.s3ind[In][0],Xr=gn[Dr]*ft[Mt[Dr]],Cr=en.s3_ll[pr++]*Xr;++Dr<=en.s3ind[In][1];)Xr=gn[Dr]*ft[Mt[Dr]],Cr=Tt(Cr,en.s3_ll[pr++]*Xr,Dr,Dr-In,en);Cr*=.158489319246111,en.blocktype_old[pn&1]==r0.SHORT_TYPE?Mn[In]=Cr:Mn[In]=ht(Math.min(Cr,Math.min(c*en.nb_1[pn][In],h*en.nb_2[pn][In])),Cr,yr),en.nb_2[pn][In]=en.nb_1[pn][In],en.nb_1[pn][In]=Cr}for(;In<=r0.CBANDS;++In)gn[In]=0,Mn[In]=0;Et(en,gn,Mn,pn)}if((Pt.mode==i.STEREO||Pt.mode==i.JOINT_STEREO)&&Pt.interChRatio>0&&At(Pt,Pt.interChRatio),Pt.mode==i.JOINT_STEREO){var Yr;Ot(en),Yr=Pt.msfix,Math.abs(Yr)>0&&It(en,Yr,Pt.ATHlower*en.ATH.adjust)}for(gt(Pt,Pn,sn,rn),pn=0;pn<zn;pn++){var Fr,Nr=0,Ur,zr;pn>1?(Fr=Wt,Nr=-2,Ur=r0.NORM_TYPE,(sn[0]==r0.SHORT_TYPE||sn[1]==r0.SHORT_TYPE)&&(Ur=r0.SHORT_TYPE),zr=Ft[Ut][pn-2]):(Fr=Yt,Nr=0,Ur=sn[pn],zr=Kt[Ut][pn]),Ur==r0.SHORT_TYPE?Fr[Nr+pn]=_t(zr,en.masking_lower):Fr[Nr+pn]=zt(zr,en.masking_lower),Pt.analysis&&(en.pinfo.pe[Ut][pn]=Fr[Nr+pn])}return 0};function un(Pt,Dt,Lt,Ut,Kt,Ft,Yt,Wt){var Xt=Pt.internal_flags;if(Ut<2)e.fft_long(Xt,Yt[Wt],Ut,Dt,Lt);else if(Ut==2)for(var sn=r0.BLKSIZE-1;sn>=0;--sn){var en=Yt[Wt+0][sn],Qt=Yt[Wt+1][sn];Yt[Wt+0][sn]=(en+Qt)*n1.SQRT2*.5,Yt[Wt+1][sn]=(en-Qt)*n1.SQRT2*.5}Ft[0]=Yt[Wt+0][0],Ft[0]*=Ft[0];for(var sn=r0.BLKSIZE/2-1;sn>=0;--sn){var ln=Yt[Wt+0][r0.BLKSIZE/2-sn],gn=Yt[Wt+0][r0.BLKSIZE/2+sn];Ft[r0.BLKSIZE/2-sn]=(ln*ln+gn*gn)*.5}{for(var dn=0,sn=11;sn<r0.HBLKSIZE;sn++)dn+=Ft[sn];Xt.tot_ener[Ut]=dn}if(Pt.analysis){for(var sn=0;sn<r0.HBLKSIZE;sn++)Xt.pinfo.energy[Kt][Ut][sn]=Xt.pinfo.energy_save[Ut][sn],Xt.pinfo.energy_save[Ut][sn]=Ft[sn];Xt.pinfo.pe[Kt][Ut]=Xt.pe[Ut]}}function yn(Pt,Dt,Lt,Ut,Kt,Ft,Yt,Wt){var Xt=Pt.internal_flags;if(Kt==0&&Ut<2&&e.fft_short(Xt,Yt[Wt],Ut,Dt,Lt),Ut==2)for(var sn=r0.BLKSIZE_s-1;sn>=0;--sn){var en=Yt[Wt+0][Kt][sn],Qt=Yt[Wt+1][Kt][sn];Yt[Wt+0][Kt][sn]=(en+Qt)*n1.SQRT2*.5,Yt[Wt+1][Kt][sn]=(en-Qt)*n1.SQRT2*.5}Ft[Kt][0]=Yt[Wt+0][Kt][0],Ft[Kt][0]*=Ft[Kt][0];for(var sn=r0.BLKSIZE_s/2-1;sn>=0;--sn){var ln=Yt[Wt+0][Kt][r0.BLKSIZE_s/2-sn],gn=Yt[Wt+0][Kt][r0.BLKSIZE_s/2+sn];Ft[Kt][r0.BLKSIZE_s/2-sn]=(ln*ln+gn*gn)*.5}}function vn(Pt,Dt,Lt,Ut){var Kt=Pt.internal_flags;Pt.athaa_loudapprox==2&&Lt<2&&(Kt.loudness_sq[Dt][Lt]=Kt.loudness_sq_save[Lt],Kt.loudness_sq_save[Lt]=st(Ut,Kt))}var mn=[-865163e-23*2,-.00851586*2,-674764e-23*2,.0209036*2,-336639e-22*2,-.0438162*2,-154175e-22*2,.0931738*2,-552212e-22*2,-.313819*2];function Tn(Pt,Dt,Lt,Ut,Kt,Ft,Yt,Wt,Xt,sn){for(var en=m1([2,576]),Qt=Pt.internal_flags,ln=Qt.channels_out,gn=Pt.mode==i.JOINT_STEREO?4:ln,dn=0;dn<ln;dn++){firbuf=Dt[dn];for(var Mn=Lt+576-350-g+192,rn=0;rn<576;rn++){var Pn,zn;Pn=firbuf[Mn+rn+10],zn=0;for(var pn=0;pn<(g-1)/2-1;pn+=2)Pn+=mn[pn]*(firbuf[Mn+rn+pn]+firbuf[Mn+rn+g-pn]),zn+=mn[pn+1]*(firbuf[Mn+rn+pn+1]+firbuf[Mn+rn+g-pn-1]);en[dn][rn]=Pn+zn}Kt[Ut][dn].en.assign(Qt.en[dn]),Kt[Ut][dn].thm.assign(Qt.thm[dn]),gn>2&&(Ft[Ut][dn].en.assign(Qt.en[dn+2]),Ft[Ut][dn].thm.assign(Qt.thm[dn+2]))}for(var dn=0;dn<gn;dn++){var In=g0(12),hn=g0(12),jn=[0,0,0,0],pr=en[dn&1],En=0,Bn=dn==3?Qt.nsPsy.attackthre_s:Qt.nsPsy.attackthre,Hn=1;if(dn==2)for(var rn=0,pn=576;pn>0;++rn,--pn){var yr=en[0][rn],Mt=en[1][rn];en[0][rn]=yr+Mt,en[1][rn]=yr-Mt}for(var rn=0;rn<3;rn++)hn[rn]=Qt.nsPsy.last_en_subshort[dn][rn+6],C0(Qt.nsPsy.last_en_subshort[dn][rn+4]>0),In[rn]=hn[rn]/Qt.nsPsy.last_en_subshort[dn][rn+4],jn[0]+=hn[rn];for(var rn=0;rn<9;rn++){for(var Vt=En+64,Gt=1;En<Vt;En++)Gt<Math.abs(pr[En])&&(Gt=Math.abs(pr[En]));Qt.nsPsy.last_en_subshort[dn][rn]=hn[rn+3]=Gt,jn[1+rn/3]+=Gt,Gt>hn[rn+3-2]?(C0(hn[rn+3-2]>0),Gt=Gt/hn[rn+3-2]):hn[rn+3-2]>Gt*10?Gt=hn[rn+3-2]/(Gt*10):Gt=0,In[rn+3]=Gt}for(var rn=0;rn<3;++rn){var Zt=hn[rn*3+3]+hn[rn*3+4]+hn[rn*3+5],nn=1;hn[rn*3+5]*6<Zt&&(nn*=.5,hn[rn*3+4]*6<Zt&&(nn*=.5)),Wt[dn][rn]=nn}if(Pt.analysis){for(var on=In[0],rn=1;rn<12;rn++)on<In[rn]&&(on=In[rn]);Qt.pinfo.ers[Ut][dn]=Qt.pinfo.ers_save[dn],Qt.pinfo.ers_save[dn]=on}for(var rn=0;rn<12;rn++)Xt[dn][rn/3]==0&&In[rn]>Bn&&(Xt[dn][rn/3]=rn%3+1);for(var rn=1;rn<4;rn++){var xn=jn[rn-1],Cn=jn[rn],$n=Math.max(xn,Cn);$n<4e4&&xn<1.7*Cn&&Cn<1.7*xn&&(rn==1&&Xt[dn][0]<=Xt[dn][rn]&&(Xt[dn][0]=0),Xt[dn][rn]=0)}Xt[dn][0]<=Qt.nsPsy.lastAttacks[dn]&&(Xt[dn][0]=0),(Qt.nsPsy.lastAttacks[dn]==3||Xt[dn][0]+Xt[dn][1]+Xt[dn][2]+Xt[dn][3]!=0)&&(Hn=0,Xt[dn][1]!=0&&Xt[dn][0]!=0&&(Xt[dn][1]=0),Xt[dn][2]!=0&&Xt[dn][1]!=0&&(Xt[dn][2]=0),Xt[dn][3]!=0&&Xt[dn][2]!=0&&(Xt[dn][3]=0)),dn<2?sn[dn]=Hn:Hn==0&&(sn[0]=sn[1]=0),Yt[dn]=Qt.tot_ener[dn]}}function kn(Pt,Dt,Lt){if(Lt==0)for(var Ut=0;Ut<Pt.npart_s;Ut++)Pt.nb_s2[Dt][Ut]=Pt.nb_s1[Dt][Ut],Pt.nb_s1[Dt][Ut]=0}function Gn(Pt,Dt){for(var Lt=0;Lt<Pt.npart_l;Lt++)Pt.nb_2[Dt][Lt]=Pt.nb_1[Dt][Lt],Pt.nb_1[Dt][Lt]=0}function wr(Pt,Dt,Lt,Ut){var Kt=ft.length-1,Ft=0,Yt=Lt[Ft]+Lt[Ft+1];if(Yt>0){var Wt=Dt[Ft];Wt<Dt[Ft+1]&&(Wt=Dt[Ft+1]),C0(Pt.numlines_s[Ft]+Pt.numlines_s[Ft+1]-1>0),Yt=20*(Wt*2-Yt)/(Yt*(Pt.numlines_s[Ft]+Pt.numlines_s[Ft+1]-1));var Xt=0|Yt;Xt>Kt&&(Xt=Kt),Ut[Ft]=Xt}else Ut[Ft]=0;for(Ft=1;Ft<Pt.npart_s-1;Ft++)if(Yt=Lt[Ft-1]+Lt[Ft]+Lt[Ft+1],C0(Ft+1<Pt.npart_s),Yt>0){var Wt=Dt[Ft-1];Wt<Dt[Ft]&&(Wt=Dt[Ft]),Wt<Dt[Ft+1]&&(Wt=Dt[Ft+1]),C0(Pt.numlines_s[Ft-1]+Pt.numlines_s[Ft]+Pt.numlines_s[Ft+1]-1>0),Yt=20*(Wt*3-Yt)/(Yt*(Pt.numlines_s[Ft-1]+Pt.numlines_s[Ft]+Pt.numlines_s[Ft+1]-1));var Xt=0|Yt;Xt>Kt&&(Xt=Kt),Ut[Ft]=Xt}else Ut[Ft]=0;if(C0(Ft==Pt.npart_s-1),Yt=Lt[Ft-1]+Lt[Ft],Yt>0){var Wt=Dt[Ft-1];Wt<Dt[Ft]&&(Wt=Dt[Ft]),C0(Pt.numlines_s[Ft-1]+Pt.numlines_s[Ft]-1>0),Yt=20*(Wt*2-Yt)/(Yt*(Pt.numlines_s[Ft-1]+Pt.numlines_s[Ft]-1));var Xt=0|Yt;Xt>Kt&&(Xt=Kt),Ut[Ft]=Xt}else Ut[Ft]=0;C0(Ft==Pt.npart_s-1)}function xt(Pt,Dt,Lt,Ut,Kt,Ft){var Yt=Pt.internal_flags,Wt=new float[r0.CBANDS],Xt=g0(r0.CBANDS),sn,en,Qt,ln=new int[r0.CBANDS];for(Qt=en=0;Qt<Yt.npart_s;++Qt){var gn=0,dn=0,Mn=Yt.numlines_s[Qt];for(sn=0;sn<Mn;++sn,++en){var rn=Dt[Ft][en];gn+=rn,dn<rn&&(dn=rn)}Lt[Qt]=gn,Wt[Qt]=dn,Xt[Qt]=gn/Mn,C0(Xt[Qt]>=0)}for(C0(Qt==Yt.npart_s);Qt<r0.CBANDS;++Qt)Wt[Qt]=0,Xt[Qt]=0;for(wr(Yt,Wt,Xt,ln),en=Qt=0;Qt<Yt.npart_s;Qt++){var Pn=Yt.s3ind_s[Qt][0],zn=Yt.s3ind_s[Qt][1],pn,In,hn,jn,pr;for(pn=ln[Pn],In=1,jn=Yt.s3_ss[en]*Lt[Pn]*ft[ln[Pn]],++en,++Pn;Pn<=zn;)pn+=ln[Pn],In+=1,hn=Yt.s3_ss[en]*Lt[Pn]*ft[ln[Pn]],jn=$t(jn,hn,Pn-Qt),++en,++Pn;pn=(1+2*pn)/(2*In),pr=ft[pn]*.5,jn*=pr,Ut[Qt]=jn,Yt.nb_s2[Kt][Qt]=Yt.nb_s1[Kt][Qt],Yt.nb_s1[Kt][Qt]=jn,hn=Wt[Qt],hn*=Yt.minval_s[Qt],hn*=pr,Ut[Qt]>hn&&(Ut[Qt]=hn),Yt.masking_lower>1&&(Ut[Qt]*=Yt.masking_lower),Ut[Qt]>Lt[Qt]&&(Ut[Qt]=Lt[Qt]),Yt.masking_lower<1&&(Ut[Qt]*=Yt.masking_lower),C0(Ut[Qt]>=0)}for(;Qt<r0.CBANDS;++Qt)Lt[Qt]=0,Ut[Qt]=0}function kt(Pt,Dt,Lt,Ut,Kt){var Ft=g0(r0.CBANDS),Yt=g0(r0.CBANDS),Wt=L1(r0.CBANDS+2),Xt;Nt(Pt,Dt,Lt,Ft,Yt),Ht(Pt,Ft,Yt,Wt);var sn=0;for(Xt=0;Xt<Pt.npart_l;Xt++){var en,Qt,ln,gn,dn=Pt.s3ind[Xt][0],Mn=Pt.s3ind[Xt][1],rn=0,Pn=0;for(rn=Wt[dn],Pn+=1,Qt=Pt.s3_ll[sn]*Lt[dn]*ft[Wt[dn]],++sn,++dn;dn<=Mn;)rn+=Wt[dn],Pn+=1,en=Pt.s3_ll[sn]*Lt[dn]*ft[Wt[dn]],gn=$t(Qt,en,dn-Xt),Qt=gn,++sn,++dn;if(rn=(1+2*rn)/(2*Pn),ln=ft[rn]*.5,Qt*=ln,Pt.blocktype_old[Kt&1]==r0.SHORT_TYPE){var zn=c*Pt.nb_1[Kt][Xt];zn>0?Ut[Xt]=Math.min(Qt,zn):Ut[Xt]=Math.min(Qt,Lt[Xt]*o)}else{var pn=h*Pt.nb_2[Kt][Xt],In=c*Pt.nb_1[Kt][Xt],zn;pn<=0&&(pn=Qt),In<=0&&(In=Qt),Pt.blocktype_old[Kt&1]==r0.NORM_TYPE?zn=Math.min(In,pn):zn=In,Ut[Xt]=Math.min(Qt,zn)}Pt.nb_2[Kt][Xt]=Pt.nb_1[Kt][Xt],Pt.nb_1[Kt][Xt]=Qt,en=Ft[Xt],en*=Pt.minval_l[Xt],en*=ln,Ut[Xt]>en&&(Ut[Xt]=en),Pt.masking_lower>1&&(Ut[Xt]*=Pt.masking_lower),Ut[Xt]>Lt[Xt]&&(Ut[Xt]=Lt[Xt]),Pt.masking_lower<1&&(Ut[Xt]*=Pt.masking_lower),C0(Ut[Xt]>=0)}for(;Xt<r0.CBANDS;++Xt)Lt[Xt]=0,Ut[Xt]=0}function wn(Pt,Dt){var Lt=Pt.internal_flags;Pt.short_blocks==F1.short_block_coupled&&!(Dt[0]!=0&&Dt[1]!=0)&&(Dt[0]=Dt[1]=0);for(var Ut=0;Ut<Lt.channels_out;Ut++)Pt.short_blocks==F1.short_block_dispensed&&(Dt[Ut]=1),Pt.short_blocks==F1.short_block_forced&&(Dt[Ut]=0)}function bn(Pt,Dt,Lt){for(var Ut=Pt.internal_flags,Kt=0;Kt<Ut.channels_out;Kt++){var Ft=r0.NORM_TYPE;Dt[Kt]!=0?(C0(Ut.blocktype_old[Kt]!=r0.START_TYPE),Ut.blocktype_old[Kt]==r0.SHORT_TYPE&&(Ft=r0.STOP_TYPE)):(Ft=r0.SHORT_TYPE,Ut.blocktype_old[Kt]==r0.NORM_TYPE&&(Ut.blocktype_old[Kt]=r0.START_TYPE),Ut.blocktype_old[Kt]==r0.STOP_TYPE&&(Ut.blocktype_old[Kt]=r0.SHORT_TYPE)),Lt[Kt]=Ut.blocktype_old[Kt],Ut.blocktype_old[Kt]=Ft}}function Dn(Pt,Dt,Lt,Ut,Kt,Ft,Yt){for(var Wt=Ft*2,Xt=Ft>0?Math.pow(10,Kt):1,sn,en,Qt=0;Qt<Yt;++Qt){var ln=Pt[2][Qt],gn=Pt[3][Qt],dn=Dt[0][Qt],Mn=Dt[1][Qt],rn=Dt[2][Qt],Pn=Dt[3][Qt];if(dn<=1.58*Mn&&Mn<=1.58*dn){var zn=Lt[Qt]*gn,pn=Lt[Qt]*ln;en=Math.max(rn,Math.min(Pn,zn)),sn=Math.max(Pn,Math.min(rn,pn))}else en=rn,sn=Pn;if(Ft>0){var In,hn,jn=Ut[Qt]*Xt;if(In=Math.min(Math.max(dn,jn),Math.max(Mn,jn)),rn=Math.max(en,jn),Pn=Math.max(sn,jn),hn=rn+Pn,hn>0&&In*Wt<hn){var pr=In*Wt/hn;rn*=pr,Pn*=pr}en=Math.min(rn,en),sn=Math.min(Pn,sn)}en>ln&&(en=ln),sn>gn&&(sn=gn),Dt[2][Qt]=en,Dt[3][Qt]=sn}}this.L3psycho_anal_vbr=function(Pt,Dt,Lt,Ut,Kt,Ft,Yt,Wt,Xt,sn){var en=Pt.internal_flags,Qt,ln,gn=g0(r0.HBLKSIZE),dn=m1([3,r0.HBLKSIZE_s]),Mn=m1([2,r0.BLKSIZE]),rn=m1([2,3,r0.BLKSIZE_s]),Pn=m1([4,r0.CBANDS]),zn=m1([4,r0.CBANDS]),pn=m1([4,3]),In=.6,hn=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],jn=L1(2),pr=Pt.mode==i.JOINT_STEREO?4:en.channels_out;Tn(Pt,Dt,Lt,Ut,Kt,Ft,Xt,pn,hn,jn),wn(Pt,jn);{for(var En=0;En<pr;En++){var Bn=En&1;Qt=Mn,un(Pt,Dt,Lt,En,Ut,gn,Qt,Bn),vn(Pt,Ut,En,gn),jn[Bn]!=0?kt(en,gn,Pn[En],zn[En],En):Gn(en,En)}jn[0]+jn[1]==2&&Pt.mode==i.JOINT_STEREO&&Dn(Pn,zn,en.mld_cb_l,en.ATH.cb_l,Pt.ATHlower*en.ATH.adjust,Pt.msfix,en.npart_l);for(var En=0;En<pr;En++){var Bn=En&1;jn[Bn]!=0&&Et(en,Pn[En],zn[En],En)}}{for(var Hn=0;Hn<3;Hn++){for(var En=0;En<pr;++En){var Bn=En&1;jn[Bn]!=0?kn(en,En,Hn):(ln=rn,yn(Pt,Dt,Lt,En,Hn,dn,ln,Bn),xt(Pt,dn,Pn[En],zn[En],En,Hn))}jn[0]+jn[1]==0&&Pt.mode==i.JOINT_STEREO&&Dn(Pn,zn,en.mld_cb_s,en.ATH.cb_s,Pt.ATHlower*en.ATH.adjust,Pt.msfix,en.npart_s);for(var En=0;En<pr;++En){var Bn=En&1;jn[Bn]==0&&jt(en,Pn[En],zn[En],En,Hn)}}for(var En=0;En<pr;En++){var Bn=En&1;if(jn[Bn]==0)for(var yr=0;yr<r0.SBMAX_s;yr++){for(var Mt=g0(3),Hn=0;Hn<3;Hn++){var Vt=en.thm[En].s[yr][Hn];if(Vt*=b,hn[En][Hn]>=2||hn[En][Hn+1]==1){var Gt=Hn!=0?Hn-1:2,Zt=ht(en.thm[En].s[yr][Gt],Vt,a*In);Vt=Math.min(Vt,Zt)}else if(hn[En][Hn]==1){var Gt=Hn!=0?Hn-1:2,Zt=ht(en.thm[En].s[yr][Gt],Vt,o*In);Vt=Math.min(Vt,Zt)}else if(Hn!=0&&hn[En][Hn-1]==3||Hn==0&&en.nsPsy.lastAttacks[En]==3){var Gt=Hn!=2?Hn+1:0,Zt=ht(en.thm[En].s[yr][Gt],Vt,o*In);Vt=Math.min(Vt,Zt)}Vt*=pn[En][Hn],Mt[Hn]=Vt}for(var Hn=0;Hn<3;Hn++)en.thm[En].s[yr][Hn]=Mt[Hn]}}}for(var En=0;En<pr;En++)en.nsPsy.lastAttacks[En]=hn[En][2];bn(Pt,jn,sn);for(var En=0;En<pr;En++){var nn,on,xn,Cn;En>1?(nn=Wt,on=-2,xn=r0.NORM_TYPE,(sn[0]==r0.SHORT_TYPE||sn[1]==r0.SHORT_TYPE)&&(xn=r0.SHORT_TYPE),Cn=Ft[Ut][En-2]):(nn=Yt,on=0,xn=sn[En],Cn=Kt[Ut][En]),xn==r0.SHORT_TYPE?nn[on+En]=_t(Cn,en.masking_lower):nn[on+En]=zt(Cn,en.masking_lower),Pt.analysis&&(en.pinfo.pe[Ut][En]=nn[on+En])}return 0};function Rn(Pt,Dt){var Lt=Pt,Ut;return Lt>=0?Ut=-Lt*27:Ut=Lt*Dt,Ut<=-72?0:Math.exp(Ut*rt)}function _n(Pt){var Dt=0,Lt=0;{var Ut=0,Kt,Ft;for(Ut=0;Rn(Ut,Pt)>1e-20;Ut-=1);for(Kt=Ut,Ft=0;Math.abs(Ft-Kt)>1e-12;)Ut=(Ft+Kt)/2,Rn(Ut,Pt)>0?Ft=Ut:Kt=Ut;Dt=Kt}{var Ut=0,Kt,Ft;for(Ut=0;Rn(Ut,Pt)>1e-20;Ut+=1);for(Kt=0,Ft=Ut;Math.abs(Ft-Kt)>1e-12;)Ut=(Ft+Kt)/2,Rn(Ut,Pt)>0?Kt=Ut:Ft=Ut;Lt=Ft}{var Yt=0,Wt=1e3,Xt;for(Xt=0;Xt<=Wt;++Xt){var Ut=Dt+Xt*(Lt-Dt)/Wt,sn=Rn(Ut,Pt);Yt+=sn}{var en=(Wt+1)/(Yt*(Lt-Dt));return en}}}function On(Pt){var Dt,Lt,Ut,Kt;return Dt=Pt,Dt>=0?Dt*=3:Dt*=1.5,Dt>=.5&&Dt<=2.5?(Kt=Dt-.5,Lt=8*(Kt*Kt-2*Kt)):Lt=0,Dt+=.474,Ut=15.811389+7.5*Dt-17.5*Math.sqrt(1+Dt*Dt),Ut<=-60?0:(Dt=Math.exp((Lt+Ut)*rt),Dt/=.6609193,Dt)}function Ln(Pt){return Pt<0&&(Pt=0),Pt=Pt*.001,13*Math.atan(.76*Pt)+3.5*Math.atan(Pt*Pt/(7.5*7.5))}function Nn(Pt,Dt,Lt,Ut,Kt,Ft,Yt,Wt,Xt,sn,en,Qt){var ln=g0(r0.CBANDS+1),gn=Wt/(Qt>15?2*576:2*192),dn=L1(r0.HBLKSIZE),Mn;Wt/=Xt;var rn=0,Pn=0;for(Mn=0;Mn<r0.CBANDS;Mn++){var zn,pn;for(zn=Ln(Wt*rn),ln[Mn]=Wt*rn,pn=rn;Ln(Wt*pn)-zn<j&&pn<=Xt/2;pn++);for(Pt[Mn]=pn-rn,Pn=Mn+1;rn<pn;)C0(rn<r0.HBLKSIZE),dn[rn++]=Mn;if(rn>Xt/2){rn=Xt/2,++Mn;break}}C0(Mn<r0.CBANDS),ln[Mn]=Wt*rn;for(var In=0;In<Qt;In++){var hn,jn,pr,En,Bn;pr=sn[In],En=sn[In+1],hn=0|Math.floor(.5+en*(pr-.5)),hn<0&&(hn=0),jn=0|Math.floor(.5+en*(En-.5)),jn>Xt/2&&(jn=Xt/2),Lt[In]=(dn[hn]+dn[jn])/2,Dt[In]=dn[jn];var Hn=gn*En;Yt[In]=(Hn-ln[Dt[In]])/(ln[Dt[In]+1]-ln[Dt[In]]),Yt[In]<0?Yt[In]=0:Yt[In]>1&&(Yt[In]=1),Bn=Ln(Wt*sn[In]*en),Bn=Math.min(Bn,15.5)/15.5,Ft[In]=Math.pow(10,1.25*(1-Math.cos(Math.PI*Bn))-2.5)}rn=0;for(var yr=0;yr<Pn;yr++){var Mt=Pt[yr],zn,Vt;zn=Ln(Wt*rn),Vt=Ln(Wt*(rn+Mt-1)),Ut[yr]=.5*(zn+Vt),zn=Ln(Wt*(rn-.5)),Vt=Ln(Wt*(rn+Mt-.5)),Kt[yr]=Vt-zn,rn+=Mt}return Pn}function Sn(Pt,Dt,Lt,Ut,Kt,Ft){var Yt=m1([r0.CBANDS,r0.CBANDS]),Wt,Xt=0;if(Ft)for(var sn=0;sn<Dt;sn++)for(Wt=0;Wt<Dt;Wt++){var en=On(Lt[sn]-Lt[Wt])*Ut[Wt];Yt[sn][Wt]=en*Kt[sn]}else for(Wt=0;Wt<Dt;Wt++)for(var Qt=15+Math.min(21/Lt[Wt],12),ln=_n(Qt),sn=0;sn<Dt;sn++){var en=ln*Rn(Lt[sn]-Lt[Wt],Qt)*Ut[Wt];Yt[sn][Wt]=en*Kt[sn]}for(var sn=0;sn<Dt;sn++){for(Wt=0;Wt<Dt&&!(Yt[sn][Wt]>0);Wt++);for(Pt[sn][0]=Wt,Wt=Dt-1;Wt>0&&!(Yt[sn][Wt]>0);Wt--);Pt[sn][1]=Wt,Xt+=Pt[sn][1]-Pt[sn][0]+1}for(var gn=g0(Xt),dn=0,sn=0;sn<Dt;sn++)for(Wt=Pt[sn][0];Wt<=Pt[sn][1];Wt++)gn[dn++]=Yt[sn][Wt];return gn}function qn(Pt){var Dt=Ln(Pt);return Dt=Math.min(Dt,15.5)/15.5,Math.pow(10,1.25*(1-Math.cos(Math.PI*Dt))-2.5)}this.psymodel_init=function(Pt){var Dt=Pt.internal_flags,Lt,Ut=!0,Kt=13,Ft=24,Yt=0,Wt=0,Xt=-8.25,sn=-4.5,en=g0(r0.CBANDS),Qt=g0(r0.CBANDS),ln=g0(r0.CBANDS),gn=Pt.out_samplerate;switch(Pt.experimentalZ){default:case 0:Ut=!0;break;case 1:Ut=!(Pt.VBR==C1.vbr_mtrh||Pt.VBR==C1.vbr_mt);break;case 2:Ut=!1;break;case 3:Kt=8,Yt=-1.75,Wt=-.0125,Xt=-8.25,sn=-2.25;break}for(Dt.ms_ener_ratio_old=.25,Dt.blocktype_old[0]=Dt.blocktype_old[1]=r0.NORM_TYPE,Lt=0;Lt<4;++Lt){for(var rn=0;rn<r0.CBANDS;++rn)Dt.nb_1[Lt][rn]=1e20,Dt.nb_2[Lt][rn]=1e20,Dt.nb_s1[Lt][rn]=Dt.nb_s2[Lt][rn]=1;for(var dn=0;dn<r0.SBMAX_l;dn++)Dt.en[Lt].l[dn]=1e20,Dt.thm[Lt].l[dn]=1e20;for(var rn=0;rn<3;++rn){for(var dn=0;dn<r0.SBMAX_s;dn++)Dt.en[Lt].s[dn][rn]=1e20,Dt.thm[Lt].s[dn][rn]=1e20;Dt.nsPsy.lastAttacks[Lt]=0}for(var rn=0;rn<9;rn++)Dt.nsPsy.last_en_subshort[Lt][rn]=10}for(Dt.loudness_sq_save[0]=Dt.loudness_sq_save[1]=0,Dt.npart_l=Nn(Dt.numlines_l,Dt.bo_l,Dt.bm_l,en,Qt,Dt.mld_l,Dt.PSY.bo_l_weight,gn,r0.BLKSIZE,Dt.scalefac_band.l,r0.BLKSIZE/(2*576),r0.SBMAX_l),C0(Dt.npart_l<r0.CBANDS),Lt=0;Lt<Dt.npart_l;Lt++){var Mn=Yt;en[Lt]>=Kt&&(Mn=Wt*(en[Lt]-Kt)/(Ft-Kt)+Yt*(Ft-en[Lt])/(Ft-Kt)),ln[Lt]=Math.pow(10,Mn/10),Dt.numlines_l[Lt]>0?Dt.rnumlines_l[Lt]=1/Dt.numlines_l[Lt]:Dt.rnumlines_l[Lt]=0}Dt.s3_ll=Sn(Dt.s3ind,Dt.npart_l,en,Qt,ln,Ut);var rn=0;for(Lt=0;Lt<Dt.npart_l;Lt++){var Pn;Pn=Ue.MAX_VALUE;for(var zn=0;zn<Dt.numlines_l[Lt];zn++,rn++){var pn=gn*rn/(1e3*r0.BLKSIZE),In;In=this.ATHformula(pn*1e3,Pt)-20,In=Math.pow(10,.1*In),In*=Dt.numlines_l[Lt],Pn>In&&(Pn=In)}Dt.ATH.cb_l[Lt]=Pn,Pn=-20+en[Lt]*20/10,Pn>6&&(Pn=100),Pn<-15&&(Pn=-15),Pn-=8,Dt.minval_l[Lt]=Math.pow(10,Pn/10)*Dt.numlines_l[Lt]}for(Dt.npart_s=Nn(Dt.numlines_s,Dt.bo_s,Dt.bm_s,en,Qt,Dt.mld_s,Dt.PSY.bo_s_weight,gn,r0.BLKSIZE_s,Dt.scalefac_band.s,r0.BLKSIZE_s/(2*192),r0.SBMAX_s),C0(Dt.npart_s<r0.CBANDS),rn=0,Lt=0;Lt<Dt.npart_s;Lt++){var Pn,Mn=Xt;en[Lt]>=Kt&&(Mn=sn*(en[Lt]-Kt)/(Ft-Kt)+Xt*(Ft-en[Lt])/(Ft-Kt)),ln[Lt]=Math.pow(10,Mn/10),Pn=Ue.MAX_VALUE;for(var zn=0;zn<Dt.numlines_s[Lt];zn++,rn++){var pn=gn*rn/(1e3*r0.BLKSIZE_s),In;In=this.ATHformula(pn*1e3,Pt)-20,In=Math.pow(10,.1*In),In*=Dt.numlines_s[Lt],Pn>In&&(Pn=In)}Dt.ATH.cb_s[Lt]=Pn,Pn=-7+en[Lt]*7/12,en[Lt]>12&&(Pn*=1+Math.log(1+Pn)*3.1),en[Lt]<12&&(Pn*=1+Math.log(1-Pn)*2.3),Pn<-15&&(Pn=-15),Pn-=8,Dt.minval_s[Lt]=Math.pow(10,Pn/10)*Dt.numlines_s[Lt]}Dt.s3_ss=Sn(Dt.s3ind_s,Dt.npart_s,en,Qt,ln,Ut),dt(),e.init_fft(Dt),Dt.decay=Math.exp(-1*s/(et*gn/192));{var hn;hn=d,Pt.exp_nspsytune&2&&(hn=1),Math.abs(Pt.msfix)>0&&(hn=Pt.msfix),Pt.msfix=hn;for(var jn=0;jn<Dt.npart_l;jn++)Dt.s3ind[jn][1]>Dt.npart_l-1&&(Dt.s3ind[jn][1]=Dt.npart_l-1)}var pr=576*Dt.mode_gr/gn;if(Dt.ATH.decay=Math.pow(10,-12/10*pr),Dt.ATH.adjust=.01,Dt.ATH.adjustLimit=1,C0(Dt.bo_l[r0.SBMAX_l-1]<=Dt.npart_l),C0(Dt.bo_s[r0.SBMAX_s-1]<=Dt.npart_s),Pt.ATHtype!=-1){var pn,En=Pt.out_samplerate/r0.BLKSIZE,Bn=0;for(pn=0,Lt=0;Lt<r0.BLKSIZE/2;++Lt)pn+=En,Dt.ATH.eql_w[Lt]=1/Math.pow(10,this.ATHformula(pn,Pt)/10),Bn+=Dt.ATH.eql_w[Lt];for(Bn=1/Bn,Lt=r0.BLKSIZE/2;--Lt>=0;)Dt.ATH.eql_w[Lt]*=Bn}{for(var jn=rn=0;jn<Dt.npart_s;++jn)for(Lt=0;Lt<Dt.numlines_s[jn];++Lt)++rn;for(var jn=rn=0;jn<Dt.npart_l;++jn)for(Lt=0;Lt<Dt.numlines_l[jn];++Lt)++rn}for(rn=0,Lt=0;Lt<Dt.npart_l;Lt++){var pn=gn*(rn+Dt.numlines_l[Lt]/2)/(1*r0.BLKSIZE);Dt.mld_cb_l[Lt]=qn(pn),rn+=Dt.numlines_l[Lt]}for(;Lt<r0.CBANDS;++Lt)Dt.mld_cb_l[Lt]=1;for(rn=0,Lt=0;Lt<Dt.npart_s;Lt++){var pn=gn*(rn+Dt.numlines_s[Lt]/2)/(1*r0.BLKSIZE_s);Dt.mld_cb_s[Lt]=qn(pn),rn+=Dt.numlines_s[Lt]}for(;Lt<r0.CBANDS;++Lt)Dt.mld_cb_s[Lt]=1;return 0};function gr(Pt,Dt){Pt<-.3&&(Pt=3410),Pt/=1e3,Pt=Math.max(.1,Pt);var Lt=3.64*Math.pow(Pt,-.8)-6.8*Math.exp(-.6*Math.pow(Pt-3.4,2))+6*Math.exp(-.15*Math.pow(Pt-8.7,2))+(.6+.04*Dt)*.001*Math.pow(Pt,4);return Lt}this.ATHformula=function(Pt,Dt){var Lt;switch(Dt.ATHtype){case 0:Lt=gr(Pt,9);break;case 1:Lt=gr(Pt,-1);break;case 2:Lt=gr(Pt,0);break;case 3:Lt=gr(Pt,1)+6;break;case 4:Lt=gr(Pt,Dt.ATHcurve);break;default:Lt=gr(Pt,0);break}return Lt}}var Qa=Ua,Wa=j1;function ja(){this.class_id=0,this.num_samples=0,this.num_channels=0,this.in_samplerate=0,this.out_samplerate=0,this.scale=0,this.scale_left=0,this.scale_right=0,this.analysis=!1,this.bWriteVbrTag=!1,this.decode_only=!1,this.quality=0,this.mode=Wa.STEREO,this.force_ms=!1,this.free_format=!1,this.findReplayGain=!1,this.decode_on_the_fly=!1,this.write_id3tag_automatic=!1,this.brate=0,this.compression_ratio=0,this.copyright=0,this.original=0,this.extension=0,this.emphasis=0,this.error_protection=0,this.strict_ISO=!1,this.disable_reservoir=!1,this.quant_comp=0,this.quant_comp_short=0,this.experimentalY=!1,this.experimentalZ=0,this.exp_nspsytune=0,this.preset=0,this.VBR=null,this.VBR_q_frac=0,this.VBR_q=0,this.VBR_mean_bitrate_kbps=0,this.VBR_min_bitrate_kbps=0,this.VBR_max_bitrate_kbps=0,this.VBR_hard_min=0,this.lowpassfreq=0,this.highpassfreq=0,this.lowpasswidth=0,this.highpasswidth=0,this.maskingadjust=0,this.maskingadjust_short=0,this.ATHonly=!1,this.ATHshort=!1,this.noATH=!1,this.ATHtype=0,this.ATHcurve=0,this.ATHlower=0,this.athaa_type=0,this.athaa_loudapprox=0,this.athaa_sensitivity=0,this.short_blocks=null,this.useTemporal=!1,this.interChRatio=0,this.msfix=0,this.tune=!1,this.tune_value_a=0,this.version=0,this.encoder_delay=0,this.encoder_padding=0,this.framesize=0,this.frameNum=0,this.lame_allocated_gfp=0,this.internal_flags=null}var za=ja,Ja=t1(),Ta={};Ta.SFBMAX=Ja.SBMAX_s*3;var ie=Ta,ya=Q0,ga=ya.new_float,N1=ya.new_int,Re=ie;function e2(){this.xr=ga(576),this.l3_enc=N1(576),this.scalefac=N1(Re.SFBMAX),this.xrpow_max=0,this.part2_3_length=0,this.big_values=0,this.count1=0,this.global_gain=0,this.scalefac_compress=0,this.block_type=0,this.mixed_block_flag=0,this.table_select=N1(3),this.subblock_gain=N1(4),this.region0_count=0,this.region1_count=0,this.preflag=0,this.scalefac_scale=0,this.count1table_select=0,this.part2_length=0,this.sfb_lmax=0,this.sfb_smin=0,this.psy_lmax=0,this.sfbmax=0,this.psymax=0,this.sfbdivide=0,this.width=N1(Re.SFBMAX),this.window=N1(Re.SFBMAX),this.count1bits=0,this.sfb_partition_table=null,this.slen=N1(4),this.max_nonzero_coeff=0;var i=this;function e(c){return new Int32Array(c)}function s(c){return new Float32Array(c)}this.assign=function(c){i.xr=s(c.xr),i.l3_enc=e(c.l3_enc),i.scalefac=e(c.scalefac),i.xrpow_max=c.xrpow_max,i.part2_3_length=c.part2_3_length,i.big_values=c.big_values,i.count1=c.count1,i.global_gain=c.global_gain,i.scalefac_compress=c.scalefac_compress,i.block_type=c.block_type,i.mixed_block_flag=c.mixed_block_flag,i.table_select=e(c.table_select),i.subblock_gain=e(c.subblock_gain),i.region0_count=c.region0_count,i.region1_count=c.region1_count,i.preflag=c.preflag,i.scalefac_scale=c.scalefac_scale,i.count1table_select=c.count1table_select,i.part2_length=c.part2_length,i.sfb_lmax=c.sfb_lmax,i.sfb_smin=c.sfb_smin,i.psy_lmax=c.psy_lmax,i.sfbmax=c.sfbmax,i.psymax=c.psymax,i.sfbdivide=c.sfbdivide,i.width=e(c.width),i.window=e(c.window),i.count1bits=c.count1bits,i.sfb_partition_table=c.sfb_partition_table.slice(0),i.slen=e(c.slen),i.max_nonzero_coeff=c.max_nonzero_coeff}}var Le=e2,a2=Q0,Qe=a2.new_int,r2=Le;function t2(){this.tt=[[null,null],[null,null]],this.main_data_begin=0,this.private_bits=0,this.resvDrain_pre=0,this.resvDrain_post=0,this.scfsi=[Qe(4),Qe(4)];for(var i=0;i<2;i++)for(var e=0;e<2;e++)this.tt[i][e]=new r2}var s2=t2,wa=Q0,g1=wa.System,ee=wa.new_int,ae=t1();function i2(i,e,s,c){this.l=ee(1+ae.SBMAX_l),this.s=ee(1+ae.SBMAX_s),this.psfb21=ee(1+ae.PSFB21),this.psfb12=ee(1+ae.PSFB12);var h=this.l,$=this.s;arguments.length==4&&(this.arrL=arguments[0],this.arrS=arguments[1],this.arr21=arguments[2],this.arr12=arguments[3],g1.arraycopy(this.arrL,0,h,0,Math.min(this.arrL.length,this.l.length)),g1.arraycopy(this.arrS,0,$,0,Math.min(this.arrS.length,this.s.length)),g1.arraycopy(this.arr21,0,this.psfb21,0,Math.min(this.arr21.length,this.psfb21.length)),g1.arraycopy(this.arr12,0,this.psfb12,0,Math.min(this.arr12.length,this.psfb12.length)))}var Ia=i2,Ne=Q0,xe=Ne.new_float,n2=Ne.new_float_n,_2=Ne.new_int,We=t1();function l2(){this.last_en_subshort=n2([4,9]),this.lastAttacks=_2(4),this.pefirbuf=xe(19),this.longfact=xe(We.SBMAX_l),this.shortfact=xe(We.SBMAX_s),this.attackthre=0,this.attackthre_s=0}var v2=l2;function o2(){this.sum=0,this.seen=0,this.want=0,this.pos=0,this.size=0,this.bag=null,this.nVbrNumFrames=0,this.nBytesWritten=0,this.TotalFrameSize=0}var h2=o2,Y1=Q0,u2=Y1.new_byte,f2=Y1.new_double,b1=Y1.new_float,p1=Y1.new_float_n,d1=Y1.new_int,re=Y1.new_int_n,m2=s2,b2=Ia,c2=v2,S2=h2,je=Ea(),W0=t1(),d2=ie;E1.MFSIZE=3*1152+W0.ENCDELAY-W0.MDCTDELAY,E1.MAX_HEADER_BUF=256,E1.MAX_BITS_PER_CHANNEL=4095,E1.MAX_BITS_PER_GRANULE=7680,E1.BPC=320;function E1(){var i=40;this.Class_ID=0,this.lame_encode_frame_init=0,this.iteration_init_init=0,this.fill_buffer_resample_init=0,this.mfbuf=p1([2,E1.MFSIZE]),this.mode_gr=0,this.channels_in=0,this.channels_out=0,this.resample_ratio=0,this.mf_samples_to_encode=0,this.mf_size=0,this.VBR_min_bitrate=0,this.VBR_max_bitrate=0,this.bitrate_index=0,this.samplerate_index=0,this.mode_ext=0,this.lowpass1=0,this.lowpass2=0,this.highpass1=0,this.highpass2=0,this.noise_shaping=0,this.noise_shaping_amp=0,this.substep_shaping=0,this.psymodel=0,this.noise_shaping_stop=0,this.subblock_gain=0,this.use_best_huffman=0,this.full_outer_loop=0,this.l3_side=new m2,this.ms_ratio=b1(2),this.padding=0,this.frac_SpF=0,this.slot_lag=0,this.tag_spec=null,this.nMusicCRC=0,this.OldValue=d1(2),this.CurrentStep=d1(2),this.masking_lower=0,this.bv_scf=d1(576),this.pseudohalf=d1(d2.SFBMAX),this.sfb21_extra=!1,this.inbuf_old=new Array(2),this.blackfilt=new Array(2*E1.BPC+1),this.itime=f2(2),this.sideinfo_len=0,this.sb_sample=p1([2,2,18,W0.SBLIMIT]),this.amp_filter=b1(32);function e(){this.write_timing=0,this.ptr=0,this.buf=u2(i)}this.header=new Array(E1.MAX_HEADER_BUF),this.h_ptr=0,this.w_ptr=0,this.ancillary_flag=0,this.ResvSize=0,this.ResvMax=0,this.scalefac_band=new b2,this.minval_l=b1(W0.CBANDS),this.minval_s=b1(W0.CBANDS),this.nb_1=p1([4,W0.CBANDS]),this.nb_2=p1([4,W0.CBANDS]),this.nb_s1=p1([4,W0.CBANDS]),this.nb_s2=p1([4,W0.CBANDS]),this.s3_ss=null,this.s3_ll=null,this.decay=0,this.thm=new Array(4),this.en=new Array(4),this.tot_ener=b1(4),this.loudness_sq=p1([2,2]),this.loudness_sq_save=b1(2),this.mld_l=b1(W0.SBMAX_l),this.mld_s=b1(W0.SBMAX_s),this.bm_l=d1(W0.SBMAX_l),this.bo_l=d1(W0.SBMAX_l),this.bm_s=d1(W0.SBMAX_s),this.bo_s=d1(W0.SBMAX_s),this.npart_l=0,this.npart_s=0,this.s3ind=re([W0.CBANDS,2]),this.s3ind_s=re([W0.CBANDS,2]),this.numlines_s=d1(W0.CBANDS),this.numlines_l=d1(W0.CBANDS),this.rnumlines_l=b1(W0.CBANDS),this.mld_cb_l=b1(W0.CBANDS),this.mld_cb_s=b1(W0.CBANDS),this.numlines_s_num1=0,this.numlines_l_num1=0,this.pe=b1(4),this.ms_ratio_s_old=0,this.ms_ratio_l_old=0,this.ms_ener_ratio_old=0,this.blocktype_old=d1(2),this.nsPsy=new c2,this.VBR_seek_table=new S2,this.ATH=null,this.PSY=null,this.nogap_total=0,this.nogap_current=0,this.decode_on_the_fly=!0,this.findReplayGain=!0,this.findPeakSample=!0,this.PeakSample=0,this.RadioGain=0,this.AudiophileGain=0,this.rgdata=null,this.noclipGainChange=0,this.noclipScale=0,this.bitrate_stereoMode_Hist=re([16,5]),this.bitrate_blockType_Hist=re([16,6]),this.pinfo=null,this.hip=null,this.in_buffer_nsamples=0,this.in_buffer_0=null,this.in_buffer_1=null,this.iteration_loop=null;for(var s=0;s<this.en.length;s++)this.en[s]=new je;for(var s=0;s<this.thm.length;s++)this.thm[s]=new je;for(var s=0;s<this.header.length;s++)this.header[s]=new e}var ne=E1,A2=Q0,H1=A2.new_float,V1=t1();function R2(){this.useAdjust=0,this.aaSensitivityP=0,this.adjust=0,this.adjustLimit=0,this.decay=0,this.floor=0,this.l=H1(V1.SBMAX_l),this.s=H1(V1.SBMAX_s),this.psfb21=H1(V1.PSFB21),this.psfb12=H1(V1.PSFB12),this.cb_l=H1(V1.CBANDS),this.cb_s=H1(V1.CBANDS),this.eql_w=H1(V1.BLKSIZE/2)}var x2=R2,La=Q0,_1=La.System,ze=La.Arrays;j0.STEPS_per_dB=100,j0.MAX_dB=120,j0.GAIN_NOT_ENOUGH_SAMPLES=-24601,j0.GAIN_ANALYSIS_ERROR=0,j0.GAIN_ANALYSIS_OK=1,j0.INIT_GAIN_ANALYSIS_ERROR=0,j0.INIT_GAIN_ANALYSIS_OK=1,j0.YULE_ORDER=10,j0.MAX_ORDER=j0.YULE_ORDER,j0.MAX_SAMP_FREQ=48e3,j0.RMS_WINDOW_TIME_NUMERATOR=1,j0.RMS_WINDOW_TIME_DENOMINATOR=20,j0.MAX_SAMPLES_PER_WINDOW=j0.MAX_SAMP_FREQ*j0.RMS_WINDOW_TIME_NUMERATOR/j0.RMS_WINDOW_TIME_DENOMINATOR+1;function j0(){var i=64.82,e=.95,s=j0.RMS_WINDOW_TIME_NUMERATOR,c=j0.RMS_WINDOW_TIME_DENOMINATOR,h=[[.038575994352,-3.84664617118067,-.02160367184185,7.81501653005538,-.00123395316851,-11.34170355132042,-9291677959e-14,13.05504219327545,-.01655260341619,-12.28759895145294,.02161526843274,9.4829380631979,-.02074045215285,-5.87257861775999,.00594298065125,2.75465861874613,.00306428023191,-.86984376593551,.00012025322027,.13919314567432,.00288463683916],[.0541865640643,-3.47845948550071,-.02911007808948,6.36317777566148,-.00848709379851,-8.54751527471874,-.00851165645469,9.4769360780128,-.00834990904936,-8.81498681370155,.02245293253339,6.85401540936998,-.02596338512915,-4.39470996079559,.01624864962975,2.19611684890774,-.00240879051584,-.75104302451432,.00674613682247,.13149317958808,-.00187763777362],[.15457299681924,-2.37898834973084,-.09331049056315,2.84868151156327,-.06247880153653,-2.64577170229825,.02163541888798,2.23697657451713,-.05588393329856,-1.67148153367602,.04781476674921,1.00595954808547,.00222312597743,-.45953458054983,.03174092540049,.16378164858596,-.01390589421898,-.05032077717131,.00651420667831,.0234789740702,-.00881362733839],[.30296907319327,-1.61273165137247,-.22613988682123,1.0797749225997,-.08587323730772,-.2565625775407,.03282930172664,-.1627671912044,-.00915702933434,-.22638893773906,-.02364141202522,.39120800788284,-.00584456039913,-.22138138954925,.06276101321749,.04500235387352,-828086748e-14,.02005851806501,.00205861885564,.00302439095741,-.02950134983287],[.33642304856132,-1.49858979367799,-.2557224142557,.87350271418188,-.11828570177555,.12205022308084,.11921148675203,-.80774944671438,-.07834489609479,.47854794562326,-.0046997791438,-.12453458140019,-.0058950022444,-.04067510197014,.05724228140351,.08333755284107,.00832043980773,-.04237348025746,-.0163538138454,.02977207319925,-.0176017656815],[.4491525660845,-.62820619233671,-.14351757464547,.29661783706366,-.22784394429749,-.372563729424,-.01419140100551,.00213767857124,.04078262797139,-.42029820170918,-.12398163381748,.22199650564824,.04097565135648,.00613424350682,.10478503600251,.06747620744683,-.01863887810927,.05784820375801,-.03193428438915,.03222754072173,.00541907748707],[.56619470757641,-1.04800335126349,-.75464456939302,.29156311971249,.1624213774223,-.26806001042947,.16744243493672,.00819999645858,-.18901604199609,.45054734505008,.3093178284183,-.33032403314006,-.27562961986224,.0673936833311,.00647310677246,-.04784254229033,.08647503780351,.01639907836189,-.0378898455484,.01807364323573,-.00588215443421],[.58100494960553,-.51035327095184,-.53174909058578,-.31863563325245,-.14289799034253,-.20256413484477,.17520704835522,.1472815413433,.02377945217615,.38952639978999,.15558449135573,-.23313271880868,-.25344790059353,-.05246019024463,.01628462406333,-.02505961724053,.06920467763959,.02442357316099,-.03721611395801,.01818801111503,-.00749618797172],[.53648789255105,-.2504987195602,-.42163034350696,-.43193942311114,-.00275953611929,-.03424681017675,.04267842219415,-.04678328784242,-.10214864179676,.26408300200955,.14590772289388,.15113130533216,-.02459864859345,-.17556493366449,-.11202315195388,-.18823009262115,-.04060034127,.05477720428674,.0478866554818,.0470440968812,-.02217936801134]],$=[[.98621192462708,-1.97223372919527,-1.97242384925416,.97261396931306,.98621192462708],[.98500175787242,-1.96977855582618,-1.97000351574484,.9702284756635,.98500175787242],[.97938932735214,-1.95835380975398,-1.95877865470428,.95920349965459,.97938932735214],[.97531843204928,-1.95002759149878,-1.95063686409857,.95124613669835,.97531843204928],[.97316523498161,-1.94561023566527,-1.94633046996323,.94705070426118,.97316523498161],[.96454515552826,-1.92783286977036,-1.92909031105652,.93034775234268,.96454515552826],[.96009142950541,-1.91858953033784,-1.92018285901082,.92177618768381,.96009142950541],[.95856916599601,-1.9154210807478,-1.91713833199203,.91885558323625,.95856916599601],[.94597685600279,-1.88903307939452,-1.89195371200558,.89487434461664,.94597685600279]];function _(a,o,d,g,rt,st){for(;rt--!=0;)d[g]=1e-10+a[o+0]*st[0]-d[g-1]*st[1]+a[o-1]*st[2]-d[g-2]*st[3]+a[o-2]*st[4]-d[g-3]*st[5]+a[o-3]*st[6]-d[g-4]*st[7]+a[o-4]*st[8]-d[g-5]*st[9]+a[o-5]*st[10]-d[g-6]*st[11]+a[o-6]*st[12]-d[g-7]*st[13]+a[o-7]*st[14]-d[g-8]*st[15]+a[o-8]*st[16]-d[g-9]*st[17]+a[o-9]*st[18]-d[g-10]*st[19]+a[o-10]*st[20],++g,++o}function j(a,o,d,g,rt,st){for(;rt--!=0;)d[g]=a[o+0]*st[0]-d[g-1]*st[1]+a[o-1]*st[2]-d[g-2]*st[3]+a[o-2]*st[4],++g,++o}function nt(a,o){for(var d=0;d<MAX_ORDER;d++)a.linprebuf[d]=a.lstepbuf[d]=a.loutbuf[d]=a.rinprebuf[d]=a.rstepbuf[d]=a.routbuf[d]=0;switch(0|o){case 48e3:a.reqindex=0;break;case 44100:a.reqindex=1;break;case 32e3:a.reqindex=2;break;case 24e3:a.reqindex=3;break;case 22050:a.reqindex=4;break;case 16e3:a.reqindex=5;break;case 12e3:a.reqindex=6;break;case 11025:a.reqindex=7;break;case 8e3:a.reqindex=8;break;default:return INIT_GAIN_ANALYSIS_ERROR}return a.sampleWindow=0|(o*s+c-1)/c,a.lsum=0,a.rsum=0,a.totsamp=0,ze.ill(a.A,0),INIT_GAIN_ANALYSIS_OK}this.InitGainAnalysis=function(a,o){return nt(a,o)!=INIT_GAIN_ANALYSIS_OK?INIT_GAIN_ANALYSIS_ERROR:(a.linpre=MAX_ORDER,a.rinpre=MAX_ORDER,a.lstep=MAX_ORDER,a.rstep=MAX_ORDER,a.lout=MAX_ORDER,a.rout=MAX_ORDER,ze.fill(a.B,0),INIT_GAIN_ANALYSIS_OK)};function et(a){return a*a}this.AnalyzeSamples=function(a,o,d,g,rt,st,tt){var ot,it,at,ut,lt,ct,ft;if(st==0)return GAIN_ANALYSIS_OK;switch(ft=0,lt=st,tt){case 1:g=o,rt=d;break;case 2:break;default:return GAIN_ANALYSIS_ERROR}for(st<MAX_ORDER?(_1.arraycopy(o,d,a.linprebuf,MAX_ORDER,st),_1.arraycopy(g,rt,a.rinprebuf,MAX_ORDER,st)):(_1.arraycopy(o,d,a.linprebuf,MAX_ORDER,MAX_ORDER),_1.arraycopy(g,rt,a.rinprebuf,MAX_ORDER,MAX_ORDER));lt>0;){ct=lt>a.sampleWindow-a.totsamp?a.sampleWindow-a.totsamp:lt,ft<MAX_ORDER?(ot=a.linpre+ft,it=a.linprebuf,at=a.rinpre+ft,ut=a.rinprebuf,ct>MAX_ORDER-ft&&(ct=MAX_ORDER-ft)):(ot=d+ft,it=o,at=rt+ft,ut=g),_(it,ot,a.lstepbuf,a.lstep+a.totsamp,ct,h[a.reqindex]),_(ut,at,a.rstepbuf,a.rstep+a.totsamp,ct,h[a.reqindex]),j(a.lstepbuf,a.lstep+a.totsamp,a.loutbuf,a.lout+a.totsamp,ct,$[a.reqindex]),j(a.rstepbuf,a.rstep+a.totsamp,a.routbuf,a.rout+a.totsamp,ct,$[a.reqindex]),ot=a.lout+a.totsamp,it=a.loutbuf,at=a.rout+a.totsamp,ut=a.routbuf;for(var dt=ct%8;dt--!=0;)a.lsum+=et(it[ot++]),a.rsum+=et(ut[at++]);for(dt=ct/8;dt--!=0;)a.lsum+=et(it[ot+0])+et(it[ot+1])+et(it[ot+2])+et(it[ot+3])+et(it[ot+4])+et(it[ot+5])+et(it[ot+6])+et(it[ot+7]),ot+=8,a.rsum+=et(ut[at+0])+et(ut[at+1])+et(ut[at+2])+et(ut[at+3])+et(ut[at+4])+et(ut[at+5])+et(ut[at+6])+et(ut[at+7]),at+=8;if(lt-=ct,ft+=ct,a.totsamp+=ct,a.totsamp==a.sampleWindow){var yt=j0.STEPS_per_dB*10*Math.log10((a.lsum+a.rsum)/a.totsamp*.5+1e-37),St=yt<=0?0:0|yt;St>=a.A.length&&(St=a.A.length-1),a.A[St]++,a.lsum=a.rsum=0,_1.arraycopy(a.loutbuf,a.totsamp,a.loutbuf,0,MAX_ORDER),_1.arraycopy(a.routbuf,a.totsamp,a.routbuf,0,MAX_ORDER),_1.arraycopy(a.lstepbuf,a.totsamp,a.lstepbuf,0,MAX_ORDER),_1.arraycopy(a.rstepbuf,a.totsamp,a.rstepbuf,0,MAX_ORDER),a.totsamp=0}if(a.totsamp>a.sampleWindow)return GAIN_ANALYSIS_ERROR}return st<MAX_ORDER?(_1.arraycopy(a.linprebuf,st,a.linprebuf,0,MAX_ORDER-st),_1.arraycopy(a.rinprebuf,st,a.rinprebuf,0,MAX_ORDER-st),_1.arraycopy(o,d,a.linprebuf,MAX_ORDER-st,st),_1.arraycopy(g,rt,a.rinprebuf,MAX_ORDER-st,st)):(_1.arraycopy(o,d+st-MAX_ORDER,a.linprebuf,0,MAX_ORDER),_1.arraycopy(g,rt+st-MAX_ORDER,a.rinprebuf,0,MAX_ORDER)),GAIN_ANALYSIS_OK};function b(a,o){var d,g=0;for(d=0;d<o;d++)g+=a[d];if(g==0)return GAIN_NOT_ENOUGH_SAMPLES;var rt=0|Math.ceil(g*(1-e));for(d=o;d-- >0&&!((rt-=a[d])<=0););return i-d/j0.STEPS_per_dB}this.GetTitleGain=function(a){for(var o=b(a.A,a.A.length),d=0;d<a.A.length;d++)a.B[d]+=a.A[d],a.A[d]=0;for(var d=0;d<MAX_ORDER;d++)a.linprebuf[d]=a.lstepbuf[d]=a.loutbuf[d]=a.rinprebuf[d]=a.rstepbuf[d]=a.routbuf[d]=0;return a.totsamp=0,a.lsum=a.rsum=0,o}}var Na=j0,pa=Q0,k1=pa.new_float,Je=pa.new_int,l1=Na;function M2(){this.linprebuf=k1(l1.MAX_ORDER*2),this.linpre=0,this.lstepbuf=k1(l1.MAX_SAMPLES_PER_WINDOW+l1.MAX_ORDER),this.lstep=0,this.loutbuf=k1(l1.MAX_SAMPLES_PER_WINDOW+l1.MAX_ORDER),this.lout=0,this.rinprebuf=k1(l1.MAX_ORDER*2),this.rinpre=0,this.rstepbuf=k1(l1.MAX_SAMPLES_PER_WINDOW+l1.MAX_ORDER),this.rstep=0,this.routbuf=k1(l1.MAX_SAMPLES_PER_WINDOW+l1.MAX_ORDER),this.rout=0,this.sampleWindow=0,this.totsamp=0,this.lsum=0,this.rsum=0,this.freqindex=0,this.first=0,this.A=Je(0|l1.STEPS_per_dB*l1.MAX_dB),this.B=Je(0|l1.STEPS_per_dB*l1.MAX_dB)}var E2=M2;function B2(i){this.bits=i}var Ha=B2,pe=Q0,ge=pe.new_float,T2=pe.new_int,ea=pe.assert,y2=Ha,aa=t1(),w2=ie,I2=ne;function L2(i){var e=i;this.quantize=e,this.iteration_loop=function(s,c,h,$){var _=s.internal_flags,j=ge(w2.SFBMAX),nt=ge(576),et=T2(2),b=0,a,o=_.l3_side,d=new y2(b);this.quantize.rv.ResvFrameBegin(s,d),b=d.bits;for(var g=0;g<_.mode_gr;g++){a=this.quantize.qupvt.on_pe(s,c,et,b,g,g),_.mode_ext==aa.MPG_MD_MS_LR&&(this.quantize.ms_convert(_.l3_side,g),this.quantize.qupvt.reduce_side(et,h[g],b,a));for(var rt=0;rt<_.channels_out;rt++){var st,tt,ot=o.tt[g][rt];ot.block_type!=aa.SHORT_TYPE?(st=0,tt=_.PSY.mask_adjust-st):(st=0,tt=_.PSY.mask_adjust_short-st),_.masking_lower=Math.pow(10,tt*.1),this.quantize.init_outer_loop(_,ot),this.quantize.init_xrpow(_,ot,nt)&&(this.quantize.qupvt.calc_xmin(s,$[g][rt],ot,j),this.quantize.outer_loop(s,ot,j,nt,rt,et[rt])),this.quantize.iteration_finish_one(_,g,rt),ea(ot.part2_3_length<=I2.MAX_BITS_PER_CHANNEL),ea(ot.part2_3_length<=et[rt])}}this.quantize.rv.ResvFrameEnd(_,b)}}var N2=L2;function q0(i,e,s,c){this.xlen=i,this.linmax=e,this.table=s,this.hlen=c}var o0={};o0.t1HB=[1,1,1,0],o0.t2HB=[1,2,1,3,1,1,3,2,0],o0.t3HB=[3,2,1,1,1,1,3,2,0],o0.t5HB=[1,2,6,5,3,1,4,4,7,5,7,1,6,1,1,0],o0.t6HB=[7,3,5,1,6,2,3,2,5,4,4,1,3,3,2,0],o0.t7HB=[1,2,10,19,16,10,3,3,7,10,5,3,11,4,13,17,8,4,12,11,18,15,11,2,7,6,9,14,3,1,6,4,5,3,2,0],o0.t8HB=[3,4,6,18,12,5,5,1,2,16,9,3,7,3,5,14,7,3,19,17,15,13,10,4,13,5,8,11,5,1,12,4,4,1,1,0],o0.t9HB=[7,5,9,14,15,7,6,4,5,5,6,7,7,6,8,8,8,5,15,6,9,10,5,1,11,7,9,6,4,1,14,4,6,2,6,0],o0.t10HB=[1,2,10,23,35,30,12,17,3,3,8,12,18,21,12,7,11,9,15,21,32,40,19,6,14,13,22,34,46,23,18,7,20,19,33,47,27,22,9,3,31,22,41,26,21,20,5,3,14,13,10,11,16,6,5,1,9,8,7,8,4,4,2,0],o0.t11HB=[3,4,10,24,34,33,21,15,5,3,4,10,32,17,11,10,11,7,13,18,30,31,20,5,25,11,19,59,27,18,12,5,35,33,31,58,30,16,7,5,28,26,32,19,17,15,8,14,14,12,9,13,14,9,4,1,11,4,6,6,6,3,2,0],o0.t12HB=[9,6,16,33,41,39,38,26,7,5,6,9,23,16,26,11,17,7,11,14,21,30,10,7,17,10,15,12,18,28,14,5,32,13,22,19,18,16,9,5,40,17,31,29,17,13,4,2,27,12,11,15,10,7,4,1,27,12,8,12,6,3,1,0],o0.t13HB=[1,5,14,21,34,51,46,71,42,52,68,52,67,44,43,19,3,4,12,19,31,26,44,33,31,24,32,24,31,35,22,14,15,13,23,36,59,49,77,65,29,40,30,40,27,33,42,16,22,20,37,61,56,79,73,64,43,76,56,37,26,31,25,14,35,16,60,57,97,75,114,91,54,73,55,41,48,53,23,24,58,27,50,96,76,70,93,84,77,58,79,29,74,49,41,17,47,45,78,74,115,94,90,79,69,83,71,50,59,38,36,15,72,34,56,95,92,85,91,90,86,73,77,65,51,44,43,42,43,20,30,44,55,78,72,87,78,61,46,54,37,30,20,16,53,25,41,37,44,59,54,81,66,76,57,54,37,18,39,11,35,33,31,57,42,82,72,80,47,58,55,21,22,26,38,22,53,25,23,38,70,60,51,36,55,26,34,23,27,14,9,7,34,32,28,39,49,75,30,52,48,40,52,28,18,17,9,5,45,21,34,64,56,50,49,45,31,19,12,15,10,7,6,3,48,23,20,39,36,35,53,21,16,23,13,10,6,1,4,2,16,15,17,27,25,20,29,11,17,12,16,8,1,1,0,1],o0.t15HB=[7,12,18,53,47,76,124,108,89,123,108,119,107,81,122,63,13,5,16,27,46,36,61,51,42,70,52,83,65,41,59,36,19,17,15,24,41,34,59,48,40,64,50,78,62,80,56,33,29,28,25,43,39,63,55,93,76,59,93,72,54,75,50,29,52,22,42,40,67,57,95,79,72,57,89,69,49,66,46,27,77,37,35,66,58,52,91,74,62,48,79,63,90,62,40,38,125,32,60,56,50,92,78,65,55,87,71,51,73,51,70,30,109,53,49,94,88,75,66,122,91,73,56,42,64,44,21,25,90,43,41,77,73,63,56,92,77,66,47,67,48,53,36,20,71,34,67,60,58,49,88,76,67,106,71,54,38,39,23,15,109,53,51,47,90,82,58,57,48,72,57,41,23,27,62,9,86,42,40,37,70,64,52,43,70,55,42,25,29,18,11,11,118,68,30,55,50,46,74,65,49,39,24,16,22,13,14,7,91,44,39,38,34,63,52,45,31,52,28,19,14,8,9,3,123,60,58,53,47,43,32,22,37,24,17,12,15,10,2,1,71,37,34,30,28,20,17,26,21,16,10,6,8,6,2,0],o0.t16HB=[1,5,14,44,74,63,110,93,172,149,138,242,225,195,376,17,3,4,12,20,35,62,53,47,83,75,68,119,201,107,207,9,15,13,23,38,67,58,103,90,161,72,127,117,110,209,206,16,45,21,39,69,64,114,99,87,158,140,252,212,199,387,365,26,75,36,68,65,115,101,179,164,155,264,246,226,395,382,362,9,66,30,59,56,102,185,173,265,142,253,232,400,388,378,445,16,111,54,52,100,184,178,160,133,257,244,228,217,385,366,715,10,98,48,91,88,165,157,148,261,248,407,397,372,380,889,884,8,85,84,81,159,156,143,260,249,427,401,392,383,727,713,708,7,154,76,73,141,131,256,245,426,406,394,384,735,359,710,352,11,139,129,67,125,247,233,229,219,393,743,737,720,885,882,439,4,243,120,118,115,227,223,396,746,742,736,721,712,706,223,436,6,202,224,222,218,216,389,386,381,364,888,443,707,440,437,1728,4,747,211,210,208,370,379,734,723,714,1735,883,877,876,3459,865,2,377,369,102,187,726,722,358,711,709,866,1734,871,3458,870,434,0,12,10,7,11,10,17,11,9,13,12,10,7,5,3,1,3],o0.t24HB=[15,13,46,80,146,262,248,434,426,669,653,649,621,517,1032,88,14,12,21,38,71,130,122,216,209,198,327,345,319,297,279,42,47,22,41,74,68,128,120,221,207,194,182,340,315,295,541,18,81,39,75,70,134,125,116,220,204,190,178,325,311,293,271,16,147,72,69,135,127,118,112,210,200,188,352,323,306,285,540,14,263,66,129,126,119,114,214,202,192,180,341,317,301,281,262,12,249,123,121,117,113,215,206,195,185,347,330,308,291,272,520,10,435,115,111,109,211,203,196,187,353,332,313,298,283,531,381,17,427,212,208,205,201,193,186,177,169,320,303,286,268,514,377,16,335,199,197,191,189,181,174,333,321,305,289,275,521,379,371,11,668,184,183,179,175,344,331,314,304,290,277,530,383,373,366,10,652,346,171,168,164,318,309,299,287,276,263,513,375,368,362,6,648,322,316,312,307,302,292,284,269,261,512,376,370,364,359,4,620,300,296,294,288,282,273,266,515,380,374,369,365,361,357,2,1033,280,278,274,267,264,259,382,378,372,367,363,360,358,356,0,43,20,19,17,15,13,11,9,7,6,4,7,5,3,1,3],o0.t32HB=[1,10,8,20,12,20,16,32,14,12,24,0,28,16,24,16],o0.t33HB=[15,28,26,48,22,40,36,64,14,24,20,32,12,16,8,0],o0.t1l=[1,4,3,5],o0.t2l=[1,4,7,4,5,7,6,7,8],o0.t3l=[2,3,7,4,4,7,6,7,8],o0.t5l=[1,4,7,8,4,5,8,9,7,8,9,10,8,8,9,10],o0.t6l=[3,4,6,8,4,4,6,7,5,6,7,8,7,7,8,9],o0.t7l=[1,4,7,9,9,10,4,6,8,9,9,10,7,7,9,10,10,11,8,9,10,11,11,11,8,9,10,11,11,12,9,10,11,12,12,12],o0.t8l=[2,4,7,9,9,10,4,4,6,10,10,10,7,6,8,10,10,11,9,10,10,11,11,12,9,9,10,11,12,12,10,10,11,11,13,13],o0.t9l=[3,4,6,7,9,10,4,5,6,7,8,10,5,6,7,8,9,10,7,7,8,9,9,10,8,8,9,9,10,11,9,9,10,10,11,11],o0.t10l=[1,4,7,9,10,10,10,11,4,6,8,9,10,11,10,10,7,8,9,10,11,12,11,11,8,9,10,11,12,12,11,12,9,10,11,12,12,12,12,12,10,11,12,12,13,13,12,13,9,10,11,12,12,12,13,13,10,10,11,12,12,13,13,13],o0.t11l=[2,4,6,8,9,10,9,10,4,5,6,8,10,10,9,10,6,7,8,9,10,11,10,10,8,8,9,11,10,12,10,11,9,10,10,11,11,12,11,12,9,10,11,12,12,13,12,13,9,9,9,10,11,12,12,12,9,9,10,11,12,12,12,12],o0.t12l=[4,4,6,8,9,10,10,10,4,5,6,7,9,9,10,10,6,6,7,8,9,10,9,10,7,7,8,8,9,10,10,10,8,8,9,9,10,10,10,11,9,9,10,10,10,11,10,11,9,9,9,10,10,11,11,12,10,10,10,11,11,11,11,12],o0.t13l=[1,5,7,8,9,10,10,11,10,11,12,12,13,13,14,14,4,6,8,9,10,10,11,11,11,11,12,12,13,14,14,14,7,8,9,10,11,11,12,12,11,12,12,13,13,14,15,15,8,9,10,11,11,12,12,12,12,13,13,13,13,14,15,15,9,9,11,11,12,12,13,13,12,13,13,14,14,15,15,16,10,10,11,12,12,12,13,13,13,13,14,13,15,15,16,16,10,11,12,12,13,13,13,13,13,14,14,14,15,15,16,16,11,11,12,13,13,13,14,14,14,14,15,15,15,16,18,18,10,10,11,12,12,13,13,14,14,14,14,15,15,16,17,17,11,11,12,12,13,13,13,15,14,15,15,16,16,16,18,17,11,12,12,13,13,14,14,15,14,15,16,15,16,17,18,19,12,12,12,13,14,14,14,14,15,15,15,16,17,17,17,18,12,13,13,14,14,15,14,15,16,16,17,17,17,18,18,18,13,13,14,15,15,15,16,16,16,16,16,17,18,17,18,18,14,14,14,15,15,15,17,16,16,19,17,17,17,19,18,18,13,14,15,16,16,16,17,16,17,17,18,18,21,20,21,18],o0.t15l=[3,5,6,8,8,9,10,10,10,11,11,12,12,12,13,14,5,5,7,8,9,9,10,10,10,11,11,12,12,12,13,13,6,7,7,8,9,9,10,10,10,11,11,12,12,13,13,13,7,8,8,9,9,10,10,11,11,11,12,12,12,13,13,13,8,8,9,9,10,10,11,11,11,11,12,12,12,13,13,13,9,9,9,10,10,10,11,11,11,11,12,12,13,13,13,14,10,9,10,10,10,11,11,11,11,12,12,12,13,13,14,14,10,10,10,11,11,11,11,12,12,12,12,12,13,13,13,14,10,10,10,11,11,11,11,12,12,12,12,13,13,14,14,14,10,10,11,11,11,11,12,12,12,13,13,13,13,14,14,14,11,11,11,11,12,12,12,12,12,13,13,13,13,14,15,14,11,11,11,11,12,12,12,12,13,13,13,13,14,14,14,15,12,12,11,12,12,12,13,13,13,13,13,13,14,14,15,15,12,12,12,12,12,13,13,13,13,14,14,14,14,14,15,15,13,13,13,13,13,13,13,13,14,14,14,14,15,15,14,15,13,13,13,13,13,13,13,14,14,14,14,14,15,15,15,15],o0.t16_5l=[1,5,7,9,10,10,11,11,12,12,12,13,13,13,14,11,4,6,8,9,10,11,11,11,12,12,12,13,14,13,14,11,7,8,9,10,11,11,12,12,13,12,13,13,13,14,14,12,9,9,10,11,11,12,12,12,13,13,14,14,14,15,15,13,10,10,11,11,12,12,13,13,13,14,14,14,15,15,15,12,10,10,11,11,12,13,13,14,13,14,14,15,15,15,16,13,11,11,11,12,13,13,13,13,14,14,14,14,15,15,16,13,11,11,12,12,13,13,13,14,14,15,15,15,15,17,17,13,11,12,12,13,13,13,14,14,15,15,15,15,16,16,16,13,12,12,12,13,13,14,14,15,15,15,15,16,15,16,15,14,12,13,12,13,14,14,14,14,15,16,16,16,17,17,16,13,13,13,13,13,14,14,15,16,16,16,16,16,16,15,16,14,13,14,14,14,14,15,15,15,15,17,16,16,16,16,18,14,15,14,14,14,15,15,16,16,16,18,17,17,17,19,17,14,14,15,13,14,16,16,15,16,16,17,18,17,19,17,16,14,11,11,11,12,12,13,13,13,14,14,14,14,14,14,14,12],o0.t16l=[1,5,7,9,10,10,11,11,12,12,12,13,13,13,14,10,4,6,8,9,10,11,11,11,12,12,12,13,14,13,14,10,7,8,9,10,11,11,12,12,13,12,13,13,13,14,14,11,9,9,10,11,11,12,12,12,13,13,14,14,14,15,15,12,10,10,11,11,12,12,13,13,13,14,14,14,15,15,15,11,10,10,11,11,12,13,13,14,13,14,14,15,15,15,16,12,11,11,11,12,13,13,13,13,14,14,14,14,15,15,16,12,11,11,12,12,13,13,13,14,14,15,15,15,15,17,17,12,11,12,12,13,13,13,14,14,15,15,15,15,16,16,16,12,12,12,12,13,13,14,14,15,15,15,15,16,15,16,15,13,12,13,12,13,14,14,14,14,15,16,16,16,17,17,16,12,13,13,13,13,14,14,15,16,16,16,16,16,16,15,16,13,13,14,14,14,14,15,15,15,15,17,16,16,16,16,18,13,15,14,14,14,15,15,16,16,16,18,17,17,17,19,17,13,14,15,13,14,16,16,15,16,16,17,18,17,19,17,16,13,10,10,10,11,11,12,12,12,13,13,13,13,13,13,13,10],o0.t24l=[4,5,7,8,9,10,10,11,11,12,12,12,12,12,13,10,5,6,7,8,9,10,10,11,11,11,12,12,12,12,12,10,7,7,8,9,9,10,10,11,11,11,11,12,12,12,13,9,8,8,9,9,10,10,10,11,11,11,11,12,12,12,12,9,9,9,9,10,10,10,10,11,11,11,12,12,12,12,13,9,10,9,10,10,10,10,11,11,11,11,12,12,12,12,12,9,10,10,10,10,10,11,11,11,11,12,12,12,12,12,13,9,11,10,10,10,11,11,11,11,12,12,12,12,12,13,13,10,11,11,11,11,11,11,11,11,11,12,12,12,12,13,13,10,11,11,11,11,11,11,11,12,12,12,12,12,13,13,13,10,12,11,11,11,11,12,12,12,12,12,12,13,13,13,13,10,12,12,11,11,11,12,12,12,12,12,12,13,13,13,13,10,12,12,12,12,12,12,12,12,12,12,13,13,13,13,13,10,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,10,13,12,12,12,12,12,12,13,13,13,13,13,13,13,13,10,9,9,9,9,9,9,9,9,9,9,9,10,10,10,10,6],o0.t32l=[1,5,5,7,5,8,7,9,5,7,7,9,7,9,9,10],o0.t33l=[4,5,5,6,5,6,6,7,5,6,6,7,6,7,7,8],o0.ht=[new q0(0,0,null,null),new q0(2,0,o0.t1HB,o0.t1l),new q0(3,0,o0.t2HB,o0.t2l),new q0(3,0,o0.t3HB,o0.t3l),new q0(0,0,null,null),new q0(4,0,o0.t5HB,o0.t5l),new q0(4,0,o0.t6HB,o0.t6l),new q0(6,0,o0.t7HB,o0.t7l),new q0(6,0,o0.t8HB,o0.t8l),new q0(6,0,o0.t9HB,o0.t9l),new q0(8,0,o0.t10HB,o0.t10l),new q0(8,0,o0.t11HB,o0.t11l),new q0(8,0,o0.t12HB,o0.t12l),new q0(16,0,o0.t13HB,o0.t13l),new q0(0,0,null,o0.t16_5l),new q0(16,0,o0.t15HB,o0.t15l),new q0(1,1,o0.t16HB,o0.t16l),new q0(2,3,o0.t16HB,o0.t16l),new q0(3,7,o0.t16HB,o0.t16l),new q0(4,15,o0.t16HB,o0.t16l),new q0(6,63,o0.t16HB,o0.t16l),new q0(8,255,o0.t16HB,o0.t16l),new q0(10,1023,o0.t16HB,o0.t16l),new q0(13,8191,o0.t16HB,o0.t16l),new q0(4,15,o0.t24HB,o0.t24l),new q0(5,31,o0.t24HB,o0.t24l),new q0(6,63,o0.t24HB,o0.t24l),new q0(7,127,o0.t24HB,o0.t24l),new q0(8,255,o0.t24HB,o0.t24l),new q0(9,511,o0.t24HB,o0.t24l),new q0(11,2047,o0.t24HB,o0.t24l),new q0(13,8191,o0.t24HB,o0.t24l),new q0(0,0,o0.t32HB,o0.t32l),new q0(0,0,o0.t33HB,o0.t33l)],o0.largetbl=[65540,327685,458759,589832,655369,655370,720906,720907,786443,786444,786444,851980,851980,851980,917517,655370,262149,393222,524295,589832,655369,720906,720906,720907,786443,786443,786444,851980,917516,851980,917516,655370,458759,524295,589832,655369,720905,720906,786442,786443,851979,786443,851979,851980,851980,917516,917517,720905,589832,589832,655369,720905,720906,786442,786442,786443,851979,851979,917515,917516,917516,983052,983052,786441,655369,655369,720905,720906,786442,786442,851978,851979,851979,917515,917516,917516,983052,983052,983053,720905,655370,655369,720906,720906,786442,851978,851979,917515,851979,917515,917516,983052,983052,983052,1048588,786441,720906,720906,720906,786442,851978,851979,851979,851979,917515,917516,917516,917516,983052,983052,1048589,786441,720907,720906,786442,786442,851979,851979,851979,917515,917516,983052,983052,983052,983052,1114125,1114125,786442,720907,786443,786443,851979,851979,851979,917515,917515,983051,983052,983052,983052,1048588,1048589,1048589,786442,786443,786443,786443,851979,851979,917515,917515,983052,983052,983052,983052,1048588,983053,1048589,983053,851978,786444,851979,786443,851979,917515,917516,917516,917516,983052,1048588,1048588,1048589,1114125,1114125,1048589,786442,851980,851980,851979,851979,917515,917516,983052,1048588,1048588,1048588,1048588,1048589,1048589,983053,1048589,851978,851980,917516,917516,917516,917516,983052,983052,983052,983052,1114124,1048589,1048589,1048589,1048589,1179661,851978,983052,917516,917516,917516,983052,983052,1048588,1048588,1048589,1179661,1114125,1114125,1114125,1245197,1114125,851978,917517,983052,851980,917516,1048588,1048588,983052,1048589,1048589,1114125,1179661,1114125,1245197,1114125,1048589,851978,655369,655369,655369,720905,720905,786441,786441,786441,851977,851977,851977,851978,851978,851978,851978,655366],o0.table23=[65538,262147,458759,262148,327684,458759,393222,458759,524296],o0.table56=[65539,262148,458758,524296,262148,327684,524294,589831,458757,524294,589831,655368,524295,524295,589832,655369],o0.bitrate_table=[[0,8,16,24,32,40,48,56,64,80,96,112,128,144,160,-1],[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,-1],[0,8,16,24,32,40,48,56,64,-1,-1,-1,-1,-1,-1,-1]],o0.samplerate_table=[[22050,24e3,16e3,-1],[44100,48e3,32e3,-1],[11025,12e3,8e3,-1]],o0.scfsi_band=[0,6,11,16,21];var He=o0,Me,ra;function Va(){if(ra)return Me;ra=1;var i=Ia,e=Q0,s=e.VbrMode,c=e.Float,h=e.Util,$=e.new_float,_=e.new_int,j=e.assert,nt=t1(),et=Ha,b=ne;a.Q_MAX=257,a.Q_MAX2=116,a.LARGE_BITS=1e5,a.IXMAX_VAL=8206;function a(){var o=Ve(),d=null,g=null,rt=null;this.setModules=function($t,At,Ot){d=$t,g=At,rt=Ot};function st($t){return j(0<=$t+a.Q_MAX2&&$t<a.Q_MAX),ft[$t+a.Q_MAX2]}this.IPOW20=function($t){return j(0<=$t&&$t<a.Q_MAX),dt[$t]};var tt=2220446049250313e-31,ot=a.IXMAX_VAL,it=ot+2,at=a.Q_MAX,ut=a.Q_MAX2;a.LARGE_BITS;var lt=100;this.nr_of_sfb_block=[[[6,5,5,5],[9,9,9,9],[6,9,9,9]],[[6,5,7,3],[9,9,12,6],[6,9,12,6]],[[11,10,0,0],[18,18,0,0],[15,18,0,0]],[[7,7,7,0],[12,12,12,0],[6,15,12,0]],[[6,6,6,3],[12,9,9,6],[6,12,9,6]],[[8,8,5,0],[15,12,9,0],[6,18,9,0]]];var ct=[0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,2,2,3,3,3,2,0];this.pretab=ct,this.sfBandIndex=[new i([0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576],[0,4,8,12,18,24,32,42,56,74,100,132,174,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new i([0,6,12,18,24,30,36,44,54,66,80,96,114,136,162,194,232,278,332,394,464,540,576],[0,4,8,12,18,26,36,48,62,80,104,136,180,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new i([0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576],[0,4,8,12,18,26,36,48,62,80,104,134,174,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new i([0,4,8,12,16,20,24,30,36,44,52,62,74,90,110,134,162,196,238,288,342,418,576],[0,4,8,12,16,22,30,40,52,66,84,106,136,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new i([0,4,8,12,16,20,24,30,36,42,50,60,72,88,106,128,156,190,230,276,330,384,576],[0,4,8,12,16,22,28,38,50,64,80,100,126,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new i([0,4,8,12,16,20,24,30,36,44,54,66,82,102,126,156,194,240,296,364,448,550,576],[0,4,8,12,16,22,30,42,58,78,104,138,180,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new i([0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576],[0/3,12/3,24/3,36/3,54/3,78/3,108/3,144/3,186/3,240/3,312/3,402/3,522/3,576/3],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new i([0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576],[0/3,12/3,24/3,36/3,54/3,78/3,108/3,144/3,186/3,240/3,312/3,402/3,522/3,576/3],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new i([0,12,24,36,48,60,72,88,108,132,160,192,232,280,336,400,476,566,568,570,572,574,576],[0/3,24/3,48/3,72/3,108/3,156/3,216/3,288/3,372/3,480/3,486/3,492/3,498/3,576/3],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0])];var ft=$(at+ut+1),dt=$(at),yt=$(it),St=$(it);this.adj43=St;function bt($t,At){var Ot=rt.ATHformula(At,$t);return Ot-=lt,Ot=Math.pow(10,Ot/10+$t.ATHlower),Ot}function Tt($t){for(var At=$t.internal_flags.ATH.l,Ot=$t.internal_flags.ATH.psfb21,It=$t.internal_flags.ATH.s,jt=$t.internal_flags.ATH.psfb12,Et=$t.internal_flags,mt=$t.out_samplerate,gt=0;gt<nt.SBMAX_l;gt++){var ht=Et.scalefac_band.l[gt],pt=Et.scalefac_band.l[gt+1];At[gt]=c.MAX_VALUE;for(var _t=ht;_t<pt;_t++){var Ct=_t*mt/1152,zt=bt($t,Ct);At[gt]=Math.min(At[gt],zt)}}for(var gt=0;gt<nt.PSFB21;gt++){var ht=Et.scalefac_band.psfb21[gt],pt=Et.scalefac_band.psfb21[gt+1];Ot[gt]=c.MAX_VALUE;for(var _t=ht;_t<pt;_t++){var Ct=_t*mt/1152,zt=bt($t,Ct);Ot[gt]=Math.min(Ot[gt],zt)}}for(var gt=0;gt<nt.SBMAX_s;gt++){var ht=Et.scalefac_band.s[gt],pt=Et.scalefac_band.s[gt+1];It[gt]=c.MAX_VALUE;for(var _t=ht;_t<pt;_t++){var Ct=_t*mt/384,zt=bt($t,Ct);It[gt]=Math.min(It[gt],zt)}It[gt]*=Et.scalefac_band.s[gt+1]-Et.scalefac_band.s[gt]}for(var gt=0;gt<nt.PSFB12;gt++){var ht=Et.scalefac_band.psfb12[gt],pt=Et.scalefac_band.psfb12[gt+1];jt[gt]=c.MAX_VALUE;for(var _t=ht;_t<pt;_t++){var Ct=_t*mt/384,zt=bt($t,Ct);jt[gt]=Math.min(jt[gt],zt)}jt[gt]*=Et.scalefac_band.s[13]-Et.scalefac_band.s[12]}if($t.noATH){for(var gt=0;gt<nt.SBMAX_l;gt++)At[gt]=1e-20;for(var gt=0;gt<nt.PSFB21;gt++)Ot[gt]=1e-20;for(var gt=0;gt<nt.SBMAX_s;gt++)It[gt]=1e-20;for(var gt=0;gt<nt.PSFB12;gt++)jt[gt]=1e-20}Et.ATH.floor=10*Math.log10(bt($t,-1))}this.iteration_init=function($t){var At=$t.internal_flags,Ot=At.l3_side,It;if(At.iteration_init_init==0){for(At.iteration_init_init=1,Ot.main_data_begin=0,Tt($t),yt[0]=0,It=1;It<it;It++)yt[It]=Math.pow(It,4/3);for(It=0;It<it-1;It++)St[It]=It+1-Math.pow(.5*(yt[It]+yt[It+1]),.75);for(St[It]=.5,It=0;It<at;It++)dt[It]=Math.pow(2,(It-210)*-.1875);for(It=0;It<=at+ut;It++)ft[It]=Math.pow(2,(It-210-ut)*.25);d.huffman_init(At);{var jt,Et,mt,gt;for(It=$t.exp_nspsytune>>2&63,It>=32&&(It-=64),jt=Math.pow(10,It/4/10),It=$t.exp_nspsytune>>8&63,It>=32&&(It-=64),Et=Math.pow(10,It/4/10),It=$t.exp_nspsytune>>14&63,It>=32&&(It-=64),mt=Math.pow(10,It/4/10),It=$t.exp_nspsytune>>20&63,It>=32&&(It-=64),gt=mt*Math.pow(10,It/4/10),It=0;It<nt.SBMAX_l;It++){var ht;It<=6?ht=jt:It<=13?ht=Et:It<=20?ht=mt:ht=gt,At.nsPsy.longfact[It]=ht}for(It=0;It<nt.SBMAX_s;It++){var ht;It<=5?ht=jt:It<=10?ht=Et:It<=11?ht=mt:ht=gt,At.nsPsy.shortfact[It]=ht}}}},this.on_pe=function($t,At,Ot,It,jt,Et){var mt=$t.internal_flags,gt=0,ht,pt=_(2),_t,Ct=new et(gt),zt=g.ResvMaxBits($t,It,Ct,Et);gt=Ct.bits;var Nt=gt+zt;for(Nt>b.MAX_BITS_PER_GRANULE&&(Nt=b.MAX_BITS_PER_GRANULE),ht=0,_t=0;_t<mt.channels_out;++_t)Ot[_t]=Math.min(b.MAX_BITS_PER_CHANNEL,gt/mt.channels_out),pt[_t]=0|Ot[_t]*At[jt][_t]/700-Ot[_t],pt[_t]>It*3/4&&(pt[_t]=It*3/4),pt[_t]<0&&(pt[_t]=0),pt[_t]+Ot[_t]>b.MAX_BITS_PER_CHANNEL&&(pt[_t]=Math.max(0,b.MAX_BITS_PER_CHANNEL-Ot[_t])),ht+=pt[_t];if(ht>zt)for(_t=0;_t<mt.channels_out;++_t)pt[_t]=zt*pt[_t]/ht;for(_t=0;_t<mt.channels_out;++_t)Ot[_t]+=pt[_t],zt-=pt[_t];for(ht=0,_t=0;_t<mt.channels_out;++_t)ht+=Ot[_t];if(ht>b.MAX_BITS_PER_GRANULE){var Ht=0;for(_t=0;_t<mt.channels_out;++_t)Ot[_t]*=b.MAX_BITS_PER_GRANULE,Ot[_t]/=ht,Ht+=Ot[_t]}return Nt},this.reduce_side=function($t,At,Ot,It){j($t[0]+$t[1]<=b.MAX_BITS_PER_GRANULE);var jt=.33*(.5-At)/.5;jt<0&&(jt=0),jt>.5&&(jt=.5);var Et=0|jt*.5*($t[0]+$t[1]);Et>b.MAX_BITS_PER_CHANNEL-$t[0]&&(Et=b.MAX_BITS_PER_CHANNEL-$t[0]),Et<0&&(Et=0),$t[1]>=125&&($t[1]-Et>125?($t[0]<Ot&&($t[0]+=Et),$t[1]-=Et):($t[0]+=$t[1]-125,$t[1]=125)),Et=$t[0]+$t[1],Et>It&&($t[0]=It*$t[0]/Et,$t[1]=It*$t[1]/Et),j($t[0]<=b.MAX_BITS_PER_CHANNEL),j($t[1]<=b.MAX_BITS_PER_CHANNEL),j($t[0]+$t[1]<=b.MAX_BITS_PER_GRANULE)},this.athAdjust=function($t,At,Ot){var It=90.30873362,jt=94.82444863,Et=h.FAST_LOG10_X(At,10),mt=$t*$t,gt=0;return Et-=Ot,mt>1e-20&&(gt=1+h.FAST_LOG10_X(mt,10/It)),gt<0&&(gt=0),Et*=gt,Et+=Ot+It-jt,Math.pow(10,.1*Et)},this.calc_xmin=function($t,At,Ot,It){var jt=0,Et=$t.internal_flags,mt,gt=0,ht=0,pt=Et.ATH,_t=Ot.xr,Ct=$t.VBR==s.vbr_mtrh?1:0,zt=Et.masking_lower;for(($t.VBR==s.vbr_mtrh||$t.VBR==s.vbr_mt)&&(zt=1),mt=0;mt<Ot.psy_lmax;mt++){var Nt,Ht,Jt,un,yn,vn;$t.VBR==s.vbr_rh||$t.VBR==s.vbr_mtrh?Ht=athAdjust(pt.adjust,pt.l[mt],pt.floor):Ht=pt.adjust*pt.l[mt],yn=Ot.width[mt],Jt=Ht/yn,un=tt,vn=yn>>1,Nt=0;do{var mn,Tn;mn=_t[gt]*_t[gt],Nt+=mn,un+=mn<Jt?mn:Jt,gt++,Tn=_t[gt]*_t[gt],Nt+=Tn,un+=Tn<Jt?Tn:Jt,gt++}while(--vn>0);if(Nt>Ht&&ht++,mt==nt.SBPSY_l){var kn=Ht*Et.nsPsy.longfact[mt];un<kn&&(un=kn)}if(Ct!=0&&(Ht=un),!$t.ATHonly){var Gn=At.en.l[mt];if(Gn>0){var kn;kn=Nt*At.thm.l[mt]*zt/Gn,Ct!=0&&(kn*=Et.nsPsy.longfact[mt]),Ht<kn&&(Ht=kn)}}Ct!=0?It[jt++]=Ht:It[jt++]=Ht*Et.nsPsy.longfact[mt]}var wr=575;if(Ot.block_type!=nt.SHORT_TYPE)for(var xt=576;xt--!=0&&o.EQ(_t[xt],0);)wr=xt;Ot.max_nonzero_coeff=wr;for(var kt=Ot.sfb_smin;mt<Ot.psymax;kt++,mt+=3){var yn,wn,bn;for($t.VBR==s.vbr_rh||$t.VBR==s.vbr_mtrh?bn=athAdjust(pt.adjust,pt.s[kt],pt.floor):bn=pt.adjust*pt.s[kt],yn=Ot.width[mt],wn=0;wn<3;wn++){var Nt=0,Ht,Jt,un,vn=yn>>1;Jt=bn/yn,un=tt;do{var mn,Tn;mn=_t[gt]*_t[gt],Nt+=mn,un+=mn<Jt?mn:Jt,gt++,Tn=_t[gt]*_t[gt],Nt+=Tn,un+=Tn<Jt?Tn:Jt,gt++}while(--vn>0);if(Nt>bn&&ht++,kt==nt.SBPSY_s){var kn=bn*Et.nsPsy.shortfact[kt];un<kn&&(un=kn)}if(Ct!=0?Ht=un:Ht=bn,!$t.ATHonly&&!$t.ATHshort){var Gn=At.en.s[kt][wn];if(Gn>0){var kn;kn=Nt*At.thm.s[kt][wn]*zt/Gn,Ct!=0&&(kn*=Et.nsPsy.shortfact[kt]),Ht<kn&&(Ht=kn)}}Ct!=0?It[jt++]=Ht:It[jt++]=Ht*Et.nsPsy.shortfact[kt]}$t.useTemporal&&(It[jt-3]>It[jt-3+1]&&(It[jt-3+1]+=(It[jt-3]-It[jt-3+1])*Et.decay),It[jt-3+1]>It[jt-3+2]&&(It[jt-3+2]+=(It[jt-3+1]-It[jt-3+2])*Et.decay))}return ht};function vt($t){this.s=$t}this.calc_noise_core=function($t,At,Ot,It){var jt=0,Et=At.s,mt=$t.l3_enc;if(Et>$t.count1)for(;Ot--!=0;){var gt;gt=$t.xr[Et],Et++,jt+=gt*gt,gt=$t.xr[Et],Et++,jt+=gt*gt}else if(Et>$t.big_values){var ht=$(2);for(ht[0]=0,ht[1]=It;Ot--!=0;){var gt;gt=Math.abs($t.xr[Et])-ht[mt[Et]],Et++,jt+=gt*gt,gt=Math.abs($t.xr[Et])-ht[mt[Et]],Et++,jt+=gt*gt}}else for(;Ot--!=0;){var gt;gt=Math.abs($t.xr[Et])-yt[mt[Et]]*It,Et++,jt+=gt*gt,gt=Math.abs($t.xr[Et])-yt[mt[Et]]*It,Et++,jt+=gt*gt}return At.s=Et,jt},this.calc_noise=function($t,At,Ot,It,jt){var Et=0,mt=0,gt,ht,pt=0,_t=0,Ct=0,zt=-20,Nt=0,Ht=$t.scalefac,Jt=0;for(It.over_SSD=0,gt=0;gt<$t.psymax;gt++){var un=$t.global_gain-(Ht[Jt++]+($t.preflag!=0?ct[gt]:0)<<$t.scalefac_scale+1)-$t.subblock_gain[$t.window[gt]]*8,yn=0;if(jt!=null&&jt.step[gt]==un)yn=jt.noise[gt],Nt+=$t.width[gt],Ot[Et++]=yn/At[mt++],yn=jt.noise_log[gt];else{var vn=st(un);if(ht=$t.width[gt]>>1,Nt+$t.width[gt]>$t.max_nonzero_coeff){var mn;mn=$t.max_nonzero_coeff-Nt+1,mn>0?ht=mn>>1:ht=0}var Tn=new vt(Nt);yn=this.calc_noise_core($t,Tn,ht,vn),Nt=Tn.s,jt!=null&&(jt.step[gt]=un,jt.noise[gt]=yn),yn=Ot[Et++]=yn/At[mt++],yn=h.FAST_LOG10(Math.max(yn,1e-20)),jt!=null&&(jt.noise_log[gt]=yn)}if(jt!=null&&(jt.global_gain=$t.global_gain),Ct+=yn,yn>0){var kn;kn=Math.max(0|yn*10+.5,1),It.over_SSD+=kn*kn,pt++,_t+=yn}zt=Math.max(zt,yn)}return It.over_count=pt,It.tot_noise=Ct,It.over_noise=_t,It.max_noise=zt,pt},this.set_pinfo=function($t,At,Ot,It,jt){var Et=$t.internal_flags,mt,gt,ht,pt,_t,Ct=At.scalefac_scale==0?.5:1,zt=At.scalefac,Nt=$(L3Side.SFBMAX),Ht=$(L3Side.SFBMAX),Jt=new CalcNoiseResult;calc_xmin($t,Ot,At,Nt),calc_noise(At,Nt,Ht,Jt,null);var un=0;for(gt=At.sfb_lmax,At.block_type!=nt.SHORT_TYPE&&At.mixed_block_flag==0&&(gt=22),mt=0;mt<gt;mt++){var yn=Et.scalefac_band.l[mt],vn=Et.scalefac_band.l[mt+1],mn=vn-yn;for(pt=0;un<vn;un++)pt+=At.xr[un]*At.xr[un];pt/=mn,_t=1e15,Et.pinfo.en[It][jt][mt]=_t*pt,Et.pinfo.xfsf[It][jt][mt]=_t*Nt[mt]*Ht[mt]/mn,Ot.en.l[mt]>0&&!$t.ATHonly?pt=pt/Ot.en.l[mt]:pt=0,Et.pinfo.thr[It][jt][mt]=_t*Math.max(pt*Ot.thm.l[mt],Et.ATH.l[mt]),Et.pinfo.LAMEsfb[It][jt][mt]=0,At.preflag!=0&&mt>=11&&(Et.pinfo.LAMEsfb[It][jt][mt]=-Ct*ct[mt]),mt<nt.SBPSY_l&&(j(zt[mt]>=0),Et.pinfo.LAMEsfb[It][jt][mt]-=Ct*zt[mt])}if(At.block_type==nt.SHORT_TYPE)for(gt=mt,mt=At.sfb_smin;mt<nt.SBMAX_s;mt++)for(var yn=Et.scalefac_band.s[mt],vn=Et.scalefac_band.s[mt+1],mn=vn-yn,Tn=0;Tn<3;Tn++){for(pt=0,ht=yn;ht<vn;ht++)pt+=At.xr[un]*At.xr[un],un++;pt=Math.max(pt/mn,1e-20),_t=1e15,Et.pinfo.en_s[It][jt][3*mt+Tn]=_t*pt,Et.pinfo.xfsf_s[It][jt][3*mt+Tn]=_t*Nt[gt]*Ht[gt]/mn,Ot.en.s[mt][Tn]>0?pt=pt/Ot.en.s[mt][Tn]:pt=0,($t.ATHonly||$t.ATHshort)&&(pt=0),Et.pinfo.thr_s[It][jt][3*mt+Tn]=_t*Math.max(pt*Ot.thm.s[mt][Tn],Et.ATH.s[mt]),Et.pinfo.LAMEsfb_s[It][jt][3*mt+Tn]=-2*At.subblock_gain[Tn],mt<nt.SBPSY_s&&(Et.pinfo.LAMEsfb_s[It][jt][3*mt+Tn]-=Ct*zt[gt]),gt++}Et.pinfo.LAMEqss[It][jt]=At.global_gain,Et.pinfo.LAMEmainbits[It][jt]=At.part2_3_length+At.part2_length,Et.pinfo.LAMEsfbits[It][jt]=At.part2_length,Et.pinfo.over[It][jt]=Jt.over_count,Et.pinfo.max_noise[It][jt]=Jt.max_noise*10,Et.pinfo.over_noise[It][jt]=Jt.over_noise*10,Et.pinfo.tot_noise[It][jt]=Jt.tot_noise*10,Et.pinfo.over_SSD[It][jt]=Jt.over_SSD}}return Me=a,Me}var Ee,ta;function Oa(){if(ta)return Ee;ta=1;var i=Q0,e=i.System,s=i.Arrays,c=i.new_int,h=i.assert,$=t1(),_=He,j=Le,nt=Va();function et(){var b=null;this.qupvt=null,this.setModules=function(Et){this.qupvt=Et,b=Et};function a(Et){this.bits=0|Et}var o=[[0,0],[0,0],[0,0],[0,0],[0,0],[0,1],[1,1],[1,1],[1,2],[2,2],[2,3],[2,3],[3,4],[3,4],[3,4],[4,5],[4,5],[4,6],[5,6],[5,6],[5,7],[6,7],[6,7]];function d(Et,mt,gt,ht,pt,_t){var Ct=.5946/mt;for(Et=Et>>1;Et--!=0;)pt[_t++]=Ct>gt[ht++]?0:1,pt[_t++]=Ct>gt[ht++]?0:1}function g(Et,mt,gt,ht,pt,_t){Et=Et>>1;var Ct=Et%2;for(Et=Et>>1;Et--!=0;){var zt,Nt,Ht,Jt,un,yn,vn,mn;zt=gt[ht++]*mt,Nt=gt[ht++]*mt,un=0|zt,Ht=gt[ht++]*mt,yn=0|Nt,Jt=gt[ht++]*mt,vn=0|Ht,zt+=b.adj43[un],mn=0|Jt,Nt+=b.adj43[yn],pt[_t++]=0|zt,Ht+=b.adj43[vn],pt[_t++]=0|Nt,Jt+=b.adj43[mn],pt[_t++]=0|Ht,pt[_t++]=0|Jt}if(Ct!=0){var zt,Nt,un,yn;zt=gt[ht++]*mt,Nt=gt[ht++]*mt,un=0|zt,yn=0|Nt,zt+=b.adj43[un],Nt+=b.adj43[yn],pt[_t++]=0|zt,pt[_t++]=0|Nt}}function rt(Et,mt,gt,ht,pt){var _t,Ct,zt=0,Nt,Ht=0,Jt=0,un=0,yn=mt,vn=0,mn=yn,Tn=0,kn=Et,Gn=0;for(Nt=pt!=null&&ht.global_gain==pt.global_gain,ht.block_type==$.SHORT_TYPE?Ct=38:Ct=21,_t=0;_t<=Ct;_t++){var wr=-1;if((Nt||ht.block_type==$.NORM_TYPE)&&(wr=ht.global_gain-(ht.scalefac[_t]+(ht.preflag!=0?b.pretab[_t]:0)<<ht.scalefac_scale+1)-ht.subblock_gain[ht.window[_t]]*8),h(ht.width[_t]>=0),Nt&&pt.step[_t]==wr)Ht!=0&&(g(Ht,gt,kn,Gn,mn,Tn),Ht=0),Jt!=0&&(d(Jt,gt,kn,Gn,mn,Tn),Jt=0);else{var xt=ht.width[_t];if(zt+ht.width[_t]>ht.max_nonzero_coeff){var kt;kt=ht.max_nonzero_coeff-zt+1,s.fill(mt,ht.max_nonzero_coeff,576,0),xt=kt,xt<0&&(xt=0),_t=Ct+1}if(Ht==0&&Jt==0&&(mn=yn,Tn=vn,kn=Et,Gn=un),pt!=null&&pt.sfb_count1>0&&_t>=pt.sfb_count1&&pt.step[_t]>0&&wr>=pt.step[_t]?(Ht!=0&&(g(Ht,gt,kn,Gn,mn,Tn),Ht=0,mn=yn,Tn=vn,kn=Et,Gn=un),Jt+=xt):(Jt!=0&&(d(Jt,gt,kn,Gn,mn,Tn),Jt=0,mn=yn,Tn=vn,kn=Et,Gn=un),Ht+=xt),xt<=0){Jt!=0&&(d(Jt,gt,kn,Gn,mn,Tn),Jt=0),Ht!=0&&(g(Ht,gt,kn,Gn,mn,Tn),Ht=0);break}}_t<=Ct&&(vn+=ht.width[_t],un+=ht.width[_t],zt+=ht.width[_t])}Ht!=0&&(g(Ht,gt,kn,Gn,mn,Tn),Ht=0),Jt!=0&&(d(Jt,gt,kn,Gn,mn,Tn),Jt=0)}function st(Et,mt,gt){var ht=0,pt=0;do{var _t=Et[mt++],Ct=Et[mt++];ht<_t&&(ht=_t),pt<Ct&&(pt=Ct)}while(mt<gt);return ht<pt&&(ht=pt),ht}function tt(Et,mt,gt,ht,pt,_t){var Ct=_.ht[ht].xlen*65536+_.ht[pt].xlen,zt=0,Nt;do{var Ht=Et[mt++],Jt=Et[mt++];Ht!=0&&(Ht>14&&(Ht=15,zt+=Ct),Ht*=16),Jt!=0&&(Jt>14&&(Jt=15,zt+=Ct),Ht+=Jt),zt+=_.largetbl[Ht]}while(mt<gt);return Nt=zt&65535,zt>>=16,zt>Nt&&(zt=Nt,ht=pt),_t.bits+=zt,ht}function ot(Et,mt,gt,ht){var pt=0,_t=_.ht[1].hlen;do{var Ct=Et[mt+0]*2+Et[mt+1];mt+=2,pt+=_t[Ct]}while(mt<gt);return ht.bits+=pt,1}function it(Et,mt,gt,ht,pt){var _t=0,Ct,zt=_.ht[ht].xlen,Nt;ht==2?Nt=_.table23:Nt=_.table56;do{var Ht=Et[mt+0]*zt+Et[mt+1];mt+=2,_t+=Nt[Ht]}while(mt<gt);return Ct=_t&65535,_t>>=16,_t>Ct&&(_t=Ct,ht++),pt.bits+=_t,ht}function at(Et,mt,gt,ht,pt){var _t=0,Ct=0,zt=0,Nt=_.ht[ht].xlen,Ht=_.ht[ht].hlen,Jt=_.ht[ht+1].hlen,un=_.ht[ht+2].hlen;do{var yn=Et[mt+0]*Nt+Et[mt+1];mt+=2,_t+=Ht[yn],Ct+=Jt[yn],zt+=un[yn]}while(mt<gt);var vn=ht;return _t>Ct&&(_t=Ct,vn++),_t>zt&&(_t=zt,vn=ht+2),pt.bits+=_t,vn}var ut=[1,2,5,7,7,10,10,13,13,13,13,13,13,13,13];function lt(Et,mt,gt,ht){var pt=st(Et,mt,gt);switch(pt){case 0:return pt;case 1:return ot(Et,mt,gt,ht);case 2:case 3:return it(Et,mt,gt,ut[pt-1],ht);case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:return at(Et,mt,gt,ut[pt-1],ht);default:if(pt>nt.IXMAX_VAL)return ht.bits=nt.LARGE_BITS,-1;pt-=15;var _t;for(_t=24;_t<32&&!(_.ht[_t].linmax>=pt);_t++);var Ct;for(Ct=_t-8;Ct<24&&!(_.ht[Ct].linmax>=pt);Ct++);return tt(Et,mt,gt,Ct,_t,ht)}}this.noquant_count_bits=function(Et,mt,gt){var ht=mt.l3_enc,pt=Math.min(576,mt.max_nonzero_coeff+2>>1<<1);for(gt!=null&&(gt.sfb_count1=0);pt>1&&!(ht[pt-1]|ht[pt-2]);pt-=2);mt.count1=pt;for(var _t=0,Ct=0;pt>3;pt-=4){var zt;if(((ht[pt-1]|ht[pt-2]|ht[pt-3]|ht[pt-4])&2147483647)>1)break;zt=((ht[pt-4]*2+ht[pt-3])*2+ht[pt-2])*2+ht[pt-1],_t+=_.t32l[zt],Ct+=_.t33l[zt]}var Nt=_t;if(mt.count1table_select=0,_t>Ct&&(Nt=Ct,mt.count1table_select=1),mt.count1bits=Nt,mt.big_values=pt,pt==0)return Nt;if(mt.block_type==$.SHORT_TYPE)_t=3*Et.scalefac_band.s[3],_t>mt.big_values&&(_t=mt.big_values),Ct=mt.big_values;else if(mt.block_type==$.NORM_TYPE){if(_t=mt.region0_count=Et.bv_scf[pt-2],Ct=mt.region1_count=Et.bv_scf[pt-1],h(_t+Ct+2<$.SBPSY_l),Ct=Et.scalefac_band.l[_t+Ct+2],_t=Et.scalefac_band.l[_t+1],Ct<pt){var Ht=new a(Nt);mt.table_select[2]=lt(ht,Ct,pt,Ht),Nt=Ht.bits}}else mt.region0_count=7,mt.region1_count=$.SBMAX_l-1-7-1,_t=Et.scalefac_band.l[8],Ct=pt,_t>Ct&&(_t=Ct);if(_t=Math.min(_t,pt),Ct=Math.min(Ct,pt),0<_t){var Ht=new a(Nt);mt.table_select[0]=lt(ht,0,_t,Ht),Nt=Ht.bits}if(_t<Ct){var Ht=new a(Nt);mt.table_select[1]=lt(ht,_t,Ct,Ht),Nt=Ht.bits}if(Et.use_best_huffman==2&&(mt.part2_3_length=Nt,best_huffman_divide(Et,mt),Nt=mt.part2_3_length),gt!=null&&mt.block_type==$.NORM_TYPE){for(var Jt=0;Et.scalefac_band.l[Jt]<mt.big_values;)Jt++;gt.sfb_count1=Jt}return Nt},this.count_bits=function(Et,mt,gt,ht){var pt=gt.l3_enc,_t=nt.IXMAX_VAL/b.IPOW20(gt.global_gain);if(gt.xrpow_max>_t)return nt.LARGE_BITS;if(rt(mt,pt,b.IPOW20(gt.global_gain),gt,ht),Et.substep_shaping&2)for(var Ct=0,zt=gt.global_gain+gt.scalefac_scale,Nt=.634521682242439/b.IPOW20(zt),Ht=0;Ht<gt.sfbmax;Ht++){var Jt=gt.width[Ht];if(Et.pseudohalf[Ht]==0)Ct+=Jt;else{var un;for(un=Ct,Ct+=Jt;un<Ct;++un)pt[un]=mt[un]>=Nt?pt[un]:0}}return this.noquant_count_bits(Et,gt,ht)};function ct(Et,mt,gt,ht,pt,_t,Ct){for(var zt=mt.big_values,Nt=0;Nt<=22;Nt++)ht[Nt]=nt.LARGE_BITS;for(var Nt=0;Nt<16;Nt++){var Ht=Et.scalefac_band.l[Nt+1];if(Ht>=zt)break;var Jt=0,un=new a(Jt),yn=lt(gt,0,Ht,un);Jt=un.bits;for(var vn=0;vn<8;vn++){var mn=Et.scalefac_band.l[Nt+vn+2];if(mn>=zt)break;var Tn=Jt;un=new a(Tn);var kn=lt(gt,Ht,mn,un);Tn=un.bits,ht[Nt+vn]>Tn&&(ht[Nt+vn]=Tn,pt[Nt+vn]=Nt,_t[Nt+vn]=yn,Ct[Nt+vn]=kn)}}}function ft(Et,mt,gt,ht,pt,_t,Ct,zt){for(var Nt=mt.big_values,Ht=2;Ht<$.SBMAX_l+1;Ht++){var Jt=Et.scalefac_band.l[Ht];if(Jt>=Nt)break;var un=pt[Ht-2]+mt.count1bits;if(gt.part2_3_length<=un)break;var yn=new a(un),vn=lt(ht,Jt,Nt,yn);un=yn.bits,!(gt.part2_3_length<=un)&&(gt.assign(mt),gt.part2_3_length=un,gt.region0_count=_t[Ht-2],gt.region1_count=Ht-2-_t[Ht-2],gt.table_select[0]=Ct[Ht-2],gt.table_select[1]=zt[Ht-2],gt.table_select[2]=vn)}}this.best_huffman_divide=function(Et,mt){var gt=new j,ht=mt.l3_enc,pt=c(23),_t=c(23),Ct=c(23),zt=c(23);if(!(mt.block_type==$.SHORT_TYPE&&Et.mode_gr==1)){gt.assign(mt),mt.block_type==$.NORM_TYPE&&(ct(Et,mt,ht,pt,_t,Ct,zt),ft(Et,gt,mt,ht,pt,_t,Ct,zt));var Nt=gt.big_values;if(!(Nt==0||(ht[Nt-2]|ht[Nt-1])>1)&&(Nt=mt.count1+2,!(Nt>576))){gt.assign(mt),gt.count1=Nt;for(var Ht=0,Jt=0;Nt>gt.big_values;Nt-=4){var un=((ht[Nt-4]*2+ht[Nt-3])*2+ht[Nt-2])*2+ht[Nt-1];Ht+=_.t32l[un],Jt+=_.t33l[un]}if(gt.big_values=Nt,gt.count1table_select=0,Ht>Jt&&(Ht=Jt,gt.count1table_select=1),gt.count1bits=Ht,gt.block_type==$.NORM_TYPE)ft(Et,gt,mt,ht,pt,_t,Ct,zt);else{if(gt.part2_3_length=Ht,Ht=Et.scalefac_band.l[8],Ht>Nt&&(Ht=Nt),Ht>0){var yn=new a(gt.part2_3_length);gt.table_select[0]=lt(ht,0,Ht,yn),gt.part2_3_length=yn.bits}if(Nt>Ht){var yn=new a(gt.part2_3_length);gt.table_select[1]=lt(ht,Ht,Nt,yn),gt.part2_3_length=yn.bits}mt.part2_3_length>gt.part2_3_length&&mt.assign(gt)}}}};var dt=[1,1,1,1,8,2,2,2,4,4,4,8,8,8,16,16],yt=[1,2,4,8,1,2,4,8,2,4,8,2,4,8,4,8],St=[0,0,0,0,3,1,1,1,2,2,2,3,3,3,4,4],bt=[0,1,2,3,0,1,2,3,1,2,3,1,2,3,2,3];et.slen1_tab=St,et.slen2_tab=bt;function Tt(Et,mt){for(var gt,ht=mt.tt[1][Et],pt=mt.tt[0][Et],_t=0;_t<_.scfsi_band.length-1;_t++){for(gt=_.scfsi_band[_t];gt<_.scfsi_band[_t+1]&&!(pt.scalefac[gt]!=ht.scalefac[gt]&&ht.scalefac[gt]>=0);gt++);if(gt==_.scfsi_band[_t+1]){for(gt=_.scfsi_band[_t];gt<_.scfsi_band[_t+1];gt++)ht.scalefac[gt]=-1;mt.scfsi[Et][_t]=1}}var Ct=0,zt=0;for(gt=0;gt<11;gt++)ht.scalefac[gt]!=-1&&(zt++,Ct<ht.scalefac[gt]&&(Ct=ht.scalefac[gt]));for(var Nt=0,Ht=0;gt<$.SBPSY_l;gt++)ht.scalefac[gt]!=-1&&(Ht++,Nt<ht.scalefac[gt]&&(Nt=ht.scalefac[gt]));for(var _t=0;_t<16;_t++)if(Ct<dt[_t]&&Nt<yt[_t]){var Jt=St[_t]*zt+bt[_t]*Ht;ht.part2_length>Jt&&(ht.part2_length=Jt,ht.scalefac_compress=_t)}}this.best_scalefac_store=function(Et,mt,gt,ht){var pt=ht.tt[mt][gt],_t,Ct,zt,Nt,Ht=0;for(zt=0,_t=0;_t<pt.sfbmax;_t++){var Jt=pt.width[_t];for(zt+=Jt,Nt=-Jt;Nt<0&&pt.l3_enc[Nt+zt]==0;Nt++);Nt==0&&(pt.scalefac[_t]=Ht=-2)}if(pt.scalefac_scale==0&&pt.preflag==0){var un=0;for(_t=0;_t<pt.sfbmax;_t++)pt.scalefac[_t]>0&&(un|=pt.scalefac[_t]);if(!(un&1)&&un!=0){for(_t=0;_t<pt.sfbmax;_t++)pt.scalefac[_t]>0&&(pt.scalefac[_t]>>=1);pt.scalefac_scale=Ht=1}}if(pt.preflag==0&&pt.block_type!=$.SHORT_TYPE&&Et.mode_gr==2){for(_t=11;_t<$.SBPSY_l&&!(pt.scalefac[_t]<b.pretab[_t]&&pt.scalefac[_t]!=-2);_t++);if(_t==$.SBPSY_l){for(_t=11;_t<$.SBPSY_l;_t++)pt.scalefac[_t]>0&&(pt.scalefac[_t]-=b.pretab[_t]);pt.preflag=Ht=1}}for(Ct=0;Ct<4;Ct++)ht.scfsi[gt][Ct]=0;for(Et.mode_gr==2&&mt==1&&ht.tt[0][gt].block_type!=$.SHORT_TYPE&&ht.tt[1][gt].block_type!=$.SHORT_TYPE&&(Tt(gt,ht),Ht=0),_t=0;_t<pt.sfbmax;_t++)pt.scalefac[_t]==-2&&(pt.scalefac[_t]=0);Ht!=0&&(Et.mode_gr==2?this.scale_bitcount(pt):this.scale_bitcount_lsf(Et,pt))};function vt(Et,mt){for(var gt=0;gt<mt;++gt)if(Et[gt]<0)return!1;return!0}var $t=[0,18,36,54,54,36,54,72,54,72,90,72,90,108,108,126],At=[0,18,36,54,51,35,53,71,52,70,88,69,87,105,104,122],Ot=[0,10,20,30,33,21,31,41,32,42,52,43,53,63,64,74];this.scale_bitcount=function(Et){var mt,gt,ht=0,pt=0,_t,Ct=Et.scalefac;if(h(vt(Ct,Et.sfbmax)),Et.block_type==$.SHORT_TYPE)_t=$t,Et.mixed_block_flag!=0&&(_t=At);else if(_t=Ot,Et.preflag==0){for(gt=11;gt<$.SBPSY_l&&!(Ct[gt]<b.pretab[gt]);gt++);if(gt==$.SBPSY_l)for(Et.preflag=1,gt=11;gt<$.SBPSY_l;gt++)Ct[gt]-=b.pretab[gt]}for(gt=0;gt<Et.sfbdivide;gt++)ht<Ct[gt]&&(ht=Ct[gt]);for(;gt<Et.sfbmax;gt++)pt<Ct[gt]&&(pt=Ct[gt]);for(Et.part2_length=nt.LARGE_BITS,mt=0;mt<16;mt++)ht<dt[mt]&&pt<yt[mt]&&Et.part2_length>_t[mt]&&(Et.part2_length=_t[mt],Et.scalefac_compress=mt);return Et.part2_length==nt.LARGE_BITS};var It=[[15,15,7,7],[15,15,7,0],[7,3,0,0],[15,31,31,0],[7,7,7,0],[3,3,0,0]];this.scale_bitcount_lsf=function(Et,mt){var gt,ht,pt,_t,Ct,zt,Nt,Ht,Jt=c(4),un=mt.scalefac;for(mt.preflag!=0?gt=2:gt=0,Nt=0;Nt<4;Nt++)Jt[Nt]=0;if(mt.block_type==$.SHORT_TYPE){ht=1;var yn=b.nr_of_sfb_block[gt][ht];for(Ht=0,pt=0;pt<4;pt++)for(_t=yn[pt]/3,Nt=0;Nt<_t;Nt++,Ht++)for(Ct=0;Ct<3;Ct++)un[Ht*3+Ct]>Jt[pt]&&(Jt[pt]=un[Ht*3+Ct])}else{ht=0;var yn=b.nr_of_sfb_block[gt][ht];for(Ht=0,pt=0;pt<4;pt++)for(_t=yn[pt],Nt=0;Nt<_t;Nt++,Ht++)un[Ht]>Jt[pt]&&(Jt[pt]=un[Ht])}for(zt=!1,pt=0;pt<4;pt++)Jt[pt]>It[gt][pt]&&(zt=!0);if(!zt){var vn,mn,Tn,kn;for(mt.sfb_partition_table=b.nr_of_sfb_block[gt][ht],pt=0;pt<4;pt++)mt.slen[pt]=jt[Jt[pt]];switch(vn=mt.slen[0],mn=mt.slen[1],Tn=mt.slen[2],kn=mt.slen[3],gt){case 0:mt.scalefac_compress=(vn*5+mn<<4)+(Tn<<2)+kn;break;case 1:mt.scalefac_compress=400+(vn*5+mn<<2)+Tn;break;case 2:mt.scalefac_compress=500+vn*3+mn;break;default:e.err.printf(`intensity stereo not implemented yet
|
|
50
50
|
`);break}}if(!zt)for(h(mt.sfb_partition_table!=null),mt.part2_length=0,pt=0;pt<4;pt++)mt.part2_length+=mt.slen[pt]*mt.sfb_partition_table[pt];return zt};var jt=[0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4];this.huffman_init=function(Et){for(var mt=2;mt<=576;mt+=2){for(var gt=0,ht;Et.scalefac_band.l[++gt]<mt;);for(ht=o[gt][0];Et.scalefac_band.l[ht+1]>mt;)ht--;for(ht<0&&(ht=o[gt][0]),Et.bv_scf[mt-2]=ht,ht=o[gt][1];Et.scalefac_band.l[ht+Et.bv_scf[mt-2]+2]>mt;)ht--;ht<0&&(ht=o[gt][1]),Et.bv_scf[mt-1]=ht}}}return Ee=et,Ee}var Be,sa;function Ve(){if(sa)return Be;sa=1;var i=Q0,e=i.System,s=i.Arrays,c=i.new_byte,h=i.new_float_n,$=i.new_int,_=i.assert,j=Oa(),nt=He,et=t1(),b=ne;a.EQ=function(o,d){return Math.abs(o)>Math.abs(d)?Math.abs(o-d)<=Math.abs(o)*1e-6:Math.abs(o-d)<=Math.abs(d)*1e-6},a.NEQ=function(o,d){return!a.EQ(o,d)};function a(){var o=Oe(),d=this,g=32773,rt=null,st=null,tt=null,ot=null;this.setModules=function(mt,gt,ht,pt){rt=mt,st=gt,tt=ht,ot=pt};var it=null,at=0,ut=0,lt=0;this.getframebits=function(mt){var gt=mt.internal_flags,ht;gt.bitrate_index!=0?ht=nt.bitrate_table[mt.version][gt.bitrate_index]:ht=mt.brate;var pt=0|(mt.version+1)*72e3*ht/mt.out_samplerate+gt.padding;return 8*pt};function ct(mt){e.arraycopy(mt.header[mt.w_ptr].buf,0,it,ut,mt.sideinfo_len),ut+=mt.sideinfo_len,at+=mt.sideinfo_len*8,mt.w_ptr=mt.w_ptr+1&b.MAX_HEADER_BUF-1}function ft(mt,gt,ht){for(;ht>0;){var pt;lt==0&&(lt=8,ut++,_(ut<o.LAME_MAXMP3BUFFER),_(mt.header[mt.w_ptr].write_timing>=at),mt.header[mt.w_ptr].write_timing==at&&ct(mt),it[ut]=0),pt=Math.min(ht,lt),ht-=pt,lt-=pt,it[ut]|=gt>>ht<<lt,at+=pt}}function dt(mt,gt,ht){for(;ht>0;){var pt;lt==0&&(lt=8,ut++,_(ut<o.LAME_MAXMP3BUFFER),it[ut]=0),pt=Math.min(ht,lt),ht-=pt,lt-=pt,it[ut]|=gt>>ht<<lt,at+=pt}}function yt(mt,gt){var ht=mt.internal_flags,pt;if(gt>=8&&(ft(ht,76,8),gt-=8),gt>=8&&(ft(ht,65,8),gt-=8),gt>=8&&(ft(ht,77,8),gt-=8),gt>=8&&(ft(ht,69,8),gt-=8),gt>=32){var _t=tt.getLameShortVersion();if(gt>=32)for(pt=0;pt<_t.length&>>=8;++pt)gt-=8,ft(ht,_t.charAt(pt),8)}for(;gt>=1;gt-=1)ft(ht,ht.ancillary_flag,1),ht.ancillary_flag^=mt.disable_reservoir?0:1}function St(mt,gt,ht){for(var pt=mt.header[mt.h_ptr].ptr;ht>0;){var _t=Math.min(ht,8-(pt&7));ht-=_t,mt.header[mt.h_ptr].buf[pt>>3]|=gt>>ht<<8-(pt&7)-_t,pt+=_t}mt.header[mt.h_ptr].ptr=pt}function bt(mt,gt){mt<<=8;for(var ht=0;ht<8;ht++)mt<<=1,gt<<=1,(gt^mt)&65536&&(gt^=g);return gt}this.CRC_writeheader=function(mt,gt){var ht=65535;ht=bt(gt[2]&255,ht),ht=bt(gt[3]&255,ht);for(var pt=6;pt<mt.sideinfo_len;pt++)ht=bt(gt[pt]&255,ht);gt[4]=byte(ht>>8),gt[5]=byte(ht&255)};function Tt(mt,gt){var ht=mt.internal_flags,pt,_t,Ct;if(pt=ht.l3_side,ht.header[ht.h_ptr].ptr=0,s.fill(ht.header[ht.h_ptr].buf,0,ht.sideinfo_len,0),mt.out_samplerate<16e3?St(ht,4094,12):St(ht,4095,12),St(ht,mt.version,1),St(ht,1,2),St(ht,mt.error_protection?0:1,1),St(ht,ht.bitrate_index,4),St(ht,ht.samplerate_index,2),St(ht,ht.padding,1),St(ht,mt.extension,1),St(ht,mt.mode.ordinal(),2),St(ht,ht.mode_ext,2),St(ht,mt.copyright,1),St(ht,mt.original,1),St(ht,mt.emphasis,2),mt.error_protection&&St(ht,0,16),mt.version==1){for(_(pt.main_data_begin>=0),St(ht,pt.main_data_begin,9),ht.channels_out==2?St(ht,pt.private_bits,3):St(ht,pt.private_bits,5),Ct=0;Ct<ht.channels_out;Ct++){var zt;for(zt=0;zt<4;zt++)St(ht,pt.scfsi[Ct][zt],1)}for(_t=0;_t<2;_t++)for(Ct=0;Ct<ht.channels_out;Ct++){var Nt=pt.tt[_t][Ct];St(ht,Nt.part2_3_length+Nt.part2_length,12),St(ht,Nt.big_values/2,9),St(ht,Nt.global_gain,8),St(ht,Nt.scalefac_compress,4),Nt.block_type!=et.NORM_TYPE?(St(ht,1,1),St(ht,Nt.block_type,2),St(ht,Nt.mixed_block_flag,1),Nt.table_select[0]==14&&(Nt.table_select[0]=16),St(ht,Nt.table_select[0],5),Nt.table_select[1]==14&&(Nt.table_select[1]=16),St(ht,Nt.table_select[1],5),St(ht,Nt.subblock_gain[0],3),St(ht,Nt.subblock_gain[1],3),St(ht,Nt.subblock_gain[2],3)):(St(ht,0,1),Nt.table_select[0]==14&&(Nt.table_select[0]=16),St(ht,Nt.table_select[0],5),Nt.table_select[1]==14&&(Nt.table_select[1]=16),St(ht,Nt.table_select[1],5),Nt.table_select[2]==14&&(Nt.table_select[2]=16),St(ht,Nt.table_select[2],5),_(0<=Nt.region0_count&&Nt.region0_count<16),_(0<=Nt.region1_count&&Nt.region1_count<8),St(ht,Nt.region0_count,4),St(ht,Nt.region1_count,3)),St(ht,Nt.preflag,1),St(ht,Nt.scalefac_scale,1),St(ht,Nt.count1table_select,1)}}else for(_(pt.main_data_begin>=0),St(ht,pt.main_data_begin,8),St(ht,pt.private_bits,ht.channels_out),_t=0,Ct=0;Ct<ht.channels_out;Ct++){var Nt=pt.tt[_t][Ct];St(ht,Nt.part2_3_length+Nt.part2_length,12),St(ht,Nt.big_values/2,9),St(ht,Nt.global_gain,8),St(ht,Nt.scalefac_compress,9),Nt.block_type!=et.NORM_TYPE?(St(ht,1,1),St(ht,Nt.block_type,2),St(ht,Nt.mixed_block_flag,1),Nt.table_select[0]==14&&(Nt.table_select[0]=16),St(ht,Nt.table_select[0],5),Nt.table_select[1]==14&&(Nt.table_select[1]=16),St(ht,Nt.table_select[1],5),St(ht,Nt.subblock_gain[0],3),St(ht,Nt.subblock_gain[1],3),St(ht,Nt.subblock_gain[2],3)):(St(ht,0,1),Nt.table_select[0]==14&&(Nt.table_select[0]=16),St(ht,Nt.table_select[0],5),Nt.table_select[1]==14&&(Nt.table_select[1]=16),St(ht,Nt.table_select[1],5),Nt.table_select[2]==14&&(Nt.table_select[2]=16),St(ht,Nt.table_select[2],5),_(0<=Nt.region0_count&&Nt.region0_count<16),_(0<=Nt.region1_count&&Nt.region1_count<8),St(ht,Nt.region0_count,4),St(ht,Nt.region1_count,3)),St(ht,Nt.scalefac_scale,1),St(ht,Nt.count1table_select,1)}mt.error_protection&&CRC_writeheader(ht,ht.header[ht.h_ptr].buf);{var Ht=ht.h_ptr;_(ht.header[Ht].ptr==ht.sideinfo_len*8),ht.h_ptr=Ht+1&b.MAX_HEADER_BUF-1,ht.header[ht.h_ptr].write_timing=ht.header[Ht].write_timing+gt,ht.h_ptr==ht.w_ptr&&e.err.println(`Error: MAX_HEADER_BUF too small in bitstream.c
|
|
51
|
-
`)}}function vt(mt,gt){var ht=nt.ht[gt.count1table_select+32],pt,_t=0,Ct=gt.big_values,zt=gt.big_values;for(_(gt.count1table_select<2),pt=(gt.count1-gt.big_values)/4;pt>0;--pt){var Nt=0,Ht=0,Jt;Jt=gt.l3_enc[Ct+0],Jt!=0&&(Ht+=8,gt.xr[zt+0]<0&&Nt++),Jt=gt.l3_enc[Ct+1],Jt!=0&&(Ht+=4,Nt*=2,gt.xr[zt+1]<0&&Nt++),Jt=gt.l3_enc[Ct+2],Jt!=0&&(Ht+=2,Nt*=2,gt.xr[zt+2]<0&&Nt++),Jt=gt.l3_enc[Ct+3],Jt!=0&&(Ht++,Nt*=2,gt.xr[zt+3]<0&&Nt++),Ct+=4,zt+=4,ft(mt,Nt+ht.table[Ht],ht.hlen[Ht]),_t+=ht.hlen[Ht]}return _t}function $t(mt,gt,ht,pt,_t){var Ct=nt.ht[gt],zt=0;if(gt==0)return zt;for(var Nt=ht;Nt<pt;Nt+=2){var Ht=0,Jt=0,un=Ct.xlen,yn=Ct.xlen,vn=0,mn=_t.l3_enc[Nt],Tn=_t.l3_enc[Nt+1];if(mn!=0&&(_t.xr[Nt]<0&&vn++,Ht--),gt>15){if(mn>14){var
|
|
51
|
+
`)}}function vt(mt,gt){var ht=nt.ht[gt.count1table_select+32],pt,_t=0,Ct=gt.big_values,zt=gt.big_values;for(_(gt.count1table_select<2),pt=(gt.count1-gt.big_values)/4;pt>0;--pt){var Nt=0,Ht=0,Jt;Jt=gt.l3_enc[Ct+0],Jt!=0&&(Ht+=8,gt.xr[zt+0]<0&&Nt++),Jt=gt.l3_enc[Ct+1],Jt!=0&&(Ht+=4,Nt*=2,gt.xr[zt+1]<0&&Nt++),Jt=gt.l3_enc[Ct+2],Jt!=0&&(Ht+=2,Nt*=2,gt.xr[zt+2]<0&&Nt++),Jt=gt.l3_enc[Ct+3],Jt!=0&&(Ht++,Nt*=2,gt.xr[zt+3]<0&&Nt++),Ct+=4,zt+=4,ft(mt,Nt+ht.table[Ht],ht.hlen[Ht]),_t+=ht.hlen[Ht]}return _t}function $t(mt,gt,ht,pt,_t){var Ct=nt.ht[gt],zt=0;if(gt==0)return zt;for(var Nt=ht;Nt<pt;Nt+=2){var Ht=0,Jt=0,un=Ct.xlen,yn=Ct.xlen,vn=0,mn=_t.l3_enc[Nt],Tn=_t.l3_enc[Nt+1];if(mn!=0&&(_t.xr[Nt]<0&&vn++,Ht--),gt>15){if(mn>14){var kn=mn-15;_(kn<=Ct.linmax),vn|=kn<<1,Jt=un,mn=15}if(Tn>14){var Gn=Tn-15;_(Gn<=Ct.linmax),vn<<=un,vn|=Gn,Jt+=un,Tn=15}yn=16}Tn!=0&&(vn<<=1,_t.xr[Nt+1]<0&&vn++,Ht--),mn=mn*yn+Tn,Jt-=Ht,Ht+=Ct.hlen[mn],ft(mt,Ct.table[mn],Ht),ft(mt,vn,Jt),zt+=Ht+Jt}return zt}function At(mt,gt){var ht=3*mt.scalefac_band.s[3];ht>gt.big_values&&(ht=gt.big_values);var pt=$t(mt,gt.table_select[0],0,ht,gt);return pt+=$t(mt,gt.table_select[1],ht,gt.big_values,gt),pt}function Ot(mt,gt){var ht,pt,_t,Ct;ht=gt.big_values;var zt=gt.region0_count+1;return _(zt<mt.scalefac_band.l.length),_t=mt.scalefac_band.l[zt],zt+=gt.region1_count+1,_(zt<mt.scalefac_band.l.length),Ct=mt.scalefac_band.l[zt],_t>ht&&(_t=ht),Ct>ht&&(Ct=ht),pt=$t(mt,gt.table_select[0],0,_t,gt),pt+=$t(mt,gt.table_select[1],_t,Ct,gt),pt+=$t(mt,gt.table_select[2],Ct,ht,gt),pt}function It(mt){var gt,ht,pt,_t,Ct=0,zt=mt.internal_flags,Nt=zt.l3_side;if(mt.version==1)for(gt=0;gt<2;gt++)for(ht=0;ht<zt.channels_out;ht++){var Ht=Nt.tt[gt][ht],Jt=j.slen1_tab[Ht.scalefac_compress],un=j.slen2_tab[Ht.scalefac_compress];for(_t=0,pt=0;pt<Ht.sfbdivide;pt++)Ht.scalefac[pt]!=-1&&(ft(zt,Ht.scalefac[pt],Jt),_t+=Jt);for(;pt<Ht.sfbmax;pt++)Ht.scalefac[pt]!=-1&&(ft(zt,Ht.scalefac[pt],un),_t+=un);_(_t==Ht.part2_length),Ht.block_type==et.SHORT_TYPE?_t+=At(zt,Ht):_t+=Ot(zt,Ht),_t+=vt(zt,Ht),_(_t==Ht.part2_3_length+Ht.part2_length),Ct+=_t}else for(gt=0,ht=0;ht<zt.channels_out;ht++){var Ht=Nt.tt[gt][ht],yn,vn,mn=0;if(_(Ht.sfb_partition_table!=null),_t=0,pt=0,vn=0,Ht.block_type==et.SHORT_TYPE){for(;vn<4;vn++){var Tn=Ht.sfb_partition_table[vn]/3,kn=Ht.slen[vn];for(yn=0;yn<Tn;yn++,pt++)ft(zt,Math.max(Ht.scalefac[pt*3+0],0),kn),ft(zt,Math.max(Ht.scalefac[pt*3+1],0),kn),ft(zt,Math.max(Ht.scalefac[pt*3+2],0),kn),mn+=3*kn}_t+=At(zt,Ht)}else{for(;vn<4;vn++){var Tn=Ht.sfb_partition_table[vn],kn=Ht.slen[vn];for(yn=0;yn<Tn;yn++,pt++)ft(zt,Math.max(Ht.scalefac[pt],0),kn),mn+=kn}_t+=Ot(zt,Ht)}_t+=vt(zt,Ht),_(_t==Ht.part2_3_length),_(mn==Ht.part2_length),Ct+=mn+_t}return Ct}function jt(){this.total=0}function Et(mt,gt){var ht=mt.internal_flags,pt,_t,Ct,zt,Nt;return Nt=ht.w_ptr,zt=ht.h_ptr-1,zt==-1&&(zt=b.MAX_HEADER_BUF-1),pt=ht.header[zt].write_timing-at,gt.total=pt,pt>=0&&(_t=1+zt-Nt,zt<Nt&&(_t=1+zt-Nt+b.MAX_HEADER_BUF),pt-=_t*8*ht.sideinfo_len),Ct=d.getframebits(mt),pt+=Ct,gt.total+=Ct,gt.total%8!=0?gt.total=1+gt.total/8:gt.total=gt.total/8,gt.total+=ut+1,pt<0&&e.err.println(`strange error flushing buffer ...
|
|
52
52
|
`),pt}this.flush_bitstream=function(mt){var gt=mt.internal_flags,ht,pt,_t=gt.h_ptr-1;if(_t==-1&&(_t=b.MAX_HEADER_BUF-1),ht=gt.l3_side,!((pt=Et(mt,new jt))<0)){if(yt(mt,pt),_(gt.header[_t].write_timing+this.getframebits(mt)==at),gt.ResvSize=0,ht.main_data_begin=0,gt.findReplayGain){var Ct=rt.GetTitleGain(gt.rgdata);_(NEQ(Ct,GainAnalysis.GAIN_NOT_ENOUGH_SAMPLES)),gt.RadioGain=Math.floor(Ct*10+.5)|0}gt.findPeakSample&&(gt.noclipGainChange=Math.ceil(Math.log10(gt.PeakSample/32767)*20*10)|0,gt.noclipGainChange>0&&(EQ(mt.scale,1)||EQ(mt.scale,0))?gt.noclipScale=Math.floor(32767/gt.PeakSample*100)/100:gt.noclipScale=-1)}},this.add_dummy_byte=function(mt,gt,ht){for(var pt=mt.internal_flags,_t;ht-- >0;)for(dt(pt,gt,8),_t=0;_t<b.MAX_HEADER_BUF;++_t)pt.header[_t].write_timing+=8},this.format_bitstream=function(mt){var gt=mt.internal_flags,ht;ht=gt.l3_side;var pt=this.getframebits(mt);yt(mt,ht.resvDrain_pre),Tt(mt,pt);var _t=8*gt.sideinfo_len;if(_t+=It(mt),yt(mt,ht.resvDrain_post),_t+=ht.resvDrain_post,ht.main_data_begin+=(pt-_t)/8,Et(mt,new jt)!=gt.ResvSize&&e.err.println("Internal buffer inconsistency. flushbits <> ResvSize"),ht.main_data_begin*8!=gt.ResvSize&&(e.err.printf(`bit reservoir error:
|
|
53
53
|
l3_side.main_data_begin: %d
|
|
54
54
|
Resvoir size: %d
|
|
@@ -58,16 +58,16 @@ header and sideinfo: %d
|
|
|
58
58
|
data bits: %d
|
|
59
59
|
total bits: %d (remainder: %d)
|
|
60
60
|
bitsperframe: %d
|
|
61
|
-
`,8*ht.main_data_begin,gt.ResvSize,ht.resvDrain_post,ht.resvDrain_pre,8*gt.sideinfo_len,_t-ht.resvDrain_post-8*gt.sideinfo_len,_t,_t%8,pt),e.err.println("This is a fatal error. It has several possible causes:"),e.err.println("90%% LAME compiled with buggy version of gcc using advanced optimizations"),e.err.println(" 9%% Your system is overclocked"),e.err.println(" 1%% bug in LAME encoding library"),gt.ResvSize=ht.main_data_begin*8),at>1e9){var Ct;for(Ct=0;Ct<b.MAX_HEADER_BUF;++Ct)gt.header[Ct].write_timing-=at;at=0}return 0},this.copy_buffer=function(mt,gt,ht,pt,_t){var Ct=ut+1;if(Ct<=0)return 0;if(pt!=0&&Ct>pt)return-1;if(e.arraycopy(it,0,gt,ht,Ct),ut=-1,lt=0,_t!=0){var zt=$(1);if(zt[0]=mt.nMusicCRC,ot.updateMusicCRC(zt,gt,ht,Ct),mt.nMusicCRC=zt[0],Ct>0&&(mt.VBR_seek_table.nBytesWritten+=Ct),mt.decode_on_the_fly){for(var Nt=h([2,1152]),Ht=Ct,Jt=-1,un;Jt!=0;)if(Jt=st.hip_decode1_unclipped(mt.hip,gt,ht,Ht,Nt[0],Nt[1]),Ht=0,Jt==-1&&(Jt=0),Jt>0){if(mt.findPeakSample){for(un=0;un<Jt;un++)Nt[0][un]>mt.PeakSample?mt.PeakSample=Nt[0][un]:-Nt[0][un]>mt.PeakSample&&(mt.PeakSample=-Nt[0][un]);if(mt.channels_out>1)for(un=0;un<Jt;un++)Nt[1][un]>mt.PeakSample?mt.PeakSample=Nt[1][un]:-Nt[1][un]>mt.PeakSample&&(mt.PeakSample=-Nt[1][un])}if(mt.findReplayGain&&rt.AnalyzeSamples(mt.rgdata,Nt[0],0,Nt[1],0,Jt,mt.channels_out)==GainAnalysis.GAIN_ANALYSIS_ERROR)return-6}}}return Ct},this.init_bit_stream_w=function(mt){it=c(o.LAME_MAXMP3BUFFER),mt.h_ptr=mt.w_ptr=0,mt.header[mt.h_ptr].write_timing=0,ut=-1,lt=0,at=0}}return Be=a,Be}var Te,ia;function Oe(){if(ia)return Te;ia=1;var i=Q0,e=i.System,s=i.VbrMode,c=i.ShortBlock,h=i.new_float,$=i.new_int_n,_=i.new_short_n,j=i.assert,nt=Qa,et=za,b=ne,a=x2,o=E2,d=N2,g=Ve(),rt=He,st=t1();function tt(){var ot=j1,it=this,at=128*1024;tt.V9=410,tt.V8=420,tt.V7=430,tt.V6=440,tt.V5=450,tt.V4=460,tt.V3=470,tt.V2=480,tt.V1=490,tt.V0=500,tt.R3MIX=1e3,tt.STANDARD=1001,tt.EXTREME=1002,tt.INSANE=1003,tt.STANDARD_FAST=1004,tt.EXTREME_FAST=1005,tt.MEDIUM=1006,tt.MEDIUM_FAST=1007;var ut=16384+at;tt.LAME_MAXMP3BUFFER=ut;var lt,ct,ft,dt,yt,St=new nt,bt,Tt,vt;this.enc=new st,this.setModules=function(xt,
|
|
62
|
-
`)),Pt.highpass2>0){for(var On=-1,Rn=0;Rn<=31;Rn++){var _n=Rn/31;_n<=Pt.highpass1&&(bn=Math.max(bn,Rn)),Pt.highpass1<_n&&_n<Pt.highpass2&&(On=Math.max(On,Rn))}Pt.highpass1=bn/31,On==-1?Pt.highpass2=(bn+.75)/31:Pt.highpass2=(On+.75)/31}for(var Rn=0;Rn<32;Rn++){var Ln,Nn,_n=Rn/31;Pt.highpass2>Pt.highpass1?Ln=Et((Pt.highpass2-_n)/(Pt.highpass2-Pt.highpass1+1e-20)):Ln=1,Pt.lowpass2>Pt.lowpass1?Nn=Et((_n-Pt.lowpass1)/(Pt.lowpass2-Pt.lowpass1+1e-20)):Nn=1,Pt.amp_filter[Rn]=Ln*Nn}}function zt(xt){var Pt=xt.internal_flags;switch(xt.quality){default:case 9:Pt.psymodel=0,Pt.noise_shaping=0,Pt.noise_shaping_amp=0,Pt.noise_shaping_stop=0,Pt.use_best_huffman=0,Pt.full_outer_loop=0;break;case 8:xt.quality=7;case 7:Pt.psymodel=1,Pt.noise_shaping=0,Pt.noise_shaping_amp=0,Pt.noise_shaping_stop=0,Pt.use_best_huffman=0,Pt.full_outer_loop=0;break;case 6:Pt.psymodel=1,Pt.noise_shaping==0&&(Pt.noise_shaping=1),Pt.noise_shaping_amp=0,Pt.noise_shaping_stop=0,Pt.subblock_gain==-1&&(Pt.subblock_gain=1),Pt.use_best_huffman=0,Pt.full_outer_loop=0;break;case 5:Pt.psymodel=1,Pt.noise_shaping==0&&(Pt.noise_shaping=1),Pt.noise_shaping_amp=0,Pt.noise_shaping_stop=0,Pt.subblock_gain==-1&&(Pt.subblock_gain=1),Pt.use_best_huffman=0,Pt.full_outer_loop=0;break;case 4:Pt.psymodel=1,Pt.noise_shaping==0&&(Pt.noise_shaping=1),Pt.noise_shaping_amp=0,Pt.noise_shaping_stop=0,Pt.subblock_gain==-1&&(Pt.subblock_gain=1),Pt.use_best_huffman=1,Pt.full_outer_loop=0;break;case 3:Pt.psymodel=1,Pt.noise_shaping==0&&(Pt.noise_shaping=1),Pt.noise_shaping_amp=1,Pt.noise_shaping_stop=1,Pt.subblock_gain==-1&&(Pt.subblock_gain=1),Pt.use_best_huffman=1,Pt.full_outer_loop=0;break;case 2:Pt.psymodel=1,Pt.noise_shaping==0&&(Pt.noise_shaping=1),Pt.substep_shaping==0&&(Pt.substep_shaping=2),Pt.noise_shaping_amp=1,Pt.noise_shaping_stop=1,Pt.subblock_gain==-1&&(Pt.subblock_gain=1),Pt.use_best_huffman=1,Pt.full_outer_loop=0;break;case 1:Pt.psymodel=1,Pt.noise_shaping==0&&(Pt.noise_shaping=1),Pt.substep_shaping==0&&(Pt.substep_shaping=2),Pt.noise_shaping_amp=2,Pt.noise_shaping_stop=1,Pt.subblock_gain==-1&&(Pt.subblock_gain=1),Pt.use_best_huffman=1,Pt.full_outer_loop=0;break;case 0:Pt.psymodel=1,Pt.noise_shaping==0&&(Pt.noise_shaping=1),Pt.substep_shaping==0&&(Pt.substep_shaping=2),Pt.noise_shaping_amp=2,Pt.noise_shaping_stop=1,Pt.subblock_gain==-1&&(Pt.subblock_gain=1),Pt.use_best_huffman=1,Pt.full_outer_loop=0;break}}function Nt(xt){var Pt=xt.internal_flags;xt.frameNum=0,xt.write_id3tag_automatic&&Tt.id3tag_write_v2(xt),Pt.bitrate_stereoMode_Hist=$([16,5]),Pt.bitrate_blockType_Hist=$([16,6]),Pt.PeakSample=0,xt.bWriteVbrTag&&bt.InitVbrTag(xt)}this.lame_init_params=function(xt){var Pt=xt.internal_flags;if(Pt.Class_ID=0,Pt.ATH==null&&(Pt.ATH=new a),Pt.PSY==null&&(Pt.PSY=new $t),Pt.rgdata==null&&(Pt.rgdata=new o),Pt.channels_in=xt.num_channels,Pt.channels_in==1&&(xt.mode=ot.MONO),Pt.channels_out=xt.mode==ot.MONO?1:2,Pt.mode_ext=st.MPG_MD_MS_LR,xt.mode==ot.MONO&&(xt.force_ms=!1),xt.VBR==s.vbr_off&&xt.VBR_mean_bitrate_kbps!=128&&xt.brate==0&&(xt.brate=xt.VBR_mean_bitrate_kbps),xt.VBR==s.vbr_off||xt.VBR==s.vbr_mtrh||xt.VBR==s.vbr_mt||(xt.free_format=!1),xt.VBR==s.vbr_off&&xt.brate==0&&g.EQ(xt.compression_ratio,0)&&(xt.compression_ratio=11.025),xt.VBR==s.vbr_off&&xt.compression_ratio>0&&(xt.out_samplerate==0&&(xt.out_samplerate=map2MP3Frequency(int(.97*xt.in_samplerate))),xt.brate=0|xt.out_samplerate*16*Pt.channels_out/(1e3*xt.compression_ratio),Pt.samplerate_index=gt(xt.out_samplerate,xt),xt.free_format||(xt.brate=ht(xt.brate,xt.version,xt.out_samplerate))),xt.out_samplerate!=0&&(xt.out_samplerate<16e3?(xt.VBR_mean_bitrate_kbps=Math.max(xt.VBR_mean_bitrate_kbps,8),xt.VBR_mean_bitrate_kbps=Math.min(xt.VBR_mean_bitrate_kbps,64)):xt.out_samplerate<32e3?(xt.VBR_mean_bitrate_kbps=Math.max(xt.VBR_mean_bitrate_kbps,8),xt.VBR_mean_bitrate_kbps=Math.min(xt.VBR_mean_bitrate_kbps,160)):(xt.VBR_mean_bitrate_kbps=Math.max(xt.VBR_mean_bitrate_kbps,32),xt.VBR_mean_bitrate_kbps=Math.min(xt.VBR_mean_bitrate_kbps,320))),xt.lowpassfreq==0){var wn=16e3;switch(xt.VBR){case s.vbr_off:{var bn=new At;_t(bn,xt.brate),wn=bn.lowerlimit;break}case s.vbr_abr:{var bn=new At;_t(bn,xt.VBR_mean_bitrate_kbps),wn=bn.lowerlimit;break}case s.vbr_rh:{var Dn=[19500,19e3,18600,18e3,17500,16e3,15600,14900,12500,1e4,3950];if(0<=xt.VBR_q&&xt.VBR_q<=9){var Rn=Dn[xt.VBR_q],_n=Dn[xt.VBR_q+1],On=xt.VBR_q_frac;wn=linear_int(Rn,_n,On)}else wn=19500;break}default:{var Dn=[19500,19e3,18500,18e3,17500,16500,15500,14500,12500,9500,3950];if(0<=xt.VBR_q&&xt.VBR_q<=9){var Rn=Dn[xt.VBR_q],_n=Dn[xt.VBR_q+1],On=xt.VBR_q_frac;wn=linear_int(Rn,_n,On)}else wn=19500}}xt.mode==ot.MONO&&(xt.VBR==s.vbr_off||xt.VBR==s.vbr_abr)&&(wn*=1.5),xt.lowpassfreq=wn|0}if(xt.out_samplerate==0&&(2*xt.lowpassfreq>xt.in_samplerate&&(xt.lowpassfreq=xt.in_samplerate/2),xt.out_samplerate=mt(xt.lowpassfreq|0,xt.in_samplerate)),xt.lowpassfreq=Math.min(20500,xt.lowpassfreq),xt.lowpassfreq=Math.min(xt.out_samplerate/2,xt.lowpassfreq),xt.VBR==s.vbr_off&&(xt.compression_ratio=xt.out_samplerate*16*Pt.channels_out/(1e3*xt.brate)),xt.VBR==s.vbr_abr&&(xt.compression_ratio=xt.out_samplerate*16*Pt.channels_out/(1e3*xt.VBR_mean_bitrate_kbps)),xt.bWriteVbrTag||(xt.findReplayGain=!1,xt.decode_on_the_fly=!1,Pt.findPeakSample=!1),Pt.findReplayGain=xt.findReplayGain,Pt.decode_on_the_fly=xt.decode_on_the_fly,Pt.decode_on_the_fly&&(Pt.findPeakSample=!0),Pt.findReplayGain&<.InitGainAnalysis(Pt.rgdata,xt.out_samplerate)==GainAnalysis.INIT_GAIN_ANALYSIS_ERROR)return xt.internal_flags=null,-6;switch(Pt.decode_on_the_fly&&!xt.decode_only&&(Pt.hip!=null&&vt.hip_decode_exit(Pt.hip),Pt.hip=vt.hip_decode_init()),Pt.mode_gr=xt.out_samplerate<=24e3?1:2,xt.framesize=576*Pt.mode_gr,xt.encoder_delay=st.ENCDELAY,Pt.resample_ratio=xt.in_samplerate/xt.out_samplerate,xt.VBR){case s.vbr_mt:case s.vbr_rh:case s.vbr_mtrh:{var Ln=[5.7,6.5,7.3,8.2,10,11.9,13,14,15,16.5];xt.compression_ratio=Ln[xt.VBR_q]}break;case s.vbr_abr:xt.compression_ratio=xt.out_samplerate*16*Pt.channels_out/(1e3*xt.VBR_mean_bitrate_kbps);break;default:xt.compression_ratio=xt.out_samplerate*16*Pt.channels_out/(1e3*xt.brate);break}if(xt.mode==ot.NOT_SET&&(xt.mode=ot.JOINT_STEREO),xt.highpassfreq>0?(Pt.highpass1=2*xt.highpassfreq,xt.highpasswidth>=0?Pt.highpass2=2*(xt.highpassfreq+xt.highpasswidth):Pt.highpass2=1*2*xt.highpassfreq,Pt.highpass1/=xt.out_samplerate,Pt.highpass2/=xt.out_samplerate):(Pt.highpass1=0,Pt.highpass2=0),xt.lowpassfreq>0?(Pt.lowpass2=2*xt.lowpassfreq,xt.lowpasswidth>=0?(Pt.lowpass1=2*(xt.lowpassfreq-xt.lowpasswidth),Pt.lowpass1<0&&(Pt.lowpass1=0)):Pt.lowpass1=1*2*xt.lowpassfreq,Pt.lowpass1/=xt.out_samplerate,Pt.lowpass2/=xt.out_samplerate):(Pt.lowpass1=0,Pt.lowpass2=0),Ct(xt),Pt.samplerate_index=gt(xt.out_samplerate,xt),Pt.samplerate_index<0)return xt.internal_flags=null,-1;if(xt.VBR==s.vbr_off){if(xt.free_format)Pt.bitrate_index=0;else if(xt.brate=ht(xt.brate,xt.version,xt.out_samplerate),Pt.bitrate_index=pt(xt.brate,xt.version,xt.out_samplerate),Pt.bitrate_index<=0)return xt.internal_flags=null,-1}else Pt.bitrate_index=1;xt.analysis&&(xt.bWriteVbrTag=!1),Pt.pinfo!=null&&(xt.bWriteVbrTag=!1),ct.init_bit_stream_w(Pt);for(var Nn=Pt.samplerate_index+3*xt.version+6*(xt.out_samplerate<16e3?1:0),Sn=0;Sn<st.SBMAX_l+1;Sn++)Pt.scalefac_band.l[Sn]=dt.sfBandIndex[Nn].l[Sn];for(var Sn=0;Sn<st.PSFB21+1;Sn++){var qn=(Pt.scalefac_band.l[22]-Pt.scalefac_band.l[21])/st.PSFB21,gr=Pt.scalefac_band.l[21]+Sn*qn;Pt.scalefac_band.psfb21[Sn]=gr}Pt.scalefac_band.psfb21[st.PSFB21]=576;for(var Sn=0;Sn<st.SBMAX_s+1;Sn++)Pt.scalefac_band.s[Sn]=dt.sfBandIndex[Nn].s[Sn];for(var Sn=0;Sn<st.PSFB12+1;Sn++){var qn=(Pt.scalefac_band.s[13]-Pt.scalefac_band.s[12])/st.PSFB12,gr=Pt.scalefac_band.s[12]+Sn*qn;Pt.scalefac_band.psfb12[Sn]=gr}Pt.scalefac_band.psfb12[st.PSFB12]=192,xt.version==1?Pt.sideinfo_len=Pt.channels_out==1?21:36:Pt.sideinfo_len=Pt.channels_out==1?13:21,xt.error_protection&&(Pt.sideinfo_len+=2),Nt(xt),Pt.Class_ID=It;{var kt;for(kt=0;kt<19;kt++)Pt.nsPsy.pefirbuf[kt]=700*Pt.mode_gr*Pt.channels_out;xt.ATHtype==-1&&(xt.ATHtype=4)}switch(j(xt.VBR_q<=9),j(xt.VBR_q>=0),xt.VBR){case s.vbr_mt:xt.VBR=s.vbr_mtrh;case s.vbr_mtrh:{xt.useTemporal==null&&(xt.useTemporal=!1),ft.apply_preset(xt,500-xt.VBR_q*10,0),xt.quality<0&&(xt.quality=LAME_DEFAULT_QUALITY),xt.quality<5&&(xt.quality=0),xt.quality>5&&(xt.quality=5),Pt.PSY.mask_adjust=xt.maskingadjust,Pt.PSY.mask_adjust_short=xt.maskingadjust_short,xt.experimentalY?Pt.sfb21_extra=!1:Pt.sfb21_extra=xt.out_samplerate>44e3,Pt.iteration_loop=new VBRNewIterationLoop(yt);break}case s.vbr_rh:{ft.apply_preset(xt,500-xt.VBR_q*10,0),Pt.PSY.mask_adjust=xt.maskingadjust,Pt.PSY.mask_adjust_short=xt.maskingadjust_short,xt.experimentalY?Pt.sfb21_extra=!1:Pt.sfb21_extra=xt.out_samplerate>44e3,xt.quality>6&&(xt.quality=6),xt.quality<0&&(xt.quality=LAME_DEFAULT_QUALITY),Pt.iteration_loop=new VBROldIterationLoop(yt);break}default:{var Dt;Pt.sfb21_extra=!1,xt.quality<0&&(xt.quality=LAME_DEFAULT_QUALITY),Dt=xt.VBR,Dt==s.vbr_off&&(xt.VBR_mean_bitrate_kbps=xt.brate),ft.apply_preset(xt,xt.VBR_mean_bitrate_kbps,0),xt.VBR=Dt,Pt.PSY.mask_adjust=xt.maskingadjust,Pt.PSY.mask_adjust_short=xt.maskingadjust_short,Dt==s.vbr_off?Pt.iteration_loop=new d(yt):Pt.iteration_loop=new ABRIterationLoop(yt);break}}if(j(xt.scale>=0),xt.VBR!=s.vbr_off){if(Pt.VBR_min_bitrate=1,Pt.VBR_max_bitrate=14,xt.out_samplerate<16e3&&(Pt.VBR_max_bitrate=8),xt.VBR_min_bitrate_kbps!=0&&(xt.VBR_min_bitrate_kbps=ht(xt.VBR_min_bitrate_kbps,xt.version,xt.out_samplerate),Pt.VBR_min_bitrate=pt(xt.VBR_min_bitrate_kbps,xt.version,xt.out_samplerate),Pt.VBR_min_bitrate<0)||xt.VBR_max_bitrate_kbps!=0&&(xt.VBR_max_bitrate_kbps=ht(xt.VBR_max_bitrate_kbps,xt.version,xt.out_samplerate),Pt.VBR_max_bitrate=pt(xt.VBR_max_bitrate_kbps,xt.version,xt.out_samplerate),Pt.VBR_max_bitrate<0))return-1;xt.VBR_min_bitrate_kbps=rt.bitrate_table[xt.version][Pt.VBR_min_bitrate],xt.VBR_max_bitrate_kbps=rt.bitrate_table[xt.version][Pt.VBR_max_bitrate],xt.VBR_mean_bitrate_kbps=Math.min(rt.bitrate_table[xt.version][Pt.VBR_max_bitrate],xt.VBR_mean_bitrate_kbps),xt.VBR_mean_bitrate_kbps=Math.max(rt.bitrate_table[xt.version][Pt.VBR_min_bitrate],xt.VBR_mean_bitrate_kbps)}return xt.tune&&(Pt.PSY.mask_adjust+=xt.tune_value_a,Pt.PSY.mask_adjust_short+=xt.tune_value_a),zt(xt),j(xt.scale>=0),xt.athaa_type<0?Pt.ATH.useAdjust=3:Pt.ATH.useAdjust=xt.athaa_type,Pt.ATH.aaSensitivityP=Math.pow(10,xt.athaa_sensitivity/-10),xt.short_blocks==null&&(xt.short_blocks=c.short_block_allowed),xt.short_blocks==c.short_block_allowed&&(xt.mode==ot.JOINT_STEREO||xt.mode==ot.STEREO)&&(xt.short_blocks=c.short_block_coupled),xt.quant_comp<0&&(xt.quant_comp=1),xt.quant_comp_short<0&&(xt.quant_comp_short=0),xt.msfix<0&&(xt.msfix=0),xt.exp_nspsytune=xt.exp_nspsytune|1,xt.internal_flags.nsPsy.attackthre<0&&(xt.internal_flags.nsPsy.attackthre=nt.NSATTACKTHRE),xt.internal_flags.nsPsy.attackthre_s<0&&(xt.internal_flags.nsPsy.attackthre_s=nt.NSATTACKTHRE_S),j(xt.scale>=0),xt.scale<0&&(xt.scale=1),xt.ATHtype<0&&(xt.ATHtype=4),xt.ATHcurve<0&&(xt.ATHcurve=4),xt.athaa_loudapprox<0&&(xt.athaa_loudapprox=2),xt.interChRatio<0&&(xt.interChRatio=0),xt.useTemporal==null&&(xt.useTemporal=!0),Pt.slot_lag=Pt.frac_SpF=0,xt.VBR==s.vbr_off&&(Pt.slot_lag=Pt.frac_SpF=(xt.version+1)*72e3*xt.brate%xt.out_samplerate|0),dt.iteration_init(xt),St.psymodel_init(xt),j(xt.scale>=0),0};function Ht(xt,Pt){(xt.in_buffer_0==null||xt.in_buffer_nsamples<Pt)&&(xt.in_buffer_0=h(Pt),xt.in_buffer_1=h(Pt),xt.in_buffer_nsamples=Pt)}this.lame_encode_flush=function(xt,Pt,wn,bn){var Dn=xt.internal_flags,Rn=_([2,1152]),_n=0,On,Ln,Nn,Sn,qn=Dn.mf_samples_to_encode-st.POSTDELAY,gr=Jt(xt);if(Dn.mf_samples_to_encode<1)return 0;for(On=0,xt.in_samplerate!=xt.out_samplerate&&(qn+=16*xt.out_samplerate/xt.in_samplerate),Nn=xt.framesize-qn%xt.framesize,Nn<576&&(Nn+=xt.framesize),xt.encoder_padding=Nn,Sn=(qn+Nn)/xt.framesize;Sn>0&&_n>=0;){var kt=gr-Dn.mf_size,Dt=xt.frameNum;kt*=xt.in_samplerate,kt/=xt.out_samplerate,kt>1152&&(kt=1152),kt<1&&(kt=1),Ln=bn-On,bn==0&&(Ln=0),_n=this.lame_encode_buffer(xt,Rn[0],Rn[1],kt,Pt,wn,Ln),wn+=_n,On+=_n,Sn-=Dt!=xt.frameNum?1:0}if(Dn.mf_samples_to_encode=0,_n<0||(Ln=bn-On,bn==0&&(Ln=0),ct.flush_bitstream(xt),_n=ct.copy_buffer(Dn,Pt,wn,Ln,1),_n<0))return _n;if(wn+=_n,On+=_n,Ln=bn-On,bn==0&&(Ln=0),xt.write_id3tag_automatic){if(Tt.id3tag_write_v1(xt),_n=ct.copy_buffer(Dn,Pt,wn,Ln,0),_n<0)return _n;On+=_n}return On},this.lame_encode_buffer=function(xt,Pt,wn,bn,Dn,Rn,_n){var On=xt.internal_flags,Ln=[null,null];if(On.Class_ID!=It)return-3;if(bn==0)return 0;Ht(On,bn),Ln[0]=On.in_buffer_0,Ln[1]=On.in_buffer_1;for(var Nn=0;Nn<bn;Nn++)Ln[0][Nn]=Pt[Nn],On.channels_in>1&&(Ln[1][Nn]=wn[Nn]);return un(xt,Ln[0],Ln[1],bn,Dn,Rn,_n)};function Jt(xt){var Pt=st.BLKSIZE+xt.framesize-st.FFTOFFSET;return Pt=Math.max(Pt,512+xt.framesize-32),Pt}function un(xt,Pt,wn,bn,Dn,Rn,_n){var On=xt.internal_flags,Ln=0,Nn,Sn,qn,gr,kt,Dt=[null,null],Lt=[null,null];if(On.Class_ID!=It)return-3;if(bn==0)return 0;if(kt=ct.copy_buffer(On,Dn,Rn,_n,0),kt<0)return kt;if(Rn+=kt,Ln+=kt,Lt[0]=Pt,Lt[1]=wn,g.NEQ(xt.scale,0)&&g.NEQ(xt.scale,1))for(Sn=0;Sn<bn;++Sn)Lt[0][Sn]*=xt.scale,On.channels_out==2&&(Lt[1][Sn]*=xt.scale);if(g.NEQ(xt.scale_left,0)&&g.NEQ(xt.scale_left,1))for(Sn=0;Sn<bn;++Sn)Lt[0][Sn]*=xt.scale_left;if(g.NEQ(xt.scale_right,0)&&g.NEQ(xt.scale_right,1))for(Sn=0;Sn<bn;++Sn)Lt[1][Sn]*=xt.scale_right;if(xt.num_channels==2&&On.channels_out==1)for(Sn=0;Sn<bn;++Sn)Lt[0][Sn]=.5*(Lt[0][Sn]+Lt[1][Sn]),Lt[1][Sn]=0;gr=Jt(xt),Dt[0]=On.mfbuf[0],Dt[1]=On.mfbuf[1];for(var Ut=0;bn>0;){var Kt=[null,null],Ft=0,Yt=0;Kt[0]=Lt[0],Kt[1]=Lt[1];var Wt=new vn;if(wr(xt,Dt,Kt,Ut,bn,Wt),Ft=Wt.n_in,Yt=Wt.n_out,On.findReplayGain&&!On.decode_on_the_fly&<.AnalyzeSamples(On.rgdata,Dt[0],On.mf_size,Dt[1],On.mf_size,Yt,On.channels_out)==GainAnalysis.GAIN_ANALYSIS_ERROR)return-6;if(bn-=Ft,Ut+=Ft,On.channels_out==2,On.mf_size+=Yt,j(On.mf_size<=b.MFSIZE),On.mf_samples_to_encode<1&&(On.mf_samples_to_encode=st.ENCDELAY+st.POSTDELAY),On.mf_samples_to_encode+=Yt,On.mf_size>=gr){var Xt=_n-Ln;if(_n==0&&(Xt=0),Nn=yn(xt,Dt[0],Dt[1],Dn,Rn,Xt),Nn<0)return Nn;for(Rn+=Nn,Ln+=Nn,On.mf_size-=xt.framesize,On.mf_samples_to_encode-=xt.framesize,qn=0;qn<On.channels_out;qn++)for(Sn=0;Sn<On.mf_size;Sn++)Dt[qn][Sn]=Dt[qn][Sn+xt.framesize]}}return Ln}function yn(xt,Pt,wn,bn,Dn,Rn){var _n=it.enc.lame_encode_mp3_frame(xt,Pt,wn,bn,Dn,Rn);return xt.frameNum++,_n}function vn(){this.n_in=0,this.n_out=0}function mn(){this.num_used=0}function Tn(xt,Pt){return Pt!=0?Tn(Pt,xt%Pt):xt}function Pn(xt,Pt,wn){var bn=Math.PI*Pt;xt/=wn,xt<0&&(xt=0),xt>1&&(xt=1);var Dn=xt-.5,Rn=.42-.5*Math.cos(2*xt*Math.PI)+.08*Math.cos(4*xt*Math.PI);return Math.abs(Dn)<1e-9?bn/Math.PI:Rn*Math.sin(wn*bn*Dn)/(Math.PI*wn*Dn)}function Gn(xt,Pt,wn,bn,Dn,Rn,_n,On,Ln){var Nn=xt.internal_flags,Sn,qn=0,gr,kt=xt.out_samplerate/Tn(xt.out_samplerate,xt.in_samplerate);kt>b.BPC&&(kt=b.BPC);var Dt=Math.abs(Nn.resample_ratio-Math.floor(.5+Nn.resample_ratio))<1e-4?1:0,Lt=1/Nn.resample_ratio;Lt>1&&(Lt=1);var Ut=31;Ut%2==0&&--Ut,Ut+=Dt;var Kt=Ut+1;if(Nn.fill_buffer_resample_init==0){for(Nn.inbuf_old[0]=h(Kt),Nn.inbuf_old[1]=h(Kt),Sn=0;Sn<=2*kt;++Sn)Nn.blackfilt[Sn]=h(Kt);for(Nn.itime[0]=0,Nn.itime[1]=0,qn=0;qn<=2*kt;qn++){var Ft=0,Yt=(qn-kt)/(2*kt);for(Sn=0;Sn<=Ut;Sn++)Ft+=Nn.blackfilt[qn][Sn]=Pn(Sn-Yt,Lt,Ut);for(Sn=0;Sn<=Ut;Sn++)Nn.blackfilt[qn][Sn]/=Ft}Nn.fill_buffer_resample_init=1}var Wt=Nn.inbuf_old[Ln];for(gr=0;gr<bn;gr++){var Xt,sn;if(Xt=gr*Nn.resample_ratio,qn=0|Math.floor(Xt-Nn.itime[Ln]),Ut+qn-Ut/2>=_n)break;var Yt=Xt-Nn.itime[Ln]-(qn+.5*(Ut%2));sn=0|Math.floor(Yt*2*kt+kt+.5);var en=0;for(Sn=0;Sn<=Ut;++Sn){var Qt=0|Sn+qn-Ut/2,ln;ln=Qt<0?Wt[Kt+Qt]:Dn[Rn+Qt],en+=ln*Nn.blackfilt[sn][Sn]}Pt[wn+gr]=en}if(On.num_used=Math.min(_n,Ut+qn-Ut/2),Nn.itime[Ln]+=On.num_used-gr*Nn.resample_ratio,On.num_used>=Kt)for(Sn=0;Sn<Kt;Sn++)Wt[Sn]=Dn[Rn+On.num_used+Sn-Kt];else{var gn=Kt-On.num_used;for(Sn=0;Sn<gn;++Sn)Wt[Sn]=Wt[Sn+On.num_used];for(qn=0;Sn<Kt;++Sn,++qn)Wt[Sn]=Dn[Rn+qn];j(qn==On.num_used)}return gr}function wr(xt,Pt,wn,bn,Dn,Rn){var _n=xt.internal_flags;if(_n.resample_ratio<.9999||_n.resample_ratio>1.0001)for(var On=0;On<_n.channels_out;On++){var Ln=new mn;Rn.n_out=Gn(xt,Pt[On],_n.mf_size,xt.framesize,wn[On],bn,Dn,Ln,On),Rn.n_in=Ln.num_used}else{Rn.n_out=Math.min(xt.framesize,Dn),Rn.n_in=Rn.n_out;for(var Nn=0;Nn<Rn.n_out;++Nn)Pt[0][_n.mf_size+Nn]=wn[0][bn+Nn],_n.channels_out==2&&(Pt[1][_n.mf_size+Nn]=wn[1][bn+Nn])}}}return Te=tt,Te}var p2=Q0,M1=p2.VbrMode;function H2(){var i=Oe();function e(b,a,o,d,g,rt,st,tt,ot,it,at,ut,lt,ct,ft){this.vbr_q=b,this.quant_comp=a,this.quant_comp_s=o,this.expY=d,this.st_lrm=g,this.st_s=rt,this.masking_adj=st,this.masking_adj_short=tt,this.ath_lower=ot,this.ath_curve=it,this.ath_sensitivity=at,this.interch=ut,this.safejoint=lt,this.sfb21mod=ct,this.msfix=ft}function s(b,a,o,d,g,rt,st,tt,ot,it,at,ut,lt,ct){this.quant_comp=a,this.quant_comp_s=o,this.safejoint=d,this.nsmsfix=g,this.st_lrm=rt,this.st_s=st,this.nsbass=tt,this.scale=ot,this.masking_adj=it,this.ath_lower=at,this.ath_curve=ut,this.interch=lt,this.sfscale=ct}var c;this.setModules=function(b){c=b};var h=[new e(0,9,9,0,5.2,125,-4.2,-6.3,4.8,1,0,0,2,21,.97),new e(1,9,9,0,5.3,125,-3.6,-5.6,4.5,1.5,0,0,2,21,1.35),new e(2,9,9,0,5.6,125,-2.2,-3.5,2.8,2,0,0,2,21,1.49),new e(3,9,9,1,5.8,130,-1.8,-2.8,2.6,3,-4,0,2,20,1.64),new e(4,9,9,1,6,135,-.7,-1.1,1.1,3.5,-8,0,2,0,1.79),new e(5,9,9,1,6.4,140,.5,.4,-7.5,4,-12,2e-4,0,0,1.95),new e(6,9,9,1,6.6,145,.67,.65,-14.7,6.5,-19,4e-4,0,0,2.3),new e(7,9,9,1,6.6,145,.8,.75,-19.7,8,-22,6e-4,0,0,2.7),new e(8,9,9,1,6.6,145,1.2,1.15,-27.5,10,-23,7e-4,0,0,0),new e(9,9,9,1,6.6,145,1.6,1.6,-36,11,-25,8e-4,0,0,0),new e(10,9,9,1,6.6,145,2,2,-36,12,-25,8e-4,0,0,0)],$=[new e(0,9,9,0,4.2,25,-7,-4,7.5,1,0,0,2,26,.97),new e(1,9,9,0,4.2,25,-5.6,-3.6,4.5,1.5,0,0,2,21,1.35),new e(2,9,9,0,4.2,25,-4.4,-1.8,2,2,0,0,2,18,1.49),new e(3,9,9,1,4.2,25,-3.4,-1.25,1.1,3,-4,0,2,15,1.64),new e(4,9,9,1,4.2,25,-2.2,.1,0,3.5,-8,0,2,0,1.79),new e(5,9,9,1,4.2,25,-1,1.65,-7.7,4,-12,2e-4,0,0,1.95),new e(6,9,9,1,4.2,25,-0,2.47,-7.7,6.5,-19,4e-4,0,0,2),new e(7,9,9,1,4.2,25,.5,2,-14.5,8,-22,6e-4,0,0,2),new e(8,9,9,1,4.2,25,1,2.4,-22,10,-23,7e-4,0,0,2),new e(9,9,9,1,4.2,25,1.5,2.95,-30,11,-25,8e-4,0,0,2),new e(10,9,9,1,4.2,25,2,2.95,-36,12,-30,8e-4,0,0,2)];function _(b,a,o){var d=b.VBR==M1.vbr_rh?h:$,g=b.VBR_q_frac,rt=d[a],st=d[a+1],tt=rt;rt.st_lrm=rt.st_lrm+g*(st.st_lrm-rt.st_lrm),rt.st_s=rt.st_s+g*(st.st_s-rt.st_s),rt.masking_adj=rt.masking_adj+g*(st.masking_adj-rt.masking_adj),rt.masking_adj_short=rt.masking_adj_short+g*(st.masking_adj_short-rt.masking_adj_short),rt.ath_lower=rt.ath_lower+g*(st.ath_lower-rt.ath_lower),rt.ath_curve=rt.ath_curve+g*(st.ath_curve-rt.ath_curve),rt.ath_sensitivity=rt.ath_sensitivity+g*(st.ath_sensitivity-rt.ath_sensitivity),rt.interch=rt.interch+g*(st.interch-rt.interch),rt.msfix=rt.msfix+g*(st.msfix-rt.msfix),et(b,tt.vbr_q),o!=0?b.quant_comp=tt.quant_comp:Math.abs(b.quant_comp- -1)>0||(b.quant_comp=tt.quant_comp),o!=0?b.quant_comp_short=tt.quant_comp_s:Math.abs(b.quant_comp_short- -1)>0||(b.quant_comp_short=tt.quant_comp_s),tt.expY!=0&&(b.experimentalY=tt.expY!=0),o!=0?b.internal_flags.nsPsy.attackthre=tt.st_lrm:Math.abs(b.internal_flags.nsPsy.attackthre- -1)>0||(b.internal_flags.nsPsy.attackthre=tt.st_lrm),o!=0?b.internal_flags.nsPsy.attackthre_s=tt.st_s:Math.abs(b.internal_flags.nsPsy.attackthre_s- -1)>0||(b.internal_flags.nsPsy.attackthre_s=tt.st_s),o!=0?b.maskingadjust=tt.masking_adj:Math.abs(b.maskingadjust-0)>0||(b.maskingadjust=tt.masking_adj),o!=0?b.maskingadjust_short=tt.masking_adj_short:Math.abs(b.maskingadjust_short-0)>0||(b.maskingadjust_short=tt.masking_adj_short),o!=0?b.ATHlower=-tt.ath_lower/10:Math.abs(-b.ATHlower*10-0)>0||(b.ATHlower=-tt.ath_lower/10),o!=0?b.ATHcurve=tt.ath_curve:Math.abs(b.ATHcurve- -1)>0||(b.ATHcurve=tt.ath_curve),o!=0?b.athaa_sensitivity=tt.ath_sensitivity:Math.abs(b.athaa_sensitivity- -1)>0||(b.athaa_sensitivity=tt.ath_sensitivity),tt.interch>0&&(o!=0?b.interChRatio=tt.interch:Math.abs(b.interChRatio- -1)>0||(b.interChRatio=tt.interch)),tt.safejoint>0&&(b.exp_nspsytune=b.exp_nspsytune|tt.safejoint),tt.sfb21mod>0&&(b.exp_nspsytune=b.exp_nspsytune|tt.sfb21mod<<20),o!=0?b.msfix=tt.msfix:Math.abs(b.msfix- -1)>0||(b.msfix=tt.msfix),o==0&&(b.VBR_q=a,b.VBR_q_frac=g)}var j=[new s(8,9,9,0,0,6.6,145,0,.95,0,-30,11,.0012,1),new s(16,9,9,0,0,6.6,145,0,.95,0,-25,11,.001,1),new s(24,9,9,0,0,6.6,145,0,.95,0,-20,11,.001,1),new s(32,9,9,0,0,6.6,145,0,.95,0,-15,11,.001,1),new s(40,9,9,0,0,6.6,145,0,.95,0,-10,11,9e-4,1),new s(48,9,9,0,0,6.6,145,0,.95,0,-10,11,9e-4,1),new s(56,9,9,0,0,6.6,145,0,.95,0,-6,11,8e-4,1),new s(64,9,9,0,0,6.6,145,0,.95,0,-2,11,8e-4,1),new s(80,9,9,0,0,6.6,145,0,.95,0,0,8,7e-4,1),new s(96,9,9,0,2.5,6.6,145,0,.95,0,1,5.5,6e-4,1),new s(112,9,9,0,2.25,6.6,145,0,.95,0,2,4.5,5e-4,1),new s(128,9,9,0,1.95,6.4,140,0,.95,0,3,4,2e-4,1),new s(160,9,9,1,1.79,6,135,0,.95,-2,5,3.5,0,1),new s(192,9,9,1,1.49,5.6,125,0,.97,-4,7,3,0,0),new s(224,9,9,1,1.25,5.2,125,0,.98,-6,9,2,0,0),new s(256,9,9,1,.97,5.2,125,0,1,-8,10,1,0,0),new s(320,9,9,1,.9,5.2,125,0,1,-10,12,0,0,0)];function nt(b,a,o){var d=a,g=c.nearestBitrateFullIndex(a);if(b.VBR=M1.vbr_abr,b.VBR_mean_bitrate_kbps=d,b.VBR_mean_bitrate_kbps=Math.min(b.VBR_mean_bitrate_kbps,320),b.VBR_mean_bitrate_kbps=Math.max(b.VBR_mean_bitrate_kbps,8),b.brate=b.VBR_mean_bitrate_kbps,b.VBR_mean_bitrate_kbps>320&&(b.disable_reservoir=!0),j[g].safejoint>0&&(b.exp_nspsytune=b.exp_nspsytune|2),j[g].sfscale>0&&(b.internal_flags.noise_shaping=2),Math.abs(j[g].nsbass)>0){var rt=int(j[g].nsbass*4);rt<0&&(rt+=64),b.exp_nspsytune=b.exp_nspsytune|rt<<2}return o!=0?b.quant_comp=j[g].quant_comp:Math.abs(b.quant_comp- -1)>0||(b.quant_comp=j[g].quant_comp),o!=0?b.quant_comp_short=j[g].quant_comp_s:Math.abs(b.quant_comp_short- -1)>0||(b.quant_comp_short=j[g].quant_comp_s),o!=0?b.msfix=j[g].nsmsfix:Math.abs(b.msfix- -1)>0||(b.msfix=j[g].nsmsfix),o!=0?b.internal_flags.nsPsy.attackthre=j[g].st_lrm:Math.abs(b.internal_flags.nsPsy.attackthre- -1)>0||(b.internal_flags.nsPsy.attackthre=j[g].st_lrm),o!=0?b.internal_flags.nsPsy.attackthre_s=j[g].st_s:Math.abs(b.internal_flags.nsPsy.attackthre_s- -1)>0||(b.internal_flags.nsPsy.attackthre_s=j[g].st_s),o!=0?b.scale=j[g].scale:Math.abs(b.scale- -1)>0||(b.scale=j[g].scale),o!=0?b.maskingadjust=j[g].masking_adj:Math.abs(b.maskingadjust-0)>0||(b.maskingadjust=j[g].masking_adj),j[g].masking_adj>0?o!=0?b.maskingadjust_short=j[g].masking_adj*.9:Math.abs(b.maskingadjust_short-0)>0||(b.maskingadjust_short=j[g].masking_adj*.9):o!=0?b.maskingadjust_short=j[g].masking_adj*1.1:Math.abs(b.maskingadjust_short-0)>0||(b.maskingadjust_short=j[g].masking_adj*1.1),o!=0?b.ATHlower=-j[g].ath_lower/10:Math.abs(-b.ATHlower*10-0)>0||(b.ATHlower=-j[g].ath_lower/10),o!=0?b.ATHcurve=j[g].ath_curve:Math.abs(b.ATHcurve- -1)>0||(b.ATHcurve=j[g].ath_curve),o!=0?b.interChRatio=j[g].interch:Math.abs(b.interChRatio- -1)>0||(b.interChRatio=j[g].interch),a}this.apply_preset=function(b,a,o){switch(a){case i.R3MIX:{a=i.V3,b.VBR=M1.vbr_mtrh;break}case i.MEDIUM:{a=i.V4,b.VBR=M1.vbr_rh;break}case i.MEDIUM_FAST:{a=i.V4,b.VBR=M1.vbr_mtrh;break}case i.STANDARD:{a=i.V2,b.VBR=M1.vbr_rh;break}case i.STANDARD_FAST:{a=i.V2,b.VBR=M1.vbr_mtrh;break}case i.EXTREME:{a=i.V0,b.VBR=M1.vbr_rh;break}case i.EXTREME_FAST:{a=i.V0,b.VBR=M1.vbr_mtrh;break}case i.INSANE:return a=320,b.preset=a,nt(b,a,o),b.VBR=M1.vbr_off,a}switch(b.preset=a,a){case i.V9:return _(b,9,o),a;case i.V8:return _(b,8,o),a;case i.V7:return _(b,7,o),a;case i.V6:return _(b,6,o),a;case i.V5:return _(b,5,o),a;case i.V4:return _(b,4,o),a;case i.V3:return _(b,3,o),a;case i.V2:return _(b,2,o),a;case i.V1:return _(b,1,o),a;case i.V0:return _(b,0,o),a}return 8<=a&&a<=320?nt(b,a,o):(b.preset=0,a)};function et(b,a){var o=0;return 0>a&&(o=-1,a=0),9<a&&(o=-1,a=9),b.VBR_q=a,b.VBR_q_frac=0,o}}var V2=H2;function O2(){this.setModules=function(i,e){}}var C2=O2;function F2(){this.over_noise=0,this.tot_noise=0,this.max_noise=0,this.over_count=0,this.over_SSD=0,this.bits=0}var k2=F2,Ca=Q0,na=Ca.new_float,X2=Ca.new_int;function Y2(){this.global_gain=0,this.sfb_count1=0,this.step=X2(39),this.noise=na(39),this.noise_log=na(39)}var q2=Y2,q1=Q0,y1=q1.System,_a$2=q1.VbrMode,ye=q1.Util,X1=q1.Arrays,K1=q1.new_float,U1=q1.assert,D2=C2,we=k2,G2=q2,D0=t1(),la=Le,va=ie;function $2(){var i;this.rv=null;var e;this.qupvt=null;var s,c=new D2,h;this.setModules=function(tt,ot,it,at){i=tt,e=ot,this.rv=ot,s=it,this.qupvt=it,h=at,c.setModules(s,h)},this.ms_convert=function(tt,ot){for(var it=0;it<576;++it){var at=tt.tt[ot][0].xr[it],ut=tt.tt[ot][1].xr[it];tt.tt[ot][0].xr[it]=(at+ut)*(ye.SQRT2*.5),tt.tt[ot][1].xr[it]=(at-ut)*(ye.SQRT2*.5)}};function $(tt,ot,it,at){at=0;for(var ut=0;ut<=it;++ut){var lt=Math.abs(tt.xr[ut]);at+=lt,ot[ut]=Math.sqrt(lt*Math.sqrt(lt)),ot[ut]>tt.xrpow_max&&(tt.xrpow_max=ot[ut])}return at}this.init_xrpow=function(tt,ot,it){var at=0,ut=0|ot.max_nonzero_coeff;if(ot.xrpow_max=0,X1.fill(it,ut,576,0),at=$(ot,it,ut,at),at>1e-20){var lt=0;tt.substep_shaping&2&&(lt=1);for(var ct=0;ct<ot.psymax;ct++)tt.pseudohalf[ct]=lt;return!0}return X1.fill(ot.l3_enc,0,576,0),!1};function _(tt,ot){var it=tt.ATH,at=ot.xr;if(ot.block_type!=D0.SHORT_TYPE)for(var ut=!1,lt=D0.PSFB21-1;lt>=0&&!ut;lt--){var ct=tt.scalefac_band.psfb21[lt],ft=tt.scalefac_band.psfb21[lt+1],dt=s.athAdjust(it.adjust,it.psfb21[lt],it.floor);tt.nsPsy.longfact[21]>1e-12&&(dt*=tt.nsPsy.longfact[21]);for(var yt=ft-1;yt>=ct;yt--)if(Math.abs(at[yt])<dt)at[yt]=0;else{ut=!0;break}}else for(var St=0;St<3;St++)for(var ut=!1,lt=D0.PSFB12-1;lt>=0&&!ut;lt--){var ct=tt.scalefac_band.s[12]*3+(tt.scalefac_band.s[13]-tt.scalefac_band.s[12])*St+(tt.scalefac_band.psfb12[lt]-tt.scalefac_band.psfb12[0]),ft=ct+(tt.scalefac_band.psfb12[lt+1]-tt.scalefac_band.psfb12[lt]),bt=s.athAdjust(it.adjust,it.psfb12[lt],it.floor);tt.nsPsy.shortfact[12]>1e-12&&(bt*=tt.nsPsy.shortfact[12]);for(var yt=ft-1;yt>=ct;yt--)if(Math.abs(at[yt])<bt)at[yt]=0;else{ut=!0;break}}}this.init_outer_loop=function(tt,ot){ot.part2_3_length=0,ot.big_values=0,ot.count1=0,ot.global_gain=210,ot.scalefac_compress=0,ot.table_select[0]=0,ot.table_select[1]=0,ot.table_select[2]=0,ot.subblock_gain[0]=0,ot.subblock_gain[1]=0,ot.subblock_gain[2]=0,ot.subblock_gain[3]=0,ot.region0_count=0,ot.region1_count=0,ot.preflag=0,ot.scalefac_scale=0,ot.count1table_select=0,ot.part2_length=0,ot.sfb_lmax=D0.SBPSY_l,ot.sfb_smin=D0.SBPSY_s,ot.psy_lmax=tt.sfb21_extra?D0.SBMAX_l:D0.SBPSY_l,ot.psymax=ot.psy_lmax,ot.sfbmax=ot.sfb_lmax,ot.sfbdivide=11;for(var it=0;it<D0.SBMAX_l;it++)ot.width[it]=tt.scalefac_band.l[it+1]-tt.scalefac_band.l[it],ot.window[it]=3;if(ot.block_type==D0.SHORT_TYPE){var at=K1(576);ot.sfb_smin=0,ot.sfb_lmax=0,ot.mixed_block_flag!=0&&(ot.sfb_smin=3,ot.sfb_lmax=tt.mode_gr*2+4),ot.psymax=ot.sfb_lmax+3*((tt.sfb21_extra?D0.SBMAX_s:D0.SBPSY_s)-ot.sfb_smin),ot.sfbmax=ot.sfb_lmax+3*(D0.SBPSY_s-ot.sfb_smin),ot.sfbdivide=ot.sfbmax-18,ot.psy_lmax=ot.sfb_lmax;var ut=tt.scalefac_band.l[ot.sfb_lmax];y1.arraycopy(ot.xr,0,at,0,576);for(var it=ot.sfb_smin;it<D0.SBMAX_s;it++)for(var lt=tt.scalefac_band.s[it],ct=tt.scalefac_band.s[it+1],ft=0;ft<3;ft++)for(var dt=lt;dt<ct;dt++)ot.xr[ut++]=at[3*dt+ft];for(var yt=ot.sfb_lmax,it=ot.sfb_smin;it<D0.SBMAX_s;it++)ot.width[yt]=ot.width[yt+1]=ot.width[yt+2]=tt.scalefac_band.s[it+1]-tt.scalefac_band.s[it],ot.window[yt]=0,ot.window[yt+1]=1,ot.window[yt+2]=2,yt+=3}ot.count1bits=0,ot.sfb_partition_table=s.nr_of_sfb_block[0][0],ot.slen[0]=0,ot.slen[1]=0,ot.slen[2]=0,ot.slen[3]=0,ot.max_nonzero_coeff=575,X1.fill(ot.scalefac,0),_(tt,ot)};function j(tt){this.ordinal=tt}j.BINSEARCH_NONE=new j(0),j.BINSEARCH_UP=new j(1),j.BINSEARCH_DOWN=new j(2);function nt(tt,ot,it,at,ut){var lt,ct=tt.CurrentStep[at],ft=!1,dt=tt.OldValue[at],yt=j.BINSEARCH_NONE;for(ot.global_gain=dt,it-=ot.part2_length;;){var St;if(lt=h.count_bits(tt,ut,ot,null),ct==1||lt==it)break;lt>it?(yt==j.BINSEARCH_DOWN&&(ft=!0),ft&&(ct/=2),yt=j.BINSEARCH_UP,St=ct):(yt==j.BINSEARCH_UP&&(ft=!0),ft&&(ct/=2),yt=j.BINSEARCH_DOWN,St=-ct),ot.global_gain+=St,ot.global_gain<0&&(ot.global_gain=0,ft=!0),ot.global_gain>255&&(ot.global_gain=255,ft=!0)}for(U1(ot.global_gain>=0),U1(ot.global_gain<256);lt>it&&ot.global_gain<255;)ot.global_gain++,lt=h.count_bits(tt,ut,ot,null);return tt.CurrentStep[at]=dt-ot.global_gain>=4?4:2,tt.OldValue[at]=ot.global_gain,ot.part2_3_length=lt,lt}this.trancate_smallspectrums=function(tt,ot,it,at){var ut=K1(va.SFBMAX);if(!(!(tt.substep_shaping&4)&&ot.block_type==D0.SHORT_TYPE||tt.substep_shaping&128)){s.calc_noise(ot,it,ut,new we,null);for(var ct=0;ct<576;ct++){var lt=0;ot.l3_enc[ct]!=0&&(lt=Math.abs(ot.xr[ct])),at[ct]=lt}var ct=0,ft=8;ot.block_type==D0.SHORT_TYPE&&(ft=6);do{var dt,yt,St,bt,Tt=ot.width[ft];if(ct+=Tt,!(ut[ft]>=1)&&(X1.sort(at,ct-Tt,Tt),!BitStream.EQ(at[ct-1],0))){dt=(1-ut[ft])*it[ft],yt=0,bt=0;do{var vt;for(St=1;bt+St<Tt&&!BitStream.NEQ(at[bt+ct-Tt],at[bt+ct+St-Tt]);St++);if(vt=at[bt+ct-Tt]*at[bt+ct-Tt]*St,dt<vt){bt!=0&&(yt=at[bt+ct-Tt-1]);break}dt-=vt,bt+=St}while(bt<Tt);if(!BitStream.EQ(yt,0))do Math.abs(ot.xr[ct-Tt])<=yt&&(ot.l3_enc[ct-Tt]=0);while(--Tt>0)}}while(++ft<ot.psymax);ot.part2_3_length=h.noquant_count_bits(tt,ot,null)}};function et(tt){for(var ot=0;ot<tt.sfbmax;ot++)if(tt.scalefac[ot]+tt.subblock_gain[tt.window[ot]]==0)return!1;return!0}function b(tt){return ye.FAST_LOG10(.368+.632*tt*tt*tt)}function a(tt,ot){for(var it=1e-37,at=0;at<ot.psymax;at++)it+=b(tt[at]);return Math.max(1e-20,it)}function o(tt,ot,it,at,ut){var lt;switch(tt){default:case 9:{ot.over_count>0?(lt=it.over_SSD<=ot.over_SSD,it.over_SSD==ot.over_SSD&&(lt=it.bits<ot.bits)):lt=it.max_noise<0&&it.max_noise*10+it.bits<=ot.max_noise*10+ot.bits;break}case 0:lt=it.over_count<ot.over_count||it.over_count==ot.over_count&&it.over_noise<ot.over_noise||it.over_count==ot.over_count&&BitStream.EQ(it.over_noise,ot.over_noise)&&it.tot_noise<ot.tot_noise;break;case 8:it.max_noise=a(ut,at);case 1:lt=it.max_noise<ot.max_noise;break;case 2:lt=it.tot_noise<ot.tot_noise;break;case 3:lt=it.tot_noise<ot.tot_noise&&it.max_noise<ot.max_noise;break;case 4:lt=it.max_noise<=0&&ot.max_noise>.2||it.max_noise<=0&&ot.max_noise<0&&ot.max_noise>it.max_noise-.2&&it.tot_noise<ot.tot_noise||it.max_noise<=0&&ot.max_noise>0&&ot.max_noise>it.max_noise-.2&&it.tot_noise<ot.tot_noise+ot.over_noise||it.max_noise>0&&ot.max_noise>-.05&&ot.max_noise>it.max_noise-.1&&it.tot_noise+it.over_noise<ot.tot_noise+ot.over_noise||it.max_noise>0&&ot.max_noise>-.1&&ot.max_noise>it.max_noise-.15&&it.tot_noise+it.over_noise+it.over_noise<ot.tot_noise+ot.over_noise+ot.over_noise;break;case 5:lt=it.over_noise<ot.over_noise||BitStream.EQ(it.over_noise,ot.over_noise)&&it.tot_noise<ot.tot_noise;break;case 6:lt=it.over_noise<ot.over_noise||BitStream.EQ(it.over_noise,ot.over_noise)&&(it.max_noise<ot.max_noise||BitStream.EQ(it.max_noise,ot.max_noise)&&it.tot_noise<=ot.tot_noise);break;case 7:lt=it.over_count<ot.over_count||it.over_noise<ot.over_noise;break}return ot.over_count==0&&(lt=lt&&it.bits<ot.bits),lt}function d(tt,ot,it,at,ut){var lt=tt.internal_flags,ct;ot.scalefac_scale==0?ct=1.2968395546510096:ct=1.6817928305074292;for(var ft=0,dt=0;dt<ot.sfbmax;dt++)ft<it[dt]&&(ft=it[dt]);var yt=lt.noise_shaping_amp;switch(yt==3&&(ut?yt=2:yt=1),yt){case 2:break;case 1:ft>1?ft=Math.pow(ft,.5):ft*=.95;break;case 0:default:ft>1?ft=1:ft*=.95;break}for(var St=0,dt=0;dt<ot.sfbmax;dt++){var bt=ot.width[dt],Tt;if(St+=bt,!(it[dt]<ft)){if(lt.substep_shaping&2&&(lt.pseudohalf[dt]=lt.pseudohalf[dt]==0?1:0,lt.pseudohalf[dt]==0&<.noise_shaping_amp==2))return;for(ot.scalefac[dt]++,Tt=-bt;Tt<0;Tt++)at[St+Tt]*=ct,at[St+Tt]>ot.xrpow_max&&(ot.xrpow_max=at[St+Tt]);if(lt.noise_shaping_amp==2)return}}}function g(tt,ot){for(var it=1.2968395546510096,at=0,ut=0;ut<tt.sfbmax;ut++){var lt=tt.width[ut],ct=tt.scalefac[ut];if(tt.preflag!=0&&(ct+=s.pretab[ut]),at+=lt,ct&1){ct++;for(var ft=-lt;ft<0;ft++)ot[at+ft]*=it,ot[at+ft]>tt.xrpow_max&&(tt.xrpow_max=ot[at+ft])}tt.scalefac[ut]=ct>>1}tt.preflag=0,tt.scalefac_scale=1}function rt(tt,ot,it){var at,ut=ot.scalefac;for(at=0;at<ot.sfb_lmax;at++)if(ut[at]>=16)return!0;for(var lt=0;lt<3;lt++){var ct=0,ft=0;for(at=ot.sfb_lmax+lt;at<ot.sfbdivide;at+=3)ct<ut[at]&&(ct=ut[at]);for(;at<ot.sfbmax;at+=3)ft<ut[at]&&(ft=ut[at]);if(!(ct<16&&ft<8)){if(ot.subblock_gain[lt]>=7)return!0;ot.subblock_gain[lt]++;var dt=tt.scalefac_band.l[ot.sfb_lmax];for(at=ot.sfb_lmax+lt;at<ot.sfbmax;at+=3){var yt,St=ot.width[at],bt=ut[at];if(bt=bt-(4>>ot.scalefac_scale),bt>=0){ut[at]=bt,dt+=St*3;continue}ut[at]=0;{var Tt=210+(bt<<ot.scalefac_scale+1);yt=s.IPOW20(Tt)}dt+=St*(lt+1);for(var vt=-St;vt<0;vt++)it[dt+vt]*=yt,it[dt+vt]>ot.xrpow_max&&(ot.xrpow_max=it[dt+vt]);dt+=St*(3-lt-1)}{var yt=s.IPOW20(202);dt+=ot.width[at]*(lt+1);for(var vt=-ot.width[at];vt<0;vt++)it[dt+vt]*=yt,it[dt+vt]>ot.xrpow_max&&(ot.xrpow_max=it[dt+vt])}}}return!1}function st(tt,ot,it,at,ut){var lt=tt.internal_flags;d(tt,ot,it,at,ut);var ct=et(ot);return ct?!1:(lt.mode_gr==2?ct=h.scale_bitcount(ot):ct=h.scale_bitcount_lsf(lt,ot),ct?(lt.noise_shaping>1&&(X1.fill(lt.pseudohalf,0),ot.scalefac_scale==0?(g(ot,at),ct=!1):ot.block_type==D0.SHORT_TYPE&<.subblock_gain>0&&(ct=rt(lt,ot,at)||et(ot))),ct||(lt.mode_gr==2?ct=h.scale_bitcount(ot):ct=h.scale_bitcount_lsf(lt,ot)),!ct):!0)}this.outer_loop=function(tt,ot,it,at,ut,lt){var ct=tt.internal_flags,ft=new la,dt=K1(576),yt=K1(va.SFBMAX),St=new we,bt,Tt=new G2,vt=9999999,$t=!1,At=!1,Ot=0;if(nt(ct,ot,lt,ut,at),ct.noise_shaping==0)return 100;s.calc_noise(ot,it,yt,St,Tt),St.bits=ot.part2_3_length,ft.assign(ot);var It=0;for(y1.arraycopy(at,0,dt,0,576);!$t;){do{var jt=new we,Et,mt=255;if(ct.substep_shaping&2?Et=20:Et=3,ct.sfb21_extra&&(yt[ft.sfbmax]>1||ft.block_type==D0.SHORT_TYPE&&(yt[ft.sfbmax+1]>1||yt[ft.sfbmax+2]>1))||!st(tt,ft,yt,at,At))break;ft.scalefac_scale!=0&&(mt=254);var gt=lt-ft.part2_length;if(gt<=0)break;for(;(ft.part2_3_length=h.count_bits(ct,at,ft,Tt))>gt&&ft.global_gain<=mt;)ft.global_gain++;if(ft.global_gain>mt)break;if(St.over_count==0){for(;(ft.part2_3_length=h.count_bits(ct,at,ft,Tt))>vt&&ft.global_gain<=mt;)ft.global_gain++;if(ft.global_gain>mt)break}if(s.calc_noise(ft,it,yt,jt,Tt),jt.bits=ft.part2_3_length,ot.block_type!=D0.SHORT_TYPE?bt=tt.quant_comp:bt=tt.quant_comp_short,bt=o(bt,St,jt,ft,yt)?1:0,bt!=0)vt=ot.part2_3_length,St=jt,ot.assign(ft),It=0,y1.arraycopy(at,0,dt,0,576);else if(ct.full_outer_loop==0&&(++It>Et&&St.over_count==0||ct.noise_shaping_amp==3&&At&&It>30||ct.noise_shaping_amp==3&&At&&ft.global_gain-Ot>15))break}while(ft.global_gain+ft.scalefac_scale<255);ct.noise_shaping_amp==3?At?$t=!0:(ft.assign(ot),y1.arraycopy(dt,0,at,0,576),It=0,Ot=ft.global_gain,At=!0):$t=!0}return U1(ot.global_gain+ot.scalefac_scale<=255),tt.VBR==_a$2.vbr_rh||tt.VBR==_a$2.vbr_mtrh?y1.arraycopy(dt,0,at,0,576):ct.substep_shaping&1&&trancate_smallspectrums(ct,ot,it,at),St.over_count},this.iteration_finish_one=function(tt,ot,it){var at=tt.l3_side,ut=at.tt[ot][it];h.best_scalefac_store(tt,ot,it,at),tt.use_best_huffman==1&&h.best_huffman_divide(tt,ut),e.ResvAdjust(tt,ut)},this.VBR_encode_granule=function(tt,ot,it,at,ut,lt,ct){var ft=tt.internal_flags,dt=new la,yt=K1(576),St=ct,bt=ct+1,Tt=(ct+lt)/2,vt,$t,At=0,Ot=ft.sfb21_extra;U1(St<=LameInternalFlags.MAX_BITS_PER_CHANNEL),X1.fill(dt.l3_enc,0);do Tt>St-42?ft.sfb21_extra=!1:ft.sfb21_extra=Ot,$t=outer_loop(tt,ot,it,at,ut,Tt),$t<=0?(At=1,bt=ot.part2_3_length,dt.assign(ot),y1.arraycopy(at,0,yt,0,576),ct=bt-32,vt=ct-lt,Tt=(ct+lt)/2):(lt=Tt+32,vt=ct-lt,Tt=(ct+lt)/2,At!=0&&(At=2,ot.assign(dt),y1.arraycopy(yt,0,at,0,576)));while(vt>12);ft.sfb21_extra=Ot,At==2&&y1.arraycopy(dt.l3_enc,0,ot.l3_enc,0,576),U1(ot.part2_3_length<=St)},this.get_framebits=function(tt,ot){var it=tt.internal_flags;it.bitrate_index=it.VBR_min_bitrate;var at=i.getframebits(tt);it.bitrate_index=1,at=i.getframebits(tt);for(var ut=1;ut<=it.VBR_max_bitrate;ut++){it.bitrate_index=ut;var lt=new MeanBits(at);ot[ut]=e.ResvFrameBegin(tt,lt),at=lt.bits}},this.VBR_old_prepare=function(tt,ot,it,at,ut,lt,ct,ft,dt){var yt=tt.internal_flags,St,bt=0,Tt=1,vt=0;yt.bitrate_index=yt.VBR_max_bitrate;var $t=e.ResvFrameBegin(tt,new MeanBits(0))/yt.mode_gr;get_framebits(tt,lt);for(var At=0;At<yt.mode_gr;At++){var Ot=s.on_pe(tt,ot,ft[At],$t,At,0);yt.mode_ext==D0.MPG_MD_MS_LR&&(ms_convert(yt.l3_side,At),s.reduce_side(ft[At],it[At],$t,Ot));for(var It=0;It<yt.channels_out;++It){var jt=yt.l3_side.tt[At][It];jt.block_type!=D0.SHORT_TYPE?(bt=1.28/(1+Math.exp(3.5-ot[At][It]/300))-.05,St=yt.PSY.mask_adjust-bt):(bt=2.56/(1+Math.exp(3.5-ot[At][It]/300))-.14,St=yt.PSY.mask_adjust_short-bt),yt.masking_lower=Math.pow(10,St*.1),init_outer_loop(yt,jt),dt[At][It]=s.calc_xmin(tt,at[At][It],jt,ut[At][It]),dt[At][It]!=0&&(Tt=0),ct[At][It]=126,vt+=ft[At][It]}}for(var At=0;At<yt.mode_gr;At++)for(var It=0;It<yt.channels_out;It++)vt>lt[yt.VBR_max_bitrate]&&(ft[At][It]*=lt[yt.VBR_max_bitrate],ft[At][It]/=vt),ct[At][It]>ft[At][It]&&(ct[At][It]=ft[At][It]);return Tt},this.bitpressure_strategy=function(tt,ot,it,at){for(var ut=0;ut<tt.mode_gr;ut++)for(var lt=0;lt<tt.channels_out;lt++){for(var ct=tt.l3_side.tt[ut][lt],ft=ot[ut][lt],dt=0,yt=0;yt<ct.psy_lmax;yt++)ft[dt++]*=1+.029*yt*yt/D0.SBMAX_l/D0.SBMAX_l;if(ct.block_type==D0.SHORT_TYPE)for(var yt=ct.sfb_smin;yt<D0.SBMAX_s;yt++)ft[dt++]*=1+.029*yt*yt/D0.SBMAX_s/D0.SBMAX_s,ft[dt++]*=1+.029*yt*yt/D0.SBMAX_s/D0.SBMAX_s,ft[dt++]*=1+.029*yt*yt/D0.SBMAX_s/D0.SBMAX_s;at[ut][lt]=0|Math.max(it[ut][lt],.9*at[ut][lt])}},this.VBR_new_prepare=function(tt,ot,it,at,ut,lt){var ct=tt.internal_flags,ft=1,dt=0,yt=0,St;if(tt.free_format){ct.bitrate_index=0;var bt=new MeanBits(dt);St=e.ResvFrameBegin(tt,bt),dt=bt.bits,ut[0]=St}else{ct.bitrate_index=ct.VBR_max_bitrate;var bt=new MeanBits(dt);e.ResvFrameBegin(tt,bt),dt=bt.bits,get_framebits(tt,ut),St=ut[ct.VBR_max_bitrate]}for(var Tt=0;Tt<ct.mode_gr;Tt++){s.on_pe(tt,ot,lt[Tt],dt,Tt,0),ct.mode_ext==D0.MPG_MD_MS_LR&&ms_convert(ct.l3_side,Tt);for(var vt=0;vt<ct.channels_out;++vt){var $t=ct.l3_side.tt[Tt][vt];ct.masking_lower=Math.pow(10,ct.PSY.mask_adjust*.1),init_outer_loop(ct,$t),s.calc_xmin(tt,it[Tt][vt],$t,at[Tt][vt])!=0&&(ft=0),yt+=lt[Tt][vt]}}for(var Tt=0;Tt<ct.mode_gr;Tt++)for(var vt=0;vt<ct.channels_out;vt++)yt>St&&(lt[Tt][vt]*=St,lt[Tt][vt]/=yt);return ft},this.calc_target_bits=function(tt,ot,it,at,ut,lt){var ct=tt.internal_flags,ft=ct.l3_side,dt,yt,St,bt,Tt=0;ct.bitrate_index=ct.VBR_max_bitrate;var vt=new MeanBits(Tt);for(lt[0]=e.ResvFrameBegin(tt,vt),Tt=vt.bits,ct.bitrate_index=1,Tt=i.getframebits(tt)-ct.sideinfo_len*8,ut[0]=Tt/(ct.mode_gr*ct.channels_out),Tt=tt.VBR_mean_bitrate_kbps*tt.framesize*1e3,ct.substep_shaping&1&&(Tt*=1.09),Tt/=tt.out_samplerate,Tt-=ct.sideinfo_len*8,Tt/=ct.mode_gr*ct.channels_out,dt=.93+.07*(11-tt.compression_ratio)/(11-5.5),dt<.9&&(dt=.9),dt>1&&(dt=1),yt=0;yt<ct.mode_gr;yt++){var $t=0;for(St=0;St<ct.channels_out;St++){if(at[yt][St]=int(dt*Tt),ot[yt][St]>700){var At=int((ot[yt][St]-700)/1.4),Ot=ft.tt[yt][St];at[yt][St]=int(dt*Tt),Ot.block_type==D0.SHORT_TYPE&&At<Tt/2&&(At=Tt/2),At>Tt*3/2?At=Tt*3/2:At<0&&(At=0),at[yt][St]+=At}at[yt][St]>LameInternalFlags.MAX_BITS_PER_CHANNEL&&(at[yt][St]=LameInternalFlags.MAX_BITS_PER_CHANNEL),$t+=at[yt][St]}if($t>LameInternalFlags.MAX_BITS_PER_GRANULE)for(St=0;St<ct.channels_out;++St)at[yt][St]*=LameInternalFlags.MAX_BITS_PER_GRANULE,at[yt][St]/=$t}if(ct.mode_ext==D0.MPG_MD_MS_LR)for(yt=0;yt<ct.mode_gr;yt++)s.reduce_side(at[yt],it[yt],Tt*ct.channels_out,LameInternalFlags.MAX_BITS_PER_GRANULE);for(bt=0,yt=0;yt<ct.mode_gr;yt++)for(St=0;St<ct.channels_out;St++)at[yt][St]>LameInternalFlags.MAX_BITS_PER_CHANNEL&&(at[yt][St]=LameInternalFlags.MAX_BITS_PER_CHANNEL),bt+=at[yt][St];if(bt>lt[0])for(yt=0;yt<ct.mode_gr;yt++)for(St=0;St<ct.channels_out;St++)at[yt][St]*=lt[0],at[yt][St]/=bt}}var P2=$2,Z2=Q0,oa=Z2.assert;function K2(){var i;this.setModules=function(e){i=e},this.ResvFrameBegin=function(e,s){var c=e.internal_flags,h,$=c.l3_side,_=i.getframebits(e);s.bits=(_-c.sideinfo_len*8)/c.mode_gr;var j=8*256*c.mode_gr-8;e.brate>320?h=8*int(e.brate*1e3/(e.out_samplerate/1152)/8+.5):(h=8*1440,e.strict_ISO&&(h=8*int(32e4/(e.out_samplerate/1152)/8+.5))),c.ResvMax=h-_,c.ResvMax>j&&(c.ResvMax=j),(c.ResvMax<0||e.disable_reservoir)&&(c.ResvMax=0);var nt=s.bits*c.mode_gr+Math.min(c.ResvSize,c.ResvMax);return nt>h&&(nt=h),oa(c.ResvMax%8==0),oa(c.ResvMax>=0),$.resvDrain_pre=0,c.pinfo!=null&&(c.pinfo.mean_bits=s.bits/2,c.pinfo.resvsize=c.ResvSize),nt},this.ResvMaxBits=function(e,s,c,h){var $=e.internal_flags,_,j=$.ResvSize,nt=$.ResvMax;h!=0&&(j+=s),$.substep_shaping&1&&(nt*=.9),c.bits=s,j*10>nt*9?(_=j-nt*9/10,c.bits+=_,$.substep_shaping|=128):(_=0,$.substep_shaping&=127,!e.disable_reservoir&&!($.substep_shaping&1)&&(c.bits-=.1*s));var et=j<$.ResvMax*6/10?j:$.ResvMax*6/10;return et-=_,et<0&&(et=0),et},this.ResvAdjust=function(e,s){e.ResvSize-=s.part2_3_length+s.part2_length},this.ResvFrameEnd=function(e,s){var c,h=e.l3_side;e.ResvSize+=s*e.mode_gr;var $=0;h.resvDrain_post=0,h.resvDrain_pre=0,(c=e.ResvSize%8)!=0&&($+=c),c=e.ResvSize-$-e.ResvMax,c>0&&($+=c);{var _=Math.min(h.main_data_begin*8,$)/8;h.resvDrain_pre+=8*_,$-=8*_,e.ResvSize-=8*_,h.main_data_begin-=_}h.resvDrain_post+=$,e.ResvSize-=$}}var U2=K2;function Q2(){var i="http://www.mp3dev.org/",e=3,s=98,c=4,h=0,$=93;this.getLameVersion=function(){return e+"."+s+"."+c},this.getLameShortVersion=function(){return e+"."+s+"."+c},this.getLameVeryShortVersion=function(){return"LAME"+e+"."+s+"r"},this.getPsyVersion=function(){return h+"."+$},this.getLameUrl=function(){return i},this.getLameOsBitness=function(){return"32bits"}}var W2=Q2,D1=Q0,j2=D1.System,Ie=D1.VbrMode,ha=D1.ShortBlock,z2=D1.Arrays,te=D1.new_byte,J2=D1.assert;Q1.NUMTOCENTRIES=100,Q1.MAXFRAMESIZE=2880;function Q1(){var i,e,s;this.setModules=function(Tt,vt,$t){i=Tt,e=vt,s=$t};var c=1,h=2,$=4,_=8,j=Q1.NUMTOCENTRIES,nt=Q1.MAXFRAMESIZE,et=j+4+4+4+4+4,b=et+9+1+1+8+1+1+3+1+1+2+4+2+2,a=128,o=64,d=32,g=null,rt="Xing",st="Info",tt=[0,49345,49537,320,49921,960,640,49729,50689,1728,1920,51009,1280,50625,50305,1088,52225,3264,3456,52545,3840,53185,52865,3648,2560,51905,52097,2880,51457,2496,2176,51265,55297,6336,6528,55617,6912,56257,55937,6720,7680,57025,57217,8e3,56577,7616,7296,56385,5120,54465,54657,5440,55041,6080,5760,54849,53761,4800,4992,54081,4352,53697,53377,4160,61441,12480,12672,61761,13056,62401,62081,12864,13824,63169,63361,14144,62721,13760,13440,62529,15360,64705,64897,15680,65281,16320,16e3,65089,64001,15040,15232,64321,14592,63937,63617,14400,10240,59585,59777,10560,60161,11200,10880,59969,60929,11968,12160,61249,11520,60865,60545,11328,58369,9408,9600,58689,9984,59329,59009,9792,8704,58049,58241,9024,57601,8640,8320,57409,40961,24768,24960,41281,25344,41921,41601,25152,26112,42689,42881,26432,42241,26048,25728,42049,27648,44225,44417,27968,44801,28608,28288,44609,43521,27328,27520,43841,26880,43457,43137,26688,30720,47297,47489,31040,47873,31680,31360,47681,48641,32448,32640,48961,32e3,48577,48257,31808,46081,29888,30080,46401,30464,47041,46721,30272,29184,45761,45953,29504,45313,29120,28800,45121,20480,37057,37249,20800,37633,21440,21120,37441,38401,22208,22400,38721,21760,38337,38017,21568,39937,23744,23936,40257,24320,40897,40577,24128,23040,39617,39809,23360,39169,22976,22656,38977,34817,18624,18816,35137,19200,35777,35457,19008,19968,36545,36737,20288,36097,19904,19584,35905,17408,33985,34177,17728,34561,18368,18048,34369,33281,17088,17280,33601,16640,33217,32897,16448];function ot(Tt,vt){if(Tt.nVbrNumFrames++,Tt.sum+=vt,Tt.seen++,!(Tt.seen<Tt.want)&&(Tt.pos<Tt.size&&(Tt.bag[Tt.pos]=Tt.sum,Tt.pos++,Tt.seen=0),Tt.pos==Tt.size)){for(var $t=1;$t<Tt.size;$t+=2)Tt.bag[$t/2]=Tt.bag[$t];Tt.want*=2,Tt.pos/=2}}function it(Tt,vt){if(!(Tt.pos<=0))for(var $t=1;$t<j;++$t){var At=$t/j,Ot,It,jt=0|Math.floor(At*Tt.pos);jt>Tt.pos-1&&(jt=Tt.pos-1),Ot=Tt.bag[jt],It=Tt.sum;var Et=0|256*Ot/It;Et>255&&(Et=255),vt[$t]=255&Et}}this.addVbrFrame=function(Tt){var vt=Tt.internal_flags,$t=Tables.bitrate_table[Tt.version][vt.bitrate_index];J2(vt.VBR_seek_table.bag!=null),ot(vt.VBR_seek_table,$t)};function at(Tt,vt){var $t=Tt[vt+0]&255;return $t<<=8,$t|=Tt[vt+1]&255,$t<<=8,$t|=Tt[vt+2]&255,$t<<=8,$t|=Tt[vt+3]&255,$t}function ut(Tt,vt,$t){Tt[vt+0]=255&($t>>24&255),Tt[vt+1]=255&($t>>16&255),Tt[vt+2]=255&($t>>8&255),Tt[vt+3]=255&($t&255)}function lt(Tt,vt,$t){Tt[vt+0]=255&($t>>8&255),Tt[vt+1]=255&($t&255)}function ct(Tt,vt){return new String(Tt,vt,rt.length(),g).equals(rt)||new String(Tt,vt,st.length(),g).equals(st)}function ft(Tt,vt,$t){return 255&(Tt<<vt|$t&~(-1<<vt))}function dt(Tt,vt){var $t=Tt.internal_flags;vt[0]=ft(vt[0],8,255),vt[1]=ft(vt[1],3,7),vt[1]=ft(vt[1],1,Tt.out_samplerate<16e3?0:1),vt[1]=ft(vt[1],1,Tt.version),vt[1]=ft(vt[1],2,1),vt[1]=ft(vt[1],1,Tt.error_protection?0:1),vt[2]=ft(vt[2],4,$t.bitrate_index),vt[2]=ft(vt[2],2,$t.samplerate_index),vt[2]=ft(vt[2],1,0),vt[2]=ft(vt[2],1,Tt.extension),vt[3]=ft(vt[3],2,Tt.mode.ordinal()),vt[3]=ft(vt[3],2,$t.mode_ext),vt[3]=ft(vt[3],1,Tt.copyright),vt[3]=ft(vt[3],1,Tt.original),vt[3]=ft(vt[3],2,Tt.emphasis),vt[0]=255;var At=255&(vt[1]&241),Ot;Tt.version==1?Ot=a:Tt.out_samplerate<16e3?Ot=d:Ot=o,Tt.VBR==Ie.vbr_off&&(Ot=Tt.brate);var It;Tt.free_format?It=0:It=255&16*i.BitrateIndex(Ot,Tt.version,Tt.out_samplerate),Tt.version==1?(vt[1]=255&(At|10),At=255&(vt[2]&13),vt[2]=255&(It|At)):(vt[1]=255&(At|2),At=255&(vt[2]&13),vt[2]=255&(It|At))}this.getVbrTag=function(Tt){var vt=new VBRTagData,$t=0;vt.flags=0;var At=Tt[$t+1]>>3&1,Ot=Tt[$t+2]>>2&3,It=Tt[$t+3]>>6&3,jt=Tt[$t+2]>>4&15;if(jt=Tables.bitrate_table[At][jt],Tt[$t+1]>>4==14?vt.samprate=Tables.samplerate_table[2][Ot]:vt.samprate=Tables.samplerate_table[At][Ot],At!=0?It!=3?$t+=36:$t+=21:It!=3?$t+=21:$t+=13,!ct(Tt,$t))return null;$t+=4,vt.hId=At;var Et=vt.flags=at(Tt,$t);if($t+=4,Et&c&&(vt.frames=at(Tt,$t),$t+=4),Et&h&&(vt.bytes=at(Tt,$t),$t+=4),Et&$){if(vt.toc!=null)for(var mt=0;mt<j;mt++)vt.toc[mt]=Tt[$t+mt];$t+=j}vt.vbrScale=-1,Et&_&&(vt.vbrScale=at(Tt,$t),$t+=4),vt.headersize=(At+1)*72e3*jt/vt.samprate,$t+=21;var gt=Tt[$t+0]<<4;gt+=Tt[$t+1]>>4;var ht=(Tt[$t+1]&15)<<8;return ht+=Tt[$t+2]&255,(gt<0||gt>3e3)&&(gt=-1),(ht<0||ht>3e3)&&(ht=-1),vt.encDelay=gt,vt.encPadding=ht,vt},this.InitVbrTag=function(Tt){var vt=Tt.internal_flags,$t;Tt.version==1?$t=a:Tt.out_samplerate<16e3?$t=d:$t=o,Tt.VBR==Ie.vbr_off&&($t=Tt.brate);var At=(Tt.version+1)*72e3*$t/Tt.out_samplerate,Ot=vt.sideinfo_len+b;if(vt.VBR_seek_table.TotalFrameSize=At,At<Ot||At>nt){Tt.bWriteVbrTag=!1;return}vt.VBR_seek_table.nVbrNumFrames=0,vt.VBR_seek_table.nBytesWritten=0,vt.VBR_seek_table.sum=0,vt.VBR_seek_table.seen=0,vt.VBR_seek_table.want=1,vt.VBR_seek_table.pos=0,vt.VBR_seek_table.bag==null&&(vt.VBR_seek_table.bag=new int[400],vt.VBR_seek_table.size=400);var It=te(nt);dt(Tt,It);for(var jt=vt.VBR_seek_table.TotalFrameSize,Et=0;Et<jt;++Et)e.add_dummy_byte(Tt,It[Et]&255,1)};function yt(Tt,vt){var $t=vt^Tt;return vt=vt>>8^tt[$t&255],vt}this.updateMusicCRC=function(Tt,vt,$t,At){for(var Ot=0;Ot<At;++Ot)Tt[0]=yt(vt[$t+Ot],Tt[0])};function St(Tt,vt,$t,At,Ot){var It=Tt.internal_flags,jt=0,Et=Tt.encoder_delay,mt=Tt.encoder_padding,gt=100-10*Tt.VBR_q-Tt.quality,ht=s.getLameVeryShortVersion(),pt,_t=0,Ct,zt=[1,5,3,2,4,0,3],Nt=0|(Tt.lowpassfreq/100+.5>255?255:Tt.lowpassfreq/100+.5),Ht=0,Jt=0,un=0,yn=Tt.internal_flags.noise_shaping,vn=0,mn=0,Tn=0,Pn=0,Gn=0,wr=(Tt.exp_nspsytune&1)!=0,xt=(Tt.exp_nspsytune&2)!=0,Pt=!1,wn=!1,bn=Tt.internal_flags.nogap_total,Dn=Tt.internal_flags.nogap_current,Rn=Tt.ATHtype,_n=0,On;switch(Tt.VBR){case vbr_abr:On=Tt.VBR_mean_bitrate_kbps;break;case vbr_off:On=Tt.brate;break;default:On=Tt.VBR_min_bitrate_kbps}switch(Tt.VBR.ordinal()<zt.length?pt=zt[Tt.VBR.ordinal()]:pt=0,Ct=16*_t+pt,It.findReplayGain&&(It.RadioGain>510&&(It.RadioGain=510),It.RadioGain<-510&&(It.RadioGain=-510),Jt=8192,Jt|=3072,It.RadioGain>=0?Jt|=It.RadioGain:(Jt|=512,Jt|=-It.RadioGain)),It.findPeakSample&&(Ht=Math.abs(0|It.PeakSample/32767*Math.pow(2,23)+.5)),bn!=-1&&(Dn>0&&(wn=!0),Dn<bn-1&&(Pt=!0)),_n=Rn+((wr?1:0)<<4)+((xt?1:0)<<5)+((Pt?1:0)<<6)+((wn?1:0)<<7),gt<0&&(gt=0),Tt.mode){case MONO:vn=0;break;case STEREO:vn=1;break;case DUAL_CHANNEL:vn=2;break;case JOINT_STEREO:Tt.force_ms?vn=4:vn=3;break;case NOT_SET:default:vn=7;break}Tt.in_samplerate<=32e3?Tn=0:Tt.in_samplerate==48e3?Tn=2:Tt.in_samplerate>48e3?Tn=3:Tn=1,(Tt.short_blocks==ha.short_block_forced||Tt.short_blocks==ha.short_block_dispensed||Tt.lowpassfreq==-1&&Tt.highpassfreq==-1||Tt.scale_left<Tt.scale_right||Tt.scale_left>Tt.scale_right||Tt.disable_reservoir&&Tt.brate<320||Tt.noATH||Tt.ATHonly||Rn==0||Tt.in_samplerate<=32e3)&&(mn=1),Pn=yn+(vn<<2)+(mn<<5)+(Tn<<6),Gn=It.nMusicCRC,ut($t,At+jt,gt),jt+=4;for(var Ln=0;Ln<9;Ln++)$t[At+jt+Ln]=255&ht.charAt(Ln);jt+=9,$t[At+jt]=255&Ct,jt++,$t[At+jt]=255&Nt,jt++,ut($t,At+jt,Ht),jt+=4,lt($t,At+jt,Jt),jt+=2,lt($t,At+jt,un),jt+=2,$t[At+jt]=255&_n,jt++,On>=255?$t[At+jt]=255:$t[At+jt]=255&On,jt++,$t[At+jt]=255&Et>>4,$t[At+jt+1]=255&(Et<<4)+(mt>>8),$t[At+jt+2]=255&mt,jt+=3,$t[At+jt]=255&Pn,jt++,$t[At+jt++]=0,lt($t,At+jt,Tt.preset),jt+=2,ut($t,At+jt,vt),jt+=4,lt($t,At+jt,Gn),jt+=2;for(var Nn=0;Nn<jt;Nn++)Ot=yt($t[At+Nn],Ot);return lt($t,At+jt,Ot),jt+=2,jt}function bt(Tt){Tt.seek(0);var vt=te(10);Tt.readFully(vt);var $t;return new String(vt,"ISO-8859-1").startsWith("ID3")?$t=0:$t=((vt[6]&127)<<21|(vt[7]&127)<<14|(vt[8]&127)<<7|vt[9]&127)+vt.length,$t}this.getLameTagFrame=function(Tt,vt){var $t=Tt.internal_flags;if(!Tt.bWriteVbrTag||$t.Class_ID!=Lame.LAME_ID||$t.VBR_seek_table.pos<=0)return 0;if(vt.length<$t.VBR_seek_table.TotalFrameSize)return $t.VBR_seek_table.TotalFrameSize;z2.fill(vt,0,$t.VBR_seek_table.TotalFrameSize,0),dt(Tt,vt);var At=te(j);if(Tt.free_format)for(var Ot=1;Ot<j;++Ot)At[Ot]=255&255*Ot/100;else it($t.VBR_seek_table,At);var It=$t.sideinfo_len;Tt.error_protection&&(It-=2),Tt.VBR==Ie.vbr_off?(vt[It++]=255&st.charAt(0),vt[It++]=255&st.charAt(1),vt[It++]=255&st.charAt(2),vt[It++]=255&st.charAt(3)):(vt[It++]=255&rt.charAt(0),vt[It++]=255&rt.charAt(1),vt[It++]=255&rt.charAt(2),vt[It++]=255&rt.charAt(3)),ut(vt,It,c+h+$+_),It+=4,ut(vt,It,$t.VBR_seek_table.nVbrNumFrames),It+=4;var jt=$t.VBR_seek_table.nBytesWritten+$t.VBR_seek_table.TotalFrameSize;ut(vt,It,0|jt),It+=4,j2.arraycopy(At,0,vt,It,At.length),It+=At.length,Tt.error_protection&&e.CRC_writeheader($t,vt);for(var Et=0,Ot=0;Ot<It;Ot++)Et=yt(vt[Ot],Et);return It+=St(Tt,jt,vt,It,Et),$t.VBR_seek_table.TotalFrameSize},this.putVbrTag=function(Tt,vt){var $t=Tt.internal_flags;if($t.VBR_seek_table.pos<=0||(vt.seek(vt.length()),vt.length()==0))return-1;var At=bt(vt);vt.seek(At);var Ot=te(nt),It=getLameTagFrame(Tt,Ot);return It>Ot.length?-1:(It<1||vt.write(Ot,0,It),0)}}var g2=Q1,Fa=Q0,ua=Fa.new_byte,er=Fa.assert,ar=Oe(),rr=V2,tr=Na,sr=Va(),ir=P2,nr=Oa(),_r=U2,lr=j1,vr=Ve();t1();var or=W2,hr=g2;function ur(){this.setModules=function(i,e){}}function fr(){this.setModules=function(i,e,s){}}function mr(){}function br(){this.setModules=function(i,e){}}function cr(i,e,s){arguments.length!=3&&(console.error("WARN: Mp3Encoder(channels, samplerate, kbps) not specified"),i=1,e=44100,s=128);var c=new ar,h=new ur,$=new tr,_=new vr,j=new rr,nt=new sr,et=new ir,b=new hr,a=new or,o=new br,d=new _r,g=new nr,rt=new fr,st=new mr;c.setModules($,_,j,nt,et,b,a,o,st),_.setModules($,st,a,b),o.setModules(_,a),j.setModules(c),et.setModules(_,d,nt,g),nt.setModules(g,d,c.enc.psy),d.setModules(_),g.setModules(nt),b.setModules(c,_,a),h.setModules(rt,st),rt.setModules(a,o,j);var tt=c.lame_init();tt.num_channels=i,tt.in_samplerate=e,tt.brate=s,tt.mode=lr.STEREO,tt.quality=3,tt.bWriteVbrTag=!1,tt.disable_reservoir=!0,tt.write_id3tag_automatic=!1,c.lame_init_params(tt);var ot=1152,it=0|1.25*ot+7200,at=ua(it);this.encodeBuffer=function(ut,lt){i==1&&(lt=ut),er(ut.length==lt.length),ut.length>ot&&(ot=ut.length,it=0|1.25*ot+7200,at=ua(it));var ct=c.lame_encode_buffer(tt,ut,lt,ut.length,at,0,it);return new Int8Array(at.subarray(0,ct))},this.flush=function(){var ut=c.lame_encode_flush(tt,at,0,it);return new Int8Array(at.subarray(0,ut))}}function A1(){this.dataOffset=0,this.dataLen=0,this.channels=0,this.sampleRate=0}function _e(i){return i.charCodeAt(0)<<24|i.charCodeAt(1)<<16|i.charCodeAt(2)<<8|i.charCodeAt(3)}A1.RIFF=_e("RIFF"),A1.WAVE=_e("WAVE"),A1.fmt_=_e("fmt "),A1.data=_e("data"),A1.readHeader=function(i){var e=new A1,s=i.getUint32(0,!1);if(A1.RIFF==s&&(i.getUint32(4,!0),A1.WAVE==i.getUint32(8,!1)&&A1.fmt_==i.getUint32(12,!1))){var c=i.getUint32(16,!0),h=20;switch(c){case 16:case 18:e.channels=i.getUint16(h+2,!0),e.sampleRate=i.getUint32(h+4,!0);break;default:throw"extended fmt chunk not implemented"}h+=c;for(var $=A1.data,_=0;$!=s&&(s=i.getUint32(h,!1),_=i.getUint32(h+4,!0),$!=s);)h+=_+8;return e.dataLen=_,e.dataOffset=h+8,e}};var Sr=cr;const compressAudioToMp3=i=>{try{const e=new Sr(1,SAMPLING_RATE,BITRATE),s=new Int16Array(i.length);for(let _=0;_<i.length;_++){const j=Math.max(-1,Math.min(1,i[_]));s[_]=j<0?j*32768:j*32767}const c=[],h=e.encodeBuffer(s);h&&h.length>0&&c.push(h);const $=e.flush();return $&&$.length>0&&c.push($),c}catch(e){return console.error("Error compressing audio to MP3: lamejs: ",e),[]}};class AudioBufferManager{constructor(e,s){this.currentSampleLength=0,this.currentFrameLength=0,this.samplingRate=0,this.incrementalAllocationSize=0,this.samplingRate=e,this.incrementalAllocationSize=Math.floor(e*s),this.buffer=new Float32Array(this.incrementalAllocationSize),this.currentSampleLength=0}append(e){return this.currentSampleLength+e.length>this.buffer.length&&this.expandBuffer(),this.buffer.set(e,this.currentSampleLength),this.currentSampleLength+=e.length,this.currentFrameLength+=1,this.currentSampleLength}getAudioData(){return this.buffer.slice(0,this.currentSampleLength)}getCurrentSampleLength(){return this.currentSampleLength}getCurrentFrameLength(){return this.currentFrameLength}getDurationInSeconds(){return this.currentSampleLength/this.samplingRate}expandBuffer(){const e=this.buffer.length+this.incrementalAllocationSize,s=new Float32Array(e);s.set(this.buffer,0),this.buffer=s}calculateChunkTimestamps(e){const s=e/SAMPLING_RATE-this.getDurationInSeconds(),c=s+this.getDurationInSeconds(),h=Math.floor(s/60).toString().padStart(2,"0"),$=(s%60).toFixed(6).toString().padStart(2,"0"),_=`${h}:${$}`,j=Math.floor(c/60).toString().padStart(2,"0"),nt=(c%60).toFixed(6).toString().padStart(2,"0"),et=`${j}:${nt}`;return{start:_,end:et}}resetBufferState(){this.currentSampleLength=0,this.currentFrameLength=0}resetBufferManagerInstance(){this.buffer=new Float32Array(this.incrementalAllocationSize),this.currentSampleLength=0,this.currentFrameLength=0}}const DEFAULT_MAX_RETRIES=3,DEFAULT_DELAY=2e3;async function retryWrapper(i,e={}){const{maxRetries:s=DEFAULT_MAX_RETRIES,delay:c=DEFAULT_DELAY}=e;let h=null;for(let $=0;$<=s;$++)try{return await i()}catch(_){h=_,console.log(`Upload attempt ${$+1} failed:`,(_==null?void 0:_.message)||_);const j=(_==null?void 0:_.statusCode)||(_==null?void 0:_.code);if(typeof j=="number"&&j>=400&&j<500&&j!==408&&j!==429)throw _;$<s&&await new Promise(nt=>setTimeout(nt,c))}throw h||new Error("Upload failed after retries")}async function uploadFileWithFormData(i,e,s,c,h){const $=async()=>{const _=new FormData;_.append("file",s,e);const j=await fetch(i,{method:"POST",body:_,headers:{...c||{}}});if(!j.ok){const et=new Error(j.statusText||"Upload failed");throw et.statusCode=j.status,et}return{success:j.headers.get("ETag")||"Upload successful"}};try{return await retryWrapper($,h)}catch(_){return{error:_.message||"Network error",code:_.statusCode||0}}}class AudioFileManager{initialiseClassInstance(){this.audioChunks=[],this.uploadPromises=[],this.successfulUploads=[],this.totalInsertedFrames=0,this.totalInsertedSamples=0,this.totalRawSamples=0,this.totalRawFrames=0}constructor(){this.audioChunks=[],this.uploadPromises=[],this.successfulUploads=[],this.totalRawSamples=0,this.totalRawFrames=0,this.totalInsertedSamples=0,this.totalInsertedFrames=0,this.sessionId="",this.uploadUrl="",this.initialiseClassInstance()}setSessionInfo({sessionId:e,uploadUrl:s,uploadHeaders:c}){this.sessionId=e,this.uploadUrl=s,this.uploadHeaders=c}setUploadProgressCallback(e){this.onUploadProgress=e}getRawSampleDetails(){return{totalRawSamples:this.totalRawSamples,totalRawFrames:this.totalRawFrames}}incrementTotalRawSamples(e){this.totalRawSamples+=e.length,this.totalRawFrames+=1}incrementInsertedSamples(e,s){this.totalInsertedSamples+=e,this.totalInsertedFrames+=s}getInsertedSampleDetails(){return{totalInsertedSamples:this.totalInsertedSamples,totalInsertedFrames:this.totalInsertedFrames}}updateAudioInfo(e){return this.audioChunks.push(e),this.audioChunks.length}async uploadAudio({audioFrames:e,fileName:s,chunkIndex:c}){console.log("upload audio chunk called for file:",s," at index:",c),await this.uploadAudioChunkInMain({audioFrames:e,fileName:s,chunkIndex:c})}async uploadAudioChunkInMain({audioFrames:e,fileName:s,chunkIndex:c}){if(!this.uploadUrl)return console.error("Upload URL not set"),{success:!1,fileName:s};const h=compressAudioToMp3(e),$=new Blob(h,{type:AUDIO_EXTENSION_TYPE_MAP[OUTPUT_FORMAT]});console.log("Uploading to URL:",this.uploadUrl,"filename:",s);const _=uploadFileWithFormData(this.uploadUrl,s,$).then(j=>{var nt;return j.success?(this.successfulUploads.push(s),c!==-1&&this.audioChunks[c]&&(this.audioChunks[c]={...this.audioChunks[c],audioFrames:void 0,fileBlob:void 0,status:"success",response:j.success}),(nt=this.onUploadProgress)==null||nt.call(this,[...this.successfulUploads],this.audioChunks.length)):c!==-1&&this.audioChunks[c]&&(this.audioChunks[c]={...this.audioChunks[c],fileBlob:$,audioFrames:void 0,status:"failure",response:j.error||"Upload failed"}),j});return this.uploadPromises.push(_),{success:!0,fileName:s}}async waitForAllUploads(){await Promise.allSettled(this.uploadPromises)}getSuccessfulUploads(){return[...this.successfulUploads]}getFailedUploads(){const e=[];return this.audioChunks.forEach(s=>{s.status!="success"&&e.push(s.fileName)}),e}getTotalAudioChunks(){return this.audioChunks}async retryFailedUploads(){return this.getFailedUploads().length===0?[]:(this.uploadPromises=[],this.audioChunks.forEach((s,c)=>{const{fileName:h,fileBlob:$,status:_,audioFrames:j}=s;if(_!="success"){let nt;if(_==="failure")nt=$;else if(_==="pending"&&j){const et=compressAudioToMp3(j);nt=new Blob(et,{type:AUDIO_EXTENSION_TYPE_MAP[OUTPUT_FORMAT]})}if(nt){const et=uploadFileWithFormData(this.uploadUrl,h,nt).then(b=>{var a;return b.success&&(this.successfulUploads.push(h),this.audioChunks[c]={...this.audioChunks[c],audioFrames:void 0,fileBlob:void 0,status:"success",response:b.success},(a=this.onUploadProgress)==null||a.call(this,[...this.successfulUploads],this.audioChunks.length)),b});this.uploadPromises.push(et)}}}),await this.waitForAllUploads(),this.getFailedUploads())}resetFileManagerInstance(){this.uploadPromises.forEach(e=>e.catch(()=>{})),this.initialiseClassInstance(),this.sessionId="",this.uploadUrl="",this.uploadHeaders=void 0}}var dist={},ortWeb_min={exports:{}};const backends={},backendsSortedByPriority=[],registerBackend=(i,e,s)=>{if(e&&typeof e.init=="function"&&typeof e.createSessionHandler=="function"){const c=backends[i];if(c===void 0)backends[i]={backend:e,priority:s};else{if(c.priority>s)return;if(c.priority===s&&c.backend!==e)throw new Error(`cannot register backend "${i}" using priority ${s}`)}if(s>=0){const h=backendsSortedByPriority.indexOf(i);h!==-1&&backendsSortedByPriority.splice(h,1);for(let $=0;$<backendsSortedByPriority.length;$++)if(backends[backendsSortedByPriority[$]].priority<=s){backendsSortedByPriority.splice($,0,i);return}backendsSortedByPriority.push(i)}return}throw new TypeError("not a valid backend")},resolveBackend=async i=>{const e=i.length===0?backendsSortedByPriority:i,s=[];for(const c of e){const h=backends[c];if(h){if(h.initialized)return h.backend;if(h.aborted)continue;const $=!!h.initPromise;try{return $||(h.initPromise=h.backend.init()),await h.initPromise,h.initialized=!0,h.backend}catch(_){$||s.push({name:c,err:_}),h.aborted=!0}finally{delete h.initPromise}}}throw new Error(`no available backend found. ERR: ${s.map(c=>`[${c.name}] ${c.err}`).join(", ")}`)};class EnvImpl{constructor(){this.wasm={},this.webgl={},this.logLevelInternal="warning"}set logLevel(e){if(e!==void 0){if(typeof e!="string"||["verbose","info","warning","error","fatal"].indexOf(e)===-1)throw new Error(`Unsupported logging level: ${e}`);this.logLevelInternal=e}}get logLevel(){return this.logLevelInternal}}const env=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 e=1;for(let s=0;s<i.length;s++){const c=i[s];if(typeof c!="number"||!Number.isSafeInteger(c))throw new TypeError(`dims[${s}] must be an integer, got: ${c}`);if(c<0)throw new RangeError(`dims[${s}] must be a non-negative integer, got: ${c}`);e*=c}return e};let Tensor$1=class Hr{constructor(e,s,c){let h,$,_;if(typeof e=="string")if(h=e,_=c,e==="string"){if(!Array.isArray(s))throw new TypeError("A string tensor's data must be a string array.");$=s}else{const nt=NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP.get(e);if(nt===void 0)throw new TypeError(`Unsupported tensor type: ${e}.`);if(Array.isArray(s))$=nt.from(s);else if(s instanceof nt)$=s;else throw new TypeError(`A ${h} tensor's data must be type of ${nt}`)}else if(_=s,Array.isArray(e)){if(e.length===0)throw new TypeError("Tensor type cannot be inferred from an empty array.");const nt=typeof e[0];if(nt==="string")h="string",$=e;else if(nt==="boolean")h="bool",$=Uint8Array.from(e);else throw new TypeError(`Invalid element type of data array: ${nt}.`)}else{const nt=NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP.get(e.constructor);if(nt===void 0)throw new TypeError(`Unsupported type for tensor data: ${e.constructor}.`);h=nt,$=e}if(_===void 0)_=[$.length];else if(!Array.isArray(_))throw new TypeError("A tensor's dims must be a number array");const j=calculateSize(_);if(j!==$.length)throw new Error(`Tensor's size(${j}) does not match data length(${$.length}).`);this.dims=_,this.type=h,this.data=$,this.size=j}static bufferToTensor(e,s){if(e===void 0)throw new Error("Image buffer must be defined");if(s.height===void 0||s.width===void 0)throw new Error("Image height and width must be defined");const{height:c,width:h}=s,$=s.norm;let _,j;$===void 0||$.mean===void 0?_=255:_=$.mean,$===void 0||$.bias===void 0?j=0:j=$.bias;const nt=s.bitmapFormat!==void 0?s.bitmapFormat:"RGBA",et=s.tensorFormat!==void 0&&s.tensorFormat!==void 0?s.tensorFormat:"RGB",b=c*h,a=et==="RGBA"?new Float32Array(b*4):new Float32Array(b*3);let o=4,d=0,g=1,rt=2,st=3,tt=0,ot=b,it=b*2,at=-1;nt==="RGB"&&(o=3,d=0,g=1,rt=2,st=-1),et==="RGBA"?at=b*3:et==="RBG"?(tt=0,it=b,ot=b*2):et==="BGR"&&(it=0,ot=b,tt=b*2);for(let lt=0;lt<b;lt++,d+=o,rt+=o,g+=o,st+=o)a[tt++]=(e[d]+j)/_,a[ot++]=(e[g]+j)/_,a[it++]=(e[rt]+j)/_,at!==-1&&st!==-1&&(a[at++]=(e[st]+j)/_);return et==="RGBA"?new Hr("float32",a,[1,4,c,h]):new Hr("float32",a,[1,3,c,h])}static async fromImage(e,s){const c=typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement,h=typeof ImageData<"u"&&e instanceof ImageData,$=typeof ImageBitmap<"u"&&e instanceof ImageBitmap,_=typeof String<"u"&&(e instanceof String||typeof e=="string");let j,nt={};if(c){const et=document.createElement("canvas"),b=et.getContext("2d");if(b!=null){let a=e.naturalHeight,o=e.naturalWidth;if(s!==void 0&&s.resizedHeight!==void 0&&s.resizedWidth!==void 0&&(a=s.resizedHeight,o=s.resizedWidth),s!==void 0){if(nt=s,s.tensorFormat!==void 0)throw new Error("Image input config format must be RGBA for HTMLImageElement");if(nt.tensorFormat="RGBA",s.height!==void 0&&s.height!==a)throw new Error("Image input config height doesn't match HTMLImageElement height");if(nt.height=a,s.width!==void 0&&s.width!==o)throw new Error("Image input config width doesn't match HTMLImageElement width");nt.width=o}else nt.tensorFormat="RGBA",nt.height=a,nt.width=o;et.width=o,et.height=a,b.drawImage(e,0,0,o,a),j=b.getImageData(0,0,o,a).data}else throw new Error("Can not access image data")}else if(h){const et="RGBA";let b,a;if(s!==void 0&&s.resizedWidth!==void 0&&s.resizedHeight!==void 0?(b=s.resizedHeight,a=s.resizedWidth):(b=e.height,a=e.width),s!==void 0){if(nt=s,s.bitmapFormat!==void 0&&s.bitmapFormat!==et)throw new Error("Image input config format must be RGBA for ImageData");nt.bitmapFormat="RGBA"}else nt.bitmapFormat="RGBA";if(nt.height=b,nt.width=a,s!==void 0){const o=document.createElement("canvas");o.width=a,o.height=b;const d=o.getContext("2d");if(d!=null)d.putImageData(e,0,0),j=d.getImageData(0,0,a,b).data;else throw new Error("Can not access image data")}else j=e.data}else if($){if(s===void 0)throw new Error("Please provide image config with format for Imagebitmap");if(s.bitmapFormat!==void 0)throw new Error("Image input config format must be defined for ImageBitmap");const et=document.createElement("canvas").getContext("2d");if(et!=null){const b=e.height,a=e.width;if(et.drawImage(e,0,0,a,b),j=et.getImageData(0,0,a,b).data,s!==void 0){if(s.height!==void 0&&s.height!==b)throw new Error("Image input config height doesn't match ImageBitmap height");if(nt.height=b,s.width!==void 0&&s.width!==a)throw new Error("Image input config width doesn't match ImageBitmap width");nt.width=a}else nt.height=b,nt.width=a;return Hr.bufferToTensor(j,nt)}else throw new Error("Can not access image data")}else{if(_)return new Promise((et,b)=>{const a=document.createElement("canvas"),o=a.getContext("2d");if(!e||!o)return b();const d=new Image;d.crossOrigin="Anonymous",d.src=e,d.onload=()=>{a.width=d.width,a.height=d.height,o.drawImage(d,0,0,a.width,a.height);const g=o.getImageData(0,0,a.width,a.height);if(s!==void 0){if(s.height!==void 0&&s.height!==a.height)throw new Error("Image input config height doesn't match ImageBitmap height");if(nt.height=a.height,s.width!==void 0&&s.width!==a.width)throw new Error("Image input config width doesn't match ImageBitmap width");nt.width=a.width}else nt.height=a.height,nt.width=a.width;et(Hr.bufferToTensor(g.data,nt))}});throw new Error("Input data provided is not supported - aborted tensor creation")}if(j!==void 0)return Hr.bufferToTensor(j,nt);throw new Error("Input data provided is not supported - aborted tensor creation")}toImageData(e){var s,c;const h=document.createElement("canvas").getContext("2d");let $;if(h!=null){const _=this.dims[3],j=this.dims[2],nt=this.dims[1],et=e!==void 0&&e.format!==void 0?e.format:"RGB",b=e!==void 0&&((s=e.norm)===null||s===void 0?void 0:s.mean)!==void 0?e.norm.mean:255,a=e!==void 0&&((c=e.norm)===null||c===void 0?void 0:c.bias)!==void 0?e.norm.bias:0,o=j*_;if(e!==void 0){if(e.height!==void 0&&e.height!==j)throw new Error("Image output config height doesn't match tensor height");if(e.width!==void 0&&e.width!==_)throw new Error("Image output config width doesn't match tensor width");if(e.format!==void 0&&nt===4&&e.format!=="RGBA"||nt===3&&e.format!=="RGB"&&e.format!=="BGR")throw new Error("Tensor format doesn't match input tensor dims")}const d=4;let g=0,rt=1,st=2,tt=3,ot=0,it=o,at=o*2,ut=-1;et==="RGBA"?(ot=0,it=o,at=o*2,ut=o*3):et==="RGB"?(ot=0,it=o,at=o*2):et==="RBG"&&(ot=0,at=o,it=o*2),$=h.createImageData(_,j);for(let lt=0;lt<j*_;g+=d,rt+=d,st+=d,tt+=d,lt++)$.data[g]=(this.data[ot++]-a)*b,$.data[rt]=(this.data[it++]-a)*b,$.data[st]=(this.data[at++]-a)*b,$.data[tt]=ut===-1?255:(this.data[ut++]-a)*b}else throw new Error("Can not access image data");return $}reshape(e){return new Hr(this.type,this.data,e)}};const Tensor=Tensor$1;let InferenceSession$1=class _o{constructor(e){this.handler=e}async run(e,s,c){const h={};let $={};if(typeof e!="object"||e===null||e instanceof Tensor||Array.isArray(e))throw new TypeError("'feeds' must be an object that use input names as keys and OnnxValue as corresponding values.");let _=!0;if(typeof s=="object"){if(s===null)throw new TypeError("Unexpected argument[1]: cannot be null.");if(s instanceof Tensor)throw new TypeError("'fetches' cannot be a Tensor");if(Array.isArray(s)){if(s.length===0)throw new TypeError("'fetches' cannot be an empty array.");_=!1;for(const et of s){if(typeof et!="string")throw new TypeError("'fetches' must be a string array or an object.");if(this.outputNames.indexOf(et)===-1)throw new RangeError(`'fetches' contains invalid output name: ${et}.`);h[et]=null}if(typeof c=="object"&&c!==null)$=c;else if(typeof c<"u")throw new TypeError("'options' must be an object.")}else{let et=!1;const b=Object.getOwnPropertyNames(s);for(const a of this.outputNames)if(b.indexOf(a)!==-1){const o=s[a];(o===null||o instanceof Tensor)&&(et=!0,_=!1,h[a]=o)}if(et){if(typeof c=="object"&&c!==null)$=c;else if(typeof c<"u")throw new TypeError("'options' must be an object.")}else $=s}}else if(typeof s<"u")throw new TypeError("Unexpected argument[1]: must be 'fetches' or 'options'.");for(const et of this.inputNames)if(typeof e[et]>"u")throw new Error(`input '${et}' is missing in 'feeds'.`);if(_)for(const et of this.outputNames)h[et]=null;const j=await this.handler.run(e,h,$),nt={};for(const et in j)Object.hasOwnProperty.call(j,et)&&(nt[et]=new Tensor(j[et].type,j[et].data,j[et].dims));return nt}static async create(e,s,c,h){let $,_={};if(typeof e=="string"){if($=e,typeof s=="object"&&s!==null)_=s;else if(typeof s<"u")throw new TypeError("'options' must be an object.")}else if(e instanceof Uint8Array){if($=e,typeof s=="object"&&s!==null)_=s;else if(typeof s<"u")throw new TypeError("'options' must be an object.")}else if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer){const a=e;let o=0,d=e.byteLength;if(typeof s=="object"&&s!==null)_=s;else if(typeof s=="number"){if(o=s,!Number.isSafeInteger(o))throw new RangeError("'byteOffset' must be an integer.");if(o<0||o>=a.byteLength)throw new RangeError(`'byteOffset' is out of range [0, ${a.byteLength}).`);if(d=e.byteLength-o,typeof c=="number"){if(d=c,!Number.isSafeInteger(d))throw new RangeError("'byteLength' must be an integer.");if(d<=0||o+d>a.byteLength)throw new RangeError(`'byteLength' is out of range (0, ${a.byteLength-o}].`);if(typeof h=="object"&&h!==null)_=h;else if(typeof h<"u")throw new TypeError("'options' must be an object.")}else if(typeof c<"u")throw new TypeError("'byteLength' must be a number.")}else if(typeof s<"u")throw new TypeError("'options' must be an object.");$=new Uint8Array(a,o,d)}else throw new TypeError("Unexpected argument[0]: must be 'path' or 'buffer'.");const nt=(_.executionProviders||[]).map(a=>typeof a=="string"?a:a.name),b=await(await resolveBackend(nt)).createSessionHandler($,_);return new _o(b)}startProfiling(){this.handler.startProfiling()}endProfiling(){this.handler.endProfiling()}get inputNames(){return this.handler.inputNames}get outputNames(){return this.handler.outputNames}};const InferenceSession=InferenceSession$1,lib=Object.freeze(Object.defineProperty({__proto__:null,InferenceSession,Tensor,env,registerBackend},Symbol.toStringTag,{value:"Module"})),require$$0=getAugmentedNamespace(lib);/*!
|
|
61
|
+
`,8*ht.main_data_begin,gt.ResvSize,ht.resvDrain_post,ht.resvDrain_pre,8*gt.sideinfo_len,_t-ht.resvDrain_post-8*gt.sideinfo_len,_t,_t%8,pt),e.err.println("This is a fatal error. It has several possible causes:"),e.err.println("90%% LAME compiled with buggy version of gcc using advanced optimizations"),e.err.println(" 9%% Your system is overclocked"),e.err.println(" 1%% bug in LAME encoding library"),gt.ResvSize=ht.main_data_begin*8),at>1e9){var Ct;for(Ct=0;Ct<b.MAX_HEADER_BUF;++Ct)gt.header[Ct].write_timing-=at;at=0}return 0},this.copy_buffer=function(mt,gt,ht,pt,_t){var Ct=ut+1;if(Ct<=0)return 0;if(pt!=0&&Ct>pt)return-1;if(e.arraycopy(it,0,gt,ht,Ct),ut=-1,lt=0,_t!=0){var zt=$(1);if(zt[0]=mt.nMusicCRC,ot.updateMusicCRC(zt,gt,ht,Ct),mt.nMusicCRC=zt[0],Ct>0&&(mt.VBR_seek_table.nBytesWritten+=Ct),mt.decode_on_the_fly){for(var Nt=h([2,1152]),Ht=Ct,Jt=-1,un;Jt!=0;)if(Jt=st.hip_decode1_unclipped(mt.hip,gt,ht,Ht,Nt[0],Nt[1]),Ht=0,Jt==-1&&(Jt=0),Jt>0){if(mt.findPeakSample){for(un=0;un<Jt;un++)Nt[0][un]>mt.PeakSample?mt.PeakSample=Nt[0][un]:-Nt[0][un]>mt.PeakSample&&(mt.PeakSample=-Nt[0][un]);if(mt.channels_out>1)for(un=0;un<Jt;un++)Nt[1][un]>mt.PeakSample?mt.PeakSample=Nt[1][un]:-Nt[1][un]>mt.PeakSample&&(mt.PeakSample=-Nt[1][un])}if(mt.findReplayGain&&rt.AnalyzeSamples(mt.rgdata,Nt[0],0,Nt[1],0,Jt,mt.channels_out)==GainAnalysis.GAIN_ANALYSIS_ERROR)return-6}}}return Ct},this.init_bit_stream_w=function(mt){it=c(o.LAME_MAXMP3BUFFER),mt.h_ptr=mt.w_ptr=0,mt.header[mt.h_ptr].write_timing=0,ut=-1,lt=0,at=0}}return Be=a,Be}var Te,ia;function Oe(){if(ia)return Te;ia=1;var i=Q0,e=i.System,s=i.VbrMode,c=i.ShortBlock,h=i.new_float,$=i.new_int_n,_=i.new_short_n,j=i.assert,nt=Qa,et=za,b=ne,a=x2,o=E2,d=N2,g=Ve(),rt=He,st=t1();function tt(){var ot=j1,it=this,at=128*1024;tt.V9=410,tt.V8=420,tt.V7=430,tt.V6=440,tt.V5=450,tt.V4=460,tt.V3=470,tt.V2=480,tt.V1=490,tt.V0=500,tt.R3MIX=1e3,tt.STANDARD=1001,tt.EXTREME=1002,tt.INSANE=1003,tt.STANDARD_FAST=1004,tt.EXTREME_FAST=1005,tt.MEDIUM=1006,tt.MEDIUM_FAST=1007;var ut=16384+at;tt.LAME_MAXMP3BUFFER=ut;var lt,ct,ft,dt,yt,St=new nt,bt,Tt,vt;this.enc=new st,this.setModules=function(xt,kt,wn,bn,Dn,Rn,_n,On,Ln){lt=xt,ct=kt,ft=wn,dt=bn,yt=Dn,bt=Rn,Tt=On,vt=Ln,this.enc.setModules(ct,St,dt,bt)};function $t(){this.mask_adjust=0,this.mask_adjust_short=0,this.bo_l_weight=h(st.SBMAX_l),this.bo_s_weight=h(st.SBMAX_s)}function At(){this.lowerlimit=0}function Ot(xt,kt){this.lowpass=kt}var It=4294479419;function jt(xt){var kt;return xt.class_id=It,kt=xt.internal_flags=new b,xt.mode=ot.NOT_SET,xt.original=1,xt.in_samplerate=44100,xt.num_channels=2,xt.num_samples=-1,xt.bWriteVbrTag=!0,xt.quality=-1,xt.short_blocks=null,kt.subblock_gain=-1,xt.lowpassfreq=0,xt.highpassfreq=0,xt.lowpasswidth=-1,xt.highpasswidth=-1,xt.VBR=s.vbr_off,xt.VBR_q=4,xt.ATHcurve=-1,xt.VBR_mean_bitrate_kbps=128,xt.VBR_min_bitrate_kbps=0,xt.VBR_max_bitrate_kbps=0,xt.VBR_hard_min=0,kt.VBR_min_bitrate=1,kt.VBR_max_bitrate=13,xt.quant_comp=-1,xt.quant_comp_short=-1,xt.msfix=-1,kt.resample_ratio=1,kt.OldValue[0]=180,kt.OldValue[1]=180,kt.CurrentStep[0]=4,kt.CurrentStep[1]=4,kt.masking_lower=1,kt.nsPsy.attackthre=-1,kt.nsPsy.attackthre_s=-1,xt.scale=-1,xt.athaa_type=-1,xt.ATHtype=-1,xt.athaa_loudapprox=-1,xt.athaa_sensitivity=0,xt.useTemporal=null,xt.interChRatio=-1,kt.mf_samples_to_encode=st.ENCDELAY+st.POSTDELAY,xt.encoder_padding=0,kt.mf_size=st.ENCDELAY-st.MDCTDELAY,xt.findReplayGain=!1,xt.decode_on_the_fly=!1,kt.decode_on_the_fly=!1,kt.findReplayGain=!1,kt.findPeakSample=!1,kt.RadioGain=0,kt.AudiophileGain=0,kt.noclipGainChange=0,kt.noclipScale=-1,xt.preset=0,xt.write_id3tag_automatic=!0,0}this.lame_init=function(){var xt=new et;return jt(xt),xt.lame_allocated_gfp=1,xt};function Et(xt){return xt>1?0:xt<=0?1:Math.cos(Math.PI/2*xt)}this.nearestBitrateFullIndex=function(xt){var kt=[8,16,24,32,40,48,56,64,80,96,112,128,160,192,224,256,320],wn=0,bn=0,Dn=0,Rn=0;Rn=kt[16],Dn=16,bn=kt[16],wn=16;for(var _n=0;_n<16;_n++)if(Math.max(xt,kt[_n+1])!=xt){Rn=kt[_n+1],Dn=_n+1,bn=kt[_n],wn=_n;break}return Rn-xt>xt-bn?wn:Dn};function mt(xt,kt){var wn=44100;return kt>=48e3?wn=48e3:kt>=44100?wn=44100:kt>=32e3?wn=32e3:kt>=24e3?wn=24e3:kt>=22050?wn=22050:kt>=16e3?wn=16e3:kt>=12e3?wn=12e3:kt>=11025?wn=11025:kt>=8e3&&(wn=8e3),xt==-1?wn:(xt<=15960&&(wn=44100),xt<=15250&&(wn=32e3),xt<=11220&&(wn=24e3),xt<=9970&&(wn=22050),xt<=7230&&(wn=16e3),xt<=5420&&(wn=12e3),xt<=4510&&(wn=11025),xt<=3970&&(wn=8e3),kt<wn?kt>44100?48e3:kt>32e3?44100:kt>24e3?32e3:kt>22050?24e3:kt>16e3?22050:kt>12e3?16e3:kt>11025?12e3:kt>8e3?11025:8e3:wn)}function gt(xt,kt){switch(xt){case 44100:return kt.version=1,0;case 48e3:return kt.version=1,1;case 32e3:return kt.version=1,2;case 22050:return kt.version=0,0;case 24e3:return kt.version=0,1;case 16e3:return kt.version=0,2;case 11025:return kt.version=0,0;case 12e3:return kt.version=0,1;case 8e3:return kt.version=0,2;default:return kt.version=0,-1}}function ht(xt,kt,wn){wn<16e3&&(kt=2);for(var bn=rt.bitrate_table[kt][1],Dn=2;Dn<=14;Dn++)rt.bitrate_table[kt][Dn]>0&&Math.abs(rt.bitrate_table[kt][Dn]-xt)<Math.abs(bn-xt)&&(bn=rt.bitrate_table[kt][Dn]);return bn}function pt(xt,kt,wn){wn<16e3&&(kt=2);for(var bn=0;bn<=14;bn++)if(rt.bitrate_table[kt][bn]>0&&rt.bitrate_table[kt][bn]==xt)return bn;return-1}function _t(xt,kt){var wn=[new Ot(8,2e3),new Ot(16,3700),new Ot(24,3900),new Ot(32,5500),new Ot(40,7e3),new Ot(48,7500),new Ot(56,1e4),new Ot(64,11e3),new Ot(80,13500),new Ot(96,15100),new Ot(112,15600),new Ot(128,17e3),new Ot(160,17500),new Ot(192,18600),new Ot(224,19400),new Ot(256,19700),new Ot(320,20500)],bn=it.nearestBitrateFullIndex(kt);xt.lowerlimit=wn[bn].lowpass}function Ct(xt){var kt=xt.internal_flags,wn=32,bn=-1;if(kt.lowpass1>0){for(var Dn=999,Rn=0;Rn<=31;Rn++){var _n=Rn/31;_n>=kt.lowpass2&&(wn=Math.min(wn,Rn)),kt.lowpass1<_n&&_n<kt.lowpass2&&(Dn=Math.min(Dn,Rn))}Dn==999?kt.lowpass1=(wn-.75)/31:kt.lowpass1=(Dn-.75)/31,kt.lowpass2=wn/31}if(kt.highpass2>0&&kt.highpass2<.9*(.75/31)&&(kt.highpass1=0,kt.highpass2=0,e.err.println(`Warning: highpass filter disabled. highpass frequency too small
|
|
62
|
+
`)),kt.highpass2>0){for(var On=-1,Rn=0;Rn<=31;Rn++){var _n=Rn/31;_n<=kt.highpass1&&(bn=Math.max(bn,Rn)),kt.highpass1<_n&&_n<kt.highpass2&&(On=Math.max(On,Rn))}kt.highpass1=bn/31,On==-1?kt.highpass2=(bn+.75)/31:kt.highpass2=(On+.75)/31}for(var Rn=0;Rn<32;Rn++){var Ln,Nn,_n=Rn/31;kt.highpass2>kt.highpass1?Ln=Et((kt.highpass2-_n)/(kt.highpass2-kt.highpass1+1e-20)):Ln=1,kt.lowpass2>kt.lowpass1?Nn=Et((_n-kt.lowpass1)/(kt.lowpass2-kt.lowpass1+1e-20)):Nn=1,kt.amp_filter[Rn]=Ln*Nn}}function zt(xt){var kt=xt.internal_flags;switch(xt.quality){default:case 9:kt.psymodel=0,kt.noise_shaping=0,kt.noise_shaping_amp=0,kt.noise_shaping_stop=0,kt.use_best_huffman=0,kt.full_outer_loop=0;break;case 8:xt.quality=7;case 7:kt.psymodel=1,kt.noise_shaping=0,kt.noise_shaping_amp=0,kt.noise_shaping_stop=0,kt.use_best_huffman=0,kt.full_outer_loop=0;break;case 6:kt.psymodel=1,kt.noise_shaping==0&&(kt.noise_shaping=1),kt.noise_shaping_amp=0,kt.noise_shaping_stop=0,kt.subblock_gain==-1&&(kt.subblock_gain=1),kt.use_best_huffman=0,kt.full_outer_loop=0;break;case 5:kt.psymodel=1,kt.noise_shaping==0&&(kt.noise_shaping=1),kt.noise_shaping_amp=0,kt.noise_shaping_stop=0,kt.subblock_gain==-1&&(kt.subblock_gain=1),kt.use_best_huffman=0,kt.full_outer_loop=0;break;case 4:kt.psymodel=1,kt.noise_shaping==0&&(kt.noise_shaping=1),kt.noise_shaping_amp=0,kt.noise_shaping_stop=0,kt.subblock_gain==-1&&(kt.subblock_gain=1),kt.use_best_huffman=1,kt.full_outer_loop=0;break;case 3:kt.psymodel=1,kt.noise_shaping==0&&(kt.noise_shaping=1),kt.noise_shaping_amp=1,kt.noise_shaping_stop=1,kt.subblock_gain==-1&&(kt.subblock_gain=1),kt.use_best_huffman=1,kt.full_outer_loop=0;break;case 2:kt.psymodel=1,kt.noise_shaping==0&&(kt.noise_shaping=1),kt.substep_shaping==0&&(kt.substep_shaping=2),kt.noise_shaping_amp=1,kt.noise_shaping_stop=1,kt.subblock_gain==-1&&(kt.subblock_gain=1),kt.use_best_huffman=1,kt.full_outer_loop=0;break;case 1:kt.psymodel=1,kt.noise_shaping==0&&(kt.noise_shaping=1),kt.substep_shaping==0&&(kt.substep_shaping=2),kt.noise_shaping_amp=2,kt.noise_shaping_stop=1,kt.subblock_gain==-1&&(kt.subblock_gain=1),kt.use_best_huffman=1,kt.full_outer_loop=0;break;case 0:kt.psymodel=1,kt.noise_shaping==0&&(kt.noise_shaping=1),kt.substep_shaping==0&&(kt.substep_shaping=2),kt.noise_shaping_amp=2,kt.noise_shaping_stop=1,kt.subblock_gain==-1&&(kt.subblock_gain=1),kt.use_best_huffman=1,kt.full_outer_loop=0;break}}function Nt(xt){var kt=xt.internal_flags;xt.frameNum=0,xt.write_id3tag_automatic&&Tt.id3tag_write_v2(xt),kt.bitrate_stereoMode_Hist=$([16,5]),kt.bitrate_blockType_Hist=$([16,6]),kt.PeakSample=0,xt.bWriteVbrTag&&bt.InitVbrTag(xt)}this.lame_init_params=function(xt){var kt=xt.internal_flags;if(kt.Class_ID=0,kt.ATH==null&&(kt.ATH=new a),kt.PSY==null&&(kt.PSY=new $t),kt.rgdata==null&&(kt.rgdata=new o),kt.channels_in=xt.num_channels,kt.channels_in==1&&(xt.mode=ot.MONO),kt.channels_out=xt.mode==ot.MONO?1:2,kt.mode_ext=st.MPG_MD_MS_LR,xt.mode==ot.MONO&&(xt.force_ms=!1),xt.VBR==s.vbr_off&&xt.VBR_mean_bitrate_kbps!=128&&xt.brate==0&&(xt.brate=xt.VBR_mean_bitrate_kbps),xt.VBR==s.vbr_off||xt.VBR==s.vbr_mtrh||xt.VBR==s.vbr_mt||(xt.free_format=!1),xt.VBR==s.vbr_off&&xt.brate==0&&g.EQ(xt.compression_ratio,0)&&(xt.compression_ratio=11.025),xt.VBR==s.vbr_off&&xt.compression_ratio>0&&(xt.out_samplerate==0&&(xt.out_samplerate=map2MP3Frequency(int(.97*xt.in_samplerate))),xt.brate=0|xt.out_samplerate*16*kt.channels_out/(1e3*xt.compression_ratio),kt.samplerate_index=gt(xt.out_samplerate,xt),xt.free_format||(xt.brate=ht(xt.brate,xt.version,xt.out_samplerate))),xt.out_samplerate!=0&&(xt.out_samplerate<16e3?(xt.VBR_mean_bitrate_kbps=Math.max(xt.VBR_mean_bitrate_kbps,8),xt.VBR_mean_bitrate_kbps=Math.min(xt.VBR_mean_bitrate_kbps,64)):xt.out_samplerate<32e3?(xt.VBR_mean_bitrate_kbps=Math.max(xt.VBR_mean_bitrate_kbps,8),xt.VBR_mean_bitrate_kbps=Math.min(xt.VBR_mean_bitrate_kbps,160)):(xt.VBR_mean_bitrate_kbps=Math.max(xt.VBR_mean_bitrate_kbps,32),xt.VBR_mean_bitrate_kbps=Math.min(xt.VBR_mean_bitrate_kbps,320))),xt.lowpassfreq==0){var wn=16e3;switch(xt.VBR){case s.vbr_off:{var bn=new At;_t(bn,xt.brate),wn=bn.lowerlimit;break}case s.vbr_abr:{var bn=new At;_t(bn,xt.VBR_mean_bitrate_kbps),wn=bn.lowerlimit;break}case s.vbr_rh:{var Dn=[19500,19e3,18600,18e3,17500,16e3,15600,14900,12500,1e4,3950];if(0<=xt.VBR_q&&xt.VBR_q<=9){var Rn=Dn[xt.VBR_q],_n=Dn[xt.VBR_q+1],On=xt.VBR_q_frac;wn=linear_int(Rn,_n,On)}else wn=19500;break}default:{var Dn=[19500,19e3,18500,18e3,17500,16500,15500,14500,12500,9500,3950];if(0<=xt.VBR_q&&xt.VBR_q<=9){var Rn=Dn[xt.VBR_q],_n=Dn[xt.VBR_q+1],On=xt.VBR_q_frac;wn=linear_int(Rn,_n,On)}else wn=19500}}xt.mode==ot.MONO&&(xt.VBR==s.vbr_off||xt.VBR==s.vbr_abr)&&(wn*=1.5),xt.lowpassfreq=wn|0}if(xt.out_samplerate==0&&(2*xt.lowpassfreq>xt.in_samplerate&&(xt.lowpassfreq=xt.in_samplerate/2),xt.out_samplerate=mt(xt.lowpassfreq|0,xt.in_samplerate)),xt.lowpassfreq=Math.min(20500,xt.lowpassfreq),xt.lowpassfreq=Math.min(xt.out_samplerate/2,xt.lowpassfreq),xt.VBR==s.vbr_off&&(xt.compression_ratio=xt.out_samplerate*16*kt.channels_out/(1e3*xt.brate)),xt.VBR==s.vbr_abr&&(xt.compression_ratio=xt.out_samplerate*16*kt.channels_out/(1e3*xt.VBR_mean_bitrate_kbps)),xt.bWriteVbrTag||(xt.findReplayGain=!1,xt.decode_on_the_fly=!1,kt.findPeakSample=!1),kt.findReplayGain=xt.findReplayGain,kt.decode_on_the_fly=xt.decode_on_the_fly,kt.decode_on_the_fly&&(kt.findPeakSample=!0),kt.findReplayGain&<.InitGainAnalysis(kt.rgdata,xt.out_samplerate)==GainAnalysis.INIT_GAIN_ANALYSIS_ERROR)return xt.internal_flags=null,-6;switch(kt.decode_on_the_fly&&!xt.decode_only&&(kt.hip!=null&&vt.hip_decode_exit(kt.hip),kt.hip=vt.hip_decode_init()),kt.mode_gr=xt.out_samplerate<=24e3?1:2,xt.framesize=576*kt.mode_gr,xt.encoder_delay=st.ENCDELAY,kt.resample_ratio=xt.in_samplerate/xt.out_samplerate,xt.VBR){case s.vbr_mt:case s.vbr_rh:case s.vbr_mtrh:{var Ln=[5.7,6.5,7.3,8.2,10,11.9,13,14,15,16.5];xt.compression_ratio=Ln[xt.VBR_q]}break;case s.vbr_abr:xt.compression_ratio=xt.out_samplerate*16*kt.channels_out/(1e3*xt.VBR_mean_bitrate_kbps);break;default:xt.compression_ratio=xt.out_samplerate*16*kt.channels_out/(1e3*xt.brate);break}if(xt.mode==ot.NOT_SET&&(xt.mode=ot.JOINT_STEREO),xt.highpassfreq>0?(kt.highpass1=2*xt.highpassfreq,xt.highpasswidth>=0?kt.highpass2=2*(xt.highpassfreq+xt.highpasswidth):kt.highpass2=1*2*xt.highpassfreq,kt.highpass1/=xt.out_samplerate,kt.highpass2/=xt.out_samplerate):(kt.highpass1=0,kt.highpass2=0),xt.lowpassfreq>0?(kt.lowpass2=2*xt.lowpassfreq,xt.lowpasswidth>=0?(kt.lowpass1=2*(xt.lowpassfreq-xt.lowpasswidth),kt.lowpass1<0&&(kt.lowpass1=0)):kt.lowpass1=1*2*xt.lowpassfreq,kt.lowpass1/=xt.out_samplerate,kt.lowpass2/=xt.out_samplerate):(kt.lowpass1=0,kt.lowpass2=0),Ct(xt),kt.samplerate_index=gt(xt.out_samplerate,xt),kt.samplerate_index<0)return xt.internal_flags=null,-1;if(xt.VBR==s.vbr_off){if(xt.free_format)kt.bitrate_index=0;else if(xt.brate=ht(xt.brate,xt.version,xt.out_samplerate),kt.bitrate_index=pt(xt.brate,xt.version,xt.out_samplerate),kt.bitrate_index<=0)return xt.internal_flags=null,-1}else kt.bitrate_index=1;xt.analysis&&(xt.bWriteVbrTag=!1),kt.pinfo!=null&&(xt.bWriteVbrTag=!1),ct.init_bit_stream_w(kt);for(var Nn=kt.samplerate_index+3*xt.version+6*(xt.out_samplerate<16e3?1:0),Sn=0;Sn<st.SBMAX_l+1;Sn++)kt.scalefac_band.l[Sn]=dt.sfBandIndex[Nn].l[Sn];for(var Sn=0;Sn<st.PSFB21+1;Sn++){var qn=(kt.scalefac_band.l[22]-kt.scalefac_band.l[21])/st.PSFB21,gr=kt.scalefac_band.l[21]+Sn*qn;kt.scalefac_band.psfb21[Sn]=gr}kt.scalefac_band.psfb21[st.PSFB21]=576;for(var Sn=0;Sn<st.SBMAX_s+1;Sn++)kt.scalefac_band.s[Sn]=dt.sfBandIndex[Nn].s[Sn];for(var Sn=0;Sn<st.PSFB12+1;Sn++){var qn=(kt.scalefac_band.s[13]-kt.scalefac_band.s[12])/st.PSFB12,gr=kt.scalefac_band.s[12]+Sn*qn;kt.scalefac_band.psfb12[Sn]=gr}kt.scalefac_band.psfb12[st.PSFB12]=192,xt.version==1?kt.sideinfo_len=kt.channels_out==1?21:36:kt.sideinfo_len=kt.channels_out==1?13:21,xt.error_protection&&(kt.sideinfo_len+=2),Nt(xt),kt.Class_ID=It;{var Pt;for(Pt=0;Pt<19;Pt++)kt.nsPsy.pefirbuf[Pt]=700*kt.mode_gr*kt.channels_out;xt.ATHtype==-1&&(xt.ATHtype=4)}switch(j(xt.VBR_q<=9),j(xt.VBR_q>=0),xt.VBR){case s.vbr_mt:xt.VBR=s.vbr_mtrh;case s.vbr_mtrh:{xt.useTemporal==null&&(xt.useTemporal=!1),ft.apply_preset(xt,500-xt.VBR_q*10,0),xt.quality<0&&(xt.quality=LAME_DEFAULT_QUALITY),xt.quality<5&&(xt.quality=0),xt.quality>5&&(xt.quality=5),kt.PSY.mask_adjust=xt.maskingadjust,kt.PSY.mask_adjust_short=xt.maskingadjust_short,xt.experimentalY?kt.sfb21_extra=!1:kt.sfb21_extra=xt.out_samplerate>44e3,kt.iteration_loop=new VBRNewIterationLoop(yt);break}case s.vbr_rh:{ft.apply_preset(xt,500-xt.VBR_q*10,0),kt.PSY.mask_adjust=xt.maskingadjust,kt.PSY.mask_adjust_short=xt.maskingadjust_short,xt.experimentalY?kt.sfb21_extra=!1:kt.sfb21_extra=xt.out_samplerate>44e3,xt.quality>6&&(xt.quality=6),xt.quality<0&&(xt.quality=LAME_DEFAULT_QUALITY),kt.iteration_loop=new VBROldIterationLoop(yt);break}default:{var Dt;kt.sfb21_extra=!1,xt.quality<0&&(xt.quality=LAME_DEFAULT_QUALITY),Dt=xt.VBR,Dt==s.vbr_off&&(xt.VBR_mean_bitrate_kbps=xt.brate),ft.apply_preset(xt,xt.VBR_mean_bitrate_kbps,0),xt.VBR=Dt,kt.PSY.mask_adjust=xt.maskingadjust,kt.PSY.mask_adjust_short=xt.maskingadjust_short,Dt==s.vbr_off?kt.iteration_loop=new d(yt):kt.iteration_loop=new ABRIterationLoop(yt);break}}if(j(xt.scale>=0),xt.VBR!=s.vbr_off){if(kt.VBR_min_bitrate=1,kt.VBR_max_bitrate=14,xt.out_samplerate<16e3&&(kt.VBR_max_bitrate=8),xt.VBR_min_bitrate_kbps!=0&&(xt.VBR_min_bitrate_kbps=ht(xt.VBR_min_bitrate_kbps,xt.version,xt.out_samplerate),kt.VBR_min_bitrate=pt(xt.VBR_min_bitrate_kbps,xt.version,xt.out_samplerate),kt.VBR_min_bitrate<0)||xt.VBR_max_bitrate_kbps!=0&&(xt.VBR_max_bitrate_kbps=ht(xt.VBR_max_bitrate_kbps,xt.version,xt.out_samplerate),kt.VBR_max_bitrate=pt(xt.VBR_max_bitrate_kbps,xt.version,xt.out_samplerate),kt.VBR_max_bitrate<0))return-1;xt.VBR_min_bitrate_kbps=rt.bitrate_table[xt.version][kt.VBR_min_bitrate],xt.VBR_max_bitrate_kbps=rt.bitrate_table[xt.version][kt.VBR_max_bitrate],xt.VBR_mean_bitrate_kbps=Math.min(rt.bitrate_table[xt.version][kt.VBR_max_bitrate],xt.VBR_mean_bitrate_kbps),xt.VBR_mean_bitrate_kbps=Math.max(rt.bitrate_table[xt.version][kt.VBR_min_bitrate],xt.VBR_mean_bitrate_kbps)}return xt.tune&&(kt.PSY.mask_adjust+=xt.tune_value_a,kt.PSY.mask_adjust_short+=xt.tune_value_a),zt(xt),j(xt.scale>=0),xt.athaa_type<0?kt.ATH.useAdjust=3:kt.ATH.useAdjust=xt.athaa_type,kt.ATH.aaSensitivityP=Math.pow(10,xt.athaa_sensitivity/-10),xt.short_blocks==null&&(xt.short_blocks=c.short_block_allowed),xt.short_blocks==c.short_block_allowed&&(xt.mode==ot.JOINT_STEREO||xt.mode==ot.STEREO)&&(xt.short_blocks=c.short_block_coupled),xt.quant_comp<0&&(xt.quant_comp=1),xt.quant_comp_short<0&&(xt.quant_comp_short=0),xt.msfix<0&&(xt.msfix=0),xt.exp_nspsytune=xt.exp_nspsytune|1,xt.internal_flags.nsPsy.attackthre<0&&(xt.internal_flags.nsPsy.attackthre=nt.NSATTACKTHRE),xt.internal_flags.nsPsy.attackthre_s<0&&(xt.internal_flags.nsPsy.attackthre_s=nt.NSATTACKTHRE_S),j(xt.scale>=0),xt.scale<0&&(xt.scale=1),xt.ATHtype<0&&(xt.ATHtype=4),xt.ATHcurve<0&&(xt.ATHcurve=4),xt.athaa_loudapprox<0&&(xt.athaa_loudapprox=2),xt.interChRatio<0&&(xt.interChRatio=0),xt.useTemporal==null&&(xt.useTemporal=!0),kt.slot_lag=kt.frac_SpF=0,xt.VBR==s.vbr_off&&(kt.slot_lag=kt.frac_SpF=(xt.version+1)*72e3*xt.brate%xt.out_samplerate|0),dt.iteration_init(xt),St.psymodel_init(xt),j(xt.scale>=0),0};function Ht(xt,kt){(xt.in_buffer_0==null||xt.in_buffer_nsamples<kt)&&(xt.in_buffer_0=h(kt),xt.in_buffer_1=h(kt),xt.in_buffer_nsamples=kt)}this.lame_encode_flush=function(xt,kt,wn,bn){var Dn=xt.internal_flags,Rn=_([2,1152]),_n=0,On,Ln,Nn,Sn,qn=Dn.mf_samples_to_encode-st.POSTDELAY,gr=Jt(xt);if(Dn.mf_samples_to_encode<1)return 0;for(On=0,xt.in_samplerate!=xt.out_samplerate&&(qn+=16*xt.out_samplerate/xt.in_samplerate),Nn=xt.framesize-qn%xt.framesize,Nn<576&&(Nn+=xt.framesize),xt.encoder_padding=Nn,Sn=(qn+Nn)/xt.framesize;Sn>0&&_n>=0;){var Pt=gr-Dn.mf_size,Dt=xt.frameNum;Pt*=xt.in_samplerate,Pt/=xt.out_samplerate,Pt>1152&&(Pt=1152),Pt<1&&(Pt=1),Ln=bn-On,bn==0&&(Ln=0),_n=this.lame_encode_buffer(xt,Rn[0],Rn[1],Pt,kt,wn,Ln),wn+=_n,On+=_n,Sn-=Dt!=xt.frameNum?1:0}if(Dn.mf_samples_to_encode=0,_n<0||(Ln=bn-On,bn==0&&(Ln=0),ct.flush_bitstream(xt),_n=ct.copy_buffer(Dn,kt,wn,Ln,1),_n<0))return _n;if(wn+=_n,On+=_n,Ln=bn-On,bn==0&&(Ln=0),xt.write_id3tag_automatic){if(Tt.id3tag_write_v1(xt),_n=ct.copy_buffer(Dn,kt,wn,Ln,0),_n<0)return _n;On+=_n}return On},this.lame_encode_buffer=function(xt,kt,wn,bn,Dn,Rn,_n){var On=xt.internal_flags,Ln=[null,null];if(On.Class_ID!=It)return-3;if(bn==0)return 0;Ht(On,bn),Ln[0]=On.in_buffer_0,Ln[1]=On.in_buffer_1;for(var Nn=0;Nn<bn;Nn++)Ln[0][Nn]=kt[Nn],On.channels_in>1&&(Ln[1][Nn]=wn[Nn]);return un(xt,Ln[0],Ln[1],bn,Dn,Rn,_n)};function Jt(xt){var kt=st.BLKSIZE+xt.framesize-st.FFTOFFSET;return kt=Math.max(kt,512+xt.framesize-32),kt}function un(xt,kt,wn,bn,Dn,Rn,_n){var On=xt.internal_flags,Ln=0,Nn,Sn,qn,gr,Pt,Dt=[null,null],Lt=[null,null];if(On.Class_ID!=It)return-3;if(bn==0)return 0;if(Pt=ct.copy_buffer(On,Dn,Rn,_n,0),Pt<0)return Pt;if(Rn+=Pt,Ln+=Pt,Lt[0]=kt,Lt[1]=wn,g.NEQ(xt.scale,0)&&g.NEQ(xt.scale,1))for(Sn=0;Sn<bn;++Sn)Lt[0][Sn]*=xt.scale,On.channels_out==2&&(Lt[1][Sn]*=xt.scale);if(g.NEQ(xt.scale_left,0)&&g.NEQ(xt.scale_left,1))for(Sn=0;Sn<bn;++Sn)Lt[0][Sn]*=xt.scale_left;if(g.NEQ(xt.scale_right,0)&&g.NEQ(xt.scale_right,1))for(Sn=0;Sn<bn;++Sn)Lt[1][Sn]*=xt.scale_right;if(xt.num_channels==2&&On.channels_out==1)for(Sn=0;Sn<bn;++Sn)Lt[0][Sn]=.5*(Lt[0][Sn]+Lt[1][Sn]),Lt[1][Sn]=0;gr=Jt(xt),Dt[0]=On.mfbuf[0],Dt[1]=On.mfbuf[1];for(var Ut=0;bn>0;){var Kt=[null,null],Ft=0,Yt=0;Kt[0]=Lt[0],Kt[1]=Lt[1];var Wt=new vn;if(wr(xt,Dt,Kt,Ut,bn,Wt),Ft=Wt.n_in,Yt=Wt.n_out,On.findReplayGain&&!On.decode_on_the_fly&<.AnalyzeSamples(On.rgdata,Dt[0],On.mf_size,Dt[1],On.mf_size,Yt,On.channels_out)==GainAnalysis.GAIN_ANALYSIS_ERROR)return-6;if(bn-=Ft,Ut+=Ft,On.channels_out==2,On.mf_size+=Yt,j(On.mf_size<=b.MFSIZE),On.mf_samples_to_encode<1&&(On.mf_samples_to_encode=st.ENCDELAY+st.POSTDELAY),On.mf_samples_to_encode+=Yt,On.mf_size>=gr){var Xt=_n-Ln;if(_n==0&&(Xt=0),Nn=yn(xt,Dt[0],Dt[1],Dn,Rn,Xt),Nn<0)return Nn;for(Rn+=Nn,Ln+=Nn,On.mf_size-=xt.framesize,On.mf_samples_to_encode-=xt.framesize,qn=0;qn<On.channels_out;qn++)for(Sn=0;Sn<On.mf_size;Sn++)Dt[qn][Sn]=Dt[qn][Sn+xt.framesize]}}return Ln}function yn(xt,kt,wn,bn,Dn,Rn){var _n=it.enc.lame_encode_mp3_frame(xt,kt,wn,bn,Dn,Rn);return xt.frameNum++,_n}function vn(){this.n_in=0,this.n_out=0}function mn(){this.num_used=0}function Tn(xt,kt){return kt!=0?Tn(kt,xt%kt):xt}function kn(xt,kt,wn){var bn=Math.PI*kt;xt/=wn,xt<0&&(xt=0),xt>1&&(xt=1);var Dn=xt-.5,Rn=.42-.5*Math.cos(2*xt*Math.PI)+.08*Math.cos(4*xt*Math.PI);return Math.abs(Dn)<1e-9?bn/Math.PI:Rn*Math.sin(wn*bn*Dn)/(Math.PI*wn*Dn)}function Gn(xt,kt,wn,bn,Dn,Rn,_n,On,Ln){var Nn=xt.internal_flags,Sn,qn=0,gr,Pt=xt.out_samplerate/Tn(xt.out_samplerate,xt.in_samplerate);Pt>b.BPC&&(Pt=b.BPC);var Dt=Math.abs(Nn.resample_ratio-Math.floor(.5+Nn.resample_ratio))<1e-4?1:0,Lt=1/Nn.resample_ratio;Lt>1&&(Lt=1);var Ut=31;Ut%2==0&&--Ut,Ut+=Dt;var Kt=Ut+1;if(Nn.fill_buffer_resample_init==0){for(Nn.inbuf_old[0]=h(Kt),Nn.inbuf_old[1]=h(Kt),Sn=0;Sn<=2*Pt;++Sn)Nn.blackfilt[Sn]=h(Kt);for(Nn.itime[0]=0,Nn.itime[1]=0,qn=0;qn<=2*Pt;qn++){var Ft=0,Yt=(qn-Pt)/(2*Pt);for(Sn=0;Sn<=Ut;Sn++)Ft+=Nn.blackfilt[qn][Sn]=kn(Sn-Yt,Lt,Ut);for(Sn=0;Sn<=Ut;Sn++)Nn.blackfilt[qn][Sn]/=Ft}Nn.fill_buffer_resample_init=1}var Wt=Nn.inbuf_old[Ln];for(gr=0;gr<bn;gr++){var Xt,sn;if(Xt=gr*Nn.resample_ratio,qn=0|Math.floor(Xt-Nn.itime[Ln]),Ut+qn-Ut/2>=_n)break;var Yt=Xt-Nn.itime[Ln]-(qn+.5*(Ut%2));sn=0|Math.floor(Yt*2*Pt+Pt+.5);var en=0;for(Sn=0;Sn<=Ut;++Sn){var Qt=0|Sn+qn-Ut/2,ln;ln=Qt<0?Wt[Kt+Qt]:Dn[Rn+Qt],en+=ln*Nn.blackfilt[sn][Sn]}kt[wn+gr]=en}if(On.num_used=Math.min(_n,Ut+qn-Ut/2),Nn.itime[Ln]+=On.num_used-gr*Nn.resample_ratio,On.num_used>=Kt)for(Sn=0;Sn<Kt;Sn++)Wt[Sn]=Dn[Rn+On.num_used+Sn-Kt];else{var gn=Kt-On.num_used;for(Sn=0;Sn<gn;++Sn)Wt[Sn]=Wt[Sn+On.num_used];for(qn=0;Sn<Kt;++Sn,++qn)Wt[Sn]=Dn[Rn+qn];j(qn==On.num_used)}return gr}function wr(xt,kt,wn,bn,Dn,Rn){var _n=xt.internal_flags;if(_n.resample_ratio<.9999||_n.resample_ratio>1.0001)for(var On=0;On<_n.channels_out;On++){var Ln=new mn;Rn.n_out=Gn(xt,kt[On],_n.mf_size,xt.framesize,wn[On],bn,Dn,Ln,On),Rn.n_in=Ln.num_used}else{Rn.n_out=Math.min(xt.framesize,Dn),Rn.n_in=Rn.n_out;for(var Nn=0;Nn<Rn.n_out;++Nn)kt[0][_n.mf_size+Nn]=wn[0][bn+Nn],_n.channels_out==2&&(kt[1][_n.mf_size+Nn]=wn[1][bn+Nn])}}}return Te=tt,Te}var p2=Q0,M1=p2.VbrMode;function H2(){var i=Oe();function e(b,a,o,d,g,rt,st,tt,ot,it,at,ut,lt,ct,ft){this.vbr_q=b,this.quant_comp=a,this.quant_comp_s=o,this.expY=d,this.st_lrm=g,this.st_s=rt,this.masking_adj=st,this.masking_adj_short=tt,this.ath_lower=ot,this.ath_curve=it,this.ath_sensitivity=at,this.interch=ut,this.safejoint=lt,this.sfb21mod=ct,this.msfix=ft}function s(b,a,o,d,g,rt,st,tt,ot,it,at,ut,lt,ct){this.quant_comp=a,this.quant_comp_s=o,this.safejoint=d,this.nsmsfix=g,this.st_lrm=rt,this.st_s=st,this.nsbass=tt,this.scale=ot,this.masking_adj=it,this.ath_lower=at,this.ath_curve=ut,this.interch=lt,this.sfscale=ct}var c;this.setModules=function(b){c=b};var h=[new e(0,9,9,0,5.2,125,-4.2,-6.3,4.8,1,0,0,2,21,.97),new e(1,9,9,0,5.3,125,-3.6,-5.6,4.5,1.5,0,0,2,21,1.35),new e(2,9,9,0,5.6,125,-2.2,-3.5,2.8,2,0,0,2,21,1.49),new e(3,9,9,1,5.8,130,-1.8,-2.8,2.6,3,-4,0,2,20,1.64),new e(4,9,9,1,6,135,-.7,-1.1,1.1,3.5,-8,0,2,0,1.79),new e(5,9,9,1,6.4,140,.5,.4,-7.5,4,-12,2e-4,0,0,1.95),new e(6,9,9,1,6.6,145,.67,.65,-14.7,6.5,-19,4e-4,0,0,2.3),new e(7,9,9,1,6.6,145,.8,.75,-19.7,8,-22,6e-4,0,0,2.7),new e(8,9,9,1,6.6,145,1.2,1.15,-27.5,10,-23,7e-4,0,0,0),new e(9,9,9,1,6.6,145,1.6,1.6,-36,11,-25,8e-4,0,0,0),new e(10,9,9,1,6.6,145,2,2,-36,12,-25,8e-4,0,0,0)],$=[new e(0,9,9,0,4.2,25,-7,-4,7.5,1,0,0,2,26,.97),new e(1,9,9,0,4.2,25,-5.6,-3.6,4.5,1.5,0,0,2,21,1.35),new e(2,9,9,0,4.2,25,-4.4,-1.8,2,2,0,0,2,18,1.49),new e(3,9,9,1,4.2,25,-3.4,-1.25,1.1,3,-4,0,2,15,1.64),new e(4,9,9,1,4.2,25,-2.2,.1,0,3.5,-8,0,2,0,1.79),new e(5,9,9,1,4.2,25,-1,1.65,-7.7,4,-12,2e-4,0,0,1.95),new e(6,9,9,1,4.2,25,-0,2.47,-7.7,6.5,-19,4e-4,0,0,2),new e(7,9,9,1,4.2,25,.5,2,-14.5,8,-22,6e-4,0,0,2),new e(8,9,9,1,4.2,25,1,2.4,-22,10,-23,7e-4,0,0,2),new e(9,9,9,1,4.2,25,1.5,2.95,-30,11,-25,8e-4,0,0,2),new e(10,9,9,1,4.2,25,2,2.95,-36,12,-30,8e-4,0,0,2)];function _(b,a,o){var d=b.VBR==M1.vbr_rh?h:$,g=b.VBR_q_frac,rt=d[a],st=d[a+1],tt=rt;rt.st_lrm=rt.st_lrm+g*(st.st_lrm-rt.st_lrm),rt.st_s=rt.st_s+g*(st.st_s-rt.st_s),rt.masking_adj=rt.masking_adj+g*(st.masking_adj-rt.masking_adj),rt.masking_adj_short=rt.masking_adj_short+g*(st.masking_adj_short-rt.masking_adj_short),rt.ath_lower=rt.ath_lower+g*(st.ath_lower-rt.ath_lower),rt.ath_curve=rt.ath_curve+g*(st.ath_curve-rt.ath_curve),rt.ath_sensitivity=rt.ath_sensitivity+g*(st.ath_sensitivity-rt.ath_sensitivity),rt.interch=rt.interch+g*(st.interch-rt.interch),rt.msfix=rt.msfix+g*(st.msfix-rt.msfix),et(b,tt.vbr_q),o!=0?b.quant_comp=tt.quant_comp:Math.abs(b.quant_comp- -1)>0||(b.quant_comp=tt.quant_comp),o!=0?b.quant_comp_short=tt.quant_comp_s:Math.abs(b.quant_comp_short- -1)>0||(b.quant_comp_short=tt.quant_comp_s),tt.expY!=0&&(b.experimentalY=tt.expY!=0),o!=0?b.internal_flags.nsPsy.attackthre=tt.st_lrm:Math.abs(b.internal_flags.nsPsy.attackthre- -1)>0||(b.internal_flags.nsPsy.attackthre=tt.st_lrm),o!=0?b.internal_flags.nsPsy.attackthre_s=tt.st_s:Math.abs(b.internal_flags.nsPsy.attackthre_s- -1)>0||(b.internal_flags.nsPsy.attackthre_s=tt.st_s),o!=0?b.maskingadjust=tt.masking_adj:Math.abs(b.maskingadjust-0)>0||(b.maskingadjust=tt.masking_adj),o!=0?b.maskingadjust_short=tt.masking_adj_short:Math.abs(b.maskingadjust_short-0)>0||(b.maskingadjust_short=tt.masking_adj_short),o!=0?b.ATHlower=-tt.ath_lower/10:Math.abs(-b.ATHlower*10-0)>0||(b.ATHlower=-tt.ath_lower/10),o!=0?b.ATHcurve=tt.ath_curve:Math.abs(b.ATHcurve- -1)>0||(b.ATHcurve=tt.ath_curve),o!=0?b.athaa_sensitivity=tt.ath_sensitivity:Math.abs(b.athaa_sensitivity- -1)>0||(b.athaa_sensitivity=tt.ath_sensitivity),tt.interch>0&&(o!=0?b.interChRatio=tt.interch:Math.abs(b.interChRatio- -1)>0||(b.interChRatio=tt.interch)),tt.safejoint>0&&(b.exp_nspsytune=b.exp_nspsytune|tt.safejoint),tt.sfb21mod>0&&(b.exp_nspsytune=b.exp_nspsytune|tt.sfb21mod<<20),o!=0?b.msfix=tt.msfix:Math.abs(b.msfix- -1)>0||(b.msfix=tt.msfix),o==0&&(b.VBR_q=a,b.VBR_q_frac=g)}var j=[new s(8,9,9,0,0,6.6,145,0,.95,0,-30,11,.0012,1),new s(16,9,9,0,0,6.6,145,0,.95,0,-25,11,.001,1),new s(24,9,9,0,0,6.6,145,0,.95,0,-20,11,.001,1),new s(32,9,9,0,0,6.6,145,0,.95,0,-15,11,.001,1),new s(40,9,9,0,0,6.6,145,0,.95,0,-10,11,9e-4,1),new s(48,9,9,0,0,6.6,145,0,.95,0,-10,11,9e-4,1),new s(56,9,9,0,0,6.6,145,0,.95,0,-6,11,8e-4,1),new s(64,9,9,0,0,6.6,145,0,.95,0,-2,11,8e-4,1),new s(80,9,9,0,0,6.6,145,0,.95,0,0,8,7e-4,1),new s(96,9,9,0,2.5,6.6,145,0,.95,0,1,5.5,6e-4,1),new s(112,9,9,0,2.25,6.6,145,0,.95,0,2,4.5,5e-4,1),new s(128,9,9,0,1.95,6.4,140,0,.95,0,3,4,2e-4,1),new s(160,9,9,1,1.79,6,135,0,.95,-2,5,3.5,0,1),new s(192,9,9,1,1.49,5.6,125,0,.97,-4,7,3,0,0),new s(224,9,9,1,1.25,5.2,125,0,.98,-6,9,2,0,0),new s(256,9,9,1,.97,5.2,125,0,1,-8,10,1,0,0),new s(320,9,9,1,.9,5.2,125,0,1,-10,12,0,0,0)];function nt(b,a,o){var d=a,g=c.nearestBitrateFullIndex(a);if(b.VBR=M1.vbr_abr,b.VBR_mean_bitrate_kbps=d,b.VBR_mean_bitrate_kbps=Math.min(b.VBR_mean_bitrate_kbps,320),b.VBR_mean_bitrate_kbps=Math.max(b.VBR_mean_bitrate_kbps,8),b.brate=b.VBR_mean_bitrate_kbps,b.VBR_mean_bitrate_kbps>320&&(b.disable_reservoir=!0),j[g].safejoint>0&&(b.exp_nspsytune=b.exp_nspsytune|2),j[g].sfscale>0&&(b.internal_flags.noise_shaping=2),Math.abs(j[g].nsbass)>0){var rt=int(j[g].nsbass*4);rt<0&&(rt+=64),b.exp_nspsytune=b.exp_nspsytune|rt<<2}return o!=0?b.quant_comp=j[g].quant_comp:Math.abs(b.quant_comp- -1)>0||(b.quant_comp=j[g].quant_comp),o!=0?b.quant_comp_short=j[g].quant_comp_s:Math.abs(b.quant_comp_short- -1)>0||(b.quant_comp_short=j[g].quant_comp_s),o!=0?b.msfix=j[g].nsmsfix:Math.abs(b.msfix- -1)>0||(b.msfix=j[g].nsmsfix),o!=0?b.internal_flags.nsPsy.attackthre=j[g].st_lrm:Math.abs(b.internal_flags.nsPsy.attackthre- -1)>0||(b.internal_flags.nsPsy.attackthre=j[g].st_lrm),o!=0?b.internal_flags.nsPsy.attackthre_s=j[g].st_s:Math.abs(b.internal_flags.nsPsy.attackthre_s- -1)>0||(b.internal_flags.nsPsy.attackthre_s=j[g].st_s),o!=0?b.scale=j[g].scale:Math.abs(b.scale- -1)>0||(b.scale=j[g].scale),o!=0?b.maskingadjust=j[g].masking_adj:Math.abs(b.maskingadjust-0)>0||(b.maskingadjust=j[g].masking_adj),j[g].masking_adj>0?o!=0?b.maskingadjust_short=j[g].masking_adj*.9:Math.abs(b.maskingadjust_short-0)>0||(b.maskingadjust_short=j[g].masking_adj*.9):o!=0?b.maskingadjust_short=j[g].masking_adj*1.1:Math.abs(b.maskingadjust_short-0)>0||(b.maskingadjust_short=j[g].masking_adj*1.1),o!=0?b.ATHlower=-j[g].ath_lower/10:Math.abs(-b.ATHlower*10-0)>0||(b.ATHlower=-j[g].ath_lower/10),o!=0?b.ATHcurve=j[g].ath_curve:Math.abs(b.ATHcurve- -1)>0||(b.ATHcurve=j[g].ath_curve),o!=0?b.interChRatio=j[g].interch:Math.abs(b.interChRatio- -1)>0||(b.interChRatio=j[g].interch),a}this.apply_preset=function(b,a,o){switch(a){case i.R3MIX:{a=i.V3,b.VBR=M1.vbr_mtrh;break}case i.MEDIUM:{a=i.V4,b.VBR=M1.vbr_rh;break}case i.MEDIUM_FAST:{a=i.V4,b.VBR=M1.vbr_mtrh;break}case i.STANDARD:{a=i.V2,b.VBR=M1.vbr_rh;break}case i.STANDARD_FAST:{a=i.V2,b.VBR=M1.vbr_mtrh;break}case i.EXTREME:{a=i.V0,b.VBR=M1.vbr_rh;break}case i.EXTREME_FAST:{a=i.V0,b.VBR=M1.vbr_mtrh;break}case i.INSANE:return a=320,b.preset=a,nt(b,a,o),b.VBR=M1.vbr_off,a}switch(b.preset=a,a){case i.V9:return _(b,9,o),a;case i.V8:return _(b,8,o),a;case i.V7:return _(b,7,o),a;case i.V6:return _(b,6,o),a;case i.V5:return _(b,5,o),a;case i.V4:return _(b,4,o),a;case i.V3:return _(b,3,o),a;case i.V2:return _(b,2,o),a;case i.V1:return _(b,1,o),a;case i.V0:return _(b,0,o),a}return 8<=a&&a<=320?nt(b,a,o):(b.preset=0,a)};function et(b,a){var o=0;return 0>a&&(o=-1,a=0),9<a&&(o=-1,a=9),b.VBR_q=a,b.VBR_q_frac=0,o}}var V2=H2;function O2(){this.setModules=function(i,e){}}var C2=O2;function F2(){this.over_noise=0,this.tot_noise=0,this.max_noise=0,this.over_count=0,this.over_SSD=0,this.bits=0}var k2=F2,Ca=Q0,na=Ca.new_float,X2=Ca.new_int;function Y2(){this.global_gain=0,this.sfb_count1=0,this.step=X2(39),this.noise=na(39),this.noise_log=na(39)}var q2=Y2,q1=Q0,y1=q1.System,_a$2=q1.VbrMode,ye=q1.Util,X1=q1.Arrays,K1=q1.new_float,U1=q1.assert,D2=C2,we=k2,G2=q2,D0=t1(),la=Le,va=ie;function $2(){var i;this.rv=null;var e;this.qupvt=null;var s,c=new D2,h;this.setModules=function(tt,ot,it,at){i=tt,e=ot,this.rv=ot,s=it,this.qupvt=it,h=at,c.setModules(s,h)},this.ms_convert=function(tt,ot){for(var it=0;it<576;++it){var at=tt.tt[ot][0].xr[it],ut=tt.tt[ot][1].xr[it];tt.tt[ot][0].xr[it]=(at+ut)*(ye.SQRT2*.5),tt.tt[ot][1].xr[it]=(at-ut)*(ye.SQRT2*.5)}};function $(tt,ot,it,at){at=0;for(var ut=0;ut<=it;++ut){var lt=Math.abs(tt.xr[ut]);at+=lt,ot[ut]=Math.sqrt(lt*Math.sqrt(lt)),ot[ut]>tt.xrpow_max&&(tt.xrpow_max=ot[ut])}return at}this.init_xrpow=function(tt,ot,it){var at=0,ut=0|ot.max_nonzero_coeff;if(ot.xrpow_max=0,X1.fill(it,ut,576,0),at=$(ot,it,ut,at),at>1e-20){var lt=0;tt.substep_shaping&2&&(lt=1);for(var ct=0;ct<ot.psymax;ct++)tt.pseudohalf[ct]=lt;return!0}return X1.fill(ot.l3_enc,0,576,0),!1};function _(tt,ot){var it=tt.ATH,at=ot.xr;if(ot.block_type!=D0.SHORT_TYPE)for(var ut=!1,lt=D0.PSFB21-1;lt>=0&&!ut;lt--){var ct=tt.scalefac_band.psfb21[lt],ft=tt.scalefac_band.psfb21[lt+1],dt=s.athAdjust(it.adjust,it.psfb21[lt],it.floor);tt.nsPsy.longfact[21]>1e-12&&(dt*=tt.nsPsy.longfact[21]);for(var yt=ft-1;yt>=ct;yt--)if(Math.abs(at[yt])<dt)at[yt]=0;else{ut=!0;break}}else for(var St=0;St<3;St++)for(var ut=!1,lt=D0.PSFB12-1;lt>=0&&!ut;lt--){var ct=tt.scalefac_band.s[12]*3+(tt.scalefac_band.s[13]-tt.scalefac_band.s[12])*St+(tt.scalefac_band.psfb12[lt]-tt.scalefac_band.psfb12[0]),ft=ct+(tt.scalefac_band.psfb12[lt+1]-tt.scalefac_band.psfb12[lt]),bt=s.athAdjust(it.adjust,it.psfb12[lt],it.floor);tt.nsPsy.shortfact[12]>1e-12&&(bt*=tt.nsPsy.shortfact[12]);for(var yt=ft-1;yt>=ct;yt--)if(Math.abs(at[yt])<bt)at[yt]=0;else{ut=!0;break}}}this.init_outer_loop=function(tt,ot){ot.part2_3_length=0,ot.big_values=0,ot.count1=0,ot.global_gain=210,ot.scalefac_compress=0,ot.table_select[0]=0,ot.table_select[1]=0,ot.table_select[2]=0,ot.subblock_gain[0]=0,ot.subblock_gain[1]=0,ot.subblock_gain[2]=0,ot.subblock_gain[3]=0,ot.region0_count=0,ot.region1_count=0,ot.preflag=0,ot.scalefac_scale=0,ot.count1table_select=0,ot.part2_length=0,ot.sfb_lmax=D0.SBPSY_l,ot.sfb_smin=D0.SBPSY_s,ot.psy_lmax=tt.sfb21_extra?D0.SBMAX_l:D0.SBPSY_l,ot.psymax=ot.psy_lmax,ot.sfbmax=ot.sfb_lmax,ot.sfbdivide=11;for(var it=0;it<D0.SBMAX_l;it++)ot.width[it]=tt.scalefac_band.l[it+1]-tt.scalefac_band.l[it],ot.window[it]=3;if(ot.block_type==D0.SHORT_TYPE){var at=K1(576);ot.sfb_smin=0,ot.sfb_lmax=0,ot.mixed_block_flag!=0&&(ot.sfb_smin=3,ot.sfb_lmax=tt.mode_gr*2+4),ot.psymax=ot.sfb_lmax+3*((tt.sfb21_extra?D0.SBMAX_s:D0.SBPSY_s)-ot.sfb_smin),ot.sfbmax=ot.sfb_lmax+3*(D0.SBPSY_s-ot.sfb_smin),ot.sfbdivide=ot.sfbmax-18,ot.psy_lmax=ot.sfb_lmax;var ut=tt.scalefac_band.l[ot.sfb_lmax];y1.arraycopy(ot.xr,0,at,0,576);for(var it=ot.sfb_smin;it<D0.SBMAX_s;it++)for(var lt=tt.scalefac_band.s[it],ct=tt.scalefac_band.s[it+1],ft=0;ft<3;ft++)for(var dt=lt;dt<ct;dt++)ot.xr[ut++]=at[3*dt+ft];for(var yt=ot.sfb_lmax,it=ot.sfb_smin;it<D0.SBMAX_s;it++)ot.width[yt]=ot.width[yt+1]=ot.width[yt+2]=tt.scalefac_band.s[it+1]-tt.scalefac_band.s[it],ot.window[yt]=0,ot.window[yt+1]=1,ot.window[yt+2]=2,yt+=3}ot.count1bits=0,ot.sfb_partition_table=s.nr_of_sfb_block[0][0],ot.slen[0]=0,ot.slen[1]=0,ot.slen[2]=0,ot.slen[3]=0,ot.max_nonzero_coeff=575,X1.fill(ot.scalefac,0),_(tt,ot)};function j(tt){this.ordinal=tt}j.BINSEARCH_NONE=new j(0),j.BINSEARCH_UP=new j(1),j.BINSEARCH_DOWN=new j(2);function nt(tt,ot,it,at,ut){var lt,ct=tt.CurrentStep[at],ft=!1,dt=tt.OldValue[at],yt=j.BINSEARCH_NONE;for(ot.global_gain=dt,it-=ot.part2_length;;){var St;if(lt=h.count_bits(tt,ut,ot,null),ct==1||lt==it)break;lt>it?(yt==j.BINSEARCH_DOWN&&(ft=!0),ft&&(ct/=2),yt=j.BINSEARCH_UP,St=ct):(yt==j.BINSEARCH_UP&&(ft=!0),ft&&(ct/=2),yt=j.BINSEARCH_DOWN,St=-ct),ot.global_gain+=St,ot.global_gain<0&&(ot.global_gain=0,ft=!0),ot.global_gain>255&&(ot.global_gain=255,ft=!0)}for(U1(ot.global_gain>=0),U1(ot.global_gain<256);lt>it&&ot.global_gain<255;)ot.global_gain++,lt=h.count_bits(tt,ut,ot,null);return tt.CurrentStep[at]=dt-ot.global_gain>=4?4:2,tt.OldValue[at]=ot.global_gain,ot.part2_3_length=lt,lt}this.trancate_smallspectrums=function(tt,ot,it,at){var ut=K1(va.SFBMAX);if(!(!(tt.substep_shaping&4)&&ot.block_type==D0.SHORT_TYPE||tt.substep_shaping&128)){s.calc_noise(ot,it,ut,new we,null);for(var ct=0;ct<576;ct++){var lt=0;ot.l3_enc[ct]!=0&&(lt=Math.abs(ot.xr[ct])),at[ct]=lt}var ct=0,ft=8;ot.block_type==D0.SHORT_TYPE&&(ft=6);do{var dt,yt,St,bt,Tt=ot.width[ft];if(ct+=Tt,!(ut[ft]>=1)&&(X1.sort(at,ct-Tt,Tt),!BitStream.EQ(at[ct-1],0))){dt=(1-ut[ft])*it[ft],yt=0,bt=0;do{var vt;for(St=1;bt+St<Tt&&!BitStream.NEQ(at[bt+ct-Tt],at[bt+ct+St-Tt]);St++);if(vt=at[bt+ct-Tt]*at[bt+ct-Tt]*St,dt<vt){bt!=0&&(yt=at[bt+ct-Tt-1]);break}dt-=vt,bt+=St}while(bt<Tt);if(!BitStream.EQ(yt,0))do Math.abs(ot.xr[ct-Tt])<=yt&&(ot.l3_enc[ct-Tt]=0);while(--Tt>0)}}while(++ft<ot.psymax);ot.part2_3_length=h.noquant_count_bits(tt,ot,null)}};function et(tt){for(var ot=0;ot<tt.sfbmax;ot++)if(tt.scalefac[ot]+tt.subblock_gain[tt.window[ot]]==0)return!1;return!0}function b(tt){return ye.FAST_LOG10(.368+.632*tt*tt*tt)}function a(tt,ot){for(var it=1e-37,at=0;at<ot.psymax;at++)it+=b(tt[at]);return Math.max(1e-20,it)}function o(tt,ot,it,at,ut){var lt;switch(tt){default:case 9:{ot.over_count>0?(lt=it.over_SSD<=ot.over_SSD,it.over_SSD==ot.over_SSD&&(lt=it.bits<ot.bits)):lt=it.max_noise<0&&it.max_noise*10+it.bits<=ot.max_noise*10+ot.bits;break}case 0:lt=it.over_count<ot.over_count||it.over_count==ot.over_count&&it.over_noise<ot.over_noise||it.over_count==ot.over_count&&BitStream.EQ(it.over_noise,ot.over_noise)&&it.tot_noise<ot.tot_noise;break;case 8:it.max_noise=a(ut,at);case 1:lt=it.max_noise<ot.max_noise;break;case 2:lt=it.tot_noise<ot.tot_noise;break;case 3:lt=it.tot_noise<ot.tot_noise&&it.max_noise<ot.max_noise;break;case 4:lt=it.max_noise<=0&&ot.max_noise>.2||it.max_noise<=0&&ot.max_noise<0&&ot.max_noise>it.max_noise-.2&&it.tot_noise<ot.tot_noise||it.max_noise<=0&&ot.max_noise>0&&ot.max_noise>it.max_noise-.2&&it.tot_noise<ot.tot_noise+ot.over_noise||it.max_noise>0&&ot.max_noise>-.05&&ot.max_noise>it.max_noise-.1&&it.tot_noise+it.over_noise<ot.tot_noise+ot.over_noise||it.max_noise>0&&ot.max_noise>-.1&&ot.max_noise>it.max_noise-.15&&it.tot_noise+it.over_noise+it.over_noise<ot.tot_noise+ot.over_noise+ot.over_noise;break;case 5:lt=it.over_noise<ot.over_noise||BitStream.EQ(it.over_noise,ot.over_noise)&&it.tot_noise<ot.tot_noise;break;case 6:lt=it.over_noise<ot.over_noise||BitStream.EQ(it.over_noise,ot.over_noise)&&(it.max_noise<ot.max_noise||BitStream.EQ(it.max_noise,ot.max_noise)&&it.tot_noise<=ot.tot_noise);break;case 7:lt=it.over_count<ot.over_count||it.over_noise<ot.over_noise;break}return ot.over_count==0&&(lt=lt&&it.bits<ot.bits),lt}function d(tt,ot,it,at,ut){var lt=tt.internal_flags,ct;ot.scalefac_scale==0?ct=1.2968395546510096:ct=1.6817928305074292;for(var ft=0,dt=0;dt<ot.sfbmax;dt++)ft<it[dt]&&(ft=it[dt]);var yt=lt.noise_shaping_amp;switch(yt==3&&(ut?yt=2:yt=1),yt){case 2:break;case 1:ft>1?ft=Math.pow(ft,.5):ft*=.95;break;case 0:default:ft>1?ft=1:ft*=.95;break}for(var St=0,dt=0;dt<ot.sfbmax;dt++){var bt=ot.width[dt],Tt;if(St+=bt,!(it[dt]<ft)){if(lt.substep_shaping&2&&(lt.pseudohalf[dt]=lt.pseudohalf[dt]==0?1:0,lt.pseudohalf[dt]==0&<.noise_shaping_amp==2))return;for(ot.scalefac[dt]++,Tt=-bt;Tt<0;Tt++)at[St+Tt]*=ct,at[St+Tt]>ot.xrpow_max&&(ot.xrpow_max=at[St+Tt]);if(lt.noise_shaping_amp==2)return}}}function g(tt,ot){for(var it=1.2968395546510096,at=0,ut=0;ut<tt.sfbmax;ut++){var lt=tt.width[ut],ct=tt.scalefac[ut];if(tt.preflag!=0&&(ct+=s.pretab[ut]),at+=lt,ct&1){ct++;for(var ft=-lt;ft<0;ft++)ot[at+ft]*=it,ot[at+ft]>tt.xrpow_max&&(tt.xrpow_max=ot[at+ft])}tt.scalefac[ut]=ct>>1}tt.preflag=0,tt.scalefac_scale=1}function rt(tt,ot,it){var at,ut=ot.scalefac;for(at=0;at<ot.sfb_lmax;at++)if(ut[at]>=16)return!0;for(var lt=0;lt<3;lt++){var ct=0,ft=0;for(at=ot.sfb_lmax+lt;at<ot.sfbdivide;at+=3)ct<ut[at]&&(ct=ut[at]);for(;at<ot.sfbmax;at+=3)ft<ut[at]&&(ft=ut[at]);if(!(ct<16&&ft<8)){if(ot.subblock_gain[lt]>=7)return!0;ot.subblock_gain[lt]++;var dt=tt.scalefac_band.l[ot.sfb_lmax];for(at=ot.sfb_lmax+lt;at<ot.sfbmax;at+=3){var yt,St=ot.width[at],bt=ut[at];if(bt=bt-(4>>ot.scalefac_scale),bt>=0){ut[at]=bt,dt+=St*3;continue}ut[at]=0;{var Tt=210+(bt<<ot.scalefac_scale+1);yt=s.IPOW20(Tt)}dt+=St*(lt+1);for(var vt=-St;vt<0;vt++)it[dt+vt]*=yt,it[dt+vt]>ot.xrpow_max&&(ot.xrpow_max=it[dt+vt]);dt+=St*(3-lt-1)}{var yt=s.IPOW20(202);dt+=ot.width[at]*(lt+1);for(var vt=-ot.width[at];vt<0;vt++)it[dt+vt]*=yt,it[dt+vt]>ot.xrpow_max&&(ot.xrpow_max=it[dt+vt])}}}return!1}function st(tt,ot,it,at,ut){var lt=tt.internal_flags;d(tt,ot,it,at,ut);var ct=et(ot);return ct?!1:(lt.mode_gr==2?ct=h.scale_bitcount(ot):ct=h.scale_bitcount_lsf(lt,ot),ct?(lt.noise_shaping>1&&(X1.fill(lt.pseudohalf,0),ot.scalefac_scale==0?(g(ot,at),ct=!1):ot.block_type==D0.SHORT_TYPE&<.subblock_gain>0&&(ct=rt(lt,ot,at)||et(ot))),ct||(lt.mode_gr==2?ct=h.scale_bitcount(ot):ct=h.scale_bitcount_lsf(lt,ot)),!ct):!0)}this.outer_loop=function(tt,ot,it,at,ut,lt){var ct=tt.internal_flags,ft=new la,dt=K1(576),yt=K1(va.SFBMAX),St=new we,bt,Tt=new G2,vt=9999999,$t=!1,At=!1,Ot=0;if(nt(ct,ot,lt,ut,at),ct.noise_shaping==0)return 100;s.calc_noise(ot,it,yt,St,Tt),St.bits=ot.part2_3_length,ft.assign(ot);var It=0;for(y1.arraycopy(at,0,dt,0,576);!$t;){do{var jt=new we,Et,mt=255;if(ct.substep_shaping&2?Et=20:Et=3,ct.sfb21_extra&&(yt[ft.sfbmax]>1||ft.block_type==D0.SHORT_TYPE&&(yt[ft.sfbmax+1]>1||yt[ft.sfbmax+2]>1))||!st(tt,ft,yt,at,At))break;ft.scalefac_scale!=0&&(mt=254);var gt=lt-ft.part2_length;if(gt<=0)break;for(;(ft.part2_3_length=h.count_bits(ct,at,ft,Tt))>gt&&ft.global_gain<=mt;)ft.global_gain++;if(ft.global_gain>mt)break;if(St.over_count==0){for(;(ft.part2_3_length=h.count_bits(ct,at,ft,Tt))>vt&&ft.global_gain<=mt;)ft.global_gain++;if(ft.global_gain>mt)break}if(s.calc_noise(ft,it,yt,jt,Tt),jt.bits=ft.part2_3_length,ot.block_type!=D0.SHORT_TYPE?bt=tt.quant_comp:bt=tt.quant_comp_short,bt=o(bt,St,jt,ft,yt)?1:0,bt!=0)vt=ot.part2_3_length,St=jt,ot.assign(ft),It=0,y1.arraycopy(at,0,dt,0,576);else if(ct.full_outer_loop==0&&(++It>Et&&St.over_count==0||ct.noise_shaping_amp==3&&At&&It>30||ct.noise_shaping_amp==3&&At&&ft.global_gain-Ot>15))break}while(ft.global_gain+ft.scalefac_scale<255);ct.noise_shaping_amp==3?At?$t=!0:(ft.assign(ot),y1.arraycopy(dt,0,at,0,576),It=0,Ot=ft.global_gain,At=!0):$t=!0}return U1(ot.global_gain+ot.scalefac_scale<=255),tt.VBR==_a$2.vbr_rh||tt.VBR==_a$2.vbr_mtrh?y1.arraycopy(dt,0,at,0,576):ct.substep_shaping&1&&trancate_smallspectrums(ct,ot,it,at),St.over_count},this.iteration_finish_one=function(tt,ot,it){var at=tt.l3_side,ut=at.tt[ot][it];h.best_scalefac_store(tt,ot,it,at),tt.use_best_huffman==1&&h.best_huffman_divide(tt,ut),e.ResvAdjust(tt,ut)},this.VBR_encode_granule=function(tt,ot,it,at,ut,lt,ct){var ft=tt.internal_flags,dt=new la,yt=K1(576),St=ct,bt=ct+1,Tt=(ct+lt)/2,vt,$t,At=0,Ot=ft.sfb21_extra;U1(St<=LameInternalFlags.MAX_BITS_PER_CHANNEL),X1.fill(dt.l3_enc,0);do Tt>St-42?ft.sfb21_extra=!1:ft.sfb21_extra=Ot,$t=outer_loop(tt,ot,it,at,ut,Tt),$t<=0?(At=1,bt=ot.part2_3_length,dt.assign(ot),y1.arraycopy(at,0,yt,0,576),ct=bt-32,vt=ct-lt,Tt=(ct+lt)/2):(lt=Tt+32,vt=ct-lt,Tt=(ct+lt)/2,At!=0&&(At=2,ot.assign(dt),y1.arraycopy(yt,0,at,0,576)));while(vt>12);ft.sfb21_extra=Ot,At==2&&y1.arraycopy(dt.l3_enc,0,ot.l3_enc,0,576),U1(ot.part2_3_length<=St)},this.get_framebits=function(tt,ot){var it=tt.internal_flags;it.bitrate_index=it.VBR_min_bitrate;var at=i.getframebits(tt);it.bitrate_index=1,at=i.getframebits(tt);for(var ut=1;ut<=it.VBR_max_bitrate;ut++){it.bitrate_index=ut;var lt=new MeanBits(at);ot[ut]=e.ResvFrameBegin(tt,lt),at=lt.bits}},this.VBR_old_prepare=function(tt,ot,it,at,ut,lt,ct,ft,dt){var yt=tt.internal_flags,St,bt=0,Tt=1,vt=0;yt.bitrate_index=yt.VBR_max_bitrate;var $t=e.ResvFrameBegin(tt,new MeanBits(0))/yt.mode_gr;get_framebits(tt,lt);for(var At=0;At<yt.mode_gr;At++){var Ot=s.on_pe(tt,ot,ft[At],$t,At,0);yt.mode_ext==D0.MPG_MD_MS_LR&&(ms_convert(yt.l3_side,At),s.reduce_side(ft[At],it[At],$t,Ot));for(var It=0;It<yt.channels_out;++It){var jt=yt.l3_side.tt[At][It];jt.block_type!=D0.SHORT_TYPE?(bt=1.28/(1+Math.exp(3.5-ot[At][It]/300))-.05,St=yt.PSY.mask_adjust-bt):(bt=2.56/(1+Math.exp(3.5-ot[At][It]/300))-.14,St=yt.PSY.mask_adjust_short-bt),yt.masking_lower=Math.pow(10,St*.1),init_outer_loop(yt,jt),dt[At][It]=s.calc_xmin(tt,at[At][It],jt,ut[At][It]),dt[At][It]!=0&&(Tt=0),ct[At][It]=126,vt+=ft[At][It]}}for(var At=0;At<yt.mode_gr;At++)for(var It=0;It<yt.channels_out;It++)vt>lt[yt.VBR_max_bitrate]&&(ft[At][It]*=lt[yt.VBR_max_bitrate],ft[At][It]/=vt),ct[At][It]>ft[At][It]&&(ct[At][It]=ft[At][It]);return Tt},this.bitpressure_strategy=function(tt,ot,it,at){for(var ut=0;ut<tt.mode_gr;ut++)for(var lt=0;lt<tt.channels_out;lt++){for(var ct=tt.l3_side.tt[ut][lt],ft=ot[ut][lt],dt=0,yt=0;yt<ct.psy_lmax;yt++)ft[dt++]*=1+.029*yt*yt/D0.SBMAX_l/D0.SBMAX_l;if(ct.block_type==D0.SHORT_TYPE)for(var yt=ct.sfb_smin;yt<D0.SBMAX_s;yt++)ft[dt++]*=1+.029*yt*yt/D0.SBMAX_s/D0.SBMAX_s,ft[dt++]*=1+.029*yt*yt/D0.SBMAX_s/D0.SBMAX_s,ft[dt++]*=1+.029*yt*yt/D0.SBMAX_s/D0.SBMAX_s;at[ut][lt]=0|Math.max(it[ut][lt],.9*at[ut][lt])}},this.VBR_new_prepare=function(tt,ot,it,at,ut,lt){var ct=tt.internal_flags,ft=1,dt=0,yt=0,St;if(tt.free_format){ct.bitrate_index=0;var bt=new MeanBits(dt);St=e.ResvFrameBegin(tt,bt),dt=bt.bits,ut[0]=St}else{ct.bitrate_index=ct.VBR_max_bitrate;var bt=new MeanBits(dt);e.ResvFrameBegin(tt,bt),dt=bt.bits,get_framebits(tt,ut),St=ut[ct.VBR_max_bitrate]}for(var Tt=0;Tt<ct.mode_gr;Tt++){s.on_pe(tt,ot,lt[Tt],dt,Tt,0),ct.mode_ext==D0.MPG_MD_MS_LR&&ms_convert(ct.l3_side,Tt);for(var vt=0;vt<ct.channels_out;++vt){var $t=ct.l3_side.tt[Tt][vt];ct.masking_lower=Math.pow(10,ct.PSY.mask_adjust*.1),init_outer_loop(ct,$t),s.calc_xmin(tt,it[Tt][vt],$t,at[Tt][vt])!=0&&(ft=0),yt+=lt[Tt][vt]}}for(var Tt=0;Tt<ct.mode_gr;Tt++)for(var vt=0;vt<ct.channels_out;vt++)yt>St&&(lt[Tt][vt]*=St,lt[Tt][vt]/=yt);return ft},this.calc_target_bits=function(tt,ot,it,at,ut,lt){var ct=tt.internal_flags,ft=ct.l3_side,dt,yt,St,bt,Tt=0;ct.bitrate_index=ct.VBR_max_bitrate;var vt=new MeanBits(Tt);for(lt[0]=e.ResvFrameBegin(tt,vt),Tt=vt.bits,ct.bitrate_index=1,Tt=i.getframebits(tt)-ct.sideinfo_len*8,ut[0]=Tt/(ct.mode_gr*ct.channels_out),Tt=tt.VBR_mean_bitrate_kbps*tt.framesize*1e3,ct.substep_shaping&1&&(Tt*=1.09),Tt/=tt.out_samplerate,Tt-=ct.sideinfo_len*8,Tt/=ct.mode_gr*ct.channels_out,dt=.93+.07*(11-tt.compression_ratio)/(11-5.5),dt<.9&&(dt=.9),dt>1&&(dt=1),yt=0;yt<ct.mode_gr;yt++){var $t=0;for(St=0;St<ct.channels_out;St++){if(at[yt][St]=int(dt*Tt),ot[yt][St]>700){var At=int((ot[yt][St]-700)/1.4),Ot=ft.tt[yt][St];at[yt][St]=int(dt*Tt),Ot.block_type==D0.SHORT_TYPE&&At<Tt/2&&(At=Tt/2),At>Tt*3/2?At=Tt*3/2:At<0&&(At=0),at[yt][St]+=At}at[yt][St]>LameInternalFlags.MAX_BITS_PER_CHANNEL&&(at[yt][St]=LameInternalFlags.MAX_BITS_PER_CHANNEL),$t+=at[yt][St]}if($t>LameInternalFlags.MAX_BITS_PER_GRANULE)for(St=0;St<ct.channels_out;++St)at[yt][St]*=LameInternalFlags.MAX_BITS_PER_GRANULE,at[yt][St]/=$t}if(ct.mode_ext==D0.MPG_MD_MS_LR)for(yt=0;yt<ct.mode_gr;yt++)s.reduce_side(at[yt],it[yt],Tt*ct.channels_out,LameInternalFlags.MAX_BITS_PER_GRANULE);for(bt=0,yt=0;yt<ct.mode_gr;yt++)for(St=0;St<ct.channels_out;St++)at[yt][St]>LameInternalFlags.MAX_BITS_PER_CHANNEL&&(at[yt][St]=LameInternalFlags.MAX_BITS_PER_CHANNEL),bt+=at[yt][St];if(bt>lt[0])for(yt=0;yt<ct.mode_gr;yt++)for(St=0;St<ct.channels_out;St++)at[yt][St]*=lt[0],at[yt][St]/=bt}}var P2=$2,Z2=Q0,oa=Z2.assert;function K2(){var i;this.setModules=function(e){i=e},this.ResvFrameBegin=function(e,s){var c=e.internal_flags,h,$=c.l3_side,_=i.getframebits(e);s.bits=(_-c.sideinfo_len*8)/c.mode_gr;var j=8*256*c.mode_gr-8;e.brate>320?h=8*int(e.brate*1e3/(e.out_samplerate/1152)/8+.5):(h=8*1440,e.strict_ISO&&(h=8*int(32e4/(e.out_samplerate/1152)/8+.5))),c.ResvMax=h-_,c.ResvMax>j&&(c.ResvMax=j),(c.ResvMax<0||e.disable_reservoir)&&(c.ResvMax=0);var nt=s.bits*c.mode_gr+Math.min(c.ResvSize,c.ResvMax);return nt>h&&(nt=h),oa(c.ResvMax%8==0),oa(c.ResvMax>=0),$.resvDrain_pre=0,c.pinfo!=null&&(c.pinfo.mean_bits=s.bits/2,c.pinfo.resvsize=c.ResvSize),nt},this.ResvMaxBits=function(e,s,c,h){var $=e.internal_flags,_,j=$.ResvSize,nt=$.ResvMax;h!=0&&(j+=s),$.substep_shaping&1&&(nt*=.9),c.bits=s,j*10>nt*9?(_=j-nt*9/10,c.bits+=_,$.substep_shaping|=128):(_=0,$.substep_shaping&=127,!e.disable_reservoir&&!($.substep_shaping&1)&&(c.bits-=.1*s));var et=j<$.ResvMax*6/10?j:$.ResvMax*6/10;return et-=_,et<0&&(et=0),et},this.ResvAdjust=function(e,s){e.ResvSize-=s.part2_3_length+s.part2_length},this.ResvFrameEnd=function(e,s){var c,h=e.l3_side;e.ResvSize+=s*e.mode_gr;var $=0;h.resvDrain_post=0,h.resvDrain_pre=0,(c=e.ResvSize%8)!=0&&($+=c),c=e.ResvSize-$-e.ResvMax,c>0&&($+=c);{var _=Math.min(h.main_data_begin*8,$)/8;h.resvDrain_pre+=8*_,$-=8*_,e.ResvSize-=8*_,h.main_data_begin-=_}h.resvDrain_post+=$,e.ResvSize-=$}}var U2=K2;function Q2(){var i="http://www.mp3dev.org/",e=3,s=98,c=4,h=0,$=93;this.getLameVersion=function(){return e+"."+s+"."+c},this.getLameShortVersion=function(){return e+"."+s+"."+c},this.getLameVeryShortVersion=function(){return"LAME"+e+"."+s+"r"},this.getPsyVersion=function(){return h+"."+$},this.getLameUrl=function(){return i},this.getLameOsBitness=function(){return"32bits"}}var W2=Q2,D1=Q0,j2=D1.System,Ie=D1.VbrMode,ha=D1.ShortBlock,z2=D1.Arrays,te=D1.new_byte,J2=D1.assert;Q1.NUMTOCENTRIES=100,Q1.MAXFRAMESIZE=2880;function Q1(){var i,e,s;this.setModules=function(Tt,vt,$t){i=Tt,e=vt,s=$t};var c=1,h=2,$=4,_=8,j=Q1.NUMTOCENTRIES,nt=Q1.MAXFRAMESIZE,et=j+4+4+4+4+4,b=et+9+1+1+8+1+1+3+1+1+2+4+2+2,a=128,o=64,d=32,g=null,rt="Xing",st="Info",tt=[0,49345,49537,320,49921,960,640,49729,50689,1728,1920,51009,1280,50625,50305,1088,52225,3264,3456,52545,3840,53185,52865,3648,2560,51905,52097,2880,51457,2496,2176,51265,55297,6336,6528,55617,6912,56257,55937,6720,7680,57025,57217,8e3,56577,7616,7296,56385,5120,54465,54657,5440,55041,6080,5760,54849,53761,4800,4992,54081,4352,53697,53377,4160,61441,12480,12672,61761,13056,62401,62081,12864,13824,63169,63361,14144,62721,13760,13440,62529,15360,64705,64897,15680,65281,16320,16e3,65089,64001,15040,15232,64321,14592,63937,63617,14400,10240,59585,59777,10560,60161,11200,10880,59969,60929,11968,12160,61249,11520,60865,60545,11328,58369,9408,9600,58689,9984,59329,59009,9792,8704,58049,58241,9024,57601,8640,8320,57409,40961,24768,24960,41281,25344,41921,41601,25152,26112,42689,42881,26432,42241,26048,25728,42049,27648,44225,44417,27968,44801,28608,28288,44609,43521,27328,27520,43841,26880,43457,43137,26688,30720,47297,47489,31040,47873,31680,31360,47681,48641,32448,32640,48961,32e3,48577,48257,31808,46081,29888,30080,46401,30464,47041,46721,30272,29184,45761,45953,29504,45313,29120,28800,45121,20480,37057,37249,20800,37633,21440,21120,37441,38401,22208,22400,38721,21760,38337,38017,21568,39937,23744,23936,40257,24320,40897,40577,24128,23040,39617,39809,23360,39169,22976,22656,38977,34817,18624,18816,35137,19200,35777,35457,19008,19968,36545,36737,20288,36097,19904,19584,35905,17408,33985,34177,17728,34561,18368,18048,34369,33281,17088,17280,33601,16640,33217,32897,16448];function ot(Tt,vt){if(Tt.nVbrNumFrames++,Tt.sum+=vt,Tt.seen++,!(Tt.seen<Tt.want)&&(Tt.pos<Tt.size&&(Tt.bag[Tt.pos]=Tt.sum,Tt.pos++,Tt.seen=0),Tt.pos==Tt.size)){for(var $t=1;$t<Tt.size;$t+=2)Tt.bag[$t/2]=Tt.bag[$t];Tt.want*=2,Tt.pos/=2}}function it(Tt,vt){if(!(Tt.pos<=0))for(var $t=1;$t<j;++$t){var At=$t/j,Ot,It,jt=0|Math.floor(At*Tt.pos);jt>Tt.pos-1&&(jt=Tt.pos-1),Ot=Tt.bag[jt],It=Tt.sum;var Et=0|256*Ot/It;Et>255&&(Et=255),vt[$t]=255&Et}}this.addVbrFrame=function(Tt){var vt=Tt.internal_flags,$t=Tables.bitrate_table[Tt.version][vt.bitrate_index];J2(vt.VBR_seek_table.bag!=null),ot(vt.VBR_seek_table,$t)};function at(Tt,vt){var $t=Tt[vt+0]&255;return $t<<=8,$t|=Tt[vt+1]&255,$t<<=8,$t|=Tt[vt+2]&255,$t<<=8,$t|=Tt[vt+3]&255,$t}function ut(Tt,vt,$t){Tt[vt+0]=255&($t>>24&255),Tt[vt+1]=255&($t>>16&255),Tt[vt+2]=255&($t>>8&255),Tt[vt+3]=255&($t&255)}function lt(Tt,vt,$t){Tt[vt+0]=255&($t>>8&255),Tt[vt+1]=255&($t&255)}function ct(Tt,vt){return new String(Tt,vt,rt.length(),g).equals(rt)||new String(Tt,vt,st.length(),g).equals(st)}function ft(Tt,vt,$t){return 255&(Tt<<vt|$t&~(-1<<vt))}function dt(Tt,vt){var $t=Tt.internal_flags;vt[0]=ft(vt[0],8,255),vt[1]=ft(vt[1],3,7),vt[1]=ft(vt[1],1,Tt.out_samplerate<16e3?0:1),vt[1]=ft(vt[1],1,Tt.version),vt[1]=ft(vt[1],2,1),vt[1]=ft(vt[1],1,Tt.error_protection?0:1),vt[2]=ft(vt[2],4,$t.bitrate_index),vt[2]=ft(vt[2],2,$t.samplerate_index),vt[2]=ft(vt[2],1,0),vt[2]=ft(vt[2],1,Tt.extension),vt[3]=ft(vt[3],2,Tt.mode.ordinal()),vt[3]=ft(vt[3],2,$t.mode_ext),vt[3]=ft(vt[3],1,Tt.copyright),vt[3]=ft(vt[3],1,Tt.original),vt[3]=ft(vt[3],2,Tt.emphasis),vt[0]=255;var At=255&(vt[1]&241),Ot;Tt.version==1?Ot=a:Tt.out_samplerate<16e3?Ot=d:Ot=o,Tt.VBR==Ie.vbr_off&&(Ot=Tt.brate);var It;Tt.free_format?It=0:It=255&16*i.BitrateIndex(Ot,Tt.version,Tt.out_samplerate),Tt.version==1?(vt[1]=255&(At|10),At=255&(vt[2]&13),vt[2]=255&(It|At)):(vt[1]=255&(At|2),At=255&(vt[2]&13),vt[2]=255&(It|At))}this.getVbrTag=function(Tt){var vt=new VBRTagData,$t=0;vt.flags=0;var At=Tt[$t+1]>>3&1,Ot=Tt[$t+2]>>2&3,It=Tt[$t+3]>>6&3,jt=Tt[$t+2]>>4&15;if(jt=Tables.bitrate_table[At][jt],Tt[$t+1]>>4==14?vt.samprate=Tables.samplerate_table[2][Ot]:vt.samprate=Tables.samplerate_table[At][Ot],At!=0?It!=3?$t+=36:$t+=21:It!=3?$t+=21:$t+=13,!ct(Tt,$t))return null;$t+=4,vt.hId=At;var Et=vt.flags=at(Tt,$t);if($t+=4,Et&c&&(vt.frames=at(Tt,$t),$t+=4),Et&h&&(vt.bytes=at(Tt,$t),$t+=4),Et&$){if(vt.toc!=null)for(var mt=0;mt<j;mt++)vt.toc[mt]=Tt[$t+mt];$t+=j}vt.vbrScale=-1,Et&_&&(vt.vbrScale=at(Tt,$t),$t+=4),vt.headersize=(At+1)*72e3*jt/vt.samprate,$t+=21;var gt=Tt[$t+0]<<4;gt+=Tt[$t+1]>>4;var ht=(Tt[$t+1]&15)<<8;return ht+=Tt[$t+2]&255,(gt<0||gt>3e3)&&(gt=-1),(ht<0||ht>3e3)&&(ht=-1),vt.encDelay=gt,vt.encPadding=ht,vt},this.InitVbrTag=function(Tt){var vt=Tt.internal_flags,$t;Tt.version==1?$t=a:Tt.out_samplerate<16e3?$t=d:$t=o,Tt.VBR==Ie.vbr_off&&($t=Tt.brate);var At=(Tt.version+1)*72e3*$t/Tt.out_samplerate,Ot=vt.sideinfo_len+b;if(vt.VBR_seek_table.TotalFrameSize=At,At<Ot||At>nt){Tt.bWriteVbrTag=!1;return}vt.VBR_seek_table.nVbrNumFrames=0,vt.VBR_seek_table.nBytesWritten=0,vt.VBR_seek_table.sum=0,vt.VBR_seek_table.seen=0,vt.VBR_seek_table.want=1,vt.VBR_seek_table.pos=0,vt.VBR_seek_table.bag==null&&(vt.VBR_seek_table.bag=new int[400],vt.VBR_seek_table.size=400);var It=te(nt);dt(Tt,It);for(var jt=vt.VBR_seek_table.TotalFrameSize,Et=0;Et<jt;++Et)e.add_dummy_byte(Tt,It[Et]&255,1)};function yt(Tt,vt){var $t=vt^Tt;return vt=vt>>8^tt[$t&255],vt}this.updateMusicCRC=function(Tt,vt,$t,At){for(var Ot=0;Ot<At;++Ot)Tt[0]=yt(vt[$t+Ot],Tt[0])};function St(Tt,vt,$t,At,Ot){var It=Tt.internal_flags,jt=0,Et=Tt.encoder_delay,mt=Tt.encoder_padding,gt=100-10*Tt.VBR_q-Tt.quality,ht=s.getLameVeryShortVersion(),pt,_t=0,Ct,zt=[1,5,3,2,4,0,3],Nt=0|(Tt.lowpassfreq/100+.5>255?255:Tt.lowpassfreq/100+.5),Ht=0,Jt=0,un=0,yn=Tt.internal_flags.noise_shaping,vn=0,mn=0,Tn=0,kn=0,Gn=0,wr=(Tt.exp_nspsytune&1)!=0,xt=(Tt.exp_nspsytune&2)!=0,kt=!1,wn=!1,bn=Tt.internal_flags.nogap_total,Dn=Tt.internal_flags.nogap_current,Rn=Tt.ATHtype,_n=0,On;switch(Tt.VBR){case vbr_abr:On=Tt.VBR_mean_bitrate_kbps;break;case vbr_off:On=Tt.brate;break;default:On=Tt.VBR_min_bitrate_kbps}switch(Tt.VBR.ordinal()<zt.length?pt=zt[Tt.VBR.ordinal()]:pt=0,Ct=16*_t+pt,It.findReplayGain&&(It.RadioGain>510&&(It.RadioGain=510),It.RadioGain<-510&&(It.RadioGain=-510),Jt=8192,Jt|=3072,It.RadioGain>=0?Jt|=It.RadioGain:(Jt|=512,Jt|=-It.RadioGain)),It.findPeakSample&&(Ht=Math.abs(0|It.PeakSample/32767*Math.pow(2,23)+.5)),bn!=-1&&(Dn>0&&(wn=!0),Dn<bn-1&&(kt=!0)),_n=Rn+((wr?1:0)<<4)+((xt?1:0)<<5)+((kt?1:0)<<6)+((wn?1:0)<<7),gt<0&&(gt=0),Tt.mode){case MONO:vn=0;break;case STEREO:vn=1;break;case DUAL_CHANNEL:vn=2;break;case JOINT_STEREO:Tt.force_ms?vn=4:vn=3;break;case NOT_SET:default:vn=7;break}Tt.in_samplerate<=32e3?Tn=0:Tt.in_samplerate==48e3?Tn=2:Tt.in_samplerate>48e3?Tn=3:Tn=1,(Tt.short_blocks==ha.short_block_forced||Tt.short_blocks==ha.short_block_dispensed||Tt.lowpassfreq==-1&&Tt.highpassfreq==-1||Tt.scale_left<Tt.scale_right||Tt.scale_left>Tt.scale_right||Tt.disable_reservoir&&Tt.brate<320||Tt.noATH||Tt.ATHonly||Rn==0||Tt.in_samplerate<=32e3)&&(mn=1),kn=yn+(vn<<2)+(mn<<5)+(Tn<<6),Gn=It.nMusicCRC,ut($t,At+jt,gt),jt+=4;for(var Ln=0;Ln<9;Ln++)$t[At+jt+Ln]=255&ht.charAt(Ln);jt+=9,$t[At+jt]=255&Ct,jt++,$t[At+jt]=255&Nt,jt++,ut($t,At+jt,Ht),jt+=4,lt($t,At+jt,Jt),jt+=2,lt($t,At+jt,un),jt+=2,$t[At+jt]=255&_n,jt++,On>=255?$t[At+jt]=255:$t[At+jt]=255&On,jt++,$t[At+jt]=255&Et>>4,$t[At+jt+1]=255&(Et<<4)+(mt>>8),$t[At+jt+2]=255&mt,jt+=3,$t[At+jt]=255&kn,jt++,$t[At+jt++]=0,lt($t,At+jt,Tt.preset),jt+=2,ut($t,At+jt,vt),jt+=4,lt($t,At+jt,Gn),jt+=2;for(var Nn=0;Nn<jt;Nn++)Ot=yt($t[At+Nn],Ot);return lt($t,At+jt,Ot),jt+=2,jt}function bt(Tt){Tt.seek(0);var vt=te(10);Tt.readFully(vt);var $t;return new String(vt,"ISO-8859-1").startsWith("ID3")?$t=0:$t=((vt[6]&127)<<21|(vt[7]&127)<<14|(vt[8]&127)<<7|vt[9]&127)+vt.length,$t}this.getLameTagFrame=function(Tt,vt){var $t=Tt.internal_flags;if(!Tt.bWriteVbrTag||$t.Class_ID!=Lame.LAME_ID||$t.VBR_seek_table.pos<=0)return 0;if(vt.length<$t.VBR_seek_table.TotalFrameSize)return $t.VBR_seek_table.TotalFrameSize;z2.fill(vt,0,$t.VBR_seek_table.TotalFrameSize,0),dt(Tt,vt);var At=te(j);if(Tt.free_format)for(var Ot=1;Ot<j;++Ot)At[Ot]=255&255*Ot/100;else it($t.VBR_seek_table,At);var It=$t.sideinfo_len;Tt.error_protection&&(It-=2),Tt.VBR==Ie.vbr_off?(vt[It++]=255&st.charAt(0),vt[It++]=255&st.charAt(1),vt[It++]=255&st.charAt(2),vt[It++]=255&st.charAt(3)):(vt[It++]=255&rt.charAt(0),vt[It++]=255&rt.charAt(1),vt[It++]=255&rt.charAt(2),vt[It++]=255&rt.charAt(3)),ut(vt,It,c+h+$+_),It+=4,ut(vt,It,$t.VBR_seek_table.nVbrNumFrames),It+=4;var jt=$t.VBR_seek_table.nBytesWritten+$t.VBR_seek_table.TotalFrameSize;ut(vt,It,0|jt),It+=4,j2.arraycopy(At,0,vt,It,At.length),It+=At.length,Tt.error_protection&&e.CRC_writeheader($t,vt);for(var Et=0,Ot=0;Ot<It;Ot++)Et=yt(vt[Ot],Et);return It+=St(Tt,jt,vt,It,Et),$t.VBR_seek_table.TotalFrameSize},this.putVbrTag=function(Tt,vt){var $t=Tt.internal_flags;if($t.VBR_seek_table.pos<=0||(vt.seek(vt.length()),vt.length()==0))return-1;var At=bt(vt);vt.seek(At);var Ot=te(nt),It=getLameTagFrame(Tt,Ot);return It>Ot.length?-1:(It<1||vt.write(Ot,0,It),0)}}var g2=Q1,Fa=Q0,ua=Fa.new_byte,er=Fa.assert,ar=Oe(),rr=V2,tr=Na,sr=Va(),ir=P2,nr=Oa(),_r=U2,lr=j1,vr=Ve();t1();var or=W2,hr=g2;function ur(){this.setModules=function(i,e){}}function fr(){this.setModules=function(i,e,s){}}function mr(){}function br(){this.setModules=function(i,e){}}function cr(i,e,s){arguments.length!=3&&(console.error("WARN: Mp3Encoder(channels, samplerate, kbps) not specified"),i=1,e=44100,s=128);var c=new ar,h=new ur,$=new tr,_=new vr,j=new rr,nt=new sr,et=new ir,b=new hr,a=new or,o=new br,d=new _r,g=new nr,rt=new fr,st=new mr;c.setModules($,_,j,nt,et,b,a,o,st),_.setModules($,st,a,b),o.setModules(_,a),j.setModules(c),et.setModules(_,d,nt,g),nt.setModules(g,d,c.enc.psy),d.setModules(_),g.setModules(nt),b.setModules(c,_,a),h.setModules(rt,st),rt.setModules(a,o,j);var tt=c.lame_init();tt.num_channels=i,tt.in_samplerate=e,tt.brate=s,tt.mode=lr.STEREO,tt.quality=3,tt.bWriteVbrTag=!1,tt.disable_reservoir=!0,tt.write_id3tag_automatic=!1,c.lame_init_params(tt);var ot=1152,it=0|1.25*ot+7200,at=ua(it);this.encodeBuffer=function(ut,lt){i==1&&(lt=ut),er(ut.length==lt.length),ut.length>ot&&(ot=ut.length,it=0|1.25*ot+7200,at=ua(it));var ct=c.lame_encode_buffer(tt,ut,lt,ut.length,at,0,it);return new Int8Array(at.subarray(0,ct))},this.flush=function(){var ut=c.lame_encode_flush(tt,at,0,it);return new Int8Array(at.subarray(0,ut))}}function A1(){this.dataOffset=0,this.dataLen=0,this.channels=0,this.sampleRate=0}function _e(i){return i.charCodeAt(0)<<24|i.charCodeAt(1)<<16|i.charCodeAt(2)<<8|i.charCodeAt(3)}A1.RIFF=_e("RIFF"),A1.WAVE=_e("WAVE"),A1.fmt_=_e("fmt "),A1.data=_e("data"),A1.readHeader=function(i){var e=new A1,s=i.getUint32(0,!1);if(A1.RIFF==s&&(i.getUint32(4,!0),A1.WAVE==i.getUint32(8,!1)&&A1.fmt_==i.getUint32(12,!1))){var c=i.getUint32(16,!0),h=20;switch(c){case 16:case 18:e.channels=i.getUint16(h+2,!0),e.sampleRate=i.getUint32(h+4,!0);break;default:throw"extended fmt chunk not implemented"}h+=c;for(var $=A1.data,_=0;$!=s&&(s=i.getUint32(h,!1),_=i.getUint32(h+4,!0),$!=s);)h+=_+8;return e.dataLen=_,e.dataOffset=h+8,e}};var Sr=cr;const compressAudioToMp3=i=>{try{const e=new Sr(1,SAMPLING_RATE,BITRATE),s=new Int16Array(i.length);for(let _=0;_<i.length;_++){const j=Math.max(-1,Math.min(1,i[_]));s[_]=j<0?j*32768:j*32767}const c=[],h=e.encodeBuffer(s);h&&h.length>0&&c.push(h);const $=e.flush();return $&&$.length>0&&c.push($),c}catch(e){return console.error("Error compressing audio to MP3: lamejs: ",e),[]}};class AudioBufferManager{constructor(e,s){this.currentSampleLength=0,this.currentFrameLength=0,this.samplingRate=0,this.incrementalAllocationSize=0,this.samplingRate=e,this.incrementalAllocationSize=Math.floor(e*s),this.buffer=new Float32Array(this.incrementalAllocationSize),this.currentSampleLength=0}append(e){return this.currentSampleLength+e.length>this.buffer.length&&this.expandBuffer(),this.buffer.set(e,this.currentSampleLength),this.currentSampleLength+=e.length,this.currentFrameLength+=1,this.currentSampleLength}getAudioData(){return this.buffer.slice(0,this.currentSampleLength)}getCurrentSampleLength(){return this.currentSampleLength}getCurrentFrameLength(){return this.currentFrameLength}getDurationInSeconds(){return this.currentSampleLength/this.samplingRate}expandBuffer(){const e=this.buffer.length+this.incrementalAllocationSize,s=new Float32Array(e);s.set(this.buffer,0),this.buffer=s}calculateChunkTimestamps(e){const s=e/SAMPLING_RATE-this.getDurationInSeconds(),c=s+this.getDurationInSeconds(),h=Math.floor(s/60).toString().padStart(2,"0"),$=(s%60).toFixed(6).toString().padStart(2,"0"),_=`${h}:${$}`,j=Math.floor(c/60).toString().padStart(2,"0"),nt=(c%60).toFixed(6).toString().padStart(2,"0"),et=`${j}:${nt}`;return{start:_,end:et}}resetBufferState(){this.currentSampleLength=0,this.currentFrameLength=0}resetBufferManagerInstance(){this.buffer=new Float32Array(this.incrementalAllocationSize),this.currentSampleLength=0,this.currentFrameLength=0}}const DEFAULT_MAX_RETRIES=3,DEFAULT_DELAY=2e3;async function retryWrapper(i,e={}){const{maxRetries:s=DEFAULT_MAX_RETRIES,delay:c=DEFAULT_DELAY}=e;let h=null;for(let $=0;$<=s;$++)try{return await i()}catch(_){h=_,console.log(`Upload attempt ${$+1} failed:`,(_==null?void 0:_.message)||_);const j=(_==null?void 0:_.statusCode)||(_==null?void 0:_.code);if(typeof j=="number"&&j>=400&&j<500&&j!==408&&j!==429)throw _;$<s&&await new Promise(nt=>setTimeout(nt,c))}throw h||new Error("Upload failed after retries")}async function uploadFileWithFormData(i,e,s,c,h){const $=async()=>{const _=new FormData;_.append("file",s,e);const j=await fetch(i,{method:"POST",body:_,headers:{...c||{}}});if(!j.ok){const et=new Error(j.statusText||"Upload failed");throw et.statusCode=j.status,et}return{success:j.headers.get("ETag")||"Upload successful"}};try{return await retryWrapper($,h)}catch(_){return{error:_.message||"Network error",code:_.statusCode||0}}}class AudioFileManager{initialiseClassInstance(){this.audioChunks=[],this.uploadPromises=[],this.successfulUploads=[],this.totalInsertedFrames=0,this.totalInsertedSamples=0,this.totalRawSamples=0,this.totalRawFrames=0}constructor(){this.audioChunks=[],this.uploadPromises=[],this.successfulUploads=[],this.totalRawSamples=0,this.totalRawFrames=0,this.totalInsertedSamples=0,this.totalInsertedFrames=0,this.sessionId="",this.uploadUrl="",this.initialiseClassInstance()}setSessionInfo({sessionId:e,uploadUrl:s,uploadHeaders:c}){this.sessionId=e,this.uploadUrl=s,this.uploadHeaders=c}setUploadProgressCallback(e){this.onUploadProgress=e}getRawSampleDetails(){return{totalRawSamples:this.totalRawSamples,totalRawFrames:this.totalRawFrames}}incrementTotalRawSamples(e){this.totalRawSamples+=e.length,this.totalRawFrames+=1}incrementInsertedSamples(e,s){this.totalInsertedSamples+=e,this.totalInsertedFrames+=s}getInsertedSampleDetails(){return{totalInsertedSamples:this.totalInsertedSamples,totalInsertedFrames:this.totalInsertedFrames}}updateAudioInfo(e){return this.audioChunks.push(e),this.audioChunks.length}async uploadAudio({audioFrames:e,fileName:s,chunkIndex:c}){console.log("upload audio chunk called for file:",s," at index:",c),await this.uploadAudioChunkInMain({audioFrames:e,fileName:s,chunkIndex:c})}async uploadAudioChunkInMain({audioFrames:e,fileName:s,chunkIndex:c}){if(!this.uploadUrl)return console.error("Upload URL not set"),{success:!1,fileName:s};const h=compressAudioToMp3(e),$=new Blob(h,{type:AUDIO_EXTENSION_TYPE_MAP[OUTPUT_FORMAT]});console.log("Uploading to URL:",this.uploadUrl,"filename:",s);const _=uploadFileWithFormData(this.uploadUrl,s,$).then(j=>{var nt;return j.success?(this.successfulUploads.push(s),c!==-1&&this.audioChunks[c]&&(this.audioChunks[c]={...this.audioChunks[c],audioFrames:void 0,fileBlob:void 0,status:"success",response:j.success}),(nt=this.onUploadProgress)==null||nt.call(this,[...this.successfulUploads],this.audioChunks.length)):c!==-1&&this.audioChunks[c]&&(this.audioChunks[c]={...this.audioChunks[c],fileBlob:$,audioFrames:void 0,status:"failure",response:j.error||"Upload failed"}),j});return this.uploadPromises.push(_),{success:!0,fileName:s}}async waitForAllUploads(){await Promise.allSettled(this.uploadPromises)}getSuccessfulUploads(){return[...this.successfulUploads]}getFailedUploads(){const e=[];return this.audioChunks.forEach(s=>{s.status!="success"&&e.push(s.fileName)}),e}getTotalAudioChunks(){return this.audioChunks}async retryFailedUploads(){return this.getFailedUploads().length===0?[]:(this.uploadPromises=[],this.audioChunks.forEach((s,c)=>{const{fileName:h,fileBlob:$,status:_,audioFrames:j}=s;if(_!="success"){let nt;if(_==="failure")nt=$;else if(_==="pending"&&j){const et=compressAudioToMp3(j);nt=new Blob(et,{type:AUDIO_EXTENSION_TYPE_MAP[OUTPUT_FORMAT]})}if(nt){const et=uploadFileWithFormData(this.uploadUrl,h,nt).then(b=>{var a;return b.success&&(this.successfulUploads.push(h),this.audioChunks[c]={...this.audioChunks[c],audioFrames:void 0,fileBlob:void 0,status:"success",response:b.success},(a=this.onUploadProgress)==null||a.call(this,[...this.successfulUploads],this.audioChunks.length)),b});this.uploadPromises.push(et)}}}),await this.waitForAllUploads(),this.getFailedUploads())}resetFileManagerInstance(){this.uploadPromises.forEach(e=>e.catch(()=>{})),this.initialiseClassInstance(),this.sessionId="",this.uploadUrl="",this.uploadHeaders=void 0}}var dist={},ortWeb_min={exports:{}};const backends={},backendsSortedByPriority=[],registerBackend=(i,e,s)=>{if(e&&typeof e.init=="function"&&typeof e.createSessionHandler=="function"){const c=backends[i];if(c===void 0)backends[i]={backend:e,priority:s};else{if(c.priority>s)return;if(c.priority===s&&c.backend!==e)throw new Error(`cannot register backend "${i}" using priority ${s}`)}if(s>=0){const h=backendsSortedByPriority.indexOf(i);h!==-1&&backendsSortedByPriority.splice(h,1);for(let $=0;$<backendsSortedByPriority.length;$++)if(backends[backendsSortedByPriority[$]].priority<=s){backendsSortedByPriority.splice($,0,i);return}backendsSortedByPriority.push(i)}return}throw new TypeError("not a valid backend")},resolveBackend=async i=>{const e=i.length===0?backendsSortedByPriority:i,s=[];for(const c of e){const h=backends[c];if(h){if(h.initialized)return h.backend;if(h.aborted)continue;const $=!!h.initPromise;try{return $||(h.initPromise=h.backend.init()),await h.initPromise,h.initialized=!0,h.backend}catch(_){$||s.push({name:c,err:_}),h.aborted=!0}finally{delete h.initPromise}}}throw new Error(`no available backend found. ERR: ${s.map(c=>`[${c.name}] ${c.err}`).join(", ")}`)};class EnvImpl{constructor(){this.wasm={},this.webgl={},this.logLevelInternal="warning"}set logLevel(e){if(e!==void 0){if(typeof e!="string"||["verbose","info","warning","error","fatal"].indexOf(e)===-1)throw new Error(`Unsupported logging level: ${e}`);this.logLevelInternal=e}}get logLevel(){return this.logLevelInternal}}const env=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 e=1;for(let s=0;s<i.length;s++){const c=i[s];if(typeof c!="number"||!Number.isSafeInteger(c))throw new TypeError(`dims[${s}] must be an integer, got: ${c}`);if(c<0)throw new RangeError(`dims[${s}] must be a non-negative integer, got: ${c}`);e*=c}return e};let Tensor$1=class Hr{constructor(e,s,c){let h,$,_;if(typeof e=="string")if(h=e,_=c,e==="string"){if(!Array.isArray(s))throw new TypeError("A string tensor's data must be a string array.");$=s}else{const nt=NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP.get(e);if(nt===void 0)throw new TypeError(`Unsupported tensor type: ${e}.`);if(Array.isArray(s))$=nt.from(s);else if(s instanceof nt)$=s;else throw new TypeError(`A ${h} tensor's data must be type of ${nt}`)}else if(_=s,Array.isArray(e)){if(e.length===0)throw new TypeError("Tensor type cannot be inferred from an empty array.");const nt=typeof e[0];if(nt==="string")h="string",$=e;else if(nt==="boolean")h="bool",$=Uint8Array.from(e);else throw new TypeError(`Invalid element type of data array: ${nt}.`)}else{const nt=NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP.get(e.constructor);if(nt===void 0)throw new TypeError(`Unsupported type for tensor data: ${e.constructor}.`);h=nt,$=e}if(_===void 0)_=[$.length];else if(!Array.isArray(_))throw new TypeError("A tensor's dims must be a number array");const j=calculateSize(_);if(j!==$.length)throw new Error(`Tensor's size(${j}) does not match data length(${$.length}).`);this.dims=_,this.type=h,this.data=$,this.size=j}static bufferToTensor(e,s){if(e===void 0)throw new Error("Image buffer must be defined");if(s.height===void 0||s.width===void 0)throw new Error("Image height and width must be defined");const{height:c,width:h}=s,$=s.norm;let _,j;$===void 0||$.mean===void 0?_=255:_=$.mean,$===void 0||$.bias===void 0?j=0:j=$.bias;const nt=s.bitmapFormat!==void 0?s.bitmapFormat:"RGBA",et=s.tensorFormat!==void 0&&s.tensorFormat!==void 0?s.tensorFormat:"RGB",b=c*h,a=et==="RGBA"?new Float32Array(b*4):new Float32Array(b*3);let o=4,d=0,g=1,rt=2,st=3,tt=0,ot=b,it=b*2,at=-1;nt==="RGB"&&(o=3,d=0,g=1,rt=2,st=-1),et==="RGBA"?at=b*3:et==="RBG"?(tt=0,it=b,ot=b*2):et==="BGR"&&(it=0,ot=b,tt=b*2);for(let lt=0;lt<b;lt++,d+=o,rt+=o,g+=o,st+=o)a[tt++]=(e[d]+j)/_,a[ot++]=(e[g]+j)/_,a[it++]=(e[rt]+j)/_,at!==-1&&st!==-1&&(a[at++]=(e[st]+j)/_);return et==="RGBA"?new Hr("float32",a,[1,4,c,h]):new Hr("float32",a,[1,3,c,h])}static async fromImage(e,s){const c=typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement,h=typeof ImageData<"u"&&e instanceof ImageData,$=typeof ImageBitmap<"u"&&e instanceof ImageBitmap,_=typeof String<"u"&&(e instanceof String||typeof e=="string");let j,nt={};if(c){const et=document.createElement("canvas"),b=et.getContext("2d");if(b!=null){let a=e.naturalHeight,o=e.naturalWidth;if(s!==void 0&&s.resizedHeight!==void 0&&s.resizedWidth!==void 0&&(a=s.resizedHeight,o=s.resizedWidth),s!==void 0){if(nt=s,s.tensorFormat!==void 0)throw new Error("Image input config format must be RGBA for HTMLImageElement");if(nt.tensorFormat="RGBA",s.height!==void 0&&s.height!==a)throw new Error("Image input config height doesn't match HTMLImageElement height");if(nt.height=a,s.width!==void 0&&s.width!==o)throw new Error("Image input config width doesn't match HTMLImageElement width");nt.width=o}else nt.tensorFormat="RGBA",nt.height=a,nt.width=o;et.width=o,et.height=a,b.drawImage(e,0,0,o,a),j=b.getImageData(0,0,o,a).data}else throw new Error("Can not access image data")}else if(h){const et="RGBA";let b,a;if(s!==void 0&&s.resizedWidth!==void 0&&s.resizedHeight!==void 0?(b=s.resizedHeight,a=s.resizedWidth):(b=e.height,a=e.width),s!==void 0){if(nt=s,s.bitmapFormat!==void 0&&s.bitmapFormat!==et)throw new Error("Image input config format must be RGBA for ImageData");nt.bitmapFormat="RGBA"}else nt.bitmapFormat="RGBA";if(nt.height=b,nt.width=a,s!==void 0){const o=document.createElement("canvas");o.width=a,o.height=b;const d=o.getContext("2d");if(d!=null)d.putImageData(e,0,0),j=d.getImageData(0,0,a,b).data;else throw new Error("Can not access image data")}else j=e.data}else if($){if(s===void 0)throw new Error("Please provide image config with format for Imagebitmap");if(s.bitmapFormat!==void 0)throw new Error("Image input config format must be defined for ImageBitmap");const et=document.createElement("canvas").getContext("2d");if(et!=null){const b=e.height,a=e.width;if(et.drawImage(e,0,0,a,b),j=et.getImageData(0,0,a,b).data,s!==void 0){if(s.height!==void 0&&s.height!==b)throw new Error("Image input config height doesn't match ImageBitmap height");if(nt.height=b,s.width!==void 0&&s.width!==a)throw new Error("Image input config width doesn't match ImageBitmap width");nt.width=a}else nt.height=b,nt.width=a;return Hr.bufferToTensor(j,nt)}else throw new Error("Can not access image data")}else{if(_)return new Promise((et,b)=>{const a=document.createElement("canvas"),o=a.getContext("2d");if(!e||!o)return b();const d=new Image;d.crossOrigin="Anonymous",d.src=e,d.onload=()=>{a.width=d.width,a.height=d.height,o.drawImage(d,0,0,a.width,a.height);const g=o.getImageData(0,0,a.width,a.height);if(s!==void 0){if(s.height!==void 0&&s.height!==a.height)throw new Error("Image input config height doesn't match ImageBitmap height");if(nt.height=a.height,s.width!==void 0&&s.width!==a.width)throw new Error("Image input config width doesn't match ImageBitmap width");nt.width=a.width}else nt.height=a.height,nt.width=a.width;et(Hr.bufferToTensor(g.data,nt))}});throw new Error("Input data provided is not supported - aborted tensor creation")}if(j!==void 0)return Hr.bufferToTensor(j,nt);throw new Error("Input data provided is not supported - aborted tensor creation")}toImageData(e){var s,c;const h=document.createElement("canvas").getContext("2d");let $;if(h!=null){const _=this.dims[3],j=this.dims[2],nt=this.dims[1],et=e!==void 0&&e.format!==void 0?e.format:"RGB",b=e!==void 0&&((s=e.norm)===null||s===void 0?void 0:s.mean)!==void 0?e.norm.mean:255,a=e!==void 0&&((c=e.norm)===null||c===void 0?void 0:c.bias)!==void 0?e.norm.bias:0,o=j*_;if(e!==void 0){if(e.height!==void 0&&e.height!==j)throw new Error("Image output config height doesn't match tensor height");if(e.width!==void 0&&e.width!==_)throw new Error("Image output config width doesn't match tensor width");if(e.format!==void 0&&nt===4&&e.format!=="RGBA"||nt===3&&e.format!=="RGB"&&e.format!=="BGR")throw new Error("Tensor format doesn't match input tensor dims")}const d=4;let g=0,rt=1,st=2,tt=3,ot=0,it=o,at=o*2,ut=-1;et==="RGBA"?(ot=0,it=o,at=o*2,ut=o*3):et==="RGB"?(ot=0,it=o,at=o*2):et==="RBG"&&(ot=0,at=o,it=o*2),$=h.createImageData(_,j);for(let lt=0;lt<j*_;g+=d,rt+=d,st+=d,tt+=d,lt++)$.data[g]=(this.data[ot++]-a)*b,$.data[rt]=(this.data[it++]-a)*b,$.data[st]=(this.data[at++]-a)*b,$.data[tt]=ut===-1?255:(this.data[ut++]-a)*b}else throw new Error("Can not access image data");return $}reshape(e){return new Hr(this.type,this.data,e)}};const Tensor=Tensor$1;let InferenceSession$1=class _o{constructor(e){this.handler=e}async run(e,s,c){const h={};let $={};if(typeof e!="object"||e===null||e instanceof Tensor||Array.isArray(e))throw new TypeError("'feeds' must be an object that use input names as keys and OnnxValue as corresponding values.");let _=!0;if(typeof s=="object"){if(s===null)throw new TypeError("Unexpected argument[1]: cannot be null.");if(s instanceof Tensor)throw new TypeError("'fetches' cannot be a Tensor");if(Array.isArray(s)){if(s.length===0)throw new TypeError("'fetches' cannot be an empty array.");_=!1;for(const et of s){if(typeof et!="string")throw new TypeError("'fetches' must be a string array or an object.");if(this.outputNames.indexOf(et)===-1)throw new RangeError(`'fetches' contains invalid output name: ${et}.`);h[et]=null}if(typeof c=="object"&&c!==null)$=c;else if(typeof c<"u")throw new TypeError("'options' must be an object.")}else{let et=!1;const b=Object.getOwnPropertyNames(s);for(const a of this.outputNames)if(b.indexOf(a)!==-1){const o=s[a];(o===null||o instanceof Tensor)&&(et=!0,_=!1,h[a]=o)}if(et){if(typeof c=="object"&&c!==null)$=c;else if(typeof c<"u")throw new TypeError("'options' must be an object.")}else $=s}}else if(typeof s<"u")throw new TypeError("Unexpected argument[1]: must be 'fetches' or 'options'.");for(const et of this.inputNames)if(typeof e[et]>"u")throw new Error(`input '${et}' is missing in 'feeds'.`);if(_)for(const et of this.outputNames)h[et]=null;const j=await this.handler.run(e,h,$),nt={};for(const et in j)Object.hasOwnProperty.call(j,et)&&(nt[et]=new Tensor(j[et].type,j[et].data,j[et].dims));return nt}static async create(e,s,c,h){let $,_={};if(typeof e=="string"){if($=e,typeof s=="object"&&s!==null)_=s;else if(typeof s<"u")throw new TypeError("'options' must be an object.")}else if(e instanceof Uint8Array){if($=e,typeof s=="object"&&s!==null)_=s;else if(typeof s<"u")throw new TypeError("'options' must be an object.")}else if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer){const a=e;let o=0,d=e.byteLength;if(typeof s=="object"&&s!==null)_=s;else if(typeof s=="number"){if(o=s,!Number.isSafeInteger(o))throw new RangeError("'byteOffset' must be an integer.");if(o<0||o>=a.byteLength)throw new RangeError(`'byteOffset' is out of range [0, ${a.byteLength}).`);if(d=e.byteLength-o,typeof c=="number"){if(d=c,!Number.isSafeInteger(d))throw new RangeError("'byteLength' must be an integer.");if(d<=0||o+d>a.byteLength)throw new RangeError(`'byteLength' is out of range (0, ${a.byteLength-o}].`);if(typeof h=="object"&&h!==null)_=h;else if(typeof h<"u")throw new TypeError("'options' must be an object.")}else if(typeof c<"u")throw new TypeError("'byteLength' must be a number.")}else if(typeof s<"u")throw new TypeError("'options' must be an object.");$=new Uint8Array(a,o,d)}else throw new TypeError("Unexpected argument[0]: must be 'path' or 'buffer'.");const nt=(_.executionProviders||[]).map(a=>typeof a=="string"?a:a.name),b=await(await resolveBackend(nt)).createSessionHandler($,_);return new _o(b)}startProfiling(){this.handler.startProfiling()}endProfiling(){this.handler.endProfiling()}get inputNames(){return this.handler.inputNames}get outputNames(){return this.handler.outputNames}};const InferenceSession=InferenceSession$1,lib=Object.freeze(Object.defineProperty({__proto__:null,InferenceSession,Tensor,env,registerBackend},Symbol.toStringTag,{value:"Module"})),require$$0=getAugmentedNamespace(lib);/*!
|
|
63
63
|
* ONNX Runtime Web v1.14.0
|
|
64
64
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
65
65
|
* Licensed under the MIT License.
|
|
66
|
-
*/(function(module,exports$1){(function(i,e){module.exports=e(require$$0)})(self,__WEBPACK_EXTERNAL_MODULE__1670__=>(()=>{var __webpack_modules__={3474:(i,e,s)=>{var c,h=(c=(c=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function($){function _(){return jt.buffer!=mt&&vn(jt.buffer),gt}function j(){return jt.buffer!=mt&&vn(jt.buffer),ht}function nt(){return jt.buffer!=mt&&vn(jt.buffer),pt}function et(){return jt.buffer!=mt&&vn(jt.buffer),_t}function b(){return jt.buffer!=mt&&vn(jt.buffer),Ct}var a,o,d;$=$||{},a||(a=$!==void 0?$:{}),a.ready=new Promise(function(wt,Rt){o=wt,d=Rt});var g,rt,st,tt,ot,it,at=Object.assign({},a),ut="./this.program",lt=(wt,Rt)=>{throw Rt},ct=typeof window=="object",ft=typeof importScripts=="function",dt=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",yt=a.ENVIRONMENT_IS_PTHREAD||!1,St="";function bt(wt){return a.locateFile?a.locateFile(wt,St):St+wt}if(dt){let wt;St=ft?s(908).dirname(St)+"/":"//",it=()=>{ot||(tt=s(1384),ot=s(908))},g=function(Rt,Bt){return it(),Rt=ot.normalize(Rt),tt.readFileSync(Rt,Bt?void 0:"utf8")},st=Rt=>((Rt=g(Rt,!0)).buffer||(Rt=new Uint8Array(Rt)),Rt),rt=(Rt,Bt,qt)=>{it(),Rt=ot.normalize(Rt),tt.readFile(Rt,function(tn,cn){tn?qt(tn):Bt(cn.buffer)})},1<process.argv.length&&(ut=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),process.on("uncaughtException",function(Rt){if(!(Rt instanceof Sn))throw Rt}),process.on("unhandledRejection",function(Rt){throw Rt}),lt=(Rt,Bt)=>{if(
|
|
66
|
+
*/(function(module,exports$1){(function(i,e){module.exports=e(require$$0)})(self,__WEBPACK_EXTERNAL_MODULE__1670__=>(()=>{var __webpack_modules__={3474:(i,e,s)=>{var c,h=(c=(c=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function($){function _(){return jt.buffer!=mt&&vn(jt.buffer),gt}function j(){return jt.buffer!=mt&&vn(jt.buffer),ht}function nt(){return jt.buffer!=mt&&vn(jt.buffer),pt}function et(){return jt.buffer!=mt&&vn(jt.buffer),_t}function b(){return jt.buffer!=mt&&vn(jt.buffer),Ct}var a,o,d;$=$||{},a||(a=$!==void 0?$:{}),a.ready=new Promise(function(wt,Rt){o=wt,d=Rt});var g,rt,st,tt,ot,it,at=Object.assign({},a),ut="./this.program",lt=(wt,Rt)=>{throw Rt},ct=typeof window=="object",ft=typeof importScripts=="function",dt=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",yt=a.ENVIRONMENT_IS_PTHREAD||!1,St="";function bt(wt){return a.locateFile?a.locateFile(wt,St):St+wt}if(dt){let wt;St=ft?s(908).dirname(St)+"/":"//",it=()=>{ot||(tt=s(1384),ot=s(908))},g=function(Rt,Bt){return it(),Rt=ot.normalize(Rt),tt.readFileSync(Rt,Bt?void 0:"utf8")},st=Rt=>((Rt=g(Rt,!0)).buffer||(Rt=new Uint8Array(Rt)),Rt),rt=(Rt,Bt,qt)=>{it(),Rt=ot.normalize(Rt),tt.readFile(Rt,function(tn,cn){tn?qt(tn):Bt(cn.buffer)})},1<process.argv.length&&(ut=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),process.on("uncaughtException",function(Rt){if(!(Rt instanceof Sn))throw Rt}),process.on("unhandledRejection",function(Rt){throw Rt}),lt=(Rt,Bt)=>{if(kt())throw process.exitCode=Rt,Bt;Bt instanceof Sn||Ot("exiting due to exception: "+Bt),process.exit(Rt)},a.inspect=function(){return"[Emscripten Module object]"};try{wt=s(9925)}catch(Rt){throw console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?'),Rt}s.g.Worker=wt.Worker}else(ct||ft)&&(ft?St=self.location.href:typeof document<"u"&&document.currentScript&&(St=document.currentScript.src),c&&(St=c),St=St.indexOf("blob:")!==0?St.substr(0,St.replace(/[?#].*/,"").lastIndexOf("/")+1):"",dt||(g=wt=>{var Rt=new XMLHttpRequest;return Rt.open("GET",wt,!1),Rt.send(null),Rt.responseText},ft&&(st=wt=>{var Rt=new XMLHttpRequest;return Rt.open("GET",wt,!1),Rt.responseType="arraybuffer",Rt.send(null),new Uint8Array(Rt.response)}),rt=(wt,Rt,Bt)=>{var qt=new XMLHttpRequest;qt.open("GET",wt,!0),qt.responseType="arraybuffer",qt.onload=()=>{qt.status==200||qt.status==0&&qt.response?Rt(qt.response):Bt()},qt.onerror=Bt,qt.send(null)}));dt&&typeof performance>"u"&&(s.g.performance=s(6953).performance);var Tt=console.log.bind(console),vt=console.warn.bind(console);dt&&(it(),Tt=wt=>tt.writeSync(1,wt+`
|
|
67
67
|
`),vt=wt=>tt.writeSync(2,wt+`
|
|
68
|
-
`));var $t,At=a.print||Tt,Ot=a.printErr||vt;Object.assign(a,at),at=null,a.thisProgram&&(ut=a.thisProgram),a.quit&&(lt=a.quit),a.wasmBinary&&($t=a.wasmBinary);var It=a.noExitRuntime||!1;typeof WebAssembly!="object"&&_n("no native wasm support detected");var jt,Et,mt,gt,ht,pt,_t,Ct,zt=!1,Nt=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function Ht(wt,Rt,Bt){var qt=(Rt>>>=0)+Bt;for(Bt=Rt;wt[Bt]&&!(Bt>=qt);)++Bt;if(16<Bt-Rt&&wt.buffer&&Nt)return Nt.decode(wt.buffer instanceof SharedArrayBuffer?wt.slice(Rt,Bt):wt.subarray(Rt,Bt));for(qt="";Rt<Bt;){var tn=wt[Rt++];if(128&tn){var cn=63&wt[Rt++];if((224&tn)==192)qt+=String.fromCharCode((31&tn)<<6|cn);else{var An=63&wt[Rt++];65536>(tn=(240&tn)==224?(15&tn)<<12|cn<<6|An:(7&tn)<<18|cn<<12|An<<6|63&wt[Rt++])?qt+=String.fromCharCode(tn):(tn-=65536,qt+=String.fromCharCode(55296|tn>>10,56320|1023&tn))}}else qt+=String.fromCharCode(tn)}return qt}function Jt(wt,Rt){return(wt>>>=0)?Ht(j(),wt,Rt):""}function un(wt,Rt,Bt,qt){if(!(0<qt))return 0;var tn=Bt>>>=0;qt=Bt+qt-1;for(var cn=0;cn<wt.length;++cn){var An=wt.charCodeAt(cn);if(55296<=An&&57343>=An&&(An=65536+((1023&An)<<10)|1023&wt.charCodeAt(++cn)),127>=An){if(Bt>=qt)break;Rt[Bt++>>>0]=An}else{if(2047>=An){if(Bt+1>=qt)break;Rt[Bt++>>>0]=192|An>>6}else{if(65535>=An){if(Bt+2>=qt)break;Rt[Bt++>>>0]=224|An>>12}else{if(Bt+3>=qt)break;Rt[Bt++>>>0]=240|An>>18,Rt[Bt++>>>0]=128|An>>12&63}Rt[Bt++>>>0]=128|An>>6&63}Rt[Bt++>>>0]=128|63&An}}return Rt[Bt>>>0]=0,Bt-tn}function yn(wt){for(var Rt=0,Bt=0;Bt<wt.length;++Bt){var qt=wt.charCodeAt(Bt);127>=qt?Rt++:2047>=qt?Rt+=2:55296<=qt&&57343>=qt?(Rt+=4,++Bt):Rt+=3}return Rt}function vn(wt){mt=wt,a.HEAP8=gt=new Int8Array(wt),a.HEAP16=new Int16Array(wt),a.HEAP32=pt=new Int32Array(wt),a.HEAPU8=ht=new Uint8Array(wt),a.HEAPU16=new Uint16Array(wt),a.HEAPU32=_t=new Uint32Array(wt),a.HEAPF32=new Float32Array(wt),a.HEAPF64=Ct=new Float64Array(wt)}yt&&(mt=a.buffer);var mn=a.INITIAL_MEMORY||16777216;if(yt)jt=a.wasmMemory,mt=a.buffer;else if(a.wasmMemory)jt=a.wasmMemory;else if(!((jt=new WebAssembly.Memory({initial:mn/65536,maximum:65536,shared:!0})).buffer instanceof SharedArrayBuffer))throw Ot("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"),dt&&console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)"),Error("bad memory");jt&&(mt=jt.buffer),mn=mt.byteLength,vn(mt);var Tn,Pn=[],Gn=[],wr=[],xt=[];function Pt(){return It||!1}function wn(){var wt=a.preRun.shift();Pn.unshift(wt)}var bn,Dn=0,Rn=null;function _n(wt){throw yt?postMessage({cmd:"onAbort",arg:wt}):a.onAbort&&a.onAbort(wt),Ot(wt="Aborted("+wt+")"),zt=!0,wt=new WebAssembly.RuntimeError(wt+". Build with -sASSERTIONS for more info."),d(wt),wt}function On(){return bn.startsWith("data:application/octet-stream;base64,")}function Ln(){var wt=bn;try{if(wt==bn&&$t)return new Uint8Array($t);if(st)return st(wt);throw"both async and sync fetching of the wasm failed"}catch(Rt){_n(Rt)}}bn="ort-wasm-threaded.wasm",On()||(bn=bt(bn));var Nn={};function Sn(wt){this.name="ExitStatus",this.message="Program terminated with exit("+wt+")",this.status=wt}function qn(wt){(wt=Lt.Vb[wt])||_n(),Lt.mc(wt)}function gr(wt){var Rt=Lt.Cc();if(!Rt)return 6;Lt.ac.push(Rt),Lt.Vb[wt.Ub]=Rt,Rt.Ub=wt.Ub;var Bt={cmd:"run",start_routine:wt.Ic,arg:wt.zc,pthread_ptr:wt.Ub};return Rt.$b=()=>{Bt.time=performance.now(),Rt.postMessage(Bt,wt.Nc)},Rt.loaded&&(Rt.$b(),delete Rt.$b),0}function kt(wt){if(yt)return $n(1,1,wt);Pt()||(Lt.oc(),a.onExit&&a.onExit(wt),zt=!0),lt(wt,new Sn(wt))}function Dt(wt,Rt){if(!Rt&&yt)throw Ft(wt),"unwind";Pt()||yt||(Yr(),Ut(wr),Cr(0),Br[1].length&&Vr(1,10),Br[2].length&&Vr(2,10),Lt.oc()),kt(wt)}var Lt={Yb:[],ac:[],qc:[],Vb:{},fc:function(){yt&&Lt.Ec()},Pc:function(){},Ec:function(){Lt.receiveObjectTransfer=Lt.Gc,Lt.threadInitTLS=Lt.pc,Lt.setExitStatus=Lt.nc,It=!1},nc:function(){},oc:function(){for(var wt of Object.values(Lt.Vb))Lt.mc(wt);for(wt of Lt.Yb)wt.terminate();Lt.Yb=[]},mc:function(wt){var Rt=wt.Ub;delete Lt.Vb[Rt],Lt.Yb.push(wt),Lt.ac.splice(Lt.ac.indexOf(wt),1),wt.Ub=0,eo(Rt)},Gc:function(){},pc:function(){Lt.qc.forEach(wt=>wt())},Fc:function(wt,Rt){wt.onmessage=Bt=>{var qt=(Bt=Bt.data).cmd;if(wt.Ub&&(Lt.Bc=wt.Ub),Bt.targetThread&&Bt.targetThread!=Mr()){var tn=Lt.Vb[Bt.Qc];tn?tn.postMessage(Bt,Bt.transferList):Ot('Internal error! Worker sent a message "'+qt+'" to target pthread '+Bt.targetThread+", but that thread no longer exists!")}else qt==="processProxyingQueue"?Gt(Bt.queue):qt==="spawnThread"?gr(Bt):qt==="cleanupThread"?qn(Bt.thread):qt==="killThread"?(Bt=Bt.thread,qt=Lt.Vb[Bt],delete Lt.Vb[Bt],qt.terminate(),eo(Bt),Lt.ac.splice(Lt.ac.indexOf(qt),1),qt.Ub=0):qt==="cancelThread"?Lt.Vb[Bt.thread].postMessage({cmd:"cancel"}):qt==="loaded"?(wt.loaded=!0,Rt&&Rt(wt),wt.$b&&(wt.$b(),delete wt.$b)):qt==="print"?At("Thread "+Bt.threadId+": "+Bt.text):qt==="printErr"?Ot("Thread "+Bt.threadId+": "+Bt.text):qt==="alert"?alert("Thread "+Bt.threadId+": "+Bt.text):Bt.target==="setimmediate"?wt.postMessage(Bt):qt==="onAbort"?a.onAbort&&a.onAbort(Bt.arg):qt&&Ot("worker sent an unknown command "+qt);Lt.Bc=void 0},wt.onerror=Bt=>{throw Ot("worker sent an error! "+Bt.filename+":"+Bt.lineno+": "+Bt.message),Bt},dt&&(wt.on("message",function(Bt){wt.onmessage({data:Bt})}),wt.on("error",function(Bt){wt.onerror(Bt)}),wt.on("detachedExit",function(){})),wt.postMessage({cmd:"load",urlOrBlob:a.mainScriptUrlOrBlob||c,wasmMemory:jt,wasmModule:Et})},yc:function(){var wt=bt("ort-wasm-threaded.worker.js");Lt.Yb.push(new Worker(wt))},Cc:function(){return Lt.Yb.length==0&&(Lt.yc(),Lt.Fc(Lt.Yb[0])),Lt.Yb.pop()}};function Ut(wt){for(;0<wt.length;)wt.shift()(a)}function Kt(wt){var Rt=Yn();return wt=wt(),Wn(Rt),wt}function Ft(wt){if(yt)return $n(2,0,wt);try{Dt(wt)}catch(Rt){Rt instanceof Sn||Rt=="unwind"||lt(1,Rt)}}a.PThread=Lt,a.establishStackSpace=function(){var wt=Mr(),Rt=nt()[wt+44>>2>>>0];wt=nt()[wt+48>>2>>>0],ro(Rt,Rt-wt),Wn(Rt)};var Yt=[];function Wt(wt){var Rt=Yt[wt];return Rt||(wt>=Yt.length&&(Yt.length=wt+1),Yt[wt]=Rt=Tn.get(wt)),Rt}a.invokeEntryPoint=function(wt,Rt){wt=Wt(wt)(Rt),Pt()?Lt.nc(wt):no(wt)};var Xt,sn,en=[],Qt=0,ln=0;function gn(wt){this.Zb=wt,this.Sb=wt-24,this.xc=function(Rt){et()[this.Sb+4>>2>>>0]=Rt},this.bc=function(){return et()[this.Sb+4>>2>>>0]},this.wc=function(Rt){et()[this.Sb+8>>2>>>0]=Rt},this.Dc=function(){return et()[this.Sb+8>>2>>>0]},this.rc=function(){nt()[this.Sb>>2>>>0]=0},this.hc=function(Rt){Rt=Rt?1:0,_()[this.Sb+12>>0>>>0]=Rt},this.uc=function(){return _()[this.Sb+12>>0>>>0]!=0},this.ic=function(Rt){Rt=Rt?1:0,_()[this.Sb+13>>0>>>0]=Rt},this.kc=function(){return _()[this.Sb+13>>0>>>0]!=0},this.fc=function(Rt,Bt){this.cc(0),this.xc(Rt),this.wc(Bt),this.rc(),this.hc(!1),this.ic(!1)},this.sc=function(){Atomics.add(nt(),this.Sb>>2,1)},this.Hc=function(){return Atomics.sub(nt(),this.Sb>>2,1)===1},this.cc=function(Rt){et()[this.Sb+16>>2>>>0]=Rt},this.tc=function(){return et()[this.Sb+16>>2>>>0]},this.vc=function(){if(io(this.bc()))return et()[this.Zb>>2>>>0];var Rt=this.tc();return Rt!==0?Rt:this.Zb}}function dn(wt){return Xr(new gn(wt).Sb)}function Mn(wt,Rt,Bt,qt){return yt?$n(3,1,wt,Rt,Bt,qt):rn(wt,Rt,Bt,qt)}function rn(wt,Rt,Bt,qt){if(typeof SharedArrayBuffer>"u")return Ot("Current environment does not support SharedArrayBuffer, pthreads are not available!"),6;var tn=[];return yt&&tn.length===0?Mn(wt,Rt,Bt,qt):(wt={Ic:Bt,Ub:wt,zc:qt,Nc:tn},yt?(wt.Oc="spawnThread",postMessage(wt,tn),0):gr(wt))}function kn(wt,Rt,Bt){return yt?$n(4,1,wt,Rt,Bt):0}function zn(wt,Rt){if(yt)return $n(5,1,wt,Rt)}function pn(wt,Rt){if(yt)return $n(6,1,wt,Rt)}function In(wt,Rt,Bt){if(yt)return $n(7,1,wt,Rt,Bt)}function hn(wt,Rt,Bt){return yt?$n(8,1,wt,Rt,Bt):0}function jn(wt,Rt){if(yt)return $n(9,1,wt,Rt)}function pr(wt,Rt,Bt){if(yt)return $n(10,1,wt,Rt,Bt)}function En(wt,Rt,Bt,qt){if(yt)return $n(11,1,wt,Rt,Bt,qt)}function Bn(wt,Rt,Bt,qt){if(yt)return $n(12,1,wt,Rt,Bt,qt)}function Hn(wt,Rt,Bt,qt){if(yt)return $n(13,1,wt,Rt,Bt,qt)}function yr(wt){if(yt)return $n(14,1,wt)}function Mt(wt,Rt){if(yt)return $n(15,1,wt,Rt)}function Vt(wt,Rt,Bt){if(yt)return $n(16,1,wt,Rt,Bt)}function Gt(wt){Atomics.store(nt(),wt>>2,1),Mr()&&zr(wt),Atomics.compareExchange(nt(),wt>>2,1,0)}function Zt(wt){return et()[wt>>>2]+4294967296*nt()[wt+4>>>2]}function nn(wt,Rt,Bt,qt,tn,cn){return yt?$n(17,1,wt,Rt,Bt,qt,tn,cn):-52}function on(wt,Rt,Bt,qt,tn,cn){if(yt)return $n(18,1,wt,Rt,Bt,qt,tn,cn)}function xn(wt){var Rt=yn(wt)+1,Bt=Dr(Rt);return Bt&&un(wt,_(),Bt,Rt),Bt}function Cn(wt,Rt,Bt){function qt(Zn){return(Zn=Zn.toTimeString().match(/\(([A-Za-z ]+)\)$/))?Zn[1]:"GMT"}if(yt)return $n(19,1,wt,Rt,Bt);var tn=new Date().getFullYear(),cn=new Date(tn,0,1),An=new Date(tn,6,1);tn=cn.getTimezoneOffset();var Fn=An.getTimezoneOffset(),Qn=Math.max(tn,Fn);nt()[wt>>2>>>0]=60*Qn,nt()[Rt>>2>>>0]=+(tn!=Fn),wt=qt(cn),Rt=qt(An),wt=xn(wt),Rt=xn(Rt),Fn<tn?(et()[Bt>>2>>>0]=wt,et()[Bt+4>>2>>>0]=Rt):(et()[Bt>>2>>>0]=Rt,et()[Bt+4>>2>>>0]=wt)}function $n(wt,Rt){var Bt=arguments.length-2,qt=arguments;return Kt(()=>{for(var tn=to(8*Bt),cn=tn>>3,An=0;An<Bt;An++){var Fn=qt[2+An];b()[cn+An>>>0]=Fn}return Ur(wt,Bt,tn,Rt)})}a.executeNotifiedProxyingQueue=Gt,sn=dt?()=>{var wt=process.hrtime();return 1e3*wt[0]+wt[1]/1e6}:yt?()=>performance.now()-a.__performance_now_clock_drift:()=>performance.now();var Vn,Jn=[],Tr={};function Er(){if(!Vn){var wt,Rt={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",_:ut||"./this.program"};for(wt in Tr)Tr[wt]===void 0?delete Rt[wt]:Rt[wt]=Tr[wt];var Bt=[];for(wt in Rt)Bt.push(wt+"="+Rt[wt]);Vn=Bt}return Vn}function an(wt,Rt){if(yt)return $n(20,1,wt,Rt);var Bt=0;return Er().forEach(function(qt,tn){var cn=Rt+Bt;for(tn=et()[wt+4*tn>>2>>>0]=cn,cn=0;cn<qt.length;++cn)_()[tn++>>0>>>0]=qt.charCodeAt(cn);_()[tn>>0>>>0]=0,Bt+=qt.length+1}),0}function Xn(wt,Rt){if(yt)return $n(21,1,wt,Rt);var Bt=Er();et()[wt>>2>>>0]=Bt.length;var qt=0;return Bt.forEach(function(tn){qt+=tn.length+1}),et()[Rt>>2>>>0]=qt,0}function Un(wt){return yt?$n(22,1,wt):52}function kr(wt,Rt,Bt,qt){return yt?$n(23,1,wt,Rt,Bt,qt):52}function Ir(wt,Rt,Bt,qt,tn){return yt?$n(24,1,wt,Rt,Bt,qt,tn):70}var Br=[null,[],[]];function Vr(wt,Rt){var Bt=Br[wt];Rt===0||Rt===10?((wt===1?At:Ot)(Ht(Bt,0)),Bt.length=0):Bt.push(Rt)}function Zr(wt,Rt,Bt,qt){if(yt)return $n(25,1,wt,Rt,Bt,qt);for(var tn=0,cn=0;cn<Bt;cn++){var An=et()[Rt>>2>>>0],Fn=et()[Rt+4>>2>>>0];Rt+=8;for(var Qn=0;Qn<Fn;Qn++)Vr(wt,j()[An+Qn>>>0]);tn+=Fn}return et()[qt>>2>>>0]=tn,0}var Or=0;function Gr(wt){return wt%4==0&&(wt%100!=0||wt%400==0)}var Ar=[31,29,31,30,31,30,31,31,30,31,30,31],qr=[31,28,31,30,31,30,31,31,30,31,30,31];function Wr(wt,Rt,Bt,qt){function tn(fn,dr,xr){for(fn=typeof fn=="number"?fn.toString():fn||"";fn.length<dr;)fn=xr[0]+fn;return fn}function cn(fn,dr){return tn(fn,dr,"0")}function An(fn,dr){function xr(Kr){return 0>Kr?-1:0<Kr?1:0}var Lr;return(Lr=xr(fn.getFullYear()-dr.getFullYear()))===0&&(Lr=xr(fn.getMonth()-dr.getMonth()))===0&&(Lr=xr(fn.getDate()-dr.getDate())),Lr}function Fn(fn){switch(fn.getDay()){case 0:return new Date(fn.getFullYear()-1,11,29);case 1:return fn;case 2:return new Date(fn.getFullYear(),0,3);case 3:return new Date(fn.getFullYear(),0,2);case 4:return new Date(fn.getFullYear(),0,1);case 5:return new Date(fn.getFullYear()-1,11,31);case 6:return new Date(fn.getFullYear()-1,11,30)}}function Qn(fn){var dr=fn.Wb;for(fn=new Date(new Date(fn.Xb+1900,0,1).getTime());0<dr;){var xr=fn.getMonth(),Lr=(Gr(fn.getFullYear())?Ar:qr)[xr];if(!(dr>Lr-fn.getDate())){fn.setDate(fn.getDate()+dr);break}dr-=Lr-fn.getDate()+1,fn.setDate(1),11>xr?fn.setMonth(xr+1):(fn.setMonth(0),fn.setFullYear(fn.getFullYear()+1))}return xr=new Date(fn.getFullYear()+1,0,4),dr=Fn(new Date(fn.getFullYear(),0,4)),xr=Fn(xr),0>=An(dr,fn)?0>=An(xr,fn)?fn.getFullYear()+1:fn.getFullYear():fn.getFullYear()-1}var Zn=nt()[qt+40>>2>>>0];for(var $r in qt={Lc:nt()[qt>>2>>>0],Kc:nt()[qt+4>>2>>>0],dc:nt()[qt+8>>2>>>0],jc:nt()[qt+12>>2>>>0],ec:nt()[qt+16>>2>>>0],Xb:nt()[qt+20>>2>>>0],Tb:nt()[qt+24>>2>>>0],Wb:nt()[qt+28>>2>>>0],Rc:nt()[qt+32>>2>>>0],Jc:nt()[qt+36>>2>>>0],Mc:Zn?Jt(Zn):""},Bt=Jt(Bt),Zn={"%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"})Bt=Bt.replace(new RegExp($r,"g"),Zn[$r]);var jr="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),Rr="January February March April May June July August September October November December".split(" ");for($r in Zn={"%a":function(fn){return jr[fn.Tb].substring(0,3)},"%A":function(fn){return jr[fn.Tb]},"%b":function(fn){return Rr[fn.ec].substring(0,3)},"%B":function(fn){return Rr[fn.ec]},"%C":function(fn){return cn((fn.Xb+1900)/100|0,2)},"%d":function(fn){return cn(fn.jc,2)},"%e":function(fn){return tn(fn.jc,2," ")},"%g":function(fn){return Qn(fn).toString().substring(2)},"%G":function(fn){return Qn(fn)},"%H":function(fn){return cn(fn.dc,2)},"%I":function(fn){return(fn=fn.dc)==0?fn=12:12<fn&&(fn-=12),cn(fn,2)},"%j":function(fn){for(var dr=0,xr=0;xr<=fn.ec-1;dr+=(Gr(fn.Xb+1900)?Ar:qr)[xr++]);return cn(fn.jc+dr,3)},"%m":function(fn){return cn(fn.ec+1,2)},"%M":function(fn){return cn(fn.Kc,2)},"%n":function(){return`
|
|
69
|
-
`},"%p":function(fn){return 0<=fn.dc&&12>fn.dc?"AM":"PM"},"%S":function(fn){return cn(fn.Lc,2)},"%t":function(){return" "},"%u":function(fn){return fn.Tb||7},"%U":function(fn){return cn(Math.floor((fn.Wb+7-fn.Tb)/7),2)},"%V":function(fn){var dr=Math.floor((fn.Wb+7-(fn.Tb+6)%7)/7);if(2>=(fn.Tb+371-fn.Wb-2)%7&&dr++,dr)dr==53&&((xr=(fn.Tb+371-fn.Wb)%7)==4||xr==3&&Gr(fn.Xb)||(dr=1));else{dr=52;var xr=(fn.Tb+7-fn.Wb-1)%7;(xr==4||xr==5&&Gr(fn.Xb%400-1))&&dr++}return cn(dr,2)},"%w":function(fn){return fn.Tb},"%W":function(fn){return cn(Math.floor((fn.Wb+7-(fn.Tb+6)%7)/7),2)},"%y":function(fn){return(fn.Xb+1900).toString().substring(2)},"%Y":function(fn){return fn.Xb+1900},"%z":function(fn){var dr=0<=(fn=fn.Jc);return fn=Math.abs(fn)/60,(dr?"+":"-")+("0000"+(fn/60*100+fn%60)).slice(-4)},"%Z":function(fn){return fn.Mc},"%%":function(){return"%"}},Bt=Bt.replace(/%%/g,"\0\0"),Zn)Bt.includes($r)&&(Bt=Bt.replace(new RegExp($r,"g"),Zn[$r](qt)));return $r=function(fn){var dr=Array(yn(fn)+1);return un(fn,dr,0,dr.length),dr}(Bt=Bt.replace(/\0\0/g,"%")),$r.length>Rt?0:(function(fn,dr){_().set(fn,dr>>>0)}($r,wt),$r.length-1)}Lt.fc();var Jr=[null,kt,Ft,Mn,kn,zn,pn,In,hn,jn,pr,En,Bn,Hn,yr,Mt,Vt,nn,on,Cn,an,Xn,Un,kr,Ir,Zr],Pr={b:function(wt){return Dr(wt+24)+24},n:function(wt){return(wt=new gn(wt)).uc()||(wt.hc(!0),Qt--),wt.ic(!1),en.push(wt),wt.sc(),wt.vc()},ma:function(wt){throw Ot("Unexpected exception thrown, this is not properly supported - aborting"),zt=!0,wt},x:function(){Kn(0);var wt=en.pop();if(wt.Hc()&&!wt.kc()){var Rt=wt.Dc();Rt&&Wt(Rt)(wt.Zb),dn(wt.Zb)}ln=0},e:function(){var wt=ln;if(!wt)return Or=0;var Rt=new gn(wt);Rt.cc(wt);var Bt=Rt.bc();if(!Bt)return Or=0,wt;for(var qt=Array.prototype.slice.call(arguments),tn=0;tn<qt.length;tn++){var cn=qt[tn];if(cn===0||cn===Bt)break;if(_i(cn,Bt,Rt.Sb+16))return Or=cn,wt}return Or=Bt,wt},l:function(){var wt=ln;if(!wt)return Or=0;var Rt=new gn(wt);Rt.cc(wt);var Bt=Rt.bc();if(!Bt)return Or=0,wt;for(var qt=Array.prototype.slice.call(arguments),tn=0;tn<qt.length;tn++){var cn=qt[tn];if(cn===0||cn===Bt)break;if(_i(cn,Bt,Rt.Sb+16))return Or=cn,wt}return Or=Bt,wt},h:function(){var wt=ln;if(!wt)return Or=0;var Rt=new gn(wt);Rt.cc(wt);var Bt=Rt.bc();if(!Bt)return Or=0,wt;for(var qt=Array.prototype.slice.call(arguments),tn=0;tn<qt.length;tn++){var cn=qt[tn];if(cn===0||cn===Bt)break;if(_i(cn,Bt,Rt.Sb+16))return Or=cn,wt}return Or=Bt,wt},t:dn,M:function(){var wt=en.pop();wt||_n("no exception to throw");var Rt=wt.Zb;throw wt.kc()||(en.push(wt),wt.ic(!0),wt.hc(!1),Qt++),ln=Rt,Rt},c:function(wt,Rt,Bt){throw new gn(wt).fc(Rt,Bt),ln=wt,Qt++,wt},pa:function(){return Qt},Fa:function(wt){Fr(wt,!ft,1,!ct),Lt.pc()},T:function(wt){yt?postMessage({cmd:"cleanupThread",thread:wt}):qn(wt)},xa:rn,j:function(wt){throw ln||(ln=wt),wt},H:kn,Ma:zn,ua:pn,wa:In,oa:hn,Ka:jn,Ca:pr,Ja:En,V:Bn,va:Hn,sa:yr,La:Mt,ta:Vt,Ta:function(){},X:function(){_n("To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking")},Ua:function(){_n("To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking")},W:function(){return Date.now()},ya:function(){return 2097152},Oa:function(){return!0},za:function(wt,Rt,Bt,qt){if(wt==Rt)setTimeout(()=>Gt(qt));else if(yt)postMessage({targetThread:wt,cmd:"processProxyingQueue",queue:qt});else{if(!(wt=Lt.Vb[wt]))return;wt.postMessage({cmd:"processProxyingQueue",queue:qt})}return 1},Ea:function(){return-1},Pa:function(wt,Rt){wt=new Date(1e3*Zt(wt)),nt()[Rt>>2>>>0]=wt.getUTCSeconds(),nt()[Rt+4>>2>>>0]=wt.getUTCMinutes(),nt()[Rt+8>>2>>>0]=wt.getUTCHours(),nt()[Rt+12>>2>>>0]=wt.getUTCDate(),nt()[Rt+16>>2>>>0]=wt.getUTCMonth(),nt()[Rt+20>>2>>>0]=wt.getUTCFullYear()-1900,nt()[Rt+24>>2>>>0]=wt.getUTCDay(),wt=(wt.getTime()-Date.UTC(wt.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,nt()[Rt+28>>2>>>0]=wt},Qa:function(wt,Rt){wt=new Date(1e3*Zt(wt)),nt()[Rt>>2>>>0]=wt.getSeconds(),nt()[Rt+4>>2>>>0]=wt.getMinutes(),nt()[Rt+8>>2>>>0]=wt.getHours(),nt()[Rt+12>>2>>>0]=wt.getDate(),nt()[Rt+16>>2>>>0]=wt.getMonth(),nt()[Rt+20>>2>>>0]=wt.getFullYear()-1900,nt()[Rt+24>>2>>>0]=wt.getDay();var Bt=new Date(wt.getFullYear(),0,1),qt=(wt.getTime()-Bt.getTime())/864e5|0;nt()[Rt+28>>2>>>0]=qt,nt()[Rt+36>>2>>>0]=-60*wt.getTimezoneOffset(),qt=new Date(wt.getFullYear(),6,1).getTimezoneOffset(),wt=0|(qt!=(Bt=Bt.getTimezoneOffset())&&wt.getTimezoneOffset()==Math.min(Bt,qt)),nt()[Rt+32>>2>>>0]=wt},Ra:function(wt){var Rt=new Date(nt()[wt+20>>2>>>0]+1900,nt()[wt+16>>2>>>0],nt()[wt+12>>2>>>0],nt()[wt+8>>2>>>0],nt()[wt+4>>2>>>0],nt()[wt>>2>>>0],0),Bt=nt()[wt+32>>2>>>0],qt=Rt.getTimezoneOffset(),tn=new Date(Rt.getFullYear(),0,1),cn=new Date(Rt.getFullYear(),6,1).getTimezoneOffset(),An=tn.getTimezoneOffset(),Fn=Math.min(An,cn);return 0>Bt?nt()[wt+32>>2>>>0]=+(cn!=An&&Fn==qt):0<Bt!=(Fn==qt)&&(cn=Math.max(An,cn),Rt.setTime(Rt.getTime()+6e4*((0<Bt?Fn:cn)-qt))),nt()[wt+24>>2>>>0]=Rt.getDay(),Bt=(Rt.getTime()-tn.getTime())/864e5|0,nt()[wt+28>>2>>>0]=Bt,nt()[wt>>2>>>0]=Rt.getSeconds(),nt()[wt+4>>2>>>0]=Rt.getMinutes(),nt()[wt+8>>2>>>0]=Rt.getHours(),nt()[wt+12>>2>>>0]=Rt.getDate(),nt()[wt+16>>2>>>0]=Rt.getMonth(),Rt.getTime()/1e3|0},Aa:nn,Ba:on,Sa:function wt(Rt,Bt,qt){wt.Ac||(wt.Ac=!0,Cn(Rt,Bt,qt))},y:function(){_n("")},U:function(){if(!dt&&!ft){var wt="Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread";Xt||(Xt={}),Xt[wt]||(Xt[wt]=1,dt&&(wt="warning: "+wt),Ot(wt))}},ra:function(){return 4294901760},B:sn,Ia:function(wt,Rt,Bt){j().copyWithin(wt>>>0,Rt>>>0,Rt+Bt>>>0)},F:function(){return dt?s(3993).cpus().length:navigator.hardwareConcurrency},Da:function(wt,Rt,Bt){Jn.length=Rt,Bt>>=3;for(var qt=0;qt<Rt;qt++)Jn[qt]=b()[Bt+qt>>>0];return(0>wt?Nn[-wt-1]:Jr[wt]).apply(null,Jn)},qa:function(wt){var Rt=j().length;if((wt>>>=0)<=Rt||4294901760<wt)return!1;for(var Bt=1;4>=Bt;Bt*=2){var qt=Rt*(1+.2/Bt);qt=Math.min(qt,wt+100663296);var tn=Math;qt=Math.max(wt,qt),tn=tn.min.call(tn,4294901760,qt+(65536-qt%65536)%65536);e:{try{jt.grow(tn-mt.byteLength+65535>>>16),vn(jt.buffer);var cn=1;break e}catch{}cn=void 0}if(cn)return!0}return!1},Na:function(){throw"unwind"},Ga:an,Ha:Xn,J:Dt,I:Un,S:kr,ga:Ir,R:Zr,d:function(){return Or},na:function wt(Rt,Bt){wt.lc||(wt.lc=function(){if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function"){var tn=new Uint8Array(1);return()=>(crypto.getRandomValues(tn),tn[0])}if(dt)try{var cn=s(Object(function(){var An=new Error("Cannot find module 'crypto'");throw An.code="MODULE_NOT_FOUND",An}()));return()=>cn.randomBytes(1)[0]}catch{}return()=>_n("randomDevice")}());for(var qt=0;qt<Bt;qt++)_()[Rt+qt>>0>>>0]=wt.lc();return 0},ia:function(wt,Rt,Bt){var qt=Yn();try{return Wt(wt)(Rt,Bt)}catch(tn){if(Wn(qt),tn!==tn+0)throw tn;Kn(1,0)}},ja:function(wt,Rt,Bt){var qt=Yn();try{return Wt(wt)(Rt,Bt)}catch(tn){if(Wn(qt),tn!==tn+0)throw tn;Kn(1,0)}},K:function(wt){var Rt=Yn();try{return Wt(wt)()}catch(Bt){if(Wn(Rt),Bt!==Bt+0)throw Bt;Kn(1,0)}},f:function(wt,Rt){var Bt=Yn();try{return Wt(wt)(Rt)}catch(qt){if(Wn(Bt),qt!==qt+0)throw qt;Kn(1,0)}},P:function(wt,Rt,Bt){var qt=Yn();try{return Wt(wt)(Rt,Bt)}catch(tn){if(Wn(qt),tn!==tn+0)throw tn;Kn(1,0)}},Q:function(wt,Rt,Bt){var qt=Yn();try{return Wt(wt)(Rt,Bt)}catch(tn){if(Wn(qt),tn!==tn+0)throw tn;Kn(1,0)}},k:function(wt,Rt,Bt){var qt=Yn();try{return Wt(wt)(Rt,Bt)}catch(tn){if(Wn(qt),tn!==tn+0)throw tn;Kn(1,0)}},p:function(wt,Rt,Bt,qt){var tn=Yn();try{return Wt(wt)(Rt,Bt,qt)}catch(cn){if(Wn(tn),cn!==cn+0)throw cn;Kn(1,0)}},q:function(wt,Rt,Bt,qt,tn){var cn=Yn();try{return Wt(wt)(Rt,Bt,qt,tn)}catch(An){if(Wn(cn),An!==An+0)throw An;Kn(1,0)}},N:function(wt,Rt,Bt,qt,tn,cn){var An=Yn();try{return Wt(wt)(Rt,Bt,qt,tn,cn)}catch(Fn){if(Wn(An),Fn!==Fn+0)throw Fn;Kn(1,0)}},s:function(wt,Rt,Bt,qt,tn,cn){var An=Yn();try{return Wt(wt)(Rt,Bt,qt,tn,cn)}catch(Fn){if(Wn(An),Fn!==Fn+0)throw Fn;Kn(1,0)}},w:function(wt,Rt,Bt,qt,tn,cn,An){var Fn=Yn();try{return Wt(wt)(Rt,Bt,qt,tn,cn,An)}catch(Qn){if(Wn(Fn),Qn!==Qn+0)throw Qn;Kn(1,0)}},L:function(wt,Rt,Bt,qt,tn,cn,An,Fn){var Qn=Yn();try{return Wt(wt)(Rt,Bt,qt,tn,cn,An,Fn)}catch(Zn){if(Wn(Qn),Zn!==Zn+0)throw Zn;Kn(1,0)}},E:function(wt,Rt,Bt,qt,tn,cn,An,Fn,Qn,Zn,$r,jr){var Rr=Yn();try{return Wt(wt)(Rt,Bt,qt,tn,cn,An,Fn,Qn,Zn,$r,jr)}catch(fn){if(Wn(Rr),fn!==fn+0)throw fn;Kn(1,0)}},aa:function(wt,Rt,Bt,qt,tn,cn,An,Fn){var Qn=Yn();try{return ho(wt,Rt,Bt,qt,tn,cn,An,Fn)}catch(Zn){if(Wn(Qn),Zn!==Zn+0)throw Zn;Kn(1,0)}},_:function(wt,Rt,Bt,qt,tn,cn,An){var Fn=Yn();try{return so(wt,Rt,Bt,qt,tn,cn,An)}catch(Qn){if(Wn(Fn),Qn!==Qn+0)throw Qn;Kn(1,0)}},Z:function(wt,Rt,Bt,qt,tn){var cn=Yn();try{return mo(wt,Rt,Bt,qt,tn)}catch(An){if(Wn(cn),An!==An+0)throw An;Kn(1,0)}},ca:function(wt,Rt,Bt,qt){var tn=Yn();try{return fo(wt,Rt,Bt,qt)}catch(cn){if(Wn(tn),cn!==cn+0)throw cn;Kn(1,0)}},$:function(wt){var Rt=Yn();try{return oo(wt)}catch(Bt){if(Wn(Rt),Bt!==Bt+0)throw Bt;Kn(1,0)}},ba:function(wt,Rt){var Bt=Yn();try{return po(wt,Rt)}catch(qt){if(Wn(Bt),qt!==qt+0)throw qt;Kn(1,0)}},Y:function(wt,Rt,Bt){var qt=Yn();try{return ao(wt,Rt,Bt)}catch(tn){if(Wn(qt),tn!==tn+0)throw tn;Kn(1,0)}},g:function(wt){var Rt=Yn();try{Wt(wt)()}catch(Bt){if(Wn(Rt),Bt!==Bt+0)throw Bt;Kn(1,0)}},r:function(wt,Rt){var Bt=Yn();try{Wt(wt)(Rt)}catch(qt){if(Wn(Bt),qt!==qt+0)throw qt;Kn(1,0)}},i:function(wt,Rt,Bt){var qt=Yn();try{Wt(wt)(Rt,Bt)}catch(tn){if(Wn(qt),tn!==tn+0)throw tn;Kn(1,0)}},ha:function(wt,Rt,Bt,qt){var tn=Yn();try{Wt(wt)(Rt,Bt,qt)}catch(cn){if(Wn(tn),cn!==cn+0)throw cn;Kn(1,0)}},m:function(wt,Rt,Bt,qt){var tn=Yn();try{Wt(wt)(Rt,Bt,qt)}catch(cn){if(Wn(tn),cn!==cn+0)throw cn;Kn(1,0)}},v:function(wt,Rt,Bt,qt,tn){var cn=Yn();try{Wt(wt)(Rt,Bt,qt,tn)}catch(An){if(Wn(cn),An!==An+0)throw An;Kn(1,0)}},u:function(wt,Rt,Bt,qt,tn,cn){var An=Yn();try{Wt(wt)(Rt,Bt,qt,tn,cn)}catch(Fn){if(Wn(An),Fn!==Fn+0)throw Fn;Kn(1,0)}},O:function(wt,Rt,Bt,qt,tn,cn,An){var Fn=Yn();try{Wt(wt)(Rt,Bt,qt,tn,cn,An)}catch(Qn){if(Wn(Fn),Qn!==Qn+0)throw Qn;Kn(1,0)}},A:function(wt,Rt,Bt,qt,tn,cn,An,Fn){var Qn=Yn();try{Wt(wt)(Rt,Bt,qt,tn,cn,An,Fn)}catch(Zn){if(Wn(Qn),Zn!==Zn+0)throw Zn;Kn(1,0)}},ka:function(wt,Rt,Bt,qt,tn,cn,An,Fn,Qn){var Zn=Yn();try{Wt(wt)(Rt,Bt,qt,tn,cn,An,Fn,Qn)}catch($r){if(Wn(Zn),$r!==$r+0)throw $r;Kn(1,0)}},C:function(wt,Rt,Bt,qt,tn,cn,An,Fn,Qn,Zn,$r){var jr=Yn();try{Wt(wt)(Rt,Bt,qt,tn,cn,An,Fn,Qn,Zn,$r)}catch(Rr){if(Wn(jr),Rr!==Rr+0)throw Rr;Kn(1,0)}},D:function(wt,Rt,Bt,qt,tn,cn,An,Fn,Qn,Zn,$r,jr,Rr,fn,dr,xr){var Lr=Yn();try{Wt(wt)(Rt,Bt,qt,tn,cn,An,Fn,Qn,Zn,$r,jr,Rr,fn,dr,xr)}catch(Kr){if(Wn(Lr),Kr!==Kr+0)throw Kr;Kn(1,0)}},fa:function(wt,Rt,Bt,qt,tn,cn,An,Fn){var Qn=Yn();try{uo(wt,Rt,Bt,qt,tn,cn,An,Fn)}catch(Zn){if(Wn(Qn),Zn!==Zn+0)throw Zn;Kn(1,0)}},da:function(wt,Rt,Bt,qt,tn,cn,An,Fn,Qn,Zn,$r,jr){var Rr=Yn();try{co(wt,Rt,Bt,qt,tn,cn,An,Fn,Qn,Zn,$r,jr)}catch(fn){if(Wn(Rr),fn!==fn+0)throw fn;Kn(1,0)}},ea:function(wt,Rt,Bt,qt,tn,cn){var An=Yn();try{lo(wt,Rt,Bt,qt,tn,cn)}catch(Fn){if(Wn(An),Fn!==Fn+0)throw Fn;Kn(1,0)}},o:function(wt){return wt},a:jt||a.wasmMemory,G:function(wt){Or=wt},la:Wr,z:function(wt,Rt,Bt,qt){return Wr(wt,Rt,Bt,qt)}};(function(){function wt(tn,cn){a.asm=tn.exports,Lt.qc.push(a.asm.sb),Tn=a.asm.ub,Gn.unshift(a.asm.Va),Et=cn,yt||(Dn--,a.monitorRunDependencies&&a.monitorRunDependencies(Dn),Dn==0&&Rn&&(tn=Rn,Rn=null,tn()))}function Rt(tn){wt(tn.instance,tn.module)}function Bt(tn){return function(){if(!$t&&(ct||ft)){if(typeof fetch=="function"&&!bn.startsWith("file://"))return fetch(bn,{credentials:"same-origin"}).then(function(cn){if(!cn.ok)throw"failed to load wasm binary file at '"+bn+"'";return cn.arrayBuffer()}).catch(function(){return Ln()});if(rt)return new Promise(function(cn,An){rt(bn,function(Fn){cn(new Uint8Array(Fn))},An)})}return Promise.resolve().then(function(){return Ln()})}().then(function(cn){return WebAssembly.instantiate(cn,qt)}).then(function(cn){return cn}).then(tn,function(cn){Ot("failed to asynchronously prepare wasm: "+cn),_n(cn)})}var qt={a:Pr};if(yt||(Dn++,a.monitorRunDependencies&&a.monitorRunDependencies(Dn)),a.instantiateWasm)try{return a.instantiateWasm(qt,wt)}catch(tn){return Ot("Module.instantiateWasm callback failed with error: "+tn),!1}($t||typeof WebAssembly.instantiateStreaming!="function"||On()||bn.startsWith("file://")||dt||typeof fetch!="function"?Bt(Rt):fetch(bn,{credentials:"same-origin"}).then(function(tn){return WebAssembly.instantiateStreaming(tn,qt).then(Rt,function(cn){return Ot("wasm streaming compile failed: "+cn),Ot("falling back to ArrayBuffer instantiation"),Bt(Rt)})})).catch(d)})(),a.___wasm_call_ctors=function(){return(a.___wasm_call_ctors=a.asm.Va).apply(null,arguments)},a._OrtInit=function(){return(a._OrtInit=a.asm.Wa).apply(null,arguments)},a._OrtCreateSessionOptions=function(){return(a._OrtCreateSessionOptions=a.asm.Xa).apply(null,arguments)},a._OrtAppendExecutionProvider=function(){return(a._OrtAppendExecutionProvider=a.asm.Ya).apply(null,arguments)},a._OrtAddSessionConfigEntry=function(){return(a._OrtAddSessionConfigEntry=a.asm.Za).apply(null,arguments)},a._OrtReleaseSessionOptions=function(){return(a._OrtReleaseSessionOptions=a.asm._a).apply(null,arguments)},a._OrtCreateSession=function(){return(a._OrtCreateSession=a.asm.$a).apply(null,arguments)},a._OrtReleaseSession=function(){return(a._OrtReleaseSession=a.asm.ab).apply(null,arguments)},a._OrtGetInputCount=function(){return(a._OrtGetInputCount=a.asm.bb).apply(null,arguments)},a._OrtGetOutputCount=function(){return(a._OrtGetOutputCount=a.asm.cb).apply(null,arguments)},a._OrtGetInputName=function(){return(a._OrtGetInputName=a.asm.db).apply(null,arguments)},a._OrtGetOutputName=function(){return(a._OrtGetOutputName=a.asm.eb).apply(null,arguments)},a._OrtFree=function(){return(a._OrtFree=a.asm.fb).apply(null,arguments)},a._OrtCreateTensor=function(){return(a._OrtCreateTensor=a.asm.gb).apply(null,arguments)},a._OrtGetTensorData=function(){return(a._OrtGetTensorData=a.asm.hb).apply(null,arguments)},a._OrtReleaseTensor=function(){return(a._OrtReleaseTensor=a.asm.ib).apply(null,arguments)},a._OrtCreateRunOptions=function(){return(a._OrtCreateRunOptions=a.asm.jb).apply(null,arguments)},a._OrtAddRunConfigEntry=function(){return(a._OrtAddRunConfigEntry=a.asm.kb).apply(null,arguments)},a._OrtReleaseRunOptions=function(){return(a._OrtReleaseRunOptions=a.asm.lb).apply(null,arguments)},a._OrtRun=function(){return(a._OrtRun=a.asm.mb).apply(null,arguments)},a._OrtEndProfiling=function(){return(a._OrtEndProfiling=a.asm.nb).apply(null,arguments)};var Mr=a._pthread_self=function(){return(Mr=a._pthread_self=a.asm.ob).apply(null,arguments)},Dr=a._malloc=function(){return(Dr=a._malloc=a.asm.pb).apply(null,arguments)},Xr=a._free=function(){return(Xr=a._free=a.asm.qb).apply(null,arguments)},Cr=a._fflush=function(){return(Cr=a._fflush=a.asm.rb).apply(null,arguments)};a.__emscripten_tls_init=function(){return(a.__emscripten_tls_init=a.asm.sb).apply(null,arguments)};var Yr=a.___funcs_on_exit=function(){return(Yr=a.___funcs_on_exit=a.asm.tb).apply(null,arguments)},Fr=a.__emscripten_thread_init=function(){return(Fr=a.__emscripten_thread_init=a.asm.vb).apply(null,arguments)};a.__emscripten_thread_crashed=function(){return(a.__emscripten_thread_crashed=a.asm.wb).apply(null,arguments)};var Nr,Ur=a._emscripten_run_in_main_runtime_thread_js=function(){return(Ur=a._emscripten_run_in_main_runtime_thread_js=a.asm.xb).apply(null,arguments)},zr=a.__emscripten_proxy_execute_task_queue=function(){return(zr=a.__emscripten_proxy_execute_task_queue=a.asm.yb).apply(null,arguments)},eo=a.__emscripten_thread_free_data=function(){return(eo=a.__emscripten_thread_free_data=a.asm.zb).apply(null,arguments)},no=a.__emscripten_thread_exit=function(){return(no=a.__emscripten_thread_exit=a.asm.Ab).apply(null,arguments)},Kn=a._setThrew=function(){return(Kn=a._setThrew=a.asm.Bb).apply(null,arguments)},ro=a._emscripten_stack_set_limits=function(){return(ro=a._emscripten_stack_set_limits=a.asm.Cb).apply(null,arguments)},Yn=a.stackSave=function(){return(Yn=a.stackSave=a.asm.Db).apply(null,arguments)},Wn=a.stackRestore=function(){return(Wn=a.stackRestore=a.asm.Eb).apply(null,arguments)},to=a.stackAlloc=function(){return(to=a.stackAlloc=a.asm.Fb).apply(null,arguments)},_i=a.___cxa_can_catch=function(){return(_i=a.___cxa_can_catch=a.asm.Gb).apply(null,arguments)},io=a.___cxa_is_pointer_type=function(){return(io=a.___cxa_is_pointer_type=a.asm.Hb).apply(null,arguments)},oo=a.dynCall_j=function(){return(oo=a.dynCall_j=a.asm.Ib).apply(null,arguments)},so=a.dynCall_iiiiij=function(){return(so=a.dynCall_iiiiij=a.asm.Jb).apply(null,arguments)},ao=a.dynCall_jii=function(){return(ao=a.dynCall_jii=a.asm.Kb).apply(null,arguments)},uo=a.dynCall_viiiiij=function(){return(uo=a.dynCall_viiiiij=a.asm.Lb).apply(null,arguments)},lo=a.dynCall_vjji=function(){return(lo=a.dynCall_vjji=a.asm.Mb).apply(null,arguments)},co=a.dynCall_viiijjjii=function(){return(co=a.dynCall_viiijjjii=a.asm.Nb).apply(null,arguments)},fo=a.dynCall_iij=function(){return(fo=a.dynCall_iij=a.asm.Ob).apply(null,arguments)},po=a.dynCall_ji=function(){return(po=a.dynCall_ji=a.asm.Pb).apply(null,arguments)},ho=a.dynCall_iiiiiij=function(){return(ho=a.dynCall_iiiiiij=a.asm.Qb).apply(null,arguments)},mo=a.dynCall_iiij=function(){return(mo=a.dynCall_iiij=a.asm.Rb).apply(null,arguments)};function go(){function wt(){if(!Nr&&(Nr=!0,a.calledRun=!0,!zt)&&(yt||Ut(Gn),o(a),a.onRuntimeInitialized&&a.onRuntimeInitialized(),!yt)){if(a.postRun)for(typeof a.postRun=="function"&&(a.postRun=[a.postRun]);a.postRun.length;){var Rt=a.postRun.shift();xt.unshift(Rt)}Ut(xt)}}if(!(0<Dn))if(yt)o(a),yt||Ut(Gn),postMessage({cmd:"loaded"});else{if(a.preRun)for(typeof a.preRun=="function"&&(a.preRun=[a.preRun]);a.preRun.length;)wn();Ut(Pn),0<Dn||(a.setStatus?(a.setStatus("Running..."),setTimeout(function(){setTimeout(function(){a.setStatus("")},1),wt()},1)):wt())}}if(a.UTF8ToString=Jt,a.stringToUTF8=function(wt,Rt,Bt){return un(wt,j(),Rt,Bt)},a.lengthBytesUTF8=yn,a.keepRuntimeAlive=Pt,a.wasmMemory=jt,a.stackSave=Yn,a.stackRestore=Wn,a.stackAlloc=to,a.ExitStatus=Sn,a.PThread=Lt,Rn=function wt(){Nr||go(),Nr||(Rn=wt)},a.preInit)for(typeof a.preInit=="function"&&(a.preInit=[a.preInit]);0<a.preInit.length;)a.preInit.pop()();return go(),$.ready});i.exports=h},932:(i,e,s)=>{var c,h=(c=(c=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function($){var _,j,nt;$=$||{},_||(_=$!==void 0?$:{}),_.ready=new Promise(function(Mt,Vt){j=Mt,nt=Vt});var et,b,a,o,d,g,rt=Object.assign({},_),st="./this.program",tt=(Mt,Vt)=>{throw Vt},ot=typeof window=="object",it=typeof importScripts=="function",at=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",ut="";at?(ut=it?s(908).dirname(ut)+"/":"//",g=()=>{d||(o=s(1384),d=s(908))},et=function(Mt,Vt){return g(),Mt=d.normalize(Mt),o.readFileSync(Mt,Vt?void 0:"utf8")},a=Mt=>((Mt=et(Mt,!0)).buffer||(Mt=new Uint8Array(Mt)),Mt),b=(Mt,Vt,Gt)=>{g(),Mt=d.normalize(Mt),o.readFile(Mt,function(Zt,nn){Zt?Gt(Zt):Vt(nn.buffer)})},1<process.argv.length&&(st=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),process.on("uncaughtException",function(Mt){if(!(Mt instanceof Gn))throw Mt}),process.on("unhandledRejection",function(Mt){throw Mt}),tt=(Mt,Vt)=>{if(dt||0<Nt)throw process.exitCode=Mt,Vt;Vt instanceof Gn||ft("exiting due to exception: "+Vt),process.exit(Mt)},_.inspect=function(){return"[Emscripten Module object]"}):(ot||it)&&(it?ut=self.location.href:typeof document<"u"&&document.currentScript&&(ut=document.currentScript.src),c&&(ut=c),ut=ut.indexOf("blob:")!==0?ut.substr(0,ut.replace(/[?#].*/,"").lastIndexOf("/")+1):"",et=Mt=>{var Vt=new XMLHttpRequest;return Vt.open("GET",Mt,!1),Vt.send(null),Vt.responseText},it&&(a=Mt=>{var Vt=new XMLHttpRequest;return Vt.open("GET",Mt,!1),Vt.responseType="arraybuffer",Vt.send(null),new Uint8Array(Vt.response)}),b=(Mt,Vt,Gt)=>{var Zt=new XMLHttpRequest;Zt.open("GET",Mt,!0),Zt.responseType="arraybuffer",Zt.onload=()=>{Zt.status==200||Zt.status==0&&Zt.response?Vt(Zt.response):Gt()},Zt.onerror=Gt,Zt.send(null)});var lt,ct=_.print||console.log.bind(console),ft=_.printErr||console.warn.bind(console);Object.assign(_,rt),rt=null,_.thisProgram&&(st=_.thisProgram),_.quit&&(tt=_.quit),_.wasmBinary&&(lt=_.wasmBinary);var dt=_.noExitRuntime||!1;typeof WebAssembly!="object"&&vn("no native wasm support detected");var yt,St,bt,Tt,vt,$t,At=!1,Ot=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function It(Mt,Vt,Gt){var Zt=(Vt>>>=0)+Gt;for(Gt=Vt;Mt[Gt]&&!(Gt>=Zt);)++Gt;if(16<Gt-Vt&&Mt.buffer&&Ot)return Ot.decode(Mt.subarray(Vt,Gt));for(Zt="";Vt<Gt;){var nn=Mt[Vt++];if(128&nn){var on=63&Mt[Vt++];if((224&nn)==192)Zt+=String.fromCharCode((31&nn)<<6|on);else{var xn=63&Mt[Vt++];65536>(nn=(240&nn)==224?(15&nn)<<12|on<<6|xn:(7&nn)<<18|on<<12|xn<<6|63&Mt[Vt++])?Zt+=String.fromCharCode(nn):(nn-=65536,Zt+=String.fromCharCode(55296|nn>>10,56320|1023&nn))}}else Zt+=String.fromCharCode(nn)}return Zt}function jt(Mt,Vt){return(Mt>>>=0)?It(Tt,Mt,Vt):""}function Et(Mt,Vt,Gt,Zt){if(!(0<Zt))return 0;var nn=Gt>>>=0;Zt=Gt+Zt-1;for(var on=0;on<Mt.length;++on){var xn=Mt.charCodeAt(on);if(55296<=xn&&57343>=xn&&(xn=65536+((1023&xn)<<10)|1023&Mt.charCodeAt(++on)),127>=xn){if(Gt>=Zt)break;Vt[Gt++>>>0]=xn}else{if(2047>=xn){if(Gt+1>=Zt)break;Vt[Gt++>>>0]=192|xn>>6}else{if(65535>=xn){if(Gt+2>=Zt)break;Vt[Gt++>>>0]=224|xn>>12}else{if(Gt+3>=Zt)break;Vt[Gt++>>>0]=240|xn>>18,Vt[Gt++>>>0]=128|xn>>12&63}Vt[Gt++>>>0]=128|xn>>6&63}Vt[Gt++>>>0]=128|63&xn}}return Vt[Gt>>>0]=0,Gt-nn}function mt(Mt){for(var Vt=0,Gt=0;Gt<Mt.length;++Gt){var Zt=Mt.charCodeAt(Gt);127>=Zt?Vt++:2047>=Zt?Vt+=2:55296<=Zt&&57343>=Zt?(Vt+=4,++Gt):Vt+=3}return Vt}function gt(){var Mt=yt.buffer;St=Mt,_.HEAP8=bt=new Int8Array(Mt),_.HEAP16=new Int16Array(Mt),_.HEAP32=vt=new Int32Array(Mt),_.HEAPU8=Tt=new Uint8Array(Mt),_.HEAPU16=new Uint16Array(Mt),_.HEAPU32=$t=new Uint32Array(Mt),_.HEAPF32=new Float32Array(Mt),_.HEAPF64=new Float64Array(Mt)}var ht,pt=[],_t=[],Ct=[],zt=[],Nt=0;function Ht(){var Mt=_.preRun.shift();pt.unshift(Mt)}var Jt,un=0,yn=null;function vn(Mt){throw _.onAbort&&_.onAbort(Mt),ft(Mt="Aborted("+Mt+")"),At=!0,Mt=new WebAssembly.RuntimeError(Mt+". Build with -sASSERTIONS for more info."),nt(Mt),Mt}function mn(){return Jt.startsWith("data:application/octet-stream;base64,")}if(Jt="ort-wasm.wasm",!mn()){var Tn=Jt;Jt=_.locateFile?_.locateFile(Tn,ut):ut+Tn}function Pn(){var Mt=Jt;try{if(Mt==Jt&<)return new Uint8Array(lt);if(a)return a(Mt);throw"both async and sync fetching of the wasm failed"}catch(Vt){vn(Vt)}}function Gn(Mt){this.name="ExitStatus",this.message="Program terminated with exit("+Mt+")",this.status=Mt}function wr(Mt){for(;0<Mt.length;)Mt.shift()(_)}var xt=[],Pt=0,wn=0;function bn(Mt){this.Db=Mt,this.zb=Mt-24,this.Ub=function(Vt){$t[this.zb+4>>2>>>0]=Vt},this.Eb=function(){return $t[this.zb+4>>2>>>0]},this.Sb=function(Vt){$t[this.zb+8>>2>>>0]=Vt},this.Wb=function(){return $t[this.zb+8>>2>>>0]},this.Tb=function(){vt[this.zb>>2>>>0]=0},this.Ib=function(Vt){bt[this.zb+12>>0>>>0]=Vt?1:0},this.Pb=function(){return bt[this.zb+12>>0>>>0]!=0},this.Jb=function(Vt){bt[this.zb+13>>0>>>0]=Vt?1:0},this.Lb=function(){return bt[this.zb+13>>0>>>0]!=0},this.Rb=function(Vt,Gt){this.Fb(0),this.Ub(Vt),this.Sb(Gt),this.Tb(),this.Ib(!1),this.Jb(!1)},this.Nb=function(){vt[this.zb>>2>>>0]+=1},this.Xb=function(){var Vt=vt[this.zb>>2>>>0];return vt[this.zb>>2>>>0]=Vt-1,Vt===1},this.Fb=function(Vt){$t[this.zb+16>>2>>>0]=Vt},this.Ob=function(){return $t[this.zb+16>>2>>>0]},this.Qb=function(){if(rn(this.Eb()))return $t[this.Db>>2>>>0];var Vt=this.Ob();return Vt!==0?Vt:this.Db}}function Dn(Mt){return Xt(new bn(Mt).zb)}var Rn=[];function _n(Mt){var Vt=Rn[Mt];return Vt||(Mt>=Rn.length&&(Rn.length=Mt+1),Rn[Mt]=Vt=ht.get(Mt)),Vt}function On(Mt){var Vt=mt(Mt)+1,Gt=Wt(Vt);return Gt&&Et(Mt,bt,Gt,Vt),Gt}var Ln={};function Nn(){if(!Sn){var Mt,Vt={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",_:st||"./this.program"};for(Mt in Ln)Ln[Mt]===void 0?delete Vt[Mt]:Vt[Mt]=Ln[Mt];var Gt=[];for(Mt in Vt)Gt.push(Mt+"="+Vt[Mt]);Sn=Gt}return Sn}var Sn,qn=[null,[],[]];function gr(Mt,Vt){var Gt=qn[Mt];Vt===0||Vt===10?((Mt===1?ct:ft)(It(Gt,0)),Gt.length=0):Gt.push(Vt)}var kt=0;function Dt(Mt){return Mt%4==0&&(Mt%100!=0||Mt%400==0)}var Lt=[31,29,31,30,31,30,31,31,30,31,30,31],Ut=[31,28,31,30,31,30,31,31,30,31,30,31];function Kt(Mt,Vt,Gt,Zt){function nn(an,Xn,Un){for(an=typeof an=="number"?an.toString():an||"";an.length<Xn;)an=Un[0]+an;return an}function on(an,Xn){return nn(an,Xn,"0")}function xn(an,Xn){function Un(Ir){return 0>Ir?-1:0<Ir?1:0}var kr;return(kr=Un(an.getFullYear()-Xn.getFullYear()))===0&&(kr=Un(an.getMonth()-Xn.getMonth()))===0&&(kr=Un(an.getDate()-Xn.getDate())),kr}function Cn(an){switch(an.getDay()){case 0:return new Date(an.getFullYear()-1,11,29);case 1:return an;case 2:return new Date(an.getFullYear(),0,3);case 3:return new Date(an.getFullYear(),0,2);case 4:return new Date(an.getFullYear(),0,1);case 5:return new Date(an.getFullYear()-1,11,31);case 6:return new Date(an.getFullYear()-1,11,30)}}function $n(an){var Xn=an.Bb;for(an=new Date(new Date(an.Cb+1900,0,1).getTime());0<Xn;){var Un=an.getMonth(),kr=(Dt(an.getFullYear())?Lt:Ut)[Un];if(!(Xn>kr-an.getDate())){an.setDate(an.getDate()+Xn);break}Xn-=kr-an.getDate()+1,an.setDate(1),11>Un?an.setMonth(Un+1):(an.setMonth(0),an.setFullYear(an.getFullYear()+1))}return Un=new Date(an.getFullYear()+1,0,4),Xn=Cn(new Date(an.getFullYear(),0,4)),Un=Cn(Un),0>=xn(Xn,an)?0>=xn(Un,an)?an.getFullYear()+1:an.getFullYear():an.getFullYear()-1}var Vn=vt[Zt+40>>2>>>0];for(var Jn in Zt={$b:vt[Zt>>2>>>0],Zb:vt[Zt+4>>2>>>0],Gb:vt[Zt+8>>2>>>0],Kb:vt[Zt+12>>2>>>0],Hb:vt[Zt+16>>2>>>0],Cb:vt[Zt+20>>2>>>0],Ab:vt[Zt+24>>2>>>0],Bb:vt[Zt+28>>2>>>0],bc:vt[Zt+32>>2>>>0],Yb:vt[Zt+36>>2>>>0],ac:Vn?jt(Vn):""},Gt=jt(Gt),Vn={"%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"})Gt=Gt.replace(new RegExp(Jn,"g"),Vn[Jn]);var Tr="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),Er="January February March April May June July August September October November December".split(" ");for(Jn in Vn={"%a":function(an){return Tr[an.Ab].substring(0,3)},"%A":function(an){return Tr[an.Ab]},"%b":function(an){return Er[an.Hb].substring(0,3)},"%B":function(an){return Er[an.Hb]},"%C":function(an){return on((an.Cb+1900)/100|0,2)},"%d":function(an){return on(an.Kb,2)},"%e":function(an){return nn(an.Kb,2," ")},"%g":function(an){return $n(an).toString().substring(2)},"%G":function(an){return $n(an)},"%H":function(an){return on(an.Gb,2)},"%I":function(an){return(an=an.Gb)==0?an=12:12<an&&(an-=12),on(an,2)},"%j":function(an){for(var Xn=0,Un=0;Un<=an.Hb-1;Xn+=(Dt(an.Cb+1900)?Lt:Ut)[Un++]);return on(an.Kb+Xn,3)},"%m":function(an){return on(an.Hb+1,2)},"%M":function(an){return on(an.Zb,2)},"%n":function(){return`
|
|
70
|
-
`},"%p":function(an){return 0<=an.Gb&&12>an.Gb?"AM":"PM"},"%S":function(an){return on(an.$b,2)},"%t":function(){return" "},"%u":function(an){return an.Ab||7},"%U":function(an){return on(Math.floor((an.Bb+7-an.Ab)/7),2)},"%V":function(an){var Xn=Math.floor((an.Bb+7-(an.Ab+6)%7)/7);if(2>=(an.Ab+371-an.Bb-2)%7&&Xn++,Xn)Xn==53&&((Un=(an.Ab+371-an.Bb)%7)==4||Un==3&&Dt(an.Cb)||(Xn=1));else{Xn=52;var Un=(an.Ab+7-an.Bb-1)%7;(Un==4||Un==5&&Dt(an.Cb%400-1))&&Xn++}return on(Xn,2)},"%w":function(an){return an.Ab},"%W":function(an){return on(Math.floor((an.Bb+7-(an.Ab+6)%7)/7),2)},"%y":function(an){return(an.Cb+1900).toString().substring(2)},"%Y":function(an){return an.Cb+1900},"%z":function(an){var Xn=0<=(an=an.Yb);return an=Math.abs(an)/60,(Xn?"+":"-")+("0000"+(an/60*100+an%60)).slice(-4)},"%Z":function(an){return an.ac},"%%":function(){return"%"}},Gt=Gt.replace(/%%/g,"\0\0"),Vn)Gt.includes(Jn)&&(Gt=Gt.replace(new RegExp(Jn,"g"),Vn[Jn](Zt)));return Jn=function(an){var Xn=Array(mt(an)+1);return Et(an,Xn,0,Xn.length),Xn}(Gt=Gt.replace(/\0\0/g,"%")),Jn.length>Vt?0:(bt.set(Jn,Mt>>>0),Jn.length-1)}var Ft={a:function(Mt){return Wt(Mt+24)+24},m:function(Mt){return(Mt=new bn(Mt)).Pb()||(Mt.Ib(!0),Pt--),Mt.Jb(!1),xt.push(Mt),Mt.Nb(),Mt.Qb()},ia:function(Mt){throw ft("Unexpected exception thrown, this is not properly supported - aborting"),At=!0,Mt},w:function(){Qt(0);var Mt=xt.pop();if(Mt.Xb()&&!Mt.Lb()){var Vt=Mt.Wb();Vt&&_n(Vt)(Mt.Db),Dn(Mt.Db)}wn=0},d:function(){var Mt=wn;if(!Mt)return kt=0;var Vt=new bn(Mt);Vt.Fb(Mt);var Gt=Vt.Eb();if(!Gt)return kt=0,Mt;for(var Zt=Array.prototype.slice.call(arguments),nn=0;nn<Zt.length;nn++){var on=Zt[nn];if(on===0||on===Gt)break;if(Mn(on,Gt,Vt.zb+16))return kt=on,Mt}return kt=Gt,Mt},k:function(){var Mt=wn;if(!Mt)return kt=0;var Vt=new bn(Mt);Vt.Fb(Mt);var Gt=Vt.Eb();if(!Gt)return kt=0,Mt;for(var Zt=Array.prototype.slice.call(arguments),nn=0;nn<Zt.length;nn++){var on=Zt[nn];if(on===0||on===Gt)break;if(Mn(on,Gt,Vt.zb+16))return kt=on,Mt}return kt=Gt,Mt},g:function(){var Mt=wn;if(!Mt)return kt=0;var Vt=new bn(Mt);Vt.Fb(Mt);var Gt=Vt.Eb();if(!Gt)return kt=0,Mt;for(var Zt=Array.prototype.slice.call(arguments),nn=0;nn<Zt.length;nn++){var on=Zt[nn];if(on===0||on===Gt)break;if(Mn(on,Gt,Vt.zb+16))return kt=on,Mt}return kt=Gt,Mt},s:Dn,L:function(){var Mt=xt.pop();Mt||vn("no exception to throw");var Vt=Mt.Db;throw Mt.Lb()||(xt.push(Mt),Mt.Jb(!0),Mt.Ib(!1),Pt++),wn=Vt,Vt},b:function(Mt,Vt,Gt){throw new bn(Mt).Rb(Vt,Gt),wn=Mt,Pt++,Mt},la:function(){return Pt},i:function(Mt){throw wn||(wn=Mt),Mt},H:function(){return 0},Ba:function(){},pa:function(){},ra:function(){},ka:function(){return 0},za:function(){},ua:function(){},ya:function(){},R:function(){},qa:function(){},na:function(){},Aa:function(){},oa:function(){},Ha:function(){},Ja:function(){vn("To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking")},Ia:function(){vn("To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking")},S:function(){return Date.now()},Ca:function(){return!0},Da:function(Mt,Vt){Mt=new Date(1e3*($t[Mt>>>2]+4294967296*vt[Mt+4>>>2])),vt[Vt>>2>>>0]=Mt.getUTCSeconds(),vt[Vt+4>>2>>>0]=Mt.getUTCMinutes(),vt[Vt+8>>2>>>0]=Mt.getUTCHours(),vt[Vt+12>>2>>>0]=Mt.getUTCDate(),vt[Vt+16>>2>>>0]=Mt.getUTCMonth(),vt[Vt+20>>2>>>0]=Mt.getUTCFullYear()-1900,vt[Vt+24>>2>>>0]=Mt.getUTCDay(),vt[Vt+28>>2>>>0]=(Mt.getTime()-Date.UTC(Mt.getUTCFullYear(),0,1,0,0,0,0))/864e5|0},Ea:function(Mt,Vt){Mt=new Date(1e3*($t[Mt>>>2]+4294967296*vt[Mt+4>>>2])),vt[Vt>>2>>>0]=Mt.getSeconds(),vt[Vt+4>>2>>>0]=Mt.getMinutes(),vt[Vt+8>>2>>>0]=Mt.getHours(),vt[Vt+12>>2>>>0]=Mt.getDate(),vt[Vt+16>>2>>>0]=Mt.getMonth(),vt[Vt+20>>2>>>0]=Mt.getFullYear()-1900,vt[Vt+24>>2>>>0]=Mt.getDay();var Gt=new Date(Mt.getFullYear(),0,1);vt[Vt+28>>2>>>0]=(Mt.getTime()-Gt.getTime())/864e5|0,vt[Vt+36>>2>>>0]=-60*Mt.getTimezoneOffset();var Zt=new Date(Mt.getFullYear(),6,1).getTimezoneOffset();Gt=Gt.getTimezoneOffset(),vt[Vt+32>>2>>>0]=0|(Zt!=Gt&&Mt.getTimezoneOffset()==Math.min(Gt,Zt))},Fa:function(Mt){var Vt=new Date(vt[Mt+20>>2>>>0]+1900,vt[Mt+16>>2>>>0],vt[Mt+12>>2>>>0],vt[Mt+8>>2>>>0],vt[Mt+4>>2>>>0],vt[Mt>>2>>>0],0),Gt=vt[Mt+32>>2>>>0],Zt=Vt.getTimezoneOffset(),nn=new Date(Vt.getFullYear(),0,1),on=new Date(Vt.getFullYear(),6,1).getTimezoneOffset(),xn=nn.getTimezoneOffset(),Cn=Math.min(xn,on);return 0>Gt?vt[Mt+32>>2>>>0]=+(on!=xn&&Cn==Zt):0<Gt!=(Cn==Zt)&&(on=Math.max(xn,on),Vt.setTime(Vt.getTime()+6e4*((0<Gt?Cn:on)-Zt))),vt[Mt+24>>2>>>0]=Vt.getDay(),vt[Mt+28>>2>>>0]=(Vt.getTime()-nn.getTime())/864e5|0,vt[Mt>>2>>>0]=Vt.getSeconds(),vt[Mt+4>>2>>>0]=Vt.getMinutes(),vt[Mt+8>>2>>>0]=Vt.getHours(),vt[Mt+12>>2>>>0]=Vt.getDate(),vt[Mt+16>>2>>>0]=Vt.getMonth(),Vt.getTime()/1e3|0},sa:function(){return-52},ta:function(){},Ga:function Mt(Vt,Gt,Zt){Mt.Vb||(Mt.Vb=!0,function(nn,on,xn){function Cn(Er){return(Er=Er.toTimeString().match(/\(([A-Za-z ]+)\)$/))?Er[1]:"GMT"}var $n=new Date().getFullYear(),Vn=new Date($n,0,1),Jn=new Date($n,6,1);$n=Vn.getTimezoneOffset();var Tr=Jn.getTimezoneOffset();vt[nn>>2>>>0]=60*Math.max($n,Tr),vt[on>>2>>>0]=+($n!=Tr),nn=Cn(Vn),on=Cn(Jn),nn=On(nn),on=On(on),Tr<$n?($t[xn>>2>>>0]=nn,$t[xn+4>>2>>>0]=on):($t[xn>>2>>>0]=on,$t[xn+4>>2>>>0]=nn)}(Vt,Gt,Zt))},B:function(){vn("")},ma:function(){return 4294901760},I:at?()=>{var Mt=process.hrtime();return 1e3*Mt[0]+Mt[1]/1e6}:()=>performance.now(),xa:function(Mt,Vt,Gt){Tt.copyWithin(Mt>>>0,Vt>>>0,Vt+Gt>>>0)},G:function(Mt){var Vt=Tt.length;if(4294901760<(Mt>>>=0))return!1;for(var Gt=1;4>=Gt;Gt*=2){var Zt=Vt*(1+.2/Gt);Zt=Math.min(Zt,Mt+100663296);var nn=Math;Zt=Math.max(Mt,Zt),nn=nn.min.call(nn,4294901760,Zt+(65536-Zt%65536)%65536);e:{try{yt.grow(nn-St.byteLength+65535>>>16),gt();var on=1;break e}catch{}on=void 0}if(on)return!0}return!1},va:function(Mt,Vt){var Gt=0;return Nn().forEach(function(Zt,nn){var on=Vt+Gt;for(nn=$t[Mt+4*nn>>2>>>0]=on,on=0;on<Zt.length;++on)bt[nn++>>0>>>0]=Zt.charCodeAt(on);bt[nn>>0>>>0]=0,Gt+=Zt.length+1}),0},wa:function(Mt,Vt){var Gt=Nn();$t[Mt>>2>>>0]=Gt.length;var Zt=0;return Gt.forEach(function(nn){Zt+=nn.length+1}),$t[Vt>>2>>>0]=Zt,0},ba:function(Mt){dt||0<Nt||(en(),wr(Ct),sn(0),qn[1].length&&gr(1,10),qn[2].length&&gr(2,10)),dt||0<Nt||(_.onExit&&_.onExit(Mt),At=!0),tt(Mt,new Gn(Mt))},E:function(){return 52},Q:function(){return 52},ca:function(){return 70},P:function(Mt,Vt,Gt,Zt){for(var nn=0,on=0;on<Gt;on++){var xn=$t[Vt>>2>>>0],Cn=$t[Vt+4>>2>>>0];Vt+=8;for(var $n=0;$n<Cn;$n++)gr(Mt,Tt[xn+$n>>>0]);nn+=Cn}return $t[Zt>>2>>>0]=nn,0},c:function(){return kt},ja:function Mt(Vt,Gt){Mt.Mb||(Mt.Mb=function(){if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function"){var nn=new Uint8Array(1);return()=>(crypto.getRandomValues(nn),nn[0])}if(at)try{var on=s(Object(function(){var xn=new Error("Cannot find module 'crypto'");throw xn.code="MODULE_NOT_FOUND",xn}()));return()=>on.randomBytes(1)[0]}catch{}return()=>vn("randomDevice")}());for(var Zt=0;Zt<Gt;Zt++)bt[Vt+Zt>>0>>>0]=Mt.Mb();return 0},ea:function(Mt,Vt,Gt){var Zt=ln();try{return _n(Mt)(Vt,Gt)}catch(nn){if(gn(Zt),nn!==nn+0)throw nn;Qt(1,0)}},fa:function(Mt,Vt,Gt){var Zt=ln();try{return _n(Mt)(Vt,Gt)}catch(nn){if(gn(Zt),nn!==nn+0)throw nn;Qt(1,0)}},J:function(Mt){var Vt=ln();try{return _n(Mt)()}catch(Gt){if(gn(Vt),Gt!==Gt+0)throw Gt;Qt(1,0)}},e:function(Mt,Vt){var Gt=ln();try{return _n(Mt)(Vt)}catch(Zt){if(gn(Gt),Zt!==Zt+0)throw Zt;Qt(1,0)}},N:function(Mt,Vt,Gt){var Zt=ln();try{return _n(Mt)(Vt,Gt)}catch(nn){if(gn(Zt),nn!==nn+0)throw nn;Qt(1,0)}},O:function(Mt,Vt,Gt){var Zt=ln();try{return _n(Mt)(Vt,Gt)}catch(nn){if(gn(Zt),nn!==nn+0)throw nn;Qt(1,0)}},j:function(Mt,Vt,Gt){var Zt=ln();try{return _n(Mt)(Vt,Gt)}catch(nn){if(gn(Zt),nn!==nn+0)throw nn;Qt(1,0)}},o:function(Mt,Vt,Gt,Zt){var nn=ln();try{return _n(Mt)(Vt,Gt,Zt)}catch(on){if(gn(nn),on!==on+0)throw on;Qt(1,0)}},p:function(Mt,Vt,Gt,Zt,nn){var on=ln();try{return _n(Mt)(Vt,Gt,Zt,nn)}catch(xn){if(gn(on),xn!==xn+0)throw xn;Qt(1,0)}},M:function(Mt,Vt,Gt,Zt,nn,on){var xn=ln();try{return _n(Mt)(Vt,Gt,Zt,nn,on)}catch(Cn){if(gn(xn),Cn!==Cn+0)throw Cn;Qt(1,0)}},r:function(Mt,Vt,Gt,Zt,nn,on){var xn=ln();try{return _n(Mt)(Vt,Gt,Zt,nn,on)}catch(Cn){if(gn(xn),Cn!==Cn+0)throw Cn;Qt(1,0)}},v:function(Mt,Vt,Gt,Zt,nn,on,xn){var Cn=ln();try{return _n(Mt)(Vt,Gt,Zt,nn,on,xn)}catch($n){if(gn(Cn),$n!==$n+0)throw $n;Qt(1,0)}},K:function(Mt,Vt,Gt,Zt,nn,on,xn,Cn){var $n=ln();try{return _n(Mt)(Vt,Gt,Zt,nn,on,xn,Cn)}catch(Vn){if(gn($n),Vn!==Vn+0)throw Vn;Qt(1,0)}},D:function(Mt,Vt,Gt,Zt,nn,on,xn,Cn,$n,Vn,Jn,Tr){var Er=ln();try{return _n(Mt)(Vt,Gt,Zt,nn,on,xn,Cn,$n,Vn,Jn,Tr)}catch(an){if(gn(Er),an!==an+0)throw an;Qt(1,0)}},X:function(Mt,Vt,Gt,Zt,nn,on,xn,Cn){var $n=ln();try{return Bn(Mt,Vt,Gt,Zt,nn,on,xn,Cn)}catch(Vn){if(gn($n),Vn!==Vn+0)throw Vn;Qt(1,0)}},V:function(Mt,Vt,Gt,Zt,nn,on,xn){var Cn=ln();try{return zn(Mt,Vt,Gt,Zt,nn,on,xn)}catch($n){if(gn(Cn),$n!==$n+0)throw $n;Qt(1,0)}},U:function(Mt,Vt,Gt,Zt,nn){var on=ln();try{return Hn(Mt,Vt,Gt,Zt,nn)}catch(xn){if(gn(on),xn!==xn+0)throw xn;Qt(1,0)}},Z:function(Mt,Vt,Gt,Zt){var nn=ln();try{return pr(Mt,Vt,Gt,Zt)}catch(on){if(gn(nn),on!==on+0)throw on;Qt(1,0)}},W:function(Mt){var Vt=ln();try{return kn(Mt)}catch(Gt){if(gn(Vt),Gt!==Gt+0)throw Gt;Qt(1,0)}},Y:function(Mt,Vt){var Gt=ln();try{return En(Mt,Vt)}catch(Zt){if(gn(Gt),Zt!==Zt+0)throw Zt;Qt(1,0)}},T:function(Mt,Vt,Gt){var Zt=ln();try{return pn(Mt,Vt,Gt)}catch(nn){if(gn(Zt),nn!==nn+0)throw nn;Qt(1,0)}},f:function(Mt){var Vt=ln();try{_n(Mt)()}catch(Gt){if(gn(Vt),Gt!==Gt+0)throw Gt;Qt(1,0)}},q:function(Mt,Vt){var Gt=ln();try{_n(Mt)(Vt)}catch(Zt){if(gn(Gt),Zt!==Zt+0)throw Zt;Qt(1,0)}},h:function(Mt,Vt,Gt){var Zt=ln();try{_n(Mt)(Vt,Gt)}catch(nn){if(gn(Zt),nn!==nn+0)throw nn;Qt(1,0)}},da:function(Mt,Vt,Gt,Zt){var nn=ln();try{_n(Mt)(Vt,Gt,Zt)}catch(on){if(gn(nn),on!==on+0)throw on;Qt(1,0)}},l:function(Mt,Vt,Gt,Zt){var nn=ln();try{_n(Mt)(Vt,Gt,Zt)}catch(on){if(gn(nn),on!==on+0)throw on;Qt(1,0)}},t:function(Mt,Vt,Gt,Zt,nn){var on=ln();try{_n(Mt)(Vt,Gt,Zt,nn)}catch(xn){if(gn(on),xn!==xn+0)throw xn;Qt(1,0)}},u:function(Mt,Vt,Gt,Zt,nn,on){var xn=ln();try{_n(Mt)(Vt,Gt,Zt,nn,on)}catch(Cn){if(gn(xn),Cn!==Cn+0)throw Cn;Qt(1,0)}},x:function(Mt,Vt,Gt,Zt,nn,on,xn){var Cn=ln();try{_n(Mt)(Vt,Gt,Zt,nn,on,xn)}catch($n){if(gn(Cn),$n!==$n+0)throw $n;Qt(1,0)}},z:function(Mt,Vt,Gt,Zt,nn,on,xn,Cn){var $n=ln();try{_n(Mt)(Vt,Gt,Zt,nn,on,xn,Cn)}catch(Vn){if(gn($n),Vn!==Vn+0)throw Vn;Qt(1,0)}},ga:function(Mt,Vt,Gt,Zt,nn,on,xn,Cn,$n){var Vn=ln();try{_n(Mt)(Vt,Gt,Zt,nn,on,xn,Cn,$n)}catch(Jn){if(gn(Vn),Jn!==Jn+0)throw Jn;Qt(1,0)}},A:function(Mt,Vt,Gt,Zt,nn,on,xn,Cn,$n,Vn,Jn){var Tr=ln();try{_n(Mt)(Vt,Gt,Zt,nn,on,xn,Cn,$n,Vn,Jn)}catch(Er){if(gn(Tr),Er!==Er+0)throw Er;Qt(1,0)}},C:function(Mt,Vt,Gt,Zt,nn,on,xn,Cn,$n,Vn,Jn,Tr,Er,an,Xn,Un){var kr=ln();try{_n(Mt)(Vt,Gt,Zt,nn,on,xn,Cn,$n,Vn,Jn,Tr,Er,an,Xn,Un)}catch(Ir){if(gn(kr),Ir!==Ir+0)throw Ir;Qt(1,0)}},aa:function(Mt,Vt,Gt,Zt,nn,on,xn,Cn){var $n=ln();try{In(Mt,Vt,Gt,Zt,nn,on,xn,Cn)}catch(Vn){if(gn($n),Vn!==Vn+0)throw Vn;Qt(1,0)}},_:function(Mt,Vt,Gt,Zt,nn,on,xn,Cn,$n,Vn,Jn,Tr){var Er=ln();try{jn(Mt,Vt,Gt,Zt,nn,on,xn,Cn,$n,Vn,Jn,Tr)}catch(an){if(gn(Er),an!==an+0)throw an;Qt(1,0)}},$:function(Mt,Vt,Gt,Zt,nn,on){var xn=ln();try{hn(Mt,Vt,Gt,Zt,nn,on)}catch(Cn){if(gn(xn),Cn!==Cn+0)throw Cn;Qt(1,0)}},n:function(Mt){return Mt},F:function(Mt){kt=Mt},ha:Kt,y:function(Mt,Vt,Gt,Zt){return Kt(Mt,Vt,Gt,Zt)}};(function(){function Mt(nn){_.asm=nn.exports,yt=_.asm.Ka,gt(),ht=_.asm.ib,_t.unshift(_.asm.La),un--,_.monitorRunDependencies&&_.monitorRunDependencies(un),un==0&&yn&&(nn=yn,yn=null,nn())}function Vt(nn){Mt(nn.instance)}function Gt(nn){return function(){if(!lt&&(ot||it)){if(typeof fetch=="function"&&!Jt.startsWith("file://"))return fetch(Jt,{credentials:"same-origin"}).then(function(on){if(!on.ok)throw"failed to load wasm binary file at '"+Jt+"'";return on.arrayBuffer()}).catch(function(){return Pn()});if(b)return new Promise(function(on,xn){b(Jt,function(Cn){on(new Uint8Array(Cn))},xn)})}return Promise.resolve().then(function(){return Pn()})}().then(function(on){return WebAssembly.instantiate(on,Zt)}).then(function(on){return on}).then(nn,function(on){ft("failed to asynchronously prepare wasm: "+on),vn(on)})}var Zt={a:Ft};if(un++,_.monitorRunDependencies&&_.monitorRunDependencies(un),_.instantiateWasm)try{return _.instantiateWasm(Zt,Mt)}catch(nn){return ft("Module.instantiateWasm callback failed with error: "+nn),!1}(lt||typeof WebAssembly.instantiateStreaming!="function"||mn()||Jt.startsWith("file://")||at||typeof fetch!="function"?Gt(Vt):fetch(Jt,{credentials:"same-origin"}).then(function(nn){return WebAssembly.instantiateStreaming(nn,Zt).then(Vt,function(on){return ft("wasm streaming compile failed: "+on),ft("falling back to ArrayBuffer instantiation"),Gt(Vt)})})).catch(nt)})(),_.___wasm_call_ctors=function(){return(_.___wasm_call_ctors=_.asm.La).apply(null,arguments)},_._OrtInit=function(){return(_._OrtInit=_.asm.Ma).apply(null,arguments)},_._OrtCreateSessionOptions=function(){return(_._OrtCreateSessionOptions=_.asm.Na).apply(null,arguments)},_._OrtAppendExecutionProvider=function(){return(_._OrtAppendExecutionProvider=_.asm.Oa).apply(null,arguments)},_._OrtAddSessionConfigEntry=function(){return(_._OrtAddSessionConfigEntry=_.asm.Pa).apply(null,arguments)},_._OrtReleaseSessionOptions=function(){return(_._OrtReleaseSessionOptions=_.asm.Qa).apply(null,arguments)},_._OrtCreateSession=function(){return(_._OrtCreateSession=_.asm.Ra).apply(null,arguments)},_._OrtReleaseSession=function(){return(_._OrtReleaseSession=_.asm.Sa).apply(null,arguments)},_._OrtGetInputCount=function(){return(_._OrtGetInputCount=_.asm.Ta).apply(null,arguments)},_._OrtGetOutputCount=function(){return(_._OrtGetOutputCount=_.asm.Ua).apply(null,arguments)},_._OrtGetInputName=function(){return(_._OrtGetInputName=_.asm.Va).apply(null,arguments)},_._OrtGetOutputName=function(){return(_._OrtGetOutputName=_.asm.Wa).apply(null,arguments)},_._OrtFree=function(){return(_._OrtFree=_.asm.Xa).apply(null,arguments)},_._OrtCreateTensor=function(){return(_._OrtCreateTensor=_.asm.Ya).apply(null,arguments)},_._OrtGetTensorData=function(){return(_._OrtGetTensorData=_.asm.Za).apply(null,arguments)},_._OrtReleaseTensor=function(){return(_._OrtReleaseTensor=_.asm._a).apply(null,arguments)},_._OrtCreateRunOptions=function(){return(_._OrtCreateRunOptions=_.asm.$a).apply(null,arguments)},_._OrtAddRunConfigEntry=function(){return(_._OrtAddRunConfigEntry=_.asm.ab).apply(null,arguments)},_._OrtReleaseRunOptions=function(){return(_._OrtReleaseRunOptions=_.asm.bb).apply(null,arguments)},_._OrtRun=function(){return(_._OrtRun=_.asm.cb).apply(null,arguments)},_._OrtEndProfiling=function(){return(_._OrtEndProfiling=_.asm.db).apply(null,arguments)};var Yt,Wt=_._malloc=function(){return(Wt=_._malloc=_.asm.eb).apply(null,arguments)},Xt=_._free=function(){return(Xt=_._free=_.asm.fb).apply(null,arguments)},sn=_._fflush=function(){return(sn=_._fflush=_.asm.gb).apply(null,arguments)},en=_.___funcs_on_exit=function(){return(en=_.___funcs_on_exit=_.asm.hb).apply(null,arguments)},Qt=_._setThrew=function(){return(Qt=_._setThrew=_.asm.jb).apply(null,arguments)},ln=_.stackSave=function(){return(ln=_.stackSave=_.asm.kb).apply(null,arguments)},gn=_.stackRestore=function(){return(gn=_.stackRestore=_.asm.lb).apply(null,arguments)},dn=_.stackAlloc=function(){return(dn=_.stackAlloc=_.asm.mb).apply(null,arguments)},Mn=_.___cxa_can_catch=function(){return(Mn=_.___cxa_can_catch=_.asm.nb).apply(null,arguments)},rn=_.___cxa_is_pointer_type=function(){return(rn=_.___cxa_is_pointer_type=_.asm.ob).apply(null,arguments)},kn=_.dynCall_j=function(){return(kn=_.dynCall_j=_.asm.pb).apply(null,arguments)},zn=_.dynCall_iiiiij=function(){return(zn=_.dynCall_iiiiij=_.asm.qb).apply(null,arguments)},pn=_.dynCall_jii=function(){return(pn=_.dynCall_jii=_.asm.rb).apply(null,arguments)},In=_.dynCall_viiiiij=function(){return(In=_.dynCall_viiiiij=_.asm.sb).apply(null,arguments)},hn=_.dynCall_vjji=function(){return(hn=_.dynCall_vjji=_.asm.tb).apply(null,arguments)},jn=_.dynCall_viiijjjii=function(){return(jn=_.dynCall_viiijjjii=_.asm.ub).apply(null,arguments)},pr=_.dynCall_iij=function(){return(pr=_.dynCall_iij=_.asm.vb).apply(null,arguments)},En=_.dynCall_ji=function(){return(En=_.dynCall_ji=_.asm.wb).apply(null,arguments)},Bn=_.dynCall_iiiiiij=function(){return(Bn=_.dynCall_iiiiiij=_.asm.xb).apply(null,arguments)},Hn=_.dynCall_iiij=function(){return(Hn=_.dynCall_iiij=_.asm.yb).apply(null,arguments)};function yr(){function Mt(){if(!Yt&&(Yt=!0,_.calledRun=!0,!At)){if(wr(_t),j(_),_.onRuntimeInitialized&&_.onRuntimeInitialized(),_.postRun)for(typeof _.postRun=="function"&&(_.postRun=[_.postRun]);_.postRun.length;){var Vt=_.postRun.shift();zt.unshift(Vt)}wr(zt)}}if(!(0<un)){if(_.preRun)for(typeof _.preRun=="function"&&(_.preRun=[_.preRun]);_.preRun.length;)Ht();wr(pt),0<un||(_.setStatus?(_.setStatus("Running..."),setTimeout(function(){setTimeout(function(){_.setStatus("")},1),Mt()},1)):Mt())}}if(_.UTF8ToString=jt,_.stringToUTF8=function(Mt,Vt,Gt){return Et(Mt,Tt,Vt,Gt)},_.lengthBytesUTF8=mt,_.stackSave=ln,_.stackRestore=gn,_.stackAlloc=dn,yn=function Mt(){Yt||yr(),Yt||(yn=Mt)},_.preInit)for(typeof _.preInit=="function"&&(_.preInit=[_.preInit]);0<_.preInit.length;)_.preInit.pop()();return yr(),$.ready});i.exports=h},4537:i=>{i.exports=function(e,s){for(var c=new Array(arguments.length-1),h=0,$=2,_=!0;$<arguments.length;)c[h++]=arguments[$++];return new Promise(function(j,nt){c[h]=function(et){if(_)if(_=!1,et)nt(et);else{for(var b=new Array(arguments.length-1),a=0;a<b.length;)b[a++]=arguments[a];j.apply(null,b)}};try{e.apply(s||null,c)}catch(et){_&&(_=!1,nt(et))}})}},7419:(i,e)=>{var s=e;s.length=function(j){var nt=j.length;if(!nt)return 0;for(var et=0;--nt%4>1&&j.charAt(nt)==="=";)++et;return Math.ceil(3*j.length)/4-et};for(var c=new Array(64),h=new Array(123),$=0;$<64;)h[c[$]=$<26?$+65:$<52?$+71:$<62?$-4:$-59|43]=$++;s.encode=function(j,nt,et){for(var b,a=null,o=[],d=0,g=0;nt<et;){var rt=j[nt++];switch(g){case 0:o[d++]=c[rt>>2],b=(3&rt)<<4,g=1;break;case 1:o[d++]=c[b|rt>>4],b=(15&rt)<<2,g=2;break;case 2:o[d++]=c[b|rt>>6],o[d++]=c[63&rt],g=0}d>8191&&((a||(a=[])).push(String.fromCharCode.apply(String,o)),d=0)}return g&&(o[d++]=c[b],o[d++]=61,g===1&&(o[d++]=61)),a?(d&&a.push(String.fromCharCode.apply(String,o.slice(0,d))),a.join("")):String.fromCharCode.apply(String,o.slice(0,d))};var _="invalid encoding";s.decode=function(j,nt,et){for(var b,a=et,o=0,d=0;d<j.length;){var g=j.charCodeAt(d++);if(g===61&&o>1)break;if((g=h[g])===void 0)throw Error(_);switch(o){case 0:b=g,o=1;break;case 1:nt[et++]=b<<2|(48&g)>>4,b=g,o=2;break;case 2:nt[et++]=(15&b)<<4|(60&g)>>2,b=g,o=3;break;case 3:nt[et++]=(3&b)<<6|g,o=0}}if(o===1)throw Error(_);return et-a},s.test=function(j){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(j)}},9211:i=>{function e(){this._listeners={}}i.exports=e,e.prototype.on=function(s,c,h){return(this._listeners[s]||(this._listeners[s]=[])).push({fn:c,ctx:h||this}),this},e.prototype.off=function(s,c){if(s===void 0)this._listeners={};else if(c===void 0)this._listeners[s]=[];else for(var h=this._listeners[s],$=0;$<h.length;)h[$].fn===c?h.splice($,1):++$;return this},e.prototype.emit=function(s){var c=this._listeners[s];if(c){for(var h=[],$=1;$<arguments.length;)h.push(arguments[$++]);for($=0;$<c.length;)c[$].fn.apply(c[$++].ctx,h)}return this}},945:i=>{function e(_){return typeof Float32Array<"u"?function(){var j=new Float32Array([-0]),nt=new Uint8Array(j.buffer),et=nt[3]===128;function b(g,rt,st){j[0]=g,rt[st]=nt[0],rt[st+1]=nt[1],rt[st+2]=nt[2],rt[st+3]=nt[3]}function a(g,rt,st){j[0]=g,rt[st]=nt[3],rt[st+1]=nt[2],rt[st+2]=nt[1],rt[st+3]=nt[0]}function o(g,rt){return nt[0]=g[rt],nt[1]=g[rt+1],nt[2]=g[rt+2],nt[3]=g[rt+3],j[0]}function d(g,rt){return nt[3]=g[rt],nt[2]=g[rt+1],nt[1]=g[rt+2],nt[0]=g[rt+3],j[0]}_.writeFloatLE=et?b:a,_.writeFloatBE=et?a:b,_.readFloatLE=et?o:d,_.readFloatBE=et?d:o}():function(){function j(et,b,a,o){var d=b<0?1:0;if(d&&(b=-b),b===0)et(1/b>0?0:2147483648,a,o);else if(isNaN(b))et(2143289344,a,o);else if(b>34028234663852886e22)et((d<<31|2139095040)>>>0,a,o);else if(b<11754943508222875e-54)et((d<<31|Math.round(b/1401298464324817e-60))>>>0,a,o);else{var g=Math.floor(Math.log(b)/Math.LN2);et((d<<31|g+127<<23|8388607&Math.round(b*Math.pow(2,-g)*8388608))>>>0,a,o)}}function nt(et,b,a){var o=et(b,a),d=2*(o>>31)+1,g=o>>>23&255,rt=8388607&o;return g===255?rt?NaN:d*(1/0):g===0?1401298464324817e-60*d*rt:d*Math.pow(2,g-150)*(rt+8388608)}_.writeFloatLE=j.bind(null,s),_.writeFloatBE=j.bind(null,c),_.readFloatLE=nt.bind(null,h),_.readFloatBE=nt.bind(null,$)}(),typeof Float64Array<"u"?function(){var j=new Float64Array([-0]),nt=new Uint8Array(j.buffer),et=nt[7]===128;function b(g,rt,st){j[0]=g,rt[st]=nt[0],rt[st+1]=nt[1],rt[st+2]=nt[2],rt[st+3]=nt[3],rt[st+4]=nt[4],rt[st+5]=nt[5],rt[st+6]=nt[6],rt[st+7]=nt[7]}function a(g,rt,st){j[0]=g,rt[st]=nt[7],rt[st+1]=nt[6],rt[st+2]=nt[5],rt[st+3]=nt[4],rt[st+4]=nt[3],rt[st+5]=nt[2],rt[st+6]=nt[1],rt[st+7]=nt[0]}function o(g,rt){return nt[0]=g[rt],nt[1]=g[rt+1],nt[2]=g[rt+2],nt[3]=g[rt+3],nt[4]=g[rt+4],nt[5]=g[rt+5],nt[6]=g[rt+6],nt[7]=g[rt+7],j[0]}function d(g,rt){return nt[7]=g[rt],nt[6]=g[rt+1],nt[5]=g[rt+2],nt[4]=g[rt+3],nt[3]=g[rt+4],nt[2]=g[rt+5],nt[1]=g[rt+6],nt[0]=g[rt+7],j[0]}_.writeDoubleLE=et?b:a,_.writeDoubleBE=et?a:b,_.readDoubleLE=et?o:d,_.readDoubleBE=et?d:o}():function(){function j(et,b,a,o,d,g){var rt=o<0?1:0;if(rt&&(o=-o),o===0)et(0,d,g+b),et(1/o>0?0:2147483648,d,g+a);else if(isNaN(o))et(0,d,g+b),et(2146959360,d,g+a);else if(o>17976931348623157e292)et(0,d,g+b),et((rt<<31|2146435072)>>>0,d,g+a);else{var st;if(o<22250738585072014e-324)et((st=o/5e-324)>>>0,d,g+b),et((rt<<31|st/4294967296)>>>0,d,g+a);else{var tt=Math.floor(Math.log(o)/Math.LN2);tt===1024&&(tt=1023),et(4503599627370496*(st=o*Math.pow(2,-tt))>>>0,d,g+b),et((rt<<31|tt+1023<<20|1048576*st&1048575)>>>0,d,g+a)}}}function nt(et,b,a,o,d){var g=et(o,d+b),rt=et(o,d+a),st=2*(rt>>31)+1,tt=rt>>>20&2047,ot=4294967296*(1048575&rt)+g;return tt===2047?ot?NaN:st*(1/0):tt===0?5e-324*st*ot:st*Math.pow(2,tt-1075)*(ot+4503599627370496)}_.writeDoubleLE=j.bind(null,s,0,4),_.writeDoubleBE=j.bind(null,c,4,0),_.readDoubleLE=nt.bind(null,h,0,4),_.readDoubleBE=nt.bind(null,$,4,0)}(),_}function s(_,j,nt){j[nt]=255&_,j[nt+1]=_>>>8&255,j[nt+2]=_>>>16&255,j[nt+3]=_>>>24}function c(_,j,nt){j[nt]=_>>>24,j[nt+1]=_>>>16&255,j[nt+2]=_>>>8&255,j[nt+3]=255&_}function h(_,j){return(_[j]|_[j+1]<<8|_[j+2]<<16|_[j+3]<<24)>>>0}function $(_,j){return(_[j]<<24|_[j+1]<<16|_[j+2]<<8|_[j+3])>>>0}i.exports=e(e)},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(e,s,c){var h=c||8192,$=h>>>1,_=null,j=h;return function(nt){if(nt<1||nt>$)return e(nt);j+nt>h&&(_=e(h),j=0);var et=s.call(_,j,j+=nt);return 7&j&&(j=1+(7|j)),et}}},4997:(i,e)=>{var s=e;s.length=function(c){for(var h=0,$=0,_=0;_<c.length;++_)($=c.charCodeAt(_))<128?h+=1:$<2048?h+=2:(64512&$)==55296&&(64512&c.charCodeAt(_+1))==56320?(++_,h+=4):h+=3;return h},s.read=function(c,h,$){if($-h<1)return"";for(var _,j=null,nt=[],et=0;h<$;)(_=c[h++])<128?nt[et++]=_:_>191&&_<224?nt[et++]=(31&_)<<6|63&c[h++]:_>239&&_<365?(_=((7&_)<<18|(63&c[h++])<<12|(63&c[h++])<<6|63&c[h++])-65536,nt[et++]=55296+(_>>10),nt[et++]=56320+(1023&_)):nt[et++]=(15&_)<<12|(63&c[h++])<<6|63&c[h++],et>8191&&((j||(j=[])).push(String.fromCharCode.apply(String,nt)),et=0);return j?(et&&j.push(String.fromCharCode.apply(String,nt.slice(0,et))),j.join("")):String.fromCharCode.apply(String,nt.slice(0,et))},s.write=function(c,h,$){for(var _,j,nt=$,et=0;et<c.length;++et)(_=c.charCodeAt(et))<128?h[$++]=_:_<2048?(h[$++]=_>>6|192,h[$++]=63&_|128):(64512&_)==55296&&(64512&(j=c.charCodeAt(et+1)))==56320?(_=65536+((1023&_)<<10)+(1023&j),++et,h[$++]=_>>18|240,h[$++]=_>>12&63|128,h[$++]=_>>6&63|128,h[$++]=63&_|128):(h[$++]=_>>12|224,h[$++]=_>>6&63|128,h[$++]=63&_|128);return $-nt}},3442:(i,e)=>{e.__esModule=!0;var s=function(){function c(h){if(!h)throw new TypeError("Invalid argument; `value` has no value.");this.value=c.EMPTY,h&&c.isGuid(h)&&(this.value=h)}return c.isGuid=function(h){var $=h.toString();return h&&(h instanceof c||c.validator.test($))},c.create=function(){return new c([c.gen(2),c.gen(1),c.gen(1),c.gen(1),c.gen(3)].join("-"))},c.createEmpty=function(){return new c("emptyguid")},c.parse=function(h){return new c(h)},c.raw=function(){return[c.gen(2),c.gen(1),c.gen(1),c.gen(1),c.gen(3)].join("-")},c.gen=function(h){for(var $="",_=0;_<h;_++)$+=(65536*(1+Math.random())|0).toString(16).substring(1);return $},c.prototype.equals=function(h){return c.isGuid(h)&&this.value===h.toString()},c.prototype.isEmpty=function(){return this.value===c.EMPTY},c.prototype.toString=function(){return this.value},c.prototype.toJSON=function(){return{value:this.value}},c.validator=new RegExp("^[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}$","i"),c.EMPTY="00000000-0000-0000-0000-000000000000",c}();e.Guid=s},3720:i=>{i.exports=s;var e=null;try{e=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(dt,yt,St){this.low=0|dt,this.high=0|yt,this.unsigned=!!St}function c(dt){return(dt&&dt.__isLong__)===!0}s.prototype.__isLong__,Object.defineProperty(s.prototype,"__isLong__",{value:!0}),s.isLong=c;var h={},$={};function _(dt,yt){var St,bt,Tt;return yt?(Tt=0<=(dt>>>=0)&&dt<256)&&(bt=$[dt])?bt:(St=nt(dt,(0|dt)<0?-1:0,!0),Tt&&($[dt]=St),St):(Tt=-128<=(dt|=0)&&dt<128)&&(bt=h[dt])?bt:(St=nt(dt,dt<0?-1:0,!1),Tt&&(h[dt]=St),St)}function j(dt,yt){if(isNaN(dt))return yt?tt:st;if(yt){if(dt<0)return tt;if(dt>=d)return lt}else{if(dt<=-g)return ct;if(dt+1>=g)return ut}return dt<0?j(-dt,yt).neg():nt(dt%o|0,dt/o|0,yt)}function nt(dt,yt,St){return new s(dt,yt,St)}s.fromInt=_,s.fromNumber=j,s.fromBits=nt;var et=Math.pow;function b(dt,yt,St){if(dt.length===0)throw Error("empty string");if(dt==="NaN"||dt==="Infinity"||dt==="+Infinity"||dt==="-Infinity")return st;if(typeof yt=="number"?(St=yt,yt=!1):yt=!!yt,(St=St||10)<2||36<St)throw RangeError("radix");var bt;if((bt=dt.indexOf("-"))>0)throw Error("interior hyphen");if(bt===0)return b(dt.substring(1),yt,St).neg();for(var Tt=j(et(St,8)),vt=st,$t=0;$t<dt.length;$t+=8){var At=Math.min(8,dt.length-$t),Ot=parseInt(dt.substring($t,$t+At),St);if(At<8){var It=j(et(St,At));vt=vt.mul(It).add(j(Ot))}else vt=(vt=vt.mul(Tt)).add(j(Ot))}return vt.unsigned=yt,vt}function a(dt,yt){return typeof dt=="number"?j(dt,yt):typeof dt=="string"?b(dt,yt):nt(dt.low,dt.high,typeof yt=="boolean"?yt:dt.unsigned)}s.fromString=b,s.fromValue=a;var o=4294967296,d=o*o,g=d/2,rt=_(1<<24),st=_(0);s.ZERO=st;var tt=_(0,!0);s.UZERO=tt;var ot=_(1);s.ONE=ot;var it=_(1,!0);s.UONE=it;var at=_(-1);s.NEG_ONE=at;var ut=nt(-1,2147483647,!1);s.MAX_VALUE=ut;var lt=nt(-1,-1,!0);s.MAX_UNSIGNED_VALUE=lt;var ct=nt(0,-2147483648,!1);s.MIN_VALUE=ct;var ft=s.prototype;ft.toInt=function(){return this.unsigned?this.low>>>0:this.low},ft.toNumber=function(){return this.unsigned?(this.high>>>0)*o+(this.low>>>0):this.high*o+(this.low>>>0)},ft.toString=function(dt){if((dt=dt||10)<2||36<dt)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(ct)){var yt=j(dt),St=this.div(yt),bt=St.mul(yt).sub(this);return St.toString(dt)+bt.toInt().toString(dt)}return"-"+this.neg().toString(dt)}for(var Tt=j(et(dt,6),this.unsigned),vt=this,$t="";;){var At=vt.div(Tt),Ot=(vt.sub(At.mul(Tt)).toInt()>>>0).toString(dt);if((vt=At).isZero())return Ot+$t;for(;Ot.length<6;)Ot="0"+Ot;$t=""+Ot+$t}},ft.getHighBits=function(){return this.high},ft.getHighBitsUnsigned=function(){return this.high>>>0},ft.getLowBits=function(){return this.low},ft.getLowBitsUnsigned=function(){return this.low>>>0},ft.getNumBitsAbs=function(){if(this.isNegative())return this.eq(ct)?64:this.neg().getNumBitsAbs();for(var dt=this.high!=0?this.high:this.low,yt=31;yt>0&&!(dt&1<<yt);yt--);return this.high!=0?yt+33:yt+1},ft.isZero=function(){return this.high===0&&this.low===0},ft.eqz=ft.isZero,ft.isNegative=function(){return!this.unsigned&&this.high<0},ft.isPositive=function(){return this.unsigned||this.high>=0},ft.isOdd=function(){return(1&this.low)==1},ft.isEven=function(){return(1&this.low)==0},ft.equals=function(dt){return c(dt)||(dt=a(dt)),(this.unsigned===dt.unsigned||this.high>>>31!=1||dt.high>>>31!=1)&&this.high===dt.high&&this.low===dt.low},ft.eq=ft.equals,ft.notEquals=function(dt){return!this.eq(dt)},ft.neq=ft.notEquals,ft.ne=ft.notEquals,ft.lessThan=function(dt){return this.comp(dt)<0},ft.lt=ft.lessThan,ft.lessThanOrEqual=function(dt){return this.comp(dt)<=0},ft.lte=ft.lessThanOrEqual,ft.le=ft.lessThanOrEqual,ft.greaterThan=function(dt){return this.comp(dt)>0},ft.gt=ft.greaterThan,ft.greaterThanOrEqual=function(dt){return this.comp(dt)>=0},ft.gte=ft.greaterThanOrEqual,ft.ge=ft.greaterThanOrEqual,ft.compare=function(dt){if(c(dt)||(dt=a(dt)),this.eq(dt))return 0;var yt=this.isNegative(),St=dt.isNegative();return yt&&!St?-1:!yt&&St?1:this.unsigned?dt.high>>>0>this.high>>>0||dt.high===this.high&&dt.low>>>0>this.low>>>0?-1:1:this.sub(dt).isNegative()?-1:1},ft.comp=ft.compare,ft.negate=function(){return!this.unsigned&&this.eq(ct)?ct:this.not().add(ot)},ft.neg=ft.negate,ft.add=function(dt){c(dt)||(dt=a(dt));var yt=this.high>>>16,St=65535&this.high,bt=this.low>>>16,Tt=65535&this.low,vt=dt.high>>>16,$t=65535&dt.high,At=dt.low>>>16,Ot=0,It=0,jt=0,Et=0;return jt+=(Et+=Tt+(65535&dt.low))>>>16,It+=(jt+=bt+At)>>>16,Ot+=(It+=St+$t)>>>16,Ot+=yt+vt,nt((jt&=65535)<<16|(Et&=65535),(Ot&=65535)<<16|(It&=65535),this.unsigned)},ft.subtract=function(dt){return c(dt)||(dt=a(dt)),this.add(dt.neg())},ft.sub=ft.subtract,ft.multiply=function(dt){if(this.isZero())return st;if(c(dt)||(dt=a(dt)),e)return nt(e.mul(this.low,this.high,dt.low,dt.high),e.get_high(),this.unsigned);if(dt.isZero())return st;if(this.eq(ct))return dt.isOdd()?ct:st;if(dt.eq(ct))return this.isOdd()?ct:st;if(this.isNegative())return dt.isNegative()?this.neg().mul(dt.neg()):this.neg().mul(dt).neg();if(dt.isNegative())return this.mul(dt.neg()).neg();if(this.lt(rt)&&dt.lt(rt))return j(this.toNumber()*dt.toNumber(),this.unsigned);var yt=this.high>>>16,St=65535&this.high,bt=this.low>>>16,Tt=65535&this.low,vt=dt.high>>>16,$t=65535&dt.high,At=dt.low>>>16,Ot=65535&dt.low,It=0,jt=0,Et=0,mt=0;return Et+=(mt+=Tt*Ot)>>>16,jt+=(Et+=bt*Ot)>>>16,Et&=65535,jt+=(Et+=Tt*At)>>>16,It+=(jt+=St*Ot)>>>16,jt&=65535,It+=(jt+=bt*At)>>>16,jt&=65535,It+=(jt+=Tt*$t)>>>16,It+=yt*Ot+St*At+bt*$t+Tt*vt,nt((Et&=65535)<<16|(mt&=65535),(It&=65535)<<16|(jt&=65535),this.unsigned)},ft.mul=ft.multiply,ft.divide=function(dt){if(c(dt)||(dt=a(dt)),dt.isZero())throw Error("division by zero");var yt,St,bt;if(e)return this.unsigned||this.high!==-2147483648||dt.low!==-1||dt.high!==-1?nt((this.unsigned?e.div_u:e.div_s)(this.low,this.high,dt.low,dt.high),e.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?tt:st;if(this.unsigned){if(dt.unsigned||(dt=dt.toUnsigned()),dt.gt(this))return tt;if(dt.gt(this.shru(1)))return it;bt=tt}else{if(this.eq(ct))return dt.eq(ot)||dt.eq(at)?ct:dt.eq(ct)?ot:(yt=this.shr(1).div(dt).shl(1)).eq(st)?dt.isNegative()?ot:at:(St=this.sub(dt.mul(yt)),bt=yt.add(St.div(dt)));if(dt.eq(ct))return this.unsigned?tt:st;if(this.isNegative())return dt.isNegative()?this.neg().div(dt.neg()):this.neg().div(dt).neg();if(dt.isNegative())return this.div(dt.neg()).neg();bt=st}for(St=this;St.gte(dt);){yt=Math.max(1,Math.floor(St.toNumber()/dt.toNumber()));for(var Tt=Math.ceil(Math.log(yt)/Math.LN2),vt=Tt<=48?1:et(2,Tt-48),$t=j(yt),At=$t.mul(dt);At.isNegative()||At.gt(St);)At=($t=j(yt-=vt,this.unsigned)).mul(dt);$t.isZero()&&($t=ot),bt=bt.add($t),St=St.sub(At)}return bt},ft.div=ft.divide,ft.modulo=function(dt){return c(dt)||(dt=a(dt)),e?nt((this.unsigned?e.rem_u:e.rem_s)(this.low,this.high,dt.low,dt.high),e.get_high(),this.unsigned):this.sub(this.div(dt).mul(dt))},ft.mod=ft.modulo,ft.rem=ft.modulo,ft.not=function(){return nt(~this.low,~this.high,this.unsigned)},ft.and=function(dt){return c(dt)||(dt=a(dt)),nt(this.low&dt.low,this.high&dt.high,this.unsigned)},ft.or=function(dt){return c(dt)||(dt=a(dt)),nt(this.low|dt.low,this.high|dt.high,this.unsigned)},ft.xor=function(dt){return c(dt)||(dt=a(dt)),nt(this.low^dt.low,this.high^dt.high,this.unsigned)},ft.shiftLeft=function(dt){return c(dt)&&(dt=dt.toInt()),(dt&=63)==0?this:dt<32?nt(this.low<<dt,this.high<<dt|this.low>>>32-dt,this.unsigned):nt(0,this.low<<dt-32,this.unsigned)},ft.shl=ft.shiftLeft,ft.shiftRight=function(dt){return c(dt)&&(dt=dt.toInt()),(dt&=63)==0?this:dt<32?nt(this.low>>>dt|this.high<<32-dt,this.high>>dt,this.unsigned):nt(this.high>>dt-32,this.high>=0?0:-1,this.unsigned)},ft.shr=ft.shiftRight,ft.shiftRightUnsigned=function(dt){if(c(dt)&&(dt=dt.toInt()),(dt&=63)==0)return this;var yt=this.high;return dt<32?nt(this.low>>>dt|yt<<32-dt,yt>>>dt,this.unsigned):nt(dt===32?yt:yt>>>dt-32,0,this.unsigned)},ft.shru=ft.shiftRightUnsigned,ft.shr_u=ft.shiftRightUnsigned,ft.toSigned=function(){return this.unsigned?nt(this.low,this.high,!1):this},ft.toUnsigned=function(){return this.unsigned?this:nt(this.low,this.high,!0)},ft.toBytes=function(dt){return dt?this.toBytesLE():this.toBytesBE()},ft.toBytesLE=function(){var dt=this.high,yt=this.low;return[255&yt,yt>>>8&255,yt>>>16&255,yt>>>24,255&dt,dt>>>8&255,dt>>>16&255,dt>>>24]},ft.toBytesBE=function(){var dt=this.high,yt=this.low;return[dt>>>24,dt>>>16&255,dt>>>8&255,255&dt,yt>>>24,yt>>>16&255,yt>>>8&255,255&yt]},s.fromBytes=function(dt,yt,St){return St?s.fromBytesLE(dt,yt):s.fromBytesBE(dt,yt)},s.fromBytesLE=function(dt,yt){return new s(dt[0]|dt[1]<<8|dt[2]<<16|dt[3]<<24,dt[4]|dt[5]<<8|dt[6]<<16|dt[7]<<24,yt)},s.fromBytesBE=function(dt,yt){return new s(dt[4]<<24|dt[5]<<16|dt[6]<<8|dt[7],dt[0]<<24|dt[1]<<16|dt[2]<<8|dt[3],yt)}},1446:(i,e,s)=>{var c,h,$,_=s(2100),j=_.Reader,nt=_.Writer,et=_.util,b=_.roots.default||(_.roots.default={});b.onnx=(($={}).Version=(c={},(h=Object.create(c))[c[0]="_START_VERSION"]=0,h[c[1]="IR_VERSION_2017_10_10"]=1,h[c[2]="IR_VERSION_2017_10_30"]=2,h[c[3]="IR_VERSION_2017_11_3"]=3,h[c[4]="IR_VERSION_2019_1_22"]=4,h[c[5]="IR_VERSION"]=5,h),$.AttributeProto=function(){function a(o){if(this.floats=[],this.ints=[],this.strings=[],this.tensors=[],this.graphs=[],o)for(var d=Object.keys(o),g=0;g<d.length;++g)o[d[g]]!=null&&(this[d[g]]=o[d[g]])}return a.prototype.name="",a.prototype.refAttrName="",a.prototype.docString="",a.prototype.type=0,a.prototype.f=0,a.prototype.i=et.Long?et.Long.fromBits(0,0,!1):0,a.prototype.s=et.newBuffer([]),a.prototype.t=null,a.prototype.g=null,a.prototype.floats=et.emptyArray,a.prototype.ints=et.emptyArray,a.prototype.strings=et.emptyArray,a.prototype.tensors=et.emptyArray,a.prototype.graphs=et.emptyArray,a.create=function(o){return new a(o)},a.encode=function(o,d){if(d||(d=nt.create()),o.name!=null&&o.hasOwnProperty("name")&&d.uint32(10).string(o.name),o.f!=null&&o.hasOwnProperty("f")&&d.uint32(21).float(o.f),o.i!=null&&o.hasOwnProperty("i")&&d.uint32(24).int64(o.i),o.s!=null&&o.hasOwnProperty("s")&&d.uint32(34).bytes(o.s),o.t!=null&&o.hasOwnProperty("t")&&b.onnx.TensorProto.encode(o.t,d.uint32(42).fork()).ldelim(),o.g!=null&&o.hasOwnProperty("g")&&b.onnx.GraphProto.encode(o.g,d.uint32(50).fork()).ldelim(),o.floats!=null&&o.floats.length){d.uint32(58).fork();for(var g=0;g<o.floats.length;++g)d.float(o.floats[g]);d.ldelim()}if(o.ints!=null&&o.ints.length){for(d.uint32(66).fork(),g=0;g<o.ints.length;++g)d.int64(o.ints[g]);d.ldelim()}if(o.strings!=null&&o.strings.length)for(g=0;g<o.strings.length;++g)d.uint32(74).bytes(o.strings[g]);if(o.tensors!=null&&o.tensors.length)for(g=0;g<o.tensors.length;++g)b.onnx.TensorProto.encode(o.tensors[g],d.uint32(82).fork()).ldelim();if(o.graphs!=null&&o.graphs.length)for(g=0;g<o.graphs.length;++g)b.onnx.GraphProto.encode(o.graphs[g],d.uint32(90).fork()).ldelim();return o.docString!=null&&o.hasOwnProperty("docString")&&d.uint32(106).string(o.docString),o.type!=null&&o.hasOwnProperty("type")&&d.uint32(160).int32(o.type),o.refAttrName!=null&&o.hasOwnProperty("refAttrName")&&d.uint32(170).string(o.refAttrName),d},a.encodeDelimited=function(o,d){return this.encode(o,d).ldelim()},a.decode=function(o,d){o instanceof j||(o=j.create(o));for(var g=d===void 0?o.len:o.pos+d,rt=new b.onnx.AttributeProto;o.pos<g;){var st=o.uint32();switch(st>>>3){case 1:rt.name=o.string();break;case 21:rt.refAttrName=o.string();break;case 13:rt.docString=o.string();break;case 20:rt.type=o.int32();break;case 2:rt.f=o.float();break;case 3:rt.i=o.int64();break;case 4:rt.s=o.bytes();break;case 5:rt.t=b.onnx.TensorProto.decode(o,o.uint32());break;case 6:rt.g=b.onnx.GraphProto.decode(o,o.uint32());break;case 7:if(rt.floats&&rt.floats.length||(rt.floats=[]),(7&st)==2)for(var tt=o.uint32()+o.pos;o.pos<tt;)rt.floats.push(o.float());else rt.floats.push(o.float());break;case 8:if(rt.ints&&rt.ints.length||(rt.ints=[]),(7&st)==2)for(tt=o.uint32()+o.pos;o.pos<tt;)rt.ints.push(o.int64());else rt.ints.push(o.int64());break;case 9:rt.strings&&rt.strings.length||(rt.strings=[]),rt.strings.push(o.bytes());break;case 10:rt.tensors&&rt.tensors.length||(rt.tensors=[]),rt.tensors.push(b.onnx.TensorProto.decode(o,o.uint32()));break;case 11:rt.graphs&&rt.graphs.length||(rt.graphs=[]),rt.graphs.push(b.onnx.GraphProto.decode(o,o.uint32()));break;default:o.skipType(7&st)}}return rt},a.decodeDelimited=function(o){return o instanceof j||(o=new j(o)),this.decode(o,o.uint32())},a.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.name!=null&&o.hasOwnProperty("name")&&!et.isString(o.name))return"name: string expected";if(o.refAttrName!=null&&o.hasOwnProperty("refAttrName")&&!et.isString(o.refAttrName))return"refAttrName: string expected";if(o.docString!=null&&o.hasOwnProperty("docString")&&!et.isString(o.docString))return"docString: string expected";if(o.type!=null&&o.hasOwnProperty("type"))switch(o.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:}if(o.f!=null&&o.hasOwnProperty("f")&&typeof o.f!="number")return"f: number expected";if(o.i!=null&&o.hasOwnProperty("i")&&!(et.isInteger(o.i)||o.i&&et.isInteger(o.i.low)&&et.isInteger(o.i.high)))return"i: integer|Long expected";if(o.s!=null&&o.hasOwnProperty("s")&&!(o.s&&typeof o.s.length=="number"||et.isString(o.s)))return"s: buffer expected";if(o.t!=null&&o.hasOwnProperty("t")&&(g=b.onnx.TensorProto.verify(o.t)))return"t."+g;if(o.g!=null&&o.hasOwnProperty("g")&&(g=b.onnx.GraphProto.verify(o.g)))return"g."+g;if(o.floats!=null&&o.hasOwnProperty("floats")){if(!Array.isArray(o.floats))return"floats: array expected";for(var d=0;d<o.floats.length;++d)if(typeof o.floats[d]!="number")return"floats: number[] expected"}if(o.ints!=null&&o.hasOwnProperty("ints")){if(!Array.isArray(o.ints))return"ints: array expected";for(d=0;d<o.ints.length;++d)if(!(et.isInteger(o.ints[d])||o.ints[d]&&et.isInteger(o.ints[d].low)&&et.isInteger(o.ints[d].high)))return"ints: integer|Long[] expected"}if(o.strings!=null&&o.hasOwnProperty("strings")){if(!Array.isArray(o.strings))return"strings: array expected";for(d=0;d<o.strings.length;++d)if(!(o.strings[d]&&typeof o.strings[d].length=="number"||et.isString(o.strings[d])))return"strings: buffer[] expected"}if(o.tensors!=null&&o.hasOwnProperty("tensors")){if(!Array.isArray(o.tensors))return"tensors: array expected";for(d=0;d<o.tensors.length;++d)if(g=b.onnx.TensorProto.verify(o.tensors[d]))return"tensors."+g}if(o.graphs!=null&&o.hasOwnProperty("graphs")){if(!Array.isArray(o.graphs))return"graphs: array expected";for(d=0;d<o.graphs.length;++d){var g;if(g=b.onnx.GraphProto.verify(o.graphs[d]))return"graphs."+g}}return null},a.fromObject=function(o){if(o instanceof b.onnx.AttributeProto)return o;var d=new b.onnx.AttributeProto;switch(o.name!=null&&(d.name=String(o.name)),o.refAttrName!=null&&(d.refAttrName=String(o.refAttrName)),o.docString!=null&&(d.docString=String(o.docString)),o.type){case"UNDEFINED":case 0:d.type=0;break;case"FLOAT":case 1:d.type=1;break;case"INT":case 2:d.type=2;break;case"STRING":case 3:d.type=3;break;case"TENSOR":case 4:d.type=4;break;case"GRAPH":case 5:d.type=5;break;case"FLOATS":case 6:d.type=6;break;case"INTS":case 7:d.type=7;break;case"STRINGS":case 8:d.type=8;break;case"TENSORS":case 9:d.type=9;break;case"GRAPHS":case 10:d.type=10}if(o.f!=null&&(d.f=Number(o.f)),o.i!=null&&(et.Long?(d.i=et.Long.fromValue(o.i)).unsigned=!1:typeof o.i=="string"?d.i=parseInt(o.i,10):typeof o.i=="number"?d.i=o.i:typeof o.i=="object"&&(d.i=new et.LongBits(o.i.low>>>0,o.i.high>>>0).toNumber())),o.s!=null&&(typeof o.s=="string"?et.base64.decode(o.s,d.s=et.newBuffer(et.base64.length(o.s)),0):o.s.length&&(d.s=o.s)),o.t!=null){if(typeof o.t!="object")throw TypeError(".onnx.AttributeProto.t: object expected");d.t=b.onnx.TensorProto.fromObject(o.t)}if(o.g!=null){if(typeof o.g!="object")throw TypeError(".onnx.AttributeProto.g: object expected");d.g=b.onnx.GraphProto.fromObject(o.g)}if(o.floats){if(!Array.isArray(o.floats))throw TypeError(".onnx.AttributeProto.floats: array expected");d.floats=[];for(var g=0;g<o.floats.length;++g)d.floats[g]=Number(o.floats[g])}if(o.ints){if(!Array.isArray(o.ints))throw TypeError(".onnx.AttributeProto.ints: array expected");for(d.ints=[],g=0;g<o.ints.length;++g)et.Long?(d.ints[g]=et.Long.fromValue(o.ints[g])).unsigned=!1:typeof o.ints[g]=="string"?d.ints[g]=parseInt(o.ints[g],10):typeof o.ints[g]=="number"?d.ints[g]=o.ints[g]:typeof o.ints[g]=="object"&&(d.ints[g]=new et.LongBits(o.ints[g].low>>>0,o.ints[g].high>>>0).toNumber())}if(o.strings){if(!Array.isArray(o.strings))throw TypeError(".onnx.AttributeProto.strings: array expected");for(d.strings=[],g=0;g<o.strings.length;++g)typeof o.strings[g]=="string"?et.base64.decode(o.strings[g],d.strings[g]=et.newBuffer(et.base64.length(o.strings[g])),0):o.strings[g].length&&(d.strings[g]=o.strings[g])}if(o.tensors){if(!Array.isArray(o.tensors))throw TypeError(".onnx.AttributeProto.tensors: array expected");for(d.tensors=[],g=0;g<o.tensors.length;++g){if(typeof o.tensors[g]!="object")throw TypeError(".onnx.AttributeProto.tensors: object expected");d.tensors[g]=b.onnx.TensorProto.fromObject(o.tensors[g])}}if(o.graphs){if(!Array.isArray(o.graphs))throw TypeError(".onnx.AttributeProto.graphs: array expected");for(d.graphs=[],g=0;g<o.graphs.length;++g){if(typeof o.graphs[g]!="object")throw TypeError(".onnx.AttributeProto.graphs: object expected");d.graphs[g]=b.onnx.GraphProto.fromObject(o.graphs[g])}}return d},a.toObject=function(o,d){d||(d={});var g={};if((d.arrays||d.defaults)&&(g.floats=[],g.ints=[],g.strings=[],g.tensors=[],g.graphs=[]),d.defaults){if(g.name="",g.f=0,et.Long){var rt=new et.Long(0,0,!1);g.i=d.longs===String?rt.toString():d.longs===Number?rt.toNumber():rt}else g.i=d.longs===String?"0":0;d.bytes===String?g.s="":(g.s=[],d.bytes!==Array&&(g.s=et.newBuffer(g.s))),g.t=null,g.g=null,g.docString="",g.type=d.enums===String?"UNDEFINED":0,g.refAttrName=""}if(o.name!=null&&o.hasOwnProperty("name")&&(g.name=o.name),o.f!=null&&o.hasOwnProperty("f")&&(g.f=d.json&&!isFinite(o.f)?String(o.f):o.f),o.i!=null&&o.hasOwnProperty("i")&&(typeof o.i=="number"?g.i=d.longs===String?String(o.i):o.i:g.i=d.longs===String?et.Long.prototype.toString.call(o.i):d.longs===Number?new et.LongBits(o.i.low>>>0,o.i.high>>>0).toNumber():o.i),o.s!=null&&o.hasOwnProperty("s")&&(g.s=d.bytes===String?et.base64.encode(o.s,0,o.s.length):d.bytes===Array?Array.prototype.slice.call(o.s):o.s),o.t!=null&&o.hasOwnProperty("t")&&(g.t=b.onnx.TensorProto.toObject(o.t,d)),o.g!=null&&o.hasOwnProperty("g")&&(g.g=b.onnx.GraphProto.toObject(o.g,d)),o.floats&&o.floats.length){g.floats=[];for(var st=0;st<o.floats.length;++st)g.floats[st]=d.json&&!isFinite(o.floats[st])?String(o.floats[st]):o.floats[st]}if(o.ints&&o.ints.length)for(g.ints=[],st=0;st<o.ints.length;++st)typeof o.ints[st]=="number"?g.ints[st]=d.longs===String?String(o.ints[st]):o.ints[st]:g.ints[st]=d.longs===String?et.Long.prototype.toString.call(o.ints[st]):d.longs===Number?new et.LongBits(o.ints[st].low>>>0,o.ints[st].high>>>0).toNumber():o.ints[st];if(o.strings&&o.strings.length)for(g.strings=[],st=0;st<o.strings.length;++st)g.strings[st]=d.bytes===String?et.base64.encode(o.strings[st],0,o.strings[st].length):d.bytes===Array?Array.prototype.slice.call(o.strings[st]):o.strings[st];if(o.tensors&&o.tensors.length)for(g.tensors=[],st=0;st<o.tensors.length;++st)g.tensors[st]=b.onnx.TensorProto.toObject(o.tensors[st],d);if(o.graphs&&o.graphs.length)for(g.graphs=[],st=0;st<o.graphs.length;++st)g.graphs[st]=b.onnx.GraphProto.toObject(o.graphs[st],d);return o.docString!=null&&o.hasOwnProperty("docString")&&(g.docString=o.docString),o.type!=null&&o.hasOwnProperty("type")&&(g.type=d.enums===String?b.onnx.AttributeProto.AttributeType[o.type]:o.type),o.refAttrName!=null&&o.hasOwnProperty("refAttrName")&&(g.refAttrName=o.refAttrName),g},a.prototype.toJSON=function(){return this.constructor.toObject(this,_.util.toJSONOptions)},a.AttributeType=function(){var o={},d=Object.create(o);return d[o[0]="UNDEFINED"]=0,d[o[1]="FLOAT"]=1,d[o[2]="INT"]=2,d[o[3]="STRING"]=3,d[o[4]="TENSOR"]=4,d[o[5]="GRAPH"]=5,d[o[6]="FLOATS"]=6,d[o[7]="INTS"]=7,d[o[8]="STRINGS"]=8,d[o[9]="TENSORS"]=9,d[o[10]="GRAPHS"]=10,d}(),a}(),$.ValueInfoProto=function(){function a(o){if(o)for(var d=Object.keys(o),g=0;g<d.length;++g)o[d[g]]!=null&&(this[d[g]]=o[d[g]])}return a.prototype.name="",a.prototype.type=null,a.prototype.docString="",a.create=function(o){return new a(o)},a.encode=function(o,d){return d||(d=nt.create()),o.name!=null&&o.hasOwnProperty("name")&&d.uint32(10).string(o.name),o.type!=null&&o.hasOwnProperty("type")&&b.onnx.TypeProto.encode(o.type,d.uint32(18).fork()).ldelim(),o.docString!=null&&o.hasOwnProperty("docString")&&d.uint32(26).string(o.docString),d},a.encodeDelimited=function(o,d){return this.encode(o,d).ldelim()},a.decode=function(o,d){o instanceof j||(o=j.create(o));for(var g=d===void 0?o.len:o.pos+d,rt=new b.onnx.ValueInfoProto;o.pos<g;){var st=o.uint32();switch(st>>>3){case 1:rt.name=o.string();break;case 2:rt.type=b.onnx.TypeProto.decode(o,o.uint32());break;case 3:rt.docString=o.string();break;default:o.skipType(7&st)}}return rt},a.decodeDelimited=function(o){return o instanceof j||(o=new j(o)),this.decode(o,o.uint32())},a.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.name!=null&&o.hasOwnProperty("name")&&!et.isString(o.name))return"name: string expected";if(o.type!=null&&o.hasOwnProperty("type")){var d=b.onnx.TypeProto.verify(o.type);if(d)return"type."+d}return o.docString!=null&&o.hasOwnProperty("docString")&&!et.isString(o.docString)?"docString: string expected":null},a.fromObject=function(o){if(o instanceof b.onnx.ValueInfoProto)return o;var d=new b.onnx.ValueInfoProto;if(o.name!=null&&(d.name=String(o.name)),o.type!=null){if(typeof o.type!="object")throw TypeError(".onnx.ValueInfoProto.type: object expected");d.type=b.onnx.TypeProto.fromObject(o.type)}return o.docString!=null&&(d.docString=String(o.docString)),d},a.toObject=function(o,d){d||(d={});var g={};return d.defaults&&(g.name="",g.type=null,g.docString=""),o.name!=null&&o.hasOwnProperty("name")&&(g.name=o.name),o.type!=null&&o.hasOwnProperty("type")&&(g.type=b.onnx.TypeProto.toObject(o.type,d)),o.docString!=null&&o.hasOwnProperty("docString")&&(g.docString=o.docString),g},a.prototype.toJSON=function(){return this.constructor.toObject(this,_.util.toJSONOptions)},a}(),$.NodeProto=function(){function a(o){if(this.input=[],this.output=[],this.attribute=[],o)for(var d=Object.keys(o),g=0;g<d.length;++g)o[d[g]]!=null&&(this[d[g]]=o[d[g]])}return a.prototype.input=et.emptyArray,a.prototype.output=et.emptyArray,a.prototype.name="",a.prototype.opType="",a.prototype.domain="",a.prototype.attribute=et.emptyArray,a.prototype.docString="",a.create=function(o){return new a(o)},a.encode=function(o,d){if(d||(d=nt.create()),o.input!=null&&o.input.length)for(var g=0;g<o.input.length;++g)d.uint32(10).string(o.input[g]);if(o.output!=null&&o.output.length)for(g=0;g<o.output.length;++g)d.uint32(18).string(o.output[g]);if(o.name!=null&&o.hasOwnProperty("name")&&d.uint32(26).string(o.name),o.opType!=null&&o.hasOwnProperty("opType")&&d.uint32(34).string(o.opType),o.attribute!=null&&o.attribute.length)for(g=0;g<o.attribute.length;++g)b.onnx.AttributeProto.encode(o.attribute[g],d.uint32(42).fork()).ldelim();return o.docString!=null&&o.hasOwnProperty("docString")&&d.uint32(50).string(o.docString),o.domain!=null&&o.hasOwnProperty("domain")&&d.uint32(58).string(o.domain),d},a.encodeDelimited=function(o,d){return this.encode(o,d).ldelim()},a.decode=function(o,d){o instanceof j||(o=j.create(o));for(var g=d===void 0?o.len:o.pos+d,rt=new b.onnx.NodeProto;o.pos<g;){var st=o.uint32();switch(st>>>3){case 1:rt.input&&rt.input.length||(rt.input=[]),rt.input.push(o.string());break;case 2:rt.output&&rt.output.length||(rt.output=[]),rt.output.push(o.string());break;case 3:rt.name=o.string();break;case 4:rt.opType=o.string();break;case 7:rt.domain=o.string();break;case 5:rt.attribute&&rt.attribute.length||(rt.attribute=[]),rt.attribute.push(b.onnx.AttributeProto.decode(o,o.uint32()));break;case 6:rt.docString=o.string();break;default:o.skipType(7&st)}}return rt},a.decodeDelimited=function(o){return o instanceof j||(o=new j(o)),this.decode(o,o.uint32())},a.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.input!=null&&o.hasOwnProperty("input")){if(!Array.isArray(o.input))return"input: array expected";for(var d=0;d<o.input.length;++d)if(!et.isString(o.input[d]))return"input: string[] expected"}if(o.output!=null&&o.hasOwnProperty("output")){if(!Array.isArray(o.output))return"output: array expected";for(d=0;d<o.output.length;++d)if(!et.isString(o.output[d]))return"output: string[] expected"}if(o.name!=null&&o.hasOwnProperty("name")&&!et.isString(o.name))return"name: string expected";if(o.opType!=null&&o.hasOwnProperty("opType")&&!et.isString(o.opType))return"opType: string expected";if(o.domain!=null&&o.hasOwnProperty("domain")&&!et.isString(o.domain))return"domain: string expected";if(o.attribute!=null&&o.hasOwnProperty("attribute")){if(!Array.isArray(o.attribute))return"attribute: array expected";for(d=0;d<o.attribute.length;++d){var g=b.onnx.AttributeProto.verify(o.attribute[d]);if(g)return"attribute."+g}}return o.docString!=null&&o.hasOwnProperty("docString")&&!et.isString(o.docString)?"docString: string expected":null},a.fromObject=function(o){if(o instanceof b.onnx.NodeProto)return o;var d=new b.onnx.NodeProto;if(o.input){if(!Array.isArray(o.input))throw TypeError(".onnx.NodeProto.input: array expected");d.input=[];for(var g=0;g<o.input.length;++g)d.input[g]=String(o.input[g])}if(o.output){if(!Array.isArray(o.output))throw TypeError(".onnx.NodeProto.output: array expected");for(d.output=[],g=0;g<o.output.length;++g)d.output[g]=String(o.output[g])}if(o.name!=null&&(d.name=String(o.name)),o.opType!=null&&(d.opType=String(o.opType)),o.domain!=null&&(d.domain=String(o.domain)),o.attribute){if(!Array.isArray(o.attribute))throw TypeError(".onnx.NodeProto.attribute: array expected");for(d.attribute=[],g=0;g<o.attribute.length;++g){if(typeof o.attribute[g]!="object")throw TypeError(".onnx.NodeProto.attribute: object expected");d.attribute[g]=b.onnx.AttributeProto.fromObject(o.attribute[g])}}return o.docString!=null&&(d.docString=String(o.docString)),d},a.toObject=function(o,d){d||(d={});var g={};if((d.arrays||d.defaults)&&(g.input=[],g.output=[],g.attribute=[]),d.defaults&&(g.name="",g.opType="",g.docString="",g.domain=""),o.input&&o.input.length){g.input=[];for(var rt=0;rt<o.input.length;++rt)g.input[rt]=o.input[rt]}if(o.output&&o.output.length)for(g.output=[],rt=0;rt<o.output.length;++rt)g.output[rt]=o.output[rt];if(o.name!=null&&o.hasOwnProperty("name")&&(g.name=o.name),o.opType!=null&&o.hasOwnProperty("opType")&&(g.opType=o.opType),o.attribute&&o.attribute.length)for(g.attribute=[],rt=0;rt<o.attribute.length;++rt)g.attribute[rt]=b.onnx.AttributeProto.toObject(o.attribute[rt],d);return o.docString!=null&&o.hasOwnProperty("docString")&&(g.docString=o.docString),o.domain!=null&&o.hasOwnProperty("domain")&&(g.domain=o.domain),g},a.prototype.toJSON=function(){return this.constructor.toObject(this,_.util.toJSONOptions)},a}(),$.ModelProto=function(){function a(o){if(this.opsetImport=[],this.metadataProps=[],o)for(var d=Object.keys(o),g=0;g<d.length;++g)o[d[g]]!=null&&(this[d[g]]=o[d[g]])}return a.prototype.irVersion=et.Long?et.Long.fromBits(0,0,!1):0,a.prototype.opsetImport=et.emptyArray,a.prototype.producerName="",a.prototype.producerVersion="",a.prototype.domain="",a.prototype.modelVersion=et.Long?et.Long.fromBits(0,0,!1):0,a.prototype.docString="",a.prototype.graph=null,a.prototype.metadataProps=et.emptyArray,a.create=function(o){return new a(o)},a.encode=function(o,d){if(d||(d=nt.create()),o.irVersion!=null&&o.hasOwnProperty("irVersion")&&d.uint32(8).int64(o.irVersion),o.producerName!=null&&o.hasOwnProperty("producerName")&&d.uint32(18).string(o.producerName),o.producerVersion!=null&&o.hasOwnProperty("producerVersion")&&d.uint32(26).string(o.producerVersion),o.domain!=null&&o.hasOwnProperty("domain")&&d.uint32(34).string(o.domain),o.modelVersion!=null&&o.hasOwnProperty("modelVersion")&&d.uint32(40).int64(o.modelVersion),o.docString!=null&&o.hasOwnProperty("docString")&&d.uint32(50).string(o.docString),o.graph!=null&&o.hasOwnProperty("graph")&&b.onnx.GraphProto.encode(o.graph,d.uint32(58).fork()).ldelim(),o.opsetImport!=null&&o.opsetImport.length)for(var g=0;g<o.opsetImport.length;++g)b.onnx.OperatorSetIdProto.encode(o.opsetImport[g],d.uint32(66).fork()).ldelim();if(o.metadataProps!=null&&o.metadataProps.length)for(g=0;g<o.metadataProps.length;++g)b.onnx.StringStringEntryProto.encode(o.metadataProps[g],d.uint32(114).fork()).ldelim();return d},a.encodeDelimited=function(o,d){return this.encode(o,d).ldelim()},a.decode=function(o,d){o instanceof j||(o=j.create(o));for(var g=d===void 0?o.len:o.pos+d,rt=new b.onnx.ModelProto;o.pos<g;){var st=o.uint32();switch(st>>>3){case 1:rt.irVersion=o.int64();break;case 8:rt.opsetImport&&rt.opsetImport.length||(rt.opsetImport=[]),rt.opsetImport.push(b.onnx.OperatorSetIdProto.decode(o,o.uint32()));break;case 2:rt.producerName=o.string();break;case 3:rt.producerVersion=o.string();break;case 4:rt.domain=o.string();break;case 5:rt.modelVersion=o.int64();break;case 6:rt.docString=o.string();break;case 7:rt.graph=b.onnx.GraphProto.decode(o,o.uint32());break;case 14:rt.metadataProps&&rt.metadataProps.length||(rt.metadataProps=[]),rt.metadataProps.push(b.onnx.StringStringEntryProto.decode(o,o.uint32()));break;default:o.skipType(7&st)}}return rt},a.decodeDelimited=function(o){return o instanceof j||(o=new j(o)),this.decode(o,o.uint32())},a.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.irVersion!=null&&o.hasOwnProperty("irVersion")&&!(et.isInteger(o.irVersion)||o.irVersion&&et.isInteger(o.irVersion.low)&&et.isInteger(o.irVersion.high)))return"irVersion: integer|Long expected";if(o.opsetImport!=null&&o.hasOwnProperty("opsetImport")){if(!Array.isArray(o.opsetImport))return"opsetImport: array expected";for(var d=0;d<o.opsetImport.length;++d)if(g=b.onnx.OperatorSetIdProto.verify(o.opsetImport[d]))return"opsetImport."+g}if(o.producerName!=null&&o.hasOwnProperty("producerName")&&!et.isString(o.producerName))return"producerName: string expected";if(o.producerVersion!=null&&o.hasOwnProperty("producerVersion")&&!et.isString(o.producerVersion))return"producerVersion: string expected";if(o.domain!=null&&o.hasOwnProperty("domain")&&!et.isString(o.domain))return"domain: string expected";if(o.modelVersion!=null&&o.hasOwnProperty("modelVersion")&&!(et.isInteger(o.modelVersion)||o.modelVersion&&et.isInteger(o.modelVersion.low)&&et.isInteger(o.modelVersion.high)))return"modelVersion: integer|Long expected";if(o.docString!=null&&o.hasOwnProperty("docString")&&!et.isString(o.docString))return"docString: string expected";if(o.graph!=null&&o.hasOwnProperty("graph")&&(g=b.onnx.GraphProto.verify(o.graph)))return"graph."+g;if(o.metadataProps!=null&&o.hasOwnProperty("metadataProps")){if(!Array.isArray(o.metadataProps))return"metadataProps: array expected";for(d=0;d<o.metadataProps.length;++d){var g;if(g=b.onnx.StringStringEntryProto.verify(o.metadataProps[d]))return"metadataProps."+g}}return null},a.fromObject=function(o){if(o instanceof b.onnx.ModelProto)return o;var d=new b.onnx.ModelProto;if(o.irVersion!=null&&(et.Long?(d.irVersion=et.Long.fromValue(o.irVersion)).unsigned=!1:typeof o.irVersion=="string"?d.irVersion=parseInt(o.irVersion,10):typeof o.irVersion=="number"?d.irVersion=o.irVersion:typeof o.irVersion=="object"&&(d.irVersion=new et.LongBits(o.irVersion.low>>>0,o.irVersion.high>>>0).toNumber())),o.opsetImport){if(!Array.isArray(o.opsetImport))throw TypeError(".onnx.ModelProto.opsetImport: array expected");d.opsetImport=[];for(var g=0;g<o.opsetImport.length;++g){if(typeof o.opsetImport[g]!="object")throw TypeError(".onnx.ModelProto.opsetImport: object expected");d.opsetImport[g]=b.onnx.OperatorSetIdProto.fromObject(o.opsetImport[g])}}if(o.producerName!=null&&(d.producerName=String(o.producerName)),o.producerVersion!=null&&(d.producerVersion=String(o.producerVersion)),o.domain!=null&&(d.domain=String(o.domain)),o.modelVersion!=null&&(et.Long?(d.modelVersion=et.Long.fromValue(o.modelVersion)).unsigned=!1:typeof o.modelVersion=="string"?d.modelVersion=parseInt(o.modelVersion,10):typeof o.modelVersion=="number"?d.modelVersion=o.modelVersion:typeof o.modelVersion=="object"&&(d.modelVersion=new et.LongBits(o.modelVersion.low>>>0,o.modelVersion.high>>>0).toNumber())),o.docString!=null&&(d.docString=String(o.docString)),o.graph!=null){if(typeof o.graph!="object")throw TypeError(".onnx.ModelProto.graph: object expected");d.graph=b.onnx.GraphProto.fromObject(o.graph)}if(o.metadataProps){if(!Array.isArray(o.metadataProps))throw TypeError(".onnx.ModelProto.metadataProps: array expected");for(d.metadataProps=[],g=0;g<o.metadataProps.length;++g){if(typeof o.metadataProps[g]!="object")throw TypeError(".onnx.ModelProto.metadataProps: object expected");d.metadataProps[g]=b.onnx.StringStringEntryProto.fromObject(o.metadataProps[g])}}return d},a.toObject=function(o,d){d||(d={});var g={};if((d.arrays||d.defaults)&&(g.opsetImport=[],g.metadataProps=[]),d.defaults){if(et.Long){var rt=new et.Long(0,0,!1);g.irVersion=d.longs===String?rt.toString():d.longs===Number?rt.toNumber():rt}else g.irVersion=d.longs===String?"0":0;g.producerName="",g.producerVersion="",g.domain="",et.Long?(rt=new et.Long(0,0,!1),g.modelVersion=d.longs===String?rt.toString():d.longs===Number?rt.toNumber():rt):g.modelVersion=d.longs===String?"0":0,g.docString="",g.graph=null}if(o.irVersion!=null&&o.hasOwnProperty("irVersion")&&(typeof o.irVersion=="number"?g.irVersion=d.longs===String?String(o.irVersion):o.irVersion:g.irVersion=d.longs===String?et.Long.prototype.toString.call(o.irVersion):d.longs===Number?new et.LongBits(o.irVersion.low>>>0,o.irVersion.high>>>0).toNumber():o.irVersion),o.producerName!=null&&o.hasOwnProperty("producerName")&&(g.producerName=o.producerName),o.producerVersion!=null&&o.hasOwnProperty("producerVersion")&&(g.producerVersion=o.producerVersion),o.domain!=null&&o.hasOwnProperty("domain")&&(g.domain=o.domain),o.modelVersion!=null&&o.hasOwnProperty("modelVersion")&&(typeof o.modelVersion=="number"?g.modelVersion=d.longs===String?String(o.modelVersion):o.modelVersion:g.modelVersion=d.longs===String?et.Long.prototype.toString.call(o.modelVersion):d.longs===Number?new et.LongBits(o.modelVersion.low>>>0,o.modelVersion.high>>>0).toNumber():o.modelVersion),o.docString!=null&&o.hasOwnProperty("docString")&&(g.docString=o.docString),o.graph!=null&&o.hasOwnProperty("graph")&&(g.graph=b.onnx.GraphProto.toObject(o.graph,d)),o.opsetImport&&o.opsetImport.length){g.opsetImport=[];for(var st=0;st<o.opsetImport.length;++st)g.opsetImport[st]=b.onnx.OperatorSetIdProto.toObject(o.opsetImport[st],d)}if(o.metadataProps&&o.metadataProps.length)for(g.metadataProps=[],st=0;st<o.metadataProps.length;++st)g.metadataProps[st]=b.onnx.StringStringEntryProto.toObject(o.metadataProps[st],d);return g},a.prototype.toJSON=function(){return this.constructor.toObject(this,_.util.toJSONOptions)},a}(),$.StringStringEntryProto=function(){function a(o){if(o)for(var d=Object.keys(o),g=0;g<d.length;++g)o[d[g]]!=null&&(this[d[g]]=o[d[g]])}return a.prototype.key="",a.prototype.value="",a.create=function(o){return new a(o)},a.encode=function(o,d){return d||(d=nt.create()),o.key!=null&&o.hasOwnProperty("key")&&d.uint32(10).string(o.key),o.value!=null&&o.hasOwnProperty("value")&&d.uint32(18).string(o.value),d},a.encodeDelimited=function(o,d){return this.encode(o,d).ldelim()},a.decode=function(o,d){o instanceof j||(o=j.create(o));for(var g=d===void 0?o.len:o.pos+d,rt=new b.onnx.StringStringEntryProto;o.pos<g;){var st=o.uint32();switch(st>>>3){case 1:rt.key=o.string();break;case 2:rt.value=o.string();break;default:o.skipType(7&st)}}return rt},a.decodeDelimited=function(o){return o instanceof j||(o=new j(o)),this.decode(o,o.uint32())},a.verify=function(o){return typeof o!="object"||o===null?"object expected":o.key!=null&&o.hasOwnProperty("key")&&!et.isString(o.key)?"key: string expected":o.value!=null&&o.hasOwnProperty("value")&&!et.isString(o.value)?"value: string expected":null},a.fromObject=function(o){if(o instanceof b.onnx.StringStringEntryProto)return o;var d=new b.onnx.StringStringEntryProto;return o.key!=null&&(d.key=String(o.key)),o.value!=null&&(d.value=String(o.value)),d},a.toObject=function(o,d){d||(d={});var g={};return d.defaults&&(g.key="",g.value=""),o.key!=null&&o.hasOwnProperty("key")&&(g.key=o.key),o.value!=null&&o.hasOwnProperty("value")&&(g.value=o.value),g},a.prototype.toJSON=function(){return this.constructor.toObject(this,_.util.toJSONOptions)},a}(),$.TensorAnnotation=function(){function a(o){if(this.quantParameterTensorNames=[],o)for(var d=Object.keys(o),g=0;g<d.length;++g)o[d[g]]!=null&&(this[d[g]]=o[d[g]])}return a.prototype.tensorName="",a.prototype.quantParameterTensorNames=et.emptyArray,a.create=function(o){return new a(o)},a.encode=function(o,d){if(d||(d=nt.create()),o.tensorName!=null&&o.hasOwnProperty("tensorName")&&d.uint32(10).string(o.tensorName),o.quantParameterTensorNames!=null&&o.quantParameterTensorNames.length)for(var g=0;g<o.quantParameterTensorNames.length;++g)b.onnx.StringStringEntryProto.encode(o.quantParameterTensorNames[g],d.uint32(18).fork()).ldelim();return d},a.encodeDelimited=function(o,d){return this.encode(o,d).ldelim()},a.decode=function(o,d){o instanceof j||(o=j.create(o));for(var g=d===void 0?o.len:o.pos+d,rt=new b.onnx.TensorAnnotation;o.pos<g;){var st=o.uint32();switch(st>>>3){case 1:rt.tensorName=o.string();break;case 2:rt.quantParameterTensorNames&&rt.quantParameterTensorNames.length||(rt.quantParameterTensorNames=[]),rt.quantParameterTensorNames.push(b.onnx.StringStringEntryProto.decode(o,o.uint32()));break;default:o.skipType(7&st)}}return rt},a.decodeDelimited=function(o){return o instanceof j||(o=new j(o)),this.decode(o,o.uint32())},a.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.tensorName!=null&&o.hasOwnProperty("tensorName")&&!et.isString(o.tensorName))return"tensorName: string expected";if(o.quantParameterTensorNames!=null&&o.hasOwnProperty("quantParameterTensorNames")){if(!Array.isArray(o.quantParameterTensorNames))return"quantParameterTensorNames: array expected";for(var d=0;d<o.quantParameterTensorNames.length;++d){var g=b.onnx.StringStringEntryProto.verify(o.quantParameterTensorNames[d]);if(g)return"quantParameterTensorNames."+g}}return null},a.fromObject=function(o){if(o instanceof b.onnx.TensorAnnotation)return o;var d=new b.onnx.TensorAnnotation;if(o.tensorName!=null&&(d.tensorName=String(o.tensorName)),o.quantParameterTensorNames){if(!Array.isArray(o.quantParameterTensorNames))throw TypeError(".onnx.TensorAnnotation.quantParameterTensorNames: array expected");d.quantParameterTensorNames=[];for(var g=0;g<o.quantParameterTensorNames.length;++g){if(typeof o.quantParameterTensorNames[g]!="object")throw TypeError(".onnx.TensorAnnotation.quantParameterTensorNames: object expected");d.quantParameterTensorNames[g]=b.onnx.StringStringEntryProto.fromObject(o.quantParameterTensorNames[g])}}return d},a.toObject=function(o,d){d||(d={});var g={};if((d.arrays||d.defaults)&&(g.quantParameterTensorNames=[]),d.defaults&&(g.tensorName=""),o.tensorName!=null&&o.hasOwnProperty("tensorName")&&(g.tensorName=o.tensorName),o.quantParameterTensorNames&&o.quantParameterTensorNames.length){g.quantParameterTensorNames=[];for(var rt=0;rt<o.quantParameterTensorNames.length;++rt)g.quantParameterTensorNames[rt]=b.onnx.StringStringEntryProto.toObject(o.quantParameterTensorNames[rt],d)}return g},a.prototype.toJSON=function(){return this.constructor.toObject(this,_.util.toJSONOptions)},a}(),$.GraphProto=function(){function a(o){if(this.node=[],this.initializer=[],this.input=[],this.output=[],this.valueInfo=[],this.quantizationAnnotation=[],o)for(var d=Object.keys(o),g=0;g<d.length;++g)o[d[g]]!=null&&(this[d[g]]=o[d[g]])}return a.prototype.node=et.emptyArray,a.prototype.name="",a.prototype.initializer=et.emptyArray,a.prototype.docString="",a.prototype.input=et.emptyArray,a.prototype.output=et.emptyArray,a.prototype.valueInfo=et.emptyArray,a.prototype.quantizationAnnotation=et.emptyArray,a.create=function(o){return new a(o)},a.encode=function(o,d){if(d||(d=nt.create()),o.node!=null&&o.node.length)for(var g=0;g<o.node.length;++g)b.onnx.NodeProto.encode(o.node[g],d.uint32(10).fork()).ldelim();if(o.name!=null&&o.hasOwnProperty("name")&&d.uint32(18).string(o.name),o.initializer!=null&&o.initializer.length)for(g=0;g<o.initializer.length;++g)b.onnx.TensorProto.encode(o.initializer[g],d.uint32(42).fork()).ldelim();if(o.docString!=null&&o.hasOwnProperty("docString")&&d.uint32(82).string(o.docString),o.input!=null&&o.input.length)for(g=0;g<o.input.length;++g)b.onnx.ValueInfoProto.encode(o.input[g],d.uint32(90).fork()).ldelim();if(o.output!=null&&o.output.length)for(g=0;g<o.output.length;++g)b.onnx.ValueInfoProto.encode(o.output[g],d.uint32(98).fork()).ldelim();if(o.valueInfo!=null&&o.valueInfo.length)for(g=0;g<o.valueInfo.length;++g)b.onnx.ValueInfoProto.encode(o.valueInfo[g],d.uint32(106).fork()).ldelim();if(o.quantizationAnnotation!=null&&o.quantizationAnnotation.length)for(g=0;g<o.quantizationAnnotation.length;++g)b.onnx.TensorAnnotation.encode(o.quantizationAnnotation[g],d.uint32(114).fork()).ldelim();return d},a.encodeDelimited=function(o,d){return this.encode(o,d).ldelim()},a.decode=function(o,d){o instanceof j||(o=j.create(o));for(var g=d===void 0?o.len:o.pos+d,rt=new b.onnx.GraphProto;o.pos<g;){var st=o.uint32();switch(st>>>3){case 1:rt.node&&rt.node.length||(rt.node=[]),rt.node.push(b.onnx.NodeProto.decode(o,o.uint32()));break;case 2:rt.name=o.string();break;case 5:rt.initializer&&rt.initializer.length||(rt.initializer=[]),rt.initializer.push(b.onnx.TensorProto.decode(o,o.uint32()));break;case 10:rt.docString=o.string();break;case 11:rt.input&&rt.input.length||(rt.input=[]),rt.input.push(b.onnx.ValueInfoProto.decode(o,o.uint32()));break;case 12:rt.output&&rt.output.length||(rt.output=[]),rt.output.push(b.onnx.ValueInfoProto.decode(o,o.uint32()));break;case 13:rt.valueInfo&&rt.valueInfo.length||(rt.valueInfo=[]),rt.valueInfo.push(b.onnx.ValueInfoProto.decode(o,o.uint32()));break;case 14:rt.quantizationAnnotation&&rt.quantizationAnnotation.length||(rt.quantizationAnnotation=[]),rt.quantizationAnnotation.push(b.onnx.TensorAnnotation.decode(o,o.uint32()));break;default:o.skipType(7&st)}}return rt},a.decodeDelimited=function(o){return o instanceof j||(o=new j(o)),this.decode(o,o.uint32())},a.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.node!=null&&o.hasOwnProperty("node")){if(!Array.isArray(o.node))return"node: array expected";for(var d=0;d<o.node.length;++d)if(g=b.onnx.NodeProto.verify(o.node[d]))return"node."+g}if(o.name!=null&&o.hasOwnProperty("name")&&!et.isString(o.name))return"name: string expected";if(o.initializer!=null&&o.hasOwnProperty("initializer")){if(!Array.isArray(o.initializer))return"initializer: array expected";for(d=0;d<o.initializer.length;++d)if(g=b.onnx.TensorProto.verify(o.initializer[d]))return"initializer."+g}if(o.docString!=null&&o.hasOwnProperty("docString")&&!et.isString(o.docString))return"docString: string expected";if(o.input!=null&&o.hasOwnProperty("input")){if(!Array.isArray(o.input))return"input: array expected";for(d=0;d<o.input.length;++d)if(g=b.onnx.ValueInfoProto.verify(o.input[d]))return"input."+g}if(o.output!=null&&o.hasOwnProperty("output")){if(!Array.isArray(o.output))return"output: array expected";for(d=0;d<o.output.length;++d)if(g=b.onnx.ValueInfoProto.verify(o.output[d]))return"output."+g}if(o.valueInfo!=null&&o.hasOwnProperty("valueInfo")){if(!Array.isArray(o.valueInfo))return"valueInfo: array expected";for(d=0;d<o.valueInfo.length;++d)if(g=b.onnx.ValueInfoProto.verify(o.valueInfo[d]))return"valueInfo."+g}if(o.quantizationAnnotation!=null&&o.hasOwnProperty("quantizationAnnotation")){if(!Array.isArray(o.quantizationAnnotation))return"quantizationAnnotation: array expected";for(d=0;d<o.quantizationAnnotation.length;++d){var g;if(g=b.onnx.TensorAnnotation.verify(o.quantizationAnnotation[d]))return"quantizationAnnotation."+g}}return null},a.fromObject=function(o){if(o instanceof b.onnx.GraphProto)return o;var d=new b.onnx.GraphProto;if(o.node){if(!Array.isArray(o.node))throw TypeError(".onnx.GraphProto.node: array expected");d.node=[];for(var g=0;g<o.node.length;++g){if(typeof o.node[g]!="object")throw TypeError(".onnx.GraphProto.node: object expected");d.node[g]=b.onnx.NodeProto.fromObject(o.node[g])}}if(o.name!=null&&(d.name=String(o.name)),o.initializer){if(!Array.isArray(o.initializer))throw TypeError(".onnx.GraphProto.initializer: array expected");for(d.initializer=[],g=0;g<o.initializer.length;++g){if(typeof o.initializer[g]!="object")throw TypeError(".onnx.GraphProto.initializer: object expected");d.initializer[g]=b.onnx.TensorProto.fromObject(o.initializer[g])}}if(o.docString!=null&&(d.docString=String(o.docString)),o.input){if(!Array.isArray(o.input))throw TypeError(".onnx.GraphProto.input: array expected");for(d.input=[],g=0;g<o.input.length;++g){if(typeof o.input[g]!="object")throw TypeError(".onnx.GraphProto.input: object expected");d.input[g]=b.onnx.ValueInfoProto.fromObject(o.input[g])}}if(o.output){if(!Array.isArray(o.output))throw TypeError(".onnx.GraphProto.output: array expected");for(d.output=[],g=0;g<o.output.length;++g){if(typeof o.output[g]!="object")throw TypeError(".onnx.GraphProto.output: object expected");d.output[g]=b.onnx.ValueInfoProto.fromObject(o.output[g])}}if(o.valueInfo){if(!Array.isArray(o.valueInfo))throw TypeError(".onnx.GraphProto.valueInfo: array expected");for(d.valueInfo=[],g=0;g<o.valueInfo.length;++g){if(typeof o.valueInfo[g]!="object")throw TypeError(".onnx.GraphProto.valueInfo: object expected");d.valueInfo[g]=b.onnx.ValueInfoProto.fromObject(o.valueInfo[g])}}if(o.quantizationAnnotation){if(!Array.isArray(o.quantizationAnnotation))throw TypeError(".onnx.GraphProto.quantizationAnnotation: array expected");for(d.quantizationAnnotation=[],g=0;g<o.quantizationAnnotation.length;++g){if(typeof o.quantizationAnnotation[g]!="object")throw TypeError(".onnx.GraphProto.quantizationAnnotation: object expected");d.quantizationAnnotation[g]=b.onnx.TensorAnnotation.fromObject(o.quantizationAnnotation[g])}}return d},a.toObject=function(o,d){d||(d={});var g={};if((d.arrays||d.defaults)&&(g.node=[],g.initializer=[],g.input=[],g.output=[],g.valueInfo=[],g.quantizationAnnotation=[]),d.defaults&&(g.name="",g.docString=""),o.node&&o.node.length){g.node=[];for(var rt=0;rt<o.node.length;++rt)g.node[rt]=b.onnx.NodeProto.toObject(o.node[rt],d)}if(o.name!=null&&o.hasOwnProperty("name")&&(g.name=o.name),o.initializer&&o.initializer.length)for(g.initializer=[],rt=0;rt<o.initializer.length;++rt)g.initializer[rt]=b.onnx.TensorProto.toObject(o.initializer[rt],d);if(o.docString!=null&&o.hasOwnProperty("docString")&&(g.docString=o.docString),o.input&&o.input.length)for(g.input=[],rt=0;rt<o.input.length;++rt)g.input[rt]=b.onnx.ValueInfoProto.toObject(o.input[rt],d);if(o.output&&o.output.length)for(g.output=[],rt=0;rt<o.output.length;++rt)g.output[rt]=b.onnx.ValueInfoProto.toObject(o.output[rt],d);if(o.valueInfo&&o.valueInfo.length)for(g.valueInfo=[],rt=0;rt<o.valueInfo.length;++rt)g.valueInfo[rt]=b.onnx.ValueInfoProto.toObject(o.valueInfo[rt],d);if(o.quantizationAnnotation&&o.quantizationAnnotation.length)for(g.quantizationAnnotation=[],rt=0;rt<o.quantizationAnnotation.length;++rt)g.quantizationAnnotation[rt]=b.onnx.TensorAnnotation.toObject(o.quantizationAnnotation[rt],d);return g},a.prototype.toJSON=function(){return this.constructor.toObject(this,_.util.toJSONOptions)},a}(),$.TensorProto=function(){function a(o){if(this.dims=[],this.floatData=[],this.int32Data=[],this.stringData=[],this.int64Data=[],this.externalData=[],this.doubleData=[],this.uint64Data=[],o)for(var d=Object.keys(o),g=0;g<d.length;++g)o[d[g]]!=null&&(this[d[g]]=o[d[g]])}return a.prototype.dims=et.emptyArray,a.prototype.dataType=0,a.prototype.segment=null,a.prototype.floatData=et.emptyArray,a.prototype.int32Data=et.emptyArray,a.prototype.stringData=et.emptyArray,a.prototype.int64Data=et.emptyArray,a.prototype.name="",a.prototype.docString="",a.prototype.rawData=et.newBuffer([]),a.prototype.externalData=et.emptyArray,a.prototype.dataLocation=0,a.prototype.doubleData=et.emptyArray,a.prototype.uint64Data=et.emptyArray,a.create=function(o){return new a(o)},a.encode=function(o,d){if(d||(d=nt.create()),o.dims!=null&&o.dims.length){d.uint32(10).fork();for(var g=0;g<o.dims.length;++g)d.int64(o.dims[g]);d.ldelim()}if(o.dataType!=null&&o.hasOwnProperty("dataType")&&d.uint32(16).int32(o.dataType),o.segment!=null&&o.hasOwnProperty("segment")&&b.onnx.TensorProto.Segment.encode(o.segment,d.uint32(26).fork()).ldelim(),o.floatData!=null&&o.floatData.length){for(d.uint32(34).fork(),g=0;g<o.floatData.length;++g)d.float(o.floatData[g]);d.ldelim()}if(o.int32Data!=null&&o.int32Data.length){for(d.uint32(42).fork(),g=0;g<o.int32Data.length;++g)d.int32(o.int32Data[g]);d.ldelim()}if(o.stringData!=null&&o.stringData.length)for(g=0;g<o.stringData.length;++g)d.uint32(50).bytes(o.stringData[g]);if(o.int64Data!=null&&o.int64Data.length){for(d.uint32(58).fork(),g=0;g<o.int64Data.length;++g)d.int64(o.int64Data[g]);d.ldelim()}if(o.name!=null&&o.hasOwnProperty("name")&&d.uint32(66).string(o.name),o.rawData!=null&&o.hasOwnProperty("rawData")&&d.uint32(74).bytes(o.rawData),o.doubleData!=null&&o.doubleData.length){for(d.uint32(82).fork(),g=0;g<o.doubleData.length;++g)d.double(o.doubleData[g]);d.ldelim()}if(o.uint64Data!=null&&o.uint64Data.length){for(d.uint32(90).fork(),g=0;g<o.uint64Data.length;++g)d.uint64(o.uint64Data[g]);d.ldelim()}if(o.docString!=null&&o.hasOwnProperty("docString")&&d.uint32(98).string(o.docString),o.externalData!=null&&o.externalData.length)for(g=0;g<o.externalData.length;++g)b.onnx.StringStringEntryProto.encode(o.externalData[g],d.uint32(106).fork()).ldelim();return o.dataLocation!=null&&o.hasOwnProperty("dataLocation")&&d.uint32(112).int32(o.dataLocation),d},a.encodeDelimited=function(o,d){return this.encode(o,d).ldelim()},a.decode=function(o,d){o instanceof j||(o=j.create(o));for(var g=d===void 0?o.len:o.pos+d,rt=new b.onnx.TensorProto;o.pos<g;){var st=o.uint32();switch(st>>>3){case 1:if(rt.dims&&rt.dims.length||(rt.dims=[]),(7&st)==2)for(var tt=o.uint32()+o.pos;o.pos<tt;)rt.dims.push(o.int64());else rt.dims.push(o.int64());break;case 2:rt.dataType=o.int32();break;case 3:rt.segment=b.onnx.TensorProto.Segment.decode(o,o.uint32());break;case 4:if(rt.floatData&&rt.floatData.length||(rt.floatData=[]),(7&st)==2)for(tt=o.uint32()+o.pos;o.pos<tt;)rt.floatData.push(o.float());else rt.floatData.push(o.float());break;case 5:if(rt.int32Data&&rt.int32Data.length||(rt.int32Data=[]),(7&st)==2)for(tt=o.uint32()+o.pos;o.pos<tt;)rt.int32Data.push(o.int32());else rt.int32Data.push(o.int32());break;case 6:rt.stringData&&rt.stringData.length||(rt.stringData=[]),rt.stringData.push(o.bytes());break;case 7:if(rt.int64Data&&rt.int64Data.length||(rt.int64Data=[]),(7&st)==2)for(tt=o.uint32()+o.pos;o.pos<tt;)rt.int64Data.push(o.int64());else rt.int64Data.push(o.int64());break;case 8:rt.name=o.string();break;case 12:rt.docString=o.string();break;case 9:rt.rawData=o.bytes();break;case 13:rt.externalData&&rt.externalData.length||(rt.externalData=[]),rt.externalData.push(b.onnx.StringStringEntryProto.decode(o,o.uint32()));break;case 14:rt.dataLocation=o.int32();break;case 10:if(rt.doubleData&&rt.doubleData.length||(rt.doubleData=[]),(7&st)==2)for(tt=o.uint32()+o.pos;o.pos<tt;)rt.doubleData.push(o.double());else rt.doubleData.push(o.double());break;case 11:if(rt.uint64Data&&rt.uint64Data.length||(rt.uint64Data=[]),(7&st)==2)for(tt=o.uint32()+o.pos;o.pos<tt;)rt.uint64Data.push(o.uint64());else rt.uint64Data.push(o.uint64());break;default:o.skipType(7&st)}}return rt},a.decodeDelimited=function(o){return o instanceof j||(o=new j(o)),this.decode(o,o.uint32())},a.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.dims!=null&&o.hasOwnProperty("dims")){if(!Array.isArray(o.dims))return"dims: array expected";for(var d=0;d<o.dims.length;++d)if(!(et.isInteger(o.dims[d])||o.dims[d]&&et.isInteger(o.dims[d].low)&&et.isInteger(o.dims[d].high)))return"dims: integer|Long[] expected"}if(o.dataType!=null&&o.hasOwnProperty("dataType")&&!et.isInteger(o.dataType))return"dataType: integer expected";if(o.segment!=null&&o.hasOwnProperty("segment")&&(g=b.onnx.TensorProto.Segment.verify(o.segment)))return"segment."+g;if(o.floatData!=null&&o.hasOwnProperty("floatData")){if(!Array.isArray(o.floatData))return"floatData: array expected";for(d=0;d<o.floatData.length;++d)if(typeof o.floatData[d]!="number")return"floatData: number[] expected"}if(o.int32Data!=null&&o.hasOwnProperty("int32Data")){if(!Array.isArray(o.int32Data))return"int32Data: array expected";for(d=0;d<o.int32Data.length;++d)if(!et.isInteger(o.int32Data[d]))return"int32Data: integer[] expected"}if(o.stringData!=null&&o.hasOwnProperty("stringData")){if(!Array.isArray(o.stringData))return"stringData: array expected";for(d=0;d<o.stringData.length;++d)if(!(o.stringData[d]&&typeof o.stringData[d].length=="number"||et.isString(o.stringData[d])))return"stringData: buffer[] expected"}if(o.int64Data!=null&&o.hasOwnProperty("int64Data")){if(!Array.isArray(o.int64Data))return"int64Data: array expected";for(d=0;d<o.int64Data.length;++d)if(!(et.isInteger(o.int64Data[d])||o.int64Data[d]&&et.isInteger(o.int64Data[d].low)&&et.isInteger(o.int64Data[d].high)))return"int64Data: integer|Long[] expected"}if(o.name!=null&&o.hasOwnProperty("name")&&!et.isString(o.name))return"name: string expected";if(o.docString!=null&&o.hasOwnProperty("docString")&&!et.isString(o.docString))return"docString: string expected";if(o.rawData!=null&&o.hasOwnProperty("rawData")&&!(o.rawData&&typeof o.rawData.length=="number"||et.isString(o.rawData)))return"rawData: buffer expected";if(o.externalData!=null&&o.hasOwnProperty("externalData")){if(!Array.isArray(o.externalData))return"externalData: array expected";for(d=0;d<o.externalData.length;++d){var g;if(g=b.onnx.StringStringEntryProto.verify(o.externalData[d]))return"externalData."+g}}if(o.dataLocation!=null&&o.hasOwnProperty("dataLocation"))switch(o.dataLocation){default:return"dataLocation: enum value expected";case 0:case 1:}if(o.doubleData!=null&&o.hasOwnProperty("doubleData")){if(!Array.isArray(o.doubleData))return"doubleData: array expected";for(d=0;d<o.doubleData.length;++d)if(typeof o.doubleData[d]!="number")return"doubleData: number[] expected"}if(o.uint64Data!=null&&o.hasOwnProperty("uint64Data")){if(!Array.isArray(o.uint64Data))return"uint64Data: array expected";for(d=0;d<o.uint64Data.length;++d)if(!(et.isInteger(o.uint64Data[d])||o.uint64Data[d]&&et.isInteger(o.uint64Data[d].low)&&et.isInteger(o.uint64Data[d].high)))return"uint64Data: integer|Long[] expected"}return null},a.fromObject=function(o){if(o instanceof b.onnx.TensorProto)return o;var d=new b.onnx.TensorProto;if(o.dims){if(!Array.isArray(o.dims))throw TypeError(".onnx.TensorProto.dims: array expected");d.dims=[];for(var g=0;g<o.dims.length;++g)et.Long?(d.dims[g]=et.Long.fromValue(o.dims[g])).unsigned=!1:typeof o.dims[g]=="string"?d.dims[g]=parseInt(o.dims[g],10):typeof o.dims[g]=="number"?d.dims[g]=o.dims[g]:typeof o.dims[g]=="object"&&(d.dims[g]=new et.LongBits(o.dims[g].low>>>0,o.dims[g].high>>>0).toNumber())}if(o.dataType!=null&&(d.dataType=0|o.dataType),o.segment!=null){if(typeof o.segment!="object")throw TypeError(".onnx.TensorProto.segment: object expected");d.segment=b.onnx.TensorProto.Segment.fromObject(o.segment)}if(o.floatData){if(!Array.isArray(o.floatData))throw TypeError(".onnx.TensorProto.floatData: array expected");for(d.floatData=[],g=0;g<o.floatData.length;++g)d.floatData[g]=Number(o.floatData[g])}if(o.int32Data){if(!Array.isArray(o.int32Data))throw TypeError(".onnx.TensorProto.int32Data: array expected");for(d.int32Data=[],g=0;g<o.int32Data.length;++g)d.int32Data[g]=0|o.int32Data[g]}if(o.stringData){if(!Array.isArray(o.stringData))throw TypeError(".onnx.TensorProto.stringData: array expected");for(d.stringData=[],g=0;g<o.stringData.length;++g)typeof o.stringData[g]=="string"?et.base64.decode(o.stringData[g],d.stringData[g]=et.newBuffer(et.base64.length(o.stringData[g])),0):o.stringData[g].length&&(d.stringData[g]=o.stringData[g])}if(o.int64Data){if(!Array.isArray(o.int64Data))throw TypeError(".onnx.TensorProto.int64Data: array expected");for(d.int64Data=[],g=0;g<o.int64Data.length;++g)et.Long?(d.int64Data[g]=et.Long.fromValue(o.int64Data[g])).unsigned=!1:typeof o.int64Data[g]=="string"?d.int64Data[g]=parseInt(o.int64Data[g],10):typeof o.int64Data[g]=="number"?d.int64Data[g]=o.int64Data[g]:typeof o.int64Data[g]=="object"&&(d.int64Data[g]=new et.LongBits(o.int64Data[g].low>>>0,o.int64Data[g].high>>>0).toNumber())}if(o.name!=null&&(d.name=String(o.name)),o.docString!=null&&(d.docString=String(o.docString)),o.rawData!=null&&(typeof o.rawData=="string"?et.base64.decode(o.rawData,d.rawData=et.newBuffer(et.base64.length(o.rawData)),0):o.rawData.length&&(d.rawData=o.rawData)),o.externalData){if(!Array.isArray(o.externalData))throw TypeError(".onnx.TensorProto.externalData: array expected");for(d.externalData=[],g=0;g<o.externalData.length;++g){if(typeof o.externalData[g]!="object")throw TypeError(".onnx.TensorProto.externalData: object expected");d.externalData[g]=b.onnx.StringStringEntryProto.fromObject(o.externalData[g])}}switch(o.dataLocation){case"DEFAULT":case 0:d.dataLocation=0;break;case"EXTERNAL":case 1:d.dataLocation=1}if(o.doubleData){if(!Array.isArray(o.doubleData))throw TypeError(".onnx.TensorProto.doubleData: array expected");for(d.doubleData=[],g=0;g<o.doubleData.length;++g)d.doubleData[g]=Number(o.doubleData[g])}if(o.uint64Data){if(!Array.isArray(o.uint64Data))throw TypeError(".onnx.TensorProto.uint64Data: array expected");for(d.uint64Data=[],g=0;g<o.uint64Data.length;++g)et.Long?(d.uint64Data[g]=et.Long.fromValue(o.uint64Data[g])).unsigned=!0:typeof o.uint64Data[g]=="string"?d.uint64Data[g]=parseInt(o.uint64Data[g],10):typeof o.uint64Data[g]=="number"?d.uint64Data[g]=o.uint64Data[g]:typeof o.uint64Data[g]=="object"&&(d.uint64Data[g]=new et.LongBits(o.uint64Data[g].low>>>0,o.uint64Data[g].high>>>0).toNumber(!0))}return d},a.toObject=function(o,d){d||(d={});var g={};if((d.arrays||d.defaults)&&(g.dims=[],g.floatData=[],g.int32Data=[],g.stringData=[],g.int64Data=[],g.doubleData=[],g.uint64Data=[],g.externalData=[]),d.defaults&&(g.dataType=0,g.segment=null,g.name="",d.bytes===String?g.rawData="":(g.rawData=[],d.bytes!==Array&&(g.rawData=et.newBuffer(g.rawData))),g.docString="",g.dataLocation=d.enums===String?"DEFAULT":0),o.dims&&o.dims.length){g.dims=[];for(var rt=0;rt<o.dims.length;++rt)typeof o.dims[rt]=="number"?g.dims[rt]=d.longs===String?String(o.dims[rt]):o.dims[rt]:g.dims[rt]=d.longs===String?et.Long.prototype.toString.call(o.dims[rt]):d.longs===Number?new et.LongBits(o.dims[rt].low>>>0,o.dims[rt].high>>>0).toNumber():o.dims[rt]}if(o.dataType!=null&&o.hasOwnProperty("dataType")&&(g.dataType=o.dataType),o.segment!=null&&o.hasOwnProperty("segment")&&(g.segment=b.onnx.TensorProto.Segment.toObject(o.segment,d)),o.floatData&&o.floatData.length)for(g.floatData=[],rt=0;rt<o.floatData.length;++rt)g.floatData[rt]=d.json&&!isFinite(o.floatData[rt])?String(o.floatData[rt]):o.floatData[rt];if(o.int32Data&&o.int32Data.length)for(g.int32Data=[],rt=0;rt<o.int32Data.length;++rt)g.int32Data[rt]=o.int32Data[rt];if(o.stringData&&o.stringData.length)for(g.stringData=[],rt=0;rt<o.stringData.length;++rt)g.stringData[rt]=d.bytes===String?et.base64.encode(o.stringData[rt],0,o.stringData[rt].length):d.bytes===Array?Array.prototype.slice.call(o.stringData[rt]):o.stringData[rt];if(o.int64Data&&o.int64Data.length)for(g.int64Data=[],rt=0;rt<o.int64Data.length;++rt)typeof o.int64Data[rt]=="number"?g.int64Data[rt]=d.longs===String?String(o.int64Data[rt]):o.int64Data[rt]:g.int64Data[rt]=d.longs===String?et.Long.prototype.toString.call(o.int64Data[rt]):d.longs===Number?new et.LongBits(o.int64Data[rt].low>>>0,o.int64Data[rt].high>>>0).toNumber():o.int64Data[rt];if(o.name!=null&&o.hasOwnProperty("name")&&(g.name=o.name),o.rawData!=null&&o.hasOwnProperty("rawData")&&(g.rawData=d.bytes===String?et.base64.encode(o.rawData,0,o.rawData.length):d.bytes===Array?Array.prototype.slice.call(o.rawData):o.rawData),o.doubleData&&o.doubleData.length)for(g.doubleData=[],rt=0;rt<o.doubleData.length;++rt)g.doubleData[rt]=d.json&&!isFinite(o.doubleData[rt])?String(o.doubleData[rt]):o.doubleData[rt];if(o.uint64Data&&o.uint64Data.length)for(g.uint64Data=[],rt=0;rt<o.uint64Data.length;++rt)typeof o.uint64Data[rt]=="number"?g.uint64Data[rt]=d.longs===String?String(o.uint64Data[rt]):o.uint64Data[rt]:g.uint64Data[rt]=d.longs===String?et.Long.prototype.toString.call(o.uint64Data[rt]):d.longs===Number?new et.LongBits(o.uint64Data[rt].low>>>0,o.uint64Data[rt].high>>>0).toNumber(!0):o.uint64Data[rt];if(o.docString!=null&&o.hasOwnProperty("docString")&&(g.docString=o.docString),o.externalData&&o.externalData.length)for(g.externalData=[],rt=0;rt<o.externalData.length;++rt)g.externalData[rt]=b.onnx.StringStringEntryProto.toObject(o.externalData[rt],d);return o.dataLocation!=null&&o.hasOwnProperty("dataLocation")&&(g.dataLocation=d.enums===String?b.onnx.TensorProto.DataLocation[o.dataLocation]:o.dataLocation),g},a.prototype.toJSON=function(){return this.constructor.toObject(this,_.util.toJSONOptions)},a.DataType=function(){var o={},d=Object.create(o);return d[o[0]="UNDEFINED"]=0,d[o[1]="FLOAT"]=1,d[o[2]="UINT8"]=2,d[o[3]="INT8"]=3,d[o[4]="UINT16"]=4,d[o[5]="INT16"]=5,d[o[6]="INT32"]=6,d[o[7]="INT64"]=7,d[o[8]="STRING"]=8,d[o[9]="BOOL"]=9,d[o[10]="FLOAT16"]=10,d[o[11]="DOUBLE"]=11,d[o[12]="UINT32"]=12,d[o[13]="UINT64"]=13,d[o[14]="COMPLEX64"]=14,d[o[15]="COMPLEX128"]=15,d[o[16]="BFLOAT16"]=16,d}(),a.Segment=function(){function o(d){if(d)for(var g=Object.keys(d),rt=0;rt<g.length;++rt)d[g[rt]]!=null&&(this[g[rt]]=d[g[rt]])}return o.prototype.begin=et.Long?et.Long.fromBits(0,0,!1):0,o.prototype.end=et.Long?et.Long.fromBits(0,0,!1):0,o.create=function(d){return new o(d)},o.encode=function(d,g){return g||(g=nt.create()),d.begin!=null&&d.hasOwnProperty("begin")&&g.uint32(8).int64(d.begin),d.end!=null&&d.hasOwnProperty("end")&&g.uint32(16).int64(d.end),g},o.encodeDelimited=function(d,g){return this.encode(d,g).ldelim()},o.decode=function(d,g){d instanceof j||(d=j.create(d));for(var rt=g===void 0?d.len:d.pos+g,st=new b.onnx.TensorProto.Segment;d.pos<rt;){var tt=d.uint32();switch(tt>>>3){case 1:st.begin=d.int64();break;case 2:st.end=d.int64();break;default:d.skipType(7&tt)}}return st},o.decodeDelimited=function(d){return d instanceof j||(d=new j(d)),this.decode(d,d.uint32())},o.verify=function(d){return typeof d!="object"||d===null?"object expected":d.begin!=null&&d.hasOwnProperty("begin")&&!(et.isInteger(d.begin)||d.begin&&et.isInteger(d.begin.low)&&et.isInteger(d.begin.high))?"begin: integer|Long expected":d.end!=null&&d.hasOwnProperty("end")&&!(et.isInteger(d.end)||d.end&&et.isInteger(d.end.low)&&et.isInteger(d.end.high))?"end: integer|Long expected":null},o.fromObject=function(d){if(d instanceof b.onnx.TensorProto.Segment)return d;var g=new b.onnx.TensorProto.Segment;return d.begin!=null&&(et.Long?(g.begin=et.Long.fromValue(d.begin)).unsigned=!1:typeof d.begin=="string"?g.begin=parseInt(d.begin,10):typeof d.begin=="number"?g.begin=d.begin:typeof d.begin=="object"&&(g.begin=new et.LongBits(d.begin.low>>>0,d.begin.high>>>0).toNumber())),d.end!=null&&(et.Long?(g.end=et.Long.fromValue(d.end)).unsigned=!1:typeof d.end=="string"?g.end=parseInt(d.end,10):typeof d.end=="number"?g.end=d.end:typeof d.end=="object"&&(g.end=new et.LongBits(d.end.low>>>0,d.end.high>>>0).toNumber())),g},o.toObject=function(d,g){g||(g={});var rt={};if(g.defaults){if(et.Long){var st=new et.Long(0,0,!1);rt.begin=g.longs===String?st.toString():g.longs===Number?st.toNumber():st}else rt.begin=g.longs===String?"0":0;et.Long?(st=new et.Long(0,0,!1),rt.end=g.longs===String?st.toString():g.longs===Number?st.toNumber():st):rt.end=g.longs===String?"0":0}return d.begin!=null&&d.hasOwnProperty("begin")&&(typeof d.begin=="number"?rt.begin=g.longs===String?String(d.begin):d.begin:rt.begin=g.longs===String?et.Long.prototype.toString.call(d.begin):g.longs===Number?new et.LongBits(d.begin.low>>>0,d.begin.high>>>0).toNumber():d.begin),d.end!=null&&d.hasOwnProperty("end")&&(typeof d.end=="number"?rt.end=g.longs===String?String(d.end):d.end:rt.end=g.longs===String?et.Long.prototype.toString.call(d.end):g.longs===Number?new et.LongBits(d.end.low>>>0,d.end.high>>>0).toNumber():d.end),rt},o.prototype.toJSON=function(){return this.constructor.toObject(this,_.util.toJSONOptions)},o}(),a.DataLocation=function(){var o={},d=Object.create(o);return d[o[0]="DEFAULT"]=0,d[o[1]="EXTERNAL"]=1,d}(),a}(),$.TensorShapeProto=function(){function a(o){if(this.dim=[],o)for(var d=Object.keys(o),g=0;g<d.length;++g)o[d[g]]!=null&&(this[d[g]]=o[d[g]])}return a.prototype.dim=et.emptyArray,a.create=function(o){return new a(o)},a.encode=function(o,d){if(d||(d=nt.create()),o.dim!=null&&o.dim.length)for(var g=0;g<o.dim.length;++g)b.onnx.TensorShapeProto.Dimension.encode(o.dim[g],d.uint32(10).fork()).ldelim();return d},a.encodeDelimited=function(o,d){return this.encode(o,d).ldelim()},a.decode=function(o,d){o instanceof j||(o=j.create(o));for(var g=d===void 0?o.len:o.pos+d,rt=new b.onnx.TensorShapeProto;o.pos<g;){var st=o.uint32();st>>>3==1?(rt.dim&&rt.dim.length||(rt.dim=[]),rt.dim.push(b.onnx.TensorShapeProto.Dimension.decode(o,o.uint32()))):o.skipType(7&st)}return rt},a.decodeDelimited=function(o){return o instanceof j||(o=new j(o)),this.decode(o,o.uint32())},a.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.dim!=null&&o.hasOwnProperty("dim")){if(!Array.isArray(o.dim))return"dim: array expected";for(var d=0;d<o.dim.length;++d){var g=b.onnx.TensorShapeProto.Dimension.verify(o.dim[d]);if(g)return"dim."+g}}return null},a.fromObject=function(o){if(o instanceof b.onnx.TensorShapeProto)return o;var d=new b.onnx.TensorShapeProto;if(o.dim){if(!Array.isArray(o.dim))throw TypeError(".onnx.TensorShapeProto.dim: array expected");d.dim=[];for(var g=0;g<o.dim.length;++g){if(typeof o.dim[g]!="object")throw TypeError(".onnx.TensorShapeProto.dim: object expected");d.dim[g]=b.onnx.TensorShapeProto.Dimension.fromObject(o.dim[g])}}return d},a.toObject=function(o,d){d||(d={});var g={};if((d.arrays||d.defaults)&&(g.dim=[]),o.dim&&o.dim.length){g.dim=[];for(var rt=0;rt<o.dim.length;++rt)g.dim[rt]=b.onnx.TensorShapeProto.Dimension.toObject(o.dim[rt],d)}return g},a.prototype.toJSON=function(){return this.constructor.toObject(this,_.util.toJSONOptions)},a.Dimension=function(){function o(g){if(g)for(var rt=Object.keys(g),st=0;st<rt.length;++st)g[rt[st]]!=null&&(this[rt[st]]=g[rt[st]])}var d;return o.prototype.dimValue=et.Long?et.Long.fromBits(0,0,!1):0,o.prototype.dimParam="",o.prototype.denotation="",Object.defineProperty(o.prototype,"value",{get:et.oneOfGetter(d=["dimValue","dimParam"]),set:et.oneOfSetter(d)}),o.create=function(g){return new o(g)},o.encode=function(g,rt){return rt||(rt=nt.create()),g.dimValue!=null&&g.hasOwnProperty("dimValue")&&rt.uint32(8).int64(g.dimValue),g.dimParam!=null&&g.hasOwnProperty("dimParam")&&rt.uint32(18).string(g.dimParam),g.denotation!=null&&g.hasOwnProperty("denotation")&&rt.uint32(26).string(g.denotation),rt},o.encodeDelimited=function(g,rt){return this.encode(g,rt).ldelim()},o.decode=function(g,rt){g instanceof j||(g=j.create(g));for(var st=rt===void 0?g.len:g.pos+rt,tt=new b.onnx.TensorShapeProto.Dimension;g.pos<st;){var ot=g.uint32();switch(ot>>>3){case 1:tt.dimValue=g.int64();break;case 2:tt.dimParam=g.string();break;case 3:tt.denotation=g.string();break;default:g.skipType(7&ot)}}return tt},o.decodeDelimited=function(g){return g instanceof j||(g=new j(g)),this.decode(g,g.uint32())},o.verify=function(g){if(typeof g!="object"||g===null)return"object expected";var rt={};if(g.dimValue!=null&&g.hasOwnProperty("dimValue")&&(rt.value=1,!(et.isInteger(g.dimValue)||g.dimValue&&et.isInteger(g.dimValue.low)&&et.isInteger(g.dimValue.high))))return"dimValue: integer|Long expected";if(g.dimParam!=null&&g.hasOwnProperty("dimParam")){if(rt.value===1)return"value: multiple values";if(rt.value=1,!et.isString(g.dimParam))return"dimParam: string expected"}return g.denotation!=null&&g.hasOwnProperty("denotation")&&!et.isString(g.denotation)?"denotation: string expected":null},o.fromObject=function(g){if(g instanceof b.onnx.TensorShapeProto.Dimension)return g;var rt=new b.onnx.TensorShapeProto.Dimension;return g.dimValue!=null&&(et.Long?(rt.dimValue=et.Long.fromValue(g.dimValue)).unsigned=!1:typeof g.dimValue=="string"?rt.dimValue=parseInt(g.dimValue,10):typeof g.dimValue=="number"?rt.dimValue=g.dimValue:typeof g.dimValue=="object"&&(rt.dimValue=new et.LongBits(g.dimValue.low>>>0,g.dimValue.high>>>0).toNumber())),g.dimParam!=null&&(rt.dimParam=String(g.dimParam)),g.denotation!=null&&(rt.denotation=String(g.denotation)),rt},o.toObject=function(g,rt){rt||(rt={});var st={};return rt.defaults&&(st.denotation=""),g.dimValue!=null&&g.hasOwnProperty("dimValue")&&(typeof g.dimValue=="number"?st.dimValue=rt.longs===String?String(g.dimValue):g.dimValue:st.dimValue=rt.longs===String?et.Long.prototype.toString.call(g.dimValue):rt.longs===Number?new et.LongBits(g.dimValue.low>>>0,g.dimValue.high>>>0).toNumber():g.dimValue,rt.oneofs&&(st.value="dimValue")),g.dimParam!=null&&g.hasOwnProperty("dimParam")&&(st.dimParam=g.dimParam,rt.oneofs&&(st.value="dimParam")),g.denotation!=null&&g.hasOwnProperty("denotation")&&(st.denotation=g.denotation),st},o.prototype.toJSON=function(){return this.constructor.toObject(this,_.util.toJSONOptions)},o}(),a}(),$.TypeProto=function(){function a(d){if(d)for(var g=Object.keys(d),rt=0;rt<g.length;++rt)d[g[rt]]!=null&&(this[g[rt]]=d[g[rt]])}var o;return a.prototype.tensorType=null,a.prototype.denotation="",Object.defineProperty(a.prototype,"value",{get:et.oneOfGetter(o=["tensorType"]),set:et.oneOfSetter(o)}),a.create=function(d){return new a(d)},a.encode=function(d,g){return g||(g=nt.create()),d.tensorType!=null&&d.hasOwnProperty("tensorType")&&b.onnx.TypeProto.Tensor.encode(d.tensorType,g.uint32(10).fork()).ldelim(),d.denotation!=null&&d.hasOwnProperty("denotation")&&g.uint32(50).string(d.denotation),g},a.encodeDelimited=function(d,g){return this.encode(d,g).ldelim()},a.decode=function(d,g){d instanceof j||(d=j.create(d));for(var rt=g===void 0?d.len:d.pos+g,st=new b.onnx.TypeProto;d.pos<rt;){var tt=d.uint32();switch(tt>>>3){case 1:st.tensorType=b.onnx.TypeProto.Tensor.decode(d,d.uint32());break;case 6:st.denotation=d.string();break;default:d.skipType(7&tt)}}return st},a.decodeDelimited=function(d){return d instanceof j||(d=new j(d)),this.decode(d,d.uint32())},a.verify=function(d){if(typeof d!="object"||d===null)return"object expected";if(d.tensorType!=null&&d.hasOwnProperty("tensorType")){var g=b.onnx.TypeProto.Tensor.verify(d.tensorType);if(g)return"tensorType."+g}return d.denotation!=null&&d.hasOwnProperty("denotation")&&!et.isString(d.denotation)?"denotation: string expected":null},a.fromObject=function(d){if(d instanceof b.onnx.TypeProto)return d;var g=new b.onnx.TypeProto;if(d.tensorType!=null){if(typeof d.tensorType!="object")throw TypeError(".onnx.TypeProto.tensorType: object expected");g.tensorType=b.onnx.TypeProto.Tensor.fromObject(d.tensorType)}return d.denotation!=null&&(g.denotation=String(d.denotation)),g},a.toObject=function(d,g){g||(g={});var rt={};return g.defaults&&(rt.denotation=""),d.tensorType!=null&&d.hasOwnProperty("tensorType")&&(rt.tensorType=b.onnx.TypeProto.Tensor.toObject(d.tensorType,g),g.oneofs&&(rt.value="tensorType")),d.denotation!=null&&d.hasOwnProperty("denotation")&&(rt.denotation=d.denotation),rt},a.prototype.toJSON=function(){return this.constructor.toObject(this,_.util.toJSONOptions)},a.Tensor=function(){function d(g){if(g)for(var rt=Object.keys(g),st=0;st<rt.length;++st)g[rt[st]]!=null&&(this[rt[st]]=g[rt[st]])}return d.prototype.elemType=0,d.prototype.shape=null,d.create=function(g){return new d(g)},d.encode=function(g,rt){return rt||(rt=nt.create()),g.elemType!=null&&g.hasOwnProperty("elemType")&&rt.uint32(8).int32(g.elemType),g.shape!=null&&g.hasOwnProperty("shape")&&b.onnx.TensorShapeProto.encode(g.shape,rt.uint32(18).fork()).ldelim(),rt},d.encodeDelimited=function(g,rt){return this.encode(g,rt).ldelim()},d.decode=function(g,rt){g instanceof j||(g=j.create(g));for(var st=rt===void 0?g.len:g.pos+rt,tt=new b.onnx.TypeProto.Tensor;g.pos<st;){var ot=g.uint32();switch(ot>>>3){case 1:tt.elemType=g.int32();break;case 2:tt.shape=b.onnx.TensorShapeProto.decode(g,g.uint32());break;default:g.skipType(7&ot)}}return tt},d.decodeDelimited=function(g){return g instanceof j||(g=new j(g)),this.decode(g,g.uint32())},d.verify=function(g){if(typeof g!="object"||g===null)return"object expected";if(g.elemType!=null&&g.hasOwnProperty("elemType")&&!et.isInteger(g.elemType))return"elemType: integer expected";if(g.shape!=null&&g.hasOwnProperty("shape")){var rt=b.onnx.TensorShapeProto.verify(g.shape);if(rt)return"shape."+rt}return null},d.fromObject=function(g){if(g instanceof b.onnx.TypeProto.Tensor)return g;var rt=new b.onnx.TypeProto.Tensor;if(g.elemType!=null&&(rt.elemType=0|g.elemType),g.shape!=null){if(typeof g.shape!="object")throw TypeError(".onnx.TypeProto.Tensor.shape: object expected");rt.shape=b.onnx.TensorShapeProto.fromObject(g.shape)}return rt},d.toObject=function(g,rt){rt||(rt={});var st={};return rt.defaults&&(st.elemType=0,st.shape=null),g.elemType!=null&&g.hasOwnProperty("elemType")&&(st.elemType=g.elemType),g.shape!=null&&g.hasOwnProperty("shape")&&(st.shape=b.onnx.TensorShapeProto.toObject(g.shape,rt)),st},d.prototype.toJSON=function(){return this.constructor.toObject(this,_.util.toJSONOptions)},d}(),a}(),$.OperatorSetIdProto=function(){function a(o){if(o)for(var d=Object.keys(o),g=0;g<d.length;++g)o[d[g]]!=null&&(this[d[g]]=o[d[g]])}return a.prototype.domain="",a.prototype.version=et.Long?et.Long.fromBits(0,0,!1):0,a.create=function(o){return new a(o)},a.encode=function(o,d){return d||(d=nt.create()),o.domain!=null&&o.hasOwnProperty("domain")&&d.uint32(10).string(o.domain),o.version!=null&&o.hasOwnProperty("version")&&d.uint32(16).int64(o.version),d},a.encodeDelimited=function(o,d){return this.encode(o,d).ldelim()},a.decode=function(o,d){o instanceof j||(o=j.create(o));for(var g=d===void 0?o.len:o.pos+d,rt=new b.onnx.OperatorSetIdProto;o.pos<g;){var st=o.uint32();switch(st>>>3){case 1:rt.domain=o.string();break;case 2:rt.version=o.int64();break;default:o.skipType(7&st)}}return rt},a.decodeDelimited=function(o){return o instanceof j||(o=new j(o)),this.decode(o,o.uint32())},a.verify=function(o){return typeof o!="object"||o===null?"object expected":o.domain!=null&&o.hasOwnProperty("domain")&&!et.isString(o.domain)?"domain: string expected":o.version!=null&&o.hasOwnProperty("version")&&!(et.isInteger(o.version)||o.version&&et.isInteger(o.version.low)&&et.isInteger(o.version.high))?"version: integer|Long expected":null},a.fromObject=function(o){if(o instanceof b.onnx.OperatorSetIdProto)return o;var d=new b.onnx.OperatorSetIdProto;return o.domain!=null&&(d.domain=String(o.domain)),o.version!=null&&(et.Long?(d.version=et.Long.fromValue(o.version)).unsigned=!1:typeof o.version=="string"?d.version=parseInt(o.version,10):typeof o.version=="number"?d.version=o.version:typeof o.version=="object"&&(d.version=new et.LongBits(o.version.low>>>0,o.version.high>>>0).toNumber())),d},a.toObject=function(o,d){d||(d={});var g={};if(d.defaults)if(g.domain="",et.Long){var rt=new et.Long(0,0,!1);g.version=d.longs===String?rt.toString():d.longs===Number?rt.toNumber():rt}else g.version=d.longs===String?"0":0;return o.domain!=null&&o.hasOwnProperty("domain")&&(g.domain=o.domain),o.version!=null&&o.hasOwnProperty("version")&&(typeof o.version=="number"?g.version=d.longs===String?String(o.version):o.version:g.version=d.longs===String?et.Long.prototype.toString.call(o.version):d.longs===Number?new et.LongBits(o.version.low>>>0,o.version.high>>>0).toNumber():o.version),g},a.prototype.toJSON=function(){return this.constructor.toObject(this,_.util.toJSONOptions)},a}(),$),i.exports=b},2100:(i,e,s)=>{i.exports=s(9482)},9482:(i,e,s)=>{var c=e;function h(){c.util._configure(),c.Writer._configure(c.BufferWriter),c.Reader._configure(c.BufferReader)}c.build="minimal",c.Writer=s(1173),c.BufferWriter=s(3155),c.Reader=s(1408),c.BufferReader=s(593),c.util=s(9693),c.rpc=s(5994),c.roots=s(5054),c.configure=h,h()},1408:(i,e,s)=>{i.exports=nt;var c,h=s(9693),$=h.LongBits,_=h.utf8;function j(rt,st){return RangeError("index out of range: "+rt.pos+" + "+(st||1)+" > "+rt.len)}function nt(rt){this.buf=rt,this.pos=0,this.len=rt.length}var et,b=typeof Uint8Array<"u"?function(rt){if(rt instanceof Uint8Array||Array.isArray(rt))return new nt(rt);throw Error("illegal buffer")}:function(rt){if(Array.isArray(rt))return new nt(rt);throw Error("illegal buffer")},a=function(){return h.Buffer?function(rt){return(nt.create=function(st){return h.Buffer.isBuffer(st)?new c(st):b(st)})(rt)}:b};function o(){var rt=new $(0,0),st=0;if(!(this.len-this.pos>4)){for(;st<3;++st){if(this.pos>=this.len)throw j(this);if(rt.lo=(rt.lo|(127&this.buf[this.pos])<<7*st)>>>0,this.buf[this.pos++]<128)return rt}return rt.lo=(rt.lo|(127&this.buf[this.pos++])<<7*st)>>>0,rt}for(;st<4;++st)if(rt.lo=(rt.lo|(127&this.buf[this.pos])<<7*st)>>>0,this.buf[this.pos++]<128)return rt;if(rt.lo=(rt.lo|(127&this.buf[this.pos])<<28)>>>0,rt.hi=(rt.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return rt;if(st=0,this.len-this.pos>4){for(;st<5;++st)if(rt.hi=(rt.hi|(127&this.buf[this.pos])<<7*st+3)>>>0,this.buf[this.pos++]<128)return rt}else for(;st<5;++st){if(this.pos>=this.len)throw j(this);if(rt.hi=(rt.hi|(127&this.buf[this.pos])<<7*st+3)>>>0,this.buf[this.pos++]<128)return rt}throw Error("invalid varint encoding")}function d(rt,st){return(rt[st-4]|rt[st-3]<<8|rt[st-2]<<16|rt[st-1]<<24)>>>0}function g(){if(this.pos+8>this.len)throw j(this,8);return new $(d(this.buf,this.pos+=4),d(this.buf,this.pos+=4))}nt.create=a(),nt.prototype._slice=h.Array.prototype.subarray||h.Array.prototype.slice,nt.prototype.uint32=(et=4294967295,function(){if(et=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128||(et=(et|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)||(et=(et|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)||(et=(et|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)||(et=(et|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128))return et;if((this.pos+=5)>this.len)throw this.pos=this.len,j(this,10);return et}),nt.prototype.int32=function(){return 0|this.uint32()},nt.prototype.sint32=function(){var rt=this.uint32();return rt>>>1^-(1&rt)|0},nt.prototype.bool=function(){return this.uint32()!==0},nt.prototype.fixed32=function(){if(this.pos+4>this.len)throw j(this,4);return d(this.buf,this.pos+=4)},nt.prototype.sfixed32=function(){if(this.pos+4>this.len)throw j(this,4);return 0|d(this.buf,this.pos+=4)},nt.prototype.float=function(){if(this.pos+4>this.len)throw j(this,4);var rt=h.float.readFloatLE(this.buf,this.pos);return this.pos+=4,rt},nt.prototype.double=function(){if(this.pos+8>this.len)throw j(this,4);var rt=h.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,rt},nt.prototype.bytes=function(){var rt=this.uint32(),st=this.pos,tt=this.pos+rt;if(tt>this.len)throw j(this,rt);return this.pos+=rt,Array.isArray(this.buf)?this.buf.slice(st,tt):st===tt?new this.buf.constructor(0):this._slice.call(this.buf,st,tt)},nt.prototype.string=function(){var rt=this.bytes();return _.read(rt,0,rt.length)},nt.prototype.skip=function(rt){if(typeof rt=="number"){if(this.pos+rt>this.len)throw j(this,rt);this.pos+=rt}else do if(this.pos>=this.len)throw j(this);while(128&this.buf[this.pos++]);return this},nt.prototype.skipType=function(rt){switch(rt){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(rt=7&this.uint32())!=4;)this.skipType(rt);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+rt+" at offset "+this.pos)}return this},nt._configure=function(rt){c=rt,nt.create=a(),c._configure();var st=h.Long?"toLong":"toNumber";h.merge(nt.prototype,{int64:function(){return o.call(this)[st](!1)},uint64:function(){return o.call(this)[st](!0)},sint64:function(){return o.call(this).zzDecode()[st](!1)},fixed64:function(){return g.call(this)[st](!0)},sfixed64:function(){return g.call(this)[st](!1)}})}},593:(i,e,s)=>{i.exports=$;var c=s(1408);($.prototype=Object.create(c.prototype)).constructor=$;var h=s(9693);function $(_){c.call(this,_)}$._configure=function(){h.Buffer&&($.prototype._slice=h.Buffer.prototype.slice)},$.prototype.string=function(){var _=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+_,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+_,this.len))},$._configure()},5054:i=>{i.exports={}},5994:(i,e,s)=>{e.Service=s(7948)},7948:(i,e,s)=>{i.exports=h;var c=s(9693);function h($,_,j){if(typeof $!="function")throw TypeError("rpcImpl must be a function");c.EventEmitter.call(this),this.rpcImpl=$,this.requestDelimited=!!_,this.responseDelimited=!!j}(h.prototype=Object.create(c.EventEmitter.prototype)).constructor=h,h.prototype.rpcCall=function $(_,j,nt,et,b){if(!et)throw TypeError("request must be specified");var a=this;if(!b)return c.asPromise($,a,_,j,nt,et);if(a.rpcImpl)try{return a.rpcImpl(_,j[a.requestDelimited?"encodeDelimited":"encode"](et).finish(),function(o,d){if(o)return a.emit("error",o,_),b(o);if(d!==null){if(!(d instanceof nt))try{d=nt[a.responseDelimited?"decodeDelimited":"decode"](d)}catch(g){return a.emit("error",g,_),b(g)}return a.emit("data",d,_),b(null,d)}a.end(!0)})}catch(o){return a.emit("error",o,_),void setTimeout(function(){b(o)},0)}else setTimeout(function(){b(Error("already ended"))},0)},h.prototype.end=function($){return this.rpcImpl&&($||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},1945:(i,e,s)=>{i.exports=h;var c=s(9693);function h(nt,et){this.lo=nt>>>0,this.hi=et>>>0}var $=h.zero=new h(0,0);$.toNumber=function(){return 0},$.zzEncode=$.zzDecode=function(){return this},$.length=function(){return 1};var _=h.zeroHash="\0\0\0\0\0\0\0\0";h.fromNumber=function(nt){if(nt===0)return $;var et=nt<0;et&&(nt=-nt);var b=nt>>>0,a=(nt-b)/4294967296>>>0;return et&&(a=~a>>>0,b=~b>>>0,++b>4294967295&&(b=0,++a>4294967295&&(a=0))),new h(b,a)},h.from=function(nt){if(typeof nt=="number")return h.fromNumber(nt);if(c.isString(nt)){if(!c.Long)return h.fromNumber(parseInt(nt,10));nt=c.Long.fromString(nt)}return nt.low||nt.high?new h(nt.low>>>0,nt.high>>>0):$},h.prototype.toNumber=function(nt){if(!nt&&this.hi>>>31){var et=1+~this.lo>>>0,b=~this.hi>>>0;return et||(b=b+1>>>0),-(et+4294967296*b)}return this.lo+4294967296*this.hi},h.prototype.toLong=function(nt){return c.Long?new c.Long(0|this.lo,0|this.hi,!!nt):{low:0|this.lo,high:0|this.hi,unsigned:!!nt}};var j=String.prototype.charCodeAt;h.fromHash=function(nt){return nt===_?$:new h((j.call(nt,0)|j.call(nt,1)<<8|j.call(nt,2)<<16|j.call(nt,3)<<24)>>>0,(j.call(nt,4)|j.call(nt,5)<<8|j.call(nt,6)<<16|j.call(nt,7)<<24)>>>0)},h.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)},h.prototype.zzEncode=function(){var nt=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^nt)>>>0,this.lo=(this.lo<<1^nt)>>>0,this},h.prototype.zzDecode=function(){var nt=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^nt)>>>0,this.hi=(this.hi>>>1^nt)>>>0,this},h.prototype.length=function(){var nt=this.lo,et=(this.lo>>>28|this.hi<<4)>>>0,b=this.hi>>>24;return b===0?et===0?nt<16384?nt<128?1:2:nt<2097152?3:4:et<16384?et<128?5:6:et<2097152?7:8:b<128?9:10}},9693:function(i,e,s){var c=e;function h(_,j,nt){for(var et=Object.keys(j),b=0;b<et.length;++b)_[et[b]]!==void 0&&nt||(_[et[b]]=j[et[b]]);return _}function $(_){function j(nt,et){if(!(this instanceof j))return new j(nt,et);Object.defineProperty(this,"message",{get:function(){return nt}}),Error.captureStackTrace?Error.captureStackTrace(this,j):Object.defineProperty(this,"stack",{value:new Error().stack||""}),et&&h(this,et)}return(j.prototype=Object.create(Error.prototype)).constructor=j,Object.defineProperty(j.prototype,"name",{get:function(){return _}}),j.prototype.toString=function(){return this.name+": "+this.message},j}c.asPromise=s(4537),c.base64=s(7419),c.EventEmitter=s(9211),c.float=s(945),c.inquire=s(7199),c.utf8=s(4997),c.pool=s(6662),c.LongBits=s(1945),c.isNode=!!(s.g!==void 0&&s.g&&s.g.process&&s.g.process.versions&&s.g.process.versions.node),c.global=c.isNode&&s.g||typeof window<"u"&&window||typeof self<"u"&&self||this,c.emptyArray=Object.freeze?Object.freeze([]):[],c.emptyObject=Object.freeze?Object.freeze({}):{},c.isInteger=Number.isInteger||function(_){return typeof _=="number"&&isFinite(_)&&Math.floor(_)===_},c.isString=function(_){return typeof _=="string"||_ instanceof String},c.isObject=function(_){return _&&typeof _=="object"},c.isset=c.isSet=function(_,j){var nt=_[j];return!(nt==null||!_.hasOwnProperty(j))&&(typeof nt!="object"||(Array.isArray(nt)?nt.length:Object.keys(nt).length)>0)},c.Buffer=function(){try{var _=c.inquire("buffer").Buffer;return _.prototype.utf8Write?_:null}catch{return null}}(),c._Buffer_from=null,c._Buffer_allocUnsafe=null,c.newBuffer=function(_){return typeof _=="number"?c.Buffer?c._Buffer_allocUnsafe(_):new c.Array(_):c.Buffer?c._Buffer_from(_):typeof Uint8Array>"u"?_:new Uint8Array(_)},c.Array=typeof Uint8Array<"u"?Uint8Array:Array,c.Long=c.global.dcodeIO&&c.global.dcodeIO.Long||c.global.Long||c.inquire("long"),c.key2Re=/^true|false|0|1$/,c.key32Re=/^-?(?:0|[1-9][0-9]*)$/,c.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,c.longToHash=function(_){return _?c.LongBits.from(_).toHash():c.LongBits.zeroHash},c.longFromHash=function(_,j){var nt=c.LongBits.fromHash(_);return c.Long?c.Long.fromBits(nt.lo,nt.hi,j):nt.toNumber(!!j)},c.merge=h,c.lcFirst=function(_){return _.charAt(0).toLowerCase()+_.substring(1)},c.newError=$,c.ProtocolError=$("ProtocolError"),c.oneOfGetter=function(_){for(var j={},nt=0;nt<_.length;++nt)j[_[nt]]=1;return function(){for(var et=Object.keys(this),b=et.length-1;b>-1;--b)if(j[et[b]]===1&&this[et[b]]!==void 0&&this[et[b]]!==null)return et[b]}},c.oneOfSetter=function(_){return function(j){for(var nt=0;nt<_.length;++nt)_[nt]!==j&&delete this[_[nt]]}},c.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},c._configure=function(){var _=c.Buffer;_?(c._Buffer_from=_.from!==Uint8Array.from&&_.from||function(j,nt){return new _(j,nt)},c._Buffer_allocUnsafe=_.allocUnsafe||function(j){return new _(j)}):c._Buffer_from=c._Buffer_allocUnsafe=null}},1173:(i,e,s)=>{i.exports=a;var c,h=s(9693),$=h.LongBits,_=h.base64,j=h.utf8;function nt(ot,it,at){this.fn=ot,this.len=it,this.next=void 0,this.val=at}function et(){}function b(ot){this.head=ot.head,this.tail=ot.tail,this.len=ot.len,this.next=ot.states}function a(){this.len=0,this.head=new nt(et,0,0),this.tail=this.head,this.states=null}var o=function(){return h.Buffer?function(){return(a.create=function(){return new c})()}:function(){return new a}};function d(ot,it,at){it[at]=255&ot}function g(ot,it){this.len=ot,this.next=void 0,this.val=it}function rt(ot,it,at){for(;ot.hi;)it[at++]=127&ot.lo|128,ot.lo=(ot.lo>>>7|ot.hi<<25)>>>0,ot.hi>>>=7;for(;ot.lo>127;)it[at++]=127&ot.lo|128,ot.lo=ot.lo>>>7;it[at++]=ot.lo}function st(ot,it,at){it[at]=255&ot,it[at+1]=ot>>>8&255,it[at+2]=ot>>>16&255,it[at+3]=ot>>>24}a.create=o(),a.alloc=function(ot){return new h.Array(ot)},h.Array!==Array&&(a.alloc=h.pool(a.alloc,h.Array.prototype.subarray)),a.prototype._push=function(ot,it,at){return this.tail=this.tail.next=new nt(ot,it,at),this.len+=it,this},g.prototype=Object.create(nt.prototype),g.prototype.fn=function(ot,it,at){for(;ot>127;)it[at++]=127&ot|128,ot>>>=7;it[at]=ot},a.prototype.uint32=function(ot){return this.len+=(this.tail=this.tail.next=new g((ot>>>=0)<128?1:ot<16384?2:ot<2097152?3:ot<268435456?4:5,ot)).len,this},a.prototype.int32=function(ot){return ot<0?this._push(rt,10,$.fromNumber(ot)):this.uint32(ot)},a.prototype.sint32=function(ot){return this.uint32((ot<<1^ot>>31)>>>0)},a.prototype.uint64=function(ot){var it=$.from(ot);return this._push(rt,it.length(),it)},a.prototype.int64=a.prototype.uint64,a.prototype.sint64=function(ot){var it=$.from(ot).zzEncode();return this._push(rt,it.length(),it)},a.prototype.bool=function(ot){return this._push(d,1,ot?1:0)},a.prototype.fixed32=function(ot){return this._push(st,4,ot>>>0)},a.prototype.sfixed32=a.prototype.fixed32,a.prototype.fixed64=function(ot){var it=$.from(ot);return this._push(st,4,it.lo)._push(st,4,it.hi)},a.prototype.sfixed64=a.prototype.fixed64,a.prototype.float=function(ot){return this._push(h.float.writeFloatLE,4,ot)},a.prototype.double=function(ot){return this._push(h.float.writeDoubleLE,8,ot)};var tt=h.Array.prototype.set?function(ot,it,at){it.set(ot,at)}:function(ot,it,at){for(var ut=0;ut<ot.length;++ut)it[at+ut]=ot[ut]};a.prototype.bytes=function(ot){var it=ot.length>>>0;if(!it)return this._push(d,1,0);if(h.isString(ot)){var at=a.alloc(it=_.length(ot));_.decode(ot,at,0),ot=at}return this.uint32(it)._push(tt,it,ot)},a.prototype.string=function(ot){var it=j.length(ot);return it?this.uint32(it)._push(j.write,it,ot):this._push(d,1,0)},a.prototype.fork=function(){return this.states=new b(this),this.head=this.tail=new nt(et,0,0),this.len=0,this},a.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 nt(et,0,0),this.len=0),this},a.prototype.ldelim=function(){var ot=this.head,it=this.tail,at=this.len;return this.reset().uint32(at),at&&(this.tail.next=ot.next,this.tail=it,this.len+=at),this},a.prototype.finish=function(){for(var ot=this.head.next,it=this.constructor.alloc(this.len),at=0;ot;)ot.fn(ot.val,it,at),at+=ot.len,ot=ot.next;return it},a._configure=function(ot){c=ot,a.create=o(),c._configure()}},3155:(i,e,s)=>{i.exports=$;var c=s(1173);($.prototype=Object.create(c.prototype)).constructor=$;var h=s(9693);function $(){c.call(this)}function _(j,nt,et){j.length<40?h.utf8.write(j,nt,et):nt.utf8Write?nt.utf8Write(j,et):nt.write(j,et)}$._configure=function(){$.alloc=h._Buffer_allocUnsafe,$.writeBytesBuffer=h.Buffer&&h.Buffer.prototype instanceof Uint8Array&&h.Buffer.prototype.set.name==="set"?function(j,nt,et){nt.set(j,et)}:function(j,nt,et){if(j.copy)j.copy(nt,et,0,j.length);else for(var b=0;b<j.length;)nt[et++]=j[b++]}},$.prototype.bytes=function(j){h.isString(j)&&(j=h._Buffer_from(j,"base64"));var nt=j.length>>>0;return this.uint32(nt),nt&&this._push($.writeBytesBuffer,nt,j),this},$.prototype.string=function(j){var nt=h.Buffer.byteLength(j);return this.uint32(nt),nt&&this._push(_,nt,j),this},$._configure()},7714:(i,e,s)=>{e.R=void 0;const c=s(6919),h=s(7448);e.R=new class{async init(){}async createSessionHandler($,_){const j=new c.Session(_);return await j.loadModel($),new h.OnnxjsSessionHandler(j)}}},4200:(i,e,s)=>{e.c8=e.rX=void 0;const c=s(1670),h=s(5381),$=s(2157),_=s(2306);e.rX=()=>{if((typeof c.env.wasm.initTimeout!="number"||c.env.wasm.initTimeout<0)&&(c.env.wasm.initTimeout=0),typeof c.env.wasm.simd!="boolean"&&(c.env.wasm.simd=!0),typeof c.env.wasm.proxy!="boolean"&&(c.env.wasm.proxy=!1),typeof c.env.wasm.numThreads!="number"||!Number.isInteger(c.env.wasm.numThreads)||c.env.wasm.numThreads<=0){const j=typeof navigator>"u"?(0,h.cpus)().length:navigator.hardwareConcurrency;c.env.wasm.numThreads=Math.min(4,Math.ceil((j||1)/2))}},e.c8=new class{async init(){(0,e.rX)(),await(0,$.initWasm)()}async createSessionHandler(j,nt){const et=new _.OnnxruntimeWebAssemblySessionHandler;return await et.loadModel(j,nt),Promise.resolve(et)}}},6018:function(i,e,s){var c=this&&this.__createBinding||(Object.create?function(_,j,nt,et){et===void 0&&(et=nt);var b=Object.getOwnPropertyDescriptor(j,nt);b&&!("get"in b?!j.__esModule:b.writable||b.configurable)||(b={enumerable:!0,get:function(){return j[nt]}}),Object.defineProperty(_,et,b)}:function(_,j,nt,et){et===void 0&&(et=nt),_[et]=j[nt]}),h=this&&this.__exportStar||function(_,j){for(var nt in _)nt==="default"||Object.prototype.hasOwnProperty.call(j,nt)||c(j,_,nt)};Object.defineProperty(e,"__esModule",{value:!0}),h(s(1670),e);const $=s(1670);{const _=s(7714).R;(0,$.registerBackend)("webgl",_,-10)}{const _=s(4200).c8;(0,$.registerBackend)("cpu",_,10),(0,$.registerBackend)("wasm",_,10),(0,$.registerBackend)("xnnpack",_,9)}},246:(i,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createAttributeWithCacheKey=void 0;class s{constructor(h){Object.assign(this,h)}get cacheKey(){return this._cacheKey||(this._cacheKey=Object.getOwnPropertyNames(this).sort().map(h=>`${this[h]}`).join(";")),this._cacheKey}}e.createAttributeWithCacheKey=c=>new s(c)},7778:(i,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Attribute=void 0;const c=s(1446),h=s(9395),$=s(9162),_=s(2517);var j=h.onnxruntime.experimental.fbs;class nt{constructor(b){if(this._attributes=new Map,b!=null){for(const a of b)a instanceof c.onnx.AttributeProto?this._attributes.set(a.name,[nt.getValue(a),nt.getType(a)]):a instanceof j.Attribute&&this._attributes.set(a.name(),[nt.getValue(a),nt.getType(a)]);if(this._attributes.size<b.length)throw new Error("duplicated attribute names")}}set(b,a,o){this._attributes.set(b,[o,a])}delete(b){this._attributes.delete(b)}getFloat(b,a){return this.get(b,"float",a)}getInt(b,a){return this.get(b,"int",a)}getString(b,a){return this.get(b,"string",a)}getTensor(b,a){return this.get(b,"tensor",a)}getFloats(b,a){return this.get(b,"floats",a)}getInts(b,a){return this.get(b,"ints",a)}getStrings(b,a){return this.get(b,"strings",a)}getTensors(b,a){return this.get(b,"tensors",a)}get(b,a,o){const d=this._attributes.get(b);if(d===void 0){if(o!==void 0)return o;throw new Error(`required attribute not found: ${b}`)}if(d[1]!==a)throw new Error(`type mismatch: expected ${a} but got ${d[1]}`);return d[0]}static getType(b){const a=b instanceof c.onnx.AttributeProto?b.type:b.type();switch(a){case c.onnx.AttributeProto.AttributeType.FLOAT:return"float";case c.onnx.AttributeProto.AttributeType.INT:return"int";case c.onnx.AttributeProto.AttributeType.STRING:return"string";case c.onnx.AttributeProto.AttributeType.TENSOR:return"tensor";case c.onnx.AttributeProto.AttributeType.FLOATS:return"floats";case c.onnx.AttributeProto.AttributeType.INTS:return"ints";case c.onnx.AttributeProto.AttributeType.STRINGS:return"strings";case c.onnx.AttributeProto.AttributeType.TENSORS:return"tensors";default:throw new Error(`attribute type is not supported yet: ${c.onnx.AttributeProto.AttributeType[a]}`)}}static getValue(b){const a=b instanceof c.onnx.AttributeProto?b.type:b.type();if(a===c.onnx.AttributeProto.AttributeType.GRAPH||a===c.onnx.AttributeProto.AttributeType.GRAPHS)throw new Error("graph attribute is not supported yet");const o=this.getValueNoCheck(b);if(a===c.onnx.AttributeProto.AttributeType.INT&&_.LongUtil.isLong(o))return _.LongUtil.longToNumber(o);if(a===c.onnx.AttributeProto.AttributeType.INTS){const d=o,g=new Array(d.length);for(let rt=0;rt<d.length;rt++){const st=d[rt];g[rt]=_.LongUtil.longToNumber(st)}return g}if(a===c.onnx.AttributeProto.AttributeType.TENSOR)return b instanceof c.onnx.AttributeProto?$.Tensor.fromProto(o):$.Tensor.fromOrtTensor(o);if(a===c.onnx.AttributeProto.AttributeType.TENSORS){if(b instanceof c.onnx.AttributeProto)return o.map(d=>$.Tensor.fromProto(d));if(b instanceof j.Attribute)return o.map(d=>$.Tensor.fromOrtTensor(d))}if(a===c.onnx.AttributeProto.AttributeType.STRING&&b instanceof c.onnx.AttributeProto){const d=o;return(0,_.decodeUtf8String)(d)}return a===c.onnx.AttributeProto.AttributeType.STRINGS&&b instanceof c.onnx.AttributeProto?o.map(_.decodeUtf8String):o}static getValueNoCheck(b){return b instanceof c.onnx.AttributeProto?this.getValueNoCheckFromOnnxFormat(b):this.getValueNoCheckFromOrtFormat(b)}static getValueNoCheckFromOnnxFormat(b){switch(b.type){case c.onnx.AttributeProto.AttributeType.FLOAT:return b.f;case c.onnx.AttributeProto.AttributeType.INT:return b.i;case c.onnx.AttributeProto.AttributeType.STRING:return b.s;case c.onnx.AttributeProto.AttributeType.TENSOR:return b.t;case c.onnx.AttributeProto.AttributeType.GRAPH:return b.g;case c.onnx.AttributeProto.AttributeType.FLOATS:return b.floats;case c.onnx.AttributeProto.AttributeType.INTS:return b.ints;case c.onnx.AttributeProto.AttributeType.STRINGS:return b.strings;case c.onnx.AttributeProto.AttributeType.TENSORS:return b.tensors;case c.onnx.AttributeProto.AttributeType.GRAPHS:return b.graphs;default:throw new Error(`unsupported attribute type: ${c.onnx.AttributeProto.AttributeType[b.type]}`)}}static getValueNoCheckFromOrtFormat(b){switch(b.type()){case j.AttributeType.FLOAT:return b.f();case j.AttributeType.INT:return b.i();case j.AttributeType.STRING:return b.s();case j.AttributeType.TENSOR:return b.t();case j.AttributeType.GRAPH:return b.g();case j.AttributeType.FLOATS:return b.floatsArray();case j.AttributeType.INTS:{const a=[];for(let o=0;o<b.intsLength();o++)a.push(b.ints(o));return a}case j.AttributeType.STRINGS:{const a=[];for(let o=0;o<b.stringsLength();o++)a.push(b.strings(o));return a}case j.AttributeType.TENSORS:{const a=[];for(let o=0;o<b.tensorsLength();o++)a.push(b.tensors(o));return a}default:throw new Error(`unsupported attribute type: ${j.AttributeType[b.type()]}`)}}}e.Attribute=nt},7091:(i,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.resolveBackend=e.backend=void 0;const c=s(5038),h=new Map;async function $(_){const j=e.backend;if(j[_]!==void 0&&function(nt){const et=nt;return"initialize"in et&&typeof et.initialize=="function"&&"createSessionHandler"in et&&typeof et.createSessionHandler=="function"&&"dispose"in et&&typeof et.dispose=="function"}(j[_])){const nt=j[_];let et=nt.initialize();if(typeof et=="object"&&"then"in et&&(et=await et),et)return h.set(_,nt),nt}}e.backend={webgl:new c.WebGLBackend},e.resolveBackend=async function _(j){if(!j)return _(["webgl"]);{const nt=typeof j=="string"?[j]:j;for(const et of nt){const b=h.get(et);if(b)return b;const a=await $(et);if(a)return a}}throw new Error("no available backend to use")}},5038:(i,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WebGLBackend=void 0;const c=s(1670),h=s(6231),$=s(6416),_=s(7305);e.WebGLBackend=class{get contextId(){return c.env.webgl.contextId}set contextId(j){c.env.webgl.contextId=j}get matmulMaxBatchSize(){return c.env.webgl.matmulMaxBatchSize}set matmulMaxBatchSize(j){c.env.webgl.matmulMaxBatchSize=j}get textureCacheMode(){return c.env.webgl.textureCacheMode}set textureCacheMode(j){c.env.webgl.textureCacheMode=j}get pack(){return c.env.webgl.pack}set pack(j){c.env.webgl.pack=j}get async(){return c.env.webgl.async}set async(j){c.env.webgl.async=j}initialize(){try{return this.glContext=(0,_.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),h.Logger.setWithEnv(c.env),h.Logger.verbose("WebGLBackend",`Created WebGLContext: ${typeof this.glContext} with matmulMaxBatchSize: ${this.matmulMaxBatchSize}; textureCacheMode: ${this.textureCacheMode}; pack: ${this.pack}; async: ${this.async}.`),!0}catch(j){return h.Logger.warning("WebGLBackend",`Unable to initialize WebGLBackend. ${j}`),!1}}createSessionHandler(j){return new $.WebGLSessionHandler(this,j)}dispose(){this.glContext.dispose()}}},5107:(i,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CoordsGlslLib=void 0;const c=s(2517),h=s(8520),$=s(5060),_=s(7859),j=s(9390);class nt extends h.GlslLib{constructor(b){super(b)}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 h.GlslLibRoutine(`
|
|
68
|
+
`));var $t,At=a.print||Tt,Ot=a.printErr||vt;Object.assign(a,at),at=null,a.thisProgram&&(ut=a.thisProgram),a.quit&&(lt=a.quit),a.wasmBinary&&($t=a.wasmBinary);var It=a.noExitRuntime||!1;typeof WebAssembly!="object"&&_n("no native wasm support detected");var jt,Et,mt,gt,ht,pt,_t,Ct,zt=!1,Nt=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function Ht(wt,Rt,Bt){var qt=(Rt>>>=0)+Bt;for(Bt=Rt;wt[Bt]&&!(Bt>=qt);)++Bt;if(16<Bt-Rt&&wt.buffer&&Nt)return Nt.decode(wt.buffer instanceof SharedArrayBuffer?wt.slice(Rt,Bt):wt.subarray(Rt,Bt));for(qt="";Rt<Bt;){var tn=wt[Rt++];if(128&tn){var cn=63&wt[Rt++];if((224&tn)==192)qt+=String.fromCharCode((31&tn)<<6|cn);else{var An=63&wt[Rt++];65536>(tn=(240&tn)==224?(15&tn)<<12|cn<<6|An:(7&tn)<<18|cn<<12|An<<6|63&wt[Rt++])?qt+=String.fromCharCode(tn):(tn-=65536,qt+=String.fromCharCode(55296|tn>>10,56320|1023&tn))}}else qt+=String.fromCharCode(tn)}return qt}function Jt(wt,Rt){return(wt>>>=0)?Ht(j(),wt,Rt):""}function un(wt,Rt,Bt,qt){if(!(0<qt))return 0;var tn=Bt>>>=0;qt=Bt+qt-1;for(var cn=0;cn<wt.length;++cn){var An=wt.charCodeAt(cn);if(55296<=An&&57343>=An&&(An=65536+((1023&An)<<10)|1023&wt.charCodeAt(++cn)),127>=An){if(Bt>=qt)break;Rt[Bt++>>>0]=An}else{if(2047>=An){if(Bt+1>=qt)break;Rt[Bt++>>>0]=192|An>>6}else{if(65535>=An){if(Bt+2>=qt)break;Rt[Bt++>>>0]=224|An>>12}else{if(Bt+3>=qt)break;Rt[Bt++>>>0]=240|An>>18,Rt[Bt++>>>0]=128|An>>12&63}Rt[Bt++>>>0]=128|An>>6&63}Rt[Bt++>>>0]=128|63&An}}return Rt[Bt>>>0]=0,Bt-tn}function yn(wt){for(var Rt=0,Bt=0;Bt<wt.length;++Bt){var qt=wt.charCodeAt(Bt);127>=qt?Rt++:2047>=qt?Rt+=2:55296<=qt&&57343>=qt?(Rt+=4,++Bt):Rt+=3}return Rt}function vn(wt){mt=wt,a.HEAP8=gt=new Int8Array(wt),a.HEAP16=new Int16Array(wt),a.HEAP32=pt=new Int32Array(wt),a.HEAPU8=ht=new Uint8Array(wt),a.HEAPU16=new Uint16Array(wt),a.HEAPU32=_t=new Uint32Array(wt),a.HEAPF32=new Float32Array(wt),a.HEAPF64=Ct=new Float64Array(wt)}yt&&(mt=a.buffer);var mn=a.INITIAL_MEMORY||16777216;if(yt)jt=a.wasmMemory,mt=a.buffer;else if(a.wasmMemory)jt=a.wasmMemory;else if(!((jt=new WebAssembly.Memory({initial:mn/65536,maximum:65536,shared:!0})).buffer instanceof SharedArrayBuffer))throw Ot("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"),dt&&console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)"),Error("bad memory");jt&&(mt=jt.buffer),mn=mt.byteLength,vn(mt);var Tn,kn=[],Gn=[],wr=[],xt=[];function kt(){return It||!1}function wn(){var wt=a.preRun.shift();kn.unshift(wt)}var bn,Dn=0,Rn=null;function _n(wt){throw yt?postMessage({cmd:"onAbort",arg:wt}):a.onAbort&&a.onAbort(wt),Ot(wt="Aborted("+wt+")"),zt=!0,wt=new WebAssembly.RuntimeError(wt+". Build with -sASSERTIONS for more info."),d(wt),wt}function On(){return bn.startsWith("data:application/octet-stream;base64,")}function Ln(){var wt=bn;try{if(wt==bn&&$t)return new Uint8Array($t);if(st)return st(wt);throw"both async and sync fetching of the wasm failed"}catch(Rt){_n(Rt)}}bn="ort-wasm-threaded.wasm",On()||(bn=bt(bn));var Nn={};function Sn(wt){this.name="ExitStatus",this.message="Program terminated with exit("+wt+")",this.status=wt}function qn(wt){(wt=Lt.Vb[wt])||_n(),Lt.mc(wt)}function gr(wt){var Rt=Lt.Cc();if(!Rt)return 6;Lt.ac.push(Rt),Lt.Vb[wt.Ub]=Rt,Rt.Ub=wt.Ub;var Bt={cmd:"run",start_routine:wt.Ic,arg:wt.zc,pthread_ptr:wt.Ub};return Rt.$b=()=>{Bt.time=performance.now(),Rt.postMessage(Bt,wt.Nc)},Rt.loaded&&(Rt.$b(),delete Rt.$b),0}function Pt(wt){if(yt)return $n(1,1,wt);kt()||(Lt.oc(),a.onExit&&a.onExit(wt),zt=!0),lt(wt,new Sn(wt))}function Dt(wt,Rt){if(!Rt&&yt)throw Ft(wt),"unwind";kt()||yt||(Yr(),Ut(wr),Cr(0),Br[1].length&&Vr(1,10),Br[2].length&&Vr(2,10),Lt.oc()),Pt(wt)}var Lt={Yb:[],ac:[],qc:[],Vb:{},fc:function(){yt&&Lt.Ec()},Pc:function(){},Ec:function(){Lt.receiveObjectTransfer=Lt.Gc,Lt.threadInitTLS=Lt.pc,Lt.setExitStatus=Lt.nc,It=!1},nc:function(){},oc:function(){for(var wt of Object.values(Lt.Vb))Lt.mc(wt);for(wt of Lt.Yb)wt.terminate();Lt.Yb=[]},mc:function(wt){var Rt=wt.Ub;delete Lt.Vb[Rt],Lt.Yb.push(wt),Lt.ac.splice(Lt.ac.indexOf(wt),1),wt.Ub=0,eo(Rt)},Gc:function(){},pc:function(){Lt.qc.forEach(wt=>wt())},Fc:function(wt,Rt){wt.onmessage=Bt=>{var qt=(Bt=Bt.data).cmd;if(wt.Ub&&(Lt.Bc=wt.Ub),Bt.targetThread&&Bt.targetThread!=Mr()){var tn=Lt.Vb[Bt.Qc];tn?tn.postMessage(Bt,Bt.transferList):Ot('Internal error! Worker sent a message "'+qt+'" to target pthread '+Bt.targetThread+", but that thread no longer exists!")}else qt==="processProxyingQueue"?Gt(Bt.queue):qt==="spawnThread"?gr(Bt):qt==="cleanupThread"?qn(Bt.thread):qt==="killThread"?(Bt=Bt.thread,qt=Lt.Vb[Bt],delete Lt.Vb[Bt],qt.terminate(),eo(Bt),Lt.ac.splice(Lt.ac.indexOf(qt),1),qt.Ub=0):qt==="cancelThread"?Lt.Vb[Bt.thread].postMessage({cmd:"cancel"}):qt==="loaded"?(wt.loaded=!0,Rt&&Rt(wt),wt.$b&&(wt.$b(),delete wt.$b)):qt==="print"?At("Thread "+Bt.threadId+": "+Bt.text):qt==="printErr"?Ot("Thread "+Bt.threadId+": "+Bt.text):qt==="alert"?alert("Thread "+Bt.threadId+": "+Bt.text):Bt.target==="setimmediate"?wt.postMessage(Bt):qt==="onAbort"?a.onAbort&&a.onAbort(Bt.arg):qt&&Ot("worker sent an unknown command "+qt);Lt.Bc=void 0},wt.onerror=Bt=>{throw Ot("worker sent an error! "+Bt.filename+":"+Bt.lineno+": "+Bt.message),Bt},dt&&(wt.on("message",function(Bt){wt.onmessage({data:Bt})}),wt.on("error",function(Bt){wt.onerror(Bt)}),wt.on("detachedExit",function(){})),wt.postMessage({cmd:"load",urlOrBlob:a.mainScriptUrlOrBlob||c,wasmMemory:jt,wasmModule:Et})},yc:function(){var wt=bt("ort-wasm-threaded.worker.js");Lt.Yb.push(new Worker(wt))},Cc:function(){return Lt.Yb.length==0&&(Lt.yc(),Lt.Fc(Lt.Yb[0])),Lt.Yb.pop()}};function Ut(wt){for(;0<wt.length;)wt.shift()(a)}function Kt(wt){var Rt=Yn();return wt=wt(),Wn(Rt),wt}function Ft(wt){if(yt)return $n(2,0,wt);try{Dt(wt)}catch(Rt){Rt instanceof Sn||Rt=="unwind"||lt(1,Rt)}}a.PThread=Lt,a.establishStackSpace=function(){var wt=Mr(),Rt=nt()[wt+44>>2>>>0];wt=nt()[wt+48>>2>>>0],ro(Rt,Rt-wt),Wn(Rt)};var Yt=[];function Wt(wt){var Rt=Yt[wt];return Rt||(wt>=Yt.length&&(Yt.length=wt+1),Yt[wt]=Rt=Tn.get(wt)),Rt}a.invokeEntryPoint=function(wt,Rt){wt=Wt(wt)(Rt),kt()?Lt.nc(wt):no(wt)};var Xt,sn,en=[],Qt=0,ln=0;function gn(wt){this.Zb=wt,this.Sb=wt-24,this.xc=function(Rt){et()[this.Sb+4>>2>>>0]=Rt},this.bc=function(){return et()[this.Sb+4>>2>>>0]},this.wc=function(Rt){et()[this.Sb+8>>2>>>0]=Rt},this.Dc=function(){return et()[this.Sb+8>>2>>>0]},this.rc=function(){nt()[this.Sb>>2>>>0]=0},this.hc=function(Rt){Rt=Rt?1:0,_()[this.Sb+12>>0>>>0]=Rt},this.uc=function(){return _()[this.Sb+12>>0>>>0]!=0},this.ic=function(Rt){Rt=Rt?1:0,_()[this.Sb+13>>0>>>0]=Rt},this.kc=function(){return _()[this.Sb+13>>0>>>0]!=0},this.fc=function(Rt,Bt){this.cc(0),this.xc(Rt),this.wc(Bt),this.rc(),this.hc(!1),this.ic(!1)},this.sc=function(){Atomics.add(nt(),this.Sb>>2,1)},this.Hc=function(){return Atomics.sub(nt(),this.Sb>>2,1)===1},this.cc=function(Rt){et()[this.Sb+16>>2>>>0]=Rt},this.tc=function(){return et()[this.Sb+16>>2>>>0]},this.vc=function(){if(io(this.bc()))return et()[this.Zb>>2>>>0];var Rt=this.tc();return Rt!==0?Rt:this.Zb}}function dn(wt){return Xr(new gn(wt).Sb)}function Mn(wt,Rt,Bt,qt){return yt?$n(3,1,wt,Rt,Bt,qt):rn(wt,Rt,Bt,qt)}function rn(wt,Rt,Bt,qt){if(typeof SharedArrayBuffer>"u")return Ot("Current environment does not support SharedArrayBuffer, pthreads are not available!"),6;var tn=[];return yt&&tn.length===0?Mn(wt,Rt,Bt,qt):(wt={Ic:Bt,Ub:wt,zc:qt,Nc:tn},yt?(wt.Oc="spawnThread",postMessage(wt,tn),0):gr(wt))}function Pn(wt,Rt,Bt){return yt?$n(4,1,wt,Rt,Bt):0}function zn(wt,Rt){if(yt)return $n(5,1,wt,Rt)}function pn(wt,Rt){if(yt)return $n(6,1,wt,Rt)}function In(wt,Rt,Bt){if(yt)return $n(7,1,wt,Rt,Bt)}function hn(wt,Rt,Bt){return yt?$n(8,1,wt,Rt,Bt):0}function jn(wt,Rt){if(yt)return $n(9,1,wt,Rt)}function pr(wt,Rt,Bt){if(yt)return $n(10,1,wt,Rt,Bt)}function En(wt,Rt,Bt,qt){if(yt)return $n(11,1,wt,Rt,Bt,qt)}function Bn(wt,Rt,Bt,qt){if(yt)return $n(12,1,wt,Rt,Bt,qt)}function Hn(wt,Rt,Bt,qt){if(yt)return $n(13,1,wt,Rt,Bt,qt)}function yr(wt){if(yt)return $n(14,1,wt)}function Mt(wt,Rt){if(yt)return $n(15,1,wt,Rt)}function Vt(wt,Rt,Bt){if(yt)return $n(16,1,wt,Rt,Bt)}function Gt(wt){Atomics.store(nt(),wt>>2,1),Mr()&&zr(wt),Atomics.compareExchange(nt(),wt>>2,1,0)}function Zt(wt){return et()[wt>>>2]+4294967296*nt()[wt+4>>>2]}function nn(wt,Rt,Bt,qt,tn,cn){return yt?$n(17,1,wt,Rt,Bt,qt,tn,cn):-52}function on(wt,Rt,Bt,qt,tn,cn){if(yt)return $n(18,1,wt,Rt,Bt,qt,tn,cn)}function xn(wt){var Rt=yn(wt)+1,Bt=Dr(Rt);return Bt&&un(wt,_(),Bt,Rt),Bt}function Cn(wt,Rt,Bt){function qt(Zn){return(Zn=Zn.toTimeString().match(/\(([A-Za-z ]+)\)$/))?Zn[1]:"GMT"}if(yt)return $n(19,1,wt,Rt,Bt);var tn=new Date().getFullYear(),cn=new Date(tn,0,1),An=new Date(tn,6,1);tn=cn.getTimezoneOffset();var Fn=An.getTimezoneOffset(),Qn=Math.max(tn,Fn);nt()[wt>>2>>>0]=60*Qn,nt()[Rt>>2>>>0]=+(tn!=Fn),wt=qt(cn),Rt=qt(An),wt=xn(wt),Rt=xn(Rt),Fn<tn?(et()[Bt>>2>>>0]=wt,et()[Bt+4>>2>>>0]=Rt):(et()[Bt>>2>>>0]=Rt,et()[Bt+4>>2>>>0]=wt)}function $n(wt,Rt){var Bt=arguments.length-2,qt=arguments;return Kt(()=>{for(var tn=to(8*Bt),cn=tn>>3,An=0;An<Bt;An++){var Fn=qt[2+An];b()[cn+An>>>0]=Fn}return Ur(wt,Bt,tn,Rt)})}a.executeNotifiedProxyingQueue=Gt,sn=dt?()=>{var wt=process.hrtime();return 1e3*wt[0]+wt[1]/1e6}:yt?()=>performance.now()-a.__performance_now_clock_drift:()=>performance.now();var Vn,Jn=[],Tr={};function Er(){if(!Vn){var wt,Rt={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",_:ut||"./this.program"};for(wt in Tr)Tr[wt]===void 0?delete Rt[wt]:Rt[wt]=Tr[wt];var Bt=[];for(wt in Rt)Bt.push(wt+"="+Rt[wt]);Vn=Bt}return Vn}function an(wt,Rt){if(yt)return $n(20,1,wt,Rt);var Bt=0;return Er().forEach(function(qt,tn){var cn=Rt+Bt;for(tn=et()[wt+4*tn>>2>>>0]=cn,cn=0;cn<qt.length;++cn)_()[tn++>>0>>>0]=qt.charCodeAt(cn);_()[tn>>0>>>0]=0,Bt+=qt.length+1}),0}function Xn(wt,Rt){if(yt)return $n(21,1,wt,Rt);var Bt=Er();et()[wt>>2>>>0]=Bt.length;var qt=0;return Bt.forEach(function(tn){qt+=tn.length+1}),et()[Rt>>2>>>0]=qt,0}function Un(wt){return yt?$n(22,1,wt):52}function Pr(wt,Rt,Bt,qt){return yt?$n(23,1,wt,Rt,Bt,qt):52}function Ir(wt,Rt,Bt,qt,tn){return yt?$n(24,1,wt,Rt,Bt,qt,tn):70}var Br=[null,[],[]];function Vr(wt,Rt){var Bt=Br[wt];Rt===0||Rt===10?((wt===1?At:Ot)(Ht(Bt,0)),Bt.length=0):Bt.push(Rt)}function Zr(wt,Rt,Bt,qt){if(yt)return $n(25,1,wt,Rt,Bt,qt);for(var tn=0,cn=0;cn<Bt;cn++){var An=et()[Rt>>2>>>0],Fn=et()[Rt+4>>2>>>0];Rt+=8;for(var Qn=0;Qn<Fn;Qn++)Vr(wt,j()[An+Qn>>>0]);tn+=Fn}return et()[qt>>2>>>0]=tn,0}var Or=0;function Gr(wt){return wt%4==0&&(wt%100!=0||wt%400==0)}var Ar=[31,29,31,30,31,30,31,31,30,31,30,31],qr=[31,28,31,30,31,30,31,31,30,31,30,31];function Wr(wt,Rt,Bt,qt){function tn(fn,dr,xr){for(fn=typeof fn=="number"?fn.toString():fn||"";fn.length<dr;)fn=xr[0]+fn;return fn}function cn(fn,dr){return tn(fn,dr,"0")}function An(fn,dr){function xr(Kr){return 0>Kr?-1:0<Kr?1:0}var Lr;return(Lr=xr(fn.getFullYear()-dr.getFullYear()))===0&&(Lr=xr(fn.getMonth()-dr.getMonth()))===0&&(Lr=xr(fn.getDate()-dr.getDate())),Lr}function Fn(fn){switch(fn.getDay()){case 0:return new Date(fn.getFullYear()-1,11,29);case 1:return fn;case 2:return new Date(fn.getFullYear(),0,3);case 3:return new Date(fn.getFullYear(),0,2);case 4:return new Date(fn.getFullYear(),0,1);case 5:return new Date(fn.getFullYear()-1,11,31);case 6:return new Date(fn.getFullYear()-1,11,30)}}function Qn(fn){var dr=fn.Wb;for(fn=new Date(new Date(fn.Xb+1900,0,1).getTime());0<dr;){var xr=fn.getMonth(),Lr=(Gr(fn.getFullYear())?Ar:qr)[xr];if(!(dr>Lr-fn.getDate())){fn.setDate(fn.getDate()+dr);break}dr-=Lr-fn.getDate()+1,fn.setDate(1),11>xr?fn.setMonth(xr+1):(fn.setMonth(0),fn.setFullYear(fn.getFullYear()+1))}return xr=new Date(fn.getFullYear()+1,0,4),dr=Fn(new Date(fn.getFullYear(),0,4)),xr=Fn(xr),0>=An(dr,fn)?0>=An(xr,fn)?fn.getFullYear()+1:fn.getFullYear():fn.getFullYear()-1}var Zn=nt()[qt+40>>2>>>0];for(var $r in qt={Lc:nt()[qt>>2>>>0],Kc:nt()[qt+4>>2>>>0],dc:nt()[qt+8>>2>>>0],jc:nt()[qt+12>>2>>>0],ec:nt()[qt+16>>2>>>0],Xb:nt()[qt+20>>2>>>0],Tb:nt()[qt+24>>2>>>0],Wb:nt()[qt+28>>2>>>0],Rc:nt()[qt+32>>2>>>0],Jc:nt()[qt+36>>2>>>0],Mc:Zn?Jt(Zn):""},Bt=Jt(Bt),Zn={"%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"})Bt=Bt.replace(new RegExp($r,"g"),Zn[$r]);var jr="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),Rr="January February March April May June July August September October November December".split(" ");for($r in Zn={"%a":function(fn){return jr[fn.Tb].substring(0,3)},"%A":function(fn){return jr[fn.Tb]},"%b":function(fn){return Rr[fn.ec].substring(0,3)},"%B":function(fn){return Rr[fn.ec]},"%C":function(fn){return cn((fn.Xb+1900)/100|0,2)},"%d":function(fn){return cn(fn.jc,2)},"%e":function(fn){return tn(fn.jc,2," ")},"%g":function(fn){return Qn(fn).toString().substring(2)},"%G":function(fn){return Qn(fn)},"%H":function(fn){return cn(fn.dc,2)},"%I":function(fn){return(fn=fn.dc)==0?fn=12:12<fn&&(fn-=12),cn(fn,2)},"%j":function(fn){for(var dr=0,xr=0;xr<=fn.ec-1;dr+=(Gr(fn.Xb+1900)?Ar:qr)[xr++]);return cn(fn.jc+dr,3)},"%m":function(fn){return cn(fn.ec+1,2)},"%M":function(fn){return cn(fn.Kc,2)},"%n":function(){return`
|
|
69
|
+
`},"%p":function(fn){return 0<=fn.dc&&12>fn.dc?"AM":"PM"},"%S":function(fn){return cn(fn.Lc,2)},"%t":function(){return" "},"%u":function(fn){return fn.Tb||7},"%U":function(fn){return cn(Math.floor((fn.Wb+7-fn.Tb)/7),2)},"%V":function(fn){var dr=Math.floor((fn.Wb+7-(fn.Tb+6)%7)/7);if(2>=(fn.Tb+371-fn.Wb-2)%7&&dr++,dr)dr==53&&((xr=(fn.Tb+371-fn.Wb)%7)==4||xr==3&&Gr(fn.Xb)||(dr=1));else{dr=52;var xr=(fn.Tb+7-fn.Wb-1)%7;(xr==4||xr==5&&Gr(fn.Xb%400-1))&&dr++}return cn(dr,2)},"%w":function(fn){return fn.Tb},"%W":function(fn){return cn(Math.floor((fn.Wb+7-(fn.Tb+6)%7)/7),2)},"%y":function(fn){return(fn.Xb+1900).toString().substring(2)},"%Y":function(fn){return fn.Xb+1900},"%z":function(fn){var dr=0<=(fn=fn.Jc);return fn=Math.abs(fn)/60,(dr?"+":"-")+("0000"+(fn/60*100+fn%60)).slice(-4)},"%Z":function(fn){return fn.Mc},"%%":function(){return"%"}},Bt=Bt.replace(/%%/g,"\0\0"),Zn)Bt.includes($r)&&(Bt=Bt.replace(new RegExp($r,"g"),Zn[$r](qt)));return $r=function(fn){var dr=Array(yn(fn)+1);return un(fn,dr,0,dr.length),dr}(Bt=Bt.replace(/\0\0/g,"%")),$r.length>Rt?0:(function(fn,dr){_().set(fn,dr>>>0)}($r,wt),$r.length-1)}Lt.fc();var Jr=[null,Pt,Ft,Mn,Pn,zn,pn,In,hn,jn,pr,En,Bn,Hn,yr,Mt,Vt,nn,on,Cn,an,Xn,Un,Pr,Ir,Zr],kr={b:function(wt){return Dr(wt+24)+24},n:function(wt){return(wt=new gn(wt)).uc()||(wt.hc(!0),Qt--),wt.ic(!1),en.push(wt),wt.sc(),wt.vc()},ma:function(wt){throw Ot("Unexpected exception thrown, this is not properly supported - aborting"),zt=!0,wt},x:function(){Kn(0);var wt=en.pop();if(wt.Hc()&&!wt.kc()){var Rt=wt.Dc();Rt&&Wt(Rt)(wt.Zb),dn(wt.Zb)}ln=0},e:function(){var wt=ln;if(!wt)return Or=0;var Rt=new gn(wt);Rt.cc(wt);var Bt=Rt.bc();if(!Bt)return Or=0,wt;for(var qt=Array.prototype.slice.call(arguments),tn=0;tn<qt.length;tn++){var cn=qt[tn];if(cn===0||cn===Bt)break;if(_i(cn,Bt,Rt.Sb+16))return Or=cn,wt}return Or=Bt,wt},l:function(){var wt=ln;if(!wt)return Or=0;var Rt=new gn(wt);Rt.cc(wt);var Bt=Rt.bc();if(!Bt)return Or=0,wt;for(var qt=Array.prototype.slice.call(arguments),tn=0;tn<qt.length;tn++){var cn=qt[tn];if(cn===0||cn===Bt)break;if(_i(cn,Bt,Rt.Sb+16))return Or=cn,wt}return Or=Bt,wt},h:function(){var wt=ln;if(!wt)return Or=0;var Rt=new gn(wt);Rt.cc(wt);var Bt=Rt.bc();if(!Bt)return Or=0,wt;for(var qt=Array.prototype.slice.call(arguments),tn=0;tn<qt.length;tn++){var cn=qt[tn];if(cn===0||cn===Bt)break;if(_i(cn,Bt,Rt.Sb+16))return Or=cn,wt}return Or=Bt,wt},t:dn,M:function(){var wt=en.pop();wt||_n("no exception to throw");var Rt=wt.Zb;throw wt.kc()||(en.push(wt),wt.ic(!0),wt.hc(!1),Qt++),ln=Rt,Rt},c:function(wt,Rt,Bt){throw new gn(wt).fc(Rt,Bt),ln=wt,Qt++,wt},pa:function(){return Qt},Fa:function(wt){Fr(wt,!ft,1,!ct),Lt.pc()},T:function(wt){yt?postMessage({cmd:"cleanupThread",thread:wt}):qn(wt)},xa:rn,j:function(wt){throw ln||(ln=wt),wt},H:Pn,Ma:zn,ua:pn,wa:In,oa:hn,Ka:jn,Ca:pr,Ja:En,V:Bn,va:Hn,sa:yr,La:Mt,ta:Vt,Ta:function(){},X:function(){_n("To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking")},Ua:function(){_n("To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking")},W:function(){return Date.now()},ya:function(){return 2097152},Oa:function(){return!0},za:function(wt,Rt,Bt,qt){if(wt==Rt)setTimeout(()=>Gt(qt));else if(yt)postMessage({targetThread:wt,cmd:"processProxyingQueue",queue:qt});else{if(!(wt=Lt.Vb[wt]))return;wt.postMessage({cmd:"processProxyingQueue",queue:qt})}return 1},Ea:function(){return-1},Pa:function(wt,Rt){wt=new Date(1e3*Zt(wt)),nt()[Rt>>2>>>0]=wt.getUTCSeconds(),nt()[Rt+4>>2>>>0]=wt.getUTCMinutes(),nt()[Rt+8>>2>>>0]=wt.getUTCHours(),nt()[Rt+12>>2>>>0]=wt.getUTCDate(),nt()[Rt+16>>2>>>0]=wt.getUTCMonth(),nt()[Rt+20>>2>>>0]=wt.getUTCFullYear()-1900,nt()[Rt+24>>2>>>0]=wt.getUTCDay(),wt=(wt.getTime()-Date.UTC(wt.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,nt()[Rt+28>>2>>>0]=wt},Qa:function(wt,Rt){wt=new Date(1e3*Zt(wt)),nt()[Rt>>2>>>0]=wt.getSeconds(),nt()[Rt+4>>2>>>0]=wt.getMinutes(),nt()[Rt+8>>2>>>0]=wt.getHours(),nt()[Rt+12>>2>>>0]=wt.getDate(),nt()[Rt+16>>2>>>0]=wt.getMonth(),nt()[Rt+20>>2>>>0]=wt.getFullYear()-1900,nt()[Rt+24>>2>>>0]=wt.getDay();var Bt=new Date(wt.getFullYear(),0,1),qt=(wt.getTime()-Bt.getTime())/864e5|0;nt()[Rt+28>>2>>>0]=qt,nt()[Rt+36>>2>>>0]=-60*wt.getTimezoneOffset(),qt=new Date(wt.getFullYear(),6,1).getTimezoneOffset(),wt=0|(qt!=(Bt=Bt.getTimezoneOffset())&&wt.getTimezoneOffset()==Math.min(Bt,qt)),nt()[Rt+32>>2>>>0]=wt},Ra:function(wt){var Rt=new Date(nt()[wt+20>>2>>>0]+1900,nt()[wt+16>>2>>>0],nt()[wt+12>>2>>>0],nt()[wt+8>>2>>>0],nt()[wt+4>>2>>>0],nt()[wt>>2>>>0],0),Bt=nt()[wt+32>>2>>>0],qt=Rt.getTimezoneOffset(),tn=new Date(Rt.getFullYear(),0,1),cn=new Date(Rt.getFullYear(),6,1).getTimezoneOffset(),An=tn.getTimezoneOffset(),Fn=Math.min(An,cn);return 0>Bt?nt()[wt+32>>2>>>0]=+(cn!=An&&Fn==qt):0<Bt!=(Fn==qt)&&(cn=Math.max(An,cn),Rt.setTime(Rt.getTime()+6e4*((0<Bt?Fn:cn)-qt))),nt()[wt+24>>2>>>0]=Rt.getDay(),Bt=(Rt.getTime()-tn.getTime())/864e5|0,nt()[wt+28>>2>>>0]=Bt,nt()[wt>>2>>>0]=Rt.getSeconds(),nt()[wt+4>>2>>>0]=Rt.getMinutes(),nt()[wt+8>>2>>>0]=Rt.getHours(),nt()[wt+12>>2>>>0]=Rt.getDate(),nt()[wt+16>>2>>>0]=Rt.getMonth(),Rt.getTime()/1e3|0},Aa:nn,Ba:on,Sa:function wt(Rt,Bt,qt){wt.Ac||(wt.Ac=!0,Cn(Rt,Bt,qt))},y:function(){_n("")},U:function(){if(!dt&&!ft){var wt="Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread";Xt||(Xt={}),Xt[wt]||(Xt[wt]=1,dt&&(wt="warning: "+wt),Ot(wt))}},ra:function(){return 4294901760},B:sn,Ia:function(wt,Rt,Bt){j().copyWithin(wt>>>0,Rt>>>0,Rt+Bt>>>0)},F:function(){return dt?s(3993).cpus().length:navigator.hardwareConcurrency},Da:function(wt,Rt,Bt){Jn.length=Rt,Bt>>=3;for(var qt=0;qt<Rt;qt++)Jn[qt]=b()[Bt+qt>>>0];return(0>wt?Nn[-wt-1]:Jr[wt]).apply(null,Jn)},qa:function(wt){var Rt=j().length;if((wt>>>=0)<=Rt||4294901760<wt)return!1;for(var Bt=1;4>=Bt;Bt*=2){var qt=Rt*(1+.2/Bt);qt=Math.min(qt,wt+100663296);var tn=Math;qt=Math.max(wt,qt),tn=tn.min.call(tn,4294901760,qt+(65536-qt%65536)%65536);e:{try{jt.grow(tn-mt.byteLength+65535>>>16),vn(jt.buffer);var cn=1;break e}catch{}cn=void 0}if(cn)return!0}return!1},Na:function(){throw"unwind"},Ga:an,Ha:Xn,J:Dt,I:Un,S:Pr,ga:Ir,R:Zr,d:function(){return Or},na:function wt(Rt,Bt){wt.lc||(wt.lc=function(){if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function"){var tn=new Uint8Array(1);return()=>(crypto.getRandomValues(tn),tn[0])}if(dt)try{var cn=s(Object(function(){var An=new Error("Cannot find module 'crypto'");throw An.code="MODULE_NOT_FOUND",An}()));return()=>cn.randomBytes(1)[0]}catch{}return()=>_n("randomDevice")}());for(var qt=0;qt<Bt;qt++)_()[Rt+qt>>0>>>0]=wt.lc();return 0},ia:function(wt,Rt,Bt){var qt=Yn();try{return Wt(wt)(Rt,Bt)}catch(tn){if(Wn(qt),tn!==tn+0)throw tn;Kn(1,0)}},ja:function(wt,Rt,Bt){var qt=Yn();try{return Wt(wt)(Rt,Bt)}catch(tn){if(Wn(qt),tn!==tn+0)throw tn;Kn(1,0)}},K:function(wt){var Rt=Yn();try{return Wt(wt)()}catch(Bt){if(Wn(Rt),Bt!==Bt+0)throw Bt;Kn(1,0)}},f:function(wt,Rt){var Bt=Yn();try{return Wt(wt)(Rt)}catch(qt){if(Wn(Bt),qt!==qt+0)throw qt;Kn(1,0)}},P:function(wt,Rt,Bt){var qt=Yn();try{return Wt(wt)(Rt,Bt)}catch(tn){if(Wn(qt),tn!==tn+0)throw tn;Kn(1,0)}},Q:function(wt,Rt,Bt){var qt=Yn();try{return Wt(wt)(Rt,Bt)}catch(tn){if(Wn(qt),tn!==tn+0)throw tn;Kn(1,0)}},k:function(wt,Rt,Bt){var qt=Yn();try{return Wt(wt)(Rt,Bt)}catch(tn){if(Wn(qt),tn!==tn+0)throw tn;Kn(1,0)}},p:function(wt,Rt,Bt,qt){var tn=Yn();try{return Wt(wt)(Rt,Bt,qt)}catch(cn){if(Wn(tn),cn!==cn+0)throw cn;Kn(1,0)}},q:function(wt,Rt,Bt,qt,tn){var cn=Yn();try{return Wt(wt)(Rt,Bt,qt,tn)}catch(An){if(Wn(cn),An!==An+0)throw An;Kn(1,0)}},N:function(wt,Rt,Bt,qt,tn,cn){var An=Yn();try{return Wt(wt)(Rt,Bt,qt,tn,cn)}catch(Fn){if(Wn(An),Fn!==Fn+0)throw Fn;Kn(1,0)}},s:function(wt,Rt,Bt,qt,tn,cn){var An=Yn();try{return Wt(wt)(Rt,Bt,qt,tn,cn)}catch(Fn){if(Wn(An),Fn!==Fn+0)throw Fn;Kn(1,0)}},w:function(wt,Rt,Bt,qt,tn,cn,An){var Fn=Yn();try{return Wt(wt)(Rt,Bt,qt,tn,cn,An)}catch(Qn){if(Wn(Fn),Qn!==Qn+0)throw Qn;Kn(1,0)}},L:function(wt,Rt,Bt,qt,tn,cn,An,Fn){var Qn=Yn();try{return Wt(wt)(Rt,Bt,qt,tn,cn,An,Fn)}catch(Zn){if(Wn(Qn),Zn!==Zn+0)throw Zn;Kn(1,0)}},E:function(wt,Rt,Bt,qt,tn,cn,An,Fn,Qn,Zn,$r,jr){var Rr=Yn();try{return Wt(wt)(Rt,Bt,qt,tn,cn,An,Fn,Qn,Zn,$r,jr)}catch(fn){if(Wn(Rr),fn!==fn+0)throw fn;Kn(1,0)}},aa:function(wt,Rt,Bt,qt,tn,cn,An,Fn){var Qn=Yn();try{return ho(wt,Rt,Bt,qt,tn,cn,An,Fn)}catch(Zn){if(Wn(Qn),Zn!==Zn+0)throw Zn;Kn(1,0)}},_:function(wt,Rt,Bt,qt,tn,cn,An){var Fn=Yn();try{return so(wt,Rt,Bt,qt,tn,cn,An)}catch(Qn){if(Wn(Fn),Qn!==Qn+0)throw Qn;Kn(1,0)}},Z:function(wt,Rt,Bt,qt,tn){var cn=Yn();try{return mo(wt,Rt,Bt,qt,tn)}catch(An){if(Wn(cn),An!==An+0)throw An;Kn(1,0)}},ca:function(wt,Rt,Bt,qt){var tn=Yn();try{return fo(wt,Rt,Bt,qt)}catch(cn){if(Wn(tn),cn!==cn+0)throw cn;Kn(1,0)}},$:function(wt){var Rt=Yn();try{return oo(wt)}catch(Bt){if(Wn(Rt),Bt!==Bt+0)throw Bt;Kn(1,0)}},ba:function(wt,Rt){var Bt=Yn();try{return po(wt,Rt)}catch(qt){if(Wn(Bt),qt!==qt+0)throw qt;Kn(1,0)}},Y:function(wt,Rt,Bt){var qt=Yn();try{return ao(wt,Rt,Bt)}catch(tn){if(Wn(qt),tn!==tn+0)throw tn;Kn(1,0)}},g:function(wt){var Rt=Yn();try{Wt(wt)()}catch(Bt){if(Wn(Rt),Bt!==Bt+0)throw Bt;Kn(1,0)}},r:function(wt,Rt){var Bt=Yn();try{Wt(wt)(Rt)}catch(qt){if(Wn(Bt),qt!==qt+0)throw qt;Kn(1,0)}},i:function(wt,Rt,Bt){var qt=Yn();try{Wt(wt)(Rt,Bt)}catch(tn){if(Wn(qt),tn!==tn+0)throw tn;Kn(1,0)}},ha:function(wt,Rt,Bt,qt){var tn=Yn();try{Wt(wt)(Rt,Bt,qt)}catch(cn){if(Wn(tn),cn!==cn+0)throw cn;Kn(1,0)}},m:function(wt,Rt,Bt,qt){var tn=Yn();try{Wt(wt)(Rt,Bt,qt)}catch(cn){if(Wn(tn),cn!==cn+0)throw cn;Kn(1,0)}},v:function(wt,Rt,Bt,qt,tn){var cn=Yn();try{Wt(wt)(Rt,Bt,qt,tn)}catch(An){if(Wn(cn),An!==An+0)throw An;Kn(1,0)}},u:function(wt,Rt,Bt,qt,tn,cn){var An=Yn();try{Wt(wt)(Rt,Bt,qt,tn,cn)}catch(Fn){if(Wn(An),Fn!==Fn+0)throw Fn;Kn(1,0)}},O:function(wt,Rt,Bt,qt,tn,cn,An){var Fn=Yn();try{Wt(wt)(Rt,Bt,qt,tn,cn,An)}catch(Qn){if(Wn(Fn),Qn!==Qn+0)throw Qn;Kn(1,0)}},A:function(wt,Rt,Bt,qt,tn,cn,An,Fn){var Qn=Yn();try{Wt(wt)(Rt,Bt,qt,tn,cn,An,Fn)}catch(Zn){if(Wn(Qn),Zn!==Zn+0)throw Zn;Kn(1,0)}},ka:function(wt,Rt,Bt,qt,tn,cn,An,Fn,Qn){var Zn=Yn();try{Wt(wt)(Rt,Bt,qt,tn,cn,An,Fn,Qn)}catch($r){if(Wn(Zn),$r!==$r+0)throw $r;Kn(1,0)}},C:function(wt,Rt,Bt,qt,tn,cn,An,Fn,Qn,Zn,$r){var jr=Yn();try{Wt(wt)(Rt,Bt,qt,tn,cn,An,Fn,Qn,Zn,$r)}catch(Rr){if(Wn(jr),Rr!==Rr+0)throw Rr;Kn(1,0)}},D:function(wt,Rt,Bt,qt,tn,cn,An,Fn,Qn,Zn,$r,jr,Rr,fn,dr,xr){var Lr=Yn();try{Wt(wt)(Rt,Bt,qt,tn,cn,An,Fn,Qn,Zn,$r,jr,Rr,fn,dr,xr)}catch(Kr){if(Wn(Lr),Kr!==Kr+0)throw Kr;Kn(1,0)}},fa:function(wt,Rt,Bt,qt,tn,cn,An,Fn){var Qn=Yn();try{uo(wt,Rt,Bt,qt,tn,cn,An,Fn)}catch(Zn){if(Wn(Qn),Zn!==Zn+0)throw Zn;Kn(1,0)}},da:function(wt,Rt,Bt,qt,tn,cn,An,Fn,Qn,Zn,$r,jr){var Rr=Yn();try{co(wt,Rt,Bt,qt,tn,cn,An,Fn,Qn,Zn,$r,jr)}catch(fn){if(Wn(Rr),fn!==fn+0)throw fn;Kn(1,0)}},ea:function(wt,Rt,Bt,qt,tn,cn){var An=Yn();try{lo(wt,Rt,Bt,qt,tn,cn)}catch(Fn){if(Wn(An),Fn!==Fn+0)throw Fn;Kn(1,0)}},o:function(wt){return wt},a:jt||a.wasmMemory,G:function(wt){Or=wt},la:Wr,z:function(wt,Rt,Bt,qt){return Wr(wt,Rt,Bt,qt)}};(function(){function wt(tn,cn){a.asm=tn.exports,Lt.qc.push(a.asm.sb),Tn=a.asm.ub,Gn.unshift(a.asm.Va),Et=cn,yt||(Dn--,a.monitorRunDependencies&&a.monitorRunDependencies(Dn),Dn==0&&Rn&&(tn=Rn,Rn=null,tn()))}function Rt(tn){wt(tn.instance,tn.module)}function Bt(tn){return function(){if(!$t&&(ct||ft)){if(typeof fetch=="function"&&!bn.startsWith("file://"))return fetch(bn,{credentials:"same-origin"}).then(function(cn){if(!cn.ok)throw"failed to load wasm binary file at '"+bn+"'";return cn.arrayBuffer()}).catch(function(){return Ln()});if(rt)return new Promise(function(cn,An){rt(bn,function(Fn){cn(new Uint8Array(Fn))},An)})}return Promise.resolve().then(function(){return Ln()})}().then(function(cn){return WebAssembly.instantiate(cn,qt)}).then(function(cn){return cn}).then(tn,function(cn){Ot("failed to asynchronously prepare wasm: "+cn),_n(cn)})}var qt={a:kr};if(yt||(Dn++,a.monitorRunDependencies&&a.monitorRunDependencies(Dn)),a.instantiateWasm)try{return a.instantiateWasm(qt,wt)}catch(tn){return Ot("Module.instantiateWasm callback failed with error: "+tn),!1}($t||typeof WebAssembly.instantiateStreaming!="function"||On()||bn.startsWith("file://")||dt||typeof fetch!="function"?Bt(Rt):fetch(bn,{credentials:"same-origin"}).then(function(tn){return WebAssembly.instantiateStreaming(tn,qt).then(Rt,function(cn){return Ot("wasm streaming compile failed: "+cn),Ot("falling back to ArrayBuffer instantiation"),Bt(Rt)})})).catch(d)})(),a.___wasm_call_ctors=function(){return(a.___wasm_call_ctors=a.asm.Va).apply(null,arguments)},a._OrtInit=function(){return(a._OrtInit=a.asm.Wa).apply(null,arguments)},a._OrtCreateSessionOptions=function(){return(a._OrtCreateSessionOptions=a.asm.Xa).apply(null,arguments)},a._OrtAppendExecutionProvider=function(){return(a._OrtAppendExecutionProvider=a.asm.Ya).apply(null,arguments)},a._OrtAddSessionConfigEntry=function(){return(a._OrtAddSessionConfigEntry=a.asm.Za).apply(null,arguments)},a._OrtReleaseSessionOptions=function(){return(a._OrtReleaseSessionOptions=a.asm._a).apply(null,arguments)},a._OrtCreateSession=function(){return(a._OrtCreateSession=a.asm.$a).apply(null,arguments)},a._OrtReleaseSession=function(){return(a._OrtReleaseSession=a.asm.ab).apply(null,arguments)},a._OrtGetInputCount=function(){return(a._OrtGetInputCount=a.asm.bb).apply(null,arguments)},a._OrtGetOutputCount=function(){return(a._OrtGetOutputCount=a.asm.cb).apply(null,arguments)},a._OrtGetInputName=function(){return(a._OrtGetInputName=a.asm.db).apply(null,arguments)},a._OrtGetOutputName=function(){return(a._OrtGetOutputName=a.asm.eb).apply(null,arguments)},a._OrtFree=function(){return(a._OrtFree=a.asm.fb).apply(null,arguments)},a._OrtCreateTensor=function(){return(a._OrtCreateTensor=a.asm.gb).apply(null,arguments)},a._OrtGetTensorData=function(){return(a._OrtGetTensorData=a.asm.hb).apply(null,arguments)},a._OrtReleaseTensor=function(){return(a._OrtReleaseTensor=a.asm.ib).apply(null,arguments)},a._OrtCreateRunOptions=function(){return(a._OrtCreateRunOptions=a.asm.jb).apply(null,arguments)},a._OrtAddRunConfigEntry=function(){return(a._OrtAddRunConfigEntry=a.asm.kb).apply(null,arguments)},a._OrtReleaseRunOptions=function(){return(a._OrtReleaseRunOptions=a.asm.lb).apply(null,arguments)},a._OrtRun=function(){return(a._OrtRun=a.asm.mb).apply(null,arguments)},a._OrtEndProfiling=function(){return(a._OrtEndProfiling=a.asm.nb).apply(null,arguments)};var Mr=a._pthread_self=function(){return(Mr=a._pthread_self=a.asm.ob).apply(null,arguments)},Dr=a._malloc=function(){return(Dr=a._malloc=a.asm.pb).apply(null,arguments)},Xr=a._free=function(){return(Xr=a._free=a.asm.qb).apply(null,arguments)},Cr=a._fflush=function(){return(Cr=a._fflush=a.asm.rb).apply(null,arguments)};a.__emscripten_tls_init=function(){return(a.__emscripten_tls_init=a.asm.sb).apply(null,arguments)};var Yr=a.___funcs_on_exit=function(){return(Yr=a.___funcs_on_exit=a.asm.tb).apply(null,arguments)},Fr=a.__emscripten_thread_init=function(){return(Fr=a.__emscripten_thread_init=a.asm.vb).apply(null,arguments)};a.__emscripten_thread_crashed=function(){return(a.__emscripten_thread_crashed=a.asm.wb).apply(null,arguments)};var Nr,Ur=a._emscripten_run_in_main_runtime_thread_js=function(){return(Ur=a._emscripten_run_in_main_runtime_thread_js=a.asm.xb).apply(null,arguments)},zr=a.__emscripten_proxy_execute_task_queue=function(){return(zr=a.__emscripten_proxy_execute_task_queue=a.asm.yb).apply(null,arguments)},eo=a.__emscripten_thread_free_data=function(){return(eo=a.__emscripten_thread_free_data=a.asm.zb).apply(null,arguments)},no=a.__emscripten_thread_exit=function(){return(no=a.__emscripten_thread_exit=a.asm.Ab).apply(null,arguments)},Kn=a._setThrew=function(){return(Kn=a._setThrew=a.asm.Bb).apply(null,arguments)},ro=a._emscripten_stack_set_limits=function(){return(ro=a._emscripten_stack_set_limits=a.asm.Cb).apply(null,arguments)},Yn=a.stackSave=function(){return(Yn=a.stackSave=a.asm.Db).apply(null,arguments)},Wn=a.stackRestore=function(){return(Wn=a.stackRestore=a.asm.Eb).apply(null,arguments)},to=a.stackAlloc=function(){return(to=a.stackAlloc=a.asm.Fb).apply(null,arguments)},_i=a.___cxa_can_catch=function(){return(_i=a.___cxa_can_catch=a.asm.Gb).apply(null,arguments)},io=a.___cxa_is_pointer_type=function(){return(io=a.___cxa_is_pointer_type=a.asm.Hb).apply(null,arguments)},oo=a.dynCall_j=function(){return(oo=a.dynCall_j=a.asm.Ib).apply(null,arguments)},so=a.dynCall_iiiiij=function(){return(so=a.dynCall_iiiiij=a.asm.Jb).apply(null,arguments)},ao=a.dynCall_jii=function(){return(ao=a.dynCall_jii=a.asm.Kb).apply(null,arguments)},uo=a.dynCall_viiiiij=function(){return(uo=a.dynCall_viiiiij=a.asm.Lb).apply(null,arguments)},lo=a.dynCall_vjji=function(){return(lo=a.dynCall_vjji=a.asm.Mb).apply(null,arguments)},co=a.dynCall_viiijjjii=function(){return(co=a.dynCall_viiijjjii=a.asm.Nb).apply(null,arguments)},fo=a.dynCall_iij=function(){return(fo=a.dynCall_iij=a.asm.Ob).apply(null,arguments)},po=a.dynCall_ji=function(){return(po=a.dynCall_ji=a.asm.Pb).apply(null,arguments)},ho=a.dynCall_iiiiiij=function(){return(ho=a.dynCall_iiiiiij=a.asm.Qb).apply(null,arguments)},mo=a.dynCall_iiij=function(){return(mo=a.dynCall_iiij=a.asm.Rb).apply(null,arguments)};function go(){function wt(){if(!Nr&&(Nr=!0,a.calledRun=!0,!zt)&&(yt||Ut(Gn),o(a),a.onRuntimeInitialized&&a.onRuntimeInitialized(),!yt)){if(a.postRun)for(typeof a.postRun=="function"&&(a.postRun=[a.postRun]);a.postRun.length;){var Rt=a.postRun.shift();xt.unshift(Rt)}Ut(xt)}}if(!(0<Dn))if(yt)o(a),yt||Ut(Gn),postMessage({cmd:"loaded"});else{if(a.preRun)for(typeof a.preRun=="function"&&(a.preRun=[a.preRun]);a.preRun.length;)wn();Ut(kn),0<Dn||(a.setStatus?(a.setStatus("Running..."),setTimeout(function(){setTimeout(function(){a.setStatus("")},1),wt()},1)):wt())}}if(a.UTF8ToString=Jt,a.stringToUTF8=function(wt,Rt,Bt){return un(wt,j(),Rt,Bt)},a.lengthBytesUTF8=yn,a.keepRuntimeAlive=kt,a.wasmMemory=jt,a.stackSave=Yn,a.stackRestore=Wn,a.stackAlloc=to,a.ExitStatus=Sn,a.PThread=Lt,Rn=function wt(){Nr||go(),Nr||(Rn=wt)},a.preInit)for(typeof a.preInit=="function"&&(a.preInit=[a.preInit]);0<a.preInit.length;)a.preInit.pop()();return go(),$.ready});i.exports=h},932:(i,e,s)=>{var c,h=(c=(c=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function($){var _,j,nt;$=$||{},_||(_=$!==void 0?$:{}),_.ready=new Promise(function(Mt,Vt){j=Mt,nt=Vt});var et,b,a,o,d,g,rt=Object.assign({},_),st="./this.program",tt=(Mt,Vt)=>{throw Vt},ot=typeof window=="object",it=typeof importScripts=="function",at=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",ut="";at?(ut=it?s(908).dirname(ut)+"/":"//",g=()=>{d||(o=s(1384),d=s(908))},et=function(Mt,Vt){return g(),Mt=d.normalize(Mt),o.readFileSync(Mt,Vt?void 0:"utf8")},a=Mt=>((Mt=et(Mt,!0)).buffer||(Mt=new Uint8Array(Mt)),Mt),b=(Mt,Vt,Gt)=>{g(),Mt=d.normalize(Mt),o.readFile(Mt,function(Zt,nn){Zt?Gt(Zt):Vt(nn.buffer)})},1<process.argv.length&&(st=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),process.on("uncaughtException",function(Mt){if(!(Mt instanceof Gn))throw Mt}),process.on("unhandledRejection",function(Mt){throw Mt}),tt=(Mt,Vt)=>{if(dt||0<Nt)throw process.exitCode=Mt,Vt;Vt instanceof Gn||ft("exiting due to exception: "+Vt),process.exit(Mt)},_.inspect=function(){return"[Emscripten Module object]"}):(ot||it)&&(it?ut=self.location.href:typeof document<"u"&&document.currentScript&&(ut=document.currentScript.src),c&&(ut=c),ut=ut.indexOf("blob:")!==0?ut.substr(0,ut.replace(/[?#].*/,"").lastIndexOf("/")+1):"",et=Mt=>{var Vt=new XMLHttpRequest;return Vt.open("GET",Mt,!1),Vt.send(null),Vt.responseText},it&&(a=Mt=>{var Vt=new XMLHttpRequest;return Vt.open("GET",Mt,!1),Vt.responseType="arraybuffer",Vt.send(null),new Uint8Array(Vt.response)}),b=(Mt,Vt,Gt)=>{var Zt=new XMLHttpRequest;Zt.open("GET",Mt,!0),Zt.responseType="arraybuffer",Zt.onload=()=>{Zt.status==200||Zt.status==0&&Zt.response?Vt(Zt.response):Gt()},Zt.onerror=Gt,Zt.send(null)});var lt,ct=_.print||console.log.bind(console),ft=_.printErr||console.warn.bind(console);Object.assign(_,rt),rt=null,_.thisProgram&&(st=_.thisProgram),_.quit&&(tt=_.quit),_.wasmBinary&&(lt=_.wasmBinary);var dt=_.noExitRuntime||!1;typeof WebAssembly!="object"&&vn("no native wasm support detected");var yt,St,bt,Tt,vt,$t,At=!1,Ot=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function It(Mt,Vt,Gt){var Zt=(Vt>>>=0)+Gt;for(Gt=Vt;Mt[Gt]&&!(Gt>=Zt);)++Gt;if(16<Gt-Vt&&Mt.buffer&&Ot)return Ot.decode(Mt.subarray(Vt,Gt));for(Zt="";Vt<Gt;){var nn=Mt[Vt++];if(128&nn){var on=63&Mt[Vt++];if((224&nn)==192)Zt+=String.fromCharCode((31&nn)<<6|on);else{var xn=63&Mt[Vt++];65536>(nn=(240&nn)==224?(15&nn)<<12|on<<6|xn:(7&nn)<<18|on<<12|xn<<6|63&Mt[Vt++])?Zt+=String.fromCharCode(nn):(nn-=65536,Zt+=String.fromCharCode(55296|nn>>10,56320|1023&nn))}}else Zt+=String.fromCharCode(nn)}return Zt}function jt(Mt,Vt){return(Mt>>>=0)?It(Tt,Mt,Vt):""}function Et(Mt,Vt,Gt,Zt){if(!(0<Zt))return 0;var nn=Gt>>>=0;Zt=Gt+Zt-1;for(var on=0;on<Mt.length;++on){var xn=Mt.charCodeAt(on);if(55296<=xn&&57343>=xn&&(xn=65536+((1023&xn)<<10)|1023&Mt.charCodeAt(++on)),127>=xn){if(Gt>=Zt)break;Vt[Gt++>>>0]=xn}else{if(2047>=xn){if(Gt+1>=Zt)break;Vt[Gt++>>>0]=192|xn>>6}else{if(65535>=xn){if(Gt+2>=Zt)break;Vt[Gt++>>>0]=224|xn>>12}else{if(Gt+3>=Zt)break;Vt[Gt++>>>0]=240|xn>>18,Vt[Gt++>>>0]=128|xn>>12&63}Vt[Gt++>>>0]=128|xn>>6&63}Vt[Gt++>>>0]=128|63&xn}}return Vt[Gt>>>0]=0,Gt-nn}function mt(Mt){for(var Vt=0,Gt=0;Gt<Mt.length;++Gt){var Zt=Mt.charCodeAt(Gt);127>=Zt?Vt++:2047>=Zt?Vt+=2:55296<=Zt&&57343>=Zt?(Vt+=4,++Gt):Vt+=3}return Vt}function gt(){var Mt=yt.buffer;St=Mt,_.HEAP8=bt=new Int8Array(Mt),_.HEAP16=new Int16Array(Mt),_.HEAP32=vt=new Int32Array(Mt),_.HEAPU8=Tt=new Uint8Array(Mt),_.HEAPU16=new Uint16Array(Mt),_.HEAPU32=$t=new Uint32Array(Mt),_.HEAPF32=new Float32Array(Mt),_.HEAPF64=new Float64Array(Mt)}var ht,pt=[],_t=[],Ct=[],zt=[],Nt=0;function Ht(){var Mt=_.preRun.shift();pt.unshift(Mt)}var Jt,un=0,yn=null;function vn(Mt){throw _.onAbort&&_.onAbort(Mt),ft(Mt="Aborted("+Mt+")"),At=!0,Mt=new WebAssembly.RuntimeError(Mt+". Build with -sASSERTIONS for more info."),nt(Mt),Mt}function mn(){return Jt.startsWith("data:application/octet-stream;base64,")}if(Jt="ort-wasm.wasm",!mn()){var Tn=Jt;Jt=_.locateFile?_.locateFile(Tn,ut):ut+Tn}function kn(){var Mt=Jt;try{if(Mt==Jt&<)return new Uint8Array(lt);if(a)return a(Mt);throw"both async and sync fetching of the wasm failed"}catch(Vt){vn(Vt)}}function Gn(Mt){this.name="ExitStatus",this.message="Program terminated with exit("+Mt+")",this.status=Mt}function wr(Mt){for(;0<Mt.length;)Mt.shift()(_)}var xt=[],kt=0,wn=0;function bn(Mt){this.Db=Mt,this.zb=Mt-24,this.Ub=function(Vt){$t[this.zb+4>>2>>>0]=Vt},this.Eb=function(){return $t[this.zb+4>>2>>>0]},this.Sb=function(Vt){$t[this.zb+8>>2>>>0]=Vt},this.Wb=function(){return $t[this.zb+8>>2>>>0]},this.Tb=function(){vt[this.zb>>2>>>0]=0},this.Ib=function(Vt){bt[this.zb+12>>0>>>0]=Vt?1:0},this.Pb=function(){return bt[this.zb+12>>0>>>0]!=0},this.Jb=function(Vt){bt[this.zb+13>>0>>>0]=Vt?1:0},this.Lb=function(){return bt[this.zb+13>>0>>>0]!=0},this.Rb=function(Vt,Gt){this.Fb(0),this.Ub(Vt),this.Sb(Gt),this.Tb(),this.Ib(!1),this.Jb(!1)},this.Nb=function(){vt[this.zb>>2>>>0]+=1},this.Xb=function(){var Vt=vt[this.zb>>2>>>0];return vt[this.zb>>2>>>0]=Vt-1,Vt===1},this.Fb=function(Vt){$t[this.zb+16>>2>>>0]=Vt},this.Ob=function(){return $t[this.zb+16>>2>>>0]},this.Qb=function(){if(rn(this.Eb()))return $t[this.Db>>2>>>0];var Vt=this.Ob();return Vt!==0?Vt:this.Db}}function Dn(Mt){return Xt(new bn(Mt).zb)}var Rn=[];function _n(Mt){var Vt=Rn[Mt];return Vt||(Mt>=Rn.length&&(Rn.length=Mt+1),Rn[Mt]=Vt=ht.get(Mt)),Vt}function On(Mt){var Vt=mt(Mt)+1,Gt=Wt(Vt);return Gt&&Et(Mt,bt,Gt,Vt),Gt}var Ln={};function Nn(){if(!Sn){var Mt,Vt={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",_:st||"./this.program"};for(Mt in Ln)Ln[Mt]===void 0?delete Vt[Mt]:Vt[Mt]=Ln[Mt];var Gt=[];for(Mt in Vt)Gt.push(Mt+"="+Vt[Mt]);Sn=Gt}return Sn}var Sn,qn=[null,[],[]];function gr(Mt,Vt){var Gt=qn[Mt];Vt===0||Vt===10?((Mt===1?ct:ft)(It(Gt,0)),Gt.length=0):Gt.push(Vt)}var Pt=0;function Dt(Mt){return Mt%4==0&&(Mt%100!=0||Mt%400==0)}var Lt=[31,29,31,30,31,30,31,31,30,31,30,31],Ut=[31,28,31,30,31,30,31,31,30,31,30,31];function Kt(Mt,Vt,Gt,Zt){function nn(an,Xn,Un){for(an=typeof an=="number"?an.toString():an||"";an.length<Xn;)an=Un[0]+an;return an}function on(an,Xn){return nn(an,Xn,"0")}function xn(an,Xn){function Un(Ir){return 0>Ir?-1:0<Ir?1:0}var Pr;return(Pr=Un(an.getFullYear()-Xn.getFullYear()))===0&&(Pr=Un(an.getMonth()-Xn.getMonth()))===0&&(Pr=Un(an.getDate()-Xn.getDate())),Pr}function Cn(an){switch(an.getDay()){case 0:return new Date(an.getFullYear()-1,11,29);case 1:return an;case 2:return new Date(an.getFullYear(),0,3);case 3:return new Date(an.getFullYear(),0,2);case 4:return new Date(an.getFullYear(),0,1);case 5:return new Date(an.getFullYear()-1,11,31);case 6:return new Date(an.getFullYear()-1,11,30)}}function $n(an){var Xn=an.Bb;for(an=new Date(new Date(an.Cb+1900,0,1).getTime());0<Xn;){var Un=an.getMonth(),Pr=(Dt(an.getFullYear())?Lt:Ut)[Un];if(!(Xn>Pr-an.getDate())){an.setDate(an.getDate()+Xn);break}Xn-=Pr-an.getDate()+1,an.setDate(1),11>Un?an.setMonth(Un+1):(an.setMonth(0),an.setFullYear(an.getFullYear()+1))}return Un=new Date(an.getFullYear()+1,0,4),Xn=Cn(new Date(an.getFullYear(),0,4)),Un=Cn(Un),0>=xn(Xn,an)?0>=xn(Un,an)?an.getFullYear()+1:an.getFullYear():an.getFullYear()-1}var Vn=vt[Zt+40>>2>>>0];for(var Jn in Zt={$b:vt[Zt>>2>>>0],Zb:vt[Zt+4>>2>>>0],Gb:vt[Zt+8>>2>>>0],Kb:vt[Zt+12>>2>>>0],Hb:vt[Zt+16>>2>>>0],Cb:vt[Zt+20>>2>>>0],Ab:vt[Zt+24>>2>>>0],Bb:vt[Zt+28>>2>>>0],bc:vt[Zt+32>>2>>>0],Yb:vt[Zt+36>>2>>>0],ac:Vn?jt(Vn):""},Gt=jt(Gt),Vn={"%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"})Gt=Gt.replace(new RegExp(Jn,"g"),Vn[Jn]);var Tr="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),Er="January February March April May June July August September October November December".split(" ");for(Jn in Vn={"%a":function(an){return Tr[an.Ab].substring(0,3)},"%A":function(an){return Tr[an.Ab]},"%b":function(an){return Er[an.Hb].substring(0,3)},"%B":function(an){return Er[an.Hb]},"%C":function(an){return on((an.Cb+1900)/100|0,2)},"%d":function(an){return on(an.Kb,2)},"%e":function(an){return nn(an.Kb,2," ")},"%g":function(an){return $n(an).toString().substring(2)},"%G":function(an){return $n(an)},"%H":function(an){return on(an.Gb,2)},"%I":function(an){return(an=an.Gb)==0?an=12:12<an&&(an-=12),on(an,2)},"%j":function(an){for(var Xn=0,Un=0;Un<=an.Hb-1;Xn+=(Dt(an.Cb+1900)?Lt:Ut)[Un++]);return on(an.Kb+Xn,3)},"%m":function(an){return on(an.Hb+1,2)},"%M":function(an){return on(an.Zb,2)},"%n":function(){return`
|
|
70
|
+
`},"%p":function(an){return 0<=an.Gb&&12>an.Gb?"AM":"PM"},"%S":function(an){return on(an.$b,2)},"%t":function(){return" "},"%u":function(an){return an.Ab||7},"%U":function(an){return on(Math.floor((an.Bb+7-an.Ab)/7),2)},"%V":function(an){var Xn=Math.floor((an.Bb+7-(an.Ab+6)%7)/7);if(2>=(an.Ab+371-an.Bb-2)%7&&Xn++,Xn)Xn==53&&((Un=(an.Ab+371-an.Bb)%7)==4||Un==3&&Dt(an.Cb)||(Xn=1));else{Xn=52;var Un=(an.Ab+7-an.Bb-1)%7;(Un==4||Un==5&&Dt(an.Cb%400-1))&&Xn++}return on(Xn,2)},"%w":function(an){return an.Ab},"%W":function(an){return on(Math.floor((an.Bb+7-(an.Ab+6)%7)/7),2)},"%y":function(an){return(an.Cb+1900).toString().substring(2)},"%Y":function(an){return an.Cb+1900},"%z":function(an){var Xn=0<=(an=an.Yb);return an=Math.abs(an)/60,(Xn?"+":"-")+("0000"+(an/60*100+an%60)).slice(-4)},"%Z":function(an){return an.ac},"%%":function(){return"%"}},Gt=Gt.replace(/%%/g,"\0\0"),Vn)Gt.includes(Jn)&&(Gt=Gt.replace(new RegExp(Jn,"g"),Vn[Jn](Zt)));return Jn=function(an){var Xn=Array(mt(an)+1);return Et(an,Xn,0,Xn.length),Xn}(Gt=Gt.replace(/\0\0/g,"%")),Jn.length>Vt?0:(bt.set(Jn,Mt>>>0),Jn.length-1)}var Ft={a:function(Mt){return Wt(Mt+24)+24},m:function(Mt){return(Mt=new bn(Mt)).Pb()||(Mt.Ib(!0),kt--),Mt.Jb(!1),xt.push(Mt),Mt.Nb(),Mt.Qb()},ia:function(Mt){throw ft("Unexpected exception thrown, this is not properly supported - aborting"),At=!0,Mt},w:function(){Qt(0);var Mt=xt.pop();if(Mt.Xb()&&!Mt.Lb()){var Vt=Mt.Wb();Vt&&_n(Vt)(Mt.Db),Dn(Mt.Db)}wn=0},d:function(){var Mt=wn;if(!Mt)return Pt=0;var Vt=new bn(Mt);Vt.Fb(Mt);var Gt=Vt.Eb();if(!Gt)return Pt=0,Mt;for(var Zt=Array.prototype.slice.call(arguments),nn=0;nn<Zt.length;nn++){var on=Zt[nn];if(on===0||on===Gt)break;if(Mn(on,Gt,Vt.zb+16))return Pt=on,Mt}return Pt=Gt,Mt},k:function(){var Mt=wn;if(!Mt)return Pt=0;var Vt=new bn(Mt);Vt.Fb(Mt);var Gt=Vt.Eb();if(!Gt)return Pt=0,Mt;for(var Zt=Array.prototype.slice.call(arguments),nn=0;nn<Zt.length;nn++){var on=Zt[nn];if(on===0||on===Gt)break;if(Mn(on,Gt,Vt.zb+16))return Pt=on,Mt}return Pt=Gt,Mt},g:function(){var Mt=wn;if(!Mt)return Pt=0;var Vt=new bn(Mt);Vt.Fb(Mt);var Gt=Vt.Eb();if(!Gt)return Pt=0,Mt;for(var Zt=Array.prototype.slice.call(arguments),nn=0;nn<Zt.length;nn++){var on=Zt[nn];if(on===0||on===Gt)break;if(Mn(on,Gt,Vt.zb+16))return Pt=on,Mt}return Pt=Gt,Mt},s:Dn,L:function(){var Mt=xt.pop();Mt||vn("no exception to throw");var Vt=Mt.Db;throw Mt.Lb()||(xt.push(Mt),Mt.Jb(!0),Mt.Ib(!1),kt++),wn=Vt,Vt},b:function(Mt,Vt,Gt){throw new bn(Mt).Rb(Vt,Gt),wn=Mt,kt++,Mt},la:function(){return kt},i:function(Mt){throw wn||(wn=Mt),Mt},H:function(){return 0},Ba:function(){},pa:function(){},ra:function(){},ka:function(){return 0},za:function(){},ua:function(){},ya:function(){},R:function(){},qa:function(){},na:function(){},Aa:function(){},oa:function(){},Ha:function(){},Ja:function(){vn("To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking")},Ia:function(){vn("To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking")},S:function(){return Date.now()},Ca:function(){return!0},Da:function(Mt,Vt){Mt=new Date(1e3*($t[Mt>>>2]+4294967296*vt[Mt+4>>>2])),vt[Vt>>2>>>0]=Mt.getUTCSeconds(),vt[Vt+4>>2>>>0]=Mt.getUTCMinutes(),vt[Vt+8>>2>>>0]=Mt.getUTCHours(),vt[Vt+12>>2>>>0]=Mt.getUTCDate(),vt[Vt+16>>2>>>0]=Mt.getUTCMonth(),vt[Vt+20>>2>>>0]=Mt.getUTCFullYear()-1900,vt[Vt+24>>2>>>0]=Mt.getUTCDay(),vt[Vt+28>>2>>>0]=(Mt.getTime()-Date.UTC(Mt.getUTCFullYear(),0,1,0,0,0,0))/864e5|0},Ea:function(Mt,Vt){Mt=new Date(1e3*($t[Mt>>>2]+4294967296*vt[Mt+4>>>2])),vt[Vt>>2>>>0]=Mt.getSeconds(),vt[Vt+4>>2>>>0]=Mt.getMinutes(),vt[Vt+8>>2>>>0]=Mt.getHours(),vt[Vt+12>>2>>>0]=Mt.getDate(),vt[Vt+16>>2>>>0]=Mt.getMonth(),vt[Vt+20>>2>>>0]=Mt.getFullYear()-1900,vt[Vt+24>>2>>>0]=Mt.getDay();var Gt=new Date(Mt.getFullYear(),0,1);vt[Vt+28>>2>>>0]=(Mt.getTime()-Gt.getTime())/864e5|0,vt[Vt+36>>2>>>0]=-60*Mt.getTimezoneOffset();var Zt=new Date(Mt.getFullYear(),6,1).getTimezoneOffset();Gt=Gt.getTimezoneOffset(),vt[Vt+32>>2>>>0]=0|(Zt!=Gt&&Mt.getTimezoneOffset()==Math.min(Gt,Zt))},Fa:function(Mt){var Vt=new Date(vt[Mt+20>>2>>>0]+1900,vt[Mt+16>>2>>>0],vt[Mt+12>>2>>>0],vt[Mt+8>>2>>>0],vt[Mt+4>>2>>>0],vt[Mt>>2>>>0],0),Gt=vt[Mt+32>>2>>>0],Zt=Vt.getTimezoneOffset(),nn=new Date(Vt.getFullYear(),0,1),on=new Date(Vt.getFullYear(),6,1).getTimezoneOffset(),xn=nn.getTimezoneOffset(),Cn=Math.min(xn,on);return 0>Gt?vt[Mt+32>>2>>>0]=+(on!=xn&&Cn==Zt):0<Gt!=(Cn==Zt)&&(on=Math.max(xn,on),Vt.setTime(Vt.getTime()+6e4*((0<Gt?Cn:on)-Zt))),vt[Mt+24>>2>>>0]=Vt.getDay(),vt[Mt+28>>2>>>0]=(Vt.getTime()-nn.getTime())/864e5|0,vt[Mt>>2>>>0]=Vt.getSeconds(),vt[Mt+4>>2>>>0]=Vt.getMinutes(),vt[Mt+8>>2>>>0]=Vt.getHours(),vt[Mt+12>>2>>>0]=Vt.getDate(),vt[Mt+16>>2>>>0]=Vt.getMonth(),Vt.getTime()/1e3|0},sa:function(){return-52},ta:function(){},Ga:function Mt(Vt,Gt,Zt){Mt.Vb||(Mt.Vb=!0,function(nn,on,xn){function Cn(Er){return(Er=Er.toTimeString().match(/\(([A-Za-z ]+)\)$/))?Er[1]:"GMT"}var $n=new Date().getFullYear(),Vn=new Date($n,0,1),Jn=new Date($n,6,1);$n=Vn.getTimezoneOffset();var Tr=Jn.getTimezoneOffset();vt[nn>>2>>>0]=60*Math.max($n,Tr),vt[on>>2>>>0]=+($n!=Tr),nn=Cn(Vn),on=Cn(Jn),nn=On(nn),on=On(on),Tr<$n?($t[xn>>2>>>0]=nn,$t[xn+4>>2>>>0]=on):($t[xn>>2>>>0]=on,$t[xn+4>>2>>>0]=nn)}(Vt,Gt,Zt))},B:function(){vn("")},ma:function(){return 4294901760},I:at?()=>{var Mt=process.hrtime();return 1e3*Mt[0]+Mt[1]/1e6}:()=>performance.now(),xa:function(Mt,Vt,Gt){Tt.copyWithin(Mt>>>0,Vt>>>0,Vt+Gt>>>0)},G:function(Mt){var Vt=Tt.length;if(4294901760<(Mt>>>=0))return!1;for(var Gt=1;4>=Gt;Gt*=2){var Zt=Vt*(1+.2/Gt);Zt=Math.min(Zt,Mt+100663296);var nn=Math;Zt=Math.max(Mt,Zt),nn=nn.min.call(nn,4294901760,Zt+(65536-Zt%65536)%65536);e:{try{yt.grow(nn-St.byteLength+65535>>>16),gt();var on=1;break e}catch{}on=void 0}if(on)return!0}return!1},va:function(Mt,Vt){var Gt=0;return Nn().forEach(function(Zt,nn){var on=Vt+Gt;for(nn=$t[Mt+4*nn>>2>>>0]=on,on=0;on<Zt.length;++on)bt[nn++>>0>>>0]=Zt.charCodeAt(on);bt[nn>>0>>>0]=0,Gt+=Zt.length+1}),0},wa:function(Mt,Vt){var Gt=Nn();$t[Mt>>2>>>0]=Gt.length;var Zt=0;return Gt.forEach(function(nn){Zt+=nn.length+1}),$t[Vt>>2>>>0]=Zt,0},ba:function(Mt){dt||0<Nt||(en(),wr(Ct),sn(0),qn[1].length&&gr(1,10),qn[2].length&&gr(2,10)),dt||0<Nt||(_.onExit&&_.onExit(Mt),At=!0),tt(Mt,new Gn(Mt))},E:function(){return 52},Q:function(){return 52},ca:function(){return 70},P:function(Mt,Vt,Gt,Zt){for(var nn=0,on=0;on<Gt;on++){var xn=$t[Vt>>2>>>0],Cn=$t[Vt+4>>2>>>0];Vt+=8;for(var $n=0;$n<Cn;$n++)gr(Mt,Tt[xn+$n>>>0]);nn+=Cn}return $t[Zt>>2>>>0]=nn,0},c:function(){return Pt},ja:function Mt(Vt,Gt){Mt.Mb||(Mt.Mb=function(){if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function"){var nn=new Uint8Array(1);return()=>(crypto.getRandomValues(nn),nn[0])}if(at)try{var on=s(Object(function(){var xn=new Error("Cannot find module 'crypto'");throw xn.code="MODULE_NOT_FOUND",xn}()));return()=>on.randomBytes(1)[0]}catch{}return()=>vn("randomDevice")}());for(var Zt=0;Zt<Gt;Zt++)bt[Vt+Zt>>0>>>0]=Mt.Mb();return 0},ea:function(Mt,Vt,Gt){var Zt=ln();try{return _n(Mt)(Vt,Gt)}catch(nn){if(gn(Zt),nn!==nn+0)throw nn;Qt(1,0)}},fa:function(Mt,Vt,Gt){var Zt=ln();try{return _n(Mt)(Vt,Gt)}catch(nn){if(gn(Zt),nn!==nn+0)throw nn;Qt(1,0)}},J:function(Mt){var Vt=ln();try{return _n(Mt)()}catch(Gt){if(gn(Vt),Gt!==Gt+0)throw Gt;Qt(1,0)}},e:function(Mt,Vt){var Gt=ln();try{return _n(Mt)(Vt)}catch(Zt){if(gn(Gt),Zt!==Zt+0)throw Zt;Qt(1,0)}},N:function(Mt,Vt,Gt){var Zt=ln();try{return _n(Mt)(Vt,Gt)}catch(nn){if(gn(Zt),nn!==nn+0)throw nn;Qt(1,0)}},O:function(Mt,Vt,Gt){var Zt=ln();try{return _n(Mt)(Vt,Gt)}catch(nn){if(gn(Zt),nn!==nn+0)throw nn;Qt(1,0)}},j:function(Mt,Vt,Gt){var Zt=ln();try{return _n(Mt)(Vt,Gt)}catch(nn){if(gn(Zt),nn!==nn+0)throw nn;Qt(1,0)}},o:function(Mt,Vt,Gt,Zt){var nn=ln();try{return _n(Mt)(Vt,Gt,Zt)}catch(on){if(gn(nn),on!==on+0)throw on;Qt(1,0)}},p:function(Mt,Vt,Gt,Zt,nn){var on=ln();try{return _n(Mt)(Vt,Gt,Zt,nn)}catch(xn){if(gn(on),xn!==xn+0)throw xn;Qt(1,0)}},M:function(Mt,Vt,Gt,Zt,nn,on){var xn=ln();try{return _n(Mt)(Vt,Gt,Zt,nn,on)}catch(Cn){if(gn(xn),Cn!==Cn+0)throw Cn;Qt(1,0)}},r:function(Mt,Vt,Gt,Zt,nn,on){var xn=ln();try{return _n(Mt)(Vt,Gt,Zt,nn,on)}catch(Cn){if(gn(xn),Cn!==Cn+0)throw Cn;Qt(1,0)}},v:function(Mt,Vt,Gt,Zt,nn,on,xn){var Cn=ln();try{return _n(Mt)(Vt,Gt,Zt,nn,on,xn)}catch($n){if(gn(Cn),$n!==$n+0)throw $n;Qt(1,0)}},K:function(Mt,Vt,Gt,Zt,nn,on,xn,Cn){var $n=ln();try{return _n(Mt)(Vt,Gt,Zt,nn,on,xn,Cn)}catch(Vn){if(gn($n),Vn!==Vn+0)throw Vn;Qt(1,0)}},D:function(Mt,Vt,Gt,Zt,nn,on,xn,Cn,$n,Vn,Jn,Tr){var Er=ln();try{return _n(Mt)(Vt,Gt,Zt,nn,on,xn,Cn,$n,Vn,Jn,Tr)}catch(an){if(gn(Er),an!==an+0)throw an;Qt(1,0)}},X:function(Mt,Vt,Gt,Zt,nn,on,xn,Cn){var $n=ln();try{return Bn(Mt,Vt,Gt,Zt,nn,on,xn,Cn)}catch(Vn){if(gn($n),Vn!==Vn+0)throw Vn;Qt(1,0)}},V:function(Mt,Vt,Gt,Zt,nn,on,xn){var Cn=ln();try{return zn(Mt,Vt,Gt,Zt,nn,on,xn)}catch($n){if(gn(Cn),$n!==$n+0)throw $n;Qt(1,0)}},U:function(Mt,Vt,Gt,Zt,nn){var on=ln();try{return Hn(Mt,Vt,Gt,Zt,nn)}catch(xn){if(gn(on),xn!==xn+0)throw xn;Qt(1,0)}},Z:function(Mt,Vt,Gt,Zt){var nn=ln();try{return pr(Mt,Vt,Gt,Zt)}catch(on){if(gn(nn),on!==on+0)throw on;Qt(1,0)}},W:function(Mt){var Vt=ln();try{return Pn(Mt)}catch(Gt){if(gn(Vt),Gt!==Gt+0)throw Gt;Qt(1,0)}},Y:function(Mt,Vt){var Gt=ln();try{return En(Mt,Vt)}catch(Zt){if(gn(Gt),Zt!==Zt+0)throw Zt;Qt(1,0)}},T:function(Mt,Vt,Gt){var Zt=ln();try{return pn(Mt,Vt,Gt)}catch(nn){if(gn(Zt),nn!==nn+0)throw nn;Qt(1,0)}},f:function(Mt){var Vt=ln();try{_n(Mt)()}catch(Gt){if(gn(Vt),Gt!==Gt+0)throw Gt;Qt(1,0)}},q:function(Mt,Vt){var Gt=ln();try{_n(Mt)(Vt)}catch(Zt){if(gn(Gt),Zt!==Zt+0)throw Zt;Qt(1,0)}},h:function(Mt,Vt,Gt){var Zt=ln();try{_n(Mt)(Vt,Gt)}catch(nn){if(gn(Zt),nn!==nn+0)throw nn;Qt(1,0)}},da:function(Mt,Vt,Gt,Zt){var nn=ln();try{_n(Mt)(Vt,Gt,Zt)}catch(on){if(gn(nn),on!==on+0)throw on;Qt(1,0)}},l:function(Mt,Vt,Gt,Zt){var nn=ln();try{_n(Mt)(Vt,Gt,Zt)}catch(on){if(gn(nn),on!==on+0)throw on;Qt(1,0)}},t:function(Mt,Vt,Gt,Zt,nn){var on=ln();try{_n(Mt)(Vt,Gt,Zt,nn)}catch(xn){if(gn(on),xn!==xn+0)throw xn;Qt(1,0)}},u:function(Mt,Vt,Gt,Zt,nn,on){var xn=ln();try{_n(Mt)(Vt,Gt,Zt,nn,on)}catch(Cn){if(gn(xn),Cn!==Cn+0)throw Cn;Qt(1,0)}},x:function(Mt,Vt,Gt,Zt,nn,on,xn){var Cn=ln();try{_n(Mt)(Vt,Gt,Zt,nn,on,xn)}catch($n){if(gn(Cn),$n!==$n+0)throw $n;Qt(1,0)}},z:function(Mt,Vt,Gt,Zt,nn,on,xn,Cn){var $n=ln();try{_n(Mt)(Vt,Gt,Zt,nn,on,xn,Cn)}catch(Vn){if(gn($n),Vn!==Vn+0)throw Vn;Qt(1,0)}},ga:function(Mt,Vt,Gt,Zt,nn,on,xn,Cn,$n){var Vn=ln();try{_n(Mt)(Vt,Gt,Zt,nn,on,xn,Cn,$n)}catch(Jn){if(gn(Vn),Jn!==Jn+0)throw Jn;Qt(1,0)}},A:function(Mt,Vt,Gt,Zt,nn,on,xn,Cn,$n,Vn,Jn){var Tr=ln();try{_n(Mt)(Vt,Gt,Zt,nn,on,xn,Cn,$n,Vn,Jn)}catch(Er){if(gn(Tr),Er!==Er+0)throw Er;Qt(1,0)}},C:function(Mt,Vt,Gt,Zt,nn,on,xn,Cn,$n,Vn,Jn,Tr,Er,an,Xn,Un){var Pr=ln();try{_n(Mt)(Vt,Gt,Zt,nn,on,xn,Cn,$n,Vn,Jn,Tr,Er,an,Xn,Un)}catch(Ir){if(gn(Pr),Ir!==Ir+0)throw Ir;Qt(1,0)}},aa:function(Mt,Vt,Gt,Zt,nn,on,xn,Cn){var $n=ln();try{In(Mt,Vt,Gt,Zt,nn,on,xn,Cn)}catch(Vn){if(gn($n),Vn!==Vn+0)throw Vn;Qt(1,0)}},_:function(Mt,Vt,Gt,Zt,nn,on,xn,Cn,$n,Vn,Jn,Tr){var Er=ln();try{jn(Mt,Vt,Gt,Zt,nn,on,xn,Cn,$n,Vn,Jn,Tr)}catch(an){if(gn(Er),an!==an+0)throw an;Qt(1,0)}},$:function(Mt,Vt,Gt,Zt,nn,on){var xn=ln();try{hn(Mt,Vt,Gt,Zt,nn,on)}catch(Cn){if(gn(xn),Cn!==Cn+0)throw Cn;Qt(1,0)}},n:function(Mt){return Mt},F:function(Mt){Pt=Mt},ha:Kt,y:function(Mt,Vt,Gt,Zt){return Kt(Mt,Vt,Gt,Zt)}};(function(){function Mt(nn){_.asm=nn.exports,yt=_.asm.Ka,gt(),ht=_.asm.ib,_t.unshift(_.asm.La),un--,_.monitorRunDependencies&&_.monitorRunDependencies(un),un==0&&yn&&(nn=yn,yn=null,nn())}function Vt(nn){Mt(nn.instance)}function Gt(nn){return function(){if(!lt&&(ot||it)){if(typeof fetch=="function"&&!Jt.startsWith("file://"))return fetch(Jt,{credentials:"same-origin"}).then(function(on){if(!on.ok)throw"failed to load wasm binary file at '"+Jt+"'";return on.arrayBuffer()}).catch(function(){return kn()});if(b)return new Promise(function(on,xn){b(Jt,function(Cn){on(new Uint8Array(Cn))},xn)})}return Promise.resolve().then(function(){return kn()})}().then(function(on){return WebAssembly.instantiate(on,Zt)}).then(function(on){return on}).then(nn,function(on){ft("failed to asynchronously prepare wasm: "+on),vn(on)})}var Zt={a:Ft};if(un++,_.monitorRunDependencies&&_.monitorRunDependencies(un),_.instantiateWasm)try{return _.instantiateWasm(Zt,Mt)}catch(nn){return ft("Module.instantiateWasm callback failed with error: "+nn),!1}(lt||typeof WebAssembly.instantiateStreaming!="function"||mn()||Jt.startsWith("file://")||at||typeof fetch!="function"?Gt(Vt):fetch(Jt,{credentials:"same-origin"}).then(function(nn){return WebAssembly.instantiateStreaming(nn,Zt).then(Vt,function(on){return ft("wasm streaming compile failed: "+on),ft("falling back to ArrayBuffer instantiation"),Gt(Vt)})})).catch(nt)})(),_.___wasm_call_ctors=function(){return(_.___wasm_call_ctors=_.asm.La).apply(null,arguments)},_._OrtInit=function(){return(_._OrtInit=_.asm.Ma).apply(null,arguments)},_._OrtCreateSessionOptions=function(){return(_._OrtCreateSessionOptions=_.asm.Na).apply(null,arguments)},_._OrtAppendExecutionProvider=function(){return(_._OrtAppendExecutionProvider=_.asm.Oa).apply(null,arguments)},_._OrtAddSessionConfigEntry=function(){return(_._OrtAddSessionConfigEntry=_.asm.Pa).apply(null,arguments)},_._OrtReleaseSessionOptions=function(){return(_._OrtReleaseSessionOptions=_.asm.Qa).apply(null,arguments)},_._OrtCreateSession=function(){return(_._OrtCreateSession=_.asm.Ra).apply(null,arguments)},_._OrtReleaseSession=function(){return(_._OrtReleaseSession=_.asm.Sa).apply(null,arguments)},_._OrtGetInputCount=function(){return(_._OrtGetInputCount=_.asm.Ta).apply(null,arguments)},_._OrtGetOutputCount=function(){return(_._OrtGetOutputCount=_.asm.Ua).apply(null,arguments)},_._OrtGetInputName=function(){return(_._OrtGetInputName=_.asm.Va).apply(null,arguments)},_._OrtGetOutputName=function(){return(_._OrtGetOutputName=_.asm.Wa).apply(null,arguments)},_._OrtFree=function(){return(_._OrtFree=_.asm.Xa).apply(null,arguments)},_._OrtCreateTensor=function(){return(_._OrtCreateTensor=_.asm.Ya).apply(null,arguments)},_._OrtGetTensorData=function(){return(_._OrtGetTensorData=_.asm.Za).apply(null,arguments)},_._OrtReleaseTensor=function(){return(_._OrtReleaseTensor=_.asm._a).apply(null,arguments)},_._OrtCreateRunOptions=function(){return(_._OrtCreateRunOptions=_.asm.$a).apply(null,arguments)},_._OrtAddRunConfigEntry=function(){return(_._OrtAddRunConfigEntry=_.asm.ab).apply(null,arguments)},_._OrtReleaseRunOptions=function(){return(_._OrtReleaseRunOptions=_.asm.bb).apply(null,arguments)},_._OrtRun=function(){return(_._OrtRun=_.asm.cb).apply(null,arguments)},_._OrtEndProfiling=function(){return(_._OrtEndProfiling=_.asm.db).apply(null,arguments)};var Yt,Wt=_._malloc=function(){return(Wt=_._malloc=_.asm.eb).apply(null,arguments)},Xt=_._free=function(){return(Xt=_._free=_.asm.fb).apply(null,arguments)},sn=_._fflush=function(){return(sn=_._fflush=_.asm.gb).apply(null,arguments)},en=_.___funcs_on_exit=function(){return(en=_.___funcs_on_exit=_.asm.hb).apply(null,arguments)},Qt=_._setThrew=function(){return(Qt=_._setThrew=_.asm.jb).apply(null,arguments)},ln=_.stackSave=function(){return(ln=_.stackSave=_.asm.kb).apply(null,arguments)},gn=_.stackRestore=function(){return(gn=_.stackRestore=_.asm.lb).apply(null,arguments)},dn=_.stackAlloc=function(){return(dn=_.stackAlloc=_.asm.mb).apply(null,arguments)},Mn=_.___cxa_can_catch=function(){return(Mn=_.___cxa_can_catch=_.asm.nb).apply(null,arguments)},rn=_.___cxa_is_pointer_type=function(){return(rn=_.___cxa_is_pointer_type=_.asm.ob).apply(null,arguments)},Pn=_.dynCall_j=function(){return(Pn=_.dynCall_j=_.asm.pb).apply(null,arguments)},zn=_.dynCall_iiiiij=function(){return(zn=_.dynCall_iiiiij=_.asm.qb).apply(null,arguments)},pn=_.dynCall_jii=function(){return(pn=_.dynCall_jii=_.asm.rb).apply(null,arguments)},In=_.dynCall_viiiiij=function(){return(In=_.dynCall_viiiiij=_.asm.sb).apply(null,arguments)},hn=_.dynCall_vjji=function(){return(hn=_.dynCall_vjji=_.asm.tb).apply(null,arguments)},jn=_.dynCall_viiijjjii=function(){return(jn=_.dynCall_viiijjjii=_.asm.ub).apply(null,arguments)},pr=_.dynCall_iij=function(){return(pr=_.dynCall_iij=_.asm.vb).apply(null,arguments)},En=_.dynCall_ji=function(){return(En=_.dynCall_ji=_.asm.wb).apply(null,arguments)},Bn=_.dynCall_iiiiiij=function(){return(Bn=_.dynCall_iiiiiij=_.asm.xb).apply(null,arguments)},Hn=_.dynCall_iiij=function(){return(Hn=_.dynCall_iiij=_.asm.yb).apply(null,arguments)};function yr(){function Mt(){if(!Yt&&(Yt=!0,_.calledRun=!0,!At)){if(wr(_t),j(_),_.onRuntimeInitialized&&_.onRuntimeInitialized(),_.postRun)for(typeof _.postRun=="function"&&(_.postRun=[_.postRun]);_.postRun.length;){var Vt=_.postRun.shift();zt.unshift(Vt)}wr(zt)}}if(!(0<un)){if(_.preRun)for(typeof _.preRun=="function"&&(_.preRun=[_.preRun]);_.preRun.length;)Ht();wr(pt),0<un||(_.setStatus?(_.setStatus("Running..."),setTimeout(function(){setTimeout(function(){_.setStatus("")},1),Mt()},1)):Mt())}}if(_.UTF8ToString=jt,_.stringToUTF8=function(Mt,Vt,Gt){return Et(Mt,Tt,Vt,Gt)},_.lengthBytesUTF8=mt,_.stackSave=ln,_.stackRestore=gn,_.stackAlloc=dn,yn=function Mt(){Yt||yr(),Yt||(yn=Mt)},_.preInit)for(typeof _.preInit=="function"&&(_.preInit=[_.preInit]);0<_.preInit.length;)_.preInit.pop()();return yr(),$.ready});i.exports=h},4537:i=>{i.exports=function(e,s){for(var c=new Array(arguments.length-1),h=0,$=2,_=!0;$<arguments.length;)c[h++]=arguments[$++];return new Promise(function(j,nt){c[h]=function(et){if(_)if(_=!1,et)nt(et);else{for(var b=new Array(arguments.length-1),a=0;a<b.length;)b[a++]=arguments[a];j.apply(null,b)}};try{e.apply(s||null,c)}catch(et){_&&(_=!1,nt(et))}})}},7419:(i,e)=>{var s=e;s.length=function(j){var nt=j.length;if(!nt)return 0;for(var et=0;--nt%4>1&&j.charAt(nt)==="=";)++et;return Math.ceil(3*j.length)/4-et};for(var c=new Array(64),h=new Array(123),$=0;$<64;)h[c[$]=$<26?$+65:$<52?$+71:$<62?$-4:$-59|43]=$++;s.encode=function(j,nt,et){for(var b,a=null,o=[],d=0,g=0;nt<et;){var rt=j[nt++];switch(g){case 0:o[d++]=c[rt>>2],b=(3&rt)<<4,g=1;break;case 1:o[d++]=c[b|rt>>4],b=(15&rt)<<2,g=2;break;case 2:o[d++]=c[b|rt>>6],o[d++]=c[63&rt],g=0}d>8191&&((a||(a=[])).push(String.fromCharCode.apply(String,o)),d=0)}return g&&(o[d++]=c[b],o[d++]=61,g===1&&(o[d++]=61)),a?(d&&a.push(String.fromCharCode.apply(String,o.slice(0,d))),a.join("")):String.fromCharCode.apply(String,o.slice(0,d))};var _="invalid encoding";s.decode=function(j,nt,et){for(var b,a=et,o=0,d=0;d<j.length;){var g=j.charCodeAt(d++);if(g===61&&o>1)break;if((g=h[g])===void 0)throw Error(_);switch(o){case 0:b=g,o=1;break;case 1:nt[et++]=b<<2|(48&g)>>4,b=g,o=2;break;case 2:nt[et++]=(15&b)<<4|(60&g)>>2,b=g,o=3;break;case 3:nt[et++]=(3&b)<<6|g,o=0}}if(o===1)throw Error(_);return et-a},s.test=function(j){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(j)}},9211:i=>{function e(){this._listeners={}}i.exports=e,e.prototype.on=function(s,c,h){return(this._listeners[s]||(this._listeners[s]=[])).push({fn:c,ctx:h||this}),this},e.prototype.off=function(s,c){if(s===void 0)this._listeners={};else if(c===void 0)this._listeners[s]=[];else for(var h=this._listeners[s],$=0;$<h.length;)h[$].fn===c?h.splice($,1):++$;return this},e.prototype.emit=function(s){var c=this._listeners[s];if(c){for(var h=[],$=1;$<arguments.length;)h.push(arguments[$++]);for($=0;$<c.length;)c[$].fn.apply(c[$++].ctx,h)}return this}},945:i=>{function e(_){return typeof Float32Array<"u"?function(){var j=new Float32Array([-0]),nt=new Uint8Array(j.buffer),et=nt[3]===128;function b(g,rt,st){j[0]=g,rt[st]=nt[0],rt[st+1]=nt[1],rt[st+2]=nt[2],rt[st+3]=nt[3]}function a(g,rt,st){j[0]=g,rt[st]=nt[3],rt[st+1]=nt[2],rt[st+2]=nt[1],rt[st+3]=nt[0]}function o(g,rt){return nt[0]=g[rt],nt[1]=g[rt+1],nt[2]=g[rt+2],nt[3]=g[rt+3],j[0]}function d(g,rt){return nt[3]=g[rt],nt[2]=g[rt+1],nt[1]=g[rt+2],nt[0]=g[rt+3],j[0]}_.writeFloatLE=et?b:a,_.writeFloatBE=et?a:b,_.readFloatLE=et?o:d,_.readFloatBE=et?d:o}():function(){function j(et,b,a,o){var d=b<0?1:0;if(d&&(b=-b),b===0)et(1/b>0?0:2147483648,a,o);else if(isNaN(b))et(2143289344,a,o);else if(b>34028234663852886e22)et((d<<31|2139095040)>>>0,a,o);else if(b<11754943508222875e-54)et((d<<31|Math.round(b/1401298464324817e-60))>>>0,a,o);else{var g=Math.floor(Math.log(b)/Math.LN2);et((d<<31|g+127<<23|8388607&Math.round(b*Math.pow(2,-g)*8388608))>>>0,a,o)}}function nt(et,b,a){var o=et(b,a),d=2*(o>>31)+1,g=o>>>23&255,rt=8388607&o;return g===255?rt?NaN:d*(1/0):g===0?1401298464324817e-60*d*rt:d*Math.pow(2,g-150)*(rt+8388608)}_.writeFloatLE=j.bind(null,s),_.writeFloatBE=j.bind(null,c),_.readFloatLE=nt.bind(null,h),_.readFloatBE=nt.bind(null,$)}(),typeof Float64Array<"u"?function(){var j=new Float64Array([-0]),nt=new Uint8Array(j.buffer),et=nt[7]===128;function b(g,rt,st){j[0]=g,rt[st]=nt[0],rt[st+1]=nt[1],rt[st+2]=nt[2],rt[st+3]=nt[3],rt[st+4]=nt[4],rt[st+5]=nt[5],rt[st+6]=nt[6],rt[st+7]=nt[7]}function a(g,rt,st){j[0]=g,rt[st]=nt[7],rt[st+1]=nt[6],rt[st+2]=nt[5],rt[st+3]=nt[4],rt[st+4]=nt[3],rt[st+5]=nt[2],rt[st+6]=nt[1],rt[st+7]=nt[0]}function o(g,rt){return nt[0]=g[rt],nt[1]=g[rt+1],nt[2]=g[rt+2],nt[3]=g[rt+3],nt[4]=g[rt+4],nt[5]=g[rt+5],nt[6]=g[rt+6],nt[7]=g[rt+7],j[0]}function d(g,rt){return nt[7]=g[rt],nt[6]=g[rt+1],nt[5]=g[rt+2],nt[4]=g[rt+3],nt[3]=g[rt+4],nt[2]=g[rt+5],nt[1]=g[rt+6],nt[0]=g[rt+7],j[0]}_.writeDoubleLE=et?b:a,_.writeDoubleBE=et?a:b,_.readDoubleLE=et?o:d,_.readDoubleBE=et?d:o}():function(){function j(et,b,a,o,d,g){var rt=o<0?1:0;if(rt&&(o=-o),o===0)et(0,d,g+b),et(1/o>0?0:2147483648,d,g+a);else if(isNaN(o))et(0,d,g+b),et(2146959360,d,g+a);else if(o>17976931348623157e292)et(0,d,g+b),et((rt<<31|2146435072)>>>0,d,g+a);else{var st;if(o<22250738585072014e-324)et((st=o/5e-324)>>>0,d,g+b),et((rt<<31|st/4294967296)>>>0,d,g+a);else{var tt=Math.floor(Math.log(o)/Math.LN2);tt===1024&&(tt=1023),et(4503599627370496*(st=o*Math.pow(2,-tt))>>>0,d,g+b),et((rt<<31|tt+1023<<20|1048576*st&1048575)>>>0,d,g+a)}}}function nt(et,b,a,o,d){var g=et(o,d+b),rt=et(o,d+a),st=2*(rt>>31)+1,tt=rt>>>20&2047,ot=4294967296*(1048575&rt)+g;return tt===2047?ot?NaN:st*(1/0):tt===0?5e-324*st*ot:st*Math.pow(2,tt-1075)*(ot+4503599627370496)}_.writeDoubleLE=j.bind(null,s,0,4),_.writeDoubleBE=j.bind(null,c,4,0),_.readDoubleLE=nt.bind(null,h,0,4),_.readDoubleBE=nt.bind(null,$,4,0)}(),_}function s(_,j,nt){j[nt]=255&_,j[nt+1]=_>>>8&255,j[nt+2]=_>>>16&255,j[nt+3]=_>>>24}function c(_,j,nt){j[nt]=_>>>24,j[nt+1]=_>>>16&255,j[nt+2]=_>>>8&255,j[nt+3]=255&_}function h(_,j){return(_[j]|_[j+1]<<8|_[j+2]<<16|_[j+3]<<24)>>>0}function $(_,j){return(_[j]<<24|_[j+1]<<16|_[j+2]<<8|_[j+3])>>>0}i.exports=e(e)},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(e,s,c){var h=c||8192,$=h>>>1,_=null,j=h;return function(nt){if(nt<1||nt>$)return e(nt);j+nt>h&&(_=e(h),j=0);var et=s.call(_,j,j+=nt);return 7&j&&(j=1+(7|j)),et}}},4997:(i,e)=>{var s=e;s.length=function(c){for(var h=0,$=0,_=0;_<c.length;++_)($=c.charCodeAt(_))<128?h+=1:$<2048?h+=2:(64512&$)==55296&&(64512&c.charCodeAt(_+1))==56320?(++_,h+=4):h+=3;return h},s.read=function(c,h,$){if($-h<1)return"";for(var _,j=null,nt=[],et=0;h<$;)(_=c[h++])<128?nt[et++]=_:_>191&&_<224?nt[et++]=(31&_)<<6|63&c[h++]:_>239&&_<365?(_=((7&_)<<18|(63&c[h++])<<12|(63&c[h++])<<6|63&c[h++])-65536,nt[et++]=55296+(_>>10),nt[et++]=56320+(1023&_)):nt[et++]=(15&_)<<12|(63&c[h++])<<6|63&c[h++],et>8191&&((j||(j=[])).push(String.fromCharCode.apply(String,nt)),et=0);return j?(et&&j.push(String.fromCharCode.apply(String,nt.slice(0,et))),j.join("")):String.fromCharCode.apply(String,nt.slice(0,et))},s.write=function(c,h,$){for(var _,j,nt=$,et=0;et<c.length;++et)(_=c.charCodeAt(et))<128?h[$++]=_:_<2048?(h[$++]=_>>6|192,h[$++]=63&_|128):(64512&_)==55296&&(64512&(j=c.charCodeAt(et+1)))==56320?(_=65536+((1023&_)<<10)+(1023&j),++et,h[$++]=_>>18|240,h[$++]=_>>12&63|128,h[$++]=_>>6&63|128,h[$++]=63&_|128):(h[$++]=_>>12|224,h[$++]=_>>6&63|128,h[$++]=63&_|128);return $-nt}},3442:(i,e)=>{e.__esModule=!0;var s=function(){function c(h){if(!h)throw new TypeError("Invalid argument; `value` has no value.");this.value=c.EMPTY,h&&c.isGuid(h)&&(this.value=h)}return c.isGuid=function(h){var $=h.toString();return h&&(h instanceof c||c.validator.test($))},c.create=function(){return new c([c.gen(2),c.gen(1),c.gen(1),c.gen(1),c.gen(3)].join("-"))},c.createEmpty=function(){return new c("emptyguid")},c.parse=function(h){return new c(h)},c.raw=function(){return[c.gen(2),c.gen(1),c.gen(1),c.gen(1),c.gen(3)].join("-")},c.gen=function(h){for(var $="",_=0;_<h;_++)$+=(65536*(1+Math.random())|0).toString(16).substring(1);return $},c.prototype.equals=function(h){return c.isGuid(h)&&this.value===h.toString()},c.prototype.isEmpty=function(){return this.value===c.EMPTY},c.prototype.toString=function(){return this.value},c.prototype.toJSON=function(){return{value:this.value}},c.validator=new RegExp("^[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}$","i"),c.EMPTY="00000000-0000-0000-0000-000000000000",c}();e.Guid=s},3720:i=>{i.exports=s;var e=null;try{e=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(dt,yt,St){this.low=0|dt,this.high=0|yt,this.unsigned=!!St}function c(dt){return(dt&&dt.__isLong__)===!0}s.prototype.__isLong__,Object.defineProperty(s.prototype,"__isLong__",{value:!0}),s.isLong=c;var h={},$={};function _(dt,yt){var St,bt,Tt;return yt?(Tt=0<=(dt>>>=0)&&dt<256)&&(bt=$[dt])?bt:(St=nt(dt,(0|dt)<0?-1:0,!0),Tt&&($[dt]=St),St):(Tt=-128<=(dt|=0)&&dt<128)&&(bt=h[dt])?bt:(St=nt(dt,dt<0?-1:0,!1),Tt&&(h[dt]=St),St)}function j(dt,yt){if(isNaN(dt))return yt?tt:st;if(yt){if(dt<0)return tt;if(dt>=d)return lt}else{if(dt<=-g)return ct;if(dt+1>=g)return ut}return dt<0?j(-dt,yt).neg():nt(dt%o|0,dt/o|0,yt)}function nt(dt,yt,St){return new s(dt,yt,St)}s.fromInt=_,s.fromNumber=j,s.fromBits=nt;var et=Math.pow;function b(dt,yt,St){if(dt.length===0)throw Error("empty string");if(dt==="NaN"||dt==="Infinity"||dt==="+Infinity"||dt==="-Infinity")return st;if(typeof yt=="number"?(St=yt,yt=!1):yt=!!yt,(St=St||10)<2||36<St)throw RangeError("radix");var bt;if((bt=dt.indexOf("-"))>0)throw Error("interior hyphen");if(bt===0)return b(dt.substring(1),yt,St).neg();for(var Tt=j(et(St,8)),vt=st,$t=0;$t<dt.length;$t+=8){var At=Math.min(8,dt.length-$t),Ot=parseInt(dt.substring($t,$t+At),St);if(At<8){var It=j(et(St,At));vt=vt.mul(It).add(j(Ot))}else vt=(vt=vt.mul(Tt)).add(j(Ot))}return vt.unsigned=yt,vt}function a(dt,yt){return typeof dt=="number"?j(dt,yt):typeof dt=="string"?b(dt,yt):nt(dt.low,dt.high,typeof yt=="boolean"?yt:dt.unsigned)}s.fromString=b,s.fromValue=a;var o=4294967296,d=o*o,g=d/2,rt=_(1<<24),st=_(0);s.ZERO=st;var tt=_(0,!0);s.UZERO=tt;var ot=_(1);s.ONE=ot;var it=_(1,!0);s.UONE=it;var at=_(-1);s.NEG_ONE=at;var ut=nt(-1,2147483647,!1);s.MAX_VALUE=ut;var lt=nt(-1,-1,!0);s.MAX_UNSIGNED_VALUE=lt;var ct=nt(0,-2147483648,!1);s.MIN_VALUE=ct;var ft=s.prototype;ft.toInt=function(){return this.unsigned?this.low>>>0:this.low},ft.toNumber=function(){return this.unsigned?(this.high>>>0)*o+(this.low>>>0):this.high*o+(this.low>>>0)},ft.toString=function(dt){if((dt=dt||10)<2||36<dt)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(ct)){var yt=j(dt),St=this.div(yt),bt=St.mul(yt).sub(this);return St.toString(dt)+bt.toInt().toString(dt)}return"-"+this.neg().toString(dt)}for(var Tt=j(et(dt,6),this.unsigned),vt=this,$t="";;){var At=vt.div(Tt),Ot=(vt.sub(At.mul(Tt)).toInt()>>>0).toString(dt);if((vt=At).isZero())return Ot+$t;for(;Ot.length<6;)Ot="0"+Ot;$t=""+Ot+$t}},ft.getHighBits=function(){return this.high},ft.getHighBitsUnsigned=function(){return this.high>>>0},ft.getLowBits=function(){return this.low},ft.getLowBitsUnsigned=function(){return this.low>>>0},ft.getNumBitsAbs=function(){if(this.isNegative())return this.eq(ct)?64:this.neg().getNumBitsAbs();for(var dt=this.high!=0?this.high:this.low,yt=31;yt>0&&!(dt&1<<yt);yt--);return this.high!=0?yt+33:yt+1},ft.isZero=function(){return this.high===0&&this.low===0},ft.eqz=ft.isZero,ft.isNegative=function(){return!this.unsigned&&this.high<0},ft.isPositive=function(){return this.unsigned||this.high>=0},ft.isOdd=function(){return(1&this.low)==1},ft.isEven=function(){return(1&this.low)==0},ft.equals=function(dt){return c(dt)||(dt=a(dt)),(this.unsigned===dt.unsigned||this.high>>>31!=1||dt.high>>>31!=1)&&this.high===dt.high&&this.low===dt.low},ft.eq=ft.equals,ft.notEquals=function(dt){return!this.eq(dt)},ft.neq=ft.notEquals,ft.ne=ft.notEquals,ft.lessThan=function(dt){return this.comp(dt)<0},ft.lt=ft.lessThan,ft.lessThanOrEqual=function(dt){return this.comp(dt)<=0},ft.lte=ft.lessThanOrEqual,ft.le=ft.lessThanOrEqual,ft.greaterThan=function(dt){return this.comp(dt)>0},ft.gt=ft.greaterThan,ft.greaterThanOrEqual=function(dt){return this.comp(dt)>=0},ft.gte=ft.greaterThanOrEqual,ft.ge=ft.greaterThanOrEqual,ft.compare=function(dt){if(c(dt)||(dt=a(dt)),this.eq(dt))return 0;var yt=this.isNegative(),St=dt.isNegative();return yt&&!St?-1:!yt&&St?1:this.unsigned?dt.high>>>0>this.high>>>0||dt.high===this.high&&dt.low>>>0>this.low>>>0?-1:1:this.sub(dt).isNegative()?-1:1},ft.comp=ft.compare,ft.negate=function(){return!this.unsigned&&this.eq(ct)?ct:this.not().add(ot)},ft.neg=ft.negate,ft.add=function(dt){c(dt)||(dt=a(dt));var yt=this.high>>>16,St=65535&this.high,bt=this.low>>>16,Tt=65535&this.low,vt=dt.high>>>16,$t=65535&dt.high,At=dt.low>>>16,Ot=0,It=0,jt=0,Et=0;return jt+=(Et+=Tt+(65535&dt.low))>>>16,It+=(jt+=bt+At)>>>16,Ot+=(It+=St+$t)>>>16,Ot+=yt+vt,nt((jt&=65535)<<16|(Et&=65535),(Ot&=65535)<<16|(It&=65535),this.unsigned)},ft.subtract=function(dt){return c(dt)||(dt=a(dt)),this.add(dt.neg())},ft.sub=ft.subtract,ft.multiply=function(dt){if(this.isZero())return st;if(c(dt)||(dt=a(dt)),e)return nt(e.mul(this.low,this.high,dt.low,dt.high),e.get_high(),this.unsigned);if(dt.isZero())return st;if(this.eq(ct))return dt.isOdd()?ct:st;if(dt.eq(ct))return this.isOdd()?ct:st;if(this.isNegative())return dt.isNegative()?this.neg().mul(dt.neg()):this.neg().mul(dt).neg();if(dt.isNegative())return this.mul(dt.neg()).neg();if(this.lt(rt)&&dt.lt(rt))return j(this.toNumber()*dt.toNumber(),this.unsigned);var yt=this.high>>>16,St=65535&this.high,bt=this.low>>>16,Tt=65535&this.low,vt=dt.high>>>16,$t=65535&dt.high,At=dt.low>>>16,Ot=65535&dt.low,It=0,jt=0,Et=0,mt=0;return Et+=(mt+=Tt*Ot)>>>16,jt+=(Et+=bt*Ot)>>>16,Et&=65535,jt+=(Et+=Tt*At)>>>16,It+=(jt+=St*Ot)>>>16,jt&=65535,It+=(jt+=bt*At)>>>16,jt&=65535,It+=(jt+=Tt*$t)>>>16,It+=yt*Ot+St*At+bt*$t+Tt*vt,nt((Et&=65535)<<16|(mt&=65535),(It&=65535)<<16|(jt&=65535),this.unsigned)},ft.mul=ft.multiply,ft.divide=function(dt){if(c(dt)||(dt=a(dt)),dt.isZero())throw Error("division by zero");var yt,St,bt;if(e)return this.unsigned||this.high!==-2147483648||dt.low!==-1||dt.high!==-1?nt((this.unsigned?e.div_u:e.div_s)(this.low,this.high,dt.low,dt.high),e.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?tt:st;if(this.unsigned){if(dt.unsigned||(dt=dt.toUnsigned()),dt.gt(this))return tt;if(dt.gt(this.shru(1)))return it;bt=tt}else{if(this.eq(ct))return dt.eq(ot)||dt.eq(at)?ct:dt.eq(ct)?ot:(yt=this.shr(1).div(dt).shl(1)).eq(st)?dt.isNegative()?ot:at:(St=this.sub(dt.mul(yt)),bt=yt.add(St.div(dt)));if(dt.eq(ct))return this.unsigned?tt:st;if(this.isNegative())return dt.isNegative()?this.neg().div(dt.neg()):this.neg().div(dt).neg();if(dt.isNegative())return this.div(dt.neg()).neg();bt=st}for(St=this;St.gte(dt);){yt=Math.max(1,Math.floor(St.toNumber()/dt.toNumber()));for(var Tt=Math.ceil(Math.log(yt)/Math.LN2),vt=Tt<=48?1:et(2,Tt-48),$t=j(yt),At=$t.mul(dt);At.isNegative()||At.gt(St);)At=($t=j(yt-=vt,this.unsigned)).mul(dt);$t.isZero()&&($t=ot),bt=bt.add($t),St=St.sub(At)}return bt},ft.div=ft.divide,ft.modulo=function(dt){return c(dt)||(dt=a(dt)),e?nt((this.unsigned?e.rem_u:e.rem_s)(this.low,this.high,dt.low,dt.high),e.get_high(),this.unsigned):this.sub(this.div(dt).mul(dt))},ft.mod=ft.modulo,ft.rem=ft.modulo,ft.not=function(){return nt(~this.low,~this.high,this.unsigned)},ft.and=function(dt){return c(dt)||(dt=a(dt)),nt(this.low&dt.low,this.high&dt.high,this.unsigned)},ft.or=function(dt){return c(dt)||(dt=a(dt)),nt(this.low|dt.low,this.high|dt.high,this.unsigned)},ft.xor=function(dt){return c(dt)||(dt=a(dt)),nt(this.low^dt.low,this.high^dt.high,this.unsigned)},ft.shiftLeft=function(dt){return c(dt)&&(dt=dt.toInt()),(dt&=63)==0?this:dt<32?nt(this.low<<dt,this.high<<dt|this.low>>>32-dt,this.unsigned):nt(0,this.low<<dt-32,this.unsigned)},ft.shl=ft.shiftLeft,ft.shiftRight=function(dt){return c(dt)&&(dt=dt.toInt()),(dt&=63)==0?this:dt<32?nt(this.low>>>dt|this.high<<32-dt,this.high>>dt,this.unsigned):nt(this.high>>dt-32,this.high>=0?0:-1,this.unsigned)},ft.shr=ft.shiftRight,ft.shiftRightUnsigned=function(dt){if(c(dt)&&(dt=dt.toInt()),(dt&=63)==0)return this;var yt=this.high;return dt<32?nt(this.low>>>dt|yt<<32-dt,yt>>>dt,this.unsigned):nt(dt===32?yt:yt>>>dt-32,0,this.unsigned)},ft.shru=ft.shiftRightUnsigned,ft.shr_u=ft.shiftRightUnsigned,ft.toSigned=function(){return this.unsigned?nt(this.low,this.high,!1):this},ft.toUnsigned=function(){return this.unsigned?this:nt(this.low,this.high,!0)},ft.toBytes=function(dt){return dt?this.toBytesLE():this.toBytesBE()},ft.toBytesLE=function(){var dt=this.high,yt=this.low;return[255&yt,yt>>>8&255,yt>>>16&255,yt>>>24,255&dt,dt>>>8&255,dt>>>16&255,dt>>>24]},ft.toBytesBE=function(){var dt=this.high,yt=this.low;return[dt>>>24,dt>>>16&255,dt>>>8&255,255&dt,yt>>>24,yt>>>16&255,yt>>>8&255,255&yt]},s.fromBytes=function(dt,yt,St){return St?s.fromBytesLE(dt,yt):s.fromBytesBE(dt,yt)},s.fromBytesLE=function(dt,yt){return new s(dt[0]|dt[1]<<8|dt[2]<<16|dt[3]<<24,dt[4]|dt[5]<<8|dt[6]<<16|dt[7]<<24,yt)},s.fromBytesBE=function(dt,yt){return new s(dt[4]<<24|dt[5]<<16|dt[6]<<8|dt[7],dt[0]<<24|dt[1]<<16|dt[2]<<8|dt[3],yt)}},1446:(i,e,s)=>{var c,h,$,_=s(2100),j=_.Reader,nt=_.Writer,et=_.util,b=_.roots.default||(_.roots.default={});b.onnx=(($={}).Version=(c={},(h=Object.create(c))[c[0]="_START_VERSION"]=0,h[c[1]="IR_VERSION_2017_10_10"]=1,h[c[2]="IR_VERSION_2017_10_30"]=2,h[c[3]="IR_VERSION_2017_11_3"]=3,h[c[4]="IR_VERSION_2019_1_22"]=4,h[c[5]="IR_VERSION"]=5,h),$.AttributeProto=function(){function a(o){if(this.floats=[],this.ints=[],this.strings=[],this.tensors=[],this.graphs=[],o)for(var d=Object.keys(o),g=0;g<d.length;++g)o[d[g]]!=null&&(this[d[g]]=o[d[g]])}return a.prototype.name="",a.prototype.refAttrName="",a.prototype.docString="",a.prototype.type=0,a.prototype.f=0,a.prototype.i=et.Long?et.Long.fromBits(0,0,!1):0,a.prototype.s=et.newBuffer([]),a.prototype.t=null,a.prototype.g=null,a.prototype.floats=et.emptyArray,a.prototype.ints=et.emptyArray,a.prototype.strings=et.emptyArray,a.prototype.tensors=et.emptyArray,a.prototype.graphs=et.emptyArray,a.create=function(o){return new a(o)},a.encode=function(o,d){if(d||(d=nt.create()),o.name!=null&&o.hasOwnProperty("name")&&d.uint32(10).string(o.name),o.f!=null&&o.hasOwnProperty("f")&&d.uint32(21).float(o.f),o.i!=null&&o.hasOwnProperty("i")&&d.uint32(24).int64(o.i),o.s!=null&&o.hasOwnProperty("s")&&d.uint32(34).bytes(o.s),o.t!=null&&o.hasOwnProperty("t")&&b.onnx.TensorProto.encode(o.t,d.uint32(42).fork()).ldelim(),o.g!=null&&o.hasOwnProperty("g")&&b.onnx.GraphProto.encode(o.g,d.uint32(50).fork()).ldelim(),o.floats!=null&&o.floats.length){d.uint32(58).fork();for(var g=0;g<o.floats.length;++g)d.float(o.floats[g]);d.ldelim()}if(o.ints!=null&&o.ints.length){for(d.uint32(66).fork(),g=0;g<o.ints.length;++g)d.int64(o.ints[g]);d.ldelim()}if(o.strings!=null&&o.strings.length)for(g=0;g<o.strings.length;++g)d.uint32(74).bytes(o.strings[g]);if(o.tensors!=null&&o.tensors.length)for(g=0;g<o.tensors.length;++g)b.onnx.TensorProto.encode(o.tensors[g],d.uint32(82).fork()).ldelim();if(o.graphs!=null&&o.graphs.length)for(g=0;g<o.graphs.length;++g)b.onnx.GraphProto.encode(o.graphs[g],d.uint32(90).fork()).ldelim();return o.docString!=null&&o.hasOwnProperty("docString")&&d.uint32(106).string(o.docString),o.type!=null&&o.hasOwnProperty("type")&&d.uint32(160).int32(o.type),o.refAttrName!=null&&o.hasOwnProperty("refAttrName")&&d.uint32(170).string(o.refAttrName),d},a.encodeDelimited=function(o,d){return this.encode(o,d).ldelim()},a.decode=function(o,d){o instanceof j||(o=j.create(o));for(var g=d===void 0?o.len:o.pos+d,rt=new b.onnx.AttributeProto;o.pos<g;){var st=o.uint32();switch(st>>>3){case 1:rt.name=o.string();break;case 21:rt.refAttrName=o.string();break;case 13:rt.docString=o.string();break;case 20:rt.type=o.int32();break;case 2:rt.f=o.float();break;case 3:rt.i=o.int64();break;case 4:rt.s=o.bytes();break;case 5:rt.t=b.onnx.TensorProto.decode(o,o.uint32());break;case 6:rt.g=b.onnx.GraphProto.decode(o,o.uint32());break;case 7:if(rt.floats&&rt.floats.length||(rt.floats=[]),(7&st)==2)for(var tt=o.uint32()+o.pos;o.pos<tt;)rt.floats.push(o.float());else rt.floats.push(o.float());break;case 8:if(rt.ints&&rt.ints.length||(rt.ints=[]),(7&st)==2)for(tt=o.uint32()+o.pos;o.pos<tt;)rt.ints.push(o.int64());else rt.ints.push(o.int64());break;case 9:rt.strings&&rt.strings.length||(rt.strings=[]),rt.strings.push(o.bytes());break;case 10:rt.tensors&&rt.tensors.length||(rt.tensors=[]),rt.tensors.push(b.onnx.TensorProto.decode(o,o.uint32()));break;case 11:rt.graphs&&rt.graphs.length||(rt.graphs=[]),rt.graphs.push(b.onnx.GraphProto.decode(o,o.uint32()));break;default:o.skipType(7&st)}}return rt},a.decodeDelimited=function(o){return o instanceof j||(o=new j(o)),this.decode(o,o.uint32())},a.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.name!=null&&o.hasOwnProperty("name")&&!et.isString(o.name))return"name: string expected";if(o.refAttrName!=null&&o.hasOwnProperty("refAttrName")&&!et.isString(o.refAttrName))return"refAttrName: string expected";if(o.docString!=null&&o.hasOwnProperty("docString")&&!et.isString(o.docString))return"docString: string expected";if(o.type!=null&&o.hasOwnProperty("type"))switch(o.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:}if(o.f!=null&&o.hasOwnProperty("f")&&typeof o.f!="number")return"f: number expected";if(o.i!=null&&o.hasOwnProperty("i")&&!(et.isInteger(o.i)||o.i&&et.isInteger(o.i.low)&&et.isInteger(o.i.high)))return"i: integer|Long expected";if(o.s!=null&&o.hasOwnProperty("s")&&!(o.s&&typeof o.s.length=="number"||et.isString(o.s)))return"s: buffer expected";if(o.t!=null&&o.hasOwnProperty("t")&&(g=b.onnx.TensorProto.verify(o.t)))return"t."+g;if(o.g!=null&&o.hasOwnProperty("g")&&(g=b.onnx.GraphProto.verify(o.g)))return"g."+g;if(o.floats!=null&&o.hasOwnProperty("floats")){if(!Array.isArray(o.floats))return"floats: array expected";for(var d=0;d<o.floats.length;++d)if(typeof o.floats[d]!="number")return"floats: number[] expected"}if(o.ints!=null&&o.hasOwnProperty("ints")){if(!Array.isArray(o.ints))return"ints: array expected";for(d=0;d<o.ints.length;++d)if(!(et.isInteger(o.ints[d])||o.ints[d]&&et.isInteger(o.ints[d].low)&&et.isInteger(o.ints[d].high)))return"ints: integer|Long[] expected"}if(o.strings!=null&&o.hasOwnProperty("strings")){if(!Array.isArray(o.strings))return"strings: array expected";for(d=0;d<o.strings.length;++d)if(!(o.strings[d]&&typeof o.strings[d].length=="number"||et.isString(o.strings[d])))return"strings: buffer[] expected"}if(o.tensors!=null&&o.hasOwnProperty("tensors")){if(!Array.isArray(o.tensors))return"tensors: array expected";for(d=0;d<o.tensors.length;++d)if(g=b.onnx.TensorProto.verify(o.tensors[d]))return"tensors."+g}if(o.graphs!=null&&o.hasOwnProperty("graphs")){if(!Array.isArray(o.graphs))return"graphs: array expected";for(d=0;d<o.graphs.length;++d){var g;if(g=b.onnx.GraphProto.verify(o.graphs[d]))return"graphs."+g}}return null},a.fromObject=function(o){if(o instanceof b.onnx.AttributeProto)return o;var d=new b.onnx.AttributeProto;switch(o.name!=null&&(d.name=String(o.name)),o.refAttrName!=null&&(d.refAttrName=String(o.refAttrName)),o.docString!=null&&(d.docString=String(o.docString)),o.type){case"UNDEFINED":case 0:d.type=0;break;case"FLOAT":case 1:d.type=1;break;case"INT":case 2:d.type=2;break;case"STRING":case 3:d.type=3;break;case"TENSOR":case 4:d.type=4;break;case"GRAPH":case 5:d.type=5;break;case"FLOATS":case 6:d.type=6;break;case"INTS":case 7:d.type=7;break;case"STRINGS":case 8:d.type=8;break;case"TENSORS":case 9:d.type=9;break;case"GRAPHS":case 10:d.type=10}if(o.f!=null&&(d.f=Number(o.f)),o.i!=null&&(et.Long?(d.i=et.Long.fromValue(o.i)).unsigned=!1:typeof o.i=="string"?d.i=parseInt(o.i,10):typeof o.i=="number"?d.i=o.i:typeof o.i=="object"&&(d.i=new et.LongBits(o.i.low>>>0,o.i.high>>>0).toNumber())),o.s!=null&&(typeof o.s=="string"?et.base64.decode(o.s,d.s=et.newBuffer(et.base64.length(o.s)),0):o.s.length&&(d.s=o.s)),o.t!=null){if(typeof o.t!="object")throw TypeError(".onnx.AttributeProto.t: object expected");d.t=b.onnx.TensorProto.fromObject(o.t)}if(o.g!=null){if(typeof o.g!="object")throw TypeError(".onnx.AttributeProto.g: object expected");d.g=b.onnx.GraphProto.fromObject(o.g)}if(o.floats){if(!Array.isArray(o.floats))throw TypeError(".onnx.AttributeProto.floats: array expected");d.floats=[];for(var g=0;g<o.floats.length;++g)d.floats[g]=Number(o.floats[g])}if(o.ints){if(!Array.isArray(o.ints))throw TypeError(".onnx.AttributeProto.ints: array expected");for(d.ints=[],g=0;g<o.ints.length;++g)et.Long?(d.ints[g]=et.Long.fromValue(o.ints[g])).unsigned=!1:typeof o.ints[g]=="string"?d.ints[g]=parseInt(o.ints[g],10):typeof o.ints[g]=="number"?d.ints[g]=o.ints[g]:typeof o.ints[g]=="object"&&(d.ints[g]=new et.LongBits(o.ints[g].low>>>0,o.ints[g].high>>>0).toNumber())}if(o.strings){if(!Array.isArray(o.strings))throw TypeError(".onnx.AttributeProto.strings: array expected");for(d.strings=[],g=0;g<o.strings.length;++g)typeof o.strings[g]=="string"?et.base64.decode(o.strings[g],d.strings[g]=et.newBuffer(et.base64.length(o.strings[g])),0):o.strings[g].length&&(d.strings[g]=o.strings[g])}if(o.tensors){if(!Array.isArray(o.tensors))throw TypeError(".onnx.AttributeProto.tensors: array expected");for(d.tensors=[],g=0;g<o.tensors.length;++g){if(typeof o.tensors[g]!="object")throw TypeError(".onnx.AttributeProto.tensors: object expected");d.tensors[g]=b.onnx.TensorProto.fromObject(o.tensors[g])}}if(o.graphs){if(!Array.isArray(o.graphs))throw TypeError(".onnx.AttributeProto.graphs: array expected");for(d.graphs=[],g=0;g<o.graphs.length;++g){if(typeof o.graphs[g]!="object")throw TypeError(".onnx.AttributeProto.graphs: object expected");d.graphs[g]=b.onnx.GraphProto.fromObject(o.graphs[g])}}return d},a.toObject=function(o,d){d||(d={});var g={};if((d.arrays||d.defaults)&&(g.floats=[],g.ints=[],g.strings=[],g.tensors=[],g.graphs=[]),d.defaults){if(g.name="",g.f=0,et.Long){var rt=new et.Long(0,0,!1);g.i=d.longs===String?rt.toString():d.longs===Number?rt.toNumber():rt}else g.i=d.longs===String?"0":0;d.bytes===String?g.s="":(g.s=[],d.bytes!==Array&&(g.s=et.newBuffer(g.s))),g.t=null,g.g=null,g.docString="",g.type=d.enums===String?"UNDEFINED":0,g.refAttrName=""}if(o.name!=null&&o.hasOwnProperty("name")&&(g.name=o.name),o.f!=null&&o.hasOwnProperty("f")&&(g.f=d.json&&!isFinite(o.f)?String(o.f):o.f),o.i!=null&&o.hasOwnProperty("i")&&(typeof o.i=="number"?g.i=d.longs===String?String(o.i):o.i:g.i=d.longs===String?et.Long.prototype.toString.call(o.i):d.longs===Number?new et.LongBits(o.i.low>>>0,o.i.high>>>0).toNumber():o.i),o.s!=null&&o.hasOwnProperty("s")&&(g.s=d.bytes===String?et.base64.encode(o.s,0,o.s.length):d.bytes===Array?Array.prototype.slice.call(o.s):o.s),o.t!=null&&o.hasOwnProperty("t")&&(g.t=b.onnx.TensorProto.toObject(o.t,d)),o.g!=null&&o.hasOwnProperty("g")&&(g.g=b.onnx.GraphProto.toObject(o.g,d)),o.floats&&o.floats.length){g.floats=[];for(var st=0;st<o.floats.length;++st)g.floats[st]=d.json&&!isFinite(o.floats[st])?String(o.floats[st]):o.floats[st]}if(o.ints&&o.ints.length)for(g.ints=[],st=0;st<o.ints.length;++st)typeof o.ints[st]=="number"?g.ints[st]=d.longs===String?String(o.ints[st]):o.ints[st]:g.ints[st]=d.longs===String?et.Long.prototype.toString.call(o.ints[st]):d.longs===Number?new et.LongBits(o.ints[st].low>>>0,o.ints[st].high>>>0).toNumber():o.ints[st];if(o.strings&&o.strings.length)for(g.strings=[],st=0;st<o.strings.length;++st)g.strings[st]=d.bytes===String?et.base64.encode(o.strings[st],0,o.strings[st].length):d.bytes===Array?Array.prototype.slice.call(o.strings[st]):o.strings[st];if(o.tensors&&o.tensors.length)for(g.tensors=[],st=0;st<o.tensors.length;++st)g.tensors[st]=b.onnx.TensorProto.toObject(o.tensors[st],d);if(o.graphs&&o.graphs.length)for(g.graphs=[],st=0;st<o.graphs.length;++st)g.graphs[st]=b.onnx.GraphProto.toObject(o.graphs[st],d);return o.docString!=null&&o.hasOwnProperty("docString")&&(g.docString=o.docString),o.type!=null&&o.hasOwnProperty("type")&&(g.type=d.enums===String?b.onnx.AttributeProto.AttributeType[o.type]:o.type),o.refAttrName!=null&&o.hasOwnProperty("refAttrName")&&(g.refAttrName=o.refAttrName),g},a.prototype.toJSON=function(){return this.constructor.toObject(this,_.util.toJSONOptions)},a.AttributeType=function(){var o={},d=Object.create(o);return d[o[0]="UNDEFINED"]=0,d[o[1]="FLOAT"]=1,d[o[2]="INT"]=2,d[o[3]="STRING"]=3,d[o[4]="TENSOR"]=4,d[o[5]="GRAPH"]=5,d[o[6]="FLOATS"]=6,d[o[7]="INTS"]=7,d[o[8]="STRINGS"]=8,d[o[9]="TENSORS"]=9,d[o[10]="GRAPHS"]=10,d}(),a}(),$.ValueInfoProto=function(){function a(o){if(o)for(var d=Object.keys(o),g=0;g<d.length;++g)o[d[g]]!=null&&(this[d[g]]=o[d[g]])}return a.prototype.name="",a.prototype.type=null,a.prototype.docString="",a.create=function(o){return new a(o)},a.encode=function(o,d){return d||(d=nt.create()),o.name!=null&&o.hasOwnProperty("name")&&d.uint32(10).string(o.name),o.type!=null&&o.hasOwnProperty("type")&&b.onnx.TypeProto.encode(o.type,d.uint32(18).fork()).ldelim(),o.docString!=null&&o.hasOwnProperty("docString")&&d.uint32(26).string(o.docString),d},a.encodeDelimited=function(o,d){return this.encode(o,d).ldelim()},a.decode=function(o,d){o instanceof j||(o=j.create(o));for(var g=d===void 0?o.len:o.pos+d,rt=new b.onnx.ValueInfoProto;o.pos<g;){var st=o.uint32();switch(st>>>3){case 1:rt.name=o.string();break;case 2:rt.type=b.onnx.TypeProto.decode(o,o.uint32());break;case 3:rt.docString=o.string();break;default:o.skipType(7&st)}}return rt},a.decodeDelimited=function(o){return o instanceof j||(o=new j(o)),this.decode(o,o.uint32())},a.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.name!=null&&o.hasOwnProperty("name")&&!et.isString(o.name))return"name: string expected";if(o.type!=null&&o.hasOwnProperty("type")){var d=b.onnx.TypeProto.verify(o.type);if(d)return"type."+d}return o.docString!=null&&o.hasOwnProperty("docString")&&!et.isString(o.docString)?"docString: string expected":null},a.fromObject=function(o){if(o instanceof b.onnx.ValueInfoProto)return o;var d=new b.onnx.ValueInfoProto;if(o.name!=null&&(d.name=String(o.name)),o.type!=null){if(typeof o.type!="object")throw TypeError(".onnx.ValueInfoProto.type: object expected");d.type=b.onnx.TypeProto.fromObject(o.type)}return o.docString!=null&&(d.docString=String(o.docString)),d},a.toObject=function(o,d){d||(d={});var g={};return d.defaults&&(g.name="",g.type=null,g.docString=""),o.name!=null&&o.hasOwnProperty("name")&&(g.name=o.name),o.type!=null&&o.hasOwnProperty("type")&&(g.type=b.onnx.TypeProto.toObject(o.type,d)),o.docString!=null&&o.hasOwnProperty("docString")&&(g.docString=o.docString),g},a.prototype.toJSON=function(){return this.constructor.toObject(this,_.util.toJSONOptions)},a}(),$.NodeProto=function(){function a(o){if(this.input=[],this.output=[],this.attribute=[],o)for(var d=Object.keys(o),g=0;g<d.length;++g)o[d[g]]!=null&&(this[d[g]]=o[d[g]])}return a.prototype.input=et.emptyArray,a.prototype.output=et.emptyArray,a.prototype.name="",a.prototype.opType="",a.prototype.domain="",a.prototype.attribute=et.emptyArray,a.prototype.docString="",a.create=function(o){return new a(o)},a.encode=function(o,d){if(d||(d=nt.create()),o.input!=null&&o.input.length)for(var g=0;g<o.input.length;++g)d.uint32(10).string(o.input[g]);if(o.output!=null&&o.output.length)for(g=0;g<o.output.length;++g)d.uint32(18).string(o.output[g]);if(o.name!=null&&o.hasOwnProperty("name")&&d.uint32(26).string(o.name),o.opType!=null&&o.hasOwnProperty("opType")&&d.uint32(34).string(o.opType),o.attribute!=null&&o.attribute.length)for(g=0;g<o.attribute.length;++g)b.onnx.AttributeProto.encode(o.attribute[g],d.uint32(42).fork()).ldelim();return o.docString!=null&&o.hasOwnProperty("docString")&&d.uint32(50).string(o.docString),o.domain!=null&&o.hasOwnProperty("domain")&&d.uint32(58).string(o.domain),d},a.encodeDelimited=function(o,d){return this.encode(o,d).ldelim()},a.decode=function(o,d){o instanceof j||(o=j.create(o));for(var g=d===void 0?o.len:o.pos+d,rt=new b.onnx.NodeProto;o.pos<g;){var st=o.uint32();switch(st>>>3){case 1:rt.input&&rt.input.length||(rt.input=[]),rt.input.push(o.string());break;case 2:rt.output&&rt.output.length||(rt.output=[]),rt.output.push(o.string());break;case 3:rt.name=o.string();break;case 4:rt.opType=o.string();break;case 7:rt.domain=o.string();break;case 5:rt.attribute&&rt.attribute.length||(rt.attribute=[]),rt.attribute.push(b.onnx.AttributeProto.decode(o,o.uint32()));break;case 6:rt.docString=o.string();break;default:o.skipType(7&st)}}return rt},a.decodeDelimited=function(o){return o instanceof j||(o=new j(o)),this.decode(o,o.uint32())},a.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.input!=null&&o.hasOwnProperty("input")){if(!Array.isArray(o.input))return"input: array expected";for(var d=0;d<o.input.length;++d)if(!et.isString(o.input[d]))return"input: string[] expected"}if(o.output!=null&&o.hasOwnProperty("output")){if(!Array.isArray(o.output))return"output: array expected";for(d=0;d<o.output.length;++d)if(!et.isString(o.output[d]))return"output: string[] expected"}if(o.name!=null&&o.hasOwnProperty("name")&&!et.isString(o.name))return"name: string expected";if(o.opType!=null&&o.hasOwnProperty("opType")&&!et.isString(o.opType))return"opType: string expected";if(o.domain!=null&&o.hasOwnProperty("domain")&&!et.isString(o.domain))return"domain: string expected";if(o.attribute!=null&&o.hasOwnProperty("attribute")){if(!Array.isArray(o.attribute))return"attribute: array expected";for(d=0;d<o.attribute.length;++d){var g=b.onnx.AttributeProto.verify(o.attribute[d]);if(g)return"attribute."+g}}return o.docString!=null&&o.hasOwnProperty("docString")&&!et.isString(o.docString)?"docString: string expected":null},a.fromObject=function(o){if(o instanceof b.onnx.NodeProto)return o;var d=new b.onnx.NodeProto;if(o.input){if(!Array.isArray(o.input))throw TypeError(".onnx.NodeProto.input: array expected");d.input=[];for(var g=0;g<o.input.length;++g)d.input[g]=String(o.input[g])}if(o.output){if(!Array.isArray(o.output))throw TypeError(".onnx.NodeProto.output: array expected");for(d.output=[],g=0;g<o.output.length;++g)d.output[g]=String(o.output[g])}if(o.name!=null&&(d.name=String(o.name)),o.opType!=null&&(d.opType=String(o.opType)),o.domain!=null&&(d.domain=String(o.domain)),o.attribute){if(!Array.isArray(o.attribute))throw TypeError(".onnx.NodeProto.attribute: array expected");for(d.attribute=[],g=0;g<o.attribute.length;++g){if(typeof o.attribute[g]!="object")throw TypeError(".onnx.NodeProto.attribute: object expected");d.attribute[g]=b.onnx.AttributeProto.fromObject(o.attribute[g])}}return o.docString!=null&&(d.docString=String(o.docString)),d},a.toObject=function(o,d){d||(d={});var g={};if((d.arrays||d.defaults)&&(g.input=[],g.output=[],g.attribute=[]),d.defaults&&(g.name="",g.opType="",g.docString="",g.domain=""),o.input&&o.input.length){g.input=[];for(var rt=0;rt<o.input.length;++rt)g.input[rt]=o.input[rt]}if(o.output&&o.output.length)for(g.output=[],rt=0;rt<o.output.length;++rt)g.output[rt]=o.output[rt];if(o.name!=null&&o.hasOwnProperty("name")&&(g.name=o.name),o.opType!=null&&o.hasOwnProperty("opType")&&(g.opType=o.opType),o.attribute&&o.attribute.length)for(g.attribute=[],rt=0;rt<o.attribute.length;++rt)g.attribute[rt]=b.onnx.AttributeProto.toObject(o.attribute[rt],d);return o.docString!=null&&o.hasOwnProperty("docString")&&(g.docString=o.docString),o.domain!=null&&o.hasOwnProperty("domain")&&(g.domain=o.domain),g},a.prototype.toJSON=function(){return this.constructor.toObject(this,_.util.toJSONOptions)},a}(),$.ModelProto=function(){function a(o){if(this.opsetImport=[],this.metadataProps=[],o)for(var d=Object.keys(o),g=0;g<d.length;++g)o[d[g]]!=null&&(this[d[g]]=o[d[g]])}return a.prototype.irVersion=et.Long?et.Long.fromBits(0,0,!1):0,a.prototype.opsetImport=et.emptyArray,a.prototype.producerName="",a.prototype.producerVersion="",a.prototype.domain="",a.prototype.modelVersion=et.Long?et.Long.fromBits(0,0,!1):0,a.prototype.docString="",a.prototype.graph=null,a.prototype.metadataProps=et.emptyArray,a.create=function(o){return new a(o)},a.encode=function(o,d){if(d||(d=nt.create()),o.irVersion!=null&&o.hasOwnProperty("irVersion")&&d.uint32(8).int64(o.irVersion),o.producerName!=null&&o.hasOwnProperty("producerName")&&d.uint32(18).string(o.producerName),o.producerVersion!=null&&o.hasOwnProperty("producerVersion")&&d.uint32(26).string(o.producerVersion),o.domain!=null&&o.hasOwnProperty("domain")&&d.uint32(34).string(o.domain),o.modelVersion!=null&&o.hasOwnProperty("modelVersion")&&d.uint32(40).int64(o.modelVersion),o.docString!=null&&o.hasOwnProperty("docString")&&d.uint32(50).string(o.docString),o.graph!=null&&o.hasOwnProperty("graph")&&b.onnx.GraphProto.encode(o.graph,d.uint32(58).fork()).ldelim(),o.opsetImport!=null&&o.opsetImport.length)for(var g=0;g<o.opsetImport.length;++g)b.onnx.OperatorSetIdProto.encode(o.opsetImport[g],d.uint32(66).fork()).ldelim();if(o.metadataProps!=null&&o.metadataProps.length)for(g=0;g<o.metadataProps.length;++g)b.onnx.StringStringEntryProto.encode(o.metadataProps[g],d.uint32(114).fork()).ldelim();return d},a.encodeDelimited=function(o,d){return this.encode(o,d).ldelim()},a.decode=function(o,d){o instanceof j||(o=j.create(o));for(var g=d===void 0?o.len:o.pos+d,rt=new b.onnx.ModelProto;o.pos<g;){var st=o.uint32();switch(st>>>3){case 1:rt.irVersion=o.int64();break;case 8:rt.opsetImport&&rt.opsetImport.length||(rt.opsetImport=[]),rt.opsetImport.push(b.onnx.OperatorSetIdProto.decode(o,o.uint32()));break;case 2:rt.producerName=o.string();break;case 3:rt.producerVersion=o.string();break;case 4:rt.domain=o.string();break;case 5:rt.modelVersion=o.int64();break;case 6:rt.docString=o.string();break;case 7:rt.graph=b.onnx.GraphProto.decode(o,o.uint32());break;case 14:rt.metadataProps&&rt.metadataProps.length||(rt.metadataProps=[]),rt.metadataProps.push(b.onnx.StringStringEntryProto.decode(o,o.uint32()));break;default:o.skipType(7&st)}}return rt},a.decodeDelimited=function(o){return o instanceof j||(o=new j(o)),this.decode(o,o.uint32())},a.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.irVersion!=null&&o.hasOwnProperty("irVersion")&&!(et.isInteger(o.irVersion)||o.irVersion&&et.isInteger(o.irVersion.low)&&et.isInteger(o.irVersion.high)))return"irVersion: integer|Long expected";if(o.opsetImport!=null&&o.hasOwnProperty("opsetImport")){if(!Array.isArray(o.opsetImport))return"opsetImport: array expected";for(var d=0;d<o.opsetImport.length;++d)if(g=b.onnx.OperatorSetIdProto.verify(o.opsetImport[d]))return"opsetImport."+g}if(o.producerName!=null&&o.hasOwnProperty("producerName")&&!et.isString(o.producerName))return"producerName: string expected";if(o.producerVersion!=null&&o.hasOwnProperty("producerVersion")&&!et.isString(o.producerVersion))return"producerVersion: string expected";if(o.domain!=null&&o.hasOwnProperty("domain")&&!et.isString(o.domain))return"domain: string expected";if(o.modelVersion!=null&&o.hasOwnProperty("modelVersion")&&!(et.isInteger(o.modelVersion)||o.modelVersion&&et.isInteger(o.modelVersion.low)&&et.isInteger(o.modelVersion.high)))return"modelVersion: integer|Long expected";if(o.docString!=null&&o.hasOwnProperty("docString")&&!et.isString(o.docString))return"docString: string expected";if(o.graph!=null&&o.hasOwnProperty("graph")&&(g=b.onnx.GraphProto.verify(o.graph)))return"graph."+g;if(o.metadataProps!=null&&o.hasOwnProperty("metadataProps")){if(!Array.isArray(o.metadataProps))return"metadataProps: array expected";for(d=0;d<o.metadataProps.length;++d){var g;if(g=b.onnx.StringStringEntryProto.verify(o.metadataProps[d]))return"metadataProps."+g}}return null},a.fromObject=function(o){if(o instanceof b.onnx.ModelProto)return o;var d=new b.onnx.ModelProto;if(o.irVersion!=null&&(et.Long?(d.irVersion=et.Long.fromValue(o.irVersion)).unsigned=!1:typeof o.irVersion=="string"?d.irVersion=parseInt(o.irVersion,10):typeof o.irVersion=="number"?d.irVersion=o.irVersion:typeof o.irVersion=="object"&&(d.irVersion=new et.LongBits(o.irVersion.low>>>0,o.irVersion.high>>>0).toNumber())),o.opsetImport){if(!Array.isArray(o.opsetImport))throw TypeError(".onnx.ModelProto.opsetImport: array expected");d.opsetImport=[];for(var g=0;g<o.opsetImport.length;++g){if(typeof o.opsetImport[g]!="object")throw TypeError(".onnx.ModelProto.opsetImport: object expected");d.opsetImport[g]=b.onnx.OperatorSetIdProto.fromObject(o.opsetImport[g])}}if(o.producerName!=null&&(d.producerName=String(o.producerName)),o.producerVersion!=null&&(d.producerVersion=String(o.producerVersion)),o.domain!=null&&(d.domain=String(o.domain)),o.modelVersion!=null&&(et.Long?(d.modelVersion=et.Long.fromValue(o.modelVersion)).unsigned=!1:typeof o.modelVersion=="string"?d.modelVersion=parseInt(o.modelVersion,10):typeof o.modelVersion=="number"?d.modelVersion=o.modelVersion:typeof o.modelVersion=="object"&&(d.modelVersion=new et.LongBits(o.modelVersion.low>>>0,o.modelVersion.high>>>0).toNumber())),o.docString!=null&&(d.docString=String(o.docString)),o.graph!=null){if(typeof o.graph!="object")throw TypeError(".onnx.ModelProto.graph: object expected");d.graph=b.onnx.GraphProto.fromObject(o.graph)}if(o.metadataProps){if(!Array.isArray(o.metadataProps))throw TypeError(".onnx.ModelProto.metadataProps: array expected");for(d.metadataProps=[],g=0;g<o.metadataProps.length;++g){if(typeof o.metadataProps[g]!="object")throw TypeError(".onnx.ModelProto.metadataProps: object expected");d.metadataProps[g]=b.onnx.StringStringEntryProto.fromObject(o.metadataProps[g])}}return d},a.toObject=function(o,d){d||(d={});var g={};if((d.arrays||d.defaults)&&(g.opsetImport=[],g.metadataProps=[]),d.defaults){if(et.Long){var rt=new et.Long(0,0,!1);g.irVersion=d.longs===String?rt.toString():d.longs===Number?rt.toNumber():rt}else g.irVersion=d.longs===String?"0":0;g.producerName="",g.producerVersion="",g.domain="",et.Long?(rt=new et.Long(0,0,!1),g.modelVersion=d.longs===String?rt.toString():d.longs===Number?rt.toNumber():rt):g.modelVersion=d.longs===String?"0":0,g.docString="",g.graph=null}if(o.irVersion!=null&&o.hasOwnProperty("irVersion")&&(typeof o.irVersion=="number"?g.irVersion=d.longs===String?String(o.irVersion):o.irVersion:g.irVersion=d.longs===String?et.Long.prototype.toString.call(o.irVersion):d.longs===Number?new et.LongBits(o.irVersion.low>>>0,o.irVersion.high>>>0).toNumber():o.irVersion),o.producerName!=null&&o.hasOwnProperty("producerName")&&(g.producerName=o.producerName),o.producerVersion!=null&&o.hasOwnProperty("producerVersion")&&(g.producerVersion=o.producerVersion),o.domain!=null&&o.hasOwnProperty("domain")&&(g.domain=o.domain),o.modelVersion!=null&&o.hasOwnProperty("modelVersion")&&(typeof o.modelVersion=="number"?g.modelVersion=d.longs===String?String(o.modelVersion):o.modelVersion:g.modelVersion=d.longs===String?et.Long.prototype.toString.call(o.modelVersion):d.longs===Number?new et.LongBits(o.modelVersion.low>>>0,o.modelVersion.high>>>0).toNumber():o.modelVersion),o.docString!=null&&o.hasOwnProperty("docString")&&(g.docString=o.docString),o.graph!=null&&o.hasOwnProperty("graph")&&(g.graph=b.onnx.GraphProto.toObject(o.graph,d)),o.opsetImport&&o.opsetImport.length){g.opsetImport=[];for(var st=0;st<o.opsetImport.length;++st)g.opsetImport[st]=b.onnx.OperatorSetIdProto.toObject(o.opsetImport[st],d)}if(o.metadataProps&&o.metadataProps.length)for(g.metadataProps=[],st=0;st<o.metadataProps.length;++st)g.metadataProps[st]=b.onnx.StringStringEntryProto.toObject(o.metadataProps[st],d);return g},a.prototype.toJSON=function(){return this.constructor.toObject(this,_.util.toJSONOptions)},a}(),$.StringStringEntryProto=function(){function a(o){if(o)for(var d=Object.keys(o),g=0;g<d.length;++g)o[d[g]]!=null&&(this[d[g]]=o[d[g]])}return a.prototype.key="",a.prototype.value="",a.create=function(o){return new a(o)},a.encode=function(o,d){return d||(d=nt.create()),o.key!=null&&o.hasOwnProperty("key")&&d.uint32(10).string(o.key),o.value!=null&&o.hasOwnProperty("value")&&d.uint32(18).string(o.value),d},a.encodeDelimited=function(o,d){return this.encode(o,d).ldelim()},a.decode=function(o,d){o instanceof j||(o=j.create(o));for(var g=d===void 0?o.len:o.pos+d,rt=new b.onnx.StringStringEntryProto;o.pos<g;){var st=o.uint32();switch(st>>>3){case 1:rt.key=o.string();break;case 2:rt.value=o.string();break;default:o.skipType(7&st)}}return rt},a.decodeDelimited=function(o){return o instanceof j||(o=new j(o)),this.decode(o,o.uint32())},a.verify=function(o){return typeof o!="object"||o===null?"object expected":o.key!=null&&o.hasOwnProperty("key")&&!et.isString(o.key)?"key: string expected":o.value!=null&&o.hasOwnProperty("value")&&!et.isString(o.value)?"value: string expected":null},a.fromObject=function(o){if(o instanceof b.onnx.StringStringEntryProto)return o;var d=new b.onnx.StringStringEntryProto;return o.key!=null&&(d.key=String(o.key)),o.value!=null&&(d.value=String(o.value)),d},a.toObject=function(o,d){d||(d={});var g={};return d.defaults&&(g.key="",g.value=""),o.key!=null&&o.hasOwnProperty("key")&&(g.key=o.key),o.value!=null&&o.hasOwnProperty("value")&&(g.value=o.value),g},a.prototype.toJSON=function(){return this.constructor.toObject(this,_.util.toJSONOptions)},a}(),$.TensorAnnotation=function(){function a(o){if(this.quantParameterTensorNames=[],o)for(var d=Object.keys(o),g=0;g<d.length;++g)o[d[g]]!=null&&(this[d[g]]=o[d[g]])}return a.prototype.tensorName="",a.prototype.quantParameterTensorNames=et.emptyArray,a.create=function(o){return new a(o)},a.encode=function(o,d){if(d||(d=nt.create()),o.tensorName!=null&&o.hasOwnProperty("tensorName")&&d.uint32(10).string(o.tensorName),o.quantParameterTensorNames!=null&&o.quantParameterTensorNames.length)for(var g=0;g<o.quantParameterTensorNames.length;++g)b.onnx.StringStringEntryProto.encode(o.quantParameterTensorNames[g],d.uint32(18).fork()).ldelim();return d},a.encodeDelimited=function(o,d){return this.encode(o,d).ldelim()},a.decode=function(o,d){o instanceof j||(o=j.create(o));for(var g=d===void 0?o.len:o.pos+d,rt=new b.onnx.TensorAnnotation;o.pos<g;){var st=o.uint32();switch(st>>>3){case 1:rt.tensorName=o.string();break;case 2:rt.quantParameterTensorNames&&rt.quantParameterTensorNames.length||(rt.quantParameterTensorNames=[]),rt.quantParameterTensorNames.push(b.onnx.StringStringEntryProto.decode(o,o.uint32()));break;default:o.skipType(7&st)}}return rt},a.decodeDelimited=function(o){return o instanceof j||(o=new j(o)),this.decode(o,o.uint32())},a.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.tensorName!=null&&o.hasOwnProperty("tensorName")&&!et.isString(o.tensorName))return"tensorName: string expected";if(o.quantParameterTensorNames!=null&&o.hasOwnProperty("quantParameterTensorNames")){if(!Array.isArray(o.quantParameterTensorNames))return"quantParameterTensorNames: array expected";for(var d=0;d<o.quantParameterTensorNames.length;++d){var g=b.onnx.StringStringEntryProto.verify(o.quantParameterTensorNames[d]);if(g)return"quantParameterTensorNames."+g}}return null},a.fromObject=function(o){if(o instanceof b.onnx.TensorAnnotation)return o;var d=new b.onnx.TensorAnnotation;if(o.tensorName!=null&&(d.tensorName=String(o.tensorName)),o.quantParameterTensorNames){if(!Array.isArray(o.quantParameterTensorNames))throw TypeError(".onnx.TensorAnnotation.quantParameterTensorNames: array expected");d.quantParameterTensorNames=[];for(var g=0;g<o.quantParameterTensorNames.length;++g){if(typeof o.quantParameterTensorNames[g]!="object")throw TypeError(".onnx.TensorAnnotation.quantParameterTensorNames: object expected");d.quantParameterTensorNames[g]=b.onnx.StringStringEntryProto.fromObject(o.quantParameterTensorNames[g])}}return d},a.toObject=function(o,d){d||(d={});var g={};if((d.arrays||d.defaults)&&(g.quantParameterTensorNames=[]),d.defaults&&(g.tensorName=""),o.tensorName!=null&&o.hasOwnProperty("tensorName")&&(g.tensorName=o.tensorName),o.quantParameterTensorNames&&o.quantParameterTensorNames.length){g.quantParameterTensorNames=[];for(var rt=0;rt<o.quantParameterTensorNames.length;++rt)g.quantParameterTensorNames[rt]=b.onnx.StringStringEntryProto.toObject(o.quantParameterTensorNames[rt],d)}return g},a.prototype.toJSON=function(){return this.constructor.toObject(this,_.util.toJSONOptions)},a}(),$.GraphProto=function(){function a(o){if(this.node=[],this.initializer=[],this.input=[],this.output=[],this.valueInfo=[],this.quantizationAnnotation=[],o)for(var d=Object.keys(o),g=0;g<d.length;++g)o[d[g]]!=null&&(this[d[g]]=o[d[g]])}return a.prototype.node=et.emptyArray,a.prototype.name="",a.prototype.initializer=et.emptyArray,a.prototype.docString="",a.prototype.input=et.emptyArray,a.prototype.output=et.emptyArray,a.prototype.valueInfo=et.emptyArray,a.prototype.quantizationAnnotation=et.emptyArray,a.create=function(o){return new a(o)},a.encode=function(o,d){if(d||(d=nt.create()),o.node!=null&&o.node.length)for(var g=0;g<o.node.length;++g)b.onnx.NodeProto.encode(o.node[g],d.uint32(10).fork()).ldelim();if(o.name!=null&&o.hasOwnProperty("name")&&d.uint32(18).string(o.name),o.initializer!=null&&o.initializer.length)for(g=0;g<o.initializer.length;++g)b.onnx.TensorProto.encode(o.initializer[g],d.uint32(42).fork()).ldelim();if(o.docString!=null&&o.hasOwnProperty("docString")&&d.uint32(82).string(o.docString),o.input!=null&&o.input.length)for(g=0;g<o.input.length;++g)b.onnx.ValueInfoProto.encode(o.input[g],d.uint32(90).fork()).ldelim();if(o.output!=null&&o.output.length)for(g=0;g<o.output.length;++g)b.onnx.ValueInfoProto.encode(o.output[g],d.uint32(98).fork()).ldelim();if(o.valueInfo!=null&&o.valueInfo.length)for(g=0;g<o.valueInfo.length;++g)b.onnx.ValueInfoProto.encode(o.valueInfo[g],d.uint32(106).fork()).ldelim();if(o.quantizationAnnotation!=null&&o.quantizationAnnotation.length)for(g=0;g<o.quantizationAnnotation.length;++g)b.onnx.TensorAnnotation.encode(o.quantizationAnnotation[g],d.uint32(114).fork()).ldelim();return d},a.encodeDelimited=function(o,d){return this.encode(o,d).ldelim()},a.decode=function(o,d){o instanceof j||(o=j.create(o));for(var g=d===void 0?o.len:o.pos+d,rt=new b.onnx.GraphProto;o.pos<g;){var st=o.uint32();switch(st>>>3){case 1:rt.node&&rt.node.length||(rt.node=[]),rt.node.push(b.onnx.NodeProto.decode(o,o.uint32()));break;case 2:rt.name=o.string();break;case 5:rt.initializer&&rt.initializer.length||(rt.initializer=[]),rt.initializer.push(b.onnx.TensorProto.decode(o,o.uint32()));break;case 10:rt.docString=o.string();break;case 11:rt.input&&rt.input.length||(rt.input=[]),rt.input.push(b.onnx.ValueInfoProto.decode(o,o.uint32()));break;case 12:rt.output&&rt.output.length||(rt.output=[]),rt.output.push(b.onnx.ValueInfoProto.decode(o,o.uint32()));break;case 13:rt.valueInfo&&rt.valueInfo.length||(rt.valueInfo=[]),rt.valueInfo.push(b.onnx.ValueInfoProto.decode(o,o.uint32()));break;case 14:rt.quantizationAnnotation&&rt.quantizationAnnotation.length||(rt.quantizationAnnotation=[]),rt.quantizationAnnotation.push(b.onnx.TensorAnnotation.decode(o,o.uint32()));break;default:o.skipType(7&st)}}return rt},a.decodeDelimited=function(o){return o instanceof j||(o=new j(o)),this.decode(o,o.uint32())},a.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.node!=null&&o.hasOwnProperty("node")){if(!Array.isArray(o.node))return"node: array expected";for(var d=0;d<o.node.length;++d)if(g=b.onnx.NodeProto.verify(o.node[d]))return"node."+g}if(o.name!=null&&o.hasOwnProperty("name")&&!et.isString(o.name))return"name: string expected";if(o.initializer!=null&&o.hasOwnProperty("initializer")){if(!Array.isArray(o.initializer))return"initializer: array expected";for(d=0;d<o.initializer.length;++d)if(g=b.onnx.TensorProto.verify(o.initializer[d]))return"initializer."+g}if(o.docString!=null&&o.hasOwnProperty("docString")&&!et.isString(o.docString))return"docString: string expected";if(o.input!=null&&o.hasOwnProperty("input")){if(!Array.isArray(o.input))return"input: array expected";for(d=0;d<o.input.length;++d)if(g=b.onnx.ValueInfoProto.verify(o.input[d]))return"input."+g}if(o.output!=null&&o.hasOwnProperty("output")){if(!Array.isArray(o.output))return"output: array expected";for(d=0;d<o.output.length;++d)if(g=b.onnx.ValueInfoProto.verify(o.output[d]))return"output."+g}if(o.valueInfo!=null&&o.hasOwnProperty("valueInfo")){if(!Array.isArray(o.valueInfo))return"valueInfo: array expected";for(d=0;d<o.valueInfo.length;++d)if(g=b.onnx.ValueInfoProto.verify(o.valueInfo[d]))return"valueInfo."+g}if(o.quantizationAnnotation!=null&&o.hasOwnProperty("quantizationAnnotation")){if(!Array.isArray(o.quantizationAnnotation))return"quantizationAnnotation: array expected";for(d=0;d<o.quantizationAnnotation.length;++d){var g;if(g=b.onnx.TensorAnnotation.verify(o.quantizationAnnotation[d]))return"quantizationAnnotation."+g}}return null},a.fromObject=function(o){if(o instanceof b.onnx.GraphProto)return o;var d=new b.onnx.GraphProto;if(o.node){if(!Array.isArray(o.node))throw TypeError(".onnx.GraphProto.node: array expected");d.node=[];for(var g=0;g<o.node.length;++g){if(typeof o.node[g]!="object")throw TypeError(".onnx.GraphProto.node: object expected");d.node[g]=b.onnx.NodeProto.fromObject(o.node[g])}}if(o.name!=null&&(d.name=String(o.name)),o.initializer){if(!Array.isArray(o.initializer))throw TypeError(".onnx.GraphProto.initializer: array expected");for(d.initializer=[],g=0;g<o.initializer.length;++g){if(typeof o.initializer[g]!="object")throw TypeError(".onnx.GraphProto.initializer: object expected");d.initializer[g]=b.onnx.TensorProto.fromObject(o.initializer[g])}}if(o.docString!=null&&(d.docString=String(o.docString)),o.input){if(!Array.isArray(o.input))throw TypeError(".onnx.GraphProto.input: array expected");for(d.input=[],g=0;g<o.input.length;++g){if(typeof o.input[g]!="object")throw TypeError(".onnx.GraphProto.input: object expected");d.input[g]=b.onnx.ValueInfoProto.fromObject(o.input[g])}}if(o.output){if(!Array.isArray(o.output))throw TypeError(".onnx.GraphProto.output: array expected");for(d.output=[],g=0;g<o.output.length;++g){if(typeof o.output[g]!="object")throw TypeError(".onnx.GraphProto.output: object expected");d.output[g]=b.onnx.ValueInfoProto.fromObject(o.output[g])}}if(o.valueInfo){if(!Array.isArray(o.valueInfo))throw TypeError(".onnx.GraphProto.valueInfo: array expected");for(d.valueInfo=[],g=0;g<o.valueInfo.length;++g){if(typeof o.valueInfo[g]!="object")throw TypeError(".onnx.GraphProto.valueInfo: object expected");d.valueInfo[g]=b.onnx.ValueInfoProto.fromObject(o.valueInfo[g])}}if(o.quantizationAnnotation){if(!Array.isArray(o.quantizationAnnotation))throw TypeError(".onnx.GraphProto.quantizationAnnotation: array expected");for(d.quantizationAnnotation=[],g=0;g<o.quantizationAnnotation.length;++g){if(typeof o.quantizationAnnotation[g]!="object")throw TypeError(".onnx.GraphProto.quantizationAnnotation: object expected");d.quantizationAnnotation[g]=b.onnx.TensorAnnotation.fromObject(o.quantizationAnnotation[g])}}return d},a.toObject=function(o,d){d||(d={});var g={};if((d.arrays||d.defaults)&&(g.node=[],g.initializer=[],g.input=[],g.output=[],g.valueInfo=[],g.quantizationAnnotation=[]),d.defaults&&(g.name="",g.docString=""),o.node&&o.node.length){g.node=[];for(var rt=0;rt<o.node.length;++rt)g.node[rt]=b.onnx.NodeProto.toObject(o.node[rt],d)}if(o.name!=null&&o.hasOwnProperty("name")&&(g.name=o.name),o.initializer&&o.initializer.length)for(g.initializer=[],rt=0;rt<o.initializer.length;++rt)g.initializer[rt]=b.onnx.TensorProto.toObject(o.initializer[rt],d);if(o.docString!=null&&o.hasOwnProperty("docString")&&(g.docString=o.docString),o.input&&o.input.length)for(g.input=[],rt=0;rt<o.input.length;++rt)g.input[rt]=b.onnx.ValueInfoProto.toObject(o.input[rt],d);if(o.output&&o.output.length)for(g.output=[],rt=0;rt<o.output.length;++rt)g.output[rt]=b.onnx.ValueInfoProto.toObject(o.output[rt],d);if(o.valueInfo&&o.valueInfo.length)for(g.valueInfo=[],rt=0;rt<o.valueInfo.length;++rt)g.valueInfo[rt]=b.onnx.ValueInfoProto.toObject(o.valueInfo[rt],d);if(o.quantizationAnnotation&&o.quantizationAnnotation.length)for(g.quantizationAnnotation=[],rt=0;rt<o.quantizationAnnotation.length;++rt)g.quantizationAnnotation[rt]=b.onnx.TensorAnnotation.toObject(o.quantizationAnnotation[rt],d);return g},a.prototype.toJSON=function(){return this.constructor.toObject(this,_.util.toJSONOptions)},a}(),$.TensorProto=function(){function a(o){if(this.dims=[],this.floatData=[],this.int32Data=[],this.stringData=[],this.int64Data=[],this.externalData=[],this.doubleData=[],this.uint64Data=[],o)for(var d=Object.keys(o),g=0;g<d.length;++g)o[d[g]]!=null&&(this[d[g]]=o[d[g]])}return a.prototype.dims=et.emptyArray,a.prototype.dataType=0,a.prototype.segment=null,a.prototype.floatData=et.emptyArray,a.prototype.int32Data=et.emptyArray,a.prototype.stringData=et.emptyArray,a.prototype.int64Data=et.emptyArray,a.prototype.name="",a.prototype.docString="",a.prototype.rawData=et.newBuffer([]),a.prototype.externalData=et.emptyArray,a.prototype.dataLocation=0,a.prototype.doubleData=et.emptyArray,a.prototype.uint64Data=et.emptyArray,a.create=function(o){return new a(o)},a.encode=function(o,d){if(d||(d=nt.create()),o.dims!=null&&o.dims.length){d.uint32(10).fork();for(var g=0;g<o.dims.length;++g)d.int64(o.dims[g]);d.ldelim()}if(o.dataType!=null&&o.hasOwnProperty("dataType")&&d.uint32(16).int32(o.dataType),o.segment!=null&&o.hasOwnProperty("segment")&&b.onnx.TensorProto.Segment.encode(o.segment,d.uint32(26).fork()).ldelim(),o.floatData!=null&&o.floatData.length){for(d.uint32(34).fork(),g=0;g<o.floatData.length;++g)d.float(o.floatData[g]);d.ldelim()}if(o.int32Data!=null&&o.int32Data.length){for(d.uint32(42).fork(),g=0;g<o.int32Data.length;++g)d.int32(o.int32Data[g]);d.ldelim()}if(o.stringData!=null&&o.stringData.length)for(g=0;g<o.stringData.length;++g)d.uint32(50).bytes(o.stringData[g]);if(o.int64Data!=null&&o.int64Data.length){for(d.uint32(58).fork(),g=0;g<o.int64Data.length;++g)d.int64(o.int64Data[g]);d.ldelim()}if(o.name!=null&&o.hasOwnProperty("name")&&d.uint32(66).string(o.name),o.rawData!=null&&o.hasOwnProperty("rawData")&&d.uint32(74).bytes(o.rawData),o.doubleData!=null&&o.doubleData.length){for(d.uint32(82).fork(),g=0;g<o.doubleData.length;++g)d.double(o.doubleData[g]);d.ldelim()}if(o.uint64Data!=null&&o.uint64Data.length){for(d.uint32(90).fork(),g=0;g<o.uint64Data.length;++g)d.uint64(o.uint64Data[g]);d.ldelim()}if(o.docString!=null&&o.hasOwnProperty("docString")&&d.uint32(98).string(o.docString),o.externalData!=null&&o.externalData.length)for(g=0;g<o.externalData.length;++g)b.onnx.StringStringEntryProto.encode(o.externalData[g],d.uint32(106).fork()).ldelim();return o.dataLocation!=null&&o.hasOwnProperty("dataLocation")&&d.uint32(112).int32(o.dataLocation),d},a.encodeDelimited=function(o,d){return this.encode(o,d).ldelim()},a.decode=function(o,d){o instanceof j||(o=j.create(o));for(var g=d===void 0?o.len:o.pos+d,rt=new b.onnx.TensorProto;o.pos<g;){var st=o.uint32();switch(st>>>3){case 1:if(rt.dims&&rt.dims.length||(rt.dims=[]),(7&st)==2)for(var tt=o.uint32()+o.pos;o.pos<tt;)rt.dims.push(o.int64());else rt.dims.push(o.int64());break;case 2:rt.dataType=o.int32();break;case 3:rt.segment=b.onnx.TensorProto.Segment.decode(o,o.uint32());break;case 4:if(rt.floatData&&rt.floatData.length||(rt.floatData=[]),(7&st)==2)for(tt=o.uint32()+o.pos;o.pos<tt;)rt.floatData.push(o.float());else rt.floatData.push(o.float());break;case 5:if(rt.int32Data&&rt.int32Data.length||(rt.int32Data=[]),(7&st)==2)for(tt=o.uint32()+o.pos;o.pos<tt;)rt.int32Data.push(o.int32());else rt.int32Data.push(o.int32());break;case 6:rt.stringData&&rt.stringData.length||(rt.stringData=[]),rt.stringData.push(o.bytes());break;case 7:if(rt.int64Data&&rt.int64Data.length||(rt.int64Data=[]),(7&st)==2)for(tt=o.uint32()+o.pos;o.pos<tt;)rt.int64Data.push(o.int64());else rt.int64Data.push(o.int64());break;case 8:rt.name=o.string();break;case 12:rt.docString=o.string();break;case 9:rt.rawData=o.bytes();break;case 13:rt.externalData&&rt.externalData.length||(rt.externalData=[]),rt.externalData.push(b.onnx.StringStringEntryProto.decode(o,o.uint32()));break;case 14:rt.dataLocation=o.int32();break;case 10:if(rt.doubleData&&rt.doubleData.length||(rt.doubleData=[]),(7&st)==2)for(tt=o.uint32()+o.pos;o.pos<tt;)rt.doubleData.push(o.double());else rt.doubleData.push(o.double());break;case 11:if(rt.uint64Data&&rt.uint64Data.length||(rt.uint64Data=[]),(7&st)==2)for(tt=o.uint32()+o.pos;o.pos<tt;)rt.uint64Data.push(o.uint64());else rt.uint64Data.push(o.uint64());break;default:o.skipType(7&st)}}return rt},a.decodeDelimited=function(o){return o instanceof j||(o=new j(o)),this.decode(o,o.uint32())},a.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.dims!=null&&o.hasOwnProperty("dims")){if(!Array.isArray(o.dims))return"dims: array expected";for(var d=0;d<o.dims.length;++d)if(!(et.isInteger(o.dims[d])||o.dims[d]&&et.isInteger(o.dims[d].low)&&et.isInteger(o.dims[d].high)))return"dims: integer|Long[] expected"}if(o.dataType!=null&&o.hasOwnProperty("dataType")&&!et.isInteger(o.dataType))return"dataType: integer expected";if(o.segment!=null&&o.hasOwnProperty("segment")&&(g=b.onnx.TensorProto.Segment.verify(o.segment)))return"segment."+g;if(o.floatData!=null&&o.hasOwnProperty("floatData")){if(!Array.isArray(o.floatData))return"floatData: array expected";for(d=0;d<o.floatData.length;++d)if(typeof o.floatData[d]!="number")return"floatData: number[] expected"}if(o.int32Data!=null&&o.hasOwnProperty("int32Data")){if(!Array.isArray(o.int32Data))return"int32Data: array expected";for(d=0;d<o.int32Data.length;++d)if(!et.isInteger(o.int32Data[d]))return"int32Data: integer[] expected"}if(o.stringData!=null&&o.hasOwnProperty("stringData")){if(!Array.isArray(o.stringData))return"stringData: array expected";for(d=0;d<o.stringData.length;++d)if(!(o.stringData[d]&&typeof o.stringData[d].length=="number"||et.isString(o.stringData[d])))return"stringData: buffer[] expected"}if(o.int64Data!=null&&o.hasOwnProperty("int64Data")){if(!Array.isArray(o.int64Data))return"int64Data: array expected";for(d=0;d<o.int64Data.length;++d)if(!(et.isInteger(o.int64Data[d])||o.int64Data[d]&&et.isInteger(o.int64Data[d].low)&&et.isInteger(o.int64Data[d].high)))return"int64Data: integer|Long[] expected"}if(o.name!=null&&o.hasOwnProperty("name")&&!et.isString(o.name))return"name: string expected";if(o.docString!=null&&o.hasOwnProperty("docString")&&!et.isString(o.docString))return"docString: string expected";if(o.rawData!=null&&o.hasOwnProperty("rawData")&&!(o.rawData&&typeof o.rawData.length=="number"||et.isString(o.rawData)))return"rawData: buffer expected";if(o.externalData!=null&&o.hasOwnProperty("externalData")){if(!Array.isArray(o.externalData))return"externalData: array expected";for(d=0;d<o.externalData.length;++d){var g;if(g=b.onnx.StringStringEntryProto.verify(o.externalData[d]))return"externalData."+g}}if(o.dataLocation!=null&&o.hasOwnProperty("dataLocation"))switch(o.dataLocation){default:return"dataLocation: enum value expected";case 0:case 1:}if(o.doubleData!=null&&o.hasOwnProperty("doubleData")){if(!Array.isArray(o.doubleData))return"doubleData: array expected";for(d=0;d<o.doubleData.length;++d)if(typeof o.doubleData[d]!="number")return"doubleData: number[] expected"}if(o.uint64Data!=null&&o.hasOwnProperty("uint64Data")){if(!Array.isArray(o.uint64Data))return"uint64Data: array expected";for(d=0;d<o.uint64Data.length;++d)if(!(et.isInteger(o.uint64Data[d])||o.uint64Data[d]&&et.isInteger(o.uint64Data[d].low)&&et.isInteger(o.uint64Data[d].high)))return"uint64Data: integer|Long[] expected"}return null},a.fromObject=function(o){if(o instanceof b.onnx.TensorProto)return o;var d=new b.onnx.TensorProto;if(o.dims){if(!Array.isArray(o.dims))throw TypeError(".onnx.TensorProto.dims: array expected");d.dims=[];for(var g=0;g<o.dims.length;++g)et.Long?(d.dims[g]=et.Long.fromValue(o.dims[g])).unsigned=!1:typeof o.dims[g]=="string"?d.dims[g]=parseInt(o.dims[g],10):typeof o.dims[g]=="number"?d.dims[g]=o.dims[g]:typeof o.dims[g]=="object"&&(d.dims[g]=new et.LongBits(o.dims[g].low>>>0,o.dims[g].high>>>0).toNumber())}if(o.dataType!=null&&(d.dataType=0|o.dataType),o.segment!=null){if(typeof o.segment!="object")throw TypeError(".onnx.TensorProto.segment: object expected");d.segment=b.onnx.TensorProto.Segment.fromObject(o.segment)}if(o.floatData){if(!Array.isArray(o.floatData))throw TypeError(".onnx.TensorProto.floatData: array expected");for(d.floatData=[],g=0;g<o.floatData.length;++g)d.floatData[g]=Number(o.floatData[g])}if(o.int32Data){if(!Array.isArray(o.int32Data))throw TypeError(".onnx.TensorProto.int32Data: array expected");for(d.int32Data=[],g=0;g<o.int32Data.length;++g)d.int32Data[g]=0|o.int32Data[g]}if(o.stringData){if(!Array.isArray(o.stringData))throw TypeError(".onnx.TensorProto.stringData: array expected");for(d.stringData=[],g=0;g<o.stringData.length;++g)typeof o.stringData[g]=="string"?et.base64.decode(o.stringData[g],d.stringData[g]=et.newBuffer(et.base64.length(o.stringData[g])),0):o.stringData[g].length&&(d.stringData[g]=o.stringData[g])}if(o.int64Data){if(!Array.isArray(o.int64Data))throw TypeError(".onnx.TensorProto.int64Data: array expected");for(d.int64Data=[],g=0;g<o.int64Data.length;++g)et.Long?(d.int64Data[g]=et.Long.fromValue(o.int64Data[g])).unsigned=!1:typeof o.int64Data[g]=="string"?d.int64Data[g]=parseInt(o.int64Data[g],10):typeof o.int64Data[g]=="number"?d.int64Data[g]=o.int64Data[g]:typeof o.int64Data[g]=="object"&&(d.int64Data[g]=new et.LongBits(o.int64Data[g].low>>>0,o.int64Data[g].high>>>0).toNumber())}if(o.name!=null&&(d.name=String(o.name)),o.docString!=null&&(d.docString=String(o.docString)),o.rawData!=null&&(typeof o.rawData=="string"?et.base64.decode(o.rawData,d.rawData=et.newBuffer(et.base64.length(o.rawData)),0):o.rawData.length&&(d.rawData=o.rawData)),o.externalData){if(!Array.isArray(o.externalData))throw TypeError(".onnx.TensorProto.externalData: array expected");for(d.externalData=[],g=0;g<o.externalData.length;++g){if(typeof o.externalData[g]!="object")throw TypeError(".onnx.TensorProto.externalData: object expected");d.externalData[g]=b.onnx.StringStringEntryProto.fromObject(o.externalData[g])}}switch(o.dataLocation){case"DEFAULT":case 0:d.dataLocation=0;break;case"EXTERNAL":case 1:d.dataLocation=1}if(o.doubleData){if(!Array.isArray(o.doubleData))throw TypeError(".onnx.TensorProto.doubleData: array expected");for(d.doubleData=[],g=0;g<o.doubleData.length;++g)d.doubleData[g]=Number(o.doubleData[g])}if(o.uint64Data){if(!Array.isArray(o.uint64Data))throw TypeError(".onnx.TensorProto.uint64Data: array expected");for(d.uint64Data=[],g=0;g<o.uint64Data.length;++g)et.Long?(d.uint64Data[g]=et.Long.fromValue(o.uint64Data[g])).unsigned=!0:typeof o.uint64Data[g]=="string"?d.uint64Data[g]=parseInt(o.uint64Data[g],10):typeof o.uint64Data[g]=="number"?d.uint64Data[g]=o.uint64Data[g]:typeof o.uint64Data[g]=="object"&&(d.uint64Data[g]=new et.LongBits(o.uint64Data[g].low>>>0,o.uint64Data[g].high>>>0).toNumber(!0))}return d},a.toObject=function(o,d){d||(d={});var g={};if((d.arrays||d.defaults)&&(g.dims=[],g.floatData=[],g.int32Data=[],g.stringData=[],g.int64Data=[],g.doubleData=[],g.uint64Data=[],g.externalData=[]),d.defaults&&(g.dataType=0,g.segment=null,g.name="",d.bytes===String?g.rawData="":(g.rawData=[],d.bytes!==Array&&(g.rawData=et.newBuffer(g.rawData))),g.docString="",g.dataLocation=d.enums===String?"DEFAULT":0),o.dims&&o.dims.length){g.dims=[];for(var rt=0;rt<o.dims.length;++rt)typeof o.dims[rt]=="number"?g.dims[rt]=d.longs===String?String(o.dims[rt]):o.dims[rt]:g.dims[rt]=d.longs===String?et.Long.prototype.toString.call(o.dims[rt]):d.longs===Number?new et.LongBits(o.dims[rt].low>>>0,o.dims[rt].high>>>0).toNumber():o.dims[rt]}if(o.dataType!=null&&o.hasOwnProperty("dataType")&&(g.dataType=o.dataType),o.segment!=null&&o.hasOwnProperty("segment")&&(g.segment=b.onnx.TensorProto.Segment.toObject(o.segment,d)),o.floatData&&o.floatData.length)for(g.floatData=[],rt=0;rt<o.floatData.length;++rt)g.floatData[rt]=d.json&&!isFinite(o.floatData[rt])?String(o.floatData[rt]):o.floatData[rt];if(o.int32Data&&o.int32Data.length)for(g.int32Data=[],rt=0;rt<o.int32Data.length;++rt)g.int32Data[rt]=o.int32Data[rt];if(o.stringData&&o.stringData.length)for(g.stringData=[],rt=0;rt<o.stringData.length;++rt)g.stringData[rt]=d.bytes===String?et.base64.encode(o.stringData[rt],0,o.stringData[rt].length):d.bytes===Array?Array.prototype.slice.call(o.stringData[rt]):o.stringData[rt];if(o.int64Data&&o.int64Data.length)for(g.int64Data=[],rt=0;rt<o.int64Data.length;++rt)typeof o.int64Data[rt]=="number"?g.int64Data[rt]=d.longs===String?String(o.int64Data[rt]):o.int64Data[rt]:g.int64Data[rt]=d.longs===String?et.Long.prototype.toString.call(o.int64Data[rt]):d.longs===Number?new et.LongBits(o.int64Data[rt].low>>>0,o.int64Data[rt].high>>>0).toNumber():o.int64Data[rt];if(o.name!=null&&o.hasOwnProperty("name")&&(g.name=o.name),o.rawData!=null&&o.hasOwnProperty("rawData")&&(g.rawData=d.bytes===String?et.base64.encode(o.rawData,0,o.rawData.length):d.bytes===Array?Array.prototype.slice.call(o.rawData):o.rawData),o.doubleData&&o.doubleData.length)for(g.doubleData=[],rt=0;rt<o.doubleData.length;++rt)g.doubleData[rt]=d.json&&!isFinite(o.doubleData[rt])?String(o.doubleData[rt]):o.doubleData[rt];if(o.uint64Data&&o.uint64Data.length)for(g.uint64Data=[],rt=0;rt<o.uint64Data.length;++rt)typeof o.uint64Data[rt]=="number"?g.uint64Data[rt]=d.longs===String?String(o.uint64Data[rt]):o.uint64Data[rt]:g.uint64Data[rt]=d.longs===String?et.Long.prototype.toString.call(o.uint64Data[rt]):d.longs===Number?new et.LongBits(o.uint64Data[rt].low>>>0,o.uint64Data[rt].high>>>0).toNumber(!0):o.uint64Data[rt];if(o.docString!=null&&o.hasOwnProperty("docString")&&(g.docString=o.docString),o.externalData&&o.externalData.length)for(g.externalData=[],rt=0;rt<o.externalData.length;++rt)g.externalData[rt]=b.onnx.StringStringEntryProto.toObject(o.externalData[rt],d);return o.dataLocation!=null&&o.hasOwnProperty("dataLocation")&&(g.dataLocation=d.enums===String?b.onnx.TensorProto.DataLocation[o.dataLocation]:o.dataLocation),g},a.prototype.toJSON=function(){return this.constructor.toObject(this,_.util.toJSONOptions)},a.DataType=function(){var o={},d=Object.create(o);return d[o[0]="UNDEFINED"]=0,d[o[1]="FLOAT"]=1,d[o[2]="UINT8"]=2,d[o[3]="INT8"]=3,d[o[4]="UINT16"]=4,d[o[5]="INT16"]=5,d[o[6]="INT32"]=6,d[o[7]="INT64"]=7,d[o[8]="STRING"]=8,d[o[9]="BOOL"]=9,d[o[10]="FLOAT16"]=10,d[o[11]="DOUBLE"]=11,d[o[12]="UINT32"]=12,d[o[13]="UINT64"]=13,d[o[14]="COMPLEX64"]=14,d[o[15]="COMPLEX128"]=15,d[o[16]="BFLOAT16"]=16,d}(),a.Segment=function(){function o(d){if(d)for(var g=Object.keys(d),rt=0;rt<g.length;++rt)d[g[rt]]!=null&&(this[g[rt]]=d[g[rt]])}return o.prototype.begin=et.Long?et.Long.fromBits(0,0,!1):0,o.prototype.end=et.Long?et.Long.fromBits(0,0,!1):0,o.create=function(d){return new o(d)},o.encode=function(d,g){return g||(g=nt.create()),d.begin!=null&&d.hasOwnProperty("begin")&&g.uint32(8).int64(d.begin),d.end!=null&&d.hasOwnProperty("end")&&g.uint32(16).int64(d.end),g},o.encodeDelimited=function(d,g){return this.encode(d,g).ldelim()},o.decode=function(d,g){d instanceof j||(d=j.create(d));for(var rt=g===void 0?d.len:d.pos+g,st=new b.onnx.TensorProto.Segment;d.pos<rt;){var tt=d.uint32();switch(tt>>>3){case 1:st.begin=d.int64();break;case 2:st.end=d.int64();break;default:d.skipType(7&tt)}}return st},o.decodeDelimited=function(d){return d instanceof j||(d=new j(d)),this.decode(d,d.uint32())},o.verify=function(d){return typeof d!="object"||d===null?"object expected":d.begin!=null&&d.hasOwnProperty("begin")&&!(et.isInteger(d.begin)||d.begin&&et.isInteger(d.begin.low)&&et.isInteger(d.begin.high))?"begin: integer|Long expected":d.end!=null&&d.hasOwnProperty("end")&&!(et.isInteger(d.end)||d.end&&et.isInteger(d.end.low)&&et.isInteger(d.end.high))?"end: integer|Long expected":null},o.fromObject=function(d){if(d instanceof b.onnx.TensorProto.Segment)return d;var g=new b.onnx.TensorProto.Segment;return d.begin!=null&&(et.Long?(g.begin=et.Long.fromValue(d.begin)).unsigned=!1:typeof d.begin=="string"?g.begin=parseInt(d.begin,10):typeof d.begin=="number"?g.begin=d.begin:typeof d.begin=="object"&&(g.begin=new et.LongBits(d.begin.low>>>0,d.begin.high>>>0).toNumber())),d.end!=null&&(et.Long?(g.end=et.Long.fromValue(d.end)).unsigned=!1:typeof d.end=="string"?g.end=parseInt(d.end,10):typeof d.end=="number"?g.end=d.end:typeof d.end=="object"&&(g.end=new et.LongBits(d.end.low>>>0,d.end.high>>>0).toNumber())),g},o.toObject=function(d,g){g||(g={});var rt={};if(g.defaults){if(et.Long){var st=new et.Long(0,0,!1);rt.begin=g.longs===String?st.toString():g.longs===Number?st.toNumber():st}else rt.begin=g.longs===String?"0":0;et.Long?(st=new et.Long(0,0,!1),rt.end=g.longs===String?st.toString():g.longs===Number?st.toNumber():st):rt.end=g.longs===String?"0":0}return d.begin!=null&&d.hasOwnProperty("begin")&&(typeof d.begin=="number"?rt.begin=g.longs===String?String(d.begin):d.begin:rt.begin=g.longs===String?et.Long.prototype.toString.call(d.begin):g.longs===Number?new et.LongBits(d.begin.low>>>0,d.begin.high>>>0).toNumber():d.begin),d.end!=null&&d.hasOwnProperty("end")&&(typeof d.end=="number"?rt.end=g.longs===String?String(d.end):d.end:rt.end=g.longs===String?et.Long.prototype.toString.call(d.end):g.longs===Number?new et.LongBits(d.end.low>>>0,d.end.high>>>0).toNumber():d.end),rt},o.prototype.toJSON=function(){return this.constructor.toObject(this,_.util.toJSONOptions)},o}(),a.DataLocation=function(){var o={},d=Object.create(o);return d[o[0]="DEFAULT"]=0,d[o[1]="EXTERNAL"]=1,d}(),a}(),$.TensorShapeProto=function(){function a(o){if(this.dim=[],o)for(var d=Object.keys(o),g=0;g<d.length;++g)o[d[g]]!=null&&(this[d[g]]=o[d[g]])}return a.prototype.dim=et.emptyArray,a.create=function(o){return new a(o)},a.encode=function(o,d){if(d||(d=nt.create()),o.dim!=null&&o.dim.length)for(var g=0;g<o.dim.length;++g)b.onnx.TensorShapeProto.Dimension.encode(o.dim[g],d.uint32(10).fork()).ldelim();return d},a.encodeDelimited=function(o,d){return this.encode(o,d).ldelim()},a.decode=function(o,d){o instanceof j||(o=j.create(o));for(var g=d===void 0?o.len:o.pos+d,rt=new b.onnx.TensorShapeProto;o.pos<g;){var st=o.uint32();st>>>3==1?(rt.dim&&rt.dim.length||(rt.dim=[]),rt.dim.push(b.onnx.TensorShapeProto.Dimension.decode(o,o.uint32()))):o.skipType(7&st)}return rt},a.decodeDelimited=function(o){return o instanceof j||(o=new j(o)),this.decode(o,o.uint32())},a.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.dim!=null&&o.hasOwnProperty("dim")){if(!Array.isArray(o.dim))return"dim: array expected";for(var d=0;d<o.dim.length;++d){var g=b.onnx.TensorShapeProto.Dimension.verify(o.dim[d]);if(g)return"dim."+g}}return null},a.fromObject=function(o){if(o instanceof b.onnx.TensorShapeProto)return o;var d=new b.onnx.TensorShapeProto;if(o.dim){if(!Array.isArray(o.dim))throw TypeError(".onnx.TensorShapeProto.dim: array expected");d.dim=[];for(var g=0;g<o.dim.length;++g){if(typeof o.dim[g]!="object")throw TypeError(".onnx.TensorShapeProto.dim: object expected");d.dim[g]=b.onnx.TensorShapeProto.Dimension.fromObject(o.dim[g])}}return d},a.toObject=function(o,d){d||(d={});var g={};if((d.arrays||d.defaults)&&(g.dim=[]),o.dim&&o.dim.length){g.dim=[];for(var rt=0;rt<o.dim.length;++rt)g.dim[rt]=b.onnx.TensorShapeProto.Dimension.toObject(o.dim[rt],d)}return g},a.prototype.toJSON=function(){return this.constructor.toObject(this,_.util.toJSONOptions)},a.Dimension=function(){function o(g){if(g)for(var rt=Object.keys(g),st=0;st<rt.length;++st)g[rt[st]]!=null&&(this[rt[st]]=g[rt[st]])}var d;return o.prototype.dimValue=et.Long?et.Long.fromBits(0,0,!1):0,o.prototype.dimParam="",o.prototype.denotation="",Object.defineProperty(o.prototype,"value",{get:et.oneOfGetter(d=["dimValue","dimParam"]),set:et.oneOfSetter(d)}),o.create=function(g){return new o(g)},o.encode=function(g,rt){return rt||(rt=nt.create()),g.dimValue!=null&&g.hasOwnProperty("dimValue")&&rt.uint32(8).int64(g.dimValue),g.dimParam!=null&&g.hasOwnProperty("dimParam")&&rt.uint32(18).string(g.dimParam),g.denotation!=null&&g.hasOwnProperty("denotation")&&rt.uint32(26).string(g.denotation),rt},o.encodeDelimited=function(g,rt){return this.encode(g,rt).ldelim()},o.decode=function(g,rt){g instanceof j||(g=j.create(g));for(var st=rt===void 0?g.len:g.pos+rt,tt=new b.onnx.TensorShapeProto.Dimension;g.pos<st;){var ot=g.uint32();switch(ot>>>3){case 1:tt.dimValue=g.int64();break;case 2:tt.dimParam=g.string();break;case 3:tt.denotation=g.string();break;default:g.skipType(7&ot)}}return tt},o.decodeDelimited=function(g){return g instanceof j||(g=new j(g)),this.decode(g,g.uint32())},o.verify=function(g){if(typeof g!="object"||g===null)return"object expected";var rt={};if(g.dimValue!=null&&g.hasOwnProperty("dimValue")&&(rt.value=1,!(et.isInteger(g.dimValue)||g.dimValue&&et.isInteger(g.dimValue.low)&&et.isInteger(g.dimValue.high))))return"dimValue: integer|Long expected";if(g.dimParam!=null&&g.hasOwnProperty("dimParam")){if(rt.value===1)return"value: multiple values";if(rt.value=1,!et.isString(g.dimParam))return"dimParam: string expected"}return g.denotation!=null&&g.hasOwnProperty("denotation")&&!et.isString(g.denotation)?"denotation: string expected":null},o.fromObject=function(g){if(g instanceof b.onnx.TensorShapeProto.Dimension)return g;var rt=new b.onnx.TensorShapeProto.Dimension;return g.dimValue!=null&&(et.Long?(rt.dimValue=et.Long.fromValue(g.dimValue)).unsigned=!1:typeof g.dimValue=="string"?rt.dimValue=parseInt(g.dimValue,10):typeof g.dimValue=="number"?rt.dimValue=g.dimValue:typeof g.dimValue=="object"&&(rt.dimValue=new et.LongBits(g.dimValue.low>>>0,g.dimValue.high>>>0).toNumber())),g.dimParam!=null&&(rt.dimParam=String(g.dimParam)),g.denotation!=null&&(rt.denotation=String(g.denotation)),rt},o.toObject=function(g,rt){rt||(rt={});var st={};return rt.defaults&&(st.denotation=""),g.dimValue!=null&&g.hasOwnProperty("dimValue")&&(typeof g.dimValue=="number"?st.dimValue=rt.longs===String?String(g.dimValue):g.dimValue:st.dimValue=rt.longs===String?et.Long.prototype.toString.call(g.dimValue):rt.longs===Number?new et.LongBits(g.dimValue.low>>>0,g.dimValue.high>>>0).toNumber():g.dimValue,rt.oneofs&&(st.value="dimValue")),g.dimParam!=null&&g.hasOwnProperty("dimParam")&&(st.dimParam=g.dimParam,rt.oneofs&&(st.value="dimParam")),g.denotation!=null&&g.hasOwnProperty("denotation")&&(st.denotation=g.denotation),st},o.prototype.toJSON=function(){return this.constructor.toObject(this,_.util.toJSONOptions)},o}(),a}(),$.TypeProto=function(){function a(d){if(d)for(var g=Object.keys(d),rt=0;rt<g.length;++rt)d[g[rt]]!=null&&(this[g[rt]]=d[g[rt]])}var o;return a.prototype.tensorType=null,a.prototype.denotation="",Object.defineProperty(a.prototype,"value",{get:et.oneOfGetter(o=["tensorType"]),set:et.oneOfSetter(o)}),a.create=function(d){return new a(d)},a.encode=function(d,g){return g||(g=nt.create()),d.tensorType!=null&&d.hasOwnProperty("tensorType")&&b.onnx.TypeProto.Tensor.encode(d.tensorType,g.uint32(10).fork()).ldelim(),d.denotation!=null&&d.hasOwnProperty("denotation")&&g.uint32(50).string(d.denotation),g},a.encodeDelimited=function(d,g){return this.encode(d,g).ldelim()},a.decode=function(d,g){d instanceof j||(d=j.create(d));for(var rt=g===void 0?d.len:d.pos+g,st=new b.onnx.TypeProto;d.pos<rt;){var tt=d.uint32();switch(tt>>>3){case 1:st.tensorType=b.onnx.TypeProto.Tensor.decode(d,d.uint32());break;case 6:st.denotation=d.string();break;default:d.skipType(7&tt)}}return st},a.decodeDelimited=function(d){return d instanceof j||(d=new j(d)),this.decode(d,d.uint32())},a.verify=function(d){if(typeof d!="object"||d===null)return"object expected";if(d.tensorType!=null&&d.hasOwnProperty("tensorType")){var g=b.onnx.TypeProto.Tensor.verify(d.tensorType);if(g)return"tensorType."+g}return d.denotation!=null&&d.hasOwnProperty("denotation")&&!et.isString(d.denotation)?"denotation: string expected":null},a.fromObject=function(d){if(d instanceof b.onnx.TypeProto)return d;var g=new b.onnx.TypeProto;if(d.tensorType!=null){if(typeof d.tensorType!="object")throw TypeError(".onnx.TypeProto.tensorType: object expected");g.tensorType=b.onnx.TypeProto.Tensor.fromObject(d.tensorType)}return d.denotation!=null&&(g.denotation=String(d.denotation)),g},a.toObject=function(d,g){g||(g={});var rt={};return g.defaults&&(rt.denotation=""),d.tensorType!=null&&d.hasOwnProperty("tensorType")&&(rt.tensorType=b.onnx.TypeProto.Tensor.toObject(d.tensorType,g),g.oneofs&&(rt.value="tensorType")),d.denotation!=null&&d.hasOwnProperty("denotation")&&(rt.denotation=d.denotation),rt},a.prototype.toJSON=function(){return this.constructor.toObject(this,_.util.toJSONOptions)},a.Tensor=function(){function d(g){if(g)for(var rt=Object.keys(g),st=0;st<rt.length;++st)g[rt[st]]!=null&&(this[rt[st]]=g[rt[st]])}return d.prototype.elemType=0,d.prototype.shape=null,d.create=function(g){return new d(g)},d.encode=function(g,rt){return rt||(rt=nt.create()),g.elemType!=null&&g.hasOwnProperty("elemType")&&rt.uint32(8).int32(g.elemType),g.shape!=null&&g.hasOwnProperty("shape")&&b.onnx.TensorShapeProto.encode(g.shape,rt.uint32(18).fork()).ldelim(),rt},d.encodeDelimited=function(g,rt){return this.encode(g,rt).ldelim()},d.decode=function(g,rt){g instanceof j||(g=j.create(g));for(var st=rt===void 0?g.len:g.pos+rt,tt=new b.onnx.TypeProto.Tensor;g.pos<st;){var ot=g.uint32();switch(ot>>>3){case 1:tt.elemType=g.int32();break;case 2:tt.shape=b.onnx.TensorShapeProto.decode(g,g.uint32());break;default:g.skipType(7&ot)}}return tt},d.decodeDelimited=function(g){return g instanceof j||(g=new j(g)),this.decode(g,g.uint32())},d.verify=function(g){if(typeof g!="object"||g===null)return"object expected";if(g.elemType!=null&&g.hasOwnProperty("elemType")&&!et.isInteger(g.elemType))return"elemType: integer expected";if(g.shape!=null&&g.hasOwnProperty("shape")){var rt=b.onnx.TensorShapeProto.verify(g.shape);if(rt)return"shape."+rt}return null},d.fromObject=function(g){if(g instanceof b.onnx.TypeProto.Tensor)return g;var rt=new b.onnx.TypeProto.Tensor;if(g.elemType!=null&&(rt.elemType=0|g.elemType),g.shape!=null){if(typeof g.shape!="object")throw TypeError(".onnx.TypeProto.Tensor.shape: object expected");rt.shape=b.onnx.TensorShapeProto.fromObject(g.shape)}return rt},d.toObject=function(g,rt){rt||(rt={});var st={};return rt.defaults&&(st.elemType=0,st.shape=null),g.elemType!=null&&g.hasOwnProperty("elemType")&&(st.elemType=g.elemType),g.shape!=null&&g.hasOwnProperty("shape")&&(st.shape=b.onnx.TensorShapeProto.toObject(g.shape,rt)),st},d.prototype.toJSON=function(){return this.constructor.toObject(this,_.util.toJSONOptions)},d}(),a}(),$.OperatorSetIdProto=function(){function a(o){if(o)for(var d=Object.keys(o),g=0;g<d.length;++g)o[d[g]]!=null&&(this[d[g]]=o[d[g]])}return a.prototype.domain="",a.prototype.version=et.Long?et.Long.fromBits(0,0,!1):0,a.create=function(o){return new a(o)},a.encode=function(o,d){return d||(d=nt.create()),o.domain!=null&&o.hasOwnProperty("domain")&&d.uint32(10).string(o.domain),o.version!=null&&o.hasOwnProperty("version")&&d.uint32(16).int64(o.version),d},a.encodeDelimited=function(o,d){return this.encode(o,d).ldelim()},a.decode=function(o,d){o instanceof j||(o=j.create(o));for(var g=d===void 0?o.len:o.pos+d,rt=new b.onnx.OperatorSetIdProto;o.pos<g;){var st=o.uint32();switch(st>>>3){case 1:rt.domain=o.string();break;case 2:rt.version=o.int64();break;default:o.skipType(7&st)}}return rt},a.decodeDelimited=function(o){return o instanceof j||(o=new j(o)),this.decode(o,o.uint32())},a.verify=function(o){return typeof o!="object"||o===null?"object expected":o.domain!=null&&o.hasOwnProperty("domain")&&!et.isString(o.domain)?"domain: string expected":o.version!=null&&o.hasOwnProperty("version")&&!(et.isInteger(o.version)||o.version&&et.isInteger(o.version.low)&&et.isInteger(o.version.high))?"version: integer|Long expected":null},a.fromObject=function(o){if(o instanceof b.onnx.OperatorSetIdProto)return o;var d=new b.onnx.OperatorSetIdProto;return o.domain!=null&&(d.domain=String(o.domain)),o.version!=null&&(et.Long?(d.version=et.Long.fromValue(o.version)).unsigned=!1:typeof o.version=="string"?d.version=parseInt(o.version,10):typeof o.version=="number"?d.version=o.version:typeof o.version=="object"&&(d.version=new et.LongBits(o.version.low>>>0,o.version.high>>>0).toNumber())),d},a.toObject=function(o,d){d||(d={});var g={};if(d.defaults)if(g.domain="",et.Long){var rt=new et.Long(0,0,!1);g.version=d.longs===String?rt.toString():d.longs===Number?rt.toNumber():rt}else g.version=d.longs===String?"0":0;return o.domain!=null&&o.hasOwnProperty("domain")&&(g.domain=o.domain),o.version!=null&&o.hasOwnProperty("version")&&(typeof o.version=="number"?g.version=d.longs===String?String(o.version):o.version:g.version=d.longs===String?et.Long.prototype.toString.call(o.version):d.longs===Number?new et.LongBits(o.version.low>>>0,o.version.high>>>0).toNumber():o.version),g},a.prototype.toJSON=function(){return this.constructor.toObject(this,_.util.toJSONOptions)},a}(),$),i.exports=b},2100:(i,e,s)=>{i.exports=s(9482)},9482:(i,e,s)=>{var c=e;function h(){c.util._configure(),c.Writer._configure(c.BufferWriter),c.Reader._configure(c.BufferReader)}c.build="minimal",c.Writer=s(1173),c.BufferWriter=s(3155),c.Reader=s(1408),c.BufferReader=s(593),c.util=s(9693),c.rpc=s(5994),c.roots=s(5054),c.configure=h,h()},1408:(i,e,s)=>{i.exports=nt;var c,h=s(9693),$=h.LongBits,_=h.utf8;function j(rt,st){return RangeError("index out of range: "+rt.pos+" + "+(st||1)+" > "+rt.len)}function nt(rt){this.buf=rt,this.pos=0,this.len=rt.length}var et,b=typeof Uint8Array<"u"?function(rt){if(rt instanceof Uint8Array||Array.isArray(rt))return new nt(rt);throw Error("illegal buffer")}:function(rt){if(Array.isArray(rt))return new nt(rt);throw Error("illegal buffer")},a=function(){return h.Buffer?function(rt){return(nt.create=function(st){return h.Buffer.isBuffer(st)?new c(st):b(st)})(rt)}:b};function o(){var rt=new $(0,0),st=0;if(!(this.len-this.pos>4)){for(;st<3;++st){if(this.pos>=this.len)throw j(this);if(rt.lo=(rt.lo|(127&this.buf[this.pos])<<7*st)>>>0,this.buf[this.pos++]<128)return rt}return rt.lo=(rt.lo|(127&this.buf[this.pos++])<<7*st)>>>0,rt}for(;st<4;++st)if(rt.lo=(rt.lo|(127&this.buf[this.pos])<<7*st)>>>0,this.buf[this.pos++]<128)return rt;if(rt.lo=(rt.lo|(127&this.buf[this.pos])<<28)>>>0,rt.hi=(rt.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return rt;if(st=0,this.len-this.pos>4){for(;st<5;++st)if(rt.hi=(rt.hi|(127&this.buf[this.pos])<<7*st+3)>>>0,this.buf[this.pos++]<128)return rt}else for(;st<5;++st){if(this.pos>=this.len)throw j(this);if(rt.hi=(rt.hi|(127&this.buf[this.pos])<<7*st+3)>>>0,this.buf[this.pos++]<128)return rt}throw Error("invalid varint encoding")}function d(rt,st){return(rt[st-4]|rt[st-3]<<8|rt[st-2]<<16|rt[st-1]<<24)>>>0}function g(){if(this.pos+8>this.len)throw j(this,8);return new $(d(this.buf,this.pos+=4),d(this.buf,this.pos+=4))}nt.create=a(),nt.prototype._slice=h.Array.prototype.subarray||h.Array.prototype.slice,nt.prototype.uint32=(et=4294967295,function(){if(et=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128||(et=(et|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)||(et=(et|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)||(et=(et|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)||(et=(et|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128))return et;if((this.pos+=5)>this.len)throw this.pos=this.len,j(this,10);return et}),nt.prototype.int32=function(){return 0|this.uint32()},nt.prototype.sint32=function(){var rt=this.uint32();return rt>>>1^-(1&rt)|0},nt.prototype.bool=function(){return this.uint32()!==0},nt.prototype.fixed32=function(){if(this.pos+4>this.len)throw j(this,4);return d(this.buf,this.pos+=4)},nt.prototype.sfixed32=function(){if(this.pos+4>this.len)throw j(this,4);return 0|d(this.buf,this.pos+=4)},nt.prototype.float=function(){if(this.pos+4>this.len)throw j(this,4);var rt=h.float.readFloatLE(this.buf,this.pos);return this.pos+=4,rt},nt.prototype.double=function(){if(this.pos+8>this.len)throw j(this,4);var rt=h.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,rt},nt.prototype.bytes=function(){var rt=this.uint32(),st=this.pos,tt=this.pos+rt;if(tt>this.len)throw j(this,rt);return this.pos+=rt,Array.isArray(this.buf)?this.buf.slice(st,tt):st===tt?new this.buf.constructor(0):this._slice.call(this.buf,st,tt)},nt.prototype.string=function(){var rt=this.bytes();return _.read(rt,0,rt.length)},nt.prototype.skip=function(rt){if(typeof rt=="number"){if(this.pos+rt>this.len)throw j(this,rt);this.pos+=rt}else do if(this.pos>=this.len)throw j(this);while(128&this.buf[this.pos++]);return this},nt.prototype.skipType=function(rt){switch(rt){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(rt=7&this.uint32())!=4;)this.skipType(rt);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+rt+" at offset "+this.pos)}return this},nt._configure=function(rt){c=rt,nt.create=a(),c._configure();var st=h.Long?"toLong":"toNumber";h.merge(nt.prototype,{int64:function(){return o.call(this)[st](!1)},uint64:function(){return o.call(this)[st](!0)},sint64:function(){return o.call(this).zzDecode()[st](!1)},fixed64:function(){return g.call(this)[st](!0)},sfixed64:function(){return g.call(this)[st](!1)}})}},593:(i,e,s)=>{i.exports=$;var c=s(1408);($.prototype=Object.create(c.prototype)).constructor=$;var h=s(9693);function $(_){c.call(this,_)}$._configure=function(){h.Buffer&&($.prototype._slice=h.Buffer.prototype.slice)},$.prototype.string=function(){var _=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+_,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+_,this.len))},$._configure()},5054:i=>{i.exports={}},5994:(i,e,s)=>{e.Service=s(7948)},7948:(i,e,s)=>{i.exports=h;var c=s(9693);function h($,_,j){if(typeof $!="function")throw TypeError("rpcImpl must be a function");c.EventEmitter.call(this),this.rpcImpl=$,this.requestDelimited=!!_,this.responseDelimited=!!j}(h.prototype=Object.create(c.EventEmitter.prototype)).constructor=h,h.prototype.rpcCall=function $(_,j,nt,et,b){if(!et)throw TypeError("request must be specified");var a=this;if(!b)return c.asPromise($,a,_,j,nt,et);if(a.rpcImpl)try{return a.rpcImpl(_,j[a.requestDelimited?"encodeDelimited":"encode"](et).finish(),function(o,d){if(o)return a.emit("error",o,_),b(o);if(d!==null){if(!(d instanceof nt))try{d=nt[a.responseDelimited?"decodeDelimited":"decode"](d)}catch(g){return a.emit("error",g,_),b(g)}return a.emit("data",d,_),b(null,d)}a.end(!0)})}catch(o){return a.emit("error",o,_),void setTimeout(function(){b(o)},0)}else setTimeout(function(){b(Error("already ended"))},0)},h.prototype.end=function($){return this.rpcImpl&&($||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},1945:(i,e,s)=>{i.exports=h;var c=s(9693);function h(nt,et){this.lo=nt>>>0,this.hi=et>>>0}var $=h.zero=new h(0,0);$.toNumber=function(){return 0},$.zzEncode=$.zzDecode=function(){return this},$.length=function(){return 1};var _=h.zeroHash="\0\0\0\0\0\0\0\0";h.fromNumber=function(nt){if(nt===0)return $;var et=nt<0;et&&(nt=-nt);var b=nt>>>0,a=(nt-b)/4294967296>>>0;return et&&(a=~a>>>0,b=~b>>>0,++b>4294967295&&(b=0,++a>4294967295&&(a=0))),new h(b,a)},h.from=function(nt){if(typeof nt=="number")return h.fromNumber(nt);if(c.isString(nt)){if(!c.Long)return h.fromNumber(parseInt(nt,10));nt=c.Long.fromString(nt)}return nt.low||nt.high?new h(nt.low>>>0,nt.high>>>0):$},h.prototype.toNumber=function(nt){if(!nt&&this.hi>>>31){var et=1+~this.lo>>>0,b=~this.hi>>>0;return et||(b=b+1>>>0),-(et+4294967296*b)}return this.lo+4294967296*this.hi},h.prototype.toLong=function(nt){return c.Long?new c.Long(0|this.lo,0|this.hi,!!nt):{low:0|this.lo,high:0|this.hi,unsigned:!!nt}};var j=String.prototype.charCodeAt;h.fromHash=function(nt){return nt===_?$:new h((j.call(nt,0)|j.call(nt,1)<<8|j.call(nt,2)<<16|j.call(nt,3)<<24)>>>0,(j.call(nt,4)|j.call(nt,5)<<8|j.call(nt,6)<<16|j.call(nt,7)<<24)>>>0)},h.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)},h.prototype.zzEncode=function(){var nt=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^nt)>>>0,this.lo=(this.lo<<1^nt)>>>0,this},h.prototype.zzDecode=function(){var nt=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^nt)>>>0,this.hi=(this.hi>>>1^nt)>>>0,this},h.prototype.length=function(){var nt=this.lo,et=(this.lo>>>28|this.hi<<4)>>>0,b=this.hi>>>24;return b===0?et===0?nt<16384?nt<128?1:2:nt<2097152?3:4:et<16384?et<128?5:6:et<2097152?7:8:b<128?9:10}},9693:function(i,e,s){var c=e;function h(_,j,nt){for(var et=Object.keys(j),b=0;b<et.length;++b)_[et[b]]!==void 0&&nt||(_[et[b]]=j[et[b]]);return _}function $(_){function j(nt,et){if(!(this instanceof j))return new j(nt,et);Object.defineProperty(this,"message",{get:function(){return nt}}),Error.captureStackTrace?Error.captureStackTrace(this,j):Object.defineProperty(this,"stack",{value:new Error().stack||""}),et&&h(this,et)}return(j.prototype=Object.create(Error.prototype)).constructor=j,Object.defineProperty(j.prototype,"name",{get:function(){return _}}),j.prototype.toString=function(){return this.name+": "+this.message},j}c.asPromise=s(4537),c.base64=s(7419),c.EventEmitter=s(9211),c.float=s(945),c.inquire=s(7199),c.utf8=s(4997),c.pool=s(6662),c.LongBits=s(1945),c.isNode=!!(s.g!==void 0&&s.g&&s.g.process&&s.g.process.versions&&s.g.process.versions.node),c.global=c.isNode&&s.g||typeof window<"u"&&window||typeof self<"u"&&self||this,c.emptyArray=Object.freeze?Object.freeze([]):[],c.emptyObject=Object.freeze?Object.freeze({}):{},c.isInteger=Number.isInteger||function(_){return typeof _=="number"&&isFinite(_)&&Math.floor(_)===_},c.isString=function(_){return typeof _=="string"||_ instanceof String},c.isObject=function(_){return _&&typeof _=="object"},c.isset=c.isSet=function(_,j){var nt=_[j];return!(nt==null||!_.hasOwnProperty(j))&&(typeof nt!="object"||(Array.isArray(nt)?nt.length:Object.keys(nt).length)>0)},c.Buffer=function(){try{var _=c.inquire("buffer").Buffer;return _.prototype.utf8Write?_:null}catch{return null}}(),c._Buffer_from=null,c._Buffer_allocUnsafe=null,c.newBuffer=function(_){return typeof _=="number"?c.Buffer?c._Buffer_allocUnsafe(_):new c.Array(_):c.Buffer?c._Buffer_from(_):typeof Uint8Array>"u"?_:new Uint8Array(_)},c.Array=typeof Uint8Array<"u"?Uint8Array:Array,c.Long=c.global.dcodeIO&&c.global.dcodeIO.Long||c.global.Long||c.inquire("long"),c.key2Re=/^true|false|0|1$/,c.key32Re=/^-?(?:0|[1-9][0-9]*)$/,c.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,c.longToHash=function(_){return _?c.LongBits.from(_).toHash():c.LongBits.zeroHash},c.longFromHash=function(_,j){var nt=c.LongBits.fromHash(_);return c.Long?c.Long.fromBits(nt.lo,nt.hi,j):nt.toNumber(!!j)},c.merge=h,c.lcFirst=function(_){return _.charAt(0).toLowerCase()+_.substring(1)},c.newError=$,c.ProtocolError=$("ProtocolError"),c.oneOfGetter=function(_){for(var j={},nt=0;nt<_.length;++nt)j[_[nt]]=1;return function(){for(var et=Object.keys(this),b=et.length-1;b>-1;--b)if(j[et[b]]===1&&this[et[b]]!==void 0&&this[et[b]]!==null)return et[b]}},c.oneOfSetter=function(_){return function(j){for(var nt=0;nt<_.length;++nt)_[nt]!==j&&delete this[_[nt]]}},c.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},c._configure=function(){var _=c.Buffer;_?(c._Buffer_from=_.from!==Uint8Array.from&&_.from||function(j,nt){return new _(j,nt)},c._Buffer_allocUnsafe=_.allocUnsafe||function(j){return new _(j)}):c._Buffer_from=c._Buffer_allocUnsafe=null}},1173:(i,e,s)=>{i.exports=a;var c,h=s(9693),$=h.LongBits,_=h.base64,j=h.utf8;function nt(ot,it,at){this.fn=ot,this.len=it,this.next=void 0,this.val=at}function et(){}function b(ot){this.head=ot.head,this.tail=ot.tail,this.len=ot.len,this.next=ot.states}function a(){this.len=0,this.head=new nt(et,0,0),this.tail=this.head,this.states=null}var o=function(){return h.Buffer?function(){return(a.create=function(){return new c})()}:function(){return new a}};function d(ot,it,at){it[at]=255&ot}function g(ot,it){this.len=ot,this.next=void 0,this.val=it}function rt(ot,it,at){for(;ot.hi;)it[at++]=127&ot.lo|128,ot.lo=(ot.lo>>>7|ot.hi<<25)>>>0,ot.hi>>>=7;for(;ot.lo>127;)it[at++]=127&ot.lo|128,ot.lo=ot.lo>>>7;it[at++]=ot.lo}function st(ot,it,at){it[at]=255&ot,it[at+1]=ot>>>8&255,it[at+2]=ot>>>16&255,it[at+3]=ot>>>24}a.create=o(),a.alloc=function(ot){return new h.Array(ot)},h.Array!==Array&&(a.alloc=h.pool(a.alloc,h.Array.prototype.subarray)),a.prototype._push=function(ot,it,at){return this.tail=this.tail.next=new nt(ot,it,at),this.len+=it,this},g.prototype=Object.create(nt.prototype),g.prototype.fn=function(ot,it,at){for(;ot>127;)it[at++]=127&ot|128,ot>>>=7;it[at]=ot},a.prototype.uint32=function(ot){return this.len+=(this.tail=this.tail.next=new g((ot>>>=0)<128?1:ot<16384?2:ot<2097152?3:ot<268435456?4:5,ot)).len,this},a.prototype.int32=function(ot){return ot<0?this._push(rt,10,$.fromNumber(ot)):this.uint32(ot)},a.prototype.sint32=function(ot){return this.uint32((ot<<1^ot>>31)>>>0)},a.prototype.uint64=function(ot){var it=$.from(ot);return this._push(rt,it.length(),it)},a.prototype.int64=a.prototype.uint64,a.prototype.sint64=function(ot){var it=$.from(ot).zzEncode();return this._push(rt,it.length(),it)},a.prototype.bool=function(ot){return this._push(d,1,ot?1:0)},a.prototype.fixed32=function(ot){return this._push(st,4,ot>>>0)},a.prototype.sfixed32=a.prototype.fixed32,a.prototype.fixed64=function(ot){var it=$.from(ot);return this._push(st,4,it.lo)._push(st,4,it.hi)},a.prototype.sfixed64=a.prototype.fixed64,a.prototype.float=function(ot){return this._push(h.float.writeFloatLE,4,ot)},a.prototype.double=function(ot){return this._push(h.float.writeDoubleLE,8,ot)};var tt=h.Array.prototype.set?function(ot,it,at){it.set(ot,at)}:function(ot,it,at){for(var ut=0;ut<ot.length;++ut)it[at+ut]=ot[ut]};a.prototype.bytes=function(ot){var it=ot.length>>>0;if(!it)return this._push(d,1,0);if(h.isString(ot)){var at=a.alloc(it=_.length(ot));_.decode(ot,at,0),ot=at}return this.uint32(it)._push(tt,it,ot)},a.prototype.string=function(ot){var it=j.length(ot);return it?this.uint32(it)._push(j.write,it,ot):this._push(d,1,0)},a.prototype.fork=function(){return this.states=new b(this),this.head=this.tail=new nt(et,0,0),this.len=0,this},a.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 nt(et,0,0),this.len=0),this},a.prototype.ldelim=function(){var ot=this.head,it=this.tail,at=this.len;return this.reset().uint32(at),at&&(this.tail.next=ot.next,this.tail=it,this.len+=at),this},a.prototype.finish=function(){for(var ot=this.head.next,it=this.constructor.alloc(this.len),at=0;ot;)ot.fn(ot.val,it,at),at+=ot.len,ot=ot.next;return it},a._configure=function(ot){c=ot,a.create=o(),c._configure()}},3155:(i,e,s)=>{i.exports=$;var c=s(1173);($.prototype=Object.create(c.prototype)).constructor=$;var h=s(9693);function $(){c.call(this)}function _(j,nt,et){j.length<40?h.utf8.write(j,nt,et):nt.utf8Write?nt.utf8Write(j,et):nt.write(j,et)}$._configure=function(){$.alloc=h._Buffer_allocUnsafe,$.writeBytesBuffer=h.Buffer&&h.Buffer.prototype instanceof Uint8Array&&h.Buffer.prototype.set.name==="set"?function(j,nt,et){nt.set(j,et)}:function(j,nt,et){if(j.copy)j.copy(nt,et,0,j.length);else for(var b=0;b<j.length;)nt[et++]=j[b++]}},$.prototype.bytes=function(j){h.isString(j)&&(j=h._Buffer_from(j,"base64"));var nt=j.length>>>0;return this.uint32(nt),nt&&this._push($.writeBytesBuffer,nt,j),this},$.prototype.string=function(j){var nt=h.Buffer.byteLength(j);return this.uint32(nt),nt&&this._push(_,nt,j),this},$._configure()},7714:(i,e,s)=>{e.R=void 0;const c=s(6919),h=s(7448);e.R=new class{async init(){}async createSessionHandler($,_){const j=new c.Session(_);return await j.loadModel($),new h.OnnxjsSessionHandler(j)}}},4200:(i,e,s)=>{e.c8=e.rX=void 0;const c=s(1670),h=s(5381),$=s(2157),_=s(2306);e.rX=()=>{if((typeof c.env.wasm.initTimeout!="number"||c.env.wasm.initTimeout<0)&&(c.env.wasm.initTimeout=0),typeof c.env.wasm.simd!="boolean"&&(c.env.wasm.simd=!0),typeof c.env.wasm.proxy!="boolean"&&(c.env.wasm.proxy=!1),typeof c.env.wasm.numThreads!="number"||!Number.isInteger(c.env.wasm.numThreads)||c.env.wasm.numThreads<=0){const j=typeof navigator>"u"?(0,h.cpus)().length:navigator.hardwareConcurrency;c.env.wasm.numThreads=Math.min(4,Math.ceil((j||1)/2))}},e.c8=new class{async init(){(0,e.rX)(),await(0,$.initWasm)()}async createSessionHandler(j,nt){const et=new _.OnnxruntimeWebAssemblySessionHandler;return await et.loadModel(j,nt),Promise.resolve(et)}}},6018:function(i,e,s){var c=this&&this.__createBinding||(Object.create?function(_,j,nt,et){et===void 0&&(et=nt);var b=Object.getOwnPropertyDescriptor(j,nt);b&&!("get"in b?!j.__esModule:b.writable||b.configurable)||(b={enumerable:!0,get:function(){return j[nt]}}),Object.defineProperty(_,et,b)}:function(_,j,nt,et){et===void 0&&(et=nt),_[et]=j[nt]}),h=this&&this.__exportStar||function(_,j){for(var nt in _)nt==="default"||Object.prototype.hasOwnProperty.call(j,nt)||c(j,_,nt)};Object.defineProperty(e,"__esModule",{value:!0}),h(s(1670),e);const $=s(1670);{const _=s(7714).R;(0,$.registerBackend)("webgl",_,-10)}{const _=s(4200).c8;(0,$.registerBackend)("cpu",_,10),(0,$.registerBackend)("wasm",_,10),(0,$.registerBackend)("xnnpack",_,9)}},246:(i,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createAttributeWithCacheKey=void 0;class s{constructor(h){Object.assign(this,h)}get cacheKey(){return this._cacheKey||(this._cacheKey=Object.getOwnPropertyNames(this).sort().map(h=>`${this[h]}`).join(";")),this._cacheKey}}e.createAttributeWithCacheKey=c=>new s(c)},7778:(i,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Attribute=void 0;const c=s(1446),h=s(9395),$=s(9162),_=s(2517);var j=h.onnxruntime.experimental.fbs;class nt{constructor(b){if(this._attributes=new Map,b!=null){for(const a of b)a instanceof c.onnx.AttributeProto?this._attributes.set(a.name,[nt.getValue(a),nt.getType(a)]):a instanceof j.Attribute&&this._attributes.set(a.name(),[nt.getValue(a),nt.getType(a)]);if(this._attributes.size<b.length)throw new Error("duplicated attribute names")}}set(b,a,o){this._attributes.set(b,[o,a])}delete(b){this._attributes.delete(b)}getFloat(b,a){return this.get(b,"float",a)}getInt(b,a){return this.get(b,"int",a)}getString(b,a){return this.get(b,"string",a)}getTensor(b,a){return this.get(b,"tensor",a)}getFloats(b,a){return this.get(b,"floats",a)}getInts(b,a){return this.get(b,"ints",a)}getStrings(b,a){return this.get(b,"strings",a)}getTensors(b,a){return this.get(b,"tensors",a)}get(b,a,o){const d=this._attributes.get(b);if(d===void 0){if(o!==void 0)return o;throw new Error(`required attribute not found: ${b}`)}if(d[1]!==a)throw new Error(`type mismatch: expected ${a} but got ${d[1]}`);return d[0]}static getType(b){const a=b instanceof c.onnx.AttributeProto?b.type:b.type();switch(a){case c.onnx.AttributeProto.AttributeType.FLOAT:return"float";case c.onnx.AttributeProto.AttributeType.INT:return"int";case c.onnx.AttributeProto.AttributeType.STRING:return"string";case c.onnx.AttributeProto.AttributeType.TENSOR:return"tensor";case c.onnx.AttributeProto.AttributeType.FLOATS:return"floats";case c.onnx.AttributeProto.AttributeType.INTS:return"ints";case c.onnx.AttributeProto.AttributeType.STRINGS:return"strings";case c.onnx.AttributeProto.AttributeType.TENSORS:return"tensors";default:throw new Error(`attribute type is not supported yet: ${c.onnx.AttributeProto.AttributeType[a]}`)}}static getValue(b){const a=b instanceof c.onnx.AttributeProto?b.type:b.type();if(a===c.onnx.AttributeProto.AttributeType.GRAPH||a===c.onnx.AttributeProto.AttributeType.GRAPHS)throw new Error("graph attribute is not supported yet");const o=this.getValueNoCheck(b);if(a===c.onnx.AttributeProto.AttributeType.INT&&_.LongUtil.isLong(o))return _.LongUtil.longToNumber(o);if(a===c.onnx.AttributeProto.AttributeType.INTS){const d=o,g=new Array(d.length);for(let rt=0;rt<d.length;rt++){const st=d[rt];g[rt]=_.LongUtil.longToNumber(st)}return g}if(a===c.onnx.AttributeProto.AttributeType.TENSOR)return b instanceof c.onnx.AttributeProto?$.Tensor.fromProto(o):$.Tensor.fromOrtTensor(o);if(a===c.onnx.AttributeProto.AttributeType.TENSORS){if(b instanceof c.onnx.AttributeProto)return o.map(d=>$.Tensor.fromProto(d));if(b instanceof j.Attribute)return o.map(d=>$.Tensor.fromOrtTensor(d))}if(a===c.onnx.AttributeProto.AttributeType.STRING&&b instanceof c.onnx.AttributeProto){const d=o;return(0,_.decodeUtf8String)(d)}return a===c.onnx.AttributeProto.AttributeType.STRINGS&&b instanceof c.onnx.AttributeProto?o.map(_.decodeUtf8String):o}static getValueNoCheck(b){return b instanceof c.onnx.AttributeProto?this.getValueNoCheckFromOnnxFormat(b):this.getValueNoCheckFromOrtFormat(b)}static getValueNoCheckFromOnnxFormat(b){switch(b.type){case c.onnx.AttributeProto.AttributeType.FLOAT:return b.f;case c.onnx.AttributeProto.AttributeType.INT:return b.i;case c.onnx.AttributeProto.AttributeType.STRING:return b.s;case c.onnx.AttributeProto.AttributeType.TENSOR:return b.t;case c.onnx.AttributeProto.AttributeType.GRAPH:return b.g;case c.onnx.AttributeProto.AttributeType.FLOATS:return b.floats;case c.onnx.AttributeProto.AttributeType.INTS:return b.ints;case c.onnx.AttributeProto.AttributeType.STRINGS:return b.strings;case c.onnx.AttributeProto.AttributeType.TENSORS:return b.tensors;case c.onnx.AttributeProto.AttributeType.GRAPHS:return b.graphs;default:throw new Error(`unsupported attribute type: ${c.onnx.AttributeProto.AttributeType[b.type]}`)}}static getValueNoCheckFromOrtFormat(b){switch(b.type()){case j.AttributeType.FLOAT:return b.f();case j.AttributeType.INT:return b.i();case j.AttributeType.STRING:return b.s();case j.AttributeType.TENSOR:return b.t();case j.AttributeType.GRAPH:return b.g();case j.AttributeType.FLOATS:return b.floatsArray();case j.AttributeType.INTS:{const a=[];for(let o=0;o<b.intsLength();o++)a.push(b.ints(o));return a}case j.AttributeType.STRINGS:{const a=[];for(let o=0;o<b.stringsLength();o++)a.push(b.strings(o));return a}case j.AttributeType.TENSORS:{const a=[];for(let o=0;o<b.tensorsLength();o++)a.push(b.tensors(o));return a}default:throw new Error(`unsupported attribute type: ${j.AttributeType[b.type()]}`)}}}e.Attribute=nt},7091:(i,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.resolveBackend=e.backend=void 0;const c=s(5038),h=new Map;async function $(_){const j=e.backend;if(j[_]!==void 0&&function(nt){const et=nt;return"initialize"in et&&typeof et.initialize=="function"&&"createSessionHandler"in et&&typeof et.createSessionHandler=="function"&&"dispose"in et&&typeof et.dispose=="function"}(j[_])){const nt=j[_];let et=nt.initialize();if(typeof et=="object"&&"then"in et&&(et=await et),et)return h.set(_,nt),nt}}e.backend={webgl:new c.WebGLBackend},e.resolveBackend=async function _(j){if(!j)return _(["webgl"]);{const nt=typeof j=="string"?[j]:j;for(const et of nt){const b=h.get(et);if(b)return b;const a=await $(et);if(a)return a}}throw new Error("no available backend to use")}},5038:(i,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WebGLBackend=void 0;const c=s(1670),h=s(6231),$=s(6416),_=s(7305);e.WebGLBackend=class{get contextId(){return c.env.webgl.contextId}set contextId(j){c.env.webgl.contextId=j}get matmulMaxBatchSize(){return c.env.webgl.matmulMaxBatchSize}set matmulMaxBatchSize(j){c.env.webgl.matmulMaxBatchSize=j}get textureCacheMode(){return c.env.webgl.textureCacheMode}set textureCacheMode(j){c.env.webgl.textureCacheMode=j}get pack(){return c.env.webgl.pack}set pack(j){c.env.webgl.pack=j}get async(){return c.env.webgl.async}set async(j){c.env.webgl.async=j}initialize(){try{return this.glContext=(0,_.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),h.Logger.setWithEnv(c.env),h.Logger.verbose("WebGLBackend",`Created WebGLContext: ${typeof this.glContext} with matmulMaxBatchSize: ${this.matmulMaxBatchSize}; textureCacheMode: ${this.textureCacheMode}; pack: ${this.pack}; async: ${this.async}.`),!0}catch(j){return h.Logger.warning("WebGLBackend",`Unable to initialize WebGLBackend. ${j}`),!1}}createSessionHandler(j){return new $.WebGLSessionHandler(this,j)}dispose(){this.glContext.dispose()}}},5107:(i,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CoordsGlslLib=void 0;const c=s(2517),h=s(8520),$=s(5060),_=s(7859),j=s(9390);class nt extends h.GlslLib{constructor(b){super(b)}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 h.GlslLibRoutine(`
|
|
71
71
|
vec2 offsetToCoords(int offset, int width, int height) {
|
|
72
72
|
int t = offset / width;
|
|
73
73
|
int s = offset - t*width;
|
|
@@ -1073,8 +1073,8 @@ float process(int indices[${St}]) {
|
|
|
1073
1073
|
float b = _B(sb);
|
|
1074
1074
|
|
|
1075
1075
|
return scale * (_X(indices) - mean) / sqrt(variance + epsilon) + b;
|
|
1076
|
-
}`;return Object.assign(Object.assign({},st),{output:{dims:tt.dims,type:tt.type,textureType:h.TextureType.unpacked},variables:[{name:"epsilon",type:"float",data:ot}],shaderSource:dt})})(b,g,a,o,d)})},et=b=>{if(!b||b.length!==3)throw new Error("InstanceNormalization requires 3 inputs.");const a=b[0],o=b[1],d=b[2];if(a.dims.length<3||o.dims.length!==1||d.dims.length!==1)throw new Error("Invalid input shape.");if(o.dims[0]!==a.dims[1]||d.dims[0]!==a.dims[1])throw new Error("Input shapes are mismatched.");if(a.type!=="float32"&&a.type!=="float64"||o.type!=="float32"&&o.type!=="float64"||d.type!=="float32"&&d.type!=="float64")throw new Error("Invalid input type.");if(b[0].dims.length!==4)throw new Error("Only support 4-D input shape.")}},708:(i,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createPackedMatmulProgramInfoLoader=void 0;const c=s(2517),h=s(5060),$=s(2039),_=s(9390),j=s(2823),nt=s(5623);e.createPackedMatmulProgramInfoLoader=(et,b,a)=>{const o=(d=b.length>2,g=a.activationCacheKey,{name:"MatMul (packed)",inputNames:d?["A","B","Bias"]:["A","B"],inputTypes:d?[$.TextureType.packed,$.TextureType.packed,$.TextureType.packed]:[$.TextureType.packed,$.TextureType.packed],cacheHint:g});var d,g;return Object.assign(Object.assign({},o),{get:()=>((rt,st,tt,ot)=>{const it=tt.length>2,at=it?"value += getBiasForMatmul();":"",ut=tt[0].dims,lt=tt[1].dims,ct=c.BroadcastUtil.calcShape(ut,lt,!0),ft=!c.ShapeUtil.areEqual(tt[0].dims,tt[1].dims);if(!ct)throw new Error("Can't use matmul on the given tensors");const dt=ut[ut.length-1],yt=Math.ceil(dt/2),St=ut.length,bt=lt.length,Tt=(0,h.getGlsl)(rt.session.backend.glContext.version),vt=(0,_.getCoordsDataType)(ct.length),$t=ct.length,At=(0,_.getGlChannels)(),{activationFunction:Ot,applyActivation:It}=(0,j.getActivationSnippet)(ot),jt=it?`${(0,nt.getBiasForMatmul)(vt,At,tt[2].dims,ct,!0)}`:"",Et=ft?`${function(pt,_t,Ct,zt){let Nt=[],Ht=[];const Jt=Ct[0].dims,un=Ct[1].dims,yn=Jt.length,vn=un.length,mn=zt.length,Tn=mn-yn,
|
|
1077
|
-
`),
|
|
1076
|
+
}`;return Object.assign(Object.assign({},st),{output:{dims:tt.dims,type:tt.type,textureType:h.TextureType.unpacked},variables:[{name:"epsilon",type:"float",data:ot}],shaderSource:dt})})(b,g,a,o,d)})},et=b=>{if(!b||b.length!==3)throw new Error("InstanceNormalization requires 3 inputs.");const a=b[0],o=b[1],d=b[2];if(a.dims.length<3||o.dims.length!==1||d.dims.length!==1)throw new Error("Invalid input shape.");if(o.dims[0]!==a.dims[1]||d.dims[0]!==a.dims[1])throw new Error("Input shapes are mismatched.");if(a.type!=="float32"&&a.type!=="float64"||o.type!=="float32"&&o.type!=="float64"||d.type!=="float32"&&d.type!=="float64")throw new Error("Invalid input type.");if(b[0].dims.length!==4)throw new Error("Only support 4-D input shape.")}},708:(i,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createPackedMatmulProgramInfoLoader=void 0;const c=s(2517),h=s(5060),$=s(2039),_=s(9390),j=s(2823),nt=s(5623);e.createPackedMatmulProgramInfoLoader=(et,b,a)=>{const o=(d=b.length>2,g=a.activationCacheKey,{name:"MatMul (packed)",inputNames:d?["A","B","Bias"]:["A","B"],inputTypes:d?[$.TextureType.packed,$.TextureType.packed,$.TextureType.packed]:[$.TextureType.packed,$.TextureType.packed],cacheHint:g});var d,g;return Object.assign(Object.assign({},o),{get:()=>((rt,st,tt,ot)=>{const it=tt.length>2,at=it?"value += getBiasForMatmul();":"",ut=tt[0].dims,lt=tt[1].dims,ct=c.BroadcastUtil.calcShape(ut,lt,!0),ft=!c.ShapeUtil.areEqual(tt[0].dims,tt[1].dims);if(!ct)throw new Error("Can't use matmul on the given tensors");const dt=ut[ut.length-1],yt=Math.ceil(dt/2),St=ut.length,bt=lt.length,Tt=(0,h.getGlsl)(rt.session.backend.glContext.version),vt=(0,_.getCoordsDataType)(ct.length),$t=ct.length,At=(0,_.getGlChannels)(),{activationFunction:Ot,applyActivation:It}=(0,j.getActivationSnippet)(ot),jt=it?`${(0,nt.getBiasForMatmul)(vt,At,tt[2].dims,ct,!0)}`:"",Et=ft?`${function(pt,_t,Ct,zt){let Nt=[],Ht=[];const Jt=Ct[0].dims,un=Ct[1].dims,yn=Jt.length,vn=un.length,mn=zt.length,Tn=mn-yn,kn=mn-vn;Nt=Jt.map((bn,Dn)=>`coords.${_t[Dn+Tn]}`),Nt[yn-1]="i*2",Nt.join(", "),Ht=un.map((bn,Dn)=>`coords.${_t[Dn+kn]}`),Ht[vn-2]="i*2",Ht.join(", ");const Gn=c.BroadcastUtil.getBroadcastDims(Jt,zt),wr=c.BroadcastUtil.getBroadcastDims(un,zt),xt=Gn.map(bn=>`coords.${_t[bn+Tn]} = 0;`).join(`
|
|
1077
|
+
`),kt=wr.map(bn=>`coords.${_t[bn+kn]} = 0;`).join(`
|
|
1078
1078
|
`),wn=`int lastDim = coords.${_t[mn-1]};
|
|
1079
1079
|
coords.${_t[mn-1]} = coords.${_t[mn-2]};
|
|
1080
1080
|
coords.${_t[mn-2]} = lastDim;`;return`
|
|
@@ -1089,7 +1089,7 @@ vec4 getAAtOutCoordsMatmul(int i) {
|
|
|
1089
1089
|
vec4 getBAtOutCoordsMatmul(int i) {
|
|
1090
1090
|
${pt} coords = getOutputCoords();
|
|
1091
1091
|
${wn}
|
|
1092
|
-
${
|
|
1092
|
+
${kt}
|
|
1093
1093
|
vec4 outputValue = getB(${Ht});
|
|
1094
1094
|
return outputValue;
|
|
1095
1095
|
}`}(vt,At,tt,ct)}`:"",mt=ft?"getAAtOutCoordsMatmul(i)":`getA(${function(pt,_t){let Ct="";for(let zt=0;zt<_t-2;zt++)Ct+=`rc.${pt[zt]}, `;return Ct+=`rc.${pt[_t-2]}, i*2`,Ct}(At,St)})`,gt=ft?"getBAtOutCoordsMatmul(i)":`getB(${function(pt,_t){let Ct="";for(let zt=0;zt<_t-2;zt++)Ct+=`rc.${pt[zt]}, `;return Ct+=`i*2, rc.${pt[_t-1]}`,Ct}(At,bt)})`,ht=`
|
|
@@ -1847,5 +1847,5 @@ value = _A(inputIdx);`,"value = min(value, _A(inputIdx));",""]}),e.reduceProd=(b
|
|
|
1847
1847
|
${j}
|
|
1848
1848
|
`);const nt=this.glContext.compileShader(j,this.glContext.gl.FRAGMENT_SHADER),et=this.glContext.createProgram(this.vertexShader,nt);return this.glContext.deleteShader(nt),et}bindOutput(j){const nt=j.width,et=j.height;h.Logger.verbose("ProrgramManager",`Binding output texture to Framebuffer: w/h=${nt}/${et}, shape=${j.shape}, type=${j.tensor.type}`),this.glContext.attachFramebuffer(j.texture,nt,et)}bindAttributes(j){const nt=j.position,et=j.textureCoord;this.glContext.setVertexAttributes(nt,et),this.attributesBound=!0}bindUniforms(j,nt,et){var b;const a=this.glContext.gl;let o=0;for(const{name:d,type:g,location:rt,arrayLength:st}of j){const tt=(b=nt.find(ot=>ot.name===d))===null||b===void 0?void 0:b.data;if(g!=="sampler2D"&&!tt)throw new Error(`variable '${d}' does not have data defined in program info`);switch(g){case"sampler2D":this.bindTexture(et[o],rt,o),o++;break;case"float":st?a.uniform1fv(rt,tt):a.uniform1f(rt,tt);break;case"int":st?a.uniform1iv(rt,tt):a.uniform1i(rt,tt);break;default:throw new Error(`Uniform not implemented: ${g}`)}}}bindTexture(j,nt,et){this.glContext.bindTextureToUniform(j.texture,et,nt)}getAttribLocations(j){return{position:this.getAttribLocation(j,"position"),textureCoord:this.getAttribLocation(j,"textureCoord")}}getUniformLocations(j,nt,et){const b=[];if(nt)for(const a of nt)b.push({name:a,type:"sampler2D",location:this.getUniformLocation(j,a)});if(et)for(const a of et)b.push(Object.assign(Object.assign({},a),{location:this.getUniformLocation(j,a.name)}));return b}getUniformLocation(j,nt){const et=this.glContext.gl.getUniformLocation(j,nt);if(et===null)throw new Error(`Uniform ${nt} not found.`);return et}getAttribLocation(j,nt){return this.glContext.gl.getAttribLocation(j,nt)}}},6416:(i,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WebGLSessionHandler=void 0;const c=s(6231),h=s(1047),$=s(8316),_=s(1640),j=s(1958),nt=s(7859),et=s(5702);e.WebGLSessionHandler=class{constructor(b,a){this.backend=b,this.context=a,this.layoutStrategy=new nt.PreferLogicalStrategy(b.glContext.maxTextureSize),this.programManager=new j.ProgramManager(this.context.profiler,b.glContext,this.layoutStrategy),this.textureManager=new et.TextureManager(b.glContext,this.layoutStrategy,this.context.profiler,{reuseTextures:b.textureCacheMode==="full"}),this.packedTextureDataCache=new Map,this.unpackedTextureDataCache=new Map,this.pack=b.pack,this.pack2unpackMap=new Map,this.unpack2packMap=new Map}createInferenceHandler(){return new $.WebGLInferenceHandler(this)}onGraphInitialized(b){const a=b.getValues().filter(o=>o.from===-1&&o.tensor).map(o=>o.tensor.dataId);this.initializers=new Set(a)}isInitializer(b){return!!this.initializers&&this.initializers.has(b)}addInitializer(b){this.initializers.add(b)}getTextureData(b,a){return a?this.packedTextureDataCache.get(b):this.unpackedTextureDataCache.get(b)}setTextureData(b,a,o=!1){c.Logger.verbose("WebGLSessionHandler","Storing Texture data in cache"),o?this.packedTextureDataCache.set(b,a):this.unpackedTextureDataCache.set(b,a)}dispose(){this.programManager.dispose(),this.textureManager.clearActiveTextures(),this.packedTextureDataCache.forEach(b=>this.textureManager.releaseTexture(b,!0)),this.packedTextureDataCache=new Map,this.unpackedTextureDataCache.forEach(b=>this.textureManager.releaseTexture(b,!0)),this.unpackedTextureDataCache=new Map}resolve(b,a,o){const d=(0,h.resolveOperator)(b,a,_.WEBGL_OP_RESOLVE_RULES);return{impl:d.opImpl,context:d.opInit?d.opInit(b,o):b}}}},7769:(i,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Uint8DataEncoder=e.RGBAFloatDataEncoder=e.RedFloat32DataEncoder=void 0;const c=s(6231);e.RedFloat32DataEncoder=class{constructor(h,$=1){if($===1)this.internalFormat=h.R32F,this.format=h.RED,this.textureType=h.FLOAT,this.channelSize=$;else{if($!==4)throw new Error(`Invalid number of channels: ${$}`);this.internalFormat=h.RGBA32F,this.format=h.RGBA,this.textureType=h.FLOAT,this.channelSize=$}}encode(h,$){let _,j;return h.constructor!==Float32Array&&(c.Logger.warning("Encoder","data was not of type Float32; creating new Float32Array"),j=new Float32Array(h)),$*this.channelSize>h.length?(c.Logger.warning("Encoder","Source data too small. Allocating larger array"),j=h,_=this.allocate($*this.channelSize),j.forEach((nt,et)=>_[et]=nt)):(j=h,_=j),_}allocate(h){return new Float32Array(4*h)}decode(h,$){return this.channelSize===1?h.filter((_,j)=>j%4==0).subarray(0,$):h.subarray(0,$)}},e.RGBAFloatDataEncoder=class{constructor(h,$=1,_){if($!==1&&$!==4)throw new Error(`Invalid number of channels: ${$}`);this.internalFormat=h.RGBA,this.format=h.RGBA,this.channelSize=$,this.textureType=_||h.FLOAT}encode(h,$){let _=h;return this.channelSize===1&&(c.Logger.verbose("Encoder","Exploding into a larger array"),_=this.allocate($),h.forEach((j,nt)=>_[4*nt]=j)),_}allocate(h){return new Float32Array(4*h)}decode(h,$){return this.channelSize===1?h.filter((_,j)=>j%4==0).subarray(0,$):h.subarray(0,$)}},e.Uint8DataEncoder=class{constructor(h,$=1){if(this.channelSize=4,$===1)this.internalFormat=h.ALPHA,this.format=h.ALPHA,this.textureType=h.UNSIGNED_BYTE,this.channelSize=$;else{if($!==4)throw new Error(`Invalid number of channels: ${$}`);this.internalFormat=h.RGBA,this.format=h.RGBA,this.textureType=h.UNSIGNED_BYTE,this.channelSize=$}}encode(h,$){return new Uint8Array(h.buffer,h.byteOffset,h.byteLength)}allocate(h){return new Uint8Array(h*this.channelSize)}decode(h,$){if(h instanceof Uint8Array)return h.subarray(0,$);throw new Error(`Invalid array type: ${h.constructor}`)}}},7859:(i,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getBatchDim=e.sizeToSquarishShape=e.getRowsCols=e.sizeFromShape=e.isInt=e.parseAxisParam=e.squeezeShape=e.PreferLogicalStrategy=e.AlwaysKeepOriginalSizeStrategy=void 0;const c=s(6231),h=s(2517);function $(b,a){const o=[],d=[],g=a!=null&&Array.isArray(a)&&a.length===0,rt=a==null||g?null:_(a,b).sort();let st=0;for(let tt=0;tt<b.length;++tt){if(rt!=null){if(rt[st]===tt&&b[tt]!==1)throw new Error(`Can't squeeze axis ${tt} since its dim '${b[tt]}' is not 1`);(rt[st]==null||rt[st]>tt)&&b[tt]===1&&(o.push(b[tt]),d.push(tt)),rt[st]<=tt&&st++}b[tt]!==1&&(o.push(b[tt]),d.push(tt))}return{newShape:o,keptDims:d}}function _(b,a){const o=a.length;return b=b==null?a.map((d,g)=>g):[].concat(b),(0,h.assert)(b.every(d=>d>=-o&&d<o),()=>`All values in axis param must be in range [-${o}, ${o}) but got axis ${b}`),(0,h.assert)(b.every(j),()=>`All values in axis param must be integers but got axis ${b}`),b.map(d=>d<0?o+d:d)}function j(b){return b%1==0}function nt(b){if(b.length===0)return 1;let a=b[0];for(let o=1;o<b.length;o++)a*=b[o];return a}function et(b){const a=Math.ceil(Math.sqrt(b));return[a,Math.ceil(b/a)]}e.AlwaysKeepOriginalSizeStrategy=class{constructor(b){this.maxTextureSize=b}computeTextureWH(b,a){if(b.length===0)return[1,1];const o=this.maxTextureSize;if(a&&a.breakAxis!==void 0){const rt=a.breakAxis>=b.length?1:b.slice(a.breakAxis).reduce((tt,ot)=>tt*ot),st=a.breakAxis<=0?1:b.slice(0,a.breakAxis).reduce((tt,ot)=>tt*ot);if(!(rt>o||st>o))return[rt,st];c.Logger.verbose("TextureLayout",`Given width/height preferences were unattainable: shape:${b}, breakAxis:${a.breakAxis}`)}const d=b.reduce((rt,st)=>rt*st);let g=Math.floor(Math.sqrt(d));for(;g<o&&g<d&&d%g!=0;g++);if(g>=o||d%g!=0)throw new Error(`The given dimensions are outside this GPU's boundaries: ${b}`);return[g,d/g]}},e.PreferLogicalStrategy=class{constructor(b){this.maxTextureSize=b}computeTextureWH(b,a){const o=this.computeTexture(b,a);return a&&a.isPacked&&(o[0]/=2,o[1]/=2),a&&a.reverseWH?[o[1],o[0]]:o}computeTexture(b,a){const o=a&&a.isPacked;if(b.length===0)return o?[2,2]:[1,1];let d=this.maxTextureSize;if(a&&a.breakAxis!==void 0){const st=a.breakAxis>=b.length?1:b.slice(a.breakAxis).reduce((ot,it)=>ot*it),tt=a.breakAxis<=0?1:b.slice(0,a.breakAxis).reduce((ot,it)=>ot*it);if(!(st>d||tt>d))return[st,tt];c.Logger.verbose("TextureLayout",`Given width/height preferences were unattainable: shape:${b}, breakAxis:${a.breakAxis}`)}let g=b.slice(0);o&&(d*=2,g=g.map((st,tt)=>tt>=g.length-2?g[tt]%2==0?g[tt]:g[tt]+1:g[tt]),g.length===1&&(g=[2,g[0]])),g.length!==2&&(g=$(g).newShape);const rt=nt(g);return g.length<=1&&rt<=d?[1,rt]:g.length===2&&g[0]<=d&&g[1]<=d?g:g.length===3&&g[0]*g[1]<=d&&g[2]<=d?[g[0]*g[1],g[2]]:g.length===3&&g[0]<=d&&g[1]*g[2]<=d?[g[0],g[1]*g[2]]:g.length===4&&g[0]*g[1]*g[2]<=d&&g[3]<=d?[g[0]*g[1]*g[2],g[3]]:g.length===4&&g[0]<=d&&g[1]*g[2]*g[3]<=d?[g[0],g[1]*g[2]*g[3]]:o?et(rt/4).map(st=>2*st):et(rt)}},e.squeezeShape=$,e.parseAxisParam=_,e.isInt=j,e.sizeFromShape=nt,e.getRowsCols=function(b){if(b.length===0)throw Error("Cannot get rows and columns of an empty shape array.");return[b.length>1?b[b.length-2]:1,b[b.length-1]]},e.sizeToSquarishShape=et,e.getBatchDim=function(b,a=2){return nt(b.slice(0,b.length-a))}},4057:(i,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createTextureLayoutFromShape=e.calculateTextureWidthAndHeight=e.createTextureLayoutFromTextureType=void 0;const c=s(2517),h=s(2039);e.createTextureLayoutFromTextureType=($,_,j)=>{const nt=j===h.TextureType.unpacked||j===h.TextureType.unpackedReversed?1:4,et=j===h.TextureType.packed,b=j===h.TextureType.unpackedReversed||j===h.TextureType.packed,a=j===h.TextureType.packedLastDimension?_.length-1:void 0,o=j===h.TextureType.packedLastDimension?_.map((d,g)=>g===_.length-1?4*d:d):void 0;return(0,e.createTextureLayoutFromShape)($,_,nt,o,{isPacked:et,reverseWH:b,breakAxis:a})},e.calculateTextureWidthAndHeight=($,_,j)=>{const nt=(0,e.createTextureLayoutFromTextureType)($,_,j);return[nt.width,nt.height]},e.createTextureLayoutFromShape=($,_,j=1,nt,et)=>{const b=!(!et||!et.isPacked),[a,o]=$.computeTextureWH(b&&nt||_,et),d=_.length;let g=_.slice(0);if(d===0&&(g=[1]),j===1)nt=_;else if(b){if(j!==4)throw new Error("a packed texture must be 4-channel");nt=_,d>0&&(g[d-1]=Math.ceil(g[d-1]/2)),d>1&&(g[d-2]=Math.ceil(g[d-2]/2))}else if(!nt)throw new Error("Unpacked shape is needed when using channels > 1");return{width:a,height:o,channels:j,isPacked:b,shape:g,strides:c.ShapeUtil.computeStrides(g),unpackedShape:nt,reversedWH:et&&et.reverseWH}}},5702:(i,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TextureManager=void 0;const c=s(6231);e.TextureManager=class{constructor(h,$,_,j){this.glContext=h,this.layoutStrategy=$,this.profiler=_,this.config=j,this.pendingRead=new Map,j.reuseTextures&&(this.inUseTextures=new Map,this.idleTextures=new Map,this.textureLookup=new Map)}createTextureFromLayout(h,$,_,j){const nt=this.toEncoderType(h),et=this.glContext.getEncoder(nt,$.channels||1,j);if($.isPacked&&j===1)throw new Error("not implemented");const b=$.width,a=$.height;let o,d;if(this.config.reuseTextures){o=`${b}x${a}_${et.format}_${et.internalFormat}_${et.textureType}`,d=this.inUseTextures.get(o),d||(d=[],this.inUseTextures.set(o,d));const rt=this.idleTextures.get(o);if(rt&&rt.length>0){const st=rt.pop();return d.push(st),j===1&&this.glContext.updateTexture(st,b,a,et,this.toTextureData(h,_)),st}}c.Logger.verbose("TextureManager",`Creating new texture of size ${$.width}x${$.height}`);const g=this.glContext.allocateTexture(b,a,et,this.toTextureData(h,_));return this.config.reuseTextures&&(d.push(g),this.textureLookup.set(g,o)),g}readTexture(h,$,_){return _||(_=1),this.profiler.event("backend","TextureManager.readTexture",()=>{const j=h.shape.reduce((et,b)=>et*b)*_,nt=this.glContext.readTexture(h.texture,h.width,h.height,j,this.toEncoderType($),_);return this.toTensorData($,nt)})}async readTextureAsync(h,$,_){const j=h.tensor.dataId;if(_||(_=1),this.pendingRead.has(j)){const nt=this.pendingRead.get(j);return new Promise(et=>nt==null?void 0:nt.push(et))}return this.profiler.event("backend","TextureManager.readTextureAsync",async()=>{this.pendingRead.set(j,[]);const nt=h.shape.reduce((o,d)=>o*d)*_;await this.glContext.createAndWaitForFence();const et=this.glContext.readTexture(h.texture,h.width,h.height,nt,this.toEncoderType($),_),b=this.toTensorData($,et),a=this.pendingRead.get(j);return this.pendingRead.delete(j),a==null||a.forEach(o=>o(b)),b})}readUint8TextureAsFloat(h){return this.profiler.event("backend","TextureManager.readUint8TextureAsFloat",()=>{const $=h.shape.reduce((j,nt)=>j*nt),_=this.glContext.readTexture(h.texture,h.width,h.height,4*$,"byte",4);return new Float32Array(_.buffer,_.byteOffset,$)})}releaseTexture(h,$){let _;if(this.config.reuseTextures&&(_=this.textureLookup.get(h.texture),_)){$&&this.textureLookup.delete(_);const j=this.inUseTextures.get(_);if(j){const nt=j.indexOf(h.texture);if(nt!==-1){j.splice(nt,1);let et=this.idleTextures.get(_);et||(et=[],this.idleTextures.set(_,et)),et.push(h.texture)}}}_&&!$||(c.Logger.verbose("TextureManager",`Deleting texture of size ${h.width}x${h.height}`),this.glContext.deleteTexture(h.texture))}toTensorData(h,$){switch(h){case"int16":return $ instanceof Int16Array?$:Int16Array.from($);case"int32":return $ instanceof Int32Array?$:Int32Array.from($);case"int8":return $ instanceof Int8Array?$:Int8Array.from($);case"uint16":return $ instanceof Uint16Array?$:Uint16Array.from($);case"uint32":return $ instanceof Uint32Array?$:Uint32Array.from($);case"uint8":case"bool":return $ instanceof Uint8Array?$:Uint8Array.from($);case"float32":return $ instanceof Float32Array?$:Float32Array.from($);case"float64":return $ instanceof Float64Array?$:Float64Array.from($);default:throw new Error(`TensorData type ${h} is not supported`)}}toTextureData(h,$){if($)return $ instanceof Float32Array?$:new Float32Array($)}toEncoderType(h){return"float"}clearActiveTextures(){this.glContext.clearActiveTextures()}}},2039:(i,e)=>{var s;Object.defineProperty(e,"__esModule",{value:!0}),e.TextureType=void 0,(s=e.TextureType||(e.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,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getGlChannels=e.getCoordsDataType=e.getSqueezedParams=e.squeezeInputShape=e.generateShaderFuncNameFromInputSamplerNameAtOutCoords=e.generateShaderFuncNameFromInputSamplerName=e.repeatedTry=e.getPackedShape=void 0;const c=s(2517);e.getPackedShape=function(h){const $=h.length;return h.slice(0,$-1).concat(h[$-1]/4)},e.repeatedTry=async function(h,$=j=>0,_){return new Promise((j,nt)=>{let et=0;const b=()=>{if(h())return void j();et++;const a=$(et);_!=null&&et>=_?nt():setTimeout(b,a)};b()})},e.generateShaderFuncNameFromInputSamplerName=function(h){return(0,c.assert)(h!==void 0&&h.length!==0,()=>"empty string found for sampler name"),"get"+h.charAt(0).toUpperCase()+h.slice(1)},e.generateShaderFuncNameFromInputSamplerNameAtOutCoords=function(h){return(0,c.assert)(h!==void 0&&h.length!==0,()=>"empty string found for sampler name"),"get"+h.charAt(0).toUpperCase()+h.slice(1)+"AtOutCoords"},e.squeezeInputShape=function(h,$){let _=JSON.parse(JSON.stringify(h));return _=$,_},e.getSqueezedParams=function(h,$){return $.map(_=>h[_]).join(", ")},e.getCoordsDataType=function(h){if(h<=1)return"int";if(h===2)return"ivec2";if(h===3)return"ivec3";if(h===4)return"ivec4";if(h===5)return"ivec5";if(h===6)return"ivec6";throw Error(`GPU for rank ${h} is not yet supported`)},e.getGlChannels=function(h=6){return["x","y","z","w","u","v"].slice(0,h)}},7305:(i,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createNewWebGLContext=e.createWebGLContext=void 0;const c=s(6231),h=s(1713),$={};function _(j){const nt=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 a=document.createElement("canvas");return a.width=1,a.height=1,a}();let et;const b={alpha:!1,depth:!1,antialias:!1,stencil:!1,preserveDrawingBuffer:!1,premultipliedAlpha:!1,failIfMajorPerformanceCaveat:!1};if((!j||j==="webgl2")&&(et=nt.getContext("webgl2",b),et))try{return new h.WebGLContext(et,2)}catch(a){c.Logger.warning("GlContextFactory",`failed to create WebGLContext using contextId 'webgl2'. Error: ${a}`)}if((!j||j==="webgl")&&(et=nt.getContext("webgl",b)||nt.getContext("experimental-webgl",b),et))try{return new h.WebGLContext(et,1)}catch(a){c.Logger.warning("GlContextFactory",`failed to create WebGLContext using contextId 'webgl' or 'experimental-webgl'. Error: ${a}`)}throw new Error("WebGL is not supported")}e.createWebGLContext=function j(nt){let et;nt&&nt!=="webgl2"||!("webgl2"in $)?nt&&nt!=="webgl"||!("webgl"in $)||(et=$.webgl):et=$.webgl2,et=et||_(nt),nt=nt||et.version===1?"webgl":"webgl2";const b=et.gl;return $[nt]=et,b.isContextLost()?(delete $[nt],j(nt)):(b.disable(b.DEPTH_TEST),b.disable(b.STENCIL_TEST),b.disable(b.BLEND),b.disable(b.DITHER),b.disable(b.POLYGON_OFFSET_FILL),b.disable(b.SAMPLE_COVERAGE),b.enable(b.SCISSOR_TEST),b.enable(b.CULL_FACE),b.cullFace(b.BACK),et)},e.createNewWebGLContext=_},1713:function(i,e,s){var c=this&&this.__createBinding||(Object.create?function(b,a,o,d){d===void 0&&(d=o);var g=Object.getOwnPropertyDescriptor(a,o);g&&!("get"in g?!a.__esModule:g.writable||g.configurable)||(g={enumerable:!0,get:function(){return a[o]}}),Object.defineProperty(b,d,g)}:function(b,a,o,d){d===void 0&&(d=o),b[d]=a[o]}),h=this&&this.__setModuleDefault||(Object.create?function(b,a){Object.defineProperty(b,"default",{enumerable:!0,value:a})}:function(b,a){b.default=a}),$=this&&this.__importStar||function(b){if(b&&b.__esModule)return b;var a={};if(b!=null)for(var o in b)o!=="default"&&Object.prototype.hasOwnProperty.call(b,o)&&c(a,b,o);return h(a,b),a};Object.defineProperty(e,"__esModule",{value:!0}),e.WebGLContext=e.linearSearchLastTrue=void 0;const _=s(1670),j=$(s(7769)),nt=s(9390);function et(b){let a=0;for(;a<b.length&&b[a]();++a);return a-1}e.linearSearchLastTrue=et,e.WebGLContext=class{constructor(b,a){this.frameBufferBound=!1,this.itemsToPoll=[],this.gl=b,this.version=a,this.getExtensions(),this.vertexbuffer=this.createVertexbuffer(),this.framebuffer=this.createFramebuffer(),this.queryVitalParameters()}allocateTexture(b,a,o,d){const g=this.gl,rt=g.createTexture();g.bindTexture(g.TEXTURE_2D,rt),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_MIN_FILTER,g.NEAREST),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_MAG_FILTER,g.NEAREST),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_S,g.CLAMP_TO_EDGE),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_T,g.CLAMP_TO_EDGE);const st=d?o.encode(d,b*a):null;return g.texImage2D(g.TEXTURE_2D,0,o.internalFormat,b,a,0,o.format,o.textureType,st),this.checkError(),rt}updateTexture(b,a,o,d,g){const rt=this.gl;rt.bindTexture(rt.TEXTURE_2D,b);const st=d.encode(g,a*o);rt.texSubImage2D(rt.TEXTURE_2D,0,0,0,a,o,d.format,d.textureType,st),this.checkError()}attachFramebuffer(b,a,o){const d=this.gl;d.bindTexture(d.TEXTURE_2D,b),d.bindFramebuffer(d.FRAMEBUFFER,this.framebuffer),d.framebufferTexture2D(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0,d.TEXTURE_2D,b,0),this.checkError(),d.viewport(0,0,a,o),d.scissor(0,0,a,o)}readTexture(b,a,o,d,g,rt){const st=this.gl;rt||(rt=1),this.frameBufferBound||this.attachFramebuffer(b,a,o);const tt=this.getEncoder(g,rt),ot=tt.allocate(a*o);return st.bindTexture(st.TEXTURE_2D,b),st.framebufferTexture2D(st.FRAMEBUFFER,st.COLOR_ATTACHMENT0,st.TEXTURE_2D,b,0),st.readPixels(0,0,a,o,st.RGBA,tt.textureType,ot),this.checkError(),tt.decode(ot,d)}isFramebufferReady(){return!0}getActiveTexture(){const b=this.gl;return"TEXTURE"+(b.getParameter(this.gl.ACTIVE_TEXTURE)-b.TEXTURE0)}getTextureBinding(){return this.gl.getParameter(this.gl.TEXTURE_BINDING_2D)}getFramebufferBinding(){return this.gl.getParameter(this.gl.FRAMEBUFFER_BINDING)}setVertexAttributes(b,a){const o=this.gl;o.vertexAttribPointer(b,3,o.FLOAT,!1,20,0),o.enableVertexAttribArray(b),a!==-1&&(o.vertexAttribPointer(a,2,o.FLOAT,!1,20,12),o.enableVertexAttribArray(a)),this.checkError()}createProgram(b,a){const o=this.gl,d=o.createProgram();return o.attachShader(d,b),o.attachShader(d,a),o.linkProgram(d),d}compileShader(b,a){const o=this.gl,d=o.createShader(a);if(!d)throw new Error(`createShader() returned null with type ${a}`);if(o.shaderSource(d,b),o.compileShader(d),o.getShaderParameter(d,o.COMPILE_STATUS)===!1)throw new Error(`Failed to compile shader: ${o.getShaderInfoLog(d)}
|
|
1849
1849
|
Shader source:
|
|
1850
|
-
${b}`);return d}deleteShader(b){this.gl.deleteShader(b)}bindTextureToUniform(b,a,o){const d=this.gl;d.activeTexture(d.TEXTURE0+a),this.checkError(),d.bindTexture(d.TEXTURE_2D,b),this.checkError(),d.uniform1i(o,a),this.checkError()}draw(){this.gl.drawArrays(this.gl.TRIANGLE_STRIP,0,4),this.checkError()}checkError(){if(_.env.debug){const b=this.gl,a=b.getError();let o="";switch(a){case b.NO_ERROR:return;case b.INVALID_ENUM:o="INVALID_ENUM";break;case b.INVALID_VALUE:o="INVALID_VALUE";break;case b.INVALID_OPERATION:o="INVALID_OPERATION";break;case b.INVALID_FRAMEBUFFER_OPERATION:o="INVALID_FRAMEBUFFER_OPERATION";break;case b.OUT_OF_MEMORY:o="OUT_OF_MEMORY";break;case b.CONTEXT_LOST_WEBGL:o="CONTEXT_LOST_WEBGL";break;default:o=`Unknown WebGL Error: ${a.toString(16)}`}throw new Error(o)}}deleteTexture(b){this.gl.deleteTexture(b)}deleteProgram(b){this.gl.deleteProgram(b)}getEncoder(b,a,o=0){if(this.version===2)return new j.RedFloat32DataEncoder(this.gl,a);switch(b){case"float":return o===1||this.isRenderFloat32Supported?new j.RGBAFloatDataEncoder(this.gl,a):new j.RGBAFloatDataEncoder(this.gl,a,this.textureHalfFloatExtension.HALF_FLOAT_OES);case"int":throw new Error("not implemented");case"byte":return new j.Uint8DataEncoder(this.gl,a);default:throw new Error(`Invalid dataType: ${b}`)}}clearActiveTextures(){const b=this.gl;for(let a=0;a<this.maxTextureImageUnits;++a)b.activeTexture(b.TEXTURE0+a),b.bindTexture(b.TEXTURE_2D,null)}dispose(){if(this.disposed)return;const b=this.gl;b.bindFramebuffer(b.FRAMEBUFFER,null),b.deleteFramebuffer(this.framebuffer),b.bindBuffer(b.ARRAY_BUFFER,null),b.deleteBuffer(this.vertexbuffer),b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,null),b.finish(),this.disposed=!0}createDefaultGeometry(){return new Float32Array([-1,1,0,0,1,-1,-1,0,0,0,1,1,0,1,1,1,-1,0,1,0])}createVertexbuffer(){const b=this.gl,a=b.createBuffer();if(!a)throw new Error("createBuffer() returned null");const o=this.createDefaultGeometry();return b.bindBuffer(b.ARRAY_BUFFER,a),b.bufferData(b.ARRAY_BUFFER,o,b.STATIC_DRAW),this.checkError(),a}createFramebuffer(){const b=this.gl.createFramebuffer();if(!b)throw new Error("createFramebuffer returned null");return b}queryVitalParameters(){const b=this.gl;if(this.isFloatTextureAttachableToFrameBuffer=this.checkFloatTextureAttachableToFrameBuffer(),this.isRenderFloat32Supported=this.checkRenderFloat32(),this.isFloat32DownloadSupported=this.checkFloat32Download(),this.version===1&&!this.textureHalfFloatExtension&&!this.isRenderFloat32Supported)throw new Error("both float32 and float16 TextureType are not supported");this.isBlendSupported=!this.isRenderFloat32Supported||this.checkFloat32Blend(),this.maxTextureSize=b.getParameter(b.MAX_TEXTURE_SIZE),this.maxTextureImageUnits=b.getParameter(b.MAX_TEXTURE_IMAGE_UNITS),this.version}getExtensions(){this.version===2?(this.colorBufferFloatExtension=this.gl.getExtension("EXT_color_buffer_float"),this.disjointTimerQueryWebgl2Extension=this.gl.getExtension("EXT_disjoint_timer_query_webgl2")):(this.textureFloatExtension=this.gl.getExtension("OES_texture_float"),this.textureHalfFloatExtension=this.gl.getExtension("OES_texture_half_float"))}checkFloatTextureAttachableToFrameBuffer(){const b=this.gl,a=b.createTexture();b.bindTexture(b.TEXTURE_2D,a);const o=this.version===2?b.RGBA32F:b.RGBA;b.texImage2D(b.TEXTURE_2D,0,o,1,1,0,b.RGBA,b.FLOAT,null);const d=b.createFramebuffer();b.bindFramebuffer(b.FRAMEBUFFER,d),b.framebufferTexture2D(b.FRAMEBUFFER,b.COLOR_ATTACHMENT0,b.TEXTURE_2D,a,0);const g=b.checkFramebufferStatus(b.FRAMEBUFFER)===b.FRAMEBUFFER_COMPLETE;return b.bindTexture(b.TEXTURE_2D,null),b.bindFramebuffer(b.FRAMEBUFFER,null),b.deleteTexture(a),b.deleteFramebuffer(d),g}checkRenderFloat32(){if(this.version===2){if(!this.colorBufferFloatExtension)return!1}else if(!this.textureFloatExtension)return!1;return this.isFloatTextureAttachableToFrameBuffer}checkFloat32Download(){if(this.version===2){if(!this.colorBufferFloatExtension)return!1}else if(!this.textureFloatExtension||!this.gl.getExtension("WEBGL_color_buffer_float"))return!1;return this.isFloatTextureAttachableToFrameBuffer}checkFloat32Blend(){const b=this.gl;let a,o,d,g,rt;try{a=b.createTexture(),o=b.createFramebuffer(),b.bindTexture(b.TEXTURE_2D,a);const st=this.version===2?b.RGBA32F:b.RGBA;return b.texImage2D(b.TEXTURE_2D,0,st,1,1,0,b.RGBA,b.FLOAT,null),b.bindFramebuffer(b.FRAMEBUFFER,o),b.framebufferTexture2D(b.FRAMEBUFFER,b.COLOR_ATTACHMENT0,b.TEXTURE_2D,a,0),b.enable(b.BLEND),d=b.createShader(b.VERTEX_SHADER),!!d&&(b.shaderSource(d,"void main(){}"),b.compileShader(d),g=b.createShader(b.FRAGMENT_SHADER),!!g&&(b.shaderSource(g,"precision highp float;void main(){gl_FragColor=vec4(0.5);}"),b.compileShader(g),rt=b.createProgram(),!!rt&&(b.attachShader(rt,d),b.attachShader(rt,g),b.linkProgram(rt),b.useProgram(rt),b.drawArrays(b.POINTS,0,1),b.getError()===b.NO_ERROR)))}finally{b.disable(b.BLEND),rt&&b.deleteProgram(rt),d&&b.deleteShader(d),g&&b.deleteShader(g),o&&(b.bindFramebuffer(b.FRAMEBUFFER,null),b.deleteFramebuffer(o)),a&&(b.bindTexture(b.TEXTURE_2D,null),b.deleteTexture(a))}}beginTimer(){if(this.version===2&&this.disjointTimerQueryWebgl2Extension){const b=this.gl,a=this.disjointTimerQueryWebgl2Extension,o=b.createQuery();return b.beginQuery(a.TIME_ELAPSED_EXT,o),o}throw new Error("WebGL1 profiling currently not supported.")}endTimer(){if(this.version!==2||!this.disjointTimerQueryWebgl2Extension)throw new Error("WebGL1 profiling currently not supported");{const b=this.gl,a=this.disjointTimerQueryWebgl2Extension;b.endQuery(a.TIME_ELAPSED_EXT)}}isTimerResultAvailable(b){let a=!1,o=!1;if(this.version!==2||!this.disjointTimerQueryWebgl2Extension)throw new Error("WebGL1 profiling currently not supported");{const d=this.gl,g=this.disjointTimerQueryWebgl2Extension;a=d.getQueryParameter(b,d.QUERY_RESULT_AVAILABLE),o=d.getParameter(g.GPU_DISJOINT_EXT)}return a&&!o}getTimerResult(b){let a=0;if(this.version!==2)throw new Error("WebGL1 profiling currently not supported");{const o=this.gl;a=o.getQueryParameter(b,o.QUERY_RESULT),o.deleteQuery(b)}return a/1e6}async waitForQueryAndGetTime(b){return await(0,nt.repeatedTry)(()=>this.isTimerResultAvailable(b)),this.getTimerResult(b)}async createAndWaitForFence(){const b=this.createFence(this.gl);return this.pollFence(b)}createFence(b){let a;const o=b,d=o.fenceSync(o.SYNC_GPU_COMMANDS_COMPLETE,0);return b.flush(),a=d===null?()=>!0:()=>{const g=o.clientWaitSync(d,0,0);return g===o.ALREADY_SIGNALED||g===o.CONDITION_SATISFIED},{query:d,isFencePassed:a}}async pollFence(b){return new Promise(a=>{this.addItemToPoll(()=>b.isFencePassed(),()=>a())})}pollItems(){const b=et(this.itemsToPoll.map(a=>a.isDoneFn));for(let a=0;a<=b;++a){const{resolveFn:o}=this.itemsToPoll[a];o()}this.itemsToPoll=this.itemsToPoll.slice(b+1)}async addItemToPoll(b,a){this.itemsToPoll.push({isDoneFn:b,resolveFn:a}),this.itemsToPoll.length>1||await(0,nt.repeatedTry)(()=>(this.pollItems(),this.itemsToPoll.length===0))}}},1036:(i,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ExecutionPlan=void 0;const c=s(6231);class h{constructor(_,j){this.op=_,this.node=j}}e.ExecutionPlan=class{constructor($,_,j){this.graph=$,this.profiler=j,this.initialize(_)}initialize($){this.profiler.event("session","ExecutionPlan.initialize",()=>{const _=this.graph.getNodes();if(_.length!==$.length)throw new Error("The size of nodes and OPs do not match.");this._ops=$.map((j,nt)=>new h(j,_[nt])),this.reset(),this._starter=[],this._ops.forEach((j,nt)=>{let et=!0;for(const b of j.node.inputs)if(!this._values[b]&&this.graph.getInputIndices().indexOf(b)===-1){et=!1;break}et&&this._starter.push(nt)})})}reset(){this._values=this.graph.getValues().map($=>$.tensor)}async execute($,_){return this.profiler.event("session","ExecutionPlan.execute",async()=>{this.reset();const j=$.createInferenceHandler(),nt=this.graph.getInputIndices();if(_.length!==nt.length)throw new Error(`number of input tensors don't match the number of inputs to the model: actual: ${_.length} expected: ${nt.length}`);_.forEach((g,rt)=>{const st=nt[rt];this._values[st]=g});const et=this._starter.slice(0),b=this.graph.getValues(),a=this.graph.getNodes();let o=0;for(;o<et.length;){const g=et[o++],rt=this._ops[g],st=rt.node.inputs.map(at=>this._values[at]);if(st.indexOf(void 0)!==-1)throw new Error(`unresolved input detected: op: ${rt.node}`);const tt=st;c.Logger.verbose("ExecPlan",`Runing op:${rt.node.name} (${tt.map((at,ut)=>`'${rt.node.inputs[ut]}': ${at.type}[${at.dims.join(",")}]`).join(", ")})`);const ot=await this.profiler.event("node",rt.node.name,async()=>rt.op.impl(j,tt,rt.op.context));if(ot.length!==rt.node.outputs.length)throw new Error("the size of output does not match model definition.");ot.forEach((at,ut)=>{const lt=rt.node.outputs[ut];if(this._values[lt])throw new Error(`output [${lt}] already has value: op:${rt.node.name}`);this._values[lt]=at});const it=new Set;ot.forEach((at,ut)=>{const lt=rt.node.outputs[ut];for(const ct of b[lt].to){const ft=a[ct];let dt=!0;for(const yt of ft.inputs)if(!this._values[yt]){dt=!1;break}dt&&it.add(ct)}}),et.push(...it)}const d=[];for(let g=0;g<this.graph.getOutputIndices().length;g++){const rt=this.graph.getOutputIndices()[g],st=this._values[rt];if(st===void 0)throw new Error(`required output [${rt}] does not have value`);rt===0?await st.getData():st.data,d.push(st)}return c.Logger.verbose("ExecPlan","disposing of inferenceHandler"),j.dispose(),d})}}},7070:(i,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Graph=void 0;const c=s(1446),h=s(7778),$=s(9395),_=s(9162),j=s(2517);var nt=$.onnxruntime.experimental.fbs;e.Graph={from:(o,d)=>new a(o,d)};class et{constructor(d){this._from=void 0,this._to=[],this.tensor=void 0,this.type=void 0,d&&(this.type=j.ProtoUtil.tensorValueTypeFromProto(d.type.tensorType))}get from(){return this._from}get to(){return this._to}}class b{constructor(d,g){d instanceof c.onnx.NodeProto?(this.name=d.name,this.opType=d.opType,this.attributes=new h.Attribute(d.attribute)):d instanceof nt.Node&&(this.name=g??d.name(),this.opType=d.opType(),this.attributes=new h.Attribute(j.ProtoUtil.tensorAttributesFromORTFormat(d))),this.inputs=[],this.outputs=[],this.executeNode=!0}}class a{constructor(d,g){if(!d)throw new TypeError("graph is empty");this.buildGraph(d),this.transformGraph(g),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(d){if(d instanceof c.onnx.GraphProto)this.buildGraphFromOnnxFormat(d);else{if(!(d instanceof nt.Graph))throw new TypeError("Graph type is not supported.");this.buildGraphFromOrtFormat(d)}}buildGraphFromOnnxFormat(d){const g=new Map;this._allData=[],this._allInputIndices=[],this._allInputNames=[],this._allOutputIndices=[],this._allOutputNames=[],this._nodes=[];const rt=new Map;if(!d.input)throw new Error("missing information in graph: input");const st=[];for(const tt of d.input){if(g.has(tt.name))throw new Error(`duplicated input name: ${tt.name}`);const ot=this._allData.push(new et(tt))-1;g.set(tt.name,ot),st.push(tt.name)}if(!d.initializer)throw new Error("missing information in graph: initializer");for(const tt of d.initializer){let ot=g.get(tt.name);if(ot===void 0){const it=new et;it.type={shape:{dims:j.ProtoUtil.tensorDimsFromProto(tt.dims)},tensorType:j.ProtoUtil.tensorDataTypeFromProto(tt.dataType)},ot=this._allData.push(it)-1,g.set(tt.name,ot)}this._allData[ot]._from=-1,this._allData[ot].tensor=_.Tensor.fromProto(tt)}for(let tt=0;tt<this._allData.length;tt++)this._allData[tt].tensor||(this._allInputIndices.push(tt),this._allInputNames.push(st[tt]));if(!d.output)throw new Error("missing information in graph: output");for(const tt of d.output){if(g.has(tt.name))throw new Error(`duplicated output name: ${tt.name}`);const ot=this._allData.push(new et(tt))-1;g.set(tt.name,ot),this._allOutputIndices.push(ot),this._allOutputNames.push(tt.name)}if(!d.node)throw new Error("missing information in graph: node");for(const tt of d.node){if(!tt.name)for(let it=0;;it++){const at=`unnamed_${tt.opType}_${it}`;if(!rt.has(at)){tt.name=at;break}}if(rt.has(tt.name))throw new Error(`duplicated node name: ${tt.name}`);const ot=this._nodes.push(new b(tt))-1;rt.set(tt.name,ot)}for(let tt=0;tt<this._nodes.length;tt++){const ot=this._nodes[tt],it=d.node[tt];if(!it.output)throw new Error(`missing output for node: ${it.name}`);for(const at of it.output){let ut=g.get(at);if(ut===void 0&&(ut=this._allData.push(new et)-1,g.set(at,ut)),ot.outputs.push(ut),this._allData[ut]._from!==void 0)throw new Error(`multiple nodes output to one data value: ${ut}`);if(this._allData[ut]._from=tt,it.opType==="Constant"){if(!it.attribute||it.attribute.length!==1||!it.attribute[0].t)throw new Error("missing attributes or missing tensor value in attributes for this Constant operator");if(!it.output||it.output.length!==1)throw new Error("missing output or incorrect number of outputs for this Constant operator");ot.outputs.pop(),ot.executeNode=!1,this._allData[ut]._from=-1,this._allData[ut].tensor=_.Tensor.fromProto(it.attribute[0].t)}}}for(let tt=0;tt<this._nodes.length;tt++){const ot=this._nodes[tt],it=d.node[tt];if(!it.input)throw new Error(`missing input for node: ${it.name}`);for(const at of it.input){const ut=g.get(at);if(ut===void 0){if(at===""&&it.input.length===3&&it.opType==="Resize")continue;throw new Error(`unrecognized input '${at}' for node: ${it.name}`)}ot.inputs.push(ut),this._allData[ut]._to.push(tt)}}return!0}buildGraphFromOrtFormat(d){var g,rt,st;const tt=new Map;this._allData=[],this._allInputIndices=[],this._allInputNames=[],this._allOutputIndices=[],this._allOutputNames=[],this._nodes=[];const ot=new Map,it=[];for(let at=0;at<d.inputsLength();at++){const ut=d.inputs(at);if(tt.has(ut))throw new Error(`duplicated input name: ${ut}`);for(let lt=0;lt<d.nodeArgsLength();lt++)if(((g=d.nodeArgs(lt))===null||g===void 0?void 0:g.name())===ut){const ct=new et;if(((st=(rt=d.nodeArgs(lt))===null||rt===void 0?void 0:rt.type())===null||st===void 0?void 0:st.valueType())!==nt.TypeInfoValue.tensor_type)throw new Error("Unexpected value type for the nodeArg.");const ft=d.nodeArgs(lt).type().value(new nt.TensorTypeAndShape),dt=j.ProtoUtil.tensorDataTypeFromProto(ft.elemType()),yt=ft.shape(),St=[];for(let Tt=0;Tt<yt.dimLength();Tt++)St.push(j.LongUtil.longToNumber(yt.dim(Tt).value().dimValue()));ct.type={shape:{dims:St},tensorType:dt};const bt=this._allData.push(ct)-1;tt.set(ut,bt),it.push(ut)}}for(let at=0;at<d.initializersLength();at++){const ut=d.initializers(at);let lt=tt.get(ut.name());if(lt===void 0){const ct=new et,ft=j.ProtoUtil.tensorDimsFromORTFormat(ut),dt=j.ProtoUtil.tensorDataTypeFromProto(ut.dataType());ct.type={shape:{dims:ft},tensorType:dt},lt=this._allData.push(ct)-1,tt.set(ut.name(),lt)}this._allData[lt]._from=-1,this._allData[lt].tensor=_.Tensor.fromOrtTensor(ut)}for(let at=0;at<this._allData.length;at++)this._allData[at].tensor||(this._allInputIndices.push(at),this._allInputNames.push(it[at]));for(let at=0;at<d.outputsLength();at++){const ut=d.outputs(at);if(tt.has(ut))throw new Error(`duplicated output name: ${ut}`);const lt=this._allData.push(new et)-1;tt.set(ut,lt),this._allOutputIndices.push(lt),this._allOutputNames.push(ut)}if(!d.nodes)throw new Error("missing information in graph: node");for(let at=0;at<d.nodesLength();at++){const ut=d.nodes(at);let lt=ut.name();if(!lt)for(let ft=0;lt=`unnamed_${ut.opType()}_${ft}`,ot.has(lt);ft++);if(ot.has(lt))throw new Error(`duplicated node name: ${lt}`);const ct=this._nodes.push(new b(ut,lt))-1;ot.set(lt,ct)}for(let at=0;at<this._nodes.length;at++){const ut=this._nodes[at],lt=d.nodes(at);if(lt==null)throw new Error(`No node exists at index ${at}`);if((lt==null?void 0:lt.outputsLength())===0)throw new Error(`missing output for node: ${lt.name}`);for(let ct=0;ct<(lt==null?void 0:lt.outputsLength());ct++){const ft=lt==null?void 0:lt.outputs(ct);let dt=tt.get(ft);if(dt===void 0&&(dt=this._allData.push(new et)-1,tt.set(ft,dt)),ut.outputs.push(dt),this._allData[dt]._from!==void 0)throw new Error(`multiple nodes output to one data value: ${dt}`);if(this._allData[dt]._from=at,lt.opType()==="Constant"){if(lt.attributesLength()!==1||!lt.attributes(0).t())throw new Error("missing attributes or missing tensor value in attributes for this Constant operator");if(lt.outputsLength()!==1)throw new Error("missing output or incorrect number of outputs for this Constant operator");ut.outputs.pop(),ut.executeNode=!1,this._allData[dt]._from=-1,this._allData[dt].tensor=_.Tensor.fromOrtTensor(lt.attributes(0).t())}}}for(let at=0;at<this._nodes.length;at++){const ut=this._nodes[at],lt=d.nodes(at);if(lt.inputsLength()===0)throw new Error(`missing input for node: ${lt.name}`);for(let ct=0;ct<lt.inputsLength();ct++){const ft=lt.inputs(ct),dt=tt.get(ft);if(dt===void 0)throw new Error(`unrecognized input '${ft}' for node: ${lt.name()}`);ut.inputs.push(dt),this._allData[dt]._to.push(at)}}}checkIsAcyclic(){const d=new Set;this._allInputIndices.forEach(st=>{this._allData[st]._to.forEach(tt=>{d.add(tt)})});const g=Array.from(d),rt=new Array(this._nodes.length).fill("white");for(;g.length>0;){const st=g.pop();rt[st]==="gray"?rt[st]="black":(g.push(st),rt[st]="gray",this._nodes[st].outputs.forEach(tt=>{const ot=this._allData[tt];if(ot.tensor!==void 0)throw new Error("node outputs should not be initialized");if(ot._from!==st)throw new Error("from property of the Value object doesn't match index of Node being processed");ot._to.forEach(it=>{if(rt[it]==="gray")throw new Error("model graph is cyclic");rt[it]==="white"&&g.push(it)})}))}}transformGraph(d){this.removeAllIdentityNodes(),this.removeAllDropoutNodes(),this.fuseConvActivationNodes(),d&&d.transformGraph(this),this.finalizeGraph()}finalizeGraph(){let d=0;for(let g=0;g<this._nodes.length;g++)this._nodes[g].executeNode?d>0&&(this._nodes[g].inputs.forEach(rt=>{const st=this._allData[rt]._to.indexOf(g+d);st!==-1&&(this._allData[rt]._to[st]=g)}),this._nodes[g].outputs.forEach(rt=>{this._allData[rt]._from&&this._allData[rt]._from===g+d&&(this._allData[rt]._from=g)})):(d++,this._nodes[g].outputs.forEach(rt=>{this._allData[rt]._from=-2}),this._nodes.splice(g,1),g--);d=0;for(let g=0;g<this._allData.length;g++)if(this._allData[g].from!==-2||this._allOutputIndices.indexOf(g+d)!==-1){if(d>0){let rt=-1;this._allData[g].from!==void 0&&this._allData[g].from!==-1?(rt=this._nodes[this._allData[g].from].outputs.indexOf(g+d),rt!==-1&&(this._nodes[this._allData[g].from].outputs[rt]=g)):(rt=this._allInputIndices.indexOf(g+d),rt!==-1&&(this._allInputIndices[rt]=g)),this._allData[g].to.forEach(st=>{rt=this._nodes[st].inputs.indexOf(g+d),rt!==-1&&(this._nodes[st].inputs[rt]=g)}),this._allData[g].to.length===0&&(rt=this._allOutputIndices.indexOf(g+d),rt!==-1&&(this._allOutputIndices[rt]=g))}}else d++,this._allData.splice(g,1),g--}deleteNode(d){const g=this._nodes[d];if(g.outputs.length>1){for(let at=1;at<g.outputs.length;at++)if(this._allData[g.outputs[at]].to.length>0)throw new Error("Node deletion with more than one output connected to other nodes is not supported. ")}g.executeNode=!1;const rt=g.inputs[0],st=g.outputs[0],tt=this._allData[st].to,ot=this._allData[rt].to.indexOf(d);if(ot===-1)throw new Error("The Value object doesn't have the current Node in it's 'to' property ");this._allData[rt].to.splice(ot,1),this._allData[st]._to=[];const it=this._allOutputIndices.indexOf(st);if(it!==-1&&(this._allOutputIndices[it]=rt),tt&&tt.length>0)for(const at of tt){const ut=this._nodes[at].inputs.indexOf(st);if(ut===-1)throw new Error("The Node object doesn't have the output Value in it's 'inputs' property ");this._nodes[at].inputs[ut]=rt,this._allData[rt].to.push(at)}}removeAllDropoutNodes(){let d=0;for(const g of this._nodes){if(g.opType==="Dropout"){if(g.inputs.length!==1)throw new Error("Dropout nodes should only contain one input. ");if(g.outputs.length!==1&&g.outputs.length!==2)throw new Error("Dropout nodes should contain either 1 or 2 output(s)");if(g.outputs.length===2&&this._allData[g.outputs[1]]._to.length!==0)throw new Error("Dropout nodes's second output should not be referenced by other nodes");this.deleteNode(d)}d++}}removeAllIdentityNodes(){let d=0;for(const g of this._nodes)g.opType==="Identity"&&this.deleteNode(d),d++}isActivation(d){switch(d.opType){case"Relu":case"Sigmoid":case"Clip":return!0;default:return!1}}fuseConvActivationNodes(){for(const d of this._nodes)if(d.opType==="Conv"){const g=this._allData[d.outputs[0]]._to;if(g.length===1&&this.isActivation(this._nodes[g[0]])){const rt=this._nodes[g[0]];if(rt.opType==="Clip")if(rt.inputs.length===1)try{d.attributes.set("activation_params","floats",[rt.attributes.getFloat("min"),rt.attributes.getFloat("max")])}catch{d.attributes.set("activation_params","floats",[j.MIN_CLIP,j.MAX_CLIP])}else{if(!(rt.inputs.length>=3&&this._allData[rt.inputs[1]].tensor!==void 0&&this._allData[rt.inputs[2]].tensor!==void 0))continue;d.attributes.set("activation_params","floats",[this._allData[rt.inputs[1]].tensor.floatData[0],this._allData[rt.inputs[2]].tensor.floatData[0]])}d.attributes.set("activation","string",rt.opType),this.deleteNode(g[0])}}}}},6231:(i,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.now=e.Profiler=e.Logger=void 0;const s={verbose:1e3,info:2e3,warning:4e3,error:5e3,fatal:6e3},c={none:new class{log(b,a,o){}},console:new class{log(b,a,o){console.log(`${this.color(b)} ${o?"\x1B[35m"+o+"\x1B[0m ":""}${a}`)}color(b){switch(b){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: ${b}`)}}}},h={provider:"console",minimalSeverity:"warning",logDateTime:!0,logSourceLocation:!1};let $={"":h};function _(b,a,o,d){if(a===void 0)return g=b,{verbose:_.verbose.bind(null,g),info:_.info.bind(null,g),warning:_.warning.bind(null,g),error:_.error.bind(null,g),fatal:_.fatal.bind(null,g)};if(o===void 0)j(b,a);else if(typeof o=="number"&&d===void 0)j(b,a);else if(typeof o=="string"&&d===void 0)j(b,o,0,a);else{if(typeof o!="string"||typeof d!="number")throw new TypeError("input is valid");j(b,o,0,a)}var g}function j(b,a,o,d){const g=$[d||""]||$[""];s[b]<s[g.minimalSeverity]||(g.logDateTime&&(a=`${new Date().toISOString()}|${a}`),g.logSourceLocation,c[g.provider].log(b,a,d))}(function(b){function a(d){$={},o("",d||{})}function o(d,g){if(d==="*")a(g);else{const rt=$[d]||h;$[d]={provider:g.provider||rt.provider,minimalSeverity:g.minimalSeverity||rt.minimalSeverity,logDateTime:g.logDateTime===void 0?rt.logDateTime:g.logDateTime,logSourceLocation:g.logSourceLocation===void 0?rt.logSourceLocation:g.logSourceLocation}}}b.verbose=function(d,g){b("verbose",d,g)},b.info=function(d,g){b("info",d,g)},b.warning=function(d,g){b("warning",d,g)},b.error=function(d,g){b("error",d,g)},b.fatal=function(d,g){b("fatal",d,g)},b.reset=a,b.set=o,b.setWithEnv=function(d){const g={};d.logLevel&&(g.minimalSeverity=d.logLevel),o("",g)}})(_||(_={})),e.Logger=_;class nt{constructor(a,o,d,g,rt,st){this.category=a,this.name=o,this.startTime=d,this.endCallback=g,this.timer=rt,this.ctx=st}end(){return this.endCallback(this)}async checkTimer(){if(this.ctx===void 0||this.timer===void 0)throw new Error("No webgl timer found");return this.ctx.endTimer(),this.ctx.waitForQueryAndGetTime(this.timer)}}class et{constructor(a,o,d,g){this.category=a,this.name=o,this.startTime=d,this.endTime=g}}e.Profiler=class{static create(b){return b===void 0?new this:new this(b.maxNumberEvents,b.flushBatchSize,b.flushIntervalInMilliseconds)}constructor(b,a,o){this._started=!1,this._flushPointer=0,this._started=!1,this._maxNumberEvents=b===void 0?1e4:b,this._flushBatchSize=a===void 0?10:a,this._flushIntervalInMilliseconds=o===void 0?5e3:o}start(){this._started=!0,this._timingEvents=[],this._flushTime=(0,e.now)(),this._flushPointer=0}stop(){for(this._started=!1;this._flushPointer<this._timingEvents.length;this._flushPointer++)this.logOneEvent(this._timingEvents[this._flushPointer])}event(b,a,o,d){const g=this._started?this.begin(b,a,d):void 0;let rt=!1;const st=o();if(st&&typeof st.then=="function")return rt=!0,new Promise((tt,ot)=>{st.then(async it=>{g&&await g.end(),tt(it)},async it=>{g&&await g.end(),ot(it)})});if(!rt&&g){const tt=g.end();if(tt&&typeof tt.then=="function")return new Promise((ot,it)=>{tt.then(()=>{ot(st)},at=>{it(at)})})}return st}begin(b,a,o){if(!this._started)throw new Error("profiler is not started yet");if(o===void 0){const d=(0,e.now)();return this.flush(d),new nt(b,a,d,g=>this.endSync(g))}{const d=o.beginTimer();return new nt(b,a,0,async g=>this.end(g),d,o)}}async end(b){const a=await b.checkTimer();this._timingEvents.length<this._maxNumberEvents&&(this._timingEvents.push(new et(b.category,b.name,b.startTime,a)),this.flush(a))}endSync(b){const a=(0,e.now)();this._timingEvents.length<this._maxNumberEvents&&(this._timingEvents.push(new et(b.category,b.name,b.startTime,a)),this.flush(a))}logOneEvent(b){e.Logger.verbose(`Profiler.${b.category}`,`${(b.endTime-b.startTime).toFixed(2)}ms on event '${b.name}' at ${b.endTime.toFixed(2)}`)}flush(b){if(this._timingEvents.length-this._flushPointer>=this._flushBatchSize||b-this._flushTime>=this._flushIntervalInMilliseconds){for(const a=this._flushPointer;this._flushPointer<a+this._flushBatchSize&&this._flushPointer<this._timingEvents.length;this._flushPointer++)this.logOneEvent(this._timingEvents[this._flushPointer]);this._flushTime=(0,e.now)()}}get started(){return this._started}},e.now=typeof performance<"u"&&performance.now?()=>performance.now():Date.now},2644:(i,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Model=void 0;const c=s(5686),h=s(1446),$=s(7070),_=s(9395),j=s(2517);var nt=_.onnxruntime.experimental.fbs;e.Model=class{constructor(){}load(et,b,a){if(!a)try{return void this.loadFromOnnxFormat(et,b)}catch(o){if(a!==void 0)throw o}this.loadFromOrtFormat(et,b)}loadFromOnnxFormat(et,b){const a=h.onnx.ModelProto.decode(et);if(j.LongUtil.longToNumber(a.irVersion)<3)throw new Error("only support ONNX model with IR_VERSION>=3");this._opsets=a.opsetImport.map(o=>({domain:o.domain,version:j.LongUtil.longToNumber(o.version)})),this._graph=$.Graph.from(a.graph,b)}loadFromOrtFormat(et,b){const a=new c.flatbuffers.ByteBuffer(et),o=nt.InferenceSession.getRootAsInferenceSession(a).model();if(j.LongUtil.longToNumber(o.irVersion())<3)throw new Error("only support ONNX model with IR_VERSION>=3");this._opsets=[];for(let d=0;d<o.opsetImportLength();d++){const g=o.opsetImport(d);this._opsets.push({domain:g==null?void 0:g.domain(),version:j.LongUtil.longToNumber(g.version())})}this._graph=$.Graph.from(o.graph(),b)}get graph(){return this._graph}get opsets(){return this._opsets}}},782:(i,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.FLOAT_TYPES=e.INT_TYPES=e.NUMBER_TYPES=void 0,e.NUMBER_TYPES=["float32","float64","int32","int16","int8","uint16","uint32","uint8"],e.INT_TYPES=["int32","int16","int8","uint16","uint32","uint8"],e.FLOAT_TYPES=["float32","float64"]},1047:(i,e)=>{function s(c,h){if(h.endsWith("+")){const $=Number.parseInt(h.substring(0,h.length-1),10);return!isNaN($)&&$<=c}if(h.split("-").length===2){const $=h.split("-"),_=Number.parseInt($[0],10),j=Number.parseInt($[1],10);return!isNaN(_)&&!isNaN(j)&&_<=c&&c<=j}return Number.parseInt(h,10)===c}Object.defineProperty(e,"__esModule",{value:!0}),e.resolveOperator=void 0,e.resolveOperator=function(c,h,$){for(const _ of $){const j=_[0],nt=_[1],et=_[2],b=_[3],a=_[4];if(c.opType===j){for(const o of h)if((o.domain===nt||o.domain==="ai.onnx"&&nt==="")&&s(o.version,et))return{opImpl:b,opInit:a}}}throw new TypeError(`cannot resolve operator '${c.opType}' with opsets: ${h.map(_=>`${_.domain||"ai.onnx"} v${_.version}`).join(", ")}`)}},9395:(i,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.onnxruntime=void 0;const c=s(5686);var h,$;h=e.onnxruntime||(e.onnxruntime={}),function(_){(function(j){j[j.UNDEFINED=0]="UNDEFINED",j[j.FLOAT=1]="FLOAT",j[j.INT=2]="INT",j[j.STRING=3]="STRING",j[j.TENSOR=4]="TENSOR",j[j.GRAPH=5]="GRAPH",j[j.FLOATS=6]="FLOATS",j[j.INTS=7]="INTS",j[j.STRINGS=8]="STRINGS",j[j.TENSORS=9]="TENSORS",j[j.GRAPHS=10]="GRAPHS",j[j.SPARSE_TENSOR=11]="SPARSE_TENSOR",j[j.SPARSE_TENSORS=12]="SPARSE_TENSORS"})(_.AttributeType||(_.AttributeType={}))}(($=h.experimental||(h.experimental={})).fbs||($.fbs={})),function(_){(function(j){(function(nt){(function(et){et[et.UNKNOWN=0]="UNKNOWN",et[et.VALUE=1]="VALUE",et[et.PARAM=2]="PARAM"})(nt.DimensionValueType||(nt.DimensionValueType={}))})(j.fbs||(j.fbs={}))})(_.experimental||(_.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(_){(function(j){(function(nt){(function(et){et[et.UNDEFINED=0]="UNDEFINED",et[et.FLOAT=1]="FLOAT",et[et.UINT8=2]="UINT8",et[et.INT8=3]="INT8",et[et.UINT16=4]="UINT16",et[et.INT16=5]="INT16",et[et.INT32=6]="INT32",et[et.INT64=7]="INT64",et[et.STRING=8]="STRING",et[et.BOOL=9]="BOOL",et[et.FLOAT16=10]="FLOAT16",et[et.DOUBLE=11]="DOUBLE",et[et.UINT32=12]="UINT32",et[et.UINT64=13]="UINT64",et[et.COMPLEX64=14]="COMPLEX64",et[et.COMPLEX128=15]="COMPLEX128",et[et.BFLOAT16=16]="BFLOAT16"})(nt.TensorDataType||(nt.TensorDataType={}))})(j.fbs||(j.fbs={}))})(_.experimental||(_.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(_){(function(j){(function(nt){(function(et){et[et.Primitive=0]="Primitive",et[et.Fused=1]="Fused"})(nt.NodeType||(nt.NodeType={}))})(j.fbs||(j.fbs={}))})(_.experimental||(_.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(_){(function(j){(function(nt){(function(et){et[et.NONE=0]="NONE",et[et.tensor_type=1]="tensor_type",et[et.sequence_type=2]="sequence_type",et[et.map_type=3]="map_type"})(nt.TypeInfoValue||(nt.TypeInfoValue={}))})(j.fbs||(j.fbs={}))})(_.experimental||(_.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(_){(function(j){(function(nt){class et{constructor(){this.bb=null,this.bb_pos=0}__init(a,o){return this.bb_pos=a,this.bb=o,this}static getRootAsShape(a,o){return(o||new et).__init(a.readInt32(a.position())+a.position(),a)}static getSizePrefixedRootAsShape(a,o){return a.setPosition(a.position()+c.flatbuffers.SIZE_PREFIX_LENGTH),(o||new et).__init(a.readInt32(a.position())+a.position(),a)}dim(a,o){let d=this.bb.__offset(this.bb_pos,4);return d?(o||new _.experimental.fbs.Dimension).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+d)+4*a),this.bb):null}dimLength(){let a=this.bb.__offset(this.bb_pos,4);return a?this.bb.__vector_len(this.bb_pos+a):0}static startShape(a){a.startObject(1)}static addDim(a,o){a.addFieldOffset(0,o,0)}static createDimVector(a,o){a.startVector(4,o.length,4);for(let d=o.length-1;d>=0;d--)a.addOffset(o[d]);return a.endVector()}static startDimVector(a,o){a.startVector(4,o,4)}static endShape(a){return a.endObject()}static createShape(a,o){return et.startShape(a),et.addDim(a,o),et.endShape(a)}}nt.Shape=et})(j.fbs||(j.fbs={}))})(_.experimental||(_.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(_){(function(j){(function(nt){class et{constructor(){this.bb=null,this.bb_pos=0}__init(a,o){return this.bb_pos=a,this.bb=o,this}static getRootAsDimension(a,o){return(o||new et).__init(a.readInt32(a.position())+a.position(),a)}static getSizePrefixedRootAsDimension(a,o){return a.setPosition(a.position()+c.flatbuffers.SIZE_PREFIX_LENGTH),(o||new et).__init(a.readInt32(a.position())+a.position(),a)}value(a){let o=this.bb.__offset(this.bb_pos,4);return o?(a||new _.experimental.fbs.DimensionValue).__init(this.bb.__indirect(this.bb_pos+o),this.bb):null}denotation(a){let o=this.bb.__offset(this.bb_pos,6);return o?this.bb.__string(this.bb_pos+o,a):null}static startDimension(a){a.startObject(2)}static addValue(a,o){a.addFieldOffset(0,o,0)}static addDenotation(a,o){a.addFieldOffset(1,o,0)}static endDimension(a){return a.endObject()}static createDimension(a,o,d){return et.startDimension(a),et.addValue(a,o),et.addDenotation(a,d),et.endDimension(a)}}nt.Dimension=et})(j.fbs||(j.fbs={}))})(_.experimental||(_.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(_){(function(j){(function(nt){class et{constructor(){this.bb=null,this.bb_pos=0}__init(a,o){return this.bb_pos=a,this.bb=o,this}static getRootAsDimensionValue(a,o){return(o||new et).__init(a.readInt32(a.position())+a.position(),a)}static getSizePrefixedRootAsDimensionValue(a,o){return a.setPosition(a.position()+c.flatbuffers.SIZE_PREFIX_LENGTH),(o||new et).__init(a.readInt32(a.position())+a.position(),a)}dimType(){let a=this.bb.__offset(this.bb_pos,4);return a?this.bb.readInt8(this.bb_pos+a):_.experimental.fbs.DimensionValueType.UNKNOWN}dimValue(){let a=this.bb.__offset(this.bb_pos,6);return a?this.bb.readInt64(this.bb_pos+a):this.bb.createLong(0,0)}dimParam(a){let o=this.bb.__offset(this.bb_pos,8);return o?this.bb.__string(this.bb_pos+o,a):null}static startDimensionValue(a){a.startObject(3)}static addDimType(a,o){a.addFieldInt8(0,o,_.experimental.fbs.DimensionValueType.UNKNOWN)}static addDimValue(a,o){a.addFieldInt64(1,o,a.createLong(0,0))}static addDimParam(a,o){a.addFieldOffset(2,o,0)}static endDimensionValue(a){return a.endObject()}static createDimensionValue(a,o,d,g){return et.startDimensionValue(a),et.addDimType(a,o),et.addDimValue(a,d),et.addDimParam(a,g),et.endDimensionValue(a)}}nt.DimensionValue=et})(j.fbs||(j.fbs={}))})(_.experimental||(_.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(_){(function(j){(function(nt){class et{constructor(){this.bb=null,this.bb_pos=0}__init(a,o){return this.bb_pos=a,this.bb=o,this}static getRootAsTensorTypeAndShape(a,o){return(o||new et).__init(a.readInt32(a.position())+a.position(),a)}static getSizePrefixedRootAsTensorTypeAndShape(a,o){return a.setPosition(a.position()+c.flatbuffers.SIZE_PREFIX_LENGTH),(o||new et).__init(a.readInt32(a.position())+a.position(),a)}elemType(){let a=this.bb.__offset(this.bb_pos,4);return a?this.bb.readInt32(this.bb_pos+a):_.experimental.fbs.TensorDataType.UNDEFINED}shape(a){let o=this.bb.__offset(this.bb_pos,6);return o?(a||new _.experimental.fbs.Shape).__init(this.bb.__indirect(this.bb_pos+o),this.bb):null}static startTensorTypeAndShape(a){a.startObject(2)}static addElemType(a,o){a.addFieldInt32(0,o,_.experimental.fbs.TensorDataType.UNDEFINED)}static addShape(a,o){a.addFieldOffset(1,o,0)}static endTensorTypeAndShape(a){return a.endObject()}static createTensorTypeAndShape(a,o,d){return et.startTensorTypeAndShape(a),et.addElemType(a,o),et.addShape(a,d),et.endTensorTypeAndShape(a)}}nt.TensorTypeAndShape=et})(j.fbs||(j.fbs={}))})(_.experimental||(_.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(_){(function(j){(function(nt){class et{constructor(){this.bb=null,this.bb_pos=0}__init(a,o){return this.bb_pos=a,this.bb=o,this}static getRootAsMapType(a,o){return(o||new et).__init(a.readInt32(a.position())+a.position(),a)}static getSizePrefixedRootAsMapType(a,o){return a.setPosition(a.position()+c.flatbuffers.SIZE_PREFIX_LENGTH),(o||new et).__init(a.readInt32(a.position())+a.position(),a)}keyType(){let a=this.bb.__offset(this.bb_pos,4);return a?this.bb.readInt32(this.bb_pos+a):_.experimental.fbs.TensorDataType.UNDEFINED}valueType(a){let o=this.bb.__offset(this.bb_pos,6);return o?(a||new _.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+o),this.bb):null}static startMapType(a){a.startObject(2)}static addKeyType(a,o){a.addFieldInt32(0,o,_.experimental.fbs.TensorDataType.UNDEFINED)}static addValueType(a,o){a.addFieldOffset(1,o,0)}static endMapType(a){return a.endObject()}static createMapType(a,o,d){return et.startMapType(a),et.addKeyType(a,o),et.addValueType(a,d),et.endMapType(a)}}nt.MapType=et})(j.fbs||(j.fbs={}))})(_.experimental||(_.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(_){(function(j){(function(nt){class et{constructor(){this.bb=null,this.bb_pos=0}__init(a,o){return this.bb_pos=a,this.bb=o,this}static getRootAsSequenceType(a,o){return(o||new et).__init(a.readInt32(a.position())+a.position(),a)}static getSizePrefixedRootAsSequenceType(a,o){return a.setPosition(a.position()+c.flatbuffers.SIZE_PREFIX_LENGTH),(o||new et).__init(a.readInt32(a.position())+a.position(),a)}elemType(a){let o=this.bb.__offset(this.bb_pos,4);return o?(a||new _.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+o),this.bb):null}static startSequenceType(a){a.startObject(1)}static addElemType(a,o){a.addFieldOffset(0,o,0)}static endSequenceType(a){return a.endObject()}static createSequenceType(a,o){return et.startSequenceType(a),et.addElemType(a,o),et.endSequenceType(a)}}nt.SequenceType=et})(j.fbs||(j.fbs={}))})(_.experimental||(_.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(_){(function(j){(j.fbs||(j.fbs={})).EdgeEnd=class{constructor(){this.bb=null,this.bb_pos=0}__init(nt,et){return this.bb_pos=nt,this.bb=et,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(nt,et,b,a){return nt.prep(4,12),nt.writeInt32(a),nt.writeInt32(b),nt.writeInt32(et),nt.offset()}}})(_.experimental||(_.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(_){(function(j){(function(nt){class et{constructor(){this.bb=null,this.bb_pos=0}__init(a,o){return this.bb_pos=a,this.bb=o,this}static getRootAsNodeEdge(a,o){return(o||new et).__init(a.readInt32(a.position())+a.position(),a)}static getSizePrefixedRootAsNodeEdge(a,o){return a.setPosition(a.position()+c.flatbuffers.SIZE_PREFIX_LENGTH),(o||new et).__init(a.readInt32(a.position())+a.position(),a)}nodeIndex(){let a=this.bb.__offset(this.bb_pos,4);return a?this.bb.readUint32(this.bb_pos+a):0}inputEdges(a,o){let d=this.bb.__offset(this.bb_pos,6);return d?(o||new _.experimental.fbs.EdgeEnd).__init(this.bb.__vector(this.bb_pos+d)+12*a,this.bb):null}inputEdgesLength(){let a=this.bb.__offset(this.bb_pos,6);return a?this.bb.__vector_len(this.bb_pos+a):0}outputEdges(a,o){let d=this.bb.__offset(this.bb_pos,8);return d?(o||new _.experimental.fbs.EdgeEnd).__init(this.bb.__vector(this.bb_pos+d)+12*a,this.bb):null}outputEdgesLength(){let a=this.bb.__offset(this.bb_pos,8);return a?this.bb.__vector_len(this.bb_pos+a):0}static startNodeEdge(a){a.startObject(3)}static addNodeIndex(a,o){a.addFieldInt32(0,o,0)}static addInputEdges(a,o){a.addFieldOffset(1,o,0)}static startInputEdgesVector(a,o){a.startVector(12,o,4)}static addOutputEdges(a,o){a.addFieldOffset(2,o,0)}static startOutputEdgesVector(a,o){a.startVector(12,o,4)}static endNodeEdge(a){return a.endObject()}static createNodeEdge(a,o,d,g){return et.startNodeEdge(a),et.addNodeIndex(a,o),et.addInputEdges(a,d),et.addOutputEdges(a,g),et.endNodeEdge(a)}}nt.NodeEdge=et})(j.fbs||(j.fbs={}))})(_.experimental||(_.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(_){(function(j){(function(nt){class et{constructor(){this.bb=null,this.bb_pos=0}__init(a,o){return this.bb_pos=a,this.bb=o,this}static getRootAsNode(a,o){return(o||new et).__init(a.readInt32(a.position())+a.position(),a)}static getSizePrefixedRootAsNode(a,o){return a.setPosition(a.position()+c.flatbuffers.SIZE_PREFIX_LENGTH),(o||new et).__init(a.readInt32(a.position())+a.position(),a)}name(a){let o=this.bb.__offset(this.bb_pos,4);return o?this.bb.__string(this.bb_pos+o,a):null}docString(a){let o=this.bb.__offset(this.bb_pos,6);return o?this.bb.__string(this.bb_pos+o,a):null}domain(a){let o=this.bb.__offset(this.bb_pos,8);return o?this.bb.__string(this.bb_pos+o,a):null}sinceVersion(){let a=this.bb.__offset(this.bb_pos,10);return a?this.bb.readInt32(this.bb_pos+a):0}index(){let a=this.bb.__offset(this.bb_pos,12);return a?this.bb.readUint32(this.bb_pos+a):0}opType(a){let o=this.bb.__offset(this.bb_pos,14);return o?this.bb.__string(this.bb_pos+o,a):null}type(){let a=this.bb.__offset(this.bb_pos,16);return a?this.bb.readInt32(this.bb_pos+a):_.experimental.fbs.NodeType.Primitive}executionProviderType(a){let o=this.bb.__offset(this.bb_pos,18);return o?this.bb.__string(this.bb_pos+o,a):null}inputs(a,o){let d=this.bb.__offset(this.bb_pos,20);return d?this.bb.__string(this.bb.__vector(this.bb_pos+d)+4*a,o):null}inputsLength(){let a=this.bb.__offset(this.bb_pos,20);return a?this.bb.__vector_len(this.bb_pos+a):0}outputs(a,o){let d=this.bb.__offset(this.bb_pos,22);return d?this.bb.__string(this.bb.__vector(this.bb_pos+d)+4*a,o):null}outputsLength(){let a=this.bb.__offset(this.bb_pos,22);return a?this.bb.__vector_len(this.bb_pos+a):0}attributes(a,o){let d=this.bb.__offset(this.bb_pos,24);return d?(o||new _.experimental.fbs.Attribute).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+d)+4*a),this.bb):null}attributesLength(){let a=this.bb.__offset(this.bb_pos,24);return a?this.bb.__vector_len(this.bb_pos+a):0}inputArgCounts(a){let o=this.bb.__offset(this.bb_pos,26);return o?this.bb.readInt32(this.bb.__vector(this.bb_pos+o)+4*a):0}inputArgCountsLength(){let a=this.bb.__offset(this.bb_pos,26);return a?this.bb.__vector_len(this.bb_pos+a):0}inputArgCountsArray(){let a=this.bb.__offset(this.bb_pos,26);return a?new Int32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+a),this.bb.__vector_len(this.bb_pos+a)):null}implicitInputs(a,o){let d=this.bb.__offset(this.bb_pos,28);return d?this.bb.__string(this.bb.__vector(this.bb_pos+d)+4*a,o):null}implicitInputsLength(){let a=this.bb.__offset(this.bb_pos,28);return a?this.bb.__vector_len(this.bb_pos+a):0}static startNode(a){a.startObject(13)}static addName(a,o){a.addFieldOffset(0,o,0)}static addDocString(a,o){a.addFieldOffset(1,o,0)}static addDomain(a,o){a.addFieldOffset(2,o,0)}static addSinceVersion(a,o){a.addFieldInt32(3,o,0)}static addIndex(a,o){a.addFieldInt32(4,o,0)}static addOpType(a,o){a.addFieldOffset(5,o,0)}static addType(a,o){a.addFieldInt32(6,o,_.experimental.fbs.NodeType.Primitive)}static addExecutionProviderType(a,o){a.addFieldOffset(7,o,0)}static addInputs(a,o){a.addFieldOffset(8,o,0)}static createInputsVector(a,o){a.startVector(4,o.length,4);for(let d=o.length-1;d>=0;d--)a.addOffset(o[d]);return a.endVector()}static startInputsVector(a,o){a.startVector(4,o,4)}static addOutputs(a,o){a.addFieldOffset(9,o,0)}static createOutputsVector(a,o){a.startVector(4,o.length,4);for(let d=o.length-1;d>=0;d--)a.addOffset(o[d]);return a.endVector()}static startOutputsVector(a,o){a.startVector(4,o,4)}static addAttributes(a,o){a.addFieldOffset(10,o,0)}static createAttributesVector(a,o){a.startVector(4,o.length,4);for(let d=o.length-1;d>=0;d--)a.addOffset(o[d]);return a.endVector()}static startAttributesVector(a,o){a.startVector(4,o,4)}static addInputArgCounts(a,o){a.addFieldOffset(11,o,0)}static createInputArgCountsVector(a,o){a.startVector(4,o.length,4);for(let d=o.length-1;d>=0;d--)a.addInt32(o[d]);return a.endVector()}static startInputArgCountsVector(a,o){a.startVector(4,o,4)}static addImplicitInputs(a,o){a.addFieldOffset(12,o,0)}static createImplicitInputsVector(a,o){a.startVector(4,o.length,4);for(let d=o.length-1;d>=0;d--)a.addOffset(o[d]);return a.endVector()}static startImplicitInputsVector(a,o){a.startVector(4,o,4)}static endNode(a){return a.endObject()}static createNode(a,o,d,g,rt,st,tt,ot,it,at,ut,lt,ct,ft){return et.startNode(a),et.addName(a,o),et.addDocString(a,d),et.addDomain(a,g),et.addSinceVersion(a,rt),et.addIndex(a,st),et.addOpType(a,tt),et.addType(a,ot),et.addExecutionProviderType(a,it),et.addInputs(a,at),et.addOutputs(a,ut),et.addAttributes(a,lt),et.addInputArgCounts(a,ct),et.addImplicitInputs(a,ft),et.endNode(a)}}nt.Node=et})(j.fbs||(j.fbs={}))})(_.experimental||(_.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(_){(function(j){(function(nt){class et{constructor(){this.bb=null,this.bb_pos=0}__init(a,o){return this.bb_pos=a,this.bb=o,this}static getRootAsValueInfo(a,o){return(o||new et).__init(a.readInt32(a.position())+a.position(),a)}static getSizePrefixedRootAsValueInfo(a,o){return a.setPosition(a.position()+c.flatbuffers.SIZE_PREFIX_LENGTH),(o||new et).__init(a.readInt32(a.position())+a.position(),a)}name(a){let o=this.bb.__offset(this.bb_pos,4);return o?this.bb.__string(this.bb_pos+o,a):null}docString(a){let o=this.bb.__offset(this.bb_pos,6);return o?this.bb.__string(this.bb_pos+o,a):null}type(a){let o=this.bb.__offset(this.bb_pos,8);return o?(a||new _.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+o),this.bb):null}static startValueInfo(a){a.startObject(3)}static addName(a,o){a.addFieldOffset(0,o,0)}static addDocString(a,o){a.addFieldOffset(1,o,0)}static addType(a,o){a.addFieldOffset(2,o,0)}static endValueInfo(a){return a.endObject()}static createValueInfo(a,o,d,g){return et.startValueInfo(a),et.addName(a,o),et.addDocString(a,d),et.addType(a,g),et.endValueInfo(a)}}nt.ValueInfo=et})(j.fbs||(j.fbs={}))})(_.experimental||(_.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(_){(function(j){(function(nt){class et{constructor(){this.bb=null,this.bb_pos=0}__init(a,o){return this.bb_pos=a,this.bb=o,this}static getRootAsTypeInfo(a,o){return(o||new et).__init(a.readInt32(a.position())+a.position(),a)}static getSizePrefixedRootAsTypeInfo(a,o){return a.setPosition(a.position()+c.flatbuffers.SIZE_PREFIX_LENGTH),(o||new et).__init(a.readInt32(a.position())+a.position(),a)}denotation(a){let o=this.bb.__offset(this.bb_pos,4);return o?this.bb.__string(this.bb_pos+o,a):null}valueType(){let a=this.bb.__offset(this.bb_pos,6);return a?this.bb.readUint8(this.bb_pos+a):_.experimental.fbs.TypeInfoValue.NONE}value(a){let o=this.bb.__offset(this.bb_pos,8);return o?this.bb.__union(a,this.bb_pos+o):null}static startTypeInfo(a){a.startObject(3)}static addDenotation(a,o){a.addFieldOffset(0,o,0)}static addValueType(a,o){a.addFieldInt8(1,o,_.experimental.fbs.TypeInfoValue.NONE)}static addValue(a,o){a.addFieldOffset(2,o,0)}static endTypeInfo(a){return a.endObject()}static createTypeInfo(a,o,d,g){return et.startTypeInfo(a),et.addDenotation(a,o),et.addValueType(a,d),et.addValue(a,g),et.endTypeInfo(a)}}nt.TypeInfo=et})(j.fbs||(j.fbs={}))})(_.experimental||(_.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(_){(function(j){(function(nt){class et{constructor(){this.bb=null,this.bb_pos=0}__init(a,o){return this.bb_pos=a,this.bb=o,this}static getRootAsOperatorSetId(a,o){return(o||new et).__init(a.readInt32(a.position())+a.position(),a)}static getSizePrefixedRootAsOperatorSetId(a,o){return a.setPosition(a.position()+c.flatbuffers.SIZE_PREFIX_LENGTH),(o||new et).__init(a.readInt32(a.position())+a.position(),a)}domain(a){let o=this.bb.__offset(this.bb_pos,4);return o?this.bb.__string(this.bb_pos+o,a):null}version(){let a=this.bb.__offset(this.bb_pos,6);return a?this.bb.readInt64(this.bb_pos+a):this.bb.createLong(0,0)}static startOperatorSetId(a){a.startObject(2)}static addDomain(a,o){a.addFieldOffset(0,o,0)}static addVersion(a,o){a.addFieldInt64(1,o,a.createLong(0,0))}static endOperatorSetId(a){return a.endObject()}static createOperatorSetId(a,o,d){return et.startOperatorSetId(a),et.addDomain(a,o),et.addVersion(a,d),et.endOperatorSetId(a)}}nt.OperatorSetId=et})(j.fbs||(j.fbs={}))})(_.experimental||(_.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(_){(function(j){(function(nt){class et{constructor(){this.bb=null,this.bb_pos=0}__init(a,o){return this.bb_pos=a,this.bb=o,this}static getRootAsTensor(a,o){return(o||new et).__init(a.readInt32(a.position())+a.position(),a)}static getSizePrefixedRootAsTensor(a,o){return a.setPosition(a.position()+c.flatbuffers.SIZE_PREFIX_LENGTH),(o||new et).__init(a.readInt32(a.position())+a.position(),a)}name(a){let o=this.bb.__offset(this.bb_pos,4);return o?this.bb.__string(this.bb_pos+o,a):null}docString(a){let o=this.bb.__offset(this.bb_pos,6);return o?this.bb.__string(this.bb_pos+o,a):null}dims(a){let o=this.bb.__offset(this.bb_pos,8);return o?this.bb.readInt64(this.bb.__vector(this.bb_pos+o)+8*a):this.bb.createLong(0,0)}dimsLength(){let a=this.bb.__offset(this.bb_pos,8);return a?this.bb.__vector_len(this.bb_pos+a):0}dataType(){let a=this.bb.__offset(this.bb_pos,10);return a?this.bb.readInt32(this.bb_pos+a):_.experimental.fbs.TensorDataType.UNDEFINED}rawData(a){let o=this.bb.__offset(this.bb_pos,12);return o?this.bb.readUint8(this.bb.__vector(this.bb_pos+o)+a):0}rawDataLength(){let a=this.bb.__offset(this.bb_pos,12);return a?this.bb.__vector_len(this.bb_pos+a):0}rawDataArray(){let a=this.bb.__offset(this.bb_pos,12);return a?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+a),this.bb.__vector_len(this.bb_pos+a)):null}stringData(a,o){let d=this.bb.__offset(this.bb_pos,14);return d?this.bb.__string(this.bb.__vector(this.bb_pos+d)+4*a,o):null}stringDataLength(){let a=this.bb.__offset(this.bb_pos,14);return a?this.bb.__vector_len(this.bb_pos+a):0}static startTensor(a){a.startObject(6)}static addName(a,o){a.addFieldOffset(0,o,0)}static addDocString(a,o){a.addFieldOffset(1,o,0)}static addDims(a,o){a.addFieldOffset(2,o,0)}static createDimsVector(a,o){a.startVector(8,o.length,8);for(let d=o.length-1;d>=0;d--)a.addInt64(o[d]);return a.endVector()}static startDimsVector(a,o){a.startVector(8,o,8)}static addDataType(a,o){a.addFieldInt32(3,o,_.experimental.fbs.TensorDataType.UNDEFINED)}static addRawData(a,o){a.addFieldOffset(4,o,0)}static createRawDataVector(a,o){a.startVector(1,o.length,1);for(let d=o.length-1;d>=0;d--)a.addInt8(o[d]);return a.endVector()}static startRawDataVector(a,o){a.startVector(1,o,1)}static addStringData(a,o){a.addFieldOffset(5,o,0)}static createStringDataVector(a,o){a.startVector(4,o.length,4);for(let d=o.length-1;d>=0;d--)a.addOffset(o[d]);return a.endVector()}static startStringDataVector(a,o){a.startVector(4,o,4)}static endTensor(a){return a.endObject()}static createTensor(a,o,d,g,rt,st,tt){return et.startTensor(a),et.addName(a,o),et.addDocString(a,d),et.addDims(a,g),et.addDataType(a,rt),et.addRawData(a,st),et.addStringData(a,tt),et.endTensor(a)}}nt.Tensor=et})(j.fbs||(j.fbs={}))})(_.experimental||(_.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(_){(function(j){(function(nt){class et{constructor(){this.bb=null,this.bb_pos=0}__init(a,o){return this.bb_pos=a,this.bb=o,this}static getRootAsSparseTensor(a,o){return(o||new et).__init(a.readInt32(a.position())+a.position(),a)}static getSizePrefixedRootAsSparseTensor(a,o){return a.setPosition(a.position()+c.flatbuffers.SIZE_PREFIX_LENGTH),(o||new et).__init(a.readInt32(a.position())+a.position(),a)}values(a){let o=this.bb.__offset(this.bb_pos,4);return o?(a||new _.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+o),this.bb):null}indices(a){let o=this.bb.__offset(this.bb_pos,6);return o?(a||new _.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+o),this.bb):null}dims(a){let o=this.bb.__offset(this.bb_pos,8);return o?this.bb.readInt64(this.bb.__vector(this.bb_pos+o)+8*a):this.bb.createLong(0,0)}dimsLength(){let a=this.bb.__offset(this.bb_pos,8);return a?this.bb.__vector_len(this.bb_pos+a):0}static startSparseTensor(a){a.startObject(3)}static addValues(a,o){a.addFieldOffset(0,o,0)}static addIndices(a,o){a.addFieldOffset(1,o,0)}static addDims(a,o){a.addFieldOffset(2,o,0)}static createDimsVector(a,o){a.startVector(8,o.length,8);for(let d=o.length-1;d>=0;d--)a.addInt64(o[d]);return a.endVector()}static startDimsVector(a,o){a.startVector(8,o,8)}static endSparseTensor(a){return a.endObject()}static createSparseTensor(a,o,d,g){return et.startSparseTensor(a),et.addValues(a,o),et.addIndices(a,d),et.addDims(a,g),et.endSparseTensor(a)}}nt.SparseTensor=et})(j.fbs||(j.fbs={}))})(_.experimental||(_.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(_){(function(j){(function(nt){class et{constructor(){this.bb=null,this.bb_pos=0}__init(a,o){return this.bb_pos=a,this.bb=o,this}static getRootAsAttribute(a,o){return(o||new et).__init(a.readInt32(a.position())+a.position(),a)}static getSizePrefixedRootAsAttribute(a,o){return a.setPosition(a.position()+c.flatbuffers.SIZE_PREFIX_LENGTH),(o||new et).__init(a.readInt32(a.position())+a.position(),a)}name(a){let o=this.bb.__offset(this.bb_pos,4);return o?this.bb.__string(this.bb_pos+o,a):null}docString(a){let o=this.bb.__offset(this.bb_pos,6);return o?this.bb.__string(this.bb_pos+o,a):null}type(){let a=this.bb.__offset(this.bb_pos,8);return a?this.bb.readInt32(this.bb_pos+a):_.experimental.fbs.AttributeType.UNDEFINED}f(){let a=this.bb.__offset(this.bb_pos,10);return a?this.bb.readFloat32(this.bb_pos+a):0}i(){let a=this.bb.__offset(this.bb_pos,12);return a?this.bb.readInt64(this.bb_pos+a):this.bb.createLong(0,0)}s(a){let o=this.bb.__offset(this.bb_pos,14);return o?this.bb.__string(this.bb_pos+o,a):null}t(a){let o=this.bb.__offset(this.bb_pos,16);return o?(a||new _.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+o),this.bb):null}g(a){let o=this.bb.__offset(this.bb_pos,18);return o?(a||new _.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb_pos+o),this.bb):null}floats(a){let o=this.bb.__offset(this.bb_pos,20);return o?this.bb.readFloat32(this.bb.__vector(this.bb_pos+o)+4*a):0}floatsLength(){let a=this.bb.__offset(this.bb_pos,20);return a?this.bb.__vector_len(this.bb_pos+a):0}floatsArray(){let a=this.bb.__offset(this.bb_pos,20);return a?new Float32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+a),this.bb.__vector_len(this.bb_pos+a)):null}ints(a){let o=this.bb.__offset(this.bb_pos,22);return o?this.bb.readInt64(this.bb.__vector(this.bb_pos+o)+8*a):this.bb.createLong(0,0)}intsLength(){let a=this.bb.__offset(this.bb_pos,22);return a?this.bb.__vector_len(this.bb_pos+a):0}strings(a,o){let d=this.bb.__offset(this.bb_pos,24);return d?this.bb.__string(this.bb.__vector(this.bb_pos+d)+4*a,o):null}stringsLength(){let a=this.bb.__offset(this.bb_pos,24);return a?this.bb.__vector_len(this.bb_pos+a):0}tensors(a,o){let d=this.bb.__offset(this.bb_pos,26);return d?(o||new _.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+d)+4*a),this.bb):null}tensorsLength(){let a=this.bb.__offset(this.bb_pos,26);return a?this.bb.__vector_len(this.bb_pos+a):0}graphs(a,o){let d=this.bb.__offset(this.bb_pos,28);return d?(o||new _.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+d)+4*a),this.bb):null}graphsLength(){let a=this.bb.__offset(this.bb_pos,28);return a?this.bb.__vector_len(this.bb_pos+a):0}static startAttribute(a){a.startObject(13)}static addName(a,o){a.addFieldOffset(0,o,0)}static addDocString(a,o){a.addFieldOffset(1,o,0)}static addType(a,o){a.addFieldInt32(2,o,_.experimental.fbs.AttributeType.UNDEFINED)}static addF(a,o){a.addFieldFloat32(3,o,0)}static addI(a,o){a.addFieldInt64(4,o,a.createLong(0,0))}static addS(a,o){a.addFieldOffset(5,o,0)}static addT(a,o){a.addFieldOffset(6,o,0)}static addG(a,o){a.addFieldOffset(7,o,0)}static addFloats(a,o){a.addFieldOffset(8,o,0)}static createFloatsVector(a,o){a.startVector(4,o.length,4);for(let d=o.length-1;d>=0;d--)a.addFloat32(o[d]);return a.endVector()}static startFloatsVector(a,o){a.startVector(4,o,4)}static addInts(a,o){a.addFieldOffset(9,o,0)}static createIntsVector(a,o){a.startVector(8,o.length,8);for(let d=o.length-1;d>=0;d--)a.addInt64(o[d]);return a.endVector()}static startIntsVector(a,o){a.startVector(8,o,8)}static addStrings(a,o){a.addFieldOffset(10,o,0)}static createStringsVector(a,o){a.startVector(4,o.length,4);for(let d=o.length-1;d>=0;d--)a.addOffset(o[d]);return a.endVector()}static startStringsVector(a,o){a.startVector(4,o,4)}static addTensors(a,o){a.addFieldOffset(11,o,0)}static createTensorsVector(a,o){a.startVector(4,o.length,4);for(let d=o.length-1;d>=0;d--)a.addOffset(o[d]);return a.endVector()}static startTensorsVector(a,o){a.startVector(4,o,4)}static addGraphs(a,o){a.addFieldOffset(12,o,0)}static createGraphsVector(a,o){a.startVector(4,o.length,4);for(let d=o.length-1;d>=0;d--)a.addOffset(o[d]);return a.endVector()}static startGraphsVector(a,o){a.startVector(4,o,4)}static endAttribute(a){return a.endObject()}static createAttribute(a,o,d,g,rt,st,tt,ot,it,at,ut,lt,ct,ft){return et.startAttribute(a),et.addName(a,o),et.addDocString(a,d),et.addType(a,g),et.addF(a,rt),et.addI(a,st),et.addS(a,tt),et.addT(a,ot),et.addG(a,it),et.addFloats(a,at),et.addInts(a,ut),et.addStrings(a,lt),et.addTensors(a,ct),et.addGraphs(a,ft),et.endAttribute(a)}}nt.Attribute=et})(j.fbs||(j.fbs={}))})(_.experimental||(_.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(_){(function(j){(function(nt){class et{constructor(){this.bb=null,this.bb_pos=0}__init(a,o){return this.bb_pos=a,this.bb=o,this}static getRootAsGraph(a,o){return(o||new et).__init(a.readInt32(a.position())+a.position(),a)}static getSizePrefixedRootAsGraph(a,o){return a.setPosition(a.position()+c.flatbuffers.SIZE_PREFIX_LENGTH),(o||new et).__init(a.readInt32(a.position())+a.position(),a)}initializers(a,o){let d=this.bb.__offset(this.bb_pos,4);return d?(o||new _.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+d)+4*a),this.bb):null}initializersLength(){let a=this.bb.__offset(this.bb_pos,4);return a?this.bb.__vector_len(this.bb_pos+a):0}nodeArgs(a,o){let d=this.bb.__offset(this.bb_pos,6);return d?(o||new _.experimental.fbs.ValueInfo).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+d)+4*a),this.bb):null}nodeArgsLength(){let a=this.bb.__offset(this.bb_pos,6);return a?this.bb.__vector_len(this.bb_pos+a):0}nodes(a,o){let d=this.bb.__offset(this.bb_pos,8);return d?(o||new _.experimental.fbs.Node).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+d)+4*a),this.bb):null}nodesLength(){let a=this.bb.__offset(this.bb_pos,8);return a?this.bb.__vector_len(this.bb_pos+a):0}maxNodeIndex(){let a=this.bb.__offset(this.bb_pos,10);return a?this.bb.readUint32(this.bb_pos+a):0}nodeEdges(a,o){let d=this.bb.__offset(this.bb_pos,12);return d?(o||new _.experimental.fbs.NodeEdge).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+d)+4*a),this.bb):null}nodeEdgesLength(){let a=this.bb.__offset(this.bb_pos,12);return a?this.bb.__vector_len(this.bb_pos+a):0}inputs(a,o){let d=this.bb.__offset(this.bb_pos,14);return d?this.bb.__string(this.bb.__vector(this.bb_pos+d)+4*a,o):null}inputsLength(){let a=this.bb.__offset(this.bb_pos,14);return a?this.bb.__vector_len(this.bb_pos+a):0}outputs(a,o){let d=this.bb.__offset(this.bb_pos,16);return d?this.bb.__string(this.bb.__vector(this.bb_pos+d)+4*a,o):null}outputsLength(){let a=this.bb.__offset(this.bb_pos,16);return a?this.bb.__vector_len(this.bb_pos+a):0}sparseInitializers(a,o){let d=this.bb.__offset(this.bb_pos,18);return d?(o||new _.experimental.fbs.SparseTensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+d)+4*a),this.bb):null}sparseInitializersLength(){let a=this.bb.__offset(this.bb_pos,18);return a?this.bb.__vector_len(this.bb_pos+a):0}static startGraph(a){a.startObject(8)}static addInitializers(a,o){a.addFieldOffset(0,o,0)}static createInitializersVector(a,o){a.startVector(4,o.length,4);for(let d=o.length-1;d>=0;d--)a.addOffset(o[d]);return a.endVector()}static startInitializersVector(a,o){a.startVector(4,o,4)}static addNodeArgs(a,o){a.addFieldOffset(1,o,0)}static createNodeArgsVector(a,o){a.startVector(4,o.length,4);for(let d=o.length-1;d>=0;d--)a.addOffset(o[d]);return a.endVector()}static startNodeArgsVector(a,o){a.startVector(4,o,4)}static addNodes(a,o){a.addFieldOffset(2,o,0)}static createNodesVector(a,o){a.startVector(4,o.length,4);for(let d=o.length-1;d>=0;d--)a.addOffset(o[d]);return a.endVector()}static startNodesVector(a,o){a.startVector(4,o,4)}static addMaxNodeIndex(a,o){a.addFieldInt32(3,o,0)}static addNodeEdges(a,o){a.addFieldOffset(4,o,0)}static createNodeEdgesVector(a,o){a.startVector(4,o.length,4);for(let d=o.length-1;d>=0;d--)a.addOffset(o[d]);return a.endVector()}static startNodeEdgesVector(a,o){a.startVector(4,o,4)}static addInputs(a,o){a.addFieldOffset(5,o,0)}static createInputsVector(a,o){a.startVector(4,o.length,4);for(let d=o.length-1;d>=0;d--)a.addOffset(o[d]);return a.endVector()}static startInputsVector(a,o){a.startVector(4,o,4)}static addOutputs(a,o){a.addFieldOffset(6,o,0)}static createOutputsVector(a,o){a.startVector(4,o.length,4);for(let d=o.length-1;d>=0;d--)a.addOffset(o[d]);return a.endVector()}static startOutputsVector(a,o){a.startVector(4,o,4)}static addSparseInitializers(a,o){a.addFieldOffset(7,o,0)}static createSparseInitializersVector(a,o){a.startVector(4,o.length,4);for(let d=o.length-1;d>=0;d--)a.addOffset(o[d]);return a.endVector()}static startSparseInitializersVector(a,o){a.startVector(4,o,4)}static endGraph(a){return a.endObject()}static createGraph(a,o,d,g,rt,st,tt,ot,it){return et.startGraph(a),et.addInitializers(a,o),et.addNodeArgs(a,d),et.addNodes(a,g),et.addMaxNodeIndex(a,rt),et.addNodeEdges(a,st),et.addInputs(a,tt),et.addOutputs(a,ot),et.addSparseInitializers(a,it),et.endGraph(a)}}nt.Graph=et})(j.fbs||(j.fbs={}))})(_.experimental||(_.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(_){(function(j){(function(nt){class et{constructor(){this.bb=null,this.bb_pos=0}__init(a,o){return this.bb_pos=a,this.bb=o,this}static getRootAsModel(a,o){return(o||new et).__init(a.readInt32(a.position())+a.position(),a)}static getSizePrefixedRootAsModel(a,o){return a.setPosition(a.position()+c.flatbuffers.SIZE_PREFIX_LENGTH),(o||new et).__init(a.readInt32(a.position())+a.position(),a)}irVersion(){let a=this.bb.__offset(this.bb_pos,4);return a?this.bb.readInt64(this.bb_pos+a):this.bb.createLong(0,0)}opsetImport(a,o){let d=this.bb.__offset(this.bb_pos,6);return d?(o||new _.experimental.fbs.OperatorSetId).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+d)+4*a),this.bb):null}opsetImportLength(){let a=this.bb.__offset(this.bb_pos,6);return a?this.bb.__vector_len(this.bb_pos+a):0}producerName(a){let o=this.bb.__offset(this.bb_pos,8);return o?this.bb.__string(this.bb_pos+o,a):null}producerVersion(a){let o=this.bb.__offset(this.bb_pos,10);return o?this.bb.__string(this.bb_pos+o,a):null}domain(a){let o=this.bb.__offset(this.bb_pos,12);return o?this.bb.__string(this.bb_pos+o,a):null}modelVersion(){let a=this.bb.__offset(this.bb_pos,14);return a?this.bb.readInt64(this.bb_pos+a):this.bb.createLong(0,0)}docString(a){let o=this.bb.__offset(this.bb_pos,16);return o?this.bb.__string(this.bb_pos+o,a):null}graph(a){let o=this.bb.__offset(this.bb_pos,18);return o?(a||new _.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb_pos+o),this.bb):null}graphDocString(a){let o=this.bb.__offset(this.bb_pos,20);return o?this.bb.__string(this.bb_pos+o,a):null}static startModel(a){a.startObject(9)}static addIrVersion(a,o){a.addFieldInt64(0,o,a.createLong(0,0))}static addOpsetImport(a,o){a.addFieldOffset(1,o,0)}static createOpsetImportVector(a,o){a.startVector(4,o.length,4);for(let d=o.length-1;d>=0;d--)a.addOffset(o[d]);return a.endVector()}static startOpsetImportVector(a,o){a.startVector(4,o,4)}static addProducerName(a,o){a.addFieldOffset(2,o,0)}static addProducerVersion(a,o){a.addFieldOffset(3,o,0)}static addDomain(a,o){a.addFieldOffset(4,o,0)}static addModelVersion(a,o){a.addFieldInt64(5,o,a.createLong(0,0))}static addDocString(a,o){a.addFieldOffset(6,o,0)}static addGraph(a,o){a.addFieldOffset(7,o,0)}static addGraphDocString(a,o){a.addFieldOffset(8,o,0)}static endModel(a){return a.endObject()}static createModel(a,o,d,g,rt,st,tt,ot,it,at){return et.startModel(a),et.addIrVersion(a,o),et.addOpsetImport(a,d),et.addProducerName(a,g),et.addProducerVersion(a,rt),et.addDomain(a,st),et.addModelVersion(a,tt),et.addDocString(a,ot),et.addGraph(a,it),et.addGraphDocString(a,at),et.endModel(a)}}nt.Model=et})(j.fbs||(j.fbs={}))})(_.experimental||(_.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(_){(function(j){(function(nt){class et{constructor(){this.bb=null,this.bb_pos=0}__init(a,o){return this.bb_pos=a,this.bb=o,this}static getRootAsKernelCreateInfos(a,o){return(o||new et).__init(a.readInt32(a.position())+a.position(),a)}static getSizePrefixedRootAsKernelCreateInfos(a,o){return a.setPosition(a.position()+c.flatbuffers.SIZE_PREFIX_LENGTH),(o||new et).__init(a.readInt32(a.position())+a.position(),a)}nodeIndices(a){let o=this.bb.__offset(this.bb_pos,4);return o?this.bb.readUint32(this.bb.__vector(this.bb_pos+o)+4*a):0}nodeIndicesLength(){let a=this.bb.__offset(this.bb_pos,4);return a?this.bb.__vector_len(this.bb_pos+a):0}nodeIndicesArray(){let a=this.bb.__offset(this.bb_pos,4);return a?new Uint32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+a),this.bb.__vector_len(this.bb_pos+a)):null}kernelDefHashes(a){let o=this.bb.__offset(this.bb_pos,6);return o?this.bb.readUint64(this.bb.__vector(this.bb_pos+o)+8*a):this.bb.createLong(0,0)}kernelDefHashesLength(){let a=this.bb.__offset(this.bb_pos,6);return a?this.bb.__vector_len(this.bb_pos+a):0}static startKernelCreateInfos(a){a.startObject(2)}static addNodeIndices(a,o){a.addFieldOffset(0,o,0)}static createNodeIndicesVector(a,o){a.startVector(4,o.length,4);for(let d=o.length-1;d>=0;d--)a.addInt32(o[d]);return a.endVector()}static startNodeIndicesVector(a,o){a.startVector(4,o,4)}static addKernelDefHashes(a,o){a.addFieldOffset(1,o,0)}static createKernelDefHashesVector(a,o){a.startVector(8,o.length,8);for(let d=o.length-1;d>=0;d--)a.addInt64(o[d]);return a.endVector()}static startKernelDefHashesVector(a,o){a.startVector(8,o,8)}static endKernelCreateInfos(a){return a.endObject()}static createKernelCreateInfos(a,o,d){return et.startKernelCreateInfos(a),et.addNodeIndices(a,o),et.addKernelDefHashes(a,d),et.endKernelCreateInfos(a)}}nt.KernelCreateInfos=et})(j.fbs||(j.fbs={}))})(_.experimental||(_.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(_){(function(j){(function(nt){class et{constructor(){this.bb=null,this.bb_pos=0}__init(a,o){return this.bb_pos=a,this.bb=o,this}static getRootAsSubGraphSessionState(a,o){return(o||new et).__init(a.readInt32(a.position())+a.position(),a)}static getSizePrefixedRootAsSubGraphSessionState(a,o){return a.setPosition(a.position()+c.flatbuffers.SIZE_PREFIX_LENGTH),(o||new et).__init(a.readInt32(a.position())+a.position(),a)}graphId(a){let o=this.bb.__offset(this.bb_pos,4);return o?this.bb.__string(this.bb_pos+o,a):null}sessionState(a){let o=this.bb.__offset(this.bb_pos,6);return o?(a||new _.experimental.fbs.SessionState).__init(this.bb.__indirect(this.bb_pos+o),this.bb):null}static startSubGraphSessionState(a){a.startObject(2)}static addGraphId(a,o){a.addFieldOffset(0,o,0)}static addSessionState(a,o){a.addFieldOffset(1,o,0)}static endSubGraphSessionState(a){let o=a.endObject();return a.requiredField(o,4),o}static createSubGraphSessionState(a,o,d){return et.startSubGraphSessionState(a),et.addGraphId(a,o),et.addSessionState(a,d),et.endSubGraphSessionState(a)}}nt.SubGraphSessionState=et})(j.fbs||(j.fbs={}))})(_.experimental||(_.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(_){(function(j){(function(nt){class et{constructor(){this.bb=null,this.bb_pos=0}__init(a,o){return this.bb_pos=a,this.bb=o,this}static getRootAsSessionState(a,o){return(o||new et).__init(a.readInt32(a.position())+a.position(),a)}static getSizePrefixedRootAsSessionState(a,o){return a.setPosition(a.position()+c.flatbuffers.SIZE_PREFIX_LENGTH),(o||new et).__init(a.readInt32(a.position())+a.position(),a)}kernels(a){let o=this.bb.__offset(this.bb_pos,4);return o?(a||new _.experimental.fbs.KernelCreateInfos).__init(this.bb.__indirect(this.bb_pos+o),this.bb):null}subGraphSessionStates(a,o){let d=this.bb.__offset(this.bb_pos,6);return d?(o||new _.experimental.fbs.SubGraphSessionState).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+d)+4*a),this.bb):null}subGraphSessionStatesLength(){let a=this.bb.__offset(this.bb_pos,6);return a?this.bb.__vector_len(this.bb_pos+a):0}static startSessionState(a){a.startObject(2)}static addKernels(a,o){a.addFieldOffset(0,o,0)}static addSubGraphSessionStates(a,o){a.addFieldOffset(1,o,0)}static createSubGraphSessionStatesVector(a,o){a.startVector(4,o.length,4);for(let d=o.length-1;d>=0;d--)a.addOffset(o[d]);return a.endVector()}static startSubGraphSessionStatesVector(a,o){a.startVector(4,o,4)}static endSessionState(a){return a.endObject()}static createSessionState(a,o,d){return et.startSessionState(a),et.addKernels(a,o),et.addSubGraphSessionStates(a,d),et.endSessionState(a)}}nt.SessionState=et})(j.fbs||(j.fbs={}))})(_.experimental||(_.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(_){(function(j){(function(nt){class et{constructor(){this.bb=null,this.bb_pos=0}__init(a,o){return this.bb_pos=a,this.bb=o,this}static getRootAsInferenceSession(a,o){return(o||new et).__init(a.readInt32(a.position())+a.position(),a)}static getSizePrefixedRootAsInferenceSession(a,o){return a.setPosition(a.position()+c.flatbuffers.SIZE_PREFIX_LENGTH),(o||new et).__init(a.readInt32(a.position())+a.position(),a)}static bufferHasIdentifier(a){return a.__has_identifier("ORTM")}ortVersion(a){let o=this.bb.__offset(this.bb_pos,4);return o?this.bb.__string(this.bb_pos+o,a):null}model(a){let o=this.bb.__offset(this.bb_pos,6);return o?(a||new _.experimental.fbs.Model).__init(this.bb.__indirect(this.bb_pos+o),this.bb):null}sessionState(a){let o=this.bb.__offset(this.bb_pos,8);return o?(a||new _.experimental.fbs.SessionState).__init(this.bb.__indirect(this.bb_pos+o),this.bb):null}static startInferenceSession(a){a.startObject(3)}static addOrtVersion(a,o){a.addFieldOffset(0,o,0)}static addModel(a,o){a.addFieldOffset(1,o,0)}static addSessionState(a,o){a.addFieldOffset(2,o,0)}static endInferenceSession(a){return a.endObject()}static finishInferenceSessionBuffer(a,o){a.finish(o,"ORTM")}static finishSizePrefixedInferenceSessionBuffer(a,o){a.finish(o,"ORTM",!0)}static createInferenceSession(a,o,d,g){return et.startInferenceSession(a),et.addOrtVersion(a,o),et.addModel(a,d),et.addSessionState(a,g),et.endInferenceSession(a)}}nt.InferenceSession=et})(j.fbs||(j.fbs={}))})(_.experimental||(_.experimental={}))}(e.onnxruntime||(e.onnxruntime={}))},7448:(i,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.OnnxjsSessionHandler=void 0;const c=s(1670),h=s(9162);e.OnnxjsSessionHandler=class{constructor($){this.session=$,this.inputNames=this.session.inputNames,this.outputNames=this.session.outputNames}async dispose(){}async run($,_,j){const nt=new Map;for(const a in $)if(Object.hasOwnProperty.call($,a)){const o=$[a];nt.set(a,new h.Tensor(o.dims,o.type,void 0,void 0,o.data))}const et=await this.session.run(nt),b={};return et.forEach((a,o)=>{b[o]=new c.Tensor(a.type,a.data,a.dims)}),b}startProfiling(){this.session.startProfiling()}endProfiling(){this.session.endProfiling()}}},6919:(i,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Session=void 0;const c=s(7067),h=s(1296),$=s(7091),_=s(1036),j=s(6231),nt=s(2644);e.Session=class{constructor(et={}){this._initialized=!1,this.backendHint=et.backendHint,this.profiler=j.Profiler.create(et.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(et,b,a){await this.profiler.event("session","Session.loadModel",async()=>{const o=await(0,$.resolveBackend)(this.backendHint);if(this.sessionHandler=o.createSessionHandler(this.context),this._model=new nt.Model,typeof et=="string"){const d=et.endsWith(".ort");if(typeof fetch>"u"){const g=await(0,h.promisify)(c.readFile)(et);this.initialize(g,d)}else{const g=await fetch(et),rt=await g.arrayBuffer();this.initialize(new Uint8Array(rt),d)}}else if(ArrayBuffer.isView(et))this.initialize(et);else{const d=new Uint8Array(et,b||0,a||et.byteLength);this.initialize(d)}})}initialize(et,b){if(this._initialized)throw new Error("already initialized");this.profiler.event("session","Session.initialize",()=>{const a=this.sessionHandler.transformGraph?this.sessionHandler:void 0;this._model.load(et,a,b),this.sessionHandler.onGraphInitialized&&this.sessionHandler.onGraphInitialized(this._model.graph),this.initializeOps(this._model.graph),this._executionPlan=new _.ExecutionPlan(this._model.graph,this._ops,this.profiler)}),this._initialized=!0}async run(et){if(!this._initialized)throw new Error("session not initialized yet");return this.profiler.event("session","Session.run",async()=>{const b=this.normalizeAndValidateInputs(et),a=await this._executionPlan.execute(this.sessionHandler,b);return this.createOutput(a)})}normalizeAndValidateInputs(et){const b=this._model.graph.getInputNames();if(Array.isArray(et)){if(et.length!==b.length)throw new Error(`incorrect input array length: expected ${b.length} but got ${et.length}`)}else{if(et.size!==b.length)throw new Error(`incorrect input map size: expected ${b.length} but got ${et.size}`);const a=new Array(et.size);let o=0;for(let d=0;d<b.length;++d){const g=et.get(b[d]);if(!g)throw new Error(`missing input tensor for: '${name}'`);a[o++]=g}et=a}if(this.context.graphInputTypes&&this.context.graphInputTypes.length!==0&&this.context.graphInputDims&&this.context.graphInputDims.length!==0)this.validateInputTensorDims(this.context.graphInputDims,et,!1);else{const a=this._model.graph.getInputIndices(),o=this._model.graph.getValues(),d=new Array(a.length);for(let g=0;g<a.length;++g){const rt=o[a[g]];d[g]=rt.type.shape.dims,this.context.graphInputTypes.push(rt.type.tensorType),this.context.graphInputDims.push(et[g].dims)}this.validateInputTensorDims(d,et,!0)}return this.validateInputTensorTypes(this.context.graphInputTypes,et),et}validateInputTensorTypes(et,b){for(let a=0;a<b.length;a++){const o=et[a],d=b[a].type;if(o!==d)throw new Error(`input tensor[${a}] check failed: expected type '${o}' but got ${d}`)}}validateInputTensorDims(et,b,a){for(let o=0;o<b.length;o++){const d=et[o],g=b[o].dims;if(!this.compareTensorDims(d,g,a))throw new Error(`input tensor[${o}] check failed: expected shape '[${d.join(",")}]' but got [${g.join(",")}]`)}}compareTensorDims(et,b,a){if(et.length!==b.length)return!1;for(let o=0;o<et.length;++o)if(et[o]!==b[o]&&(!a||et[o]!==0))return!1;return!0}createOutput(et){const b=this._model.graph.getOutputNames();if(et.length!==b.length)throw new Error("expected number of outputs do not match number of generated outputs");const a=new Map;for(let o=0;o<b.length;++o)a.set(b[o],et[o]);return a}initializeOps(et){const b=et.getNodes();this._ops=new Array(b.length);for(let a=0;a<b.length;a++)this._ops[a]=this.sessionHandler.resolve(b[a],this._model.opsets,et)}}},9162:function(i,e,s){var c=this&&this.__importDefault||function(rt){return rt&&rt.__esModule?rt:{default:rt}};Object.defineProperty(e,"__esModule",{value:!0}),e.Tensor=void 0;const h=s(3442),$=c(s(3720)),_=s(1446),j=s(9395),nt=s(2517);var et=j.onnxruntime.experimental.fbs;class b{get data(){if(this.cache===void 0){const st=this.dataProvider(this.dataId);if(st.length!==this.size)throw new Error("Length of data provided by the Data Provider is inconsistent with the dims of this Tensor.");this.cache=st}return this.cache}get stringData(){if(this.type!=="string")throw new TypeError("data type is not string");return this.data}get integerData(){switch(this.type){case"uint8":case"int8":case"uint16":case"int16":case"int32":case"uint32":case"bool":return this.data;default:throw new TypeError("data type is not integer (uint8, int8, uint16, int16, int32, uint32, bool)")}}get floatData(){switch(this.type){case"float32":case"float64":return this.data;default:throw new TypeError("data type is not float (float32, float64)")}}get numberData(){if(this.type!=="string")return this.data;throw new TypeError("type cannot be non-number (string)")}get(st){return this.data[nt.ShapeUtil.indicesToOffset(st,this.strides)]}set(st,tt){this.data[nt.ShapeUtil.indicesToOffset(st,this.strides)]=tt}async getData(){return this.cache===void 0&&(this.cache=await this.asyncDataProvider(this.dataId)),this.cache}get strides(){return this._strides||(this._strides=nt.ShapeUtil.computeStrides(this.dims)),this._strides}constructor(st,tt,ot,it,at,ut=h.Guid.create()){this.dims=st,this.type=tt,this.dataProvider=ot,this.asyncDataProvider=it,this.cache=at,this.dataId=ut,this.size=nt.ShapeUtil.validateDimsAndCalcSize(st);const lt=this.size,ct=ot===void 0&&it===void 0&&at===void 0;if(at!==void 0&&at.length!==lt)throw new RangeError("Input dims doesn't match data length.");if(tt==="string"){if(!(at===void 0||Array.isArray(at)&&at.every(ft=>typeof ft=="string")))throw new TypeError("cache should be a string array");ct&&(this.cache=new Array(lt))}else{if(at!==void 0){const ft=o(tt);if(!(at instanceof ft))throw new TypeError(`cache should be type ${ft.name}`)}if(ct){const ft=new ArrayBuffer(lt*function(dt){switch(dt){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 ${dt}`)}}(tt));this.cache=function(dt,yt){return new(o(yt))(dt)}(ft,tt)}}}static fromProto(st){if(!st)throw new Error("cannot construct Value from an empty tensor");const tt=nt.ProtoUtil.tensorDataTypeFromProto(st.dataType),ot=nt.ProtoUtil.tensorDimsFromProto(st.dims),it=new b(ot,tt);if(tt==="string")st.stringData.forEach((at,ut)=>{it.data[ut]=(0,nt.decodeUtf8String)(at)});else if(st.rawData&&typeof st.rawData.byteLength=="number"&&st.rawData.byteLength>0){const at=it.data,ut=new DataView(st.rawData.buffer,st.rawData.byteOffset,st.rawData.byteLength),lt=a(st.dataType),ct=st.rawData.byteLength/lt;if(st.rawData.byteLength%lt!=0)throw new Error("invalid buffer length");if(at.length!==ct)throw new Error("buffer length mismatch");for(let ft=0;ft<ct;ft++){const dt=g(ut,st.dataType,ft*lt);at[ft]=dt}}else{let at;switch(st.dataType){case _.onnx.TensorProto.DataType.FLOAT:at=st.floatData;break;case _.onnx.TensorProto.DataType.INT32:case _.onnx.TensorProto.DataType.INT16:case _.onnx.TensorProto.DataType.UINT16:case _.onnx.TensorProto.DataType.INT8:case _.onnx.TensorProto.DataType.UINT8:case _.onnx.TensorProto.DataType.BOOL:at=st.int32Data;break;case _.onnx.TensorProto.DataType.INT64:at=st.int64Data;break;case _.onnx.TensorProto.DataType.DOUBLE:at=st.doubleData;break;case _.onnx.TensorProto.DataType.UINT32:case _.onnx.TensorProto.DataType.UINT64:at=st.uint64Data;break;default:throw new Error("unspecific error")}if(at==null)throw new Error("failed to populate data from a tensorproto value");const ut=it.data;if(ut.length!==at.length)throw new Error("array length mismatch");for(let lt=0;lt<at.length;lt++){const ct=at[lt];$.default.isLong(ct)?ut[lt]=d(ct,st.dataType):ut[lt]=ct}}return it}static fromData(st,tt,ot){return new b(tt,ot,void 0,void 0,st)}static fromOrtTensor(st){if(!st)throw new Error("cannot construct Value from an empty tensor");const tt=nt.ProtoUtil.tensorDimsFromORTFormat(st),ot=nt.ProtoUtil.tensorDataTypeFromProto(st.dataType()),it=new b(tt,ot);if(ot==="string")for(let at=0;at<st.stringDataLength();at++)it.data[at]=st.stringData(at);else if(st.rawDataArray()&&typeof st.rawDataLength()=="number"&&st.rawDataLength()>0){const at=it.data,ut=new DataView(st.rawDataArray().buffer,st.rawDataArray().byteOffset,st.rawDataLength()),lt=a(st.dataType()),ct=st.rawDataLength()/lt;if(st.rawDataLength()%lt!=0)throw new Error("invalid buffer length");if(at.length!==ct)throw new Error("buffer length mismatch");for(let ft=0;ft<ct;ft++){const dt=g(ut,st.dataType(),ft*lt);at[ft]=dt}}return it}}function a(rt){switch(rt){case _.onnx.TensorProto.DataType.UINT8:case _.onnx.TensorProto.DataType.INT8:case _.onnx.TensorProto.DataType.BOOL:return 1;case _.onnx.TensorProto.DataType.UINT16:case _.onnx.TensorProto.DataType.INT16:return 2;case _.onnx.TensorProto.DataType.FLOAT:case _.onnx.TensorProto.DataType.INT32:case _.onnx.TensorProto.DataType.UINT32:return 4;case _.onnx.TensorProto.DataType.INT64:case _.onnx.TensorProto.DataType.DOUBLE:case _.onnx.TensorProto.DataType.UINT64:return 8;default:throw new Error(`cannot calculate sizeof() on type ${_.onnx.TensorProto.DataType[rt]}`)}}function o(rt){switch(rt){case"bool":case"uint8":return Uint8Array;case"int8":return Int8Array;case"int16":return Int16Array;case"uint16":return Uint16Array;case"int32":return Int32Array;case"uint32":return Uint32Array;case"float32":return Float32Array;case"float64":return Float64Array;default:throw new Error("unspecified error")}}function d(rt,st){if(st===_.onnx.TensorProto.DataType.INT64||st===et.TensorDataType.INT64){if(rt.greaterThanOrEqual(2147483648)||rt.lessThan(-2147483648))throw new TypeError("int64 is not supported")}else{if(st!==_.onnx.TensorProto.DataType.UINT32&&st!==et.TensorDataType.UINT32&&st!==_.onnx.TensorProto.DataType.UINT64&&st!==et.TensorDataType.UINT64)throw new TypeError(`not a LONG type: ${_.onnx.TensorProto.DataType[st]}`);if(rt.greaterThanOrEqual(4294967296)||rt.lessThan(0))throw new TypeError("uint64 is not supported")}return rt.toNumber()}function g(rt,st,tt){switch(st){case _.onnx.TensorProto.DataType.BOOL:case _.onnx.TensorProto.DataType.UINT8:return rt.getUint8(tt);case _.onnx.TensorProto.DataType.INT8:return rt.getInt8(tt);case _.onnx.TensorProto.DataType.UINT16:return rt.getUint16(tt,!0);case _.onnx.TensorProto.DataType.INT16:return rt.getInt16(tt,!0);case _.onnx.TensorProto.DataType.FLOAT:return rt.getFloat32(tt,!0);case _.onnx.TensorProto.DataType.INT32:return rt.getInt32(tt,!0);case _.onnx.TensorProto.DataType.UINT32:return rt.getUint32(tt,!0);case _.onnx.TensorProto.DataType.INT64:return d($.default.fromBits(rt.getUint32(tt,!0),rt.getUint32(tt+4,!0),!1),st);case _.onnx.TensorProto.DataType.DOUBLE:return rt.getFloat64(tt,!0);case _.onnx.TensorProto.DataType.UINT64:return d($.default.fromBits(rt.getUint32(tt,!0),rt.getUint32(tt+4,!0),!0),st);default:throw new Error(`cannot read from DataView for type ${_.onnx.TensorProto.DataType[st]}`)}}e.Tensor=b},2517:function(i,e,s){var c=this&&this.__importDefault||function(st){return st&&st.__esModule?st:{default:st}};Object.defineProperty(e,"__esModule",{value:!0}),e.decodeUtf8String=e.MAX_CLIP=e.MIN_CLIP=e.PoolConvUtil=e.ReduceUtil=e.SplitUtil=e.MathUtil=e.ShapeUtil=e.LongUtil=e.ProtoUtil=e.GemmUtil=e.arrayCopyHelper=e.BroadcastUtil=e.MatMulUtil=e.ArrayUtil=e.assert=e.checkInputsShape=void 0;const h=s(5686),$=c(s(3720)),_=s(1446),j=s(9162);e.checkInputsShape=function(st,...tt){if(!st||st.length!==tt.length)return!1;for(let ot=0;ot<st.length;ot++)if(!st[ot].dims||st[ot].dims.length!==tt[ot])return!1;return!0},e.assert=function(st,tt){if(!st)throw new Error(typeof tt=="string"?tt:tt())},e.ArrayUtil=class{static arraysEqual(st,tt){if(st.length!==tt.length)return!1;for(let ot=0;ot<st.length;ot++)if(st[ot]!==tt[ot])return!1;return!0}};class nt{static preprocessInputShapes(tt,ot){return[tt.length===1?[1,tt[0]]:tt,ot.length===1?[ot[0],1]:ot]}static postprocessOutputShape(tt,ot,it){ot===1&&tt.splice(tt.length-2,1),it===1&&tt.pop()}static calcMatMulShape(tt,ot){return tt[1]!==ot[0]?void 0:[tt[0],ot[1]]}}e.MatMulUtil=nt;class et{static calcShape(tt,ot,it=!1){const at=tt.length,ut=ot.length;if(at===0)return ot;if(ut===0)return tt;const lt=Math.max(tt.length,ot.length),ct=new Array(lt);if(it){if(at<2||ut<2)return;const ft=nt.calcMatMulShape([tt[at-2],tt[at-1]],[ot[ut-2],ot[ut-1]]);if(ft===void 0)return;[ct[lt-2],ct[lt-1]]=ft}for(let ft=it?3:1;ft<=lt;ft++){const dt=at-ft<0?1:tt[at-ft],yt=ut-ft<0?1:ot[ut-ft];if(dt!==yt&&dt>1&&yt>1)return;ct[lt-ft]=Math.max(dt,yt)}return ct}static index(tt,ot){const it=new Array(ot.length);return et.fillIndex(tt,ot,it),it}static fillIndex(tt,ot,it){const at=tt.length-ot.length;for(let ut=0;ut<ot.length;ut++)it[ut]=tt[at+ut]%ot[ut]}static calc(tt,ot,it,at,ut){const lt=et.calcShape(tt.dims,ot.dims);if(lt){if(at&&!o.areEqual(lt,tt.dims))return;const ct=o.size(lt),ft=at?tt:new j.Tensor(lt,ut||tt.type);if(lt.length===0)ft.set([],it(tt.get([]),ot.get([])));else{const dt=new Array(lt.length),yt=new Array(tt.dims.length),St=new Array(ot.dims.length);let bt,Tt=0,vt=0,$t=!1,At=!1;tt.dims.length===0&&(Tt=tt.get([]),$t=!0),ot.dims.length===0&&(vt=ot.get([]),At=!0);for(let Ot=0;Ot<ct;Ot++){bt=Ot;for(let It=lt.length-1;It>=0;It--)dt[It]=bt%lt[It],bt=Math.floor(bt/lt[It]);$t||(et.fillIndex(dt,tt.dims,yt),Tt=tt.get(yt)),At||(et.fillIndex(dt,ot.dims,St),vt=ot.get(St)),ft.set(dt,it(Tt,vt))}}return ft}}static isValidBroadcast(tt,ot){const it=tt.length,at=ot.length;if(it>at)return!1;for(let ut=1;ut<=it;ut++)if(tt[it-ut]!==1&&tt[it-ut]!==ot[at-ut])return!1;return!0}static getBroadcastDims(tt,ot){const it=tt.length,at=[];for(let ut=0;ut<it;ut++){const lt=it-1-ut,ct=tt[lt]||1;(ot[ot.length-1-ut]||1)>1&&ct===1&&at.unshift(lt)}return at}}e.BroadcastUtil=et,e.arrayCopyHelper=function(st,tt,ot,it,at){if(it<0||it>=tt.length)throw new Error("sourceIndex out of bounds");if(ot<0||ot>=st.length)throw new Error("targetIndex out of bounds");if(it+at>tt.length)throw new Error("source indices to be copied are outside bounds");if(ot+at>st.length)throw new Error("target array is too small to hold result");for(let ut=0;ut<at;ut++)st[ot+ut]=tt[it+ut]},e.GemmUtil=class{static getShapeOfGemmResult(st,tt,ot,it,at){if(st.length!==2||ot.length!==2)throw new Error("shape need to be of size 2");let ut,lt,ct;tt?(ut=st[1],lt=st[0]):(ut=st[0],lt=st[1]);let ft=-1;if(it?(ct=ot[0],ft=1):(ct=ot[1],ft=0),ot[ft]!==lt)throw new Error("dimension mismatch");if(ut<=0||ct<=0||lt<=0)throw new Error("invalid shape specified");if(at&&!et.isValidBroadcast(at,[ut,ct]))throw new Error("gemm: invalid bias shape for broadcast");return[ut,ct,lt]}};class b{static tensorDataTypeFromProto(tt){switch(tt){case _.onnx.TensorProto.DataType.INT8:return"int8";case _.onnx.TensorProto.DataType.UINT8:return"uint8";case _.onnx.TensorProto.DataType.BOOL:return"bool";case _.onnx.TensorProto.DataType.INT16:return"int16";case _.onnx.TensorProto.DataType.UINT16:return"uint16";case _.onnx.TensorProto.DataType.INT32:return"int32";case _.onnx.TensorProto.DataType.UINT32:return"uint32";case _.onnx.TensorProto.DataType.FLOAT:return"float32";case _.onnx.TensorProto.DataType.DOUBLE:return"float64";case _.onnx.TensorProto.DataType.STRING:return"string";case _.onnx.TensorProto.DataType.INT64:return"int32";case _.onnx.TensorProto.DataType.UINT64:return"uint32";default:throw new Error(`unsupported data type: ${_.onnx.TensorProto.DataType[tt]}`)}}static tensorDataTypeStringToEnum(tt){switch(tt){case"int8":return _.onnx.TensorProto.DataType.INT8;case"uint8":return _.onnx.TensorProto.DataType.UINT8;case"bool":return _.onnx.TensorProto.DataType.BOOL;case"int16":return _.onnx.TensorProto.DataType.INT16;case"uint16":return _.onnx.TensorProto.DataType.UINT16;case"int32":return _.onnx.TensorProto.DataType.INT32;case"uint32":return _.onnx.TensorProto.DataType.UINT32;case"float32":return _.onnx.TensorProto.DataType.FLOAT;case"float64":return _.onnx.TensorProto.DataType.DOUBLE;case"string":return _.onnx.TensorProto.DataType.STRING;case"int64":return _.onnx.TensorProto.DataType.INT64;case"uint64":return _.onnx.TensorProto.DataType.UINT64;default:throw new Error(`unsupported data type: ${tt}`)}}static tensorDimsFromProto(tt){return tt.map(ot=>$.default.isLong(ot)?ot.toNumber():ot)}static tensorValueTypeFromProto(tt){return{tensorType:b.tensorDataTypeFromProto(tt.elemType),shape:{dims:b.tensorDimsFromProto(tt.shape.dim.map(ot=>ot.dimValue))}}}static tensorDimsFromORTFormat(tt){const ot=[];for(let it=0;it<tt.dimsLength();it++)ot.push(a.longToNumber(tt.dims(it)));return ot}static tensorAttributesFromORTFormat(tt){const ot=[];for(let it=0;it<tt.attributesLength();it++)ot.push(tt.attributes(it));return ot}}e.ProtoUtil=b;class a{static longToNumber(tt,ot){return $.default.isLong(tt)?tt.toNumber():tt instanceof h.flatbuffers.Long?$.default.fromValue({low:tt.low,high:tt.high,unsigned:ot!=null&&ot}).toNumber():tt}static isLong(tt){return $.default.isLong(tt)||tt instanceof h.flatbuffers.Long}}e.LongUtil=a;class o{static size(tt){return o.getSizeFromDimensionRange(tt,0,tt.length)}static sizeFromDimension(tt,ot){if(ot<0||ot>tt.length)throw new Error(`invalid dimension of ${ot} for sizeFromDimension as Tensor has ${tt.length} dimensions.`);return o.getSizeFromDimensionRange(tt,ot,tt.length)}static sizeToDimension(tt,ot){if(ot<0||ot>tt.length)throw new Error(`invalid dimension of ${ot} for sizeToDimension as Tensor has ${tt.length} dimensions.`);return o.getSizeFromDimensionRange(tt,0,ot)}static getSizeFromDimensionRange(tt,ot,it){let at=1;for(let ut=ot;ut<it;ut++){if(tt[ut]<=0)throw new Error("cannot get valid size from specified dimension range. Most likely the range contains 0 or negative values in them.");at*=tt[ut]}return at}static computeStrides(tt){const ot=tt.length;if(ot===0)return[];if(ot===1)return[1];const it=new Array(ot);it[ot-1]=1,it[ot-2]=tt[ot-1];for(let at=ot-3;at>=0;--at)it[at]=it[at+1]*tt[at+1];return it}static transpose(tt){return tt.slice().reverse()}static indicesToOffset(tt,ot,it){it===void 0&&(it=tt.length);let at=0;for(let ut=0;ut<it;++ut)at+=ot[ut]*tt[ut];return at}static offsetToIndices(tt,ot){const it=ot.length;if(it===0)return[];if(it===1)return[tt*ot[0]];const at=new Array(ot.length);for(let ut=0;ut<at.length-1;++ut)at[ut]=Math.floor(tt/ot[ut]),tt-=at[ut]*ot[ut];return at[at.length-1]=tt,at}static normalizeAxis(tt,ot){if(tt<-ot&&tt>=ot)throw new Error("unsupported axis for this operation.");return tt<0?tt+ot:tt}static normalizeAxes(tt,ot){return tt.map(it=>this.normalizeAxis(it,ot))}static incrementIndex(tt,ot,it){if(ot.length===0||tt.length===0)throw new Error("Index incrementing unsupported for scalar Tensor");if(it===void 0)it=ot.length;else if(it<=0||it>ot.length)throw new Error("Incorrect axis to increment on");for(let at=it-1;at>=0&&(tt[at]++,!(tt[at]<ot[at]));--at)tt[at]=0}static calculateReshapedDims(tt,ot){if(ot.length===0){if(tt.length===0||o.size(tt)===1)return[];throw new Error("cannot reshape to a scalar Tensor")}const it=ot.length,at=new Array(it);let ut=-1,lt=1;for(let ft=0;ft<it;ft++){if(ot[ft]<-1)throw new Error("a dimension in shape hints cannot be less than -1");if(ot[ft]===-1){if(ut!==-1)throw new Error("at most one dimension in shape hints can be -1");ut=ft}else{if(ot[ft]===0){if(ft>=tt.length)throw new Error("the dimension with value zero exceeds the dimension size of the input tensor");at[ft]=tt[ft]}else at[ft]=ot[ft];lt*=at[ft]}}const ct=o.size(tt);if(ut!==-1){if(ct%lt!=0)throw new Error(`the input tensor cannot be reshaped to the requested shape. Input shape: [${tt}] Output shape: [${ot}]`);at[ut]=ct/lt}else if(lt!==ct)throw new Error("reshapedDims and originalDims don't have matching sizes");return at}static sortBasedOnPerm(tt,ot){return ot?ot.map(it=>tt[it]):tt.slice().reverse()}static padShape(tt,ot){const it=tt.length;return tt.map((at,ut)=>at+ot[ut]+ot[ut+it])}static areEqual(tt,ot){return tt.length===ot.length&&tt.every((it,at)=>it===ot[at])}static validateDimsAndCalcSize(tt){if(tt.length>6)throw new TypeError("Only rank 0 to 6 is supported for tensor shape.");let ot=1;for(const it of tt){if(!Number.isInteger(it))throw new TypeError(`Invalid shape: ${it} is not an integer`);if(it<0||it>2147483647)throw new TypeError(`Invalid shape: length ${it} is not allowed`);ot*=it}return ot}static flattenShape(tt,ot){ot<0&&(ot+=tt.length);const it=tt.reduce((ut,lt)=>ut*lt,1),at=tt.slice(ot).reduce((ut,lt)=>ut*lt,1);return[it/at,at]}static squeezeShape(tt,ot){const it=new Array;ot=o.normalizeAxes(ot,tt.length);for(let at=0;at<tt.length;at++){const ut=ot.indexOf(at)>=0;if(ut&&tt[at]!==1)throw new Error("squeeze an axis of size different than 1");(ot.length===0&&tt[at]>1||ot.length>0&&!ut)&&it.push(tt[at])}return it}static unsqueezeShape(tt,ot){const it=new Array(tt.length+ot.length);it.fill(0);for(let ut=0;ut<ot.length;ut++){const lt=o.normalizeAxis(ot[ut],it.length);if(lt>=it.length)throw new Error("'axes' has an out of range axis");if(it[lt]!==0)throw new Error("'axes' has a duplicate axis");it[lt]=1}let at=0;for(let ut=0;ut<it.length;ut++)it[ut]===0&&(it[ut]=tt[at++]);if(at!==tt.length)throw new Error("the unsqueezed dimension could not be established");return it}}e.ShapeUtil=o,e.MathUtil=class{static sqr(st,tt,ot,it,at){if(it<0||it>=tt.length)throw new Error("sourceIndex out of bounds");if(ot<0||ot>=st.length)throw new Error("targetIndex out of bounds");if(it+at>tt.length)throw new Error("source indices to be copied are outside bounds");if(ot+at>st.length)throw new Error("target array is too small to hold result");for(let ut=0;ut<at;ut++)st[ot+ut]+=Math.pow(tt[it+ut],2)}static axpy(st,tt,ot,it,at,ut){if(it<0||it>=tt.length)throw new Error("sourceIndex out of bounds");if(ot<0||ot>=st.length)throw new Error("targetIndex out of bounds");if(it+at>tt.length)throw new Error("source indices to be copied are outside bounds");if(ot+at>st.length)throw new Error("target array is too small to hold result");for(let lt=0;lt<at;lt++)st[ot+lt]+=ut*tt[it+lt]}static powx(st,tt,ot,it,at,ut){if(it<0||it>=tt.length)throw new Error("sourceIndex out of bounds");if(ot<0||ot>=st.length)throw new Error("targetIndex out of bounds");if(it+at>tt.length)throw new Error("source indices to be copied are outside bounds");if(ot+at>st.length)throw new Error("target array is too small to hold result");for(let lt=0;lt<at;lt++)st[ot+lt]=Math.pow(tt[it+lt],ut)}static mul(st,tt,ot,it,at){if(it<0||it>=tt.length)throw new Error("sourceIndex out of bounds");if(ot<0||ot>=st.length)throw new Error("targetIndex out of bounds");if(it+at>tt.length)throw new Error("source indices to be copied are outside bounds");if(ot+at>st.length)throw new Error("target array is too small to hold result");for(let ut=0;ut<at;ut++)st[ot+ut]=tt[it+ut]*st[ot+ut]}};class d{static splitShape(tt,ot,it,at){if(it.length===0){if(!at)throw new Error("need to know number of outputs when the 'split' attribute is not specified");d.determineSplit(tt[ot],at,it)}const ut=[],lt=[0];for(let ct=0;ct<it.length;++ct){ct!==0&<.push(lt[ct-1]+it[ct-1]);const ft=tt.slice();ft[ot]=it[ct],ut.push(ft)}return[ut,lt]}static determineSplit(tt,ot,it){if(tt%ot!=0)throw new Error("cannot split tensor to equal sized parts");for(let at=0;at<ot;++at)it.push(tt/ot)}}e.SplitUtil=d;class g{static calcReduce(tt,ot,it,at,ut){const lt=tt.dims.slice(0);ot.length===0&<.forEach((Tt,vt)=>ot.push(vt));const ct=g.calcReduceShape(lt,ot,!0),ft=o.size(ct),dt=new j.Tensor(ct,tt.type),yt=o.computeStrides(ct),St=o.computeStrides(lt),bt=new Array(lt.length);for(let Tt=0;Tt<ft;Tt++){const vt=o.offsetToIndices(Tt,yt);et.fillIndex(vt,lt,bt),dt.set(vt,g.calcReduceByAxis(tt.numberData,ot,lt,0,o.indicesToOffset(bt,St),at,ut))}return it?dt:new j.Tensor(g.calcReduceShape(lt,ot,it),dt.type,void 0,void 0,dt.data,dt.dataId)}static calcReduceByAxis(tt,ot,it,at,ut,lt,ct){let ft=0;if(at>=ot.length)return lt(tt[ut]);const dt=ot[at],yt=dt>=it.length?1:o.size(it.slice(dt+1));for(let St=0;St<it[dt];St++)ft=St===0?g.calcReduceByAxis(tt,ot,it,at+1,ut,lt,ct):ct(ft,g.calcReduceByAxis(tt,ot,it,at+1,ut,lt,ct)),ut+=yt;return ft}static calcReduceShape(tt,ot,it){const at=tt.slice();for(let ut=0;ut<ot.length;ut++)at[ot[ut]]=it?1:0;return at.filter(ut=>ut!==0)}}e.ReduceUtil=g;class rt{static adjustPoolAttributes(tt,ot,it,at,ut,lt){if(!tt&&it.length!==ot.length-2)throw new Error("length of specified kernel shapes should be 2 less than length of input dimensions");if(tt)for(let ct=0;ct<ot.length-2;ct++)ct>=it.length?it.push(ot[ct+2]):it[ct]=ot[ct+2];for(let ct=0;ct<it.length;ct++)if(ct<at.length){if(at[ct]<0)throw new Error("strides should be greater than or equal to 1")}else at.push(1);for(let ct=0;ct<it.length;ct++)if(ct<ut.length){if(ut[ct]<0)throw new Error("dilations should be greater than or equal to 1")}else ut.push(1);for(let ct=0;ct<2*it.length;ct++)if(ct<lt.length){if(lt[ct]<0)throw new Error("pad should be greater than or equal to 1")}else lt.push(0);for(let ct=0;ct<it.length;ct++){if(it[ct]<=0)throw new Error("kernel shapes need to be greater than 0");if(lt[ct]>=it[ct]||lt[ct+it.length]>=it[ct])throw new Error("pads should be smaller than kernel")}}static adjustPadsBasedOnAutoPad(tt,ot,it,at,ut,lt){if(lt){if(ut.length!==2*(tt.length-2))throw new Error("length of pads should be twice the length of data dimensions");if(ot.length!==tt.length-2)throw new Error("length of strides should be the length of data dimensions");if(at.length!==tt.length-2)throw new Error("length of kernel shapes should be the length of data dimensions");for(let ct=0;ct<tt.length-2;ct++)rt.adjustPadAndReturnShape(tt[ct+2],ot[ct],it[ct],at[ct],ut,ct,ct+tt.length-2,lt)}}static computePoolOutputShape(tt,ot,it,at,ut,lt,ct){if(ot.length<=0)throw new Error("input shape must be of size greater than 0");const ft=[ot[0],ot[1]];return rt.computeShapeHelper(tt,ot,ft,it,at,ut,lt,ct),ft}static computeConvOutputShape(tt,ot,it,at,ut,lt,ct){if(tt.length<=0||ot.length<=0)throw new Error("invalid input tensor dims or invalid filter tensor dims");const ft=[tt[0],ot[0]];return rt.computeShapeHelper(!1,tt,ft,it,at,ut,lt,ct),ft}static computeShapeHelper(tt,ot,it,at,ut,lt,ct,ft){if(tt)for(let dt=0;dt<ot.length-2;dt++)it.push(1);else for(let dt=0;dt<ot.length-2;dt++)it.push(rt.adjustPadAndReturnShape(ot[dt+2],at[dt],ut[dt],lt[dt],ct,dt,dt+ot.length-2,ft))}static adjustPadAndReturnShape(tt,ot,it,at,ut,lt,ct,ft){const dt=it*(at-1)+1;if(!ft||ft==="NOTSET")return Math.floor((tt+ut[lt]+ut[ct]-dt)/ot+1);switch(ft){case"VALID":return ut[lt]=0,ut[ct]=0,Math.floor((tt-dt)/ot+1);case"SAME_LOWER":case"SAME_UPPER":if(it!==1)throw new Error("Dilation not supported for SAME_UPPER or SAME_LOWER");{const yt=((tt+ot-1)/ot-1)*ot+at-tt;return ut[lt]=Math.floor(ft==="SAME_LOWER"?(yt+1)/2:yt/2),ut[ct]=yt-ut[lt],Math.floor((tt+yt-at)/ot+1)}default:throw new Error("Unsupported AutoPad type")}}}e.PoolConvUtil=rt,e.MIN_CLIP=-34028234663852886e22,e.MAX_CLIP=34028234663852886e22,e.decodeUtf8String=function(st){return new TextDecoder().decode(st)}},7967:(i,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.iterateExtraOptions=void 0,e.iterateExtraOptions=(s,c,h,$)=>{if(typeof s=="object"&&s!==null){if(h.has(s))throw new Error("Circular reference in options");h.add(s)}Object.entries(s).forEach(([_,j])=>{const nt=c?c+_:_;if(typeof j=="object")(0,e.iterateExtraOptions)(j,nt+".",h,$);else if(typeof j=="string"||typeof j=="number")$(nt,j.toString());else{if(typeof j!="boolean")throw new Error("Can't handle extra config type: "+typeof j);$(nt,j?"1":"0")}})}},2157:function(i,e,s){var c,h=this&&this.__createBinding||(Object.create?function(yt,St,bt,Tt){Tt===void 0&&(Tt=bt);var vt=Object.getOwnPropertyDescriptor(St,bt);vt&&!("get"in vt?!St.__esModule:vt.writable||vt.configurable)||(vt={enumerable:!0,get:function(){return St[bt]}}),Object.defineProperty(yt,Tt,vt)}:function(yt,St,bt,Tt){Tt===void 0&&(Tt=bt),yt[Tt]=St[bt]}),$=this&&this.__setModuleDefault||(Object.create?function(yt,St){Object.defineProperty(yt,"default",{enumerable:!0,value:St})}:function(yt,St){yt.default=St}),_=this&&this.__importStar||function(yt){if(yt&&yt.__esModule)return yt;var St={};if(yt!=null)for(var bt in yt)bt!=="default"&&Object.prototype.hasOwnProperty.call(yt,bt)&&h(St,yt,bt);return $(St,yt),St};Object.defineProperty(e,"__esModule",{value:!0}),e.endProfiling=e.run=e.releaseSession=e.createSession=e.createSessionFinalize=e.createSessionAllocate=e.initOrt=e.initWasm=void 0;const j=s(1670),nt=_(s(349)),et=s(6361),b=()=>!!j.env.wasm.proxy&&typeof document<"u";let a,o,d,g=!1,rt=!1,st=!1;const tt=[],ot=[],it=[],at=[],ut=[],lt=[],ct=()=>{if(g||!rt||st||!a)throw new Error("worker not ready")},ft=yt=>{switch(yt.data.type){case"init-wasm":g=!1,yt.data.err?(st=!0,o[1](yt.data.err)):(rt=!0,o[0]());break;case"init-ort":yt.data.err?d[1](yt.data.err):d[0]();break;case"create_allocate":yt.data.err?tt.shift()[1](yt.data.err):tt.shift()[0](yt.data.out);break;case"create_finalize":yt.data.err?ot.shift()[1](yt.data.err):ot.shift()[0](yt.data.out);break;case"create":yt.data.err?it.shift()[1](yt.data.err):it.shift()[0](yt.data.out);break;case"release":yt.data.err?at.shift()[1](yt.data.err):at.shift()[0]();break;case"run":yt.data.err?ut.shift()[1](yt.data.err):ut.shift()[0](yt.data.out);break;case"end-profiling":yt.data.err?lt.shift()[1](yt.data.err):lt.shift()[0]()}},dt=typeof document<"u"?(c=document==null?void 0:document.currentScript)===null||c===void 0?void 0:c.src:void 0;e.initWasm=async()=>{if(b()){if(rt)return;if(g)throw new Error("multiple calls to 'initWasm()' detected.");if(st)throw new Error("previous call to 'initWasm()' failed.");return g=!0,j.env.wasm.wasmPaths===void 0&&dt&&dt.indexOf("blob:")!==0&&(j.env.wasm.wasmPaths=dt.substr(0,+dt.lastIndexOf("/")+1)),new Promise((yt,St)=>{a==null||a.terminate(),a=s(9710).Z(),a.onmessage=ft,o=[yt,St];const bt={type:"init-wasm",in:j.env.wasm};a.postMessage(bt)})}return(0,et.initializeWebAssembly)(j.env.wasm)},e.initOrt=async(yt,St)=>{if(b())return ct(),new Promise((bt,Tt)=>{d=[bt,Tt];const vt={type:"init-ort",in:{numThreads:yt,loggingLevel:St}};a.postMessage(vt)});nt.initOrt(yt,St)},e.createSessionAllocate=async yt=>b()?(ct(),new Promise((St,bt)=>{tt.push([St,bt]);const Tt={type:"create_allocate",in:{model:yt}};a.postMessage(Tt,[yt.buffer])})):nt.createSessionAllocate(yt),e.createSessionFinalize=async(yt,St)=>b()?(ct(),new Promise((bt,Tt)=>{ot.push([bt,Tt]);const vt={type:"create_finalize",in:{modeldata:yt,options:St}};a.postMessage(vt)})):nt.createSessionFinalize(yt,St),e.createSession=async(yt,St)=>b()?(ct(),new Promise((bt,Tt)=>{it.push([bt,Tt]);const vt={type:"create",in:{model:yt,options:St}};a.postMessage(vt,[yt.buffer])})):nt.createSession(yt,St),e.releaseSession=async yt=>{if(b())return ct(),new Promise((St,bt)=>{at.push([St,bt]);const Tt={type:"release",in:yt};a.postMessage(Tt)});nt.releaseSession(yt)},e.run=async(yt,St,bt,Tt,vt)=>b()?(ct(),new Promise(($t,At)=>{ut.push([$t,At]);const Ot={type:"run",in:{sessionId:yt,inputIndices:St,inputs:bt,outputIndices:Tt,options:vt}};a.postMessage(Ot,nt.extractTransferableBuffers(bt))})):nt.run(yt,St,bt,Tt,vt),e.endProfiling=async yt=>{if(b())return ct(),new Promise((St,bt)=>{lt.push([St,bt]);const Tt={type:"end-profiling",in:yt};a.postMessage(Tt)});nt.endProfiling(yt)}},586:(i,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.setRunOptions=void 0;const c=s(7967),h=s(4983),$=s(6361);e.setRunOptions=_=>{const j=(0,$.getInstance)();let nt=0;const et=[],b=_||{};try{if((_==null?void 0:_.logSeverityLevel)===void 0)b.logSeverityLevel=2;else if(typeof _.logSeverityLevel!="number"||!Number.isInteger(_.logSeverityLevel)||_.logSeverityLevel<0||_.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${_.logSeverityLevel}`);if((_==null?void 0:_.logVerbosityLevel)===void 0)b.logVerbosityLevel=0;else if(typeof _.logVerbosityLevel!="number"||!Number.isInteger(_.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${_.logVerbosityLevel}`);(_==null?void 0:_.terminate)===void 0&&(b.terminate=!1);let a=0;if((_==null?void 0:_.tag)!==void 0&&(a=(0,h.allocWasmString)(_.tag,et)),nt=j._OrtCreateRunOptions(b.logSeverityLevel,b.logVerbosityLevel,!!b.terminate,a),nt===0)throw new Error("Can't create run options");return(_==null?void 0:_.extra)!==void 0&&(0,c.iterateExtraOptions)(_.extra,"",new WeakSet,(o,d)=>{const g=(0,h.allocWasmString)(o,et),rt=(0,h.allocWasmString)(d,et);if(j._OrtAddRunConfigEntry(nt,g,rt)!==0)throw new Error(`Can't set a run config entry: ${o} - ${d}`)}),[nt,et]}catch(a){throw nt!==0&&j._OrtReleaseRunOptions(nt),et.forEach(j._free),a}}},2306:(i,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.OnnxruntimeWebAssemblySessionHandler=void 0;const c=s(2806),h=s(1670),$=s(2850),_=s(2157);let j;e.OnnxruntimeWebAssemblySessionHandler=class{async createSessionAllocate(nt){const et=await fetch(nt),b=await et.arrayBuffer();return(0,_.createSessionAllocate)(new Uint8Array(b))}async loadModel(nt,et){if(j||(await(0,_.initOrt)(h.env.wasm.numThreads,(b=>{switch(b){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: ${b}`)}})(h.env.logLevel)),j=!0),typeof nt=="string")if(typeof fetch>"u"){const b=await(0,$.promisify)(c.readFile)(nt);[this.sessionId,this.inputNames,this.outputNames]=await(0,_.createSession)(b,et)}else{const b=await this.createSessionAllocate(nt);[this.sessionId,this.inputNames,this.outputNames]=await(0,_.createSessionFinalize)(b,et)}else[this.sessionId,this.inputNames,this.outputNames]=await(0,_.createSession)(nt,et)}async dispose(){return(0,_.releaseSession)(this.sessionId)}async run(nt,et,b){const a=[],o=[];Object.entries(nt).forEach(st=>{const tt=st[0],ot=st[1],it=this.inputNames.indexOf(tt);if(it===-1)throw new Error(`invalid input '${tt}'`);a.push(ot),o.push(it)});const d=[];Object.entries(et).forEach(st=>{const tt=st[0],ot=this.outputNames.indexOf(tt);if(ot===-1)throw new Error(`invalid output '${tt}'`);d.push(ot)});const g=await(0,_.run)(this.sessionId,o,a.map(st=>[st.type,st.dims,st.data]),d,b),rt={};for(let st=0;st<g.length;st++)rt[this.outputNames[d[st]]]=new h.Tensor(g[st][0],g[st][2],g[st][1]);return rt}startProfiling(){}endProfiling(){(0,_.endProfiling)(this.sessionId)}}},4919:(i,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.setSessionOptions=void 0;const c=s(7967),h=s(4983),$=s(6361);e.setSessionOptions=_=>{const j=(0,$.getInstance)();let nt=0;const et=[],b=_||{};(a=>{a.extra||(a.extra={}),a.extra.session||(a.extra.session={});const o=a.extra.session;o.use_ort_model_bytes_directly||(o.use_ort_model_bytes_directly="1")})(b);try{(_==null?void 0:_.graphOptimizationLevel)===void 0&&(b.graphOptimizationLevel="all");const a=(g=>{switch(g){case"disabled":return 0;case"basic":return 1;case"extended":return 2;case"all":return 99;default:throw new Error(`unsupported graph optimization level: ${g}`)}})(b.graphOptimizationLevel);(_==null?void 0:_.enableCpuMemArena)===void 0&&(b.enableCpuMemArena=!0),(_==null?void 0:_.enableMemPattern)===void 0&&(b.enableMemPattern=!0),(_==null?void 0:_.executionMode)===void 0&&(b.executionMode="sequential");const o=(g=>{switch(g){case"sequential":return 0;case"parallel":return 1;default:throw new Error(`unsupported execution mode: ${g}`)}})(b.executionMode);let d=0;if((_==null?void 0:_.logId)!==void 0&&(d=(0,h.allocWasmString)(_.logId,et)),(_==null?void 0:_.logSeverityLevel)===void 0)b.logSeverityLevel=2;else if(typeof _.logSeverityLevel!="number"||!Number.isInteger(_.logSeverityLevel)||_.logSeverityLevel<0||_.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${_.logSeverityLevel}`);if((_==null?void 0:_.logVerbosityLevel)===void 0)b.logVerbosityLevel=0;else if(typeof _.logVerbosityLevel!="number"||!Number.isInteger(_.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${_.logVerbosityLevel}`);if((_==null?void 0:_.enableProfiling)===void 0&&(b.enableProfiling=!1),nt=j._OrtCreateSessionOptions(a,!!b.enableCpuMemArena,!!b.enableMemPattern,o,!!b.enableProfiling,0,d,b.logSeverityLevel,b.logVerbosityLevel),nt===0)throw new Error("Can't create session options");return _!=null&&_.executionProviders&&((g,rt,st)=>{for(const tt of rt){let ot=typeof tt=="string"?tt:tt.name;switch(ot){case"xnnpack":ot="XNNPACK";break;case"wasm":case"cpu":continue;default:throw new Error(`not supported EP: ${ot}`)}const it=(0,h.allocWasmString)(ot,st);if((0,$.getInstance)()._OrtAppendExecutionProvider(g,it)!==0)throw new Error(`Can't append execution provider: ${ot}`)}})(nt,_.executionProviders,et),(_==null?void 0:_.extra)!==void 0&&(0,c.iterateExtraOptions)(_.extra,"",new WeakSet,(g,rt)=>{const st=(0,h.allocWasmString)(g,et),tt=(0,h.allocWasmString)(rt,et);if(j._OrtAddSessionConfigEntry(nt,st,tt)!==0)throw new Error(`Can't set a session config entry: ${g} - ${rt}`)}),[nt,et]}catch(a){throw nt!==0&&j._OrtReleaseSessionOptions(nt),et.forEach(j._free),a}}},4983:(i,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.allocWasmString=void 0;const c=s(6361);e.allocWasmString=(h,$)=>{const _=(0,c.getInstance)(),j=_.lengthBytesUTF8(h)+1,nt=_._malloc(j);return _.stringToUTF8(h,nt,j),$.push(nt),nt}},349:(i,e,s)=>{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 c=s(586),h=s(4919),$=s(4983),_=s(6361);e.initOrt=(a,o)=>{const d=(0,_.getInstance)()._OrtInit(a,o);if(d!==0)throw new Error(`Can't initialize onnxruntime. error code = ${d}`)};const j=new Map;e.createSessionAllocate=a=>{const o=(0,_.getInstance)(),d=o._malloc(a.byteLength);return o.HEAPU8.set(a,d),[d,a.byteLength]},e.createSessionFinalize=(a,o)=>{const d=(0,_.getInstance)();let g=0,rt=0,st=[];try{if([rt,st]=(0,h.setSessionOptions)(o),g=d._OrtCreateSession(a[0],a[1],rt),g===0)throw new Error("Can't create a session")}finally{d._free(a[0]),d._OrtReleaseSessionOptions(rt),st.forEach(d._free)}const tt=d._OrtGetInputCount(g),ot=d._OrtGetOutputCount(g),it=[],at=[],ut=[],lt=[];for(let ct=0;ct<tt;ct++){const ft=d._OrtGetInputName(g,ct);if(ft===0)throw new Error("Can't get an input name");at.push(ft),it.push(d.UTF8ToString(ft))}for(let ct=0;ct<ot;ct++){const ft=d._OrtGetOutputName(g,ct);if(ft===0)throw new Error("Can't get an output name");lt.push(ft),ut.push(d.UTF8ToString(ft))}return j.set(g,[g,at,lt]),[g,it,ut]},e.createSession=(a,o)=>{const d=(0,e.createSessionAllocate)(a);return(0,e.createSessionFinalize)(d,o)},e.releaseSession=a=>{const o=(0,_.getInstance)(),d=j.get(a);if(!d)throw new Error("invalid session id");const g=d[0],rt=d[1],st=d[2];rt.forEach(o._OrtFree),st.forEach(o._OrtFree),o._OrtReleaseSession(g),j.delete(a)};const nt=a=>{switch(a){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: ${a}`)}},et=a=>{switch(a){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: ${a}`)}},b=a=>{switch(a){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: ${a}`)}};e.run=(a,o,d,g,rt)=>{const st=(0,_.getInstance)(),tt=j.get(a);if(!tt)throw new Error("invalid session id");const ot=tt[0],it=tt[1],at=tt[2],ut=o.length,lt=g.length;let ct=0,ft=[];const dt=[],yt=[];try{[ct,ft]=(0,c.setRunOptions)(rt);for(let At=0;At<ut;At++){const Ot=d[At][0],It=d[At][1],jt=d[At][2];let Et,mt;if(Array.isArray(jt)){mt=4*jt.length,Et=st._malloc(mt),yt.push(Et);let pt=Et/4;for(let _t=0;_t<jt.length;_t++){if(typeof jt[_t]!="string")throw new TypeError(`tensor data at index ${_t} is not a string`);st.HEAPU32[pt++]=(0,$.allocWasmString)(jt[_t],yt)}}else mt=jt.byteLength,Et=st._malloc(mt),yt.push(Et),st.HEAPU8.set(new Uint8Array(jt.buffer,jt.byteOffset,mt),Et);const gt=st.stackSave(),ht=st.stackAlloc(4*It.length);try{let pt=ht/4;It.forEach(Ct=>st.HEAP32[pt++]=Ct);const _t=st._OrtCreateTensor(nt(Ot),Et,mt,ht,It.length);if(_t===0)throw new Error("Can't create a tensor");dt.push(_t)}finally{st.stackRestore(gt)}}const St=st.stackSave(),bt=st.stackAlloc(4*ut),Tt=st.stackAlloc(4*ut),vt=st.stackAlloc(4*lt),$t=st.stackAlloc(4*lt);try{let At=bt/4,Ot=Tt/4,It=vt/4,jt=$t/4;for(let gt=0;gt<ut;gt++)st.HEAPU32[At++]=dt[gt],st.HEAPU32[Ot++]=it[o[gt]];for(let gt=0;gt<lt;gt++)st.HEAPU32[It++]=0,st.HEAPU32[jt++]=at[g[gt]];let Et=st._OrtRun(ot,Tt,bt,ut,$t,lt,vt,ct);const mt=[];if(Et===0)for(let gt=0;gt<lt;gt++){const ht=st.HEAPU32[vt/4+gt],pt=st.stackSave(),_t=st.stackAlloc(16);let Ct,zt=0;try{if(Et=st._OrtGetTensorData(ht,_t,_t+4,_t+8,_t+12),Et!==0)throw new Error(`Can't access output tensor data. error code = ${Et}`);let Nt=_t/4;const Ht=st.HEAPU32[Nt++];zt=st.HEAPU32[Nt++];const Jt=st.HEAPU32[Nt++],un=st.HEAPU32[Nt++],yn=[];for(let mn=0;mn<un;mn++)yn.push(st.HEAPU32[Jt/4+mn]);st._OrtFree(Jt);const vn=yn.length===0?1:yn.reduce((mn,Tn)=>mn*Tn);if(Ct=et(Ht),Ct==="string"){const mn=[];let Tn=zt/4;for(let Pn=0;Pn<vn;Pn++){const Gn=st.HEAPU32[Tn++],wr=Pn===vn-1?void 0:st.HEAPU32[Tn]-Gn;mn.push(st.UTF8ToString(Gn,wr))}mt.push([Ct,yn,mn])}else{const mn=new(b(Ct))(vn);new Uint8Array(mn.buffer,mn.byteOffset,mn.byteLength).set(st.HEAPU8.subarray(zt,zt+mn.byteLength)),mt.push([Ct,yn,mn])}}finally{st.stackRestore(pt),Ct==="string"&&zt&&st._free(zt),st._OrtReleaseTensor(ht)}}if(Et===0)return mt;throw new Error(`failed to call OrtRun(). error code = ${Et}.`)}finally{st.stackRestore(St)}}finally{dt.forEach(st._OrtReleaseTensor),yt.forEach(st._free),st._OrtReleaseRunOptions(ct),ft.forEach(st._free)}},e.endProfiling=a=>{const o=(0,_.getInstance)(),d=j.get(a);if(!d)throw new Error("invalid session id");const g=d[0],rt=o._OrtEndProfiling(g);if(rt===0)throw new Error("Can't get an profile file name");o._OrtFree(rt)},e.extractTransferableBuffers=a=>{const o=[];for(const d of a){const g=d[2];!Array.isArray(g)&&g.buffer&&o.push(g.buffer)}return o}},6361:function(i,e,s){var c=this&&this.__createBinding||(Object.create?function(rt,st,tt,ot){ot===void 0&&(ot=tt);var it=Object.getOwnPropertyDescriptor(st,tt);it&&!("get"in it?!st.__esModule:it.writable||it.configurable)||(it={enumerable:!0,get:function(){return st[tt]}}),Object.defineProperty(rt,ot,it)}:function(rt,st,tt,ot){ot===void 0&&(ot=tt),rt[ot]=st[tt]}),h=this&&this.__setModuleDefault||(Object.create?function(rt,st){Object.defineProperty(rt,"default",{enumerable:!0,value:st})}:function(rt,st){rt.default=st}),$=this&&this.__importStar||function(rt){if(rt&&rt.__esModule)return rt;var st={};if(rt!=null)for(var tt in rt)tt!=="default"&&Object.prototype.hasOwnProperty.call(rt,tt)&&c(st,rt,tt);return h(st,rt),st},_=this&&this.__importDefault||function(rt){return rt&&rt.__esModule?rt:{default:rt}};Object.defineProperty(e,"__esModule",{value:!0}),e.dispose=e.getInstance=e.initializeWebAssembly=void 0;const j=$(s(6449)),nt=_(s(932)),et=s(3474);let b,a=!1,o=!1,d=!1;const g=(rt,st)=>st?rt?"ort-wasm-simd-threaded.wasm":"ort-wasm-threaded.wasm":rt?"ort-wasm-simd.wasm":"ort-wasm.wasm";e.initializeWebAssembly=async rt=>{if(a)return Promise.resolve();if(o)throw new Error("multiple calls to 'initializeWebAssembly()' detected.");if(d)throw new Error("previous call to 'initializeWebAssembly()' failed.");o=!0;const st=rt.initTimeout,tt=rt.numThreads,ot=rt.simd,it=tt>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}})(),at=ot&&(()=>{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}})(),ut=typeof rt.wasmPaths=="string"?rt.wasmPaths:void 0,lt=g(!1,it),ct=g(at,it),ft=typeof rt.wasmPaths=="object"?rt.wasmPaths[ct]:void 0;let dt=!1;const yt=[];if(st>0&&yt.push(new Promise(St=>{setTimeout(()=>{dt=!0,St()},st)})),yt.push(new Promise((St,bt)=>{const Tt=it?et:nt.default,vt={locateFile:($t,At)=>it&&$t.endsWith(".worker.js")&&typeof Blob<"u"?URL.createObjectURL(new Blob([s(4154)],{type:"text/javascript"})):$t===lt?ft??(ut??At)+ct:At+$t};if(it)if(typeof Blob>"u")vt.mainScriptUrlOrBlob=j.join("/","ort-wasm-threaded.js");else{const $t=`var ortWasmThreaded=(function(){var _scriptDir;return ${Tt.toString()}})();`;vt.mainScriptUrlOrBlob=new Blob([$t],{type:"text/javascript"})}Tt(vt).then($t=>{o=!1,a=!0,b=$t,St()},$t=>{o=!1,d=!0,bt($t)})})),await Promise.race(yt),dt)throw new Error(`WebAssembly backend initializing failed due to timeout: ${st}ms`)},e.getInstance=()=>{if(a&&b)return b;throw new Error("WebAssembly is not initialized yet.")},e.dispose=()=>{var rt;!a||o||d||(o=!0,(rt=b.PThread)===null||rt===void 0||rt.terminateAllThreads(),b=void 0,o=!1,a=!1,d=!0)}},9710:(i,e,s)=>{s.d(e,{Z:()=>$});var c=s(477),h=s.n(c);function $(){return h()('/*!\n* ONNX Runtime Web v1.14.0\n* Copyright (c) Microsoft Corporation. All rights reserved.\n* Licensed under the MIT License.\n*/\n(()=>{var t={474:(t,e,n)=>{var _scriptDir,r=(_scriptDir=(_scriptDir="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(t){function e(){return j.buffer!=D&&N(j.buffer),P}function r(){return j.buffer!=D&&N(j.buffer),U}function a(){return j.buffer!=D&&N(j.buffer),F}function i(){return j.buffer!=D&&N(j.buffer),I}function o(){return j.buffer!=D&&N(j.buffer),W}var u,c,s;t=t||{},u||(u=void 0!==t?t:{}),u.ready=new Promise((function(t,e){c=t,s=e}));var l,f,p,h,d,y,b=Object.assign({},u),m="./this.program",g=(t,e)=>{throw e},v="object"==typeof window,w="function"==typeof importScripts,_="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,O=u.ENVIRONMENT_IS_PTHREAD||!1,A="";function S(t){return u.locateFile?u.locateFile(t,A):A+t}if(_){let e;A=w?n(908).dirname(A)+"/":"//",y=()=>{d||(h=n(384),d=n(908))},l=function(t,e){return y(),t=d.normalize(t),h.readFileSync(t,e?void 0:"utf8")},p=t=>((t=l(t,!0)).buffer||(t=new Uint8Array(t)),t),f=(t,e,n)=>{y(),t=d.normalize(t),h.readFile(t,(function(t,r){t?n(t):e(r.buffer)}))},1<process.argv.length&&(m=process.argv[1].replace(/\\\\/g,"/")),process.argv.slice(2),process.on("uncaughtException",(function(t){if(!(t instanceof ct))throw t})),process.on("unhandledRejection",(function(t){throw t})),g=(t,e)=>{if(Q())throw process.exitCode=t,e;e instanceof ct||x("exiting due to exception: "+e),process.exit(t)},u.inspect=function(){return"[Emscripten Module object]"};try{e=n(925)}catch(t){throw console.error(\'The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?\'),t}n.g.Worker=e.Worker}else(v||w)&&(w?A=self.location.href:"undefined"!=typeof document&&document.currentScript&&(A=document.currentScript.src),_scriptDir&&(A=_scriptDir),A=0!==A.indexOf("blob:")?A.substr(0,A.replace(/[?#].*/,"").lastIndexOf("/")+1):"",_||(l=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},w&&(p=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),f=(t,e,n)=>{var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?e(r.response):n()},r.onerror=n,r.send(null)}));_&&"undefined"==typeof performance&&(n.g.performance=n(953).performance);var T=console.log.bind(console),E=console.warn.bind(console);_&&(y(),T=t=>h.writeSync(1,t+"\\n"),E=t=>h.writeSync(2,t+"\\n"));var M,C=u.print||T,x=u.printErr||E;Object.assign(u,b),b=null,u.thisProgram&&(m=u.thisProgram),u.quit&&(g=u.quit),u.wasmBinary&&(M=u.wasmBinary);var R=u.noExitRuntime||!1;"object"!=typeof WebAssembly&&at("no native wasm support detected");var j,k,D,P,U,F,I,W,H=!1,L="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function z(t,e,n){var r=(e>>>=0)+n;for(n=e;t[n]&&!(n>=r);)++n;if(16<n-e&&t.buffer&&L)return L.decode(t.buffer instanceof SharedArrayBuffer?t.slice(e,n):t.subarray(e,n));for(r="";e<n;){var a=t[e++];if(128&a){var i=63&t[e++];if(192==(224&a))r+=String.fromCharCode((31&a)<<6|i);else{var o=63&t[e++];65536>(a=224==(240&a)?(15&a)<<12|i<<6|o:(7&a)<<18|i<<12|o<<6|63&t[e++])?r+=String.fromCharCode(a):(a-=65536,r+=String.fromCharCode(55296|a>>10,56320|1023&a))}}else r+=String.fromCharCode(a)}return r}function Y(t,e){return(t>>>=0)?z(r(),t,e):""}function B(t,e,n,r){if(!(0<r))return 0;var a=n>>>=0;r=n+r-1;for(var i=0;i<t.length;++i){var o=t.charCodeAt(i);if(55296<=o&&57343>=o&&(o=65536+((1023&o)<<10)|1023&t.charCodeAt(++i)),127>=o){if(n>=r)break;e[n++>>>0]=o}else{if(2047>=o){if(n+1>=r)break;e[n++>>>0]=192|o>>6}else{if(65535>=o){if(n+2>=r)break;e[n++>>>0]=224|o>>12}else{if(n+3>=r)break;e[n++>>>0]=240|o>>18,e[n++>>>0]=128|o>>12&63}e[n++>>>0]=128|o>>6&63}e[n++>>>0]=128|63&o}}return e[n>>>0]=0,n-a}function G(t){for(var e=0,n=0;n<t.length;++n){var r=t.charCodeAt(n);127>=r?e++:2047>=r?e+=2:55296<=r&&57343>=r?(e+=4,++n):e+=3}return e}function N(t){D=t,u.HEAP8=P=new Int8Array(t),u.HEAP16=new Int16Array(t),u.HEAP32=F=new Int32Array(t),u.HEAPU8=U=new Uint8Array(t),u.HEAPU16=new Uint16Array(t),u.HEAPU32=I=new Uint32Array(t),u.HEAPF32=new Float32Array(t),u.HEAPF64=W=new Float64Array(t)}O&&(D=u.buffer);var V=u.INITIAL_MEMORY||16777216;if(O)j=u.wasmMemory,D=u.buffer;else if(u.wasmMemory)j=u.wasmMemory;else if(!((j=new WebAssembly.Memory({initial:V/65536,maximum:65536,shared:!0})).buffer instanceof SharedArrayBuffer))throw x("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag"),_&&console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)"),Error("bad memory");j&&(D=j.buffer),V=D.byteLength,N(D);var $,q=[],X=[],J=[],Z=[];function Q(){return R||!1}function K(){var t=u.preRun.shift();q.unshift(t)}var tt,et=0,nt=null,rt=null;function at(t){throw O?postMessage({cmd:"onAbort",arg:t}):u.onAbort&&u.onAbort(t),x(t="Aborted("+t+")"),H=!0,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),s(t),t}function it(){return tt.startsWith("data:application/octet-stream;base64,")}function ot(){var t=tt;try{if(t==tt&&M)return new Uint8Array(M);if(p)return p(t);throw"both async and sync fetching of the wasm failed"}catch(t){at(t)}}tt="ort-wasm-threaded.wasm",it()||(tt=S(tt));var ut={};function ct(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function st(t){(t=ht.Vb[t])||at(),ht.mc(t)}function lt(t){var e=ht.Cc();if(!e)return 6;ht.ac.push(e),ht.Vb[t.Ub]=e,e.Ub=t.Ub;var n={cmd:"run",start_routine:t.Ic,arg:t.zc,pthread_ptr:t.Ub};return e.$b=()=>{n.time=performance.now(),e.postMessage(n,t.Nc)},e.loaded&&(e.$b(),delete e.$b),0}function ft(t){if(O)return $t(1,1,t);Q()||(ht.oc(),u.onExit&&u.onExit(t),H=!0),g(t,new ct(t))}function pt(t,e){if(!e&&O)throw bt(t),"unwind";Q()||O||(me(),dt(J),be(0),re[1].length&&ae(1,10),re[2].length&&ae(2,10),ht.oc()),ft(t)}var ht={Yb:[],ac:[],qc:[],Vb:{},fc:function(){O&&ht.Ec()},Pc:function(){},Ec:function(){ht.receiveObjectTransfer=ht.Gc,ht.threadInitTLS=ht.pc,ht.setExitStatus=ht.nc,R=!1},nc:function(){},oc:function(){for(var t of Object.values(ht.Vb))ht.mc(t);for(t of ht.Yb)t.terminate();ht.Yb=[]},mc:function(t){var e=t.Ub;delete ht.Vb[e],ht.Yb.push(t),ht.ac.splice(ht.ac.indexOf(t),1),t.Ub=0,Oe(e)},Gc:function(){},pc:function(){ht.qc.forEach((t=>t()))},Fc:function(t,e){t.onmessage=n=>{var r=(n=n.data).cmd;if(t.Ub&&(ht.Bc=t.Ub),n.targetThread&&n.targetThread!=he()){var a=ht.Vb[n.Qc];a?a.postMessage(n,n.transferList):x(\'Internal error! Worker sent a message "\'+r+\'" to target pthread \'+n.targetThread+", but that thread no longer exists!")}else"processProxyingQueue"===r?zt(n.queue):"spawnThread"===r?lt(n):"cleanupThread"===r?st(n.thread):"killThread"===r?(n=n.thread,r=ht.Vb[n],delete ht.Vb[n],r.terminate(),Oe(n),ht.ac.splice(ht.ac.indexOf(r),1),r.Ub=0):"cancelThread"===r?ht.Vb[n.thread].postMessage({cmd:"cancel"}):"loaded"===r?(t.loaded=!0,e&&e(t),t.$b&&(t.$b(),delete t.$b)):"print"===r?C("Thread "+n.threadId+": "+n.text):"printErr"===r?x("Thread "+n.threadId+": "+n.text):"alert"===r?alert("Thread "+n.threadId+": "+n.text):"setimmediate"===n.target?t.postMessage(n):"onAbort"===r?u.onAbort&&u.onAbort(n.arg):r&&x("worker sent an unknown command "+r);ht.Bc=void 0},t.onerror=t=>{throw x("worker sent an error! "+t.filename+":"+t.lineno+": "+t.message),t},_&&(t.on("message",(function(e){t.onmessage({data:e})})),t.on("error",(function(e){t.onerror(e)})),t.on("detachedExit",(function(){}))),t.postMessage({cmd:"load",urlOrBlob:u.mainScriptUrlOrBlob||_scriptDir,wasmMemory:j,wasmModule:k})},yc:function(){var t=S("ort-wasm-threaded.worker.js");ht.Yb.push(new Worker(t))},Cc:function(){return 0==ht.Yb.length&&(ht.yc(),ht.Fc(ht.Yb[0])),ht.Yb.pop()}};function dt(t){for(;0<t.length;)t.shift()(u)}function yt(t){var e=Ee();return t=t(),Me(e),t}function bt(t){if(O)return $t(2,0,t);try{pt(t)}catch(t){t instanceof ct||"unwind"==t||g(1,t)}}u.PThread=ht,u.establishStackSpace=function(){var t=he(),e=a()[t+44>>2>>>0];t=a()[t+48>>2>>>0],Te(e,e-t),Me(e)};var mt=[];function gt(t){var e=mt[t];return e||(t>=mt.length&&(mt.length=t+1),mt[t]=e=$.get(t)),e}u.invokeEntryPoint=function(t,e){t=gt(t)(e),Q()?ht.nc(t):Ae(t)};var vt,wt,_t=[],Ot=0,At=0;function St(t){this.Zb=t,this.Sb=t-24,this.xc=function(t){i()[this.Sb+4>>2>>>0]=t},this.bc=function(){return i()[this.Sb+4>>2>>>0]},this.wc=function(t){i()[this.Sb+8>>2>>>0]=t},this.Dc=function(){return i()[this.Sb+8>>2>>>0]},this.rc=function(){a()[this.Sb>>2>>>0]=0},this.hc=function(t){t=t?1:0,e()[this.Sb+12>>0>>>0]=t},this.uc=function(){return 0!=e()[this.Sb+12>>0>>>0]},this.ic=function(t){t=t?1:0,e()[this.Sb+13>>0>>>0]=t},this.kc=function(){return 0!=e()[this.Sb+13>>0>>>0]},this.fc=function(t,e){this.cc(0),this.xc(t),this.wc(e),this.rc(),this.hc(!1),this.ic(!1)},this.sc=function(){Atomics.add(a(),this.Sb>>2,1)},this.Hc=function(){return 1===Atomics.sub(a(),this.Sb>>2,1)},this.cc=function(t){i()[this.Sb+16>>2>>>0]=t},this.tc=function(){return i()[this.Sb+16>>2>>>0]},this.vc=function(){if(Re(this.bc()))return i()[this.Zb>>2>>>0];var t=this.tc();return 0!==t?t:this.Zb}}function Tt(t){return ye(new St(t).Sb)}function Et(t,e,n,r){return O?$t(3,1,t,e,n,r):Mt(t,e,n,r)}function Mt(t,e,n,r){if("undefined"==typeof SharedArrayBuffer)return x("Current environment does not support SharedArrayBuffer, pthreads are not available!"),6;var a=[];return O&&0===a.length?Et(t,e,n,r):(t={Ic:n,Ub:t,zc:r,Nc:a},O?(t.Oc="spawnThread",postMessage(t,a),0):lt(t))}function Ct(t,e,n){return O?$t(4,1,t,e,n):0}function xt(t,e){if(O)return $t(5,1,t,e)}function Rt(t,e){if(O)return $t(6,1,t,e)}function jt(t,e,n){if(O)return $t(7,1,t,e,n)}function kt(t,e,n){return O?$t(8,1,t,e,n):0}function Dt(t,e){if(O)return $t(9,1,t,e)}function Pt(t,e,n){if(O)return $t(10,1,t,e,n)}function Ut(t,e,n,r){if(O)return $t(11,1,t,e,n,r)}function Ft(t,e,n,r){if(O)return $t(12,1,t,e,n,r)}function It(t,e,n,r){if(O)return $t(13,1,t,e,n,r)}function Wt(t){if(O)return $t(14,1,t)}function Ht(t,e){if(O)return $t(15,1,t,e)}function Lt(t,e,n){if(O)return $t(16,1,t,e,n)}function zt(t){Atomics.store(a(),t>>2,1),he()&&_e(t),Atomics.compareExchange(a(),t>>2,1,0)}function Yt(t){return i()[t>>>2]+4294967296*a()[t+4>>>2]}function Bt(t,e,n,r,a,i){return O?$t(17,1,t,e,n,r,a,i):-52}function Gt(t,e,n,r,a,i){if(O)return $t(18,1,t,e,n,r,a,i)}function Nt(t){var n=G(t)+1,r=de(n);return r&&B(t,e(),r,n),r}function Vt(t,e,n){function r(t){return(t=t.toTimeString().match(/\\(([A-Za-z ]+)\\)$/))?t[1]:"GMT"}if(O)return $t(19,1,t,e,n);var o=(new Date).getFullYear(),u=new Date(o,0,1),c=new Date(o,6,1);o=u.getTimezoneOffset();var s=c.getTimezoneOffset(),l=Math.max(o,s);a()[t>>2>>>0]=60*l,a()[e>>2>>>0]=Number(o!=s),t=r(u),e=r(c),t=Nt(t),e=Nt(e),s<o?(i()[n>>2>>>0]=t,i()[n+4>>2>>>0]=e):(i()[n>>2>>>0]=e,i()[n+4>>2>>>0]=t)}function $t(t,e){var n=arguments.length-2,r=arguments;return yt((()=>{for(var a=Ce(8*n),i=a>>3,u=0;u<n;u++){var c=r[2+u];o()[i+u>>>0]=c}return we(t,n,a,e)}))}u.executeNotifiedProxyingQueue=zt,wt=_?()=>{var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:O?()=>performance.now()-u.__performance_now_clock_drift:()=>performance.now();var qt,Xt=[],Jt={};function Zt(){if(!qt){var t,e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:m||"./this.program"};for(t in Jt)void 0===Jt[t]?delete e[t]:e[t]=Jt[t];var n=[];for(t in e)n.push(t+"="+e[t]);qt=n}return qt}function Qt(t,n){if(O)return $t(20,1,t,n);var r=0;return Zt().forEach((function(a,o){var u=n+r;for(o=i()[t+4*o>>2>>>0]=u,u=0;u<a.length;++u)e()[o++>>0>>>0]=a.charCodeAt(u);e()[o>>0>>>0]=0,r+=a.length+1})),0}function Kt(t,e){if(O)return $t(21,1,t,e);var n=Zt();i()[t>>2>>>0]=n.length;var r=0;return n.forEach((function(t){r+=t.length+1})),i()[e>>2>>>0]=r,0}function te(t){return O?$t(22,1,t):52}function ee(t,e,n,r){return O?$t(23,1,t,e,n,r):52}function ne(t,e,n,r,a){return O?$t(24,1,t,e,n,r,a):70}var re=[null,[],[]];function ae(t,e){var n=re[t];0===e||10===e?((1===t?C:x)(z(n,0)),n.length=0):n.push(e)}function ie(t,e,n,a){if(O)return $t(25,1,t,e,n,a);for(var o=0,u=0;u<n;u++){var c=i()[e>>2>>>0],s=i()[e+4>>2>>>0];e+=8;for(var l=0;l<s;l++)ae(t,r()[c+l>>>0]);o+=s}return i()[a>>2>>>0]=o,0}var oe=0;function ue(t){return 0==t%4&&(0!=t%100||0==t%400)}var ce=[31,29,31,30,31,30,31,31,30,31,30,31],se=[31,28,31,30,31,30,31,31,30,31,30,31];function le(t,n,r,i){function o(t,e,n){for(t="number"==typeof t?t.toString():t||"";t.length<e;)t=n[0]+t;return t}function u(t,e){return o(t,e,"0")}function c(t,e){function n(t){return 0>t?-1:0<t?1:0}var r;return 0===(r=n(t.getFullYear()-e.getFullYear()))&&0===(r=n(t.getMonth()-e.getMonth()))&&(r=n(t.getDate()-e.getDate())),r}function s(t){switch(t.getDay()){case 0:return new Date(t.getFullYear()-1,11,29);case 1:return t;case 2:return new Date(t.getFullYear(),0,3);case 3:return new Date(t.getFullYear(),0,2);case 4:return new Date(t.getFullYear(),0,1);case 5:return new Date(t.getFullYear()-1,11,31);case 6:return new Date(t.getFullYear()-1,11,30)}}function l(t){var e=t.Wb;for(t=new Date(new Date(t.Xb+1900,0,1).getTime());0<e;){var n=t.getMonth(),r=(ue(t.getFullYear())?ce:se)[n];if(!(e>r-t.getDate())){t.setDate(t.getDate()+e);break}e-=r-t.getDate()+1,t.setDate(1),11>n?t.setMonth(n+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return n=new Date(t.getFullYear()+1,0,4),e=s(new Date(t.getFullYear(),0,4)),n=s(n),0>=c(e,t)?0>=c(n,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var f=a()[i+40>>2>>>0];for(var p in i={Lc:a()[i>>2>>>0],Kc:a()[i+4>>2>>>0],dc:a()[i+8>>2>>>0],jc:a()[i+12>>2>>>0],ec:a()[i+16>>2>>>0],Xb:a()[i+20>>2>>>0],Tb:a()[i+24>>2>>>0],Wb:a()[i+28>>2>>>0],Rc:a()[i+32>>2>>>0],Jc:a()[i+36>>2>>>0],Mc:f?Y(f):""},r=Y(r),f={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})r=r.replace(new RegExp(p,"g"),f[p]);var h="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),d="January February March April May June July August September October November December".split(" ");for(p in f={"%a":function(t){return h[t.Tb].substring(0,3)},"%A":function(t){return h[t.Tb]},"%b":function(t){return d[t.ec].substring(0,3)},"%B":function(t){return d[t.ec]},"%C":function(t){return u((t.Xb+1900)/100|0,2)},"%d":function(t){return u(t.jc,2)},"%e":function(t){return o(t.jc,2," ")},"%g":function(t){return l(t).toString().substring(2)},"%G":function(t){return l(t)},"%H":function(t){return u(t.dc,2)},"%I":function(t){return 0==(t=t.dc)?t=12:12<t&&(t-=12),u(t,2)},"%j":function(t){for(var e=0,n=0;n<=t.ec-1;e+=(ue(t.Xb+1900)?ce:se)[n++]);return u(t.jc+e,3)},"%m":function(t){return u(t.ec+1,2)},"%M":function(t){return u(t.Kc,2)},"%n":function(){return"\\n"},"%p":function(t){return 0<=t.dc&&12>t.dc?"AM":"PM"},"%S":function(t){return u(t.Lc,2)},"%t":function(){return"\\t"},"%u":function(t){return t.Tb||7},"%U":function(t){return u(Math.floor((t.Wb+7-t.Tb)/7),2)},"%V":function(t){var e=Math.floor((t.Wb+7-(t.Tb+6)%7)/7);if(2>=(t.Tb+371-t.Wb-2)%7&&e++,e)53==e&&(4==(n=(t.Tb+371-t.Wb)%7)||3==n&&ue(t.Xb)||(e=1));else{e=52;var n=(t.Tb+7-t.Wb-1)%7;(4==n||5==n&&ue(t.Xb%400-1))&&e++}return u(e,2)},"%w":function(t){return t.Tb},"%W":function(t){return u(Math.floor((t.Wb+7-(t.Tb+6)%7)/7),2)},"%y":function(t){return(t.Xb+1900).toString().substring(2)},"%Y":function(t){return t.Xb+1900},"%z":function(t){var e=0<=(t=t.Jc);return t=Math.abs(t)/60,(e?"+":"-")+String("0000"+(t/60*100+t%60)).slice(-4)},"%Z":function(t){return t.Mc},"%%":function(){return"%"}},r=r.replace(/%%/g,"\\0\\0"),f)r.includes(p)&&(r=r.replace(new RegExp(p,"g"),f[p](i)));return p=function(t){var e=Array(G(t)+1);return B(t,e,0,e.length),e}(r=r.replace(/\\0\\0/g,"%")),p.length>n?0:(function(t,n){e().set(t,n>>>0)}(p,t),p.length-1)}ht.fc();var fe=[null,ft,bt,Et,Ct,xt,Rt,jt,kt,Dt,Pt,Ut,Ft,It,Wt,Ht,Lt,Bt,Gt,Vt,Qt,Kt,te,ee,ne,ie],pe={b:function(t){return de(t+24)+24},n:function(t){return(t=new St(t)).uc()||(t.hc(!0),Ot--),t.ic(!1),_t.push(t),t.sc(),t.vc()},ma:function(t){throw x("Unexpected exception thrown, this is not properly supported - aborting"),H=!0,t},x:function(){Se(0);var t=_t.pop();if(t.Hc()&&!t.kc()){var e=t.Dc();e&>(e)(t.Zb),Tt(t.Zb)}At=0},e:function(){var t=At;if(!t)return oe=0;var e=new St(t);e.cc(t);var n=e.bc();if(!n)return oe=0,t;for(var r=Array.prototype.slice.call(arguments),a=0;a<r.length;a++){var i=r[a];if(0===i||i===n)break;if(xe(i,n,e.Sb+16))return oe=i,t}return oe=n,t},l:function(){var t=At;if(!t)return oe=0;var e=new St(t);e.cc(t);var n=e.bc();if(!n)return oe=0,t;for(var r=Array.prototype.slice.call(arguments),a=0;a<r.length;a++){var i=r[a];if(0===i||i===n)break;if(xe(i,n,e.Sb+16))return oe=i,t}return oe=n,t},h:function(){var t=At;if(!t)return oe=0;var e=new St(t);e.cc(t);var n=e.bc();if(!n)return oe=0,t;for(var r=Array.prototype.slice.call(arguments),a=0;a<r.length;a++){var i=r[a];if(0===i||i===n)break;if(xe(i,n,e.Sb+16))return oe=i,t}return oe=n,t},t:Tt,M:function(){var t=_t.pop();t||at("no exception to throw");var e=t.Zb;throw t.kc()||(_t.push(t),t.ic(!0),t.hc(!1),Ot++),At=e,e},c:function(t,e,n){throw new St(t).fc(e,n),At=t,Ot++,t},pa:function(){return Ot},Fa:function(t){ge(t,!w,1,!v),ht.pc()},T:function(t){O?postMessage({cmd:"cleanupThread",thread:t}):st(t)},xa:Mt,j:function(t){throw At||(At=t),t},H:Ct,Ma:xt,ua:Rt,wa:jt,oa:kt,Ka:Dt,Ca:Pt,Ja:Ut,V:Ft,va:It,sa:Wt,La:Ht,ta:Lt,Ta:function(){},X:function(){at("To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking")},Ua:function(){at("To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking")},W:function(){return Date.now()},ya:function(){return 2097152},Oa:function(){return!0},za:function(t,e,n,r){if(t==e)setTimeout((()=>zt(r)));else if(O)postMessage({targetThread:t,cmd:"processProxyingQueue",queue:r});else{if(!(t=ht.Vb[t]))return;t.postMessage({cmd:"processProxyingQueue",queue:r})}return 1},Ea:function(){return-1},Pa:function(t,e){t=new Date(1e3*Yt(t)),a()[e>>2>>>0]=t.getUTCSeconds(),a()[e+4>>2>>>0]=t.getUTCMinutes(),a()[e+8>>2>>>0]=t.getUTCHours(),a()[e+12>>2>>>0]=t.getUTCDate(),a()[e+16>>2>>>0]=t.getUTCMonth(),a()[e+20>>2>>>0]=t.getUTCFullYear()-1900,a()[e+24>>2>>>0]=t.getUTCDay(),t=(t.getTime()-Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,a()[e+28>>2>>>0]=t},Qa:function(t,e){t=new Date(1e3*Yt(t)),a()[e>>2>>>0]=t.getSeconds(),a()[e+4>>2>>>0]=t.getMinutes(),a()[e+8>>2>>>0]=t.getHours(),a()[e+12>>2>>>0]=t.getDate(),a()[e+16>>2>>>0]=t.getMonth(),a()[e+20>>2>>>0]=t.getFullYear()-1900,a()[e+24>>2>>>0]=t.getDay();var n=new Date(t.getFullYear(),0,1),r=(t.getTime()-n.getTime())/864e5|0;a()[e+28>>2>>>0]=r,a()[e+36>>2>>>0]=-60*t.getTimezoneOffset(),r=new Date(t.getFullYear(),6,1).getTimezoneOffset(),t=0|(r!=(n=n.getTimezoneOffset())&&t.getTimezoneOffset()==Math.min(n,r)),a()[e+32>>2>>>0]=t},Ra:function(t){var e=new Date(a()[t+20>>2>>>0]+1900,a()[t+16>>2>>>0],a()[t+12>>2>>>0],a()[t+8>>2>>>0],a()[t+4>>2>>>0],a()[t>>2>>>0],0),n=a()[t+32>>2>>>0],r=e.getTimezoneOffset(),i=new Date(e.getFullYear(),0,1),o=new Date(e.getFullYear(),6,1).getTimezoneOffset(),u=i.getTimezoneOffset(),c=Math.min(u,o);return 0>n?a()[t+32>>2>>>0]=Number(o!=u&&c==r):0<n!=(c==r)&&(o=Math.max(u,o),e.setTime(e.getTime()+6e4*((0<n?c:o)-r))),a()[t+24>>2>>>0]=e.getDay(),n=(e.getTime()-i.getTime())/864e5|0,a()[t+28>>2>>>0]=n,a()[t>>2>>>0]=e.getSeconds(),a()[t+4>>2>>>0]=e.getMinutes(),a()[t+8>>2>>>0]=e.getHours(),a()[t+12>>2>>>0]=e.getDate(),a()[t+16>>2>>>0]=e.getMonth(),e.getTime()/1e3|0},Aa:Bt,Ba:Gt,Sa:function t(e,n,r){t.Ac||(t.Ac=!0,Vt(e,n,r))},y:function(){at("")},U:function(){if(!_&&!w){var t="Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread";vt||(vt={}),vt[t]||(vt[t]=1,_&&(t="warning: "+t),x(t))}},ra:function(){return 4294901760},B:wt,Ia:function(t,e,n){r().copyWithin(t>>>0,e>>>0,e+n>>>0)},F:function(){return _?n(993).cpus().length:navigator.hardwareConcurrency},Da:function(t,e,n){Xt.length=e,n>>=3;for(var r=0;r<e;r++)Xt[r]=o()[n+r>>>0];return(0>t?ut[-t-1]:fe[t]).apply(null,Xt)},qa:function(t){var e=r().length;if((t>>>=0)<=e||4294901760<t)return!1;for(var n=1;4>=n;n*=2){var a=e*(1+.2/n);a=Math.min(a,t+100663296);var i=Math;a=Math.max(t,a),i=i.min.call(i,4294901760,a+(65536-a%65536)%65536);t:{try{j.grow(i-D.byteLength+65535>>>16),N(j.buffer);var o=1;break t}catch(t){}o=void 0}if(o)return!0}return!1},Na:function(){throw"unwind"},Ga:Qt,Ha:Kt,J:pt,I:te,S:ee,ga:ne,R:ie,d:function(){return oe},na:function t(r,a){t.lc||(t.lc=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var t=new Uint8Array(1);return()=>(crypto.getRandomValues(t),t[0])}if(_)try{var e=n(Object(function(){var t=new Error("Cannot find module \'crypto\'");throw t.code="MODULE_NOT_FOUND",t}()));return()=>e.randomBytes(1)[0]}catch(t){}return()=>at("randomDevice")}());for(var i=0;i<a;i++)e()[r+i>>0>>>0]=t.lc();return 0},ia:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},ja:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},K:function(t){var e=Ee();try{return gt(t)()}catch(t){if(Me(e),t!==t+0)throw t;Se(1,0)}},f:function(t,e){var n=Ee();try{return gt(t)(e)}catch(t){if(Me(n),t!==t+0)throw t;Se(1,0)}},P:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},Q:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},k:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},p:function(t,e,n,r){var a=Ee();try{return gt(t)(e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Se(1,0)}},q:function(t,e,n,r,a){var i=Ee();try{return gt(t)(e,n,r,a)}catch(t){if(Me(i),t!==t+0)throw t;Se(1,0)}},N:function(t,e,n,r,a,i){var o=Ee();try{return gt(t)(e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Se(1,0)}},s:function(t,e,n,r,a,i){var o=Ee();try{return gt(t)(e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Se(1,0)}},w:function(t,e,n,r,a,i,o){var u=Ee();try{return gt(t)(e,n,r,a,i,o)}catch(t){if(Me(u),t!==t+0)throw t;Se(1,0)}},L:function(t,e,n,r,a,i,o,u){var c=Ee();try{return gt(t)(e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Se(1,0)}},E:function(t,e,n,r,a,i,o,u,c,s,l,f){var p=Ee();try{return gt(t)(e,n,r,a,i,o,u,c,s,l,f)}catch(t){if(Me(p),t!==t+0)throw t;Se(1,0)}},aa:function(t,e,n,r,a,i,o,u){var c=Ee();try{return He(t,e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Se(1,0)}},_:function(t,e,n,r,a,i,o){var u=Ee();try{return ke(t,e,n,r,a,i,o)}catch(t){if(Me(u),t!==t+0)throw t;Se(1,0)}},Z:function(t,e,n,r,a){var i=Ee();try{return Le(t,e,n,r,a)}catch(t){if(Me(i),t!==t+0)throw t;Se(1,0)}},ca:function(t,e,n,r){var a=Ee();try{return Ie(t,e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Se(1,0)}},$:function(t){var e=Ee();try{return je(t)}catch(t){if(Me(e),t!==t+0)throw t;Se(1,0)}},ba:function(t,e){var n=Ee();try{return We(t,e)}catch(t){if(Me(n),t!==t+0)throw t;Se(1,0)}},Y:function(t,e,n){var r=Ee();try{return De(t,e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},g:function(t){var e=Ee();try{gt(t)()}catch(t){if(Me(e),t!==t+0)throw t;Se(1,0)}},r:function(t,e){var n=Ee();try{gt(t)(e)}catch(t){if(Me(n),t!==t+0)throw t;Se(1,0)}},i:function(t,e,n){var r=Ee();try{gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},ha:function(t,e,n,r){var a=Ee();try{gt(t)(e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Se(1,0)}},m:function(t,e,n,r){var a=Ee();try{gt(t)(e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Se(1,0)}},v:function(t,e,n,r,a){var i=Ee();try{gt(t)(e,n,r,a)}catch(t){if(Me(i),t!==t+0)throw t;Se(1,0)}},u:function(t,e,n,r,a,i){var o=Ee();try{gt(t)(e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Se(1,0)}},O:function(t,e,n,r,a,i,o){var u=Ee();try{gt(t)(e,n,r,a,i,o)}catch(t){if(Me(u),t!==t+0)throw t;Se(1,0)}},A:function(t,e,n,r,a,i,o,u){var c=Ee();try{gt(t)(e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Se(1,0)}},ka:function(t,e,n,r,a,i,o,u,c){var s=Ee();try{gt(t)(e,n,r,a,i,o,u,c)}catch(t){if(Me(s),t!==t+0)throw t;Se(1,0)}},C:function(t,e,n,r,a,i,o,u,c,s,l){var f=Ee();try{gt(t)(e,n,r,a,i,o,u,c,s,l)}catch(t){if(Me(f),t!==t+0)throw t;Se(1,0)}},D:function(t,e,n,r,a,i,o,u,c,s,l,f,p,h,d,y){var b=Ee();try{gt(t)(e,n,r,a,i,o,u,c,s,l,f,p,h,d,y)}catch(t){if(Me(b),t!==t+0)throw t;Se(1,0)}},fa:function(t,e,n,r,a,i,o,u){var c=Ee();try{Pe(t,e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Se(1,0)}},da:function(t,e,n,r,a,i,o,u,c,s,l,f){var p=Ee();try{Fe(t,e,n,r,a,i,o,u,c,s,l,f)}catch(t){if(Me(p),t!==t+0)throw t;Se(1,0)}},ea:function(t,e,n,r,a,i){var o=Ee();try{Ue(t,e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Se(1,0)}},o:function(t){return t},a:j||u.wasmMemory,G:function(t){oe=t},la:le,z:function(t,e,n,r){return le(t,e,n,r)}};!function(){function t(t,e){u.asm=t.exports,ht.qc.push(u.asm.sb),$=u.asm.ub,X.unshift(u.asm.Va),k=e,O||(et--,u.monitorRunDependencies&&u.monitorRunDependencies(et),0==et&&(null!==nt&&(clearInterval(nt),nt=null),rt&&(t=rt,rt=null,t())))}function e(e){t(e.instance,e.module)}function n(t){return function(){if(!M&&(v||w)){if("function"==typeof fetch&&!tt.startsWith("file://"))return fetch(tt,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at \'"+tt+"\'";return t.arrayBuffer()})).catch((function(){return ot()}));if(f)return new Promise((function(t,e){f(tt,(function(e){t(new Uint8Array(e))}),e)}))}return Promise.resolve().then((function(){return ot()}))}().then((function(t){return WebAssembly.instantiate(t,r)})).then((function(t){return t})).then(t,(function(t){x("failed to asynchronously prepare wasm: "+t),at(t)}))}var r={a:pe};if(O||(et++,u.monitorRunDependencies&&u.monitorRunDependencies(et)),u.instantiateWasm)try{return u.instantiateWasm(r,t)}catch(t){return x("Module.instantiateWasm callback failed with error: "+t),!1}(M||"function"!=typeof WebAssembly.instantiateStreaming||it()||tt.startsWith("file://")||_||"function"!=typeof fetch?n(e):fetch(tt,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,r).then(e,(function(t){return x("wasm streaming compile failed: "+t),x("falling back to ArrayBuffer instantiation"),n(e)}))}))).catch(s)}(),u.___wasm_call_ctors=function(){return(u.___wasm_call_ctors=u.asm.Va).apply(null,arguments)},u._OrtInit=function(){return(u._OrtInit=u.asm.Wa).apply(null,arguments)},u._OrtCreateSessionOptions=function(){return(u._OrtCreateSessionOptions=u.asm.Xa).apply(null,arguments)},u._OrtAppendExecutionProvider=function(){return(u._OrtAppendExecutionProvider=u.asm.Ya).apply(null,arguments)},u._OrtAddSessionConfigEntry=function(){return(u._OrtAddSessionConfigEntry=u.asm.Za).apply(null,arguments)},u._OrtReleaseSessionOptions=function(){return(u._OrtReleaseSessionOptions=u.asm._a).apply(null,arguments)},u._OrtCreateSession=function(){return(u._OrtCreateSession=u.asm.$a).apply(null,arguments)},u._OrtReleaseSession=function(){return(u._OrtReleaseSession=u.asm.ab).apply(null,arguments)},u._OrtGetInputCount=function(){return(u._OrtGetInputCount=u.asm.bb).apply(null,arguments)},u._OrtGetOutputCount=function(){return(u._OrtGetOutputCount=u.asm.cb).apply(null,arguments)},u._OrtGetInputName=function(){return(u._OrtGetInputName=u.asm.db).apply(null,arguments)},u._OrtGetOutputName=function(){return(u._OrtGetOutputName=u.asm.eb).apply(null,arguments)},u._OrtFree=function(){return(u._OrtFree=u.asm.fb).apply(null,arguments)},u._OrtCreateTensor=function(){return(u._OrtCreateTensor=u.asm.gb).apply(null,arguments)},u._OrtGetTensorData=function(){return(u._OrtGetTensorData=u.asm.hb).apply(null,arguments)},u._OrtReleaseTensor=function(){return(u._OrtReleaseTensor=u.asm.ib).apply(null,arguments)},u._OrtCreateRunOptions=function(){return(u._OrtCreateRunOptions=u.asm.jb).apply(null,arguments)},u._OrtAddRunConfigEntry=function(){return(u._OrtAddRunConfigEntry=u.asm.kb).apply(null,arguments)},u._OrtReleaseRunOptions=function(){return(u._OrtReleaseRunOptions=u.asm.lb).apply(null,arguments)},u._OrtRun=function(){return(u._OrtRun=u.asm.mb).apply(null,arguments)},u._OrtEndProfiling=function(){return(u._OrtEndProfiling=u.asm.nb).apply(null,arguments)};var he=u._pthread_self=function(){return(he=u._pthread_self=u.asm.ob).apply(null,arguments)},de=u._malloc=function(){return(de=u._malloc=u.asm.pb).apply(null,arguments)},ye=u._free=function(){return(ye=u._free=u.asm.qb).apply(null,arguments)},be=u._fflush=function(){return(be=u._fflush=u.asm.rb).apply(null,arguments)};u.__emscripten_tls_init=function(){return(u.__emscripten_tls_init=u.asm.sb).apply(null,arguments)};var me=u.___funcs_on_exit=function(){return(me=u.___funcs_on_exit=u.asm.tb).apply(null,arguments)},ge=u.__emscripten_thread_init=function(){return(ge=u.__emscripten_thread_init=u.asm.vb).apply(null,arguments)};u.__emscripten_thread_crashed=function(){return(u.__emscripten_thread_crashed=u.asm.wb).apply(null,arguments)};var ve,we=u._emscripten_run_in_main_runtime_thread_js=function(){return(we=u._emscripten_run_in_main_runtime_thread_js=u.asm.xb).apply(null,arguments)},_e=u.__emscripten_proxy_execute_task_queue=function(){return(_e=u.__emscripten_proxy_execute_task_queue=u.asm.yb).apply(null,arguments)},Oe=u.__emscripten_thread_free_data=function(){return(Oe=u.__emscripten_thread_free_data=u.asm.zb).apply(null,arguments)},Ae=u.__emscripten_thread_exit=function(){return(Ae=u.__emscripten_thread_exit=u.asm.Ab).apply(null,arguments)},Se=u._setThrew=function(){return(Se=u._setThrew=u.asm.Bb).apply(null,arguments)},Te=u._emscripten_stack_set_limits=function(){return(Te=u._emscripten_stack_set_limits=u.asm.Cb).apply(null,arguments)},Ee=u.stackSave=function(){return(Ee=u.stackSave=u.asm.Db).apply(null,arguments)},Me=u.stackRestore=function(){return(Me=u.stackRestore=u.asm.Eb).apply(null,arguments)},Ce=u.stackAlloc=function(){return(Ce=u.stackAlloc=u.asm.Fb).apply(null,arguments)},xe=u.___cxa_can_catch=function(){return(xe=u.___cxa_can_catch=u.asm.Gb).apply(null,arguments)},Re=u.___cxa_is_pointer_type=function(){return(Re=u.___cxa_is_pointer_type=u.asm.Hb).apply(null,arguments)},je=u.dynCall_j=function(){return(je=u.dynCall_j=u.asm.Ib).apply(null,arguments)},ke=u.dynCall_iiiiij=function(){return(ke=u.dynCall_iiiiij=u.asm.Jb).apply(null,arguments)},De=u.dynCall_jii=function(){return(De=u.dynCall_jii=u.asm.Kb).apply(null,arguments)},Pe=u.dynCall_viiiiij=function(){return(Pe=u.dynCall_viiiiij=u.asm.Lb).apply(null,arguments)},Ue=u.dynCall_vjji=function(){return(Ue=u.dynCall_vjji=u.asm.Mb).apply(null,arguments)},Fe=u.dynCall_viiijjjii=function(){return(Fe=u.dynCall_viiijjjii=u.asm.Nb).apply(null,arguments)},Ie=u.dynCall_iij=function(){return(Ie=u.dynCall_iij=u.asm.Ob).apply(null,arguments)},We=u.dynCall_ji=function(){return(We=u.dynCall_ji=u.asm.Pb).apply(null,arguments)},He=u.dynCall_iiiiiij=function(){return(He=u.dynCall_iiiiiij=u.asm.Qb).apply(null,arguments)},Le=u.dynCall_iiij=function(){return(Le=u.dynCall_iiij=u.asm.Rb).apply(null,arguments)};function ze(){function t(){if(!ve&&(ve=!0,u.calledRun=!0,!H)&&(O||dt(X),c(u),u.onRuntimeInitialized&&u.onRuntimeInitialized(),!O)){if(u.postRun)for("function"==typeof u.postRun&&(u.postRun=[u.postRun]);u.postRun.length;){var t=u.postRun.shift();Z.unshift(t)}dt(Z)}}if(!(0<et))if(O)c(u),O||dt(X),postMessage({cmd:"loaded"});else{if(u.preRun)for("function"==typeof u.preRun&&(u.preRun=[u.preRun]);u.preRun.length;)K();dt(q),0<et||(u.setStatus?(u.setStatus("Running..."),setTimeout((function(){setTimeout((function(){u.setStatus("")}),1),t()}),1)):t())}}if(u.UTF8ToString=Y,u.stringToUTF8=function(t,e,n){return B(t,r(),e,n)},u.lengthBytesUTF8=G,u.keepRuntimeAlive=Q,u.wasmMemory=j,u.stackSave=Ee,u.stackRestore=Me,u.stackAlloc=Ce,u.ExitStatus=ct,u.PThread=ht,rt=function t(){ve||ze(),ve||(rt=t)},u.preInit)for("function"==typeof u.preInit&&(u.preInit=[u.preInit]);0<u.preInit.length;)u.preInit.pop()();return ze(),t.ready});t.exports=r},932:(t,e,n)=>{var _scriptDir,r=(_scriptDir=(_scriptDir="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(t){var e,r,a;t=t||{},e||(e=void 0!==t?t:{}),e.ready=new Promise((function(t,e){r=t,a=e}));var i,o,u,c,s,l,f=Object.assign({},e),p="./this.program",h=(t,e)=>{throw e},d="object"==typeof window,y="function"==typeof importScripts,b="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,m="";b?(m=y?n(908).dirname(m)+"/":"//",l=()=>{s||(c=n(384),s=n(908))},i=function(t,e){return l(),t=s.normalize(t),c.readFileSync(t,e?void 0:"utf8")},u=t=>((t=i(t,!0)).buffer||(t=new Uint8Array(t)),t),o=(t,e,n)=>{l(),t=s.normalize(t),c.readFile(t,(function(t,r){t?n(t):e(r.buffer)}))},1<process.argv.length&&(p=process.argv[1].replace(/\\\\/g,"/")),process.argv.slice(2),process.on("uncaughtException",(function(t){if(!(t instanceof J))throw t})),process.on("unhandledRejection",(function(t){throw t})),h=(t,e)=>{if(_||0<L)throw process.exitCode=t,e;e instanceof J||w("exiting due to exception: "+e),process.exit(t)},e.inspect=function(){return"[Emscripten Module object]"}):(d||y)&&(y?m=self.location.href:"undefined"!=typeof document&&document.currentScript&&(m=document.currentScript.src),_scriptDir&&(m=_scriptDir),m=0!==m.indexOf("blob:")?m.substr(0,m.replace(/[?#].*/,"").lastIndexOf("/")+1):"",i=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},y&&(u=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),o=(t,e,n)=>{var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?e(r.response):n()},r.onerror=n,r.send(null)});var g,v=e.print||console.log.bind(console),w=e.printErr||console.warn.bind(console);Object.assign(e,f),f=null,e.thisProgram&&(p=e.thisProgram),e.quit&&(h=e.quit),e.wasmBinary&&(g=e.wasmBinary);var _=e.noExitRuntime||!1;"object"!=typeof WebAssembly&&V("no native wasm support detected");var O,A,S,T,E,M,C=!1,x="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function R(t,e,n){var r=(e>>>=0)+n;for(n=e;t[n]&&!(n>=r);)++n;if(16<n-e&&t.buffer&&x)return x.decode(t.subarray(e,n));for(r="";e<n;){var a=t[e++];if(128&a){var i=63&t[e++];if(192==(224&a))r+=String.fromCharCode((31&a)<<6|i);else{var o=63&t[e++];65536>(a=224==(240&a)?(15&a)<<12|i<<6|o:(7&a)<<18|i<<12|o<<6|63&t[e++])?r+=String.fromCharCode(a):(a-=65536,r+=String.fromCharCode(55296|a>>10,56320|1023&a))}}else r+=String.fromCharCode(a)}return r}function j(t,e){return(t>>>=0)?R(T,t,e):""}function k(t,e,n,r){if(!(0<r))return 0;var a=n>>>=0;r=n+r-1;for(var i=0;i<t.length;++i){var o=t.charCodeAt(i);if(55296<=o&&57343>=o&&(o=65536+((1023&o)<<10)|1023&t.charCodeAt(++i)),127>=o){if(n>=r)break;e[n++>>>0]=o}else{if(2047>=o){if(n+1>=r)break;e[n++>>>0]=192|o>>6}else{if(65535>=o){if(n+2>=r)break;e[n++>>>0]=224|o>>12}else{if(n+3>=r)break;e[n++>>>0]=240|o>>18,e[n++>>>0]=128|o>>12&63}e[n++>>>0]=128|o>>6&63}e[n++>>>0]=128|63&o}}return e[n>>>0]=0,n-a}function D(t){for(var e=0,n=0;n<t.length;++n){var r=t.charCodeAt(n);127>=r?e++:2047>=r?e+=2:55296<=r&&57343>=r?(e+=4,++n):e+=3}return e}function P(){var t=O.buffer;A=t,e.HEAP8=S=new Int8Array(t),e.HEAP16=new Int16Array(t),e.HEAP32=E=new Int32Array(t),e.HEAPU8=T=new Uint8Array(t),e.HEAPU16=new Uint16Array(t),e.HEAPU32=M=new Uint32Array(t),e.HEAPF32=new Float32Array(t),e.HEAPF64=new Float64Array(t)}var U,F=[],I=[],W=[],H=[],L=0;function z(){var t=e.preRun.shift();F.unshift(t)}var Y,B=0,G=null,N=null;function V(t){throw e.onAbort&&e.onAbort(t),w(t="Aborted("+t+")"),C=!0,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),a(t),t}function $(){return Y.startsWith("data:application/octet-stream;base64,")}if(Y="ort-wasm.wasm",!$()){var q=Y;Y=e.locateFile?e.locateFile(q,m):m+q}function X(){var t=Y;try{if(t==Y&&g)return new Uint8Array(g);if(u)return u(t);throw"both async and sync fetching of the wasm failed"}catch(t){V(t)}}function J(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function Z(t){for(;0<t.length;)t.shift()(e)}var Q=[],K=0,tt=0;function et(t){this.Db=t,this.zb=t-24,this.Ub=function(t){M[this.zb+4>>2>>>0]=t},this.Eb=function(){return M[this.zb+4>>2>>>0]},this.Sb=function(t){M[this.zb+8>>2>>>0]=t},this.Wb=function(){return M[this.zb+8>>2>>>0]},this.Tb=function(){E[this.zb>>2>>>0]=0},this.Ib=function(t){S[this.zb+12>>0>>>0]=t?1:0},this.Pb=function(){return 0!=S[this.zb+12>>0>>>0]},this.Jb=function(t){S[this.zb+13>>0>>>0]=t?1:0},this.Lb=function(){return 0!=S[this.zb+13>>0>>>0]},this.Rb=function(t,e){this.Fb(0),this.Ub(t),this.Sb(e),this.Tb(),this.Ib(!1),this.Jb(!1)},this.Nb=function(){E[this.zb>>2>>>0]+=1},this.Xb=function(){var t=E[this.zb>>2>>>0];return E[this.zb>>2>>>0]=t-1,1===t},this.Fb=function(t){M[this.zb+16>>2>>>0]=t},this.Ob=function(){return M[this.zb+16>>2>>>0]},this.Qb=function(){if(Mt(this.Eb()))return M[this.Db>>2>>>0];var t=this.Ob();return 0!==t?t:this.Db}}function nt(t){return vt(new et(t).zb)}var rt=[];function at(t){var e=rt[t];return e||(t>=rt.length&&(rt.length=t+1),rt[t]=e=U.get(t)),e}function it(t){var e=D(t)+1,n=gt(e);return n&&k(t,S,n,e),n}var ot={};function ut(){if(!ct){var t,e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:p||"./this.program"};for(t in ot)void 0===ot[t]?delete e[t]:e[t]=ot[t];var n=[];for(t in e)n.push(t+"="+e[t]);ct=n}return ct}var ct,st=[null,[],[]];function lt(t,e){var n=st[t];0===e||10===e?((1===t?v:w)(R(n,0)),n.length=0):n.push(e)}var ft=0;function pt(t){return 0==t%4&&(0!=t%100||0==t%400)}var ht=[31,29,31,30,31,30,31,31,30,31,30,31],dt=[31,28,31,30,31,30,31,31,30,31,30,31];function yt(t,e,n,r){function a(t,e,n){for(t="number"==typeof t?t.toString():t||"";t.length<e;)t=n[0]+t;return t}function i(t,e){return a(t,e,"0")}function o(t,e){function n(t){return 0>t?-1:0<t?1:0}var r;return 0===(r=n(t.getFullYear()-e.getFullYear()))&&0===(r=n(t.getMonth()-e.getMonth()))&&(r=n(t.getDate()-e.getDate())),r}function u(t){switch(t.getDay()){case 0:return new Date(t.getFullYear()-1,11,29);case 1:return t;case 2:return new Date(t.getFullYear(),0,3);case 3:return new Date(t.getFullYear(),0,2);case 4:return new Date(t.getFullYear(),0,1);case 5:return new Date(t.getFullYear()-1,11,31);case 6:return new Date(t.getFullYear()-1,11,30)}}function c(t){var e=t.Bb;for(t=new Date(new Date(t.Cb+1900,0,1).getTime());0<e;){var n=t.getMonth(),r=(pt(t.getFullYear())?ht:dt)[n];if(!(e>r-t.getDate())){t.setDate(t.getDate()+e);break}e-=r-t.getDate()+1,t.setDate(1),11>n?t.setMonth(n+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return n=new Date(t.getFullYear()+1,0,4),e=u(new Date(t.getFullYear(),0,4)),n=u(n),0>=o(e,t)?0>=o(n,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var s=E[r+40>>2>>>0];for(var l in r={$b:E[r>>2>>>0],Zb:E[r+4>>2>>>0],Gb:E[r+8>>2>>>0],Kb:E[r+12>>2>>>0],Hb:E[r+16>>2>>>0],Cb:E[r+20>>2>>>0],Ab:E[r+24>>2>>>0],Bb:E[r+28>>2>>>0],bc:E[r+32>>2>>>0],Yb:E[r+36>>2>>>0],ac:s?j(s):""},n=j(n),s={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})n=n.replace(new RegExp(l,"g"),s[l]);var f="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),p="January February March April May June July August September October November December".split(" ");for(l in s={"%a":function(t){return f[t.Ab].substring(0,3)},"%A":function(t){return f[t.Ab]},"%b":function(t){return p[t.Hb].substring(0,3)},"%B":function(t){return p[t.Hb]},"%C":function(t){return i((t.Cb+1900)/100|0,2)},"%d":function(t){return i(t.Kb,2)},"%e":function(t){return a(t.Kb,2," ")},"%g":function(t){return c(t).toString().substring(2)},"%G":function(t){return c(t)},"%H":function(t){return i(t.Gb,2)},"%I":function(t){return 0==(t=t.Gb)?t=12:12<t&&(t-=12),i(t,2)},"%j":function(t){for(var e=0,n=0;n<=t.Hb-1;e+=(pt(t.Cb+1900)?ht:dt)[n++]);return i(t.Kb+e,3)},"%m":function(t){return i(t.Hb+1,2)},"%M":function(t){return i(t.Zb,2)},"%n":function(){return"\\n"},"%p":function(t){return 0<=t.Gb&&12>t.Gb?"AM":"PM"},"%S":function(t){return i(t.$b,2)},"%t":function(){return"\\t"},"%u":function(t){return t.Ab||7},"%U":function(t){return i(Math.floor((t.Bb+7-t.Ab)/7),2)},"%V":function(t){var e=Math.floor((t.Bb+7-(t.Ab+6)%7)/7);if(2>=(t.Ab+371-t.Bb-2)%7&&e++,e)53==e&&(4==(n=(t.Ab+371-t.Bb)%7)||3==n&&pt(t.Cb)||(e=1));else{e=52;var n=(t.Ab+7-t.Bb-1)%7;(4==n||5==n&&pt(t.Cb%400-1))&&e++}return i(e,2)},"%w":function(t){return t.Ab},"%W":function(t){return i(Math.floor((t.Bb+7-(t.Ab+6)%7)/7),2)},"%y":function(t){return(t.Cb+1900).toString().substring(2)},"%Y":function(t){return t.Cb+1900},"%z":function(t){var e=0<=(t=t.Yb);return t=Math.abs(t)/60,(e?"+":"-")+String("0000"+(t/60*100+t%60)).slice(-4)},"%Z":function(t){return t.ac},"%%":function(){return"%"}},n=n.replace(/%%/g,"\\0\\0"),s)n.includes(l)&&(n=n.replace(new RegExp(l,"g"),s[l](r)));return l=function(t){var e=Array(D(t)+1);return k(t,e,0,e.length),e}(n=n.replace(/\\0\\0/g,"%")),l.length>e?0:(S.set(l,t>>>0),l.length-1)}var bt={a:function(t){return gt(t+24)+24},m:function(t){return(t=new et(t)).Pb()||(t.Ib(!0),K--),t.Jb(!1),Q.push(t),t.Nb(),t.Qb()},ia:function(t){throw w("Unexpected exception thrown, this is not properly supported - aborting"),C=!0,t},w:function(){Ot(0);var t=Q.pop();if(t.Xb()&&!t.Lb()){var e=t.Wb();e&&at(e)(t.Db),nt(t.Db)}tt=0},d:function(){var t=tt;if(!t)return ft=0;var e=new et(t);e.Fb(t);var n=e.Eb();if(!n)return ft=0,t;for(var r=Array.prototype.slice.call(arguments),a=0;a<r.length;a++){var i=r[a];if(0===i||i===n)break;if(Et(i,n,e.zb+16))return ft=i,t}return ft=n,t},k:function(){var t=tt;if(!t)return ft=0;var e=new et(t);e.Fb(t);var n=e.Eb();if(!n)return ft=0,t;for(var r=Array.prototype.slice.call(arguments),a=0;a<r.length;a++){var i=r[a];if(0===i||i===n)break;if(Et(i,n,e.zb+16))return ft=i,t}return ft=n,t},g:function(){var t=tt;if(!t)return ft=0;var e=new et(t);e.Fb(t);var n=e.Eb();if(!n)return ft=0,t;for(var r=Array.prototype.slice.call(arguments),a=0;a<r.length;a++){var i=r[a];if(0===i||i===n)break;if(Et(i,n,e.zb+16))return ft=i,t}return ft=n,t},s:nt,L:function(){var t=Q.pop();t||V("no exception to throw");var e=t.Db;throw t.Lb()||(Q.push(t),t.Jb(!0),t.Ib(!1),K++),tt=e,e},b:function(t,e,n){throw new et(t).Rb(e,n),tt=t,K++,t},la:function(){return K},i:function(t){throw tt||(tt=t),t},H:function(){return 0},Ba:function(){},pa:function(){},ra:function(){},ka:function(){return 0},za:function(){},ua:function(){},ya:function(){},R:function(){},qa:function(){},na:function(){},Aa:function(){},oa:function(){},Ha:function(){},Ja:function(){V("To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking")},Ia:function(){V("To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking")},S:function(){return Date.now()},Ca:function(){return!0},Da:function(t,e){t=new Date(1e3*(M[t>>>2]+4294967296*E[t+4>>>2])),E[e>>2>>>0]=t.getUTCSeconds(),E[e+4>>2>>>0]=t.getUTCMinutes(),E[e+8>>2>>>0]=t.getUTCHours(),E[e+12>>2>>>0]=t.getUTCDate(),E[e+16>>2>>>0]=t.getUTCMonth(),E[e+20>>2>>>0]=t.getUTCFullYear()-1900,E[e+24>>2>>>0]=t.getUTCDay(),E[e+28>>2>>>0]=(t.getTime()-Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0))/864e5|0},Ea:function(t,e){t=new Date(1e3*(M[t>>>2]+4294967296*E[t+4>>>2])),E[e>>2>>>0]=t.getSeconds(),E[e+4>>2>>>0]=t.getMinutes(),E[e+8>>2>>>0]=t.getHours(),E[e+12>>2>>>0]=t.getDate(),E[e+16>>2>>>0]=t.getMonth(),E[e+20>>2>>>0]=t.getFullYear()-1900,E[e+24>>2>>>0]=t.getDay();var n=new Date(t.getFullYear(),0,1);E[e+28>>2>>>0]=(t.getTime()-n.getTime())/864e5|0,E[e+36>>2>>>0]=-60*t.getTimezoneOffset();var r=new Date(t.getFullYear(),6,1).getTimezoneOffset();n=n.getTimezoneOffset(),E[e+32>>2>>>0]=0|(r!=n&&t.getTimezoneOffset()==Math.min(n,r))},Fa:function(t){var e=new Date(E[t+20>>2>>>0]+1900,E[t+16>>2>>>0],E[t+12>>2>>>0],E[t+8>>2>>>0],E[t+4>>2>>>0],E[t>>2>>>0],0),n=E[t+32>>2>>>0],r=e.getTimezoneOffset(),a=new Date(e.getFullYear(),0,1),i=new Date(e.getFullYear(),6,1).getTimezoneOffset(),o=a.getTimezoneOffset(),u=Math.min(o,i);return 0>n?E[t+32>>2>>>0]=Number(i!=o&&u==r):0<n!=(u==r)&&(i=Math.max(o,i),e.setTime(e.getTime()+6e4*((0<n?u:i)-r))),E[t+24>>2>>>0]=e.getDay(),E[t+28>>2>>>0]=(e.getTime()-a.getTime())/864e5|0,E[t>>2>>>0]=e.getSeconds(),E[t+4>>2>>>0]=e.getMinutes(),E[t+8>>2>>>0]=e.getHours(),E[t+12>>2>>>0]=e.getDate(),E[t+16>>2>>>0]=e.getMonth(),e.getTime()/1e3|0},sa:function(){return-52},ta:function(){},Ga:function t(e,n,r){t.Vb||(t.Vb=!0,function(t,e,n){function r(t){return(t=t.toTimeString().match(/\\(([A-Za-z ]+)\\)$/))?t[1]:"GMT"}var a=(new Date).getFullYear(),i=new Date(a,0,1),o=new Date(a,6,1);a=i.getTimezoneOffset();var u=o.getTimezoneOffset();E[t>>2>>>0]=60*Math.max(a,u),E[e>>2>>>0]=Number(a!=u),t=r(i),e=r(o),t=it(t),e=it(e),u<a?(M[n>>2>>>0]=t,M[n+4>>2>>>0]=e):(M[n>>2>>>0]=e,M[n+4>>2>>>0]=t)}(e,n,r))},B:function(){V("")},ma:function(){return 4294901760},I:b?()=>{var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:()=>performance.now(),xa:function(t,e,n){T.copyWithin(t>>>0,e>>>0,e+n>>>0)},G:function(t){var e=T.length;if(4294901760<(t>>>=0))return!1;for(var n=1;4>=n;n*=2){var r=e*(1+.2/n);r=Math.min(r,t+100663296);var a=Math;r=Math.max(t,r),a=a.min.call(a,4294901760,r+(65536-r%65536)%65536);t:{try{O.grow(a-A.byteLength+65535>>>16),P();var i=1;break t}catch(t){}i=void 0}if(i)return!0}return!1},va:function(t,e){var n=0;return ut().forEach((function(r,a){var i=e+n;for(a=M[t+4*a>>2>>>0]=i,i=0;i<r.length;++i)S[a++>>0>>>0]=r.charCodeAt(i);S[a>>0>>>0]=0,n+=r.length+1})),0},wa:function(t,e){var n=ut();M[t>>2>>>0]=n.length;var r=0;return n.forEach((function(t){r+=t.length+1})),M[e>>2>>>0]=r,0},ba:function(t){_||0<L||(_t(),Z(W),wt(0),st[1].length&<(1,10),st[2].length&<(2,10)),_||0<L||(e.onExit&&e.onExit(t),C=!0),h(t,new J(t))},E:function(){return 52},Q:function(){return 52},ca:function(){return 70},P:function(t,e,n,r){for(var a=0,i=0;i<n;i++){var o=M[e>>2>>>0],u=M[e+4>>2>>>0];e+=8;for(var c=0;c<u;c++)lt(t,T[o+c>>>0]);a+=u}return M[r>>2>>>0]=a,0},c:function(){return ft},ja:function t(e,r){t.Mb||(t.Mb=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var t=new Uint8Array(1);return()=>(crypto.getRandomValues(t),t[0])}if(b)try{var e=n(Object(function(){var t=new Error("Cannot find module \'crypto\'");throw t.code="MODULE_NOT_FOUND",t}()));return()=>e.randomBytes(1)[0]}catch(t){}return()=>V("randomDevice")}());for(var a=0;a<r;a++)S[e+a>>0>>>0]=t.Mb();return 0},ea:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},fa:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},J:function(t){var e=At();try{return at(t)()}catch(t){if(St(e),t!==t+0)throw t;Ot(1,0)}},e:function(t,e){var n=At();try{return at(t)(e)}catch(t){if(St(n),t!==t+0)throw t;Ot(1,0)}},N:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},O:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},j:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},o:function(t,e,n,r){var a=At();try{return at(t)(e,n,r)}catch(t){if(St(a),t!==t+0)throw t;Ot(1,0)}},p:function(t,e,n,r,a){var i=At();try{return at(t)(e,n,r,a)}catch(t){if(St(i),t!==t+0)throw t;Ot(1,0)}},M:function(t,e,n,r,a,i){var o=At();try{return at(t)(e,n,r,a,i)}catch(t){if(St(o),t!==t+0)throw t;Ot(1,0)}},r:function(t,e,n,r,a,i){var o=At();try{return at(t)(e,n,r,a,i)}catch(t){if(St(o),t!==t+0)throw t;Ot(1,0)}},v:function(t,e,n,r,a,i,o){var u=At();try{return at(t)(e,n,r,a,i,o)}catch(t){if(St(u),t!==t+0)throw t;Ot(1,0)}},K:function(t,e,n,r,a,i,o,u){var c=At();try{return at(t)(e,n,r,a,i,o,u)}catch(t){if(St(c),t!==t+0)throw t;Ot(1,0)}},D:function(t,e,n,r,a,i,o,u,c,s,l,f){var p=At();try{return at(t)(e,n,r,a,i,o,u,c,s,l,f)}catch(t){if(St(p),t!==t+0)throw t;Ot(1,0)}},X:function(t,e,n,r,a,i,o,u){var c=At();try{return Ft(t,e,n,r,a,i,o,u)}catch(t){if(St(c),t!==t+0)throw t;Ot(1,0)}},V:function(t,e,n,r,a,i,o){var u=At();try{return xt(t,e,n,r,a,i,o)}catch(t){if(St(u),t!==t+0)throw t;Ot(1,0)}},U:function(t,e,n,r,a){var i=At();try{return It(t,e,n,r,a)}catch(t){if(St(i),t!==t+0)throw t;Ot(1,0)}},Z:function(t,e,n,r){var a=At();try{return Pt(t,e,n,r)}catch(t){if(St(a),t!==t+0)throw t;Ot(1,0)}},W:function(t){var e=At();try{return Ct(t)}catch(t){if(St(e),t!==t+0)throw t;Ot(1,0)}},Y:function(t,e){var n=At();try{return Ut(t,e)}catch(t){if(St(n),t!==t+0)throw t;Ot(1,0)}},T:function(t,e,n){var r=At();try{return Rt(t,e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},f:function(t){var e=At();try{at(t)()}catch(t){if(St(e),t!==t+0)throw t;Ot(1,0)}},q:function(t,e){var n=At();try{at(t)(e)}catch(t){if(St(n),t!==t+0)throw t;Ot(1,0)}},h:function(t,e,n){var r=At();try{at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},da:function(t,e,n,r){var a=At();try{at(t)(e,n,r)}catch(t){if(St(a),t!==t+0)throw t;Ot(1,0)}},l:function(t,e,n,r){var a=At();try{at(t)(e,n,r)}catch(t){if(St(a),t!==t+0)throw t;Ot(1,0)}},t:function(t,e,n,r,a){var i=At();try{at(t)(e,n,r,a)}catch(t){if(St(i),t!==t+0)throw t;Ot(1,0)}},u:function(t,e,n,r,a,i){var o=At();try{at(t)(e,n,r,a,i)}catch(t){if(St(o),t!==t+0)throw t;Ot(1,0)}},x:function(t,e,n,r,a,i,o){var u=At();try{at(t)(e,n,r,a,i,o)}catch(t){if(St(u),t!==t+0)throw t;Ot(1,0)}},z:function(t,e,n,r,a,i,o,u){var c=At();try{at(t)(e,n,r,a,i,o,u)}catch(t){if(St(c),t!==t+0)throw t;Ot(1,0)}},ga:function(t,e,n,r,a,i,o,u,c){var s=At();try{at(t)(e,n,r,a,i,o,u,c)}catch(t){if(St(s),t!==t+0)throw t;Ot(1,0)}},A:function(t,e,n,r,a,i,o,u,c,s,l){var f=At();try{at(t)(e,n,r,a,i,o,u,c,s,l)}catch(t){if(St(f),t!==t+0)throw t;Ot(1,0)}},C:function(t,e,n,r,a,i,o,u,c,s,l,f,p,h,d,y){var b=At();try{at(t)(e,n,r,a,i,o,u,c,s,l,f,p,h,d,y)}catch(t){if(St(b),t!==t+0)throw t;Ot(1,0)}},aa:function(t,e,n,r,a,i,o,u){var c=At();try{jt(t,e,n,r,a,i,o,u)}catch(t){if(St(c),t!==t+0)throw t;Ot(1,0)}},_:function(t,e,n,r,a,i,o,u,c,s,l,f){var p=At();try{Dt(t,e,n,r,a,i,o,u,c,s,l,f)}catch(t){if(St(p),t!==t+0)throw t;Ot(1,0)}},$:function(t,e,n,r,a,i){var o=At();try{kt(t,e,n,r,a,i)}catch(t){if(St(o),t!==t+0)throw t;Ot(1,0)}},n:function(t){return t},F:function(t){ft=t},ha:yt,y:function(t,e,n,r){return yt(t,e,n,r)}};!function(){function t(t){e.asm=t.exports,O=e.asm.Ka,P(),U=e.asm.ib,I.unshift(e.asm.La),B--,e.monitorRunDependencies&&e.monitorRunDependencies(B),0==B&&(null!==G&&(clearInterval(G),G=null),N&&(t=N,N=null,t()))}function n(e){t(e.instance)}function r(t){return function(){if(!g&&(d||y)){if("function"==typeof fetch&&!Y.startsWith("file://"))return fetch(Y,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at \'"+Y+"\'";return t.arrayBuffer()})).catch((function(){return X()}));if(o)return new Promise((function(t,e){o(Y,(function(e){t(new Uint8Array(e))}),e)}))}return Promise.resolve().then((function(){return X()}))}().then((function(t){return WebAssembly.instantiate(t,i)})).then((function(t){return t})).then(t,(function(t){w("failed to asynchronously prepare wasm: "+t),V(t)}))}var i={a:bt};if(B++,e.monitorRunDependencies&&e.monitorRunDependencies(B),e.instantiateWasm)try{return e.instantiateWasm(i,t)}catch(t){return w("Module.instantiateWasm callback failed with error: "+t),!1}(g||"function"!=typeof WebAssembly.instantiateStreaming||$()||Y.startsWith("file://")||b||"function"!=typeof fetch?r(n):fetch(Y,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,i).then(n,(function(t){return w("wasm streaming compile failed: "+t),w("falling back to ArrayBuffer instantiation"),r(n)}))}))).catch(a)}(),e.___wasm_call_ctors=function(){return(e.___wasm_call_ctors=e.asm.La).apply(null,arguments)},e._OrtInit=function(){return(e._OrtInit=e.asm.Ma).apply(null,arguments)},e._OrtCreateSessionOptions=function(){return(e._OrtCreateSessionOptions=e.asm.Na).apply(null,arguments)},e._OrtAppendExecutionProvider=function(){return(e._OrtAppendExecutionProvider=e.asm.Oa).apply(null,arguments)},e._OrtAddSessionConfigEntry=function(){return(e._OrtAddSessionConfigEntry=e.asm.Pa).apply(null,arguments)},e._OrtReleaseSessionOptions=function(){return(e._OrtReleaseSessionOptions=e.asm.Qa).apply(null,arguments)},e._OrtCreateSession=function(){return(e._OrtCreateSession=e.asm.Ra).apply(null,arguments)},e._OrtReleaseSession=function(){return(e._OrtReleaseSession=e.asm.Sa).apply(null,arguments)},e._OrtGetInputCount=function(){return(e._OrtGetInputCount=e.asm.Ta).apply(null,arguments)},e._OrtGetOutputCount=function(){return(e._OrtGetOutputCount=e.asm.Ua).apply(null,arguments)},e._OrtGetInputName=function(){return(e._OrtGetInputName=e.asm.Va).apply(null,arguments)},e._OrtGetOutputName=function(){return(e._OrtGetOutputName=e.asm.Wa).apply(null,arguments)},e._OrtFree=function(){return(e._OrtFree=e.asm.Xa).apply(null,arguments)},e._OrtCreateTensor=function(){return(e._OrtCreateTensor=e.asm.Ya).apply(null,arguments)},e._OrtGetTensorData=function(){return(e._OrtGetTensorData=e.asm.Za).apply(null,arguments)},e._OrtReleaseTensor=function(){return(e._OrtReleaseTensor=e.asm._a).apply(null,arguments)},e._OrtCreateRunOptions=function(){return(e._OrtCreateRunOptions=e.asm.$a).apply(null,arguments)},e._OrtAddRunConfigEntry=function(){return(e._OrtAddRunConfigEntry=e.asm.ab).apply(null,arguments)},e._OrtReleaseRunOptions=function(){return(e._OrtReleaseRunOptions=e.asm.bb).apply(null,arguments)},e._OrtRun=function(){return(e._OrtRun=e.asm.cb).apply(null,arguments)},e._OrtEndProfiling=function(){return(e._OrtEndProfiling=e.asm.db).apply(null,arguments)};var mt,gt=e._malloc=function(){return(gt=e._malloc=e.asm.eb).apply(null,arguments)},vt=e._free=function(){return(vt=e._free=e.asm.fb).apply(null,arguments)},wt=e._fflush=function(){return(wt=e._fflush=e.asm.gb).apply(null,arguments)},_t=e.___funcs_on_exit=function(){return(_t=e.___funcs_on_exit=e.asm.hb).apply(null,arguments)},Ot=e._setThrew=function(){return(Ot=e._setThrew=e.asm.jb).apply(null,arguments)},At=e.stackSave=function(){return(At=e.stackSave=e.asm.kb).apply(null,arguments)},St=e.stackRestore=function(){return(St=e.stackRestore=e.asm.lb).apply(null,arguments)},Tt=e.stackAlloc=function(){return(Tt=e.stackAlloc=e.asm.mb).apply(null,arguments)},Et=e.___cxa_can_catch=function(){return(Et=e.___cxa_can_catch=e.asm.nb).apply(null,arguments)},Mt=e.___cxa_is_pointer_type=function(){return(Mt=e.___cxa_is_pointer_type=e.asm.ob).apply(null,arguments)},Ct=e.dynCall_j=function(){return(Ct=e.dynCall_j=e.asm.pb).apply(null,arguments)},xt=e.dynCall_iiiiij=function(){return(xt=e.dynCall_iiiiij=e.asm.qb).apply(null,arguments)},Rt=e.dynCall_jii=function(){return(Rt=e.dynCall_jii=e.asm.rb).apply(null,arguments)},jt=e.dynCall_viiiiij=function(){return(jt=e.dynCall_viiiiij=e.asm.sb).apply(null,arguments)},kt=e.dynCall_vjji=function(){return(kt=e.dynCall_vjji=e.asm.tb).apply(null,arguments)},Dt=e.dynCall_viiijjjii=function(){return(Dt=e.dynCall_viiijjjii=e.asm.ub).apply(null,arguments)},Pt=e.dynCall_iij=function(){return(Pt=e.dynCall_iij=e.asm.vb).apply(null,arguments)},Ut=e.dynCall_ji=function(){return(Ut=e.dynCall_ji=e.asm.wb).apply(null,arguments)},Ft=e.dynCall_iiiiiij=function(){return(Ft=e.dynCall_iiiiiij=e.asm.xb).apply(null,arguments)},It=e.dynCall_iiij=function(){return(It=e.dynCall_iiij=e.asm.yb).apply(null,arguments)};function Wt(){function t(){if(!mt&&(mt=!0,e.calledRun=!0,!C)){if(Z(I),r(e),e.onRuntimeInitialized&&e.onRuntimeInitialized(),e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;){var t=e.postRun.shift();H.unshift(t)}Z(H)}}if(!(0<B)){if(e.preRun)for("function"==typeof e.preRun&&(e.preRun=[e.preRun]);e.preRun.length;)z();Z(F),0<B||(e.setStatus?(e.setStatus("Running..."),setTimeout((function(){setTimeout((function(){e.setStatus("")}),1),t()}),1)):t())}}if(e.UTF8ToString=j,e.stringToUTF8=function(t,e,n){return k(t,T,e,n)},e.lengthBytesUTF8=D,e.stackSave=At,e.stackRestore=St,e.stackAlloc=Tt,N=function t(){mt||Wt(),mt||(N=t)},e.preInit)for("function"==typeof e.preInit&&(e.preInit=[e.preInit]);0<e.preInit.length;)e.preInit.pop()();return Wt(),t.ready});t.exports=r},967:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.iterateExtraOptions=void 0,e.iterateExtraOptions=(t,n,r,a)=>{if("object"==typeof t&&null!==t){if(r.has(t))throw new Error("Circular reference in options");r.add(t)}Object.entries(t).forEach((([t,i])=>{const o=n?n+t:t;if("object"==typeof i)(0,e.iterateExtraOptions)(i,o+".",r,a);else if("string"==typeof i||"number"==typeof i)a(o,i.toString());else{if("boolean"!=typeof i)throw new Error("Can\'t handle extra config type: "+typeof i);a(o,i?"1":"0")}}))}},586:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setRunOptions=void 0;const r=n(967),a=n(983),i=n(361);e.setRunOptions=t=>{const e=(0,i.getInstance)();let n=0;const o=[],u=t||{};try{if(void 0===(null==t?void 0:t.logSeverityLevel))u.logSeverityLevel=2;else if("number"!=typeof t.logSeverityLevel||!Number.isInteger(t.logSeverityLevel)||t.logSeverityLevel<0||t.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${t.logSeverityLevel}`);if(void 0===(null==t?void 0:t.logVerbosityLevel))u.logVerbosityLevel=0;else if("number"!=typeof t.logVerbosityLevel||!Number.isInteger(t.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${t.logVerbosityLevel}`);void 0===(null==t?void 0:t.terminate)&&(u.terminate=!1);let i=0;if(void 0!==(null==t?void 0:t.tag)&&(i=(0,a.allocWasmString)(t.tag,o)),n=e._OrtCreateRunOptions(u.logSeverityLevel,u.logVerbosityLevel,!!u.terminate,i),0===n)throw new Error("Can\'t create run options");return void 0!==(null==t?void 0:t.extra)&&(0,r.iterateExtraOptions)(t.extra,"",new WeakSet,((t,r)=>{const i=(0,a.allocWasmString)(t,o),u=(0,a.allocWasmString)(r,o);if(0!==e._OrtAddRunConfigEntry(n,i,u))throw new Error(`Can\'t set a run config entry: ${t} - ${r}`)})),[n,o]}catch(t){throw 0!==n&&e._OrtReleaseRunOptions(n),o.forEach(e._free),t}}},919:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setSessionOptions=void 0;const r=n(967),a=n(983),i=n(361);e.setSessionOptions=t=>{const e=(0,i.getInstance)();let n=0;const o=[],u=t||{};(t=>{t.extra||(t.extra={}),t.extra.session||(t.extra.session={});const e=t.extra.session;e.use_ort_model_bytes_directly||(e.use_ort_model_bytes_directly="1")})(u);try{void 0===(null==t?void 0:t.graphOptimizationLevel)&&(u.graphOptimizationLevel="all");const c=(t=>{switch(t){case"disabled":return 0;case"basic":return 1;case"extended":return 2;case"all":return 99;default:throw new Error(`unsupported graph optimization level: ${t}`)}})(u.graphOptimizationLevel);void 0===(null==t?void 0:t.enableCpuMemArena)&&(u.enableCpuMemArena=!0),void 0===(null==t?void 0:t.enableMemPattern)&&(u.enableMemPattern=!0),void 0===(null==t?void 0:t.executionMode)&&(u.executionMode="sequential");const s=(t=>{switch(t){case"sequential":return 0;case"parallel":return 1;default:throw new Error(`unsupported execution mode: ${t}`)}})(u.executionMode);let l=0;if(void 0!==(null==t?void 0:t.logId)&&(l=(0,a.allocWasmString)(t.logId,o)),void 0===(null==t?void 0:t.logSeverityLevel))u.logSeverityLevel=2;else if("number"!=typeof t.logSeverityLevel||!Number.isInteger(t.logSeverityLevel)||t.logSeverityLevel<0||t.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${t.logSeverityLevel}`);if(void 0===(null==t?void 0:t.logVerbosityLevel))u.logVerbosityLevel=0;else if("number"!=typeof t.logVerbosityLevel||!Number.isInteger(t.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${t.logVerbosityLevel}`);if(void 0===(null==t?void 0:t.enableProfiling)&&(u.enableProfiling=!1),n=e._OrtCreateSessionOptions(c,!!u.enableCpuMemArena,!!u.enableMemPattern,s,!!u.enableProfiling,0,l,u.logSeverityLevel,u.logVerbosityLevel),0===n)throw new Error("Can\'t create session options");return(null==t?void 0:t.executionProviders)&&((t,e,n)=>{for(const r of e){let e="string"==typeof r?r:r.name;switch(e){case"xnnpack":e="XNNPACK";break;case"wasm":case"cpu":continue;default:throw new Error(`not supported EP: ${e}`)}const o=(0,a.allocWasmString)(e,n);if(0!==(0,i.getInstance)()._OrtAppendExecutionProvider(t,o))throw new Error(`Can\'t append execution provider: ${e}`)}})(n,t.executionProviders,o),void 0!==(null==t?void 0:t.extra)&&(0,r.iterateExtraOptions)(t.extra,"",new WeakSet,((t,r)=>{const i=(0,a.allocWasmString)(t,o),u=(0,a.allocWasmString)(r,o);if(0!==e._OrtAddSessionConfigEntry(n,i,u))throw new Error(`Can\'t set a session config entry: ${t} - ${r}`)})),[n,o]}catch(t){throw 0!==n&&e._OrtReleaseSessionOptions(n),o.forEach(e._free),t}}},983:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.allocWasmString=void 0;const r=n(361);e.allocWasmString=(t,e)=>{const n=(0,r.getInstance)(),a=n.lengthBytesUTF8(t)+1,i=n._malloc(a);return n.stringToUTF8(t,i,a),e.push(i),i}},349:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.extractTransferableBuffers=e.endProfiling=e.run=e.releaseSession=e.createSession=e.createSessionFinalize=e.createSessionAllocate=e.initOrt=void 0;const r=n(586),a=n(919),i=n(983),o=n(361);e.initOrt=(t,e)=>{const n=(0,o.getInstance)()._OrtInit(t,e);if(0!==n)throw new Error(`Can\'t initialize onnxruntime. error code = ${n}`)};const u=new Map;e.createSessionAllocate=t=>{const e=(0,o.getInstance)(),n=e._malloc(t.byteLength);return e.HEAPU8.set(t,n),[n,t.byteLength]},e.createSessionFinalize=(t,e)=>{const n=(0,o.getInstance)();let r=0,i=0,c=[];try{if([i,c]=(0,a.setSessionOptions)(e),r=n._OrtCreateSession(t[0],t[1],i),0===r)throw new Error("Can\'t create a session")}finally{n._free(t[0]),n._OrtReleaseSessionOptions(i),c.forEach(n._free)}const s=n._OrtGetInputCount(r),l=n._OrtGetOutputCount(r),f=[],p=[],h=[],d=[];for(let t=0;t<s;t++){const e=n._OrtGetInputName(r,t);if(0===e)throw new Error("Can\'t get an input name");p.push(e),f.push(n.UTF8ToString(e))}for(let t=0;t<l;t++){const e=n._OrtGetOutputName(r,t);if(0===e)throw new Error("Can\'t get an output name");d.push(e),h.push(n.UTF8ToString(e))}return u.set(r,[r,p,d]),[r,f,h]},e.createSession=(t,n)=>{const r=(0,e.createSessionAllocate)(t);return(0,e.createSessionFinalize)(r,n)},e.releaseSession=t=>{const e=(0,o.getInstance)(),n=u.get(t);if(!n)throw new Error("invalid session id");const r=n[0],a=n[1],i=n[2];a.forEach(e._OrtFree),i.forEach(e._OrtFree),e._OrtReleaseSession(r),u.delete(t)};const c=t=>{switch(t){case"int8":return 3;case"uint8":return 2;case"bool":return 9;case"int16":return 5;case"uint16":return 4;case"int32":return 6;case"uint32":return 12;case"float32":return 1;case"float64":return 11;case"string":return 8;case"int64":return 7;case"uint64":return 13;default:throw new Error(`unsupported data type: ${t}`)}},s=t=>{switch(t){case 3:return"int8";case 2:return"uint8";case 9:return"bool";case 5:return"int16";case 4:return"uint16";case 6:return"int32";case 12:return"uint32";case 1:return"float32";case 11:return"float64";case 8:return"string";case 7:return"int64";case 13:return"uint64";default:throw new Error(`unsupported data type: ${t}`)}},l=t=>{switch(t){case"float32":return Float32Array;case"uint8":case"bool":return Uint8Array;case"int8":return Int8Array;case"uint16":return Uint16Array;case"int16":return Int16Array;case"int32":return Int32Array;case"float64":return Float64Array;case"uint32":return Uint32Array;case"int64":return BigInt64Array;case"uint64":return BigUint64Array;default:throw new Error(`unsupported type: ${t}`)}};e.run=(t,e,n,a,f)=>{const p=(0,o.getInstance)(),h=u.get(t);if(!h)throw new Error("invalid session id");const d=h[0],y=h[1],b=h[2],m=e.length,g=a.length;let v=0,w=[];const _=[],O=[];try{[v,w]=(0,r.setRunOptions)(f);for(let t=0;t<m;t++){const e=n[t][0],r=n[t][1],a=n[t][2];let o,u;if(Array.isArray(a)){u=4*a.length,o=p._malloc(u),O.push(o);let t=o/4;for(let e=0;e<a.length;e++){if("string"!=typeof a[e])throw new TypeError(`tensor data at index ${e} is not a string`);p.HEAPU32[t++]=(0,i.allocWasmString)(a[e],O)}}else u=a.byteLength,o=p._malloc(u),O.push(o),p.HEAPU8.set(new Uint8Array(a.buffer,a.byteOffset,u),o);const s=p.stackSave(),l=p.stackAlloc(4*r.length);try{let t=l/4;r.forEach((e=>p.HEAP32[t++]=e));const n=p._OrtCreateTensor(c(e),o,u,l,r.length);if(0===n)throw new Error("Can\'t create a tensor");_.push(n)}finally{p.stackRestore(s)}}const t=p.stackSave(),o=p.stackAlloc(4*m),u=p.stackAlloc(4*m),h=p.stackAlloc(4*g),A=p.stackAlloc(4*g);try{let n=o/4,r=u/4,i=h/4,c=A/4;for(let t=0;t<m;t++)p.HEAPU32[n++]=_[t],p.HEAPU32[r++]=y[e[t]];for(let t=0;t<g;t++)p.HEAPU32[i++]=0,p.HEAPU32[c++]=b[a[t]];let f=p._OrtRun(d,u,o,m,A,g,h,v);const w=[];if(0===f)for(let t=0;t<g;t++){const e=p.HEAPU32[h/4+t],n=p.stackSave(),r=p.stackAlloc(16);let a,i=0;try{if(f=p._OrtGetTensorData(e,r,r+4,r+8,r+12),0!==f)throw new Error(`Can\'t access output tensor data. error code = ${f}`);let t=r/4;const o=p.HEAPU32[t++];i=p.HEAPU32[t++];const u=p.HEAPU32[t++],c=p.HEAPU32[t++],h=[];for(let t=0;t<c;t++)h.push(p.HEAPU32[u/4+t]);p._OrtFree(u);const d=0===h.length?1:h.reduce(((t,e)=>t*e));if(a=s(o),"string"===a){const t=[];let e=i/4;for(let n=0;n<d;n++){const r=p.HEAPU32[e++],a=n===d-1?void 0:p.HEAPU32[e]-r;t.push(p.UTF8ToString(r,a))}w.push([a,h,t])}else{const t=new(l(a))(d);new Uint8Array(t.buffer,t.byteOffset,t.byteLength).set(p.HEAPU8.subarray(i,i+t.byteLength)),w.push([a,h,t])}}finally{p.stackRestore(n),"string"===a&&i&&p._free(i),p._OrtReleaseTensor(e)}}if(0===f)return w;throw new Error(`failed to call OrtRun(). error code = ${f}.`)}finally{p.stackRestore(t)}}finally{_.forEach(p._OrtReleaseTensor),O.forEach(p._free),p._OrtReleaseRunOptions(v),w.forEach(p._free)}},e.endProfiling=t=>{const e=(0,o.getInstance)(),n=u.get(t);if(!n)throw new Error("invalid session id");const r=n[0],a=e._OrtEndProfiling(r);if(0===a)throw new Error("Can\'t get an profile file name");e._OrtFree(a)},e.extractTransferableBuffers=t=>{const e=[];for(const n of t){const t=n[2];!Array.isArray(t)&&t.buffer&&e.push(t.buffer)}return e}},361:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var a=Object.getOwnPropertyDescriptor(e,n);a&&!("get"in a?!e.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,a)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),a=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&r(e,t,n);return a(e,t),e},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.dispose=e.getInstance=e.initializeWebAssembly=void 0;const u=i(n(449)),c=o(n(932)),s=n(474);let l,f=!1,p=!1,h=!1;const d=(t,e)=>e?t?"ort-wasm-simd-threaded.wasm":"ort-wasm-threaded.wasm":t?"ort-wasm-simd.wasm":"ort-wasm.wasm";e.initializeWebAssembly=async t=>{if(f)return Promise.resolve();if(p)throw new Error("multiple calls to \'initializeWebAssembly()\' detected.");if(h)throw new Error("previous call to \'initializeWebAssembly()\' failed.");p=!0;const e=t.initTimeout,r=t.numThreads,a=t.simd,i=r>1&&(()=>{try{return"undefined"!=typeof SharedArrayBuffer&&("undefined"!=typeof MessageChannel&&(new MessageChannel).port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11])))}catch(t){return!1}})(),o=a&&(()=>{try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,30,1,28,0,65,0,253,15,253,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,253,186,1,26,11]))}catch(t){return!1}})(),y="string"==typeof t.wasmPaths?t.wasmPaths:void 0,b=d(!1,i),m=d(o,i),g="object"==typeof t.wasmPaths?t.wasmPaths[m]:void 0;let v=!1;const w=[];if(e>0&&w.push(new Promise((t=>{setTimeout((()=>{v=!0,t()}),e)}))),w.push(new Promise(((t,e)=>{const r=i?s:c.default,a={locateFile:(t,e)=>i&&t.endsWith(".worker.js")&&"undefined"!=typeof Blob?URL.createObjectURL(new Blob([n(154)],{type:"text/javascript"})):t===b?null!=g?g:(null!=y?y:e)+m:e+t};if(i)if("undefined"==typeof Blob)a.mainScriptUrlOrBlob=u.join("/","ort-wasm-threaded.js");else{const t=`var ortWasmThreaded=(function(){var _scriptDir;return ${r.toString()}})();`;a.mainScriptUrlOrBlob=new Blob([t],{type:"text/javascript"})}r(a).then((e=>{p=!1,f=!0,l=e,t()}),(t=>{p=!1,h=!0,e(t)}))}))),await Promise.race(w),v)throw new Error(`WebAssembly backend initializing failed due to timeout: ${e}ms`)},e.getInstance=()=>{if(f&&l)return l;throw new Error("WebAssembly is not initialized yet.")},e.dispose=()=>{var t;!f||p||h||(p=!0,null===(t=l.PThread)||void 0===t||t.terminateAllThreads(),l=void 0,p=!1,f=!1,h=!0)}},154:t=>{"use strict";t.exports=\'"use strict";var e={},t="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node;if(t){var r=require("worker_threads"),a=r.parentPort;a.on("message",(e=>onmessage({data:e})));var o=require("fs");Object.assign(global,{self:global,require:require,Module:e,location:{href:__filename},Worker:r.Worker,importScripts:function(e){(0,eval)(o.readFileSync(e,"utf8"))},postMessage:function(e){a.postMessage(e)},performance:global.performance||{now:function(){return Date.now()}}})}var s=!1,n=[],i=function(){var e=Array.prototype.slice.call(arguments).join(" ");t?o.writeSync(2,e+"\\\\n"):console.error(e)};self.alert=function(){var t=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:t,threadId:e._pthread_self()})},e.instantiateWasm=(t,r)=>{var a=new WebAssembly.Instance(e.wasmModule,t);return r(a),e.wasmModule=null,a.exports},self.onunhandledrejection=e=>{throw e.reason??e},self.onmessage=t=>{try{if("load"===t.data.cmd){if(e.wasmModule=t.data.wasmModule,e.wasmMemory=t.data.wasmMemory,e.buffer=e.wasmMemory.buffer,e.ENVIRONMENT_IS_PTHREAD=!0,"string"==typeof t.data.urlOrBlob)importScripts(t.data.urlOrBlob);else{var r=URL.createObjectURL(t.data.urlOrBlob);importScripts(r),URL.revokeObjectURL(r)}ortWasmThreaded(e).then((function(t){e=t}))}else if("run"===t.data.cmd){e.__performance_now_clock_drift=performance.now()-t.data.time,e.__emscripten_thread_init(t.data.pthread_ptr,0,0,1),e.establishStackSpace(),e.PThread.receiveObjectTransfer(t.data),e.PThread.threadInitTLS(),s||(n.forEach((t=>{e.executeNotifiedProxyingQueue(t)})),n=[],s=!0);try{e.invokeEntryPoint(t.data.start_routine,t.data.arg)}catch(t){if("unwind"!=t){if(!(t instanceof e.ExitStatus))throw t;e.keepRuntimeAlive()||e.__emscripten_thread_exit(t.status)}}}else"cancel"===t.data.cmd?e._pthread_self()&&e.__emscripten_thread_exit(-1):"setimmediate"===t.data.target||("processProxyingQueue"===t.data.cmd?s?e.executeNotifiedProxyingQueue(t.data.queue):n.push(t.data.queue):(i("worker.js received unknown command "+t.data.cmd),i(t.data)))}catch(t){throw i("worker.js onmessage() captured an uncaught exception: "+t),t&&t.stack&&i(t.stack),e.__emscripten_thread_crashed&&e.__emscripten_thread_crashed(),t}};\\n\'},384:()=>{},993:()=>{},908:()=>{},953:()=>{},925:()=>{},449:()=>{}},e={};function n(r){var a=e[r];if(void 0!==a)return a.exports;var i=e[r]={exports:{}};return t[r].call(i.exports,i,i.exports,n),i.exports}n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),(()=>{"use strict";const t=n(349),e=n(361);self.onmessage=n=>{switch(n.data.type){case"init-wasm":(0,e.initializeWebAssembly)(n.data.in).then((()=>postMessage({type:"init-wasm"})),(t=>postMessage({type:"init-wasm",err:t})));break;case"init-ort":try{const{numThreads:e,loggingLevel:r}=n.data.in;(0,t.initOrt)(e,r),postMessage({type:"init-ort"})}catch(t){postMessage({type:"init-ort",err:t})}break;case"create_allocate":try{const{model:e}=n.data.in,r=(0,t.createSessionAllocate)(e);postMessage({type:"create_allocate",out:r})}catch(t){postMessage({type:"create_allocate",err:t})}break;case"create_finalize":try{const{modeldata:e,options:r}=n.data.in,a=(0,t.createSessionFinalize)(e,r);postMessage({type:"create_finalize",out:a})}catch(t){postMessage({type:"create_finalize",err:t})}break;case"create":try{const{model:e,options:r}=n.data.in,a=(0,t.createSession)(e,r);postMessage({type:"create",out:a})}catch(t){postMessage({type:"create",err:t})}break;case"release":try{const e=n.data.in;(0,t.releaseSession)(e),postMessage({type:"release"})}catch(t){postMessage({type:"release",err:t})}break;case"run":try{const{sessionId:e,inputIndices:r,inputs:a,outputIndices:i,options:o}=n.data.in,u=(0,t.run)(e,r,a,i,o);postMessage({type:"run",out:u},(0,t.extractTransferableBuffers)(u))}catch(t){postMessage({type:"run",err:t})}break;case"end-profiling":try{const e=n.data.in;(0,t.endProfiling)(e),postMessage({type:"end-profiling"})}catch(t){postMessage({type:"end-profiling",err:t})}}}})()})();\n',"Worker",void 0,void 0)}},477:i=>{i.exports=function(e,s,c,h){var $=self||window;try{try{var _;try{_=new $.Blob([e])}catch{(_=new($.BlobBuilder||$.WebKitBlobBuilder||$.MozBlobBuilder||$.MSBlobBuilder)).append(e),_=_.getBlob()}var j=$.URL||$.webkitURL,nt=j.createObjectURL(_),et=new $[s](nt,c);return j.revokeObjectURL(nt),et}catch{return new $[s]("data:application/javascript,".concat(encodeURIComponent(e)),c)}}catch{if(!h)throw Error("Inline worker is not supported");return new $[s](h,c)}}},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}};
|
|
1851
|
-
`},1670:i=>{i.exports=__WEBPACK_EXTERNAL_MODULE__1670__},7067:()=>{},1296:()=>{},1384:()=>{},3993:()=>{},908:()=>{},6953:()=>{},9925:()=>{},2806:()=>{},6449:()=>{},2850:()=>{},5381:()=>{},5686:(i,e,s)=>{s.r(e),s.d(e,{flatbuffers:()=>c});var c={};c.Offset,c.Table,c.SIZEOF_SHORT=2,c.SIZEOF_INT=4,c.FILE_IDENTIFIER_LENGTH=4,c.SIZE_PREFIX_LENGTH=4,c.Encoding={UTF8_BYTES:1,UTF16_STRING:2},c.int32=new Int32Array(2),c.float32=new Float32Array(c.int32.buffer),c.float64=new Float64Array(c.int32.buffer),c.isLittleEndian=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1,c.Long=function(h,$){this.low=0|h,this.high=0|$},c.Long.create=function(h,$){return h==0&&$==0?c.Long.ZERO:new c.Long(h,$)},c.Long.prototype.toFloat64=function(){return(this.low>>>0)+4294967296*this.high},c.Long.prototype.equals=function(h){return this.low==h.low&&this.high==h.high},c.Long.ZERO=new c.Long(0,0),c.Builder=function(h){if(h)$=h;else var $=1024;this.bb=c.ByteBuffer.allocate($),this.space=$,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},c.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},c.Builder.prototype.forceDefaults=function(h){this.force_defaults=h},c.Builder.prototype.dataBuffer=function(){return this.bb},c.Builder.prototype.asUint8Array=function(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())},c.Builder.prototype.prep=function(h,$){h>this.minalign&&(this.minalign=h);for(var _=1+~(this.bb.capacity()-this.space+$)&h-1;this.space<_+h+$;){var j=this.bb.capacity();this.bb=c.Builder.growByteBuffer(this.bb),this.space+=this.bb.capacity()-j}this.pad(_)},c.Builder.prototype.pad=function(h){for(var $=0;$<h;$++)this.bb.writeInt8(--this.space,0)},c.Builder.prototype.writeInt8=function(h){this.bb.writeInt8(this.space-=1,h)},c.Builder.prototype.writeInt16=function(h){this.bb.writeInt16(this.space-=2,h)},c.Builder.prototype.writeInt32=function(h){this.bb.writeInt32(this.space-=4,h)},c.Builder.prototype.writeInt64=function(h){this.bb.writeInt64(this.space-=8,h)},c.Builder.prototype.writeFloat32=function(h){this.bb.writeFloat32(this.space-=4,h)},c.Builder.prototype.writeFloat64=function(h){this.bb.writeFloat64(this.space-=8,h)},c.Builder.prototype.addInt8=function(h){this.prep(1,0),this.writeInt8(h)},c.Builder.prototype.addInt16=function(h){this.prep(2,0),this.writeInt16(h)},c.Builder.prototype.addInt32=function(h){this.prep(4,0),this.writeInt32(h)},c.Builder.prototype.addInt64=function(h){this.prep(8,0),this.writeInt64(h)},c.Builder.prototype.addFloat32=function(h){this.prep(4,0),this.writeFloat32(h)},c.Builder.prototype.addFloat64=function(h){this.prep(8,0),this.writeFloat64(h)},c.Builder.prototype.addFieldInt8=function(h,$,_){(this.force_defaults||$!=_)&&(this.addInt8($),this.slot(h))},c.Builder.prototype.addFieldInt16=function(h,$,_){(this.force_defaults||$!=_)&&(this.addInt16($),this.slot(h))},c.Builder.prototype.addFieldInt32=function(h,$,_){(this.force_defaults||$!=_)&&(this.addInt32($),this.slot(h))},c.Builder.prototype.addFieldInt64=function(h,$,_){!this.force_defaults&&$.equals(_)||(this.addInt64($),this.slot(h))},c.Builder.prototype.addFieldFloat32=function(h,$,_){(this.force_defaults||$!=_)&&(this.addFloat32($),this.slot(h))},c.Builder.prototype.addFieldFloat64=function(h,$,_){(this.force_defaults||$!=_)&&(this.addFloat64($),this.slot(h))},c.Builder.prototype.addFieldOffset=function(h,$,_){(this.force_defaults||$!=_)&&(this.addOffset($),this.slot(h))},c.Builder.prototype.addFieldStruct=function(h,$,_){$!=_&&(this.nested($),this.slot(h))},c.Builder.prototype.nested=function(h){if(h!=this.offset())throw new Error("FlatBuffers: struct must be serialized inline.")},c.Builder.prototype.notNested=function(){if(this.isNested)throw new Error("FlatBuffers: object serialization must not be nested.")},c.Builder.prototype.slot=function(h){this.vtable[h]=this.offset()},c.Builder.prototype.offset=function(){return this.bb.capacity()-this.space},c.Builder.growByteBuffer=function(h){var $=h.capacity();if(3221225472&$)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");var _=$<<1,j=c.ByteBuffer.allocate(_);return j.setPosition(_-$),j.bytes().set(h.bytes(),_-$),j},c.Builder.prototype.addOffset=function(h){this.prep(c.SIZEOF_INT,0),this.writeInt32(this.offset()-h+c.SIZEOF_INT)},c.Builder.prototype.startObject=function(h){this.notNested(),this.vtable==null&&(this.vtable=[]),this.vtable_in_use=h;for(var $=0;$<h;$++)this.vtable[$]=0;this.isNested=!0,this.object_start=this.offset()},c.Builder.prototype.endObject=function(){if(this.vtable==null||!this.isNested)throw new Error("FlatBuffers: endObject called without startObject");this.addInt32(0);for(var h=this.offset(),$=this.vtable_in_use-1;$>=0&&this.vtable[$]==0;$--);for(var _=$+1;$>=0;$--)this.addInt16(this.vtable[$]!=0?h-this.vtable[$]:0);this.addInt16(h-this.object_start);var j=(_+2)*c.SIZEOF_SHORT;this.addInt16(j);var nt=0,et=this.space;e:for($=0;$<this.vtables.length;$++){var b=this.bb.capacity()-this.vtables[$];if(j==this.bb.readInt16(b)){for(var a=c.SIZEOF_SHORT;a<j;a+=c.SIZEOF_SHORT)if(this.bb.readInt16(et+a)!=this.bb.readInt16(b+a))continue e;nt=this.vtables[$];break}}return nt?(this.space=this.bb.capacity()-h,this.bb.writeInt32(this.space,nt-h)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-h,this.offset()-h)),this.isNested=!1,h},c.Builder.prototype.finish=function(h,$,_){var j=_?c.SIZE_PREFIX_LENGTH:0;if($){var nt=$;if(this.prep(this.minalign,c.SIZEOF_INT+c.FILE_IDENTIFIER_LENGTH+j),nt.length!=c.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+c.FILE_IDENTIFIER_LENGTH);for(var et=c.FILE_IDENTIFIER_LENGTH-1;et>=0;et--)this.writeInt8(nt.charCodeAt(et))}this.prep(this.minalign,c.SIZEOF_INT+j),this.addOffset(h),j&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)},c.Builder.prototype.finishSizePrefixed=function(h,$){this.finish(h,$,!0)},c.Builder.prototype.requiredField=function(h,$){var _=this.bb.capacity()-h,j=_-this.bb.readInt32(_);if(this.bb.readInt16(j+$)==0)throw new Error("FlatBuffers: field "+$+" must be set")},c.Builder.prototype.startVector=function(h,$,_){this.notNested(),this.vector_num_elems=$,this.prep(c.SIZEOF_INT,h*$),this.prep(_,h*$)},c.Builder.prototype.endVector=function(){return this.writeInt32(this.vector_num_elems),this.offset()},c.Builder.prototype.createString=function(h){if(h instanceof Uint8Array)var $=h;else{$=[];for(var _=0;_<h.length;){var j,nt=h.charCodeAt(_++);(j=nt<55296||nt>=56320?nt:(nt<<10)+h.charCodeAt(_++)+-56613888)<128?$.push(j):(j<2048?$.push(j>>6&31|192):(j<65536?$.push(j>>12&15|224):$.push(j>>18&7|240,j>>12&63|128),$.push(j>>6&63|128)),$.push(63&j|128))}}this.addInt8(0),this.startVector(1,$.length,1),this.bb.setPosition(this.space-=$.length),_=0;for(var et=this.space,b=this.bb.bytes();_<$.length;_++)b[et++]=$[_];return this.endVector()},c.Builder.prototype.createLong=function(h,$){return c.Long.create(h,$)},c.ByteBuffer=function(h){this.bytes_=h,this.position_=0},c.ByteBuffer.allocate=function(h){return new c.ByteBuffer(new Uint8Array(h))},c.ByteBuffer.prototype.clear=function(){this.position_=0},c.ByteBuffer.prototype.bytes=function(){return this.bytes_},c.ByteBuffer.prototype.position=function(){return this.position_},c.ByteBuffer.prototype.setPosition=function(h){this.position_=h},c.ByteBuffer.prototype.capacity=function(){return this.bytes_.length},c.ByteBuffer.prototype.readInt8=function(h){return this.readUint8(h)<<24>>24},c.ByteBuffer.prototype.readUint8=function(h){return this.bytes_[h]},c.ByteBuffer.prototype.readInt16=function(h){return this.readUint16(h)<<16>>16},c.ByteBuffer.prototype.readUint16=function(h){return this.bytes_[h]|this.bytes_[h+1]<<8},c.ByteBuffer.prototype.readInt32=function(h){return this.bytes_[h]|this.bytes_[h+1]<<8|this.bytes_[h+2]<<16|this.bytes_[h+3]<<24},c.ByteBuffer.prototype.readUint32=function(h){return this.readInt32(h)>>>0},c.ByteBuffer.prototype.readInt64=function(h){return new c.Long(this.readInt32(h),this.readInt32(h+4))},c.ByteBuffer.prototype.readUint64=function(h){return new c.Long(this.readUint32(h),this.readUint32(h+4))},c.ByteBuffer.prototype.readFloat32=function(h){return c.int32[0]=this.readInt32(h),c.float32[0]},c.ByteBuffer.prototype.readFloat64=function(h){return c.int32[c.isLittleEndian?0:1]=this.readInt32(h),c.int32[c.isLittleEndian?1:0]=this.readInt32(h+4),c.float64[0]},c.ByteBuffer.prototype.writeInt8=function(h,$){this.bytes_[h]=$},c.ByteBuffer.prototype.writeUint8=function(h,$){this.bytes_[h]=$},c.ByteBuffer.prototype.writeInt16=function(h,$){this.bytes_[h]=$,this.bytes_[h+1]=$>>8},c.ByteBuffer.prototype.writeUint16=function(h,$){this.bytes_[h]=$,this.bytes_[h+1]=$>>8},c.ByteBuffer.prototype.writeInt32=function(h,$){this.bytes_[h]=$,this.bytes_[h+1]=$>>8,this.bytes_[h+2]=$>>16,this.bytes_[h+3]=$>>24},c.ByteBuffer.prototype.writeUint32=function(h,$){this.bytes_[h]=$,this.bytes_[h+1]=$>>8,this.bytes_[h+2]=$>>16,this.bytes_[h+3]=$>>24},c.ByteBuffer.prototype.writeInt64=function(h,$){this.writeInt32(h,$.low),this.writeInt32(h+4,$.high)},c.ByteBuffer.prototype.writeUint64=function(h,$){this.writeUint32(h,$.low),this.writeUint32(h+4,$.high)},c.ByteBuffer.prototype.writeFloat32=function(h,$){c.float32[0]=$,this.writeInt32(h,c.int32[0])},c.ByteBuffer.prototype.writeFloat64=function(h,$){c.float64[0]=$,this.writeInt32(h,c.int32[c.isLittleEndian?0:1]),this.writeInt32(h+4,c.int32[c.isLittleEndian?1:0])},c.ByteBuffer.prototype.getBufferIdentifier=function(){if(this.bytes_.length<this.position_+c.SIZEOF_INT+c.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");for(var h="",$=0;$<c.FILE_IDENTIFIER_LENGTH;$++)h+=String.fromCharCode(this.readInt8(this.position_+c.SIZEOF_INT+$));return h},c.ByteBuffer.prototype.__offset=function(h,$){var _=h-this.readInt32(h);return $<this.readInt16(_)?this.readInt16(_+$):0},c.ByteBuffer.prototype.__union=function(h,$){return h.bb_pos=$+this.readInt32($),h.bb=this,h},c.ByteBuffer.prototype.__string=function(h,$){h+=this.readInt32(h);var _=this.readInt32(h),j="",nt=0;if(h+=c.SIZEOF_INT,$===c.Encoding.UTF8_BYTES)return this.bytes_.subarray(h,h+_);for(;nt<_;){var et,b=this.readUint8(h+nt++);if(b<192)et=b;else{var a=this.readUint8(h+nt++);if(b<224)et=(31&b)<<6|63&a;else{var o=this.readUint8(h+nt++);et=b<240?(15&b)<<12|(63&a)<<6|63&o:(7&b)<<18|(63&a)<<12|(63&o)<<6|63&this.readUint8(h+nt++)}}et<65536?j+=String.fromCharCode(et):(et-=65536,j+=String.fromCharCode(55296+(et>>10),56320+(1023&et)))}return j},c.ByteBuffer.prototype.__indirect=function(h){return h+this.readInt32(h)},c.ByteBuffer.prototype.__vector=function(h){return h+this.readInt32(h)+c.SIZEOF_INT},c.ByteBuffer.prototype.__vector_len=function(h){return this.readInt32(h+this.readInt32(h))},c.ByteBuffer.prototype.__has_identifier=function(h){if(h.length!=c.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+c.FILE_IDENTIFIER_LENGTH);for(var $=0;$<c.FILE_IDENTIFIER_LENGTH;$++)if(h.charCodeAt($)!=this.readInt8(this.position_+c.SIZEOF_INT+$))return!1;return!0},c.ByteBuffer.prototype.createLong=function(h,$){return c.Long.create(h,$)}}},__webpack_module_cache__={};function __webpack_require__(i){var e=__webpack_module_cache__[i];if(e!==void 0)return e.exports;var s=__webpack_module_cache__[i]={exports:{}};return __webpack_modules__[i].call(s.exports,s,s.exports,__webpack_require__),s.exports}__webpack_require__.n=i=>{var e=i&&i.__esModule?()=>i.default:()=>i;return __webpack_require__.d(e,{a:e}),e},__webpack_require__.d=(i,e)=>{for(var s in e)__webpack_require__.o(e,s)&&!__webpack_require__.o(i,s)&&Object.defineProperty(i,s,{enumerable:!0,get:e[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,e)=>Object.prototype.hasOwnProperty.call(i,e),__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);var ortWeb_minExports=ortWeb_min.exports,assetPath={};Object.defineProperty(assetPath,"__esModule",{value:!0}),assetPath.baseAssetPath=void 0;const isWeb=typeof window<"u"&&typeof window.document<"u",currentScript=isWeb?window.document.currentScript:null;let basePath="/";currentScript&&(basePath=currentScript.src.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")),assetPath.baseAssetPath=basePath;var defaultModelFetcher$1={};Object.defineProperty(defaultModelFetcher$1,"__esModule",{value:!0}),defaultModelFetcher$1.defaultModelFetcher=void 0;const defaultModelFetcher=i=>fetch(i).then(e=>e.arrayBuffer());defaultModelFetcher$1.defaultModelFetcher=defaultModelFetcher;var frameProcessor={},logging={};(function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.log=i.LOG_PREFIX=void 0,i.LOG_PREFIX="[VAD]";const e=["error","debug","warn"];function s(h){return(...$)=>{console[h](i.LOG_PREFIX,...$)}}const c=e.reduce((h,$)=>(h[$]=s($),h),{});i.log=c})(logging);var messages={};Object.defineProperty(messages,"__esModule",{value:!0}),messages.Message=void 0;var Message;(function(i){i.AudioFrame="AUDIO_FRAME",i.SpeechStart="SPEECH_START",i.VADMisfire="VAD_MISFIRE",i.SpeechEnd="SPEECH_END",i.SpeechStop="SPEECH_STOP"})(Message||(messages.Message=Message={})),Object.defineProperty(frameProcessor,"__esModule",{value:!0}),frameProcessor.FrameProcessor=frameProcessor.validateOptions=frameProcessor.defaultV5FrameProcessorOptions=frameProcessor.defaultLegacyFrameProcessorOptions=void 0;const logging_1$3=logging,messages_1=messages,RECOMMENDED_FRAME_SAMPLES=[512,1024,1536];frameProcessor.defaultLegacyFrameProcessorOptions={positiveSpeechThreshold:.5,negativeSpeechThreshold:.5-.15,preSpeechPadFrames:1,redemptionFrames:8,frameSamples:1536,minSpeechFrames:3,submitUserSpeechOnPause:!1},frameProcessor.defaultV5FrameProcessorOptions={positiveSpeechThreshold:.5,negativeSpeechThreshold:.5-.15,preSpeechPadFrames:3,redemptionFrames:24,frameSamples:512,minSpeechFrames:9,submitUserSpeechOnPause:!1};function validateOptions(i){RECOMMENDED_FRAME_SAMPLES.includes(i.frameSamples)||logging_1$3.log.warn("You are using an unusual frame size"),(i.positiveSpeechThreshold<0||i.positiveSpeechThreshold>1)&&logging_1$3.log.error("positiveSpeechThreshold should be a number between 0 and 1"),(i.negativeSpeechThreshold<0||i.negativeSpeechThreshold>i.positiveSpeechThreshold)&&logging_1$3.log.error("negativeSpeechThreshold should be between 0 and positiveSpeechThreshold"),i.preSpeechPadFrames<0&&logging_1$3.log.error("preSpeechPadFrames should be positive"),i.redemptionFrames<0&&logging_1$3.log.error("redemptionFrames should be positive")}frameProcessor.validateOptions=validateOptions;const concatArrays=i=>{const e=i.reduce((c,h)=>(c.push(c.at(-1)+h.length),c),[0]),s=new Float32Array(e.at(-1));return i.forEach((c,h)=>{const $=e[h];s.set(c,$)}),s};class FrameProcessor{constructor(e,s,c){this.modelProcessFunc=e,this.modelResetFunc=s,this.options=c,this.speaking=!1,this.redemptionCounter=0,this.active=!1,this.reset=()=>{this.speaking=!1,this.audioBuffer=[],this.modelResetFunc(),this.redemptionCounter=0},this.pause=()=>(this.active=!1,this.options.submitUserSpeechOnPause?this.endSegment():(this.reset(),{})),this.resume=()=>{this.active=!0},this.endSegment=()=>{const h=this.audioBuffer;this.audioBuffer=[];const $=this.speaking;this.reset();const _=h.reduce((j,nt)=>j+ +nt.isSpeech,0);if($)if(_>=this.options.minSpeechFrames){const j=concatArrays(h.map(nt=>nt.frame));return{msg:messages_1.Message.SpeechEnd,audio:j}}else return{msg:messages_1.Message.VADMisfire};return{}},this.process=async h=>{if(!this.active)return{};const $=await this.modelProcessFunc(h);if(this.audioBuffer.push({frame:h,isSpeech:$.isSpeech>=this.options.positiveSpeechThreshold}),$.isSpeech>=this.options.positiveSpeechThreshold&&this.redemptionCounter&&(this.redemptionCounter=0),$.isSpeech>=this.options.positiveSpeechThreshold&&!this.speaking)return this.speaking=!0,{probs:$,msg:messages_1.Message.SpeechStart,frame:h};if($.isSpeech<this.options.negativeSpeechThreshold&&this.speaking&&++this.redemptionCounter>=this.options.redemptionFrames){this.redemptionCounter=0,this.speaking=!1;const _=this.audioBuffer;if(this.audioBuffer=[],_.reduce((nt,et)=>nt+ +et.isSpeech,0)>=this.options.minSpeechFrames){const nt=concatArrays(_.map(et=>et.frame));return{probs:$,msg:messages_1.Message.SpeechEnd,audio:nt,frame:h}}else return{probs:$,msg:messages_1.Message.VADMisfire,frame:h}}if(!this.speaking)for(;this.audioBuffer.length>this.options.preSpeechPadFrames;)this.audioBuffer.shift();return{probs:$,frame:h}},this.audioBuffer=[],this.reset()}}frameProcessor.FrameProcessor=FrameProcessor;var nonRealTimeVad={},models={},common={};Object.defineProperty(common,"__esModule",{value:!0});var legacy={},_a$1;Object.defineProperty(legacy,"__esModule",{value:!0}),legacy.SileroLegacy=void 0;const logging_1$2=logging;class SileroLegacy{constructor(e,s,c,h,$){this.ortInstance=e,this._session=s,this._h=c,this._c=h,this._sr=$,this.reset_state=()=>{const _=Array(128).fill(0);this._h=new this.ortInstance.Tensor("float32",_,[2,1,64]),this._c=new this.ortInstance.Tensor("float32",_,[2,1,64])},this.process=async _=>{var o;const nt={input:new this.ortInstance.Tensor("float32",_,[1,_.length]),h:this._h,c:this._c,sr:this._sr},et=await this._session.run(nt);this._h=et.hn,this._c=et.cn;const[b]=(o=et.output)==null?void 0:o.data;return{notSpeech:1-b,isSpeech:b}}}}legacy.SileroLegacy=SileroLegacy,_a$1=SileroLegacy,SileroLegacy.new=async(i,e)=>{logging_1$2.log.debug("initializing vad");const s=await e(),c=await i.InferenceSession.create(s),h=new i.Tensor("int64",[16000n]),$=Array(2*64).fill(0),_=new i.Tensor("float32",$,[2,1,64]),j=new i.Tensor("float32",$,[2,1,64]);return logging_1$2.log.debug("vad is initialized"),new _a$1(i,c,_,j,h)};var v5={},_a;Object.defineProperty(v5,"__esModule",{value:!0}),v5.SileroV5=void 0;const logging_1$1=logging;function getNewState(i){const e=Array(256).fill(0);return new i.Tensor("float32",e,[2,1,128])}class SileroV5{constructor(e,s,c,h){this._session=e,this._state=s,this._sr=c,this.ortInstance=h,this.reset_state=()=>{this._state=getNewState(this.ortInstance)},this.process=async $=>{var a;const j={input:new this.ortInstance.Tensor("float32",$,[1,$.length]),state:this._state,sr:this._sr},nt=await this._session.run(j);this._state=nt.stateN;const[et]=(a=nt.output)==null?void 0:a.data;return{notSpeech:1-et,isSpeech:et}}}}v5.SileroV5=SileroV5,_a=SileroV5,SileroV5.new=async(i,e)=>{logging_1$1.log.debug("Loading VAD...");const s=await e(),c=await i.InferenceSession.create(s),h=new i.Tensor("int64",[16000n]),$=getNewState(i);return logging_1$1.log.debug("...finished loading VAD"),new _a(c,$,h,i)},function(i){var e=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function($,_,j,nt){nt===void 0&&(nt=j);var et=Object.getOwnPropertyDescriptor(_,j);(!et||("get"in et?!_.__esModule:et.writable||et.configurable))&&(et={enumerable:!0,get:function(){return _[j]}}),Object.defineProperty($,nt,et)}:function($,_,j,nt){nt===void 0&&(nt=j),$[nt]=_[j]}),s=commonjsGlobal&&commonjsGlobal.__exportStar||function($,_){for(var j in $)j!=="default"&&!Object.prototype.hasOwnProperty.call(_,j)&&e(_,$,j)};Object.defineProperty(i,"__esModule",{value:!0}),i.SileroV5=i.SileroLegacy=void 0,s(common,i);var c=legacy;Object.defineProperty(i,"SileroLegacy",{enumerable:!0,get:function(){return c.SileroLegacy}});var h=v5;Object.defineProperty(i,"SileroV5",{enumerable:!0,get:function(){return h.SileroV5}})}(models);var resampler={};Object.defineProperty(resampler,"__esModule",{value:!0}),resampler.Resampler=void 0;const logging_1=logging;class Resampler{constructor(e){this.options=e,this.process=s=>{const c=[];for(const h of s)for(this.inputBuffer.push(h);this.hasEnoughDataForFrame();){const $=this.generateOutputFrame();c.push($)}return c},this.stream=async function*(s){for(const c of s)for(this.inputBuffer.push(c);this.hasEnoughDataForFrame();)yield this.generateOutputFrame()},e.nativeSampleRate<16e3&&logging_1.log.error("nativeSampleRate is too low. Should have 16000 = targetSampleRate <= nativeSampleRate"),this.inputBuffer=[]}hasEnoughDataForFrame(){return this.inputBuffer.length*this.options.targetSampleRate/this.options.nativeSampleRate>=this.options.targetFrameSize}generateOutputFrame(){const e=new Float32Array(this.options.targetFrameSize);let s=0,c=0;for(;s<this.options.targetFrameSize;){let h=0,$=0;for(;c<Math.min(this.inputBuffer.length,(s+1)*this.options.nativeSampleRate/this.options.targetSampleRate);){const _=this.inputBuffer[c];_!==void 0&&(h+=_,$++),c++}e[s]=h/$,s++}return this.inputBuffer=this.inputBuffer.slice(c),e}}resampler.Resampler=Resampler,function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.PlatformAgnosticNonRealTimeVAD=i.defaultNonRealTimeVADOptions=void 0;const e=frameProcessor,s=messages,c=models,h=resampler;i.defaultNonRealTimeVADOptions={...e.defaultLegacyFrameProcessorOptions,ortConfig:void 0};class ${static async _new(j,nt,et={}){const b={...i.defaultNonRealTimeVADOptions,...et};b.ortConfig!==void 0&&b.ortConfig(nt);const a=new this(j,nt,b);return await a.init(),a}constructor(j,nt,et){this.modelFetcher=j,this.ort=nt,this.options=et,this.init=async()=>{const b=await c.SileroLegacy.new(this.ort,this.modelFetcher);this.frameProcessor=new e.FrameProcessor(b.process,b.reset_state,{frameSamples:this.options.frameSamples,positiveSpeechThreshold:this.options.positiveSpeechThreshold,negativeSpeechThreshold:this.options.negativeSpeechThreshold,redemptionFrames:this.options.redemptionFrames,preSpeechPadFrames:this.options.preSpeechPadFrames,minSpeechFrames:this.options.minSpeechFrames,submitUserSpeechOnPause:this.options.submitUserSpeechOnPause}),this.frameProcessor.resume()},this.run=async function*(b,a){const o={nativeSampleRate:a,targetSampleRate:16e3,targetFrameSize:this.options.frameSamples},d=new h.Resampler(o);let g=0,rt=0,st=0;for await(const it of d.stream(b)){const{msg:at,audio:ut}=await this.frameProcessor.process(it);switch(at){case s.Message.SpeechStart:g=st*this.options.frameSamples/16;break;case s.Message.SpeechEnd:rt=(st+1)*this.options.frameSamples/16,yield{audio:ut,start:g,end:rt};break}st++}const{msg:tt,audio:ot}=this.frameProcessor.endSegment();tt==s.Message.SpeechEnd&&(yield{audio:ot,start:g,end:st*this.options.frameSamples/16})},(0,e.validateOptions)(et)}}i.PlatformAgnosticNonRealTimeVAD=$}(nonRealTimeVad);var utils={};Object.defineProperty(utils,"__esModule",{value:!0}),utils.audioFileToArray=utils.encodeWAV=utils.arrayBufferToBase64=utils.minFramesForTargetMS=void 0;function minFramesForTargetMS(i,e,s=16e3){return Math.ceil(i*s/1e3/e)}utils.minFramesForTargetMS=minFramesForTargetMS;function arrayBufferToBase64(i){const e=new Uint8Array(i),s=e.byteLength,c=new Array(s);for(var h=0;h<s;h++){const $=e[h];if($===void 0)break;c[h]=String.fromCharCode($)}return btoa(c.join(""))}utils.arrayBufferToBase64=arrayBufferToBase64;function encodeWAV(i,e=3,s=16e3,c=1,h=32){var $=h/8,_=c*$,j=new ArrayBuffer(44+i.length*$),nt=new DataView(j);return writeString(nt,0,"RIFF"),nt.setUint32(4,36+i.length*$,!0),writeString(nt,8,"WAVE"),writeString(nt,12,"fmt "),nt.setUint32(16,16,!0),nt.setUint16(20,e,!0),nt.setUint16(22,c,!0),nt.setUint32(24,s,!0),nt.setUint32(28,s*_,!0),nt.setUint16(32,_,!0),nt.setUint16(34,h,!0),writeString(nt,36,"data"),nt.setUint32(40,i.length*$,!0),e===1?floatTo16BitPCM(nt,44,i):writeFloat32(nt,44,i),j}utils.encodeWAV=encodeWAV;function writeFloat32(i,e,s){for(var c=0;c<s.length;c++,e+=4)i.setFloat32(e,s[c],!0)}function floatTo16BitPCM(i,e,s){for(var c=0;c<s.length;c++,e+=2){var h=Math.max(-1,Math.min(1,s[c]));i.setInt16(e,h<0?h*32768:h*32767,!0)}}function writeString(i,e,s){for(var c=0;c<s.length;c++)i.setUint8(e+c,s.charCodeAt(c))}async function audioFileToArray(i){const e=new OfflineAudioContext(1,1,44100),s=new FileReader;let c=null;if(await new Promise(_=>{s.addEventListener("loadend",j=>{const nt=s.result;e.decodeAudioData(nt,et=>{c=et,e.startRendering().then(b=>{console.log("Rendering completed successfully"),_()}).catch(b=>{console.error(`Rendering failed: ${b}`)})},et=>{console.log(`Error with decoding audio data: ${et}`)})}),s.readAsArrayBuffer(i)}),c===null)throw Error("some shit");let h=c,$=new Float32Array(h.length);for(let _=0;_<h.length;_++)for(let j=0;j<h.numberOfChannels;j++)$[_]+=h.getChannelData(j)[_];return{audio:$,sampleRate:h.sampleRate}}utils.audioFileToArray=audioFileToArray;var realTimeVad={};(function(i){var e=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(tt,ot,it,at){at===void 0&&(at=it);var ut=Object.getOwnPropertyDescriptor(ot,it);(!ut||("get"in ut?!ot.__esModule:ut.writable||ut.configurable))&&(ut={enumerable:!0,get:function(){return ot[it]}}),Object.defineProperty(tt,at,ut)}:function(tt,ot,it,at){at===void 0&&(at=it),tt[at]=ot[it]}),s=commonjsGlobal&&commonjsGlobal.__setModuleDefault||(Object.create?function(tt,ot){Object.defineProperty(tt,"default",{enumerable:!0,value:ot})}:function(tt,ot){tt.default=ot}),c=commonjsGlobal&&commonjsGlobal.__importStar||function(tt){if(tt&&tt.__esModule)return tt;var ot={};if(tt!=null)for(var it in tt)it!=="default"&&Object.prototype.hasOwnProperty.call(tt,it)&&e(ot,tt,it);return s(ot,tt),ot};Object.defineProperty(i,"__esModule",{value:!0}),i.AudioNodeVAD=i.MicVAD=i.getDefaultRealTimeVADOptions=i.ort=i.DEFAULT_MODEL=void 0;const h=c(ortWeb_minExports),$=defaultModelFetcher$1,_=frameProcessor,j=logging,nt=messages,et=models,b=resampler;i.DEFAULT_MODEL="legacy",i.ort=h;const a="vad.worklet.bundle.min.js",o="silero_vad_v5.onnx",d="silero_vad_legacy.onnx",g=tt=>({...tt==="v5"?_.defaultV5FrameProcessorOptions:_.defaultLegacyFrameProcessorOptions,onFrameProcessed:it=>{},onVADMisfire:()=>{j.log.debug("VAD misfire")},onSpeechStart:()=>{j.log.debug("Detected speech start")},onSpeechEnd:()=>{j.log.debug("Detected speech end")},baseAssetPath:"https://cdn.jsdelivr.net/npm/@ricky0123/vad-web@0.0.22/dist/",onnxWASMBasePath:"https://cdn.jsdelivr.net/npm/onnxruntime-web@1.14.0/dist/",stream:void 0,ortConfig:void 0,model:i.DEFAULT_MODEL,workletOptions:{}});i.getDefaultRealTimeVADOptions=g;class rt{static async new(ot={}){const it={...(0,i.getDefaultRealTimeVADOptions)(ot.model??i.DEFAULT_MODEL),...ot};(0,_.validateOptions)(it);let at;it.stream===void 0?at=await navigator.mediaDevices.getUserMedia({audio:{...it.additionalAudioConstraints,channelCount:1,echoCancellation:!0,autoGainControl:!0,noiseSuppression:!0}}):at=it.stream;const ut=new AudioContext,lt=new MediaStreamAudioSourceNode(ut,{mediaStream:at}),ct=await st.new(ut,it);return ct.receive(lt),new rt(it,ut,at,ct,lt)}constructor(ot,it,at,ut,lt,ct=!1){this.options=ot,this.audioContext=it,this.stream=at,this.audioNodeVAD=ut,this.sourceNode=lt,this.listening=ct,this.pause=()=>{this.audioNodeVAD.pause(),this.listening=!1},this.start=()=>{this.audioNodeVAD.start(),this.listening=!0},this.destroy=()=>{this.listening&&this.pause(),this.options.stream===void 0&&this.stream.getTracks().forEach(ft=>ft.stop()),this.sourceNode.disconnect(),this.audioNodeVAD.destroy(),this.audioContext.close()}}}i.MicVAD=rt;class st{static async new(ot,it={}){const at={...(0,i.getDefaultRealTimeVADOptions)(it.model??i.DEFAULT_MODEL),...it};(0,_.validateOptions)(at),i.ort.env.wasm.wasmPaths=at.onnxWASMBasePath,at.ortConfig!==void 0&&at.ortConfig(i.ort);const ut=at.model==="v5"?o:d,lt=at.baseAssetPath+ut,ct=at.model==="v5"?et.SileroV5.new:et.SileroLegacy.new;let ft;try{ft=await ct(i.ort,()=>(0,$.defaultModelFetcher)(lt))}catch(St){throw console.error(`Encountered an error while loading model file ${lt}`),St}const dt=new _.FrameProcessor(ft.process,ft.reset_state,{frameSamples:at.frameSamples,positiveSpeechThreshold:at.positiveSpeechThreshold,negativeSpeechThreshold:at.negativeSpeechThreshold,redemptionFrames:at.redemptionFrames,preSpeechPadFrames:at.preSpeechPadFrames,minSpeechFrames:at.minSpeechFrames,submitUserSpeechOnPause:at.submitUserSpeechOnPause}),yt=new st(ot,at,dt);return await yt.setupAudioNode(),yt}constructor(ot,it,at){this.ctx=ot,this.options=it,this.bufferIndex=0,this.pause=()=>{const ut=this.frameProcessor.pause();this.handleFrameProcessorEvent(ut)},this.start=()=>{this.frameProcessor.resume()},this.receive=ut=>{ut.connect(this.audioNode)},this.processFrame=async ut=>{const lt=await this.frameProcessor.process(ut);this.handleFrameProcessorEvent(lt)},this.handleFrameProcessorEvent=ut=>{switch(ut.probs!==void 0&&this.options.onFrameProcessed(ut.probs,ut.frame),ut.msg){case nt.Message.SpeechStart:this.options.onSpeechStart();break;case nt.Message.VADMisfire:this.options.onVADMisfire();break;case nt.Message.SpeechEnd:this.options.onSpeechEnd(ut.audio);break}},this.destroy=()=>{var ut;this.audioNode instanceof AudioWorkletNode&&this.audioNode.port.postMessage({message:nt.Message.SpeechStop}),this.audioNode.disconnect(),(ut=this.gainNode)==null||ut.disconnect()},this.frameProcessor=at}async setupAudioNode(){if("audioWorklet"in this.ctx&&typeof AudioWorkletNode=="function")try{const ut=this.options.baseAssetPath+a;await this.ctx.audioWorklet.addModule(ut);const lt=this.options.workletOptions??{};lt.processorOptions={...lt.processorOptions??{},frameSamples:this.options.frameSamples},this.audioNode=new AudioWorkletNode(this.ctx,"vad-helper-worklet",lt),this.audioNode.port.onmessage=async ct=>{var ft;switch((ft=ct.data)==null?void 0:ft.message){case nt.Message.AudioFrame:let dt=ct.data.data;dt instanceof ArrayBuffer||(dt=new ArrayBuffer(ct.data.data.byteLength),new Uint8Array(dt).set(new Uint8Array(ct.data.data)));const yt=new Float32Array(dt);await this.processFrame(yt);break}};return}catch(ut){console.log("AudioWorklet setup failed, falling back to ScriptProcessor",ut)}this.resampler=new b.Resampler({nativeSampleRate:this.ctx.sampleRate,targetSampleRate:16e3,targetFrameSize:this.options.frameSamples??480});const it=4096;this.audioNode=this.ctx.createScriptProcessor(it,1,1),this.gainNode=this.ctx.createGain(),this.gainNode.gain.value=0;let at=!1;this.audioNode.onaudioprocess=async ut=>{if(!at){at=!0;try{const lt=ut.inputBuffer.getChannelData(0);if(ut.outputBuffer.getChannelData(0).fill(0),this.resampler){const ft=this.resampler.process(lt);for(const dt of ft)await this.processFrame(dt)}}catch(lt){console.error("Error processing audio:",lt)}finally{at=!1}}},this.audioNode.connect(this.gainNode),this.gainNode.connect(this.ctx.destination)}}i.AudioNodeVAD=st})(realTimeVad),function(i){var e=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(d,g,rt,st){st===void 0&&(st=rt);var tt=Object.getOwnPropertyDescriptor(g,rt);(!tt||("get"in tt?!g.__esModule:tt.writable||tt.configurable))&&(tt={enumerable:!0,get:function(){return g[rt]}}),Object.defineProperty(d,st,tt)}:function(d,g,rt,st){st===void 0&&(st=rt),d[st]=g[rt]}),s=commonjsGlobal&&commonjsGlobal.__setModuleDefault||(Object.create?function(d,g){Object.defineProperty(d,"default",{enumerable:!0,value:g})}:function(d,g){d.default=g}),c=commonjsGlobal&&commonjsGlobal.__importStar||function(d){if(d&&d.__esModule)return d;var g={};if(d!=null)for(var rt in d)rt!=="default"&&Object.prototype.hasOwnProperty.call(d,rt)&&e(g,d,rt);return s(g,d),g};Object.defineProperty(i,"__esModule",{value:!0}),i.NonRealTimeVAD=i.Message=i.FrameProcessor=i.getDefaultRealTimeVADOptions=i.MicVAD=i.DEFAULT_MODEL=i.AudioNodeVAD=i.utils=i.defaultNonRealTimeVADOptions=void 0;const h=c(ortWeb_minExports),$=assetPath,_=defaultModelFetcher$1,j=frameProcessor;Object.defineProperty(i,"FrameProcessor",{enumerable:!0,get:function(){return j.FrameProcessor}});const nt=messages;Object.defineProperty(i,"Message",{enumerable:!0,get:function(){return nt.Message}});const et=nonRealTimeVad,b=utils;i.defaultNonRealTimeVADOptions={modelURL:$.baseAssetPath+"silero_vad_legacy.onnx",modelFetcher:_.defaultModelFetcher};class a extends et.PlatformAgnosticNonRealTimeVAD{static async new(g={}){const{modelURL:rt,modelFetcher:st}={...i.defaultNonRealTimeVADOptions,...g};return await this._new(()=>st(rt),h,g)}}i.NonRealTimeVAD=a,i.utils={audioFileToArray:b.audioFileToArray,minFramesForTargetMS:b.minFramesForTargetMS,arrayBufferToBase64:b.arrayBufferToBase64,encodeWAV:b.encodeWAV};var o=realTimeVad;Object.defineProperty(i,"AudioNodeVAD",{enumerable:!0,get:function(){return o.AudioNodeVAD}}),Object.defineProperty(i,"DEFAULT_MODEL",{enumerable:!0,get:function(){return o.DEFAULT_MODEL}}),Object.defineProperty(i,"MicVAD",{enumerable:!0,get:function(){return o.MicVAD}}),Object.defineProperty(i,"getDefaultRealTimeVADOptions",{enumerable:!0,get:function(){return o.getDefaultRealTimeVADOptions}})}(dist);class VadWebClient{constructor(e,s,c,h,$,_){this.micStream=null,this.is_vad_loading=!0,this.noSpeechStartTime=null,this.recording_started=!1,this.lastWarningTime=null,this.warningCooldownPeriod=2e3,this.vad_past=[],this.last_clip_index=0,this.clip_points=[0],this.sil_duration_acc=0,this.pref_length_samples=e*h,this.desp_length_samples=s*h,this.max_length_samples=c*h,this.shor_thsld=SHORT_SILENCE_THRESHOLD*h,this.long_thsld=LONG_SILENCE_THRESHOLD*h,this.frame_size=FRAME_SIZE,this.speech_pad_frames=PRE_SPEECH_PAD_FRAMES,this.micVad={},this.audioFileManager=$,this.audioBufferManager=_}setDependencies(e,s){this.audioFileManager=e,this.audioBufferManager=s}setCallbacks(e,s,c){this.onVadFramesCallback=e,this.onVadFrameProcessedCallback=s,this.onUserSpeechCallback=c}stopMicStream(){var e,s;try{(s=(e=this.micStream)==null?void 0:e.getTracks)==null||s.call(e).forEach(c=>c.stop())}catch{}finally{this.micStream=null}}checkNoSpeech(e){if(!this.recording_started)return;const s=Date.now();e===0?this.noSpeechStartTime===null?this.noSpeechStartTime=s:s-this.noSpeechStartTime>=1e4&&(this.lastWarningTime===null||s-this.lastWarningTime>=this.warningCooldownPeriod)&&(this.onVadFramesCallback&&this.onVadFramesCallback({message:"No audio detected for a while. Please talk or stop the recording if done.",error_code:ErrorCode.AUDIO_QUALITY_POOR,status_code:HttpStatus.BAD_REQUEST}),this.lastWarningTime=s,this.noSpeechStartTime=s):(this.noSpeechStartTime=null,this.lastWarningTime=null,this.onVadFramesCallback&&this.onVadFramesCallback({message:"Audio captured. Recording continues.",status_code:HttpStatus.OK}))}getMicVad(){return this.micVad}isVadLoading(){return this.is_vad_loading}processVadFrame(e){let s=!1;this.vad_past.length>0&&(e===0&&(this.sil_duration_acc+=1),e===1&&(this.sil_duration_acc=0));const c=(this.vad_past.length-this.last_clip_index)*this.frame_size,h=this.sil_duration_acc*this.frame_size;return c>this.pref_length_samples&&h>this.long_thsld&&(this.last_clip_index=this.vad_past.length-Math.min(Math.floor(this.sil_duration_acc/2),5),this.clip_points.push(this.last_clip_index),this.sil_duration_acc=0,s=!0),c>this.desp_length_samples&&h>this.shor_thsld&&(this.last_clip_index=this.vad_past.length-Math.min(Math.floor(this.sil_duration_acc/2),5),this.clip_points.push(this.last_clip_index),this.sil_duration_acc=0,s=!0),c>=this.max_length_samples&&(this.last_clip_index=this.vad_past.length,this.clip_points.push(this.last_clip_index),this.sil_duration_acc=0,s=!0),this.vad_past.push(e),s?[!0,this.clip_points[this.clip_points.length-1]]:[!1,this.clip_points[this.clip_points.length-1]]}async initVad(e){this.is_vad_loading=!0,this.stopMicStream();let s;try{s=await navigator.mediaDevices.getUserMedia({audio:e?{deviceId:{exact:e}}:!0})}catch(c){if((c==null?void 0:c.name)==="OverconstrainedError"||(c==null?void 0:c.name)==="NotFoundError")s=await navigator.mediaDevices.getUserMedia({audio:!0});else throw c}this.micStream=s;try{const c=await dist.MicVAD.new({stream:s,frameSamples:this.frame_size,preSpeechPadFrames:this.speech_pad_frames,onFrameProcessed:(h,$)=>{var b,a,o;if(this.onVadFrameProcessedCallback&&this.onVadFrameProcessedCallback({probabilities:h,frame:$}),!this.recording_started)return;(b=this.audioFileManager)==null||b.incrementTotalRawSamples($),(a=this.audioBufferManager)==null||a.append($);const{isSpeech:_}=h;let j=0;_>=.5&&(j=1),this.checkNoSpeech(j);const nt=this.processVadFrame(j),et=nt[0];if(console.log("is clip point:",et," at index:",nt[1]),et){const d=(o=this.audioBufferManager)==null?void 0:o.getAudioData();console.log("Processing audio chunk at clip point:",d),d&&this.processAudioChunk({audioFrames:d})}},onSpeechStart:()=>{var h;(h=this.onUserSpeechCallback)==null||h.call(this,!0)},onSpeechEnd:()=>{var h;(h=this.onUserSpeechCallback)==null||h.call(this,!1)}});return this.is_vad_loading=!1,this.micVad=c,!this.is_vad_loading}catch(c){throw console.error("Error initializing VAD:",c),this.stopMicStream(),this.is_vad_loading=!1,c}}async reinitializeVad(e){return await this.initVad(e)}async processAudioChunk({audioFrames:e}){if(!e||!this.audioFileManager||!this.audioBufferManager)return;const c=`audio_${this.audioFileManager.audioChunks.length||0}.${OUTPUT_FORMAT}`,h=this.audioFileManager.getRawSampleDetails(),$=this.audioBufferManager.calculateChunkTimestamps(h.totalRawSamples);try{const _={fileName:c,timestamp:{st:$.start,et:$.end},status:"pending",audioFrames:e},j=this.audioFileManager.updateAudioInfo(_);this.audioFileManager.incrementInsertedSamples(this.audioBufferManager.getCurrentSampleLength(),this.audioBufferManager.getCurrentFrameLength()),this.audioBufferManager.resetBufferState(),console.log("Uploading audio chunk:",c," at index:",j-1),await this.audioFileManager.uploadAudio({audioFrames:e,fileName:c,chunkIndex:j-1})}catch(_){console.error("Error uploading audio chunk:",_)}}startVad(){this.micVad&&typeof this.micVad.start=="function"&&this.micVad.start(),this.recording_started=!0}pauseVad(){this.micVad&&typeof this.micVad.pause=="function"&&this.micVad.pause(),this.recording_started=!1}destroyVad(){this.micVad&&typeof this.micVad.destroy=="function"&&this.micVad.destroy(),this.stopMicStream(),this.recording_started=!1}resetVadWebInstance(){this.micVad&&typeof this.micVad.destroy=="function"&&this.micVad.destroy(),this.stopMicStream(),this.vad_past=[],this.last_clip_index=0,this.clip_points=[0],this.sil_duration_acc=0,this.noSpeechStartTime=null,this.lastWarningTime=null,this.recording_started=!1,this.is_vad_loading=!0}configureVadConstants({pref_length:e,desp_length:s,max_length:c,sr:h,frame_size:$,pre_speech_pad_frames:_,short_thsld:j,long_thsld:nt}){this.pref_length_samples=e*h,this.desp_length_samples=s*h,this.max_length_samples=c*h,this.shor_thsld=j*h,this.long_thsld=nt*h,this.frame_size=$,this.speech_pad_frames=_}}class ChunkedRecorder{constructor(e){this._isPaused=!1,this.eventEmitter=e,this.bufferManager=new AudioBufferManager(SAMPLING_RATE,AUDIO_BUFFER_SIZE_IN_S),this.fileManager=new AudioFileManager,this.vadClient=new VadWebClient(PREF_CHUNK_LENGTH,DESP_CHUNK_LENGTH,MAX_CHUNK_LENGTH,SAMPLING_RATE,this.fileManager,this.bufferManager),this.eventEmitter&&(this.fileManager.setUploadProgressCallback((s,c)=>{}),this.vadClient.setCallbacks(s=>{},s=>{},s=>{}))}initialize(e,s){if(!e.upload_url)throw new Error("Upload URL is required for chunked recording");const c={};s!=null&&s.accessToken&&(c.Authorization=`Bearer ${s.accessToken}`),this.fileManager.setSessionInfo({sessionId:e.session_id,uploadUrl:e.upload_url,uploadHeaders:c}),console.log("ChunkedRecorder initialized with session:",e.session_id)}async start(e){console.log("Starting ChunkedRecorder with deviceId:",e),await this.vadClient.initVad(e);const s=this.vadClient.getMicVad();if((this.vadClient.isVadLoading()||!s||Object.keys(s).length===0)&&await this.vadClient.reinitializeVad(e))throw new Error("VAD instance is not initialized.");this.vadClient.startVad()}pause(){this._isPaused||(this.vadClient.pauseVad(),this._isPaused=!0)}resume(){this._isPaused&&(this.vadClient.startVad(),this._isPaused=!1)}isPaused(){return this._isPaused}async stop(){this._isPaused=!1,this.vadClient.resetVadWebInstance(),await this.fileManager.waitForAllUploads();const e=await this.fileManager.retryFailedUploads(),s=this.fileManager.getTotalAudioChunks().length;return{failedUploads:e,totalFiles:s}}reset(){this._isPaused=!1,this.vadClient.resetVadWebInstance(),this.fileManager.resetFileManagerInstance(),this.bufferManager.resetBufferState()}}class SingleRecorder{constructor(e){this.mediaRecorder=null,this.audioChunks=[],this.uploadUrl="",this.uploadHeaders={},this.stream=null,this._isPaused=!1,this.eventEmitter=e}initialize(e,s){if(!e.upload_url)throw new Error("Upload URL is required for single recording");this.uploadUrl=e.upload_url,s!=null&&s.accessToken&&(this.uploadHeaders.Authorization=`Bearer ${s.accessToken}`)}async start(e){this.audioChunks=[];let s;try{s=await navigator.mediaDevices.getUserMedia({audio:e?{deviceId:{exact:e}}:!0})}catch(c){if((c==null?void 0:c.name)==="OverconstrainedError"||(c==null?void 0:c.name)==="NotFoundError")s=await navigator.mediaDevices.getUserMedia({audio:!0});else throw c}this.stream=s,this.mediaRecorder=new MediaRecorder(s),this.mediaRecorder.ondataavailable=c=>{c.data.size>0&&this.audioChunks.push(c.data)},this.mediaRecorder.start()}pause(){this.mediaRecorder&&this.mediaRecorder.state==="recording"&&(this.mediaRecorder.pause(),this._isPaused=!0)}resume(){this.mediaRecorder&&this.mediaRecorder.state==="paused"&&(this.mediaRecorder.resume(),this._isPaused=!1)}isPaused(){return this._isPaused}async stop(){return this._isPaused=!1,new Promise(e=>{if(!this.mediaRecorder){e({failedUploads:[],totalFiles:0});return}this.mediaRecorder.onstop=async()=>{var $;const s=new Blob(this.audioChunks,{type:"audio/webm"}),c=`recording_${Date.now()}.webm`;(await uploadFileWithFormData(this.uploadUrl,c,s,this.uploadHeaders)).success?e({failedUploads:[],totalFiles:1}):e({failedUploads:[c],totalFiles:1}),($=this.stream)==null||$.getTracks().forEach(_=>_.stop()),this.stream=null,this.mediaRecorder=null},this.mediaRecorder.stop()})}reset(){var e;this._isPaused=!1,this.mediaRecorder&&this.mediaRecorder.state!=="inactive"&&this.mediaRecorder.stop(),(e=this.stream)==null||e.getTracks().forEach(s=>s.stop()),this.stream=null,this.mediaRecorder=null,this.audioChunks=[]}}class EventEmitter{constructor(){this.listeners=new Map}on(e,s){var c;this.listeners.has(e)||this.listeners.set(e,new Set),(c=this.listeners.get(e))==null||c.add(s)}off(e,s){var c;(c=this.listeners.get(e))==null||c.delete(s)}emit(e){var s;(s=this.listeners.get(e.type))==null||s.forEach(c=>{try{c(e)}catch(h){console.error("Error in event listener:",h)}})}}class ScribeClient{static getInstance(e){return ScribeClient.instance||(ScribeClient.instance=new ScribeClient(e)),ScribeClient.instance}static resetInstance(){ScribeClient.instance&&(ScribeClient.instance.reset().catch(()=>{}),ScribeClient.instance=null)}constructor(e){this.discoveryDocument=null,this.currentSession=null,this.isInitialized=!1,this.recorder=null,this.validateConfig(e),this.config={debug:!1,autoDiscovery:!0,...e},this.httpClient=new HttpClient(this.config.apiKey,this.config.accessToken,this.config.debug),this.discoveryAPI=new DiscoveryAPI(this.httpClient),this.sessionAPI=new SessionAPI(this.httpClient,this.config.baseUrl||""),this.eventEmitter=new EventEmitter}async init(){if(this.isInitialized){this.config.debug&&console.log("[ScribeSDK] Already initialized");return}if(!this.config.baseUrl)throw new ValidationError("baseUrl is required for initialization");if(this.config.autoDiscovery)try{this.discoveryDocument=await this.discoveryAPI.getDiscovery(this.config.baseUrl),this.discoveryDocument.endpoints.base_url&&this.sessionAPI.setBaseUrl(this.discoveryDocument.endpoints.base_url),this.emitEvent({type:"discovery:complete",data:this.discoveryDocument}),this.config.debug&&console.log("[ScribeSDK] Discovery complete:",this.discoveryDocument)}catch(e){throw this.emitEvent({type:"error",error:e instanceof Error?e:new Error("Discovery failed")}),e}else this.sessionAPI.setBaseUrl(this.config.baseUrl);this.isInitialized=!0}async startRecording(e){if(this.isInitialized||await this.init(),(await navigator.permissions.query({name:"microphone"})).state!=="granted")throw new ValidationError("Microphone access is required to start recording.");try{const c={templates:e.templates,model:e.model,language_hint:e.languageHint,transcript_language:e.transcriptLanguage,upload_type:e.uploadType||UploadType.CHUNKED,communication_protocol:e.communicationProtocol||"http",additional_data:e.additionalData};return this.currentSession=await this.sessionAPI.createSession(c),this.emitEvent({type:"session:created",data:this.currentSession}),this.config.debug&&console.log("[ScribeSDK] Session created:",this.currentSession),e.uploadType===UploadType.SINGLE?this.recorder=new SingleRecorder(this.eventEmitter):this.recorder=new ChunkedRecorder(this.eventEmitter),this.recorder.initialize(this.currentSession,{accessToken:this.config.accessToken}),await this.recorder.start(e.deviceId),this.currentSession}catch(c){throw this.emitEvent({type:"error",error:c instanceof Error?c:new Error("Failed to start recording")}),c}}pauseRecording(){if(!this.recorder)throw new ValidationError("No active recording to pause");this.recorder.pause(),this.emitEvent({type:"recording:paused"}),this.config.debug&&console.log("[ScribeSDK] Recording paused")}resumeRecording(){if(!this.recorder)throw new ValidationError("No active recording to resume");this.recorder.resume(),this.emitEvent({type:"recording:resumed"}),this.config.debug&&console.log("[ScribeSDK] Recording resumed")}isRecordingPaused(){var e;return((e=this.recorder)==null?void 0:e.isPaused())??!1}async endRecording(){if(!this.currentSession)throw new ValidationError("No active session to end");try{let e=0;if(this.recorder){const{failedUploads:c,totalFiles:h}=await this.recorder.stop();if(c.length>0)throw console.warn("Some audio files failed to upload:",c),new ScribeError(`Failed to upload audio recordings: ${c.join(", ")}`,"upload_failed");e=h||0,this.recorder=null}const s=await this.sessionAPI.endSession(this.currentSession.session_id,e);return this.emitEvent({type:"session:ended",data:s}),this.config.debug&&console.log("[ScribeSDK] Session ended:",s),s}catch(e){throw this.emitEvent({type:"error",error:e instanceof Error?e:new Error("Failed to end recording")}),e}}async reset(){this.recorder&&(await this.recorder.stop().catch(()=>{}),this.recorder=null),this.currentSession=null,this.discoveryAPI.clearCache(),this.discoveryDocument=null,this.isInitialized=!1}emitEvent(e){this.eventEmitter.emit(e)}async getOutputStatus(e){var c;const s=e||((c=this.currentSession)==null?void 0:c.session_id);if(!s)throw new ValidationError("No session ID provided and no active session");try{const h=await this.sessionAPI.getSessionStatus(s);return this.emitEvent({type:"session:status_update",data:h}),this.config.debug&&console.log("[ScribeSDK] Session status:",h),h}catch(h){throw this.emitEvent({type:"error",error:h instanceof Error?h:new Error("Failed to get output status")}),h}}async pollForCompletion(e,s={}){var h;const c=e||((h=this.currentSession)==null?void 0:h.session_id);if(!c)throw new ValidationError("No session ID provided and no active session");return this.sessionAPI.pollSessionStatus(c,{...s,onProgress:$=>{this.emitEvent({type:"session:status_update",data:$}),s.onProgress&&s.onProgress($)}})}getCurrentSession(){return this.currentSession}getDiscoveryDocument(){return this.discoveryDocument}on(e,s){this.eventEmitter.on(e,s)}off(e,s){this.eventEmitter.off(e,s)}clearSession(){this.currentSession=null}validateConfig(e){if(!e.baseUrl)throw new ValidationError("baseUrl is required for initialization")}}ScribeClient.instance=null;function useScribeSession(i){const[e,s]=reactExports.useState("idle"),[c,h]=reactExports.useState(0),[$,_]=reactExports.useState(null),[j,nt]=reactExports.useState(""),et=reactExports.useRef(null),b=reactExports.useRef(null),a=reactExports.useRef(0),o=reactExports.useRef(0),d=reactExports.useCallback((...ft)=>{i.debug&&console.log("[EkaScribe]",...ft)},[i.debug]);reactExports.useEffect(()=>{if(!i.baseUrl){d("Skipping SDK init - no baseUrl provided");return}return(async()=>{try{et.current=new ScribeClient({apiKey:i.apiKey,baseUrl:i.baseUrl,debug:i.debug}),await et.current.init(),d("SDK initialized")}catch(dt){d("Failed to initialize SDK",dt)}})(),()=>{b.current&&clearInterval(b.current)}},[i.apiKey,i.baseUrl,i.debug,d]);const g=reactExports.useCallback(()=>{b.current=window.setInterval(()=>{const ft=Math.floor((Date.now()-a.current)/1e3);h(ft)},1e3)},[]),rt=reactExports.useCallback(()=>{b.current&&(clearInterval(b.current),b.current=null)},[]),st=async()=>{try{return(await navigator.permissions.query({name:"microphone"})).state}catch{return"prompt"}},tt=async()=>{try{return(await navigator.mediaDevices.getUserMedia({audio:!0})).getTracks().forEach(dt=>dt.stop()),!0}catch(ft){return d("Microphone permission denied",ft),!1}},ot=reactExports.useCallback(ft=>{nt(ft),s("error")},[]),it=reactExports.useCallback(async()=>{const ft=await st();if(ft==="denied"){ot("Microphone access is blocked. Please enable it in your browser settings.");return}if(ft==="prompt"&&(s("permission"),!await tt())){ot("Microphone access is required to record.");return}if(!et.current){ot("SDK not initialized. Please try again.");return}try{s("recording"),await et.current.startRecording({templates:i.templates||["soap"],languageHint:i.languageHint}),a.current=Date.now(),o.current=0,h(0),g(),d("Recording started")}catch(dt){d("Failed to start recording",dt),ot("Failed to start recording. Please try again.")}},[i.templates,i.languageHint,d,ot,g]),at=reactExports.useCallback(()=>{et.current&&(et.current.pauseRecording(),s("paused"),o.current=Date.now(),rt(),d("Recording paused"))},[d,rt]),ut=reactExports.useCallback(()=>{et.current&&(et.current.resumeRecording(),s("recording"),o.current&&(a.current+=Date.now()-o.current,o.current=0),g(),d("Recording resumed"))},[d,g]),lt=reactExports.useCallback(async()=>{if(et.current)try{rt(),s("processing"),d("Stopping recording...");const ft=await et.current.endRecording();d("Recording ended",ft),d("Polling for completion...");const dt=await et.current.pollForCompletion(void 0,{maxAttempts:60,intervalMs:2e3,onProgress:yt=>{d("Status update:",yt.status)}});_(dt),d("Final result:",dt),s("results"),i.onResult&&i.onResult(dt)}catch(ft){d("Failed to stop recording",ft),ot("Failed to process recording. Please try again."),i.onError&&ft instanceof Error&&i.onError(ft)}},[i,d,ot,rt]),ct=reactExports.useCallback(()=>{_(null),nt(""),h(0),s("idle")},[]);return{state:e,elapsedTime:c,result:$,errorMessage:j,startRecording:it,pauseRecording:at,resumeRecording:ut,stopRecording:lt,reset:ct}}function App({config:i,onClose:e}){const[s,c]=reactExports.useState(!1),[h,$]=reactExports.useState(i.baseUrl?{apiKey:i.apiKey,baseUrl:i.baseUrl}:null),_=reactExports.useMemo(()=>h?{...i,apiKey:h.apiKey,baseUrl:h.baseUrl}:i,[i,h]),j=!h,{state:nt,elapsedTime:et,result:b,errorMessage:a,startRecording:o,pauseRecording:d,resumeRecording:g,stopRecording:rt,reset:st}=useScribeSession(_);if(s)return null;const tt=(it,at)=>{$({apiKey:it,baseUrl:at})},ot=()=>{if(j)return jsxRuntimeExports.jsx(ConfigState,{onSubmit:tt,initialApiKey:i.apiKey||"",initialBaseUrl:i.baseUrl||""});switch(nt){case"idle":return jsxRuntimeExports.jsx(IdleState,{onStartRecording:o});case"permission":return jsxRuntimeExports.jsx(PermissionState,{onRequestPermission:o});case"recording":case"paused":return jsxRuntimeExports.jsx(RecordingState,{elapsedTime:et,isPaused:nt==="paused",onPause:d,onResume:g,onStop:rt});case"processing":return jsxRuntimeExports.jsx(ProcessingState,{});case"results":return b?jsxRuntimeExports.jsx(ResultsState,{result:b,onNewRecording:st}):null;case"error":return jsxRuntimeExports.jsx(ErrorState,{message:a,onRetry:st});default:return jsxRuntimeExports.jsx(IdleState,{onStartRecording:o})}};return jsxRuntimeExports.jsx(FloatingPanel,{position:_.position,onClose:e,onMinimize:()=>c(!0),children:ot()})}const widgetStyles=":host{all:initial;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,sans-serif}*{box-sizing:border-box;margin:0;padding:0}.scribe-panel{position:fixed;bottom:20px;right:20px;background:#fff;border-radius:16px;box-shadow:0 4px 24px #0000001f,0 0 0 1px #0000000d;z-index:2147483647;overflow:hidden;min-width:320px}.panel-header{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;background:#fafafa;border-bottom:1px solid #eee;cursor:grab}.panel-header:active{cursor:grabbing}.drag-handle{display:flex;gap:2px;flex-wrap:wrap;width:16px;opacity:.4}.drag-handle span{width:4px;height:4px;background:#666;border-radius:50%}.header-actions{display:flex;gap:8px}.header-btn{background:none;border:none;cursor:pointer;padding:4px;color:#666;display:flex;align-items:center;justify-content:center;width:24px;height:24px}.header-btn:hover{color:#333}.header-btn svg{width:16px;height:16px}.panel-content{padding:20px 24px}.idle-state{display:flex;align-items:center;gap:24px}.logo{display:flex;align-items:center;gap:8px}.logo-icon{width:32px;height:32px}.logo-icon svg{width:100%;height:100%}.logo-text{font-size:20px;font-weight:600;color:#2563eb}.start-btn{display:flex;align-items:center;gap:8px;background:#2563eb;color:#fff;border:none;padding:12px 24px;border-radius:24px;font-size:16px;font-weight:500;cursor:pointer;transition:background .2s}.start-btn:hover{background:#1d4ed8}.start-btn:disabled{background:#93c5fd;cursor:not-allowed}.mic-icon{width:20px;height:20px}.mic-icon svg{width:100%;height:100%}.recording-state{display:flex;align-items:center;gap:16px}.recording-indicator{display:flex;align-items:center;gap:12px;color:#666}.recording-icon{width:24px;height:24px;color:#666}.recording-icon svg{width:100%;height:100%}.recording-icon.active{color:#ef4444;animation:pulse 1.5s infinite}@keyframes pulse{0%,to{opacity:1}50%{opacity:.5}}.timer{font-size:20px;font-weight:500;font-variant-numeric:tabular-nums;color:#374151}.recording-actions{display:flex;gap:8px;margin-left:auto}.resume-btn{background:#fff;color:#2563eb;border:2px solid #2563eb;padding:10px 20px;border-radius:8px;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s}.resume-btn:hover{background:#eff6ff}.pause-btn{background:#fff;color:#f59e0b;border:2px solid #f59e0b;padding:10px 20px;border-radius:8px;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s}.pause-btn:hover{background:#fffbeb}.stop-btn{background:#ef4444;color:#fff;border:none;padding:10px 16px;border-radius:8px;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background .2s}.stop-btn:hover{background:#dc2626}.stop-icon{width:16px;height:16px;background:#fff;border-radius:2px}.processing-state{display:flex;flex-direction:column;align-items:center;gap:16px;padding:20px}.spinner{width:40px;height:40px;border:3px solid #e5e7eb;border-top-color:#2563eb;border-radius:50%;animation:spin 1s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.processing-text{color:#6b7280;font-size:14px}.results-state{display:flex;flex-direction:column;gap:16px;max-height:400px}.results-header{display:flex;align-items:center;justify-content:space-between}.results-title{font-size:16px;font-weight:600;color:#111827}.new-recording-btn{background:#2563eb;color:#fff;border:none;padding:8px 16px;border-radius:6px;font-size:13px;cursor:pointer;transition:background .2s}.new-recording-btn:hover{background:#1d4ed8}.results-content{overflow-y:auto;max-height:300px}.transcript-section{margin-bottom:16px}.section-title{font-size:13px;font-weight:600;color:#6b7280;text-transform:uppercase;letter-spacing:.05em;margin-bottom:8px}.transcript-text{font-size:14px;line-height:1.6;color:#374151;background:#f9fafb;padding:12px;border-radius:8px;white-space:pre-wrap}.error-state{display:flex;flex-direction:column;align-items:center;gap:12px;padding:20px;text-align:center}.error-icon{width:48px;height:48px;color:#ef4444}.error-icon svg{width:100%;height:100%}.error-message{color:#ef4444;font-size:14px}.retry-btn{background:#ef4444;color:#fff;border:none;padding:10px 20px;border-radius:8px;font-size:14px;cursor:pointer;transition:background .2s}.retry-btn:hover{background:#dc2626}.permission-state{display:flex;flex-direction:column;align-items:center;gap:16px;padding:20px;text-align:center}.permission-icon{width:48px;height:48px;color:#2563eb}.permission-icon svg{width:100%;height:100%}.permission-text{color:#374151;font-size:14px;line-height:1.5}.permission-btn{background:#2563eb;color:#fff;border:none;padding:12px 24px;border-radius:8px;font-size:14px;font-weight:500;cursor:pointer;transition:background .2s}.permission-btn:hover{background:#1d4ed8}.config-state{display:flex;flex-direction:column;gap:20px}.config-state .logo{justify-content:center}.config-form{display:flex;flex-direction:column;gap:12px}.config-form .form-group{display:flex;flex-direction:column;gap:4px}.config-form label{font-size:13px;font-weight:500;color:#374151}.config-form input{padding:10px 12px;border:1px solid #d1d5db;border-radius:8px;font-size:14px;color:#111827;background:#fff;transition:border-color .2s,box-shadow .2s}.config-form input:focus{outline:none;border-color:#2563eb;box-shadow:0 0 0 3px #2563eb1a}.config-form input::placeholder{color:#9ca3af}.config-error{color:#ef4444;font-size:13px;margin:0}.config-submit-btn{background:#2563eb;color:#fff;border:none;padding:12px 24px;border-radius:8px;font-size:14px;font-weight:500;cursor:pointer;transition:background .2s;margin-top:4px}.config-submit-btn:hover{background:#1d4ed8}";class ScribeWidget{constructor(e){Qr(this,"container");Qr(this,"shadowRoot");Qr(this,"root",null);Qr(this,"config");Qr(this,"visible",!0);this.config={templates:["soap"],languageHint:["en"],position:{bottom:20,right:20},...e},this.container=document.createElement("div"),this.container.id="eka-scribe-widget",this.shadowRoot=this.container.attachShadow({mode:"closed"});const s=document.createElement("style");s.textContent=widgetStyles,this.shadowRoot.appendChild(s);const c=document.createElement("div");c.id="eka-scribe-root",this.shadowRoot.appendChild(c),this.root=createRoot(c)}render(){!this.root||!this.visible||this.root.render(jsxRuntimeExports.jsx(App,{config:this.config,onClose:()=>this.hide()}))}mount(e){const s=typeof e=="string"?document.querySelector(e):e||document.body;s&&(s.appendChild(this.container),this.render())}unmount(){this.root&&(this.root.unmount(),this.root=null),this.container.remove()}show(){this.visible=!0,this.container.style.display="block",this.render()}hide(){this.visible=!1,this.container.style.display="none"}isVisible(){return this.visible}}let widgetInstance=null;function init(i={}){return widgetInstance&&widgetInstance.unmount(),console.log(i,"config - WIDGET"),widgetInstance=new ScribeWidget(i),widgetInstance.mount(),widgetInstance}function getInstance(){return widgetInstance}const EkaScribe={init,getInstance,Widget:ScribeWidget};if(typeof window<"u"&&typeof document<"u"){const i=()=>{const e=document.currentScript||document.querySelector('script[src*="scribe-widget"]');e!=null&&e.hasAttribute("data-no-auto-init")||(console.log(widgetInstance,"widget instance"),widgetInstance||init({}))};document.readyState==="loading"?document.addEventListener("DOMContentLoaded - WIDGET",i):(console.log("load document - WIDGET"),i())}exports.ScribeWidget=ScribeWidget,exports.default=EkaScribe,exports.getInstance=getInstance,exports.init=init,Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1850
|
+
${b}`);return d}deleteShader(b){this.gl.deleteShader(b)}bindTextureToUniform(b,a,o){const d=this.gl;d.activeTexture(d.TEXTURE0+a),this.checkError(),d.bindTexture(d.TEXTURE_2D,b),this.checkError(),d.uniform1i(o,a),this.checkError()}draw(){this.gl.drawArrays(this.gl.TRIANGLE_STRIP,0,4),this.checkError()}checkError(){if(_.env.debug){const b=this.gl,a=b.getError();let o="";switch(a){case b.NO_ERROR:return;case b.INVALID_ENUM:o="INVALID_ENUM";break;case b.INVALID_VALUE:o="INVALID_VALUE";break;case b.INVALID_OPERATION:o="INVALID_OPERATION";break;case b.INVALID_FRAMEBUFFER_OPERATION:o="INVALID_FRAMEBUFFER_OPERATION";break;case b.OUT_OF_MEMORY:o="OUT_OF_MEMORY";break;case b.CONTEXT_LOST_WEBGL:o="CONTEXT_LOST_WEBGL";break;default:o=`Unknown WebGL Error: ${a.toString(16)}`}throw new Error(o)}}deleteTexture(b){this.gl.deleteTexture(b)}deleteProgram(b){this.gl.deleteProgram(b)}getEncoder(b,a,o=0){if(this.version===2)return new j.RedFloat32DataEncoder(this.gl,a);switch(b){case"float":return o===1||this.isRenderFloat32Supported?new j.RGBAFloatDataEncoder(this.gl,a):new j.RGBAFloatDataEncoder(this.gl,a,this.textureHalfFloatExtension.HALF_FLOAT_OES);case"int":throw new Error("not implemented");case"byte":return new j.Uint8DataEncoder(this.gl,a);default:throw new Error(`Invalid dataType: ${b}`)}}clearActiveTextures(){const b=this.gl;for(let a=0;a<this.maxTextureImageUnits;++a)b.activeTexture(b.TEXTURE0+a),b.bindTexture(b.TEXTURE_2D,null)}dispose(){if(this.disposed)return;const b=this.gl;b.bindFramebuffer(b.FRAMEBUFFER,null),b.deleteFramebuffer(this.framebuffer),b.bindBuffer(b.ARRAY_BUFFER,null),b.deleteBuffer(this.vertexbuffer),b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,null),b.finish(),this.disposed=!0}createDefaultGeometry(){return new Float32Array([-1,1,0,0,1,-1,-1,0,0,0,1,1,0,1,1,1,-1,0,1,0])}createVertexbuffer(){const b=this.gl,a=b.createBuffer();if(!a)throw new Error("createBuffer() returned null");const o=this.createDefaultGeometry();return b.bindBuffer(b.ARRAY_BUFFER,a),b.bufferData(b.ARRAY_BUFFER,o,b.STATIC_DRAW),this.checkError(),a}createFramebuffer(){const b=this.gl.createFramebuffer();if(!b)throw new Error("createFramebuffer returned null");return b}queryVitalParameters(){const b=this.gl;if(this.isFloatTextureAttachableToFrameBuffer=this.checkFloatTextureAttachableToFrameBuffer(),this.isRenderFloat32Supported=this.checkRenderFloat32(),this.isFloat32DownloadSupported=this.checkFloat32Download(),this.version===1&&!this.textureHalfFloatExtension&&!this.isRenderFloat32Supported)throw new Error("both float32 and float16 TextureType are not supported");this.isBlendSupported=!this.isRenderFloat32Supported||this.checkFloat32Blend(),this.maxTextureSize=b.getParameter(b.MAX_TEXTURE_SIZE),this.maxTextureImageUnits=b.getParameter(b.MAX_TEXTURE_IMAGE_UNITS),this.version}getExtensions(){this.version===2?(this.colorBufferFloatExtension=this.gl.getExtension("EXT_color_buffer_float"),this.disjointTimerQueryWebgl2Extension=this.gl.getExtension("EXT_disjoint_timer_query_webgl2")):(this.textureFloatExtension=this.gl.getExtension("OES_texture_float"),this.textureHalfFloatExtension=this.gl.getExtension("OES_texture_half_float"))}checkFloatTextureAttachableToFrameBuffer(){const b=this.gl,a=b.createTexture();b.bindTexture(b.TEXTURE_2D,a);const o=this.version===2?b.RGBA32F:b.RGBA;b.texImage2D(b.TEXTURE_2D,0,o,1,1,0,b.RGBA,b.FLOAT,null);const d=b.createFramebuffer();b.bindFramebuffer(b.FRAMEBUFFER,d),b.framebufferTexture2D(b.FRAMEBUFFER,b.COLOR_ATTACHMENT0,b.TEXTURE_2D,a,0);const g=b.checkFramebufferStatus(b.FRAMEBUFFER)===b.FRAMEBUFFER_COMPLETE;return b.bindTexture(b.TEXTURE_2D,null),b.bindFramebuffer(b.FRAMEBUFFER,null),b.deleteTexture(a),b.deleteFramebuffer(d),g}checkRenderFloat32(){if(this.version===2){if(!this.colorBufferFloatExtension)return!1}else if(!this.textureFloatExtension)return!1;return this.isFloatTextureAttachableToFrameBuffer}checkFloat32Download(){if(this.version===2){if(!this.colorBufferFloatExtension)return!1}else if(!this.textureFloatExtension||!this.gl.getExtension("WEBGL_color_buffer_float"))return!1;return this.isFloatTextureAttachableToFrameBuffer}checkFloat32Blend(){const b=this.gl;let a,o,d,g,rt;try{a=b.createTexture(),o=b.createFramebuffer(),b.bindTexture(b.TEXTURE_2D,a);const st=this.version===2?b.RGBA32F:b.RGBA;return b.texImage2D(b.TEXTURE_2D,0,st,1,1,0,b.RGBA,b.FLOAT,null),b.bindFramebuffer(b.FRAMEBUFFER,o),b.framebufferTexture2D(b.FRAMEBUFFER,b.COLOR_ATTACHMENT0,b.TEXTURE_2D,a,0),b.enable(b.BLEND),d=b.createShader(b.VERTEX_SHADER),!!d&&(b.shaderSource(d,"void main(){}"),b.compileShader(d),g=b.createShader(b.FRAGMENT_SHADER),!!g&&(b.shaderSource(g,"precision highp float;void main(){gl_FragColor=vec4(0.5);}"),b.compileShader(g),rt=b.createProgram(),!!rt&&(b.attachShader(rt,d),b.attachShader(rt,g),b.linkProgram(rt),b.useProgram(rt),b.drawArrays(b.POINTS,0,1),b.getError()===b.NO_ERROR)))}finally{b.disable(b.BLEND),rt&&b.deleteProgram(rt),d&&b.deleteShader(d),g&&b.deleteShader(g),o&&(b.bindFramebuffer(b.FRAMEBUFFER,null),b.deleteFramebuffer(o)),a&&(b.bindTexture(b.TEXTURE_2D,null),b.deleteTexture(a))}}beginTimer(){if(this.version===2&&this.disjointTimerQueryWebgl2Extension){const b=this.gl,a=this.disjointTimerQueryWebgl2Extension,o=b.createQuery();return b.beginQuery(a.TIME_ELAPSED_EXT,o),o}throw new Error("WebGL1 profiling currently not supported.")}endTimer(){if(this.version!==2||!this.disjointTimerQueryWebgl2Extension)throw new Error("WebGL1 profiling currently not supported");{const b=this.gl,a=this.disjointTimerQueryWebgl2Extension;b.endQuery(a.TIME_ELAPSED_EXT)}}isTimerResultAvailable(b){let a=!1,o=!1;if(this.version!==2||!this.disjointTimerQueryWebgl2Extension)throw new Error("WebGL1 profiling currently not supported");{const d=this.gl,g=this.disjointTimerQueryWebgl2Extension;a=d.getQueryParameter(b,d.QUERY_RESULT_AVAILABLE),o=d.getParameter(g.GPU_DISJOINT_EXT)}return a&&!o}getTimerResult(b){let a=0;if(this.version!==2)throw new Error("WebGL1 profiling currently not supported");{const o=this.gl;a=o.getQueryParameter(b,o.QUERY_RESULT),o.deleteQuery(b)}return a/1e6}async waitForQueryAndGetTime(b){return await(0,nt.repeatedTry)(()=>this.isTimerResultAvailable(b)),this.getTimerResult(b)}async createAndWaitForFence(){const b=this.createFence(this.gl);return this.pollFence(b)}createFence(b){let a;const o=b,d=o.fenceSync(o.SYNC_GPU_COMMANDS_COMPLETE,0);return b.flush(),a=d===null?()=>!0:()=>{const g=o.clientWaitSync(d,0,0);return g===o.ALREADY_SIGNALED||g===o.CONDITION_SATISFIED},{query:d,isFencePassed:a}}async pollFence(b){return new Promise(a=>{this.addItemToPoll(()=>b.isFencePassed(),()=>a())})}pollItems(){const b=et(this.itemsToPoll.map(a=>a.isDoneFn));for(let a=0;a<=b;++a){const{resolveFn:o}=this.itemsToPoll[a];o()}this.itemsToPoll=this.itemsToPoll.slice(b+1)}async addItemToPoll(b,a){this.itemsToPoll.push({isDoneFn:b,resolveFn:a}),this.itemsToPoll.length>1||await(0,nt.repeatedTry)(()=>(this.pollItems(),this.itemsToPoll.length===0))}}},1036:(i,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ExecutionPlan=void 0;const c=s(6231);class h{constructor(_,j){this.op=_,this.node=j}}e.ExecutionPlan=class{constructor($,_,j){this.graph=$,this.profiler=j,this.initialize(_)}initialize($){this.profiler.event("session","ExecutionPlan.initialize",()=>{const _=this.graph.getNodes();if(_.length!==$.length)throw new Error("The size of nodes and OPs do not match.");this._ops=$.map((j,nt)=>new h(j,_[nt])),this.reset(),this._starter=[],this._ops.forEach((j,nt)=>{let et=!0;for(const b of j.node.inputs)if(!this._values[b]&&this.graph.getInputIndices().indexOf(b)===-1){et=!1;break}et&&this._starter.push(nt)})})}reset(){this._values=this.graph.getValues().map($=>$.tensor)}async execute($,_){return this.profiler.event("session","ExecutionPlan.execute",async()=>{this.reset();const j=$.createInferenceHandler(),nt=this.graph.getInputIndices();if(_.length!==nt.length)throw new Error(`number of input tensors don't match the number of inputs to the model: actual: ${_.length} expected: ${nt.length}`);_.forEach((g,rt)=>{const st=nt[rt];this._values[st]=g});const et=this._starter.slice(0),b=this.graph.getValues(),a=this.graph.getNodes();let o=0;for(;o<et.length;){const g=et[o++],rt=this._ops[g],st=rt.node.inputs.map(at=>this._values[at]);if(st.indexOf(void 0)!==-1)throw new Error(`unresolved input detected: op: ${rt.node}`);const tt=st;c.Logger.verbose("ExecPlan",`Runing op:${rt.node.name} (${tt.map((at,ut)=>`'${rt.node.inputs[ut]}': ${at.type}[${at.dims.join(",")}]`).join(", ")})`);const ot=await this.profiler.event("node",rt.node.name,async()=>rt.op.impl(j,tt,rt.op.context));if(ot.length!==rt.node.outputs.length)throw new Error("the size of output does not match model definition.");ot.forEach((at,ut)=>{const lt=rt.node.outputs[ut];if(this._values[lt])throw new Error(`output [${lt}] already has value: op:${rt.node.name}`);this._values[lt]=at});const it=new Set;ot.forEach((at,ut)=>{const lt=rt.node.outputs[ut];for(const ct of b[lt].to){const ft=a[ct];let dt=!0;for(const yt of ft.inputs)if(!this._values[yt]){dt=!1;break}dt&&it.add(ct)}}),et.push(...it)}const d=[];for(let g=0;g<this.graph.getOutputIndices().length;g++){const rt=this.graph.getOutputIndices()[g],st=this._values[rt];if(st===void 0)throw new Error(`required output [${rt}] does not have value`);rt===0?await st.getData():st.data,d.push(st)}return c.Logger.verbose("ExecPlan","disposing of inferenceHandler"),j.dispose(),d})}}},7070:(i,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Graph=void 0;const c=s(1446),h=s(7778),$=s(9395),_=s(9162),j=s(2517);var nt=$.onnxruntime.experimental.fbs;e.Graph={from:(o,d)=>new a(o,d)};class et{constructor(d){this._from=void 0,this._to=[],this.tensor=void 0,this.type=void 0,d&&(this.type=j.ProtoUtil.tensorValueTypeFromProto(d.type.tensorType))}get from(){return this._from}get to(){return this._to}}class b{constructor(d,g){d instanceof c.onnx.NodeProto?(this.name=d.name,this.opType=d.opType,this.attributes=new h.Attribute(d.attribute)):d instanceof nt.Node&&(this.name=g??d.name(),this.opType=d.opType(),this.attributes=new h.Attribute(j.ProtoUtil.tensorAttributesFromORTFormat(d))),this.inputs=[],this.outputs=[],this.executeNode=!0}}class a{constructor(d,g){if(!d)throw new TypeError("graph is empty");this.buildGraph(d),this.transformGraph(g),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(d){if(d instanceof c.onnx.GraphProto)this.buildGraphFromOnnxFormat(d);else{if(!(d instanceof nt.Graph))throw new TypeError("Graph type is not supported.");this.buildGraphFromOrtFormat(d)}}buildGraphFromOnnxFormat(d){const g=new Map;this._allData=[],this._allInputIndices=[],this._allInputNames=[],this._allOutputIndices=[],this._allOutputNames=[],this._nodes=[];const rt=new Map;if(!d.input)throw new Error("missing information in graph: input");const st=[];for(const tt of d.input){if(g.has(tt.name))throw new Error(`duplicated input name: ${tt.name}`);const ot=this._allData.push(new et(tt))-1;g.set(tt.name,ot),st.push(tt.name)}if(!d.initializer)throw new Error("missing information in graph: initializer");for(const tt of d.initializer){let ot=g.get(tt.name);if(ot===void 0){const it=new et;it.type={shape:{dims:j.ProtoUtil.tensorDimsFromProto(tt.dims)},tensorType:j.ProtoUtil.tensorDataTypeFromProto(tt.dataType)},ot=this._allData.push(it)-1,g.set(tt.name,ot)}this._allData[ot]._from=-1,this._allData[ot].tensor=_.Tensor.fromProto(tt)}for(let tt=0;tt<this._allData.length;tt++)this._allData[tt].tensor||(this._allInputIndices.push(tt),this._allInputNames.push(st[tt]));if(!d.output)throw new Error("missing information in graph: output");for(const tt of d.output){if(g.has(tt.name))throw new Error(`duplicated output name: ${tt.name}`);const ot=this._allData.push(new et(tt))-1;g.set(tt.name,ot),this._allOutputIndices.push(ot),this._allOutputNames.push(tt.name)}if(!d.node)throw new Error("missing information in graph: node");for(const tt of d.node){if(!tt.name)for(let it=0;;it++){const at=`unnamed_${tt.opType}_${it}`;if(!rt.has(at)){tt.name=at;break}}if(rt.has(tt.name))throw new Error(`duplicated node name: ${tt.name}`);const ot=this._nodes.push(new b(tt))-1;rt.set(tt.name,ot)}for(let tt=0;tt<this._nodes.length;tt++){const ot=this._nodes[tt],it=d.node[tt];if(!it.output)throw new Error(`missing output for node: ${it.name}`);for(const at of it.output){let ut=g.get(at);if(ut===void 0&&(ut=this._allData.push(new et)-1,g.set(at,ut)),ot.outputs.push(ut),this._allData[ut]._from!==void 0)throw new Error(`multiple nodes output to one data value: ${ut}`);if(this._allData[ut]._from=tt,it.opType==="Constant"){if(!it.attribute||it.attribute.length!==1||!it.attribute[0].t)throw new Error("missing attributes or missing tensor value in attributes for this Constant operator");if(!it.output||it.output.length!==1)throw new Error("missing output or incorrect number of outputs for this Constant operator");ot.outputs.pop(),ot.executeNode=!1,this._allData[ut]._from=-1,this._allData[ut].tensor=_.Tensor.fromProto(it.attribute[0].t)}}}for(let tt=0;tt<this._nodes.length;tt++){const ot=this._nodes[tt],it=d.node[tt];if(!it.input)throw new Error(`missing input for node: ${it.name}`);for(const at of it.input){const ut=g.get(at);if(ut===void 0){if(at===""&&it.input.length===3&&it.opType==="Resize")continue;throw new Error(`unrecognized input '${at}' for node: ${it.name}`)}ot.inputs.push(ut),this._allData[ut]._to.push(tt)}}return!0}buildGraphFromOrtFormat(d){var g,rt,st;const tt=new Map;this._allData=[],this._allInputIndices=[],this._allInputNames=[],this._allOutputIndices=[],this._allOutputNames=[],this._nodes=[];const ot=new Map,it=[];for(let at=0;at<d.inputsLength();at++){const ut=d.inputs(at);if(tt.has(ut))throw new Error(`duplicated input name: ${ut}`);for(let lt=0;lt<d.nodeArgsLength();lt++)if(((g=d.nodeArgs(lt))===null||g===void 0?void 0:g.name())===ut){const ct=new et;if(((st=(rt=d.nodeArgs(lt))===null||rt===void 0?void 0:rt.type())===null||st===void 0?void 0:st.valueType())!==nt.TypeInfoValue.tensor_type)throw new Error("Unexpected value type for the nodeArg.");const ft=d.nodeArgs(lt).type().value(new nt.TensorTypeAndShape),dt=j.ProtoUtil.tensorDataTypeFromProto(ft.elemType()),yt=ft.shape(),St=[];for(let Tt=0;Tt<yt.dimLength();Tt++)St.push(j.LongUtil.longToNumber(yt.dim(Tt).value().dimValue()));ct.type={shape:{dims:St},tensorType:dt};const bt=this._allData.push(ct)-1;tt.set(ut,bt),it.push(ut)}}for(let at=0;at<d.initializersLength();at++){const ut=d.initializers(at);let lt=tt.get(ut.name());if(lt===void 0){const ct=new et,ft=j.ProtoUtil.tensorDimsFromORTFormat(ut),dt=j.ProtoUtil.tensorDataTypeFromProto(ut.dataType());ct.type={shape:{dims:ft},tensorType:dt},lt=this._allData.push(ct)-1,tt.set(ut.name(),lt)}this._allData[lt]._from=-1,this._allData[lt].tensor=_.Tensor.fromOrtTensor(ut)}for(let at=0;at<this._allData.length;at++)this._allData[at].tensor||(this._allInputIndices.push(at),this._allInputNames.push(it[at]));for(let at=0;at<d.outputsLength();at++){const ut=d.outputs(at);if(tt.has(ut))throw new Error(`duplicated output name: ${ut}`);const lt=this._allData.push(new et)-1;tt.set(ut,lt),this._allOutputIndices.push(lt),this._allOutputNames.push(ut)}if(!d.nodes)throw new Error("missing information in graph: node");for(let at=0;at<d.nodesLength();at++){const ut=d.nodes(at);let lt=ut.name();if(!lt)for(let ft=0;lt=`unnamed_${ut.opType()}_${ft}`,ot.has(lt);ft++);if(ot.has(lt))throw new Error(`duplicated node name: ${lt}`);const ct=this._nodes.push(new b(ut,lt))-1;ot.set(lt,ct)}for(let at=0;at<this._nodes.length;at++){const ut=this._nodes[at],lt=d.nodes(at);if(lt==null)throw new Error(`No node exists at index ${at}`);if((lt==null?void 0:lt.outputsLength())===0)throw new Error(`missing output for node: ${lt.name}`);for(let ct=0;ct<(lt==null?void 0:lt.outputsLength());ct++){const ft=lt==null?void 0:lt.outputs(ct);let dt=tt.get(ft);if(dt===void 0&&(dt=this._allData.push(new et)-1,tt.set(ft,dt)),ut.outputs.push(dt),this._allData[dt]._from!==void 0)throw new Error(`multiple nodes output to one data value: ${dt}`);if(this._allData[dt]._from=at,lt.opType()==="Constant"){if(lt.attributesLength()!==1||!lt.attributes(0).t())throw new Error("missing attributes or missing tensor value in attributes for this Constant operator");if(lt.outputsLength()!==1)throw new Error("missing output or incorrect number of outputs for this Constant operator");ut.outputs.pop(),ut.executeNode=!1,this._allData[dt]._from=-1,this._allData[dt].tensor=_.Tensor.fromOrtTensor(lt.attributes(0).t())}}}for(let at=0;at<this._nodes.length;at++){const ut=this._nodes[at],lt=d.nodes(at);if(lt.inputsLength()===0)throw new Error(`missing input for node: ${lt.name}`);for(let ct=0;ct<lt.inputsLength();ct++){const ft=lt.inputs(ct),dt=tt.get(ft);if(dt===void 0)throw new Error(`unrecognized input '${ft}' for node: ${lt.name()}`);ut.inputs.push(dt),this._allData[dt]._to.push(at)}}}checkIsAcyclic(){const d=new Set;this._allInputIndices.forEach(st=>{this._allData[st]._to.forEach(tt=>{d.add(tt)})});const g=Array.from(d),rt=new Array(this._nodes.length).fill("white");for(;g.length>0;){const st=g.pop();rt[st]==="gray"?rt[st]="black":(g.push(st),rt[st]="gray",this._nodes[st].outputs.forEach(tt=>{const ot=this._allData[tt];if(ot.tensor!==void 0)throw new Error("node outputs should not be initialized");if(ot._from!==st)throw new Error("from property of the Value object doesn't match index of Node being processed");ot._to.forEach(it=>{if(rt[it]==="gray")throw new Error("model graph is cyclic");rt[it]==="white"&&g.push(it)})}))}}transformGraph(d){this.removeAllIdentityNodes(),this.removeAllDropoutNodes(),this.fuseConvActivationNodes(),d&&d.transformGraph(this),this.finalizeGraph()}finalizeGraph(){let d=0;for(let g=0;g<this._nodes.length;g++)this._nodes[g].executeNode?d>0&&(this._nodes[g].inputs.forEach(rt=>{const st=this._allData[rt]._to.indexOf(g+d);st!==-1&&(this._allData[rt]._to[st]=g)}),this._nodes[g].outputs.forEach(rt=>{this._allData[rt]._from&&this._allData[rt]._from===g+d&&(this._allData[rt]._from=g)})):(d++,this._nodes[g].outputs.forEach(rt=>{this._allData[rt]._from=-2}),this._nodes.splice(g,1),g--);d=0;for(let g=0;g<this._allData.length;g++)if(this._allData[g].from!==-2||this._allOutputIndices.indexOf(g+d)!==-1){if(d>0){let rt=-1;this._allData[g].from!==void 0&&this._allData[g].from!==-1?(rt=this._nodes[this._allData[g].from].outputs.indexOf(g+d),rt!==-1&&(this._nodes[this._allData[g].from].outputs[rt]=g)):(rt=this._allInputIndices.indexOf(g+d),rt!==-1&&(this._allInputIndices[rt]=g)),this._allData[g].to.forEach(st=>{rt=this._nodes[st].inputs.indexOf(g+d),rt!==-1&&(this._nodes[st].inputs[rt]=g)}),this._allData[g].to.length===0&&(rt=this._allOutputIndices.indexOf(g+d),rt!==-1&&(this._allOutputIndices[rt]=g))}}else d++,this._allData.splice(g,1),g--}deleteNode(d){const g=this._nodes[d];if(g.outputs.length>1){for(let at=1;at<g.outputs.length;at++)if(this._allData[g.outputs[at]].to.length>0)throw new Error("Node deletion with more than one output connected to other nodes is not supported. ")}g.executeNode=!1;const rt=g.inputs[0],st=g.outputs[0],tt=this._allData[st].to,ot=this._allData[rt].to.indexOf(d);if(ot===-1)throw new Error("The Value object doesn't have the current Node in it's 'to' property ");this._allData[rt].to.splice(ot,1),this._allData[st]._to=[];const it=this._allOutputIndices.indexOf(st);if(it!==-1&&(this._allOutputIndices[it]=rt),tt&&tt.length>0)for(const at of tt){const ut=this._nodes[at].inputs.indexOf(st);if(ut===-1)throw new Error("The Node object doesn't have the output Value in it's 'inputs' property ");this._nodes[at].inputs[ut]=rt,this._allData[rt].to.push(at)}}removeAllDropoutNodes(){let d=0;for(const g of this._nodes){if(g.opType==="Dropout"){if(g.inputs.length!==1)throw new Error("Dropout nodes should only contain one input. ");if(g.outputs.length!==1&&g.outputs.length!==2)throw new Error("Dropout nodes should contain either 1 or 2 output(s)");if(g.outputs.length===2&&this._allData[g.outputs[1]]._to.length!==0)throw new Error("Dropout nodes's second output should not be referenced by other nodes");this.deleteNode(d)}d++}}removeAllIdentityNodes(){let d=0;for(const g of this._nodes)g.opType==="Identity"&&this.deleteNode(d),d++}isActivation(d){switch(d.opType){case"Relu":case"Sigmoid":case"Clip":return!0;default:return!1}}fuseConvActivationNodes(){for(const d of this._nodes)if(d.opType==="Conv"){const g=this._allData[d.outputs[0]]._to;if(g.length===1&&this.isActivation(this._nodes[g[0]])){const rt=this._nodes[g[0]];if(rt.opType==="Clip")if(rt.inputs.length===1)try{d.attributes.set("activation_params","floats",[rt.attributes.getFloat("min"),rt.attributes.getFloat("max")])}catch{d.attributes.set("activation_params","floats",[j.MIN_CLIP,j.MAX_CLIP])}else{if(!(rt.inputs.length>=3&&this._allData[rt.inputs[1]].tensor!==void 0&&this._allData[rt.inputs[2]].tensor!==void 0))continue;d.attributes.set("activation_params","floats",[this._allData[rt.inputs[1]].tensor.floatData[0],this._allData[rt.inputs[2]].tensor.floatData[0]])}d.attributes.set("activation","string",rt.opType),this.deleteNode(g[0])}}}}},6231:(i,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.now=e.Profiler=e.Logger=void 0;const s={verbose:1e3,info:2e3,warning:4e3,error:5e3,fatal:6e3},c={none:new class{log(b,a,o){}},console:new class{log(b,a,o){console.log(`${this.color(b)} ${o?"\x1B[35m"+o+"\x1B[0m ":""}${a}`)}color(b){switch(b){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: ${b}`)}}}},h={provider:"console",minimalSeverity:"warning",logDateTime:!0,logSourceLocation:!1};let $={"":h};function _(b,a,o,d){if(a===void 0)return g=b,{verbose:_.verbose.bind(null,g),info:_.info.bind(null,g),warning:_.warning.bind(null,g),error:_.error.bind(null,g),fatal:_.fatal.bind(null,g)};if(o===void 0)j(b,a);else if(typeof o=="number"&&d===void 0)j(b,a);else if(typeof o=="string"&&d===void 0)j(b,o,0,a);else{if(typeof o!="string"||typeof d!="number")throw new TypeError("input is valid");j(b,o,0,a)}var g}function j(b,a,o,d){const g=$[d||""]||$[""];s[b]<s[g.minimalSeverity]||(g.logDateTime&&(a=`${new Date().toISOString()}|${a}`),g.logSourceLocation,c[g.provider].log(b,a,d))}(function(b){function a(d){$={},o("",d||{})}function o(d,g){if(d==="*")a(g);else{const rt=$[d]||h;$[d]={provider:g.provider||rt.provider,minimalSeverity:g.minimalSeverity||rt.minimalSeverity,logDateTime:g.logDateTime===void 0?rt.logDateTime:g.logDateTime,logSourceLocation:g.logSourceLocation===void 0?rt.logSourceLocation:g.logSourceLocation}}}b.verbose=function(d,g){b("verbose",d,g)},b.info=function(d,g){b("info",d,g)},b.warning=function(d,g){b("warning",d,g)},b.error=function(d,g){b("error",d,g)},b.fatal=function(d,g){b("fatal",d,g)},b.reset=a,b.set=o,b.setWithEnv=function(d){const g={};d.logLevel&&(g.minimalSeverity=d.logLevel),o("",g)}})(_||(_={})),e.Logger=_;class nt{constructor(a,o,d,g,rt,st){this.category=a,this.name=o,this.startTime=d,this.endCallback=g,this.timer=rt,this.ctx=st}end(){return this.endCallback(this)}async checkTimer(){if(this.ctx===void 0||this.timer===void 0)throw new Error("No webgl timer found");return this.ctx.endTimer(),this.ctx.waitForQueryAndGetTime(this.timer)}}class et{constructor(a,o,d,g){this.category=a,this.name=o,this.startTime=d,this.endTime=g}}e.Profiler=class{static create(b){return b===void 0?new this:new this(b.maxNumberEvents,b.flushBatchSize,b.flushIntervalInMilliseconds)}constructor(b,a,o){this._started=!1,this._flushPointer=0,this._started=!1,this._maxNumberEvents=b===void 0?1e4:b,this._flushBatchSize=a===void 0?10:a,this._flushIntervalInMilliseconds=o===void 0?5e3:o}start(){this._started=!0,this._timingEvents=[],this._flushTime=(0,e.now)(),this._flushPointer=0}stop(){for(this._started=!1;this._flushPointer<this._timingEvents.length;this._flushPointer++)this.logOneEvent(this._timingEvents[this._flushPointer])}event(b,a,o,d){const g=this._started?this.begin(b,a,d):void 0;let rt=!1;const st=o();if(st&&typeof st.then=="function")return rt=!0,new Promise((tt,ot)=>{st.then(async it=>{g&&await g.end(),tt(it)},async it=>{g&&await g.end(),ot(it)})});if(!rt&&g){const tt=g.end();if(tt&&typeof tt.then=="function")return new Promise((ot,it)=>{tt.then(()=>{ot(st)},at=>{it(at)})})}return st}begin(b,a,o){if(!this._started)throw new Error("profiler is not started yet");if(o===void 0){const d=(0,e.now)();return this.flush(d),new nt(b,a,d,g=>this.endSync(g))}{const d=o.beginTimer();return new nt(b,a,0,async g=>this.end(g),d,o)}}async end(b){const a=await b.checkTimer();this._timingEvents.length<this._maxNumberEvents&&(this._timingEvents.push(new et(b.category,b.name,b.startTime,a)),this.flush(a))}endSync(b){const a=(0,e.now)();this._timingEvents.length<this._maxNumberEvents&&(this._timingEvents.push(new et(b.category,b.name,b.startTime,a)),this.flush(a))}logOneEvent(b){e.Logger.verbose(`Profiler.${b.category}`,`${(b.endTime-b.startTime).toFixed(2)}ms on event '${b.name}' at ${b.endTime.toFixed(2)}`)}flush(b){if(this._timingEvents.length-this._flushPointer>=this._flushBatchSize||b-this._flushTime>=this._flushIntervalInMilliseconds){for(const a=this._flushPointer;this._flushPointer<a+this._flushBatchSize&&this._flushPointer<this._timingEvents.length;this._flushPointer++)this.logOneEvent(this._timingEvents[this._flushPointer]);this._flushTime=(0,e.now)()}}get started(){return this._started}},e.now=typeof performance<"u"&&performance.now?()=>performance.now():Date.now},2644:(i,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Model=void 0;const c=s(5686),h=s(1446),$=s(7070),_=s(9395),j=s(2517);var nt=_.onnxruntime.experimental.fbs;e.Model=class{constructor(){}load(et,b,a){if(!a)try{return void this.loadFromOnnxFormat(et,b)}catch(o){if(a!==void 0)throw o}this.loadFromOrtFormat(et,b)}loadFromOnnxFormat(et,b){const a=h.onnx.ModelProto.decode(et);if(j.LongUtil.longToNumber(a.irVersion)<3)throw new Error("only support ONNX model with IR_VERSION>=3");this._opsets=a.opsetImport.map(o=>({domain:o.domain,version:j.LongUtil.longToNumber(o.version)})),this._graph=$.Graph.from(a.graph,b)}loadFromOrtFormat(et,b){const a=new c.flatbuffers.ByteBuffer(et),o=nt.InferenceSession.getRootAsInferenceSession(a).model();if(j.LongUtil.longToNumber(o.irVersion())<3)throw new Error("only support ONNX model with IR_VERSION>=3");this._opsets=[];for(let d=0;d<o.opsetImportLength();d++){const g=o.opsetImport(d);this._opsets.push({domain:g==null?void 0:g.domain(),version:j.LongUtil.longToNumber(g.version())})}this._graph=$.Graph.from(o.graph(),b)}get graph(){return this._graph}get opsets(){return this._opsets}}},782:(i,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.FLOAT_TYPES=e.INT_TYPES=e.NUMBER_TYPES=void 0,e.NUMBER_TYPES=["float32","float64","int32","int16","int8","uint16","uint32","uint8"],e.INT_TYPES=["int32","int16","int8","uint16","uint32","uint8"],e.FLOAT_TYPES=["float32","float64"]},1047:(i,e)=>{function s(c,h){if(h.endsWith("+")){const $=Number.parseInt(h.substring(0,h.length-1),10);return!isNaN($)&&$<=c}if(h.split("-").length===2){const $=h.split("-"),_=Number.parseInt($[0],10),j=Number.parseInt($[1],10);return!isNaN(_)&&!isNaN(j)&&_<=c&&c<=j}return Number.parseInt(h,10)===c}Object.defineProperty(e,"__esModule",{value:!0}),e.resolveOperator=void 0,e.resolveOperator=function(c,h,$){for(const _ of $){const j=_[0],nt=_[1],et=_[2],b=_[3],a=_[4];if(c.opType===j){for(const o of h)if((o.domain===nt||o.domain==="ai.onnx"&&nt==="")&&s(o.version,et))return{opImpl:b,opInit:a}}}throw new TypeError(`cannot resolve operator '${c.opType}' with opsets: ${h.map(_=>`${_.domain||"ai.onnx"} v${_.version}`).join(", ")}`)}},9395:(i,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.onnxruntime=void 0;const c=s(5686);var h,$;h=e.onnxruntime||(e.onnxruntime={}),function(_){(function(j){j[j.UNDEFINED=0]="UNDEFINED",j[j.FLOAT=1]="FLOAT",j[j.INT=2]="INT",j[j.STRING=3]="STRING",j[j.TENSOR=4]="TENSOR",j[j.GRAPH=5]="GRAPH",j[j.FLOATS=6]="FLOATS",j[j.INTS=7]="INTS",j[j.STRINGS=8]="STRINGS",j[j.TENSORS=9]="TENSORS",j[j.GRAPHS=10]="GRAPHS",j[j.SPARSE_TENSOR=11]="SPARSE_TENSOR",j[j.SPARSE_TENSORS=12]="SPARSE_TENSORS"})(_.AttributeType||(_.AttributeType={}))}(($=h.experimental||(h.experimental={})).fbs||($.fbs={})),function(_){(function(j){(function(nt){(function(et){et[et.UNKNOWN=0]="UNKNOWN",et[et.VALUE=1]="VALUE",et[et.PARAM=2]="PARAM"})(nt.DimensionValueType||(nt.DimensionValueType={}))})(j.fbs||(j.fbs={}))})(_.experimental||(_.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(_){(function(j){(function(nt){(function(et){et[et.UNDEFINED=0]="UNDEFINED",et[et.FLOAT=1]="FLOAT",et[et.UINT8=2]="UINT8",et[et.INT8=3]="INT8",et[et.UINT16=4]="UINT16",et[et.INT16=5]="INT16",et[et.INT32=6]="INT32",et[et.INT64=7]="INT64",et[et.STRING=8]="STRING",et[et.BOOL=9]="BOOL",et[et.FLOAT16=10]="FLOAT16",et[et.DOUBLE=11]="DOUBLE",et[et.UINT32=12]="UINT32",et[et.UINT64=13]="UINT64",et[et.COMPLEX64=14]="COMPLEX64",et[et.COMPLEX128=15]="COMPLEX128",et[et.BFLOAT16=16]="BFLOAT16"})(nt.TensorDataType||(nt.TensorDataType={}))})(j.fbs||(j.fbs={}))})(_.experimental||(_.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(_){(function(j){(function(nt){(function(et){et[et.Primitive=0]="Primitive",et[et.Fused=1]="Fused"})(nt.NodeType||(nt.NodeType={}))})(j.fbs||(j.fbs={}))})(_.experimental||(_.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(_){(function(j){(function(nt){(function(et){et[et.NONE=0]="NONE",et[et.tensor_type=1]="tensor_type",et[et.sequence_type=2]="sequence_type",et[et.map_type=3]="map_type"})(nt.TypeInfoValue||(nt.TypeInfoValue={}))})(j.fbs||(j.fbs={}))})(_.experimental||(_.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(_){(function(j){(function(nt){class et{constructor(){this.bb=null,this.bb_pos=0}__init(a,o){return this.bb_pos=a,this.bb=o,this}static getRootAsShape(a,o){return(o||new et).__init(a.readInt32(a.position())+a.position(),a)}static getSizePrefixedRootAsShape(a,o){return a.setPosition(a.position()+c.flatbuffers.SIZE_PREFIX_LENGTH),(o||new et).__init(a.readInt32(a.position())+a.position(),a)}dim(a,o){let d=this.bb.__offset(this.bb_pos,4);return d?(o||new _.experimental.fbs.Dimension).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+d)+4*a),this.bb):null}dimLength(){let a=this.bb.__offset(this.bb_pos,4);return a?this.bb.__vector_len(this.bb_pos+a):0}static startShape(a){a.startObject(1)}static addDim(a,o){a.addFieldOffset(0,o,0)}static createDimVector(a,o){a.startVector(4,o.length,4);for(let d=o.length-1;d>=0;d--)a.addOffset(o[d]);return a.endVector()}static startDimVector(a,o){a.startVector(4,o,4)}static endShape(a){return a.endObject()}static createShape(a,o){return et.startShape(a),et.addDim(a,o),et.endShape(a)}}nt.Shape=et})(j.fbs||(j.fbs={}))})(_.experimental||(_.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(_){(function(j){(function(nt){class et{constructor(){this.bb=null,this.bb_pos=0}__init(a,o){return this.bb_pos=a,this.bb=o,this}static getRootAsDimension(a,o){return(o||new et).__init(a.readInt32(a.position())+a.position(),a)}static getSizePrefixedRootAsDimension(a,o){return a.setPosition(a.position()+c.flatbuffers.SIZE_PREFIX_LENGTH),(o||new et).__init(a.readInt32(a.position())+a.position(),a)}value(a){let o=this.bb.__offset(this.bb_pos,4);return o?(a||new _.experimental.fbs.DimensionValue).__init(this.bb.__indirect(this.bb_pos+o),this.bb):null}denotation(a){let o=this.bb.__offset(this.bb_pos,6);return o?this.bb.__string(this.bb_pos+o,a):null}static startDimension(a){a.startObject(2)}static addValue(a,o){a.addFieldOffset(0,o,0)}static addDenotation(a,o){a.addFieldOffset(1,o,0)}static endDimension(a){return a.endObject()}static createDimension(a,o,d){return et.startDimension(a),et.addValue(a,o),et.addDenotation(a,d),et.endDimension(a)}}nt.Dimension=et})(j.fbs||(j.fbs={}))})(_.experimental||(_.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(_){(function(j){(function(nt){class et{constructor(){this.bb=null,this.bb_pos=0}__init(a,o){return this.bb_pos=a,this.bb=o,this}static getRootAsDimensionValue(a,o){return(o||new et).__init(a.readInt32(a.position())+a.position(),a)}static getSizePrefixedRootAsDimensionValue(a,o){return a.setPosition(a.position()+c.flatbuffers.SIZE_PREFIX_LENGTH),(o||new et).__init(a.readInt32(a.position())+a.position(),a)}dimType(){let a=this.bb.__offset(this.bb_pos,4);return a?this.bb.readInt8(this.bb_pos+a):_.experimental.fbs.DimensionValueType.UNKNOWN}dimValue(){let a=this.bb.__offset(this.bb_pos,6);return a?this.bb.readInt64(this.bb_pos+a):this.bb.createLong(0,0)}dimParam(a){let o=this.bb.__offset(this.bb_pos,8);return o?this.bb.__string(this.bb_pos+o,a):null}static startDimensionValue(a){a.startObject(3)}static addDimType(a,o){a.addFieldInt8(0,o,_.experimental.fbs.DimensionValueType.UNKNOWN)}static addDimValue(a,o){a.addFieldInt64(1,o,a.createLong(0,0))}static addDimParam(a,o){a.addFieldOffset(2,o,0)}static endDimensionValue(a){return a.endObject()}static createDimensionValue(a,o,d,g){return et.startDimensionValue(a),et.addDimType(a,o),et.addDimValue(a,d),et.addDimParam(a,g),et.endDimensionValue(a)}}nt.DimensionValue=et})(j.fbs||(j.fbs={}))})(_.experimental||(_.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(_){(function(j){(function(nt){class et{constructor(){this.bb=null,this.bb_pos=0}__init(a,o){return this.bb_pos=a,this.bb=o,this}static getRootAsTensorTypeAndShape(a,o){return(o||new et).__init(a.readInt32(a.position())+a.position(),a)}static getSizePrefixedRootAsTensorTypeAndShape(a,o){return a.setPosition(a.position()+c.flatbuffers.SIZE_PREFIX_LENGTH),(o||new et).__init(a.readInt32(a.position())+a.position(),a)}elemType(){let a=this.bb.__offset(this.bb_pos,4);return a?this.bb.readInt32(this.bb_pos+a):_.experimental.fbs.TensorDataType.UNDEFINED}shape(a){let o=this.bb.__offset(this.bb_pos,6);return o?(a||new _.experimental.fbs.Shape).__init(this.bb.__indirect(this.bb_pos+o),this.bb):null}static startTensorTypeAndShape(a){a.startObject(2)}static addElemType(a,o){a.addFieldInt32(0,o,_.experimental.fbs.TensorDataType.UNDEFINED)}static addShape(a,o){a.addFieldOffset(1,o,0)}static endTensorTypeAndShape(a){return a.endObject()}static createTensorTypeAndShape(a,o,d){return et.startTensorTypeAndShape(a),et.addElemType(a,o),et.addShape(a,d),et.endTensorTypeAndShape(a)}}nt.TensorTypeAndShape=et})(j.fbs||(j.fbs={}))})(_.experimental||(_.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(_){(function(j){(function(nt){class et{constructor(){this.bb=null,this.bb_pos=0}__init(a,o){return this.bb_pos=a,this.bb=o,this}static getRootAsMapType(a,o){return(o||new et).__init(a.readInt32(a.position())+a.position(),a)}static getSizePrefixedRootAsMapType(a,o){return a.setPosition(a.position()+c.flatbuffers.SIZE_PREFIX_LENGTH),(o||new et).__init(a.readInt32(a.position())+a.position(),a)}keyType(){let a=this.bb.__offset(this.bb_pos,4);return a?this.bb.readInt32(this.bb_pos+a):_.experimental.fbs.TensorDataType.UNDEFINED}valueType(a){let o=this.bb.__offset(this.bb_pos,6);return o?(a||new _.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+o),this.bb):null}static startMapType(a){a.startObject(2)}static addKeyType(a,o){a.addFieldInt32(0,o,_.experimental.fbs.TensorDataType.UNDEFINED)}static addValueType(a,o){a.addFieldOffset(1,o,0)}static endMapType(a){return a.endObject()}static createMapType(a,o,d){return et.startMapType(a),et.addKeyType(a,o),et.addValueType(a,d),et.endMapType(a)}}nt.MapType=et})(j.fbs||(j.fbs={}))})(_.experimental||(_.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(_){(function(j){(function(nt){class et{constructor(){this.bb=null,this.bb_pos=0}__init(a,o){return this.bb_pos=a,this.bb=o,this}static getRootAsSequenceType(a,o){return(o||new et).__init(a.readInt32(a.position())+a.position(),a)}static getSizePrefixedRootAsSequenceType(a,o){return a.setPosition(a.position()+c.flatbuffers.SIZE_PREFIX_LENGTH),(o||new et).__init(a.readInt32(a.position())+a.position(),a)}elemType(a){let o=this.bb.__offset(this.bb_pos,4);return o?(a||new _.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+o),this.bb):null}static startSequenceType(a){a.startObject(1)}static addElemType(a,o){a.addFieldOffset(0,o,0)}static endSequenceType(a){return a.endObject()}static createSequenceType(a,o){return et.startSequenceType(a),et.addElemType(a,o),et.endSequenceType(a)}}nt.SequenceType=et})(j.fbs||(j.fbs={}))})(_.experimental||(_.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(_){(function(j){(j.fbs||(j.fbs={})).EdgeEnd=class{constructor(){this.bb=null,this.bb_pos=0}__init(nt,et){return this.bb_pos=nt,this.bb=et,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(nt,et,b,a){return nt.prep(4,12),nt.writeInt32(a),nt.writeInt32(b),nt.writeInt32(et),nt.offset()}}})(_.experimental||(_.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(_){(function(j){(function(nt){class et{constructor(){this.bb=null,this.bb_pos=0}__init(a,o){return this.bb_pos=a,this.bb=o,this}static getRootAsNodeEdge(a,o){return(o||new et).__init(a.readInt32(a.position())+a.position(),a)}static getSizePrefixedRootAsNodeEdge(a,o){return a.setPosition(a.position()+c.flatbuffers.SIZE_PREFIX_LENGTH),(o||new et).__init(a.readInt32(a.position())+a.position(),a)}nodeIndex(){let a=this.bb.__offset(this.bb_pos,4);return a?this.bb.readUint32(this.bb_pos+a):0}inputEdges(a,o){let d=this.bb.__offset(this.bb_pos,6);return d?(o||new _.experimental.fbs.EdgeEnd).__init(this.bb.__vector(this.bb_pos+d)+12*a,this.bb):null}inputEdgesLength(){let a=this.bb.__offset(this.bb_pos,6);return a?this.bb.__vector_len(this.bb_pos+a):0}outputEdges(a,o){let d=this.bb.__offset(this.bb_pos,8);return d?(o||new _.experimental.fbs.EdgeEnd).__init(this.bb.__vector(this.bb_pos+d)+12*a,this.bb):null}outputEdgesLength(){let a=this.bb.__offset(this.bb_pos,8);return a?this.bb.__vector_len(this.bb_pos+a):0}static startNodeEdge(a){a.startObject(3)}static addNodeIndex(a,o){a.addFieldInt32(0,o,0)}static addInputEdges(a,o){a.addFieldOffset(1,o,0)}static startInputEdgesVector(a,o){a.startVector(12,o,4)}static addOutputEdges(a,o){a.addFieldOffset(2,o,0)}static startOutputEdgesVector(a,o){a.startVector(12,o,4)}static endNodeEdge(a){return a.endObject()}static createNodeEdge(a,o,d,g){return et.startNodeEdge(a),et.addNodeIndex(a,o),et.addInputEdges(a,d),et.addOutputEdges(a,g),et.endNodeEdge(a)}}nt.NodeEdge=et})(j.fbs||(j.fbs={}))})(_.experimental||(_.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(_){(function(j){(function(nt){class et{constructor(){this.bb=null,this.bb_pos=0}__init(a,o){return this.bb_pos=a,this.bb=o,this}static getRootAsNode(a,o){return(o||new et).__init(a.readInt32(a.position())+a.position(),a)}static getSizePrefixedRootAsNode(a,o){return a.setPosition(a.position()+c.flatbuffers.SIZE_PREFIX_LENGTH),(o||new et).__init(a.readInt32(a.position())+a.position(),a)}name(a){let o=this.bb.__offset(this.bb_pos,4);return o?this.bb.__string(this.bb_pos+o,a):null}docString(a){let o=this.bb.__offset(this.bb_pos,6);return o?this.bb.__string(this.bb_pos+o,a):null}domain(a){let o=this.bb.__offset(this.bb_pos,8);return o?this.bb.__string(this.bb_pos+o,a):null}sinceVersion(){let a=this.bb.__offset(this.bb_pos,10);return a?this.bb.readInt32(this.bb_pos+a):0}index(){let a=this.bb.__offset(this.bb_pos,12);return a?this.bb.readUint32(this.bb_pos+a):0}opType(a){let o=this.bb.__offset(this.bb_pos,14);return o?this.bb.__string(this.bb_pos+o,a):null}type(){let a=this.bb.__offset(this.bb_pos,16);return a?this.bb.readInt32(this.bb_pos+a):_.experimental.fbs.NodeType.Primitive}executionProviderType(a){let o=this.bb.__offset(this.bb_pos,18);return o?this.bb.__string(this.bb_pos+o,a):null}inputs(a,o){let d=this.bb.__offset(this.bb_pos,20);return d?this.bb.__string(this.bb.__vector(this.bb_pos+d)+4*a,o):null}inputsLength(){let a=this.bb.__offset(this.bb_pos,20);return a?this.bb.__vector_len(this.bb_pos+a):0}outputs(a,o){let d=this.bb.__offset(this.bb_pos,22);return d?this.bb.__string(this.bb.__vector(this.bb_pos+d)+4*a,o):null}outputsLength(){let a=this.bb.__offset(this.bb_pos,22);return a?this.bb.__vector_len(this.bb_pos+a):0}attributes(a,o){let d=this.bb.__offset(this.bb_pos,24);return d?(o||new _.experimental.fbs.Attribute).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+d)+4*a),this.bb):null}attributesLength(){let a=this.bb.__offset(this.bb_pos,24);return a?this.bb.__vector_len(this.bb_pos+a):0}inputArgCounts(a){let o=this.bb.__offset(this.bb_pos,26);return o?this.bb.readInt32(this.bb.__vector(this.bb_pos+o)+4*a):0}inputArgCountsLength(){let a=this.bb.__offset(this.bb_pos,26);return a?this.bb.__vector_len(this.bb_pos+a):0}inputArgCountsArray(){let a=this.bb.__offset(this.bb_pos,26);return a?new Int32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+a),this.bb.__vector_len(this.bb_pos+a)):null}implicitInputs(a,o){let d=this.bb.__offset(this.bb_pos,28);return d?this.bb.__string(this.bb.__vector(this.bb_pos+d)+4*a,o):null}implicitInputsLength(){let a=this.bb.__offset(this.bb_pos,28);return a?this.bb.__vector_len(this.bb_pos+a):0}static startNode(a){a.startObject(13)}static addName(a,o){a.addFieldOffset(0,o,0)}static addDocString(a,o){a.addFieldOffset(1,o,0)}static addDomain(a,o){a.addFieldOffset(2,o,0)}static addSinceVersion(a,o){a.addFieldInt32(3,o,0)}static addIndex(a,o){a.addFieldInt32(4,o,0)}static addOpType(a,o){a.addFieldOffset(5,o,0)}static addType(a,o){a.addFieldInt32(6,o,_.experimental.fbs.NodeType.Primitive)}static addExecutionProviderType(a,o){a.addFieldOffset(7,o,0)}static addInputs(a,o){a.addFieldOffset(8,o,0)}static createInputsVector(a,o){a.startVector(4,o.length,4);for(let d=o.length-1;d>=0;d--)a.addOffset(o[d]);return a.endVector()}static startInputsVector(a,o){a.startVector(4,o,4)}static addOutputs(a,o){a.addFieldOffset(9,o,0)}static createOutputsVector(a,o){a.startVector(4,o.length,4);for(let d=o.length-1;d>=0;d--)a.addOffset(o[d]);return a.endVector()}static startOutputsVector(a,o){a.startVector(4,o,4)}static addAttributes(a,o){a.addFieldOffset(10,o,0)}static createAttributesVector(a,o){a.startVector(4,o.length,4);for(let d=o.length-1;d>=0;d--)a.addOffset(o[d]);return a.endVector()}static startAttributesVector(a,o){a.startVector(4,o,4)}static addInputArgCounts(a,o){a.addFieldOffset(11,o,0)}static createInputArgCountsVector(a,o){a.startVector(4,o.length,4);for(let d=o.length-1;d>=0;d--)a.addInt32(o[d]);return a.endVector()}static startInputArgCountsVector(a,o){a.startVector(4,o,4)}static addImplicitInputs(a,o){a.addFieldOffset(12,o,0)}static createImplicitInputsVector(a,o){a.startVector(4,o.length,4);for(let d=o.length-1;d>=0;d--)a.addOffset(o[d]);return a.endVector()}static startImplicitInputsVector(a,o){a.startVector(4,o,4)}static endNode(a){return a.endObject()}static createNode(a,o,d,g,rt,st,tt,ot,it,at,ut,lt,ct,ft){return et.startNode(a),et.addName(a,o),et.addDocString(a,d),et.addDomain(a,g),et.addSinceVersion(a,rt),et.addIndex(a,st),et.addOpType(a,tt),et.addType(a,ot),et.addExecutionProviderType(a,it),et.addInputs(a,at),et.addOutputs(a,ut),et.addAttributes(a,lt),et.addInputArgCounts(a,ct),et.addImplicitInputs(a,ft),et.endNode(a)}}nt.Node=et})(j.fbs||(j.fbs={}))})(_.experimental||(_.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(_){(function(j){(function(nt){class et{constructor(){this.bb=null,this.bb_pos=0}__init(a,o){return this.bb_pos=a,this.bb=o,this}static getRootAsValueInfo(a,o){return(o||new et).__init(a.readInt32(a.position())+a.position(),a)}static getSizePrefixedRootAsValueInfo(a,o){return a.setPosition(a.position()+c.flatbuffers.SIZE_PREFIX_LENGTH),(o||new et).__init(a.readInt32(a.position())+a.position(),a)}name(a){let o=this.bb.__offset(this.bb_pos,4);return o?this.bb.__string(this.bb_pos+o,a):null}docString(a){let o=this.bb.__offset(this.bb_pos,6);return o?this.bb.__string(this.bb_pos+o,a):null}type(a){let o=this.bb.__offset(this.bb_pos,8);return o?(a||new _.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+o),this.bb):null}static startValueInfo(a){a.startObject(3)}static addName(a,o){a.addFieldOffset(0,o,0)}static addDocString(a,o){a.addFieldOffset(1,o,0)}static addType(a,o){a.addFieldOffset(2,o,0)}static endValueInfo(a){return a.endObject()}static createValueInfo(a,o,d,g){return et.startValueInfo(a),et.addName(a,o),et.addDocString(a,d),et.addType(a,g),et.endValueInfo(a)}}nt.ValueInfo=et})(j.fbs||(j.fbs={}))})(_.experimental||(_.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(_){(function(j){(function(nt){class et{constructor(){this.bb=null,this.bb_pos=0}__init(a,o){return this.bb_pos=a,this.bb=o,this}static getRootAsTypeInfo(a,o){return(o||new et).__init(a.readInt32(a.position())+a.position(),a)}static getSizePrefixedRootAsTypeInfo(a,o){return a.setPosition(a.position()+c.flatbuffers.SIZE_PREFIX_LENGTH),(o||new et).__init(a.readInt32(a.position())+a.position(),a)}denotation(a){let o=this.bb.__offset(this.bb_pos,4);return o?this.bb.__string(this.bb_pos+o,a):null}valueType(){let a=this.bb.__offset(this.bb_pos,6);return a?this.bb.readUint8(this.bb_pos+a):_.experimental.fbs.TypeInfoValue.NONE}value(a){let o=this.bb.__offset(this.bb_pos,8);return o?this.bb.__union(a,this.bb_pos+o):null}static startTypeInfo(a){a.startObject(3)}static addDenotation(a,o){a.addFieldOffset(0,o,0)}static addValueType(a,o){a.addFieldInt8(1,o,_.experimental.fbs.TypeInfoValue.NONE)}static addValue(a,o){a.addFieldOffset(2,o,0)}static endTypeInfo(a){return a.endObject()}static createTypeInfo(a,o,d,g){return et.startTypeInfo(a),et.addDenotation(a,o),et.addValueType(a,d),et.addValue(a,g),et.endTypeInfo(a)}}nt.TypeInfo=et})(j.fbs||(j.fbs={}))})(_.experimental||(_.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(_){(function(j){(function(nt){class et{constructor(){this.bb=null,this.bb_pos=0}__init(a,o){return this.bb_pos=a,this.bb=o,this}static getRootAsOperatorSetId(a,o){return(o||new et).__init(a.readInt32(a.position())+a.position(),a)}static getSizePrefixedRootAsOperatorSetId(a,o){return a.setPosition(a.position()+c.flatbuffers.SIZE_PREFIX_LENGTH),(o||new et).__init(a.readInt32(a.position())+a.position(),a)}domain(a){let o=this.bb.__offset(this.bb_pos,4);return o?this.bb.__string(this.bb_pos+o,a):null}version(){let a=this.bb.__offset(this.bb_pos,6);return a?this.bb.readInt64(this.bb_pos+a):this.bb.createLong(0,0)}static startOperatorSetId(a){a.startObject(2)}static addDomain(a,o){a.addFieldOffset(0,o,0)}static addVersion(a,o){a.addFieldInt64(1,o,a.createLong(0,0))}static endOperatorSetId(a){return a.endObject()}static createOperatorSetId(a,o,d){return et.startOperatorSetId(a),et.addDomain(a,o),et.addVersion(a,d),et.endOperatorSetId(a)}}nt.OperatorSetId=et})(j.fbs||(j.fbs={}))})(_.experimental||(_.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(_){(function(j){(function(nt){class et{constructor(){this.bb=null,this.bb_pos=0}__init(a,o){return this.bb_pos=a,this.bb=o,this}static getRootAsTensor(a,o){return(o||new et).__init(a.readInt32(a.position())+a.position(),a)}static getSizePrefixedRootAsTensor(a,o){return a.setPosition(a.position()+c.flatbuffers.SIZE_PREFIX_LENGTH),(o||new et).__init(a.readInt32(a.position())+a.position(),a)}name(a){let o=this.bb.__offset(this.bb_pos,4);return o?this.bb.__string(this.bb_pos+o,a):null}docString(a){let o=this.bb.__offset(this.bb_pos,6);return o?this.bb.__string(this.bb_pos+o,a):null}dims(a){let o=this.bb.__offset(this.bb_pos,8);return o?this.bb.readInt64(this.bb.__vector(this.bb_pos+o)+8*a):this.bb.createLong(0,0)}dimsLength(){let a=this.bb.__offset(this.bb_pos,8);return a?this.bb.__vector_len(this.bb_pos+a):0}dataType(){let a=this.bb.__offset(this.bb_pos,10);return a?this.bb.readInt32(this.bb_pos+a):_.experimental.fbs.TensorDataType.UNDEFINED}rawData(a){let o=this.bb.__offset(this.bb_pos,12);return o?this.bb.readUint8(this.bb.__vector(this.bb_pos+o)+a):0}rawDataLength(){let a=this.bb.__offset(this.bb_pos,12);return a?this.bb.__vector_len(this.bb_pos+a):0}rawDataArray(){let a=this.bb.__offset(this.bb_pos,12);return a?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+a),this.bb.__vector_len(this.bb_pos+a)):null}stringData(a,o){let d=this.bb.__offset(this.bb_pos,14);return d?this.bb.__string(this.bb.__vector(this.bb_pos+d)+4*a,o):null}stringDataLength(){let a=this.bb.__offset(this.bb_pos,14);return a?this.bb.__vector_len(this.bb_pos+a):0}static startTensor(a){a.startObject(6)}static addName(a,o){a.addFieldOffset(0,o,0)}static addDocString(a,o){a.addFieldOffset(1,o,0)}static addDims(a,o){a.addFieldOffset(2,o,0)}static createDimsVector(a,o){a.startVector(8,o.length,8);for(let d=o.length-1;d>=0;d--)a.addInt64(o[d]);return a.endVector()}static startDimsVector(a,o){a.startVector(8,o,8)}static addDataType(a,o){a.addFieldInt32(3,o,_.experimental.fbs.TensorDataType.UNDEFINED)}static addRawData(a,o){a.addFieldOffset(4,o,0)}static createRawDataVector(a,o){a.startVector(1,o.length,1);for(let d=o.length-1;d>=0;d--)a.addInt8(o[d]);return a.endVector()}static startRawDataVector(a,o){a.startVector(1,o,1)}static addStringData(a,o){a.addFieldOffset(5,o,0)}static createStringDataVector(a,o){a.startVector(4,o.length,4);for(let d=o.length-1;d>=0;d--)a.addOffset(o[d]);return a.endVector()}static startStringDataVector(a,o){a.startVector(4,o,4)}static endTensor(a){return a.endObject()}static createTensor(a,o,d,g,rt,st,tt){return et.startTensor(a),et.addName(a,o),et.addDocString(a,d),et.addDims(a,g),et.addDataType(a,rt),et.addRawData(a,st),et.addStringData(a,tt),et.endTensor(a)}}nt.Tensor=et})(j.fbs||(j.fbs={}))})(_.experimental||(_.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(_){(function(j){(function(nt){class et{constructor(){this.bb=null,this.bb_pos=0}__init(a,o){return this.bb_pos=a,this.bb=o,this}static getRootAsSparseTensor(a,o){return(o||new et).__init(a.readInt32(a.position())+a.position(),a)}static getSizePrefixedRootAsSparseTensor(a,o){return a.setPosition(a.position()+c.flatbuffers.SIZE_PREFIX_LENGTH),(o||new et).__init(a.readInt32(a.position())+a.position(),a)}values(a){let o=this.bb.__offset(this.bb_pos,4);return o?(a||new _.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+o),this.bb):null}indices(a){let o=this.bb.__offset(this.bb_pos,6);return o?(a||new _.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+o),this.bb):null}dims(a){let o=this.bb.__offset(this.bb_pos,8);return o?this.bb.readInt64(this.bb.__vector(this.bb_pos+o)+8*a):this.bb.createLong(0,0)}dimsLength(){let a=this.bb.__offset(this.bb_pos,8);return a?this.bb.__vector_len(this.bb_pos+a):0}static startSparseTensor(a){a.startObject(3)}static addValues(a,o){a.addFieldOffset(0,o,0)}static addIndices(a,o){a.addFieldOffset(1,o,0)}static addDims(a,o){a.addFieldOffset(2,o,0)}static createDimsVector(a,o){a.startVector(8,o.length,8);for(let d=o.length-1;d>=0;d--)a.addInt64(o[d]);return a.endVector()}static startDimsVector(a,o){a.startVector(8,o,8)}static endSparseTensor(a){return a.endObject()}static createSparseTensor(a,o,d,g){return et.startSparseTensor(a),et.addValues(a,o),et.addIndices(a,d),et.addDims(a,g),et.endSparseTensor(a)}}nt.SparseTensor=et})(j.fbs||(j.fbs={}))})(_.experimental||(_.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(_){(function(j){(function(nt){class et{constructor(){this.bb=null,this.bb_pos=0}__init(a,o){return this.bb_pos=a,this.bb=o,this}static getRootAsAttribute(a,o){return(o||new et).__init(a.readInt32(a.position())+a.position(),a)}static getSizePrefixedRootAsAttribute(a,o){return a.setPosition(a.position()+c.flatbuffers.SIZE_PREFIX_LENGTH),(o||new et).__init(a.readInt32(a.position())+a.position(),a)}name(a){let o=this.bb.__offset(this.bb_pos,4);return o?this.bb.__string(this.bb_pos+o,a):null}docString(a){let o=this.bb.__offset(this.bb_pos,6);return o?this.bb.__string(this.bb_pos+o,a):null}type(){let a=this.bb.__offset(this.bb_pos,8);return a?this.bb.readInt32(this.bb_pos+a):_.experimental.fbs.AttributeType.UNDEFINED}f(){let a=this.bb.__offset(this.bb_pos,10);return a?this.bb.readFloat32(this.bb_pos+a):0}i(){let a=this.bb.__offset(this.bb_pos,12);return a?this.bb.readInt64(this.bb_pos+a):this.bb.createLong(0,0)}s(a){let o=this.bb.__offset(this.bb_pos,14);return o?this.bb.__string(this.bb_pos+o,a):null}t(a){let o=this.bb.__offset(this.bb_pos,16);return o?(a||new _.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+o),this.bb):null}g(a){let o=this.bb.__offset(this.bb_pos,18);return o?(a||new _.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb_pos+o),this.bb):null}floats(a){let o=this.bb.__offset(this.bb_pos,20);return o?this.bb.readFloat32(this.bb.__vector(this.bb_pos+o)+4*a):0}floatsLength(){let a=this.bb.__offset(this.bb_pos,20);return a?this.bb.__vector_len(this.bb_pos+a):0}floatsArray(){let a=this.bb.__offset(this.bb_pos,20);return a?new Float32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+a),this.bb.__vector_len(this.bb_pos+a)):null}ints(a){let o=this.bb.__offset(this.bb_pos,22);return o?this.bb.readInt64(this.bb.__vector(this.bb_pos+o)+8*a):this.bb.createLong(0,0)}intsLength(){let a=this.bb.__offset(this.bb_pos,22);return a?this.bb.__vector_len(this.bb_pos+a):0}strings(a,o){let d=this.bb.__offset(this.bb_pos,24);return d?this.bb.__string(this.bb.__vector(this.bb_pos+d)+4*a,o):null}stringsLength(){let a=this.bb.__offset(this.bb_pos,24);return a?this.bb.__vector_len(this.bb_pos+a):0}tensors(a,o){let d=this.bb.__offset(this.bb_pos,26);return d?(o||new _.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+d)+4*a),this.bb):null}tensorsLength(){let a=this.bb.__offset(this.bb_pos,26);return a?this.bb.__vector_len(this.bb_pos+a):0}graphs(a,o){let d=this.bb.__offset(this.bb_pos,28);return d?(o||new _.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+d)+4*a),this.bb):null}graphsLength(){let a=this.bb.__offset(this.bb_pos,28);return a?this.bb.__vector_len(this.bb_pos+a):0}static startAttribute(a){a.startObject(13)}static addName(a,o){a.addFieldOffset(0,o,0)}static addDocString(a,o){a.addFieldOffset(1,o,0)}static addType(a,o){a.addFieldInt32(2,o,_.experimental.fbs.AttributeType.UNDEFINED)}static addF(a,o){a.addFieldFloat32(3,o,0)}static addI(a,o){a.addFieldInt64(4,o,a.createLong(0,0))}static addS(a,o){a.addFieldOffset(5,o,0)}static addT(a,o){a.addFieldOffset(6,o,0)}static addG(a,o){a.addFieldOffset(7,o,0)}static addFloats(a,o){a.addFieldOffset(8,o,0)}static createFloatsVector(a,o){a.startVector(4,o.length,4);for(let d=o.length-1;d>=0;d--)a.addFloat32(o[d]);return a.endVector()}static startFloatsVector(a,o){a.startVector(4,o,4)}static addInts(a,o){a.addFieldOffset(9,o,0)}static createIntsVector(a,o){a.startVector(8,o.length,8);for(let d=o.length-1;d>=0;d--)a.addInt64(o[d]);return a.endVector()}static startIntsVector(a,o){a.startVector(8,o,8)}static addStrings(a,o){a.addFieldOffset(10,o,0)}static createStringsVector(a,o){a.startVector(4,o.length,4);for(let d=o.length-1;d>=0;d--)a.addOffset(o[d]);return a.endVector()}static startStringsVector(a,o){a.startVector(4,o,4)}static addTensors(a,o){a.addFieldOffset(11,o,0)}static createTensorsVector(a,o){a.startVector(4,o.length,4);for(let d=o.length-1;d>=0;d--)a.addOffset(o[d]);return a.endVector()}static startTensorsVector(a,o){a.startVector(4,o,4)}static addGraphs(a,o){a.addFieldOffset(12,o,0)}static createGraphsVector(a,o){a.startVector(4,o.length,4);for(let d=o.length-1;d>=0;d--)a.addOffset(o[d]);return a.endVector()}static startGraphsVector(a,o){a.startVector(4,o,4)}static endAttribute(a){return a.endObject()}static createAttribute(a,o,d,g,rt,st,tt,ot,it,at,ut,lt,ct,ft){return et.startAttribute(a),et.addName(a,o),et.addDocString(a,d),et.addType(a,g),et.addF(a,rt),et.addI(a,st),et.addS(a,tt),et.addT(a,ot),et.addG(a,it),et.addFloats(a,at),et.addInts(a,ut),et.addStrings(a,lt),et.addTensors(a,ct),et.addGraphs(a,ft),et.endAttribute(a)}}nt.Attribute=et})(j.fbs||(j.fbs={}))})(_.experimental||(_.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(_){(function(j){(function(nt){class et{constructor(){this.bb=null,this.bb_pos=0}__init(a,o){return this.bb_pos=a,this.bb=o,this}static getRootAsGraph(a,o){return(o||new et).__init(a.readInt32(a.position())+a.position(),a)}static getSizePrefixedRootAsGraph(a,o){return a.setPosition(a.position()+c.flatbuffers.SIZE_PREFIX_LENGTH),(o||new et).__init(a.readInt32(a.position())+a.position(),a)}initializers(a,o){let d=this.bb.__offset(this.bb_pos,4);return d?(o||new _.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+d)+4*a),this.bb):null}initializersLength(){let a=this.bb.__offset(this.bb_pos,4);return a?this.bb.__vector_len(this.bb_pos+a):0}nodeArgs(a,o){let d=this.bb.__offset(this.bb_pos,6);return d?(o||new _.experimental.fbs.ValueInfo).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+d)+4*a),this.bb):null}nodeArgsLength(){let a=this.bb.__offset(this.bb_pos,6);return a?this.bb.__vector_len(this.bb_pos+a):0}nodes(a,o){let d=this.bb.__offset(this.bb_pos,8);return d?(o||new _.experimental.fbs.Node).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+d)+4*a),this.bb):null}nodesLength(){let a=this.bb.__offset(this.bb_pos,8);return a?this.bb.__vector_len(this.bb_pos+a):0}maxNodeIndex(){let a=this.bb.__offset(this.bb_pos,10);return a?this.bb.readUint32(this.bb_pos+a):0}nodeEdges(a,o){let d=this.bb.__offset(this.bb_pos,12);return d?(o||new _.experimental.fbs.NodeEdge).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+d)+4*a),this.bb):null}nodeEdgesLength(){let a=this.bb.__offset(this.bb_pos,12);return a?this.bb.__vector_len(this.bb_pos+a):0}inputs(a,o){let d=this.bb.__offset(this.bb_pos,14);return d?this.bb.__string(this.bb.__vector(this.bb_pos+d)+4*a,o):null}inputsLength(){let a=this.bb.__offset(this.bb_pos,14);return a?this.bb.__vector_len(this.bb_pos+a):0}outputs(a,o){let d=this.bb.__offset(this.bb_pos,16);return d?this.bb.__string(this.bb.__vector(this.bb_pos+d)+4*a,o):null}outputsLength(){let a=this.bb.__offset(this.bb_pos,16);return a?this.bb.__vector_len(this.bb_pos+a):0}sparseInitializers(a,o){let d=this.bb.__offset(this.bb_pos,18);return d?(o||new _.experimental.fbs.SparseTensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+d)+4*a),this.bb):null}sparseInitializersLength(){let a=this.bb.__offset(this.bb_pos,18);return a?this.bb.__vector_len(this.bb_pos+a):0}static startGraph(a){a.startObject(8)}static addInitializers(a,o){a.addFieldOffset(0,o,0)}static createInitializersVector(a,o){a.startVector(4,o.length,4);for(let d=o.length-1;d>=0;d--)a.addOffset(o[d]);return a.endVector()}static startInitializersVector(a,o){a.startVector(4,o,4)}static addNodeArgs(a,o){a.addFieldOffset(1,o,0)}static createNodeArgsVector(a,o){a.startVector(4,o.length,4);for(let d=o.length-1;d>=0;d--)a.addOffset(o[d]);return a.endVector()}static startNodeArgsVector(a,o){a.startVector(4,o,4)}static addNodes(a,o){a.addFieldOffset(2,o,0)}static createNodesVector(a,o){a.startVector(4,o.length,4);for(let d=o.length-1;d>=0;d--)a.addOffset(o[d]);return a.endVector()}static startNodesVector(a,o){a.startVector(4,o,4)}static addMaxNodeIndex(a,o){a.addFieldInt32(3,o,0)}static addNodeEdges(a,o){a.addFieldOffset(4,o,0)}static createNodeEdgesVector(a,o){a.startVector(4,o.length,4);for(let d=o.length-1;d>=0;d--)a.addOffset(o[d]);return a.endVector()}static startNodeEdgesVector(a,o){a.startVector(4,o,4)}static addInputs(a,o){a.addFieldOffset(5,o,0)}static createInputsVector(a,o){a.startVector(4,o.length,4);for(let d=o.length-1;d>=0;d--)a.addOffset(o[d]);return a.endVector()}static startInputsVector(a,o){a.startVector(4,o,4)}static addOutputs(a,o){a.addFieldOffset(6,o,0)}static createOutputsVector(a,o){a.startVector(4,o.length,4);for(let d=o.length-1;d>=0;d--)a.addOffset(o[d]);return a.endVector()}static startOutputsVector(a,o){a.startVector(4,o,4)}static addSparseInitializers(a,o){a.addFieldOffset(7,o,0)}static createSparseInitializersVector(a,o){a.startVector(4,o.length,4);for(let d=o.length-1;d>=0;d--)a.addOffset(o[d]);return a.endVector()}static startSparseInitializersVector(a,o){a.startVector(4,o,4)}static endGraph(a){return a.endObject()}static createGraph(a,o,d,g,rt,st,tt,ot,it){return et.startGraph(a),et.addInitializers(a,o),et.addNodeArgs(a,d),et.addNodes(a,g),et.addMaxNodeIndex(a,rt),et.addNodeEdges(a,st),et.addInputs(a,tt),et.addOutputs(a,ot),et.addSparseInitializers(a,it),et.endGraph(a)}}nt.Graph=et})(j.fbs||(j.fbs={}))})(_.experimental||(_.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(_){(function(j){(function(nt){class et{constructor(){this.bb=null,this.bb_pos=0}__init(a,o){return this.bb_pos=a,this.bb=o,this}static getRootAsModel(a,o){return(o||new et).__init(a.readInt32(a.position())+a.position(),a)}static getSizePrefixedRootAsModel(a,o){return a.setPosition(a.position()+c.flatbuffers.SIZE_PREFIX_LENGTH),(o||new et).__init(a.readInt32(a.position())+a.position(),a)}irVersion(){let a=this.bb.__offset(this.bb_pos,4);return a?this.bb.readInt64(this.bb_pos+a):this.bb.createLong(0,0)}opsetImport(a,o){let d=this.bb.__offset(this.bb_pos,6);return d?(o||new _.experimental.fbs.OperatorSetId).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+d)+4*a),this.bb):null}opsetImportLength(){let a=this.bb.__offset(this.bb_pos,6);return a?this.bb.__vector_len(this.bb_pos+a):0}producerName(a){let o=this.bb.__offset(this.bb_pos,8);return o?this.bb.__string(this.bb_pos+o,a):null}producerVersion(a){let o=this.bb.__offset(this.bb_pos,10);return o?this.bb.__string(this.bb_pos+o,a):null}domain(a){let o=this.bb.__offset(this.bb_pos,12);return o?this.bb.__string(this.bb_pos+o,a):null}modelVersion(){let a=this.bb.__offset(this.bb_pos,14);return a?this.bb.readInt64(this.bb_pos+a):this.bb.createLong(0,0)}docString(a){let o=this.bb.__offset(this.bb_pos,16);return o?this.bb.__string(this.bb_pos+o,a):null}graph(a){let o=this.bb.__offset(this.bb_pos,18);return o?(a||new _.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb_pos+o),this.bb):null}graphDocString(a){let o=this.bb.__offset(this.bb_pos,20);return o?this.bb.__string(this.bb_pos+o,a):null}static startModel(a){a.startObject(9)}static addIrVersion(a,o){a.addFieldInt64(0,o,a.createLong(0,0))}static addOpsetImport(a,o){a.addFieldOffset(1,o,0)}static createOpsetImportVector(a,o){a.startVector(4,o.length,4);for(let d=o.length-1;d>=0;d--)a.addOffset(o[d]);return a.endVector()}static startOpsetImportVector(a,o){a.startVector(4,o,4)}static addProducerName(a,o){a.addFieldOffset(2,o,0)}static addProducerVersion(a,o){a.addFieldOffset(3,o,0)}static addDomain(a,o){a.addFieldOffset(4,o,0)}static addModelVersion(a,o){a.addFieldInt64(5,o,a.createLong(0,0))}static addDocString(a,o){a.addFieldOffset(6,o,0)}static addGraph(a,o){a.addFieldOffset(7,o,0)}static addGraphDocString(a,o){a.addFieldOffset(8,o,0)}static endModel(a){return a.endObject()}static createModel(a,o,d,g,rt,st,tt,ot,it,at){return et.startModel(a),et.addIrVersion(a,o),et.addOpsetImport(a,d),et.addProducerName(a,g),et.addProducerVersion(a,rt),et.addDomain(a,st),et.addModelVersion(a,tt),et.addDocString(a,ot),et.addGraph(a,it),et.addGraphDocString(a,at),et.endModel(a)}}nt.Model=et})(j.fbs||(j.fbs={}))})(_.experimental||(_.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(_){(function(j){(function(nt){class et{constructor(){this.bb=null,this.bb_pos=0}__init(a,o){return this.bb_pos=a,this.bb=o,this}static getRootAsKernelCreateInfos(a,o){return(o||new et).__init(a.readInt32(a.position())+a.position(),a)}static getSizePrefixedRootAsKernelCreateInfos(a,o){return a.setPosition(a.position()+c.flatbuffers.SIZE_PREFIX_LENGTH),(o||new et).__init(a.readInt32(a.position())+a.position(),a)}nodeIndices(a){let o=this.bb.__offset(this.bb_pos,4);return o?this.bb.readUint32(this.bb.__vector(this.bb_pos+o)+4*a):0}nodeIndicesLength(){let a=this.bb.__offset(this.bb_pos,4);return a?this.bb.__vector_len(this.bb_pos+a):0}nodeIndicesArray(){let a=this.bb.__offset(this.bb_pos,4);return a?new Uint32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+a),this.bb.__vector_len(this.bb_pos+a)):null}kernelDefHashes(a){let o=this.bb.__offset(this.bb_pos,6);return o?this.bb.readUint64(this.bb.__vector(this.bb_pos+o)+8*a):this.bb.createLong(0,0)}kernelDefHashesLength(){let a=this.bb.__offset(this.bb_pos,6);return a?this.bb.__vector_len(this.bb_pos+a):0}static startKernelCreateInfos(a){a.startObject(2)}static addNodeIndices(a,o){a.addFieldOffset(0,o,0)}static createNodeIndicesVector(a,o){a.startVector(4,o.length,4);for(let d=o.length-1;d>=0;d--)a.addInt32(o[d]);return a.endVector()}static startNodeIndicesVector(a,o){a.startVector(4,o,4)}static addKernelDefHashes(a,o){a.addFieldOffset(1,o,0)}static createKernelDefHashesVector(a,o){a.startVector(8,o.length,8);for(let d=o.length-1;d>=0;d--)a.addInt64(o[d]);return a.endVector()}static startKernelDefHashesVector(a,o){a.startVector(8,o,8)}static endKernelCreateInfos(a){return a.endObject()}static createKernelCreateInfos(a,o,d){return et.startKernelCreateInfos(a),et.addNodeIndices(a,o),et.addKernelDefHashes(a,d),et.endKernelCreateInfos(a)}}nt.KernelCreateInfos=et})(j.fbs||(j.fbs={}))})(_.experimental||(_.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(_){(function(j){(function(nt){class et{constructor(){this.bb=null,this.bb_pos=0}__init(a,o){return this.bb_pos=a,this.bb=o,this}static getRootAsSubGraphSessionState(a,o){return(o||new et).__init(a.readInt32(a.position())+a.position(),a)}static getSizePrefixedRootAsSubGraphSessionState(a,o){return a.setPosition(a.position()+c.flatbuffers.SIZE_PREFIX_LENGTH),(o||new et).__init(a.readInt32(a.position())+a.position(),a)}graphId(a){let o=this.bb.__offset(this.bb_pos,4);return o?this.bb.__string(this.bb_pos+o,a):null}sessionState(a){let o=this.bb.__offset(this.bb_pos,6);return o?(a||new _.experimental.fbs.SessionState).__init(this.bb.__indirect(this.bb_pos+o),this.bb):null}static startSubGraphSessionState(a){a.startObject(2)}static addGraphId(a,o){a.addFieldOffset(0,o,0)}static addSessionState(a,o){a.addFieldOffset(1,o,0)}static endSubGraphSessionState(a){let o=a.endObject();return a.requiredField(o,4),o}static createSubGraphSessionState(a,o,d){return et.startSubGraphSessionState(a),et.addGraphId(a,o),et.addSessionState(a,d),et.endSubGraphSessionState(a)}}nt.SubGraphSessionState=et})(j.fbs||(j.fbs={}))})(_.experimental||(_.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(_){(function(j){(function(nt){class et{constructor(){this.bb=null,this.bb_pos=0}__init(a,o){return this.bb_pos=a,this.bb=o,this}static getRootAsSessionState(a,o){return(o||new et).__init(a.readInt32(a.position())+a.position(),a)}static getSizePrefixedRootAsSessionState(a,o){return a.setPosition(a.position()+c.flatbuffers.SIZE_PREFIX_LENGTH),(o||new et).__init(a.readInt32(a.position())+a.position(),a)}kernels(a){let o=this.bb.__offset(this.bb_pos,4);return o?(a||new _.experimental.fbs.KernelCreateInfos).__init(this.bb.__indirect(this.bb_pos+o),this.bb):null}subGraphSessionStates(a,o){let d=this.bb.__offset(this.bb_pos,6);return d?(o||new _.experimental.fbs.SubGraphSessionState).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+d)+4*a),this.bb):null}subGraphSessionStatesLength(){let a=this.bb.__offset(this.bb_pos,6);return a?this.bb.__vector_len(this.bb_pos+a):0}static startSessionState(a){a.startObject(2)}static addKernels(a,o){a.addFieldOffset(0,o,0)}static addSubGraphSessionStates(a,o){a.addFieldOffset(1,o,0)}static createSubGraphSessionStatesVector(a,o){a.startVector(4,o.length,4);for(let d=o.length-1;d>=0;d--)a.addOffset(o[d]);return a.endVector()}static startSubGraphSessionStatesVector(a,o){a.startVector(4,o,4)}static endSessionState(a){return a.endObject()}static createSessionState(a,o,d){return et.startSessionState(a),et.addKernels(a,o),et.addSubGraphSessionStates(a,d),et.endSessionState(a)}}nt.SessionState=et})(j.fbs||(j.fbs={}))})(_.experimental||(_.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(_){(function(j){(function(nt){class et{constructor(){this.bb=null,this.bb_pos=0}__init(a,o){return this.bb_pos=a,this.bb=o,this}static getRootAsInferenceSession(a,o){return(o||new et).__init(a.readInt32(a.position())+a.position(),a)}static getSizePrefixedRootAsInferenceSession(a,o){return a.setPosition(a.position()+c.flatbuffers.SIZE_PREFIX_LENGTH),(o||new et).__init(a.readInt32(a.position())+a.position(),a)}static bufferHasIdentifier(a){return a.__has_identifier("ORTM")}ortVersion(a){let o=this.bb.__offset(this.bb_pos,4);return o?this.bb.__string(this.bb_pos+o,a):null}model(a){let o=this.bb.__offset(this.bb_pos,6);return o?(a||new _.experimental.fbs.Model).__init(this.bb.__indirect(this.bb_pos+o),this.bb):null}sessionState(a){let o=this.bb.__offset(this.bb_pos,8);return o?(a||new _.experimental.fbs.SessionState).__init(this.bb.__indirect(this.bb_pos+o),this.bb):null}static startInferenceSession(a){a.startObject(3)}static addOrtVersion(a,o){a.addFieldOffset(0,o,0)}static addModel(a,o){a.addFieldOffset(1,o,0)}static addSessionState(a,o){a.addFieldOffset(2,o,0)}static endInferenceSession(a){return a.endObject()}static finishInferenceSessionBuffer(a,o){a.finish(o,"ORTM")}static finishSizePrefixedInferenceSessionBuffer(a,o){a.finish(o,"ORTM",!0)}static createInferenceSession(a,o,d,g){return et.startInferenceSession(a),et.addOrtVersion(a,o),et.addModel(a,d),et.addSessionState(a,g),et.endInferenceSession(a)}}nt.InferenceSession=et})(j.fbs||(j.fbs={}))})(_.experimental||(_.experimental={}))}(e.onnxruntime||(e.onnxruntime={}))},7448:(i,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.OnnxjsSessionHandler=void 0;const c=s(1670),h=s(9162);e.OnnxjsSessionHandler=class{constructor($){this.session=$,this.inputNames=this.session.inputNames,this.outputNames=this.session.outputNames}async dispose(){}async run($,_,j){const nt=new Map;for(const a in $)if(Object.hasOwnProperty.call($,a)){const o=$[a];nt.set(a,new h.Tensor(o.dims,o.type,void 0,void 0,o.data))}const et=await this.session.run(nt),b={};return et.forEach((a,o)=>{b[o]=new c.Tensor(a.type,a.data,a.dims)}),b}startProfiling(){this.session.startProfiling()}endProfiling(){this.session.endProfiling()}}},6919:(i,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Session=void 0;const c=s(7067),h=s(1296),$=s(7091),_=s(1036),j=s(6231),nt=s(2644);e.Session=class{constructor(et={}){this._initialized=!1,this.backendHint=et.backendHint,this.profiler=j.Profiler.create(et.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(et,b,a){await this.profiler.event("session","Session.loadModel",async()=>{const o=await(0,$.resolveBackend)(this.backendHint);if(this.sessionHandler=o.createSessionHandler(this.context),this._model=new nt.Model,typeof et=="string"){const d=et.endsWith(".ort");if(typeof fetch>"u"){const g=await(0,h.promisify)(c.readFile)(et);this.initialize(g,d)}else{const g=await fetch(et),rt=await g.arrayBuffer();this.initialize(new Uint8Array(rt),d)}}else if(ArrayBuffer.isView(et))this.initialize(et);else{const d=new Uint8Array(et,b||0,a||et.byteLength);this.initialize(d)}})}initialize(et,b){if(this._initialized)throw new Error("already initialized");this.profiler.event("session","Session.initialize",()=>{const a=this.sessionHandler.transformGraph?this.sessionHandler:void 0;this._model.load(et,a,b),this.sessionHandler.onGraphInitialized&&this.sessionHandler.onGraphInitialized(this._model.graph),this.initializeOps(this._model.graph),this._executionPlan=new _.ExecutionPlan(this._model.graph,this._ops,this.profiler)}),this._initialized=!0}async run(et){if(!this._initialized)throw new Error("session not initialized yet");return this.profiler.event("session","Session.run",async()=>{const b=this.normalizeAndValidateInputs(et),a=await this._executionPlan.execute(this.sessionHandler,b);return this.createOutput(a)})}normalizeAndValidateInputs(et){const b=this._model.graph.getInputNames();if(Array.isArray(et)){if(et.length!==b.length)throw new Error(`incorrect input array length: expected ${b.length} but got ${et.length}`)}else{if(et.size!==b.length)throw new Error(`incorrect input map size: expected ${b.length} but got ${et.size}`);const a=new Array(et.size);let o=0;for(let d=0;d<b.length;++d){const g=et.get(b[d]);if(!g)throw new Error(`missing input tensor for: '${name}'`);a[o++]=g}et=a}if(this.context.graphInputTypes&&this.context.graphInputTypes.length!==0&&this.context.graphInputDims&&this.context.graphInputDims.length!==0)this.validateInputTensorDims(this.context.graphInputDims,et,!1);else{const a=this._model.graph.getInputIndices(),o=this._model.graph.getValues(),d=new Array(a.length);for(let g=0;g<a.length;++g){const rt=o[a[g]];d[g]=rt.type.shape.dims,this.context.graphInputTypes.push(rt.type.tensorType),this.context.graphInputDims.push(et[g].dims)}this.validateInputTensorDims(d,et,!0)}return this.validateInputTensorTypes(this.context.graphInputTypes,et),et}validateInputTensorTypes(et,b){for(let a=0;a<b.length;a++){const o=et[a],d=b[a].type;if(o!==d)throw new Error(`input tensor[${a}] check failed: expected type '${o}' but got ${d}`)}}validateInputTensorDims(et,b,a){for(let o=0;o<b.length;o++){const d=et[o],g=b[o].dims;if(!this.compareTensorDims(d,g,a))throw new Error(`input tensor[${o}] check failed: expected shape '[${d.join(",")}]' but got [${g.join(",")}]`)}}compareTensorDims(et,b,a){if(et.length!==b.length)return!1;for(let o=0;o<et.length;++o)if(et[o]!==b[o]&&(!a||et[o]!==0))return!1;return!0}createOutput(et){const b=this._model.graph.getOutputNames();if(et.length!==b.length)throw new Error("expected number of outputs do not match number of generated outputs");const a=new Map;for(let o=0;o<b.length;++o)a.set(b[o],et[o]);return a}initializeOps(et){const b=et.getNodes();this._ops=new Array(b.length);for(let a=0;a<b.length;a++)this._ops[a]=this.sessionHandler.resolve(b[a],this._model.opsets,et)}}},9162:function(i,e,s){var c=this&&this.__importDefault||function(rt){return rt&&rt.__esModule?rt:{default:rt}};Object.defineProperty(e,"__esModule",{value:!0}),e.Tensor=void 0;const h=s(3442),$=c(s(3720)),_=s(1446),j=s(9395),nt=s(2517);var et=j.onnxruntime.experimental.fbs;class b{get data(){if(this.cache===void 0){const st=this.dataProvider(this.dataId);if(st.length!==this.size)throw new Error("Length of data provided by the Data Provider is inconsistent with the dims of this Tensor.");this.cache=st}return this.cache}get stringData(){if(this.type!=="string")throw new TypeError("data type is not string");return this.data}get integerData(){switch(this.type){case"uint8":case"int8":case"uint16":case"int16":case"int32":case"uint32":case"bool":return this.data;default:throw new TypeError("data type is not integer (uint8, int8, uint16, int16, int32, uint32, bool)")}}get floatData(){switch(this.type){case"float32":case"float64":return this.data;default:throw new TypeError("data type is not float (float32, float64)")}}get numberData(){if(this.type!=="string")return this.data;throw new TypeError("type cannot be non-number (string)")}get(st){return this.data[nt.ShapeUtil.indicesToOffset(st,this.strides)]}set(st,tt){this.data[nt.ShapeUtil.indicesToOffset(st,this.strides)]=tt}async getData(){return this.cache===void 0&&(this.cache=await this.asyncDataProvider(this.dataId)),this.cache}get strides(){return this._strides||(this._strides=nt.ShapeUtil.computeStrides(this.dims)),this._strides}constructor(st,tt,ot,it,at,ut=h.Guid.create()){this.dims=st,this.type=tt,this.dataProvider=ot,this.asyncDataProvider=it,this.cache=at,this.dataId=ut,this.size=nt.ShapeUtil.validateDimsAndCalcSize(st);const lt=this.size,ct=ot===void 0&&it===void 0&&at===void 0;if(at!==void 0&&at.length!==lt)throw new RangeError("Input dims doesn't match data length.");if(tt==="string"){if(!(at===void 0||Array.isArray(at)&&at.every(ft=>typeof ft=="string")))throw new TypeError("cache should be a string array");ct&&(this.cache=new Array(lt))}else{if(at!==void 0){const ft=o(tt);if(!(at instanceof ft))throw new TypeError(`cache should be type ${ft.name}`)}if(ct){const ft=new ArrayBuffer(lt*function(dt){switch(dt){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 ${dt}`)}}(tt));this.cache=function(dt,yt){return new(o(yt))(dt)}(ft,tt)}}}static fromProto(st){if(!st)throw new Error("cannot construct Value from an empty tensor");const tt=nt.ProtoUtil.tensorDataTypeFromProto(st.dataType),ot=nt.ProtoUtil.tensorDimsFromProto(st.dims),it=new b(ot,tt);if(tt==="string")st.stringData.forEach((at,ut)=>{it.data[ut]=(0,nt.decodeUtf8String)(at)});else if(st.rawData&&typeof st.rawData.byteLength=="number"&&st.rawData.byteLength>0){const at=it.data,ut=new DataView(st.rawData.buffer,st.rawData.byteOffset,st.rawData.byteLength),lt=a(st.dataType),ct=st.rawData.byteLength/lt;if(st.rawData.byteLength%lt!=0)throw new Error("invalid buffer length");if(at.length!==ct)throw new Error("buffer length mismatch");for(let ft=0;ft<ct;ft++){const dt=g(ut,st.dataType,ft*lt);at[ft]=dt}}else{let at;switch(st.dataType){case _.onnx.TensorProto.DataType.FLOAT:at=st.floatData;break;case _.onnx.TensorProto.DataType.INT32:case _.onnx.TensorProto.DataType.INT16:case _.onnx.TensorProto.DataType.UINT16:case _.onnx.TensorProto.DataType.INT8:case _.onnx.TensorProto.DataType.UINT8:case _.onnx.TensorProto.DataType.BOOL:at=st.int32Data;break;case _.onnx.TensorProto.DataType.INT64:at=st.int64Data;break;case _.onnx.TensorProto.DataType.DOUBLE:at=st.doubleData;break;case _.onnx.TensorProto.DataType.UINT32:case _.onnx.TensorProto.DataType.UINT64:at=st.uint64Data;break;default:throw new Error("unspecific error")}if(at==null)throw new Error("failed to populate data from a tensorproto value");const ut=it.data;if(ut.length!==at.length)throw new Error("array length mismatch");for(let lt=0;lt<at.length;lt++){const ct=at[lt];$.default.isLong(ct)?ut[lt]=d(ct,st.dataType):ut[lt]=ct}}return it}static fromData(st,tt,ot){return new b(tt,ot,void 0,void 0,st)}static fromOrtTensor(st){if(!st)throw new Error("cannot construct Value from an empty tensor");const tt=nt.ProtoUtil.tensorDimsFromORTFormat(st),ot=nt.ProtoUtil.tensorDataTypeFromProto(st.dataType()),it=new b(tt,ot);if(ot==="string")for(let at=0;at<st.stringDataLength();at++)it.data[at]=st.stringData(at);else if(st.rawDataArray()&&typeof st.rawDataLength()=="number"&&st.rawDataLength()>0){const at=it.data,ut=new DataView(st.rawDataArray().buffer,st.rawDataArray().byteOffset,st.rawDataLength()),lt=a(st.dataType()),ct=st.rawDataLength()/lt;if(st.rawDataLength()%lt!=0)throw new Error("invalid buffer length");if(at.length!==ct)throw new Error("buffer length mismatch");for(let ft=0;ft<ct;ft++){const dt=g(ut,st.dataType(),ft*lt);at[ft]=dt}}return it}}function a(rt){switch(rt){case _.onnx.TensorProto.DataType.UINT8:case _.onnx.TensorProto.DataType.INT8:case _.onnx.TensorProto.DataType.BOOL:return 1;case _.onnx.TensorProto.DataType.UINT16:case _.onnx.TensorProto.DataType.INT16:return 2;case _.onnx.TensorProto.DataType.FLOAT:case _.onnx.TensorProto.DataType.INT32:case _.onnx.TensorProto.DataType.UINT32:return 4;case _.onnx.TensorProto.DataType.INT64:case _.onnx.TensorProto.DataType.DOUBLE:case _.onnx.TensorProto.DataType.UINT64:return 8;default:throw new Error(`cannot calculate sizeof() on type ${_.onnx.TensorProto.DataType[rt]}`)}}function o(rt){switch(rt){case"bool":case"uint8":return Uint8Array;case"int8":return Int8Array;case"int16":return Int16Array;case"uint16":return Uint16Array;case"int32":return Int32Array;case"uint32":return Uint32Array;case"float32":return Float32Array;case"float64":return Float64Array;default:throw new Error("unspecified error")}}function d(rt,st){if(st===_.onnx.TensorProto.DataType.INT64||st===et.TensorDataType.INT64){if(rt.greaterThanOrEqual(2147483648)||rt.lessThan(-2147483648))throw new TypeError("int64 is not supported")}else{if(st!==_.onnx.TensorProto.DataType.UINT32&&st!==et.TensorDataType.UINT32&&st!==_.onnx.TensorProto.DataType.UINT64&&st!==et.TensorDataType.UINT64)throw new TypeError(`not a LONG type: ${_.onnx.TensorProto.DataType[st]}`);if(rt.greaterThanOrEqual(4294967296)||rt.lessThan(0))throw new TypeError("uint64 is not supported")}return rt.toNumber()}function g(rt,st,tt){switch(st){case _.onnx.TensorProto.DataType.BOOL:case _.onnx.TensorProto.DataType.UINT8:return rt.getUint8(tt);case _.onnx.TensorProto.DataType.INT8:return rt.getInt8(tt);case _.onnx.TensorProto.DataType.UINT16:return rt.getUint16(tt,!0);case _.onnx.TensorProto.DataType.INT16:return rt.getInt16(tt,!0);case _.onnx.TensorProto.DataType.FLOAT:return rt.getFloat32(tt,!0);case _.onnx.TensorProto.DataType.INT32:return rt.getInt32(tt,!0);case _.onnx.TensorProto.DataType.UINT32:return rt.getUint32(tt,!0);case _.onnx.TensorProto.DataType.INT64:return d($.default.fromBits(rt.getUint32(tt,!0),rt.getUint32(tt+4,!0),!1),st);case _.onnx.TensorProto.DataType.DOUBLE:return rt.getFloat64(tt,!0);case _.onnx.TensorProto.DataType.UINT64:return d($.default.fromBits(rt.getUint32(tt,!0),rt.getUint32(tt+4,!0),!0),st);default:throw new Error(`cannot read from DataView for type ${_.onnx.TensorProto.DataType[st]}`)}}e.Tensor=b},2517:function(i,e,s){var c=this&&this.__importDefault||function(st){return st&&st.__esModule?st:{default:st}};Object.defineProperty(e,"__esModule",{value:!0}),e.decodeUtf8String=e.MAX_CLIP=e.MIN_CLIP=e.PoolConvUtil=e.ReduceUtil=e.SplitUtil=e.MathUtil=e.ShapeUtil=e.LongUtil=e.ProtoUtil=e.GemmUtil=e.arrayCopyHelper=e.BroadcastUtil=e.MatMulUtil=e.ArrayUtil=e.assert=e.checkInputsShape=void 0;const h=s(5686),$=c(s(3720)),_=s(1446),j=s(9162);e.checkInputsShape=function(st,...tt){if(!st||st.length!==tt.length)return!1;for(let ot=0;ot<st.length;ot++)if(!st[ot].dims||st[ot].dims.length!==tt[ot])return!1;return!0},e.assert=function(st,tt){if(!st)throw new Error(typeof tt=="string"?tt:tt())},e.ArrayUtil=class{static arraysEqual(st,tt){if(st.length!==tt.length)return!1;for(let ot=0;ot<st.length;ot++)if(st[ot]!==tt[ot])return!1;return!0}};class nt{static preprocessInputShapes(tt,ot){return[tt.length===1?[1,tt[0]]:tt,ot.length===1?[ot[0],1]:ot]}static postprocessOutputShape(tt,ot,it){ot===1&&tt.splice(tt.length-2,1),it===1&&tt.pop()}static calcMatMulShape(tt,ot){return tt[1]!==ot[0]?void 0:[tt[0],ot[1]]}}e.MatMulUtil=nt;class et{static calcShape(tt,ot,it=!1){const at=tt.length,ut=ot.length;if(at===0)return ot;if(ut===0)return tt;const lt=Math.max(tt.length,ot.length),ct=new Array(lt);if(it){if(at<2||ut<2)return;const ft=nt.calcMatMulShape([tt[at-2],tt[at-1]],[ot[ut-2],ot[ut-1]]);if(ft===void 0)return;[ct[lt-2],ct[lt-1]]=ft}for(let ft=it?3:1;ft<=lt;ft++){const dt=at-ft<0?1:tt[at-ft],yt=ut-ft<0?1:ot[ut-ft];if(dt!==yt&&dt>1&&yt>1)return;ct[lt-ft]=Math.max(dt,yt)}return ct}static index(tt,ot){const it=new Array(ot.length);return et.fillIndex(tt,ot,it),it}static fillIndex(tt,ot,it){const at=tt.length-ot.length;for(let ut=0;ut<ot.length;ut++)it[ut]=tt[at+ut]%ot[ut]}static calc(tt,ot,it,at,ut){const lt=et.calcShape(tt.dims,ot.dims);if(lt){if(at&&!o.areEqual(lt,tt.dims))return;const ct=o.size(lt),ft=at?tt:new j.Tensor(lt,ut||tt.type);if(lt.length===0)ft.set([],it(tt.get([]),ot.get([])));else{const dt=new Array(lt.length),yt=new Array(tt.dims.length),St=new Array(ot.dims.length);let bt,Tt=0,vt=0,$t=!1,At=!1;tt.dims.length===0&&(Tt=tt.get([]),$t=!0),ot.dims.length===0&&(vt=ot.get([]),At=!0);for(let Ot=0;Ot<ct;Ot++){bt=Ot;for(let It=lt.length-1;It>=0;It--)dt[It]=bt%lt[It],bt=Math.floor(bt/lt[It]);$t||(et.fillIndex(dt,tt.dims,yt),Tt=tt.get(yt)),At||(et.fillIndex(dt,ot.dims,St),vt=ot.get(St)),ft.set(dt,it(Tt,vt))}}return ft}}static isValidBroadcast(tt,ot){const it=tt.length,at=ot.length;if(it>at)return!1;for(let ut=1;ut<=it;ut++)if(tt[it-ut]!==1&&tt[it-ut]!==ot[at-ut])return!1;return!0}static getBroadcastDims(tt,ot){const it=tt.length,at=[];for(let ut=0;ut<it;ut++){const lt=it-1-ut,ct=tt[lt]||1;(ot[ot.length-1-ut]||1)>1&&ct===1&&at.unshift(lt)}return at}}e.BroadcastUtil=et,e.arrayCopyHelper=function(st,tt,ot,it,at){if(it<0||it>=tt.length)throw new Error("sourceIndex out of bounds");if(ot<0||ot>=st.length)throw new Error("targetIndex out of bounds");if(it+at>tt.length)throw new Error("source indices to be copied are outside bounds");if(ot+at>st.length)throw new Error("target array is too small to hold result");for(let ut=0;ut<at;ut++)st[ot+ut]=tt[it+ut]},e.GemmUtil=class{static getShapeOfGemmResult(st,tt,ot,it,at){if(st.length!==2||ot.length!==2)throw new Error("shape need to be of size 2");let ut,lt,ct;tt?(ut=st[1],lt=st[0]):(ut=st[0],lt=st[1]);let ft=-1;if(it?(ct=ot[0],ft=1):(ct=ot[1],ft=0),ot[ft]!==lt)throw new Error("dimension mismatch");if(ut<=0||ct<=0||lt<=0)throw new Error("invalid shape specified");if(at&&!et.isValidBroadcast(at,[ut,ct]))throw new Error("gemm: invalid bias shape for broadcast");return[ut,ct,lt]}};class b{static tensorDataTypeFromProto(tt){switch(tt){case _.onnx.TensorProto.DataType.INT8:return"int8";case _.onnx.TensorProto.DataType.UINT8:return"uint8";case _.onnx.TensorProto.DataType.BOOL:return"bool";case _.onnx.TensorProto.DataType.INT16:return"int16";case _.onnx.TensorProto.DataType.UINT16:return"uint16";case _.onnx.TensorProto.DataType.INT32:return"int32";case _.onnx.TensorProto.DataType.UINT32:return"uint32";case _.onnx.TensorProto.DataType.FLOAT:return"float32";case _.onnx.TensorProto.DataType.DOUBLE:return"float64";case _.onnx.TensorProto.DataType.STRING:return"string";case _.onnx.TensorProto.DataType.INT64:return"int32";case _.onnx.TensorProto.DataType.UINT64:return"uint32";default:throw new Error(`unsupported data type: ${_.onnx.TensorProto.DataType[tt]}`)}}static tensorDataTypeStringToEnum(tt){switch(tt){case"int8":return _.onnx.TensorProto.DataType.INT8;case"uint8":return _.onnx.TensorProto.DataType.UINT8;case"bool":return _.onnx.TensorProto.DataType.BOOL;case"int16":return _.onnx.TensorProto.DataType.INT16;case"uint16":return _.onnx.TensorProto.DataType.UINT16;case"int32":return _.onnx.TensorProto.DataType.INT32;case"uint32":return _.onnx.TensorProto.DataType.UINT32;case"float32":return _.onnx.TensorProto.DataType.FLOAT;case"float64":return _.onnx.TensorProto.DataType.DOUBLE;case"string":return _.onnx.TensorProto.DataType.STRING;case"int64":return _.onnx.TensorProto.DataType.INT64;case"uint64":return _.onnx.TensorProto.DataType.UINT64;default:throw new Error(`unsupported data type: ${tt}`)}}static tensorDimsFromProto(tt){return tt.map(ot=>$.default.isLong(ot)?ot.toNumber():ot)}static tensorValueTypeFromProto(tt){return{tensorType:b.tensorDataTypeFromProto(tt.elemType),shape:{dims:b.tensorDimsFromProto(tt.shape.dim.map(ot=>ot.dimValue))}}}static tensorDimsFromORTFormat(tt){const ot=[];for(let it=0;it<tt.dimsLength();it++)ot.push(a.longToNumber(tt.dims(it)));return ot}static tensorAttributesFromORTFormat(tt){const ot=[];for(let it=0;it<tt.attributesLength();it++)ot.push(tt.attributes(it));return ot}}e.ProtoUtil=b;class a{static longToNumber(tt,ot){return $.default.isLong(tt)?tt.toNumber():tt instanceof h.flatbuffers.Long?$.default.fromValue({low:tt.low,high:tt.high,unsigned:ot!=null&&ot}).toNumber():tt}static isLong(tt){return $.default.isLong(tt)||tt instanceof h.flatbuffers.Long}}e.LongUtil=a;class o{static size(tt){return o.getSizeFromDimensionRange(tt,0,tt.length)}static sizeFromDimension(tt,ot){if(ot<0||ot>tt.length)throw new Error(`invalid dimension of ${ot} for sizeFromDimension as Tensor has ${tt.length} dimensions.`);return o.getSizeFromDimensionRange(tt,ot,tt.length)}static sizeToDimension(tt,ot){if(ot<0||ot>tt.length)throw new Error(`invalid dimension of ${ot} for sizeToDimension as Tensor has ${tt.length} dimensions.`);return o.getSizeFromDimensionRange(tt,0,ot)}static getSizeFromDimensionRange(tt,ot,it){let at=1;for(let ut=ot;ut<it;ut++){if(tt[ut]<=0)throw new Error("cannot get valid size from specified dimension range. Most likely the range contains 0 or negative values in them.");at*=tt[ut]}return at}static computeStrides(tt){const ot=tt.length;if(ot===0)return[];if(ot===1)return[1];const it=new Array(ot);it[ot-1]=1,it[ot-2]=tt[ot-1];for(let at=ot-3;at>=0;--at)it[at]=it[at+1]*tt[at+1];return it}static transpose(tt){return tt.slice().reverse()}static indicesToOffset(tt,ot,it){it===void 0&&(it=tt.length);let at=0;for(let ut=0;ut<it;++ut)at+=ot[ut]*tt[ut];return at}static offsetToIndices(tt,ot){const it=ot.length;if(it===0)return[];if(it===1)return[tt*ot[0]];const at=new Array(ot.length);for(let ut=0;ut<at.length-1;++ut)at[ut]=Math.floor(tt/ot[ut]),tt-=at[ut]*ot[ut];return at[at.length-1]=tt,at}static normalizeAxis(tt,ot){if(tt<-ot&&tt>=ot)throw new Error("unsupported axis for this operation.");return tt<0?tt+ot:tt}static normalizeAxes(tt,ot){return tt.map(it=>this.normalizeAxis(it,ot))}static incrementIndex(tt,ot,it){if(ot.length===0||tt.length===0)throw new Error("Index incrementing unsupported for scalar Tensor");if(it===void 0)it=ot.length;else if(it<=0||it>ot.length)throw new Error("Incorrect axis to increment on");for(let at=it-1;at>=0&&(tt[at]++,!(tt[at]<ot[at]));--at)tt[at]=0}static calculateReshapedDims(tt,ot){if(ot.length===0){if(tt.length===0||o.size(tt)===1)return[];throw new Error("cannot reshape to a scalar Tensor")}const it=ot.length,at=new Array(it);let ut=-1,lt=1;for(let ft=0;ft<it;ft++){if(ot[ft]<-1)throw new Error("a dimension in shape hints cannot be less than -1");if(ot[ft]===-1){if(ut!==-1)throw new Error("at most one dimension in shape hints can be -1");ut=ft}else{if(ot[ft]===0){if(ft>=tt.length)throw new Error("the dimension with value zero exceeds the dimension size of the input tensor");at[ft]=tt[ft]}else at[ft]=ot[ft];lt*=at[ft]}}const ct=o.size(tt);if(ut!==-1){if(ct%lt!=0)throw new Error(`the input tensor cannot be reshaped to the requested shape. Input shape: [${tt}] Output shape: [${ot}]`);at[ut]=ct/lt}else if(lt!==ct)throw new Error("reshapedDims and originalDims don't have matching sizes");return at}static sortBasedOnPerm(tt,ot){return ot?ot.map(it=>tt[it]):tt.slice().reverse()}static padShape(tt,ot){const it=tt.length;return tt.map((at,ut)=>at+ot[ut]+ot[ut+it])}static areEqual(tt,ot){return tt.length===ot.length&&tt.every((it,at)=>it===ot[at])}static validateDimsAndCalcSize(tt){if(tt.length>6)throw new TypeError("Only rank 0 to 6 is supported for tensor shape.");let ot=1;for(const it of tt){if(!Number.isInteger(it))throw new TypeError(`Invalid shape: ${it} is not an integer`);if(it<0||it>2147483647)throw new TypeError(`Invalid shape: length ${it} is not allowed`);ot*=it}return ot}static flattenShape(tt,ot){ot<0&&(ot+=tt.length);const it=tt.reduce((ut,lt)=>ut*lt,1),at=tt.slice(ot).reduce((ut,lt)=>ut*lt,1);return[it/at,at]}static squeezeShape(tt,ot){const it=new Array;ot=o.normalizeAxes(ot,tt.length);for(let at=0;at<tt.length;at++){const ut=ot.indexOf(at)>=0;if(ut&&tt[at]!==1)throw new Error("squeeze an axis of size different than 1");(ot.length===0&&tt[at]>1||ot.length>0&&!ut)&&it.push(tt[at])}return it}static unsqueezeShape(tt,ot){const it=new Array(tt.length+ot.length);it.fill(0);for(let ut=0;ut<ot.length;ut++){const lt=o.normalizeAxis(ot[ut],it.length);if(lt>=it.length)throw new Error("'axes' has an out of range axis");if(it[lt]!==0)throw new Error("'axes' has a duplicate axis");it[lt]=1}let at=0;for(let ut=0;ut<it.length;ut++)it[ut]===0&&(it[ut]=tt[at++]);if(at!==tt.length)throw new Error("the unsqueezed dimension could not be established");return it}}e.ShapeUtil=o,e.MathUtil=class{static sqr(st,tt,ot,it,at){if(it<0||it>=tt.length)throw new Error("sourceIndex out of bounds");if(ot<0||ot>=st.length)throw new Error("targetIndex out of bounds");if(it+at>tt.length)throw new Error("source indices to be copied are outside bounds");if(ot+at>st.length)throw new Error("target array is too small to hold result");for(let ut=0;ut<at;ut++)st[ot+ut]+=Math.pow(tt[it+ut],2)}static axpy(st,tt,ot,it,at,ut){if(it<0||it>=tt.length)throw new Error("sourceIndex out of bounds");if(ot<0||ot>=st.length)throw new Error("targetIndex out of bounds");if(it+at>tt.length)throw new Error("source indices to be copied are outside bounds");if(ot+at>st.length)throw new Error("target array is too small to hold result");for(let lt=0;lt<at;lt++)st[ot+lt]+=ut*tt[it+lt]}static powx(st,tt,ot,it,at,ut){if(it<0||it>=tt.length)throw new Error("sourceIndex out of bounds");if(ot<0||ot>=st.length)throw new Error("targetIndex out of bounds");if(it+at>tt.length)throw new Error("source indices to be copied are outside bounds");if(ot+at>st.length)throw new Error("target array is too small to hold result");for(let lt=0;lt<at;lt++)st[ot+lt]=Math.pow(tt[it+lt],ut)}static mul(st,tt,ot,it,at){if(it<0||it>=tt.length)throw new Error("sourceIndex out of bounds");if(ot<0||ot>=st.length)throw new Error("targetIndex out of bounds");if(it+at>tt.length)throw new Error("source indices to be copied are outside bounds");if(ot+at>st.length)throw new Error("target array is too small to hold result");for(let ut=0;ut<at;ut++)st[ot+ut]=tt[it+ut]*st[ot+ut]}};class d{static splitShape(tt,ot,it,at){if(it.length===0){if(!at)throw new Error("need to know number of outputs when the 'split' attribute is not specified");d.determineSplit(tt[ot],at,it)}const ut=[],lt=[0];for(let ct=0;ct<it.length;++ct){ct!==0&<.push(lt[ct-1]+it[ct-1]);const ft=tt.slice();ft[ot]=it[ct],ut.push(ft)}return[ut,lt]}static determineSplit(tt,ot,it){if(tt%ot!=0)throw new Error("cannot split tensor to equal sized parts");for(let at=0;at<ot;++at)it.push(tt/ot)}}e.SplitUtil=d;class g{static calcReduce(tt,ot,it,at,ut){const lt=tt.dims.slice(0);ot.length===0&<.forEach((Tt,vt)=>ot.push(vt));const ct=g.calcReduceShape(lt,ot,!0),ft=o.size(ct),dt=new j.Tensor(ct,tt.type),yt=o.computeStrides(ct),St=o.computeStrides(lt),bt=new Array(lt.length);for(let Tt=0;Tt<ft;Tt++){const vt=o.offsetToIndices(Tt,yt);et.fillIndex(vt,lt,bt),dt.set(vt,g.calcReduceByAxis(tt.numberData,ot,lt,0,o.indicesToOffset(bt,St),at,ut))}return it?dt:new j.Tensor(g.calcReduceShape(lt,ot,it),dt.type,void 0,void 0,dt.data,dt.dataId)}static calcReduceByAxis(tt,ot,it,at,ut,lt,ct){let ft=0;if(at>=ot.length)return lt(tt[ut]);const dt=ot[at],yt=dt>=it.length?1:o.size(it.slice(dt+1));for(let St=0;St<it[dt];St++)ft=St===0?g.calcReduceByAxis(tt,ot,it,at+1,ut,lt,ct):ct(ft,g.calcReduceByAxis(tt,ot,it,at+1,ut,lt,ct)),ut+=yt;return ft}static calcReduceShape(tt,ot,it){const at=tt.slice();for(let ut=0;ut<ot.length;ut++)at[ot[ut]]=it?1:0;return at.filter(ut=>ut!==0)}}e.ReduceUtil=g;class rt{static adjustPoolAttributes(tt,ot,it,at,ut,lt){if(!tt&&it.length!==ot.length-2)throw new Error("length of specified kernel shapes should be 2 less than length of input dimensions");if(tt)for(let ct=0;ct<ot.length-2;ct++)ct>=it.length?it.push(ot[ct+2]):it[ct]=ot[ct+2];for(let ct=0;ct<it.length;ct++)if(ct<at.length){if(at[ct]<0)throw new Error("strides should be greater than or equal to 1")}else at.push(1);for(let ct=0;ct<it.length;ct++)if(ct<ut.length){if(ut[ct]<0)throw new Error("dilations should be greater than or equal to 1")}else ut.push(1);for(let ct=0;ct<2*it.length;ct++)if(ct<lt.length){if(lt[ct]<0)throw new Error("pad should be greater than or equal to 1")}else lt.push(0);for(let ct=0;ct<it.length;ct++){if(it[ct]<=0)throw new Error("kernel shapes need to be greater than 0");if(lt[ct]>=it[ct]||lt[ct+it.length]>=it[ct])throw new Error("pads should be smaller than kernel")}}static adjustPadsBasedOnAutoPad(tt,ot,it,at,ut,lt){if(lt){if(ut.length!==2*(tt.length-2))throw new Error("length of pads should be twice the length of data dimensions");if(ot.length!==tt.length-2)throw new Error("length of strides should be the length of data dimensions");if(at.length!==tt.length-2)throw new Error("length of kernel shapes should be the length of data dimensions");for(let ct=0;ct<tt.length-2;ct++)rt.adjustPadAndReturnShape(tt[ct+2],ot[ct],it[ct],at[ct],ut,ct,ct+tt.length-2,lt)}}static computePoolOutputShape(tt,ot,it,at,ut,lt,ct){if(ot.length<=0)throw new Error("input shape must be of size greater than 0");const ft=[ot[0],ot[1]];return rt.computeShapeHelper(tt,ot,ft,it,at,ut,lt,ct),ft}static computeConvOutputShape(tt,ot,it,at,ut,lt,ct){if(tt.length<=0||ot.length<=0)throw new Error("invalid input tensor dims or invalid filter tensor dims");const ft=[tt[0],ot[0]];return rt.computeShapeHelper(!1,tt,ft,it,at,ut,lt,ct),ft}static computeShapeHelper(tt,ot,it,at,ut,lt,ct,ft){if(tt)for(let dt=0;dt<ot.length-2;dt++)it.push(1);else for(let dt=0;dt<ot.length-2;dt++)it.push(rt.adjustPadAndReturnShape(ot[dt+2],at[dt],ut[dt],lt[dt],ct,dt,dt+ot.length-2,ft))}static adjustPadAndReturnShape(tt,ot,it,at,ut,lt,ct,ft){const dt=it*(at-1)+1;if(!ft||ft==="NOTSET")return Math.floor((tt+ut[lt]+ut[ct]-dt)/ot+1);switch(ft){case"VALID":return ut[lt]=0,ut[ct]=0,Math.floor((tt-dt)/ot+1);case"SAME_LOWER":case"SAME_UPPER":if(it!==1)throw new Error("Dilation not supported for SAME_UPPER or SAME_LOWER");{const yt=((tt+ot-1)/ot-1)*ot+at-tt;return ut[lt]=Math.floor(ft==="SAME_LOWER"?(yt+1)/2:yt/2),ut[ct]=yt-ut[lt],Math.floor((tt+yt-at)/ot+1)}default:throw new Error("Unsupported AutoPad type")}}}e.PoolConvUtil=rt,e.MIN_CLIP=-34028234663852886e22,e.MAX_CLIP=34028234663852886e22,e.decodeUtf8String=function(st){return new TextDecoder().decode(st)}},7967:(i,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.iterateExtraOptions=void 0,e.iterateExtraOptions=(s,c,h,$)=>{if(typeof s=="object"&&s!==null){if(h.has(s))throw new Error("Circular reference in options");h.add(s)}Object.entries(s).forEach(([_,j])=>{const nt=c?c+_:_;if(typeof j=="object")(0,e.iterateExtraOptions)(j,nt+".",h,$);else if(typeof j=="string"||typeof j=="number")$(nt,j.toString());else{if(typeof j!="boolean")throw new Error("Can't handle extra config type: "+typeof j);$(nt,j?"1":"0")}})}},2157:function(i,e,s){var c,h=this&&this.__createBinding||(Object.create?function(yt,St,bt,Tt){Tt===void 0&&(Tt=bt);var vt=Object.getOwnPropertyDescriptor(St,bt);vt&&!("get"in vt?!St.__esModule:vt.writable||vt.configurable)||(vt={enumerable:!0,get:function(){return St[bt]}}),Object.defineProperty(yt,Tt,vt)}:function(yt,St,bt,Tt){Tt===void 0&&(Tt=bt),yt[Tt]=St[bt]}),$=this&&this.__setModuleDefault||(Object.create?function(yt,St){Object.defineProperty(yt,"default",{enumerable:!0,value:St})}:function(yt,St){yt.default=St}),_=this&&this.__importStar||function(yt){if(yt&&yt.__esModule)return yt;var St={};if(yt!=null)for(var bt in yt)bt!=="default"&&Object.prototype.hasOwnProperty.call(yt,bt)&&h(St,yt,bt);return $(St,yt),St};Object.defineProperty(e,"__esModule",{value:!0}),e.endProfiling=e.run=e.releaseSession=e.createSession=e.createSessionFinalize=e.createSessionAllocate=e.initOrt=e.initWasm=void 0;const j=s(1670),nt=_(s(349)),et=s(6361),b=()=>!!j.env.wasm.proxy&&typeof document<"u";let a,o,d,g=!1,rt=!1,st=!1;const tt=[],ot=[],it=[],at=[],ut=[],lt=[],ct=()=>{if(g||!rt||st||!a)throw new Error("worker not ready")},ft=yt=>{switch(yt.data.type){case"init-wasm":g=!1,yt.data.err?(st=!0,o[1](yt.data.err)):(rt=!0,o[0]());break;case"init-ort":yt.data.err?d[1](yt.data.err):d[0]();break;case"create_allocate":yt.data.err?tt.shift()[1](yt.data.err):tt.shift()[0](yt.data.out);break;case"create_finalize":yt.data.err?ot.shift()[1](yt.data.err):ot.shift()[0](yt.data.out);break;case"create":yt.data.err?it.shift()[1](yt.data.err):it.shift()[0](yt.data.out);break;case"release":yt.data.err?at.shift()[1](yt.data.err):at.shift()[0]();break;case"run":yt.data.err?ut.shift()[1](yt.data.err):ut.shift()[0](yt.data.out);break;case"end-profiling":yt.data.err?lt.shift()[1](yt.data.err):lt.shift()[0]()}},dt=typeof document<"u"?(c=document==null?void 0:document.currentScript)===null||c===void 0?void 0:c.src:void 0;e.initWasm=async()=>{if(b()){if(rt)return;if(g)throw new Error("multiple calls to 'initWasm()' detected.");if(st)throw new Error("previous call to 'initWasm()' failed.");return g=!0,j.env.wasm.wasmPaths===void 0&&dt&&dt.indexOf("blob:")!==0&&(j.env.wasm.wasmPaths=dt.substr(0,+dt.lastIndexOf("/")+1)),new Promise((yt,St)=>{a==null||a.terminate(),a=s(9710).Z(),a.onmessage=ft,o=[yt,St];const bt={type:"init-wasm",in:j.env.wasm};a.postMessage(bt)})}return(0,et.initializeWebAssembly)(j.env.wasm)},e.initOrt=async(yt,St)=>{if(b())return ct(),new Promise((bt,Tt)=>{d=[bt,Tt];const vt={type:"init-ort",in:{numThreads:yt,loggingLevel:St}};a.postMessage(vt)});nt.initOrt(yt,St)},e.createSessionAllocate=async yt=>b()?(ct(),new Promise((St,bt)=>{tt.push([St,bt]);const Tt={type:"create_allocate",in:{model:yt}};a.postMessage(Tt,[yt.buffer])})):nt.createSessionAllocate(yt),e.createSessionFinalize=async(yt,St)=>b()?(ct(),new Promise((bt,Tt)=>{ot.push([bt,Tt]);const vt={type:"create_finalize",in:{modeldata:yt,options:St}};a.postMessage(vt)})):nt.createSessionFinalize(yt,St),e.createSession=async(yt,St)=>b()?(ct(),new Promise((bt,Tt)=>{it.push([bt,Tt]);const vt={type:"create",in:{model:yt,options:St}};a.postMessage(vt,[yt.buffer])})):nt.createSession(yt,St),e.releaseSession=async yt=>{if(b())return ct(),new Promise((St,bt)=>{at.push([St,bt]);const Tt={type:"release",in:yt};a.postMessage(Tt)});nt.releaseSession(yt)},e.run=async(yt,St,bt,Tt,vt)=>b()?(ct(),new Promise(($t,At)=>{ut.push([$t,At]);const Ot={type:"run",in:{sessionId:yt,inputIndices:St,inputs:bt,outputIndices:Tt,options:vt}};a.postMessage(Ot,nt.extractTransferableBuffers(bt))})):nt.run(yt,St,bt,Tt,vt),e.endProfiling=async yt=>{if(b())return ct(),new Promise((St,bt)=>{lt.push([St,bt]);const Tt={type:"end-profiling",in:yt};a.postMessage(Tt)});nt.endProfiling(yt)}},586:(i,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.setRunOptions=void 0;const c=s(7967),h=s(4983),$=s(6361);e.setRunOptions=_=>{const j=(0,$.getInstance)();let nt=0;const et=[],b=_||{};try{if((_==null?void 0:_.logSeverityLevel)===void 0)b.logSeverityLevel=2;else if(typeof _.logSeverityLevel!="number"||!Number.isInteger(_.logSeverityLevel)||_.logSeverityLevel<0||_.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${_.logSeverityLevel}`);if((_==null?void 0:_.logVerbosityLevel)===void 0)b.logVerbosityLevel=0;else if(typeof _.logVerbosityLevel!="number"||!Number.isInteger(_.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${_.logVerbosityLevel}`);(_==null?void 0:_.terminate)===void 0&&(b.terminate=!1);let a=0;if((_==null?void 0:_.tag)!==void 0&&(a=(0,h.allocWasmString)(_.tag,et)),nt=j._OrtCreateRunOptions(b.logSeverityLevel,b.logVerbosityLevel,!!b.terminate,a),nt===0)throw new Error("Can't create run options");return(_==null?void 0:_.extra)!==void 0&&(0,c.iterateExtraOptions)(_.extra,"",new WeakSet,(o,d)=>{const g=(0,h.allocWasmString)(o,et),rt=(0,h.allocWasmString)(d,et);if(j._OrtAddRunConfigEntry(nt,g,rt)!==0)throw new Error(`Can't set a run config entry: ${o} - ${d}`)}),[nt,et]}catch(a){throw nt!==0&&j._OrtReleaseRunOptions(nt),et.forEach(j._free),a}}},2306:(i,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.OnnxruntimeWebAssemblySessionHandler=void 0;const c=s(2806),h=s(1670),$=s(2850),_=s(2157);let j;e.OnnxruntimeWebAssemblySessionHandler=class{async createSessionAllocate(nt){const et=await fetch(nt),b=await et.arrayBuffer();return(0,_.createSessionAllocate)(new Uint8Array(b))}async loadModel(nt,et){if(j||(await(0,_.initOrt)(h.env.wasm.numThreads,(b=>{switch(b){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: ${b}`)}})(h.env.logLevel)),j=!0),typeof nt=="string")if(typeof fetch>"u"){const b=await(0,$.promisify)(c.readFile)(nt);[this.sessionId,this.inputNames,this.outputNames]=await(0,_.createSession)(b,et)}else{const b=await this.createSessionAllocate(nt);[this.sessionId,this.inputNames,this.outputNames]=await(0,_.createSessionFinalize)(b,et)}else[this.sessionId,this.inputNames,this.outputNames]=await(0,_.createSession)(nt,et)}async dispose(){return(0,_.releaseSession)(this.sessionId)}async run(nt,et,b){const a=[],o=[];Object.entries(nt).forEach(st=>{const tt=st[0],ot=st[1],it=this.inputNames.indexOf(tt);if(it===-1)throw new Error(`invalid input '${tt}'`);a.push(ot),o.push(it)});const d=[];Object.entries(et).forEach(st=>{const tt=st[0],ot=this.outputNames.indexOf(tt);if(ot===-1)throw new Error(`invalid output '${tt}'`);d.push(ot)});const g=await(0,_.run)(this.sessionId,o,a.map(st=>[st.type,st.dims,st.data]),d,b),rt={};for(let st=0;st<g.length;st++)rt[this.outputNames[d[st]]]=new h.Tensor(g[st][0],g[st][2],g[st][1]);return rt}startProfiling(){}endProfiling(){(0,_.endProfiling)(this.sessionId)}}},4919:(i,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.setSessionOptions=void 0;const c=s(7967),h=s(4983),$=s(6361);e.setSessionOptions=_=>{const j=(0,$.getInstance)();let nt=0;const et=[],b=_||{};(a=>{a.extra||(a.extra={}),a.extra.session||(a.extra.session={});const o=a.extra.session;o.use_ort_model_bytes_directly||(o.use_ort_model_bytes_directly="1")})(b);try{(_==null?void 0:_.graphOptimizationLevel)===void 0&&(b.graphOptimizationLevel="all");const a=(g=>{switch(g){case"disabled":return 0;case"basic":return 1;case"extended":return 2;case"all":return 99;default:throw new Error(`unsupported graph optimization level: ${g}`)}})(b.graphOptimizationLevel);(_==null?void 0:_.enableCpuMemArena)===void 0&&(b.enableCpuMemArena=!0),(_==null?void 0:_.enableMemPattern)===void 0&&(b.enableMemPattern=!0),(_==null?void 0:_.executionMode)===void 0&&(b.executionMode="sequential");const o=(g=>{switch(g){case"sequential":return 0;case"parallel":return 1;default:throw new Error(`unsupported execution mode: ${g}`)}})(b.executionMode);let d=0;if((_==null?void 0:_.logId)!==void 0&&(d=(0,h.allocWasmString)(_.logId,et)),(_==null?void 0:_.logSeverityLevel)===void 0)b.logSeverityLevel=2;else if(typeof _.logSeverityLevel!="number"||!Number.isInteger(_.logSeverityLevel)||_.logSeverityLevel<0||_.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${_.logSeverityLevel}`);if((_==null?void 0:_.logVerbosityLevel)===void 0)b.logVerbosityLevel=0;else if(typeof _.logVerbosityLevel!="number"||!Number.isInteger(_.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${_.logVerbosityLevel}`);if((_==null?void 0:_.enableProfiling)===void 0&&(b.enableProfiling=!1),nt=j._OrtCreateSessionOptions(a,!!b.enableCpuMemArena,!!b.enableMemPattern,o,!!b.enableProfiling,0,d,b.logSeverityLevel,b.logVerbosityLevel),nt===0)throw new Error("Can't create session options");return _!=null&&_.executionProviders&&((g,rt,st)=>{for(const tt of rt){let ot=typeof tt=="string"?tt:tt.name;switch(ot){case"xnnpack":ot="XNNPACK";break;case"wasm":case"cpu":continue;default:throw new Error(`not supported EP: ${ot}`)}const it=(0,h.allocWasmString)(ot,st);if((0,$.getInstance)()._OrtAppendExecutionProvider(g,it)!==0)throw new Error(`Can't append execution provider: ${ot}`)}})(nt,_.executionProviders,et),(_==null?void 0:_.extra)!==void 0&&(0,c.iterateExtraOptions)(_.extra,"",new WeakSet,(g,rt)=>{const st=(0,h.allocWasmString)(g,et),tt=(0,h.allocWasmString)(rt,et);if(j._OrtAddSessionConfigEntry(nt,st,tt)!==0)throw new Error(`Can't set a session config entry: ${g} - ${rt}`)}),[nt,et]}catch(a){throw nt!==0&&j._OrtReleaseSessionOptions(nt),et.forEach(j._free),a}}},4983:(i,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.allocWasmString=void 0;const c=s(6361);e.allocWasmString=(h,$)=>{const _=(0,c.getInstance)(),j=_.lengthBytesUTF8(h)+1,nt=_._malloc(j);return _.stringToUTF8(h,nt,j),$.push(nt),nt}},349:(i,e,s)=>{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 c=s(586),h=s(4919),$=s(4983),_=s(6361);e.initOrt=(a,o)=>{const d=(0,_.getInstance)()._OrtInit(a,o);if(d!==0)throw new Error(`Can't initialize onnxruntime. error code = ${d}`)};const j=new Map;e.createSessionAllocate=a=>{const o=(0,_.getInstance)(),d=o._malloc(a.byteLength);return o.HEAPU8.set(a,d),[d,a.byteLength]},e.createSessionFinalize=(a,o)=>{const d=(0,_.getInstance)();let g=0,rt=0,st=[];try{if([rt,st]=(0,h.setSessionOptions)(o),g=d._OrtCreateSession(a[0],a[1],rt),g===0)throw new Error("Can't create a session")}finally{d._free(a[0]),d._OrtReleaseSessionOptions(rt),st.forEach(d._free)}const tt=d._OrtGetInputCount(g),ot=d._OrtGetOutputCount(g),it=[],at=[],ut=[],lt=[];for(let ct=0;ct<tt;ct++){const ft=d._OrtGetInputName(g,ct);if(ft===0)throw new Error("Can't get an input name");at.push(ft),it.push(d.UTF8ToString(ft))}for(let ct=0;ct<ot;ct++){const ft=d._OrtGetOutputName(g,ct);if(ft===0)throw new Error("Can't get an output name");lt.push(ft),ut.push(d.UTF8ToString(ft))}return j.set(g,[g,at,lt]),[g,it,ut]},e.createSession=(a,o)=>{const d=(0,e.createSessionAllocate)(a);return(0,e.createSessionFinalize)(d,o)},e.releaseSession=a=>{const o=(0,_.getInstance)(),d=j.get(a);if(!d)throw new Error("invalid session id");const g=d[0],rt=d[1],st=d[2];rt.forEach(o._OrtFree),st.forEach(o._OrtFree),o._OrtReleaseSession(g),j.delete(a)};const nt=a=>{switch(a){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: ${a}`)}},et=a=>{switch(a){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: ${a}`)}},b=a=>{switch(a){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: ${a}`)}};e.run=(a,o,d,g,rt)=>{const st=(0,_.getInstance)(),tt=j.get(a);if(!tt)throw new Error("invalid session id");const ot=tt[0],it=tt[1],at=tt[2],ut=o.length,lt=g.length;let ct=0,ft=[];const dt=[],yt=[];try{[ct,ft]=(0,c.setRunOptions)(rt);for(let At=0;At<ut;At++){const Ot=d[At][0],It=d[At][1],jt=d[At][2];let Et,mt;if(Array.isArray(jt)){mt=4*jt.length,Et=st._malloc(mt),yt.push(Et);let pt=Et/4;for(let _t=0;_t<jt.length;_t++){if(typeof jt[_t]!="string")throw new TypeError(`tensor data at index ${_t} is not a string`);st.HEAPU32[pt++]=(0,$.allocWasmString)(jt[_t],yt)}}else mt=jt.byteLength,Et=st._malloc(mt),yt.push(Et),st.HEAPU8.set(new Uint8Array(jt.buffer,jt.byteOffset,mt),Et);const gt=st.stackSave(),ht=st.stackAlloc(4*It.length);try{let pt=ht/4;It.forEach(Ct=>st.HEAP32[pt++]=Ct);const _t=st._OrtCreateTensor(nt(Ot),Et,mt,ht,It.length);if(_t===0)throw new Error("Can't create a tensor");dt.push(_t)}finally{st.stackRestore(gt)}}const St=st.stackSave(),bt=st.stackAlloc(4*ut),Tt=st.stackAlloc(4*ut),vt=st.stackAlloc(4*lt),$t=st.stackAlloc(4*lt);try{let At=bt/4,Ot=Tt/4,It=vt/4,jt=$t/4;for(let gt=0;gt<ut;gt++)st.HEAPU32[At++]=dt[gt],st.HEAPU32[Ot++]=it[o[gt]];for(let gt=0;gt<lt;gt++)st.HEAPU32[It++]=0,st.HEAPU32[jt++]=at[g[gt]];let Et=st._OrtRun(ot,Tt,bt,ut,$t,lt,vt,ct);const mt=[];if(Et===0)for(let gt=0;gt<lt;gt++){const ht=st.HEAPU32[vt/4+gt],pt=st.stackSave(),_t=st.stackAlloc(16);let Ct,zt=0;try{if(Et=st._OrtGetTensorData(ht,_t,_t+4,_t+8,_t+12),Et!==0)throw new Error(`Can't access output tensor data. error code = ${Et}`);let Nt=_t/4;const Ht=st.HEAPU32[Nt++];zt=st.HEAPU32[Nt++];const Jt=st.HEAPU32[Nt++],un=st.HEAPU32[Nt++],yn=[];for(let mn=0;mn<un;mn++)yn.push(st.HEAPU32[Jt/4+mn]);st._OrtFree(Jt);const vn=yn.length===0?1:yn.reduce((mn,Tn)=>mn*Tn);if(Ct=et(Ht),Ct==="string"){const mn=[];let Tn=zt/4;for(let kn=0;kn<vn;kn++){const Gn=st.HEAPU32[Tn++],wr=kn===vn-1?void 0:st.HEAPU32[Tn]-Gn;mn.push(st.UTF8ToString(Gn,wr))}mt.push([Ct,yn,mn])}else{const mn=new(b(Ct))(vn);new Uint8Array(mn.buffer,mn.byteOffset,mn.byteLength).set(st.HEAPU8.subarray(zt,zt+mn.byteLength)),mt.push([Ct,yn,mn])}}finally{st.stackRestore(pt),Ct==="string"&&zt&&st._free(zt),st._OrtReleaseTensor(ht)}}if(Et===0)return mt;throw new Error(`failed to call OrtRun(). error code = ${Et}.`)}finally{st.stackRestore(St)}}finally{dt.forEach(st._OrtReleaseTensor),yt.forEach(st._free),st._OrtReleaseRunOptions(ct),ft.forEach(st._free)}},e.endProfiling=a=>{const o=(0,_.getInstance)(),d=j.get(a);if(!d)throw new Error("invalid session id");const g=d[0],rt=o._OrtEndProfiling(g);if(rt===0)throw new Error("Can't get an profile file name");o._OrtFree(rt)},e.extractTransferableBuffers=a=>{const o=[];for(const d of a){const g=d[2];!Array.isArray(g)&&g.buffer&&o.push(g.buffer)}return o}},6361:function(i,e,s){var c=this&&this.__createBinding||(Object.create?function(rt,st,tt,ot){ot===void 0&&(ot=tt);var it=Object.getOwnPropertyDescriptor(st,tt);it&&!("get"in it?!st.__esModule:it.writable||it.configurable)||(it={enumerable:!0,get:function(){return st[tt]}}),Object.defineProperty(rt,ot,it)}:function(rt,st,tt,ot){ot===void 0&&(ot=tt),rt[ot]=st[tt]}),h=this&&this.__setModuleDefault||(Object.create?function(rt,st){Object.defineProperty(rt,"default",{enumerable:!0,value:st})}:function(rt,st){rt.default=st}),$=this&&this.__importStar||function(rt){if(rt&&rt.__esModule)return rt;var st={};if(rt!=null)for(var tt in rt)tt!=="default"&&Object.prototype.hasOwnProperty.call(rt,tt)&&c(st,rt,tt);return h(st,rt),st},_=this&&this.__importDefault||function(rt){return rt&&rt.__esModule?rt:{default:rt}};Object.defineProperty(e,"__esModule",{value:!0}),e.dispose=e.getInstance=e.initializeWebAssembly=void 0;const j=$(s(6449)),nt=_(s(932)),et=s(3474);let b,a=!1,o=!1,d=!1;const g=(rt,st)=>st?rt?"ort-wasm-simd-threaded.wasm":"ort-wasm-threaded.wasm":rt?"ort-wasm-simd.wasm":"ort-wasm.wasm";e.initializeWebAssembly=async rt=>{if(a)return Promise.resolve();if(o)throw new Error("multiple calls to 'initializeWebAssembly()' detected.");if(d)throw new Error("previous call to 'initializeWebAssembly()' failed.");o=!0;const st=rt.initTimeout,tt=rt.numThreads,ot=rt.simd,it=tt>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}})(),at=ot&&(()=>{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}})(),ut=typeof rt.wasmPaths=="string"?rt.wasmPaths:void 0,lt=g(!1,it),ct=g(at,it),ft=typeof rt.wasmPaths=="object"?rt.wasmPaths[ct]:void 0;let dt=!1;const yt=[];if(st>0&&yt.push(new Promise(St=>{setTimeout(()=>{dt=!0,St()},st)})),yt.push(new Promise((St,bt)=>{const Tt=it?et:nt.default,vt={locateFile:($t,At)=>it&&$t.endsWith(".worker.js")&&typeof Blob<"u"?URL.createObjectURL(new Blob([s(4154)],{type:"text/javascript"})):$t===lt?ft??(ut??At)+ct:At+$t};if(it)if(typeof Blob>"u")vt.mainScriptUrlOrBlob=j.join("/","ort-wasm-threaded.js");else{const $t=`var ortWasmThreaded=(function(){var _scriptDir;return ${Tt.toString()}})();`;vt.mainScriptUrlOrBlob=new Blob([$t],{type:"text/javascript"})}Tt(vt).then($t=>{o=!1,a=!0,b=$t,St()},$t=>{o=!1,d=!0,bt($t)})})),await Promise.race(yt),dt)throw new Error(`WebAssembly backend initializing failed due to timeout: ${st}ms`)},e.getInstance=()=>{if(a&&b)return b;throw new Error("WebAssembly is not initialized yet.")},e.dispose=()=>{var rt;!a||o||d||(o=!0,(rt=b.PThread)===null||rt===void 0||rt.terminateAllThreads(),b=void 0,o=!1,a=!1,d=!0)}},9710:(i,e,s)=>{s.d(e,{Z:()=>$});var c=s(477),h=s.n(c);function $(){return h()('/*!\n* ONNX Runtime Web v1.14.0\n* Copyright (c) Microsoft Corporation. All rights reserved.\n* Licensed under the MIT License.\n*/\n(()=>{var t={474:(t,e,n)=>{var _scriptDir,r=(_scriptDir=(_scriptDir="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(t){function e(){return j.buffer!=D&&N(j.buffer),P}function r(){return j.buffer!=D&&N(j.buffer),U}function a(){return j.buffer!=D&&N(j.buffer),F}function i(){return j.buffer!=D&&N(j.buffer),I}function o(){return j.buffer!=D&&N(j.buffer),W}var u,c,s;t=t||{},u||(u=void 0!==t?t:{}),u.ready=new Promise((function(t,e){c=t,s=e}));var l,f,p,h,d,y,b=Object.assign({},u),m="./this.program",g=(t,e)=>{throw e},v="object"==typeof window,w="function"==typeof importScripts,_="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,O=u.ENVIRONMENT_IS_PTHREAD||!1,A="";function S(t){return u.locateFile?u.locateFile(t,A):A+t}if(_){let e;A=w?n(908).dirname(A)+"/":"//",y=()=>{d||(h=n(384),d=n(908))},l=function(t,e){return y(),t=d.normalize(t),h.readFileSync(t,e?void 0:"utf8")},p=t=>((t=l(t,!0)).buffer||(t=new Uint8Array(t)),t),f=(t,e,n)=>{y(),t=d.normalize(t),h.readFile(t,(function(t,r){t?n(t):e(r.buffer)}))},1<process.argv.length&&(m=process.argv[1].replace(/\\\\/g,"/")),process.argv.slice(2),process.on("uncaughtException",(function(t){if(!(t instanceof ct))throw t})),process.on("unhandledRejection",(function(t){throw t})),g=(t,e)=>{if(Q())throw process.exitCode=t,e;e instanceof ct||x("exiting due to exception: "+e),process.exit(t)},u.inspect=function(){return"[Emscripten Module object]"};try{e=n(925)}catch(t){throw console.error(\'The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?\'),t}n.g.Worker=e.Worker}else(v||w)&&(w?A=self.location.href:"undefined"!=typeof document&&document.currentScript&&(A=document.currentScript.src),_scriptDir&&(A=_scriptDir),A=0!==A.indexOf("blob:")?A.substr(0,A.replace(/[?#].*/,"").lastIndexOf("/")+1):"",_||(l=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},w&&(p=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),f=(t,e,n)=>{var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?e(r.response):n()},r.onerror=n,r.send(null)}));_&&"undefined"==typeof performance&&(n.g.performance=n(953).performance);var T=console.log.bind(console),E=console.warn.bind(console);_&&(y(),T=t=>h.writeSync(1,t+"\\n"),E=t=>h.writeSync(2,t+"\\n"));var M,C=u.print||T,x=u.printErr||E;Object.assign(u,b),b=null,u.thisProgram&&(m=u.thisProgram),u.quit&&(g=u.quit),u.wasmBinary&&(M=u.wasmBinary);var R=u.noExitRuntime||!1;"object"!=typeof WebAssembly&&at("no native wasm support detected");var j,k,D,P,U,F,I,W,H=!1,L="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function z(t,e,n){var r=(e>>>=0)+n;for(n=e;t[n]&&!(n>=r);)++n;if(16<n-e&&t.buffer&&L)return L.decode(t.buffer instanceof SharedArrayBuffer?t.slice(e,n):t.subarray(e,n));for(r="";e<n;){var a=t[e++];if(128&a){var i=63&t[e++];if(192==(224&a))r+=String.fromCharCode((31&a)<<6|i);else{var o=63&t[e++];65536>(a=224==(240&a)?(15&a)<<12|i<<6|o:(7&a)<<18|i<<12|o<<6|63&t[e++])?r+=String.fromCharCode(a):(a-=65536,r+=String.fromCharCode(55296|a>>10,56320|1023&a))}}else r+=String.fromCharCode(a)}return r}function Y(t,e){return(t>>>=0)?z(r(),t,e):""}function B(t,e,n,r){if(!(0<r))return 0;var a=n>>>=0;r=n+r-1;for(var i=0;i<t.length;++i){var o=t.charCodeAt(i);if(55296<=o&&57343>=o&&(o=65536+((1023&o)<<10)|1023&t.charCodeAt(++i)),127>=o){if(n>=r)break;e[n++>>>0]=o}else{if(2047>=o){if(n+1>=r)break;e[n++>>>0]=192|o>>6}else{if(65535>=o){if(n+2>=r)break;e[n++>>>0]=224|o>>12}else{if(n+3>=r)break;e[n++>>>0]=240|o>>18,e[n++>>>0]=128|o>>12&63}e[n++>>>0]=128|o>>6&63}e[n++>>>0]=128|63&o}}return e[n>>>0]=0,n-a}function G(t){for(var e=0,n=0;n<t.length;++n){var r=t.charCodeAt(n);127>=r?e++:2047>=r?e+=2:55296<=r&&57343>=r?(e+=4,++n):e+=3}return e}function N(t){D=t,u.HEAP8=P=new Int8Array(t),u.HEAP16=new Int16Array(t),u.HEAP32=F=new Int32Array(t),u.HEAPU8=U=new Uint8Array(t),u.HEAPU16=new Uint16Array(t),u.HEAPU32=I=new Uint32Array(t),u.HEAPF32=new Float32Array(t),u.HEAPF64=W=new Float64Array(t)}O&&(D=u.buffer);var V=u.INITIAL_MEMORY||16777216;if(O)j=u.wasmMemory,D=u.buffer;else if(u.wasmMemory)j=u.wasmMemory;else if(!((j=new WebAssembly.Memory({initial:V/65536,maximum:65536,shared:!0})).buffer instanceof SharedArrayBuffer))throw x("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag"),_&&console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)"),Error("bad memory");j&&(D=j.buffer),V=D.byteLength,N(D);var $,q=[],X=[],J=[],Z=[];function Q(){return R||!1}function K(){var t=u.preRun.shift();q.unshift(t)}var tt,et=0,nt=null,rt=null;function at(t){throw O?postMessage({cmd:"onAbort",arg:t}):u.onAbort&&u.onAbort(t),x(t="Aborted("+t+")"),H=!0,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),s(t),t}function it(){return tt.startsWith("data:application/octet-stream;base64,")}function ot(){var t=tt;try{if(t==tt&&M)return new Uint8Array(M);if(p)return p(t);throw"both async and sync fetching of the wasm failed"}catch(t){at(t)}}tt="ort-wasm-threaded.wasm",it()||(tt=S(tt));var ut={};function ct(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function st(t){(t=ht.Vb[t])||at(),ht.mc(t)}function lt(t){var e=ht.Cc();if(!e)return 6;ht.ac.push(e),ht.Vb[t.Ub]=e,e.Ub=t.Ub;var n={cmd:"run",start_routine:t.Ic,arg:t.zc,pthread_ptr:t.Ub};return e.$b=()=>{n.time=performance.now(),e.postMessage(n,t.Nc)},e.loaded&&(e.$b(),delete e.$b),0}function ft(t){if(O)return $t(1,1,t);Q()||(ht.oc(),u.onExit&&u.onExit(t),H=!0),g(t,new ct(t))}function pt(t,e){if(!e&&O)throw bt(t),"unwind";Q()||O||(me(),dt(J),be(0),re[1].length&&ae(1,10),re[2].length&&ae(2,10),ht.oc()),ft(t)}var ht={Yb:[],ac:[],qc:[],Vb:{},fc:function(){O&&ht.Ec()},Pc:function(){},Ec:function(){ht.receiveObjectTransfer=ht.Gc,ht.threadInitTLS=ht.pc,ht.setExitStatus=ht.nc,R=!1},nc:function(){},oc:function(){for(var t of Object.values(ht.Vb))ht.mc(t);for(t of ht.Yb)t.terminate();ht.Yb=[]},mc:function(t){var e=t.Ub;delete ht.Vb[e],ht.Yb.push(t),ht.ac.splice(ht.ac.indexOf(t),1),t.Ub=0,Oe(e)},Gc:function(){},pc:function(){ht.qc.forEach((t=>t()))},Fc:function(t,e){t.onmessage=n=>{var r=(n=n.data).cmd;if(t.Ub&&(ht.Bc=t.Ub),n.targetThread&&n.targetThread!=he()){var a=ht.Vb[n.Qc];a?a.postMessage(n,n.transferList):x(\'Internal error! Worker sent a message "\'+r+\'" to target pthread \'+n.targetThread+", but that thread no longer exists!")}else"processProxyingQueue"===r?zt(n.queue):"spawnThread"===r?lt(n):"cleanupThread"===r?st(n.thread):"killThread"===r?(n=n.thread,r=ht.Vb[n],delete ht.Vb[n],r.terminate(),Oe(n),ht.ac.splice(ht.ac.indexOf(r),1),r.Ub=0):"cancelThread"===r?ht.Vb[n.thread].postMessage({cmd:"cancel"}):"loaded"===r?(t.loaded=!0,e&&e(t),t.$b&&(t.$b(),delete t.$b)):"print"===r?C("Thread "+n.threadId+": "+n.text):"printErr"===r?x("Thread "+n.threadId+": "+n.text):"alert"===r?alert("Thread "+n.threadId+": "+n.text):"setimmediate"===n.target?t.postMessage(n):"onAbort"===r?u.onAbort&&u.onAbort(n.arg):r&&x("worker sent an unknown command "+r);ht.Bc=void 0},t.onerror=t=>{throw x("worker sent an error! "+t.filename+":"+t.lineno+": "+t.message),t},_&&(t.on("message",(function(e){t.onmessage({data:e})})),t.on("error",(function(e){t.onerror(e)})),t.on("detachedExit",(function(){}))),t.postMessage({cmd:"load",urlOrBlob:u.mainScriptUrlOrBlob||_scriptDir,wasmMemory:j,wasmModule:k})},yc:function(){var t=S("ort-wasm-threaded.worker.js");ht.Yb.push(new Worker(t))},Cc:function(){return 0==ht.Yb.length&&(ht.yc(),ht.Fc(ht.Yb[0])),ht.Yb.pop()}};function dt(t){for(;0<t.length;)t.shift()(u)}function yt(t){var e=Ee();return t=t(),Me(e),t}function bt(t){if(O)return $t(2,0,t);try{pt(t)}catch(t){t instanceof ct||"unwind"==t||g(1,t)}}u.PThread=ht,u.establishStackSpace=function(){var t=he(),e=a()[t+44>>2>>>0];t=a()[t+48>>2>>>0],Te(e,e-t),Me(e)};var mt=[];function gt(t){var e=mt[t];return e||(t>=mt.length&&(mt.length=t+1),mt[t]=e=$.get(t)),e}u.invokeEntryPoint=function(t,e){t=gt(t)(e),Q()?ht.nc(t):Ae(t)};var vt,wt,_t=[],Ot=0,At=0;function St(t){this.Zb=t,this.Sb=t-24,this.xc=function(t){i()[this.Sb+4>>2>>>0]=t},this.bc=function(){return i()[this.Sb+4>>2>>>0]},this.wc=function(t){i()[this.Sb+8>>2>>>0]=t},this.Dc=function(){return i()[this.Sb+8>>2>>>0]},this.rc=function(){a()[this.Sb>>2>>>0]=0},this.hc=function(t){t=t?1:0,e()[this.Sb+12>>0>>>0]=t},this.uc=function(){return 0!=e()[this.Sb+12>>0>>>0]},this.ic=function(t){t=t?1:0,e()[this.Sb+13>>0>>>0]=t},this.kc=function(){return 0!=e()[this.Sb+13>>0>>>0]},this.fc=function(t,e){this.cc(0),this.xc(t),this.wc(e),this.rc(),this.hc(!1),this.ic(!1)},this.sc=function(){Atomics.add(a(),this.Sb>>2,1)},this.Hc=function(){return 1===Atomics.sub(a(),this.Sb>>2,1)},this.cc=function(t){i()[this.Sb+16>>2>>>0]=t},this.tc=function(){return i()[this.Sb+16>>2>>>0]},this.vc=function(){if(Re(this.bc()))return i()[this.Zb>>2>>>0];var t=this.tc();return 0!==t?t:this.Zb}}function Tt(t){return ye(new St(t).Sb)}function Et(t,e,n,r){return O?$t(3,1,t,e,n,r):Mt(t,e,n,r)}function Mt(t,e,n,r){if("undefined"==typeof SharedArrayBuffer)return x("Current environment does not support SharedArrayBuffer, pthreads are not available!"),6;var a=[];return O&&0===a.length?Et(t,e,n,r):(t={Ic:n,Ub:t,zc:r,Nc:a},O?(t.Oc="spawnThread",postMessage(t,a),0):lt(t))}function Ct(t,e,n){return O?$t(4,1,t,e,n):0}function xt(t,e){if(O)return $t(5,1,t,e)}function Rt(t,e){if(O)return $t(6,1,t,e)}function jt(t,e,n){if(O)return $t(7,1,t,e,n)}function kt(t,e,n){return O?$t(8,1,t,e,n):0}function Dt(t,e){if(O)return $t(9,1,t,e)}function Pt(t,e,n){if(O)return $t(10,1,t,e,n)}function Ut(t,e,n,r){if(O)return $t(11,1,t,e,n,r)}function Ft(t,e,n,r){if(O)return $t(12,1,t,e,n,r)}function It(t,e,n,r){if(O)return $t(13,1,t,e,n,r)}function Wt(t){if(O)return $t(14,1,t)}function Ht(t,e){if(O)return $t(15,1,t,e)}function Lt(t,e,n){if(O)return $t(16,1,t,e,n)}function zt(t){Atomics.store(a(),t>>2,1),he()&&_e(t),Atomics.compareExchange(a(),t>>2,1,0)}function Yt(t){return i()[t>>>2]+4294967296*a()[t+4>>>2]}function Bt(t,e,n,r,a,i){return O?$t(17,1,t,e,n,r,a,i):-52}function Gt(t,e,n,r,a,i){if(O)return $t(18,1,t,e,n,r,a,i)}function Nt(t){var n=G(t)+1,r=de(n);return r&&B(t,e(),r,n),r}function Vt(t,e,n){function r(t){return(t=t.toTimeString().match(/\\(([A-Za-z ]+)\\)$/))?t[1]:"GMT"}if(O)return $t(19,1,t,e,n);var o=(new Date).getFullYear(),u=new Date(o,0,1),c=new Date(o,6,1);o=u.getTimezoneOffset();var s=c.getTimezoneOffset(),l=Math.max(o,s);a()[t>>2>>>0]=60*l,a()[e>>2>>>0]=Number(o!=s),t=r(u),e=r(c),t=Nt(t),e=Nt(e),s<o?(i()[n>>2>>>0]=t,i()[n+4>>2>>>0]=e):(i()[n>>2>>>0]=e,i()[n+4>>2>>>0]=t)}function $t(t,e){var n=arguments.length-2,r=arguments;return yt((()=>{for(var a=Ce(8*n),i=a>>3,u=0;u<n;u++){var c=r[2+u];o()[i+u>>>0]=c}return we(t,n,a,e)}))}u.executeNotifiedProxyingQueue=zt,wt=_?()=>{var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:O?()=>performance.now()-u.__performance_now_clock_drift:()=>performance.now();var qt,Xt=[],Jt={};function Zt(){if(!qt){var t,e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:m||"./this.program"};for(t in Jt)void 0===Jt[t]?delete e[t]:e[t]=Jt[t];var n=[];for(t in e)n.push(t+"="+e[t]);qt=n}return qt}function Qt(t,n){if(O)return $t(20,1,t,n);var r=0;return Zt().forEach((function(a,o){var u=n+r;for(o=i()[t+4*o>>2>>>0]=u,u=0;u<a.length;++u)e()[o++>>0>>>0]=a.charCodeAt(u);e()[o>>0>>>0]=0,r+=a.length+1})),0}function Kt(t,e){if(O)return $t(21,1,t,e);var n=Zt();i()[t>>2>>>0]=n.length;var r=0;return n.forEach((function(t){r+=t.length+1})),i()[e>>2>>>0]=r,0}function te(t){return O?$t(22,1,t):52}function ee(t,e,n,r){return O?$t(23,1,t,e,n,r):52}function ne(t,e,n,r,a){return O?$t(24,1,t,e,n,r,a):70}var re=[null,[],[]];function ae(t,e){var n=re[t];0===e||10===e?((1===t?C:x)(z(n,0)),n.length=0):n.push(e)}function ie(t,e,n,a){if(O)return $t(25,1,t,e,n,a);for(var o=0,u=0;u<n;u++){var c=i()[e>>2>>>0],s=i()[e+4>>2>>>0];e+=8;for(var l=0;l<s;l++)ae(t,r()[c+l>>>0]);o+=s}return i()[a>>2>>>0]=o,0}var oe=0;function ue(t){return 0==t%4&&(0!=t%100||0==t%400)}var ce=[31,29,31,30,31,30,31,31,30,31,30,31],se=[31,28,31,30,31,30,31,31,30,31,30,31];function le(t,n,r,i){function o(t,e,n){for(t="number"==typeof t?t.toString():t||"";t.length<e;)t=n[0]+t;return t}function u(t,e){return o(t,e,"0")}function c(t,e){function n(t){return 0>t?-1:0<t?1:0}var r;return 0===(r=n(t.getFullYear()-e.getFullYear()))&&0===(r=n(t.getMonth()-e.getMonth()))&&(r=n(t.getDate()-e.getDate())),r}function s(t){switch(t.getDay()){case 0:return new Date(t.getFullYear()-1,11,29);case 1:return t;case 2:return new Date(t.getFullYear(),0,3);case 3:return new Date(t.getFullYear(),0,2);case 4:return new Date(t.getFullYear(),0,1);case 5:return new Date(t.getFullYear()-1,11,31);case 6:return new Date(t.getFullYear()-1,11,30)}}function l(t){var e=t.Wb;for(t=new Date(new Date(t.Xb+1900,0,1).getTime());0<e;){var n=t.getMonth(),r=(ue(t.getFullYear())?ce:se)[n];if(!(e>r-t.getDate())){t.setDate(t.getDate()+e);break}e-=r-t.getDate()+1,t.setDate(1),11>n?t.setMonth(n+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return n=new Date(t.getFullYear()+1,0,4),e=s(new Date(t.getFullYear(),0,4)),n=s(n),0>=c(e,t)?0>=c(n,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var f=a()[i+40>>2>>>0];for(var p in i={Lc:a()[i>>2>>>0],Kc:a()[i+4>>2>>>0],dc:a()[i+8>>2>>>0],jc:a()[i+12>>2>>>0],ec:a()[i+16>>2>>>0],Xb:a()[i+20>>2>>>0],Tb:a()[i+24>>2>>>0],Wb:a()[i+28>>2>>>0],Rc:a()[i+32>>2>>>0],Jc:a()[i+36>>2>>>0],Mc:f?Y(f):""},r=Y(r),f={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})r=r.replace(new RegExp(p,"g"),f[p]);var h="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),d="January February March April May June July August September October November December".split(" ");for(p in f={"%a":function(t){return h[t.Tb].substring(0,3)},"%A":function(t){return h[t.Tb]},"%b":function(t){return d[t.ec].substring(0,3)},"%B":function(t){return d[t.ec]},"%C":function(t){return u((t.Xb+1900)/100|0,2)},"%d":function(t){return u(t.jc,2)},"%e":function(t){return o(t.jc,2," ")},"%g":function(t){return l(t).toString().substring(2)},"%G":function(t){return l(t)},"%H":function(t){return u(t.dc,2)},"%I":function(t){return 0==(t=t.dc)?t=12:12<t&&(t-=12),u(t,2)},"%j":function(t){for(var e=0,n=0;n<=t.ec-1;e+=(ue(t.Xb+1900)?ce:se)[n++]);return u(t.jc+e,3)},"%m":function(t){return u(t.ec+1,2)},"%M":function(t){return u(t.Kc,2)},"%n":function(){return"\\n"},"%p":function(t){return 0<=t.dc&&12>t.dc?"AM":"PM"},"%S":function(t){return u(t.Lc,2)},"%t":function(){return"\\t"},"%u":function(t){return t.Tb||7},"%U":function(t){return u(Math.floor((t.Wb+7-t.Tb)/7),2)},"%V":function(t){var e=Math.floor((t.Wb+7-(t.Tb+6)%7)/7);if(2>=(t.Tb+371-t.Wb-2)%7&&e++,e)53==e&&(4==(n=(t.Tb+371-t.Wb)%7)||3==n&&ue(t.Xb)||(e=1));else{e=52;var n=(t.Tb+7-t.Wb-1)%7;(4==n||5==n&&ue(t.Xb%400-1))&&e++}return u(e,2)},"%w":function(t){return t.Tb},"%W":function(t){return u(Math.floor((t.Wb+7-(t.Tb+6)%7)/7),2)},"%y":function(t){return(t.Xb+1900).toString().substring(2)},"%Y":function(t){return t.Xb+1900},"%z":function(t){var e=0<=(t=t.Jc);return t=Math.abs(t)/60,(e?"+":"-")+String("0000"+(t/60*100+t%60)).slice(-4)},"%Z":function(t){return t.Mc},"%%":function(){return"%"}},r=r.replace(/%%/g,"\\0\\0"),f)r.includes(p)&&(r=r.replace(new RegExp(p,"g"),f[p](i)));return p=function(t){var e=Array(G(t)+1);return B(t,e,0,e.length),e}(r=r.replace(/\\0\\0/g,"%")),p.length>n?0:(function(t,n){e().set(t,n>>>0)}(p,t),p.length-1)}ht.fc();var fe=[null,ft,bt,Et,Ct,xt,Rt,jt,kt,Dt,Pt,Ut,Ft,It,Wt,Ht,Lt,Bt,Gt,Vt,Qt,Kt,te,ee,ne,ie],pe={b:function(t){return de(t+24)+24},n:function(t){return(t=new St(t)).uc()||(t.hc(!0),Ot--),t.ic(!1),_t.push(t),t.sc(),t.vc()},ma:function(t){throw x("Unexpected exception thrown, this is not properly supported - aborting"),H=!0,t},x:function(){Se(0);var t=_t.pop();if(t.Hc()&&!t.kc()){var e=t.Dc();e&>(e)(t.Zb),Tt(t.Zb)}At=0},e:function(){var t=At;if(!t)return oe=0;var e=new St(t);e.cc(t);var n=e.bc();if(!n)return oe=0,t;for(var r=Array.prototype.slice.call(arguments),a=0;a<r.length;a++){var i=r[a];if(0===i||i===n)break;if(xe(i,n,e.Sb+16))return oe=i,t}return oe=n,t},l:function(){var t=At;if(!t)return oe=0;var e=new St(t);e.cc(t);var n=e.bc();if(!n)return oe=0,t;for(var r=Array.prototype.slice.call(arguments),a=0;a<r.length;a++){var i=r[a];if(0===i||i===n)break;if(xe(i,n,e.Sb+16))return oe=i,t}return oe=n,t},h:function(){var t=At;if(!t)return oe=0;var e=new St(t);e.cc(t);var n=e.bc();if(!n)return oe=0,t;for(var r=Array.prototype.slice.call(arguments),a=0;a<r.length;a++){var i=r[a];if(0===i||i===n)break;if(xe(i,n,e.Sb+16))return oe=i,t}return oe=n,t},t:Tt,M:function(){var t=_t.pop();t||at("no exception to throw");var e=t.Zb;throw t.kc()||(_t.push(t),t.ic(!0),t.hc(!1),Ot++),At=e,e},c:function(t,e,n){throw new St(t).fc(e,n),At=t,Ot++,t},pa:function(){return Ot},Fa:function(t){ge(t,!w,1,!v),ht.pc()},T:function(t){O?postMessage({cmd:"cleanupThread",thread:t}):st(t)},xa:Mt,j:function(t){throw At||(At=t),t},H:Ct,Ma:xt,ua:Rt,wa:jt,oa:kt,Ka:Dt,Ca:Pt,Ja:Ut,V:Ft,va:It,sa:Wt,La:Ht,ta:Lt,Ta:function(){},X:function(){at("To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking")},Ua:function(){at("To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking")},W:function(){return Date.now()},ya:function(){return 2097152},Oa:function(){return!0},za:function(t,e,n,r){if(t==e)setTimeout((()=>zt(r)));else if(O)postMessage({targetThread:t,cmd:"processProxyingQueue",queue:r});else{if(!(t=ht.Vb[t]))return;t.postMessage({cmd:"processProxyingQueue",queue:r})}return 1},Ea:function(){return-1},Pa:function(t,e){t=new Date(1e3*Yt(t)),a()[e>>2>>>0]=t.getUTCSeconds(),a()[e+4>>2>>>0]=t.getUTCMinutes(),a()[e+8>>2>>>0]=t.getUTCHours(),a()[e+12>>2>>>0]=t.getUTCDate(),a()[e+16>>2>>>0]=t.getUTCMonth(),a()[e+20>>2>>>0]=t.getUTCFullYear()-1900,a()[e+24>>2>>>0]=t.getUTCDay(),t=(t.getTime()-Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,a()[e+28>>2>>>0]=t},Qa:function(t,e){t=new Date(1e3*Yt(t)),a()[e>>2>>>0]=t.getSeconds(),a()[e+4>>2>>>0]=t.getMinutes(),a()[e+8>>2>>>0]=t.getHours(),a()[e+12>>2>>>0]=t.getDate(),a()[e+16>>2>>>0]=t.getMonth(),a()[e+20>>2>>>0]=t.getFullYear()-1900,a()[e+24>>2>>>0]=t.getDay();var n=new Date(t.getFullYear(),0,1),r=(t.getTime()-n.getTime())/864e5|0;a()[e+28>>2>>>0]=r,a()[e+36>>2>>>0]=-60*t.getTimezoneOffset(),r=new Date(t.getFullYear(),6,1).getTimezoneOffset(),t=0|(r!=(n=n.getTimezoneOffset())&&t.getTimezoneOffset()==Math.min(n,r)),a()[e+32>>2>>>0]=t},Ra:function(t){var e=new Date(a()[t+20>>2>>>0]+1900,a()[t+16>>2>>>0],a()[t+12>>2>>>0],a()[t+8>>2>>>0],a()[t+4>>2>>>0],a()[t>>2>>>0],0),n=a()[t+32>>2>>>0],r=e.getTimezoneOffset(),i=new Date(e.getFullYear(),0,1),o=new Date(e.getFullYear(),6,1).getTimezoneOffset(),u=i.getTimezoneOffset(),c=Math.min(u,o);return 0>n?a()[t+32>>2>>>0]=Number(o!=u&&c==r):0<n!=(c==r)&&(o=Math.max(u,o),e.setTime(e.getTime()+6e4*((0<n?c:o)-r))),a()[t+24>>2>>>0]=e.getDay(),n=(e.getTime()-i.getTime())/864e5|0,a()[t+28>>2>>>0]=n,a()[t>>2>>>0]=e.getSeconds(),a()[t+4>>2>>>0]=e.getMinutes(),a()[t+8>>2>>>0]=e.getHours(),a()[t+12>>2>>>0]=e.getDate(),a()[t+16>>2>>>0]=e.getMonth(),e.getTime()/1e3|0},Aa:Bt,Ba:Gt,Sa:function t(e,n,r){t.Ac||(t.Ac=!0,Vt(e,n,r))},y:function(){at("")},U:function(){if(!_&&!w){var t="Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread";vt||(vt={}),vt[t]||(vt[t]=1,_&&(t="warning: "+t),x(t))}},ra:function(){return 4294901760},B:wt,Ia:function(t,e,n){r().copyWithin(t>>>0,e>>>0,e+n>>>0)},F:function(){return _?n(993).cpus().length:navigator.hardwareConcurrency},Da:function(t,e,n){Xt.length=e,n>>=3;for(var r=0;r<e;r++)Xt[r]=o()[n+r>>>0];return(0>t?ut[-t-1]:fe[t]).apply(null,Xt)},qa:function(t){var e=r().length;if((t>>>=0)<=e||4294901760<t)return!1;for(var n=1;4>=n;n*=2){var a=e*(1+.2/n);a=Math.min(a,t+100663296);var i=Math;a=Math.max(t,a),i=i.min.call(i,4294901760,a+(65536-a%65536)%65536);t:{try{j.grow(i-D.byteLength+65535>>>16),N(j.buffer);var o=1;break t}catch(t){}o=void 0}if(o)return!0}return!1},Na:function(){throw"unwind"},Ga:Qt,Ha:Kt,J:pt,I:te,S:ee,ga:ne,R:ie,d:function(){return oe},na:function t(r,a){t.lc||(t.lc=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var t=new Uint8Array(1);return()=>(crypto.getRandomValues(t),t[0])}if(_)try{var e=n(Object(function(){var t=new Error("Cannot find module \'crypto\'");throw t.code="MODULE_NOT_FOUND",t}()));return()=>e.randomBytes(1)[0]}catch(t){}return()=>at("randomDevice")}());for(var i=0;i<a;i++)e()[r+i>>0>>>0]=t.lc();return 0},ia:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},ja:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},K:function(t){var e=Ee();try{return gt(t)()}catch(t){if(Me(e),t!==t+0)throw t;Se(1,0)}},f:function(t,e){var n=Ee();try{return gt(t)(e)}catch(t){if(Me(n),t!==t+0)throw t;Se(1,0)}},P:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},Q:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},k:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},p:function(t,e,n,r){var a=Ee();try{return gt(t)(e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Se(1,0)}},q:function(t,e,n,r,a){var i=Ee();try{return gt(t)(e,n,r,a)}catch(t){if(Me(i),t!==t+0)throw t;Se(1,0)}},N:function(t,e,n,r,a,i){var o=Ee();try{return gt(t)(e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Se(1,0)}},s:function(t,e,n,r,a,i){var o=Ee();try{return gt(t)(e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Se(1,0)}},w:function(t,e,n,r,a,i,o){var u=Ee();try{return gt(t)(e,n,r,a,i,o)}catch(t){if(Me(u),t!==t+0)throw t;Se(1,0)}},L:function(t,e,n,r,a,i,o,u){var c=Ee();try{return gt(t)(e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Se(1,0)}},E:function(t,e,n,r,a,i,o,u,c,s,l,f){var p=Ee();try{return gt(t)(e,n,r,a,i,o,u,c,s,l,f)}catch(t){if(Me(p),t!==t+0)throw t;Se(1,0)}},aa:function(t,e,n,r,a,i,o,u){var c=Ee();try{return He(t,e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Se(1,0)}},_:function(t,e,n,r,a,i,o){var u=Ee();try{return ke(t,e,n,r,a,i,o)}catch(t){if(Me(u),t!==t+0)throw t;Se(1,0)}},Z:function(t,e,n,r,a){var i=Ee();try{return Le(t,e,n,r,a)}catch(t){if(Me(i),t!==t+0)throw t;Se(1,0)}},ca:function(t,e,n,r){var a=Ee();try{return Ie(t,e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Se(1,0)}},$:function(t){var e=Ee();try{return je(t)}catch(t){if(Me(e),t!==t+0)throw t;Se(1,0)}},ba:function(t,e){var n=Ee();try{return We(t,e)}catch(t){if(Me(n),t!==t+0)throw t;Se(1,0)}},Y:function(t,e,n){var r=Ee();try{return De(t,e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},g:function(t){var e=Ee();try{gt(t)()}catch(t){if(Me(e),t!==t+0)throw t;Se(1,0)}},r:function(t,e){var n=Ee();try{gt(t)(e)}catch(t){if(Me(n),t!==t+0)throw t;Se(1,0)}},i:function(t,e,n){var r=Ee();try{gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},ha:function(t,e,n,r){var a=Ee();try{gt(t)(e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Se(1,0)}},m:function(t,e,n,r){var a=Ee();try{gt(t)(e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Se(1,0)}},v:function(t,e,n,r,a){var i=Ee();try{gt(t)(e,n,r,a)}catch(t){if(Me(i),t!==t+0)throw t;Se(1,0)}},u:function(t,e,n,r,a,i){var o=Ee();try{gt(t)(e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Se(1,0)}},O:function(t,e,n,r,a,i,o){var u=Ee();try{gt(t)(e,n,r,a,i,o)}catch(t){if(Me(u),t!==t+0)throw t;Se(1,0)}},A:function(t,e,n,r,a,i,o,u){var c=Ee();try{gt(t)(e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Se(1,0)}},ka:function(t,e,n,r,a,i,o,u,c){var s=Ee();try{gt(t)(e,n,r,a,i,o,u,c)}catch(t){if(Me(s),t!==t+0)throw t;Se(1,0)}},C:function(t,e,n,r,a,i,o,u,c,s,l){var f=Ee();try{gt(t)(e,n,r,a,i,o,u,c,s,l)}catch(t){if(Me(f),t!==t+0)throw t;Se(1,0)}},D:function(t,e,n,r,a,i,o,u,c,s,l,f,p,h,d,y){var b=Ee();try{gt(t)(e,n,r,a,i,o,u,c,s,l,f,p,h,d,y)}catch(t){if(Me(b),t!==t+0)throw t;Se(1,0)}},fa:function(t,e,n,r,a,i,o,u){var c=Ee();try{Pe(t,e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Se(1,0)}},da:function(t,e,n,r,a,i,o,u,c,s,l,f){var p=Ee();try{Fe(t,e,n,r,a,i,o,u,c,s,l,f)}catch(t){if(Me(p),t!==t+0)throw t;Se(1,0)}},ea:function(t,e,n,r,a,i){var o=Ee();try{Ue(t,e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Se(1,0)}},o:function(t){return t},a:j||u.wasmMemory,G:function(t){oe=t},la:le,z:function(t,e,n,r){return le(t,e,n,r)}};!function(){function t(t,e){u.asm=t.exports,ht.qc.push(u.asm.sb),$=u.asm.ub,X.unshift(u.asm.Va),k=e,O||(et--,u.monitorRunDependencies&&u.monitorRunDependencies(et),0==et&&(null!==nt&&(clearInterval(nt),nt=null),rt&&(t=rt,rt=null,t())))}function e(e){t(e.instance,e.module)}function n(t){return function(){if(!M&&(v||w)){if("function"==typeof fetch&&!tt.startsWith("file://"))return fetch(tt,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at \'"+tt+"\'";return t.arrayBuffer()})).catch((function(){return ot()}));if(f)return new Promise((function(t,e){f(tt,(function(e){t(new Uint8Array(e))}),e)}))}return Promise.resolve().then((function(){return ot()}))}().then((function(t){return WebAssembly.instantiate(t,r)})).then((function(t){return t})).then(t,(function(t){x("failed to asynchronously prepare wasm: "+t),at(t)}))}var r={a:pe};if(O||(et++,u.monitorRunDependencies&&u.monitorRunDependencies(et)),u.instantiateWasm)try{return u.instantiateWasm(r,t)}catch(t){return x("Module.instantiateWasm callback failed with error: "+t),!1}(M||"function"!=typeof WebAssembly.instantiateStreaming||it()||tt.startsWith("file://")||_||"function"!=typeof fetch?n(e):fetch(tt,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,r).then(e,(function(t){return x("wasm streaming compile failed: "+t),x("falling back to ArrayBuffer instantiation"),n(e)}))}))).catch(s)}(),u.___wasm_call_ctors=function(){return(u.___wasm_call_ctors=u.asm.Va).apply(null,arguments)},u._OrtInit=function(){return(u._OrtInit=u.asm.Wa).apply(null,arguments)},u._OrtCreateSessionOptions=function(){return(u._OrtCreateSessionOptions=u.asm.Xa).apply(null,arguments)},u._OrtAppendExecutionProvider=function(){return(u._OrtAppendExecutionProvider=u.asm.Ya).apply(null,arguments)},u._OrtAddSessionConfigEntry=function(){return(u._OrtAddSessionConfigEntry=u.asm.Za).apply(null,arguments)},u._OrtReleaseSessionOptions=function(){return(u._OrtReleaseSessionOptions=u.asm._a).apply(null,arguments)},u._OrtCreateSession=function(){return(u._OrtCreateSession=u.asm.$a).apply(null,arguments)},u._OrtReleaseSession=function(){return(u._OrtReleaseSession=u.asm.ab).apply(null,arguments)},u._OrtGetInputCount=function(){return(u._OrtGetInputCount=u.asm.bb).apply(null,arguments)},u._OrtGetOutputCount=function(){return(u._OrtGetOutputCount=u.asm.cb).apply(null,arguments)},u._OrtGetInputName=function(){return(u._OrtGetInputName=u.asm.db).apply(null,arguments)},u._OrtGetOutputName=function(){return(u._OrtGetOutputName=u.asm.eb).apply(null,arguments)},u._OrtFree=function(){return(u._OrtFree=u.asm.fb).apply(null,arguments)},u._OrtCreateTensor=function(){return(u._OrtCreateTensor=u.asm.gb).apply(null,arguments)},u._OrtGetTensorData=function(){return(u._OrtGetTensorData=u.asm.hb).apply(null,arguments)},u._OrtReleaseTensor=function(){return(u._OrtReleaseTensor=u.asm.ib).apply(null,arguments)},u._OrtCreateRunOptions=function(){return(u._OrtCreateRunOptions=u.asm.jb).apply(null,arguments)},u._OrtAddRunConfigEntry=function(){return(u._OrtAddRunConfigEntry=u.asm.kb).apply(null,arguments)},u._OrtReleaseRunOptions=function(){return(u._OrtReleaseRunOptions=u.asm.lb).apply(null,arguments)},u._OrtRun=function(){return(u._OrtRun=u.asm.mb).apply(null,arguments)},u._OrtEndProfiling=function(){return(u._OrtEndProfiling=u.asm.nb).apply(null,arguments)};var he=u._pthread_self=function(){return(he=u._pthread_self=u.asm.ob).apply(null,arguments)},de=u._malloc=function(){return(de=u._malloc=u.asm.pb).apply(null,arguments)},ye=u._free=function(){return(ye=u._free=u.asm.qb).apply(null,arguments)},be=u._fflush=function(){return(be=u._fflush=u.asm.rb).apply(null,arguments)};u.__emscripten_tls_init=function(){return(u.__emscripten_tls_init=u.asm.sb).apply(null,arguments)};var me=u.___funcs_on_exit=function(){return(me=u.___funcs_on_exit=u.asm.tb).apply(null,arguments)},ge=u.__emscripten_thread_init=function(){return(ge=u.__emscripten_thread_init=u.asm.vb).apply(null,arguments)};u.__emscripten_thread_crashed=function(){return(u.__emscripten_thread_crashed=u.asm.wb).apply(null,arguments)};var ve,we=u._emscripten_run_in_main_runtime_thread_js=function(){return(we=u._emscripten_run_in_main_runtime_thread_js=u.asm.xb).apply(null,arguments)},_e=u.__emscripten_proxy_execute_task_queue=function(){return(_e=u.__emscripten_proxy_execute_task_queue=u.asm.yb).apply(null,arguments)},Oe=u.__emscripten_thread_free_data=function(){return(Oe=u.__emscripten_thread_free_data=u.asm.zb).apply(null,arguments)},Ae=u.__emscripten_thread_exit=function(){return(Ae=u.__emscripten_thread_exit=u.asm.Ab).apply(null,arguments)},Se=u._setThrew=function(){return(Se=u._setThrew=u.asm.Bb).apply(null,arguments)},Te=u._emscripten_stack_set_limits=function(){return(Te=u._emscripten_stack_set_limits=u.asm.Cb).apply(null,arguments)},Ee=u.stackSave=function(){return(Ee=u.stackSave=u.asm.Db).apply(null,arguments)},Me=u.stackRestore=function(){return(Me=u.stackRestore=u.asm.Eb).apply(null,arguments)},Ce=u.stackAlloc=function(){return(Ce=u.stackAlloc=u.asm.Fb).apply(null,arguments)},xe=u.___cxa_can_catch=function(){return(xe=u.___cxa_can_catch=u.asm.Gb).apply(null,arguments)},Re=u.___cxa_is_pointer_type=function(){return(Re=u.___cxa_is_pointer_type=u.asm.Hb).apply(null,arguments)},je=u.dynCall_j=function(){return(je=u.dynCall_j=u.asm.Ib).apply(null,arguments)},ke=u.dynCall_iiiiij=function(){return(ke=u.dynCall_iiiiij=u.asm.Jb).apply(null,arguments)},De=u.dynCall_jii=function(){return(De=u.dynCall_jii=u.asm.Kb).apply(null,arguments)},Pe=u.dynCall_viiiiij=function(){return(Pe=u.dynCall_viiiiij=u.asm.Lb).apply(null,arguments)},Ue=u.dynCall_vjji=function(){return(Ue=u.dynCall_vjji=u.asm.Mb).apply(null,arguments)},Fe=u.dynCall_viiijjjii=function(){return(Fe=u.dynCall_viiijjjii=u.asm.Nb).apply(null,arguments)},Ie=u.dynCall_iij=function(){return(Ie=u.dynCall_iij=u.asm.Ob).apply(null,arguments)},We=u.dynCall_ji=function(){return(We=u.dynCall_ji=u.asm.Pb).apply(null,arguments)},He=u.dynCall_iiiiiij=function(){return(He=u.dynCall_iiiiiij=u.asm.Qb).apply(null,arguments)},Le=u.dynCall_iiij=function(){return(Le=u.dynCall_iiij=u.asm.Rb).apply(null,arguments)};function ze(){function t(){if(!ve&&(ve=!0,u.calledRun=!0,!H)&&(O||dt(X),c(u),u.onRuntimeInitialized&&u.onRuntimeInitialized(),!O)){if(u.postRun)for("function"==typeof u.postRun&&(u.postRun=[u.postRun]);u.postRun.length;){var t=u.postRun.shift();Z.unshift(t)}dt(Z)}}if(!(0<et))if(O)c(u),O||dt(X),postMessage({cmd:"loaded"});else{if(u.preRun)for("function"==typeof u.preRun&&(u.preRun=[u.preRun]);u.preRun.length;)K();dt(q),0<et||(u.setStatus?(u.setStatus("Running..."),setTimeout((function(){setTimeout((function(){u.setStatus("")}),1),t()}),1)):t())}}if(u.UTF8ToString=Y,u.stringToUTF8=function(t,e,n){return B(t,r(),e,n)},u.lengthBytesUTF8=G,u.keepRuntimeAlive=Q,u.wasmMemory=j,u.stackSave=Ee,u.stackRestore=Me,u.stackAlloc=Ce,u.ExitStatus=ct,u.PThread=ht,rt=function t(){ve||ze(),ve||(rt=t)},u.preInit)for("function"==typeof u.preInit&&(u.preInit=[u.preInit]);0<u.preInit.length;)u.preInit.pop()();return ze(),t.ready});t.exports=r},932:(t,e,n)=>{var _scriptDir,r=(_scriptDir=(_scriptDir="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(t){var e,r,a;t=t||{},e||(e=void 0!==t?t:{}),e.ready=new Promise((function(t,e){r=t,a=e}));var i,o,u,c,s,l,f=Object.assign({},e),p="./this.program",h=(t,e)=>{throw e},d="object"==typeof window,y="function"==typeof importScripts,b="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,m="";b?(m=y?n(908).dirname(m)+"/":"//",l=()=>{s||(c=n(384),s=n(908))},i=function(t,e){return l(),t=s.normalize(t),c.readFileSync(t,e?void 0:"utf8")},u=t=>((t=i(t,!0)).buffer||(t=new Uint8Array(t)),t),o=(t,e,n)=>{l(),t=s.normalize(t),c.readFile(t,(function(t,r){t?n(t):e(r.buffer)}))},1<process.argv.length&&(p=process.argv[1].replace(/\\\\/g,"/")),process.argv.slice(2),process.on("uncaughtException",(function(t){if(!(t instanceof J))throw t})),process.on("unhandledRejection",(function(t){throw t})),h=(t,e)=>{if(_||0<L)throw process.exitCode=t,e;e instanceof J||w("exiting due to exception: "+e),process.exit(t)},e.inspect=function(){return"[Emscripten Module object]"}):(d||y)&&(y?m=self.location.href:"undefined"!=typeof document&&document.currentScript&&(m=document.currentScript.src),_scriptDir&&(m=_scriptDir),m=0!==m.indexOf("blob:")?m.substr(0,m.replace(/[?#].*/,"").lastIndexOf("/")+1):"",i=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},y&&(u=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),o=(t,e,n)=>{var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?e(r.response):n()},r.onerror=n,r.send(null)});var g,v=e.print||console.log.bind(console),w=e.printErr||console.warn.bind(console);Object.assign(e,f),f=null,e.thisProgram&&(p=e.thisProgram),e.quit&&(h=e.quit),e.wasmBinary&&(g=e.wasmBinary);var _=e.noExitRuntime||!1;"object"!=typeof WebAssembly&&V("no native wasm support detected");var O,A,S,T,E,M,C=!1,x="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function R(t,e,n){var r=(e>>>=0)+n;for(n=e;t[n]&&!(n>=r);)++n;if(16<n-e&&t.buffer&&x)return x.decode(t.subarray(e,n));for(r="";e<n;){var a=t[e++];if(128&a){var i=63&t[e++];if(192==(224&a))r+=String.fromCharCode((31&a)<<6|i);else{var o=63&t[e++];65536>(a=224==(240&a)?(15&a)<<12|i<<6|o:(7&a)<<18|i<<12|o<<6|63&t[e++])?r+=String.fromCharCode(a):(a-=65536,r+=String.fromCharCode(55296|a>>10,56320|1023&a))}}else r+=String.fromCharCode(a)}return r}function j(t,e){return(t>>>=0)?R(T,t,e):""}function k(t,e,n,r){if(!(0<r))return 0;var a=n>>>=0;r=n+r-1;for(var i=0;i<t.length;++i){var o=t.charCodeAt(i);if(55296<=o&&57343>=o&&(o=65536+((1023&o)<<10)|1023&t.charCodeAt(++i)),127>=o){if(n>=r)break;e[n++>>>0]=o}else{if(2047>=o){if(n+1>=r)break;e[n++>>>0]=192|o>>6}else{if(65535>=o){if(n+2>=r)break;e[n++>>>0]=224|o>>12}else{if(n+3>=r)break;e[n++>>>0]=240|o>>18,e[n++>>>0]=128|o>>12&63}e[n++>>>0]=128|o>>6&63}e[n++>>>0]=128|63&o}}return e[n>>>0]=0,n-a}function D(t){for(var e=0,n=0;n<t.length;++n){var r=t.charCodeAt(n);127>=r?e++:2047>=r?e+=2:55296<=r&&57343>=r?(e+=4,++n):e+=3}return e}function P(){var t=O.buffer;A=t,e.HEAP8=S=new Int8Array(t),e.HEAP16=new Int16Array(t),e.HEAP32=E=new Int32Array(t),e.HEAPU8=T=new Uint8Array(t),e.HEAPU16=new Uint16Array(t),e.HEAPU32=M=new Uint32Array(t),e.HEAPF32=new Float32Array(t),e.HEAPF64=new Float64Array(t)}var U,F=[],I=[],W=[],H=[],L=0;function z(){var t=e.preRun.shift();F.unshift(t)}var Y,B=0,G=null,N=null;function V(t){throw e.onAbort&&e.onAbort(t),w(t="Aborted("+t+")"),C=!0,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),a(t),t}function $(){return Y.startsWith("data:application/octet-stream;base64,")}if(Y="ort-wasm.wasm",!$()){var q=Y;Y=e.locateFile?e.locateFile(q,m):m+q}function X(){var t=Y;try{if(t==Y&&g)return new Uint8Array(g);if(u)return u(t);throw"both async and sync fetching of the wasm failed"}catch(t){V(t)}}function J(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function Z(t){for(;0<t.length;)t.shift()(e)}var Q=[],K=0,tt=0;function et(t){this.Db=t,this.zb=t-24,this.Ub=function(t){M[this.zb+4>>2>>>0]=t},this.Eb=function(){return M[this.zb+4>>2>>>0]},this.Sb=function(t){M[this.zb+8>>2>>>0]=t},this.Wb=function(){return M[this.zb+8>>2>>>0]},this.Tb=function(){E[this.zb>>2>>>0]=0},this.Ib=function(t){S[this.zb+12>>0>>>0]=t?1:0},this.Pb=function(){return 0!=S[this.zb+12>>0>>>0]},this.Jb=function(t){S[this.zb+13>>0>>>0]=t?1:0},this.Lb=function(){return 0!=S[this.zb+13>>0>>>0]},this.Rb=function(t,e){this.Fb(0),this.Ub(t),this.Sb(e),this.Tb(),this.Ib(!1),this.Jb(!1)},this.Nb=function(){E[this.zb>>2>>>0]+=1},this.Xb=function(){var t=E[this.zb>>2>>>0];return E[this.zb>>2>>>0]=t-1,1===t},this.Fb=function(t){M[this.zb+16>>2>>>0]=t},this.Ob=function(){return M[this.zb+16>>2>>>0]},this.Qb=function(){if(Mt(this.Eb()))return M[this.Db>>2>>>0];var t=this.Ob();return 0!==t?t:this.Db}}function nt(t){return vt(new et(t).zb)}var rt=[];function at(t){var e=rt[t];return e||(t>=rt.length&&(rt.length=t+1),rt[t]=e=U.get(t)),e}function it(t){var e=D(t)+1,n=gt(e);return n&&k(t,S,n,e),n}var ot={};function ut(){if(!ct){var t,e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:p||"./this.program"};for(t in ot)void 0===ot[t]?delete e[t]:e[t]=ot[t];var n=[];for(t in e)n.push(t+"="+e[t]);ct=n}return ct}var ct,st=[null,[],[]];function lt(t,e){var n=st[t];0===e||10===e?((1===t?v:w)(R(n,0)),n.length=0):n.push(e)}var ft=0;function pt(t){return 0==t%4&&(0!=t%100||0==t%400)}var ht=[31,29,31,30,31,30,31,31,30,31,30,31],dt=[31,28,31,30,31,30,31,31,30,31,30,31];function yt(t,e,n,r){function a(t,e,n){for(t="number"==typeof t?t.toString():t||"";t.length<e;)t=n[0]+t;return t}function i(t,e){return a(t,e,"0")}function o(t,e){function n(t){return 0>t?-1:0<t?1:0}var r;return 0===(r=n(t.getFullYear()-e.getFullYear()))&&0===(r=n(t.getMonth()-e.getMonth()))&&(r=n(t.getDate()-e.getDate())),r}function u(t){switch(t.getDay()){case 0:return new Date(t.getFullYear()-1,11,29);case 1:return t;case 2:return new Date(t.getFullYear(),0,3);case 3:return new Date(t.getFullYear(),0,2);case 4:return new Date(t.getFullYear(),0,1);case 5:return new Date(t.getFullYear()-1,11,31);case 6:return new Date(t.getFullYear()-1,11,30)}}function c(t){var e=t.Bb;for(t=new Date(new Date(t.Cb+1900,0,1).getTime());0<e;){var n=t.getMonth(),r=(pt(t.getFullYear())?ht:dt)[n];if(!(e>r-t.getDate())){t.setDate(t.getDate()+e);break}e-=r-t.getDate()+1,t.setDate(1),11>n?t.setMonth(n+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return n=new Date(t.getFullYear()+1,0,4),e=u(new Date(t.getFullYear(),0,4)),n=u(n),0>=o(e,t)?0>=o(n,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var s=E[r+40>>2>>>0];for(var l in r={$b:E[r>>2>>>0],Zb:E[r+4>>2>>>0],Gb:E[r+8>>2>>>0],Kb:E[r+12>>2>>>0],Hb:E[r+16>>2>>>0],Cb:E[r+20>>2>>>0],Ab:E[r+24>>2>>>0],Bb:E[r+28>>2>>>0],bc:E[r+32>>2>>>0],Yb:E[r+36>>2>>>0],ac:s?j(s):""},n=j(n),s={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})n=n.replace(new RegExp(l,"g"),s[l]);var f="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),p="January February March April May June July August September October November December".split(" ");for(l in s={"%a":function(t){return f[t.Ab].substring(0,3)},"%A":function(t){return f[t.Ab]},"%b":function(t){return p[t.Hb].substring(0,3)},"%B":function(t){return p[t.Hb]},"%C":function(t){return i((t.Cb+1900)/100|0,2)},"%d":function(t){return i(t.Kb,2)},"%e":function(t){return a(t.Kb,2," ")},"%g":function(t){return c(t).toString().substring(2)},"%G":function(t){return c(t)},"%H":function(t){return i(t.Gb,2)},"%I":function(t){return 0==(t=t.Gb)?t=12:12<t&&(t-=12),i(t,2)},"%j":function(t){for(var e=0,n=0;n<=t.Hb-1;e+=(pt(t.Cb+1900)?ht:dt)[n++]);return i(t.Kb+e,3)},"%m":function(t){return i(t.Hb+1,2)},"%M":function(t){return i(t.Zb,2)},"%n":function(){return"\\n"},"%p":function(t){return 0<=t.Gb&&12>t.Gb?"AM":"PM"},"%S":function(t){return i(t.$b,2)},"%t":function(){return"\\t"},"%u":function(t){return t.Ab||7},"%U":function(t){return i(Math.floor((t.Bb+7-t.Ab)/7),2)},"%V":function(t){var e=Math.floor((t.Bb+7-(t.Ab+6)%7)/7);if(2>=(t.Ab+371-t.Bb-2)%7&&e++,e)53==e&&(4==(n=(t.Ab+371-t.Bb)%7)||3==n&&pt(t.Cb)||(e=1));else{e=52;var n=(t.Ab+7-t.Bb-1)%7;(4==n||5==n&&pt(t.Cb%400-1))&&e++}return i(e,2)},"%w":function(t){return t.Ab},"%W":function(t){return i(Math.floor((t.Bb+7-(t.Ab+6)%7)/7),2)},"%y":function(t){return(t.Cb+1900).toString().substring(2)},"%Y":function(t){return t.Cb+1900},"%z":function(t){var e=0<=(t=t.Yb);return t=Math.abs(t)/60,(e?"+":"-")+String("0000"+(t/60*100+t%60)).slice(-4)},"%Z":function(t){return t.ac},"%%":function(){return"%"}},n=n.replace(/%%/g,"\\0\\0"),s)n.includes(l)&&(n=n.replace(new RegExp(l,"g"),s[l](r)));return l=function(t){var e=Array(D(t)+1);return k(t,e,0,e.length),e}(n=n.replace(/\\0\\0/g,"%")),l.length>e?0:(S.set(l,t>>>0),l.length-1)}var bt={a:function(t){return gt(t+24)+24},m:function(t){return(t=new et(t)).Pb()||(t.Ib(!0),K--),t.Jb(!1),Q.push(t),t.Nb(),t.Qb()},ia:function(t){throw w("Unexpected exception thrown, this is not properly supported - aborting"),C=!0,t},w:function(){Ot(0);var t=Q.pop();if(t.Xb()&&!t.Lb()){var e=t.Wb();e&&at(e)(t.Db),nt(t.Db)}tt=0},d:function(){var t=tt;if(!t)return ft=0;var e=new et(t);e.Fb(t);var n=e.Eb();if(!n)return ft=0,t;for(var r=Array.prototype.slice.call(arguments),a=0;a<r.length;a++){var i=r[a];if(0===i||i===n)break;if(Et(i,n,e.zb+16))return ft=i,t}return ft=n,t},k:function(){var t=tt;if(!t)return ft=0;var e=new et(t);e.Fb(t);var n=e.Eb();if(!n)return ft=0,t;for(var r=Array.prototype.slice.call(arguments),a=0;a<r.length;a++){var i=r[a];if(0===i||i===n)break;if(Et(i,n,e.zb+16))return ft=i,t}return ft=n,t},g:function(){var t=tt;if(!t)return ft=0;var e=new et(t);e.Fb(t);var n=e.Eb();if(!n)return ft=0,t;for(var r=Array.prototype.slice.call(arguments),a=0;a<r.length;a++){var i=r[a];if(0===i||i===n)break;if(Et(i,n,e.zb+16))return ft=i,t}return ft=n,t},s:nt,L:function(){var t=Q.pop();t||V("no exception to throw");var e=t.Db;throw t.Lb()||(Q.push(t),t.Jb(!0),t.Ib(!1),K++),tt=e,e},b:function(t,e,n){throw new et(t).Rb(e,n),tt=t,K++,t},la:function(){return K},i:function(t){throw tt||(tt=t),t},H:function(){return 0},Ba:function(){},pa:function(){},ra:function(){},ka:function(){return 0},za:function(){},ua:function(){},ya:function(){},R:function(){},qa:function(){},na:function(){},Aa:function(){},oa:function(){},Ha:function(){},Ja:function(){V("To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking")},Ia:function(){V("To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking")},S:function(){return Date.now()},Ca:function(){return!0},Da:function(t,e){t=new Date(1e3*(M[t>>>2]+4294967296*E[t+4>>>2])),E[e>>2>>>0]=t.getUTCSeconds(),E[e+4>>2>>>0]=t.getUTCMinutes(),E[e+8>>2>>>0]=t.getUTCHours(),E[e+12>>2>>>0]=t.getUTCDate(),E[e+16>>2>>>0]=t.getUTCMonth(),E[e+20>>2>>>0]=t.getUTCFullYear()-1900,E[e+24>>2>>>0]=t.getUTCDay(),E[e+28>>2>>>0]=(t.getTime()-Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0))/864e5|0},Ea:function(t,e){t=new Date(1e3*(M[t>>>2]+4294967296*E[t+4>>>2])),E[e>>2>>>0]=t.getSeconds(),E[e+4>>2>>>0]=t.getMinutes(),E[e+8>>2>>>0]=t.getHours(),E[e+12>>2>>>0]=t.getDate(),E[e+16>>2>>>0]=t.getMonth(),E[e+20>>2>>>0]=t.getFullYear()-1900,E[e+24>>2>>>0]=t.getDay();var n=new Date(t.getFullYear(),0,1);E[e+28>>2>>>0]=(t.getTime()-n.getTime())/864e5|0,E[e+36>>2>>>0]=-60*t.getTimezoneOffset();var r=new Date(t.getFullYear(),6,1).getTimezoneOffset();n=n.getTimezoneOffset(),E[e+32>>2>>>0]=0|(r!=n&&t.getTimezoneOffset()==Math.min(n,r))},Fa:function(t){var e=new Date(E[t+20>>2>>>0]+1900,E[t+16>>2>>>0],E[t+12>>2>>>0],E[t+8>>2>>>0],E[t+4>>2>>>0],E[t>>2>>>0],0),n=E[t+32>>2>>>0],r=e.getTimezoneOffset(),a=new Date(e.getFullYear(),0,1),i=new Date(e.getFullYear(),6,1).getTimezoneOffset(),o=a.getTimezoneOffset(),u=Math.min(o,i);return 0>n?E[t+32>>2>>>0]=Number(i!=o&&u==r):0<n!=(u==r)&&(i=Math.max(o,i),e.setTime(e.getTime()+6e4*((0<n?u:i)-r))),E[t+24>>2>>>0]=e.getDay(),E[t+28>>2>>>0]=(e.getTime()-a.getTime())/864e5|0,E[t>>2>>>0]=e.getSeconds(),E[t+4>>2>>>0]=e.getMinutes(),E[t+8>>2>>>0]=e.getHours(),E[t+12>>2>>>0]=e.getDate(),E[t+16>>2>>>0]=e.getMonth(),e.getTime()/1e3|0},sa:function(){return-52},ta:function(){},Ga:function t(e,n,r){t.Vb||(t.Vb=!0,function(t,e,n){function r(t){return(t=t.toTimeString().match(/\\(([A-Za-z ]+)\\)$/))?t[1]:"GMT"}var a=(new Date).getFullYear(),i=new Date(a,0,1),o=new Date(a,6,1);a=i.getTimezoneOffset();var u=o.getTimezoneOffset();E[t>>2>>>0]=60*Math.max(a,u),E[e>>2>>>0]=Number(a!=u),t=r(i),e=r(o),t=it(t),e=it(e),u<a?(M[n>>2>>>0]=t,M[n+4>>2>>>0]=e):(M[n>>2>>>0]=e,M[n+4>>2>>>0]=t)}(e,n,r))},B:function(){V("")},ma:function(){return 4294901760},I:b?()=>{var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:()=>performance.now(),xa:function(t,e,n){T.copyWithin(t>>>0,e>>>0,e+n>>>0)},G:function(t){var e=T.length;if(4294901760<(t>>>=0))return!1;for(var n=1;4>=n;n*=2){var r=e*(1+.2/n);r=Math.min(r,t+100663296);var a=Math;r=Math.max(t,r),a=a.min.call(a,4294901760,r+(65536-r%65536)%65536);t:{try{O.grow(a-A.byteLength+65535>>>16),P();var i=1;break t}catch(t){}i=void 0}if(i)return!0}return!1},va:function(t,e){var n=0;return ut().forEach((function(r,a){var i=e+n;for(a=M[t+4*a>>2>>>0]=i,i=0;i<r.length;++i)S[a++>>0>>>0]=r.charCodeAt(i);S[a>>0>>>0]=0,n+=r.length+1})),0},wa:function(t,e){var n=ut();M[t>>2>>>0]=n.length;var r=0;return n.forEach((function(t){r+=t.length+1})),M[e>>2>>>0]=r,0},ba:function(t){_||0<L||(_t(),Z(W),wt(0),st[1].length&<(1,10),st[2].length&<(2,10)),_||0<L||(e.onExit&&e.onExit(t),C=!0),h(t,new J(t))},E:function(){return 52},Q:function(){return 52},ca:function(){return 70},P:function(t,e,n,r){for(var a=0,i=0;i<n;i++){var o=M[e>>2>>>0],u=M[e+4>>2>>>0];e+=8;for(var c=0;c<u;c++)lt(t,T[o+c>>>0]);a+=u}return M[r>>2>>>0]=a,0},c:function(){return ft},ja:function t(e,r){t.Mb||(t.Mb=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var t=new Uint8Array(1);return()=>(crypto.getRandomValues(t),t[0])}if(b)try{var e=n(Object(function(){var t=new Error("Cannot find module \'crypto\'");throw t.code="MODULE_NOT_FOUND",t}()));return()=>e.randomBytes(1)[0]}catch(t){}return()=>V("randomDevice")}());for(var a=0;a<r;a++)S[e+a>>0>>>0]=t.Mb();return 0},ea:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},fa:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},J:function(t){var e=At();try{return at(t)()}catch(t){if(St(e),t!==t+0)throw t;Ot(1,0)}},e:function(t,e){var n=At();try{return at(t)(e)}catch(t){if(St(n),t!==t+0)throw t;Ot(1,0)}},N:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},O:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},j:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},o:function(t,e,n,r){var a=At();try{return at(t)(e,n,r)}catch(t){if(St(a),t!==t+0)throw t;Ot(1,0)}},p:function(t,e,n,r,a){var i=At();try{return at(t)(e,n,r,a)}catch(t){if(St(i),t!==t+0)throw t;Ot(1,0)}},M:function(t,e,n,r,a,i){var o=At();try{return at(t)(e,n,r,a,i)}catch(t){if(St(o),t!==t+0)throw t;Ot(1,0)}},r:function(t,e,n,r,a,i){var o=At();try{return at(t)(e,n,r,a,i)}catch(t){if(St(o),t!==t+0)throw t;Ot(1,0)}},v:function(t,e,n,r,a,i,o){var u=At();try{return at(t)(e,n,r,a,i,o)}catch(t){if(St(u),t!==t+0)throw t;Ot(1,0)}},K:function(t,e,n,r,a,i,o,u){var c=At();try{return at(t)(e,n,r,a,i,o,u)}catch(t){if(St(c),t!==t+0)throw t;Ot(1,0)}},D:function(t,e,n,r,a,i,o,u,c,s,l,f){var p=At();try{return at(t)(e,n,r,a,i,o,u,c,s,l,f)}catch(t){if(St(p),t!==t+0)throw t;Ot(1,0)}},X:function(t,e,n,r,a,i,o,u){var c=At();try{return Ft(t,e,n,r,a,i,o,u)}catch(t){if(St(c),t!==t+0)throw t;Ot(1,0)}},V:function(t,e,n,r,a,i,o){var u=At();try{return xt(t,e,n,r,a,i,o)}catch(t){if(St(u),t!==t+0)throw t;Ot(1,0)}},U:function(t,e,n,r,a){var i=At();try{return It(t,e,n,r,a)}catch(t){if(St(i),t!==t+0)throw t;Ot(1,0)}},Z:function(t,e,n,r){var a=At();try{return Pt(t,e,n,r)}catch(t){if(St(a),t!==t+0)throw t;Ot(1,0)}},W:function(t){var e=At();try{return Ct(t)}catch(t){if(St(e),t!==t+0)throw t;Ot(1,0)}},Y:function(t,e){var n=At();try{return Ut(t,e)}catch(t){if(St(n),t!==t+0)throw t;Ot(1,0)}},T:function(t,e,n){var r=At();try{return Rt(t,e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},f:function(t){var e=At();try{at(t)()}catch(t){if(St(e),t!==t+0)throw t;Ot(1,0)}},q:function(t,e){var n=At();try{at(t)(e)}catch(t){if(St(n),t!==t+0)throw t;Ot(1,0)}},h:function(t,e,n){var r=At();try{at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},da:function(t,e,n,r){var a=At();try{at(t)(e,n,r)}catch(t){if(St(a),t!==t+0)throw t;Ot(1,0)}},l:function(t,e,n,r){var a=At();try{at(t)(e,n,r)}catch(t){if(St(a),t!==t+0)throw t;Ot(1,0)}},t:function(t,e,n,r,a){var i=At();try{at(t)(e,n,r,a)}catch(t){if(St(i),t!==t+0)throw t;Ot(1,0)}},u:function(t,e,n,r,a,i){var o=At();try{at(t)(e,n,r,a,i)}catch(t){if(St(o),t!==t+0)throw t;Ot(1,0)}},x:function(t,e,n,r,a,i,o){var u=At();try{at(t)(e,n,r,a,i,o)}catch(t){if(St(u),t!==t+0)throw t;Ot(1,0)}},z:function(t,e,n,r,a,i,o,u){var c=At();try{at(t)(e,n,r,a,i,o,u)}catch(t){if(St(c),t!==t+0)throw t;Ot(1,0)}},ga:function(t,e,n,r,a,i,o,u,c){var s=At();try{at(t)(e,n,r,a,i,o,u,c)}catch(t){if(St(s),t!==t+0)throw t;Ot(1,0)}},A:function(t,e,n,r,a,i,o,u,c,s,l){var f=At();try{at(t)(e,n,r,a,i,o,u,c,s,l)}catch(t){if(St(f),t!==t+0)throw t;Ot(1,0)}},C:function(t,e,n,r,a,i,o,u,c,s,l,f,p,h,d,y){var b=At();try{at(t)(e,n,r,a,i,o,u,c,s,l,f,p,h,d,y)}catch(t){if(St(b),t!==t+0)throw t;Ot(1,0)}},aa:function(t,e,n,r,a,i,o,u){var c=At();try{jt(t,e,n,r,a,i,o,u)}catch(t){if(St(c),t!==t+0)throw t;Ot(1,0)}},_:function(t,e,n,r,a,i,o,u,c,s,l,f){var p=At();try{Dt(t,e,n,r,a,i,o,u,c,s,l,f)}catch(t){if(St(p),t!==t+0)throw t;Ot(1,0)}},$:function(t,e,n,r,a,i){var o=At();try{kt(t,e,n,r,a,i)}catch(t){if(St(o),t!==t+0)throw t;Ot(1,0)}},n:function(t){return t},F:function(t){ft=t},ha:yt,y:function(t,e,n,r){return yt(t,e,n,r)}};!function(){function t(t){e.asm=t.exports,O=e.asm.Ka,P(),U=e.asm.ib,I.unshift(e.asm.La),B--,e.monitorRunDependencies&&e.monitorRunDependencies(B),0==B&&(null!==G&&(clearInterval(G),G=null),N&&(t=N,N=null,t()))}function n(e){t(e.instance)}function r(t){return function(){if(!g&&(d||y)){if("function"==typeof fetch&&!Y.startsWith("file://"))return fetch(Y,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at \'"+Y+"\'";return t.arrayBuffer()})).catch((function(){return X()}));if(o)return new Promise((function(t,e){o(Y,(function(e){t(new Uint8Array(e))}),e)}))}return Promise.resolve().then((function(){return X()}))}().then((function(t){return WebAssembly.instantiate(t,i)})).then((function(t){return t})).then(t,(function(t){w("failed to asynchronously prepare wasm: "+t),V(t)}))}var i={a:bt};if(B++,e.monitorRunDependencies&&e.monitorRunDependencies(B),e.instantiateWasm)try{return e.instantiateWasm(i,t)}catch(t){return w("Module.instantiateWasm callback failed with error: "+t),!1}(g||"function"!=typeof WebAssembly.instantiateStreaming||$()||Y.startsWith("file://")||b||"function"!=typeof fetch?r(n):fetch(Y,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,i).then(n,(function(t){return w("wasm streaming compile failed: "+t),w("falling back to ArrayBuffer instantiation"),r(n)}))}))).catch(a)}(),e.___wasm_call_ctors=function(){return(e.___wasm_call_ctors=e.asm.La).apply(null,arguments)},e._OrtInit=function(){return(e._OrtInit=e.asm.Ma).apply(null,arguments)},e._OrtCreateSessionOptions=function(){return(e._OrtCreateSessionOptions=e.asm.Na).apply(null,arguments)},e._OrtAppendExecutionProvider=function(){return(e._OrtAppendExecutionProvider=e.asm.Oa).apply(null,arguments)},e._OrtAddSessionConfigEntry=function(){return(e._OrtAddSessionConfigEntry=e.asm.Pa).apply(null,arguments)},e._OrtReleaseSessionOptions=function(){return(e._OrtReleaseSessionOptions=e.asm.Qa).apply(null,arguments)},e._OrtCreateSession=function(){return(e._OrtCreateSession=e.asm.Ra).apply(null,arguments)},e._OrtReleaseSession=function(){return(e._OrtReleaseSession=e.asm.Sa).apply(null,arguments)},e._OrtGetInputCount=function(){return(e._OrtGetInputCount=e.asm.Ta).apply(null,arguments)},e._OrtGetOutputCount=function(){return(e._OrtGetOutputCount=e.asm.Ua).apply(null,arguments)},e._OrtGetInputName=function(){return(e._OrtGetInputName=e.asm.Va).apply(null,arguments)},e._OrtGetOutputName=function(){return(e._OrtGetOutputName=e.asm.Wa).apply(null,arguments)},e._OrtFree=function(){return(e._OrtFree=e.asm.Xa).apply(null,arguments)},e._OrtCreateTensor=function(){return(e._OrtCreateTensor=e.asm.Ya).apply(null,arguments)},e._OrtGetTensorData=function(){return(e._OrtGetTensorData=e.asm.Za).apply(null,arguments)},e._OrtReleaseTensor=function(){return(e._OrtReleaseTensor=e.asm._a).apply(null,arguments)},e._OrtCreateRunOptions=function(){return(e._OrtCreateRunOptions=e.asm.$a).apply(null,arguments)},e._OrtAddRunConfigEntry=function(){return(e._OrtAddRunConfigEntry=e.asm.ab).apply(null,arguments)},e._OrtReleaseRunOptions=function(){return(e._OrtReleaseRunOptions=e.asm.bb).apply(null,arguments)},e._OrtRun=function(){return(e._OrtRun=e.asm.cb).apply(null,arguments)},e._OrtEndProfiling=function(){return(e._OrtEndProfiling=e.asm.db).apply(null,arguments)};var mt,gt=e._malloc=function(){return(gt=e._malloc=e.asm.eb).apply(null,arguments)},vt=e._free=function(){return(vt=e._free=e.asm.fb).apply(null,arguments)},wt=e._fflush=function(){return(wt=e._fflush=e.asm.gb).apply(null,arguments)},_t=e.___funcs_on_exit=function(){return(_t=e.___funcs_on_exit=e.asm.hb).apply(null,arguments)},Ot=e._setThrew=function(){return(Ot=e._setThrew=e.asm.jb).apply(null,arguments)},At=e.stackSave=function(){return(At=e.stackSave=e.asm.kb).apply(null,arguments)},St=e.stackRestore=function(){return(St=e.stackRestore=e.asm.lb).apply(null,arguments)},Tt=e.stackAlloc=function(){return(Tt=e.stackAlloc=e.asm.mb).apply(null,arguments)},Et=e.___cxa_can_catch=function(){return(Et=e.___cxa_can_catch=e.asm.nb).apply(null,arguments)},Mt=e.___cxa_is_pointer_type=function(){return(Mt=e.___cxa_is_pointer_type=e.asm.ob).apply(null,arguments)},Ct=e.dynCall_j=function(){return(Ct=e.dynCall_j=e.asm.pb).apply(null,arguments)},xt=e.dynCall_iiiiij=function(){return(xt=e.dynCall_iiiiij=e.asm.qb).apply(null,arguments)},Rt=e.dynCall_jii=function(){return(Rt=e.dynCall_jii=e.asm.rb).apply(null,arguments)},jt=e.dynCall_viiiiij=function(){return(jt=e.dynCall_viiiiij=e.asm.sb).apply(null,arguments)},kt=e.dynCall_vjji=function(){return(kt=e.dynCall_vjji=e.asm.tb).apply(null,arguments)},Dt=e.dynCall_viiijjjii=function(){return(Dt=e.dynCall_viiijjjii=e.asm.ub).apply(null,arguments)},Pt=e.dynCall_iij=function(){return(Pt=e.dynCall_iij=e.asm.vb).apply(null,arguments)},Ut=e.dynCall_ji=function(){return(Ut=e.dynCall_ji=e.asm.wb).apply(null,arguments)},Ft=e.dynCall_iiiiiij=function(){return(Ft=e.dynCall_iiiiiij=e.asm.xb).apply(null,arguments)},It=e.dynCall_iiij=function(){return(It=e.dynCall_iiij=e.asm.yb).apply(null,arguments)};function Wt(){function t(){if(!mt&&(mt=!0,e.calledRun=!0,!C)){if(Z(I),r(e),e.onRuntimeInitialized&&e.onRuntimeInitialized(),e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;){var t=e.postRun.shift();H.unshift(t)}Z(H)}}if(!(0<B)){if(e.preRun)for("function"==typeof e.preRun&&(e.preRun=[e.preRun]);e.preRun.length;)z();Z(F),0<B||(e.setStatus?(e.setStatus("Running..."),setTimeout((function(){setTimeout((function(){e.setStatus("")}),1),t()}),1)):t())}}if(e.UTF8ToString=j,e.stringToUTF8=function(t,e,n){return k(t,T,e,n)},e.lengthBytesUTF8=D,e.stackSave=At,e.stackRestore=St,e.stackAlloc=Tt,N=function t(){mt||Wt(),mt||(N=t)},e.preInit)for("function"==typeof e.preInit&&(e.preInit=[e.preInit]);0<e.preInit.length;)e.preInit.pop()();return Wt(),t.ready});t.exports=r},967:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.iterateExtraOptions=void 0,e.iterateExtraOptions=(t,n,r,a)=>{if("object"==typeof t&&null!==t){if(r.has(t))throw new Error("Circular reference in options");r.add(t)}Object.entries(t).forEach((([t,i])=>{const o=n?n+t:t;if("object"==typeof i)(0,e.iterateExtraOptions)(i,o+".",r,a);else if("string"==typeof i||"number"==typeof i)a(o,i.toString());else{if("boolean"!=typeof i)throw new Error("Can\'t handle extra config type: "+typeof i);a(o,i?"1":"0")}}))}},586:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setRunOptions=void 0;const r=n(967),a=n(983),i=n(361);e.setRunOptions=t=>{const e=(0,i.getInstance)();let n=0;const o=[],u=t||{};try{if(void 0===(null==t?void 0:t.logSeverityLevel))u.logSeverityLevel=2;else if("number"!=typeof t.logSeverityLevel||!Number.isInteger(t.logSeverityLevel)||t.logSeverityLevel<0||t.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${t.logSeverityLevel}`);if(void 0===(null==t?void 0:t.logVerbosityLevel))u.logVerbosityLevel=0;else if("number"!=typeof t.logVerbosityLevel||!Number.isInteger(t.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${t.logVerbosityLevel}`);void 0===(null==t?void 0:t.terminate)&&(u.terminate=!1);let i=0;if(void 0!==(null==t?void 0:t.tag)&&(i=(0,a.allocWasmString)(t.tag,o)),n=e._OrtCreateRunOptions(u.logSeverityLevel,u.logVerbosityLevel,!!u.terminate,i),0===n)throw new Error("Can\'t create run options");return void 0!==(null==t?void 0:t.extra)&&(0,r.iterateExtraOptions)(t.extra,"",new WeakSet,((t,r)=>{const i=(0,a.allocWasmString)(t,o),u=(0,a.allocWasmString)(r,o);if(0!==e._OrtAddRunConfigEntry(n,i,u))throw new Error(`Can\'t set a run config entry: ${t} - ${r}`)})),[n,o]}catch(t){throw 0!==n&&e._OrtReleaseRunOptions(n),o.forEach(e._free),t}}},919:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setSessionOptions=void 0;const r=n(967),a=n(983),i=n(361);e.setSessionOptions=t=>{const e=(0,i.getInstance)();let n=0;const o=[],u=t||{};(t=>{t.extra||(t.extra={}),t.extra.session||(t.extra.session={});const e=t.extra.session;e.use_ort_model_bytes_directly||(e.use_ort_model_bytes_directly="1")})(u);try{void 0===(null==t?void 0:t.graphOptimizationLevel)&&(u.graphOptimizationLevel="all");const c=(t=>{switch(t){case"disabled":return 0;case"basic":return 1;case"extended":return 2;case"all":return 99;default:throw new Error(`unsupported graph optimization level: ${t}`)}})(u.graphOptimizationLevel);void 0===(null==t?void 0:t.enableCpuMemArena)&&(u.enableCpuMemArena=!0),void 0===(null==t?void 0:t.enableMemPattern)&&(u.enableMemPattern=!0),void 0===(null==t?void 0:t.executionMode)&&(u.executionMode="sequential");const s=(t=>{switch(t){case"sequential":return 0;case"parallel":return 1;default:throw new Error(`unsupported execution mode: ${t}`)}})(u.executionMode);let l=0;if(void 0!==(null==t?void 0:t.logId)&&(l=(0,a.allocWasmString)(t.logId,o)),void 0===(null==t?void 0:t.logSeverityLevel))u.logSeverityLevel=2;else if("number"!=typeof t.logSeverityLevel||!Number.isInteger(t.logSeverityLevel)||t.logSeverityLevel<0||t.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${t.logSeverityLevel}`);if(void 0===(null==t?void 0:t.logVerbosityLevel))u.logVerbosityLevel=0;else if("number"!=typeof t.logVerbosityLevel||!Number.isInteger(t.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${t.logVerbosityLevel}`);if(void 0===(null==t?void 0:t.enableProfiling)&&(u.enableProfiling=!1),n=e._OrtCreateSessionOptions(c,!!u.enableCpuMemArena,!!u.enableMemPattern,s,!!u.enableProfiling,0,l,u.logSeverityLevel,u.logVerbosityLevel),0===n)throw new Error("Can\'t create session options");return(null==t?void 0:t.executionProviders)&&((t,e,n)=>{for(const r of e){let e="string"==typeof r?r:r.name;switch(e){case"xnnpack":e="XNNPACK";break;case"wasm":case"cpu":continue;default:throw new Error(`not supported EP: ${e}`)}const o=(0,a.allocWasmString)(e,n);if(0!==(0,i.getInstance)()._OrtAppendExecutionProvider(t,o))throw new Error(`Can\'t append execution provider: ${e}`)}})(n,t.executionProviders,o),void 0!==(null==t?void 0:t.extra)&&(0,r.iterateExtraOptions)(t.extra,"",new WeakSet,((t,r)=>{const i=(0,a.allocWasmString)(t,o),u=(0,a.allocWasmString)(r,o);if(0!==e._OrtAddSessionConfigEntry(n,i,u))throw new Error(`Can\'t set a session config entry: ${t} - ${r}`)})),[n,o]}catch(t){throw 0!==n&&e._OrtReleaseSessionOptions(n),o.forEach(e._free),t}}},983:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.allocWasmString=void 0;const r=n(361);e.allocWasmString=(t,e)=>{const n=(0,r.getInstance)(),a=n.lengthBytesUTF8(t)+1,i=n._malloc(a);return n.stringToUTF8(t,i,a),e.push(i),i}},349:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.extractTransferableBuffers=e.endProfiling=e.run=e.releaseSession=e.createSession=e.createSessionFinalize=e.createSessionAllocate=e.initOrt=void 0;const r=n(586),a=n(919),i=n(983),o=n(361);e.initOrt=(t,e)=>{const n=(0,o.getInstance)()._OrtInit(t,e);if(0!==n)throw new Error(`Can\'t initialize onnxruntime. error code = ${n}`)};const u=new Map;e.createSessionAllocate=t=>{const e=(0,o.getInstance)(),n=e._malloc(t.byteLength);return e.HEAPU8.set(t,n),[n,t.byteLength]},e.createSessionFinalize=(t,e)=>{const n=(0,o.getInstance)();let r=0,i=0,c=[];try{if([i,c]=(0,a.setSessionOptions)(e),r=n._OrtCreateSession(t[0],t[1],i),0===r)throw new Error("Can\'t create a session")}finally{n._free(t[0]),n._OrtReleaseSessionOptions(i),c.forEach(n._free)}const s=n._OrtGetInputCount(r),l=n._OrtGetOutputCount(r),f=[],p=[],h=[],d=[];for(let t=0;t<s;t++){const e=n._OrtGetInputName(r,t);if(0===e)throw new Error("Can\'t get an input name");p.push(e),f.push(n.UTF8ToString(e))}for(let t=0;t<l;t++){const e=n._OrtGetOutputName(r,t);if(0===e)throw new Error("Can\'t get an output name");d.push(e),h.push(n.UTF8ToString(e))}return u.set(r,[r,p,d]),[r,f,h]},e.createSession=(t,n)=>{const r=(0,e.createSessionAllocate)(t);return(0,e.createSessionFinalize)(r,n)},e.releaseSession=t=>{const e=(0,o.getInstance)(),n=u.get(t);if(!n)throw new Error("invalid session id");const r=n[0],a=n[1],i=n[2];a.forEach(e._OrtFree),i.forEach(e._OrtFree),e._OrtReleaseSession(r),u.delete(t)};const c=t=>{switch(t){case"int8":return 3;case"uint8":return 2;case"bool":return 9;case"int16":return 5;case"uint16":return 4;case"int32":return 6;case"uint32":return 12;case"float32":return 1;case"float64":return 11;case"string":return 8;case"int64":return 7;case"uint64":return 13;default:throw new Error(`unsupported data type: ${t}`)}},s=t=>{switch(t){case 3:return"int8";case 2:return"uint8";case 9:return"bool";case 5:return"int16";case 4:return"uint16";case 6:return"int32";case 12:return"uint32";case 1:return"float32";case 11:return"float64";case 8:return"string";case 7:return"int64";case 13:return"uint64";default:throw new Error(`unsupported data type: ${t}`)}},l=t=>{switch(t){case"float32":return Float32Array;case"uint8":case"bool":return Uint8Array;case"int8":return Int8Array;case"uint16":return Uint16Array;case"int16":return Int16Array;case"int32":return Int32Array;case"float64":return Float64Array;case"uint32":return Uint32Array;case"int64":return BigInt64Array;case"uint64":return BigUint64Array;default:throw new Error(`unsupported type: ${t}`)}};e.run=(t,e,n,a,f)=>{const p=(0,o.getInstance)(),h=u.get(t);if(!h)throw new Error("invalid session id");const d=h[0],y=h[1],b=h[2],m=e.length,g=a.length;let v=0,w=[];const _=[],O=[];try{[v,w]=(0,r.setRunOptions)(f);for(let t=0;t<m;t++){const e=n[t][0],r=n[t][1],a=n[t][2];let o,u;if(Array.isArray(a)){u=4*a.length,o=p._malloc(u),O.push(o);let t=o/4;for(let e=0;e<a.length;e++){if("string"!=typeof a[e])throw new TypeError(`tensor data at index ${e} is not a string`);p.HEAPU32[t++]=(0,i.allocWasmString)(a[e],O)}}else u=a.byteLength,o=p._malloc(u),O.push(o),p.HEAPU8.set(new Uint8Array(a.buffer,a.byteOffset,u),o);const s=p.stackSave(),l=p.stackAlloc(4*r.length);try{let t=l/4;r.forEach((e=>p.HEAP32[t++]=e));const n=p._OrtCreateTensor(c(e),o,u,l,r.length);if(0===n)throw new Error("Can\'t create a tensor");_.push(n)}finally{p.stackRestore(s)}}const t=p.stackSave(),o=p.stackAlloc(4*m),u=p.stackAlloc(4*m),h=p.stackAlloc(4*g),A=p.stackAlloc(4*g);try{let n=o/4,r=u/4,i=h/4,c=A/4;for(let t=0;t<m;t++)p.HEAPU32[n++]=_[t],p.HEAPU32[r++]=y[e[t]];for(let t=0;t<g;t++)p.HEAPU32[i++]=0,p.HEAPU32[c++]=b[a[t]];let f=p._OrtRun(d,u,o,m,A,g,h,v);const w=[];if(0===f)for(let t=0;t<g;t++){const e=p.HEAPU32[h/4+t],n=p.stackSave(),r=p.stackAlloc(16);let a,i=0;try{if(f=p._OrtGetTensorData(e,r,r+4,r+8,r+12),0!==f)throw new Error(`Can\'t access output tensor data. error code = ${f}`);let t=r/4;const o=p.HEAPU32[t++];i=p.HEAPU32[t++];const u=p.HEAPU32[t++],c=p.HEAPU32[t++],h=[];for(let t=0;t<c;t++)h.push(p.HEAPU32[u/4+t]);p._OrtFree(u);const d=0===h.length?1:h.reduce(((t,e)=>t*e));if(a=s(o),"string"===a){const t=[];let e=i/4;for(let n=0;n<d;n++){const r=p.HEAPU32[e++],a=n===d-1?void 0:p.HEAPU32[e]-r;t.push(p.UTF8ToString(r,a))}w.push([a,h,t])}else{const t=new(l(a))(d);new Uint8Array(t.buffer,t.byteOffset,t.byteLength).set(p.HEAPU8.subarray(i,i+t.byteLength)),w.push([a,h,t])}}finally{p.stackRestore(n),"string"===a&&i&&p._free(i),p._OrtReleaseTensor(e)}}if(0===f)return w;throw new Error(`failed to call OrtRun(). error code = ${f}.`)}finally{p.stackRestore(t)}}finally{_.forEach(p._OrtReleaseTensor),O.forEach(p._free),p._OrtReleaseRunOptions(v),w.forEach(p._free)}},e.endProfiling=t=>{const e=(0,o.getInstance)(),n=u.get(t);if(!n)throw new Error("invalid session id");const r=n[0],a=e._OrtEndProfiling(r);if(0===a)throw new Error("Can\'t get an profile file name");e._OrtFree(a)},e.extractTransferableBuffers=t=>{const e=[];for(const n of t){const t=n[2];!Array.isArray(t)&&t.buffer&&e.push(t.buffer)}return e}},361:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var a=Object.getOwnPropertyDescriptor(e,n);a&&!("get"in a?!e.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,a)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),a=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&r(e,t,n);return a(e,t),e},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.dispose=e.getInstance=e.initializeWebAssembly=void 0;const u=i(n(449)),c=o(n(932)),s=n(474);let l,f=!1,p=!1,h=!1;const d=(t,e)=>e?t?"ort-wasm-simd-threaded.wasm":"ort-wasm-threaded.wasm":t?"ort-wasm-simd.wasm":"ort-wasm.wasm";e.initializeWebAssembly=async t=>{if(f)return Promise.resolve();if(p)throw new Error("multiple calls to \'initializeWebAssembly()\' detected.");if(h)throw new Error("previous call to \'initializeWebAssembly()\' failed.");p=!0;const e=t.initTimeout,r=t.numThreads,a=t.simd,i=r>1&&(()=>{try{return"undefined"!=typeof SharedArrayBuffer&&("undefined"!=typeof MessageChannel&&(new MessageChannel).port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11])))}catch(t){return!1}})(),o=a&&(()=>{try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,30,1,28,0,65,0,253,15,253,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,253,186,1,26,11]))}catch(t){return!1}})(),y="string"==typeof t.wasmPaths?t.wasmPaths:void 0,b=d(!1,i),m=d(o,i),g="object"==typeof t.wasmPaths?t.wasmPaths[m]:void 0;let v=!1;const w=[];if(e>0&&w.push(new Promise((t=>{setTimeout((()=>{v=!0,t()}),e)}))),w.push(new Promise(((t,e)=>{const r=i?s:c.default,a={locateFile:(t,e)=>i&&t.endsWith(".worker.js")&&"undefined"!=typeof Blob?URL.createObjectURL(new Blob([n(154)],{type:"text/javascript"})):t===b?null!=g?g:(null!=y?y:e)+m:e+t};if(i)if("undefined"==typeof Blob)a.mainScriptUrlOrBlob=u.join("/","ort-wasm-threaded.js");else{const t=`var ortWasmThreaded=(function(){var _scriptDir;return ${r.toString()}})();`;a.mainScriptUrlOrBlob=new Blob([t],{type:"text/javascript"})}r(a).then((e=>{p=!1,f=!0,l=e,t()}),(t=>{p=!1,h=!0,e(t)}))}))),await Promise.race(w),v)throw new Error(`WebAssembly backend initializing failed due to timeout: ${e}ms`)},e.getInstance=()=>{if(f&&l)return l;throw new Error("WebAssembly is not initialized yet.")},e.dispose=()=>{var t;!f||p||h||(p=!0,null===(t=l.PThread)||void 0===t||t.terminateAllThreads(),l=void 0,p=!1,f=!1,h=!0)}},154:t=>{"use strict";t.exports=\'"use strict";var e={},t="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node;if(t){var r=require("worker_threads"),a=r.parentPort;a.on("message",(e=>onmessage({data:e})));var o=require("fs");Object.assign(global,{self:global,require:require,Module:e,location:{href:__filename},Worker:r.Worker,importScripts:function(e){(0,eval)(o.readFileSync(e,"utf8"))},postMessage:function(e){a.postMessage(e)},performance:global.performance||{now:function(){return Date.now()}}})}var s=!1,n=[],i=function(){var e=Array.prototype.slice.call(arguments).join(" ");t?o.writeSync(2,e+"\\\\n"):console.error(e)};self.alert=function(){var t=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:t,threadId:e._pthread_self()})},e.instantiateWasm=(t,r)=>{var a=new WebAssembly.Instance(e.wasmModule,t);return r(a),e.wasmModule=null,a.exports},self.onunhandledrejection=e=>{throw e.reason??e},self.onmessage=t=>{try{if("load"===t.data.cmd){if(e.wasmModule=t.data.wasmModule,e.wasmMemory=t.data.wasmMemory,e.buffer=e.wasmMemory.buffer,e.ENVIRONMENT_IS_PTHREAD=!0,"string"==typeof t.data.urlOrBlob)importScripts(t.data.urlOrBlob);else{var r=URL.createObjectURL(t.data.urlOrBlob);importScripts(r),URL.revokeObjectURL(r)}ortWasmThreaded(e).then((function(t){e=t}))}else if("run"===t.data.cmd){e.__performance_now_clock_drift=performance.now()-t.data.time,e.__emscripten_thread_init(t.data.pthread_ptr,0,0,1),e.establishStackSpace(),e.PThread.receiveObjectTransfer(t.data),e.PThread.threadInitTLS(),s||(n.forEach((t=>{e.executeNotifiedProxyingQueue(t)})),n=[],s=!0);try{e.invokeEntryPoint(t.data.start_routine,t.data.arg)}catch(t){if("unwind"!=t){if(!(t instanceof e.ExitStatus))throw t;e.keepRuntimeAlive()||e.__emscripten_thread_exit(t.status)}}}else"cancel"===t.data.cmd?e._pthread_self()&&e.__emscripten_thread_exit(-1):"setimmediate"===t.data.target||("processProxyingQueue"===t.data.cmd?s?e.executeNotifiedProxyingQueue(t.data.queue):n.push(t.data.queue):(i("worker.js received unknown command "+t.data.cmd),i(t.data)))}catch(t){throw i("worker.js onmessage() captured an uncaught exception: "+t),t&&t.stack&&i(t.stack),e.__emscripten_thread_crashed&&e.__emscripten_thread_crashed(),t}};\\n\'},384:()=>{},993:()=>{},908:()=>{},953:()=>{},925:()=>{},449:()=>{}},e={};function n(r){var a=e[r];if(void 0!==a)return a.exports;var i=e[r]={exports:{}};return t[r].call(i.exports,i,i.exports,n),i.exports}n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),(()=>{"use strict";const t=n(349),e=n(361);self.onmessage=n=>{switch(n.data.type){case"init-wasm":(0,e.initializeWebAssembly)(n.data.in).then((()=>postMessage({type:"init-wasm"})),(t=>postMessage({type:"init-wasm",err:t})));break;case"init-ort":try{const{numThreads:e,loggingLevel:r}=n.data.in;(0,t.initOrt)(e,r),postMessage({type:"init-ort"})}catch(t){postMessage({type:"init-ort",err:t})}break;case"create_allocate":try{const{model:e}=n.data.in,r=(0,t.createSessionAllocate)(e);postMessage({type:"create_allocate",out:r})}catch(t){postMessage({type:"create_allocate",err:t})}break;case"create_finalize":try{const{modeldata:e,options:r}=n.data.in,a=(0,t.createSessionFinalize)(e,r);postMessage({type:"create_finalize",out:a})}catch(t){postMessage({type:"create_finalize",err:t})}break;case"create":try{const{model:e,options:r}=n.data.in,a=(0,t.createSession)(e,r);postMessage({type:"create",out:a})}catch(t){postMessage({type:"create",err:t})}break;case"release":try{const e=n.data.in;(0,t.releaseSession)(e),postMessage({type:"release"})}catch(t){postMessage({type:"release",err:t})}break;case"run":try{const{sessionId:e,inputIndices:r,inputs:a,outputIndices:i,options:o}=n.data.in,u=(0,t.run)(e,r,a,i,o);postMessage({type:"run",out:u},(0,t.extractTransferableBuffers)(u))}catch(t){postMessage({type:"run",err:t})}break;case"end-profiling":try{const e=n.data.in;(0,t.endProfiling)(e),postMessage({type:"end-profiling"})}catch(t){postMessage({type:"end-profiling",err:t})}}}})()})();\n',"Worker",void 0,void 0)}},477:i=>{i.exports=function(e,s,c,h){var $=self||window;try{try{var _;try{_=new $.Blob([e])}catch{(_=new($.BlobBuilder||$.WebKitBlobBuilder||$.MozBlobBuilder||$.MSBlobBuilder)).append(e),_=_.getBlob()}var j=$.URL||$.webkitURL,nt=j.createObjectURL(_),et=new $[s](nt,c);return j.revokeObjectURL(nt),et}catch{return new $[s]("data:application/javascript,".concat(encodeURIComponent(e)),c)}}catch{if(!h)throw Error("Inline worker is not supported");return new $[s](h,c)}}},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}};
|
|
1851
|
+
`},1670:i=>{i.exports=__WEBPACK_EXTERNAL_MODULE__1670__},7067:()=>{},1296:()=>{},1384:()=>{},3993:()=>{},908:()=>{},6953:()=>{},9925:()=>{},2806:()=>{},6449:()=>{},2850:()=>{},5381:()=>{},5686:(i,e,s)=>{s.r(e),s.d(e,{flatbuffers:()=>c});var c={};c.Offset,c.Table,c.SIZEOF_SHORT=2,c.SIZEOF_INT=4,c.FILE_IDENTIFIER_LENGTH=4,c.SIZE_PREFIX_LENGTH=4,c.Encoding={UTF8_BYTES:1,UTF16_STRING:2},c.int32=new Int32Array(2),c.float32=new Float32Array(c.int32.buffer),c.float64=new Float64Array(c.int32.buffer),c.isLittleEndian=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1,c.Long=function(h,$){this.low=0|h,this.high=0|$},c.Long.create=function(h,$){return h==0&&$==0?c.Long.ZERO:new c.Long(h,$)},c.Long.prototype.toFloat64=function(){return(this.low>>>0)+4294967296*this.high},c.Long.prototype.equals=function(h){return this.low==h.low&&this.high==h.high},c.Long.ZERO=new c.Long(0,0),c.Builder=function(h){if(h)$=h;else var $=1024;this.bb=c.ByteBuffer.allocate($),this.space=$,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},c.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},c.Builder.prototype.forceDefaults=function(h){this.force_defaults=h},c.Builder.prototype.dataBuffer=function(){return this.bb},c.Builder.prototype.asUint8Array=function(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())},c.Builder.prototype.prep=function(h,$){h>this.minalign&&(this.minalign=h);for(var _=1+~(this.bb.capacity()-this.space+$)&h-1;this.space<_+h+$;){var j=this.bb.capacity();this.bb=c.Builder.growByteBuffer(this.bb),this.space+=this.bb.capacity()-j}this.pad(_)},c.Builder.prototype.pad=function(h){for(var $=0;$<h;$++)this.bb.writeInt8(--this.space,0)},c.Builder.prototype.writeInt8=function(h){this.bb.writeInt8(this.space-=1,h)},c.Builder.prototype.writeInt16=function(h){this.bb.writeInt16(this.space-=2,h)},c.Builder.prototype.writeInt32=function(h){this.bb.writeInt32(this.space-=4,h)},c.Builder.prototype.writeInt64=function(h){this.bb.writeInt64(this.space-=8,h)},c.Builder.prototype.writeFloat32=function(h){this.bb.writeFloat32(this.space-=4,h)},c.Builder.prototype.writeFloat64=function(h){this.bb.writeFloat64(this.space-=8,h)},c.Builder.prototype.addInt8=function(h){this.prep(1,0),this.writeInt8(h)},c.Builder.prototype.addInt16=function(h){this.prep(2,0),this.writeInt16(h)},c.Builder.prototype.addInt32=function(h){this.prep(4,0),this.writeInt32(h)},c.Builder.prototype.addInt64=function(h){this.prep(8,0),this.writeInt64(h)},c.Builder.prototype.addFloat32=function(h){this.prep(4,0),this.writeFloat32(h)},c.Builder.prototype.addFloat64=function(h){this.prep(8,0),this.writeFloat64(h)},c.Builder.prototype.addFieldInt8=function(h,$,_){(this.force_defaults||$!=_)&&(this.addInt8($),this.slot(h))},c.Builder.prototype.addFieldInt16=function(h,$,_){(this.force_defaults||$!=_)&&(this.addInt16($),this.slot(h))},c.Builder.prototype.addFieldInt32=function(h,$,_){(this.force_defaults||$!=_)&&(this.addInt32($),this.slot(h))},c.Builder.prototype.addFieldInt64=function(h,$,_){!this.force_defaults&&$.equals(_)||(this.addInt64($),this.slot(h))},c.Builder.prototype.addFieldFloat32=function(h,$,_){(this.force_defaults||$!=_)&&(this.addFloat32($),this.slot(h))},c.Builder.prototype.addFieldFloat64=function(h,$,_){(this.force_defaults||$!=_)&&(this.addFloat64($),this.slot(h))},c.Builder.prototype.addFieldOffset=function(h,$,_){(this.force_defaults||$!=_)&&(this.addOffset($),this.slot(h))},c.Builder.prototype.addFieldStruct=function(h,$,_){$!=_&&(this.nested($),this.slot(h))},c.Builder.prototype.nested=function(h){if(h!=this.offset())throw new Error("FlatBuffers: struct must be serialized inline.")},c.Builder.prototype.notNested=function(){if(this.isNested)throw new Error("FlatBuffers: object serialization must not be nested.")},c.Builder.prototype.slot=function(h){this.vtable[h]=this.offset()},c.Builder.prototype.offset=function(){return this.bb.capacity()-this.space},c.Builder.growByteBuffer=function(h){var $=h.capacity();if(3221225472&$)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");var _=$<<1,j=c.ByteBuffer.allocate(_);return j.setPosition(_-$),j.bytes().set(h.bytes(),_-$),j},c.Builder.prototype.addOffset=function(h){this.prep(c.SIZEOF_INT,0),this.writeInt32(this.offset()-h+c.SIZEOF_INT)},c.Builder.prototype.startObject=function(h){this.notNested(),this.vtable==null&&(this.vtable=[]),this.vtable_in_use=h;for(var $=0;$<h;$++)this.vtable[$]=0;this.isNested=!0,this.object_start=this.offset()},c.Builder.prototype.endObject=function(){if(this.vtable==null||!this.isNested)throw new Error("FlatBuffers: endObject called without startObject");this.addInt32(0);for(var h=this.offset(),$=this.vtable_in_use-1;$>=0&&this.vtable[$]==0;$--);for(var _=$+1;$>=0;$--)this.addInt16(this.vtable[$]!=0?h-this.vtable[$]:0);this.addInt16(h-this.object_start);var j=(_+2)*c.SIZEOF_SHORT;this.addInt16(j);var nt=0,et=this.space;e:for($=0;$<this.vtables.length;$++){var b=this.bb.capacity()-this.vtables[$];if(j==this.bb.readInt16(b)){for(var a=c.SIZEOF_SHORT;a<j;a+=c.SIZEOF_SHORT)if(this.bb.readInt16(et+a)!=this.bb.readInt16(b+a))continue e;nt=this.vtables[$];break}}return nt?(this.space=this.bb.capacity()-h,this.bb.writeInt32(this.space,nt-h)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-h,this.offset()-h)),this.isNested=!1,h},c.Builder.prototype.finish=function(h,$,_){var j=_?c.SIZE_PREFIX_LENGTH:0;if($){var nt=$;if(this.prep(this.minalign,c.SIZEOF_INT+c.FILE_IDENTIFIER_LENGTH+j),nt.length!=c.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+c.FILE_IDENTIFIER_LENGTH);for(var et=c.FILE_IDENTIFIER_LENGTH-1;et>=0;et--)this.writeInt8(nt.charCodeAt(et))}this.prep(this.minalign,c.SIZEOF_INT+j),this.addOffset(h),j&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)},c.Builder.prototype.finishSizePrefixed=function(h,$){this.finish(h,$,!0)},c.Builder.prototype.requiredField=function(h,$){var _=this.bb.capacity()-h,j=_-this.bb.readInt32(_);if(this.bb.readInt16(j+$)==0)throw new Error("FlatBuffers: field "+$+" must be set")},c.Builder.prototype.startVector=function(h,$,_){this.notNested(),this.vector_num_elems=$,this.prep(c.SIZEOF_INT,h*$),this.prep(_,h*$)},c.Builder.prototype.endVector=function(){return this.writeInt32(this.vector_num_elems),this.offset()},c.Builder.prototype.createString=function(h){if(h instanceof Uint8Array)var $=h;else{$=[];for(var _=0;_<h.length;){var j,nt=h.charCodeAt(_++);(j=nt<55296||nt>=56320?nt:(nt<<10)+h.charCodeAt(_++)+-56613888)<128?$.push(j):(j<2048?$.push(j>>6&31|192):(j<65536?$.push(j>>12&15|224):$.push(j>>18&7|240,j>>12&63|128),$.push(j>>6&63|128)),$.push(63&j|128))}}this.addInt8(0),this.startVector(1,$.length,1),this.bb.setPosition(this.space-=$.length),_=0;for(var et=this.space,b=this.bb.bytes();_<$.length;_++)b[et++]=$[_];return this.endVector()},c.Builder.prototype.createLong=function(h,$){return c.Long.create(h,$)},c.ByteBuffer=function(h){this.bytes_=h,this.position_=0},c.ByteBuffer.allocate=function(h){return new c.ByteBuffer(new Uint8Array(h))},c.ByteBuffer.prototype.clear=function(){this.position_=0},c.ByteBuffer.prototype.bytes=function(){return this.bytes_},c.ByteBuffer.prototype.position=function(){return this.position_},c.ByteBuffer.prototype.setPosition=function(h){this.position_=h},c.ByteBuffer.prototype.capacity=function(){return this.bytes_.length},c.ByteBuffer.prototype.readInt8=function(h){return this.readUint8(h)<<24>>24},c.ByteBuffer.prototype.readUint8=function(h){return this.bytes_[h]},c.ByteBuffer.prototype.readInt16=function(h){return this.readUint16(h)<<16>>16},c.ByteBuffer.prototype.readUint16=function(h){return this.bytes_[h]|this.bytes_[h+1]<<8},c.ByteBuffer.prototype.readInt32=function(h){return this.bytes_[h]|this.bytes_[h+1]<<8|this.bytes_[h+2]<<16|this.bytes_[h+3]<<24},c.ByteBuffer.prototype.readUint32=function(h){return this.readInt32(h)>>>0},c.ByteBuffer.prototype.readInt64=function(h){return new c.Long(this.readInt32(h),this.readInt32(h+4))},c.ByteBuffer.prototype.readUint64=function(h){return new c.Long(this.readUint32(h),this.readUint32(h+4))},c.ByteBuffer.prototype.readFloat32=function(h){return c.int32[0]=this.readInt32(h),c.float32[0]},c.ByteBuffer.prototype.readFloat64=function(h){return c.int32[c.isLittleEndian?0:1]=this.readInt32(h),c.int32[c.isLittleEndian?1:0]=this.readInt32(h+4),c.float64[0]},c.ByteBuffer.prototype.writeInt8=function(h,$){this.bytes_[h]=$},c.ByteBuffer.prototype.writeUint8=function(h,$){this.bytes_[h]=$},c.ByteBuffer.prototype.writeInt16=function(h,$){this.bytes_[h]=$,this.bytes_[h+1]=$>>8},c.ByteBuffer.prototype.writeUint16=function(h,$){this.bytes_[h]=$,this.bytes_[h+1]=$>>8},c.ByteBuffer.prototype.writeInt32=function(h,$){this.bytes_[h]=$,this.bytes_[h+1]=$>>8,this.bytes_[h+2]=$>>16,this.bytes_[h+3]=$>>24},c.ByteBuffer.prototype.writeUint32=function(h,$){this.bytes_[h]=$,this.bytes_[h+1]=$>>8,this.bytes_[h+2]=$>>16,this.bytes_[h+3]=$>>24},c.ByteBuffer.prototype.writeInt64=function(h,$){this.writeInt32(h,$.low),this.writeInt32(h+4,$.high)},c.ByteBuffer.prototype.writeUint64=function(h,$){this.writeUint32(h,$.low),this.writeUint32(h+4,$.high)},c.ByteBuffer.prototype.writeFloat32=function(h,$){c.float32[0]=$,this.writeInt32(h,c.int32[0])},c.ByteBuffer.prototype.writeFloat64=function(h,$){c.float64[0]=$,this.writeInt32(h,c.int32[c.isLittleEndian?0:1]),this.writeInt32(h+4,c.int32[c.isLittleEndian?1:0])},c.ByteBuffer.prototype.getBufferIdentifier=function(){if(this.bytes_.length<this.position_+c.SIZEOF_INT+c.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");for(var h="",$=0;$<c.FILE_IDENTIFIER_LENGTH;$++)h+=String.fromCharCode(this.readInt8(this.position_+c.SIZEOF_INT+$));return h},c.ByteBuffer.prototype.__offset=function(h,$){var _=h-this.readInt32(h);return $<this.readInt16(_)?this.readInt16(_+$):0},c.ByteBuffer.prototype.__union=function(h,$){return h.bb_pos=$+this.readInt32($),h.bb=this,h},c.ByteBuffer.prototype.__string=function(h,$){h+=this.readInt32(h);var _=this.readInt32(h),j="",nt=0;if(h+=c.SIZEOF_INT,$===c.Encoding.UTF8_BYTES)return this.bytes_.subarray(h,h+_);for(;nt<_;){var et,b=this.readUint8(h+nt++);if(b<192)et=b;else{var a=this.readUint8(h+nt++);if(b<224)et=(31&b)<<6|63&a;else{var o=this.readUint8(h+nt++);et=b<240?(15&b)<<12|(63&a)<<6|63&o:(7&b)<<18|(63&a)<<12|(63&o)<<6|63&this.readUint8(h+nt++)}}et<65536?j+=String.fromCharCode(et):(et-=65536,j+=String.fromCharCode(55296+(et>>10),56320+(1023&et)))}return j},c.ByteBuffer.prototype.__indirect=function(h){return h+this.readInt32(h)},c.ByteBuffer.prototype.__vector=function(h){return h+this.readInt32(h)+c.SIZEOF_INT},c.ByteBuffer.prototype.__vector_len=function(h){return this.readInt32(h+this.readInt32(h))},c.ByteBuffer.prototype.__has_identifier=function(h){if(h.length!=c.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+c.FILE_IDENTIFIER_LENGTH);for(var $=0;$<c.FILE_IDENTIFIER_LENGTH;$++)if(h.charCodeAt($)!=this.readInt8(this.position_+c.SIZEOF_INT+$))return!1;return!0},c.ByteBuffer.prototype.createLong=function(h,$){return c.Long.create(h,$)}}},__webpack_module_cache__={};function __webpack_require__(i){var e=__webpack_module_cache__[i];if(e!==void 0)return e.exports;var s=__webpack_module_cache__[i]={exports:{}};return __webpack_modules__[i].call(s.exports,s,s.exports,__webpack_require__),s.exports}__webpack_require__.n=i=>{var e=i&&i.__esModule?()=>i.default:()=>i;return __webpack_require__.d(e,{a:e}),e},__webpack_require__.d=(i,e)=>{for(var s in e)__webpack_require__.o(e,s)&&!__webpack_require__.o(i,s)&&Object.defineProperty(i,s,{enumerable:!0,get:e[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,e)=>Object.prototype.hasOwnProperty.call(i,e),__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);var ortWeb_minExports=ortWeb_min.exports,assetPath={};Object.defineProperty(assetPath,"__esModule",{value:!0}),assetPath.baseAssetPath=void 0;const isWeb=typeof window<"u"&&typeof window.document<"u",currentScript=isWeb?window.document.currentScript:null;let basePath="/";currentScript&&(basePath=currentScript.src.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")),assetPath.baseAssetPath=basePath;var defaultModelFetcher$1={};Object.defineProperty(defaultModelFetcher$1,"__esModule",{value:!0}),defaultModelFetcher$1.defaultModelFetcher=void 0;const defaultModelFetcher=i=>fetch(i).then(e=>e.arrayBuffer());defaultModelFetcher$1.defaultModelFetcher=defaultModelFetcher;var frameProcessor={},logging={};(function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.log=i.LOG_PREFIX=void 0,i.LOG_PREFIX="[VAD]";const e=["error","debug","warn"];function s(h){return(...$)=>{console[h](i.LOG_PREFIX,...$)}}const c=e.reduce((h,$)=>(h[$]=s($),h),{});i.log=c})(logging);var messages={};Object.defineProperty(messages,"__esModule",{value:!0}),messages.Message=void 0;var Message;(function(i){i.AudioFrame="AUDIO_FRAME",i.SpeechStart="SPEECH_START",i.VADMisfire="VAD_MISFIRE",i.SpeechEnd="SPEECH_END",i.SpeechStop="SPEECH_STOP"})(Message||(messages.Message=Message={})),Object.defineProperty(frameProcessor,"__esModule",{value:!0}),frameProcessor.FrameProcessor=frameProcessor.validateOptions=frameProcessor.defaultV5FrameProcessorOptions=frameProcessor.defaultLegacyFrameProcessorOptions=void 0;const logging_1$3=logging,messages_1=messages,RECOMMENDED_FRAME_SAMPLES=[512,1024,1536];frameProcessor.defaultLegacyFrameProcessorOptions={positiveSpeechThreshold:.5,negativeSpeechThreshold:.5-.15,preSpeechPadFrames:1,redemptionFrames:8,frameSamples:1536,minSpeechFrames:3,submitUserSpeechOnPause:!1},frameProcessor.defaultV5FrameProcessorOptions={positiveSpeechThreshold:.5,negativeSpeechThreshold:.5-.15,preSpeechPadFrames:3,redemptionFrames:24,frameSamples:512,minSpeechFrames:9,submitUserSpeechOnPause:!1};function validateOptions(i){RECOMMENDED_FRAME_SAMPLES.includes(i.frameSamples)||logging_1$3.log.warn("You are using an unusual frame size"),(i.positiveSpeechThreshold<0||i.positiveSpeechThreshold>1)&&logging_1$3.log.error("positiveSpeechThreshold should be a number between 0 and 1"),(i.negativeSpeechThreshold<0||i.negativeSpeechThreshold>i.positiveSpeechThreshold)&&logging_1$3.log.error("negativeSpeechThreshold should be between 0 and positiveSpeechThreshold"),i.preSpeechPadFrames<0&&logging_1$3.log.error("preSpeechPadFrames should be positive"),i.redemptionFrames<0&&logging_1$3.log.error("redemptionFrames should be positive")}frameProcessor.validateOptions=validateOptions;const concatArrays=i=>{const e=i.reduce((c,h)=>(c.push(c.at(-1)+h.length),c),[0]),s=new Float32Array(e.at(-1));return i.forEach((c,h)=>{const $=e[h];s.set(c,$)}),s};class FrameProcessor{constructor(e,s,c){this.modelProcessFunc=e,this.modelResetFunc=s,this.options=c,this.speaking=!1,this.redemptionCounter=0,this.active=!1,this.reset=()=>{this.speaking=!1,this.audioBuffer=[],this.modelResetFunc(),this.redemptionCounter=0},this.pause=()=>(this.active=!1,this.options.submitUserSpeechOnPause?this.endSegment():(this.reset(),{})),this.resume=()=>{this.active=!0},this.endSegment=()=>{const h=this.audioBuffer;this.audioBuffer=[];const $=this.speaking;this.reset();const _=h.reduce((j,nt)=>j+ +nt.isSpeech,0);if($)if(_>=this.options.minSpeechFrames){const j=concatArrays(h.map(nt=>nt.frame));return{msg:messages_1.Message.SpeechEnd,audio:j}}else return{msg:messages_1.Message.VADMisfire};return{}},this.process=async h=>{if(!this.active)return{};const $=await this.modelProcessFunc(h);if(this.audioBuffer.push({frame:h,isSpeech:$.isSpeech>=this.options.positiveSpeechThreshold}),$.isSpeech>=this.options.positiveSpeechThreshold&&this.redemptionCounter&&(this.redemptionCounter=0),$.isSpeech>=this.options.positiveSpeechThreshold&&!this.speaking)return this.speaking=!0,{probs:$,msg:messages_1.Message.SpeechStart,frame:h};if($.isSpeech<this.options.negativeSpeechThreshold&&this.speaking&&++this.redemptionCounter>=this.options.redemptionFrames){this.redemptionCounter=0,this.speaking=!1;const _=this.audioBuffer;if(this.audioBuffer=[],_.reduce((nt,et)=>nt+ +et.isSpeech,0)>=this.options.minSpeechFrames){const nt=concatArrays(_.map(et=>et.frame));return{probs:$,msg:messages_1.Message.SpeechEnd,audio:nt,frame:h}}else return{probs:$,msg:messages_1.Message.VADMisfire,frame:h}}if(!this.speaking)for(;this.audioBuffer.length>this.options.preSpeechPadFrames;)this.audioBuffer.shift();return{probs:$,frame:h}},this.audioBuffer=[],this.reset()}}frameProcessor.FrameProcessor=FrameProcessor;var nonRealTimeVad={},models={},common={};Object.defineProperty(common,"__esModule",{value:!0});var legacy={},_a$1;Object.defineProperty(legacy,"__esModule",{value:!0}),legacy.SileroLegacy=void 0;const logging_1$2=logging;class SileroLegacy{constructor(e,s,c,h,$){this.ortInstance=e,this._session=s,this._h=c,this._c=h,this._sr=$,this.reset_state=()=>{const _=Array(128).fill(0);this._h=new this.ortInstance.Tensor("float32",_,[2,1,64]),this._c=new this.ortInstance.Tensor("float32",_,[2,1,64])},this.process=async _=>{var o;const nt={input:new this.ortInstance.Tensor("float32",_,[1,_.length]),h:this._h,c:this._c,sr:this._sr},et=await this._session.run(nt);this._h=et.hn,this._c=et.cn;const[b]=(o=et.output)==null?void 0:o.data;return{notSpeech:1-b,isSpeech:b}}}}legacy.SileroLegacy=SileroLegacy,_a$1=SileroLegacy,SileroLegacy.new=async(i,e)=>{logging_1$2.log.debug("initializing vad");const s=await e(),c=await i.InferenceSession.create(s),h=new i.Tensor("int64",[16000n]),$=Array(2*64).fill(0),_=new i.Tensor("float32",$,[2,1,64]),j=new i.Tensor("float32",$,[2,1,64]);return logging_1$2.log.debug("vad is initialized"),new _a$1(i,c,_,j,h)};var v5={},_a;Object.defineProperty(v5,"__esModule",{value:!0}),v5.SileroV5=void 0;const logging_1$1=logging;function getNewState(i){const e=Array(256).fill(0);return new i.Tensor("float32",e,[2,1,128])}class SileroV5{constructor(e,s,c,h){this._session=e,this._state=s,this._sr=c,this.ortInstance=h,this.reset_state=()=>{this._state=getNewState(this.ortInstance)},this.process=async $=>{var a;const j={input:new this.ortInstance.Tensor("float32",$,[1,$.length]),state:this._state,sr:this._sr},nt=await this._session.run(j);this._state=nt.stateN;const[et]=(a=nt.output)==null?void 0:a.data;return{notSpeech:1-et,isSpeech:et}}}}v5.SileroV5=SileroV5,_a=SileroV5,SileroV5.new=async(i,e)=>{logging_1$1.log.debug("Loading VAD...");const s=await e(),c=await i.InferenceSession.create(s),h=new i.Tensor("int64",[16000n]),$=getNewState(i);return logging_1$1.log.debug("...finished loading VAD"),new _a(c,$,h,i)},function(i){var e=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function($,_,j,nt){nt===void 0&&(nt=j);var et=Object.getOwnPropertyDescriptor(_,j);(!et||("get"in et?!_.__esModule:et.writable||et.configurable))&&(et={enumerable:!0,get:function(){return _[j]}}),Object.defineProperty($,nt,et)}:function($,_,j,nt){nt===void 0&&(nt=j),$[nt]=_[j]}),s=commonjsGlobal&&commonjsGlobal.__exportStar||function($,_){for(var j in $)j!=="default"&&!Object.prototype.hasOwnProperty.call(_,j)&&e(_,$,j)};Object.defineProperty(i,"__esModule",{value:!0}),i.SileroV5=i.SileroLegacy=void 0,s(common,i);var c=legacy;Object.defineProperty(i,"SileroLegacy",{enumerable:!0,get:function(){return c.SileroLegacy}});var h=v5;Object.defineProperty(i,"SileroV5",{enumerable:!0,get:function(){return h.SileroV5}})}(models);var resampler={};Object.defineProperty(resampler,"__esModule",{value:!0}),resampler.Resampler=void 0;const logging_1=logging;class Resampler{constructor(e){this.options=e,this.process=s=>{const c=[];for(const h of s)for(this.inputBuffer.push(h);this.hasEnoughDataForFrame();){const $=this.generateOutputFrame();c.push($)}return c},this.stream=async function*(s){for(const c of s)for(this.inputBuffer.push(c);this.hasEnoughDataForFrame();)yield this.generateOutputFrame()},e.nativeSampleRate<16e3&&logging_1.log.error("nativeSampleRate is too low. Should have 16000 = targetSampleRate <= nativeSampleRate"),this.inputBuffer=[]}hasEnoughDataForFrame(){return this.inputBuffer.length*this.options.targetSampleRate/this.options.nativeSampleRate>=this.options.targetFrameSize}generateOutputFrame(){const e=new Float32Array(this.options.targetFrameSize);let s=0,c=0;for(;s<this.options.targetFrameSize;){let h=0,$=0;for(;c<Math.min(this.inputBuffer.length,(s+1)*this.options.nativeSampleRate/this.options.targetSampleRate);){const _=this.inputBuffer[c];_!==void 0&&(h+=_,$++),c++}e[s]=h/$,s++}return this.inputBuffer=this.inputBuffer.slice(c),e}}resampler.Resampler=Resampler,function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.PlatformAgnosticNonRealTimeVAD=i.defaultNonRealTimeVADOptions=void 0;const e=frameProcessor,s=messages,c=models,h=resampler;i.defaultNonRealTimeVADOptions={...e.defaultLegacyFrameProcessorOptions,ortConfig:void 0};class ${static async _new(j,nt,et={}){const b={...i.defaultNonRealTimeVADOptions,...et};b.ortConfig!==void 0&&b.ortConfig(nt);const a=new this(j,nt,b);return await a.init(),a}constructor(j,nt,et){this.modelFetcher=j,this.ort=nt,this.options=et,this.init=async()=>{const b=await c.SileroLegacy.new(this.ort,this.modelFetcher);this.frameProcessor=new e.FrameProcessor(b.process,b.reset_state,{frameSamples:this.options.frameSamples,positiveSpeechThreshold:this.options.positiveSpeechThreshold,negativeSpeechThreshold:this.options.negativeSpeechThreshold,redemptionFrames:this.options.redemptionFrames,preSpeechPadFrames:this.options.preSpeechPadFrames,minSpeechFrames:this.options.minSpeechFrames,submitUserSpeechOnPause:this.options.submitUserSpeechOnPause}),this.frameProcessor.resume()},this.run=async function*(b,a){const o={nativeSampleRate:a,targetSampleRate:16e3,targetFrameSize:this.options.frameSamples},d=new h.Resampler(o);let g=0,rt=0,st=0;for await(const it of d.stream(b)){const{msg:at,audio:ut}=await this.frameProcessor.process(it);switch(at){case s.Message.SpeechStart:g=st*this.options.frameSamples/16;break;case s.Message.SpeechEnd:rt=(st+1)*this.options.frameSamples/16,yield{audio:ut,start:g,end:rt};break}st++}const{msg:tt,audio:ot}=this.frameProcessor.endSegment();tt==s.Message.SpeechEnd&&(yield{audio:ot,start:g,end:st*this.options.frameSamples/16})},(0,e.validateOptions)(et)}}i.PlatformAgnosticNonRealTimeVAD=$}(nonRealTimeVad);var utils={};Object.defineProperty(utils,"__esModule",{value:!0}),utils.audioFileToArray=utils.encodeWAV=utils.arrayBufferToBase64=utils.minFramesForTargetMS=void 0;function minFramesForTargetMS(i,e,s=16e3){return Math.ceil(i*s/1e3/e)}utils.minFramesForTargetMS=minFramesForTargetMS;function arrayBufferToBase64(i){const e=new Uint8Array(i),s=e.byteLength,c=new Array(s);for(var h=0;h<s;h++){const $=e[h];if($===void 0)break;c[h]=String.fromCharCode($)}return btoa(c.join(""))}utils.arrayBufferToBase64=arrayBufferToBase64;function encodeWAV(i,e=3,s=16e3,c=1,h=32){var $=h/8,_=c*$,j=new ArrayBuffer(44+i.length*$),nt=new DataView(j);return writeString(nt,0,"RIFF"),nt.setUint32(4,36+i.length*$,!0),writeString(nt,8,"WAVE"),writeString(nt,12,"fmt "),nt.setUint32(16,16,!0),nt.setUint16(20,e,!0),nt.setUint16(22,c,!0),nt.setUint32(24,s,!0),nt.setUint32(28,s*_,!0),nt.setUint16(32,_,!0),nt.setUint16(34,h,!0),writeString(nt,36,"data"),nt.setUint32(40,i.length*$,!0),e===1?floatTo16BitPCM(nt,44,i):writeFloat32(nt,44,i),j}utils.encodeWAV=encodeWAV;function writeFloat32(i,e,s){for(var c=0;c<s.length;c++,e+=4)i.setFloat32(e,s[c],!0)}function floatTo16BitPCM(i,e,s){for(var c=0;c<s.length;c++,e+=2){var h=Math.max(-1,Math.min(1,s[c]));i.setInt16(e,h<0?h*32768:h*32767,!0)}}function writeString(i,e,s){for(var c=0;c<s.length;c++)i.setUint8(e+c,s.charCodeAt(c))}async function audioFileToArray(i){const e=new OfflineAudioContext(1,1,44100),s=new FileReader;let c=null;if(await new Promise(_=>{s.addEventListener("loadend",j=>{const nt=s.result;e.decodeAudioData(nt,et=>{c=et,e.startRendering().then(b=>{console.log("Rendering completed successfully"),_()}).catch(b=>{console.error(`Rendering failed: ${b}`)})},et=>{console.log(`Error with decoding audio data: ${et}`)})}),s.readAsArrayBuffer(i)}),c===null)throw Error("some shit");let h=c,$=new Float32Array(h.length);for(let _=0;_<h.length;_++)for(let j=0;j<h.numberOfChannels;j++)$[_]+=h.getChannelData(j)[_];return{audio:$,sampleRate:h.sampleRate}}utils.audioFileToArray=audioFileToArray;var realTimeVad={};(function(i){var e=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(tt,ot,it,at){at===void 0&&(at=it);var ut=Object.getOwnPropertyDescriptor(ot,it);(!ut||("get"in ut?!ot.__esModule:ut.writable||ut.configurable))&&(ut={enumerable:!0,get:function(){return ot[it]}}),Object.defineProperty(tt,at,ut)}:function(tt,ot,it,at){at===void 0&&(at=it),tt[at]=ot[it]}),s=commonjsGlobal&&commonjsGlobal.__setModuleDefault||(Object.create?function(tt,ot){Object.defineProperty(tt,"default",{enumerable:!0,value:ot})}:function(tt,ot){tt.default=ot}),c=commonjsGlobal&&commonjsGlobal.__importStar||function(tt){if(tt&&tt.__esModule)return tt;var ot={};if(tt!=null)for(var it in tt)it!=="default"&&Object.prototype.hasOwnProperty.call(tt,it)&&e(ot,tt,it);return s(ot,tt),ot};Object.defineProperty(i,"__esModule",{value:!0}),i.AudioNodeVAD=i.MicVAD=i.getDefaultRealTimeVADOptions=i.ort=i.DEFAULT_MODEL=void 0;const h=c(ortWeb_minExports),$=defaultModelFetcher$1,_=frameProcessor,j=logging,nt=messages,et=models,b=resampler;i.DEFAULT_MODEL="legacy",i.ort=h;const a="vad.worklet.bundle.min.js",o="silero_vad_v5.onnx",d="silero_vad_legacy.onnx",g=tt=>({...tt==="v5"?_.defaultV5FrameProcessorOptions:_.defaultLegacyFrameProcessorOptions,onFrameProcessed:it=>{},onVADMisfire:()=>{j.log.debug("VAD misfire")},onSpeechStart:()=>{j.log.debug("Detected speech start")},onSpeechEnd:()=>{j.log.debug("Detected speech end")},baseAssetPath:"https://cdn.jsdelivr.net/npm/@ricky0123/vad-web@0.0.22/dist/",onnxWASMBasePath:"https://cdn.jsdelivr.net/npm/onnxruntime-web@1.14.0/dist/",stream:void 0,ortConfig:void 0,model:i.DEFAULT_MODEL,workletOptions:{}});i.getDefaultRealTimeVADOptions=g;class rt{static async new(ot={}){const it={...(0,i.getDefaultRealTimeVADOptions)(ot.model??i.DEFAULT_MODEL),...ot};(0,_.validateOptions)(it);let at;it.stream===void 0?at=await navigator.mediaDevices.getUserMedia({audio:{...it.additionalAudioConstraints,channelCount:1,echoCancellation:!0,autoGainControl:!0,noiseSuppression:!0}}):at=it.stream;const ut=new AudioContext,lt=new MediaStreamAudioSourceNode(ut,{mediaStream:at}),ct=await st.new(ut,it);return ct.receive(lt),new rt(it,ut,at,ct,lt)}constructor(ot,it,at,ut,lt,ct=!1){this.options=ot,this.audioContext=it,this.stream=at,this.audioNodeVAD=ut,this.sourceNode=lt,this.listening=ct,this.pause=()=>{this.audioNodeVAD.pause(),this.listening=!1},this.start=()=>{this.audioNodeVAD.start(),this.listening=!0},this.destroy=()=>{this.listening&&this.pause(),this.options.stream===void 0&&this.stream.getTracks().forEach(ft=>ft.stop()),this.sourceNode.disconnect(),this.audioNodeVAD.destroy(),this.audioContext.close()}}}i.MicVAD=rt;class st{static async new(ot,it={}){const at={...(0,i.getDefaultRealTimeVADOptions)(it.model??i.DEFAULT_MODEL),...it};(0,_.validateOptions)(at),i.ort.env.wasm.wasmPaths=at.onnxWASMBasePath,at.ortConfig!==void 0&&at.ortConfig(i.ort);const ut=at.model==="v5"?o:d,lt=at.baseAssetPath+ut,ct=at.model==="v5"?et.SileroV5.new:et.SileroLegacy.new;let ft;try{ft=await ct(i.ort,()=>(0,$.defaultModelFetcher)(lt))}catch(St){throw console.error(`Encountered an error while loading model file ${lt}`),St}const dt=new _.FrameProcessor(ft.process,ft.reset_state,{frameSamples:at.frameSamples,positiveSpeechThreshold:at.positiveSpeechThreshold,negativeSpeechThreshold:at.negativeSpeechThreshold,redemptionFrames:at.redemptionFrames,preSpeechPadFrames:at.preSpeechPadFrames,minSpeechFrames:at.minSpeechFrames,submitUserSpeechOnPause:at.submitUserSpeechOnPause}),yt=new st(ot,at,dt);return await yt.setupAudioNode(),yt}constructor(ot,it,at){this.ctx=ot,this.options=it,this.bufferIndex=0,this.pause=()=>{const ut=this.frameProcessor.pause();this.handleFrameProcessorEvent(ut)},this.start=()=>{this.frameProcessor.resume()},this.receive=ut=>{ut.connect(this.audioNode)},this.processFrame=async ut=>{const lt=await this.frameProcessor.process(ut);this.handleFrameProcessorEvent(lt)},this.handleFrameProcessorEvent=ut=>{switch(ut.probs!==void 0&&this.options.onFrameProcessed(ut.probs,ut.frame),ut.msg){case nt.Message.SpeechStart:this.options.onSpeechStart();break;case nt.Message.VADMisfire:this.options.onVADMisfire();break;case nt.Message.SpeechEnd:this.options.onSpeechEnd(ut.audio);break}},this.destroy=()=>{var ut;this.audioNode instanceof AudioWorkletNode&&this.audioNode.port.postMessage({message:nt.Message.SpeechStop}),this.audioNode.disconnect(),(ut=this.gainNode)==null||ut.disconnect()},this.frameProcessor=at}async setupAudioNode(){if("audioWorklet"in this.ctx&&typeof AudioWorkletNode=="function")try{const ut=this.options.baseAssetPath+a;await this.ctx.audioWorklet.addModule(ut);const lt=this.options.workletOptions??{};lt.processorOptions={...lt.processorOptions??{},frameSamples:this.options.frameSamples},this.audioNode=new AudioWorkletNode(this.ctx,"vad-helper-worklet",lt),this.audioNode.port.onmessage=async ct=>{var ft;switch((ft=ct.data)==null?void 0:ft.message){case nt.Message.AudioFrame:let dt=ct.data.data;dt instanceof ArrayBuffer||(dt=new ArrayBuffer(ct.data.data.byteLength),new Uint8Array(dt).set(new Uint8Array(ct.data.data)));const yt=new Float32Array(dt);await this.processFrame(yt);break}};return}catch(ut){console.log("AudioWorklet setup failed, falling back to ScriptProcessor",ut)}this.resampler=new b.Resampler({nativeSampleRate:this.ctx.sampleRate,targetSampleRate:16e3,targetFrameSize:this.options.frameSamples??480});const it=4096;this.audioNode=this.ctx.createScriptProcessor(it,1,1),this.gainNode=this.ctx.createGain(),this.gainNode.gain.value=0;let at=!1;this.audioNode.onaudioprocess=async ut=>{if(!at){at=!0;try{const lt=ut.inputBuffer.getChannelData(0);if(ut.outputBuffer.getChannelData(0).fill(0),this.resampler){const ft=this.resampler.process(lt);for(const dt of ft)await this.processFrame(dt)}}catch(lt){console.error("Error processing audio:",lt)}finally{at=!1}}},this.audioNode.connect(this.gainNode),this.gainNode.connect(this.ctx.destination)}}i.AudioNodeVAD=st})(realTimeVad),function(i){var e=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(d,g,rt,st){st===void 0&&(st=rt);var tt=Object.getOwnPropertyDescriptor(g,rt);(!tt||("get"in tt?!g.__esModule:tt.writable||tt.configurable))&&(tt={enumerable:!0,get:function(){return g[rt]}}),Object.defineProperty(d,st,tt)}:function(d,g,rt,st){st===void 0&&(st=rt),d[st]=g[rt]}),s=commonjsGlobal&&commonjsGlobal.__setModuleDefault||(Object.create?function(d,g){Object.defineProperty(d,"default",{enumerable:!0,value:g})}:function(d,g){d.default=g}),c=commonjsGlobal&&commonjsGlobal.__importStar||function(d){if(d&&d.__esModule)return d;var g={};if(d!=null)for(var rt in d)rt!=="default"&&Object.prototype.hasOwnProperty.call(d,rt)&&e(g,d,rt);return s(g,d),g};Object.defineProperty(i,"__esModule",{value:!0}),i.NonRealTimeVAD=i.Message=i.FrameProcessor=i.getDefaultRealTimeVADOptions=i.MicVAD=i.DEFAULT_MODEL=i.AudioNodeVAD=i.utils=i.defaultNonRealTimeVADOptions=void 0;const h=c(ortWeb_minExports),$=assetPath,_=defaultModelFetcher$1,j=frameProcessor;Object.defineProperty(i,"FrameProcessor",{enumerable:!0,get:function(){return j.FrameProcessor}});const nt=messages;Object.defineProperty(i,"Message",{enumerable:!0,get:function(){return nt.Message}});const et=nonRealTimeVad,b=utils;i.defaultNonRealTimeVADOptions={modelURL:$.baseAssetPath+"silero_vad_legacy.onnx",modelFetcher:_.defaultModelFetcher};class a extends et.PlatformAgnosticNonRealTimeVAD{static async new(g={}){const{modelURL:rt,modelFetcher:st}={...i.defaultNonRealTimeVADOptions,...g};return await this._new(()=>st(rt),h,g)}}i.NonRealTimeVAD=a,i.utils={audioFileToArray:b.audioFileToArray,minFramesForTargetMS:b.minFramesForTargetMS,arrayBufferToBase64:b.arrayBufferToBase64,encodeWAV:b.encodeWAV};var o=realTimeVad;Object.defineProperty(i,"AudioNodeVAD",{enumerable:!0,get:function(){return o.AudioNodeVAD}}),Object.defineProperty(i,"DEFAULT_MODEL",{enumerable:!0,get:function(){return o.DEFAULT_MODEL}}),Object.defineProperty(i,"MicVAD",{enumerable:!0,get:function(){return o.MicVAD}}),Object.defineProperty(i,"getDefaultRealTimeVADOptions",{enumerable:!0,get:function(){return o.getDefaultRealTimeVADOptions}})}(dist);class VadWebClient{constructor(e,s,c,h,$,_){this.micStream=null,this.is_vad_loading=!0,this.noSpeechStartTime=null,this.recording_started=!1,this.lastWarningTime=null,this.warningCooldownPeriod=2e3,this.vad_past=[],this.last_clip_index=0,this.clip_points=[0],this.sil_duration_acc=0,this.pref_length_samples=e*h,this.desp_length_samples=s*h,this.max_length_samples=c*h,this.shor_thsld=SHORT_SILENCE_THRESHOLD*h,this.long_thsld=LONG_SILENCE_THRESHOLD*h,this.frame_size=FRAME_SIZE,this.speech_pad_frames=PRE_SPEECH_PAD_FRAMES,this.micVad={},this.audioFileManager=$,this.audioBufferManager=_}setDependencies(e,s){this.audioFileManager=e,this.audioBufferManager=s}setCallbacks(e,s,c){this.onVadFramesCallback=e,this.onVadFrameProcessedCallback=s,this.onUserSpeechCallback=c}stopMicStream(){var e,s;try{(s=(e=this.micStream)==null?void 0:e.getTracks)==null||s.call(e).forEach(c=>c.stop())}catch{}finally{this.micStream=null}}checkNoSpeech(e){if(!this.recording_started)return;const s=Date.now();e===0?this.noSpeechStartTime===null?this.noSpeechStartTime=s:s-this.noSpeechStartTime>=1e4&&(this.lastWarningTime===null||s-this.lastWarningTime>=this.warningCooldownPeriod)&&(this.onVadFramesCallback&&this.onVadFramesCallback({message:"No audio detected for a while. Please talk or stop the recording if done.",error_code:ErrorCode.AUDIO_QUALITY_POOR,status_code:HttpStatus.BAD_REQUEST}),this.lastWarningTime=s,this.noSpeechStartTime=s):(this.noSpeechStartTime=null,this.lastWarningTime=null,this.onVadFramesCallback&&this.onVadFramesCallback({message:"Audio captured. Recording continues.",status_code:HttpStatus.OK}))}getMicVad(){return this.micVad}isVadLoading(){return this.is_vad_loading}processVadFrame(e){let s=!1;this.vad_past.length>0&&(e===0&&(this.sil_duration_acc+=1),e===1&&(this.sil_duration_acc=0));const c=(this.vad_past.length-this.last_clip_index)*this.frame_size,h=this.sil_duration_acc*this.frame_size;return c>this.pref_length_samples&&h>this.long_thsld&&(this.last_clip_index=this.vad_past.length-Math.min(Math.floor(this.sil_duration_acc/2),5),this.clip_points.push(this.last_clip_index),this.sil_duration_acc=0,s=!0),c>this.desp_length_samples&&h>this.shor_thsld&&(this.last_clip_index=this.vad_past.length-Math.min(Math.floor(this.sil_duration_acc/2),5),this.clip_points.push(this.last_clip_index),this.sil_duration_acc=0,s=!0),c>=this.max_length_samples&&(this.last_clip_index=this.vad_past.length,this.clip_points.push(this.last_clip_index),this.sil_duration_acc=0,s=!0),this.vad_past.push(e),s?[!0,this.clip_points[this.clip_points.length-1]]:[!1,this.clip_points[this.clip_points.length-1]]}async initVad(e){this.is_vad_loading=!0,this.stopMicStream();let s;try{s=await navigator.mediaDevices.getUserMedia({audio:e?{deviceId:{exact:e}}:!0})}catch(c){if((c==null?void 0:c.name)==="OverconstrainedError"||(c==null?void 0:c.name)==="NotFoundError")s=await navigator.mediaDevices.getUserMedia({audio:!0});else throw c}this.micStream=s;try{const c=await dist.MicVAD.new({stream:s,frameSamples:this.frame_size,preSpeechPadFrames:this.speech_pad_frames,onFrameProcessed:(h,$)=>{var b,a,o;if(this.onVadFrameProcessedCallback&&this.onVadFrameProcessedCallback({probabilities:h,frame:$}),!this.recording_started)return;(b=this.audioFileManager)==null||b.incrementTotalRawSamples($),(a=this.audioBufferManager)==null||a.append($);const{isSpeech:_}=h;let j=0;_>=.5&&(j=1),this.checkNoSpeech(j);const nt=this.processVadFrame(j),et=nt[0];if(console.log("is clip point:",et," at index:",nt[1]),et){const d=(o=this.audioBufferManager)==null?void 0:o.getAudioData();console.log("Processing audio chunk at clip point:",d),d&&this.processAudioChunk({audioFrames:d})}},onSpeechStart:()=>{var h;(h=this.onUserSpeechCallback)==null||h.call(this,!0)},onSpeechEnd:()=>{var h;(h=this.onUserSpeechCallback)==null||h.call(this,!1)}});return this.is_vad_loading=!1,this.micVad=c,!this.is_vad_loading}catch(c){throw console.error("Error initializing VAD:",c),this.stopMicStream(),this.is_vad_loading=!1,c}}async reinitializeVad(e){return await this.initVad(e)}async processAudioChunk({audioFrames:e}){if(!e||!this.audioFileManager||!this.audioBufferManager)return;const c=`audio_${this.audioFileManager.audioChunks.length||0}.${OUTPUT_FORMAT}`,h=this.audioFileManager.getRawSampleDetails(),$=this.audioBufferManager.calculateChunkTimestamps(h.totalRawSamples);try{const _={fileName:c,timestamp:{st:$.start,et:$.end},status:"pending",audioFrames:e},j=this.audioFileManager.updateAudioInfo(_);this.audioFileManager.incrementInsertedSamples(this.audioBufferManager.getCurrentSampleLength(),this.audioBufferManager.getCurrentFrameLength()),this.audioBufferManager.resetBufferState(),console.log("Uploading audio chunk:",c," at index:",j-1),await this.audioFileManager.uploadAudio({audioFrames:e,fileName:c,chunkIndex:j-1})}catch(_){console.error("Error uploading audio chunk:",_)}}startVad(){this.micVad&&typeof this.micVad.start=="function"&&this.micVad.start(),this.recording_started=!0}pauseVad(){this.micVad&&typeof this.micVad.pause=="function"&&this.micVad.pause(),this.recording_started=!1}destroyVad(){this.micVad&&typeof this.micVad.destroy=="function"&&this.micVad.destroy(),this.stopMicStream(),this.recording_started=!1}resetVadWebInstance(){this.micVad&&typeof this.micVad.destroy=="function"&&this.micVad.destroy(),this.stopMicStream(),this.vad_past=[],this.last_clip_index=0,this.clip_points=[0],this.sil_duration_acc=0,this.noSpeechStartTime=null,this.lastWarningTime=null,this.recording_started=!1,this.is_vad_loading=!0}configureVadConstants({pref_length:e,desp_length:s,max_length:c,sr:h,frame_size:$,pre_speech_pad_frames:_,short_thsld:j,long_thsld:nt}){this.pref_length_samples=e*h,this.desp_length_samples=s*h,this.max_length_samples=c*h,this.shor_thsld=j*h,this.long_thsld=nt*h,this.frame_size=$,this.speech_pad_frames=_}}class ChunkedRecorder{constructor(e){this._isPaused=!1,this.eventEmitter=e,this.bufferManager=new AudioBufferManager(SAMPLING_RATE,AUDIO_BUFFER_SIZE_IN_S),this.fileManager=new AudioFileManager,this.vadClient=new VadWebClient(PREF_CHUNK_LENGTH,DESP_CHUNK_LENGTH,MAX_CHUNK_LENGTH,SAMPLING_RATE,this.fileManager,this.bufferManager),this.eventEmitter&&(this.fileManager.setUploadProgressCallback((s,c)=>{}),this.vadClient.setCallbacks(s=>{},s=>{},s=>{}))}initialize(e,s){if(!e.upload_url)throw new Error("Upload URL is required for chunked recording");const c={};s!=null&&s.accessToken&&(c.Authorization=`Bearer ${s.accessToken}`),this.fileManager.setSessionInfo({sessionId:e.session_id,uploadUrl:e.upload_url,uploadHeaders:c}),console.log("ChunkedRecorder initialized with session:",e.session_id)}async start(e){console.log("Starting ChunkedRecorder with deviceId:",e),await this.vadClient.initVad(e);const s=this.vadClient.getMicVad();if((this.vadClient.isVadLoading()||!s||Object.keys(s).length===0)&&await this.vadClient.reinitializeVad(e))throw new Error("VAD instance is not initialized.");this.vadClient.startVad()}pause(){this._isPaused||(this.vadClient.pauseVad(),this._isPaused=!0)}resume(){this._isPaused&&(this.vadClient.startVad(),this._isPaused=!1)}isPaused(){return this._isPaused}async stop(){this._isPaused=!1,this.vadClient.resetVadWebInstance(),await this.fileManager.waitForAllUploads();const e=await this.fileManager.retryFailedUploads(),s=this.fileManager.getTotalAudioChunks().length;return{failedUploads:e,totalFiles:s}}reset(){this._isPaused=!1,this.vadClient.resetVadWebInstance(),this.fileManager.resetFileManagerInstance(),this.bufferManager.resetBufferState()}}class SingleRecorder{constructor(e){this.mediaRecorder=null,this.audioChunks=[],this.uploadUrl="",this.uploadHeaders={},this.stream=null,this._isPaused=!1,this.eventEmitter=e}initialize(e,s){if(!e.upload_url)throw new Error("Upload URL is required for single recording");this.uploadUrl=e.upload_url,s!=null&&s.accessToken&&(this.uploadHeaders.Authorization=`Bearer ${s.accessToken}`)}async start(e){this.audioChunks=[];let s;try{s=await navigator.mediaDevices.getUserMedia({audio:e?{deviceId:{exact:e}}:!0})}catch(c){if((c==null?void 0:c.name)==="OverconstrainedError"||(c==null?void 0:c.name)==="NotFoundError")s=await navigator.mediaDevices.getUserMedia({audio:!0});else throw c}this.stream=s,this.mediaRecorder=new MediaRecorder(s),this.mediaRecorder.ondataavailable=c=>{c.data.size>0&&this.audioChunks.push(c.data)},this.mediaRecorder.start()}pause(){this.mediaRecorder&&this.mediaRecorder.state==="recording"&&(this.mediaRecorder.pause(),this._isPaused=!0)}resume(){this.mediaRecorder&&this.mediaRecorder.state==="paused"&&(this.mediaRecorder.resume(),this._isPaused=!1)}isPaused(){return this._isPaused}async stop(){return this._isPaused=!1,new Promise(e=>{if(!this.mediaRecorder){e({failedUploads:[],totalFiles:0});return}this.mediaRecorder.onstop=async()=>{var $;const s=new Blob(this.audioChunks,{type:"audio/webm"}),c=`recording_${Date.now()}.webm`;(await uploadFileWithFormData(this.uploadUrl,c,s,this.uploadHeaders)).success?e({failedUploads:[],totalFiles:1}):e({failedUploads:[c],totalFiles:1}),($=this.stream)==null||$.getTracks().forEach(_=>_.stop()),this.stream=null,this.mediaRecorder=null},this.mediaRecorder.stop()})}reset(){var e;this._isPaused=!1,this.mediaRecorder&&this.mediaRecorder.state!=="inactive"&&this.mediaRecorder.stop(),(e=this.stream)==null||e.getTracks().forEach(s=>s.stop()),this.stream=null,this.mediaRecorder=null,this.audioChunks=[]}}class EventEmitter{constructor(){this.listeners=new Map}on(e,s){var c;this.listeners.has(e)||this.listeners.set(e,new Set),(c=this.listeners.get(e))==null||c.add(s)}off(e,s){var c;(c=this.listeners.get(e))==null||c.delete(s)}emit(e){var s;(s=this.listeners.get(e.type))==null||s.forEach(c=>{try{c(e)}catch(h){console.error("Error in event listener:",h)}})}}class ScribeClient{static getInstance(e){return ScribeClient.instance||(ScribeClient.instance=new ScribeClient(e)),ScribeClient.instance}static resetInstance(){ScribeClient.instance&&(ScribeClient.instance.reset().catch(()=>{}),ScribeClient.instance=null)}constructor(e){this.discoveryDocument=null,this.currentSession=null,this.isInitialized=!1,this.recorder=null,this.validateConfig(e),this.config={debug:!1,autoDiscovery:!0,...e},this.httpClient=new HttpClient(this.config.apiKey,this.config.accessToken,this.config.debug),this.discoveryAPI=new DiscoveryAPI(this.httpClient),this.sessionAPI=new SessionAPI(this.httpClient,this.config.baseUrl||""),this.eventEmitter=new EventEmitter}async init(){if(this.isInitialized){this.config.debug&&console.log("[ScribeSDK] Already initialized");return}if(!this.config.baseUrl)throw new ValidationError("baseUrl is required for initialization");if(this.config.autoDiscovery)try{this.discoveryDocument=await this.discoveryAPI.getDiscovery(this.config.baseUrl),this.discoveryDocument.endpoints.base_url&&this.sessionAPI.setBaseUrl(this.discoveryDocument.endpoints.base_url),this.emitEvent({type:"discovery:complete",data:this.discoveryDocument}),this.config.debug&&console.log("[ScribeSDK] Discovery complete:",this.discoveryDocument)}catch(e){throw this.emitEvent({type:"error",error:e instanceof Error?e:new Error("Discovery failed")}),e}else this.sessionAPI.setBaseUrl(this.config.baseUrl);this.isInitialized=!0}async startRecording(e){if(this.isInitialized||await this.init(),(await navigator.permissions.query({name:"microphone"})).state!=="granted")throw new ValidationError("Microphone access is required to start recording.");try{const c={templates:e.templates,model:e.model,language_hint:e.languageHint,transcript_language:e.transcriptLanguage,upload_type:e.uploadType||UploadType.CHUNKED,communication_protocol:e.communicationProtocol||"http",additional_data:e.additionalData};return this.currentSession=await this.sessionAPI.createSession(c),this.emitEvent({type:"session:created",data:this.currentSession}),this.config.debug&&console.log("[ScribeSDK] Session created:",this.currentSession),e.uploadType===UploadType.SINGLE?this.recorder=new SingleRecorder(this.eventEmitter):this.recorder=new ChunkedRecorder(this.eventEmitter),this.recorder.initialize(this.currentSession,{accessToken:this.config.accessToken}),await this.recorder.start(e.deviceId),this.currentSession}catch(c){throw this.emitEvent({type:"error",error:c instanceof Error?c:new Error("Failed to start recording")}),c}}pauseRecording(){if(!this.recorder)throw new ValidationError("No active recording to pause");this.recorder.pause(),this.emitEvent({type:"recording:paused"}),this.config.debug&&console.log("[ScribeSDK] Recording paused")}resumeRecording(){if(!this.recorder)throw new ValidationError("No active recording to resume");this.recorder.resume(),this.emitEvent({type:"recording:resumed"}),this.config.debug&&console.log("[ScribeSDK] Recording resumed")}isRecordingPaused(){var e;return((e=this.recorder)==null?void 0:e.isPaused())??!1}async endRecording(){if(!this.currentSession)throw new ValidationError("No active session to end");try{let e=0;if(this.recorder){const{failedUploads:c,totalFiles:h}=await this.recorder.stop();if(c.length>0)throw console.warn("Some audio files failed to upload:",c),new ScribeError(`Failed to upload audio recordings: ${c.join(", ")}`,"upload_failed");e=h||0,this.recorder=null}const s=await this.sessionAPI.endSession(this.currentSession.session_id,e);return this.emitEvent({type:"session:ended",data:s}),this.config.debug&&console.log("[ScribeSDK] Session ended:",s),s}catch(e){throw this.emitEvent({type:"error",error:e instanceof Error?e:new Error("Failed to end recording")}),e}}async reset(){this.recorder&&(await this.recorder.stop().catch(()=>{}),this.recorder=null),this.currentSession=null,this.discoveryAPI.clearCache(),this.discoveryDocument=null,this.isInitialized=!1}emitEvent(e){this.eventEmitter.emit(e)}async getOutputStatus(e){var c;const s=e||((c=this.currentSession)==null?void 0:c.session_id);if(!s)throw new ValidationError("No session ID provided and no active session");try{const h=await this.sessionAPI.getSessionStatus(s);return this.emitEvent({type:"session:status_update",data:h}),this.config.debug&&console.log("[ScribeSDK] Session status:",h),h}catch(h){throw this.emitEvent({type:"error",error:h instanceof Error?h:new Error("Failed to get output status")}),h}}async pollForCompletion(e,s={}){var h;const c=e||((h=this.currentSession)==null?void 0:h.session_id);if(!c)throw new ValidationError("No session ID provided and no active session");return this.sessionAPI.pollSessionStatus(c,{...s,onProgress:$=>{this.emitEvent({type:"session:status_update",data:$}),s.onProgress&&s.onProgress($)}})}getCurrentSession(){return this.currentSession}getDiscoveryDocument(){return this.discoveryDocument}on(e,s){this.eventEmitter.on(e,s)}off(e,s){this.eventEmitter.off(e,s)}clearSession(){this.currentSession=null}validateConfig(e){if(!e.baseUrl)throw new ValidationError("baseUrl is required for initialization")}}ScribeClient.instance=null;function useScribeSession(i){const[e,s]=reactExports.useState("idle"),[c,h]=reactExports.useState(0),[$,_]=reactExports.useState(null),[j,nt]=reactExports.useState(""),et=reactExports.useRef(null),b=reactExports.useRef(null),a=reactExports.useRef(0),o=reactExports.useRef(0),d=reactExports.useCallback((...ft)=>{i.debug&&console.log("[EkaScribe]",...ft)},[i.debug]);reactExports.useEffect(()=>{if(!i.baseUrl){d("Skipping SDK init - no baseUrl provided");return}return(async()=>{try{et.current=ScribeClient.getInstance({accessToken:i.accessToken,baseUrl:i.baseUrl,debug:i.debug}),await et.current.init(),d("SDK initialized")}catch(dt){d("Failed to initialize SDK",dt)}})(),()=>{b.current&&clearInterval(b.current)}},[i.accessToken,i.baseUrl,i.debug,d]);const g=reactExports.useCallback(()=>{b.current=window.setInterval(()=>{const ft=Math.floor((Date.now()-a.current)/1e3);h(ft)},1e3)},[]),rt=reactExports.useCallback(()=>{b.current&&(clearInterval(b.current),b.current=null)},[]),st=async()=>{try{return(await navigator.permissions.query({name:"microphone"})).state}catch{return"prompt"}},tt=async()=>{try{return(await navigator.mediaDevices.getUserMedia({audio:!0})).getTracks().forEach(dt=>dt.stop()),!0}catch(ft){return d("Microphone permission denied",ft),!1}},ot=reactExports.useCallback(ft=>{nt(ft),s("error")},[]),it=reactExports.useCallback(async()=>{const ft=await st();if(ft==="denied"){ot("Microphone access is blocked. Please enable it in your browser settings.");return}if(ft==="prompt"&&(s("permission"),!await tt())){ot("Microphone access is required to record.");return}if(!et.current){ot("SDK not initialized. Please try again.");return}try{s("recording"),await et.current.startRecording({templates:i.templates||["eka_emr_template"],languageHint:i.languageHint}),a.current=Date.now(),o.current=0,h(0),g(),d("Recording started")}catch(dt){d("Failed to start recording",dt),ot("Failed to start recording. Please try again.")}},[i.templates,i.languageHint,d,ot,g]),at=reactExports.useCallback(()=>{et.current&&(et.current.pauseRecording(),s("paused"),o.current=Date.now(),rt(),d("Recording paused"))},[d,rt]),ut=reactExports.useCallback(()=>{et.current&&(et.current.resumeRecording(),s("recording"),o.current&&(a.current+=Date.now()-o.current,o.current=0),g(),d("Recording resumed"))},[d,g]),lt=reactExports.useCallback(async()=>{if(et.current)try{rt(),s("processing"),d("Stopping recording...");const ft=await et.current.endRecording();d("Recording ended",ft),d("Polling for completion...");const dt=await et.current.pollForCompletion(void 0,{maxAttempts:60,intervalMs:2e3,onProgress:yt=>{d("Status update:",yt.status)}});_(dt),d("Final result:",dt),s("results"),i.onResult&&i.onResult(dt)}catch(ft){d("Failed to stop recording",ft),ot("Failed to process recording. Please try again."),i.onError&&ft instanceof Error&&i.onError(ft)}},[i,d,ot,rt]),ct=reactExports.useCallback(()=>{_(null),nt(""),h(0),s("idle")},[]);return{state:e,elapsedTime:c,result:$,errorMessage:j,startRecording:it,pauseRecording:at,resumeRecording:ut,stopRecording:lt,reset:ct}}function App({config:i,onClose:e}){const[s,c]=reactExports.useState(!1),[h,$]=reactExports.useState(i.baseUrl?{accessToken:i.accessToken,baseUrl:i.baseUrl}:null),_=reactExports.useMemo(()=>h?{...i,accessToken:h.accessToken,baseUrl:h.baseUrl}:i,[i,h]),j=!h,{state:nt,elapsedTime:et,result:b,errorMessage:a,startRecording:o,pauseRecording:d,resumeRecording:g,stopRecording:rt,reset:st}=useScribeSession(_);if(s)return null;const tt=(it,at)=>{$({accessToken:it,baseUrl:at})},ot=()=>{if(j)return jsxRuntimeExports.jsx(ConfigState,{onSubmit:tt,initialAccessToken:i.accessToken||"",initialBaseUrl:i.baseUrl||""});switch(nt){case"idle":return jsxRuntimeExports.jsx(IdleState,{onStartRecording:o});case"permission":return jsxRuntimeExports.jsx(PermissionState,{onRequestPermission:o});case"recording":case"paused":return jsxRuntimeExports.jsx(RecordingState,{elapsedTime:et,isPaused:nt==="paused",onPause:d,onResume:g,onStop:rt});case"processing":return jsxRuntimeExports.jsx(ProcessingState,{});case"results":return b?jsxRuntimeExports.jsx(ResultsState,{result:b,onNewRecording:st}):null;case"error":return jsxRuntimeExports.jsx(ErrorState,{message:a,onRetry:st});default:return jsxRuntimeExports.jsx(IdleState,{onStartRecording:o})}};return jsxRuntimeExports.jsx(FloatingPanel,{position:_.position,onClose:e,onMinimize:()=>c(!0),children:ot()})}const widgetStyles=":host{all:initial;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,sans-serif}*{box-sizing:border-box;margin:0;padding:0}.scribe-panel{position:fixed;bottom:20px;right:20px;background:#fff;border-radius:16px;box-shadow:0 4px 24px #0000001f,0 0 0 1px #0000000d;z-index:2147483647;overflow:hidden;min-width:320px}.panel-header{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;background:#fafafa;border-bottom:1px solid #eee;cursor:grab}.panel-header:active{cursor:grabbing}.drag-handle{display:flex;gap:2px;flex-wrap:wrap;width:16px;opacity:.4}.drag-handle span{width:4px;height:4px;background:#666;border-radius:50%}.header-actions{display:flex;gap:8px}.header-btn{background:none;border:none;cursor:pointer;padding:4px;color:#666;display:flex;align-items:center;justify-content:center;width:24px;height:24px}.header-btn:hover{color:#333}.header-btn svg{width:16px;height:16px}.panel-content{padding:20px 24px}.idle-state{display:flex;align-items:center;gap:24px}.logo{display:flex;align-items:center;gap:8px}.logo-icon{width:32px;height:32px}.logo-icon svg{width:100%;height:100%}.logo-text{font-size:20px;font-weight:600;color:#2563eb}.start-btn{display:flex;align-items:center;gap:8px;background:#2563eb;color:#fff;border:none;padding:12px 24px;border-radius:24px;font-size:16px;font-weight:500;cursor:pointer;transition:background .2s}.start-btn:hover{background:#1d4ed8}.start-btn:disabled{background:#93c5fd;cursor:not-allowed}.mic-icon{width:20px;height:20px}.mic-icon svg{width:100%;height:100%}.recording-state{display:flex;align-items:center;gap:16px}.recording-indicator{display:flex;align-items:center;gap:12px;color:#666}.recording-icon{width:24px;height:24px;color:#666}.recording-icon svg{width:100%;height:100%}.recording-icon.active{color:#ef4444;animation:pulse 1.5s infinite}@keyframes pulse{0%,to{opacity:1}50%{opacity:.5}}.timer{font-size:20px;font-weight:500;font-variant-numeric:tabular-nums;color:#374151}.recording-actions{display:flex;gap:8px;margin-left:auto}.resume-btn{background:#fff;color:#2563eb;border:2px solid #2563eb;padding:10px 20px;border-radius:8px;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s}.resume-btn:hover{background:#eff6ff}.pause-btn{background:#fff;color:#f59e0b;border:2px solid #f59e0b;padding:10px 20px;border-radius:8px;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s}.pause-btn:hover{background:#fffbeb}.stop-btn{background:#ef4444;color:#fff;border:none;padding:10px 16px;border-radius:8px;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background .2s}.stop-btn:hover{background:#dc2626}.stop-icon{width:16px;height:16px;background:#fff;border-radius:2px}.processing-state{display:flex;flex-direction:column;align-items:center;gap:16px;padding:20px}.spinner{width:40px;height:40px;border:3px solid #e5e7eb;border-top-color:#2563eb;border-radius:50%;animation:spin 1s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.processing-text{color:#6b7280;font-size:14px}.results-state{display:flex;flex-direction:column;gap:16px;max-height:400px}.results-header{display:flex;align-items:center;justify-content:space-between}.results-title{font-size:16px;font-weight:600;color:#111827}.new-recording-btn{background:#2563eb;color:#fff;border:none;padding:8px 16px;border-radius:6px;font-size:13px;cursor:pointer;transition:background .2s}.new-recording-btn:hover{background:#1d4ed8}.results-content{overflow-y:auto;max-height:300px}.transcript-section{margin-bottom:16px}.section-title{font-size:13px;font-weight:600;color:#6b7280;text-transform:uppercase;letter-spacing:.05em;margin-bottom:8px}.transcript-text{font-size:14px;line-height:1.6;color:#374151;background:#f9fafb;padding:12px;border-radius:8px;white-space:pre-wrap}.error-state{display:flex;flex-direction:column;align-items:center;gap:12px;padding:20px;text-align:center}.error-icon{width:48px;height:48px;color:#ef4444}.error-icon svg{width:100%;height:100%}.error-message{color:#ef4444;font-size:14px}.retry-btn{background:#ef4444;color:#fff;border:none;padding:10px 20px;border-radius:8px;font-size:14px;cursor:pointer;transition:background .2s}.retry-btn:hover{background:#dc2626}.permission-state{display:flex;flex-direction:column;align-items:center;gap:16px;padding:20px;text-align:center}.permission-icon{width:48px;height:48px;color:#2563eb}.permission-icon svg{width:100%;height:100%}.permission-text{color:#374151;font-size:14px;line-height:1.5}.permission-btn{background:#2563eb;color:#fff;border:none;padding:12px 24px;border-radius:8px;font-size:14px;font-weight:500;cursor:pointer;transition:background .2s}.permission-btn:hover{background:#1d4ed8}.config-state{display:flex;flex-direction:column;gap:20px}.config-state .logo{justify-content:center}.config-form{display:flex;flex-direction:column;gap:12px}.config-form .form-group{display:flex;flex-direction:column;gap:4px}.config-form label{font-size:13px;font-weight:500;color:#374151}.config-form input{padding:10px 12px;border:1px solid #d1d5db;border-radius:8px;font-size:14px;color:#111827;background:#fff;transition:border-color .2s,box-shadow .2s}.config-form input:focus{outline:none;border-color:#2563eb;box-shadow:0 0 0 3px #2563eb1a}.config-form input::placeholder{color:#9ca3af}.config-error{color:#ef4444;font-size:13px;margin:0}.config-submit-btn{background:#2563eb;color:#fff;border:none;padding:12px 24px;border-radius:8px;font-size:14px;font-weight:500;cursor:pointer;transition:background .2s;margin-top:4px}.config-submit-btn:hover{background:#1d4ed8}";class ScribeWidget{constructor(e){Qr(this,"container");Qr(this,"shadowRoot");Qr(this,"root",null);Qr(this,"config");Qr(this,"visible",!0);this.config={templates:["soap"],languageHint:["en"],position:{bottom:20,right:20},...e},this.container=document.createElement("div"),this.container.id="eka-scribe-widget",this.shadowRoot=this.container.attachShadow({mode:"closed"});const s=document.createElement("style");s.textContent=widgetStyles,this.shadowRoot.appendChild(s);const c=document.createElement("div");c.id="eka-scribe-root",this.shadowRoot.appendChild(c),this.root=createRoot(c)}render(){!this.root||!this.visible||this.root.render(jsxRuntimeExports.jsx(App,{config:this.config,onClose:()=>this.hide()}))}mount(e){const s=typeof e=="string"?document.querySelector(e):e||document.body;s&&(s.appendChild(this.container),this.render())}unmount(){this.root&&(this.root.unmount(),this.root=null),this.container.remove()}show(){this.visible=!0,this.container.style.display="block",this.render()}hide(){this.visible=!1,this.container.style.display="none"}isVisible(){return this.visible}}let widgetInstance=null;function init(i={}){return widgetInstance&&widgetInstance.unmount(),console.log(i,"config - WIDGET"),widgetInstance=new ScribeWidget(i),widgetInstance.mount(),widgetInstance}function getInstance(){return widgetInstance}const EkaScribe={init,getInstance,Widget:ScribeWidget};if(typeof window<"u"&&typeof document<"u"){const i=()=>{const e=document.currentScript||document.querySelector('script[src*="scribe-widget"]');e!=null&&e.hasAttribute("data-no-auto-init")||(console.log(widgetInstance,"widget instance"),widgetInstance||init({baseUrl:""}))};document.readyState==="loading"?document.addEventListener("DOMContentLoaded - WIDGET",i):(console.log("load document - WIDGET"),i())}exports.ScribeWidget=ScribeWidget,exports.default=EkaScribe,exports.getInstance=getInstance,exports.init=init,Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|