diff --git a/assets/index-fc7c003a.js b/assets/index-326371ca.js similarity index 99% rename from assets/index-fc7c003a.js rename to assets/index-326371ca.js index 1c43c0b..a0b0ce5 100644 --- a/assets/index-fc7c003a.js +++ b/assets/index-326371ca.js @@ -960,7 +960,7 @@ void main() { * https://github.com/KingSora * * Released under the MIT license. - */const createCache$1=(ne,oe)=>{const{o:ce,u:ue,_:pe}=ne;let me=ce,ge;const ye=(_e,Se)=>{const $e=me,Re=_e,Ae=Se||(ue?!ue($e,Re):$e!==Re);return(Ae||pe)&&(me=Re,ge=$e),[me,Ae,ge]};return[oe?_e=>ye(oe(me,ge),_e):ye,_e=>[me,!!_e,ge]]},t$6=typeof window<"u",n$6=t$6?window:{},o$4=Math.max,s$3=Math.min,e$5=Math.round,r$5=n$6.cancelAnimationFrame,l$5=n$6.requestAnimationFrame,i$6=n$6.setTimeout,a$4=n$6.clearTimeout,getApi=ne=>typeof n$6[ne]<"u"?n$6[ne]:void 0,u$6=getApi("MutationObserver"),f$5=getApi("IntersectionObserver"),_$3=getApi("ResizeObserver"),d$6=getApi("ScrollTimeline"),v$5=t$6&&Node.ELEMENT_NODE,{toString:h$6,hasOwnProperty:p$6}=Object.prototype,g$5=/^\[object (.+)\]$/,isUndefined=ne=>ne===void 0,isNull$1=ne=>ne===null,type$1=ne=>isUndefined(ne)||isNull$1(ne)?`${ne}`:h$6.call(ne).replace(g$5,"$1").toLowerCase(),isNumber$2=ne=>typeof ne=="number",isString$2=ne=>typeof ne=="string",isBoolean$2=ne=>typeof ne=="boolean",isFunction$2=ne=>typeof ne=="function",isArray$4=ne=>Array.isArray(ne),isObject$4=ne=>typeof ne=="object"&&!isArray$4(ne)&&!isNull$1(ne),isArrayLike=ne=>{const oe=!!ne&&ne.length,ce=isNumber$2(oe)&&oe>-1&&oe%1==0;return isArray$4(ne)||!isFunction$2(ne)&&ce?oe>0&&isObject$4(ne)?oe-1 in ne:!0:!1},isPlainObject$1=ne=>{if(!ne||!isObject$4(ne)||type$1(ne)!=="object")return!1;let oe;const ce="constructor",ue=ne[ce],pe=ue&&ue.prototype,me=p$6.call(ne,ce),ge=pe&&p$6.call(pe,"isPrototypeOf");if(ue&&!me&&!ge)return!1;for(oe in ne);return isUndefined(oe)||p$6.call(ne,oe)},isHTMLElement=ne=>{const oe=HTMLElement;return ne?oe?ne instanceof oe:ne.nodeType===v$5:!1},isElement$2=ne=>{const oe=Element;return ne?oe?ne instanceof oe:ne.nodeType===v$5:!1};function each(ne,oe){if(isArrayLike(ne))for(let ce=0;ceoe(ne[ce],ce,ne));return ne}const inArray=(ne,oe)=>ne.indexOf(oe)>=0,concat=(ne,oe)=>ne.concat(oe),push$2=(ne,oe,ce)=>(!ce&&!isString$2(oe)&&isArrayLike(oe)?Array.prototype.push.apply(ne,oe):ne.push(oe),ne),from$1=ne=>Array.from(ne||[]),createOrKeepArray=ne=>isArray$4(ne)?ne:[ne],isEmptyArray=ne=>!!ne&&!ne.length,deduplicateArray=ne=>from$1(new Set(ne)),runEachAndClear=(ne,oe,ce)=>{each(ne,pe=>pe&&pe.apply(void 0,oe||[])),!ce&&(ne.length=0)},b$5="paddingTop",w$5="paddingRight",S$5="paddingLeft",y$3="paddingBottom",m$5="marginLeft",O$3="marginRight",$$4="marginBottom",C$3="overflowX",x$3="overflowY",H$4="width",I$3="height",z$4="hidden",E$3="visible",equal=(ne,oe,ce,ue)=>{if(ne&&oe){let pe=!0;return each(ce,me=>{const ge=ue?ue(ne[me]):ne[me],ye=ue?ue(oe[me]):oe[me];ge!==ye&&(pe=!1)}),pe}return!1},equalWH=(ne,oe)=>equal(ne,oe,["w","h"]),equalXY=(ne,oe)=>equal(ne,oe,["x","y"]),equalTRBL=(ne,oe)=>equal(ne,oe,["t","r","b","l"]),noop$8=()=>{},bind$2=(ne,...oe)=>ne.bind(0,...oe),selfClearTimeout=ne=>{let oe;const ce=ne?i$6:l$5,ue=ne?a$4:r$5;return[pe=>{ue(oe),oe=ce(pe,isFunction$2(ne)?ne():ne)},()=>ue(oe)]},debounce=(ne,oe)=>{let ce,ue,pe,me=noop$8;const{v:ge,p:ye,S:ve}=oe||{},xe=function(Ae){me(),a$4(ce),ce=ue=void 0,me=noop$8,ne.apply(this,Ae)},_e=Re=>ve&&ue?ve(ue,Re):Re,Se=()=>{me!==noop$8&&xe(_e(pe)||pe)},$e=function(){const Ae=from$1(arguments),Ie=isFunction$2(ge)?ge():ge;if(isNumber$2(Ie)&&Ie>=0){const Be=isFunction$2(ye)?ye():ye,Ne=isNumber$2(Be)&&Be>=0,Fe=Ie>0?i$6:l$5,Ue=Ie>0?a$4:r$5,qe=_e(Ae)||Ae,ze=xe.bind(0,qe);me();const Ge=Fe(ze,Ie);me=()=>Ue(Ge),Ne&&!ce&&(ce=i$6(Se,Be)),ue=pe=qe}else xe(Ae)};return $e.m=Se,$e},hasOwnProperty$2=(ne,oe)=>Object.prototype.hasOwnProperty.call(ne,oe),keys$1=ne=>ne?Object.keys(ne):[],assignDeep=(ne,oe,ce,ue,pe,me,ge)=>{const ye=[oe,ce,ue,pe,me,ge];return(typeof ne!="object"||isNull$1(ne))&&!isFunction$2(ne)&&(ne={}),each(ye,ve=>{each(ve,(xe,_e)=>{const Se=ve[_e];if(ne===Se)return!0;const $e=isArray$4(Se);if(Se&&isPlainObject$1(Se)){const Re=ne[_e];let Ae=Re;$e&&!isArray$4(Re)?Ae=[]:!$e&&!isPlainObject$1(Re)&&(Ae={}),ne[_e]=assignDeep(Ae,Se)}else ne[_e]=$e?Se.slice():Se})}),ne},removeUndefinedProperties=(ne,oe)=>each(assignDeep({},ne),(ce,ue,pe)=>{ce===void 0?delete pe[ue]:oe&&ce&&isPlainObject$1(ce)&&(pe[ue]=removeUndefinedProperties(ce,oe))}),isEmptyObject=ne=>{for(const oe in ne)return!1;return!0},capNumber=(ne,oe,ce)=>o$4(ne,s$3(oe,ce)),getDomTokensArray=ne=>from$1(new Set((isArray$4(ne)?ne:(ne||"").split(" ")).filter(oe=>oe))),getAttr=(ne,oe)=>ne&&ne.getAttribute(oe),setAttrs=(ne,oe,ce)=>{each(getDomTokensArray(oe),ue=>{ne&&ne.setAttribute(ue,ce||"")})},removeAttrs=(ne,oe)=>{each(getDomTokensArray(oe),ce=>ne&&ne.removeAttribute(ce))},domTokenListAttr=(ne,oe)=>{const ce=getDomTokensArray(getAttr(ne,oe)),ue=bind$2(setAttrs,ne,oe),pe=(me,ge)=>{const ye=new Set(ce);return each(getDomTokensArray(me),ve=>ye[ge](ve)),from$1(ye).join(" ")};return{O:me=>ue(pe(me,"delete")),$:me=>ue(pe(me,"add")),C:me=>{const ge=getDomTokensArray(me);return ge.reduce((ye,ve)=>ye&&ce.includes(ve),ge.length>0)}}},removeAttrClass=(ne,oe,ce)=>{domTokenListAttr(ne,oe).O(ce)},addAttrClass=(ne,oe,ce)=>(domTokenListAttr(ne,oe).$(ce),bind$2(removeAttrClass,ne,oe,ce)),addRemoveAttrClass=(ne,oe,ce,ue)=>{(ue?addAttrClass:removeAttrClass)(ne,oe,ce)},hasAttrClass=(ne,oe,ce)=>domTokenListAttr(ne,oe).C(ce),createDomTokenListClass=ne=>domTokenListAttr(ne,"class"),removeClass=(ne,oe)=>{createDomTokenListClass(ne).O(oe)},addClass=(ne,oe)=>(createDomTokenListClass(ne).$(oe),bind$2(removeClass,ne,oe)),A$5=t$6&&Element.prototype,find$1=(ne,oe)=>{const ce=[],ue=oe?isElement$2(oe)&&oe:document;return ue?push$2(ce,ue.querySelectorAll(ne)):ce},findFirst=(ne,oe)=>{const ce=oe?isElement$2(oe)&&oe:document;return ce?ce.querySelector(ne):null},is$7=(ne,oe)=>isElement$2(ne)?(A$5.matches||A$5.msMatchesSelector).call(ne,oe):!1,contents=ne=>ne?from$1(ne.childNodes):[],parent=ne=>ne&&ne.parentElement,closest$2=(ne,oe)=>isElement$2(ne)&&ne.closest(oe),liesBetween=(ne,oe,ce)=>{const ue=closest$2(ne,oe),pe=ne&&findFirst(ce,ue),me=closest$2(pe,oe)===ue;return ue&&pe?ue===ne||pe===ne||me&&closest$2(closest$2(ne,ce),oe)!==ue:!1},removeElements=ne=>{if(isArrayLike(ne))each(from$1(ne),oe=>removeElements(oe));else if(ne){const oe=parent(ne);oe&&oe.removeChild(ne)}},before=(ne,oe,ce)=>{if(ce&&ne){let ue=oe,pe;return isArrayLike(ce)?(pe=document.createDocumentFragment(),each(ce,me=>{me===ue&&(ue=me.previousSibling),pe.appendChild(me)})):pe=ce,oe&&(ue?ue!==oe&&(ue=ue.nextSibling):ue=ne.firstChild),ne.insertBefore(pe,ue||null),()=>removeElements(ce)}return noop$8},appendChildren=(ne,oe)=>before(ne,null,oe),insertAfter=(ne,oe)=>before(parent(ne),ne&&ne.nextSibling,oe),createDiv=ne=>{const oe=document.createElement("div");return setAttrs(oe,"class",ne),oe},createDOM=ne=>{const oe=createDiv();return oe.innerHTML=ne.trim(),each(contents(oe),ce=>removeElements(ce))},T$3=/^--/,getCSSVal=(ne,oe)=>ne.getPropertyValue(oe)||ne[oe]||"",validFiniteNumber=ne=>{const oe=ne||0;return isFinite(oe)?oe:0},parseToZeroOrNumber=ne=>validFiniteNumber(parseFloat(ne||"")),ratioToCssPercent=ne=>`${(validFiniteNumber(ne)*100).toFixed(3)}%`,numberToCssPx=ne=>`${validFiniteNumber(ne)}px`;function setStyles(ne,oe){ne&&each(oe,(ce,ue)=>{try{const pe=ne.style,me=isNumber$2(ce)?numberToCssPx(ce):(ce||"")+"";T$3.test(ue)?pe.setProperty(ue,me):pe[ue]=me}catch{}})}function getStyles$2(ne,oe,ce){const ue=isString$2(oe);let pe=ue?"":{};if(ne){const me=n$6.getComputedStyle(ne,ce)||ne.style;pe=ue?getCSSVal(me,oe):oe.reduce((ge,ye)=>(ge[ye]=getCSSVal(me,ye),ge),pe)}return pe}const getDirectionIsRTL=ne=>getStyles$2(ne,"direction")==="rtl",topRightBottomLeft=(ne,oe,ce)=>{const ue=oe?`${oe}-`:"",pe=ce?`-${ce}`:"",me=`${ue}top${pe}`,ge=`${ue}right${pe}`,ye=`${ue}bottom${pe}`,ve=`${ue}left${pe}`,xe=getStyles$2(ne,[me,ge,ye,ve]);return{t:parseToZeroOrNumber(xe[me]),r:parseToZeroOrNumber(xe[ge]),b:parseToZeroOrNumber(xe[ye]),l:parseToZeroOrNumber(xe[ve])}},getTrasformTranslateValue=(ne,oe)=>`translate${isObject$4(ne)?`(${ne.x},${ne.y})`:`${oe?"X":"Y"}(${ne})`}`,D$3={w:0,h:0},getElmWidthHeightProperty=(ne,oe)=>oe?{w:oe[`${ne}Width`],h:oe[`${ne}Height`]}:D$3,windowSize=ne=>getElmWidthHeightProperty("inner",ne||n$6),k$6=bind$2(getElmWidthHeightProperty,"offset"),R$3=bind$2(getElmWidthHeightProperty,"client"),M$4=bind$2(getElmWidthHeightProperty,"scroll"),fractionalSize=ne=>{const oe=parseFloat(getStyles$2(ne,H$4))||0,ce=parseFloat(getStyles$2(ne,I$3))||0;return{w:oe-e$5(oe),h:ce-e$5(ce)}},getBoundingClientRect=ne=>ne.getBoundingClientRect(),domRectHasDimensions=ne=>!!(ne&&(ne[I$3]||ne[H$4])),domRectAppeared=(ne,oe)=>{const ce=domRectHasDimensions(ne);return!domRectHasDimensions(oe)&&ce},removeEventListener$1=(ne,oe,ce,ue)=>{each(getDomTokensArray(oe),pe=>{ne.removeEventListener(pe,ce,ue)})},addEventListener$1=(ne,oe,ce,ue)=>{var pe;const me=(pe=ue&&ue.H)!=null?pe:!0,ge=ue&&ue.I||!1,ye=ue&&ue.A||!1,ve={passive:me,capture:ge};return bind$2(runEachAndClear,getDomTokensArray(oe).map(xe=>{const _e=ye?Se=>{removeEventListener$1(ne,xe,_e,ge),ce(Se)}:ce;return ne.addEventListener(xe,_e,ve),bind$2(removeEventListener$1,ne,xe,_e,ge)}))},stopPropagation=ne=>ne.stopPropagation(),preventDefault$1=ne=>ne.preventDefault(),V$3={x:0,y:0},absoluteCoordinates=ne=>{const oe=ne&&getBoundingClientRect(ne);return oe?{x:oe.left+n$6.scrollX,y:oe.top+n$6.scrollY}:V$3},convertScrollPosition=(ne,oe,ce)=>ce?ce.n?-ne+0:ce.i?oe-ne:ne:ne,getRawScrollBounds=(ne,oe)=>[convertScrollPosition(0,ne,oe),convertScrollPosition(ne,ne,oe)],getRawScrollRatio=(ne,oe,ce)=>capNumber(0,1,convertScrollPosition(ne,oe,ce)/oe||0),scrollElementTo=(ne,oe)=>{const{x:ce,y:ue}=isNumber$2(oe)?{x:oe,y:oe}:oe||{};isNumber$2(ce)&&(ne.scrollLeft=ce),isNumber$2(ue)&&(ne.scrollTop=ue)},getElmentScroll=ne=>({x:ne.scrollLeft,y:ne.scrollTop}),manageListener=(ne,oe)=>{each(createOrKeepArray(oe),ne)},createEventListenerHub=ne=>{const oe=new Map,ce=(me,ge)=>{if(me){const ye=oe.get(me);manageListener(ve=>{ye&&ye[ve?"delete":"clear"](ve)},ge)}else oe.forEach(ye=>{ye.clear()}),oe.clear()},ue=(me,ge)=>{if(isString$2(me)){const xe=oe.get(me)||new Set;return oe.set(me,xe),manageListener(_e=>{isFunction$2(_e)&&xe.add(_e)},ge),bind$2(ce,me,ge)}isBoolean$2(ge)&&ge&&ce();const ye=keys$1(me),ve=[];return each(ye,xe=>{const _e=me[xe];_e&&push$2(ve,ue(xe,_e))}),bind$2(runEachAndClear,ve)},pe=(me,ge)=>{each(from$1(oe.get(me)),ye=>{ge&&!isEmptyArray(ge)?ye.apply(0,ge):ye()})};return ue(ne||{}),[ue,ce,pe]},opsStringify=ne=>JSON.stringify(ne,(oe,ce)=>{if(isFunction$2(ce))throw 0;return ce}),getPropByPath=(ne,oe)=>ne?`${oe}`.split(".").reduce((ce,ue)=>ce&&hasOwnProperty$2(ce,ue)?ce[ue]:void 0,ne):void 0,L$3={paddingAbsolute:!1,showNativeOverlaidScrollbars:!1,update:{elementEvents:[["img","load"]],debounce:[0,33],attributes:null,ignoreMutation:null},overflow:{x:"scroll",y:"scroll"},scrollbars:{theme:"os-theme-dark",visibility:"auto",autoHide:"never",autoHideDelay:1300,autoHideSuspend:!1,dragScroll:!0,clickScroll:!1,pointers:["mouse","touch","pen"]}},getOptionsDiff=(ne,oe)=>{const ce={},ue=concat(keys$1(oe),keys$1(ne));return each(ue,pe=>{const me=ne[pe],ge=oe[pe];if(isObject$4(me)&&isObject$4(ge))assignDeep(ce[pe]={},getOptionsDiff(me,ge)),isEmptyObject(ce[pe])&&delete ce[pe];else if(hasOwnProperty$2(oe,pe)&&ge!==me){let ye=!0;if(isArray$4(me)||isArray$4(ge))try{opsStringify(me)===opsStringify(ge)&&(ye=!1)}catch{}ye&&(ce[pe]=ge)}}),ce},createOptionCheck=(ne,oe,ce)=>ue=>[getPropByPath(ne,ue),ce||getPropByPath(oe,ue)!==void 0],P$2="data-overlayscrollbars",U$3="os-environment",B$3=`${U$3}-scrollbar-hidden`,N$4=`${P$2}-initialize`,j$4=P$2,F$4=`${j$4}-overflow-x`,q$6=`${j$4}-overflow-y`,W$3="overflowVisible",X$3="scrollbarPressed",Y$3="updating",J$3="body",K$3=`${P$2}-viewport`,Z$3="arrange",G$3="scrollbarHidden",Q$3=W$3,tt$3=`${P$2}-padding`,nt$2=Q$3,ot$2=`${P$2}-content`,st$2="os-size-observer",et$3=`${st$2}-appear`,ct$2=`${st$2}-listener`,at$2="os-trinsic-observer",ut$2="os-theme-none",ft="os-scrollbar",_t=`${ft}-rtl`,dt$2=`${ft}-horizontal`,vt=`${ft}-vertical`,ht$2=`${ft}-track`,pt$1=`${ft}-handle`,gt$1=`${ft}-visible`,bt$1=`${ft}-cornerless`,wt=`${ft}-transitionless`,St=`${ft}-interaction`,yt=`${ft}-unusable`,mt$1=`${ft}-auto-hide`,Ot=`${mt$1}-hidden`,$t=`${ft}-wheel`,Ct$1=`${ht$2}-interactive`,xt=`${pt$1}-interactive`,Ht$1={},It={},addPlugins=ne=>{each(ne,oe=>each(oe,(ce,ue)=>{Ht$1[ue]=oe[ue]}))},registerPluginModuleInstances=(ne,oe,ce)=>keys$1(ne).map(ue=>{const{static:pe,instance:me}=ne[ue],[ge,ye,ve]=ce||[],xe=ce?me:pe;if(xe){const _e=ce?xe(ge,ye,oe):xe(oe);return(ve||It)[ue]=_e}}),getStaticPluginModuleInstance=ne=>It[ne],zt="__osOptionsValidationPlugin",Et$1="__osSizeObserverPlugin",getShowNativeOverlaidScrollbars=(ne,oe)=>{const{T:ce}=oe,[ue,pe]=ne("showNativeOverlaidScrollbars");return[ue&&ce.x&&ce.y,pe]},overflowIsVisible=ne=>ne.indexOf(E$3)===0,getViewportOverflowState=(ne,oe)=>{const{D:ce}=ne,ue=ve=>{const xe=getStyles$2(ce,ve),Se=(oe?oe[ve]:xe)==="scroll";return[xe,Se]},[pe,me]=ue(C$3),[ge,ye]=ue(x$3);return{k:{x:pe,y:ge},R:{x:me,y:ye}}},setViewportOverflowState=(ne,oe,ce,ue)=>{const pe=oe.x||oe.y,me=(_e,Se)=>{const $e=overflowIsVisible(_e),Re=$e&&pe?"hidden":"",Ae=Se&&$e&&_e.replace(`${E$3}-`,"")||Re;return[Se&&!$e?_e:"",overflowIsVisible(Ae)?"hidden":Ae]},[ge,ye]=me(ce.x,oe.x),[ve,xe]=me(ce.y,oe.y);return ue[C$3]=ye&&ve?ye:ge,ue[x$3]=xe&&ge?xe:ve,getViewportOverflowState(ne,ue)},Tt="__osScrollbarsHidingPlugin",kt="__osClickScrollPlugin";let Mt;const createEnvironment=()=>{const ne=(Fe,Ue,We,qe)=>{appendChildren(Fe,Ue);const ze=R$3(Ue),Ge=k$6(Ue),Ze=fractionalSize(We);return qe&&removeElements(Ue),{x:Ge.h-ze.h+Ze.h,y:Ge.w-ze.w+Ze.w}},oe=Fe=>{let Ue=!1;const We=addClass(Fe,B$3);try{Ue=getStyles$2(Fe,"scrollbar-width")==="none"||getStyles$2(Fe,"display","::-webkit-scrollbar")==="none"}catch{}return We(),Ue},ce=(Fe,Ue)=>{setStyles(Fe,{[C$3]:z$4,[x$3]:z$4,direction:"rtl"}),scrollElementTo(Fe,{x:0});const We=absoluteCoordinates(Fe),qe=absoluteCoordinates(Ue);scrollElementTo(Fe,{x:-999});const ze=absoluteCoordinates(Ue);return{i:We.x===qe.x,n:qe.x!==ze.x}},{body:ue}=document,me=createDOM(`
`)[0],ge=me.firstChild,[ye,,ve]=createEventListenerHub(),[xe,_e]=createCache$1({o:ne(ue,me,ge),u:equalXY},bind$2(ne,ue,me,ge,!0)),[Se]=_e(),$e=oe(me),Re={x:Se.x===0,y:Se.y===0},Ae={elements:{host:null,padding:!$e,viewport:Fe=>$e&&Fe===Fe.ownerDocument.body&&Fe,content:!1},scrollbars:{slot:!0},cancel:{nativeScrollbarsOverlaid:!1,body:null}},Ie=assignDeep({},L$3),ke=bind$2(assignDeep,{},Ie),Be=bind$2(assignDeep,{},Ae),Ne={P:Se,T:Re,L:$e,J:!!d$6,K:ce(me,ge),Z:bind$2(ye,"r"),G:Be,tt:Fe=>assignDeep(Ae,Fe)&&Be(),nt:ke,ot:Fe=>assignDeep(Ie,Fe)&&ke(),st:assignDeep({},Ae),et:assignDeep({},Ie)};return removeAttrs(me,"style"),removeElements(me),n$6.addEventListener("resize",()=>{let Fe;if(!$e&&(!Re.x||!Re.y)){const Ue=getStaticPluginModuleInstance(Tt);Fe=!!(Ue?Ue.Y():noop$8)(Ne,xe)}ve("r",[Fe])}),Ne},getEnvironment=()=>(Mt||(Mt=createEnvironment()),Mt),resolveInitialization=(ne,oe)=>isFunction$2(oe)?oe.apply(0,ne):oe,staticInitializationElement=(ne,oe,ce,ue)=>{const pe=isUndefined(ue)?ce:ue;return resolveInitialization(ne,pe)||oe.apply(0,ne)},dynamicInitializationElement=(ne,oe,ce,ue)=>{const pe=isUndefined(ue)?ce:ue,me=resolveInitialization(ne,pe);return!!me&&(isHTMLElement(me)?me:oe.apply(0,ne))},cancelInitialization=(ne,oe)=>{const{nativeScrollbarsOverlaid:ce,body:ue}=oe||{},{T:pe,L:me,G:ge}=getEnvironment(),{nativeScrollbarsOverlaid:ye,body:ve}=ge().cancel,xe=ce??ye,_e=isUndefined(ue)?ve:ue,Se=(pe.x||pe.y)&&xe,$e=ne&&(isNull$1(_e)?!me:_e);return!!Se||!!$e},Vt=new WeakMap,addInstance=(ne,oe)=>{Vt.set(ne,oe)},removeInstance=ne=>{Vt.delete(ne)},getInstance=ne=>Vt.get(ne),createEventContentChange=(ne,oe,ce)=>{let ue=!1;const pe=ce?new WeakMap:!1,me=()=>{ue=!0},ge=ye=>{if(pe&&ce){const ve=ce.map(xe=>{const[_e,Se]=xe||[];return[Se&&_e?(ye||find$1)(_e,ne):[],Se]});each(ve,xe=>each(xe[0],_e=>{const Se=xe[1],$e=pe.get(_e)||[];if(ne.contains(_e)&&Se){const Ae=addEventListener$1(_e,Se,Ie=>{ue?(Ae(),pe.delete(_e)):oe(Ie)});pe.set(_e,push$2($e,Ae))}else runEachAndClear($e),pe.delete(_e)}))}};return ge(),[me,ge]},createDOMObserver=(ne,oe,ce,ue)=>{let pe=!1;const{ct:me,rt:ge,lt:ye,it:ve,ut:xe,ft:_e}=ue||{},Se=debounce(()=>pe&&ce(!0),{v:33,p:99}),[$e,Re]=createEventContentChange(ne,Se,ye),Ae=me||[],Ie=ge||[],ke=concat(Ae,Ie),Be=(Fe,Ue)=>{if(!isEmptyArray(Ue)){const We=xe||noop$8,qe=_e||noop$8,ze=[],Ge=[];let Ze=!1,Dt=!1;if(each(Ue,Je=>{const{attributeName:Ut,target:jt,type:Ke,oldValue:an,addedNodes:Zt,removedNodes:en}=Je,Kt=Ke==="attributes",Wt=Ke==="childList",un=ne===jt,Xt=Kt&&Ut,nn=Xt&&getAttr(jt,Ut||"")||null,vn=Xt&&an!==nn,Sn=inArray(Ie,Ut)&&vn;if(oe&&(Wt||!un)){const Cn=Kt&&vn,Nt=Cn&&ve&&is$7(jt,ve),Jt=(Nt?!We(jt,Ut,an,nn):!Kt||Cn)&&!qe(Je,!!Nt,ne,ue);each(Zt,hn=>push$2(ze,hn)),each(en,hn=>push$2(ze,hn)),Dt=Dt||Jt}!oe&&un&&vn&&!We(jt,Ut,an,nn)&&(push$2(Ge,Ut),Ze=Ze||Sn)}),Re(Je=>deduplicateArray(ze).reduce((Ut,jt)=>(push$2(Ut,find$1(Je,jt)),is$7(jt,Je)?push$2(Ut,jt):Ut),[])),oe)return!Fe&&Dt&&ce(!1),[!1];if(!isEmptyArray(Ge)||Ze){const Je=[deduplicateArray(Ge),Ze];return!Fe&&ce.apply(0,Je),Je}}},Ne=new u$6(bind$2(Be,!1));return[()=>(Ne.observe(ne,{attributes:!0,attributeOldValue:!0,attributeFilter:ke,subtree:oe,childList:oe,characterData:oe}),pe=!0,()=>{pe&&($e(),Ne.disconnect(),pe=!1)}),()=>{if(pe)return Se.m(),Be(!0,Ne.takeRecords())}]},createSizeObserver=(ne,oe,ce)=>{const{_t:pe,dt:me}=ce||{},ge=getStaticPluginModuleInstance(Et$1),{K:ye}=getEnvironment(),ve=bind$2(getDirectionIsRTL,ne),[xe]=createCache$1({o:!1,_:!0});return()=>{const _e=[],$e=createDOM(`
`)[0],Re=$e.firstChild,Ae=Ie=>{const ke=Ie instanceof ResizeObserverEntry,Be=!ke&&isArray$4(Ie);let Ne=!1,Fe=!1,Ue=!0;if(ke){const[We,,qe]=xe(Ie.contentRect),ze=domRectHasDimensions(We),Ge=domRectAppeared(We,qe);Fe=!qe||Ge,Ne=!Fe&&!ze,Ue=!Ne}else Be?[,Ue]=Ie:Fe=Ie===!0;if(pe&&Ue){const We=Be?Ie[0]:getDirectionIsRTL($e);scrollElementTo($e,{x:convertScrollPosition(3333333,3333333,We&&ye),y:3333333})}Ne||oe({vt:Be?Ie:void 0,ht:!Be,dt:Fe})};if(_$3){const Ie=new _$3(ke=>Ae(ke.pop()));Ie.observe(Re),push$2(_e,()=>{Ie.disconnect()})}else if(ge){const[Ie,ke]=ge(Re,Ae,me);push$2(_e,concat([addClass($e,et$3),addEventListener$1($e,"animationstart",Ie)],ke))}else return noop$8;if(pe){const[Ie]=createCache$1({o:void 0},ve);push$2(_e,addEventListener$1($e,"scroll",ke=>{const Be=Ie(),[Ne,Fe,Ue]=Be;Fe&&(removeClass(Re,"ltr rtl"),addClass(Re,Ne?"rtl":"ltr"),Ae([!!Ne,Fe,Ue])),stopPropagation(ke)}))}return bind$2(runEachAndClear,push$2(_e,appendChildren(ne,$e)))}},createTrinsicObserver=(ne,oe)=>{let ce;const ue=ve=>ve.h===0||ve.isIntersecting||ve.intersectionRatio>0,pe=createDiv(at$2),[me]=createCache$1({o:!1}),ge=(ve,xe)=>{if(ve){const _e=me(ue(ve)),[,Se]=_e;return Se&&!xe&&oe(_e)&&[_e]}},ye=(ve,xe)=>ge(xe.pop(),ve);return[()=>{const ve=[];if(f$5)ce=new f$5(bind$2(ye,!1),{root:ne}),ce.observe(pe),push$2(ve,()=>{ce.disconnect()});else{const xe=()=>{const _e=k$6(pe);ge(_e)};push$2(ve,createSizeObserver(pe,xe)()),xe()}return bind$2(runEachAndClear,push$2(ve,appendChildren(ne,pe)))},()=>ce&&ye(!0,ce.takeRecords())]},createObserversSetup=(ne,oe,ce,ue)=>{let pe,me,ge,ye,ve,xe;const{L:_e}=getEnvironment(),Se=`[${j$4}]`,$e=`[${K$3}]`,Re=["tabindex"],Ae=["wrap","cols","rows"],Ie=["id","class","style","open"],{gt:ke,bt:Be,D:Ne,wt:Fe,St:Ue,V:We,yt:qe,Ot:ze}=ne,Ge={$t:!1,N:getDirectionIsRTL(ke)},Ze=getEnvironment(),Dt=getStaticPluginModuleInstance(Tt),[Je]=createCache$1({u:equalWH,o:{w:0,h:0}},()=>{const Yt=Dt&&Dt.M(ne,oe,Ge,Ze,ce).W,Jt=qe(Q$3),hn=!We&&qe(Z$3),Ye=hn&&getElmentScroll(Ne);ze(Q$3),We&&ze(Y$3,!0);const Xe=hn&&Yt&&Yt()[0],Pt=M$4(Fe),sn=M$4(Ne),yn=fractionalSize(Ne);return ze(Q$3,Jt),We&&ze(Y$3),Xe&&Xe(),scrollElementTo(Ne,Ye),{w:sn.w+Pt.w+yn.w,h:sn.h+Pt.h+yn.h}}),Ut=Ue?Ae:concat(Ie,Ae),jt=debounce(ue,{v:()=>pe,p:()=>me,S(Yt,Jt){const[hn]=Yt,[Ye]=Jt;return[concat(keys$1(hn),keys$1(Ye)).reduce((Xe,Pt)=>(Xe[Pt]=hn[Pt]||Ye[Pt],Xe),{})]}}),Ke=Yt=>{if(We){const Jt=getDirectionIsRTL(ke);assignDeep(Yt,{Ct:xe!==Jt}),assignDeep(Ge,{N:Jt}),xe=Jt}},an=Yt=>{each(Yt||Re,Jt=>{if(inArray(Re,Jt)){const hn=getAttr(Be,Jt);isString$2(hn)?setAttrs(Ne,Jt,hn):removeAttrs(Ne,Jt)}})},Zt=(Yt,Jt)=>{const[hn,Ye]=Yt,Xe={xt:Ye};return assignDeep(Ge,{$t:hn}),!Jt&&ue(Xe),Xe},en=({ht:Yt,vt:Jt,dt:hn})=>{const Xe=!(Yt&&!hn&&!Jt)&&_e?jt:ue,[Pt,sn]=Jt||[],yn={ht:Yt||hn,dt:hn,Ct:sn};Ke(yn),Jt&&assignDeep(Ge,{N:Pt}),Xe(yn)},Kt=(Yt,Jt)=>{const[,hn]=Je(),Ye={Ht:hn};return Ke(Ye),hn&&!Jt&&(Yt?ue:jt)(Ye),Ye},Wt=(Yt,Jt,hn)=>{const Ye={It:Jt};return Ke(Ye),Jt&&!hn?jt(Ye):We||an(Yt),Ye},{Z:un}=Ze,[Xt,nn]=Fe?createTrinsicObserver(Be,Zt):[],vn=!We&&createSizeObserver(Be,en,{dt:!0,_t:!0}),[Sn,Cn]=createDOMObserver(Be,!1,Wt,{rt:Ie,ct:concat(Ie,Re)}),Nt=We&&_$3&&new _$3(Yt=>{const Jt=Yt[Yt.length-1].contentRect;en({ht:!0,dt:domRectAppeared(Jt,ve)}),ve=Jt});return[()=>{an(),Nt&&Nt.observe(Be);const Yt=vn&&vn(),Jt=Xt&&Xt(),hn=Sn(),Ye=un(Xe=>{const[,Pt]=Je();jt({zt:Xe,Ht:Pt})});return()=>{Nt&&Nt.disconnect(),Yt&&Yt(),Jt&&Jt(),ye&&ye(),hn(),Ye()}},({Et:Yt,At:Jt,Tt:hn})=>{const Ye={},[Xe]=Yt("update.ignoreMutation"),[Pt,sn]=Yt("update.attributes"),[yn,qt]=Yt("update.elementEvents"),[wn,Tn]=Yt("update.debounce"),xn=qt||sn,Nn=Jt||hn,zn=Yn=>isFunction$2(Xe)&&Xe(Yn);if(xn){ge&&ge(),ye&&ye();const[Yn,Kn]=createDOMObserver(Fe||Ne,!0,Kt,{ct:concat(Ut,Pt||[]),lt:yn,it:Se,ft:(Rn,Mn)=>{const{target:Xn,attributeName:Jn}=Rn;return(!Mn&&Jn&&!We?liesBetween(Xn,Se,$e):!1)||!!closest$2(Xn,`.${ft}`)||!!zn(Rn)}});ye=Yn(),ge=Kn}if(Tn)if(jt.m(),isArray$4(wn)){const Yn=wn[0],Kn=wn[1];pe=isNumber$2(Yn)&&Yn,me=isNumber$2(Kn)&&Kn}else isNumber$2(wn)?(pe=wn,me=!1):(pe=!1,me=!1);if(Nn){const Yn=Cn(),Kn=nn&&nn(),Rn=ge&&ge();Yn&&assignDeep(Ye,Wt(Yn[0],Yn[1],Nn)),Kn&&assignDeep(Ye,Zt(Kn[0],Nn)),Rn&&assignDeep(Ye,Kt(Rn[0],Nn))}return Ke(Ye),Ye},Ge]},createScrollbarsSetupElements=(ne,oe,ce,ue)=>{const{G:pe,K:me}=getEnvironment(),{scrollbars:ge}=pe(),{slot:ye}=ge,{gt:ve,bt:xe,D:_e,Dt:Se,kt:$e,Rt:Re,V:Ae}=oe,{scrollbars:Ie}=Se?{}:ne,{slot:ke}=Ie||{},Be=new Map,Ne=Yt=>d$6&&new d$6({source:$e,axis:Yt}),Fe=Ne("x"),Ue=Ne("y"),We=dynamicInitializationElement([ve,xe,_e],()=>Ae&&Re?ve:xe,ye,ke),qe=(Yt,Jt)=>{if(Jt){const yn=Yt?H$4:I$3,{Mt:qt,Vt:wn}=Jt,Tn=getBoundingClientRect(wn)[yn],xn=getBoundingClientRect(qt)[yn];return capNumber(0,1,Tn/xn||0)}const hn=Yt?"x":"y",{Lt:Ye,Pt:Xe}=ce,Pt=Xe[hn],sn=Ye[hn];return capNumber(0,1,Pt/(Pt+sn)||0)},ze=(Yt,Jt,hn,Ye)=>{const Xe=qe(hn,Yt);return 1/Xe*(1-Xe)*(Ye?1-Jt:Jt)||0},Ge=(Yt,Jt)=>assignDeep(Yt,Jt?{clear:["left"]}:{}),Ze=Yt=>{Be.forEach((Jt,hn)=>{(Yt?inArray(createOrKeepArray(Yt),hn):!0)&&(each(Jt||[],Xe=>{Xe&&Xe.cancel()}),Be.delete(hn))})},Dt=(Yt,Jt,hn,Ye)=>{const Xe=Be.get(Yt)||[],Pt=Xe.find(sn=>sn&&sn.timeline===Jt);Pt?Pt.effect=new KeyframeEffect(Yt,hn,{composite:Ye}):Be.set(Yt,concat(Xe,[Yt.animate(hn,{timeline:Jt,composite:Ye})]))},Je=(Yt,Jt,hn)=>{const Ye=hn?addClass:removeClass;each(Yt,Xe=>{Ye(Xe.Ut,Jt)})},Ut=(Yt,Jt)=>{each(Yt,hn=>{const[Ye,Xe]=Jt(hn);setStyles(Ye,Xe)})},jt=(Yt,Jt)=>{Ut(Yt,hn=>{const{Vt:Ye}=hn;return[Ye,{[Jt?H$4:I$3]:ratioToCssPercent(qe(Jt))}]})},Ke=(Yt,Jt)=>{const{Lt:hn}=ce,Ye=Jt?hn.x:hn.y,Xe=(Pt,sn,yn)=>getTrasformTranslateValue(ratioToCssPercent(ze(Pt,getRawScrollRatio(sn,Ye,yn),Jt,yn)),Jt);if(Fe&&Ue)each(Yt,Pt=>{const{Ut:sn,Vt:yn}=Pt,qt=Jt&&getDirectionIsRTL(sn)&&me;Dt(yn,Jt?Fe:Ue,Ge({transform:getRawScrollBounds(Ye,qt).map(wn=>Xe(Pt,wn,qt))},qt))});else{const Pt=getElmentScroll($e);Ut(Yt,sn=>{const{Vt:yn,Ut:qt}=sn;return[yn,{transform:Xe(sn,Jt?Pt.x:Pt.y,Jt&&getDirectionIsRTL(qt)&&me)}]})}},an=Yt=>Ae&&!Re&&parent(Yt)===_e,Zt=[],en=[],Kt=[],Wt=(Yt,Jt,hn)=>{const Ye=isBoolean$2(hn),Xe=Ye?hn:!0,Pt=Ye?!hn:!0;Xe&&Je(en,Yt,Jt),Pt&&Je(Kt,Yt,Jt)},un=()=>{jt(en,!0),jt(Kt)},Xt=()=>{Ke(en,!0),Ke(Kt)},nn=()=>{if(Ae){const{Lt:Yt}=ce,Jt=.5;if(Fe&&Ue)each(concat(Kt,en),({Ut:hn})=>{if(an(hn)){const Ye=(Xe,Pt,sn)=>{const yn=sn&&getDirectionIsRTL(hn)&&me;Dt(hn,Xe,Ge({transform:getRawScrollBounds(Pt-Jt,yn).map(qt=>getTrasformTranslateValue(numberToCssPx(qt),sn))},yn),"add")};Ye(Fe,Yt.x,!0),Ye(Ue,Yt.y)}else Ze(hn)});else{const hn=getElmentScroll($e),Ye=Xe=>{const{Ut:Pt}=Xe,sn=an(Pt)&&Pt,yn=(qt,wn,Tn)=>{const xn=getRawScrollRatio(qt,wn,Tn),Nn=wn*xn;return numberToCssPx(Tn?-Nn:Nn)};return[sn,{transform:sn?getTrasformTranslateValue({x:yn(hn.x,Yt.x,getDirectionIsRTL(Pt)&&me),y:yn(hn.y,Yt.y)}):""}]};Ut(en,Ye),Ut(Kt,Ye)}}},vn=Yt=>{const Jt=Yt?dt$2:vt,hn=Yt?en:Kt,Ye=isEmptyArray(hn)?wt:"",Xe=createDiv(`${ft} ${Jt} ${Ye}`),Pt=createDiv(ht$2),sn=createDiv(pt$1),yn={Ut:Xe,Mt:Pt,Vt:sn};return push$2(hn,yn),push$2(Zt,[appendChildren(Xe,Pt),appendChildren(Pt,sn),bind$2(removeElements,Xe),Ze,ue(yn,Wt,Ke,Yt)]),yn},Sn=bind$2(vn,!0),Cn=bind$2(vn,!1),Nt=()=>(appendChildren(We,en[0].Ut),appendChildren(We,Kt[0].Ut),i$6(()=>{Wt(wt)},300),bind$2(runEachAndClear,Zt));return Sn(),Cn(),[{Bt:un,Nt:Xt,jt:nn,Ft:Wt,qt:{J:Fe,Wt:en,Xt:Sn,Yt:bind$2(Ut,en)},Jt:{J:Ue,Wt:Kt,Xt:Cn,Yt:bind$2(Ut,Kt)}},Nt]},createScrollbarsSetupEvents=(ne,oe,ce)=>{const{bt:ue,kt:pe,Kt:me}=oe;return(ge,ye,ve,xe)=>{const{Ut:_e,Mt:Se,Vt:$e}=ge,[Re,Ae]=selfClearTimeout(333),[Ie,ke]=selfClearTimeout(),Be=bind$2(ve,[ge],xe),Ne=!!pe.scrollBy,Fe=`client${xe?"X":"Y"}`,Ue=xe?H$4:I$3,We=xe?"left":"top",qe=xe?"w":"h",ze=xe?"x":"y",Ge=Je=>Je.propertyName.indexOf(Ue)>-1,Ze=()=>{const Je="pointerup pointerleave pointercancel lostpointercapture",Ut=(jt,Ke)=>an=>{const{Lt:Zt}=ce,en=k$6(Se)[qe]-k$6($e)[qe],Wt=Ke*an/en*Zt[ze];scrollElementTo(pe,{[ze]:jt+Wt})};return addEventListener$1(Se,"pointerdown",jt=>{const Ke=closest$2(jt.target,`.${pt$1}`)===$e,an=Ke?$e:Se,Zt=ne.scrollbars,{button:en,isPrimary:Kt,pointerType:Wt}=jt,{pointers:un}=Zt;if(en===0&&Kt&&Zt[Ke?"dragScroll":"clickScroll"]&&(un||[]).includes(Wt)){const nn=!Ke&&jt.shiftKey,vn=bind$2(getBoundingClientRect,$e),Sn=bind$2(getBoundingClientRect,Se),Cn=(xn,Nn)=>(xn||vn())[We]-(Nn||Sn())[We],Nt=e$5(getBoundingClientRect(pe)[Ue])/k$6(pe)[qe]||1,Yt=Ut(getElmentScroll(pe)[ze]||0,1/Nt),Jt=jt[Fe],hn=vn(),Ye=Sn(),Xe=hn[Ue],Pt=Cn(hn,Ye)+Xe/2,sn=Jt-Ye[We],yn=Ke?0:sn-Pt,qt=xn=>{runEachAndClear(Tn),an.releasePointerCapture(xn.pointerId)},Tn=[addAttrClass(ue,j$4,X$3),addEventListener$1(me,Je,qt),addEventListener$1(me,"selectstart",xn=>preventDefault$1(xn),{H:!1}),addEventListener$1(Se,Je,qt),addEventListener$1(Se,"pointermove",xn=>{const Nn=xn[Fe]-Jt;(Ke||nn)&&Yt(yn+Nn)})];if(an.setPointerCapture(jt.pointerId),nn)Yt(yn);else if(!Ke){const xn=getStaticPluginModuleInstance(kt);xn&&push$2(Tn,xn(Yt,Cn,yn,Xe,sn))}}})};let Dt=!0;return bind$2(runEachAndClear,[addEventListener$1(_e,"pointerenter",()=>{ye(St,!0)}),addEventListener$1(_e,"pointerleave pointercancel",()=>{ye(St,!1)}),addEventListener$1(_e,"wheel",Je=>{const{deltaX:Ut,deltaY:jt,deltaMode:Ke}=Je;Ne&&Dt&&Ke===0&&parent(_e)===ue&&pe.scrollBy({left:Ut,top:jt,behavior:"smooth"}),Dt=!1,ye($t,!0),Re(()=>{Dt=!0,ye($t)}),preventDefault$1(Je)},{H:!1,I:!0}),addEventListener$1($e,"transitionstart",Je=>{if(Ge(Je)){const Ut=()=>{Be(),Ie(Ut)};Ut()}}),addEventListener$1($e,"transitionend transitioncancel",Je=>{Ge(Je)&&(ke(),Be())}),addEventListener$1(_e,"mousedown",bind$2(addEventListener$1,me,"click",stopPropagation,{A:!0,I:!0}),{I:!0}),Ze(),Ae,ke])}},createScrollbarsSetup=(ne,oe,ce,ue,pe,me)=>{let ge,ye,ve,xe,_e,Se=noop$8,$e=0;const[Re,Ae]=selfClearTimeout(),[Ie,ke]=selfClearTimeout(),[Be,Ne]=selfClearTimeout(100),[Fe,Ue]=selfClearTimeout(100),[We,qe]=selfClearTimeout(100),[ze,Ge]=selfClearTimeout(()=>$e),[Ze,Dt]=createScrollbarsSetupElements(ne,pe,ue,createScrollbarsSetupEvents(oe,pe,ue)),{bt:Je,Zt:Ut,Rt:jt}=pe,{Ft:Ke,Bt:an,Nt:Zt,jt:en}=Ze,Kt=vn=>{Ke(mt$1,vn,!0),Ke(mt$1,vn,!1)},Wt=(vn,Sn)=>{if(Ge(),vn)Ke(Ot);else{const Cn=bind$2(Ke,Ot,!0);$e>0&&!Sn?ze(Cn):Cn()}},un=vn=>vn.pointerType==="mouse",Xt=vn=>{un(vn)&&(xe=ye,xe&&Wt(!0))},nn=[Ne,Ge,Ue,qe,ke,Ae,()=>Se(),addEventListener$1(Je,"pointerover",Xt,{A:!0}),addEventListener$1(Je,"pointerenter",Xt),addEventListener$1(Je,"pointerleave",vn=>{un(vn)&&(xe=!1,ye&&Wt(!1))}),addEventListener$1(Je,"pointermove",vn=>{un(vn)&&ge&&Re(()=>{Ne(),Wt(!0),Fe(()=>{ge&&Wt(!1)})})}),addEventListener$1(Ut,"scroll",vn=>{Ie(()=>{Zt(),ve&&Wt(!0),Be(()=>{ve&&!xe&&Wt(!1)})}),me(vn),en()})];return[()=>bind$2(runEachAndClear,push$2(nn,Dt())),({Et:vn,Tt:Sn,Gt:Cn,Qt:Nt})=>{const{tn:Yt,nn:Jt,sn:hn}=Nt||{},{Ct:Ye,dt:Xe}=Cn||{},{N:Pt}=ce,{T:sn}=getEnvironment(),{Lt:yn,k:qt,en:wn}=ue,[Tn,xn]=vn("showNativeOverlaidScrollbars"),[Nn,zn]=vn("scrollbars.theme"),[Yn,Kn]=vn("scrollbars.visibility"),[Rn,Mn]=vn("scrollbars.autoHide"),[Xn,Jn]=vn("scrollbars.autoHideSuspend"),[pn]=vn("scrollbars.autoHideDelay"),[tn,Gt]=vn("scrollbars.dragScroll"),[bn,kn]=vn("scrollbars.clickScroll"),jn=Xe&&!Sn,Wn=wn.x||wn.y,dn=Yt||Jt||Ye||Sn,Bn=hn||Kn,mn=Tn&&sn.x&&sn.y,Pn=(ur,er)=>{const _r=Yn==="visible"||Yn==="auto"&&ur==="scroll";return Ke(gt$1,_r,er),_r};if($e=pn,jn&&(Xn&&Wn?(Kt(!1),Se(),We(()=>{Se=addEventListener$1(Ut,"scroll",bind$2(Kt,!0),{A:!0})})):Kt(!0)),xn&&Ke(ut$2,mn),zn&&(Ke(_e),Ke(Nn,!0),_e=Nn),Jn&&!Xn&&Kt(!0),Mn&&(ge=Rn==="move",ye=Rn==="leave",ve=Rn!=="never",Wt(!ve,!0)),Gt&&Ke(xt,tn),kn&&Ke(Ct$1,bn),Bn){const ur=Pn(qt.x,!0),er=Pn(qt.y,!1);Ke(bt$1,!(ur&&er))}dn&&(an(),Zt(),en(),Ke(yt,!yn.x,!0),Ke(yt,!yn.y,!1),Ke(_t,Pt&&!jt))},{},Ze]},createStructureSetupElements=ne=>{const oe=getEnvironment(),{G:ce,L:ue}=oe,{elements:pe}=ce(),{host:me,padding:ge,viewport:ye,content:ve}=pe,xe=isHTMLElement(ne),_e=xe?{}:ne,{elements:Se}=_e,{host:$e,padding:Re,viewport:Ae,content:Ie}=Se||{},ke=xe?ne:_e.target,Be=is$7(ke,"textarea"),Ne=ke.ownerDocument,Fe=Ne.documentElement,Ue=ke===Ne.body,We=Ne.defaultView,qe=()=>Ne.activeElement,ze=Yn=>{Yn&&Yn.focus&&Yn.focus()},Ge=bind$2(staticInitializationElement,[ke]),Ze=bind$2(dynamicInitializationElement,[ke]),Dt=bind$2(resolveInitialization,[ke]),Je=bind$2(createDiv,""),Ut=bind$2(Ge,Je,ye),jt=bind$2(Ze,Je,ve),Ke=Ut(Ae),an=Ke===ke,Zt=an&&Ue,en=!an&&jt(Ie),Kt=!an&&isHTMLElement(Ke)&&Ke===en,Wt=Kt&&!!Dt(ve),un=Wt?Ut():Ke,Xt=Wt?en:jt(),vn=Zt?Fe:Kt?un:Ke,Sn=Be?Ge(Je,me,$e):ke,Cn=Zt?vn:Sn,Nt=Kt?Xt:en,Yt={gt:ke,bt:Cn,D:vn,cn:!an&&Ze(Je,ge,Re),wt:Nt,kt:Zt?Fe:vn,Zt:Zt?Ne:vn,rn:Ue?Fe:ke,ln:We,Kt:Ne,St:Be,Rt:Ue,Dt:xe,V:an,an:Kt,yt:Yn=>hasAttrClass(vn,an?j$4:K$3,Yn),Ot:(Yn,Kn)=>addRemoveAttrClass(vn,an?j$4:K$3,Yn,Kn)},Jt=keys$1(Yt).reduce((Yn,Kn)=>{const Rn=Yt[Kn];return push$2(Yn,Rn&&isHTMLElement(Rn)&&!parent(Rn)?Rn:!1)},[]),hn=Yn=>Yn?inArray(Jt,Yn):null,{gt:Ye,bt:Xe,cn:Pt,D:sn,wt:yn}=Yt,qt=[()=>{removeAttrs(Xe,[j$4,N$4]),removeAttrs(Ye,N$4),Ue&&removeAttrs(Fe,[N$4,j$4])}],wn=Be&&hn(Xe);let Tn=Be?Ye:contents([yn,sn,Pt,Xe,Ye].find(Yn=>hn(Yn)===!1));const xn=Zt?Ye:yn||sn,Nn=bind$2(runEachAndClear,qt);return[Yt,()=>{const Yn=qe(),Kn=Xn=>{appendChildren(parent(Xn),contents(Xn)),removeElements(Xn)},Rn=Xn=>Xn?addEventListener$1(Xn,"focus blur",Jn=>{stopPropagation(Jn),Jn.stopImmediatePropagation()},{I:!0,H:!1}):noop$8,Mn=Rn(Yn);if(setAttrs(Xe,j$4,an?"viewport":"host"),setAttrs(Pt,tt$3,""),setAttrs(yn,ot$2,""),an||(setAttrs(sn,K$3,""),Ue&&addAttrClass(Fe,j$4,J$3)),wn&&(insertAfter(Ye,Xe),push$2(qt,()=>{insertAfter(Xe,Ye),removeElements(Xe)})),appendChildren(xn,Tn),appendChildren(Xe,Pt),appendChildren(Pt||Xe,!an&&sn),appendChildren(sn,yn),push$2(qt,[Mn,()=>{const Xn=qe(),Jn=Rn(Xn);removeAttrs(Pt,tt$3),removeAttrs(yn,ot$2),removeAttrs(sn,[F$4,q$6,K$3]),hn(yn)&&Kn(yn),hn(sn)&&Kn(sn),hn(Pt)&&Kn(Pt),ze(Xn),Jn()}]),ue&&!an&&(addAttrClass(sn,K$3,G$3),push$2(qt,bind$2(removeAttrs,sn,K$3))),!an&&We.top===We&&Yn===ke){const Xn="tabindex",Jn=getAttr(sn,Xn);setAttrs(sn,Xn,"-1"),ze(sn);const pn=()=>Jn?setAttrs(sn,Xn,Jn):removeAttrs(sn,Xn),tn=addEventListener$1(Ne,"pointerdown keydown",()=>{pn(),tn()});push$2(qt,[pn,tn])}else ze(Yn);return Mn(),Tn=0,Nn},Nn]},createTrinsicUpdateSegment=({wt:ne})=>({Gt:oe,un:ce,Tt:ue})=>{const{xt:pe}=oe||{},{$t:me}=ce;ne&&(pe||ue)&&setStyles(ne,{[I$3]:me&&"100%"})},createPaddingUpdateSegment=({bt:ne,cn:oe,D:ce,V:ue},pe)=>{const[me,ge]=createCache$1({u:equalTRBL,o:topRightBottomLeft()},bind$2(topRightBottomLeft,ne,"padding",""));return({Et:ye,Gt:ve,un:xe,Tt:_e})=>{let[Se,$e]=ge(_e);const{L:Re}=getEnvironment(),{ht:Ae,Ht:Ie,Ct:ke}=ve||{},{N:Be}=xe,[Ne,Fe]=ye("paddingAbsolute");(Ae||$e||(_e||Ie))&&([Se,$e]=me(_e));const We=!ue&&(Fe||ke||$e);if(We){const qe=!Ne||!oe&&!Re,ze=Se.r+Se.l,Ge=Se.t+Se.b,Ze={[O$3]:qe&&!Be?-ze:0,[$$4]:qe?-Ge:0,[m$5]:qe&&Be?-ze:0,top:qe?-Se.t:0,right:qe?Be?-Se.r:"auto":0,left:qe?Be?"auto":-Se.l:0,[H$4]:qe&&`calc(100% + ${ze}px)`},Dt={[b$5]:qe?Se.t:0,[w$5]:qe?Se.r:0,[y$3]:qe?Se.b:0,[S$5]:qe?Se.l:0};setStyles(oe||ce,Ze),setStyles(ce,Dt),assignDeep(pe,{cn:Se,fn:!qe,j:oe?Dt:assignDeep({},Ze,Dt)})}return{_n:We}}},createOverflowUpdateSegment=(ne,oe)=>{const ce=getEnvironment(),{bt:ue,cn:pe,D:me,V:ge,Ot:ye,Rt:ve,ln:xe}=ne,{L:_e,T:Se}=ce,$e=ve&&ge,Re=bind$2(o$4,0),Ae={u:equalWH,o:{w:0,h:0}},Ie={u:equalXY,o:{x:z$4,y:z$4}},ke=(Je,Ut)=>{const jt=n$6.devicePixelRatio%1!==0?1:0,Ke={w:Re(Je.w-Ut.w),h:Re(Je.h-Ut.h)};return{w:Ke.w>jt?Ke.w:0,h:Ke.h>jt?Ke.h:0}},[Be,Ne]=createCache$1(Ae,bind$2(fractionalSize,me)),[Fe,Ue]=createCache$1(Ae,bind$2(M$4,me)),[We,qe]=createCache$1(Ae),[ze,Ge]=createCache$1(Ae),[Ze]=createCache$1(Ie),Dt=getStaticPluginModuleInstance(Tt);return({Et:Je,Gt:Ut,un:jt,Tt:Ke},{_n:an})=>{const{ht:Zt,It:en,Ht:Kt,xt:Wt,Ct:un,zt:Xt}=Ut||{},{$t:nn}=jt,vn=Dt&&Dt.M(ne,oe,jt,ce,Je),{q:Sn,W:Cn,X:Nt,F:Yt}=vn||{},Jt=(mn,Pn)=>{if(setStyles(me,{[I$3]:""}),Pn){const{fn:ur,cn:er}=oe,{R:_r}=mn,dr=fractionalSize(ue),Sr=R$3(ue),sr=getStyles$2(me,"boxSizing")==="content-box",nr=ur||sr?er.b+er.t:0,kr=!(Se.x&&sr);setStyles(me,{[I$3]:Sr.h+dr.h+(_r.x&&kr&&Yt?Yt(mn).U.x:0)-nr})}},[hn,Ye]=getShowNativeOverlaidScrollbars(Je,ce),[Xe,Pt]=Je("overflow"),sn=!ge&&(Zt||Kt||en||Ye||Wt),yn=Zt||an||Kt||un||Xt||Ye,qt=overflowIsVisible(Xe.x),wn=overflowIsVisible(Xe.y),Tn=qt||wn;let xn=Ne(Ke),Nn=Ue(Ke),zn=qe(Ke),Yn=Ge(Ke),Kn;if(Ye&&_e&&ye(G$3,!hn),sn&&(Kn=getViewportOverflowState(ne),Jt(Kn,nn)),yn){Tn&&ye(Q$3,!1);const[mn,Pn]=Cn?Cn(Kn):[],[ur,er]=xn=Be(Ke),[_r,dr]=Nn=Fe(Ke),Sr=R$3(me),sr=_r,nr=Sr;mn&&mn(),(dr||er||Ye)&&Pn&&!hn&&Sn&&Sn(Pn,_r,ur);const kr=windowSize(xe),Mr={w:Re(o$4(_r.w,sr.w)+ur.w),h:Re(o$4(_r.h,sr.h)+ur.h)},Rr={w:Re(($e?kr.w:nr.w+Re(Sr.w-_r.w))+ur.w),h:Re(($e?kr.h:nr.h+Re(Sr.h-_r.h))+ur.h)};Yn=ze(Rr),zn=We(ke(Mr,Rr),Ke)}const[Rn,Mn]=Yn,[Xn,Jn]=zn,[pn,tn]=Nn,[Gt,bn]=xn,kn={x:Xn.w>0,y:Xn.h>0},jn=qt&&wn&&(kn.x||kn.y)||qt&&kn.x&&!kn.y||wn&&kn.y&&!kn.x;if(an||un||Xt||bn||tn||Mn||Jn||Pt||Ye||sn||yn){const mn={},Pn=setViewportOverflowState(ne,kn,Xe,mn);Nt&&Nt(Pn,jt,!!Sn&&Sn(Pn,pn,Gt),mn),sn&&Jt(Pn,nn),ge?(setAttrs(ue,F$4,mn[C$3]),setAttrs(ue,q$6,mn[x$3])):setStyles(me,mn)}addRemoveAttrClass(ue,j$4,W$3,jn),addRemoveAttrClass(pe,tt$3,nt$2,jn),ge||addRemoveAttrClass(me,K$3,Q$3,Tn);const[dn,Bn]=Ze(getViewportOverflowState(ne).k);return assignDeep(oe,{k:dn,Pt:{x:Rn.w,y:Rn.h},Lt:{x:Xn.w,y:Xn.h},en:kn}),{sn:Bn,tn:Mn,nn:Jn}}},createStructureSetup=ne=>{const[oe,ce,ue]=createStructureSetupElements(ne),pe={cn:{t:0,r:0,b:0,l:0},fn:!1,j:{[O$3]:0,[$$4]:0,[m$5]:0,[b$5]:0,[w$5]:0,[y$3]:0,[S$5]:0},Pt:{x:0,y:0},Lt:{x:0,y:0},k:{x:z$4,y:z$4},en:{x:!1,y:!1}},{gt:me,D:ge,V:ye}=oe,{L:ve,T:xe}=getEnvironment(),_e=!ve&&(xe.x||xe.y),Se=[createTrinsicUpdateSegment(oe),createPaddingUpdateSegment(oe,pe),createOverflowUpdateSegment(oe,pe)];return[ce,$e=>{const Re={},Ie=_e&&getElmentScroll(ge),ke=ye?addAttrClass(ge,j$4,Y$3):noop$8;return each(Se,Be=>{assignDeep(Re,Be($e,Re)||{})}),ke(),scrollElementTo(ge,Ie),!ye&&scrollElementTo(me,0),Re},pe,oe,ue]},createSetups=(ne,oe,ce,ue)=>{const pe=createOptionCheck(oe,{}),[me,ge,ye,ve,xe]=createStructureSetup(ne),[_e,Se,$e]=createObserversSetup(ve,ye,pe,Ne=>{Be({},Ne)}),[Re,Ae,,Ie]=createScrollbarsSetup(ne,oe,$e,ye,ve,ue),ke=Ne=>keys$1(Ne).some(Fe=>!!Ne[Fe]),Be=(Ne,Fe)=>{const{dn:Ue,Tt:We,At:qe,vn:ze}=Ne,Ge=Ue||{},Ze=!!We,Dt={Et:createOptionCheck(oe,Ge,Ze),dn:Ge,Tt:Ze};if(ze)return Ae(Dt),!1;const Je=Fe||Se(assignDeep({},Dt,{At:qe})),Ut=ge(assignDeep({},Dt,{un:$e,Gt:Je}));Ae(assignDeep({},Dt,{Gt:Je,Qt:Ut}));const jt=ke(Je),Ke=ke(Ut),an=jt||Ke||!isEmptyObject(Ge)||Ze;return an&&ce(Ne,{Gt:Je,Qt:Ut}),an};return[()=>{const{rn:Ne,D:Fe}=ve,Ue=getElmentScroll(Ne),We=[_e(),me(),Re()];return scrollElementTo(Fe,Ue),bind$2(runEachAndClear,We)},Be,()=>({hn:$e,pn:ye}),{gn:ve,bn:Ie},xe]},OverlayScrollbars=(ne,oe,ce)=>{const{nt:ue}=getEnvironment(),pe=isHTMLElement(ne),me=pe?ne:ne.target,ge=getInstance(me);if(oe&&!ge){let ye=!1;const ve=[],xe={},_e=Dt=>{const Je=removeUndefinedProperties(Dt,!0),Ut=getStaticPluginModuleInstance(zt);return Ut?Ut(Je,!0):Je},Se=assignDeep({},ue(),_e(oe)),[$e,Re,Ae]=createEventListenerHub(),[Ie,ke,Be]=createEventListenerHub(ce),Ne=(Dt,Je)=>{Be(Dt,Je),Ae(Dt,Je)},[Fe,Ue,We,qe,ze]=createSetups(ne,Se,({dn:Dt,Tt:Je},{Gt:Ut,Qt:jt})=>{const{ht:Ke,Ct:an,xt:Zt,Ht:en,It:Kt,dt:Wt}=Ut,{tn:un,nn:Xt,sn:nn}=jt;Ne("updated",[Ze,{updateHints:{sizeChanged:!!Ke,directionChanged:!!an,heightIntrinsicChanged:!!Zt,overflowEdgeChanged:!!un,overflowAmountChanged:!!Xt,overflowStyleChanged:!!nn,contentMutation:!!en,hostMutation:!!Kt,appear:!!Wt},changedOptions:Dt||{},force:!!Je}])},Dt=>Ne("scroll",[Ze,Dt])),Ge=Dt=>{removeInstance(me),runEachAndClear(ve),ye=!0,Ne("destroyed",[Ze,Dt]),Re(),ke()},Ze={options(Dt,Je){if(Dt){const Ut=Je?ue():{},jt=getOptionsDiff(Se,assignDeep(Ut,_e(Dt)));isEmptyObject(jt)||(assignDeep(Se,jt),Ue({dn:jt}))}return assignDeep({},Se)},on:Ie,off:(Dt,Je)=>{Dt&&Je&&ke(Dt,Je)},state(){const{hn:Dt,pn:Je}=We(),{N:Ut}=Dt,{Pt:jt,Lt:Ke,k:an,en:Zt,cn:en,fn:Kt}=Je;return assignDeep({},{overflowEdge:jt,overflowAmount:Ke,overflowStyle:an,hasOverflow:Zt,padding:en,paddingAbsolute:Kt,directionRTL:Ut,destroyed:ye})},elements(){const{gt:Dt,bt:Je,cn:Ut,D:jt,wt:Ke,kt:an,Zt}=qe.gn,{qt:en,Jt:Kt}=qe.bn,Wt=Xt=>{const{Vt:nn,Mt:vn,Ut:Sn}=Xt;return{scrollbar:Sn,track:vn,handle:nn}},un=Xt=>{const{Wt:nn,Xt:vn}=Xt,Sn=Wt(nn[0]);return assignDeep({},Sn,{clone:()=>{const Cn=Wt(vn());return Ue({vn:!0}),Cn}})};return assignDeep({},{target:Dt,host:Je,padding:Ut||jt,viewport:jt,content:Ke||jt,scrollOffsetElement:an,scrollEventElement:Zt,scrollbarHorizontal:un(en),scrollbarVertical:un(Kt)})},update:Dt=>Ue({Tt:Dt,At:!0}),destroy:bind$2(Ge,!1),plugin:Dt=>xe[keys$1(Dt)[0]]};return push$2(ve,[ze]),addInstance(me,Ze),registerPluginModuleInstances(Ht$1,OverlayScrollbars,[Ze,$e,xe]),cancelInitialization(qe.gn.Rt,!pe&&ne.cancel)?(Ge(!0),Ze):(push$2(ve,Fe()),Ne("initialized",[Ze]),Ze.update(!0),Ze)}return ge};OverlayScrollbars.plugin=ne=>{const oe=isArray$4(ne),ce=oe?ne:[ne],ue=ce.map(pe=>registerPluginModuleInstances(pe,OverlayScrollbars)[0]);return addPlugins(ce),oe?ue:ue[0]};OverlayScrollbars.valid=ne=>{const oe=ne&&ne.elements,ce=isFunction$2(oe)&&oe();return isPlainObject$1(ce)&&!!getInstance(ce.target)};OverlayScrollbars.env=()=>{const{P:ne,T:oe,L:ce,K:ue,J:pe,st:me,et:ge,G:ye,tt:ve,nt:xe,ot:_e}=getEnvironment();return assignDeep({},{scrollbarsSize:ne,scrollbarsOverlaid:oe,scrollbarsHiding:ce,rtlScrollBehavior:ue,scrollTimeline:pe,staticDefaultInitialization:me,staticDefaultOptions:ge,getDefaultInitialization:ye,setDefaultInitialization:ve,getDefaultOptions:xe,setDefaultOptions:_e})};const O$2=()=>{if(typeof window>"u"){const xe=()=>{};return[xe,xe]}let ne,oe;const ce=window,ue=typeof ce.requestIdleCallback=="function",pe=ce.requestAnimationFrame,me=ce.cancelAnimationFrame,ge=ue?ce.requestIdleCallback:pe,ye=ue?ce.cancelIdleCallback:me,ve=()=>{ye(ne),me(oe)};return[(xe,_e)=>{ve(),ne=ge(ue?()=>{ve(),oe=pe(xe)}:xe,typeof _e=="object"?_e:{timeout:2233})},ve]},S$4=ne=>{const{options:oe,events:ce,defer:ue}=ne||{},[pe,me]=reactExports.useMemo(O$2,[]),ge=reactExports.useRef(null),ye=reactExports.useRef(ue),ve=reactExports.useRef(oe),xe=reactExports.useRef(ce);return reactExports.useEffect(()=>{ye.current=ue},[ue]),reactExports.useEffect(()=>{const{current:_e}=ge;ve.current=oe,OverlayScrollbars.valid(_e)&&_e.options(oe||{},!0)},[oe]),reactExports.useEffect(()=>{const{current:_e}=ge;xe.current=ce,OverlayScrollbars.valid(_e)&&_e.on(ce||{},!0)},[ce]),reactExports.useEffect(()=>()=>{var _e;me(),(_e=ge.current)==null||_e.destroy()},[]),reactExports.useMemo(()=>[_e=>{const Se=ge.current;if(OverlayScrollbars.valid(Se))return;const $e=ye.current,Re=ve.current||{},Ae=xe.current||{},Ie=()=>ge.current=OverlayScrollbars(_e,Re,Ae);$e?pe(Ie,$e):Ie()},()=>ge.current],[])},F$3=(ne,oe)=>{const{element:ce="div",options:ue,events:pe,defer:me,children:ge,...ye}=ne,ve=ce,xe=reactExports.useRef(null),_e=reactExports.useRef(null),[Se,$e]=S$4({options:ue,events:pe,defer:me});return reactExports.useEffect(()=>{const{current:Re}=xe,{current:Ae}=_e;return Re&&Ae&&Se({target:Re,elements:{viewport:Ae,content:Ae}}),()=>{var Ie;return(Ie=$e())==null?void 0:Ie.destroy()}},[Se,ce]),reactExports.useImperativeHandle(oe,()=>({osInstance:$e,getElement:()=>xe.current}),[]),React$2.createElement(ve,{"data-overlayscrollbars-initialize":"",ref:xe,...ye},React$2.createElement("div",{"data-overlayscrollbars-contents":"",ref:_e},ge))},A$4=reactExports.forwardRef(F$3),Scroll=reactExports.forwardRef(({children:ne,x:oe,y:ce,px:ue=6,py:pe=0,...me},ge)=>{const{palette:ye,spacing:ve}=useTheme$1(),xe=useCss$1({"--os-padding-perpendicular":"2px","div.os-scrollbar-vertical > div.os-scrollbar-track":{height:`calc(100% - ${ve(ue)})`,marginTop:ve(ue)},"div.os-scrollbar-horizontal > div.os-scrollbar-track":{width:`calc(100% - ${ve(pe*2)})`,marginLeft:ve(pe)},"div > div.os-scrollbar-track":{"--os-handle-perpendicular-size":"2px","--os-handle-perpendicular-size-hover":"6px","--os-handle-perpendicular-size-active":"6px","> div.os-scrollbar-handle":{borderRadius:0,opacity:.5,"&:hover":{opacity:.8}}}}),_e=reactExports.useCallback(Se=>{if(ge&&Se){const $e=Se.elements().viewport;$e&&(typeof ge=="function"?ge==null||ge($e):ge.current=$e)}},[ge]);return jsxRuntimeExports.jsx(A$4,{options:{overflow:{x:oe?"scroll":"hidden",y:ce?"scroll":"hidden"},scrollbars:{autoHide:"leave",theme:ye.mode==="dark"?"os-theme-light":"os-theme-dark"}},...me,style:{width:"100%",height:"100%",...me.style},className:`${xe} ${me.className}`,events:{initialized:_e},children:ne})}),reflow=ne=>ne.scrollTop;function getTransitionProps(ne,oe){const{timeout:ce,easing:ue,style:pe={}}=ne;return{duration:pe.transitionDuration??(typeof ce=="number"?ce:ce[oe.mode]||0),easing:pe.transitionTimingFunction??(typeof ue=="object"?ue[oe.mode]:ue),delay:pe.transitionDelay}}const styles={entering:{transform:"translateY(0)",opacity:1},entered:{transform:"translateY(0)",opacity:1},exiting:{},exited:{},unmounted:{}},Swipe=reactExports.forwardRef((ne,oe)=>{const ce=useTheme$1(),ue={enter:ce.transitions.duration.enteringScreen,exit:ce.transitions.duration.leavingScreen},{addEndListener:pe,appear:me=!0,children:ge,easing:ye,in:ve,onEnter:xe,onEntered:_e,onEntering:Se,onExit:$e,onExited:Re,onExiting:Ae,style:Ie,timeout:ke=ue,TransitionComponent:Be=Transition$1,...Ne}=ne,Fe=reactExports.useRef(null),Ue=useForkRef(Fe,ge.ref,oe),We=jt=>Ke=>{if(jt){const an=Fe.current;Ke===void 0?jt(an):jt(an,Ke)}},qe=We(Se),ze=We((jt,Ke)=>{reflow(jt);const an=getTransitionProps({style:Ie,timeout:ke,easing:ye},{mode:"enter"});jt.style.webkitTransition=ce.transitions.create(["opacity","transform"],an),jt.style.transition=ce.transitions.create(["opacity","transform"],an),xe&&xe(jt,Ke)}),Ge=We(_e),Ze=We(Ae),Dt=We(jt=>{const Ke=getTransitionProps({style:Ie,timeout:ke,easing:ye},{mode:"exit"});jt.style.webkitTransition=ce.transitions.create(["opacity","transform"],Ke),jt.style.transition=ce.transitions.create(["opacity","transform"],Ke),$e&&$e(jt)}),Je=We(Re),Ut=jt=>{pe&&pe(Fe.current,jt)};return jsxRuntimeExports.jsx(Be,{appear:me,in:ve,nodeRef:Fe,onEnter:ze,onEntered:Ge,onEntering:qe,onExit:Dt,onExited:Je,onExiting:Ze,addEndListener:Ut,timeout:ke,...Ne,children:(jt,Ke)=>reactExports.cloneElement(ge,{style:{transform:"translateY(16px)",opacity:0,visibility:jt==="exited"&&!ve?"hidden":void 0,...styles[jt],...Ie,...ge.props.style},ref:Ue,...Ke})})});function AppBarTitle({children:ne}){return jsxRuntimeExports.jsx(Type$2,{component:"div",variant:"h6",children:ne})}function ModalAppBar({onClose:ne=()=>{},style:oe,elevatedStyle:ce,children:ue,transitionProperties:pe=["box-shadow","background","border-bottom"],elevatedChildren:me,simple:ge,position:ye="sticky"}){const ve=useSmallDisplay(),xe=usePanel(),_e=useTheme$1(),[,,Se,,$e]=useScrollState();reactExports.useEffect(()=>{$e(xe)},[xe,$e]);const Re=Se?{background:_e.palette.background.paper,...!ge&&{boxShadow:_e.shadows[0]},...oe}:{background:_e.palette.background.paper,...!ge&&{boxShadow:_e.shadows[4]},...ce};function Ae(Ie){return typeof Ie=="string"?jsxRuntimeExports.jsx(AppBarTitle,{children:Ie}):Ie}return jsxRuntimeExports.jsx(AppBar$1,{elevation:0,position:ye,style:{color:_e.palette.text.primary,transition:_e.transitions.create(pe),...Re},children:jsxRuntimeExports.jsxs(Toolbar$1,{children:[jsxRuntimeExports.jsx(IconButton$1,{style:{marginRight:_e.spacing(1)},"aria-label":"open drawer",edge:"start",onClick:()=>ne(),children:jsxRuntimeExports.jsx(ArrowBack,{})}),ue&&jsxRuntimeExports.jsx("div",{style:{gridColumn:1,gridRow:1,flex:1,overflow:"auto"},children:jsxRuntimeExports.jsx(Fade$1,{in:!!(!me||Se),mountOnEnter:!0,unmountOnExit:!0,children:jsxRuntimeExports.jsx(Box$1,{style:{width:"100%"},children:Ae(ue)})})}),me&&jsxRuntimeExports.jsx("div",{style:{gridColumn:1,gridRow:1,flex:1,overflow:"auto"},children:jsxRuntimeExports.jsx(Fade$1,{in:!!(me&&!Se),mountOnEnter:!0,unmountOnExit:!0,children:jsxRuntimeExports.jsx(Box$1,{style:{width:"100%"},children:Ae(me)})})})]})})}function Modal({children:ne,actions:oe,width:ce=480,height:ue,variant:pe="default",scrollable:me=!0,...ge}){var Ze;const[ye,ve]=useUIState(),[xe,_e]=reactExports.useState(void 0);reactExports.useEffect(()=>{ne&&_e(ne)},[ne]);const Se=useTheme$1(),$e=useSmallDisplay(),[Re,Ae]=reactExports.useState(null),[Ie,ke]=reactExports.useState(null),[Be,Ne]=reactExports.useState(!1),[Fe,Ue]=reactExports.useState(0),[We,qe]=reactExports.useState(0);reactExports.useEffect(()=>{if(ge.open){let Dt=0;return ve(Je=>(Dt=Je.depth,{depth:Je.depth+1})),qe(Dt+1),()=>{ve(Je=>({depth:Je.depth-1}))}}},[ve,qe,ge.open]);const ze=95-5*We;reactExports.useEffect(()=>{if(Re&&Ie&&!$e&&!ue){const Dt=()=>{const Ut=window.innerHeight-64{window.removeEventListener("resize",Dt),Je.detach()}}},[Re,Ie,$e,ue]);const Ge=pe==="submodal"&&$e;return jsxRuntimeExports.jsxs(Dialog$1,{fullScreen:$e,...ge,open:$e?ge.open&&!!We:ge.open,keepMounted:!1,TransitionComponent:$e?Swipe:void 0,TransitionProps:{unmountOnExit:!0,mountOnEnter:!0},style:{...Ge&&{paddingTop:Se.spacing(8)},...ge.style},PaperProps:{ref:Dt=>Ae(Dt),style:{...$e&&{borderRadius:`${Se.shape.borderRadius*2}px ${Se.shape.borderRadius*2}px 0 0`},background:Se.palette.background.paper,overflow:"hidden",height:ue&&!$e?ue:$e?`${ze}vh`:Be?"100%":Fe||"fit-content",position:"relative",maxWidth:"none",marginTop:$e?`${100-ze}vh`:0,...(Ze=ge.PaperProps)==null?void 0:Ze.style},...ge.PaperProps},children:[jsxRuntimeExports.jsx(Scroll,{y:!0,style:{height:"100%",width:$e?void 0:ce,maxWidth:"100%",overflow:me?void 0:"hidden"},children:jsxRuntimeExports.jsx("div",{ref:Dt=>ke(Dt),style:{width:"100%",height:$e?"100%":void 0},children:xe})}),oe]})}function ManagedModal({appBar:ne,trigger:oe=()=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{}),children:ce,popover:ue,slotProps:pe}){var _e;const me=usePaper(),ge=useAcrylic(),ye=useSmallDisplay(),ve=ue&&!ye,xe=ce??((_e=pe==null?void 0:pe.modal)==null?void 0:_e.children);return jsxRuntimeExports.jsx(PopupState,{variant:"popover",children:Se=>{const{open:$e,close:Re,isOpen:Ae}=Se,Ie=typeof xe=="function"?xe(Se):xe;return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[reactExports.cloneElement(oe($e,Ae)),ve?jsxRuntimeExports.jsx(Popover$1,{onMouseDown:ke=>{ke.stopPropagation()},onTouchStart:ke=>{ke.stopPropagation()},...lodashExports$1.merge(bindPopover(Se),{slotProps:{paper:{sx:{...ge}}}},pe==null?void 0:pe.popover),children:jsxRuntimeExports.jsx(Box$1,{...lodashExports$1.merge({sx:{width:360,...ge,...me(1)}},pe==null?void 0:pe.paper),children:Ie})}):jsxRuntimeExports.jsxs(Modal,{open:Ae,onClose:Re,...pe==null?void 0:pe.modal,children:[jsxRuntimeExports.jsx(ModalAppBar,{onClose:Re,...ne}),Ie]})]})}})}var rx_escapable=/[\\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;function quote$1(ne){return rx_escapable.lastIndex=0,rx_escapable.test(ne)?'"'+ne.replace(rx_escapable,function(oe){var ce=meta[oe];return typeof ce=="string"?ce:"\\u"+("0000"+oe.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+ne+'"'}function str$2(ne,oe,ce){var ue,pe,me,ge,ye=gap,ve,xe=oe[ne];switch(xe&&typeof xe=="object"&&typeof xe.toJSON=="function"&&(xe=xe.toJSON(ne)),typeof rep=="function"&&(xe=rep.call(oe,ne,xe)),typeof xe){case"string":return quote$1(xe);case"number":return isFinite(xe)?String(xe):"null";case"boolean":case"null":return String(xe);case"object":if(!xe)return"null";if(gap+=indent,ve=[],Object.prototype.toString.apply(xe)==="[object Array]"){for(ge=xe.length,ue=0;uece?`[ + */const createCache$1=(ne,oe)=>{const{o:ce,u:ue,_:pe}=ne;let me=ce,ge;const ye=(_e,Se)=>{const $e=me,Re=_e,Ae=Se||(ue?!ue($e,Re):$e!==Re);return(Ae||pe)&&(me=Re,ge=$e),[me,Ae,ge]};return[oe?_e=>ye(oe(me,ge),_e):ye,_e=>[me,!!_e,ge]]},t$6=typeof window<"u",n$6=t$6?window:{},o$4=Math.max,s$3=Math.min,e$5=Math.round,r$5=n$6.cancelAnimationFrame,l$5=n$6.requestAnimationFrame,i$6=n$6.setTimeout,a$4=n$6.clearTimeout,getApi=ne=>typeof n$6[ne]<"u"?n$6[ne]:void 0,u$6=getApi("MutationObserver"),f$5=getApi("IntersectionObserver"),_$3=getApi("ResizeObserver"),d$6=getApi("ScrollTimeline"),v$5=t$6&&Node.ELEMENT_NODE,{toString:h$6,hasOwnProperty:p$6}=Object.prototype,g$5=/^\[object (.+)\]$/,isUndefined=ne=>ne===void 0,isNull$1=ne=>ne===null,type$1=ne=>isUndefined(ne)||isNull$1(ne)?`${ne}`:h$6.call(ne).replace(g$5,"$1").toLowerCase(),isNumber$2=ne=>typeof ne=="number",isString$2=ne=>typeof ne=="string",isBoolean$2=ne=>typeof ne=="boolean",isFunction$2=ne=>typeof ne=="function",isArray$4=ne=>Array.isArray(ne),isObject$4=ne=>typeof ne=="object"&&!isArray$4(ne)&&!isNull$1(ne),isArrayLike=ne=>{const oe=!!ne&&ne.length,ce=isNumber$2(oe)&&oe>-1&&oe%1==0;return isArray$4(ne)||!isFunction$2(ne)&&ce?oe>0&&isObject$4(ne)?oe-1 in ne:!0:!1},isPlainObject$1=ne=>{if(!ne||!isObject$4(ne)||type$1(ne)!=="object")return!1;let oe;const ce="constructor",ue=ne[ce],pe=ue&&ue.prototype,me=p$6.call(ne,ce),ge=pe&&p$6.call(pe,"isPrototypeOf");if(ue&&!me&&!ge)return!1;for(oe in ne);return isUndefined(oe)||p$6.call(ne,oe)},isHTMLElement=ne=>{const oe=HTMLElement;return ne?oe?ne instanceof oe:ne.nodeType===v$5:!1},isElement$2=ne=>{const oe=Element;return ne?oe?ne instanceof oe:ne.nodeType===v$5:!1};function each(ne,oe){if(isArrayLike(ne))for(let ce=0;ceoe(ne[ce],ce,ne));return ne}const inArray=(ne,oe)=>ne.indexOf(oe)>=0,concat=(ne,oe)=>ne.concat(oe),push$2=(ne,oe,ce)=>(!ce&&!isString$2(oe)&&isArrayLike(oe)?Array.prototype.push.apply(ne,oe):ne.push(oe),ne),from$1=ne=>Array.from(ne||[]),createOrKeepArray=ne=>isArray$4(ne)?ne:[ne],isEmptyArray=ne=>!!ne&&!ne.length,deduplicateArray=ne=>from$1(new Set(ne)),runEachAndClear=(ne,oe,ce)=>{each(ne,pe=>pe&&pe.apply(void 0,oe||[])),!ce&&(ne.length=0)},b$5="paddingTop",w$5="paddingRight",S$5="paddingLeft",y$3="paddingBottom",m$5="marginLeft",O$3="marginRight",$$4="marginBottom",C$3="overflowX",x$3="overflowY",H$4="width",I$3="height",z$4="hidden",E$3="visible",equal=(ne,oe,ce,ue)=>{if(ne&&oe){let pe=!0;return each(ce,me=>{const ge=ue?ue(ne[me]):ne[me],ye=ue?ue(oe[me]):oe[me];ge!==ye&&(pe=!1)}),pe}return!1},equalWH=(ne,oe)=>equal(ne,oe,["w","h"]),equalXY=(ne,oe)=>equal(ne,oe,["x","y"]),equalTRBL=(ne,oe)=>equal(ne,oe,["t","r","b","l"]),noop$8=()=>{},bind$2=(ne,...oe)=>ne.bind(0,...oe),selfClearTimeout=ne=>{let oe;const ce=ne?i$6:l$5,ue=ne?a$4:r$5;return[pe=>{ue(oe),oe=ce(pe,isFunction$2(ne)?ne():ne)},()=>ue(oe)]},debounce=(ne,oe)=>{let ce,ue,pe,me=noop$8;const{v:ge,p:ye,S:ve}=oe||{},xe=function(Ae){me(),a$4(ce),ce=ue=void 0,me=noop$8,ne.apply(this,Ae)},_e=Re=>ve&&ue?ve(ue,Re):Re,Se=()=>{me!==noop$8&&xe(_e(pe)||pe)},$e=function(){const Ae=from$1(arguments),Ie=isFunction$2(ge)?ge():ge;if(isNumber$2(Ie)&&Ie>=0){const Be=isFunction$2(ye)?ye():ye,Ne=isNumber$2(Be)&&Be>=0,Fe=Ie>0?i$6:l$5,Ue=Ie>0?a$4:r$5,qe=_e(Ae)||Ae,ze=xe.bind(0,qe);me();const Ge=Fe(ze,Ie);me=()=>Ue(Ge),Ne&&!ce&&(ce=i$6(Se,Be)),ue=pe=qe}else xe(Ae)};return $e.m=Se,$e},hasOwnProperty$2=(ne,oe)=>Object.prototype.hasOwnProperty.call(ne,oe),keys$1=ne=>ne?Object.keys(ne):[],assignDeep=(ne,oe,ce,ue,pe,me,ge)=>{const ye=[oe,ce,ue,pe,me,ge];return(typeof ne!="object"||isNull$1(ne))&&!isFunction$2(ne)&&(ne={}),each(ye,ve=>{each(ve,(xe,_e)=>{const Se=ve[_e];if(ne===Se)return!0;const $e=isArray$4(Se);if(Se&&isPlainObject$1(Se)){const Re=ne[_e];let Ae=Re;$e&&!isArray$4(Re)?Ae=[]:!$e&&!isPlainObject$1(Re)&&(Ae={}),ne[_e]=assignDeep(Ae,Se)}else ne[_e]=$e?Se.slice():Se})}),ne},removeUndefinedProperties=(ne,oe)=>each(assignDeep({},ne),(ce,ue,pe)=>{ce===void 0?delete pe[ue]:oe&&ce&&isPlainObject$1(ce)&&(pe[ue]=removeUndefinedProperties(ce,oe))}),isEmptyObject=ne=>{for(const oe in ne)return!1;return!0},capNumber=(ne,oe,ce)=>o$4(ne,s$3(oe,ce)),getDomTokensArray=ne=>from$1(new Set((isArray$4(ne)?ne:(ne||"").split(" ")).filter(oe=>oe))),getAttr=(ne,oe)=>ne&&ne.getAttribute(oe),setAttrs=(ne,oe,ce)=>{each(getDomTokensArray(oe),ue=>{ne&&ne.setAttribute(ue,ce||"")})},removeAttrs=(ne,oe)=>{each(getDomTokensArray(oe),ce=>ne&&ne.removeAttribute(ce))},domTokenListAttr=(ne,oe)=>{const ce=getDomTokensArray(getAttr(ne,oe)),ue=bind$2(setAttrs,ne,oe),pe=(me,ge)=>{const ye=new Set(ce);return each(getDomTokensArray(me),ve=>ye[ge](ve)),from$1(ye).join(" ")};return{O:me=>ue(pe(me,"delete")),$:me=>ue(pe(me,"add")),C:me=>{const ge=getDomTokensArray(me);return ge.reduce((ye,ve)=>ye&&ce.includes(ve),ge.length>0)}}},removeAttrClass=(ne,oe,ce)=>{domTokenListAttr(ne,oe).O(ce)},addAttrClass=(ne,oe,ce)=>(domTokenListAttr(ne,oe).$(ce),bind$2(removeAttrClass,ne,oe,ce)),addRemoveAttrClass=(ne,oe,ce,ue)=>{(ue?addAttrClass:removeAttrClass)(ne,oe,ce)},hasAttrClass=(ne,oe,ce)=>domTokenListAttr(ne,oe).C(ce),createDomTokenListClass=ne=>domTokenListAttr(ne,"class"),removeClass=(ne,oe)=>{createDomTokenListClass(ne).O(oe)},addClass=(ne,oe)=>(createDomTokenListClass(ne).$(oe),bind$2(removeClass,ne,oe)),A$5=t$6&&Element.prototype,find$1=(ne,oe)=>{const ce=[],ue=oe?isElement$2(oe)&&oe:document;return ue?push$2(ce,ue.querySelectorAll(ne)):ce},findFirst=(ne,oe)=>{const ce=oe?isElement$2(oe)&&oe:document;return ce?ce.querySelector(ne):null},is$7=(ne,oe)=>isElement$2(ne)?(A$5.matches||A$5.msMatchesSelector).call(ne,oe):!1,contents=ne=>ne?from$1(ne.childNodes):[],parent=ne=>ne&&ne.parentElement,closest$2=(ne,oe)=>isElement$2(ne)&&ne.closest(oe),liesBetween=(ne,oe,ce)=>{const ue=closest$2(ne,oe),pe=ne&&findFirst(ce,ue),me=closest$2(pe,oe)===ue;return ue&&pe?ue===ne||pe===ne||me&&closest$2(closest$2(ne,ce),oe)!==ue:!1},removeElements=ne=>{if(isArrayLike(ne))each(from$1(ne),oe=>removeElements(oe));else if(ne){const oe=parent(ne);oe&&oe.removeChild(ne)}},before=(ne,oe,ce)=>{if(ce&&ne){let ue=oe,pe;return isArrayLike(ce)?(pe=document.createDocumentFragment(),each(ce,me=>{me===ue&&(ue=me.previousSibling),pe.appendChild(me)})):pe=ce,oe&&(ue?ue!==oe&&(ue=ue.nextSibling):ue=ne.firstChild),ne.insertBefore(pe,ue||null),()=>removeElements(ce)}return noop$8},appendChildren=(ne,oe)=>before(ne,null,oe),insertAfter=(ne,oe)=>before(parent(ne),ne&&ne.nextSibling,oe),createDiv=ne=>{const oe=document.createElement("div");return setAttrs(oe,"class",ne),oe},createDOM=ne=>{const oe=createDiv();return oe.innerHTML=ne.trim(),each(contents(oe),ce=>removeElements(ce))},T$3=/^--/,getCSSVal=(ne,oe)=>ne.getPropertyValue(oe)||ne[oe]||"",validFiniteNumber=ne=>{const oe=ne||0;return isFinite(oe)?oe:0},parseToZeroOrNumber=ne=>validFiniteNumber(parseFloat(ne||"")),ratioToCssPercent=ne=>`${(validFiniteNumber(ne)*100).toFixed(3)}%`,numberToCssPx=ne=>`${validFiniteNumber(ne)}px`;function setStyles(ne,oe){ne&&each(oe,(ce,ue)=>{try{const pe=ne.style,me=isNumber$2(ce)?numberToCssPx(ce):(ce||"")+"";T$3.test(ue)?pe.setProperty(ue,me):pe[ue]=me}catch{}})}function getStyles$2(ne,oe,ce){const ue=isString$2(oe);let pe=ue?"":{};if(ne){const me=n$6.getComputedStyle(ne,ce)||ne.style;pe=ue?getCSSVal(me,oe):oe.reduce((ge,ye)=>(ge[ye]=getCSSVal(me,ye),ge),pe)}return pe}const getDirectionIsRTL=ne=>getStyles$2(ne,"direction")==="rtl",topRightBottomLeft=(ne,oe,ce)=>{const ue=oe?`${oe}-`:"",pe=ce?`-${ce}`:"",me=`${ue}top${pe}`,ge=`${ue}right${pe}`,ye=`${ue}bottom${pe}`,ve=`${ue}left${pe}`,xe=getStyles$2(ne,[me,ge,ye,ve]);return{t:parseToZeroOrNumber(xe[me]),r:parseToZeroOrNumber(xe[ge]),b:parseToZeroOrNumber(xe[ye]),l:parseToZeroOrNumber(xe[ve])}},getTrasformTranslateValue=(ne,oe)=>`translate${isObject$4(ne)?`(${ne.x},${ne.y})`:`${oe?"X":"Y"}(${ne})`}`,D$3={w:0,h:0},getElmWidthHeightProperty=(ne,oe)=>oe?{w:oe[`${ne}Width`],h:oe[`${ne}Height`]}:D$3,windowSize=ne=>getElmWidthHeightProperty("inner",ne||n$6),k$6=bind$2(getElmWidthHeightProperty,"offset"),R$3=bind$2(getElmWidthHeightProperty,"client"),M$4=bind$2(getElmWidthHeightProperty,"scroll"),fractionalSize=ne=>{const oe=parseFloat(getStyles$2(ne,H$4))||0,ce=parseFloat(getStyles$2(ne,I$3))||0;return{w:oe-e$5(oe),h:ce-e$5(ce)}},getBoundingClientRect=ne=>ne.getBoundingClientRect(),domRectHasDimensions=ne=>!!(ne&&(ne[I$3]||ne[H$4])),domRectAppeared=(ne,oe)=>{const ce=domRectHasDimensions(ne);return!domRectHasDimensions(oe)&&ce},removeEventListener$1=(ne,oe,ce,ue)=>{each(getDomTokensArray(oe),pe=>{ne.removeEventListener(pe,ce,ue)})},addEventListener$1=(ne,oe,ce,ue)=>{var pe;const me=(pe=ue&&ue.H)!=null?pe:!0,ge=ue&&ue.I||!1,ye=ue&&ue.A||!1,ve={passive:me,capture:ge};return bind$2(runEachAndClear,getDomTokensArray(oe).map(xe=>{const _e=ye?Se=>{removeEventListener$1(ne,xe,_e,ge),ce(Se)}:ce;return ne.addEventListener(xe,_e,ve),bind$2(removeEventListener$1,ne,xe,_e,ge)}))},stopPropagation=ne=>ne.stopPropagation(),preventDefault$1=ne=>ne.preventDefault(),V$3={x:0,y:0},absoluteCoordinates=ne=>{const oe=ne&&getBoundingClientRect(ne);return oe?{x:oe.left+n$6.scrollX,y:oe.top+n$6.scrollY}:V$3},convertScrollPosition=(ne,oe,ce)=>ce?ce.n?-ne+0:ce.i?oe-ne:ne:ne,getRawScrollBounds=(ne,oe)=>[convertScrollPosition(0,ne,oe),convertScrollPosition(ne,ne,oe)],getRawScrollRatio=(ne,oe,ce)=>capNumber(0,1,convertScrollPosition(ne,oe,ce)/oe||0),scrollElementTo=(ne,oe)=>{const{x:ce,y:ue}=isNumber$2(oe)?{x:oe,y:oe}:oe||{};isNumber$2(ce)&&(ne.scrollLeft=ce),isNumber$2(ue)&&(ne.scrollTop=ue)},getElmentScroll=ne=>({x:ne.scrollLeft,y:ne.scrollTop}),manageListener=(ne,oe)=>{each(createOrKeepArray(oe),ne)},createEventListenerHub=ne=>{const oe=new Map,ce=(me,ge)=>{if(me){const ye=oe.get(me);manageListener(ve=>{ye&&ye[ve?"delete":"clear"](ve)},ge)}else oe.forEach(ye=>{ye.clear()}),oe.clear()},ue=(me,ge)=>{if(isString$2(me)){const xe=oe.get(me)||new Set;return oe.set(me,xe),manageListener(_e=>{isFunction$2(_e)&&xe.add(_e)},ge),bind$2(ce,me,ge)}isBoolean$2(ge)&&ge&&ce();const ye=keys$1(me),ve=[];return each(ye,xe=>{const _e=me[xe];_e&&push$2(ve,ue(xe,_e))}),bind$2(runEachAndClear,ve)},pe=(me,ge)=>{each(from$1(oe.get(me)),ye=>{ge&&!isEmptyArray(ge)?ye.apply(0,ge):ye()})};return ue(ne||{}),[ue,ce,pe]},opsStringify=ne=>JSON.stringify(ne,(oe,ce)=>{if(isFunction$2(ce))throw 0;return ce}),getPropByPath=(ne,oe)=>ne?`${oe}`.split(".").reduce((ce,ue)=>ce&&hasOwnProperty$2(ce,ue)?ce[ue]:void 0,ne):void 0,L$3={paddingAbsolute:!1,showNativeOverlaidScrollbars:!1,update:{elementEvents:[["img","load"]],debounce:[0,33],attributes:null,ignoreMutation:null},overflow:{x:"scroll",y:"scroll"},scrollbars:{theme:"os-theme-dark",visibility:"auto",autoHide:"never",autoHideDelay:1300,autoHideSuspend:!1,dragScroll:!0,clickScroll:!1,pointers:["mouse","touch","pen"]}},getOptionsDiff=(ne,oe)=>{const ce={},ue=concat(keys$1(oe),keys$1(ne));return each(ue,pe=>{const me=ne[pe],ge=oe[pe];if(isObject$4(me)&&isObject$4(ge))assignDeep(ce[pe]={},getOptionsDiff(me,ge)),isEmptyObject(ce[pe])&&delete ce[pe];else if(hasOwnProperty$2(oe,pe)&&ge!==me){let ye=!0;if(isArray$4(me)||isArray$4(ge))try{opsStringify(me)===opsStringify(ge)&&(ye=!1)}catch{}ye&&(ce[pe]=ge)}}),ce},createOptionCheck=(ne,oe,ce)=>ue=>[getPropByPath(ne,ue),ce||getPropByPath(oe,ue)!==void 0],P$2="data-overlayscrollbars",U$3="os-environment",B$3=`${U$3}-scrollbar-hidden`,N$4=`${P$2}-initialize`,j$4=P$2,F$4=`${j$4}-overflow-x`,q$6=`${j$4}-overflow-y`,W$3="overflowVisible",X$3="scrollbarPressed",Y$3="updating",J$3="body",K$3=`${P$2}-viewport`,Z$3="arrange",G$3="scrollbarHidden",Q$3=W$3,tt$3=`${P$2}-padding`,nt$2=Q$3,ot$2=`${P$2}-content`,st$2="os-size-observer",et$3=`${st$2}-appear`,ct$2=`${st$2}-listener`,at$2="os-trinsic-observer",ut$2="os-theme-none",ft="os-scrollbar",_t=`${ft}-rtl`,dt$2=`${ft}-horizontal`,vt=`${ft}-vertical`,ht$2=`${ft}-track`,pt$1=`${ft}-handle`,gt$1=`${ft}-visible`,bt$1=`${ft}-cornerless`,wt=`${ft}-transitionless`,St=`${ft}-interaction`,yt=`${ft}-unusable`,mt$1=`${ft}-auto-hide`,Ot=`${mt$1}-hidden`,$t=`${ft}-wheel`,Ct$1=`${ht$2}-interactive`,xt=`${pt$1}-interactive`,Ht$1={},It={},addPlugins=ne=>{each(ne,oe=>each(oe,(ce,ue)=>{Ht$1[ue]=oe[ue]}))},registerPluginModuleInstances=(ne,oe,ce)=>keys$1(ne).map(ue=>{const{static:pe,instance:me}=ne[ue],[ge,ye,ve]=ce||[],xe=ce?me:pe;if(xe){const _e=ce?xe(ge,ye,oe):xe(oe);return(ve||It)[ue]=_e}}),getStaticPluginModuleInstance=ne=>It[ne],zt="__osOptionsValidationPlugin",Et$1="__osSizeObserverPlugin",getShowNativeOverlaidScrollbars=(ne,oe)=>{const{T:ce}=oe,[ue,pe]=ne("showNativeOverlaidScrollbars");return[ue&&ce.x&&ce.y,pe]},overflowIsVisible=ne=>ne.indexOf(E$3)===0,getViewportOverflowState=(ne,oe)=>{const{D:ce}=ne,ue=ve=>{const xe=getStyles$2(ce,ve),Se=(oe?oe[ve]:xe)==="scroll";return[xe,Se]},[pe,me]=ue(C$3),[ge,ye]=ue(x$3);return{k:{x:pe,y:ge},R:{x:me,y:ye}}},setViewportOverflowState=(ne,oe,ce,ue)=>{const pe=oe.x||oe.y,me=(_e,Se)=>{const $e=overflowIsVisible(_e),Re=$e&&pe?"hidden":"",Ae=Se&&$e&&_e.replace(`${E$3}-`,"")||Re;return[Se&&!$e?_e:"",overflowIsVisible(Ae)?"hidden":Ae]},[ge,ye]=me(ce.x,oe.x),[ve,xe]=me(ce.y,oe.y);return ue[C$3]=ye&&ve?ye:ge,ue[x$3]=xe&&ge?xe:ve,getViewportOverflowState(ne,ue)},Tt="__osScrollbarsHidingPlugin",kt="__osClickScrollPlugin";let Mt;const createEnvironment=()=>{const ne=(Fe,Ue,We,qe)=>{appendChildren(Fe,Ue);const ze=R$3(Ue),Ge=k$6(Ue),Ze=fractionalSize(We);return qe&&removeElements(Ue),{x:Ge.h-ze.h+Ze.h,y:Ge.w-ze.w+Ze.w}},oe=Fe=>{let Ue=!1;const We=addClass(Fe,B$3);try{Ue=getStyles$2(Fe,"scrollbar-width")==="none"||getStyles$2(Fe,"display","::-webkit-scrollbar")==="none"}catch{}return We(),Ue},ce=(Fe,Ue)=>{setStyles(Fe,{[C$3]:z$4,[x$3]:z$4,direction:"rtl"}),scrollElementTo(Fe,{x:0});const We=absoluteCoordinates(Fe),qe=absoluteCoordinates(Ue);scrollElementTo(Fe,{x:-999});const ze=absoluteCoordinates(Ue);return{i:We.x===qe.x,n:qe.x!==ze.x}},{body:ue}=document,me=createDOM(`
`)[0],ge=me.firstChild,[ye,,ve]=createEventListenerHub(),[xe,_e]=createCache$1({o:ne(ue,me,ge),u:equalXY},bind$2(ne,ue,me,ge,!0)),[Se]=_e(),$e=oe(me),Re={x:Se.x===0,y:Se.y===0},Ae={elements:{host:null,padding:!$e,viewport:Fe=>$e&&Fe===Fe.ownerDocument.body&&Fe,content:!1},scrollbars:{slot:!0},cancel:{nativeScrollbarsOverlaid:!1,body:null}},Ie=assignDeep({},L$3),ke=bind$2(assignDeep,{},Ie),Be=bind$2(assignDeep,{},Ae),Ne={P:Se,T:Re,L:$e,J:!!d$6,K:ce(me,ge),Z:bind$2(ye,"r"),G:Be,tt:Fe=>assignDeep(Ae,Fe)&&Be(),nt:ke,ot:Fe=>assignDeep(Ie,Fe)&&ke(),st:assignDeep({},Ae),et:assignDeep({},Ie)};return removeAttrs(me,"style"),removeElements(me),n$6.addEventListener("resize",()=>{let Fe;if(!$e&&(!Re.x||!Re.y)){const Ue=getStaticPluginModuleInstance(Tt);Fe=!!(Ue?Ue.Y():noop$8)(Ne,xe)}ve("r",[Fe])}),Ne},getEnvironment=()=>(Mt||(Mt=createEnvironment()),Mt),resolveInitialization=(ne,oe)=>isFunction$2(oe)?oe.apply(0,ne):oe,staticInitializationElement=(ne,oe,ce,ue)=>{const pe=isUndefined(ue)?ce:ue;return resolveInitialization(ne,pe)||oe.apply(0,ne)},dynamicInitializationElement=(ne,oe,ce,ue)=>{const pe=isUndefined(ue)?ce:ue,me=resolveInitialization(ne,pe);return!!me&&(isHTMLElement(me)?me:oe.apply(0,ne))},cancelInitialization=(ne,oe)=>{const{nativeScrollbarsOverlaid:ce,body:ue}=oe||{},{T:pe,L:me,G:ge}=getEnvironment(),{nativeScrollbarsOverlaid:ye,body:ve}=ge().cancel,xe=ce??ye,_e=isUndefined(ue)?ve:ue,Se=(pe.x||pe.y)&&xe,$e=ne&&(isNull$1(_e)?!me:_e);return!!Se||!!$e},Vt=new WeakMap,addInstance=(ne,oe)=>{Vt.set(ne,oe)},removeInstance=ne=>{Vt.delete(ne)},getInstance=ne=>Vt.get(ne),createEventContentChange=(ne,oe,ce)=>{let ue=!1;const pe=ce?new WeakMap:!1,me=()=>{ue=!0},ge=ye=>{if(pe&&ce){const ve=ce.map(xe=>{const[_e,Se]=xe||[];return[Se&&_e?(ye||find$1)(_e,ne):[],Se]});each(ve,xe=>each(xe[0],_e=>{const Se=xe[1],$e=pe.get(_e)||[];if(ne.contains(_e)&&Se){const Ae=addEventListener$1(_e,Se,Ie=>{ue?(Ae(),pe.delete(_e)):oe(Ie)});pe.set(_e,push$2($e,Ae))}else runEachAndClear($e),pe.delete(_e)}))}};return ge(),[me,ge]},createDOMObserver=(ne,oe,ce,ue)=>{let pe=!1;const{ct:me,rt:ge,lt:ye,it:ve,ut:xe,ft:_e}=ue||{},Se=debounce(()=>pe&&ce(!0),{v:33,p:99}),[$e,Re]=createEventContentChange(ne,Se,ye),Ae=me||[],Ie=ge||[],ke=concat(Ae,Ie),Be=(Fe,Ue)=>{if(!isEmptyArray(Ue)){const We=xe||noop$8,qe=_e||noop$8,ze=[],Ge=[];let Ze=!1,Dt=!1;if(each(Ue,Je=>{const{attributeName:Ut,target:jt,type:Ke,oldValue:an,addedNodes:Zt,removedNodes:en}=Je,Kt=Ke==="attributes",Wt=Ke==="childList",un=ne===jt,Xt=Kt&&Ut,nn=Xt&&getAttr(jt,Ut||"")||null,vn=Xt&&an!==nn,Sn=inArray(Ie,Ut)&&vn;if(oe&&(Wt||!un)){const Cn=Kt&&vn,Nt=Cn&&ve&&is$7(jt,ve),Jt=(Nt?!We(jt,Ut,an,nn):!Kt||Cn)&&!qe(Je,!!Nt,ne,ue);each(Zt,hn=>push$2(ze,hn)),each(en,hn=>push$2(ze,hn)),Dt=Dt||Jt}!oe&&un&&vn&&!We(jt,Ut,an,nn)&&(push$2(Ge,Ut),Ze=Ze||Sn)}),Re(Je=>deduplicateArray(ze).reduce((Ut,jt)=>(push$2(Ut,find$1(Je,jt)),is$7(jt,Je)?push$2(Ut,jt):Ut),[])),oe)return!Fe&&Dt&&ce(!1),[!1];if(!isEmptyArray(Ge)||Ze){const Je=[deduplicateArray(Ge),Ze];return!Fe&&ce.apply(0,Je),Je}}},Ne=new u$6(bind$2(Be,!1));return[()=>(Ne.observe(ne,{attributes:!0,attributeOldValue:!0,attributeFilter:ke,subtree:oe,childList:oe,characterData:oe}),pe=!0,()=>{pe&&($e(),Ne.disconnect(),pe=!1)}),()=>{if(pe)return Se.m(),Be(!0,Ne.takeRecords())}]},createSizeObserver=(ne,oe,ce)=>{const{_t:pe,dt:me}=ce||{},ge=getStaticPluginModuleInstance(Et$1),{K:ye}=getEnvironment(),ve=bind$2(getDirectionIsRTL,ne),[xe]=createCache$1({o:!1,_:!0});return()=>{const _e=[],$e=createDOM(`
`)[0],Re=$e.firstChild,Ae=Ie=>{const ke=Ie instanceof ResizeObserverEntry,Be=!ke&&isArray$4(Ie);let Ne=!1,Fe=!1,Ue=!0;if(ke){const[We,,qe]=xe(Ie.contentRect),ze=domRectHasDimensions(We),Ge=domRectAppeared(We,qe);Fe=!qe||Ge,Ne=!Fe&&!ze,Ue=!Ne}else Be?[,Ue]=Ie:Fe=Ie===!0;if(pe&&Ue){const We=Be?Ie[0]:getDirectionIsRTL($e);scrollElementTo($e,{x:convertScrollPosition(3333333,3333333,We&&ye),y:3333333})}Ne||oe({vt:Be?Ie:void 0,ht:!Be,dt:Fe})};if(_$3){const Ie=new _$3(ke=>Ae(ke.pop()));Ie.observe(Re),push$2(_e,()=>{Ie.disconnect()})}else if(ge){const[Ie,ke]=ge(Re,Ae,me);push$2(_e,concat([addClass($e,et$3),addEventListener$1($e,"animationstart",Ie)],ke))}else return noop$8;if(pe){const[Ie]=createCache$1({o:void 0},ve);push$2(_e,addEventListener$1($e,"scroll",ke=>{const Be=Ie(),[Ne,Fe,Ue]=Be;Fe&&(removeClass(Re,"ltr rtl"),addClass(Re,Ne?"rtl":"ltr"),Ae([!!Ne,Fe,Ue])),stopPropagation(ke)}))}return bind$2(runEachAndClear,push$2(_e,appendChildren(ne,$e)))}},createTrinsicObserver=(ne,oe)=>{let ce;const ue=ve=>ve.h===0||ve.isIntersecting||ve.intersectionRatio>0,pe=createDiv(at$2),[me]=createCache$1({o:!1}),ge=(ve,xe)=>{if(ve){const _e=me(ue(ve)),[,Se]=_e;return Se&&!xe&&oe(_e)&&[_e]}},ye=(ve,xe)=>ge(xe.pop(),ve);return[()=>{const ve=[];if(f$5)ce=new f$5(bind$2(ye,!1),{root:ne}),ce.observe(pe),push$2(ve,()=>{ce.disconnect()});else{const xe=()=>{const _e=k$6(pe);ge(_e)};push$2(ve,createSizeObserver(pe,xe)()),xe()}return bind$2(runEachAndClear,push$2(ve,appendChildren(ne,pe)))},()=>ce&&ye(!0,ce.takeRecords())]},createObserversSetup=(ne,oe,ce,ue)=>{let pe,me,ge,ye,ve,xe;const{L:_e}=getEnvironment(),Se=`[${j$4}]`,$e=`[${K$3}]`,Re=["tabindex"],Ae=["wrap","cols","rows"],Ie=["id","class","style","open"],{gt:ke,bt:Be,D:Ne,wt:Fe,St:Ue,V:We,yt:qe,Ot:ze}=ne,Ge={$t:!1,N:getDirectionIsRTL(ke)},Ze=getEnvironment(),Dt=getStaticPluginModuleInstance(Tt),[Je]=createCache$1({u:equalWH,o:{w:0,h:0}},()=>{const Yt=Dt&&Dt.M(ne,oe,Ge,Ze,ce).W,Jt=qe(Q$3),hn=!We&&qe(Z$3),Ye=hn&&getElmentScroll(Ne);ze(Q$3),We&&ze(Y$3,!0);const Xe=hn&&Yt&&Yt()[0],Pt=M$4(Fe),sn=M$4(Ne),yn=fractionalSize(Ne);return ze(Q$3,Jt),We&&ze(Y$3),Xe&&Xe(),scrollElementTo(Ne,Ye),{w:sn.w+Pt.w+yn.w,h:sn.h+Pt.h+yn.h}}),Ut=Ue?Ae:concat(Ie,Ae),jt=debounce(ue,{v:()=>pe,p:()=>me,S(Yt,Jt){const[hn]=Yt,[Ye]=Jt;return[concat(keys$1(hn),keys$1(Ye)).reduce((Xe,Pt)=>(Xe[Pt]=hn[Pt]||Ye[Pt],Xe),{})]}}),Ke=Yt=>{if(We){const Jt=getDirectionIsRTL(ke);assignDeep(Yt,{Ct:xe!==Jt}),assignDeep(Ge,{N:Jt}),xe=Jt}},an=Yt=>{each(Yt||Re,Jt=>{if(inArray(Re,Jt)){const hn=getAttr(Be,Jt);isString$2(hn)?setAttrs(Ne,Jt,hn):removeAttrs(Ne,Jt)}})},Zt=(Yt,Jt)=>{const[hn,Ye]=Yt,Xe={xt:Ye};return assignDeep(Ge,{$t:hn}),!Jt&&ue(Xe),Xe},en=({ht:Yt,vt:Jt,dt:hn})=>{const Xe=!(Yt&&!hn&&!Jt)&&_e?jt:ue,[Pt,sn]=Jt||[],yn={ht:Yt||hn,dt:hn,Ct:sn};Ke(yn),Jt&&assignDeep(Ge,{N:Pt}),Xe(yn)},Kt=(Yt,Jt)=>{const[,hn]=Je(),Ye={Ht:hn};return Ke(Ye),hn&&!Jt&&(Yt?ue:jt)(Ye),Ye},Wt=(Yt,Jt,hn)=>{const Ye={It:Jt};return Ke(Ye),Jt&&!hn?jt(Ye):We||an(Yt),Ye},{Z:un}=Ze,[Xt,nn]=Fe?createTrinsicObserver(Be,Zt):[],vn=!We&&createSizeObserver(Be,en,{dt:!0,_t:!0}),[Sn,Cn]=createDOMObserver(Be,!1,Wt,{rt:Ie,ct:concat(Ie,Re)}),Nt=We&&_$3&&new _$3(Yt=>{const Jt=Yt[Yt.length-1].contentRect;en({ht:!0,dt:domRectAppeared(Jt,ve)}),ve=Jt});return[()=>{an(),Nt&&Nt.observe(Be);const Yt=vn&&vn(),Jt=Xt&&Xt(),hn=Sn(),Ye=un(Xe=>{const[,Pt]=Je();jt({zt:Xe,Ht:Pt})});return()=>{Nt&&Nt.disconnect(),Yt&&Yt(),Jt&&Jt(),ye&&ye(),hn(),Ye()}},({Et:Yt,At:Jt,Tt:hn})=>{const Ye={},[Xe]=Yt("update.ignoreMutation"),[Pt,sn]=Yt("update.attributes"),[yn,qt]=Yt("update.elementEvents"),[wn,Tn]=Yt("update.debounce"),xn=qt||sn,Nn=Jt||hn,zn=Yn=>isFunction$2(Xe)&&Xe(Yn);if(xn){ge&&ge(),ye&&ye();const[Yn,Kn]=createDOMObserver(Fe||Ne,!0,Kt,{ct:concat(Ut,Pt||[]),lt:yn,it:Se,ft:(Rn,Mn)=>{const{target:Xn,attributeName:Jn}=Rn;return(!Mn&&Jn&&!We?liesBetween(Xn,Se,$e):!1)||!!closest$2(Xn,`.${ft}`)||!!zn(Rn)}});ye=Yn(),ge=Kn}if(Tn)if(jt.m(),isArray$4(wn)){const Yn=wn[0],Kn=wn[1];pe=isNumber$2(Yn)&&Yn,me=isNumber$2(Kn)&&Kn}else isNumber$2(wn)?(pe=wn,me=!1):(pe=!1,me=!1);if(Nn){const Yn=Cn(),Kn=nn&&nn(),Rn=ge&&ge();Yn&&assignDeep(Ye,Wt(Yn[0],Yn[1],Nn)),Kn&&assignDeep(Ye,Zt(Kn[0],Nn)),Rn&&assignDeep(Ye,Kt(Rn[0],Nn))}return Ke(Ye),Ye},Ge]},createScrollbarsSetupElements=(ne,oe,ce,ue)=>{const{G:pe,K:me}=getEnvironment(),{scrollbars:ge}=pe(),{slot:ye}=ge,{gt:ve,bt:xe,D:_e,Dt:Se,kt:$e,Rt:Re,V:Ae}=oe,{scrollbars:Ie}=Se?{}:ne,{slot:ke}=Ie||{},Be=new Map,Ne=Yt=>d$6&&new d$6({source:$e,axis:Yt}),Fe=Ne("x"),Ue=Ne("y"),We=dynamicInitializationElement([ve,xe,_e],()=>Ae&&Re?ve:xe,ye,ke),qe=(Yt,Jt)=>{if(Jt){const yn=Yt?H$4:I$3,{Mt:qt,Vt:wn}=Jt,Tn=getBoundingClientRect(wn)[yn],xn=getBoundingClientRect(qt)[yn];return capNumber(0,1,Tn/xn||0)}const hn=Yt?"x":"y",{Lt:Ye,Pt:Xe}=ce,Pt=Xe[hn],sn=Ye[hn];return capNumber(0,1,Pt/(Pt+sn)||0)},ze=(Yt,Jt,hn,Ye)=>{const Xe=qe(hn,Yt);return 1/Xe*(1-Xe)*(Ye?1-Jt:Jt)||0},Ge=(Yt,Jt)=>assignDeep(Yt,Jt?{clear:["left"]}:{}),Ze=Yt=>{Be.forEach((Jt,hn)=>{(Yt?inArray(createOrKeepArray(Yt),hn):!0)&&(each(Jt||[],Xe=>{Xe&&Xe.cancel()}),Be.delete(hn))})},Dt=(Yt,Jt,hn,Ye)=>{const Xe=Be.get(Yt)||[],Pt=Xe.find(sn=>sn&&sn.timeline===Jt);Pt?Pt.effect=new KeyframeEffect(Yt,hn,{composite:Ye}):Be.set(Yt,concat(Xe,[Yt.animate(hn,{timeline:Jt,composite:Ye})]))},Je=(Yt,Jt,hn)=>{const Ye=hn?addClass:removeClass;each(Yt,Xe=>{Ye(Xe.Ut,Jt)})},Ut=(Yt,Jt)=>{each(Yt,hn=>{const[Ye,Xe]=Jt(hn);setStyles(Ye,Xe)})},jt=(Yt,Jt)=>{Ut(Yt,hn=>{const{Vt:Ye}=hn;return[Ye,{[Jt?H$4:I$3]:ratioToCssPercent(qe(Jt))}]})},Ke=(Yt,Jt)=>{const{Lt:hn}=ce,Ye=Jt?hn.x:hn.y,Xe=(Pt,sn,yn)=>getTrasformTranslateValue(ratioToCssPercent(ze(Pt,getRawScrollRatio(sn,Ye,yn),Jt,yn)),Jt);if(Fe&&Ue)each(Yt,Pt=>{const{Ut:sn,Vt:yn}=Pt,qt=Jt&&getDirectionIsRTL(sn)&&me;Dt(yn,Jt?Fe:Ue,Ge({transform:getRawScrollBounds(Ye,qt).map(wn=>Xe(Pt,wn,qt))},qt))});else{const Pt=getElmentScroll($e);Ut(Yt,sn=>{const{Vt:yn,Ut:qt}=sn;return[yn,{transform:Xe(sn,Jt?Pt.x:Pt.y,Jt&&getDirectionIsRTL(qt)&&me)}]})}},an=Yt=>Ae&&!Re&&parent(Yt)===_e,Zt=[],en=[],Kt=[],Wt=(Yt,Jt,hn)=>{const Ye=isBoolean$2(hn),Xe=Ye?hn:!0,Pt=Ye?!hn:!0;Xe&&Je(en,Yt,Jt),Pt&&Je(Kt,Yt,Jt)},un=()=>{jt(en,!0),jt(Kt)},Xt=()=>{Ke(en,!0),Ke(Kt)},nn=()=>{if(Ae){const{Lt:Yt}=ce,Jt=.5;if(Fe&&Ue)each(concat(Kt,en),({Ut:hn})=>{if(an(hn)){const Ye=(Xe,Pt,sn)=>{const yn=sn&&getDirectionIsRTL(hn)&&me;Dt(hn,Xe,Ge({transform:getRawScrollBounds(Pt-Jt,yn).map(qt=>getTrasformTranslateValue(numberToCssPx(qt),sn))},yn),"add")};Ye(Fe,Yt.x,!0),Ye(Ue,Yt.y)}else Ze(hn)});else{const hn=getElmentScroll($e),Ye=Xe=>{const{Ut:Pt}=Xe,sn=an(Pt)&&Pt,yn=(qt,wn,Tn)=>{const xn=getRawScrollRatio(qt,wn,Tn),Nn=wn*xn;return numberToCssPx(Tn?-Nn:Nn)};return[sn,{transform:sn?getTrasformTranslateValue({x:yn(hn.x,Yt.x,getDirectionIsRTL(Pt)&&me),y:yn(hn.y,Yt.y)}):""}]};Ut(en,Ye),Ut(Kt,Ye)}}},vn=Yt=>{const Jt=Yt?dt$2:vt,hn=Yt?en:Kt,Ye=isEmptyArray(hn)?wt:"",Xe=createDiv(`${ft} ${Jt} ${Ye}`),Pt=createDiv(ht$2),sn=createDiv(pt$1),yn={Ut:Xe,Mt:Pt,Vt:sn};return push$2(hn,yn),push$2(Zt,[appendChildren(Xe,Pt),appendChildren(Pt,sn),bind$2(removeElements,Xe),Ze,ue(yn,Wt,Ke,Yt)]),yn},Sn=bind$2(vn,!0),Cn=bind$2(vn,!1),Nt=()=>(appendChildren(We,en[0].Ut),appendChildren(We,Kt[0].Ut),i$6(()=>{Wt(wt)},300),bind$2(runEachAndClear,Zt));return Sn(),Cn(),[{Bt:un,Nt:Xt,jt:nn,Ft:Wt,qt:{J:Fe,Wt:en,Xt:Sn,Yt:bind$2(Ut,en)},Jt:{J:Ue,Wt:Kt,Xt:Cn,Yt:bind$2(Ut,Kt)}},Nt]},createScrollbarsSetupEvents=(ne,oe,ce)=>{const{bt:ue,kt:pe,Kt:me}=oe;return(ge,ye,ve,xe)=>{const{Ut:_e,Mt:Se,Vt:$e}=ge,[Re,Ae]=selfClearTimeout(333),[Ie,ke]=selfClearTimeout(),Be=bind$2(ve,[ge],xe),Ne=!!pe.scrollBy,Fe=`client${xe?"X":"Y"}`,Ue=xe?H$4:I$3,We=xe?"left":"top",qe=xe?"w":"h",ze=xe?"x":"y",Ge=Je=>Je.propertyName.indexOf(Ue)>-1,Ze=()=>{const Je="pointerup pointerleave pointercancel lostpointercapture",Ut=(jt,Ke)=>an=>{const{Lt:Zt}=ce,en=k$6(Se)[qe]-k$6($e)[qe],Wt=Ke*an/en*Zt[ze];scrollElementTo(pe,{[ze]:jt+Wt})};return addEventListener$1(Se,"pointerdown",jt=>{const Ke=closest$2(jt.target,`.${pt$1}`)===$e,an=Ke?$e:Se,Zt=ne.scrollbars,{button:en,isPrimary:Kt,pointerType:Wt}=jt,{pointers:un}=Zt;if(en===0&&Kt&&Zt[Ke?"dragScroll":"clickScroll"]&&(un||[]).includes(Wt)){const nn=!Ke&&jt.shiftKey,vn=bind$2(getBoundingClientRect,$e),Sn=bind$2(getBoundingClientRect,Se),Cn=(xn,Nn)=>(xn||vn())[We]-(Nn||Sn())[We],Nt=e$5(getBoundingClientRect(pe)[Ue])/k$6(pe)[qe]||1,Yt=Ut(getElmentScroll(pe)[ze]||0,1/Nt),Jt=jt[Fe],hn=vn(),Ye=Sn(),Xe=hn[Ue],Pt=Cn(hn,Ye)+Xe/2,sn=Jt-Ye[We],yn=Ke?0:sn-Pt,qt=xn=>{runEachAndClear(Tn),an.releasePointerCapture(xn.pointerId)},Tn=[addAttrClass(ue,j$4,X$3),addEventListener$1(me,Je,qt),addEventListener$1(me,"selectstart",xn=>preventDefault$1(xn),{H:!1}),addEventListener$1(Se,Je,qt),addEventListener$1(Se,"pointermove",xn=>{const Nn=xn[Fe]-Jt;(Ke||nn)&&Yt(yn+Nn)})];if(an.setPointerCapture(jt.pointerId),nn)Yt(yn);else if(!Ke){const xn=getStaticPluginModuleInstance(kt);xn&&push$2(Tn,xn(Yt,Cn,yn,Xe,sn))}}})};let Dt=!0;return bind$2(runEachAndClear,[addEventListener$1(_e,"pointerenter",()=>{ye(St,!0)}),addEventListener$1(_e,"pointerleave pointercancel",()=>{ye(St,!1)}),addEventListener$1(_e,"wheel",Je=>{const{deltaX:Ut,deltaY:jt,deltaMode:Ke}=Je;Ne&&Dt&&Ke===0&&parent(_e)===ue&&pe.scrollBy({left:Ut,top:jt,behavior:"smooth"}),Dt=!1,ye($t,!0),Re(()=>{Dt=!0,ye($t)}),preventDefault$1(Je)},{H:!1,I:!0}),addEventListener$1($e,"transitionstart",Je=>{if(Ge(Je)){const Ut=()=>{Be(),Ie(Ut)};Ut()}}),addEventListener$1($e,"transitionend transitioncancel",Je=>{Ge(Je)&&(ke(),Be())}),addEventListener$1(_e,"mousedown",bind$2(addEventListener$1,me,"click",stopPropagation,{A:!0,I:!0}),{I:!0}),Ze(),Ae,ke])}},createScrollbarsSetup=(ne,oe,ce,ue,pe,me)=>{let ge,ye,ve,xe,_e,Se=noop$8,$e=0;const[Re,Ae]=selfClearTimeout(),[Ie,ke]=selfClearTimeout(),[Be,Ne]=selfClearTimeout(100),[Fe,Ue]=selfClearTimeout(100),[We,qe]=selfClearTimeout(100),[ze,Ge]=selfClearTimeout(()=>$e),[Ze,Dt]=createScrollbarsSetupElements(ne,pe,ue,createScrollbarsSetupEvents(oe,pe,ue)),{bt:Je,Zt:Ut,Rt:jt}=pe,{Ft:Ke,Bt:an,Nt:Zt,jt:en}=Ze,Kt=vn=>{Ke(mt$1,vn,!0),Ke(mt$1,vn,!1)},Wt=(vn,Sn)=>{if(Ge(),vn)Ke(Ot);else{const Cn=bind$2(Ke,Ot,!0);$e>0&&!Sn?ze(Cn):Cn()}},un=vn=>vn.pointerType==="mouse",Xt=vn=>{un(vn)&&(xe=ye,xe&&Wt(!0))},nn=[Ne,Ge,Ue,qe,ke,Ae,()=>Se(),addEventListener$1(Je,"pointerover",Xt,{A:!0}),addEventListener$1(Je,"pointerenter",Xt),addEventListener$1(Je,"pointerleave",vn=>{un(vn)&&(xe=!1,ye&&Wt(!1))}),addEventListener$1(Je,"pointermove",vn=>{un(vn)&&ge&&Re(()=>{Ne(),Wt(!0),Fe(()=>{ge&&Wt(!1)})})}),addEventListener$1(Ut,"scroll",vn=>{Ie(()=>{Zt(),ve&&Wt(!0),Be(()=>{ve&&!xe&&Wt(!1)})}),me(vn),en()})];return[()=>bind$2(runEachAndClear,push$2(nn,Dt())),({Et:vn,Tt:Sn,Gt:Cn,Qt:Nt})=>{const{tn:Yt,nn:Jt,sn:hn}=Nt||{},{Ct:Ye,dt:Xe}=Cn||{},{N:Pt}=ce,{T:sn}=getEnvironment(),{Lt:yn,k:qt,en:wn}=ue,[Tn,xn]=vn("showNativeOverlaidScrollbars"),[Nn,zn]=vn("scrollbars.theme"),[Yn,Kn]=vn("scrollbars.visibility"),[Rn,Mn]=vn("scrollbars.autoHide"),[Xn,Jn]=vn("scrollbars.autoHideSuspend"),[pn]=vn("scrollbars.autoHideDelay"),[tn,Gt]=vn("scrollbars.dragScroll"),[bn,kn]=vn("scrollbars.clickScroll"),jn=Xe&&!Sn,Wn=wn.x||wn.y,dn=Yt||Jt||Ye||Sn,Bn=hn||Kn,mn=Tn&&sn.x&&sn.y,Pn=(ur,er)=>{const _r=Yn==="visible"||Yn==="auto"&&ur==="scroll";return Ke(gt$1,_r,er),_r};if($e=pn,jn&&(Xn&&Wn?(Kt(!1),Se(),We(()=>{Se=addEventListener$1(Ut,"scroll",bind$2(Kt,!0),{A:!0})})):Kt(!0)),xn&&Ke(ut$2,mn),zn&&(Ke(_e),Ke(Nn,!0),_e=Nn),Jn&&!Xn&&Kt(!0),Mn&&(ge=Rn==="move",ye=Rn==="leave",ve=Rn!=="never",Wt(!ve,!0)),Gt&&Ke(xt,tn),kn&&Ke(Ct$1,bn),Bn){const ur=Pn(qt.x,!0),er=Pn(qt.y,!1);Ke(bt$1,!(ur&&er))}dn&&(an(),Zt(),en(),Ke(yt,!yn.x,!0),Ke(yt,!yn.y,!1),Ke(_t,Pt&&!jt))},{},Ze]},createStructureSetupElements=ne=>{const oe=getEnvironment(),{G:ce,L:ue}=oe,{elements:pe}=ce(),{host:me,padding:ge,viewport:ye,content:ve}=pe,xe=isHTMLElement(ne),_e=xe?{}:ne,{elements:Se}=_e,{host:$e,padding:Re,viewport:Ae,content:Ie}=Se||{},ke=xe?ne:_e.target,Be=is$7(ke,"textarea"),Ne=ke.ownerDocument,Fe=Ne.documentElement,Ue=ke===Ne.body,We=Ne.defaultView,qe=()=>Ne.activeElement,ze=Yn=>{Yn&&Yn.focus&&Yn.focus()},Ge=bind$2(staticInitializationElement,[ke]),Ze=bind$2(dynamicInitializationElement,[ke]),Dt=bind$2(resolveInitialization,[ke]),Je=bind$2(createDiv,""),Ut=bind$2(Ge,Je,ye),jt=bind$2(Ze,Je,ve),Ke=Ut(Ae),an=Ke===ke,Zt=an&&Ue,en=!an&&jt(Ie),Kt=!an&&isHTMLElement(Ke)&&Ke===en,Wt=Kt&&!!Dt(ve),un=Wt?Ut():Ke,Xt=Wt?en:jt(),vn=Zt?Fe:Kt?un:Ke,Sn=Be?Ge(Je,me,$e):ke,Cn=Zt?vn:Sn,Nt=Kt?Xt:en,Yt={gt:ke,bt:Cn,D:vn,cn:!an&&Ze(Je,ge,Re),wt:Nt,kt:Zt?Fe:vn,Zt:Zt?Ne:vn,rn:Ue?Fe:ke,ln:We,Kt:Ne,St:Be,Rt:Ue,Dt:xe,V:an,an:Kt,yt:Yn=>hasAttrClass(vn,an?j$4:K$3,Yn),Ot:(Yn,Kn)=>addRemoveAttrClass(vn,an?j$4:K$3,Yn,Kn)},Jt=keys$1(Yt).reduce((Yn,Kn)=>{const Rn=Yt[Kn];return push$2(Yn,Rn&&isHTMLElement(Rn)&&!parent(Rn)?Rn:!1)},[]),hn=Yn=>Yn?inArray(Jt,Yn):null,{gt:Ye,bt:Xe,cn:Pt,D:sn,wt:yn}=Yt,qt=[()=>{removeAttrs(Xe,[j$4,N$4]),removeAttrs(Ye,N$4),Ue&&removeAttrs(Fe,[N$4,j$4])}],wn=Be&&hn(Xe);let Tn=Be?Ye:contents([yn,sn,Pt,Xe,Ye].find(Yn=>hn(Yn)===!1));const xn=Zt?Ye:yn||sn,Nn=bind$2(runEachAndClear,qt);return[Yt,()=>{const Yn=qe(),Kn=Xn=>{appendChildren(parent(Xn),contents(Xn)),removeElements(Xn)},Rn=Xn=>Xn?addEventListener$1(Xn,"focus blur",Jn=>{stopPropagation(Jn),Jn.stopImmediatePropagation()},{I:!0,H:!1}):noop$8,Mn=Rn(Yn);if(setAttrs(Xe,j$4,an?"viewport":"host"),setAttrs(Pt,tt$3,""),setAttrs(yn,ot$2,""),an||(setAttrs(sn,K$3,""),Ue&&addAttrClass(Fe,j$4,J$3)),wn&&(insertAfter(Ye,Xe),push$2(qt,()=>{insertAfter(Xe,Ye),removeElements(Xe)})),appendChildren(xn,Tn),appendChildren(Xe,Pt),appendChildren(Pt||Xe,!an&&sn),appendChildren(sn,yn),push$2(qt,[Mn,()=>{const Xn=qe(),Jn=Rn(Xn);removeAttrs(Pt,tt$3),removeAttrs(yn,ot$2),removeAttrs(sn,[F$4,q$6,K$3]),hn(yn)&&Kn(yn),hn(sn)&&Kn(sn),hn(Pt)&&Kn(Pt),ze(Xn),Jn()}]),ue&&!an&&(addAttrClass(sn,K$3,G$3),push$2(qt,bind$2(removeAttrs,sn,K$3))),!an&&We.top===We&&Yn===ke){const Xn="tabindex",Jn=getAttr(sn,Xn);setAttrs(sn,Xn,"-1"),ze(sn);const pn=()=>Jn?setAttrs(sn,Xn,Jn):removeAttrs(sn,Xn),tn=addEventListener$1(Ne,"pointerdown keydown",()=>{pn(),tn()});push$2(qt,[pn,tn])}else ze(Yn);return Mn(),Tn=0,Nn},Nn]},createTrinsicUpdateSegment=({wt:ne})=>({Gt:oe,un:ce,Tt:ue})=>{const{xt:pe}=oe||{},{$t:me}=ce;ne&&(pe||ue)&&setStyles(ne,{[I$3]:me&&"100%"})},createPaddingUpdateSegment=({bt:ne,cn:oe,D:ce,V:ue},pe)=>{const[me,ge]=createCache$1({u:equalTRBL,o:topRightBottomLeft()},bind$2(topRightBottomLeft,ne,"padding",""));return({Et:ye,Gt:ve,un:xe,Tt:_e})=>{let[Se,$e]=ge(_e);const{L:Re}=getEnvironment(),{ht:Ae,Ht:Ie,Ct:ke}=ve||{},{N:Be}=xe,[Ne,Fe]=ye("paddingAbsolute");(Ae||$e||(_e||Ie))&&([Se,$e]=me(_e));const We=!ue&&(Fe||ke||$e);if(We){const qe=!Ne||!oe&&!Re,ze=Se.r+Se.l,Ge=Se.t+Se.b,Ze={[O$3]:qe&&!Be?-ze:0,[$$4]:qe?-Ge:0,[m$5]:qe&&Be?-ze:0,top:qe?-Se.t:0,right:qe?Be?-Se.r:"auto":0,left:qe?Be?"auto":-Se.l:0,[H$4]:qe&&`calc(100% + ${ze}px)`},Dt={[b$5]:qe?Se.t:0,[w$5]:qe?Se.r:0,[y$3]:qe?Se.b:0,[S$5]:qe?Se.l:0};setStyles(oe||ce,Ze),setStyles(ce,Dt),assignDeep(pe,{cn:Se,fn:!qe,j:oe?Dt:assignDeep({},Ze,Dt)})}return{_n:We}}},createOverflowUpdateSegment=(ne,oe)=>{const ce=getEnvironment(),{bt:ue,cn:pe,D:me,V:ge,Ot:ye,Rt:ve,ln:xe}=ne,{L:_e,T:Se}=ce,$e=ve&&ge,Re=bind$2(o$4,0),Ae={u:equalWH,o:{w:0,h:0}},Ie={u:equalXY,o:{x:z$4,y:z$4}},ke=(Je,Ut)=>{const jt=n$6.devicePixelRatio%1!==0?1:0,Ke={w:Re(Je.w-Ut.w),h:Re(Je.h-Ut.h)};return{w:Ke.w>jt?Ke.w:0,h:Ke.h>jt?Ke.h:0}},[Be,Ne]=createCache$1(Ae,bind$2(fractionalSize,me)),[Fe,Ue]=createCache$1(Ae,bind$2(M$4,me)),[We,qe]=createCache$1(Ae),[ze,Ge]=createCache$1(Ae),[Ze]=createCache$1(Ie),Dt=getStaticPluginModuleInstance(Tt);return({Et:Je,Gt:Ut,un:jt,Tt:Ke},{_n:an})=>{const{ht:Zt,It:en,Ht:Kt,xt:Wt,Ct:un,zt:Xt}=Ut||{},{$t:nn}=jt,vn=Dt&&Dt.M(ne,oe,jt,ce,Je),{q:Sn,W:Cn,X:Nt,F:Yt}=vn||{},Jt=(mn,Pn)=>{if(setStyles(me,{[I$3]:""}),Pn){const{fn:ur,cn:er}=oe,{R:_r}=mn,dr=fractionalSize(ue),Sr=R$3(ue),sr=getStyles$2(me,"boxSizing")==="content-box",nr=ur||sr?er.b+er.t:0,kr=!(Se.x&&sr);setStyles(me,{[I$3]:Sr.h+dr.h+(_r.x&&kr&&Yt?Yt(mn).U.x:0)-nr})}},[hn,Ye]=getShowNativeOverlaidScrollbars(Je,ce),[Xe,Pt]=Je("overflow"),sn=!ge&&(Zt||Kt||en||Ye||Wt),yn=Zt||an||Kt||un||Xt||Ye,qt=overflowIsVisible(Xe.x),wn=overflowIsVisible(Xe.y),Tn=qt||wn;let xn=Ne(Ke),Nn=Ue(Ke),zn=qe(Ke),Yn=Ge(Ke),Kn;if(Ye&&_e&&ye(G$3,!hn),sn&&(Kn=getViewportOverflowState(ne),Jt(Kn,nn)),yn){Tn&&ye(Q$3,!1);const[mn,Pn]=Cn?Cn(Kn):[],[ur,er]=xn=Be(Ke),[_r,dr]=Nn=Fe(Ke),Sr=R$3(me),sr=_r,nr=Sr;mn&&mn(),(dr||er||Ye)&&Pn&&!hn&&Sn&&Sn(Pn,_r,ur);const kr=windowSize(xe),Mr={w:Re(o$4(_r.w,sr.w)+ur.w),h:Re(o$4(_r.h,sr.h)+ur.h)},Rr={w:Re(($e?kr.w:nr.w+Re(Sr.w-_r.w))+ur.w),h:Re(($e?kr.h:nr.h+Re(Sr.h-_r.h))+ur.h)};Yn=ze(Rr),zn=We(ke(Mr,Rr),Ke)}const[Rn,Mn]=Yn,[Xn,Jn]=zn,[pn,tn]=Nn,[Gt,bn]=xn,kn={x:Xn.w>0,y:Xn.h>0},jn=qt&&wn&&(kn.x||kn.y)||qt&&kn.x&&!kn.y||wn&&kn.y&&!kn.x;if(an||un||Xt||bn||tn||Mn||Jn||Pt||Ye||sn||yn){const mn={},Pn=setViewportOverflowState(ne,kn,Xe,mn);Nt&&Nt(Pn,jt,!!Sn&&Sn(Pn,pn,Gt),mn),sn&&Jt(Pn,nn),ge?(setAttrs(ue,F$4,mn[C$3]),setAttrs(ue,q$6,mn[x$3])):setStyles(me,mn)}addRemoveAttrClass(ue,j$4,W$3,jn),addRemoveAttrClass(pe,tt$3,nt$2,jn),ge||addRemoveAttrClass(me,K$3,Q$3,Tn);const[dn,Bn]=Ze(getViewportOverflowState(ne).k);return assignDeep(oe,{k:dn,Pt:{x:Rn.w,y:Rn.h},Lt:{x:Xn.w,y:Xn.h},en:kn}),{sn:Bn,tn:Mn,nn:Jn}}},createStructureSetup=ne=>{const[oe,ce,ue]=createStructureSetupElements(ne),pe={cn:{t:0,r:0,b:0,l:0},fn:!1,j:{[O$3]:0,[$$4]:0,[m$5]:0,[b$5]:0,[w$5]:0,[y$3]:0,[S$5]:0},Pt:{x:0,y:0},Lt:{x:0,y:0},k:{x:z$4,y:z$4},en:{x:!1,y:!1}},{gt:me,D:ge,V:ye}=oe,{L:ve,T:xe}=getEnvironment(),_e=!ve&&(xe.x||xe.y),Se=[createTrinsicUpdateSegment(oe),createPaddingUpdateSegment(oe,pe),createOverflowUpdateSegment(oe,pe)];return[ce,$e=>{const Re={},Ie=_e&&getElmentScroll(ge),ke=ye?addAttrClass(ge,j$4,Y$3):noop$8;return each(Se,Be=>{assignDeep(Re,Be($e,Re)||{})}),ke(),scrollElementTo(ge,Ie),!ye&&scrollElementTo(me,0),Re},pe,oe,ue]},createSetups=(ne,oe,ce,ue)=>{const pe=createOptionCheck(oe,{}),[me,ge,ye,ve,xe]=createStructureSetup(ne),[_e,Se,$e]=createObserversSetup(ve,ye,pe,Ne=>{Be({},Ne)}),[Re,Ae,,Ie]=createScrollbarsSetup(ne,oe,$e,ye,ve,ue),ke=Ne=>keys$1(Ne).some(Fe=>!!Ne[Fe]),Be=(Ne,Fe)=>{const{dn:Ue,Tt:We,At:qe,vn:ze}=Ne,Ge=Ue||{},Ze=!!We,Dt={Et:createOptionCheck(oe,Ge,Ze),dn:Ge,Tt:Ze};if(ze)return Ae(Dt),!1;const Je=Fe||Se(assignDeep({},Dt,{At:qe})),Ut=ge(assignDeep({},Dt,{un:$e,Gt:Je}));Ae(assignDeep({},Dt,{Gt:Je,Qt:Ut}));const jt=ke(Je),Ke=ke(Ut),an=jt||Ke||!isEmptyObject(Ge)||Ze;return an&&ce(Ne,{Gt:Je,Qt:Ut}),an};return[()=>{const{rn:Ne,D:Fe}=ve,Ue=getElmentScroll(Ne),We=[_e(),me(),Re()];return scrollElementTo(Fe,Ue),bind$2(runEachAndClear,We)},Be,()=>({hn:$e,pn:ye}),{gn:ve,bn:Ie},xe]},OverlayScrollbars=(ne,oe,ce)=>{const{nt:ue}=getEnvironment(),pe=isHTMLElement(ne),me=pe?ne:ne.target,ge=getInstance(me);if(oe&&!ge){let ye=!1;const ve=[],xe={},_e=Dt=>{const Je=removeUndefinedProperties(Dt,!0),Ut=getStaticPluginModuleInstance(zt);return Ut?Ut(Je,!0):Je},Se=assignDeep({},ue(),_e(oe)),[$e,Re,Ae]=createEventListenerHub(),[Ie,ke,Be]=createEventListenerHub(ce),Ne=(Dt,Je)=>{Be(Dt,Je),Ae(Dt,Je)},[Fe,Ue,We,qe,ze]=createSetups(ne,Se,({dn:Dt,Tt:Je},{Gt:Ut,Qt:jt})=>{const{ht:Ke,Ct:an,xt:Zt,Ht:en,It:Kt,dt:Wt}=Ut,{tn:un,nn:Xt,sn:nn}=jt;Ne("updated",[Ze,{updateHints:{sizeChanged:!!Ke,directionChanged:!!an,heightIntrinsicChanged:!!Zt,overflowEdgeChanged:!!un,overflowAmountChanged:!!Xt,overflowStyleChanged:!!nn,contentMutation:!!en,hostMutation:!!Kt,appear:!!Wt},changedOptions:Dt||{},force:!!Je}])},Dt=>Ne("scroll",[Ze,Dt])),Ge=Dt=>{removeInstance(me),runEachAndClear(ve),ye=!0,Ne("destroyed",[Ze,Dt]),Re(),ke()},Ze={options(Dt,Je){if(Dt){const Ut=Je?ue():{},jt=getOptionsDiff(Se,assignDeep(Ut,_e(Dt)));isEmptyObject(jt)||(assignDeep(Se,jt),Ue({dn:jt}))}return assignDeep({},Se)},on:Ie,off:(Dt,Je)=>{Dt&&Je&&ke(Dt,Je)},state(){const{hn:Dt,pn:Je}=We(),{N:Ut}=Dt,{Pt:jt,Lt:Ke,k:an,en:Zt,cn:en,fn:Kt}=Je;return assignDeep({},{overflowEdge:jt,overflowAmount:Ke,overflowStyle:an,hasOverflow:Zt,padding:en,paddingAbsolute:Kt,directionRTL:Ut,destroyed:ye})},elements(){const{gt:Dt,bt:Je,cn:Ut,D:jt,wt:Ke,kt:an,Zt}=qe.gn,{qt:en,Jt:Kt}=qe.bn,Wt=Xt=>{const{Vt:nn,Mt:vn,Ut:Sn}=Xt;return{scrollbar:Sn,track:vn,handle:nn}},un=Xt=>{const{Wt:nn,Xt:vn}=Xt,Sn=Wt(nn[0]);return assignDeep({},Sn,{clone:()=>{const Cn=Wt(vn());return Ue({vn:!0}),Cn}})};return assignDeep({},{target:Dt,host:Je,padding:Ut||jt,viewport:jt,content:Ke||jt,scrollOffsetElement:an,scrollEventElement:Zt,scrollbarHorizontal:un(en),scrollbarVertical:un(Kt)})},update:Dt=>Ue({Tt:Dt,At:!0}),destroy:bind$2(Ge,!1),plugin:Dt=>xe[keys$1(Dt)[0]]};return push$2(ve,[ze]),addInstance(me,Ze),registerPluginModuleInstances(Ht$1,OverlayScrollbars,[Ze,$e,xe]),cancelInitialization(qe.gn.Rt,!pe&&ne.cancel)?(Ge(!0),Ze):(push$2(ve,Fe()),Ne("initialized",[Ze]),Ze.update(!0),Ze)}return ge};OverlayScrollbars.plugin=ne=>{const oe=isArray$4(ne),ce=oe?ne:[ne],ue=ce.map(pe=>registerPluginModuleInstances(pe,OverlayScrollbars)[0]);return addPlugins(ce),oe?ue:ue[0]};OverlayScrollbars.valid=ne=>{const oe=ne&&ne.elements,ce=isFunction$2(oe)&&oe();return isPlainObject$1(ce)&&!!getInstance(ce.target)};OverlayScrollbars.env=()=>{const{P:ne,T:oe,L:ce,K:ue,J:pe,st:me,et:ge,G:ye,tt:ve,nt:xe,ot:_e}=getEnvironment();return assignDeep({},{scrollbarsSize:ne,scrollbarsOverlaid:oe,scrollbarsHiding:ce,rtlScrollBehavior:ue,scrollTimeline:pe,staticDefaultInitialization:me,staticDefaultOptions:ge,getDefaultInitialization:ye,setDefaultInitialization:ve,getDefaultOptions:xe,setDefaultOptions:_e})};const O$2=()=>{if(typeof window>"u"){const xe=()=>{};return[xe,xe]}let ne,oe;const ce=window,ue=typeof ce.requestIdleCallback=="function",pe=ce.requestAnimationFrame,me=ce.cancelAnimationFrame,ge=ue?ce.requestIdleCallback:pe,ye=ue?ce.cancelIdleCallback:me,ve=()=>{ye(ne),me(oe)};return[(xe,_e)=>{ve(),ne=ge(ue?()=>{ve(),oe=pe(xe)}:xe,typeof _e=="object"?_e:{timeout:2233})},ve]},S$4=ne=>{const{options:oe,events:ce,defer:ue}=ne||{},[pe,me]=reactExports.useMemo(O$2,[]),ge=reactExports.useRef(null),ye=reactExports.useRef(ue),ve=reactExports.useRef(oe),xe=reactExports.useRef(ce);return reactExports.useEffect(()=>{ye.current=ue},[ue]),reactExports.useEffect(()=>{const{current:_e}=ge;ve.current=oe,OverlayScrollbars.valid(_e)&&_e.options(oe||{},!0)},[oe]),reactExports.useEffect(()=>{const{current:_e}=ge;xe.current=ce,OverlayScrollbars.valid(_e)&&_e.on(ce||{},!0)},[ce]),reactExports.useEffect(()=>()=>{var _e;me(),(_e=ge.current)==null||_e.destroy()},[]),reactExports.useMemo(()=>[_e=>{const Se=ge.current;if(OverlayScrollbars.valid(Se))return;const $e=ye.current,Re=ve.current||{},Ae=xe.current||{},Ie=()=>ge.current=OverlayScrollbars(_e,Re,Ae);$e?pe(Ie,$e):Ie()},()=>ge.current],[])},F$3=(ne,oe)=>{const{element:ce="div",options:ue,events:pe,defer:me,children:ge,...ye}=ne,ve=ce,xe=reactExports.useRef(null),_e=reactExports.useRef(null),[Se,$e]=S$4({options:ue,events:pe,defer:me});return reactExports.useEffect(()=>{const{current:Re}=xe,{current:Ae}=_e;return Re&&Ae&&Se({target:Re,elements:{viewport:Ae,content:Ae}}),()=>{var Ie;return(Ie=$e())==null?void 0:Ie.destroy()}},[Se,ce]),reactExports.useImperativeHandle(oe,()=>({osInstance:$e,getElement:()=>xe.current}),[]),React$2.createElement(ve,{"data-overlayscrollbars-initialize":"",ref:xe,...ye},React$2.createElement("div",{"data-overlayscrollbars-contents":"",ref:_e},ge))},A$4=reactExports.forwardRef(F$3),Scroll=reactExports.forwardRef(({children:ne,x:oe,y:ce,px:ue=6,py:pe=0,...me},ge)=>{const{palette:ye,spacing:ve}=useTheme$1(),xe=useCss$1({"--os-padding-perpendicular":"2px","div.os-scrollbar-vertical > div.os-scrollbar-track":{height:`calc(100% - ${ve(ue)})`,marginTop:ve(ue)},"div.os-scrollbar-horizontal > div.os-scrollbar-track":{width:`calc(100% - ${ve(pe*2)})`,marginLeft:ve(pe)},"div > div.os-scrollbar-track":{"--os-handle-perpendicular-size":"2px","--os-handle-perpendicular-size-hover":"6px","--os-handle-perpendicular-size-active":"6px","> div.os-scrollbar-handle":{borderRadius:0,opacity:.5,"&:hover":{opacity:.8}}}}),_e=reactExports.useCallback(Se=>{if(ge&&Se){const $e=Se.elements().viewport;$e&&(typeof ge=="function"?ge==null||ge($e):ge.current=$e)}},[ge]);return jsxRuntimeExports.jsx(A$4,{options:{overflow:{x:oe?"scroll":"hidden",y:ce?"scroll":"hidden"},scrollbars:{autoHide:"leave",theme:ye.mode==="dark"?"os-theme-light":"os-theme-dark"}},...me,style:{width:"100%",height:"100%",...me.style},className:`${xe} ${me.className}`,events:{initialized:_e},children:ne})}),reflow=ne=>ne.scrollTop;function getTransitionProps(ne,oe){const{timeout:ce,easing:ue,style:pe={}}=ne;return{duration:pe.transitionDuration??(typeof ce=="number"?ce:ce[oe.mode]||0),easing:pe.transitionTimingFunction??(typeof ue=="object"?ue[oe.mode]:ue),delay:pe.transitionDelay}}const styles={entering:{transform:"translateY(0)",opacity:1},entered:{transform:"translateY(0)",opacity:1},exiting:{},exited:{},unmounted:{}},Swipe=reactExports.forwardRef((ne,oe)=>{const ce=useTheme$1(),ue={enter:ce.transitions.duration.enteringScreen,exit:ce.transitions.duration.leavingScreen},{addEndListener:pe,appear:me=!0,children:ge,easing:ye,in:ve,onEnter:xe,onEntered:_e,onEntering:Se,onExit:$e,onExited:Re,onExiting:Ae,style:Ie,timeout:ke=ue,TransitionComponent:Be=Transition$1,...Ne}=ne,Fe=reactExports.useRef(null),Ue=useForkRef(Fe,ge.ref,oe),We=jt=>Ke=>{if(jt){const an=Fe.current;Ke===void 0?jt(an):jt(an,Ke)}},qe=We(Se),ze=We((jt,Ke)=>{reflow(jt);const an=getTransitionProps({style:Ie,timeout:ke,easing:ye},{mode:"enter"});jt.style.webkitTransition=ce.transitions.create(["opacity","transform"],an),jt.style.transition=ce.transitions.create(["opacity","transform"],an),xe&&xe(jt,Ke)}),Ge=We(_e),Ze=We(Ae),Dt=We(jt=>{const Ke=getTransitionProps({style:Ie,timeout:ke,easing:ye},{mode:"exit"});jt.style.webkitTransition=ce.transitions.create(["opacity","transform"],Ke),jt.style.transition=ce.transitions.create(["opacity","transform"],Ke),$e&&$e(jt)}),Je=We(Re),Ut=jt=>{pe&&pe(Fe.current,jt)};return jsxRuntimeExports.jsx(Be,{appear:me,in:ve,nodeRef:Fe,onEnter:ze,onEntered:Ge,onEntering:qe,onExit:Dt,onExited:Je,onExiting:Ze,addEndListener:Ut,timeout:ke,...Ne,children:(jt,Ke)=>reactExports.cloneElement(ge,{style:{transform:"translateY(16px)",opacity:0,visibility:jt==="exited"&&!ve?"hidden":void 0,...styles[jt],...Ie,...ge.props.style},ref:Ue,...Ke})})});function AppBarTitle({children:ne}){return jsxRuntimeExports.jsx(Type$2,{component:"div",variant:"h6",children:ne})}function ModalAppBar({onClose:ne=()=>{},style:oe,elevatedStyle:ce,children:ue,transitionProperties:pe=["box-shadow","background","border-bottom"],elevatedChildren:me,simple:ge,position:ye="sticky"}){const ve=useSmallDisplay(),xe=usePanel(),_e=useTheme$1(),[,,Se,,$e]=useScrollState();reactExports.useEffect(()=>{$e(xe)},[xe,$e]);const Re=Se?{background:_e.palette.background.paper,...!ge&&{boxShadow:_e.shadows[0]},...oe}:{background:_e.palette.background.paper,...!ge&&{boxShadow:_e.shadows[4]},...ce};function Ae(Ie){return typeof Ie=="string"?jsxRuntimeExports.jsx(AppBarTitle,{children:Ie}):Ie}return jsxRuntimeExports.jsx(AppBar$1,{elevation:0,position:ye,style:{color:_e.palette.text.primary,transition:_e.transitions.create(pe),...Re},children:jsxRuntimeExports.jsxs(Toolbar$1,{children:[jsxRuntimeExports.jsx(IconButton$1,{style:{marginRight:_e.spacing(1)},"aria-label":"open drawer",edge:"start",onClick:()=>ne(),children:jsxRuntimeExports.jsx(ArrowBack,{})}),ue&&jsxRuntimeExports.jsx("div",{style:{gridColumn:1,gridRow:1,flex:1,overflow:"auto"},children:jsxRuntimeExports.jsx(Fade$1,{in:!!(!me||Se),mountOnEnter:!0,unmountOnExit:!0,children:jsxRuntimeExports.jsx(Box$1,{style:{width:"100%"},children:Ae(ue)})})}),me&&jsxRuntimeExports.jsx("div",{style:{gridColumn:1,gridRow:1,flex:1,overflow:"auto"},children:jsxRuntimeExports.jsx(Fade$1,{in:!!(me&&!Se),mountOnEnter:!0,unmountOnExit:!0,children:jsxRuntimeExports.jsx(Box$1,{style:{width:"100%"},children:Ae(me)})})})]})})}function Modal({children:ne,actions:oe,width:ce=480,height:ue,variant:pe="default",scrollable:me=!0,...ge}){var Ze;const[ye,ve]=useUIState(),[xe,_e]=reactExports.useState(void 0);reactExports.useEffect(()=>{ne&&_e(ne)},[ne]);const Se=useTheme$1(),$e=useSmallDisplay(),[Re,Ae]=reactExports.useState(null),[Ie,ke]=reactExports.useState(null),[Be,Ne]=reactExports.useState(!1),[Fe,Ue]=reactExports.useState(0),[We,qe]=reactExports.useState(0);reactExports.useEffect(()=>{if(ge.open){let Dt=0;return ve(Je=>(Dt=Je.depth,{depth:Je.depth+1})),qe(Dt+1),()=>{ve(Je=>({depth:Je.depth-1}))}}},[ve,qe,ge.open]);const ze=95-5*We;reactExports.useEffect(()=>{if(Re&&Ie&&!$e&&!ue){const Dt=()=>{const Ut=window.innerHeight-64{window.removeEventListener("resize",Dt),Je.detach()}}},[Re,Ie,$e,ue]);const Ge=pe==="submodal"&&$e;return jsxRuntimeExports.jsxs(Dialog$1,{fullScreen:$e,...ge,open:$e?ge.open&&!!We:ge.open,keepMounted:!1,TransitionComponent:$e?Swipe:void 0,TransitionProps:{unmountOnExit:!0,mountOnEnter:!0},style:{...Ge&&{paddingTop:Se.spacing(8)},...ge.style},PaperProps:{ref:Dt=>Ae(Dt),style:{...$e&&{borderRadius:`${Se.shape.borderRadius*2}px ${Se.shape.borderRadius*2}px 0 0`},background:Se.palette.background.paper,overflow:"hidden",height:ue&&!$e?ue:$e?`${ze}dvh`:Be?"100%":Fe||"fit-content",position:"relative",maxWidth:"none",marginTop:$e?`${100-ze}dvh`:0,...(Ze=ge.PaperProps)==null?void 0:Ze.style},...ge.PaperProps},children:[jsxRuntimeExports.jsx(Scroll,{y:!0,style:{height:"100%",width:$e?void 0:ce,maxWidth:"100%",overflow:me?void 0:"hidden"},children:jsxRuntimeExports.jsx("div",{ref:Dt=>ke(Dt),style:{width:"100%",height:$e?"100%":void 0},children:xe})}),oe]})}function ManagedModal({appBar:ne,trigger:oe=()=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{}),children:ce,popover:ue,slotProps:pe}){var _e;const me=usePaper(),ge=useAcrylic(),ye=useSmallDisplay(),ve=ue&&!ye,xe=ce??((_e=pe==null?void 0:pe.modal)==null?void 0:_e.children);return jsxRuntimeExports.jsx(PopupState,{variant:"popover",children:Se=>{const{open:$e,close:Re,isOpen:Ae}=Se,Ie=typeof xe=="function"?xe(Se):xe;return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[reactExports.cloneElement(oe($e,Ae)),ve?jsxRuntimeExports.jsx(Popover$1,{onMouseDown:ke=>{ke.stopPropagation()},onTouchStart:ke=>{ke.stopPropagation()},...lodashExports$1.merge(bindPopover(Se),{slotProps:{paper:{sx:{...ge}}}},pe==null?void 0:pe.popover),children:jsxRuntimeExports.jsx(Box$1,{...lodashExports$1.merge({sx:{width:360,...ge,...me(1)}},pe==null?void 0:pe.paper),children:Ie})}):jsxRuntimeExports.jsxs(Modal,{open:Ae,onClose:Re,...pe==null?void 0:pe.modal,children:[jsxRuntimeExports.jsx(ModalAppBar,{onClose:Re,...ne}),Ie]})]})}})}var rx_escapable=/[\\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;function quote$1(ne){return rx_escapable.lastIndex=0,rx_escapable.test(ne)?'"'+ne.replace(rx_escapable,function(oe){var ce=meta[oe];return typeof ce=="string"?ce:"\\u"+("0000"+oe.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+ne+'"'}function str$2(ne,oe,ce){var ue,pe,me,ge,ye=gap,ve,xe=oe[ne];switch(xe&&typeof xe=="object"&&typeof xe.toJSON=="function"&&(xe=xe.toJSON(ne)),typeof rep=="function"&&(xe=rep.call(oe,ne,xe)),typeof xe){case"string":return quote$1(xe);case"number":return isFinite(xe)?String(xe):"null";case"boolean":case"null":return String(xe);case"object":if(!xe)return"null";if(gap+=indent,ve=[],Object.prototype.toString.apply(xe)==="[object Array]"){for(ge=xe.length,ue=0;uece?`[ `+gap+ve.join(`, `+gap)+` `+ye+"]":"[ "+ve.join(", ")+" ]":"["+ve.join(",")+"]",gap=ye,me}if(rep&&typeof rep=="object")for(ge=rep.length,ue=0;uece?`{ @@ -992,7 +992,7 @@ void main() { const events = $.__internal__?.events; const parent = $.__internal__?.parent; return ${ne}; - `);return ce=>oe(new Proxy(normalize$1(ce),{get(ue,pe){return typeof(ue==null?void 0:ue[pe])=="function"?ue[pe]({}):ue==null?void 0:ue[pe]}}))},openBrace$1=/^\$\{\{\s*/,closeBrace$1=/^\s*\}\}/,neverMatch$1=/\b\B/,parser$2=distExports.parseStringTemplateGenerator({VARIABLE_START:openBrace$1,VARIABLE_END:closeBrace$1,PIPE_START:neverMatch$1,PIPE_PARAMETER_START:neverMatch$1,QUOTED_STRING:neverMatch$1}),parseString$1=memoizee$1(ne=>{const oe=parser$2(ne);return lodashExports$1.join(oe.literals,"")?ce=>distExports.evaluateParsedString(oe,{},{},ue=>parseToken$1(ue)(ce)):parseToken$1(oe.variables[0].name)},{primitive:!0});function parseProperty$1(ne){switch(ne==null?void 0:ne.constructor){case Array:{const oe=lodashExports$1.map(ne,parseProperty$1);return ce=>lodashExports$1.map(oe,ue=>ue(ce))}case Object:{const oe=lodashExports$1.mapValues(ne,parseProperty$1);return ce=>lodashExports$1.mapValues(oe,ue=>ue(ce))}case String:return parseString$1(ne);default:return()=>ne}}function commonjsRequire(ne){throw new Error('Could not dynamically require "'+ne+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var pluralize$1={exports:{}};(function(ne,oe){(function(ce,ue){typeof commonjsRequire=="function"?ne.exports=ue():ce.pluralize=ue()})(commonjsGlobal,function(){var ce=[],ue=[],pe={},me={},ge={};function ye(Ie){return typeof Ie=="string"?new RegExp("^"+Ie+"$","i"):Ie}function ve(Ie,ke){return Ie===ke?ke:Ie===Ie.toLowerCase()?ke.toLowerCase():Ie===Ie.toUpperCase()?ke.toUpperCase():Ie[0]===Ie[0].toUpperCase()?ke.charAt(0).toUpperCase()+ke.substr(1).toLowerCase():ke.toLowerCase()}function xe(Ie,ke){return Ie.replace(/\$(\d{1,2})/g,function(Be,Ne){return ke[Ne]||""})}function _e(Ie,ke){return Ie.replace(ke[0],function(Be,Ne){var Fe=xe(ke[1],arguments);return ve(Be===""?Ie[Ne-1]:Be,Fe)})}function Se(Ie,ke,Be){if(!Ie.length||pe.hasOwnProperty(Ie))return ke;for(var Ne=Be.length;Ne--;){var Fe=Be[Ne];if(Fe[0].test(ke))return _e(ke,Fe)}return ke}function $e(Ie,ke,Be){return function(Ne){var Fe=Ne.toLowerCase();return ke.hasOwnProperty(Fe)?ve(Ne,Fe):Ie.hasOwnProperty(Fe)?ve(Ne,Ie[Fe]):Se(Fe,Ne,Be)}}function Re(Ie,ke,Be,Ne){return function(Fe){var Ue=Fe.toLowerCase();return ke.hasOwnProperty(Ue)?!0:Ie.hasOwnProperty(Ue)?!1:Se(Ue,Ue,Be)===Ue}}function Ae(Ie,ke,Be){var Ne=ke===1?Ae.singular(Ie):Ae.plural(Ie);return(Be?ke+" ":"")+Ne}return Ae.plural=$e(ge,me,ce),Ae.isPlural=Re(ge,me,ce),Ae.singular=$e(me,ge,ue),Ae.isSingular=Re(me,ge,ue),Ae.addPluralRule=function(Ie,ke){ce.push([ye(Ie),ke])},Ae.addSingularRule=function(Ie,ke){ue.push([ye(Ie),ke])},Ae.addUncountableRule=function(Ie){if(typeof Ie=="string"){pe[Ie.toLowerCase()]=!0;return}Ae.addPluralRule(Ie,"$0"),Ae.addSingularRule(Ie,"$0")},Ae.addIrregularRule=function(Ie,ke){ke=ke.toLowerCase(),Ie=Ie.toLowerCase(),ge[Ie]=ke,me[ke]=Ie},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach(function(Ie){return Ae.addIrregularRule(Ie[0],Ie[1])}),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach(function(Ie){return Ae.addPluralRule(Ie[0],Ie[1])}),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach(function(Ie){return Ae.addSingularRule(Ie[0],Ie[1])}),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eé]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(Ae.addUncountableRule),Ae})})(pluralize$1);var pluralizeExports=pluralize$1.exports;const pluralize=getDefaultExportFromCjs(pluralizeExports),parseTraceWorkerLegacyUrl=""+new URL("parseTrace.worker-46466b88.js",import.meta.url).href,parseTraceWorkerUrl=""+new URL("parseTrace.worker-10cdd3eb.js",import.meta.url).href;class ParseTraceWorker extends Worker{constructor(){super(parseTraceWorkerUrl,{type:"module"})}}class ParseTraceWorkerLegacy extends Worker{constructor(){super(parseTraceWorkerLegacyUrl,{type:"module"})}}const parseTraceAsync=usingMemoizedWorkerTask(ParseTraceWorker),parseTraceLegacyAsync=usingMemoizedWorkerTask(ParseTraceWorkerLegacy);function useTraceParser(ne,oe){const ce=useSnackbar(),ue=useLoadingState("specimen");return reactExports.useMemo(()=>{if(ne.trace)return()=>ue(async()=>{var pe,me;ce("Processing trace...");try{const ge=((pe=ne.trace)==null?void 0:pe.version)==="1.4.0"?await parseTraceAsync(ne):await parseTraceLegacyAsync(ne);return ce("Trace loaded",pluralize("step",((me=ge==null?void 0:ge.stepsPersistent)==null?void 0:me.length)??0,!0)),{components:ge,content:ne.trace}}catch(ge){return console.error(ge),ce("Error parsing",lodashExports$1.get(ge,"message")),{error:lodashExports$1.get(ge,"message")}}})},oe)}function mapProperties(ne={},oe){const ce={};for(const ue of Object.keys(ne))ce[ue]=ue==="$"?ne[ue]:oe(ne[ue],ue,ne);return Object.setPrototypeOf(ce,ne)}function normalize(ne={}){return mapProperties(ne,oe=>lodashExports$1.isFunction(oe)?oe:parseProperty(oe))}const parseToken=ne=>{const oe=Function("$",`return ${ne};`);return ce=>oe(new Proxy(normalize(ce),{get(ue,pe){return typeof(ue==null?void 0:ue[pe])=="function"?ue[pe]({}):ue==null?void 0:ue[pe]}}))},openBrace=/^\{\{\s*/,closeBrace=/^\s*\}\}/,neverMatch=/\b\B/,parser$1=distExports.parseStringTemplateGenerator({VARIABLE_START:openBrace,VARIABLE_END:closeBrace,PIPE_START:neverMatch,PIPE_PARAMETER_START:neverMatch,QUOTED_STRING:neverMatch}),parseString=memoizee$1(ne=>{const oe=parser$1(ne);return lodashExports$1.join(oe.literals,"")?ce=>distExports.evaluateParsedString(oe,{},{},ue=>parseToken(ue)(ce)):parseToken(oe.variables[0].name)},{primitive:!0});function parseProperty(ne){switch(ne==null?void 0:ne.constructor){case Array:{const oe=lodashExports$1.map(ne,parseProperty);return ce=>lodashExports$1.map(oe,ue=>ue(ce))}case Object:{const oe=lodashExports$1.mapValues(ne,parseProperty);return ce=>lodashExports$1.mapValues(oe,ue=>ue(ce))}case String:return parseString(ne);default:return()=>ne}}function useTraceContent(ne){const oe=useSnackbar(),ce=useLoadingState("specimen"),ue=useConnectionResolver(),[{traces:pe}]=useFeatures(),me=reactExports.useMemo(()=>memoizee$1(async({source:Se,id:$e})=>{if(Se&&$e){const Re=ue({url:Se});if(Re){oe("Fetching trace...");const Ae=await Re.transport().call("features/trace",{id:$e});return console.log(Ae==null?void 0:Ae.content),Ae==null?void 0:Ae.content}}},{normalizer:JSON.stringify}),[ue,oe]),{content:ge,source:ye,id:ve,key:xe}=ne??{},{lastModified:_e}=lodashExports$1.find(pe,{id:ve,source:ye})??{};return useAsync(()=>ce(async()=>{if(ve){if(ge)return{...ne,content:ge};{const Se=await me({source:ye,id:ve,lastModified:_e});return{...ne,content:Se}}}}),[me,!!ge,xe,ye,ve,_e])}const labelScale=1.25,reuseCanvas={canvas:document.createElement("canvas")};function getTextWidth(ne,oe){const ue=(reuseCanvas.canvas||(reuseCanvas.canvas=document.createElement("canvas"))).getContext("2d");return ue.font=oe,ue.measureText(ne).width}const isNullish=ne=>ne==null;function makePathIndex(ne){const oe=[],ce={},ue={},pe=lodashExports$1.chain(ne==null?void 0:ne.events).map((ye,ve)=>({step:ve,id:ye.id,pId:ye.pId})).groupBy("id").value();lodashExports$1.forEach(ne==null?void 0:ne.events,({id:ye,pId:ve},xe)=>{!isNullish(ve)&&ce[ye]!==ve&&(oe.push({id:ye,pId:ve,step:xe,prev:lodashExports$1.last(oe)}),ce[ye]=ve),ue[xe]=lodashExports$1.last(oe)});const me=(ye,ve=(xe=>(xe=ne==null?void 0:ne.events)==null?void 0:xe.length)()??0)=>{let _e=ue[ve];for(;_e;){if(_e.id===ye)return _e.pId;_e=_e.prev}};return{getParent:me,getPath:ye=>{const ve=[ye];let xe={...(ne.events??[])[ye],step:ye};for(;xe;){const _e=me(xe.id,xe.step);if(_e){const Se=lodashExports$1.findLast(pe[_e],$e=>$e.step<=xe.step);if(Se)ve.push(Se.step),xe=Se;else break}else break}return ve}}}const controller$1={key:"trace",icon:jsxRuntimeExports.jsx(RouteTwoTone,{}),inferName:ne=>{var oe,ce;return((ce=(oe=ne.source)==null?void 0:oe.trace)==null?void 0:ce.name)??"Untitled Trace"},error:ne=>{var oe,ce,ue,pe;return((ce=(oe=ne==null?void 0:ne.source)==null?void 0:oe.trace)==null?void 0:ce.error)||((pe=(ue=ne==null?void 0:ne.source)==null?void 0:ue.parsedTrace)==null?void 0:pe.error)},compress:ne=>lodashExports$1.pick(ne,["trace","onion","step","code","breakpoints"]),claimImportedFile:async ne=>isTraceFormat(ne)?{claimed:!0,layer:async oe=>{oe("Opening trace...");try{return{trace:await readUploadedTrace(ne).read()}}catch(ce){return console.error(ce),oe(`Error opening, ${lodashExports$1.get(ce,"message")}`),{trace:{key:nanoid$1(),id:custom$1().id,error:lodashExports$1.get(ce,"message"),name:lodashExports$1.startCase(name$2(ne.name))}}}}}:{claimed:!1},editor:withProduce(({value:ne,produce:oe})=>{var ce,ue,pe,me,ge,ye,ve,xe,_e,Se,$e;return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Option,{label:"Trace",content:jsxRuntimeExports.jsx(TracePicker,{onChange:Re=>oe(Ae=>lodashExports$1.set(Ae,"source.trace",Re)),value:(ce=ne==null?void 0:ne.source)==null?void 0:ce.trace})}),((pe=(ue=ne==null?void 0:ne.source)==null?void 0:ue.trace)==null?void 0:pe.error)&&jsxRuntimeExports.jsx(Type$2,{component:"div",variant:"body2",color:Re=>Re.palette.error.main,sx:{whiteSpace:"pre-wrap",mb:1,mt:1},children:jsxRuntimeExports.jsx("code",{children:(ge=(me=ne==null?void 0:ne.source)==null?void 0:me.trace)==null?void 0:ge.error})}),((ve=(ye=ne==null?void 0:ne.source)==null?void 0:ye.parsedTrace)==null?void 0:ve.error)&&jsxRuntimeExports.jsx(Type$2,{component:"div",variant:"body2",color:Re=>Re.palette.error.main,sx:{whiteSpace:"pre-wrap",mb:1,mt:1},children:jsxRuntimeExports.jsx("code",{children:(_e=(xe=ne==null?void 0:ne.source)==null?void 0:xe.parsedTrace)==null?void 0:_e.error})}),jsxRuntimeExports.jsx(Heading,{label:"Preview"}),jsxRuntimeExports.jsx(Box$1,{sx:{height:240,mx:-2},children:jsxRuntimeExports.jsx(TracePreview,{trace:($e=(Se=ne==null?void 0:ne.source)==null?void 0:Se.parsedTrace)==null?void 0:$e.content})})]})}),service:withProduce(({value:ne,produce:oe})=>{var ge;const{palette:ce}=useTheme$1(),{result:ue,loading:pe}=useTraceContent((ge=ne==null?void 0:ne.source)==null?void 0:ge.trace);reactExports.useEffect(()=>{oe(ye=>{var ve,xe;return lodashExports$1.set(ye,"source.playbackTo",((xe=(ve=ue==null?void 0:ue.content)==null?void 0:ve.events)==null?void 0:xe.length)??0)})},[ue==null?void 0:ue.key]);const me=useTraceParser({trace:ue==null?void 0:ue.content,context:{theme:{foreground:ce.text.primary,background:ce.background.paper,accent:ce.primary.main},color:{...colorsHex,...lodashExports$1.mapValues(accentColors,(ye,ve)=>getShade(ve,ce.mode,500,400))},themeAccent:ce.primary.main,themeTextPrimary:ce.text.primary,themeBackground:ce.background.paper},view:"main"},[ue==null?void 0:ue.key,ce.mode]);return useAsync$1(async()=>{if(me&&!pe){const ye=await me();oe(ve=>{lodashExports$1.set(ve,"source.parsedTrace",ye),lodashExports$1.set(ve,"viewKey",nanoid$1())})}},[pe,me]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(PlaybackService,{value:ne})})}),renderer:({layer:ne,index:oe})=>{var ve,xe,_e;const ce=(xe=(ve=ne==null?void 0:ne.source)==null?void 0:ve.parsedTrace)==null?void 0:xe.components,ue=useThrottle$1(((_e=ne==null?void 0:ne.source)==null?void 0:_e.step)??0,1e3/60),pe=use2DPath(ne,oe,ue),me=reactExports.useMemo(()=>lodashExports$1.map(ce==null?void 0:ce.stepsPersistent,Se=>lodashExports$1.map(Se,$e=>lodashExports$1.merge($e,{meta:{sourceLayer:ne==null?void 0:ne.key,sourceLayerIndex:oe,sourceLayerAlpha:1-.01*+((ne==null?void 0:ne.transparency)??0),sourceLayerDisplayMode:(ne==null?void 0:ne.displayMode)??"source-over"}}))),[ce==null?void 0:ce.stepsPersistent,ne==null?void 0:ne.key,ne==null?void 0:ne.transparency,ne==null?void 0:ne.displayMode,oe]),ge=reactExports.useMemo(()=>lodashExports$1.map(ce==null?void 0:ce.stepsTransient,Se=>lodashExports$1.map(Se,$e=>lodashExports$1.merge($e,{meta:{sourceLayer:ne==null?void 0:ne.key,sourceLayerIndex:oe,sourceLayerAlpha:1-.01*+((ne==null?void 0:ne.transparency)??0),sourceLayerDisplayMode:(ne==null?void 0:ne.displayMode)??"source-over"}}))),[ce==null?void 0:ce.stepsTransient,ne==null?void 0:ne.key,ne==null?void 0:ne.transparency,ne==null?void 0:ne.displayMode,oe]),ye=reactExports.useMemo(()=>[ge[ue]??[]],[ge,ue]);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(LazyNodeList,{end:ue,nodes:me}),jsxRuntimeExports.jsx(NodeList,{nodes:ye}),pe]})},steps:ne=>{var oe,ce,ue;return((ue=(ce=(oe=ne==null?void 0:ne.source)==null?void 0:oe.parsedTrace)==null?void 0:ce.content)==null?void 0:ue.events)??[]},provideSelectionInfo:({layer:ne,event:oe,children:ce})=>{const{layer:ue,setLayer:pe}=useLayer(ne),me=reactExports.useMemo(()=>{var xe,_e,Se,$e,Re;const ge=((Se=(_e=(xe=ue==null?void 0:ue.source)==null?void 0:xe.parsedTrace)==null?void 0:_e.content)==null?void 0:Se.events)??[],ye=lodashExports$1.chain(($e=oe==null?void 0:oe.info)==null?void 0:$e.components).filter(Ae=>{var Ie;return((Ie=Ae.meta)==null?void 0:Ie.sourceLayer)===(ue==null?void 0:ue.key)}).map(Ae=>{var Ie;return(Ie=Ae.meta)==null?void 0:Ie.step}).filter(lodashExports$1.negate(lodashExports$1.isUndefined)).sort((Ae,Ie)=>Ae-Ie).value(),ve=lodashExports$1.chain((Re=oe==null?void 0:oe.info)==null?void 0:Re.components).filter(Ae=>{var Ie;return((Ie=Ae.meta)==null?void 0:Ie.sourceLayer)===(ue==null?void 0:ue.key)}).filter(Ae=>{var Ie;return(Ie=Ae.meta)==null?void 0:Ie.info}).value();if(ye.length&&ue){const Ae=lodashExports$1.last(ye),Ie=ge[Ae];if(Ie)return{...lodashExports$1.keyBy(lodashExports$1.map(ve,(ke,Be)=>({key:`${ue.key}.${Be}`,primary:`Selection in ${inferLayerName(ue)}`,items:{info:{index:-1,primary:jsxRuntimeExports.jsx(PropertyList,{event:ke.meta.info,vertical:!0})}}})),"key"),[ue.key]:{primary:inferLayerName(ue),items:{properties:{index:-2,primary:jsxRuntimeExports.jsx(PropertyList,{event:Ie,vertical:!0,simple:!0,primitives:!0})},propertiesDetails:{index:-1,extras:jsxRuntimeExports.jsx(PropertyDialog,{event:Ie,trigger:ke=>jsxRuntimeExports.jsxs(MenuItem$1,{onClick:ke,children:[jsxRuntimeExports.jsx(ListItemIcon$1,{children:jsxRuntimeExports.jsx(DataObjectOutlined,{})}),jsxRuntimeExports.jsx(ListItemText$1,{sx:{mr:4},children:"See properties"}),jsxRuntimeExports.jsxs(Type$2,{component:"div",variant:"body2",color:"text.secondary",children:["Step ",Ae]})]})})},[`${Ie}`]:{primary:`Go to step ${Ae}`,secondary:`${lodashExports$1.startCase(Ie.type)}`,action:()=>pe(produce(ue,ke=>{lodashExports$1.set(ke,"source.step",Ae)})),icon:jsxRuntimeExports.jsx(ArrowOutwardRounded,{})}}}}}return{}},[ue,oe]);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:ce==null?void 0:ce(me)})},getSources:ne=>{var ce;const oe=(ce=ne==null?void 0:ne.source)==null?void 0:ce.trace;return oe?[{id:"trace",name:`(Source) ${oe.name}`,language:"yaml",content:dump(oe.content,{noCompatMode:!0})}]:[]}},labelSize=.8;function use2DPath(ne,oe=0,ce=0){var ge,ye,ve;const{palette:ue}=useTheme$1(),{getPath:pe}=reactExports.useMemo(()=>{var xe,_e,Se;return((xe=ne==null?void 0:ne.source)==null?void 0:xe.playback)!=="playing"&&((Se=(_e=ne==null?void 0:ne.source)==null?void 0:_e.parsedTrace)!=null&&Se.content)?makePathIndex(ne.source.parsedTrace.content):{getParent:lodashExports$1.constant(void 0),getPath:lodashExports$1.constant([])}},[(ye=(ge=ne==null?void 0:ne.source)==null?void 0:ge.parsedTrace)==null?void 0:ye.content,(ve=ne==null?void 0:ne.source)==null?void 0:ve.playback]);return reactExports.useMemo(()=>{var Se,$e,Re,Ae,Ie,ke,Be,Ne,Fe,Ue,We,qe;const xe=interpolate$1([ue.background.paper,ue.text.primary])(.05),_e=($e=(Se=ne==null?void 0:ne.source)==null?void 0:Se.parsedTrace)==null?void 0:$e.content;if((Re=_e==null?void 0:_e.render)!=null&&Re.path||_e!=null&&_e.pivot){const ze=((Ie=(Ae=_e==null?void 0:_e.render)==null?void 0:Ae.path)==null?void 0:Ie.pivot)??(_e==null?void 0:_e.pivot)??{},Ge=(Be=(ke=_e==null?void 0:_e.render)==null?void 0:ke.path)!=null&&Be.scale?_e.render.path.scale*(1/.3):((Ne=_e==null?void 0:_e.pivot)==null?void 0:Ne.scale)??1,{x:Ze,y:Dt}=ze,Je=(_e==null?void 0:_e.version)==="1.4.0"?parseProperty$1:Zt=>en=>parseProperty(Zt)({event:en}),Ut=Ze?Je(Ze):Zt=>Zt.x,jt=Dt?Je(Dt):Zt=>Zt.y,Ke=lodashExports$1.map(pe(ce),Zt=>{var en;return(en=_e==null?void 0:_e.events)==null?void 0:en[Zt]}),an={x:Ut({x:0,y:0,...lodashExports$1.head(Ke)}),y:jt({x:0,y:0,...lodashExports$1.head(Ke)})};if(Ke.length){const Zt=`${lodashExports$1.startCase((Fe=lodashExports$1.head(Ke))==null?void 0:Fe.type)} ${(Ue=lodashExports$1.head(Ke))==null?void 0:Ue.id}`,en=getTextWidth(Zt,`${labelSize*Ge*labelScale}px Inter`),Kt=[{$:"circle",x:Ut({x:0,y:0,...lodashExports$1.last(Ke)}),y:jt({x:0,y:0,...lodashExports$1.last(Ke)}),fill:ue.primary.main,radius:.3*Ge},{$:"path",points:Ke.map(Wt=>({x:Ut({x:0,y:0,...Wt}),y:jt({x:0,y:0,...Wt})})),fill:ue.primary.main,alpha:1,lineWidth:.3*Ge},{$:"circle",...an,fill:ue.primary.main,radius:.3*Ge},{$:"rect",alpha:.85,fill:xe,x:an.x-.3*Ge*labelScale,y:an.y-2*Ge*labelScale,width:en+(.8+.5)*Ge*labelScale,height:1.4*Ge*labelScale},{$:"path",points:[{x:an.x,y:an.y},{x:an.x+(-.3-.05)*Ge*labelScale,y:an.y+(-2+1.4)*Ge*labelScale}],fill:getColorHex((We=lodashExports$1.head(Ke))==null?void 0:We.type),alpha:1,lineWidth:.1*Ge*labelScale},{$:"rect",x:an.x+(-.3-.1)*Ge*labelScale,y:an.y+-2*Ge*labelScale,fill:getColorHex((qe=lodashExports$1.head(Ke))==null?void 0:qe.type),height:1.4*Ge*labelScale,width:.1*Ge*labelScale},{$:"rect",alpha:0,fill:"rgba(255, 255, 255, 0)",x:an.x-.3*Ge*labelScale,y:an.y-2*Ge*labelScale,width:en*2,height:1*Ge*labelScale,label:Zt,"label-size":labelSize*Ge*labelScale,"label-x":(.1+.5)*Ge*labelScale,"label-y":1*Ge*labelScale,"label-color":ue.text.primary}];return jsxRuntimeExports.jsx(NodeList,{nodes:[lodashExports$1.map(Kt,Wt=>({component:Wt,meta:{source:"path",sourceLayerIndex:-99999+oe}}))]})}}return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{})},[ne,oe,ce,ue,pe])}const mapValuesDeep=(ne,oe)=>lodashExports$1.isArray(ne)?lodashExports$1.map(ne,ce=>mapValuesDeep(ce,oe)):lodashExports$1.isObject(ne)?lodashExports$1.mapValues(ne,ce=>mapValuesDeep(ce,oe)):oe(ne);async function findConnection(ne,oe,ce){for(const ue of ne){const pe=await ue.transport().call("features/algorithms"),me=await ue.transport().call("features/formats");if(lodashExports$1.find(pe,{id:oe})&&lodashExports$1.find(me,{id:ce}))return ue}}const maxStringPropLength=40,controller={...lodashExports$1.omit(controller$1,"claimImportedFile"),key:"query",icon:jsxRuntimeExports.jsx(RouteTwoTone,{}),compress:ne=>lodashExports$1.pick(ne,["mapLayerKey","query","start","end","algorithm","onion","step","code","breakpoints"]),editor:withProduce(({value:ne,produce:oe})=>{var xe,_e;const{algorithm:ce}=(ne==null?void 0:ne.source)??{},{layers:ue,allLayers:pe,layer:me,key:ge}=useLayer(void 0,Se=>{var $e;return(($e=Se.source)==null?void 0:$e.type)==="map"}),[{algorithms:ye}]=useFeatures(),[ve]=useConnections();return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Option,{label:"Algorithm",content:jsxRuntimeExports.jsx(FeaturePicker,{arrow:!0,paper:!0,icon:jsxRuntimeExports.jsx(CodeOutlined,{}),label:"Algorithm",value:ce,items:ye.map(Se=>{var $e;return{...Se,description:($e=lodashExports$1.find(ve,{url:Se.source}))==null?void 0:$e.name}}),onChange:async Se=>oe($e=>lodashExports$1.set($e,"source.algorithm",Se))})}),!(ye!=null&&ye.length)&&jsxRuntimeExports.jsx(Type$2,{component:"div",variant:"body2",color:"warning.main",sx:{mb:1},children:"No connected solver has declared support for running algorithms"}),jsxRuntimeExports.jsx(Option,{label:"Map",content:jsxRuntimeExports.jsx(FeaturePicker,{arrow:!0,paper:!0,icon:jsxRuntimeExports.jsx(LayersIcon,{}),label:"Layer",value:ge,items:pe.map(Se=>({id:Se.key,hidden:!lodashExports$1.find(ue,$e=>$e.key===Se.key),name:inferLayerName(Se)})),onChange:async Se=>oe($e=>lodashExports$1.set($e,"source.mapLayerKey",Se))})}),me&&jsxRuntimeExports.jsxs(Type$2,{component:"div",variant:"body2",color:"text.secondary",sx:{mb:1,mt:1},children:["Define source and destination nodes by clicking on valid regions on"," ",inferLayerName(me)]}),jsxRuntimeExports.jsx(Heading,{label:"Preview"}),jsxRuntimeExports.jsx(Box$1,{sx:{height:240,mx:-2},children:jsxRuntimeExports.jsx(TracePreview,{trace:(_e=(xe=ne==null?void 0:ne.source)==null?void 0:xe.trace)==null?void 0:_e.content})})]})}),service:withProduce(({value:ne,produce:oe,onChange:ce})=>{var Ae;const ue=controller$1.service,pe=useSnackbar(),{algorithm:me,mapLayerKey:ge,start:ye,end:ve}=(ne==null?void 0:ne.source)??{},[{layers:xe}]=useLayers(),[_e]=useConnections(),[{algorithms:Se}]=useFeatures(),$e=reactExports.useMemo(()=>{if(ge&&me)return lodashExports$1.find(xe,{key:ge})},[ge,me,xe]),{result:Re}=useMapContent((Ae=$e==null?void 0:$e.source)==null?void 0:Ae.map);return useEffectWhenAsync(async Ie=>{var ke;if($e&&Re&&me){const{format:Be}=((ke=$e==null?void 0:$e.source)==null?void 0:ke.map)??{},{content:Ne}=Re??{};if(Be&&Ne){const Fe=await findConnection(_e,me,Be),Ue=lodashExports$1.find(Se,{id:me});if(Fe){pe(`Executing ${inferLayerName(ne)} using ${Fe.name}...`);const We={format:Be,instances:[{start:ye??0,end:ve??0}],mapURI:`map:${encodeURIComponent(Ne)}`,algorithm:me},qe=await Fe.transport().call("solve/pathfinding",We);Ie.aborted?pe("Canceled"):oe(ze=>{lodashExports$1.set(ze,"source.trace",{name:`${Ue==null?void 0:Ue.name}`,content:qe,key:nanoid$1(),id:nanoid$1()}),lodashExports$1.set(ze,"source.query",We)})}}}},[$e,_e,me,ye,ve,oe,pe,ne,Se],[$e,Re,_e,me,ye,ve]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(ue,{value:ne,onChange:ce})})}),inferName:ne=>{var oe,ce;return((ce=(oe=ne.source)==null?void 0:oe.trace)==null?void 0:ce.name)??"Untitled Query"},provideSelectionInfo:({children:ne,event:oe,layer:ce})=>{const ue=controller$1.provideSelectionInfo,{layer:pe,setLayer:me,layers:ge}=useLayer(ce),ye=reactExports.useMemo(()=>{const xe=lodashExports$1.filter(ge,{source:{type:"map"}});return lodashExports$1.filter(lodashExports$1.map(xe,_e=>{var $e,Re,Ae,Ie;const{parsedMap:Se}=(_e==null?void 0:_e.source)??{};if(Se&&oe){const ke=(Ie=(Ae=getParser((Re=($e=_e==null?void 0:_e.source)==null?void 0:$e.map)==null?void 0:Re.format))==null?void 0:Ae.hydrate)==null?void 0:Ie.call(Ae,Se);if(ke){const Be=(oe==null?void 0:oe.world)&&ke.snap(oe.world);if(Be){const Ne=(oe==null?void 0:oe.world)&&ke.nodeAt(Be);return{point:Be,node:Ne,key:_e.key,name:inferLayerName(_e)}}}}}))},[ge]),ve=reactExports.useMemo(()=>!!pe&&!!ye.length&&{[pe.key]:{primary:inferLayerName(pe),items:{...lodashExports$1.reduce(ye,(xe,_e)=>({...xe,[`${ce}-${_e==null?void 0:_e.key}-source`]:{primary:"Set as source",secondary:_e==null?void 0:_e.name,action:()=>me(produce(pe,Se=>{lodashExports$1.set(Se,"source.start",_e==null?void 0:_e.node),lodashExports$1.set(Se,"source.query",void 0),lodashExports$1.set(Se,"source.mapLayerKey",_e==null?void 0:_e.key),lodashExports$1.set(Se,"source.trace",void 0)})),icon:jsxRuntimeExports.jsx(StartIcon,{sx:{transform:"scale(0.5)"}})},[`${ce}-${_e==null?void 0:_e.key}-destination`]:{primary:"Set as destination",secondary:_e==null?void 0:_e.name,action:()=>me(produce(pe,Se=>{lodashExports$1.set(Se,"source.end",_e==null?void 0:_e.node),lodashExports$1.set(Se,"source.query",void 0),lodashExports$1.set(Se,"source.mapLayerKey",_e==null?void 0:_e.key),lodashExports$1.set(Se,"source.trace",void 0)})),icon:jsxRuntimeExports.jsx(DestinationIcon,{})}}),{})}}},[ye,pe,ge,me]);return jsxRuntimeExports.jsx(ue,{event:oe,layer:ce,children:xe=>ne==null?void 0:ne(lodashExports$1.merge(xe,ve))})},getSources:ne=>{const{algorithm:oe=null,start:ce=0,end:ue=0,query:pe}=(ne==null?void 0:ne.source)??{};return[{id:"params",name:"Query",language:"yaml",content:dump({algorithm:oe,instances:[{start:ce,end:ue}],mapURI:"(...)",format:"(...)",...mapValuesDeep(pe,me=>typeof me=="string"&&me.length>maxStringPropLength?`${lodashExports$1.truncate(me,{length:maxStringPropLength})} (${me.length} characters)`:me)},{noCompatMode:!0})},...controller$1.getSources(ne)]}};function getController(ne){var oe;return getControllers()[((oe=ne==null?void 0:ne.source)==null?void 0:oe.type)??""]}const getControllers=lodashExports$1.once(()=>({trace:controller$1,map:controller$2,query:controller}));function inferLayerName(ne){var oe;return ne!=null&&ne.name?ne==null?void 0:ne.name:(oe=ne==null?void 0:ne.source)!=null&&oe.type?getController(ne).inferName(ne):"Untitled Layer"}var shim$5={exports:{}},useSyncExternalStoreShim_production_min={};/** + `);return ce=>oe(new Proxy(normalize$1(ce),{get(ue,pe){return typeof(ue==null?void 0:ue[pe])=="function"?ue[pe]({}):ue==null?void 0:ue[pe]}}))},openBrace$1=/^\$\{\{\s*/,closeBrace$1=/^\s*\}\}/,neverMatch$1=/\b\B/,parser$2=distExports.parseStringTemplateGenerator({VARIABLE_START:openBrace$1,VARIABLE_END:closeBrace$1,PIPE_START:neverMatch$1,PIPE_PARAMETER_START:neverMatch$1,QUOTED_STRING:neverMatch$1}),parseString$1=memoizee$1(ne=>{const oe=parser$2(ne);return lodashExports$1.join(oe.literals,"")?ce=>distExports.evaluateParsedString(oe,{},{},ue=>parseToken$1(ue)(ce)):parseToken$1(oe.variables[0].name)},{primitive:!0});function parseProperty$1(ne){switch(ne==null?void 0:ne.constructor){case Array:{const oe=lodashExports$1.map(ne,parseProperty$1);return ce=>lodashExports$1.map(oe,ue=>ue(ce))}case Object:{const oe=lodashExports$1.mapValues(ne,parseProperty$1);return ce=>lodashExports$1.mapValues(oe,ue=>ue(ce))}case String:return parseString$1(ne);default:return()=>ne}}function commonjsRequire(ne){throw new Error('Could not dynamically require "'+ne+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var pluralize$1={exports:{}};(function(ne,oe){(function(ce,ue){typeof commonjsRequire=="function"?ne.exports=ue():ce.pluralize=ue()})(commonjsGlobal,function(){var ce=[],ue=[],pe={},me={},ge={};function ye(Ie){return typeof Ie=="string"?new RegExp("^"+Ie+"$","i"):Ie}function ve(Ie,ke){return Ie===ke?ke:Ie===Ie.toLowerCase()?ke.toLowerCase():Ie===Ie.toUpperCase()?ke.toUpperCase():Ie[0]===Ie[0].toUpperCase()?ke.charAt(0).toUpperCase()+ke.substr(1).toLowerCase():ke.toLowerCase()}function xe(Ie,ke){return Ie.replace(/\$(\d{1,2})/g,function(Be,Ne){return ke[Ne]||""})}function _e(Ie,ke){return Ie.replace(ke[0],function(Be,Ne){var Fe=xe(ke[1],arguments);return ve(Be===""?Ie[Ne-1]:Be,Fe)})}function Se(Ie,ke,Be){if(!Ie.length||pe.hasOwnProperty(Ie))return ke;for(var Ne=Be.length;Ne--;){var Fe=Be[Ne];if(Fe[0].test(ke))return _e(ke,Fe)}return ke}function $e(Ie,ke,Be){return function(Ne){var Fe=Ne.toLowerCase();return ke.hasOwnProperty(Fe)?ve(Ne,Fe):Ie.hasOwnProperty(Fe)?ve(Ne,Ie[Fe]):Se(Fe,Ne,Be)}}function Re(Ie,ke,Be,Ne){return function(Fe){var Ue=Fe.toLowerCase();return ke.hasOwnProperty(Ue)?!0:Ie.hasOwnProperty(Ue)?!1:Se(Ue,Ue,Be)===Ue}}function Ae(Ie,ke,Be){var Ne=ke===1?Ae.singular(Ie):Ae.plural(Ie);return(Be?ke+" ":"")+Ne}return Ae.plural=$e(ge,me,ce),Ae.isPlural=Re(ge,me,ce),Ae.singular=$e(me,ge,ue),Ae.isSingular=Re(me,ge,ue),Ae.addPluralRule=function(Ie,ke){ce.push([ye(Ie),ke])},Ae.addSingularRule=function(Ie,ke){ue.push([ye(Ie),ke])},Ae.addUncountableRule=function(Ie){if(typeof Ie=="string"){pe[Ie.toLowerCase()]=!0;return}Ae.addPluralRule(Ie,"$0"),Ae.addSingularRule(Ie,"$0")},Ae.addIrregularRule=function(Ie,ke){ke=ke.toLowerCase(),Ie=Ie.toLowerCase(),ge[Ie]=ke,me[ke]=Ie},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach(function(Ie){return Ae.addIrregularRule(Ie[0],Ie[1])}),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach(function(Ie){return Ae.addPluralRule(Ie[0],Ie[1])}),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach(function(Ie){return Ae.addSingularRule(Ie[0],Ie[1])}),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eé]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(Ae.addUncountableRule),Ae})})(pluralize$1);var pluralizeExports=pluralize$1.exports;const pluralize=getDefaultExportFromCjs(pluralizeExports),parseTraceWorkerLegacyUrl=""+new URL("parseTrace.worker-d91f3db3.js",import.meta.url).href,parseTraceWorkerUrl=""+new URL("parseTrace.worker-10cdd3eb.js",import.meta.url).href;class ParseTraceWorker extends Worker{constructor(){super(parseTraceWorkerUrl,{type:"module"})}}class ParseTraceWorkerLegacy extends Worker{constructor(){super(parseTraceWorkerLegacyUrl,{type:"module"})}}const parseTraceAsync=usingMemoizedWorkerTask(ParseTraceWorker),parseTraceLegacyAsync=usingMemoizedWorkerTask(ParseTraceWorkerLegacy);function useTraceParser(ne,oe){const ce=useSnackbar(),ue=useLoadingState("specimen");return reactExports.useMemo(()=>{if(ne.trace)return()=>ue(async()=>{var pe,me;ce("Processing trace...");try{const ge=((pe=ne.trace)==null?void 0:pe.version)==="1.4.0"?await parseTraceAsync(ne):await parseTraceLegacyAsync(ne);return ce("Trace loaded",pluralize("step",((me=ge==null?void 0:ge.stepsPersistent)==null?void 0:me.length)??0,!0)),{components:ge,content:ne.trace}}catch(ge){return console.error(ge),ce("Error parsing",lodashExports$1.get(ge,"message")),{error:lodashExports$1.get(ge,"message")}}})},oe)}function mapProperties(ne={},oe){const ce={};for(const ue of Object.keys(ne))ce[ue]=ue==="$"?ne[ue]:oe(ne[ue],ue,ne);return Object.setPrototypeOf(ce,ne)}function normalize(ne={}){return mapProperties(ne,oe=>lodashExports$1.isFunction(oe)?oe:parseProperty(oe))}const parseToken=ne=>{const oe=Function("$",`return ${ne};`);return ce=>oe(new Proxy(normalize(ce),{get(ue,pe){return typeof(ue==null?void 0:ue[pe])=="function"?ue[pe]({}):ue==null?void 0:ue[pe]}}))},openBrace=/^\{\{\s*/,closeBrace=/^\s*\}\}/,neverMatch=/\b\B/,parser$1=distExports.parseStringTemplateGenerator({VARIABLE_START:openBrace,VARIABLE_END:closeBrace,PIPE_START:neverMatch,PIPE_PARAMETER_START:neverMatch,QUOTED_STRING:neverMatch}),parseString=memoizee$1(ne=>{const oe=parser$1(ne);return lodashExports$1.join(oe.literals,"")?ce=>distExports.evaluateParsedString(oe,{},{},ue=>parseToken(ue)(ce)):parseToken(oe.variables[0].name)},{primitive:!0});function parseProperty(ne){switch(ne==null?void 0:ne.constructor){case Array:{const oe=lodashExports$1.map(ne,parseProperty);return ce=>lodashExports$1.map(oe,ue=>ue(ce))}case Object:{const oe=lodashExports$1.mapValues(ne,parseProperty);return ce=>lodashExports$1.mapValues(oe,ue=>ue(ce))}case String:return parseString(ne);default:return()=>ne}}function useTraceContent(ne){const oe=useSnackbar(),ce=useLoadingState("specimen"),ue=useConnectionResolver(),[{traces:pe}]=useFeatures(),me=reactExports.useMemo(()=>memoizee$1(async({source:Se,id:$e})=>{if(Se&&$e){const Re=ue({url:Se});if(Re){oe("Fetching trace...");const Ae=await Re.transport().call("features/trace",{id:$e});return console.log(Ae==null?void 0:Ae.content),Ae==null?void 0:Ae.content}}},{normalizer:JSON.stringify}),[ue,oe]),{content:ge,source:ye,id:ve,key:xe}=ne??{},{lastModified:_e}=lodashExports$1.find(pe,{id:ve,source:ye})??{};return useAsync(()=>ce(async()=>{if(ve){if(ge)return{...ne,content:ge};{const Se=await me({source:ye,id:ve,lastModified:_e});return{...ne,content:Se}}}}),[me,!!ge,xe,ye,ve,_e])}const labelScale=1.25,reuseCanvas={canvas:document.createElement("canvas")};function getTextWidth(ne,oe){const ue=(reuseCanvas.canvas||(reuseCanvas.canvas=document.createElement("canvas"))).getContext("2d");return ue.font=oe,ue.measureText(ne).width}const isNullish=ne=>ne==null;function makePathIndex(ne){const oe=[],ce={},ue={},pe=lodashExports$1.chain(ne==null?void 0:ne.events).map((ye,ve)=>({step:ve,id:ye.id,pId:ye.pId})).groupBy("id").value();lodashExports$1.forEach(ne==null?void 0:ne.events,({id:ye,pId:ve},xe)=>{!isNullish(ve)&&ce[ye]!==ve&&(oe.push({id:ye,pId:ve,step:xe,prev:lodashExports$1.last(oe)}),ce[ye]=ve),ue[xe]=lodashExports$1.last(oe)});const me=(ye,ve=(xe=>(xe=ne==null?void 0:ne.events)==null?void 0:xe.length)()??0)=>{let _e=ue[ve];for(;_e;){if(_e.id===ye)return _e.pId;_e=_e.prev}};return{getParent:me,getPath:ye=>{const ve=[ye];let xe={...(ne.events??[])[ye],step:ye};for(;xe;){const _e=me(xe.id,xe.step);if(_e){const Se=lodashExports$1.findLast(pe[_e],$e=>$e.step<=xe.step);if(Se)ve.push(Se.step),xe=Se;else break}else break}return ve}}}const controller$1={key:"trace",icon:jsxRuntimeExports.jsx(RouteTwoTone,{}),inferName:ne=>{var oe,ce;return((ce=(oe=ne.source)==null?void 0:oe.trace)==null?void 0:ce.name)??"Untitled Trace"},error:ne=>{var oe,ce,ue,pe;return((ce=(oe=ne==null?void 0:ne.source)==null?void 0:oe.trace)==null?void 0:ce.error)||((pe=(ue=ne==null?void 0:ne.source)==null?void 0:ue.parsedTrace)==null?void 0:pe.error)},compress:ne=>lodashExports$1.pick(ne,["trace","onion","step","code","breakpoints"]),claimImportedFile:async ne=>isTraceFormat(ne)?{claimed:!0,layer:async oe=>{oe("Opening trace...");try{return{trace:await readUploadedTrace(ne).read()}}catch(ce){return console.error(ce),oe(`Error opening, ${lodashExports$1.get(ce,"message")}`),{trace:{key:nanoid$1(),id:custom$1().id,error:lodashExports$1.get(ce,"message"),name:lodashExports$1.startCase(name$2(ne.name))}}}}}:{claimed:!1},editor:withProduce(({value:ne,produce:oe})=>{var ce,ue,pe,me,ge,ye,ve,xe,_e,Se,$e;return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Option,{label:"Trace",content:jsxRuntimeExports.jsx(TracePicker,{onChange:Re=>oe(Ae=>lodashExports$1.set(Ae,"source.trace",Re)),value:(ce=ne==null?void 0:ne.source)==null?void 0:ce.trace})}),((pe=(ue=ne==null?void 0:ne.source)==null?void 0:ue.trace)==null?void 0:pe.error)&&jsxRuntimeExports.jsx(Type$2,{component:"div",variant:"body2",color:Re=>Re.palette.error.main,sx:{whiteSpace:"pre-wrap",mb:1,mt:1},children:jsxRuntimeExports.jsx("code",{children:(ge=(me=ne==null?void 0:ne.source)==null?void 0:me.trace)==null?void 0:ge.error})}),((ve=(ye=ne==null?void 0:ne.source)==null?void 0:ye.parsedTrace)==null?void 0:ve.error)&&jsxRuntimeExports.jsx(Type$2,{component:"div",variant:"body2",color:Re=>Re.palette.error.main,sx:{whiteSpace:"pre-wrap",mb:1,mt:1},children:jsxRuntimeExports.jsx("code",{children:(_e=(xe=ne==null?void 0:ne.source)==null?void 0:xe.parsedTrace)==null?void 0:_e.error})}),jsxRuntimeExports.jsx(Heading,{label:"Preview"}),jsxRuntimeExports.jsx(Box$1,{sx:{height:240,mx:-2},children:jsxRuntimeExports.jsx(TracePreview,{trace:($e=(Se=ne==null?void 0:ne.source)==null?void 0:Se.parsedTrace)==null?void 0:$e.content})})]})}),service:withProduce(({value:ne,produce:oe})=>{var ge;const{palette:ce}=useTheme$1(),{result:ue,loading:pe}=useTraceContent((ge=ne==null?void 0:ne.source)==null?void 0:ge.trace);reactExports.useEffect(()=>{oe(ye=>{var ve,xe;return lodashExports$1.set(ye,"source.playbackTo",((xe=(ve=ue==null?void 0:ue.content)==null?void 0:ve.events)==null?void 0:xe.length)??0)})},[ue==null?void 0:ue.key]);const me=useTraceParser({trace:ue==null?void 0:ue.content,context:{theme:{foreground:ce.text.primary,background:ce.background.paper,accent:ce.primary.main},color:{...colorsHex,...lodashExports$1.mapValues(accentColors,(ye,ve)=>getShade(ve,ce.mode,500,400))},themeAccent:ce.primary.main,themeTextPrimary:ce.text.primary,themeBackground:ce.background.paper},view:"main"},[ue==null?void 0:ue.key,ce.mode]);return useAsync$1(async()=>{if(me&&!pe){const ye=await me();oe(ve=>{lodashExports$1.set(ve,"source.parsedTrace",ye),lodashExports$1.set(ve,"viewKey",nanoid$1())})}},[pe,me]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(PlaybackService,{value:ne})})}),renderer:({layer:ne,index:oe})=>{var ve,xe,_e;const ce=(xe=(ve=ne==null?void 0:ne.source)==null?void 0:ve.parsedTrace)==null?void 0:xe.components,ue=useThrottle$1(((_e=ne==null?void 0:ne.source)==null?void 0:_e.step)??0,1e3/60),pe=use2DPath(ne,oe,ue),me=reactExports.useMemo(()=>lodashExports$1.map(ce==null?void 0:ce.stepsPersistent,Se=>lodashExports$1.map(Se,$e=>lodashExports$1.merge($e,{meta:{sourceLayer:ne==null?void 0:ne.key,sourceLayerIndex:oe,sourceLayerAlpha:1-.01*+((ne==null?void 0:ne.transparency)??0),sourceLayerDisplayMode:(ne==null?void 0:ne.displayMode)??"source-over"}}))),[ce==null?void 0:ce.stepsPersistent,ne==null?void 0:ne.key,ne==null?void 0:ne.transparency,ne==null?void 0:ne.displayMode,oe]),ge=reactExports.useMemo(()=>lodashExports$1.map(ce==null?void 0:ce.stepsTransient,Se=>lodashExports$1.map(Se,$e=>lodashExports$1.merge($e,{meta:{sourceLayer:ne==null?void 0:ne.key,sourceLayerIndex:oe,sourceLayerAlpha:1-.01*+((ne==null?void 0:ne.transparency)??0),sourceLayerDisplayMode:(ne==null?void 0:ne.displayMode)??"source-over"}}))),[ce==null?void 0:ce.stepsTransient,ne==null?void 0:ne.key,ne==null?void 0:ne.transparency,ne==null?void 0:ne.displayMode,oe]),ye=reactExports.useMemo(()=>[ge[ue]??[]],[ge,ue]);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(LazyNodeList,{end:ue,nodes:me}),jsxRuntimeExports.jsx(NodeList,{nodes:ye}),pe]})},steps:ne=>{var oe,ce,ue;return((ue=(ce=(oe=ne==null?void 0:ne.source)==null?void 0:oe.parsedTrace)==null?void 0:ce.content)==null?void 0:ue.events)??[]},provideSelectionInfo:({layer:ne,event:oe,children:ce})=>{const{layer:ue,setLayer:pe}=useLayer(ne),me=reactExports.useMemo(()=>{var xe,_e,Se,$e,Re;const ge=((Se=(_e=(xe=ue==null?void 0:ue.source)==null?void 0:xe.parsedTrace)==null?void 0:_e.content)==null?void 0:Se.events)??[],ye=lodashExports$1.chain(($e=oe==null?void 0:oe.info)==null?void 0:$e.components).filter(Ae=>{var Ie;return((Ie=Ae.meta)==null?void 0:Ie.sourceLayer)===(ue==null?void 0:ue.key)}).map(Ae=>{var Ie;return(Ie=Ae.meta)==null?void 0:Ie.step}).filter(lodashExports$1.negate(lodashExports$1.isUndefined)).sort((Ae,Ie)=>Ae-Ie).value(),ve=lodashExports$1.chain((Re=oe==null?void 0:oe.info)==null?void 0:Re.components).filter(Ae=>{var Ie;return((Ie=Ae.meta)==null?void 0:Ie.sourceLayer)===(ue==null?void 0:ue.key)}).filter(Ae=>{var Ie;return(Ie=Ae.meta)==null?void 0:Ie.info}).value();if(ye.length&&ue){const Ae=lodashExports$1.last(ye),Ie=ge[Ae];if(Ie)return{...lodashExports$1.keyBy(lodashExports$1.map(ve,(ke,Be)=>({key:`${ue.key}.${Be}`,primary:`Selection in ${inferLayerName(ue)}`,items:{info:{index:-1,primary:jsxRuntimeExports.jsx(PropertyList,{event:ke.meta.info,vertical:!0})}}})),"key"),[ue.key]:{primary:inferLayerName(ue),items:{properties:{index:-2,primary:jsxRuntimeExports.jsx(PropertyList,{event:Ie,vertical:!0,simple:!0,primitives:!0})},propertiesDetails:{index:-1,extras:jsxRuntimeExports.jsx(PropertyDialog,{event:Ie,trigger:ke=>jsxRuntimeExports.jsxs(MenuItem$1,{onClick:ke,children:[jsxRuntimeExports.jsx(ListItemIcon$1,{children:jsxRuntimeExports.jsx(DataObjectOutlined,{})}),jsxRuntimeExports.jsx(ListItemText$1,{sx:{mr:4},children:"See properties"}),jsxRuntimeExports.jsxs(Type$2,{component:"div",variant:"body2",color:"text.secondary",children:["Step ",Ae]})]})})},[`${Ie}`]:{primary:`Go to step ${Ae}`,secondary:`${lodashExports$1.startCase(Ie.type)}`,action:()=>pe(produce(ue,ke=>{lodashExports$1.set(ke,"source.step",Ae)})),icon:jsxRuntimeExports.jsx(ArrowOutwardRounded,{})}}}}}return{}},[ue,oe]);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:ce==null?void 0:ce(me)})},getSources:ne=>{var ce;const oe=(ce=ne==null?void 0:ne.source)==null?void 0:ce.trace;return oe?[{id:"trace",name:`(Source) ${oe.name}`,language:"yaml",content:dump(oe.content,{noCompatMode:!0})}]:[]}},labelSize=.8;function use2DPath(ne,oe=0,ce=0){var ge,ye,ve;const{palette:ue}=useTheme$1(),{getPath:pe}=reactExports.useMemo(()=>{var xe,_e,Se;return((xe=ne==null?void 0:ne.source)==null?void 0:xe.playback)!=="playing"&&((Se=(_e=ne==null?void 0:ne.source)==null?void 0:_e.parsedTrace)!=null&&Se.content)?makePathIndex(ne.source.parsedTrace.content):{getParent:lodashExports$1.constant(void 0),getPath:lodashExports$1.constant([])}},[(ye=(ge=ne==null?void 0:ne.source)==null?void 0:ge.parsedTrace)==null?void 0:ye.content,(ve=ne==null?void 0:ne.source)==null?void 0:ve.playback]);return reactExports.useMemo(()=>{var Se,$e,Re,Ae,Ie,ke,Be,Ne,Fe,Ue,We,qe;const xe=interpolate$1([ue.background.paper,ue.text.primary])(.05),_e=($e=(Se=ne==null?void 0:ne.source)==null?void 0:Se.parsedTrace)==null?void 0:$e.content;if((Re=_e==null?void 0:_e.render)!=null&&Re.path||_e!=null&&_e.pivot){const ze=((Ie=(Ae=_e==null?void 0:_e.render)==null?void 0:Ae.path)==null?void 0:Ie.pivot)??(_e==null?void 0:_e.pivot)??{},Ge=(Be=(ke=_e==null?void 0:_e.render)==null?void 0:ke.path)!=null&&Be.scale?_e.render.path.scale*(1/.3):((Ne=_e==null?void 0:_e.pivot)==null?void 0:Ne.scale)??1,{x:Ze,y:Dt}=ze,Je=(_e==null?void 0:_e.version)==="1.4.0"?parseProperty$1:Zt=>en=>parseProperty(Zt)({event:en}),Ut=Ze?Je(Ze):Zt=>Zt.x,jt=Dt?Je(Dt):Zt=>Zt.y,Ke=lodashExports$1.map(pe(ce),Zt=>{var en;return(en=_e==null?void 0:_e.events)==null?void 0:en[Zt]}),an={x:Ut({x:0,y:0,...lodashExports$1.head(Ke)}),y:jt({x:0,y:0,...lodashExports$1.head(Ke)})};if(Ke.length){const Zt=`${lodashExports$1.startCase((Fe=lodashExports$1.head(Ke))==null?void 0:Fe.type)} ${(Ue=lodashExports$1.head(Ke))==null?void 0:Ue.id}`,en=getTextWidth(Zt,`${labelSize*Ge*labelScale}px Inter`),Kt=[{$:"circle",x:Ut({x:0,y:0,...lodashExports$1.last(Ke)}),y:jt({x:0,y:0,...lodashExports$1.last(Ke)}),fill:ue.primary.main,radius:.3*Ge},{$:"path",points:Ke.map(Wt=>({x:Ut({x:0,y:0,...Wt}),y:jt({x:0,y:0,...Wt})})),fill:ue.primary.main,alpha:1,lineWidth:.3*Ge},{$:"circle",...an,fill:ue.primary.main,radius:.3*Ge},{$:"rect",alpha:.85,fill:xe,x:an.x-.3*Ge*labelScale,y:an.y-2*Ge*labelScale,width:en+(.8+.5)*Ge*labelScale,height:1.4*Ge*labelScale},{$:"path",points:[{x:an.x,y:an.y},{x:an.x+(-.3-.05)*Ge*labelScale,y:an.y+(-2+1.4)*Ge*labelScale}],fill:getColorHex((We=lodashExports$1.head(Ke))==null?void 0:We.type),alpha:1,lineWidth:.1*Ge*labelScale},{$:"rect",x:an.x+(-.3-.1)*Ge*labelScale,y:an.y+-2*Ge*labelScale,fill:getColorHex((qe=lodashExports$1.head(Ke))==null?void 0:qe.type),height:1.4*Ge*labelScale,width:.1*Ge*labelScale},{$:"rect",alpha:0,fill:"rgba(255, 255, 255, 0)",x:an.x-.3*Ge*labelScale,y:an.y-2*Ge*labelScale,width:en*2,height:1*Ge*labelScale,label:Zt,"label-size":labelSize*Ge*labelScale,"label-x":(.1+.5)*Ge*labelScale,"label-y":1*Ge*labelScale,"label-color":ue.text.primary}];return jsxRuntimeExports.jsx(NodeList,{nodes:[lodashExports$1.map(Kt,Wt=>({component:Wt,meta:{source:"path",sourceLayerIndex:-99999+oe}}))]})}}return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{})},[ne,oe,ce,ue,pe])}const mapValuesDeep=(ne,oe)=>lodashExports$1.isArray(ne)?lodashExports$1.map(ne,ce=>mapValuesDeep(ce,oe)):lodashExports$1.isObject(ne)?lodashExports$1.mapValues(ne,ce=>mapValuesDeep(ce,oe)):oe(ne);async function findConnection(ne,oe,ce){for(const ue of ne){const pe=await ue.transport().call("features/algorithms"),me=await ue.transport().call("features/formats");if(lodashExports$1.find(pe,{id:oe})&&lodashExports$1.find(me,{id:ce}))return ue}}const maxStringPropLength=40,controller={...lodashExports$1.omit(controller$1,"claimImportedFile"),key:"query",icon:jsxRuntimeExports.jsx(RouteTwoTone,{}),compress:ne=>lodashExports$1.pick(ne,["mapLayerKey","query","start","end","algorithm","onion","step","code","breakpoints"]),editor:withProduce(({value:ne,produce:oe})=>{var xe,_e;const{algorithm:ce}=(ne==null?void 0:ne.source)??{},{layers:ue,allLayers:pe,layer:me,key:ge}=useLayer(void 0,Se=>{var $e;return(($e=Se.source)==null?void 0:$e.type)==="map"}),[{algorithms:ye}]=useFeatures(),[ve]=useConnections();return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Option,{label:"Algorithm",content:jsxRuntimeExports.jsx(FeaturePicker,{arrow:!0,paper:!0,icon:jsxRuntimeExports.jsx(CodeOutlined,{}),label:"Algorithm",value:ce,items:ye.map(Se=>{var $e;return{...Se,description:($e=lodashExports$1.find(ve,{url:Se.source}))==null?void 0:$e.name}}),onChange:async Se=>oe($e=>lodashExports$1.set($e,"source.algorithm",Se))})}),!(ye!=null&&ye.length)&&jsxRuntimeExports.jsx(Type$2,{component:"div",variant:"body2",color:"warning.main",sx:{mb:1},children:"No connected solver has declared support for running algorithms"}),jsxRuntimeExports.jsx(Option,{label:"Map",content:jsxRuntimeExports.jsx(FeaturePicker,{arrow:!0,paper:!0,icon:jsxRuntimeExports.jsx(LayersIcon,{}),label:"Layer",value:ge,items:pe.map(Se=>({id:Se.key,hidden:!lodashExports$1.find(ue,$e=>$e.key===Se.key),name:inferLayerName(Se)})),onChange:async Se=>oe($e=>lodashExports$1.set($e,"source.mapLayerKey",Se))})}),me&&jsxRuntimeExports.jsxs(Type$2,{component:"div",variant:"body2",color:"text.secondary",sx:{mb:1,mt:1},children:["Define source and destination nodes by clicking on valid regions on"," ",inferLayerName(me)]}),jsxRuntimeExports.jsx(Heading,{label:"Preview"}),jsxRuntimeExports.jsx(Box$1,{sx:{height:240,mx:-2},children:jsxRuntimeExports.jsx(TracePreview,{trace:(_e=(xe=ne==null?void 0:ne.source)==null?void 0:xe.trace)==null?void 0:_e.content})})]})}),service:withProduce(({value:ne,produce:oe,onChange:ce})=>{var Ae;const ue=controller$1.service,pe=useSnackbar(),{algorithm:me,mapLayerKey:ge,start:ye,end:ve}=(ne==null?void 0:ne.source)??{},[{layers:xe}]=useLayers(),[_e]=useConnections(),[{algorithms:Se}]=useFeatures(),$e=reactExports.useMemo(()=>{if(ge&&me)return lodashExports$1.find(xe,{key:ge})},[ge,me,xe]),{result:Re}=useMapContent((Ae=$e==null?void 0:$e.source)==null?void 0:Ae.map);return useEffectWhenAsync(async Ie=>{var ke;if($e&&Re&&me){const{format:Be}=((ke=$e==null?void 0:$e.source)==null?void 0:ke.map)??{},{content:Ne}=Re??{};if(Be&&Ne){const Fe=await findConnection(_e,me,Be),Ue=lodashExports$1.find(Se,{id:me});if(Fe){pe(`Executing ${inferLayerName(ne)} using ${Fe.name}...`);const We={format:Be,instances:[{start:ye??0,end:ve??0}],mapURI:`map:${encodeURIComponent(Ne)}`,algorithm:me},qe=await Fe.transport().call("solve/pathfinding",We);Ie.aborted?pe("Canceled"):oe(ze=>{lodashExports$1.set(ze,"source.trace",{name:`${Ue==null?void 0:Ue.name}`,content:qe,key:nanoid$1(),id:nanoid$1()}),lodashExports$1.set(ze,"source.query",We)})}}}},[$e,_e,me,ye,ve,oe,pe,ne,Se],[$e,Re,_e,me,ye,ve]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(ue,{value:ne,onChange:ce})})}),inferName:ne=>{var oe,ce;return((ce=(oe=ne.source)==null?void 0:oe.trace)==null?void 0:ce.name)??"Untitled Query"},provideSelectionInfo:({children:ne,event:oe,layer:ce})=>{const ue=controller$1.provideSelectionInfo,{layer:pe,setLayer:me,layers:ge}=useLayer(ce),ye=reactExports.useMemo(()=>{const xe=lodashExports$1.filter(ge,{source:{type:"map"}});return lodashExports$1.filter(lodashExports$1.map(xe,_e=>{var $e,Re,Ae,Ie;const{parsedMap:Se}=(_e==null?void 0:_e.source)??{};if(Se&&oe){const ke=(Ie=(Ae=getParser((Re=($e=_e==null?void 0:_e.source)==null?void 0:$e.map)==null?void 0:Re.format))==null?void 0:Ae.hydrate)==null?void 0:Ie.call(Ae,Se);if(ke){const Be=(oe==null?void 0:oe.world)&&ke.snap(oe.world);if(Be){const Ne=(oe==null?void 0:oe.world)&&ke.nodeAt(Be);return{point:Be,node:Ne,key:_e.key,name:inferLayerName(_e)}}}}}))},[ge]),ve=reactExports.useMemo(()=>!!pe&&!!ye.length&&{[pe.key]:{primary:inferLayerName(pe),items:{...lodashExports$1.reduce(ye,(xe,_e)=>({...xe,[`${ce}-${_e==null?void 0:_e.key}-source`]:{primary:"Set as source",secondary:_e==null?void 0:_e.name,action:()=>me(produce(pe,Se=>{lodashExports$1.set(Se,"source.start",_e==null?void 0:_e.node),lodashExports$1.set(Se,"source.query",void 0),lodashExports$1.set(Se,"source.mapLayerKey",_e==null?void 0:_e.key),lodashExports$1.set(Se,"source.trace",void 0)})),icon:jsxRuntimeExports.jsx(StartIcon,{sx:{transform:"scale(0.5)"}})},[`${ce}-${_e==null?void 0:_e.key}-destination`]:{primary:"Set as destination",secondary:_e==null?void 0:_e.name,action:()=>me(produce(pe,Se=>{lodashExports$1.set(Se,"source.end",_e==null?void 0:_e.node),lodashExports$1.set(Se,"source.query",void 0),lodashExports$1.set(Se,"source.mapLayerKey",_e==null?void 0:_e.key),lodashExports$1.set(Se,"source.trace",void 0)})),icon:jsxRuntimeExports.jsx(DestinationIcon,{})}}),{})}}},[ye,pe,ge,me]);return jsxRuntimeExports.jsx(ue,{event:oe,layer:ce,children:xe=>ne==null?void 0:ne(lodashExports$1.merge(xe,ve))})},getSources:ne=>{const{algorithm:oe=null,start:ce=0,end:ue=0,query:pe}=(ne==null?void 0:ne.source)??{};return[{id:"params",name:"Query",language:"yaml",content:dump({algorithm:oe,instances:[{start:ce,end:ue}],mapURI:"(...)",format:"(...)",...mapValuesDeep(pe,me=>typeof me=="string"&&me.length>maxStringPropLength?`${lodashExports$1.truncate(me,{length:maxStringPropLength})} (${me.length} characters)`:me)},{noCompatMode:!0})},...controller$1.getSources(ne)]}};function getController(ne){var oe;return getControllers()[((oe=ne==null?void 0:ne.source)==null?void 0:oe.type)??""]}const getControllers=lodashExports$1.once(()=>({trace:controller$1,map:controller$2,query:controller}));function inferLayerName(ne){var oe;return ne!=null&&ne.name?ne==null?void 0:ne.name:(oe=ne==null?void 0:ne.source)!=null&&oe.type?getController(ne).inferName(ne):"Untitled Layer"}var shim$5={exports:{}},useSyncExternalStoreShim_production_min={};/** * @license React * use-sync-external-store-shim.production.min.js * @@ -1073,7 +1073,7 @@ ${Nt.current.stack} -moz-user-select: none; -ms-user-select: none; overflow-anchor: none; - `}}];return{always:getStyles(ge,"always"),resting:getStyles(ge,"resting"),dragging:getStyles(ge,"dragging"),dropAnimating:getStyles(ge,"dropAnimating"),userCancel:getStyles(ge,"userCancel")}};const useIsomorphicLayoutEffect$3=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?reactExports.useLayoutEffect:reactExports.useEffect;var useLayoutEffect=useIsomorphicLayoutEffect$3;const getHead=()=>{const ne=document.querySelector("head");return ne||invariant(!1),ne},createStyleEl=ne=>{const oe=document.createElement("style");return ne&&oe.setAttribute("nonce",ne),oe.type="text/css",oe};function useStyleMarshal(ne,oe){const ce=useMemo(()=>getStyles$1(ne),[ne]),ue=reactExports.useRef(null),pe=reactExports.useRef(null),me=useCallback(memoizeOne(Se=>{const $e=pe.current;$e||invariant(!1),$e.textContent=Se}),[]),ge=useCallback(Se=>{const $e=ue.current;$e||invariant(!1),$e.textContent=Se},[]);useLayoutEffect(()=>{!ue.current&&!pe.current||invariant(!1);const Se=createStyleEl(oe),$e=createStyleEl(oe);return ue.current=Se,pe.current=$e,Se.setAttribute(`${prefix$2}-always`,ne),$e.setAttribute(`${prefix$2}-dynamic`,ne),getHead().appendChild(Se),getHead().appendChild($e),ge(ce.always),me(ce.resting),()=>{const Re=Ae=>{const Ie=Ae.current;Ie||invariant(!1),getHead().removeChild(Ie),Ae.current=null};Re(ue),Re(pe)}},[oe,ge,me,ce.always,ce.resting,ne]);const ye=useCallback(()=>me(ce.dragging),[me,ce.dragging]),ve=useCallback(Se=>{if(Se==="DROP"){me(ce.dropAnimating);return}me(ce.userCancel)},[me,ce.dropAnimating,ce.userCancel]),xe=useCallback(()=>{pe.current&&me(ce.resting)},[me,ce.resting]);return useMemo(()=>({dragging:ye,dropping:ve,resting:xe}),[ye,ve,xe])}function querySelectorAll(ne,oe){return Array.from(ne.querySelectorAll(oe))}var getWindowFromEl=ne=>ne&&ne.ownerDocument&&ne.ownerDocument.defaultView?ne.ownerDocument.defaultView:window;function isHtmlElement(ne){return ne instanceof getWindowFromEl(ne).HTMLElement}function findDragHandle(ne,oe){const ce=`[${dragHandle.contextId}="${ne}"]`,ue=querySelectorAll(document,ce);if(!ue.length)return null;const pe=ue.find(me=>me.getAttribute(dragHandle.draggableId)===oe);return!pe||!isHtmlElement(pe)?null:pe}function useFocusMarshal(ne){const oe=reactExports.useRef({}),ce=reactExports.useRef(null),ue=reactExports.useRef(null),pe=reactExports.useRef(!1),me=useCallback(function($e,Re){const Ae={id:$e,focus:Re};return oe.current[$e]=Ae,function(){const ke=oe.current;ke[$e]!==Ae&&delete ke[$e]}},[]),ge=useCallback(function($e){const Re=findDragHandle(ne,$e);Re&&Re!==document.activeElement&&Re.focus()},[ne]),ye=useCallback(function($e,Re){ce.current===$e&&(ce.current=Re)},[]),ve=useCallback(function(){ue.current||pe.current&&(ue.current=requestAnimationFrame(()=>{ue.current=null;const $e=ce.current;$e&&ge($e)}))},[ge]),xe=useCallback(function($e){ce.current=null;const Re=document.activeElement;Re&&Re.getAttribute(dragHandle.draggableId)===$e&&(ce.current=$e)},[]);return useLayoutEffect(()=>(pe.current=!0,function(){pe.current=!1;const $e=ue.current;$e&&cancelAnimationFrame($e)}),[]),useMemo(()=>({register:me,tryRecordFocus:xe,tryRestoreFocusRecorded:ve,tryShiftRecord:ye}),[me,xe,ve,ye])}function createRegistry(){const ne={draggables:{},droppables:{}},oe=[];function ce(Se){return oe.push(Se),function(){const Re=oe.indexOf(Se);Re!==-1&&oe.splice(Re,1)}}function ue(Se){oe.length&&oe.forEach($e=>$e(Se))}function pe(Se){return ne.draggables[Se]||null}function me(Se){const $e=pe(Se);return $e||invariant(!1),$e}const ge={register:Se=>{ne.draggables[Se.descriptor.id]=Se,ue({type:"ADDITION",value:Se})},update:(Se,$e)=>{const Re=ne.draggables[$e.descriptor.id];Re&&Re.uniqueId===Se.uniqueId&&(delete ne.draggables[$e.descriptor.id],ne.draggables[Se.descriptor.id]=Se)},unregister:Se=>{const $e=Se.descriptor.id,Re=pe($e);Re&&Se.uniqueId===Re.uniqueId&&(delete ne.draggables[$e],ne.droppables[Se.descriptor.droppableId]&&ue({type:"REMOVAL",value:Se}))},getById:me,findById:pe,exists:Se=>!!pe(Se),getAllByType:Se=>Object.values(ne.draggables).filter($e=>$e.descriptor.type===Se)};function ye(Se){return ne.droppables[Se]||null}function ve(Se){const $e=ye(Se);return $e||invariant(!1),$e}const xe={register:Se=>{ne.droppables[Se.descriptor.id]=Se},unregister:Se=>{const $e=ye(Se.descriptor.id);$e&&Se.uniqueId===$e.uniqueId&&delete ne.droppables[Se.descriptor.id]},getById:ve,findById:ye,exists:Se=>!!ye(Se),getAllByType:Se=>Object.values(ne.droppables).filter($e=>$e.descriptor.type===Se)};function _e(){ne.draggables={},ne.droppables={},oe.length=0}return{draggable:ge,droppable:xe,subscribe:ce,clean:_e}}function useRegistry(){const ne=useMemo(createRegistry,[]);return reactExports.useEffect(()=>function(){React$2.version.startsWith("16")||React$2.version.startsWith("17")?requestAnimationFrame(ne.clean):ne.clean()},[ne]),ne}var StoreContext=React$2.createContext(null),getBodyElement=()=>{const ne=document.body;return ne||invariant(!1),ne};const visuallyHidden={position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)","clip-path":"inset(100%)"};var visuallyHidden$1=visuallyHidden;const getId=ne=>`rfd-announcement-${ne}`;function useAnnouncer(ne){const oe=useMemo(()=>getId(ne),[ne]),ce=reactExports.useRef(null);return reactExports.useEffect(function(){const me=document.createElement("div");return ce.current=me,me.id=oe,me.setAttribute("aria-live","assertive"),me.setAttribute("aria-atomic","true"),_extends$2(me.style,visuallyHidden$1),getBodyElement().appendChild(me),function(){setTimeout(function(){const ve=getBodyElement();ve.contains(me)&&ve.removeChild(me),me===ce.current&&(ce.current=null)})}},[oe]),useCallback(pe=>{const me=ce.current;if(me){me.textContent=pe;return}},[])}let count$1=0;const defaults$2={separator:"::"};function useDeprecatedUniqueId(ne,oe=defaults$2){return useMemo(()=>`${ne}${oe.separator}${count$1++}`,[oe.separator,ne])}function useUniqueId(ne,oe=defaults$2){const ce=React$2.useId();return useMemo(()=>`${ne}${oe.separator}${ce}`,[oe.separator,ne,ce])}var useUniqueId$1="useId"in React$2?useUniqueId:useDeprecatedUniqueId;function getElementId({contextId:ne,uniqueId:oe}){return`rfd-hidden-text-${ne}-${oe}`}function useHiddenTextElement({contextId:ne,text:oe}){const ce=useUniqueId$1("hidden-text",{separator:"-"}),ue=useMemo(()=>getElementId({contextId:ne,uniqueId:ce}),[ce,ne]);return reactExports.useEffect(function(){const me=document.createElement("div");return me.id=ue,me.textContent=oe,me.style.display="none",getBodyElement().appendChild(me),function(){const ye=getBodyElement();ye.contains(me)&&ye.removeChild(me)}},[ue,oe]),ue}var AppContext=React$2.createContext(null);function usePrevious(ne){const oe=reactExports.useRef(ne);return reactExports.useEffect(()=>{oe.current=ne}),oe}function create$1(){let ne=null;function oe(){return!!ne}function ce(ge){return ge===ne}function ue(ge){ne&&invariant(!1);const ye={abandon:ge};return ne=ye,ye}function pe(){ne||invariant(!1),ne=null}function me(){ne&&(ne.abandon(),pe())}return{isClaimed:oe,isActive:ce,claim:ue,release:pe,tryAbandon:me}}function isDragging(ne){return ne.phase==="IDLE"||ne.phase==="DROP_ANIMATING"?!1:ne.isDragging}const tab=9,enter=13,escape$1=27,space=32,pageUp=33,pageDown=34,end=35,home=36,arrowLeft=37,arrowUp=38,arrowRight=39,arrowDown=40,preventedKeys={[enter]:!0,[tab]:!0};var preventStandardKeyEvents=ne=>{preventedKeys[ne.keyCode]&&ne.preventDefault()};const supportedEventName=(()=>{const ne="visibilitychange";return typeof document>"u"?ne:[ne,`ms${ne}`,`webkit${ne}`,`moz${ne}`,`o${ne}`].find(ue=>`on${ue}`in document)||ne})();var supportedPageVisibilityEventName=supportedEventName;const primaryButton=0,sloppyClickThreshold=5;function isSloppyClickThresholdExceeded(ne,oe){return Math.abs(oe.x-ne.x)>=sloppyClickThreshold||Math.abs(oe.y-ne.y)>=sloppyClickThreshold}const idle$1={type:"IDLE"};function getCaptureBindings({cancel:ne,completed:oe,getPhase:ce,setPhase:ue}){return[{eventName:"mousemove",fn:pe=>{const{button:me,clientX:ge,clientY:ye}=pe;if(me!==primaryButton)return;const ve={x:ge,y:ye},xe=ce();if(xe.type==="DRAGGING"){pe.preventDefault(),xe.actions.move(ve);return}xe.type!=="PENDING"&&invariant(!1);const _e=xe.point;if(!isSloppyClickThresholdExceeded(_e,ve))return;pe.preventDefault();const Se=xe.actions.fluidLift(ve);ue({type:"DRAGGING",actions:Se})}},{eventName:"mouseup",fn:pe=>{const me=ce();if(me.type!=="DRAGGING"){ne();return}pe.preventDefault(),me.actions.drop({shouldBlockNextClick:!0}),oe()}},{eventName:"mousedown",fn:pe=>{ce().type==="DRAGGING"&&pe.preventDefault(),ne()}},{eventName:"keydown",fn:pe=>{if(ce().type==="PENDING"){ne();return}if(pe.keyCode===escape$1){pe.preventDefault(),ne();return}preventStandardKeyEvents(pe)}},{eventName:"resize",fn:ne},{eventName:"scroll",options:{passive:!0,capture:!1},fn:()=>{ce().type==="PENDING"&&ne()}},{eventName:"webkitmouseforcedown",fn:pe=>{const me=ce();if(me.type==="IDLE"&&invariant(!1),me.actions.shouldRespectForcePress()){ne();return}pe.preventDefault()}},{eventName:supportedPageVisibilityEventName,fn:ne}]}function useMouseSensor(ne){const oe=reactExports.useRef(idle$1),ce=reactExports.useRef(noop$2$1),ue=useMemo(()=>({eventName:"mousedown",fn:function(Se){if(Se.defaultPrevented||Se.button!==primaryButton||Se.ctrlKey||Se.metaKey||Se.shiftKey||Se.altKey)return;const $e=ne.findClosestDraggableId(Se);if(!$e)return;const Re=ne.tryGetLock($e,ge,{sourceEvent:Se});if(!Re)return;Se.preventDefault();const Ae={x:Se.clientX,y:Se.clientY};ce.current(),xe(Re,Ae)}}),[ne]),pe=useMemo(()=>({eventName:"webkitmouseforcewillbegin",fn:_e=>{if(_e.defaultPrevented)return;const Se=ne.findClosestDraggableId(_e);if(!Se)return;const $e=ne.findOptionsForDraggable(Se);$e&&($e.shouldRespectForcePress||ne.canGetLock(Se)&&_e.preventDefault())}}),[ne]),me=useCallback(function(){const Se={passive:!1,capture:!0};ce.current=bindEvents(window,[pe,ue],Se)},[pe,ue]),ge=useCallback(()=>{oe.current.type!=="IDLE"&&(oe.current=idle$1,ce.current(),me())},[me]),ye=useCallback(()=>{const _e=oe.current;ge(),_e.type==="DRAGGING"&&_e.actions.cancel({shouldBlockNextClick:!0}),_e.type==="PENDING"&&_e.actions.abort()},[ge]),ve=useCallback(function(){const Se={capture:!0,passive:!1},$e=getCaptureBindings({cancel:ye,completed:ge,getPhase:()=>oe.current,setPhase:Re=>{oe.current=Re}});ce.current=bindEvents(window,$e,Se)},[ye,ge]),xe=useCallback(function(Se,$e){oe.current.type!=="IDLE"&&invariant(!1),oe.current={type:"PENDING",point:$e,actions:Se},ve()},[ve]);useLayoutEffect(function(){return me(),function(){ce.current()}},[me])}function noop$1$1(){}const scrollJumpKeys={[pageDown]:!0,[pageUp]:!0,[home]:!0,[end]:!0};function getDraggingBindings(ne,oe){function ce(){oe(),ne.cancel()}function ue(){oe(),ne.drop()}return[{eventName:"keydown",fn:pe=>{if(pe.keyCode===escape$1){pe.preventDefault(),ce();return}if(pe.keyCode===space){pe.preventDefault(),ue();return}if(pe.keyCode===arrowDown){pe.preventDefault(),ne.moveDown();return}if(pe.keyCode===arrowUp){pe.preventDefault(),ne.moveUp();return}if(pe.keyCode===arrowRight){pe.preventDefault(),ne.moveRight();return}if(pe.keyCode===arrowLeft){pe.preventDefault(),ne.moveLeft();return}if(scrollJumpKeys[pe.keyCode]){pe.preventDefault();return}preventStandardKeyEvents(pe)}},{eventName:"mousedown",fn:ce},{eventName:"mouseup",fn:ce},{eventName:"click",fn:ce},{eventName:"touchstart",fn:ce},{eventName:"resize",fn:ce},{eventName:"wheel",fn:ce,options:{passive:!0}},{eventName:supportedPageVisibilityEventName,fn:ce}]}function useKeyboardSensor(ne){const oe=reactExports.useRef(noop$1$1),ce=useMemo(()=>({eventName:"keydown",fn:function(me){if(me.defaultPrevented||me.keyCode!==space)return;const ge=ne.findClosestDraggableId(me);if(!ge)return;const ye=ne.tryGetLock(ge,_e,{sourceEvent:me});if(!ye)return;me.preventDefault();let ve=!0;const xe=ye.snapLift();oe.current();function _e(){ve||invariant(!1),ve=!1,oe.current(),ue()}oe.current=bindEvents(window,getDraggingBindings(xe,_e),{capture:!0,passive:!1})}}),[ne]),ue=useCallback(function(){const me={passive:!1,capture:!0};oe.current=bindEvents(window,[ce],me)},[ce]);useLayoutEffect(function(){return ue(),function(){oe.current()}},[ue])}const idle={type:"IDLE"},timeForLongPress=120,forcePressThreshold=.15;function getWindowBindings({cancel:ne,getPhase:oe}){return[{eventName:"orientationchange",fn:ne},{eventName:"resize",fn:ne},{eventName:"contextmenu",fn:ce=>{ce.preventDefault()}},{eventName:"keydown",fn:ce=>{if(oe().type!=="DRAGGING"){ne();return}ce.keyCode===escape$1&&ce.preventDefault(),ne()}},{eventName:supportedPageVisibilityEventName,fn:ne}]}function getHandleBindings({cancel:ne,completed:oe,getPhase:ce}){return[{eventName:"touchmove",options:{capture:!1},fn:ue=>{const pe=ce();if(pe.type!=="DRAGGING"){ne();return}pe.hasMoved=!0;const{clientX:me,clientY:ge}=ue.touches[0],ye={x:me,y:ge};ue.preventDefault(),pe.actions.move(ye)}},{eventName:"touchend",fn:ue=>{const pe=ce();if(pe.type!=="DRAGGING"){ne();return}ue.preventDefault(),pe.actions.drop({shouldBlockNextClick:!0}),oe()}},{eventName:"touchcancel",fn:ue=>{if(ce().type!=="DRAGGING"){ne();return}ue.preventDefault(),ne()}},{eventName:"touchforcechange",fn:ue=>{const pe=ce();pe.type==="IDLE"&&invariant(!1);const me=ue.touches[0];if(!me||!(me.force>=forcePressThreshold))return;const ye=pe.actions.shouldRespectForcePress();if(pe.type==="PENDING"){ye&&ne();return}if(ye){if(pe.hasMoved){ue.preventDefault();return}ne();return}ue.preventDefault()}},{eventName:supportedPageVisibilityEventName,fn:ne}]}function useTouchSensor(ne){const oe=reactExports.useRef(idle),ce=reactExports.useRef(noop$2$1),ue=useCallback(function(){return oe.current},[]),pe=useCallback(function(Re){oe.current=Re},[]),me=useMemo(()=>({eventName:"touchstart",fn:function(Re){if(Re.defaultPrevented)return;const Ae=ne.findClosestDraggableId(Re);if(!Ae)return;const Ie=ne.tryGetLock(Ae,ye,{sourceEvent:Re});if(!Ie)return;const ke=Re.touches[0],{clientX:Be,clientY:Ne}=ke,Fe={x:Be,y:Ne};ce.current(),Se(Ie,Fe)}}),[ne]),ge=useCallback(function(){const Re={capture:!0,passive:!1};ce.current=bindEvents(window,[me],Re)},[me]),ye=useCallback(()=>{const $e=oe.current;$e.type!=="IDLE"&&($e.type==="PENDING"&&clearTimeout($e.longPressTimerId),pe(idle),ce.current(),ge())},[ge,pe]),ve=useCallback(()=>{const $e=oe.current;ye(),$e.type==="DRAGGING"&&$e.actions.cancel({shouldBlockNextClick:!0}),$e.type==="PENDING"&&$e.actions.abort()},[ye]),xe=useCallback(function(){const Re={capture:!0,passive:!1},Ae={cancel:ve,completed:ye,getPhase:ue},Ie=bindEvents(window,getHandleBindings(Ae),Re),ke=bindEvents(window,getWindowBindings(Ae),Re);ce.current=function(){Ie(),ke()}},[ve,ue,ye]),_e=useCallback(function(){const Re=ue();Re.type!=="PENDING"&&invariant(!1);const Ae=Re.actions.fluidLift(Re.point);pe({type:"DRAGGING",actions:Ae,hasMoved:!1})},[ue,pe]),Se=useCallback(function(Re,Ae){ue().type!=="IDLE"&&invariant(!1);const Ie=setTimeout(_e,timeForLongPress);pe({type:"PENDING",point:Ae,actions:Re,longPressTimerId:Ie}),xe()},[xe,ue,pe,_e]);useLayoutEffect(function(){return ge(),function(){ce.current();const Ae=ue();Ae.type==="PENDING"&&(clearTimeout(Ae.longPressTimerId),pe(idle))}},[ue,ge,pe]),useLayoutEffect(function(){return bindEvents(window,[{eventName:"touchmove",fn:()=>{},options:{capture:!1,passive:!1}}])},[])}const interactiveTagNames=["input","button","textarea","select","option","optgroup","video","audio"];function isAnInteractiveElement(ne,oe){if(oe==null)return!1;if(interactiveTagNames.includes(oe.tagName.toLowerCase()))return!0;const ue=oe.getAttribute("contenteditable");return ue==="true"||ue===""?!0:oe===ne?!1:isAnInteractiveElement(ne,oe.parentElement)}function isEventInInteractiveElement(ne,oe){const ce=oe.target;return isHtmlElement(ce)?isAnInteractiveElement(ne,ce):!1}var getBorderBoxCenterPosition=ne=>getRect(ne.getBoundingClientRect()).center;function isElement$1(ne){return ne instanceof getWindowFromEl(ne).Element}const supportedMatchesName=(()=>{const ne="matches";return typeof document>"u"?ne:[ne,"msMatchesSelector","webkitMatchesSelector"].find(ue=>ue in Element.prototype)||ne})();function closestPonyfill(ne,oe){return ne==null?null:ne[supportedMatchesName](oe)?ne:closestPonyfill(ne.parentElement,oe)}function closest(ne,oe){return ne.closest?ne.closest(oe):closestPonyfill(ne,oe)}function getSelector(ne){return`[${dragHandle.contextId}="${ne}"]`}function findClosestDragHandleFromEvent(ne,oe){const ce=oe.target;if(!isElement$1(ce))return null;const ue=getSelector(ne),pe=closest(ce,ue);return!pe||!isHtmlElement(pe)?null:pe}function tryGetClosestDraggableIdFromEvent(ne,oe){const ce=findClosestDragHandleFromEvent(ne,oe);return ce?ce.getAttribute(dragHandle.draggableId):null}function findDraggable(ne,oe){const ce=`[${draggable.contextId}="${ne}"]`,pe=querySelectorAll(document,ce).find(me=>me.getAttribute(draggable.id)===oe);return!pe||!isHtmlElement(pe)?null:pe}function preventDefault(ne){ne.preventDefault()}function isActive({expected:ne,phase:oe,isLockActive:ce,shouldWarn:ue}){return!(!ce()||ne!==oe)}function canStart({lockAPI:ne,store:oe,registry:ce,draggableId:ue}){if(ne.isClaimed())return!1;const pe=ce.draggable.findById(ue);return!(!pe||!pe.options.isEnabled||!canStartDrag(oe.getState(),ue))}function tryStart({lockAPI:ne,contextId:oe,store:ce,registry:ue,draggableId:pe,forceSensorStop:me,sourceEvent:ge}){if(!canStart({lockAPI:ne,store:ce,registry:ue,draggableId:pe}))return null;const ve=ue.draggable.getById(pe),xe=findDraggable(oe,ve.descriptor.id);if(!xe||ge&&!ve.options.canDragInteractiveElements&&isEventInInteractiveElement(xe,ge))return null;const _e=ne.claim(me||noop$2$1);let Se="PRE_DRAG";function $e(){return ve.options.shouldRespectForcePress}function Re(){return ne.isActive(_e)}function Ae(We,qe){isActive({expected:We,phase:Se,isLockActive:Re,shouldWarn:!0})&&ce.dispatch(qe())}const Ie=Ae.bind(null,"DRAGGING");function ke(We){function qe(){ne.release(),Se="COMPLETED"}Se!=="PRE_DRAG"&&(qe(),invariant(!1)),ce.dispatch(lift$1(We.liftActionArgs)),Se="DRAGGING";function ze(Ge,Ze={shouldBlockNextClick:!1}){if(We.cleanup(),Ze.shouldBlockNextClick){const Dt=bindEvents(window,[{eventName:"click",fn:preventDefault,options:{once:!0,passive:!1,capture:!0}}]);setTimeout(Dt)}qe(),ce.dispatch(drop$1({reason:Ge}))}return{isActive:()=>isActive({expected:"DRAGGING",phase:Se,isLockActive:Re,shouldWarn:!1}),shouldRespectForcePress:$e,drop:Ge=>ze("DROP",Ge),cancel:Ge=>ze("CANCEL",Ge),...We.actions}}function Be(We){const qe=rafSchd$1(Ge=>{Ie(()=>move({client:Ge}))});return{...ke({liftActionArgs:{id:pe,clientSelection:We,movementMode:"FLUID"},cleanup:()=>qe.cancel(),actions:{move:qe}}),move:qe}}function Ne(){const We={moveUp:()=>Ie(moveUp),moveRight:()=>Ie(moveRight),moveDown:()=>Ie(moveDown),moveLeft:()=>Ie(moveLeft)};return ke({liftActionArgs:{id:pe,clientSelection:getBorderBoxCenterPosition(xe),movementMode:"SNAP"},cleanup:noop$2$1,actions:We})}function Fe(){isActive({expected:"PRE_DRAG",phase:Se,isLockActive:Re,shouldWarn:!0})&&ne.release()}return{isActive:()=>isActive({expected:"PRE_DRAG",phase:Se,isLockActive:Re,shouldWarn:!1}),shouldRespectForcePress:$e,fluidLift:Be,snapLift:Ne,abort:Fe}}const defaultSensors=[useMouseSensor,useKeyboardSensor,useTouchSensor];function useSensorMarshal({contextId:ne,store:oe,registry:ce,customSensors:ue,enableDefaultSensors:pe}){const me=[...pe?defaultSensors:[],...ue||[]],ge=reactExports.useState(()=>create$1())[0],ye=useCallback(function(ke,Be){isDragging(ke)&&!isDragging(Be)&&ge.tryAbandon()},[ge]);useLayoutEffect(function(){let ke=oe.getState();return oe.subscribe(()=>{const Ne=oe.getState();ye(ke,Ne),ke=Ne})},[ge,oe,ye]),useLayoutEffect(()=>ge.tryAbandon,[ge.tryAbandon]);const ve=useCallback(Ie=>canStart({lockAPI:ge,registry:ce,store:oe,draggableId:Ie}),[ge,ce,oe]),xe=useCallback((Ie,ke,Be)=>tryStart({lockAPI:ge,registry:ce,contextId:ne,store:oe,draggableId:Ie,forceSensorStop:ke||null,sourceEvent:Be&&Be.sourceEvent?Be.sourceEvent:null}),[ne,ge,ce,oe]),_e=useCallback(Ie=>tryGetClosestDraggableIdFromEvent(ne,Ie),[ne]),Se=useCallback(Ie=>{const ke=ce.draggable.findById(Ie);return ke?ke.options:null},[ce.draggable]),$e=useCallback(function(){ge.isClaimed()&&(ge.tryAbandon(),oe.getState().phase!=="IDLE"&&oe.dispatch(flush()))},[ge,oe]),Re=useCallback(()=>ge.isClaimed(),[ge]),Ae=useMemo(()=>({canGetLock:ve,tryGetLock:xe,findClosestDraggableId:_e,findOptionsForDraggable:Se,tryReleaseLock:$e,isLockClaimed:Re}),[ve,xe,_e,Se,$e,Re]);for(let Ie=0;Ie({onBeforeCapture:oe=>{const ce=()=>{ne.onBeforeCapture&&ne.onBeforeCapture(oe)};React$2.version.startsWith("16")||React$2.version.startsWith("17")?ce():reactDomExports.flushSync(ce)},onBeforeDragStart:ne.onBeforeDragStart,onDragStart:ne.onDragStart,onDragEnd:ne.onDragEnd,onDragUpdate:ne.onDragUpdate}),createAutoScrollerOptions=ne=>({...defaultAutoScrollerOptions,...ne.autoScrollerOptions,durationDampening:{...defaultAutoScrollerOptions.durationDampening,...ne.autoScrollerOptions}});function getStore(ne){return ne.current||invariant(!1),ne.current}function App$1(ne){const{contextId:oe,setCallbacks:ce,sensors:ue,nonce:pe,dragHandleUsageInstructions:me}=ne,ge=reactExports.useRef(null),ye=usePrevious(ne),ve=useCallback(()=>createResponders(ye.current),[ye]),xe=useCallback(()=>createAutoScrollerOptions(ye.current),[ye]),_e=useAnnouncer(oe),Se=useHiddenTextElement({contextId:oe,text:me}),$e=useStyleMarshal(oe,pe),Re=useCallback(Dt=>{getStore(ge).dispatch(Dt)},[]),Ae=useMemo(()=>bindActionCreators$1({publishWhileDragging,updateDroppableScroll,updateDroppableIsEnabled,updateDroppableIsCombineEnabled,collectionStarting},Re),[Re]),Ie=useRegistry(),ke=useMemo(()=>createDimensionMarshal(Ie,Ae),[Ie,Ae]),Be=useMemo(()=>createAutoScroller({scrollWindow,scrollDroppable:ke.scrollDroppable,getAutoScrollerOptions:xe,...bindActionCreators$1({move},Re)}),[ke.scrollDroppable,Re,xe]),Ne=useFocusMarshal(oe),Fe=useMemo(()=>createStore({announce:_e,autoScroller:Be,dimensionMarshal:ke,focusMarshal:Ne,getResponders:ve,styleMarshal:$e}),[_e,Be,ke,Ne,ve,$e]);ge.current=Fe;const Ue=useCallback(()=>{const Dt=getStore(ge);Dt.getState().phase!=="IDLE"&&Dt.dispatch(flush())},[]),We=useCallback(()=>{const Dt=getStore(ge).getState();return Dt.phase==="DROP_ANIMATING"?!0:Dt.phase==="IDLE"?!1:Dt.isDragging},[]),qe=useMemo(()=>({isDragging:We,tryAbort:Ue}),[We,Ue]);ce(qe);const ze=useCallback(Dt=>canStartDrag(getStore(ge).getState(),Dt),[]),Ge=useCallback(()=>isMovementAllowed(getStore(ge).getState()),[]),Ze=useMemo(()=>({marshal:ke,focus:Ne,contextId:oe,canLift:ze,isMovementAllowed:Ge,dragHandleUsageInstructionsId:Se,registry:Ie}),[oe,ke,Se,Ne,ze,Ge,Ie]);return useSensorMarshal({contextId:oe,store:Fe,registry:Ie,customSensors:ue||null,enableDefaultSensors:ne.enableDefaultSensors!==!1}),reactExports.useEffect(()=>Ue,[Ue]),React$2.createElement(AppContext.Provider,{value:Ze},React$2.createElement(Provider,{context:StoreContext,store:Fe},ne.children))}let count=0;function useDeprecatedUniqueContextId(){return useMemo(()=>`${count++}`,[])}function useUniqueContextId(){return React$2.useId()}var useUniqueContextId$1="useId"in React$2?useUniqueContextId:useDeprecatedUniqueContextId;function DragDropContext(ne){const oe=useUniqueContextId$1(),ce=ne.dragHandleUsageInstructions||preset$1.dragHandleUsageInstructions;return React$2.createElement(ErrorBoundary$1,null,ue=>React$2.createElement(App$1,{nonce:ne.nonce,contextId:oe,setCallbacks:ue,dragHandleUsageInstructions:ce,enableDefaultSensors:ne.enableDefaultSensors,sensors:ne.sensors,onBeforeCapture:ne.onBeforeCapture,onBeforeDragStart:ne.onBeforeDragStart,onDragStart:ne.onDragStart,onDragUpdate:ne.onDragUpdate,onDragEnd:ne.onDragEnd,autoScrollerOptions:ne.autoScrollerOptions},ne.children))}const zIndexOptions={dragging:5e3,dropAnimating:4500},getDraggingTransition=(ne,oe)=>oe?transitions.drop(oe.duration):ne?transitions.snap:transitions.fluid,getDraggingOpacity=(ne,oe)=>{if(ne)return oe?combine$1.opacity.drop:combine$1.opacity.combining},getShouldDraggingAnimate=ne=>ne.forceShouldAnimate!=null?ne.forceShouldAnimate:ne.mode==="SNAP";function getDraggingStyle(ne){const ce=ne.dimension.client,{offset:ue,combineWith:pe,dropping:me}=ne,ge=!!pe,ye=getShouldDraggingAnimate(ne),ve=!!me,xe=ve?transforms.drop(ue,ge):transforms.moveTo(ue);return{position:"fixed",top:ce.marginBox.top,left:ce.marginBox.left,boxSizing:"border-box",width:ce.borderBox.width,height:ce.borderBox.height,transition:getDraggingTransition(ye,me),transform:xe,opacity:getDraggingOpacity(ge,ve),zIndex:ve?zIndexOptions.dropAnimating:zIndexOptions.dragging,pointerEvents:"none"}}function getSecondaryStyle(ne){return{transform:transforms.moveTo(ne.offset),transition:ne.shouldAnimateDisplacement?void 0:"none"}}function getStyle$1(ne){return ne.type==="DRAGGING"?getDraggingStyle(ne):getSecondaryStyle(ne)}function getDimension$1(ne,oe,ce=origin){const ue=window.getComputedStyle(oe),pe=oe.getBoundingClientRect(),me=calculateBox(pe,ue),ge=withScroll(me,ce),ye={client:me,tagName:oe.tagName.toLowerCase(),display:ue.display},ve={x:me.marginBox.width,y:me.marginBox.height};return{descriptor:ne,placeholder:ye,displaceBy:ve,client:me,page:ge}}function useDraggablePublisher(ne){const oe=useUniqueId$1("draggable"),{descriptor:ce,registry:ue,getDraggableRef:pe,canDragInteractiveElements:me,shouldRespectForcePress:ge,isEnabled:ye}=ne,ve=useMemo(()=>({canDragInteractiveElements:me,shouldRespectForcePress:ge,isEnabled:ye}),[me,ye,ge]),xe=useCallback(Re=>{const Ae=pe();return Ae||invariant(!1),getDimension$1(ce,Ae,Re)},[ce,pe]),_e=useMemo(()=>({uniqueId:oe,descriptor:ce,options:ve,getDimension:xe}),[ce,xe,ve,oe]),Se=reactExports.useRef(_e),$e=reactExports.useRef(!0);useLayoutEffect(()=>(ue.draggable.register(Se.current),()=>ue.draggable.unregister(Se.current)),[ue.draggable]),useLayoutEffect(()=>{if($e.current){$e.current=!1;return}const Re=Se.current;Se.current=_e,ue.draggable.update(_e,Re)},[_e,ue.draggable])}var DroppableContext=React$2.createContext(null);function useRequiredContext(ne){const oe=reactExports.useContext(ne);return oe||invariant(!1),oe}function preventHtml5Dnd(ne){ne.preventDefault()}const Draggable=ne=>{const oe=reactExports.useRef(null),ce=useCallback((qe=null)=>{oe.current=qe},[]),ue=useCallback(()=>oe.current,[]),{contextId:pe,dragHandleUsageInstructionsId:me,registry:ge}=useRequiredContext(AppContext),{type:ye,droppableId:ve}=useRequiredContext(DroppableContext),xe=useMemo(()=>({id:ne.draggableId,index:ne.index,type:ye,droppableId:ve}),[ne.draggableId,ne.index,ye,ve]),{children:_e,draggableId:Se,isEnabled:$e,shouldRespectForcePress:Re,canDragInteractiveElements:Ae,isClone:Ie,mapped:ke,dropAnimationFinished:Be}=ne;if(!Ie){const qe=useMemo(()=>({descriptor:xe,registry:ge,getDraggableRef:ue,canDragInteractiveElements:Ae,shouldRespectForcePress:Re,isEnabled:$e}),[xe,ge,ue,Ae,Re,$e]);useDraggablePublisher(qe)}const Ne=useMemo(()=>$e?{tabIndex:0,role:"button","aria-describedby":me,"data-rfd-drag-handle-draggable-id":Se,"data-rfd-drag-handle-context-id":pe,draggable:!1,onDragStart:preventHtml5Dnd}:null,[pe,me,Se,$e]),Fe=useCallback(qe=>{ke.type==="DRAGGING"&&ke.dropping&&qe.propertyName==="transform"&&(React$2.version.startsWith("16")||React$2.version.startsWith("17")?Be():reactDomExports.flushSync(Be))},[Be,ke]),Ue=useMemo(()=>{const qe=getStyle$1(ke),ze=ke.type==="DRAGGING"&&ke.dropping?Fe:void 0;return{innerRef:ce,draggableProps:{"data-rfd-draggable-context-id":pe,"data-rfd-draggable-id":Se,style:qe,onTransitionEnd:ze},dragHandleProps:Ne}},[pe,Ne,Se,ke,Fe,ce]),We=useMemo(()=>({draggableId:xe.id,type:xe.type,source:{index:xe.index,droppableId:xe.droppableId}}),[xe.droppableId,xe.id,xe.index,xe.type]);return React$2.createElement(React$2.Fragment,null,_e(Ue,ke.snapshot,We))};var Draggable$1=Draggable,isStrictEqual=(ne,oe)=>ne===oe,whatIsDraggedOverFromResult=ne=>{const{combine:oe,destination:ce}=ne;return ce?ce.droppableId:oe?oe.droppableId:null};const getCombineWithFromResult=ne=>ne.combine?ne.combine.draggableId:null,getCombineWithFromImpact=ne=>ne.at&&ne.at.type==="COMBINE"?ne.at.combine.draggableId:null;function getDraggableSelector(){const ne=memoizeOne((pe,me)=>({x:pe,y:me})),oe=memoizeOne((pe,me,ge=null,ye=null,ve=null)=>({isDragging:!0,isClone:me,isDropAnimating:!!ve,dropAnimation:ve,mode:pe,draggingOver:ge,combineWith:ye,combineTargetFor:null})),ce=memoizeOne((pe,me,ge,ye,ve=null,xe=null,_e=null)=>({mapped:{type:"DRAGGING",dropping:null,draggingOver:ve,combineWith:xe,mode:me,offset:pe,dimension:ge,forceShouldAnimate:_e,snapshot:oe(me,ye,ve,xe,null)}}));return(pe,me)=>{if(isDragging(pe)){if(pe.critical.draggable.id!==me.draggableId)return null;const ge=pe.current.client.offset,ye=pe.dimensions.draggables[me.draggableId],ve=whatIsDraggedOver(pe.impact),xe=getCombineWithFromImpact(pe.impact),_e=pe.forceShouldAnimate;return ce(ne(ge.x,ge.y),pe.movementMode,ye,me.isClone,ve,xe,_e)}if(pe.phase==="DROP_ANIMATING"){const ge=pe.completed;if(ge.result.draggableId!==me.draggableId)return null;const ye=me.isClone,ve=pe.dimensions.draggables[me.draggableId],xe=ge.result,_e=xe.mode,Se=whatIsDraggedOverFromResult(xe),$e=getCombineWithFromResult(xe),Ae={duration:pe.dropDuration,curve:curves$1.drop,moveTo:pe.newHomeClientOffset,opacity:$e?combine$1.opacity.drop:null,scale:$e?combine$1.scale.drop:null};return{mapped:{type:"DRAGGING",offset:pe.newHomeClientOffset,dimension:ve,dropping:Ae,draggingOver:Se,combineWith:$e,mode:_e,forceShouldAnimate:null,snapshot:oe(_e,ye,Se,$e,Ae)}}}return null}}function getSecondarySnapshot(ne=null){return{isDragging:!1,isDropAnimating:!1,isClone:!1,dropAnimation:null,mode:null,draggingOver:null,combineTargetFor:ne,combineWith:null}}const atRest={mapped:{type:"SECONDARY",offset:origin,combineTargetFor:null,shouldAnimateDisplacement:!0,snapshot:getSecondarySnapshot(null)}};function getSecondarySelector(){const ne=memoizeOne((ge,ye)=>({x:ge,y:ye})),oe=memoizeOne(getSecondarySnapshot),ce=memoizeOne((ge,ye=null,ve)=>({mapped:{type:"SECONDARY",offset:ge,combineTargetFor:ye,shouldAnimateDisplacement:ve,snapshot:oe(ye)}})),ue=ge=>ge?ce(origin,ge,!0):null,pe=(ge,ye,ve,xe)=>{const _e=ve.displaced.visible[ge],Se=!!(xe.inVirtualList&&xe.effected[ge]),$e=tryGetCombine(ve),Re=$e&&$e.draggableId===ge?ye:null;if(!_e){if(!Se)return ue(Re);if(ve.displaced.invisible[ge])return null;const ke=negate(xe.displacedBy.point),Be=ne(ke.x,ke.y);return ce(Be,Re,!0)}if(Se)return ue(Re);const Ae=ve.displacedBy.point,Ie=ne(Ae.x,Ae.y);return ce(Ie,Re,_e.shouldAnimate)};return(ge,ye)=>{if(isDragging(ge))return ge.critical.draggable.id===ye.draggableId?null:pe(ye.draggableId,ge.critical.draggable.id,ge.impact,ge.afterCritical);if(ge.phase==="DROP_ANIMATING"){const ve=ge.completed;return ve.result.draggableId===ye.draggableId?null:pe(ye.draggableId,ve.result.draggableId,ve.impact,ve.afterCritical)}return null}}const makeMapStateToProps$1=()=>{const ne=getDraggableSelector(),oe=getSecondarySelector();return(ue,pe)=>ne(ue,pe)||oe(ue,pe)||atRest},mapDispatchToProps$1={dropAnimationFinished},ConnectedDraggable=connect$1(makeMapStateToProps$1,mapDispatchToProps$1,null,{context:StoreContext,areStatePropsEqual:isStrictEqual})(Draggable$1);var ConnectedDraggable$1=ConnectedDraggable;function PrivateDraggable(ne){return useRequiredContext(DroppableContext).isUsingCloneFor===ne.draggableId&&!ne.isClone?null:React$2.createElement(ConnectedDraggable$1,ne)}function PublicDraggable(ne){const oe=typeof ne.isDragDisabled=="boolean"?!ne.isDragDisabled:!0,ce=!!ne.disableInteractiveElementBlocking,ue=!!ne.shouldRespectForcePress;return React$2.createElement(PrivateDraggable,_extends$2({},ne,{isClone:!1,isEnabled:oe,canDragInteractiveElements:ce,shouldRespectForcePress:ue}))}const isEqual=ne=>oe=>ne===oe,isScroll=isEqual("scroll"),isAuto=isEqual("auto"),isEither=(ne,oe)=>oe(ne.overflowX)||oe(ne.overflowY),isElementScrollable=ne=>{const oe=window.getComputedStyle(ne),ce={overflowX:oe.overflowX,overflowY:oe.overflowY};return isEither(ce,isScroll)||isEither(ce,isAuto)},isBodyScrollable=()=>!1,getClosestScrollable=ne=>ne==null?null:ne===document.body?isBodyScrollable()?ne:null:ne===document.documentElement?null:isElementScrollable(ne)?ne:getClosestScrollable(ne.parentElement);var getScroll=ne=>({x:ne.scrollLeft,y:ne.scrollTop});const getIsFixed=ne=>ne?window.getComputedStyle(ne).position==="fixed"?!0:getIsFixed(ne.parentElement):!1;var getEnv=ne=>{const oe=getClosestScrollable(ne),ce=getIsFixed(ne);return{closestScrollable:oe,isFixedOnPage:ce}},getDroppableDimension=({descriptor:ne,isEnabled:oe,isCombineEnabled:ce,isFixedOnPage:ue,direction:pe,client:me,page:ge,closest:ye})=>{const ve=(()=>{if(!ye)return null;const{scrollSize:$e,client:Re}=ye,Ae=getMaxScroll({scrollHeight:$e.scrollHeight,scrollWidth:$e.scrollWidth,height:Re.paddingBox.height,width:Re.paddingBox.width});return{pageMarginBox:ye.page.marginBox,frameClient:Re,scrollSize:$e,shouldClipSubject:ye.shouldClipSubject,scroll:{initial:ye.scroll,current:ye.scroll,max:Ae,diff:{value:origin,displacement:origin}}}})(),xe=pe==="vertical"?vertical:horizontal,_e=getSubject({page:ge,withPlaceholder:null,axis:xe,frame:ve});return{descriptor:ne,isCombineEnabled:ce,isFixedOnPage:ue,axis:xe,isEnabled:oe,client:me,page:ge,frame:ve,subject:_e}};const getClient=(ne,oe)=>{const ce=getBox(ne);if(!oe||ne!==oe)return ce;const ue=ce.paddingBox.top-oe.scrollTop,pe=ce.paddingBox.left-oe.scrollLeft,me=ue+oe.scrollHeight,ge=pe+oe.scrollWidth,ve=expand({top:ue,right:ge,bottom:me,left:pe},ce.border);return createBox({borderBox:ve,margin:ce.margin,border:ce.border,padding:ce.padding})};var getDimension=({ref:ne,descriptor:oe,env:ce,windowScroll:ue,direction:pe,isDropDisabled:me,isCombineEnabled:ge,shouldClipSubject:ye})=>{const ve=ce.closestScrollable,xe=getClient(ne,ve),_e=withScroll(xe,ue),Se=(()=>{if(!ve)return null;const Re=getBox(ve),Ae={scrollHeight:ve.scrollHeight,scrollWidth:ve.scrollWidth};return{client:Re,page:withScroll(Re,ue),scroll:getScroll(ve),scrollSize:Ae,shouldClipSubject:ye}})();return getDroppableDimension({descriptor:oe,isEnabled:!me,isCombineEnabled:ge,isFixedOnPage:ce.isFixedOnPage,direction:pe,client:xe,page:_e,closest:Se})};const immediate={passive:!1},delayed={passive:!0};var getListenerOptions=ne=>ne.shouldPublishImmediately?immediate:delayed;const getClosestScrollableFromDrag=ne=>ne&&ne.env.closestScrollable||null;function useDroppablePublisher(ne){const oe=reactExports.useRef(null),ce=useRequiredContext(AppContext),ue=useUniqueId$1("droppable"),{registry:pe,marshal:me}=ce,ge=usePrevious(ne),ye=useMemo(()=>({id:ne.droppableId,type:ne.type,mode:ne.mode}),[ne.droppableId,ne.mode,ne.type]),ve=reactExports.useRef(ye),xe=useMemo(()=>memoizeOne((Ue,We)=>{oe.current||invariant(!1);const qe={x:Ue,y:We};me.updateDroppableScroll(ye.id,qe)}),[ye.id,me]),_e=useCallback(()=>{const Ue=oe.current;return!Ue||!Ue.env.closestScrollable?origin:getScroll(Ue.env.closestScrollable)},[]),Se=useCallback(()=>{const Ue=_e();xe(Ue.x,Ue.y)},[_e,xe]),$e=useMemo(()=>rafSchd$1(Se),[Se]),Re=useCallback(()=>{const Ue=oe.current,We=getClosestScrollableFromDrag(Ue);if(Ue&&We||invariant(!1),Ue.scrollOptions.shouldPublishImmediately){Se();return}$e()},[$e,Se]),Ae=useCallback((Ue,We)=>{oe.current&&invariant(!1);const qe=ge.current,ze=qe.getDroppableRef();ze||invariant(!1);const Ge=getEnv(ze),Ze={ref:ze,descriptor:ye,env:Ge,scrollOptions:We};oe.current=Ze;const Dt=getDimension({ref:ze,descriptor:ye,env:Ge,windowScroll:Ue,direction:qe.direction,isDropDisabled:qe.isDropDisabled,isCombineEnabled:qe.isCombineEnabled,shouldClipSubject:!qe.ignoreContainerClipping}),Je=Ge.closestScrollable;return Je&&(Je.setAttribute(scrollContainer.contextId,ce.contextId),Je.addEventListener("scroll",Re,getListenerOptions(Ze.scrollOptions))),Dt},[ce.contextId,ye,Re,ge]),Ie=useCallback(()=>{const Ue=oe.current,We=getClosestScrollableFromDrag(Ue);return Ue&&We||invariant(!1),getScroll(We)},[]),ke=useCallback(()=>{const Ue=oe.current;Ue||invariant(!1);const We=getClosestScrollableFromDrag(Ue);oe.current=null,We&&($e.cancel(),We.removeAttribute(scrollContainer.contextId),We.removeEventListener("scroll",Re,getListenerOptions(Ue.scrollOptions)))},[Re,$e]),Be=useCallback(Ue=>{const We=oe.current;We||invariant(!1);const qe=getClosestScrollableFromDrag(We);qe||invariant(!1),qe.scrollTop+=Ue.y,qe.scrollLeft+=Ue.x},[]),Ne=useMemo(()=>({getDimensionAndWatchScroll:Ae,getScrollWhileDragging:Ie,dragStopped:ke,scroll:Be}),[ke,Ae,Ie,Be]),Fe=useMemo(()=>({uniqueId:ue,descriptor:ye,callbacks:Ne}),[Ne,ye,ue]);useLayoutEffect(()=>(ve.current=Fe.descriptor,pe.droppable.register(Fe),()=>{oe.current&&ke(),pe.droppable.unregister(Fe)}),[Ne,ye,ke,Fe,me,pe.droppable]),useLayoutEffect(()=>{oe.current&&me.updateDroppableIsEnabled(ve.current.id,!ne.isDropDisabled)},[ne.isDropDisabled,me]),useLayoutEffect(()=>{oe.current&&me.updateDroppableIsCombineEnabled(ve.current.id,ne.isCombineEnabled)},[ne.isCombineEnabled,me])}function noop$6(){}const empty$2={width:0,height:0,margin:noSpacing},getSize=({isAnimatingOpenOnMount:ne,placeholder:oe,animate:ce})=>ne||ce==="close"?empty$2:{height:oe.client.borderBox.height,width:oe.client.borderBox.width,margin:oe.client.margin},getStyle=({isAnimatingOpenOnMount:ne,placeholder:oe,animate:ce})=>{const ue=getSize({isAnimatingOpenOnMount:ne,placeholder:oe,animate:ce});return{display:oe.display,boxSizing:"border-box",width:ue.width,height:ue.height,marginTop:ue.margin.top,marginRight:ue.margin.right,marginBottom:ue.margin.bottom,marginLeft:ue.margin.left,flexShrink:"0",flexGrow:"0",pointerEvents:"none",transition:ce!=="none"?transitions.placeholder:null}},Placeholder=ne=>{const oe=reactExports.useRef(null),ce=useCallback(()=>{oe.current&&(clearTimeout(oe.current),oe.current=null)},[]),{animate:ue,onTransitionEnd:pe,onClose:me,contextId:ge}=ne,[ye,ve]=reactExports.useState(ne.animate==="open");reactExports.useEffect(()=>ye?ue!=="open"?(ce(),ve(!1),noop$6):oe.current?noop$6:(oe.current=setTimeout(()=>{oe.current=null,ve(!1)}),ce):noop$6,[ue,ye,ce]);const xe=useCallback(Se=>{Se.propertyName==="height"&&(pe(),ue==="close"&&me())},[ue,me,pe]),_e=getStyle({isAnimatingOpenOnMount:ye,animate:ne.animate,placeholder:ne.placeholder});return React$2.createElement(ne.placeholder.tagName,{style:_e,"data-rfd-placeholder-context-id":ge,onTransitionEnd:xe,ref:ne.innerRef})};var Placeholder$1=React$2.memo(Placeholder);class AnimateInOut extends React$2.PureComponent{constructor(...oe){super(...oe),this.state={isVisible:!!this.props.on,data:this.props.on,animate:this.props.shouldAnimate&&this.props.on?"open":"none"},this.onClose=()=>{this.state.animate==="close"&&this.setState({isVisible:!1})}}static getDerivedStateFromProps(oe,ce){return oe.shouldAnimate?oe.on?{isVisible:!0,data:oe.on,animate:"open"}:ce.isVisible?{isVisible:!0,data:ce.data,animate:"close"}:{isVisible:!1,animate:"close",data:null}:{isVisible:!!oe.on,data:oe.on,animate:"none"}}render(){if(!this.state.isVisible)return null;const oe={onClose:this.onClose,data:this.state.data,animate:this.state.animate};return this.props.children(oe)}}const Droppable=ne=>{const oe=reactExports.useContext(AppContext);oe||invariant(!1);const{contextId:ce,isMovementAllowed:ue}=oe,pe=reactExports.useRef(null),me=reactExports.useRef(null),{children:ge,droppableId:ye,type:ve,mode:xe,direction:_e,ignoreContainerClipping:Se,isDropDisabled:$e,isCombineEnabled:Re,snapshot:Ae,useClone:Ie,updateViewportMaxScroll:ke,getContainerForClone:Be}=ne,Ne=useCallback(()=>pe.current,[]),Fe=useCallback((Je=null)=>{pe.current=Je},[]);useCallback(()=>me.current,[]);const Ue=useCallback((Je=null)=>{me.current=Je},[]),We=useCallback(()=>{ue()&&ke({maxScroll:getMaxWindowScroll()})},[ue,ke]);useDroppablePublisher({droppableId:ye,type:ve,mode:xe,direction:_e,isDropDisabled:$e,isCombineEnabled:Re,ignoreContainerClipping:Se,getDroppableRef:Ne});const qe=useMemo(()=>React$2.createElement(AnimateInOut,{on:ne.placeholder,shouldAnimate:ne.shouldAnimatePlaceholder},({onClose:Je,data:Ut,animate:jt})=>React$2.createElement(Placeholder$1,{placeholder:Ut,onClose:Je,innerRef:Ue,animate:jt,contextId:ce,onTransitionEnd:We})),[ce,We,ne.placeholder,ne.shouldAnimatePlaceholder,Ue]),ze=useMemo(()=>({innerRef:Fe,placeholder:qe,droppableProps:{"data-rfd-droppable-id":ye,"data-rfd-droppable-context-id":ce}}),[ce,ye,qe,Fe]),Ge=Ie?Ie.dragging.draggableId:null,Ze=useMemo(()=>({droppableId:ye,type:ve,isUsingCloneFor:Ge}),[ye,Ge,ve]);function Dt(){if(!Ie)return null;const{dragging:Je,render:Ut}=Ie,jt=React$2.createElement(PrivateDraggable,{draggableId:Je.draggableId,index:Je.source.index,isClone:!0,isEnabled:!0,shouldRespectForcePress:!1,canDragInteractiveElements:!0},(Ke,an)=>Ut(Ke,an,Je));return ReactDOM$1.createPortal(jt,Be())}return React$2.createElement(DroppableContext.Provider,{value:Ze},ge(ze,Ae),Dt())};var Droppable$1=Droppable;function getBody(){return document.body||invariant(!1),document.body}const defaultProps={mode:"standard",type:"DEFAULT",direction:"vertical",isDropDisabled:!1,isCombineEnabled:!1,ignoreContainerClipping:!1,renderClone:null,getContainerForClone:getBody},attachDefaultPropsToOwnProps=ne=>{let oe={...ne},ce;for(ce in defaultProps)ne[ce]===void 0&&(oe={...oe,[ce]:defaultProps[ce]});return oe},isMatchingType=(ne,oe)=>ne===oe.droppable.type,getDraggable=(ne,oe)=>oe.draggables[ne.draggable.id],makeMapStateToProps=()=>{const ne={placeholder:null,shouldAnimatePlaceholder:!0,snapshot:{isDraggingOver:!1,draggingOverWith:null,draggingFromThisWith:null,isUsingPlaceholder:!1},useClone:null},oe={...ne,shouldAnimatePlaceholder:!1},ce=memoizeOne(me=>({draggableId:me.id,type:me.type,source:{index:me.index,droppableId:me.droppableId}})),ue=memoizeOne((me,ge,ye,ve,xe,_e)=>{const Se=xe.descriptor.id;if(xe.descriptor.droppableId===me){const Ae=_e?{render:_e,dragging:ce(xe.descriptor)}:null,Ie={isDraggingOver:ye,draggingOverWith:ye?Se:null,draggingFromThisWith:Se,isUsingPlaceholder:!0};return{placeholder:xe.placeholder,shouldAnimatePlaceholder:!1,snapshot:Ie,useClone:Ae}}if(!ge)return oe;if(!ve)return ne;const Re={isDraggingOver:ye,draggingOverWith:Se,draggingFromThisWith:null,isUsingPlaceholder:!0};return{placeholder:xe.placeholder,shouldAnimatePlaceholder:!0,snapshot:Re,useClone:null}});return(me,ge)=>{const ye=attachDefaultPropsToOwnProps(ge),ve=ye.droppableId,xe=ye.type,_e=!ye.isDropDisabled,Se=ye.renderClone;if(isDragging(me)){const $e=me.critical;if(!isMatchingType(xe,$e))return oe;const Re=getDraggable($e,me.dimensions),Ae=whatIsDraggedOver(me.impact)===ve;return ue(ve,_e,Ae,Ae,Re,Se)}if(me.phase==="DROP_ANIMATING"){const $e=me.completed;if(!isMatchingType(xe,$e.critical))return oe;const Re=getDraggable($e.critical,me.dimensions);return ue(ve,_e,whatIsDraggedOverFromResult($e.result)===ve,whatIsDraggedOver($e.impact)===ve,Re,Se)}if(me.phase==="IDLE"&&me.completed&&!me.shouldFlush){const $e=me.completed;if(!isMatchingType(xe,$e.critical))return oe;const Re=whatIsDraggedOver($e.impact)===ve,Ae=!!($e.impact.at&&$e.impact.at.type==="COMBINE"),Ie=$e.critical.droppable.id===ve;return Re?Ae?ne:oe:Ie?ne:oe}return oe}},mapDispatchToProps={updateViewportMaxScroll},ConnectedDroppable=connect$1(makeMapStateToProps,mapDispatchToProps,(ne,oe,ce)=>({...attachDefaultPropsToOwnProps(ce),...ne,...oe}),{context:StoreContext,areStatePropsEqual:isStrictEqual})(Droppable$1);var ConnectedDroppable$1=ConnectedDroppable;const DefaultListEditorInput=reactExports.forwardRef(function({onValueChange:oe,...ce},ue){return jsxRuntimeExports.jsx(InputBase$1,{fullWidth:!0,...ce,placeholder:"Untitled item",inputRef:ue})});function useInitialRender(){const ne=reactExports.useRef(!1),oe=ne.current;return ne.current=!0,!oe}const defaultEditorRenderer=({handle:ne,content:oe,extras:ce})=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[ne,oe,ce]});function ListEditorField({toggleable:ne,deletable:oe,editable:ce=!0,onChangeItem:ue=()=>{},onDeleteItem:pe=()=>{},extras:me,enabled:ge=!1,editor:ye=jsxRuntimeExports.jsx(DefaultListEditorInput,{}),value:ve,id:xe,i:_e=0,autoFocus:Se,sortable:$e,button:Re=!0,renderEditor:Ae=defaultEditorRenderer}){const Ie=useAcrylic(),ke=usePaper(),[Be,Ne]=reactExports.useState(null),Fe=Re?ButtonBase$1:Box$1;return jsxRuntimeExports.jsx(PublicDraggable,{index:_e,draggableId:`${xe}`,children:(Ue,We)=>jsxRuntimeExports.jsx("div",{ref:Ue.innerRef,...Ue.draggableProps,children:jsxRuntimeExports.jsx(Stack$1,{direction:"row",alignItems:"center",sx:{...Re?{transition:qe=>qe.transitions.create("background"),"&:hover":{background:qe=>qe.palette.action.hover}}:void 0,...We.isDragging?{...ke(1),...Ie}:void 0},children:Ae==null?void 0:Ae({value:ve,onValueChange:qe=>ue(xe??_e,qe,ge),handle:$e&&jsxRuntimeExports.jsx(Flex,{...Ue.dragHandleProps,color:"text.secondary",sx:{flex:0,p:2},children:jsxRuntimeExports.jsx(DragHandleOutlined,{})}),content:jsxRuntimeExports.jsx(Fe,{sx:{flex:1,display:"block",textAlign:"left",px:2},children:reactExports.cloneElement(ye,{onDelete:()=>pe(xe??_e),autoFocus:Se,value:ve,key:xe??_e,onValueChange:qe=>ue(xe??_e,qe,ge),onChange:qe=>ue(xe??_e,qe.target.value,ge),ref:qe=>Ne(qe)})}),extras:jsxRuntimeExports.jsxs(Flex,{sx:{flex:0,px:1},children:[ne&&jsxRuntimeExports.jsx(Switch$2,{color:"primary",edge:"end",onChange:(qe,ze)=>ue(xe??_e,ve,ze),checked:ge}),ce&&jsxRuntimeExports.jsx(IconButton$1,{edge:"end",onClick:()=>{Be!=null&&Be.focus&&Be.focus()},children:jsxRuntimeExports.jsx(EditIcon,{})}),oe&&jsxRuntimeExports.jsx(IconButton$1,{onClick:()=>pe(xe??_e),sx:{color:qe=>qe.palette.text.secondary},children:jsxRuntimeExports.jsx(DeleteIcon,{})}),me&&me(ve)]})})})})})}function reorder(ne,oe,ce){const ue=Array.from(ne),[pe]=ue.splice(oe,1);return ue.splice(ce,0,pe),ue}function Editor(ne){const{addItemLabel:oe="Add Item",UNSAFE_label:ce,UNSAFE_text:ue,onAddItem:pe=()=>{},onDeleteItem:me=()=>{},items:ge=[],placeholder:ye,autoFocus:ve,category:xe,order:_e,onChange:Se,addItemExtras:$e,addable:Re=!0}=ne,Ae=usePaper(),Ie=useInitialRender(),ke=useTheme$1(),[Be,Ne]=reactExports.useState(ge),[Fe,Ue]=reactExports.useState(-1);reactExports.useEffect(()=>{const Ge=setTimeout(()=>{Ne(ge)},ke.transitions.duration.standard);return()=>{clearTimeout(Ge)}},[ge,Ne,ke.transitions.duration.standard]);const We=lodashExports$1.uniqBy([...Be,...ge],Ge=>Ge.id).map(Ge=>ge.find(Ze=>Ge.id===Ze.id)??Ge).map((Ge,Ze)=>{const{enabled:Dt,editor:Je,value:Ut,id:jt}=Ge??{};return{value:Ut,render:Ke=>jsxRuntimeExports.jsx(Collapse$1,{in:!!ge.find(an=>an.id===Ge.id),unmountOnExit:!0,appear:!Ie,mountOnEnter:!0,children:jsxRuntimeExports.jsx(ListEditorField,{...ne,onDeleteItem:an=>{me(an),Ue(-1)},enabled:Dt,editor:Je,value:Ut,id:jt,i:Ze,autoFocus:ve||Ze===Fe,...Ke})}),key:jt,in:!!ge.find(Ke=>Ke.id===Ge.id)}}),qe=lodashExports$1.sortBy(We,Ge=>xe==null?void 0:xe(Ge.value),Ge=>_e==null?void 0:_e(Ge.value)).map(Ge=>({...Ge,render:Ze=>jsxRuntimeExports.jsx(Box$1,{children:Ge.render(Ze)},Ge.key)}));return jsxRuntimeExports.jsx(DragDropContext,{onDragEnd:Ge=>{if(!Ge.destination)return;const Ze=reorder(ge,Ge.source.index,Ge.destination.index);Se==null||Se(Ze),Ne(Ze)},children:jsxRuntimeExports.jsxs(List$2,{subheader:ce||ue?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs(ListSubheader$1,{disableSticky:!0,children:[ce&&jsxRuntimeExports.jsx(Type$2,{component:"div",variant:"body1",gutterBottom:!0,color:"textPrimary",children:ce}),ue&&jsxRuntimeExports.jsx(Type$2,{component:"div",variant:"body2",color:"text.secondary",gutterBottom:!0,style:{marginBottom:ke.spacing(3)},children:ue})]})}):void 0,children:[jsxRuntimeExports.jsx(Box$1,{mt:xe?-1:0,children:jsxRuntimeExports.jsx(ConnectedDroppable$1,{droppableId:"list",isDropDisabled:!1,isCombineEnabled:!1,ignoreContainerClipping:!0,children:Ge=>jsxRuntimeExports.jsxs("div",{...Ge.droppableProps,ref:Ge.innerRef,children:[(()=>{const Ze=[];return qe.forEach((Dt,Je)=>{xe&&ze(qe,Je,Dt)&&Ze.push(jsxRuntimeExports.jsx(Collapse$1,{in:ge.some(Ut=>xe(Ut.value)===xe(Dt.value)),appear:!0,children:jsxRuntimeExports.jsx(Box$1,{pl:2,pb:2,pt:1,children:jsxRuntimeExports.jsx(Type$2,{component:"div",variant:"overline",color:"text.secondary",children:xe(Dt.value)})})},xe(Dt.value))),Ze.push(Dt.render())}),Ze})(),Ge.placeholder]})})}),jsxRuntimeExports.jsx(Collapse$1,{in:!(ge!=null&&ge.length),children:jsxRuntimeExports.jsx(Box$1,{ml:2,mb:1,pt:xe?1:0,children:jsxRuntimeExports.jsx(Type$2,{component:"div",color:"text.secondary",children:ye??"No items"})})}),jsxRuntimeExports.jsxs(Stack$1,{p:2,pt:2,gap:2,direction:"row",children:[Re&&jsxRuntimeExports.jsx(MuiButton,{disableElevation:!0,variant:"outlined",startIcon:jsxRuntimeExports.jsx(Add,{}),onClick:()=>{pe(),Ue(ge.length)},sx:{...Ae(1)},children:jsxRuntimeExports.jsx(Box$1,{sx:{color:"text.primary",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},children:oe})}),$e]})]})});function ze(Ge,Ze,Dt){return!!(xe&&(Ge[Ze-1]===void 0||xe(Ge[Ze-1].value)!==xe(Dt.value)))}}function ListEditor({onChange:ne,value:oe,editor:ce,create:ue,onFocus:pe,...me}){const[ge,ye]=reactExports.useState(oe??[]);function ve(xe){ye(xe),ne==null||ne(xe)}return reactExports.useEffect(()=>{ye(oe??[])},[oe]),jsxRuntimeExports.jsx(Box$1,{children:jsxRuntimeExports.jsx(Editor,{deletable:!0,editable:!1,...me,items:ge.map(xe=>({id:xe.key,value:xe,editor:ce==null?void 0:ce(xe)})),onAddItem:()=>{const xe=nanoid$1();ve==null||ve([...ge,{key:xe,...ue==null?void 0:ue()}]),lodashExports$1.defer(()=>pe==null?void 0:pe(xe))},onDeleteItem:xe=>ve==null?void 0:ve(lodashExports$1.filter(ge,_e=>_e.key!==xe)),onChangeItem:(xe,_e)=>ve==null?void 0:ve(lodashExports$1.map(ge,Se=>Se.key===xe?_e:Se)),onChange:xe=>ve==null?void 0:ve(lodashExports$1.map(xe,_e=>_e.value))})})}const comparators=[{key:"equal",apply:({value:ne,reference:oe})=>ne===oe,needsReference:!0},{key:"less-than",apply:({value:ne,reference:oe})=>nene>oe,needsReference:!0},{key:"changed",apply:({value:ne,property:oe,step:ce,node:ue})=>{if(ue.parent){const pe=lodashExports$1.findLast(ue.parent.events,me=>me.step({value:ye,label:lodashExports$1.startCase(ye)})),onChange:ye=>ue({type:ye==="any"?void 0:ye}),value:ne.type??"any"}),jsxRuntimeExports.jsx(Divider$1,{flexItem:!0,orientation:"vertical",sx:{mx:2}}),jsxRuntimeExports.jsx(SelectField,{placeholder:"Property",sx:{minWidth:140,textOverflow:"ellipsis",whiteSpace:"nowrap"},items:lodashExports$1.map(ce,ye=>({value:ye,label:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[lodashExports$1.last(ye.split(".")),jsxRuntimeExports.jsx(Space,{}),jsxRuntimeExports.jsx(Type$2,{color:"text.secondary",variant:"body2",component:"span",children:`$.${ye}`})]})})),onChange:ye=>ue({property:ye}),value:ne.property}),jsxRuntimeExports.jsx(Space,{}),jsxRuntimeExports.jsx(SelectField,{placeholder:"Condition",items:comparators.map(ye=>({value:ye.key,label:lodashExports$1.startCase(ye.key)})),value:((pe=ne.condition)==null?void 0:pe.key)??((me=comparators==null?void 0:comparators[0])==null?void 0:me.key),onChange:ye=>ue({condition:lodashExports$1.find(comparators,{key:ye})})}),jsxRuntimeExports.jsx(Space,{}),jsxRuntimeExports.jsx(TextField$1,{label:"Reference",fullWidth:!0,defaultValue:`${ne.reference??0}`,variant:"filled",inputProps:{inputMode:"numeric",pattern:"[0-9]*"},onChange:ye=>ue({reference:+ye.target.value}),type:"number",disabled:!((ge=ne.condition)!=null&&ge.needsReference)}),jsxRuntimeExports.jsx(Space,{sx:{px:2}}),jsxRuntimeExports.jsx(Switch,{checked:!!ne.active,onChange:(ye,ve)=>ue({active:ve}),sx:{mr:-4}})]})}function BreakpointListEditor({layer:ne}){var ge,ye,ve;const{layer:oe,setLayer:ce}=useLayer(ne),{breakpoints:ue}=(oe==null?void 0:oe.source)??{};function pe(xe){oe&&ce(produce(oe,_e=>lodashExports$1.set(_e,"source.breakpoints",xe)))}const me=reactExports.useMemo(()=>{var xe,_e,Se;return lodashExports$1.chain((Se=(_e=(xe=oe==null?void 0:oe.source)==null?void 0:xe.trace)==null?void 0:_e.content)==null?void 0:Se.events).flatMap(lodashExports$1.keys).uniq().filter($e=>$e!=="type").value()},[(ve=(ye=(ge=oe==null?void 0:oe.source)==null?void 0:ge.trace)==null?void 0:ye.content)==null?void 0:ve.events]);return jsxRuntimeExports.jsx(Box$1,{sx:{overflow:"auto hidden",width:"100%"},children:jsxRuntimeExports.jsx(Scroll,{x:!0,children:jsxRuntimeExports.jsx(Box$1,{sx:{minWidth:720,mb:2},children:jsxRuntimeExports.jsx(ListEditor,{sortable:!0,button:!1,icon:null,value:ue,deletable:!0,editable:!1,editor:xe=>jsxRuntimeExports.jsx(BreakpointEditor,{value:xe,properties:me}),create:()=>({active:!0,property:me==null?void 0:me[0],condition:comparators==null?void 0:comparators[0],type:void 0,reference:0}),onChange:xe=>pe(xe),addItemLabel:"Breakpoint",placeholder:"Get started by adding a breakpoint."})})})})}const stepsLayerGuard$1=ne=>!!getController(ne).steps,divider$3=jsxRuntimeExports.jsx(Divider$1,{orientation:"vertical",flexItem:!0,sx:{m:1,height:ne=>ne.spacing(3),alignSelf:"auto"}});function DebugPage({template:ne}){const{controls:oe,onChange:ce,state:ue,dragHandle:pe}=useViewTreeContext(),[me,ge]=reactExports.useState("standard"),{key:ye,setKey:ve,layers:xe,layer:_e,setLayer:Se,allLayers:$e}=useLayer(void 0,stepsLayerGuard$1),{code:Re}=(_e==null?void 0:_e.source)??{};function Ae(Ie){return jsxRuntimeExports.jsx(Type$2,{component:"div",variant:"overline",color:"text.secondary",children:Ie})}return jsxRuntimeExports.jsx(TabContext,{value:me,children:jsxRuntimeExports.jsxs(ne,{onChange:ce,stack:ue,children:[jsxRuntimeExports.jsx(ne.Key,{children:"debug"}),jsxRuntimeExports.jsx(ne.Title,{children:"Debugger"}),jsxRuntimeExports.jsx(ne.Handle,{children:pe}),jsxRuntimeExports.jsxs(ne.Options,{children:[jsxRuntimeExports.jsx(FeaturePicker,{icon:jsxRuntimeExports.jsx(LayersIcon,{}),label:"Layer",value:ye,items:lodashExports$1.map($e,Ie=>({id:Ie.key,hidden:!lodashExports$1.find(xe,{key:Ie.key}),name:inferLayerName(Ie)})),onChange:ve,arrow:!0,ellipsis:12}),divider$3,jsxRuntimeExports.jsxs(TabList$1,{onChange:(Ie,ke)=>ge(ke),children:[jsxRuntimeExports.jsx(Tab$1,{label:"Standard",value:"standard",disabled:!_e}),jsxRuntimeExports.jsx(Tab$1,{label:"Advanced",value:"advanced",disabled:!_e})]})]}),jsxRuntimeExports.jsx(ne.Content,{children:_e?jsxRuntimeExports.jsx(Scroll,{y:!0,children:jsxRuntimeExports.jsxs(Box$1,{pt:6,height:"100%",children:[jsxRuntimeExports.jsx(TabPanel$1,{value:"standard",sx:{p:2},children:jsxRuntimeExports.jsxs(Box$1,{mx:-2,children:[jsxRuntimeExports.jsx(Box$1,{px:2,children:Ae("Breakpoints")}),jsxRuntimeExports.jsx(BreakpointListEditor,{layer:_e==null?void 0:_e.key})]})}),jsxRuntimeExports.jsx(TabPanel$1,{value:"advanced",sx:{p:0,height:"100%"},children:jsxRuntimeExports.jsx(ScriptEditor,{code:Re??makeTemplate(lodashExports$1.values(templates)),onChange:Ie=>_e&&Se(produce(_e,ke=>lodashExports$1.set(ke,"source.code",Ie)))})})]})}):jsxRuntimeExports.jsx(Placeholder$2,{icon:jsxRuntimeExports.jsx(DebuggerIcon,{}),label:"Debugger",secondary:"Configure breakpoints and other debugging options here. First, you'll need to load a trace."})}),jsxRuntimeExports.jsx(ne.Extras,{children:oe})]})})}const scriptRel="modulepreload",assetsURL=function(ne,oe){return new URL(ne,oe).href},seen={},__vitePreload=function(oe,ce,ue){if(!ce||ce.length===0)return oe();const pe=document.getElementsByTagName("link");return Promise.all(ce.map(me=>{if(me=assetsURL(me,ue),me in seen)return;seen[me]=!0;const ge=me.endsWith(".css"),ye=ge?'[rel="stylesheet"]':"";if(!!ue)for(let _e=pe.length-1;_e>=0;_e--){const Se=pe[_e];if(Se.href===me&&(!ge||Se.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${me}"]${ye}`))return;const xe=document.createElement("link");if(xe.rel=ge?"stylesheet":scriptRel,ge||(xe.as="script",xe.crossOrigin=""),xe.href=me,document.head.appendChild(xe),ge)return new Promise((_e,Se)=>{xe.addEventListener("load",_e),xe.addEventListener("error",()=>Se(new Error(`Unable to preload CSS for ${me}`)))})})).then(()=>oe()).catch(me=>{const ge=new Event("vite:preloadError",{cancelable:!0});if(ge.payload=me,window.dispatchEvent(ge),!ge.defaultPrevented)throw me})},EXCLUDED_NAMES=["PropTypes"],getSlotProps=(ne,oe)=>reactExports.Children.toArray(ne).reduce((ce,ue)=>{if(reactExports.isValidElement(ue)){const pe=ue.type.displayName;ce[pe]=ue.props}return ce},{}),getCleanChildren=(ne,oe)=>{const ce=reactExports.Children.toArray(ne).filter(ue=>{if(reactExports.isValidElement(ue)){const pe=ue.type.displayName;return!(oe!=null&&oe.includes(pe))}return!0});return ce.length>0?ce:void 0},isComponentName=ne=>typeof ne=="string"&&!EXCLUDED_NAMES.includes(ne)&&ne.match(/^[A-Z0-9]/),createResultComponent=ne=>reactExports.memo(ce=>{const{children:ue,propagateSlotProps:pe,slotKeys:me=[],...ge}=ce,ye=reactExports.useMemo(()=>getSlotProps(ue),[me,ue]),ve=reactExports.useMemo(()=>getCleanChildren(ue,me),[me,ue]),xe=reactExports.useMemo(()=>({...ge,slotProps:{...pe,...ye}}),[ge,ye,pe]);return reactExports.createElement(ne,xe,ve)}),withSlots=ne=>{const oe=reactExports.memo(createResultComponent(ne));return oe.displayName=`WithSlots(${ne.displayName||ne.name})`,new Proxy(oe,{get(ue,pe,me){var ve;if(pe in ue||typeof pe=="symbol"||!isComponentName(pe))return Reflect.get(ue,pe,me);const ge=((ve=Reflect.get(ue,"defaultProps"))==null?void 0:ve.slotKeys)||[];if(!Reflect.get(ue,pe)){const xe=()=>null;xe.displayName=pe,Reflect.set(ue,pe,xe)}return Reflect.set(ue,"defaultProps",{...ue.defaultProps,slotKeys:[...ge,pe]}),Reflect.get(ue,pe,me)}})};function wait(ne){return new Promise(oe=>lodashExports$1.delay(oe,ne))}async function timed(ne,oe=2500){const ce=lodashExports$1.now();return{result:await Promise.any([ne(),wait(oe)]),delta:lodashExports$1.now()-ce}}const FullscreenModalContext=reactExports.createContext({});function useFullscreenModalContext(){return reactExports.useContext(FullscreenModalContext)}const FullscreenPage=withSlots(({slotProps:ne})=>{var ue,pe,me,ge;const oe=useSmallDisplay(),ce=useAcrylic();return jsxRuntimeExports.jsxs(Stack$1,{sx:{height:oe?"calc(100% - 56px)":"100%",minHeight:"70vh"},children:[!!((ue=ne.Options)!=null&&ue.children)&&jsxRuntimeExports.jsx(Stack$1,{sx:{minHeight:ye=>ye.spacing(6),flex:0},children:jsxRuntimeExports.jsxs(Stack$1,{direction:"row",sx:{p:0,zIndex:1,width:"100%",borderBottom:1,borderColor:"divider",alignItems:"center",pr:oe?0:6,...ce,background:ye=>`linear-gradient(to bottom, ${ye.palette.background.paper}, ${alpha$1(ye.palette.background.paper,.75)})`},children:[jsxRuntimeExports.jsx(Scroll,{x:!0,children:jsxRuntimeExports.jsx(Flex,{sx:{width:"max-content",height:ye=>ye.spacing(6),alignItems:"center",p:1},children:((pe=ne.Options)==null?void 0:pe.children)&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:ne.Options.children})})}),(me=ne.Extras)==null?void 0:me.children]})}),jsxRuntimeExports.jsx(Box$1,{sx:{bgcolor:"background.paper",mt:-6,flex:1,position:"relative"},children:jsxRuntimeExports.jsx(Scroll,{y:!0,style:{height:"100%",position:"absolute"},children:(ge=ne.Content)==null?void 0:ge.children})})]})});function FullscreenModalHost(){const[{fullscreenModal:ne},oe]=useUIState(),[ce,ue]=reactExports.useState(!1),pe=reactExports.useCallback(async function(){ue(!0),await wait(300),oe(()=>({fullscreenModal:void 0})),ue(!1)},[oe]),me=reactExports.useMemo(()=>({close:pe}),[pe]),ge=ne?pages[ne]:void 0,ye=reactExports.useMemo(()=>{if(ge){const ve=ge.content,xe=withSlots(({slotProps:_e,...Se})=>{var $e,Re,Ae;return jsxRuntimeExports.jsxs(FullscreenPage,{...Se,children:[jsxRuntimeExports.jsx(FullscreenPage.Content,{children:($e=_e.Content)==null?void 0:$e.children}),jsxRuntimeExports.jsx(FullscreenPage.Options,{children:(Re=_e.Options)==null?void 0:Re.children}),jsxRuntimeExports.jsx(FullscreenPage.Extras,{children:(Ae=_e.Extras)==null?void 0:Ae.children})]})});return jsxRuntimeExports.jsx(ve,{template:xe})}},[ne,ge]);return jsxRuntimeExports.jsx(FullscreenModalContext.Provider,{value:me,children:!!ge&&jsxRuntimeExports.jsxs(Modal,{open:!ce,onClose:pe,width:"70vw",children:[jsxRuntimeExports.jsx(ModalAppBar,{onClose:pe,children:jsxRuntimeExports.jsx(Type$2,{component:"div",variant:"h6",children:ge.name})}),ye]})})}var download$1={exports:{}};(function(ne,oe){(function(ce,ue){ne.exports=ue()})(commonjsGlobal,function(){return function ce(ue,pe,me){var ge=window,ye="application/octet-stream",ve=me||ye,xe=ue,_e=!pe&&!me&&xe,Se=document.createElement("a"),$e=function(ze){return String(ze)},Re=ge.Blob||ge.MozBlob||ge.WebKitBlob||$e,Ae=pe||"download",Ie,ke;if(Re=Re.call?Re.bind(ge):Blob,String(this)==="true"&&(xe=[xe,ve],ve=xe[0],xe=xe[1]),_e&&_e.length<2048&&(Ae=_e.split("/").pop().split("?")[0],Se.href=_e,Se.href.indexOf(_e)!==-1)){var Be=new XMLHttpRequest;return Be.open("GET",_e,!0),Be.responseType="blob",Be.onload=function(ze){ce(ze.target.response,Ae,ye)},setTimeout(function(){Be.send()},0),Be}if(/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(xe))if(xe.length>1024*1024*1.999&&Re!==$e)xe=We(xe),ve=xe.type||ye;else return navigator.msSaveBlob?navigator.msSaveBlob(We(xe),Ae):qe(xe);else if(/([\x80-\xff])/.test(xe)){var Ne=0,Fe=new Uint8Array(xe.length),Ue=Fe.length;for(Ne;Ne{const ne=document.querySelector("head");return ne||invariant(!1),ne},createStyleEl=ne=>{const oe=document.createElement("style");return ne&&oe.setAttribute("nonce",ne),oe.type="text/css",oe};function useStyleMarshal(ne,oe){const ce=useMemo(()=>getStyles$1(ne),[ne]),ue=reactExports.useRef(null),pe=reactExports.useRef(null),me=useCallback(memoizeOne(Se=>{const $e=pe.current;$e||invariant(!1),$e.textContent=Se}),[]),ge=useCallback(Se=>{const $e=ue.current;$e||invariant(!1),$e.textContent=Se},[]);useLayoutEffect(()=>{!ue.current&&!pe.current||invariant(!1);const Se=createStyleEl(oe),$e=createStyleEl(oe);return ue.current=Se,pe.current=$e,Se.setAttribute(`${prefix$2}-always`,ne),$e.setAttribute(`${prefix$2}-dynamic`,ne),getHead().appendChild(Se),getHead().appendChild($e),ge(ce.always),me(ce.resting),()=>{const Re=Ae=>{const Ie=Ae.current;Ie||invariant(!1),getHead().removeChild(Ie),Ae.current=null};Re(ue),Re(pe)}},[oe,ge,me,ce.always,ce.resting,ne]);const ye=useCallback(()=>me(ce.dragging),[me,ce.dragging]),ve=useCallback(Se=>{if(Se==="DROP"){me(ce.dropAnimating);return}me(ce.userCancel)},[me,ce.dropAnimating,ce.userCancel]),xe=useCallback(()=>{pe.current&&me(ce.resting)},[me,ce.resting]);return useMemo(()=>({dragging:ye,dropping:ve,resting:xe}),[ye,ve,xe])}function querySelectorAll(ne,oe){return Array.from(ne.querySelectorAll(oe))}var getWindowFromEl=ne=>ne&&ne.ownerDocument&&ne.ownerDocument.defaultView?ne.ownerDocument.defaultView:window;function isHtmlElement(ne){return ne instanceof getWindowFromEl(ne).HTMLElement}function findDragHandle(ne,oe){const ce=`[${dragHandle.contextId}="${ne}"]`,ue=querySelectorAll(document,ce);if(!ue.length)return null;const pe=ue.find(me=>me.getAttribute(dragHandle.draggableId)===oe);return!pe||!isHtmlElement(pe)?null:pe}function useFocusMarshal(ne){const oe=reactExports.useRef({}),ce=reactExports.useRef(null),ue=reactExports.useRef(null),pe=reactExports.useRef(!1),me=useCallback(function($e,Re){const Ae={id:$e,focus:Re};return oe.current[$e]=Ae,function(){const ke=oe.current;ke[$e]!==Ae&&delete ke[$e]}},[]),ge=useCallback(function($e){const Re=findDragHandle(ne,$e);Re&&Re!==document.activeElement&&Re.focus()},[ne]),ye=useCallback(function($e,Re){ce.current===$e&&(ce.current=Re)},[]),ve=useCallback(function(){ue.current||pe.current&&(ue.current=requestAnimationFrame(()=>{ue.current=null;const $e=ce.current;$e&&ge($e)}))},[ge]),xe=useCallback(function($e){ce.current=null;const Re=document.activeElement;Re&&Re.getAttribute(dragHandle.draggableId)===$e&&(ce.current=$e)},[]);return useLayoutEffect(()=>(pe.current=!0,function(){pe.current=!1;const $e=ue.current;$e&&cancelAnimationFrame($e)}),[]),useMemo(()=>({register:me,tryRecordFocus:xe,tryRestoreFocusRecorded:ve,tryShiftRecord:ye}),[me,xe,ve,ye])}function createRegistry(){const ne={draggables:{},droppables:{}},oe=[];function ce(Se){return oe.push(Se),function(){const Re=oe.indexOf(Se);Re!==-1&&oe.splice(Re,1)}}function ue(Se){oe.length&&oe.forEach($e=>$e(Se))}function pe(Se){return ne.draggables[Se]||null}function me(Se){const $e=pe(Se);return $e||invariant(!1),$e}const ge={register:Se=>{ne.draggables[Se.descriptor.id]=Se,ue({type:"ADDITION",value:Se})},update:(Se,$e)=>{const Re=ne.draggables[$e.descriptor.id];Re&&Re.uniqueId===Se.uniqueId&&(delete ne.draggables[$e.descriptor.id],ne.draggables[Se.descriptor.id]=Se)},unregister:Se=>{const $e=Se.descriptor.id,Re=pe($e);Re&&Se.uniqueId===Re.uniqueId&&(delete ne.draggables[$e],ne.droppables[Se.descriptor.droppableId]&&ue({type:"REMOVAL",value:Se}))},getById:me,findById:pe,exists:Se=>!!pe(Se),getAllByType:Se=>Object.values(ne.draggables).filter($e=>$e.descriptor.type===Se)};function ye(Se){return ne.droppables[Se]||null}function ve(Se){const $e=ye(Se);return $e||invariant(!1),$e}const xe={register:Se=>{ne.droppables[Se.descriptor.id]=Se},unregister:Se=>{const $e=ye(Se.descriptor.id);$e&&Se.uniqueId===$e.uniqueId&&delete ne.droppables[Se.descriptor.id]},getById:ve,findById:ye,exists:Se=>!!ye(Se),getAllByType:Se=>Object.values(ne.droppables).filter($e=>$e.descriptor.type===Se)};function _e(){ne.draggables={},ne.droppables={},oe.length=0}return{draggable:ge,droppable:xe,subscribe:ce,clean:_e}}function useRegistry(){const ne=useMemo(createRegistry,[]);return reactExports.useEffect(()=>function(){React$2.version.startsWith("16")||React$2.version.startsWith("17")?requestAnimationFrame(ne.clean):ne.clean()},[ne]),ne}var StoreContext=React$2.createContext(null),getBodyElement=()=>{const ne=document.body;return ne||invariant(!1),ne};const visuallyHidden={position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)","clip-path":"inset(100%)"};var visuallyHidden$1=visuallyHidden;const getId=ne=>`rfd-announcement-${ne}`;function useAnnouncer(ne){const oe=useMemo(()=>getId(ne),[ne]),ce=reactExports.useRef(null);return reactExports.useEffect(function(){const me=document.createElement("div");return ce.current=me,me.id=oe,me.setAttribute("aria-live","assertive"),me.setAttribute("aria-atomic","true"),_extends$2(me.style,visuallyHidden$1),getBodyElement().appendChild(me),function(){setTimeout(function(){const ve=getBodyElement();ve.contains(me)&&ve.removeChild(me),me===ce.current&&(ce.current=null)})}},[oe]),useCallback(pe=>{const me=ce.current;if(me){me.textContent=pe;return}},[])}let count$1=0;const defaults$2={separator:"::"};function useDeprecatedUniqueId(ne,oe=defaults$2){return useMemo(()=>`${ne}${oe.separator}${count$1++}`,[oe.separator,ne])}function useUniqueId(ne,oe=defaults$2){const ce=React$2.useId();return useMemo(()=>`${ne}${oe.separator}${ce}`,[oe.separator,ne,ce])}var useUniqueId$1="useId"in React$2?useUniqueId:useDeprecatedUniqueId;function getElementId({contextId:ne,uniqueId:oe}){return`rfd-hidden-text-${ne}-${oe}`}function useHiddenTextElement({contextId:ne,text:oe}){const ce=useUniqueId$1("hidden-text",{separator:"-"}),ue=useMemo(()=>getElementId({contextId:ne,uniqueId:ce}),[ce,ne]);return reactExports.useEffect(function(){const me=document.createElement("div");return me.id=ue,me.textContent=oe,me.style.display="none",getBodyElement().appendChild(me),function(){const ye=getBodyElement();ye.contains(me)&&ye.removeChild(me)}},[ue,oe]),ue}var AppContext=React$2.createContext(null);function usePrevious(ne){const oe=reactExports.useRef(ne);return reactExports.useEffect(()=>{oe.current=ne}),oe}function create$1(){let ne=null;function oe(){return!!ne}function ce(ge){return ge===ne}function ue(ge){ne&&invariant(!1);const ye={abandon:ge};return ne=ye,ye}function pe(){ne||invariant(!1),ne=null}function me(){ne&&(ne.abandon(),pe())}return{isClaimed:oe,isActive:ce,claim:ue,release:pe,tryAbandon:me}}function isDragging(ne){return ne.phase==="IDLE"||ne.phase==="DROP_ANIMATING"?!1:ne.isDragging}const tab=9,enter=13,escape$1=27,space=32,pageUp=33,pageDown=34,end=35,home=36,arrowLeft=37,arrowUp=38,arrowRight=39,arrowDown=40,preventedKeys={[enter]:!0,[tab]:!0};var preventStandardKeyEvents=ne=>{preventedKeys[ne.keyCode]&&ne.preventDefault()};const supportedEventName=(()=>{const ne="visibilitychange";return typeof document>"u"?ne:[ne,`ms${ne}`,`webkit${ne}`,`moz${ne}`,`o${ne}`].find(ue=>`on${ue}`in document)||ne})();var supportedPageVisibilityEventName=supportedEventName;const primaryButton=0,sloppyClickThreshold=5;function isSloppyClickThresholdExceeded(ne,oe){return Math.abs(oe.x-ne.x)>=sloppyClickThreshold||Math.abs(oe.y-ne.y)>=sloppyClickThreshold}const idle$1={type:"IDLE"};function getCaptureBindings({cancel:ne,completed:oe,getPhase:ce,setPhase:ue}){return[{eventName:"mousemove",fn:pe=>{const{button:me,clientX:ge,clientY:ye}=pe;if(me!==primaryButton)return;const ve={x:ge,y:ye},xe=ce();if(xe.type==="DRAGGING"){pe.preventDefault(),xe.actions.move(ve);return}xe.type!=="PENDING"&&invariant(!1);const _e=xe.point;if(!isSloppyClickThresholdExceeded(_e,ve))return;pe.preventDefault();const Se=xe.actions.fluidLift(ve);ue({type:"DRAGGING",actions:Se})}},{eventName:"mouseup",fn:pe=>{const me=ce();if(me.type!=="DRAGGING"){ne();return}pe.preventDefault(),me.actions.drop({shouldBlockNextClick:!0}),oe()}},{eventName:"mousedown",fn:pe=>{ce().type==="DRAGGING"&&pe.preventDefault(),ne()}},{eventName:"keydown",fn:pe=>{if(ce().type==="PENDING"){ne();return}if(pe.keyCode===escape$1){pe.preventDefault(),ne();return}preventStandardKeyEvents(pe)}},{eventName:"resize",fn:ne},{eventName:"scroll",options:{passive:!0,capture:!1},fn:()=>{ce().type==="PENDING"&&ne()}},{eventName:"webkitmouseforcedown",fn:pe=>{const me=ce();if(me.type==="IDLE"&&invariant(!1),me.actions.shouldRespectForcePress()){ne();return}pe.preventDefault()}},{eventName:supportedPageVisibilityEventName,fn:ne}]}function useMouseSensor(ne){const oe=reactExports.useRef(idle$1),ce=reactExports.useRef(noop$2$1),ue=useMemo(()=>({eventName:"mousedown",fn:function(Se){if(Se.defaultPrevented||Se.button!==primaryButton||Se.ctrlKey||Se.metaKey||Se.shiftKey||Se.altKey)return;const $e=ne.findClosestDraggableId(Se);if(!$e)return;const Re=ne.tryGetLock($e,ge,{sourceEvent:Se});if(!Re)return;Se.preventDefault();const Ae={x:Se.clientX,y:Se.clientY};ce.current(),xe(Re,Ae)}}),[ne]),pe=useMemo(()=>({eventName:"webkitmouseforcewillbegin",fn:_e=>{if(_e.defaultPrevented)return;const Se=ne.findClosestDraggableId(_e);if(!Se)return;const $e=ne.findOptionsForDraggable(Se);$e&&($e.shouldRespectForcePress||ne.canGetLock(Se)&&_e.preventDefault())}}),[ne]),me=useCallback(function(){const Se={passive:!1,capture:!0};ce.current=bindEvents(window,[pe,ue],Se)},[pe,ue]),ge=useCallback(()=>{oe.current.type!=="IDLE"&&(oe.current=idle$1,ce.current(),me())},[me]),ye=useCallback(()=>{const _e=oe.current;ge(),_e.type==="DRAGGING"&&_e.actions.cancel({shouldBlockNextClick:!0}),_e.type==="PENDING"&&_e.actions.abort()},[ge]),ve=useCallback(function(){const Se={capture:!0,passive:!1},$e=getCaptureBindings({cancel:ye,completed:ge,getPhase:()=>oe.current,setPhase:Re=>{oe.current=Re}});ce.current=bindEvents(window,$e,Se)},[ye,ge]),xe=useCallback(function(Se,$e){oe.current.type!=="IDLE"&&invariant(!1),oe.current={type:"PENDING",point:$e,actions:Se},ve()},[ve]);useLayoutEffect(function(){return me(),function(){ce.current()}},[me])}function noop$1$1(){}const scrollJumpKeys={[pageDown]:!0,[pageUp]:!0,[home]:!0,[end]:!0};function getDraggingBindings(ne,oe){function ce(){oe(),ne.cancel()}function ue(){oe(),ne.drop()}return[{eventName:"keydown",fn:pe=>{if(pe.keyCode===escape$1){pe.preventDefault(),ce();return}if(pe.keyCode===space){pe.preventDefault(),ue();return}if(pe.keyCode===arrowDown){pe.preventDefault(),ne.moveDown();return}if(pe.keyCode===arrowUp){pe.preventDefault(),ne.moveUp();return}if(pe.keyCode===arrowRight){pe.preventDefault(),ne.moveRight();return}if(pe.keyCode===arrowLeft){pe.preventDefault(),ne.moveLeft();return}if(scrollJumpKeys[pe.keyCode]){pe.preventDefault();return}preventStandardKeyEvents(pe)}},{eventName:"mousedown",fn:ce},{eventName:"mouseup",fn:ce},{eventName:"click",fn:ce},{eventName:"touchstart",fn:ce},{eventName:"resize",fn:ce},{eventName:"wheel",fn:ce,options:{passive:!0}},{eventName:supportedPageVisibilityEventName,fn:ce}]}function useKeyboardSensor(ne){const oe=reactExports.useRef(noop$1$1),ce=useMemo(()=>({eventName:"keydown",fn:function(me){if(me.defaultPrevented||me.keyCode!==space)return;const ge=ne.findClosestDraggableId(me);if(!ge)return;const ye=ne.tryGetLock(ge,_e,{sourceEvent:me});if(!ye)return;me.preventDefault();let ve=!0;const xe=ye.snapLift();oe.current();function _e(){ve||invariant(!1),ve=!1,oe.current(),ue()}oe.current=bindEvents(window,getDraggingBindings(xe,_e),{capture:!0,passive:!1})}}),[ne]),ue=useCallback(function(){const me={passive:!1,capture:!0};oe.current=bindEvents(window,[ce],me)},[ce]);useLayoutEffect(function(){return ue(),function(){oe.current()}},[ue])}const idle={type:"IDLE"},timeForLongPress=120,forcePressThreshold=.15;function getWindowBindings({cancel:ne,getPhase:oe}){return[{eventName:"orientationchange",fn:ne},{eventName:"resize",fn:ne},{eventName:"contextmenu",fn:ce=>{ce.preventDefault()}},{eventName:"keydown",fn:ce=>{if(oe().type!=="DRAGGING"){ne();return}ce.keyCode===escape$1&&ce.preventDefault(),ne()}},{eventName:supportedPageVisibilityEventName,fn:ne}]}function getHandleBindings({cancel:ne,completed:oe,getPhase:ce}){return[{eventName:"touchmove",options:{capture:!1},fn:ue=>{const pe=ce();if(pe.type!=="DRAGGING"){ne();return}pe.hasMoved=!0;const{clientX:me,clientY:ge}=ue.touches[0],ye={x:me,y:ge};ue.preventDefault(),pe.actions.move(ye)}},{eventName:"touchend",fn:ue=>{const pe=ce();if(pe.type!=="DRAGGING"){ne();return}ue.preventDefault(),pe.actions.drop({shouldBlockNextClick:!0}),oe()}},{eventName:"touchcancel",fn:ue=>{if(ce().type!=="DRAGGING"){ne();return}ue.preventDefault(),ne()}},{eventName:"touchforcechange",fn:ue=>{const pe=ce();pe.type==="IDLE"&&invariant(!1);const me=ue.touches[0];if(!me||!(me.force>=forcePressThreshold))return;const ye=pe.actions.shouldRespectForcePress();if(pe.type==="PENDING"){ye&&ne();return}if(ye){if(pe.hasMoved){ue.preventDefault();return}ne();return}ue.preventDefault()}},{eventName:supportedPageVisibilityEventName,fn:ne}]}function useTouchSensor(ne){const oe=reactExports.useRef(idle),ce=reactExports.useRef(noop$2$1),ue=useCallback(function(){return oe.current},[]),pe=useCallback(function(Re){oe.current=Re},[]),me=useMemo(()=>({eventName:"touchstart",fn:function(Re){if(Re.defaultPrevented)return;const Ae=ne.findClosestDraggableId(Re);if(!Ae)return;const Ie=ne.tryGetLock(Ae,ye,{sourceEvent:Re});if(!Ie)return;const ke=Re.touches[0],{clientX:Be,clientY:Ne}=ke,Fe={x:Be,y:Ne};ce.current(),Se(Ie,Fe)}}),[ne]),ge=useCallback(function(){const Re={capture:!0,passive:!1};ce.current=bindEvents(window,[me],Re)},[me]),ye=useCallback(()=>{const $e=oe.current;$e.type!=="IDLE"&&($e.type==="PENDING"&&clearTimeout($e.longPressTimerId),pe(idle),ce.current(),ge())},[ge,pe]),ve=useCallback(()=>{const $e=oe.current;ye(),$e.type==="DRAGGING"&&$e.actions.cancel({shouldBlockNextClick:!0}),$e.type==="PENDING"&&$e.actions.abort()},[ye]),xe=useCallback(function(){const Re={capture:!0,passive:!1},Ae={cancel:ve,completed:ye,getPhase:ue},Ie=bindEvents(window,getHandleBindings(Ae),Re),ke=bindEvents(window,getWindowBindings(Ae),Re);ce.current=function(){Ie(),ke()}},[ve,ue,ye]),_e=useCallback(function(){const Re=ue();Re.type!=="PENDING"&&invariant(!1);const Ae=Re.actions.fluidLift(Re.point);pe({type:"DRAGGING",actions:Ae,hasMoved:!1})},[ue,pe]),Se=useCallback(function(Re,Ae){ue().type!=="IDLE"&&invariant(!1);const Ie=setTimeout(_e,timeForLongPress);pe({type:"PENDING",point:Ae,actions:Re,longPressTimerId:Ie}),xe()},[xe,ue,pe,_e]);useLayoutEffect(function(){return ge(),function(){ce.current();const Ae=ue();Ae.type==="PENDING"&&(clearTimeout(Ae.longPressTimerId),pe(idle))}},[ue,ge,pe]),useLayoutEffect(function(){return bindEvents(window,[{eventName:"touchmove",fn:()=>{},options:{capture:!1,passive:!1}}])},[])}const interactiveTagNames=["input","button","textarea","select","option","optgroup","video","audio"];function isAnInteractiveElement(ne,oe){if(oe==null)return!1;if(interactiveTagNames.includes(oe.tagName.toLowerCase()))return!0;const ue=oe.getAttribute("contenteditable");return ue==="true"||ue===""?!0:oe===ne?!1:isAnInteractiveElement(ne,oe.parentElement)}function isEventInInteractiveElement(ne,oe){const ce=oe.target;return isHtmlElement(ce)?isAnInteractiveElement(ne,ce):!1}var getBorderBoxCenterPosition=ne=>getRect(ne.getBoundingClientRect()).center;function isElement$1(ne){return ne instanceof getWindowFromEl(ne).Element}const supportedMatchesName=(()=>{const ne="matches";return typeof document>"u"?ne:[ne,"msMatchesSelector","webkitMatchesSelector"].find(ue=>ue in Element.prototype)||ne})();function closestPonyfill(ne,oe){return ne==null?null:ne[supportedMatchesName](oe)?ne:closestPonyfill(ne.parentElement,oe)}function closest(ne,oe){return ne.closest?ne.closest(oe):closestPonyfill(ne,oe)}function getSelector(ne){return`[${dragHandle.contextId}="${ne}"]`}function findClosestDragHandleFromEvent(ne,oe){const ce=oe.target;if(!isElement$1(ce))return null;const ue=getSelector(ne),pe=closest(ce,ue);return!pe||!isHtmlElement(pe)?null:pe}function tryGetClosestDraggableIdFromEvent(ne,oe){const ce=findClosestDragHandleFromEvent(ne,oe);return ce?ce.getAttribute(dragHandle.draggableId):null}function findDraggable(ne,oe){const ce=`[${draggable.contextId}="${ne}"]`,pe=querySelectorAll(document,ce).find(me=>me.getAttribute(draggable.id)===oe);return!pe||!isHtmlElement(pe)?null:pe}function preventDefault(ne){ne.preventDefault()}function isActive({expected:ne,phase:oe,isLockActive:ce,shouldWarn:ue}){return!(!ce()||ne!==oe)}function canStart({lockAPI:ne,store:oe,registry:ce,draggableId:ue}){if(ne.isClaimed())return!1;const pe=ce.draggable.findById(ue);return!(!pe||!pe.options.isEnabled||!canStartDrag(oe.getState(),ue))}function tryStart({lockAPI:ne,contextId:oe,store:ce,registry:ue,draggableId:pe,forceSensorStop:me,sourceEvent:ge}){if(!canStart({lockAPI:ne,store:ce,registry:ue,draggableId:pe}))return null;const ve=ue.draggable.getById(pe),xe=findDraggable(oe,ve.descriptor.id);if(!xe||ge&&!ve.options.canDragInteractiveElements&&isEventInInteractiveElement(xe,ge))return null;const _e=ne.claim(me||noop$2$1);let Se="PRE_DRAG";function $e(){return ve.options.shouldRespectForcePress}function Re(){return ne.isActive(_e)}function Ae(We,qe){isActive({expected:We,phase:Se,isLockActive:Re,shouldWarn:!0})&&ce.dispatch(qe())}const Ie=Ae.bind(null,"DRAGGING");function ke(We){function qe(){ne.release(),Se="COMPLETED"}Se!=="PRE_DRAG"&&(qe(),invariant(!1)),ce.dispatch(lift$1(We.liftActionArgs)),Se="DRAGGING";function ze(Ge,Ze={shouldBlockNextClick:!1}){if(We.cleanup(),Ze.shouldBlockNextClick){const Dt=bindEvents(window,[{eventName:"click",fn:preventDefault,options:{once:!0,passive:!1,capture:!0}}]);setTimeout(Dt)}qe(),ce.dispatch(drop$1({reason:Ge}))}return{isActive:()=>isActive({expected:"DRAGGING",phase:Se,isLockActive:Re,shouldWarn:!1}),shouldRespectForcePress:$e,drop:Ge=>ze("DROP",Ge),cancel:Ge=>ze("CANCEL",Ge),...We.actions}}function Be(We){const qe=rafSchd$1(Ge=>{Ie(()=>move({client:Ge}))});return{...ke({liftActionArgs:{id:pe,clientSelection:We,movementMode:"FLUID"},cleanup:()=>qe.cancel(),actions:{move:qe}}),move:qe}}function Ne(){const We={moveUp:()=>Ie(moveUp),moveRight:()=>Ie(moveRight),moveDown:()=>Ie(moveDown),moveLeft:()=>Ie(moveLeft)};return ke({liftActionArgs:{id:pe,clientSelection:getBorderBoxCenterPosition(xe),movementMode:"SNAP"},cleanup:noop$2$1,actions:We})}function Fe(){isActive({expected:"PRE_DRAG",phase:Se,isLockActive:Re,shouldWarn:!0})&&ne.release()}return{isActive:()=>isActive({expected:"PRE_DRAG",phase:Se,isLockActive:Re,shouldWarn:!1}),shouldRespectForcePress:$e,fluidLift:Be,snapLift:Ne,abort:Fe}}const defaultSensors=[useMouseSensor,useKeyboardSensor,useTouchSensor];function useSensorMarshal({contextId:ne,store:oe,registry:ce,customSensors:ue,enableDefaultSensors:pe}){const me=[...pe?defaultSensors:[],...ue||[]],ge=reactExports.useState(()=>create$1())[0],ye=useCallback(function(ke,Be){isDragging(ke)&&!isDragging(Be)&&ge.tryAbandon()},[ge]);useLayoutEffect(function(){let ke=oe.getState();return oe.subscribe(()=>{const Ne=oe.getState();ye(ke,Ne),ke=Ne})},[ge,oe,ye]),useLayoutEffect(()=>ge.tryAbandon,[ge.tryAbandon]);const ve=useCallback(Ie=>canStart({lockAPI:ge,registry:ce,store:oe,draggableId:Ie}),[ge,ce,oe]),xe=useCallback((Ie,ke,Be)=>tryStart({lockAPI:ge,registry:ce,contextId:ne,store:oe,draggableId:Ie,forceSensorStop:ke||null,sourceEvent:Be&&Be.sourceEvent?Be.sourceEvent:null}),[ne,ge,ce,oe]),_e=useCallback(Ie=>tryGetClosestDraggableIdFromEvent(ne,Ie),[ne]),Se=useCallback(Ie=>{const ke=ce.draggable.findById(Ie);return ke?ke.options:null},[ce.draggable]),$e=useCallback(function(){ge.isClaimed()&&(ge.tryAbandon(),oe.getState().phase!=="IDLE"&&oe.dispatch(flush()))},[ge,oe]),Re=useCallback(()=>ge.isClaimed(),[ge]),Ae=useMemo(()=>({canGetLock:ve,tryGetLock:xe,findClosestDraggableId:_e,findOptionsForDraggable:Se,tryReleaseLock:$e,isLockClaimed:Re}),[ve,xe,_e,Se,$e,Re]);for(let Ie=0;Ie({onBeforeCapture:oe=>{const ce=()=>{ne.onBeforeCapture&&ne.onBeforeCapture(oe)};React$2.version.startsWith("16")||React$2.version.startsWith("17")?ce():reactDomExports.flushSync(ce)},onBeforeDragStart:ne.onBeforeDragStart,onDragStart:ne.onDragStart,onDragEnd:ne.onDragEnd,onDragUpdate:ne.onDragUpdate}),createAutoScrollerOptions=ne=>({...defaultAutoScrollerOptions,...ne.autoScrollerOptions,durationDampening:{...defaultAutoScrollerOptions.durationDampening,...ne.autoScrollerOptions}});function getStore(ne){return ne.current||invariant(!1),ne.current}function App$1(ne){const{contextId:oe,setCallbacks:ce,sensors:ue,nonce:pe,dragHandleUsageInstructions:me}=ne,ge=reactExports.useRef(null),ye=usePrevious(ne),ve=useCallback(()=>createResponders(ye.current),[ye]),xe=useCallback(()=>createAutoScrollerOptions(ye.current),[ye]),_e=useAnnouncer(oe),Se=useHiddenTextElement({contextId:oe,text:me}),$e=useStyleMarshal(oe,pe),Re=useCallback(Dt=>{getStore(ge).dispatch(Dt)},[]),Ae=useMemo(()=>bindActionCreators$1({publishWhileDragging,updateDroppableScroll,updateDroppableIsEnabled,updateDroppableIsCombineEnabled,collectionStarting},Re),[Re]),Ie=useRegistry(),ke=useMemo(()=>createDimensionMarshal(Ie,Ae),[Ie,Ae]),Be=useMemo(()=>createAutoScroller({scrollWindow,scrollDroppable:ke.scrollDroppable,getAutoScrollerOptions:xe,...bindActionCreators$1({move},Re)}),[ke.scrollDroppable,Re,xe]),Ne=useFocusMarshal(oe),Fe=useMemo(()=>createStore({announce:_e,autoScroller:Be,dimensionMarshal:ke,focusMarshal:Ne,getResponders:ve,styleMarshal:$e}),[_e,Be,ke,Ne,ve,$e]);ge.current=Fe;const Ue=useCallback(()=>{const Dt=getStore(ge);Dt.getState().phase!=="IDLE"&&Dt.dispatch(flush())},[]),We=useCallback(()=>{const Dt=getStore(ge).getState();return Dt.phase==="DROP_ANIMATING"?!0:Dt.phase==="IDLE"?!1:Dt.isDragging},[]),qe=useMemo(()=>({isDragging:We,tryAbort:Ue}),[We,Ue]);ce(qe);const ze=useCallback(Dt=>canStartDrag(getStore(ge).getState(),Dt),[]),Ge=useCallback(()=>isMovementAllowed(getStore(ge).getState()),[]),Ze=useMemo(()=>({marshal:ke,focus:Ne,contextId:oe,canLift:ze,isMovementAllowed:Ge,dragHandleUsageInstructionsId:Se,registry:Ie}),[oe,ke,Se,Ne,ze,Ge,Ie]);return useSensorMarshal({contextId:oe,store:Fe,registry:Ie,customSensors:ue||null,enableDefaultSensors:ne.enableDefaultSensors!==!1}),reactExports.useEffect(()=>Ue,[Ue]),React$2.createElement(AppContext.Provider,{value:Ze},React$2.createElement(Provider,{context:StoreContext,store:Fe},ne.children))}let count=0;function useDeprecatedUniqueContextId(){return useMemo(()=>`${count++}`,[])}function useUniqueContextId(){return React$2.useId()}var useUniqueContextId$1="useId"in React$2?useUniqueContextId:useDeprecatedUniqueContextId;function DragDropContext(ne){const oe=useUniqueContextId$1(),ce=ne.dragHandleUsageInstructions||preset$1.dragHandleUsageInstructions;return React$2.createElement(ErrorBoundary$1,null,ue=>React$2.createElement(App$1,{nonce:ne.nonce,contextId:oe,setCallbacks:ue,dragHandleUsageInstructions:ce,enableDefaultSensors:ne.enableDefaultSensors,sensors:ne.sensors,onBeforeCapture:ne.onBeforeCapture,onBeforeDragStart:ne.onBeforeDragStart,onDragStart:ne.onDragStart,onDragUpdate:ne.onDragUpdate,onDragEnd:ne.onDragEnd,autoScrollerOptions:ne.autoScrollerOptions},ne.children))}const zIndexOptions={dragging:5e3,dropAnimating:4500},getDraggingTransition=(ne,oe)=>oe?transitions.drop(oe.duration):ne?transitions.snap:transitions.fluid,getDraggingOpacity=(ne,oe)=>{if(ne)return oe?combine$1.opacity.drop:combine$1.opacity.combining},getShouldDraggingAnimate=ne=>ne.forceShouldAnimate!=null?ne.forceShouldAnimate:ne.mode==="SNAP";function getDraggingStyle(ne){const ce=ne.dimension.client,{offset:ue,combineWith:pe,dropping:me}=ne,ge=!!pe,ye=getShouldDraggingAnimate(ne),ve=!!me,xe=ve?transforms.drop(ue,ge):transforms.moveTo(ue);return{position:"fixed",top:ce.marginBox.top,left:ce.marginBox.left,boxSizing:"border-box",width:ce.borderBox.width,height:ce.borderBox.height,transition:getDraggingTransition(ye,me),transform:xe,opacity:getDraggingOpacity(ge,ve),zIndex:ve?zIndexOptions.dropAnimating:zIndexOptions.dragging,pointerEvents:"none"}}function getSecondaryStyle(ne){return{transform:transforms.moveTo(ne.offset),transition:ne.shouldAnimateDisplacement?void 0:"none"}}function getStyle$1(ne){return ne.type==="DRAGGING"?getDraggingStyle(ne):getSecondaryStyle(ne)}function getDimension$1(ne,oe,ce=origin){const ue=window.getComputedStyle(oe),pe=oe.getBoundingClientRect(),me=calculateBox(pe,ue),ge=withScroll(me,ce),ye={client:me,tagName:oe.tagName.toLowerCase(),display:ue.display},ve={x:me.marginBox.width,y:me.marginBox.height};return{descriptor:ne,placeholder:ye,displaceBy:ve,client:me,page:ge}}function useDraggablePublisher(ne){const oe=useUniqueId$1("draggable"),{descriptor:ce,registry:ue,getDraggableRef:pe,canDragInteractiveElements:me,shouldRespectForcePress:ge,isEnabled:ye}=ne,ve=useMemo(()=>({canDragInteractiveElements:me,shouldRespectForcePress:ge,isEnabled:ye}),[me,ye,ge]),xe=useCallback(Re=>{const Ae=pe();return Ae||invariant(!1),getDimension$1(ce,Ae,Re)},[ce,pe]),_e=useMemo(()=>({uniqueId:oe,descriptor:ce,options:ve,getDimension:xe}),[ce,xe,ve,oe]),Se=reactExports.useRef(_e),$e=reactExports.useRef(!0);useLayoutEffect(()=>(ue.draggable.register(Se.current),()=>ue.draggable.unregister(Se.current)),[ue.draggable]),useLayoutEffect(()=>{if($e.current){$e.current=!1;return}const Re=Se.current;Se.current=_e,ue.draggable.update(_e,Re)},[_e,ue.draggable])}var DroppableContext=React$2.createContext(null);function useRequiredContext(ne){const oe=reactExports.useContext(ne);return oe||invariant(!1),oe}function preventHtml5Dnd(ne){ne.preventDefault()}const Draggable=ne=>{const oe=reactExports.useRef(null),ce=useCallback((qe=null)=>{oe.current=qe},[]),ue=useCallback(()=>oe.current,[]),{contextId:pe,dragHandleUsageInstructionsId:me,registry:ge}=useRequiredContext(AppContext),{type:ye,droppableId:ve}=useRequiredContext(DroppableContext),xe=useMemo(()=>({id:ne.draggableId,index:ne.index,type:ye,droppableId:ve}),[ne.draggableId,ne.index,ye,ve]),{children:_e,draggableId:Se,isEnabled:$e,shouldRespectForcePress:Re,canDragInteractiveElements:Ae,isClone:Ie,mapped:ke,dropAnimationFinished:Be}=ne;if(!Ie){const qe=useMemo(()=>({descriptor:xe,registry:ge,getDraggableRef:ue,canDragInteractiveElements:Ae,shouldRespectForcePress:Re,isEnabled:$e}),[xe,ge,ue,Ae,Re,$e]);useDraggablePublisher(qe)}const Ne=useMemo(()=>$e?{tabIndex:0,role:"button","aria-describedby":me,"data-rfd-drag-handle-draggable-id":Se,"data-rfd-drag-handle-context-id":pe,draggable:!1,onDragStart:preventHtml5Dnd}:null,[pe,me,Se,$e]),Fe=useCallback(qe=>{ke.type==="DRAGGING"&&ke.dropping&&qe.propertyName==="transform"&&(React$2.version.startsWith("16")||React$2.version.startsWith("17")?Be():reactDomExports.flushSync(Be))},[Be,ke]),Ue=useMemo(()=>{const qe=getStyle$1(ke),ze=ke.type==="DRAGGING"&&ke.dropping?Fe:void 0;return{innerRef:ce,draggableProps:{"data-rfd-draggable-context-id":pe,"data-rfd-draggable-id":Se,style:qe,onTransitionEnd:ze},dragHandleProps:Ne}},[pe,Ne,Se,ke,Fe,ce]),We=useMemo(()=>({draggableId:xe.id,type:xe.type,source:{index:xe.index,droppableId:xe.droppableId}}),[xe.droppableId,xe.id,xe.index,xe.type]);return React$2.createElement(React$2.Fragment,null,_e(Ue,ke.snapshot,We))};var Draggable$1=Draggable,isStrictEqual=(ne,oe)=>ne===oe,whatIsDraggedOverFromResult=ne=>{const{combine:oe,destination:ce}=ne;return ce?ce.droppableId:oe?oe.droppableId:null};const getCombineWithFromResult=ne=>ne.combine?ne.combine.draggableId:null,getCombineWithFromImpact=ne=>ne.at&&ne.at.type==="COMBINE"?ne.at.combine.draggableId:null;function getDraggableSelector(){const ne=memoizeOne((pe,me)=>({x:pe,y:me})),oe=memoizeOne((pe,me,ge=null,ye=null,ve=null)=>({isDragging:!0,isClone:me,isDropAnimating:!!ve,dropAnimation:ve,mode:pe,draggingOver:ge,combineWith:ye,combineTargetFor:null})),ce=memoizeOne((pe,me,ge,ye,ve=null,xe=null,_e=null)=>({mapped:{type:"DRAGGING",dropping:null,draggingOver:ve,combineWith:xe,mode:me,offset:pe,dimension:ge,forceShouldAnimate:_e,snapshot:oe(me,ye,ve,xe,null)}}));return(pe,me)=>{if(isDragging(pe)){if(pe.critical.draggable.id!==me.draggableId)return null;const ge=pe.current.client.offset,ye=pe.dimensions.draggables[me.draggableId],ve=whatIsDraggedOver(pe.impact),xe=getCombineWithFromImpact(pe.impact),_e=pe.forceShouldAnimate;return ce(ne(ge.x,ge.y),pe.movementMode,ye,me.isClone,ve,xe,_e)}if(pe.phase==="DROP_ANIMATING"){const ge=pe.completed;if(ge.result.draggableId!==me.draggableId)return null;const ye=me.isClone,ve=pe.dimensions.draggables[me.draggableId],xe=ge.result,_e=xe.mode,Se=whatIsDraggedOverFromResult(xe),$e=getCombineWithFromResult(xe),Ae={duration:pe.dropDuration,curve:curves$1.drop,moveTo:pe.newHomeClientOffset,opacity:$e?combine$1.opacity.drop:null,scale:$e?combine$1.scale.drop:null};return{mapped:{type:"DRAGGING",offset:pe.newHomeClientOffset,dimension:ve,dropping:Ae,draggingOver:Se,combineWith:$e,mode:_e,forceShouldAnimate:null,snapshot:oe(_e,ye,Se,$e,Ae)}}}return null}}function getSecondarySnapshot(ne=null){return{isDragging:!1,isDropAnimating:!1,isClone:!1,dropAnimation:null,mode:null,draggingOver:null,combineTargetFor:ne,combineWith:null}}const atRest={mapped:{type:"SECONDARY",offset:origin,combineTargetFor:null,shouldAnimateDisplacement:!0,snapshot:getSecondarySnapshot(null)}};function getSecondarySelector(){const ne=memoizeOne((ge,ye)=>({x:ge,y:ye})),oe=memoizeOne(getSecondarySnapshot),ce=memoizeOne((ge,ye=null,ve)=>({mapped:{type:"SECONDARY",offset:ge,combineTargetFor:ye,shouldAnimateDisplacement:ve,snapshot:oe(ye)}})),ue=ge=>ge?ce(origin,ge,!0):null,pe=(ge,ye,ve,xe)=>{const _e=ve.displaced.visible[ge],Se=!!(xe.inVirtualList&&xe.effected[ge]),$e=tryGetCombine(ve),Re=$e&&$e.draggableId===ge?ye:null;if(!_e){if(!Se)return ue(Re);if(ve.displaced.invisible[ge])return null;const ke=negate(xe.displacedBy.point),Be=ne(ke.x,ke.y);return ce(Be,Re,!0)}if(Se)return ue(Re);const Ae=ve.displacedBy.point,Ie=ne(Ae.x,Ae.y);return ce(Ie,Re,_e.shouldAnimate)};return(ge,ye)=>{if(isDragging(ge))return ge.critical.draggable.id===ye.draggableId?null:pe(ye.draggableId,ge.critical.draggable.id,ge.impact,ge.afterCritical);if(ge.phase==="DROP_ANIMATING"){const ve=ge.completed;return ve.result.draggableId===ye.draggableId?null:pe(ye.draggableId,ve.result.draggableId,ve.impact,ve.afterCritical)}return null}}const makeMapStateToProps$1=()=>{const ne=getDraggableSelector(),oe=getSecondarySelector();return(ue,pe)=>ne(ue,pe)||oe(ue,pe)||atRest},mapDispatchToProps$1={dropAnimationFinished},ConnectedDraggable=connect$1(makeMapStateToProps$1,mapDispatchToProps$1,null,{context:StoreContext,areStatePropsEqual:isStrictEqual})(Draggable$1);var ConnectedDraggable$1=ConnectedDraggable;function PrivateDraggable(ne){return useRequiredContext(DroppableContext).isUsingCloneFor===ne.draggableId&&!ne.isClone?null:React$2.createElement(ConnectedDraggable$1,ne)}function PublicDraggable(ne){const oe=typeof ne.isDragDisabled=="boolean"?!ne.isDragDisabled:!0,ce=!!ne.disableInteractiveElementBlocking,ue=!!ne.shouldRespectForcePress;return React$2.createElement(PrivateDraggable,_extends$2({},ne,{isClone:!1,isEnabled:oe,canDragInteractiveElements:ce,shouldRespectForcePress:ue}))}const isEqual=ne=>oe=>ne===oe,isScroll=isEqual("scroll"),isAuto=isEqual("auto"),isEither=(ne,oe)=>oe(ne.overflowX)||oe(ne.overflowY),isElementScrollable=ne=>{const oe=window.getComputedStyle(ne),ce={overflowX:oe.overflowX,overflowY:oe.overflowY};return isEither(ce,isScroll)||isEither(ce,isAuto)},isBodyScrollable=()=>!1,getClosestScrollable=ne=>ne==null?null:ne===document.body?isBodyScrollable()?ne:null:ne===document.documentElement?null:isElementScrollable(ne)?ne:getClosestScrollable(ne.parentElement);var getScroll=ne=>({x:ne.scrollLeft,y:ne.scrollTop});const getIsFixed=ne=>ne?window.getComputedStyle(ne).position==="fixed"?!0:getIsFixed(ne.parentElement):!1;var getEnv=ne=>{const oe=getClosestScrollable(ne),ce=getIsFixed(ne);return{closestScrollable:oe,isFixedOnPage:ce}},getDroppableDimension=({descriptor:ne,isEnabled:oe,isCombineEnabled:ce,isFixedOnPage:ue,direction:pe,client:me,page:ge,closest:ye})=>{const ve=(()=>{if(!ye)return null;const{scrollSize:$e,client:Re}=ye,Ae=getMaxScroll({scrollHeight:$e.scrollHeight,scrollWidth:$e.scrollWidth,height:Re.paddingBox.height,width:Re.paddingBox.width});return{pageMarginBox:ye.page.marginBox,frameClient:Re,scrollSize:$e,shouldClipSubject:ye.shouldClipSubject,scroll:{initial:ye.scroll,current:ye.scroll,max:Ae,diff:{value:origin,displacement:origin}}}})(),xe=pe==="vertical"?vertical:horizontal,_e=getSubject({page:ge,withPlaceholder:null,axis:xe,frame:ve});return{descriptor:ne,isCombineEnabled:ce,isFixedOnPage:ue,axis:xe,isEnabled:oe,client:me,page:ge,frame:ve,subject:_e}};const getClient=(ne,oe)=>{const ce=getBox(ne);if(!oe||ne!==oe)return ce;const ue=ce.paddingBox.top-oe.scrollTop,pe=ce.paddingBox.left-oe.scrollLeft,me=ue+oe.scrollHeight,ge=pe+oe.scrollWidth,ve=expand({top:ue,right:ge,bottom:me,left:pe},ce.border);return createBox({borderBox:ve,margin:ce.margin,border:ce.border,padding:ce.padding})};var getDimension=({ref:ne,descriptor:oe,env:ce,windowScroll:ue,direction:pe,isDropDisabled:me,isCombineEnabled:ge,shouldClipSubject:ye})=>{const ve=ce.closestScrollable,xe=getClient(ne,ve),_e=withScroll(xe,ue),Se=(()=>{if(!ve)return null;const Re=getBox(ve),Ae={scrollHeight:ve.scrollHeight,scrollWidth:ve.scrollWidth};return{client:Re,page:withScroll(Re,ue),scroll:getScroll(ve),scrollSize:Ae,shouldClipSubject:ye}})();return getDroppableDimension({descriptor:oe,isEnabled:!me,isCombineEnabled:ge,isFixedOnPage:ce.isFixedOnPage,direction:pe,client:xe,page:_e,closest:Se})};const immediate={passive:!1},delayed={passive:!0};var getListenerOptions=ne=>ne.shouldPublishImmediately?immediate:delayed;const getClosestScrollableFromDrag=ne=>ne&&ne.env.closestScrollable||null;function useDroppablePublisher(ne){const oe=reactExports.useRef(null),ce=useRequiredContext(AppContext),ue=useUniqueId$1("droppable"),{registry:pe,marshal:me}=ce,ge=usePrevious(ne),ye=useMemo(()=>({id:ne.droppableId,type:ne.type,mode:ne.mode}),[ne.droppableId,ne.mode,ne.type]),ve=reactExports.useRef(ye),xe=useMemo(()=>memoizeOne((Ue,We)=>{oe.current||invariant(!1);const qe={x:Ue,y:We};me.updateDroppableScroll(ye.id,qe)}),[ye.id,me]),_e=useCallback(()=>{const Ue=oe.current;return!Ue||!Ue.env.closestScrollable?origin:getScroll(Ue.env.closestScrollable)},[]),Se=useCallback(()=>{const Ue=_e();xe(Ue.x,Ue.y)},[_e,xe]),$e=useMemo(()=>rafSchd$1(Se),[Se]),Re=useCallback(()=>{const Ue=oe.current,We=getClosestScrollableFromDrag(Ue);if(Ue&&We||invariant(!1),Ue.scrollOptions.shouldPublishImmediately){Se();return}$e()},[$e,Se]),Ae=useCallback((Ue,We)=>{oe.current&&invariant(!1);const qe=ge.current,ze=qe.getDroppableRef();ze||invariant(!1);const Ge=getEnv(ze),Ze={ref:ze,descriptor:ye,env:Ge,scrollOptions:We};oe.current=Ze;const Dt=getDimension({ref:ze,descriptor:ye,env:Ge,windowScroll:Ue,direction:qe.direction,isDropDisabled:qe.isDropDisabled,isCombineEnabled:qe.isCombineEnabled,shouldClipSubject:!qe.ignoreContainerClipping}),Je=Ge.closestScrollable;return Je&&(Je.setAttribute(scrollContainer.contextId,ce.contextId),Je.addEventListener("scroll",Re,getListenerOptions(Ze.scrollOptions))),Dt},[ce.contextId,ye,Re,ge]),Ie=useCallback(()=>{const Ue=oe.current,We=getClosestScrollableFromDrag(Ue);return Ue&&We||invariant(!1),getScroll(We)},[]),ke=useCallback(()=>{const Ue=oe.current;Ue||invariant(!1);const We=getClosestScrollableFromDrag(Ue);oe.current=null,We&&($e.cancel(),We.removeAttribute(scrollContainer.contextId),We.removeEventListener("scroll",Re,getListenerOptions(Ue.scrollOptions)))},[Re,$e]),Be=useCallback(Ue=>{const We=oe.current;We||invariant(!1);const qe=getClosestScrollableFromDrag(We);qe||invariant(!1),qe.scrollTop+=Ue.y,qe.scrollLeft+=Ue.x},[]),Ne=useMemo(()=>({getDimensionAndWatchScroll:Ae,getScrollWhileDragging:Ie,dragStopped:ke,scroll:Be}),[ke,Ae,Ie,Be]),Fe=useMemo(()=>({uniqueId:ue,descriptor:ye,callbacks:Ne}),[Ne,ye,ue]);useLayoutEffect(()=>(ve.current=Fe.descriptor,pe.droppable.register(Fe),()=>{oe.current&&ke(),pe.droppable.unregister(Fe)}),[Ne,ye,ke,Fe,me,pe.droppable]),useLayoutEffect(()=>{oe.current&&me.updateDroppableIsEnabled(ve.current.id,!ne.isDropDisabled)},[ne.isDropDisabled,me]),useLayoutEffect(()=>{oe.current&&me.updateDroppableIsCombineEnabled(ve.current.id,ne.isCombineEnabled)},[ne.isCombineEnabled,me])}function noop$6(){}const empty$2={width:0,height:0,margin:noSpacing},getSize=({isAnimatingOpenOnMount:ne,placeholder:oe,animate:ce})=>ne||ce==="close"?empty$2:{height:oe.client.borderBox.height,width:oe.client.borderBox.width,margin:oe.client.margin},getStyle=({isAnimatingOpenOnMount:ne,placeholder:oe,animate:ce})=>{const ue=getSize({isAnimatingOpenOnMount:ne,placeholder:oe,animate:ce});return{display:oe.display,boxSizing:"border-box",width:ue.width,height:ue.height,marginTop:ue.margin.top,marginRight:ue.margin.right,marginBottom:ue.margin.bottom,marginLeft:ue.margin.left,flexShrink:"0",flexGrow:"0",pointerEvents:"none",transition:ce!=="none"?transitions.placeholder:null}},Placeholder=ne=>{const oe=reactExports.useRef(null),ce=useCallback(()=>{oe.current&&(clearTimeout(oe.current),oe.current=null)},[]),{animate:ue,onTransitionEnd:pe,onClose:me,contextId:ge}=ne,[ye,ve]=reactExports.useState(ne.animate==="open");reactExports.useEffect(()=>ye?ue!=="open"?(ce(),ve(!1),noop$6):oe.current?noop$6:(oe.current=setTimeout(()=>{oe.current=null,ve(!1)}),ce):noop$6,[ue,ye,ce]);const xe=useCallback(Se=>{Se.propertyName==="height"&&(pe(),ue==="close"&&me())},[ue,me,pe]),_e=getStyle({isAnimatingOpenOnMount:ye,animate:ne.animate,placeholder:ne.placeholder});return React$2.createElement(ne.placeholder.tagName,{style:_e,"data-rfd-placeholder-context-id":ge,onTransitionEnd:xe,ref:ne.innerRef})};var Placeholder$1=React$2.memo(Placeholder);class AnimateInOut extends React$2.PureComponent{constructor(...oe){super(...oe),this.state={isVisible:!!this.props.on,data:this.props.on,animate:this.props.shouldAnimate&&this.props.on?"open":"none"},this.onClose=()=>{this.state.animate==="close"&&this.setState({isVisible:!1})}}static getDerivedStateFromProps(oe,ce){return oe.shouldAnimate?oe.on?{isVisible:!0,data:oe.on,animate:"open"}:ce.isVisible?{isVisible:!0,data:ce.data,animate:"close"}:{isVisible:!1,animate:"close",data:null}:{isVisible:!!oe.on,data:oe.on,animate:"none"}}render(){if(!this.state.isVisible)return null;const oe={onClose:this.onClose,data:this.state.data,animate:this.state.animate};return this.props.children(oe)}}const Droppable=ne=>{const oe=reactExports.useContext(AppContext);oe||invariant(!1);const{contextId:ce,isMovementAllowed:ue}=oe,pe=reactExports.useRef(null),me=reactExports.useRef(null),{children:ge,droppableId:ye,type:ve,mode:xe,direction:_e,ignoreContainerClipping:Se,isDropDisabled:$e,isCombineEnabled:Re,snapshot:Ae,useClone:Ie,updateViewportMaxScroll:ke,getContainerForClone:Be}=ne,Ne=useCallback(()=>pe.current,[]),Fe=useCallback((Je=null)=>{pe.current=Je},[]);useCallback(()=>me.current,[]);const Ue=useCallback((Je=null)=>{me.current=Je},[]),We=useCallback(()=>{ue()&&ke({maxScroll:getMaxWindowScroll()})},[ue,ke]);useDroppablePublisher({droppableId:ye,type:ve,mode:xe,direction:_e,isDropDisabled:$e,isCombineEnabled:Re,ignoreContainerClipping:Se,getDroppableRef:Ne});const qe=useMemo(()=>React$2.createElement(AnimateInOut,{on:ne.placeholder,shouldAnimate:ne.shouldAnimatePlaceholder},({onClose:Je,data:Ut,animate:jt})=>React$2.createElement(Placeholder$1,{placeholder:Ut,onClose:Je,innerRef:Ue,animate:jt,contextId:ce,onTransitionEnd:We})),[ce,We,ne.placeholder,ne.shouldAnimatePlaceholder,Ue]),ze=useMemo(()=>({innerRef:Fe,placeholder:qe,droppableProps:{"data-rfd-droppable-id":ye,"data-rfd-droppable-context-id":ce}}),[ce,ye,qe,Fe]),Ge=Ie?Ie.dragging.draggableId:null,Ze=useMemo(()=>({droppableId:ye,type:ve,isUsingCloneFor:Ge}),[ye,Ge,ve]);function Dt(){if(!Ie)return null;const{dragging:Je,render:Ut}=Ie,jt=React$2.createElement(PrivateDraggable,{draggableId:Je.draggableId,index:Je.source.index,isClone:!0,isEnabled:!0,shouldRespectForcePress:!1,canDragInteractiveElements:!0},(Ke,an)=>Ut(Ke,an,Je));return ReactDOM$1.createPortal(jt,Be())}return React$2.createElement(DroppableContext.Provider,{value:Ze},ge(ze,Ae),Dt())};var Droppable$1=Droppable;function getBody(){return document.body||invariant(!1),document.body}const defaultProps={mode:"standard",type:"DEFAULT",direction:"vertical",isDropDisabled:!1,isCombineEnabled:!1,ignoreContainerClipping:!1,renderClone:null,getContainerForClone:getBody},attachDefaultPropsToOwnProps=ne=>{let oe={...ne},ce;for(ce in defaultProps)ne[ce]===void 0&&(oe={...oe,[ce]:defaultProps[ce]});return oe},isMatchingType=(ne,oe)=>ne===oe.droppable.type,getDraggable=(ne,oe)=>oe.draggables[ne.draggable.id],makeMapStateToProps=()=>{const ne={placeholder:null,shouldAnimatePlaceholder:!0,snapshot:{isDraggingOver:!1,draggingOverWith:null,draggingFromThisWith:null,isUsingPlaceholder:!1},useClone:null},oe={...ne,shouldAnimatePlaceholder:!1},ce=memoizeOne(me=>({draggableId:me.id,type:me.type,source:{index:me.index,droppableId:me.droppableId}})),ue=memoizeOne((me,ge,ye,ve,xe,_e)=>{const Se=xe.descriptor.id;if(xe.descriptor.droppableId===me){const Ae=_e?{render:_e,dragging:ce(xe.descriptor)}:null,Ie={isDraggingOver:ye,draggingOverWith:ye?Se:null,draggingFromThisWith:Se,isUsingPlaceholder:!0};return{placeholder:xe.placeholder,shouldAnimatePlaceholder:!1,snapshot:Ie,useClone:Ae}}if(!ge)return oe;if(!ve)return ne;const Re={isDraggingOver:ye,draggingOverWith:Se,draggingFromThisWith:null,isUsingPlaceholder:!0};return{placeholder:xe.placeholder,shouldAnimatePlaceholder:!0,snapshot:Re,useClone:null}});return(me,ge)=>{const ye=attachDefaultPropsToOwnProps(ge),ve=ye.droppableId,xe=ye.type,_e=!ye.isDropDisabled,Se=ye.renderClone;if(isDragging(me)){const $e=me.critical;if(!isMatchingType(xe,$e))return oe;const Re=getDraggable($e,me.dimensions),Ae=whatIsDraggedOver(me.impact)===ve;return ue(ve,_e,Ae,Ae,Re,Se)}if(me.phase==="DROP_ANIMATING"){const $e=me.completed;if(!isMatchingType(xe,$e.critical))return oe;const Re=getDraggable($e.critical,me.dimensions);return ue(ve,_e,whatIsDraggedOverFromResult($e.result)===ve,whatIsDraggedOver($e.impact)===ve,Re,Se)}if(me.phase==="IDLE"&&me.completed&&!me.shouldFlush){const $e=me.completed;if(!isMatchingType(xe,$e.critical))return oe;const Re=whatIsDraggedOver($e.impact)===ve,Ae=!!($e.impact.at&&$e.impact.at.type==="COMBINE"),Ie=$e.critical.droppable.id===ve;return Re?Ae?ne:oe:Ie?ne:oe}return oe}},mapDispatchToProps={updateViewportMaxScroll},ConnectedDroppable=connect$1(makeMapStateToProps,mapDispatchToProps,(ne,oe,ce)=>({...attachDefaultPropsToOwnProps(ce),...ne,...oe}),{context:StoreContext,areStatePropsEqual:isStrictEqual})(Droppable$1);var ConnectedDroppable$1=ConnectedDroppable;const DefaultListEditorInput=reactExports.forwardRef(function({onValueChange:oe,...ce},ue){return jsxRuntimeExports.jsx(InputBase$1,{fullWidth:!0,...ce,placeholder:"Untitled item",inputRef:ue})});function useInitialRender(){const ne=reactExports.useRef(!1),oe=ne.current;return ne.current=!0,!oe}const defaultEditorRenderer=({handle:ne,content:oe,extras:ce})=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[ne,oe,ce]});function ListEditorField({toggleable:ne,deletable:oe,editable:ce=!0,onChangeItem:ue=()=>{},onDeleteItem:pe=()=>{},extras:me,enabled:ge=!1,editor:ye=jsxRuntimeExports.jsx(DefaultListEditorInput,{}),value:ve,id:xe,i:_e=0,autoFocus:Se,sortable:$e,button:Re=!0,renderEditor:Ae=defaultEditorRenderer}){const Ie=useAcrylic(),ke=usePaper(),[Be,Ne]=reactExports.useState(null),Fe=Re?ButtonBase$1:Box$1;return jsxRuntimeExports.jsx(PublicDraggable,{index:_e,draggableId:`${xe}`,children:(Ue,We)=>jsxRuntimeExports.jsx("div",{ref:Ue.innerRef,...Ue.draggableProps,children:jsxRuntimeExports.jsx(Stack$1,{direction:"row",alignItems:"center",sx:{...Re?{transition:qe=>qe.transitions.create("background"),"&:hover":{background:qe=>qe.palette.action.hover}}:void 0,...We.isDragging?{...ke(1),...Ie}:void 0},children:Ae==null?void 0:Ae({value:ve,onValueChange:qe=>ue(xe??_e,qe,ge),handle:$e&&jsxRuntimeExports.jsx(Flex,{...Ue.dragHandleProps,color:"text.secondary",sx:{flex:0,p:2},children:jsxRuntimeExports.jsx(DragHandleOutlined,{})}),content:jsxRuntimeExports.jsx(Fe,{sx:{flex:1,display:"block",textAlign:"left",px:2},children:reactExports.cloneElement(ye,{onDelete:()=>pe(xe??_e),autoFocus:Se,value:ve,key:xe??_e,onValueChange:qe=>ue(xe??_e,qe,ge),onChange:qe=>ue(xe??_e,qe.target.value,ge),ref:qe=>Ne(qe)})}),extras:jsxRuntimeExports.jsxs(Flex,{sx:{flex:0,px:1},children:[ne&&jsxRuntimeExports.jsx(Switch$2,{color:"primary",edge:"end",onChange:(qe,ze)=>ue(xe??_e,ve,ze),checked:ge}),ce&&jsxRuntimeExports.jsx(IconButton$1,{edge:"end",onClick:()=>{Be!=null&&Be.focus&&Be.focus()},children:jsxRuntimeExports.jsx(EditIcon,{})}),oe&&jsxRuntimeExports.jsx(IconButton$1,{onClick:()=>pe(xe??_e),sx:{color:qe=>qe.palette.text.secondary},children:jsxRuntimeExports.jsx(DeleteIcon,{})}),me&&me(ve)]})})})})})}function reorder(ne,oe,ce){const ue=Array.from(ne),[pe]=ue.splice(oe,1);return ue.splice(ce,0,pe),ue}function Editor(ne){const{addItemLabel:oe="Add Item",UNSAFE_label:ce,UNSAFE_text:ue,onAddItem:pe=()=>{},onDeleteItem:me=()=>{},items:ge=[],placeholder:ye,autoFocus:ve,category:xe,order:_e,onChange:Se,addItemExtras:$e,addable:Re=!0}=ne,Ae=usePaper(),Ie=useInitialRender(),ke=useTheme$1(),[Be,Ne]=reactExports.useState(ge),[Fe,Ue]=reactExports.useState(-1);reactExports.useEffect(()=>{const Ge=setTimeout(()=>{Ne(ge)},ke.transitions.duration.standard);return()=>{clearTimeout(Ge)}},[ge,Ne,ke.transitions.duration.standard]);const We=lodashExports$1.uniqBy([...Be,...ge],Ge=>Ge.id).map(Ge=>ge.find(Ze=>Ge.id===Ze.id)??Ge).map((Ge,Ze)=>{const{enabled:Dt,editor:Je,value:Ut,id:jt}=Ge??{};return{value:Ut,render:Ke=>jsxRuntimeExports.jsx(Collapse$1,{in:!!ge.find(an=>an.id===Ge.id),unmountOnExit:!0,appear:!Ie,mountOnEnter:!0,children:jsxRuntimeExports.jsx(ListEditorField,{...ne,onDeleteItem:an=>{me(an),Ue(-1)},enabled:Dt,editor:Je,value:Ut,id:jt,i:Ze,autoFocus:ve||Ze===Fe,...Ke})}),key:jt,in:!!ge.find(Ke=>Ke.id===Ge.id)}}),qe=lodashExports$1.sortBy(We,Ge=>xe==null?void 0:xe(Ge.value),Ge=>_e==null?void 0:_e(Ge.value)).map(Ge=>({...Ge,render:Ze=>jsxRuntimeExports.jsx(Box$1,{children:Ge.render(Ze)},Ge.key)}));return jsxRuntimeExports.jsx(DragDropContext,{onDragEnd:Ge=>{if(!Ge.destination)return;const Ze=reorder(ge,Ge.source.index,Ge.destination.index);Se==null||Se(Ze),Ne(Ze)},children:jsxRuntimeExports.jsxs(List$2,{subheader:ce||ue?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs(ListSubheader$1,{disableSticky:!0,children:[ce&&jsxRuntimeExports.jsx(Type$2,{component:"div",variant:"body1",gutterBottom:!0,color:"textPrimary",children:ce}),ue&&jsxRuntimeExports.jsx(Type$2,{component:"div",variant:"body2",color:"text.secondary",gutterBottom:!0,style:{marginBottom:ke.spacing(3)},children:ue})]})}):void 0,children:[jsxRuntimeExports.jsx(Box$1,{mt:xe?-1:0,children:jsxRuntimeExports.jsx(ConnectedDroppable$1,{droppableId:"list",isDropDisabled:!1,isCombineEnabled:!1,ignoreContainerClipping:!0,children:Ge=>jsxRuntimeExports.jsxs("div",{...Ge.droppableProps,ref:Ge.innerRef,children:[(()=>{const Ze=[];return qe.forEach((Dt,Je)=>{xe&&ze(qe,Je,Dt)&&Ze.push(jsxRuntimeExports.jsx(Collapse$1,{in:ge.some(Ut=>xe(Ut.value)===xe(Dt.value)),appear:!0,children:jsxRuntimeExports.jsx(Box$1,{pl:2,pb:2,pt:1,children:jsxRuntimeExports.jsx(Type$2,{component:"div",variant:"overline",color:"text.secondary",children:xe(Dt.value)})})},xe(Dt.value))),Ze.push(Dt.render())}),Ze})(),Ge.placeholder]})})}),jsxRuntimeExports.jsx(Collapse$1,{in:!(ge!=null&&ge.length),children:jsxRuntimeExports.jsx(Box$1,{ml:2,mb:1,pt:xe?1:0,children:jsxRuntimeExports.jsx(Type$2,{component:"div",color:"text.secondary",children:ye??"No items"})})}),jsxRuntimeExports.jsxs(Stack$1,{p:2,pt:2,gap:2,direction:"row",children:[Re&&jsxRuntimeExports.jsx(MuiButton,{disableElevation:!0,variant:"outlined",startIcon:jsxRuntimeExports.jsx(Add,{}),onClick:()=>{pe(),Ue(ge.length)},sx:{...Ae(1)},children:jsxRuntimeExports.jsx(Box$1,{sx:{color:"text.primary",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},children:oe})}),$e]})]})});function ze(Ge,Ze,Dt){return!!(xe&&(Ge[Ze-1]===void 0||xe(Ge[Ze-1].value)!==xe(Dt.value)))}}function ListEditor({onChange:ne,value:oe,editor:ce,create:ue,onFocus:pe,...me}){const[ge,ye]=reactExports.useState(oe??[]);function ve(xe){ye(xe),ne==null||ne(xe)}return reactExports.useEffect(()=>{ye(oe??[])},[oe]),jsxRuntimeExports.jsx(Box$1,{children:jsxRuntimeExports.jsx(Editor,{deletable:!0,editable:!1,...me,items:ge.map(xe=>({id:xe.key,value:xe,editor:ce==null?void 0:ce(xe)})),onAddItem:()=>{const xe=nanoid$1();ve==null||ve([...ge,{key:xe,...ue==null?void 0:ue()}]),lodashExports$1.defer(()=>pe==null?void 0:pe(xe))},onDeleteItem:xe=>ve==null?void 0:ve(lodashExports$1.filter(ge,_e=>_e.key!==xe)),onChangeItem:(xe,_e)=>ve==null?void 0:ve(lodashExports$1.map(ge,Se=>Se.key===xe?_e:Se)),onChange:xe=>ve==null?void 0:ve(lodashExports$1.map(xe,_e=>_e.value))})})}const comparators=[{key:"equal",apply:({value:ne,reference:oe})=>ne===oe,needsReference:!0},{key:"less-than",apply:({value:ne,reference:oe})=>nene>oe,needsReference:!0},{key:"changed",apply:({value:ne,property:oe,step:ce,node:ue})=>{if(ue.parent){const pe=lodashExports$1.findLast(ue.parent.events,me=>me.step({value:ye,label:lodashExports$1.startCase(ye)})),onChange:ye=>ue({type:ye==="any"?void 0:ye}),value:ne.type??"any"}),jsxRuntimeExports.jsx(Divider$1,{flexItem:!0,orientation:"vertical",sx:{mx:2}}),jsxRuntimeExports.jsx(SelectField,{placeholder:"Property",sx:{minWidth:140,textOverflow:"ellipsis",whiteSpace:"nowrap"},items:lodashExports$1.map(ce,ye=>({value:ye,label:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[lodashExports$1.last(ye.split(".")),jsxRuntimeExports.jsx(Space,{}),jsxRuntimeExports.jsx(Type$2,{color:"text.secondary",variant:"body2",component:"span",children:`$.${ye}`})]})})),onChange:ye=>ue({property:ye}),value:ne.property}),jsxRuntimeExports.jsx(Space,{}),jsxRuntimeExports.jsx(SelectField,{placeholder:"Condition",items:comparators.map(ye=>({value:ye.key,label:lodashExports$1.startCase(ye.key)})),value:((pe=ne.condition)==null?void 0:pe.key)??((me=comparators==null?void 0:comparators[0])==null?void 0:me.key),onChange:ye=>ue({condition:lodashExports$1.find(comparators,{key:ye})})}),jsxRuntimeExports.jsx(Space,{}),jsxRuntimeExports.jsx(TextField$1,{label:"Reference",fullWidth:!0,defaultValue:`${ne.reference??0}`,variant:"filled",inputProps:{inputMode:"numeric",pattern:"[0-9]*"},onChange:ye=>ue({reference:+ye.target.value}),type:"number",disabled:!((ge=ne.condition)!=null&&ge.needsReference)}),jsxRuntimeExports.jsx(Space,{sx:{px:2}}),jsxRuntimeExports.jsx(Switch,{checked:!!ne.active,onChange:(ye,ve)=>ue({active:ve}),sx:{mr:-4}})]})}function BreakpointListEditor({layer:ne}){var ge,ye,ve;const{layer:oe,setLayer:ce}=useLayer(ne),{breakpoints:ue}=(oe==null?void 0:oe.source)??{};function pe(xe){oe&&ce(produce(oe,_e=>lodashExports$1.set(_e,"source.breakpoints",xe)))}const me=reactExports.useMemo(()=>{var xe,_e,Se;return lodashExports$1.chain((Se=(_e=(xe=oe==null?void 0:oe.source)==null?void 0:xe.trace)==null?void 0:_e.content)==null?void 0:Se.events).flatMap(lodashExports$1.keys).uniq().filter($e=>$e!=="type").value()},[(ve=(ye=(ge=oe==null?void 0:oe.source)==null?void 0:ge.trace)==null?void 0:ye.content)==null?void 0:ve.events]);return jsxRuntimeExports.jsx(Box$1,{sx:{overflow:"auto hidden",width:"100%"},children:jsxRuntimeExports.jsx(Scroll,{x:!0,children:jsxRuntimeExports.jsx(Box$1,{sx:{minWidth:720,mb:2},children:jsxRuntimeExports.jsx(ListEditor,{sortable:!0,button:!1,icon:null,value:ue,deletable:!0,editable:!1,editor:xe=>jsxRuntimeExports.jsx(BreakpointEditor,{value:xe,properties:me}),create:()=>({active:!0,property:me==null?void 0:me[0],condition:comparators==null?void 0:comparators[0],type:void 0,reference:0}),onChange:xe=>pe(xe),addItemLabel:"Breakpoint",placeholder:"Get started by adding a breakpoint."})})})})}const stepsLayerGuard$1=ne=>!!getController(ne).steps,divider$3=jsxRuntimeExports.jsx(Divider$1,{orientation:"vertical",flexItem:!0,sx:{m:1,height:ne=>ne.spacing(3),alignSelf:"auto"}});function DebugPage({template:ne}){const{controls:oe,onChange:ce,state:ue,dragHandle:pe}=useViewTreeContext(),[me,ge]=reactExports.useState("standard"),{key:ye,setKey:ve,layers:xe,layer:_e,setLayer:Se,allLayers:$e}=useLayer(void 0,stepsLayerGuard$1),{code:Re}=(_e==null?void 0:_e.source)??{};function Ae(Ie){return jsxRuntimeExports.jsx(Type$2,{component:"div",variant:"overline",color:"text.secondary",children:Ie})}return jsxRuntimeExports.jsx(TabContext,{value:me,children:jsxRuntimeExports.jsxs(ne,{onChange:ce,stack:ue,children:[jsxRuntimeExports.jsx(ne.Key,{children:"debug"}),jsxRuntimeExports.jsx(ne.Title,{children:"Debugger"}),jsxRuntimeExports.jsx(ne.Handle,{children:pe}),jsxRuntimeExports.jsxs(ne.Options,{children:[jsxRuntimeExports.jsx(FeaturePicker,{icon:jsxRuntimeExports.jsx(LayersIcon,{}),label:"Layer",value:ye,items:lodashExports$1.map($e,Ie=>({id:Ie.key,hidden:!lodashExports$1.find(xe,{key:Ie.key}),name:inferLayerName(Ie)})),onChange:ve,arrow:!0,ellipsis:12}),divider$3,jsxRuntimeExports.jsxs(TabList$1,{onChange:(Ie,ke)=>ge(ke),children:[jsxRuntimeExports.jsx(Tab$1,{label:"Standard",value:"standard",disabled:!_e}),jsxRuntimeExports.jsx(Tab$1,{label:"Advanced",value:"advanced",disabled:!_e})]})]}),jsxRuntimeExports.jsx(ne.Content,{children:_e?jsxRuntimeExports.jsx(Scroll,{y:!0,children:jsxRuntimeExports.jsxs(Box$1,{pt:6,height:"100%",children:[jsxRuntimeExports.jsx(TabPanel$1,{value:"standard",sx:{p:2},children:jsxRuntimeExports.jsxs(Box$1,{mx:-2,children:[jsxRuntimeExports.jsx(Box$1,{px:2,children:Ae("Breakpoints")}),jsxRuntimeExports.jsx(BreakpointListEditor,{layer:_e==null?void 0:_e.key})]})}),jsxRuntimeExports.jsx(TabPanel$1,{value:"advanced",sx:{p:0,height:"100%"},children:jsxRuntimeExports.jsx(ScriptEditor,{code:Re??makeTemplate(lodashExports$1.values(templates)),onChange:Ie=>_e&&Se(produce(_e,ke=>lodashExports$1.set(ke,"source.code",Ie)))})})]})}):jsxRuntimeExports.jsx(Placeholder$2,{icon:jsxRuntimeExports.jsx(DebuggerIcon,{}),label:"Debugger",secondary:"Configure breakpoints and other debugging options here. First, you'll need to load a trace."})}),jsxRuntimeExports.jsx(ne.Extras,{children:oe})]})})}const scriptRel="modulepreload",assetsURL=function(ne,oe){return new URL(ne,oe).href},seen={},__vitePreload=function(oe,ce,ue){if(!ce||ce.length===0)return oe();const pe=document.getElementsByTagName("link");return Promise.all(ce.map(me=>{if(me=assetsURL(me,ue),me in seen)return;seen[me]=!0;const ge=me.endsWith(".css"),ye=ge?'[rel="stylesheet"]':"";if(!!ue)for(let _e=pe.length-1;_e>=0;_e--){const Se=pe[_e];if(Se.href===me&&(!ge||Se.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${me}"]${ye}`))return;const xe=document.createElement("link");if(xe.rel=ge?"stylesheet":scriptRel,ge||(xe.as="script",xe.crossOrigin=""),xe.href=me,document.head.appendChild(xe),ge)return new Promise((_e,Se)=>{xe.addEventListener("load",_e),xe.addEventListener("error",()=>Se(new Error(`Unable to preload CSS for ${me}`)))})})).then(()=>oe()).catch(me=>{const ge=new Event("vite:preloadError",{cancelable:!0});if(ge.payload=me,window.dispatchEvent(ge),!ge.defaultPrevented)throw me})},EXCLUDED_NAMES=["PropTypes"],getSlotProps=(ne,oe)=>reactExports.Children.toArray(ne).reduce((ce,ue)=>{if(reactExports.isValidElement(ue)){const pe=ue.type.displayName;ce[pe]=ue.props}return ce},{}),getCleanChildren=(ne,oe)=>{const ce=reactExports.Children.toArray(ne).filter(ue=>{if(reactExports.isValidElement(ue)){const pe=ue.type.displayName;return!(oe!=null&&oe.includes(pe))}return!0});return ce.length>0?ce:void 0},isComponentName=ne=>typeof ne=="string"&&!EXCLUDED_NAMES.includes(ne)&&ne.match(/^[A-Z0-9]/),createResultComponent=ne=>reactExports.memo(ce=>{const{children:ue,propagateSlotProps:pe,slotKeys:me=[],...ge}=ce,ye=reactExports.useMemo(()=>getSlotProps(ue),[me,ue]),ve=reactExports.useMemo(()=>getCleanChildren(ue,me),[me,ue]),xe=reactExports.useMemo(()=>({...ge,slotProps:{...pe,...ye}}),[ge,ye,pe]);return reactExports.createElement(ne,xe,ve)}),withSlots=ne=>{const oe=reactExports.memo(createResultComponent(ne));return oe.displayName=`WithSlots(${ne.displayName||ne.name})`,new Proxy(oe,{get(ue,pe,me){var ve;if(pe in ue||typeof pe=="symbol"||!isComponentName(pe))return Reflect.get(ue,pe,me);const ge=((ve=Reflect.get(ue,"defaultProps"))==null?void 0:ve.slotKeys)||[];if(!Reflect.get(ue,pe)){const xe=()=>null;xe.displayName=pe,Reflect.set(ue,pe,xe)}return Reflect.set(ue,"defaultProps",{...ue.defaultProps,slotKeys:[...ge,pe]}),Reflect.get(ue,pe,me)}})};function wait(ne){return new Promise(oe=>lodashExports$1.delay(oe,ne))}async function timed(ne,oe=2500){const ce=lodashExports$1.now();return{result:await Promise.any([ne(),wait(oe)]),delta:lodashExports$1.now()-ce}}const FullscreenModalContext=reactExports.createContext({});function useFullscreenModalContext(){return reactExports.useContext(FullscreenModalContext)}const FullscreenPage=withSlots(({slotProps:ne})=>{var ue,pe,me,ge;const oe=useSmallDisplay(),ce=useAcrylic();return jsxRuntimeExports.jsxs(Stack$1,{sx:{height:oe?"calc(100% - 56px)":"100%",minHeight:"70dvh"},children:[!!((ue=ne.Options)!=null&&ue.children)&&jsxRuntimeExports.jsx(Stack$1,{sx:{minHeight:ye=>ye.spacing(6),flex:0},children:jsxRuntimeExports.jsxs(Stack$1,{direction:"row",sx:{p:0,zIndex:1,width:"100%",borderBottom:1,borderColor:"divider",alignItems:"center",pr:oe?0:6,...ce,background:ye=>`linear-gradient(to bottom, ${ye.palette.background.paper}, ${alpha$1(ye.palette.background.paper,.75)})`},children:[jsxRuntimeExports.jsx(Scroll,{x:!0,children:jsxRuntimeExports.jsx(Flex,{sx:{width:"max-content",height:ye=>ye.spacing(6),alignItems:"center",p:1},children:((pe=ne.Options)==null?void 0:pe.children)&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:ne.Options.children})})}),(me=ne.Extras)==null?void 0:me.children]})}),jsxRuntimeExports.jsx(Box$1,{sx:{bgcolor:"background.paper",mt:-6,flex:1,position:"relative"},children:jsxRuntimeExports.jsx(Scroll,{y:!0,style:{height:"100%",position:"absolute"},children:(ge=ne.Content)==null?void 0:ge.children})})]})});function FullscreenModalHost(){const[{fullscreenModal:ne},oe]=useUIState(),[ce,ue]=reactExports.useState(!1),pe=reactExports.useCallback(async function(){ue(!0),await wait(300),oe(()=>({fullscreenModal:void 0})),ue(!1)},[oe]),me=reactExports.useMemo(()=>({close:pe}),[pe]),ge=ne?pages[ne]:void 0,ye=reactExports.useMemo(()=>{if(ge){const ve=ge.content,xe=withSlots(({slotProps:_e,...Se})=>{var $e,Re,Ae;return jsxRuntimeExports.jsxs(FullscreenPage,{...Se,children:[jsxRuntimeExports.jsx(FullscreenPage.Content,{children:($e=_e.Content)==null?void 0:$e.children}),jsxRuntimeExports.jsx(FullscreenPage.Options,{children:(Re=_e.Options)==null?void 0:Re.children}),jsxRuntimeExports.jsx(FullscreenPage.Extras,{children:(Ae=_e.Extras)==null?void 0:Ae.children})]})});return jsxRuntimeExports.jsx(ve,{template:xe})}},[ne,ge]);return jsxRuntimeExports.jsx(FullscreenModalContext.Provider,{value:me,children:!!ge&&jsxRuntimeExports.jsxs(Modal,{open:!ce,onClose:pe,width:"70vw",children:[jsxRuntimeExports.jsx(ModalAppBar,{onClose:pe,children:jsxRuntimeExports.jsx(Type$2,{component:"div",variant:"h6",children:ge.name})}),ye]})})}var download$1={exports:{}};(function(ne,oe){(function(ce,ue){ne.exports=ue()})(commonjsGlobal,function(){return function ce(ue,pe,me){var ge=window,ye="application/octet-stream",ve=me||ye,xe=ue,_e=!pe&&!me&&xe,Se=document.createElement("a"),$e=function(ze){return String(ze)},Re=ge.Blob||ge.MozBlob||ge.WebKitBlob||$e,Ae=pe||"download",Ie,ke;if(Re=Re.call?Re.bind(ge):Blob,String(this)==="true"&&(xe=[xe,ve],ve=xe[0],xe=xe[1]),_e&&_e.length<2048&&(Ae=_e.split("/").pop().split("?")[0],Se.href=_e,Se.href.indexOf(_e)!==-1)){var Be=new XMLHttpRequest;return Be.open("GET",_e,!0),Be.responseType="blob",Be.onload=function(ze){ce(ze.target.response,Ae,ye)},setTimeout(function(){Be.send()},0),Be}if(/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(xe))if(xe.length>1024*1024*1.999&&Re!==$e)xe=We(xe),ve=xe.type||ye;else return navigator.msSaveBlob?navigator.msSaveBlob(We(xe),Ae):qe(xe);else if(/([\x80-\xff])/.test(xe)){var Ne=0,Fe=new Uint8Array(xe.length),Ue=Fe.length;for(Ne;Ne0)throw new Error("Invalid string. Length must be a multiple of 4");var ce=ne.indexOf("=");ce===-1&&(ce=oe);var ue=ce===oe?0:4-ce%4;return[ce,ue]}function byteLength$2(ne){var oe=getLens(ne),ce=oe[0],ue=oe[1];return(ce+ue)*3/4-ue}function _byteLength(ne,oe,ce){return(oe+ce)*3/4-ce}function toByteArray(ne){var oe,ce=getLens(ne),ue=ce[0],pe=ce[1],me=new Arr(_byteLength(ne,ue,pe)),ge=0,ye=pe>0?ue-4:ue,ve;for(ve=0;ve>16&255,me[ge++]=oe>>8&255,me[ge++]=oe&255;return pe===2&&(oe=revLookup[ne.charCodeAt(ve)]<<2|revLookup[ne.charCodeAt(ve+1)]>>4,me[ge++]=oe&255),pe===1&&(oe=revLookup[ne.charCodeAt(ve)]<<10|revLookup[ne.charCodeAt(ve+1)]<<4|revLookup[ne.charCodeAt(ve+2)]>>2,me[ge++]=oe>>8&255,me[ge++]=oe&255),me}function tripletToBase64(ne){return lookup$2[ne>>18&63]+lookup$2[ne>>12&63]+lookup$2[ne>>6&63]+lookup$2[ne&63]}function encodeChunk(ne,oe,ce){for(var ue,pe=[],me=oe;meye?ye:ge+me));return ue===1?(oe=ne[ce-1],pe.push(lookup$2[oe>>2]+lookup$2[oe<<4&63]+"==")):ue===2&&(oe=(ne[ce-2]<<8)+ne[ce-1],pe.push(lookup$2[oe>>10]+lookup$2[oe>>4&63]+lookup$2[oe<<2&63]+"=")),pe.join("")}var ieee754={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ieee754.read=function(ne,oe,ce,ue,pe){var me,ge,ye=pe*8-ue-1,ve=(1<>1,_e=-7,Se=ce?pe-1:0,$e=ce?-1:1,Re=ne[oe+Se];for(Se+=$e,me=Re&(1<<-_e)-1,Re>>=-_e,_e+=ye;_e>0;me=me*256+ne[oe+Se],Se+=$e,_e-=8);for(ge=me&(1<<-_e)-1,me>>=-_e,_e+=ue;_e>0;ge=ge*256+ne[oe+Se],Se+=$e,_e-=8);if(me===0)me=1-xe;else{if(me===ve)return ge?NaN:(Re?-1:1)*(1/0);ge=ge+Math.pow(2,ue),me=me-xe}return(Re?-1:1)*ge*Math.pow(2,me-ue)};ieee754.write=function(ne,oe,ce,ue,pe,me){var ge,ye,ve,xe=me*8-pe-1,_e=(1<>1,$e=pe===23?Math.pow(2,-24)-Math.pow(2,-77):0,Re=ue?0:me-1,Ae=ue?1:-1,Ie=oe<0||oe===0&&1/oe<0?1:0;for(oe=Math.abs(oe),isNaN(oe)||oe===1/0?(ye=isNaN(oe)?1:0,ge=_e):(ge=Math.floor(Math.log(oe)/Math.LN2),oe*(ve=Math.pow(2,-ge))<1&&(ge--,ve*=2),ge+Se>=1?oe+=$e/ve:oe+=$e*Math.pow(2,1-Se),oe*ve>=2&&(ge++,ve/=2),ge+Se>=_e?(ye=0,ge=_e):ge+Se>=1?(ye=(oe*ve-1)*Math.pow(2,pe),ge=ge+Se):(ye=oe*Math.pow(2,Se-1)*Math.pow(2,pe),ge=0));pe>=8;ne[ce+Re]=ye&255,Re+=Ae,ye/=256,pe-=8);for(ge=ge<0;ne[ce+Re]=ge&255,Re+=Ae,ge/=256,xe-=8);ne[ce+Re-Ae]|=Ie*128};/*! * The buffer module from node.js, for the browser. @@ -2441,7 +2441,7 @@ void main(void)\r `+Nt.split(` `).map(function(Jt){return" "+Jt}).join(` `)):Nt=Wt.stylize("[Circular]","special")),ze(Cn)){if(Sn&&vn.match(/^\d+$/))return Nt;(Cn=JSON.stringify(""+vn)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(Cn=Cn.substr(1,Cn.length-2),Cn=Wt.stylize(Cn,"name")):(Cn=Cn.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),Cn=Wt.stylize(Cn,"string"))}return Cn+": "+Nt}function Ne(Wt){return Array.isArray(Wt)}function Fe(Wt){return typeof Wt=="boolean"}function Ue(Wt){return Wt===null}function We(Wt){return typeof Wt=="number"}function qe(Wt){return typeof Wt=="string"}function ze(Wt){return Wt===void 0}function Ge(Wt){return Ze(Wt)&&jt(Wt)==="[object RegExp]"}function Ze(Wt){return typeof Wt=="object"&&Wt!==null}function Dt(Wt){return Ze(Wt)&&jt(Wt)==="[object Date]"}function Je(Wt){return Ze(Wt)&&(jt(Wt)==="[object Error]"||Wt instanceof Error)}function Ut(Wt){return typeof Wt=="function"}function jt(Wt){return Object.prototype.toString.call(Wt)}function Ke(Wt){return Wt<10?"0"+Wt.toString(10):Wt.toString(10)}me.debuglog=function(Wt){if(Wt=Wt.toUpperCase(),!xe[Wt])if(_e.test(Wt)){var un=ge.pid;xe[Wt]=function(){var Xt=me.format.apply(me,arguments);console.error("%s %d: %s",Wt,un,Xt)}}else xe[Wt]=function(){};return xe[Wt]},me.inspect=$e,$e.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},$e.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},me.types=ue("./support/types"),me.isArray=Ne,me.isBoolean=Fe,me.isNull=Ue,me.isNullOrUndefined=function(Wt){return Wt==null},me.isNumber=We,me.isString=qe,me.isSymbol=function(Wt){return typeof Wt=="symbol"},me.isUndefined=ze,me.isRegExp=Ge,me.types.isRegExp=Ge,me.isObject=Ze,me.isDate=Dt,me.types.isDate=Dt,me.isError=Je,me.types.isNativeError=Je,me.isFunction=Ut,me.isPrimitive=function(Wt){return Wt===null||typeof Wt=="boolean"||typeof Wt=="number"||typeof Wt=="string"||typeof Wt=="symbol"||Wt===void 0},me.isBuffer=ue("./support/isBuffer");var an=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Zt(Wt,un){return Object.prototype.hasOwnProperty.call(Wt,un)}me.log=function(){var Wt,un;console.log("%s - %s",(Wt=new Date,un=[Ke(Wt.getHours()),Ke(Wt.getMinutes()),Ke(Wt.getSeconds())].join(":"),[Wt.getDate(),an[Wt.getMonth()],un].join(" ")),me.format.apply(me,arguments))},me.inherits=ue("inherits"),me._extend=function(Wt,un){if(!un||!Ze(un))return Wt;for(var Xt=Object.keys(un),nn=Xt.length;nn--;)Wt[Xt[nn]]=un[Xt[nn]];return Wt};var en=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;function Kt(Wt,un){if(!Wt){var Xt=new Error("Promise was rejected with a falsy value");Xt.reason=Wt,Wt=Xt}return un(Wt)}me.promisify=function(Wt){if(typeof Wt!="function")throw new TypeError('The "original" argument must be of type Function');if(en&&Wt[en]){var un;if(typeof(un=Wt[en])!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(un,en,{value:un,enumerable:!1,writable:!1,configurable:!0}),un}function un(){for(var Xt,nn,vn=new Promise(function(Nt,Yt){Xt=Nt,nn=Yt}),Sn=[],Cn=0;Cn{var oe=ne.exports={};oe.nextTick=function(){var ce=typeof window<"u"&&window.setImmediate,ue=typeof window<"u"&&window.postMessage&&window.addEventListener;if(ce)return function(me){return window.setImmediate(me)};if(ue){var pe=[];return window.addEventListener("message",function(me){var ge=me.source;ge!==window&&ge!==null||me.data!=="process-tick"||(me.stopPropagation(),pe.length>0&&pe.shift()())},!0),function(me){pe.push(me),window.postMessage("process-tick","*")}}return function(me){setTimeout(me,0)}}(),oe.title="browser",oe.browser=!0,oe.env={},oe.argv=[],oe.binding=function(ce){throw new Error("process.binding is not supported")},oe.cwd=function(){return"/"},oe.chdir=function(ce){throw new Error("process.chdir is not supported")}},6197:(ne,oe,ce)=>{var ue=ce(8834).lW;Object.defineProperty(oe,"__esModule",{value:!0}),oe.AbstractTokenizer=void 0;const pe=ce(4644);oe.AbstractTokenizer=class{constructor(me){this.position=0,this.numBuffer=new Uint8Array(8),this.fileInfo=me||{}}async readToken(me,ge=this.position){const ye=ue.alloc(me.len);if(await this.readBuffer(ye,{position:ge})ge)return this.position+=ge,ge}return this.position+=me,me}async close(){}normalizeOptions(me,ge){if(ge&&ge.position!==void 0&&ge.position{Object.defineProperty(oe,"__esModule",{value:!0}),oe.BufferTokenizer=void 0;const ue=ce(4644),pe=ce(6197);class me extends pe.AbstractTokenizer{constructor(ye,ve){super(ve),this.uint8Array=ye,this.fileInfo.size=this.fileInfo.size?this.fileInfo.size:ye.length}async readBuffer(ye,ve){if(ve&&ve.position){if(ve.position{Object.defineProperty(oe,"__esModule",{value:!0}),oe.fromFile=oe.FileTokenizer=void 0;const ue=ce(6197),pe=ce(4644),me=ce(5187);class ge extends ue.AbstractTokenizer{constructor(ve,xe){super(xe),this.fd=ve}async readBuffer(ve,xe){const _e=this.normalizeOptions(ve,xe);this.position=_e.position;const Se=await me.read(this.fd,ve,_e.offset,_e.length,_e.position);if(this.position+=Se.bytesRead,Se.bytesRead<_e.length&&(!xe||!xe.mayBeLess))throw new pe.EndOfStreamError;return Se.bytesRead}async peekBuffer(ve,xe){const _e=this.normalizeOptions(ve,xe),Se=await me.read(this.fd,ve,_e.offset,_e.length,_e.position);if(!_e.mayBeLess&&Se.bytesRead<_e.length)throw new pe.EndOfStreamError;return Se.bytesRead}async close(){return me.close(this.fd)}}oe.FileTokenizer=ge,oe.fromFile=async function(ye){const ve=await me.stat(ye);if(!ve.isFile)throw new Error(`File not a file: ${ye}`);const xe=await me.open(ye,"r");return new ge(xe,{path:ye,size:ve.size})}},5187:(ne,oe,ce)=>{Object.defineProperty(oe,"__esModule",{value:!0}),oe.readFile=oe.writeFileSync=oe.writeFile=oe.read=oe.open=oe.close=oe.stat=oe.createReadStream=oe.pathExists=void 0;const ue=ce(6777);oe.pathExists=ue.existsSync,oe.createReadStream=ue.createReadStream,oe.stat=async function(pe){return new Promise((me,ge)=>{ue.stat(pe,(ye,ve)=>{ye?ge(ye):me(ve)})})},oe.close=async function(pe){return new Promise((me,ge)=>{ue.close(pe,ye=>{ye?ge(ye):me()})})},oe.open=async function(pe,me){return new Promise((ge,ye)=>{ue.open(pe,me,(ve,xe)=>{ve?ye(ve):ge(xe)})})},oe.read=async function(pe,me,ge,ye,ve){return new Promise((xe,_e)=>{ue.read(pe,me,ge,ye,ve,(Se,$e,Re)=>{Se?_e(Se):xe({bytesRead:$e,buffer:Re})})})},oe.writeFile=async function(pe,me){return new Promise((ge,ye)=>{ue.writeFile(pe,me,ve=>{ve?ye(ve):ge()})})},oe.writeFileSync=function(pe,me){ue.writeFileSync(pe,me)},oe.readFile=async function(pe){return new Promise((me,ge)=>{ue.readFile(pe,(ye,ve)=>{ye?ge(ye):me(ve)})})}},8286:(ne,oe,ce)=>{Object.defineProperty(oe,"__esModule",{value:!0}),oe.ReadStreamTokenizer=void 0;const ue=ce(6197),pe=ce(4644);class me extends ue.AbstractTokenizer{constructor(ye,ve){super(ve),this.streamReader=new pe.StreamReader(ye)}async getFileInfo(){return this.fileInfo}async readBuffer(ye,ve){const xe=this.normalizeOptions(ye,ve),_e=xe.position-this.position;if(_e>0)return await this.ignore(_e),this.readBuffer(ye,ve);if(_e<0)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");if(xe.length===0)return 0;const Se=await this.streamReader.read(ye,xe.offset,xe.length);if(this.position+=Se,(!ve||!ve.mayBeLess)&&Se0){const $e=new Uint8Array(xe.length+Se);return _e=await this.peekBuffer($e,{mayBeLess:xe.mayBeLess}),ye.set($e.subarray(Se),xe.offset),_e-Se}if(Se<0)throw new Error("Cannot peek from a negative offset in a stream")}if(xe.length>0){try{_e=await this.streamReader.peek(ye,xe.offset,xe.length)}catch(Se){if(ve&&ve.mayBeLess&&Se instanceof pe.EndOfStreamError)return 0;throw Se}if(!xe.mayBeLess&&_e{Object.defineProperty(oe,"__esModule",{value:!0}),oe.fromBuffer=oe.fromStream=oe.EndOfStreamError=void 0;const ue=ce(8286),pe=ce(932);var me=ce(4644);Object.defineProperty(oe,"EndOfStreamError",{enumerable:!0,get:function(){return me.EndOfStreamError}}),oe.fromStream=function(ge,ye){return ye=ye||{},new ue.ReadStreamTokenizer(ge,ye)},oe.fromBuffer=function(ge,ye){return new pe.BufferTokenizer(ge,ye)}},3569:(ne,oe,ce)=>{Object.defineProperty(oe,"__esModule",{value:!0}),oe.fromStream=oe.fromBuffer=oe.EndOfStreamError=oe.fromFile=void 0;const ue=ce(5187),pe=ce(7378);var me=ce(9425);Object.defineProperty(oe,"fromFile",{enumerable:!0,get:function(){return me.fromFile}});var ge=ce(7378);Object.defineProperty(oe,"EndOfStreamError",{enumerable:!0,get:function(){return ge.EndOfStreamError}}),Object.defineProperty(oe,"fromBuffer",{enumerable:!0,get:function(){return ge.fromBuffer}}),oe.fromStream=async function(ye,ve){if(ve=ve||{},ye.path){const xe=await ue.stat(ye.path);ve.path=ye.path,ve.size=xe.size}return pe.fromStream(ye,ve)}},643:(ne,oe)=>{var ce=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(xe){return typeof xe}:function(xe){return xe&&typeof Symbol=="function"&&xe.constructor===Symbol&&xe!==Symbol.prototype?"symbol":typeof xe};oe.Ee=function(xe,_e,Se,$e,Re,Ae){for(var Ie=arguments.length,ke=Array(Ie>6?Ie-6:0),Be=6;Be3?Ae-3:0),ke=3;ke{var ue=ce(8834).lW;Object.defineProperty(oe,"__esModule",{value:!0}),oe.AnsiStringType=oe.StringType=oe.BufferType=oe.Uint8ArrayType=oe.IgnoreType=oe.Float80_LE=oe.Float80_BE=oe.Float64_LE=oe.Float64_BE=oe.Float32_LE=oe.Float32_BE=oe.Float16_LE=oe.Float16_BE=oe.INT64_BE=oe.UINT64_BE=oe.INT64_LE=oe.UINT64_LE=oe.INT32_LE=oe.INT32_BE=oe.INT24_BE=oe.INT24_LE=oe.INT16_LE=oe.INT16_BE=oe.INT8=oe.UINT32_BE=oe.UINT32_LE=oe.UINT24_BE=oe.UINT24_LE=oe.UINT16_BE=oe.UINT16_LE=oe.UINT8=void 0;const pe=ce(2333);function me(ye){return new DataView(ye.buffer,ye.byteOffset)}oe.UINT8={len:1,get:(ye,ve)=>me(ye).getUint8(ve),put:(ye,ve,xe)=>(me(ye).setUint8(ve,xe),ve+1)},oe.UINT16_LE={len:2,get:(ye,ve)=>me(ye).getUint16(ve,!0),put:(ye,ve,xe)=>(me(ye).setUint16(ve,xe,!0),ve+2)},oe.UINT16_BE={len:2,get:(ye,ve)=>me(ye).getUint16(ve),put:(ye,ve,xe)=>(me(ye).setUint16(ve,xe),ve+2)},oe.UINT24_LE={len:3,get(ye,ve){const xe=me(ye);return xe.getUint8(ve)+(xe.getUint16(ve+1,!0)<<8)},put(ye,ve,xe){const _e=me(ye);return _e.setUint8(ve,255&xe),_e.setUint16(ve+1,xe>>8,!0),ve+3}},oe.UINT24_BE={len:3,get(ye,ve){const xe=me(ye);return(xe.getUint16(ve)<<8)+xe.getUint8(ve+2)},put(ye,ve,xe){const _e=me(ye);return _e.setUint16(ve,xe>>8),_e.setUint8(ve+2,255&xe),ve+3}},oe.UINT32_LE={len:4,get:(ye,ve)=>me(ye).getUint32(ve,!0),put:(ye,ve,xe)=>(me(ye).setUint32(ve,xe,!0),ve+4)},oe.UINT32_BE={len:4,get:(ye,ve)=>me(ye).getUint32(ve),put:(ye,ve,xe)=>(me(ye).setUint32(ve,xe),ve+4)},oe.INT8={len:1,get:(ye,ve)=>me(ye).getInt8(ve),put:(ye,ve,xe)=>(me(ye).setInt8(ve,xe),ve+1)},oe.INT16_BE={len:2,get:(ye,ve)=>me(ye).getInt16(ve),put:(ye,ve,xe)=>(me(ye).setInt16(ve,xe),ve+2)},oe.INT16_LE={len:2,get:(ye,ve)=>me(ye).getInt16(ve,!0),put:(ye,ve,xe)=>(me(ye).setInt16(ve,xe,!0),ve+2)},oe.INT24_LE={len:3,get(ye,ve){const xe=oe.UINT24_LE.get(ye,ve);return xe>8388607?xe-16777216:xe},put(ye,ve,xe){const _e=me(ye);return _e.setUint8(ve,255&xe),_e.setUint16(ve+1,xe>>8,!0),ve+3}},oe.INT24_BE={len:3,get(ye,ve){const xe=oe.UINT24_BE.get(ye,ve);return xe>8388607?xe-16777216:xe},put(ye,ve,xe){const _e=me(ye);return _e.setUint16(ve,xe>>8),_e.setUint8(ve+2,255&xe),ve+3}},oe.INT32_BE={len:4,get:(ye,ve)=>me(ye).getInt32(ve),put:(ye,ve,xe)=>(me(ye).setInt32(ve,xe),ve+4)},oe.INT32_LE={len:4,get:(ye,ve)=>me(ye).getInt32(ve,!0),put:(ye,ve,xe)=>(me(ye).setInt32(ve,xe,!0),ve+4)},oe.UINT64_LE={len:8,get:(ye,ve)=>me(ye).getBigUint64(ve,!0),put:(ye,ve,xe)=>(me(ye).setBigUint64(ve,xe,!0),ve+8)},oe.INT64_LE={len:8,get:(ye,ve)=>me(ye).getBigInt64(ve,!0),put:(ye,ve,xe)=>(me(ye).setBigInt64(ve,xe,!0),ve+8)},oe.UINT64_BE={len:8,get:(ye,ve)=>me(ye).getBigUint64(ve),put:(ye,ve,xe)=>(me(ye).setBigUint64(ve,xe),ve+8)},oe.INT64_BE={len:8,get:(ye,ve)=>me(ye).getBigInt64(ve),put:(ye,ve,xe)=>(me(ye).setBigInt64(ve,xe),ve+8)},oe.Float16_BE={len:2,get(ye,ve){return pe.read(ye,ve,!1,10,this.len)},put(ye,ve,xe){return pe.write(ye,xe,ve,!1,10,this.len),ve+this.len}},oe.Float16_LE={len:2,get(ye,ve){return pe.read(ye,ve,!0,10,this.len)},put(ye,ve,xe){return pe.write(ye,xe,ve,!0,10,this.len),ve+this.len}},oe.Float32_BE={len:4,get:(ye,ve)=>me(ye).getFloat32(ve),put:(ye,ve,xe)=>(me(ye).setFloat32(ve,xe),ve+4)},oe.Float32_LE={len:4,get:(ye,ve)=>me(ye).getFloat32(ve,!0),put:(ye,ve,xe)=>(me(ye).setFloat32(ve,xe,!0),ve+4)},oe.Float64_BE={len:8,get:(ye,ve)=>me(ye).getFloat64(ve),put:(ye,ve,xe)=>(me(ye).setFloat64(ve,xe),ve+8)},oe.Float64_LE={len:8,get:(ye,ve)=>me(ye).getFloat64(ve,!0),put:(ye,ve,xe)=>(me(ye).setFloat64(ve,xe,!0),ve+8)},oe.Float80_BE={len:10,get(ye,ve){return pe.read(ye,ve,!1,63,this.len)},put(ye,ve,xe){return pe.write(ye,xe,ve,!1,63,this.len),ve+this.len}},oe.Float80_LE={len:10,get(ye,ve){return pe.read(ye,ve,!0,63,this.len)},put(ye,ve,xe){return pe.write(ye,xe,ve,!0,63,this.len),ve+this.len}},oe.IgnoreType=class{constructor(ye){this.len=ye}get(ye,ve){}},oe.Uint8ArrayType=class{constructor(ye){this.len=ye}get(ye,ve){return ye.subarray(ve,ve+this.len)}},oe.BufferType=class{constructor(ye){this.len=ye}get(ye,ve){return ue.from(ye.subarray(ve,ve+this.len))}},oe.StringType=class{constructor(ye,ve){this.len=ye,this.encoding=ve}get(ye,ve){return ue.from(ye).toString(this.encoding,ve,ve+this.len)}};class ge{constructor(ve){this.len=ve}static decode(ve,xe,_e){let Se="";for(let $e=xe;$e<_e;++$e)Se+=ge.codePointToString(ge.singleByteDecoder(ve[$e]));return Se}static inRange(ve,xe,_e){return xe<=ve&&ve<=_e}static codePointToString(ve){return ve<=65535?String.fromCharCode(ve):(ve-=65536,String.fromCharCode(55296+(ve>>10),56320+(1023&ve)))}static singleByteDecoder(ve){if(ge.inRange(ve,0,127))return ve;const xe=ge.windows1252[ve-128];if(xe===null)throw Error("invaliding encoding");return xe}get(ve,xe=0){return ge.decode(ve,xe,xe+this.len)}}oe.AnsiStringType=ge,ge.windows1252=[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,381,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,382,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255]},311:(ne,oe)=>{(oe=ne.exports=function(ce){return ce.replace(/^\s*|\s*$/g,"")}).left=function(ce){return ce.replace(/^\s*/,"")},oe.right=function(ce){return ce.replace(/\s*$/,"")}},9299:(ne,oe,ce)=>{var ue=ce(4406);(function(){var pe={};function me(){ue===void 0&&console.log.apply(console,arguments)}ne.exports=pe,function(ge,ye){var ve,xe,_e,Se,$e,Re,Ae,Ie,ke,Be,Ne,Fe,Ue,We,qe;(function(){var ze=function(){function Dt(Je){this.message="JPEG error: "+Je}return Dt.prototype=new Error,Dt.prototype.name="JpegError",Dt.constructor=Dt,Dt}(),Ge=function(){var Dt=new Uint8Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),Je=4017,Ut=799,jt=3406,Ke=2276,an=1567,Zt=3784,en=5793,Kt=2896;function Wt(Nt){Nt==null&&(Nt={}),Nt.w==null&&(Nt.w=-1),this.V=Nt.n,this.N=Nt.w}function un(Nt,Yt){for(var Jt,hn,Ye,Xe=0,Pt=[],sn=16;sn>0&&!Nt[sn-1];)sn--;Pt.push({children:[],index:0});var yn=Pt[0];for(Jt=0;Jt0;)yn=Pt.pop();for(yn.index++,Pt.push(yn);Pt.length<=Jt;)Pt.push(Ye={children:[],index:0}),yn.children[yn.index]=Ye.children,yn=Ye;Xe++}Jt+10)return kn--,bn>>kn&1;if((bn=Nt[Yt++])===255){var nr=Nt[Yt++];if(nr){if(nr===220&&qt){var kr=Ze(Nt,Yt+=2);if(Yt+=2,kr>0&&kr!==Jt.s)throw new DNLMarkerError("Found DNL marker (0xFFDC) while parsing scan data",kr)}else if(nr===217){if(qt){var Mr=8*dn;if(Mr>0&&Mr>>7}function Pn(nr){for(var kr=nr;;){switch(typeof(kr=kr[mn()])){case"number":return kr;case"object":continue}throw new ze("invalid huffman sequence")}}function ur(nr){for(var kr=0;nr>0;)kr=kr<<1|mn(),nr--;return kr}function er(nr){if(nr===1)return mn()===1?1:-1;var kr=ur(nr);return kr>=1<0)jn--;else for(var Mr=Xe,Rr=Pt;Mr<=Rr;){var Yr=Pn(nr.i),li=15&Yr,ei=Yr>>4;if(li!==0){var Pr=Dt[Mr+=ei];nr.D[kr+Pr]=er(li)*(1<>4,(Mr=15&Rr)==0)ei<15?(jn=ur(ei)+(1<>4;if(ei!==0){var hi=Dt[Yr+=Pr];nr.D[kr+hi]=er(ei),Yr++}else{if(Pr<15)break;Yr+=16}}},Mn=Sr===1?hn[0].P*hn[0].c:pn*Jt.R;Bn<=Mn;){var sr=Ye?Math.min(Mn-Bn,Ye):Mn;if(sr>0){for(xn=0;xn=65488&&Rn.M<=65495)))break;Yt+=2}return Yt-Gt}function vn(Nt,Yt,Jt){var hn,Ye,Xe,Pt,sn,yn,qt,wn,Tn,xn,Nn,zn,Yn,Kn,Rn,Mn,Xn,Jn=Nt.$,pn=Nt.D;if(!Jn)throw new ze("missing required Quantization Table.");for(var tn=0;tn<64;tn+=8)Tn=pn[Yt+tn],xn=pn[Yt+tn+1],Nn=pn[Yt+tn+2],zn=pn[Yt+tn+3],Yn=pn[Yt+tn+4],Kn=pn[Yt+tn+5],Rn=pn[Yt+tn+6],Mn=pn[Yt+tn+7],Tn*=Jn[tn],xn|Nn|zn|Yn|Kn|Rn|Mn?(xn*=Jn[tn+1],Nn*=Jn[tn+2],zn*=Jn[tn+3],Yn*=Jn[tn+4],Kn*=Jn[tn+5],Rn*=Jn[tn+6],Mn*=Jn[tn+7],Ye=(hn=(hn=en*Tn+128>>8)+(Ye=en*Yn+128>>8)+1>>1)-Ye,Xn=(Xe=Nn)*Zt+(Pt=Rn)*an+128>>8,Xe=Xe*an-Pt*Zt+128>>8,qt=(sn=(sn=Kt*(xn-Mn)+128>>8)+(qt=Kn<<4)+1>>1)-qt,yn=(wn=(wn=Kt*(xn+Mn)+128>>8)+(yn=zn<<4)+1>>1)-yn,Pt=(hn=hn+(Pt=Xn)+1>>1)-Pt,Xe=(Ye=Ye+Xe+1>>1)-Xe,Xn=sn*Ke+wn*jt+2048>>12,sn=sn*jt-wn*Ke+2048>>12,wn=Xn,Xn=yn*Ut+qt*Je+2048>>12,yn=yn*Je-qt*Ut+2048>>12,qt=Xn,Jt[tn]=hn+wn,Jt[tn+7]=hn-wn,Jt[tn+1]=Ye+qt,Jt[tn+6]=Ye-qt,Jt[tn+2]=Xe+yn,Jt[tn+5]=Xe-yn,Jt[tn+3]=Pt+sn,Jt[tn+4]=Pt-sn):(Xn=en*Tn+512>>10,Jt[tn]=Xn,Jt[tn+1]=Xn,Jt[tn+2]=Xn,Jt[tn+3]=Xn,Jt[tn+4]=Xn,Jt[tn+5]=Xn,Jt[tn+6]=Xn,Jt[tn+7]=Xn);for(var Gt=0;Gt<8;++Gt)Tn=Jt[Gt],(xn=Jt[Gt+8])|(Nn=Jt[Gt+16])|(zn=Jt[Gt+24])|(Yn=Jt[Gt+32])|(Kn=Jt[Gt+40])|(Rn=Jt[Gt+48])|(Mn=Jt[Gt+56])?(Ye=(hn=4112+((hn=en*Tn+2048>>12)+(Ye=en*Yn+2048>>12)+1>>1))-Ye,Xn=(Xe=Nn)*Zt+(Pt=Rn)*an+2048>>12,Xe=Xe*an-Pt*Zt+2048>>12,Pt=Xn,qt=(sn=(sn=Kt*(xn-Mn)+2048>>12)+(qt=Kn)+1>>1)-qt,yn=(wn=(wn=Kt*(xn+Mn)+2048>>12)+(yn=zn)+1>>1)-yn,Xn=sn*Ke+wn*jt+2048>>12,sn=sn*jt-wn*Ke+2048>>12,wn=Xn,Xn=yn*Ut+qt*Je+2048>>12,yn=yn*Je-qt*Ut+2048>>12,(Tn=(hn=hn+Pt+1>>1)+wn)<16?Tn=0:Tn>=4080?Tn=255:Tn>>=4,(xn=(Ye=Ye+Xe+1>>1)+(qt=Xn))<16?xn=0:xn>=4080?xn=255:xn>>=4,(Nn=(Xe=Ye-Xe)+yn)<16?Nn=0:Nn>=4080?Nn=255:Nn>>=4,(zn=(Pt=hn-Pt)+sn)<16?zn=0:zn>=4080?zn=255:zn>>=4,(Yn=Pt-sn)<16?Yn=0:Yn>=4080?Yn=255:Yn>>=4,(Kn=Xe-yn)<16?Kn=0:Kn>=4080?Kn=255:Kn>>=4,(Rn=Ye-qt)<16?Rn=0:Rn>=4080?Rn=255:Rn>>=4,(Mn=hn-wn)<16?Mn=0:Mn>=4080?Mn=255:Mn>>=4,pn[Yt+Gt]=Tn,pn[Yt+Gt+8]=xn,pn[Yt+Gt+16]=Nn,pn[Yt+Gt+24]=zn,pn[Yt+Gt+32]=Yn,pn[Yt+Gt+40]=Kn,pn[Yt+Gt+48]=Rn,pn[Yt+Gt+56]=Mn):(Xn=(Xn=en*Tn+8192>>14)<-2040?0:Xn>=2024?255:Xn+2056>>4,pn[Yt+Gt]=Xn,pn[Yt+Gt+8]=Xn,pn[Yt+Gt+16]=Xn,pn[Yt+Gt+24]=Xn,pn[Yt+Gt+32]=Xn,pn[Yt+Gt+40]=Xn,pn[Yt+Gt+48]=Xn,pn[Yt+Gt+56]=Xn)}function Sn(Nt,Yt){for(var Jt=Yt.P,hn=Yt.c,Ye=new Int16Array(64),Xe=0;Xe=hn)return null;var Xe=Ze(Nt,Yt);if(Xe>=65472&&Xe<=65534)return{u:null,M:Xe,offset:Yt};for(var Pt=Ze(Nt,Ye);!(Pt>=65472&&Pt<=65534);){if(++Ye>=hn)return null;Pt=Ze(Nt,Ye)}return{u:Xe.toString(16),M:Pt,offset:Ye}}return Wt.prototype={parse(Nt,Yt){Yt==null&&(Yt={});var Jt,hn,Ye=Yt.F,Xe=0,Pt=null,sn=null,yn=0;function qt(){var yi=Ze(Nt,Xe),Gi=(Xe+=2)+yi-2,gi=Cn(Nt,Gi,Xe);gi&&gi.u&&(Gi=gi.offset);var xi=Nt.subarray(Xe,Gi);return Xe+=xi.length,xi}function wn(yi){for(var Gi=Math.ceil(yi.o/8/yi.X),gi=Math.ceil(yi.s/8/yi.B),xi=0;xi>4){if(Jn>>4!=1)throw new ze("DQT - invalid table spec");for(Kn=0;Kn<64;Kn++)pn[Dt[Kn]]=Ze(Nt,Xe),Xe+=2}else for(Kn=0;Kn<64;Kn++)pn[Dt[Kn]]=Nt[Xe++];Tn[15&Jn]=pn}break;case 65472:case 65473:case 65474:if(Jt)throw new ze("Only single frame JPEGs supported");Xe+=2,(Jt={}).G=zn===65473,Jt.Z=zn===65474,Jt.precision=Nt[Xe++];var tn,Gt=Ze(Nt,Xe),bn=0,kn=0;Xe+=2,Jt.s=Ye||Gt,Jt.o=Ze(Nt,Xe),Xe+=2,Jt.W=[],Jt._={};var jn=Nt[Xe++];for(Yn=0;Yn>4,dn=15&Nt[Xe+1];bn>4?xn:Nn)[15&Pn]=un(ur,_r)}break;case 65501:hn=Ze(Nt,Xe+=2),Xe+=2;break;case 65498:var dr,Sr=++yn==1&&!Ye;Xe+=2;var sr=Nt[Xe++],nr=[];for(Yn=0;Yn>4],dr.i=xn[15&Rr],nr.push(dr)}var Yr=Nt[Xe++],li=Nt[Xe++],ei=Nt[Xe++];try{var Pr=nn(Nt,Xe,Jt,nr,hn,Yr,li,ei>>4,15&ei,Sr);Xe+=Pr}catch(yi){if(yi instanceof DNLMarkerError)return this.parse(Nt,{F:yi.s});if(yi instanceof EOIMarkerError)break e;throw yi}break;case 65500:Xe+=4;break;case 65535:Nt[Xe]!==255&&Xe--;break;default:var hi=Cn(Nt,Xe-2,Xe-3);if(hi&&hi.u){Xe=hi.offset;break}if(Xe>=Nt.length-1)break e;throw new ze("JpegImage.parse - unknown marker: "+zn.toString(16))}zn=Ze(Nt,Xe),Xe+=2}for(this.width=Jt.o,this.height=Jt.s,this.g=Pt,this.b=sn,this.W=[],Yn=0;Yn>8)+Gt[Tn+1];return Jn},get f(){return this.b?!!this.b.a:this.p===3?this.N!==0&&(this.W[0].index!==82||this.W[1].index!==71||this.W[2].index!==66):this.N===1},z:function(Nt){for(var Yt,Jt,hn,Ye=0,Xe=Nt.length;Ye4)throw new ze("Unsupported color mode");var Xe=this.Y(Yt,Jt,Ye);if(this.p===1&&hn){for(var Pt=Xe.length,sn=new Uint8ClampedArray(3*Pt),yn=0,qt=0;qt3&&(Ge.t258=Ge.t258.slice(0,3)),Ut=Ge.t258?Math.min(32,Ge.t258[0])*Ge.t258.length:Ge.t277?Ge.t277[0]:1,jt==1&&Ge.t279!=null&&Ge.t278&&Ge.t262[0]==32803&&(Ut=Math.round(8*Ge.t279[0]/(Ge.width*Ge.t278[0]))),Ge.t50885&&Ge.t50885[0]==4&&(Ut=3*Ge.t258[0]);var an=8*Math.ceil(Ge.width*Ut/8),Zt=Ge.t273;(Zt==null||Ge.t322)&&(Zt=Ge.t324);var en=Ge.t279;jt==1&&Zt.length==1&&(en=[Ge.height*(an>>>3)]),(en==null||Ge.t322)&&(en=Ge.t325);var Kt=new Uint8Array(Ge.height*(an>>>3)),Wt=0;if(Ge.t322!=null){var un=Ge.t322[0],Xt=Ge.t323[0],nn=Math.floor((Ge.width+un-1)/un),vn=Math.floor((Ge.height+Xt-1)/Xt),Sn=new Uint8Array(0|Math.ceil(un*Xt*Ut/8));console.log("====",nn,vn);for(var Cn=0;Cn>>3,vn=ze.t278?ze.t278[0]:ze.height,Sn=Math.ceil(un*Xt*ze.width/8);if(un==16&&!ze.isLE&&ze.t33422==null)for(var Cn=0;Cn>>8&255}else if(Xt==3)for(Zt=3;Zt>>3]>>>7-(7&Xt)&1;return un[1]++,nn}function jt(un,Xt){if(ze==null){ze={};for(var nn=0;nn>>=1;return un}function an(un,Xt){return un>>Xt}function Zt(un,Xt,nn,vn,Sn,Cn){Xt[nn]=an(an(11*un[Sn]-4*un[Sn+Cn]+un[Sn+Cn+Cn]+4,3)+un[vn],1),Xt[nn+Cn]=an(an(5*un[Sn]+4*un[Sn+Cn]-un[Sn+Cn+Cn]+4,3)-un[vn],1)}function en(un,Xt,nn,vn,Sn,Cn){var Nt=un[Sn-Cn]-un[Sn+Cn],Yt=un[Sn],Jt=un[vn];Xt[nn]=an(an(Nt+4,3)+Yt+Jt,1),Xt[nn+Cn]=an(an(4-Nt,3)+Yt-Jt,1)}function Kt(un,Xt,nn,vn,Sn,Cn){Xt[nn]=an(an(5*un[Sn]+4*un[Sn-Cn]-un[Sn-Cn-Cn]+4,3)+un[vn],1),Xt[nn+Cn]=an(an(11*un[Sn]-4*un[Sn-Cn]+un[Sn-Cn-Cn]+4,3)-un[vn],1)}function Wt(un){return Ze[un=un<0?0:un>4095?4095:un]>>>2}return function(un,Xt,nn,vn,Sn){vn=new Uint16Array(vn.buffer);var Cn,Nt,Yt,Jt,hn,Ye,Xe,Pt,sn=Date.now(),yn=ge._binBE,qt=Xt+nn;for(Xt+=4;Xt>>1)*(Nt>>>1));for(Pt=new Int16Array((Cn>>>1)*(Nt>>>1)),Ge=new Int16Array(1024),Yn=0;Yn<1024;Yn++){var Kn=Yn-512,Rn=Math.abs(Kn),Mn=Math.floor(768*Rn*Rn*Rn/16581375)+Rn;Ge[Yn]=Math.sign(Kn)*Mn}for(Ze=new Uint16Array(4096),Yn=0;Yn<4096;Yn++){var Xn=Yn,Jn=65535*(Math.pow(113,Xn/4095)-1)/112;Ze[Yn]=Math.min(Jn,65535)}}var pn=Xe[hn],tn=Ke(Cn,1+Je[Yt]),Gt=Ke(Nt,1+Je[Yt]);if(Yt==0)for(var bn=0;bn>>1)+kn]=un[jn]<<8|un[jn+1]}else{var Wn=[un,8*Xt],dn=[],Bn=0,mn=tn*Gt,Pn=[0,0],ur=0;for(Tn=0;Bn0;)dn[Bn++]=Tn,ur--;var er=(Yt-1)%3,_r=er!=1?tn:0,dr=er!=0?Gt:0;for(bn=0;bn>>1)+_r,sr=bn*tn;for(kn=0;kn>>1,kr=2*tn,Mr=2*Gt;for(bn=0;bn>14-2*hi&3;var mi=ei[Pr];if(mi!=0)for(bn=0;bn>>1)*(Cn>>>1)+(kn>>>1)],bi=Gi[jn]-2048,oi=gi[jn]-2048,ki=xi[jn]-2048,Co=(bi<<1)+fi,Wi=(oi<<1)+fi,Di=fi+ki,pi=fi-ki;vn[Ni]=Wt(Co),vn[Ni+1]=Wt(Di),vn[Ni+Cn]=Wt(pi),vn[Ni+Cn+1]=Wt(Wi)}}Xt+=4*zn}else if(xn==16388)Xt+=4*zn;else if(Nn!=8192&&Nn!=8448&&Nn!=9216)throw xn.toString(16)}}}}}}}}}console.log(Date.now()-sn)}}(),ge.decode._decodeLogLuv32=function(ze,Ge,Ze,Dt,Je,Ut){for(var jt=ze.width,Ke=4*jt,an=0,Zt=new Uint8Array(Ke);an>>11,un=15&en>>>22,Xt=15&en>>>26,nn=0;nn<4&&128<>3))>>>(7&vn)&127)<2047&&(Cn[Jt]=2047),vn+=7);for(Jt=0;Jt<16;Jt++,sn+=2)Kn=Cn[Jt]<<1,ge.decode._putsF(Je,(yn*jt+sn)*an,Kn<<16-an);sn-=1&sn?1:31}}}else for(var Jt=0;Jt>>4,Je[Ut+Jt+1]=hn<<4|Xe>>>4,Je[Ut+Jt+2]=Xe<<4|Ye>>>4}else{Ke+=8;var Pt,sn,yn,qt=[Ze,0,0,0],wn=new Uint16Array(32770),Tn=[3857,3856,3599,3342,3085,2828,2571,2314,2057,1800,1543,1286,1029,772,771,768,514,513],xn=0,Nn=ge.decode._ljpeg_diff;for(wn[0]=15,Pt=Jt=0;Jt<18;Jt++)for(var zn=32768>>>(Tn[Jt]>>>8),Yn=0;Yn1&&(Tn=Math.floor(wn/(xn-1))),Cn==68&&Nt==32&&Tn>0&&(Wt=Jt.readShort(vn,562));var Nn=[0,0],zn=un(Ke[Kt]),Yn=[Dt,0,0,0];for(Xe=0;Xe>>4),0)<<1)<>>1)&1<>>3;ze[Dt]|=Ze>>>16,ze[Dt+1]|=Ze>>>8,ze[Dt+2]|=Ze},ge.decode._getbithuff=function(ze,Ge,Ze,Dt){ge.decode._get_byte;var Je,Ut=Ge[0],jt=Ge[1],Ke=Ge[2],an=Ge[3];if(Ze==0||Ke<0)return 0;for(;!an&&Ke>>32-Ze,Dt?(Ke-=Dt[Je+1]>>>8,Je=255&Dt[Je+1]):Ke-=Ze,Ke<0)throw"e";return Ge[0]=Ut,Ge[1]=jt,Ge[2]=Ke,Ge[3]=an,Je},ge.decode._make_decoder=function(ze){var Ge,Ze,Dt,Je,Ut,jt=[];for(Ge=16;Ge!=0&&!ze[Ge];Ge--);var Ke=17;for(jt[0]=Ge,Dt=Ze=1;Ze<=Ge;Ze++)for(Je=0;Je>>8;else for(en=0;en>>8,Je[Ut+(en<<1)+1]=255&Xt[en];else if(un==14||un==12){var vn=16-un;for(en=0;en1),!Wt){if(Ge[Ze]==255&&Ge[Ze+1]==Zt)return{jpegOffset:Ze};if(un!=null&&(Ge[Ze+Xt]==255&&Ge[Ze+Xt+1]==Zt?en=Ze+Xt:me("JPEGInterchangeFormat does not point to SOI"),nn==null?me("JPEGInterchangeFormatLength field is missing"):(Xt>=Kt||Xt+vn<=Kt)&&me("JPEGInterchangeFormatLength field value is invalid"),en!=null))return{jpegOffset:en}}if(Cn!=null&&(Nt=Cn[0],Yt=Cn[1]),un!=null&&nn!=null)if(vn>=2&&Xt+vn<=Kt){for(Je=Ge[Ze+Xt+vn-2]==255&&Ge[Ze+Xt+vn-1]==Zt?new Uint8Array(vn-2):new Uint8Array(vn),jt=0;jt offset to first strip or tile");if(Je==null){var Ye=0,Xe=[];Xe[Ye++]=255,Xe[Ye++]=Zt;var Pt=ze.t519;if(Pt==null)throw new Error("JPEGQTables tag is missing");for(jt=0;jt>>8,Xe[Ye++]=255&yn,Xe[Ye++]=jt|an<<4,Ke=0;Ke<16;Ke++)Xe[Ye++]=Ge[Ze+sn[jt]+Ke];for(Ke=0;Ke>>8&255,Xe[Ye++]=255&ze.height,Xe[Ye++]=ze.width>>>8&255,Xe[Ye++]=255&ze.width,Xe[Ye++]=Jt,Jt==1)Xe[Ye++]=1,Xe[Ye++]=17,Xe[Ye++]=0;else for(jt=0;jt<3;jt++)Xe[Ye++]=jt+1,Xe[Ye++]=jt!=0?17:(15&Nt)<<4|15&Yt,Xe[Ye++]=jt;hn!=null&&hn[0]!=0&&(Xe[Ye++]=255,Xe[Ye++]=221,Xe[Ye++]=0,Xe[Ye++]=4,Xe[Ye++]=hn[0]>>>8&255,Xe[Ye++]=255&hn[0]),Je=new Uint8Array(Xe)}var qt=-1;for(jt=0;jt>>8&255,Je[Tn++]=255&ze.height,Je[Tn++]=ze.width>>>8&255,Je[Tn++]=255&ze.width,Je[Tn++]=Jt,Jt==1)Je[Tn++]=1,Je[Tn++]=17,Je[Tn++]=0;else for(jt=0;jt<3;jt++)Je[Tn++]=jt+1,Je[Tn++]=jt!=0?17:(15&Nt)<<4|15&Yt,Je[Tn++]=jt}if(Ge[Kt]==255&&Ge[Kt+1]==218){var xn=Ge[Kt+2]<<8|Ge[Kt+3];for((Ut=new Uint8Array(xn+2))[0]=Ge[Kt],Ut[1]=Ge[Kt+1],Ut[2]=Ge[Kt+2],Ut[3]=Ge[Kt+3],jt=0;jt>>8&255,an[en.sofPosition+6]=255&ze.height,an[en.sofPosition+7]=ze.width>>>8&255,an[en.sofPosition+8]=255&ze.width,Ge[Ze]==255&&Ge[Ze+1]==SOS||(an.set(en.sosMarker,Zt),Zt+=sosMarker.length),un=0;un=0&&an<128)for(var Zt=0;Zt=-127&&an<0){for(Zt=0;Zt<1-an;Zt++)jt[Je]=Ut[Ge],Je++;Ge++}}return Je},ge.decode._decodeThunder=function(ze,Ge,Ze,Dt,Je){for(var Ut=[0,1,0,-1],jt=[0,1,2,3,0,-3,-2,-1],Ke=Ge+Ze,an=2*Je,Zt=0;Ge>>6,Wt=63&en;if(Ge++,Kt==3&&(Zt=15&Wt,Dt[an>>>1]|=Zt<<4*(1-an&1),an++),Kt==0)for(var un=0;un>>1]|=Zt<<4*(1-an&1),an++;if(Kt==2)for(un=0;un<2;un++)(Xt=Wt>>>3*(1-un)&7)!=4&&(Zt+=jt[Xt],Dt[an>>>1]|=Zt<<4*(1-an&1),an++);if(Kt==1)for(un=0;un<3;un++){var Xt;(Xt=Wt>>>2*(2-un)&3)!=2&&(Zt+=Ut[Xt],Dt[an>>>1]|=Zt<<4*(1-an&1),an++)}}},ge.decode._dmap={1:0,"011":1,"000011":2,"0000011":3,"010":-1,"000010":-2,"0000010":-3},ge.decode._lens=function(){var ze=function(an,Zt,en,Kt){for(var Wt=0;Wt>>3>>3]>>>7-(7&an)&1),jt==2&&(Ye=ze[an>>>3]>>>(7&an)&1),an++,en+=Ye,Yt=="H"){if(Ke._lens[Cn][en]!=null){var Xe=Ke._lens[Cn][en];en="",Zt+=Xe,Xe<64&&(Ke._addNtimes(Kt,Zt,Cn),Xt+=Zt,Cn=1-Cn,Zt=0,--Jt==0&&(Yt=""))}}else en=="0001"&&(en="",Ke._addNtimes(Kt,Sn-Xt,Cn),Xt=Sn),en=="001"&&(en="",Yt="H",Jt=2),Ke._dmap[en]!=null&&(nn=vn+Ke._dmap[en],Ke._addNtimes(Kt,nn-Xt,Cn),Xt=nn,en="",Cn=1-Cn);Kt.length==Ut&&Yt==""&&(Ke._writeBits(Kt,Dt,8*Je+Nt*hn),Cn=0,Nt++,Xt=0,Wt=Ke._makeDiff(Kt),Kt=[])}},ge.decode._findDiff=function(ze,Ge,Ze){for(var Dt=0;Dt=Ge&&ze[Dt+1]==Ze)return ze[Dt]},ge.decode._makeDiff=function(ze){var Ge=[];ze[0]==1&&Ge.push(0,1);for(var Ze=1;Ze>>3>>3]>>>7-(7&an)&1),jt==2&&(nn=ze[an>>>3]>>>(7&an)&1),an++,en+=nn,(Zt=Ke._lens[Wt][en])!=null&&(Ke._addNtimes(Kt,Zt,Wt),en="",Zt<64&&(Wt=1-Wt),Kt.length==Ut&&(Ke._writeBits(Kt,Dt,8*Je+un*Xt),Kt=[],un++,Wt=0,7&an&&(an+=8-(7&an)),Zt>=64&&(an+=8)))}},ge.decode._decodeG3=function(ze,Ge,Ze,Dt,Je,Ut,jt,Ke){for(var an=ge.decode,Zt=Ge<<3,en=0,Kt="",Wt=[],un=[],Xt=0;Xt>>3>>3]>>>7-(7&Zt)&1),jt==2&&(Pt=ze[Zt>>>3]>>>(7&Zt)&1),Zt++,Kt+=Pt,Ye){if(an._lens[Nt][Kt]!=null){var sn=an._lens[Nt][Kt];Kt="",en+=sn,sn<64&&(an._addNtimes(Wt,en,Nt),Nt=1-Nt,en=0)}}else Jt=="H"?an._lens[Nt][Kt]!=null&&(sn=an._lens[Nt][Kt],Kt="",en+=sn,sn<64&&(an._addNtimes(Wt,en,Nt),nn+=en,Nt=1-Nt,en=0,--hn==0&&(Jt=""))):(Kt=="0001"&&(Kt="",an._addNtimes(Wt,Cn-nn,Nt),nn=Cn),Kt=="001"&&(Kt="",Jt="H",hn=2),an._dmap[Kt]!=null&&(vn=Sn+an._dmap[Kt],an._addNtimes(Wt,vn-nn,Nt),nn=vn,Kt="",Nt=1-Nt));Kt.endsWith("000000000001")&&(Yt>=0&&an._writeBits(Wt,Dt,8*Je+Yt*Xe),Ke&&(jt==1&&(Ye=(ze[Zt>>>3]>>>7-(7&Zt)&1)==1),jt==2&&(Ye=(ze[Zt>>>3]>>>(7&Zt)&1)==1),Zt++),Kt="",Nt=0,Yt++,nn=0,un=an._makeDiff(Wt),Wt=[])}Wt.length==Ut&&an._writeBits(Wt,Dt,8*Je+Yt*Xe)},ge.decode._addNtimes=function(ze,Ge,Ze){for(var Dt=0;Dt>>3]|=ze[Dt]<<7-(Ze+Dt&7)},ge.decode._decodeLZW=ge.decode._decodeLZW=($e=0,Re=0,Ae=0,Ie=0,ke=function(){var ze=ve>>>3,Ge=(xe[ze]<<16|xe[ze+1]<<8|xe[ze+2])>>>24-(7&ve)-Re&(1<>>----------------");for(var an=0;an4&&(ze.writeUint(Ze,Dt,Ke),nn=Ke),Kt==1||Kt==7)for(var vn=0;vn4&&(Ke+=Xt+=1&Xt),Dt+=4}}return[Dt,Ke]},ge.toRGBA8=function(ze,Ge){var Ze=ze.width,Dt=ze.height,Je=Ze*Dt,Ut=4*Je,jt=ze.data,Ke=new Uint8Array(4*Je),an=ze.t262?ze.t262[0]:2,Zt=ze.t258?Math.min(32,ze.t258[0]):1;if(ze.t262==null&&Zt==1&&(an=0),an==0)for(var en=Math.ceil(Zt*Ze/8),Kt=0;Kt>3)]>>7-(7&Xt)&1;Ke[nn]=Ke[nn+1]=Ke[nn+2]=255*(1-vn),Ke[nn+3]=255}if(Zt==4)for(Xt=0;Xt>1)]>>4-4*(1&Xt)&15,Ke[nn]=Ke[nn+1]=Ke[nn+2]=17*(15-vn),Ke[nn+3]=255;if(Zt==8)for(Xt=0;Xt>3)]>>7-(7&Xt)&1,Ke[nn]=Ke[nn+1]=Ke[nn+2]=255*vn,Ke[nn+3]=255;if(Zt==2)for(Xt=0;Xt>2)]>>6-2*(3&Xt)&3,Ke[nn]=Ke[nn+1]=Ke[nn+2]=85*vn,Ke[nn+3]=255;if(Zt==8)for(Xt=0;Xt>>3)]>>>7-(7&Xe)&1;else if(Zt==2)Pt=jt[sn+(Xe>>>2)]>>>6-2*(3&Xe)&3;else if(Zt==4)Pt=jt[sn+(Xe>>>1)]>>>4-4*(1&Xe)&15;else{if(Zt!=8)throw Zt;Pt=jt[sn+Xe*Sn]}Ke[nn]=hn[Pt]>>8,Ke[nn+1]=hn[Ye+Pt]>>8,Ke[nn+2]=hn[Ye+Ye+Pt]>>8,Ke[nn+3]=255}}else if(an==5){var yn=(Sn=ze.t258?ze.t258.length:4)>4?1:0;for(Xt=0;Xt>>1))+(1&Rn)];var Mn=jt[qt+2]-128,Xn=jt[qt+3]-128,Jn=xn+((Xn>>2)+(Xn>>3)+(Xn>>5)),pn=xn-((Mn>>2)+(Mn>>4)+(Mn>>5))-((Xn>>1)+(Xn>>3)+(Xn>>4)+(Xn>>5)),tn=xn+(Mn+(Mn>>1)+(Mn>>2)+(Mn>>6));Ke[nn]=Math.max(0,Math.min(255,Jn)),Ke[nn+1]=Math.max(0,Math.min(255,pn)),Ke[nn+2]=Math.max(0,Math.min(255,tn)),Ke[nn+3]=255}}}else if(an==32845){let mn=function(Pn){return Pn<.0031308?12.92*Pn:1.055*Math.pow(Pn,.4166666666666667)-.055};for(Kt=0;KtDt&&(Dt=Ke,Je=jt)}}ge.decodeImage(ze,Je,Ge);var an=ge.toRGBA8(Je),Zt=Je.width,en=Je.height,Kt=document.createElement("canvas");Kt.width=Zt,Kt.height=en;var Wt=Kt.getContext("2d"),un=new ImageData(new Uint8ClampedArray(an.buffer),Zt,en);return Wt.putImageData(un,0,0),Kt.toDataURL()},ge._binBE={nextZero:function(ze,Ge){for(;ze[Ge]!=0;)Ge++;return Ge},readUshort:function(ze,Ge){return ze[Ge]<<8|ze[Ge+1]},readShort:function(ze,Ge){var Ze=ge._binBE.ui8;return Ze[0]=ze[Ge+1],Ze[1]=ze[Ge+0],ge._binBE.i16[0]},readInt:function(ze,Ge){var Ze=ge._binBE.ui8;return Ze[0]=ze[Ge+3],Ze[1]=ze[Ge+2],Ze[2]=ze[Ge+1],Ze[3]=ze[Ge+0],ge._binBE.i32[0]},readUint:function(ze,Ge){var Ze=ge._binBE.ui8;return Ze[0]=ze[Ge+3],Ze[1]=ze[Ge+2],Ze[2]=ze[Ge+1],Ze[3]=ze[Ge+0],ge._binBE.ui32[0]},readASCII:function(ze,Ge,Ze){for(var Dt="",Je=0;Je>8&255,ze[Ge+1]=255&Ze},writeInt:function(ze,Ge,Ze){var Dt=ge._binBE.ui8;ge._binBE.i32[0]=Ze,ze[Ge+3]=Dt[0],ze[Ge+2]=Dt[1],ze[Ge+1]=Dt[2],ze[Ge+0]=Dt[3]},writeUint:function(ze,Ge,Ze){ze[Ge]=Ze>>24&255,ze[Ge+1]=Ze>>16&255,ze[Ge+2]=Ze>>8&255,ze[Ge+3]=Ze>>0&255},writeASCII:function(ze,Ge,Ze){for(var Dt=0;Dt>8&255},writeInt:function(ze,Ge,Ze){var Dt=ge._binBE.ui8;ge._binBE.i32[0]=Ze,ze[Ge+0]=Dt[0],ze[Ge+1]=Dt[1],ze[Ge+2]=Dt[2],ze[Ge+3]=Dt[3]},writeUint:function(ze,Ge,Ze){ze[Ge]=Ze>>>0&255,ze[Ge+1]=Ze>>>8&255,ze[Ge+2]=Ze>>>16&255,ze[Ge+3]=Ze>>>24&255},writeASCII:ge._binBE.writeASCII},ge._copyTile=function(ze,Ge,Ze,Dt,Je,Ut,jt,Ke){for(var an=Math.min(Ge,Je-jt),Zt=Math.min(Ze,Ut-Ke),en=0;en>--Jt&1)];Yt[Cn]=Ye}}function Ut(Xt,nn,vn,Sn){if(Xt[nn+3]!=255)return 0;if(vn==0)return nn;for(var Cn=0;Cn<2;Cn++){Xt[nn+Cn]==0&&(Xt[nn+Cn]=Xt.length,Xt.push(0,0,Sn,255));var Nt=Ut(Xt,Xt[nn+Cn],vn-1,Sn+1);if(Nt!=0)return Nt}return 0}function jt(Xt){for(var nn=Xt.b,vn=Xt.a;nn<25&&Xt.e>>8),vn=vn<<8|Sn,nn+=8}if(nn<0)throw"e";Xt.b=nn,Xt.a=vn}function Ke(Xt,nn){return nn.b>(nn.b-=Xt)&65535>>16-Xt}function an(Xt,nn){var vn=Xt[0],Sn=0,Cn=255;nn.b<16&&jt(nn);var Nt=nn.a>>nn.b-8&255;for(Cn=vn[(Sn=Xt[1][Nt])+3],nn.b-=vn[Sn+2];Cn==255;)Cn=vn[(Sn=vn[Sn+(nn.a>>--nn.b&1)])+3];return Cn}function Zt(Xt,nn){return Xt<32768>>16-nn&&(Xt+=1-(1<>>1);else if(nn==6)Tn=Xt[qt]+(wn-Xt[qt-Yt]>>>1);else{if(nn!=7)throw nn;Tn=wn+Xt[qt]>>>1}Xt[yn]+=Tn}}}return function(Xt){if(ze=Xt,Ge=0,Dt()!=65496)throw"e";for(var nn=[],vn=0,Sn=0,Cn=[],Nt=[],Yt=[],Jt=0,hn=0,Ye=0;;){var Xe=Dt();if(Xe!=65535){var Pt=Dt();if(Xe==65475){Sn=Ze(),hn=Dt(),Ye=Dt(),Jt=Ze();for(var sn=0;sn>4,15&qt]}}else if(Xe==65476)for(var wn=Ge+Pt-2;Ge>>4],Cn[Tn[0]]=Tn.slice(1)}vn=Ze(),Ge+=2;break}Ge+=Pt-2}}else Ge--}var xn=new(Sn>8?Uint16Array:Uint8Array)(hn*Ye*Jt),Nn={b:0,a:0,c:vn==8,e:Ge,data:ze,d:ze.length};if(Nn.c)(function(Pn,ur,er,_r,dr){for(var Sr=ze.length-Ge,sr=0;srYn&&(Yn=kn),(bn=Rn[1])>Kn&&(Kn=bn),zn.push(kn*bn)}if(Yn!=1||Kn!=1){var Mn=[],Xn=0;for(sn=0;sn>>6),yn=0;yn<3;yn++)for(var qt=0;qt<41;qt++)Pt[yn][qt]=[sn,1];return Pt}function Sn(Xe,Pt){var sn=0,yn=8-Xe.a;if(Xe.j,Xe.a,Pt){if(Pt>=yn)do sn<<=yn,Pt-=yn,sn|=Xe[Xe.j]&(1<=8);Pt&&(sn<<=Pt,yn-=Pt,sn|=Xe[Xe.j]>>>yn&(1<Rn&&Kn>>2,xn)return void(tn[Xn]=Mn);Nn=Pt.t*Pt.c[Xe.g+jn-bn]+Pt.c[Xe.g+kn-jn]}else Mn=jn>kn&&jn>Wn||jn>>2:dn+Bn>>>1,Nn=Pt.t*Pt.c[Xe.g+jn-kn]+Pt.c[Xe.g+kn-dn];zn=mn(Nn);var Pn=function(er){for(var _r=-1,dr=0;!dr;_r++)dr=er[er.j]>>>7-er.a&1,er.a++,er.a&=7,er.a||er.j++;return _r}(sn);if(Pn>>1):pn>>>1,Tn[zn][0]+=mn(pn),Tn[zn][1]==Xe.f&&(Tn[zn][0]>>>=1,Tn[zn][1]>>>=1),Tn[zn][1]++,Mn=Nn<0?Mn-pn:Mn+pn,Xe.i&&(Mn<0?Mn+=Pt.w:Mn>Xe.g&&(Mn-=Pt.w)),tn[Xn]=Mn>=0?Math.min(Mn,Xe.g):0}function Nt(Xe,Pt,sn){for(var yn=Xe[0].length,qt=Pt;qt<=sn;qt++)Xe[qt][0]=Xe[qt-1][1],Xe[qt][yn-1]=Xe[qt-1][yn-2]}function Yt(Xe){Nt(Xe,Ut,en),Nt(Xe,ze,Ze),Nt(Xe,un,nn)}function Jt(Xe,Pt,sn,yn,qt,wn,Tn,xn,Nn,zn,Yn,Kn,Rn){for(var Mn=0,Xn=1,Jn=qtZe;Xn8&&(Cn(Xe,Pt,sn,yn,qt,Xn,xn[Nn]),Cn(Xe,Pt,sn,yn,wn,Xn,xn[Nn]),Xn+=2);Yt(yn)}function hn(Xe,Pt,sn,yn,qt,wn){Jt(Xe,Pt,sn,yn,ze,Ut,qt,wn,0,0,1,0,8),Jt(Xe,Pt,sn,yn,jt,un,qt,wn,1,0,1,0,8),Jt(Xe,Pt,sn,yn,Ge,Ke,qt,wn,2,1,0,3,0),Jt(Xe,Pt,sn,yn,an,Xt,qt,wn,0,0,0,3,2),Jt(Xe,Pt,sn,yn,Ze,Zt,qt,wn,1,0,0,3,2),Jt(Xe,Pt,sn,yn,en,nn,qt,wn,2,1,0,3,0)}function Ye(Xe,Pt,sn,yn,qt,wn){var Tn=wn.length,xn=Xe.l;qt+1==Xe.s&&(xn=Xe.e-qt*Xe.l);for(var Nn=6*Xe.e*yn+qt*Xe.l,zn=0;zn<6;zn++){for(var Yn=0;Yn>>1):Rn==2?un+(zn>>>1):Ut+zn;var Mn=Xe.h?(2*Yn/3&2147483646|Yn%3&1)+(Yn%3>>>1):Yn>>>1;Pt[Nn+Yn]=sn[Kn][Mn+1]}Nn+=Xe.e}}ge._decompressRAF=function(Xe,Pt){var sn=function(Xn){var Jn=ge._binBE.readUshort,pn={b:Jn(Xn,0),i:Xn[2],C:Xn[3],u:Xn[4],q:Jn(Xn,5),k:Jn(Xn,7),e:Jn(Xn,9),l:Jn(Xn,11),s:Xn[13],d:Jn(Xn,14)};if(pn.b!=18771||pn.i>1||pn.q<6||pn.q%6||pn.e<768||pn.e%24||pn.l!=768||pn.k=pn.l||pn.s>16||pn.s!=pn.k/pn.l||pn.s!=Math.ceil(pn.e/pn.l)||pn.d!=pn.q/6||pn.u!=12&&pn.u!=14&&pn.u!=16||pn.C!=16&&pn.C!=0)throw"Invalid data";if(pn.i==0)throw"Not implemented. We need this file!";return pn.h=pn.C==16,pn.m=0|(pn.h?2*pn.l/3:pn.l>>>1),pn.A=pn.m+2,pn.f=64,pn.g=(1<{ce.r(oe),ce.d(oe,{DOMException:()=>We,Headers:()=>_e,Request:()=>Be,Response:()=>Fe,fetch:()=>qe});var ue=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||ue!==void 0&&ue,pe={searchParams:"URLSearchParams"in ue,iterable:"Symbol"in ue&&"iterator"in Symbol,blob:"FileReader"in ue&&"Blob"in ue&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in ue,arrayBuffer:"ArrayBuffer"in ue};if(pe.arrayBuffer)var me=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],ge=ArrayBuffer.isView||function(ze){return ze&&me.indexOf(Object.prototype.toString.call(ze))>-1};function ye(ze){if(typeof ze!="string"&&(ze=String(ze)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(ze)||ze==="")throw new TypeError('Invalid character in header field name: "'+ze+'"');return ze.toLowerCase()}function ve(ze){return typeof ze!="string"&&(ze=String(ze)),ze}function xe(ze){var Ge={next:function(){var Ze=ze.shift();return{done:Ze===void 0,value:Ze}}};return pe.iterable&&(Ge[Symbol.iterator]=function(){return Ge}),Ge}function _e(ze){this.map={},ze instanceof _e?ze.forEach(function(Ge,Ze){this.append(Ze,Ge)},this):Array.isArray(ze)?ze.forEach(function(Ge){this.append(Ge[0],Ge[1])},this):ze&&Object.getOwnPropertyNames(ze).forEach(function(Ge){this.append(Ge,ze[Ge])},this)}function Se(ze){if(ze.bodyUsed)return Promise.reject(new TypeError("Already read"));ze.bodyUsed=!0}function $e(ze){return new Promise(function(Ge,Ze){ze.onload=function(){Ge(ze.result)},ze.onerror=function(){Ze(ze.error)}})}function Re(ze){var Ge=new FileReader,Ze=$e(Ge);return Ge.readAsArrayBuffer(ze),Ze}function Ae(ze){if(ze.slice)return ze.slice(0);var Ge=new Uint8Array(ze.byteLength);return Ge.set(new Uint8Array(ze)),Ge.buffer}function Ie(){return this.bodyUsed=!1,this._initBody=function(ze){var Ge;this.bodyUsed=this.bodyUsed,this._bodyInit=ze,ze?typeof ze=="string"?this._bodyText=ze:pe.blob&&Blob.prototype.isPrototypeOf(ze)?this._bodyBlob=ze:pe.formData&&FormData.prototype.isPrototypeOf(ze)?this._bodyFormData=ze:pe.searchParams&&URLSearchParams.prototype.isPrototypeOf(ze)?this._bodyText=ze.toString():pe.arrayBuffer&&pe.blob&&(Ge=ze)&&DataView.prototype.isPrototypeOf(Ge)?(this._bodyArrayBuffer=Ae(ze.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):pe.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(ze)||ge(ze))?this._bodyArrayBuffer=Ae(ze):this._bodyText=ze=Object.prototype.toString.call(ze):this._bodyText="",this.headers.get("content-type")||(typeof ze=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):pe.searchParams&&URLSearchParams.prototype.isPrototypeOf(ze)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},pe.blob&&(this.blob=function(){var ze=Se(this);if(ze)return ze;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?Se(this)||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer)):this.blob().then(Re)}),this.text=function(){var ze,Ge,Ze,Dt=Se(this);if(Dt)return Dt;if(this._bodyBlob)return ze=this._bodyBlob,Ze=$e(Ge=new FileReader),Ge.readAsText(ze),Ze;if(this._bodyArrayBuffer)return Promise.resolve(function(Je){for(var Ut=new Uint8Array(Je),jt=new Array(Ut.length),Ke=0;Ke-1?Dt:Ze),this.mode=Ge.mode||this.mode||null,this.signal=Ge.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&Je)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(Je),!(this.method!=="GET"&&this.method!=="HEAD"||Ge.cache!=="no-store"&&Ge.cache!=="no-cache")){var Ut=/([?&])_=[^&]*/;Ut.test(this.url)?this.url=this.url.replace(Ut,"$1_="+new Date().getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+new Date().getTime()}}function Ne(ze){var Ge=new FormData;return ze.trim().split("&").forEach(function(Ze){if(Ze){var Dt=Ze.split("="),Je=Dt.shift().replace(/\+/g," "),Ut=Dt.join("=").replace(/\+/g," ");Ge.append(decodeURIComponent(Je),decodeURIComponent(Ut))}}),Ge}function Fe(ze,Ge){if(!(this instanceof Fe))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');Ge||(Ge={}),this.type="default",this.status=Ge.status===void 0?200:Ge.status,this.ok=this.status>=200&&this.status<300,this.statusText=Ge.statusText===void 0?"":""+Ge.statusText,this.headers=new _e(Ge.headers),this.url=Ge.url||"",this._initBody(ze)}Be.prototype.clone=function(){return new Be(this,{body:this._bodyInit})},Ie.call(Be.prototype),Ie.call(Fe.prototype),Fe.prototype.clone=function(){return new Fe(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new _e(this.headers),url:this.url})},Fe.error=function(){var ze=new Fe(null,{status:0,statusText:""});return ze.type="error",ze};var Ue=[301,302,303,307,308];Fe.redirect=function(ze,Ge){if(Ue.indexOf(Ge)===-1)throw new RangeError("Invalid status code");return new Fe(null,{status:Ge,headers:{location:ze}})};var We=ue.DOMException;try{new We}catch{(We=function(Ge,Ze){this.message=Ge,this.name=Ze;var Dt=Error(Ge);this.stack=Dt.stack}).prototype=Object.create(Error.prototype),We.prototype.constructor=We}function qe(ze,Ge){return new Promise(function(Ze,Dt){var Je=new Be(ze,Ge);if(Je.signal&&Je.signal.aborted)return Dt(new We("Aborted","AbortError"));var Ut=new XMLHttpRequest;function jt(){Ut.abort()}Ut.onload=function(){var Ke,an,Zt={status:Ut.status,statusText:Ut.statusText,headers:(Ke=Ut.getAllResponseHeaders()||"",an=new _e,Ke.replace(/\r?\n[\t ]+/g," ").split("\r").map(function(Kt){return Kt.indexOf(` -`)===0?Kt.substr(1,Kt.length):Kt}).forEach(function(Kt){var Wt=Kt.split(":"),un=Wt.shift().trim();if(un){var Xt=Wt.join(":").trim();an.append(un,Xt)}}),an)};Zt.url="responseURL"in Ut?Ut.responseURL:Zt.headers.get("X-Request-URL");var en="response"in Ut?Ut.response:Ut.responseText;setTimeout(function(){Ze(new Fe(en,Zt))},0)},Ut.onerror=function(){setTimeout(function(){Dt(new TypeError("Network request failed"))},0)},Ut.ontimeout=function(){setTimeout(function(){Dt(new TypeError("Network request failed"))},0)},Ut.onabort=function(){setTimeout(function(){Dt(new We("Aborted","AbortError"))},0)},Ut.open(Je.method,function(Ke){try{return Ke===""&&ue.location.href?ue.location.href:Ke}catch{return Ke}}(Je.url),!0),Je.credentials==="include"?Ut.withCredentials=!0:Je.credentials==="omit"&&(Ut.withCredentials=!1),"responseType"in Ut&&(pe.blob?Ut.responseType="blob":pe.arrayBuffer&&Je.headers.get("Content-Type")&&Je.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(Ut.responseType="arraybuffer")),!Ge||typeof Ge.headers!="object"||Ge.headers instanceof _e?Je.headers.forEach(function(Ke,an){Ut.setRequestHeader(an,Ke)}):Object.getOwnPropertyNames(Ge.headers).forEach(function(Ke){Ut.setRequestHeader(Ke,ve(Ge.headers[Ke]))}),Je.signal&&(Je.signal.addEventListener("abort",jt),Ut.onreadystatechange=function(){Ut.readyState===4&&Je.signal.removeEventListener("abort",jt)}),Ut.send(Je._bodyInit===void 0?null:Je._bodyInit)})}qe.polyfill=!0,ue.fetch||(ue.fetch=qe,ue.Headers=_e,ue.Request=Be,ue.Response=Fe)},6290:(ne,oe,ce)=>{var ue=ce(5048),pe=ce(9748),me=ce(4655),ge=ce(1960);function ye(_e,Se,$e){var Re=_e;return pe(Se)?($e=Se,typeof _e=="string"&&(Re={uri:_e})):Re=ge(Se,{uri:_e}),Re.callback=$e,Re}function ve(_e,Se,$e){return xe(Se=ye(_e,Se,$e))}function xe(_e){if(_e.callback===void 0)throw new Error("callback argument missing");var Se=!1,$e=function(Je,Ut,jt){Se||(Se=!0,_e.callback(Je,Ut,jt))};function Re(){var Je=void 0;if(Je=Ne.response?Ne.response:Ne.responseText||function(Ut){try{if(Ut.responseType==="document")return Ut.responseXML;var jt=Ut.responseXML&&Ut.responseXML.documentElement.nodeName==="parsererror";if(Ut.responseType===""&&!jt)return Ut.responseXML}catch{}return null}(Ne),Ze)try{Je=JSON.parse(Je)}catch{}return Je}function Ae(Je){return clearTimeout(Fe),Je instanceof Error||(Je=new Error(""+(Je||"Unknown XMLHttpRequest Error"))),Je.statusCode=0,$e(Je,Dt)}function Ie(){if(!Be){var Je;clearTimeout(Fe),Je=_e.useXDR&&Ne.status===void 0?200:Ne.status===1223?204:Ne.status;var Ut=Dt,jt=null;return Je!==0?(Ut={body:Re(),statusCode:Je,method:We,headers:{},url:Ue,rawRequest:Ne},Ne.getAllResponseHeaders&&(Ut.headers=me(Ne.getAllResponseHeaders()))):jt=new Error("Internal XMLHttpRequest Error"),$e(jt,Ut,Ut.body)}}var ke,Be,Ne=_e.xhr||null;Ne||(Ne=_e.cors||_e.useXDR?new ve.XDomainRequest:new ve.XMLHttpRequest);var Fe,Ue=Ne.url=_e.uri||_e.url,We=Ne.method=_e.method||"GET",qe=_e.body||_e.data,ze=Ne.headers=_e.headers||{},Ge=!!_e.sync,Ze=!1,Dt={body:void 0,headers:{},statusCode:0,method:We,url:Ue,rawRequest:Ne};if("json"in _e&&_e.json!==!1&&(Ze=!0,ze.accept||ze.Accept||(ze.Accept="application/json"),We!=="GET"&&We!=="HEAD"&&(ze["content-type"]||ze["Content-Type"]||(ze["Content-Type"]="application/json"),qe=JSON.stringify(_e.json===!0?qe:_e.json))),Ne.onreadystatechange=function(){Ne.readyState===4&&setTimeout(Ie,0)},Ne.onload=Ie,Ne.onerror=Ae,Ne.onprogress=function(){},Ne.onabort=function(){Be=!0},Ne.ontimeout=Ae,Ne.open(We,Ue,!Ge,_e.username,_e.password),Ge||(Ne.withCredentials=!!_e.withCredentials),!Ge&&_e.timeout>0&&(Fe=setTimeout(function(){if(!Be){Be=!0,Ne.abort("timeout");var Je=new Error("XMLHttpRequest timeout");Je.code="ETIMEDOUT",Ae(Je)}},_e.timeout)),Ne.setRequestHeader)for(ke in ze)ze.hasOwnProperty(ke)&&Ne.setRequestHeader(ke,ze[ke]);else if(_e.headers&&!function(Je){for(var Ut in Je)if(Je.hasOwnProperty(Ut))return!1;return!0}(_e.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in _e&&(Ne.responseType=_e.responseType),"beforeSend"in _e&&typeof _e.beforeSend=="function"&&_e.beforeSend(Ne),Ne.send(qe||null),Ne}ne.exports=ve,ne.exports.default=ve,ve.XMLHttpRequest=ue.XMLHttpRequest||function(){},ve.XDomainRequest="withCredentials"in new ve.XMLHttpRequest?ve.XMLHttpRequest:ue.XDomainRequest,function(_e,Se){for(var $e=0;$e<_e.length;$e++)Se(_e[$e])}(["get","put","post","patch","head","delete"],function(_e){ve[_e==="delete"?"del":_e]=function(Se,$e,Re){return($e=ye(Se,$e,Re)).method=_e.toUpperCase(),xe($e)}})},1596:ne=>{ne.exports=self.DOMParser!==void 0?function(oe){return new self.DOMParser().parseFromString(oe,"application/xml")}:self.ActiveXObject!==void 0&&new self.ActiveXObject("Microsoft.XMLDOM")?function(oe){var ce=new self.ActiveXObject("Microsoft.XMLDOM");return ce.async="false",ce.loadXML(oe),ce}:function(oe){var ce=document.createElement("div");return ce.innerHTML=oe,ce}},1960:ne=>{ne.exports=function(){for(var ce={},ue=0;ue{},6777:()=>{},5546:()=>{},2460:(ne,oe,ce)=>{var ue=ce(4406),pe=Object.defineProperty,me=Object.getOwnPropertyDescriptor,ge=Object.getOwnPropertyNames,ye=Object.prototype.hasOwnProperty,ve=(Qt,On)=>{for(var Un in On)pe(Qt,Un,{get:On[Un],enumerable:!0})},xe=(Qt=>(On,Un)=>Qt&&Qt.get(On)||(Un=((Zn,or,mr,cr)=>{if(or&&typeof or=="object"||typeof or=="function")for(let Er of ge(or))ye.call(Zn,Er)||pe(Zn,Er,{get:()=>or[Er],enumerable:!(cr=me(or,Er))||cr.enumerable});return Zn})(pe({},"__esModule",{value:!0}),On),Qt&&Qt.set(On,Un),Un))(typeof WeakMap<"u"?new WeakMap:0),_e=(Qt,On,Un)=>(((Zn,or,mr)=>{or in Zn?pe(Zn,or,{enumerable:!0,configurable:!0,writable:!0,value:mr}):Zn[or]=mr})(Qt,typeof On!="symbol"?On+"":On,Un),Un),Se={};ve(Se,{applyPalette:()=>ca,applyPaletteSync:()=>Ao,buildPalette:()=>la,buildPaletteSync:()=>Ro,constants:()=>$e,conversion:()=>Be,distance:()=>Yt,image:()=>mi,palette:()=>Mn,quality:()=>ki,utils:()=>bn});var $e={};ve($e,{bt709:()=>Re});var Re={};ve(Re,{Y:()=>Ae,x:()=>Ie,y:()=>ke});var Ae=(Qt=>(Qt[Qt.RED=.2126]="RED",Qt[Qt.GREEN=.7152]="GREEN",Qt[Qt.BLUE=.0722]="BLUE",Qt[Qt.WHITE=1]="WHITE",Qt))(Ae||{}),Ie=(Qt=>(Qt[Qt.RED=.64]="RED",Qt[Qt.GREEN=.3]="GREEN",Qt[Qt.BLUE=.15]="BLUE",Qt[Qt.WHITE=.3127]="WHITE",Qt))(Ie||{}),ke=(Qt=>(Qt[Qt.RED=.33]="RED",Qt[Qt.GREEN=.6]="GREEN",Qt[Qt.BLUE=.06]="BLUE",Qt[Qt.WHITE=.329]="WHITE",Qt))(ke||{}),Be={};function Ne(Qt){return Qt>.04045?((Qt+.055)/1.055)**2.4:Qt/12.92}function Fe(Qt,On,Un){return{x:.4124*(Qt=Ne(Qt/255))+.3576*(On=Ne(On/255))+.1805*(Un=Ne(Un/255)),y:.2126*Qt+.7152*On+.0722*Un,z:.0193*Qt+.1192*On+.9505*Un}}ve(Be,{lab2rgb:()=>Nt,lab2xyz:()=>vn,rgb2hsl:()=>Ut,rgb2lab:()=>Kt,rgb2xyz:()=>Fe,xyz2lab:()=>en,xyz2rgb:()=>Cn});var Ue={};function We(Qt){return Qt*(Math.PI/180)}function qe(Qt,On,Un){let Zn=Qt;return ZnOn&&(Zn=On),Zn>Un&&(Zn=Un),Zn}function Ge(Qt,On,Un){return Qt>Un&&(Qt=Un),Qt255?Qt=255:Qt<0&&(Qt=0),Qt}function Dt(Qt){return Qt>255?Qt=255:Qt<0&&(Qt=0),Qt}function Je(Qt,On){const Un=typeof Qt[0];let Zn;if(Un==="number"||Un==="string"){const or=Object.create(null);for(let mr=0,cr=Qt.length;mrOn(mr,cr)||or[mr]-or[cr])}else{const or=Qt.slice(0);Zn=Qt.sort((mr,cr)=>On(mr,cr)||or.indexOf(mr)-or.indexOf(cr))}return Zn}function Ut(Qt,On,Un){const Zn=ze(Qt,On,Un),or=qe(Qt,On,Un),mr=or-Zn,cr=(Zn+or)/510;let Er=0;cr>0&&cr<1&&(Er=mr/(cr<.5?or+Zn:510-or-Zn));let pr=0;return mr>0&&(pr=or===Qt?(On-Un)/mr:or===On?2+(Un-Qt)/mr:4+(Qt-On)/mr,pr*=60,pr<0&&(pr+=360)),{h:pr,s:Er,l:cr}}ve(Ue,{degrees2radians:()=>We,inRange0to255:()=>Dt,inRange0to255Rounded:()=>Ze,intInRange:()=>Ge,max3:()=>qe,min3:()=>ze,stableSort:()=>Je});var jt=.95047,Ke=1,an=1.08883;function Zt(Qt){return Qt>.008856?Qt**.3333333333333333:7.787*Qt+.13793103448275862}function en(Qt,On,Un){if(Qt=Zt(Qt/jt),On=Zt(On/Ke),Un=Zt(Un/an),116*On-16<0)throw new Error("xxx");return{L:Math.max(0,116*On-16),a:500*(Qt-On),b:200*(On-Un)}}function Kt(Qt,On,Un){const Zn=Fe(Qt,On,Un);return en(Zn.x,Zn.y,Zn.z)}var Wt=.95047,un=1,Xt=1.08883;function nn(Qt){return Qt>.206893034?Qt**3:(Qt-.13793103448275862)/7.787}function vn(Qt,On,Un){const Zn=(Qt+16)/116,or=Zn-Un/200;return{x:Wt*nn(On/500+Zn),y:un*nn(Zn),z:Xt*nn(or)}}function Sn(Qt){return Qt>.0031308?1.055*Qt**.4166666666666667-.055:12.92*Qt}function Cn(Qt,On,Un){const Zn=Sn(3.2406*Qt+-1.5372*On+-.4986*Un),or=Sn(-.9689*Qt+1.8758*On+.0415*Un),mr=Sn(.0557*Qt+-.204*On+1.057*Un);return{r:Ze(255*Zn),g:Ze(255*or),b:Ze(255*mr)}}function Nt(Qt,On,Un){const Zn=vn(Qt,On,Un);return Cn(Zn.x,Zn.y,Zn.z)}var Yt={};ve(Yt,{AbstractDistanceCalculator:()=>Jt,AbstractEuclidean:()=>qt,AbstractManhattan:()=>Nn,CIE94GraphicArts:()=>Xe,CIE94Textiles:()=>Ye,CIEDE2000:()=>sn,CMetric:()=>yn,Euclidean:()=>wn,EuclideanBT709:()=>Tn,EuclideanBT709NoAlpha:()=>xn,Manhattan:()=>zn,ManhattanBT709:()=>Kn,ManhattanNommyde:()=>Yn,PNGQuant:()=>Rn});var Jt=class{constructor(){_e(this,"_maxDistance"),_e(this,"_whitePoint"),this._setDefaults(),this.setWhitePoint(255,255,255,255)}setWhitePoint(Qt,On,Un,Zn){this._whitePoint={r:Qt>0?255/Qt:0,g:On>0?255/On:0,b:Un>0?255/Un:0,a:Zn>0?255/Zn:0},this._maxDistance=this.calculateRaw(Qt,On,Un,Zn,0,0,0,0)}calculateNormalized(Qt,On){return this.calculateRaw(Qt.r,Qt.g,Qt.b,Qt.a,On.r,On.g,On.b,On.a)/this._maxDistance}},hn=class extends Jt{calculateRaw(Qt,On,Un,Zn,or,mr,cr,Er){const pr=Kt(Dt(Qt*this._whitePoint.r),Dt(On*this._whitePoint.g),Dt(Un*this._whitePoint.b)),Ar=Kt(Dt(or*this._whitePoint.r),Dt(mr*this._whitePoint.g),Dt(cr*this._whitePoint.b)),vr=pr.L-Ar.L,Cr=pr.a-Ar.a,$r=pr.b-Ar.b,Jr=Math.sqrt(pr.a*pr.a+pr.b*pr.b),Zr=Jr-Math.sqrt(Ar.a*Ar.a+Ar.b*Ar.b);let jr=Cr*Cr+$r*$r-Zr*Zr;jr=jr<0?0:Math.sqrt(jr);const Ur=(Er-Zn)*this._whitePoint.a*this._kA;return Math.sqrt((vr/this._Kl)**2+(Zr/(1+this._K1*Jr))**2+(jr/(1+this._K2*Jr))**2+Ur**2)}},Ye=class extends hn{_setDefaults(){this._Kl=2,this._K1=.048,this._K2=.014,this._kA=12.5/255}},Xe=class extends hn{_setDefaults(){this._Kl=1,this._K1=.045,this._K2=.015,this._kA=25/255}},Pt=class extends Jt{_setDefaults(){}static _calculatehp(Qt,On){const Un=Math.atan2(Qt,On);return Un>=0?Un:Un+Pt._deg360InRad}static _calculateRT(Qt,On){const Un=On**7,Zn=2*Math.sqrt(Un/(Un+Pt._pow25to7)),or=Pt._deg30InRad*Math.exp(-(((Qt-Pt._deg275InRad)/Pt._deg25InRad)**2));return-Math.sin(2*or)*Zn}static _calculateT(Qt){return 1-.17*Math.cos(Qt-Pt._deg30InRad)+.24*Math.cos(2*Qt)+.32*Math.cos(3*Qt+Pt._deg6InRad)-.2*Math.cos(4*Qt-Pt._deg63InRad)}static _calculate_ahp(Qt,On,Un,Zn){const or=Un+Zn;return Qt===0?or:On<=Pt._deg180InRad?or/2:or>8)+4*vr*vr+((767-pr)*Cr*Cr>>8),Jr=(Er-Zn)*this._whitePoint.a;return Math.sqrt($r+Jr*Jr)}_setDefaults(){}},qt=class extends Jt{calculateRaw(Qt,On,Un,Zn,or,mr,cr,Er){const pr=or-Qt,Ar=mr-On,vr=cr-Un,Cr=Er-Zn;return Math.sqrt(this._kR*pr*pr+this._kG*Ar*Ar+this._kB*vr*vr+this._kA*Cr*Cr)}},wn=class extends qt{_setDefaults(){this._kR=1,this._kG=1,this._kB=1,this._kA=1}},Tn=class extends qt{_setDefaults(){this._kR=.2126,this._kG=.7152,this._kB=.0722,this._kA=1}},xn=class extends qt{_setDefaults(){this._kR=.2126,this._kG=.7152,this._kB=.0722,this._kA=0}},Nn=class extends Jt{calculateRaw(Qt,On,Un,Zn,or,mr,cr,Er){let pr=or-Qt,Ar=mr-On,vr=cr-Un,Cr=Er-Zn;return pr<0&&(pr=0-pr),Ar<0&&(Ar=0-Ar),vr<0&&(vr=0-vr),Cr<0&&(Cr=0-Cr),this._kR*pr+this._kG*Ar+this._kB*vr+this._kA*Cr}},zn=class extends Nn{_setDefaults(){this._kR=1,this._kG=1,this._kB=1,this._kA=1}},Yn=class extends Nn{_setDefaults(){this._kR=.4984,this._kG=.8625,this._kB=.2979,this._kA=1}},Kn=class extends Nn{_setDefaults(){this._kR=.2126,this._kG=.7152,this._kB=.0722,this._kA=1}},Rn=class extends Jt{calculateRaw(Qt,On,Un,Zn,or,mr,cr,Er){const pr=(Er-Zn)*this._whitePoint.a;return this._colordifferenceCh(Qt*this._whitePoint.r,or*this._whitePoint.r,pr)+this._colordifferenceCh(On*this._whitePoint.g,mr*this._whitePoint.g,pr)+this._colordifferenceCh(Un*this._whitePoint.b,cr*this._whitePoint.b,pr)}_colordifferenceCh(Qt,On,Un){const Zn=Qt-On,or=Zn+Un;return Zn*Zn+or*or}_setDefaults(){}},Mn={};ve(Mn,{AbstractPaletteQuantizer:()=>Xn,ColorHistogram:()=>Sr,NeuQuant:()=>Pn,NeuQuantFloat:()=>_r,RGBQuant:()=>nr,WuColorCube:()=>ei,WuQuant:()=>hi});var Xn=class{quantizeSync(){for(const Qt of this.quantize())if(Qt.palette)return Qt.palette;throw new Error("unreachable")}},Jn=class{constructor(){_e(this,"r"),_e(this,"g"),_e(this,"b"),_e(this,"a"),_e(this,"uint32"),_e(this,"rgba"),this.uint32=-1>>>0,this.r=this.g=this.b=this.a=0,this.rgba=new Array(4),this.rgba[0]=0,this.rgba[1]=0,this.rgba[2]=0,this.rgba[3]=0}static createByQuadruplet(Qt){const On=new Jn;return On.r=0|Qt[0],On.g=0|Qt[1],On.b=0|Qt[2],On.a=0|Qt[3],On._loadUINT32(),On._loadQuadruplet(),On}static createByRGBA(Qt,On,Un,Zn){const or=new Jn;return or.r=0|Qt,or.g=0|On,or.b=0|Un,or.a=0|Zn,or._loadUINT32(),or._loadQuadruplet(),or}static createByUint32(Qt){const On=new Jn;return On.uint32=Qt>>>0,On._loadRGBA(),On._loadQuadruplet(),On}from(Qt){this.r=Qt.r,this.g=Qt.g,this.b=Qt.b,this.a=Qt.a,this.uint32=Qt.uint32,this.rgba[0]=Qt.r,this.rgba[1]=Qt.g,this.rgba[2]=Qt.b,this.rgba[3]=Qt.a}getLuminosity(Qt){let On=this.r,Un=this.g,Zn=this.b;return Qt&&(On=Math.min(255,255-this.a+this.a*On/255),Un=Math.min(255,255-this.a+this.a*Un/255),Zn=Math.min(255,255-this.a+this.a*Zn/255)),.2126*On+.7152*Un+.0722*Zn}_loadUINT32(){this.uint32=(this.a<<24|this.b<<16|this.g<<8|this.r)>>>0}_loadRGBA(){this.r=255&this.uint32,this.g=this.uint32>>>8&255,this.b=this.uint32>>>16&255,this.a=this.uint32>>>24&255}_loadQuadruplet(){this.rgba[0]=this.r,this.rgba[1]=this.g,this.rgba[2]=this.b,this.rgba[3]=this.a}},pn=class{constructor(){_e(this,"_pointArray"),_e(this,"_width"),_e(this,"_height"),this._width=0,this._height=0,this._pointArray=[]}getWidth(){return this._width}getHeight(){return this._height}setWidth(Qt){this._width=Qt}setHeight(Qt){this._height=Qt}getPointArray(){return this._pointArray}clone(){const Qt=new pn;Qt._width=this._width,Qt._height=this._height;for(let On=0,Un=this._pointArray.length;On=or&&Qt=0;On--)if(Qt.uint32===this._pointArray[On].uint32)return!0;return!1}getNearestColor(Qt,On){return this._pointArray[0|this._getNearestIndex(Qt,On)]}getPointContainer(){return this._pointContainer}_nearestPointFromCache(Qt){return typeof this._i32idx[Qt]=="number"?this._i32idx[Qt]:-1}_getNearestIndex(Qt,On){let Un=this._nearestPointFromCache(""+On.uint32);if(Un>=0)return Un;let Zn=Number.MAX_VALUE;Un=0;for(let or=0,mr=this._pointArray.length;or{const Un=Ut(Qt.r,Qt.g,Qt.b),Zn=Ut(On.r,On.g,On.b),or=Qt.r===Qt.g&&Qt.g===Qt.b?0:1+tn(Un.h,10),mr=(On.r===On.g&&On.g===On.b?0:1+tn(Zn.h,10))-or;if(mr)return-mr;const cr=Qt.getLuminosity(!0),Er=On.getLuminosity(!0);if(Er-cr!=0)return Er-cr;const pr=(100*Zn.s|0)-(100*Un.s|0);return pr?-pr:0})}},bn={};ve(bn,{HueStatistics:()=>jn,Palette:()=>Gt,Point:()=>Jn,PointContainer:()=>pn,ProgressTracker:()=>dn,arithmetic:()=>Ue});var kn=class{constructor(){_e(this,"num",0),_e(this,"cols",[])}},jn=class{constructor(Qt,On){_e(this,"_numGroups"),_e(this,"_minCols"),_e(this,"_stats"),_e(this,"_groupsFull"),this._numGroups=Qt,this._minCols=On,this._stats=[];for(let Un=0;Un<=Qt;Un++)this._stats[Un]=new kn;this._groupsFull=0}check(Qt){this._groupsFull===this._numGroups+1&&(this.check=()=>{});const On=255&Qt,Un=Qt>>>8&255,Zn=Qt>>>16&255,or=On===Un&&Un===Zn?0:1+tn(Ut(On,Un,Zn).h,this._numGroups),mr=this._stats[or],cr=this._minCols;mr.num++,mr.num>cr||(mr.num===cr&&this._groupsFull++,mr.num<=cr&&this._stats[or].cols.push(Qt))}injectIntoDictionary(Qt){for(let On=0;On<=this._numGroups;On++)this._stats[On].num<=this._minCols&&this._stats[On].cols.forEach(Un=>{Qt[Un]?Qt[Un]++:Qt[Un]=1})}injectIntoArray(Qt){for(let On=0;On<=this._numGroups;On++)this._stats[On].num<=this._minCols&&this._stats[On].cols.forEach(Un=>{Qt.indexOf(Un)===-1&&Qt.push(Un)})}},Wn=class{constructor(Qt,On){_e(this,"progress"),_e(this,"_step"),_e(this,"_range"),_e(this,"_last"),_e(this,"_progressRange"),this._range=Qt,this._progressRange=On,this._step=Math.max(1,this._range/(Wn.steps+1)|0),this._last=-this._step,this.progress=0}shouldNotify(Qt){return Qt-this._last>=this._step&&(this._last=Qt,this.progress=Math.min(this._progressRange*this._last/this._range,this._progressRange),!0)}},dn=Wn;_e(dn,"steps",100);var Bn=class{constructor(Qt){_e(this,"r"),_e(this,"g"),_e(this,"b"),_e(this,"a"),this.r=this.g=this.b=this.a=Qt}toPoint(){return Jn.createByRGBA(this.r>>3,this.g>>3,this.b>>3,this.a>>3)}subtract(Qt,On,Un,Zn){this.r-=0|Qt,this.g-=0|On,this.b-=0|Un,this.a-=0|Zn}},mn=class extends Xn{constructor(Qt,On=256){super(),_e(this,"_pointArray"),_e(this,"_networkSize"),_e(this,"_network"),_e(this,"_sampleFactor"),_e(this,"_radPower"),_e(this,"_freq"),_e(this,"_bias"),_e(this,"_distance"),this._distance=Qt,this._pointArray=[],this._sampleFactor=1,this._networkSize=On,this._distance.setWhitePoint(2040,2040,2040,2040)}sample(Qt){this._pointArray=this._pointArray.concat(Qt.getPointArray())}*quantize(){this._init(),yield*this._learn(),yield{palette:this._buildPalette(),progress:100}}_init(){this._freq=[],this._bias=[],this._radPower=[],this._network=[];for(let Qt=0;Qt>3)*mn._radiusBias,pr=Er>>mn._radiusBiasShift;pr<=1&&(pr=0);for(let vr=0;vr>>0;or=On=On&&(Cr-=On),vr++,mr===0&&(mr=1),vr%mr==0){cr-=cr/Un|0,Er-=Er/mn._radiusDecrease|0,pr=Er>>mn._radiusBiasShift,pr<=1&&(pr=0);for(let Pi=0;Pi>>0}}}_buildPalette(){const Qt=new Gt;return this._network.forEach(On=>{Qt.add(On.toPoint())}),Qt.sort(),Qt}_alterNeighbour(Qt,On,Un,Zn,or,mr){let cr=On-Qt;cr<-1&&(cr=-1);let Er=On+Qt;Er>this._networkSize&&(Er=this._networkSize);let pr=On+1,Ar=On-1,vr=1;for(;prcr;){const Cr=this._radPower[vr++]/mn._alphaRadBias;if(prcr){const $r=this._network[Ar--];$r.subtract(Cr*($r.r-or),Cr*($r.g-Zn),Cr*($r.b-Un),Cr*($r.a-mr))}}}_alterSingle(Qt,On,Un,Zn,or,mr){Qt/=mn._initAlpha;const cr=this._network[On];cr.subtract(Qt*(cr.r-or),Qt*(cr.g-Zn),Qt*(cr.b-Un),Qt*(cr.a-mr))}_contest(Qt,On,Un,Zn){let or=2147483647,mr=or,cr=-1,Er=cr;for(let pr=0;pr>mn._initialBiasShift-3);Cr>mn._betaShift;this._freq[pr]-=$r,this._bias[pr]+=$r<>mn._betaShift),_e(Pn,"_betaGamma",mn._initialBias<>3,this.g>>3,this.b>>3,this.a>>3)}subtract(Qt,On,Un,Zn){this.r-=Qt,this.g-=On,this.b-=Un,this.a-=Zn}},er=class extends Xn{constructor(Qt,On=256){super(),_e(this,"_pointArray"),_e(this,"_networkSize"),_e(this,"_network"),_e(this,"_sampleFactor"),_e(this,"_radPower"),_e(this,"_freq"),_e(this,"_bias"),_e(this,"_distance"),this._distance=Qt,this._pointArray=[],this._sampleFactor=1,this._networkSize=On,this._distance.setWhitePoint(2040,2040,2040,2040)}sample(Qt){this._pointArray=this._pointArray.concat(Qt.getPointArray())}*quantize(){this._init(),yield*this._learn(),yield{palette:this._buildPalette(),progress:100}}_init(){this._freq=[],this._bias=[],this._radPower=[],this._network=[];for(let Qt=0;Qt>3)*er._radiusBias,pr=Er>>er._radiusBiasShift;pr<=1&&(pr=0);for(let vr=0;vr=On&&(Cr-=On),vr++,mr===0&&(mr=1),vr%mr==0){cr-=cr/Un,Er-=Er/er._radiusDecrease,pr=Er>>er._radiusBiasShift,pr<=1&&(pr=0);for(let Pi=0;Pi{Qt.add(On.toPoint())}),Qt.sort(),Qt}_alterNeighbour(Qt,On,Un,Zn,or,mr){let cr=On-Qt;cr<-1&&(cr=-1);let Er=On+Qt;Er>this._networkSize&&(Er=this._networkSize);let pr=On+1,Ar=On-1,vr=1;for(;prcr;){const Cr=this._radPower[vr++]/er._alphaRadBias;if(prcr){const $r=this._network[Ar--];$r.subtract(Cr*($r.r-or),Cr*($r.g-Zn),Cr*($r.b-Un),Cr*($r.a-mr))}}}_alterSingle(Qt,On,Un,Zn,or,mr){Qt/=er._initAlpha;const cr=this._network[On];cr.subtract(Qt*(cr.r-or),Qt*(cr.g-Zn),Qt*(cr.b-Un),Qt*(cr.a-mr))}_contest(Qt,On,Un,Zn){let or=2147483647,mr=or,cr=-1,Er=cr;for(let pr=0;pr>er._initialBiasShift-3);Cr>er._betaShift;this._freq[pr]-=$r,this._bias[pr]+=$r<>er._betaShift),_e(_r,"_betaGamma",er._initialBias<this._histogram[Zn]-this._histogram[Un]);if(Qt.length===0)return[];let On;switch(this._method){case 1:const Un=Math.min(Qt.length,this._initColors),Zn=Qt[Un-1],or=this._histogram[Zn];On=Qt.slice(0,Un);let mr=Un;const cr=Qt.length;for(;mr+Un)}_colorStats1D(Qt){const On=this._histogram,Un=Qt.getPointArray(),Zn=Un.length;for(let or=0;or{let vr=Math.round(Ar.w*Ar.h/cr)*dr._boxPixels;vr<2&&(vr=2);const Cr={};this._iterateBox(Ar,On,$r=>{const Jr=Zn[$r].uint32;this._hueStats.check(Jr),Jr in pr?pr[Jr]++:Jr in Cr?++Cr[Jr]>=vr&&(pr[Jr]=Cr[Jr]):Cr[Jr]=1})}),this._hueStats.injectIntoDictionary(pr)}_iterateBox(Qt,On,Un){const Zn=Qt,or=Zn.y*On+Zn.x,mr=(Zn.y+Zn.h-1)*On+(Zn.x+Zn.w-1),cr=On-Zn.w+1;let Er=0,pr=or;do Un.call(this,pr),pr+=++Er%Zn.w==0?cr:1;while(pr<=mr)}_makeBoxes(Qt,On,Un,Zn){const or=Qt%Un,mr=On%Zn,cr=Qt-or,Er=On-mr,pr=[];for(let Ar=0;Arthis._colors;){mr.length=0;for(let vr=0;vr3*this._colors?this._initialDistance:this._distanceIncrement}if(cr$r.distance-Cr.distance);let vr=0;for(;cr=0;vr--)Zn[vr]===0&&(vr!==Ar-1&&(Un[vr]=Un[Ar-1]),--Ar);Un.length=Ar,On.sort(),yield{palette:On,progress:100}}};function kr(Qt){const On=[];for(let Un=0;Un0){const Un=this._sums[On],Zn=this._reds[On]/Un,or=this._greens[On]/Un,mr=this._blues[On]/Un,cr=this._alphas[On]/Un,Er=Jn.createByRGBA(0|Zn,0|or,0|mr,0|cr);Qt.add(Er)}Qt.sort(),yield{palette:Qt,progress:100}}*_preparePalette(){yield*this._calculateMoments();let Qt=0;const On=kr(this._colors);for(let cr=1;cr1?this._calculateVariance(this._cubes[Qt]):0,On[cr]=this._cubes[cr].volume>1?this._calculateVariance(this._cubes[cr]):0):(On[Qt]=0,cr--),Qt=0;let Er=On[0];for(let pr=1;pr<=cr;++pr)On[pr]>Er&&(Er=On[pr],Qt=pr);if(Er<=0){this._colors=cr+1;break}}const Un=[],Zn=[],or=[],mr=[];for(let cr=0;cr0?(Un[cr]=Pr._volume(this._cubes[cr],this._momentsRed)/Er|0,Zn[cr]=Pr._volume(this._cubes[cr],this._momentsGreen)/Er|0,or[cr]=Pr._volume(this._cubes[cr],this._momentsBlue)/Er|0,mr[cr]=Pr._volume(this._cubes[cr],this._momentsAlpha)/Er|0):(Un[cr]=0,Zn[cr]=0,or[cr]=0,mr[cr]=0)}this._reds=kr(this._colors+1),this._greens=kr(this._colors+1),this._blues=kr(this._colors+1),this._alphas=kr(this._colors+1),this._sums=kr(this._colors+1);for(let cr=0,Er=this._pixels.length;cr>On),Zn=1+(Qt.g>>On),or=1+(Qt.b>>On),mr=1+(Qt.a>>On);this._weights[mr][Un][Zn][or]++,this._momentsRed[mr][Un][Zn][or]+=Qt.r,this._momentsGreen[mr][Un][Zn][or]+=Qt.g,this._momentsBlue[mr][Un][Zn][or]+=Qt.b,this._momentsAlpha[mr][Un][Zn][or]+=Qt.a,this._moments[mr][Un][Zn][or]+=this._table[Qt.r]+this._table[Qt.g]+this._table[Qt.b]+this._table[Qt.a]}*_calculateMoments(){const Qt=[],On=[],Un=[],Zn=[],or=[],mr=[],cr=Rr(this._sideSize,this._sideSize,this._sideSize),Er=Rr(this._sideSize,this._sideSize,this._sideSize),pr=Rr(this._sideSize,this._sideSize,this._sideSize),Ar=Rr(this._sideSize,this._sideSize,this._sideSize),vr=Rr(this._sideSize,this._sideSize,this._sideSize),Cr=Rr(this._sideSize,this._sideSize,this._sideSize);let $r=0;const Jr=new dn(this._alphaMaxSideIndex*this._maxSideIndex,99);for(let Zr=1;Zr<=this._alphaMaxSideIndex;++Zr){Yr(cr,this._sideSize,this._sideSize,this._sideSize,0),Yr(Er,this._sideSize,this._sideSize,this._sideSize,0),Yr(pr,this._sideSize,this._sideSize,this._sideSize,0),Yr(Ar,this._sideSize,this._sideSize,this._sideSize,0),Yr(vr,this._sideSize,this._sideSize,this._sideSize,0),Yr(Cr,this._sideSize,this._sideSize,this._sideSize,0);for(let jr=1;jr<=this._maxSideIndex;++jr,++$r){Jr.shouldNotify($r)&&(yield{progress:Jr.progress}),li(Qt,this._sideSize,0),li(On,this._sideSize,0),li(Un,this._sideSize,0),li(Zn,this._sideSize,0),li(or,this._sideSize,0),li(mr,this._sideSize,0);for(let Ur=1;Ur<=this._maxSideIndex;++Ur){let Ci=0,Pi=0,qi=0,Fi=0,so=0,Ui=0;for(let ti=1;ti<=this._maxSideIndex;++ti)Ci+=this._weights[Zr][jr][Ur][ti],Pi+=this._momentsRed[Zr][jr][Ur][ti],qi+=this._momentsGreen[Zr][jr][Ur][ti],Fi+=this._momentsBlue[Zr][jr][Ur][ti],so+=this._momentsAlpha[Zr][jr][Ur][ti],Ui+=this._moments[Zr][jr][Ur][ti],Qt[ti]+=Ci,On[ti]+=Pi,Un[ti]+=qi,Zn[ti]+=Fi,or[ti]+=so,mr[ti]+=Ui,cr[jr][Ur][ti]=cr[jr-1][Ur][ti]+Qt[ti],Er[jr][Ur][ti]=Er[jr-1][Ur][ti]+On[ti],pr[jr][Ur][ti]=pr[jr-1][Ur][ti]+Un[ti],Ar[jr][Ur][ti]=Ar[jr-1][Ur][ti]+Zn[ti],vr[jr][Ur][ti]=vr[jr-1][Ur][ti]+or[ti],Cr[jr][Ur][ti]=Cr[jr-1][Ur][ti]+mr[ti],this._weights[Zr][jr][Ur][ti]=this._weights[Zr-1][jr][Ur][ti]+cr[jr][Ur][ti],this._momentsRed[Zr][jr][Ur][ti]=this._momentsRed[Zr-1][jr][Ur][ti]+Er[jr][Ur][ti],this._momentsGreen[Zr][jr][Ur][ti]=this._momentsGreen[Zr-1][jr][Ur][ti]+pr[jr][Ur][ti],this._momentsBlue[Zr][jr][Ur][ti]=this._momentsBlue[Zr-1][jr][Ur][ti]+Ar[jr][Ur][ti],this._momentsAlpha[Zr][jr][Ur][ti]=this._momentsAlpha[Zr-1][jr][Ur][ti]+vr[jr][Ur][ti],this._moments[Zr][jr][Ur][ti]=this._moments[Zr-1][jr][Ur][ti]+Cr[jr][Ur][ti]}}}}static _volumeFloat(Qt,On){return On[Qt.alphaMaximum][Qt.redMaximum][Qt.greenMaximum][Qt.blueMaximum]-On[Qt.alphaMaximum][Qt.redMaximum][Qt.greenMinimum][Qt.blueMaximum]-On[Qt.alphaMaximum][Qt.redMinimum][Qt.greenMaximum][Qt.blueMaximum]+On[Qt.alphaMaximum][Qt.redMinimum][Qt.greenMinimum][Qt.blueMaximum]-On[Qt.alphaMinimum][Qt.redMaximum][Qt.greenMaximum][Qt.blueMaximum]+On[Qt.alphaMinimum][Qt.redMaximum][Qt.greenMinimum][Qt.blueMaximum]+On[Qt.alphaMinimum][Qt.redMinimum][Qt.greenMaximum][Qt.blueMaximum]-On[Qt.alphaMinimum][Qt.redMinimum][Qt.greenMinimum][Qt.blueMaximum]-(On[Qt.alphaMaximum][Qt.redMaximum][Qt.greenMaximum][Qt.blueMinimum]-On[Qt.alphaMinimum][Qt.redMaximum][Qt.greenMaximum][Qt.blueMinimum]-On[Qt.alphaMaximum][Qt.redMaximum][Qt.greenMinimum][Qt.blueMinimum]+On[Qt.alphaMinimum][Qt.redMaximum][Qt.greenMinimum][Qt.blueMinimum]-On[Qt.alphaMaximum][Qt.redMinimum][Qt.greenMaximum][Qt.blueMinimum]+On[Qt.alphaMinimum][Qt.redMinimum][Qt.greenMaximum][Qt.blueMinimum]+On[Qt.alphaMaximum][Qt.redMinimum][Qt.greenMinimum][Qt.blueMinimum]-On[Qt.alphaMinimum][Qt.redMinimum][Qt.greenMinimum][Qt.blueMinimum])}static _volume(Qt,On){return 0|Pr._volumeFloat(Qt,On)}static _top(Qt,On,Un,Zn){let or;switch(On){case Pr._alpha:or=Zn[Un][Qt.redMaximum][Qt.greenMaximum][Qt.blueMaximum]-Zn[Un][Qt.redMaximum][Qt.greenMinimum][Qt.blueMaximum]-Zn[Un][Qt.redMinimum][Qt.greenMaximum][Qt.blueMaximum]+Zn[Un][Qt.redMinimum][Qt.greenMinimum][Qt.blueMaximum]-(Zn[Un][Qt.redMaximum][Qt.greenMaximum][Qt.blueMinimum]-Zn[Un][Qt.redMaximum][Qt.greenMinimum][Qt.blueMinimum]-Zn[Un][Qt.redMinimum][Qt.greenMaximum][Qt.blueMinimum]+Zn[Un][Qt.redMinimum][Qt.greenMinimum][Qt.blueMinimum]);break;case Pr._red:or=Zn[Qt.alphaMaximum][Un][Qt.greenMaximum][Qt.blueMaximum]-Zn[Qt.alphaMaximum][Un][Qt.greenMinimum][Qt.blueMaximum]-Zn[Qt.alphaMinimum][Un][Qt.greenMaximum][Qt.blueMaximum]+Zn[Qt.alphaMinimum][Un][Qt.greenMinimum][Qt.blueMaximum]-(Zn[Qt.alphaMaximum][Un][Qt.greenMaximum][Qt.blueMinimum]-Zn[Qt.alphaMaximum][Un][Qt.greenMinimum][Qt.blueMinimum]-Zn[Qt.alphaMinimum][Un][Qt.greenMaximum][Qt.blueMinimum]+Zn[Qt.alphaMinimum][Un][Qt.greenMinimum][Qt.blueMinimum]);break;case Pr._green:or=Zn[Qt.alphaMaximum][Qt.redMaximum][Un][Qt.blueMaximum]-Zn[Qt.alphaMaximum][Qt.redMinimum][Un][Qt.blueMaximum]-Zn[Qt.alphaMinimum][Qt.redMaximum][Un][Qt.blueMaximum]+Zn[Qt.alphaMinimum][Qt.redMinimum][Un][Qt.blueMaximum]-(Zn[Qt.alphaMaximum][Qt.redMaximum][Un][Qt.blueMinimum]-Zn[Qt.alphaMaximum][Qt.redMinimum][Un][Qt.blueMinimum]-Zn[Qt.alphaMinimum][Qt.redMaximum][Un][Qt.blueMinimum]+Zn[Qt.alphaMinimum][Qt.redMinimum][Un][Qt.blueMinimum]);break;case Pr._blue:or=Zn[Qt.alphaMaximum][Qt.redMaximum][Qt.greenMaximum][Un]-Zn[Qt.alphaMaximum][Qt.redMaximum][Qt.greenMinimum][Un]-Zn[Qt.alphaMaximum][Qt.redMinimum][Qt.greenMaximum][Un]+Zn[Qt.alphaMaximum][Qt.redMinimum][Qt.greenMinimum][Un]-(Zn[Qt.alphaMinimum][Qt.redMaximum][Qt.greenMaximum][Un]-Zn[Qt.alphaMinimum][Qt.redMaximum][Qt.greenMinimum][Un]-Zn[Qt.alphaMinimum][Qt.redMinimum][Qt.greenMaximum][Un]+Zn[Qt.alphaMinimum][Qt.redMinimum][Qt.greenMinimum][Un]);break;default:throw new Error("impossible")}return 0|or}static _bottom(Qt,On,Un){switch(On){case Pr._alpha:return-Un[Qt.alphaMinimum][Qt.redMaximum][Qt.greenMaximum][Qt.blueMaximum]+Un[Qt.alphaMinimum][Qt.redMaximum][Qt.greenMinimum][Qt.blueMaximum]+Un[Qt.alphaMinimum][Qt.redMinimum][Qt.greenMaximum][Qt.blueMaximum]-Un[Qt.alphaMinimum][Qt.redMinimum][Qt.greenMinimum][Qt.blueMaximum]-(-Un[Qt.alphaMinimum][Qt.redMaximum][Qt.greenMaximum][Qt.blueMinimum]+Un[Qt.alphaMinimum][Qt.redMaximum][Qt.greenMinimum][Qt.blueMinimum]+Un[Qt.alphaMinimum][Qt.redMinimum][Qt.greenMaximum][Qt.blueMinimum]-Un[Qt.alphaMinimum][Qt.redMinimum][Qt.greenMinimum][Qt.blueMinimum]);case Pr._red:return-Un[Qt.alphaMaximum][Qt.redMinimum][Qt.greenMaximum][Qt.blueMaximum]+Un[Qt.alphaMaximum][Qt.redMinimum][Qt.greenMinimum][Qt.blueMaximum]+Un[Qt.alphaMinimum][Qt.redMinimum][Qt.greenMaximum][Qt.blueMaximum]-Un[Qt.alphaMinimum][Qt.redMinimum][Qt.greenMinimum][Qt.blueMaximum]-(-Un[Qt.alphaMaximum][Qt.redMinimum][Qt.greenMaximum][Qt.blueMinimum]+Un[Qt.alphaMaximum][Qt.redMinimum][Qt.greenMinimum][Qt.blueMinimum]+Un[Qt.alphaMinimum][Qt.redMinimum][Qt.greenMaximum][Qt.blueMinimum]-Un[Qt.alphaMinimum][Qt.redMinimum][Qt.greenMinimum][Qt.blueMinimum]);case Pr._green:return-Un[Qt.alphaMaximum][Qt.redMaximum][Qt.greenMinimum][Qt.blueMaximum]+Un[Qt.alphaMaximum][Qt.redMinimum][Qt.greenMinimum][Qt.blueMaximum]+Un[Qt.alphaMinimum][Qt.redMaximum][Qt.greenMinimum][Qt.blueMaximum]-Un[Qt.alphaMinimum][Qt.redMinimum][Qt.greenMinimum][Qt.blueMaximum]-(-Un[Qt.alphaMaximum][Qt.redMaximum][Qt.greenMinimum][Qt.blueMinimum]+Un[Qt.alphaMaximum][Qt.redMinimum][Qt.greenMinimum][Qt.blueMinimum]+Un[Qt.alphaMinimum][Qt.redMaximum][Qt.greenMinimum][Qt.blueMinimum]-Un[Qt.alphaMinimum][Qt.redMinimum][Qt.greenMinimum][Qt.blueMinimum]);case Pr._blue:return-Un[Qt.alphaMaximum][Qt.redMaximum][Qt.greenMaximum][Qt.blueMinimum]+Un[Qt.alphaMaximum][Qt.redMaximum][Qt.greenMinimum][Qt.blueMinimum]+Un[Qt.alphaMaximum][Qt.redMinimum][Qt.greenMaximum][Qt.blueMinimum]-Un[Qt.alphaMaximum][Qt.redMinimum][Qt.greenMinimum][Qt.blueMinimum]-(-Un[Qt.alphaMinimum][Qt.redMaximum][Qt.greenMaximum][Qt.blueMinimum]+Un[Qt.alphaMinimum][Qt.redMaximum][Qt.greenMinimum][Qt.blueMinimum]+Un[Qt.alphaMinimum][Qt.redMinimum][Qt.greenMaximum][Qt.blueMinimum]-Un[Qt.alphaMinimum][Qt.redMinimum][Qt.greenMinimum][Qt.blueMinimum]);default:return 0}}_calculateVariance(Qt){const On=Pr._volume(Qt,this._momentsRed),Un=Pr._volume(Qt,this._momentsGreen),Zn=Pr._volume(Qt,this._momentsBlue),or=Pr._volume(Qt,this._momentsAlpha);return Pr._volumeFloat(Qt,this._moments)-(On*On+Un*Un+Zn*Zn+or*or)/Pr._volume(Qt,this._weights)}_maximize(Qt,On,Un,Zn,or,mr,cr,Er,pr){const Ar=0|Pr._bottom(Qt,On,this._momentsRed),vr=0|Pr._bottom(Qt,On,this._momentsGreen),Cr=0|Pr._bottom(Qt,On,this._momentsBlue),$r=0|Pr._bottom(Qt,On,this._momentsAlpha),Jr=0|Pr._bottom(Qt,On,this._weights);let Zr=0,jr=-1;for(let Ur=Un;UrZr&&(Zr=ti,jr=Ur))}}return{max:Zr,position:jr}}_cut(Qt,On){let Un;const Zn=Pr._volume(Qt,this._momentsRed),or=Pr._volume(Qt,this._momentsGreen),mr=Pr._volume(Qt,this._momentsBlue),cr=Pr._volume(Qt,this._momentsAlpha),Er=Pr._volume(Qt,this._weights),pr=this._maximize(Qt,Pr._red,Qt.redMinimum+1,Qt.redMaximum,Zn,or,mr,cr,Er),Ar=this._maximize(Qt,Pr._green,Qt.greenMinimum+1,Qt.greenMaximum,Zn,or,mr,cr,Er),vr=this._maximize(Qt,Pr._blue,Qt.blueMinimum+1,Qt.blueMaximum,Zn,or,mr,cr,Er),Cr=this._maximize(Qt,Pr._alpha,Qt.alphaMinimum+1,Qt.alphaMaximum,Zn,or,mr,cr,Er);if(Cr.max>=pr.max&&Cr.max>=Ar.max&&Cr.max>=vr.max){if(Un=Pr._alpha,Cr.position<0)return!1}else Un=pr.max>=Cr.max&&pr.max>=Ar.max&&pr.max>=vr.max?Pr._red:Ar.max>=Cr.max&&Ar.max>=pr.max&&Ar.max>=vr.max?Pr._green:Pr._blue;switch(On.redMaximum=Qt.redMaximum,On.greenMaximum=Qt.greenMaximum,On.blueMaximum=Qt.blueMaximum,On.alphaMaximum=Qt.alphaMaximum,Un){case Pr._red:On.redMinimum=Qt.redMaximum=pr.position,On.greenMinimum=Qt.greenMinimum,On.blueMinimum=Qt.blueMinimum,On.alphaMinimum=Qt.alphaMinimum;break;case Pr._green:On.greenMinimum=Qt.greenMaximum=Ar.position,On.redMinimum=Qt.redMinimum,On.blueMinimum=Qt.blueMinimum,On.alphaMinimum=Qt.alphaMinimum;break;case Pr._blue:On.blueMinimum=Qt.blueMaximum=vr.position,On.redMinimum=Qt.redMinimum,On.greenMinimum=Qt.greenMinimum,On.alphaMinimum=Qt.alphaMinimum;break;case Pr._alpha:On.alphaMinimum=Qt.alphaMaximum=Cr.position,On.blueMinimum=Qt.blueMinimum,On.redMinimum=Qt.redMinimum,On.greenMinimum=Qt.greenMinimum}return Qt.volume=(Qt.redMaximum-Qt.redMinimum)*(Qt.greenMaximum-Qt.greenMinimum)*(Qt.blueMaximum-Qt.blueMinimum)*(Qt.alphaMaximum-Qt.alphaMinimum),On.volume=(On.redMaximum-On.redMinimum)*(On.greenMaximum-On.greenMinimum)*(On.blueMaximum-On.blueMinimum)*(On.alphaMaximum-On.alphaMinimum),!0}_initialize(Qt){this._colors=Qt,this._cubes=[];for(let On=0;Onyi,ErrorDiffusionArray:()=>xi,ErrorDiffusionArrayKernel:()=>gi,ErrorDiffusionRiemersma:()=>oi,NearestColor:()=>Gi});var yi=class{quantizeSync(Qt,On){for(const Un of this.quantize(Qt,On))if(Un.pointContainer)return Un.pointContainer;throw new Error("unreachable")}},Gi=class extends yi{constructor(Qt){super(),_e(this,"_distance"),this._distance=Qt}*quantize(Qt,On){const Un=Qt.getPointArray(),Zn=Qt.getWidth(),or=Qt.getHeight(),mr=new dn(or,99);for(let cr=0;cr(Qt[Qt.FloydSteinberg=0]="FloydSteinberg",Qt[Qt.FalseFloydSteinberg=1]="FalseFloydSteinberg",Qt[Qt.Stucki=2]="Stucki",Qt[Qt.Atkinson=3]="Atkinson",Qt[Qt.Jarvis=4]="Jarvis",Qt[Qt.Burkes=5]="Burkes",Qt[Qt.Sierra=6]="Sierra",Qt[Qt.TwoSierra=7]="TwoSierra",Qt[Qt.SierraLite=8]="SierraLite",Qt))(gi||{}),xi=class extends yi{constructor(Qt,On,Un=!0,Zn=0,or=!1){super(),_e(this,"_minColorDistance"),_e(this,"_serpentine"),_e(this,"_kernel"),_e(this,"_calculateErrorLikeGIMP"),_e(this,"_distance"),this._setKernel(On),this._distance=Qt,this._minColorDistance=Zn,this._serpentine=Un,this._calculateErrorLikeGIMP=or}*quantize(Qt,On){const Un=Qt.getPointArray(),Zn=new Jn,or=Qt.getWidth(),mr=Qt.getHeight(),cr=[];let Er=1,pr=1;for(const vr of this._kernel){const Cr=vr[2]+1;pr=0&&$a+jr=0&&mo+vrOn&&(Qt.length=On);const Un=Qt.length;for(let Zn=0;Zn=0&&Qt.x=0&&Qt.y{const Ar=Un[Er+pr*Zn];let{r:vr,g:Cr,b:$r,a:Jr}=Ar;for(let Ci=0;CiDi});var Co=.01,Wi=.03;function Di(Qt,On){if(Qt.getHeight()!==On.getHeight()||Qt.getWidth()!==On.getWidth())throw new Error("Images have different sizes!");const Un=(255*Co)**2,Zn=(255*Wi)**2;let or=0,mr=0;return function(cr,Er,pr){const Ar=cr.getWidth(),vr=cr.getHeight();for(let Cr=0;Cr{let vr=0,Cr=0,$r=0;for(let Zr=0;Zrue.nextTick(Qt):Qt=>setTimeout(Qt,0);function Ro(Qt,{colorDistanceFormula:On,paletteQuantization:Un,colors:Zn}={}){const or=ua(Ei(On),Un,Zn);return Qt.forEach(mr=>or.sample(mr)),or.quantizeSync()}async function la(Qt,{colorDistanceFormula:On,paletteQuantization:Un,colors:Zn,onProgress:or}={}){return new Promise((mr,cr)=>{const Er=ua(Ei(On),Un,Zn);let pr;Qt.forEach(Cr=>Er.sample(Cr));const Ar=Er.quantize(),vr=()=>{try{const Cr=Ar.next();Cr.done?mr(pr):(Cr.value.palette&&(pr=Cr.value.palette),or&&or(Cr.value.progress),bo(vr))}catch(Cr){cr(Cr)}};bo(vr)})}function Ao(Qt,On,{colorDistanceFormula:Un,imageQuantization:Zn}={}){return aa(Ei(Un),Zn).quantizeSync(Qt,On)}async function ca(Qt,On,{colorDistanceFormula:Un,imageQuantization:Zn,onProgress:or}={}){return new Promise((mr,cr)=>{let Er;const pr=aa(Ei(Un),Zn).quantize(Qt,On),Ar=()=>{try{const vr=pr.next();vr.done?mr(Er):(vr.value.pointContainer&&(Er=vr.value.pointContainer),or&&or(vr.value.progress),bo(Ar))}catch(vr){cr(vr)}};bo(Ar)})}function Ei(Qt="euclidean-bt709"){switch(Qt){case"cie94-graphic-arts":return new Xe;case"cie94-textiles":return new Ye;case"ciede2000":return new sn;case"color-metric":return new yn;case"euclidean":return new wn;case"euclidean-bt709":return new Tn;case"euclidean-bt709-noalpha":return new xn;case"manhattan":return new zn;case"manhattan-bt709":return new Kn;case"manhattan-nommyde":return new Yn;case"pngquant":return new Rn;default:throw new Error(`Unknown colorDistanceFormula ${Qt}`)}}function aa(Qt,On="floyd-steinberg"){switch(On){case"nearest":return new Gi(Qt);case"riemersma":return new oi(Qt);case"floyd-steinberg":return new xi(Qt,0);case"false-floyd-steinberg":return new xi(Qt,1);case"stucki":return new xi(Qt,2);case"atkinson":return new xi(Qt,3);case"jarvis":return new xi(Qt,4);case"burkes":return new xi(Qt,5);case"sierra":return new xi(Qt,6);case"two-sierra":return new xi(Qt,7);case"sierra-lite":return new xi(Qt,8);default:throw new Error(`Unknown imageQuantization ${On}`)}}function ua(Qt,On="wuquant",Un=256){switch(On){case"neuquant":return new Pn(Qt,Un);case"rgbquant":return new nr(Qt,Un);case"wuquant":return new hi(Qt,Un);case"neuquant-float":return new _r(Qt,Un);default:throw new Error(`Unknown paletteQuantization ${On}`)}}ne.exports=xe(Se)}},__webpack_module_cache__={};function __webpack_require__(ne){var oe=__webpack_module_cache__[ne];if(oe!==void 0)return oe.exports;var ce=__webpack_module_cache__[ne]={exports:{}};return __webpack_modules__[ne](ce,ce.exports,__webpack_require__),ce.exports}__webpack_require__.n=ne=>{var oe=ne&&ne.__esModule?()=>ne.default:()=>ne;return __webpack_require__.d(oe,{a:oe}),oe},__webpack_require__.d=(ne,oe)=>{for(var ce in oe)__webpack_require__.o(oe,ce)&&!__webpack_require__.o(ne,ce)&&Object.defineProperty(ne,ce,{enumerable:!0,get:oe[ce]})},__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=(ne,oe)=>Object.prototype.hasOwnProperty.call(ne,oe),__webpack_require__.r=ne=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(ne,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(ne,"__esModule",{value:!0})},(()=>{var ne={};__webpack_require__.r(ne),__webpack_require__.d(ne,{AUTO:()=>Nn,BLEND_ADD:()=>Gt,BLEND_DARKEN:()=>jn,BLEND_DESTINATION_OVER:()=>pn,BLEND_DIFFERENCE:()=>Bn,BLEND_EXCLUSION:()=>mn,BLEND_HARDLIGHT:()=>dn,BLEND_LIGHTEN:()=>Wn,BLEND_MULTIPLY:()=>tn,BLEND_OVERLAY:()=>kn,BLEND_SCREEN:()=>bn,BLEND_SOURCE_OVER:()=>Jn,EDGE_CROP:()=>er,EDGE_EXTEND:()=>Pn,EDGE_WRAP:()=>ur,HORIZONTAL_ALIGN_CENTER:()=>Yn,HORIZONTAL_ALIGN_LEFT:()=>zn,HORIZONTAL_ALIGN_RIGHT:()=>Kn,VERTICAL_ALIGN_BOTTOM:()=>Xn,VERTICAL_ALIGN_MIDDLE:()=>Mn,VERTICAL_ALIGN_TOP:()=>Rn});var oe={};__webpack_require__.r(oe),__webpack_require__.d(oe,{add:()=>sr,darken:()=>Mr,difference:()=>li,dstOver:()=>dr,exclusion:()=>ei,hardLight:()=>Yr,lighten:()=>Rr,multiply:()=>Sr,overlay:()=>kr,screen:()=>nr,srcOver:()=>_r});var ce=__webpack_require__(5546),ue=__webpack_require__.n(ce),pe=__webpack_require__(1023),me=__webpack_require__.n(pe),ge=__webpack_require__(2699),ye=__webpack_require__.n(ge);function ve(rn){if(rn===void 0)return!1;if(typeof rn!="function")throw new TypeError("Callback must be a function");return!0}function xe(rn,ln){if(typeof rn=="string"&&(rn=new Error(rn)),typeof ln=="function")return ln.call(this,rn);throw rn}function _e(rn,ln,En,$n,An,Ln){ln=Math.round(ln),En=Math.round(En),$n=Math.round($n),An=Math.round(An);for(let qn=En;qn1&&($i-=1),$i<1/6?vi+6*(Ri-vi)*$i:$i<.5?Ri:$i<2/3?vi+(Ri-vi)*(2/3-$i)*6:vi}if(gr=nn(gr,360),yr=nn(yr,100),xr=nn(xr,100),yr===0)Lr=Hr=si=xr;else{var ni=xr<.5?xr*(1+yr):xr+yr-xr*yr,wi=2*xr-ni;Lr=_i(wi,ni,gr+1/3),Hr=_i(wi,ni,gr),si=_i(wi,ni,gr-1/3)}return{r:255*Lr,g:255*Hr,b:255*si}}($n.h,ar,fr),Or=!0,wr="hsl"),$n.hasOwnProperty("a")&&(Vn=$n.a)),Vn=Xt(Vn),{ok:Or,format:$n.format||wr,r:Math.min(255,Math.max(Gn.r,0)),g:Math.min(255,Math.max(Gn.g,0)),b:Math.min(255,Math.max(Gn.b,0)),a:Vn}}(rn);this._originalInput=rn,this._r=En.r,this._g=En.g,this._b=En.b,this._a=En.a,this._roundA=Math.round(100*this._a)/100,this._format=ln.format||En.format,this._gradientType=ln.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=En.ok}function Fe(rn,ln,En){rn=nn(rn,255),ln=nn(ln,255),En=nn(En,255);var $n,An,Ln=Math.max(rn,ln,En),qn=Math.min(rn,ln,En),Gn=(Ln+qn)/2;if(Ln==qn)$n=An=0;else{var Vn=Ln-qn;switch(An=Gn>.5?Vn/(2-Ln-qn):Vn/(Ln+qn),Ln){case rn:$n=(ln-En)/Vn+(ln>1)+720)%360;--ln;)$n.h=($n.h+An)%360,Ln.push(Ne($n));return Ln}function Kt(rn,ln){ln=ln||6;for(var En=Ne(rn).toHsv(),$n=En.h,An=En.s,Ln=En.v,qn=[],Gn=1/ln;ln--;)qn.push(Ne({h:$n,s:An,v:Ln})),Ln=(Ln+Gn)%1;return qn}Ne.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var rn=this.toRgb();return(299*rn.r+587*rn.g+114*rn.b)/1e3},getLuminance:function(){var rn,ln,En,$n=this.toRgb();return rn=$n.r/255,ln=$n.g/255,En=$n.b/255,.2126*(rn<=.03928?rn/12.92:Math.pow((rn+.055)/1.055,2.4))+.7152*(ln<=.03928?ln/12.92:Math.pow((ln+.055)/1.055,2.4))+.0722*(En<=.03928?En/12.92:Math.pow((En+.055)/1.055,2.4))},setAlpha:function(rn){return this._a=Xt(rn),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var rn=Ue(this._r,this._g,this._b);return{h:360*rn.h,s:rn.s,v:rn.v,a:this._a}},toHsvString:function(){var rn=Ue(this._r,this._g,this._b),ln=Math.round(360*rn.h),En=Math.round(100*rn.s),$n=Math.round(100*rn.v);return this._a==1?"hsv("+ln+", "+En+"%, "+$n+"%)":"hsva("+ln+", "+En+"%, "+$n+"%, "+this._roundA+")"},toHsl:function(){var rn=Fe(this._r,this._g,this._b);return{h:360*rn.h,s:rn.s,l:rn.l,a:this._a}},toHslString:function(){var rn=Fe(this._r,this._g,this._b),ln=Math.round(360*rn.h),En=Math.round(100*rn.s),$n=Math.round(100*rn.l);return this._a==1?"hsl("+ln+", "+En+"%, "+$n+"%)":"hsla("+ln+", "+En+"%, "+$n+"%, "+this._roundA+")"},toHex:function(rn){return We(this._r,this._g,this._b,rn)},toHexString:function(rn){return"#"+this.toHex(rn)},toHex8:function(rn){return function(ln,En,$n,An,Ln){var qn=[Cn(Math.round(ln).toString(16)),Cn(Math.round(En).toString(16)),Cn(Math.round($n).toString(16)),Cn(Yt(An))];return Ln&&qn[0].charAt(0)==qn[0].charAt(1)&&qn[1].charAt(0)==qn[1].charAt(1)&&qn[2].charAt(0)==qn[2].charAt(1)&&qn[3].charAt(0)==qn[3].charAt(1)?qn[0].charAt(0)+qn[1].charAt(0)+qn[2].charAt(0)+qn[3].charAt(0):qn.join("")}(this._r,this._g,this._b,this._a,rn)},toHex8String:function(rn){return"#"+this.toHex8(rn)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*nn(this._r,255))+"%",g:Math.round(100*nn(this._g,255))+"%",b:Math.round(100*nn(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(100*nn(this._r,255))+"%, "+Math.round(100*nn(this._g,255))+"%, "+Math.round(100*nn(this._b,255))+"%)":"rgba("+Math.round(100*nn(this._r,255))+"%, "+Math.round(100*nn(this._g,255))+"%, "+Math.round(100*nn(this._b,255))+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":!(this._a<1)&&(un[We(this._r,this._g,this._b,!0)]||!1)},toFilter:function(rn){var ln="#"+qe(this._r,this._g,this._b,this._a),En=ln,$n=this._gradientType?"GradientType = 1, ":"";if(rn){var An=Ne(rn);En="#"+qe(An._r,An._g,An._b,An._a)}return"progid:DXImageTransform.Microsoft.gradient("+$n+"startColorstr="+ln+",endColorstr="+En+")"},toString:function(rn){var ln=!!rn;rn=rn||this._format;var En=!1,$n=this._a<1&&this._a>=0;return ln||!$n||rn!=="hex"&&rn!=="hex6"&&rn!=="hex3"&&rn!=="hex4"&&rn!=="hex8"&&rn!=="name"?(rn==="rgb"&&(En=this.toRgbString()),rn==="prgb"&&(En=this.toPercentageRgbString()),rn!=="hex"&&rn!=="hex6"||(En=this.toHexString()),rn==="hex3"&&(En=this.toHexString(!0)),rn==="hex4"&&(En=this.toHex8String(!0)),rn==="hex8"&&(En=this.toHex8String()),rn==="name"&&(En=this.toName()),rn==="hsl"&&(En=this.toHslString()),rn==="hsv"&&(En=this.toHsvString()),En||this.toHexString()):rn==="name"&&this._a===0?this.toName():this.toRgbString()},clone:function(){return Ne(this.toString())},_applyModification:function(rn,ln){var En=rn.apply(null,[this].concat([].slice.call(ln)));return this._r=En._r,this._g=En._g,this._b=En._b,this.setAlpha(En._a),this},lighten:function(){return this._applyModification(Dt,arguments)},brighten:function(){return this._applyModification(Je,arguments)},darken:function(){return this._applyModification(Ut,arguments)},desaturate:function(){return this._applyModification(ze,arguments)},saturate:function(){return this._applyModification(Ge,arguments)},greyscale:function(){return this._applyModification(Ze,arguments)},spin:function(){return this._applyModification(jt,arguments)},_applyCombination:function(rn,ln){return rn.apply(null,[this].concat([].slice.call(ln)))},analogous:function(){return this._applyCombination(en,arguments)},complement:function(){return this._applyCombination(Ke,arguments)},monochromatic:function(){return this._applyCombination(Kt,arguments)},splitcomplement:function(){return this._applyCombination(Zt,arguments)},triad:function(){return this._applyCombination(an,[3])},tetrad:function(){return this._applyCombination(an,[4])}},Ne.fromRatio=function(rn,ln){if(Ie(rn)=="object"){var En={};for(var $n in rn)rn.hasOwnProperty($n)&&(En[$n]=$n==="a"?rn[$n]:Nt(rn[$n]));rn=En}return Ne(rn,ln)},Ne.equals=function(rn,ln){return!(!rn||!ln)&&Ne(rn).toRgbString()==Ne(ln).toRgbString()},Ne.random=function(){return Ne.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},Ne.mix=function(rn,ln,En){En=En===0?0:En||50;var $n=Ne(rn).toRgb(),An=Ne(ln).toRgb(),Ln=En/100;return Ne({r:(An.r-$n.r)*Ln+$n.r,g:(An.g-$n.g)*Ln+$n.g,b:(An.b-$n.b)*Ln+$n.b,a:(An.a-$n.a)*Ln+$n.a})},Ne.readability=function(rn,ln){var En=Ne(rn),$n=Ne(ln);return(Math.max(En.getLuminance(),$n.getLuminance())+.05)/(Math.min(En.getLuminance(),$n.getLuminance())+.05)},Ne.isReadable=function(rn,ln,En){var $n,An,Ln,qn,Gn,Vn=Ne.readability(rn,ln);switch(An=!1,(Ln=En,(qn=((Ln=Ln||{level:"AA",size:"small"}).level||"AA").toUpperCase())!=="AA"&&qn!=="AAA"&&(qn="AA"),(Gn=(Ln.size||"small").toLowerCase())!=="small"&&Gn!=="large"&&(Gn="small"),$n={level:qn,size:Gn}).level+$n.size){case"AAsmall":case"AAAlarge":An=Vn>=4.5;break;case"AAlarge":An=Vn>=3;break;case"AAAsmall":An=Vn>=7}return An},Ne.mostReadable=function(rn,ln,En){var $n,An,Ln,qn,Gn=null,Vn=0;An=(En=En||{}).includeFallbackColors,Ln=En.level,qn=En.size;for(var ar=0;arVn&&(Vn=$n,Gn=Ne(ln[ar]));return Ne.isReadable(rn,Gn,{level:Ln,size:qn})||!An?Gn:(En.includeFallbackColors=!1,Ne.mostReadable(rn,["#fff","#000"],En))};var Wt=Ne.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},un=Ne.hexNames=function(rn){var ln={};for(var En in rn)rn.hasOwnProperty(En)&&(ln[rn[En]]=En);return ln}(Wt);function Xt(rn){return rn=parseFloat(rn),(isNaN(rn)||rn<0||rn>1)&&(rn=1),rn}function nn(rn,ln){(function($n){return typeof $n=="string"&&$n.indexOf(".")!=-1&&parseFloat($n)===1})(rn)&&(rn="100%");var En=function($n){return typeof $n=="string"&&$n.indexOf("%")!=-1}(rn);return rn=Math.min(ln,Math.max(0,parseFloat(rn))),En&&(rn=parseInt(rn*ln,10)/100),Math.abs(rn-ln)<1e-6?1:rn%ln/parseFloat(ln)}function vn(rn){return Math.min(1,Math.max(0,rn))}function Sn(rn){return parseInt(rn,16)}function Cn(rn){return rn.length==1?"0"+rn:""+rn}function Nt(rn){return rn<=1&&(rn=100*rn+"%"),rn}function Yt(rn){return Math.round(255*parseFloat(rn)).toString(16)}function Jt(rn){return Sn(rn)/255}var hn,Ye,Xe,Pt=(Ye="[\\s|\\(]+("+(hn="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+hn+")[,|\\s]+("+hn+")\\s*\\)?",Xe="[\\s|\\(]+("+hn+")[,|\\s]+("+hn+")[,|\\s]+("+hn+")[,|\\s]+("+hn+")\\s*\\)?",{CSS_UNIT:new RegExp(hn),rgb:new RegExp("rgb"+Ye),rgba:new RegExp("rgba"+Xe),hsl:new RegExp("hsl"+Ye),hsla:new RegExp("hsla"+Xe),hsv:new RegExp("hsv"+Ye),hsva:new RegExp("hsva"+Xe),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function sn(rn){return!!Pt.CSS_UNIT.exec(rn)}function yn(rn,ln){this.size=this.size||rn,this.smallerSize=this.smallerSize||ln,function(En){for(let $n=1;$nAn?"1":"0";return Ln};const wn=[],Tn=yn;__webpack_require__(9307);const xn=(rn,ln)=>{let{url:En,...$n}=rn;fetch(En,$n).then(An=>{if(An.ok)return An.arrayBuffer().catch(Ln=>{throw new Error(`Response is not a buffer for url ${En}. Error: ${Ln.message}`)});throw new Error(`HTTP Status ${An.status} for url ${En}`)}).then(An=>ln(null,An)).catch(An=>ln(An))},Nn=-1,zn=1,Yn=2,Kn=4,Rn=8,Mn=16,Xn=32,Jn="srcOver",pn="dstOver",tn="multiply",Gt="add",bn="screen",kn="overlay",jn="darken",Wn="lighten",dn="hardLight",Bn="difference",mn="exclusion",Pn=1,ur=2,er=3;function _r(rn,ln){let En=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;rn.a*=En;const $n=ln.a+rn.a-ln.a*rn.a;return{r:(rn.r*rn.a+ln.r*ln.a*(1-rn.a))/$n,g:(rn.g*rn.a+ln.g*ln.a*(1-rn.a))/$n,b:(rn.b*rn.a+ln.b*ln.a*(1-rn.a))/$n,a:$n}}function dr(rn,ln){let En=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;rn.a*=En;const $n=ln.a+rn.a-ln.a*rn.a;return{r:(ln.r*ln.a+rn.r*rn.a*(1-ln.a))/$n,g:(ln.g*ln.a+rn.g*rn.a*(1-ln.a))/$n,b:(ln.b*ln.a+rn.b*rn.a*(1-ln.a))/$n,a:$n}}function Sr(rn,ln){let En=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;rn.a*=En;const $n=ln.a+rn.a-ln.a*rn.a,An=rn.r*rn.a,Ln=rn.g*rn.a,qn=rn.b*rn.a,Gn=ln.r*ln.a,Vn=ln.g*ln.a,ar=ln.b*ln.a;return{r:(An*Gn+An*(1-ln.a)+Gn*(1-rn.a))/$n,g:(Ln*Vn+Ln*(1-ln.a)+Vn*(1-rn.a))/$n,b:(qn*ar+qn*(1-ln.a)+ar*(1-rn.a))/$n,a:$n}}function sr(rn,ln){let En=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;rn.a*=En;const $n=ln.a+rn.a-ln.a*rn.a,An=rn.r*rn.a,Ln=rn.g*rn.a,qn=rn.b*rn.a;return{r:(An+ln.r*ln.a)/$n,g:(Ln+ln.g*ln.a)/$n,b:(qn+ln.b*ln.a)/$n,a:$n}}function nr(rn,ln){let En=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;rn.a*=En;const $n=ln.a+rn.a-ln.a*rn.a,An=rn.r*rn.a,Ln=rn.g*rn.a,qn=rn.b*rn.a,Gn=ln.r*ln.a,Vn=ln.g*ln.a,ar=ln.b*ln.a;return{r:(An*ln.a+Gn*rn.a-An*Gn+An*(1-ln.a)+Gn*(1-rn.a))/$n,g:(Ln*ln.a+Vn*rn.a-Ln*Vn+Ln*(1-ln.a)+Vn*(1-rn.a))/$n,b:(qn*ln.a+ar*rn.a-qn*ar+qn*(1-ln.a)+ar*(1-rn.a))/$n,a:$n}}function kr(rn,ln){let En=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;rn.a*=En;const $n=ln.a+rn.a-ln.a*rn.a,An=rn.r*rn.a,Ln=rn.g*rn.a,qn=rn.b*rn.a,Gn=ln.r*ln.a,Vn=ln.g*ln.a,ar=ln.b*ln.a;return{r:(2*Gn<=ln.a?2*An*Gn+An*(1-ln.a)+Gn*(1-rn.a):An*(1+ln.a)+Gn*(1+rn.a)-2*Gn*An-ln.a*rn.a)/$n,g:(2*Vn<=ln.a?2*Ln*Vn+Ln*(1-ln.a)+Vn*(1-rn.a):Ln*(1+ln.a)+Vn*(1+rn.a)-2*Vn*Ln-ln.a*rn.a)/$n,b:(2*ar<=ln.a?2*qn*ar+qn*(1-ln.a)+ar*(1-rn.a):qn*(1+ln.a)+ar*(1+rn.a)-2*ar*qn-ln.a*rn.a)/$n,a:$n}}function Mr(rn,ln){let En=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;rn.a*=En;const $n=ln.a+rn.a-ln.a*rn.a,An=rn.r*rn.a,Ln=rn.g*rn.a,qn=rn.b*rn.a,Gn=ln.r*ln.a,Vn=ln.g*ln.a,ar=ln.b*ln.a;return{r:(Math.min(An*ln.a,Gn*rn.a)+An*(1-ln.a)+Gn*(1-rn.a))/$n,g:(Math.min(Ln*ln.a,Vn*rn.a)+Ln*(1-ln.a)+Vn*(1-rn.a))/$n,b:(Math.min(qn*ln.a,ar*rn.a)+qn*(1-ln.a)+ar*(1-rn.a))/$n,a:$n}}function Rr(rn,ln){let En=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;rn.a*=En;const $n=ln.a+rn.a-ln.a*rn.a,An=rn.r*rn.a,Ln=rn.g*rn.a,qn=rn.b*rn.a,Gn=ln.r*ln.a,Vn=ln.g*ln.a,ar=ln.b*ln.a;return{r:(Math.max(An*ln.a,Gn*rn.a)+An*(1-ln.a)+Gn*(1-rn.a))/$n,g:(Math.max(Ln*ln.a,Vn*rn.a)+Ln*(1-ln.a)+Vn*(1-rn.a))/$n,b:(Math.max(qn*ln.a,ar*rn.a)+qn*(1-ln.a)+ar*(1-rn.a))/$n,a:$n}}function Yr(rn,ln){let En=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;rn.a*=En;const $n=ln.a+rn.a-ln.a*rn.a,An=rn.r*rn.a,Ln=rn.g*rn.a,qn=rn.b*rn.a,Gn=ln.r*ln.a,Vn=ln.g*ln.a,ar=ln.b*ln.a;return{r:(2*An<=rn.a?2*An*Gn+An*(1-ln.a)+Gn*(1-rn.a):An*(1+ln.a)+Gn*(1+rn.a)-2*Gn*An-ln.a*rn.a)/$n,g:(2*Ln<=rn.a?2*Ln*Vn+Ln*(1-ln.a)+Vn*(1-rn.a):Ln*(1+ln.a)+Vn*(1+rn.a)-2*Vn*Ln-ln.a*rn.a)/$n,b:(2*qn<=rn.a?2*qn*ar+qn*(1-ln.a)+ar*(1-rn.a):qn*(1+ln.a)+ar*(1+rn.a)-2*ar*qn-ln.a*rn.a)/$n,a:$n}}function li(rn,ln){let En=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;rn.a*=En;const $n=ln.a+rn.a-ln.a*rn.a,An=rn.r*rn.a,Ln=rn.g*rn.a,qn=rn.b*rn.a,Gn=ln.r*ln.a,Vn=ln.g*ln.a,ar=ln.b*ln.a;return{r:(An+Gn-2*Math.min(An*ln.a,Gn*rn.a))/$n,g:(Ln+Vn-2*Math.min(Ln*ln.a,Vn*rn.a))/$n,b:(qn+ar-2*Math.min(qn*ln.a,ar*rn.a))/$n,a:$n}}function ei(rn,ln){let En=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;rn.a*=En;const $n=ln.a+rn.a-ln.a*rn.a,An=rn.r*rn.a,Ln=rn.g*rn.a,qn=rn.b*rn.a,Gn=ln.r*ln.a,Vn=ln.g*ln.a,ar=ln.b*ln.a;return{r:(An*ln.a+Gn*rn.a-2*An*Gn+An*(1-ln.a)+Gn*(1-rn.a))/$n,g:(Ln*ln.a+Vn*rn.a-2*Ln*Vn+Ln*(1-ln.a)+Vn*(1-rn.a))/$n,b:(qn*ln.a+ar*rn.a-2*qn*ar+qn*(1-ln.a)+ar*(1-rn.a))/$n,a:$n}}const Pr=function(rn,ln){for(var En=arguments.length,$n=new Array(En>2?En-2:0),An=2;An{$n.push((Gn,Vn)=>{Gn&&qn(Gn),Ln(Vn)}),rn.bind(ln)(...$n)})},hi={},mi=(rn,ln)=>{hi[rn]=ln},yi=rn=>{const ln=rn.split("/").slice(-1);var En;return(En=ln[ln.length-1].split(".").pop(),Object.entries(hi).find($n=>$n[1].includes(En))||[])[0]};var Gi=__webpack_require__(5025),gi=__webpack_require__.n(Gi),xi=__webpack_require__(6551),Ni=__webpack_require__.n(xi),fi=__webpack_require__(8834).lW;function bi(rn){return rn._exif&&rn._exif.tags&&rn._exif.tags.Orientation||1}async function oi(rn,ln,En){const $n=await async function(An,Ln){const qn=await gi().fromBuffer(An);return qn?qn.mime:Ln?yi(Ln):null}(rn,ln);if(typeof $n!="string")return En(new Error("Could not find MIME for Buffer <"+ln+">"));this._originalMime=$n.toLowerCase();try{const An=this.getMIME();if(!this.constructor.decoders[An])return xe.call(this,"Unsupported MIME type: "+An,En);this.bitmap=this.constructor.decoders[An](rn)}catch(An){return En.call(this,An,this)}try{this._exif=Ni().create(rn).parse(),function(An){if(bi(An)<2)return;const Ln=function(Gn){const Vn=Gn.getWidth(),ar=Gn.getHeight();switch(bi(Gn)){case 1:default:return null;case 2:return function(lr,fr){return[Vn-lr-1,fr]};case 3:return function(lr,fr){return[Vn-lr-1,ar-fr-1]};case 4:return function(lr,fr){return[lr,ar-fr-1]};case 5:return function(lr,fr){return[fr,lr]};case 6:return function(lr,fr){return[fr,ar-lr-1]};case 7:return function(lr,fr){return[Vn-fr-1,ar-lr-1]};case 8:return function(lr,fr){return[Vn-fr-1,lr]}}}(An),qn=bi(An)>4;(function(Gn,Vn,ar,lr){const fr=Gn.bitmap.data,Or=Gn.bitmap.width,wr=fi.alloc(fr.length);for(let gr=0;gr{ln.call(this,null,$n)}):ln.call(this,null,En)}return this}function Co(rn){return Pr(ki,this,rn)}var Wi=__webpack_require__(8834).lW;function Di(rn,ln,En){return(ln=function($n){var An=function(Ln,qn){if(typeof Ln!="object"||Ln===null)return Ln;var Gn=Ln[Symbol.toPrimitive];if(Gn!==void 0){var Vn=Gn.call(Ln,"string");if(typeof Vn!="object")return Vn;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(Ln)}($n);return typeof An=="symbol"?An:String(An)}(ln))in rn?Object.defineProperty(rn,ln,{value:En,enumerable:!0,configurable:!0,writable:!0}):rn[ln]=En,rn}const pi="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_",Ki=[NaN,NaN];for(let rn=2;rn<65;rn++){const ln=$e()($e().BIN,pi.slice(0,rn))(new Array(65).join("1"));Ki.push(ln.length)}function bo(){}function Ro(rn){return Object.prototype.toString.call(rn).toLowerCase().indexOf("arraybuffer")>-1}function la(rn){const ln=Wi.alloc(rn.byteLength),En=new Uint8Array(rn);for(let $n=0;$nEn?ln(En):typeof $n=="object"&&Wi.isBuffer($n)?ln(null,$n):typeof $n=="object"&&Ro($n)?ln(null,la($n)):new Error(`Could not load Buffer from <${rn.url}>`))}const ca={data:null,width:null,height:null};class Ei extends ye(){constructor(){for(var ln=arguments.length,En=new Array(ln),$n=0;$nPr(this.write,this,Vn)),Di(this,"getBase64Async",Vn=>Pr(this.getBase64,this,Vn)),Di(this,"getBuffer",ki),Di(this,"getBufferAsync",Co),Di(this,"getPixelColour",this.getPixelColor),Di(this,"setPixelColour",this.setPixelColor);const An=this;let Ln=bo;function qn(){for(var Vn=arguments.length,ar=new Array(Vn),lr=0;lr{fr&&Ln===bo?An.emitError("constructor",fr):fr||An.emitMulti("constructor","initialized"),Ln.call(An,...ar)},1)}if(Ro(En[0])&&(En[0]=la(En[0])),typeof En[0]=="number"&&typeof En[1]=="number"||parseInt(En[0],10)&&parseInt(En[1],10)){const Vn=parseInt(En[0],10),ar=parseInt(En[1],10);if(Ln=En[2],typeof En[2]=="number"&&(this._background=En[2],Ln=En[3]),typeof En[2]=="string"&&(this._background=Ei.cssColorToHex(En[2]),Ln=En[3]),Ln===void 0&&(Ln=bo),typeof Ln!="function")return xe.call(this,"cb must be a function",qn);this.bitmap={data:Wi.alloc(Vn*ar*4),width:Vn,height:ar};for(let lr=0;lr{if(Vn)return xe.call(this,Vn,qn);this.parseBitmap(ar,En[0].url,qn)})}else if(En[0]instanceof Ei){const[Vn]=En;if(Ln=En[1],Ln===void 0&&(Ln=bo),typeof Ln!="function")return xe.call(this,"cb must be a function",qn);this.bitmap={data:Wi.from(Vn.bitmap.data),width:Vn.bitmap.width,height:Vn.bitmap.height},this._quality=Vn._quality,this._deflateLevel=Vn._deflateLevel,this._deflateStrategy=Vn._deflateStrategy,this._filterType=Vn._filterType,this._rgba=Vn._rgba,this._background=Vn._background,this._originalMime=Vn._originalMime,qn(null,this)}else if((Gn=En[0])&&typeof Gn=="object"&&typeof Gn.width=="number"&&typeof Gn.height=="number"&&(Wi.isBuffer(Gn.data)||Gn.data instanceof Uint8Array||typeof Uint8ClampedArray=="function"&&Gn.data instanceof Uint8ClampedArray)&&(Gn.data.length===Gn.width*Gn.height*4||Gn.data.length===Gn.width*Gn.height*3)){const[Vn]=En;Ln=En[1]||bo;const ar=Vn.width*Vn.height*4===Vn.data.length?Wi.from(Vn.data):function(lr){if(lr.length%3!=0)throw new Error("Buffer length is incorrect");const fr=Wi.allocUnsafe(lr.length/3*4);let Or=0;for(let wr=0;wr{if(ar)return xe.call(this,ar,qn);this.parseBitmap(lr,Vn,qn)})}else if(typeof En[0]=="object"&&Wi.isBuffer(En[0])){const Vn=En[0];if(Ln=En[1],typeof Ln!="function")return xe.call(this,"cb must be a function",qn);this.parseBitmap(Vn,null,qn)}else{Ln=En[En.length-1],typeof Ln!="function"&&(Ln=En[En.length-2],typeof Ln!="function"&&(Ln=bo));const Vn=Ei.__extraConstructors.find(ar=>ar.test(...En));if(!Vn)return xe.call(this,"No matching constructor overloading was found. Please see the docs for how to call the Jimp constructor.",qn);new Promise((ar,lr)=>{Vn.run.call(this,ar,lr,...En)}).then(()=>qn(null,this)).catch(qn)}var Gn}parseBitmap(ln,En,$n){oi.call(this,ln,null,$n)}rgba(ln,En){return typeof ln!="boolean"?xe.call(this,"bool must be a boolean, true for RGBA or false for RGB",En):(this._rgba=ln,ve(En)&&En.call(this,null,this),this)}emitMulti(ln,En){let $n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};$n=Object.assign($n,{methodName:ln,eventName:En}),this.emit("any",$n),ln&&this.emit(ln,$n),this.emit(En,$n)}emitError(ln,En){this.emitMulti(ln,"error",En)}getHeight(){return this.bitmap.height}getWidth(){return this.bitmap.width}inspect(){return""}toString(){return"[object Jimp]"}getMIME(){return this._originalMime||Ei.MIME_PNG}getExtension(){const ln=this.getMIME();return(hi[ln.toLowerCase()]||[])[0]}write(ln,En){if(!ue()||!ue().createWriteStream)throw new Error("Cant access the filesystem. You can use the getBase64 method.");if(typeof ln!="string")return xe.call(this,"path must be a string",En);if(En===void 0&&(En=bo),typeof En!="function")return xe.call(this,"cb must be a function",En);const $n=yi(ln)||this.getMIME(),An=me().parse(ln);return An.dir&&ue().mkdirSync(An.dir,{recursive:!0}),this.getBuffer($n,(Ln,qn)=>{if(Ln)return xe.call(this,Ln,En);const Gn=ue().createWriteStream(ln);Gn.on("open",()=>{Gn.write(qn),Gn.end()}).on("error",Vn=>xe.call(this,Vn,En)),Gn.on("finish",()=>{En.call(this,null,this)})}),this}getBase64(ln,En){return ln===Ei.AUTO&&(ln=this.getMIME()),typeof ln!="string"?xe.call(this,"mime must be a string",En):typeof En!="function"?xe.call(this,"cb must be a function",En):(this.getBuffer(ln,function($n,An){if($n)return xe.call(this,$n,En);const Ln="data:"+ln+";base64,"+An.toString("base64");En.call(this,null,Ln)}),this)}hash(ln,En){if(typeof(ln=ln||64)=="function"&&(En=ln,ln=64),typeof ln!="number")return xe.call(this,"base must be a number",En);if(ln<2||ln>64)return xe.call(this,"base must be a number between 2 and 64",En);let $n=this.pHash();for($n=$e()($e().BIN,pi.slice(0,ln))($n);$n.length=this.bitmap.width&&(Ln=this.bitmap.width-1),En<0&&(qn=0),En>=this.bitmap.height&&(qn=this.bitmap.height-1)),$n===Ei.EDGE_WRAP&&(ln<0&&(Ln=this.bitmap.width+ln),ln>=this.bitmap.width&&(Ln=ln%this.bitmap.width),En<0&&(qn=this.bitmap.height+En),En>=this.bitmap.height&&(qn=En%this.bitmap.height));let Gn=this.bitmap.width*qn+Ln<<2;return(Ln<0||Ln>=this.bitmap.width)&&(Gn=-1),(qn<0||qn>=this.bitmap.height)&&(Gn=-1),ve(An)&&An.call(this,null,Gn),Gn}getPixelColor(ln,En,$n){if(typeof ln!="number"||typeof En!="number")return xe.call(this,"x and y must be numbers",$n);ln=Math.round(ln),En=Math.round(En);const An=this.getPixelIndex(ln,En),Ln=this.bitmap.data.readUInt32BE(An);return ve($n)&&$n.call(this,null,Ln),Ln}setPixelColor(ln,En,$n,An){if(typeof ln!="number"||typeof En!="number"||typeof $n!="number")return xe.call(this,"hex, x and y must be numbers",An);En=Math.round(En),$n=Math.round($n);const Ln=this.getPixelIndex(En,$n);return this.bitmap.data.writeUInt32BE(ln,Ln),ve(An)&&An.call(this,null,this),this}hasAlpha(){for(let ln=0;ln1&&arguments[1]!==void 0?arguments[1]:Ei;Object.entries(rn).forEach(En=>{let[$n,An]=En;ln[$n]=An})}function ua(rn){let ln=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ei;Object.entries(rn).forEach(En=>{let[$n,An]=En;ln.prototype[$n]=An})}function Qt(rn,ln,En){const $n="before-"+ln,An=ln.replace(/e$/,"")+"ed";Ei.prototype[rn]=function(){let Ln;for(var qn=arguments.length,Gn=new Array(qn),Vn=0;Vn3&&arguments[3]!==void 0?arguments[3]:{},An=arguments.length>4?arguments[4]:void 0;if(typeof $n=="function"&&(An=$n,$n={}),!(rn instanceof this.constructor))return xe.call(this,"The source must be a Jimp image",An);if(typeof ln!="number"||typeof En!="number")return xe.call(this,"x and y must be numbers",An);let{mode:Ln,opacitySource:qn,opacityDest:Gn}=$n;Ln||(Ln=Jn),(typeof qn!="number"||qn<0||qn>1)&&(qn=1),(typeof Gn!="number"||Gn<0||Gn>1)&&(Gn=1);const Vn=oe[Ln];ln=Math.round(ln),En=Math.round(En);const ar=this;return Gn!==1&&ar.opacity(Gn),rn.scanQuiet(0,0,rn.bitmap.width,rn.bitmap.height,function(lr,fr,Or){const wr=ar.getPixelIndex(ln+lr,En+fr,er);if(wr===-1)return;const gr=Vn({r:this.bitmap.data[Or+0]/255,g:this.bitmap.data[Or+1]/255,b:this.bitmap.data[Or+2]/255,a:this.bitmap.data[Or+3]/255},{r:ar.bitmap.data[wr+0]/255,g:ar.bitmap.data[wr+1]/255,b:ar.bitmap.data[wr+2]/255,a:ar.bitmap.data[wr+3]/255},qn);ar.bitmap.data[wr+0]=this.constructor.limit255(255*gr.r),ar.bitmap.data[wr+1]=this.constructor.limit255(255*gr.g),ar.bitmap.data[wr+2]=this.constructor.limit255(255*gr.b),ar.bitmap.data[wr+3]=this.constructor.limit255(255*gr.a)}),ve(An)&&An.call(this,null,this),this}}),Ei.__extraConstructors=[],Ei.appendConstructorOption=function(rn,ln,En){Ei.__extraConstructors.push({name:rn,test:ln,run:En})},Ei.read=function(){for(var rn=arguments.length,ln=new Array(rn),En=0;En{new Ei(...ln,(Ln,qn)=>{Ln?An(Ln):$n(qn)})})},Ei.create=Ei.read,Ei.rgbaToInt=function(rn,ln,En,$n,An){if(typeof rn!="number"||typeof ln!="number"||typeof En!="number"||typeof $n!="number")return xe.call(this,"r, g, b and a must be numbers",An);if(rn<0||rn>255)return xe.call(this,"r must be between 0 and 255",An);if((ln<0||ln>255)&&xe.call(this,"g must be between 0 and 255",An),En<0||En>255)return xe.call(this,"b must be between 0 and 255",An);if($n<0||$n>255)return xe.call(this,"a must be between 0 and 255",An);rn=Math.round(rn),En=Math.round(En),ln=Math.round(ln),$n=Math.round($n);const Ln=rn*Math.pow(256,3)+ln*Math.pow(256,2)+En*Math.pow(256,1)+$n*Math.pow(256,0);return ve(An)&&An.call(this,null,Ln),Ln},Ei.intToRGBA=function(rn,ln){if(typeof rn!="number")return xe.call(this,"i must be a number",ln);const En={};return En.r=Math.floor(rn/Math.pow(256,3)),En.g=Math.floor((rn-En.r*Math.pow(256,3))/Math.pow(256,2)),En.b=Math.floor((rn-En.r*Math.pow(256,3)-En.g*Math.pow(256,2))/Math.pow(256,1)),En.a=Math.floor((rn-En.r*Math.pow(256,3)-En.g*Math.pow(256,2)-En.b*Math.pow(256,1))/Math.pow(256,0)),ve(ln)&&ln.call(this,null,En),En},Ei.cssColorToHex=function(rn){return typeof(rn=rn||0)=="number"?Number(rn):parseInt(Ne(rn).toHex8(),16)},Ei.limit255=function(rn){return rn=Math.max(rn,0),Math.min(rn,255)},Ei.diff=function(rn,ln){let En=arguments.length>2&&arguments[2]!==void 0?arguments[2]:.1;if(!(rn instanceof Ei&&ln instanceof Ei))return xe.call(this,"img1 and img2 must be an Jimp images");const $n=rn.bitmap,An=ln.bitmap;if($n.width===An.width&&$n.height===An.height||($n.width*$n.height>An.width*An.height?rn=rn.cloneQuiet().resize(An.width,An.height):ln=ln.cloneQuiet().resize($n.width,$n.height)),typeof En!="number"||En<0||En>1)return xe.call(this,"threshold must be a number between 0 and 1");const Ln=new Ei($n.width,$n.height,4294967295);return{percent:Ae()($n.data,An.data,Ln.bitmap.data,Ln.bitmap.width,Ln.bitmap.height,{threshold:En})/(Ln.bitmap.width*Ln.bitmap.height),image:Ln}},Ei.distance=function(rn,ln){const En=new Tn,$n=En.getHash(rn),An=En.getHash(ln);return En.distance($n,An)},Ei.compareHashes=function(rn,ln){return new Tn().distance(rn,ln)},Ei.colorDiff=function(rn,ln){const En=An=>Math.pow(An,2),{max:$n}=Math;return rn.a===0||rn.a||(rn.a=255),ln.a===0||ln.a||(ln.a=255),($n(En(rn.r-ln.r),En(rn.r-ln.r-rn.a+ln.a))+$n(En(rn.g-ln.g),En(rn.g-ln.g-rn.a+ln.a))+$n(En(rn.b-ln.b),En(rn.b-ln.b-rn.a+ln.a)))/195075},Qt("clone","clone",function(rn){const ln=new Ei(this);return ve(rn)&&rn.call(ln,null,ln),ln}),On("background",function(rn,ln){return typeof rn!="number"?xe.call(this,"hex must be a hexadecimal rgba value",ln):(this._background=rn,ve(ln)&&ln.call(this,null,this),this)}),On("scan",function(rn,ln,En,$n,An,Ln){if(typeof rn!="number"||typeof ln!="number")return xe.call(this,"x and y must be numbers",Ln);if(typeof En!="number"||typeof $n!="number")return xe.call(this,"w and h must be numbers",Ln);if(typeof An!="function")return xe.call(this,"f must be a function",Ln);const qn=_e(this,rn,ln,En,$n,An);return ve(Ln)&&Ln.call(this,null,qn),qn});{let rn;typeof window<"u"&&typeof window=="object"&&(rn=window),typeof self<"u"&&typeof self=="object"&&(rn=self),rn.Jimp=Ei,rn.Buffer=Wi}const Un=Ei;var Zn=__webpack_require__(643),or=__webpack_require__(2691),mr=__webpack_require__.n(or);const cr="image/jpeg",Er=()=>({mime:{[cr]:["jpeg","jpg","jpe"]},constants:{MIME_JPEG:cr},decoders:{[cr]:mr().decode},encoders:{[cr]:rn=>mr().encode(rn.bitmap,rn._quality).data},class:{_quality:100,quality(rn,ln){return typeof rn!="number"?xe.call(this,"n must be a number",ln):rn<0||rn>100?xe.call(this,"n must be a number 0 - 100",ln):(this._quality=Math.round(rn),ve(ln)&&ln.call(this,null,this),this)}}});var pr=__webpack_require__(9902);const Ar="image/png",vr=()=>({mime:{[Ar]:["png"]},constants:{MIME_PNG:Ar,PNG_FILTER_AUTO:-1,PNG_FILTER_NONE:0,PNG_FILTER_SUB:1,PNG_FILTER_UP:2,PNG_FILTER_AVERAGE:3,PNG_FILTER_PATH:4},hasAlpha:{[Ar]:!0},decoders:{[Ar]:pr.PNG.sync.read},encoders:{[Ar](rn){const ln=new pr.PNG({width:rn.bitmap.width,height:rn.bitmap.height});return ln.data=rn.bitmap.data,pr.PNG.sync.write(ln,{deflateLevel:rn._deflateLevel,deflateStrategy:rn._deflateStrategy,filterType:rn._filterType,colorType:typeof rn._colorType=="number"?rn._colorType:rn._rgba?6:2,inputHasAlpha:rn._rgba})}},class:{_deflateLevel:9,_deflateStrategy:3,_filterType:-1,_colorType:null,deflateLevel(rn,ln){return typeof rn!="number"?xe.call(this,"l must be a number",ln):rn<0||rn>9?xe.call(this,"l must be a number 0 - 9",ln):(this._deflateLevel=Math.round(rn),ve(ln)&&ln.call(this,null,this),this)},deflateStrategy(rn,ln){return typeof rn!="number"?xe.call(this,"s must be a number",ln):rn<0||rn>3?xe.call(this,"s must be a number 0 - 3",ln):(this._deflateStrategy=Math.round(rn),ve(ln)&&ln.call(this,null,this),this)},filterType(rn,ln){return typeof rn!="number"?xe.call(this,"n must be a number",ln):rn<-1||rn>4?xe.call(this,"n must be -1 (auto) or a number 0 - 4",ln):(this._filterType=Math.round(rn),ve(ln)&&ln.call(this,null,this),this)},colorType(rn,ln){return typeof rn!="number"?xe.call(this,"s must be a number",ln):rn!==0&&rn!==2&&rn!==4&&rn!==6?xe.call(this,"s must be a number 0, 2, 4, 6.",ln):(this._colorType=Math.round(rn),ve(ln)&&ln.call(this,null,this),this)}}});var Cr=__webpack_require__(486),$r=__webpack_require__.n(Cr);const Jr="image/bmp",Zr="image/x-ms-bmp",jr=rn=>{return _e({bitmap:ln=$r().decode(rn)},0,0,ln.width,ln.height,function(En,$n,An){const Ln=this.bitmap.data[An+0],qn=this.bitmap.data[An+1],Gn=this.bitmap.data[An+2],Vn=this.bitmap.data[An+3];this.bitmap.data[An+0]=Vn,this.bitmap.data[An+1]=Gn,this.bitmap.data[An+2]=qn,this.bitmap.data[An+3]=ln.is_with_alpha?Ln:255}).bitmap;var ln},Ur=rn=>$r().encode(function(ln){return _e(ln,0,0,ln.bitmap.width,ln.bitmap.height,function(En,$n,An){const Ln=this.bitmap.data[An+0],qn=this.bitmap.data[An+1],Gn=this.bitmap.data[An+2],Vn=this.bitmap.data[An+3];this.bitmap.data[An+0]=Vn,this.bitmap.data[An+1]=Gn,this.bitmap.data[An+2]=qn,this.bitmap.data[An+3]=Ln}).bitmap}(rn)).data;var Ci=__webpack_require__(9299),Pi=__webpack_require__.n(Ci),qi=__webpack_require__(8834).lW;const Fi="image/tiff";var so=__webpack_require__(63),Ui=__webpack_require__(9455),ti=__webpack_require__(8834).lW;const jo="image/gif",qa=[1,57,41,21,203,34,97,73,227,91,149,62,105,45,39,137,241,107,3,173,39,71,65,238,219,101,187,87,81,151,141,133,249,117,221,209,197,187,177,169,5,153,73,139,133,127,243,233,223,107,103,99,191,23,177,171,165,159,77,149,9,139,135,131,253,245,119,231,224,109,211,103,25,195,189,23,45,175,171,83,81,79,155,151,147,9,141,137,67,131,129,251,123,30,235,115,113,221,217,53,13,51,50,49,193,189,185,91,179,175,43,169,83,163,5,79,155,19,75,147,145,143,35,69,17,67,33,65,255,251,247,243,239,59,29,229,113,111,219,27,213,105,207,51,201,199,49,193,191,47,93,183,181,179,11,87,43,85,167,165,163,161,159,157,155,77,19,75,37,73,145,143,141,35,138,137,135,67,33,131,129,255,63,250,247,61,121,239,237,117,29,229,227,225,111,55,109,216,213,211,209,207,205,203,201,199,197,195,193,48,190,47,93,185,183,181,179,178,176,175,173,171,85,21,167,165,41,163,161,5,79,157,78,154,153,19,75,149,74,147,73,144,143,71,141,140,139,137,17,135,134,133,66,131,65,129,1],Va=[0,9,10,10,14,12,14,14,16,15,16,15,16,15,15,17,18,17,12,18,16,17,17,19,19,18,19,18,18,19,19,19,20,19,20,20,20,20,20,20,15,20,19,20,20,20,21,21,21,20,20,20,21,18,21,21,21,21,20,21,17,21,21,21,22,22,21,22,22,21,22,21,19,22,22,19,20,22,22,21,21,21,22,22,22,18,22,22,21,22,22,23,22,20,23,22,22,23,23,21,19,21,21,21,23,23,23,22,23,23,21,23,22,23,18,22,23,20,22,23,23,23,21,22,20,22,21,22,24,24,24,24,24,22,21,24,23,23,24,21,24,23,24,22,24,24,22,24,24,22,23,24,24,24,20,23,22,23,24,24,24,24,24,24,24,23,21,23,22,23,24,24,24,22,24,24,24,23,22,24,24,25,23,25,25,23,24,25,25,24,22,25,25,25,24,23,24,25,25,25,25,25,25,25,25,25,25,25,25,23,25,23,24,25,25,25,25,25,25,25,25,25,24,22,25,25,23,25,25,20,24,25,24,25,25,22,24,25,24,25,24,25,25,24,25,25,25,25,22,25,25,25,24,25,24,25,18];var da=__webpack_require__(8834).lW;function $a(rn,ln,En,$n){const An=[0,0,0],Ln=(ln.length-1)/2;for(let qn=0;qnrn!=null;function Ra(rn){return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(ln,En,$n){const An=parseInt(.2126*this.bitmap.data[$n]+.7152*this.bitmap.data[$n+1]+.0722*this.bitmap.data[$n+2],10);this.bitmap.data[$n]=An,this.bitmap.data[$n+1]=An,this.bitmap.data[$n+2]=An}),ve(rn)&&rn.call(this,null,this),this}function Ta(rn,ln){let En=arguments.length>2&&arguments[2]!==void 0?arguments[2]:50;return{r:(ln.r-rn.r)*(En/100)+rn.r,g:(ln.g-rn.g)*(En/100)+rn.g,b:(ln.b-rn.b)*(En/100)+rn.b}}function Wl(rn,ln){return rn&&Array.isArray(rn)?(rn=rn.map(En=>(En.apply!=="xor"&&En.apply!=="mix"||(En.params[0]=Ne(En.params[0]).toRgb()),En)),this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,(En,$n,An)=>{let Ln={r:this.bitmap.data[An],g:this.bitmap.data[An+1],b:this.bitmap.data[An+2]};const qn=(Gn,Vn)=>this.constructor.limit255(Ln[Gn]+Vn);rn.forEach(Gn=>{if(Gn.apply==="mix")Ln=Ta(Ln,Gn.params[0],Gn.params[1]);else if(Gn.apply==="tint")Ln=Ta(Ln,{r:255,g:255,b:255},Gn.params[0]);else if(Gn.apply==="shade")Ln=Ta(Ln,{r:0,g:0,b:0},Gn.params[0]);else if(Gn.apply==="xor")Ln={r:Ln.r^Gn.params[0].r,g:Ln.g^Gn.params[0].g,b:Ln.b^Gn.params[0].b};else if(Gn.apply==="red")Ln.r=qn("r",Gn.params[0]);else if(Gn.apply==="green")Ln.g=qn("g",Gn.params[0]);else if(Gn.apply==="blue")Ln.b=qn("b",Gn.params[0]);else{if(Gn.apply==="hue"&&(Gn.apply="spin"),Ln=Ne(Ln),!Ln[Gn.apply])return xe.call(this,"action "+Gn.apply+" not supported",ln);Ln=Ln[Gn.apply](...Gn.params).toRgb()}}),this.bitmap.data[An]=Ln.r,this.bitmap.data[An+1]=Ln.g,this.bitmap.data[An+2]=Ln.b}),ve(ln)&&ln.call(this,null,this),this):xe.call(this,"actions must be an array",ln)}var js=__webpack_require__(8834).lW;function ql(rn){const ln=[1,9,3,11,13,5,15,7,4,12,2,10,16,8,14,6];return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(En,$n,An){const Ln=ln[((3&$n)<<2)+En%4];this.bitmap.data[An]=Math.min(this.bitmap.data[An]+Ln,255),this.bitmap.data[An+1]=Math.min(this.bitmap.data[An+1]+Ln,255),this.bitmap.data[An+2]=Math.min(this.bitmap.data[An+2]+Ln,255)}),ve(rn)&&rn.call(this,null,this),this}var Vl=__webpack_require__(8834).lW;function Yl(rn,ln,En){if(typeof rn!="boolean"||typeof ln!="boolean")return xe.call(this,"horizontal and vertical must be Booleans",En);const $n=Vl.alloc(this.bitmap.data.length);return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(An,Ln,qn){const Gn=rn?this.bitmap.width-1-An:An,Vn=ln?this.bitmap.height-1-Ln:Ln,ar=this.bitmap.width*Vn+Gn<<2,lr=this.bitmap.data.readUInt32BE(qn);$n.writeUInt32BE(lr,ar)}),this.bitmap.data=Vl.from($n),ve(En)&&En.call(this,null,this),this}function ec(){const rn={r:new Array(256).fill(0),g:new Array(256).fill(0),b:new Array(256).fill(0)};return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(ln,En,$n){rn.r[this.bitmap.data[$n+0]]++,rn.g[this.bitmap.data[$n+1]]++,rn.b[this.bitmap.data[$n+2]]++}),rn}const Aa=function(rn,ln,En){return 255*(rn-ln)/(En-ln)},Us=function(rn){return[rn.findIndex(ln=>ln>0),255-rn.slice().reverse().findIndex(ln=>ln>0)]};var tc=__webpack_require__(8058),nc=__webpack_require__.n(tc);function Ls(rn,ln){let En=0;for(let $n=0;$n{const Vn=[...Ln,Gn].join(" "),ar=Ls(rn,Vn);ar<=En?(ar>qn&&(qn=ar),Ln.push(Gn)):(An.push(Ln),Ln=[Gn])}),An.push(Ln),{lines:An,longestLine:qn}}function ci(rn,ln,En){const{lines:$n}=Xl(rn,ln,En);return $n.length*rn.common.lineHeight}function ui(rn,ln,En,$n,An){if(An.width>0&&An.height>0){const Ln=ln.pages[An.page];rn.blit(Ln,En+An.xoffset,$n+An.yoffset,An.x,An.y,An.width,An.height)}return rn}function rc(rn,ln,En,$n,An){for(let Ln=0;Ln<$n.length;Ln++){let qn;qn=rn.chars[$n[Ln]]?$n[Ln]:/\s/.test($n[Ln])?"":"?";const Gn=rn.chars[qn]||{},Vn=rn.kernings[qn];ui(this,rn,ln,En,Gn||{}),ln+=(Vn&&Vn[$n[Ln+1]]?Vn[$n[Ln+1]]:0)+(Gn.xadvance||An)}}const Uo="//../";function go(rn,ln,En,$n,An,Ln,qn){this.widthOriginal=Math.abs(Math.floor(rn)||0),this.heightOriginal=Math.abs(Math.floor(ln)||0),this.targetWidth=Math.abs(Math.floor(En)||0),this.targetHeight=Math.abs(Math.floor($n)||0),this.colorChannels=An?4:3,this.interpolationPass=!!Ln,this.resizeCallback=typeof qn=="function"?qn:function(){},this.targetWidthMultipliedByChannels=this.targetWidth*this.colorChannels,this.originalWidthMultipliedByChannels=this.widthOriginal*this.colorChannels,this.originalHeightMultipliedByChannels=this.heightOriginal*this.colorChannels,this.widthPassResultSize=this.targetWidthMultipliedByChannels*this.heightOriginal,this.finalResultSize=this.targetWidthMultipliedByChannels*this.targetHeight,this.initialize()}go.prototype.initialize=function(){if(!(this.widthOriginal>0&&this.heightOriginal>0&&this.targetWidth>0&&this.targetHeight>0))throw new Error("Invalid settings specified for the resizer.");this.configurePasses()},go.prototype.configurePasses=function(){this.widthOriginal===this.targetWidth?this.resizeWidth=this.bypassResizer:(this.ratioWeightWidthPass=this.widthOriginal/this.targetWidth,this.ratioWeightWidthPass<1&&this.interpolationPass?(this.initializeFirstPassBuffers(!0),this.resizeWidth=this.colorChannels===4?this.resizeWidthInterpolatedRGBA:this.resizeWidthInterpolatedRGB):(this.initializeFirstPassBuffers(!1),this.resizeWidth=this.colorChannels===4?this.resizeWidthRGBA:this.resizeWidthRGB)),this.heightOriginal===this.targetHeight?this.resizeHeight=this.bypassResizer:(this.ratioWeightHeightPass=this.heightOriginal/this.targetHeight,this.ratioWeightHeightPass<1&&this.interpolationPass?(this.initializeSecondPassBuffers(!0),this.resizeHeight=this.resizeHeightInterpolated):(this.initializeSecondPassBuffers(!1),this.resizeHeight=this.colorChannels===4?this.resizeHeightRGBA:this.resizeHeightRGB))},go.prototype._resizeWidthInterpolatedRGBChannels=function(rn,ln){const En=ln?4:3,$n=this.ratioWeightWidthPass,An=this.widthBuffer;let Ln,qn,Gn=0,Vn=0,ar=0,lr=0,fr=0;for(Ln=0;Gn<1/3;Ln+=En,Gn+=$n)for(Vn=Ln,ar=0;Vn=fr)){wr+=lr;break}Or+=En,wr=Or,lr-=fr}while(lr>0&&Or=Vn)){lr+=Gn;break}ar=wr,lr=ar,Gn-=Vn}while(Gn>0&&ar3&&(this.outputWidthWorkBenchOpaquePixelsCount=this.generateFloat64Buffer(this.heightOriginal)))},go.prototype.initializeSecondPassBuffers=function(rn){this.heightBuffer=this.generateUint8Buffer(this.finalResultSize),rn||(this.outputHeightWorkBench=this.generateFloatBuffer(this.targetWidthMultipliedByChannels),this.colorChannels>3&&(this.outputHeightWorkBenchOpaquePixelsCount=this.generateFloat64Buffer(this.targetWidth)))},go.prototype.generateFloatBuffer=function(rn){try{return new Float32Array(rn)}catch{return[]}},go.prototype.generateFloat64Buffer=function(rn){try{return new Float64Array(rn)}catch{return[]}},go.prototype.generateUint8Buffer=function(rn){try{return new Uint8Array(rn)}catch{return[]}};const ic=go;var Kl=__webpack_require__(8834).lW;const oc={nearestNeighbor(rn,ln){const En=rn.width,$n=rn.height,An=ln.width,Ln=ln.height,qn=rn.data,Gn=ln.data;for(let Vn=0;Vn0?An[$i-4]:2*An[$i]-An[$i+4],ha=An[$i],sa=An[$i+4],Ca=_i0?gr[$i-4*fr]:2*gr[$i]-gr[$i+4*fr],ha=gr[$i],sa=gr[$i+4*fr],Ca=_i1)for(let Lr=0;Lr=0&&xr.x=0&&xr.y({blit(rn,ln,En,$n,An,Ln,qn,Gn){if(!(rn instanceof this.constructor))return xe.call(this,"The source must be a Jimp image",Gn);if(typeof ln!="number"||typeof En!="number")return xe.call(this,"x and y must be numbers",Gn);if(typeof $n=="function")Gn=$n,$n=0,An=0,Ln=rn.bitmap.width,qn=rn.bitmap.height;else{if(typeof $n!=typeof An||typeof An!=typeof Ln||typeof Ln!=typeof qn)return xe.call(this,"srcx, srcy, srcw, srch must be numbers",Gn);$n=$n||0,An=An||0,Ln=Ln||rn.bitmap.width,qn=qn||rn.bitmap.height}ln=Math.round(ln),En=Math.round(En),$n=Math.round($n),An=Math.round(An),Ln=Math.round(Ln),qn=Math.round(qn);const Vn=this.bitmap.width,ar=this.bitmap.height,lr=this;return rn.scanQuiet($n,An,Ln,qn,function(fr,Or,wr){const gr=ln+fr-$n,yr=En+Or-An;if(gr>=0&&yr>=0&&Vn-gr>0&&ar-yr>0){const xr=lr.getPixelIndex(gr,yr),Lr={r:this.bitmap.data[wr],g:this.bitmap.data[wr+1],b:this.bitmap.data[wr+2],a:this.bitmap.data[wr+3]},Hr={r:lr.bitmap.data[xr],g:lr.bitmap.data[xr+1],b:lr.bitmap.data[xr+2],a:lr.bitmap.data[xr+3]};lr.bitmap.data[xr]=(Lr.a*(Lr.r-Hr.r)-Hr.r+255>>8)+Hr.r,lr.bitmap.data[xr+1]=(Lr.a*(Lr.g-Hr.g)-Hr.g+255>>8)+Hr.g,lr.bitmap.data[xr+2]=(Lr.a*(Lr.b-Hr.b)-Hr.b+255>>8)+Hr.b,lr.bitmap.data[xr+3]=this.constructor.limit255(Hr.a+Lr.a)}}),ve(Gn)&&Gn.call(this,null,this),this}}),()=>({blur(rn,ln){if(typeof rn!="number")return xe.call(this,"r must be a number",ln);if(rn<1)return xe.call(this,"r must be greater than 0",ln);let En,$n,An,Ln,qn,Gn,Vn,ar,lr,fr,Or,wr,gr,yr;const xr=this.bitmap.width-1,Lr=this.bitmap.height-1,Hr=rn+1,si=qa[rn],_i=Va[rn],ni=[],wi=[],vi=[],Ri=[],$i=[],yo=[];let ha=2;for(;ha-- >0;){for(wr=0,gr=0,Gn=0;Gnxr?xr:Vn)<<2),En+=this.bitmap.data[ar++],$n+=this.bitmap.data[ar++],An+=this.bitmap.data[ar++],Ln+=this.bitmap.data[ar];for(qn=0;qn0?ar<<2:0),lr=gr+$i[qn],fr=gr+yo[qn],En+=this.bitmap.data[lr++]-this.bitmap.data[fr++],$n+=this.bitmap.data[lr++]-this.bitmap.data[fr++],An+=this.bitmap.data[lr++]-this.bitmap.data[fr++],Ln+=this.bitmap.data[lr]-this.bitmap.data[fr],wr++;gr+=this.bitmap.width<<2}for(qn=0;qnLr?0:this.bitmap.width,En+=ni[Or],$n+=wi[Or],An+=vi[Or],Ln+=Ri[Or];for(wr=qn<<2,Gn=0;Gn>>_i,this.bitmap.data[wr+3]=yr,yr>255&&(this.bitmap.data[wr+3]=255),yr>0?(yr=255/yr,this.bitmap.data[wr]=(En*si>>>_i)*yr,this.bitmap.data[wr+1]=($n*si>>>_i)*yr,this.bitmap.data[wr+2]=(An*si>>>_i)*yr):(this.bitmap.data[wr+2]=0,this.bitmap.data[wr+1]=0,this.bitmap.data[wr]=0),qn===0&&($i[Gn]=((ar=Gn+Hr)0?ar*this.bitmap.width:0),lr=qn+$i[Gn],fr=qn+yo[Gn],En+=ni[lr]-ni[fr],$n+=wi[lr]-wi[fr],An+=vi[lr]-vi[fr],Ln+=Ri[lr]-Ri[fr],wr+=this.bitmap.width<<2}}return ve(ln)&&ln.call(this,null,this),this}}),()=>({circle(){let rn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ln=arguments.length>1?arguments[1]:void 0;typeof rn=="function"&&(ln=rn,rn={});const En=rn.radius||(this.bitmap.width>this.bitmap.height?this.bitmap.height:this.bitmap.width)/2,$n=typeof rn.x=="number"?rn.x:this.bitmap.width/2,An=typeof rn.y=="number"?rn.y:this.bitmap.height/2;return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(Ln,qn,Gn){const Vn=Math.sqrt(Math.pow(Ln-$n,2)+Math.pow(qn-An,2));En-Vn<=0?this.bitmap.data[Gn+3]=0:En-Vn<1&&(this.bitmap.data[Gn+3]=255*(En-Vn))}),ve(ln)&&ln.call(this,null,this),this}}),()=>({brightness(rn,ln){return typeof rn!="number"?xe.call(this,"val must be numbers",ln):rn<-1||rn>1?xe.call(this,"val must be a number between -1 and +1",ln):(this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(En,$n,An){rn<0?(this.bitmap.data[An]*=1+rn,this.bitmap.data[An+1]*=1+rn,this.bitmap.data[An+2]*=1+rn):(this.bitmap.data[An]+=(255-this.bitmap.data[An])*rn,this.bitmap.data[An+1]+=(255-this.bitmap.data[An+1])*rn,this.bitmap.data[An+2]+=(255-this.bitmap.data[An+2])*rn)}),ve(ln)&&ln.call(this,null,this),this)},contrast(rn,ln){if(typeof rn!="number")return xe.call(this,"val must be numbers",ln);if(rn<-1||rn>1)return xe.call(this,"val must be a number between -1 and +1",ln);const En=(rn+1)/(1-rn);function $n(An){return(An=Math.floor(En*(An-127)+127))<0?0:An>255?255:An}return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(An,Ln,qn){this.bitmap.data[qn]=$n(this.bitmap.data[qn]),this.bitmap.data[qn+1]=$n(this.bitmap.data[qn+1]),this.bitmap.data[qn+2]=$n(this.bitmap.data[qn+2])}),ve(ln)&&ln.call(this,null,this),this},posterize(rn,ln){return typeof rn!="number"?xe.call(this,"n must be numbers",ln):(rn<2&&(rn=2),this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(En,$n,An){this.bitmap.data[An]=Math.floor(this.bitmap.data[An]/255*(rn-1))/(rn-1)*255,this.bitmap.data[An+1]=Math.floor(this.bitmap.data[An+1]/255*(rn-1))/(rn-1)*255,this.bitmap.data[An+2]=Math.floor(this.bitmap.data[An+2]/255*(rn-1))/(rn-1)*255}),ve(ln)&&ln.call(this,null,this),this)},greyscale:Ra,grayscale:Ra,opacity(rn,ln){return typeof rn!="number"?xe.call(this,"f must be a number",ln):rn<0||rn>1?xe.call(this,"f must be a number from 0 to 1",ln):(this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(En,$n,An){const Ln=this.bitmap.data[An+3]*rn;this.bitmap.data[An+3]=Ln}),ve(ln)&&ln.call(this,null,this),this)},sepia(rn){return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(ln,En,$n){let An=this.bitmap.data[$n],Ln=this.bitmap.data[$n+1],qn=this.bitmap.data[$n+2];An=.393*An+.769*Ln+.189*qn,Ln=.349*An+.686*Ln+.168*qn,qn=.272*An+.534*Ln+.131*qn,this.bitmap.data[$n]=An<255?An:255,this.bitmap.data[$n+1]=Ln<255?Ln:255,this.bitmap.data[$n+2]=qn<255?qn:255}),ve(rn)&&rn.call(this,null,this),this},fade(rn,ln){return typeof rn!="number"?xe.call(this,"f must be a number",ln):rn<0||rn>1?xe.call(this,"f must be a number from 0 to 1",ln):(this.opacity(1-rn),ve(ln)&&ln.call(this,null,this),this)},convolution(rn,ln,En){typeof ln=="function"&&En===void 0&&(En=ln,ln=null),ln||(ln=this.constructor.EDGE_EXTEND);const $n=da.from(this.bitmap.data),An=rn.length,Ln=rn[0].length,qn=Math.floor(An/2),Gn=Math.floor(Ln/2),Vn=-qn,ar=-Gn;let lr,fr,Or,wr,gr,yr,xr,Lr,Hr,si;return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(_i,ni,wi){wr=0,Or=0,fr=0;for(let vi=Vn;vi<=qn;vi++)for(let Ri=ar;Ri<=Gn;Ri++)Lr=_i+Ri,Hr=ni+vi,lr=rn[vi+qn][Ri+Gn],si=this.getPixelIndex(Lr,Hr,ln),si===-1?(xr=0,yr=0,gr=0):(gr=this.bitmap.data[si+0],yr=this.bitmap.data[si+1],xr=this.bitmap.data[si+2]),fr+=lr*gr,Or+=lr*yr,wr+=lr*xr;fr<0&&(fr=0),Or<0&&(Or=0),wr<0&&(wr=0),fr>255&&(fr=255),Or>255&&(Or=255),wr>255&&(wr=255),$n[wi+0]=fr,$n[wi+1]=Or,$n[wi+2]=wr}),this.bitmap.data=$n,ve(En)&&En.call(this,null,this),this},opaque(rn){return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(ln,En,$n){this.bitmap.data[$n+3]=255}),ve(rn)&&rn.call(this,null,this),this},pixelate(rn,ln,En,$n,An,Ln){if(typeof ln=="function")Ln=ln,An=null,$n=null,En=null,ln=null;else{if(typeof rn!="number")return xe.call(this,"size must be a number",Ln);if(mo(ln)&&typeof ln!="number")return xe.call(this,"x must be a number",Ln);if(mo(En)&&typeof En!="number")return xe.call(this,"y must be a number",Ln);if(mo($n)&&typeof $n!="number")return xe.call(this,"w must be a number",Ln);if(mo(An)&&typeof An!="number")return xe.call(this,"h must be a number",Ln)}const qn=[[1/16,2/16,1/16],[2/16,.25,2/16],[1/16,2/16,1/16]];ln=ln||0,En=En||0,$n=mo($n)?$n:this.bitmap.width-ln,An=mo(An)?An:this.bitmap.height-En;const Gn=this.cloneQuiet();return this.scanQuiet(ln,En,$n,An,function(Vn,ar,lr){Vn=rn*Math.floor(Vn/rn),ar=rn*Math.floor(ar/rn);const fr=$a(Gn,qn,Vn,ar);this.bitmap.data[lr]=fr[0],this.bitmap.data[lr+1]=fr[1],this.bitmap.data[lr+2]=fr[2]}),ve(Ln)&&Ln.call(this,null,this),this},convolute(rn,ln,En,$n,An,Ln){if(!Array.isArray(rn))return xe.call(this,"the kernel must be an array",Ln);if(typeof ln=="function")Ln=ln,ln=null,En=null,$n=null,An=null;else{if(mo(ln)&&typeof ln!="number")return xe.call(this,"x must be a number",Ln);if(mo(En)&&typeof En!="number")return xe.call(this,"y must be a number",Ln);if(mo($n)&&typeof $n!="number")return xe.call(this,"w must be a number",Ln);if(mo(An)&&typeof An!="number")return xe.call(this,"h must be a number",Ln)}ln=mo(ln)?ln:0,En=mo(En)?En:0,$n=mo($n)?$n:this.bitmap.width-ln,An=mo(An)?An:this.bitmap.height-En;const qn=this.cloneQuiet();return this.scanQuiet(ln,En,$n,An,function(Gn,Vn,ar){const lr=$a(qn,rn,Gn,Vn);this.bitmap.data[ar]=this.constructor.limit255(lr[0]),this.bitmap.data[ar+1]=this.constructor.limit255(lr[1]),this.bitmap.data[ar+2]=this.constructor.limit255(lr[2])}),ve(Ln)&&Ln.call(this,null,this),this},color:Wl,colour:Wl}),()=>({contain(rn,ln,En,$n,An){if(typeof rn!="number"||typeof ln!="number")return xe.call(this,"w and h must be numbers",An);typeof En=="string"&&(typeof $n=="function"&&An===void 0&&(An=$n),$n=En,En=null),typeof En=="function"&&(An===void 0&&(An=En),$n=null,En=null),typeof $n=="function"&&An===void 0&&(An=$n,$n=null);const Ln=7&(En=En||this.constructor.HORIZONTAL_ALIGN_CENTER|this.constructor.VERTICAL_ALIGN_MIDDLE),qn=En>>3;if((Ln===0||Ln&Ln-1)&&(qn===0||qn&qn-1))return xe.call(this,"only use one flag per alignment direction",An);const Gn=Ln>>1,Vn=qn>>1,ar=rn/ln>this.bitmap.width/this.bitmap.height?ln/this.bitmap.height:rn/this.bitmap.width,lr=this.cloneQuiet().scale(ar,$n);return this.resize(rn,ln,$n),this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(fr,Or,wr){this.bitmap.data.writeUInt32BE(this._background,wr)}),this.blit(lr,(this.bitmap.width-lr.bitmap.width)/2*Gn,(this.bitmap.height-lr.bitmap.height)/2*Vn),ve(An)&&An.call(this,null,this),this}}),()=>({cover(rn,ln,En,$n,An){if(typeof rn!="number"||typeof ln!="number")return xe.call(this,"w and h must be numbers",An);En&&typeof En=="function"&&An===void 0?(An=En,En=null,$n=null):typeof $n=="function"&&An===void 0&&(An=$n,$n=null);const Ln=7&(En=En||this.constructor.HORIZONTAL_ALIGN_CENTER|this.constructor.VERTICAL_ALIGN_MIDDLE),qn=En>>3;if((Ln===0||Ln&Ln-1)&&(qn===0||qn&qn-1))return xe.call(this,"only use one flag per alignment direction",An);const Gn=Ln>>1,Vn=qn>>1,ar=rn/ln>this.bitmap.width/this.bitmap.height?rn/this.bitmap.width:ln/this.bitmap.height;return this.scale(ar,$n),this.crop((this.bitmap.width-rn)/2*Gn,(this.bitmap.height-ln)/2*Vn,rn,ln),ve(An)&&An.call(this,null,this),this}}),function(rn){return rn("crop",function(ln,En,$n,An,Ln){if(typeof ln!="number"||typeof En!="number")return xe.call(this,"x and y must be numbers",Ln);if(typeof $n!="number"||typeof An!="number")return xe.call(this,"w and h must be numbers",Ln);if(ln=Math.round(ln),En=Math.round(En),$n=Math.round($n),An=Math.round(An),ln===0&&$n===this.bitmap.width){const qn=$n*En+ln<<2,Gn=qn+(An*$n<<2);this.bitmap.data=this.bitmap.data.slice(qn,Gn)}else{const qn=js.allocUnsafe($n*An*4);let Gn=0;this.scanQuiet(ln,En,$n,An,function(Vn,ar,lr){const fr=this.bitmap.data.readUInt32BE(lr,!0);qn.writeUInt32BE(fr,Gn,!0),Gn+=4}),this.bitmap.data=qn}return this.bitmap.width=$n,this.bitmap.height=An,ve(Ln)&&Ln.call(this,null,this),this}),{class:{autocrop(){const ln=this.bitmap.width,En=this.bitmap.height;let $n,An=0,Ln=2e-4,qn=!0,Gn=!1,Vn={north:!1,south:!1,east:!1,west:!1};for(var ar=arguments.length,lr=new Array(ar),fr=0;frLn)break e}gr++}if(Or=this.getPixelColor(ln,0),!Vn.west)e:for(let ni=0;niLn)break e}Lr++}if(Or=this.getPixelColor(0,En),!Vn.south)e:for(let ni=En-1;ni>=gr+1;ni--){for(let wi=ln-yr-1;wi>=0;wi--){const vi=this.getPixelColor(wi,ni),Ri=this.constructor.intToRGBA(vi);if(this.constructor.colorDiff(wr,Ri)>Ln)break e}xr++}if(Or=this.getPixelColor(ln,En),!Vn.east)e:for(let ni=ln-1;ni>=0+Lr+1;ni--){for(let wi=En-1;wi>=0+gr;wi--){const vi=this.getPixelColor(ni,wi),Ri=this.constructor.intToRGBA(vi);if(this.constructor.colorDiff(wr,Ri)>Ln)break e}yr++}let Hr=!1;if(Lr-=An,yr-=An,gr-=An,xr-=An,Gn){const ni=Math.min(yr,Lr),wi=Math.min(gr,xr);Lr=ni,yr=ni,gr=wi,xr=wi}Lr=Lr>=0?Lr:0,yr=yr>=0?yr:0,gr=gr>=0?gr:0,xr=xr>=0?xr:0;const si=ln-(Lr+yr),_i=En-(xr+gr);return Hr=qn?yr!==0&&gr!==0&&Lr!==0&&xr!==0:yr!==0||gr!==0||Lr!==0||xr!==0,Hr&&this.crop(Lr,gr,si,_i),ve($n)&&$n.call(this,null,this),this}}}},()=>({displace(rn,ln,En){if(typeof rn!="object"||rn.constructor!==this.constructor)return xe.call(this,"The source must be a Jimp image",En);if(typeof ln!="number")return xe.call(this,"factor must be a number",En);const $n=this.cloneQuiet();return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(An,Ln,qn){let Gn=rn.bitmap.data[qn]/256*ln;Gn=Math.round(Gn);const Vn=this.getPixelIndex(An+Gn,Ln);this.bitmap.data[Vn]=$n.bitmap.data[qn],this.bitmap.data[Vn+1]=$n.bitmap.data[qn+1],this.bitmap.data[Vn+2]=$n.bitmap.data[qn+2]}),ve(En)&&En.call(this,null,this),this}}),()=>({dither565:ql,dither16:ql}),()=>({fisheye(){let rn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{r:2.5},ln=arguments.length>1?arguments[1]:void 0;typeof rn=="function"&&(ln=rn,rn={r:2.5});const En=this.cloneQuiet(),{width:$n,height:An}=En.bitmap;return En.scanQuiet(0,0,$n,An,(Ln,qn)=>{const Gn=Ln/$n,Vn=qn/An,ar=Math.sqrt(Math.pow(Gn-.5,2)+Math.pow(Vn-.5,2)),lr=2*Math.pow(ar,rn.r),fr=(Gn-.5)/ar,Or=(Vn-.5)/ar,wr=Math.round((lr*fr+.5)*$n),gr=Math.round((lr*Or+.5)*An),yr=En.getPixelColor(wr,gr);this.setPixelColor(yr,Ln,qn)}),this.setPixelColor(En.getPixelColor($n/2,An/2),$n/2,An/2),ve(ln)&&ln.call(this,null,this),this}}),()=>({flip:Yl,mirror:Yl}),()=>({gaussian(rn,ln){if(typeof rn!="number")return xe.call(this,"r must be a number",ln);if(rn<1)return xe.call(this,"r must be greater than 0",ln);const En=Math.ceil(2.57*rn),$n=2*En+1,An=rn*rn*2,Ln=An*Math.PI,qn=[];for(let Gn=0;Gn<$n;Gn++){qn[Gn]=[];for(let Vn=0;Vn<$n;Vn++){const ar=(Vn-En)**2+(Gn-En)**2;qn[Gn][Vn]=Math.exp(-ar/An)/Ln}}for(let Gn=0;Gn({invert(rn){return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(ln,En,$n){this.bitmap.data[$n]=255-this.bitmap.data[$n],this.bitmap.data[$n+1]=255-this.bitmap.data[$n+1],this.bitmap.data[$n+2]=255-this.bitmap.data[$n+2]}),ve(rn)&&rn.call(this,null,this),this}}),()=>({mask(rn){let ln=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,En=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,$n=arguments.length>3?arguments[3]:void 0;if(!(rn instanceof this.constructor))return xe.call(this,"The source must be a Jimp image",$n);if(typeof ln!="number"||typeof En!="number")return xe.call(this,"x and y must be numbers",$n);ln=Math.round(ln),En=Math.round(En);const An=this.bitmap.width,Ln=this.bitmap.height,qn=this;return rn.scanQuiet(0,0,rn.bitmap.width,rn.bitmap.height,function(Gn,Vn,ar){const lr=ln+Gn,fr=En+Vn;if(lr>=0&&fr>=0&&lr({normalize(rn){const ln=ec.call(this),En={r:Us(ln.r),g:Us(ln.g),b:Us(ln.b)};return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function($n,An,Ln){const qn=this.bitmap.data[Ln+0],Gn=this.bitmap.data[Ln+1],Vn=this.bitmap.data[Ln+2];this.bitmap.data[Ln+0]=Aa(qn,En.r[0],En.r[1]),this.bitmap.data[Ln+1]=Aa(Gn,En.g[0],En.g[1]),this.bitmap.data[Ln+2]=Aa(Vn,En.b[0],En.b[1])}),ve(rn)&&rn.call(this,null,this),this}}),()=>({constants:{measureText:Ls,measureTextHeight:ci,FONT_SANS_8_BLACK:me().join(Uo,"fonts/open-sans/open-sans-8-black/open-sans-8-black.fnt"),FONT_SANS_10_BLACK:me().join(Uo,"fonts/open-sans/open-sans-10-black/open-sans-10-black.fnt"),FONT_SANS_12_BLACK:me().join(Uo,"fonts/open-sans/open-sans-12-black/open-sans-12-black.fnt"),FONT_SANS_14_BLACK:me().join(Uo,"fonts/open-sans/open-sans-14-black/open-sans-14-black.fnt"),FONT_SANS_16_BLACK:me().join(Uo,"fonts/open-sans/open-sans-16-black/open-sans-16-black.fnt"),FONT_SANS_32_BLACK:me().join(Uo,"fonts/open-sans/open-sans-32-black/open-sans-32-black.fnt"),FONT_SANS_64_BLACK:me().join(Uo,"fonts/open-sans/open-sans-64-black/open-sans-64-black.fnt"),FONT_SANS_128_BLACK:me().join(Uo,"fonts/open-sans/open-sans-128-black/open-sans-128-black.fnt"),FONT_SANS_8_WHITE:me().join(Uo,"fonts/open-sans/open-sans-8-white/open-sans-8-white.fnt"),FONT_SANS_16_WHITE:me().join(Uo,"fonts/open-sans/open-sans-16-white/open-sans-16-white.fnt"),FONT_SANS_32_WHITE:me().join(Uo,"fonts/open-sans/open-sans-32-white/open-sans-32-white.fnt"),FONT_SANS_64_WHITE:me().join(Uo,"fonts/open-sans/open-sans-64-white/open-sans-64-white.fnt"),FONT_SANS_128_WHITE:me().join(Uo,"fonts/open-sans/open-sans-128-white/open-sans-128-white.fnt"),loadFont(rn,ln){return typeof rn!="string"?xe.call(this,"file must be a string",ln):new Promise((En,$n)=>{ln=ln||function(An,Ln){An?$n(An):En(Ln)},nc()(rn,(An,Ln)=>{const qn={},Gn={};if(An)return xe.call(this,An,ln);for(let Vn=0;VnVn.read(ar+"/"+Or));return Promise.all(fr)})(this,me().dirname(rn),Ln.pages).then(Vn=>{ln(null,{chars:qn,kernings:Gn,pages:Vn,common:Ln.common,info:Ln.info})})})})}},class:{print(rn,ln,En,$n,An,Ln,qn){if(typeof An=="function"&&qn===void 0&&(qn=An,An=1/0),An===void 0&&(An=1/0),typeof Ln=="function"&&qn===void 0&&(qn=Ln,Ln=1/0),Ln===void 0&&(Ln=1/0),typeof rn!="object")return xe.call(this,"font must be a Jimp loadFont",qn);if(typeof ln!="number"||typeof En!="number"||typeof An!="number")return xe.call(this,"x, y and maxWidth must be numbers",qn);if(typeof An!="number")return xe.call(this,"maxWidth must be a number",qn);if(typeof Ln!="number")return xe.call(this,"maxHeight must be a number",qn);let Gn,Vn;typeof $n=="object"&&$n.text!==null&&$n.text!==void 0?(Gn=$n.alignmentX||this.constructor.HORIZONTAL_ALIGN_LEFT,Vn=$n.alignmentY||this.constructor.VERTICAL_ALIGN_TOP,{text:$n}=$n):(Gn=this.constructor.HORIZONTAL_ALIGN_LEFT,Vn=this.constructor.VERTICAL_ALIGN_TOP,$n=$n.toString()),Ln!==1/0&&Vn===this.constructor.VERTICAL_ALIGN_BOTTOM?En+=Ln-ci(rn,$n,An):Ln!==1/0&&Vn===this.constructor.VERTICAL_ALIGN_MIDDLE&&(En+=Ln/2-ci(rn,$n,An)/2);const ar=Object.entries(rn.chars)[0][1].xadvance,{lines:lr,longestLine:fr}=Xl(rn,$n,An);return lr.forEach(Or=>{const wr=Or.join(" "),gr=function(yr,xr,Lr,Hr,si){return si===yr.HORIZONTAL_ALIGN_LEFT?0:si===yr.HORIZONTAL_ALIGN_CENTER?(Hr-Ls(xr,Lr))/2:Hr-Ls(xr,Lr)}(this.constructor,rn,wr,An,Gn);rc.call(this,rn,ln+gr,En,wr,ar),En+=rn.common.lineHeight}),ve(qn)&&qn.call(this,null,this,{x:ln+fr,y:En}),this}}}),()=>({constants:{RESIZE_NEAREST_NEIGHBOR:"nearestNeighbor",RESIZE_BILINEAR:"bilinearInterpolation",RESIZE_BICUBIC:"bicubicInterpolation",RESIZE_HERMITE:"hermiteInterpolation",RESIZE_BEZIER:"bezierInterpolation"},class:{resize(rn,ln,En,$n){if(typeof rn!="number"||typeof ln!="number")return xe.call(this,"w and h must be numbers",$n);if(typeof En=="function"&&$n===void 0&&($n=En,En=null),rn===this.constructor.AUTO&&ln===this.constructor.AUTO)return xe.call(this,"w and h cannot both be set to auto",$n);if(rn===this.constructor.AUTO&&(rn=this.bitmap.width*(ln/this.bitmap.height)),ln===this.constructor.AUTO&&(ln=this.bitmap.height*(rn/this.bitmap.width)),rn<0||ln<0)return xe.call(this,"w and h must be positive numbers",$n);if(rn=Math.round(rn)||1,ln=Math.round(ln)||1,typeof Ds[En]=="function"){const An={data:Zl.alloc(rn*ln*4),width:rn,height:ln};Ds[En](this.bitmap,An),this.bitmap=An}else{const An=this;new ic(this.bitmap.width,this.bitmap.height,rn,ln,!0,!0,Ln=>{An.bitmap.data=Zl.from(Ln),An.bitmap.width=rn,An.bitmap.height=ln}).resize(this.bitmap.data)}return ve($n)&&$n.call(this,null,this),this}}}),()=>({rotate(rn,ln,En){return ln==null&&(ln=!0),typeof ln=="function"&&En===void 0&&(En=ln,ln=!0),typeof rn!="number"?xe.call(this,"deg must be a number",En):typeof ln!="boolean"&&typeof ln!="string"?xe.call(this,"mode must be a boolean or a string",En):(rn%90!=0||!ln&&this.bitmap.width!==this.bitmap.height&&rn%180!=0?zo.call(this,rn,ln,En):Ya.call(this,rn),ve(En)&&En.call(this,null,this),this)}}),()=>({scale(rn,ln,En){if(typeof rn!="number")return xe.call(this,"f must be a number",En);if(rn<0)return xe.call(this,"f must be a positive number",En);typeof ln=="function"&&En===void 0&&(En=ln,ln=null);const $n=this.bitmap.width*rn,An=this.bitmap.height*rn;return this.resize($n,An,ln),ve(En)&&En.call(this,null,this),this},scaleToFit(rn,ln,En,$n){if(typeof rn!="number"||typeof ln!="number")return xe.call(this,"w and h must be numbers",$n);typeof En=="function"&&$n===void 0&&($n=En,En=null);const An=rn/ln>this.bitmap.width/this.bitmap.height?ln/this.bitmap.height:rn/this.bitmap.width;return this.scale(An,En),ve($n)&&$n.call(this,null,this),this}}),()=>({shadow(){let rn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ln=arguments.length>1?arguments[1]:void 0;typeof rn=="function"&&(ln=rn,rn={});const{opacity:En=.7,size:$n=1.1,x:An=-25,y:Ln=25,blur:qn=5}=rn,Gn=this.clone(),Vn=this.clone();return Vn.scan(0,0,Vn.bitmap.width,Vn.bitmap.height,(ar,lr,fr)=>{Vn.bitmap.data[fr]=0,Vn.bitmap.data[fr+1]=0,Vn.bitmap.data[fr+2]=0,Vn.bitmap.data[fr+3]=Vn.constructor.limit255(Vn.bitmap.data[fr+3]*En),this.bitmap.data[fr]=0,this.bitmap.data[fr+1]=0,this.bitmap.data[fr+2]=0,this.bitmap.data[fr+3]=0}),Vn.resize(Vn.bitmap.width*$n,Vn.bitmap.height*$n).blur(qn),this.composite(Vn,An,Ln),this.composite(Gn,0,0),ve(ln)&&ln.call(this,null,this),this}}),()=>({threshold(rn,ln){let{max:En,replace:$n=255,autoGreyscale:An=!0}=rn;return typeof En!="number"?xe.call(this,"max must be a number",ln):typeof $n!="number"?xe.call(this,"replace must be a number",ln):typeof An!="boolean"?xe.call(this,"autoGreyscale must be a boolean",ln):(En=this.constructor.limit255(En),$n=this.constructor.limit255($n),An&&this.greyscale(),this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,(Ln,qn,Gn)=>{const Vn=this.bitmap.data[Gn]1&&arguments[1]!==void 0?arguments[1]:Un;const En={hasAlpha:{},encoders:{},decoders:{},class:{},constants:{}};function $n(An){Object.entries(An).forEach(Ln=>{let[qn,Gn]=Ln;En[qn]={...En[qn],...Gn}})}rn.types&&(rn.types.forEach(function(An){const Ln=An();Array.isArray(Ln.mime)?mi(...Ln.mime):Object.entries(Ln.mime).forEach(qn=>mi(...qn)),delete Ln.mime,$n(Ln)}),ln.decoders={...ln.decoders,...En.decoders},ln.encoders={...ln.encoders,...En.encoders},ln.hasAlpha={...ln.hasAlpha,...En.hasAlpha}),rn.plugins&&rn.plugins.forEach(function(An){const Ln=An(On)||{};Ln.class||Ln.constants?$n(Ln):$n({class:Ln})}),ua(En.class,ln),aa(En.constants,ln)})({types:[()=>(0,Zn.Ee)(Er(),vr(),{mime:{[Jr]:["bmp"]},constants:{MIME_BMP:Jr,MIME_X_MS_BMP:Zr},decoders:{[Jr]:jr,[Zr]:jr},encoders:{[Jr]:Ur,[Zr]:Ur}},{mime:{[Fi]:["tiff","tif"]},constants:{MIME_TIFF:Fi},decoders:{[Fi]:rn=>{const ln=Pi().decode(rn),En=ln[0];ln.forEach(An=>{Pi().decodeImage(rn,An)});const $n=Pi().toRGBA8(En);return{data:qi.from($n),width:En.t256[0],height:En.t257[0]}}},encoders:{[Fi]:rn=>{const ln=Pi().encodeImage(rn.bitmap.data,rn.bitmap.width,rn.bitmap.height);return qi.from(ln)}}},{mime:{[jo]:["gif"]},constants:{MIME_GIF:jo},decoders:{[jo]:rn=>{const ln=new so.N(rn),En=ti.alloc(ln.width*ln.height*4);return ln.decodeAndBlitFrameRGBA(0,En),{data:En,width:ln.width,height:ln.height}}},encoders:{[jo]:rn=>{const ln=new Ui.BitmapImage(rn.bitmap);Ui.GifUtil.quantizeDekker(ln,256);const En=new Ui.GifFrame(ln);return new Ui.GifCodec().encodeGif([En],{}).then($n=>$n.buffer)}}})],plugins:[rn=>{const ln=zs.map(En=>{let $n=En(rn)||{};return $n.class||$n.constants||($n={class:$n}),$n});return(0,Zn.Ee)(...ln)}]})})()})();const _Jimp=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Jimp=typeof self<"u"&&self.Jimp||_Jimp;function isPlainObject(ne){return(ne==null?void 0:ne.constructor)===Object}var validPathRegex=/^[^.[\]]+(?:\.[^.[\]]+)*(?:\[\d+])*(?:\.[^.[\]]+(?:\[\d+])*)*$/,pathSplitRegex=/\.|(?=\[)/g,matchBracketsRegex=/[[\]]/g;function set$1(ne,oe,ce){if(!validPathRegex.test(oe))throw new Error("Invalid path, look at the examples for the correct format.");const ue=oe.split(pathSplitRegex);let pe=ne;for(let me=0;mejsxRuntimeExports.jsx("img",{src:ne});function Screenshot({screenshot:ne,renderScreenshot:oe=defaultScreenshotRenderer}){const{result:ce,loading:ue}=useAsync(async()=>await(ne==null?void 0:ne()),[ne]);return oe(ce,ue)}function Gallery({onChange:ne}){const oe=usePaper(),[ce]=useScreenshots(),[ue,{set:pe,remove:me}]=useMap$1();reactExports.useEffect(()=>{ne==null||ne(lodashExports$1.values(ue))},[ue]);function ge(ye,ve,xe){ve&&xe?pe(`${ye}`,xe):me(`${ye}`)}return useAsync(async()=>{const ye=lodashExports$1.head(lodashExports$1.values(ce)),ve=await(ye==null?void 0:ye());ve&&ge(0,!0,ve)},[ce]),jsxRuntimeExports.jsx(Scroll,{x:!0,py:2,children:jsxRuntimeExports.jsx(Stack$1,{direction:"row",children:lodashExports$1.values(ce).map((ye,ve)=>jsxRuntimeExports.jsx(Screenshot,{screenshot:ye,renderScreenshot:(xe,_e)=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Box$1,{sx:{minWidth:"320px",height:"320px",flex:0,p:2,"&:not(:last-child)":{pr:1}},children:jsxRuntimeExports.jsxs(Box$1,{sx:{position:"relative",...oe(1),height:"100%"},children:[!!xe&&jsxRuntimeExports.jsx(Box$1,{sx:{backgroundImage:Se=>`linear-gradient(to bottom, ${alpha$1(Se.palette.background.paper,.5)}, transparent), url("${xe}")`,width:"100%",height:"100%",backgroundSize:"cover",backgroundPosition:"center"}}),jsxRuntimeExports.jsx(Box$1,{sx:{position:"absolute",p:1,top:0,left:0},children:jsxRuntimeExports.jsx(FormControlLabel$1,{control:jsxRuntimeExports.jsx(Checkbox$1,{checked:!!ue[ve],disabled:!xe,color:"primary",sx:{ml:1},onChange:(Se,$e)=>ge(ve,$e,xe)}),label:`Viewport ${ve+1}`})}),_e&&jsxRuntimeExports.jsx(Box$1,{sx:{position:"absolute",m:2,top:0,right:0},children:jsxRuntimeExports.jsx(CircularProgress$1,{})})]})})})},ve))})})}const replacements={"*":"star","/":"slash","+":"plus","@":"at","%":"percent","&":"and"};function getFilename(ne=""){return lodashExports$1.kebabCase(lodashExports$1.reduce(lodashExports$1.entries(replacements),(oe,[ce,ue])=>oe.replace(ce,` ${ue} `),ne))||"untitled"}const imageSize=64;async function resizeImage(ne){const oe=await Jimp.read(Buffer.from(ne.split(",")[1],"base64")),ce=oe.getWidth()set(Ae,`workspaceMeta.${$e}`,Re)))}const{save:ge,estimateWorkspaceSize:ye}=useWorkspace(),ve=useLoadingState("general"),xe=useSnackbar(),_e=reactExports.useMemo(ye,[]);async function Se($e){return{...ue,id:nanoid$1(),size:$e,screenshots:await map((ue==null?void 0:ue.screenshots)??[],resizeImage),lastModified:Date.now()}}return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Box$1,{children:jsxRuntimeExports.jsx(Gallery,{onChange:$e=>me("screenshots",$e)})}),jsxRuntimeExports.jsxs(Stack$1,{p:2,gap:2,children:[jsxRuntimeExports.jsx(TextField$1,{...textFieldProps,defaultValue:ue.name,onChange:$e=>me("name",$e.target.value),label:"Name",fullWidth:!0}),jsxRuntimeExports.jsx(TextField$1,{...textFieldProps,minRows:3,defaultValue:ue.description,size:"small",onChange:$e=>me("description",$e.target.value),label:"Description",fullWidth:!0,multiline:!0}),jsxRuntimeExports.jsx(TextField$1,{...textFieldProps,defaultValue:ue.author,size:"small",onChange:$e=>me("author",$e.target.value),label:"Author",fullWidth:!0,multiline:!0}),jsxRuntimeExports.jsx(Box$1,{sx:{pt:2,width:"100%"},children:jsxRuntimeExports.jsx(Button,{sx:{justifyContent:"flex-start",width:"100%",...ne(1)},onClick:()=>ve(async()=>{const $e=getFilename(ue.name),{size:Re}=await ge(!1,$e);download(JSON.stringify(await Se(Re)),`${$e}.workspace.meta`),xe(`Metadata saved, ${$e}.workspace.meta`)}),startIcon:jsxRuntimeExports.jsx(DownloadOutlined,{}),size:"large",children:jsxRuntimeExports.jsxs(Stack$1,{sx:{ml:1},alignItems:"baseline",children:[ue.name||"Untitled",jsxRuntimeExports.jsxs(Type$2,{component:"div",color:"text.secondary",children:[getFilename(ue.name),".workspace"]}),jsxRuntimeExports.jsxs(Type$2,{component:"div",color:"text.secondary",children:[lodashExports$1.ceil(_e/1024/1024,2)," MB"]})]})})})]})]})}function ExportWorkspaceModal(ne){return jsxRuntimeExports.jsxs(Modal,{...ne,children:[jsxRuntimeExports.jsx(ModalAppBar,{onClose:()=>{var oe;return(oe=ne==null?void 0:ne.onClose)==null?void 0:oe.call(ne,{},"backdropClick")},children:jsxRuntimeExports.jsx(Type$2,{component:"div",variant:"h6",children:"Publish Workspace"})}),jsxRuntimeExports.jsx(A,{})]})}const canOpenWindows=!distExports$1.isMobile,alphabet="ABCDEFGHIJKLMNOPQRSTUVWXYZ";function MenuEntry({startIcon:ne,endIcon:oe,label:ce}){return jsxRuntimeExports.jsxs(Stack$1,{direction:"row",gap:1,children:[!!ne&&reactExports.cloneElement(ne,{fontSize:"small",color:"disabled"}),jsxRuntimeExports.jsx("span",{children:ce}),!!oe&&reactExports.cloneElement(oe,{fontSize:"small",color:"disabled"})]})}function useTitleBarVisible(){const[ne,oe]=reactExports.useState(!1),[ce,ue]=reactExports.useState(new DOMRect);return reactExports.useEffect(()=>{if("windowControlsOverlay"in navigator){const pe=()=>{oe(!!navigator.windowControlsOverlay.visible),ue(navigator.windowControlsOverlay.getTitlebarAreaRect())};return navigator.windowControlsOverlay.addEventListener("geometrychange",pe),pe(),()=>navigator.windowControlsOverlay.removeEventListener("geometrychange",pe)}},[oe]),{visible:ne,rect:ce}}const WorkspaceChip=()=>{const ne=useTheme$1(),{index:oe,isPrimary:ce,participants:ue,peers:pe}=useSyncStatus(),me=shades[(oe+1)*2%shades.length],ge=alphabet[oe],ye=getShade(me,ne.palette.mode);return jsxRuntimeExports.jsx(Tooltip$1,{title:`${ce?"Primary":"Secondary"} window, ${ue.length+1} in group`,children:jsxRuntimeExports.jsx(Collapse$1,{in:!!pe.length,orientation:"horizontal",sx:{ml:"0px !important",overflow:"hidden"},children:jsxRuntimeExports.jsx(Chip$1,{size:"small",icon:jsxRuntimeExports.jsx(WorkspacesOutlined,{sx:{color:`${ye} !important`}}),sx:{ml:1,flex:0,WebkitAppRegion:"no-drag",color:ye,background:alpha$1(ye,.08)},label:`Group ${ge}`})})})},TitleBarPlaceholder=()=>{const ne=useTitleBarVisible(),{palette:oe}=useTheme$1(),ce=oe.background.default;return useTitleBar(ce),jsxRuntimeExports.jsx(Box$1,{sx:{bgcolor:"background.default",minHeight:36,width:"100%",height:ne?"env(titlebar-area-height, 50px)":0}})},TitleBar=()=>{const{palette:ne}=useTheme$1(),oe=ne.background.default;useTitleBar(oe);const{save:ce,load:ue}=useWorkspace(),{visible:pe,rect:me}=useTitleBarVisible(),[,ge]=useView(),[ye,ve]=reactExports.useState(!1);function xe(_e){ge(({view:Se})=>({view:{type:"branch",orientation:_e,key:nanoid$1(),children:[{...Se,size:80},{type:"leaf",key:nanoid$1(),content:{type:""},size:20,acceptDrop:!0}]}}))}return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Box$1,{sx:{mx:.5,borderBottom:_e=>`1px solid ${_e.palette.background.default}`,minHeight:36,paddingLeft:"env(titlebar-area-x, 0px)",height:pe?"env(titlebar-area-height, 50px)":0,width:"env(titlebar-area-width, 100%)",WebkitAppRegion:"drag",overflowX:"auto"},children:jsxRuntimeExports.jsx(Scroll,{x:!0,style:{height:"100%"},children:jsxRuntimeExports.jsx(Box$1,{sx:{height:"100%"},children:jsxRuntimeExports.jsxs(Stack$1,{direction:"row",spacing:1,sx:{height:"100%"},alignItems:"center",justifyContent:"flex-start",children:[pe&&me.x>=0&&jsxRuntimeExports.jsx(Box$1,{sx:{p:1,height:"100%",maxWidth:"min-content",aspectRatio:1},children:jsxRuntimeExports.jsx("img",{src:logo$1,style:{height:"100%"}})}),jsxRuntimeExports.jsx(WorkspaceChip,{}),[{key:"view",items:[{disabled:!canOpenWindows,key:"panel-new-window",type:"action",name:"New window",action:()=>openWindow()},{type:"divider"},{type:"action",key:"panel-new-right",name:"Add view to the right",action:()=>xe("horizontal")},{type:"action",key:"panel-new-bottom",name:"Add view below",action:()=>xe("vertical")},{type:"divider"},{type:"action",name:"Reset layout",key:"panel-reset",action:()=>ge(getDefaultViewTree)},{type:"action",name:"Reload window",key:"panel-reload",action:()=>location.reload()}]},{key:"workspace",items:[{type:"action",name:"Open workspace",key:"workspace-load",action:ue},{type:"action",name:"Save workspace",key:"workspace-save",action:ce},{type:"divider"},{type:"action",name:jsxRuntimeExports.jsx(MenuEntry,{label:"Publish workspace",endIcon:jsxRuntimeExports.jsx(OpenInNewOutlined,{})}),key:"workspace-save-metadata",action:()=>ve(!0)}]},{key:"help",items:[{type:"action",name:"Open repository in GitHub",key:"github",action:()=>open(repository,"_blank")},{type:"action",name:"Changelog",key:"changelog",action:()=>open(`${changelog}/${version}`,"_blank")},{type:"action",name:"Documentation",key:"documentation",action:()=>open(docs,"_blank")}]}].map(({key:_e,items:Se})=>jsxRuntimeExports.jsx(PopupState,{variant:"popover",children:$e=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Menu$1,{...bindMenu($e),children:jsxRuntimeExports.jsx(MenuList$1,{dense:!0,sx:{p:0},children:Se.map((Re,Ae)=>{if(Re.type==="action"){const{name:Ie,key:ke,action:Be}=Re;return jsxRuntimeExports.jsx(MenuItem$1,{disabled:lodashExports$1.get(Re,"disabled"),onClick:()=>{Be==null||Be(),$e.close()},children:Ie},ke)}else return jsxRuntimeExports.jsx(Divider$1,{},Ae)})})}),jsxRuntimeExports.jsx(FeaturePickerButton,{...bindTrigger($e),sx:{WebkitAppRegion:"no-drag",minWidth:"fit-content",p:.5,px:1},children:lodashExports$1.startCase(_e)},_e)]})},_e))]})})})}),jsxRuntimeExports.jsx(ExportWorkspaceModal,{open:ye,onClose:()=>ve(!1)})]})},logo=""+new URL("logo192-5e372a8c.png",import.meta.url).href;function BootstrapService(){const{load:ne}=useWorkspace();return useAsync(async()=>{try{const oe=new URLSearchParams(location.search).get("workspace");if(oe&&isWorkspace(oe)&&isWorkspace(oe)){const ce=oe.split("/").pop()??oe,ue=await fetch(oe);ne(new File([await ue.blob()],ce,{lastModified:lodashExports$1.now()}))}}catch(oe){console.warn(oe)}},[]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{})}function ConnectionsService(){const ne=useSnackbar(),[{remote:oe}]=useSettings(),[,ce]=useConnections(),ue=useLoadingState("connections");return reactExports.useEffect(()=>{let pe=!1,me=[];return ue(async()=>{if(oe!=null&&oe.length){for(const{transport:ge,url:ye,disabled:ve}of oe){if(ve!==!0){ne(`Connecting to ${ye}...`);const xe=new(getTransport(ge))({url:ye});await xe.connect();const{result:_e,delta:Se}=await timed(()=>xe.call("about"));_e?(ne(`Connected to ${_e.name}`),me=[...me,{..._e,url:ye,ping:Se,transport:()=>xe}]):await xe.disconnect()}pe||ce(()=>me)}pe||ne(`Connected to ${me.length} of ${oe.length} solvers`)}}),()=>{pe=!0,me.map(ge=>ge.transport().disconnect())}},[JSON.stringify(oe),ce,ne,ue]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{})}function withSource(ne){return oe=>({...oe,source:ne})}const getFeatures=async({transport:ne,url:oe})=>lodashExports$1.chain(await map(["algorithms","formats","maps","traces"],async ce=>{const{result:ue}=await timed(()=>ne().call(`features/${ce}`),1e3);return{prop:ce,result:lodashExports$1.map(ue,withSource(oe))}})).keyBy("prop").mapValues("result").value();function FeaturesService(){const[ne]=useConnections(),[,oe]=useFeatures(),[{connections:ce}]=useLoading(),ue=useLoadingState("features");return useAsyncAbortable(async pe=>{ue(async()=>{if(!ce){const me={default:{algorithms:[],formats:lodashExports$1.keys(mapParsers).map(ye=>({id:ye,source:"internal"})),traces:[],maps:[]}},ge=()=>{if(!pe.aborted){const ye=lodashExports$1.chain(me).values().reduce((ve,xe)=>lodashExports$1.mergeWith({},ve,xe,(_e,Se)=>lodashExports$1.isArray(_e)?lodashExports$1.uniqBy([..._e,...Se],"id"):void 0)).value();oe(()=>ye)}};for(const ye of ne){const ve=async()=>{me[ye.url]=await getFeatures(ye),ge()};ye.transport().on("features/changed",ve),ve()}}})},[ne,getFeatures,oe,ce]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{})}function useLayerServices(){const{isPrimary:ne}=useSyncStatus(),[{layers:oe},ce,,ue]=useLayers();return reactExports.useMemo(()=>ne?lodashExports$1.map(oe,pe=>{const me=getController(pe).service;if(me)return reactExports.createElement(me,{key:pe.key,value:pe,onChange:ge=>ce(({layers:ye})=>({layers:lodashExports$1.map(ye,ve=>ve.key===pe.key?ge(ve):ve)}))})}):[],[ue,ce,ne])}function LayerService(){const ne=useLayerServices();return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:ne})}var dist={},ConsoleCapture$1={},logs={};Object.defineProperty(logs,"__esModule",{value:!0});logs.overridableFunctionNames=void 0;logs.overridableFunctionNames=["log","warn","info","debug","error"];Object.defineProperty(ConsoleCapture$1,"__esModule",{value:!0});ConsoleCapture$1.ConsoleCapture=void 0;var logs_1=logs;console.original={};var ConsoleCapture=function(){function ne(){ne.captures=[]}return ne.saveLog=function(oe,ce){var ue=ce.map(function(pe){return typeof pe=="object"?pe instanceof Error?JSON.stringify(pe,Object.getOwnPropertyNames(pe)):JSON.stringify(pe):pe});ne.captures.push({function:oe,args:ue,ts:Date.now()})},ne.setNewFunctions=function(oe){oe===void 0&&(oe=!1);var ce={apply:function(ue,pe,me){if(ne.saveLog(ue.name,me),ue.bind(pe),oe)return ue.apply(void 0,me)}};logs_1.overridableFunctionNames.forEach(function(ue){ne.consoleOverriden||(console.original[ue]=console[ue]),console[ue]=new Proxy(console[ue],ce)}),ne.consoleOverriden=!0},ne.resetToOriginalFunctions=function(){ne.consoleOverriden&&logs_1.overridableFunctionNames.forEach(function(oe){console[oe]=console.original[oe]}),ne.consoleOverriden=!1},ne.prototype.start=function(oe){oe===void 0&&(oe=!1),ne.captures=[],ne.setNewFunctions(oe)},ne.prototype.stop=function(){ne.resetToOriginalFunctions()},ne.prototype.flush=function(){ne.captures=[]},ne.prototype.getCaptures=function(){return ne.captures},ne.makeOriginalLog=function(oe){if(ne.resetToOriginalFunctions(),logs_1.overridableFunctionNames.includes(oe.function)){var ce=oe.args.map(function(ue){if(typeof ue=="string")try{var pe=JSON.parse(ue);return pe.stack?pe.stack:pe}catch{return ue}return ue});console[oe.function].apply(console,ce)}else throw Error("Invalid Log type")},ne.consoleOverriden=!1,ne}();ConsoleCapture$1.ConsoleCapture=ConsoleCapture;Object.defineProperty(dist,"__esModule",{value:!0});var ConsoleCapture_1=ConsoleCapture$1;dist.default=ConsoleCapture_1.ConsoleCapture;function LogCaptureService(){return useSnackbar(),reactExports.useEffect(()=>{},[]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{})}function SettingsService(){const[{"behaviour/showOnStart":ne},,oe]=useSettings(),[,ce]=useUIState();return reactExports.useEffect(()=>{const ue=new URLSearchParams(location.search).get("workspace");!minimal&&ne&&oe&&!ue&&ce(()=>({fullscreenModal:ne}))},[oe,minimal]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{})}function SliceProvider({slices:ne,children:oe,services:ce}){return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:lodashExports$1.reduce(lodashExports$1.map(ne,ue=>reactExports.createElement(ue)),(ue,pe)=>reactExports.cloneElement(pe,{},ue),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[oe,lodashExports$1.map(ce,(ue,pe)=>reactExports.createElement(ue,{key:pe}))]}))})}const services=[SyncService,ConnectionsService,FeaturesService,RendererService,LayerService,LogCaptureService,SettingsService,BootstrapService];function App(){const{palette:ne}=useTheme$1(),oe=ne.background.default,{loading:ce}=useSyncStatus();return jsxRuntimeExports.jsx(Flex,{vertical:!0,sx:{bgcolor:oe,color:"text.primary",WebkitAppRegion:"no-drag"},children:ce?minimal?jsxRuntimeExports.jsx(Fade$1,{in:!0,children:jsxRuntimeExports.jsxs(Stack$1,{sx:{WebkitAppRegion:"drag",background:ue=>ue.palette.background.paper,width:"100vw",height:"100vh"},children:[jsxRuntimeExports.jsx(TitleBarPlaceholder,{}),jsxRuntimeExports.jsx(Placeholder$2,{icon:jsxRuntimeExports.jsx(CircularProgress$1,{})})]})}):jsxRuntimeExports.jsx(Fade$1,{in:!0,children:jsxRuntimeExports.jsxs(Stack$1,{sx:{WebkitAppRegion:"drag",width:"100vw",height:"100vh",alignItems:"center",justifyContent:"center",gap:6},children:[jsxRuntimeExports.jsx(Image$1,{src:logo,style:{height:64,width:64}}),jsxRuntimeExports.jsx(CircularProgress$1,{})]})}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(TitleBar,{}),jsxRuntimeExports.jsx(Flex,{flex:1,children:jsxRuntimeExports.jsx(Inspector,{flex:1})})]})})}function ThemedApp(){const[{"appearance/theme":ne="dark","appearance/accentColor":oe="teal"}]=useSettings(),ce=reactExports.useMemo(()=>makeTheme(ne,oe),[ne,oe]);return jsxRuntimeExports.jsx(ThemeProvider,{theme:ce,children:jsxRuntimeExports.jsx(CssBaseline,{children:jsxRuntimeExports.jsx(SnackbarProvider,{children:jsxRuntimeExports.jsx(SliceProvider,{services,children:jsxRuntimeExports.jsx(App,{})})})})})}const index$1="",overlayscrollbars="";var client={exports:{}},reactDomClient_production={},scheduler={exports:{}},scheduler_production={};/** +`)===0?Kt.substr(1,Kt.length):Kt}).forEach(function(Kt){var Wt=Kt.split(":"),un=Wt.shift().trim();if(un){var Xt=Wt.join(":").trim();an.append(un,Xt)}}),an)};Zt.url="responseURL"in Ut?Ut.responseURL:Zt.headers.get("X-Request-URL");var en="response"in Ut?Ut.response:Ut.responseText;setTimeout(function(){Ze(new Fe(en,Zt))},0)},Ut.onerror=function(){setTimeout(function(){Dt(new TypeError("Network request failed"))},0)},Ut.ontimeout=function(){setTimeout(function(){Dt(new TypeError("Network request failed"))},0)},Ut.onabort=function(){setTimeout(function(){Dt(new We("Aborted","AbortError"))},0)},Ut.open(Je.method,function(Ke){try{return Ke===""&&ue.location.href?ue.location.href:Ke}catch{return Ke}}(Je.url),!0),Je.credentials==="include"?Ut.withCredentials=!0:Je.credentials==="omit"&&(Ut.withCredentials=!1),"responseType"in Ut&&(pe.blob?Ut.responseType="blob":pe.arrayBuffer&&Je.headers.get("Content-Type")&&Je.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(Ut.responseType="arraybuffer")),!Ge||typeof Ge.headers!="object"||Ge.headers instanceof _e?Je.headers.forEach(function(Ke,an){Ut.setRequestHeader(an,Ke)}):Object.getOwnPropertyNames(Ge.headers).forEach(function(Ke){Ut.setRequestHeader(Ke,ve(Ge.headers[Ke]))}),Je.signal&&(Je.signal.addEventListener("abort",jt),Ut.onreadystatechange=function(){Ut.readyState===4&&Je.signal.removeEventListener("abort",jt)}),Ut.send(Je._bodyInit===void 0?null:Je._bodyInit)})}qe.polyfill=!0,ue.fetch||(ue.fetch=qe,ue.Headers=_e,ue.Request=Be,ue.Response=Fe)},6290:(ne,oe,ce)=>{var ue=ce(5048),pe=ce(9748),me=ce(4655),ge=ce(1960);function ye(_e,Se,$e){var Re=_e;return pe(Se)?($e=Se,typeof _e=="string"&&(Re={uri:_e})):Re=ge(Se,{uri:_e}),Re.callback=$e,Re}function ve(_e,Se,$e){return xe(Se=ye(_e,Se,$e))}function xe(_e){if(_e.callback===void 0)throw new Error("callback argument missing");var Se=!1,$e=function(Je,Ut,jt){Se||(Se=!0,_e.callback(Je,Ut,jt))};function Re(){var Je=void 0;if(Je=Ne.response?Ne.response:Ne.responseText||function(Ut){try{if(Ut.responseType==="document")return Ut.responseXML;var jt=Ut.responseXML&&Ut.responseXML.documentElement.nodeName==="parsererror";if(Ut.responseType===""&&!jt)return Ut.responseXML}catch{}return null}(Ne),Ze)try{Je=JSON.parse(Je)}catch{}return Je}function Ae(Je){return clearTimeout(Fe),Je instanceof Error||(Je=new Error(""+(Je||"Unknown XMLHttpRequest Error"))),Je.statusCode=0,$e(Je,Dt)}function Ie(){if(!Be){var Je;clearTimeout(Fe),Je=_e.useXDR&&Ne.status===void 0?200:Ne.status===1223?204:Ne.status;var Ut=Dt,jt=null;return Je!==0?(Ut={body:Re(),statusCode:Je,method:We,headers:{},url:Ue,rawRequest:Ne},Ne.getAllResponseHeaders&&(Ut.headers=me(Ne.getAllResponseHeaders()))):jt=new Error("Internal XMLHttpRequest Error"),$e(jt,Ut,Ut.body)}}var ke,Be,Ne=_e.xhr||null;Ne||(Ne=_e.cors||_e.useXDR?new ve.XDomainRequest:new ve.XMLHttpRequest);var Fe,Ue=Ne.url=_e.uri||_e.url,We=Ne.method=_e.method||"GET",qe=_e.body||_e.data,ze=Ne.headers=_e.headers||{},Ge=!!_e.sync,Ze=!1,Dt={body:void 0,headers:{},statusCode:0,method:We,url:Ue,rawRequest:Ne};if("json"in _e&&_e.json!==!1&&(Ze=!0,ze.accept||ze.Accept||(ze.Accept="application/json"),We!=="GET"&&We!=="HEAD"&&(ze["content-type"]||ze["Content-Type"]||(ze["Content-Type"]="application/json"),qe=JSON.stringify(_e.json===!0?qe:_e.json))),Ne.onreadystatechange=function(){Ne.readyState===4&&setTimeout(Ie,0)},Ne.onload=Ie,Ne.onerror=Ae,Ne.onprogress=function(){},Ne.onabort=function(){Be=!0},Ne.ontimeout=Ae,Ne.open(We,Ue,!Ge,_e.username,_e.password),Ge||(Ne.withCredentials=!!_e.withCredentials),!Ge&&_e.timeout>0&&(Fe=setTimeout(function(){if(!Be){Be=!0,Ne.abort("timeout");var Je=new Error("XMLHttpRequest timeout");Je.code="ETIMEDOUT",Ae(Je)}},_e.timeout)),Ne.setRequestHeader)for(ke in ze)ze.hasOwnProperty(ke)&&Ne.setRequestHeader(ke,ze[ke]);else if(_e.headers&&!function(Je){for(var Ut in Je)if(Je.hasOwnProperty(Ut))return!1;return!0}(_e.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in _e&&(Ne.responseType=_e.responseType),"beforeSend"in _e&&typeof _e.beforeSend=="function"&&_e.beforeSend(Ne),Ne.send(qe||null),Ne}ne.exports=ve,ne.exports.default=ve,ve.XMLHttpRequest=ue.XMLHttpRequest||function(){},ve.XDomainRequest="withCredentials"in new ve.XMLHttpRequest?ve.XMLHttpRequest:ue.XDomainRequest,function(_e,Se){for(var $e=0;$e<_e.length;$e++)Se(_e[$e])}(["get","put","post","patch","head","delete"],function(_e){ve[_e==="delete"?"del":_e]=function(Se,$e,Re){return($e=ye(Se,$e,Re)).method=_e.toUpperCase(),xe($e)}})},1596:ne=>{ne.exports=self.DOMParser!==void 0?function(oe){return new self.DOMParser().parseFromString(oe,"application/xml")}:self.ActiveXObject!==void 0&&new self.ActiveXObject("Microsoft.XMLDOM")?function(oe){var ce=new self.ActiveXObject("Microsoft.XMLDOM");return ce.async="false",ce.loadXML(oe),ce}:function(oe){var ce=document.createElement("div");return ce.innerHTML=oe,ce}},1960:ne=>{ne.exports=function(){for(var ce={},ue=0;ue{},6777:()=>{},5546:()=>{},2460:(ne,oe,ce)=>{var ue=ce(4406),pe=Object.defineProperty,me=Object.getOwnPropertyDescriptor,ge=Object.getOwnPropertyNames,ye=Object.prototype.hasOwnProperty,ve=(Qt,On)=>{for(var Un in On)pe(Qt,Un,{get:On[Un],enumerable:!0})},xe=(Qt=>(On,Un)=>Qt&&Qt.get(On)||(Un=((Zn,or,mr,cr)=>{if(or&&typeof or=="object"||typeof or=="function")for(let Er of ge(or))ye.call(Zn,Er)||pe(Zn,Er,{get:()=>or[Er],enumerable:!(cr=me(or,Er))||cr.enumerable});return Zn})(pe({},"__esModule",{value:!0}),On),Qt&&Qt.set(On,Un),Un))(typeof WeakMap<"u"?new WeakMap:0),_e=(Qt,On,Un)=>(((Zn,or,mr)=>{or in Zn?pe(Zn,or,{enumerable:!0,configurable:!0,writable:!0,value:mr}):Zn[or]=mr})(Qt,typeof On!="symbol"?On+"":On,Un),Un),Se={};ve(Se,{applyPalette:()=>ca,applyPaletteSync:()=>Ao,buildPalette:()=>la,buildPaletteSync:()=>Ro,constants:()=>$e,conversion:()=>Be,distance:()=>Yt,image:()=>mi,palette:()=>Mn,quality:()=>ki,utils:()=>bn});var $e={};ve($e,{bt709:()=>Re});var Re={};ve(Re,{Y:()=>Ae,x:()=>Ie,y:()=>ke});var Ae=(Qt=>(Qt[Qt.RED=.2126]="RED",Qt[Qt.GREEN=.7152]="GREEN",Qt[Qt.BLUE=.0722]="BLUE",Qt[Qt.WHITE=1]="WHITE",Qt))(Ae||{}),Ie=(Qt=>(Qt[Qt.RED=.64]="RED",Qt[Qt.GREEN=.3]="GREEN",Qt[Qt.BLUE=.15]="BLUE",Qt[Qt.WHITE=.3127]="WHITE",Qt))(Ie||{}),ke=(Qt=>(Qt[Qt.RED=.33]="RED",Qt[Qt.GREEN=.6]="GREEN",Qt[Qt.BLUE=.06]="BLUE",Qt[Qt.WHITE=.329]="WHITE",Qt))(ke||{}),Be={};function Ne(Qt){return Qt>.04045?((Qt+.055)/1.055)**2.4:Qt/12.92}function Fe(Qt,On,Un){return{x:.4124*(Qt=Ne(Qt/255))+.3576*(On=Ne(On/255))+.1805*(Un=Ne(Un/255)),y:.2126*Qt+.7152*On+.0722*Un,z:.0193*Qt+.1192*On+.9505*Un}}ve(Be,{lab2rgb:()=>Nt,lab2xyz:()=>vn,rgb2hsl:()=>Ut,rgb2lab:()=>Kt,rgb2xyz:()=>Fe,xyz2lab:()=>en,xyz2rgb:()=>Cn});var Ue={};function We(Qt){return Qt*(Math.PI/180)}function qe(Qt,On,Un){let Zn=Qt;return ZnOn&&(Zn=On),Zn>Un&&(Zn=Un),Zn}function Ge(Qt,On,Un){return Qt>Un&&(Qt=Un),Qt255?Qt=255:Qt<0&&(Qt=0),Qt}function Dt(Qt){return Qt>255?Qt=255:Qt<0&&(Qt=0),Qt}function Je(Qt,On){const Un=typeof Qt[0];let Zn;if(Un==="number"||Un==="string"){const or=Object.create(null);for(let mr=0,cr=Qt.length;mrOn(mr,cr)||or[mr]-or[cr])}else{const or=Qt.slice(0);Zn=Qt.sort((mr,cr)=>On(mr,cr)||or.indexOf(mr)-or.indexOf(cr))}return Zn}function Ut(Qt,On,Un){const Zn=ze(Qt,On,Un),or=qe(Qt,On,Un),mr=or-Zn,cr=(Zn+or)/510;let Er=0;cr>0&&cr<1&&(Er=mr/(cr<.5?or+Zn:510-or-Zn));let pr=0;return mr>0&&(pr=or===Qt?(On-Un)/mr:or===On?2+(Un-Qt)/mr:4+(Qt-On)/mr,pr*=60,pr<0&&(pr+=360)),{h:pr,s:Er,l:cr}}ve(Ue,{degrees2radians:()=>We,inRange0to255:()=>Dt,inRange0to255Rounded:()=>Ze,intInRange:()=>Ge,max3:()=>qe,min3:()=>ze,stableSort:()=>Je});var jt=.95047,Ke=1,an=1.08883;function Zt(Qt){return Qt>.008856?Qt**.3333333333333333:7.787*Qt+.13793103448275862}function en(Qt,On,Un){if(Qt=Zt(Qt/jt),On=Zt(On/Ke),Un=Zt(Un/an),116*On-16<0)throw new Error("xxx");return{L:Math.max(0,116*On-16),a:500*(Qt-On),b:200*(On-Un)}}function Kt(Qt,On,Un){const Zn=Fe(Qt,On,Un);return en(Zn.x,Zn.y,Zn.z)}var Wt=.95047,un=1,Xt=1.08883;function nn(Qt){return Qt>.206893034?Qt**3:(Qt-.13793103448275862)/7.787}function vn(Qt,On,Un){const Zn=(Qt+16)/116,or=Zn-Un/200;return{x:Wt*nn(On/500+Zn),y:un*nn(Zn),z:Xt*nn(or)}}function Sn(Qt){return Qt>.0031308?1.055*Qt**.4166666666666667-.055:12.92*Qt}function Cn(Qt,On,Un){const Zn=Sn(3.2406*Qt+-1.5372*On+-.4986*Un),or=Sn(-.9689*Qt+1.8758*On+.0415*Un),mr=Sn(.0557*Qt+-.204*On+1.057*Un);return{r:Ze(255*Zn),g:Ze(255*or),b:Ze(255*mr)}}function Nt(Qt,On,Un){const Zn=vn(Qt,On,Un);return Cn(Zn.x,Zn.y,Zn.z)}var Yt={};ve(Yt,{AbstractDistanceCalculator:()=>Jt,AbstractEuclidean:()=>qt,AbstractManhattan:()=>Nn,CIE94GraphicArts:()=>Xe,CIE94Textiles:()=>Ye,CIEDE2000:()=>sn,CMetric:()=>yn,Euclidean:()=>wn,EuclideanBT709:()=>Tn,EuclideanBT709NoAlpha:()=>xn,Manhattan:()=>zn,ManhattanBT709:()=>Kn,ManhattanNommyde:()=>Yn,PNGQuant:()=>Rn});var Jt=class{constructor(){_e(this,"_maxDistance"),_e(this,"_whitePoint"),this._setDefaults(),this.setWhitePoint(255,255,255,255)}setWhitePoint(Qt,On,Un,Zn){this._whitePoint={r:Qt>0?255/Qt:0,g:On>0?255/On:0,b:Un>0?255/Un:0,a:Zn>0?255/Zn:0},this._maxDistance=this.calculateRaw(Qt,On,Un,Zn,0,0,0,0)}calculateNormalized(Qt,On){return this.calculateRaw(Qt.r,Qt.g,Qt.b,Qt.a,On.r,On.g,On.b,On.a)/this._maxDistance}},hn=class extends Jt{calculateRaw(Qt,On,Un,Zn,or,mr,cr,Er){const pr=Kt(Dt(Qt*this._whitePoint.r),Dt(On*this._whitePoint.g),Dt(Un*this._whitePoint.b)),Ar=Kt(Dt(or*this._whitePoint.r),Dt(mr*this._whitePoint.g),Dt(cr*this._whitePoint.b)),vr=pr.L-Ar.L,Cr=pr.a-Ar.a,$r=pr.b-Ar.b,Jr=Math.sqrt(pr.a*pr.a+pr.b*pr.b),Zr=Jr-Math.sqrt(Ar.a*Ar.a+Ar.b*Ar.b);let jr=Cr*Cr+$r*$r-Zr*Zr;jr=jr<0?0:Math.sqrt(jr);const Ur=(Er-Zn)*this._whitePoint.a*this._kA;return Math.sqrt((vr/this._Kl)**2+(Zr/(1+this._K1*Jr))**2+(jr/(1+this._K2*Jr))**2+Ur**2)}},Ye=class extends hn{_setDefaults(){this._Kl=2,this._K1=.048,this._K2=.014,this._kA=12.5/255}},Xe=class extends hn{_setDefaults(){this._Kl=1,this._K1=.045,this._K2=.015,this._kA=25/255}},Pt=class extends Jt{_setDefaults(){}static _calculatehp(Qt,On){const Un=Math.atan2(Qt,On);return Un>=0?Un:Un+Pt._deg360InRad}static _calculateRT(Qt,On){const Un=On**7,Zn=2*Math.sqrt(Un/(Un+Pt._pow25to7)),or=Pt._deg30InRad*Math.exp(-(((Qt-Pt._deg275InRad)/Pt._deg25InRad)**2));return-Math.sin(2*or)*Zn}static _calculateT(Qt){return 1-.17*Math.cos(Qt-Pt._deg30InRad)+.24*Math.cos(2*Qt)+.32*Math.cos(3*Qt+Pt._deg6InRad)-.2*Math.cos(4*Qt-Pt._deg63InRad)}static _calculate_ahp(Qt,On,Un,Zn){const or=Un+Zn;return Qt===0?or:On<=Pt._deg180InRad?or/2:or>8)+4*vr*vr+((767-pr)*Cr*Cr>>8),Jr=(Er-Zn)*this._whitePoint.a;return Math.sqrt($r+Jr*Jr)}_setDefaults(){}},qt=class extends Jt{calculateRaw(Qt,On,Un,Zn,or,mr,cr,Er){const pr=or-Qt,Ar=mr-On,vr=cr-Un,Cr=Er-Zn;return Math.sqrt(this._kR*pr*pr+this._kG*Ar*Ar+this._kB*vr*vr+this._kA*Cr*Cr)}},wn=class extends qt{_setDefaults(){this._kR=1,this._kG=1,this._kB=1,this._kA=1}},Tn=class extends qt{_setDefaults(){this._kR=.2126,this._kG=.7152,this._kB=.0722,this._kA=1}},xn=class extends qt{_setDefaults(){this._kR=.2126,this._kG=.7152,this._kB=.0722,this._kA=0}},Nn=class extends Jt{calculateRaw(Qt,On,Un,Zn,or,mr,cr,Er){let pr=or-Qt,Ar=mr-On,vr=cr-Un,Cr=Er-Zn;return pr<0&&(pr=0-pr),Ar<0&&(Ar=0-Ar),vr<0&&(vr=0-vr),Cr<0&&(Cr=0-Cr),this._kR*pr+this._kG*Ar+this._kB*vr+this._kA*Cr}},zn=class extends Nn{_setDefaults(){this._kR=1,this._kG=1,this._kB=1,this._kA=1}},Yn=class extends Nn{_setDefaults(){this._kR=.4984,this._kG=.8625,this._kB=.2979,this._kA=1}},Kn=class extends Nn{_setDefaults(){this._kR=.2126,this._kG=.7152,this._kB=.0722,this._kA=1}},Rn=class extends Jt{calculateRaw(Qt,On,Un,Zn,or,mr,cr,Er){const pr=(Er-Zn)*this._whitePoint.a;return this._colordifferenceCh(Qt*this._whitePoint.r,or*this._whitePoint.r,pr)+this._colordifferenceCh(On*this._whitePoint.g,mr*this._whitePoint.g,pr)+this._colordifferenceCh(Un*this._whitePoint.b,cr*this._whitePoint.b,pr)}_colordifferenceCh(Qt,On,Un){const Zn=Qt-On,or=Zn+Un;return Zn*Zn+or*or}_setDefaults(){}},Mn={};ve(Mn,{AbstractPaletteQuantizer:()=>Xn,ColorHistogram:()=>Sr,NeuQuant:()=>Pn,NeuQuantFloat:()=>_r,RGBQuant:()=>nr,WuColorCube:()=>ei,WuQuant:()=>hi});var Xn=class{quantizeSync(){for(const Qt of this.quantize())if(Qt.palette)return Qt.palette;throw new Error("unreachable")}},Jn=class{constructor(){_e(this,"r"),_e(this,"g"),_e(this,"b"),_e(this,"a"),_e(this,"uint32"),_e(this,"rgba"),this.uint32=-1>>>0,this.r=this.g=this.b=this.a=0,this.rgba=new Array(4),this.rgba[0]=0,this.rgba[1]=0,this.rgba[2]=0,this.rgba[3]=0}static createByQuadruplet(Qt){const On=new Jn;return On.r=0|Qt[0],On.g=0|Qt[1],On.b=0|Qt[2],On.a=0|Qt[3],On._loadUINT32(),On._loadQuadruplet(),On}static createByRGBA(Qt,On,Un,Zn){const or=new Jn;return or.r=0|Qt,or.g=0|On,or.b=0|Un,or.a=0|Zn,or._loadUINT32(),or._loadQuadruplet(),or}static createByUint32(Qt){const On=new Jn;return On.uint32=Qt>>>0,On._loadRGBA(),On._loadQuadruplet(),On}from(Qt){this.r=Qt.r,this.g=Qt.g,this.b=Qt.b,this.a=Qt.a,this.uint32=Qt.uint32,this.rgba[0]=Qt.r,this.rgba[1]=Qt.g,this.rgba[2]=Qt.b,this.rgba[3]=Qt.a}getLuminosity(Qt){let On=this.r,Un=this.g,Zn=this.b;return Qt&&(On=Math.min(255,255-this.a+this.a*On/255),Un=Math.min(255,255-this.a+this.a*Un/255),Zn=Math.min(255,255-this.a+this.a*Zn/255)),.2126*On+.7152*Un+.0722*Zn}_loadUINT32(){this.uint32=(this.a<<24|this.b<<16|this.g<<8|this.r)>>>0}_loadRGBA(){this.r=255&this.uint32,this.g=this.uint32>>>8&255,this.b=this.uint32>>>16&255,this.a=this.uint32>>>24&255}_loadQuadruplet(){this.rgba[0]=this.r,this.rgba[1]=this.g,this.rgba[2]=this.b,this.rgba[3]=this.a}},pn=class{constructor(){_e(this,"_pointArray"),_e(this,"_width"),_e(this,"_height"),this._width=0,this._height=0,this._pointArray=[]}getWidth(){return this._width}getHeight(){return this._height}setWidth(Qt){this._width=Qt}setHeight(Qt){this._height=Qt}getPointArray(){return this._pointArray}clone(){const Qt=new pn;Qt._width=this._width,Qt._height=this._height;for(let On=0,Un=this._pointArray.length;On=or&&Qt=0;On--)if(Qt.uint32===this._pointArray[On].uint32)return!0;return!1}getNearestColor(Qt,On){return this._pointArray[0|this._getNearestIndex(Qt,On)]}getPointContainer(){return this._pointContainer}_nearestPointFromCache(Qt){return typeof this._i32idx[Qt]=="number"?this._i32idx[Qt]:-1}_getNearestIndex(Qt,On){let Un=this._nearestPointFromCache(""+On.uint32);if(Un>=0)return Un;let Zn=Number.MAX_VALUE;Un=0;for(let or=0,mr=this._pointArray.length;or{const Un=Ut(Qt.r,Qt.g,Qt.b),Zn=Ut(On.r,On.g,On.b),or=Qt.r===Qt.g&&Qt.g===Qt.b?0:1+tn(Un.h,10),mr=(On.r===On.g&&On.g===On.b?0:1+tn(Zn.h,10))-or;if(mr)return-mr;const cr=Qt.getLuminosity(!0),Er=On.getLuminosity(!0);if(Er-cr!=0)return Er-cr;const pr=(100*Zn.s|0)-(100*Un.s|0);return pr?-pr:0})}},bn={};ve(bn,{HueStatistics:()=>jn,Palette:()=>Gt,Point:()=>Jn,PointContainer:()=>pn,ProgressTracker:()=>dn,arithmetic:()=>Ue});var kn=class{constructor(){_e(this,"num",0),_e(this,"cols",[])}},jn=class{constructor(Qt,On){_e(this,"_numGroups"),_e(this,"_minCols"),_e(this,"_stats"),_e(this,"_groupsFull"),this._numGroups=Qt,this._minCols=On,this._stats=[];for(let Un=0;Un<=Qt;Un++)this._stats[Un]=new kn;this._groupsFull=0}check(Qt){this._groupsFull===this._numGroups+1&&(this.check=()=>{});const On=255&Qt,Un=Qt>>>8&255,Zn=Qt>>>16&255,or=On===Un&&Un===Zn?0:1+tn(Ut(On,Un,Zn).h,this._numGroups),mr=this._stats[or],cr=this._minCols;mr.num++,mr.num>cr||(mr.num===cr&&this._groupsFull++,mr.num<=cr&&this._stats[or].cols.push(Qt))}injectIntoDictionary(Qt){for(let On=0;On<=this._numGroups;On++)this._stats[On].num<=this._minCols&&this._stats[On].cols.forEach(Un=>{Qt[Un]?Qt[Un]++:Qt[Un]=1})}injectIntoArray(Qt){for(let On=0;On<=this._numGroups;On++)this._stats[On].num<=this._minCols&&this._stats[On].cols.forEach(Un=>{Qt.indexOf(Un)===-1&&Qt.push(Un)})}},Wn=class{constructor(Qt,On){_e(this,"progress"),_e(this,"_step"),_e(this,"_range"),_e(this,"_last"),_e(this,"_progressRange"),this._range=Qt,this._progressRange=On,this._step=Math.max(1,this._range/(Wn.steps+1)|0),this._last=-this._step,this.progress=0}shouldNotify(Qt){return Qt-this._last>=this._step&&(this._last=Qt,this.progress=Math.min(this._progressRange*this._last/this._range,this._progressRange),!0)}},dn=Wn;_e(dn,"steps",100);var Bn=class{constructor(Qt){_e(this,"r"),_e(this,"g"),_e(this,"b"),_e(this,"a"),this.r=this.g=this.b=this.a=Qt}toPoint(){return Jn.createByRGBA(this.r>>3,this.g>>3,this.b>>3,this.a>>3)}subtract(Qt,On,Un,Zn){this.r-=0|Qt,this.g-=0|On,this.b-=0|Un,this.a-=0|Zn}},mn=class extends Xn{constructor(Qt,On=256){super(),_e(this,"_pointArray"),_e(this,"_networkSize"),_e(this,"_network"),_e(this,"_sampleFactor"),_e(this,"_radPower"),_e(this,"_freq"),_e(this,"_bias"),_e(this,"_distance"),this._distance=Qt,this._pointArray=[],this._sampleFactor=1,this._networkSize=On,this._distance.setWhitePoint(2040,2040,2040,2040)}sample(Qt){this._pointArray=this._pointArray.concat(Qt.getPointArray())}*quantize(){this._init(),yield*this._learn(),yield{palette:this._buildPalette(),progress:100}}_init(){this._freq=[],this._bias=[],this._radPower=[],this._network=[];for(let Qt=0;Qt>3)*mn._radiusBias,pr=Er>>mn._radiusBiasShift;pr<=1&&(pr=0);for(let vr=0;vr>>0;or=On=On&&(Cr-=On),vr++,mr===0&&(mr=1),vr%mr==0){cr-=cr/Un|0,Er-=Er/mn._radiusDecrease|0,pr=Er>>mn._radiusBiasShift,pr<=1&&(pr=0);for(let Pi=0;Pi>>0}}}_buildPalette(){const Qt=new Gt;return this._network.forEach(On=>{Qt.add(On.toPoint())}),Qt.sort(),Qt}_alterNeighbour(Qt,On,Un,Zn,or,mr){let cr=On-Qt;cr<-1&&(cr=-1);let Er=On+Qt;Er>this._networkSize&&(Er=this._networkSize);let pr=On+1,Ar=On-1,vr=1;for(;prcr;){const Cr=this._radPower[vr++]/mn._alphaRadBias;if(prcr){const $r=this._network[Ar--];$r.subtract(Cr*($r.r-or),Cr*($r.g-Zn),Cr*($r.b-Un),Cr*($r.a-mr))}}}_alterSingle(Qt,On,Un,Zn,or,mr){Qt/=mn._initAlpha;const cr=this._network[On];cr.subtract(Qt*(cr.r-or),Qt*(cr.g-Zn),Qt*(cr.b-Un),Qt*(cr.a-mr))}_contest(Qt,On,Un,Zn){let or=2147483647,mr=or,cr=-1,Er=cr;for(let pr=0;pr>mn._initialBiasShift-3);Cr>mn._betaShift;this._freq[pr]-=$r,this._bias[pr]+=$r<>mn._betaShift),_e(Pn,"_betaGamma",mn._initialBias<>3,this.g>>3,this.b>>3,this.a>>3)}subtract(Qt,On,Un,Zn){this.r-=Qt,this.g-=On,this.b-=Un,this.a-=Zn}},er=class extends Xn{constructor(Qt,On=256){super(),_e(this,"_pointArray"),_e(this,"_networkSize"),_e(this,"_network"),_e(this,"_sampleFactor"),_e(this,"_radPower"),_e(this,"_freq"),_e(this,"_bias"),_e(this,"_distance"),this._distance=Qt,this._pointArray=[],this._sampleFactor=1,this._networkSize=On,this._distance.setWhitePoint(2040,2040,2040,2040)}sample(Qt){this._pointArray=this._pointArray.concat(Qt.getPointArray())}*quantize(){this._init(),yield*this._learn(),yield{palette:this._buildPalette(),progress:100}}_init(){this._freq=[],this._bias=[],this._radPower=[],this._network=[];for(let Qt=0;Qt>3)*er._radiusBias,pr=Er>>er._radiusBiasShift;pr<=1&&(pr=0);for(let vr=0;vr=On&&(Cr-=On),vr++,mr===0&&(mr=1),vr%mr==0){cr-=cr/Un,Er-=Er/er._radiusDecrease,pr=Er>>er._radiusBiasShift,pr<=1&&(pr=0);for(let Pi=0;Pi{Qt.add(On.toPoint())}),Qt.sort(),Qt}_alterNeighbour(Qt,On,Un,Zn,or,mr){let cr=On-Qt;cr<-1&&(cr=-1);let Er=On+Qt;Er>this._networkSize&&(Er=this._networkSize);let pr=On+1,Ar=On-1,vr=1;for(;prcr;){const Cr=this._radPower[vr++]/er._alphaRadBias;if(prcr){const $r=this._network[Ar--];$r.subtract(Cr*($r.r-or),Cr*($r.g-Zn),Cr*($r.b-Un),Cr*($r.a-mr))}}}_alterSingle(Qt,On,Un,Zn,or,mr){Qt/=er._initAlpha;const cr=this._network[On];cr.subtract(Qt*(cr.r-or),Qt*(cr.g-Zn),Qt*(cr.b-Un),Qt*(cr.a-mr))}_contest(Qt,On,Un,Zn){let or=2147483647,mr=or,cr=-1,Er=cr;for(let pr=0;pr>er._initialBiasShift-3);Cr>er._betaShift;this._freq[pr]-=$r,this._bias[pr]+=$r<>er._betaShift),_e(_r,"_betaGamma",er._initialBias<this._histogram[Zn]-this._histogram[Un]);if(Qt.length===0)return[];let On;switch(this._method){case 1:const Un=Math.min(Qt.length,this._initColors),Zn=Qt[Un-1],or=this._histogram[Zn];On=Qt.slice(0,Un);let mr=Un;const cr=Qt.length;for(;mr+Un)}_colorStats1D(Qt){const On=this._histogram,Un=Qt.getPointArray(),Zn=Un.length;for(let or=0;or{let vr=Math.round(Ar.w*Ar.h/cr)*dr._boxPixels;vr<2&&(vr=2);const Cr={};this._iterateBox(Ar,On,$r=>{const Jr=Zn[$r].uint32;this._hueStats.check(Jr),Jr in pr?pr[Jr]++:Jr in Cr?++Cr[Jr]>=vr&&(pr[Jr]=Cr[Jr]):Cr[Jr]=1})}),this._hueStats.injectIntoDictionary(pr)}_iterateBox(Qt,On,Un){const Zn=Qt,or=Zn.y*On+Zn.x,mr=(Zn.y+Zn.h-1)*On+(Zn.x+Zn.w-1),cr=On-Zn.w+1;let Er=0,pr=or;do Un.call(this,pr),pr+=++Er%Zn.w==0?cr:1;while(pr<=mr)}_makeBoxes(Qt,On,Un,Zn){const or=Qt%Un,mr=On%Zn,cr=Qt-or,Er=On-mr,pr=[];for(let Ar=0;Arthis._colors;){mr.length=0;for(let vr=0;vr3*this._colors?this._initialDistance:this._distanceIncrement}if(cr$r.distance-Cr.distance);let vr=0;for(;cr=0;vr--)Zn[vr]===0&&(vr!==Ar-1&&(Un[vr]=Un[Ar-1]),--Ar);Un.length=Ar,On.sort(),yield{palette:On,progress:100}}};function kr(Qt){const On=[];for(let Un=0;Un0){const Un=this._sums[On],Zn=this._reds[On]/Un,or=this._greens[On]/Un,mr=this._blues[On]/Un,cr=this._alphas[On]/Un,Er=Jn.createByRGBA(0|Zn,0|or,0|mr,0|cr);Qt.add(Er)}Qt.sort(),yield{palette:Qt,progress:100}}*_preparePalette(){yield*this._calculateMoments();let Qt=0;const On=kr(this._colors);for(let cr=1;cr1?this._calculateVariance(this._cubes[Qt]):0,On[cr]=this._cubes[cr].volume>1?this._calculateVariance(this._cubes[cr]):0):(On[Qt]=0,cr--),Qt=0;let Er=On[0];for(let pr=1;pr<=cr;++pr)On[pr]>Er&&(Er=On[pr],Qt=pr);if(Er<=0){this._colors=cr+1;break}}const Un=[],Zn=[],or=[],mr=[];for(let cr=0;cr0?(Un[cr]=Pr._volume(this._cubes[cr],this._momentsRed)/Er|0,Zn[cr]=Pr._volume(this._cubes[cr],this._momentsGreen)/Er|0,or[cr]=Pr._volume(this._cubes[cr],this._momentsBlue)/Er|0,mr[cr]=Pr._volume(this._cubes[cr],this._momentsAlpha)/Er|0):(Un[cr]=0,Zn[cr]=0,or[cr]=0,mr[cr]=0)}this._reds=kr(this._colors+1),this._greens=kr(this._colors+1),this._blues=kr(this._colors+1),this._alphas=kr(this._colors+1),this._sums=kr(this._colors+1);for(let cr=0,Er=this._pixels.length;cr>On),Zn=1+(Qt.g>>On),or=1+(Qt.b>>On),mr=1+(Qt.a>>On);this._weights[mr][Un][Zn][or]++,this._momentsRed[mr][Un][Zn][or]+=Qt.r,this._momentsGreen[mr][Un][Zn][or]+=Qt.g,this._momentsBlue[mr][Un][Zn][or]+=Qt.b,this._momentsAlpha[mr][Un][Zn][or]+=Qt.a,this._moments[mr][Un][Zn][or]+=this._table[Qt.r]+this._table[Qt.g]+this._table[Qt.b]+this._table[Qt.a]}*_calculateMoments(){const Qt=[],On=[],Un=[],Zn=[],or=[],mr=[],cr=Rr(this._sideSize,this._sideSize,this._sideSize),Er=Rr(this._sideSize,this._sideSize,this._sideSize),pr=Rr(this._sideSize,this._sideSize,this._sideSize),Ar=Rr(this._sideSize,this._sideSize,this._sideSize),vr=Rr(this._sideSize,this._sideSize,this._sideSize),Cr=Rr(this._sideSize,this._sideSize,this._sideSize);let $r=0;const Jr=new dn(this._alphaMaxSideIndex*this._maxSideIndex,99);for(let Zr=1;Zr<=this._alphaMaxSideIndex;++Zr){Yr(cr,this._sideSize,this._sideSize,this._sideSize,0),Yr(Er,this._sideSize,this._sideSize,this._sideSize,0),Yr(pr,this._sideSize,this._sideSize,this._sideSize,0),Yr(Ar,this._sideSize,this._sideSize,this._sideSize,0),Yr(vr,this._sideSize,this._sideSize,this._sideSize,0),Yr(Cr,this._sideSize,this._sideSize,this._sideSize,0);for(let jr=1;jr<=this._maxSideIndex;++jr,++$r){Jr.shouldNotify($r)&&(yield{progress:Jr.progress}),li(Qt,this._sideSize,0),li(On,this._sideSize,0),li(Un,this._sideSize,0),li(Zn,this._sideSize,0),li(or,this._sideSize,0),li(mr,this._sideSize,0);for(let Ur=1;Ur<=this._maxSideIndex;++Ur){let Ci=0,Pi=0,qi=0,Fi=0,so=0,Ui=0;for(let ti=1;ti<=this._maxSideIndex;++ti)Ci+=this._weights[Zr][jr][Ur][ti],Pi+=this._momentsRed[Zr][jr][Ur][ti],qi+=this._momentsGreen[Zr][jr][Ur][ti],Fi+=this._momentsBlue[Zr][jr][Ur][ti],so+=this._momentsAlpha[Zr][jr][Ur][ti],Ui+=this._moments[Zr][jr][Ur][ti],Qt[ti]+=Ci,On[ti]+=Pi,Un[ti]+=qi,Zn[ti]+=Fi,or[ti]+=so,mr[ti]+=Ui,cr[jr][Ur][ti]=cr[jr-1][Ur][ti]+Qt[ti],Er[jr][Ur][ti]=Er[jr-1][Ur][ti]+On[ti],pr[jr][Ur][ti]=pr[jr-1][Ur][ti]+Un[ti],Ar[jr][Ur][ti]=Ar[jr-1][Ur][ti]+Zn[ti],vr[jr][Ur][ti]=vr[jr-1][Ur][ti]+or[ti],Cr[jr][Ur][ti]=Cr[jr-1][Ur][ti]+mr[ti],this._weights[Zr][jr][Ur][ti]=this._weights[Zr-1][jr][Ur][ti]+cr[jr][Ur][ti],this._momentsRed[Zr][jr][Ur][ti]=this._momentsRed[Zr-1][jr][Ur][ti]+Er[jr][Ur][ti],this._momentsGreen[Zr][jr][Ur][ti]=this._momentsGreen[Zr-1][jr][Ur][ti]+pr[jr][Ur][ti],this._momentsBlue[Zr][jr][Ur][ti]=this._momentsBlue[Zr-1][jr][Ur][ti]+Ar[jr][Ur][ti],this._momentsAlpha[Zr][jr][Ur][ti]=this._momentsAlpha[Zr-1][jr][Ur][ti]+vr[jr][Ur][ti],this._moments[Zr][jr][Ur][ti]=this._moments[Zr-1][jr][Ur][ti]+Cr[jr][Ur][ti]}}}}static _volumeFloat(Qt,On){return On[Qt.alphaMaximum][Qt.redMaximum][Qt.greenMaximum][Qt.blueMaximum]-On[Qt.alphaMaximum][Qt.redMaximum][Qt.greenMinimum][Qt.blueMaximum]-On[Qt.alphaMaximum][Qt.redMinimum][Qt.greenMaximum][Qt.blueMaximum]+On[Qt.alphaMaximum][Qt.redMinimum][Qt.greenMinimum][Qt.blueMaximum]-On[Qt.alphaMinimum][Qt.redMaximum][Qt.greenMaximum][Qt.blueMaximum]+On[Qt.alphaMinimum][Qt.redMaximum][Qt.greenMinimum][Qt.blueMaximum]+On[Qt.alphaMinimum][Qt.redMinimum][Qt.greenMaximum][Qt.blueMaximum]-On[Qt.alphaMinimum][Qt.redMinimum][Qt.greenMinimum][Qt.blueMaximum]-(On[Qt.alphaMaximum][Qt.redMaximum][Qt.greenMaximum][Qt.blueMinimum]-On[Qt.alphaMinimum][Qt.redMaximum][Qt.greenMaximum][Qt.blueMinimum]-On[Qt.alphaMaximum][Qt.redMaximum][Qt.greenMinimum][Qt.blueMinimum]+On[Qt.alphaMinimum][Qt.redMaximum][Qt.greenMinimum][Qt.blueMinimum]-On[Qt.alphaMaximum][Qt.redMinimum][Qt.greenMaximum][Qt.blueMinimum]+On[Qt.alphaMinimum][Qt.redMinimum][Qt.greenMaximum][Qt.blueMinimum]+On[Qt.alphaMaximum][Qt.redMinimum][Qt.greenMinimum][Qt.blueMinimum]-On[Qt.alphaMinimum][Qt.redMinimum][Qt.greenMinimum][Qt.blueMinimum])}static _volume(Qt,On){return 0|Pr._volumeFloat(Qt,On)}static _top(Qt,On,Un,Zn){let or;switch(On){case Pr._alpha:or=Zn[Un][Qt.redMaximum][Qt.greenMaximum][Qt.blueMaximum]-Zn[Un][Qt.redMaximum][Qt.greenMinimum][Qt.blueMaximum]-Zn[Un][Qt.redMinimum][Qt.greenMaximum][Qt.blueMaximum]+Zn[Un][Qt.redMinimum][Qt.greenMinimum][Qt.blueMaximum]-(Zn[Un][Qt.redMaximum][Qt.greenMaximum][Qt.blueMinimum]-Zn[Un][Qt.redMaximum][Qt.greenMinimum][Qt.blueMinimum]-Zn[Un][Qt.redMinimum][Qt.greenMaximum][Qt.blueMinimum]+Zn[Un][Qt.redMinimum][Qt.greenMinimum][Qt.blueMinimum]);break;case Pr._red:or=Zn[Qt.alphaMaximum][Un][Qt.greenMaximum][Qt.blueMaximum]-Zn[Qt.alphaMaximum][Un][Qt.greenMinimum][Qt.blueMaximum]-Zn[Qt.alphaMinimum][Un][Qt.greenMaximum][Qt.blueMaximum]+Zn[Qt.alphaMinimum][Un][Qt.greenMinimum][Qt.blueMaximum]-(Zn[Qt.alphaMaximum][Un][Qt.greenMaximum][Qt.blueMinimum]-Zn[Qt.alphaMaximum][Un][Qt.greenMinimum][Qt.blueMinimum]-Zn[Qt.alphaMinimum][Un][Qt.greenMaximum][Qt.blueMinimum]+Zn[Qt.alphaMinimum][Un][Qt.greenMinimum][Qt.blueMinimum]);break;case Pr._green:or=Zn[Qt.alphaMaximum][Qt.redMaximum][Un][Qt.blueMaximum]-Zn[Qt.alphaMaximum][Qt.redMinimum][Un][Qt.blueMaximum]-Zn[Qt.alphaMinimum][Qt.redMaximum][Un][Qt.blueMaximum]+Zn[Qt.alphaMinimum][Qt.redMinimum][Un][Qt.blueMaximum]-(Zn[Qt.alphaMaximum][Qt.redMaximum][Un][Qt.blueMinimum]-Zn[Qt.alphaMaximum][Qt.redMinimum][Un][Qt.blueMinimum]-Zn[Qt.alphaMinimum][Qt.redMaximum][Un][Qt.blueMinimum]+Zn[Qt.alphaMinimum][Qt.redMinimum][Un][Qt.blueMinimum]);break;case Pr._blue:or=Zn[Qt.alphaMaximum][Qt.redMaximum][Qt.greenMaximum][Un]-Zn[Qt.alphaMaximum][Qt.redMaximum][Qt.greenMinimum][Un]-Zn[Qt.alphaMaximum][Qt.redMinimum][Qt.greenMaximum][Un]+Zn[Qt.alphaMaximum][Qt.redMinimum][Qt.greenMinimum][Un]-(Zn[Qt.alphaMinimum][Qt.redMaximum][Qt.greenMaximum][Un]-Zn[Qt.alphaMinimum][Qt.redMaximum][Qt.greenMinimum][Un]-Zn[Qt.alphaMinimum][Qt.redMinimum][Qt.greenMaximum][Un]+Zn[Qt.alphaMinimum][Qt.redMinimum][Qt.greenMinimum][Un]);break;default:throw new Error("impossible")}return 0|or}static _bottom(Qt,On,Un){switch(On){case Pr._alpha:return-Un[Qt.alphaMinimum][Qt.redMaximum][Qt.greenMaximum][Qt.blueMaximum]+Un[Qt.alphaMinimum][Qt.redMaximum][Qt.greenMinimum][Qt.blueMaximum]+Un[Qt.alphaMinimum][Qt.redMinimum][Qt.greenMaximum][Qt.blueMaximum]-Un[Qt.alphaMinimum][Qt.redMinimum][Qt.greenMinimum][Qt.blueMaximum]-(-Un[Qt.alphaMinimum][Qt.redMaximum][Qt.greenMaximum][Qt.blueMinimum]+Un[Qt.alphaMinimum][Qt.redMaximum][Qt.greenMinimum][Qt.blueMinimum]+Un[Qt.alphaMinimum][Qt.redMinimum][Qt.greenMaximum][Qt.blueMinimum]-Un[Qt.alphaMinimum][Qt.redMinimum][Qt.greenMinimum][Qt.blueMinimum]);case Pr._red:return-Un[Qt.alphaMaximum][Qt.redMinimum][Qt.greenMaximum][Qt.blueMaximum]+Un[Qt.alphaMaximum][Qt.redMinimum][Qt.greenMinimum][Qt.blueMaximum]+Un[Qt.alphaMinimum][Qt.redMinimum][Qt.greenMaximum][Qt.blueMaximum]-Un[Qt.alphaMinimum][Qt.redMinimum][Qt.greenMinimum][Qt.blueMaximum]-(-Un[Qt.alphaMaximum][Qt.redMinimum][Qt.greenMaximum][Qt.blueMinimum]+Un[Qt.alphaMaximum][Qt.redMinimum][Qt.greenMinimum][Qt.blueMinimum]+Un[Qt.alphaMinimum][Qt.redMinimum][Qt.greenMaximum][Qt.blueMinimum]-Un[Qt.alphaMinimum][Qt.redMinimum][Qt.greenMinimum][Qt.blueMinimum]);case Pr._green:return-Un[Qt.alphaMaximum][Qt.redMaximum][Qt.greenMinimum][Qt.blueMaximum]+Un[Qt.alphaMaximum][Qt.redMinimum][Qt.greenMinimum][Qt.blueMaximum]+Un[Qt.alphaMinimum][Qt.redMaximum][Qt.greenMinimum][Qt.blueMaximum]-Un[Qt.alphaMinimum][Qt.redMinimum][Qt.greenMinimum][Qt.blueMaximum]-(-Un[Qt.alphaMaximum][Qt.redMaximum][Qt.greenMinimum][Qt.blueMinimum]+Un[Qt.alphaMaximum][Qt.redMinimum][Qt.greenMinimum][Qt.blueMinimum]+Un[Qt.alphaMinimum][Qt.redMaximum][Qt.greenMinimum][Qt.blueMinimum]-Un[Qt.alphaMinimum][Qt.redMinimum][Qt.greenMinimum][Qt.blueMinimum]);case Pr._blue:return-Un[Qt.alphaMaximum][Qt.redMaximum][Qt.greenMaximum][Qt.blueMinimum]+Un[Qt.alphaMaximum][Qt.redMaximum][Qt.greenMinimum][Qt.blueMinimum]+Un[Qt.alphaMaximum][Qt.redMinimum][Qt.greenMaximum][Qt.blueMinimum]-Un[Qt.alphaMaximum][Qt.redMinimum][Qt.greenMinimum][Qt.blueMinimum]-(-Un[Qt.alphaMinimum][Qt.redMaximum][Qt.greenMaximum][Qt.blueMinimum]+Un[Qt.alphaMinimum][Qt.redMaximum][Qt.greenMinimum][Qt.blueMinimum]+Un[Qt.alphaMinimum][Qt.redMinimum][Qt.greenMaximum][Qt.blueMinimum]-Un[Qt.alphaMinimum][Qt.redMinimum][Qt.greenMinimum][Qt.blueMinimum]);default:return 0}}_calculateVariance(Qt){const On=Pr._volume(Qt,this._momentsRed),Un=Pr._volume(Qt,this._momentsGreen),Zn=Pr._volume(Qt,this._momentsBlue),or=Pr._volume(Qt,this._momentsAlpha);return Pr._volumeFloat(Qt,this._moments)-(On*On+Un*Un+Zn*Zn+or*or)/Pr._volume(Qt,this._weights)}_maximize(Qt,On,Un,Zn,or,mr,cr,Er,pr){const Ar=0|Pr._bottom(Qt,On,this._momentsRed),vr=0|Pr._bottom(Qt,On,this._momentsGreen),Cr=0|Pr._bottom(Qt,On,this._momentsBlue),$r=0|Pr._bottom(Qt,On,this._momentsAlpha),Jr=0|Pr._bottom(Qt,On,this._weights);let Zr=0,jr=-1;for(let Ur=Un;UrZr&&(Zr=ti,jr=Ur))}}return{max:Zr,position:jr}}_cut(Qt,On){let Un;const Zn=Pr._volume(Qt,this._momentsRed),or=Pr._volume(Qt,this._momentsGreen),mr=Pr._volume(Qt,this._momentsBlue),cr=Pr._volume(Qt,this._momentsAlpha),Er=Pr._volume(Qt,this._weights),pr=this._maximize(Qt,Pr._red,Qt.redMinimum+1,Qt.redMaximum,Zn,or,mr,cr,Er),Ar=this._maximize(Qt,Pr._green,Qt.greenMinimum+1,Qt.greenMaximum,Zn,or,mr,cr,Er),vr=this._maximize(Qt,Pr._blue,Qt.blueMinimum+1,Qt.blueMaximum,Zn,or,mr,cr,Er),Cr=this._maximize(Qt,Pr._alpha,Qt.alphaMinimum+1,Qt.alphaMaximum,Zn,or,mr,cr,Er);if(Cr.max>=pr.max&&Cr.max>=Ar.max&&Cr.max>=vr.max){if(Un=Pr._alpha,Cr.position<0)return!1}else Un=pr.max>=Cr.max&&pr.max>=Ar.max&&pr.max>=vr.max?Pr._red:Ar.max>=Cr.max&&Ar.max>=pr.max&&Ar.max>=vr.max?Pr._green:Pr._blue;switch(On.redMaximum=Qt.redMaximum,On.greenMaximum=Qt.greenMaximum,On.blueMaximum=Qt.blueMaximum,On.alphaMaximum=Qt.alphaMaximum,Un){case Pr._red:On.redMinimum=Qt.redMaximum=pr.position,On.greenMinimum=Qt.greenMinimum,On.blueMinimum=Qt.blueMinimum,On.alphaMinimum=Qt.alphaMinimum;break;case Pr._green:On.greenMinimum=Qt.greenMaximum=Ar.position,On.redMinimum=Qt.redMinimum,On.blueMinimum=Qt.blueMinimum,On.alphaMinimum=Qt.alphaMinimum;break;case Pr._blue:On.blueMinimum=Qt.blueMaximum=vr.position,On.redMinimum=Qt.redMinimum,On.greenMinimum=Qt.greenMinimum,On.alphaMinimum=Qt.alphaMinimum;break;case Pr._alpha:On.alphaMinimum=Qt.alphaMaximum=Cr.position,On.blueMinimum=Qt.blueMinimum,On.redMinimum=Qt.redMinimum,On.greenMinimum=Qt.greenMinimum}return Qt.volume=(Qt.redMaximum-Qt.redMinimum)*(Qt.greenMaximum-Qt.greenMinimum)*(Qt.blueMaximum-Qt.blueMinimum)*(Qt.alphaMaximum-Qt.alphaMinimum),On.volume=(On.redMaximum-On.redMinimum)*(On.greenMaximum-On.greenMinimum)*(On.blueMaximum-On.blueMinimum)*(On.alphaMaximum-On.alphaMinimum),!0}_initialize(Qt){this._colors=Qt,this._cubes=[];for(let On=0;Onyi,ErrorDiffusionArray:()=>xi,ErrorDiffusionArrayKernel:()=>gi,ErrorDiffusionRiemersma:()=>oi,NearestColor:()=>Gi});var yi=class{quantizeSync(Qt,On){for(const Un of this.quantize(Qt,On))if(Un.pointContainer)return Un.pointContainer;throw new Error("unreachable")}},Gi=class extends yi{constructor(Qt){super(),_e(this,"_distance"),this._distance=Qt}*quantize(Qt,On){const Un=Qt.getPointArray(),Zn=Qt.getWidth(),or=Qt.getHeight(),mr=new dn(or,99);for(let cr=0;cr(Qt[Qt.FloydSteinberg=0]="FloydSteinberg",Qt[Qt.FalseFloydSteinberg=1]="FalseFloydSteinberg",Qt[Qt.Stucki=2]="Stucki",Qt[Qt.Atkinson=3]="Atkinson",Qt[Qt.Jarvis=4]="Jarvis",Qt[Qt.Burkes=5]="Burkes",Qt[Qt.Sierra=6]="Sierra",Qt[Qt.TwoSierra=7]="TwoSierra",Qt[Qt.SierraLite=8]="SierraLite",Qt))(gi||{}),xi=class extends yi{constructor(Qt,On,Un=!0,Zn=0,or=!1){super(),_e(this,"_minColorDistance"),_e(this,"_serpentine"),_e(this,"_kernel"),_e(this,"_calculateErrorLikeGIMP"),_e(this,"_distance"),this._setKernel(On),this._distance=Qt,this._minColorDistance=Zn,this._serpentine=Un,this._calculateErrorLikeGIMP=or}*quantize(Qt,On){const Un=Qt.getPointArray(),Zn=new Jn,or=Qt.getWidth(),mr=Qt.getHeight(),cr=[];let Er=1,pr=1;for(const vr of this._kernel){const Cr=vr[2]+1;pr=0&&$a+jr=0&&mo+vrOn&&(Qt.length=On);const Un=Qt.length;for(let Zn=0;Zn=0&&Qt.x=0&&Qt.y{const Ar=Un[Er+pr*Zn];let{r:vr,g:Cr,b:$r,a:Jr}=Ar;for(let Ci=0;CiDi});var Co=.01,Wi=.03;function Di(Qt,On){if(Qt.getHeight()!==On.getHeight()||Qt.getWidth()!==On.getWidth())throw new Error("Images have different sizes!");const Un=(255*Co)**2,Zn=(255*Wi)**2;let or=0,mr=0;return function(cr,Er,pr){const Ar=cr.getWidth(),vr=cr.getHeight();for(let Cr=0;Cr{let vr=0,Cr=0,$r=0;for(let Zr=0;Zrue.nextTick(Qt):Qt=>setTimeout(Qt,0);function Ro(Qt,{colorDistanceFormula:On,paletteQuantization:Un,colors:Zn}={}){const or=ua(Ei(On),Un,Zn);return Qt.forEach(mr=>or.sample(mr)),or.quantizeSync()}async function la(Qt,{colorDistanceFormula:On,paletteQuantization:Un,colors:Zn,onProgress:or}={}){return new Promise((mr,cr)=>{const Er=ua(Ei(On),Un,Zn);let pr;Qt.forEach(Cr=>Er.sample(Cr));const Ar=Er.quantize(),vr=()=>{try{const Cr=Ar.next();Cr.done?mr(pr):(Cr.value.palette&&(pr=Cr.value.palette),or&&or(Cr.value.progress),bo(vr))}catch(Cr){cr(Cr)}};bo(vr)})}function Ao(Qt,On,{colorDistanceFormula:Un,imageQuantization:Zn}={}){return aa(Ei(Un),Zn).quantizeSync(Qt,On)}async function ca(Qt,On,{colorDistanceFormula:Un,imageQuantization:Zn,onProgress:or}={}){return new Promise((mr,cr)=>{let Er;const pr=aa(Ei(Un),Zn).quantize(Qt,On),Ar=()=>{try{const vr=pr.next();vr.done?mr(Er):(vr.value.pointContainer&&(Er=vr.value.pointContainer),or&&or(vr.value.progress),bo(Ar))}catch(vr){cr(vr)}};bo(Ar)})}function Ei(Qt="euclidean-bt709"){switch(Qt){case"cie94-graphic-arts":return new Xe;case"cie94-textiles":return new Ye;case"ciede2000":return new sn;case"color-metric":return new yn;case"euclidean":return new wn;case"euclidean-bt709":return new Tn;case"euclidean-bt709-noalpha":return new xn;case"manhattan":return new zn;case"manhattan-bt709":return new Kn;case"manhattan-nommyde":return new Yn;case"pngquant":return new Rn;default:throw new Error(`Unknown colorDistanceFormula ${Qt}`)}}function aa(Qt,On="floyd-steinberg"){switch(On){case"nearest":return new Gi(Qt);case"riemersma":return new oi(Qt);case"floyd-steinberg":return new xi(Qt,0);case"false-floyd-steinberg":return new xi(Qt,1);case"stucki":return new xi(Qt,2);case"atkinson":return new xi(Qt,3);case"jarvis":return new xi(Qt,4);case"burkes":return new xi(Qt,5);case"sierra":return new xi(Qt,6);case"two-sierra":return new xi(Qt,7);case"sierra-lite":return new xi(Qt,8);default:throw new Error(`Unknown imageQuantization ${On}`)}}function ua(Qt,On="wuquant",Un=256){switch(On){case"neuquant":return new Pn(Qt,Un);case"rgbquant":return new nr(Qt,Un);case"wuquant":return new hi(Qt,Un);case"neuquant-float":return new _r(Qt,Un);default:throw new Error(`Unknown paletteQuantization ${On}`)}}ne.exports=xe(Se)}},__webpack_module_cache__={};function __webpack_require__(ne){var oe=__webpack_module_cache__[ne];if(oe!==void 0)return oe.exports;var ce=__webpack_module_cache__[ne]={exports:{}};return __webpack_modules__[ne](ce,ce.exports,__webpack_require__),ce.exports}__webpack_require__.n=ne=>{var oe=ne&&ne.__esModule?()=>ne.default:()=>ne;return __webpack_require__.d(oe,{a:oe}),oe},__webpack_require__.d=(ne,oe)=>{for(var ce in oe)__webpack_require__.o(oe,ce)&&!__webpack_require__.o(ne,ce)&&Object.defineProperty(ne,ce,{enumerable:!0,get:oe[ce]})},__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=(ne,oe)=>Object.prototype.hasOwnProperty.call(ne,oe),__webpack_require__.r=ne=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(ne,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(ne,"__esModule",{value:!0})},(()=>{var ne={};__webpack_require__.r(ne),__webpack_require__.d(ne,{AUTO:()=>Nn,BLEND_ADD:()=>Gt,BLEND_DARKEN:()=>jn,BLEND_DESTINATION_OVER:()=>pn,BLEND_DIFFERENCE:()=>Bn,BLEND_EXCLUSION:()=>mn,BLEND_HARDLIGHT:()=>dn,BLEND_LIGHTEN:()=>Wn,BLEND_MULTIPLY:()=>tn,BLEND_OVERLAY:()=>kn,BLEND_SCREEN:()=>bn,BLEND_SOURCE_OVER:()=>Jn,EDGE_CROP:()=>er,EDGE_EXTEND:()=>Pn,EDGE_WRAP:()=>ur,HORIZONTAL_ALIGN_CENTER:()=>Yn,HORIZONTAL_ALIGN_LEFT:()=>zn,HORIZONTAL_ALIGN_RIGHT:()=>Kn,VERTICAL_ALIGN_BOTTOM:()=>Xn,VERTICAL_ALIGN_MIDDLE:()=>Mn,VERTICAL_ALIGN_TOP:()=>Rn});var oe={};__webpack_require__.r(oe),__webpack_require__.d(oe,{add:()=>sr,darken:()=>Mr,difference:()=>li,dstOver:()=>dr,exclusion:()=>ei,hardLight:()=>Yr,lighten:()=>Rr,multiply:()=>Sr,overlay:()=>kr,screen:()=>nr,srcOver:()=>_r});var ce=__webpack_require__(5546),ue=__webpack_require__.n(ce),pe=__webpack_require__(1023),me=__webpack_require__.n(pe),ge=__webpack_require__(2699),ye=__webpack_require__.n(ge);function ve(rn){if(rn===void 0)return!1;if(typeof rn!="function")throw new TypeError("Callback must be a function");return!0}function xe(rn,ln){if(typeof rn=="string"&&(rn=new Error(rn)),typeof ln=="function")return ln.call(this,rn);throw rn}function _e(rn,ln,En,$n,An,Ln){ln=Math.round(ln),En=Math.round(En),$n=Math.round($n),An=Math.round(An);for(let qn=En;qn1&&($i-=1),$i<1/6?vi+6*(Ri-vi)*$i:$i<.5?Ri:$i<2/3?vi+(Ri-vi)*(2/3-$i)*6:vi}if(gr=nn(gr,360),yr=nn(yr,100),xr=nn(xr,100),yr===0)Lr=Hr=si=xr;else{var ni=xr<.5?xr*(1+yr):xr+yr-xr*yr,wi=2*xr-ni;Lr=_i(wi,ni,gr+1/3),Hr=_i(wi,ni,gr),si=_i(wi,ni,gr-1/3)}return{r:255*Lr,g:255*Hr,b:255*si}}($n.h,ar,fr),Or=!0,wr="hsl"),$n.hasOwnProperty("a")&&(Vn=$n.a)),Vn=Xt(Vn),{ok:Or,format:$n.format||wr,r:Math.min(255,Math.max(Gn.r,0)),g:Math.min(255,Math.max(Gn.g,0)),b:Math.min(255,Math.max(Gn.b,0)),a:Vn}}(rn);this._originalInput=rn,this._r=En.r,this._g=En.g,this._b=En.b,this._a=En.a,this._roundA=Math.round(100*this._a)/100,this._format=ln.format||En.format,this._gradientType=ln.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=En.ok}function Fe(rn,ln,En){rn=nn(rn,255),ln=nn(ln,255),En=nn(En,255);var $n,An,Ln=Math.max(rn,ln,En),qn=Math.min(rn,ln,En),Gn=(Ln+qn)/2;if(Ln==qn)$n=An=0;else{var Vn=Ln-qn;switch(An=Gn>.5?Vn/(2-Ln-qn):Vn/(Ln+qn),Ln){case rn:$n=(ln-En)/Vn+(ln>1)+720)%360;--ln;)$n.h=($n.h+An)%360,Ln.push(Ne($n));return Ln}function Kt(rn,ln){ln=ln||6;for(var En=Ne(rn).toHsv(),$n=En.h,An=En.s,Ln=En.v,qn=[],Gn=1/ln;ln--;)qn.push(Ne({h:$n,s:An,v:Ln})),Ln=(Ln+Gn)%1;return qn}Ne.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var rn=this.toRgb();return(299*rn.r+587*rn.g+114*rn.b)/1e3},getLuminance:function(){var rn,ln,En,$n=this.toRgb();return rn=$n.r/255,ln=$n.g/255,En=$n.b/255,.2126*(rn<=.03928?rn/12.92:Math.pow((rn+.055)/1.055,2.4))+.7152*(ln<=.03928?ln/12.92:Math.pow((ln+.055)/1.055,2.4))+.0722*(En<=.03928?En/12.92:Math.pow((En+.055)/1.055,2.4))},setAlpha:function(rn){return this._a=Xt(rn),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var rn=Ue(this._r,this._g,this._b);return{h:360*rn.h,s:rn.s,v:rn.v,a:this._a}},toHsvString:function(){var rn=Ue(this._r,this._g,this._b),ln=Math.round(360*rn.h),En=Math.round(100*rn.s),$n=Math.round(100*rn.v);return this._a==1?"hsv("+ln+", "+En+"%, "+$n+"%)":"hsva("+ln+", "+En+"%, "+$n+"%, "+this._roundA+")"},toHsl:function(){var rn=Fe(this._r,this._g,this._b);return{h:360*rn.h,s:rn.s,l:rn.l,a:this._a}},toHslString:function(){var rn=Fe(this._r,this._g,this._b),ln=Math.round(360*rn.h),En=Math.round(100*rn.s),$n=Math.round(100*rn.l);return this._a==1?"hsl("+ln+", "+En+"%, "+$n+"%)":"hsla("+ln+", "+En+"%, "+$n+"%, "+this._roundA+")"},toHex:function(rn){return We(this._r,this._g,this._b,rn)},toHexString:function(rn){return"#"+this.toHex(rn)},toHex8:function(rn){return function(ln,En,$n,An,Ln){var qn=[Cn(Math.round(ln).toString(16)),Cn(Math.round(En).toString(16)),Cn(Math.round($n).toString(16)),Cn(Yt(An))];return Ln&&qn[0].charAt(0)==qn[0].charAt(1)&&qn[1].charAt(0)==qn[1].charAt(1)&&qn[2].charAt(0)==qn[2].charAt(1)&&qn[3].charAt(0)==qn[3].charAt(1)?qn[0].charAt(0)+qn[1].charAt(0)+qn[2].charAt(0)+qn[3].charAt(0):qn.join("")}(this._r,this._g,this._b,this._a,rn)},toHex8String:function(rn){return"#"+this.toHex8(rn)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*nn(this._r,255))+"%",g:Math.round(100*nn(this._g,255))+"%",b:Math.round(100*nn(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(100*nn(this._r,255))+"%, "+Math.round(100*nn(this._g,255))+"%, "+Math.round(100*nn(this._b,255))+"%)":"rgba("+Math.round(100*nn(this._r,255))+"%, "+Math.round(100*nn(this._g,255))+"%, "+Math.round(100*nn(this._b,255))+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":!(this._a<1)&&(un[We(this._r,this._g,this._b,!0)]||!1)},toFilter:function(rn){var ln="#"+qe(this._r,this._g,this._b,this._a),En=ln,$n=this._gradientType?"GradientType = 1, ":"";if(rn){var An=Ne(rn);En="#"+qe(An._r,An._g,An._b,An._a)}return"progid:DXImageTransform.Microsoft.gradient("+$n+"startColorstr="+ln+",endColorstr="+En+")"},toString:function(rn){var ln=!!rn;rn=rn||this._format;var En=!1,$n=this._a<1&&this._a>=0;return ln||!$n||rn!=="hex"&&rn!=="hex6"&&rn!=="hex3"&&rn!=="hex4"&&rn!=="hex8"&&rn!=="name"?(rn==="rgb"&&(En=this.toRgbString()),rn==="prgb"&&(En=this.toPercentageRgbString()),rn!=="hex"&&rn!=="hex6"||(En=this.toHexString()),rn==="hex3"&&(En=this.toHexString(!0)),rn==="hex4"&&(En=this.toHex8String(!0)),rn==="hex8"&&(En=this.toHex8String()),rn==="name"&&(En=this.toName()),rn==="hsl"&&(En=this.toHslString()),rn==="hsv"&&(En=this.toHsvString()),En||this.toHexString()):rn==="name"&&this._a===0?this.toName():this.toRgbString()},clone:function(){return Ne(this.toString())},_applyModification:function(rn,ln){var En=rn.apply(null,[this].concat([].slice.call(ln)));return this._r=En._r,this._g=En._g,this._b=En._b,this.setAlpha(En._a),this},lighten:function(){return this._applyModification(Dt,arguments)},brighten:function(){return this._applyModification(Je,arguments)},darken:function(){return this._applyModification(Ut,arguments)},desaturate:function(){return this._applyModification(ze,arguments)},saturate:function(){return this._applyModification(Ge,arguments)},greyscale:function(){return this._applyModification(Ze,arguments)},spin:function(){return this._applyModification(jt,arguments)},_applyCombination:function(rn,ln){return rn.apply(null,[this].concat([].slice.call(ln)))},analogous:function(){return this._applyCombination(en,arguments)},complement:function(){return this._applyCombination(Ke,arguments)},monochromatic:function(){return this._applyCombination(Kt,arguments)},splitcomplement:function(){return this._applyCombination(Zt,arguments)},triad:function(){return this._applyCombination(an,[3])},tetrad:function(){return this._applyCombination(an,[4])}},Ne.fromRatio=function(rn,ln){if(Ie(rn)=="object"){var En={};for(var $n in rn)rn.hasOwnProperty($n)&&(En[$n]=$n==="a"?rn[$n]:Nt(rn[$n]));rn=En}return Ne(rn,ln)},Ne.equals=function(rn,ln){return!(!rn||!ln)&&Ne(rn).toRgbString()==Ne(ln).toRgbString()},Ne.random=function(){return Ne.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},Ne.mix=function(rn,ln,En){En=En===0?0:En||50;var $n=Ne(rn).toRgb(),An=Ne(ln).toRgb(),Ln=En/100;return Ne({r:(An.r-$n.r)*Ln+$n.r,g:(An.g-$n.g)*Ln+$n.g,b:(An.b-$n.b)*Ln+$n.b,a:(An.a-$n.a)*Ln+$n.a})},Ne.readability=function(rn,ln){var En=Ne(rn),$n=Ne(ln);return(Math.max(En.getLuminance(),$n.getLuminance())+.05)/(Math.min(En.getLuminance(),$n.getLuminance())+.05)},Ne.isReadable=function(rn,ln,En){var $n,An,Ln,qn,Gn,Vn=Ne.readability(rn,ln);switch(An=!1,(Ln=En,(qn=((Ln=Ln||{level:"AA",size:"small"}).level||"AA").toUpperCase())!=="AA"&&qn!=="AAA"&&(qn="AA"),(Gn=(Ln.size||"small").toLowerCase())!=="small"&&Gn!=="large"&&(Gn="small"),$n={level:qn,size:Gn}).level+$n.size){case"AAsmall":case"AAAlarge":An=Vn>=4.5;break;case"AAlarge":An=Vn>=3;break;case"AAAsmall":An=Vn>=7}return An},Ne.mostReadable=function(rn,ln,En){var $n,An,Ln,qn,Gn=null,Vn=0;An=(En=En||{}).includeFallbackColors,Ln=En.level,qn=En.size;for(var ar=0;arVn&&(Vn=$n,Gn=Ne(ln[ar]));return Ne.isReadable(rn,Gn,{level:Ln,size:qn})||!An?Gn:(En.includeFallbackColors=!1,Ne.mostReadable(rn,["#fff","#000"],En))};var Wt=Ne.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},un=Ne.hexNames=function(rn){var ln={};for(var En in rn)rn.hasOwnProperty(En)&&(ln[rn[En]]=En);return ln}(Wt);function Xt(rn){return rn=parseFloat(rn),(isNaN(rn)||rn<0||rn>1)&&(rn=1),rn}function nn(rn,ln){(function($n){return typeof $n=="string"&&$n.indexOf(".")!=-1&&parseFloat($n)===1})(rn)&&(rn="100%");var En=function($n){return typeof $n=="string"&&$n.indexOf("%")!=-1}(rn);return rn=Math.min(ln,Math.max(0,parseFloat(rn))),En&&(rn=parseInt(rn*ln,10)/100),Math.abs(rn-ln)<1e-6?1:rn%ln/parseFloat(ln)}function vn(rn){return Math.min(1,Math.max(0,rn))}function Sn(rn){return parseInt(rn,16)}function Cn(rn){return rn.length==1?"0"+rn:""+rn}function Nt(rn){return rn<=1&&(rn=100*rn+"%"),rn}function Yt(rn){return Math.round(255*parseFloat(rn)).toString(16)}function Jt(rn){return Sn(rn)/255}var hn,Ye,Xe,Pt=(Ye="[\\s|\\(]+("+(hn="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+hn+")[,|\\s]+("+hn+")\\s*\\)?",Xe="[\\s|\\(]+("+hn+")[,|\\s]+("+hn+")[,|\\s]+("+hn+")[,|\\s]+("+hn+")\\s*\\)?",{CSS_UNIT:new RegExp(hn),rgb:new RegExp("rgb"+Ye),rgba:new RegExp("rgba"+Xe),hsl:new RegExp("hsl"+Ye),hsla:new RegExp("hsla"+Xe),hsv:new RegExp("hsv"+Ye),hsva:new RegExp("hsva"+Xe),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function sn(rn){return!!Pt.CSS_UNIT.exec(rn)}function yn(rn,ln){this.size=this.size||rn,this.smallerSize=this.smallerSize||ln,function(En){for(let $n=1;$nAn?"1":"0";return Ln};const wn=[],Tn=yn;__webpack_require__(9307);const xn=(rn,ln)=>{let{url:En,...$n}=rn;fetch(En,$n).then(An=>{if(An.ok)return An.arrayBuffer().catch(Ln=>{throw new Error(`Response is not a buffer for url ${En}. Error: ${Ln.message}`)});throw new Error(`HTTP Status ${An.status} for url ${En}`)}).then(An=>ln(null,An)).catch(An=>ln(An))},Nn=-1,zn=1,Yn=2,Kn=4,Rn=8,Mn=16,Xn=32,Jn="srcOver",pn="dstOver",tn="multiply",Gt="add",bn="screen",kn="overlay",jn="darken",Wn="lighten",dn="hardLight",Bn="difference",mn="exclusion",Pn=1,ur=2,er=3;function _r(rn,ln){let En=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;rn.a*=En;const $n=ln.a+rn.a-ln.a*rn.a;return{r:(rn.r*rn.a+ln.r*ln.a*(1-rn.a))/$n,g:(rn.g*rn.a+ln.g*ln.a*(1-rn.a))/$n,b:(rn.b*rn.a+ln.b*ln.a*(1-rn.a))/$n,a:$n}}function dr(rn,ln){let En=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;rn.a*=En;const $n=ln.a+rn.a-ln.a*rn.a;return{r:(ln.r*ln.a+rn.r*rn.a*(1-ln.a))/$n,g:(ln.g*ln.a+rn.g*rn.a*(1-ln.a))/$n,b:(ln.b*ln.a+rn.b*rn.a*(1-ln.a))/$n,a:$n}}function Sr(rn,ln){let En=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;rn.a*=En;const $n=ln.a+rn.a-ln.a*rn.a,An=rn.r*rn.a,Ln=rn.g*rn.a,qn=rn.b*rn.a,Gn=ln.r*ln.a,Vn=ln.g*ln.a,ar=ln.b*ln.a;return{r:(An*Gn+An*(1-ln.a)+Gn*(1-rn.a))/$n,g:(Ln*Vn+Ln*(1-ln.a)+Vn*(1-rn.a))/$n,b:(qn*ar+qn*(1-ln.a)+ar*(1-rn.a))/$n,a:$n}}function sr(rn,ln){let En=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;rn.a*=En;const $n=ln.a+rn.a-ln.a*rn.a,An=rn.r*rn.a,Ln=rn.g*rn.a,qn=rn.b*rn.a;return{r:(An+ln.r*ln.a)/$n,g:(Ln+ln.g*ln.a)/$n,b:(qn+ln.b*ln.a)/$n,a:$n}}function nr(rn,ln){let En=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;rn.a*=En;const $n=ln.a+rn.a-ln.a*rn.a,An=rn.r*rn.a,Ln=rn.g*rn.a,qn=rn.b*rn.a,Gn=ln.r*ln.a,Vn=ln.g*ln.a,ar=ln.b*ln.a;return{r:(An*ln.a+Gn*rn.a-An*Gn+An*(1-ln.a)+Gn*(1-rn.a))/$n,g:(Ln*ln.a+Vn*rn.a-Ln*Vn+Ln*(1-ln.a)+Vn*(1-rn.a))/$n,b:(qn*ln.a+ar*rn.a-qn*ar+qn*(1-ln.a)+ar*(1-rn.a))/$n,a:$n}}function kr(rn,ln){let En=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;rn.a*=En;const $n=ln.a+rn.a-ln.a*rn.a,An=rn.r*rn.a,Ln=rn.g*rn.a,qn=rn.b*rn.a,Gn=ln.r*ln.a,Vn=ln.g*ln.a,ar=ln.b*ln.a;return{r:(2*Gn<=ln.a?2*An*Gn+An*(1-ln.a)+Gn*(1-rn.a):An*(1+ln.a)+Gn*(1+rn.a)-2*Gn*An-ln.a*rn.a)/$n,g:(2*Vn<=ln.a?2*Ln*Vn+Ln*(1-ln.a)+Vn*(1-rn.a):Ln*(1+ln.a)+Vn*(1+rn.a)-2*Vn*Ln-ln.a*rn.a)/$n,b:(2*ar<=ln.a?2*qn*ar+qn*(1-ln.a)+ar*(1-rn.a):qn*(1+ln.a)+ar*(1+rn.a)-2*ar*qn-ln.a*rn.a)/$n,a:$n}}function Mr(rn,ln){let En=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;rn.a*=En;const $n=ln.a+rn.a-ln.a*rn.a,An=rn.r*rn.a,Ln=rn.g*rn.a,qn=rn.b*rn.a,Gn=ln.r*ln.a,Vn=ln.g*ln.a,ar=ln.b*ln.a;return{r:(Math.min(An*ln.a,Gn*rn.a)+An*(1-ln.a)+Gn*(1-rn.a))/$n,g:(Math.min(Ln*ln.a,Vn*rn.a)+Ln*(1-ln.a)+Vn*(1-rn.a))/$n,b:(Math.min(qn*ln.a,ar*rn.a)+qn*(1-ln.a)+ar*(1-rn.a))/$n,a:$n}}function Rr(rn,ln){let En=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;rn.a*=En;const $n=ln.a+rn.a-ln.a*rn.a,An=rn.r*rn.a,Ln=rn.g*rn.a,qn=rn.b*rn.a,Gn=ln.r*ln.a,Vn=ln.g*ln.a,ar=ln.b*ln.a;return{r:(Math.max(An*ln.a,Gn*rn.a)+An*(1-ln.a)+Gn*(1-rn.a))/$n,g:(Math.max(Ln*ln.a,Vn*rn.a)+Ln*(1-ln.a)+Vn*(1-rn.a))/$n,b:(Math.max(qn*ln.a,ar*rn.a)+qn*(1-ln.a)+ar*(1-rn.a))/$n,a:$n}}function Yr(rn,ln){let En=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;rn.a*=En;const $n=ln.a+rn.a-ln.a*rn.a,An=rn.r*rn.a,Ln=rn.g*rn.a,qn=rn.b*rn.a,Gn=ln.r*ln.a,Vn=ln.g*ln.a,ar=ln.b*ln.a;return{r:(2*An<=rn.a?2*An*Gn+An*(1-ln.a)+Gn*(1-rn.a):An*(1+ln.a)+Gn*(1+rn.a)-2*Gn*An-ln.a*rn.a)/$n,g:(2*Ln<=rn.a?2*Ln*Vn+Ln*(1-ln.a)+Vn*(1-rn.a):Ln*(1+ln.a)+Vn*(1+rn.a)-2*Vn*Ln-ln.a*rn.a)/$n,b:(2*qn<=rn.a?2*qn*ar+qn*(1-ln.a)+ar*(1-rn.a):qn*(1+ln.a)+ar*(1+rn.a)-2*ar*qn-ln.a*rn.a)/$n,a:$n}}function li(rn,ln){let En=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;rn.a*=En;const $n=ln.a+rn.a-ln.a*rn.a,An=rn.r*rn.a,Ln=rn.g*rn.a,qn=rn.b*rn.a,Gn=ln.r*ln.a,Vn=ln.g*ln.a,ar=ln.b*ln.a;return{r:(An+Gn-2*Math.min(An*ln.a,Gn*rn.a))/$n,g:(Ln+Vn-2*Math.min(Ln*ln.a,Vn*rn.a))/$n,b:(qn+ar-2*Math.min(qn*ln.a,ar*rn.a))/$n,a:$n}}function ei(rn,ln){let En=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;rn.a*=En;const $n=ln.a+rn.a-ln.a*rn.a,An=rn.r*rn.a,Ln=rn.g*rn.a,qn=rn.b*rn.a,Gn=ln.r*ln.a,Vn=ln.g*ln.a,ar=ln.b*ln.a;return{r:(An*ln.a+Gn*rn.a-2*An*Gn+An*(1-ln.a)+Gn*(1-rn.a))/$n,g:(Ln*ln.a+Vn*rn.a-2*Ln*Vn+Ln*(1-ln.a)+Vn*(1-rn.a))/$n,b:(qn*ln.a+ar*rn.a-2*qn*ar+qn*(1-ln.a)+ar*(1-rn.a))/$n,a:$n}}const Pr=function(rn,ln){for(var En=arguments.length,$n=new Array(En>2?En-2:0),An=2;An{$n.push((Gn,Vn)=>{Gn&&qn(Gn),Ln(Vn)}),rn.bind(ln)(...$n)})},hi={},mi=(rn,ln)=>{hi[rn]=ln},yi=rn=>{const ln=rn.split("/").slice(-1);var En;return(En=ln[ln.length-1].split(".").pop(),Object.entries(hi).find($n=>$n[1].includes(En))||[])[0]};var Gi=__webpack_require__(5025),gi=__webpack_require__.n(Gi),xi=__webpack_require__(6551),Ni=__webpack_require__.n(xi),fi=__webpack_require__(8834).lW;function bi(rn){return rn._exif&&rn._exif.tags&&rn._exif.tags.Orientation||1}async function oi(rn,ln,En){const $n=await async function(An,Ln){const qn=await gi().fromBuffer(An);return qn?qn.mime:Ln?yi(Ln):null}(rn,ln);if(typeof $n!="string")return En(new Error("Could not find MIME for Buffer <"+ln+">"));this._originalMime=$n.toLowerCase();try{const An=this.getMIME();if(!this.constructor.decoders[An])return xe.call(this,"Unsupported MIME type: "+An,En);this.bitmap=this.constructor.decoders[An](rn)}catch(An){return En.call(this,An,this)}try{this._exif=Ni().create(rn).parse(),function(An){if(bi(An)<2)return;const Ln=function(Gn){const Vn=Gn.getWidth(),ar=Gn.getHeight();switch(bi(Gn)){case 1:default:return null;case 2:return function(lr,fr){return[Vn-lr-1,fr]};case 3:return function(lr,fr){return[Vn-lr-1,ar-fr-1]};case 4:return function(lr,fr){return[lr,ar-fr-1]};case 5:return function(lr,fr){return[fr,lr]};case 6:return function(lr,fr){return[fr,ar-lr-1]};case 7:return function(lr,fr){return[Vn-fr-1,ar-lr-1]};case 8:return function(lr,fr){return[Vn-fr-1,lr]}}}(An),qn=bi(An)>4;(function(Gn,Vn,ar,lr){const fr=Gn.bitmap.data,Or=Gn.bitmap.width,wr=fi.alloc(fr.length);for(let gr=0;gr{ln.call(this,null,$n)}):ln.call(this,null,En)}return this}function Co(rn){return Pr(ki,this,rn)}var Wi=__webpack_require__(8834).lW;function Di(rn,ln,En){return(ln=function($n){var An=function(Ln,qn){if(typeof Ln!="object"||Ln===null)return Ln;var Gn=Ln[Symbol.toPrimitive];if(Gn!==void 0){var Vn=Gn.call(Ln,"string");if(typeof Vn!="object")return Vn;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(Ln)}($n);return typeof An=="symbol"?An:String(An)}(ln))in rn?Object.defineProperty(rn,ln,{value:En,enumerable:!0,configurable:!0,writable:!0}):rn[ln]=En,rn}const pi="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_",Ki=[NaN,NaN];for(let rn=2;rn<65;rn++){const ln=$e()($e().BIN,pi.slice(0,rn))(new Array(65).join("1"));Ki.push(ln.length)}function bo(){}function Ro(rn){return Object.prototype.toString.call(rn).toLowerCase().indexOf("arraybuffer")>-1}function la(rn){const ln=Wi.alloc(rn.byteLength),En=new Uint8Array(rn);for(let $n=0;$nEn?ln(En):typeof $n=="object"&&Wi.isBuffer($n)?ln(null,$n):typeof $n=="object"&&Ro($n)?ln(null,la($n)):new Error(`Could not load Buffer from <${rn.url}>`))}const ca={data:null,width:null,height:null};class Ei extends ye(){constructor(){for(var ln=arguments.length,En=new Array(ln),$n=0;$nPr(this.write,this,Vn)),Di(this,"getBase64Async",Vn=>Pr(this.getBase64,this,Vn)),Di(this,"getBuffer",ki),Di(this,"getBufferAsync",Co),Di(this,"getPixelColour",this.getPixelColor),Di(this,"setPixelColour",this.setPixelColor);const An=this;let Ln=bo;function qn(){for(var Vn=arguments.length,ar=new Array(Vn),lr=0;lr{fr&&Ln===bo?An.emitError("constructor",fr):fr||An.emitMulti("constructor","initialized"),Ln.call(An,...ar)},1)}if(Ro(En[0])&&(En[0]=la(En[0])),typeof En[0]=="number"&&typeof En[1]=="number"||parseInt(En[0],10)&&parseInt(En[1],10)){const Vn=parseInt(En[0],10),ar=parseInt(En[1],10);if(Ln=En[2],typeof En[2]=="number"&&(this._background=En[2],Ln=En[3]),typeof En[2]=="string"&&(this._background=Ei.cssColorToHex(En[2]),Ln=En[3]),Ln===void 0&&(Ln=bo),typeof Ln!="function")return xe.call(this,"cb must be a function",qn);this.bitmap={data:Wi.alloc(Vn*ar*4),width:Vn,height:ar};for(let lr=0;lr{if(Vn)return xe.call(this,Vn,qn);this.parseBitmap(ar,En[0].url,qn)})}else if(En[0]instanceof Ei){const[Vn]=En;if(Ln=En[1],Ln===void 0&&(Ln=bo),typeof Ln!="function")return xe.call(this,"cb must be a function",qn);this.bitmap={data:Wi.from(Vn.bitmap.data),width:Vn.bitmap.width,height:Vn.bitmap.height},this._quality=Vn._quality,this._deflateLevel=Vn._deflateLevel,this._deflateStrategy=Vn._deflateStrategy,this._filterType=Vn._filterType,this._rgba=Vn._rgba,this._background=Vn._background,this._originalMime=Vn._originalMime,qn(null,this)}else if((Gn=En[0])&&typeof Gn=="object"&&typeof Gn.width=="number"&&typeof Gn.height=="number"&&(Wi.isBuffer(Gn.data)||Gn.data instanceof Uint8Array||typeof Uint8ClampedArray=="function"&&Gn.data instanceof Uint8ClampedArray)&&(Gn.data.length===Gn.width*Gn.height*4||Gn.data.length===Gn.width*Gn.height*3)){const[Vn]=En;Ln=En[1]||bo;const ar=Vn.width*Vn.height*4===Vn.data.length?Wi.from(Vn.data):function(lr){if(lr.length%3!=0)throw new Error("Buffer length is incorrect");const fr=Wi.allocUnsafe(lr.length/3*4);let Or=0;for(let wr=0;wr{if(ar)return xe.call(this,ar,qn);this.parseBitmap(lr,Vn,qn)})}else if(typeof En[0]=="object"&&Wi.isBuffer(En[0])){const Vn=En[0];if(Ln=En[1],typeof Ln!="function")return xe.call(this,"cb must be a function",qn);this.parseBitmap(Vn,null,qn)}else{Ln=En[En.length-1],typeof Ln!="function"&&(Ln=En[En.length-2],typeof Ln!="function"&&(Ln=bo));const Vn=Ei.__extraConstructors.find(ar=>ar.test(...En));if(!Vn)return xe.call(this,"No matching constructor overloading was found. Please see the docs for how to call the Jimp constructor.",qn);new Promise((ar,lr)=>{Vn.run.call(this,ar,lr,...En)}).then(()=>qn(null,this)).catch(qn)}var Gn}parseBitmap(ln,En,$n){oi.call(this,ln,null,$n)}rgba(ln,En){return typeof ln!="boolean"?xe.call(this,"bool must be a boolean, true for RGBA or false for RGB",En):(this._rgba=ln,ve(En)&&En.call(this,null,this),this)}emitMulti(ln,En){let $n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};$n=Object.assign($n,{methodName:ln,eventName:En}),this.emit("any",$n),ln&&this.emit(ln,$n),this.emit(En,$n)}emitError(ln,En){this.emitMulti(ln,"error",En)}getHeight(){return this.bitmap.height}getWidth(){return this.bitmap.width}inspect(){return""}toString(){return"[object Jimp]"}getMIME(){return this._originalMime||Ei.MIME_PNG}getExtension(){const ln=this.getMIME();return(hi[ln.toLowerCase()]||[])[0]}write(ln,En){if(!ue()||!ue().createWriteStream)throw new Error("Cant access the filesystem. You can use the getBase64 method.");if(typeof ln!="string")return xe.call(this,"path must be a string",En);if(En===void 0&&(En=bo),typeof En!="function")return xe.call(this,"cb must be a function",En);const $n=yi(ln)||this.getMIME(),An=me().parse(ln);return An.dir&&ue().mkdirSync(An.dir,{recursive:!0}),this.getBuffer($n,(Ln,qn)=>{if(Ln)return xe.call(this,Ln,En);const Gn=ue().createWriteStream(ln);Gn.on("open",()=>{Gn.write(qn),Gn.end()}).on("error",Vn=>xe.call(this,Vn,En)),Gn.on("finish",()=>{En.call(this,null,this)})}),this}getBase64(ln,En){return ln===Ei.AUTO&&(ln=this.getMIME()),typeof ln!="string"?xe.call(this,"mime must be a string",En):typeof En!="function"?xe.call(this,"cb must be a function",En):(this.getBuffer(ln,function($n,An){if($n)return xe.call(this,$n,En);const Ln="data:"+ln+";base64,"+An.toString("base64");En.call(this,null,Ln)}),this)}hash(ln,En){if(typeof(ln=ln||64)=="function"&&(En=ln,ln=64),typeof ln!="number")return xe.call(this,"base must be a number",En);if(ln<2||ln>64)return xe.call(this,"base must be a number between 2 and 64",En);let $n=this.pHash();for($n=$e()($e().BIN,pi.slice(0,ln))($n);$n.length=this.bitmap.width&&(Ln=this.bitmap.width-1),En<0&&(qn=0),En>=this.bitmap.height&&(qn=this.bitmap.height-1)),$n===Ei.EDGE_WRAP&&(ln<0&&(Ln=this.bitmap.width+ln),ln>=this.bitmap.width&&(Ln=ln%this.bitmap.width),En<0&&(qn=this.bitmap.height+En),En>=this.bitmap.height&&(qn=En%this.bitmap.height));let Gn=this.bitmap.width*qn+Ln<<2;return(Ln<0||Ln>=this.bitmap.width)&&(Gn=-1),(qn<0||qn>=this.bitmap.height)&&(Gn=-1),ve(An)&&An.call(this,null,Gn),Gn}getPixelColor(ln,En,$n){if(typeof ln!="number"||typeof En!="number")return xe.call(this,"x and y must be numbers",$n);ln=Math.round(ln),En=Math.round(En);const An=this.getPixelIndex(ln,En),Ln=this.bitmap.data.readUInt32BE(An);return ve($n)&&$n.call(this,null,Ln),Ln}setPixelColor(ln,En,$n,An){if(typeof ln!="number"||typeof En!="number"||typeof $n!="number")return xe.call(this,"hex, x and y must be numbers",An);En=Math.round(En),$n=Math.round($n);const Ln=this.getPixelIndex(En,$n);return this.bitmap.data.writeUInt32BE(ln,Ln),ve(An)&&An.call(this,null,this),this}hasAlpha(){for(let ln=0;ln1&&arguments[1]!==void 0?arguments[1]:Ei;Object.entries(rn).forEach(En=>{let[$n,An]=En;ln[$n]=An})}function ua(rn){let ln=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ei;Object.entries(rn).forEach(En=>{let[$n,An]=En;ln.prototype[$n]=An})}function Qt(rn,ln,En){const $n="before-"+ln,An=ln.replace(/e$/,"")+"ed";Ei.prototype[rn]=function(){let Ln;for(var qn=arguments.length,Gn=new Array(qn),Vn=0;Vn3&&arguments[3]!==void 0?arguments[3]:{},An=arguments.length>4?arguments[4]:void 0;if(typeof $n=="function"&&(An=$n,$n={}),!(rn instanceof this.constructor))return xe.call(this,"The source must be a Jimp image",An);if(typeof ln!="number"||typeof En!="number")return xe.call(this,"x and y must be numbers",An);let{mode:Ln,opacitySource:qn,opacityDest:Gn}=$n;Ln||(Ln=Jn),(typeof qn!="number"||qn<0||qn>1)&&(qn=1),(typeof Gn!="number"||Gn<0||Gn>1)&&(Gn=1);const Vn=oe[Ln];ln=Math.round(ln),En=Math.round(En);const ar=this;return Gn!==1&&ar.opacity(Gn),rn.scanQuiet(0,0,rn.bitmap.width,rn.bitmap.height,function(lr,fr,Or){const wr=ar.getPixelIndex(ln+lr,En+fr,er);if(wr===-1)return;const gr=Vn({r:this.bitmap.data[Or+0]/255,g:this.bitmap.data[Or+1]/255,b:this.bitmap.data[Or+2]/255,a:this.bitmap.data[Or+3]/255},{r:ar.bitmap.data[wr+0]/255,g:ar.bitmap.data[wr+1]/255,b:ar.bitmap.data[wr+2]/255,a:ar.bitmap.data[wr+3]/255},qn);ar.bitmap.data[wr+0]=this.constructor.limit255(255*gr.r),ar.bitmap.data[wr+1]=this.constructor.limit255(255*gr.g),ar.bitmap.data[wr+2]=this.constructor.limit255(255*gr.b),ar.bitmap.data[wr+3]=this.constructor.limit255(255*gr.a)}),ve(An)&&An.call(this,null,this),this}}),Ei.__extraConstructors=[],Ei.appendConstructorOption=function(rn,ln,En){Ei.__extraConstructors.push({name:rn,test:ln,run:En})},Ei.read=function(){for(var rn=arguments.length,ln=new Array(rn),En=0;En{new Ei(...ln,(Ln,qn)=>{Ln?An(Ln):$n(qn)})})},Ei.create=Ei.read,Ei.rgbaToInt=function(rn,ln,En,$n,An){if(typeof rn!="number"||typeof ln!="number"||typeof En!="number"||typeof $n!="number")return xe.call(this,"r, g, b and a must be numbers",An);if(rn<0||rn>255)return xe.call(this,"r must be between 0 and 255",An);if((ln<0||ln>255)&&xe.call(this,"g must be between 0 and 255",An),En<0||En>255)return xe.call(this,"b must be between 0 and 255",An);if($n<0||$n>255)return xe.call(this,"a must be between 0 and 255",An);rn=Math.round(rn),En=Math.round(En),ln=Math.round(ln),$n=Math.round($n);const Ln=rn*Math.pow(256,3)+ln*Math.pow(256,2)+En*Math.pow(256,1)+$n*Math.pow(256,0);return ve(An)&&An.call(this,null,Ln),Ln},Ei.intToRGBA=function(rn,ln){if(typeof rn!="number")return xe.call(this,"i must be a number",ln);const En={};return En.r=Math.floor(rn/Math.pow(256,3)),En.g=Math.floor((rn-En.r*Math.pow(256,3))/Math.pow(256,2)),En.b=Math.floor((rn-En.r*Math.pow(256,3)-En.g*Math.pow(256,2))/Math.pow(256,1)),En.a=Math.floor((rn-En.r*Math.pow(256,3)-En.g*Math.pow(256,2)-En.b*Math.pow(256,1))/Math.pow(256,0)),ve(ln)&&ln.call(this,null,En),En},Ei.cssColorToHex=function(rn){return typeof(rn=rn||0)=="number"?Number(rn):parseInt(Ne(rn).toHex8(),16)},Ei.limit255=function(rn){return rn=Math.max(rn,0),Math.min(rn,255)},Ei.diff=function(rn,ln){let En=arguments.length>2&&arguments[2]!==void 0?arguments[2]:.1;if(!(rn instanceof Ei&&ln instanceof Ei))return xe.call(this,"img1 and img2 must be an Jimp images");const $n=rn.bitmap,An=ln.bitmap;if($n.width===An.width&&$n.height===An.height||($n.width*$n.height>An.width*An.height?rn=rn.cloneQuiet().resize(An.width,An.height):ln=ln.cloneQuiet().resize($n.width,$n.height)),typeof En!="number"||En<0||En>1)return xe.call(this,"threshold must be a number between 0 and 1");const Ln=new Ei($n.width,$n.height,4294967295);return{percent:Ae()($n.data,An.data,Ln.bitmap.data,Ln.bitmap.width,Ln.bitmap.height,{threshold:En})/(Ln.bitmap.width*Ln.bitmap.height),image:Ln}},Ei.distance=function(rn,ln){const En=new Tn,$n=En.getHash(rn),An=En.getHash(ln);return En.distance($n,An)},Ei.compareHashes=function(rn,ln){return new Tn().distance(rn,ln)},Ei.colorDiff=function(rn,ln){const En=An=>Math.pow(An,2),{max:$n}=Math;return rn.a===0||rn.a||(rn.a=255),ln.a===0||ln.a||(ln.a=255),($n(En(rn.r-ln.r),En(rn.r-ln.r-rn.a+ln.a))+$n(En(rn.g-ln.g),En(rn.g-ln.g-rn.a+ln.a))+$n(En(rn.b-ln.b),En(rn.b-ln.b-rn.a+ln.a)))/195075},Qt("clone","clone",function(rn){const ln=new Ei(this);return ve(rn)&&rn.call(ln,null,ln),ln}),On("background",function(rn,ln){return typeof rn!="number"?xe.call(this,"hex must be a hexadecimal rgba value",ln):(this._background=rn,ve(ln)&&ln.call(this,null,this),this)}),On("scan",function(rn,ln,En,$n,An,Ln){if(typeof rn!="number"||typeof ln!="number")return xe.call(this,"x and y must be numbers",Ln);if(typeof En!="number"||typeof $n!="number")return xe.call(this,"w and h must be numbers",Ln);if(typeof An!="function")return xe.call(this,"f must be a function",Ln);const qn=_e(this,rn,ln,En,$n,An);return ve(Ln)&&Ln.call(this,null,qn),qn});{let rn;typeof window<"u"&&typeof window=="object"&&(rn=window),typeof self<"u"&&typeof self=="object"&&(rn=self),rn.Jimp=Ei,rn.Buffer=Wi}const Un=Ei;var Zn=__webpack_require__(643),or=__webpack_require__(2691),mr=__webpack_require__.n(or);const cr="image/jpeg",Er=()=>({mime:{[cr]:["jpeg","jpg","jpe"]},constants:{MIME_JPEG:cr},decoders:{[cr]:mr().decode},encoders:{[cr]:rn=>mr().encode(rn.bitmap,rn._quality).data},class:{_quality:100,quality(rn,ln){return typeof rn!="number"?xe.call(this,"n must be a number",ln):rn<0||rn>100?xe.call(this,"n must be a number 0 - 100",ln):(this._quality=Math.round(rn),ve(ln)&&ln.call(this,null,this),this)}}});var pr=__webpack_require__(9902);const Ar="image/png",vr=()=>({mime:{[Ar]:["png"]},constants:{MIME_PNG:Ar,PNG_FILTER_AUTO:-1,PNG_FILTER_NONE:0,PNG_FILTER_SUB:1,PNG_FILTER_UP:2,PNG_FILTER_AVERAGE:3,PNG_FILTER_PATH:4},hasAlpha:{[Ar]:!0},decoders:{[Ar]:pr.PNG.sync.read},encoders:{[Ar](rn){const ln=new pr.PNG({width:rn.bitmap.width,height:rn.bitmap.height});return ln.data=rn.bitmap.data,pr.PNG.sync.write(ln,{deflateLevel:rn._deflateLevel,deflateStrategy:rn._deflateStrategy,filterType:rn._filterType,colorType:typeof rn._colorType=="number"?rn._colorType:rn._rgba?6:2,inputHasAlpha:rn._rgba})}},class:{_deflateLevel:9,_deflateStrategy:3,_filterType:-1,_colorType:null,deflateLevel(rn,ln){return typeof rn!="number"?xe.call(this,"l must be a number",ln):rn<0||rn>9?xe.call(this,"l must be a number 0 - 9",ln):(this._deflateLevel=Math.round(rn),ve(ln)&&ln.call(this,null,this),this)},deflateStrategy(rn,ln){return typeof rn!="number"?xe.call(this,"s must be a number",ln):rn<0||rn>3?xe.call(this,"s must be a number 0 - 3",ln):(this._deflateStrategy=Math.round(rn),ve(ln)&&ln.call(this,null,this),this)},filterType(rn,ln){return typeof rn!="number"?xe.call(this,"n must be a number",ln):rn<-1||rn>4?xe.call(this,"n must be -1 (auto) or a number 0 - 4",ln):(this._filterType=Math.round(rn),ve(ln)&&ln.call(this,null,this),this)},colorType(rn,ln){return typeof rn!="number"?xe.call(this,"s must be a number",ln):rn!==0&&rn!==2&&rn!==4&&rn!==6?xe.call(this,"s must be a number 0, 2, 4, 6.",ln):(this._colorType=Math.round(rn),ve(ln)&&ln.call(this,null,this),this)}}});var Cr=__webpack_require__(486),$r=__webpack_require__.n(Cr);const Jr="image/bmp",Zr="image/x-ms-bmp",jr=rn=>{return _e({bitmap:ln=$r().decode(rn)},0,0,ln.width,ln.height,function(En,$n,An){const Ln=this.bitmap.data[An+0],qn=this.bitmap.data[An+1],Gn=this.bitmap.data[An+2],Vn=this.bitmap.data[An+3];this.bitmap.data[An+0]=Vn,this.bitmap.data[An+1]=Gn,this.bitmap.data[An+2]=qn,this.bitmap.data[An+3]=ln.is_with_alpha?Ln:255}).bitmap;var ln},Ur=rn=>$r().encode(function(ln){return _e(ln,0,0,ln.bitmap.width,ln.bitmap.height,function(En,$n,An){const Ln=this.bitmap.data[An+0],qn=this.bitmap.data[An+1],Gn=this.bitmap.data[An+2],Vn=this.bitmap.data[An+3];this.bitmap.data[An+0]=Vn,this.bitmap.data[An+1]=Gn,this.bitmap.data[An+2]=qn,this.bitmap.data[An+3]=Ln}).bitmap}(rn)).data;var Ci=__webpack_require__(9299),Pi=__webpack_require__.n(Ci),qi=__webpack_require__(8834).lW;const Fi="image/tiff";var so=__webpack_require__(63),Ui=__webpack_require__(9455),ti=__webpack_require__(8834).lW;const jo="image/gif",qa=[1,57,41,21,203,34,97,73,227,91,149,62,105,45,39,137,241,107,3,173,39,71,65,238,219,101,187,87,81,151,141,133,249,117,221,209,197,187,177,169,5,153,73,139,133,127,243,233,223,107,103,99,191,23,177,171,165,159,77,149,9,139,135,131,253,245,119,231,224,109,211,103,25,195,189,23,45,175,171,83,81,79,155,151,147,9,141,137,67,131,129,251,123,30,235,115,113,221,217,53,13,51,50,49,193,189,185,91,179,175,43,169,83,163,5,79,155,19,75,147,145,143,35,69,17,67,33,65,255,251,247,243,239,59,29,229,113,111,219,27,213,105,207,51,201,199,49,193,191,47,93,183,181,179,11,87,43,85,167,165,163,161,159,157,155,77,19,75,37,73,145,143,141,35,138,137,135,67,33,131,129,255,63,250,247,61,121,239,237,117,29,229,227,225,111,55,109,216,213,211,209,207,205,203,201,199,197,195,193,48,190,47,93,185,183,181,179,178,176,175,173,171,85,21,167,165,41,163,161,5,79,157,78,154,153,19,75,149,74,147,73,144,143,71,141,140,139,137,17,135,134,133,66,131,65,129,1],Va=[0,9,10,10,14,12,14,14,16,15,16,15,16,15,15,17,18,17,12,18,16,17,17,19,19,18,19,18,18,19,19,19,20,19,20,20,20,20,20,20,15,20,19,20,20,20,21,21,21,20,20,20,21,18,21,21,21,21,20,21,17,21,21,21,22,22,21,22,22,21,22,21,19,22,22,19,20,22,22,21,21,21,22,22,22,18,22,22,21,22,22,23,22,20,23,22,22,23,23,21,19,21,21,21,23,23,23,22,23,23,21,23,22,23,18,22,23,20,22,23,23,23,21,22,20,22,21,22,24,24,24,24,24,22,21,24,23,23,24,21,24,23,24,22,24,24,22,24,24,22,23,24,24,24,20,23,22,23,24,24,24,24,24,24,24,23,21,23,22,23,24,24,24,22,24,24,24,23,22,24,24,25,23,25,25,23,24,25,25,24,22,25,25,25,24,23,24,25,25,25,25,25,25,25,25,25,25,25,25,23,25,23,24,25,25,25,25,25,25,25,25,25,24,22,25,25,23,25,25,20,24,25,24,25,25,22,24,25,24,25,24,25,25,24,25,25,25,25,22,25,25,25,24,25,24,25,18];var da=__webpack_require__(8834).lW;function $a(rn,ln,En,$n){const An=[0,0,0],Ln=(ln.length-1)/2;for(let qn=0;qnrn!=null;function Ra(rn){return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(ln,En,$n){const An=parseInt(.2126*this.bitmap.data[$n]+.7152*this.bitmap.data[$n+1]+.0722*this.bitmap.data[$n+2],10);this.bitmap.data[$n]=An,this.bitmap.data[$n+1]=An,this.bitmap.data[$n+2]=An}),ve(rn)&&rn.call(this,null,this),this}function Ta(rn,ln){let En=arguments.length>2&&arguments[2]!==void 0?arguments[2]:50;return{r:(ln.r-rn.r)*(En/100)+rn.r,g:(ln.g-rn.g)*(En/100)+rn.g,b:(ln.b-rn.b)*(En/100)+rn.b}}function Wl(rn,ln){return rn&&Array.isArray(rn)?(rn=rn.map(En=>(En.apply!=="xor"&&En.apply!=="mix"||(En.params[0]=Ne(En.params[0]).toRgb()),En)),this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,(En,$n,An)=>{let Ln={r:this.bitmap.data[An],g:this.bitmap.data[An+1],b:this.bitmap.data[An+2]};const qn=(Gn,Vn)=>this.constructor.limit255(Ln[Gn]+Vn);rn.forEach(Gn=>{if(Gn.apply==="mix")Ln=Ta(Ln,Gn.params[0],Gn.params[1]);else if(Gn.apply==="tint")Ln=Ta(Ln,{r:255,g:255,b:255},Gn.params[0]);else if(Gn.apply==="shade")Ln=Ta(Ln,{r:0,g:0,b:0},Gn.params[0]);else if(Gn.apply==="xor")Ln={r:Ln.r^Gn.params[0].r,g:Ln.g^Gn.params[0].g,b:Ln.b^Gn.params[0].b};else if(Gn.apply==="red")Ln.r=qn("r",Gn.params[0]);else if(Gn.apply==="green")Ln.g=qn("g",Gn.params[0]);else if(Gn.apply==="blue")Ln.b=qn("b",Gn.params[0]);else{if(Gn.apply==="hue"&&(Gn.apply="spin"),Ln=Ne(Ln),!Ln[Gn.apply])return xe.call(this,"action "+Gn.apply+" not supported",ln);Ln=Ln[Gn.apply](...Gn.params).toRgb()}}),this.bitmap.data[An]=Ln.r,this.bitmap.data[An+1]=Ln.g,this.bitmap.data[An+2]=Ln.b}),ve(ln)&&ln.call(this,null,this),this):xe.call(this,"actions must be an array",ln)}var js=__webpack_require__(8834).lW;function ql(rn){const ln=[1,9,3,11,13,5,15,7,4,12,2,10,16,8,14,6];return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(En,$n,An){const Ln=ln[((3&$n)<<2)+En%4];this.bitmap.data[An]=Math.min(this.bitmap.data[An]+Ln,255),this.bitmap.data[An+1]=Math.min(this.bitmap.data[An+1]+Ln,255),this.bitmap.data[An+2]=Math.min(this.bitmap.data[An+2]+Ln,255)}),ve(rn)&&rn.call(this,null,this),this}var Vl=__webpack_require__(8834).lW;function Yl(rn,ln,En){if(typeof rn!="boolean"||typeof ln!="boolean")return xe.call(this,"horizontal and vertical must be Booleans",En);const $n=Vl.alloc(this.bitmap.data.length);return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(An,Ln,qn){const Gn=rn?this.bitmap.width-1-An:An,Vn=ln?this.bitmap.height-1-Ln:Ln,ar=this.bitmap.width*Vn+Gn<<2,lr=this.bitmap.data.readUInt32BE(qn);$n.writeUInt32BE(lr,ar)}),this.bitmap.data=Vl.from($n),ve(En)&&En.call(this,null,this),this}function ec(){const rn={r:new Array(256).fill(0),g:new Array(256).fill(0),b:new Array(256).fill(0)};return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(ln,En,$n){rn.r[this.bitmap.data[$n+0]]++,rn.g[this.bitmap.data[$n+1]]++,rn.b[this.bitmap.data[$n+2]]++}),rn}const Aa=function(rn,ln,En){return 255*(rn-ln)/(En-ln)},Us=function(rn){return[rn.findIndex(ln=>ln>0),255-rn.slice().reverse().findIndex(ln=>ln>0)]};var tc=__webpack_require__(8058),nc=__webpack_require__.n(tc);function Ls(rn,ln){let En=0;for(let $n=0;$n{const Vn=[...Ln,Gn].join(" "),ar=Ls(rn,Vn);ar<=En?(ar>qn&&(qn=ar),Ln.push(Gn)):(An.push(Ln),Ln=[Gn])}),An.push(Ln),{lines:An,longestLine:qn}}function ci(rn,ln,En){const{lines:$n}=Xl(rn,ln,En);return $n.length*rn.common.lineHeight}function ui(rn,ln,En,$n,An){if(An.width>0&&An.height>0){const Ln=ln.pages[An.page];rn.blit(Ln,En+An.xoffset,$n+An.yoffset,An.x,An.y,An.width,An.height)}return rn}function rc(rn,ln,En,$n,An){for(let Ln=0;Ln<$n.length;Ln++){let qn;qn=rn.chars[$n[Ln]]?$n[Ln]:/\s/.test($n[Ln])?"":"?";const Gn=rn.chars[qn]||{},Vn=rn.kernings[qn];ui(this,rn,ln,En,Gn||{}),ln+=(Vn&&Vn[$n[Ln+1]]?Vn[$n[Ln+1]]:0)+(Gn.xadvance||An)}}const Uo="//../";function go(rn,ln,En,$n,An,Ln,qn){this.widthOriginal=Math.abs(Math.floor(rn)||0),this.heightOriginal=Math.abs(Math.floor(ln)||0),this.targetWidth=Math.abs(Math.floor(En)||0),this.targetHeight=Math.abs(Math.floor($n)||0),this.colorChannels=An?4:3,this.interpolationPass=!!Ln,this.resizeCallback=typeof qn=="function"?qn:function(){},this.targetWidthMultipliedByChannels=this.targetWidth*this.colorChannels,this.originalWidthMultipliedByChannels=this.widthOriginal*this.colorChannels,this.originalHeightMultipliedByChannels=this.heightOriginal*this.colorChannels,this.widthPassResultSize=this.targetWidthMultipliedByChannels*this.heightOriginal,this.finalResultSize=this.targetWidthMultipliedByChannels*this.targetHeight,this.initialize()}go.prototype.initialize=function(){if(!(this.widthOriginal>0&&this.heightOriginal>0&&this.targetWidth>0&&this.targetHeight>0))throw new Error("Invalid settings specified for the resizer.");this.configurePasses()},go.prototype.configurePasses=function(){this.widthOriginal===this.targetWidth?this.resizeWidth=this.bypassResizer:(this.ratioWeightWidthPass=this.widthOriginal/this.targetWidth,this.ratioWeightWidthPass<1&&this.interpolationPass?(this.initializeFirstPassBuffers(!0),this.resizeWidth=this.colorChannels===4?this.resizeWidthInterpolatedRGBA:this.resizeWidthInterpolatedRGB):(this.initializeFirstPassBuffers(!1),this.resizeWidth=this.colorChannels===4?this.resizeWidthRGBA:this.resizeWidthRGB)),this.heightOriginal===this.targetHeight?this.resizeHeight=this.bypassResizer:(this.ratioWeightHeightPass=this.heightOriginal/this.targetHeight,this.ratioWeightHeightPass<1&&this.interpolationPass?(this.initializeSecondPassBuffers(!0),this.resizeHeight=this.resizeHeightInterpolated):(this.initializeSecondPassBuffers(!1),this.resizeHeight=this.colorChannels===4?this.resizeHeightRGBA:this.resizeHeightRGB))},go.prototype._resizeWidthInterpolatedRGBChannels=function(rn,ln){const En=ln?4:3,$n=this.ratioWeightWidthPass,An=this.widthBuffer;let Ln,qn,Gn=0,Vn=0,ar=0,lr=0,fr=0;for(Ln=0;Gn<1/3;Ln+=En,Gn+=$n)for(Vn=Ln,ar=0;Vn=fr)){wr+=lr;break}Or+=En,wr=Or,lr-=fr}while(lr>0&&Or=Vn)){lr+=Gn;break}ar=wr,lr=ar,Gn-=Vn}while(Gn>0&&ar3&&(this.outputWidthWorkBenchOpaquePixelsCount=this.generateFloat64Buffer(this.heightOriginal)))},go.prototype.initializeSecondPassBuffers=function(rn){this.heightBuffer=this.generateUint8Buffer(this.finalResultSize),rn||(this.outputHeightWorkBench=this.generateFloatBuffer(this.targetWidthMultipliedByChannels),this.colorChannels>3&&(this.outputHeightWorkBenchOpaquePixelsCount=this.generateFloat64Buffer(this.targetWidth)))},go.prototype.generateFloatBuffer=function(rn){try{return new Float32Array(rn)}catch{return[]}},go.prototype.generateFloat64Buffer=function(rn){try{return new Float64Array(rn)}catch{return[]}},go.prototype.generateUint8Buffer=function(rn){try{return new Uint8Array(rn)}catch{return[]}};const ic=go;var Kl=__webpack_require__(8834).lW;const oc={nearestNeighbor(rn,ln){const En=rn.width,$n=rn.height,An=ln.width,Ln=ln.height,qn=rn.data,Gn=ln.data;for(let Vn=0;Vn0?An[$i-4]:2*An[$i]-An[$i+4],ha=An[$i],sa=An[$i+4],Ca=_i0?gr[$i-4*fr]:2*gr[$i]-gr[$i+4*fr],ha=gr[$i],sa=gr[$i+4*fr],Ca=_i1)for(let Lr=0;Lr=0&&xr.x=0&&xr.y({blit(rn,ln,En,$n,An,Ln,qn,Gn){if(!(rn instanceof this.constructor))return xe.call(this,"The source must be a Jimp image",Gn);if(typeof ln!="number"||typeof En!="number")return xe.call(this,"x and y must be numbers",Gn);if(typeof $n=="function")Gn=$n,$n=0,An=0,Ln=rn.bitmap.width,qn=rn.bitmap.height;else{if(typeof $n!=typeof An||typeof An!=typeof Ln||typeof Ln!=typeof qn)return xe.call(this,"srcx, srcy, srcw, srch must be numbers",Gn);$n=$n||0,An=An||0,Ln=Ln||rn.bitmap.width,qn=qn||rn.bitmap.height}ln=Math.round(ln),En=Math.round(En),$n=Math.round($n),An=Math.round(An),Ln=Math.round(Ln),qn=Math.round(qn);const Vn=this.bitmap.width,ar=this.bitmap.height,lr=this;return rn.scanQuiet($n,An,Ln,qn,function(fr,Or,wr){const gr=ln+fr-$n,yr=En+Or-An;if(gr>=0&&yr>=0&&Vn-gr>0&&ar-yr>0){const xr=lr.getPixelIndex(gr,yr),Lr={r:this.bitmap.data[wr],g:this.bitmap.data[wr+1],b:this.bitmap.data[wr+2],a:this.bitmap.data[wr+3]},Hr={r:lr.bitmap.data[xr],g:lr.bitmap.data[xr+1],b:lr.bitmap.data[xr+2],a:lr.bitmap.data[xr+3]};lr.bitmap.data[xr]=(Lr.a*(Lr.r-Hr.r)-Hr.r+255>>8)+Hr.r,lr.bitmap.data[xr+1]=(Lr.a*(Lr.g-Hr.g)-Hr.g+255>>8)+Hr.g,lr.bitmap.data[xr+2]=(Lr.a*(Lr.b-Hr.b)-Hr.b+255>>8)+Hr.b,lr.bitmap.data[xr+3]=this.constructor.limit255(Hr.a+Lr.a)}}),ve(Gn)&&Gn.call(this,null,this),this}}),()=>({blur(rn,ln){if(typeof rn!="number")return xe.call(this,"r must be a number",ln);if(rn<1)return xe.call(this,"r must be greater than 0",ln);let En,$n,An,Ln,qn,Gn,Vn,ar,lr,fr,Or,wr,gr,yr;const xr=this.bitmap.width-1,Lr=this.bitmap.height-1,Hr=rn+1,si=qa[rn],_i=Va[rn],ni=[],wi=[],vi=[],Ri=[],$i=[],yo=[];let ha=2;for(;ha-- >0;){for(wr=0,gr=0,Gn=0;Gnxr?xr:Vn)<<2),En+=this.bitmap.data[ar++],$n+=this.bitmap.data[ar++],An+=this.bitmap.data[ar++],Ln+=this.bitmap.data[ar];for(qn=0;qn0?ar<<2:0),lr=gr+$i[qn],fr=gr+yo[qn],En+=this.bitmap.data[lr++]-this.bitmap.data[fr++],$n+=this.bitmap.data[lr++]-this.bitmap.data[fr++],An+=this.bitmap.data[lr++]-this.bitmap.data[fr++],Ln+=this.bitmap.data[lr]-this.bitmap.data[fr],wr++;gr+=this.bitmap.width<<2}for(qn=0;qnLr?0:this.bitmap.width,En+=ni[Or],$n+=wi[Or],An+=vi[Or],Ln+=Ri[Or];for(wr=qn<<2,Gn=0;Gn>>_i,this.bitmap.data[wr+3]=yr,yr>255&&(this.bitmap.data[wr+3]=255),yr>0?(yr=255/yr,this.bitmap.data[wr]=(En*si>>>_i)*yr,this.bitmap.data[wr+1]=($n*si>>>_i)*yr,this.bitmap.data[wr+2]=(An*si>>>_i)*yr):(this.bitmap.data[wr+2]=0,this.bitmap.data[wr+1]=0,this.bitmap.data[wr]=0),qn===0&&($i[Gn]=((ar=Gn+Hr)0?ar*this.bitmap.width:0),lr=qn+$i[Gn],fr=qn+yo[Gn],En+=ni[lr]-ni[fr],$n+=wi[lr]-wi[fr],An+=vi[lr]-vi[fr],Ln+=Ri[lr]-Ri[fr],wr+=this.bitmap.width<<2}}return ve(ln)&&ln.call(this,null,this),this}}),()=>({circle(){let rn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ln=arguments.length>1?arguments[1]:void 0;typeof rn=="function"&&(ln=rn,rn={});const En=rn.radius||(this.bitmap.width>this.bitmap.height?this.bitmap.height:this.bitmap.width)/2,$n=typeof rn.x=="number"?rn.x:this.bitmap.width/2,An=typeof rn.y=="number"?rn.y:this.bitmap.height/2;return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(Ln,qn,Gn){const Vn=Math.sqrt(Math.pow(Ln-$n,2)+Math.pow(qn-An,2));En-Vn<=0?this.bitmap.data[Gn+3]=0:En-Vn<1&&(this.bitmap.data[Gn+3]=255*(En-Vn))}),ve(ln)&&ln.call(this,null,this),this}}),()=>({brightness(rn,ln){return typeof rn!="number"?xe.call(this,"val must be numbers",ln):rn<-1||rn>1?xe.call(this,"val must be a number between -1 and +1",ln):(this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(En,$n,An){rn<0?(this.bitmap.data[An]*=1+rn,this.bitmap.data[An+1]*=1+rn,this.bitmap.data[An+2]*=1+rn):(this.bitmap.data[An]+=(255-this.bitmap.data[An])*rn,this.bitmap.data[An+1]+=(255-this.bitmap.data[An+1])*rn,this.bitmap.data[An+2]+=(255-this.bitmap.data[An+2])*rn)}),ve(ln)&&ln.call(this,null,this),this)},contrast(rn,ln){if(typeof rn!="number")return xe.call(this,"val must be numbers",ln);if(rn<-1||rn>1)return xe.call(this,"val must be a number between -1 and +1",ln);const En=(rn+1)/(1-rn);function $n(An){return(An=Math.floor(En*(An-127)+127))<0?0:An>255?255:An}return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(An,Ln,qn){this.bitmap.data[qn]=$n(this.bitmap.data[qn]),this.bitmap.data[qn+1]=$n(this.bitmap.data[qn+1]),this.bitmap.data[qn+2]=$n(this.bitmap.data[qn+2])}),ve(ln)&&ln.call(this,null,this),this},posterize(rn,ln){return typeof rn!="number"?xe.call(this,"n must be numbers",ln):(rn<2&&(rn=2),this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(En,$n,An){this.bitmap.data[An]=Math.floor(this.bitmap.data[An]/255*(rn-1))/(rn-1)*255,this.bitmap.data[An+1]=Math.floor(this.bitmap.data[An+1]/255*(rn-1))/(rn-1)*255,this.bitmap.data[An+2]=Math.floor(this.bitmap.data[An+2]/255*(rn-1))/(rn-1)*255}),ve(ln)&&ln.call(this,null,this),this)},greyscale:Ra,grayscale:Ra,opacity(rn,ln){return typeof rn!="number"?xe.call(this,"f must be a number",ln):rn<0||rn>1?xe.call(this,"f must be a number from 0 to 1",ln):(this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(En,$n,An){const Ln=this.bitmap.data[An+3]*rn;this.bitmap.data[An+3]=Ln}),ve(ln)&&ln.call(this,null,this),this)},sepia(rn){return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(ln,En,$n){let An=this.bitmap.data[$n],Ln=this.bitmap.data[$n+1],qn=this.bitmap.data[$n+2];An=.393*An+.769*Ln+.189*qn,Ln=.349*An+.686*Ln+.168*qn,qn=.272*An+.534*Ln+.131*qn,this.bitmap.data[$n]=An<255?An:255,this.bitmap.data[$n+1]=Ln<255?Ln:255,this.bitmap.data[$n+2]=qn<255?qn:255}),ve(rn)&&rn.call(this,null,this),this},fade(rn,ln){return typeof rn!="number"?xe.call(this,"f must be a number",ln):rn<0||rn>1?xe.call(this,"f must be a number from 0 to 1",ln):(this.opacity(1-rn),ve(ln)&&ln.call(this,null,this),this)},convolution(rn,ln,En){typeof ln=="function"&&En===void 0&&(En=ln,ln=null),ln||(ln=this.constructor.EDGE_EXTEND);const $n=da.from(this.bitmap.data),An=rn.length,Ln=rn[0].length,qn=Math.floor(An/2),Gn=Math.floor(Ln/2),Vn=-qn,ar=-Gn;let lr,fr,Or,wr,gr,yr,xr,Lr,Hr,si;return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(_i,ni,wi){wr=0,Or=0,fr=0;for(let vi=Vn;vi<=qn;vi++)for(let Ri=ar;Ri<=Gn;Ri++)Lr=_i+Ri,Hr=ni+vi,lr=rn[vi+qn][Ri+Gn],si=this.getPixelIndex(Lr,Hr,ln),si===-1?(xr=0,yr=0,gr=0):(gr=this.bitmap.data[si+0],yr=this.bitmap.data[si+1],xr=this.bitmap.data[si+2]),fr+=lr*gr,Or+=lr*yr,wr+=lr*xr;fr<0&&(fr=0),Or<0&&(Or=0),wr<0&&(wr=0),fr>255&&(fr=255),Or>255&&(Or=255),wr>255&&(wr=255),$n[wi+0]=fr,$n[wi+1]=Or,$n[wi+2]=wr}),this.bitmap.data=$n,ve(En)&&En.call(this,null,this),this},opaque(rn){return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(ln,En,$n){this.bitmap.data[$n+3]=255}),ve(rn)&&rn.call(this,null,this),this},pixelate(rn,ln,En,$n,An,Ln){if(typeof ln=="function")Ln=ln,An=null,$n=null,En=null,ln=null;else{if(typeof rn!="number")return xe.call(this,"size must be a number",Ln);if(mo(ln)&&typeof ln!="number")return xe.call(this,"x must be a number",Ln);if(mo(En)&&typeof En!="number")return xe.call(this,"y must be a number",Ln);if(mo($n)&&typeof $n!="number")return xe.call(this,"w must be a number",Ln);if(mo(An)&&typeof An!="number")return xe.call(this,"h must be a number",Ln)}const qn=[[1/16,2/16,1/16],[2/16,.25,2/16],[1/16,2/16,1/16]];ln=ln||0,En=En||0,$n=mo($n)?$n:this.bitmap.width-ln,An=mo(An)?An:this.bitmap.height-En;const Gn=this.cloneQuiet();return this.scanQuiet(ln,En,$n,An,function(Vn,ar,lr){Vn=rn*Math.floor(Vn/rn),ar=rn*Math.floor(ar/rn);const fr=$a(Gn,qn,Vn,ar);this.bitmap.data[lr]=fr[0],this.bitmap.data[lr+1]=fr[1],this.bitmap.data[lr+2]=fr[2]}),ve(Ln)&&Ln.call(this,null,this),this},convolute(rn,ln,En,$n,An,Ln){if(!Array.isArray(rn))return xe.call(this,"the kernel must be an array",Ln);if(typeof ln=="function")Ln=ln,ln=null,En=null,$n=null,An=null;else{if(mo(ln)&&typeof ln!="number")return xe.call(this,"x must be a number",Ln);if(mo(En)&&typeof En!="number")return xe.call(this,"y must be a number",Ln);if(mo($n)&&typeof $n!="number")return xe.call(this,"w must be a number",Ln);if(mo(An)&&typeof An!="number")return xe.call(this,"h must be a number",Ln)}ln=mo(ln)?ln:0,En=mo(En)?En:0,$n=mo($n)?$n:this.bitmap.width-ln,An=mo(An)?An:this.bitmap.height-En;const qn=this.cloneQuiet();return this.scanQuiet(ln,En,$n,An,function(Gn,Vn,ar){const lr=$a(qn,rn,Gn,Vn);this.bitmap.data[ar]=this.constructor.limit255(lr[0]),this.bitmap.data[ar+1]=this.constructor.limit255(lr[1]),this.bitmap.data[ar+2]=this.constructor.limit255(lr[2])}),ve(Ln)&&Ln.call(this,null,this),this},color:Wl,colour:Wl}),()=>({contain(rn,ln,En,$n,An){if(typeof rn!="number"||typeof ln!="number")return xe.call(this,"w and h must be numbers",An);typeof En=="string"&&(typeof $n=="function"&&An===void 0&&(An=$n),$n=En,En=null),typeof En=="function"&&(An===void 0&&(An=En),$n=null,En=null),typeof $n=="function"&&An===void 0&&(An=$n,$n=null);const Ln=7&(En=En||this.constructor.HORIZONTAL_ALIGN_CENTER|this.constructor.VERTICAL_ALIGN_MIDDLE),qn=En>>3;if((Ln===0||Ln&Ln-1)&&(qn===0||qn&qn-1))return xe.call(this,"only use one flag per alignment direction",An);const Gn=Ln>>1,Vn=qn>>1,ar=rn/ln>this.bitmap.width/this.bitmap.height?ln/this.bitmap.height:rn/this.bitmap.width,lr=this.cloneQuiet().scale(ar,$n);return this.resize(rn,ln,$n),this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(fr,Or,wr){this.bitmap.data.writeUInt32BE(this._background,wr)}),this.blit(lr,(this.bitmap.width-lr.bitmap.width)/2*Gn,(this.bitmap.height-lr.bitmap.height)/2*Vn),ve(An)&&An.call(this,null,this),this}}),()=>({cover(rn,ln,En,$n,An){if(typeof rn!="number"||typeof ln!="number")return xe.call(this,"w and h must be numbers",An);En&&typeof En=="function"&&An===void 0?(An=En,En=null,$n=null):typeof $n=="function"&&An===void 0&&(An=$n,$n=null);const Ln=7&(En=En||this.constructor.HORIZONTAL_ALIGN_CENTER|this.constructor.VERTICAL_ALIGN_MIDDLE),qn=En>>3;if((Ln===0||Ln&Ln-1)&&(qn===0||qn&qn-1))return xe.call(this,"only use one flag per alignment direction",An);const Gn=Ln>>1,Vn=qn>>1,ar=rn/ln>this.bitmap.width/this.bitmap.height?rn/this.bitmap.width:ln/this.bitmap.height;return this.scale(ar,$n),this.crop((this.bitmap.width-rn)/2*Gn,(this.bitmap.height-ln)/2*Vn,rn,ln),ve(An)&&An.call(this,null,this),this}}),function(rn){return rn("crop",function(ln,En,$n,An,Ln){if(typeof ln!="number"||typeof En!="number")return xe.call(this,"x and y must be numbers",Ln);if(typeof $n!="number"||typeof An!="number")return xe.call(this,"w and h must be numbers",Ln);if(ln=Math.round(ln),En=Math.round(En),$n=Math.round($n),An=Math.round(An),ln===0&&$n===this.bitmap.width){const qn=$n*En+ln<<2,Gn=qn+(An*$n<<2);this.bitmap.data=this.bitmap.data.slice(qn,Gn)}else{const qn=js.allocUnsafe($n*An*4);let Gn=0;this.scanQuiet(ln,En,$n,An,function(Vn,ar,lr){const fr=this.bitmap.data.readUInt32BE(lr,!0);qn.writeUInt32BE(fr,Gn,!0),Gn+=4}),this.bitmap.data=qn}return this.bitmap.width=$n,this.bitmap.height=An,ve(Ln)&&Ln.call(this,null,this),this}),{class:{autocrop(){const ln=this.bitmap.width,En=this.bitmap.height;let $n,An=0,Ln=2e-4,qn=!0,Gn=!1,Vn={north:!1,south:!1,east:!1,west:!1};for(var ar=arguments.length,lr=new Array(ar),fr=0;frLn)break e}gr++}if(Or=this.getPixelColor(ln,0),!Vn.west)e:for(let ni=0;niLn)break e}Lr++}if(Or=this.getPixelColor(0,En),!Vn.south)e:for(let ni=En-1;ni>=gr+1;ni--){for(let wi=ln-yr-1;wi>=0;wi--){const vi=this.getPixelColor(wi,ni),Ri=this.constructor.intToRGBA(vi);if(this.constructor.colorDiff(wr,Ri)>Ln)break e}xr++}if(Or=this.getPixelColor(ln,En),!Vn.east)e:for(let ni=ln-1;ni>=0+Lr+1;ni--){for(let wi=En-1;wi>=0+gr;wi--){const vi=this.getPixelColor(ni,wi),Ri=this.constructor.intToRGBA(vi);if(this.constructor.colorDiff(wr,Ri)>Ln)break e}yr++}let Hr=!1;if(Lr-=An,yr-=An,gr-=An,xr-=An,Gn){const ni=Math.min(yr,Lr),wi=Math.min(gr,xr);Lr=ni,yr=ni,gr=wi,xr=wi}Lr=Lr>=0?Lr:0,yr=yr>=0?yr:0,gr=gr>=0?gr:0,xr=xr>=0?xr:0;const si=ln-(Lr+yr),_i=En-(xr+gr);return Hr=qn?yr!==0&&gr!==0&&Lr!==0&&xr!==0:yr!==0||gr!==0||Lr!==0||xr!==0,Hr&&this.crop(Lr,gr,si,_i),ve($n)&&$n.call(this,null,this),this}}}},()=>({displace(rn,ln,En){if(typeof rn!="object"||rn.constructor!==this.constructor)return xe.call(this,"The source must be a Jimp image",En);if(typeof ln!="number")return xe.call(this,"factor must be a number",En);const $n=this.cloneQuiet();return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(An,Ln,qn){let Gn=rn.bitmap.data[qn]/256*ln;Gn=Math.round(Gn);const Vn=this.getPixelIndex(An+Gn,Ln);this.bitmap.data[Vn]=$n.bitmap.data[qn],this.bitmap.data[Vn+1]=$n.bitmap.data[qn+1],this.bitmap.data[Vn+2]=$n.bitmap.data[qn+2]}),ve(En)&&En.call(this,null,this),this}}),()=>({dither565:ql,dither16:ql}),()=>({fisheye(){let rn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{r:2.5},ln=arguments.length>1?arguments[1]:void 0;typeof rn=="function"&&(ln=rn,rn={r:2.5});const En=this.cloneQuiet(),{width:$n,height:An}=En.bitmap;return En.scanQuiet(0,0,$n,An,(Ln,qn)=>{const Gn=Ln/$n,Vn=qn/An,ar=Math.sqrt(Math.pow(Gn-.5,2)+Math.pow(Vn-.5,2)),lr=2*Math.pow(ar,rn.r),fr=(Gn-.5)/ar,Or=(Vn-.5)/ar,wr=Math.round((lr*fr+.5)*$n),gr=Math.round((lr*Or+.5)*An),yr=En.getPixelColor(wr,gr);this.setPixelColor(yr,Ln,qn)}),this.setPixelColor(En.getPixelColor($n/2,An/2),$n/2,An/2),ve(ln)&&ln.call(this,null,this),this}}),()=>({flip:Yl,mirror:Yl}),()=>({gaussian(rn,ln){if(typeof rn!="number")return xe.call(this,"r must be a number",ln);if(rn<1)return xe.call(this,"r must be greater than 0",ln);const En=Math.ceil(2.57*rn),$n=2*En+1,An=rn*rn*2,Ln=An*Math.PI,qn=[];for(let Gn=0;Gn<$n;Gn++){qn[Gn]=[];for(let Vn=0;Vn<$n;Vn++){const ar=(Vn-En)**2+(Gn-En)**2;qn[Gn][Vn]=Math.exp(-ar/An)/Ln}}for(let Gn=0;Gn({invert(rn){return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(ln,En,$n){this.bitmap.data[$n]=255-this.bitmap.data[$n],this.bitmap.data[$n+1]=255-this.bitmap.data[$n+1],this.bitmap.data[$n+2]=255-this.bitmap.data[$n+2]}),ve(rn)&&rn.call(this,null,this),this}}),()=>({mask(rn){let ln=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,En=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,$n=arguments.length>3?arguments[3]:void 0;if(!(rn instanceof this.constructor))return xe.call(this,"The source must be a Jimp image",$n);if(typeof ln!="number"||typeof En!="number")return xe.call(this,"x and y must be numbers",$n);ln=Math.round(ln),En=Math.round(En);const An=this.bitmap.width,Ln=this.bitmap.height,qn=this;return rn.scanQuiet(0,0,rn.bitmap.width,rn.bitmap.height,function(Gn,Vn,ar){const lr=ln+Gn,fr=En+Vn;if(lr>=0&&fr>=0&&lr({normalize(rn){const ln=ec.call(this),En={r:Us(ln.r),g:Us(ln.g),b:Us(ln.b)};return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function($n,An,Ln){const qn=this.bitmap.data[Ln+0],Gn=this.bitmap.data[Ln+1],Vn=this.bitmap.data[Ln+2];this.bitmap.data[Ln+0]=Aa(qn,En.r[0],En.r[1]),this.bitmap.data[Ln+1]=Aa(Gn,En.g[0],En.g[1]),this.bitmap.data[Ln+2]=Aa(Vn,En.b[0],En.b[1])}),ve(rn)&&rn.call(this,null,this),this}}),()=>({constants:{measureText:Ls,measureTextHeight:ci,FONT_SANS_8_BLACK:me().join(Uo,"fonts/open-sans/open-sans-8-black/open-sans-8-black.fnt"),FONT_SANS_10_BLACK:me().join(Uo,"fonts/open-sans/open-sans-10-black/open-sans-10-black.fnt"),FONT_SANS_12_BLACK:me().join(Uo,"fonts/open-sans/open-sans-12-black/open-sans-12-black.fnt"),FONT_SANS_14_BLACK:me().join(Uo,"fonts/open-sans/open-sans-14-black/open-sans-14-black.fnt"),FONT_SANS_16_BLACK:me().join(Uo,"fonts/open-sans/open-sans-16-black/open-sans-16-black.fnt"),FONT_SANS_32_BLACK:me().join(Uo,"fonts/open-sans/open-sans-32-black/open-sans-32-black.fnt"),FONT_SANS_64_BLACK:me().join(Uo,"fonts/open-sans/open-sans-64-black/open-sans-64-black.fnt"),FONT_SANS_128_BLACK:me().join(Uo,"fonts/open-sans/open-sans-128-black/open-sans-128-black.fnt"),FONT_SANS_8_WHITE:me().join(Uo,"fonts/open-sans/open-sans-8-white/open-sans-8-white.fnt"),FONT_SANS_16_WHITE:me().join(Uo,"fonts/open-sans/open-sans-16-white/open-sans-16-white.fnt"),FONT_SANS_32_WHITE:me().join(Uo,"fonts/open-sans/open-sans-32-white/open-sans-32-white.fnt"),FONT_SANS_64_WHITE:me().join(Uo,"fonts/open-sans/open-sans-64-white/open-sans-64-white.fnt"),FONT_SANS_128_WHITE:me().join(Uo,"fonts/open-sans/open-sans-128-white/open-sans-128-white.fnt"),loadFont(rn,ln){return typeof rn!="string"?xe.call(this,"file must be a string",ln):new Promise((En,$n)=>{ln=ln||function(An,Ln){An?$n(An):En(Ln)},nc()(rn,(An,Ln)=>{const qn={},Gn={};if(An)return xe.call(this,An,ln);for(let Vn=0;VnVn.read(ar+"/"+Or));return Promise.all(fr)})(this,me().dirname(rn),Ln.pages).then(Vn=>{ln(null,{chars:qn,kernings:Gn,pages:Vn,common:Ln.common,info:Ln.info})})})})}},class:{print(rn,ln,En,$n,An,Ln,qn){if(typeof An=="function"&&qn===void 0&&(qn=An,An=1/0),An===void 0&&(An=1/0),typeof Ln=="function"&&qn===void 0&&(qn=Ln,Ln=1/0),Ln===void 0&&(Ln=1/0),typeof rn!="object")return xe.call(this,"font must be a Jimp loadFont",qn);if(typeof ln!="number"||typeof En!="number"||typeof An!="number")return xe.call(this,"x, y and maxWidth must be numbers",qn);if(typeof An!="number")return xe.call(this,"maxWidth must be a number",qn);if(typeof Ln!="number")return xe.call(this,"maxHeight must be a number",qn);let Gn,Vn;typeof $n=="object"&&$n.text!==null&&$n.text!==void 0?(Gn=$n.alignmentX||this.constructor.HORIZONTAL_ALIGN_LEFT,Vn=$n.alignmentY||this.constructor.VERTICAL_ALIGN_TOP,{text:$n}=$n):(Gn=this.constructor.HORIZONTAL_ALIGN_LEFT,Vn=this.constructor.VERTICAL_ALIGN_TOP,$n=$n.toString()),Ln!==1/0&&Vn===this.constructor.VERTICAL_ALIGN_BOTTOM?En+=Ln-ci(rn,$n,An):Ln!==1/0&&Vn===this.constructor.VERTICAL_ALIGN_MIDDLE&&(En+=Ln/2-ci(rn,$n,An)/2);const ar=Object.entries(rn.chars)[0][1].xadvance,{lines:lr,longestLine:fr}=Xl(rn,$n,An);return lr.forEach(Or=>{const wr=Or.join(" "),gr=function(yr,xr,Lr,Hr,si){return si===yr.HORIZONTAL_ALIGN_LEFT?0:si===yr.HORIZONTAL_ALIGN_CENTER?(Hr-Ls(xr,Lr))/2:Hr-Ls(xr,Lr)}(this.constructor,rn,wr,An,Gn);rc.call(this,rn,ln+gr,En,wr,ar),En+=rn.common.lineHeight}),ve(qn)&&qn.call(this,null,this,{x:ln+fr,y:En}),this}}}),()=>({constants:{RESIZE_NEAREST_NEIGHBOR:"nearestNeighbor",RESIZE_BILINEAR:"bilinearInterpolation",RESIZE_BICUBIC:"bicubicInterpolation",RESIZE_HERMITE:"hermiteInterpolation",RESIZE_BEZIER:"bezierInterpolation"},class:{resize(rn,ln,En,$n){if(typeof rn!="number"||typeof ln!="number")return xe.call(this,"w and h must be numbers",$n);if(typeof En=="function"&&$n===void 0&&($n=En,En=null),rn===this.constructor.AUTO&&ln===this.constructor.AUTO)return xe.call(this,"w and h cannot both be set to auto",$n);if(rn===this.constructor.AUTO&&(rn=this.bitmap.width*(ln/this.bitmap.height)),ln===this.constructor.AUTO&&(ln=this.bitmap.height*(rn/this.bitmap.width)),rn<0||ln<0)return xe.call(this,"w and h must be positive numbers",$n);if(rn=Math.round(rn)||1,ln=Math.round(ln)||1,typeof Ds[En]=="function"){const An={data:Zl.alloc(rn*ln*4),width:rn,height:ln};Ds[En](this.bitmap,An),this.bitmap=An}else{const An=this;new ic(this.bitmap.width,this.bitmap.height,rn,ln,!0,!0,Ln=>{An.bitmap.data=Zl.from(Ln),An.bitmap.width=rn,An.bitmap.height=ln}).resize(this.bitmap.data)}return ve($n)&&$n.call(this,null,this),this}}}),()=>({rotate(rn,ln,En){return ln==null&&(ln=!0),typeof ln=="function"&&En===void 0&&(En=ln,ln=!0),typeof rn!="number"?xe.call(this,"deg must be a number",En):typeof ln!="boolean"&&typeof ln!="string"?xe.call(this,"mode must be a boolean or a string",En):(rn%90!=0||!ln&&this.bitmap.width!==this.bitmap.height&&rn%180!=0?zo.call(this,rn,ln,En):Ya.call(this,rn),ve(En)&&En.call(this,null,this),this)}}),()=>({scale(rn,ln,En){if(typeof rn!="number")return xe.call(this,"f must be a number",En);if(rn<0)return xe.call(this,"f must be a positive number",En);typeof ln=="function"&&En===void 0&&(En=ln,ln=null);const $n=this.bitmap.width*rn,An=this.bitmap.height*rn;return this.resize($n,An,ln),ve(En)&&En.call(this,null,this),this},scaleToFit(rn,ln,En,$n){if(typeof rn!="number"||typeof ln!="number")return xe.call(this,"w and h must be numbers",$n);typeof En=="function"&&$n===void 0&&($n=En,En=null);const An=rn/ln>this.bitmap.width/this.bitmap.height?ln/this.bitmap.height:rn/this.bitmap.width;return this.scale(An,En),ve($n)&&$n.call(this,null,this),this}}),()=>({shadow(){let rn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ln=arguments.length>1?arguments[1]:void 0;typeof rn=="function"&&(ln=rn,rn={});const{opacity:En=.7,size:$n=1.1,x:An=-25,y:Ln=25,blur:qn=5}=rn,Gn=this.clone(),Vn=this.clone();return Vn.scan(0,0,Vn.bitmap.width,Vn.bitmap.height,(ar,lr,fr)=>{Vn.bitmap.data[fr]=0,Vn.bitmap.data[fr+1]=0,Vn.bitmap.data[fr+2]=0,Vn.bitmap.data[fr+3]=Vn.constructor.limit255(Vn.bitmap.data[fr+3]*En),this.bitmap.data[fr]=0,this.bitmap.data[fr+1]=0,this.bitmap.data[fr+2]=0,this.bitmap.data[fr+3]=0}),Vn.resize(Vn.bitmap.width*$n,Vn.bitmap.height*$n).blur(qn),this.composite(Vn,An,Ln),this.composite(Gn,0,0),ve(ln)&&ln.call(this,null,this),this}}),()=>({threshold(rn,ln){let{max:En,replace:$n=255,autoGreyscale:An=!0}=rn;return typeof En!="number"?xe.call(this,"max must be a number",ln):typeof $n!="number"?xe.call(this,"replace must be a number",ln):typeof An!="boolean"?xe.call(this,"autoGreyscale must be a boolean",ln):(En=this.constructor.limit255(En),$n=this.constructor.limit255($n),An&&this.greyscale(),this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,(Ln,qn,Gn)=>{const Vn=this.bitmap.data[Gn]1&&arguments[1]!==void 0?arguments[1]:Un;const En={hasAlpha:{},encoders:{},decoders:{},class:{},constants:{}};function $n(An){Object.entries(An).forEach(Ln=>{let[qn,Gn]=Ln;En[qn]={...En[qn],...Gn}})}rn.types&&(rn.types.forEach(function(An){const Ln=An();Array.isArray(Ln.mime)?mi(...Ln.mime):Object.entries(Ln.mime).forEach(qn=>mi(...qn)),delete Ln.mime,$n(Ln)}),ln.decoders={...ln.decoders,...En.decoders},ln.encoders={...ln.encoders,...En.encoders},ln.hasAlpha={...ln.hasAlpha,...En.hasAlpha}),rn.plugins&&rn.plugins.forEach(function(An){const Ln=An(On)||{};Ln.class||Ln.constants?$n(Ln):$n({class:Ln})}),ua(En.class,ln),aa(En.constants,ln)})({types:[()=>(0,Zn.Ee)(Er(),vr(),{mime:{[Jr]:["bmp"]},constants:{MIME_BMP:Jr,MIME_X_MS_BMP:Zr},decoders:{[Jr]:jr,[Zr]:jr},encoders:{[Jr]:Ur,[Zr]:Ur}},{mime:{[Fi]:["tiff","tif"]},constants:{MIME_TIFF:Fi},decoders:{[Fi]:rn=>{const ln=Pi().decode(rn),En=ln[0];ln.forEach(An=>{Pi().decodeImage(rn,An)});const $n=Pi().toRGBA8(En);return{data:qi.from($n),width:En.t256[0],height:En.t257[0]}}},encoders:{[Fi]:rn=>{const ln=Pi().encodeImage(rn.bitmap.data,rn.bitmap.width,rn.bitmap.height);return qi.from(ln)}}},{mime:{[jo]:["gif"]},constants:{MIME_GIF:jo},decoders:{[jo]:rn=>{const ln=new so.N(rn),En=ti.alloc(ln.width*ln.height*4);return ln.decodeAndBlitFrameRGBA(0,En),{data:En,width:ln.width,height:ln.height}}},encoders:{[jo]:rn=>{const ln=new Ui.BitmapImage(rn.bitmap);Ui.GifUtil.quantizeDekker(ln,256);const En=new Ui.GifFrame(ln);return new Ui.GifCodec().encodeGif([En],{}).then($n=>$n.buffer)}}})],plugins:[rn=>{const ln=zs.map(En=>{let $n=En(rn)||{};return $n.class||$n.constants||($n={class:$n}),$n});return(0,Zn.Ee)(...ln)}]})})()})();const _Jimp=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Jimp=typeof self<"u"&&self.Jimp||_Jimp;function isPlainObject(ne){return(ne==null?void 0:ne.constructor)===Object}var validPathRegex=/^[^.[\]]+(?:\.[^.[\]]+)*(?:\[\d+])*(?:\.[^.[\]]+(?:\[\d+])*)*$/,pathSplitRegex=/\.|(?=\[)/g,matchBracketsRegex=/[[\]]/g;function set$1(ne,oe,ce){if(!validPathRegex.test(oe))throw new Error("Invalid path, look at the examples for the correct format.");const ue=oe.split(pathSplitRegex);let pe=ne;for(let me=0;mejsxRuntimeExports.jsx("img",{src:ne});function Screenshot({screenshot:ne,renderScreenshot:oe=defaultScreenshotRenderer}){const{result:ce,loading:ue}=useAsync(async()=>await(ne==null?void 0:ne()),[ne]);return oe(ce,ue)}function Gallery({onChange:ne}){const oe=usePaper(),[ce]=useScreenshots(),[ue,{set:pe,remove:me}]=useMap$1();reactExports.useEffect(()=>{ne==null||ne(lodashExports$1.values(ue))},[ue]);function ge(ye,ve,xe){ve&&xe?pe(`${ye}`,xe):me(`${ye}`)}return useAsync(async()=>{const ye=lodashExports$1.head(lodashExports$1.values(ce)),ve=await(ye==null?void 0:ye());ve&&ge(0,!0,ve)},[ce]),jsxRuntimeExports.jsx(Scroll,{x:!0,py:2,children:jsxRuntimeExports.jsx(Stack$1,{direction:"row",children:lodashExports$1.values(ce).map((ye,ve)=>jsxRuntimeExports.jsx(Screenshot,{screenshot:ye,renderScreenshot:(xe,_e)=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Box$1,{sx:{minWidth:"320px",height:"320px",flex:0,p:2,"&:not(:last-child)":{pr:1}},children:jsxRuntimeExports.jsxs(Box$1,{sx:{position:"relative",...oe(1),height:"100%"},children:[!!xe&&jsxRuntimeExports.jsx(Box$1,{sx:{backgroundImage:Se=>`linear-gradient(to bottom, ${alpha$1(Se.palette.background.paper,.5)}, transparent), url("${xe}")`,width:"100%",height:"100%",backgroundSize:"cover",backgroundPosition:"center"}}),jsxRuntimeExports.jsx(Box$1,{sx:{position:"absolute",p:1,top:0,left:0},children:jsxRuntimeExports.jsx(FormControlLabel$1,{control:jsxRuntimeExports.jsx(Checkbox$1,{checked:!!ue[ve],disabled:!xe,color:"primary",sx:{ml:1},onChange:(Se,$e)=>ge(ve,$e,xe)}),label:`Viewport ${ve+1}`})}),_e&&jsxRuntimeExports.jsx(Box$1,{sx:{position:"absolute",m:2,top:0,right:0},children:jsxRuntimeExports.jsx(CircularProgress$1,{})})]})})})},ve))})})}const replacements={"*":"star","/":"slash","+":"plus","@":"at","%":"percent","&":"and"};function getFilename(ne=""){return lodashExports$1.kebabCase(lodashExports$1.reduce(lodashExports$1.entries(replacements),(oe,[ce,ue])=>oe.replace(ce,` ${ue} `),ne))||"untitled"}const imageSize=64;async function resizeImage(ne){const oe=await Jimp.read(Buffer.from(ne.split(",")[1],"base64")),ce=oe.getWidth()set(Ae,`workspaceMeta.${$e}`,Re)))}const{save:ge,estimateWorkspaceSize:ye}=useWorkspace(),ve=useLoadingState("general"),xe=useSnackbar(),_e=reactExports.useMemo(ye,[]);async function Se($e){return{...ue,id:nanoid$1(),size:$e,screenshots:await map((ue==null?void 0:ue.screenshots)??[],resizeImage),lastModified:Date.now()}}return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Box$1,{children:jsxRuntimeExports.jsx(Gallery,{onChange:$e=>me("screenshots",$e)})}),jsxRuntimeExports.jsxs(Stack$1,{p:2,gap:2,children:[jsxRuntimeExports.jsx(TextField$1,{...textFieldProps,defaultValue:ue.name,onChange:$e=>me("name",$e.target.value),label:"Name",fullWidth:!0}),jsxRuntimeExports.jsx(TextField$1,{...textFieldProps,minRows:3,defaultValue:ue.description,size:"small",onChange:$e=>me("description",$e.target.value),label:"Description",fullWidth:!0,multiline:!0}),jsxRuntimeExports.jsx(TextField$1,{...textFieldProps,defaultValue:ue.author,size:"small",onChange:$e=>me("author",$e.target.value),label:"Author",fullWidth:!0,multiline:!0}),jsxRuntimeExports.jsx(Box$1,{sx:{pt:2,width:"100%"},children:jsxRuntimeExports.jsx(Button,{sx:{justifyContent:"flex-start",width:"100%",...ne(1)},onClick:()=>ve(async()=>{const $e=getFilename(ue.name),{size:Re}=await ge(!1,$e);download(JSON.stringify(await Se(Re)),`${$e}.workspace.meta`),xe(`Metadata saved, ${$e}.workspace.meta`)}),startIcon:jsxRuntimeExports.jsx(DownloadOutlined,{}),size:"large",children:jsxRuntimeExports.jsxs(Stack$1,{sx:{ml:1},alignItems:"baseline",children:[ue.name||"Untitled",jsxRuntimeExports.jsxs(Type$2,{component:"div",color:"text.secondary",children:[getFilename(ue.name),".workspace"]}),jsxRuntimeExports.jsxs(Type$2,{component:"div",color:"text.secondary",children:[lodashExports$1.ceil(_e/1024/1024,2)," MB"]})]})})})]})]})}function ExportWorkspaceModal(ne){return jsxRuntimeExports.jsxs(Modal,{...ne,children:[jsxRuntimeExports.jsx(ModalAppBar,{onClose:()=>{var oe;return(oe=ne==null?void 0:ne.onClose)==null?void 0:oe.call(ne,{},"backdropClick")},children:jsxRuntimeExports.jsx(Type$2,{component:"div",variant:"h6",children:"Publish Workspace"})}),jsxRuntimeExports.jsx(A,{})]})}const canOpenWindows=!distExports$1.isMobile,alphabet="ABCDEFGHIJKLMNOPQRSTUVWXYZ";function MenuEntry({startIcon:ne,endIcon:oe,label:ce}){return jsxRuntimeExports.jsxs(Stack$1,{direction:"row",gap:1,children:[!!ne&&reactExports.cloneElement(ne,{fontSize:"small",color:"disabled"}),jsxRuntimeExports.jsx("span",{children:ce}),!!oe&&reactExports.cloneElement(oe,{fontSize:"small",color:"disabled"})]})}function useTitleBarVisible(){const[ne,oe]=reactExports.useState(!1),[ce,ue]=reactExports.useState(new DOMRect);return reactExports.useEffect(()=>{if("windowControlsOverlay"in navigator){const pe=()=>{oe(!!navigator.windowControlsOverlay.visible),ue(navigator.windowControlsOverlay.getTitlebarAreaRect())};return navigator.windowControlsOverlay.addEventListener("geometrychange",pe),pe(),()=>navigator.windowControlsOverlay.removeEventListener("geometrychange",pe)}},[oe]),{visible:ne,rect:ce}}const WorkspaceChip=()=>{const ne=useTheme$1(),{index:oe,isPrimary:ce,participants:ue,peers:pe}=useSyncStatus(),me=shades[(oe+1)*2%shades.length],ge=alphabet[oe],ye=getShade(me,ne.palette.mode);return jsxRuntimeExports.jsx(Tooltip$1,{title:`${ce?"Primary":"Secondary"} window, ${ue.length+1} in group`,children:jsxRuntimeExports.jsx(Collapse$1,{in:!!pe.length,orientation:"horizontal",sx:{ml:"0px !important",overflow:"hidden"},children:jsxRuntimeExports.jsx(Chip$1,{size:"small",icon:jsxRuntimeExports.jsx(WorkspacesOutlined,{sx:{color:`${ye} !important`}}),sx:{ml:1,flex:0,WebkitAppRegion:"no-drag",color:ye,background:alpha$1(ye,.08)},label:`Group ${ge}`})})})},TitleBarPlaceholder=()=>{const ne=useTitleBarVisible(),{palette:oe}=useTheme$1(),ce=oe.background.default;return useTitleBar(ce),jsxRuntimeExports.jsx(Box$1,{sx:{bgcolor:"background.default",minHeight:36,width:"100%",height:ne?"env(titlebar-area-height, 50px)":0}})},TitleBar=()=>{const{palette:ne}=useTheme$1(),oe=ne.background.default;useTitleBar(oe);const{save:ce,load:ue}=useWorkspace(),{visible:pe,rect:me}=useTitleBarVisible(),[,ge]=useView(),[ye,ve]=reactExports.useState(!1);function xe(_e){ge(({view:Se})=>({view:{type:"branch",orientation:_e,key:nanoid$1(),children:[{...Se,size:80},{type:"leaf",key:nanoid$1(),content:{type:""},size:20,acceptDrop:!0}]}}))}return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Box$1,{sx:{mx:.5,borderBottom:_e=>`1px solid ${_e.palette.background.default}`,minHeight:36,paddingLeft:"env(titlebar-area-x, 0px)",height:pe?"env(titlebar-area-height, 50px)":0,width:"env(titlebar-area-width, 100%)",WebkitAppRegion:"drag",overflowX:"auto"},children:jsxRuntimeExports.jsx(Scroll,{x:!0,style:{height:"100%"},children:jsxRuntimeExports.jsx(Box$1,{sx:{height:"100%"},children:jsxRuntimeExports.jsxs(Stack$1,{direction:"row",spacing:1,sx:{height:"100%"},alignItems:"center",justifyContent:"flex-start",children:[(!pe||me.x===0)&&jsxRuntimeExports.jsx(Box$1,{sx:{p:1,height:"100%",maxWidth:"min-content",aspectRatio:1},children:jsxRuntimeExports.jsx("img",{src:logo$1,style:{height:"100%"}})}),jsxRuntimeExports.jsx(WorkspaceChip,{}),[{key:"view",items:[{disabled:!canOpenWindows,key:"panel-new-window",type:"action",name:"New window",action:()=>openWindow()},{type:"divider"},{type:"action",key:"panel-new-right",name:"Add view to the right",action:()=>xe("horizontal")},{type:"action",key:"panel-new-bottom",name:"Add view below",action:()=>xe("vertical")},{type:"divider"},{type:"action",name:"Reset layout",key:"panel-reset",action:()=>ge(getDefaultViewTree)},{type:"action",name:"Reload window",key:"panel-reload",action:()=>location.reload()}]},{key:"workspace",items:[{type:"action",name:"Open workspace",key:"workspace-load",action:ue},{type:"action",name:"Save workspace",key:"workspace-save",action:ce},{type:"divider"},{type:"action",name:jsxRuntimeExports.jsx(MenuEntry,{label:"Publish workspace",endIcon:jsxRuntimeExports.jsx(OpenInNewOutlined,{})}),key:"workspace-save-metadata",action:()=>ve(!0)}]},{key:"help",items:[{type:"action",name:"Open repository in GitHub",key:"github",action:()=>open(repository,"_blank")},{type:"action",name:"Changelog",key:"changelog",action:()=>open(`${changelog}/${version}`,"_blank")},{type:"action",name:"Documentation",key:"documentation",action:()=>open(docs,"_blank")}]}].map(({key:_e,items:Se})=>jsxRuntimeExports.jsx(PopupState,{variant:"popover",children:$e=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Menu$1,{...bindMenu($e),children:jsxRuntimeExports.jsx(MenuList$1,{dense:!0,sx:{p:0},children:Se.map((Re,Ae)=>{if(Re.type==="action"){const{name:Ie,key:ke,action:Be}=Re;return jsxRuntimeExports.jsx(MenuItem$1,{disabled:lodashExports$1.get(Re,"disabled"),onClick:()=>{Be==null||Be(),$e.close()},children:Ie},ke)}else return jsxRuntimeExports.jsx(Divider$1,{},Ae)})})}),jsxRuntimeExports.jsx(FeaturePickerButton,{...bindTrigger($e),sx:{WebkitAppRegion:"no-drag",minWidth:"fit-content",p:.5,px:1},children:lodashExports$1.startCase(_e)},_e)]})},_e))]})})})}),jsxRuntimeExports.jsx(ExportWorkspaceModal,{open:ye,onClose:()=>ve(!1)})]})},logo=""+new URL("logo192-5e372a8c.png",import.meta.url).href;function BootstrapService(){const{load:ne}=useWorkspace();return useAsync(async()=>{try{const oe=new URLSearchParams(location.search).get("workspace");if(oe&&isWorkspace(oe)&&isWorkspace(oe)){const ce=oe.split("/").pop()??oe,ue=await fetch(oe);ne(new File([await ue.blob()],ce,{lastModified:lodashExports$1.now()}))}}catch(oe){console.warn(oe)}},[]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{})}function ConnectionsService(){const ne=useSnackbar(),[{remote:oe}]=useSettings(),[,ce]=useConnections(),ue=useLoadingState("connections");return reactExports.useEffect(()=>{let pe=!1,me=[];return ue(async()=>{if(oe!=null&&oe.length){for(const{transport:ge,url:ye,disabled:ve}of oe){if(ve!==!0){ne(`Connecting to ${ye}...`);const xe=new(getTransport(ge))({url:ye});await xe.connect();const{result:_e,delta:Se}=await timed(()=>xe.call("about"));_e?(ne(`Connected to ${_e.name}`),me=[...me,{..._e,url:ye,ping:Se,transport:()=>xe}]):await xe.disconnect()}pe||ce(()=>me)}pe||ne(`Connected to ${me.length} of ${oe.length} solvers`)}}),()=>{pe=!0,me.map(ge=>ge.transport().disconnect())}},[JSON.stringify(oe),ce,ne,ue]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{})}function withSource(ne){return oe=>({...oe,source:ne})}const getFeatures=async({transport:ne,url:oe})=>lodashExports$1.chain(await map(["algorithms","formats","maps","traces"],async ce=>{const{result:ue}=await timed(()=>ne().call(`features/${ce}`),1e3);return{prop:ce,result:lodashExports$1.map(ue,withSource(oe))}})).keyBy("prop").mapValues("result").value();function FeaturesService(){const[ne]=useConnections(),[,oe]=useFeatures(),[{connections:ce}]=useLoading(),ue=useLoadingState("features");return useAsyncAbortable(async pe=>{ue(async()=>{if(!ce){const me={default:{algorithms:[],formats:lodashExports$1.keys(mapParsers).map(ye=>({id:ye,source:"internal"})),traces:[],maps:[]}},ge=()=>{if(!pe.aborted){const ye=lodashExports$1.chain(me).values().reduce((ve,xe)=>lodashExports$1.mergeWith({},ve,xe,(_e,Se)=>lodashExports$1.isArray(_e)?lodashExports$1.uniqBy([..._e,...Se],"id"):void 0)).value();oe(()=>ye)}};for(const ye of ne){const ve=async()=>{me[ye.url]=await getFeatures(ye),ge()};ye.transport().on("features/changed",ve),ve()}}})},[ne,getFeatures,oe,ce]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{})}function useLayerServices(){const{isPrimary:ne}=useSyncStatus(),[{layers:oe},ce,,ue]=useLayers();return reactExports.useMemo(()=>ne?lodashExports$1.map(oe,pe=>{const me=getController(pe).service;if(me)return reactExports.createElement(me,{key:pe.key,value:pe,onChange:ge=>ce(({layers:ye})=>({layers:lodashExports$1.map(ye,ve=>ve.key===pe.key?ge(ve):ve)}))})}):[],[ue,ce,ne])}function LayerService(){const ne=useLayerServices();return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:ne})}var dist={},ConsoleCapture$1={},logs={};Object.defineProperty(logs,"__esModule",{value:!0});logs.overridableFunctionNames=void 0;logs.overridableFunctionNames=["log","warn","info","debug","error"];Object.defineProperty(ConsoleCapture$1,"__esModule",{value:!0});ConsoleCapture$1.ConsoleCapture=void 0;var logs_1=logs;console.original={};var ConsoleCapture=function(){function ne(){ne.captures=[]}return ne.saveLog=function(oe,ce){var ue=ce.map(function(pe){return typeof pe=="object"?pe instanceof Error?JSON.stringify(pe,Object.getOwnPropertyNames(pe)):JSON.stringify(pe):pe});ne.captures.push({function:oe,args:ue,ts:Date.now()})},ne.setNewFunctions=function(oe){oe===void 0&&(oe=!1);var ce={apply:function(ue,pe,me){if(ne.saveLog(ue.name,me),ue.bind(pe),oe)return ue.apply(void 0,me)}};logs_1.overridableFunctionNames.forEach(function(ue){ne.consoleOverriden||(console.original[ue]=console[ue]),console[ue]=new Proxy(console[ue],ce)}),ne.consoleOverriden=!0},ne.resetToOriginalFunctions=function(){ne.consoleOverriden&&logs_1.overridableFunctionNames.forEach(function(oe){console[oe]=console.original[oe]}),ne.consoleOverriden=!1},ne.prototype.start=function(oe){oe===void 0&&(oe=!1),ne.captures=[],ne.setNewFunctions(oe)},ne.prototype.stop=function(){ne.resetToOriginalFunctions()},ne.prototype.flush=function(){ne.captures=[]},ne.prototype.getCaptures=function(){return ne.captures},ne.makeOriginalLog=function(oe){if(ne.resetToOriginalFunctions(),logs_1.overridableFunctionNames.includes(oe.function)){var ce=oe.args.map(function(ue){if(typeof ue=="string")try{var pe=JSON.parse(ue);return pe.stack?pe.stack:pe}catch{return ue}return ue});console[oe.function].apply(console,ce)}else throw Error("Invalid Log type")},ne.consoleOverriden=!1,ne}();ConsoleCapture$1.ConsoleCapture=ConsoleCapture;Object.defineProperty(dist,"__esModule",{value:!0});var ConsoleCapture_1=ConsoleCapture$1;dist.default=ConsoleCapture_1.ConsoleCapture;function LogCaptureService(){return useSnackbar(),reactExports.useEffect(()=>{},[]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{})}function SettingsService(){const[{"behaviour/showOnStart":ne},,oe]=useSettings(),[,ce]=useUIState();return reactExports.useEffect(()=>{const ue=new URLSearchParams(location.search).get("workspace");!minimal&&ne&&oe&&!ue&&ce(()=>({fullscreenModal:ne}))},[oe,minimal]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{})}function SliceProvider({slices:ne,children:oe,services:ce}){return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:lodashExports$1.reduce(lodashExports$1.map(ne,ue=>reactExports.createElement(ue)),(ue,pe)=>reactExports.cloneElement(pe,{},ue),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[oe,lodashExports$1.map(ce,(ue,pe)=>reactExports.createElement(ue,{key:pe}))]}))})}const services=[SyncService,ConnectionsService,FeaturesService,RendererService,LayerService,LogCaptureService,SettingsService,BootstrapService];function App(){const{palette:ne}=useTheme$1(),oe=ne.background.default,{loading:ce}=useSyncStatus();return jsxRuntimeExports.jsx(Flex,{vertical:!0,sx:{bgcolor:oe,color:"text.primary",WebkitAppRegion:"no-drag"},children:ce?minimal?jsxRuntimeExports.jsx(Fade$1,{in:!0,children:jsxRuntimeExports.jsxs(Stack$1,{sx:{WebkitAppRegion:"drag",background:ue=>ue.palette.background.paper,width:"100vw",height:"100dvh"},children:[jsxRuntimeExports.jsx(TitleBarPlaceholder,{}),jsxRuntimeExports.jsx(Placeholder$2,{icon:jsxRuntimeExports.jsx(CircularProgress$1,{})})]})}):jsxRuntimeExports.jsx(Fade$1,{in:!0,children:jsxRuntimeExports.jsxs(Stack$1,{sx:{WebkitAppRegion:"drag",width:"100vw",height:"100dvh",alignItems:"center",justifyContent:"center",gap:6},children:[jsxRuntimeExports.jsx(Image$1,{src:logo,style:{height:64,width:64}}),jsxRuntimeExports.jsx(CircularProgress$1,{})]})}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(TitleBar,{}),jsxRuntimeExports.jsx(Flex,{flex:1,children:jsxRuntimeExports.jsx(Inspector,{flex:1})})]})})}function ThemedApp(){const[{"appearance/theme":ne="dark","appearance/accentColor":oe="teal"}]=useSettings(),ce=reactExports.useMemo(()=>makeTheme(ne,oe),[ne,oe]);return jsxRuntimeExports.jsx(ThemeProvider,{theme:ce,children:jsxRuntimeExports.jsx(CssBaseline,{children:jsxRuntimeExports.jsx(SnackbarProvider,{children:jsxRuntimeExports.jsx(SliceProvider,{services,children:jsxRuntimeExports.jsx(App,{})})})})})}const index$1="",overlayscrollbars="";var client={exports:{}},reactDomClient_production={},scheduler={exports:{}},scheduler_production={};/** * @license React * scheduler.production.js * diff --git a/assets/parseTrace.worker-46466b88.js b/assets/parseTrace.worker-46466b88.js deleted file mode 100644 index cbc38e6..0000000 --- a/assets/parseTrace.worker-46466b88.js +++ /dev/null @@ -1,27 +0,0 @@ -(function(){"use strict";var Ke=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},vt={exports:{}};/** - * @license - * Lodash - * Copyright OpenJS Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */vt.exports,function(h,w){(function(){var f,T="4.17.21",C=200,R="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",O="Expected a function",k="Invalid `variable` option passed into `_.template`",Z="__lodash_hash_undefined__",N=500,j="__lodash_placeholder__",an=1,G=2,z=4,pn=1,ln=2,P=1,_n=2,W=4,A=8,D=16,Y=32,J=64,nn=128,sn=256,Br=512,Cs=30,Ls="...",Ps=800,Ws=16,Uu=1,Fs=2,Ms=3,de=1/0,oe=9007199254740991,Bs=17976931348623157e292,mt=0/0,Yn=4294967295,Us=Yn-1,Ds=Yn>>>1,qs=[["ary",nn],["bind",P],["bindKey",_n],["curry",A],["curryRight",D],["flip",Br],["partial",Y],["partialRight",J],["rearg",sn]],Ee="[object Arguments]",xt="[object Array]",$s="[object AsyncFunction]",Xe="[object Boolean]",Je="[object Date]",Ns="[object DOMException]",yt="[object Error]",At="[object Function]",Du="[object GeneratorFunction]",Nn="[object Map]",Qe="[object Number]",Gs="[object Null]",Vn="[object Object]",qu="[object Promise]",Hs="[object Proxy]",Ve="[object RegExp]",Gn="[object Set]",ke="[object String]",St="[object Symbol]",zs="[object Undefined]",je="[object WeakMap]",Ks="[object WeakSet]",nt="[object ArrayBuffer]",Ce="[object DataView]",Ur="[object Float32Array]",Dr="[object Float64Array]",qr="[object Int8Array]",$r="[object Int16Array]",Nr="[object Int32Array]",Gr="[object Uint8Array]",Hr="[object Uint8ClampedArray]",zr="[object Uint16Array]",Kr="[object Uint32Array]",Zs=/\b__p \+= '';/g,Ys=/\b(__p \+=) '' \+/g,Xs=/(__e\(.*?\)|\b__t\)) \+\n'';/g,$u=/&(?:amp|lt|gt|quot|#39);/g,Nu=/[&<>"']/g,Js=RegExp($u.source),Qs=RegExp(Nu.source),Vs=/<%-([\s\S]+?)%>/g,ks=/<%([\s\S]+?)%>/g,Gu=/<%=([\s\S]+?)%>/g,js=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,nl=/^\w*$/,el=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Zr=/[\\^$.*+?()[\]{}|]/g,tl=RegExp(Zr.source),Yr=/^\s+/,rl=/\s/,il=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ul=/\{\n\/\* \[wrapped with (.+)\] \*/,fl=/,? & /,ol=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,al=/[()=,{}\[\]\/\s]/,sl=/\\(\\)?/g,ll=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Hu=/\w*$/,cl=/^[-+]0x[0-9a-f]+$/i,hl=/^0b[01]+$/i,gl=/^\[object .+?Constructor\]$/,pl=/^0o[0-7]+$/i,_l=/^(?:0|[1-9]\d*)$/,vl=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,bt=/($^)/,dl=/['\n\r\u2028\u2029\\]/g,It="\\ud800-\\udfff",wl="\\u0300-\\u036f",ml="\\ufe20-\\ufe2f",xl="\\u20d0-\\u20ff",zu=wl+ml+xl,Ku="\\u2700-\\u27bf",Zu="a-z\\xdf-\\xf6\\xf8-\\xff",yl="\\xac\\xb1\\xd7\\xf7",Al="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Sl="\\u2000-\\u206f",bl=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Yu="A-Z\\xc0-\\xd6\\xd8-\\xde",Xu="\\ufe0e\\ufe0f",Ju=yl+Al+Sl+bl,Xr="['’]",Il="["+It+"]",Qu="["+Ju+"]",Rt="["+zu+"]",Vu="\\d+",Rl="["+Ku+"]",ku="["+Zu+"]",ju="[^"+It+Ju+Vu+Ku+Zu+Yu+"]",Jr="\\ud83c[\\udffb-\\udfff]",Tl="(?:"+Rt+"|"+Jr+")",nf="[^"+It+"]",Qr="(?:\\ud83c[\\udde6-\\uddff]){2}",Vr="[\\ud800-\\udbff][\\udc00-\\udfff]",Le="["+Yu+"]",ef="\\u200d",tf="(?:"+ku+"|"+ju+")",Ol="(?:"+Le+"|"+ju+")",rf="(?:"+Xr+"(?:d|ll|m|re|s|t|ve))?",uf="(?:"+Xr+"(?:D|LL|M|RE|S|T|VE))?",ff=Tl+"?",of="["+Xu+"]?",El="(?:"+ef+"(?:"+[nf,Qr,Vr].join("|")+")"+of+ff+")*",Cl="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ll="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",af=of+ff+El,Pl="(?:"+[Rl,Qr,Vr].join("|")+")"+af,Wl="(?:"+[nf+Rt+"?",Rt,Qr,Vr,Il].join("|")+")",Fl=RegExp(Xr,"g"),Ml=RegExp(Rt,"g"),kr=RegExp(Jr+"(?="+Jr+")|"+Wl+af,"g"),Bl=RegExp([Le+"?"+ku+"+"+rf+"(?="+[Qu,Le,"$"].join("|")+")",Ol+"+"+uf+"(?="+[Qu,Le+tf,"$"].join("|")+")",Le+"?"+tf+"+"+rf,Le+"+"+uf,Ll,Cl,Vu,Pl].join("|"),"g"),Ul=RegExp("["+ef+It+zu+Xu+"]"),Dl=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ql=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],$l=-1,en={};en[Ur]=en[Dr]=en[qr]=en[$r]=en[Nr]=en[Gr]=en[Hr]=en[zr]=en[Kr]=!0,en[Ee]=en[xt]=en[nt]=en[Xe]=en[Ce]=en[Je]=en[yt]=en[At]=en[Nn]=en[Qe]=en[Vn]=en[Ve]=en[Gn]=en[ke]=en[je]=!1;var V={};V[Ee]=V[xt]=V[nt]=V[Ce]=V[Xe]=V[Je]=V[Ur]=V[Dr]=V[qr]=V[$r]=V[Nr]=V[Nn]=V[Qe]=V[Vn]=V[Ve]=V[Gn]=V[ke]=V[St]=V[Gr]=V[Hr]=V[zr]=V[Kr]=!0,V[yt]=V[At]=V[je]=!1;var Nl={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Gl={"&":"&","<":"<",">":">",'"':""","'":"'"},Hl={"&":"&","<":"<",">":">",""":'"',"'":"'"},zl={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Kl=parseFloat,Zl=parseInt,sf=typeof Ke=="object"&&Ke&&Ke.Object===Object&&Ke,Yl=typeof self=="object"&&self&&self.Object===Object&&self,vn=sf||Yl||Function("return this")(),jr=w&&!w.nodeType&&w,we=jr&&!0&&h&&!h.nodeType&&h,lf=we&&we.exports===jr,ni=lf&&sf.process,Wn=function(){try{var l=we&&we.require&&we.require("util").types;return l||ni&&ni.binding&&ni.binding("util")}catch{}}(),cf=Wn&&Wn.isArrayBuffer,hf=Wn&&Wn.isDate,gf=Wn&&Wn.isMap,pf=Wn&&Wn.isRegExp,_f=Wn&&Wn.isSet,vf=Wn&&Wn.isTypedArray;function Tn(l,p,g){switch(g.length){case 0:return l.call(p);case 1:return l.call(p,g[0]);case 2:return l.call(p,g[0],g[1]);case 3:return l.call(p,g[0],g[1],g[2])}return l.apply(p,g)}function Xl(l,p,g,x){for(var E=-1,H=l==null?0:l.length;++E-1}function ei(l,p,g){for(var x=-1,E=l==null?0:l.length;++x-1;);return g}function bf(l,p){for(var g=l.length;g--&&Pe(p,l[g],0)>-1;);return g}function rc(l,p){for(var g=l.length,x=0;g--;)l[g]===p&&++x;return x}var ic=ui(Nl),uc=ui(Gl);function fc(l){return"\\"+zl[l]}function oc(l,p){return l==null?f:l[p]}function We(l){return Ul.test(l)}function ac(l){return Dl.test(l)}function sc(l){for(var p,g=[];!(p=l.next()).done;)g.push(p.value);return g}function si(l){var p=-1,g=Array(l.size);return l.forEach(function(x,E){g[++p]=[E,x]}),g}function If(l,p){return function(g){return l(p(g))}}function le(l,p){for(var g=-1,x=l.length,E=0,H=[];++g-1}function Qc(n,e){var t=this.__data__,r=zt(t,n);return r<0?(++this.size,t.push([n,e])):t[r][1]=e,this}kn.prototype.clear=Zc,kn.prototype.delete=Yc,kn.prototype.get=Xc,kn.prototype.has=Jc,kn.prototype.set=Qc;function jn(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e=e?n:e)),n}function Un(n,e,t,r,i,o){var a,s=e&an,c=e&G,_=e&z;if(t&&(a=i?t(n,r,i,o):t(n)),a!==f)return a;if(!rn(n))return n;var v=L(n);if(v){if(a=ng(n),!s)return Sn(n,a)}else{var d=mn(n),m=d==At||d==Du;if(ve(n))return oo(n,s);if(d==Vn||d==Ee||m&&!i){if(a=c||m?{}:To(n),!s)return c?Hh(n,hh(a,n)):Gh(n,Uf(a,n))}else{if(!V[d])return i?n:{};a=eg(n,d,s)}}o||(o=new zn);var y=o.get(n);if(y)return y;o.set(n,a),ta(n)?n.forEach(function(I){a.add(Un(I,e,t,I,n,o))}):na(n)&&n.forEach(function(I,U){a.set(U,Un(I,e,t,U,n,o))});var b=_?c?Mi:Fi:c?In:gn,M=v?f:b(n);return Fn(M||n,function(I,U){M&&(U=I,I=n[U]),ot(a,U,Un(I,e,t,U,n,o))}),a}function gh(n){var e=gn(n);return function(t){return Df(t,n,e)}}function Df(n,e,t){var r=t.length;if(n==null)return!r;for(n=Q(n);r--;){var i=t[r],o=e[i],a=n[i];if(a===f&&!(i in n)||!o(a))return!1}return!0}function qf(n,e,t){if(typeof n!="function")throw new Mn(O);return pt(function(){n.apply(f,t)},e)}function at(n,e,t,r){var i=-1,o=Tt,a=!0,s=n.length,c=[],_=e.length;if(!s)return c;t&&(e=tn(e,On(t))),r?(o=ei,a=!1):e.length>=C&&(o=et,a=!1,e=new ye(e));n:for(;++ii?0:i+t),r=r===f||r>i?i:F(r),r<0&&(r+=i),r=t>r?0:ia(r);t0&&t(s)?e>1?dn(s,e-1,t,r,i):se(i,s):r||(i[i.length]=s)}return i}var vi=go(),Gf=go(!0);function Xn(n,e){return n&&vi(n,e,gn)}function di(n,e){return n&&Gf(n,e,gn)}function Zt(n,e){return ae(e,function(t){return ie(n[t])})}function Se(n,e){e=pe(e,n);for(var t=0,r=e.length;n!=null&&te}function vh(n,e){return n!=null&&X.call(n,e)}function dh(n,e){return n!=null&&e in Q(n)}function wh(n,e,t){return n>=wn(e,t)&&n=120&&v.length>=120)?new ye(a&&v):f}v=n[0];var d=-1,m=s[0];n:for(;++d-1;)s!==n&&Ut.call(s,c,1),Ut.call(n,c,1);return n}function jf(n,e){for(var t=n?e.length:0,r=t-1;t--;){var i=e[t];if(t==r||i!==o){var o=i;re(i)?Ut.call(n,i,1):Ti(n,i)}}return n}function bi(n,e){return n+$t(Wf()*(e-n+1))}function Lh(n,e,t,r){for(var i=-1,o=hn(qt((e-n)/(t||1)),0),a=g(o);o--;)a[r?o:++i]=n,n+=t;return a}function Ii(n,e){var t="";if(!n||e<1||e>oe)return t;do e%2&&(t+=n),e=$t(e/2),e&&(n+=n);while(e);return t}function B(n,e){return Gi(Co(n,e,Rn),n+"")}function Ph(n){return Bf(ze(n))}function Wh(n,e){var t=ze(n);return rr(t,Ae(e,0,t.length))}function ct(n,e,t,r){if(!rn(n))return n;e=pe(e,n);for(var i=-1,o=e.length,a=o-1,s=n;s!=null&&++ii?0:i+e),t=t>i?i:t,t<0&&(t+=i),i=e>t?0:t-e>>>0,e>>>=0;for(var o=g(i);++r>>1,a=n[o];a!==null&&!Cn(a)&&(t?a<=e:a=C){var _=e?null:Yh(n);if(_)return Et(_);a=!1,i=et,c=new ye}else c=e?[]:s;n:for(;++r=r?n:Dn(n,e,t)}var fo=bc||function(n){return vn.clearTimeout(n)};function oo(n,e){if(e)return n.slice();var t=n.length,r=Of?Of(t):new n.constructor(t);return n.copy(r),r}function Li(n){var e=new n.constructor(n.byteLength);return new Mt(e).set(new Mt(n)),e}function Dh(n,e){var t=e?Li(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.byteLength)}function qh(n){var e=new n.constructor(n.source,Hu.exec(n));return e.lastIndex=n.lastIndex,e}function $h(n){return ft?Q(ft.call(n)):{}}function ao(n,e){var t=e?Li(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.length)}function so(n,e){if(n!==e){var t=n!==f,r=n===null,i=n===n,o=Cn(n),a=e!==f,s=e===null,c=e===e,_=Cn(e);if(!s&&!_&&!o&&n>e||o&&a&&c&&!s&&!_||r&&a&&c||!t&&c||!i)return 1;if(!r&&!o&&!_&&n=s)return c;var _=t[r];return c*(_=="desc"?-1:1)}}return n.index-e.index}function lo(n,e,t,r){for(var i=-1,o=n.length,a=t.length,s=-1,c=e.length,_=hn(o-a,0),v=g(c+_),d=!r;++s1?t[i-1]:f,a=i>2?t[2]:f;for(o=n.length>3&&typeof o=="function"?(i--,o):f,a&&yn(t[0],t[1],a)&&(o=i<3?f:o,i=1),e=Q(e);++r-1?i[o?e[a]:a]:f}}function vo(n){return te(function(e){var t=e.length,r=t,i=Bn.prototype.thru;for(n&&e.reverse();r--;){var o=e[r];if(typeof o!="function")throw new Mn(O);if(i&&!a&&er(o)=="wrapper")var a=new Bn([],!0)}for(r=a?r:t;++r1&&$.reverse(),v&&cs))return!1;var _=o.get(n),v=o.get(e);if(_&&v)return _==e&&v==n;var d=-1,m=!0,y=t&ln?new ye:f;for(o.set(n,e),o.set(e,n);++d1?"& ":"")+e[r],e=e.join(t>2?", ":" "),n.replace(il,`{ -/* [wrapped with `+e+`] */ -`)}function rg(n){return L(n)||Re(n)||!!(Lf&&n&&n[Lf])}function re(n,e){var t=typeof n;return e=e??oe,!!e&&(t=="number"||t!="symbol"&&_l.test(n))&&n>-1&&n%1==0&&n0){if(++e>=Ps)return arguments[0]}else e=0;return n.apply(f,arguments)}}function rr(n,e){var t=-1,r=n.length,i=r-1;for(e=e===f?r:e;++t1?n[e-1]:f;return t=typeof t=="function"?(n.pop(),t):f,Go(n,t)});function Ho(n){var e=u(n);return e.__chain__=!0,e}function pp(n,e){return e(n),n}function ir(n,e){return e(n)}var _p=te(function(n){var e=n.length,t=e?n[0]:0,r=this.__wrapped__,i=function(o){return _i(o,n)};return e>1||this.__actions__.length||!(r instanceof q)||!re(t)?this.thru(i):(r=r.slice(t,+t+(e?1:0)),r.__actions__.push({func:ir,args:[i],thisArg:f}),new Bn(r,this.__chain__).thru(function(o){return e&&!o.length&&o.push(f),o}))});function vp(){return Ho(this)}function dp(){return new Bn(this.value(),this.__chain__)}function wp(){this.__values__===f&&(this.__values__=ra(this.value()));var n=this.__index__>=this.__values__.length,e=n?f:this.__values__[this.__index__++];return{done:n,value:e}}function mp(){return this}function xp(n){for(var e,t=this;t instanceof Ht;){var r=Bo(t);r.__index__=0,r.__values__=f,e?i.__wrapped__=r:e=r;var i=r;t=t.__wrapped__}return i.__wrapped__=n,e}function yp(){var n=this.__wrapped__;if(n instanceof q){var e=n;return this.__actions__.length&&(e=new q(this)),e=e.reverse(),e.__actions__.push({func:ir,args:[Hi],thisArg:f}),new Bn(e,this.__chain__)}return this.thru(Hi)}function Ap(){return io(this.__wrapped__,this.__actions__)}var Sp=Qt(function(n,e,t){X.call(n,t)?++n[t]:ne(n,t,1)});function bp(n,e,t){var r=L(n)?df:ph;return t&&yn(n,e,t)&&(e=f),r(n,S(e,3))}function Ip(n,e){var t=L(n)?ae:Nf;return t(n,S(e,3))}var Rp=_o(Uo),Tp=_o(Do);function Op(n,e){return dn(ur(n,e),1)}function Ep(n,e){return dn(ur(n,e),de)}function Cp(n,e,t){return t=t===f?1:F(t),dn(ur(n,e),t)}function zo(n,e){var t=L(n)?Fn:he;return t(n,S(e,3))}function Ko(n,e){var t=L(n)?Jl:$f;return t(n,S(e,3))}var Lp=Qt(function(n,e,t){X.call(n,t)?n[t].push(e):ne(n,t,[e])});function Pp(n,e,t,r){n=bn(n)?n:ze(n),t=t&&!r?F(t):0;var i=n.length;return t<0&&(t=hn(i+t,0)),lr(n)?t<=i&&n.indexOf(e,t)>-1:!!i&&Pe(n,e,t)>-1}var Wp=B(function(n,e,t){var r=-1,i=typeof e=="function",o=bn(n)?g(n.length):[];return he(n,function(a){o[++r]=i?Tn(e,a,t):st(a,e,t)}),o}),Fp=Qt(function(n,e,t){ne(n,t,e)});function ur(n,e){var t=L(n)?tn:Yf;return t(n,S(e,3))}function Mp(n,e,t,r){return n==null?[]:(L(e)||(e=e==null?[]:[e]),t=r?f:t,L(t)||(t=t==null?[]:[t]),Vf(n,e,t))}var Bp=Qt(function(n,e,t){n[t?0:1].push(e)},function(){return[[],[]]});function Up(n,e,t){var r=L(n)?ti:yf,i=arguments.length<3;return r(n,S(e,4),t,i,he)}function Dp(n,e,t){var r=L(n)?Ql:yf,i=arguments.length<3;return r(n,S(e,4),t,i,$f)}function qp(n,e){var t=L(n)?ae:Nf;return t(n,ar(S(e,3)))}function $p(n){var e=L(n)?Bf:Ph;return e(n)}function Np(n,e,t){(t?yn(n,e,t):e===f)?e=1:e=F(e);var r=L(n)?sh:Wh;return r(n,e)}function Gp(n){var e=L(n)?lh:Mh;return e(n)}function Hp(n){if(n==null)return 0;if(bn(n))return lr(n)?Fe(n):n.length;var e=mn(n);return e==Nn||e==Gn?n.size:yi(n).length}function zp(n,e,t){var r=L(n)?ri:Bh;return t&&yn(n,e,t)&&(e=f),r(n,S(e,3))}var Kp=B(function(n,e){if(n==null)return[];var t=e.length;return t>1&&yn(n,e[0],e[1])?e=[]:t>2&&yn(e[0],e[1],e[2])&&(e=[e[0]]),Vf(n,dn(e,1),[])}),fr=Ic||function(){return vn.Date.now()};function Zp(n,e){if(typeof e!="function")throw new Mn(O);return n=F(n),function(){if(--n<1)return e.apply(this,arguments)}}function Zo(n,e,t){return e=t?f:e,e=n&&e==null?n.length:e,ee(n,nn,f,f,f,f,e)}function Yo(n,e){var t;if(typeof e!="function")throw new Mn(O);return n=F(n),function(){return--n>0&&(t=e.apply(this,arguments)),n<=1&&(e=f),t}}var Ki=B(function(n,e,t){var r=P;if(t.length){var i=le(t,Ge(Ki));r|=Y}return ee(n,r,e,t,i)}),Xo=B(function(n,e,t){var r=P|_n;if(t.length){var i=le(t,Ge(Xo));r|=Y}return ee(e,r,n,t,i)});function Jo(n,e,t){e=t?f:e;var r=ee(n,A,f,f,f,f,f,e);return r.placeholder=Jo.placeholder,r}function Qo(n,e,t){e=t?f:e;var r=ee(n,D,f,f,f,f,f,e);return r.placeholder=Qo.placeholder,r}function Vo(n,e,t){var r,i,o,a,s,c,_=0,v=!1,d=!1,m=!0;if(typeof n!="function")throw new Mn(O);e=$n(e)||0,rn(t)&&(v=!!t.leading,d="maxWait"in t,o=d?hn($n(t.maxWait)||0,e):o,m="trailing"in t?!!t.trailing:m);function y(on){var Zn=r,fe=i;return r=i=f,_=on,a=n.apply(fe,Zn),a}function b(on){return _=on,s=pt(U,e),v?y(on):a}function M(on){var Zn=on-c,fe=on-_,va=e-Zn;return d?wn(va,o-fe):va}function I(on){var Zn=on-c,fe=on-_;return c===f||Zn>=e||Zn<0||d&&fe>=o}function U(){var on=fr();if(I(on))return $(on);s=pt(U,M(on))}function $(on){return s=f,m&&r?y(on):(r=i=f,a)}function Ln(){s!==f&&fo(s),_=0,r=c=i=s=f}function An(){return s===f?a:$(fr())}function Pn(){var on=fr(),Zn=I(on);if(r=arguments,i=this,c=on,Zn){if(s===f)return b(c);if(d)return fo(s),s=pt(U,e),y(c)}return s===f&&(s=pt(U,e)),a}return Pn.cancel=Ln,Pn.flush=An,Pn}var Yp=B(function(n,e){return qf(n,1,e)}),Xp=B(function(n,e,t){return qf(n,$n(e)||0,t)});function Jp(n){return ee(n,Br)}function or(n,e){if(typeof n!="function"||e!=null&&typeof e!="function")throw new Mn(O);var t=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=t.cache;if(o.has(i))return o.get(i);var a=n.apply(this,r);return t.cache=o.set(i,a)||o,a};return t.cache=new(or.Cache||jn),t}or.Cache=jn;function ar(n){if(typeof n!="function")throw new Mn(O);return function(){var e=arguments;switch(e.length){case 0:return!n.call(this);case 1:return!n.call(this,e[0]);case 2:return!n.call(this,e[0],e[1]);case 3:return!n.call(this,e[0],e[1],e[2])}return!n.apply(this,e)}}function Qp(n){return Yo(2,n)}var Vp=Uh(function(n,e){e=e.length==1&&L(e[0])?tn(e[0],On(S())):tn(dn(e,1),On(S()));var t=e.length;return B(function(r){for(var i=-1,o=wn(r.length,t);++i=e}),Re=zf(function(){return arguments}())?zf:function(n){return un(n)&&X.call(n,"callee")&&!Cf.call(n,"callee")},L=g.isArray,h_=cf?On(cf):xh;function bn(n){return n!=null&&sr(n.length)&&!ie(n)}function fn(n){return un(n)&&bn(n)}function g_(n){return n===!0||n===!1||un(n)&&xn(n)==Xe}var ve=Tc||ru,p_=hf?On(hf):yh;function __(n){return un(n)&&n.nodeType===1&&!_t(n)}function v_(n){if(n==null)return!0;if(bn(n)&&(L(n)||typeof n=="string"||typeof n.splice=="function"||ve(n)||He(n)||Re(n)))return!n.length;var e=mn(n);if(e==Nn||e==Gn)return!n.size;if(gt(n))return!yi(n).length;for(var t in n)if(X.call(n,t))return!1;return!0}function d_(n,e){return lt(n,e)}function w_(n,e,t){t=typeof t=="function"?t:f;var r=t?t(n,e):f;return r===f?lt(n,e,f,t):!!r}function Yi(n){if(!un(n))return!1;var e=xn(n);return e==yt||e==Ns||typeof n.message=="string"&&typeof n.name=="string"&&!_t(n)}function m_(n){return typeof n=="number"&&Pf(n)}function ie(n){if(!rn(n))return!1;var e=xn(n);return e==At||e==Du||e==$s||e==Hs}function jo(n){return typeof n=="number"&&n==F(n)}function sr(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=oe}function rn(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}function un(n){return n!=null&&typeof n=="object"}var na=gf?On(gf):Sh;function x_(n,e){return n===e||xi(n,e,Ui(e))}function y_(n,e,t){return t=typeof t=="function"?t:f,xi(n,e,Ui(e),t)}function A_(n){return ea(n)&&n!=+n}function S_(n){if(fg(n))throw new E(R);return Kf(n)}function b_(n){return n===null}function I_(n){return n==null}function ea(n){return typeof n=="number"||un(n)&&xn(n)==Qe}function _t(n){if(!un(n)||xn(n)!=Vn)return!1;var e=Bt(n);if(e===null)return!0;var t=X.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&Pt.call(t)==yc}var Xi=pf?On(pf):bh;function R_(n){return jo(n)&&n>=-oe&&n<=oe}var ta=_f?On(_f):Ih;function lr(n){return typeof n=="string"||!L(n)&&un(n)&&xn(n)==ke}function Cn(n){return typeof n=="symbol"||un(n)&&xn(n)==St}var He=vf?On(vf):Rh;function T_(n){return n===f}function O_(n){return un(n)&&mn(n)==je}function E_(n){return un(n)&&xn(n)==Ks}var C_=nr(Ai),L_=nr(function(n,e){return n<=e});function ra(n){if(!n)return[];if(bn(n))return lr(n)?Hn(n):Sn(n);if(tt&&n[tt])return sc(n[tt]());var e=mn(n),t=e==Nn?si:e==Gn?Et:ze;return t(n)}function ue(n){if(!n)return n===0?n:0;if(n=$n(n),n===de||n===-de){var e=n<0?-1:1;return e*Bs}return n===n?n:0}function F(n){var e=ue(n),t=e%1;return e===e?t?e-t:e:0}function ia(n){return n?Ae(F(n),0,Yn):0}function $n(n){if(typeof n=="number")return n;if(Cn(n))return mt;if(rn(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=rn(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=Af(n);var t=hl.test(n);return t||pl.test(n)?Zl(n.slice(2),t?2:8):cl.test(n)?mt:+n}function ua(n){return Jn(n,In(n))}function P_(n){return n?Ae(F(n),-oe,oe):n===0?n:0}function K(n){return n==null?"":En(n)}var W_=$e(function(n,e){if(gt(e)||bn(e)){Jn(e,gn(e),n);return}for(var t in e)X.call(e,t)&&ot(n,t,e[t])}),fa=$e(function(n,e){Jn(e,In(e),n)}),cr=$e(function(n,e,t,r){Jn(e,In(e),n,r)}),F_=$e(function(n,e,t,r){Jn(e,gn(e),n,r)}),M_=te(_i);function B_(n,e){var t=qe(n);return e==null?t:Uf(t,e)}var U_=B(function(n,e){n=Q(n);var t=-1,r=e.length,i=r>2?e[2]:f;for(i&&yn(e[0],e[1],i)&&(r=1);++t1),o}),Jn(n,Mi(n),t),r&&(t=Un(t,an|G|z,Xh));for(var i=e.length;i--;)Ti(t,e[i]);return t});function ev(n,e){return aa(n,ar(S(e)))}var tv=te(function(n,e){return n==null?{}:Eh(n,e)});function aa(n,e){if(n==null)return{};var t=tn(Mi(n),function(r){return[r]});return e=S(e),kf(n,t,function(r,i){return e(r,i[0])})}function rv(n,e,t){e=pe(e,n);var r=-1,i=e.length;for(i||(i=1,n=f);++re){var r=n;n=e,e=r}if(t||n%1||e%1){var i=Wf();return wn(n+i*(e-n+Kl("1e-"+((i+"").length-1))),e)}return bi(n,e)}var pv=Ne(function(n,e,t){return e=e.toLowerCase(),n+(t?ca(e):e)});function ca(n){return Vi(K(n).toLowerCase())}function ha(n){return n=K(n),n&&n.replace(vl,ic).replace(Ml,"")}function _v(n,e,t){n=K(n),e=En(e);var r=n.length;t=t===f?r:Ae(F(t),0,r);var i=t;return t-=e.length,t>=0&&n.slice(t,i)==e}function vv(n){return n=K(n),n&&Qs.test(n)?n.replace(Nu,uc):n}function dv(n){return n=K(n),n&&tl.test(n)?n.replace(Zr,"\\$&"):n}var wv=Ne(function(n,e,t){return n+(t?"-":"")+e.toLowerCase()}),mv=Ne(function(n,e,t){return n+(t?" ":"")+e.toLowerCase()}),xv=po("toLowerCase");function yv(n,e,t){n=K(n),e=F(e);var r=e?Fe(n):0;if(!e||r>=e)return n;var i=(e-r)/2;return jt($t(i),t)+n+jt(qt(i),t)}function Av(n,e,t){n=K(n),e=F(e);var r=e?Fe(n):0;return e&&r>>0,t?(n=K(n),n&&(typeof e=="string"||e!=null&&!Xi(e))&&(e=En(e),!e&&We(n))?_e(Hn(n),0,t):n.split(e,t)):[]}var Ev=Ne(function(n,e,t){return n+(t?" ":"")+Vi(e)});function Cv(n,e,t){return n=K(n),t=t==null?0:Ae(F(t),0,n.length),e=En(e),n.slice(t,t+e.length)==e}function Lv(n,e,t){var r=u.templateSettings;t&&yn(n,e,t)&&(e=f),n=K(n),e=cr({},e,r,Ao);var i=cr({},e.imports,r.imports,Ao),o=gn(i),a=ai(i,o),s,c,_=0,v=e.interpolate||bt,d="__p += '",m=li((e.escape||bt).source+"|"+v.source+"|"+(v===Gu?ll:bt).source+"|"+(e.evaluate||bt).source+"|$","g"),y="//# sourceURL="+(X.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++$l+"]")+` -`;n.replace(m,function(I,U,$,Ln,An,Pn){return $||($=Ln),d+=n.slice(_,Pn).replace(dl,fc),U&&(s=!0,d+=`' + -__e(`+U+`) + -'`),An&&(c=!0,d+=`'; -`+An+`; -__p += '`),$&&(d+=`' + -((__t = (`+$+`)) == null ? '' : __t) + -'`),_=Pn+I.length,I}),d+=`'; -`;var b=X.call(e,"variable")&&e.variable;if(!b)d=`with (obj) { -`+d+` -} -`;else if(al.test(b))throw new E(k);d=(c?d.replace(Zs,""):d).replace(Ys,"$1").replace(Xs,"$1;"),d="function("+(b||"obj")+`) { -`+(b?"":`obj || (obj = {}); -`)+"var __t, __p = ''"+(s?", __e = _.escape":"")+(c?`, __j = Array.prototype.join; -function print() { __p += __j.call(arguments, '') } -`:`; -`)+d+`return __p -}`;var M=pa(function(){return H(o,y+"return "+d).apply(f,a)});if(M.source=d,Yi(M))throw M;return M}function Pv(n){return K(n).toLowerCase()}function Wv(n){return K(n).toUpperCase()}function Fv(n,e,t){if(n=K(n),n&&(t||e===f))return Af(n);if(!n||!(e=En(e)))return n;var r=Hn(n),i=Hn(e),o=Sf(r,i),a=bf(r,i)+1;return _e(r,o,a).join("")}function Mv(n,e,t){if(n=K(n),n&&(t||e===f))return n.slice(0,Rf(n)+1);if(!n||!(e=En(e)))return n;var r=Hn(n),i=bf(r,Hn(e))+1;return _e(r,0,i).join("")}function Bv(n,e,t){if(n=K(n),n&&(t||e===f))return n.replace(Yr,"");if(!n||!(e=En(e)))return n;var r=Hn(n),i=Sf(r,Hn(e));return _e(r,i).join("")}function Uv(n,e){var t=Cs,r=Ls;if(rn(e)){var i="separator"in e?e.separator:i;t="length"in e?F(e.length):t,r="omission"in e?En(e.omission):r}n=K(n);var o=n.length;if(We(n)){var a=Hn(n);o=a.length}if(t>=o)return n;var s=t-Fe(r);if(s<1)return r;var c=a?_e(a,0,s).join(""):n.slice(0,s);if(i===f)return c+r;if(a&&(s+=c.length-s),Xi(i)){if(n.slice(s).search(i)){var _,v=c;for(i.global||(i=li(i.source,K(Hu.exec(i))+"g")),i.lastIndex=0;_=i.exec(v);)var d=_.index;c=c.slice(0,d===f?s:d)}}else if(n.indexOf(En(i),s)!=s){var m=c.lastIndexOf(i);m>-1&&(c=c.slice(0,m))}return c+r}function Dv(n){return n=K(n),n&&Js.test(n)?n.replace($u,gc):n}var qv=Ne(function(n,e,t){return n+(t?" ":"")+e.toUpperCase()}),Vi=po("toUpperCase");function ga(n,e,t){return n=K(n),e=t?f:e,e===f?ac(n)?vc(n):jl(n):n.match(e)||[]}var pa=B(function(n,e){try{return Tn(n,f,e)}catch(t){return Yi(t)?t:new E(t)}}),$v=te(function(n,e){return Fn(e,function(t){t=Qn(t),ne(n,t,Ki(n[t],n))}),n});function Nv(n){var e=n==null?0:n.length,t=S();return n=e?tn(n,function(r){if(typeof r[1]!="function")throw new Mn(O);return[t(r[0]),r[1]]}):[],B(function(r){for(var i=-1;++ioe)return[];var t=Yn,r=wn(n,Yn);e=S(e),n-=Yn;for(var i=oi(r,e);++t0||e<0)?new q(t):(n<0?t=t.takeRight(-n):n&&(t=t.drop(n)),e!==f&&(e=F(e),t=e<0?t.dropRight(-e):t.take(e-n)),t)},q.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},q.prototype.toArray=function(){return this.take(Yn)},Xn(q.prototype,function(n,e){var t=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),i=u[r?"take"+(e=="last"?"Right":""):e],o=r||/^find/.test(e);i&&(u.prototype[e]=function(){var a=this.__wrapped__,s=r?[1]:arguments,c=a instanceof q,_=s[0],v=c||L(a),d=function(U){var $=i.apply(u,se([U],s));return r&&m?$[0]:$};v&&t&&typeof _=="function"&&_.length!=1&&(c=v=!1);var m=this.__chain__,y=!!this.__actions__.length,b=o&&!m,M=c&&!y;if(!o&&v){a=M?a:new q(this);var I=n.apply(a,s);return I.__actions__.push({func:ir,args:[d],thisArg:f}),new Bn(I,m)}return b&&M?n.apply(this,s):(I=this.thru(d),b?r?I.value()[0]:I.value():I)})}),Fn(["pop","push","shift","sort","splice","unshift"],function(n){var e=Ct[n],t=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",r=/^(?:pop|shift)$/.test(n);u.prototype[n]=function(){var i=arguments;if(r&&!this.__chain__){var o=this.value();return e.apply(L(o)?o:[],i)}return this[t](function(a){return e.apply(L(a)?a:[],i)})}}),Xn(q.prototype,function(n,e){var t=u[e];if(t){var r=t.name+"";X.call(De,r)||(De[r]=[]),De[r].push({name:e,func:t})}}),De[Vt(f,_n).name]=[{name:"wrapper",func:f}],q.prototype.clone=Dc,q.prototype.reverse=qc,q.prototype.value=$c,u.prototype.at=_p,u.prototype.chain=vp,u.prototype.commit=dp,u.prototype.next=wp,u.prototype.plant=xp,u.prototype.reverse=yp,u.prototype.toJSON=u.prototype.valueOf=u.prototype.value=Ap,u.prototype.first=u.prototype.head,tt&&(u.prototype[tt]=mp),u},Me=dc();we?((we.exports=Me)._=Me,jr._=Me):vn._=Me}).call(Ke)}(vt,vt.exports);var Te=vt.exports,da=function(){},wa=da(),Oe=function(h){return h!==wa&&h!==null},ma=Oe,xa=Array.prototype.forEach,ya=Object.create,Aa=function(h,w){var f;for(f in h)w[f]=h[f]},Sa=function(h){var w=ya(null);return xa.call(arguments,function(f){ma(f)&&Aa(Object(f),w)}),w},ba=function(){var h=Math.sign;return typeof h!="function"?!1:h(10)===1&&h(-20)===-1},hr,iu;function Ia(){return iu||(iu=1,hr=function(h){return h=Number(h),isNaN(h)||h===0?h:h>0?1:-1}),hr}var Ra=ba()?Math.sign:Ia(),Ta=Ra,Oa=Math.abs,Ea=Math.floor,Ca=function(h){return isNaN(h)?0:(h=Number(h),h===0||!isFinite(h)?h:Ta(h)*Ea(Oa(h)))},La=Ca,Pa=Math.max,Wa=function(h){return Pa(0,La(h))},uu=function(h){if(typeof h!="function")throw new TypeError(h+" is not a function");return h},Fa=Oe,fu=function(h){if(!Fa(h))throw new TypeError("Cannot use null or undefined");return h},Ma={exports:{}},Ba=function(){var h=Object.assign,w;return typeof h!="function"?!1:(w={foo:"raz"},h(w,{bar:"dwa"},{trzy:"trzy"}),w.foo+w.bar+w.trzy==="razdwatrzy")},gr,ou;function Ua(){return ou||(ou=1,gr=function(){try{return Object.keys("primitive"),!0}catch{return!1}}),gr}var pr,au;function Da(){if(au)return pr;au=1;var h=Oe,w=Object.keys;return pr=function(f){return w(h(f)?Object(f):f)},pr}var _r,su;function qa(){return su||(su=1,_r=Ua()()?Object.keys:Da()),_r}var vr,lu;function $a(){if(lu)return vr;lu=1;var h=qa(),w=fu,f=Math.max;return vr=function(T,C){var R,O,k=f(arguments.length,2),Z;for(T=Object(w(T)),Z=function(N){try{T[N]=C[N]}catch(j){R||(R=j)}},O=1;O-1},wr}var is=ts()?String.prototype.contains:rs(),dt=pu,vu=es,du=cu,wu=Sa,Ze=is,us=gu.exports=function(h,w){var f,T,C,R,O;return arguments.length<2||typeof h!="string"?(R=w,w=h,h=null):R=arguments[2],dt(h)?(f=Ze.call(h,"c"),T=Ze.call(h,"e"),C=Ze.call(h,"w")):(f=C=!0,T=!1),O={value:w,configurable:f,enumerable:T,writable:C},R?du(wu(R),O):O};us.gs=function(h,w,f){var T,C,R,O;return typeof h!="string"?(R=f,f=w,w=h,h=null):R=arguments[3],dt(w)?vu(w)?dt(f)?vu(f)||(R=f,f=void 0):f=void 0:(R=w,w=f=void 0):w=void 0,dt(h)?(T=Ze.call(h,"c"),C=Ze.call(h,"e")):(T=!0,C=!1),O={get:w,set:f,configurable:T,enumerable:C},R?du(wu(R),O):O};var Ye=gu.exports,mr={exports:{}};(function(h,w){var f=Ye,T=uu,C=Function.prototype.apply,R=Function.prototype.call,O=Object.create,k=Object.defineProperty,Z=Object.defineProperties,N=Object.prototype.hasOwnProperty,j={configurable:!0,enumerable:!1,writable:!0},an,G,z,pn,ln,P,_n;an=function(W,A){var D;return T(A),N.call(this,"__ee__")?D=this.__ee__:(D=j.value=O(null),k(this,"__ee__",j),j.value=null),D[W]?typeof D[W]=="object"?D[W].push(A):D[W]=[D[W],A]:D[W]=A,this},G=function(W,A){var D,Y;return T(A),Y=this,an.call(this,W,D=function(){z.call(Y,W,D),C.call(A,this,arguments)}),D.__eeOnceListener__=A,this},z=function(W,A){var D,Y,J,nn;if(T(A),!N.call(this,"__ee__"))return this;if(D=this.__ee__,!D[W])return this;if(Y=D[W],typeof Y=="object")for(nn=0;J=Y[nn];++nn)(J===A||J.__eeOnceListener__===A)&&(Y.length===2?D[W]=Y[nn?0:1]:Y.splice(nn,1));else(Y===A||Y.__eeOnceListener__===A)&&delete D[W];return this},pn=function(W){var A,D,Y,J,nn;if(N.call(this,"__ee__")&&(J=this.__ee__[W],!!J))if(typeof J=="object"){for(D=arguments.length,nn=new Array(D-1),A=1;A=55296&&D<=56319&&(sn+=G[++P])),sn=z?N.call(z,pn,sn,_n):sn,ln?(j.value=sn,an(W,_n,j)):W[_n]=sn,++_n;A=_n}}if(A===void 0)for(A=T(G.length),ln&&(W=new ln(A)),P=0;Pasync w=>{const f=new h,T=await w(f);if("error"in T)throw console.error(T.error),new Error(T.error);return f.terminate(),T.result},As=h=>w=>ys(h)(f=>(f.postMessage(w),new Promise((T,C)=>{f.onmessage=R=>{T(R.data)},f.onerror=R=>{console.error(R),C(R)}}))),Ss=h=>async w=>{try{const f=await h(w);postMessage({result:f})}catch(f){postMessage({error:f})}};var bs=""+new URL("parseTraceSlave.worker-4cd9f48c.js",self.location.href).href;const{min:Is}=Math,Rs=navigator.hardwareConcurrency??8;class Ts extends Worker{constructor(){super(bs,{type:"module"})}}const Os=As(Ts);async function Es({trace:h,context:w,view:f="main"}){var O,k;const T=Te.ceil((((O=h==null?void 0:h.events)==null?void 0:O.length)??0)/Rs),C=Te.range(0,(k=h==null?void 0:h.events)==null?void 0:k.length,T),R=Te.flatten(await Promise.all(Te.map(C,Z=>{var N;return Os({trace:h,context:w,view:f,from:Z,to:Is(Z+T,((N=h==null?void 0:h.events)==null?void 0:N.length)??0)})})));return{stepsPersistent:Te.flatMap(R,"stepsPersistent"),stepsTransient:Te.flatMap(R,"stepsTransient")}}onmessage=Ss(async({data:h})=>await Es(h))})(); diff --git a/assets/parseTrace.worker-d91f3db3.js b/assets/parseTrace.worker-d91f3db3.js new file mode 100644 index 0000000..e74e6b3 --- /dev/null +++ b/assets/parseTrace.worker-d91f3db3.js @@ -0,0 +1,27 @@ +(function(){"use strict";var Ke=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},vt={exports:{}};/** + * @license + * Lodash + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */vt.exports,function(h,w){(function(){var f,T="4.17.21",C=200,R="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",O="Expected a function",k="Invalid `variable` option passed into `_.template`",Z="__lodash_hash_undefined__",N=500,j="__lodash_placeholder__",an=1,G=2,z=4,pn=1,ln=2,P=1,_n=2,W=4,A=8,D=16,Y=32,J=64,nn=128,sn=256,Ur=512,Ws=30,Fs="...",Ms=800,Bs=16,qu=1,Us=2,Ds=3,de=1/0,oe=9007199254740991,qs=17976931348623157e292,mt=0/0,Yn=4294967295,$s=Yn-1,Ns=Yn>>>1,Gs=[["ary",nn],["bind",P],["bindKey",_n],["curry",A],["curryRight",D],["flip",Ur],["partial",Y],["partialRight",J],["rearg",sn]],Ee="[object Arguments]",xt="[object Array]",Hs="[object AsyncFunction]",Xe="[object Boolean]",Je="[object Date]",zs="[object DOMException]",yt="[object Error]",At="[object Function]",$u="[object GeneratorFunction]",Nn="[object Map]",Qe="[object Number]",Ks="[object Null]",Vn="[object Object]",Nu="[object Promise]",Zs="[object Proxy]",Ve="[object RegExp]",Gn="[object Set]",ke="[object String]",St="[object Symbol]",Ys="[object Undefined]",je="[object WeakMap]",Xs="[object WeakSet]",nt="[object ArrayBuffer]",Ce="[object DataView]",Dr="[object Float32Array]",qr="[object Float64Array]",$r="[object Int8Array]",Nr="[object Int16Array]",Gr="[object Int32Array]",Hr="[object Uint8Array]",zr="[object Uint8ClampedArray]",Kr="[object Uint16Array]",Zr="[object Uint32Array]",Js=/\b__p \+= '';/g,Qs=/\b(__p \+=) '' \+/g,Vs=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Gu=/&(?:amp|lt|gt|quot|#39);/g,Hu=/[&<>"']/g,ks=RegExp(Gu.source),js=RegExp(Hu.source),nl=/<%-([\s\S]+?)%>/g,el=/<%([\s\S]+?)%>/g,zu=/<%=([\s\S]+?)%>/g,tl=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,rl=/^\w*$/,il=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Yr=/[\\^$.*+?()[\]{}|]/g,ul=RegExp(Yr.source),Xr=/^\s+/,fl=/\s/,ol=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,al=/\{\n\/\* \[wrapped with (.+)\] \*/,sl=/,? & /,ll=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,cl=/[()=,{}\[\]\/\s]/,hl=/\\(\\)?/g,gl=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ku=/\w*$/,pl=/^[-+]0x[0-9a-f]+$/i,_l=/^0b[01]+$/i,vl=/^\[object .+?Constructor\]$/,dl=/^0o[0-7]+$/i,wl=/^(?:0|[1-9]\d*)$/,ml=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,bt=/($^)/,xl=/['\n\r\u2028\u2029\\]/g,It="\\ud800-\\udfff",yl="\\u0300-\\u036f",Al="\\ufe20-\\ufe2f",Sl="\\u20d0-\\u20ff",Zu=yl+Al+Sl,Yu="\\u2700-\\u27bf",Xu="a-z\\xdf-\\xf6\\xf8-\\xff",bl="\\xac\\xb1\\xd7\\xf7",Il="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Rl="\\u2000-\\u206f",Tl=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ju="A-Z\\xc0-\\xd6\\xd8-\\xde",Qu="\\ufe0e\\ufe0f",Vu=bl+Il+Rl+Tl,Jr="['’]",Ol="["+It+"]",ku="["+Vu+"]",Rt="["+Zu+"]",ju="\\d+",El="["+Yu+"]",nf="["+Xu+"]",ef="[^"+It+Vu+ju+Yu+Xu+Ju+"]",Qr="\\ud83c[\\udffb-\\udfff]",Cl="(?:"+Rt+"|"+Qr+")",tf="[^"+It+"]",Vr="(?:\\ud83c[\\udde6-\\uddff]){2}",kr="[\\ud800-\\udbff][\\udc00-\\udfff]",Le="["+Ju+"]",rf="\\u200d",uf="(?:"+nf+"|"+ef+")",Ll="(?:"+Le+"|"+ef+")",ff="(?:"+Jr+"(?:d|ll|m|re|s|t|ve))?",of="(?:"+Jr+"(?:D|LL|M|RE|S|T|VE))?",af=Cl+"?",sf="["+Qu+"]?",Pl="(?:"+rf+"(?:"+[tf,Vr,kr].join("|")+")"+sf+af+")*",Wl="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Fl="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",lf=sf+af+Pl,Ml="(?:"+[El,Vr,kr].join("|")+")"+lf,Bl="(?:"+[tf+Rt+"?",Rt,Vr,kr,Ol].join("|")+")",Ul=RegExp(Jr,"g"),Dl=RegExp(Rt,"g"),jr=RegExp(Qr+"(?="+Qr+")|"+Bl+lf,"g"),ql=RegExp([Le+"?"+nf+"+"+ff+"(?="+[ku,Le,"$"].join("|")+")",Ll+"+"+of+"(?="+[ku,Le+uf,"$"].join("|")+")",Le+"?"+uf+"+"+ff,Le+"+"+of,Fl,Wl,ju,Ml].join("|"),"g"),$l=RegExp("["+rf+It+Zu+Qu+"]"),Nl=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Gl=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Hl=-1,en={};en[Dr]=en[qr]=en[$r]=en[Nr]=en[Gr]=en[Hr]=en[zr]=en[Kr]=en[Zr]=!0,en[Ee]=en[xt]=en[nt]=en[Xe]=en[Ce]=en[Je]=en[yt]=en[At]=en[Nn]=en[Qe]=en[Vn]=en[Ve]=en[Gn]=en[ke]=en[je]=!1;var V={};V[Ee]=V[xt]=V[nt]=V[Ce]=V[Xe]=V[Je]=V[Dr]=V[qr]=V[$r]=V[Nr]=V[Gr]=V[Nn]=V[Qe]=V[Vn]=V[Ve]=V[Gn]=V[ke]=V[St]=V[Hr]=V[zr]=V[Kr]=V[Zr]=!0,V[yt]=V[At]=V[je]=!1;var zl={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Kl={"&":"&","<":"<",">":">",'"':""","'":"'"},Zl={"&":"&","<":"<",">":">",""":'"',"'":"'"},Yl={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Xl=parseFloat,Jl=parseInt,cf=typeof Ke=="object"&&Ke&&Ke.Object===Object&&Ke,Ql=typeof self=="object"&&self&&self.Object===Object&&self,vn=cf||Ql||Function("return this")(),ni=w&&!w.nodeType&&w,we=ni&&!0&&h&&!h.nodeType&&h,hf=we&&we.exports===ni,ei=hf&&cf.process,Wn=function(){try{var l=we&&we.require&&we.require("util").types;return l||ei&&ei.binding&&ei.binding("util")}catch{}}(),gf=Wn&&Wn.isArrayBuffer,pf=Wn&&Wn.isDate,_f=Wn&&Wn.isMap,vf=Wn&&Wn.isRegExp,df=Wn&&Wn.isSet,wf=Wn&&Wn.isTypedArray;function Tn(l,p,g){switch(g.length){case 0:return l.call(p);case 1:return l.call(p,g[0]);case 2:return l.call(p,g[0],g[1]);case 3:return l.call(p,g[0],g[1],g[2])}return l.apply(p,g)}function Vl(l,p,g,x){for(var E=-1,H=l==null?0:l.length;++E-1}function ti(l,p,g){for(var x=-1,E=l==null?0:l.length;++x-1;);return g}function Rf(l,p){for(var g=l.length;g--&&Pe(p,l[g],0)>-1;);return g}function fc(l,p){for(var g=l.length,x=0;g--;)l[g]===p&&++x;return x}var oc=fi(zl),ac=fi(Kl);function sc(l){return"\\"+Yl[l]}function lc(l,p){return l==null?f:l[p]}function We(l){return $l.test(l)}function cc(l){return Nl.test(l)}function hc(l){for(var p,g=[];!(p=l.next()).done;)g.push(p.value);return g}function li(l){var p=-1,g=Array(l.size);return l.forEach(function(x,E){g[++p]=[E,x]}),g}function Tf(l,p){return function(g){return l(p(g))}}function le(l,p){for(var g=-1,x=l.length,E=0,H=[];++g-1}function jc(n,e){var t=this.__data__,r=zt(t,n);return r<0?(++this.size,t.push([n,e])):t[r][1]=e,this}kn.prototype.clear=Jc,kn.prototype.delete=Qc,kn.prototype.get=Vc,kn.prototype.has=kc,kn.prototype.set=jc;function jn(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e=e?n:e)),n}function Un(n,e,t,r,i,o){var a,s=e&an,c=e&G,_=e&z;if(t&&(a=i?t(n,r,i,o):t(n)),a!==f)return a;if(!rn(n))return n;var v=L(n);if(v){if(a=rg(n),!s)return Sn(n,a)}else{var d=mn(n),m=d==At||d==$u;if(ve(n))return so(n,s);if(d==Vn||d==Ee||m&&!i){if(a=c||m?{}:Eo(n),!s)return c?Zh(n,_h(a,n)):Kh(n,qf(a,n))}else{if(!V[d])return i?n:{};a=ig(n,d,s)}}o||(o=new zn);var y=o.get(n);if(y)return y;o.set(n,a),ia(n)?n.forEach(function(I){a.add(Un(I,e,t,I,n,o))}):ta(n)&&n.forEach(function(I,U){a.set(U,Un(I,e,t,U,n,o))});var b=_?c?Bi:Mi:c?In:gn,M=v?f:b(n);return Fn(M||n,function(I,U){M&&(U=I,I=n[U]),ot(a,U,Un(I,e,t,U,n,o))}),a}function vh(n){var e=gn(n);return function(t){return $f(t,n,e)}}function $f(n,e,t){var r=t.length;if(n==null)return!r;for(n=Q(n);r--;){var i=t[r],o=e[i],a=n[i];if(a===f&&!(i in n)||!o(a))return!1}return!0}function Nf(n,e,t){if(typeof n!="function")throw new Mn(O);return pt(function(){n.apply(f,t)},e)}function at(n,e,t,r){var i=-1,o=Tt,a=!0,s=n.length,c=[],_=e.length;if(!s)return c;t&&(e=tn(e,On(t))),r?(o=ti,a=!1):e.length>=C&&(o=et,a=!1,e=new ye(e));n:for(;++ii?0:i+t),r=r===f||r>i?i:F(r),r<0&&(r+=i),r=t>r?0:fa(r);t0&&t(s)?e>1?dn(s,e-1,t,r,i):se(i,s):r||(i[i.length]=s)}return i}var di=_o(),zf=_o(!0);function Xn(n,e){return n&&di(n,e,gn)}function wi(n,e){return n&&zf(n,e,gn)}function Zt(n,e){return ae(e,function(t){return ie(n[t])})}function Se(n,e){e=pe(e,n);for(var t=0,r=e.length;n!=null&&te}function mh(n,e){return n!=null&&X.call(n,e)}function xh(n,e){return n!=null&&e in Q(n)}function yh(n,e,t){return n>=wn(e,t)&&n=120&&v.length>=120)?new ye(a&&v):f}v=n[0];var d=-1,m=s[0];n:for(;++d-1;)s!==n&&Ut.call(s,c,1),Ut.call(n,c,1);return n}function eo(n,e){for(var t=n?e.length:0,r=t-1;t--;){var i=e[t];if(t==r||i!==o){var o=i;re(i)?Ut.call(n,i,1):Oi(n,i)}}return n}function Ii(n,e){return n+$t(Mf()*(e-n+1))}function Fh(n,e,t,r){for(var i=-1,o=hn(qt((e-n)/(t||1)),0),a=g(o);o--;)a[r?o:++i]=n,n+=t;return a}function Ri(n,e){var t="";if(!n||e<1||e>oe)return t;do e%2&&(t+=n),e=$t(e/2),e&&(n+=n);while(e);return t}function B(n,e){return Hi(Po(n,e,Rn),n+"")}function Mh(n){return Df(ze(n))}function Bh(n,e){var t=ze(n);return rr(t,Ae(e,0,t.length))}function ct(n,e,t,r){if(!rn(n))return n;e=pe(e,n);for(var i=-1,o=e.length,a=o-1,s=n;s!=null&&++ii?0:i+e),t=t>i?i:t,t<0&&(t+=i),i=e>t?0:t-e>>>0,e>>>=0;for(var o=g(i);++r>>1,a=n[o];a!==null&&!Cn(a)&&(t?a<=e:a=C){var _=e?null:Qh(n);if(_)return Et(_);a=!1,i=et,c=new ye}else c=e?[]:s;n:for(;++r=r?n:Dn(n,e,t)}var ao=Tc||function(n){return vn.clearTimeout(n)};function so(n,e){if(e)return n.slice();var t=n.length,r=Cf?Cf(t):new n.constructor(t);return n.copy(r),r}function Pi(n){var e=new n.constructor(n.byteLength);return new Mt(e).set(new Mt(n)),e}function Nh(n,e){var t=e?Pi(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.byteLength)}function Gh(n){var e=new n.constructor(n.source,Ku.exec(n));return e.lastIndex=n.lastIndex,e}function Hh(n){return ft?Q(ft.call(n)):{}}function lo(n,e){var t=e?Pi(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.length)}function co(n,e){if(n!==e){var t=n!==f,r=n===null,i=n===n,o=Cn(n),a=e!==f,s=e===null,c=e===e,_=Cn(e);if(!s&&!_&&!o&&n>e||o&&a&&c&&!s&&!_||r&&a&&c||!t&&c||!i)return 1;if(!r&&!o&&!_&&n=s)return c;var _=t[r];return c*(_=="desc"?-1:1)}}return n.index-e.index}function ho(n,e,t,r){for(var i=-1,o=n.length,a=t.length,s=-1,c=e.length,_=hn(o-a,0),v=g(c+_),d=!r;++s1?t[i-1]:f,a=i>2?t[2]:f;for(o=n.length>3&&typeof o=="function"?(i--,o):f,a&&yn(t[0],t[1],a)&&(o=i<3?f:o,i=1),e=Q(e);++r-1?i[o?e[a]:a]:f}}function mo(n){return te(function(e){var t=e.length,r=t,i=Bn.prototype.thru;for(n&&e.reverse();r--;){var o=e[r];if(typeof o!="function")throw new Mn(O);if(i&&!a&&er(o)=="wrapper")var a=new Bn([],!0)}for(r=a?r:t;++r1&&$.reverse(),v&&cs))return!1;var _=o.get(n),v=o.get(e);if(_&&v)return _==e&&v==n;var d=-1,m=!0,y=t&ln?new ye:f;for(o.set(n,e),o.set(e,n);++d1?"& ":"")+e[r],e=e.join(t>2?", ":" "),n.replace(ol,`{ +/* [wrapped with `+e+`] */ +`)}function fg(n){return L(n)||Re(n)||!!(Wf&&n&&n[Wf])}function re(n,e){var t=typeof n;return e=e??oe,!!e&&(t=="number"||t!="symbol"&&wl.test(n))&&n>-1&&n%1==0&&n0){if(++e>=Ms)return arguments[0]}else e=0;return n.apply(f,arguments)}}function rr(n,e){var t=-1,r=n.length,i=r-1;for(e=e===f?r:e;++t1?n[e-1]:f;return t=typeof t=="function"?(n.pop(),t):f,zo(n,t)});function Ko(n){var e=u(n);return e.__chain__=!0,e}function dp(n,e){return e(n),n}function ir(n,e){return e(n)}var wp=te(function(n){var e=n.length,t=e?n[0]:0,r=this.__wrapped__,i=function(o){return vi(o,n)};return e>1||this.__actions__.length||!(r instanceof q)||!re(t)?this.thru(i):(r=r.slice(t,+t+(e?1:0)),r.__actions__.push({func:ir,args:[i],thisArg:f}),new Bn(r,this.__chain__).thru(function(o){return e&&!o.length&&o.push(f),o}))});function mp(){return Ko(this)}function xp(){return new Bn(this.value(),this.__chain__)}function yp(){this.__values__===f&&(this.__values__=ua(this.value()));var n=this.__index__>=this.__values__.length,e=n?f:this.__values__[this.__index__++];return{done:n,value:e}}function Ap(){return this}function Sp(n){for(var e,t=this;t instanceof Ht;){var r=Do(t);r.__index__=0,r.__values__=f,e?i.__wrapped__=r:e=r;var i=r;t=t.__wrapped__}return i.__wrapped__=n,e}function bp(){var n=this.__wrapped__;if(n instanceof q){var e=n;return this.__actions__.length&&(e=new q(this)),e=e.reverse(),e.__actions__.push({func:ir,args:[zi],thisArg:f}),new Bn(e,this.__chain__)}return this.thru(zi)}function Ip(){return fo(this.__wrapped__,this.__actions__)}var Rp=Qt(function(n,e,t){X.call(n,t)?++n[t]:ne(n,t,1)});function Tp(n,e,t){var r=L(n)?mf:dh;return t&&yn(n,e,t)&&(e=f),r(n,S(e,3))}function Op(n,e){var t=L(n)?ae:Hf;return t(n,S(e,3))}var Ep=wo(qo),Cp=wo($o);function Lp(n,e){return dn(ur(n,e),1)}function Pp(n,e){return dn(ur(n,e),de)}function Wp(n,e,t){return t=t===f?1:F(t),dn(ur(n,e),t)}function Zo(n,e){var t=L(n)?Fn:he;return t(n,S(e,3))}function Yo(n,e){var t=L(n)?kl:Gf;return t(n,S(e,3))}var Fp=Qt(function(n,e,t){X.call(n,t)?n[t].push(e):ne(n,t,[e])});function Mp(n,e,t,r){n=bn(n)?n:ze(n),t=t&&!r?F(t):0;var i=n.length;return t<0&&(t=hn(i+t,0)),lr(n)?t<=i&&n.indexOf(e,t)>-1:!!i&&Pe(n,e,t)>-1}var Bp=B(function(n,e,t){var r=-1,i=typeof e=="function",o=bn(n)?g(n.length):[];return he(n,function(a){o[++r]=i?Tn(e,a,t):st(a,e,t)}),o}),Up=Qt(function(n,e,t){ne(n,t,e)});function ur(n,e){var t=L(n)?tn:Jf;return t(n,S(e,3))}function Dp(n,e,t,r){return n==null?[]:(L(e)||(e=e==null?[]:[e]),t=r?f:t,L(t)||(t=t==null?[]:[t]),jf(n,e,t))}var qp=Qt(function(n,e,t){n[t?0:1].push(e)},function(){return[[],[]]});function $p(n,e,t){var r=L(n)?ri:Sf,i=arguments.length<3;return r(n,S(e,4),t,i,he)}function Np(n,e,t){var r=L(n)?jl:Sf,i=arguments.length<3;return r(n,S(e,4),t,i,Gf)}function Gp(n,e){var t=L(n)?ae:Hf;return t(n,ar(S(e,3)))}function Hp(n){var e=L(n)?Df:Mh;return e(n)}function zp(n,e,t){(t?yn(n,e,t):e===f)?e=1:e=F(e);var r=L(n)?hh:Bh;return r(n,e)}function Kp(n){var e=L(n)?gh:Dh;return e(n)}function Zp(n){if(n==null)return 0;if(bn(n))return lr(n)?Fe(n):n.length;var e=mn(n);return e==Nn||e==Gn?n.size:Ai(n).length}function Yp(n,e,t){var r=L(n)?ii:qh;return t&&yn(n,e,t)&&(e=f),r(n,S(e,3))}var Xp=B(function(n,e){if(n==null)return[];var t=e.length;return t>1&&yn(n,e[0],e[1])?e=[]:t>2&&yn(e[0],e[1],e[2])&&(e=[e[0]]),jf(n,dn(e,1),[])}),fr=Oc||function(){return vn.Date.now()};function Jp(n,e){if(typeof e!="function")throw new Mn(O);return n=F(n),function(){if(--n<1)return e.apply(this,arguments)}}function Xo(n,e,t){return e=t?f:e,e=n&&e==null?n.length:e,ee(n,nn,f,f,f,f,e)}function Jo(n,e){var t;if(typeof e!="function")throw new Mn(O);return n=F(n),function(){return--n>0&&(t=e.apply(this,arguments)),n<=1&&(e=f),t}}var Zi=B(function(n,e,t){var r=P;if(t.length){var i=le(t,Ge(Zi));r|=Y}return ee(n,r,e,t,i)}),Qo=B(function(n,e,t){var r=P|_n;if(t.length){var i=le(t,Ge(Qo));r|=Y}return ee(e,r,n,t,i)});function Vo(n,e,t){e=t?f:e;var r=ee(n,A,f,f,f,f,f,e);return r.placeholder=Vo.placeholder,r}function ko(n,e,t){e=t?f:e;var r=ee(n,D,f,f,f,f,f,e);return r.placeholder=ko.placeholder,r}function jo(n,e,t){var r,i,o,a,s,c,_=0,v=!1,d=!1,m=!0;if(typeof n!="function")throw new Mn(O);e=$n(e)||0,rn(t)&&(v=!!t.leading,d="maxWait"in t,o=d?hn($n(t.maxWait)||0,e):o,m="trailing"in t?!!t.trailing:m);function y(on){var Zn=r,fe=i;return r=i=f,_=on,a=n.apply(fe,Zn),a}function b(on){return _=on,s=pt(U,e),v?y(on):a}function M(on){var Zn=on-c,fe=on-_,wa=e-Zn;return d?wn(wa,o-fe):wa}function I(on){var Zn=on-c,fe=on-_;return c===f||Zn>=e||Zn<0||d&&fe>=o}function U(){var on=fr();if(I(on))return $(on);s=pt(U,M(on))}function $(on){return s=f,m&&r?y(on):(r=i=f,a)}function Ln(){s!==f&&ao(s),_=0,r=c=i=s=f}function An(){return s===f?a:$(fr())}function Pn(){var on=fr(),Zn=I(on);if(r=arguments,i=this,c=on,Zn){if(s===f)return b(c);if(d)return ao(s),s=pt(U,e),y(c)}return s===f&&(s=pt(U,e)),a}return Pn.cancel=Ln,Pn.flush=An,Pn}var Qp=B(function(n,e){return Nf(n,1,e)}),Vp=B(function(n,e,t){return Nf(n,$n(e)||0,t)});function kp(n){return ee(n,Ur)}function or(n,e){if(typeof n!="function"||e!=null&&typeof e!="function")throw new Mn(O);var t=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=t.cache;if(o.has(i))return o.get(i);var a=n.apply(this,r);return t.cache=o.set(i,a)||o,a};return t.cache=new(or.Cache||jn),t}or.Cache=jn;function ar(n){if(typeof n!="function")throw new Mn(O);return function(){var e=arguments;switch(e.length){case 0:return!n.call(this);case 1:return!n.call(this,e[0]);case 2:return!n.call(this,e[0],e[1]);case 3:return!n.call(this,e[0],e[1],e[2])}return!n.apply(this,e)}}function jp(n){return Jo(2,n)}var n_=$h(function(n,e){e=e.length==1&&L(e[0])?tn(e[0],On(S())):tn(dn(e,1),On(S()));var t=e.length;return B(function(r){for(var i=-1,o=wn(r.length,t);++i=e}),Re=Zf(function(){return arguments}())?Zf:function(n){return un(n)&&X.call(n,"callee")&&!Pf.call(n,"callee")},L=g.isArray,__=gf?On(gf):Sh;function bn(n){return n!=null&&sr(n.length)&&!ie(n)}function fn(n){return un(n)&&bn(n)}function v_(n){return n===!0||n===!1||un(n)&&xn(n)==Xe}var ve=Cc||iu,d_=pf?On(pf):bh;function w_(n){return un(n)&&n.nodeType===1&&!_t(n)}function m_(n){if(n==null)return!0;if(bn(n)&&(L(n)||typeof n=="string"||typeof n.splice=="function"||ve(n)||He(n)||Re(n)))return!n.length;var e=mn(n);if(e==Nn||e==Gn)return!n.size;if(gt(n))return!Ai(n).length;for(var t in n)if(X.call(n,t))return!1;return!0}function x_(n,e){return lt(n,e)}function y_(n,e,t){t=typeof t=="function"?t:f;var r=t?t(n,e):f;return r===f?lt(n,e,f,t):!!r}function Xi(n){if(!un(n))return!1;var e=xn(n);return e==yt||e==zs||typeof n.message=="string"&&typeof n.name=="string"&&!_t(n)}function A_(n){return typeof n=="number"&&Ff(n)}function ie(n){if(!rn(n))return!1;var e=xn(n);return e==At||e==$u||e==Hs||e==Zs}function ea(n){return typeof n=="number"&&n==F(n)}function sr(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=oe}function rn(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}function un(n){return n!=null&&typeof n=="object"}var ta=_f?On(_f):Rh;function S_(n,e){return n===e||yi(n,e,Di(e))}function b_(n,e,t){return t=typeof t=="function"?t:f,yi(n,e,Di(e),t)}function I_(n){return ra(n)&&n!=+n}function R_(n){if(sg(n))throw new E(R);return Yf(n)}function T_(n){return n===null}function O_(n){return n==null}function ra(n){return typeof n=="number"||un(n)&&xn(n)==Qe}function _t(n){if(!un(n)||xn(n)!=Vn)return!1;var e=Bt(n);if(e===null)return!0;var t=X.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&Pt.call(t)==bc}var Ji=vf?On(vf):Th;function E_(n){return ea(n)&&n>=-oe&&n<=oe}var ia=df?On(df):Oh;function lr(n){return typeof n=="string"||!L(n)&&un(n)&&xn(n)==ke}function Cn(n){return typeof n=="symbol"||un(n)&&xn(n)==St}var He=wf?On(wf):Eh;function C_(n){return n===f}function L_(n){return un(n)&&mn(n)==je}function P_(n){return un(n)&&xn(n)==Xs}var W_=nr(Si),F_=nr(function(n,e){return n<=e});function ua(n){if(!n)return[];if(bn(n))return lr(n)?Hn(n):Sn(n);if(tt&&n[tt])return hc(n[tt]());var e=mn(n),t=e==Nn?li:e==Gn?Et:ze;return t(n)}function ue(n){if(!n)return n===0?n:0;if(n=$n(n),n===de||n===-de){var e=n<0?-1:1;return e*qs}return n===n?n:0}function F(n){var e=ue(n),t=e%1;return e===e?t?e-t:e:0}function fa(n){return n?Ae(F(n),0,Yn):0}function $n(n){if(typeof n=="number")return n;if(Cn(n))return mt;if(rn(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=rn(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=bf(n);var t=_l.test(n);return t||dl.test(n)?Jl(n.slice(2),t?2:8):pl.test(n)?mt:+n}function oa(n){return Jn(n,In(n))}function M_(n){return n?Ae(F(n),-oe,oe):n===0?n:0}function K(n){return n==null?"":En(n)}var B_=$e(function(n,e){if(gt(e)||bn(e)){Jn(e,gn(e),n);return}for(var t in e)X.call(e,t)&&ot(n,t,e[t])}),aa=$e(function(n,e){Jn(e,In(e),n)}),cr=$e(function(n,e,t,r){Jn(e,In(e),n,r)}),U_=$e(function(n,e,t,r){Jn(e,gn(e),n,r)}),D_=te(vi);function q_(n,e){var t=qe(n);return e==null?t:qf(t,e)}var $_=B(function(n,e){n=Q(n);var t=-1,r=e.length,i=r>2?e[2]:f;for(i&&yn(e[0],e[1],i)&&(r=1);++t1),o}),Jn(n,Bi(n),t),r&&(t=Un(t,an|G|z,Vh));for(var i=e.length;i--;)Oi(t,e[i]);return t});function iv(n,e){return la(n,ar(S(e)))}var uv=te(function(n,e){return n==null?{}:Ph(n,e)});function la(n,e){if(n==null)return{};var t=tn(Bi(n),function(r){return[r]});return e=S(e),no(n,t,function(r,i){return e(r,i[0])})}function fv(n,e,t){e=pe(e,n);var r=-1,i=e.length;for(i||(i=1,n=f);++re){var r=n;n=e,e=r}if(t||n%1||e%1){var i=Mf();return wn(n+i*(e-n+Xl("1e-"+((i+"").length-1))),e)}return Ii(n,e)}var dv=Ne(function(n,e,t){return e=e.toLowerCase(),n+(t?ga(e):e)});function ga(n){return ki(K(n).toLowerCase())}function pa(n){return n=K(n),n&&n.replace(ml,oc).replace(Dl,"")}function wv(n,e,t){n=K(n),e=En(e);var r=n.length;t=t===f?r:Ae(F(t),0,r);var i=t;return t-=e.length,t>=0&&n.slice(t,i)==e}function mv(n){return n=K(n),n&&js.test(n)?n.replace(Hu,ac):n}function xv(n){return n=K(n),n&&ul.test(n)?n.replace(Yr,"\\$&"):n}var yv=Ne(function(n,e,t){return n+(t?"-":"")+e.toLowerCase()}),Av=Ne(function(n,e,t){return n+(t?" ":"")+e.toLowerCase()}),Sv=vo("toLowerCase");function bv(n,e,t){n=K(n),e=F(e);var r=e?Fe(n):0;if(!e||r>=e)return n;var i=(e-r)/2;return jt($t(i),t)+n+jt(qt(i),t)}function Iv(n,e,t){n=K(n),e=F(e);var r=e?Fe(n):0;return e&&r>>0,t?(n=K(n),n&&(typeof e=="string"||e!=null&&!Ji(e))&&(e=En(e),!e&&We(n))?_e(Hn(n),0,t):n.split(e,t)):[]}var Pv=Ne(function(n,e,t){return n+(t?" ":"")+ki(e)});function Wv(n,e,t){return n=K(n),t=t==null?0:Ae(F(t),0,n.length),e=En(e),n.slice(t,t+e.length)==e}function Fv(n,e,t){var r=u.templateSettings;t&&yn(n,e,t)&&(e=f),n=K(n),e=cr({},e,r,bo);var i=cr({},e.imports,r.imports,bo),o=gn(i),a=si(i,o),s,c,_=0,v=e.interpolate||bt,d="__p += '",m=ci((e.escape||bt).source+"|"+v.source+"|"+(v===zu?gl:bt).source+"|"+(e.evaluate||bt).source+"|$","g"),y="//# sourceURL="+(X.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Hl+"]")+` +`;n.replace(m,function(I,U,$,Ln,An,Pn){return $||($=Ln),d+=n.slice(_,Pn).replace(xl,sc),U&&(s=!0,d+=`' + +__e(`+U+`) + +'`),An&&(c=!0,d+=`'; +`+An+`; +__p += '`),$&&(d+=`' + +((__t = (`+$+`)) == null ? '' : __t) + +'`),_=Pn+I.length,I}),d+=`'; +`;var b=X.call(e,"variable")&&e.variable;if(!b)d=`with (obj) { +`+d+` +} +`;else if(cl.test(b))throw new E(k);d=(c?d.replace(Js,""):d).replace(Qs,"$1").replace(Vs,"$1;"),d="function("+(b||"obj")+`) { +`+(b?"":`obj || (obj = {}); +`)+"var __t, __p = ''"+(s?", __e = _.escape":"")+(c?`, __j = Array.prototype.join; +function print() { __p += __j.call(arguments, '') } +`:`; +`)+d+`return __p +}`;var M=va(function(){return H(o,y+"return "+d).apply(f,a)});if(M.source=d,Xi(M))throw M;return M}function Mv(n){return K(n).toLowerCase()}function Bv(n){return K(n).toUpperCase()}function Uv(n,e,t){if(n=K(n),n&&(t||e===f))return bf(n);if(!n||!(e=En(e)))return n;var r=Hn(n),i=Hn(e),o=If(r,i),a=Rf(r,i)+1;return _e(r,o,a).join("")}function Dv(n,e,t){if(n=K(n),n&&(t||e===f))return n.slice(0,Of(n)+1);if(!n||!(e=En(e)))return n;var r=Hn(n),i=Rf(r,Hn(e))+1;return _e(r,0,i).join("")}function qv(n,e,t){if(n=K(n),n&&(t||e===f))return n.replace(Xr,"");if(!n||!(e=En(e)))return n;var r=Hn(n),i=If(r,Hn(e));return _e(r,i).join("")}function $v(n,e){var t=Ws,r=Fs;if(rn(e)){var i="separator"in e?e.separator:i;t="length"in e?F(e.length):t,r="omission"in e?En(e.omission):r}n=K(n);var o=n.length;if(We(n)){var a=Hn(n);o=a.length}if(t>=o)return n;var s=t-Fe(r);if(s<1)return r;var c=a?_e(a,0,s).join(""):n.slice(0,s);if(i===f)return c+r;if(a&&(s+=c.length-s),Ji(i)){if(n.slice(s).search(i)){var _,v=c;for(i.global||(i=ci(i.source,K(Ku.exec(i))+"g")),i.lastIndex=0;_=i.exec(v);)var d=_.index;c=c.slice(0,d===f?s:d)}}else if(n.indexOf(En(i),s)!=s){var m=c.lastIndexOf(i);m>-1&&(c=c.slice(0,m))}return c+r}function Nv(n){return n=K(n),n&&ks.test(n)?n.replace(Gu,vc):n}var Gv=Ne(function(n,e,t){return n+(t?" ":"")+e.toUpperCase()}),ki=vo("toUpperCase");function _a(n,e,t){return n=K(n),e=t?f:e,e===f?cc(n)?mc(n):tc(n):n.match(e)||[]}var va=B(function(n,e){try{return Tn(n,f,e)}catch(t){return Xi(t)?t:new E(t)}}),Hv=te(function(n,e){return Fn(e,function(t){t=Qn(t),ne(n,t,Zi(n[t],n))}),n});function zv(n){var e=n==null?0:n.length,t=S();return n=e?tn(n,function(r){if(typeof r[1]!="function")throw new Mn(O);return[t(r[0]),r[1]]}):[],B(function(r){for(var i=-1;++ioe)return[];var t=Yn,r=wn(n,Yn);e=S(e),n-=Yn;for(var i=ai(r,e);++t0||e<0)?new q(t):(n<0?t=t.takeRight(-n):n&&(t=t.drop(n)),e!==f&&(e=F(e),t=e<0?t.dropRight(-e):t.take(e-n)),t)},q.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},q.prototype.toArray=function(){return this.take(Yn)},Xn(q.prototype,function(n,e){var t=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),i=u[r?"take"+(e=="last"?"Right":""):e],o=r||/^find/.test(e);i&&(u.prototype[e]=function(){var a=this.__wrapped__,s=r?[1]:arguments,c=a instanceof q,_=s[0],v=c||L(a),d=function(U){var $=i.apply(u,se([U],s));return r&&m?$[0]:$};v&&t&&typeof _=="function"&&_.length!=1&&(c=v=!1);var m=this.__chain__,y=!!this.__actions__.length,b=o&&!m,M=c&&!y;if(!o&&v){a=M?a:new q(this);var I=n.apply(a,s);return I.__actions__.push({func:ir,args:[d],thisArg:f}),new Bn(I,m)}return b&&M?n.apply(this,s):(I=this.thru(d),b?r?I.value()[0]:I.value():I)})}),Fn(["pop","push","shift","sort","splice","unshift"],function(n){var e=Ct[n],t=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",r=/^(?:pop|shift)$/.test(n);u.prototype[n]=function(){var i=arguments;if(r&&!this.__chain__){var o=this.value();return e.apply(L(o)?o:[],i)}return this[t](function(a){return e.apply(L(a)?a:[],i)})}}),Xn(q.prototype,function(n,e){var t=u[e];if(t){var r=t.name+"";X.call(De,r)||(De[r]=[]),De[r].push({name:e,func:t})}}),De[Vt(f,_n).name]=[{name:"wrapper",func:f}],q.prototype.clone=Nc,q.prototype.reverse=Gc,q.prototype.value=Hc,u.prototype.at=wp,u.prototype.chain=mp,u.prototype.commit=xp,u.prototype.next=yp,u.prototype.plant=Sp,u.prototype.reverse=bp,u.prototype.toJSON=u.prototype.valueOf=u.prototype.value=Ip,u.prototype.first=u.prototype.head,tt&&(u.prototype[tt]=Ap),u},Me=xc();we?((we.exports=Me)._=Me,ni._=Me):vn._=Me}).call(Ke)}(vt,vt.exports);var Te=vt.exports,ma=function(){},xa=ma(),Oe=function(h){return h!==xa&&h!==null},ya=Oe,Aa=Array.prototype.forEach,Sa=Object.create,ba=function(h,w){var f;for(f in h)w[f]=h[f]},Ia=function(h){var w=Sa(null);return Aa.call(arguments,function(f){ya(f)&&ba(Object(f),w)}),w},Ra=function(){var h=Math.sign;return typeof h!="function"?!1:h(10)===1&&h(-20)===-1},hr,uu;function Ta(){return uu||(uu=1,hr=function(h){return h=Number(h),isNaN(h)||h===0?h:h>0?1:-1}),hr}var Oa=Ra()?Math.sign:Ta(),Ea=Oa,Ca=Math.abs,La=Math.floor,Pa=function(h){return isNaN(h)?0:(h=Number(h),h===0||!isFinite(h)?h:Ea(h)*La(Ca(h)))},Wa=Pa,Fa=Math.max,Ma=function(h){return Fa(0,Wa(h))},fu=function(h){if(typeof h!="function")throw new TypeError(h+" is not a function");return h},Ba=Oe,ou=function(h){if(!Ba(h))throw new TypeError("Cannot use null or undefined");return h},Ua={exports:{}},Da=function(){var h=Object.assign,w;return typeof h!="function"?!1:(w={foo:"raz"},h(w,{bar:"dwa"},{trzy:"trzy"}),w.foo+w.bar+w.trzy==="razdwatrzy")},gr,au;function qa(){return au||(au=1,gr=function(){try{return Object.keys("primitive"),!0}catch{return!1}}),gr}var pr,su;function $a(){if(su)return pr;su=1;var h=Oe,w=Object.keys;return pr=function(f){return w(h(f)?Object(f):f)},pr}var _r,lu;function Na(){return lu||(lu=1,_r=qa()()?Object.keys:$a()),_r}var vr,cu;function Ga(){if(cu)return vr;cu=1;var h=Na(),w=ou,f=Math.max;return vr=function(T,C){var R,O,k=f(arguments.length,2),Z;for(T=Object(w(T)),Z=function(N){try{T[N]=C[N]}catch(j){R||(R=j)}},O=1;O-1},wr}var fs=is()?String.prototype.contains:us(),dt=_u,du=rs,wu=hu,mu=Ia,Ze=fs,os=pu.exports=function(h,w){var f,T,C,R,O;return arguments.length<2||typeof h!="string"?(R=w,w=h,h=null):R=arguments[2],dt(h)?(f=Ze.call(h,"c"),T=Ze.call(h,"e"),C=Ze.call(h,"w")):(f=C=!0,T=!1),O={value:w,configurable:f,enumerable:T,writable:C},R?wu(mu(R),O):O};os.gs=function(h,w,f){var T,C,R,O;return typeof h!="string"?(R=f,f=w,w=h,h=null):R=arguments[3],dt(w)?du(w)?dt(f)?du(f)||(R=f,f=void 0):f=void 0:(R=w,w=f=void 0):w=void 0,dt(h)?(T=Ze.call(h,"c"),C=Ze.call(h,"e")):(T=!0,C=!1),O={get:w,set:f,configurable:T,enumerable:C},R?wu(mu(R),O):O};var Ye=pu.exports,mr={exports:{}};(function(h,w){var f=Ye,T=fu,C=Function.prototype.apply,R=Function.prototype.call,O=Object.create,k=Object.defineProperty,Z=Object.defineProperties,N=Object.prototype.hasOwnProperty,j={configurable:!0,enumerable:!1,writable:!0},an,G,z,pn,ln,P,_n;an=function(W,A){var D;return T(A),N.call(this,"__ee__")?D=this.__ee__:(D=j.value=O(null),k(this,"__ee__",j),j.value=null),D[W]?typeof D[W]=="object"?D[W].push(A):D[W]=[D[W],A]:D[W]=A,this},G=function(W,A){var D,Y;return T(A),Y=this,an.call(this,W,D=function(){z.call(Y,W,D),C.call(A,this,arguments)}),D.__eeOnceListener__=A,this},z=function(W,A){var D,Y,J,nn;if(T(A),!N.call(this,"__ee__"))return this;if(D=this.__ee__,!D[W])return this;if(Y=D[W],typeof Y=="object")for(nn=0;J=Y[nn];++nn)(J===A||J.__eeOnceListener__===A)&&(Y.length===2?D[W]=Y[nn?0:1]:Y.splice(nn,1));else(Y===A||Y.__eeOnceListener__===A)&&delete D[W];return this},pn=function(W){var A,D,Y,J,nn;if(N.call(this,"__ee__")&&(J=this.__ee__[W],!!J))if(typeof J=="object"){for(D=arguments.length,nn=new Array(D-1),A=1;A=55296&&D<=56319&&(sn+=G[++P])),sn=z?N.call(z,pn,sn,_n):sn,ln?(j.value=sn,an(W,_n,j)):W[_n]=sn,++_n;A=_n}}if(A===void 0)for(A=T(G.length),ln&&(W=new ln(A)),P=0;Pasync w=>{const f=new h,T=await w(f);if("error"in T)throw console.error(T.error),new Error(T.error);return f.terminate(),T.result},Is=h=>w=>bs(h)(f=>(f.postMessage(w),new Promise((T,C)=>{f.onmessage=R=>{T(R.data)},f.onerror=R=>{console.error(R),C(R)}}))),Rs=h=>async w=>{try{const f=await h(w);postMessage({result:f})}catch(f){postMessage({error:f})}};var Ts=""+new URL("parseTraceSlave.worker-682281af.js",self.location.href).href;const{min:Os}=Math,Es=navigator.hardwareConcurrency??8;class Cs extends Worker{constructor(){super(Ts,{type:"module"})}}const Ls=Is(Cs);async function Ps({trace:h,context:w,view:f="main"}){var O,k;const T=Te.ceil((((O=h==null?void 0:h.events)==null?void 0:O.length)??0)/Es),C=Te.range(0,(k=h==null?void 0:h.events)==null?void 0:k.length,T),R=Te.flatten(await Promise.all(Te.map(C,Z=>{var N;return Ls({trace:h,context:w,view:f,from:Z,to:Os(Z+T,((N=h==null?void 0:h.events)==null?void 0:N.length)??0)})})));return{stepsPersistent:Te.flatMap(R,"stepsPersistent"),stepsTransient:Te.flatMap(R,"stepsTransient")}}onmessage=Rs(async({data:h})=>await Ps(h))})(); diff --git a/assets/parseTraceSlave.worker-4cd9f48c.js b/assets/parseTraceSlave.worker-4cd9f48c.js deleted file mode 100644 index 578752b..0000000 --- a/assets/parseTraceSlave.worker-4cd9f48c.js +++ /dev/null @@ -1,28 +0,0 @@ -(function(){"use strict";var Ye=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ms(f){return f&&f.__esModule&&Object.prototype.hasOwnProperty.call(f,"default")?f.default:f}var ys=function(){},ws=ys(),qe=function(f){return f!==ws&&f!==null},xs=qe,bs=Array.prototype.forEach,Ss=Object.create,As=function(f,l){var i;for(i in f)l[i]=f[i]},cf=function(f){var l=Ss(null);return bs.call(arguments,function(i){xs(i)&&As(Object(i),l)}),l},Os=function(){var f=Math.sign;return typeof f!="function"?!1:f(10)===1&&f(-20)===-1},Dr,hf;function Ts(){return hf||(hf=1,Dr=function(f){return f=Number(f),isNaN(f)||f===0?f:f>0?1:-1}),Dr}var Is=Os()?Math.sign:Ts(),Rs=Is,Es=Math.abs,Ps=Math.floor,Cs=function(f){return isNaN(f)?0:(f=Number(f),f===0||!isFinite(f)?f:Rs(f)*Ps(Es(f)))},Ls=Cs,Ms=Math.max,Fe=function(f){return Ms(0,Ls(f))},qs=Fe,pf=function(f,l,i){var h;return isNaN(f)?(h=l,h>=0?i&&h?h-1:h:1):f===!1?!1:qs(f)},we=function(f){if(typeof f!="function")throw new TypeError(f+" is not a function");return f},Fs=qe,Qe=function(f){if(!Fs(f))throw new TypeError("Cannot use null or undefined");return f},Ns=we,$s=Qe,Ds=Function.prototype.bind,gf=Function.prototype.call,Ws=Object.keys,Bs=Object.prototype.propertyIsEnumerable,Us=function(f,l){return function(i,h){var m,d=arguments[2],g=arguments[3];return i=Object($s(i)),Ns(h),m=Ws(i),g&&m.sort(typeof g=="function"?Ds.call(g,i):void 0),typeof f!="function"&&(f=m[f]),gf.call(f,m,function(y,w){return Bs.call(i,y)?gf.call(h,d,i[y],y,i,w):l})}},Ft=Us("forEach"),Ne={},vf={exports:{}},Gs=function(){var f=Object.assign,l;return typeof f!="function"?!1:(l={foo:"raz"},f(l,{bar:"dwa"},{trzy:"trzy"}),l.foo+l.bar+l.trzy==="razdwatrzy")},Wr,df;function zs(){return df||(df=1,Wr=function(){try{return Object.keys("primitive"),!0}catch{return!1}}),Wr}var Br,_f;function Hs(){if(_f)return Br;_f=1;var f=qe,l=Object.keys;return Br=function(i){return l(f(i)?Object(i):i)},Br}var Ur,mf;function Ks(){return mf||(mf=1,Ur=zs()()?Object.keys:Hs()),Ur}var Gr,yf;function Zs(){if(yf)return Gr;yf=1;var f=Ks(),l=Qe,i=Math.max;return Gr=function(h,m){var d,g,y=i(arguments.length,2),w;for(h=Object(l(h)),w=function(_){try{h[_]=m[_]}catch(b){d||(d=b)}},g=1;g-1},Vr}var cc=lc()?String.prototype.contains:sc(),Nt=Pf,Lf=ac,Mf=wf,qf=cf,ht=cc,hc=Ef.exports=function(f,l){var i,h,m,d,g;return arguments.length<2||typeof f!="string"?(d=l,l=f,f=null):d=arguments[2],Nt(f)?(i=ht.call(f,"c"),h=ht.call(f,"e"),m=ht.call(f,"w")):(i=m=!0,h=!1),g={value:l,configurable:i,enumerable:h,writable:m},d?Mf(qf(d),g):g};hc.gs=function(f,l,i){var h,m,d,g;return typeof f!="string"?(d=i,i=l,l=f,f=null):d=arguments[3],Nt(l)?Lf(l)?Nt(i)?Lf(i)||(d=i,i=void 0):i=void 0:(d=l,l=i=void 0):l=void 0,Nt(f)?(h=ht.call(f,"c"),m=ht.call(f,"e")):(h=!0,m=!1),g={get:l,set:i,configurable:h,enumerable:m},d?Mf(qf(d),g):g};var $e=Ef.exports,Yr={exports:{}};(function(f,l){var i=$e,h=we,m=Function.prototype.apply,d=Function.prototype.call,g=Object.create,y=Object.defineProperty,w=Object.defineProperties,_=Object.prototype.hasOwnProperty,b={configurable:!0,enumerable:!1,writable:!0},M,F,C,D,q,I,P;M=function(L,A){var E;return h(A),_.call(this,"__ee__")?E=this.__ee__:(E=b.value=g(null),y(this,"__ee__",b),b.value=null),E[L]?typeof E[L]=="object"?E[L].push(A):E[L]=[E[L],A]:E[L]=A,this},F=function(L,A){var E,W;return h(A),W=this,M.call(this,L,E=function(){C.call(W,L,E),m.call(A,this,arguments)}),E.__eeOnceListener__=A,this},C=function(L,A){var E,W,U,J;if(h(A),!_.call(this,"__ee__"))return this;if(E=this.__ee__,!E[L])return this;if(W=E[L],typeof W=="object")for(J=0;U=W[J];++J)(U===A||U.__eeOnceListener__===A)&&(W.length===2?E[L]=W[J?0:1]:W.splice(J,1));else(W===A||W.__eeOnceListener__===A)&&delete E[L];return this},D=function(L){var A,E,W,U,J;if(_.call(this,"__ee__")&&(U=this.__ee__[L],!!U))if(typeof U=="object"){for(E=arguments.length,J=new Array(E-1),A=1;A=55296&&E<=56319&&(rn+=F[++I])),rn=C?_.call(C,D,rn,P):rn,q?(b.value=rn,M(L,P,b)):L[P]=rn,++P;A=P}}if(A===void 0)for(A=h(F.length),q&&(L=new q(A)),I=0;I=0?b=g(b):b=l(this.length)-g(d(b)),w=b;w<_;++w)if(m.call(this,w)&&(M=this[w],f(M)))return w;return-1},yi}var xi,ao;function kc(){if(ao)return xi;ao=1;var f=wi(),l=Object.create;return xi=function(){var i=0,h=[],m=l(null);return{get:function(d){var g=0,y=h,w,_=d.length;if(_===0)return y[_]||null;if(y=y[_]){for(;g<_-1;){if(w=f.call(y[0],d[g]),w===-1)return null;y=y[1][w],++g}return w=f.call(y[0],d[g]),w===-1?null:y[1][w]||null}return null},set:function(d){var g=0,y=h,w,_=d.length;if(_===0)y[_]=++i;else{for(y[_]||(y[_]=[[],[]]),y=y[_];g<_-1;)w=f.call(y[0],d[g]),w===-1&&(w=y[0].push(d[g])-1,y[1].push([[],[]])),y=y[1][w],++g;w=f.call(y[0],d[g]),w===-1&&(w=y[0].push(d[g])-1),y[1][w]=++i}return m[i]=d,i},delete:function(d){var g=0,y=h,w,_=m[d],b=_.length,M=[];if(b===0)delete y[b];else if(y=y[b]){for(;g"}},Ci}var Li,Ao;function oh(){if(Ao)return Li;Ao=1;var f=fh(),l=/[\n\r\u2028\u2029]/g;return Li=function(i){var h=f(i);return h.length>100&&(h=h.slice(0,99)+"…"),h=h.replace(l,function(m){return JSON.stringify(m).slice(1,-1)}),h},Li}var Ut={exports:{}},Oo;function To(){if(Oo)return Ut.exports;Oo=1,Ut.exports=f,Ut.exports.default=f;function f(l){return!!l&&(typeof l=="object"||typeof l=="function")&&typeof l.then=="function"}return Ut.exports}var Io;function ah(){if(Io)return _o;Io=1;var f=po(),l=rh(),i=uh(),h=oh(),m=To(),d=Ti(),g=Object.create,y=l("then","then:finally","done","done:finally");return Ne.promise=function(w,_){var b=g(null),M=g(null),F=g(null);if(w===!0)w=null;else if(w=i(w),!y[w])throw new TypeError("'"+h(w)+"' is not valid promise mode");_.on("set",function(C,D,q){var I=!1;if(!m(q)){M[C]=q,_.emit("setasync",C,1);return}b[C]=1,F[C]=q;var P=function(W){var U=b[C];if(I)throw new Error(`Memoizee error: Detected unordered then|done & finally resolution, which in turn makes proper detection of success/failure impossible (when in 'done:finally' mode) -Consider to rely on 'then' or 'done' mode instead.`);U&&(delete b[C],M[C]=W,_.emit("setasync",C,U))},L=function(){I=!0,b[C]&&(delete b[C],delete F[C],_.delete(C))},A=w;if(A||(A="then"),A==="then"){var E=function(){d(L)};q=q.then(function(W){d(P.bind(this,W))},E),typeof q.finally=="function"&&q.finally(E)}else if(A==="done"){if(typeof q.done!="function")throw new Error("Memoizee error: Retrieved promise does not implement 'done' in 'done' mode");q.done(P,L)}else if(A==="done:finally"){if(typeof q.done!="function")throw new Error("Memoizee error: Retrieved promise does not implement 'done' in 'done:finally' mode");if(typeof q.finally!="function")throw new Error("Memoizee error: Retrieved promise does not implement 'finally' in 'done:finally' mode");q.done(P),q.finally(L)}}),_.on("get",function(C,D,q){var I;if(b[C]){++b[C];return}I=F[C];var P=function(){_.emit("getasync",C,D,q)};m(I)?typeof I.done=="function"?I.done(P):I.then(function(){d(P)}):P()}),_.on("delete",function(C){if(delete F[C],b[C]){delete b[C];return}if(hasOwnProperty.call(M,C)){var D=M[C];delete M[C],_.emit("deleteasync",C,[D])}}),_.on("clear",function(){var C=M;M=g(null),b=g(null),F=g(null),_.emit("clearasync",f(C,function(D){return[D]}))})},_o}var Ro={},Eo;function lh(){if(Eo)return Ro;Eo=1;var f=we,l=Ft,i=Ne,h=Function.prototype.apply;return i.dispose=function(m,d,g){var y;if(f(m),g.async&&i.async||g.promise&&i.promise){d.on("deleteasync",y=function(w,_){h.call(m,null,_)}),d.on("clearasync",function(w){l(w,function(_,b){y(b,_)})});return}d.on("delete",y=function(w,_){m(_)}),d.on("clear",function(w){l(w,function(_,b){y(b,_)})})},Ro}var Po={},Mi,Co;function sh(){return Co||(Co=1,Mi=2147483647),Mi}var qi,Lo;function ch(){if(Lo)return qi;Lo=1;var f=Fe,l=sh();return qi=function(i){if(i=f(i),i>l)throw new TypeError(i+" exceeds maximum possible timeout");return i},qi}var Mo;function hh(){if(Mo)return Po;Mo=1;var f=ci,l=Ft,i=Ti(),h=To(),m=ch(),d=Ne,g=Function.prototype,y=Math.max,w=Math.min,_=Object.create;return d.maxAge=function(b,M,F){var C,D,q,I;b=m(b),b&&(C=_(null),D=F.async&&d.async||F.promise&&d.promise?"async":"",M.on("set"+D,function(P){C[P]=setTimeout(function(){M.delete(P)},b),typeof C[P].unref=="function"&&C[P].unref(),I&&(I[P]&&I[P]!=="nextTick"&&clearTimeout(I[P]),I[P]=setTimeout(function(){delete I[P]},q),typeof I[P].unref=="function"&&I[P].unref())}),M.on("delete"+D,function(P){clearTimeout(C[P]),delete C[P],I&&(I[P]!=="nextTick"&&clearTimeout(I[P]),delete I[P])}),F.preFetch&&(F.preFetch===!0||isNaN(F.preFetch)?q=.333:q=y(w(Number(F.preFetch),1),0),q&&(I={},q=(1-q)*b,M.on("get"+D,function(P,L,A){I[P]||(I[P]="nextTick",i(function(){var E;I[P]==="nextTick"&&(delete I[P],M.delete(P),F.async&&(L=f(L),L.push(g)),E=M.memoized.apply(A,L),F.promise&&h(E)&&(typeof E.done=="function"?E.done(g,g):E.then(g,g)))}))}))),M.on("clear"+D,function(){l(C,function(P){clearTimeout(P)}),C={},I&&(l(I,function(P){P!=="nextTick"&&clearTimeout(P)}),I={})}))},Po}var qo={},Fi,Fo;function ph(){if(Fo)return Fi;Fo=1;var f=Fe,l=Object.create,i=Object.prototype.hasOwnProperty;return Fi=function(h){var m=0,d=1,g=l(null),y=l(null),w=0,_;return h=f(h),{hit:function(b){var M=y[b],F=++w;if(g[F]=b,y[b]=F,!M)return++m,m<=h?void 0:(b=g[d],_(b),b);if(delete g[M],d===M)for(;!i.call(g,++d););},delete:_=function(b){var M=y[b];if(M&&(delete g[M],delete y[b],--m,d===M)){if(!m){w=0,d=1;return}for(;!i.call(g,++d););}},clear:function(){m=0,d=1,g=l(null),y=l(null),w=0}}},Fi}var No;function gh(){if(No)return qo;No=1;var f=Fe,l=ph(),i=Ne;return i.max=function(h,m,d){var g,y,w;h=f(h),h&&(y=l(h),g=d.async&&i.async||d.promise&&i.promise?"async":"",m.on("set"+g,w=function(_){_=y.hit(_),_!==void 0&&m.delete(_)}),m.on("get"+g,w),m.on("delete"+g,y.delete),m.on("clear"+g,y.clear))},qo}var $o={},Do;function vh(){if(Do)return $o;Do=1;var f=$e,l=Ne,i=Object.create,h=Object.defineProperties;return l.refCounter=function(m,d,g){var y,w;y=i(null),w=g.async&&l.async||g.promise&&l.promise?"async":"",d.on("set"+w,function(_,b){y[_]=b||1}),d.on("get"+w,function(_){++y[_]}),d.on("delete"+w,function(_){delete y[_]}),d.on("clear"+w,function(){y={}}),h(d.memoized,{deleteRef:f(function(){var _=d.get(arguments);return _===null||!y[_]?null:--y[_]?!1:(d.delete(_),!0)}),getRefCount:f(function(){var _=d.get(arguments);return _===null||!y[_]?0:y[_]})})},$o}var dh=cf,_h=pf,mh=Vc,yh=function(f){var l=dh(arguments[1]),i;return l.normalizer||(i=l.length=_h(l.length,f.length,l.async),i!==0&&(l.primitive?i===!1?l.normalizer=Yc():i>1&&(l.normalizer=Qc()(i)):i===!1?l.normalizer=kc()():i===1?l.normalizer=nh()():l.normalizer=eh()(i))),l.async&&th(),l.promise&&ah(),l.dispose&&lh(),l.maxAge&&hh(),l.max&&gh(),l.refCounter&&vh(),mh(f,l)},wh=ms(yh);const xh=f=>async l=>{try{const i=await f(l);postMessage({result:i})}catch(i){postMessage({error:i})}};var Gt={exports:{}};/** - * @license - * Lodash - * Copyright OpenJS Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */Gt.exports,function(f,l){(function(){var i,h="4.17.21",m=200,d="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",g="Expected a function",y="Invalid `variable` option passed into `_.template`",w="__lodash_hash_undefined__",_=500,b="__lodash_placeholder__",M=1,F=2,C=4,D=1,q=2,I=1,P=2,L=4,A=8,E=16,W=32,U=64,J=128,rn=256,Pn=512,gt=30,Ht="...",Wi=800,Kt=16,vt=1,Bi=2,Ui=3,Nn=1/0,wn=9007199254740991,De=17976931348623157e292,ae=0/0,$n=4294967295,Gi=$n-1,Zt=$n>>>1,Vt=[["ary",J],["bind",I],["bindKey",P],["curry",A],["curryRight",E],["flip",Pn],["partial",W],["partialRight",U],["rearg",rn]],le="[object Arguments]",xe="[object Array]",dt="[object AsyncFunction]",se="[object Boolean]",be="[object Date]",un="[object DOMException]",ie="[object Error]",xn="[object Function]",Se="[object GeneratorFunction]",dn="[object Map]",Cn="[object Number]",Ae="[object Null]",Hn="[object Object]",_t="[object Promise]",Yt="[object Proxy]",an="[object RegExp]",_n="[object Set]",kn="[object String]",Qt="[object Symbol]",Ch="[object Undefined]",mt="[object WeakMap]",Lh="[object WeakSet]",yt="[object ArrayBuffer]",Je="[object DataView]",zi="[object Float32Array]",Hi="[object Float64Array]",Ki="[object Int8Array]",Zi="[object Int16Array]",Vi="[object Int32Array]",Yi="[object Uint8Array]",Qi="[object Uint8ClampedArray]",Xi="[object Uint16Array]",Ji="[object Uint32Array]",Mh=/\b__p \+= '';/g,qh=/\b(__p \+=) '' \+/g,Fh=/(__e\(.*?\)|\b__t\)) \+\n'';/g,zo=/&(?:amp|lt|gt|quot|#39);/g,Ho=/[&<>"']/g,Nh=RegExp(zo.source),$h=RegExp(Ho.source),Dh=/<%-([\s\S]+?)%>/g,Wh=/<%([\s\S]+?)%>/g,Ko=/<%=([\s\S]+?)%>/g,Bh=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Uh=/^\w*$/,Gh=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ji=/[\\^$.*+?()[\]{}|]/g,zh=RegExp(ji.source),ki=/^\s+/,Hh=/\s/,Kh=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Zh=/\{\n\/\* \[wrapped with (.+)\] \*/,Vh=/,? & /,Yh=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Qh=/[()=,{}\[\]\/\s]/,Xh=/\\(\\)?/g,Jh=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Zo=/\w*$/,jh=/^[-+]0x[0-9a-f]+$/i,kh=/^0b[01]+$/i,np=/^\[object .+?Constructor\]$/,ep=/^0o[0-7]+$/i,tp=/^(?:0|[1-9]\d*)$/,rp=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Xt=/($^)/,ip=/['\n\r\u2028\u2029\\]/g,Jt="\\ud800-\\udfff",up="\\u0300-\\u036f",fp="\\ufe20-\\ufe2f",op="\\u20d0-\\u20ff",Vo=up+fp+op,Yo="\\u2700-\\u27bf",Qo="a-z\\xdf-\\xf6\\xf8-\\xff",ap="\\xac\\xb1\\xd7\\xf7",lp="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",sp="\\u2000-\\u206f",cp=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Xo="A-Z\\xc0-\\xd6\\xd8-\\xde",Jo="\\ufe0e\\ufe0f",jo=ap+lp+sp+cp,nu="['’]",hp="["+Jt+"]",ko="["+jo+"]",jt="["+Vo+"]",na="\\d+",pp="["+Yo+"]",ea="["+Qo+"]",ta="[^"+Jt+jo+na+Yo+Qo+Xo+"]",eu="\\ud83c[\\udffb-\\udfff]",gp="(?:"+jt+"|"+eu+")",ra="[^"+Jt+"]",tu="(?:\\ud83c[\\udde6-\\uddff]){2}",ru="[\\ud800-\\udbff][\\udc00-\\udfff]",je="["+Xo+"]",ia="\\u200d",ua="(?:"+ea+"|"+ta+")",vp="(?:"+je+"|"+ta+")",fa="(?:"+nu+"(?:d|ll|m|re|s|t|ve))?",oa="(?:"+nu+"(?:D|LL|M|RE|S|T|VE))?",aa=gp+"?",la="["+Jo+"]?",dp="(?:"+ia+"(?:"+[ra,tu,ru].join("|")+")"+la+aa+")*",_p="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",mp="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",sa=la+aa+dp,yp="(?:"+[pp,tu,ru].join("|")+")"+sa,wp="(?:"+[ra+jt+"?",jt,tu,ru,hp].join("|")+")",xp=RegExp(nu,"g"),bp=RegExp(jt,"g"),iu=RegExp(eu+"(?="+eu+")|"+wp+sa,"g"),Sp=RegExp([je+"?"+ea+"+"+fa+"(?="+[ko,je,"$"].join("|")+")",vp+"+"+oa+"(?="+[ko,je+ua,"$"].join("|")+")",je+"?"+ua+"+"+fa,je+"+"+oa,mp,_p,na,yp].join("|"),"g"),Ap=RegExp("["+ia+Jt+Vo+Jo+"]"),Op=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Tp=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Ip=-1,ln={};ln[zi]=ln[Hi]=ln[Ki]=ln[Zi]=ln[Vi]=ln[Yi]=ln[Qi]=ln[Xi]=ln[Ji]=!0,ln[le]=ln[xe]=ln[yt]=ln[se]=ln[Je]=ln[be]=ln[ie]=ln[xn]=ln[dn]=ln[Cn]=ln[Hn]=ln[an]=ln[_n]=ln[kn]=ln[mt]=!1;var on={};on[le]=on[xe]=on[yt]=on[Je]=on[se]=on[be]=on[zi]=on[Hi]=on[Ki]=on[Zi]=on[Vi]=on[dn]=on[Cn]=on[Hn]=on[an]=on[_n]=on[kn]=on[Qt]=on[Yi]=on[Qi]=on[Xi]=on[Ji]=!0,on[ie]=on[xn]=on[mt]=!1;var Rp={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Ep={"&":"&","<":"<",">":">",'"':""","'":"'"},Pp={"&":"&","<":"<",">":">",""":'"',"'":"'"},Cp={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Lp=parseFloat,Mp=parseInt,ca=typeof Ye=="object"&&Ye&&Ye.Object===Object&&Ye,qp=typeof self=="object"&&self&&self.Object===Object&&self,Sn=ca||qp||Function("return this")(),uu=l&&!l.nodeType&&l,We=uu&&!0&&f&&!f.nodeType&&f,ha=We&&We.exports===uu,fu=ha&&ca.process,Kn=function(){try{var p=We&&We.require&&We.require("util").types;return p||fu&&fu.binding&&fu.binding("util")}catch{}}(),pa=Kn&&Kn.isArrayBuffer,ga=Kn&&Kn.isDate,va=Kn&&Kn.isMap,da=Kn&&Kn.isRegExp,_a=Kn&&Kn.isSet,ma=Kn&&Kn.isTypedArray;function Dn(p,S,x){switch(x.length){case 0:return p.call(S);case 1:return p.call(S,x[0]);case 2:return p.call(S,x[0],x[1]);case 3:return p.call(S,x[0],x[1],x[2])}return p.apply(S,x)}function Fp(p,S,x,$){for(var K=-1,nn=p==null?0:p.length;++K-1}function ou(p,S,x){for(var $=-1,K=p==null?0:p.length;++$-1;);return x}function Ta(p,S){for(var x=p.length;x--&&ke(S,p[x],0)>-1;);return x}function Hp(p,S){for(var x=p.length,$=0;x--;)p[x]===S&&++$;return $}var Kp=cu(Rp),Zp=cu(Ep);function Vp(p){return"\\"+Cp[p]}function Yp(p,S){return p==null?i:p[S]}function nt(p){return Ap.test(p)}function Qp(p){return Op.test(p)}function Xp(p){for(var S,x=[];!(S=p.next()).done;)x.push(S.value);return x}function vu(p){var S=-1,x=Array(p.size);return p.forEach(function($,K){x[++S]=[K,$]}),x}function Ia(p,S){return function(x){return p(S(x))}}function Ie(p,S){for(var x=-1,$=p.length,K=0,nn=[];++x<$;){var mn=p[x];(mn===S||mn===b)&&(p[x]=b,nn[K++]=x)}return nn}function er(p){var S=-1,x=Array(p.size);return p.forEach(function($){x[++S]=$}),x}function Jp(p){var S=-1,x=Array(p.size);return p.forEach(function($){x[++S]=[$,$]}),x}function jp(p,S,x){for(var $=x-1,K=p.length;++$-1}function $g(n,e){var t=this.__data__,r=dr(t,n);return r<0?(++this.size,t.push([n,e])):t[r][1]=e,this}ce.prototype.clear=Mg,ce.prototype.delete=qg,ce.prototype.get=Fg,ce.prototype.has=Ng,ce.prototype.set=$g;function he(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e=e?n:e)),n}function Qn(n,e,t,r,u,a){var s,c=e&M,v=e&F,O=e&C;if(t&&(s=u?t(n,r,u,a):t(n)),s!==i)return s;if(!hn(n))return n;var T=Z(n);if(T){if(s=Uv(n),!c)return Ln(n,s)}else{var R=Tn(n),N=R==xn||R==Se;if(Me(n))return ll(n,c);if(R==Hn||R==le||N&&!u){if(s=v||N?{}:Rl(n),!c)return v?Pv(n,kg(s,n)):Ev(n,Wa(s,n))}else{if(!on[R])return u?n:{};s=Gv(n,R,c)}}a||(a=new ee);var B=a.get(n);if(B)return B;a.set(n,s),rs(n)?n.forEach(function(H){s.add(Qn(H,e,t,H,n,a))}):es(n)&&n.forEach(function(H,X){s.set(X,Qn(H,e,t,X,n,a))});var z=O?v?Uu:Bu:v?qn:bn,Y=T?i:z(n);return Zn(Y||n,function(H,X){Y&&(X=H,H=n[X]),Tt(s,X,Qn(H,e,t,X,n,a))}),s}function nv(n){var e=bn(n);return function(t){return Ba(t,n,e)}}function Ba(n,e,t){var r=t.length;if(n==null)return!r;for(n=fn(n);r--;){var u=t[r],a=e[u],s=n[u];if(s===i&&!(u in n)||!a(s))return!1}return!0}function Ua(n,e,t){if(typeof n!="function")throw new Vn(g);return Mt(function(){n.apply(i,t)},e)}function It(n,e,t,r){var u=-1,a=kt,s=!0,c=n.length,v=[],O=e.length;if(!c)return v;t&&(e=sn(e,Wn(t))),r?(a=ou,s=!1):e.length>=m&&(a=wt,s=!1,e=new Ge(e));n:for(;++uu?0:u+t),r=r===i||r>u?u:V(r),r<0&&(r+=u),r=t>r?0:us(r);t0&&t(c)?e>1?An(c,e-1,t,r,u):Te(u,c):r||(u[u.length]=c)}return u}var bu=vl(),Ha=vl(!0);function ue(n,e){return n&&bu(n,e,bn)}function Su(n,e){return n&&Ha(n,e,bn)}function mr(n,e){return Oe(e,function(t){return _e(n[t])})}function He(n,e){e=Ce(e,n);for(var t=0,r=e.length;n!=null&&te}function rv(n,e){return n!=null&&tn.call(n,e)}function iv(n,e){return n!=null&&e in fn(n)}function uv(n,e,t){return n>=On(e,t)&&n=120&&T.length>=120)?new Ge(s&&T):i}T=n[0];var R=-1,N=c[0];n:for(;++R-1;)c!==n&&lr.call(c,v,1),lr.call(n,v,1);return n}function el(n,e){for(var t=n?e.length:0,r=t-1;t--;){var u=e[t];if(t==r||u!==a){var a=u;de(u)?lr.call(n,u,1):Mu(n,u)}}return n}function Pu(n,e){return n+hr(Fa()*(e-n+1))}function mv(n,e,t,r){for(var u=-1,a=yn(cr((e-n)/(t||1)),0),s=x(a);a--;)s[r?a:++u]=n,n+=t;return s}function Cu(n,e){var t="";if(!n||e<1||e>wn)return t;do e%2&&(t+=n),e=hr(e/2),e&&(n+=n);while(e);return t}function Q(n,e){return Yu(Cl(n,e,Fn),n+"")}function yv(n){return Da(ct(n))}function wv(n,e){var t=ct(n);return Er(t,ze(e,0,t.length))}function Pt(n,e,t,r){if(!hn(n))return n;e=Ce(e,n);for(var u=-1,a=e.length,s=a-1,c=n;c!=null&&++uu?0:u+e),t=t>u?u:t,t<0&&(t+=u),u=e>t?0:t-e>>>0,e>>>=0;for(var a=x(u);++r>>1,s=n[a];s!==null&&!Un(s)&&(t?s<=e:s=m){var O=e?null:qv(n);if(O)return er(O);s=!1,u=wt,v=new Ge}else v=e?[]:c;n:for(;++r=r?n:Xn(n,e,t)}var al=cg||function(n){return Sn.clearTimeout(n)};function ll(n,e){if(e)return n.slice();var t=n.length,r=Pa?Pa(t):new n.constructor(t);return n.copy(r),r}function $u(n){var e=new n.constructor(n.byteLength);return new or(e).set(new or(n)),e}function Ov(n,e){var t=e?$u(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.byteLength)}function Tv(n){var e=new n.constructor(n.source,Zo.exec(n));return e.lastIndex=n.lastIndex,e}function Iv(n){return Ot?fn(Ot.call(n)):{}}function sl(n,e){var t=e?$u(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.length)}function cl(n,e){if(n!==e){var t=n!==i,r=n===null,u=n===n,a=Un(n),s=e!==i,c=e===null,v=e===e,O=Un(e);if(!c&&!O&&!a&&n>e||a&&s&&v&&!c&&!O||r&&s&&v||!t&&v||!u)return 1;if(!r&&!a&&!O&&n=c)return v;var O=t[r];return v*(O=="desc"?-1:1)}}return n.index-e.index}function hl(n,e,t,r){for(var u=-1,a=n.length,s=t.length,c=-1,v=e.length,O=yn(a-s,0),T=x(v+O),R=!r;++c1?t[u-1]:i,s=u>2?t[2]:i;for(a=n.length>3&&typeof a=="function"?(u--,a):i,s&&Rn(t[0],t[1],s)&&(a=u<3?i:a,u=1),e=fn(e);++r-1?u[a?e[s]:s]:i}}function ml(n){return ve(function(e){var t=e.length,r=t,u=Yn.prototype.thru;for(n&&e.reverse();r--;){var a=e[r];if(typeof a!="function")throw new Vn(g);if(u&&!s&&Ir(a)=="wrapper")var s=new Yn([],!0)}for(r=s?r:t;++r1&&k.reverse(),T&&vc))return!1;var O=a.get(n),T=a.get(e);if(O&&T)return O==e&&T==n;var R=-1,N=!0,B=t&q?new Ge:i;for(a.set(n,e),a.set(e,n);++R1?"& ":"")+e[r],e=e.join(t>2?", ":" "),n.replace(Kh,`{ -/* [wrapped with `+e+`] */ -`)}function Hv(n){return Z(n)||Ve(n)||!!(Ma&&n&&n[Ma])}function de(n,e){var t=typeof n;return e=e??wn,!!e&&(t=="number"||t!="symbol"&&tp.test(n))&&n>-1&&n%1==0&&n0){if(++e>=Wi)return arguments[0]}else e=0;return n.apply(i,arguments)}}function Er(n,e){var t=-1,r=n.length,u=r-1;for(e=e===i?r:e;++t1?n[e-1]:i;return t=typeof t=="function"?(n.pop(),t):i,zl(n,t)});function Hl(n){var e=o(n);return e.__chain__=!0,e}function e_(n,e){return e(n),n}function Pr(n,e){return e(n)}var t_=ve(function(n){var e=n.length,t=e?n[0]:0,r=this.__wrapped__,u=function(a){return xu(a,n)};return e>1||this.__actions__.length||!(r instanceof j)||!de(t)?this.thru(u):(r=r.slice(t,+t+(e?1:0)),r.__actions__.push({func:Pr,args:[u],thisArg:i}),new Yn(r,this.__chain__).thru(function(a){return e&&!a.length&&a.push(i),a}))});function r_(){return Hl(this)}function i_(){return new Yn(this.value(),this.__chain__)}function u_(){this.__values__===i&&(this.__values__=is(this.value()));var n=this.__index__>=this.__values__.length,e=n?i:this.__values__[this.__index__++];return{done:n,value:e}}function f_(){return this}function o_(n){for(var e,t=this;t instanceof vr;){var r=$l(t);r.__index__=0,r.__values__=i,e?u.__wrapped__=r:e=r;var u=r;t=t.__wrapped__}return u.__wrapped__=n,e}function a_(){var n=this.__wrapped__;if(n instanceof j){var e=n;return this.__actions__.length&&(e=new j(this)),e=e.reverse(),e.__actions__.push({func:Pr,args:[Qu],thisArg:i}),new Yn(e,this.__chain__)}return this.thru(Qu)}function l_(){return fl(this.__wrapped__,this.__actions__)}var s_=br(function(n,e,t){tn.call(n,t)?++n[t]:pe(n,t,1)});function c_(n,e,t){var r=Z(n)?ya:ev;return t&&Rn(n,e,t)&&(e=i),r(n,G(e,3))}function h_(n,e){var t=Z(n)?Oe:za;return t(n,G(e,3))}var p_=_l(Dl),g_=_l(Wl);function v_(n,e){return An(Cr(n,e),1)}function d_(n,e){return An(Cr(n,e),Nn)}function __(n,e,t){return t=t===i?1:V(t),An(Cr(n,e),t)}function Kl(n,e){var t=Z(n)?Zn:Ee;return t(n,G(e,3))}function Zl(n,e){var t=Z(n)?Np:Ga;return t(n,G(e,3))}var m_=br(function(n,e,t){tn.call(n,t)?n[t].push(e):pe(n,t,[e])});function y_(n,e,t,r){n=Mn(n)?n:ct(n),t=t&&!r?V(t):0;var u=n.length;return t<0&&(t=yn(u+t,0)),Nr(n)?t<=u&&n.indexOf(e,t)>-1:!!u&&ke(n,e,t)>-1}var w_=Q(function(n,e,t){var r=-1,u=typeof e=="function",a=Mn(n)?x(n.length):[];return Ee(n,function(s){a[++r]=u?Dn(e,s,t):Rt(s,e,t)}),a}),x_=br(function(n,e,t){pe(n,t,e)});function Cr(n,e){var t=Z(n)?sn:Qa;return t(n,G(e,3))}function b_(n,e,t,r){return n==null?[]:(Z(e)||(e=e==null?[]:[e]),t=r?i:t,Z(t)||(t=t==null?[]:[t]),ka(n,e,t))}var S_=br(function(n,e,t){n[t?0:1].push(e)},function(){return[[],[]]});function A_(n,e,t){var r=Z(n)?au:Sa,u=arguments.length<3;return r(n,G(e,4),t,u,Ee)}function O_(n,e,t){var r=Z(n)?$p:Sa,u=arguments.length<3;return r(n,G(e,4),t,u,Ga)}function T_(n,e){var t=Z(n)?Oe:za;return t(n,qr(G(e,3)))}function I_(n){var e=Z(n)?Da:yv;return e(n)}function R_(n,e,t){(t?Rn(n,e,t):e===i)?e=1:e=V(e);var r=Z(n)?Xg:wv;return r(n,e)}function E_(n){var e=Z(n)?Jg:bv;return e(n)}function P_(n){if(n==null)return 0;if(Mn(n))return Nr(n)?et(n):n.length;var e=Tn(n);return e==dn||e==_n?n.size:Iu(n).length}function C_(n,e,t){var r=Z(n)?lu:Sv;return t&&Rn(n,e,t)&&(e=i),r(n,G(e,3))}var L_=Q(function(n,e){if(n==null)return[];var t=e.length;return t>1&&Rn(n,e[0],e[1])?e=[]:t>2&&Rn(e[0],e[1],e[2])&&(e=[e[0]]),ka(n,An(e,1),[])}),Lr=hg||function(){return Sn.Date.now()};function M_(n,e){if(typeof e!="function")throw new Vn(g);return n=V(n),function(){if(--n<1)return e.apply(this,arguments)}}function Vl(n,e,t){return e=t?i:e,e=n&&e==null?n.length:e,ge(n,J,i,i,i,i,e)}function Yl(n,e){var t;if(typeof e!="function")throw new Vn(g);return n=V(n),function(){return--n>0&&(t=e.apply(this,arguments)),n<=1&&(e=i),t}}var Ju=Q(function(n,e,t){var r=I;if(t.length){var u=Ie(t,lt(Ju));r|=W}return ge(n,r,e,t,u)}),Ql=Q(function(n,e,t){var r=I|P;if(t.length){var u=Ie(t,lt(Ql));r|=W}return ge(e,r,n,t,u)});function Xl(n,e,t){e=t?i:e;var r=ge(n,A,i,i,i,i,i,e);return r.placeholder=Xl.placeholder,r}function Jl(n,e,t){e=t?i:e;var r=ge(n,E,i,i,i,i,i,e);return r.placeholder=Jl.placeholder,r}function jl(n,e,t){var r,u,a,s,c,v,O=0,T=!1,R=!1,N=!0;if(typeof n!="function")throw new Vn(g);e=jn(e)||0,hn(t)&&(T=!!t.leading,R="maxWait"in t,a=R?yn(jn(t.maxWait)||0,e):a,N="trailing"in t?!!t.trailing:N);function B(vn){var re=r,ye=u;return r=u=i,O=vn,s=n.apply(ye,re),s}function z(vn){return O=vn,c=Mt(X,e),T?B(vn):s}function Y(vn){var re=vn-v,ye=vn-O,_s=e-re;return R?On(_s,a-ye):_s}function H(vn){var re=vn-v,ye=vn-O;return v===i||re>=e||re<0||R&&ye>=a}function X(){var vn=Lr();if(H(vn))return k(vn);c=Mt(X,Y(vn))}function k(vn){return c=i,N&&r?B(vn):(r=u=i,s)}function Gn(){c!==i&&al(c),O=0,r=v=u=c=i}function En(){return c===i?s:k(Lr())}function zn(){var vn=Lr(),re=H(vn);if(r=arguments,u=this,v=vn,re){if(c===i)return z(v);if(R)return al(c),c=Mt(X,e),B(v)}return c===i&&(c=Mt(X,e)),s}return zn.cancel=Gn,zn.flush=En,zn}var q_=Q(function(n,e){return Ua(n,1,e)}),F_=Q(function(n,e,t){return Ua(n,jn(e)||0,t)});function N_(n){return ge(n,Pn)}function Mr(n,e){if(typeof n!="function"||e!=null&&typeof e!="function")throw new Vn(g);var t=function(){var r=arguments,u=e?e.apply(this,r):r[0],a=t.cache;if(a.has(u))return a.get(u);var s=n.apply(this,r);return t.cache=a.set(u,s)||a,s};return t.cache=new(Mr.Cache||he),t}Mr.Cache=he;function qr(n){if(typeof n!="function")throw new Vn(g);return function(){var e=arguments;switch(e.length){case 0:return!n.call(this);case 1:return!n.call(this,e[0]);case 2:return!n.call(this,e[0],e[1]);case 3:return!n.call(this,e[0],e[1],e[2])}return!n.apply(this,e)}}function $_(n){return Yl(2,n)}var D_=Av(function(n,e){e=e.length==1&&Z(e[0])?sn(e[0],Wn(G())):sn(An(e,1),Wn(G()));var t=e.length;return Q(function(r){for(var u=-1,a=On(r.length,t);++u=e}),Ve=Za(function(){return arguments}())?Za:function(n){return pn(n)&&tn.call(n,"callee")&&!La.call(n,"callee")},Z=x.isArray,k_=pa?Wn(pa):ov;function Mn(n){return n!=null&&Fr(n.length)&&!_e(n)}function gn(n){return pn(n)&&Mn(n)}function n0(n){return n===!0||n===!1||pn(n)&&In(n)==se}var Me=gg||sf,e0=ga?Wn(ga):av;function t0(n){return pn(n)&&n.nodeType===1&&!qt(n)}function r0(n){if(n==null)return!0;if(Mn(n)&&(Z(n)||typeof n=="string"||typeof n.splice=="function"||Me(n)||st(n)||Ve(n)))return!n.length;var e=Tn(n);if(e==dn||e==_n)return!n.size;if(Lt(n))return!Iu(n).length;for(var t in n)if(tn.call(n,t))return!1;return!0}function i0(n,e){return Et(n,e)}function u0(n,e,t){t=typeof t=="function"?t:i;var r=t?t(n,e):i;return r===i?Et(n,e,i,t):!!r}function ku(n){if(!pn(n))return!1;var e=In(n);return e==ie||e==un||typeof n.message=="string"&&typeof n.name=="string"&&!qt(n)}function f0(n){return typeof n=="number"&&qa(n)}function _e(n){if(!hn(n))return!1;var e=In(n);return e==xn||e==Se||e==dt||e==Yt}function ns(n){return typeof n=="number"&&n==V(n)}function Fr(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=wn}function hn(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}function pn(n){return n!=null&&typeof n=="object"}var es=va?Wn(va):sv;function o0(n,e){return n===e||Tu(n,e,zu(e))}function a0(n,e,t){return t=typeof t=="function"?t:i,Tu(n,e,zu(e),t)}function l0(n){return ts(n)&&n!=+n}function s0(n){if(Vv(n))throw new K(d);return Va(n)}function c0(n){return n===null}function h0(n){return n==null}function ts(n){return typeof n=="number"||pn(n)&&In(n)==Cn}function qt(n){if(!pn(n)||In(n)!=Hn)return!1;var e=ar(n);if(e===null)return!0;var t=tn.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&ir.call(t)==ag}var nf=da?Wn(da):cv;function p0(n){return ns(n)&&n>=-wn&&n<=wn}var rs=_a?Wn(_a):hv;function Nr(n){return typeof n=="string"||!Z(n)&&pn(n)&&In(n)==kn}function Un(n){return typeof n=="symbol"||pn(n)&&In(n)==Qt}var st=ma?Wn(ma):pv;function g0(n){return n===i}function v0(n){return pn(n)&&Tn(n)==mt}function d0(n){return pn(n)&&In(n)==Lh}var _0=Tr(Ru),m0=Tr(function(n,e){return n<=e});function is(n){if(!n)return[];if(Mn(n))return Nr(n)?ne(n):Ln(n);if(xt&&n[xt])return Xp(n[xt]());var e=Tn(n),t=e==dn?vu:e==_n?er:ct;return t(n)}function me(n){if(!n)return n===0?n:0;if(n=jn(n),n===Nn||n===-Nn){var e=n<0?-1:1;return e*De}return n===n?n:0}function V(n){var e=me(n),t=e%1;return e===e?t?e-t:e:0}function us(n){return n?ze(V(n),0,$n):0}function jn(n){if(typeof n=="number")return n;if(Un(n))return ae;if(hn(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=hn(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=Aa(n);var t=kh.test(n);return t||ep.test(n)?Mp(n.slice(2),t?2:8):jh.test(n)?ae:+n}function fs(n){return fe(n,qn(n))}function y0(n){return n?ze(V(n),-wn,wn):n===0?n:0}function en(n){return n==null?"":Bn(n)}var w0=ot(function(n,e){if(Lt(e)||Mn(e)){fe(e,bn(e),n);return}for(var t in e)tn.call(e,t)&&Tt(n,t,e[t])}),os=ot(function(n,e){fe(e,qn(e),n)}),$r=ot(function(n,e,t,r){fe(e,qn(e),n,r)}),x0=ot(function(n,e,t,r){fe(e,bn(e),n,r)}),b0=ve(xu);function S0(n,e){var t=ft(n);return e==null?t:Wa(t,e)}var A0=Q(function(n,e){n=fn(n);var t=-1,r=e.length,u=r>2?e[2]:i;for(u&&Rn(e[0],e[1],u)&&(r=1);++t1),a}),fe(n,Uu(n),t),r&&(t=Qn(t,M|F|C,Fv));for(var u=e.length;u--;)Mu(t,e[u]);return t});function G0(n,e){return ls(n,qr(G(e)))}var z0=ve(function(n,e){return n==null?{}:dv(n,e)});function ls(n,e){if(n==null)return{};var t=sn(Uu(n),function(r){return[r]});return e=G(e),nl(n,t,function(r,u){return e(r,u[0])})}function H0(n,e,t){e=Ce(e,n);var r=-1,u=e.length;for(u||(u=1,n=i);++re){var r=n;n=e,e=r}if(t||n%1||e%1){var u=Fa();return On(n+u*(e-n+Lp("1e-"+((u+"").length-1))),e)}return Pu(n,e)}var e1=at(function(n,e,t){return e=e.toLowerCase(),n+(t?hs(e):e)});function hs(n){return rf(en(n).toLowerCase())}function ps(n){return n=en(n),n&&n.replace(rp,Kp).replace(bp,"")}function t1(n,e,t){n=en(n),e=Bn(e);var r=n.length;t=t===i?r:ze(V(t),0,r);var u=t;return t-=e.length,t>=0&&n.slice(t,u)==e}function r1(n){return n=en(n),n&&$h.test(n)?n.replace(Ho,Zp):n}function i1(n){return n=en(n),n&&zh.test(n)?n.replace(ji,"\\$&"):n}var u1=at(function(n,e,t){return n+(t?"-":"")+e.toLowerCase()}),f1=at(function(n,e,t){return n+(t?" ":"")+e.toLowerCase()}),o1=dl("toLowerCase");function a1(n,e,t){n=en(n),e=V(e);var r=e?et(n):0;if(!e||r>=e)return n;var u=(e-r)/2;return Or(hr(u),t)+n+Or(cr(u),t)}function l1(n,e,t){n=en(n),e=V(e);var r=e?et(n):0;return e&&r>>0,t?(n=en(n),n&&(typeof e=="string"||e!=null&&!nf(e))&&(e=Bn(e),!e&&nt(n))?Le(ne(n),0,t):n.split(e,t)):[]}var d1=at(function(n,e,t){return n+(t?" ":"")+rf(e)});function _1(n,e,t){return n=en(n),t=t==null?0:ze(V(t),0,n.length),e=Bn(e),n.slice(t,t+e.length)==e}function m1(n,e,t){var r=o.templateSettings;t&&Rn(n,e,t)&&(e=i),n=en(n),e=$r({},e,r,Sl);var u=$r({},e.imports,r.imports,Sl),a=bn(u),s=gu(u,a),c,v,O=0,T=e.interpolate||Xt,R="__p += '",N=du((e.escape||Xt).source+"|"+T.source+"|"+(T===Ko?Jh:Xt).source+"|"+(e.evaluate||Xt).source+"|$","g"),B="//# sourceURL="+(tn.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Ip+"]")+` -`;n.replace(N,function(H,X,k,Gn,En,zn){return k||(k=Gn),R+=n.slice(O,zn).replace(ip,Vp),X&&(c=!0,R+=`' + -__e(`+X+`) + -'`),En&&(v=!0,R+=`'; -`+En+`; -__p += '`),k&&(R+=`' + -((__t = (`+k+`)) == null ? '' : __t) + -'`),O=zn+H.length,H}),R+=`'; -`;var z=tn.call(e,"variable")&&e.variable;if(!z)R=`with (obj) { -`+R+` -} -`;else if(Qh.test(z))throw new K(y);R=(v?R.replace(Mh,""):R).replace(qh,"$1").replace(Fh,"$1;"),R="function("+(z||"obj")+`) { -`+(z?"":`obj || (obj = {}); -`)+"var __t, __p = ''"+(c?", __e = _.escape":"")+(v?`, __j = Array.prototype.join; -function print() { __p += __j.call(arguments, '') } -`:`; -`)+R+`return __p -}`;var Y=vs(function(){return nn(a,B+"return "+R).apply(i,s)});if(Y.source=R,ku(Y))throw Y;return Y}function y1(n){return en(n).toLowerCase()}function w1(n){return en(n).toUpperCase()}function x1(n,e,t){if(n=en(n),n&&(t||e===i))return Aa(n);if(!n||!(e=Bn(e)))return n;var r=ne(n),u=ne(e),a=Oa(r,u),s=Ta(r,u)+1;return Le(r,a,s).join("")}function b1(n,e,t){if(n=en(n),n&&(t||e===i))return n.slice(0,Ra(n)+1);if(!n||!(e=Bn(e)))return n;var r=ne(n),u=Ta(r,ne(e))+1;return Le(r,0,u).join("")}function S1(n,e,t){if(n=en(n),n&&(t||e===i))return n.replace(ki,"");if(!n||!(e=Bn(e)))return n;var r=ne(n),u=Oa(r,ne(e));return Le(r,u).join("")}function A1(n,e){var t=gt,r=Ht;if(hn(e)){var u="separator"in e?e.separator:u;t="length"in e?V(e.length):t,r="omission"in e?Bn(e.omission):r}n=en(n);var a=n.length;if(nt(n)){var s=ne(n);a=s.length}if(t>=a)return n;var c=t-et(r);if(c<1)return r;var v=s?Le(s,0,c).join(""):n.slice(0,c);if(u===i)return v+r;if(s&&(c+=v.length-c),nf(u)){if(n.slice(c).search(u)){var O,T=v;for(u.global||(u=du(u.source,en(Zo.exec(u))+"g")),u.lastIndex=0;O=u.exec(T);)var R=O.index;v=v.slice(0,R===i?c:R)}}else if(n.indexOf(Bn(u),c)!=c){var N=v.lastIndexOf(u);N>-1&&(v=v.slice(0,N))}return v+r}function O1(n){return n=en(n),n&&Nh.test(n)?n.replace(zo,ng):n}var T1=at(function(n,e,t){return n+(t?" ":"")+e.toUpperCase()}),rf=dl("toUpperCase");function gs(n,e,t){return n=en(n),e=t?i:e,e===i?Qp(n)?rg(n):Bp(n):n.match(e)||[]}var vs=Q(function(n,e){try{return Dn(n,i,e)}catch(t){return ku(t)?t:new K(t)}}),I1=ve(function(n,e){return Zn(e,function(t){t=oe(t),pe(n,t,Ju(n[t],n))}),n});function R1(n){var e=n==null?0:n.length,t=G();return n=e?sn(n,function(r){if(typeof r[1]!="function")throw new Vn(g);return[t(r[0]),r[1]]}):[],Q(function(r){for(var u=-1;++uwn)return[];var t=$n,r=On(n,$n);e=G(e),n-=$n;for(var u=pu(r,e);++t0||e<0)?new j(t):(n<0?t=t.takeRight(-n):n&&(t=t.drop(n)),e!==i&&(e=V(e),t=e<0?t.dropRight(-e):t.take(e-n)),t)},j.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},j.prototype.toArray=function(){return this.take($n)},ue(j.prototype,function(n,e){var t=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),u=o[r?"take"+(e=="last"?"Right":""):e],a=r||/^find/.test(e);u&&(o.prototype[e]=function(){var s=this.__wrapped__,c=r?[1]:arguments,v=s instanceof j,O=c[0],T=v||Z(s),R=function(X){var k=u.apply(o,Te([X],c));return r&&N?k[0]:k};T&&t&&typeof O=="function"&&O.length!=1&&(v=T=!1);var N=this.__chain__,B=!!this.__actions__.length,z=a&&!N,Y=v&&!B;if(!a&&T){s=Y?s:new j(this);var H=n.apply(s,c);return H.__actions__.push({func:Pr,args:[R],thisArg:i}),new Yn(H,N)}return z&&Y?n.apply(this,c):(H=this.thru(R),z?r?H.value()[0]:H.value():H)})}),Zn(["pop","push","shift","sort","splice","unshift"],function(n){var e=tr[n],t=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",r=/^(?:pop|shift)$/.test(n);o.prototype[n]=function(){var u=arguments;if(r&&!this.__chain__){var a=this.value();return e.apply(Z(a)?a:[],u)}return this[t](function(s){return e.apply(Z(s)?s:[],u)})}}),ue(j.prototype,function(n,e){var t=o[e];if(t){var r=t.name+"";tn.call(ut,r)||(ut[r]=[]),ut[r].push({name:e,func:t})}}),ut[Sr(i,P).name]=[{name:"wrapper",func:i}],j.prototype.clone=Og,j.prototype.reverse=Tg,j.prototype.value=Ig,o.prototype.at=t_,o.prototype.chain=r_,o.prototype.commit=i_,o.prototype.next=u_,o.prototype.plant=o_,o.prototype.reverse=a_,o.prototype.toJSON=o.prototype.valueOf=o.prototype.value=l_,o.prototype.first=o.prototype.head,xt&&(o.prototype[xt]=f_),o},tt=ig();We?((We.exports=tt)._=tt,uu._=tt):Sn._=tt}).call(Ye)}(Gt,Gt.exports);var cn=Gt.exports;function Ni(f={},l){const i={};for(const h of Object.keys(f))i[h]=h==="$"?f[h]:l(f[h],h,f);return Object.setPrototypeOf(i,f)}var Wo={exports:{}};(function(f,l){(function(i,h){f.exports=h()})(Ye,function(){return function(i){function h(d){if(m[d])return m[d].exports;var g=m[d]={i:d,l:!1,exports:{}};return i[d].call(g.exports,g,g.exports,h),g.l=!0,g.exports}var m={};return h.m=i,h.c=m,h.d=function(d,g,y){h.o(d,g)||Object.defineProperty(d,g,{configurable:!1,enumerable:!0,get:y})},h.n=function(d){var g=d&&d.__esModule?function(){return d.default}:function(){return d};return h.d(g,"a",g),g},h.o=function(d,g){return Object.prototype.hasOwnProperty.call(d,g)},h.p="",h(h.s=1)}([function(i,h,m){function d(y){var w=y===void 0?{}:y,_=w.ESCAPE,b=_===void 0?/^\\/:_,M=w.VARIABLE_START,F=M===void 0?/^\${\s*/:M,C=w.VARIABLE_END,D=C===void 0?/^\s*}/:C,q=w.PIPE_START,I=q===void 0?/^\s*\|\s*/:q,P=w.PIPE_PARAMETER_START,L=P===void 0?/^\s*:\s*/:P,A=w.QUOTED_STRING,E=A===void 0?h.DEFAULT_QUOTED_STRING_REGEX:A,W=w.QUOTED_STRING_TEST,U=W===void 0?null:W,J=w.QUOTED_STRING_GET_AND_ADVANCE,rn=J===void 0?null:J,Pn=w.QUOTED_STRING_IN_PARAMETER_TEST,gt=Pn===void 0?null:Pn,Ht=w.QUOTED_STRING_IN_PARAMETER_GET_AND_ADVANCE,Wi=Ht===void 0?null:Ht,Kt=U||function(Nn){return E.test(Nn)},vt=rn||g(E),Bi=gt||function(Nn){return E.test(Nn)},Ui=Wi||g(E);return function(Nn){function wn(an){an===void 0&&(an=1),un=un.substr(an)}function De(an){an===void 0&&(an=/^/),wn(un.match(an)[0].length)}function ae(){var an;return De(b),an=un.length>0?un[0]:"",wn(),an}function $n(an){var _n=(an===void 0?{}:an).isNull,kn=_n!==void 0&&_n;dn={name:"",pipes:[]},Hn=!kn}function Gi(){ie.variables.push(dn),$n({isNull:!0})}function Zt(an){var _n=(an===void 0?{}:an).isNull,kn=_n!==void 0&&_n;Cn={name:"",parameters:[]},_t=!kn}function Vt(){dn.pipes.push(Cn),Zt({isNull:!0})}function le(an){var _n=(an===void 0?{}:an).isNull,kn=_n!==void 0&&_n;Ae="",Yt=!kn}function xe(){Cn.parameters.push(Ae),le({isNull:!0})}function dt(){return!!D.test(un)&&(De(D),xn>=3&&xe(),xn>=2&&Vt(),xn>=1&&Gi(),xn=0,!0)}function se(){return!!I.test(un)&&(De(I),xn>=3&&xe(),xn>=2&&Vt(),xn>=1&&Zt(),xn=2,!0)}function be(){return!!L.test(un)&&(De(L),xn>=3&&xe(),xn>=2&&le(),xn=3,!0)}for(var un=Nn,ie={literals:[],variables:[]},xn=0,Se="",dn={name:"",pipes:[]},Cn={name:"",parameters:[]},Ae="",Hn=!1,_t=!1,Yt=!1;un&&un.length>0;)switch(xn){case 0:if(b.test(un)){Se+=ae();continue}if(F.test(un)){xn=1,$n(),ie.literals.push(Se),Se="",De(F);continue}Se+=un[0],wn();break;case 1:if(b.test(un)){dn.name+=ae();continue}if(dt()||se())continue;if(Kt(un)){dn.name+=vt(un,wn);continue}dn.name+=un[0],wn();break;case 2:if(b.test(un)){Cn.name+=ae();continue}if(dt()||be()||se())continue;if(Kt(un)){Cn.name+=vt(un,wn);continue}Cn.name+=un[0],wn();break;case 3:if(b.test(un)){Ae+=ae();continue}if(dt()||be()||se())continue;if(Bi(un)){Ae+=Ui(un,wn);continue}Ae+=un[0],wn()}return Yt&&Cn.parameters.push(Ae),_t&&dn.pipes.push(Cn),Hn&&ie.variables.push(dn),ie.literals.push(Se),ie}}function g(y){return function(w,_){var b=w.match(y);return _(b[0].length),b.slice(2).join("").replace("\\\\","\\")}}Object.defineProperty(h,"__esModule",{value:!0}),h.DEFAULT_QUOTED_STRING_REGEX=/^('((?:[^'\\]|\\.)*)'|'((?:[^'\\]|\\.)*)$|"((?:[^"\\]|\\.)*)"|"((?:[^"\\]|\\.)*)$)/,h.parseStringTemplateGenerator=d,h.parseStringTemplate=d(),h.getQuotedStringAndAdvanceForRegex=g},function(i,h,m){i.exports=m(2)},function(i,h,m){function d(g){for(var y in g)h.hasOwnProperty(y)||(h[y]=g[y])}Object.defineProperty(h,"__esModule",{value:!0}),d(m(0)),d(m(3))},function(i,h,m){function d(b){return function(M){return b.hasOwnProperty(M)?b[M]:M.split(".").reduce(function(F,C){return F.hasOwnProperty(C)?F[C]:""},b)}}function g(b,M,F,C){C===void 0&&(C=d(M));var D=C(b.name);return b.pipes.reduce(function(q,I){return F.hasOwnProperty(I.name)?F[I.name](q,I.parameters):q},D??"")}function y(b,M,F,C){return C===void 0&&(C=d(M)),b.literals.length===0?"":b.literals.slice(1).reduce(function(D,q,I){return""+D+g(b.variables[I],M,F,C)+q},b.literals[0])}function w(b,M,F){return y(_.parseStringTemplate(b),M,F)}Object.defineProperty(h,"__esModule",{value:!0});var _=m(0);h.evaluateParsedString=y,h.evaluateStringTemplate=w}])})})(Wo);var Bo=Wo.exports;const Uo=f=>{const l=Function("$",`return ${f};`);return i=>l(new Proxy(zt(i),{get(h,m){return typeof(h==null?void 0:h[m])=="function"?h[m]({}):h==null?void 0:h[m]}}))},bh=/^\{\{\s*/,Sh=/^\s*\}\}/,$i=/\b\B/,Ah=Bo.parseStringTemplateGenerator({VARIABLE_START:bh,VARIABLE_END:Sh,PIPE_START:$i,PIPE_PARAMETER_START:$i,QUOTED_STRING:$i}),Oh=wh(f=>{const l=Ah(f);return cn.join(l.literals,"")?i=>Bo.evaluateParsedString(l,{},{},h=>Uo(h)(i)):Uo(l.variables[0].name)},{primitive:!0});function Xe(f){switch(f==null?void 0:f.constructor){case Array:{const l=cn.map(f,Xe);return i=>cn.map(l,h=>h(i))}case Object:{const l=cn.mapValues(f,Xe);return i=>cn.mapValues(l,h=>h(i))}case String:return Oh(f);default:return()=>f}}function zt(f={}){return Ni(f,l=>cn.isFunction(l)?l:Xe(l))}function Th(f={}){return new Proxy(f,{get:(l,i)=>typeof l[i]=="function"?l[i]:()=>l[i]})}function Di(f,l){return Object.setPrototypeOf(Ni(l,i=>h=>i(f)),f)}function Ih(f){const{$for:l,...i}=f;if(l){const{$let:h="i",$from:m=0,$to:d=1,$step:g=1}=l,y=Xe(m),w=Xe(d),_=Xe(g);return(b={})=>cn.range(y(b),w(b),_(b)).map(M=>{const F=Di(b,zt({[h]:M}));return Di(F,zt(i))})}else return(h={})=>[Di(h,zt(i))]}function Rh(f,l){const i=d=>{const{$:g}=d,y=Ih(d);return g in l?w=>cn.flatMap(y(w),_=>cn.flatMap(h[g],b=>b(_))):w=>cn.map(y(w),_=>Object.setPrototypeOf(Ni(_,b=>b(_)),null))},h=cn.mapValues(l,d=>cn.map(d,i)),m=cn.flatMap(f,i);return d=>cn.flatMap(m,g=>g(d))}const Eh=f=>f==null,Go=f=>f.display!=="transient";function Ph({trace:f,context:l,view:i="main",from:h=0,to:m=(d=>(d=f==null?void 0:f.events)==null?void 0:d.length)()??0}){var M,F,C,D;const g=Rh(((C=(F=(M=f==null?void 0:f.render)==null?void 0:M.views)==null?void 0:F[i])==null?void 0:C.components)??[],((D=f==null?void 0:f.render)==null?void 0:D.components)??{}),y=q=>q&&Object.hasOwn(q,"alpha")?q.alpha>0:!0,w=q=>I=>({component:I,meta:{source:"trace",step:h+q,info:I.$info}}),_=cn.chain(f==null?void 0:f.events).map((q,I)=>({step:I,id:q.id,data:q,pId:q.pId})).groupBy("id").value(),b=cn.chain(cn.range(h,m)).map(q=>{var W;const I=f.events[q],P=f.events,L=g(Th({alpha:1,...l,step:q,parent:Eh(I.pId)?void 0:P[((W=cn.findLast(_[I.pId],U=>U.step<=q))==null?void 0:W.step)??0],event:I,events:P})),A=L.filter(Go),E=L.filter(cn.negate(Go));return{persistent:A,transient:E}}).map(q=>cn.mapValues(q,I=>I.filter(y))).map((q,I)=>cn.mapValues(q,P=>P.map(w(I)))).value();return{stepsPersistent:cn.map(b,q=>q.persistent),stepsTransient:cn.map(b,q=>q.transient)}}onmessage=xh(async({data:f})=>Ph(f))})(); diff --git a/assets/parseTraceSlave.worker-682281af.js b/assets/parseTraceSlave.worker-682281af.js new file mode 100644 index 0000000..6ed2d1d --- /dev/null +++ b/assets/parseTraceSlave.worker-682281af.js @@ -0,0 +1,28 @@ +(function(){"use strict";var Ye=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ws(f){return f&&f.__esModule&&Object.prototype.hasOwnProperty.call(f,"default")?f.default:f}var xs=function(){},bs=xs(),Me=function(f){return f!==bs&&f!==null},Ss=Me,As=Array.prototype.forEach,Os=Object.create,Ts=function(f,l){var i;for(i in f)l[i]=f[i]},hf=function(f){var l=Os(null);return As.call(arguments,function(i){Ss(i)&&Ts(Object(i),l)}),l},Is=function(){var f=Math.sign;return typeof f!="function"?!1:f(10)===1&&f(-20)===-1},Dr,pf;function Rs(){return pf||(pf=1,Dr=function(f){return f=Number(f),isNaN(f)||f===0?f:f>0?1:-1}),Dr}var Es=Is()?Math.sign:Rs(),Ps=Es,Cs=Math.abs,Ls=Math.floor,qs=function(f){return isNaN(f)?0:(f=Number(f),f===0||!isFinite(f)?f:Ps(f)*Ls(Cs(f)))},Ms=qs,Fs=Math.max,Fe=function(f){return Fs(0,Ms(f))},Ns=Fe,gf=function(f,l,i){var h;return isNaN(f)?(h=l,h>=0?i&&h?h-1:h:1):f===!1?!1:Ns(f)},we=function(f){if(typeof f!="function")throw new TypeError(f+" is not a function");return f},$s=Me,Qe=function(f){if(!$s(f))throw new TypeError("Cannot use null or undefined");return f},Ds=we,Ws=Qe,Bs=Function.prototype.bind,vf=Function.prototype.call,Us=Object.keys,Gs=Object.prototype.propertyIsEnumerable,zs=function(f,l){return function(i,h){var m,d=arguments[2],g=arguments[3];return i=Object(Ws(i)),Ds(h),m=Us(i),g&&m.sort(typeof g=="function"?Bs.call(g,i):void 0),typeof f!="function"&&(f=m[f]),vf.call(f,m,function(y,w){return Gs.call(i,y)?vf.call(h,d,i[y],y,i,w):l})}},Ft=zs("forEach"),Ne={},df={exports:{}},Hs=function(){var f=Object.assign,l;return typeof f!="function"?!1:(l={foo:"raz"},f(l,{bar:"dwa"},{trzy:"trzy"}),l.foo+l.bar+l.trzy==="razdwatrzy")},Wr,_f;function Ks(){return _f||(_f=1,Wr=function(){try{return Object.keys("primitive"),!0}catch{return!1}}),Wr}var Br,mf;function Zs(){if(mf)return Br;mf=1;var f=Me,l=Object.keys;return Br=function(i){return l(f(i)?Object(i):i)},Br}var Ur,yf;function Vs(){return yf||(yf=1,Ur=Ks()()?Object.keys:Zs()),Ur}var Gr,wf;function Ys(){if(wf)return Gr;wf=1;var f=Vs(),l=Qe,i=Math.max;return Gr=function(h,m){var d,g,y=i(arguments.length,2),w;for(h=Object(l(h)),w=function(_){try{h[_]=m[_]}catch(b){d||(d=b)}},g=1;g-1},Vr}var pc=cc()?String.prototype.contains:hc(),Nt=Cf,qf=sc,Mf=xf,Ff=hf,ht=pc,gc=Pf.exports=function(f,l){var i,h,m,d,g;return arguments.length<2||typeof f!="string"?(d=l,l=f,f=null):d=arguments[2],Nt(f)?(i=ht.call(f,"c"),h=ht.call(f,"e"),m=ht.call(f,"w")):(i=m=!0,h=!1),g={value:l,configurable:i,enumerable:h,writable:m},d?Mf(Ff(d),g):g};gc.gs=function(f,l,i){var h,m,d,g;return typeof f!="string"?(d=i,i=l,l=f,f=null):d=arguments[3],Nt(l)?qf(l)?Nt(i)?qf(i)||(d=i,i=void 0):i=void 0:(d=l,l=i=void 0):l=void 0,Nt(f)?(h=ht.call(f,"c"),m=ht.call(f,"e")):(h=!0,m=!1),g={get:l,set:i,configurable:h,enumerable:m},d?Mf(Ff(d),g):g};var $e=Pf.exports,Yr={exports:{}};(function(f,l){var i=$e,h=we,m=Function.prototype.apply,d=Function.prototype.call,g=Object.create,y=Object.defineProperty,w=Object.defineProperties,_=Object.prototype.hasOwnProperty,b={configurable:!0,enumerable:!1,writable:!0},q,F,C,D,M,I,P;q=function(L,A){var E;return h(A),_.call(this,"__ee__")?E=this.__ee__:(E=b.value=g(null),y(this,"__ee__",b),b.value=null),E[L]?typeof E[L]=="object"?E[L].push(A):E[L]=[E[L],A]:E[L]=A,this},F=function(L,A){var E,W;return h(A),W=this,q.call(this,L,E=function(){C.call(W,L,E),m.call(A,this,arguments)}),E.__eeOnceListener__=A,this},C=function(L,A){var E,W,U,J;if(h(A),!_.call(this,"__ee__"))return this;if(E=this.__ee__,!E[L])return this;if(W=E[L],typeof W=="object")for(J=0;U=W[J];++J)(U===A||U.__eeOnceListener__===A)&&(W.length===2?E[L]=W[J?0:1]:W.splice(J,1));else(W===A||W.__eeOnceListener__===A)&&delete E[L];return this},D=function(L){var A,E,W,U,J;if(_.call(this,"__ee__")&&(U=this.__ee__[L],!!U))if(typeof U=="object"){for(E=arguments.length,J=new Array(E-1),A=1;A=55296&&E<=56319&&(rn+=F[++I])),rn=C?_.call(C,D,rn,P):rn,M?(b.value=rn,q(L,P,b)):L[P]=rn,++P;A=P}}if(A===void 0)for(A=h(F.length),M&&(L=new M(A)),I=0;I=0?b=g(b):b=l(this.length)-g(d(b)),w=b;w<_;++w)if(m.call(this,w)&&(q=this[w],f(q)))return w;return-1},wi}var bi,so;function eh(){if(so)return bi;so=1;var f=xi(),l=Object.create;return bi=function(){var i=0,h=[],m=l(null);return{get:function(d){var g=0,y=h,w,_=d.length;if(_===0)return y[_]||null;if(y=y[_]){for(;g<_-1;){if(w=f.call(y[0],d[g]),w===-1)return null;y=y[1][w],++g}return w=f.call(y[0],d[g]),w===-1?null:y[1][w]||null}return null},set:function(d){var g=0,y=h,w,_=d.length;if(_===0)y[_]=++i;else{for(y[_]||(y[_]=[[],[]]),y=y[_];g<_-1;)w=f.call(y[0],d[g]),w===-1&&(w=y[0].push(d[g])-1,y[1].push([[],[]])),y=y[1][w],++g;w=f.call(y[0],d[g]),w===-1&&(w=y[0].push(d[g])-1),y[1][w]=++i}return m[i]=d,i},delete:function(d){var g=0,y=h,w,_=m[d],b=_.length,q=[];if(b===0)delete y[b];else if(y=y[b]){for(;g"}},Li}var qi,To;function lh(){if(To)return qi;To=1;var f=ah(),l=/[\n\r\u2028\u2029]/g;return qi=function(i){var h=f(i);return h.length>100&&(h=h.slice(0,99)+"…"),h=h.replace(l,function(m){return JSON.stringify(m).slice(1,-1)}),h},qi}var Ut={exports:{}},Io;function Ro(){if(Io)return Ut.exports;Io=1,Ut.exports=f,Ut.exports.default=f;function f(l){return!!l&&(typeof l=="object"||typeof l=="function")&&typeof l.then=="function"}return Ut.exports}var Eo;function sh(){if(Eo)return yo;Eo=1;var f=vo(),l=uh(),i=oh(),h=lh(),m=Ro(),d=Ii(),g=Object.create,y=l("then","then:finally","done","done:finally");return Ne.promise=function(w,_){var b=g(null),q=g(null),F=g(null);if(w===!0)w=null;else if(w=i(w),!y[w])throw new TypeError("'"+h(w)+"' is not valid promise mode");_.on("set",function(C,D,M){var I=!1;if(!m(M)){q[C]=M,_.emit("setasync",C,1);return}b[C]=1,F[C]=M;var P=function(W){var U=b[C];if(I)throw new Error(`Memoizee error: Detected unordered then|done & finally resolution, which in turn makes proper detection of success/failure impossible (when in 'done:finally' mode) +Consider to rely on 'then' or 'done' mode instead.`);U&&(delete b[C],q[C]=W,_.emit("setasync",C,U))},L=function(){I=!0,b[C]&&(delete b[C],delete F[C],_.delete(C))},A=w;if(A||(A="then"),A==="then"){var E=function(){d(L)};M=M.then(function(W){d(P.bind(this,W))},E),typeof M.finally=="function"&&M.finally(E)}else if(A==="done"){if(typeof M.done!="function")throw new Error("Memoizee error: Retrieved promise does not implement 'done' in 'done' mode");M.done(P,L)}else if(A==="done:finally"){if(typeof M.done!="function")throw new Error("Memoizee error: Retrieved promise does not implement 'done' in 'done:finally' mode");if(typeof M.finally!="function")throw new Error("Memoizee error: Retrieved promise does not implement 'finally' in 'done:finally' mode");M.done(P),M.finally(L)}}),_.on("get",function(C,D,M){var I;if(b[C]){++b[C];return}I=F[C];var P=function(){_.emit("getasync",C,D,M)};m(I)?typeof I.done=="function"?I.done(P):I.then(function(){d(P)}):P()}),_.on("delete",function(C){if(delete F[C],b[C]){delete b[C];return}if(hasOwnProperty.call(q,C)){var D=q[C];delete q[C],_.emit("deleteasync",C,[D])}}),_.on("clear",function(){var C=q;q=g(null),b=g(null),F=g(null),_.emit("clearasync",f(C,function(D){return[D]}))})},yo}var Po={},Co;function ch(){if(Co)return Po;Co=1;var f=we,l=Ft,i=Ne,h=Function.prototype.apply;return i.dispose=function(m,d,g){var y;if(f(m),g.async&&i.async||g.promise&&i.promise){d.on("deleteasync",y=function(w,_){h.call(m,null,_)}),d.on("clearasync",function(w){l(w,function(_,b){y(b,_)})});return}d.on("delete",y=function(w,_){m(_)}),d.on("clear",function(w){l(w,function(_,b){y(b,_)})})},Po}var Lo={},Mi,qo;function hh(){return qo||(qo=1,Mi=2147483647),Mi}var Fi,Mo;function ph(){if(Mo)return Fi;Mo=1;var f=Fe,l=hh();return Fi=function(i){if(i=f(i),i>l)throw new TypeError(i+" exceeds maximum possible timeout");return i},Fi}var Fo;function gh(){if(Fo)return Lo;Fo=1;var f=hi(),l=Ft,i=Ii(),h=Ro(),m=ph(),d=Ne,g=Function.prototype,y=Math.max,w=Math.min,_=Object.create;return d.maxAge=function(b,q,F){var C,D,M,I;b=m(b),b&&(C=_(null),D=F.async&&d.async||F.promise&&d.promise?"async":"",q.on("set"+D,function(P){C[P]=setTimeout(function(){q.delete(P)},b),typeof C[P].unref=="function"&&C[P].unref(),I&&(I[P]&&I[P]!=="nextTick"&&clearTimeout(I[P]),I[P]=setTimeout(function(){delete I[P]},M),typeof I[P].unref=="function"&&I[P].unref())}),q.on("delete"+D,function(P){clearTimeout(C[P]),delete C[P],I&&(I[P]!=="nextTick"&&clearTimeout(I[P]),delete I[P])}),F.preFetch&&(F.preFetch===!0||isNaN(F.preFetch)?M=.333:M=y(w(Number(F.preFetch),1),0),M&&(I={},M=(1-M)*b,q.on("get"+D,function(P,L,A){I[P]||(I[P]="nextTick",i(function(){var E;I[P]==="nextTick"&&(delete I[P],q.delete(P),F.async&&(L=f(L),L.push(g)),E=q.memoized.apply(A,L),F.promise&&h(E)&&(typeof E.done=="function"?E.done(g,g):E.then(g,g)))}))}))),q.on("clear"+D,function(){l(C,function(P){clearTimeout(P)}),C={},I&&(l(I,function(P){P!=="nextTick"&&clearTimeout(P)}),I={})}))},Lo}var No={},Ni,$o;function vh(){if($o)return Ni;$o=1;var f=Fe,l=Object.create,i=Object.prototype.hasOwnProperty;return Ni=function(h){var m=0,d=1,g=l(null),y=l(null),w=0,_;return h=f(h),{hit:function(b){var q=y[b],F=++w;if(g[F]=b,y[b]=F,!q)return++m,m<=h?void 0:(b=g[d],_(b),b);if(delete g[q],d===q)for(;!i.call(g,++d););},delete:_=function(b){var q=y[b];if(q&&(delete g[q],delete y[b],--m,d===q)){if(!m){w=0,d=1;return}for(;!i.call(g,++d););}},clear:function(){m=0,d=1,g=l(null),y=l(null),w=0}}},Ni}var Do;function dh(){if(Do)return No;Do=1;var f=Fe,l=vh(),i=Ne;return i.max=function(h,m,d){var g,y,w;h=f(h),h&&(y=l(h),g=d.async&&i.async||d.promise&&i.promise?"async":"",m.on("set"+g,w=function(_){_=y.hit(_),_!==void 0&&m.delete(_)}),m.on("get"+g,w),m.on("delete"+g,y.delete),m.on("clear"+g,y.clear))},No}var Wo={},Bo;function _h(){if(Bo)return Wo;Bo=1;var f=$e,l=Ne,i=Object.create,h=Object.defineProperties;return l.refCounter=function(m,d,g){var y,w;y=i(null),w=g.async&&l.async||g.promise&&l.promise?"async":"",d.on("set"+w,function(_,b){y[_]=b||1}),d.on("get"+w,function(_){++y[_]}),d.on("delete"+w,function(_){delete y[_]}),d.on("clear"+w,function(){y={}}),h(d.memoized,{deleteRef:f(function(){var _=d.get(arguments);return _===null||!y[_]?null:--y[_]?!1:(d.delete(_),!0)}),getRefCount:f(function(){var _=d.get(arguments);return _===null||!y[_]?0:y[_]})})},Wo}var mh=hf,yh=gf,wh=Qc,xh=function(f){var l=mh(arguments[1]),i;return l.normalizer||(i=l.length=yh(l.length,f.length,l.async),i!==0&&(l.primitive?i===!1?l.normalizer=Xc():i>1&&(l.normalizer=Jc()(i)):i===!1?l.normalizer=eh()():i===1?l.normalizer=th()():l.normalizer=rh()(i))),l.async&&ih(),l.promise&&sh(),l.dispose&&ch(),l.maxAge&&gh(),l.max&&dh(),l.refCounter&&_h(),wh(f,l)},bh=ws(xh);const Sh=f=>async l=>{try{const i=await f(l);postMessage({result:i})}catch(i){postMessage({error:i})}};var Gt={exports:{}};/** + * @license + * Lodash + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */Gt.exports,function(f,l){(function(){var i,h="4.17.21",m=200,d="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",g="Expected a function",y="Invalid `variable` option passed into `_.template`",w="__lodash_hash_undefined__",_=500,b="__lodash_placeholder__",q=1,F=2,C=4,D=1,M=2,I=1,P=2,L=4,A=8,E=16,W=32,U=64,J=128,rn=256,Pn=512,gt=30,Ht="...",Bi=800,Kt=16,vt=1,Ui=2,Gi=3,Nn=1/0,wn=9007199254740991,De=17976931348623157e292,ae=0/0,$n=4294967295,zi=$n-1,Zt=$n>>>1,Vt=[["ary",J],["bind",I],["bindKey",P],["curry",A],["curryRight",E],["flip",Pn],["partial",W],["partialRight",U],["rearg",rn]],le="[object Arguments]",xe="[object Array]",dt="[object AsyncFunction]",se="[object Boolean]",be="[object Date]",un="[object DOMException]",ie="[object Error]",xn="[object Function]",Se="[object GeneratorFunction]",dn="[object Map]",Cn="[object Number]",Ae="[object Null]",Hn="[object Object]",_t="[object Promise]",Yt="[object Proxy]",an="[object RegExp]",_n="[object Set]",kn="[object String]",Qt="[object Symbol]",qh="[object Undefined]",mt="[object WeakMap]",Mh="[object WeakSet]",yt="[object ArrayBuffer]",Je="[object DataView]",Hi="[object Float32Array]",Ki="[object Float64Array]",Zi="[object Int8Array]",Vi="[object Int16Array]",Yi="[object Int32Array]",Qi="[object Uint8Array]",Xi="[object Uint8ClampedArray]",Ji="[object Uint16Array]",ji="[object Uint32Array]",Fh=/\b__p \+= '';/g,Nh=/\b(__p \+=) '' \+/g,$h=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ko=/&(?:amp|lt|gt|quot|#39);/g,Zo=/[&<>"']/g,Dh=RegExp(Ko.source),Wh=RegExp(Zo.source),Bh=/<%-([\s\S]+?)%>/g,Uh=/<%([\s\S]+?)%>/g,Vo=/<%=([\s\S]+?)%>/g,Gh=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,zh=/^\w*$/,Hh=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ki=/[\\^$.*+?()[\]{}|]/g,Kh=RegExp(ki.source),nu=/^\s+/,Zh=/\s/,Vh=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Yh=/\{\n\/\* \[wrapped with (.+)\] \*/,Qh=/,? & /,Xh=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Jh=/[()=,{}\[\]\/\s]/,jh=/\\(\\)?/g,kh=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Yo=/\w*$/,np=/^[-+]0x[0-9a-f]+$/i,ep=/^0b[01]+$/i,tp=/^\[object .+?Constructor\]$/,rp=/^0o[0-7]+$/i,ip=/^(?:0|[1-9]\d*)$/,up=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Xt=/($^)/,fp=/['\n\r\u2028\u2029\\]/g,Jt="\\ud800-\\udfff",op="\\u0300-\\u036f",ap="\\ufe20-\\ufe2f",lp="\\u20d0-\\u20ff",Qo=op+ap+lp,Xo="\\u2700-\\u27bf",Jo="a-z\\xdf-\\xf6\\xf8-\\xff",sp="\\xac\\xb1\\xd7\\xf7",cp="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",hp="\\u2000-\\u206f",pp=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",jo="A-Z\\xc0-\\xd6\\xd8-\\xde",ko="\\ufe0e\\ufe0f",na=sp+cp+hp+pp,eu="['’]",gp="["+Jt+"]",ea="["+na+"]",jt="["+Qo+"]",ta="\\d+",vp="["+Xo+"]",ra="["+Jo+"]",ia="[^"+Jt+na+ta+Xo+Jo+jo+"]",tu="\\ud83c[\\udffb-\\udfff]",dp="(?:"+jt+"|"+tu+")",ua="[^"+Jt+"]",ru="(?:\\ud83c[\\udde6-\\uddff]){2}",iu="[\\ud800-\\udbff][\\udc00-\\udfff]",je="["+jo+"]",fa="\\u200d",oa="(?:"+ra+"|"+ia+")",_p="(?:"+je+"|"+ia+")",aa="(?:"+eu+"(?:d|ll|m|re|s|t|ve))?",la="(?:"+eu+"(?:D|LL|M|RE|S|T|VE))?",sa=dp+"?",ca="["+ko+"]?",mp="(?:"+fa+"(?:"+[ua,ru,iu].join("|")+")"+ca+sa+")*",yp="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",wp="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",ha=ca+sa+mp,xp="(?:"+[vp,ru,iu].join("|")+")"+ha,bp="(?:"+[ua+jt+"?",jt,ru,iu,gp].join("|")+")",Sp=RegExp(eu,"g"),Ap=RegExp(jt,"g"),uu=RegExp(tu+"(?="+tu+")|"+bp+ha,"g"),Op=RegExp([je+"?"+ra+"+"+aa+"(?="+[ea,je,"$"].join("|")+")",_p+"+"+la+"(?="+[ea,je+oa,"$"].join("|")+")",je+"?"+oa+"+"+aa,je+"+"+la,wp,yp,ta,xp].join("|"),"g"),Tp=RegExp("["+fa+Jt+Qo+ko+"]"),Ip=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Rp=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Ep=-1,ln={};ln[Hi]=ln[Ki]=ln[Zi]=ln[Vi]=ln[Yi]=ln[Qi]=ln[Xi]=ln[Ji]=ln[ji]=!0,ln[le]=ln[xe]=ln[yt]=ln[se]=ln[Je]=ln[be]=ln[ie]=ln[xn]=ln[dn]=ln[Cn]=ln[Hn]=ln[an]=ln[_n]=ln[kn]=ln[mt]=!1;var on={};on[le]=on[xe]=on[yt]=on[Je]=on[se]=on[be]=on[Hi]=on[Ki]=on[Zi]=on[Vi]=on[Yi]=on[dn]=on[Cn]=on[Hn]=on[an]=on[_n]=on[kn]=on[Qt]=on[Qi]=on[Xi]=on[Ji]=on[ji]=!0,on[ie]=on[xn]=on[mt]=!1;var Pp={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Cp={"&":"&","<":"<",">":">",'"':""","'":"'"},Lp={"&":"&","<":"<",">":">",""":'"',"'":"'"},qp={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Mp=parseFloat,Fp=parseInt,pa=typeof Ye=="object"&&Ye&&Ye.Object===Object&&Ye,Np=typeof self=="object"&&self&&self.Object===Object&&self,Sn=pa||Np||Function("return this")(),fu=l&&!l.nodeType&&l,We=fu&&!0&&f&&!f.nodeType&&f,ga=We&&We.exports===fu,ou=ga&&pa.process,Kn=function(){try{var p=We&&We.require&&We.require("util").types;return p||ou&&ou.binding&&ou.binding("util")}catch{}}(),va=Kn&&Kn.isArrayBuffer,da=Kn&&Kn.isDate,_a=Kn&&Kn.isMap,ma=Kn&&Kn.isRegExp,ya=Kn&&Kn.isSet,wa=Kn&&Kn.isTypedArray;function Dn(p,S,x){switch(x.length){case 0:return p.call(S);case 1:return p.call(S,x[0]);case 2:return p.call(S,x[0],x[1]);case 3:return p.call(S,x[0],x[1],x[2])}return p.apply(S,x)}function $p(p,S,x,$){for(var K=-1,nn=p==null?0:p.length;++K-1}function au(p,S,x){for(var $=-1,K=p==null?0:p.length;++$-1;);return x}function Ra(p,S){for(var x=p.length;x--&&ke(S,p[x],0)>-1;);return x}function Zp(p,S){for(var x=p.length,$=0;x--;)p[x]===S&&++$;return $}var Vp=hu(Pp),Yp=hu(Cp);function Qp(p){return"\\"+qp[p]}function Xp(p,S){return p==null?i:p[S]}function nt(p){return Tp.test(p)}function Jp(p){return Ip.test(p)}function jp(p){for(var S,x=[];!(S=p.next()).done;)x.push(S.value);return x}function du(p){var S=-1,x=Array(p.size);return p.forEach(function($,K){x[++S]=[K,$]}),x}function Ea(p,S){return function(x){return p(S(x))}}function Ie(p,S){for(var x=-1,$=p.length,K=0,nn=[];++x<$;){var mn=p[x];(mn===S||mn===b)&&(p[x]=b,nn[K++]=x)}return nn}function er(p){var S=-1,x=Array(p.size);return p.forEach(function($){x[++S]=$}),x}function kp(p){var S=-1,x=Array(p.size);return p.forEach(function($){x[++S]=[$,$]}),x}function ng(p,S,x){for(var $=x-1,K=p.length;++$-1}function Wg(n,e){var t=this.__data__,r=dr(t,n);return r<0?(++this.size,t.push([n,e])):t[r][1]=e,this}ce.prototype.clear=Fg,ce.prototype.delete=Ng,ce.prototype.get=$g,ce.prototype.has=Dg,ce.prototype.set=Wg;function he(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e=e?n:e)),n}function Qn(n,e,t,r,u,a){var s,c=e&q,v=e&F,O=e&C;if(t&&(s=u?t(n,r,u,a):t(n)),s!==i)return s;if(!hn(n))return n;var T=Z(n);if(T){if(s=zv(n),!c)return Ln(n,s)}else{var R=Tn(n),N=R==xn||R==Se;if(qe(n))return cl(n,c);if(R==Hn||R==le||N&&!u){if(s=v||N?{}:Pl(n),!c)return v?Lv(n,ev(s,n)):Cv(n,Ua(s,n))}else{if(!on[R])return u?n:{};s=Hv(n,R,c)}}a||(a=new ee);var B=a.get(n);if(B)return B;a.set(n,s),us(n)?n.forEach(function(H){s.add(Qn(H,e,t,H,n,a))}):rs(n)&&n.forEach(function(H,X){s.set(X,Qn(H,e,t,X,n,a))});var z=O?v?Gu:Uu:v?Mn:bn,Y=T?i:z(n);return Zn(Y||n,function(H,X){Y&&(X=H,H=n[X]),Tt(s,X,Qn(H,e,t,X,n,a))}),s}function tv(n){var e=bn(n);return function(t){return Ga(t,n,e)}}function Ga(n,e,t){var r=t.length;if(n==null)return!r;for(n=fn(n);r--;){var u=t[r],a=e[u],s=n[u];if(s===i&&!(u in n)||!a(s))return!1}return!0}function za(n,e,t){if(typeof n!="function")throw new Vn(g);return qt(function(){n.apply(i,t)},e)}function It(n,e,t,r){var u=-1,a=kt,s=!0,c=n.length,v=[],O=e.length;if(!c)return v;t&&(e=sn(e,Wn(t))),r?(a=au,s=!1):e.length>=m&&(a=wt,s=!1,e=new Ge(e));n:for(;++uu?0:u+t),r=r===i||r>u?u:V(r),r<0&&(r+=u),r=t>r?0:os(r);t0&&t(c)?e>1?An(c,e-1,t,r,u):Te(u,c):r||(u[u.length]=c)}return u}var Su=_l(),Za=_l(!0);function ue(n,e){return n&&Su(n,e,bn)}function Au(n,e){return n&&Za(n,e,bn)}function mr(n,e){return Oe(e,function(t){return _e(n[t])})}function He(n,e){e=Ce(e,n);for(var t=0,r=e.length;n!=null&&te}function uv(n,e){return n!=null&&tn.call(n,e)}function fv(n,e){return n!=null&&e in fn(n)}function ov(n,e,t){return n>=On(e,t)&&n=120&&T.length>=120)?new Ge(s&&T):i}T=n[0];var R=-1,N=c[0];n:for(;++R-1;)c!==n&&lr.call(c,v,1),lr.call(n,v,1);return n}function rl(n,e){for(var t=n?e.length:0,r=t-1;t--;){var u=e[t];if(t==r||u!==a){var a=u;de(u)?lr.call(n,u,1):Mu(n,u)}}return n}function Cu(n,e){return n+hr($a()*(e-n+1))}function wv(n,e,t,r){for(var u=-1,a=yn(cr((e-n)/(t||1)),0),s=x(a);a--;)s[r?a:++u]=n,n+=t;return s}function Lu(n,e){var t="";if(!n||e<1||e>wn)return t;do e%2&&(t+=n),e=hr(e/2),e&&(n+=n);while(e);return t}function Q(n,e){return Qu(ql(n,e,Fn),n+"")}function xv(n){return Ba(ct(n))}function bv(n,e){var t=ct(n);return Er(t,ze(e,0,t.length))}function Pt(n,e,t,r){if(!hn(n))return n;e=Ce(e,n);for(var u=-1,a=e.length,s=a-1,c=n;c!=null&&++uu?0:u+e),t=t>u?u:t,t<0&&(t+=u),u=e>t?0:t-e>>>0,e>>>=0;for(var a=x(u);++r>>1,s=n[a];s!==null&&!Un(s)&&(t?s<=e:s=m){var O=e?null:Nv(n);if(O)return er(O);s=!1,u=wt,v=new Ge}else v=e?[]:c;n:for(;++r=r?n:Xn(n,e,t)}var sl=pg||function(n){return Sn.clearTimeout(n)};function cl(n,e){if(e)return n.slice();var t=n.length,r=La?La(t):new n.constructor(t);return n.copy(r),r}function Du(n){var e=new n.constructor(n.byteLength);return new or(e).set(new or(n)),e}function Iv(n,e){var t=e?Du(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.byteLength)}function Rv(n){var e=new n.constructor(n.source,Yo.exec(n));return e.lastIndex=n.lastIndex,e}function Ev(n){return Ot?fn(Ot.call(n)):{}}function hl(n,e){var t=e?Du(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.length)}function pl(n,e){if(n!==e){var t=n!==i,r=n===null,u=n===n,a=Un(n),s=e!==i,c=e===null,v=e===e,O=Un(e);if(!c&&!O&&!a&&n>e||a&&s&&v&&!c&&!O||r&&s&&v||!t&&v||!u)return 1;if(!r&&!a&&!O&&n=c)return v;var O=t[r];return v*(O=="desc"?-1:1)}}return n.index-e.index}function gl(n,e,t,r){for(var u=-1,a=n.length,s=t.length,c=-1,v=e.length,O=yn(a-s,0),T=x(v+O),R=!r;++c1?t[u-1]:i,s=u>2?t[2]:i;for(a=n.length>3&&typeof a=="function"?(u--,a):i,s&&Rn(t[0],t[1],s)&&(a=u<3?i:a,u=1),e=fn(e);++r-1?u[a?e[s]:s]:i}}function wl(n){return ve(function(e){var t=e.length,r=t,u=Yn.prototype.thru;for(n&&e.reverse();r--;){var a=e[r];if(typeof a!="function")throw new Vn(g);if(u&&!s&&Ir(a)=="wrapper")var s=new Yn([],!0)}for(r=s?r:t;++r1&&k.reverse(),T&&vc))return!1;var O=a.get(n),T=a.get(e);if(O&&T)return O==e&&T==n;var R=-1,N=!0,B=t&M?new Ge:i;for(a.set(n,e),a.set(e,n);++R1?"& ":"")+e[r],e=e.join(t>2?", ":" "),n.replace(Vh,`{ +/* [wrapped with `+e+`] */ +`)}function Zv(n){return Z(n)||Ve(n)||!!(Fa&&n&&n[Fa])}function de(n,e){var t=typeof n;return e=e??wn,!!e&&(t=="number"||t!="symbol"&&ip.test(n))&&n>-1&&n%1==0&&n0){if(++e>=Bi)return arguments[0]}else e=0;return n.apply(i,arguments)}}function Er(n,e){var t=-1,r=n.length,u=r-1;for(e=e===i?r:e;++t1?n[e-1]:i;return t=typeof t=="function"?(n.pop(),t):i,Kl(n,t)});function Zl(n){var e=o(n);return e.__chain__=!0,e}function r_(n,e){return e(n),n}function Pr(n,e){return e(n)}var i_=ve(function(n){var e=n.length,t=e?n[0]:0,r=this.__wrapped__,u=function(a){return bu(a,n)};return e>1||this.__actions__.length||!(r instanceof j)||!de(t)?this.thru(u):(r=r.slice(t,+t+(e?1:0)),r.__actions__.push({func:Pr,args:[u],thisArg:i}),new Yn(r,this.__chain__).thru(function(a){return e&&!a.length&&a.push(i),a}))});function u_(){return Zl(this)}function f_(){return new Yn(this.value(),this.__chain__)}function o_(){this.__values__===i&&(this.__values__=fs(this.value()));var n=this.__index__>=this.__values__.length,e=n?i:this.__values__[this.__index__++];return{done:n,value:e}}function a_(){return this}function l_(n){for(var e,t=this;t instanceof vr;){var r=Wl(t);r.__index__=0,r.__values__=i,e?u.__wrapped__=r:e=r;var u=r;t=t.__wrapped__}return u.__wrapped__=n,e}function s_(){var n=this.__wrapped__;if(n instanceof j){var e=n;return this.__actions__.length&&(e=new j(this)),e=e.reverse(),e.__actions__.push({func:Pr,args:[Xu],thisArg:i}),new Yn(e,this.__chain__)}return this.thru(Xu)}function c_(){return al(this.__wrapped__,this.__actions__)}var h_=br(function(n,e,t){tn.call(n,t)?++n[t]:pe(n,t,1)});function p_(n,e,t){var r=Z(n)?xa:rv;return t&&Rn(n,e,t)&&(e=i),r(n,G(e,3))}function g_(n,e){var t=Z(n)?Oe:Ka;return t(n,G(e,3))}var v_=yl(Bl),d_=yl(Ul);function __(n,e){return An(Cr(n,e),1)}function m_(n,e){return An(Cr(n,e),Nn)}function y_(n,e,t){return t=t===i?1:V(t),An(Cr(n,e),t)}function Vl(n,e){var t=Z(n)?Zn:Ee;return t(n,G(e,3))}function Yl(n,e){var t=Z(n)?Dp:Ha;return t(n,G(e,3))}var w_=br(function(n,e,t){tn.call(n,t)?n[t].push(e):pe(n,t,[e])});function x_(n,e,t,r){n=qn(n)?n:ct(n),t=t&&!r?V(t):0;var u=n.length;return t<0&&(t=yn(u+t,0)),Nr(n)?t<=u&&n.indexOf(e,t)>-1:!!u&&ke(n,e,t)>-1}var b_=Q(function(n,e,t){var r=-1,u=typeof e=="function",a=qn(n)?x(n.length):[];return Ee(n,function(s){a[++r]=u?Dn(e,s,t):Rt(s,e,t)}),a}),S_=br(function(n,e,t){pe(n,t,e)});function Cr(n,e){var t=Z(n)?sn:Ja;return t(n,G(e,3))}function A_(n,e,t,r){return n==null?[]:(Z(e)||(e=e==null?[]:[e]),t=r?i:t,Z(t)||(t=t==null?[]:[t]),el(n,e,t))}var O_=br(function(n,e,t){n[t?0:1].push(e)},function(){return[[],[]]});function T_(n,e,t){var r=Z(n)?lu:Oa,u=arguments.length<3;return r(n,G(e,4),t,u,Ee)}function I_(n,e,t){var r=Z(n)?Wp:Oa,u=arguments.length<3;return r(n,G(e,4),t,u,Ha)}function R_(n,e){var t=Z(n)?Oe:Ka;return t(n,Mr(G(e,3)))}function E_(n){var e=Z(n)?Ba:xv;return e(n)}function P_(n,e,t){(t?Rn(n,e,t):e===i)?e=1:e=V(e);var r=Z(n)?jg:bv;return r(n,e)}function C_(n){var e=Z(n)?kg:Av;return e(n)}function L_(n){if(n==null)return 0;if(qn(n))return Nr(n)?et(n):n.length;var e=Tn(n);return e==dn||e==_n?n.size:Ru(n).length}function q_(n,e,t){var r=Z(n)?su:Ov;return t&&Rn(n,e,t)&&(e=i),r(n,G(e,3))}var M_=Q(function(n,e){if(n==null)return[];var t=e.length;return t>1&&Rn(n,e[0],e[1])?e=[]:t>2&&Rn(e[0],e[1],e[2])&&(e=[e[0]]),el(n,An(e,1),[])}),Lr=gg||function(){return Sn.Date.now()};function F_(n,e){if(typeof e!="function")throw new Vn(g);return n=V(n),function(){if(--n<1)return e.apply(this,arguments)}}function Ql(n,e,t){return e=t?i:e,e=n&&e==null?n.length:e,ge(n,J,i,i,i,i,e)}function Xl(n,e){var t;if(typeof e!="function")throw new Vn(g);return n=V(n),function(){return--n>0&&(t=e.apply(this,arguments)),n<=1&&(e=i),t}}var ju=Q(function(n,e,t){var r=I;if(t.length){var u=Ie(t,lt(ju));r|=W}return ge(n,r,e,t,u)}),Jl=Q(function(n,e,t){var r=I|P;if(t.length){var u=Ie(t,lt(Jl));r|=W}return ge(e,r,n,t,u)});function jl(n,e,t){e=t?i:e;var r=ge(n,A,i,i,i,i,i,e);return r.placeholder=jl.placeholder,r}function kl(n,e,t){e=t?i:e;var r=ge(n,E,i,i,i,i,i,e);return r.placeholder=kl.placeholder,r}function ns(n,e,t){var r,u,a,s,c,v,O=0,T=!1,R=!1,N=!0;if(typeof n!="function")throw new Vn(g);e=jn(e)||0,hn(t)&&(T=!!t.leading,R="maxWait"in t,a=R?yn(jn(t.maxWait)||0,e):a,N="trailing"in t?!!t.trailing:N);function B(vn){var re=r,ye=u;return r=u=i,O=vn,s=n.apply(ye,re),s}function z(vn){return O=vn,c=qt(X,e),T?B(vn):s}function Y(vn){var re=vn-v,ye=vn-O,ys=e-re;return R?On(ys,a-ye):ys}function H(vn){var re=vn-v,ye=vn-O;return v===i||re>=e||re<0||R&&ye>=a}function X(){var vn=Lr();if(H(vn))return k(vn);c=qt(X,Y(vn))}function k(vn){return c=i,N&&r?B(vn):(r=u=i,s)}function Gn(){c!==i&&sl(c),O=0,r=v=u=c=i}function En(){return c===i?s:k(Lr())}function zn(){var vn=Lr(),re=H(vn);if(r=arguments,u=this,v=vn,re){if(c===i)return z(v);if(R)return sl(c),c=qt(X,e),B(v)}return c===i&&(c=qt(X,e)),s}return zn.cancel=Gn,zn.flush=En,zn}var N_=Q(function(n,e){return za(n,1,e)}),$_=Q(function(n,e,t){return za(n,jn(e)||0,t)});function D_(n){return ge(n,Pn)}function qr(n,e){if(typeof n!="function"||e!=null&&typeof e!="function")throw new Vn(g);var t=function(){var r=arguments,u=e?e.apply(this,r):r[0],a=t.cache;if(a.has(u))return a.get(u);var s=n.apply(this,r);return t.cache=a.set(u,s)||a,s};return t.cache=new(qr.Cache||he),t}qr.Cache=he;function Mr(n){if(typeof n!="function")throw new Vn(g);return function(){var e=arguments;switch(e.length){case 0:return!n.call(this);case 1:return!n.call(this,e[0]);case 2:return!n.call(this,e[0],e[1]);case 3:return!n.call(this,e[0],e[1],e[2])}return!n.apply(this,e)}}function W_(n){return Xl(2,n)}var B_=Tv(function(n,e){e=e.length==1&&Z(e[0])?sn(e[0],Wn(G())):sn(An(e,1),Wn(G()));var t=e.length;return Q(function(r){for(var u=-1,a=On(r.length,t);++u=e}),Ve=Ya(function(){return arguments}())?Ya:function(n){return pn(n)&&tn.call(n,"callee")&&!Ma.call(n,"callee")},Z=x.isArray,e0=va?Wn(va):lv;function qn(n){return n!=null&&Fr(n.length)&&!_e(n)}function gn(n){return pn(n)&&qn(n)}function t0(n){return n===!0||n===!1||pn(n)&&In(n)==se}var qe=dg||cf,r0=da?Wn(da):sv;function i0(n){return pn(n)&&n.nodeType===1&&!Mt(n)}function u0(n){if(n==null)return!0;if(qn(n)&&(Z(n)||typeof n=="string"||typeof n.splice=="function"||qe(n)||st(n)||Ve(n)))return!n.length;var e=Tn(n);if(e==dn||e==_n)return!n.size;if(Lt(n))return!Ru(n).length;for(var t in n)if(tn.call(n,t))return!1;return!0}function f0(n,e){return Et(n,e)}function o0(n,e,t){t=typeof t=="function"?t:i;var r=t?t(n,e):i;return r===i?Et(n,e,i,t):!!r}function nf(n){if(!pn(n))return!1;var e=In(n);return e==ie||e==un||typeof n.message=="string"&&typeof n.name=="string"&&!Mt(n)}function a0(n){return typeof n=="number"&&Na(n)}function _e(n){if(!hn(n))return!1;var e=In(n);return e==xn||e==Se||e==dt||e==Yt}function ts(n){return typeof n=="number"&&n==V(n)}function Fr(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=wn}function hn(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}function pn(n){return n!=null&&typeof n=="object"}var rs=_a?Wn(_a):hv;function l0(n,e){return n===e||Iu(n,e,Hu(e))}function s0(n,e,t){return t=typeof t=="function"?t:i,Iu(n,e,Hu(e),t)}function c0(n){return is(n)&&n!=+n}function h0(n){if(Qv(n))throw new K(d);return Qa(n)}function p0(n){return n===null}function g0(n){return n==null}function is(n){return typeof n=="number"||pn(n)&&In(n)==Cn}function Mt(n){if(!pn(n)||In(n)!=Hn)return!1;var e=ar(n);if(e===null)return!0;var t=tn.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&ir.call(t)==sg}var ef=ma?Wn(ma):pv;function v0(n){return ts(n)&&n>=-wn&&n<=wn}var us=ya?Wn(ya):gv;function Nr(n){return typeof n=="string"||!Z(n)&&pn(n)&&In(n)==kn}function Un(n){return typeof n=="symbol"||pn(n)&&In(n)==Qt}var st=wa?Wn(wa):vv;function d0(n){return n===i}function _0(n){return pn(n)&&Tn(n)==mt}function m0(n){return pn(n)&&In(n)==Mh}var y0=Tr(Eu),w0=Tr(function(n,e){return n<=e});function fs(n){if(!n)return[];if(qn(n))return Nr(n)?ne(n):Ln(n);if(xt&&n[xt])return jp(n[xt]());var e=Tn(n),t=e==dn?du:e==_n?er:ct;return t(n)}function me(n){if(!n)return n===0?n:0;if(n=jn(n),n===Nn||n===-Nn){var e=n<0?-1:1;return e*De}return n===n?n:0}function V(n){var e=me(n),t=e%1;return e===e?t?e-t:e:0}function os(n){return n?ze(V(n),0,$n):0}function jn(n){if(typeof n=="number")return n;if(Un(n))return ae;if(hn(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=hn(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=Ta(n);var t=ep.test(n);return t||rp.test(n)?Fp(n.slice(2),t?2:8):np.test(n)?ae:+n}function as(n){return fe(n,Mn(n))}function x0(n){return n?ze(V(n),-wn,wn):n===0?n:0}function en(n){return n==null?"":Bn(n)}var b0=ot(function(n,e){if(Lt(e)||qn(e)){fe(e,bn(e),n);return}for(var t in e)tn.call(e,t)&&Tt(n,t,e[t])}),ls=ot(function(n,e){fe(e,Mn(e),n)}),$r=ot(function(n,e,t,r){fe(e,Mn(e),n,r)}),S0=ot(function(n,e,t,r){fe(e,bn(e),n,r)}),A0=ve(bu);function O0(n,e){var t=ft(n);return e==null?t:Ua(t,e)}var T0=Q(function(n,e){n=fn(n);var t=-1,r=e.length,u=r>2?e[2]:i;for(u&&Rn(e[0],e[1],u)&&(r=1);++t1),a}),fe(n,Gu(n),t),r&&(t=Qn(t,q|F|C,$v));for(var u=e.length;u--;)Mu(t,e[u]);return t});function H0(n,e){return cs(n,Mr(G(e)))}var K0=ve(function(n,e){return n==null?{}:mv(n,e)});function cs(n,e){if(n==null)return{};var t=sn(Gu(n),function(r){return[r]});return e=G(e),tl(n,t,function(r,u){return e(r,u[0])})}function Z0(n,e,t){e=Ce(e,n);var r=-1,u=e.length;for(u||(u=1,n=i);++re){var r=n;n=e,e=r}if(t||n%1||e%1){var u=$a();return On(n+u*(e-n+Mp("1e-"+((u+"").length-1))),e)}return Cu(n,e)}var r1=at(function(n,e,t){return e=e.toLowerCase(),n+(t?gs(e):e)});function gs(n){return uf(en(n).toLowerCase())}function vs(n){return n=en(n),n&&n.replace(up,Vp).replace(Ap,"")}function i1(n,e,t){n=en(n),e=Bn(e);var r=n.length;t=t===i?r:ze(V(t),0,r);var u=t;return t-=e.length,t>=0&&n.slice(t,u)==e}function u1(n){return n=en(n),n&&Wh.test(n)?n.replace(Zo,Yp):n}function f1(n){return n=en(n),n&&Kh.test(n)?n.replace(ki,"\\$&"):n}var o1=at(function(n,e,t){return n+(t?"-":"")+e.toLowerCase()}),a1=at(function(n,e,t){return n+(t?" ":"")+e.toLowerCase()}),l1=ml("toLowerCase");function s1(n,e,t){n=en(n),e=V(e);var r=e?et(n):0;if(!e||r>=e)return n;var u=(e-r)/2;return Or(hr(u),t)+n+Or(cr(u),t)}function c1(n,e,t){n=en(n),e=V(e);var r=e?et(n):0;return e&&r>>0,t?(n=en(n),n&&(typeof e=="string"||e!=null&&!ef(e))&&(e=Bn(e),!e&&nt(n))?Le(ne(n),0,t):n.split(e,t)):[]}var m1=at(function(n,e,t){return n+(t?" ":"")+uf(e)});function y1(n,e,t){return n=en(n),t=t==null?0:ze(V(t),0,n.length),e=Bn(e),n.slice(t,t+e.length)==e}function w1(n,e,t){var r=o.templateSettings;t&&Rn(n,e,t)&&(e=i),n=en(n),e=$r({},e,r,Ol);var u=$r({},e.imports,r.imports,Ol),a=bn(u),s=vu(u,a),c,v,O=0,T=e.interpolate||Xt,R="__p += '",N=_u((e.escape||Xt).source+"|"+T.source+"|"+(T===Vo?kh:Xt).source+"|"+(e.evaluate||Xt).source+"|$","g"),B="//# sourceURL="+(tn.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Ep+"]")+` +`;n.replace(N,function(H,X,k,Gn,En,zn){return k||(k=Gn),R+=n.slice(O,zn).replace(fp,Qp),X&&(c=!0,R+=`' + +__e(`+X+`) + +'`),En&&(v=!0,R+=`'; +`+En+`; +__p += '`),k&&(R+=`' + +((__t = (`+k+`)) == null ? '' : __t) + +'`),O=zn+H.length,H}),R+=`'; +`;var z=tn.call(e,"variable")&&e.variable;if(!z)R=`with (obj) { +`+R+` +} +`;else if(Jh.test(z))throw new K(y);R=(v?R.replace(Fh,""):R).replace(Nh,"$1").replace($h,"$1;"),R="function("+(z||"obj")+`) { +`+(z?"":`obj || (obj = {}); +`)+"var __t, __p = ''"+(c?", __e = _.escape":"")+(v?`, __j = Array.prototype.join; +function print() { __p += __j.call(arguments, '') } +`:`; +`)+R+`return __p +}`;var Y=_s(function(){return nn(a,B+"return "+R).apply(i,s)});if(Y.source=R,nf(Y))throw Y;return Y}function x1(n){return en(n).toLowerCase()}function b1(n){return en(n).toUpperCase()}function S1(n,e,t){if(n=en(n),n&&(t||e===i))return Ta(n);if(!n||!(e=Bn(e)))return n;var r=ne(n),u=ne(e),a=Ia(r,u),s=Ra(r,u)+1;return Le(r,a,s).join("")}function A1(n,e,t){if(n=en(n),n&&(t||e===i))return n.slice(0,Pa(n)+1);if(!n||!(e=Bn(e)))return n;var r=ne(n),u=Ra(r,ne(e))+1;return Le(r,0,u).join("")}function O1(n,e,t){if(n=en(n),n&&(t||e===i))return n.replace(nu,"");if(!n||!(e=Bn(e)))return n;var r=ne(n),u=Ia(r,ne(e));return Le(r,u).join("")}function T1(n,e){var t=gt,r=Ht;if(hn(e)){var u="separator"in e?e.separator:u;t="length"in e?V(e.length):t,r="omission"in e?Bn(e.omission):r}n=en(n);var a=n.length;if(nt(n)){var s=ne(n);a=s.length}if(t>=a)return n;var c=t-et(r);if(c<1)return r;var v=s?Le(s,0,c).join(""):n.slice(0,c);if(u===i)return v+r;if(s&&(c+=v.length-c),ef(u)){if(n.slice(c).search(u)){var O,T=v;for(u.global||(u=_u(u.source,en(Yo.exec(u))+"g")),u.lastIndex=0;O=u.exec(T);)var R=O.index;v=v.slice(0,R===i?c:R)}}else if(n.indexOf(Bn(u),c)!=c){var N=v.lastIndexOf(u);N>-1&&(v=v.slice(0,N))}return v+r}function I1(n){return n=en(n),n&&Dh.test(n)?n.replace(Ko,tg):n}var R1=at(function(n,e,t){return n+(t?" ":"")+e.toUpperCase()}),uf=ml("toUpperCase");function ds(n,e,t){return n=en(n),e=t?i:e,e===i?Jp(n)?ug(n):Gp(n):n.match(e)||[]}var _s=Q(function(n,e){try{return Dn(n,i,e)}catch(t){return nf(t)?t:new K(t)}}),E1=ve(function(n,e){return Zn(e,function(t){t=oe(t),pe(n,t,ju(n[t],n))}),n});function P1(n){var e=n==null?0:n.length,t=G();return n=e?sn(n,function(r){if(typeof r[1]!="function")throw new Vn(g);return[t(r[0]),r[1]]}):[],Q(function(r){for(var u=-1;++uwn)return[];var t=$n,r=On(n,$n);e=G(e),n-=$n;for(var u=gu(r,e);++t0||e<0)?new j(t):(n<0?t=t.takeRight(-n):n&&(t=t.drop(n)),e!==i&&(e=V(e),t=e<0?t.dropRight(-e):t.take(e-n)),t)},j.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},j.prototype.toArray=function(){return this.take($n)},ue(j.prototype,function(n,e){var t=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),u=o[r?"take"+(e=="last"?"Right":""):e],a=r||/^find/.test(e);u&&(o.prototype[e]=function(){var s=this.__wrapped__,c=r?[1]:arguments,v=s instanceof j,O=c[0],T=v||Z(s),R=function(X){var k=u.apply(o,Te([X],c));return r&&N?k[0]:k};T&&t&&typeof O=="function"&&O.length!=1&&(v=T=!1);var N=this.__chain__,B=!!this.__actions__.length,z=a&&!N,Y=v&&!B;if(!a&&T){s=Y?s:new j(this);var H=n.apply(s,c);return H.__actions__.push({func:Pr,args:[R],thisArg:i}),new Yn(H,N)}return z&&Y?n.apply(this,c):(H=this.thru(R),z?r?H.value()[0]:H.value():H)})}),Zn(["pop","push","shift","sort","splice","unshift"],function(n){var e=tr[n],t=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",r=/^(?:pop|shift)$/.test(n);o.prototype[n]=function(){var u=arguments;if(r&&!this.__chain__){var a=this.value();return e.apply(Z(a)?a:[],u)}return this[t](function(s){return e.apply(Z(s)?s:[],u)})}}),ue(j.prototype,function(n,e){var t=o[e];if(t){var r=t.name+"";tn.call(ut,r)||(ut[r]=[]),ut[r].push({name:e,func:t})}}),ut[Sr(i,P).name]=[{name:"wrapper",func:i}],j.prototype.clone=Ig,j.prototype.reverse=Rg,j.prototype.value=Eg,o.prototype.at=i_,o.prototype.chain=u_,o.prototype.commit=f_,o.prototype.next=o_,o.prototype.plant=l_,o.prototype.reverse=s_,o.prototype.toJSON=o.prototype.valueOf=o.prototype.value=c_,o.prototype.first=o.prototype.head,xt&&(o.prototype[xt]=a_),o},tt=fg();We?((We.exports=tt)._=tt,fu._=tt):Sn._=tt}).call(Ye)}(Gt,Gt.exports);var cn=Gt.exports;function $i(f={},l){const i={};for(const h of Object.keys(f))i[h]=h==="$"?f[h]:l(f[h],h,f);return Object.setPrototypeOf(i,f)}var Uo={exports:{}};(function(f,l){(function(i,h){f.exports=h()})(Ye,function(){return function(i){function h(d){if(m[d])return m[d].exports;var g=m[d]={i:d,l:!1,exports:{}};return i[d].call(g.exports,g,g.exports,h),g.l=!0,g.exports}var m={};return h.m=i,h.c=m,h.d=function(d,g,y){h.o(d,g)||Object.defineProperty(d,g,{configurable:!1,enumerable:!0,get:y})},h.n=function(d){var g=d&&d.__esModule?function(){return d.default}:function(){return d};return h.d(g,"a",g),g},h.o=function(d,g){return Object.prototype.hasOwnProperty.call(d,g)},h.p="",h(h.s=1)}([function(i,h,m){function d(y){var w=y===void 0?{}:y,_=w.ESCAPE,b=_===void 0?/^\\/:_,q=w.VARIABLE_START,F=q===void 0?/^\${\s*/:q,C=w.VARIABLE_END,D=C===void 0?/^\s*}/:C,M=w.PIPE_START,I=M===void 0?/^\s*\|\s*/:M,P=w.PIPE_PARAMETER_START,L=P===void 0?/^\s*:\s*/:P,A=w.QUOTED_STRING,E=A===void 0?h.DEFAULT_QUOTED_STRING_REGEX:A,W=w.QUOTED_STRING_TEST,U=W===void 0?null:W,J=w.QUOTED_STRING_GET_AND_ADVANCE,rn=J===void 0?null:J,Pn=w.QUOTED_STRING_IN_PARAMETER_TEST,gt=Pn===void 0?null:Pn,Ht=w.QUOTED_STRING_IN_PARAMETER_GET_AND_ADVANCE,Bi=Ht===void 0?null:Ht,Kt=U||function(Nn){return E.test(Nn)},vt=rn||g(E),Ui=gt||function(Nn){return E.test(Nn)},Gi=Bi||g(E);return function(Nn){function wn(an){an===void 0&&(an=1),un=un.substr(an)}function De(an){an===void 0&&(an=/^/),wn(un.match(an)[0].length)}function ae(){var an;return De(b),an=un.length>0?un[0]:"",wn(),an}function $n(an){var _n=(an===void 0?{}:an).isNull,kn=_n!==void 0&&_n;dn={name:"",pipes:[]},Hn=!kn}function zi(){ie.variables.push(dn),$n({isNull:!0})}function Zt(an){var _n=(an===void 0?{}:an).isNull,kn=_n!==void 0&&_n;Cn={name:"",parameters:[]},_t=!kn}function Vt(){dn.pipes.push(Cn),Zt({isNull:!0})}function le(an){var _n=(an===void 0?{}:an).isNull,kn=_n!==void 0&&_n;Ae="",Yt=!kn}function xe(){Cn.parameters.push(Ae),le({isNull:!0})}function dt(){return!!D.test(un)&&(De(D),xn>=3&&xe(),xn>=2&&Vt(),xn>=1&&zi(),xn=0,!0)}function se(){return!!I.test(un)&&(De(I),xn>=3&&xe(),xn>=2&&Vt(),xn>=1&&Zt(),xn=2,!0)}function be(){return!!L.test(un)&&(De(L),xn>=3&&xe(),xn>=2&&le(),xn=3,!0)}for(var un=Nn,ie={literals:[],variables:[]},xn=0,Se="",dn={name:"",pipes:[]},Cn={name:"",parameters:[]},Ae="",Hn=!1,_t=!1,Yt=!1;un&&un.length>0;)switch(xn){case 0:if(b.test(un)){Se+=ae();continue}if(F.test(un)){xn=1,$n(),ie.literals.push(Se),Se="",De(F);continue}Se+=un[0],wn();break;case 1:if(b.test(un)){dn.name+=ae();continue}if(dt()||se())continue;if(Kt(un)){dn.name+=vt(un,wn);continue}dn.name+=un[0],wn();break;case 2:if(b.test(un)){Cn.name+=ae();continue}if(dt()||be()||se())continue;if(Kt(un)){Cn.name+=vt(un,wn);continue}Cn.name+=un[0],wn();break;case 3:if(b.test(un)){Ae+=ae();continue}if(dt()||be()||se())continue;if(Ui(un)){Ae+=Gi(un,wn);continue}Ae+=un[0],wn()}return Yt&&Cn.parameters.push(Ae),_t&&dn.pipes.push(Cn),Hn&&ie.variables.push(dn),ie.literals.push(Se),ie}}function g(y){return function(w,_){var b=w.match(y);return _(b[0].length),b.slice(2).join("").replace("\\\\","\\")}}Object.defineProperty(h,"__esModule",{value:!0}),h.DEFAULT_QUOTED_STRING_REGEX=/^('((?:[^'\\]|\\.)*)'|'((?:[^'\\]|\\.)*)$|"((?:[^"\\]|\\.)*)"|"((?:[^"\\]|\\.)*)$)/,h.parseStringTemplateGenerator=d,h.parseStringTemplate=d(),h.getQuotedStringAndAdvanceForRegex=g},function(i,h,m){i.exports=m(2)},function(i,h,m){function d(g){for(var y in g)h.hasOwnProperty(y)||(h[y]=g[y])}Object.defineProperty(h,"__esModule",{value:!0}),d(m(0)),d(m(3))},function(i,h,m){function d(b){return function(q){return b.hasOwnProperty(q)?b[q]:q.split(".").reduce(function(F,C){return F.hasOwnProperty(C)?F[C]:""},b)}}function g(b,q,F,C){C===void 0&&(C=d(q));var D=C(b.name);return b.pipes.reduce(function(M,I){return F.hasOwnProperty(I.name)?F[I.name](M,I.parameters):M},D??"")}function y(b,q,F,C){return C===void 0&&(C=d(q)),b.literals.length===0?"":b.literals.slice(1).reduce(function(D,M,I){return""+D+g(b.variables[I],q,F,C)+M},b.literals[0])}function w(b,q,F){return y(_.parseStringTemplate(b),q,F)}Object.defineProperty(h,"__esModule",{value:!0});var _=m(0);h.evaluateParsedString=y,h.evaluateStringTemplate=w}])})})(Uo);var Go=Uo.exports;const zo=f=>{const l=Function("$",`return ${f};`);return i=>l(new Proxy(zt(i),{get(h,m){return typeof(h==null?void 0:h[m])=="function"?h[m]({}):h==null?void 0:h[m]}}))},Ah=/^\{\{\s*/,Oh=/^\s*\}\}/,Di=/\b\B/,Th=Go.parseStringTemplateGenerator({VARIABLE_START:Ah,VARIABLE_END:Oh,PIPE_START:Di,PIPE_PARAMETER_START:Di,QUOTED_STRING:Di}),Ih=bh(f=>{const l=Th(f);return cn.join(l.literals,"")?i=>Go.evaluateParsedString(l,{},{},h=>zo(h)(i)):zo(l.variables[0].name)},{primitive:!0});function Xe(f){switch(f==null?void 0:f.constructor){case Array:{const l=cn.map(f,Xe);return i=>cn.map(l,h=>h(i))}case Object:{const l=cn.mapValues(f,Xe);return i=>cn.mapValues(l,h=>h(i))}case String:return Ih(f);default:return()=>f}}function zt(f={}){return $i(f,l=>cn.isFunction(l)?l:Xe(l))}function Rh(f={}){return new Proxy(f,{get:(l,i)=>typeof l[i]=="function"?l[i]:()=>l[i]})}function Wi(f,l){return Object.setPrototypeOf($i(l,i=>h=>i(f)),f)}function Eh(f){const{$for:l,...i}=f;if(l){const{$let:h="i",$from:m=0,$to:d=1,$step:g=1}=l,y=Xe(m),w=Xe(d),_=Xe(g);return(b={})=>cn.range(y(b),w(b),_(b)).map(q=>{const F=Wi(b,zt({[h]:q}));return Wi(F,zt(i))})}else return(h={})=>[Wi(h,zt(i))]}function Ph(f,l){const i=d=>{const{$:g}=d,y=Eh(d);return g in l?w=>cn.flatMap(y(w),_=>cn.flatMap(h[g],b=>b(_))):w=>cn.map(y(w),_=>Object.setPrototypeOf($i(_,b=>b(_)),null))},h=cn.mapValues(l,d=>cn.map(d,i)),m=cn.flatMap(f,i);return d=>cn.flatMap(m,g=>g(d))}const Ch=f=>f==null,Ho=f=>f.display!=="transient";function Lh({trace:f,context:l,view:i="main",from:h=0,to:m=(d=>(d=f==null?void 0:f.events)==null?void 0:d.length)()??0}){var q,F,C,D;const g=Ph(((C=(F=(q=f==null?void 0:f.render)==null?void 0:q.views)==null?void 0:F[i])==null?void 0:C.components)??[],((D=f==null?void 0:f.render)==null?void 0:D.components)??{}),y=M=>M&&Object.hasOwn(M,"alpha")?M.alpha>0:!0,w=M=>I=>({component:I,meta:{source:"trace",step:h+M,info:I.$info}}),_=cn.chain(f==null?void 0:f.events).map((M,I)=>({step:I,id:M.id,data:M,pId:M.pId})).groupBy("id").value(),b=cn.chain(cn.range(h,m)).map(M=>{var W;const I=f.events[M],P=f.events,L=g(Rh({alpha:1,...l,step:M,parent:Ch(I.pId)?void 0:P[((W=cn.findLast(_[I.pId],U=>U.step<=M))==null?void 0:W.step)??0],event:I,events:P})),A=L.filter(Ho),E=L.filter(cn.negate(Ho));return{persistent:A,transient:E}}).map(M=>cn.mapValues(M,I=>I.filter(y))).map((M,I)=>cn.mapValues(M,P=>P.map(w(I)))).value();return{stepsPersistent:cn.map(b,M=>M.persistent),stepsTransient:cn.map(b,M=>M.transient)}}onmessage=Sh(async({data:f})=>Lh(f))})(); diff --git a/index.html b/index.html index 5450284..4cdf0fc 100644 --- a/index.html +++ b/index.html @@ -10,11 +10,11 @@ Posthoc - + - +