From e2f0c3b30448424ee5acdf8d314afe4e8fbbf59b Mon Sep 17 00:00:00 2001 From: Spaaaacccee Date: Wed, 22 May 2024 04:05:43 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20Shortest?= =?UTF-8?q?PathLab/posthoc-app@ddb985449b8eec5d2cb36d9098e9cae0b6a11917=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/{index-2e196eb7.js => index-1a90b3a1.js} | 4 ++-- index.html | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) rename assets/{index-2e196eb7.js => index-1a90b3a1.js} (99%) diff --git a/assets/index-2e196eb7.js b/assets/index-1a90b3a1.js similarity index 99% rename from assets/index-2e196eb7.js rename to assets/index-1a90b3a1.js index 55dbcdb..636eb75 100644 --- a/assets/index-2e196eb7.js +++ b/assets/index-1a90b3a1.js @@ -506,7 +506,7 @@ Consider to rely on 'then' or 'done' mode instead.`);We&&(delete _e[Re],we[Re]=q * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */function paletteMapKey(oe){return oe=normalize$2(oe),oe.A!==1?`rgba(${oe.R}, ${oe.G}, ${oe.B}, ${oe.A})`:`rgb(${oe.R}, ${oe.G}, ${oe.B})`}function labPaletteMapKey(oe){return`lab(${oe.L}, ${oe.a}, ${oe.b})`}function mapPalette(oe,ne,ce,ue){const pe={};ue=ue||{R:255,G:255,B:255},ce=ce||"closest";for(let me=0;meye){ve=_e,ye=we;continue}}ve&&(pe[paletteMapKey(ge)]=ve)}return pe}function matchPaletteLab(oe,ne,ce){let ue,pe,me=ne[0],ge=ciede2000(oe,me);for(let ve=1,ye=ne.length;vege)&&(me=ue,ge=pe);return me}function mapPaletteLab(oe,ne,ce){const ue={},pe=ce==="furthest";for(let me=0;me{let ne=hexRgb(oe);return{R:ne[0],G:ne[1],B:ne[2]}},pantoneRGBList=pantones.map(oe=>get_rgbObject(oe.hex));var getClosestColor=oe=>{const ne=get_rgbObject(oe),ce=diff.closest(ne,pantoneRGBList),ue=rgbHex(ce.R,ce.G,ce.B),pe=pantones.findIndex(ge=>ge.hex==`#${ue}`);return pantones[pe]};function u$4(){return(u$4=Object.assign||function(oe){for(var ne=1;ne=0||(pe[ce]=oe[ce]);return pe}function i$7(oe){var ne=reactExports.useRef(oe),ce=reactExports.useRef(function(ue){ne.current&&ne.current(ue)});return ne.current=oe,ce.current}var s$4=function(oe,ne,ce){return ne===void 0&&(ne=0),ce===void 0&&(ce=1),oe>ce?ce:oe0:ke.buttons>0)&&pe.current?me(d$6(pe.current,ke,ve.current)):Ie(!1)},Ae=function(){return Ie(!1)};function Ie(ke){var Be=ye.current,Ne=v$5(pe.current),Fe=ke?Ne.addEventListener:Ne.removeEventListener;Fe(Be?"touchmove":"mousemove",Re),Fe(Be?"touchend":"mouseup",Ae)}return[function(ke){var Be=ke.nativeEvent,Ne=pe.current;if(Ne&&(h$5(Be),!function(Ue,qe){return qe&&!f$6(Ue)}(Be,ye.current)&&Ne)){if(f$6(Be)){ye.current=!0;var Fe=Be.changedTouches||[];Fe.length&&(ve.current=Fe[0].identifier)}Ne.focus(),me(d$6(Ne,Be,ve.current)),Ie(!0)}},function(ke){var Be=ke.which||ke.keyCode;Be<37||Be>40||(ke.preventDefault(),ge({left:Be===39?.05:Be===37?-.05:0,top:Be===40?.05:Be===38?-.05:0}))},Ie]},[ge,me]),_e=xe[0],we=xe[1],$e=xe[2];return reactExports.useEffect(function(){return $e},[$e]),React$2.createElement("div",u$4({},ue,{onTouchStart:_e,onMouseDown:_e,className:"react-colorful__interactive",ref:pe,onKeyDown:we,tabIndex:0,role:"slider"}))}),g$5=function(oe){return oe.filter(Boolean).join(" ")},p$5=function(oe){var ne=oe.color,ce=oe.left,ue=oe.top,pe=ue===void 0?.5:ue,me=g$5(["react-colorful__pointer",oe.className]);return React$2.createElement("div",{className:me,style:{top:100*pe+"%",left:100*ce+"%"}},React$2.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:ne}}))},b$6=function(oe,ne,ce){return ne===void 0&&(ne=0),ce===void 0&&(ce=Math.pow(10,ne)),Math.round(ce*oe)/ce},x$4=function(oe){return L$4(C$5(oe))},C$5=function(oe){return oe[0]==="#"&&(oe=oe.substring(1)),oe.length<6?{r:parseInt(oe[0]+oe[0],16),g:parseInt(oe[1]+oe[1],16),b:parseInt(oe[2]+oe[2],16),a:oe.length===4?b$6(parseInt(oe[3]+oe[3],16)/255,2):1}:{r:parseInt(oe.substring(0,2),16),g:parseInt(oe.substring(2,4),16),b:parseInt(oe.substring(4,6),16),a:oe.length===8?b$6(parseInt(oe.substring(6,8),16)/255,2):1}},w$6=function(oe){return K$4(I$4(oe))},y$5=function(oe){var ne=oe.s,ce=oe.v,ue=oe.a,pe=(200-ne)*ce/100;return{h:b$6(oe.h),s:b$6(pe>0&&pe<200?ne*ce/100/(pe<=100?pe:200-pe)*100:0),l:b$6(pe/2),a:b$6(ue,2)}},q$4=function(oe){var ne=y$5(oe);return"hsl("+ne.h+", "+ne.s+"%, "+ne.l+"%)"},I$4=function(oe){var ne=oe.h,ce=oe.s,ue=oe.v,pe=oe.a;ne=ne/360*6,ce/=100,ue/=100;var me=Math.floor(ne),ge=ue*(1-ce),ve=ue*(1-(ne-me)*ce),ye=ue*(1-(1-ne+me)*ce),xe=me%6;return{r:b$6(255*[ue,ve,ge,ge,ye,ue][xe]),g:b$6(255*[ye,ue,ue,ve,ge,ge][xe]),b:b$6(255*[ge,ge,ye,ue,ue,ve][xe]),a:b$6(pe,2)}},D$4=function(oe){var ne=oe.toString(16);return ne.length<2?"0"+ne:ne},K$4=function(oe){var ne=oe.r,ce=oe.g,ue=oe.b,pe=oe.a,me=pe<1?D$4(b$6(255*pe)):"";return"#"+D$4(ne)+D$4(ce)+D$4(ue)+me},L$4=function(oe){var ne=oe.r,ce=oe.g,ue=oe.b,pe=oe.a,me=Math.max(ne,ce,ue),ge=me-Math.min(ne,ce,ue),ve=ge?me===ne?(ce-ue)/ge:me===ce?2+(ue-ne)/ge:4+(ne-ce)/ge:0;return{h:b$6(60*(ve<0?ve+6:ve)),s:b$6(me?ge/me*100:0),v:b$6(me/255*100),a:pe}},S$6=React$2.memo(function(oe){var ne=oe.hue,ce=oe.onChange,ue=g$5(["react-colorful__hue",oe.className]);return React$2.createElement("div",{className:ue},React$2.createElement(m$5,{onMove:function(pe){ce({h:360*pe.left})},onKey:function(pe){ce({h:s$4(ne+360*pe.left,0,360)})},"aria-label":"Hue","aria-valuenow":b$6(ne),"aria-valuemax":"360","aria-valuemin":"0"},React$2.createElement(p$5,{className:"react-colorful__hue-pointer",left:ne/360,color:q$4({h:ne,s:100,v:100,a:1})})))}),T$4=React$2.memo(function(oe){var ne=oe.hsva,ce=oe.onChange,ue={backgroundColor:q$4({h:ne.h,s:100,v:100,a:1})};return React$2.createElement("div",{className:"react-colorful__saturation",style:ue},React$2.createElement(m$5,{onMove:function(pe){ce({s:100*pe.left,v:100-100*pe.top})},onKey:function(pe){ce({s:s$4(ne.s+100*pe.left,0,100),v:s$4(ne.v-100*pe.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+b$6(ne.s)+"%, Brightness "+b$6(ne.v)+"%"},React$2.createElement(p$5,{className:"react-colorful__saturation-pointer",top:1-ne.v/100,left:ne.s/100,color:q$4(ne)})))}),F$5=function(oe,ne){if(oe===ne)return!0;for(var ce in oe)if(oe[ce]!==ne[ce])return!1;return!0},X$4=function(oe,ne){return oe.toLowerCase()===ne.toLowerCase()||F$5(C$5(oe),C$5(ne))};function Y$4(oe,ne,ce){var ue=i$7(ce),pe=reactExports.useState(function(){return oe.toHsva(ne)}),me=pe[0],ge=pe[1],ve=reactExports.useRef({color:ne,hsva:me});reactExports.useEffect(function(){if(!oe.equal(ne,ve.current.color)){var xe=oe.toHsva(ne);ve.current={hsva:xe,color:ne},ge(xe)}},[ne,oe]),reactExports.useEffect(function(){var xe;F$5(me,ve.current.hsva)||oe.equal(xe=oe.fromHsva(me),ve.current.color)||(ve.current={hsva:me,color:xe},ue(xe))},[me,oe,ue]);var ye=reactExports.useCallback(function(xe){ge(function(_e){return Object.assign({},_e,xe)})},[]);return[me,ye]}var V$4=typeof window<"u"?reactExports.useLayoutEffect:reactExports.useEffect,$$5=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},J$4=new Map,Q$4=function(oe){V$4(function(){var ne=oe.current?oe.current.ownerDocument:document;if(ne!==void 0&&!J$4.has(ne)){var ce=ne.createElement("style");ce.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,J$4.set(ne,ce);var ue=$$5();ue&&ce.setAttribute("nonce",ue),ne.head.appendChild(ce)}},[])},U$4=function(oe){var ne=oe.className,ce=oe.colorModel,ue=oe.color,pe=ue===void 0?ce.defaultColor:ue,me=oe.onChange,ge=c$3(oe,["className","colorModel","color","onChange"]),ve=reactExports.useRef(null);Q$4(ve);var ye=Y$4(ce,pe,me),xe=ye[0],_e=ye[1],we=g$5(["react-colorful",ne]);return React$2.createElement("div",u$4({},ge,{ref:ve,className:we}),React$2.createElement(T$4,{hsva:xe,onChange:_e}),React$2.createElement(S$6,{hue:xe.h,onChange:_e,className:"react-colorful__last-control"}))},W$4={defaultColor:"000",toHsva:x$4,fromHsva:function(oe){return w$6({h:oe.h,s:oe.s,v:oe.v,a:1})},equal:X$4},Z$4=function(oe){return React$2.createElement(U$4,u$4({},oe,{colorModel:W$4}))};const byPoint=({variables:oe},{x:ne,y:ce})=>(oe==null?void 0:oe.x)===ne&&(oe==null?void 0:oe.y)===ce,getGridSymbolsUrl=""+new URL("getGridSymbols.worker-412f6f1d.js",import.meta.url).href;class GetGridSymbolsWorker extends Worker{constructor(){super(getGridSymbolsUrl,{type:"module"})}}const getGridSymbolsAsync=usingWorkerTask(GetGridSymbolsWorker),parseGridWorkerUrl=""+new URL("parseGrid.worker-54cbc273.js",import.meta.url).href;class ParseGridWorker extends Worker{constructor(){super(parseGridWorkerUrl,{type:"module"})}}const parseGridAsync=usingMemoizedWorkerTask(ParseGridWorker);function _extends(){return _extends=Object.assign||function(oe){for(var ne=1;ne{const ue=compilerRuntimeExports.c(8);let pe;ue[0]!==ce?(pe=ce||[],ue[0]=ce,ue[1]=pe):pe=ue[1];const me=reactExports.useRef(pe),ve=me.current===ce||!me.current.every((we,$e)=>we===ce[$e]);me.current=ce;let ye;if(ue[2]!==ne){let we;ue[4]===Symbol.for("react.memo_cache_sentinel")?(we=()=>null,ue[4]=we):we=ue[4],ye=ne.map(we),ue[2]=ne,ue[3]=ye}else ye=ue[3];const xe=ye;let _e;return ue[5]!==ve||ue[6]!==oe?(_e=ve?()=>void oe():()=>{},ue[5]=ve,ue[6]=oe,ue[7]=_e):_e=ue[7],reactExports.useEffect(_e,ve?ne:xe)};function allSame(oe,ne){return lodashExports$1.zip(oe,ne).every(([ce,ue])=>ce===ue)}const useEffectWhenAsync=(oe,ne,ce)=>{const ue=compilerRuntimeExports.c(12);let pe;ue[0]!==ne?(pe=ne===void 0?[]:ne,ue[0]=ne,ue[1]=pe):pe=ue[1];const me=pe;let ge;ue[2]!==ce?(ge=ce===void 0?[]:ce,ue[2]=ce,ue[3]=ge):ge=ue[3];const ve=ge,[ye,xe]=reactExports.useState(me),[_e,we]=reactExports.useState(ve);let $e,Re;ue[4]!==_e||ue[5]!==ve||ue[6]!==me?($e=()=>{allSame(_e,ve)||(xe(me),we(ve))},Re=[me,ve,_e],ue[4]=_e,ue[5]=ve,ue[6]=me,ue[7]=$e,ue[8]=Re):($e=ue[7],Re=ue[8]),reactExports.useEffect($e,Re);let Ae;return ue[9]!==ye||ue[10]!==_e?(Ae=[...ye,..._e],ue[9]=ye,ue[10]=_e,ue[11]=Ae):Ae=ue[11],useAsyncAbortable(oe,Ae)};function useDebouncedState(oe,ne,ce){const ue=compilerRuntimeExports.c(9),pe=ne===void 0?lodashExports$1.noop:ne,me=ce===void 0?300:ce,[ge,ve]=reactExports.useState(oe);let ye,xe;ue[0]!==pe||ue[1]!==ge||ue[2]!==me?(ye=()=>{const $e=lodashExports$1.delay(()=>{pe(ge)},me);return()=>clearTimeout($e)},xe=[ge,pe,me],ue[0]=pe,ue[1]=ge,ue[2]=me,ue[3]=ye,ue[4]=xe):(ye=ue[3],xe=ue[4]);let _e;ue[5]!==ge?(_e=[ge],ue[5]=ge,ue[6]=_e):_e=ue[6],useEffectWhen(ye,xe,_e);let we;return ue[7]!==ge?(we=[ge,ve],ue[7]=ge,ue[8]=we):we=ue[8],we}function between(oe,ne,ce){return oe>=ne&&oe({content:oe,...await parseGridAsync({map:oe,options:ne})}),{normalizer:JSON.stringify});function SymbolColorPicker(oe){const ne=compilerRuntimeExports.c(5),{onChange:ce,value:ue,autoValue:pe}=oe,[me,ge]=useDebouncedState(ue,ce),ve=me??pe;let ye;return ne[0]!==ve||ne[1]!==me||ne[2]!==ge||ne[3]!==pe?(ye=jsxRuntimeExports.jsx(PopupState,{variant:"popover",children:xe=>{var _e;return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(FeaturePickerButton,{...bindTrigger(xe),children:jsxRuntimeExports.jsxs(Stack$1,{direction:"row",gap:1,alignItems:"center",children:[jsxRuntimeExports.jsx(Box$1,{sx:{width:16,height:16,backgroundColor:ve,outline:we=>`1px solid ${we.palette.divider}`,borderRadius:4}}),me?lodashExports$1.startCase(((_e=getClosestColor(me))==null?void 0:_e.name)??"Custom"):"Auto"]})}),jsxRuntimeExports.jsxs(Popover$1,{transformOrigin:{horizontal:"left",vertical:"top"},anchorOrigin:{horizontal:"right",vertical:"top"},...bindPopover(xe),slotProps:{paper:{sx:{overflow:"visible"}}},children:[jsxRuntimeExports.jsx(Box$1,{sx:{px:2,py:1},children:jsxRuntimeExports.jsx(FormControlLabel$1,{control:jsxRuntimeExports.jsx(Checkbox$1,{defaultChecked:!me,onChange:(we,$e)=>ge==null?void 0:ge($e?void 0:pe)}),label:"Choose Automatically"})}),jsxRuntimeExports.jsx(Box$1,{sx:{p:2,pt:0,...!me&&{opacity:we=>we.palette.action.disabledOpacity,pointerEvents:"none"}},children:jsxRuntimeExports.jsx(Z$4,{color:me??pe,onChange:ge})})]})]})}}),ne[0]=ve,ne[1]=me,ne[2]=ge,ne[3]=pe,ne[4]=ye):ye=ne[4],ye}const editor$3=async oe=>{if(oe){const{symbols:ne}=await getGridSymbolsAsync({map:oe});return withProduce(({produce:ce,value:ue})=>{const{palette:pe}=useTheme$1(),me=lodashExports$1.flow(interpolate$1([pe.background.paper,pe.text.primary]),rgbToHex$1);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:lodashExports$1.sortBy(ne,"value").map(({symbol:ge})=>{var ve,ye;return jsxRuntimeExports.jsx(Option,{label:`Tile color for "${ge}"`,content:jsxRuntimeExports.jsx(SymbolColorPicker,{value:(ve=ue==null?void 0:ue.symbols)==null?void 0:ve[ge],autoValue:me(((ye=lodashExports$1.find(ne,{symbol:ge}))==null?void 0:ye.value)??0),onChange:xe=>ce(_e=>{lodashExports$1.set(_e,`symbols["${ge}"]`,xe)})})},ge)})})})}else return()=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{})},hydrate$3=oe=>{const{width:ne,height:ce}=oe.bounds;return{...oe,snap:({x:ue,y:pe},me=1)=>{const[ge,ve]=[lodashExports$1.round(-1+ue+me/2),lodashExports$1.round(-1+pe+me/2)];if(between(ge,0,ne)&&between(ve,0,ce))return{x:ge,y:ve}},nodeAt:ue=>{const{x:pe,y:me}=ue;return me*ne+pe},pointOf:ue=>({x:ue%ne,y:~~(ue/ne)}),matchNode:byPoint}},grid=Object.freeze(Object.defineProperty({__proto__:null,SymbolColorPicker,editor:editor$3,hydrate:hydrate$3,parse:parse$a},Symbol.toStringTag,{value:"Module"})),parseMeshWorkerUrl=""+new URL("parseMesh.worker-f335403f.js",import.meta.url).href;class ParseMeshWorker extends Worker{constructor(){super(parseMeshWorkerUrl,{type:"module"})}}const parseMeshAsync=usingMemoizedWorkerTask(ParseMeshWorker),parse$9=memoizee$1(async(oe="",ne)=>await parseMeshAsync({map:oe,options:ne}),{normalizer:JSON.stringify}),hydrate$2=oe=>({...oe,snap:lodashExports$1.identity,nodeAt:lodashExports$1.constant(0),pointOf:lodashExports$1.constant({x:0,y:0}),matchNode:byPoint}),editor$2=async()=>()=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Type$2,{component:"div",variant:"body2",color:"text.secondary",sx:{mb:1,mt:1},children:"No options available."})}),mesh=Object.freeze(Object.defineProperty({__proto__:null,editor:editor$2,hydrate:hydrate$2,parse:parse$9},Symbol.toStringTag,{value:"Module"})),parseNetworkWorkerUrl=""+new URL("parseNetwork.worker-8208763b.js",import.meta.url).href;class ParseNetworkWorker extends Worker{constructor(){super(parseNetworkWorkerUrl,{type:"module"})}}const parseNetworkAsync=usingMemoizedWorkerTask(ParseNetworkWorker),parse$8=memoizee$1(async(oe="",ne)=>await parseNetworkAsync({map:oe,options:ne}),{normalizer:JSON.stringify}),hydrate$1=oe=>({...oe,snap:lodashExports$1.identity,nodeAt:lodashExports$1.constant(0),pointOf:lodashExports$1.constant({x:0,y:0}),matchNode:byPoint}),editor$1=async()=>()=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Type$2,{component:"div",variant:"body2",color:"text.secondary",sx:{mb:1,mt:1},children:"No options available."})}),xy=Object.freeze(Object.defineProperty({__proto__:null,editor:editor$1,hydrate:hydrate$1,parse:parse$8},Symbol.toStringTag,{value:"Module"})),parsePolyWorkerUrl=""+new URL("parsePoly.worker-47ff7d18.js",import.meta.url).href;class ParsePolyWorker extends Worker{constructor(){super(parsePolyWorkerUrl,{type:"module"})}}const parsePolyAsync=usingMemoizedWorkerTask(ParsePolyWorker),parse$7=memoizee$1(async(oe="",ne)=>await parsePolyAsync({map:oe,options:ne}),{normalizer:JSON.stringify}),hydrate=oe=>({...oe,snap:lodashExports$1.identity,nodeAt:lodashExports$1.constant(0),pointOf:lodashExports$1.constant({x:0,y:0}),matchNode:byPoint}),editor=async()=>()=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Type$2,{component:"div",variant:"body2",color:"text.secondary",sx:{mb:1,mt:1},children:"No options available."})}),poly=Object.freeze(Object.defineProperty({__proto__:null,editor,hydrate,parse:parse$7},Symbol.toStringTag,{value:"Module"})),mapParsers={grid,map:grid,xy,mesh,poly};function getParser(oe=""){return mapParsers[oe]}const defaultGuard=lodashExports$1.constant(!0),[useLayers,LayersProvider]=createSlice({layers:[]});function useLayer(oe,ne){const ce=compilerRuntimeExports.c(21),ue=ne===void 0?defaultGuard:ne,[pe,me]=reactExports.useState(oe),[ge,ve]=useLayers(),{layers:ye}=ge;let xe,_e;ce[0]!==ye||ce[1]!==ue||ce[2]!==pe?(_e=lodashExports$1.filter(ye,ue),xe=pe?lodashExports$1.find(_e,{key:pe})??lodashExports$1.head(_e):lodashExports$1.head(_e),ce[0]=ye,ce[1]=ue,ce[2]=pe,ce[3]=xe,ce[4]=_e):(xe=ce[3],_e=ce[4]);const we=xe;let $e,Re;ce[5]!==oe?($e=()=>{me(oe)},Re=[oe],ce[5]=oe,ce[6]=$e,ce[7]=Re):($e=ce[6],Re=ce[7]),reactExports.useEffect($e,Re);let Ae,Ie;ce[8]!==we||ce[9]!==pe?(Ae=()=>{we&&we.key!==pe&&me(we.key)},Ie=[we,pe,me],ce[8]=we,ce[9]=pe,ce[10]=Ae,ce[11]=Ie):(Ae=ce[10],Ie=ce[11]),reactExports.useEffect(Ae,Ie);let ke;const Be=we==null?void 0:we.key;let Ne;ce[12]!==we||ce[13]!==ve?(Ne=Ue=>{const qe={...we,...Ue};ve(We=>{const{layers:ze}=We;return{layers:lodashExports$1.map(ze,Ge=>Ge.key===qe.key?qe:Ge)}})},ce[12]=we,ce[13]=ve,ce[14]=Ne):Ne=ce[14];let Fe;return ce[15]!==Be||ce[16]!==we||ce[17]!==Ne||ce[18]!==_e||ce[19]!==ye?(Fe={key:Be,setKey:me,layer:we,setLayer:Ne,layers:_e,allLayers:ye},ce[15]=Be,ce[16]=we,ce[17]=Ne,ce[18]=_e,ce[19]=ye,ce[20]=Fe):Fe=ce[20],ke=Fe,ke}const fn=memoizee$1((oe,ne)=>new Function("params",`${oe}; return ${ne}.apply(null, params);`));function call$1(oe,ne,ce){try{return fn(oe,ne)(ce)}catch{return templates[ne].defaultReturnValue}}const treeWorkerUrl$1=""+new URL("treeLegacy.worker-a5e2610c.js",import.meta.url).href;let TreeWorkerUrl$1=class extends Worker{constructor(){super(treeWorkerUrl$1,{type:"module"})}};const treeAsync$1=usingMemoizedWorkerTask(TreeWorkerUrl$1);function useTree$1(oe){const ne=compilerRuntimeExports.c(3);let ce,ue;return ne[0]!==oe?(ce=async()=>await treeAsync$1(oe),ue=[oe],ne[0]=oe,ne[1]=ce,ne[2]=ue):(ce=ne[1],ue=ne[2]),useAsync(ce,ue)}function useTreeMemo$1(oe,ne){const ce=reactExports.useMemo(()=>oe,ne);return useTree$1(ce)}function useBreakpoints(oe){var xe;const{layer:ne}=useLayer(oe),{monotonicF:ce,monotonicG:ue,breakpoints:pe,code:me,trace:ge}=(ne==null?void 0:ne.source)??{},ve=ge==null?void 0:ge.content,{result:ye}=useTreeMemo$1({trace:ve,step:(xe=ve==null?void 0:ve.events)==null?void 0:xe.length,radius:void 0},[ve]);return reactExports.useMemo(()=>{const _e=(ve==null?void 0:ve.events)??[],we=treeToDict((ye==null?void 0:ye.tree)??[]);return memoizee$1($e=>{var Ae,Ie;const Re=_e[$e];if(Re)try{for(const{active:ke,condition:Be,type:Ne,property:Fe="",reference:Ue=0}of pe??[]){const qe=!Ne||Ne===Re.type;if(ke&&qe&&(()=>{var ze;return(ze=Be==null?void 0:Be.apply)==null?void 0:ze.call(Be,{type:Ne,event:Re,property:Fe,value:lodashExports$1.get(Re,Fe),reference:Ue,step:$e,events:_e,node:we[$e]})})())return Be!=null&&Be.needsReference?{result:`${Fe} ${lodashExports$1.toLower(lodashExports$1.startCase(Be==null?void 0:Be.key))} ${Ue}`}:{result:`${Fe} ${lodashExports$1.toLower(lodashExports$1.startCase(Be==null?void 0:Be.key))}`}}if(call$1(me??"","shouldBreak",[$e,Re,_e,(Ae=we[$e])==null?void 0:Ae.parent,(Ie=we[$e])==null?void 0:Ie.children]))return{result:"Script editor"}}catch(ke){return{error:`${ke}`}}return{result:""}})},[me,ve,pe,ce,ue,ye])}function treeToDict(oe=[],ne={}){for(const ce of oe){for(const ue of ce.events)ne[ue.step]=ce;treeToDict(ce.children,ne)}return ne}function cancellable(oe,ne){let ce=!1;return requestAnimationFrame(async()=>{const ue=await oe();ce||ne(ue)}),()=>{ce=!0}}function usePlaybackState(oe){const{layer:ne,setLayer:ce,setKey:ue}=useLayer(oe),pe=useSnackbar(),me=useBreakpoints(oe);reactExports.useEffect(()=>{oe&&ue(oe)},[oe]);const{playback:ge,playbackTo:ve,step:ye=0}=(ne==null?void 0:ne.source)??{},xe=lodashExports$1.min([ve,ye])??0,_e=!!ve,we=ge==="playing",[$e,Re]=[0,(ve??1)-1];return reactExports.useMemo(()=>{function Ae(We){ce(produce(ne,ze=>lodashExports$1.set(ze,"source",{...ze==null?void 0:ze.source,...We})))}const Ie={start:$e,end:Re,step:xe,canPlay:_e&&!we&&xe0},ke=(We=0)=>{Ae({playback:"paused",step:Ue(We)})},Be=(We=1)=>Ae({playback:"playing",step:Ue(We)}),Ne=(We,ze=0)=>cancellable(async()=>{for(const Ge of lodashExports$1.range(ze,We)){const Ze=me(xe+Ge);if(Ze.result||Ze.error)return{...Ze,offset:Ge}}return{result:"",offset:0,error:void 0}},({result:Ge,offset:Ze,error:Je})=>{Je?(pe(`${lodashExports$1.trimEnd(Je,".")}`,`Step ${xe+Ze}`),ke()):Ge?(pe(`Breakpoint hit: ${Ge}`,`Step ${xe+Ze}`),ke(Ze)):Be(We)}),Fe=(We=1)=>{var Ge;let ze;for(ze=xe+We;ze<=Re&&ze>=0&&!((Ge=me(ze))!=null&&Ge.result);ze+=We);return ze},Ue=We=>lodashExports$1.clamp(xe+We,$e,Re);return{playing:ge==="playing",...Ie,...{play:()=>{Ae({playback:"playing",step:Ue(1)})},pause:ke,stepTo:(We=0)=>Ae({step:lodashExports$1.clamp(We,$e,Re)}),stop:()=>Ae({step:$e,playback:"paused"}),stepForward:()=>Ae({step:Ue(1)}),stepBackward:()=>Ae({step:Ue(-1)}),tick:Be,findBreakpoint:Fe,stepWithBreakpointCheck:Ne}}},[Re,ge,we,_e,$e,xe,ce])}function RenderLayer(oe){var ge,ve;const ne=compilerRuntimeExports.c(5),{layer:ce,index:ue}=oe;let pe;ne[0]!==ce||ne[1]!==ue?(pe=ce&&reactExports.createElement((ve=layerHandlers[((ge=ce==null?void 0:ce.source)==null?void 0:ge.type)??""])==null?void 0:ve.renderer,{layer:ce,index:ue}),ne[0]=ce,ne[1]=ue,ne[2]=pe):pe=ne[2];let me;return ne[3]!==pe?(me=jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:pe}),ne[3]=pe,ne[4]=me):me=ne[4],me}const[useRenderers,RendererProvider]=createSlice([],{reduce:replace$1}),removeUndefinedValues=oe=>lodashExports$1.omit(oe,lodashExports$1.filter(lodashExports$1.keys(oe),ne=>lodashExports$1.isUndefined(oe[ne]))),[useScreenshots,ScreenshotsProvider]=createSlice({},{reduce:lodashExports$1.flow(merge$4,removeUndefinedValues)});function Placeholder$2({label:oe,icon:ne=jsxRuntimeExports.jsx(WidgetsOutlined,{}),secondary:ce,...ue}){return jsxRuntimeExports.jsxs(Flex,{justifyContent:"center",alignItems:"center",color:"text.secondary",sx:{gap:2,p:6,pt:12,background:pe=>`repeating-linear-gradient( + */function paletteMapKey(oe){return oe=normalize$2(oe),oe.A!==1?`rgba(${oe.R}, ${oe.G}, ${oe.B}, ${oe.A})`:`rgb(${oe.R}, ${oe.G}, ${oe.B})`}function labPaletteMapKey(oe){return`lab(${oe.L}, ${oe.a}, ${oe.b})`}function mapPalette(oe,ne,ce,ue){const pe={};ue=ue||{R:255,G:255,B:255},ce=ce||"closest";for(let me=0;meye){ve=_e,ye=we;continue}}ve&&(pe[paletteMapKey(ge)]=ve)}return pe}function matchPaletteLab(oe,ne,ce){let ue,pe,me=ne[0],ge=ciede2000(oe,me);for(let ve=1,ye=ne.length;vege)&&(me=ue,ge=pe);return me}function mapPaletteLab(oe,ne,ce){const ue={},pe=ce==="furthest";for(let me=0;me{let ne=hexRgb(oe);return{R:ne[0],G:ne[1],B:ne[2]}},pantoneRGBList=pantones.map(oe=>get_rgbObject(oe.hex));var getClosestColor=oe=>{const ne=get_rgbObject(oe),ce=diff.closest(ne,pantoneRGBList),ue=rgbHex(ce.R,ce.G,ce.B),pe=pantones.findIndex(ge=>ge.hex==`#${ue}`);return pantones[pe]};function u$4(){return(u$4=Object.assign||function(oe){for(var ne=1;ne=0||(pe[ce]=oe[ce]);return pe}function i$7(oe){var ne=reactExports.useRef(oe),ce=reactExports.useRef(function(ue){ne.current&&ne.current(ue)});return ne.current=oe,ce.current}var s$4=function(oe,ne,ce){return ne===void 0&&(ne=0),ce===void 0&&(ce=1),oe>ce?ce:oe0:ke.buttons>0)&&pe.current?me(d$6(pe.current,ke,ve.current)):Ie(!1)},Ae=function(){return Ie(!1)};function Ie(ke){var Be=ye.current,Ne=v$5(pe.current),Fe=ke?Ne.addEventListener:Ne.removeEventListener;Fe(Be?"touchmove":"mousemove",Re),Fe(Be?"touchend":"mouseup",Ae)}return[function(ke){var Be=ke.nativeEvent,Ne=pe.current;if(Ne&&(h$5(Be),!function(Ue,qe){return qe&&!f$6(Ue)}(Be,ye.current)&&Ne)){if(f$6(Be)){ye.current=!0;var Fe=Be.changedTouches||[];Fe.length&&(ve.current=Fe[0].identifier)}Ne.focus(),me(d$6(Ne,Be,ve.current)),Ie(!0)}},function(ke){var Be=ke.which||ke.keyCode;Be<37||Be>40||(ke.preventDefault(),ge({left:Be===39?.05:Be===37?-.05:0,top:Be===40?.05:Be===38?-.05:0}))},Ie]},[ge,me]),_e=xe[0],we=xe[1],$e=xe[2];return reactExports.useEffect(function(){return $e},[$e]),React$2.createElement("div",u$4({},ue,{onTouchStart:_e,onMouseDown:_e,className:"react-colorful__interactive",ref:pe,onKeyDown:we,tabIndex:0,role:"slider"}))}),g$5=function(oe){return oe.filter(Boolean).join(" ")},p$5=function(oe){var ne=oe.color,ce=oe.left,ue=oe.top,pe=ue===void 0?.5:ue,me=g$5(["react-colorful__pointer",oe.className]);return React$2.createElement("div",{className:me,style:{top:100*pe+"%",left:100*ce+"%"}},React$2.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:ne}}))},b$6=function(oe,ne,ce){return ne===void 0&&(ne=0),ce===void 0&&(ce=Math.pow(10,ne)),Math.round(ce*oe)/ce},x$4=function(oe){return L$4(C$5(oe))},C$5=function(oe){return oe[0]==="#"&&(oe=oe.substring(1)),oe.length<6?{r:parseInt(oe[0]+oe[0],16),g:parseInt(oe[1]+oe[1],16),b:parseInt(oe[2]+oe[2],16),a:oe.length===4?b$6(parseInt(oe[3]+oe[3],16)/255,2):1}:{r:parseInt(oe.substring(0,2),16),g:parseInt(oe.substring(2,4),16),b:parseInt(oe.substring(4,6),16),a:oe.length===8?b$6(parseInt(oe.substring(6,8),16)/255,2):1}},w$6=function(oe){return K$4(I$4(oe))},y$5=function(oe){var ne=oe.s,ce=oe.v,ue=oe.a,pe=(200-ne)*ce/100;return{h:b$6(oe.h),s:b$6(pe>0&&pe<200?ne*ce/100/(pe<=100?pe:200-pe)*100:0),l:b$6(pe/2),a:b$6(ue,2)}},q$4=function(oe){var ne=y$5(oe);return"hsl("+ne.h+", "+ne.s+"%, "+ne.l+"%)"},I$4=function(oe){var ne=oe.h,ce=oe.s,ue=oe.v,pe=oe.a;ne=ne/360*6,ce/=100,ue/=100;var me=Math.floor(ne),ge=ue*(1-ce),ve=ue*(1-(ne-me)*ce),ye=ue*(1-(1-ne+me)*ce),xe=me%6;return{r:b$6(255*[ue,ve,ge,ge,ye,ue][xe]),g:b$6(255*[ye,ue,ue,ve,ge,ge][xe]),b:b$6(255*[ge,ge,ye,ue,ue,ve][xe]),a:b$6(pe,2)}},D$4=function(oe){var ne=oe.toString(16);return ne.length<2?"0"+ne:ne},K$4=function(oe){var ne=oe.r,ce=oe.g,ue=oe.b,pe=oe.a,me=pe<1?D$4(b$6(255*pe)):"";return"#"+D$4(ne)+D$4(ce)+D$4(ue)+me},L$4=function(oe){var ne=oe.r,ce=oe.g,ue=oe.b,pe=oe.a,me=Math.max(ne,ce,ue),ge=me-Math.min(ne,ce,ue),ve=ge?me===ne?(ce-ue)/ge:me===ce?2+(ue-ne)/ge:4+(ne-ce)/ge:0;return{h:b$6(60*(ve<0?ve+6:ve)),s:b$6(me?ge/me*100:0),v:b$6(me/255*100),a:pe}},S$6=React$2.memo(function(oe){var ne=oe.hue,ce=oe.onChange,ue=g$5(["react-colorful__hue",oe.className]);return React$2.createElement("div",{className:ue},React$2.createElement(m$5,{onMove:function(pe){ce({h:360*pe.left})},onKey:function(pe){ce({h:s$4(ne+360*pe.left,0,360)})},"aria-label":"Hue","aria-valuenow":b$6(ne),"aria-valuemax":"360","aria-valuemin":"0"},React$2.createElement(p$5,{className:"react-colorful__hue-pointer",left:ne/360,color:q$4({h:ne,s:100,v:100,a:1})})))}),T$4=React$2.memo(function(oe){var ne=oe.hsva,ce=oe.onChange,ue={backgroundColor:q$4({h:ne.h,s:100,v:100,a:1})};return React$2.createElement("div",{className:"react-colorful__saturation",style:ue},React$2.createElement(m$5,{onMove:function(pe){ce({s:100*pe.left,v:100-100*pe.top})},onKey:function(pe){ce({s:s$4(ne.s+100*pe.left,0,100),v:s$4(ne.v-100*pe.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+b$6(ne.s)+"%, Brightness "+b$6(ne.v)+"%"},React$2.createElement(p$5,{className:"react-colorful__saturation-pointer",top:1-ne.v/100,left:ne.s/100,color:q$4(ne)})))}),F$5=function(oe,ne){if(oe===ne)return!0;for(var ce in oe)if(oe[ce]!==ne[ce])return!1;return!0},X$4=function(oe,ne){return oe.toLowerCase()===ne.toLowerCase()||F$5(C$5(oe),C$5(ne))};function Y$4(oe,ne,ce){var ue=i$7(ce),pe=reactExports.useState(function(){return oe.toHsva(ne)}),me=pe[0],ge=pe[1],ve=reactExports.useRef({color:ne,hsva:me});reactExports.useEffect(function(){if(!oe.equal(ne,ve.current.color)){var xe=oe.toHsva(ne);ve.current={hsva:xe,color:ne},ge(xe)}},[ne,oe]),reactExports.useEffect(function(){var xe;F$5(me,ve.current.hsva)||oe.equal(xe=oe.fromHsva(me),ve.current.color)||(ve.current={hsva:me,color:xe},ue(xe))},[me,oe,ue]);var ye=reactExports.useCallback(function(xe){ge(function(_e){return Object.assign({},_e,xe)})},[]);return[me,ye]}var V$4=typeof window<"u"?reactExports.useLayoutEffect:reactExports.useEffect,$$5=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},J$4=new Map,Q$4=function(oe){V$4(function(){var ne=oe.current?oe.current.ownerDocument:document;if(ne!==void 0&&!J$4.has(ne)){var ce=ne.createElement("style");ce.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,J$4.set(ne,ce);var ue=$$5();ue&&ce.setAttribute("nonce",ue),ne.head.appendChild(ce)}},[])},U$4=function(oe){var ne=oe.className,ce=oe.colorModel,ue=oe.color,pe=ue===void 0?ce.defaultColor:ue,me=oe.onChange,ge=c$3(oe,["className","colorModel","color","onChange"]),ve=reactExports.useRef(null);Q$4(ve);var ye=Y$4(ce,pe,me),xe=ye[0],_e=ye[1],we=g$5(["react-colorful",ne]);return React$2.createElement("div",u$4({},ge,{ref:ve,className:we}),React$2.createElement(T$4,{hsva:xe,onChange:_e}),React$2.createElement(S$6,{hue:xe.h,onChange:_e,className:"react-colorful__last-control"}))},W$4={defaultColor:"000",toHsva:x$4,fromHsva:function(oe){return w$6({h:oe.h,s:oe.s,v:oe.v,a:1})},equal:X$4},Z$4=function(oe){return React$2.createElement(U$4,u$4({},oe,{colorModel:W$4}))};const byPoint=({variables:oe},{x:ne,y:ce})=>(oe==null?void 0:oe.x)===ne&&(oe==null?void 0:oe.y)===ce,getGridSymbolsUrl=""+new URL("getGridSymbols.worker-412f6f1d.js",import.meta.url).href;class GetGridSymbolsWorker extends Worker{constructor(){super(getGridSymbolsUrl,{type:"module"})}}const getGridSymbolsAsync=usingWorkerTask(GetGridSymbolsWorker),parseGridWorkerUrl=""+new URL("parseGrid.worker-54cbc273.js",import.meta.url).href;class ParseGridWorker extends Worker{constructor(){super(parseGridWorkerUrl,{type:"module"})}}const parseGridAsync=usingMemoizedWorkerTask(ParseGridWorker);function useDebouncedState(oe,ne,ce){const ue=compilerRuntimeExports.c(6),pe=ne===void 0?lodashExports$1.noop:ne,[me,ge]=reactExports.useState(oe);let ve;ue[0]===Symbol.for("react.memo_cache_sentinel")?(ve=lodashExports$1.now(),ue[0]=ve):ve=ue[0];const ye=reactExports.useRef(ve);let xe;ue[1]!==pe?(xe=we=>{const $e=lodashExports$1.now();requestIdleCallback(()=>{$e>ye.current&&(pe==null||pe(we),ye.current=$e)},{timeout:300}),ge(we)},ue[1]=pe,ue[2]=xe):xe=ue[2];let _e;return ue[3]!==me||ue[4]!==xe?(_e=[me,xe],ue[3]=me,ue[4]=xe,ue[5]=_e):_e=ue[5],_e}function between(oe,ne,ce){return oe>=ne&&oe({content:oe,...await parseGridAsync({map:oe,options:ne})}),{normalizer:JSON.stringify});function SymbolColorPicker(oe){const ne=compilerRuntimeExports.c(5),{onChange:ce,value:ue,autoValue:pe}=oe,[me,ge]=useDebouncedState(ue,ce),ve=me??pe;let ye;return ne[0]!==ve||ne[1]!==me||ne[2]!==ge||ne[3]!==pe?(ye=jsxRuntimeExports.jsx(PopupState,{variant:"popover",children:xe=>{var _e;return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(FeaturePickerButton,{...bindTrigger(xe),children:jsxRuntimeExports.jsxs(Stack$1,{direction:"row",gap:1,alignItems:"center",children:[jsxRuntimeExports.jsx(Box$1,{sx:{width:16,height:16,backgroundColor:ve,outline:we=>`1px solid ${we.palette.divider}`,borderRadius:4}}),me?lodashExports$1.startCase(((_e=getClosestColor(me))==null?void 0:_e.name)??"Custom"):"Auto"]})}),jsxRuntimeExports.jsxs(Popover$1,{transformOrigin:{horizontal:"left",vertical:"top"},anchorOrigin:{horizontal:"right",vertical:"top"},...bindPopover(xe),slotProps:{paper:{sx:{overflow:"visible"}}},children:[jsxRuntimeExports.jsx(Box$1,{sx:{px:2,py:1},children:jsxRuntimeExports.jsx(FormControlLabel$1,{control:jsxRuntimeExports.jsx(Checkbox$1,{defaultChecked:!me,onChange:(we,$e)=>ge==null?void 0:ge($e?void 0:pe)}),label:"Choose Automatically"})}),jsxRuntimeExports.jsx(Box$1,{sx:{p:2,pt:0,...!me&&{opacity:we=>we.palette.action.disabledOpacity,pointerEvents:"none"}},children:jsxRuntimeExports.jsx(Z$4,{color:me??pe,onChange:ge})})]})]})}}),ne[0]=ve,ne[1]=me,ne[2]=ge,ne[3]=pe,ne[4]=ye):ye=ne[4],ye}const editor$3=async oe=>{if(oe){const{symbols:ne}=await getGridSymbolsAsync({map:oe});return withProduce(({produce:ce,value:ue})=>{const{palette:pe}=useTheme$1(),me=lodashExports$1.flow(interpolate$1([pe.background.paper,pe.text.primary]),rgbToHex$1);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:lodashExports$1.sortBy(ne,"value").map(({symbol:ge})=>{var ve,ye;return jsxRuntimeExports.jsx(Option,{label:`Tile color for "${ge}"`,content:jsxRuntimeExports.jsx(SymbolColorPicker,{value:(ve=ue==null?void 0:ue.symbols)==null?void 0:ve[ge],autoValue:me(((ye=lodashExports$1.find(ne,{symbol:ge}))==null?void 0:ye.value)??0),onChange:xe=>ce(_e=>{lodashExports$1.set(_e,`symbols["${ge}"]`,xe)})})},ge)})})})}else return()=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{})},hydrate$3=oe=>{const{width:ne,height:ce}=oe.bounds;return{...oe,snap:({x:ue,y:pe},me=1)=>{const[ge,ve]=[lodashExports$1.round(-1+ue+me/2),lodashExports$1.round(-1+pe+me/2)];if(between(ge,0,ne)&&between(ve,0,ce))return{x:ge,y:ve}},nodeAt:ue=>{const{x:pe,y:me}=ue;return me*ne+pe},pointOf:ue=>({x:ue%ne,y:~~(ue/ne)}),matchNode:byPoint}},grid=Object.freeze(Object.defineProperty({__proto__:null,SymbolColorPicker,editor:editor$3,hydrate:hydrate$3,parse:parse$a},Symbol.toStringTag,{value:"Module"})),parseMeshWorkerUrl=""+new URL("parseMesh.worker-f335403f.js",import.meta.url).href;class ParseMeshWorker extends Worker{constructor(){super(parseMeshWorkerUrl,{type:"module"})}}const parseMeshAsync=usingMemoizedWorkerTask(ParseMeshWorker),parse$9=memoizee$1(async(oe="",ne)=>await parseMeshAsync({map:oe,options:ne}),{normalizer:JSON.stringify}),hydrate$2=oe=>({...oe,snap:lodashExports$1.identity,nodeAt:lodashExports$1.constant(0),pointOf:lodashExports$1.constant({x:0,y:0}),matchNode:byPoint}),editor$2=async()=>()=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Type$2,{component:"div",variant:"body2",color:"text.secondary",sx:{mb:1,mt:1},children:"No options available."})}),mesh=Object.freeze(Object.defineProperty({__proto__:null,editor:editor$2,hydrate:hydrate$2,parse:parse$9},Symbol.toStringTag,{value:"Module"})),parseNetworkWorkerUrl=""+new URL("parseNetwork.worker-8208763b.js",import.meta.url).href;class ParseNetworkWorker extends Worker{constructor(){super(parseNetworkWorkerUrl,{type:"module"})}}const parseNetworkAsync=usingMemoizedWorkerTask(ParseNetworkWorker),parse$8=memoizee$1(async(oe="",ne)=>await parseNetworkAsync({map:oe,options:ne}),{normalizer:JSON.stringify}),hydrate$1=oe=>({...oe,snap:lodashExports$1.identity,nodeAt:lodashExports$1.constant(0),pointOf:lodashExports$1.constant({x:0,y:0}),matchNode:byPoint}),editor$1=async()=>()=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Type$2,{component:"div",variant:"body2",color:"text.secondary",sx:{mb:1,mt:1},children:"No options available."})}),xy=Object.freeze(Object.defineProperty({__proto__:null,editor:editor$1,hydrate:hydrate$1,parse:parse$8},Symbol.toStringTag,{value:"Module"})),parsePolyWorkerUrl=""+new URL("parsePoly.worker-47ff7d18.js",import.meta.url).href;class ParsePolyWorker extends Worker{constructor(){super(parsePolyWorkerUrl,{type:"module"})}}const parsePolyAsync=usingMemoizedWorkerTask(ParsePolyWorker),parse$7=memoizee$1(async(oe="",ne)=>await parsePolyAsync({map:oe,options:ne}),{normalizer:JSON.stringify}),hydrate=oe=>({...oe,snap:lodashExports$1.identity,nodeAt:lodashExports$1.constant(0),pointOf:lodashExports$1.constant({x:0,y:0}),matchNode:byPoint}),editor=async()=>()=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Type$2,{component:"div",variant:"body2",color:"text.secondary",sx:{mb:1,mt:1},children:"No options available."})}),poly=Object.freeze(Object.defineProperty({__proto__:null,editor,hydrate,parse:parse$7},Symbol.toStringTag,{value:"Module"})),mapParsers={grid,map:grid,xy,mesh,poly};function getParser(oe=""){return mapParsers[oe]}const defaultGuard=lodashExports$1.constant(!0),[useLayers,LayersProvider]=createSlice({layers:[]});function useLayer(oe,ne){const ce=compilerRuntimeExports.c(21),ue=ne===void 0?defaultGuard:ne,[pe,me]=reactExports.useState(oe),[ge,ve]=useLayers(),{layers:ye}=ge;let xe,_e;ce[0]!==ye||ce[1]!==ue||ce[2]!==pe?(_e=lodashExports$1.filter(ye,ue),xe=pe?lodashExports$1.find(_e,{key:pe})??lodashExports$1.head(_e):lodashExports$1.head(_e),ce[0]=ye,ce[1]=ue,ce[2]=pe,ce[3]=xe,ce[4]=_e):(xe=ce[3],_e=ce[4]);const we=xe;let $e,Re;ce[5]!==oe?($e=()=>{me(oe)},Re=[oe],ce[5]=oe,ce[6]=$e,ce[7]=Re):($e=ce[6],Re=ce[7]),reactExports.useEffect($e,Re);let Ae,Ie;ce[8]!==we||ce[9]!==pe?(Ae=()=>{we&&we.key!==pe&&me(we.key)},Ie=[we,pe,me],ce[8]=we,ce[9]=pe,ce[10]=Ae,ce[11]=Ie):(Ae=ce[10],Ie=ce[11]),reactExports.useEffect(Ae,Ie);let ke;const Be=we==null?void 0:we.key;let Ne;ce[12]!==we||ce[13]!==ve?(Ne=Ue=>{const qe={...we,...Ue};ve(We=>{const{layers:ze}=We;return{layers:lodashExports$1.map(ze,Ge=>Ge.key===qe.key?qe:Ge)}})},ce[12]=we,ce[13]=ve,ce[14]=Ne):Ne=ce[14];let Fe;return ce[15]!==Be||ce[16]!==we||ce[17]!==Ne||ce[18]!==_e||ce[19]!==ye?(Fe={key:Be,setKey:me,layer:we,setLayer:Ne,layers:_e,allLayers:ye},ce[15]=Be,ce[16]=we,ce[17]=Ne,ce[18]=_e,ce[19]=ye,ce[20]=Fe):Fe=ce[20],ke=Fe,ke}const fn=memoizee$1((oe,ne)=>new Function("params",`${oe}; return ${ne}.apply(null, params);`));function call$1(oe,ne,ce){try{return fn(oe,ne)(ce)}catch{return templates[ne].defaultReturnValue}}function _extends(){return _extends=Object.assign||function(oe){for(var ne=1;neawait treeAsync$1(oe),ue=[oe],ne[0]=oe,ne[1]=ce,ne[2]=ue):(ce=ne[1],ue=ne[2]),useAsync(ce,ue)}function useTreeMemo$1(oe,ne){const ce=reactExports.useMemo(()=>oe,ne);return useTree$1(ce)}function useBreakpoints(oe){var xe;const{layer:ne}=useLayer(oe),{monotonicF:ce,monotonicG:ue,breakpoints:pe,code:me,trace:ge}=(ne==null?void 0:ne.source)??{},ve=ge==null?void 0:ge.content,{result:ye}=useTreeMemo$1({trace:ve,step:(xe=ve==null?void 0:ve.events)==null?void 0:xe.length,radius:void 0},[ve]);return reactExports.useMemo(()=>{const _e=(ve==null?void 0:ve.events)??[],we=treeToDict((ye==null?void 0:ye.tree)??[]);return memoizee$1($e=>{var Ae,Ie;const Re=_e[$e];if(Re)try{for(const{active:ke,condition:Be,type:Ne,property:Fe="",reference:Ue=0}of pe??[]){const qe=!Ne||Ne===Re.type;if(ke&&qe&&(()=>{var ze;return(ze=Be==null?void 0:Be.apply)==null?void 0:ze.call(Be,{type:Ne,event:Re,property:Fe,value:lodashExports$1.get(Re,Fe),reference:Ue,step:$e,events:_e,node:we[$e]})})())return Be!=null&&Be.needsReference?{result:`${Fe} ${lodashExports$1.toLower(lodashExports$1.startCase(Be==null?void 0:Be.key))} ${Ue}`}:{result:`${Fe} ${lodashExports$1.toLower(lodashExports$1.startCase(Be==null?void 0:Be.key))}`}}if(call$1(me??"","shouldBreak",[$e,Re,_e,(Ae=we[$e])==null?void 0:Ae.parent,(Ie=we[$e])==null?void 0:Ie.children]))return{result:"Script editor"}}catch(ke){return{error:`${ke}`}}return{result:""}})},[me,ve,pe,ce,ue,ye])}function treeToDict(oe=[],ne={}){for(const ce of oe){for(const ue of ce.events)ne[ue.step]=ce;treeToDict(ce.children,ne)}return ne}function cancellable(oe,ne){let ce=!1;return requestAnimationFrame(async()=>{const ue=await oe();ce||ne(ue)}),()=>{ce=!0}}function usePlaybackState(oe){const{layer:ne,setLayer:ce,setKey:ue}=useLayer(oe),pe=useSnackbar(),me=useBreakpoints(oe);reactExports.useEffect(()=>{oe&&ue(oe)},[oe]);const{playback:ge,playbackTo:ve,step:ye=0}=(ne==null?void 0:ne.source)??{},xe=lodashExports$1.min([ve,ye])??0,_e=!!ve,we=ge==="playing",[$e,Re]=[0,(ve??1)-1];return reactExports.useMemo(()=>{function Ae(We){ce(produce(ne,ze=>lodashExports$1.set(ze,"source",{...ze==null?void 0:ze.source,...We})))}const Ie={start:$e,end:Re,step:xe,canPlay:_e&&!we&&xe0},ke=(We=0)=>{Ae({playback:"paused",step:Ue(We)})},Be=(We=1)=>Ae({playback:"playing",step:Ue(We)}),Ne=(We,ze=0)=>cancellable(async()=>{for(const Ge of lodashExports$1.range(ze,We)){const Ze=me(xe+Ge);if(Ze.result||Ze.error)return{...Ze,offset:Ge}}return{result:"",offset:0,error:void 0}},({result:Ge,offset:Ze,error:Je})=>{Je?(pe(`${lodashExports$1.trimEnd(Je,".")}`,`Step ${xe+Ze}`),ke()):Ge?(pe(`Breakpoint hit: ${Ge}`,`Step ${xe+Ze}`),ke(Ze)):Be(We)}),Fe=(We=1)=>{var Ge;let ze;for(ze=xe+We;ze<=Re&&ze>=0&&!((Ge=me(ze))!=null&&Ge.result);ze+=We);return ze},Ue=We=>lodashExports$1.clamp(xe+We,$e,Re);return{playing:ge==="playing",...Ie,...{play:()=>{Ae({playback:"playing",step:Ue(1)})},pause:ke,stepTo:(We=0)=>Ae({step:lodashExports$1.clamp(We,$e,Re)}),stop:()=>Ae({step:$e,playback:"paused"}),stepForward:()=>Ae({step:Ue(1)}),stepBackward:()=>Ae({step:Ue(-1)}),tick:Be,findBreakpoint:Fe,stepWithBreakpointCheck:Ne}}},[Re,ge,we,_e,$e,xe,ce])}function RenderLayer(oe){var ge,ve;const ne=compilerRuntimeExports.c(5),{layer:ce,index:ue}=oe;let pe;ne[0]!==ce||ne[1]!==ue?(pe=ce&&reactExports.createElement((ve=layerHandlers[((ge=ce==null?void 0:ce.source)==null?void 0:ge.type)??""])==null?void 0:ve.renderer,{layer:ce,index:ue}),ne[0]=ce,ne[1]=ue,ne[2]=pe):pe=ne[2];let me;return ne[3]!==pe?(me=jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:pe}),ne[3]=pe,ne[4]=me):me=ne[4],me}const[useRenderers,RendererProvider]=createSlice([],{reduce:replace$1}),removeUndefinedValues=oe=>lodashExports$1.omit(oe,lodashExports$1.filter(lodashExports$1.keys(oe),ne=>lodashExports$1.isUndefined(oe[ne]))),[useScreenshots,ScreenshotsProvider]=createSlice({},{reduce:lodashExports$1.flow(merge$4,removeUndefinedValues)});function Placeholder$2({label:oe,icon:ne=jsxRuntimeExports.jsx(WidgetsOutlined,{}),secondary:ce,...ue}){return jsxRuntimeExports.jsxs(Flex,{justifyContent:"center",alignItems:"center",color:"text.secondary",sx:{gap:2,p:6,pt:12,background:pe=>`repeating-linear-gradient( 45deg, ${pe.palette.background.default}, transparent 1px, @@ -982,7 +982,7 @@ void main() { `+ve+"]":"[ "+ye.join(", ")+" ]":"["+ye.join(",")+"]",gap=ve,me}if(rep&&typeof rep=="object")for(ge=rep.length,ue=0;uece?`{ `+gap+ye.join(`, `+gap)+` -`+ve+"}":"{ "+ye.join(", ")+" }":"{"+ye.join(",")+"}",gap=ve,me}}function beautify(oe,ne,ce,ue){var pe;if(gap="",indent="",ue||(ue=0),typeof ue!="number")throw new Error("beaufifier: limit must be a number");if(typeof ce=="number")for(pe=0;pe+pe);return ue<-2||ue>4?jsxRuntimeExports.jsxs("span",{children:[ce,"x10",jsxRuntimeExports.jsx("sup",{style:supProps,children:ue})]}):lodashExports$1.round(oe,2)}else return oe;case"string":return`${oe}`;case"undefined":return"null";default:return ne?jsxRuntimeExports.jsx("code",{children:lodashExports$1.isNull(oe)?"null":lodashExports$1.get(oe,"constructor.name")??typeof oe}):jsxRuntimeExports.jsx("code",{style:{whiteSpace:"pre"},children:lodashExports$1.truncate(beautify$1(oe,void 0,2),{length:100})})}}function Property(oe){const ne=compilerRuntimeExports.c(17),{label:ce,value:ue,type:pe,simple:me}=oe,ge=`${ce}::${renderProperty(ue)}`,ve=pe==null?void 0:pe.sx;let ye;ne[0]!==ve?(ye={opacity:.54,...ve},ne[0]=ve,ne[1]=ye):ye=ne[1];let xe;ne[2]!==pe||ne[3]!==ye||ne[4]!==ce?(xe=jsxRuntimeExports.jsx(Type$2,{component:"div",variant:"body2",...pe,sx:ye,children:ce}),ne[2]=pe,ne[3]=ye,ne[4]=ce,ne[5]=xe):xe=ne[5];let _e;ne[6]===Symbol.for("react.memo_cache_sentinel")?(_e=jsxRuntimeExports.jsx(Space,{}),ne[6]=_e):_e=ne[6];let we;ne[7]!==ue||ne[8]!==me?(we=renderProperty(ue,me)??"none",ne[7]=ue,ne[8]=me,ne[9]=we):we=ne[9];let $e;ne[10]!==pe||ne[11]!==we?($e=jsxRuntimeExports.jsx(Type$2,{component:"div",variant:"body2",...pe,children:we}),ne[10]=pe,ne[11]=we,ne[12]=$e):$e=ne[12];let Re;return ne[13]!==ge||ne[14]!==xe||ne[15]!==$e?(Re=jsxRuntimeExports.jsxs(Flex,{width:"auto",mr:2,mb:.5,alignItems:"baseline",children:[xe,_e,$e]},ge),ne[13]=ge,ne[14]=xe,ne[15]=$e,ne[16]=Re):Re=ne[16],Re}const COMMON_PROPS=["type"],OMIT_PROPS=[...COMMON_PROPS,"id"],ESSENTIAL_PROPS=["id"],GRAPH_PROPS=[...ESSENTIAL_PROPS,"pId"],HEURISTIC_PROPS=["f","g"],ALL_PROPS=[...OMIT_PROPS,...GRAPH_PROPS,...HEURISTIC_PROPS],sortEventKeys=oe=>lodashExports$1.chain(oe).entries().filter(([,ne])=>!lodashExports$1.isUndefined(ne)).sortBy(([ne])=>lodashExports$1.indexOf(ALL_PROPS,ne)+1||Number.MAX_SAFE_INTEGER).value();function PropertyDialog(oe){const ne=compilerRuntimeExports.c(19);let ce,ue,pe;if(ne[0]!==oe){const{event:_e,max:we,simple:$e,variant:Re,...Ae}=oe;ue=_e,ce=we,pe=Ae,ne[0]=oe,ne[1]=ce,ne[2]=ue,ne[3]=pe}else ce=ne[1],ue=ne[2],pe=ne[3];const me=ce===void 0?10:ce;let ge,ve,ye;if(ne[4]!==ue||ne[5]!==me||ne[6]!==pe){const _e=sortEventKeys(ue);ge=ManagedModal;let we;ne[10]===Symbol.for("react.memo_cache_sentinel")?(we=jsxRuntimeExports.jsx(AppBarTitle,{children:"Event Properties"}),ne[10]=we):we=ne[10],ve=lodashExports$1.merge({appBar:{children:we},trigger:ke=>jsxRuntimeExports.jsxs(MuiButton,{variant:"text",sx:{mx:-1,minWidth:0,width:"fit-content",color:Be=>Be.palette.text.secondary,justifyContent:"left"},onClick:Be=>{Be.stopPropagation(),Be.preventDefault(),ke(Be)},children:[_e.length-me," more"]})},pe);let $e;ne[11]===Symbol.for("react.memo_cache_sentinel")?($e=ke=>{const[Be]=ke;return COMMON_PROPS.includes(Be)},ne[11]=$e):$e=ne[11];let Re;ne[12]===Symbol.for("react.memo_cache_sentinel")?(Re=ke=>{const[Be]=ke;return GRAPH_PROPS.includes(Be)},ne[12]=Re):Re=ne[12];let Ae;ne[13]===Symbol.for("react.memo_cache_sentinel")?(Ae=ke=>{const[Be]=ke;return HEURISTIC_PROPS.includes(Be)},ne[13]=Ae):Ae=ne[13];let Ie;ne[14]===Symbol.for("react.memo_cache_sentinel")?(Ie=ke=>{const[Be]=ke;return!ALL_PROPS.includes(Be)},ne[14]=Ie):Ie=ne[14],ye=[{name:"common",props:lodashExports$1.filter(_e,$e)},{name:"Graph",props:lodashExports$1.filter(_e,Re)},{name:"Heuristic",props:lodashExports$1.filter(_e,Ae)},{name:"other",props:lodashExports$1.filter(_e,Ie)}].map((ke,Be)=>{const{name:Ne,props:Fe}=ke;return jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[!!Be&&jsxRuntimeExports.jsx(Divider$1,{sx:{mb:1}}),jsxRuntimeExports.jsx(Type$2,{component:"div",variant:"overline",color:"text.secondary",sx:{px:3},children:lodashExports$1.startCase(Ne)}),jsxRuntimeExports.jsx(Box$1,{sx:{p:1,pt:0,display:"grid",gridAutoFlow:"row",gridTemplateColumns:"repeat(2, 1fr)"},children:lodashExports$1.map(Fe,Ue=>{const[qe,We]=Ue;return jsxRuntimeExports.jsx(ListItem$1,{sx:{py:.5},children:jsxRuntimeExports.jsx(ListItemText$1,{secondary:qe,primary:renderProperty(We)})},`${qe}::${We}`)})},Ne)]},Ne)}),ne[4]=ue,ne[5]=me,ne[6]=pe,ne[7]=ge,ne[8]=ve,ne[9]=ye}else ge=ne[7],ve=ne[8],ye=ne[9];let xe;return ne[15]!==ge||ne[16]!==ve||ne[17]!==ye?(xe=jsxRuntimeExports.jsx(ge,{...ve,children:ye}),ne[15]=ge,ne[16]=ve,ne[17]=ye,ne[18]=xe):xe=ne[18],xe}function PropertyList(oe){const ne=compilerRuntimeExports.c(32);let ce,ue,pe,me,ge,ve;ne[0]!==oe?({event:pe,variant:ce,max:ue,simple:ve,primitives:ge,...me}=oe,ne[0]=oe,ne[1]=ce,ne[2]=ue,ne[3]=pe,ne[4]=me,ne[5]=ge,ne[6]=ve):(ce=ne[1],ue=ne[2],pe=ne[3],me=ne[4],ge=ne[5],ve=ne[6]);const ye=ce===void 0?"body2":ce,xe=ue===void 0?10:ue;let _e,we,$e,Re;if(ne[7]!==pe||ne[8]!==me||ne[9]!==ge||ne[10]!==xe||ne[11]!==ye||ne[12]!==ve){_e=sortEventKeys(pe),we=Flex,$e=me;let ke;ne[17]!==ge?(ke=ge?Ne=>{const[,Fe]=Ne;return isPrimitive(Fe)}:lodashExports$1.constant(!0),ne[17]=ge,ne[18]=ke):ke=ne[18];let Be;ne[19]!==ye||ne[20]!==ve?(Be=(Ne,Fe)=>{const[Ue,qe]=Ne;return jsxRuntimeExports.jsx(Property,{label:Ue,value:qe,type:{variant:ye},simple:ve},Fe)},ne[19]=ye,ne[20]=ve,ne[21]=Be):Be=ne[21],Re=lodashExports$1.chain(_e).filter(ke).slice(0,xe).map(Be).value(),ne[7]=pe,ne[8]=me,ne[9]=ge,ne[10]=xe,ne[11]=ye,ne[12]=ve,ne[13]=_e,ne[14]=we,ne[15]=$e,ne[16]=Re}else _e=ne[13],we=ne[14],$e=ne[15],Re=ne[16];let Ae;ne[22]!==_e.length||ne[23]!==xe||ne[24]!==ve||ne[25]!==oe?(Ae=_e.length>xe&&!ve&&jsxRuntimeExports.jsx(PropertyDialog,{...oe}),ne[22]=_e.length,ne[23]=xe,ne[24]=ve,ne[25]=oe,ne[26]=Ae):Ae=ne[26];let Ie;return ne[27]!==we||ne[28]!==$e||ne[29]!==Re||ne[30]!==Ae?(Ie=jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs(we,{...$e,children:[Re,Ae]})}),ne[27]=we,ne[28]=$e,ne[29]=Re,ne[30]=Ae,ne[31]=Ie):Ie=ne[31],Ie}function isPrimitive(oe){return lodashExports$1.isString(oe)||lodashExports$1.isNumber(oe)}var t$2,e$2,s$2,i$5;(function(oe){oe.HEX="HEX",oe.RGB="RGB",oe.HSL="HSL",oe.CIELab="CIELab",oe.CMYK="CMYK"})(t$2||(t$2={})),function(oe){oe.ANALOGOUS="ANALOGOUS",oe.COMPLEMENTARY="COMPLEMENTARY",oe.SPLIT_COMPLEMENTARY="SPLIT_COMPLEMENTARY",oe.TRIADIC="TRIADIC",oe.TETRADIC="TETRADIC",oe.SQUARE="SQUARE"}(e$2||(e$2={})),function(oe){oe.ADDITIVE="ADDITIVE",oe.SUBTRACTIVE="SUBTRACTIVE"}(s$2||(s$2={})),function(oe){oe.black="#000000",oe.silver="#C0C0C0",oe.gray="#808080",oe.white="#FFFFFF",oe.maroon="#800000",oe.red="#FF0000",oe.purple="#800080",oe.fuchsia="#FF00FF",oe.green="#008000",oe.lime="#00FF00",oe.olive="#808000",oe.yellow="#FFFF00",oe.navy="#000080",oe.blue="#0000FF",oe.teal="#008080",oe.aqua="#00FFFF",oe.orange="#FFA500",oe.aliceblue="#F0F8FF",oe.antiquewhite="#FAEBD7",oe.aquamarine="#7FFFD4",oe.azure="#F0FFFF",oe.beige="#F5F5DC",oe.bisque="#FFE4C4",oe.blanchedalmond="#FFEBCD",oe.blueviolet="#8A2BE2",oe.brown="#A52A2A",oe.burlywood="#DEB887",oe.cadetblue="#5F9EA0",oe.chartreuse="#7FFF00",oe.chocolate="#D2691E",oe.coral="#FF7F50",oe.cornflowerblue="#6495ED",oe.cornsilk="#FFF8DC",oe.crimson="#DC143C",oe.cyan="#00FFFF",oe.darkblue="#00008B",oe.darkcyan="#008B8B",oe.darkgoldenrod="#B8860B",oe.darkgray="#A9A9A9",oe.darkgreen="#006400",oe.darkgrey="#A9A9A9",oe.darkkhaki="#BDB76B",oe.darkmagenta="#8B008B",oe.darkolivegreen="#556B2F",oe.darkorange="#FF8C00",oe.darkorchid="#9932CC",oe.darkred="#8B0000",oe.darksalmon="#E9967A",oe.darkseagreen="#8FBC8F",oe.darkslateblue="#483D8B",oe.darkslategray="#2F4F4F",oe.darkslategrey="#2F4F4F",oe.darkturquoise="#00CED1",oe.darkviolet="#9400D3",oe.deeppink="#FF1493",oe.deepskyblue="#00BFFF",oe.dimgray="#696969",oe.dimgrey="#696969",oe.dodgerblue="#1E90FF",oe.firebrick="#B22222",oe.floralwhite="#FFFAF0",oe.forestgreen="#228B22",oe.gainsboro="#DCDCDC",oe.ghostwhite="#F8F8FF",oe.gold="#FFD700",oe.goldenrod="#DAA520",oe.greenyellow="#ADFF2F",oe.grey="#808080",oe.honeydew="#F0FFF0",oe.hotpink="#FF69B4",oe.indianred="#CD5C5C",oe.indigo="#4B0082",oe.ivory="#FFFFF0",oe.khaki="#F0E68C",oe.lavender="#E6E6FA",oe.lavenderblush="#FFF0F5",oe.lawngreen="#7CFC00",oe.lemonchiffon="#FFFACD",oe.lightblue="#ADD8E6",oe.lightcoral="#F08080",oe.lightcyan="#E0FFFF",oe.lightgoldenrodyellow="#FAFAD2",oe.lightgray="#D3D3D3",oe.lightgreen="#90EE90",oe.lightgrey="#D3D3D3",oe.lightpink="#FFB6C1",oe.lightsalmon="#FFA07A",oe.lightseagreen="#20B2AA",oe.lightskyblue="#87CEFA",oe.lightslategray="#778899",oe.lightslategrey="#778899",oe.lightsteelblue="#B0C4DE",oe.lightyellow="#FFFFE0",oe.limegreen="#32CD32",oe.linen="#FAF0E6",oe.magenta="#FF00FF",oe.mediumaquamarine="#66CDAA",oe.mediumblue="#0000CD",oe.mediumorchid="#BA55D3",oe.mediumpurple="#9370DB",oe.mediumseagreen="#3CB371",oe.mediumslateblue="#7B68EE",oe.mediumspringgreen="#00FA9A",oe.mediumturquoise="#48D1CC",oe.mediumvioletred="#C71585",oe.midnightblue="#191970",oe.mintcream="#F5FFFA",oe.mistyrose="#FFE4E1",oe.moccasin="#FFE4B5",oe.navajowhite="#FFDEAD",oe.oldlace="#FDF5E6",oe.olivedrab="#6B8E23",oe.orangered="#FF4500",oe.orchid="#DA70D6",oe.palegoldenrod="#EEE8AA",oe.palegreen="#98FB98",oe.paleturquoise="#AFEEEE",oe.palevioletred="#DB7093",oe.papayawhip="#FFEFD5",oe.peachpuff="#FFDAB9",oe.peru="#CD853F",oe.pink="#FFC0CB",oe.plum="#DDA0DD",oe.powderblue="#B0E0E6",oe.rosybrown="#BC8F8F",oe.royalblue="#4169E1",oe.saddlebrown="#8B4513",oe.salmon="#FA8072",oe.sandybrown="#F4A460",oe.seagreen="#2E8B57",oe.seashell="#FFF5EE",oe.sienna="#A0522D",oe.skyblue="#87CEEB",oe.slateblue="#6A5ACD",oe.slategray="#708090",oe.slategrey="#708090",oe.snow="#FFFAFA",oe.springgreen="#00FF7F",oe.steelblue="#4682B4",oe.tan="#D2B48C",oe.thistle="#D8BFD8",oe.tomato="#FF6347",oe.turquoise="#40E0D0",oe.violet="#EE82EE",oe.wheat="#F5DEB3",oe.whitesmoke="#F5F5F5",oe.yellowgreen="#9ACD32",oe.rebeccapurple="#663399"}(i$5||(i$5={}));const a$3=Object.keys(i$5),r$2={HEX:["R","G","B","A"],RGB:["R","G","B","A"],HSL:["H","S","L","A"],CIELab:["L","a","b","A"],CMYK:["C","M","Y","K","A"]},n$2={BGR:t$2.RGB,ABGR:t$2.RGB,HLS:t$2.HSL,AHLS:t$2.HSL,LAB:t$2.CIELab,ALAB:t$2.CIELab,CKMY:t$2.CMYK,ACKMY:t$2.CMYK};var c$2;(function(oe){oe.NUMBER="number",oe.BOOLEAN="boolean"})(c$2||(c$2={}));const o$3={[t$2.HEX]:/^#(?:([a-f\d])([a-f\d])([a-f\d])([a-f\d])?|([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?)$/i,[t$2.RGB]:/^rgba?\s*\(\s*(?:((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)(?:\s*,\s*((?:\d*\.)?\d+))?|((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)(?:\s*\/\s*((?:\d*\.)?\d+%?))?)\s*\)$/,[t$2.HSL]:/^hsla?\s*\(\s*(?:(-?(?:\d*\.)?\d+(?:deg|grad|rad|turn)?)\s*,\s*((?:\d*\.)?\d+)%\s*,\s*((?:\d*\.)?\d+)%(?:\s*,\s*((?:\d*\.)?\d+))?|(-?(?:\d*\.)?\d+(?:deg|grad|rad|turn)?)\s*((?:\d*\.)?\d+)%\s*((?:\d*\.)?\d+)%(?:\s*\/\s*((?:\d*\.)?\d+%?))?)\s*\)$/,[t$2.CIELab]:/^lab\s*\(\s*(?:((?:\d*\.)?\d+%?)\s*(-?(?:\d*\.)?\d+%?)\s*(-?(?:\d*\.)?\d+%?)(?:\s*\/\s*((?:\d*\.)?\d+%?))?)\s*\)$/,[t$2.CMYK]:/^(?:device-cmyk|cmyk)\s*\(\s*(?:((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)(?:\s*,\s*((?:\d*\.)?\d+))?|((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)(?:\s*\/\s*((?:\d*\.)?\d+%?))?)\s*\)$/},A$3=/^(-?(?:\d*\.)?\d+)((?:deg|grad|rad|turn)?)$/,h$2=/^(-?\d+(?:\.\d+)?|-?\.\d+)%$/,u$2=/^0x([a-f\d]{1,2})$/i,d$4=/\{(\d+)\}/g,l$2=/,( +|\d+)/g,E$2=/ +/,m$2="The provided string color doesn't have a correct format",b$3="The provided color object doesn't have the proper keys or format";var C$2,L$2,g$3;(function(oe){oe.NONE="none",oe.DEGREES="deg",oe.GRADIANS="grad",oe.RADIANS="rad",oe.TURNS="turn"})(C$2||(C$2={})),function(oe){oe.NONE="none",oe.PERCENT="percent"}(L$2||(L$2={})),function(oe){oe.DEVICE_CMYK="device-cmyk",oe.CMYK="cmyk"}(g$3||(g$3={}));const B$2={decimals:6,legacyCSS:!1,spacesAfterCommas:!1,anglesUnit:C$2.NONE,rgbUnit:L$2.NONE,labUnit:L$2.NONE,cmykUnit:L$2.PERCENT,alphaUnit:L$2.NONE,cmykFunction:g$3.DEVICE_CMYK},p$2=(oe,ne)=>Object.prototype.hasOwnProperty.call(oe,ne),H$3=oe=>+`${oe}`.replace(h$2,"$1"),F$2=oe=>h$2.test(`${oe}`)?H$3(oe):Math.min(+oe,100),R$2=oe=>(oe.length===1&&(oe+=oe),parseInt(oe,16)),S$3=oe=>{const ne=D$2(oe,0).toString(16).toUpperCase();return ne.length===1?`0x0${ne}`:`0x${ne}`},I$2=(oe,ne=!1)=>!ne&&h$2.test(oe)?Math.min(255*H$3(oe)/100,255):u$2.test(oe)?(oe.length===3&&(oe+=oe.slice(-1)),ne?D$2(oe)/255:D$2(oe)):Math.min(+oe,ne?1:255),G$2=oe=>h$2.test(oe)?f$3(125*H$3(oe)/100,-125,125):f$3(+oe,-125,125),M$3=oe=>Math.min(h$2.test(oe)?H$3(oe)/100:+oe,1),y$2=oe=>[...oe].sort().join("").toUpperCase(),D$2=(oe,ne=6)=>{const ce=Math.pow(10,ne);return Math.round(+oe*ce)/ce},f$3=(oe,ne,ce)=>Math.max(ne,Math.min(oe,ce)),O$1=oe=>{if(typeof oe=="string"){const ne=oe.match(A$3),ce=+ne[1];switch(ne[2]){case C$2.RADIANS:oe=D$2(180*ce/Math.PI);break;case C$2.TURNS:oe=D$2(360*ce);break;case C$2.GRADIANS:oe=D$2(.9*ce);break;case C$2.DEGREES:default:oe=ce}}return(oe>360||oe<0)&&(oe-=360*Math.floor(oe/360)),oe},Y$2=(oe,ne)=>{let ce;switch(ne){case C$2.RADIANS:ce=D$2((ue=>ue*Math.PI/180)(oe));break;case C$2.TURNS:ce=D$2(oe/360);break;case C$2.GRADIANS:ce=D$2(10/9*oe);break;case C$2.DEGREES:case C$2.NONE:default:ce=oe}return ce},k$3=(oe,...ne)=>{const ce=[],ue=[],pe=[],me=[],ge=[],ve=[],ye=Object.values(C$2),xe=Object.values(L$2),_e=Object.values(g$3),we={legacyCSS:0,spacesAfterCommas:0,cmykFunction:0};for(const $e of ne)if(typeof $e=="string"){if(ce.push($e),$e.includes(",")){we.legacyCSS++;const Re=$e.match(l$2);new Set(Re).size===1&&E$2.test(Re[0].slice(1))&&we.spacesAfterCommas++}if($e.match(o$3.HSL)){const Re=$e.match(o$3.HSL),Ae=Re[1]||Re[5],Ie=Re[8],ke=Ae.match(A$3)[2];ue.push(ke===""?C$2.NONE:ke),ve.push(h$2.test(Ie));continue}if(o$3.RGB.test($e)){const Re=$e.match(o$3.RGB),Ae=Re[1]||Re[5],Ie=Re[2]||Re[6],ke=Re[3]||Re[7],Be=Re[8];pe.push(h$2.test(Ae)&&h$2.test(Ie)&&h$2.test(ke)),ve.push(h$2.test(Be));continue}if(o$3.CIELab.test($e)){const Re=$e.match(o$3.CIELab),Ae=Re[1],Ie=Re[2],ke=Re[3],Be=Re[4];me.push(h$2.test(Ae)&&h$2.test(Ie)&&h$2.test(ke)),ve.push(h$2.test(Be));continue}if($e.match(o$3.CMYK)){const Re=$e.match(o$3.CMYK),Ae=Re[1]||Re[6],Ie=Re[2]||Re[7],ke=Re[3]||Re[8],Be=Re[4]||Re[9],Ne=Re[10];ge.push(h$2.test(Ae)&&h$2.test(Ie)&&h$2.test(ke)&&h$2.test(Be)),$e.startsWith("cmyk")&&we.cmykFunction++,ve.push(h$2.test(Ne))}}return{decimals:typeof oe.decimals===c$2.NUMBER?oe.decimals:B$2.decimals,legacyCSS:typeof oe.legacyCSS===c$2.BOOLEAN?oe.legacyCSS:!!(ce.length&&we.legacyCSS===ce.length)||B$2.legacyCSS,spacesAfterCommas:typeof oe.spacesAfterCommas===c$2.BOOLEAN?oe.spacesAfterCommas:!!(ce.length&&we.spacesAfterCommas===ce.length)||B$2.spacesAfterCommas,anglesUnit:oe.anglesUnit&&ye.includes(oe.anglesUnit)?oe.anglesUnit:new Set(ue).size===1?ue[0]:B$2.anglesUnit,rgbUnit:oe.rgbUnit&&xe.includes(oe.rgbUnit)?oe.rgbUnit:new Set(pe).size===1&&pe[0]?L$2.PERCENT:B$2.rgbUnit,labUnit:oe.labUnit&&xe.includes(oe.labUnit)?oe.labUnit:new Set(me).size===1&&me[0]?L$2.PERCENT:B$2.labUnit,cmykUnit:oe.cmykUnit&&xe.includes(oe.cmykUnit)?oe.cmykUnit:new Set(ge).size!==1||ge[0]?B$2.cmykUnit:L$2.NONE,alphaUnit:oe.alphaUnit&&xe.includes(oe.alphaUnit)?oe.alphaUnit:new Set(ve).size===1&&ve[0]?L$2.PERCENT:B$2.alphaUnit,cmykFunction:oe.cmykFunction&&_e.includes(oe.cmykFunction)?oe.cmykFunction:ge.length&&ge.length===we.cmykFunction?g$3.CMYK:B$2.cmykFunction}},K$2=oe=>`${oe}`in s$2,X$2=[[.4360747,.3850649,.1430804],[.2225045,.7168786,.0606169],[.0139322,.0971045,.7141733]],T$2=[[3.1338561,-1.6168667,-.4906146],[-.9787684,1.9161415,.033454],[.0719453,-.2289914,1.4052427]],N$3=X$2.map(oe=>oe.reduce((ne,ce)=>ne+ce,0)),$$3=(oe,ne,ce)=>(ce<0&&(ce+=6),ce>=6&&(ce-=6),D$2(ce<1?255*((ne-oe)*ce+oe):ce<3?255*ne:ce<4?255*((ne-oe)*(4-ce)+oe):255*oe)),j$3=oe=>oe<=.04045?oe/12.92:((oe+.055)/1.055)**2.4,U$2=oe=>oe<=.0031308?12.92*oe:1.055*oe**(1/2.4)-.055,w$3=(oe,ne,ce,ue)=>{const pe=[0,0,0],me=[oe,ne,ce];return ue.forEach((ge,ve)=>{ge.forEach((ye,xe)=>{pe[ve]+=ye*me[xe]})}),pe},x$2=(oe,ne,ce)=>{ne/=100;const ue=(ce/=100)<=.5?ce*(ne+1):ce+ne-ce*ne,pe=2*ce-ue;return{R:$$3(pe,ue,(oe/=60)+2),G:$$3(pe,ue,oe),B:$$3(pe,ue,oe-2)}},v$2=(oe,ne,ce,ue=1)=>{oe/=255,ne/=255,ce/=255,ue=Math.min(ue,1);const pe=Math.max(oe,ne,ce),me=Math.min(oe,ne,ce),ge=pe-me;let ve=0,ye=0;const xe=(pe+me)/2;if(ge!==0){switch(pe){case oe:ve=(ne-ce)/ge%6;break;case ne:ve=(ce-oe)/ge+2;break;case ce:ve=(oe-ne)/ge+4}ve=D$2(60*ve),ve<0&&(ve+=360),ye=ge/(1-Math.abs(2*xe-1))}return{H:ve,S:D$2(100*ye),L:D$2(100*xe),A:ue}},V$2=(oe,ne,ce)=>{const ue=[oe/255,ne/255,ce/255].map(j$3),pe=w$3(ue[0],ue[1],ue[2],X$2),me=((ge,ve,ye)=>{const xe=$e=>$e>.008856451679035631?Math.cbrt($e):$e/.12841854934601665+.13793103448275862,_e=xe(ge/N$3[0]),we=xe(ve/N$3[1]);return[116*we-16,500*(_e-we),200*(we-xe(ye/N$3[2]))]})(pe[0],pe[1],pe[2]);return{L:me[0],a:me[1],b:me[2]}},P$1=(oe,ne,ce)=>{const ue=((me,ge,ve)=>{const ye=$e=>$e>.20689655172413793?$e**3:.12841854934601665*($e-.13793103448275862),xe=(me+16)/116,_e=ge/500,we=ve/200;return[N$3[0]*ye(xe+_e),N$3[1]*ye(xe),N$3[2]*ye(xe-we)]})(oe,ne,ce),pe=w$3(ue[0],ue[1],ue[2],T$2).map(U$2);return{R:f$3(255*pe[0],0,255),G:f$3(255*pe[1],0,255),B:f$3(255*pe[2],0,255)}},q$2=(oe,ne,ce,ue)=>({R:D$2(255*(1-oe)*(ue=1-ue)),G:D$2(255*(1-ne)*ue),B:D$2(255*(1-ce)*ue)}),_$2=(oe,ne,ce)=>{oe/=255,ne/=255,ce/=255;const ue=1-Math.max(oe,ne,ce),pe=1-ue,me=pe&&(pe-ne)/pe,ge=pe&&(pe-ce)/pe;return{C:D$2(100*(pe&&(pe-oe)/pe)),M:D$2(100*me),Y:D$2(100*ge),K:D$2(100*ue)}},z$3=(oe,ne)=>{if(oe<0&&(oe+=360),oe>360&&(oe-=360),oe===360||oe===0)return oe;const ce=[[0,120],[120,180],[180,240],[240,360]],ue=[[0,60],[60,120],[120,240],[240,360]],pe=ne?ue:ce;let me=0,ge=0,ve=0,ye=0;return(ne?ce:ue).find((xe,_e)=>oe>=xe[0]&&oeoe?", ":",",W$2=(oe,ne)=>{const ce=y$2(Object.keys(oe));return r$2[n$2[ce]].reduce((ue,pe,me)=>{const ge=oe[pe];return ge!==void 0&&ue.push(ne(ge,me)),ue},[])},J$2=(oe,ne)=>oe.replace(d$4,(ce,ue)=>`${ne[+ue-1]}`),Z$2=(oe,ne,ce=!1)=>{const{alphaUnit:ue,legacyCSS:pe,decimals:me}=ne;return ue!==L$2.PERCENT||pe&&!ce?D$2(oe,me):`${D$2(100*oe,me)}%`},tt$2={[t$2.HEX]:oe=>{const ne=W$2(oe,ue=>(pe=>{let me=D$2(pe,0).toString(16).toUpperCase();return me.length===1&&(me=`0${me}`),me})(D$2(ue))),ce=ne.length===4?"#{1}{2}{3}{4}":"#{1}{2}{3}";return J$2(ce,ne)},[t$2.RGB]:(oe,ne)=>{const{decimals:ce,legacyCSS:ue,spacesAfterCommas:pe,rgbUnit:me}=ne,ge=Q$2(pe),ve=W$2(oe,(xe,_e)=>me===L$2.PERCENT&&_e<3?`${((we,$e)=>D$2(we/255*100,$e))(xe,ce)}%`:_e===3?Z$2(xe,ne):D$2(xe,ce)),ye=ue?ve.length===4?`rgba({1}${ge}{2}${ge}{3}${ge}{4})`:`rgb({1}${ge}{2}${ge}{3})`:ve.length===4?"rgb({1} {2} {3} / {4})":"rgb({1} {2} {3})";return J$2(ye,ve)},[t$2.HSL]:(oe,ne)=>{const{decimals:ce,legacyCSS:ue,spacesAfterCommas:pe,anglesUnit:me}=ne,ge=Q$2(pe),ve=W$2(oe,(xe,_e)=>_e===0&&me!==C$2.NONE?`${D$2(Y$2(xe,me),ce)}${me}`:_e===3?Z$2(xe,ne):D$2(xe,ce)),ye=ue?ve.length===4?`hsla({1}${ge}{2}%${ge}{3}%${ge}{4})`:`hsl({1}${ge}{2}%${ge}{3}%)`:ve.length===4?"hsl({1} {2}% {3}% / {4})":"hsl({1} {2}% {3}%)";return J$2(ye,ve)},[t$2.CIELab]:(oe,ne)=>{const{decimals:ce,labUnit:ue}=ne,pe=W$2(oe,(ge,ve)=>{if(ve===0){const ye=D$2(F$2(ge),ce);return ue===L$2.PERCENT?`${ye}%`:`${ye}`}return ve<3?ue===L$2.PERCENT?`${((ye,xe)=>D$2(ye/125*100,xe))(ge,ce)}%`:D$2(ge,ce):Z$2(ge,ne,!0)}),me=pe.length===4?"lab({1} {2} {3} / {4})":"lab({1} {2} {3})";return J$2(me,pe)},[t$2.CMYK]:(oe,ne)=>{const{decimals:ce,legacyCSS:ue,spacesAfterCommas:pe,cmykUnit:me,cmykFunction:ge}=ne,ve=Q$2(pe),ye=W$2(oe,(_e,we)=>me===L$2.PERCENT&&we<4?`${D$2(_e,ce)}%`:we===4?Z$2(_e,ne):D$2(_e/100,ce)),xe=ue?ye.length===5?`${ge}({1}${ve}{2}${ve}{3}${ve}{4}${ve}{5})`:`${ge}({1}${ve}{2}${ve}{3}${ve}{4})`:ye.length===5?`${ge}({1} {2} {3} {4} / {5})`:`${ge}({1} {2} {3} {4})`;return J$2(xe,ye)}},et$2=oe=>(typeof oe=="string"&&(oe=h$2.test(oe)?H$3(oe)/100:+oe),isNaN(+oe)||oe>1?1:D$2(oe)),st$1=(oe,ne,ce)=>ne.reduce((ue,pe)=>[...ue,{...oe,H:ce===s$2.ADDITIVE?O$1(oe.H+pe):O$1(z$3(z$3(oe.H,!1)+pe,!0))}],[{...oe}]),it$1=(oe,ne)=>st$1(oe,[30,-30],ne),at$1=(oe,ne)=>st$1(oe,[180],ne),rt$1=(oe,ne)=>st$1(oe,[150,-150],ne),nt$1=(oe,ne)=>st$1(oe,[120,-120],ne),ct$1=(oe,ne)=>st$1(oe,[60,-120,180],ne),ot$1=(oe,ne)=>st$1(oe,[90,-90,180],ne),At=oe=>typeof oe=="string"?(ne=>{let ce;if(Object.keys(t$2).some(ue=>{if(o$3[ue].test(ne))return ce=ue,!0}),!ce&&~a$3.indexOf(ne)&&(ce=t$2.HEX),!ce)throw new Error(m$2);return ce})(oe):(ne=>{let ce,ue=!1;const pe=y$2(Object.keys(ne));if(n$2[pe]&&(ce=n$2[pe]),ce&&ce===t$2.RGB){const me=Object.entries(ne).some(ve=>!u$2.test(`${ve[1]}`)),ge=Object.entries(ne).some(ve=>!(h$2.test(`${ve[1]}`)||!u$2.test(`${ve[1]}`)&&!isNaN(+ve[1])&&+ve[1]<=255));me&&ge&&(ue=!0),me||(ce=t$2.HEX)}if(!ce||ue)throw new Error(b$3);return ce})(oe),ht$1={[t$2.HEX](oe){const ne=(~a$3.indexOf(oe)?i$5[oe]:oe).match(o$3.HEX),ce={R:R$2(ne[1]||ne[5]),G:R$2(ne[2]||ne[6]),B:R$2(ne[3]||ne[7])},ue=ne[4]||ne[8];return ue!==void 0&&(ce.A=R$2(ue)/255),ce},[t$2.RGB](oe){const ne=oe.match(o$3.RGB),ce=I$2(ne[1]||ne[5]),ue=I$2(ne[2]||ne[6]),pe=I$2(ne[3]||ne[7]),me=ne[4]||ne[8],ge={R:Math.min(ce,255),G:Math.min(ue,255),B:Math.min(pe,255)};return me!==void 0&&(ge.A=et$2(me)),ge},[t$2.HSL](oe){const ne=oe.match(o$3.HSL),ce=O$1(ne[1]||ne[5]),ue=F$2(ne[2]||ne[6]),pe=F$2(ne[3]||ne[7]),me=ne[4]||ne[8],ge=x$2(ce,ue,pe);return me!==void 0&&(ge.A=et$2(me)),ge},[t$2.CIELab](oe){const ne=oe.match(o$3.CIELab),ce=F$2(ne[1]),ue=G$2(ne[2]),pe=G$2(ne[3]),me=ne[4],ge=P$1(ce,ue,pe);return me!==void 0&&(ge.A=et$2(me)),ge},[t$2.CMYK](oe){const ne=oe.match(o$3.CMYK),ce=M$3(ne[1]||ne[6]),ue=M$3(ne[2]||ne[7]),pe=M$3(ne[3]||ne[8]),me=M$3(ne[4]||ne[9]),ge=ne[5]||ne[10],ve=q$2(ce,ue,pe,me);return ge!==void 0&&(ve.A=et$2(ge)),ve}},ut$1={[t$2.HEX](oe){const ne={R:I$2(`${oe.R}`),G:I$2(`${oe.G}`),B:I$2(`${oe.B}`)};return p$2(oe,"A")&&(ne.A=Math.min(I$2(`${oe.A}`,!0),1)),ne},[t$2.RGB](oe){return this.HEX(oe)},[t$2.HSL](oe){const ne=F$2(`${oe.S}`),ce=F$2(`${oe.L}`),ue=x$2(O$1(oe.H),ne,ce);return p$2(oe,"A")&&(ue.A=et$2(oe.A)),ue},[t$2.CIELab](oe){const ne=F$2(`${oe.L}`),ce=G$2(`${oe.a}`),ue=G$2(`${oe.b}`),pe=P$1(ne,ce,ue);return p$2(oe,"A")&&(pe.A=et$2(oe.A)),pe},[t$2.CMYK](oe){const ne=M$3(`${oe.C}`),ce=M$3(`${oe.M}`),ue=M$3(`${oe.Y}`),pe=M$3(`${oe.K}`),me=q$2(ne,ce,ue,pe);return p$2(oe,"A")&&(me.A=et$2(oe.A)),me}},dt$1=(oe,ne=At(oe))=>typeof oe=="string"?ht$1[ne](oe):ut$1[ne](oe),lt={[t$2.HEX]:oe=>({R:S$3(oe.R),G:S$3(oe.G),B:S$3(oe.B)}),HEXA(oe){const ne=lt.HEX(oe);return ne.A=p$2(oe,"A")?S$3(255*oe.A):"0xFF",ne},[t$2.RGB](oe,ne){const ce=Ct(oe,ne);return p$2(ce,"A")&&delete ce.A,ce},RGBA(oe,ne){const ce=lt.RGB(oe,ne);return ce.A=p$2(oe,"A")?D$2(oe.A):1,ce},[t$2.HSL](oe,ne){const ce=v$2(oe.R,oe.G,oe.B);return delete ce.A,Lt(ce,ne)},HSLA(oe,ne){const ce=lt.HSL(oe,ne);return ce.A=p$2(oe,"A")?D$2(oe.A,ne):1,ce},[t$2.CIELab](oe,ne){const ce=V$2(oe.R,oe.G,oe.B);return gt(ce,ne)},CIELabA(oe,ne){const ce=lt.CIELab(oe,ne);return ce.A=p$2(oe,"A")?D$2(oe.A,ne):1,ce},[t$2.CMYK]:(oe,ne)=>Bt(_$2(oe.R,oe.G,oe.B),ne),CMYKA(oe,ne){const ce=lt.CMYK(oe,ne);return ce.A=p$2(oe,"A")?D$2(oe.A,ne):1,ce}},Et=(oe,ne,ce,ue)=>{const pe=At(oe),me=typeof oe=="string",ge=dt$1(oe,pe),ve=typeof oe=="string"&&p$2(ge,"A")||typeof oe!="string"&&p$2(oe,"A"),ye=v$2(ge.R,ge.G,ge.B,ge.A);ve||delete ye.A;const xe=ce?ye.L/(ne+1):(100-ye.L)/(ne+1),_e=Array(ne).fill(null).map((we,$e)=>({...ye,L:ye.L+xe*($e+1)*(1-2*+ce)}));switch(pe){case t$2.HEX:default:return _e.map(we=>{const $e=x$2(we.H,we.S,we.L);return ve&&($e.A=we.A),me?ve?tt$2.HEX({...$e,A:D$2(255*$e.A)}):tt$2.HEX($e):ve?lt.HEXA($e):lt.HEX($e)});case t$2.RGB:return _e.map(we=>{const $e=x$2(we.H,we.S,we.L);return ve&&($e.A=we.A),me?tt$2.RGB($e,ue):ve?lt.RGBA($e,ue.decimals):lt.RGB($e,ue.decimals)});case t$2.HSL:return _e.map(we=>me?tt$2.HSL(we,ue):ve?lt.HSLA({...x$2(we.H,we.S,we.L),A:we.A},ue.decimals):lt.HSL(x$2(we.H,we.S,we.L),ue.decimals));case t$2.CIELab:return _e.map(we=>{const $e=x$2(we.H,we.S,we.L);return me?tt$2.CIELab(ve?lt.CIELabA($e,ue.decimals):lt.CIELab($e,ue.decimals),ue):ve?lt.CIELabA({...$e,A:we.A},ue.decimals):lt.CIELab($e,ue.decimals)})}},mt={buildHarmony(oe,ne,ce,ue){const pe=At(oe),me=dt$1(oe,pe),ge=v$2(me.R,me.G,me.B,me.A),ve=typeof oe=="string"&&p$2(me,"A")||typeof oe!="string"&&p$2(oe,"A"),ye=typeof oe=="string";switch(pe){case t$2.HEX:default:return ve?this.HEXA(Lt(ge,0),ne,ce,ye):this.HEX(Lt(ge,0),ne,ce,ye);case t$2.HSL:return ve?this.HSLA(ge,ne,ce,ye,ue):this.HSL(ge,ne,ce,ye,ue);case t$2.RGB:return ve?this.RGBA(ge,ne,ce,ye,ue):this.RGB(ge,ne,ce,ye,ue);case t$2.CIELab:return ve?this.CIELabA(ge,ne,ce,ye,ue):this.CIELab(ge,ne,ce,ye,ue)}},[t$2.HEX]:(oe,ne,ce,ue)=>ne(oe,ce).map(pe=>ue?tt$2.HEX(x$2(pe.H,pe.S,pe.L)):lt.HEX(x$2(pe.H,pe.S,pe.L))),HEXA:(oe,ne,ce,ue)=>ne(oe,ce).map(pe=>ue?tt$2.HEX({...x$2(pe.H,pe.S,pe.L),A:255*et$2(pe.A)}):lt.HEXA({...x$2(pe.H,pe.S,pe.L),A:et$2(pe.A)})),[t$2.RGB]:(oe,ne,ce,ue,pe)=>ne(oe,ce).map(me=>ue?tt$2.RGB(x$2(me.H,me.S,me.L),pe):lt.RGB(x$2(me.H,me.S,me.L),pe.decimals)),RGBA:(oe,ne,ce,ue,pe)=>ne(oe,ce).map(me=>ue?tt$2.RGB({...x$2(me.H,me.S,me.L),A:et$2(me.A)},pe):lt.RGBA({...x$2(me.H,me.S,me.L),A:et$2(me.A)},pe.decimals)),[t$2.HSL]:(oe,ne,ce,ue,pe)=>ne(oe,ce).map(me=>ue?tt$2.HSL({H:me.H,S:me.S,L:me.L},pe):lt.HSL(x$2(me.H,me.S,me.L),pe.decimals)),HSLA:(oe,ne,ce,ue,pe)=>ne(oe,ce).map(me=>ue?tt$2.HSL({...me,A:et$2(me.A)},pe):lt.HSLA({...x$2(me.H,me.S,me.L),A:et$2(me.A)},pe.decimals)),[t$2.CIELab]:(oe,ne,ce,ue,pe)=>ne(oe,ce).map(me=>{const ge=x$2(me.H,me.S,me.L);return ue?tt$2.CIELab(V$2(ge.R,ge.G,ge.B),pe):lt.CIELab(ge,pe.decimals)}),CIELabA:(oe,ne,ce,ue,pe)=>ne(oe,ce).map(me=>{const ge=x$2(me.H,me.S,me.L);return ue?tt$2.CIELab({...V$2(ge.R,ge.G,ge.B),A:et$2(me.A)},pe):lt.CIELabA({...ge,A:et$2(me.A)},pe.decimals)})},bt={mix(oe,ne){const ce=oe.map(ge=>{const ve=At(ge);return dt$1(ge,ve)}),ue=ne===s$2.SUBTRACTIVE?ce.map(ge=>{const ve=((ye,xe,_e)=>{const we=Math.min(ye,xe,_e),$e=Math.min(255-ye,255-xe,255-_e),Re=ye-we,Ae=xe-we,Ie=_e-we,ke=Math.min(Re,Ae),Be=Re-ke,Ne=(Ae+ke)/2,Fe=(Ie+Ae-ke)/2,Ue=Math.max(Be,Ne,Fe)/Math.max(Re,Ae,Ie),qe=isNaN(Ue)||Ue===1/0||Ue<=0?1:Ue;return{R:Be/qe+$e,Y:Ne/qe+$e,B:Fe/qe+$e}})(ge.R,ge.G,ge.B);return p$2(ge,"A")&&(ve.A=ge.A),ve}):null;function pe(ge){const ve=ne===s$2.ADDITIVE?{R:0,G:0,B:0,A:0}:{R:0,Y:0,B:0,A:0};return ge.reduce((ye,xe)=>{const _e=p$2(xe,"A")?xe.A:1,we={R:Math.min(ye.R+xe.R*_e,255),B:Math.min(ye.B+xe.B*_e,255),A:1-(1-_e)*(1-ye.A)},$e="G"in ye?ye.G:ye.Y,Re="G"in xe?xe.G:xe.Y;return{...we,...ne===s$2.ADDITIVE?{G:Math.min($e+Re*_e,255)}:{Y:Math.min($e+Re*_e,255)}}},ve)}let me;if(ne===s$2.ADDITIVE)me=pe(ce);else{const ge=pe(ue);me=((ve,ye,xe)=>{const _e=Math.min(ve,ye,xe),we=Math.min(255-ve,255-ye,255-xe),$e=ve-_e,Re=ye-_e,Ae=xe-_e,Ie=Math.min(Re,Ae),ke=$e+Re-Ie,Be=Re+Ie,Ne=2*(Ae-Ie),Fe=Math.max(ke,Be,Ne)/Math.max($e,Re,Ae),Ue=isNaN(Fe)||Fe===1/0||Fe<=0?1:Fe;return{R:ke/Ue+we,G:Be/Ue+we,B:Ne/Ue+we}})(ge.R,ge.Y,ge.B),me.A=ge.A}return{R:D$2(me.R),G:D$2(me.G),B:D$2(me.B),A:f$3(me.A,0,1)}},[t$2.HEX](oe,ne,ce){const ue=this.mix(oe,ne);return delete ue.A,ce?tt$2.HEX(ue):lt.HEX(ue)},HEXA(oe,ne,ce){const ue=this.mix(oe,ne);return ue.A=ce?255*et$2(ue.A):et$2(ue.A),ce?tt$2.HEX(ue):lt.HEXA(ue)},[t$2.RGB](oe,ne,ce,ue){const pe=this.mix(oe,ne);return delete pe.A,ce?tt$2.RGB(pe,ue):lt.RGB(pe,ue.decimals)},RGBA(oe,ne,ce,ue){const pe=this.mix(oe,ne);return ce?tt$2.RGB(pe,ue):lt.RGBA(pe,ue.decimals)},[t$2.HSL](oe,ne,ce,ue){const pe=this.mix(oe,ne),me=v$2(pe.R,pe.G,pe.B);return delete pe.A,delete me.A,ce?tt$2.HSL(me,ue):lt.HSL(pe,ue.decimals)},HSLA(oe,ne,ce,ue){const pe=this.mix(oe,ne),me=v$2(pe.R,pe.G,pe.B,pe.A);return ce?tt$2.HSL(me,ue):lt.HSLA(pe,ue.decimals)},[t$2.CIELab](oe,ne,ce,ue){const pe=this.mix(oe,ne),me=V$2(pe.R,pe.G,pe.B);return delete pe.A,ce?tt$2.CIELab(me,ue):lt.CIELabA(pe,ue.decimals)},CIELabA(oe,ne,ce,ue){const pe=this.mix(oe,ne),me=V$2(pe.R,pe.G,pe.B);return p$2(pe,"A")&&(me.A=pe.A),ce?tt$2.CIELab(me,ue):lt.CIELabA(pe,ue.decimals)}},Ct=(oe,ne)=>({R:D$2(oe.R,ne),G:D$2(oe.G,ne),B:D$2(oe.B,ne),...p$2(oe,"A")?{A:D$2(oe.A,ne)}:{}}),Lt=(oe,ne)=>({H:D$2(oe.H,ne),S:D$2(oe.S,ne),L:D$2(oe.L,ne),...p$2(oe,"A")?{A:D$2(oe.A,ne)}:{}}),gt=(oe,ne)=>({L:D$2(oe.L,ne),a:D$2(oe.a,ne),b:D$2(oe.b,ne)}),Bt=(oe,ne)=>({C:D$2(oe.C,ne),M:D$2(oe.M,ne),Y:D$2(oe.Y,ne),K:D$2(oe.K,ne)}),pt=(oe,ne,ce,ue)=>ue(dt$1(oe,ne),ce),Ht=(oe,ne,ce,ue,pe)=>(ce<1&&(ce=5),((ge,ve,ye)=>{const xe=ye-1,_e=(ve.R-ge.R)/xe,we=(ve.G-ge.G)/xe,$e=(ve.B-ge.B)/xe,Re=et$2(ge.A),Ae=(et$2(ve.A)-Re)/xe;return Array(ye).fill(null).map((Ie,ke)=>ke===0?ge:ke===xe?ve:{R:D$2(ge.R+_e*ke),G:D$2(ge.G+we*ke),B:D$2(ge.B+$e*ke),A:D$2(Re+Ae*ke)})})(dt$1(oe),dt$1(ne),ce).map(ge=>pe(ge,ue))),Ft=(oe,ne,ce,ue)=>({[e$2.ANALOGOUS]:mt.buildHarmony(ne,it$1,ce,ue),[e$2.COMPLEMENTARY]:mt.buildHarmony(ne,at$1,ce,ue),[e$2.SPLIT_COMPLEMENTARY]:mt.buildHarmony(ne,rt$1,ce,ue),[e$2.TRIADIC]:mt.buildHarmony(ne,nt$1,ce,ue),[e$2.TETRADIC]:mt.buildHarmony(ne,ct$1,ce,ue),[e$2.SQUARE]:mt.buildHarmony(ne,ot$1,ce,ue)})[oe];class Rt{constructor(ne,ce={}){this._options=k$3(ce,ne),this.rgb=dt$1(ne),this.updateHSL(),this.updateLab(),this.updateCMYK()}updateRGB(){this.rgb={...x$2(this.hsl.H,this.hsl.S,this.hsl.L),A:this.hsl.A}}updateRGBFromCMYK(){this.rgb={...q$2(this.cmyk.C,this.cmyk.M,this.cmyk.Y,this.cmyk.K),A:this.rgb.A}}updateRGBFromLab(){this.rgb={...P$1(this.lab.L,this.lab.a,this.lab.b),A:this.rgb.A}}updateHSL(){this.hsl=v$2(this.rgb.R,this.rgb.G,this.rgb.B,this.rgb.A)}updateLab(){this.lab={...V$2(this.rgb.R,this.rgb.G,this.rgb.B),A:this.rgb.A}}updateCMYK(){this.cmyk=_$2(this.rgb.R,this.rgb.G,this.rgb.B)}setOptions(ne={}){return this._options={...this._options,...ne},this}setH(ne){return this.hsl.H=O$1(ne),this.updateRGB(),this.updateLab(),this.updateCMYK(),this}setS(ne){return this.hsl.S=f$3(ne,0,100),this.updateRGB(),this.updateLab(),this.updateCMYK(),this}setL(ne){return this.hsl.L=f$3(ne,0,100),this.updateRGB(),this.updateLab(),this.updateCMYK(),this}setR(ne){this.rgb.R=f$3(ne,0,255),this.updateHSL(),this.updateLab(),this.updateCMYK()}setG(ne){return this.rgb.G=f$3(ne,0,255),this.updateHSL(),this.updateLab(),this.updateCMYK(),this}setB(ne){return this.rgb.B=f$3(ne,0,255),this.updateHSL(),this.updateLab(),this.updateCMYK(),this}setCIEL(ne){return this.lab.L=f$3(ne,0,100),this.updateRGBFromLab(),this.updateHSL(),this.updateCMYK(),this}setCIEa(ne){return this.lab.a=f$3(ne,-125,125),this.updateRGBFromLab(),this.updateHSL(),this.updateCMYK(),this}setCIEb(ne){return this.lab.b=f$3(ne,-125,125),this.updateRGBFromLab(),this.updateHSL(),this.updateCMYK(),this}setA(ne){return this.hsl.A=this.rgb.A=f$3(ne,0,1),this}setC(ne){return this.cmyk.C=f$3(ne,0,100),this.updateRGBFromCMYK(),this.updateHSL(),this.updateLab(),this}setM(ne){return this.cmyk.M=f$3(ne,0,100),this.updateRGBFromCMYK(),this.updateHSL(),this.updateLab(),this}setY(ne){return this.cmyk.Y=f$3(ne,0,100),this.updateRGBFromCMYK(),this.updateHSL(),this.updateLab(),this}setK(ne){return this.cmyk.K=f$3(ne,0,100),this.updateRGBFromCMYK(),this.updateHSL(),this.updateLab(),this}get options(){return this._options}get H(){return D$2(this.hsl.H,this.options.decimals)}get S(){return D$2(this.hsl.S,this.options.decimals)}get L(){return D$2(this.hsl.L,this.options.decimals)}get CIEL(){return D$2(this.lab.L,this.options.decimals)}get CIEa(){return D$2(this.lab.a,this.options.decimals)}get CIEb(){return D$2(this.lab.b,this.options.decimals)}get R(){return D$2(this.rgb.R,this.options.decimals)}get G(){return D$2(this.rgb.G,this.options.decimals)}get B(){return D$2(this.rgb.B,this.options.decimals)}get A(){return D$2(this.hsl.A,this.options.decimals)}get C(){return D$2(this.cmyk.C,this.options.decimals)}get M(){return D$2(this.cmyk.M,this.options.decimals)}get Y(){return D$2(this.cmyk.Y,this.options.decimals)}get K(){return D$2(this.cmyk.K,this.options.decimals)}get HEXObject(){return lt.HEX(this.rgb)}get HEXAObject(){return lt.HEXA(this.rgb)}get RGBObject(){return{R:this.R,G:this.G,B:this.B}}get RGBAObject(){return{...this.RGBObject,A:this.A}}get HSLObject(){return{H:this.H,S:this.S,L:this.L}}get HSLAObject(){return{...this.HSLObject,A:this.A}}get CIELabObject(){return{L:this.CIEL,a:this.CIEa,b:this.CIEb}}get CIELabAObject(){return{...this.CIELabObject,A:this.A}}get CMYKObject(){return{C:this.C,M:this.M,Y:this.Y,K:this.K}}get CMYKAObject(){return{...this.CMYKObject,A:this.A}}get HEX(){return tt$2.HEX({R:this.R,G:this.G,B:this.B})}get HEXA(){return tt$2.HEX({R:this.R,G:this.G,B:this.B,A:255*this.A})}get RGB(){return tt$2.RGB({R:this.R,G:this.G,B:this.B},this.options)}get RGBA(){return tt$2.RGB({R:this.R,G:this.G,B:this.B,A:this.A},this.options)}get HSL(){return tt$2.HSL({H:this.H,S:this.S,L:this.L},this.options)}get HSLA(){return tt$2.HSL({H:this.H,S:this.S,L:this.L,A:this.A},this.options)}get CIELab(){return tt$2.CIELab({L:this.CIEL,a:this.CIEa,b:this.CIEb},this.options)}get CIELabA(){return tt$2.CIELab({L:this.CIEL,a:this.CIEa,b:this.CIEb,A:this.A},this.options)}get CMYK(){return tt$2.CMYK({C:this.C,M:this.M,Y:this.Y,K:this.K},this.options)}get CMYKA(){return tt$2.CMYK({C:this.C,M:this.M,Y:this.Y,K:this.K,A:this.A},this.options)}static toHEXObject(ne){const ce=At(ne);return pt(ne,ce,0,lt.HEX)}static toHEX(ne){return tt$2.HEX(Rt.toHEXObject(ne))}static toHEXAObject(ne){const ce=At(ne);return pt(ne,ce,0,lt.HEXA)}static toHEXA(ne){return tt$2.HEX(Rt.toHEXAObject(ne))}static toRGBObject(ne,ce={}){const ue=At(ne);return pt(ne,ue,ce.decimals,lt.RGB)}static toRGB(ne,ce={}){const ue=At(ne),pe=k$3(ce,ne),me=pt(ne,ue,ce.decimals,lt.RGB);return tt$2.RGB(me,pe)}static toRGBAObject(ne,ce={}){const ue=At(ne);return pt(ne,ue,ce.decimals,lt.RGBA)}static toRGBA(ne,ce={}){const ue=At(ne),pe=k$3(ce,ne),me=pt(ne,ue,ce.decimals,lt.RGBA);return tt$2.RGB(me,pe)}static toHSLObject(ne,ce={}){const ue=At(ne);return pt(ne,ue,ce.decimals,lt.HSL)}static toHSL(ne,ce={}){const ue=At(ne),pe=k$3(ce,ne),me=pt(ne,ue,ce.decimals,lt.HSL);return tt$2.HSL(me,pe)}static toHSLAObject(ne,ce={}){const ue=At(ne);return pt(ne,ue,ce.decimals,lt.HSLA)}static toHSLA(ne,ce={}){const ue=At(ne),pe=k$3(ce,ne),me=pt(ne,ue,ce.decimals,lt.HSLA);return tt$2.HSL(me,pe)}static toCIELabObject(ne,ce={}){const ue=At(ne);return pt(ne,ue,ce.decimals,lt.CIELab)}static toCIELab(ne,ce={}){const ue=At(ne),pe=k$3(ce,ne),me=pt(ne,ue,ce.decimals,lt.CIELab);return tt$2.CIELab(me,pe)}static toCIELabAObject(ne,ce={}){const ue=At(ne);return pt(ne,ue,ce.decimals,lt.CIELabA)}static toCIELabA(ne,ce={}){const ue=At(ne),pe=k$3(ce,ne),me=pt(ne,ue,ce.decimals,lt.CIELabA);return tt$2.CIELab(me,pe)}static toCMYKObject(ne,ce={}){const ue=At(ne);return pt(ne,ue,ce.decimals,lt.CMYK)}static toCMYK(ne,ce={}){const ue=At(ne),pe=k$3(ce,ne),me=pt(ne,ue,ce.decimals,lt.CMYK);return tt$2.CMYK(me,pe)}static toCMYKAObject(ne,ce={}){const ue=At(ne);return pt(ne,ue,ce.decimals,lt.CMYKA)}static toCMYKA(ne,ce={}){const ue=At(ne),pe=k$3(ce,ne),me=pt(ne,ue,ce.decimals,lt.CMYKA);return tt$2.CMYK(me,pe)}static getBlendHEXObject(ne,ce,ue=5){return Ht(ne,ce,ue,0,lt.HEX)}static getBlendHEX(ne,ce,ue=5){return Rt.getBlendHEXObject(ne,ce,ue).map(pe=>tt$2.HEX(pe))}static getBlendHEXAObject(ne,ce,ue=5){return Ht(ne,ce,ue,0,lt.HEXA)}static getBlendHEXA(ne,ce,ue=5){return Rt.getBlendHEXAObject(ne,ce,ue).map(pe=>tt$2.HEX(pe))}static getBlendRGBObject(ne,ce,ue,pe){return typeof ue=="number"?Ht(ne,ce,ue,pe==null?void 0:pe.decimals,lt.RGB):Ht(ne,ce,5,ue==null?void 0:ue.decimals,lt.RGB)}static getBlendRGB(ne,ce,ue,pe){return typeof ue=="number"?Ht(ne,ce,ue,pe==null?void 0:pe.decimals,lt.RGB).map(me=>tt$2.RGB(me,k$3(pe||{},ne,ce))):Ht(ne,ce,5,ue==null?void 0:ue.decimals,lt.RGB).map(me=>tt$2.RGB(me,k$3(ue||{},ne,ce)))}static getBlendRGBAObject(ne,ce,ue,pe){return typeof ue=="number"?Ht(ne,ce,ue,pe==null?void 0:pe.decimals,lt.RGBA):Ht(ne,ce,5,ue==null?void 0:ue.decimals,lt.RGBA)}static getBlendRGBA(ne,ce,ue,pe){return typeof ue=="number"?Ht(ne,ce,ue,pe==null?void 0:pe.decimals,lt.RGBA).map(me=>tt$2.RGB(me,k$3(pe||{},ne,ce))):Ht(ne,ce,5,ue==null?void 0:ue.decimals,lt.RGBA).map(me=>tt$2.RGB(me,k$3(ue||{},ne,ce)))}static getBlendHSLObject(ne,ce,ue,pe){return Ht(ne,ce,typeof ue=="number"?ue:5,pe==null?void 0:pe.decimals,lt.HSL)}static getBlendHSL(ne,ce,ue,pe){return typeof ue=="number"?Ht(ne,ce,ue,pe==null?void 0:pe.decimals,lt.HSL).map(me=>tt$2.HSL(me,k$3(pe||{},ne,ce))):Ht(ne,ce,5,ue==null?void 0:ue.decimals,lt.HSL).map(me=>tt$2.HSL(me,k$3(ue||{},ne,ce)))}static getBlendHSLAObject(ne,ce,ue,pe){return typeof ue=="number"?Ht(ne,ce,ue,pe==null?void 0:pe.decimals,lt.HSLA):Ht(ne,ce,5,ue==null?void 0:ue.decimals,lt.HSLA)}static getBlendHSLA(ne,ce,ue,pe){return typeof ue=="number"?Ht(ne,ce,ue,pe==null?void 0:pe.decimals,lt.HSLA).map(me=>tt$2.HSL(me,k$3(pe||{},ne,ce))):Ht(ne,ce,5,ue==null?void 0:ue.decimals,lt.HSLA).map(me=>tt$2.HSL(me,k$3(ue||{},ne,ce)))}static getBlendCIELabObject(ne,ce,ue,pe){return typeof ue=="number"?Ht(ne,ce,ue,pe==null?void 0:pe.decimals,lt.CIELab):Ht(ne,ce,5,ue==null?void 0:ue.decimals,lt.CIELab)}static getBlendCIELab(ne,ce,ue,pe){return typeof ue=="number"?Ht(ne,ce,ue,pe==null?void 0:pe.decimals,lt.CIELab).map(me=>tt$2.CIELab(me,k$3(pe||{},ne,ce))):Ht(ne,ce,5,ue==null?void 0:ue.decimals,lt.CIELab).map(me=>tt$2.CIELab(me,k$3(ue||{},ne,ce)))}static getBlendCIELabAObject(ne,ce,ue,pe){return typeof ue=="number"?Ht(ne,ce,ue,pe==null?void 0:pe.decimals,lt.CIELabA):Ht(ne,ce,5,ue==null?void 0:ue.decimals,lt.CIELabA)}static getBlendCIELabA(ne,ce,ue,pe){return typeof ue=="number"?Ht(ne,ce,ue,pe==null?void 0:pe.decimals,lt.CIELabA).map(me=>tt$2.CIELab(me,k$3(pe||{},ne,ce))):Ht(ne,ce,5,ue==null?void 0:ue.decimals,lt.CIELabA).map(me=>tt$2.CIELab(me,k$3(ue||{},ne,ce)))}static getMixHEXObject(ne,ce=s$2.ADDITIVE){return bt.HEX(ne,ce,!1)}static getMixHEX(ne,ce=s$2.ADDITIVE){return bt.HEX(ne,ce,!0)}static getMixHEXAObject(ne,ce=s$2.ADDITIVE){return bt.HEXA(ne,ce,!1)}static getMixHEXA(ne,ce=s$2.ADDITIVE){return bt.HEXA(ne,ce,!0)}static getMixRGBObject(ne,ce,ue){return typeof ce=="string"?bt.RGB(ne,ce,!1,k$3(ue||{},...ne)):bt.RGB(ne,s$2.ADDITIVE,!1,k$3(ce||{},...ne))}static getMixRGB(ne,ce,ue){return typeof ce=="string"?bt.RGB(ne,ce,!0,k$3(ue||{},...ne)):bt.RGB(ne,s$2.ADDITIVE,!0,k$3(ce||{},...ne))}static getMixRGBAObject(ne,ce,ue){return typeof ce=="string"?bt.RGBA(ne,ce,!1,k$3(ue||{},...ne)):bt.RGBA(ne,s$2.ADDITIVE,!1,k$3(ce||{},...ne))}static getMixRGBA(ne,ce,ue){return typeof ce=="string"?bt.RGBA(ne,ce,!0,k$3(ue||{},...ne)):bt.RGBA(ne,s$2.ADDITIVE,!0,k$3(ce||{},...ne))}static getMixHSLObject(ne,ce,ue){return typeof ce=="string"?bt.HSL(ne,ce,!1,k$3(ue||{},...ne)):bt.HSL(ne,s$2.ADDITIVE,!1,k$3(ce||{},...ne))}static getMixHSL(ne,ce,ue){return typeof ce=="string"?bt.HSL(ne,ce,!0,k$3(ue||{},...ne)):bt.HSL(ne,s$2.ADDITIVE,!0,k$3(ce||{},...ne))}static getMixHSLAObject(ne,ce,ue){return typeof ce=="string"?bt.HSLA(ne,ce,!1,k$3(ue||{},...ne)):bt.HSLA(ne,s$2.ADDITIVE,!1,k$3(ce||{},...ne))}static getMixHSLA(ne,ce,ue){return typeof ce=="string"?bt.HSLA(ne,ce,!0,k$3(ue||{},...ne)):bt.HSLA(ne,s$2.ADDITIVE,!0,k$3(ce||{},...ne))}static getMixCIELabObject(ne,ce,ue){return typeof ce=="string"?bt.CIELab(ne,ce,!1,k$3(ue||{},...ne)):bt.CIELab(ne,s$2.ADDITIVE,!1,k$3(ce||{},...ne))}static getMixCIELab(ne,ce,ue){return typeof ce=="string"?bt.CIELab(ne,ce,!0,k$3(ue||{},...ne)):bt.CIELab(ne,s$2.ADDITIVE,!0,k$3(ce||{},...ne))}static getMixCIELabAObject(ne,ce,ue){return typeof ce=="string"?bt.CIELabA(ne,ce,!1,k$3(ue||{},...ne)):bt.CIELabA(ne,s$2.ADDITIVE,!1,k$3(ce||{},...ne))}static getMixCIELabA(ne,ce,ue){return typeof ce=="string"?bt.CIELabA(ne,ce,!0,k$3(ue||{},...ne)):bt.CIELabA(ne,s$2.ADDITIVE,!0,k$3(ce||{},...ne))}static getShades(ne,ce,ue){return typeof ce=="number"?Et(ne,ce,!0,k$3(ue||{},ne)):Et(ne,5,!0,k$3(ce||{},ne))}static getTints(ne,ce,ue){return typeof ce=="number"?Et(ne,ce,!1,k$3(ue||{},ne)):Et(ne,5,!1,k$3(ce||{},ne))}static getHarmony(ne,ce,ue,pe){return`${ce}`in e$2?Ft(ce,ne,K$2(ue)?ue:s$2.ADDITIVE,k$3(K$2(ue)?pe||{}:ue||{},ne)):K$2(ce)?Ft(e$2.COMPLEMENTARY,ne,ce,k$3(ue||{},ne)):Ft(e$2.COMPLEMENTARY,ne,s$2.ADDITIVE,k$3(ce||{},ne))}}function hash(oe){let ne=5381,ce=oe.length;for(;ce;)ne=ne*33^oe.charCodeAt(--ce);return ne>>>0}const tint="500";function hex(oe){return parseInt(oe.replace("#","0x"))}const searchEventAliases=lodashExports$1.thru({source:["source","start"],destination:["destination","goal","finish"],updating:["update","updating"],expanding:["expanding","expanding"],generating:["generate","generating","open","opening"],closing:["close","closing"],end:["finish","end"]},oe=>{const ne={};for(const[ce,ue]of lodashExports$1.entries(oe))for(const pe of ue)ne[pe]=ce;return ne}),colorsHex={source:green$1.A400,destination:red$1.A400,updating:orange$1[tint],expanding:deepPurple$1[tint],generating:amber$1[tint],closing:pink$1[tint],end:blue$1.A400};lodashExports$1.mapValues(colorsHex,hex);const shades=lodashExports$1.sortBy(lodashExports$1.keys(accentColors),oe=>new Rt(getShade(oe,"dark")).H);function getColorHex(oe="",ne){if(searchEventAliases[lodashExports$1.lowerCase(oe)])return colorsHex[oe];if(ne)return ne;{const ue=hash(lodashExports$1.lowerCase(oe)),pe=lodashExports$1.values(accentColors);return pe[ue%pe.length][tint]}}const treeWorkerUrl=""+new URL("tree.worker-3134016b.js",import.meta.url).href;class TreeWorkerUrl extends Worker{constructor(){super(treeWorkerUrl,{type:"module"})}}const treeAsync=usingMemoizedWorkerTask(TreeWorkerUrl);function useTree(oe){const ne=compilerRuntimeExports.c(3);let ce,ue;return ne[0]!==oe?(ce=async()=>await treeAsync(oe),ue=[oe],ne[0]=oe,ne[1]=ce,ne[2]=ue):(ce=ne[1],ue=ne[2]),useAsync(ce,ue)}function useTreeMemo(oe,ne){const ce=reactExports.useMemo(()=>oe,ne);return useTree(ce)}const isDefined$1=oe=>!lodashExports$1.isUndefined(oe)&&!lodashExports$1.isNull(oe),divider$4=jsxRuntimeExports.jsx(Divider$1,{orientation:"vertical",flexItem:!0,sx:{m:1}});function useCache(oe,ne){const ce=compilerRuntimeExports.c(4),ue=ne===void 0?!1:ne,[pe,me]=reactExports.useState();let ge,ve;return ce[0]!==ue||ce[1]!==oe?(ge=()=>{ue||oe&&me(oe)},ve=[oe,ue],ce[0]=ue,ce[1]=oe,ce[2]=ge,ce[3]=ve):(ge=ce[2],ve=ce[3]),reactExports.useEffect(ge,ve),pe}const layoutModes={"directed-graph":{value:"directed-graph",name:"Directed Graph",description:"Show all edges",showAllEdges:!0},tree:{value:"tree",name:"Tree",description:"Show only edges between each node and their final parents",showAllEdges:!1}};function GraphEvents(oe){const ne=compilerRuntimeExports.c(7),{onSelection:ce,layer:ue}=oe,pe=v$4(),me=y$4();let ge;ne[0]!==me||ne[1]!==ce?(ge=()=>{me({clickNode:ye=>{ce==null||ce({event:ye.event.original,node:ye.node})},enterNode:()=>{document.body.style.cursor="pointer"},leaveNode:()=>{document.body.style.cursor=""}})},ne[0]=me,ne[1]=ce,ne[2]=ge):ge=ne[2];let ve;return ne[3]!==ue||ne[4]!==me||ne[5]!==pe?(ve=[ue,me,pe],ne[3]=ue,ne[4]=me,ne[5]=pe,ne[6]=ve):ve=ne[6],reactExports.useEffect(ge,ve),null}const SEVEN_CLASS_GNBU=["#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"];function TreeGraph({trace:oe,tree:ne,step:ce=0,layer:ue,showAllEdges:pe,trackedProperty:me}){const ge=v$4(),[ve,ye]=reactExports.useState("vertical"),xe=usePaper(),_e=useAcrylic(),we=useTheme$1(),$e=interpolate$1([we.palette.background.paper,we.palette.text.primary]),Re=_$4(),Ae=reactExports.useMemo(()=>getFinalParents(oe),[oe]),Ie=reactExports.useMemo(()=>{const ke=ve==="vertical",Be=new MultiDirectedGraph;lodashExports$1.forEach(ne,Fe=>{Be.addNode(Fe.label,{x:ke?Fe.x:-Fe.y,y:ke?Fe.y:-Fe.x,label:Fe.label,size:Math.log(Fe.size)+2,color:we.palette.action.disabledBackground})});const Ne={};return lodashExports$1.forEach(oe==null?void 0:oe.events,({id:Fe,pId:Ue,type:qe},We)=>{Fe&&Ue&&(Ne[Fe]=Ne[Fe]??new Set,Ne[Fe].add(Ue))}),lodashExports$1.forEach(oe==null?void 0:oe.events,({id:Fe,pId:Ue})=>{if(isDefined$1(Ue)&&Be.hasNode(`${Ue}`)){const qe=makeEdgeKey(Fe,Ue);!Be.hasEdge(qe)&&Be.hasNode(`${Fe}`)&&Be.addDirectedEdgeWithKey(qe,`${Ue}`,`${Fe}`,{label:"",color:"white",size:2,final:Ae[Fe]===Ue}),Be.hasDirectedEdge(qe)&&Be.updateEdgeAttribute(qe,"size",We=>Math.log(Math.E**(We-.5)+.5)+.5)}}),Be},[Re,oe,ne,Ae,ve]);return reactExports.useEffect(()=>{const ke=memoizee$1(qe=>interpolate$1([we.palette.background.paper,qe])),Be=400,Ne=$e(.1);Ie.forEachNode(qe=>{Ie.setNodeAttribute(qe,"color",Ne),Ie.setNodeAttribute(qe,"forceLabel",!1),Ie.setNodeAttribute(qe,"label",lodashExports$1.truncate(qe,{length:15}))}),Ie.forEachEdge(qe=>{const We=Ie.getEdgeAttribute(qe,"final");Ie.setEdgeAttribute(qe,"color",Ne),Ie.setEdgeAttribute(qe,"hidden",!pe&&!We),Ie.setEdgeAttribute(qe,"forceLabel",!1),Ie.setEdgeAttribute(qe,"label","")});const Fe={},Ue={};if((pe?lodashExports$1.forEach:lodashExports$1.forEachRight)(lodashExports$1.slice(oe==null?void 0:oe.events,0,ce+1),({id:qe,type:We,pId:ze},Ge)=>{const Ze=getColorHex(We),Je=ke(Ze)(lodashExports$1.max([1-(ce-Ge)/Be,.2]));if(Ie.hasNode(`${qe}`)&&!Fe[qe]){Ie.setNodeAttribute(`${qe}`,"color",Je),Ie.setNodeAttribute(`${qe}`,"label",lodashExports$1.truncate(`${lodashExports$1.startCase(We)} ${qe}`,{length:15})),Ie.setNodeAttribute(`${qe}`,"forceLabel",ce===Ge);const Qe=makeEdgeKey(qe,ze);isDefined$1(ze)&&Ie.hasNode(`${ze}`)&&Ie.hasEdge(Qe)&&!Ue[Qe]&&(Ie.setEdgeAttribute(Qe,"forceLabel",ce===Ge),Ie.setEdgeAttribute(Qe,"color",Je),Ie.setEdgeAttribute(Qe,"label",`Step ${Ge}`),Ie.setEdgeAttribute(Qe,"hidden",!1),pe||(Ue[Qe]=!0)),pe||(Fe[qe]=!0)}}),me){const qe=lodashExports$1.min(lodashExports$1.map(oe==null?void 0:oe.events,Ze=>lodashExports$1.get(Ze,me))),We=lodashExports$1.max(lodashExports$1.map(oe==null?void 0:oe.events,Ze=>lodashExports$1.get(Ze,me))),ze=Ze=>isNaN(qe)||isNaN(We)||isNaN(Ze)?0:(Ze-qe)/(We-qe),Ge=interpolate$1(SEVEN_CLASS_GNBU);lodashExports$1.forEach(lodashExports$1.slice(oe==null?void 0:oe.events,0,ce+1),Ze=>{if(Ie.hasNode(`${Ze.id}`)){const Je=Ge(ze(lodashExports$1.get(Ze,me)));if(Ie.setNodeAttribute(`${Ze.id}`,"color",Je),isDefined$1(Ze.pId)){const Qe=makeEdgeKey(`${Ze.id}`,`${Ze.pId}`);Ie.hasDirectedEdge(Qe)&&Ie.setEdgeAttribute(Qe,"color",Je)}}})}Re(Ie)},[Ie,ce,oe,pe,me,we]),jsxRuntimeExports.jsx(Stack$1,{sx:{pt:6,position:"absolute",top:0,left:0},children:jsxRuntimeExports.jsxs(Stack$1,{direction:"row",sx:{...xe(1),..._e,alignItems:"center",height:ke=>ke.spacing(6),px:1,m:1},children:[jsxRuntimeExports.jsx(IconButtonWithTooltip,{color:"primary",onClick:()=>{var ke,Be,Ne;(Ne=(Be=(ke=ge==null?void 0:ge.getCamera)==null?void 0:ke.call(ge))==null?void 0:Be.animatedReset)==null||Ne.call(Be)},label:"Fit",icon:jsxRuntimeExports.jsx(CenterFocusWeakOutlined,{})}),divider$4,jsxRuntimeExports.jsx(IconButtonWithTooltip,{color:"primary",onClick:()=>{ye(ve==="vertical"?"horizontal":"vertical")},label:"Rotate",icon:jsxRuntimeExports.jsx(RotateIcon,{})}),divider$4,jsxRuntimeExports.jsx(MinimisedPlaybackControls,{layer:ue})]})})}function makeEdgeKey(oe,ne){return`${oe}::${ne}`}const stepsLayerGuard$2=oe=>!!getLayerHandler(oe).steps;function TreePage({template:oe}){var Ye,tn,Xt,Qt,Zt,Gt,sn,Kt,Jt,mn;const{key:ne,setKey:ce,layer:ue,layers:pe,allLayers:me}=useLayer(void 0,stepsLayerGuard$2),ge=useTheme$1(),{controls:ve,onChange:ye,state:xe,dragHandle:_e}=useViewTreeContext(),we=useThrottle$1(((Ye=ue==null?void 0:ue.source)==null?void 0:Ye.step)??0,1e3/24),{stepTo:$e}=usePlaybackState(ne),Re=reactExports.useMemo(()=>{var bn,$n,Ut;return lodashExports$1.chain((Ut=($n=(bn=ue==null?void 0:ue.source)==null?void 0:bn.trace)==null?void 0:$n.content)==null?void 0:Ut.events).flatMap(lodashExports$1.keys).uniq().filter(Yt=>Yt!=="type").value()},[(Qt=(Xt=(tn=ue==null?void 0:ue.source)==null?void 0:tn.trace)==null?void 0:Xt.content)==null?void 0:Qt.events]),[Ae,Ie]=reactExports.useState(""),ke=(Gt=(Zt=ue==null?void 0:ue.source)==null?void 0:Zt.trace)==null?void 0:Gt.content,Be=(Kt=(sn=ue==null?void 0:ue.source)==null?void 0:sn.trace)==null?void 0:Kt.lastModified,Ne=(mn=(Jt=ue==null?void 0:ue.source)==null?void 0:Jt.trace)==null?void 0:mn.key;reactExports.useEffect(()=>{Ie("")},[ke,Ie]);const[Fe,Ue]=reactExports.useState(),[qe,We]=reactExports.useState(!1),[ze,Ge]=reactExports.useState("tree"),Ze=reactExports.useMemo(()=>{const bn=lodashExports$1.filter(lodashExports$1.map(ke==null?void 0:ke.events,($n,Ut)=>({event:$n,step:Ut})),$n=>`${$n.event.id}`===(Fe==null?void 0:Fe.node));return{events:bn,current:lodashExports$1.findLast(bn,$n=>$n.step<=we)}},[Fe,we]),Je=reactExports.useMemo(()=>({trace:ke,mode:ze}),[ke,Ne,Be,ze]),{result:Qe,loading:Nt}=useTreeMemo(Je,[Je]),jt=reactExports.useMemo(()=>({stagePadding:8*8,allowInvalidContainer:!0,edgeLabelColor:{color:ge.palette.text.secondary},labelFont:"Inter",labelSize:14,labelDensity:.1,renderEdgeLabels:!0,edgeLabelFont:"Inter",edgeLabelSize:12,defaultDrawNodeHover:()=>{},labelColor:{color:ge.palette.text.primary},edgeLabelWeight:"500",defaultEdgeType:"arrow",edgeProgramClasses:{straight:EdgeArrowProgram$1,curvedArrow:EdgeCurvedArrowProgram}}),[ge]);return jsxRuntimeExports.jsxs(oe,{onChange:ye,stack:xe,children:[jsxRuntimeExports.jsx(oe.Key,{children:"tree"}),jsxRuntimeExports.jsx(oe.Title,{children:"Tree"}),jsxRuntimeExports.jsx(oe.Handle,{children:_e}),jsxRuntimeExports.jsx(oe.Content,{children:jsxRuntimeExports.jsx(Flex,{children:ke?Nt?jsxRuntimeExports.jsxs(Flex,{sx:{flexDirection:"column",gap:4,alignItems:"center",justifyContent:"center"},children:[jsxRuntimeExports.jsx(CircularProgress$1,{}),jsxRuntimeExports.jsx(Type$2,{component:"div",variant:"body2",sx:{px:8,maxWidth:480},children:"Generating layout"})]}):Qe!=null&&Qe.length?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(AutoSizer,{children:bn=>jsxRuntimeExports.jsxs(k$5,{style:{...bn,background:ge.palette.background.paper},graph:MultiDirectedGraph,settings:jt,children:[jsxRuntimeExports.jsx(TreeGraph,{step:we,tree:Qe,trace:ke,layer:ue,showAllEdges:layoutModes[ze].showAllEdges,trackedProperty:Ae}),jsxRuntimeExports.jsx(GraphEvents,{layer:ne,onSelection:$n=>{Ue($n),We(!0)}})]})}),jsxRuntimeExports.jsx(Menu$1,{onClose:()=>We(!1),anchorReference:"anchorPosition",anchorPosition:{left:(Fe==null?void 0:Fe.event.clientX)??0,top:(Fe==null?void 0:Fe.event.clientY)??0},transformOrigin:{horizontal:"left",vertical:"top"},open:qe,children:jsxRuntimeExports.jsxs(MenuList$1,{dense:!0,sx:{p:0},children:[!!Ze.current&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(ListItem$1,{sx:{py:0},children:jsxRuntimeExports.jsxs(Type$2,{component:"div",color:"text.secondary",variant:"overline",children:["Step ",Ze.current.step]})}),jsxRuntimeExports.jsx(Box$1,{px:2,py:1,children:jsxRuntimeExports.jsx(PropertyList,{event:Ze.current.event,vertical:!0,simple:!0,primitives:!0})}),jsxRuntimeExports.jsx(Divider$1,{sx:{my:1,mx:2}})]}),jsxRuntimeExports.jsx(ListItem$1,{sx:{py:0},children:jsxRuntimeExports.jsxs(Type$2,{component:"div",color:"text.secondary",variant:"overline",children:["Events at ",Fe==null?void 0:Fe.node]})}),lodashExports$1.map(Ze.events,(bn,$n,Ut)=>{var en;const Yt=((en=lodashExports$1.findLast(Ut,dn=>dn.step<=we))==null?void 0:en.step)===bn.step;return jsxRuntimeExports.jsxs(Stack$1,{direction:"row",children:[jsxRuntimeExports.jsx(MenuItem$1,{selected:Yt,sx:{height:32,flex:1,borderLeft:`4px solid ${getColorHex(bn.event.type)}`},onClick:()=>{$e(bn.step)},children:jsxRuntimeExports.jsx(Tooltip$1,{title:`Go to step ${bn.step}`,children:jsxRuntimeExports.jsx(Box$1,{sx:{ml:-.5,pr:4},children:jsxRuntimeExports.jsx(Label$1,{primary:lodashExports$1.startCase(bn.event.type),secondary:isDefined$1(bn.event.pId)?`Step ${bn.step}, from ${bn.event.pId}`:`Step ${bn.step}`})})})}),jsxRuntimeExports.jsx(Box$1,{sx:{flex:0},children:jsxRuntimeExports.jsx(PropertyDialog,{event:bn.event,trigger:dn=>jsxRuntimeExports.jsx(MenuItem$1,{selected:Yt,onClick:dn,sx:{pr:0},children:jsxRuntimeExports.jsx(Tooltip$1,{title:"See all properties",children:jsxRuntimeExports.jsx(ListItemIcon$1,{children:jsxRuntimeExports.jsx(DataObjectOutlined,{})})})})})})]})})]})})]}):jsxRuntimeExports.jsx(Placeholder$2,{icon:jsxRuntimeExports.jsx(TreeIcon,{}),label:"Graph",secondary:`${inferLayerName(ue)} is not a graph.`}):jsxRuntimeExports.jsx(Placeholder$2,{icon:jsxRuntimeExports.jsx(TreeIcon,{}),label:"Graph",secondary:"When you load a trace that has tree-like data, you'll see it here as a decision tree."})})}),jsxRuntimeExports.jsxs(oe.Options,{children:[jsxRuntimeExports.jsx(FeaturePicker,{icon:jsxRuntimeExports.jsx(LayersIcon,{}),label:"Layer",value:ne,items:lodashExports$1.map(me,bn=>({id:bn.key,hidden:!lodashExports$1.find(pe,{key:bn.key}),name:inferLayerName(bn)})),onChange:ce,arrow:!0,ellipsis:12}),divider$4,jsxRuntimeExports.jsx(FeaturePicker,{icon:jsxRuntimeExports.jsx(ModeStandbyOutlined,{}),label:"Layout",value:ze,onChange:Ge,items:lodashExports$1.map(lodashExports$1.entries(layoutModes),([bn,$n])=>({id:bn,...$n})),arrow:!0}),divider$4,jsxRuntimeExports.jsx(FeaturePicker,{icon:jsxRuntimeExports.jsx(TimelineOutlined,{}),label:"Tracked Property",value:Ae,onChange:Ie,items:[{id:"",name:"Off"},...lodashExports$1.map(Re,bn=>({id:bn,name:`$.${bn}`}))],arrow:!0})]}),jsxRuntimeExports.jsx(oe.Extras,{children:ve})]})}function getFinalParents(oe){const ne={};return lodashExports$1.forEach(oe==null?void 0:oe.events,({id:ce,pId:ue})=>{ne[ce]=ue}),ne}function SelectionMenu(oe){const ne=compilerRuntimeExports.c(17),{selection:ce,onClose:ue}=oe,pe=useSelectionMenu(),me=useCache(ce);let ge;ne[0]!==ce?(ge=ce??{},ne[0]=ce,ne[1]=ge):ge=ne[1];const{client:ve}=ge,ye=!!ce,xe=(ve==null?void 0:ve.y)??0,_e=(ve==null?void 0:ve.x)??0;let we;ne[2]!==xe||ne[3]!==_e?(we={top:xe,left:_e},ne[2]=xe,ne[3]=_e,ne[4]=we):we=ne[4];let $e;ne[5]===Symbol.for("react.memo_cache_sentinel")?($e={py:0},ne[5]=$e):$e=ne[5];let Re;ne[6]!==ue?(Re=ke=>{const Be=lodashExports$1.entries(ke);return Be.length?lodashExports$1.chain(Be).sortBy(Ne=>{const[,Fe]=Ne;return Fe.index}).map((Ne,Fe)=>{const[,Ue]=Ne,{items:qe,primary:We}=Ue;return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[!!Fe&&jsxRuntimeExports.jsx(Divider$1,{sx:{my:1,mx:2}}),We&&jsxRuntimeExports.jsx(ListItem$1,{sx:{py:0},children:jsxRuntimeExports.jsx(Type$2,{component:"div",color:"text.secondary",variant:"overline",children:We})}),lodashExports$1.chain(qe).entries().sortBy(ze=>{const[,Ge]=ze;return Ge.index}).map(ze=>{const[Ge,Ze]=ze,{action:Je,icon:Qe,primary:Nt,secondary:jt,extras:Ye}=Ze;return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[!!(Je||Nt||jt)&&(Je?jsxRuntimeExports.jsxs(MenuItem$1,{onClick:()=>{Je==null||Je(),ue==null||ue()},children:[Qe&&jsxRuntimeExports.jsx(ListItemIcon$1,{children:Qe}),jsxRuntimeExports.jsx(ListItemText$1,{primary:Nt,sx:{mr:4}}),jsxRuntimeExports.jsx(Type$2,{component:"div",variant:"body2",color:"text.secondary",children:jt})]},Ge):jsxRuntimeExports.jsxs(ListItem$1,{children:[Qe&&jsxRuntimeExports.jsx(ListItemIcon$1,{children:Qe}),jsxRuntimeExports.jsx(ListItemText$1,{primary:Nt,sx:{mr:4}}),jsxRuntimeExports.jsx(Type$2,{component:"div",variant:"body2",color:"text.secondary",children:jt})]},Ge)),!!Ye&&Ye]})}).value()]})}).value():jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(ListItem$1,{children:jsxRuntimeExports.jsx(Type$2,{component:"div",children:"No info to show."})})})},ne[6]=ue,ne[7]=Re):Re=ne[7];let Ae;ne[8]!==pe||ne[9]!==me||ne[10]!==Re?(Ae=jsxRuntimeExports.jsx(MenuList$1,{dense:!0,sx:$e,children:jsxRuntimeExports.jsx(pe,{event:me,children:Re})}),ne[8]=pe,ne[9]=me,ne[10]=Re,ne[11]=Ae):Ae=ne[11];let Ie;return ne[12]!==ye||ne[13]!==we||ne[14]!==ue||ne[15]!==Ae?(Ie=jsxRuntimeExports.jsx(Menu$1,{open:ye,anchorReference:"anchorPosition",anchorPosition:we,onClose:ue,keepMounted:!0,children:Ae}),ne[12]=ye,ne[13]=we,ne[14]=ue,ne[15]=Ae,ne[16]=Ie):Ie=ne[16],Ie}const identity$1=({children:oe})=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:oe==null?void 0:oe({})});function useSelectionMenu(){const oe=compilerRuntimeExports.c(3),[ne]=useLayers(),{layers:ce}=ne;let ue,pe;if(oe[0]!==ce){let me;oe[2]===Symbol.for("react.memo_cache_sentinel")?(me=(ge,ve)=>{var xe;const ye=((xe=getLayerHandler(ve))==null?void 0:xe.provideSelectionInfo)??identity$1;return _e=>{const{children:we,event:$e}=_e;return jsxRuntimeExports.jsx(ye,{layer:ve.key,event:$e,children:Re=>jsxRuntimeExports.jsx(ge,{event:$e,children:Ae=>we==null?void 0:we(lodashExports$1.merge(Re,Ae))})})}},oe[2]=me):me=oe[2],pe=lodashExports$1.chain(ce).reduce(me,identity$1).value(),oe[0]=ce,oe[1]=pe}else pe=oe[1];return ue=pe,ue}const TILE_RESOLUTION=128,tileSize=(oe=!1)=>(oe?.75:devicePixelRatio*2)*TILE_RESOLUTION,rendererOptions={tileSubdivision:2,workerCount:lodashExports$1.clamp(lodashExports$1.floor((navigator.hardwareConcurrency-1)/2),1,12),tileResolution:{width:tileSize(),height:tileSize()}},TraceRendererContext=reactExports.createContext({});function useRendererInstance(){return reactExports.useContext(TraceRendererContext)}function useRenderer(oe,{width:ne,height:ce}={}){const ue=useTheme$1(),[pe]=useRenderers(),me=reactExports.useRef(null),[ge,ve]=reactExports.useState(""),[ye,xe]=reactExports.useState();return reactExports.useEffect(()=>{if(ve(""),me.current&&ne&&ce&&oe){const _e=lodashExports$1.find(pe,we=>we.renderer.meta.id===oe);if(_e){const we=new _e.renderer.constructor;return we.setup({...rendererOptions,screenSize:{width:ne,height:ce},backgroundColor:ue.palette.background.paper,accentColor:ue.palette.primary.main}),me.current.append(we.getView()),xe(we),()=>{var $e,Re;try{(Re=($e=me.current)==null?void 0:$e.removeChild)==null||Re.call($e,we.getView()),xe(void 0)}catch(Ae){console.warn(Ae)}finally{we.destroy()}}}}},[me.current,lodashExports$1.map,oe,pe,ue,ve,xe]),useDebounce(()=>{ye&&ne&&ce&&ye.setOptions({screenSize:{width:ne,height:ce}})},ue.transitions.duration.standard,[ye,ne,ce]),{instance:ye,ref:me,error:ge}}function TraceRendererCircularProgress(){const oe=compilerRuntimeExports.c(3),[ne]=useLoading(),{map:ce,specimen:ue}=ne;let pe;return oe[0]!==ce||oe[1]!==ue?(pe=!!(ce||ue)&&jsxRuntimeExports.jsx(CircularProgress$1,{sx:{position:"absolute",top:me=>me.spacing(8),right:me=>me.spacing(2)}}),oe[0]=ce,oe[1]=ue,oe[2]=pe):pe=oe[2],pe}const VIEWPORT_PAGE_DESCRIPTION="When you create a layer, you'll see it visualised here.";function TraceRenderer({width:oe,height:ne,renderer:ce,rendererRef:ue,layers:pe}){const me=reactExports.useMemo(nanoid$1,[]),{instance:ge,error:ve,ref:ye}=useRenderer(ce,{width:oe,height:ne}),{playing:xe}=usePlaybackState(),[,_e]=useScreenshots(),[we,$e]=reactExports.useState();reactExports.useEffect(()=>{if(ge){const Ae=(Ie,ke)=>{const Be=Ie;$e({client:{x:Be.clientX,y:Be.clientY},world:ke.world,info:{point:ke.world,components:ke.components}})};return ge.on("click",Ae),()=>void ge.off("click",Ae)}},[ge]);const Re=reactExports.useMemo(()=>({renderer:ge}),[ge]);return reactExports.useEffect(()=>ue==null?void 0:ue(ge),[ge,ue]),reactExports.useEffect(()=>{const Ae=async()=>{var Ie;return await((Ie=ge==null?void 0:ge.toDataUrl)==null?void 0:Ie.call(ge))};return _e(()=>({[me]:Ae})),()=>_e(()=>({[me]:void 0}))},[me,ge]),reactExports.useEffect(()=>{ge&&ge.setOptions({tileResolution:{width:tileSize(xe),height:tileSize(xe)}})},[ge,xe]),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(TraceRendererCircularProgress,{}),jsxRuntimeExports.jsx(TraceRendererContext.Provider,{value:Re,children:pe!=null&&pe.length?ve?jsxRuntimeExports.jsxs(Box$1,{sx:{display:"flex",flexDirection:"column",width:oe,height:ne,alignItems:"center",justifyContent:"center",color:"text.secondary"},children:[jsxRuntimeExports.jsx(DisabledIcon,{sx:{mb:2},fontSize:"large"}),ve]}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Box$1,{ref:ye,children:pe.map((Ae,Ie)=>jsxRuntimeExports.jsx(RenderLayer,{index:Ie,layer:Ae},Ae.key))})}):jsxRuntimeExports.jsx(Placeholder$2,{icon:jsxRuntimeExports.jsx(ViewportIcon,{}),label:"Viewport",width:oe,height:ne,secondary:VIEWPORT_PAGE_DESCRIPTION})}),jsxRuntimeExports.jsx(SelectionMenu,{selection:we,onClose:()=>$e(void 0)})]})}function NodeList({nodes:oe,start:ne=0,end:ce=(oe==null?void 0:oe.length)??0}){const{renderer:ue}=useRendererInstance();return reactExports.useEffect(()=>{if(ue&&(oe!=null&&oe.length))return ue.add(lodashExports$1.slice(oe,ne,ce).flat())},[ue,oe,ne,ce]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{})}function NodeList2(oe){const ne=compilerRuntimeExports.c(5),{nodes:ce}=oe,{renderer:ue}=useRendererInstance();let pe,me;ne[0]!==ue||ne[1]!==ce?(pe=()=>{if(ue&&(ce!=null&&ce.length))return ue.add(ce)},me=[ue,ce],ne[0]=ue,ne[1]=ce,ne[2]=pe,ne[3]=me):(pe=ne[2],me=ne[3]),reactExports.useEffect(pe,me);let ge;return ne[4]===Symbol.for("react.memo_cache_sentinel")?(ge=jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{}),ne[4]=ge):ge=ne[4],ge}function LazyNodeList({nodes:oe,end:ne}){const ue=lodashExports$1.floor((ne??0)/100)*100,pe=reactExports.useMemo(()=>lodashExports$1.slice(oe,0,ue),[oe,ue]),me=reactExports.useMemo(()=>lodashExports$1.slice(oe,ue,(ne??0)+1),[oe,ue,ne]);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[!!ue&&jsxRuntimeExports.jsx(NodeList,{nodes:pe}),me.map((ge,ve)=>jsxRuntimeExports.jsx(NodeList2,{nodes:ge},ue+ve))]})}function useConnectionResolver(){const oe=compilerRuntimeExports.c(2),[ne]=useConnections();let ce;return oe[0]!==ne?(ce=ue=>lodashExports$1.find(ne,ue),oe[0]=ne,oe[1]=ce):ce=oe[1],ce}function useConnection(oe){const ne=compilerRuntimeExports.c(3),ce=useConnectionResolver();let ue;return ne[0]!==oe||ne[1]!==ce?(ue=ce({url:oe}),ne[0]=oe,ne[1]=ce,ne[2]=ue):ue=ne[2],ue}function useMapContent(oe){const ne=compilerRuntimeExports.c(19),ce=useSnackbar(),ue=useLoadingState("map"),pe=useConnectionResolver();let me,ge;ne[0]!==pe||ne[1]!==ce?(ge=async Ie=>{const{source:ke,id:Be}=Ie===void 0?{}:Ie;if(ke&&Be){const Ne=pe({url:ke});if(Ne){ce("Fetching map...");const Fe=await Ne.transport().call("features/map",{id:Be});return Fe==null?void 0:Fe.content}}},ne[0]=pe,ne[1]=ce,ne[2]=ge):ge=ne[2];let ve;ne[3]!==ge?(ve=memoizee$1(ge,{normalizer:JSON.stringify}),ne[3]=ge,ne[4]=ve):ve=ne[4],me=ve;const ye=me;let xe;ne[5]!==oe?(xe=oe??{},ne[5]=oe,ne[6]=xe):xe=ne[6];const{content:_e,source:we,id:$e}=xe;let Re;ne[7]!==ue||ne[8]!==$e||ne[9]!==oe||ne[10]!==_e||ne[11]!==ye||ne[12]!==we?(Re=()=>ue(async()=>{if($e)return{...oe,content:_e||await ye({source:we,id:$e})}}),ne[7]=ue,ne[8]=$e,ne[9]=oe,ne[10]=_e,ne[11]=ye,ne[12]=we,ne[13]=Re):Re=ne[13];let Ae;return ne[14]!==ye||ne[15]!==_e||ne[16]!==we||ne[17]!==$e?(Ae=[ye,_e,we,$e],ne[14]=ye,ne[15]=_e,ne[16]=we,ne[17]=$e,ne[18]=Ae):Ae=ne[18],useAsync(Re,Ae)}const noop$7=()=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{});function useMapOptions(oe){const ne=compilerRuntimeExports.c(7);let ce;ne[0]!==oe?(ce=oe??{},ne[0]=oe,ne[1]=ce):ce=ne[1];const{format:ue}=ce;let pe;ne[2]!==ue||ne[3]!==oe?(pe=async()=>{var ge,ve;return await((ve=(ge=getParser(ue))==null?void 0:ge.editor)==null?void 0:ve.call(ge,oe==null?void 0:oe.content))??noop$7},ne[2]=ue,ne[3]=oe,ne[4]=pe):pe=ne[4];let me;return ne[5]!==oe?(me=[oe],ne[5]=oe,ne[6]=me):me=ne[6],useAsync(pe,me)}function useParsedMap(oe,ne){const ce=useSnackbar(),ue=useTheme$1(),pe=useLoadingState("map"),{format:me,content:ge}=oe??{};return useAsync(()=>pe(async()=>{var ve,ye;if(me&&ge){ce("Processing map...");try{const xe=await((ye=(ve=getParser(me))==null?void 0:ve.parse)==null?void 0:ye.call(ve,ge,{color:ue.palette.text.primary,background:ue.palette.background.paper,...ne}))??{nodes:[]};return ce("Map loaded",`${xe.nodes.length} elements, ${xe.log.join(", ")}`),xe}catch(xe){return console.error(xe),ce("Error parsing",lodashExports$1.get(xe,"message")),{error:lodashExports$1.get(xe,"message")}}}}),[me,ge,ue,ne])}const controller$2={key:"map",icon:jsxRuntimeExports.jsx(MapTwoTone,{}),inferName:oe=>{var ne;return(ne=oe==null?void 0:oe.source)!=null&&ne.map?`${oe.source.map.name} (${lodashExports$1.startCase(oe.source.map.format)})`:"Untitled Map"},error:oe=>{var ne,ce;return(ce=(ne=oe==null?void 0:oe.source)==null?void 0:ne.parsedMap)==null?void 0:ce.error},claimImportedFile:async oe=>lodashExports$1.keys(mapParsers).includes(ext$1(oe.name))?{claimed:!0,layer:async ne=>{ne("Opening map...");try{return{map:{...await readUploadedMap(oe,lodashExports$1.entries(mapParsers).map(([ue])=>({id:ue}))).read()}}}catch(ce){return console.error(ce),ne(`Error opening, ${lodashExports$1.get(ce,"message")}`),{map:{key:nanoid$1(),id:custom$1().id,error:lodashExports$1.get(ce,"message"),name:lodashExports$1.startCase(name$2(oe.name))}}}}}:{claimed:!1},editor:withProduce(({value:oe,produce:ne})=>{var pe,me,ge,ve,ye,xe,_e,we;const{result:ce}=useMapContent((pe=oe==null?void 0:oe.source)==null?void 0:pe.map),{result:ue}=useMapOptions(ce);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Option,{label:"Source",content:jsxRuntimeExports.jsx(MapPicker,{value:(me=oe==null?void 0:oe.source)==null?void 0:me.map,onChange:$e=>ne(Re=>lodashExports$1.set(Re,"source.map",$e))})}),((ve=(ge=oe==null?void 0:oe.source)==null?void 0:ge.parsedMap)==null?void 0:ve.error)&&jsxRuntimeExports.jsx(Type$2,{component:"div",variant:"body2",color:$e=>$e.palette.error.main,sx:{whiteSpace:"pre-wrap",mb:1,mt:1},children:jsxRuntimeExports.jsx("code",{children:(xe=(ye=oe==null?void 0:oe.source)==null?void 0:ye.parsedMap)==null?void 0:xe.error})}),!!((_e=oe==null?void 0:oe.source)!=null&&_e.map)&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Heading,{label:"Map Options"}),ue?jsxRuntimeExports.jsx(ue,{value:(we=oe==null?void 0:oe.source)==null?void 0:we.options,onChange:$e=>ne(Re=>{var Ae;lodashExports$1.set(Re,"source.options",$e(((Ae=Re.source)==null?void 0:Ae.options)??{}))})}):jsxRuntimeExports.jsx(CircularProgress$1,{sx:{mt:2}})]})]})}),renderer:({layer:oe,index:ne})=>{var pe;const{nodes:ce}=((pe=oe==null?void 0:oe.source)==null?void 0:pe.parsedMap)??{},ue=reactExports.useMemo(()=>[lodashExports$1.map(ce,me=>({...me,meta:{...me.meta,sourceLayer:oe==null?void 0:oe.key,sourceLayerIndex:ne,sourceLayerAlpha:1-.01*+((oe==null?void 0:oe.transparency)??0),sourceLayerDisplayMode:(oe==null?void 0:oe.displayMode)??"source-over"}}))],[ce,ne,oe==null?void 0:oe.transparency,oe==null?void 0:oe.displayMode]);return jsxRuntimeExports.jsx(NodeList,{nodes:ue})},service:withProduce(({value:oe,produce:ne})=>{var pe,me;const{result:ce}=useMapContent((pe=oe==null?void 0:oe.source)==null?void 0:pe.map),{result:ue}=useParsedMap(ce,(me=oe==null?void 0:oe.source)==null?void 0:me.options);return useEffectWhen(()=>void ne(ge=>{lodashExports$1.set(ge,"source.parsedMap",ue),lodashExports$1.set(ge,"viewKey",nanoid$1())}),[ue,ne],[ue]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{})}),provideSelectionInfo:({children:oe,event:ne,layer:ce})=>{const{layer:ue,setLayer:pe,layers:me}=useLayer(ce),{parsedMap:ge}=(ue==null?void 0:ue.source)??{},{point:ve,node:ye}=reactExports.useMemo(()=>{var _e,we,$e,Re;if(ge&&ne){const Ae=(Re=($e=getParser((we=(_e=ue==null?void 0:ue.source)==null?void 0:_e.map)==null?void 0:we.format))==null?void 0:$e.hydrate)==null?void 0:Re.call($e,ge);if(Ae){const Ie=(ne==null?void 0:ne.world)&&Ae.snap(ne.world);if(Ie){const ke=(ne==null?void 0:ne.world)&&Ae.nodeAt(Ie);return{point:Ie,node:ke}}}}return{}},[ge,ne]),xe=reactExports.useMemo(()=>({...ue&&ve&&!lodashExports$1.isUndefined(ye)&&{[ue.key]:{primary:inferLayerName(ue),items:{point:{primary:"Point",secondary:`(${lodashExports$1.round(ve.x,2)}, ${lodashExports$1.round(ve.y,2)})`}}}}}),[ve,ye,ue,me,pe]);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:oe==null?void 0:oe(xe)})},getSources:oe=>{var ue,pe;const ne=(ue=oe==null?void 0:oe.source)==null?void 0:ue.map,ce=(pe=oe==null?void 0:oe.source)==null?void 0:pe.parsedMap;return ne?[{id:"map",name:`(Source) ${ne.name}`,language:"txt",content:ce==null?void 0:ce.content}]:[]},onEditSource:(oe,ne,ce)=>oe};/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function isNothing(oe){return typeof oe>"u"||oe===null}function isObject$3(oe){return typeof oe=="object"&&oe!==null}function toArray$2(oe){return Array.isArray(oe)?oe:isNothing(oe)?[]:[oe]}function extend$2(oe,ne){var ce,ue,pe,me;if(ne)for(me=Object.keys(ne),ce=0,ue=me.length;ce+pe);return ue<-2||ue>4?jsxRuntimeExports.jsxs("span",{children:[ce,"x10",jsxRuntimeExports.jsx("sup",{style:supProps,children:ue})]}):lodashExports$1.round(oe,2)}else return oe;case"string":return`${oe}`;case"undefined":return"null";default:return ne?jsxRuntimeExports.jsx("code",{children:lodashExports$1.isNull(oe)?"null":lodashExports$1.get(oe,"constructor.name")??typeof oe}):jsxRuntimeExports.jsx("code",{style:{whiteSpace:"pre"},children:lodashExports$1.truncate(beautify$1(oe,void 0,2),{length:100})})}}function Property(oe){const ne=compilerRuntimeExports.c(17),{label:ce,value:ue,type:pe,simple:me}=oe,ge=`${ce}::${renderProperty(ue)}`,ve=pe==null?void 0:pe.sx;let ye;ne[0]!==ve?(ye={opacity:.54,...ve},ne[0]=ve,ne[1]=ye):ye=ne[1];let xe;ne[2]!==pe||ne[3]!==ye||ne[4]!==ce?(xe=jsxRuntimeExports.jsx(Type$2,{component:"div",variant:"body2",...pe,sx:ye,children:ce}),ne[2]=pe,ne[3]=ye,ne[4]=ce,ne[5]=xe):xe=ne[5];let _e;ne[6]===Symbol.for("react.memo_cache_sentinel")?(_e=jsxRuntimeExports.jsx(Space,{}),ne[6]=_e):_e=ne[6];let we;ne[7]!==ue||ne[8]!==me?(we=renderProperty(ue,me)??"none",ne[7]=ue,ne[8]=me,ne[9]=we):we=ne[9];let $e;ne[10]!==pe||ne[11]!==we?($e=jsxRuntimeExports.jsx(Type$2,{component:"div",variant:"body2",...pe,children:we}),ne[10]=pe,ne[11]=we,ne[12]=$e):$e=ne[12];let Re;return ne[13]!==ge||ne[14]!==xe||ne[15]!==$e?(Re=jsxRuntimeExports.jsxs(Flex,{width:"auto",mr:2,mb:.5,alignItems:"baseline",children:[xe,_e,$e]},ge),ne[13]=ge,ne[14]=xe,ne[15]=$e,ne[16]=Re):Re=ne[16],Re}const COMMON_PROPS=["type"],OMIT_PROPS=[...COMMON_PROPS,"id"],ESSENTIAL_PROPS=["id"],GRAPH_PROPS=[...ESSENTIAL_PROPS,"pId"],HEURISTIC_PROPS=["f","g"],ALL_PROPS=[...OMIT_PROPS,...GRAPH_PROPS,...HEURISTIC_PROPS],sortEventKeys=oe=>lodashExports$1.chain(oe).entries().filter(([,ne])=>!lodashExports$1.isUndefined(ne)).sortBy(([ne])=>lodashExports$1.indexOf(ALL_PROPS,ne)+1||Number.MAX_SAFE_INTEGER).value();function PropertyDialog(oe){const ne=compilerRuntimeExports.c(19);let ce,ue,pe;if(ne[0]!==oe){const{event:_e,max:we,simple:$e,variant:Re,...Ae}=oe;ue=_e,ce=we,pe=Ae,ne[0]=oe,ne[1]=ce,ne[2]=ue,ne[3]=pe}else ce=ne[1],ue=ne[2],pe=ne[3];const me=ce===void 0?10:ce;let ge,ve,ye;if(ne[4]!==ue||ne[5]!==me||ne[6]!==pe){const _e=sortEventKeys(ue);ge=ManagedModal;let we;ne[10]===Symbol.for("react.memo_cache_sentinel")?(we=jsxRuntimeExports.jsx(AppBarTitle,{children:"Event Properties"}),ne[10]=we):we=ne[10],ve=lodashExports$1.merge({appBar:{children:we},trigger:ke=>jsxRuntimeExports.jsxs(MuiButton,{variant:"text",sx:{mx:-1,minWidth:0,width:"fit-content",color:Be=>Be.palette.text.secondary,justifyContent:"left"},onClick:Be=>{Be.stopPropagation(),Be.preventDefault(),ke(Be)},children:[_e.length-me," more"]})},pe);let $e;ne[11]===Symbol.for("react.memo_cache_sentinel")?($e=ke=>{const[Be]=ke;return COMMON_PROPS.includes(Be)},ne[11]=$e):$e=ne[11];let Re;ne[12]===Symbol.for("react.memo_cache_sentinel")?(Re=ke=>{const[Be]=ke;return GRAPH_PROPS.includes(Be)},ne[12]=Re):Re=ne[12];let Ae;ne[13]===Symbol.for("react.memo_cache_sentinel")?(Ae=ke=>{const[Be]=ke;return HEURISTIC_PROPS.includes(Be)},ne[13]=Ae):Ae=ne[13];let Ie;ne[14]===Symbol.for("react.memo_cache_sentinel")?(Ie=ke=>{const[Be]=ke;return!ALL_PROPS.includes(Be)},ne[14]=Ie):Ie=ne[14],ye=[{name:"common",props:lodashExports$1.filter(_e,$e)},{name:"Graph",props:lodashExports$1.filter(_e,Re)},{name:"Heuristic",props:lodashExports$1.filter(_e,Ae)},{name:"other",props:lodashExports$1.filter(_e,Ie)}].map((ke,Be)=>{const{name:Ne,props:Fe}=ke;return jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[!!Be&&jsxRuntimeExports.jsx(Divider$1,{sx:{mb:1}}),jsxRuntimeExports.jsx(Type$2,{component:"div",variant:"overline",color:"text.secondary",sx:{px:3},children:lodashExports$1.startCase(Ne)}),jsxRuntimeExports.jsx(Box$1,{sx:{p:1,pt:0,display:"grid",gridAutoFlow:"row",gridTemplateColumns:"repeat(2, 1fr)"},children:lodashExports$1.map(Fe,Ue=>{const[qe,We]=Ue;return jsxRuntimeExports.jsx(ListItem$1,{sx:{py:.5},children:jsxRuntimeExports.jsx(ListItemText$1,{secondary:qe,primary:renderProperty(We)})},`${qe}::${We}`)})},Ne)]},Ne)}),ne[4]=ue,ne[5]=me,ne[6]=pe,ne[7]=ge,ne[8]=ve,ne[9]=ye}else ge=ne[7],ve=ne[8],ye=ne[9];let xe;return ne[15]!==ge||ne[16]!==ve||ne[17]!==ye?(xe=jsxRuntimeExports.jsx(ge,{...ve,children:ye}),ne[15]=ge,ne[16]=ve,ne[17]=ye,ne[18]=xe):xe=ne[18],xe}function PropertyList(oe){const ne=compilerRuntimeExports.c(32);let ce,ue,pe,me,ge,ve;ne[0]!==oe?({event:pe,variant:ce,max:ue,simple:ve,primitives:ge,...me}=oe,ne[0]=oe,ne[1]=ce,ne[2]=ue,ne[3]=pe,ne[4]=me,ne[5]=ge,ne[6]=ve):(ce=ne[1],ue=ne[2],pe=ne[3],me=ne[4],ge=ne[5],ve=ne[6]);const ye=ce===void 0?"body2":ce,xe=ue===void 0?10:ue;let _e,we,$e,Re;if(ne[7]!==pe||ne[8]!==me||ne[9]!==ge||ne[10]!==xe||ne[11]!==ye||ne[12]!==ve){_e=sortEventKeys(pe),we=Flex,$e=me;let ke;ne[17]!==ge?(ke=ge?Ne=>{const[,Fe]=Ne;return isPrimitive(Fe)}:lodashExports$1.constant(!0),ne[17]=ge,ne[18]=ke):ke=ne[18];let Be;ne[19]!==ye||ne[20]!==ve?(Be=(Ne,Fe)=>{const[Ue,qe]=Ne;return jsxRuntimeExports.jsx(Property,{label:Ue,value:qe,type:{variant:ye},simple:ve},Fe)},ne[19]=ye,ne[20]=ve,ne[21]=Be):Be=ne[21],Re=lodashExports$1.chain(_e).filter(ke).slice(0,xe).map(Be).value(),ne[7]=pe,ne[8]=me,ne[9]=ge,ne[10]=xe,ne[11]=ye,ne[12]=ve,ne[13]=_e,ne[14]=we,ne[15]=$e,ne[16]=Re}else _e=ne[13],we=ne[14],$e=ne[15],Re=ne[16];let Ae;ne[22]!==_e.length||ne[23]!==xe||ne[24]!==ve||ne[25]!==oe?(Ae=_e.length>xe&&!ve&&jsxRuntimeExports.jsx(PropertyDialog,{...oe}),ne[22]=_e.length,ne[23]=xe,ne[24]=ve,ne[25]=oe,ne[26]=Ae):Ae=ne[26];let Ie;return ne[27]!==we||ne[28]!==$e||ne[29]!==Re||ne[30]!==Ae?(Ie=jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs(we,{...$e,children:[Re,Ae]})}),ne[27]=we,ne[28]=$e,ne[29]=Re,ne[30]=Ae,ne[31]=Ie):Ie=ne[31],Ie}function isPrimitive(oe){return lodashExports$1.isString(oe)||lodashExports$1.isNumber(oe)}var t$2,e$2,s$2,i$5;(function(oe){oe.HEX="HEX",oe.RGB="RGB",oe.HSL="HSL",oe.CIELab="CIELab",oe.CMYK="CMYK"})(t$2||(t$2={})),function(oe){oe.ANALOGOUS="ANALOGOUS",oe.COMPLEMENTARY="COMPLEMENTARY",oe.SPLIT_COMPLEMENTARY="SPLIT_COMPLEMENTARY",oe.TRIADIC="TRIADIC",oe.TETRADIC="TETRADIC",oe.SQUARE="SQUARE"}(e$2||(e$2={})),function(oe){oe.ADDITIVE="ADDITIVE",oe.SUBTRACTIVE="SUBTRACTIVE"}(s$2||(s$2={})),function(oe){oe.black="#000000",oe.silver="#C0C0C0",oe.gray="#808080",oe.white="#FFFFFF",oe.maroon="#800000",oe.red="#FF0000",oe.purple="#800080",oe.fuchsia="#FF00FF",oe.green="#008000",oe.lime="#00FF00",oe.olive="#808000",oe.yellow="#FFFF00",oe.navy="#000080",oe.blue="#0000FF",oe.teal="#008080",oe.aqua="#00FFFF",oe.orange="#FFA500",oe.aliceblue="#F0F8FF",oe.antiquewhite="#FAEBD7",oe.aquamarine="#7FFFD4",oe.azure="#F0FFFF",oe.beige="#F5F5DC",oe.bisque="#FFE4C4",oe.blanchedalmond="#FFEBCD",oe.blueviolet="#8A2BE2",oe.brown="#A52A2A",oe.burlywood="#DEB887",oe.cadetblue="#5F9EA0",oe.chartreuse="#7FFF00",oe.chocolate="#D2691E",oe.coral="#FF7F50",oe.cornflowerblue="#6495ED",oe.cornsilk="#FFF8DC",oe.crimson="#DC143C",oe.cyan="#00FFFF",oe.darkblue="#00008B",oe.darkcyan="#008B8B",oe.darkgoldenrod="#B8860B",oe.darkgray="#A9A9A9",oe.darkgreen="#006400",oe.darkgrey="#A9A9A9",oe.darkkhaki="#BDB76B",oe.darkmagenta="#8B008B",oe.darkolivegreen="#556B2F",oe.darkorange="#FF8C00",oe.darkorchid="#9932CC",oe.darkred="#8B0000",oe.darksalmon="#E9967A",oe.darkseagreen="#8FBC8F",oe.darkslateblue="#483D8B",oe.darkslategray="#2F4F4F",oe.darkslategrey="#2F4F4F",oe.darkturquoise="#00CED1",oe.darkviolet="#9400D3",oe.deeppink="#FF1493",oe.deepskyblue="#00BFFF",oe.dimgray="#696969",oe.dimgrey="#696969",oe.dodgerblue="#1E90FF",oe.firebrick="#B22222",oe.floralwhite="#FFFAF0",oe.forestgreen="#228B22",oe.gainsboro="#DCDCDC",oe.ghostwhite="#F8F8FF",oe.gold="#FFD700",oe.goldenrod="#DAA520",oe.greenyellow="#ADFF2F",oe.grey="#808080",oe.honeydew="#F0FFF0",oe.hotpink="#FF69B4",oe.indianred="#CD5C5C",oe.indigo="#4B0082",oe.ivory="#FFFFF0",oe.khaki="#F0E68C",oe.lavender="#E6E6FA",oe.lavenderblush="#FFF0F5",oe.lawngreen="#7CFC00",oe.lemonchiffon="#FFFACD",oe.lightblue="#ADD8E6",oe.lightcoral="#F08080",oe.lightcyan="#E0FFFF",oe.lightgoldenrodyellow="#FAFAD2",oe.lightgray="#D3D3D3",oe.lightgreen="#90EE90",oe.lightgrey="#D3D3D3",oe.lightpink="#FFB6C1",oe.lightsalmon="#FFA07A",oe.lightseagreen="#20B2AA",oe.lightskyblue="#87CEFA",oe.lightslategray="#778899",oe.lightslategrey="#778899",oe.lightsteelblue="#B0C4DE",oe.lightyellow="#FFFFE0",oe.limegreen="#32CD32",oe.linen="#FAF0E6",oe.magenta="#FF00FF",oe.mediumaquamarine="#66CDAA",oe.mediumblue="#0000CD",oe.mediumorchid="#BA55D3",oe.mediumpurple="#9370DB",oe.mediumseagreen="#3CB371",oe.mediumslateblue="#7B68EE",oe.mediumspringgreen="#00FA9A",oe.mediumturquoise="#48D1CC",oe.mediumvioletred="#C71585",oe.midnightblue="#191970",oe.mintcream="#F5FFFA",oe.mistyrose="#FFE4E1",oe.moccasin="#FFE4B5",oe.navajowhite="#FFDEAD",oe.oldlace="#FDF5E6",oe.olivedrab="#6B8E23",oe.orangered="#FF4500",oe.orchid="#DA70D6",oe.palegoldenrod="#EEE8AA",oe.palegreen="#98FB98",oe.paleturquoise="#AFEEEE",oe.palevioletred="#DB7093",oe.papayawhip="#FFEFD5",oe.peachpuff="#FFDAB9",oe.peru="#CD853F",oe.pink="#FFC0CB",oe.plum="#DDA0DD",oe.powderblue="#B0E0E6",oe.rosybrown="#BC8F8F",oe.royalblue="#4169E1",oe.saddlebrown="#8B4513",oe.salmon="#FA8072",oe.sandybrown="#F4A460",oe.seagreen="#2E8B57",oe.seashell="#FFF5EE",oe.sienna="#A0522D",oe.skyblue="#87CEEB",oe.slateblue="#6A5ACD",oe.slategray="#708090",oe.slategrey="#708090",oe.snow="#FFFAFA",oe.springgreen="#00FF7F",oe.steelblue="#4682B4",oe.tan="#D2B48C",oe.thistle="#D8BFD8",oe.tomato="#FF6347",oe.turquoise="#40E0D0",oe.violet="#EE82EE",oe.wheat="#F5DEB3",oe.whitesmoke="#F5F5F5",oe.yellowgreen="#9ACD32",oe.rebeccapurple="#663399"}(i$5||(i$5={}));const a$3=Object.keys(i$5),r$2={HEX:["R","G","B","A"],RGB:["R","G","B","A"],HSL:["H","S","L","A"],CIELab:["L","a","b","A"],CMYK:["C","M","Y","K","A"]},n$2={BGR:t$2.RGB,ABGR:t$2.RGB,HLS:t$2.HSL,AHLS:t$2.HSL,LAB:t$2.CIELab,ALAB:t$2.CIELab,CKMY:t$2.CMYK,ACKMY:t$2.CMYK};var c$2;(function(oe){oe.NUMBER="number",oe.BOOLEAN="boolean"})(c$2||(c$2={}));const o$3={[t$2.HEX]:/^#(?:([a-f\d])([a-f\d])([a-f\d])([a-f\d])?|([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?)$/i,[t$2.RGB]:/^rgba?\s*\(\s*(?:((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)(?:\s*,\s*((?:\d*\.)?\d+))?|((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)(?:\s*\/\s*((?:\d*\.)?\d+%?))?)\s*\)$/,[t$2.HSL]:/^hsla?\s*\(\s*(?:(-?(?:\d*\.)?\d+(?:deg|grad|rad|turn)?)\s*,\s*((?:\d*\.)?\d+)%\s*,\s*((?:\d*\.)?\d+)%(?:\s*,\s*((?:\d*\.)?\d+))?|(-?(?:\d*\.)?\d+(?:deg|grad|rad|turn)?)\s*((?:\d*\.)?\d+)%\s*((?:\d*\.)?\d+)%(?:\s*\/\s*((?:\d*\.)?\d+%?))?)\s*\)$/,[t$2.CIELab]:/^lab\s*\(\s*(?:((?:\d*\.)?\d+%?)\s*(-?(?:\d*\.)?\d+%?)\s*(-?(?:\d*\.)?\d+%?)(?:\s*\/\s*((?:\d*\.)?\d+%?))?)\s*\)$/,[t$2.CMYK]:/^(?:device-cmyk|cmyk)\s*\(\s*(?:((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)(?:\s*,\s*((?:\d*\.)?\d+))?|((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)(?:\s*\/\s*((?:\d*\.)?\d+%?))?)\s*\)$/},A$3=/^(-?(?:\d*\.)?\d+)((?:deg|grad|rad|turn)?)$/,h$2=/^(-?\d+(?:\.\d+)?|-?\.\d+)%$/,u$2=/^0x([a-f\d]{1,2})$/i,d$4=/\{(\d+)\}/g,l$2=/,( +|\d+)/g,E$2=/ +/,m$2="The provided string color doesn't have a correct format",b$3="The provided color object doesn't have the proper keys or format";var C$2,L$2,g$3;(function(oe){oe.NONE="none",oe.DEGREES="deg",oe.GRADIANS="grad",oe.RADIANS="rad",oe.TURNS="turn"})(C$2||(C$2={})),function(oe){oe.NONE="none",oe.PERCENT="percent"}(L$2||(L$2={})),function(oe){oe.DEVICE_CMYK="device-cmyk",oe.CMYK="cmyk"}(g$3||(g$3={}));const B$2={decimals:6,legacyCSS:!1,spacesAfterCommas:!1,anglesUnit:C$2.NONE,rgbUnit:L$2.NONE,labUnit:L$2.NONE,cmykUnit:L$2.PERCENT,alphaUnit:L$2.NONE,cmykFunction:g$3.DEVICE_CMYK},p$2=(oe,ne)=>Object.prototype.hasOwnProperty.call(oe,ne),H$3=oe=>+`${oe}`.replace(h$2,"$1"),F$2=oe=>h$2.test(`${oe}`)?H$3(oe):Math.min(+oe,100),R$2=oe=>(oe.length===1&&(oe+=oe),parseInt(oe,16)),S$3=oe=>{const ne=D$2(oe,0).toString(16).toUpperCase();return ne.length===1?`0x0${ne}`:`0x${ne}`},I$2=(oe,ne=!1)=>!ne&&h$2.test(oe)?Math.min(255*H$3(oe)/100,255):u$2.test(oe)?(oe.length===3&&(oe+=oe.slice(-1)),ne?D$2(oe)/255:D$2(oe)):Math.min(+oe,ne?1:255),G$2=oe=>h$2.test(oe)?f$3(125*H$3(oe)/100,-125,125):f$3(+oe,-125,125),M$3=oe=>Math.min(h$2.test(oe)?H$3(oe)/100:+oe,1),y$2=oe=>[...oe].sort().join("").toUpperCase(),D$2=(oe,ne=6)=>{const ce=Math.pow(10,ne);return Math.round(+oe*ce)/ce},f$3=(oe,ne,ce)=>Math.max(ne,Math.min(oe,ce)),O$1=oe=>{if(typeof oe=="string"){const ne=oe.match(A$3),ce=+ne[1];switch(ne[2]){case C$2.RADIANS:oe=D$2(180*ce/Math.PI);break;case C$2.TURNS:oe=D$2(360*ce);break;case C$2.GRADIANS:oe=D$2(.9*ce);break;case C$2.DEGREES:default:oe=ce}}return(oe>360||oe<0)&&(oe-=360*Math.floor(oe/360)),oe},Y$2=(oe,ne)=>{let ce;switch(ne){case C$2.RADIANS:ce=D$2((ue=>ue*Math.PI/180)(oe));break;case C$2.TURNS:ce=D$2(oe/360);break;case C$2.GRADIANS:ce=D$2(10/9*oe);break;case C$2.DEGREES:case C$2.NONE:default:ce=oe}return ce},k$3=(oe,...ne)=>{const ce=[],ue=[],pe=[],me=[],ge=[],ve=[],ye=Object.values(C$2),xe=Object.values(L$2),_e=Object.values(g$3),we={legacyCSS:0,spacesAfterCommas:0,cmykFunction:0};for(const $e of ne)if(typeof $e=="string"){if(ce.push($e),$e.includes(",")){we.legacyCSS++;const Re=$e.match(l$2);new Set(Re).size===1&&E$2.test(Re[0].slice(1))&&we.spacesAfterCommas++}if($e.match(o$3.HSL)){const Re=$e.match(o$3.HSL),Ae=Re[1]||Re[5],Ie=Re[8],ke=Ae.match(A$3)[2];ue.push(ke===""?C$2.NONE:ke),ve.push(h$2.test(Ie));continue}if(o$3.RGB.test($e)){const Re=$e.match(o$3.RGB),Ae=Re[1]||Re[5],Ie=Re[2]||Re[6],ke=Re[3]||Re[7],Be=Re[8];pe.push(h$2.test(Ae)&&h$2.test(Ie)&&h$2.test(ke)),ve.push(h$2.test(Be));continue}if(o$3.CIELab.test($e)){const Re=$e.match(o$3.CIELab),Ae=Re[1],Ie=Re[2],ke=Re[3],Be=Re[4];me.push(h$2.test(Ae)&&h$2.test(Ie)&&h$2.test(ke)),ve.push(h$2.test(Be));continue}if($e.match(o$3.CMYK)){const Re=$e.match(o$3.CMYK),Ae=Re[1]||Re[6],Ie=Re[2]||Re[7],ke=Re[3]||Re[8],Be=Re[4]||Re[9],Ne=Re[10];ge.push(h$2.test(Ae)&&h$2.test(Ie)&&h$2.test(ke)&&h$2.test(Be)),$e.startsWith("cmyk")&&we.cmykFunction++,ve.push(h$2.test(Ne))}}return{decimals:typeof oe.decimals===c$2.NUMBER?oe.decimals:B$2.decimals,legacyCSS:typeof oe.legacyCSS===c$2.BOOLEAN?oe.legacyCSS:!!(ce.length&&we.legacyCSS===ce.length)||B$2.legacyCSS,spacesAfterCommas:typeof oe.spacesAfterCommas===c$2.BOOLEAN?oe.spacesAfterCommas:!!(ce.length&&we.spacesAfterCommas===ce.length)||B$2.spacesAfterCommas,anglesUnit:oe.anglesUnit&&ye.includes(oe.anglesUnit)?oe.anglesUnit:new Set(ue).size===1?ue[0]:B$2.anglesUnit,rgbUnit:oe.rgbUnit&&xe.includes(oe.rgbUnit)?oe.rgbUnit:new Set(pe).size===1&&pe[0]?L$2.PERCENT:B$2.rgbUnit,labUnit:oe.labUnit&&xe.includes(oe.labUnit)?oe.labUnit:new Set(me).size===1&&me[0]?L$2.PERCENT:B$2.labUnit,cmykUnit:oe.cmykUnit&&xe.includes(oe.cmykUnit)?oe.cmykUnit:new Set(ge).size!==1||ge[0]?B$2.cmykUnit:L$2.NONE,alphaUnit:oe.alphaUnit&&xe.includes(oe.alphaUnit)?oe.alphaUnit:new Set(ve).size===1&&ve[0]?L$2.PERCENT:B$2.alphaUnit,cmykFunction:oe.cmykFunction&&_e.includes(oe.cmykFunction)?oe.cmykFunction:ge.length&&ge.length===we.cmykFunction?g$3.CMYK:B$2.cmykFunction}},K$2=oe=>`${oe}`in s$2,X$2=[[.4360747,.3850649,.1430804],[.2225045,.7168786,.0606169],[.0139322,.0971045,.7141733]],T$2=[[3.1338561,-1.6168667,-.4906146],[-.9787684,1.9161415,.033454],[.0719453,-.2289914,1.4052427]],N$3=X$2.map(oe=>oe.reduce((ne,ce)=>ne+ce,0)),$$3=(oe,ne,ce)=>(ce<0&&(ce+=6),ce>=6&&(ce-=6),D$2(ce<1?255*((ne-oe)*ce+oe):ce<3?255*ne:ce<4?255*((ne-oe)*(4-ce)+oe):255*oe)),j$3=oe=>oe<=.04045?oe/12.92:((oe+.055)/1.055)**2.4,U$2=oe=>oe<=.0031308?12.92*oe:1.055*oe**(1/2.4)-.055,w$3=(oe,ne,ce,ue)=>{const pe=[0,0,0],me=[oe,ne,ce];return ue.forEach((ge,ve)=>{ge.forEach((ye,xe)=>{pe[ve]+=ye*me[xe]})}),pe},x$2=(oe,ne,ce)=>{ne/=100;const ue=(ce/=100)<=.5?ce*(ne+1):ce+ne-ce*ne,pe=2*ce-ue;return{R:$$3(pe,ue,(oe/=60)+2),G:$$3(pe,ue,oe),B:$$3(pe,ue,oe-2)}},v$2=(oe,ne,ce,ue=1)=>{oe/=255,ne/=255,ce/=255,ue=Math.min(ue,1);const pe=Math.max(oe,ne,ce),me=Math.min(oe,ne,ce),ge=pe-me;let ve=0,ye=0;const xe=(pe+me)/2;if(ge!==0){switch(pe){case oe:ve=(ne-ce)/ge%6;break;case ne:ve=(ce-oe)/ge+2;break;case ce:ve=(oe-ne)/ge+4}ve=D$2(60*ve),ve<0&&(ve+=360),ye=ge/(1-Math.abs(2*xe-1))}return{H:ve,S:D$2(100*ye),L:D$2(100*xe),A:ue}},V$2=(oe,ne,ce)=>{const ue=[oe/255,ne/255,ce/255].map(j$3),pe=w$3(ue[0],ue[1],ue[2],X$2),me=((ge,ve,ye)=>{const xe=$e=>$e>.008856451679035631?Math.cbrt($e):$e/.12841854934601665+.13793103448275862,_e=xe(ge/N$3[0]),we=xe(ve/N$3[1]);return[116*we-16,500*(_e-we),200*(we-xe(ye/N$3[2]))]})(pe[0],pe[1],pe[2]);return{L:me[0],a:me[1],b:me[2]}},P$1=(oe,ne,ce)=>{const ue=((me,ge,ve)=>{const ye=$e=>$e>.20689655172413793?$e**3:.12841854934601665*($e-.13793103448275862),xe=(me+16)/116,_e=ge/500,we=ve/200;return[N$3[0]*ye(xe+_e),N$3[1]*ye(xe),N$3[2]*ye(xe-we)]})(oe,ne,ce),pe=w$3(ue[0],ue[1],ue[2],T$2).map(U$2);return{R:f$3(255*pe[0],0,255),G:f$3(255*pe[1],0,255),B:f$3(255*pe[2],0,255)}},q$2=(oe,ne,ce,ue)=>({R:D$2(255*(1-oe)*(ue=1-ue)),G:D$2(255*(1-ne)*ue),B:D$2(255*(1-ce)*ue)}),_$2=(oe,ne,ce)=>{oe/=255,ne/=255,ce/=255;const ue=1-Math.max(oe,ne,ce),pe=1-ue,me=pe&&(pe-ne)/pe,ge=pe&&(pe-ce)/pe;return{C:D$2(100*(pe&&(pe-oe)/pe)),M:D$2(100*me),Y:D$2(100*ge),K:D$2(100*ue)}},z$3=(oe,ne)=>{if(oe<0&&(oe+=360),oe>360&&(oe-=360),oe===360||oe===0)return oe;const ce=[[0,120],[120,180],[180,240],[240,360]],ue=[[0,60],[60,120],[120,240],[240,360]],pe=ne?ue:ce;let me=0,ge=0,ve=0,ye=0;return(ne?ce:ue).find((xe,_e)=>oe>=xe[0]&&oeoe?", ":",",W$2=(oe,ne)=>{const ce=y$2(Object.keys(oe));return r$2[n$2[ce]].reduce((ue,pe,me)=>{const ge=oe[pe];return ge!==void 0&&ue.push(ne(ge,me)),ue},[])},J$2=(oe,ne)=>oe.replace(d$4,(ce,ue)=>`${ne[+ue-1]}`),Z$2=(oe,ne,ce=!1)=>{const{alphaUnit:ue,legacyCSS:pe,decimals:me}=ne;return ue!==L$2.PERCENT||pe&&!ce?D$2(oe,me):`${D$2(100*oe,me)}%`},tt$2={[t$2.HEX]:oe=>{const ne=W$2(oe,ue=>(pe=>{let me=D$2(pe,0).toString(16).toUpperCase();return me.length===1&&(me=`0${me}`),me})(D$2(ue))),ce=ne.length===4?"#{1}{2}{3}{4}":"#{1}{2}{3}";return J$2(ce,ne)},[t$2.RGB]:(oe,ne)=>{const{decimals:ce,legacyCSS:ue,spacesAfterCommas:pe,rgbUnit:me}=ne,ge=Q$2(pe),ve=W$2(oe,(xe,_e)=>me===L$2.PERCENT&&_e<3?`${((we,$e)=>D$2(we/255*100,$e))(xe,ce)}%`:_e===3?Z$2(xe,ne):D$2(xe,ce)),ye=ue?ve.length===4?`rgba({1}${ge}{2}${ge}{3}${ge}{4})`:`rgb({1}${ge}{2}${ge}{3})`:ve.length===4?"rgb({1} {2} {3} / {4})":"rgb({1} {2} {3})";return J$2(ye,ve)},[t$2.HSL]:(oe,ne)=>{const{decimals:ce,legacyCSS:ue,spacesAfterCommas:pe,anglesUnit:me}=ne,ge=Q$2(pe),ve=W$2(oe,(xe,_e)=>_e===0&&me!==C$2.NONE?`${D$2(Y$2(xe,me),ce)}${me}`:_e===3?Z$2(xe,ne):D$2(xe,ce)),ye=ue?ve.length===4?`hsla({1}${ge}{2}%${ge}{3}%${ge}{4})`:`hsl({1}${ge}{2}%${ge}{3}%)`:ve.length===4?"hsl({1} {2}% {3}% / {4})":"hsl({1} {2}% {3}%)";return J$2(ye,ve)},[t$2.CIELab]:(oe,ne)=>{const{decimals:ce,labUnit:ue}=ne,pe=W$2(oe,(ge,ve)=>{if(ve===0){const ye=D$2(F$2(ge),ce);return ue===L$2.PERCENT?`${ye}%`:`${ye}`}return ve<3?ue===L$2.PERCENT?`${((ye,xe)=>D$2(ye/125*100,xe))(ge,ce)}%`:D$2(ge,ce):Z$2(ge,ne,!0)}),me=pe.length===4?"lab({1} {2} {3} / {4})":"lab({1} {2} {3})";return J$2(me,pe)},[t$2.CMYK]:(oe,ne)=>{const{decimals:ce,legacyCSS:ue,spacesAfterCommas:pe,cmykUnit:me,cmykFunction:ge}=ne,ve=Q$2(pe),ye=W$2(oe,(_e,we)=>me===L$2.PERCENT&&we<4?`${D$2(_e,ce)}%`:we===4?Z$2(_e,ne):D$2(_e/100,ce)),xe=ue?ye.length===5?`${ge}({1}${ve}{2}${ve}{3}${ve}{4}${ve}{5})`:`${ge}({1}${ve}{2}${ve}{3}${ve}{4})`:ye.length===5?`${ge}({1} {2} {3} {4} / {5})`:`${ge}({1} {2} {3} {4})`;return J$2(xe,ye)}},et$2=oe=>(typeof oe=="string"&&(oe=h$2.test(oe)?H$3(oe)/100:+oe),isNaN(+oe)||oe>1?1:D$2(oe)),st$1=(oe,ne,ce)=>ne.reduce((ue,pe)=>[...ue,{...oe,H:ce===s$2.ADDITIVE?O$1(oe.H+pe):O$1(z$3(z$3(oe.H,!1)+pe,!0))}],[{...oe}]),it$1=(oe,ne)=>st$1(oe,[30,-30],ne),at$1=(oe,ne)=>st$1(oe,[180],ne),rt$1=(oe,ne)=>st$1(oe,[150,-150],ne),nt$1=(oe,ne)=>st$1(oe,[120,-120],ne),ct$1=(oe,ne)=>st$1(oe,[60,-120,180],ne),ot$1=(oe,ne)=>st$1(oe,[90,-90,180],ne),At=oe=>typeof oe=="string"?(ne=>{let ce;if(Object.keys(t$2).some(ue=>{if(o$3[ue].test(ne))return ce=ue,!0}),!ce&&~a$3.indexOf(ne)&&(ce=t$2.HEX),!ce)throw new Error(m$2);return ce})(oe):(ne=>{let ce,ue=!1;const pe=y$2(Object.keys(ne));if(n$2[pe]&&(ce=n$2[pe]),ce&&ce===t$2.RGB){const me=Object.entries(ne).some(ve=>!u$2.test(`${ve[1]}`)),ge=Object.entries(ne).some(ve=>!(h$2.test(`${ve[1]}`)||!u$2.test(`${ve[1]}`)&&!isNaN(+ve[1])&&+ve[1]<=255));me&&ge&&(ue=!0),me||(ce=t$2.HEX)}if(!ce||ue)throw new Error(b$3);return ce})(oe),ht$1={[t$2.HEX](oe){const ne=(~a$3.indexOf(oe)?i$5[oe]:oe).match(o$3.HEX),ce={R:R$2(ne[1]||ne[5]),G:R$2(ne[2]||ne[6]),B:R$2(ne[3]||ne[7])},ue=ne[4]||ne[8];return ue!==void 0&&(ce.A=R$2(ue)/255),ce},[t$2.RGB](oe){const ne=oe.match(o$3.RGB),ce=I$2(ne[1]||ne[5]),ue=I$2(ne[2]||ne[6]),pe=I$2(ne[3]||ne[7]),me=ne[4]||ne[8],ge={R:Math.min(ce,255),G:Math.min(ue,255),B:Math.min(pe,255)};return me!==void 0&&(ge.A=et$2(me)),ge},[t$2.HSL](oe){const ne=oe.match(o$3.HSL),ce=O$1(ne[1]||ne[5]),ue=F$2(ne[2]||ne[6]),pe=F$2(ne[3]||ne[7]),me=ne[4]||ne[8],ge=x$2(ce,ue,pe);return me!==void 0&&(ge.A=et$2(me)),ge},[t$2.CIELab](oe){const ne=oe.match(o$3.CIELab),ce=F$2(ne[1]),ue=G$2(ne[2]),pe=G$2(ne[3]),me=ne[4],ge=P$1(ce,ue,pe);return me!==void 0&&(ge.A=et$2(me)),ge},[t$2.CMYK](oe){const ne=oe.match(o$3.CMYK),ce=M$3(ne[1]||ne[6]),ue=M$3(ne[2]||ne[7]),pe=M$3(ne[3]||ne[8]),me=M$3(ne[4]||ne[9]),ge=ne[5]||ne[10],ve=q$2(ce,ue,pe,me);return ge!==void 0&&(ve.A=et$2(ge)),ve}},ut$1={[t$2.HEX](oe){const ne={R:I$2(`${oe.R}`),G:I$2(`${oe.G}`),B:I$2(`${oe.B}`)};return p$2(oe,"A")&&(ne.A=Math.min(I$2(`${oe.A}`,!0),1)),ne},[t$2.RGB](oe){return this.HEX(oe)},[t$2.HSL](oe){const ne=F$2(`${oe.S}`),ce=F$2(`${oe.L}`),ue=x$2(O$1(oe.H),ne,ce);return p$2(oe,"A")&&(ue.A=et$2(oe.A)),ue},[t$2.CIELab](oe){const ne=F$2(`${oe.L}`),ce=G$2(`${oe.a}`),ue=G$2(`${oe.b}`),pe=P$1(ne,ce,ue);return p$2(oe,"A")&&(pe.A=et$2(oe.A)),pe},[t$2.CMYK](oe){const ne=M$3(`${oe.C}`),ce=M$3(`${oe.M}`),ue=M$3(`${oe.Y}`),pe=M$3(`${oe.K}`),me=q$2(ne,ce,ue,pe);return p$2(oe,"A")&&(me.A=et$2(oe.A)),me}},dt$1=(oe,ne=At(oe))=>typeof oe=="string"?ht$1[ne](oe):ut$1[ne](oe),lt={[t$2.HEX]:oe=>({R:S$3(oe.R),G:S$3(oe.G),B:S$3(oe.B)}),HEXA(oe){const ne=lt.HEX(oe);return ne.A=p$2(oe,"A")?S$3(255*oe.A):"0xFF",ne},[t$2.RGB](oe,ne){const ce=Ct(oe,ne);return p$2(ce,"A")&&delete ce.A,ce},RGBA(oe,ne){const ce=lt.RGB(oe,ne);return ce.A=p$2(oe,"A")?D$2(oe.A):1,ce},[t$2.HSL](oe,ne){const ce=v$2(oe.R,oe.G,oe.B);return delete ce.A,Lt(ce,ne)},HSLA(oe,ne){const ce=lt.HSL(oe,ne);return ce.A=p$2(oe,"A")?D$2(oe.A,ne):1,ce},[t$2.CIELab](oe,ne){const ce=V$2(oe.R,oe.G,oe.B);return gt(ce,ne)},CIELabA(oe,ne){const ce=lt.CIELab(oe,ne);return ce.A=p$2(oe,"A")?D$2(oe.A,ne):1,ce},[t$2.CMYK]:(oe,ne)=>Bt(_$2(oe.R,oe.G,oe.B),ne),CMYKA(oe,ne){const ce=lt.CMYK(oe,ne);return ce.A=p$2(oe,"A")?D$2(oe.A,ne):1,ce}},Et=(oe,ne,ce,ue)=>{const pe=At(oe),me=typeof oe=="string",ge=dt$1(oe,pe),ve=typeof oe=="string"&&p$2(ge,"A")||typeof oe!="string"&&p$2(oe,"A"),ye=v$2(ge.R,ge.G,ge.B,ge.A);ve||delete ye.A;const xe=ce?ye.L/(ne+1):(100-ye.L)/(ne+1),_e=Array(ne).fill(null).map((we,$e)=>({...ye,L:ye.L+xe*($e+1)*(1-2*+ce)}));switch(pe){case t$2.HEX:default:return _e.map(we=>{const $e=x$2(we.H,we.S,we.L);return ve&&($e.A=we.A),me?ve?tt$2.HEX({...$e,A:D$2(255*$e.A)}):tt$2.HEX($e):ve?lt.HEXA($e):lt.HEX($e)});case t$2.RGB:return _e.map(we=>{const $e=x$2(we.H,we.S,we.L);return ve&&($e.A=we.A),me?tt$2.RGB($e,ue):ve?lt.RGBA($e,ue.decimals):lt.RGB($e,ue.decimals)});case t$2.HSL:return _e.map(we=>me?tt$2.HSL(we,ue):ve?lt.HSLA({...x$2(we.H,we.S,we.L),A:we.A},ue.decimals):lt.HSL(x$2(we.H,we.S,we.L),ue.decimals));case t$2.CIELab:return _e.map(we=>{const $e=x$2(we.H,we.S,we.L);return me?tt$2.CIELab(ve?lt.CIELabA($e,ue.decimals):lt.CIELab($e,ue.decimals),ue):ve?lt.CIELabA({...$e,A:we.A},ue.decimals):lt.CIELab($e,ue.decimals)})}},mt={buildHarmony(oe,ne,ce,ue){const pe=At(oe),me=dt$1(oe,pe),ge=v$2(me.R,me.G,me.B,me.A),ve=typeof oe=="string"&&p$2(me,"A")||typeof oe!="string"&&p$2(oe,"A"),ye=typeof oe=="string";switch(pe){case t$2.HEX:default:return ve?this.HEXA(Lt(ge,0),ne,ce,ye):this.HEX(Lt(ge,0),ne,ce,ye);case t$2.HSL:return ve?this.HSLA(ge,ne,ce,ye,ue):this.HSL(ge,ne,ce,ye,ue);case t$2.RGB:return ve?this.RGBA(ge,ne,ce,ye,ue):this.RGB(ge,ne,ce,ye,ue);case t$2.CIELab:return ve?this.CIELabA(ge,ne,ce,ye,ue):this.CIELab(ge,ne,ce,ye,ue)}},[t$2.HEX]:(oe,ne,ce,ue)=>ne(oe,ce).map(pe=>ue?tt$2.HEX(x$2(pe.H,pe.S,pe.L)):lt.HEX(x$2(pe.H,pe.S,pe.L))),HEXA:(oe,ne,ce,ue)=>ne(oe,ce).map(pe=>ue?tt$2.HEX({...x$2(pe.H,pe.S,pe.L),A:255*et$2(pe.A)}):lt.HEXA({...x$2(pe.H,pe.S,pe.L),A:et$2(pe.A)})),[t$2.RGB]:(oe,ne,ce,ue,pe)=>ne(oe,ce).map(me=>ue?tt$2.RGB(x$2(me.H,me.S,me.L),pe):lt.RGB(x$2(me.H,me.S,me.L),pe.decimals)),RGBA:(oe,ne,ce,ue,pe)=>ne(oe,ce).map(me=>ue?tt$2.RGB({...x$2(me.H,me.S,me.L),A:et$2(me.A)},pe):lt.RGBA({...x$2(me.H,me.S,me.L),A:et$2(me.A)},pe.decimals)),[t$2.HSL]:(oe,ne,ce,ue,pe)=>ne(oe,ce).map(me=>ue?tt$2.HSL({H:me.H,S:me.S,L:me.L},pe):lt.HSL(x$2(me.H,me.S,me.L),pe.decimals)),HSLA:(oe,ne,ce,ue,pe)=>ne(oe,ce).map(me=>ue?tt$2.HSL({...me,A:et$2(me.A)},pe):lt.HSLA({...x$2(me.H,me.S,me.L),A:et$2(me.A)},pe.decimals)),[t$2.CIELab]:(oe,ne,ce,ue,pe)=>ne(oe,ce).map(me=>{const ge=x$2(me.H,me.S,me.L);return ue?tt$2.CIELab(V$2(ge.R,ge.G,ge.B),pe):lt.CIELab(ge,pe.decimals)}),CIELabA:(oe,ne,ce,ue,pe)=>ne(oe,ce).map(me=>{const ge=x$2(me.H,me.S,me.L);return ue?tt$2.CIELab({...V$2(ge.R,ge.G,ge.B),A:et$2(me.A)},pe):lt.CIELabA({...ge,A:et$2(me.A)},pe.decimals)})},bt={mix(oe,ne){const ce=oe.map(ge=>{const ve=At(ge);return dt$1(ge,ve)}),ue=ne===s$2.SUBTRACTIVE?ce.map(ge=>{const ve=((ye,xe,_e)=>{const we=Math.min(ye,xe,_e),$e=Math.min(255-ye,255-xe,255-_e),Re=ye-we,Ae=xe-we,Ie=_e-we,ke=Math.min(Re,Ae),Be=Re-ke,Ne=(Ae+ke)/2,Fe=(Ie+Ae-ke)/2,Ue=Math.max(Be,Ne,Fe)/Math.max(Re,Ae,Ie),qe=isNaN(Ue)||Ue===1/0||Ue<=0?1:Ue;return{R:Be/qe+$e,Y:Ne/qe+$e,B:Fe/qe+$e}})(ge.R,ge.G,ge.B);return p$2(ge,"A")&&(ve.A=ge.A),ve}):null;function pe(ge){const ve=ne===s$2.ADDITIVE?{R:0,G:0,B:0,A:0}:{R:0,Y:0,B:0,A:0};return ge.reduce((ye,xe)=>{const _e=p$2(xe,"A")?xe.A:1,we={R:Math.min(ye.R+xe.R*_e,255),B:Math.min(ye.B+xe.B*_e,255),A:1-(1-_e)*(1-ye.A)},$e="G"in ye?ye.G:ye.Y,Re="G"in xe?xe.G:xe.Y;return{...we,...ne===s$2.ADDITIVE?{G:Math.min($e+Re*_e,255)}:{Y:Math.min($e+Re*_e,255)}}},ve)}let me;if(ne===s$2.ADDITIVE)me=pe(ce);else{const ge=pe(ue);me=((ve,ye,xe)=>{const _e=Math.min(ve,ye,xe),we=Math.min(255-ve,255-ye,255-xe),$e=ve-_e,Re=ye-_e,Ae=xe-_e,Ie=Math.min(Re,Ae),ke=$e+Re-Ie,Be=Re+Ie,Ne=2*(Ae-Ie),Fe=Math.max(ke,Be,Ne)/Math.max($e,Re,Ae),Ue=isNaN(Fe)||Fe===1/0||Fe<=0?1:Fe;return{R:ke/Ue+we,G:Be/Ue+we,B:Ne/Ue+we}})(ge.R,ge.Y,ge.B),me.A=ge.A}return{R:D$2(me.R),G:D$2(me.G),B:D$2(me.B),A:f$3(me.A,0,1)}},[t$2.HEX](oe,ne,ce){const ue=this.mix(oe,ne);return delete ue.A,ce?tt$2.HEX(ue):lt.HEX(ue)},HEXA(oe,ne,ce){const ue=this.mix(oe,ne);return ue.A=ce?255*et$2(ue.A):et$2(ue.A),ce?tt$2.HEX(ue):lt.HEXA(ue)},[t$2.RGB](oe,ne,ce,ue){const pe=this.mix(oe,ne);return delete pe.A,ce?tt$2.RGB(pe,ue):lt.RGB(pe,ue.decimals)},RGBA(oe,ne,ce,ue){const pe=this.mix(oe,ne);return ce?tt$2.RGB(pe,ue):lt.RGBA(pe,ue.decimals)},[t$2.HSL](oe,ne,ce,ue){const pe=this.mix(oe,ne),me=v$2(pe.R,pe.G,pe.B);return delete pe.A,delete me.A,ce?tt$2.HSL(me,ue):lt.HSL(pe,ue.decimals)},HSLA(oe,ne,ce,ue){const pe=this.mix(oe,ne),me=v$2(pe.R,pe.G,pe.B,pe.A);return ce?tt$2.HSL(me,ue):lt.HSLA(pe,ue.decimals)},[t$2.CIELab](oe,ne,ce,ue){const pe=this.mix(oe,ne),me=V$2(pe.R,pe.G,pe.B);return delete pe.A,ce?tt$2.CIELab(me,ue):lt.CIELabA(pe,ue.decimals)},CIELabA(oe,ne,ce,ue){const pe=this.mix(oe,ne),me=V$2(pe.R,pe.G,pe.B);return p$2(pe,"A")&&(me.A=pe.A),ce?tt$2.CIELab(me,ue):lt.CIELabA(pe,ue.decimals)}},Ct=(oe,ne)=>({R:D$2(oe.R,ne),G:D$2(oe.G,ne),B:D$2(oe.B,ne),...p$2(oe,"A")?{A:D$2(oe.A,ne)}:{}}),Lt=(oe,ne)=>({H:D$2(oe.H,ne),S:D$2(oe.S,ne),L:D$2(oe.L,ne),...p$2(oe,"A")?{A:D$2(oe.A,ne)}:{}}),gt=(oe,ne)=>({L:D$2(oe.L,ne),a:D$2(oe.a,ne),b:D$2(oe.b,ne)}),Bt=(oe,ne)=>({C:D$2(oe.C,ne),M:D$2(oe.M,ne),Y:D$2(oe.Y,ne),K:D$2(oe.K,ne)}),pt=(oe,ne,ce,ue)=>ue(dt$1(oe,ne),ce),Ht=(oe,ne,ce,ue,pe)=>(ce<1&&(ce=5),((ge,ve,ye)=>{const xe=ye-1,_e=(ve.R-ge.R)/xe,we=(ve.G-ge.G)/xe,$e=(ve.B-ge.B)/xe,Re=et$2(ge.A),Ae=(et$2(ve.A)-Re)/xe;return Array(ye).fill(null).map((Ie,ke)=>ke===0?ge:ke===xe?ve:{R:D$2(ge.R+_e*ke),G:D$2(ge.G+we*ke),B:D$2(ge.B+$e*ke),A:D$2(Re+Ae*ke)})})(dt$1(oe),dt$1(ne),ce).map(ge=>pe(ge,ue))),Ft=(oe,ne,ce,ue)=>({[e$2.ANALOGOUS]:mt.buildHarmony(ne,it$1,ce,ue),[e$2.COMPLEMENTARY]:mt.buildHarmony(ne,at$1,ce,ue),[e$2.SPLIT_COMPLEMENTARY]:mt.buildHarmony(ne,rt$1,ce,ue),[e$2.TRIADIC]:mt.buildHarmony(ne,nt$1,ce,ue),[e$2.TETRADIC]:mt.buildHarmony(ne,ct$1,ce,ue),[e$2.SQUARE]:mt.buildHarmony(ne,ot$1,ce,ue)})[oe];class Rt{constructor(ne,ce={}){this._options=k$3(ce,ne),this.rgb=dt$1(ne),this.updateHSL(),this.updateLab(),this.updateCMYK()}updateRGB(){this.rgb={...x$2(this.hsl.H,this.hsl.S,this.hsl.L),A:this.hsl.A}}updateRGBFromCMYK(){this.rgb={...q$2(this.cmyk.C,this.cmyk.M,this.cmyk.Y,this.cmyk.K),A:this.rgb.A}}updateRGBFromLab(){this.rgb={...P$1(this.lab.L,this.lab.a,this.lab.b),A:this.rgb.A}}updateHSL(){this.hsl=v$2(this.rgb.R,this.rgb.G,this.rgb.B,this.rgb.A)}updateLab(){this.lab={...V$2(this.rgb.R,this.rgb.G,this.rgb.B),A:this.rgb.A}}updateCMYK(){this.cmyk=_$2(this.rgb.R,this.rgb.G,this.rgb.B)}setOptions(ne={}){return this._options={...this._options,...ne},this}setH(ne){return this.hsl.H=O$1(ne),this.updateRGB(),this.updateLab(),this.updateCMYK(),this}setS(ne){return this.hsl.S=f$3(ne,0,100),this.updateRGB(),this.updateLab(),this.updateCMYK(),this}setL(ne){return this.hsl.L=f$3(ne,0,100),this.updateRGB(),this.updateLab(),this.updateCMYK(),this}setR(ne){this.rgb.R=f$3(ne,0,255),this.updateHSL(),this.updateLab(),this.updateCMYK()}setG(ne){return this.rgb.G=f$3(ne,0,255),this.updateHSL(),this.updateLab(),this.updateCMYK(),this}setB(ne){return this.rgb.B=f$3(ne,0,255),this.updateHSL(),this.updateLab(),this.updateCMYK(),this}setCIEL(ne){return this.lab.L=f$3(ne,0,100),this.updateRGBFromLab(),this.updateHSL(),this.updateCMYK(),this}setCIEa(ne){return this.lab.a=f$3(ne,-125,125),this.updateRGBFromLab(),this.updateHSL(),this.updateCMYK(),this}setCIEb(ne){return this.lab.b=f$3(ne,-125,125),this.updateRGBFromLab(),this.updateHSL(),this.updateCMYK(),this}setA(ne){return this.hsl.A=this.rgb.A=f$3(ne,0,1),this}setC(ne){return this.cmyk.C=f$3(ne,0,100),this.updateRGBFromCMYK(),this.updateHSL(),this.updateLab(),this}setM(ne){return this.cmyk.M=f$3(ne,0,100),this.updateRGBFromCMYK(),this.updateHSL(),this.updateLab(),this}setY(ne){return this.cmyk.Y=f$3(ne,0,100),this.updateRGBFromCMYK(),this.updateHSL(),this.updateLab(),this}setK(ne){return this.cmyk.K=f$3(ne,0,100),this.updateRGBFromCMYK(),this.updateHSL(),this.updateLab(),this}get options(){return this._options}get H(){return D$2(this.hsl.H,this.options.decimals)}get S(){return D$2(this.hsl.S,this.options.decimals)}get L(){return D$2(this.hsl.L,this.options.decimals)}get CIEL(){return D$2(this.lab.L,this.options.decimals)}get CIEa(){return D$2(this.lab.a,this.options.decimals)}get CIEb(){return D$2(this.lab.b,this.options.decimals)}get R(){return D$2(this.rgb.R,this.options.decimals)}get G(){return D$2(this.rgb.G,this.options.decimals)}get B(){return D$2(this.rgb.B,this.options.decimals)}get A(){return D$2(this.hsl.A,this.options.decimals)}get C(){return D$2(this.cmyk.C,this.options.decimals)}get M(){return D$2(this.cmyk.M,this.options.decimals)}get Y(){return D$2(this.cmyk.Y,this.options.decimals)}get K(){return D$2(this.cmyk.K,this.options.decimals)}get HEXObject(){return lt.HEX(this.rgb)}get HEXAObject(){return lt.HEXA(this.rgb)}get RGBObject(){return{R:this.R,G:this.G,B:this.B}}get RGBAObject(){return{...this.RGBObject,A:this.A}}get HSLObject(){return{H:this.H,S:this.S,L:this.L}}get HSLAObject(){return{...this.HSLObject,A:this.A}}get CIELabObject(){return{L:this.CIEL,a:this.CIEa,b:this.CIEb}}get CIELabAObject(){return{...this.CIELabObject,A:this.A}}get CMYKObject(){return{C:this.C,M:this.M,Y:this.Y,K:this.K}}get CMYKAObject(){return{...this.CMYKObject,A:this.A}}get HEX(){return tt$2.HEX({R:this.R,G:this.G,B:this.B})}get HEXA(){return tt$2.HEX({R:this.R,G:this.G,B:this.B,A:255*this.A})}get RGB(){return tt$2.RGB({R:this.R,G:this.G,B:this.B},this.options)}get RGBA(){return tt$2.RGB({R:this.R,G:this.G,B:this.B,A:this.A},this.options)}get HSL(){return tt$2.HSL({H:this.H,S:this.S,L:this.L},this.options)}get HSLA(){return tt$2.HSL({H:this.H,S:this.S,L:this.L,A:this.A},this.options)}get CIELab(){return tt$2.CIELab({L:this.CIEL,a:this.CIEa,b:this.CIEb},this.options)}get CIELabA(){return tt$2.CIELab({L:this.CIEL,a:this.CIEa,b:this.CIEb,A:this.A},this.options)}get CMYK(){return tt$2.CMYK({C:this.C,M:this.M,Y:this.Y,K:this.K},this.options)}get CMYKA(){return tt$2.CMYK({C:this.C,M:this.M,Y:this.Y,K:this.K,A:this.A},this.options)}static toHEXObject(ne){const ce=At(ne);return pt(ne,ce,0,lt.HEX)}static toHEX(ne){return tt$2.HEX(Rt.toHEXObject(ne))}static toHEXAObject(ne){const ce=At(ne);return pt(ne,ce,0,lt.HEXA)}static toHEXA(ne){return tt$2.HEX(Rt.toHEXAObject(ne))}static toRGBObject(ne,ce={}){const ue=At(ne);return pt(ne,ue,ce.decimals,lt.RGB)}static toRGB(ne,ce={}){const ue=At(ne),pe=k$3(ce,ne),me=pt(ne,ue,ce.decimals,lt.RGB);return tt$2.RGB(me,pe)}static toRGBAObject(ne,ce={}){const ue=At(ne);return pt(ne,ue,ce.decimals,lt.RGBA)}static toRGBA(ne,ce={}){const ue=At(ne),pe=k$3(ce,ne),me=pt(ne,ue,ce.decimals,lt.RGBA);return tt$2.RGB(me,pe)}static toHSLObject(ne,ce={}){const ue=At(ne);return pt(ne,ue,ce.decimals,lt.HSL)}static toHSL(ne,ce={}){const ue=At(ne),pe=k$3(ce,ne),me=pt(ne,ue,ce.decimals,lt.HSL);return tt$2.HSL(me,pe)}static toHSLAObject(ne,ce={}){const ue=At(ne);return pt(ne,ue,ce.decimals,lt.HSLA)}static toHSLA(ne,ce={}){const ue=At(ne),pe=k$3(ce,ne),me=pt(ne,ue,ce.decimals,lt.HSLA);return tt$2.HSL(me,pe)}static toCIELabObject(ne,ce={}){const ue=At(ne);return pt(ne,ue,ce.decimals,lt.CIELab)}static toCIELab(ne,ce={}){const ue=At(ne),pe=k$3(ce,ne),me=pt(ne,ue,ce.decimals,lt.CIELab);return tt$2.CIELab(me,pe)}static toCIELabAObject(ne,ce={}){const ue=At(ne);return pt(ne,ue,ce.decimals,lt.CIELabA)}static toCIELabA(ne,ce={}){const ue=At(ne),pe=k$3(ce,ne),me=pt(ne,ue,ce.decimals,lt.CIELabA);return tt$2.CIELab(me,pe)}static toCMYKObject(ne,ce={}){const ue=At(ne);return pt(ne,ue,ce.decimals,lt.CMYK)}static toCMYK(ne,ce={}){const ue=At(ne),pe=k$3(ce,ne),me=pt(ne,ue,ce.decimals,lt.CMYK);return tt$2.CMYK(me,pe)}static toCMYKAObject(ne,ce={}){const ue=At(ne);return pt(ne,ue,ce.decimals,lt.CMYKA)}static toCMYKA(ne,ce={}){const ue=At(ne),pe=k$3(ce,ne),me=pt(ne,ue,ce.decimals,lt.CMYKA);return tt$2.CMYK(me,pe)}static getBlendHEXObject(ne,ce,ue=5){return Ht(ne,ce,ue,0,lt.HEX)}static getBlendHEX(ne,ce,ue=5){return Rt.getBlendHEXObject(ne,ce,ue).map(pe=>tt$2.HEX(pe))}static getBlendHEXAObject(ne,ce,ue=5){return Ht(ne,ce,ue,0,lt.HEXA)}static getBlendHEXA(ne,ce,ue=5){return Rt.getBlendHEXAObject(ne,ce,ue).map(pe=>tt$2.HEX(pe))}static getBlendRGBObject(ne,ce,ue,pe){return typeof ue=="number"?Ht(ne,ce,ue,pe==null?void 0:pe.decimals,lt.RGB):Ht(ne,ce,5,ue==null?void 0:ue.decimals,lt.RGB)}static getBlendRGB(ne,ce,ue,pe){return typeof ue=="number"?Ht(ne,ce,ue,pe==null?void 0:pe.decimals,lt.RGB).map(me=>tt$2.RGB(me,k$3(pe||{},ne,ce))):Ht(ne,ce,5,ue==null?void 0:ue.decimals,lt.RGB).map(me=>tt$2.RGB(me,k$3(ue||{},ne,ce)))}static getBlendRGBAObject(ne,ce,ue,pe){return typeof ue=="number"?Ht(ne,ce,ue,pe==null?void 0:pe.decimals,lt.RGBA):Ht(ne,ce,5,ue==null?void 0:ue.decimals,lt.RGBA)}static getBlendRGBA(ne,ce,ue,pe){return typeof ue=="number"?Ht(ne,ce,ue,pe==null?void 0:pe.decimals,lt.RGBA).map(me=>tt$2.RGB(me,k$3(pe||{},ne,ce))):Ht(ne,ce,5,ue==null?void 0:ue.decimals,lt.RGBA).map(me=>tt$2.RGB(me,k$3(ue||{},ne,ce)))}static getBlendHSLObject(ne,ce,ue,pe){return Ht(ne,ce,typeof ue=="number"?ue:5,pe==null?void 0:pe.decimals,lt.HSL)}static getBlendHSL(ne,ce,ue,pe){return typeof ue=="number"?Ht(ne,ce,ue,pe==null?void 0:pe.decimals,lt.HSL).map(me=>tt$2.HSL(me,k$3(pe||{},ne,ce))):Ht(ne,ce,5,ue==null?void 0:ue.decimals,lt.HSL).map(me=>tt$2.HSL(me,k$3(ue||{},ne,ce)))}static getBlendHSLAObject(ne,ce,ue,pe){return typeof ue=="number"?Ht(ne,ce,ue,pe==null?void 0:pe.decimals,lt.HSLA):Ht(ne,ce,5,ue==null?void 0:ue.decimals,lt.HSLA)}static getBlendHSLA(ne,ce,ue,pe){return typeof ue=="number"?Ht(ne,ce,ue,pe==null?void 0:pe.decimals,lt.HSLA).map(me=>tt$2.HSL(me,k$3(pe||{},ne,ce))):Ht(ne,ce,5,ue==null?void 0:ue.decimals,lt.HSLA).map(me=>tt$2.HSL(me,k$3(ue||{},ne,ce)))}static getBlendCIELabObject(ne,ce,ue,pe){return typeof ue=="number"?Ht(ne,ce,ue,pe==null?void 0:pe.decimals,lt.CIELab):Ht(ne,ce,5,ue==null?void 0:ue.decimals,lt.CIELab)}static getBlendCIELab(ne,ce,ue,pe){return typeof ue=="number"?Ht(ne,ce,ue,pe==null?void 0:pe.decimals,lt.CIELab).map(me=>tt$2.CIELab(me,k$3(pe||{},ne,ce))):Ht(ne,ce,5,ue==null?void 0:ue.decimals,lt.CIELab).map(me=>tt$2.CIELab(me,k$3(ue||{},ne,ce)))}static getBlendCIELabAObject(ne,ce,ue,pe){return typeof ue=="number"?Ht(ne,ce,ue,pe==null?void 0:pe.decimals,lt.CIELabA):Ht(ne,ce,5,ue==null?void 0:ue.decimals,lt.CIELabA)}static getBlendCIELabA(ne,ce,ue,pe){return typeof ue=="number"?Ht(ne,ce,ue,pe==null?void 0:pe.decimals,lt.CIELabA).map(me=>tt$2.CIELab(me,k$3(pe||{},ne,ce))):Ht(ne,ce,5,ue==null?void 0:ue.decimals,lt.CIELabA).map(me=>tt$2.CIELab(me,k$3(ue||{},ne,ce)))}static getMixHEXObject(ne,ce=s$2.ADDITIVE){return bt.HEX(ne,ce,!1)}static getMixHEX(ne,ce=s$2.ADDITIVE){return bt.HEX(ne,ce,!0)}static getMixHEXAObject(ne,ce=s$2.ADDITIVE){return bt.HEXA(ne,ce,!1)}static getMixHEXA(ne,ce=s$2.ADDITIVE){return bt.HEXA(ne,ce,!0)}static getMixRGBObject(ne,ce,ue){return typeof ce=="string"?bt.RGB(ne,ce,!1,k$3(ue||{},...ne)):bt.RGB(ne,s$2.ADDITIVE,!1,k$3(ce||{},...ne))}static getMixRGB(ne,ce,ue){return typeof ce=="string"?bt.RGB(ne,ce,!0,k$3(ue||{},...ne)):bt.RGB(ne,s$2.ADDITIVE,!0,k$3(ce||{},...ne))}static getMixRGBAObject(ne,ce,ue){return typeof ce=="string"?bt.RGBA(ne,ce,!1,k$3(ue||{},...ne)):bt.RGBA(ne,s$2.ADDITIVE,!1,k$3(ce||{},...ne))}static getMixRGBA(ne,ce,ue){return typeof ce=="string"?bt.RGBA(ne,ce,!0,k$3(ue||{},...ne)):bt.RGBA(ne,s$2.ADDITIVE,!0,k$3(ce||{},...ne))}static getMixHSLObject(ne,ce,ue){return typeof ce=="string"?bt.HSL(ne,ce,!1,k$3(ue||{},...ne)):bt.HSL(ne,s$2.ADDITIVE,!1,k$3(ce||{},...ne))}static getMixHSL(ne,ce,ue){return typeof ce=="string"?bt.HSL(ne,ce,!0,k$3(ue||{},...ne)):bt.HSL(ne,s$2.ADDITIVE,!0,k$3(ce||{},...ne))}static getMixHSLAObject(ne,ce,ue){return typeof ce=="string"?bt.HSLA(ne,ce,!1,k$3(ue||{},...ne)):bt.HSLA(ne,s$2.ADDITIVE,!1,k$3(ce||{},...ne))}static getMixHSLA(ne,ce,ue){return typeof ce=="string"?bt.HSLA(ne,ce,!0,k$3(ue||{},...ne)):bt.HSLA(ne,s$2.ADDITIVE,!0,k$3(ce||{},...ne))}static getMixCIELabObject(ne,ce,ue){return typeof ce=="string"?bt.CIELab(ne,ce,!1,k$3(ue||{},...ne)):bt.CIELab(ne,s$2.ADDITIVE,!1,k$3(ce||{},...ne))}static getMixCIELab(ne,ce,ue){return typeof ce=="string"?bt.CIELab(ne,ce,!0,k$3(ue||{},...ne)):bt.CIELab(ne,s$2.ADDITIVE,!0,k$3(ce||{},...ne))}static getMixCIELabAObject(ne,ce,ue){return typeof ce=="string"?bt.CIELabA(ne,ce,!1,k$3(ue||{},...ne)):bt.CIELabA(ne,s$2.ADDITIVE,!1,k$3(ce||{},...ne))}static getMixCIELabA(ne,ce,ue){return typeof ce=="string"?bt.CIELabA(ne,ce,!0,k$3(ue||{},...ne)):bt.CIELabA(ne,s$2.ADDITIVE,!0,k$3(ce||{},...ne))}static getShades(ne,ce,ue){return typeof ce=="number"?Et(ne,ce,!0,k$3(ue||{},ne)):Et(ne,5,!0,k$3(ce||{},ne))}static getTints(ne,ce,ue){return typeof ce=="number"?Et(ne,ce,!1,k$3(ue||{},ne)):Et(ne,5,!1,k$3(ce||{},ne))}static getHarmony(ne,ce,ue,pe){return`${ce}`in e$2?Ft(ce,ne,K$2(ue)?ue:s$2.ADDITIVE,k$3(K$2(ue)?pe||{}:ue||{},ne)):K$2(ce)?Ft(e$2.COMPLEMENTARY,ne,ce,k$3(ue||{},ne)):Ft(e$2.COMPLEMENTARY,ne,s$2.ADDITIVE,k$3(ce||{},ne))}}function hash(oe){let ne=5381,ce=oe.length;for(;ce;)ne=ne*33^oe.charCodeAt(--ce);return ne>>>0}const tint="500";function hex(oe){return parseInt(oe.replace("#","0x"))}const searchEventAliases=lodashExports$1.thru({source:["source","start"],destination:["destination","goal","finish"],updating:["update","updating"],expanding:["expanding","expanding"],generating:["generate","generating","open","opening"],closing:["close","closing"],end:["finish","end"]},oe=>{const ne={};for(const[ce,ue]of lodashExports$1.entries(oe))for(const pe of ue)ne[pe]=ce;return ne}),colorsHex={source:green$1.A400,destination:red$1.A400,updating:orange$1[tint],expanding:deepPurple$1[tint],generating:amber$1[tint],closing:pink$1[tint],end:blue$1.A400};lodashExports$1.mapValues(colorsHex,hex);const shades=lodashExports$1.sortBy(lodashExports$1.keys(accentColors),oe=>new Rt(getShade(oe,"dark")).H);function getColorHex(oe="",ne){if(searchEventAliases[lodashExports$1.lowerCase(oe)])return colorsHex[oe];if(ne)return ne;{const ue=hash(lodashExports$1.lowerCase(oe)),pe=lodashExports$1.values(accentColors);return pe[ue%pe.length][tint]}}const treeWorkerUrl=""+new URL("tree.worker-3134016b.js",import.meta.url).href;class TreeWorkerUrl extends Worker{constructor(){super(treeWorkerUrl,{type:"module"})}}const treeAsync=usingMemoizedWorkerTask(TreeWorkerUrl);function useTree(oe){const ne=compilerRuntimeExports.c(3);let ce,ue;return ne[0]!==oe?(ce=async()=>await treeAsync(oe),ue=[oe],ne[0]=oe,ne[1]=ce,ne[2]=ue):(ce=ne[1],ue=ne[2]),useAsync(ce,ue)}function useTreeMemo(oe,ne){const ce=reactExports.useMemo(()=>oe,ne);return useTree(ce)}const isDefined$1=oe=>!lodashExports$1.isUndefined(oe)&&!lodashExports$1.isNull(oe),divider$4=jsxRuntimeExports.jsx(Divider$1,{orientation:"vertical",flexItem:!0,sx:{m:1}});function useCache(oe,ne){const ce=compilerRuntimeExports.c(4),ue=ne===void 0?!1:ne,[pe,me]=reactExports.useState();let ge,ve;return ce[0]!==ue||ce[1]!==oe?(ge=()=>{ue||oe&&me(oe)},ve=[oe,ue],ce[0]=ue,ce[1]=oe,ce[2]=ge,ce[3]=ve):(ge=ce[2],ve=ce[3]),reactExports.useEffect(ge,ve),pe}const layoutModes={"directed-graph":{value:"directed-graph",name:"Directed Graph",description:"Show all edges",showAllEdges:!0},tree:{value:"tree",name:"Tree",description:"Show only edges between each node and their final parents",showAllEdges:!1}};function GraphEvents(oe){const ne=compilerRuntimeExports.c(7),{onSelection:ce,layer:ue}=oe,pe=v$4(),me=y$4();let ge;ne[0]!==me||ne[1]!==ce?(ge=()=>{me({clickNode:ye=>{ce==null||ce({event:ye.event.original,node:ye.node})},enterNode:()=>{document.body.style.cursor="pointer"},leaveNode:()=>{document.body.style.cursor=""}})},ne[0]=me,ne[1]=ce,ne[2]=ge):ge=ne[2];let ve;return ne[3]!==ue||ne[4]!==me||ne[5]!==pe?(ve=[ue,me,pe],ne[3]=ue,ne[4]=me,ne[5]=pe,ne[6]=ve):ve=ne[6],reactExports.useEffect(ge,ve),null}const SEVEN_CLASS_GNBU=["#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"];function TreeGraph({trace:oe,tree:ne,step:ce=0,layer:ue,showAllEdges:pe,trackedProperty:me}){const ge=v$4(),[ve,ye]=reactExports.useState("vertical"),xe=usePaper(),_e=useAcrylic(),we=useTheme$1(),$e=interpolate$1([we.palette.background.paper,we.palette.text.primary]),Re=_$4(),Ae=reactExports.useMemo(()=>getFinalParents(oe),[oe]),Ie=reactExports.useMemo(()=>{const ke=ve==="vertical",Be=new MultiDirectedGraph;lodashExports$1.forEach(ne,Fe=>{Be.addNode(Fe.label,{x:ke?Fe.x:-Fe.y,y:ke?Fe.y:-Fe.x,label:Fe.label,size:Math.log(Fe.size)+2,color:we.palette.action.disabledBackground})});const Ne={};return lodashExports$1.forEach(oe==null?void 0:oe.events,({id:Fe,pId:Ue,type:qe},We)=>{Fe&&Ue&&(Ne[Fe]=Ne[Fe]??new Set,Ne[Fe].add(Ue))}),lodashExports$1.forEach(oe==null?void 0:oe.events,({id:Fe,pId:Ue})=>{if(isDefined$1(Ue)&&Be.hasNode(`${Ue}`)){const qe=makeEdgeKey(Fe,Ue);!Be.hasEdge(qe)&&Be.hasNode(`${Fe}`)&&Be.addDirectedEdgeWithKey(qe,`${Ue}`,`${Fe}`,{label:"",color:"white",size:2,final:Ae[Fe]===Ue}),Be.hasDirectedEdge(qe)&&Be.updateEdgeAttribute(qe,"size",We=>Math.log(Math.E**(We-.5)+.5)+.5)}}),Be},[Re,oe,ne,Ae,ve]);return reactExports.useEffect(()=>{const ke=memoizee$1(qe=>interpolate$1([we.palette.background.paper,qe])),Be=400,Ne=$e(.1);Ie.forEachNode(qe=>{Ie.setNodeAttribute(qe,"color",Ne),Ie.setNodeAttribute(qe,"forceLabel",!1),Ie.setNodeAttribute(qe,"label",lodashExports$1.truncate(qe,{length:15}))}),Ie.forEachEdge(qe=>{const We=Ie.getEdgeAttribute(qe,"final");Ie.setEdgeAttribute(qe,"color",Ne),Ie.setEdgeAttribute(qe,"hidden",!pe&&!We),Ie.setEdgeAttribute(qe,"forceLabel",!1),Ie.setEdgeAttribute(qe,"label","")});const Fe={},Ue={};if((pe?lodashExports$1.forEach:lodashExports$1.forEachRight)(lodashExports$1.slice(oe==null?void 0:oe.events,0,ce+1),({id:qe,type:We,pId:ze},Ge)=>{const Ze=getColorHex(We),Je=ke(Ze)(lodashExports$1.max([1-(ce-Ge)/Be,.2]));if(Ie.hasNode(`${qe}`)&&!Fe[qe]){Ie.setNodeAttribute(`${qe}`,"color",Je),Ie.setNodeAttribute(`${qe}`,"label",lodashExports$1.truncate(`${lodashExports$1.startCase(We)} ${qe}`,{length:15})),Ie.setNodeAttribute(`${qe}`,"forceLabel",ce===Ge);const Qe=makeEdgeKey(qe,ze);isDefined$1(ze)&&Ie.hasNode(`${ze}`)&&Ie.hasEdge(Qe)&&!Ue[Qe]&&(Ie.setEdgeAttribute(Qe,"forceLabel",ce===Ge),Ie.setEdgeAttribute(Qe,"color",Je),Ie.setEdgeAttribute(Qe,"label",`Step ${Ge}`),Ie.setEdgeAttribute(Qe,"hidden",!1),pe||(Ue[Qe]=!0)),pe||(Fe[qe]=!0)}}),me){const qe=lodashExports$1.min(lodashExports$1.map(oe==null?void 0:oe.events,Ze=>lodashExports$1.get(Ze,me))),We=lodashExports$1.max(lodashExports$1.map(oe==null?void 0:oe.events,Ze=>lodashExports$1.get(Ze,me))),ze=Ze=>isNaN(qe)||isNaN(We)||isNaN(Ze)?0:(Ze-qe)/(We-qe),Ge=interpolate$1(SEVEN_CLASS_GNBU);lodashExports$1.forEach(lodashExports$1.slice(oe==null?void 0:oe.events,0,ce+1),Ze=>{if(Ie.hasNode(`${Ze.id}`)){const Je=Ge(ze(lodashExports$1.get(Ze,me)));if(Ie.setNodeAttribute(`${Ze.id}`,"color",Je),isDefined$1(Ze.pId)){const Qe=makeEdgeKey(`${Ze.id}`,`${Ze.pId}`);Ie.hasDirectedEdge(Qe)&&Ie.setEdgeAttribute(Qe,"color",Je)}}})}Re(Ie)},[Ie,ce,oe,pe,me,we]),jsxRuntimeExports.jsx(Stack$1,{sx:{pt:6,position:"absolute",top:0,left:0},children:jsxRuntimeExports.jsxs(Stack$1,{direction:"row",sx:{...xe(1),..._e,alignItems:"center",height:ke=>ke.spacing(6),px:1,m:1},children:[jsxRuntimeExports.jsx(IconButtonWithTooltip,{color:"primary",onClick:()=>{var ke,Be,Ne;(Ne=(Be=(ke=ge==null?void 0:ge.getCamera)==null?void 0:ke.call(ge))==null?void 0:Be.animatedReset)==null||Ne.call(Be)},label:"Fit",icon:jsxRuntimeExports.jsx(CenterFocusWeakOutlined,{})}),divider$4,jsxRuntimeExports.jsx(IconButtonWithTooltip,{color:"primary",onClick:()=>{ye(ve==="vertical"?"horizontal":"vertical")},label:"Rotate",icon:jsxRuntimeExports.jsx(RotateIcon,{})}),divider$4,jsxRuntimeExports.jsx(MinimisedPlaybackControls,{layer:ue})]})})}function makeEdgeKey(oe,ne){return`${oe}::${ne}`}const stepsLayerGuard$2=oe=>!!getLayerHandler(oe).steps;function TreePage({template:oe}){var Ye,tn,Xt,Qt,Zt,Gt,sn,Kt,Jt,mn;const{key:ne,setKey:ce,layer:ue,layers:pe,allLayers:me}=useLayer(void 0,stepsLayerGuard$2),ge=useTheme$1(),{controls:ve,onChange:ye,state:xe,dragHandle:_e}=useViewTreeContext(),we=useThrottle$1(((Ye=ue==null?void 0:ue.source)==null?void 0:Ye.step)??0,1e3/24),{stepTo:$e}=usePlaybackState(ne),Re=reactExports.useMemo(()=>{var bn,$n,Ut;return lodashExports$1.chain((Ut=($n=(bn=ue==null?void 0:ue.source)==null?void 0:bn.trace)==null?void 0:$n.content)==null?void 0:Ut.events).flatMap(lodashExports$1.keys).uniq().filter(Yt=>Yt!=="type").value()},[(Qt=(Xt=(tn=ue==null?void 0:ue.source)==null?void 0:tn.trace)==null?void 0:Xt.content)==null?void 0:Qt.events]),[Ae,Ie]=reactExports.useState(""),ke=(Gt=(Zt=ue==null?void 0:ue.source)==null?void 0:Zt.trace)==null?void 0:Gt.content,Be=(Kt=(sn=ue==null?void 0:ue.source)==null?void 0:sn.trace)==null?void 0:Kt.lastModified,Ne=(mn=(Jt=ue==null?void 0:ue.source)==null?void 0:Jt.trace)==null?void 0:mn.key;reactExports.useEffect(()=>{Ie("")},[ke,Ie]);const[Fe,Ue]=reactExports.useState(),[qe,We]=reactExports.useState(!1),[ze,Ge]=reactExports.useState("tree"),Ze=reactExports.useMemo(()=>{const bn=lodashExports$1.filter(lodashExports$1.map(ke==null?void 0:ke.events,($n,Ut)=>({event:$n,step:Ut})),$n=>`${$n.event.id}`===(Fe==null?void 0:Fe.node));return{events:bn,current:lodashExports$1.findLast(bn,$n=>$n.step<=we)}},[Fe,we]),Je=reactExports.useMemo(()=>({trace:ke,mode:ze}),[ke,Ne,Be,ze]),{result:Qe,loading:Nt}=useTreeMemo(Je,[Je]),jt=reactExports.useMemo(()=>({stagePadding:8*8,allowInvalidContainer:!0,edgeLabelColor:{color:ge.palette.text.secondary},labelFont:"Inter",labelSize:14,labelDensity:.1,renderEdgeLabels:!0,edgeLabelFont:"Inter",edgeLabelSize:12,defaultDrawNodeHover:()=>{},labelColor:{color:ge.palette.text.primary},edgeLabelWeight:"500",defaultEdgeType:"arrow",edgeProgramClasses:{straight:EdgeArrowProgram$1,curvedArrow:EdgeCurvedArrowProgram}}),[ge]);return jsxRuntimeExports.jsxs(oe,{onChange:ye,stack:xe,children:[jsxRuntimeExports.jsx(oe.Key,{children:"tree"}),jsxRuntimeExports.jsx(oe.Title,{children:"Tree"}),jsxRuntimeExports.jsx(oe.Handle,{children:_e}),jsxRuntimeExports.jsx(oe.Content,{children:jsxRuntimeExports.jsx(Flex,{children:ke?Nt?jsxRuntimeExports.jsxs(Flex,{sx:{flexDirection:"column",gap:4,alignItems:"center",justifyContent:"center"},children:[jsxRuntimeExports.jsx(CircularProgress$1,{}),jsxRuntimeExports.jsx(Type$2,{component:"div",variant:"body2",sx:{px:8,maxWidth:480},children:"Generating layout"})]}):Qe!=null&&Qe.length?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(AutoSizer,{children:bn=>jsxRuntimeExports.jsxs(k$5,{style:{...bn,background:ge.palette.background.paper},graph:MultiDirectedGraph,settings:jt,children:[jsxRuntimeExports.jsx(TreeGraph,{step:we,tree:Qe,trace:ke,layer:ue,showAllEdges:layoutModes[ze].showAllEdges,trackedProperty:Ae}),jsxRuntimeExports.jsx(GraphEvents,{layer:ne,onSelection:$n=>{Ue($n),We(!0)}})]})}),jsxRuntimeExports.jsx(Menu$1,{onClose:()=>We(!1),anchorReference:"anchorPosition",anchorPosition:{left:(Fe==null?void 0:Fe.event.clientX)??0,top:(Fe==null?void 0:Fe.event.clientY)??0},transformOrigin:{horizontal:"left",vertical:"top"},open:qe,children:jsxRuntimeExports.jsxs(MenuList$1,{dense:!0,sx:{p:0},children:[!!Ze.current&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(ListItem$1,{sx:{py:0},children:jsxRuntimeExports.jsxs(Type$2,{component:"div",color:"text.secondary",variant:"overline",children:["Step ",Ze.current.step]})}),jsxRuntimeExports.jsx(Box$1,{px:2,py:1,children:jsxRuntimeExports.jsx(PropertyList,{event:Ze.current.event,vertical:!0,simple:!0,primitives:!0})}),jsxRuntimeExports.jsx(Divider$1,{sx:{my:1,mx:2}})]}),jsxRuntimeExports.jsx(ListItem$1,{sx:{py:0},children:jsxRuntimeExports.jsxs(Type$2,{component:"div",color:"text.secondary",variant:"overline",children:["Events at ",Fe==null?void 0:Fe.node]})}),lodashExports$1.map(Ze.events,(bn,$n,Ut)=>{var en;const Yt=((en=lodashExports$1.findLast(Ut,dn=>dn.step<=we))==null?void 0:en.step)===bn.step;return jsxRuntimeExports.jsxs(Stack$1,{direction:"row",children:[jsxRuntimeExports.jsx(MenuItem$1,{selected:Yt,sx:{height:32,flex:1,borderLeft:`4px solid ${getColorHex(bn.event.type)}`},onClick:()=>{$e(bn.step)},children:jsxRuntimeExports.jsx(Tooltip$1,{title:`Go to step ${bn.step}`,children:jsxRuntimeExports.jsx(Box$1,{sx:{ml:-.5,pr:4},children:jsxRuntimeExports.jsx(Label$1,{primary:lodashExports$1.startCase(bn.event.type),secondary:isDefined$1(bn.event.pId)?`Step ${bn.step}, from ${bn.event.pId}`:`Step ${bn.step}`})})})}),jsxRuntimeExports.jsx(Box$1,{sx:{flex:0},children:jsxRuntimeExports.jsx(PropertyDialog,{event:bn.event,trigger:dn=>jsxRuntimeExports.jsx(MenuItem$1,{selected:Yt,onClick:dn,sx:{pr:0},children:jsxRuntimeExports.jsx(Tooltip$1,{title:"See all properties",children:jsxRuntimeExports.jsx(ListItemIcon$1,{children:jsxRuntimeExports.jsx(DataObjectOutlined,{})})})})})})]})})]})})]}):jsxRuntimeExports.jsx(Placeholder$2,{icon:jsxRuntimeExports.jsx(TreeIcon,{}),label:"Graph",secondary:`${inferLayerName(ue)} is not a graph.`}):jsxRuntimeExports.jsx(Placeholder$2,{icon:jsxRuntimeExports.jsx(TreeIcon,{}),label:"Graph",secondary:"When you load a trace that has tree-like data, you'll see it here as a decision tree."})})}),jsxRuntimeExports.jsxs(oe.Options,{children:[jsxRuntimeExports.jsx(FeaturePicker,{icon:jsxRuntimeExports.jsx(LayersIcon,{}),label:"Layer",value:ne,items:lodashExports$1.map(me,bn=>({id:bn.key,hidden:!lodashExports$1.find(pe,{key:bn.key}),name:inferLayerName(bn)})),onChange:ce,arrow:!0,ellipsis:12}),divider$4,jsxRuntimeExports.jsx(FeaturePicker,{icon:jsxRuntimeExports.jsx(ModeStandbyOutlined,{}),label:"Layout",value:ze,onChange:Ge,items:lodashExports$1.map(lodashExports$1.entries(layoutModes),([bn,$n])=>({id:bn,...$n})),arrow:!0}),divider$4,jsxRuntimeExports.jsx(FeaturePicker,{icon:jsxRuntimeExports.jsx(TimelineOutlined,{}),label:"Tracked Property",value:Ae,onChange:Ie,items:[{id:"",name:"Off"},...lodashExports$1.map(Re,bn=>({id:bn,name:`$.${bn}`}))],arrow:!0})]}),jsxRuntimeExports.jsx(oe.Extras,{children:ve})]})}function getFinalParents(oe){const ne={};return lodashExports$1.forEach(oe==null?void 0:oe.events,({id:ce,pId:ue})=>{ne[ce]=ue}),ne}function SelectionMenu(oe){const ne=compilerRuntimeExports.c(17),{selection:ce,onClose:ue}=oe,pe=useSelectionMenu(),me=useCache(ce);let ge;ne[0]!==ce?(ge=ce??{},ne[0]=ce,ne[1]=ge):ge=ne[1];const{client:ve}=ge,ye=!!ce,xe=(ve==null?void 0:ve.y)??0,_e=(ve==null?void 0:ve.x)??0;let we;ne[2]!==xe||ne[3]!==_e?(we={top:xe,left:_e},ne[2]=xe,ne[3]=_e,ne[4]=we):we=ne[4];let $e;ne[5]===Symbol.for("react.memo_cache_sentinel")?($e={py:0},ne[5]=$e):$e=ne[5];let Re;ne[6]!==ue?(Re=ke=>{const Be=lodashExports$1.entries(ke);return Be.length?lodashExports$1.chain(Be).sortBy(Ne=>{const[,Fe]=Ne;return Fe.index}).map((Ne,Fe)=>{const[,Ue]=Ne,{items:qe,primary:We}=Ue;return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[!!Fe&&jsxRuntimeExports.jsx(Divider$1,{sx:{my:1,mx:2}}),We&&jsxRuntimeExports.jsx(ListItem$1,{sx:{py:0},children:jsxRuntimeExports.jsx(Type$2,{component:"div",color:"text.secondary",variant:"overline",children:We})}),lodashExports$1.chain(qe).entries().sortBy(ze=>{const[,Ge]=ze;return Ge.index}).map(ze=>{const[Ge,Ze]=ze,{action:Je,icon:Qe,primary:Nt,secondary:jt,extras:Ye}=Ze;return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[!!(Je||Nt||jt)&&(Je?jsxRuntimeExports.jsxs(MenuItem$1,{onClick:()=>{Je==null||Je(),ue==null||ue()},children:[Qe&&jsxRuntimeExports.jsx(ListItemIcon$1,{children:Qe}),jsxRuntimeExports.jsx(ListItemText$1,{primary:Nt,sx:{mr:4}}),jsxRuntimeExports.jsx(Type$2,{component:"div",variant:"body2",color:"text.secondary",children:jt})]},Ge):jsxRuntimeExports.jsxs(ListItem$1,{children:[Qe&&jsxRuntimeExports.jsx(ListItemIcon$1,{children:Qe}),jsxRuntimeExports.jsx(ListItemText$1,{primary:Nt,sx:{mr:4}}),jsxRuntimeExports.jsx(Type$2,{component:"div",variant:"body2",color:"text.secondary",children:jt})]},Ge)),!!Ye&&Ye]})}).value()]})}).value():jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(ListItem$1,{children:jsxRuntimeExports.jsx(Type$2,{component:"div",children:"No info to show."})})})},ne[6]=ue,ne[7]=Re):Re=ne[7];let Ae;ne[8]!==pe||ne[9]!==me||ne[10]!==Re?(Ae=jsxRuntimeExports.jsx(MenuList$1,{dense:!0,sx:$e,children:jsxRuntimeExports.jsx(pe,{event:me,children:Re})}),ne[8]=pe,ne[9]=me,ne[10]=Re,ne[11]=Ae):Ae=ne[11];let Ie;return ne[12]!==ye||ne[13]!==we||ne[14]!==ue||ne[15]!==Ae?(Ie=jsxRuntimeExports.jsx(Menu$1,{open:ye,anchorReference:"anchorPosition",anchorPosition:we,onClose:ue,keepMounted:!0,children:Ae}),ne[12]=ye,ne[13]=we,ne[14]=ue,ne[15]=Ae,ne[16]=Ie):Ie=ne[16],Ie}const identity$1=({children:oe})=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:oe==null?void 0:oe({})});function useSelectionMenu(){const oe=compilerRuntimeExports.c(3),[ne]=useLayers(),{layers:ce}=ne;let ue,pe;if(oe[0]!==ce){let me;oe[2]===Symbol.for("react.memo_cache_sentinel")?(me=(ge,ve)=>{var xe;const ye=((xe=getLayerHandler(ve))==null?void 0:xe.provideSelectionInfo)??identity$1;return _e=>{const{children:we,event:$e}=_e;return jsxRuntimeExports.jsx(ye,{layer:ve.key,event:$e,children:Re=>jsxRuntimeExports.jsx(ge,{event:$e,children:Ae=>we==null?void 0:we(lodashExports$1.merge(Re,Ae))})})}},oe[2]=me):me=oe[2],pe=lodashExports$1.chain(ce).reduce(me,identity$1).value(),oe[0]=ce,oe[1]=pe}else pe=oe[1];return ue=pe,ue}const TILE_RESOLUTION=128,tileSize=(oe=!1)=>(oe?.75:devicePixelRatio*2)*TILE_RESOLUTION,rendererOptions={tileSubdivision:2,workerCount:lodashExports$1.clamp(lodashExports$1.floor((navigator.hardwareConcurrency-1)/2),1,12),tileResolution:{width:tileSize(),height:tileSize()}},TraceRendererContext=reactExports.createContext({});function useRendererInstance(){return reactExports.useContext(TraceRendererContext)}function useRenderer(oe,{width:ne,height:ce}={}){const ue=useTheme$1(),[pe]=useRenderers(),me=reactExports.useRef(null),[ge,ve]=reactExports.useState(""),[ye,xe]=reactExports.useState();return reactExports.useEffect(()=>{if(ve(""),me.current&&ne&&ce&&oe){const _e=lodashExports$1.find(pe,we=>we.renderer.meta.id===oe);if(_e){const we=new _e.renderer.constructor;return we.setup({...rendererOptions,screenSize:{width:ne,height:ce},backgroundColor:ue.palette.background.paper,accentColor:ue.palette.primary.main}),me.current.append(we.getView()),xe(we),()=>{var $e,Re;try{(Re=($e=me.current)==null?void 0:$e.removeChild)==null||Re.call($e,we.getView()),xe(void 0)}catch(Ae){console.warn(Ae)}finally{we.destroy()}}}}},[me.current,lodashExports$1.map,oe,pe,ue,ve,xe]),useDebounce(()=>{ye&&ne&&ce&&ye.setOptions({screenSize:{width:ne,height:ce}})},ue.transitions.duration.standard,[ye,ne,ce]),{instance:ye,ref:me,error:ge}}function TraceRendererCircularProgress(){const oe=compilerRuntimeExports.c(3),[ne]=useLoading(),{map:ce,specimen:ue}=ne;let pe;return oe[0]!==ce||oe[1]!==ue?(pe=!!(ce||ue)&&jsxRuntimeExports.jsx(CircularProgress$1,{sx:{position:"absolute",top:me=>me.spacing(8),right:me=>me.spacing(2)}}),oe[0]=ce,oe[1]=ue,oe[2]=pe):pe=oe[2],pe}const VIEWPORT_PAGE_DESCRIPTION="When you create a layer, you'll see it visualised here.";function TraceRenderer({width:oe,height:ne,renderer:ce,rendererRef:ue,layers:pe}){const me=reactExports.useMemo(nanoid$1,[]),{instance:ge,error:ve,ref:ye}=useRenderer(ce,{width:oe,height:ne}),{playing:xe}=usePlaybackState(),[,_e]=useScreenshots(),[we,$e]=reactExports.useState();reactExports.useEffect(()=>{if(ge){const Ae=(Ie,ke)=>{const Be=Ie;$e({client:{x:Be.clientX,y:Be.clientY},world:ke.world,info:{point:ke.world,components:ke.components}})};return ge.on("click",Ae),()=>void ge.off("click",Ae)}},[ge]);const Re=reactExports.useMemo(()=>({renderer:ge}),[ge]);return reactExports.useEffect(()=>ue==null?void 0:ue(ge),[ge,ue]),reactExports.useEffect(()=>{const Ae=async()=>{var Ie;return await((Ie=ge==null?void 0:ge.toDataUrl)==null?void 0:Ie.call(ge))};return _e(()=>({[me]:Ae})),()=>_e(()=>({[me]:void 0}))},[me,ge]),reactExports.useEffect(()=>{ge&&ge.setOptions({tileResolution:{width:tileSize(xe),height:tileSize(xe)}})},[ge,xe]),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(TraceRendererCircularProgress,{}),jsxRuntimeExports.jsx(TraceRendererContext.Provider,{value:Re,children:pe!=null&&pe.length?ve?jsxRuntimeExports.jsxs(Box$1,{sx:{display:"flex",flexDirection:"column",width:oe,height:ne,alignItems:"center",justifyContent:"center",color:"text.secondary"},children:[jsxRuntimeExports.jsx(DisabledIcon,{sx:{mb:2},fontSize:"large"}),ve]}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Box$1,{ref:ye,children:pe.map((Ae,Ie)=>jsxRuntimeExports.jsx(RenderLayer,{index:Ie,layer:Ae},Ae.key))})}):jsxRuntimeExports.jsx(Placeholder$2,{icon:jsxRuntimeExports.jsx(ViewportIcon,{}),label:"Viewport",width:oe,height:ne,secondary:VIEWPORT_PAGE_DESCRIPTION})}),jsxRuntimeExports.jsx(SelectionMenu,{selection:we,onClose:()=>$e(void 0)})]})}function NodeList({nodes:oe,start:ne=0,end:ce=(oe==null?void 0:oe.length)??0}){const{renderer:ue}=useRendererInstance();return reactExports.useEffect(()=>{if(ue&&(oe!=null&&oe.length))return ue.add(lodashExports$1.slice(oe,ne,ce).flat())},[ue,oe,ne,ce]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{})}function NodeList2(oe){const ne=compilerRuntimeExports.c(5),{nodes:ce}=oe,{renderer:ue}=useRendererInstance();let pe,me;ne[0]!==ue||ne[1]!==ce?(pe=()=>{if(ue&&(ce!=null&&ce.length))return ue.add(ce)},me=[ue,ce],ne[0]=ue,ne[1]=ce,ne[2]=pe,ne[3]=me):(pe=ne[2],me=ne[3]),reactExports.useEffect(pe,me);let ge;return ne[4]===Symbol.for("react.memo_cache_sentinel")?(ge=jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{}),ne[4]=ge):ge=ne[4],ge}function LazyNodeList({nodes:oe,end:ne}){const ue=lodashExports$1.floor((ne??0)/100)*100,pe=reactExports.useMemo(()=>lodashExports$1.slice(oe,0,ue),[oe,ue]),me=reactExports.useMemo(()=>lodashExports$1.slice(oe,ue,(ne??0)+1),[oe,ue,ne]);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[!!ue&&jsxRuntimeExports.jsx(NodeList,{nodes:pe}),me.map((ge,ve)=>jsxRuntimeExports.jsx(NodeList2,{nodes:ge},ue+ve))]})}const useEffectWhen=(oe,ne,ce)=>{const ue=compilerRuntimeExports.c(8);let pe;ue[0]!==ce?(pe=ce||[],ue[0]=ce,ue[1]=pe):pe=ue[1];const me=reactExports.useRef(pe),ve=me.current===ce||!me.current.every((we,$e)=>we===ce[$e]);me.current=ce;let ye;if(ue[2]!==ne){let we;ue[4]===Symbol.for("react.memo_cache_sentinel")?(we=()=>null,ue[4]=we):we=ue[4],ye=ne.map(we),ue[2]=ne,ue[3]=ye}else ye=ue[3];const xe=ye;let _e;return ue[5]!==ve||ue[6]!==oe?(_e=ve?()=>void oe():()=>{},ue[5]=ve,ue[6]=oe,ue[7]=_e):_e=ue[7],reactExports.useEffect(_e,ve?ne:xe)};function allSame(oe,ne){return lodashExports$1.zip(oe,ne).every(([ce,ue])=>ce===ue)}const useEffectWhenAsync=(oe,ne,ce)=>{const ue=compilerRuntimeExports.c(12);let pe;ue[0]!==ne?(pe=ne===void 0?[]:ne,ue[0]=ne,ue[1]=pe):pe=ue[1];const me=pe;let ge;ue[2]!==ce?(ge=ce===void 0?[]:ce,ue[2]=ce,ue[3]=ge):ge=ue[3];const ve=ge,[ye,xe]=reactExports.useState(me),[_e,we]=reactExports.useState(ve);let $e,Re;ue[4]!==_e||ue[5]!==ve||ue[6]!==me?($e=()=>{allSame(_e,ve)||(xe(me),we(ve))},Re=[me,ve,_e],ue[4]=_e,ue[5]=ve,ue[6]=me,ue[7]=$e,ue[8]=Re):($e=ue[7],Re=ue[8]),reactExports.useEffect($e,Re);let Ae;return ue[9]!==ye||ue[10]!==_e?(Ae=[...ye,..._e],ue[9]=ye,ue[10]=_e,ue[11]=Ae):Ae=ue[11],useAsyncAbortable(oe,Ae)};function useConnectionResolver(){const oe=compilerRuntimeExports.c(2),[ne]=useConnections();let ce;return oe[0]!==ne?(ce=ue=>lodashExports$1.find(ne,ue),oe[0]=ne,oe[1]=ce):ce=oe[1],ce}function useConnection(oe){const ne=compilerRuntimeExports.c(3),ce=useConnectionResolver();let ue;return ne[0]!==oe||ne[1]!==ce?(ue=ce({url:oe}),ne[0]=oe,ne[1]=ce,ne[2]=ue):ue=ne[2],ue}function useMapContent(oe){const ne=compilerRuntimeExports.c(19),ce=useSnackbar(),ue=useLoadingState("map"),pe=useConnectionResolver();let me,ge;ne[0]!==pe||ne[1]!==ce?(ge=async Ie=>{const{source:ke,id:Be}=Ie===void 0?{}:Ie;if(ke&&Be){const Ne=pe({url:ke});if(Ne){ce("Fetching map...");const Fe=await Ne.transport().call("features/map",{id:Be});return Fe==null?void 0:Fe.content}}},ne[0]=pe,ne[1]=ce,ne[2]=ge):ge=ne[2];let ve;ne[3]!==ge?(ve=memoizee$1(ge,{normalizer:JSON.stringify}),ne[3]=ge,ne[4]=ve):ve=ne[4],me=ve;const ye=me;let xe;ne[5]!==oe?(xe=oe??{},ne[5]=oe,ne[6]=xe):xe=ne[6];const{content:_e,source:we,id:$e}=xe;let Re;ne[7]!==ue||ne[8]!==$e||ne[9]!==oe||ne[10]!==_e||ne[11]!==ye||ne[12]!==we?(Re=()=>ue(async()=>{if($e)return{...oe,content:_e||await ye({source:we,id:$e})}}),ne[7]=ue,ne[8]=$e,ne[9]=oe,ne[10]=_e,ne[11]=ye,ne[12]=we,ne[13]=Re):Re=ne[13];let Ae;return ne[14]!==ye||ne[15]!==_e||ne[16]!==we||ne[17]!==$e?(Ae=[ye,_e,we,$e],ne[14]=ye,ne[15]=_e,ne[16]=we,ne[17]=$e,ne[18]=Ae):Ae=ne[18],useAsync(Re,Ae)}const noop$7=()=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{});function useMapOptions(oe){const ne=compilerRuntimeExports.c(8);let ce;ne[0]!==oe?(ce=oe??{},ne[0]=oe,ne[1]=ce):ce=ne[1];const{format:ue}=ce;let pe;ne[2]!==ue||ne[3]!==oe?(pe=async()=>{var ve,ye;return await((ye=(ve=getParser(ue))==null?void 0:ve.editor)==null?void 0:ye.call(ve,oe==null?void 0:oe.content))??noop$7},ne[2]=ue,ne[3]=oe,ne[4]=pe):pe=ne[4];const me=oe==null?void 0:oe.content;let ge;return ne[5]!==ue||ne[6]!==me?(ge=[ue,me],ne[5]=ue,ne[6]=me,ne[7]=ge):ge=ne[7],useAsync(pe,ge)}function useParsedMap(oe,ne){const ce=useSnackbar(),ue=useTheme$1(),pe=useLoadingState("map"),{format:me,content:ge}=oe??{};return useAsync(()=>pe(async()=>{var ve,ye;if(me&&ge){ce("Processing map...");try{const xe=await((ye=(ve=getParser(me))==null?void 0:ve.parse)==null?void 0:ye.call(ve,ge,{color:ue.palette.text.primary,background:ue.palette.background.paper,...ne}))??{nodes:[]};return ce("Map loaded",`${xe.nodes.length} elements, ${xe.log.join(", ")}`),{...oe,...xe}}catch(xe){return console.error(xe),ce("Error parsing",lodashExports$1.get(xe,"message")),{error:lodashExports$1.get(xe,"message")}}}}),[me,ge,ue,ne])}const controller$2={key:"map",icon:jsxRuntimeExports.jsx(MapTwoTone,{}),inferName:oe=>{var ne;return(ne=oe==null?void 0:oe.source)!=null&&ne.map?`${oe.source.map.name} (${lodashExports$1.startCase(oe.source.map.format)})`:"Untitled Map"},error:oe=>{var ne,ce;return(ce=(ne=oe==null?void 0:oe.source)==null?void 0:ne.parsedMap)==null?void 0:ce.error},claimImportedFile:async oe=>lodashExports$1.keys(mapParsers).includes(ext$1(oe.name))?{claimed:!0,layer:async ne=>{ne("Opening map...");try{return{map:{...await readUploadedMap(oe,lodashExports$1.entries(mapParsers).map(([ue])=>({id:ue}))).read()}}}catch(ce){return console.error(ce),ne(`Error opening, ${lodashExports$1.get(ce,"message")}`),{map:{key:nanoid$1(),id:custom$1().id,error:lodashExports$1.get(ce,"message"),name:lodashExports$1.startCase(name$2(oe.name))}}}}}:{claimed:!1},editor:withProduce(({value:oe,produce:ne})=>{var pe,me,ge,ve,ye,xe,_e,we;const ce=(pe=oe==null?void 0:oe.source)==null?void 0:pe.parsedMap,{result:ue}=useMapOptions(ce);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Option,{label:"Source",content:jsxRuntimeExports.jsx(MapPicker,{value:(me=oe==null?void 0:oe.source)==null?void 0:me.map,onChange:$e=>ne(Re=>lodashExports$1.set(Re,"source.map",$e))})}),((ve=(ge=oe==null?void 0:oe.source)==null?void 0:ge.parsedMap)==null?void 0:ve.error)&&jsxRuntimeExports.jsx(Type$2,{component:"div",variant:"body2",color:$e=>$e.palette.error.main,sx:{whiteSpace:"pre-wrap",mb:1,mt:1},children:jsxRuntimeExports.jsx("code",{children:(xe=(ye=oe==null?void 0:oe.source)==null?void 0:ye.parsedMap)==null?void 0:xe.error})}),!!((_e=oe==null?void 0:oe.source)!=null&&_e.map)&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Heading,{label:"Map Options"}),ue?jsxRuntimeExports.jsx(ue,{value:(we=oe==null?void 0:oe.source)==null?void 0:we.options,onChange:$e=>ne(Re=>{var Ae;lodashExports$1.set(Re,"source.options",$e(((Ae=Re.source)==null?void 0:Ae.options)??{}))})}):jsxRuntimeExports.jsx(CircularProgress$1,{sx:{mt:2}})]})]})}),renderer:({layer:oe,index:ne})=>{var pe;const{nodes:ce}=((pe=oe==null?void 0:oe.source)==null?void 0:pe.parsedMap)??{},ue=reactExports.useMemo(()=>[lodashExports$1.map(ce,me=>({...me,meta:{...me.meta,sourceLayer:oe==null?void 0:oe.key,sourceLayerIndex:ne,sourceLayerAlpha:1-.01*+((oe==null?void 0:oe.transparency)??0),sourceLayerDisplayMode:(oe==null?void 0:oe.displayMode)??"source-over"}}))],[ce,ne,oe==null?void 0:oe.transparency,oe==null?void 0:oe.displayMode]);return jsxRuntimeExports.jsx(NodeList,{nodes:ue})},service:withProduce(({value:oe,produce:ne})=>{var me,ge;const{result:ce}=useMapContent((me=oe==null?void 0:oe.source)==null?void 0:me.map),{result:ue,loading:pe}=useParsedMap(ce,(ge=oe==null?void 0:oe.source)==null?void 0:ge.options);return useEffectWhen(()=>{pe||ne(ve=>{lodashExports$1.set(ve,"source.parsedMap",ue),lodashExports$1.set(ve,"viewKey",nanoid$1())})},[ue,ne,pe],[ue]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{})}),provideSelectionInfo:({children:oe,event:ne,layer:ce})=>{const{layer:ue,setLayer:pe,layers:me}=useLayer(ce),{parsedMap:ge}=(ue==null?void 0:ue.source)??{},{point:ve,node:ye}=reactExports.useMemo(()=>{var _e,we,$e,Re;if(ge&&ne){const Ae=(Re=($e=getParser((we=(_e=ue==null?void 0:ue.source)==null?void 0:_e.map)==null?void 0:we.format))==null?void 0:$e.hydrate)==null?void 0:Re.call($e,ge);if(Ae){const Ie=(ne==null?void 0:ne.world)&&Ae.snap(ne.world);if(Ie){const ke=(ne==null?void 0:ne.world)&&Ae.nodeAt(Ie);return{point:Ie,node:ke}}}}return{}},[ge,ne]),xe=reactExports.useMemo(()=>({...ue&&ve&&!lodashExports$1.isUndefined(ye)&&{[ue.key]:{primary:inferLayerName(ue),items:{point:{primary:"Point",secondary:`(${lodashExports$1.round(ve.x,2)}, ${lodashExports$1.round(ve.y,2)})`}}}}}),[ve,ye,ue,me,pe]);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:oe==null?void 0:oe(xe)})},getSources:oe=>{var ue,pe;const ne=(ue=oe==null?void 0:oe.source)==null?void 0:ue.map,ce=(pe=oe==null?void 0:oe.source)==null?void 0:pe.parsedMap;return ne?[{id:"map",name:`(Source) ${ne.name}`,language:"txt",content:ce==null?void 0:ce.content}]:[]},onEditSource:(oe,ne,ce)=>oe};/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function isNothing(oe){return typeof oe>"u"||oe===null}function isObject$3(oe){return typeof oe=="object"&&oe!==null}function toArray$2(oe){return Array.isArray(oe)?oe:isNothing(oe)?[]:[oe]}function extend$2(oe,ne){var ce,ue,pe,me;if(ne)for(me=Object.keys(ne),ce=0,ue=me.length;ce=0?"0b"+oe.toString(2):"-0b"+oe.toString(2).slice(1)},octal:function(oe){return oe>=0?"0o"+oe.toString(8):"-0o"+oe.toString(8).slice(1)},decimal:function(oe){return oe.toString(10)},hexadecimal:function(oe){return oe>=0?"0x"+oe.toString(16).toUpperCase():"-0x"+oe.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),YAML_FLOAT_PATTERN=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function resolveYamlFloat(oe){return!(oe===null||!YAML_FLOAT_PATTERN.test(oe)||oe[oe.length-1]==="_")}function constructYamlFloat(oe){var ne,ce;return ne=oe.replace(/_/g,"").toLowerCase(),ce=ne[0]==="-"?-1:1,"+-".indexOf(ne[0])>=0&&(ne=ne.slice(1)),ne===".inf"?ce===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:ne===".nan"?NaN:ce*parseFloat(ne,10)}var SCIENTIFIC_WITHOUT_DOT=/^[-+]?[0-9]+e/;function representYamlFloat(oe,ne){var ce;if(isNaN(oe))switch(ne){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===oe)switch(ne){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===oe)switch(ne){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(common.isNegativeZero(oe))return"-0.0";return ce=oe.toString(10),SCIENTIFIC_WITHOUT_DOT.test(ce)?ce.replace("e",".e"):ce}function isFloat(oe){return Object.prototype.toString.call(oe)==="[object Number]"&&(oe%1!==0||common.isNegativeZero(oe))}var float=new type("tag:yaml.org,2002:float",{kind:"scalar",resolve:resolveYamlFloat,construct:constructYamlFloat,predicate:isFloat,represent:representYamlFloat,defaultStyle:"lowercase"}),json$1=failsafe$1.extend({implicit:[_null,bool,int,float]}),core$1=json$1,YAML_DATE_REGEXP=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),YAML_TIMESTAMP_REGEXP=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function resolveYamlTimestamp(oe){return oe===null?!1:YAML_DATE_REGEXP.exec(oe)!==null||YAML_TIMESTAMP_REGEXP.exec(oe)!==null}function constructYamlTimestamp(oe){var ne,ce,ue,pe,me,ge,ve,ye=0,xe=null,_e,we,$e;if(ne=YAML_DATE_REGEXP.exec(oe),ne===null&&(ne=YAML_TIMESTAMP_REGEXP.exec(oe)),ne===null)throw new Error("Date resolve error");if(ce=+ne[1],ue=+ne[2]-1,pe=+ne[3],!ne[4])return new Date(Date.UTC(ce,ue,pe));if(me=+ne[4],ge=+ne[5],ve=+ne[6],ne[7]){for(ye=ne[7].slice(0,3);ye.length<3;)ye+="0";ye=+ye}return ne[9]&&(_e=+ne[10],we=+(ne[11]||0),xe=(_e*60+we)*6e4,ne[9]==="-"&&(xe=-xe)),$e=new Date(Date.UTC(ce,ue,pe,me,ge,ve,ye)),xe&&$e.setTime($e.getTime()-xe),$e}function representYamlTimestamp(oe){return oe.toISOString()}var timestamp$1=new type("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:resolveYamlTimestamp,construct:constructYamlTimestamp,instanceOf:Date,represent:representYamlTimestamp});function resolveYamlMerge(oe){return oe==="<<"||oe===null}var merge$2=new type("tag:yaml.org,2002:merge",{kind:"scalar",resolve:resolveYamlMerge}),BASE64_MAP=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= \r`;function resolveYamlBinary(oe){if(oe===null)return!1;var ne,ce,ue=0,pe=oe.length,me=BASE64_MAP;for(ce=0;ce64)){if(ne<0)return!1;ue+=6}return ue%8===0}function constructYamlBinary(oe){var ne,ce,ue=oe.replace(/[\r\n=]/g,""),pe=ue.length,me=BASE64_MAP,ge=0,ve=[];for(ne=0;ne>16&255),ve.push(ge>>8&255),ve.push(ge&255)),ge=ge<<6|me.indexOf(ue.charAt(ne));return ce=pe%4*6,ce===0?(ve.push(ge>>16&255),ve.push(ge>>8&255),ve.push(ge&255)):ce===18?(ve.push(ge>>10&255),ve.push(ge>>2&255)):ce===12&&ve.push(ge>>4&255),new Uint8Array(ve)}function representYamlBinary(oe){var ne="",ce=0,ue,pe,me=oe.length,ge=BASE64_MAP;for(ue=0;ue>18&63],ne+=ge[ce>>12&63],ne+=ge[ce>>6&63],ne+=ge[ce&63]),ce=(ce<<8)+oe[ue];return pe=me%3,pe===0?(ne+=ge[ce>>18&63],ne+=ge[ce>>12&63],ne+=ge[ce>>6&63],ne+=ge[ce&63]):pe===2?(ne+=ge[ce>>10&63],ne+=ge[ce>>4&63],ne+=ge[ce<<2&63],ne+=ge[64]):pe===1&&(ne+=ge[ce>>2&63],ne+=ge[ce<<4&63],ne+=ge[64],ne+=ge[64]),ne}function isBinary$1(oe){return Object.prototype.toString.call(oe)==="[object Uint8Array]"}var binary$1=new type("tag:yaml.org,2002:binary",{kind:"scalar",resolve:resolveYamlBinary,construct:constructYamlBinary,predicate:isBinary$1,represent:representYamlBinary}),_hasOwnProperty$3=Object.prototype.hasOwnProperty,_toString$2=Object.prototype.toString;function resolveYamlOmap(oe){if(oe===null)return!0;var ne=[],ce,ue,pe,me,ge,ve=oe;for(ce=0,ue=ve.length;ce - +