moi-computer 0.9.0 → 0.9.1-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/api/app-config.ts +51 -0
- package/client/api/workspace-keys.ts +1 -0
- package/client/app/routes/WorkspaceRoute.tsx +4 -2
- package/client/assets/hermes.png +0 -0
- package/client/components/shared/IconGhost.tsx +15 -18
- package/client/components/ui/button.tsx +2 -2
- package/client/components/ui/hover-card.tsx +1 -1
- package/client/components/ui/popover.tsx +3 -1
- package/client/features/applets/api.ts +38 -0
- package/client/features/applets/applet-thumbnail.ts +208 -0
- package/client/features/chat/ChatEmptyState.tsx +30 -10
- package/client/features/chat/ChatPanel.tsx +67 -31
- package/client/features/chat/ChatPopup.tsx +3 -2
- package/client/features/chat/ChatPromptBubbles.tsx +1 -1
- package/client/features/chat/ChatSelector.tsx +29 -10
- package/client/features/chat/MarkdownContent.tsx +3 -3
- package/client/features/chat/attachment-staging.ts +153 -0
- package/client/features/chat/chat-send.ts +55 -0
- package/client/features/chat/chat-store.ts +32 -8
- package/client/features/chat/composer/ChatComposer.tsx +190 -77
- package/client/features/chat/{ModelPicker.tsx → composer/ModelPicker.tsx} +29 -25
- package/client/features/chat/composer/banners/ComposerBanner.tsx +1 -1
- package/client/features/chat/composer/banners/WorkspaceAgentAvailabilityBanner.tsx +4 -13
- package/client/features/chat/{model-order.ts → composer/model-order.ts} +16 -0
- package/client/features/chat/composer/useWorkspaceComposerState.tsx +9 -4
- package/client/features/chat/tool-group/format/claude.ts +48 -0
- package/client/features/chat/tool-group/format/codex.ts +126 -0
- package/client/features/chat/tool-group/format/hermes.ts +68 -0
- package/client/features/chat/tool-group/format/index.ts +34 -0
- package/client/features/chat/tool-group/format/mcp.ts +64 -0
- package/client/features/chat/tool-group/format/openclaw.ts +116 -0
- package/client/features/chat/tool-group/format/shared.ts +49 -0
- package/client/features/chat/useChat.ts +5 -10
- package/client/features/drawings/DrawingLayer.tsx +49 -0
- package/client/features/drawings/DrawingToolbar.tsx +95 -0
- package/client/features/drawings/capture-element.ts +45 -0
- package/client/features/drawings/useChatAnnotation.ts +222 -0
- package/client/features/drawings/useDrawingLayer.ts +758 -0
- package/client/features/drawings/useViewBuilderSketch.ts +151 -0
- package/client/features/home/HomePage.tsx +13 -0
- package/client/features/home/WorkspacePreview.tsx +10 -5
- package/client/features/home/workspace-presentation.tsx +6 -2
- package/client/features/home/workspace-setup/CreateWorkspaceDialog.tsx +9 -0
- package/client/features/home/workspace-setup/InstallMoiDialog.tsx +245 -0
- package/client/features/home/workspace-setup/WorkspaceAgentStep.tsx +13 -7
- package/client/features/home/workspace-setup/WorkspaceDialogContent.tsx +1 -1
- package/client/features/scratchpad/ScratchpadControls.tsx +19 -5
- package/client/features/views/ViewBuilder.tsx +238 -0
- package/client/features/views/ViewManager.tsx +18 -2
- package/client/features/views/api.ts +1 -0
- package/client/features/views/useViewBuilderActions.ts +24 -3
- package/client/features/views/useViewBuilderDrafts.ts +66 -0
- package/client/features/widgets/WidgetFrame.tsx +1 -1
- package/client/features/widgets/WidgetGrid.tsx +1 -1
- package/client/features/widgets/Widgets.tsx +39 -54
- package/client/features/workspace/CustomizePanel.tsx +30 -9
- package/client/features/workspace/WorkspaceScreen.tsx +158 -64
- package/client/features/workspace/WorkspaceTabs.tsx +3 -3
- package/client/features/workspace/useFitsSplitLayout.ts +14 -8
- package/client/index.css +8 -0
- package/client/index.tsx +6 -1
- package/client/runtime/useWorkspaceEvents.ts +17 -0
- package/client/runtime/workspace-theme.ts +29 -6
- package/client/store/ui.ts +19 -0
- package/client/theme.css +33 -8
- package/dist/chunk-5c19v3zr.js +10 -0
- package/dist/chunk-6wx91x8j.js +1 -0
- package/dist/chunk-8s41nd3g.js +1 -0
- package/dist/{chunk-kkj86722.js → chunk-a7fzp0z0.js} +78 -78
- package/dist/{chunk-2vaafjp4.js → chunk-b959mdkj.js} +1 -1
- package/dist/chunk-cagtq45k.js +1 -0
- package/dist/chunk-cva7jpt4.js +82 -0
- package/dist/chunk-sapvd7he.css +1 -0
- package/dist/{chunk-35fq49qa.js → chunk-zbeq02yc.js} +1 -1
- package/dist/chunk-zbt8emsw.js +2 -0
- package/dist/chunk-zfz3b4xg.js +2 -0
- package/dist/hermes-pznd63x9.png +0 -0
- package/dist/index.html +1 -1
- package/lib/format.ts +1 -1
- package/lib/themes.ts +8 -8
- package/lib/types.ts +68 -42
- package/lib/workspace-types.ts +2 -1
- package/package.json +2 -1
- package/server/api.ts +90 -33
- package/server/app-config.ts +144 -0
- package/server/applets.ts +17 -0
- package/server/cli.ts +235 -14
- package/server/harness/README.md +64 -17
- package/server/harness/acp/adapter.ts +220 -0
- package/server/harness/acp/archived.ts +88 -0
- package/server/harness/acp/client.ts +328 -0
- package/server/harness/acp/discovery.ts +130 -0
- package/server/harness/acp/run-durations.ts +68 -0
- package/server/harness/acp/session.ts +788 -0
- package/server/harness/acp/wire.ts +132 -0
- package/server/harness/executable.ts +15 -1
- package/server/harness/hermes/NOTES.md +815 -0
- package/server/harness/hermes/discovery.ts +155 -0
- package/server/harness/hermes/index.ts +155 -0
- package/server/harness/hermes/models.ts +79 -0
- package/server/harness/registry.ts +3 -1
- package/server/layout.ts +40 -45
- package/server/moi-scaffold.ts +37 -1
- package/server/thumbnails.ts +197 -0
- package/server/view-builders.ts +4 -2
- package/server/views.ts +10 -1
- package/server/widgets.ts +4 -18
- package/server/workspace-import.ts +30 -1
- package/workspace/.claude/skills/moi-workspace/SKILL.md +13 -1
- package/workspace/.claude/skills/moi-workspace/references/DESIGN.md +153 -253
- package/client/features/chat/tool-group/format.ts +0 -384
- package/client/features/views/ViewBuilderTab.tsx +0 -152
- package/client/features/widgets/api.ts +0 -47
- package/client/features/widgets/useWidgetThumbnails.ts +0 -107
- package/client/features/widgets/widget-snapshot.ts +0 -71
- package/dist/chunk-3b3rkjet.js +0 -1
- package/dist/chunk-gt7n06ef.js +0 -1
- package/dist/chunk-ty1sqbmn.js +0 -80
- package/dist/chunk-xeyxk7ep.js +0 -10
- package/dist/chunk-yz6wd5vc.css +0 -1
package/dist/chunk-ty1sqbmn.js
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import{$ as rB,$a as sg,$b as Ov,A as AB,Aa as xg,Ab as Yv,Ac as g_,B as MD,Ba as hg,Bb as Kv,Bc as O4,C as AD,Ca as gg,Cb as Wv,Cc as Nh,D as F3,Da as vg,Db as fY,Dc as h5,E as tZ,Ea as LY,Eb as Bv,Ec as HC,F as DD,Fa as fg,Fb as cY,G as sB,Ga as dY,Gb as qv,H as _D,Ha as h3,Hb as Ny,I as OD,Ia as fy,Ib as KV,J as q4,Ja as gD,Jb as Vy,K as t8,Ka as vv,Kb as NW,L as ZT,La as mg,Lb as Uv,M as NY,Ma as ug,Mb as e8,N as ED,Na as pg,O as I7,Oa as Ry,Ob as Fv,P as iC,Pa as cg,Pb as Nv,Q as r9,Qa as dg,Qb as KX,R as QD,Ra as lg,Rb as Vv,S as U0,Sa as ig,Sb as Lv,T as mA,Ta as rg,Tb as UQ,U as BY,Ua as DE,Ub as hP,V as S1,Va as wj,Vb as Mv,W as TH,Wb as Av,X as WD,Xa as ag,Y as dB,Ya as FE,Yb as Dv,Z as lB,Za as S$,_ as iB,_a as ng,_b as _v,aa as aB,ab as Mf,ac as Pv,b as v,ba as nB,bb as og,bc as wv,c as l,cb as F$,cc as mh,d as W4,da as HL,db as tg,dc as jv,e as b70,ea as e,eb as eg,f as P5,fa as Cf,fc as NE,g as I0,ga as yJ,gb as $v,gc as mv,h as vX,ha as E0,hb as Zv,hc as Cv,i as K0,ia as Sy,j as W0,ja as Eg,jb as Jv,jc as Tv,k as y5,ka as hD,kb as vD,kc as Ev,l as XQ,la as yH,lb as _W,lc as Q8,m as _5,ma as Ig,mb as qQ,mc as Ah,n as AH,na as AE,nb as Wm,nc as KE,o as O8,ob as Qv,oc as MG,p as JD,pa as YC,pb as Bm,pc as BE,q as V5,qa as gv,qc as k_,r as U1,ra as BQ,rb as A1,rc as D_,s as HA,sa as Rg,sb as fD,sc as __,t as $G,ta as kg,tb as Vf,tc as x_,u as YD,ua as WQ,ub as Xv,v as R7,va as Sg,vb as Hv,vc as E_,w as E7,wa as bg,wb as Gv,wc as o5,x as _H,xa as pY,xb as ry,xc as Lm,y as iZ,ya as Km,yb as fv,yc as s1,z as Hq,za as yg,zb as zv,zc as h_}from"/chunk-xeyxk7ep.js";import{Fc as P,Gc as Z1,Hc as S4,Ic as Wh}from"/chunk-35fq49qa.js";var IX=Z1((rm)=>{var t4=P(v());function vm($,Z){return $===Z&&($!==0||1/$===1/Z)||$!==$&&Z!==Z}var fm=typeof Object.is==="function"?Object.is:vm,mm=t4.useState,um=t4.useEffect,pm=t4.useLayoutEffect,cm=t4.useDebugValue;function dm($,Z){var J=Z(),Q=mm({inst:{value:J,getSnapshot:Z}}),X=Q[0].inst,H=Q[1];return pm(function(){X.value=J,X.getSnapshot=Z,$B(X)&&H({inst:X})},[$,J,Z]),um(function(){return $B(X)&&H({inst:X}),$(function(){$B(X)&&H({inst:X})})},[$]),cm(J),J}function $B($){var Z=$.getSnapshot;$=$.value;try{var J=Z();return!fm($,J)}catch(Q){return!0}}function lm($,Z){return Z()}var im=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?lm:dm;rm.useSyncExternalStore=t4.useSyncExternalStore!==void 0?t4.useSyncExternalStore:im});var xE=Z1((Np0,yE)=>{var RE=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Cs=/\n/g,Ts=/^\s*/,Es=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Is=/^:\s*/,Rs=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,ks=/^[;\s]*/,Ss=/^\s+|\s+$/g,bs=`
|
|
2
|
-
`,kE="/",SE="*",l3="",ys="comment",xs="declaration";function hs($,Z){if(typeof $!=="string")throw TypeError("First argument must be a string");if(!$)return[];Z=Z||{};var J=1,Q=1;function X(F){var N=F.match(Cs);if(N)J+=N.length;var L=F.lastIndexOf(bs);Q=~L?F.length-L:Q+F.length}function H(){var F={line:J,column:Q};return function(N){return N.position=new G(F),K(),N}}function G(F){this.start=F,this.end={line:J,column:Q},this.source=Z.source}G.prototype.content=$;function z(F){var N=Error(Z.source+":"+J+":"+Q+": "+F);if(N.reason=F,N.filename=Z.source,N.line=J,N.column=Q,N.source=$,Z.silent);else throw N}function Y(F){var N=F.exec($);if(!N)return;var L=N[0];return X(L),$=$.slice(L.length),N}function K(){Y(Ts)}function W(F){var N;F=F||[];while(N=B())if(N!==!1)F.push(N);return F}function B(){var F=H();if(kE!=$.charAt(0)||SE!=$.charAt(1))return;var N=2;while(l3!=$.charAt(N)&&(SE!=$.charAt(N)||kE!=$.charAt(N+1)))++N;if(N+=2,l3===$.charAt(N-1))return z("End of comment missing");var L=$.slice(2,N-2);return Q+=2,X(L),$=$.slice(N),Q+=2,F({type:ys,comment:L})}function q(){var F=H(),N=Y(Es);if(!N)return;if(B(),!Y(Is))return z("property missing ':'");var L=Y(Rs),V=F({type:xs,property:bE(N[0].replace(RE,l3)),value:L?bE(L[0].replace(RE,l3)):l3});return Y(ks),V}function U(){var F=[];W(F);var N;while(N=q())if(N!==!1)F.push(N),W(F);return F}return K(),U()}function bE($){return $?$.replace(Ss,l3):l3}yE.exports=hs});var hE=Z1((LQ)=>{var gs=LQ&&LQ.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(LQ,"__esModule",{value:!0});LQ.default=fs;var vs=gs(xE());function fs($,Z){let J=null;if(!$||typeof $!=="string")return J;let Q=(0,vs.default)($),X=typeof Z==="function";return Q.forEach((H)=>{if(H.type!=="declaration")return;let{property:G,value:z}=H;if(X)Z(G,z,H);else if(z)J=J||{},J[G]=z}),J}});var mE=Z1((vE)=>{Object.defineProperty(vE,"__esModule",{value:!0});vE.camelCase=void 0;var ms=/^--[a-zA-Z0-9_-]+$/,us=/-([a-z])/g,ps=/^[^-]+$/,cs=/^-(webkit|moz|ms|o|khtml)-/,ds=/^-(ms)-/,ls=function($){return!$||ps.test($)||ms.test($)},is=function($,Z){return Z.toUpperCase()},gE=function($,Z){return"".concat(Z,"-")},rs=function($,Z){if(Z===void 0)Z={};if(ls($))return $;if($=$.toLowerCase(),Z.reactCompat)$=$.replace(ds,gE);else $=$.replace(cs,gE);return $.replace(us,is)};vE.camelCase=rs});var pE=Z1((PF,uE)=>{var as=PF&&PF.__importDefault||function($){return $&&$.__esModule?$:{default:$}},ns=as(hE()),ss=mE();function OF($,Z){var J={};if(!$||typeof $!=="string")return J;return(0,ns.default)($,function(Q,X){if(Q&&X)J[(0,ss.camelCase)(Q,Z)]=X}),J}OF.default=OF;uE.exports=OF});var KR=Z1((Ga0,YR)=>{var _K=Object.prototype.hasOwnProperty,zR=Object.prototype.toString,ZR=Object.defineProperty,JR=Object.getOwnPropertyDescriptor,QR=function(Z){if(typeof Array.isArray==="function")return Array.isArray(Z);return zR.call(Z)==="[object Array]"},XR=function(Z){if(!Z||zR.call(Z)!=="[object Object]")return!1;var J=_K.call(Z,"constructor"),Q=Z.constructor&&Z.constructor.prototype&&_K.call(Z.constructor.prototype,"isPrototypeOf");if(Z.constructor&&!J&&!Q)return!1;var X;for(X in Z);return typeof X>"u"||_K.call(Z,X)},HR=function(Z,J){if(ZR&&J.name==="__proto__")ZR(Z,J.name,{enumerable:!0,configurable:!0,value:J.newValue,writable:!0});else Z[J.name]=J.newValue},GR=function(Z,J){if(J==="__proto__"){if(!_K.call(Z,J))return;else if(JR)return JR(Z,J).value}return Z[J]};YR.exports=function $(){var Z,J,Q,X,H,G,z=arguments[0],Y=1,K=arguments.length,W=!1;if(typeof z==="boolean")W=z,z=arguments[1]||{},Y=2;if(z==null||typeof z!=="object"&&typeof z!=="function")z={};for(;Y<K;++Y)if(Z=arguments[Y],Z!=null){for(J in Z)if(Q=GR(z,J),X=GR(Z,J),z!==X){if(W&&X&&(XR(X)||(H=QR(X)))){if(H)H=!1,G=Q&&QR(Q)?Q:[];else G=Q&&XR(Q)?Q:{};HR(z,{name:J,newValue:$(W,G,X)})}else if(typeof X<"u")HR(z,{name:J,newValue:X})}}return z}});var ZS=Z1((Ts0,$S)=>{function fk($){if($ instanceof Map)$.clear=$.delete=$.set=function(){throw Error("map is read-only")};else if($ instanceof Set)$.add=$.clear=$.delete=function(){throw Error("set is read-only")};return Object.freeze($),Object.getOwnPropertyNames($).forEach((Z)=>{let J=$[Z],Q=typeof J;if((Q==="object"||Q==="function")&&!Object.isFrozen(J))fk(J)}),$}class FN{constructor($){if($.data===void 0)$.data={};this.data=$.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function mk($){return $.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function I6($,...Z){let J=Object.create(null);for(let Q in $)J[Q]=$[Q];return Z.forEach(function(Q){for(let X in Q)J[X]=Q[X]}),J}var O00="</span>",bk=($)=>{return!!$.scope},P00=($,{prefix:Z})=>{if($.startsWith("language:"))return $.replace("language:","language-");if($.includes(".")){let J=$.split(".");return[`${Z}${J.shift()}`,...J.map((Q,X)=>`${Q}${"_".repeat(X+1)}`)].join(" ")}return`${Z}${$}`};class uk{constructor($,Z){this.buffer="",this.classPrefix=Z.classPrefix,$.walk(this)}addText($){this.buffer+=mk($)}openNode($){if(!bk($))return;let Z=P00($.scope,{prefix:this.classPrefix});this.span(Z)}closeNode($){if(!bk($))return;this.buffer+=O00}value(){return this.buffer}span($){this.buffer+=`<span class="${$}">`}}var yk=($={})=>{let Z={children:[]};return Object.assign(Z,$),Z};class NN{constructor(){this.rootNode=yk(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add($){this.top.children.push($)}openNode($){let Z=yk({scope:$});this.add(Z),this.stack.push(Z)}closeNode(){if(this.stack.length>1)return this.stack.pop();return}closeAllNodes(){while(this.closeNode());}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk($){return this.constructor._walk($,this.rootNode)}static _walk($,Z){if(typeof Z==="string")$.addText(Z);else if(Z.children)$.openNode(Z),Z.children.forEach((J)=>this._walk($,J)),$.closeNode(Z);return $}static _collapse($){if(typeof $==="string")return;if(!$.children)return;if($.children.every((Z)=>typeof Z==="string"))$.children=[$.children.join("")];else $.children.forEach((Z)=>{NN._collapse(Z)})}}class pk extends NN{constructor($){super();this.options=$}addText($){if($==="")return;this.add($)}startScope($){this.openNode($)}endScope(){this.closeNode()}__addSublanguage($,Z){let J=$.root;if(Z)J.scope=`language:${Z}`;this.add(J)}toHTML(){return new uk(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function yQ($){if(!$)return null;if(typeof $==="string")return $;return $.source}function ck($){return Z7("(?=",$,")")}function w00($){return Z7("(?:",$,")*")}function j00($){return Z7("(?:",$,")?")}function Z7(...$){return $.map((J)=>yQ(J)).join("")}function C00($){let Z=$[$.length-1];if(typeof Z==="object"&&Z.constructor===Object)return $.splice($.length-1,1),Z;else return{}}function VN(...$){return"("+(C00($).capture?"":"?:")+$.map((Q)=>yQ(Q)).join("|")+")"}function dk($){return new RegExp($.toString()+"|").exec("").length-1}function T00($,Z){let J=$&&$.exec(Z);return J&&J.index===0}var E00=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function LN($,{joinWith:Z}){let J=0;return $.map((Q)=>{J+=1;let X=J,H=yQ(Q),G="";while(H.length>0){let z=E00.exec(H);if(!z){G+=H;break}if(G+=H.substring(0,z.index),H=H.substring(z.index+z[0].length),z[0][0]==="\\"&&z[1])G+="\\"+String(Number(z[1])+X);else if(G+=z[0],z[0]==="(")J++}return G}).map((Q)=>`(${Q})`).join(Z)}var I00=/\b\B/,lk="[a-zA-Z]\\w*",MN="[a-zA-Z_]\\w*",ik="\\b\\d+(\\.\\d+)?",rk="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",ak="\\b(0b[01]+)",R00="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",k00=($={})=>{let Z=/^#![ ]*\//;if($.binary)$.begin=Z7(Z,/.*\b/,$.binary,/\b.*/);return I6({scope:"meta",begin:Z,end:/$/,relevance:0,"on:begin":(J,Q)=>{if(J.index!==0)Q.ignoreMatch()}},$)},xQ={begin:"\\\\[\\s\\S]",relevance:0},S00={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[xQ]},b00={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[xQ]},y00={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},yK=function($,Z,J={}){let Q=I6({scope:"comment",begin:$,end:Z,contains:[]},J);Q.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let X=VN("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return Q.contains.push({begin:Z7(/[ ]+/,"(",X,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),Q},x00=yK("//","$"),h00=yK("/\\*","\\*/"),g00=yK("#","$"),v00={scope:"number",begin:ik,relevance:0},f00={scope:"number",begin:rk,relevance:0},m00={scope:"number",begin:ak,relevance:0},u00={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[xQ,{begin:/\[/,end:/\]/,relevance:0,contains:[xQ]}]},p00={scope:"title",begin:lk,relevance:0},c00={scope:"title",begin:MN,relevance:0},d00={begin:"\\.\\s*"+MN,relevance:0},l00=function($){return Object.assign($,{"on:begin":(Z,J)=>{J.data._beginMatch=Z[1]},"on:end":(Z,J)=>{if(J.data._beginMatch!==Z[1])J.ignoreMatch()}})},SK=Object.freeze({__proto__:null,APOS_STRING_MODE:S00,BACKSLASH_ESCAPE:xQ,BINARY_NUMBER_MODE:m00,BINARY_NUMBER_RE:ak,COMMENT:yK,C_BLOCK_COMMENT_MODE:h00,C_LINE_COMMENT_MODE:x00,C_NUMBER_MODE:f00,C_NUMBER_RE:rk,END_SAME_AS_BEGIN:l00,HASH_COMMENT_MODE:g00,IDENT_RE:lk,MATCH_NOTHING_RE:I00,METHOD_GUARD:d00,NUMBER_MODE:v00,NUMBER_RE:ik,PHRASAL_WORDS_MODE:y00,QUOTE_STRING_MODE:b00,REGEXP_MODE:u00,RE_STARTERS_RE:R00,SHEBANG:k00,TITLE_MODE:p00,UNDERSCORE_IDENT_RE:MN,UNDERSCORE_TITLE_MODE:c00});function i00($,Z){if($.input[$.index-1]===".")Z.ignoreMatch()}function r00($,Z){if($.className!==void 0)$.scope=$.className,delete $.className}function a00($,Z){if(!Z)return;if(!$.beginKeywords)return;if($.begin="\\b("+$.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",$.__beforeBegin=i00,$.keywords=$.keywords||$.beginKeywords,delete $.beginKeywords,$.relevance===void 0)$.relevance=0}function n00($,Z){if(!Array.isArray($.illegal))return;$.illegal=VN(...$.illegal)}function s00($,Z){if(!$.match)return;if($.begin||$.end)throw Error("begin & end are not supported with match");$.begin=$.match,delete $.match}function o00($,Z){if($.relevance===void 0)$.relevance=1}var t00=($,Z)=>{if(!$.beforeMatch)return;if($.starts)throw Error("beforeMatch cannot be used with starts");let J=Object.assign({},$);Object.keys($).forEach((Q)=>{delete $[Q]}),$.keywords=J.keywords,$.begin=Z7(J.beforeMatch,ck(J.begin)),$.starts={relevance:0,contains:[Object.assign(J,{endsParent:!0})]},$.relevance=0,delete J.beforeMatch},e00=["of","and","for","in","not","or","if","then","parent","list","value"],$50="keyword";function nk($,Z,J=$50){let Q=Object.create(null);if(typeof $==="string")X(J,$.split(" "));else if(Array.isArray($))X(J,$);else Object.keys($).forEach(function(H){Object.assign(Q,nk($[H],Z,H))});return Q;function X(H,G){if(Z)G=G.map((z)=>z.toLowerCase());G.forEach(function(z){let Y=z.split("|");Q[Y[0]]=[H,Z50(Y[0],Y[1])]})}}function Z50($,Z){if(Z)return Number(Z);return J50($)?0:1}function J50($){return e00.includes($.toLowerCase())}var xk={},$7=($)=>{console.error($)},hk=($,...Z)=>{console.log(`WARN: ${$}`,...Z)},l$=($,Z)=>{if(xk[`${$}/${Z}`])return;console.log(`Deprecated as of ${$}. ${Z}`),xk[`${$}/${Z}`]=!0},bK=Error();function sk($,Z,{key:J}){let Q=0,X=$[J],H={},G={};for(let z=1;z<=Z.length;z++)G[z+Q]=X[z],H[z+Q]=!0,Q+=dk(Z[z-1]);$[J]=G,$[J]._emit=H,$[J]._multi=!0}function Q50($){if(!Array.isArray($.begin))return;if($.skip||$.excludeBegin||$.returnBegin)throw $7("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),bK;if(typeof $.beginScope!=="object"||$.beginScope===null)throw $7("beginScope must be object"),bK;sk($,$.begin,{key:"beginScope"}),$.begin=LN($.begin,{joinWith:""})}function X50($){if(!Array.isArray($.end))return;if($.skip||$.excludeEnd||$.returnEnd)throw $7("skip, excludeEnd, returnEnd not compatible with endScope: {}"),bK;if(typeof $.endScope!=="object"||$.endScope===null)throw $7("endScope must be object"),bK;sk($,$.end,{key:"endScope"}),$.end=LN($.end,{joinWith:""})}function H50($){if($.scope&&typeof $.scope==="object"&&$.scope!==null)$.beginScope=$.scope,delete $.scope}function G50($){if(H50($),typeof $.beginScope==="string")$.beginScope={_wrap:$.beginScope};if(typeof $.endScope==="string")$.endScope={_wrap:$.endScope};Q50($),X50($)}function z50($){function Z(G,z){return new RegExp(yQ(G),"m"+($.case_insensitive?"i":"")+($.unicodeRegex?"u":"")+(z?"g":""))}class J{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(G,z){z.position=this.position++,this.matchIndexes[this.matchAt]=z,this.regexes.push([z,G]),this.matchAt+=dk(G)+1}compile(){if(this.regexes.length===0)this.exec=()=>null;let G=this.regexes.map((z)=>z[1]);this.matcherRe=Z(LN(G,{joinWith:"|"}),!0),this.lastIndex=0}exec(G){this.matcherRe.lastIndex=this.lastIndex;let z=this.matcherRe.exec(G);if(!z)return null;let Y=z.findIndex((W,B)=>B>0&&W!==void 0),K=this.matchIndexes[Y];return z.splice(0,Y),Object.assign(z,K)}}class Q{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(G){if(this.multiRegexes[G])return this.multiRegexes[G];let z=new J;return this.rules.slice(G).forEach(([Y,K])=>z.addRule(Y,K)),z.compile(),this.multiRegexes[G]=z,z}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(G,z){if(this.rules.push([G,z]),z.type==="begin")this.count++}exec(G){let z=this.getMatcher(this.regexIndex);z.lastIndex=this.lastIndex;let Y=z.exec(G);if(this.resumingScanAtSamePosition())if(Y&&Y.index===this.lastIndex);else{let K=this.getMatcher(0);K.lastIndex=this.lastIndex+1,Y=K.exec(G)}if(Y){if(this.regexIndex+=Y.position+1,this.regexIndex===this.count)this.considerAll()}return Y}}function X(G){let z=new Q;if(G.contains.forEach((Y)=>z.addRule(Y.begin,{rule:Y,type:"begin"})),G.terminatorEnd)z.addRule(G.terminatorEnd,{type:"end"});if(G.illegal)z.addRule(G.illegal,{type:"illegal"});return z}function H(G,z){let Y=G;if(G.isCompiled)return Y;[r00,s00,G50,t00].forEach((W)=>W(G,z)),$.compilerExtensions.forEach((W)=>W(G,z)),G.__beforeBegin=null,[a00,n00,o00].forEach((W)=>W(G,z)),G.isCompiled=!0;let K=null;if(typeof G.keywords==="object"&&G.keywords.$pattern)G.keywords=Object.assign({},G.keywords),K=G.keywords.$pattern,delete G.keywords.$pattern;if(K=K||/\w+/,G.keywords)G.keywords=nk(G.keywords,$.case_insensitive);if(Y.keywordPatternRe=Z(K,!0),z){if(!G.begin)G.begin=/\B|\b/;if(Y.beginRe=Z(Y.begin),!G.end&&!G.endsWithParent)G.end=/\B|\b/;if(G.end)Y.endRe=Z(Y.end);if(Y.terminatorEnd=yQ(Y.end)||"",G.endsWithParent&&z.terminatorEnd)Y.terminatorEnd+=(G.end?"|":"")+z.terminatorEnd}if(G.illegal)Y.illegalRe=Z(G.illegal);if(!G.contains)G.contains=[];if(G.contains=[].concat(...G.contains.map(function(W){return Y50(W==="self"?G:W)})),G.contains.forEach(function(W){H(W,Y)}),G.starts)H(G.starts,z);return Y.matcher=X(Y),Y}if(!$.compilerExtensions)$.compilerExtensions=[];if($.contains&&$.contains.includes("self"))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return $.classNameAliases=I6($.classNameAliases||{}),H($)}function ok($){if(!$)return!1;return $.endsWithParent||ok($.starts)}function Y50($){if($.variants&&!$.cachedVariants)$.cachedVariants=$.variants.map(function(Z){return I6($,{variants:null},Z)});if($.cachedVariants)return $.cachedVariants;if(ok($))return I6($,{starts:$.starts?I6($.starts):null});if(Object.isFrozen($))return I6($);return $}var K50="11.11.1";class tk extends Error{constructor($,Z){super($);this.name="HTMLInjectionError",this.html=Z}}var UN=mk,gk=I6,vk=Symbol("nomatch"),W50=7,ek=function($){let Z=Object.create(null),J=Object.create(null),Q=[],X=!0,H="Could not find the language '{}', did you forget to load/include a language module?",G={disableAutodetect:!0,name:"Plain text",contains:[]},z={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:pk};function Y(E){return z.noHighlightRe.test(E)}function K(E){let b=E.className+" ";b+=E.parentNode?E.parentNode.className:"";let g=z.languageDetectRe.exec(b);if(g){let u=k(g[1]);if(!u)hk(H.replace("{}",g[1])),hk("Falling back to no-highlight mode for this block.",E);return u?g[1]:"no-highlight"}return b.split(/\s+/).find((u)=>Y(u)||k(u))}function W(E,b,g){let u="",w="";if(typeof b==="object")u=E,g=b.ignoreIllegals,w=b.language;else l$("10.7.0","highlight(lang, code, ...args) has been deprecated."),l$("10.7.0",`Please use highlight(code, options) instead.
|
|
3
|
-
https://github.com/highlightjs/highlight.js/issues/2277`),w=E,u=b;if(g===void 0)g=!0;let s={code:u,language:w};R("before:highlight",s);let z0=s.result?s.result:B(s.language,s.code,g);return z0.code=s.code,R("after:highlight",z0),z0}function B(E,b,g,u){let w=Object.create(null);function s(m,i){return m.keywords[i]}function z0(){if(!a.keywords){o.addText(n);return}let m=0;a.keywordPatternRe.lastIndex=0;let i=a.keywordPatternRe.exec(n),f="";while(i){f+=n.substring(m,i.index);let X0=G0.case_insensitive?i[0].toLowerCase():i[0],L0=s(a,X0);if(L0){let[k0,r0]=L0;if(o.addText(f),f="",w[X0]=(w[X0]||0)+1,w[X0]<=W50)V0+=r0;if(k0.startsWith("_"))f+=i[0];else{let J5=G0.classNameAliases[k0]||k0;M0(i[0],J5)}}else f+=i[0];m=a.keywordPatternRe.lastIndex,i=a.keywordPatternRe.exec(n)}f+=n.substring(m),o.addText(f)}function h(){if(n==="")return;let m=null;if(typeof a.subLanguage==="string"){if(!Z[a.subLanguage]){o.addText(n);return}m=B(a.subLanguage,n,!0,p[a.subLanguage]),p[a.subLanguage]=m._top}else m=U(n,a.subLanguage.length?a.subLanguage:null);if(a.relevance>0)V0+=m.relevance;o.__addSublanguage(m._emitter,m.language)}function t(){if(a.subLanguage!=null)h();else z0();n=""}function M0(m,i){if(m==="")return;o.startScope(i),o.addText(m),o.endScope()}function d(m,i){let f=1,X0=i.length-1;while(f<=X0){if(!m._emit[f]){f++;continue}let L0=G0.classNameAliases[m[f]]||m[f],k0=i[f];if(L0)M0(k0,L0);else n=k0,z0(),n="";f++}}function Y0(m,i){if(m.scope&&typeof m.scope==="string")o.openNode(G0.classNameAliases[m.scope]||m.scope);if(m.beginScope){if(m.beginScope._wrap)M0(n,G0.classNameAliases[m.beginScope._wrap]||m.beginScope._wrap),n="";else if(m.beginScope._multi)d(m.beginScope,i),n=""}return a=Object.create(m,{parent:{value:a}}),a}function B0(m,i,f){let X0=T00(m.endRe,f);if(X0){if(m["on:end"]){let L0=new FN(m);if(m["on:end"](i,L0),L0.isMatchIgnored)X0=!1}if(X0){while(m.endsParent&&m.parent)m=m.parent;return m}}if(m.endsWithParent)return B0(m.parent,i,f)}function J0(m){if(a.matcher.regexIndex===0)return n+=m[0],1;else return c0=!0,0}function H0(m){let i=m[0],f=m.rule,X0=new FN(f),L0=[f.__beforeBegin,f["on:begin"]];for(let k0 of L0){if(!k0)continue;if(k0(m,X0),X0.isMatchIgnored)return J0(i)}if(f.skip)n+=i;else{if(f.excludeBegin)n+=i;if(t(),!f.returnBegin&&!f.excludeBegin)n=i}return Y0(f,m),f.returnBegin?0:i.length}function N0(m){let i=m[0],f=b.substring(m.index),X0=B0(a,m,f);if(!X0)return vk;let L0=a;if(a.endScope&&a.endScope._wrap)t(),M0(i,a.endScope._wrap);else if(a.endScope&&a.endScope._multi)t(),d(a.endScope,m);else if(L0.skip)n+=i;else{if(!(L0.returnEnd||L0.excludeEnd))n+=i;if(t(),L0.excludeEnd)n=i}do{if(a.scope)o.closeNode();if(!a.skip&&!a.subLanguage)V0+=a.relevance;a=a.parent}while(a!==X0.parent);if(X0.starts)Y0(X0.starts,m);return L0.returnEnd?0:i.length}function c(){let m=[];for(let i=a;i!==G0;i=i.parent)if(i.scope)m.unshift(i.scope);m.forEach((i)=>o.openNode(i))}let Z0={};function $0(m,i){let f=i&&i[0];if(n+=m,f==null)return t(),0;if(Z0.type==="begin"&&i.type==="end"&&Z0.index===i.index&&f===""){if(n+=b.slice(i.index,i.index+1),!X){let X0=Error(`0 width match regex (${E})`);throw X0.languageName=E,X0.badRule=Z0.rule,X0}return 1}if(Z0=i,i.type==="begin")return H0(i);else if(i.type==="illegal"&&!g){let X0=Error('Illegal lexeme "'+f+'" for mode "'+(a.scope||"<unnamed>")+'"');throw X0.mode=a,X0}else if(i.type==="end"){let X0=N0(i);if(X0!==vk)return X0}if(i.type==="illegal"&&f==="")return n+=`
|
|
4
|
-
`,1;if(v0>1e5&&v0>i.index*3)throw Error("potential infinite loop, way more iterations than matches");return n+=f,f.length}let G0=k(E);if(!G0)throw $7(H.replace("{}",E)),Error('Unknown language: "'+E+'"');let r=z50(G0),Q0="",a=u||r,p={},o=new z.__emitter(z);c();let n="",V0=0,w0=0,v0=0,c0=!1;try{if(!G0.__emitTokens){a.matcher.considerAll();for(;;){if(v0++,c0)c0=!1;else a.matcher.considerAll();a.matcher.lastIndex=w0;let m=a.matcher.exec(b);if(!m)break;let i=b.substring(w0,m.index),f=$0(i,m);w0=m.index+f}$0(b.substring(w0))}else G0.__emitTokens(b,o);return o.finalize(),Q0=o.toHTML(),{language:E,value:Q0,relevance:V0,illegal:!1,_emitter:o,_top:a}}catch(m){if(m.message&&m.message.includes("Illegal"))return{language:E,value:UN(b),illegal:!0,relevance:0,_illegalBy:{message:m.message,index:w0,context:b.slice(w0-100,w0+100),mode:m.mode,resultSoFar:Q0},_emitter:o};else if(X)return{language:E,value:UN(b),illegal:!1,relevance:0,errorRaised:m,_emitter:o,_top:a};else throw m}}function q(E){let b={value:UN(E),illegal:!1,relevance:0,_top:G,_emitter:new z.__emitter(z)};return b._emitter.addText(E),b}function U(E,b){b=b||z.languages||Object.keys(Z);let g=q(E),u=b.filter(k).filter(I).map((t)=>B(t,E,!1));u.unshift(g);let w=u.sort((t,M0)=>{if(t.relevance!==M0.relevance)return M0.relevance-t.relevance;if(t.language&&M0.language){if(k(t.language).supersetOf===M0.language)return 1;else if(k(M0.language).supersetOf===t.language)return-1}return 0}),[s,z0]=w,h=s;return h.secondBest=z0,h}function F(E,b,g){let u=b&&J[b]||g;E.classList.add("hljs"),E.classList.add(`language-${u}`)}function N(E){let b=null,g=K(E);if(Y(g))return;if(R("before:highlightElement",{el:E,language:g}),E.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",E);return}if(E.children.length>0){if(!z.ignoreUnescapedHTML)console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(E);if(z.throwUnescapedHTML)throw new tk("One of your code blocks includes unescaped HTML.",E.innerHTML)}b=E;let u=b.textContent,w=g?W(u,{language:g,ignoreIllegals:!0}):U(u);if(E.innerHTML=w.value,E.dataset.highlighted="yes",F(E,g,w.language),E.result={language:w.language,re:w.relevance,relevance:w.relevance},w.secondBest)E.secondBest={language:w.secondBest.language,relevance:w.secondBest.relevance};R("after:highlightElement",{el:E,result:w,text:u})}function L(E){z=gk(z,E)}let V=()=>{O(),l$("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function M(){O(),l$("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let A=!1;function O(){function E(){O()}if(document.readyState==="loading"){if(!A)window.addEventListener("DOMContentLoaded",E,!1);A=!0;return}document.querySelectorAll(z.cssSelector).forEach(N)}function _(E,b){let g=null;try{g=b($)}catch(u){if($7("Language definition for '{}' could not be registered.".replace("{}",E)),!X)throw u;else $7(u);g=G}if(!g.name)g.name=E;if(Z[E]=g,g.rawDefinition=b.bind(null,$),g.aliases)x(g.aliases,{languageName:E})}function D(E){delete Z[E];for(let b of Object.keys(J))if(J[b]===E)delete J[b]}function T(){return Object.keys(Z)}function k(E){return E=(E||"").toLowerCase(),Z[E]||Z[J[E]]}function x(E,{languageName:b}){if(typeof E==="string")E=[E];E.forEach((g)=>{J[g.toLowerCase()]=b})}function I(E){let b=k(E);return b&&!b.disableAutodetect}function y(E){if(E["before:highlightBlock"]&&!E["before:highlightElement"])E["before:highlightElement"]=(b)=>{E["before:highlightBlock"](Object.assign({block:b.el},b))};if(E["after:highlightBlock"]&&!E["after:highlightElement"])E["after:highlightElement"]=(b)=>{E["after:highlightBlock"](Object.assign({block:b.el},b))}}function C(E){y(E),Q.push(E)}function j(E){let b=Q.indexOf(E);if(b!==-1)Q.splice(b,1)}function R(E,b){let g=E;Q.forEach(function(u){if(u[g])u[g](b)})}function S(E){return l$("10.7.0","highlightBlock will be removed entirely in v12.0"),l$("10.7.0","Please use highlightElement now."),N(E)}Object.assign($,{highlight:W,highlightAuto:U,highlightAll:O,highlightElement:N,highlightBlock:S,configure:L,initHighlighting:V,initHighlightingOnLoad:M,registerLanguage:_,unregisterLanguage:D,listLanguages:T,getLanguage:k,registerAliases:x,autoDetection:I,inherit:gk,addPlugin:C,removePlugin:j}),$.debugMode=function(){X=!1},$.safeMode=function(){X=!0},$.versionString=K50,$.regex={concat:Z7,lookahead:ck,either:VN,optional:j00,anyNumberOfTimes:w00};for(let E in SK)if(typeof SK[E]==="object")fk(SK[E]);return Object.assign($,SK),$},i$=ek({});i$.newInstance=()=>ek({});$S.exports=i$;i$.HighlightJS=i$;i$.default=i$});var Kx=Z1((QW,Yx)=>{(function($,Z){typeof QW==="object"&&typeof Yx<"u"?Z(QW):typeof define==="function"&&define.amd?define(["exports"],Z):($=typeof globalThis<"u"?globalThis:$||self,Z($["fast-equals"]={}))})(QW,function($){function Z(d){return function(B0,J0,H0,N0,c,Z0,$0){return d(B0,J0,$0)}}function J(d){return function(B0,J0,H0,N0){if(!B0||!J0||typeof B0!=="object"||typeof J0!=="object")return d(B0,J0,H0,N0);var c=N0.get(B0),Z0=N0.get(J0);if(c&&Z0)return c===J0&&Z0===B0;N0.set(B0,J0),N0.set(J0,B0);var $0=d(B0,J0,H0,N0);return N0.delete(B0),N0.delete(J0),$0}}function Q(d,Y0){var B0={};for(var J0 in d)B0[J0]=d[J0];for(var J0 in Y0)B0[J0]=Y0[J0];return B0}function X(d){return d.constructor===Object||d.constructor==null}function H(d){return typeof d.then==="function"}function G(d,Y0){return d===Y0||d!==d&&Y0!==Y0}var z="[object Arguments]",Y="[object Boolean]",K="[object Date]",W="[object RegExp]",B="[object Map]",q="[object Number]",U="[object Object]",F="[object Set]",N="[object String]",L=Object.prototype.toString;function V(d){var{areArraysEqual:Y0,areDatesEqual:B0,areMapsEqual:J0,areObjectsEqual:H0,areRegExpsEqual:N0,areSetsEqual:c,createIsNestedEqual:Z0}=d,$0=Z0(G0);function G0(r,Q0,a){if(r===Q0)return!0;if(!r||!Q0||typeof r!=="object"||typeof Q0!=="object")return r!==r&&Q0!==Q0;if(X(r)&&X(Q0))return H0(r,Q0,$0,a);var p=Array.isArray(r),o=Array.isArray(Q0);if(p||o)return p===o&&Y0(r,Q0,$0,a);var n=L.call(r);if(n!==L.call(Q0))return!1;if(n===K)return B0(r,Q0,$0,a);if(n===W)return N0(r,Q0,$0,a);if(n===B)return J0(r,Q0,$0,a);if(n===F)return c(r,Q0,$0,a);if(n===U||n===z)return H(r)||H(Q0)?!1:H0(r,Q0,$0,a);if(n===Y||n===q||n===N)return G(r.valueOf(),Q0.valueOf());return!1}return G0}function M(d,Y0,B0,J0){var H0=d.length;if(Y0.length!==H0)return!1;while(H0-- >0)if(!B0(d[H0],Y0[H0],H0,H0,d,Y0,J0))return!1;return!0}var A=J(M);function O(d,Y0){return G(d.valueOf(),Y0.valueOf())}function _(d,Y0,B0,J0){var H0=d.size===Y0.size;if(!H0)return!1;if(!d.size)return!0;var N0={},c=0;return d.forEach(function(Z0,$0){if(!H0)return;var G0=!1,r=0;Y0.forEach(function(Q0,a){if(!G0&&!N0[r]&&(G0=B0($0,a,c,r,d,Y0,J0)&&B0(Z0,Q0,$0,a,d,Y0,J0)))N0[r]=!0;r++}),c++,H0=G0}),H0}var D=J(_),T="_owner",k=Object.prototype.hasOwnProperty;function x(d,Y0,B0,J0){var H0=Object.keys(d),N0=H0.length;if(Object.keys(Y0).length!==N0)return!1;var c;while(N0-- >0){if(c=H0[N0],c===T){var Z0=!!d.$$typeof,$0=!!Y0.$$typeof;if((Z0||$0)&&Z0!==$0)return!1}if(!k.call(Y0,c)||!B0(d[c],Y0[c],c,c,d,Y0,J0))return!1}return!0}var I=J(x);function y(d,Y0){return d.source===Y0.source&&d.flags===Y0.flags}function C(d,Y0,B0,J0){var H0=d.size===Y0.size;if(!H0)return!1;if(!d.size)return!0;var N0={};return d.forEach(function(c,Z0){if(!H0)return;var $0=!1,G0=0;Y0.forEach(function(r,Q0){if(!$0&&!N0[G0]&&($0=B0(c,r,Z0,Q0,d,Y0,J0)))N0[G0]=!0;G0++}),H0=$0}),H0}var j=J(C),R=Object.freeze({areArraysEqual:M,areDatesEqual:O,areMapsEqual:_,areObjectsEqual:x,areRegExpsEqual:y,areSetsEqual:C,createIsNestedEqual:Z}),S=Object.freeze({areArraysEqual:A,areDatesEqual:O,areMapsEqual:D,areObjectsEqual:I,areRegExpsEqual:y,areSetsEqual:j,createIsNestedEqual:Z}),E=V(R);function b(d,Y0){return E(d,Y0,void 0)}var g=V(Q(R,{createIsNestedEqual:function(){return G}}));function u(d,Y0){return g(d,Y0,void 0)}var w=V(S);function s(d,Y0){return w(d,Y0,new WeakMap)}var z0=V(Q(S,{createIsNestedEqual:function(){return G}}));function h(d,Y0){return z0(d,Y0,new WeakMap)}function t(d){return V(Q(R,d(R)))}function M0(d){var Y0=V(Q(S,d(S)));return function(B0,J0,H0){if(H0===void 0)H0=new WeakMap;return Y0(B0,J0,H0)}}$.circularDeepEqual=s,$.circularShallowEqual=h,$.createCustomCircularEqual=M0,$.createCustomEqual=t,$.deepEqual=b,$.sameValueZeroEqual=G,$.shallowEqual=u,Object.defineProperty($,"__esModule",{value:!0})})});var Bx=Z1((v45,Wx)=>{var e40="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";Wx.exports=e40});var Nx=Z1((f45,Fx)=>{var $20=Bx();function qx(){}function Ux(){}Ux.resetWarningCache=qx;Fx.exports=function(){function $(Q,X,H,G,z,Y){if(Y===$20)return;var K=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw K.name="Invariant Violation",K}$.isRequired=$;function Z(){return $}var J={array:$,bigint:$,bool:$,func:$,number:$,object:$,string:$,symbol:$,any:$,arrayOf:Z,element:$,elementType:$,instanceOf:Z,node:$,objectOf:Z,oneOf:Z,oneOfType:Z,shape:Z,exact:Z,checkPropTypes:Ux,resetWarningCache:qx};return J.PropTypes=J,J}});var tQ=Z1((m45,Vx)=>{Vx.exports=Nx()();var Z20,J20});var Ax=Z1((u45,fV)=>{function Mx($){var Z,J,Q="";if(typeof $=="string"||typeof $=="number")Q+=$;else if(typeof $=="object")if(Array.isArray($)){var X=$.length;for(Z=0;Z<X;Z++)$[Z]&&(J=Mx($[Z]))&&(Q&&(Q+=" "),Q+=J)}else for(J in $)$[J]&&(Q&&(Q+=" "),Q+=J);return Q}function Lx(){for(var $,Z,J=0,Q="",X=arguments.length;J<X;J++)($=arguments[J])&&(Z=Mx($))&&(Q&&(Q+=" "),Q+=Z);return Q}fV.exports=Lx,fV.exports.clsx=Lx});var eQ=Z1((Dx)=>{Object.defineProperty(Dx,"__esModule",{value:!0});Dx.dontSetMe=z20;Dx.findInArray=Q20;Dx.int=G20;Dx.isFunction=X20;Dx.isNum=H20;function Q20($,Z){for(let J=0,Q=$.length;J<Q;J++)if(Z.apply(Z,[$[J],J,$]))return $[J]}function X20($){return typeof $==="function"||Object.prototype.toString.call($)==="[object Function]"}function H20($){return typeof $==="number"&&!isNaN($)}function G20($){return parseInt($,10)}function z20($,Z,J){if($[Z])return Error(`Invalid prop ${Z} passed to ${J} - do not set this, set it on the child.`)}});var jx=Z1((Px)=>{Object.defineProperty(Px,"__esModule",{value:!0});Px.browserPrefixToKey=Ox;Px.browserPrefixToStyle=U20;Px.default=void 0;Px.getPrefix=_x;var mV=["Moz","Webkit","O","ms"];function _x(){let $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";let Z=window.document?.documentElement?.style;if(!Z)return"";if($ in Z)return"";for(let J=0;J<mV.length;J++)if(Ox($,mV[J])in Z)return mV[J];return""}function Ox($,Z){return Z?`${Z}${F20($)}`:$}function U20($,Z){return Z?`-${Z.toLowerCase()}-${$}`:$}function F20($){let Z="",J=!0;for(let Q=0;Q<$.length;Q++)if(J)Z+=$[Q].toUpperCase(),J=!1;else if($[Q]==="-")J=!0;else Z+=$[Q];return Z}var c45=Px.default=_x()});var HW=Z1((Sx)=>{Object.defineProperty(Sx,"__esModule",{value:!0});Sx.addClassName=Rx;Sx.addEvent=A20;Sx.addUserSelectStyles=R20;Sx.createCSSTransform=C20;Sx.createSVGTransform=T20;Sx.getTouch=E20;Sx.getTouchIdentifier=I20;Sx.getTranslation=uV;Sx.innerHeight=P20;Sx.innerWidth=w20;Sx.matchesSelector=Ix;Sx.matchesSelectorAndParentsTo=M20;Sx.offsetXYFromParent=j20;Sx.outerHeight=_20;Sx.outerWidth=O20;Sx.removeClassName=kx;Sx.removeEvent=D20;Sx.scheduleRemoveUserSelectStyles=k20;var w4=eQ(),Cx=Ex(jx());function Ex($,Z){if(typeof WeakMap=="function")var J=new WeakMap,Q=new WeakMap;return(Ex=function(X,H){if(!H&&X&&X.__esModule)return X;var G,z,Y={__proto__:null,default:X};if(X===null||typeof X!="object"&&typeof X!="function")return Y;if(G=H?Q:J){if(G.has(X))return G.get(X);G.set(X,Y)}for(let K in X)K!=="default"&&{}.hasOwnProperty.call(X,K)&&((z=(G=Object.defineProperty)&&Object.getOwnPropertyDescriptor(X,K))&&(z.get||z.set)?G(Y,K,z):Y[K]=X[K]);return Y})($,Z)}var XW="";function Ix($,Z){if(!XW)XW=(0,w4.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(J){return(0,w4.isFunction)($[J])});if(!(0,w4.isFunction)($[XW]))return!1;return $[XW](Z)}function M20($,Z,J){let Q=$;do{if(Ix(Q,Z))return!0;if(Q===J)return!1;Q=Q.parentNode}while(Q);return!1}function A20($,Z,J,Q){if(!$)return;let X={capture:!0,...Q};if($.addEventListener)$.addEventListener(Z,J,X);else if($.attachEvent)$.attachEvent("on"+Z,J);else $["on"+Z]=J}function D20($,Z,J,Q){if(!$)return;let X={capture:!0,...Q};if($.removeEventListener)$.removeEventListener(Z,J,X);else if($.detachEvent)$.detachEvent("on"+Z,J);else $["on"+Z]=null}function _20($){let Z=$.clientHeight,J=$.ownerDocument.defaultView.getComputedStyle($);return Z+=(0,w4.int)(J.borderTopWidth),Z+=(0,w4.int)(J.borderBottomWidth),Z}function O20($){let Z=$.clientWidth,J=$.ownerDocument.defaultView.getComputedStyle($);return Z+=(0,w4.int)(J.borderLeftWidth),Z+=(0,w4.int)(J.borderRightWidth),Z}function P20($){let Z=$.clientHeight,J=$.ownerDocument.defaultView.getComputedStyle($);return Z-=(0,w4.int)(J.paddingTop),Z-=(0,w4.int)(J.paddingBottom),Z}function w20($){let Z=$.clientWidth,J=$.ownerDocument.defaultView.getComputedStyle($);return Z-=(0,w4.int)(J.paddingLeft),Z-=(0,w4.int)(J.paddingRight),Z}function j20($,Z,J){let X=Z===Z.ownerDocument.body?{left:0,top:0}:Z.getBoundingClientRect(),H=($.clientX+Z.scrollLeft-X.left)/J,G=($.clientY+Z.scrollTop-X.top)/J;return{x:H,y:G}}function C20($,Z){let J=uV($,Z,"px");return{[(0,Cx.browserPrefixToKey)("transform",Cx.default)]:J}}function T20($,Z){return uV($,Z,"")}function uV($,Z,J){let{x:Q,y:X}=$,H=`translate(${Q}${J},${X}${J})`;if(Z){let G=`${typeof Z.x==="string"?Z.x:Z.x+J}`,z=`${typeof Z.y==="string"?Z.y:Z.y+J}`;H=`translate(${G}, ${z})`+H}return H}function E20($,Z){return $.targetTouches&&(0,w4.findInArray)($.targetTouches,(J)=>Z===J.identifier)||$.changedTouches&&(0,w4.findInArray)($.changedTouches,(J)=>Z===J.identifier)}function I20($){if($.targetTouches&&$.targetTouches[0])return $.targetTouches[0].identifier;if($.changedTouches&&$.changedTouches[0])return $.changedTouches[0].identifier}function R20($){if(!$)return;let Z=$.getElementById("react-draggable-style-el");if(!Z)Z=$.createElement("style"),Z.type="text/css",Z.id="react-draggable-style-el",Z.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
5
|
-
`,Z.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
|
|
6
|
-
`,$.getElementsByTagName("head")[0].appendChild(Z);if($.body)Rx($.body,"react-draggable-transparent-selection")}function k20($){if(window.requestAnimationFrame)window.requestAnimationFrame(()=>{Tx($)});else Tx($)}function Tx($){if(!$)return;try{if($.body)kx($.body,"react-draggable-transparent-selection");if($.selection)$.selection.empty();else{let Z=($.defaultView||window).getSelection();if(Z&&Z.type!=="Caret")Z.removeAllRanges()}}catch(Z){}}function Rx($,Z){if($.classList)$.classList.add(Z);else if(!$.className.match(new RegExp(`(?:^|\\s)${Z}(?!\\S)`)))$.className+=` ${Z}`}function kx($,Z){if($.classList)$.classList.remove(Z);else $.className=$.className.replace(new RegExp(`(?:^|\\s)${Z}(?!\\S)`,"g"),"")}});var cV=Z1((bx)=>{Object.defineProperty(bx,"__esModule",{value:!0});bx.canDragX=t20;bx.canDragY=e20;bx.createCoreData=Z90;bx.createDraggableData=J90;bx.getBoundPosition=s20;bx.getControlPosition=$90;bx.snapToGrid=o20;var j4=eQ(),zZ=HW();function s20($,Z,J){if(!$.props.bounds)return[Z,J];let{bounds:Q}=$.props;Q=typeof Q==="string"?Q:Q90(Q);let X=pV($);if(typeof Q==="string"){let{ownerDocument:H}=X,G=H.defaultView,z;if(Q==="parent")z=X.parentNode;else z=X.getRootNode().querySelector(Q);if(!(z instanceof G.HTMLElement))throw Error('Bounds selector "'+Q+'" could not find an element.');let Y=z,K=G.getComputedStyle(X),W=G.getComputedStyle(Y);Q={left:-X.offsetLeft+(0,j4.int)(W.paddingLeft)+(0,j4.int)(K.marginLeft),top:-X.offsetTop+(0,j4.int)(W.paddingTop)+(0,j4.int)(K.marginTop),right:(0,zZ.innerWidth)(Y)-(0,zZ.outerWidth)(X)-X.offsetLeft+(0,j4.int)(W.paddingRight)-(0,j4.int)(K.marginRight),bottom:(0,zZ.innerHeight)(Y)-(0,zZ.outerHeight)(X)-X.offsetTop+(0,j4.int)(W.paddingBottom)-(0,j4.int)(K.marginBottom)}}if((0,j4.isNum)(Q.right))Z=Math.min(Z,Q.right);if((0,j4.isNum)(Q.bottom))J=Math.min(J,Q.bottom);if((0,j4.isNum)(Q.left))Z=Math.max(Z,Q.left);if((0,j4.isNum)(Q.top))J=Math.max(J,Q.top);return[Z,J]}function o20($,Z,J){let Q=Math.round(Z/$[0])*$[0],X=Math.round(J/$[1])*$[1];return[Q,X]}function t20($){return $.props.axis==="both"||$.props.axis==="x"}function e20($){return $.props.axis==="both"||$.props.axis==="y"}function $90($,Z,J){let Q=typeof Z==="number"?(0,zZ.getTouch)($,Z):null;if(typeof Z==="number"&&!Q)return null;let X=pV(J),H=J.props.offsetParent||X.offsetParent||X.ownerDocument.body;return(0,zZ.offsetXYFromParent)(Q||$,H,J.props.scale)}function Z90($,Z,J){let Q=!(0,j4.isNum)($.lastX),X=pV($);if(Q)return{node:X,deltaX:0,deltaY:0,lastX:Z,lastY:J,x:Z,y:J};else return{node:X,deltaX:Z-$.lastX,deltaY:J-$.lastY,lastX:$.lastX,lastY:$.lastY,x:Z,y:J}}function J90($,Z){let J=$.props.scale;return{node:Z.node,x:$.state.x+Z.deltaX/J,y:$.state.y+Z.deltaY/J,deltaX:Z.deltaX/J,deltaY:Z.deltaY/J,lastX:$.state.x,lastY:$.state.y}}function Q90($){return{left:$.left,top:$.top,right:$.right,bottom:$.bottom}}function pV($){let Z=$.findDOMNode();if(!Z)throw Error("<DraggableCore>: Unmounted during event!");return Z}});var dV=Z1((yx)=>{Object.defineProperty(yx,"__esModule",{value:!0});yx.default=B90;function B90(){}});var vx=Z1((hx)=>{var V90=P(v()),L90=P(W4());Object.defineProperty(hx,"__esModule",{value:!0});hx.default=void 0;var lV=xx(V90),i8=rV(tQ()),U90=rV(L90),x8=HW(),f6=cV(),iV=eQ(),$X=rV(dV());function rV($){return $&&$.__esModule?$:{default:$}}function xx($,Z){if(typeof WeakMap=="function")var J=new WeakMap,Q=new WeakMap;return(xx=function(X,H){if(!H&&X&&X.__esModule)return X;var G,z,Y={__proto__:null,default:X};if(X===null||typeof X!="object"&&typeof X!="function")return Y;if(G=H?Q:J){if(G.has(X))return G.get(X);G.set(X,Y)}for(let K in X)K!=="default"&&{}.hasOwnProperty.call(X,K)&&((z=(G=Object.defineProperty)&&Object.getOwnPropertyDescriptor(X,K))&&(z.get||z.set)?G(Y,K,z):Y[K]=X[K]);return Y})($,Z)}function r8($,Z,J){return(Z=F90(Z))in $?Object.defineProperty($,Z,{value:J,enumerable:!0,configurable:!0,writable:!0}):$[Z]=J,$}function F90($){var Z=N90($,"string");return typeof Z=="symbol"?Z:Z+""}function N90($,Z){if(typeof $!="object"||!$)return $;var J=$[Symbol.toPrimitive];if(J!==void 0){var Q=J.call($,Z||"default");if(typeof Q!="object")return Q;throw TypeError("@@toPrimitive must return a primitive value.")}return(Z==="string"?String:Number)($)}var N2={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}},m6=N2.mouse;class ZX extends lV.Component{constructor(){super(...arguments);r8(this,"dragging",!1),r8(this,"lastX",NaN),r8(this,"lastY",NaN),r8(this,"touchIdentifier",null),r8(this,"mounted",!1),r8(this,"handleDragStart",($)=>{if(this.props.onMouseDown($),!this.props.allowAnyClick&&typeof $.button==="number"&&$.button!==0)return!1;let Z=this.findDOMNode();if(!Z||!Z.ownerDocument||!Z.ownerDocument.body)throw Error("<DraggableCore> not mounted on DragStart!");let{ownerDocument:J}=Z;if(this.props.disabled||!($.target instanceof J.defaultView.Node)||this.props.handle&&!(0,x8.matchesSelectorAndParentsTo)($.target,this.props.handle,Z)||this.props.cancel&&(0,x8.matchesSelectorAndParentsTo)($.target,this.props.cancel,Z))return;if($.type==="touchstart"&&!this.props.allowMobileScroll)$.preventDefault();let Q=(0,x8.getTouchIdentifier)($);this.touchIdentifier=Q;let X=(0,f6.getControlPosition)($,Q,this);if(X==null)return;let{x:H,y:G}=X,z=(0,f6.createCoreData)(this,H,G);if((0,$X.default)("DraggableCore: handleDragStart: %j",z),(0,$X.default)("calling",this.props.onStart),this.props.onStart($,z)===!1||this.mounted===!1)return;if(this.props.enableUserSelectHack)(0,x8.addUserSelectStyles)(J);this.dragging=!0,this.lastX=H,this.lastY=G,(0,x8.addEvent)(J,m6.move,this.handleDrag),(0,x8.addEvent)(J,m6.stop,this.handleDragStop)}),r8(this,"handleDrag",($)=>{let Z=(0,f6.getControlPosition)($,this.touchIdentifier,this);if(Z==null)return;let{x:J,y:Q}=Z;if(Array.isArray(this.props.grid)){let G=J-this.lastX,z=Q-this.lastY;if([G,z]=(0,f6.snapToGrid)(this.props.grid,G,z),!G&&!z)return;J=this.lastX+G,Q=this.lastY+z}let X=(0,f6.createCoreData)(this,J,Q);if((0,$X.default)("DraggableCore: handleDrag: %j",X),this.props.onDrag($,X)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch(G){let z=document.createEvent("MouseEvents");z.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(z)}return}this.lastX=J,this.lastY=Q}),r8(this,"handleDragStop",($)=>{if(!this.dragging)return;let Z=(0,f6.getControlPosition)($,this.touchIdentifier,this);if(Z==null)return;let{x:J,y:Q}=Z;if(Array.isArray(this.props.grid)){let z=J-this.lastX||0,Y=Q-this.lastY||0;[z,Y]=(0,f6.snapToGrid)(this.props.grid,z,Y),J=this.lastX+z,Q=this.lastY+Y}let X=(0,f6.createCoreData)(this,J,Q);if(this.props.onStop($,X)===!1||this.mounted===!1)return!1;let G=this.findDOMNode();if(G){if(this.props.enableUserSelectHack)(0,x8.scheduleRemoveUserSelectStyles)(G.ownerDocument)}if((0,$X.default)("DraggableCore: handleDragStop: %j",X),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,G)(0,$X.default)("DraggableCore: Removing handlers"),(0,x8.removeEvent)(G.ownerDocument,m6.move,this.handleDrag),(0,x8.removeEvent)(G.ownerDocument,m6.stop,this.handleDragStop)}),r8(this,"onMouseDown",($)=>{return m6=N2.mouse,this.handleDragStart($)}),r8(this,"onMouseUp",($)=>{return m6=N2.mouse,this.handleDragStop($)}),r8(this,"onTouchStart",($)=>{return m6=N2.touch,this.handleDragStart($)}),r8(this,"onTouchEnd",($)=>{return m6=N2.touch,this.handleDragStop($)})}componentDidMount(){this.mounted=!0;let $=this.findDOMNode();if($)(0,x8.addEvent)($,N2.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;let $=this.findDOMNode();if($){let{ownerDocument:Z}=$;if((0,x8.removeEvent)(Z,N2.mouse.move,this.handleDrag),(0,x8.removeEvent)(Z,N2.touch.move,this.handleDrag),(0,x8.removeEvent)(Z,N2.mouse.stop,this.handleDragStop),(0,x8.removeEvent)(Z,N2.touch.stop,this.handleDragStop),(0,x8.removeEvent)($,N2.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack)(0,x8.scheduleRemoveUserSelectStyles)(Z)}}findDOMNode(){return this.props?.nodeRef?this.props?.nodeRef?.current:U90.default.findDOMNode(this)}render(){return lV.cloneElement(lV.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}}hx.default=ZX;r8(ZX,"displayName","DraggableCore");r8(ZX,"propTypes",{allowAnyClick:i8.default.bool,allowMobileScroll:i8.default.bool,children:i8.default.node.isRequired,disabled:i8.default.bool,enableUserSelectHack:i8.default.bool,offsetParent:function($,Z){if($[Z]&&$[Z].nodeType!==1)throw Error("Draggable's offsetParent must be a DOM Node.")},grid:i8.default.arrayOf(i8.default.number),handle:i8.default.string,cancel:i8.default.string,nodeRef:i8.default.object,onStart:i8.default.func,onDrag:i8.default.func,onStop:i8.default.func,onMouseDown:i8.default.func,scale:i8.default.number,className:iV.dontSetMe,style:iV.dontSetMe,transform:iV.dontSetMe});r8(ZX,"defaultProps",{allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1})});var px=Z1((sV)=>{var O90=P(v()),P90=P(W4());Object.defineProperty(sV,"__esModule",{value:!0});Object.defineProperty(sV,"DraggableCore",{enumerable:!0,get:function(){return YW.default}});sV.default=void 0;var GW=mx(O90),G1=KW(tQ()),M90=KW(P90),A90=Ax(),fx=HW(),YZ=cV(),aV=eQ(),YW=KW(vx()),zW=KW(dV());function KW($){return $&&$.__esModule?$:{default:$}}function mx($,Z){if(typeof WeakMap=="function")var J=new WeakMap,Q=new WeakMap;return(mx=function(X,H){if(!H&&X&&X.__esModule)return X;var G,z,Y={__proto__:null,default:X};if(X===null||typeof X!="object"&&typeof X!="function")return Y;if(G=H?Q:J){if(G.has(X))return G.get(X);G.set(X,Y)}for(let K in X)K!=="default"&&{}.hasOwnProperty.call(X,K)&&((z=(G=Object.defineProperty)&&Object.getOwnPropertyDescriptor(X,K))&&(z.get||z.set)?G(Y,K,z):Y[K]=X[K]);return Y})($,Z)}function nV(){return nV=Object.assign?Object.assign.bind():function($){for(var Z=1;Z<arguments.length;Z++){var J=arguments[Z];for(var Q in J)({}).hasOwnProperty.call(J,Q)&&($[Q]=J[Q])}return $},nV.apply(null,arguments)}function KZ($,Z,J){return(Z=D90(Z))in $?Object.defineProperty($,Z,{value:J,enumerable:!0,configurable:!0,writable:!0}):$[Z]=J,$}function D90($){var Z=_90($,"string");return typeof Z=="symbol"?Z:Z+""}function _90($,Z){if(typeof $!="object"||!$)return $;var J=$[Symbol.toPrimitive];if(J!==void 0){var Q=J.call($,Z||"default");if(typeof Q!="object")return Q;throw TypeError("@@toPrimitive must return a primitive value.")}return(Z==="string"?String:Number)($)}class JX extends GW.Component{static getDerivedStateFromProps($,Z){let{position:J}=$,{prevPropsPosition:Q}=Z;if(J&&(!Q||J.x!==Q.x||J.y!==Q.y))return(0,zW.default)("Draggable: getDerivedStateFromProps %j",{position:J,prevPropsPosition:Q}),{x:J.x,y:J.y,prevPropsPosition:{...J}};return null}constructor($){super($);if(KZ(this,"onDragStart",(Z,J)=>{if((0,zW.default)("Draggable: onDragStart: %j",J),this.props.onStart(Z,(0,YZ.createDraggableData)(this,J))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),KZ(this,"onDrag",(Z,J)=>{if(!this.state.dragging)return!1;(0,zW.default)("Draggable: onDrag: %j",J);let Q=(0,YZ.createDraggableData)(this,J),X={x:Q.x,y:Q.y,slackX:0,slackY:0};if(this.props.bounds){let{x:G,y:z}=X;X.x+=this.state.slackX,X.y+=this.state.slackY;let[Y,K]=(0,YZ.getBoundPosition)(this,X.x,X.y);X.x=Y,X.y=K,X.slackX=this.state.slackX+(G-X.x),X.slackY=this.state.slackY+(z-X.y),Q.x=X.x,Q.y=X.y,Q.deltaX=X.x-this.state.x,Q.deltaY=X.y-this.state.y}if(this.props.onDrag(Z,Q)===!1)return!1;this.setState(X)}),KZ(this,"onDragStop",(Z,J)=>{if(!this.state.dragging)return!1;if(this.props.onStop(Z,(0,YZ.createDraggableData)(this,J))===!1)return!1;(0,zW.default)("Draggable: onDragStop: %j",J);let X={dragging:!1,slackX:0,slackY:0};if(Boolean(this.props.position)){let{x:G,y:z}=this.props.position;X.x=G,X.y=z}this.setState(X)}),this.state={dragging:!1,dragged:!1,x:$.position?$.position.x:$.defaultPosition.x,y:$.position?$.position.y:$.defaultPosition.y,prevPropsPosition:{...$.position},slackX:0,slackY:0,isElementSVG:!1},$.position&&!($.onDrag||$.onStop))console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){if(typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement)this.setState({isElementSVG:!0})}componentWillUnmount(){if(this.state.dragging)this.setState({dragging:!1})}findDOMNode(){return this.props?.nodeRef?.current??M90.default.findDOMNode(this)}render(){let{axis:$,bounds:Z,children:J,defaultPosition:Q,defaultClassName:X,defaultClassNameDragging:H,defaultClassNameDragged:G,position:z,positionOffset:Y,scale:K,...W}=this.props,B={},q=null,F=!Boolean(z)||this.state.dragging,N=z||Q,L={x:(0,YZ.canDragX)(this)&&F?this.state.x:N.x,y:(0,YZ.canDragY)(this)&&F?this.state.y:N.y};if(this.state.isElementSVG)q=(0,fx.createSVGTransform)(L,Y);else B=(0,fx.createCSSTransform)(L,Y);let V=(0,A90.clsx)(J.props.className||"",X,{[H]:this.state.dragging,[G]:this.state.dragged});return GW.createElement(YW.default,nV({},W,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),GW.cloneElement(GW.Children.only(J),{className:V,style:{...J.props.style,...B},transform:q}))}}sV.default=JX;KZ(JX,"displayName","Draggable");KZ(JX,"propTypes",{...YW.default.propTypes,axis:G1.default.oneOf(["both","x","y","none"]),bounds:G1.default.oneOfType([G1.default.shape({left:G1.default.number,right:G1.default.number,top:G1.default.number,bottom:G1.default.number}),G1.default.string,G1.default.oneOf([!1])]),defaultClassName:G1.default.string,defaultClassNameDragging:G1.default.string,defaultClassNameDragged:G1.default.string,defaultPosition:G1.default.shape({x:G1.default.number,y:G1.default.number}),positionOffset:G1.default.shape({x:G1.default.oneOfType([G1.default.number,G1.default.string]),y:G1.default.oneOfType([G1.default.number,G1.default.string])}),position:G1.default.shape({x:G1.default.number,y:G1.default.number}),className:aV.dontSetMe,style:aV.dontSetMe,transform:aV.dontSetMe});KZ(JX,"defaultProps",{...YW.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})});var BW=Z1((s45,WW)=>{var{default:cx,DraggableCore:w90}=px();WW.exports=cx;WW.exports.default=cx;WW.exports.DraggableCore=w90});var ix=Z1((k90)=>{var y90=P(v());k90.__esModule=!0;k90.cloneElement=R90;var j90=C90(y90);function C90($){return $&&$.__esModule?$:{default:$}}function dx($,Z){var J=Object.keys($);if(Object.getOwnPropertySymbols){var Q=Object.getOwnPropertySymbols($);Z&&(Q=Q.filter(function(X){return Object.getOwnPropertyDescriptor($,X).enumerable})),J.push.apply(J,Q)}return J}function lx($){for(var Z=1;Z<arguments.length;Z++){var J=arguments[Z]!=null?arguments[Z]:{};Z%2?dx(Object(J),!0).forEach(function(Q){T90($,Q,J[Q])}):Object.getOwnPropertyDescriptors?Object.defineProperties($,Object.getOwnPropertyDescriptors(J)):dx(Object(J)).forEach(function(Q){Object.defineProperty($,Q,Object.getOwnPropertyDescriptor(J,Q))})}return $}function T90($,Z,J){return(Z=E90(Z))in $?Object.defineProperty($,Z,{value:J,enumerable:!0,configurable:!0,writable:!0}):$[Z]=J,$}function E90($){var Z=I90($,"string");return typeof Z=="symbol"?Z:Z+""}function I90($,Z){if(typeof $!="object"||!$)return $;var J=$[Symbol.toPrimitive];if(J!==void 0){var Q=J.call($,Z||"default");if(typeof Q!="object")return Q;throw TypeError("@@toPrimitive must return a primitive value.")}return(Z==="string"?String:Number)($)}function R90($,Z){if(Z.style&&$.props.style)Z.style=lx(lx({},$.props.style),Z.style);if(Z.className&&$.props.className)Z.className=`${$.props.className} ${Z.className}`;return j90.default.cloneElement($,Z)}});var oV=Z1((h90)=>{h90.__esModule=!0;h90.resizableProps=void 0;var z5=x90(tQ()),t45=BW();function x90($){return $&&$.__esModule?$:{default:$}}var e45=h90.resizableProps={axis:z5.default.oneOf(["both","x","y","none"]),className:z5.default.string,children:z5.default.element.isRequired,draggableOpts:z5.default.shape({allowAnyClick:z5.default.bool,cancel:z5.default.string,children:z5.default.node,disabled:z5.default.bool,enableUserSelectHack:z5.default.bool,offsetParent:typeof Element<"u"?z5.default.instanceOf(Element):z5.default.any,grid:z5.default.arrayOf(z5.default.number),handle:z5.default.string,nodeRef:z5.default.object,onStart:z5.default.func,onDrag:z5.default.func,onStop:z5.default.func,onMouseDown:z5.default.func,scale:z5.default.number}),height:function(){for(var $=arguments.length,Z=Array($),J=0;J<$;J++)Z[J]=arguments[J];let[Q]=Z;if(Q.axis==="both"||Q.axis==="y")return z5.default.number.isRequired(...Z);return z5.default.number(...Z)},handle:z5.default.oneOfType([z5.default.node,z5.default.func]),handleSize:z5.default.arrayOf(z5.default.number),lockAspectRatio:z5.default.bool,maxConstraints:z5.default.arrayOf(z5.default.number),minConstraints:z5.default.arrayOf(z5.default.number),onResizeStop:z5.default.func,onResizeStart:z5.default.func,onResize:z5.default.func,resizeHandles:z5.default.arrayOf(z5.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:z5.default.number,width:function(){for(var $=arguments.length,Z=Array($),J=0;J<$;J++)Z[J]=arguments[J];let[Q]=Z;if(Q.axis==="both"||Q.axis==="x")return z5.default.number.isRequired(...Z);return z5.default.number(...Z)}}});var $L=Z1((r90)=>{var n90=P(v());r90.__esModule=!0;r90.default=void 0;var WZ=nx(n90),v90=BW(),f90=ix(),m90=oV(),u90=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function nx($,Z){if(typeof WeakMap=="function")var J=new WeakMap,Q=new WeakMap;return(nx=function(X,H){if(!H&&X&&X.__esModule)return X;var G,z,Y={__proto__:null,default:X};if(X===null||typeof X!="object"&&typeof X!="function")return Y;if(G=H?Q:J){if(G.has(X))return G.get(X);G.set(X,Y)}for(let K in X)K!=="default"&&{}.hasOwnProperty.call(X,K)&&((z=(G=Object.defineProperty)&&Object.getOwnPropertyDescriptor(X,K))&&(z.get||z.set)?G(Y,K,z):Y[K]=X[K]);return Y})($,Z)}function eV(){return eV=Object.assign?Object.assign.bind():function($){for(var Z=1;Z<arguments.length;Z++){var J=arguments[Z];for(var Q in J)({}).hasOwnProperty.call(J,Q)&&($[Q]=J[Q])}return $},eV.apply(null,arguments)}function p90($,Z){if($==null)return{};var J,Q,X=c90($,Z);if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols($);for(Q=0;Q<H.length;Q++)J=H[Q],Z.indexOf(J)===-1&&{}.propertyIsEnumerable.call($,J)&&(X[J]=$[J])}return X}function c90($,Z){if($==null)return{};var J={};for(var Q in $)if({}.hasOwnProperty.call($,Q)){if(Z.indexOf(Q)!==-1)continue;J[Q]=$[Q]}return J}function ax($,Z){var J=Object.keys($);if(Object.getOwnPropertySymbols){var Q=Object.getOwnPropertySymbols($);Z&&(Q=Q.filter(function(X){return Object.getOwnPropertyDescriptor($,X).enumerable})),J.push.apply(J,Q)}return J}function tV($){for(var Z=1;Z<arguments.length;Z++){var J=arguments[Z]!=null?arguments[Z]:{};Z%2?ax(Object(J),!0).forEach(function(Q){d90($,Q,J[Q])}):Object.getOwnPropertyDescriptors?Object.defineProperties($,Object.getOwnPropertyDescriptors(J)):ax(Object(J)).forEach(function(Q){Object.defineProperty($,Q,Object.getOwnPropertyDescriptor(J,Q))})}return $}function d90($,Z,J){return(Z=l90(Z))in $?Object.defineProperty($,Z,{value:J,enumerable:!0,configurable:!0,writable:!0}):$[Z]=J,$}function l90($){var Z=i90($,"string");return typeof Z=="symbol"?Z:Z+""}function i90($,Z){if(typeof $!="object"||!$)return $;var J=$[Symbol.toPrimitive];if(J!==void 0){var Q=J.call($,Z||"default");if(typeof Q!="object")return Q;throw TypeError("@@toPrimitive must return a primitive value.")}return(Z==="string"?String:Number)($)}class qW extends WZ.Component{constructor(){super(...arguments);this.handleRefs={},this.lastHandleRect=null,this.slack=null,this.lastSize=null}componentWillUnmount(){this.resetData()}resetData(){this.lastHandleRect=this.slack=this.lastSize=null}runConstraints($,Z){let{minConstraints:J,maxConstraints:Q,lockAspectRatio:X}=this.props;if(!J&&!Q&&!X)return[$,Z];if(X){let K=this.props.width/this.props.height,W=$-this.props.width,B=Z-this.props.height;if(Math.abs(W)>Math.abs(B*K))Z=$/K;else $=Z*K}let[H,G]=[$,Z],[z,Y]=this.slack||[0,0];if($+=z,Z+=Y,J)$=Math.max(J[0],$),Z=Math.max(J[1],Z);if(Q)$=Math.min(Q[0],$),Z=Math.min(Q[1],Z);return this.slack=[z+(H-$),Y+(G-Z)],[$,Z]}resizeHandler($,Z){return(J,Q)=>{let{node:X,deltaX:H,deltaY:G}=Q;if($==="onResizeStart")this.resetData();let z=(this.props.axis==="both"||this.props.axis==="x")&&Z!=="n"&&Z!=="s",Y=(this.props.axis==="both"||this.props.axis==="y")&&Z!=="e"&&Z!=="w";if(!z&&!Y)return;let K=Z[0],W=Z[Z.length-1],B=X.getBoundingClientRect();if(this.lastHandleRect!=null){if(W==="w"){let V=B.left-this.lastHandleRect.left;H+=V}if(K==="n"){let V=B.top-this.lastHandleRect.top;G+=V}}if(this.lastHandleRect=B,W==="w")H=-H;if(K==="n")G=-G;let q=this.props.width+(z?H/this.props.transformScale:0),U=this.props.height+(Y?G/this.props.transformScale:0);if([q,U]=this.runConstraints(q,U),$==="onResizeStop"&&this.lastSize)({width:q,height:U}=this.lastSize);let F=q!==this.props.width||U!==this.props.height;if($!=="onResizeStop")this.lastSize={width:q,height:U};let N=typeof this.props[$]==="function"?this.props[$]:null;if(N&&!($==="onResize"&&!F))J.persist?.(),N(J,{node:X,size:{width:q,height:U},handle:Z});if($==="onResizeStop")this.resetData()}}renderResizeHandle($,Z){let{handle:J}=this.props;if(!J)return WZ.createElement("span",{className:`react-resizable-handle react-resizable-handle-${$}`,ref:Z});if(typeof J==="function")return J($,Z);let Q=typeof J.type==="string",X=tV({ref:Z},Q?{}:{handleAxis:$});return WZ.cloneElement(J,X)}render(){let $=this.props,{children:Z,className:J,draggableOpts:Q,width:X,height:H,handle:G,handleSize:z,lockAspectRatio:Y,axis:K,minConstraints:W,maxConstraints:B,onResize:q,onResizeStop:U,onResizeStart:F,resizeHandles:N,transformScale:L}=$,V=p90($,u90);return(0,f90.cloneElement)(Z,tV(tV({},V),{},{className:`${J?`${J} `:""}react-resizable`,children:[...WZ.Children.toArray(Z.props.children),...N.map((M)=>{let A=this.handleRefs[M]??(this.handleRefs[M]=WZ.createRef());return WZ.createElement(v90.DraggableCore,eV({},Q,{nodeRef:A,key:`resizableHandle-${M}`,onStop:this.resizeHandler("onResizeStop",M),onStart:this.resizeHandler("onResizeStart",M),onDrag:this.resizeHandler("onResize",M)}),this.renderResizeHandle(M,A))})]}))}}r90.default=qW;qW.propTypes=m90.resizableProps;qW.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1}});var Zh=Z1((H60)=>{var z60=P(v());H60.__esModule=!0;H60.default=void 0;var ZL=ex(z60),s90=tx(tQ()),o90=tx($L()),t90=oV(),e90=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function tx($){return $&&$.__esModule?$:{default:$}}function ex($,Z){if(typeof WeakMap=="function")var J=new WeakMap,Q=new WeakMap;return(ex=function(X,H){if(!H&&X&&X.__esModule)return X;var G,z,Y={__proto__:null,default:X};if(X===null||typeof X!="object"&&typeof X!="function")return Y;if(G=H?Q:J){if(G.has(X))return G.get(X);G.set(X,Y)}for(let K in X)K!=="default"&&{}.hasOwnProperty.call(X,K)&&((z=(G=Object.defineProperty)&&Object.getOwnPropertyDescriptor(X,K))&&(z.get||z.set)?G(Y,K,z):Y[K]=X[K]);return Y})($,Z)}function JL(){return JL=Object.assign?Object.assign.bind():function($){for(var Z=1;Z<arguments.length;Z++){var J=arguments[Z];for(var Q in J)({}).hasOwnProperty.call(J,Q)&&($[Q]=J[Q])}return $},JL.apply(null,arguments)}function ox($,Z){var J=Object.keys($);if(Object.getOwnPropertySymbols){var Q=Object.getOwnPropertySymbols($);Z&&(Q=Q.filter(function(X){return Object.getOwnPropertyDescriptor($,X).enumerable})),J.push.apply(J,Q)}return J}function UW($){for(var Z=1;Z<arguments.length;Z++){var J=arguments[Z]!=null?arguments[Z]:{};Z%2?ox(Object(J),!0).forEach(function(Q){$60($,Q,J[Q])}):Object.getOwnPropertyDescriptors?Object.defineProperties($,Object.getOwnPropertyDescriptors(J)):ox(Object(J)).forEach(function(Q){Object.defineProperty($,Q,Object.getOwnPropertyDescriptor(J,Q))})}return $}function $60($,Z,J){return(Z=Z60(Z))in $?Object.defineProperty($,Z,{value:J,enumerable:!0,configurable:!0,writable:!0}):$[Z]=J,$}function Z60($){var Z=J60($,"string");return typeof Z=="symbol"?Z:Z+""}function J60($,Z){if(typeof $!="object"||!$)return $;var J=$[Symbol.toPrimitive];if(J!==void 0){var Q=J.call($,Z||"default");if(typeof Q!="object")return Q;throw TypeError("@@toPrimitive must return a primitive value.")}return(Z==="string"?String:Number)($)}function Q60($,Z){if($==null)return{};var J,Q,X=X60($,Z);if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols($);for(Q=0;Q<H.length;Q++)J=H[Q],Z.indexOf(J)===-1&&{}.propertyIsEnumerable.call($,J)&&(X[J]=$[J])}return X}function X60($,Z){if($==null)return{};var J={};for(var Q in $)if({}.hasOwnProperty.call($,Q)){if(Z.indexOf(Q)!==-1)continue;J[Q]=$[Q]}return J}class QL extends ZL.Component{constructor(){super(...arguments);this.state={width:this.props.width,height:this.props.height,propsWidth:this.props.width,propsHeight:this.props.height},this.onResize=($,Z)=>{let{size:J}=Z;if(this.props.onResize)$.persist?.(),this.setState(J,()=>this.props.onResize&&this.props.onResize($,Z));else this.setState(J)}}static getDerivedStateFromProps($,Z){if(Z.propsWidth!==$.width||Z.propsHeight!==$.height)return{width:$.width,height:$.height,propsWidth:$.width,propsHeight:$.height};return null}render(){let $=this.props,{handle:Z,handleSize:J,onResize:Q,onResizeStart:X,onResizeStop:H,draggableOpts:G,minConstraints:z,maxConstraints:Y,lockAspectRatio:K,axis:W,width:B,height:q,resizeHandles:U,style:F,transformScale:N}=$,L=Q60($,e90);return ZL.createElement(o90.default,{axis:W,draggableOpts:G,handle:Z,handleSize:J,height:this.state.height,lockAspectRatio:K,maxConstraints:Y,minConstraints:z,onResizeStart:X,onResize:this.onResize,onResizeStop:H,resizeHandles:U,transformScale:N,width:this.state.width},ZL.createElement("div",JL({},L,{style:UW(UW({},F),{},{width:this.state.width+"px",height:this.state.height+"px"})})))}}H60.default=QL;QL.propTypes=UW(UW({},t90.resizableProps),{},{children:s90.default.element})});var Jh=Z1((Q25,FW)=>{FW.exports=function(){throw Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")};FW.exports.Resizable=$L().default;FW.exports.ResizableBox=Zh().default});var E4=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe($){return this.listeners.add($),this.onSubscribe(),()=>{this.listeners.delete($),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}};var jm=class extends E4{#$;#Z;#J;constructor(){super();this.#J=($)=>{if(typeof window<"u"&&window.addEventListener){let Z=()=>$();return window.addEventListener("visibilitychange",Z,!1),()=>{window.removeEventListener("visibilitychange",Z)}}return}}onSubscribe(){if(!this.#Z)this.setEventListener(this.#J)}onUnsubscribe(){if(!this.hasListeners())this.#Z?.(),this.#Z=void 0}setEventListener($){this.#J=$,this.#Z?.(),this.#Z=$((Z)=>{if(typeof Z==="boolean")this.setFocused(Z);else this.onFocus()})}setFocused($){if(this.#$!==$)this.#$=$,this.onFocus()}onFocus(){let $=this.isFocused();this.listeners.forEach((Z)=>{Z($)})}isFocused(){if(typeof this.#$==="boolean")return this.#$;return globalThis.document?.visibilityState!=="hidden"}},N7=new jm;var Cm={setTimeout:($,Z)=>setTimeout($,Z),clearTimeout:($)=>clearTimeout($),setInterval:($,Z)=>setInterval($,Z),clearInterval:($)=>clearInterval($)},Tm=class{#$=Cm;#Z=!1;setTimeoutProvider($){this.#$=$}setTimeout($,Z){return this.#$.setTimeout($,Z)}clearTimeout($){this.#$.clearTimeout($)}setInterval($,Z){return this.#$.setInterval($,Z)}clearInterval($){this.#$.clearInterval($)}},A2=new Tm;function pL($){setTimeout($,0)}var mW=typeof window>"u"||"Deno"in globalThis;function w1(){}function lL($,Z){return typeof $==="function"?$(Z):$}function CZ($){return typeof $==="number"&&$>=0&&$!==1/0}function DX($,Z){return Math.max($+(Z||0)-Date.now(),0)}function o4($,Z){return typeof $==="function"?$(Z):$}function f8($,Z){return typeof $==="function"?$(Z):$}function _X($,Z){let{type:J="all",exact:Q,fetchStatus:X,predicate:H,queryKey:G,stale:z}=$;if(G){if(Q){if(Z.queryHash!==TZ(G,Z.options))return!1}else if(!a6(Z.queryKey,G))return!1}if(J!=="all"){let Y=Z.isActive();if(J==="active"&&!Y)return!1;if(J==="inactive"&&Y)return!1}if(typeof z==="boolean"&&Z.isStale()!==z)return!1;if(X&&X!==Z.state.fetchStatus)return!1;if(H&&!H(Z))return!1;return!0}function OX($,Z){let{exact:J,status:Q,predicate:X,mutationKey:H}=$;if(H){if(!Z.options.mutationKey)return!1;if(J){if(D2(Z.options.mutationKey)!==D2(H))return!1}else if(!a6(Z.options.mutationKey,H))return!1}if(Q&&Z.state.status!==Q)return!1;if(X&&!X(Z))return!1;return!0}function TZ($,Z){return(Z?.queryKeyHashFn||D2)($)}function D2($){return JSON.stringify($,(Z,J)=>fW(J)?Object.keys(J).sort().reduce((Q,X)=>{return Q[X]=J[X],Q},{}):J)}function a6($,Z){if($===Z)return!0;if(typeof $!==typeof Z)return!1;if($&&Z&&typeof $==="object"&&typeof Z==="object")return Object.keys(Z).every((J)=>a6($[J],Z[J]));return!1}var Em=Object.prototype.hasOwnProperty;function EZ($,Z,J=0){if($===Z)return $;if(J>500)return Z;let Q=cL($)&&cL(Z);if(!Q&&!(fW($)&&fW(Z)))return Z;let H=(Q?$:Object.keys($)).length,G=Q?Z:Object.keys(Z),z=G.length,Y=Q?Array(z):{},K=0;for(let W=0;W<z;W++){let B=Q?W:G[W],q=$[B],U=Z[B];if(q===U){if(Y[B]=q,Q?W<H:Em.call($,B))K++;continue}if(q===null||U===null||typeof q!=="object"||typeof U!=="object"){Y[B]=U;continue}let F=EZ(q,U,J+1);if(Y[B]=F,F===q)K++}return H===z&&K===H?$:Y}function V7($,Z){if(!Z||Object.keys($).length!==Object.keys(Z).length)return!1;for(let J in $)if($[J]!==Z[J])return!1;return!0}function cL($){return Array.isArray($)&&$.length===Object.keys($).length}function fW($){if(!dL($))return!1;let Z=$.constructor;if(Z===void 0)return!0;let J=Z.prototype;if(!dL(J))return!1;if(!J.hasOwnProperty("isPrototypeOf"))return!1;if(Object.getPrototypeOf($)!==Object.prototype)return!1;return!0}function dL($){return Object.prototype.toString.call($)==="[object Object]"}function iL($){return new Promise((Z)=>{A2.setTimeout(Z,$)})}function IZ($,Z,J){if(typeof J.structuralSharing==="function")return J.structuralSharing($,Z);else if(J.structuralSharing!==!1)return EZ($,Z);return Z}function rL($,Z,J=0){let Q=[...$,Z];return J&&Q.length>J?Q.slice(1):Q}function aL($,Z,J=0){let Q=[Z,...$];return J&&Q.length>J?Q.slice(0,-1):Q}var L7=Symbol();function PX($,Z){if(!$.queryFn&&Z?.initialPromise)return()=>Z.initialPromise;if(!$.queryFn||$.queryFn===L7)return()=>Promise.reject(Error(`Missing queryFn: '${$.queryHash}'`));return $.queryFn}function M7($,Z){if(typeof $==="function")return $(...Z);return!!$}function nL($,Z,J){let Q=!1,X;return Object.defineProperty($,"signal",{enumerable:!0,get:()=>{if(X??=Z(),Q)return X;if(Q=!0,X.aborted)J();else X.addEventListener("abort",J,{once:!0});return X}}),$}var _2=(()=>{let $=()=>mW;return{isServer(){return $()},setIsServer(Z){$=Z}}})();function RZ(){let $,Z,J=new Promise((X,H)=>{$=X,Z=H});J.status="pending",J.catch(()=>{});function Q(X){Object.assign(J,X),delete J.resolve,delete J.reject}return J.resolve=(X)=>{Q({status:"fulfilled",value:X}),$(X)},J.reject=(X)=>{Q({status:"rejected",reason:X}),Z(X)},J}var sL=pL;function Im(){let $=[],Z=0,J=(z)=>{z()},Q=(z)=>{z()},X=sL,H=(z)=>{if(Z)$.push(z);else X(()=>{J(z)})},G=()=>{let z=$;if($=[],z.length)X(()=>{Q(()=>{z.forEach((Y)=>{J(Y)})})})};return{batch:(z)=>{let Y;Z++;try{Y=z()}finally{if(Z--,!Z)G()}return Y},batchCalls:(z)=>{return(...Y)=>{H(()=>{z(...Y)})}},schedule:H,setNotifyFunction:(z)=>{J=z},setBatchNotifyFunction:(z)=>{Q=z},setScheduler:(z)=>{X=z}}}var S5=Im();var Rm=class extends E4{#$=!0;#Z;#J;constructor(){super();this.#J=($)=>{if(typeof window<"u"&&window.addEventListener){let Z=()=>$(!0),J=()=>$(!1);return window.addEventListener("online",Z,!1),window.addEventListener("offline",J,!1),()=>{window.removeEventListener("online",Z),window.removeEventListener("offline",J)}}return}}onSubscribe(){if(!this.#Z)this.setEventListener(this.#J)}onUnsubscribe(){if(!this.hasListeners())this.#Z?.(),this.#Z=void 0}setEventListener($){this.#J=$,this.#Z?.(),this.#Z=$(this.setOnline.bind(this))}setOnline($){if(this.#$!==$)this.#$=$,this.listeners.forEach((J)=>{J($)})}isOnline(){return this.#$}},A7=new Rm;function km($){return Math.min(1000*2**$,30000)}function uW($){return($??"online")==="online"?A7.isOnline():!0}var wX=class extends Error{constructor($){super("CancelledError");this.revert=$?.revert,this.silent=$?.silent}};function jX($){let Z=!1,J=0,Q,X=RZ(),H=()=>X.status!=="pending",G=(N)=>{if(!H()){let L=new wX(N);q(L),$.onCancel?.(L)}},z=()=>{Z=!0},Y=()=>{Z=!1},K=()=>N7.isFocused()&&($.networkMode==="always"||A7.isOnline())&&$.canRun(),W=()=>uW($.networkMode)&&$.canRun(),B=(N)=>{if(!H())Q?.(),X.resolve(N)},q=(N)=>{if(!H())Q?.(),X.reject(N)},U=()=>{return new Promise((N)=>{Q=(L)=>{if(H()||K())N(L)},$.onPause?.()}).then(()=>{if(Q=void 0,!H())$.onContinue?.()})},F=()=>{if(H())return;let N,L=J===0?$.initialPromise:void 0;try{N=L??$.fn()}catch(V){N=Promise.reject(V)}Promise.resolve(N).then(B).catch((V)=>{if(H())return;let M=$.retry??(_2.isServer()?0:3),A=$.retryDelay??km,O=typeof A==="function"?A(J,V):A,_=M===!0||typeof M==="number"&&J<M||typeof M==="function"&&M(J,V);if(Z||!_){q(V);return}J++,$.onFail?.(J,V),iL(O).then(()=>{return K()?void 0:U()}).then(()=>{if(Z)q(V);else F()})})};return{promise:X,status:()=>X.status,cancel:G,continue:()=>{return Q?.(),X},cancelRetry:z,continueRetry:Y,canStart:W,start:()=>{if(W())F();else U().then(F);return X}}}var CX=class{#$;destroy(){this.clearGcTimeout()}scheduleGc(){if(this.clearGcTimeout(),CZ(this.gcTime))this.#$=A2.setTimeout(()=>{this.optionalRemove()},this.gcTime)}updateGcTime($){this.gcTime=Math.max(this.gcTime||0,$??(_2.isServer()?1/0:300000))}clearGcTimeout(){if(this.#$!==void 0)A2.clearTimeout(this.#$),this.#$=void 0}};var eL=class extends CX{#$;#Z;#J;#X;#Q;#H;#G;constructor($){super();this.#G=!1,this.#H=$.defaultOptions,this.setOptions($.options),this.observers=[],this.#X=$.client,this.#J=this.#X.getQueryCache(),this.queryKey=$.queryKey,this.queryHash=$.queryHash,this.#$=tL(this.options),this.state=$.state??this.#$,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#Q?.promise}setOptions($){if(this.options={...this.#H,...$},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let Z=tL(this.options);if(Z.data!==void 0)this.setState(oL(Z.data,Z.dataUpdatedAt)),this.#$=Z}}optionalRemove(){if(!this.observers.length&&this.state.fetchStatus==="idle")this.#J.remove(this)}setData($,Z){let J=IZ(this.state.data,$,this.options);return this.#Y({data:J,type:"success",dataUpdatedAt:Z?.updatedAt,manual:Z?.manual}),J}setState($,Z){this.#Y({type:"setState",state:$,setStateOptions:Z})}cancel($){let Z=this.#Q?.promise;return this.#Q?.cancel($),Z?Z.then(w1).catch(w1):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#$}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(($)=>f8($.options.enabled,this)!==!1)}isDisabled(){if(this.getObserversCount()>0)return!this.isActive();return this.options.queryFn===L7||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){if(this.getObserversCount()>0)return this.observers.some(($)=>o4($.options.staleTime,this)==="static");return!1}isStale(){if(this.getObserversCount()>0)return this.observers.some(($)=>$.getCurrentResult().isStale);return this.state.data===void 0||this.state.isInvalidated}isStaleByTime($=0){if(this.state.data===void 0)return!0;if($==="static")return!1;if(this.state.isInvalidated)return!0;return!DX(this.state.dataUpdatedAt,$)}onFocus(){this.observers.find((Z)=>Z.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#Q?.continue()}onOnline(){this.observers.find((Z)=>Z.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#Q?.continue()}addObserver($){if(!this.observers.includes($))this.observers.push($),this.clearGcTimeout(),this.#J.notify({type:"observerAdded",query:this,observer:$})}removeObserver($){if(this.observers.includes($)){if(this.observers=this.observers.filter((Z)=>Z!==$),!this.observers.length){if(this.#Q)if(this.#G||this.#z())this.#Q.cancel({revert:!0});else this.#Q.cancelRetry();this.scheduleGc()}this.#J.notify({type:"observerRemoved",query:this,observer:$})}}getObserversCount(){return this.observers.length}#z(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){if(!this.state.isInvalidated)this.#Y({type:"invalidate"})}async fetch($,Z){if(this.state.fetchStatus!=="idle"&&this.#Q?.status()!=="rejected"){if(this.state.data!==void 0&&Z?.cancelRefetch)this.cancel({silent:!0});else if(this.#Q)return this.#Q.continueRetry(),this.#Q.promise}if($)this.setOptions($);if(!this.options.queryFn){let z=this.observers.find((Y)=>Y.options.queryFn);if(z)this.setOptions(z.options)}let J=new AbortController,Q=(z)=>{Object.defineProperty(z,"signal",{enumerable:!0,get:()=>{return this.#G=!0,J.signal}})},X=()=>{let z=PX(this.options,Z),K=(()=>{let W={client:this.#X,queryKey:this.queryKey,meta:this.meta};return Q(W),W})();if(this.#G=!1,this.options.persister)return this.options.persister(z,K,this);return z(K)},G=(()=>{let z={fetchOptions:Z,options:this.options,queryKey:this.queryKey,client:this.#X,state:this.state,fetchFn:X};return Q(z),z})();if(this.options.behavior?.onFetch(G,this),this.#Z=this.state,this.state.fetchStatus==="idle"||this.state.fetchMeta!==G.fetchOptions?.meta)this.#Y({type:"fetch",meta:G.fetchOptions?.meta});this.#Q=jX({initialPromise:Z?.initialPromise,fn:G.fetchFn,onCancel:(z)=>{if(z instanceof wX&&z.revert)this.setState({...this.#Z,fetchStatus:"idle"});J.abort()},onFail:(z,Y)=>{this.#Y({type:"failed",failureCount:z,error:Y})},onPause:()=>{this.#Y({type:"pause"})},onContinue:()=>{this.#Y({type:"continue"})},retry:G.options.retry,retryDelay:G.options.retryDelay,networkMode:G.options.networkMode,canRun:()=>!0});try{let z=await this.#Q.start();if(z===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(z),this.#J.config.onSuccess?.(z,this),this.#J.config.onSettled?.(z,this.state.error,this),z}catch(z){if(z instanceof wX){if(z.silent)return this.#Q.promise;else if(z.revert){if(this.state.data===void 0)throw z;return this.state.data}}throw this.#Y({type:"error",error:z}),this.#J.config.onError?.(z,this),this.#J.config.onSettled?.(this.state.data,z,this),z}finally{this.scheduleGc()}}#Y($){let Z=(J)=>{switch($.type){case"failed":return{...J,fetchFailureCount:$.failureCount,fetchFailureReason:$.error};case"pause":return{...J,fetchStatus:"paused"};case"continue":return{...J,fetchStatus:"fetching"};case"fetch":return{...J,...pW(J.data,this.options),fetchMeta:$.meta??null};case"success":let Q={...J,...oL($.data,$.dataUpdatedAt),dataUpdateCount:J.dataUpdateCount+1,...!$.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#Z=$.manual?Q:void 0,Q;case"error":let X=$.error;return{...J,error:X,errorUpdateCount:J.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:J.fetchFailureCount+1,fetchFailureReason:X,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...J,isInvalidated:!0};case"setState":return{...J,...$.state}}};this.state=Z(this.state),S5.batch(()=>{this.observers.forEach((J)=>{J.onQueryUpdate()}),this.#J.notify({query:this,type:"updated",action:$})})}};function pW($,Z){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:uW(Z.networkMode)?"fetching":"paused",...$===void 0&&{error:null,status:"pending"}}}function oL($,Z){return{data:$,dataUpdatedAt:Z??Date.now(),error:null,isInvalidated:!1,status:"success"}}function tL($){let Z=typeof $.initialData==="function"?$.initialData():$.initialData,J=Z!==void 0,Q=J?typeof $.initialDataUpdatedAt==="function"?$.initialDataUpdatedAt():$.initialDataUpdatedAt:0;return{data:Z,dataUpdateCount:0,dataUpdatedAt:J?Q??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:J?"success":"pending",fetchStatus:"idle"}}var dW=class extends E4{constructor($,Z){super();this.options=Z,this.#$=$,this.#z=null,this.#G=RZ(),this.bindMethods(),this.setOptions(Z)}#$;#Z=void 0;#J=void 0;#X=void 0;#Q;#H;#G;#z;#Y;#U;#F;#W;#B;#K;#N=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){if(this.listeners.size===1){if(this.#Z.addObserver(this),$M(this.#Z,this.options))this.#q();else this.updateResult();this.#A()}}onUnsubscribe(){if(!this.hasListeners())this.destroy()}shouldFetchOnReconnect(){return cW(this.#Z,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return cW(this.#Z,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#D(),this.#_(),this.#Z.removeObserver(this)}setOptions($){let Z=this.options,J=this.#Z;if(this.options=this.#$.defaultQueryOptions($),this.options.enabled!==void 0&&typeof this.options.enabled!=="boolean"&&typeof this.options.enabled!=="function"&&typeof f8(this.options.enabled,this.#Z)!=="boolean")throw Error("Expected enabled to be a boolean or a callback that returns a boolean");if(this.#O(),this.#Z.setOptions(this.options),Z._defaulted&&!V7(this.options,Z))this.#$.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#Z,observer:this});let Q=this.hasListeners();if(Q&&ZM(this.#Z,J,this.options,Z))this.#q();if(this.updateResult(),Q&&(this.#Z!==J||f8(this.options.enabled,this.#Z)!==f8(Z.enabled,this.#Z)||o4(this.options.staleTime,this.#Z)!==o4(Z.staleTime,this.#Z)))this.#V();let X=this.#L();if(Q&&(this.#Z!==J||f8(this.options.enabled,this.#Z)!==f8(Z.enabled,this.#Z)||X!==this.#K))this.#M(X)}getOptimisticResult($){let Z=this.#$.getQueryCache().build(this.#$,$),J=this.createResult(Z,$);if(bm(this,J))this.#X=J,this.#H=this.options,this.#Q=this.#Z.state;return J}getCurrentResult(){return this.#X}trackResult($,Z){return new Proxy($,{get:(J,Q)=>{if(this.trackProp(Q),Z?.(Q),Q==="promise"){if(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#G.status==="pending")this.#G.reject(Error("experimental_prefetchInRender feature flag is not enabled"))}return Reflect.get(J,Q)}})}trackProp($){this.#N.add($)}getCurrentQuery(){return this.#Z}refetch({...$}={}){return this.fetch({...$})}fetchOptimistic($){let Z=this.#$.defaultQueryOptions($),J=this.#$.getQueryCache().build(this.#$,Z);return J.fetch().then(()=>this.createResult(J,Z))}fetch($){return this.#q({...$,cancelRefetch:$.cancelRefetch??!0}).then(()=>{return this.updateResult(),this.#X})}#q($){this.#O();let Z=this.#Z.fetch(this.options,$);if(!$?.throwOnError)Z=Z.catch(w1);return Z}#V(){this.#D();let $=o4(this.options.staleTime,this.#Z);if(_2.isServer()||this.#X.isStale||!CZ($))return;let J=DX(this.#X.dataUpdatedAt,$)+1;this.#W=A2.setTimeout(()=>{if(!this.#X.isStale)this.updateResult()},J)}#L(){return(typeof this.options.refetchInterval==="function"?this.options.refetchInterval(this.#Z):this.options.refetchInterval)??!1}#M($){if(this.#_(),this.#K=$,_2.isServer()||f8(this.options.enabled,this.#Z)===!1||!CZ(this.#K)||this.#K===0)return;this.#B=A2.setInterval(()=>{if(this.options.refetchIntervalInBackground||N7.isFocused())this.#q()},this.#K)}#A(){this.#V(),this.#M(this.#L())}#D(){if(this.#W!==void 0)A2.clearTimeout(this.#W),this.#W=void 0}#_(){if(this.#B!==void 0)A2.clearInterval(this.#B),this.#B=void 0}createResult($,Z){let J=this.#Z,Q=this.options,X=this.#X,H=this.#Q,G=this.#H,Y=$!==J?$.state:this.#J,{state:K}=$,W={...K},B=!1,q;if(Z._optimisticResults){let k=this.hasListeners(),x=!k&&$M($,Z),I=k&&ZM($,J,Z,Q);if(x||I)W={...W,...pW(K.data,$.options)};if(Z._optimisticResults==="isRestoring")W.fetchStatus="idle"}let{error:U,errorUpdatedAt:F,status:N}=W;q=W.data;let L=!1;if(Z.placeholderData!==void 0&&q===void 0&&N==="pending"){let k;if(X?.isPlaceholderData&&Z.placeholderData===G?.placeholderData)k=X.data,L=!0;else k=typeof Z.placeholderData==="function"?Z.placeholderData(this.#F?.state.data,this.#F):Z.placeholderData;if(k!==void 0)N="success",q=IZ(X?.data,k,Z),B=!0}if(Z.select&&q!==void 0&&!L)if(X&&q===H?.data&&Z.select===this.#Y)q=this.#U;else try{this.#Y=Z.select,q=Z.select(q),q=IZ(X?.data,q,Z),this.#U=q,this.#z=null}catch(k){this.#z=k}if(this.#z)U=this.#z,q=this.#U,F=Date.now(),N="error";let V=W.fetchStatus==="fetching",M=N==="pending",A=N==="error",O=M&&V,_=q!==void 0,T={status:N,fetchStatus:W.fetchStatus,isPending:M,isSuccess:N==="success",isError:A,isInitialLoading:O,isLoading:O,data:q,dataUpdatedAt:W.dataUpdatedAt,error:U,errorUpdatedAt:F,failureCount:W.fetchFailureCount,failureReason:W.fetchFailureReason,errorUpdateCount:W.errorUpdateCount,isFetched:$.isFetched(),isFetchedAfterMount:W.dataUpdateCount>Y.dataUpdateCount||W.errorUpdateCount>Y.errorUpdateCount,isFetching:V,isRefetching:V&&!M,isLoadingError:A&&!_,isPaused:W.fetchStatus==="paused",isPlaceholderData:B,isRefetchError:A&&_,isStale:lW($,Z),refetch:this.refetch,promise:this.#G,isEnabled:f8(Z.enabled,$)!==!1};if(this.options.experimental_prefetchInRender){let k=T.data!==void 0,x=T.status==="error"&&!k,I=(j)=>{if(x)j.reject(T.error);else if(k)j.resolve(T.data)},y=()=>{let j=this.#G=T.promise=RZ();I(j)},C=this.#G;switch(C.status){case"pending":if($.queryHash===J.queryHash)I(C);break;case"fulfilled":if(x||T.data!==C.value)y();break;case"rejected":if(!x||T.error!==C.reason)y();break}}return T}updateResult(){let $=this.#X,Z=this.createResult(this.#Z,this.options);if(this.#Q=this.#Z.state,this.#H=this.options,this.#Q.data!==void 0)this.#F=this.#Z;if(V7(Z,$))return;this.#X=Z;let J=()=>{if(!$)return!0;let{notifyOnChangeProps:Q}=this.options,X=typeof Q==="function"?Q():Q;if(X==="all"||!X&&!this.#N.size)return!0;let H=new Set(X??this.#N);if(this.options.throwOnError)H.add("error");return Object.keys(this.#X).some((G)=>{let z=G;return this.#X[z]!==$[z]&&H.has(z)})};this.#P({listeners:J()})}#O(){let $=this.#$.getQueryCache().build(this.#$,this.options);if($===this.#Z)return;let Z=this.#Z;if(this.#Z=$,this.#J=$.state,this.hasListeners())Z?.removeObserver(this),$.addObserver(this)}onQueryUpdate(){if(this.updateResult(),this.hasListeners())this.#A()}#P($){S5.batch(()=>{if($.listeners)this.listeners.forEach((Z)=>{Z(this.#X)});this.#$.getQueryCache().notify({query:this.#Z,type:"observerResultsUpdated"})})}};function Sm($,Z){return f8(Z.enabled,$)!==!1&&$.state.data===void 0&&!($.state.status==="error"&&f8(Z.retryOnMount,$)===!1)}function $M($,Z){return Sm($,Z)||$.state.data!==void 0&&cW($,Z,Z.refetchOnMount)}function cW($,Z,J){if(f8(Z.enabled,$)!==!1&&o4(Z.staleTime,$)!=="static"){let Q=typeof J==="function"?J($):J;return Q==="always"||Q!==!1&&lW($,Z)}return!1}function ZM($,Z,J,Q){return($!==Z||f8(Q.enabled,$)===!1)&&(!J.suspense||$.state.status!=="error")&&lW($,J)}function lW($,Z){return f8(Z.enabled,$)!==!1&&$.isStaleByTime(o4(Z.staleTime,$))}function bm($,Z){if(!V7($.getCurrentResult(),Z))return!0;return!1}function iW($){return{onFetch:(Z,J)=>{let Q=Z.options,X=Z.fetchOptions?.meta?.fetchMore?.direction,H=Z.state.data?.pages||[],G=Z.state.data?.pageParams||[],z={pages:[],pageParams:[]},Y=0,K=async()=>{let W=!1,B=(F)=>{nL(F,()=>Z.signal,()=>W=!0)},q=PX(Z.options,Z.fetchOptions),U=async(F,N,L)=>{if(W)return Promise.reject();if(N==null&&F.pages.length)return Promise.resolve(F);let M=(()=>{let D={client:Z.client,queryKey:Z.queryKey,pageParam:N,direction:L?"backward":"forward",meta:Z.options.meta};return B(D),D})(),A=await q(M),{maxPages:O}=Z.options,_=L?aL:rL;return{pages:_(F.pages,A,O),pageParams:_(F.pageParams,N,O)}};if(X&&H.length){let F=X==="backward",N=F?ym:JM,L={pages:H,pageParams:G},V=N(Q,L);z=await U(L,V,F)}else{let F=$??H.length;do{let N=Y===0?G[0]??Q.initialPageParam:JM(Q,z);if(Y>0&&N==null)break;z=await U(z,N),Y++}while(Y<F)}return z};if(Z.options.persister)Z.fetchFn=()=>{return Z.options.persister?.(K,{client:Z.client,queryKey:Z.queryKey,meta:Z.options.meta,signal:Z.signal},J)};else Z.fetchFn=K}}}function JM($,{pages:Z,pageParams:J}){let Q=Z.length-1;return Z.length>0?$.getNextPageParam(Z[Q],Z,J[Q],J):void 0}function ym($,{pages:Z,pageParams:J}){return Z.length>0?$.getPreviousPageParam?.(Z[0],Z,J[0],J):void 0}var QM=class extends CX{#$;#Z;#J;#X;constructor($){super();this.#$=$.client,this.mutationId=$.mutationId,this.#J=$.mutationCache,this.#Z=[],this.state=$.state||rW(),this.setOptions($.options),this.scheduleGc()}setOptions($){this.options=$,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver($){if(!this.#Z.includes($))this.#Z.push($),this.clearGcTimeout(),this.#J.notify({type:"observerAdded",mutation:this,observer:$})}removeObserver($){this.#Z=this.#Z.filter((Z)=>Z!==$),this.scheduleGc(),this.#J.notify({type:"observerRemoved",mutation:this,observer:$})}optionalRemove(){if(!this.#Z.length)if(this.state.status==="pending")this.scheduleGc();else this.#J.remove(this)}continue(){return this.#X?.continue()??this.execute(this.state.variables)}async execute($){let Z=()=>{this.#Q({type:"continue"})},J={client:this.#$,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#X=jX({fn:()=>{if(!this.options.mutationFn)return Promise.reject(Error("No mutationFn found"));return this.options.mutationFn($,J)},onFail:(H,G)=>{this.#Q({type:"failed",failureCount:H,error:G})},onPause:()=>{this.#Q({type:"pause"})},onContinue:Z,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#J.canRun(this)});let Q=this.state.status==="pending",X=!this.#X.canStart();try{if(Q)Z();else{if(this.#Q({type:"pending",variables:$,isPaused:X}),this.#J.config.onMutate)await this.#J.config.onMutate($,this,J);let G=await this.options.onMutate?.($,J);if(G!==this.state.context)this.#Q({type:"pending",context:G,variables:$,isPaused:X})}let H=await this.#X.start();return await this.#J.config.onSuccess?.(H,$,this.state.context,this,J),await this.options.onSuccess?.(H,$,this.state.context,J),await this.#J.config.onSettled?.(H,null,this.state.variables,this.state.context,this,J),await this.options.onSettled?.(H,null,$,this.state.context,J),this.#Q({type:"success",data:H}),H}catch(H){try{await this.#J.config.onError?.(H,$,this.state.context,this,J)}catch(G){Promise.reject(G)}try{await this.options.onError?.(H,$,this.state.context,J)}catch(G){Promise.reject(G)}try{await this.#J.config.onSettled?.(void 0,H,this.state.variables,this.state.context,this,J)}catch(G){Promise.reject(G)}try{await this.options.onSettled?.(void 0,H,$,this.state.context,J)}catch(G){Promise.reject(G)}throw this.#Q({type:"error",error:H}),H}finally{this.#J.runNext(this)}}#Q($){let Z=(J)=>{switch($.type){case"failed":return{...J,failureCount:$.failureCount,failureReason:$.error};case"pause":return{...J,isPaused:!0};case"continue":return{...J,isPaused:!1};case"pending":return{...J,context:$.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:$.isPaused,status:"pending",variables:$.variables,submittedAt:Date.now()};case"success":return{...J,data:$.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...J,data:void 0,error:$.error,failureCount:J.failureCount+1,failureReason:$.error,isPaused:!1,status:"error"}}};this.state=Z(this.state),S5.batch(()=>{this.#Z.forEach((J)=>{J.onMutationUpdate($)}),this.#J.notify({mutation:this,type:"updated",action:$})})}};function rW(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var XM=class extends E4{constructor($={}){super();this.config=$,this.#$=new Set,this.#Z=new Map,this.#J=0}#$;#Z;#J;build($,Z,J){let Q=new QM({client:$,mutationCache:this,mutationId:++this.#J,options:$.defaultMutationOptions(Z),state:J});return this.add(Q),Q}add($){this.#$.add($);let Z=TX($);if(typeof Z==="string"){let J=this.#Z.get(Z);if(J)J.push($);else this.#Z.set(Z,[$])}this.notify({type:"added",mutation:$})}remove($){if(this.#$.delete($)){let Z=TX($);if(typeof Z==="string"){let J=this.#Z.get(Z);if(J){if(J.length>1){let Q=J.indexOf($);if(Q!==-1)J.splice(Q,1)}else if(J[0]===$)this.#Z.delete(Z)}}}this.notify({type:"removed",mutation:$})}canRun($){let Z=TX($);if(typeof Z==="string"){let Q=this.#Z.get(Z)?.find((X)=>X.state.status==="pending");return!Q||Q===$}else return!0}runNext($){let Z=TX($);if(typeof Z==="string")return this.#Z.get(Z)?.find((Q)=>Q!==$&&Q.state.isPaused)?.continue()??Promise.resolve();else return Promise.resolve()}clear(){S5.batch(()=>{this.#$.forEach(($)=>{this.notify({type:"removed",mutation:$})}),this.#$.clear(),this.#Z.clear()})}getAll(){return Array.from(this.#$)}find($){let Z={exact:!0,...$};return this.getAll().find((J)=>OX(Z,J))}findAll($={}){return this.getAll().filter((Z)=>OX($,Z))}notify($){S5.batch(()=>{this.listeners.forEach((Z)=>{Z($)})})}resumePausedMutations(){let $=this.getAll().filter((Z)=>Z.state.isPaused);return S5.batch(()=>Promise.all($.map((Z)=>Z.continue().catch(w1))))}};function TX($){return $.options.scope?.id}var aW=class extends E4{#$;#Z=void 0;#J;#X;constructor($,Z){super();this.#$=$,this.setOptions(Z),this.bindMethods(),this.#Q()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions($){let Z=this.options;if(this.options=this.#$.defaultMutationOptions($),!V7(this.options,Z))this.#$.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#J,observer:this});if(Z?.mutationKey&&this.options.mutationKey&&D2(Z.mutationKey)!==D2(this.options.mutationKey))this.reset();else if(this.#J?.state.status==="pending")this.#J.setOptions(this.options)}onUnsubscribe(){if(!this.hasListeners())this.#J?.removeObserver(this)}onMutationUpdate($){this.#Q(),this.#H($)}getCurrentResult(){return this.#Z}reset(){this.#J?.removeObserver(this),this.#J=void 0,this.#Q(),this.#H()}mutate($,Z){return this.#X=Z,this.#J?.removeObserver(this),this.#J=this.#$.getMutationCache().build(this.#$,this.options),this.#J.addObserver(this),this.#J.execute($)}#Q(){let $=this.#J?.state??rW();this.#Z={...$,isPending:$.status==="pending",isSuccess:$.status==="success",isError:$.status==="error",isIdle:$.status==="idle",mutate:this.mutate,reset:this.reset}}#H($){S5.batch(()=>{if(this.#X&&this.hasListeners()){let Z=this.#Z.variables,J=this.#Z.context,Q={client:this.#$,meta:this.options.meta,mutationKey:this.options.mutationKey};if($?.type==="success"){try{this.#X.onSuccess?.($.data,Z,J,Q)}catch(X){Promise.reject(X)}try{this.#X.onSettled?.($.data,null,Z,J,Q)}catch(X){Promise.reject(X)}}else if($?.type==="error"){try{this.#X.onError?.($.error,Z,J,Q)}catch(X){Promise.reject(X)}try{this.#X.onSettled?.(void 0,$.error,Z,J,Q)}catch(X){Promise.reject(X)}}}this.listeners.forEach((Z)=>{Z(this.#Z)})})}};var HM=class extends E4{constructor($={}){super();this.config=$,this.#$=new Map}#$;build($,Z,J){let Q=Z.queryKey,X=Z.queryHash??TZ(Q,Z),H=this.get(X);if(!H)H=new eL({client:$,queryKey:Q,queryHash:X,options:$.defaultQueryOptions(Z),state:J,defaultOptions:$.getQueryDefaults(Q)}),this.add(H);return H}add($){if(!this.#$.has($.queryHash))this.#$.set($.queryHash,$),this.notify({type:"added",query:$})}remove($){let Z=this.#$.get($.queryHash);if(Z){if($.destroy(),Z===$)this.#$.delete($.queryHash);this.notify({type:"removed",query:$})}}clear(){S5.batch(()=>{this.getAll().forEach(($)=>{this.remove($)})})}get($){return this.#$.get($)}getAll(){return[...this.#$.values()]}find($){let Z={exact:!0,...$};return this.getAll().find((J)=>_X(Z,J))}findAll($={}){let Z=this.getAll();return Object.keys($).length>0?Z.filter((J)=>_X($,J)):Z}notify($){S5.batch(()=>{this.listeners.forEach((Z)=>{Z($)})})}onFocus(){S5.batch(()=>{this.getAll().forEach(($)=>{$.onFocus()})})}onOnline(){S5.batch(()=>{this.getAll().forEach(($)=>{$.onOnline()})})}};var nW=class{#$;#Z;#J;#X;#Q;#H;#G;#z;constructor($={}){this.#$=$.queryCache||new HM,this.#Z=$.mutationCache||new XM,this.#J=$.defaultOptions||{},this.#X=new Map,this.#Q=new Map,this.#H=0}mount(){if(this.#H++,this.#H!==1)return;this.#G=N7.subscribe(async($)=>{if($)await this.resumePausedMutations(),this.#$.onFocus()}),this.#z=A7.subscribe(async($)=>{if($)await this.resumePausedMutations(),this.#$.onOnline()})}unmount(){if(this.#H--,this.#H!==0)return;this.#G?.(),this.#G=void 0,this.#z?.(),this.#z=void 0}isFetching($){return this.#$.findAll({...$,fetchStatus:"fetching"}).length}isMutating($){return this.#Z.findAll({...$,status:"pending"}).length}getQueryData($){let Z=this.defaultQueryOptions({queryKey:$});return this.#$.get(Z.queryHash)?.state.data}ensureQueryData($){let Z=this.defaultQueryOptions($),J=this.#$.build(this,Z),Q=J.state.data;if(Q===void 0)return this.fetchQuery($);if($.revalidateIfStale&&J.isStaleByTime(o4(Z.staleTime,J)))this.prefetchQuery(Z);return Promise.resolve(Q)}getQueriesData($){return this.#$.findAll($).map(({queryKey:Z,state:J})=>{let Q=J.data;return[Z,Q]})}setQueryData($,Z,J){let Q=this.defaultQueryOptions({queryKey:$}),H=this.#$.get(Q.queryHash)?.state.data,G=lL(Z,H);if(G===void 0)return;return this.#$.build(this,Q).setData(G,{...J,manual:!0})}setQueriesData($,Z,J){return S5.batch(()=>this.#$.findAll($).map(({queryKey:Q})=>[Q,this.setQueryData(Q,Z,J)]))}getQueryState($){let Z=this.defaultQueryOptions({queryKey:$});return this.#$.get(Z.queryHash)?.state}removeQueries($){let Z=this.#$;S5.batch(()=>{Z.findAll($).forEach((J)=>{Z.remove(J)})})}resetQueries($,Z){let J=this.#$;return S5.batch(()=>{return J.findAll($).forEach((Q)=>{Q.reset()}),this.refetchQueries({type:"active",...$},Z)})}cancelQueries($,Z={}){let J={revert:!0,...Z},Q=S5.batch(()=>this.#$.findAll($).map((X)=>X.cancel(J)));return Promise.all(Q).then(w1).catch(w1)}invalidateQueries($,Z={}){return S5.batch(()=>{if(this.#$.findAll($).forEach((J)=>{J.invalidate()}),$?.refetchType==="none")return Promise.resolve();return this.refetchQueries({...$,type:$?.refetchType??$?.type??"active"},Z)})}refetchQueries($,Z={}){let J={...Z,cancelRefetch:Z.cancelRefetch??!0},Q=S5.batch(()=>this.#$.findAll($).filter((X)=>!X.isDisabled()&&!X.isStatic()).map((X)=>{let H=X.fetch(void 0,J);if(!J.throwOnError)H=H.catch(w1);return X.state.fetchStatus==="paused"?Promise.resolve():H}));return Promise.all(Q).then(w1)}fetchQuery($){let Z=this.defaultQueryOptions($);if(Z.retry===void 0)Z.retry=!1;let J=this.#$.build(this,Z);return J.isStaleByTime(o4(Z.staleTime,J))?J.fetch(Z):Promise.resolve(J.state.data)}prefetchQuery($){return this.fetchQuery($).then(w1).catch(w1)}fetchInfiniteQuery($){return $.behavior=iW($.pages),this.fetchQuery($)}prefetchInfiniteQuery($){return this.fetchInfiniteQuery($).then(w1).catch(w1)}ensureInfiniteQueryData($){return $.behavior=iW($.pages),this.ensureQueryData($)}resumePausedMutations(){if(A7.isOnline())return this.#Z.resumePausedMutations();return Promise.resolve()}getQueryCache(){return this.#$}getMutationCache(){return this.#Z}getDefaultOptions(){return this.#J}setDefaultOptions($){this.#J=$}setQueryDefaults($,Z){this.#X.set(D2($),{queryKey:$,defaultOptions:Z})}getQueryDefaults($){let Z=[...this.#X.values()],J={};return Z.forEach((Q)=>{if(a6($,Q.queryKey))Object.assign(J,Q.defaultOptions)}),J}setMutationDefaults($,Z){this.#Q.set(D2($),{mutationKey:$,defaultOptions:Z})}getMutationDefaults($){let Z=[...this.#Q.values()],J={};return Z.forEach((Q)=>{if(a6($,Q.mutationKey))Object.assign(J,Q.defaultOptions)}),J}defaultQueryOptions($){if($._defaulted)return $;let Z={...this.#J.queries,...this.getQueryDefaults($.queryKey),...$,_defaulted:!0};if(!Z.queryHash)Z.queryHash=TZ(Z.queryKey,Z);if(Z.refetchOnReconnect===void 0)Z.refetchOnReconnect=Z.networkMode!=="always";if(Z.throwOnError===void 0)Z.throwOnError=!!Z.suspense;if(!Z.networkMode&&Z.persister)Z.networkMode="offlineFirst";if(Z.queryFn===L7)Z.enabled=!1;return Z}defaultMutationOptions($){if($?._defaulted)return $;return{...this.#J.mutations,...$?.mutationKey&&this.getMutationDefaults($.mutationKey),...$,_defaulted:!0}}clear(){this.#$.clear(),this.#Z.clear()}};var E9=P(v(),1);var D7=P(v(),1),GM=P(l(),1),sW=D7.createContext(void 0),s0=($)=>{let Z=D7.useContext(sW);if($)return $;if(!Z)throw Error("No QueryClient set, use QueryClientProvider to set one");return Z},oW=({client:$,children:Z})=>{return D7.useEffect(()=>{return $.mount(),()=>{$.unmount()}},[$]),GM.jsx(sW.Provider,{value:$,children:Z})};var kZ=P(v(),1),xm=P(l(),1);function hm(){let $=!1;return{clearReset:()=>{$=!1},reset:()=>{$=!0},isReset:()=>{return $}}}var gm=kZ.createContext(hm()),zM=()=>kZ.useContext(gm);var YM=P(v(),1);var KM=($,Z,J)=>{let Q=J?.state.error&&typeof $.throwOnError==="function"?M7($.throwOnError,[J.state.error,J]):$.throwOnError;if($.suspense||$.experimental_prefetchInRender||Q){if(!Z.isReset())$.retryOnMount=!1}},WM=($)=>{YM.useEffect(()=>{$.clearReset()},[$])},BM=({result:$,errorResetBoundary:Z,throwOnError:J,query:Q,suspense:X})=>{return $.isError&&!Z.isReset()&&!$.isFetching&&Q&&(X&&$.data===void 0||M7(J,[$.error,Q]))};var EX=P(v(),1),qM=EX.createContext(!1),UM=()=>EX.useContext(qM),MZ0=qM.Provider;var FM=($)=>{if($.suspense){let J=(X)=>X==="static"?X:Math.max(X??1000,1000),Q=$.staleTime;if($.staleTime=typeof Q==="function"?(...X)=>J(Q(...X)):J(Q),typeof $.gcTime==="number")$.gcTime=Math.max($.gcTime,1000)}},NM=($,Z)=>$.isLoading&&$.isFetching&&!Z,VM=($,Z)=>$?.suspense&&Z.isPending,tW=($,Z,J)=>Z.fetchOptimistic($).catch(()=>{J.clearReset()});function LM($,Z,J){let Q=UM(),X=zM(),H=s0(J),G=H.defaultQueryOptions($);H.getDefaultOptions().queries?._experimental_beforeQuery?.(G);let z=H.getQueryCache().get(G.queryHash);G._optimisticResults=Q?"isRestoring":"optimistic",FM(G),KM(G,X,z),WM(X);let Y=!H.getQueryCache().get(G.queryHash),[K]=E9.useState(()=>new Z(H,G)),W=K.getOptimisticResult(G),B=!Q&&$.subscribed!==!1;if(E9.useSyncExternalStore(E9.useCallback((q)=>{let U=B?K.subscribe(S5.batchCalls(q)):w1;return K.updateResult(),U},[K,B]),()=>K.getCurrentResult(),()=>K.getCurrentResult()),E9.useEffect(()=>{K.setOptions(G)},[G,K]),VM(G,W))throw tW(G,K,X);if(BM({result:W,errorResetBoundary:X,throwOnError:G.throwOnError,query:z,suspense:G.suspense}))throw W.error;if(H.getDefaultOptions().queries?._experimental_afterQuery?.(G,W),G.experimental_prefetchInRender&&!_2.isServer()&&NM(W,Q))(Y?tW(G,K,X):z?.promise)?.catch(w1).finally(()=>{K.updateResult()});return!G.notifyOnChangeProps?K.trackResult(W):W}function $1($,Z){return LM($,dW,Z)}var J9=P(v(),1);function eW($,Z){let J=s0(Z);return AM({filters:{...$,status:"pending"}},J).length}function MM($,Z){return $.findAll(Z.filters).map((J)=>Z.select?Z.select(J):J.state)}function AM($={},Z){let J=s0(Z).getMutationCache(),Q=J9.useRef($),X=J9.useRef(null);if(X.current===null)X.current=MM(J,$);return J9.useEffect(()=>{Q.current=$}),J9.useSyncExternalStore(J9.useCallback((H)=>J.subscribe(()=>{let G=EZ(X.current,MM(J,Q.current));if(X.current!==G)X.current=G,S5.schedule(H)}),[J]),()=>X.current,()=>X.current)}var Q9=P(v(),1);function r5($,Z){let J=s0(Z),[Q]=Q9.useState(()=>new aW(J,$));Q9.useEffect(()=>{Q.setOptions($)},[Q,$]);let X=Q9.useSyncExternalStore(Q9.useCallback((G)=>Q.subscribe(S5.batchCalls(G)),[Q]),()=>Q.getCurrentResult(),()=>Q.getCurrentResult()),H=Q9.useCallback((G,z)=>{Q.mutate(G,z).catch(w1)},[Q]);if(X.error&&M7(Q.options.throwOnError,[X.error]))throw X.error;return{...X,mutate:H,mutateAsync:X.mutate}}var _m=P(b70(),1);function DM($,Z){if($ instanceof RegExp)return{keys:!1,pattern:$};var J,Q,X,H,G=[],z="",Y=$.split("/");Y[0]||Y.shift();while(X=Y.shift())if(J=X[0],J==="*")G.push(J),z+=X[1]==="?"?"(?:/(.*))?":"/(.*)";else if(J===":"){if(Q=X.indexOf("?",1),H=X.indexOf(".",1),G.push(X.substring(1,~Q?Q:~H?H:X.length)),z+=!!~Q&&!~H?"(?:/([^/]+?))?":"/([^/]+?)",~H)z+=(~Q?"?":"")+"\\"+X.substring(H)}else z+="/"+X;return{keys:G,pattern:new RegExp("^"+z+(Z?"(?=$|/)":"/?$"),"i")}}var n6=P(v(),1),M5=P(v(),1);var RX=P(IX(),1);var nm=n6.useInsertionEffect,sm=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ZB=sm?n6.useLayoutEffect:n6.useEffect,om=nm||ZB,kX=($)=>{let Z=n6.useRef([$,(...J)=>Z[0](...J)]).current;return om(()=>{Z[0]=$}),Z[1]};var tm="popstate",JB="pushState",QB="replaceState",em="hashchange",_M=[tm,JB,QB,em],$u=($)=>{for(let Z of _M)addEventListener(Z,$);return()=>{for(let Z of _M)removeEventListener(Z,$)}},XB=($,Z)=>RX.useSyncExternalStore($u,$,Z),OM=()=>location.search,jM=({ssrSearch:$}={})=>XB(OM,$!=null?()=>$:OM),PM=()=>location.pathname,Zu=({ssrPath:$}={})=>XB(PM,$!=null?()=>$:PM),Ju=()=>history.state,CM=()=>XB(Ju,()=>null),Qu=($,{replace:Z=!1,state:J=null}={})=>history[Z?QB:JB](J,"",$),TM=($={})=>[Zu($),Qu],wM=Symbol.for("wouter_v3");if(typeof history<"u"&&typeof window[wM]>"u"){for(let $ of[JB,QB]){let Z=history[$];history[$]=function(){let J=Z.apply(this,arguments),Q=new Event($);return Q.arguments=arguments,dispatchEvent(Q),J}}Object.defineProperty(window,wM,{value:!0})}var Xu=($,Z)=>!Z.toLowerCase().indexOf($.toLowerCase())?Z.slice($.length)||"/":"~"+Z,IM=($="")=>$==="/"?"":$,RM=($,Z)=>$[0]==="~"?$.slice(1):IM(Z)+$,kM=($="",Z)=>Xu(EM(IM($)),EM(Z));var EM=($)=>{try{return decodeURI($)}catch(Z){return $}};var bM={hook:TM,searchHook:jM,parser:DM,base:"",ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:($)=>$,aroundNav:($,Z,J)=>$(Z,J)},yM=M5.createContext(bM),_7=()=>M5.useContext(yM),xM={},hM=M5.createContext(xM),HB=()=>M5.useContext(hM),SZ=($)=>{let[Z,J]=$.hook($);return[kM($.base,Z),kX((Q,X)=>$.aroundNav(J,RM(Q,$.base),X))]},I4=()=>SZ(_7());var gM=($,Z,J,Q)=>{let{pattern:X,keys:H}=Z instanceof RegExp?{keys:!1,pattern:Z}:$(Z||"*",Q),G=X.exec(J)||[],[z,...Y]=G;return z!==void 0?[!0,(()=>{let K=H!==!1?Object.fromEntries(H.map((B,q)=>[B,Y[q]])):G.groups,W={...Y};return K&&Object.assign(W,K),W})(),...Q?[z]:[]]:[!1,null]};var GB=({children:$,...Z})=>{let J=_7(),Q=Z.hook?bM:J,X=Q,[H,G=Z.ssrSearch??""]=Z.ssrPath?.split("?")??[];if(H)Z.ssrSearch=G,Z.ssrPath=H;Z.hrefs=Z.hrefs??Z.hook?.hrefs,Z.searchHook=Z.searchHook??Z.hook?.searchHook;let z=M5.useRef({}),Y=z.current,K=Y;for(let W in Q){let B=W==="base"?Q[W]+(Z[W]??""):Z[W]??Q[W];if(Y===K&&B!==K[W])z.current=K={...K};if(K[W]=B,B!==Q[W]||B!==X[W])X=K}return M5.createElement(yM.Provider,{value:X,children:$})},SM=({children:$,component:Z},J)=>{if(Z)return M5.createElement(Z,{params:J});return typeof $==="function"?$(J):$},Hu=($)=>{let Z=M5.useRef(xM),J=Z.current;return Z.current=Object.keys($).length!==Object.keys(J).length||Object.entries($).some(([Q,X])=>X!==J[Q])?$:J};var SX=({path:$,nest:Z,match:J,...Q})=>{let X=_7(),[H]=SZ(X),[G,z,Y]=J??gM(X.parser,$,H,Z),K=Hu({...HB(),...z});if(!G)return null;let W=Y?M5.createElement(GB,{base:Y},SM(Q,K)):SM(Q,K);return M5.createElement(hM.Provider,{value:K,children:W})},bZ=M5.forwardRef(($,Z)=>{let J=_7(),[Q,X]=SZ(J),{to:H="",href:G=H,onClick:z,asChild:Y,children:K,className:W,replace:B,state:q,transition:U,...F}=$,N=kX((V)=>{if(V.ctrlKey||V.metaKey||V.altKey||V.shiftKey||V.button!==0)return;if(z?.(V),!V.defaultPrevented)V.preventDefault(),X(G,$)}),L=J.hrefs(G[0]==="~"?G.slice(1):J.base+G,J);return Y&&M5.isValidElement(K)?M5.cloneElement(K,{onClick:N,href:L}):M5.createElement("a",{...F,onClick:N,href:L,className:W?.call?W(Q===G):W,children:K,ref:Z})}),vM=($)=>Array.isArray($)?$.flatMap((Z)=>vM(Z&&Z.type===M5.Fragment?Z.props.children:Z)):[$],fM=({children:$,location:Z})=>{let J=_7(),[Q]=SZ(J);for(let X of vM($)){let H=0;if(M5.isValidElement(X)&&(H=gM(J.parser,X.props.path,Z||Q,X.props.nest))[0])return M5.cloneElement(X,{match:H})}return null},mM=($)=>{let{to:Z,href:J=Z}=$,Q=_7(),[,X]=SZ(Q),H=kX(()=>X(Z||J,$)),{ssrContext:G}=Q;if(ZB(()=>{H()},[]),G)G.redirectTo=Z;return null};var C8={};S4(C8,{useToastManager:()=>yD,createToastManager:()=>xD,Viewport:()=>RA,Title:()=>dA,Root:()=>hA,Provider:()=>jA,Positioner:()=>kD,Portal:()=>LD,Description:()=>pA,Content:()=>gA,Close:()=>lA,Arrow:()=>bD,Action:()=>rA});var PA=P(v(),1);var uM=P(v(),1),Gu=[];function _8($){uM.useEffect($,Gu)}var bX=P(v(),1),yZ=bX.createContext(void 0);function I9(){let $=bX.useContext(yZ);if(!$)throw Error(I0(73));return $}var xX=Symbol("NOT_FOUND");function zu($,Z=`expected a function, instead received ${typeof $}`){if(typeof $!=="function")throw TypeError(Z)}function Yu($,Z=`expected an object, instead received ${typeof $}`){if(typeof $!=="object")throw TypeError(Z)}function Ku($,Z="expected all items to be functions, instead received the following types: "){if(!$.every((J)=>typeof J==="function")){let J=$.map((Q)=>typeof Q==="function"?`function ${Q.name||"unnamed"}()`:typeof Q).join(", ");throw TypeError(`${Z}[${J}]`)}}var pM=($)=>{return Array.isArray($)?$:[$]};function Wu($){let Z=Array.isArray($[0])?$[0]:$;return Ku(Z,"createSelector expects all input-selectors to be functions, but received the following types: "),Z}function Bu($,Z){let J=[],{length:Q}=$;for(let X=0;X<Q;X++)J.push($[X].apply(null,Z));return J}var cM=0,qu=null,lM=class{revision=cM;_value;_lastValue;_isEqual=zB;constructor($,Z=zB){this._value=this._lastValue=$,this._isEqual=Z}get value(){return qu?.add(this),this._value}set value($){if(this.value===$)return;this._value=$,this.revision=++cM}};function zB($,Z){return $===Z}function YB($){if(!($ instanceof lM))console.warn("Not a valid cell! ",$);return $.value}function Uu($,Z=zB){return new lM($,Z)}var Fu=($,Z)=>!1;function hX(){return Uu(null,Fu)}var iM=($)=>{let Z=$.collectionTag;if(Z===null)Z=$.collectionTag=hX();YB(Z)};var gJ0=Symbol(),rM=0,Nu=Object.getPrototypeOf({}),Vu=class{constructor($){this.value=$,this.value=$,this.tag.value=$}proxy=new Proxy(this,xZ);tag=hX();tags={};children={};collectionTag=null;id=rM++},xZ={get($,Z){function J(){let{value:X}=$,H=Reflect.get(X,Z);if(typeof Z==="symbol")return H;if(Z in Nu)return H;if(typeof H==="object"&&H!==null){let G=$.children[Z];if(G===void 0)G=$.children[Z]=Au(H);if(G.tag)YB(G.tag);return G.proxy}else{let G=$.tags[Z];if(G===void 0)G=$.tags[Z]=hX(),G.value=H;return YB(G),H}}return J()},ownKeys($){return iM($),Reflect.ownKeys($.value)},getOwnPropertyDescriptor($,Z){return Reflect.getOwnPropertyDescriptor($.value,Z)},has($,Z){return Reflect.has($.value,Z)}},Lu=class{constructor($){this.value=$,this.value=$,this.tag.value=$}proxy=new Proxy([this],Mu);tag=hX();tags={};children={};collectionTag=null;id=rM++},Mu={get([$],Z){if(Z==="length")iM($);return xZ.get($,Z)},ownKeys([$]){return xZ.ownKeys($)},getOwnPropertyDescriptor([$],Z){return xZ.getOwnPropertyDescriptor($,Z)},has([$],Z){return xZ.has($,Z)}};function Au($){if(Array.isArray($))return new Lu($);return new Vu($)}function Du($){let Z;return{get(J){if(Z&&$(Z.key,J))return Z.value;return xX},put(J,Q){Z={key:J,value:Q}},getEntries(){return Z?[Z]:[]},clear(){Z=void 0}}}function _u($,Z){let J=[];function Q(z){let Y=J.findIndex((K)=>Z(z,K.key));if(Y>-1){let K=J[Y];if(Y>0)J.splice(Y,1),J.unshift(K);return K.value}return xX}function X(z,Y){if(Q(z)===xX){if(J.unshift({key:z,value:Y}),J.length>$)J.pop()}}function H(){return J}function G(){J=[]}return{get:Q,put:X,getEntries:H,clear:G}}var Ou=($,Z)=>$===Z;function Pu($){return function(J,Q){if(J===null||Q===null||J.length!==Q.length)return!1;let{length:X}=J;for(let H=0;H<X;H++)if(!$(J[H],Q[H]))return!1;return!0}}function aM($,Z){let J=typeof Z==="object"?Z:{equalityCheck:Z},{equalityCheck:Q=Ou,maxSize:X=1,resultEqualityCheck:H}=J,G=Pu(Q),z=0,Y=X<=1?Du(G):_u(X,G);function K(){let W=Y.get(arguments);if(W===xX){if(W=$.apply(null,arguments),z++,H){let q=Y.getEntries().find((U)=>H(U.value,W));if(q)W=q.value,z!==0&&z--}Y.put(arguments,W)}return W}return K.clearCache=()=>{Y.clear(),K.resetResultsCount()},K.resultsCount=()=>z,K.resetResultsCount=()=>{z=0},K}var wu=class{constructor($){this.value=$}deref(){return this.value}},ju=typeof WeakRef<"u"?WeakRef:wu,Cu=0,dM=1;function yX(){return{s:Cu,v:void 0,o:null,p:null}}function nM($,Z={}){let J=yX(),{resultEqualityCheck:Q}=Z,X,H=0;function G(){let z=J,{length:Y}=arguments;for(let B=0,q=Y;B<q;B++){let U=arguments[B];if(typeof U==="function"||typeof U==="object"&&U!==null){let F=z.o;if(F===null)z.o=F=new WeakMap;let N=F.get(U);if(N===void 0)z=yX(),F.set(U,z);else z=N}else{let F=z.p;if(F===null)z.p=F=new Map;let N=F.get(U);if(N===void 0)z=yX(),F.set(U,z);else z=N}}let K=z,W;if(z.s===dM)W=z.v;else if(W=$.apply(null,arguments),H++,Q){let B=X?.deref?.()??X;if(B!=null&&Q(B,W))W=B,H!==0&&H--;X=typeof W==="object"&&W!==null||typeof W==="function"?new ju(W):W}return K.s=dM,K.v=W,W}return G.clearCache=()=>{J=yX(),G.resetResultsCount()},G.resultsCount=()=>H,G.resetResultsCount=()=>{H=0},G}function KB($,...Z){let J=typeof $==="function"?{memoize:$,memoizeOptions:Z}:$,Q=(...X)=>{let H=0,G=0,z,Y={},K=X.pop();if(typeof K==="object")Y=K,K=X.pop();zu(K,`createSelector expects an output function after the inputs, but received: [${typeof K}]`);let W={...J,...Y},{memoize:B,memoizeOptions:q=[],argsMemoize:U=nM,argsMemoizeOptions:F=[],devModeChecks:N={}}=W,L=pM(q),V=pM(F),M=Wu(X),A=B(function(){return H++,K.apply(null,arguments)},...L),O=!0,_=U(function(){G++;let T=Bu(M,arguments);return z=A.apply(null,T),z},...V);return Object.assign(_,{resultFunc:K,memoizedResultFunc:A,dependencies:M,dependencyRecomputations:()=>G,resetDependencyRecomputations:()=>{G=0},lastResult:()=>z,recomputations:()=>H,resetRecomputations:()=>{H=0},memoize:B,argsMemoize:U})};return Object.assign(Q,{withTypes:()=>Q}),Q}var Tu=KB(nM),Eu=Object.assign(($,Z=Tu)=>{Yu($,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof $}`);let J=Object.keys($),Q=J.map((H)=>$[H]);return Z(Q,(...H)=>{return H.reduce((G,z,Y)=>{return G[J[Y]]=z,G},{})})},{withTypes:()=>Eu});var Iu=KB({memoize:aM,memoizeOptions:{maxSize:1,equalityCheck:Object.is}}),C0=($,Z,J,Q,X,H,...G)=>{if(G.length>0)throw Error(I0(1));let z;if($&&Z&&J&&Q&&X&&H)z=(Y,K,W,B)=>{let q=$(Y,K,W,B),U=Z(Y,K,W,B),F=J(Y,K,W,B),N=Q(Y,K,W,B),L=X(Y,K,W,B);return H(q,U,F,N,L,K,W,B)};else if($&&Z&&J&&Q&&X)z=(Y,K,W,B)=>{let q=$(Y,K,W,B),U=Z(Y,K,W,B),F=J(Y,K,W,B),N=Q(Y,K,W,B);return X(q,U,F,N,K,W,B)};else if($&&Z&&J&&Q)z=(Y,K,W,B)=>{let q=$(Y,K,W,B),U=Z(Y,K,W,B),F=J(Y,K,W,B);return Q(q,U,F,K,W,B)};else if($&&Z&&J)z=(Y,K,W,B)=>{let q=$(Y,K,W,B),U=Z(Y,K,W,B);return J(q,U,K,W,B)};else if($&&Z)z=(Y,K,W,B)=>{let q=$(Y,K,W,B);return Z(q,K,W,B)};else if($)z=$;else throw Error("Missing arguments");return z},sM=(...$)=>{let Z=new WeakMap,J=1,Q=$[$.length-1],X=$.length-1||1,H=Q.length-X;if(H>3)throw Error(I0(2));return(z,Y,K,W)=>{let B=z.__cacheKey__;if(!B)B={id:J},z.__cacheKey__=B,J+=1;let q=Z.get(B);if(!q){let U=$,F=[void 0,void 0,void 0];switch(H){case 0:break;case 1:{U=[...$.slice(0,-1),()=>F[0],Q];break}case 2:{U=[...$.slice(0,-1),()=>F[0],()=>F[1],Q];break}case 3:{U=[...$.slice(0,-1),()=>F[0],()=>F[1],()=>F[2],Q];break}default:throw Error(I0(2))}q=Iu(...U),q.selectorArgs=F,Z.set(B,q)}switch(q.selectorArgs[0]=Y,q.selectorArgs[1]=K,q.selectorArgs[2]=W,H){case 0:return q(z);case 1:return q(z,Y);case 2:return q(z,Y,K);case 3:return q(z,Y,K,W);default:throw Error("unreachable")}}};var $A=P(v(),1),UB=P(IX(),1);var R9=P(v(),1),Ru=IX();function ku($,Z){return $===Z&&($!==0||1/$===1/Z)||$!==$&&Z!==Z}var Su=typeof Object.is==="function"?Object.is:ku,bu=Ru.useSyncExternalStore,yu=R9.useRef,xu=R9.useEffect,hu=R9.useMemo,gu=R9.useDebugValue;var WB=function($,Z,J,Q,X){var H=yu(null);if(H.current===null){var G={hasValue:!1,value:null};H.current=G}else G=H.current;H=hu(function(){function Y(U){if(!K){if(K=!0,W=U,U=Q(U),X!==void 0&&G.hasValue){var F=G.value;if(X(F,U))return B=F}return B=U}if(F=B,Su(W,U))return F;var N=Q(U);if(X!==void 0&&X(F,N))return W=U,F;return W=U,B=N}var K=!1,W,B,q=J===void 0?null:J;return[function(){return Y(Z())},q===null?void 0:function(){return Y(q())}]},[Z,J,Q,X]);var z=bu($,H[0],H[1]);return xu(function(){G.hasValue=!0,G.value=z},[z]),gu(z),z};var oM=P(v(),1);var BB=[],qB=void 0;function tM(){return qB}function eM($){BB.push($)}function hZ($){let Z=(J,Q)=>{let X=P5(vu).current,H;try{qB=X;for(let G of BB)G.before(X);H=$(J,Q);for(let G of BB)G.after(X);X.didInitialize=!0}finally{qB=void 0}return H};return Z.displayName=$.displayName||$.name,Z}function gX($){return oM.forwardRef(hZ($))}function vu(){return{didInitialize:!1}}var fu=vX(19),mu=fu?pu:cu;function fX($,Z,J,Q,X){return mu($,Z,J,Q,X)}function uu($,Z,J,Q,X){let H=$A.useCallback(()=>Z($.getSnapshot(),J,Q,X),[$,Z,J,Q,X]);return UB.useSyncExternalStore($.subscribe,H,H)}eM({before($){if($.syncIndex=0,!$.didInitialize)$.syncTick=1,$.syncHooks=[],$.didChangeStore=!0,$.getSnapshot=()=>{let Z=!1;for(let J=0;J<$.syncHooks.length;J+=1){let Q=$.syncHooks[J],X=Q.selector(Q.store.state,Q.a1,Q.a2,Q.a3);if(Q.didChange||!Object.is(Q.value,X))Z=!0,Q.value=X,Q.didChange=!1}if(Z)$.syncTick+=1;return $.syncTick}},after($){if($.syncHooks.length>0){if($.didChangeStore)$.didChangeStore=!1,$.subscribe=(Z)=>{let J=new Set;for(let X of $.syncHooks)J.add(X.store);let Q=[];for(let X of J)Q.push(X.subscribe(Z));return()=>{for(let X of Q)X()}};UB.useSyncExternalStore($.subscribe,$.getSnapshot,$.getSnapshot)}}});function pu($,Z,J,Q,X){let H=tM();if(!H)return uu($,Z,J,Q,X);let G=H.syncIndex;H.syncIndex+=1;let z;if(!H.didInitialize)z={store:$,selector:Z,a1:J,a2:Q,a3:X,value:Z($.getSnapshot(),J,Q,X),didChange:!1},H.syncHooks.push(z);else if(z=H.syncHooks[G],z.store!==$||z.selector!==Z||!Object.is(z.a1,J)||!Object.is(z.a2,Q)||!Object.is(z.a3,X)){if(z.store!==$)H.didChangeStore=!0;z.store=$,z.selector=Z,z.a1=J,z.a2=Q,z.a3=X,z.didChange=!0}return z.value}function cu($,Z,J,Q,X){return WB($.subscribe,$.getSnapshot,$.getSnapshot,(H)=>Z(H,J,Q,X))}class FB{constructor($){this.state=$,this.listeners=new Set,this.updateTick=0}subscribe=($)=>{return this.listeners.add($),()=>{this.listeners.delete($)}};getSnapshot=()=>{return this.state};setState($){if(this.state===$)return;this.state=$,this.updateTick+=1;let Z=this.updateTick;for(let J of this.listeners){if(Z!==this.updateTick)return;J($)}}update($){for(let Z in $)if(!Object.is(this.state[Z],$[Z])){this.setState({...this.state,...$});return}}set($,Z){if(!Object.is(this.state[$],Z))this.setState({...this.state,[$]:Z})}notifyAll(){let $={...this.state};this.setState($)}use($,Z,J,Q){return fX(this,$,Z,J,Q)}}var s6=P(v(),1);class K4 extends FB{constructor($,Z={},J){super($);this.context=Z,this.selectors=J}useSyncedValue($,Z){s6.useDebugValue($),W0(()=>{if(this.state[$]!==Z)this.set($,Z)},[$,Z])}useSyncedValueWithCleanup($,Z){let J=this;W0(()=>{if(J.state[$]!==Z)J.set($,Z);return()=>{J.set($,void 0)}},[J,$,Z])}useSyncedValues($){let Z=this,J=Object.values($);W0(()=>{Z.update($)},[Z,...J])}useControlledProp($,Z){s6.useDebugValue($);let J=Z!==void 0;W0(()=>{if(J&&!Object.is(this.state[$],Z))super.setState({...this.state,[$]:Z})},[$,Z,J])}select($,Z,J,Q){let X=this.selectors[$];return X(this.state,Z,J,Q)}useState($,Z,J,Q){return s6.useDebugValue($),fX(this,this.selectors[$],Z,J,Q)}useContextCallback($,Z){s6.useDebugValue($);let J=K0(Z??y5);this.context[$]=J}useStateSetter($){let Z=s6.useRef(void 0);if(Z.current===void 0)Z.current=(J)=>{this.set($,J)};return Z.current}observe($,Z){let J;if(typeof $==="function")J=$;else J=this.selectors[$];let Q=J(this.state);return Z(Q,Q,this),this.subscribe((X)=>{let H=J(X);if(!Object.is(Q,H)){let G=Q;Q=H,Z(H,G,this)}})}}var mX=null,KQ0=globalThis.requestAnimationFrame;class ZA{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=($)=>{this.isScheduled=!1;let Z=this.callbacks,J=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,J>0)for(let Q=0;Q<Z.length;Q+=1)Z[Q]?.($)};request($){let Z=this.nextId;this.nextId+=1,this.callbacks.push($),this.callbacksCount+=1;let J=!1;if(!this.isScheduled||J)requestAnimationFrame(this.tick),this.isScheduled=!0;return Z}cancel($){let Z=$-this.startId;if(Z<0||Z>=this.callbacks.length)return;this.callbacks[Z]=null,this.callbacksCount-=1}}var uX=new ZA;class J1{static create(){return new J1}static request($){return uX.request($)}static cancel($){return uX.cancel($)}currentId=mX;request($){this.cancel(),this.currentId=uX.request(()=>{this.currentId=mX,$()})}cancel=()=>{if(this.currentId!==mX)uX.cancel(this.currentId),this.currentId=mX};disposeEffect=()=>{return this.cancel}}function n8(){let $=P5(J1.create).current;return _8($.disposeEffect),$}var gZ=0;class h1{static create(){return new h1}currentId=gZ;start($,Z){this.clear(),this.currentId=setTimeout(()=>{this.currentId=gZ,Z()},$)}isStarted(){return this.currentId!==gZ}clear=()=>{if(this.currentId!==gZ)clearTimeout(this.currentId),this.currentId=gZ};disposeEffect=()=>{return this.clear}}function q1(){let $=P5(h1.create).current;return _8($.disposeEffect),$}var JA=0;function pX($){return JA+=1,`${$}-${Math.random().toString(36).slice(2,6)}-${JA}`}function g0($){return $?.ownerDocument||document}function cX($,Z){if(typeof $==="string")return{description:$};if(typeof $==="function"){let J=$(Z);return typeof J==="string"?{description:J}:J}return $}var k9=typeof navigator<"u",NB=du(),QA=iu(),dX=lu(),lX=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),iX=NB.platform==="MacIntel"&&NB.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(NB.platform),MQ0=k9&&/firefox/i.test(dX),rX=k9&&/apple/i.test(navigator.vendor),AQ0=k9&&/Edg/i.test(dX),aX=k9&&/android/i.test(QA)||/android/i.test(dX),XA=k9&&QA.toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints,nX=dX.includes("jsdom/");function du(){if(!k9)return{platform:"",maxTouchPoints:-1};let $=navigator.userAgentData;if($?.platform)return{platform:$.platform,maxTouchPoints:navigator.maxTouchPoints};return{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function lu(){if(!k9)return"";let $=navigator.userAgentData;if($&&Array.isArray($.brands))return $.brands.map(({brand:Z,version:J})=>`${Z}/${J}`).join(" ");return navigator.userAgent}function iu(){if(!k9)return"";let $=navigator.userAgentData;if($?.platform)return $.platform;return navigator.platform??""}var vZ="data-base-ui-focusable",VB="active",LB="selected",O7="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",O2="ArrowLeft",P2="ArrowRight",fZ="ArrowUp",o6="ArrowDown";function p5($){let Z=$.activeElement;while(Z?.shadowRoot?.activeElement!=null)Z=Z.shadowRoot.activeElement;return Z}function x0($,Z){if(!$||!Z)return!1;let J=Z.getRootNode?.();if($.contains(Z))return!0;if(J&&HA(J)){let Q=Z;while(Q){if($===Q)return!0;Q=Q.parentNode||Q.host}}return!1}function t6($,Z){if(!V5($))return!1;let J=$;if(Z.hasElement(J))return!J.hasAttribute("data-trigger-disabled");for(let[,Q]of Z.entries())if(x0(Q,J))return!Q.hasAttribute("data-trigger-disabled");return!1}function T5($){if("composedPath"in $)return $.composedPath()[0];return $.target}function R4($,Z){if(Z==null)return!1;if("composedPath"in $)return $.composedPath().includes(Z);let J=$;return J.target!=null&&Z.contains(J.target)}function GA($){return $.matches("html,body")}function e6($){return U1($)&&$.matches(O7)}function mZ($){if(!$)return!1;return $.getAttribute("role")==="combobox"&&e6($)}function S9($){if(!$||nX)return!0;try{return $.matches(":focus-visible")}catch(Z){return!0}}function $3($){if(!$)return null;return $.hasAttribute(vZ)?$:$.querySelector(`[${vZ}]`)||$}function w2($,Z,J=!0){return $.filter((X)=>X.parentId===Z&&(!J||X.context?.open)).flatMap((X)=>[X,...w2($,X.id,J)])}function MB($,Z){let J=[],Q=$.find((X)=>X.id===Z)?.parentId;while(Q){let X=$.find((H)=>H.id===Q);if(Q=X?.parentId,X)J=J.concat(X)}return J}function g1($){$.preventDefault(),$.stopPropagation()}function zA($){return"nativeEvent"in $}function sX($){if($.pointerType===""&&$.isTrusted)return!0;if(aX&&$.pointerType)return $.type==="click"&&$.buttons===1;return $.detail===0&&!$.pointerType}function oX($){if(nX)return!1;return!aX&&$.width===0&&$.height===0||aX&&$.width===1&&$.height===1&&$.pressure===0&&$.detail===0&&$.pointerType==="mouse"||$.width<1&&$.height<1&&$.pressure===0&&$.detail===0&&$.pointerType==="touch"}function k4($,Z){let J=["mouse","pen"];if(!Z)J.push("",void 0);return J.includes($)}function tX($){let Z=$.type;return Z==="click"||Z==="mousedown"||Z==="keydown"||Z==="keyup"}function eX($,Z,J){return Math.floor($/Z)!==J}function P7($,Z){return Z<0||Z>=$.current.length}function $H($,Z){return U8($,{disabledIndices:Z})}function DB($,Z){return U8($,{decrement:!0,startingIndex:$.current.length,disabledIndices:Z})}function U8($,{startingIndex:Z=-1,decrement:J=!1,disabledIndices:Q,amount:X=1}={}){let H=Z;do H+=J?-X:X;while(H>=0&&H<=$.current.length-1&&w7($,H,Q));return H}function YA($,{event:Z,orientation:J,loopFocus:Q,rtl:X,cols:H,disabledIndices:G,minIndex:z,maxIndex:Y,prevIndex:K,stopEvent:W=!1}){let B=K,q=[],U={},F=!1;{let V=null,M=-1;$.current.forEach((A,O)=>{if(A==null)return;let _=A.closest('[role="row"]');if(_)F=!0;if(_!==V||M===-1)V=_,M+=1,q[M]=[];q[M].push(O),U[O]=M})}let N=F&&q.length>0&&q.some((V)=>V.length!==H);function L(V){if(!N||K===-1)return;let M=U[K];if(M==null)return;let A=q[M].indexOf(K),O=V==="up"?M-1:M+1;if(Q){if(O<0)O=q.length-1;else if(O>=q.length)O=0}let _=new Set;while(O>=0&&O<q.length&&!_.has(O)){_.add(O);let D=q[O];if(D.length===0){O=V==="up"?O-1:O+1;continue}let T=Math.min(A,D.length-1);for(let k=T;k>=0;k-=1){let x=D[k];if(!w7($,x,G))return x}if(O=V==="up"?O-1:O+1,Q){if(O<0)O=q.length-1;else if(O>=q.length)O=0}}return}if(Z.key===fZ){let V=L("up");if(V!==void 0){if(W)g1(Z);B=V}else{if(W)g1(Z);if(K===-1)B=Y;else if(B=U8($,{startingIndex:B,amount:H,decrement:!0,disabledIndices:G}),Q&&(K-H<z||B<0)){let M=K%H,A=Y%H,O=Y-(A-M);if(A===M)B=Y;else B=A>M?O:O-H}if(P7($,B))B=K}}if(Z.key===o6){let V=L("down");if(V!==void 0){if(W)g1(Z);B=V}else{if(W)g1(Z);if(K===-1)B=z;else if(B=U8($,{startingIndex:K,amount:H,disabledIndices:G}),Q&&K+H>Y)B=U8($,{startingIndex:K%H-H,amount:H,disabledIndices:G});if(P7($,B))B=K}}if(J==="both"){let V=AB(K/H);if(Z.key===(X?O2:P2)){if(W)g1(Z);if(K%H!==H-1){if(B=U8($,{startingIndex:K,disabledIndices:G}),Q&&eX(B,H,V))B=U8($,{startingIndex:K-K%H-1,disabledIndices:G})}else if(Q)B=U8($,{startingIndex:K-K%H-1,disabledIndices:G});if(eX(B,H,V))B=K}if(Z.key===(X?P2:O2)){if(W)g1(Z);if(K%H!==0){if(B=U8($,{startingIndex:K,decrement:!0,disabledIndices:G}),Q&&eX(B,H,V))B=U8($,{startingIndex:K+(H-K%H),decrement:!0,disabledIndices:G})}else if(Q)B=U8($,{startingIndex:K+(H-K%H),decrement:!0,disabledIndices:G});if(eX(B,H,V))B=K}let M=AB(Y/H)===V;if(P7($,B))if(Q&&M)B=Z.key===(X?P2:O2)?Y:U8($,{startingIndex:K-K%H-1,disabledIndices:G});else B=K}return B}function KA($,Z,J){let Q=[],X=0;return $.forEach(({width:H,height:G},z)=>{if(H>Z);let Y=!1;if(J)X=0;while(!Y){let K=[];for(let W=0;W<H;W+=1)for(let B=0;B<G;B+=1)K.push(X+W+B*Z);if(X%Z+H<=Z&&K.every((W)=>Q[W]==null))K.forEach((W)=>{Q[W]=z}),Y=!0;else X+=1}}),[...Q]}function WA($,Z,J,Q,X){if($===-1)return-1;let H=J.indexOf($),G=Z[$];switch(X){case"tl":return H;case"tr":if(!G)return H;return H+G.width-1;case"bl":if(!G)return H;return H+(G.height-1)*Q;case"br":return J.lastIndexOf($);default:return-1}}function BA($,Z){return Z.flatMap((J,Q)=>$.includes(J)?[Q]:[])}function w7($,Z,J){if(typeof J==="function")return J(Z);if(J)return J.includes(Z);let Q=$.current[Z];if(!Q)return!1;return Q.hasAttribute("disabled")||Q.getAttribute("aria-disabled")==="true"}/*!
|
|
7
|
-
* tabbable 6.4.0
|
|
8
|
-
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
9
|
-
*/var ru=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],ZH=ru.join(","),UA=typeof Element>"u",j7=UA?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,JH=!UA&&Element.prototype.getRootNode?function($){var Z;return $===null||$===void 0?void 0:(Z=$.getRootNode)===null||Z===void 0?void 0:Z.call($)}:function($){return $===null||$===void 0?void 0:$.ownerDocument},QH=function(Z,J){var Q;if(J===void 0)J=!0;var X=Z===null||Z===void 0?void 0:(Q=Z.getAttribute)===null||Q===void 0?void 0:Q.call(Z,"inert"),H=X===""||X==="true",G=H||J&&Z&&(typeof Z.closest==="function"?Z.closest("[inert]"):QH(Z.parentNode));return G},au=function(Z){var J,Q=Z===null||Z===void 0?void 0:(J=Z.getAttribute)===null||J===void 0?void 0:J.call(Z,"contenteditable");return Q===""||Q==="true"},FA=function(Z,J,Q){if(QH(Z))return[];var X=Array.prototype.slice.apply(Z.querySelectorAll(ZH));if(J&&j7.call(Z,ZH))X.unshift(Z);return X=X.filter(Q),X},XH=function(Z,J,Q){var X=[],H=Array.from(Z);while(H.length){var G=H.shift();if(QH(G,!1))continue;if(G.tagName==="SLOT"){var z=G.assignedElements(),Y=z.length?z:G.children,K=XH(Y,!0,Q);if(Q.flatten)X.push.apply(X,K);else X.push({scopeParent:G,candidates:K})}else{var W=j7.call(G,ZH);if(W&&Q.filter(G)&&(J||!Z.includes(G)))X.push(G);var B=G.shadowRoot||typeof Q.getShadowRoot==="function"&&Q.getShadowRoot(G),q=!QH(B,!1)&&(!Q.shadowRootFilter||Q.shadowRootFilter(G));if(B&&q){var U=XH(B===!0?G.children:B.children,!0,Q);if(Q.flatten)X.push.apply(X,U);else X.push({scopeParent:G,candidates:U})}else H.unshift.apply(H,G.children)}}return X},NA=function(Z){return!isNaN(parseInt(Z.getAttribute("tabindex"),10))},VA=function(Z){if(!Z)throw Error("No node provided");if(Z.tabIndex<0){if((/^(AUDIO|VIDEO|DETAILS)$/.test(Z.tagName)||au(Z))&&!NA(Z))return 0}return Z.tabIndex},nu=function(Z,J){var Q=VA(Z);if(Q<0&&J&&!NA(Z))return 0;return Q},su=function(Z,J){return Z.tabIndex===J.tabIndex?Z.documentOrder-J.documentOrder:Z.tabIndex-J.tabIndex},LA=function(Z){return Z.tagName==="INPUT"},ou=function(Z){return LA(Z)&&Z.type==="hidden"},tu=function(Z){var J=Z.tagName==="DETAILS"&&Array.prototype.slice.apply(Z.children).some(function(Q){return Q.tagName==="SUMMARY"});return J},eu=function(Z,J){for(var Q=0;Q<Z.length;Q++)if(Z[Q].checked&&Z[Q].form===J)return Z[Q]},$p=function(Z){if(!Z.name)return!0;var J=Z.form||JH(Z),Q=function(z){return J.querySelectorAll('input[type="radio"][name="'+z+'"]')},X;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape==="function")X=Q(window.CSS.escape(Z.name));else try{X=Q(Z.name)}catch(G){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",G.message),!1}var H=eu(X,Z.form);return!H||H===Z},Zp=function(Z){return LA(Z)&&Z.type==="radio"},Jp=function(Z){return Zp(Z)&&!$p(Z)},Qp=function(Z){var J,Q=Z&&JH(Z),X=(J=Q)===null||J===void 0?void 0:J.host,H=!1;if(Q&&Q!==Z){var G,z,Y;H=!!((G=X)!==null&&G!==void 0&&(z=G.ownerDocument)!==null&&z!==void 0&&z.contains(X)||Z!==null&&Z!==void 0&&(Y=Z.ownerDocument)!==null&&Y!==void 0&&Y.contains(Z));while(!H&&X){var K,W,B;Q=JH(X),X=(K=Q)===null||K===void 0?void 0:K.host,H=!!((W=X)!==null&&W!==void 0&&(B=W.ownerDocument)!==null&&B!==void 0&&B.contains(X))}}return H},qA=function(Z){var J=Z.getBoundingClientRect(),Q=J.width,X=J.height;return Q===0&&X===0},Xp=function(Z,J){var{displayCheck:Q,getShadowRoot:X}=J;if(Q==="full-native"){if("checkVisibility"in Z){var H=Z.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!H}}if(getComputedStyle(Z).visibility==="hidden")return!0;var G=j7.call(Z,"details>summary:first-of-type"),z=G?Z.parentElement:Z;if(j7.call(z,"details:not([open]) *"))return!0;if(!Q||Q==="full"||Q==="full-native"||Q==="legacy-full"){if(typeof X==="function"){var Y=Z;while(Z){var K=Z.parentElement,W=JH(Z);if(K&&!K.shadowRoot&&X(K)===!0)return qA(Z);else if(Z.assignedSlot)Z=Z.assignedSlot;else if(!K&&W!==Z.ownerDocument)Z=W.host;else Z=K}Z=Y}if(Qp(Z))return!Z.getClientRects().length;if(Q!=="legacy-full")return!0}else if(Q==="non-zero-area")return qA(Z);return!1},Hp=function(Z){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(Z.tagName)){var J=Z.parentElement;while(J){if(J.tagName==="FIELDSET"&&J.disabled){for(var Q=0;Q<J.children.length;Q++){var X=J.children.item(Q);if(X.tagName==="LEGEND")return j7.call(J,"fieldset[disabled] *")?!0:!X.contains(Z)}return!0}J=J.parentElement}}return!1},_B=function(Z,J){if(J.disabled||ou(J)||Xp(J,Z)||tu(J)||Hp(J))return!1;return!0},OB=function(Z,J){if(Jp(J)||VA(J)<0||!_B(Z,J))return!1;return!0},Gp=function(Z){var J=parseInt(Z.getAttribute("tabindex"),10);if(isNaN(J)||J>=0)return!0;return!1},MA=function(Z){var J=[],Q=[];return Z.forEach(function(X,H){var G=!!X.scopeParent,z=G?X.scopeParent:X,Y=nu(z,G),K=G?MA(X.candidates):z;if(Y===0)G?J.push.apply(J,K):J.push(z);else Q.push({documentOrder:H,tabIndex:Y,item:X,isScope:G,content:K})}),Q.sort(su).reduce(function(X,H){return H.isScope?X.push.apply(X,H.content):X.push(H.content),X},[]).concat(J)},Z3=function(Z,J){J=J||{};var Q;if(J.getShadowRoot)Q=XH([Z],J.includeContainer,{filter:OB.bind(null,J),flatten:!1,getShadowRoot:J.getShadowRoot,shadowRootFilter:Gp});else Q=FA(Z,J.includeContainer,OB.bind(null,J));return MA(Q)},AA=function(Z,J){J=J||{};var Q;if(J.getShadowRoot)Q=XH([Z],J.includeContainer,{filter:_B.bind(null,J),flatten:!0,getShadowRoot:J.getShadowRoot});else Q=FA(Z,J.includeContainer,_B.bind(null,J));return Q},PB=function(Z,J){if(J=J||{},!Z)throw Error("No node provided");if(j7.call(Z,ZH)===!1)return!1;return OB(J,Z)};var J3=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver==="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function DA($,Z){let J=Z3($,J3()),Q=J.length;if(Q===0)return;let X=p5(g0($)),H=J.indexOf(X),G=H===-1?Z===1?0:Q-1:H+Z;return J[G]}function b9($){return DA(g0($).body,1)||$}function HH($){return DA(g0($).body,-1)||$}function _A($,Z){if(!$)return null;let J=Z3(g0($).body,J3()),Q=J.length;if(Q===0)return null;let X=J.indexOf($);if(X===-1)return null;let H=(X+Z+Q)%Q;return J[H]}function GH($){return _A($,1)}function zH($){return _A($,-1)}function e4($,Z){let J=Z||$.currentTarget,Q=$.relatedTarget;return!Q||!x0(J,Q)}function OA($){Z3($,J3()).forEach((J)=>{J.dataset.tabindex=J.getAttribute("tabindex")||"",J.setAttribute("tabindex","-1")})}function wB($){$.querySelectorAll("[data-tabindex]").forEach((J)=>{let Q=J.dataset.tabindex;if(delete J.dataset.tabindex,Q)J.setAttribute("tabindex",Q);else J.removeAttribute("tabindex")})}var YH=sM(($)=>$.toasts,($)=>{let Z=new Map,J=0,Q=0;return $.forEach((X,H)=>{let G=X.transitionStatus==="ending";if(Z.set(X.id,{value:X,domIndex:H,visibleIndex:G?-1:J,offsetY:Q}),Q+=X.height||0,!G)J+=1}),Z}),X9={toasts:C0(($)=>$.toasts),isEmpty:C0(($)=>$.toasts.length===0),toast:C0(YH,($,Z)=>$.get(Z)?.value),toastIndex:C0(YH,($,Z)=>$.get(Z)?.domIndex??-1),toastOffsetY:C0(YH,($,Z)=>$.get(Z)?.offsetY??0),toastVisibleIndex:C0(YH,($,Z)=>$.get(Z)?.visibleIndex??-1),hovering:C0(($)=>$.hovering),focused:C0(($)=>$.focused),expanded:C0(($)=>$.hovering||$.focused),expandedOrOutOfFocus:C0(($)=>$.hovering||$.focused||!$.isWindowFocused),prevFocusElement:C0(($)=>$.prevFocusElement)};class jB extends K4{timers=new Map;areTimersPaused=!1;constructor($){super($,{},X9)}setFocused($){this.set("focused",$)}setHovering($){this.set("hovering",$)}setIsWindowFocused($){this.set("isWindowFocused",$)}setPrevFocusElement($){this.set("prevFocusElement",$)}setViewport=($)=>{this.set("viewport",$)};disposeEffect=()=>{return()=>{this.timers.forEach(($)=>{$.timeout?.clear()}),this.timers.clear()}};removeToast($){let Z=X9.toastIndex(this.state,$);if(Z===-1)return;this.state.toasts[Z]?.onRemove?.();let Q=[...this.state.toasts];Q.splice(Z,1),this.setToasts(Q)}addToast=($)=>{let{toasts:Z,timeout:J,limit:Q}=this.state,X=$.id||pX("toast"),H={...$,id:X,transitionStatus:"starting"},G=[H,...Z],z=G.filter((K)=>K.transitionStatus!=="ending");if(z.length>Q){let K=z.length-Q,W=z.slice(-K),B=new Set(W.map((q)=>q.id));this.setToasts(G.map((q)=>{let U=B.has(q.id);if(q.limited!==U)return{...q,limited:U};return q}))}else this.setToasts(G.map((K)=>K.limited?{...K,limited:!1}:K));let Y=H.timeout??J;if(H.type!=="loading"&&Y>0)this.scheduleTimer(X,Y,()=>this.closeToast(X));if(X9.expandedOrOutOfFocus(this.state))this.pauseTimers();return X};updateToast=($,Z)=>{this.updateToastInternal($,Z)};updateToastInternal=($,Z)=>{let{timeout:J,toasts:Q}=this.state,X=X9.toast(this.state,$)??null;if(!X)return;if(X.transitionStatus==="ending")return;let H={...X,...Z};this.setToasts(Q.map((U)=>U.id===$?{...U,...Z}:U));let G=H.timeout??J,z=X?.timeout??J,Y=Object.hasOwn(Z,"timeout"),K=H.transitionStatus!=="ending"&&H.type!=="loading"&&G>0,W=this.timers.has($),B=z!==G,q=X?.type==="loading";if(!K&&W){this.timers.get($)?.timeout?.clear(),this.timers.delete($);return}if(K&&(!W||B||Y||q)){let U=this.timers.get($);if(U)U.timeout?.clear(),this.timers.delete($);if(this.scheduleTimer($,G,()=>this.closeToast($)),X9.expandedOrOutOfFocus(this.state))this.pauseTimers()}};closeToast=($)=>{X9.toast(this.state,$)?.onClose?.();let{limit:J,toasts:Q}=this.state,X=0,H=Q.map((z)=>{if(z.id===$)return{...z,transitionStatus:"ending",height:0};if(z.transitionStatus==="ending")return z;let Y=X>=J;return X+=1,z.limited!==Y?{...z,limited:Y}:z}),G=this.timers.get($);if(G&&G.timeout)G.timeout.clear(),this.timers.delete($);this.handleFocusManagement($),this.setToasts(H)};promiseToast=($,Z)=>{let J=cX(Z.loading),Q=this.addToast({...J,type:"loading"}),X=$.then((H)=>{let G=cX(Z.success,H);return this.updateToast(Q,{...G,type:"success",timeout:G.timeout}),H}).catch((H)=>{let G=cX(Z.error,H);return this.updateToast(Q,{...G,type:"error",timeout:G.timeout}),Promise.reject(H)});if({}.hasOwnProperty.call(Z,"setPromise"))Z.setPromise(X);return X};pauseTimers(){if(this.areTimersPaused)return;this.areTimersPaused=!0,this.timers.forEach(($)=>{if($.timeout){$.timeout.clear();let Z=Date.now()-$.start,J=$.delay-Z;$.remaining=J>0?J:0}})}resumeTimers(){if(!this.areTimersPaused)return;this.areTimersPaused=!1,this.timers.forEach(($,Z)=>{$.remaining=$.remaining>0?$.remaining:$.delay,$.timeout??=h1.create(),$.timeout.start($.remaining,()=>{this.timers.delete(Z),$.callback()}),$.start=Date.now()})}restoreFocusToPrevElement(){this.state.prevFocusElement?.focus({preventScroll:!0})}handleDocumentPointerDown=($)=>{if($.pointerType!=="touch")return;let Z=T5($);if(x0(this.state.viewport,Z))return;this.resumeTimers(),this.update({hovering:!1,focused:!1})};scheduleTimer($,Z,J){let Q=Date.now(),X=!X9.expandedOrOutOfFocus(this.state),H=X?h1.create():void 0;H?.start(Z,()=>{this.timers.delete($),J()}),this.timers.set($,{timeout:H,start:X?Q:0,delay:Z,remaining:Z,callback:J})}setToasts($){let Z={toasts:$};if($.length===0)Z.hovering=!1,Z.focused=!1;this.update(Z)}handleFocusManagement($){let Z=p5(g0(this.state.viewport));if(!this.state.viewport||!x0(this.state.viewport,Z)||!S9(Z))return;let J=X9.toasts(this.state),Q=X9.toastIndex(this.state,$),X=null,H=Q+1;while(H<J.length){if(J[H].transitionStatus!=="ending"){X=J[H];break}H+=1}if(!X){H=Q-1;while(H>=0){if(J[H].transitionStatus!=="ending"){X=J[H];break}H-=1}}if(X)X.ref?.current?.focus();else this.restoreFocusToPrevElement()}}var wA=P(l(),1),jA=function(Z){let{children:J,timeout:Q=5000,limit:X=3,toastManager:H}=Z,G=P5(()=>new jB({timeout:Q,limit:X,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return _8(G.disposeEffect),PA.useEffect(function(){if(!H)return;return H[" subscribe"](({action:K,options:W})=>{let B=W.id;if(K==="promise"&&W.promise)G.promiseToast(W.promise,W);else if(K==="update"&&B)G.updateToast(B,W);else if(K==="close"&&B)G.closeToast(B);else G.addToast(W)})},[G,Q,H]),G.useSyncedValues({timeout:Q,limit:X}),wA.jsx(yZ.Provider,{value:G,children:J})};var w8=P(v(),1);var CA={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},$2={...CA,position:"fixed",top:0,left:0},TA={...CA,position:"absolute"};var KH=P(v(),1);var EA=P(l(),1),P8=KH.forwardRef(function(Z,J){let[Q,X]=KH.useState();return W0(()=>{if(rX)X("button")},[]),EA.jsx("span",{...Z,ref:J,style:$2,"aria-hidden":Q?void 0:!0,...{tabIndex:0,role:Q},"data-base-ui-focus-guard":""})});var IA=function($){return $.frontmostHeight="--toast-frontmost-height",$}({});var Z2=P(l(),1),RA=w8.forwardRef(function(Z,J){let{render:Q,className:X,children:H,...G}=Z,z=I9(),Y=q1(),K=w8.useRef(!1),W=w8.useRef(!1),B=z.useState("isEmpty"),q=z.useState("toasts"),U=z.useState("focused"),F=z.useState("expanded"),N=z.useState("prevFocusElement"),L=q[0]?.height??0,V=w8.useMemo(()=>q.some((C)=>C.transitionStatus==="ending"),[q]);w8.useEffect(()=>{let C=z.state.viewport;if(!C)return;function j(S){if(B)return;if(S.key==="F6"&&S.target!==C)S.preventDefault(),z.setPrevFocusElement(p5(g0(C))),C?.focus({preventScroll:!0}),z.pauseTimers(),z.setFocused(!0)}let R=O8(C);return R.addEventListener("keydown",j),()=>{R.removeEventListener("keydown",j)}},[z,B]),w8.useEffect(()=>{let C=z.state.viewport;if(!C||B)return;let j=O8(C);function R(E){if(E.target!==j)return;z.setIsWindowFocused(!1),z.pauseTimers()}function S(E){if(E.relatedTarget||E.target===j)return;let b=T5(E),g=p5(g0(C));if(!x0(C,b)||!S9(g))z.resumeTimers();Y.start(0,()=>z.setIsWindowFocused(!0))}return j.addEventListener("blur",R,!0),j.addEventListener("focus",S,!0),()=>{j.removeEventListener("blur",R,!0),j.removeEventListener("focus",S,!0)}},[z,Y,B]),w8.useEffect(()=>{let C=z.state.viewport;if(!C||B)return;let j=g0(C);return j.addEventListener("pointerdown",z.handleDocumentPointerDown,!0),()=>{j.removeEventListener("pointerdown",z.handleDocumentPointerDown,!0)}},[B,z]);function M(C){let j=z.state.viewport;if(!j)return;if(K.current=!0,C.relatedTarget===j)q[0]?.ref?.current?.focus();else z.restoreFocusToPrevElement()}function A(C){if(C.key==="Tab"&&C.shiftKey&&C.target===z.state.viewport)C.preventDefault(),z.restoreFocusToPrevElement(),z.resumeTimers()}w8.useEffect(()=>{if(!z.state.isWindowFocused||V||!W.current)return;z.resumeTimers(),z.setHovering(!1),W.current=!1},[V,z]);function O(){z.pauseTimers(),z.setHovering(!0),W.current=!1}function _(){if(V)W.current=!0;else z.resumeTimers(),z.setHovering(!1)}function D(){if(K.current){K.current=!1;return}if(U)return;if(S9(g0(z.state.viewport).activeElement))z.setFocused(!0),z.pauseTimers()}function T(C){if(!U||x0(z.state.viewport,C.relatedTarget))return;z.setFocused(!1),z.resumeTimers()}let k={tabIndex:-1,role:"region","aria-live":"polite","aria-atomic":!1,"aria-relevant":"additions text","aria-label":"Notifications",onMouseEnter:O,onMouseMove:O,onMouseLeave:_,onFocus:D,onBlur:T,onKeyDown:A,onClick:D},x={expanded:F},I=U0("div",Z,{ref:[J,z.setViewport],state:x,props:[k,{style:{[IA.frontmostHeight]:L?`${L}px`:void 0}},G,{children:Z2.jsxs(w8.Fragment,{children:[!B&&N&&Z2.jsx(P8,{onFocus:M}),H,!B&&N&&Z2.jsx(P8,{onFocus:M})]})}]}),y=w8.useMemo(()=>q.filter((C)=>C.priority==="high"),[q]);return Z2.jsxs(w8.Fragment,{children:[!B&&N&&Z2.jsx(P8,{onFocus:M}),I,!U&&y.length>0&&Z2.jsx("div",{style:$2,children:y.map((C)=>Z2.jsxs("div",{role:"alert","aria-atomic":!0,children:[Z2.jsx("div",{children:C.title}),Z2.jsx("div",{children:C.description})]},C.id))})]})});var Q1=P(v(),1),yA=P(W4(),1);function j2($){if(vX(19))return $;return $?"true":void 0}var WH=P(v(),1),CB=WH.createContext(void 0);function C2(){let $=WH.useContext(CB);if(!$)throw Error(I0(66));return $}var T2=function($){return $.startingStyle="data-starting-style",$.endingStyle="data-ending-style",$}({}),zp={[T2.startingStyle]:""},Yp={[T2.endingStyle]:""},s5={transitionStatus($){if($==="starting")return zp;if($==="ending")return Yp;return null}};var SA=P(v(),1);var kA=P(W4(),1);function J2($){if($==null)return $;return"current"in $?$.current:$}function E2($,Z=!1,J=!0){let Q=n8();return K0((X,H=null)=>{Q.cancel();function G(){kA.flushSync(X)}let z=J2($);if(z==null)return;let Y=z;if(typeof Y.getAnimations!=="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)X();else{let K=function(){let B=T2.startingStyle;if(!Y.hasAttribute(B)){Q.request(W);return}let q=new MutationObserver(()=>{if(!Y.hasAttribute(B))q.disconnect(),W()});q.observe(Y,{attributes:!0,attributeFilter:[B]}),H?.addEventListener("abort",()=>q.disconnect(),{once:!0})},W=function(){Promise.all(Y.getAnimations().map((B)=>B.finished)).then(()=>{if(H?.aborted)return;G()}).catch(()=>{let B=Y.getAnimations();if(J){if(H?.aborted)return;G()}else if(B.length>0&&B.some((q)=>q.pending||q.playState!=="finished"))W()})};if(Z){K();return}Q.request(W)}})}function v1($){let{enabled:Z=!0,open:J,ref:Q,onComplete:X}=$,H=K0(X),G=E2(Q,J,!1);SA.useEffect(()=>{if(!Z)return;let z=new AbortController;return G(H,z.signal),()=>{z.abort()}},[Z,J,H,G])}var I2=function($){return $.index="--toast-index",$.offsetY="--toast-offset-y",$.height="--toast-height",$.swipeMovementX="--toast-swipe-movement-x",$.swipeMovementY="--toast-swipe-movement-y",$}({});var xA=P(l(),1),Kp={...s5,swipeDirection($){return $?{"data-swipe-direction":$}:null}},uZ=40,Wp=10,y9=0.5,Bp=1;function bA($,Z,J){switch($){case"up":return-J;case"down":return J;case"left":return-Z;case"right":return Z;default:return 0}}function qp($){let J=window.getComputedStyle($).transform,Q=0,X=0,H=1;if(J&&J!=="none"){let G=J.match(/matrix(?:3d)?\(([^)]+)\)/);if(G){let z=G[1].split(", ").map(parseFloat);if(z.length===6)Q=z[4],X=z[5],H=Math.sqrt(z[0]*z[0]+z[1]*z[1]);else if(z.length===16)Q=z[12],X=z[13],H=z[0]}}return{x:Q,y:X,scale:H}}var hA=Q1.forwardRef(function(Z,J){let{toast:Q,render:X,className:H,swipeDirection:G=["down","right"],...z}=Z,Y=Q.positionerProps?.anchor!==void 0,K=[];if(!Y)K=Array.isArray(G)?G:[G];let W=K.length>0,B=I9(),[q,U]=Q1.useState(void 0),[F,N]=Q1.useState(!1),[L,V]=Q1.useState(!1),[M,A]=Q1.useState(!1),[O,_]=Q1.useState({x:0,y:0}),[D,T]=Q1.useState({x:0,y:0,scale:1}),[k,x]=Q1.useState(),[I,y]=Q1.useState(),[C,j]=Q1.useState(null),R=Q1.useRef(null),S=Q1.useRef({x:0,y:0}),E=Q1.useRef({x:0,y:0,scale:1}),b=Q1.useRef(void 0),g=Q1.useRef(0),u=Q1.useRef(!1),w=Q1.useRef({x:0,y:0}),s=Q1.useRef(!1),z0=B.useState("toastIndex",Q.id),h=B.useState("toastVisibleIndex",Q.id),t=B.useState("toastOffsetY",Q.id),M0=B.useState("focused"),d=B.useState("expanded");v1({open:Q.transitionStatus!=="ending",ref:R,onComplete(){if(Q.transitionStatus==="ending")B.removeToast(Q.id)}});let Y0=K0((p=!1)=>{let o=R.current;if(!o)return;let n=o.style.height;o.style.height="auto";let V0=o.offsetHeight;o.style.height=n;function w0(){B.updateToastInternal(Q.id,{ref:R,height:V0,...Q.transitionStatus==="starting"?{transitionStatus:void 0}:{}})}if(p)yA.flushSync(w0);else w0()});W0(Y0,[Y0]);function B0(p,o){let n=p,V0=o;if(!K.includes("left")&&!K.includes("right"))n=p>0?p**y9:-(Math.abs(p)**y9);else{if(!K.includes("right")&&p>0)n=p**y9;if(!K.includes("left")&&p<0)n=-(Math.abs(p)**y9)}if(!K.includes("up")&&!K.includes("down"))V0=o>0?o**y9:-(Math.abs(o)**y9);else{if(!K.includes("down")&&o>0)V0=o**y9;if(!K.includes("up")&&o<0)V0=-(Math.abs(o)**y9)}return{x:n,y:V0}}function J0(p){if(p.button!==0)return;if(p.pointerType==="touch")B.pauseTimers();let o=T5(p.nativeEvent);if(o?o.closest('button,a,input,textarea,[role="button"],[data-swipe-ignore]'):!1)return;if(u.current=!1,b.current=void 0,g.current=0,S.current={x:p.clientX,y:p.clientY},w.current=S.current,R.current){let V0=qp(R.current);E.current=V0,T(V0),_({x:V0.x,y:V0.y})}B.setHovering(!0),N(!0),V(!1),j(null),s.current=!0,R.current?.setPointerCapture(p.pointerId)}function H0(p){if(!F)return;if(p.preventDefault(),s.current)S.current={x:p.clientX,y:p.clientY},s.current=!1;let{clientY:o,clientX:n,movementX:V0,movementY:w0}=p;if(w0<0&&o>w.current.y||w0>0&&o<w.current.y)w.current={x:w.current.x,y:o};if(V0<0&&n>w.current.x||V0>0&&n<w.current.x)w.current={x:n,y:w.current.y};let v0=n-S.current.x,c0=o-S.current.y,m=o-w.current.y,i=n-w.current.x;if(!L){if(Math.sqrt(v0*v0+c0*c0)>=Bp){if(V(!0),C===null){let J5=K.includes("left")||K.includes("right"),m0=K.includes("up")||K.includes("down");if(J5&&m0){let P0=Math.abs(v0),f0=Math.abs(c0);j(P0>f0?"horizontal":"vertical")}}}}let f;if(!b.current){if(C==="vertical"){if(c0>0)f="down";else if(c0<0)f="up"}else if(C==="horizontal"){if(v0>0)f="right";else if(v0<0)f="left"}else if(Math.abs(v0)>=Math.abs(c0))f=v0>0?"right":"left";else f=c0>0?"down":"up";if(f&&K.includes(f))b.current=f,g.current=bA(f,v0,c0),U(f)}else{let r0=b.current,J5=bA(r0,i,m);if(J5>uZ)u.current=!1,U(r0);else if(!(K.includes("left")&&K.includes("right"))&&!(K.includes("up")&&K.includes("down"))&&g.current-J5>=Wp)u.current=!0}let X0=B0(v0,c0),L0=E.current.x,k0=E.current.y;if(C==="horizontal"){if(K.includes("left")||K.includes("right"))L0+=X0.x}else if(C==="vertical"){if(K.includes("up")||K.includes("down"))k0+=X0.y}else{if(K.includes("left")||K.includes("right"))L0+=X0.x;if(K.includes("up")||K.includes("down"))k0+=X0.y}_({x:L0,y:k0})}function N0(p){if(!F)return;if(N(!1),V(!1),j(null),R.current?.releasePointerCapture(p.pointerId),u.current){_({x:D.x,y:D.y}),U(void 0);return}let o=!1,n=O.x-D.x,V0=O.y-D.y,w0;for(let v0 of K){switch(v0){case"right":if(n>uZ)o=!0,w0="right";break;case"left":if(n<-uZ)o=!0,w0="left";break;case"down":if(V0>uZ)o=!0,w0="down";break;case"up":if(V0<-uZ)o=!0,w0="up";break;default:break}if(o)break}if(o)U(w0),A(!0),B.closeToast(Q.id);else _({x:D.x,y:D.y}),U(void 0)}function c(p){if(p.key==="Escape"){if(!R.current||!x0(R.current,p5(g0(R.current))))return;B.closeToast(Q.id)}}Q1.useEffect(()=>{if(!W)return;let p=R.current;if(!p)return;function o(n){if(x0(p,n.target))n.preventDefault()}return p.addEventListener("touchmove",o,{passive:!1}),()=>{p.removeEventListener("touchmove",o)}},[W]);function Z0(){if(!F&&O.x===D.x&&O.y===D.y&&!M)return{[I2.swipeMovementX]:"0px",[I2.swipeMovementY]:"0px"};let p=O.x-D.x,o=O.y-D.y;return{transition:F?"none":void 0,transform:F?`translateX(${O.x}px) translateY(${O.y}px) scale(${D.scale})`:void 0,[I2.swipeMovementX]:`${p}px`,[I2.swipeMovementY]:`${o}px`}}let $0=Q.priority==="high",G0={role:$0?"alertdialog":"dialog",tabIndex:0,"aria-modal":!1,"aria-labelledby":k,"aria-describedby":I,"aria-hidden":$0&&!M0?!0:void 0,onPointerDown:W?J0:void 0,onPointerMove:W?H0:void 0,onPointerUp:W?N0:void 0,onKeyDown:c,inert:j2(Q.limited),style:{...Z0(),[I2.index]:Q.transitionStatus==="ending"?z0:h,[I2.offsetY]:`${t}px`,[I2.height]:Q.height?`${Q.height}px`:void 0}},r=Q1.useMemo(()=>({rootRef:R,toast:Q,titleId:k,setTitleId:x,descriptionId:I,setDescriptionId:y,swiping:F,swipeDirection:q,recalculateHeight:Y0,index:z0,visibleIndex:h,expanded:d}),[Q,k,I,F,q,Y0,z0,h,d]),Q0={transitionStatus:Q.transitionStatus,expanded:d,limited:Q.limited||!1,type:Q.type,swiping:r.swiping,swipeDirection:r.swipeDirection},a=U0("div",Z,{ref:[J,r.rootRef],state:Q0,stateAttributesMapping:Kp,props:[G0,z]});return xA.jsx(CB.Provider,{value:r,children:a})});var BH=P(v(),1);var gA=BH.forwardRef(function(Z,J){let{render:Q,className:X,...H}=Z,{visibleIndex:G,expanded:z,recalculateHeight:Y}=C2(),K=BH.useRef(null);W0(()=>{let U=K.current;if(!U)return;if(Y(),typeof ResizeObserver!=="function"||typeof MutationObserver!=="function")return;let F=new ResizeObserver(()=>Y(!0)),N=new MutationObserver(()=>Y(!0));return F.observe(U),N.observe(U,{childList:!0,subtree:!0,characterData:!0}),()=>{F.disconnect(),N.disconnect()}},[Y]);let W=G>0;return U0("div",Z,{ref:[J,K],state:{expanded:z,behind:W},props:H})});var uA=P(v(),1);var qH=P(v(),1);var vA=0;function Up($,Z="mui"){let[J,Q]=qH.useState($),X=$||J;return qH.useEffect(()=>{if(J==null)vA+=1,Q(`${Z}-${vA}`)},[J,Z]),X}var fA=mA.useId;function J8($,Z){if(fA!==void 0){let J=fA();return $??(Z?`${Z}-${J}`:J)}return Up($,Z)}var pA=uA.forwardRef(function(Z,J){let{render:Q,className:X,id:H,children:G,...z}=Z,{toast:Y,setDescriptionId:K}=C2(),W=G??Y.description,B=Boolean(W),q=J8(H);W0(()=>{if(!B)return;return K(q),()=>{K(void 0)}},[B,q,K]);let U={type:Y.type},F=U0("p",Z,{ref:J,state:U,props:{...z,id:q,children:W}});if(!B)return null;return F});var cA=P(v(),1);var dA=cA.forwardRef(function(Z,J){let{render:Q,className:X,id:H,children:G,...z}=Z,{toast:Y,setTitleId:K}=C2(),W=G??Y.title,B=Boolean(W),q=J8(H);W0(()=>{if(!B)return;return K(q),()=>{K(void 0)}},[B,q,K]);let U={type:Y.type},F=U0("h2",Z,{ref:J,state:U,props:{...z,id:q,children:W}});if(!B)return null;return F});var UH=P(v(),1);var lA=UH.forwardRef(function(Z,J){let{render:Q,className:X,disabled:H,nativeButton:G=!0,...z}=Z,Y=I9(),{toast:K}=C2(),W=Y.useState("expanded"),[B,q]=UH.useState(!1),{getButtonProps:U,buttonRef:F}=S1({disabled:H,native:G}),N={type:K.type};return U0("button",Z,{ref:[J,F],state:N,props:[{"aria-hidden":!W&&!B,onClick(){Y.closeToast(K.id)},onFocus(){q(!0)},onBlur(){q(!1)}},z,U]})});var iA=P(v(),1);var rA=iA.forwardRef(function(Z,J){let{render:Q,className:X,disabled:H,nativeButton:G=!0,...z}=Z,{toast:Y}=C2(),K=Y.actionProps?.children??z.children,W=Boolean(K),{getButtonProps:B,buttonRef:q}=S1({disabled:H,native:G}),U={type:Y.type},F=U0("button",Z,{ref:[J,q],state:U,props:[z,Y.actionProps,B,{children:K}]});if(!W)return null;return F});var EH=P(v(),1),ND=P(W4(),1);var s8=P(v(),1);var VH=P(v(),1);function V1($){let Z=P5(Fp,$).current;return Z.next=$,W0(Z.effect),Z}function Fp($){let Z={current:$,next:$,effect:()=>{Z.current=Z.next}};return Z}var x9=P(v(),1);function FH(){let $=new Map;return{emit(Z,J){$.get(Z)?.forEach((Q)=>Q(J))},on(Z,J){if(!$.has(Z))$.set(Z,new Set);$.get(Z).add(J)},off(Z,J){$.get(Z)?.delete(J)}}}class Q3{nodesRef={current:[]};events=FH();addNode($){this.nodesRef.current.push($)}removeNode($){let Z=this.nodesRef.current.findIndex((J)=>J===$);if(Z!==-1)this.nodesRef.current.splice(Z,1)}}var TB=P(l(),1),aA=x9.createContext(null),nA=x9.createContext(null),d1=()=>x9.useContext(aA)?.id||null,j8=($)=>{let Z=x9.useContext(nA);return $??Z};function X3($){let Z=J8(),J=j8($),Q=d1();return W0(()=>{if(!Z)return;let X={id:Z,parentId:Q};return J?.addNode(X),()=>{J?.removeNode(X)}},[J,Z,Q]),Z}function pZ($){let{children:Z,id:J}=$,Q=d1();return TB.jsx(aA.Provider,{value:x9.useMemo(()=>({id:J,parentId:Q}),[J,Q]),children:Z})}function cZ($){let{children:Z,externalTree:J}=$,Q=P5(()=>J??new Q3).current;return TB.jsx(nA.Provider,{value:Q,children:Z})}var q0={};S4(q0,{windowResize:()=>rp,wheel:()=>mp,triggerPress:()=>Vp,triggerHover:()=>Lp,triggerFocus:()=>Mp,trackPress:()=>jp,swipe:()=>ip,siblingOpen:()=>cp,scrub:()=>up,pointer:()=>vp,outsidePress:()=>Ap,none:()=>Np,listNavigation:()=>hp,linkPress:()=>Op,keyboard:()=>gp,itemPress:()=>Dp,inputPress:()=>Sp,inputPaste:()=>kp,inputClear:()=>Ip,inputChange:()=>Ep,inputBlur:()=>Rp,incrementPress:()=>Cp,imperativeAction:()=>lp,focusOut:()=>bp,escapeKey:()=>yp,drag:()=>fp,disabled:()=>dp,decrementPress:()=>Tp,closeWatcher:()=>xp,closePress:()=>_p,clearPress:()=>Pp,chipRemovePress:()=>wp,cancelOpen:()=>pp});var Np="none",Vp="trigger-press",Lp="trigger-hover",Mp="trigger-focus",Ap="outside-press",Dp="item-press",_p="close-press",Op="link-press",Pp="clear-press",wp="chip-remove-press",jp="track-press",Cp="increment-press",Tp="decrement-press",Ep="input-change",Ip="input-clear",Rp="input-blur",kp="input-paste",Sp="input-press",bp="focus-out",yp="escape-key",xp="close-watcher",hp="list-navigation",gp="keyboard",vp="pointer",fp="drag",mp="wheel",up="scrub",pp="cancel-open",cp="sibling-open",dp="disabled",lp="imperative-action",ip="swipe",rp="window-resize";function O0($,Z,J,Q){let X=!1,H=!1,G=Q??_5;return{reason:$,event:Z??new Event("base-ui"),cancel(){X=!0},allowPropagation(){H=!0},get isCanceled(){return X},get isPropagationAllowed(){return H},trigger:J,...G}}function NH($,Z,J){let Q=J??_5;return{reason:$,event:Z??new Event("base-ui"),...Q}}function B4($){return`data-base-ui-${$}`}var kH0=B4("safe-polygon"),SH0=`button,[role="button"],select,[tabindex]:not([tabindex="-1"]),${O7}`;function C7($,Z,J){if(J&&!k4(J))return 0;if(typeof $==="number")return $;if(typeof $==="function"){let Q=$();if(typeof Q==="number")return Q;return Q?.[Z]}return $?.[Z]}var sA=P(l(),1),oA=s8.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new h1,currentIdRef:{current:null},currentContextRef:{current:null}});function EB($){let{children:Z,delay:J,timeoutMs:Q=0}=$,X=s8.useRef(J),H=s8.useRef(J),G=s8.useRef(null),z=s8.useRef(null),Y=q1();return sA.jsx(oA.Provider,{value:s8.useMemo(()=>({hasProvider:!0,delayRef:X,initialDelayRef:H,currentIdRef:G,timeoutMs:Q,currentContextRef:z,timeout:Y}),[Q,Y]),children:Z})}function IB($,Z={open:!1}){let J="rootStore"in $?$.rootStore:$,Q=J.useState("floatingId"),{open:X}=Z,H=s8.useContext(oA),{currentIdRef:G,delayRef:z,timeoutMs:Y,initialDelayRef:K,currentContextRef:W,hasProvider:B,timeout:q}=H,[U,F]=s8.useState(!1);return W0(()=>{function N(){F(!1),W.current?.setIsInstantPhase(!1),G.current=null,W.current=null,z.current=K.current}if(!G.current)return;if(!X&&G.current===Q){if(F(!1),Y){let L=Q;return q.start(Y,()=>{if(J.select("open")||G.current&&G.current!==L)return;N()}),()=>{q.clear()}}N()}return},[X,Q,G,z,Y,K,W,q,J]),W0(()=>{if(!X)return;let N=W.current,L=G.current;if(q.clear(),W.current={onOpenChange:J.setOpen,setIsInstantPhase:F},G.current=Q,z.current={open:0,close:C7(K.current,"close")},L!==null&&L!==Q)F(!0),N?.setIsInstantPhase(!0),N?.onOpenChange(!1,O0(q0.none));else F(!1),N?.setIsInstantPhase(!1)},[X,Q,J,G,z,Y,K,W,q]),W0(()=>{return()=>{W.current=null}},[W]),s8.useMemo(()=>({hasProvider:B,delayRef:z,isInstantPhase:U}),[B,z,U])}var l1=P(v(),1);var tA=0;function H3($,Z={}){let{preventScroll:J=!1,cancelPrevious:Q=!0,sync:X=!1}=Z;if(Q)cancelAnimationFrame(tA);let H=()=>$?.focus({preventScroll:J});if(X)H();else tA=requestAnimationFrame(H)}var T7={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function eA($){if($==="inert")return T7.inert;if($==="aria-hidden")return T7["aria-hidden"];return T7.none}var LH=new WeakSet,MH={},RB=0;var $D=($)=>$&&($.host||$D($.parentNode)),ap=($,Z)=>Z.map((J)=>{if($.contains(J))return J;let Q=$D(J);if($.contains(Q))return Q;return null}).filter((J)=>J!=null);function np($,Z,J,Q){let H=Q?"inert":J?"aria-hidden":null,G=ap(Z,$),z=new Set,Y=new Set(G),K=[];if(!MH["data-base-ui-inert"])MH["data-base-ui-inert"]=new WeakMap;let W=MH["data-base-ui-inert"];G.forEach(B),q(Z),z.clear();function B(U){if(!U||z.has(U))return;if(z.add(U),U.parentNode)B(U.parentNode)}function q(U){if(!U||Y.has(U))return;[].forEach.call(U.children,(F)=>{if(AH(F)==="script")return;if(z.has(F))q(F);else{let N=H?F.getAttribute(H):null,L=N!==null&&N!=="false",V=eA(H),M=(V.get(F)||0)+1,A=(W.get(F)||0)+1;if(V.set(F,M),W.set(F,A),K.push(F),M===1&&L)LH.add(F);if(A===1)F.setAttribute("data-base-ui-inert","");if(!L&&H)F.setAttribute(H,H==="inert"?"":"true")}})}return RB+=1,()=>{if(K.forEach((U)=>{let F=eA(H),L=(F.get(U)||0)-1,V=(W.get(U)||0)-1;if(F.set(U,L),W.set(U,V),!L){if(!LH.has(U)&&H)U.removeAttribute(H);LH.delete(U)}if(!V)U.removeAttribute("data-base-ui-inert")}),RB-=1,!RB)T7.inert=new WeakMap,T7["aria-hidden"]=new WeakMap,T7.none=new WeakMap,LH=new WeakSet,MH={}}}function ZD($,Z=!1,J=!1){let Q=g0($[0]).body;return np($.concat(Array.from(Q.querySelectorAll("[aria-live]"))),Q,Z,J)}var L1=P(v(),1),kB=P(W4(),1);var G3=P(l(),1),XD=L1.createContext(null),SB=()=>L1.useContext(XD),sp=B4("portal");function DH($={}){let{ref:Z,container:J,componentProps:Q=_5,elementProps:X}=$,H=J8(),z=SB()?.portalNode,[Y,K]=L1.useState(null),[W,B]=L1.useState(null),q=K0((L)=>{if(L!==null)B(L)}),U=L1.useRef(null);W0(()=>{if(J===null){if(U.current)U.current=null,B(null),K(null);return}if(H==null)return;let L=(J&&(JD(J)?J:J.current))??z??document.body;if(L==null){if(U.current)U.current=null,B(null),K(null);return}if(U.current!==L)U.current=L,B(null),K(L)},[J,z,H]);let F=U0("div",Q,{ref:[Z,q],props:[{id:H,[sp]:""},X]});return{portalNode:W,portalSubtree:Y&&F?kB.createPortal(F,Y):null}}var z3=L1.forwardRef(function(Z,J){let{children:Q,container:X,className:H,render:G,renderGuards:z,...Y}=Z,{portalNode:K,portalSubtree:W}=DH({container:X,ref:J,componentProps:Z,elementProps:Y}),B=L1.useRef(null),q=L1.useRef(null),U=L1.useRef(null),F=L1.useRef(null),[N,L]=L1.useState(null),V=N?.modal,M=N?.open,A=typeof z==="boolean"?z:!!N&&!N.modal&&N.open&&!!K;L1.useEffect(()=>{if(!K||V)return;function _(D){if(K&&D.relatedTarget&&e4(D))(D.type==="focusin"?wB:OA)(K)}return K.addEventListener("focusin",_,!0),K.addEventListener("focusout",_,!0),()=>{K.removeEventListener("focusin",_,!0),K.removeEventListener("focusout",_,!0)}},[K,V]),L1.useEffect(()=>{if(!K||M)return;wB(K)},[M,K]);let O=L1.useMemo(()=>({beforeOutsideRef:B,afterOutsideRef:q,beforeInsideRef:U,afterInsideRef:F,portalNode:K,setFocusManagerState:L}),[K]);return G3.jsxs(L1.Fragment,{children:[W,G3.jsxs(XD.Provider,{value:O,children:[A&&K&&G3.jsx(P8,{"data-type":"outside",ref:B,onFocus:(_)=>{if(e4(_,K))U.current?.focus();else{let D=N?N.domReference:null;HH(D)?.focus()}}}),A&&K&&G3.jsx("span",{"aria-owns":K.id,style:QD}),K&&kB.createPortal(Q,K),A&&K&&G3.jsx(P8,{"data-type":"outside",ref:q,onFocus:(_)=>{if(e4(_,K))F.current?.focus();else{let D=N?N.domReference:null;if(b9(D)?.focus(),N?.closeOnFocusOut)N?.onOpenChange(!1,O0(q0.focusOut,_.nativeEvent))}}})]})]})});var dZ=P(l(),1);function op($,Z){let J=O8($.target);if($ instanceof J.KeyboardEvent)return"keyboard";if($ instanceof J.FocusEvent)return Z||"keyboard";if("pointerType"in $)return $.pointerType||"keyboard";if("touches"in $)return"touch";if($ instanceof J.MouseEvent)return Z||($.detail===0?"keyboard":"mouse");return""}var HD=20,h9=[];function yB(){h9=h9.filter(($)=>{return $.deref()?.isConnected})}function tp($){if(yB(),$&&AH($)!=="body"){if(h9.push(new WeakRef($)),h9.length>HD)h9=h9.slice(-HD)}}function bB(){return yB(),h9[h9.length-1]?.deref()}function ep($){if(!$)return null;let Z=J3();if(PB($,Z))return $;return Z3($,Z)[0]||$}function $c($){if(!$||!$.isConnected)return!1;if(typeof $.checkVisibility==="function")return $.checkVisibility();return E7($).display!=="none"}function GD($,Z){if(!Z.current.includes("floating")&&!$.getAttribute("role")?.includes("dialog"))return;let J=J3(),X=AA($,J).filter((G)=>{let z=G.getAttribute("data-tabindex")||"";return PB(G,J)||G.hasAttribute("data-tabindex")&&!z.startsWith("-")}),H=$.getAttribute("tabindex");if(Z.current.includes("floating")||X.length===0){if(H!=="0")$.setAttribute("tabindex","0")}else if(H!=="-1"||$.hasAttribute("data-tabindex")&&$.getAttribute("data-tabindex")!=="-1")$.setAttribute("tabindex","-1"),$.setAttribute("data-tabindex","-1")}function Y3($){let{context:Z,children:J,disabled:Q=!1,initialFocus:X=!0,returnFocus:H=!0,restoreFocus:G=!1,modal:z=!0,closeOnFocusOut:Y=!0,openInteractionType:K="",nextFocusableElement:W,previousFocusableElement:B,beforeContentFocusGuardRef:q,externalTree:U}=$,F="rootStore"in Z?Z.rootStore:Z,N=F.useState("open"),L=F.useState("domReferenceElement"),V=F.useState("floatingElement"),{events:M,dataRef:A}=F.context,O=K0(()=>A.current.floatingContext?.nodeId),_=X===!1,D=mZ(L)&&_,T=l1.useRef(["content"]),k=V1(X),x=V1(H),I=V1(K),y=j8(U),C=SB(),j=l1.useRef(null),R=l1.useRef(null),S=l1.useRef(!1),E=l1.useRef(!1),b=l1.useRef(!1),g=l1.useRef(-1),u=l1.useRef(""),w=l1.useRef(""),s=l1.useRef(null),z0=l1.useRef(null),h=q4(s,q,C?.beforeInsideRef),t=q4(z0,C?.afterInsideRef),M0=q1(),d=q1(),Y0=n8(),B0=C!=null,J0=$3(V),H0=K0((Z0=J0)=>{return Z0?Z3(Z0,J3()):[]}),N0=K0((Z0)=>{let $0=H0(Z0);return T.current.map(()=>$0).filter(Boolean).flat()});l1.useEffect(()=>{if(Q||!z)return;function Z0(G0){if(G0.key==="Tab"){if(x0(J0,p5(g0(J0)))&&H0().length===0&&!D)g1(G0)}}let $0=g0(J0);return $0.addEventListener("keydown",Z0),()=>{$0.removeEventListener("keydown",Z0)}},[Q,L,J0,z,T,D,H0,N0]),l1.useEffect(()=>{if(Q||!N)return;let Z0=g0(J0);function $0(){b.current=!1}function G0(Q0){let a=T5(Q0),p=x0(V,a)||x0(L,a)||x0(C?.portalNode,a);if(b.current=!p,w.current=Q0.pointerType||"keyboard",a?.closest(`[${I7}]`))E.current=!0}function r(){w.current="keyboard"}return Z0.addEventListener("pointerdown",G0,!0),Z0.addEventListener("pointerup",$0,!0),Z0.addEventListener("pointercancel",$0,!0),Z0.addEventListener("keydown",r,!0),()=>{Z0.removeEventListener("pointerdown",G0,!0),Z0.removeEventListener("pointerup",$0,!0),Z0.removeEventListener("pointercancel",$0,!0),Z0.removeEventListener("keydown",r,!0)}},[Q,V,L,J0,N,C]),l1.useEffect(()=>{if(Q||!Y)return;let Z0=g0(J0);function $0(){E.current=!0,d.start(0,()=>{E.current=!1})}function G0(o){let n=T5(o),w0=H0().indexOf(n);if(w0!==-1)g.current=w0}function r(o){let{relatedTarget:n,currentTarget:V0}=o,w0=T5(o);queueMicrotask(()=>{let v0=O(),c0=F.context.triggerElements,m=n?.hasAttribute(B4("focus-guard"))&&[s.current,z0.current,C?.beforeInsideRef.current,C?.afterInsideRef.current,C?.beforeOutsideRef.current,C?.afterOutsideRef.current,J2(B),J2(W)].includes(n),i=!(x0(L,n)||x0(V,n)||x0(n,V)||x0(C?.portalNode,n)||n!=null&&c0.hasElement(n)||c0.hasMatchingElement((f)=>x0(f,n))||m||y&&(w2(y.nodesRef.current,v0).find((f)=>x0(f.context?.elements.floating,n)||x0(f.context?.elements.domReference,n))||MB(y.nodesRef.current,v0).find((f)=>[f.context?.elements.floating,$3(f.context?.elements.floating)].includes(n)||f.context?.elements.domReference===n)));if(V0===L&&J0)GD(J0,T);if(G&&V0!==L&&!$c(w0)&&p5(Z0)===Z0.body){if(U1(J0)){if(J0.focus(),G==="popup"){Y0.request(()=>{J0.focus()});return}}let f=g.current,X0=H0(),L0=X0[f]||X0[X0.length-1]||J0;if(U1(L0))L0.focus()}if(A.current.insideReactTree){A.current.insideReactTree=!1;return}if((D?!0:!z)&&n&&i&&!E.current&&(D||n!==bB()))S.current=!0,F.setOpen(!1,O0(q0.focusOut,o))})}function Q0(){if(b.current)return;A.current.insideReactTree=!0,M0.start(0,()=>{A.current.insideReactTree=!1})}let a=U1(L)?L:null,p=[];if(!V&&!a)return;if(a)a.addEventListener("focusout",r),a.addEventListener("pointerdown",$0),p.push(()=>{a.removeEventListener("focusout",r),a.removeEventListener("pointerdown",$0)});if(V){if(V.addEventListener("focusin",G0),V.addEventListener("focusout",r),C)V.addEventListener("focusout",Q0,!0),p.push(()=>{V.removeEventListener("focusout",Q0,!0)});p.push(()=>{V.removeEventListener("focusin",G0),V.removeEventListener("focusout",r)})}return()=>{p.forEach((o)=>{o()})}},[Q,L,V,J0,z,y,C,F,Y,G,H0,D,O,T,A,M0,d,Y0,W,B]),l1.useEffect(()=>{if(Q||!V||!N)return;let Z0=Array.from(C?.portalNode?.querySelectorAll(`[${B4("portal")}]`)||[]),G0=(y?MB(y.nodesRef.current,O()):[]).find((Q0)=>mZ(Q0.context?.elements.domReference||null))?.context?.elements.domReference,r=[V,G0,...Z0,j.current,R.current,s.current,z0.current,C?.beforeOutsideRef.current,C?.afterOutsideRef.current,J2(B),J2(W),D?L:null].filter((Q0)=>Q0!=null);return ZD(r,z||D)},[N,Q,L,V,z,T,C,D,y,O,W,B]),W0(()=>{if(!N||Q||!U1(J0))return;let Z0=g0(J0),$0=p5(Z0);queueMicrotask(()=>{let G0=N0(J0),r=k.current,Q0=typeof r==="function"?r(I.current||""):r;if(Q0===void 0||Q0===!1)return;let a;if(Q0===!0||Q0===null)a=G0[0]||J0;else a=J2(Q0);if(a=a||G0[0]||J0,x0(J0,$0))return;H3(a,{preventScroll:a===J0})})},[Q,N,J0,_,N0,k,I]),W0(()=>{if(Q||!J0)return;let Z0=g0(J0),$0=p5(Z0);tp($0);function G0(a){if(!a.open)u.current=op(a.nativeEvent,w.current);if(a.reason===q0.triggerHover&&a.nativeEvent.type==="mouseleave")S.current=!0;if(a.reason!==q0.outsidePress)return;if(a.nested)S.current=!1;else if(sX(a.nativeEvent)||oX(a.nativeEvent))S.current=!1;else{let p=!1;if(document.createElement("div").focus({get preventScroll(){return p=!0,!1}}),p)S.current=!1;else S.current=!0}}M.on("openchange",G0);let r=Z0.createElement("span");if(r.setAttribute("tabindex","-1"),r.setAttribute("aria-hidden","true"),Object.assign(r.style,$2),B0&&L)L.insertAdjacentElement("afterend",r);function Q0(){let a=x.current,p=typeof a==="function"?a(u.current):a;if(p===void 0||p===!1)return null;if(p===null)p=!0;if(typeof p==="boolean"){let n=L||bB();return n&&n.isConnected?n:r}let o=L||bB()||r;return J2(p)||o}return()=>{M.off("openchange",G0);let a=p5(Z0),p=x0(V,a)||y&&w2(y.nodesRef.current,O(),!1).some((n)=>x0(n.context?.elements.floating,a)),o=Q0();queueMicrotask(()=>{let n=ep(o),V0=typeof x.current!=="boolean";if(x.current&&!S.current&&U1(n)&&(!V0&&n!==a&&a!==Z0.body?p:!0))n.focus({preventScroll:!0});r.remove(),S.current=!1})}},[Q,V,J0,x,A,M,y,B0,L,O]),W0(()=>{if(!lX||N||!V)return;let Z0=p5(g0(V));if(!U1(Z0)||!e6(Z0))return;if(x0(V,Z0))Z0.blur()},[N,V]),W0(()=>{if(Q||!C)return;return C.setFocusManagerState({modal:z,closeOnFocusOut:Y,open:N,onOpenChange:F.setOpen,domReference:L}),()=>{C.setFocusManagerState(null)}},[Q,C,z,N,F,Y,L]),W0(()=>{if(Q||!J0)return;return GD(J0,T),()=>{queueMicrotask(yB)}},[Q,J0,T]);let c=!Q&&(z?!D:!0)&&(B0||z);return dZ.jsxs(l1.Fragment,{children:[c&&dZ.jsx(P8,{"data-type":"inside",ref:h,onFocus:(Z0)=>{if(z){let $0=N0();H3($0[$0.length-1])}else if(C?.portalNode)if(S.current=!1,e4(Z0,C.portalNode))b9(L)?.focus();else J2(B??C.beforeOutsideRef)?.focus()}}),J,c&&dZ.jsx(P8,{"data-type":"inside",ref:t,onFocus:(Z0)=>{if(z)H3(N0()[0]);else if(C?.portalNode){if(Y)S.current=!0;if(e4(Z0,C.portalNode))HH(L)?.focus();else J2(W??C.afterOutsideRef)?.focus()}}})]})}var lZ=P(v(),1);function H9($,Z={}){let J="rootStore"in $?$.rootStore:$,Q=J.context.dataRef,{enabled:X=!0,event:H="click",toggle:G=!0,ignoreMouse:z=!1,stickIfOpen:Y=!0,touchOpenDelay:K=0,reason:W=q0.triggerPress}=Z,B=lZ.useRef(void 0),q=n8(),U=q1(),F=lZ.useMemo(()=>({onPointerDown(N){B.current=N.pointerType},onMouseDown(N){let L=B.current,V=N.nativeEvent,M=J.select("open");if(N.button!==0||H==="click"||k4(L,!0)&&z)return;let A=Q.current.openEvent,O=A?.type,_=J.select("domReferenceElement")!==N.currentTarget,D=M&&_||!(M&&G&&(A&&Y?O==="click"||O==="mousedown":!0));if(e6(V.target)){let k=O0(W,V,V.target);if(D&&L==="touch"&&K>0)U.start(K,()=>{J.setOpen(!0,k)});else J.setOpen(D,k);return}let T=N.currentTarget;q.request(()=>{let k=O0(W,V,T);if(D&&L==="touch"&&K>0)U.start(K,()=>{J.setOpen(!0,k)});else J.setOpen(D,k)})},onClick(N){if(H==="mousedown-only")return;let L=B.current;if(H==="mousedown"&&L){B.current=void 0;return}if(k4(L,!0)&&z)return;let V=J.select("open"),M=Q.current.openEvent,A=J.select("domReferenceElement")!==N.currentTarget,O=V&&A||!(V&&G&&(M&&Y?tX(M):!0)),_=O0(W,N.nativeEvent,N.currentTarget);if(O&&L==="touch"&&K>0)U.start(K,()=>{J.setOpen(!0,_)});else J.setOpen(O,_)},onKeyDown(){B.current=void 0}}),[Q,H,z,J,Y,G,q,U,K,W]);return lZ.useMemo(()=>X?{reference:F}:_5,[X,F])}var m8=P(v(),1);function Zc($,Z){let J=null,Q=null,X=!1;return{contextElement:$||void 0,getBoundingClientRect(){let H=$?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},G=Z.axis==="x"||Z.axis==="both",z=Z.axis==="y"||Z.axis==="both",Y=["mouseenter","mousemove"].includes(Z.dataRef.current.openEvent?.type||"")&&Z.pointerType!=="touch",K=H.width,W=H.height,B=H.x,q=H.y;if(J==null&&Z.x&&G)J=H.x-Z.x;if(Q==null&&Z.y&&z)Q=H.y-Z.y;if(B-=J||0,q-=Q||0,K=0,W=0,!X||Y)K=Z.axis==="y"?H.width:0,W=Z.axis==="x"?H.height:0,B=G&&Z.x!=null?Z.x:B,q=z&&Z.y!=null?Z.y:q;else if(X&&!Y)W=Z.axis==="x"?H.height:W,K=Z.axis==="y"?H.width:K;return X=!0,{width:K,height:W,x:B,y:q,top:q,right:B+K,bottom:q+W,left:B}}}}function zD($){return $!=null&&$.clientX!=null}function xB($,Z={}){let J="rootStore"in $?$.rootStore:$,Q=J.useState("open"),X=J.useState("floatingElement"),H=J.useState("domReferenceElement"),G=J.context.dataRef,{enabled:z=!0,axis:Y="both"}=Z,K=m8.useRef(!1),W=m8.useRef(null),[B,q]=m8.useState(),[U,F]=m8.useState([]),N=K0((O,_,D)=>{if(K.current)return;if(G.current.openEvent&&!zD(G.current.openEvent))return;J.set("positionReference",Zc(D??H,{x:O,y:_,axis:Y,dataRef:G,pointerType:B}))}),L=K0((O)=>{if(!Q)N(O.clientX,O.clientY,O.currentTarget);else if(!W.current)F([])}),V=k4(B)?X:Q,M=m8.useCallback(()=>{if(!V||!z)return;let O=O8(X);function _(D){let T=T5(D);if(!x0(X,T))N(D.clientX,D.clientY);else O.removeEventListener("mousemove",_),W.current=null}if(!G.current.openEvent||zD(G.current.openEvent)){O.addEventListener("mousemove",_);let D=()=>{O.removeEventListener("mousemove",_),W.current=null};return W.current=D,D}J.set("positionReference",H);return},[V,z,X,G,H,J,N]);m8.useEffect(()=>{return M()},[M,U]),m8.useEffect(()=>{if(z&&!X)K.current=!1},[z,X]),m8.useEffect(()=>{if(!z&&Q)K.current=!0},[z,Q]);let A=m8.useMemo(()=>{function O(_){q(_.pointerType)}return{onPointerDown:O,onPointerEnter:O,onMouseMove:L,onMouseEnter:L}},[L]);return m8.useMemo(()=>z?{reference:A,trigger:A}:{},[z,A])}var b4=P(v(),1);var Jc={intentional:"onClick",sloppy:"onPointerDown"};function Qc($){return{escapeKey:typeof $==="boolean"?$:$?.escapeKey??!1,outsidePress:typeof $==="boolean"?$:$?.outsidePress??!0}}function G9($,Z={}){let J="rootStore"in $?$.rootStore:$,Q=J.useState("open"),X=J.useState("floatingElement"),H=J.useState("referenceElement"),G=J.useState("domReferenceElement"),{onOpenChange:z,dataRef:Y}=J.context,{enabled:K=!0,escapeKey:W=!0,outsidePress:B=!0,outsidePressEvent:q="sloppy",referencePress:U=!1,referencePressEvent:F="sloppy",ancestorScroll:N=!1,bubbles:L,externalTree:V}=Z,M=j8(V),A=K0(typeof B==="function"?B:()=>!1),O=typeof B==="function"?A:B,_=b4.useRef(!1),{escapeKey:D,outsidePress:T}=Qc(L),k=b4.useRef(null),x=q1(),I=q1(),y=K0(()=>{I.clear(),Y.current.insideReactTree=!1}),C=b4.useRef(!1),j=b4.useRef(""),R=K0((c)=>{j.current=c.pointerType}),S=K0(()=>{let c=j.current,Z0=c==="pen"||!c?"mouse":c,$0=typeof q==="function"?q():q;if(typeof $0==="string")return $0;return $0[Z0]}),E=K0((c)=>{if(!Q||!K||!W||c.key!=="Escape")return;if(C.current)return;let Z0=Y.current.floatingContext?.nodeId,$0=M?w2(M.nodesRef.current,Z0):[];if(!D){if($0.length>0){let Q0=!0;if($0.forEach((a)=>{if(a.context?.open&&!a.context.dataRef.current.__escapeKeyBubbles)Q0=!1}),!Q0)return}}let G0=zA(c)?c.nativeEvent:c,r=O0(q0.escapeKey,G0);if(J.setOpen(!1,r),!D&&!r.isPropagationAllowed)c.stopPropagation()}),b=K0((c)=>{let Z0=S();return Z0==="intentional"&&c.type!=="click"||Z0==="sloppy"&&c.type==="click"}),g=K0(()=>{Y.current.insideReactTree=!0,I.start(0,y)}),u=K0((c,Z0=!1)=>{if(b(c)){y();return}if(Y.current.insideReactTree){y();return}if(S()==="intentional"&&Z0)return;if(typeof O==="function"&&!O(c))return;let $0=T5(c),G0=`[${B4("inert")}]`,r=g0(J.select("floatingElement")).querySelectorAll(G0),Q0=J.context.triggerElements;if($0&&(Q0.hasElement($0)||Q0.hasMatchingElement((V0)=>x0(V0,$0))))return;let a=V5($0)?$0:null;while(a&&!R7(a)){let V0=_H(a);if(R7(V0)||!V5(V0))break;a=V0}if(r.length&&V5($0)&&!GA($0)&&!x0($0,J.select("floatingElement"))&&Array.from(r).every((V0)=>!x0(a,V0)))return;if(U1($0)&&!("touches"in c)){let V0=R7($0),w0=E7($0),v0=/auto|scroll/,c0=V0||v0.test(w0.overflowX),m=V0||v0.test(w0.overflowY),i=c0&&$0.clientWidth>0&&$0.scrollWidth>$0.clientWidth,f=m&&$0.clientHeight>0&&$0.scrollHeight>$0.clientHeight,X0=w0.direction==="rtl",L0=f&&(X0?c.offsetX<=$0.offsetWidth-$0.clientWidth:c.offsetX>$0.clientWidth),k0=i&&c.offsetY>$0.clientHeight;if(L0||k0)return}let p=Y.current.floatingContext?.nodeId,o=M&&w2(M.nodesRef.current,p).some((V0)=>R4(c,V0.context?.elements.floating));if(R4(c,J.select("floatingElement"))||R4(c,J.select("domReferenceElement"))||o)return;let n=M?w2(M.nodesRef.current,p):[];if(n.length>0){let V0=!0;if(n.forEach((w0)=>{if(w0.context?.open&&!w0.context.dataRef.current.__outsidePressBubbles)V0=!1}),!V0)return}J.setOpen(!1,O0(q0.outsidePress,c)),y()}),w=K0((c)=>{if(S()!=="sloppy"||c.pointerType==="touch"||!J.select("open")||!K||R4(c,J.select("floatingElement"))||R4(c,J.select("domReferenceElement")))return;u(c)}),s=K0((c)=>{if(S()!=="sloppy"||!J.select("open")||!K||R4(c,J.select("floatingElement"))||R4(c,J.select("domReferenceElement")))return;let Z0=c.touches[0];if(Z0)k.current={startTime:Date.now(),startX:Z0.clientX,startY:Z0.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},x.start(1000,()=>{if(k.current)k.current.dismissOnTouchEnd=!1,k.current.dismissOnMouseDown=!1})}),z0=K0((c)=>{let Z0=T5(c);function $0(){s(c),Z0?.removeEventListener(c.type,$0)}Z0?.addEventListener(c.type,$0)}),h=K0((c)=>{let Z0=_.current;if(_.current=!1,x.clear(),c.type==="mousedown"&&k.current&&!k.current.dismissOnMouseDown)return;let $0=T5(c);function G0(){if(c.type==="pointerdown")w(c);else u(c,Z0);$0?.removeEventListener(c.type,G0)}$0?.addEventListener(c.type,G0)}),t=K0((c)=>{if(S()!=="sloppy"||!k.current||R4(c,J.select("floatingElement"))||R4(c,J.select("domReferenceElement")))return;let Z0=c.touches[0];if(!Z0)return;let $0=Math.abs(Z0.clientX-k.current.startX),G0=Math.abs(Z0.clientY-k.current.startY),r=Math.sqrt($0*$0+G0*G0);if(r>5)k.current.dismissOnTouchEnd=!0;if(r>10)u(c),x.clear(),k.current=null}),M0=K0((c)=>{let Z0=T5(c);function $0(){t(c),Z0?.removeEventListener(c.type,$0)}Z0?.addEventListener(c.type,$0)}),d=K0((c)=>{if(S()!=="sloppy"||!k.current||R4(c,J.select("floatingElement"))||R4(c,J.select("domReferenceElement")))return;if(k.current.dismissOnTouchEnd)u(c);x.clear(),k.current=null}),Y0=K0((c)=>{let Z0=T5(c);function $0(){d(c),Z0?.removeEventListener(c.type,$0)}Z0?.addEventListener(c.type,$0)});b4.useEffect(()=>{if(!Q||!K)return;Y.current.__escapeKeyBubbles=D,Y.current.__outsidePressBubbles=T;let c=new h1;function Z0(a){J.setOpen(!1,O0(q0.none,a))}function $0(){c.clear(),C.current=!0}function G0(){c.start(YD()?5:0,()=>{C.current=!1})}let r=g0(X);if(r.addEventListener("pointerdown",R,!0),W)r.addEventListener("keydown",E),r.addEventListener("compositionstart",$0),r.addEventListener("compositionend",G0);if(O)r.addEventListener("click",h,!0),r.addEventListener("pointerdown",h,!0),r.addEventListener("touchstart",z0,!0),r.addEventListener("touchmove",M0,!0),r.addEventListener("touchend",Y0,!0),r.addEventListener("mousedown",h,!0);let Q0=[];if(N){if(V5(G))Q0=iZ(G);if(V5(X))Q0=Q0.concat(iZ(X));if(!V5(H)&&H&&H.contextElement)Q0=Q0.concat(iZ(H.contextElement))}return Q0=Q0.filter((a)=>a!==r.defaultView?.visualViewport),Q0.forEach((a)=>{a.addEventListener("scroll",Z0,{passive:!0})}),()=>{if(r.removeEventListener("pointerdown",R,!0),W)r.removeEventListener("keydown",E),r.removeEventListener("compositionstart",$0),r.removeEventListener("compositionend",G0);if(O)r.removeEventListener("click",h,!0),r.removeEventListener("pointerdown",h,!0),r.removeEventListener("touchstart",z0,!0),r.removeEventListener("touchmove",M0,!0),r.removeEventListener("touchend",Y0,!0),r.removeEventListener("mousedown",h,!0);Q0.forEach((a)=>{a.removeEventListener("scroll",Z0)}),c.clear(),_.current=!1}},[Y,X,H,G,W,O,Q,z,N,K,D,T,E,u,h,w,z0,M0,Y0,R,J]),b4.useEffect(y,[O,y]);let B0=b4.useMemo(()=>({onKeyDown:E,...U&&{[Jc[F]]:(c)=>{J.setOpen(!1,O0(q0.triggerPress,c.nativeEvent))},...F!=="intentional"&&{onClick(c){J.setOpen(!1,O0(q0.triggerPress,c.nativeEvent))}}}}),[E,J,U,F]),J0=K0((c)=>{let Z0=T5(c.nativeEvent);if(!x0(J.select("floatingElement"),Z0)||c.button!==0)return;_.current=!0}),H0=K0((c)=>{if(!Q||!K||c.button!==0)return;_.current=!0}),N0=b4.useMemo(()=>({onKeyDown:E,onPointerDown:J0,onMouseDown:J0,onMouseUp:J0,onClickCapture:g,onMouseDownCapture(c){g(),H0(c)},onPointerDownCapture(c){g(),H0(c)},onMouseUpCapture:g,onTouchEndCapture:g,onTouchMoveCapture:g}),[E,J0,g,H0]);return b4.useMemo(()=>K?{reference:B0,floating:N0,trigger:B0}:{},[K,B0,N0])}var u8=P(v(),1);var Xc={open:C0(($)=>$.open),domReferenceElement:C0(($)=>$.domReferenceElement),referenceElement:C0(($)=>$.positionReference??$.referenceElement),floatingElement:C0(($)=>$.floatingElement),floatingId:C0(($)=>$.floatingId)};class K3 extends K4{constructor($){let{nested:Z,noEmit:J,onOpenChange:Q,triggerElements:X,...H}=$;super({...H,positionReference:H.referenceElement,domReferenceElement:H.referenceElement},{onOpenChange:Q,dataRef:{current:{}},events:FH(),nested:Z,noEmit:J,triggerElements:X},Xc)}setOpen=($,Z)=>{if(!$||!this.state.open||tX(Z.event))this.context.dataRef.current.openEvent=$?Z.event:void 0;if(!this.context.noEmit){let J={open:$,reason:Z.reason,nativeEvent:Z.event,nested:this.context.nested,triggerElement:Z.trigger};this.context.events.emit("openchange",J)}this.context.onOpenChange?.($,Z)}}var aZ=P(v(),1);var rZ=P(v(),1);function y4($,Z=!1,J=!1){let[Q,X]=rZ.useState($&&Z?"idle":void 0),[H,G]=rZ.useState($);if($&&!H)G(!0),X("starting");if(!$&&H&&Q!=="ending"&&!J)X("ending");if(!$&&!H&&Q==="ending")X(void 0);return W0(()=>{if(!$&&H&&Q!=="ending"&&J){let z=J1.request(()=>{X("ending")});return()=>{J1.cancel(z)}}return},[$,H,Q,J]),W0(()=>{if(!$||Z)return;let z=J1.request(()=>{X(void 0)});return()=>{J1.cancel(z)}},[Z,$]),W0(()=>{if(!$||!Z)return;if($&&H&&Q!=="idle")X("starting");let z=J1.request(()=>{X("idle")});return()=>{J1.cancel(z)}},[Z,$,H,X,Q]),rZ.useMemo(()=>({mounted:H,setMounted:G,transitionStatus:Q}),[H,Q])}function hB($,Z){let J=aZ.useRef(null),Q=aZ.useRef(null);return aZ.useCallback((X)=>{if($===void 0)return;if(J.current!==null){let H=J.current,G=Q.current,z=Z.context.triggerElements.getById(H);if(G&&z===G)Z.context.triggerElements.delete(H);J.current=null,Q.current=null}if(X!==null)J.current=$,Q.current=X,Z.context.triggerElements.add($,X)},[Z,$])}function g9($,Z,J,Q){let X=J.useState("isMountedByTrigger",$),H=hB($,J),G=K0((z)=>{if(H(z),!z||!J.select("open"))return;let Y=J.select("activeTriggerId");if(Y===$){J.update({activeTriggerElement:z,...Q});return}if(Y==null)J.update({activeTriggerId:$,activeTriggerElement:z,...Q})});return W0(()=>{if(X)J.update({activeTriggerElement:Z.current,...Q})},[X,J,Z,...Object.values(Q)]),{registerTrigger:G,isMountedByThisTrigger:X}}function v9($){let Z=$.useState("open");W0(()=>{if(Z&&!$.select("activeTriggerId")&&$.context.triggerElements.size===1){let J=$.context.triggerElements.entries().next();if(!J.done){let[Q,X]=J.value;$.update({activeTriggerId:Q,activeTriggerElement:X})}}},[Z,$])}function f9($,Z,J){let{mounted:Q,setMounted:X,transitionStatus:H}=y4($);Z.useSyncedValues({mounted:Q,transitionStatus:H});let G=K0(()=>{X(!1),Z.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),J?.(),Z.context.onOpenChangeComplete?.(!1)}),z=Z.useState("preventUnmountingOnClose");return v1({enabled:!z,open:$,ref:Z.context.popupRef,onComplete(){if(!$)G()}}),{forceUnmount:G,transitionStatus:H}}class U4{constructor(){this.elementsSet=new Set,this.idMap=new Map}add($,Z){let J=this.idMap.get($);if(J===Z)return;if(J!==void 0)this.elementsSet.delete(J);this.elementsSet.add(Z),this.idMap.set($,Z)}delete($){let Z=this.idMap.get($);if(Z)this.elementsSet.delete(Z),this.idMap.delete($)}hasElement($){return this.elementsSet.has($)}hasMatchingElement($){for(let Z of this.elementsSet)if($(Z))return!0;return!1}getById($){return this.idMap.get($)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}}function KD(){return new K3({open:!1,floatingElement:null,referenceElement:null,triggerElements:new U4,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function m9(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:"idle",floatingRootContext:KD(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:_5,inactiveTriggerProps:_5,popupProps:_5}}var OH=C0(($)=>$.triggerIdProp??$.activeTriggerId),u9={open:C0(($)=>$.openProp??$.open),mounted:C0(($)=>$.mounted),transitionStatus:C0(($)=>$.transitionStatus),floatingRootContext:C0(($)=>$.floatingRootContext),preventUnmountingOnClose:C0(($)=>$.preventUnmountingOnClose),payload:C0(($)=>$.payload),activeTriggerId:OH,activeTriggerElement:C0(($)=>$.mounted?$.activeTriggerElement:null),isTriggerActive:C0(($,Z)=>Z!==void 0&&OH($)===Z),isOpenedByTrigger:C0(($,Z)=>Z!==void 0&&OH($)===Z&&$.open),isMountedByTrigger:C0(($,Z)=>Z!==void 0&&OH($)===Z&&$.mounted),triggerProps:C0(($,Z)=>Z?$.activeTriggerProps:$.inactiveTriggerProps),popupProps:C0(($)=>$.popupProps),popupElement:C0(($)=>$.popupElement),positionerElement:C0(($)=>$.positionerElement)};function nZ($){let{open:Z=!1,onOpenChange:J,elements:Q={}}=$,X=J8(),H=d1()!=null,G=P5(()=>new K3({open:Z,onOpenChange:J,referenceElement:Q.reference??null,floatingElement:Q.floating??null,triggerElements:new U4,floatingId:X,nested:H,noEmit:!1})).current;return W0(()=>{let z={open:Z,floatingId:X};if(Q.reference!==void 0)z.referenceElement=Q.reference,z.domReferenceElement=V5(Q.reference)?Q.reference:null;if(Q.floating!==void 0)z.floatingElement=Q.floating;G.update(z)},[Z,X,Q.reference,Q.floating,G]),G.context.onOpenChange=J,G.context.nested=H,G.context.noEmit=!1,G}function gB($={}){let{nodeId:Z,externalTree:J}=$,Q=nZ($),X=$.rootContext||Q,H={reference:X.useState("referenceElement"),floating:X.useState("floatingElement"),domReference:X.useState("domReferenceElement")},[G,z]=u8.useState(null),Y=u8.useRef(null),K=j8(J);W0(()=>{if(H.domReference)Y.current=H.domReference},[H.domReference]);let W=WD({...$,elements:{...H,...G&&{reference:G}}}),B=u8.useCallback((T)=>{let k=V5(T)?{getBoundingClientRect:()=>T.getBoundingClientRect(),getClientRects:()=>T.getClientRects(),contextElement:T}:T;z(k),W.refs.setReference(k)},[W.refs]),[q,U]=u8.useState(null),[F,N]=u8.useState(null);X.useSyncedValue("referenceElement",q),X.useSyncedValue("domReferenceElement",V5(q)?q:null),X.useSyncedValue("floatingElement",F);let L=u8.useCallback((T)=>{if(V5(T)||T===null)Y.current=T,U(T);if(V5(W.refs.reference.current)||W.refs.reference.current===null||T!==null&&!V5(T))W.refs.setReference(T)},[W.refs,U]),V=u8.useCallback((T)=>{N(T),W.refs.setFloating(T)},[W.refs]),M=u8.useMemo(()=>({...W.refs,setReference:L,setFloating:V,setPositionReference:B,domReference:Y}),[W.refs,L,V,B]),A=u8.useMemo(()=>({...W.elements,domReference:H.domReference}),[W.elements,H.domReference]),O=X.useState("open"),_=X.useState("floatingId"),D=u8.useMemo(()=>({...W,dataRef:X.context.dataRef,open:O,onOpenChange:X.setOpen,events:X.context.events,floatingId:_,refs:M,elements:A,nodeId:Z,rootStore:X}),[W,M,A,Z,X,O,_]);return W0(()=>{X.context.dataRef.current.floatingContext=D;let T=K?.nodesRef.current.find((k)=>k.id===Z);if(T)T.context=D}),u8.useMemo(()=>({...W,context:D,refs:M,elements:A,rootStore:X}),[W,M,A,D,X])}function z9($){let{popupStore:Z,noEmit:J=!1,treatPopupAsFloatingElement:Q=!1,onOpenChange:X}=$,H=J8(),G=d1()!=null,z=Z.useState("open"),Y=Z.useState("activeTriggerElement"),K=Z.useState(Q?"popupElement":"positionerElement"),W=Z.context.triggerElements,B=P5(()=>new K3({open:z,referenceElement:Y,floatingElement:K,triggerElements:W,onOpenChange:X,floatingId:H,nested:G,noEmit:J})).current;return W0(()=>{let q={open:z,floatingId:H,referenceElement:Y,floatingElement:K};if(V5(Y))q.domReferenceElement=Y;if(B.state.positionReference===B.state.referenceElement)q.positionReference=Y;B.update(q)},[z,H,Y,K,B]),B.context.onOpenChange=X,B.context.nested=G,B.context.noEmit=J,B}var R2=P(v(),1);var vB=XA&&rX;function sZ($,Z={}){let J="rootStore"in $?$.rootStore:$,{events:Q,dataRef:X}=J.context,{enabled:H=!0,delay:G}=Z,z=R2.useRef(!1),Y=R2.useRef(null),K=q1(),W=R2.useRef(!0);R2.useEffect(()=>{let q=J.select("domReferenceElement");if(!H)return;let U=O8(q);function F(){let V=J.select("domReferenceElement");if(!J.select("open")&&U1(V)&&V===p5(g0(V)))z.current=!0}function N(){W.current=!0}function L(){W.current=!1}if(U.addEventListener("blur",F),vB)U.addEventListener("keydown",N,!0),U.addEventListener("pointerdown",L,!0);return()=>{if(U.removeEventListener("blur",F),vB)U.removeEventListener("keydown",N,!0),U.removeEventListener("pointerdown",L,!0)}},[J,H]),R2.useEffect(()=>{if(!H)return;function q(U){if(U.reason===q0.triggerPress||U.reason===q0.escapeKey){let F=J.select("domReferenceElement");if(V5(F))Y.current=F,z.current=!0}}return Q.on("openchange",q),()=>{Q.off("openchange",q)}},[Q,H,J]);let B=R2.useMemo(()=>({onMouseLeave(){z.current=!1,Y.current=null},onFocus(q){let U=q.currentTarget;if(z.current){if(Y.current===U)return;z.current=!1,Y.current=null}let F=T5(q.nativeEvent);if(V5(F)){if(vB&&!q.relatedTarget){if(!W.current&&!e6(F))return}else if(!S9(F))return}let N=t6(q.relatedTarget,J.context.triggerElements),{nativeEvent:L,currentTarget:V}=q,M=typeof G==="function"?G():G;if(J.select("open")&&N||M===0||M===void 0){J.setOpen(!0,O0(q0.triggerFocus,L,V));return}K.start(M,()=>{if(z.current)return;J.setOpen(!0,O0(q0.triggerFocus,L,V))})},onBlur(q){z.current=!1,Y.current=null;let{relatedTarget:U,nativeEvent:F}=q,N=V5(U)&&U.hasAttribute(B4("focus-guard"))&&U.getAttribute("data-type")==="outside";K.start(0,()=>{let L=J.select("domReferenceElement"),V=p5(L?L.ownerDocument:document);if(!U&&V===L)return;if(x0(X.current.floatingContext?.refs.floating.current,V)||x0(L,V)||N)return;if(t6(U??V,J.context.triggerElements))return;J.setOpen(!1,O0(q0.triggerFocus,F))})}}),[X,J,K,G]);return R2.useMemo(()=>H?{reference:B,trigger:B}:{},[H,B])}var k7=P(v(),1);var oZ=B4("safe-polygon"),Hc=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${O7}`;function BD($){return $?Boolean($.closest(Hc)):!1}class fB{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.unbindMouseMove=()=>{},this.restTimeoutPending=!1,this.openChangeTimeout=new h1,this.restTimeout=new h1,this.handleCloseOptions=void 0}static create(){return new fB}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>{return this.dispose}}function PH($){let Z=P5(fB.create).current,J=$.context.dataRef.current;if(!J.hoverInteractionState)J.hoverInteractionState=Z;return _8(J.hoverInteractionState.disposeEffect),J.hoverInteractionState}var Gc=new Set(["click","mousedown"]);function W3($,Z={}){let J="rootStore"in $?$.rootStore:$,Q=J.useState("open"),X=J.useState("floatingElement"),H=J.useState("domReferenceElement"),{dataRef:G}=J.context,{enabled:z=!0,closeDelay:Y=0}=Z,K=PH(J),W=j8(),B=d1(),q=K0(()=>{if(K.interactedInside)return!0;return G.current.openEvent?Gc.has(G.current.openEvent.type):!1}),U=K0(()=>{let A=G.current.openEvent?.type;return A?.includes("mouse")&&A!=="mousedown"}),F=K0((A)=>{return t6(A,J.context.triggerElements)}),N=k7.useCallback((A,O=!0)=>{let _=zc(Y,K.pointerType);if(_&&!K.handler)K.openChangeTimeout.start(_,()=>J.setOpen(!1,O0(q0.triggerHover,A)));else if(O)K.openChangeTimeout.clear(),J.setOpen(!1,O0(q0.triggerHover,A))},[Y,J,K]),L=K0(()=>{K.unbindMouseMove(),K.handler=void 0}),V=K0(()=>{if(K.performedPointerEventsMutation){let A=g0(X).body;A.style.pointerEvents="",A.removeAttribute(oZ),K.performedPointerEventsMutation=!1}}),M=K0((A)=>{let O=T5(A);if(!BD(O)){K.interactedInside=!1;return}K.interactedInside=!0});W0(()=>{if(!Q)K.pointerType=void 0,K.restTimeoutPending=!1,K.interactedInside=!1,L(),V()},[Q,K,L,V]),k7.useEffect(()=>{return()=>{L()}},[L]),k7.useEffect(()=>{return V},[V]),W0(()=>{if(!z)return;if(Q&&K.handleCloseOptions?.blockPointerEvents&&U()&&V5(H)&&X){K.performedPointerEventsMutation=!0;let A=g0(X).body;A.setAttribute(oZ,"");let O=H,_=X,D=W?.nodesRef.current.find((T)=>T.id===B)?.context?.elements.floating;if(D)D.style.pointerEvents="";return A.style.pointerEvents="none",O.style.pointerEvents="auto",_.style.pointerEvents="auto",()=>{A.style.pointerEvents="",O.style.pointerEvents="",_.style.pointerEvents=""}}return},[z,Q,H,X,K,U,W,B]),k7.useEffect(()=>{if(!z)return;function A(T){if(q()||!G.current.floatingContext||!J.select("open"))return;if(F(T.relatedTarget))return;if(V(),L(),!q())N(T)}function O(T){K.openChangeTimeout.clear(),V(),K.handler?.(T),L()}function _(T){if(!q())N(T,!1)}let D=X;if(D)D.addEventListener("mouseleave",A),D.addEventListener("mouseenter",O),D.addEventListener("mouseleave",_),D.addEventListener("pointerdown",M,!0);return()=>{if(D)D.removeEventListener("mouseleave",A),D.removeEventListener("mouseenter",O),D.removeEventListener("mouseleave",_),D.removeEventListener("pointerdown",M,!0)}},[z,X,J,G,q,F,N,V,L,M,K])}function zc($,Z){if(Z&&!k4(Z))return 0;if(typeof $==="function")return $();return $}var B3=P(v(),1),qD=P(W4(),1);function mB($){if(typeof $==="function")return $();return $}var Yc={current:null};function Y9($,Z={}){let J="rootStore"in $?$.rootStore:$,{dataRef:Q,events:X}=J.context,{enabled:H=!0,delay:G=0,handleClose:z=null,mouseOnly:Y=!1,restMs:K=0,move:W=!0,triggerElementRef:B=Yc,externalTree:q,isActiveTrigger:U=!0}=Z,F=j8(q),N=PH(J),L=V1(z),V=V1(G),M=V1(K),A=V1(H);if(U)N.handleCloseOptions=L.current?.__options;let O=K0(()=>{if(N.interactedInside)return!0;return Q.current.openEvent?["click","mousedown"].includes(Q.current.openEvent.type):!1}),_=K0((I)=>{return t6(I,J.context.triggerElements)}),D=B3.useCallback((I,y=!0)=>{let C=C7(V.current,"close",N.pointerType);if(C&&!N.handler)N.openChangeTimeout.start(C,()=>J.setOpen(!1,O0(q0.triggerHover,I)));else if(y)N.openChangeTimeout.clear(),J.setOpen(!1,O0(q0.triggerHover,I))},[V,J,N]),T=K0(()=>{N.unbindMouseMove(),N.handler=void 0}),k=K0(()=>{if(N.performedPointerEventsMutation){let I=g0(J.select("domReferenceElement")).body;I.style.pointerEvents="",I.removeAttribute(oZ),N.performedPointerEventsMutation=!1}});B3.useEffect(()=>{if(!H)return;function I(y){if(!y.open)N.openChangeTimeout.clear(),N.restTimeout.clear(),N.blockMouseMove=!0,N.restTimeoutPending=!1}return X.on("openchange",I),()=>{X.off("openchange",I)}},[H,X,N]);let x=K0((I)=>{if(O())return;if(!Q.current.floatingContext)return;if(_(I.relatedTarget))return;let y=B.current;L.current?.({...Q.current.floatingContext,tree:F,x:I.clientX,y:I.clientY,onClose(){if(k(),T(),!O()&&y===J.select("domReferenceElement"))D(I)}})(I)});return B3.useEffect(()=>{if(!H)return;let I=B.current??(U?J.select("domReferenceElement"):null);if(!V5(I))return;function y(R){if(N.openChangeTimeout.clear(),N.blockMouseMove=!1,Y&&!k4(N.pointerType))return;if(mB(M.current)>0&&!C7(V.current,"open"))return;let S=C7(V.current,"open",N.pointerType),E=J.select("domReferenceElement"),b=J.context.triggerElements,g=(b.hasElement(R.target)||b.hasMatchingElement((z0)=>x0(z0,R.target)))&&(!E||!x0(E,R.target)),u=R.currentTarget??null,w=J.select("open"),s=!w||g;if(g&&w)J.setOpen(!0,O0(q0.triggerHover,R,u));else if(S)N.openChangeTimeout.start(S,()=>{if(s)J.setOpen(!0,O0(q0.triggerHover,R,u))});else if(s)J.setOpen(!0,O0(q0.triggerHover,R,u))}function C(R){if(O()){k();return}N.unbindMouseMove();let S=J.select("domReferenceElement"),E=g0(S);if(N.restTimeout.clear(),N.restTimeoutPending=!1,_(R.relatedTarget))return;if(L.current&&Q.current.floatingContext){if(!J.select("open"))N.openChangeTimeout.clear();let g=B.current;N.handler=L.current({...Q.current.floatingContext,tree:F,x:R.clientX,y:R.clientY,onClose(){if(k(),T(),A.current&&!O()&&g===J.select("domReferenceElement"))D(R,!0)}});let u=N.handler;u(R),E.addEventListener("mousemove",u),N.unbindMouseMove=()=>{E.removeEventListener("mousemove",u)};return}if(N.pointerType==="touch"?!x0(J.select("floatingElement"),R.relatedTarget):!0)D(R)}function j(R){x(R)}if(J.select("open"))I.addEventListener("mouseleave",j);if(W)I.addEventListener("mousemove",y,{once:!0});return I.addEventListener("mouseenter",y),I.addEventListener("mouseleave",C),()=>{if(I.removeEventListener("mouseleave",j),W)I.removeEventListener("mousemove",y);I.removeEventListener("mouseenter",y),I.removeEventListener("mouseleave",C)}},[T,k,Q,V,D,J,H,L,x,N,U,O,_,Y,W,M,B,F,A]),B3.useMemo(()=>{if(!H)return;function I(y){N.pointerType=y.pointerType}return{onPointerDown:I,onPointerEnter:I,onMouseMove(y){let{nativeEvent:C}=y,j=y.currentTarget,R=J.select("domReferenceElement"),S=J.context.triggerElements,E=J.select("open"),b=(S.hasElement(y.target)||S.hasMatchingElement((u)=>x0(u,y.target)))&&(!R||!x0(R,y.target));if(Y&&!k4(N.pointerType))return;if(E&&!b||mB(M.current)===0)return;if(!b&&N.restTimeoutPending&&y.movementX**2+y.movementY**2<2)return;N.restTimeout.clear();function g(){if(N.restTimeoutPending=!1,O())return;let u=J.select("open");if(!N.blockMouseMove&&(!u||b))J.setOpen(!0,O0(q0.triggerHover,C,j))}if(N.pointerType==="touch")qD.flushSync(()=>{g()});else if(b&&E)g();else N.restTimeoutPending=!0,N.restTimeout.start(mB(M.current),g)}}},[H,N,O,Y,J,M])}var q3=P(v(),1);function F8($=[]){let Z=$.map((K)=>K?.reference),J=$.map((K)=>K?.floating),Q=$.map((K)=>K?.item),X=$.map((K)=>K?.trigger),H=q3.useCallback((K)=>wH(K,$,"reference"),Z),G=q3.useCallback((K)=>wH(K,$,"floating"),J),z=q3.useCallback((K)=>wH(K,$,"item"),Q),Y=q3.useCallback((K)=>wH(K,$,"trigger"),X);return q3.useMemo(()=>({getReferenceProps:H,getFloatingProps:G,getItemProps:z,getTriggerProps:Y}),[H,G,z,Y])}function wH($,Z,J){let Q=new Map,X=J==="item",H={};if(J==="floating")H.tabIndex=-1,H[vZ]="";for(let G in $){if(X&&$){if(G===VB||G===LB)continue}H[G]=$[G]}for(let G=0;G<Z.length;G+=1){let z,Y=Z[G]?.[J];if(typeof Y==="function")z=$?Y($):null;else z=Y;if(!z)continue;UD(H,z,X,Q)}return UD(H,$,X,Q),H}function UD($,Z,J,Q){for(let X in Z){let H=Z[X];if(J&&(X===VB||X===LB))continue;if(!X.startsWith("on"))$[X]=H;else{if(!Q.has(X))Q.set(X,[]);if(typeof H==="function")Q.get(X)?.push(H),$[X]=(...G)=>{return Q.get(X)?.map((z)=>z(...G)).find((z)=>z!==void 0)}}}}var i1=P(v(),1);var Kc="Escape";function CH($,Z,J){switch($){case"vertical":return Z;case"horizontal":return J;default:return Z||J}}function jH($,Z){return CH(Z,$===fZ||$===o6,$===O2||$===P2)}function uB($,Z,J){return CH(Z,$===o6,J?$===O2:$===P2)||$==="Enter"||$===" "||$===""}function Wc($,Z,J){return CH(Z,J?$===O2:$===P2,$===o6)}function Bc($,Z,J,Q){let X=J?$===P2:$===O2,H=$===fZ;if(Z==="both"||Z==="horizontal"&&Q&&Q>1)return $===Kc;return CH(Z,X,H)}function pB($,Z){let J="rootStore"in $?$.rootStore:$,Q=J.useState("open"),X=J.useState("floatingElement"),H=J.useState("domReferenceElement"),G=J.context.dataRef,{listRef:z,activeIndex:Y,onNavigate:K=()=>{},enabled:W=!0,selectedIndex:B=null,allowEscape:q=!1,loopFocus:U=!1,nested:F=!1,rtl:N=!1,virtual:L=!1,focusItemOnOpen:V="auto",focusItemOnHover:M=!0,openOnArrowKeyDown:A=!0,disabledIndices:O=void 0,orientation:_="vertical",parentOrientation:D,cols:T=1,id:k,resetOnPointerLeave:x=!0,externalTree:I}=Z,y=$3(X),C=V1(y),j=d1(),R=j8(I);W0(()=>{G.current.orientation=_},[G,_]);let S=mZ(H),E=i1.useRef(V),b=i1.useRef(B??-1),g=i1.useRef(null),u=i1.useRef(!0),w=K0((p)=>{K(b.current===-1?null:b.current,p)}),s=i1.useRef(w),z0=i1.useRef(!!X),h=i1.useRef(Q),t=i1.useRef(!1),M0=i1.useRef(!1),d=V1(O),Y0=V1(Q),B0=V1(B),J0=V1(x),H0=K0(()=>{function p(w0){if(L)R?.events.emit("virtualfocus",w0);else H3(w0,{sync:t.current,preventScroll:!0})}let o=z.current[b.current],n=M0.current;if(o)p(o);(t.current?(w0)=>w0():requestAnimationFrame)(()=>{let w0=z.current[b.current]||o;if(!w0)return;if(!o)p(w0);if(c&&(n||!u.current))w0.scrollIntoView?.({block:"nearest",inline:"nearest"})})});W0(()=>{if(!W)return;if(Q&&X){if(b.current=B??-1,E.current&&B!=null)M0.current=!0,w()}else if(z0.current)b.current=-1,s.current()},[W,Q,X,B,w]),W0(()=>{if(!W)return;if(!Q){t.current=!1;return}if(!X)return;if(Y==null){if(t.current=!1,B0.current!=null)return;if(z0.current)b.current=-1,H0();if((!h.current||!z0.current)&&E.current&&(g.current!=null||E.current===!0&&g.current==null)){let p=0,o=()=>{if(z.current[0]==null){if(p<2)(p?requestAnimationFrame:queueMicrotask)(o);p+=1}else b.current=g.current==null||uB(g.current,_,N)||F?$H(z):DB(z),g.current=null,w()};o()}}else if(!P7(z,Y))b.current=Y,H0(),M0.current=!1},[W,Q,X,Y,B0,F,z,_,N,w,H0,d]),W0(()=>{if(!W||X||!R||L||!z0.current)return;let p=R.nodesRef.current,o=p.find((w0)=>w0.id===j)?.context?.elements.floating,n=p5(g0(X)),V0=p.some((w0)=>w0.context&&x0(w0.context.elements.floating,n));if(o&&!V0&&u.current)o.focus({preventScroll:!0})},[W,X,R,j,L]),W0(()=>{s.current=w,h.current=Q,z0.current=!!X}),W0(()=>{if(!Q)g.current=null,E.current=V},[Q,V]);let N0=Y!=null,c=i1.useMemo(()=>{function p(n){if(!Y0.current)return;let V0=z.current.indexOf(n.currentTarget);if(V0!==-1&&b.current!==V0)b.current=V0,w(n)}return{onFocus(n){t.current=!0,p(n)},onClick:({currentTarget:n})=>n.focus({preventScroll:!0}),onMouseMove(n){if(t.current=!0,M0.current=!1,M)p(n)},onPointerLeave(n){if(!Y0.current||!u.current||n.pointerType==="touch")return;t.current=!0;let V0=n.relatedTarget;if(!M||z.current.includes(V0))return;if(!J0.current)return;if(H3(null,{sync:!0}),b.current=-1,w(n),!L)C.current?.focus({preventScroll:!0})}}},[Y0,C,M,z,w,J0,L]),Z0=i1.useCallback(()=>{return D??R?.nodesRef.current.find((p)=>p.id===j)?.context?.dataRef?.current.orientation},[j,R,D]),$0=K0((p)=>{if(u.current=!1,t.current=!0,p.which===229)return;if(!Y0.current&&p.currentTarget===C.current)return;if(F&&Bc(p.key,_,N,T)){if(!jH(p.key,Z0()))g1(p);if(J.setOpen(!1,O0(q0.listNavigation,p.nativeEvent)),U1(H))if(L)R?.events.emit("virtualfocus",H);else H.focus();return}let o=b.current,n=$H(z,O),V0=DB(z,O);if(!S){if(p.key==="Home")g1(p),b.current=n,w(p);if(p.key==="End")g1(p),b.current=V0,w(p)}if(T>1){let w0=Array.from({length:z.current.length},()=>({width:1,height:1})),v0=KA(w0,T,!1),c0=v0.findIndex((f)=>f!=null&&!w7(z,f,O)),m=v0.reduce((f,X0,L0)=>X0!=null&&!w7(z,X0,O)?L0:f,-1),i=v0[YA({current:v0.map((f)=>f!=null?z.current[f]:null)},{event:p,orientation:_,loopFocus:U,rtl:N,cols:T,disabledIndices:BA([...(typeof O!=="function"?O:null)||z.current.map((f,X0)=>w7(z,X0,O)?X0:void 0),void 0],v0),minIndex:c0,maxIndex:m,prevIndex:WA(b.current>V0?n:b.current,w0,v0,T,p.key===o6?"bl":p.key===(N?O2:P2)?"tr":"tl"),stopEvent:!0})];if(i!=null)b.current=i,w(p);if(_==="both")return}if(jH(p.key,_)){if(g1(p),Q&&!L&&p5(p.currentTarget.ownerDocument)===p.currentTarget){b.current=uB(p.key,_,N)?n:V0,w(p);return}if(uB(p.key,_,N))if(U)if(o>=V0)if(q&&o!==z.current.length)b.current=-1;else t.current=!1,b.current=n;else b.current=U8(z,{startingIndex:o,disabledIndices:O});else b.current=Math.min(V0,U8(z,{startingIndex:o,disabledIndices:O}));else if(U)if(o<=n)if(q&&o!==-1)b.current=z.current.length;else t.current=!1,b.current=V0;else b.current=U8(z,{startingIndex:o,decrement:!0,disabledIndices:O});else b.current=Math.max(n,U8(z,{startingIndex:o,decrement:!0,disabledIndices:O}));if(P7(z,b.current))b.current=-1;w(p)}}),G0=i1.useMemo(()=>{return L&&Q&&N0&&{"aria-activedescendant":`${k}-${Y}`}},[L,Q,N0,k,Y]),r=i1.useMemo(()=>{return{"aria-orientation":_==="both"?void 0:_,...!S?G0:{},onKeyDown(p){if(p.key==="Tab"&&p.shiftKey&&Q&&!L){let o=T5(p.nativeEvent);if(o&&!x0(C.current,o))return;if(g1(p),J.setOpen(!1,O0(q0.focusOut,p.nativeEvent)),U1(H))H.focus();return}$0(p)},onPointerMove(){u.current=!0}}},[G0,$0,C,_,S,J,Q,L,H]),Q0=i1.useMemo(()=>{function p(n){if(V==="auto"&&sX(n.nativeEvent))E.current=!L}function o(n){if(E.current=V,V==="auto"&&oX(n.nativeEvent))E.current=!0}return{onKeyDown(n){let V0=J.select("open");u.current=!1;let w0=n.key.startsWith("Arrow"),v0=Wc(n.key,Z0(),N),c0=jH(n.key,_),m=(F?v0:c0)||n.key==="Enter"||n.key.trim()==="";if(L&&V0)return $0(n);if(!V0&&!A&&w0)return;if(m){let i=jH(n.key,Z0());g.current=F&&i?null:n.key}if(F){if(v0)if(g1(n),V0)b.current=$H(z,d.current),w(n);else J.setOpen(!0,O0(q0.listNavigation,n.nativeEvent,n.currentTarget));return}if(c0){if(B0.current!=null)b.current=B0.current;if(g1(n),!V0&&A)J.setOpen(!0,O0(q0.listNavigation,n.nativeEvent,n.currentTarget));else $0(n);if(V0)w(n)}return},onFocus(n){if(J.select("open")&&!L)b.current=-1,w(n)},onPointerDown:o,onPointerEnter:o,onMouseDown:p,onClick:p}},[$0,d,V,z,F,w,J,A,_,Z0,N,B0,L]),a=i1.useMemo(()=>{return{...G0,...Q0}},[G0,Q0]);return i1.useMemo(()=>W?{reference:a,floating:r,item:c,trigger:Q0}:{},[W,a,r,Q0,c])}var p9=P(v(),1);var qc=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function U3($,Z={}){let J="rootStore"in $?$.rootStore:$,Q=J.useState("open"),X=J.useState("floatingId"),H=J.useState("domReferenceElement"),G=J.useState("floatingElement"),{role:z="dialog"}=Z,Y=J8(),K=H?.id||Y,W=p9.useMemo(()=>$3(G)?.id||X,[G,X]),B=qc.get(z)??z,U=d1()!=null,F=p9.useMemo(()=>{if(B==="tooltip"||z==="label")return _5;return{"aria-haspopup":B==="alertdialog"?"dialog":B,"aria-expanded":"false",...B==="listbox"&&{role:"combobox"},...B==="menu"&&U&&{role:"menuitem"},...z==="select"&&{"aria-autocomplete":"none"},...z==="combobox"&&{"aria-autocomplete":"list"}}},[B,U,z]),N=p9.useMemo(()=>{if(B==="tooltip"||z==="label")return{[`aria-${z==="label"?"labelledby":"describedby"}`]:Q?W:void 0};return{...F,"aria-expanded":Q?"true":"false","aria-controls":Q?W:void 0,...B==="menu"&&{id:K}}},[B,W,Q,K,z,F]),L=p9.useMemo(()=>{let M={id:W,...B&&{role:B}};if(B==="tooltip"||z==="label")return M;return{...M,...B==="menu"&&{"aria-labelledby":K}}},[B,W,K,z]),V=p9.useCallback(({active:M,selected:A})=>{let O={role:"option",...M&&{id:`${W}-fui-option`}};switch(z){case"select":case"combobox":return{...O,"aria-selected":A};default:}return{}},[W,z]);return p9.useMemo(()=>({reference:N,floating:L,item:V,trigger:F}),[N,L,F,V])}var c9=P(v(),1);function cB($,Z){let J="rootStore"in $?$.rootStore:$,Q=J.context.dataRef,X=J.useState("open"),{listRef:H,activeIndex:G,onMatch:z,onTypingChange:Y,enabled:K=!0,resetMs:W=750,selectedIndex:B=null}=Z,q=q1(),U=c9.useRef(""),F=c9.useRef(B??G??-1),N=c9.useRef(null);W0(()=>{if(!X&&B!==null)return;if(q.clear(),N.current=null,U.current!=="")U.current=""},[X,B,q]),W0(()=>{if(X&&U.current==="")F.current=B??G??-1},[X,B,G]);let L=K0((_)=>{if(_){if(!Q.current.typing)Q.current.typing=_,Y?.(_)}else if(Q.current.typing)Q.current.typing=_,Y?.(_)}),V=K0((_)=>{function D(C,j,R){let S=j.find((E)=>E?.toLocaleLowerCase().indexOf(R.toLocaleLowerCase())===0);return S?C.indexOf(S):-1}let T=H.current;if(U.current.length>0&&U.current[0]!==" "){if(D(T,T,U.current)===-1)L(!1);else if(_.key===" ")g1(_)}if(T==null||_.key.length!==1||_.ctrlKey||_.metaKey||_.altKey)return;if(X&&_.key!==" ")g1(_),L(!0);let k=U.current==="";if(k)F.current=B??G??-1;if(T.every((C)=>C?C[0]?.toLocaleLowerCase()!==C[1]?.toLocaleLowerCase():!0)&&U.current===_.key)U.current="",F.current=N.current;U.current+=_.key,q.start(W,()=>{U.current="",F.current=N.current,L(!1)});let I=k?B??G??-1:F.current,y=D(T,[...T.slice((I||0)+1),...T.slice(0,(I||0)+1)],U.current);if(y!==-1)z?.(y),N.current=y;else if(_.key!==" ")U.current="",L(!1)}),M=K0((_)=>{let D=_.relatedTarget,T=J.select("domReferenceElement"),k=J.select("floatingElement"),x=x0(T,D),I=x0(k,D);if(x||I)return;q.clear(),U.current="",F.current=N.current,L(!1)}),A=c9.useMemo(()=>({onKeyDown:V,onBlur:M}),[V,M]),O=c9.useMemo(()=>{return{onKeyDown:V,onKeyUp(_){if(_.key===" ")L(!1)},onBlur:M}},[V,M,L]);return c9.useMemo(()=>K?{reference:A,floating:O}:{},[K,A,O])}function FD($,Z){let[J,Q]=$,X=!1,H=Z.length;for(let G=0,z=H-1;G<H;z=G++){let[Y,K]=Z[G]||[0,0],[W,B]=Z[z]||[0,0];if(K>=Q!==B>=Q&&J<=(W-Y)*(Q-K)/(B-K)+Y)X=!X}return X}function Uc($,Z){return $[0]>=Z.x&&$[0]<=Z.x+Z.width&&$[1]>=Z.y&&$[1]<=Z.y+Z.height}function K9($={}){let{buffer:Z=0.5,blockPointerEvents:J=!1,requireIntent:Q=!0}=$,X=new h1,H=!1,G=null,z=null,Y=typeof performance<"u"?performance.now():0;function K(B,q){let U=performance.now(),F=U-Y;if(G===null||z===null||F===0)return G=B,z=q,Y=U,null;let N=B-G,L=q-z,M=Math.sqrt(N*N+L*L)/F;return G=B,z=q,Y=U,M}let W=({x:B,y:q,placement:U,elements:F,onClose:N,nodeId:L,tree:V})=>{return function(A){function O(){X.clear(),N()}if(X.clear(),!F.domReference||!F.floating||U==null||B==null||q==null)return;let{clientX:_,clientY:D}=A,T=[_,D],k=T5(A),x=A.type==="mouseleave",I=x0(F.floating,k),y=x0(F.domReference,k),C=F.domReference.getBoundingClientRect(),j=F.floating.getBoundingClientRect(),R=U.split("-")[0],S=B>j.right-j.width/2,E=q>j.bottom-j.height/2,b=Uc(T,C),g=j.width>C.width,u=j.height>C.height,w=(g?C:j).left,s=(g?C:j).right,z0=(u?C:j).top,h=(u?C:j).bottom;if(I){if(H=!0,!x)return}if(y)H=!1;if(y&&!x){H=!0;return}if(x&&V5(A.relatedTarget)&&x0(F.floating,A.relatedTarget))return;if(V&&w2(V.nodesRef.current,L).some(({context:d})=>d?.open))return;if(R==="top"&&q>=C.bottom-1||R==="bottom"&&q<=C.top+1||R==="left"&&B>=C.right-1||R==="right"&&B<=C.left+1)return O();let t=[];switch(R){case"top":t=[[w,C.top+1],[w,j.bottom-1],[s,j.bottom-1],[s,C.top+1]];break;case"bottom":t=[[w,j.top+1],[w,C.bottom-1],[s,C.bottom-1],[s,j.top+1]];break;case"left":t=[[j.right-1,h],[j.right-1,z0],[C.left+1,z0],[C.left+1,h]];break;case"right":t=[[C.right-1,h],[C.right-1,z0],[j.left+1,z0],[j.left+1,h]];break;default:}function M0([d,Y0]){switch(R){case"top":{let B0=[g?d+Z/2:S?d+Z*4:d-Z*4,Y0+Z+1],J0=[g?d-Z/2:S?d+Z*4:d-Z*4,Y0+Z+1],H0=[[j.left,S?j.bottom-Z:g?j.bottom-Z:j.top],[j.right,S?g?j.bottom-Z:j.top:j.bottom-Z]];return[B0,J0,...H0]}case"bottom":{let B0=[g?d+Z/2:S?d+Z*4:d-Z*4,Y0-Z],J0=[g?d-Z/2:S?d+Z*4:d-Z*4,Y0-Z],H0=[[j.left,S?j.top+Z:g?j.top+Z:j.bottom],[j.right,S?g?j.top+Z:j.bottom:j.top+Z]];return[B0,J0,...H0]}case"left":{let B0=[d+Z+1,u?Y0+Z/2:E?Y0+Z*4:Y0-Z*4],J0=[d+Z+1,u?Y0-Z/2:E?Y0+Z*4:Y0-Z*4];return[...[[E?j.right-Z:u?j.right-Z:j.left,j.top],[E?u?j.right-Z:j.left:j.right-Z,j.bottom]],B0,J0]}case"right":{let B0=[d-Z,u?Y0+Z/2:E?Y0+Z*4:Y0-Z*4],J0=[d-Z,u?Y0-Z/2:E?Y0+Z*4:Y0-Z*4],H0=[[E?j.left+Z:u?j.left+Z:j.right,j.top],[E?u?j.left+Z:j.right:j.left+Z,j.bottom]];return[B0,J0,...H0]}default:return[]}}if(FD([_,D],t))return;if(H&&!b)return O();if(!x&&Q){let d=K(A.clientX,A.clientY),Y0=0.1;if(d!==null&&d<0.1)return O()}if(!FD([_,D],M0([B,q])))O();else if(!H&&Q)X.start(40,O);return}};return W.__options={blockPointerEvents:J},W}var VD=P(l(),1),IH=EH.forwardRef(function(Z,J){let{children:Q,container:X,className:H,render:G,...z}=Z,{portalNode:Y,portalSubtree:K}=DH({container:X,ref:J,componentProps:Z,elementProps:z});if(!K&&!Y)return null;return VD.jsxs(EH.Fragment,{children:[K,Y&&ND.createPortal(Q,Y)]})});var LD=IH;var i9=P(v(),1);var F4=P(v(),1);var RH=P(v(),1),Fc=RH.createContext(void 0);function x4(){return RH.useContext(Fc)?.direction??"ltr"}var Nc=($)=>({name:"arrow",options:$,async fn(Z){let{x:J,y:Q,placement:X,rects:H,platform:G,elements:z,middlewareData:Y}=Z,{element:K,padding:W=0,offsetParent:B="real"}=AD($,Z)||{};if(K==null)return{};let q=OD(W),U={x:J,y:Q},F=_D(X),N=DD(F),L=await G.getDimensions(K),V=F==="y",M=V?"top":"left",A=V?"bottom":"right",O=V?"clientHeight":"clientWidth",_=H.reference[N]+H.reference[F]-U[F]-H.floating[N],D=U[F]-H.reference[F],T=B==="real"?await G.getOffsetParent?.(K):z.floating,k=z.floating[O]||H.floating[N];if(!k||!await G.isElement?.(T))k=z.floating[O]||H.floating[N];let x=_/2-D/2,I=k/2-L[N]/2-1,y=Math.min(q[M],I),C=Math.min(q[A],I),j=y,R=k-L[N]-C,S=k/2-L[N]/2+x,E=MD(j,S,R),b=!Y.arrow&&tZ(X)!=null&&S!==E&&H.reference[N]/2-(S<j?y:C)-L[N]/2<0,g=b?S<j?S-j:S-R:0;return{[F]:U[F]+g,data:{[F]:E,centerOffset:S-E-g,...b&&{alignmentOffset:g}},reset:b}}}),PD=($,Z)=>({...Nc($),options:[$,Z]});var wD={name:"hide",async fn($){let{width:Z,height:J,x:Q,y:X}=$.rects.reference,H=Z===0&&J===0&&Q===0&&X===0;return{data:{referenceHidden:(await nB().fn($)).data?.referenceHidden||H}}}};var eZ={sideX:"left",sideY:"top"},kH={name:"adaptiveOrigin",async fn($){let{x:Z,y:J,rects:{floating:Q},elements:{floating:X},platform:H,strategy:G,placement:z}=$,Y=O8(X),K=Y.getComputedStyle(X);if(!(K.transitionDuration!=="0s"&&K.transitionDuration!==""))return{x:Z,y:J,data:eZ};let B=await H.getOffsetParent?.(X),q={width:0,height:0};if(G==="fixed"&&Y?.visualViewport)q={width:Y.visualViewport.width,height:Y.visualViewport.height};else if(B===Y){let M=g0(X);q={width:M.documentElement.clientWidth,height:M.documentElement.clientHeight}}else if(await H.isElement?.(B))q=await H.getDimensions(B);let U=F3(z),F=Z,N=J;if(U==="left")F=q.width-(Z+Q.width);if(U==="top")N=q.height-(J+Q.height);let L=U==="left"?"right":eZ.sideX,V=U==="top"?"bottom":eZ.sideY;return{x:F,y:N,data:{sideX:L,sideY:V}}}};function TD($,Z,J){let Q=$==="inline-start"||$==="inline-end";return{top:"top",right:Q?J?"inline-start":"inline-end":"right",bottom:"bottom",left:Q?J?"inline-end":"inline-start":"left"}[Z]}function jD($,Z,J){let{rects:Q,placement:X}=$;return{side:TD(Z,F3(X),J),align:tZ(X)||"center",anchor:{width:Q.reference.width,height:Q.reference.height},positioner:{width:Q.floating.width,height:Q.floating.height}}}function d9($){let{anchor:Z,positionMethod:J="absolute",side:Q="bottom",sideOffset:X=0,align:H="center",alignOffset:G=0,collisionBoundary:z,collisionPadding:Y=5,sticky:K=!1,arrowPadding:W=5,disableAnchorTracking:B=!1,keepMounted:q=!1,floatingRootContext:U,mounted:F,collisionAvoidance:N,shiftCrossAxis:L=!1,nodeId:V,adaptiveOrigin:M,lazyFlip:A=!1,externalTree:O}=$,[_,D]=F4.useState(null);if(!F&&_!==null)D(null);let T=N.side||"flip",k=N.align||"flip",x=N.fallbackAxisSide||"end",I=typeof Z==="function"?Z:void 0,y=K0(I),C=I?y:Z,j=V1(Z),S=x4()==="rtl",E=_||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":S?"left":"right","inline-start":S?"right":"left"}[Q],b=H==="center"?E:`${E}-${H}`,g=Y,u=1,w=Q==="bottom"?u:0,s=Q==="top"?u:0,z0=Q==="right"?u:0,h=Q==="left"?u:0;if(typeof g==="number")g={top:g+w,right:g+h,bottom:g+s,left:g+z0};else if(g)g={top:(g.top||0)+w,right:(g.right||0)+h,bottom:(g.bottom||0)+s,left:(g.left||0)+z0};let t={boundary:z==="clipping-ancestors"?"clippingAncestors":z,padding:g},M0=F4.useRef(null),d=V1(X),Y0=V1(G),H0=[dB((h0)=>{let a0=jD(h0,Q,S),n5=typeof d.current==="function"?d.current(a0):d.current,j5=typeof Y0.current==="function"?Y0.current(a0):Y0.current;return{mainAxis:n5,crossAxis:j5,alignmentAxis:j5}},[typeof X!=="function"?X:0,typeof G!=="function"?G:0,S,Q])],N0=k==="none"&&T!=="shift",c=!N0&&(K||L||T==="shift"),Z0=T==="none"?null:rB({...t,padding:{top:g.top+u,right:g.right+u,bottom:g.bottom+u,left:g.left+u},mainAxis:!L&&T==="flip",crossAxis:k==="flip"?"alignment":!1,fallbackAxisSideDirection:x}),$0=N0?null:lB((h0)=>{let a0=g0(h0.elements.floating).documentElement;return{...t,rootBoundary:L?{x:0,y:0,width:a0.clientWidth,height:a0.clientHeight}:void 0,mainAxis:k!=="none",crossAxis:c,limiter:K||L?void 0:iB((n5)=>{if(!M0.current)return{};let{width:j5,height:R1}=M0.current.getBoundingClientRect(),T0=sB(F3(n5.placement)),b0=T0==="y"?j5:R1,p0=T0==="y"?g.left+g.right:g.top+g.bottom;return{offset:b0/2+p0/2}})}},[t,K,L,g,k]);if(T==="shift"||k==="shift"||H==="center")H0.push($0,Z0);else H0.push(Z0,$0);H0.push(aB({...t,apply({elements:{floating:h0},rects:{reference:a0},availableWidth:n5,availableHeight:j5}){let R1=h0.style;R1.setProperty("--available-width",`${n5}px`),R1.setProperty("--available-height",`${j5}px`),R1.setProperty("--anchor-width",`${a0.width}px`),R1.setProperty("--anchor-height",`${a0.height}px`)}}),PD(()=>({element:M0.current||document.createElement("div"),padding:W,offsetParent:"floating"}),[W]),{name:"transformOrigin",fn(h0){let{elements:a0,middlewareData:n5,placement:j5,rects:R1,y:T0}=h0,b0=F3(j5),p0=sB(b0),$5=M0.current,K5=n5.arrow?.x||0,O5=n5.arrow?.y||0,m5=$5?.clientWidth||0,u5=$5?.clientHeight||0,W5=K5+m5/2,K1=O5+u5/2,k1=Math.abs(n5.shift?.y||0),x1=R1.reference.height/2,y0=typeof X==="function"?X(jD(h0,Q,S)):X,t0=k1>y0,u0={top:`${W5}px calc(100% + ${y0}px)`,bottom:`${W5}px ${-y0}px`,left:`calc(100% + ${y0}px) ${K1}px`,right:`${-y0}px ${K1}px`}[b0],G5=`${W5}px ${R1.reference.y+x1-T0}px`;return a0.floating.style.setProperty("--transform-origin",c&&p0==="y"&&t0?G5:u0),{}}},wD,M),W0(()=>{if(!F&&U)U.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[F,U]);let G0=F4.useMemo(()=>({elementResize:!B&&typeof ResizeObserver<"u",layoutShift:!B&&typeof IntersectionObserver<"u"}),[B]),{refs:r,elements:Q0,x:a,y:p,middlewareData:o,update:n,placement:V0,context:w0,isPositioned:v0,floatingStyles:c0}=gB({rootContext:U,placement:b,middleware:H0,strategy:J,whileElementsMounted:q?void 0:(...h0)=>TH(...h0,G0),nodeId:V,externalTree:O}),{sideX:m,sideY:i}=o.adaptiveOrigin||eZ,f=v0?J:"fixed",X0=F4.useMemo(()=>{let h0=M?{position:f,[m]:a,[i]:p}:{position:f,...c0};if(!v0)h0.opacity=0;return h0},[M,f,m,a,i,p,c0,v0]),L0=F4.useRef(null);W0(()=>{if(!F)return;let h0=j.current,a0=typeof h0==="function"?h0():h0,j5=(CD(a0)?a0.current:a0)||null||null;if(j5!==L0.current)r.setPositionReference(j5),L0.current=j5},[F,r,C,j]),F4.useEffect(()=>{if(!F)return;let h0=j.current;if(typeof h0==="function")return;if(CD(h0)&&h0.current!==L0.current)r.setPositionReference(h0.current),L0.current=h0.current},[F,r,C,j]),F4.useEffect(()=>{if(q&&F&&Q0.domReference&&Q0.floating)return TH(Q0.domReference,Q0.floating,n,G0);return},[q,F,Q0,n,G0]);let k0=F3(V0),r0=TD(Q,k0,S),J5=tZ(V0)||"center",m0=Boolean(o.hide?.referenceHidden);W0(()=>{if(A&&F&&v0)D(k0)},[A,F,v0,k0]);let P0=F4.useMemo(()=>({position:"absolute",top:o.arrow?.y,left:o.arrow?.x}),[o.arrow]),f0=o.arrow?.centerOffset!==0;return F4.useMemo(()=>({positionerStyles:X0,arrowStyles:P0,arrowRef:M0,arrowUncentered:f0,side:r0,align:J5,physicalSide:k0,anchorHidden:m0,refs:r,context:w0,isPositioned:v0,update:n}),[X0,P0,M0,f0,r0,J5,k0,m0,r,w0,v0,n])}function CD($){return $!=null&&"current"in $}var N4=function($){return $.open="data-open",$.closed="data-closed",$[$.startingStyle=T2.startingStyle]="startingStyle",$[$.endingStyle=T2.endingStyle]="endingStyle",$.anchorHidden="data-anchor-hidden",$.side="data-side",$.align="data-align",$}({}),$J=function($){return $.popupOpen="data-popup-open",$.pressed="data-pressed",$}({}),Vc={[$J.popupOpen]:""},Lc={[$J.popupOpen]:"",[$J.pressed]:""},Mc={[N4.open]:""},Ac={[N4.closed]:""},Dc={[N4.anchorHidden]:""},l9={open($){if($)return Vc;return null}},ZJ={open($){if($)return Lc;return null}},x5={open($){if($)return Mc;return Ac},anchorHidden($){if($)return Dc;return null}};function o8($){return $==="starting"?ED:_5}var SH=P(v(),1),oB=SH.createContext(void 0);function ID(){let $=SH.useContext(oB);if($===void 0)throw Error(I0(84));return $}var RD=P(l(),1),kD=i9.forwardRef(function(Z,J){let{toast:Q,...X}=Z,H=I9(),G=Q.positionerProps??_5,{render:z,className:Y,anchor:K=G.anchor,positionMethod:W=G.positionMethod??"absolute",side:B=G.side??"top",align:q=G.align??"center",sideOffset:U=G.sideOffset??0,alignOffset:F=G.alignOffset??0,collisionBoundary:N=G.collisionBoundary??"clipping-ancestors",collisionPadding:L=G.collisionPadding??5,arrowPadding:V=G.arrowPadding??5,sticky:M=G.sticky??!1,disableAnchorTracking:A=G.disableAnchorTracking??!1,collisionAvoidance:O=G.collisionAvoidance??r9,..._}=X,[D,T]=i9.useState(null),k=H.useState("toastIndex",Q.id),x=H.useState("toastVisibleIndex",Q.id),I=V5(K)?K:null,y=nZ({open:!0,onOpenChange:y5,elements:{floating:D,reference:I}}),C=d9({anchor:I,positionMethod:W,floatingRootContext:y,mounted:!0,side:B,sideOffset:U,align:q,alignOffset:F,collisionBoundary:N,collisionPadding:L,sticky:M,arrowPadding:V,disableAnchorTracking:A,keepMounted:!0,collisionAvoidance:O}),j=i9.useMemo(()=>{let b={};return{role:"presentation",style:{...C.positionerStyles,...b,[I2.index]:Q.transitionStatus==="ending"?k:x}}},[C.positionerStyles,Q.transitionStatus,k,x]),R=i9.useMemo(()=>({side:C.side,align:C.align,anchorHidden:C.anchorHidden}),[C.side,C.align,C.anchorHidden]),S=i9.useMemo(()=>({...R,arrowRef:C.arrowRef,arrowStyles:C.arrowStyles,arrowUncentered:C.arrowUncentered}),[R,C.arrowRef,C.arrowStyles,C.arrowUncentered]),E=U0("div",Z,{state:R,props:[j,o8(Q.transitionStatus),_],ref:[J,T],stateAttributesMapping:x5});return RD.jsx(oB.Provider,{value:S,children:E})});var SD=P(v(),1);var bD=SD.forwardRef(function(Z,J){let{className:Q,render:X,...H}=Z,{arrowRef:G,side:z,align:Y,arrowUncentered:K,arrowStyles:W}=ID();return U0("div",Z,{state:{side:z,align:Y,uncentered:K},ref:[J,G],props:[{style:W,"aria-hidden":!0},H]})});var bH=P(v(),1);function yD(){let $=bH.useContext(yZ);if(!$)throw Error(I0(73));let Z=$.useState("toasts");return bH.useMemo(()=>({toasts:Z,add:$.addToast,close:$.closeToast,update:$.updateToast,promise:$.promiseToast}),[Z,$])}function xD(){let $=new Set;function Z(J){$.forEach((Q)=>Q(J))}return{" subscribe":function(Q){return $.add(Q),()=>{$.delete(Q)}},add(J){let Q=J.id||pX("toast"),X={...J,id:Q,transitionStatus:"starting"};return Z({action:"add",options:X}),Q},close(J){Z({action:"close",options:{id:J}})},update(J,Q){Z({action:"update",options:{...Q,id:J}})},promise(J,Q){let X=J;return Z({action:"promise",options:{...Q,promise:J,setPromise(H){X=H}}}),X}}}var E5=P(l(),1),S7=C8.createToastManager();function _c({...$}){return E5.jsx(C8.Provider,{...$})}function Oc({...$}){return E5.jsx(C8.Portal,{"data-slot":"toast-portal",...$})}function Pc({className:$,...Z}){return E5.jsx(C8.Viewport,{"data-slot":"toast-viewport",className:e("pointer-events-none fixed inset-x-4 bottom-4 z-50 mx-auto w-auto max-w-sm outline-none sm:right-4 sm:left-auto sm:mx-0 sm:w-full",$),...Z})}function wc({className:$,...Z}){return E5.jsx(C8.Root,{"data-slot":"toast",className:e("group/toast pointer-events-auto absolute right-0 bottom-0 z-[calc(1000-var(--toast-index))] w-full origin-bottom rounded-2xl border bg-popover text-popover-foreground shadow-lg will-change-transform outline-none select-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","[--gap:0.75rem] [--height:var(--toast-frontmost-height,var(--toast-height))] [--offset-y:calc(var(--toast-offset-y)*-1+calc(var(--toast-index)*var(--gap)*-1)+var(--toast-swipe-movement-y))] [--peek:0.75rem] [--scale:calc(max(0,1-(var(--toast-index)*0.1)))] [--shrink:calc(1-var(--scale))]","h-(--height) [transform:translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)-(var(--toast-index)*var(--peek))-(var(--shrink)*var(--height))))_scale(var(--scale))] [transition:transform_500ms_cubic-bezier(0.22,1,0.36,1),opacity_500ms,height_150ms]","after:absolute after:top-full after:left-0 after:h-[calc(var(--gap)+1px)] after:w-full after:content-['']","data-expanded:h-(--toast-height) data-expanded:[transform:translateX(var(--toast-swipe-movement-x))_translateY(var(--offset-y))]","data-limited:opacity-0 data-starting-style:[transform:translateY(150%)]","[&[data-ending-style]:not([data-limited]):not([data-swipe-direction])]:[transform:translateY(150%)]","data-ending-style:data-[swipe-direction=down]:[transform:translateY(calc(var(--toast-swipe-movement-y)+150%))]","data-ending-style:data-[swipe-direction=left]:[transform:translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))]","data-ending-style:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))]","data-ending-style:data-[swipe-direction=up]:[transform:translateY(calc(var(--toast-swipe-movement-y)-150%))]","data-expanded:data-ending-style:data-[swipe-direction=down]:[transform:translateY(calc(var(--toast-swipe-movement-y)+150%))]","data-expanded:data-ending-style:data-[swipe-direction=left]:[transform:translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))]","data-expanded:data-ending-style:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))]","data-expanded:data-ending-style:data-[swipe-direction=up]:[transform:translateY(calc(var(--toast-swipe-movement-y)-150%))]",$),...Z})}function jc({className:$,...Z}){return E5.jsx(C8.Content,{"data-slot":"toast-content",className:e("flex h-full items-center gap-3 overflow-hidden p-4 transition-opacity duration-250 ease-[cubic-bezier(0.22,1,0.36,1)] data-behind:opacity-0 data-expanded:opacity-100",$),...Z})}function Cc({className:$,...Z}){return E5.jsx(C8.Title,{"data-slot":"toast-title",className:e("text-sm font-medium",$),...Z})}function Tc({className:$,...Z}){return E5.jsx(C8.Description,{"data-slot":"toast-description",className:e("text-sm text-muted-foreground",$),...Z})}function Ec({className:$,render:Z=E5.jsx(E0,{variant:"outline",size:"sm"}),...J}){return E5.jsx(C8.Action,{"data-slot":"toast-action",render:Z,className:e("shrink-0",$),...J})}function Ic({className:$,children:Z,render:J=E5.jsx(E0,{variant:"ghost",size:"icon-sm"}),...Q}){return E5.jsx(C8.Close,{"data-slot":"toast-close","aria-label":"Close toast",render:J,className:e("relative shrink-0 text-muted-foreground after:absolute after:-inset-2 after:content-[''] hover:text-foreground",$),...Q,children:Z??E5.jsx(Q8,{"aria-hidden":"true",stroke:1.75})})}function Rc({type:$}){let Z=null;if($==="success")Z=E5.jsx(gD,{"aria-hidden":"true",stroke:1.75});if($==="info")Z=E5.jsx(vD,{"aria-hidden":"true",stroke:1.75});if($==="warning")Z=E5.jsx(yH,{"aria-hidden":"true",stroke:1.75});if($==="error")Z=E5.jsx(hD,{className:"text-destructive","aria-hidden":"true",stroke:1.75});if($==="loading")Z=E5.jsx(fD,{className:"animate-spin","aria-hidden":"true",stroke:1.75});if(!Z)return null;return E5.jsx("span",{"data-slot":"toast-icon",className:"shrink-0 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",children:Z})}function kc(){let{toasts:$}=C8.useToastManager();return $.map((Z)=>E5.jsx(wc,{toast:Z,children:E5.jsxs(jc,{children:[E5.jsx(Rc,{type:Z.type}),E5.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[E5.jsx(Cc,{}),E5.jsx(Tc,{})]}),E5.jsx(Ec,{}),E5.jsx(Ic,{})]})},Z.id))}function mD({children:$,toastManager:Z=S7,...J}){return E5.jsxs(_c,{toastManager:Z,...J,children:[$,E5.jsx(Oc,{children:E5.jsx(Pc,{children:E5.jsx(kc,{})})})]})}var hW0=C8.createToastManager,gW0=C8.useToastManager;var W9={};S4(W9,{createHandle:()=>N_,Viewport:()=>F_,Trigger:()=>sD,Root:()=>lD,Provider:()=>G_,Positioner:()=>Z_,Portal:()=>eD,Popup:()=>Q_,Handle:()=>pH,Arrow:()=>H_});var k2=P(v(),1);var uD=P(v(),1);function a9($){let Z=uD.useRef(!0);if(Z.current)Z.current=!1,$()}var xH=P(v(),1),tB=xH.createContext(void 0);function h4($){let Z=xH.useContext(tB);if(Z===void 0&&!$)throw Error(I0(72));return Z}var pD=P(v(),1),cD=P(W4(),1);var Sc={...u9,disabled:C0(($)=>$.disabled),instantType:C0(($)=>$.instantType),isInstantPhase:C0(($)=>$.isInstantPhase),trackCursorAxis:C0(($)=>$.trackCursorAxis),disableHoverablePopup:C0(($)=>$.disableHoverablePopup),lastOpenChangeReason:C0(($)=>$.openChangeReason),closeDelay:C0(($)=>$.closeDelay),hasViewport:C0(($)=>$.hasViewport)};class b7 extends K4{constructor($){super({...bc(),...$},{popupRef:pD.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new U4},Sc)}setOpen=($,Z)=>{let J=Z.reason,Q=J===q0.triggerHover,X=$&&J===q0.triggerFocus,H=!$&&(J===q0.triggerPress||J===q0.escapeKey);if(Z.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.($,Z),Z.isCanceled)return;let G=()=>{let z={open:$,openChangeReason:J};if(X)z.instantType="focus";else if(H)z.instantType="dismiss";else if(J===q0.triggerHover)z.instantType=void 0;let Y=Z.trigger?.id??null;if(Y||$)z.activeTriggerId=Y,z.activeTriggerElement=Z.trigger??null;this.update(z)};if(Q)cD.flushSync(G);else G()};static useStore($,Z){let J=P5(()=>{return new b7(Z)}).current,Q=$??J,X=z9({popupStore:Q,onOpenChange:Q.setOpen});return Q.state.floatingRootContext=X,Q}}function bc(){return{...m9(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeDelay:0,hasViewport:!1}}var dD=P(l(),1),lD=hZ(function(Z){let{disabled:J=!1,defaultOpen:Q=!1,open:X,disableHoverablePopup:H=!1,trackCursorAxis:G="none",actionsRef:z,onOpenChange:Y,onOpenChangeComplete:K,handle:W,triggerId:B,defaultTriggerId:q=null,children:U}=Z,F=b7.useStore(W?.store,{open:Q,openProp:X,activeTriggerId:q,triggerIdProp:B});a9(()=>{if(X===void 0&&F.state.open===!1&&Q===!0)F.update({open:!0,activeTriggerId:q})}),F.useControlledProp("openProp",X),F.useControlledProp("triggerIdProp",B),F.useContextCallback("onOpenChange",Y),F.useContextCallback("onOpenChangeComplete",K);let N=F.useState("open"),L=!J&&N,V=F.useState("activeTriggerId"),M=F.useState("payload");F.useSyncedValues({trackCursorAxis:G,disableHoverablePopup:H}),W0(()=>{if(N&&J)F.setOpen(!1,O0(q0.disabled))},[N,J,F]),F.useSyncedValue("disabled",J),v9(F);let{forceUnmount:A,transitionStatus:O}=f9(L,F),_=F.useState("isInstantPhase"),D=F.useState("instantType"),T=F.useState("lastOpenChangeReason"),k=k2.useRef(null);W0(()=>{if(O==="ending"&&T===q0.none||O!=="ending"&&_){if(D!=="delay")k.current=D;F.set("instantType","delay")}else if(k.current!==null)F.set("instantType",k.current),k.current=null},[O,_,T,D,F]),W0(()=>{if(L){if(V==null)F.set("payload",void 0)}},[F,V,L]);let x=k2.useCallback(()=>{F.setOpen(!1,yc(F,q0.imperativeAction))},[F]);k2.useImperativeHandle(z,()=>({unmount:A,close:x}),[A,x]);let I=F.useState("floatingRootContext"),y=G9(I,{enabled:!J,referencePress:!0}),C=xB(I,{enabled:!J&&G!=="none",axis:G==="none"?void 0:G}),{getReferenceProps:j,getFloatingProps:R,getTriggerProps:S}=F8([y,C]),E=k2.useMemo(()=>j(),[j]),b=k2.useMemo(()=>S(),[S]),g=k2.useMemo(()=>R(),[R]);return F.useSyncedValues({activeTriggerProps:E,inactiveTriggerProps:b,popupProps:g}),dD.jsx(tB.Provider,{value:F,children:typeof U==="function"?U({payload:M}):U})});function yc($,Z){let J=O0(Z);return J.preventUnmountOnClose=()=>{$.set("preventUnmountingOnClose",!0)},J}var nD=P(v(),1);function e0($){return J8($,"base-ui")}var hH=P(v(),1),eB=hH.createContext(void 0);function iD(){return hH.useContext(eB)}var rD=function($){return $[$.popupOpen=$J.popupOpen]="popupOpen",$.triggerDisabled="data-trigger-disabled",$}({});var aD=600;var sD=gX(function(Z,J){let{className:Q,render:X,handle:H,payload:G,disabled:z,delay:Y,closeDelay:K,id:W,...B}=Z,q=h4(!0),U=H?.store??q;if(!U)throw Error(I0(82));let F=e0(W),N=U.useState("isTriggerActive",F),L=U.useState("isOpenedByTrigger",F),V=U.useState("floatingRootContext"),M=nD.useRef(null),A=Y??aD,O=K??0,{registerTrigger:_,isMountedByThisTrigger:D}=g9(F,M,U,{payload:G,closeDelay:O}),T=iD(),{delayRef:k,isInstantPhase:x,hasProvider:I}=IB(V,{open:L});U.useSyncedValue("isInstantPhase",x);let y=U.useState("disabled"),C=z??y,j=U.useState("trackCursorAxis"),R=U.useState("disableHoverablePopup"),S=Y9(V,{enabled:!C,mouseOnly:!0,move:!1,handleClose:!R&&j!=="both"?K9():null,restMs(){let w=T?.delay,s=typeof k.current==="object"?k.current.open:void 0,z0=A;if(I)if(s!==0)z0=Y??w??A;else z0=0;return z0},delay(){let w=typeof k.current==="object"?k.current.close:void 0,s=O;if(K==null&&I)s=w;return{close:s}},triggerElementRef:M,isActiveTrigger:N}),E=sZ(V,{enabled:!C}).reference,b={open:L},g=U.useState("triggerProps",D);return U0("button",Z,{state:b,ref:[J,_,M],props:[S,E,g,{id:F,[rD.triggerDisabled]:C?"":void 0},B],stateAttributesMapping:l9})});var tD=P(v(),1);var gH=P(v(),1),$q=gH.createContext(void 0);function oD(){let $=gH.useContext($q);if($===void 0)throw Error(I0(70));return $}var Zq=P(l(),1),eD=tD.forwardRef(function(Z,J){let{keepMounted:Q=!1,...X}=Z;if(!(h4().useState("mounted")||Q))return null;return Zq.jsx($q.Provider,{value:Q,children:Zq.jsx(IH,{ref:J,...X})})});var x7=P(v(),1);var vH=P(v(),1),Jq=vH.createContext(void 0);function y7(){let $=vH.useContext(Jq);if($===void 0)throw Error(I0(71));return $}var $_=P(l(),1),Z_=x7.forwardRef(function(Z,J){let{render:Q,className:X,anchor:H,positionMethod:G="absolute",side:z="top",align:Y="center",sideOffset:K=0,alignOffset:W=0,collisionBoundary:B="clipping-ancestors",collisionPadding:q=5,arrowPadding:U=5,sticky:F=!1,disableAnchorTracking:N=!1,collisionAvoidance:L=r9,...V}=Z,M=h4(),A=oD(),O=M.useState("open"),_=M.useState("mounted"),D=M.useState("trackCursorAxis"),T=M.useState("disableHoverablePopup"),k=M.useState("floatingRootContext"),x=M.useState("instantType"),I=M.useState("transitionStatus"),y=M.useState("hasViewport"),C=d9({anchor:H,positionMethod:G,floatingRootContext:k,mounted:_,side:z,sideOffset:K,align:Y,alignOffset:W,collisionBoundary:B,collisionPadding:q,sticky:F,arrowPadding:U,disableAnchorTracking:N,keepMounted:A,collisionAvoidance:L,adaptiveOrigin:y?kH:void 0}),j=x7.useMemo(()=>{let b={};if(!O||D==="both"||T)b.pointerEvents="none";return{role:"presentation",hidden:!_,style:{...C.positionerStyles,...b}}},[O,D,T,_,C.positionerStyles]),R=x7.useMemo(()=>({open:O,side:C.side,align:C.align,anchorHidden:C.anchorHidden,instant:D!=="none"?"tracking-cursor":x}),[O,C.side,C.align,C.anchorHidden,D,x]),S=x7.useMemo(()=>({...R,arrowRef:C.arrowRef,arrowStyles:C.arrowStyles,arrowUncentered:C.arrowUncentered}),[R,C.arrowRef,C.arrowStyles,C.arrowUncentered]),E=U0("div",Z,{state:R,props:[j,o8(I),V],ref:[J,M.useStateSetter("positionerElement")],stateAttributesMapping:x5});return $_.jsx(Jq.Provider,{value:S,children:E})});var J_=P(v(),1);var xc={...x5,...s5},Q_=J_.forwardRef(function(Z,J){let{className:Q,render:X,...H}=Z,G=h4(),{side:z,align:Y}=y7(),K=G.useState("open"),W=G.useState("instantType"),B=G.useState("transitionStatus"),q=G.useState("popupProps"),U=G.useState("floatingRootContext");v1({open:K,ref:G.context.popupRef,onComplete(){if(K)G.context.onOpenChangeComplete?.(!0)}});let F=G.useState("disabled"),N=G.useState("closeDelay");return W3(U,{enabled:!F,closeDelay:N}),U0("div",Z,{state:{open:K,side:z,align:Y,instant:W,transitionStatus:B},ref:[J,G.context.popupRef,G.useStateSetter("popupElement")],props:[q,o8(B),H],stateAttributesMapping:xc})});var X_=P(v(),1);var H_=X_.forwardRef(function(Z,J){let{className:Q,render:X,...H}=Z,z=h4().useState("instantType"),{open:Y,arrowRef:K,side:W,align:B,arrowUncentered:q,arrowStyles:U}=y7();return U0("div",Z,{state:{open:Y,side:W,align:B,uncentered:q,instant:z},ref:[J,K],props:[{style:U,"aria-hidden":!0},H],stateAttributesMapping:x5})});var Qq=P(v(),1);var Xq=P(l(),1),G_=function(Z){let{delay:J,closeDelay:Q,timeout:X=400}=Z,H=Qq.useMemo(()=>({delay:J,closeDelay:Q}),[J,Q]),G=Qq.useMemo(()=>({open:J,close:Q}),[J,Q]);return Xq.jsx(eB.Provider,{value:H,children:Xq.jsx(EB,{delay:G,timeoutMs:X,children:Z.children})})};var U_=P(v(),1);var z_=function($){return $.popupWidth="--popup-width",$.popupHeight="--popup-height",$}({});var T8=P(v(),1);var Y_=P(v(),1);function K_($){let[Z,J]=Y_.useState({current:$,previous:null});if($!==Z.current)J({current:$,previous:Z.current});return Z.previous}var N3=P(v(),1);function Gq($){let Z=E7($),J=parseFloat(Z.width)||0,Q=parseFloat(Z.height)||0,X=U1($),H=X?$.offsetWidth:J,G=X?$.offsetHeight:Q;if(Hq(J)!==H||Hq(Q)!==G)J=H,Q=G;return{width:J,height:Q}}var hc=typeof ResizeObserver<"u",gc=()=>!0;function B_($){let{popupElement:Z,positionerElement:J,content:Q,mounted:X,enabled:H=gc,onMeasureLayout:G,onMeasureLayoutComplete:z,side:Y,direction:K}=$,W=E2(Z,!0,!1),B=n8(),q=N3.useRef(null),U=N3.useRef(null),F=N3.useRef(!0),N=N3.useRef(y5),L=K0(G),V=K0(z),M=N3.useMemo(()=>{let A=Y==="top",O=Y==="left";if(K==="rtl")A=A||Y==="inline-end",O=O||Y==="inline-end";else A=A||Y==="inline-start",O=O||Y==="inline-start";return A?{position:"absolute",[Y==="top"?"bottom":"top"]:"0",[O?"right":"left"]:"0"}:_5},[Y,K]);W0(()=>{if(!X||!H()||!hc){N.current=y5,F.current=!0,q.current=null,U.current=null;return}if(!Z||!J)return;N.current=W_(Z,M);let A=new ResizeObserver((j)=>{let R=j[0];if(R)U.current={width:Math.ceil(R.borderBoxSize[0].inlineSize),height:Math.ceil(R.borderBoxSize[0].blockSize)}});A.observe(Z),fH(Z,"auto");let O=mH(Z,"position","static"),_=mH(Z,"transform","none"),D=mH(Z,"scale","1"),T=W_(J,{"--available-width":"max-content","--available-height":"max-content"});function k(){O(),_(),T()}function x(){k(),D()}if(L?.(),F.current||q.current===null){JJ(J,"max-content");let j=Gq(Z);return q.current=j,JJ(J,j),x(),V?.(null,j),F.current=!1,()=>{A.disconnect(),N.current(),N.current=y5}}fH(Z,"auto"),JJ(J,"max-content");let I=q.current??U.current,y=Gq(Z);if(q.current=y,!I)return JJ(J,y),x(),V?.(null,y),()=>{A.disconnect(),B.cancel(),N.current(),N.current=y5};fH(Z,I),x(),V?.(I,y),JJ(J,y);let C=new AbortController;return B.request(()=>{fH(Z,y),W(()=>{Z.style.setProperty("--popup-width","auto"),Z.style.setProperty("--popup-height","auto")},C.signal)}),()=>{A.disconnect(),C.abort(),B.cancel(),N.current(),N.current=y5}},[Q,Z,J,W,B,H,X,L,V,M])}function mH($,Z,J){let Q=$.style.getPropertyValue(Z);return $.style.setProperty(Z,J),()=>{$.style.setProperty(Z,Q)}}function W_($,Z){let J=[];for(let[Q,X]of Object.entries(Z))J.push(mH($,Q,X));return J.length?()=>{J.forEach((Q)=>Q())}:y5}function fH($,Z){let J=Z==="auto"?"auto":`${Z.width}px`,Q=Z==="auto"?"auto":`${Z.height}px`;$.style.setProperty("--popup-width",J),$.style.setProperty("--popup-height",Q)}function JJ($,Z){let J=Z==="max-content"?"max-content":`${Z.width}px`,Q=Z==="max-content"?"max-content":`${Z.height}px`;$.style.setProperty("--positioner-width",J),$.style.setProperty("--positioner-height",Q)}var h7=P(l(),1);function uH($){let{store:Z,side:J,cssVars:Q,children:X}=$,H=x4(),G=Z.useState("activeTriggerElement"),z=Z.useState("activeTriggerId"),Y=Z.useState("open"),K=Z.useState("payload"),W=Z.useState("mounted"),B=Z.useState("popupElement"),q=Z.useState("positionerElement"),U=K_(Y?G:null),F=mc(z,K),N=T8.useRef(null),[L,V]=T8.useState(null),[M,A]=T8.useState(null),O=T8.useRef(null),_=T8.useRef(null),D=E2(O,!0,!1),T=n8(),[k,x]=T8.useState(null),[I,y]=T8.useState(!1);W0(()=>{return Z.set("hasViewport",!0),()=>{Z.set("hasViewport",!1)}},[Z]);let C=K0(()=>{O.current?.style.setProperty("animation","none"),O.current?.style.setProperty("transition","none"),_.current?.style.setProperty("display","none")}),j=K0((g)=>{if(O.current?.style.removeProperty("animation"),O.current?.style.removeProperty("transition"),_.current?.style.removeProperty("display"),g)x(g)}),R=T8.useRef(null);W0(()=>{if(G&&U&&G!==U&&R.current!==G&&N.current){V(N.current),y(!0);let g=fc(U,G);A(g),T.request(()=>{T.request(()=>{y(!1),D(()=>{V(null),x(null),N.current=null})})}),R.current=G}},[G,U,L,D,T]),W0(()=>{let g=O.current;if(!g)return;let u=document.createElement("div");for(let w of Array.from(g.childNodes))u.appendChild(w.cloneNode(!0));N.current=u});let S=L!=null,E;if(!S)E=h7.jsx("div",{"data-current":!0,ref:O,children:X},F);else E=h7.jsxs(T8.Fragment,{children:[h7.jsx("div",{"data-previous":!0,inert:j2(!0),ref:_,style:{[Q.popupWidth]:`${k?.width}px`,[Q.popupHeight]:`${k?.height}px`,position:"absolute"},"data-ending-style":I?void 0:""},"previous"),h7.jsx("div",{"data-current":!0,ref:O,"data-starting-style":I?"":void 0,children:X},F)]});W0(()=>{let g=_.current;if(!g||!L)return;g.replaceChildren(...Array.from(L.childNodes))},[L]),B_({popupElement:B,positionerElement:q,mounted:W,content:K,onMeasureLayout:C,onMeasureLayoutComplete:j,side:J,direction:H});let b={activationDirection:vc(M),transitioning:S};return{children:E,state:b}}function vc($){if(!$)return;return`${q_($.horizontal,5,"right","left")} ${q_($.vertical,5,"down","up")}`}function q_($,Z,J,Q){if($>Z)return J;if($<-Z)return Q;return""}function fc($,Z){let J=$.getBoundingClientRect(),Q=Z.getBoundingClientRect(),X={x:J.left+J.width/2,y:J.top+J.height/2},H={x:Q.left+Q.width/2,y:Q.top+Q.height/2};return{horizontal:H.x-X.x,vertical:H.y-X.y}}function mc($,Z){let[J,Q]=T8.useState(0),X=T8.useRef($),H=T8.useRef(Z),G=T8.useRef(!1);return W0(()=>{let z=X.current,Y=H.current,K=$!==z,W=Z!==Y;if(K)Q((B)=>B+1),G.current=!W;else if(G.current&&W)Q((B)=>B+1),G.current=!1;X.current=$,H.current=Z},[$,Z]),`${$??"current"}-${J}`}var uc={activationDirection:($)=>$?{"data-activation-direction":$}:null},F_=U_.forwardRef(function(Z,J){let{render:Q,className:X,children:H,...G}=Z,z=h4(),Y=y7(),K=z.useState("instantType"),{children:W,state:B}=uH({store:z,side:Y.side,cssVars:z_,children:H}),q={activationDirection:B.activationDirection,transitioning:B.transitioning,instant:K};return U0("div",Z,{state:q,ref:J,props:[G,{children:W}],stateAttributesMapping:uc})});class pH{constructor(){this.store=new b7}open($){let Z=$?this.store.context.triggerElements.getById($):void 0;if($&&!Z)throw Error(I0(81,$));this.store.setOpen(!0,O0(q0.imperativeAction,void 0,Z))}close(){this.store.setOpen(!1,O0(q0.imperativeAction,void 0,void 0))}get isOpen(){return this.store.state.open}}function N_(){return new pH}var V3=P(l(),1);function V_({delay:$=100,...Z}){return V3.jsx(W9.Provider,{"data-slot":"tooltip-provider",delay:$,...Z})}function r1({...$}){return V3.jsx(W9.Root,{"data-slot":"tooltip",...$})}function a1({...$}){return V3.jsx(W9.Trigger,{"data-slot":"tooltip-trigger",...$})}function n1({className:$,side:Z="top",sideOffset:J=6,align:Q="center",alignOffset:X=0,children:H,...G}){return V3.jsx(W9.Portal,{children:V3.jsx(W9.Positioner,{align:Q,alignOffset:X,side:Z,sideOffset:J,className:"isolate z-50",children:V3.jsx(W9.Popup,{"data-slot":"tooltip-content",className:e("z-50 flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-lg bg-popover px-2.5 py-1.5 text-xs font-medium text-popover-foreground shadow-md has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-lg data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",$),...G,children:H})})})}function cH({cooldownMs:$,windowMs:Z,maxPerWindow:J,maxKeys:Q=256,now:X=Date.now}){let H=new Map,G=0,z=0;return{admit(Y){let K=X(),W=H.get(Y);if(W!==void 0&&K-W<$)return"cooldown";if(K-G>=Z)G=K,z=0;if(z>=J)return"window";if(z++,H.set(Y,K),H.size>Q)for(let B of[...H.keys()].slice(0,Math.ceil(Q/2)))H.delete(B);return"ok"}}}var pc=cH({cooldownMs:5000,windowMs:60000,maxPerWindow:30});function Q2($,Z){let J=[$,Z.source,Z.kind,Z.name,Z.message].join("\x00");if(pc.admit(J)!=="ok")return;fetch(`/api/workspaces/${$}/applet-log`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({events:[Z]})}).catch(()=>{})}var cc=/\/api\/workspaces\/([^/\s)]+)\/(widgets|views)\/([^/\s)]+)\//;function L_($){if(!$)return null;let Z=cc.exec($);if(!Z)return null;return{workspaceId:Z[1],kind:Z[2]==="widgets"?"widget":"view",name:Z[3]}}var M_=!1;function A_(){if(M_)return;M_=!0;let $=(Z,J,Q)=>{let X=J instanceof Error?J:null,H=X?.stack??"",G=Z??L_(H);if(!G)return;Q2(G.workspaceId,{source:"window",kind:G.kind,name:G.name,message:X?.message||Q||String(J),...H?{stack:H}:{}})};window.addEventListener("error",(Z)=>$(L_(Z.filename),Z.error,Z.message)),window.addEventListener("unhandledrejection",(Z)=>$(null,Z.reason))}function n9($,Z){return`${$}:${Z}`}function QJ($){return $==="running"}function dH($,Z,J){return QJ($[n9(Z,J)])}function O_($,Z){let J=`${Z}:`;return Object.entries($).some(([Q,X])=>Q.startsWith(J)&&QJ(X))}function P_($,Z,J){if(!J)return!1;let Q=`${Z}:`,X=n9(Z,J);return Object.entries($).some(([H,G])=>H.startsWith(Q)&&H!==X&&QJ(G))}function S2($,Z){return n9($,Z??"new")}var M1=D_()(($)=>({activity:{},errors:{},previews:{},attachments:{},setActivity:(Z,J,Q)=>$((X)=>({activity:{...X.activity,[n9(Z,J)]:Q}})),reconcileActivity:(Z)=>$(()=>({activity:Object.fromEntries(Z.map((J)=>[n9(J.workspaceId,J.sessionId),J.activity]))})),setError:(Z,J,Q)=>$((X)=>({errors:{...X.errors,[n9(Z,J)]:Q}})),setPreview:(Z)=>$((J)=>({previews:{...J.previews,[Z.messageId]:{workspaceId:Z.workspaceId,sessionId:Z.sessionId,parentToolUseId:Z.parentToolUseId,blocks:Z.blocks,updatedAt:Date.now()}}})),clearPreview:(Z)=>$((J)=>{if(!(Z in J.previews))return J;let{[Z]:Q,...X}=J.previews;return{previews:X}}),clearPreviewsForSession:(Z,J)=>$((Q)=>{let X={},H=!1;for(let[G,z]of Object.entries(Q.previews))if(z.workspaceId===Z&&z.sessionId===J)H=!0;else X[G]=z;return H?{previews:X}:Q}),clearAllPreviews:()=>$((Z)=>Object.keys(Z.previews).length?{previews:{}}:Z),sweepPreviews:(Z,J)=>$((Q)=>{let X={},H=!1;for(let[G,z]of Object.entries(Q.previews))if(J-z.updatedAt>Z)H=!0;else X[G]=z;return H?{previews:X}:Q}),addAttachments:(Z,J,Q)=>$((X)=>{let H=S2(Z,J);return{attachments:{...X.attachments,[H]:[...X.attachments[H]??[],...Q]}}}),updateAttachment:(Z,J,Q,X)=>$((H)=>{let G=S2(Z,J),z=H.attachments[G];if(!z)return{};return{attachments:{...H.attachments,[G]:z.map((Y)=>Y.localId===Q?{...Y,...X}:Y)}}}),removeAttachment:(Z,J,Q)=>$((X)=>{let H=S2(Z,J),G=X.attachments[H];if(!G)return{};let z=G.find((Y)=>Y.localId===Q);if(z?.previewUrl)URL.revokeObjectURL(z.previewUrl);return{attachments:{...X.attachments,[H]:G.filter((Y)=>Y.localId!==Q)}}}),clearAttachments:(Z,J)=>$((Q)=>{let X=S2(Z,J);for(let G of Q.attachments[X]??[])if(G.previewUrl)URL.revokeObjectURL(G.previewUrl);let H={...Q.attachments};return delete H[X],{attachments:H}}),renameSession:(Z,J,Q)=>$((X)=>{let H=n9(Z,J),G=n9(Z,Q),z={...X.activity},Y={...X.errors};if(H in z)z[G]=z[H],delete z[H];if(H in Y)Y[G]=Y[H],delete Y[H];let K=X.previews,W=!1;for(let[B,q]of Object.entries(X.previews))if(q.workspaceId===Z&&q.sessionId===J){if(!W)K={...X.previews},W=!0;K[B]={...q,sessionId:Q}}return{activity:z,errors:Y,previews:K}})}));function w_($,Z,J){if(!J)return{root:null,byParent:{}};let Q=null,X={};for(let H of Object.values($)){if(H.workspaceId!==Z||H.sessionId!==J)continue;if(H.parentToolUseId===null){if(!Q||H.updatedAt>Q.updatedAt)Q=H}else{let G=X[H.parentToolUseId];if(!G||H.updatedAt>G.updatedAt)X[H.parentToolUseId]=H}}return{root:Q,byParent:X}}function V4($){return __(M1,$)}var j0={all:["workspaces"],discover:["workspaces","discover"],setupInfo:["workspaces","setup-info"],preview:($)=>["workspaces","preview",$],layout:($)=>["workspaces","layout",$],widgets:($)=>["workspaces","widgets",$],views:($)=>["workspaces","views",$],viewBuilders:($)=>["workspaces","view-builders",$],sessions:($)=>["workspaces","sessions",$],events:($,Z)=>["workspaces","events",$,Z],sessionConfig:($,Z)=>["workspaces","sessionConfig",$,Z],mcp:($)=>["workspaces","mcp",$],agent:($)=>["workspaces","agent",$],skills:($)=>["workspaces","skills",$],env:($)=>["workspaces","env",$]};var XJ=P(v(),1);var L3={all:["app-ui"],selectedSession:($)=>["app-ui","selected-session",$]};async function j_($,Z){let J=await $.text();return Error(J||Z)}async function D5($,Z,J="Request failed"){let Q=await fetch($,Z);if(!Q.ok)throw await j_(Q,J);return Q.json()}async function L4($,Z,J="Request failed"){let Q=await fetch($,Z);if(!Q.ok)throw await j_(Q,J)}function f1($,Z){return{method:$,headers:{"Content-Type":"application/json"},body:Z===void 0?void 0:JSON.stringify(Z)}}function dc($){return[...L3.selectedSession($),"save"]}function lc($,Z,J){let Q=L3.selectedSession(Z),X=$.getQueryData(Q),H=X?.sessionId??null;if(X&&H===J)return null;return $.setQueryData(Q,{sessionId:J}),{sessionId:J,previousSessionId:H}}function ic($,Z,J,Q){let X=L3.selectedSession(Z),H=$.getQueryData(X);if(J.sessionId!==Q.sessionId&&H?.sessionId!==J.sessionId)return"conflict";if(H?.sessionId!==Q.sessionId&&H?.sessionId!==Q.previousSessionId)return"ignored";return $.setQueryData(X,J),"applied"}function rc($,Z,J,Q){if(Q)return;$.setQueryData(L3.selectedSession(Z),{sessionId:J})}function C_($,Z,J,Q){$.setQueryData(L3.selectedSession(Z),(X)=>X?.sessionId===J?{sessionId:Q}:X)}function s9(){let $=o5(),Z=s0(),J=XJ.useMemo(()=>L3.selectedSession($),[$]),Q=XJ.useMemo(()=>dc($),[$]),X=eW({mutationKey:Q,exact:!0}),H=$1({queryKey:J,queryFn:()=>D5(`/api/workspaces/${$}/selected-session`),staleTime:1/0,gcTime:0,refetchOnMount:!1,refetchOnWindowFocus:!1}),{mutate:G}=r5({mutationKey:Q,scope:{id:`selected-session:${$}`},mutationFn:(K)=>D5(`/api/workspaces/${$}/selected-session`,f1("PUT",K),"Couldn’t save selected chat"),onSuccess:(K,W)=>{if(ic(Z,$,K,W)!=="conflict")return;S7.add({title:"Couldn’t save selected chat",type:"error"}),Z.invalidateQueries({queryKey:J})},onError:(K,W)=>{if(Z.getQueryData(J)?.sessionId!==W.sessionId)return;S7.add({title:"Couldn’t save selected chat",type:"error"}),Z.invalidateQueries({queryKey:J})}}),z=XJ.useCallback((K)=>{let W=lc(Z,$,K);if(W)G(W)},[Z,G,$]);return s1((K)=>{if(K.type!=="selected-session:updated"||K.workspaceId!==$)return;rc(Z,$,K.sessionId,X>0)}),[H.isLoading?void 0:H.data?.sessionId??null,z]}function HJ(){return{turns:[],notices:[]}}function GJ($,Z){switch(Z.kind){case"snapshot":return{...$,snapshot:Z.snapshot};case"turn":{let J=$.turns.findIndex((X)=>X.id===Z.turn.id);if(J>=0)return{...$,turns:$.turns.map((X,H)=>H===J?Z.turn:X)};if(Z.turn.seq===void 0)return{...$,turns:[...$.turns,Z.turn]};let Q=$.turns.findIndex((X)=>X.seq!==void 0&&X.seq>Z.turn.seq);if(Q<0)return{...$,turns:[...$.turns,Z.turn]};return{...$,turns:[...$.turns.slice(0,Q),Z.turn,...$.turns.slice(Q)]}}case"notice":{if($.notices.some((J)=>J.id===Z.notice.id))return{...$,notices:$.notices.map((J)=>J.id===Z.notice.id?Z.notice:J)};return{...$,notices:[...$.notices,Z.notice]}}case"result":return{...$,result:Z.result}}}function T_($){return $.reduce(GJ,HJ())}function I_($,Z){let{queryClient:J,sendMessage:Q,onWorkspaceSwitch:X}=Z,H=M1.getState();if($.type==="status_snapshot"){H.reconcileActivity($.sessions??[]);return}if($.type==="status"){let{workspaceId:K,sessionId:W,activity:B}=$;if(H.setActivity(K,W,B),B!=="running")H.clearPreviewsForSession(K,W);return}if($.type==="preview"){let K=$,W=j0.events(K.workspaceId,K.sessionId);if(J?.getQueryData(W)===void 0)return;H.setPreview({workspaceId:K.workspaceId,sessionId:K.sessionId,messageId:K.messageId,parentToolUseId:K.parentToolUseId,blocks:K.blocks});return}if($.type==="session_renamed"){let{workspaceId:K,from:W,to:B}=$,q=j0.sessions(K),F=J?.getQueryData(q)?.find((V)=>V.sessionId===W||V.sessionId===B);if(F)J?.cancelQueries({queryKey:q});if(H.renameSession(K,W,B),J)C_(J,K,W,B);if(F)J?.setQueryData(q,(V)=>[{...F,sessionId:B},...(V??[]).filter((M)=>M.sessionId!==W&&M.sessionId!==B)]);let N=J?.getQueryData(j0.events(K,W));if(N!==void 0)J?.setQueryData(j0.events(K,B),N),J?.removeQueries({queryKey:j0.events(K,W)});let L=J?.getQueryData(j0.sessionConfig(K,W));if(L!==void 0)J?.setQueryData(j0.sessionConfig(K,B),L),J?.removeQueries({queryKey:j0.sessionConfig(K,W)});if(!F)J?.invalidateQueries({queryKey:q});J?.invalidateQueries({queryKey:j0.preview(K)});return}if($.type==="sessions_changed"){let K=$.workspaceId,W=j0.sessions(K);J?.invalidateQueries({queryKey:W}),J?.invalidateQueries({queryKey:j0.preview(K)});return}if($.type==="workspace:switch"){X?.($.workspaceId);return}if($.type==="scratchpad:op"){let K=E_($.workspaceId);if(!K)return;let W=$.opId;K($.op).then((B)=>Q({type:"scratchpad:op-result",opId:W,result:B}),(B)=>Q({type:"scratchpad:op-result",opId:W,error:B instanceof Error?B.message:String(B)}));return}let{workspaceId:G,sessionId:z}=$;if(!G||!z)return;let Y=$.kind;if(Y==="snapshot"||Y==="turn"||Y==="notice"||Y==="result"){if(ac(J,G,z,$),Y==="turn"){let K=$.turn?.meta?.apiMessageId;if(K)H.clearPreview(K)}if(Y==="result")H.clearPreviewsForSession(G,z)}if(Y==="error"&&typeof $.content==="string")H.setError(G,z,$.content),H.setActivity(G,z,"idle"),H.clearPreviewsForSession(G,z);if(Y==="stopped")H.setActivity(G,z,"idle"),H.clearPreviewsForSession(G,z)}function ac($,Z,J,Q){let X=j0.events(Z,J),H=$?.getQueryData(X);if(H===void 0)return;$?.setQueryData(X,GJ(H,Q))}var Yq=null,g7=null,lH=0,iH=null,zq=[],S_=null,R_=null,nc=15000;function b_($){if(Yq=$,!R_)R_=setInterval(()=>M1.getState().sweepPreviews(nc,Date.now()),5000);if(g7)return;y_()}function y_(){let $=++lH;if(iH)clearTimeout(iH),iH=null;let Z=new WebSocket(k_("/ws"));g7=Z,Z.onopen=()=>{if(lH!==$){Z.close();return}for(let J of zq)Z.send(JSON.stringify(J));zq.length=0,Yq?.invalidateQueries({queryKey:["workspaces","events"]}),M1.getState().clearAllPreviews()},Z.onmessage=(J)=>{if(lH!==$)return;let Q;try{Q=JSON.parse(J.data)}catch{return}sc(Q)},Z.onclose=()=>{if(lH!==$)return;g7=null,iH=setTimeout(y_,1000)},Z.onerror=()=>Z.close()}function sc($){I_($,{queryClient:Yq,sendMessage:rH,onWorkspaceSwitch:S_})}function rH($){if(g7&&g7.readyState===WebSocket.OPEN)g7.send(JSON.stringify($));else zq.push($)}function Kq($){S_=$}var hW=P(v(),1);var oc=($)=>x_()(g_((Z)=>({discoveredWorkspacesOpen:!0,hasSentMessageFromMoi:!1,workspaceIdsPendingAnalysis:[],composerDrafts:{},dockedChatWidth:360,setDiscoveredWorkspacesOpen:(J)=>Z({discoveredWorkspacesOpen:J}),markWorkspacePendingAnalysis:(J)=>Z((Q)=>{let X=Q.workspaceIdsPendingAnalysis??[];return{workspaceIdsPendingAnalysis:X.includes(J)?X:[...X,J]}}),markMessageSentFromMoi:(J)=>Z((Q)=>({hasSentMessageFromMoi:!0,workspaceIdsPendingAnalysis:(Q.workspaceIdsPendingAnalysis??[]).filter((X)=>X!==J)})),setComposerDraft:(J,Q)=>Z((X)=>{let H={...X.composerDrafts??{}};if(Q)H[J]=Q;else delete H[J];return{composerDrafts:H}}),setDockedChatWidth:(J)=>Z({dockedChatWidth:J})}),$?{name:"moi:ui",storage:h_(()=>$)}:{name:"moi:ui"})),m1=oc();function v_($,Z){let J=$??[],Q=J.findIndex((X)=>X.id===Z.id||X.path===Z.path);if(Q===-1)return[Z,...J];return J.map((X,H)=>H===Q?{...X,...Z}:X)}function aH(){return $1({queryKey:j0.all,queryFn:()=>D5("/api/workspaces"),staleTime:1/0,refetchOnMount:"always"})}function nH($){return $1({queryKey:j0.preview($),queryFn:()=>D5(`/api/workspaces/${$}/preview`),staleTime:60000})}function f_(){return $1({queryKey:j0.discover,queryFn:()=>D5("/api/workspaces/discover")})}function m_(){let $=s0();return r5({mutationFn:(Z)=>D5("/api/workspaces",f1("POST",Z),"Failed to add workspace"),onSuccess:(Z,J)=>{m1.getState().markWorkspacePendingAnalysis(Z.id),$.setQueryData(j0.all,(Q)=>v_(Q,Z)),$.setQueryData(j0.discover,(Q)=>(Q??[]).filter((X)=>X.path!==J.path))}})}function sH(){return $1({queryKey:j0.setupInfo,queryFn:()=>D5("/api/workspaces/create"),staleTime:30000,refetchOnMount:"always"})}function u_(){let $=s0();return r5({mutationFn:(Z)=>D5("/api/workspaces/create",f1("POST",Z),"Failed to create workspace"),onSuccess:(Z)=>{$.setQueryData(j0.all,(J)=>v_(J,Z))}})}function p_(){let $=s0();return r5({mutationFn:(Z)=>D5("/api/workspaces/order",f1("PUT",{ids:Z}),"Failed to reorder spaces"),onMutate:async(Z)=>{await $.cancelQueries({queryKey:j0.all,exact:!0});let J=$.getQueryData(j0.all);if(J){let Q=new Map(J.map((H)=>[H.id,H])),X=Z.map((H)=>Q.get(H)).filter((H)=>Boolean(H));if(X.length===J.length)$.setQueryData(j0.all,X)}return{previous:J}},onError:(Z,J,Q)=>{if(Q?.previous)$.setQueryData(j0.all,Q.previous);$.invalidateQueries({queryKey:j0.all,exact:!0})},onSuccess:(Z)=>{$.setQueryData(j0.all,Z)}})}function c_(){let $=s0();return r5({mutationFn:(Z)=>L4(`/api/workspaces/${Z}`,{method:"DELETE"},"Failed to remove workspace"),onSuccess:(Z,J)=>{$.setQueryData(j0.all,(Q)=>(Q??[]).filter((X)=>X.id!==J)),$.invalidateQueries({queryKey:j0.discover})}})}var AJ=P(v(),1);var X2={};S4(X2,{createHandle:()=>AO,Viewport:()=>NO,Trigger:()=>MO,Title:()=>LO,Root:()=>UO,Portal:()=>XO,Popup:()=>$O,Handle:()=>QG,Description:()=>n_,Close:()=>r_,Backdrop:()=>l_});var d_=P(v(),1);var oH=P(v(),1),Wq=oH.createContext(void 0);function X8($){let Z=oH.useContext(Wq);if($===!1&&Z===void 0)throw Error(I0(27));return Z}var tc={...x5,...s5},l_=d_.forwardRef(function(Z,J){let{render:Q,className:X,forceRender:H=!1,...G}=Z,{store:z}=X8(),Y=z.useState("open"),K=z.useState("nested"),W=z.useState("mounted"),B=z.useState("transitionStatus");return U0("div",Z,{state:{open:Y,transitionStatus:B},ref:[z.context.backdropRef,J],stateAttributesMapping:tc,props:[{role:"presentation",hidden:!W,style:{userSelect:"none",WebkitUserSelect:"none"}},G],enabled:H||!K})});var i_=P(v(),1);var r_=i_.forwardRef(function(Z,J){let{render:Q,className:X,disabled:H=!1,nativeButton:G=!0,...z}=Z,{store:Y}=X8(),K=Y.useState("open");function W(F){if(K)Y.setOpen(!1,O0(q0.closePress,F.nativeEvent))}let{getButtonProps:B,buttonRef:q}=S1({disabled:H,native:G});return U0("button",Z,{state:{disabled:H},ref:[J,q],props:[{onClick:W},z,B]})});var a_=P(v(),1);var n_=a_.forwardRef(function(Z,J){let{render:Q,className:X,id:H,...G}=Z,{store:z}=X8(),Y=e0(H);return z.useSyncedValueWithCleanup("descriptionElementId",Y),U0("p",Z,{ref:J,props:[{id:Y},G]})});var t_=P(v(),1);var s_=function($){return $.nestedDialogs="--nested-dialogs",$}({});var o_=function($){return $[$.open=N4.open]="open",$[$.closed=N4.closed]="closed",$[$.startingStyle=N4.startingStyle]="startingStyle",$[$.endingStyle=N4.endingStyle]="endingStyle",$.nested="data-nested",$.nestedDialogOpen="data-nested-dialog-open",$}({});var tH=P(v(),1),Bq=tH.createContext(void 0);function eH(){let $=tH.useContext(Bq);if($===void 0)throw Error(I0(26));return $}var zJ="ArrowUp",YJ="ArrowDown",KJ="ArrowLeft",WJ="ArrowRight",BJ="Home",qJ="End",ec=new Set([KJ,WJ]);var $d=new Set([zJ,YJ]);var Zd=new Set([...ec,...$d]),HF0=new Set([...Zd,BJ,qJ]),o9=new Set([zJ,YJ,KJ,WJ,BJ,qJ]);var e_=P(l(),1),Jd={...x5,...s5,nestedDialogOpen($){return $?{[o_.nestedDialogOpen]:""}:null}},$O=t_.forwardRef(function(Z,J){let{className:Q,finalFocus:X,initialFocus:H,render:G,...z}=Z,{store:Y}=X8(),K=Y.useState("descriptionElementId"),W=Y.useState("disablePointerDismissal"),B=Y.useState("floatingRootContext"),q=Y.useState("popupProps"),U=Y.useState("modal"),F=Y.useState("mounted"),N=Y.useState("nested"),L=Y.useState("nestedOpenDialogCount"),V=Y.useState("open"),M=Y.useState("openMethod"),A=Y.useState("titleElementId"),O=Y.useState("transitionStatus"),_=Y.useState("role");eH(),v1({open:V,ref:Y.context.popupRef,onComplete(){if(V)Y.context.onOpenChangeComplete?.(!0)}});function D(y){if(y==="touch")return Y.context.popupRef.current;return!0}let T=H===void 0?D:H,k=L>0,I=U0("div",Z,{state:{open:V,nested:N,transitionStatus:O,nestedDialogOpen:k},props:[q,{"aria-labelledby":A??void 0,"aria-describedby":K??void 0,role:_,tabIndex:-1,hidden:!F,onKeyDown(y){if(o9.has(y.key))y.stopPropagation()},style:{[s_.nestedDialogs]:L}},z],ref:[J,Y.context.popupRef,Y.useStateSetter("popupElement")],stateAttributesMapping:Jd});return e_.jsx(Y3,{context:B,openInteractionType:M,disabled:!F,closeOnFocusOut:!W,initialFocus:T,returnFocus:X,modal:U!==!1,restoreFocus:"popup",children:I})});var QO=P(v(),1);var ZO=P(v(),1),JO=P(l(),1),v7=ZO.forwardRef(function(Z,J){let{cutout:Q,...X}=Z,H;if(Q){let G=Q?.getBoundingClientRect();H=`polygon(
|
|
10
|
-
0% 0%,
|
|
11
|
-
100% 0%,
|
|
12
|
-
100% 100%,
|
|
13
|
-
0% 100%,
|
|
14
|
-
0% 0%,
|
|
15
|
-
${G.left}px ${G.top}px,
|
|
16
|
-
${G.left}px ${G.bottom}px,
|
|
17
|
-
${G.right}px ${G.bottom}px,
|
|
18
|
-
${G.right}px ${G.top}px,
|
|
19
|
-
${G.left}px ${G.top}px
|
|
20
|
-
)`}return JO.jsx("div",{ref:J,role:"presentation","data-base-ui-inert":"",...X,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:H}})});var UJ=P(l(),1),XO=QO.forwardRef(function(Z,J){let{keepMounted:Q=!1,...X}=Z,{store:H}=X8(),G=H.useState("mounted"),z=H.useState("modal"),Y=H.useState("open");if(!(G||Q))return null;return UJ.jsx(Bq.Provider,{value:Q,children:UJ.jsxs(z3,{ref:J,...X,children:[G&&z===!0&&UJ.jsx(v7,{ref:H.context.internalBackdropRef,inert:j2(!Y)}),Z.children]})})});var BO=P(v(),1);var g4=P(v(),1);var HO={},GO={},zO="";function Qd($){if(typeof document>"u")return!1;let Z=g0($);return O8(Z).innerWidth-Z.documentElement.clientWidth>0}function Xd($){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;let J=g0($),Q=J.documentElement,X=J.body,H=$G(Q)?Q:X,G=H.style.overflowY,z=Q.style.scrollbarGutter;Q.style.scrollbarGutter="stable",H.style.overflowY="scroll";let Y=H.offsetWidth;H.style.overflowY="hidden";let K=H.offsetWidth;return H.style.overflowY=G,Q.style.scrollbarGutter=z,Y===K}function Hd($){let Z=g0($),J=Z.documentElement,Q=Z.body,X=$G(J)?J:Q,H={overflowY:X.style.overflowY,overflowX:X.style.overflowX};return Object.assign(X.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(X.style,H)}}function Gd($){let Z=g0($),J=Z.documentElement,Q=Z.body,X=O8(J),H=0,G=0,z=!1,Y=J1.create();if(lX&&(X.visualViewport?.scale??1)!==1)return()=>{};function K(){let q=X.getComputedStyle(J),U=X.getComputedStyle(Q),L=(q.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";H=J.scrollTop,G=J.scrollLeft,HO={scrollbarGutter:J.style.scrollbarGutter,overflowY:J.style.overflowY,overflowX:J.style.overflowX},zO=J.style.scrollBehavior,GO={position:Q.style.position,height:Q.style.height,width:Q.style.width,boxSizing:Q.style.boxSizing,overflowY:Q.style.overflowY,overflowX:Q.style.overflowX,scrollBehavior:Q.style.scrollBehavior};let V=J.scrollHeight>J.clientHeight,M=J.scrollWidth>J.clientWidth,A=q.overflowY==="scroll"||U.overflowY==="scroll",O=q.overflowX==="scroll"||U.overflowX==="scroll",_=Math.max(0,X.innerWidth-Q.clientWidth),D=Math.max(0,X.innerHeight-Q.clientHeight),T=parseFloat(U.marginTop)+parseFloat(U.marginBottom),k=parseFloat(U.marginLeft)+parseFloat(U.marginRight),x=$G(J)?J:Q;if(z=Xd($),z){J.style.scrollbarGutter=L,x.style.overflowY="hidden",x.style.overflowX="hidden";return}if(Object.assign(J.style,{scrollbarGutter:L,overflowY:"hidden",overflowX:"hidden"}),V||A)J.style.overflowY="scroll";if(M||O)J.style.overflowX="scroll";Object.assign(Q.style,{position:"relative",height:T||D?`calc(100dvh - ${T+D}px)`:"100dvh",width:k||_?`calc(100vw - ${k+_}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),Q.scrollTop=H,Q.scrollLeft=G,J.setAttribute("data-base-ui-scroll-locked",""),J.style.scrollBehavior="unset"}function W(){if(Object.assign(J.style,HO),Object.assign(Q.style,GO),!z)J.scrollTop=H,J.scrollLeft=G,J.removeAttribute("data-base-ui-scroll-locked"),J.style.scrollBehavior=zO}function B(){W(),Y.request(K)}return K(),X.addEventListener("resize",B),()=>{if(Y.cancel(),W(),typeof X.removeEventListener==="function")X.removeEventListener("resize",B)}}class YO{lockCount=0;restore=null;timeoutLock=h1.create();timeoutUnlock=h1.create();acquire($){if(this.lockCount+=1,this.lockCount===1&&this.restore===null)this.timeoutLock.start(0,()=>this.lock($));return this.release}release=()=>{if(this.lockCount-=1,this.lockCount===0&&this.restore)this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{if(this.lockCount===0&&this.restore)this.restore?.(),this.restore=null};lock($){if(this.lockCount===0||this.restore!==null)return;let J=g0($).documentElement,Q=O8(J).getComputedStyle(J).overflowY;if(Q==="hidden"||Q==="clip"){this.restore=y5;return}let X=iX||!Qd($);this.restore=X?Hd($):Gd($)}}var zd=new YO;function f7($=!0,Z=null){W0(()=>{if(!$)return;return zd.acquire(Z)},[$,Z])}var m7=P(v(),1);var FJ=P(v(),1);function KO($){let Z=FJ.useRef(""),J=FJ.useCallback((X)=>{if(X.defaultPrevented)return;Z.current=X.pointerType,$(X,X.pointerType)},[$]);return{onClick:FJ.useCallback((X)=>{if(X.detail===0){$(X,"keyboard");return}if("pointerType"in X)$(X,X.pointerType);else $(X,Z.current);Z.current=""},[$]),onPointerDown:J}}function u7($){let[Z,J]=m7.useState(null),Q=K0((z,Y)=>{if(!$)J(Y||(iX?"touch":""))}),X=m7.useCallback(()=>{J(null)},[]),{onClick:H,onPointerDown:G}=KO(Q);return m7.useMemo(()=>({openMethod:Z,reset:X,triggerProps:{onClick:H,onPointerDown:G}}),[Z,X,H,G])}function WO($){let{store:Z,parentContext:J,actionsRef:Q}=$,X=Z.useState("open"),H=Z.useState("disablePointerDismissal"),G=Z.useState("modal"),z=Z.useState("popupElement"),{openMethod:Y,triggerProps:K,reset:W}=u7(X);v9(Z);let{forceUnmount:B}=f9(X,Z,()=>{W()}),q=K0((I)=>{let y=O0(I);return y.preventUnmountOnClose=()=>{Z.set("preventUnmountingOnClose",!0)},y}),U=g4.useCallback(()=>{Z.setOpen(!1,q(q0.imperativeAction))},[Z,q]);g4.useImperativeHandle(Q,()=>({unmount:B,close:U}),[B,U]);let F=z9({popupStore:Z,onOpenChange:Z.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[N,L]=g4.useState(0),V=N===0,M=U3(F),A=G9(F,{outsidePressEvent(){if(Z.context.internalBackdropRef.current||Z.context.backdropRef.current)return"intentional";return{mouse:G==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(I){if(!Z.context.outsidePressEnabledRef.current)return!1;if("button"in I&&I.button!==0)return!1;if("touches"in I&&I.touches.length!==1)return!1;let y=T5(I);if(V&&!H){let C=y;if(G)return Z.context.internalBackdropRef.current||Z.context.backdropRef.current?Z.context.internalBackdropRef.current===C||Z.context.backdropRef.current===C||x0(C,z)&&!C?.hasAttribute("data-base-ui-portal"):!0;return!0}return!1},escapeKey:V});f7(X&&G===!0,z);let{getReferenceProps:O,getFloatingProps:_,getTriggerProps:D}=F8([M,A]);Z.useContextCallback("onNestedDialogOpen",(I)=>{L(I+1)}),Z.useContextCallback("onNestedDialogClose",()=>{L(0)}),g4.useEffect(()=>{if(J?.onNestedDialogOpen&&X)J.onNestedDialogOpen(N);if(J?.onNestedDialogClose&&!X)J.onNestedDialogClose();return()=>{if(J?.onNestedDialogClose&&X)J.onNestedDialogClose()}},[X,J,N]);let T=g4.useMemo(()=>O(K),[O,K]),k=g4.useMemo(()=>D(K),[D,K]),x=g4.useMemo(()=>_(),[_]);Z.useSyncedValues({openMethod:Y,activeTriggerProps:T,inactiveTriggerProps:k,popupProps:x,floatingRootContext:F,nestedOpenDialogCount:N})}var ZG=P(v(),1);var Yd={...u9,modal:C0(($)=>$.modal),nested:C0(($)=>$.nested),nestedOpenDialogCount:C0(($)=>$.nestedOpenDialogCount),disablePointerDismissal:C0(($)=>$.disablePointerDismissal),openMethod:C0(($)=>$.openMethod),descriptionElementId:C0(($)=>$.descriptionElementId),titleElementId:C0(($)=>$.titleElementId),viewportElement:C0(($)=>$.viewportElement),role:C0(($)=>$.role)};class NJ extends K4{constructor($){super(Kd($),{popupRef:ZG.createRef(),backdropRef:ZG.createRef(),internalBackdropRef:ZG.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new U4,onOpenChange:void 0,onOpenChangeComplete:void 0},Yd)}setOpen=($,Z)=>{if(Z.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!$&&Z.trigger==null&&this.state.activeTriggerId!=null)Z.trigger=this.state.activeTriggerElement??void 0;if(this.context.onOpenChange?.($,Z),Z.isCanceled)return;let J={open:$,nativeEvent:Z.event,reason:Z.reason,nested:this.state.nested};this.state.floatingRootContext.context.events?.emit("openchange",J);let Q={open:$},X=Z.trigger?.id??null;if(X||$)Q.activeTriggerId=X,Q.activeTriggerElement=Z.trigger??null;this.update(Q)}}function Kd($={}){return{...m9(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...$}}var qO=P(l(),1);function UO($){let{children:Z,open:J,defaultOpen:Q=!1,onOpenChange:X,onOpenChangeComplete:H,disablePointerDismissal:G=!1,modal:z=!0,actionsRef:Y,handle:K,triggerId:W,defaultTriggerId:B=null}=$,q=X8(!0),U=Boolean(q),F=P5(()=>{return K?.store??new NJ({open:Q,openProp:J,activeTriggerId:B,triggerIdProp:W,modal:z,disablePointerDismissal:G,nested:U})}).current;a9(()=>{if(J===void 0&&F.state.open===!1&&Q===!0)F.update({open:!0,activeTriggerId:B})}),F.useControlledProp("openProp",J),F.useControlledProp("triggerIdProp",W),F.useSyncedValues({disablePointerDismissal:G,nested:U,modal:z}),F.useContextCallback("onOpenChange",X),F.useContextCallback("onOpenChangeComplete",H);let N=F.useState("payload");WO({store:F,actionsRef:Y,parentContext:q?.store.context,onOpenChange:X,triggerIdProp:W});let L=BO.useMemo(()=>({store:F}),[F]);return qO.jsx(Wq.Provider,{value:L,children:typeof Z==="function"?Z({payload:N}):Z})}var FO=P(v(),1);var qq=function($){return $[$.open=N4.open]="open",$[$.closed=N4.closed]="closed",$[$.startingStyle=N4.startingStyle]="startingStyle",$[$.endingStyle=N4.endingStyle]="endingStyle",$.nested="data-nested",$.nestedDialogOpen="data-nested-dialog-open",$}({});var Wd={...x5,...s5,nested($){return $?{[qq.nested]:""}:null},nestedDialogOpen($){return $?{[qq.nestedDialogOpen]:""}:null}},NO=FO.forwardRef(function(Z,J){let{className:Q,render:X,children:H,...G}=Z,z=eH(),{store:Y}=X8(),K=Y.useState("open"),W=Y.useState("nested"),B=Y.useState("transitionStatus"),q=Y.useState("nestedOpenDialogCount"),U=Y.useState("mounted"),F=q>0;return U0("div",Z,{enabled:z||U,state:{open:K,nested:W,transitionStatus:B,nestedDialogOpen:F},ref:[J,Y.useStateSetter("viewportElement")],stateAttributesMapping:Wd,props:[{role:"presentation",hidden:!U,style:{pointerEvents:!K?"none":void 0},children:H},G]})});var VO=P(v(),1);var LO=VO.forwardRef(function(Z,J){let{render:Q,className:X,id:H,...G}=Z,{store:z}=X8(),Y=e0(H);return z.useSyncedValueWithCleanup("titleElementId",Y),U0("h2",Z,{ref:J,props:[{id:Y},G]})});var JG=P(v(),1);var MO=JG.forwardRef(function(Z,J){let{render:Q,className:X,disabled:H=!1,nativeButton:G=!0,id:z,payload:Y,handle:K,...W}=Z,B=X8(!0),q=K?.store??B?.store;if(!q)throw Error(I0(79));let U=e0(z),F=q.useState("floatingRootContext"),N=q.useState("isOpenedByTrigger",U),L=JG.useRef(null),{registerTrigger:V,isMountedByThisTrigger:M}=g9(U,L,q,{payload:Y}),{getButtonProps:A,buttonRef:O}=S1({disabled:H,native:G}),_=H9(F,{enabled:F!=null}),D=F8([_]),T={disabled:H,open:N},k=q.useState("triggerProps",M);return U0("button",Z,{state:T,ref:[O,J,V,L],props:[D.getReferenceProps(),k,{[I7]:"",id:U},W,A],stateAttributesMapping:l9})});class QG{constructor($){this.store=$??new NJ}open($){let Z=$?this.store.context.triggerElements.getById($):void 0;this.store.setOpen(!0,O0(q0.imperativeAction,void 0,Z))}openWithPayload($){this.store.set("payload",$),this.store.setOpen(!0,O0(q0.imperativeAction,void 0,void 0))}close(){this.store.setOpen(!1,O0(q0.imperativeAction,void 0,void 0))}get isOpen(){return this.store.state.open}}function AO(){return new QG}var b2=P(l(),1);function p7({...$}){return b2.jsx(X2.Root,{"data-slot":"dialog",...$})}function DO({...$}){return b2.jsx(X2.Trigger,{"data-slot":"dialog-trigger",...$})}function XG({...$}){return b2.jsx(X2.Close,{"data-slot":"dialog-close",...$})}function HG({className:$,children:Z,...J}){return b2.jsxs(X2.Portal,{children:[b2.jsx(X2.Backdrop,{"data-slot":"dialog-backdrop",className:"fixed inset-0 z-50 bg-foreground/40 duration-150 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0"}),b2.jsx(X2.Popup,{"data-slot":"dialog-content",className:e("fixed top-1/2 left-1/2 z-50 origin-center -translate-x-1/2 -translate-y-1/2 overflow-hidden rounded-xl bg-card text-card-foreground shadow-xl outline-hidden duration-150 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",$),...J,children:Z})]})}function c7({className:$,...Z}){return b2.jsx(X2.Title,{"data-slot":"dialog-title",className:e("text-lg font-semibold",$),...Z})}function GG({className:$,...Z}){return b2.jsx(X2.Description,{"data-slot":"dialog-description",className:e("text-sm text-muted-foreground",$),...Z})}var hO=P(v(),1);var LG={};S4(LG,{Validity:()=>SO,Root:()=>wO,Label:()=>jO,Item:()=>xO,Error:()=>CO,Description:()=>EO,Control:()=>RO});var G8=P(v(),1);var zG=P(v(),1);var Uq=function($){return $.disabled="data-disabled",$.valid="data-valid",$.invalid="data-invalid",$.touched="data-touched",$.dirty="data-dirty",$.filled="data-filled",$.focused="data-focused",$}({});var M3={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},E8={valid($){if($===null)return null;if($)return{[Uq.valid]:""};return{[Uq.invalid]:""}}};var Fq=zG.createContext({invalid:void 0,name:void 0,validityData:{state:M3,errors:[],error:"",value:"",initialValue:null},setValidityData:y5,disabled:void 0,touched:!1,setTouched:y5,dirty:!1,setDirty:y5,filled:!1,setFilled:y5,focused:!1,setFocused:y5,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:{disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},markedDirtyRef:{current:!1},validation:{getValidationProps:($=_5)=>$,getInputValidationProps:($=_5)=>$,inputRef:{current:null},commit:async()=>{}}});function j1($=!0){let Z=zG.useContext(Fq);if(Z.setValidityData===y5&&!$)throw Error(I0(28));return Z}var YG=P(v(),1),Bd=YG.createContext({legendId:void 0,setLegendId:()=>{},disabled:void 0});function _O($=!1){let Z=YG.useContext(Bd);if(!Z&&!$)throw Error(I0(86));return Z}var KG=P(v(),1);var qd=KG.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:y5,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function v4(){return KG.useContext(qd)}var t9=P(v(),1);var WG=P(v(),1);var Nq=WG.createContext({controlId:void 0,registerControlId:y5,labelId:void 0,setLabelId:y5,messageIds:[],setMessageIds:y5,getDescriptionProps:($)=>$});function H8(){return WG.useContext(Nq)}var OO=P(l(),1),BG=function(Z){let J=e0(),[Q,X]=t9.useState(Z.initialControlId===void 0?J:Z.initialControlId),[H,G]=t9.useState(void 0),[z,Y]=t9.useState([]),K=P5(()=>new Map),{messageIds:W}=H8(),B=K0((F,N)=>{let L=K.current;if(N===void 0){L.delete(F);return}L.set(F,N),X((V)=>{if(L.size===0)return;let M;for(let A of L.values()){if(V!==void 0&&A===V)return V;if(M===void 0)M=A}return M})}),q=t9.useCallback((F)=>{return t8({"aria-describedby":W.concat(z).join(" ")||void 0},F)},[W,z]),U=t9.useMemo(()=>({controlId:Q,registerControlId:B,labelId:H,setLabelId:G,messageIds:z,setMessageIds:Y,getDescriptionProps:q}),[Q,B,H,G,z,Y,q]);return OO.jsx(Nq.Provider,{value:U,children:Z.children})};var D3=P(v(),1);function A3($,Z){return{...$,state:{...$.state,valid:!Z&&$.state.valid}}}var qG=Object.keys(M3);function Ud($){if(!$||$.valid||!$.valueMissing)return!1;let Z=!1;for(let J of qG){if(J==="valid")continue;if(J==="valueMissing")Z=$[J];if($[J])Z=!1}return Z}function PO($){let{formRef:Z,clearErrors:J}=v4(),{setValidityData:Q,validate:X,validityData:H,validationDebounceTime:G,invalid:z,markedDirtyRef:Y,state:K,name:W,shouldValidateOnChange:B}=$,{controlId:q,getDescriptionProps:U}=H8(),F=q1(),N=D3.useRef(null),L=K0(async(A,O=!1)=>{let _=N.current;if(!_)return;if(O){if(K.valid!==!1)return;let j=_.validity;if(!j.valueMissing){let S={value:A,state:{...M3,valid:!0},error:"",errors:[],initialValue:H.initialValue};if(_.setCustomValidity(""),q){let E=Z.current.fields.get(q);if(E)Z.current.fields.set(q,{...E,...A3(S,!1)})}Q(S);return}let R=qG.reduce((S,E)=>{return S[E]=j[E],S},{});if(!R.valid&&!Ud(R))return}function D(j){let R=qG.reduce((E,b)=>{return E[b]=j.validity[b],E},{}),S=!1;for(let E of qG){if(E==="valid")continue;if(E==="valueMissing"&&R[E])S=!0;else if(R[E])return R}if(S&&!Y.current)R.valid=!0,R.valueMissing=!1;return R}F.clear();let T=null,k=[],x=D(_),I,y=B();if(_.validationMessage&&!y)I=_.validationMessage,k=[_.validationMessage];else{let j=Array.from(Z.current.fields.values()).reduce((S,E)=>{if(E.name)S[E.name]=E.getValue();return S},{}),R=X(A,j);if(typeof R==="object"&&R!==null&&"then"in R)T=await R;else T=R;if(T!==null){if(x.valid=!1,x.customError=!0,Array.isArray(T))k=T,_.setCustomValidity(T.join(`
|
|
21
|
-
`));else if(T)k=[T],_.setCustomValidity(T)}else if(y){if(_.setCustomValidity(""),x.customError=!1,_.validationMessage)I=_.validationMessage,k=[_.validationMessage];else if(_.validity.valid&&!x.valid)x.valid=!0}}let C={value:A,state:x,error:I??(Array.isArray(T)?T[0]:T??""),errors:k,initialValue:H.initialValue};if(q){let j=Z.current.fields.get(q);if(j)Z.current.fields.set(q,{...j,...A3(C,z)})}Q(C)}),V=D3.useCallback((A={})=>t8(U,K.valid===!1?{"aria-invalid":!0}:_5,A),[U,K.valid]),M=D3.useCallback((A={})=>t8({onChange(O){if(O.nativeEvent.defaultPrevented)return;if(J(W),!B()){L(O.currentTarget.value,!0);return}if(z)return;let _=O.currentTarget;if(_.value===""){L(_.value);return}if(F.clear(),G)F.start(G,()=>{L(_.value)});else L(_.value)}},V(A)),[V,J,W,F,L,z,G,B]);return D3.useMemo(()=>({getValidationProps:V,getInputValidationProps:M,inputRef:N,commit:L}),[V,M,L])}var UG=P(l(),1),Fd=G8.forwardRef(function(Z,J){let{errors:Q,validationMode:X,submitAttemptedRef:H}=v4(),{render:G,className:z,validate:Y,validationDebounceTime:K=0,validationMode:W=X,name:B,disabled:q=!1,invalid:U,dirty:F,touched:N,actionsRef:L,...V}=Z,{disabled:M}=_O(),A=K0(Y||(()=>null)),O=M||q,[_,D]=G8.useState(!1),[T,k]=G8.useState(!1),[x,I]=G8.useState(!1),[y,C]=G8.useState(!1),j=F??T,R=N??_,S=G8.useRef(!1),E=K0((B0)=>{if(F!==void 0)return;if(B0)S.current=!0;k(B0)}),b=K0((B0)=>{if(N!==void 0)return;D(B0)}),g=K0(()=>W==="onChange"||W==="onSubmit"&&H.current),u=Boolean(U||B&&{}.hasOwnProperty.call(Q,B)&&Q[B]!==void 0),[w,s]=G8.useState({state:M3,error:"",errors:[],value:null,initialValue:null}),z0=!u&&w.state.valid,h=G8.useMemo(()=>({disabled:O,touched:R,dirty:j,valid:z0,filled:x,focused:y}),[O,R,j,z0,x,y]),t=PO({setValidityData:s,validate:A,validityData:w,validationDebounceTime:K,invalid:u,markedDirtyRef:S,state:h,name:B,shouldValidateOnChange:g}),M0=G8.useCallback(()=>{S.current=!0,t.commit(w.value)},[t,w]);G8.useImperativeHandle(L,()=>({validate:M0}),[M0]);let d=G8.useMemo(()=>({invalid:u,name:B,validityData:w,setValidityData:s,disabled:O,touched:R,setTouched:b,dirty:j,setDirty:E,filled:x,setFilled:I,focused:y,setFocused:C,validate:A,validationMode:W,validationDebounceTime:K,shouldValidateOnChange:g,state:h,markedDirtyRef:S,validation:t}),[u,B,w,O,R,b,j,E,x,I,y,C,A,W,K,g,h,t]),Y0=U0("div",Z,{ref:J,state:h,props:V,stateAttributesMapping:E8});return UG.jsx(Fq.Provider,{value:d,children:Y0})}),wO=G8.forwardRef(function(Z,J){return UG.jsx(BG,{children:UG.jsx(Fd,{...Z,ref:J})})});var VJ=P(v(),1);var jO=VJ.forwardRef(function(Z,J){let{render:Q,className:X,id:H,nativeLabel:G=!0,...z}=Z,Y=j1(!1),{controlId:K,setLabelId:W,labelId:B}=H8(),q=e0(H),U=VJ.useRef(null),F=K0((L)=>{if(T5(L.nativeEvent)?.closest("button,input,select,textarea"))return;if(!L.defaultPrevented&&L.detail>1)L.preventDefault();if(G||!K)return;let M=g0(L.currentTarget).getElementById(K);if(U1(M))M.focus({focusVisible:!0})});return W0(()=>{if(q)W(q);return()=>{W(void 0)}},[q,W]),U0("label",Z,{ref:[J,U],state:Y.state,props:[{id:B},G?{htmlFor:K??void 0,onMouseDown:F}:{onClick:F,onPointerDown(L){L.preventDefault()}},z],stateAttributesMapping:E8})});var _3=P(v(),1);var Vq=P(l(),1),Nd={...E8,...s5},CO=_3.forwardRef(function(Z,J){let{render:Q,id:X,className:H,match:G,...z}=Z,Y=e0(X),{validityData:K,state:W,name:B}=j1(!1),{setMessageIds:q}=H8(),{errors:U}=v4(),F=B?U[B]:null,N=!1;if(F||G===!0)N=!0;else if(G)N=Boolean(K.state[G]);else N=K.state.valid===!1;let{mounted:L,transitionStatus:V,setMounted:M}=y4(N);W0(()=>{if(!N||!Y)return;return q((C)=>C.concat(Y)),()=>{q((C)=>C.filter((j)=>j!==Y))}},[N,Y,q]);let A=_3.useRef(null),[O,_]=_3.useState(null),[D,T]=_3.useState(null),k=F||(K.errors.length>1?Vq.jsx("ul",{children:K.errors.map((C)=>Vq.jsx("li",{children:C},C))}):K.error),x=K.error;if(F!=null)x=Array.isArray(F)?JSON.stringify(F):F;else if(K.errors.length>1)x=JSON.stringify(K.errors);if(N&&x!==D)T(x),_(k);v1({open:N,ref:A,onComplete(){if(!N)M(!1)}});let I={...W,transitionStatus:V},y=U0("div",Z,{ref:[J,A],state:I,props:[{id:Y,children:N?k:O},z],stateAttributesMapping:Nd,enabled:L});if(!L)return null;return y});var TO=P(v(),1);var EO=TO.forwardRef(function(Z,J){let{render:Q,id:X,className:H,...G}=Z,z=e0(X),Y=j1(!1),{setMessageIds:K}=H8();return W0(()=>{if(!z)return;return K((B)=>B.concat(z)),()=>{K((B)=>B.filter((q)=>q!==z))}},[z,K]),U0("p",Z,{ref:J,state:Y.state,props:[{id:z},G],stateAttributesMapping:E8})});var FG=P(v(),1);var O3=P(v(),1);function f4({controlled:$,default:Z,name:J,state:Q="value"}){let{current:X}=O3.useRef($!==void 0),[H,G]=O3.useState(Z),z=X?$:H,Y=O3.useCallback((K)=>{if(!X)G(K)},[]);return[z,Y]}var LJ=P(v(),1);function d7($={}){let{id:Z,implicit:J=!1,controlRef:Q}=$,{controlId:X,registerControlId:H}=H8(),G=e0(Z),z=J?X:void 0,Y=P5(()=>Symbol("labelable-control")),K=LJ.useRef(!1),W=LJ.useRef(Z!=null),B=K0(()=>{if(!K.current||H===y5)return;K.current=!1,H(Y.current,void 0)});return W0(()=>{if(H===y5)return;let q;if(J){let U=Q?.current;if(V5(U)&&U.closest("label")!=null)q=Z??null;else q=z??G}else if(Z!=null)W.current=!0,q=Z;else if(W.current)q=G;else{B();return}if(q===void 0){B();return}K.current=!0,H(Y.current,q);return},[Z,Q,z,H,J,G,Y,B]),LJ.useEffect(()=>{return B},[B]),X??G}var IO=P(W4(),1);function l7($){let{enabled:Z=!0,value:J,id:Q,name:X,controlRef:H,commit:G}=$,{formRef:z}=v4(),{invalid:Y,markedDirtyRef:K,validityData:W,setValidityData:B}=j1(),q=K0($.getValue);W0(()=>{if(!Z)return;let U=J;if(U===void 0)U=q();if(W.initialValue===null&&U!==null)B((F)=>({...F,initialValue:U}))},[Z,B,J,W.initialValue,q]),W0(()=>{if(!Z||!Q)return;z.current.fields.set(Q,{getValue:q,name:X,controlRef:H,validityData:A3(W,Y),validate(U=!0){let F=J;if(F===void 0)F=q();if(K.current=!0,!U)G(F);else IO.flushSync(()=>G(F))}})},[G,H,Z,z,q,Q,Y,K,X,W,J]),W0(()=>{let U=z.current.fields;return()=>{if(Q)U.delete(Q)}},[z,Q])}var RO=FG.forwardRef(function(Z,J){let{render:Q,className:X,id:H,name:G,value:z,disabled:Y=!1,onValueChange:K,defaultValue:W,autoFocus:B=!1,...q}=Z,{state:U,name:F,disabled:N,setTouched:L,setDirty:V,validityData:M,setFocused:A,setFilled:O,validationMode:_,validation:D}=j1(),T=N||Y,k=F??G,x={...U,disabled:T},{labelId:I}=H8(),y=d7({id:H});W0(()=>{let b=z!=null;if(D.inputRef.current?.value||b&&z!=="")O(!0);else if(b&&z==="")O(!1)},[D.inputRef,O,z]);let C=FG.useRef(null);W0(()=>{if(B&&C.current===p5(g0(C.current)))A(!0)},[B,A]);let[j]=f4({controlled:z,default:W,name:"FieldControl",state:"value"}),R=z!==void 0,S=R?j:void 0;return l7({id:y,name:k,commit:D.commit,value:S,getValue:()=>D.inputRef.current?.value,controlRef:D.inputRef}),U0("input",Z,{ref:[J,C],state:x,props:[{id:y,disabled:T,name:k,ref:D.inputRef,"aria-labelledby":I,autoFocus:B,...R?{value:S}:{defaultValue:W},onChange(b){let g=b.currentTarget.value;K?.(g,O0(q0.none,b.nativeEvent)),V(g!==M.initialValue),O(g!=="")},onFocus(){A(!0)},onBlur(b){if(L(!0),A(!1),_==="onBlur")D.commit(b.currentTarget.value)},onKeyDown(b){if(b.currentTarget.tagName==="INPUT"&&b.key==="Enter")L(!0),D.commit(b.currentTarget.value)}},D.getInputValidationProps(),q],stateAttributesMapping:E8})});var MJ=P(v(),1);var kO=P(l(),1),SO=function(Z){let{children:J}=Z,{validityData:Q,invalid:X}=j1(!1),H=MJ.useMemo(()=>A3(Q,X),[Q,X]),G=H.state.valid===!1,{transitionStatus:z}=y4(G),Y=MJ.useMemo(()=>{return{...H,validity:H.state,transitionStatus:z}},[H,z]);return kO.jsx(MJ.Fragment,{children:J(Y)})};var VG=P(v(),1);var Lq=P(v(),1),bO=Lq.createContext({disabled:!1});var NG=P(v(),1),Vd=NG.createContext(void 0);function yO($=!0){let Z=NG.useContext(Vd);if(Z===void 0&&!$)throw Error(I0(3));return Z}var Mq=P(l(),1),xO=VG.forwardRef(function(Z,J){let{render:Q,className:X,disabled:H=!1,...G}=Z,{state:z,disabled:Y}=j1(!1),K=Y||H,W=yO(),B=W?.parent.id,U=W?.allValues!==void 0?B:void 0,F=VG.useMemo(()=>({disabled:K}),[K]),N=U0("div",Z,{ref:J,state:z,props:G,stateAttributesMapping:E8});return Mq.jsx(BG,{initialControlId:U,children:Mq.jsx(bO.Provider,{value:F,children:N})})});var gO=P(l(),1),Aq=hO.forwardRef(function(Z,J){return gO.jsx(LG.Control,{ref:J,...Z})});var vO=P(l(),1);function e9({className:$,type:Z,...J}){return vO.jsx(Aq,{type:Z,"data-slot":"input",className:e("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-sm transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",$),...J})}function fO($){if(!$)return"Folder name is required";if($.length>64)return"Folder name is too long (max 64 characters)";if(!/^[A-Za-z0-9][A-Za-z0-9._ -]*$/.test($))return"Use letters, numbers, dots, dashes, underscores and spaces, starting with a letter or number";if($.endsWith(".")||$.endsWith(" "))return"Folder name cannot end with a dot or space";return null}var i7=["claude-code","codex","openclaw"];var dO=P(v(),1);var mO="/claude-z2xnay0d.svg";var uO="/openai-ep9ht2pq.svg";var pO="/openclaw-a2pyfhpn.svg";var Dq=P(l(),1),H2={"claude-code":mO,openclaw:pO,codex:uO},_q={"claude-code":"Claude Code",openclaw:"OpenClaw",codex:"Codex"};function cO({types:$}){let Z=$.map((J)=>_q[J]).join(", ");return Dq.jsx("span",{role:"img","aria-label":Z,className:"inline-flex shrink-0 items-center -space-x-0.5",children:$.map((J)=>Dq.jsx("img",{src:H2[J],alt:"",className:"size-4 shrink-0 rounded-full bg-muted ring-2 ring-muted"},J))})}function P3($){if("types"in $)return $.path.split("/").pop()||$.path;if($.name)return $.name;if($.type==="openclaw")return $.agentId??"OpenClaw agent";return $.path.split("/").pop()||$.path}var X1=P(l(),1),Dd="Choose which agent moi will use to build your workspace",_d=`Initialize OpenClaw in the folder
|
|
22
|
-
manually, then import it to moi`,Od={"claude-code":"Anthropic",codex:"OpenAI",openclaw:"Open-source"};function Pd({availability:$,detectedTypes:Z=[]}){return i7.map((J)=>{let Q=$?.[J],X=Q?.available===!1?Q.reason:void 0,H=J==="openclaw"&&!Z.includes(J)?_d:void 0,G=X??H;return{type:J,description:Od[J],disabled:Boolean(G),...G?{disabledReason:G}:{}}})}function wd($,Z){let J=$.find((Q)=>Q.type===Z);if(J&&!J.disabled)return J.type;return $.find((Q)=>!Q.disabled)?.type}function AG({title:$,selectedType:Z,detectedTypes:J,availability:Q,isPending:X,errorMessage:H,secondaryAction:G,primaryLabel:z,pendingLabel:Y,onTypeChange:K,onSubmit:W}){let B=m1((L)=>L.hasSentMessageFromMoi),q=Pd({availability:Q,detectedTypes:J}),U=wd(q,Z),F=U!==Z,N=U==="claude-code"?"Tip: you can use your existing Claude subscription in moi":U==="codex"?"Tip: you can use your existing ChatGPT subscription in moi":void 0;return dO.useEffect(()=>{if(U&&F)K(U)},[K,U,F]),X1.jsxs("div",{className:"flex flex-col gap-5",children:[X1.jsxs("div",{className:"flex flex-col gap-0.5 pr-8",children:[X1.jsx(c7,{children:$}),X1.jsx(GG,{children:Dd})]}),X1.jsxs("div",{className:"flex flex-col gap-4",children:[X1.jsx(jd,{options:q,selectedType:F?void 0:Z,onTypeChange:K}),!B&&N&&X1.jsx("p",{className:"text-sm text-muted-foreground",children:N})]}),H&&X1.jsx("p",{role:"alert",className:"text-xs text-destructive",children:H}),X1.jsxs("div",{className:"flex items-center justify-end gap-2",children:[G,X1.jsx(E0,{onClick:W,disabled:X||F,children:X&&Y?Y:z})]})]})}function jd({options:$,selectedType:Z,onTypeChange:J}){return X1.jsx("div",{role:"group","aria-label":"Agent",className:e("grid gap-2",$.length>2?"grid-cols-3":"grid-cols-2"),children:$.map((Q)=>X1.jsx(Cd,{option:Q,selected:Z===Q.type,onSelect:J},Q.type))})}function Cd({option:$,selected:Z,onSelect:J}){let Q=Boolean($.disabledReason),X=X1.jsxs("button",{type:"button",disabled:$.disabled&&!Q,"aria-disabled":$.disabled||void 0,"aria-pressed":Z,onClick:(H)=>{if($.disabled){H.preventDefault();return}J($.type)},className:e("relative flex w-full flex-col items-start justify-between gap-6 rounded-xl bg-card p-4 text-left ring-1 ring-border transition-opacity outline-none focus-visible:ring-3 focus-visible:ring-ring/50",!Z&&"opacity-70",!Z&&!$.disabled&&"cursor-pointer hover:opacity-100",$.disabled&&"cursor-not-allowed"),children:[X1.jsxs("span",{className:"relative inline-flex",children:[X1.jsx(Td,{type:$.type}),Z&&X1.jsx(MG,{size:16,stroke:1.75,"aria-hidden":"true",className:"absolute -top-1.5 -right-1.5"})]}),X1.jsxs("span",{className:"flex min-w-0 flex-col gap-0.5",children:[X1.jsx("span",{className:"text-sm font-medium text-foreground",children:_q[$.type]}),X1.jsx("span",{className:"text-xs leading-4 text-muted-foreground",children:$.description})]})]});if(!Q)return X;return X1.jsxs(r1,{children:[X1.jsx(a1,{render:X}),X1.jsx(n1,{className:"max-w-64 text-center whitespace-pre-line",children:$.disabledReason})]})}function Td({type:$}){return X1.jsx("img",{src:H2[$],alt:"",className:"size-8 shrink-0"})}var r7=P(l(),1);function DG({children:$,closeDisabled:Z=!1}){return r7.jsxs(HG,{className:"w-[calc(100%-2rem)] max-w-md p-6",children:[r7.jsx(XG,{render:r7.jsx(E0,{variant:"ghost",size:"icon-sm","aria-label":"Close",className:"absolute top-4 right-4",disabled:Z,children:r7.jsx(Q8,{stroke:1.75})})}),$]})}var H1=P(l(),1),lO=i7[0];function DJ({trigger:$}){let[,Z]=I4(),J=sH(),Q=u_(),[X,H]=AJ.useState(!1),[G,z]=AJ.useState("agent"),[Y,K]=AJ.useState(lO),[W,B]=AJ.useState(""),q=W.trim(),U=q?fO(q):null,F=Q.isPending;function N(A){H(!1),Z(`/workspace/${A}`)}function L(){z("agent"),K(lO),B(""),Q.reset()}function V(){Q.reset(),z("name")}function M(){if(!q||U||F)return;Q.reset(),Q.mutate({name:q,type:Y},{onSuccess:(A)=>N(A.id)})}return H1.jsxs(p7,{open:X,onOpenChange:H,onOpenChangeComplete:(A)=>{if(!A)L()},children:[H1.jsx(DO,{render:$}),H1.jsx(DG,{children:G==="agent"?H1.jsx(AG,{title:"Create new workspace",selectedType:Y,availability:J.data?.availability,isPending:!1,secondaryAction:H1.jsx(Id,{}),primaryLabel:"Next",onTypeChange:K,onSubmit:V}):H1.jsx(Ed,{name:W,validationError:U,requestError:Q.error?.message,isPending:F,onNameChange:B,onSubmit:M})})]})}function Ed({name:$,validationError:Z,requestError:J,isPending:Q,onNameChange:X,onSubmit:H}){function G(z){z.preventDefault(),H()}return H1.jsxs("form",{className:"flex flex-col gap-5",onSubmit:G,children:[H1.jsxs("div",{className:"flex flex-col gap-0.5 pr-8",children:[H1.jsx(c7,{children:"Create new workspace"}),H1.jsx(GG,{children:"Give it a short and recognizable name"})]}),H1.jsxs("div",{className:"flex flex-col gap-2",children:[H1.jsx("label",{htmlFor:"workspace-name",className:"sr-only",children:"Workspace name"}),H1.jsx(e9,{id:"workspace-name",value:$,onChange:(z)=>X(z.target.value),placeholder:"my-workspace",autoFocus:!0,"aria-invalid":Boolean(Z),"aria-describedby":Z?"workspace-name-error":void 0,autoComplete:"off",spellCheck:!1}),Z&&H1.jsx("p",{id:"workspace-name-error",role:"alert",className:"text-xs text-destructive",children:Z})]}),J&&H1.jsx("p",{role:"alert",className:"text-xs text-destructive",children:J}),H1.jsx("div",{className:"flex items-center justify-end gap-2",children:H1.jsx(E0,{type:"submit",disabled:!$.trim()||Boolean(Z)||Q,children:Q?"Creating…":"Create workspace"})})]})}function Id(){return H1.jsxs(r1,{children:[H1.jsx(a1,{render:H1.jsx(E0,{variant:"secondary","aria-disabled":!0,onClick:(Z)=>Z.preventDefault(),className:"cursor-not-allowed opacity-50",children:"Use existing folder"})}),H1.jsx(n1,{className:"max-w-64",children:H1.jsxs("span",{className:"text-center",children:["Not supported yet — run"," ",H1.jsx("code",{className:"rounded-xs bg-accent px-1 py-0.5 font-mono whitespace-nowrap",children:"moi init"})," ","in the folder from your console to add it"]})})]})}var Z6=P(v(),1);var F0=P(v(),1),E3=P(W4(),1);var u1=P(v(),1);var _J=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function w3($){let Z=Object.prototype.toString.call($);return Z==="[object Window]"||Z==="[object global]"}function _G($){return"nodeType"in $}function I8($){var Z,J;if(!$)return window;if(w3($))return $;if(!_G($))return window;return(Z=(J=$.ownerDocument)==null?void 0:J.defaultView)!=null?Z:window}function OG($){let{Document:Z}=I8($);return $ instanceof Z}function n7($){if(w3($))return!1;return $ instanceof I8($).HTMLElement}function Pq($){return $ instanceof I8($).SVGElement}function j3($){if(!$)return document;if(w3($))return $.document;if(!_G($))return document;if(OG($))return $;if(n7($)||Pq($))return $.ownerDocument;return document}var y2=_J?u1.useLayoutEffect:u1.useEffect;function OJ($){let Z=u1.useRef($);return y2(()=>{Z.current=$}),u1.useCallback(function(){for(var J=arguments.length,Q=Array(J),X=0;X<J;X++)Q[X]=arguments[X];return Z.current==null?void 0:Z.current(...Q)},[])}function rO(){let $=u1.useRef(null),Z=u1.useCallback((Q,X)=>{$.current=setInterval(Q,X)},[]),J=u1.useCallback(()=>{if($.current!==null)clearInterval($.current),$.current=null},[]);return[Z,J]}function s7($,Z){if(Z===void 0)Z=[$];let J=u1.useRef($);return y2(()=>{if(J.current!==$)J.current=$},Z),J}function o7($,Z){let J=u1.useRef();return u1.useMemo(()=>{let Q=$(J.current);return J.current=Q,Q},[...Z])}function PJ($){let Z=OJ($),J=u1.useRef(null),Q=u1.useCallback((X)=>{if(X!==J.current)Z==null||Z(X,J.current);J.current=X},[]);return[J,Q]}function wJ($){let Z=u1.useRef();return u1.useEffect(()=>{Z.current=$},[$]),Z.current}var Oq={};function jJ($,Z){return u1.useMemo(()=>{if(Z)return Z;let J=Oq[$]==null?0:Oq[$]+1;return Oq[$]=J,$+"-"+J},[$,Z])}function aO($){return function(Z){for(var J=arguments.length,Q=Array(J>1?J-1:0),X=1;X<J;X++)Q[X-1]=arguments[X];return Q.reduce((H,G)=>{let z=Object.entries(G);for(let[Y,K]of z){let W=H[Y];if(W!=null)H[Y]=W+$*K}return H},{...Z})}}var C3=aO(1),CJ=aO(-1);function Rd($){return"clientX"in $&&"clientY"in $}function PG($){if(!$)return!1;let{KeyboardEvent:Z}=I8($.target);return Z&&$ instanceof Z}function kd($){if(!$)return!1;let{TouchEvent:Z}=I8($.target);return Z&&$ instanceof Z}function TJ($){if(kd($)){if($.touches&&$.touches.length){let{clientX:Z,clientY:J}=$.touches[0];return{x:Z,y:J}}else if($.changedTouches&&$.changedTouches.length){let{clientX:Z,clientY:J}=$.changedTouches[0];return{x:Z,y:J}}}if(Rd($))return{x:$.clientX,y:$.clientY};return null}var a7=Object.freeze({Translate:{toString($){if(!$)return;let{x:Z,y:J}=$;return"translate3d("+(Z?Math.round(Z):0)+"px, "+(J?Math.round(J):0)+"px, 0)"}},Scale:{toString($){if(!$)return;let{scaleX:Z,scaleY:J}=$;return"scaleX("+Z+") scaleY("+J+")"}},Transform:{toString($){if(!$)return;return[a7.Translate.toString($),a7.Scale.toString($)].join(" ")}},Transition:{toString($){let{property:Z,duration:J,easing:Q}=$;return Z+" "+J+"ms "+Q}}}),iO="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function nO($){if($.matches(iO))return $;return $.querySelector(iO)}var T3=P(v(),1),Sd={display:"none"};function sO($){let{id:Z,value:J}=$;return T3.default.createElement("div",{id:Z,style:Sd},J)}function oO($){let{id:Z,announcement:J,ariaLiveType:Q="assertive"}=$,X={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return T3.default.createElement("div",{id:Z,style:X,role:"status","aria-live":Q,"aria-atomic":!0},J)}function tO(){let[$,Z]=T3.useState("");return{announce:T3.useCallback((Q)=>{if(Q!=null)Z(Q)},[]),announcement:$}}var BP=F0.createContext(null);function bd($){let Z=F0.useContext(BP);F0.useEffect(()=>{if(!Z)throw Error("useDndMonitor must be used within a children of <DndContext>");return Z($)},[$,Z])}function yd(){let[$]=F0.useState(()=>new Set),Z=F0.useCallback((Q)=>{return $.add(Q),()=>$.delete(Q)},[$]);return[F0.useCallback((Q)=>{let{type:X,event:H}=Q;$.forEach((G)=>{var z;return(z=G[X])==null?void 0:z.call(G,H)})},[$]),Z]}var xd={draggable:`
|
|
23
|
-
To pick up a draggable item, press the space bar.
|
|
24
|
-
While dragging, use the arrow keys to move the item.
|
|
25
|
-
Press space again to drop the item in its new position, or press escape to cancel.
|
|
26
|
-
`},hd={onDragStart($){let{active:Z}=$;return"Picked up draggable item "+Z.id+"."},onDragOver($){let{active:Z,over:J}=$;if(J)return"Draggable item "+Z.id+" was moved over droppable area "+J.id+".";return"Draggable item "+Z.id+" is no longer over a droppable area."},onDragEnd($){let{active:Z,over:J}=$;if(J)return"Draggable item "+Z.id+" was dropped over droppable area "+J.id;return"Draggable item "+Z.id+" was dropped."},onDragCancel($){let{active:Z}=$;return"Dragging was cancelled. Draggable item "+Z.id+" was dropped."}};function gd($){let{announcements:Z=hd,container:J,hiddenTextDescribedById:Q,screenReaderInstructions:X=xd}=$,{announce:H,announcement:G}=tO(),z=jJ("DndLiveRegion"),[Y,K]=F0.useState(!1);if(F0.useEffect(()=>{K(!0)},[]),bd(F0.useMemo(()=>({onDragStart(B){let{active:q}=B;H(Z.onDragStart({active:q}))},onDragMove(B){let{active:q,over:U}=B;if(Z.onDragMove)H(Z.onDragMove({active:q,over:U}))},onDragOver(B){let{active:q,over:U}=B;H(Z.onDragOver({active:q,over:U}))},onDragEnd(B){let{active:q,over:U}=B;H(Z.onDragEnd({active:q,over:U}))},onDragCancel(B){let{active:q,over:U}=B;H(Z.onDragCancel({active:q,over:U}))}}),[H,Z])),!Y)return null;let W=F0.default.createElement(F0.default.Fragment,null,F0.default.createElement(sO,{id:Q,value:X.draggable}),F0.default.createElement(oO,{id:z,announcement:G}));return J?E3.createPortal(W,J):W}var o1;(function($){$.DragStart="dragStart",$.DragMove="dragMove",$.DragEnd="dragEnd",$.DragCancel="dragCancel",$.DragOver="dragOver",$.RegisterDroppable="registerDroppable",$.SetDroppableDisabled="setDroppableDisabled",$.UnregisterDroppable="unregisterDroppable"})(o1||(o1={}));function jG(){}function Rq($,Z){return F0.useMemo(()=>({sensor:$,options:Z!=null?Z:{}}),[$,Z])}function qP(){for(var $=arguments.length,Z=Array($),J=0;J<$;J++)Z[J]=arguments[J];return F0.useMemo(()=>[...Z].filter((Q)=>Q!=null),[...Z])}var G2=Object.freeze({x:0,y:0});function vd($,Z){return Math.sqrt(Math.pow($.x-Z.x,2)+Math.pow($.y-Z.y,2))}function fd($,Z){let J=TJ($);if(!J)return"0 0";let Q={x:(J.x-Z.left)/Z.width*100,y:(J.y-Z.top)/Z.height*100};return Q.x+"% "+Q.y+"%"}function md($,Z){let{data:{value:J}}=$,{data:{value:Q}}=Z;return J-Q}function ud($,Z){let{data:{value:J}}=$,{data:{value:Q}}=Z;return Q-J}function pd($,Z){if(!$||$.length===0)return null;let[J]=$;return Z?J[Z]:J}function eO($,Z,J){if(Z===void 0)Z=$.left;if(J===void 0)J=$.top;return{x:Z+$.width*0.5,y:J+$.height*0.5}}var UP=($)=>{let{collisionRect:Z,droppableRects:J,droppableContainers:Q}=$,X=eO(Z,Z.left,Z.top),H=[];for(let G of Q){let{id:z}=G,Y=J.get(z);if(Y){let K=vd(eO(Y),X);H.push({id:z,data:{droppableContainer:G,value:K}})}}return H.sort(md)};function cd($,Z){let J=Math.max(Z.top,$.top),Q=Math.max(Z.left,$.left),X=Math.min(Z.left+Z.width,$.left+$.width),H=Math.min(Z.top+Z.height,$.top+$.height),G=X-Q,z=H-J;if(Q<X&&J<H){let Y=Z.width*Z.height,K=$.width*$.height,W=G*z,B=W/(Y+K-W);return Number(B.toFixed(4))}return 0}var dd=($)=>{let{collisionRect:Z,droppableRects:J,droppableContainers:Q}=$,X=[];for(let H of Q){let{id:G}=H,z=J.get(G);if(z){let Y=cd(z,Z);if(Y>0)X.push({id:G,data:{droppableContainer:H,value:Y}})}}return X.sort(ud)};function ld($,Z,J){return{...$,scaleX:Z&&J?Z.width/J.width:1,scaleY:Z&&J?Z.height/J.height:1}}function FP($,Z){return $&&Z?{x:$.left-Z.left,y:$.top-Z.top}:G2}function id($){return function(J){for(var Q=arguments.length,X=Array(Q>1?Q-1:0),H=1;H<Q;H++)X[H-1]=arguments[H];return X.reduce((G,z)=>({...G,top:G.top+$*z.y,bottom:G.bottom+$*z.y,left:G.left+$*z.x,right:G.right+$*z.x}),{...J})}}var rd=id(1);function NP($){if($.startsWith("matrix3d(")){let Z=$.slice(9,-1).split(/, /);return{x:+Z[12],y:+Z[13],scaleX:+Z[0],scaleY:+Z[5]}}else if($.startsWith("matrix(")){let Z=$.slice(7,-1).split(/, /);return{x:+Z[4],y:+Z[5],scaleX:+Z[0],scaleY:+Z[3]}}return null}function ad($,Z,J){let Q=NP(Z);if(!Q)return $;let{scaleX:X,scaleY:H,x:G,y:z}=Q,Y=$.left-G-(1-X)*parseFloat(J),K=$.top-z-(1-H)*parseFloat(J.slice(J.indexOf(" ")+1)),W=X?$.width/X:$.width,B=H?$.height/H:$.height;return{width:W,height:B,top:K,right:Y+W,bottom:K+B,left:Y}}var nd={ignoreTransform:!1};function RJ($,Z){if(Z===void 0)Z=nd;let J=$.getBoundingClientRect();if(Z.ignoreTransform){let{transform:K,transformOrigin:W}=I8($).getComputedStyle($);if(K)J=ad(J,K,W)}let{top:Q,left:X,width:H,height:G,bottom:z,right:Y}=J;return{top:Q,left:X,width:H,height:G,bottom:z,right:Y}}function $P($){return RJ($,{ignoreTransform:!0})}function sd($){let{innerWidth:Z,innerHeight:J}=$;return{top:0,left:0,right:Z,bottom:J,width:Z,height:J}}function od($,Z){if(Z===void 0)Z=I8($).getComputedStyle($);return Z.position==="fixed"}function td($,Z){if(Z===void 0)Z=I8($).getComputedStyle($);let J=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some((X)=>{let H=Z[X];return typeof H==="string"?J.test(H):!1})}function kq($,Z){let J=[];function Q(X){if(Z!=null&&J.length>=Z)return J;if(!X)return J;if(OG(X)&&X.scrollingElement!=null&&!J.includes(X.scrollingElement))return J.push(X.scrollingElement),J;if(!n7(X)||Pq(X))return J;if(J.includes(X))return J;let H=I8($).getComputedStyle(X);if(X!==$){if(td(X,H))J.push(X)}if(od(X,H))return J;return Q(X.parentNode)}if(!$)return J;return Q($)}function VP($){let[Z]=kq($,1);return Z!=null?Z:null}function wq($){if(!_J||!$)return null;if(w3($))return $;if(!_G($))return null;if(OG($)||$===j3($).scrollingElement)return window;if(n7($))return $;return null}function LP($){if(w3($))return $.scrollX;return $.scrollLeft}function MP($){if(w3($))return $.scrollY;return $.scrollTop}function Tq($){return{x:LP($),y:MP($)}}var z8;(function($){$[$.Forward=1]="Forward",$[$.Backward=-1]="Backward"})(z8||(z8={}));function AP($){if(!_J||!$)return!1;return $===document.scrollingElement}function DP($){let Z={x:0,y:0},J=AP($)?{height:window.innerHeight,width:window.innerWidth}:{height:$.clientHeight,width:$.clientWidth},Q={x:$.scrollWidth-J.width,y:$.scrollHeight-J.height},X=$.scrollTop<=Z.y,H=$.scrollLeft<=Z.x,G=$.scrollTop>=Q.y,z=$.scrollLeft>=Q.x;return{isTop:X,isLeft:H,isBottom:G,isRight:z,maxScroll:Q,minScroll:Z}}var ed={x:0.2,y:0.2};function $l($,Z,J,Q,X){let{top:H,left:G,right:z,bottom:Y}=J;if(Q===void 0)Q=10;if(X===void 0)X=ed;let{isTop:K,isBottom:W,isLeft:B,isRight:q}=DP($),U={x:0,y:0},F={x:0,y:0},N={height:Z.height*X.y,width:Z.width*X.x};if(!K&&H<=Z.top+N.height)U.y=z8.Backward,F.y=Q*Math.abs((Z.top+N.height-H)/N.height);else if(!W&&Y>=Z.bottom-N.height)U.y=z8.Forward,F.y=Q*Math.abs((Z.bottom-N.height-Y)/N.height);if(!q&&z>=Z.right-N.width)U.x=z8.Forward,F.x=Q*Math.abs((Z.right-N.width-z)/N.width);else if(!B&&G<=Z.left+N.width)U.x=z8.Backward,F.x=Q*Math.abs((Z.left+N.width-G)/N.width);return{direction:U,speed:F}}function Zl($){if($===document.scrollingElement){let{innerWidth:H,innerHeight:G}=window;return{top:0,left:0,right:H,bottom:G,width:H,height:G}}let{top:Z,left:J,right:Q,bottom:X}=$.getBoundingClientRect();return{top:Z,left:J,right:Q,bottom:X,width:$.clientWidth,height:$.clientHeight}}function _P($){return $.reduce((Z,J)=>{return C3(Z,Tq(J))},G2)}function Jl($){return $.reduce((Z,J)=>{return Z+LP(J)},0)}function Ql($){return $.reduce((Z,J)=>{return Z+MP(J)},0)}function OP($,Z){if(Z===void 0)Z=RJ;if(!$)return;let{top:J,left:Q,bottom:X,right:H}=Z($);if(!VP($))return;if(X<=0||H<=0||J>=window.innerHeight||Q>=window.innerWidth)$.scrollIntoView({block:"center",inline:"center"})}var Xl=[["x",["left","right"],Jl],["y",["top","bottom"],Ql]];class TG{constructor($,Z){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;let J=kq(Z),Q=_P(J);this.rect={...$},this.width=$.width,this.height=$.height;for(let[X,H,G]of Xl)for(let z of H)Object.defineProperty(this,z,{get:()=>{let Y=G(J),K=Q[X]-Y;return this.rect[z]+K},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class t7{constructor($){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach((Z)=>{var J;return(J=this.target)==null?void 0:J.removeEventListener(...Z)})},this.target=$}add($,Z,J){var Q;(Q=this.target)==null||Q.addEventListener($,Z,J),this.listeners.push([$,Z,J])}}function Hl($){let{EventTarget:Z}=I8($);return $ instanceof Z?$:j3($)}function jq($,Z){let J=Math.abs($.x),Q=Math.abs($.y);if(typeof Z==="number")return Math.sqrt(J**2+Q**2)>Z;if("x"in Z&&"y"in Z)return J>Z.x&&Q>Z.y;if("x"in Z)return J>Z.x;if("y"in Z)return Q>Z.y;return!1}var m4;(function($){$.Click="click",$.DragStart="dragstart",$.Keydown="keydown",$.ContextMenu="contextmenu",$.Resize="resize",$.SelectionChange="selectionchange",$.VisibilityChange="visibilitychange"})(m4||(m4={}));function ZP($){$.preventDefault()}function Gl($){$.stopPropagation()}var I5;(function($){$.Space="Space",$.Down="ArrowDown",$.Right="ArrowRight",$.Left="ArrowLeft",$.Up="ArrowUp",$.Esc="Escape",$.Enter="Enter",$.Tab="Tab"})(I5||(I5={}));var PP={start:[I5.Space,I5.Enter],cancel:[I5.Esc],end:[I5.Space,I5.Enter,I5.Tab]},zl=($,Z)=>{let{currentCoordinates:J}=Z;switch($.code){case I5.Right:return{...J,x:J.x+25};case I5.Left:return{...J,x:J.x-25};case I5.Down:return{...J,y:J.y+25};case I5.Up:return{...J,y:J.y-25}}return};class kJ{constructor($){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=$;let{event:{target:Z}}=$;this.props=$,this.listeners=new t7(j3(Z)),this.windowListeners=new t7(I8(Z)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(m4.Resize,this.handleCancel),this.windowListeners.add(m4.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(m4.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:$,onStart:Z}=this.props,J=$.node.current;if(J)OP(J);Z(G2)}handleKeyDown($){if(PG($)){let{active:Z,context:J,options:Q}=this.props,{keyboardCodes:X=PP,coordinateGetter:H=zl,scrollBehavior:G="smooth"}=Q,{code:z}=$;if(X.end.includes(z)){this.handleEnd($);return}if(X.cancel.includes(z)){this.handleCancel($);return}let{collisionRect:Y}=J.current,K=Y?{x:Y.left,y:Y.top}:G2;if(!this.referenceCoordinates)this.referenceCoordinates=K;let W=H($,{active:Z,context:J.current,currentCoordinates:K});if(W){let B=CJ(W,K),q={x:0,y:0},{scrollableAncestors:U}=J.current;for(let F of U){let N=$.code,{isTop:L,isRight:V,isLeft:M,isBottom:A,maxScroll:O,minScroll:_}=DP(F),D=Zl(F),T={x:Math.min(N===I5.Right?D.right-D.width/2:D.right,Math.max(N===I5.Right?D.left:D.left+D.width/2,W.x)),y:Math.min(N===I5.Down?D.bottom-D.height/2:D.bottom,Math.max(N===I5.Down?D.top:D.top+D.height/2,W.y))},k=N===I5.Right&&!V||N===I5.Left&&!M,x=N===I5.Down&&!A||N===I5.Up&&!L;if(k&&T.x!==W.x){let I=F.scrollLeft+B.x,y=N===I5.Right&&I<=O.x||N===I5.Left&&I>=_.x;if(y&&!B.y){F.scrollTo({left:I,behavior:G});return}if(y)q.x=F.scrollLeft-I;else q.x=N===I5.Right?F.scrollLeft-O.x:F.scrollLeft-_.x;if(q.x)F.scrollBy({left:-q.x,behavior:G});break}else if(x&&T.y!==W.y){let I=F.scrollTop+B.y,y=N===I5.Down&&I<=O.y||N===I5.Up&&I>=_.y;if(y&&!B.x){F.scrollTo({top:I,behavior:G});return}if(y)q.y=F.scrollTop-I;else q.y=N===I5.Down?F.scrollTop-O.y:F.scrollTop-_.y;if(q.y)F.scrollBy({top:-q.y,behavior:G});break}}this.handleMove($,C3(CJ(W,this.referenceCoordinates),q))}}}handleMove($,Z){let{onMove:J}=this.props;$.preventDefault(),J(Z)}handleEnd($){let{onEnd:Z}=this.props;$.preventDefault(),this.detach(),Z()}handleCancel($){let{onCancel:Z}=this.props;$.preventDefault(),this.detach(),Z()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}kJ.activators=[{eventName:"onKeyDown",handler:($,Z,J)=>{let{keyboardCodes:Q=PP,onActivation:X}=Z,{active:H}=J,{code:G}=$.nativeEvent;if(Q.start.includes(G)){let z=H.activatorNode.current;if(z&&$.target!==z)return!1;return $.preventDefault(),X==null||X({event:$.nativeEvent}),!0}return!1}}];function JP($){return Boolean($&&"distance"in $)}function QP($){return Boolean($&&"delay"in $)}class EG{constructor($,Z,J){var Q;if(J===void 0)J=Hl($.event.target);this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=$,this.events=Z;let{event:X}=$,{target:H}=X;this.props=$,this.events=Z,this.document=j3(H),this.documentListeners=new t7(this.document),this.listeners=new t7(J),this.windowListeners=new t7(I8(H)),this.initialCoordinates=(Q=TJ(X))!=null?Q:G2,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){let{events:$,props:{options:{activationConstraint:Z,bypassActivationConstraint:J}}}=this;if(this.listeners.add($.move.name,this.handleMove,{passive:!1}),this.listeners.add($.end.name,this.handleEnd),$.cancel)this.listeners.add($.cancel.name,this.handleCancel);if(this.windowListeners.add(m4.Resize,this.handleCancel),this.windowListeners.add(m4.DragStart,ZP),this.windowListeners.add(m4.VisibilityChange,this.handleCancel),this.windowListeners.add(m4.ContextMenu,ZP),this.documentListeners.add(m4.Keydown,this.handleKeydown),Z){if(J!=null&&J({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(QP(Z)){this.timeoutId=setTimeout(this.handleStart,Z.delay),this.handlePending(Z);return}if(JP(Z)){this.handlePending(Z);return}}this.handleStart()}detach(){if(this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null)clearTimeout(this.timeoutId),this.timeoutId=null}handlePending($,Z){let{active:J,onPending:Q}=this.props;Q(J,$,this.initialCoordinates,Z)}handleStart(){let{initialCoordinates:$}=this,{onStart:Z}=this.props;if($)this.activated=!0,this.documentListeners.add(m4.Click,Gl,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(m4.SelectionChange,this.removeTextSelection),Z($)}handleMove($){var Z;let{activated:J,initialCoordinates:Q,props:X}=this,{onMove:H,options:{activationConstraint:G}}=X;if(!Q)return;let z=(Z=TJ($))!=null?Z:G2,Y=CJ(Q,z);if(!J&&G){if(JP(G)){if(G.tolerance!=null&&jq(Y,G.tolerance))return this.handleCancel();if(jq(Y,G.distance))return this.handleStart()}if(QP(G)){if(jq(Y,G.tolerance))return this.handleCancel()}this.handlePending(G,Y);return}if($.cancelable)$.preventDefault();H(z)}handleEnd(){let{onAbort:$,onEnd:Z}=this.props;if(this.detach(),!this.activated)$(this.props.active);Z()}handleCancel(){let{onAbort:$,onCancel:Z}=this.props;if(this.detach(),!this.activated)$(this.props.active);Z()}handleKeydown($){if($.code===I5.Esc)this.handleCancel()}removeTextSelection(){var $;($=this.document.getSelection())==null||$.removeAllRanges()}}var Yl={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class SJ extends EG{constructor($){let{event:Z}=$,J=j3(Z.target);super($,Yl,J)}}SJ.activators=[{eventName:"onPointerDown",handler:($,Z)=>{let{nativeEvent:J}=$,{onActivation:Q}=Z;if(!J.isPrimary||J.button!==0)return!1;return Q==null||Q({event:J}),!0}}];var Kl={move:{name:"mousemove"},end:{name:"mouseup"}},Eq;(function($){$[$.RightClick=2]="RightClick"})(Eq||(Eq={}));class wP extends EG{constructor($){super($,Kl,j3($.event.target))}}wP.activators=[{eventName:"onMouseDown",handler:($,Z)=>{let{nativeEvent:J}=$,{onActivation:Q}=Z;if(J.button===Eq.RightClick)return!1;return Q==null||Q({event:J}),!0}}];var Cq={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class jP extends EG{constructor($){super($,Cq)}static setup(){return window.addEventListener(Cq.move.name,$,{capture:!1,passive:!1}),function(){window.removeEventListener(Cq.move.name,$)};function $(){}}}jP.activators=[{eventName:"onTouchStart",handler:($,Z)=>{let{nativeEvent:J}=$,{onActivation:Q}=Z,{touches:X}=J;if(X.length>1)return!1;return Q==null||Q({event:J}),!0}}];var EJ;(function($){$[$.Pointer=0]="Pointer",$[$.DraggableRect=1]="DraggableRect"})(EJ||(EJ={}));var CG;(function($){$[$.TreeOrder=0]="TreeOrder",$[$.ReversedTreeOrder=1]="ReversedTreeOrder"})(CG||(CG={}));function Wl($){let{acceleration:Z,activator:J=EJ.Pointer,canScroll:Q,draggingRect:X,enabled:H,interval:G=5,order:z=CG.TreeOrder,pointerCoordinates:Y,scrollableAncestors:K,scrollableAncestorRects:W,delta:B,threshold:q}=$,U=ql({delta:B,disabled:!H}),[F,N]=rO(),L=F0.useRef({x:0,y:0}),V=F0.useRef({x:0,y:0}),M=F0.useMemo(()=>{switch(J){case EJ.Pointer:return Y?{top:Y.y,bottom:Y.y,left:Y.x,right:Y.x}:null;case EJ.DraggableRect:return X}},[J,X,Y]),A=F0.useRef(null),O=F0.useCallback(()=>{let D=A.current;if(!D)return;let T=L.current.x*V.current.x,k=L.current.y*V.current.y;D.scrollBy(T,k)},[]),_=F0.useMemo(()=>z===CG.TreeOrder?[...K].reverse():K,[z,K]);F0.useEffect(()=>{if(!H||!K.length||!M){N();return}for(let D of _){if((Q==null?void 0:Q(D))===!1)continue;let T=K.indexOf(D),k=W[T];if(!k)continue;let{direction:x,speed:I}=$l(D,k,M,Z,q);for(let y of["x","y"])if(!U[y][x[y]])I[y]=0,x[y]=0;if(I.x>0||I.y>0){N(),A.current=D,F(O,G),L.current=I,V.current=x;return}}L.current={x:0,y:0},V.current={x:0,y:0},N()},[Z,O,Q,N,H,G,JSON.stringify(M),JSON.stringify(U),F,K,_,W,JSON.stringify(q)])}var Bl={x:{[z8.Backward]:!1,[z8.Forward]:!1},y:{[z8.Backward]:!1,[z8.Forward]:!1}};function ql($){let{delta:Z,disabled:J}=$,Q=wJ(Z);return o7((X)=>{if(J||!Q||!X)return Bl;let H={x:Math.sign(Z.x-Q.x),y:Math.sign(Z.y-Q.y)};return{x:{[z8.Backward]:X.x[z8.Backward]||H.x===-1,[z8.Forward]:X.x[z8.Forward]||H.x===1},y:{[z8.Backward]:X.y[z8.Backward]||H.y===-1,[z8.Forward]:X.y[z8.Forward]||H.y===1}}},[J,Z,Q])}function Ul($,Z){let J=Z!=null?$.get(Z):void 0,Q=J?J.node.current:null;return o7((X)=>{var H;if(Z==null)return null;return(H=Q!=null?Q:X)!=null?H:null},[Q,Z])}function Fl($,Z){return F0.useMemo(()=>$.reduce((J,Q)=>{let{sensor:X}=Q,H=X.activators.map((G)=>({eventName:G.eventName,handler:Z(G.handler,Q)}));return[...J,...H]},[]),[$,Z])}var IJ;(function($){$[$.Always=0]="Always",$[$.BeforeDragging=1]="BeforeDragging",$[$.WhileDragging=2]="WhileDragging"})(IJ||(IJ={}));var Iq;(function($){$.Optimized="optimized"})(Iq||(Iq={}));var XP=new Map;function Nl($,Z){let{dragging:J,dependencies:Q,config:X}=Z,[H,G]=F0.useState(null),{frequency:z,measure:Y,strategy:K}=X,W=F0.useRef($),B=L(),q=s7(B),U=F0.useCallback(function(V){if(V===void 0)V=[];if(q.current)return;G((M)=>{if(M===null)return V;return M.concat(V.filter((A)=>!M.includes(A)))})},[q]),F=F0.useRef(null),N=o7((V)=>{if(B&&!J)return XP;if(!V||V===XP||W.current!==$||H!=null){let M=new Map;for(let A of $){if(!A)continue;if(H&&H.length>0&&!H.includes(A.id)&&A.rect.current){M.set(A.id,A.rect.current);continue}let O=A.node.current,_=O?new TG(Y(O),O):null;if(A.rect.current=_,_)M.set(A.id,_)}return M}return V},[$,H,J,B,Y]);return F0.useEffect(()=>{W.current=$},[$]),F0.useEffect(()=>{if(B)return;U()},[J,B]),F0.useEffect(()=>{if(H&&H.length>0)G(null)},[JSON.stringify(H)]),F0.useEffect(()=>{if(B||typeof z!=="number"||F.current!==null)return;F.current=setTimeout(()=>{U(),F.current=null},z)},[z,B,U,...Q]),{droppableRects:N,measureDroppableContainers:U,measuringScheduled:H!=null};function L(){switch(K){case IJ.Always:return!1;case IJ.BeforeDragging:return J;default:return!J}}}function Sq($,Z){return o7((J)=>{if(!$)return null;if(J)return J;return typeof Z==="function"?Z($):$},[Z,$])}function Vl($,Z){return Sq($,Z)}function Ll($){let{callback:Z,disabled:J}=$,Q=OJ(Z),X=F0.useMemo(()=>{if(J||typeof window>"u"||typeof window.MutationObserver>"u")return;let{MutationObserver:H}=window;return new H(Q)},[Q,J]);return F0.useEffect(()=>{return()=>X==null?void 0:X.disconnect()},[X]),X}function IG($){let{callback:Z,disabled:J}=$,Q=OJ(Z),X=F0.useMemo(()=>{if(J||typeof window>"u"||typeof window.ResizeObserver>"u")return;let{ResizeObserver:H}=window;return new H(Q)},[J]);return F0.useEffect(()=>{return()=>X==null?void 0:X.disconnect()},[X]),X}function Ml($){return new TG(RJ($),$)}function HP($,Z,J){if(Z===void 0)Z=Ml;let[Q,X]=F0.useState(null);function H(){X((Y)=>{if(!$)return null;if($.isConnected===!1){var K;return(K=Y!=null?Y:J)!=null?K:null}let W=Z($);if(JSON.stringify(Y)===JSON.stringify(W))return Y;return W})}let G=Ll({callback(Y){if(!$)return;for(let K of Y){let{type:W,target:B}=K;if(W==="childList"&&B instanceof HTMLElement&&B.contains($)){H();break}}}}),z=IG({callback:H});return y2(()=>{if(H(),$)z==null||z.observe($),G==null||G.observe(document.body,{childList:!0,subtree:!0});else z==null||z.disconnect(),G==null||G.disconnect()},[$]),Q}function Al($){let Z=Sq($);return FP($,Z)}var GP=[];function Dl($){let Z=F0.useRef($),J=o7((Q)=>{if(!$)return GP;if(Q&&Q!==GP&&$&&Z.current&&$.parentNode===Z.current.parentNode)return Q;return kq($)},[$]);return F0.useEffect(()=>{Z.current=$},[$]),J}function _l($){let[Z,J]=F0.useState(null),Q=F0.useRef($),X=F0.useCallback((H)=>{let G=wq(H.target);if(!G)return;J((z)=>{if(!z)return null;return z.set(G,Tq(G)),new Map(z)})},[]);return F0.useEffect(()=>{let H=Q.current;if($!==H){G(H);let z=$.map((Y)=>{let K=wq(Y);if(K)return K.addEventListener("scroll",X,{passive:!0}),[K,Tq(K)];return null}).filter((Y)=>Y!=null);J(z.length?new Map(z):null),Q.current=$}return()=>{G($),G(H)};function G(z){z.forEach((Y)=>{let K=wq(Y);K==null||K.removeEventListener("scroll",X)})}},[X,$]),F0.useMemo(()=>{if($.length)return Z?Array.from(Z.values()).reduce((H,G)=>C3(H,G),G2):_P($);return G2},[$,Z])}function zP($,Z){if(Z===void 0)Z=[];let J=F0.useRef(null);return F0.useEffect(()=>{J.current=null},Z),F0.useEffect(()=>{let Q=$!==G2;if(Q&&!J.current)J.current=$;if(!Q&&J.current)J.current=null},[$]),J.current?CJ($,J.current):G2}function Ol($){F0.useEffect(()=>{if(!_J)return;let Z=$.map((J)=>{let{sensor:Q}=J;return Q.setup==null?void 0:Q.setup()});return()=>{for(let J of Z)J==null||J()}},$.map((Z)=>{let{sensor:J}=Z;return J}))}function Pl($,Z){return F0.useMemo(()=>{return $.reduce((J,Q)=>{let{eventName:X,handler:H}=Q;return J[X]=(G)=>{H(G,Z)},J},{})},[$,Z])}function CP($){return F0.useMemo(()=>$?sd($):null,[$])}var YP=[];function wl($,Z){if(Z===void 0)Z=RJ;let[J]=$,Q=CP(J?I8(J):null),[X,H]=F0.useState(YP);function G(){H(()=>{if(!$.length)return YP;return $.map((Y)=>AP(Y)?Q:new TG(Z(Y),Y))})}let z=IG({callback:G});return y2(()=>{z==null||z.disconnect(),G(),$.forEach((Y)=>z==null?void 0:z.observe(Y))},[$]),X}function TP($){if(!$)return null;if($.children.length>1)return $;let Z=$.children[0];return n7(Z)?Z:$}function jl($){let{measure:Z}=$,[J,Q]=F0.useState(null),X=F0.useCallback((K)=>{for(let{target:W}of K)if(n7(W)){Q((B)=>{let q=Z(W);return B?{...B,width:q.width,height:q.height}:q});break}},[Z]),H=IG({callback:X}),G=F0.useCallback((K)=>{let W=TP(K);if(H==null||H.disconnect(),W)H==null||H.observe(W);Q(W?Z(W):null)},[Z,H]),[z,Y]=PJ(G);return F0.useMemo(()=>({nodeRef:z,rect:J,setRef:Y}),[J,z,Y])}var Cl=[{sensor:SJ,options:{}},{sensor:kJ,options:{}}],Tl={current:{}},wG={draggable:{measure:$P},droppable:{measure:$P,strategy:IJ.WhileDragging,frequency:Iq.Optimized},dragOverlay:{measure:RJ}};class e7 extends Map{get($){var Z;return $!=null?(Z=super.get($))!=null?Z:void 0:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(($)=>{let{disabled:Z}=$;return!Z})}getNodeFor($){var Z,J;return(Z=(J=this.get($))==null?void 0:J.node.current)!=null?Z:void 0}}var El={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new e7,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:jG},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:wG,measureDroppableContainers:jG,windowRect:null,measuringScheduled:!1},EP={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:jG,draggableNodes:new Map,over:null,measureDroppableContainers:jG},bJ=F0.createContext(EP),IP=F0.createContext(El);function Il(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new e7}}}function Rl($,Z){switch(Z.type){case o1.DragStart:return{...$,draggable:{...$.draggable,initialCoordinates:Z.initialCoordinates,active:Z.active}};case o1.DragMove:if($.draggable.active==null)return $;return{...$,draggable:{...$.draggable,translate:{x:Z.coordinates.x-$.draggable.initialCoordinates.x,y:Z.coordinates.y-$.draggable.initialCoordinates.y}}};case o1.DragEnd:case o1.DragCancel:return{...$,draggable:{...$.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case o1.RegisterDroppable:{let{element:J}=Z,{id:Q}=J,X=new e7($.droppable.containers);return X.set(Q,J),{...$,droppable:{...$.droppable,containers:X}}}case o1.SetDroppableDisabled:{let{id:J,key:Q,disabled:X}=Z,H=$.droppable.containers.get(J);if(!H||Q!==H.key)return $;let G=new e7($.droppable.containers);return G.set(J,{...H,disabled:X}),{...$,droppable:{...$.droppable,containers:G}}}case o1.UnregisterDroppable:{let{id:J,key:Q}=Z,X=$.droppable.containers.get(J);if(!X||Q!==X.key)return $;let H=new e7($.droppable.containers);return H.delete(J),{...$,droppable:{...$.droppable,containers:H}}}default:return $}}function kl($){let{disabled:Z}=$,{active:J,activatorEvent:Q,draggableNodes:X}=F0.useContext(bJ),H=wJ(Q),G=wJ(J==null?void 0:J.id);return F0.useEffect(()=>{if(Z)return;if(!Q&&H&&G!=null){if(!PG(H))return;if(document.activeElement===H.target)return;let z=X.get(G);if(!z)return;let{activatorNode:Y,node:K}=z;if(!Y.current&&!K.current)return;requestAnimationFrame(()=>{for(let W of[Y.current,K.current]){if(!W)continue;let B=nO(W);if(B){B.focus();break}}})}},[Q,Z,X,G,H]),null}function RP($,Z){let{transform:J,...Q}=Z;return $!=null&&$.length?$.reduce((X,H)=>{return H({transform:X,...Q})},J):J}function Sl($){return F0.useMemo(()=>({draggable:{...wG.draggable,...$==null?void 0:$.draggable},droppable:{...wG.droppable,...$==null?void 0:$.droppable},dragOverlay:{...wG.dragOverlay,...$==null?void 0:$.dragOverlay}}),[$==null?void 0:$.draggable,$==null?void 0:$.droppable,$==null?void 0:$.dragOverlay])}function bl($){let{activeNode:Z,measure:J,initialRect:Q,config:X=!0}=$,H=F0.useRef(!1),{x:G,y:z}=typeof X==="boolean"?{x:X,y:X}:X;y2(()=>{if(!G&&!z||!Z){H.current=!1;return}if(H.current||!Q)return;let K=Z==null?void 0:Z.node.current;if(!K||K.isConnected===!1)return;let W=J(K),B=FP(W,Q);if(!G)B.x=0;if(!z)B.y=0;if(H.current=!0,Math.abs(B.x)>0||Math.abs(B.y)>0){let q=VP(K);if(q)q.scrollBy({top:B.y,left:B.x})}},[Z,G,z,Q,J])}var RG=F0.createContext({...G2,scaleX:1,scaleY:1}),$6;(function($){$[$.Uninitialized=0]="Uninitialized",$[$.Initializing=1]="Initializing",$[$.Initialized=2]="Initialized"})($6||($6={}));var kP=F0.memo(function(Z){var J,Q,X,H;let{id:G,accessibility:z,autoScroll:Y=!0,children:K,sensors:W=Cl,collisionDetection:B=dd,measuring:q,modifiers:U,...F}=Z,N=F0.useReducer(Rl,void 0,Il),[L,V]=N,[M,A]=yd(),[O,_]=F0.useState($6.Uninitialized),D=O===$6.Initialized,{draggable:{active:T,nodes:k,translate:x},droppable:{containers:I}}=L,y=T!=null?k.get(T):null,C=F0.useRef({initial:null,translated:null}),j=F0.useMemo(()=>{var T0;return T!=null?{id:T,data:(T0=y==null?void 0:y.data)!=null?T0:Tl,rect:C}:null},[T,y]),R=F0.useRef(null),[S,E]=F0.useState(null),[b,g]=F0.useState(null),u=s7(F,Object.values(F)),w=jJ("DndDescribedBy",G),s=F0.useMemo(()=>I.getEnabled(),[I]),z0=Sl(q),{droppableRects:h,measureDroppableContainers:t,measuringScheduled:M0}=Nl(s,{dragging:D,dependencies:[x.x,x.y],config:z0.droppable}),d=Ul(k,T),Y0=F0.useMemo(()=>b?TJ(b):null,[b]),B0=R1(),J0=Vl(d,z0.draggable.measure);bl({activeNode:T!=null?k.get(T):null,config:B0.layoutShiftCompensation,initialRect:J0,measure:z0.draggable.measure});let H0=HP(d,z0.draggable.measure,J0),N0=HP(d?d.parentElement:null),c=F0.useRef({activatorEvent:null,active:null,activeNode:d,collisionRect:null,collisions:null,droppableRects:h,draggableNodes:k,draggingNode:null,draggingNodeRect:null,droppableContainers:I,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Z0=I.getNodeFor((J=c.current.over)==null?void 0:J.id),$0=jl({measure:z0.dragOverlay.measure}),G0=(Q=$0.nodeRef.current)!=null?Q:d,r=D?(X=$0.rect)!=null?X:H0:null,Q0=Boolean($0.nodeRef.current&&$0.rect),a=Al(Q0?null:H0),p=CP(G0?I8(G0):null),o=Dl(D?Z0!=null?Z0:d:null),n=wl(o),V0=RP(U,{transform:{x:x.x-a.x,y:x.y-a.y,scaleX:1,scaleY:1},activatorEvent:b,active:j,activeNodeRect:H0,containerNodeRect:N0,draggingNodeRect:r,over:c.current.over,overlayNodeRect:$0.rect,scrollableAncestors:o,scrollableAncestorRects:n,windowRect:p}),w0=Y0?C3(Y0,x):null,v0=_l(o),c0=zP(v0),m=zP(v0,[H0]),i=C3(V0,c0),f=r?rd(r,V0):null,X0=j&&f?B({active:j,collisionRect:f,droppableRects:h,droppableContainers:s,pointerCoordinates:w0}):null,L0=pd(X0,"id"),[k0,r0]=F0.useState(null),J5=Q0?V0:C3(V0,m),m0=ld(J5,(H=k0==null?void 0:k0.rect)!=null?H:null,H0),P0=F0.useRef(null),f0=F0.useCallback((T0,b0)=>{let{sensor:p0,options:$5}=b0;if(R.current==null)return;let K5=k.get(R.current);if(!K5)return;let O5=T0.nativeEvent,m5=new p0({active:R.current,activeNode:K5,event:O5,options:$5,context:c,onAbort(W5){if(!k.get(W5))return;let{onDragAbort:k1}=u.current,x1={id:W5};k1==null||k1(x1),M({type:"onDragAbort",event:x1})},onPending(W5,K1,k1,x1){if(!k.get(W5))return;let{onDragPending:t0}=u.current,u0={id:W5,constraint:K1,initialCoordinates:k1,offset:x1};t0==null||t0(u0),M({type:"onDragPending",event:u0})},onStart(W5){let K1=R.current;if(K1==null)return;let k1=k.get(K1);if(!k1)return;let{onDragStart:x1}=u.current,y0={activatorEvent:O5,active:{id:K1,data:k1.data,rect:C}};E3.unstable_batchedUpdates(()=>{x1==null||x1(y0),_($6.Initializing),V({type:o1.DragStart,initialCoordinates:W5,active:K1}),M({type:"onDragStart",event:y0}),E(P0.current),g(O5)})},onMove(W5){V({type:o1.DragMove,coordinates:W5})},onEnd:u5(o1.DragEnd),onCancel:u5(o1.DragCancel)});P0.current=m5;function u5(W5){return async function(){let{active:k1,collisions:x1,over:y0,scrollAdjustedTranslate:t0}=c.current,u0=null;if(k1&&t0){let{cancelDrop:G5}=u.current;if(u0={activatorEvent:O5,active:k1,collisions:x1,delta:t0,over:y0},W5===o1.DragEnd&&typeof G5==="function"){if(await Promise.resolve(G5(u0)))W5=o1.DragCancel}}R.current=null,E3.unstable_batchedUpdates(()=>{V({type:W5}),_($6.Uninitialized),r0(null),E(null),g(null),P0.current=null;let G5=W5===o1.DragEnd?"onDragEnd":"onDragCancel";if(u0){let C5=u.current[G5];C5==null||C5(u0),M({type:G5,event:u0})}})}}},[k]),h0=F0.useCallback((T0,b0)=>{return(p0,$5)=>{let K5=p0.nativeEvent,O5=k.get($5);if(R.current!==null||!O5||K5.dndKit||K5.defaultPrevented)return;let m5={active:O5};if(T0(p0,b0.options,m5)===!0)K5.dndKit={capturedBy:b0.sensor},R.current=$5,f0(p0,b0)}},[k,f0]),a0=Fl(W,h0);Ol(W),y2(()=>{if(H0&&O===$6.Initializing)_($6.Initialized)},[H0,O]),F0.useEffect(()=>{let{onDragMove:T0}=u.current,{active:b0,activatorEvent:p0,collisions:$5,over:K5}=c.current;if(!b0||!p0)return;let O5={active:b0,activatorEvent:p0,collisions:$5,delta:{x:i.x,y:i.y},over:K5};E3.unstable_batchedUpdates(()=>{T0==null||T0(O5),M({type:"onDragMove",event:O5})})},[i.x,i.y]),F0.useEffect(()=>{let{active:T0,activatorEvent:b0,collisions:p0,droppableContainers:$5,scrollAdjustedTranslate:K5}=c.current;if(!T0||R.current==null||!b0||!K5)return;let{onDragOver:O5}=u.current,m5=$5.get(L0),u5=m5&&m5.rect.current?{id:m5.id,rect:m5.rect.current,data:m5.data,disabled:m5.disabled}:null,W5={active:T0,activatorEvent:b0,collisions:p0,delta:{x:K5.x,y:K5.y},over:u5};E3.unstable_batchedUpdates(()=>{r0(u5),O5==null||O5(W5),M({type:"onDragOver",event:W5})})},[L0]),y2(()=>{c.current={activatorEvent:b,active:j,activeNode:d,collisionRect:f,collisions:X0,droppableRects:h,draggableNodes:k,draggingNode:G0,draggingNodeRect:r,droppableContainers:I,over:k0,scrollableAncestors:o,scrollAdjustedTranslate:i},C.current={initial:r,translated:f}},[j,d,X0,f,k,G0,r,h,I,k0,o,i]),Wl({...B0,delta:x,draggingRect:f,pointerCoordinates:w0,scrollableAncestors:o,scrollableAncestorRects:n});let n5=F0.useMemo(()=>{return{active:j,activeNode:d,activeNodeRect:H0,activatorEvent:b,collisions:X0,containerNodeRect:N0,dragOverlay:$0,draggableNodes:k,droppableContainers:I,droppableRects:h,over:k0,measureDroppableContainers:t,scrollableAncestors:o,scrollableAncestorRects:n,measuringConfiguration:z0,measuringScheduled:M0,windowRect:p}},[j,d,H0,b,X0,N0,$0,k,I,h,k0,t,o,n,z0,M0,p]),j5=F0.useMemo(()=>{return{activatorEvent:b,activators:a0,active:j,activeNodeRect:H0,ariaDescribedById:{draggable:w},dispatch:V,draggableNodes:k,over:k0,measureDroppableContainers:t}},[b,a0,j,H0,V,w,k,k0,t]);return F0.default.createElement(BP.Provider,{value:A},F0.default.createElement(bJ.Provider,{value:j5},F0.default.createElement(IP.Provider,{value:n5},F0.default.createElement(RG.Provider,{value:m0},K)),F0.default.createElement(kl,{disabled:(z==null?void 0:z.restoreFocus)===!1})),F0.default.createElement(gd,{...z,hiddenTextDescribedById:w}));function R1(){let T0=(S==null?void 0:S.autoScrollEnabled)===!1,b0=typeof Y==="object"?Y.enabled===!1:Y===!1,p0=D&&!T0&&!b0;if(typeof Y==="object")return{...Y,enabled:p0};return{enabled:p0}}}),yl=F0.createContext(null),KP="button",xl="Draggable";function SP($){let{id:Z,data:J,disabled:Q=!1,attributes:X}=$,H=jJ(xl),{activators:G,activatorEvent:z,active:Y,activeNodeRect:K,ariaDescribedById:W,draggableNodes:B,over:q}=F0.useContext(bJ),{role:U=KP,roleDescription:F="draggable",tabIndex:N=0}=X!=null?X:{},L=(Y==null?void 0:Y.id)===Z,V=F0.useContext(L?RG:yl),[M,A]=PJ(),[O,_]=PJ(),D=Pl(G,Z),T=s7(J);y2(()=>{return B.set(Z,{id:Z,key:H,node:M,activatorNode:O,data:T}),()=>{let x=B.get(Z);if(x&&x.key===H)B.delete(Z)}},[B,Z]);let k=F0.useMemo(()=>({role:U,tabIndex:N,"aria-disabled":Q,"aria-pressed":L&&U===KP?!0:void 0,"aria-roledescription":F,"aria-describedby":W.draggable}),[Q,U,N,L,F,W.draggable]);return{active:Y,activatorEvent:z,activeNodeRect:K,attributes:k,isDragging:L,listeners:Q?void 0:D,node:M,over:q,setNodeRef:A,setActivatorNodeRef:_,transform:V}}function hl(){return F0.useContext(IP)}var gl="Droppable",vl={timeout:25};function bP($){let{data:Z,disabled:J=!1,id:Q,resizeObserverConfig:X}=$,H=jJ(gl),{active:G,dispatch:z,over:Y,measureDroppableContainers:K}=F0.useContext(bJ),W=F0.useRef({disabled:J}),B=F0.useRef(!1),q=F0.useRef(null),U=F0.useRef(null),{disabled:F,updateMeasurementsFor:N,timeout:L}={...vl,...X},V=s7(N!=null?N:Q),M=F0.useCallback(()=>{if(!B.current){B.current=!0;return}if(U.current!=null)clearTimeout(U.current);U.current=setTimeout(()=>{K(Array.isArray(V.current)?V.current:[V.current]),U.current=null},L)},[L]),A=IG({callback:M,disabled:F||!G}),O=F0.useCallback((k,x)=>{if(!A)return;if(x)A.unobserve(x),B.current=!1;if(k)A.observe(k)},[A]),[_,D]=PJ(O),T=s7(Z);return F0.useEffect(()=>{if(!A||!_.current)return;A.disconnect(),B.current=!1,A.observe(_.current)},[_,A]),F0.useEffect(()=>{return z({type:o1.RegisterDroppable,element:{id:Q,key:H,disabled:J,node:_,rect:q,data:T}}),()=>z({type:o1.UnregisterDroppable,key:H,id:Q})},[Q]),F0.useEffect(()=>{if(J!==W.current.disabled)z({type:o1.SetDroppableDisabled,id:Q,key:H,disabled:J}),W.current.disabled=J},[Q,H,J,z]),{active:G,rect:q,isOver:(Y==null?void 0:Y.id)===Q,node:_,over:Y,setNodeRef:D}}function fl($){let{animation:Z,children:J}=$,[Q,X]=F0.useState(null),[H,G]=F0.useState(null),z=wJ(J);if(!J&&!Q&&z)X(z);return y2(()=>{if(!H)return;let Y=Q==null?void 0:Q.key,K=Q==null?void 0:Q.props.id;if(Y==null||K==null){X(null);return}Promise.resolve(Z(K,H)).then(()=>{X(null)})},[Z,Q,H]),F0.default.createElement(F0.default.Fragment,null,J,Q?F0.cloneElement(Q,{ref:G}):null)}var ml={x:0,y:0,scaleX:1,scaleY:1};function ul($){let{children:Z}=$;return F0.default.createElement(bJ.Provider,{value:EP},F0.default.createElement(RG.Provider,{value:ml},Z))}var pl={position:"fixed",touchAction:"none"},cl=($)=>{return PG($)?"transform 250ms ease":void 0},dl=F0.forwardRef(($,Z)=>{let{as:J,activatorEvent:Q,adjustScale:X,children:H,className:G,rect:z,style:Y,transform:K,transition:W=cl}=$;if(!z)return null;let B=X?K:{...K,scaleX:1,scaleY:1},q={...pl,width:z.width,height:z.height,top:z.top,left:z.left,transform:a7.Transform.toString(B),transformOrigin:X&&Q?fd(Q,z):void 0,transition:typeof W==="function"?W(Q):W,...Y};return F0.default.createElement(J,{className:G,style:q,ref:Z},H)}),ll=($)=>(Z)=>{let{active:J,dragOverlay:Q}=Z,X={},{styles:H,className:G}=$;if(H!=null&&H.active)for(let[z,Y]of Object.entries(H.active)){if(Y===void 0)continue;X[z]=J.node.style.getPropertyValue(z),J.node.style.setProperty(z,Y)}if(H!=null&&H.dragOverlay)for(let[z,Y]of Object.entries(H.dragOverlay)){if(Y===void 0)continue;Q.node.style.setProperty(z,Y)}if(G!=null&&G.active)J.node.classList.add(G.active);if(G!=null&&G.dragOverlay)Q.node.classList.add(G.dragOverlay);return function(){for(let[Y,K]of Object.entries(X))J.node.style.setProperty(Y,K);if(G!=null&&G.active)J.node.classList.remove(G.active)}},il=($)=>{let{transform:{initial:Z,final:J}}=$;return[{transform:a7.Transform.toString(Z)},{transform:a7.Transform.toString(J)}]},rl={duration:250,easing:"ease",keyframes:il,sideEffects:ll({styles:{active:{opacity:"0"}}})};function al($){let{config:Z,draggableNodes:J,droppableContainers:Q,measuringConfiguration:X}=$;return OJ((H,G)=>{if(Z===null)return;let z=J.get(H);if(!z)return;let Y=z.node.current;if(!Y)return;let K=TP(G);if(!K)return;let{transform:W}=I8(G).getComputedStyle(G),B=NP(W);if(!B)return;let q=typeof Z==="function"?Z:nl(Z);return OP(Y,X.draggable.measure),q({active:{id:H,data:z.data,node:Y,rect:X.draggable.measure(Y)},draggableNodes:J,dragOverlay:{node:G,rect:X.dragOverlay.measure(K)},droppableContainers:Q,measuringConfiguration:X,transform:B})})}function nl($){let{duration:Z,easing:J,sideEffects:Q,keyframes:X}={...rl,...$};return(H)=>{let{active:G,dragOverlay:z,transform:Y,...K}=H;if(!Z)return;let W={x:z.rect.left-G.rect.left,y:z.rect.top-G.rect.top},B={scaleX:Y.scaleX!==1?G.rect.width*Y.scaleX/z.rect.width:1,scaleY:Y.scaleY!==1?G.rect.height*Y.scaleY/z.rect.height:1},q={x:Y.x-W.x,y:Y.y-W.y,...B},U=X({...K,active:G,dragOverlay:z,transform:{initial:Y,final:q}}),[F]=U,N=U[U.length-1];if(JSON.stringify(F)===JSON.stringify(N))return;let L=Q==null?void 0:Q({active:G,dragOverlay:z,...K}),V=z.node.animate(U,{duration:Z,easing:J,fill:"forwards"});return new Promise((M)=>{V.onfinish=()=>{L==null||L(),M()}})}}var WP=0;function sl($){return F0.useMemo(()=>{if($==null)return;return WP++,WP},[$])}var yP=F0.default.memo(($)=>{let{adjustScale:Z=!1,children:J,dropAnimation:Q,style:X,transition:H,modifiers:G,wrapperElement:z="div",className:Y,zIndex:K=999}=$,{activatorEvent:W,active:B,activeNodeRect:q,containerNodeRect:U,draggableNodes:F,droppableContainers:N,dragOverlay:L,over:V,measuringConfiguration:M,scrollableAncestors:A,scrollableAncestorRects:O,windowRect:_}=hl(),D=F0.useContext(RG),T=sl(B==null?void 0:B.id),k=RP(G,{activatorEvent:W,active:B,activeNodeRect:q,containerNodeRect:U,draggingNodeRect:L.rect,over:V,overlayNodeRect:L.rect,scrollableAncestors:A,scrollableAncestorRects:O,transform:D,windowRect:_}),x=Sq(q),I=al({config:Q,draggableNodes:F,droppableContainers:N,measuringConfiguration:M}),y=x?L.setRef:void 0;return F0.default.createElement(ul,null,F0.default.createElement(fl,{animation:I},B&&T?F0.default.createElement(dl,{key:T,id:B.id,ref:y,as:z,activatorEvent:W,adjustScale:Z,className:Y,transition:H,rect:x,style:{zIndex:K,...X},transform:k},J):null))});var I3=P(l(),1),ol={start:[I5.Space],cancel:[I5.Esc],end:[I5.Space,I5.Tab]};function tl($,Z,J){let Q=$.indexOf(Z),X=$.indexOf(J);if(Q<0||X<0||Q===X)return $;let H=[...$],[G]=H.splice(Q,1);return H.splice(X,0,G),H}function kG({items:$,getId:Z,className:J,itemClassName:Q,dragDisabled:X=!1,onReorder:H,renderItem:G,renderPlaceholder:z,renderOverlay:Y}){let K=qP(Rq(SJ,{activationConstraint:{distance:4}}),Rq(kJ,{keyboardCodes:ol})),[W,B]=Z6.useState(null),[q,U]=Z6.useState(null),F=Z6.useRef(null),N=Z6.useMemo(()=>$.map(Z),[$,Z]),L=Z6.useMemo(()=>new Map($.map((T)=>[Z(T),T])),[$,Z]),M=(W&&q?q:N).map((T)=>L.get(T)).filter((T)=>Boolean(T)),A=W?L.get(W):void 0,O=X||$.length<2;return I3.jsxs(kP,{sensors:K,collisionDetection:UP,onDragStart:(T)=>{let k=$.map(Z);B(String(T.active.id)),F.current=k,U(k)},onDragOver:(T)=>{let k=String(T.active.id),x=T.over?String(T.over.id):void 0,I=F.current;if(!x||x===k||!I)return;let y=tl(I,k,x);if(y===I)return;F.current=y,U(y)},onDragCancel:()=>{F.current=null,B(null),U(null)},onDragEnd:(T)=>{let k=String(T.active.id),x=F.current;if(F.current=null,B(null),U(null),!x||x.join("|")===N.join("|"))return;if(!x.includes(k))return;H(x)},children:[I3.jsx("div",{className:J,children:M.map((T)=>I3.jsx(el,{id:Z(T),item:T,disabled:O,itemClassName:Q,renderItem:G,renderPlaceholder:z},Z(T)))}),I3.jsx(yP,{dropAnimation:null,children:A&&Y?Y(A):null})]})}function el({id:$,item:Z,disabled:J,itemClassName:Q,renderItem:X,renderPlaceholder:H}){let{setNodeRef:G,isOver:z}=bP({id:$,disabled:J}),{attributes:Y,listeners:K,setNodeRef:W,isDragging:B}=SP({id:$,disabled:J,attributes:{roleDescription:"sortable item"}}),q=(F)=>{G(F),W(F)},U={isDragging:B,isOver:z,dragDisabled:J,dragHandleProps:J?{}:{...Y,...K}};return I3.jsxs(h5.div,{layout:!0,ref:q,className:e("relative",Q?.(Z,U)),transition:{type:"spring",duration:0.25,bounce:0},children:[B&&H?.(Z),X(Z,U)]})}var g5=P(l(),1);function $i($){return e(yJ({variant:"ghost",size:"icon"}),$&&"bg-accent text-accent-foreground")}function SG({children:$,showWorkspaces:Z=!0}){let{data:J}=aH(),Q=s0();return s1((X)=>{if(X.type==="workspace:updated"||X.type==="workspaces-list:updated")Q.invalidateQueries({queryKey:j0.all,exact:!0})}),g5.jsxs("div",{className:e("flex h-dvh bg-muted"),children:[g5.jsx(Zi,{workspaces:Z?J??[]:[]}),g5.jsx("main",{className:"flex min-w-0 flex-1 flex-col",children:$})]})}function Zi({workspaces:$}){let Z=p_();return g5.jsxs("aside",{className:"flex h-full shrink-0 flex-col items-center gap-4 px-2 py-5 [font-family:var(--default-sans)]",children:[g5.jsx(bZ,{href:"/","aria-label":"Home",title:"Home",className:$i,children:g5.jsx(hP,{stroke:1.5})}),g5.jsx("nav",{className:"flex max-h-full min-h-0 w-14 flex-1 flex-col items-center justify-center gap-4",children:$.length>0&&g5.jsxs(g5.Fragment,{children:[g5.jsx("div",{className:"no-scrollbar min-h-0 scroll-fade overflow-y-auto [--scroll-fade-reveal:16px]",children:g5.jsx(kG,{items:$,getId:(J)=>J.id,className:"flex flex-col gap-4",onReorder:(J)=>Z.mutate(J),renderPlaceholder:()=>g5.jsx("div",{className:"pointer-events-none absolute top-0 left-1 size-10 rounded-xl bg-accent"}),renderOverlay:(J)=>g5.jsx(xP,{workspace:J,dragOverlay:!0}),renderItem:(J,Q)=>g5.jsx(xP,{workspace:J,dragState:Q})})}),g5.jsx("div",{className:"shrink-0",children:g5.jsx(DJ,{trigger:g5.jsx(E0,{type:"button",variant:"ghost",size:"icon-lg","aria-label":"Create new workspace",title:"Create new workspace",className:"text-muted-foreground hover:text-foreground",children:g5.jsx(e8,{"data-icon":"inline-start",stroke:1.5})})})})]})}),g5.jsx("div",{"aria-hidden":"true",className:"size-8 shrink-0"})]})}function xP({workspace:$,dragOverlay:Z=!1,dragState:J}){let[Q]=I4(),X=`/workspace/${$.id}`,H=P3($),G=Q===X||Q.startsWith(`${X}/`),z=g5.jsxs(g5.Fragment,{children:[g5.jsx("div",{className:e(yJ({variant:"ghost",size:"icon-lg"}),"pointer-events-none size-12",Z?"bg-background shadow-lg":"group-hover:bg-accent group-hover:text-accent-foreground group-focus-visible:ring-3 group-focus-visible:ring-ring/50",G&&!Z&&"bg-accent text-accent-foreground"),children:g5.jsx("img",{src:$.icon??H2[$.type??"claude-code"],alt:"",className:"size-7 shrink-0 rounded-xs"})}),g5.jsx("span",{className:"mt-0.5 line-clamp-2 w-full text-center text-[11px] leading-snug font-medium text-ellipsis text-foreground",children:H})]});if(Z)return g5.jsx("span",{className:"flex w-14 flex-col items-center",children:z});return g5.jsx(bZ,{href:X,"aria-label":H,title:H,onClick:(Y)=>{if(J?.isDragging)Y.preventDefault()},className:e("group flex w-14 flex-col items-center rounded-lg outline-none",J?.isDragging&&"invisible"),...J?.dragHandleProps,children:z})}var gP=P(v(),1);var $$=P(l(),1);function Ji({choice:$,availability:Z,isPending:J,errorMessage:Q,onTypeChange:X,onCancel:H,onSubmit:G}){return $$.jsx(AG,{title:`Import ${P3($.workspace)}`,selectedType:$.selectedType,detectedTypes:$.workspace.types,availability:Z,isPending:J,errorMessage:Q,secondaryAction:$$.jsx(E0,{variant:"secondary",onClick:H,disabled:J,children:"Cancel"}),primaryLabel:"Add workspace",pendingLabel:"Adding…",onTypeChange:X,onSubmit:G})}function vP({choice:$,availability:Z,isPending:J,errorMessage:Q,onTypeChange:X,onSubmit:H,onReset:G}){let[z,Y]=gP.useState(!0);function K(B){if(!B&&J)return;Y(B)}function W(B){if(!B)G()}return $$.jsx(p7,{open:z,onOpenChange:K,onOpenChangeComplete:W,children:$$.jsx(DG,{closeDisabled:J,children:$$.jsx(Ji,{choice:$,availability:Z,isPending:J,errorMessage:Q,onTypeChange:X,onCancel:()=>Y(!1),onSubmit:H})})})}var fP=P(v(),1);function Qi($){return $.types[0]??i7[0]}function mP({onSuccess:$}){let Z=m_(),[J,Q]=fP.useState(null);function X(Y){Z.reset(),Q({workspace:Y,selectedType:Qi(Y)})}function H(Y){Q((K)=>K?{...K,selectedType:Y}:K)}function G(){if(!J||Z.isPending)return;Z.mutate({path:J.workspace.path,type:J.selectedType},{onSuccess:$})}function z(){Q(null),Z.reset()}return{choice:J,isPending:Z.isPending,error:Z.error,startImport:X,selectType:H,submit:G,reset:z}}var hJ=P(v(),1);var gJ=P(l(),1),Xi=[["OOOOO","O.O.O","O.O.O"],["OOO","O.O","OOO"],["O","O","O"]],J6=10,bG=3,Hi=2.5,Gi={O:1,o:0.5,".":0},zi=3000,Yi=2,uP=3,Q6=3,pP=0.001,R3={courantSquared:0.14,damping:0.976,driveAmplitude:1.4,driveFrequency:0.027,gain:0.65,fadeIn:0.36,fadeOut:0.1};function Ki($){let Z=Math.max(...$.map((H)=>H.length)),J=Z*J6+(Z-1)*bG,Q=$.length*J6+($.length-1)*bG,X=[];return $.forEach((H,G)=>{Array.from(H).forEach((z,Y)=>{let K=Gi[z];if(K===void 0)return;let W=Y*(J6+bG),B=G*(J6+bG);X.push({x:W,y:B,centerX:W+J6/2,centerY:B+J6/2,targetOpacity:K})})}),{width:J,height:Q,fieldColumns:Math.round(J/Q6)+1,fieldRows:Math.round(Q/Q6)+1,pixels:X}}var Wi=Xi.map(Ki);function xJ($,Z,J){return $<Z?Z:$>J?J:$}function Bi($){return $<0.5?2*$*$:1-(-2*$+2)**2/2}class cP{rects;svg;geometry;animationFrame=0;running=!1;intro=!0;introStartedAt=-1;field;previousField;nextField;pointerActive=!1;pointerX=0;pointerY=0;activation=0;constructor($,Z,J){this.rects=$,this.svg=Z,this.geometry=J;let Q=J.fieldColumns*J.fieldRows;this.field=new Float32Array(Q),this.previousField=new Float32Array(Q),this.nextField=new Float32Array(Q)}start(){this.seedImpulse(),this.activation=1,this.resume()}stop(){cancelAnimationFrame(this.animationFrame),this.running=!1}handlePointerMove=($)=>{let Z=this.svg.getBoundingClientRect();if(!Z.width||!Z.height)return;if(this.pointerActive=$.clientX>=Z.left&&$.clientX<=Z.right&&$.clientY>=Z.top&&$.clientY<=Z.bottom,this.pointerActive)this.pointerX=($.clientX-Z.left)/Z.width*this.geometry.width,this.pointerY=($.clientY-Z.top)/Z.height*this.geometry.height,this.resume()};seedImpulse(){let $=Math.round(this.geometry.width/2/Q6),Z=Math.round(this.geometry.height/2/Q6),J=2*uP*uP;for(let Q=0;Q<this.geometry.fieldRows;Q++)for(let X=0;X<this.geometry.fieldColumns;X++){let H=(X-$)**2+(Q-Z)**2,G=Yi*Math.exp(-H/J),z=Q*this.geometry.fieldColumns+X;this.field[z]=G,this.previousField[z]=G}}resume(){if(this.running)return;this.running=!0,this.animationFrame=requestAnimationFrame(this.animate)}animate=($)=>{if(this.stepWave(),this.pointerActive)this.driveWave($);if(this.intro&&!this.pointerActive){if(this.introStartedAt<0)this.introStartedAt=$;let J=($-this.introStartedAt)/zi;if(this.activation=1-Bi(Math.min(1,J)),J>=1)this.intro=!1}else{this.intro=!1;let J=this.pointerActive?1:0,Q=this.pointerActive?R3.fadeIn:R3.fadeOut;this.activation+=(J-this.activation)*Q}let Z=this.renderWave();if(this.intro||this.pointerActive||this.activation>pP||Z>pP){this.animationFrame=requestAnimationFrame(this.animate);return}this.running=!1,this.activation=0,this.renderTargets()};stepWave(){let{fieldColumns:$,fieldRows:Z}=this.geometry;for(let Q=1;Q<Z-1;Q++)for(let X=1;X<$-1;X++){let H=Q*$+X,G=this.field[H-1]+this.field[H+1]+this.field[H-$]+this.field[H+$]-4*this.field[H];this.nextField[H]=(2*this.field[H]-this.previousField[H]+R3.courantSquared*G)*R3.damping}let J=this.previousField;this.previousField=this.field,this.field=this.nextField,this.nextField=J}driveWave($){let Z=xJ(Math.round(this.pointerX/Q6),1,this.geometry.fieldColumns-2),J=xJ(Math.round(this.pointerY/Q6),1,this.geometry.fieldRows-2);this.field[J*this.geometry.fieldColumns+Z]=R3.driveAmplitude*Math.sin($*R3.driveFrequency)}sampleField($,Z){let J=xJ($/Q6,0,this.geometry.fieldColumns-1),Q=xJ(Z/Q6,0,this.geometry.fieldRows-1),X=Math.floor(J),H=Math.floor(Q),G=Math.min(X+1,this.geometry.fieldColumns-1),z=Math.min(H+1,this.geometry.fieldRows-1),Y=J-X,K=Q-H,{fieldColumns:W}=this.geometry,B=this.field[H*W+X],q=this.field[H*W+G],U=this.field[z*W+X],F=this.field[z*W+G];return(B*(1-Y)+q*Y)*(1-K)+(U*(1-Y)+F*Y)*K}renderWave(){let $=0;return this.geometry.pixels.forEach((Z,J)=>{let Q=this.rects[J];if(!Q)return;let X=this.sampleField(Z.centerX,Z.centerY);$=Math.max($,Math.abs(X));let H=xJ(0.5+X*R3.gain,0,1),G=Z.targetOpacity*(1-this.activation)+H*this.activation;Q.setAttribute("opacity",G.toFixed(3))}),$}renderTargets(){this.geometry.pixels.forEach(($,Z)=>{this.rects[Z]?.setAttribute("opacity",String($.targetOpacity))})}}function qi({geometry:$}){let Z=hJ.useRef([]),J=hJ.useRef(null);return hJ.useEffect(()=>{let Q=J.current;if(!Q||window.matchMedia("(prefers-reduced-motion: reduce)").matches)return;let X=new cP(Z.current,Q,$);return X.start(),window.addEventListener("pointermove",X.handlePointerMove),()=>{X.stop(),window.removeEventListener("pointermove",X.handlePointerMove)}},[$]),gJ.jsx("svg",{ref:J,className:"h-8 w-auto",viewBox:`0 0 ${$.width} ${$.height}`,fill:"currentColor","aria-hidden":"true",children:$.pixels.map((Q,X)=>gJ.jsx("rect",{ref:(H)=>{Z.current[X]=H},x:Q.x,y:Q.y,width:J6,height:J6,rx:Hi,opacity:Q.targetOpacity},`${Q.x}-${Q.y}`))})}function dP({className:$}){return gJ.jsx("div",{role:"img","aria-label":"moi",className:e("flex items-center gap-2 text-accent",$),children:Wi.map((Z,J)=>gJ.jsx(qi,{geometry:Z},J))})}var Z$={};S4(Z$,{Trigger:()=>oP,Root:()=>sP,Panel:()=>$w});var vJ=P(v(),1);var M4=P(v(),1);function lP($){let{open:Z,defaultOpen:J,onOpenChange:Q,disabled:X}=$,H=Z!==void 0,[G,z]=f4({controlled:Z,default:J,name:"Collapsible",state:"open"}),{mounted:Y,setMounted:K,transitionStatus:W}=y4(G,!0,!0),[B,q]=M4.useState(G),[{height:U,width:F},N]=M4.useState({height:void 0,width:void 0}),L=e0(),[V,M]=M4.useState(),A=V??L,[O,_]=M4.useState(!1),[D,T]=M4.useState(!1),k=M4.useRef(null),x=M4.useRef(null),I=M4.useRef(null),y=M4.useRef(null),C=E2(y,!1),j=K0((R)=>{let S=!G,E=O0(q0.triggerPress,R.nativeEvent);if(Q(S,E),E.isCanceled)return;let b=y.current;if(x.current==="css-animation"&&b!=null)b.style.removeProperty("animation-name");if(!O&&!D){if(x.current!=null&&x.current!=="css-animation"){if(!Y&&S)K(!0)}if(x.current==="css-animation"){if(!B&&S)q(!0);if(!Y&&S)K(!0)}}if(z(S),x.current==="none"&&Y&&!S)K(!1)});return W0(()=>{if(H&&x.current==="none"&&!D&&!G)K(!1)},[H,D,G,Z,K]),M4.useMemo(()=>({abortControllerRef:k,animationTypeRef:x,disabled:X,handleTrigger:j,height:U,mounted:Y,open:G,panelId:A,panelRef:y,runOnceAnimationsFinish:C,setDimensions:N,setHiddenUntilFound:_,setKeepMounted:T,setMounted:K,setOpen:z,setPanelIdState:M,setVisible:q,transitionDimensionRef:I,transitionStatus:W,visible:B,width:F}),[k,x,X,j,U,Y,G,A,y,C,N,_,T,K,z,q,I,W,B,F])}var yG=P(v(),1),bq=yG.createContext(void 0);function xG(){let $=yG.useContext(bq);if($===void 0)throw Error(I0(15));return $}var k3=function($){return $.open="data-open",$.closed="data-closed",$[$.startingStyle=T2.startingStyle]="startingStyle",$[$.endingStyle=T2.endingStyle]="endingStyle",$}({});var iP=function($){return $.panelOpen="data-panel-open",$}({});var Ui={[k3.open]:""},Fi={[k3.closed]:""},rP={open($){if($)return{[iP.panelOpen]:""};return null}},aP={open($){if($)return Ui;return Fi}};var hG={...aP,...s5};var nP=P(l(),1),sP=vJ.forwardRef(function(Z,J){let{render:Q,className:X,defaultOpen:H=!1,disabled:G=!1,onOpenChange:z,open:Y,...K}=Z,W=K0(z),B=lP({open:Y,defaultOpen:H,onOpenChange:W,disabled:G}),q=vJ.useMemo(()=>({open:B.open,disabled:B.disabled,transitionStatus:B.transitionStatus}),[B.open,B.disabled,B.transitionStatus]),U=vJ.useMemo(()=>({...B,onOpenChange:W,state:q}),[B,W,q]),F=U0("div",Z,{state:q,ref:J,props:K,stateAttributesMapping:hG});return nP.jsx(bq.Provider,{value:U,children:F})});var gG=P(v(),1);var Ni={...rP,...s5},oP=gG.forwardRef(function(Z,J){let{panelId:Q,open:X,handleTrigger:H,state:G,disabled:z}=xG(),{className:Y,disabled:K=z,id:W,render:B,nativeButton:q=!0,...U}=Z,{getButtonProps:F,buttonRef:N}=S1({disabled:K,focusableWhenDisabled:!0,native:q}),L=gG.useMemo(()=>({"aria-controls":X?Q:void 0,"aria-expanded":X,onClick:H}),[Q,X,H]);return U0("button",Z,{state:G,ref:[J,N],props:[L,U,F],stateAttributesMapping:Ni})});var vG=P(v(),1);var x2=P(v(),1);var tP=function($){return $.disabled="data-disabled",$.orientation="data-orientation",$}({});function eP($){let{abortControllerRef:Z,animationTypeRef:J,externalRef:Q,height:X,hiddenUntilFound:H,keepMounted:G,id:z,mounted:Y,onOpenChange:K,open:W,panelRef:B,runOnceAnimationsFinish:q,setDimensions:U,setMounted:F,setOpen:N,setVisible:L,transitionDimensionRef:V,visible:M,width:A}=$,O=x2.useRef(!1),_=x2.useRef(null),D=x2.useRef(W),T=x2.useRef(W),k=n8(),x=x2.useMemo(()=>{if(J.current==="css-animation")return!M;return!W&&!Y},[W,Y,M,J]),I=K0((C)=>{if(!C)return;if(J.current==null||V.current==null){let S=getComputedStyle(C),E=S.animationName!=="none"&&S.animationName!=="",b=S.transitionDuration!=="0s"&&S.transitionDuration!=="";if(E&&b);else if(S.animationName==="none"&&S.transitionDuration!=="0s")J.current="css-transition";else if(S.animationName!=="none"&&S.transitionDuration==="0s")J.current="css-animation";else J.current="none";if(C.getAttribute(tP.orientation)==="horizontal"||S.transitionProperty.indexOf("width")>-1)V.current="width";else V.current="height"}if(J.current!=="css-transition")return;if(X===void 0||A===void 0){if(U({height:C.scrollHeight,width:C.scrollWidth}),T.current)C.style.setProperty("transition-duration","0s")}let j=-1,R=-1;return j=J1.request(()=>{T.current=!1,R=J1.request(()=>{setTimeout(()=>{C.style.removeProperty("transition-duration")})})}),()=>{J1.cancel(j),J1.cancel(R)}}),y=q4(Q,B,I);return W0(()=>{if(J.current!=="css-transition")return;let C=B.current;if(!C)return;let j=-1;if(Z.current!=null)Z.current.abort(),Z.current=null;if(W){let R={"justify-content":C.style.justifyContent,"align-items":C.style.alignItems,"align-content":C.style.alignContent,"justify-items":C.style.justifyItems};if(Object.keys(R).forEach((S)=>{C.style.setProperty(S,"initial","important")}),!T.current&&!G)C.setAttribute(k3.startingStyle,"");U({height:C.scrollHeight,width:C.scrollWidth}),j=J1.request(()=>{Object.entries(R).forEach(([S,E])=>{if(E==="")C.style.removeProperty(S);else C.style.setProperty(S,E)})})}else{if(C.scrollHeight===0&&C.scrollWidth===0)return;U({height:C.scrollHeight,width:C.scrollWidth});let R=new AbortController;Z.current=R;let S=R.signal,E=null,b=k3.endingStyle;return E=new MutationObserver((g)=>{if(g.some((w)=>w.type==="attributes"&&w.attributeName===b))E?.disconnect(),E=null,q(()=>{if(U({height:0,width:0}),C.style.removeProperty("content-visibility"),F(!1),Z.current===R)Z.current=null},S)}),E.observe(C,{attributes:!0,attributeFilter:[b]}),()=>{if(E?.disconnect(),k.cancel(),Z.current===R)R.abort(),Z.current=null}}return()=>{J1.cancel(j)}},[Z,J,k,H,G,Y,W,B,q,U,F]),W0(()=>{if(J.current!=="css-animation")return;let C=B.current;if(!C)return;if(_.current=C.style.animationName||_.current,C.style.setProperty("animation-name","none"),U({height:C.scrollHeight,width:C.scrollWidth}),!D.current&&!O.current)C.style.removeProperty("animation-name");if(W){if(Z.current!=null)Z.current.abort(),Z.current=null;F(!0),L(!0)}else Z.current=new AbortController,q(()=>{F(!1),L(!1),Z.current=null},Z.current.signal)},[Z,J,W,B,q,U,F,L,M]),_8(()=>{let C=J1.request(()=>{D.current=!1});return()=>J1.cancel(C)}),W0(()=>{if(!H)return;let C=B.current;if(!C)return;let j=-1,R=-1;if(W&&O.current)C.style.transitionDuration="0s",U({height:C.scrollHeight,width:C.scrollWidth}),j=J1.request(()=>{O.current=!1,R=J1.request(()=>{setTimeout(()=>{C.style.removeProperty("transition-duration")})})});return()=>{J1.cancel(j),J1.cancel(R)}},[H,W,B,U]),W0(()=>{let C=B.current;if(C&&H&&x){if(C.setAttribute("hidden","until-found"),J.current==="css-transition")C.setAttribute(k3.startingStyle,"")}},[H,x,J,B]),x2.useEffect(function(){let j=B.current;if(!j)return;function R(S){O.current=!0,N(!0),K(!0,O0(q0.none,S))}return j.addEventListener("beforematch",R),()=>{j.removeEventListener("beforematch",R)}},[K,B,N]),x2.useMemo(()=>({props:{hidden:x,id:z,ref:y}}),[x,z,y])}var yq=function($){return $.collapsiblePanelHeight="--collapsible-panel-height",$.collapsiblePanelWidth="--collapsible-panel-width",$}({});var $w=vG.forwardRef(function(Z,J){let{className:Q,hiddenUntilFound:X,keepMounted:H,render:G,id:z,...Y}=Z,{abortControllerRef:K,animationTypeRef:W,height:B,mounted:q,onOpenChange:U,open:F,panelId:N,panelRef:L,runOnceAnimationsFinish:V,setDimensions:M,setHiddenUntilFound:A,setKeepMounted:O,setMounted:_,setPanelIdState:D,setOpen:T,setVisible:k,state:x,transitionDimensionRef:I,visible:y,width:C,transitionStatus:j}=xG(),R=X??!1,S=H??!1;W0(()=>{if(z)return D(z),()=>{D(void 0)};return},[z,D]),W0(()=>{A(R)},[A,R]),W0(()=>{O(S)},[O,S]);let{props:E}=eP({abortControllerRef:K,animationTypeRef:W,externalRef:J,height:B,hiddenUntilFound:R,id:N,keepMounted:S,mounted:q,onOpenChange:U,open:F,panelRef:L,runOnceAnimationsFinish:V,setDimensions:M,setMounted:_,setOpen:T,setVisible:k,transitionDimensionRef:I,visible:y,width:C});v1({open:F&&j==="idle",ref:L,onComplete(){if(!F)return;M({height:void 0,width:void 0})}});let b=vG.useMemo(()=>({...x,transitionStatus:j}),[x,j]),g=U0("div",Z,{state:b,ref:[J,L],props:[E,{style:{[yq.collapsiblePanelHeight]:B===void 0?"auto":`${B}px`,[yq.collapsiblePanelWidth]:C===void 0?"auto":`${C}px`}},Y],stateAttributesMapping:hG});if(!(S||R||!S&&q))return null;return g});var pG=P(l(),1);function fG({...$}){return pG.jsx(Z$.Root,{"data-slot":"collapsible",...$})}function mG({...$}){return pG.jsx(Z$.Trigger,{"data-slot":"collapsible-trigger",...$})}function uG({...$}){return pG.jsx(Z$.Panel,{"data-slot":"collapsible-content",...$})}var Pz=P(v(),1);var Vi=($,Z)=>{if(typeof $!=="number")return;if(Z===3)return{mode:"rgb",r:($>>8&15|$>>4&240)/255,g:($>>4&15|$&240)/255,b:($&15|$<<4&240)/255};if(Z===4)return{mode:"rgb",r:($>>12&15|$>>8&240)/255,g:($>>8&15|$>>4&240)/255,b:($>>4&15|$&240)/255,alpha:($&15|$<<4&240)/255};if(Z===6)return{mode:"rgb",r:($>>16&255)/255,g:($>>8&255)/255,b:($&255)/255};if(Z===8)return{mode:"rgb",r:($>>24&255)/255,g:($>>16&255)/255,b:($>>8&255)/255,alpha:($&255)/255}},cG=Vi;var Li={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Zw=Li;var Mi=($)=>{return cG(Zw[$.toLowerCase()],6)},Jw=Mi;var Ai=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,Di=($)=>{let Z;return(Z=$.match(Ai))?cG(parseInt(Z[1],16),Z[1].length):void 0},Qw=Di;var dG="([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)";var S3="([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%";var fJ="(?:([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%|([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?))";var Xw="(?:([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)(deg|grad|rad|turn)|([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?))";var X6="\\s*,\\s*";var ED0=new RegExp("^(?:([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%|([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)|none)$");var _i=new RegExp(`^rgba?\\(\\s*${dG}${X6}${dG}${X6}${dG}\\s*(?:,\\s*${fJ}\\s*)?\\)$`),Oi=new RegExp(`^rgba?\\(\\s*${S3}${X6}${S3}${X6}${S3}\\s*(?:,\\s*${fJ}\\s*)?\\)$`),Pi=($)=>{let Z={mode:"rgb"},J;if(J=$.match(_i)){if(J[1]!==void 0)Z.r=J[1]/255;if(J[2]!==void 0)Z.g=J[2]/255;if(J[3]!==void 0)Z.b=J[3]/255}else if(J=$.match(Oi)){if(J[1]!==void 0)Z.r=J[1]/100;if(J[2]!==void 0)Z.g=J[2]/100;if(J[3]!==void 0)Z.b=J[3]/100}else return;if(J[4]!==void 0)Z.alpha=Math.max(0,Math.min(1,J[4]/100));else if(J[5]!==void 0)Z.alpha=Math.max(0,Math.min(1,+J[5]));return Z},Hw=Pi;var wi=($,Z)=>$===void 0?void 0:typeof $!=="object"?zw($):$.mode!==void 0?$:Z?{...$,mode:Z}:void 0,Gw=wi;var ji=($="rgb")=>(Z)=>(Z=Gw(Z,$))!==void 0?Z.mode===$?Z:z2[Z.mode][$]?z2[Z.mode][$](Z):$==="rgb"?z2[Z.mode].rgb(Z):z2.rgb[$](z2[Z.mode].rgb(Z)):void 0,lG=ji;var z2={},Yw={},mJ=[],xq={},Ci=($)=>$,b5=($)=>{if(z2[$.mode]={...z2[$.mode],...$.toMode},Object.keys($.fromMode||{}).forEach((Z)=>{if(!z2[Z])z2[Z]={};z2[Z][$.mode]=$.fromMode[Z]}),!$.ranges)$.ranges={};if(!$.difference)$.difference={};return $.channels.forEach((Z)=>{if($.ranges[Z]===void 0)$.ranges[Z]=[0,1];if(!$.interpolate[Z])throw Error(`Missing interpolator for: ${Z}`);if(typeof $.interpolate[Z]==="function")$.interpolate[Z]={use:$.interpolate[Z]};if(!$.interpolate[Z].fixup)$.interpolate[Z].fixup=Ci}),Yw[$.mode]=$,($.parse||[]).forEach((Z)=>{Ti(Z,$.mode)}),lG($.mode)},Kw=($)=>Yw[$],Ti=($,Z)=>{if(typeof $==="string"){if(!Z)throw Error("'mode' required when 'parser' is a string");xq[$]=Z}else if(typeof $==="function"){if(mJ.indexOf($)<0)mJ.push($)}};var hq=/[^\x00-\x7F]|[a-zA-Z_]/,Ei=/[^\x00-\x7F]|[-\w]/,A0={Function:"function",Ident:"ident",Number:"number",Percentage:"percentage",ParenClose:")",None:"none",Hue:"hue",Alpha:"alpha"},o0=0;function iG($){let Z=$[o0],J=$[o0+1];if(Z==="-"||Z==="+")return/\d/.test(J)||J==="."&&/\d/.test($[o0+2]);if(Z===".")return/\d/.test(J);return/\d/.test(Z)}function gq($){if(o0>=$.length)return!1;let Z=$[o0];if(hq.test(Z))return!0;if(Z==="-"){if($.length-o0<2)return!1;let J=$[o0+1];if(J==="-"||hq.test(J))return!0;return!1}return!1}var Ii={deg:1,rad:180/Math.PI,grad:0.9,turn:360};function uJ($){let Z="";if($[o0]==="-"||$[o0]==="+")Z+=$[o0++];if(Z+=rG($),$[o0]==="."&&/\d/.test($[o0+1]))Z+=$[o0++]+rG($);if($[o0]==="e"||$[o0]==="E"){if(($[o0+1]==="-"||$[o0+1]==="+")&&/\d/.test($[o0+2]))Z+=$[o0++]+$[o0++]+rG($);else if(/\d/.test($[o0+1]))Z+=$[o0++]+rG($)}if(gq($)){let J=aG($);if(J==="deg"||J==="rad"||J==="turn"||J==="grad")return{type:A0.Hue,value:Z*Ii[J]};return}if($[o0]==="%")return o0++,{type:A0.Percentage,value:+Z};return{type:A0.Number,value:+Z}}function rG($){let Z="";while(/\d/.test($[o0]))Z+=$[o0++];return Z}function aG($){let Z="";while(o0<$.length&&Ei.test($[o0]))Z+=$[o0++];return Z}function Ri($){let Z=aG($);if($[o0]==="(")return o0++,{type:A0.Function,value:Z};if(Z==="none")return{type:A0.None,value:void 0};return{type:A0.Ident,value:Z}}function ki($=""){let Z=$.trim(),J=[],Q;o0=0;while(o0<Z.length){if(Q=Z[o0++],Q===`
|
|
27
|
-
`||Q==="\t"||Q===" "){while(o0<Z.length&&(Z[o0]===`
|
|
28
|
-
`||Z[o0]==="\t"||Z[o0]===" "))o0++;continue}if(Q===",")return;if(Q===")"){J.push({type:A0.ParenClose});continue}if(Q==="+"){if(o0--,iG(Z)){J.push(uJ(Z));continue}return}if(Q==="-"){if(o0--,iG(Z)){J.push(uJ(Z));continue}if(gq(Z)){J.push({type:A0.Ident,value:aG(Z)});continue}return}if(Q==="."){if(o0--,iG(Z)){J.push(uJ(Z));continue}return}if(Q==="/"){while(o0<Z.length&&(Z[o0]===`
|
|
29
|
-
`||Z[o0]==="\t"||Z[o0]===" "))o0++;let X;if(iG(Z)){if(X=uJ(Z),X.type!==A0.Hue){J.push({type:A0.Alpha,value:X});continue}}if(gq(Z)){if(aG(Z)==="none"){J.push({type:A0.Alpha,value:{type:A0.None,value:void 0}});continue}}return}if(/\d/.test(Q)){o0--,J.push(uJ(Z));continue}if(hq.test(Q)){o0--,J.push(Ri(Z));continue}return}return J}function Si($){$._i=0;let Z=$[$._i++];if(!Z||Z.type!==A0.Function||Z.value!=="color")return;if(Z=$[$._i++],Z.type!==A0.Ident)return;let J=xq[Z.value];if(!J)return;let Q={mode:J},X=Ww($,!1);if(!X)return;let H=Kw(J).channels;for(let G=0,z,Y;G<H.length;G++)if(z=X[G],Y=H[G],z.type!==A0.None){if(Q[Y]=z.type===A0.Number?z.value:z.value/100,Y==="alpha")Q[Y]=Math.max(0,Math.min(1,Q[Y]))}return Q}function Ww($,Z){let J=[],Q;while($._i<$.length){if(Q=$[$._i++],Q.type===A0.None||Q.type===A0.Number||Q.type===A0.Alpha||Q.type===A0.Percentage||Z&&Q.type===A0.Hue){J.push(Q);continue}if(Q.type===A0.ParenClose){if($._i<$.length)return;continue}return}if(J.length<3||J.length>4)return;if(J.length===4){if(J[3].type!==A0.Alpha)return;J[3]=J[3].value}if(J.length===3)J.push({type:A0.None,value:void 0});return J.every((X)=>X.type!==A0.Alpha)?J:void 0}function bi($,Z){$._i=0;let J=$[$._i++];if(!J||J.type!==A0.Function)return;let Q=Ww($,Z);if(!Q)return;return Q.unshift(J.value),Q}var yi=($)=>{if(typeof $!=="string")return;let Z=ki($),J=Z?bi(Z,!0):void 0,Q=void 0,X=0,H=mJ.length;while(X<H)if((Q=mJ[X++]($,J))!==void 0)return Q;return Z?Si(Z):void 0},zw=yi;function xi($,Z){if(!Z||Z[0]!=="rgb"&&Z[0]!=="rgba")return;let J={mode:"rgb"},[,Q,X,H,G]=Z;if(Q.type===A0.Hue||X.type===A0.Hue||H.type===A0.Hue)return;if(Q.type!==A0.None)J.r=Q.type===A0.Number?Q.value/255:Q.value/100;if(X.type!==A0.None)J.g=X.type===A0.Number?X.value/255:X.value/100;if(H.type!==A0.None)J.b=H.type===A0.Number?H.value/255:H.value/100;if(G.type!==A0.None)J.alpha=Math.min(1,Math.max(0,G.type===A0.Number?G.value:G.value/100));return J}var Bw=xi;var hi=($)=>$==="transparent"?{mode:"rgb",r:0,g:0,b:0,alpha:0}:void 0,qw=hi;var Uw=($,Z,J)=>$+J*(Z-$);var gi=($)=>{let Z=[];for(let J=0;J<$.length-1;J++){let Q=$[J],X=$[J+1];if(Q===void 0&&X===void 0)Z.push(void 0);else if(Q!==void 0&&X!==void 0)Z.push([Q,X]);else Z.push(Q!==void 0?[Q,Q]:[X,X])}return Z},Fw=($)=>(Z)=>{let J=gi(Z);return(Q)=>{let X=Q*J.length,H=Q>=1?J.length-1:Math.max(Math.floor(X),0),G=J[H];return G===void 0?void 0:$(G[0],G[1],X-H)}};var D0=Fw(Uw);var B5=($)=>{let Z=!1,J=$.map((Q)=>{if(Q!==void 0)return Z=!0,Q;return 1});return Z?J:$};var vi={mode:"rgb",channels:["r","g","b","alpha"],parse:[Bw,Qw,Hw,Jw,qw,"srgb"],serialize:"srgb",interpolate:{r:D0,g:D0,b:D0,alpha:{use:D0,fixup:B5}},gamut:!0,white:{r:1,g:1,b:1},black:{r:0,g:0,b:0}},u4=vi;var vq=($=0)=>Math.pow(Math.abs($),2.19921875)*Math.sign($),fi=($)=>{let Z=vq($.r),J=vq($.g),Q=vq($.b),X={mode:"xyz65",x:0.5766690429101305*Z+0.1855582379065463*J+0.1882286462349947*Q,y:0.297344975250536*Z+0.6273635662554661*J+0.0752914584939979*Q,z:0.0270313613864123*Z+0.0706888525358272*J+0.9913375368376386*Q};if($.alpha!==void 0)X.alpha=$.alpha;return X},fq=fi;var mq=($)=>Math.pow(Math.abs($),0.4547069271758437)*Math.sign($),mi=({x:$,y:Z,z:J,alpha:Q})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let X={mode:"a98",r:mq($*2.0415879038107465-Z*0.5650069742788597-0.3447313507783297*J),g:mq($*-0.9692436362808798+Z*1.8759675015077206+0.0415550574071756*J),b:mq($*0.0134442806320312-Z*0.1183623922310184+1.0151749943912058*J)};if(Q!==void 0)X.alpha=Q;return X},uq=mi;var pq=($=0)=>{let Z=Math.abs($);if(Z<=0.04045)return $/12.92;return(Math.sign($)||1)*Math.pow((Z+0.055)/1.055,2.4)},ui=({r:$,g:Z,b:J,alpha:Q})=>{let X={mode:"lrgb",r:pq($),g:pq(Z),b:pq(J)};if(Q!==void 0)X.alpha=Q;return X},p4=ui;var pi=($)=>{let{r:Z,g:J,b:Q,alpha:X}=p4($),H={mode:"xyz65",x:0.4123907992659593*Z+0.357584339383878*J+0.1804807884018343*Q,y:0.2126390058715102*Z+0.715168678767756*J+0.0721923153607337*Q,z:0.0193308187155918*Z+0.119194779794626*J+0.9505321522496607*Q};if(X!==void 0)H.alpha=X;return H},$4=pi;var cq=($=0)=>{let Z=Math.abs($);if(Z>0.0031308)return(Math.sign($)||1)*(1.055*Math.pow(Z,0.4166666666666667)-0.055);return $*12.92},ci=({r:$,g:Z,b:J,alpha:Q},X="rgb")=>{let H={mode:X,r:cq($),g:cq(Z),b:cq(J)};if(Q!==void 0)H.alpha=Q;return H},c4=ci;var di=({x:$,y:Z,z:J,alpha:Q})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let X=c4({r:$*3.2409699419045226-Z*1.537383177570094-0.4986107602930034*J,g:$*-0.9692436362808796+Z*1.8759675015077204+0.0415550574071756*J,b:$*0.0556300796969936-Z*0.2039769588889765+1.0569715142428784*J});if(Q!==void 0)X.alpha=Q;return X},Z4=di;var li={...u4,mode:"a98",parse:["a98-rgb"],serialize:"a98-rgb",fromMode:{rgb:($)=>uq($4($)),xyz65:uq},toMode:{rgb:($)=>Z4(fq($)),xyz65:fq}},Nw=li;var ii=($)=>($=$%360)<0?$+360:$,c5=ii;var ri=($,Z)=>{return $.map((J,Q,X)=>{if(J===void 0)return J;let H=c5(J);if(Q===0||$[Q-1]===void 0)return H;return Z(H-c5(X[Q-1]))}).reduce((J,Q)=>{if(!J.length||Q===void 0||J[J.length-1]===void 0)return J.push(Q),J;return J.push(Q+J[J.length-1]),J},[])},Y8=($)=>ri($,(Z)=>Math.abs(Z)<=180?Z:Z-360*Math.sign(Z));var p1=[-0.14861,1.78277,-0.29227,-0.90649,1.97294,0],Vw=Math.PI/180,Lw=180/Math.PI;var Mw=p1[3]*p1[4],Aw=p1[1]*p1[4],Dw=p1[1]*p1[2]-p1[0]*p1[3],ai=({r:$,g:Z,b:J,alpha:Q})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let X=(Dw*J+$*Mw-Z*Aw)/(Dw+Mw-Aw),H=J-X,G=(p1[4]*(Z-X)-p1[2]*H)/p1[3],z={mode:"cubehelix",l:X,s:X===0||X===1?void 0:Math.sqrt(H*H+G*G)/(p1[4]*X*(1-X))};if(z.s)z.h=Math.atan2(G,H)*Lw-120;if(Q!==void 0)z.alpha=Q;return z},_w=ai;var ni=({h:$,s:Z,l:J,alpha:Q})=>{let X={mode:"rgb"};if($=($===void 0?0:$+120)*Vw,J===void 0)J=0;let H=Z===void 0?0:Z*J*(1-J),G=Math.cos($),z=Math.sin($);if(X.r=J+H*(p1[0]*G+p1[1]*z),X.g=J+H*(p1[2]*G+p1[3]*z),X.b=J+H*(p1[4]*G+p1[5]*z),Q!==void 0)X.alpha=Q;return X},Ow=ni;var H6=($,Z)=>{if($.h===void 0||Z.h===void 0||!$.s||!Z.s)return 0;let J=c5($.h),Q=c5(Z.h),X=Math.sin((Q-J+360)/2*Math.PI/180);return 2*Math.sqrt($.s*Z.s)*X},Pw=($,Z)=>{if($.h===void 0||Z.h===void 0)return 0;let J=c5($.h),Q=c5(Z.h);if(Math.abs(Q-J)>180)return J-(Q-360*Math.sign(Q-J));return Q-J},G6=($,Z)=>{if($.h===void 0||Z.h===void 0||!$.c||!Z.c)return 0;let J=c5($.h),Q=c5(Z.h),X=Math.sin((Q-J+360)/2*Math.PI/180);return 2*Math.sqrt($.c*Z.c)*X};var K8=($)=>{let Z=$.reduce((Q,X)=>{if(X!==void 0){let H=X*Math.PI/180;Q.sin+=Math.sin(H),Q.cos+=Math.cos(H)}return Q},{sin:0,cos:0}),J=Math.atan2(Z.sin,Z.cos)*180/Math.PI;return J<0?360+J:J};var si={mode:"cubehelix",channels:["h","s","l","alpha"],parse:["--cubehelix"],serialize:"--cubehelix",ranges:{h:[0,360],s:[0,4.614],l:[0,1]},fromMode:{rgb:_w},toMode:{rgb:Ow},interpolate:{h:{use:D0,fixup:Y8},s:D0,l:D0,alpha:{use:D0,fixup:B5}},difference:{h:H6},average:{h:K8}},ww=si;var oi=({l:$,a:Z,b:J,alpha:Q},X="lch")=>{if(Z===void 0)Z=0;if(J===void 0)J=0;let H=Math.sqrt(Z*Z+J*J),G={mode:X,l:$,c:H};if(H)G.h=c5(Math.atan2(J,Z)*180/Math.PI);if(Q!==void 0)G.alpha=Q;return G},A4=oi;var ti=({l:$,c:Z,h:J,alpha:Q},X="lab")=>{if(J===void 0)J=0;let H={mode:X,l:$,a:Z?Z*Math.cos(J/180*Math.PI):0,b:Z?Z*Math.sin(J/180*Math.PI):0};if(Q!==void 0)H.alpha=Q;return H},D4=ti;var nG=Math.pow(29,3)/Math.pow(3,3),sG=Math.pow(6,3)/Math.pow(29,3);var F1={X:0.9642956764295677,Y:1,Z:0.8251046025104602},z6={X:0.9504559270516716,Y:1,Z:1.0890577507598784},u_0=Math.pow(29,3)/Math.pow(3,3),p_0=Math.pow(6,3)/Math.pow(29,3);var dq=($)=>Math.pow($,3)>sG?Math.pow($,3):(116*$-16)/nG,ei=({l:$,a:Z,b:J,alpha:Q})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let X=($+16)/116,H=Z/500+X,G=X-J/200,z={mode:"xyz65",x:dq(H)*z6.X,y:dq(X)*z6.Y,z:dq(G)*z6.Z};if(Q!==void 0)z.alpha=Q;return z},oG=ei;var $r=($)=>Z4(oG($)),Y6=$r;var lq=($)=>$>sG?Math.cbrt($):(nG*$+16)/116,Zr=({x:$,y:Z,z:J,alpha:Q})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let X=lq($/z6.X),H=lq(Z/z6.Y),G=lq(J/z6.Z),z={mode:"lab65",l:116*H-16,a:500*(X-H),b:200*(H-G)};if(Q!==void 0)z.alpha=Q;return z},tG=Zr;var Jr=($)=>{let Z=tG($4($));if($.r===$.b&&$.b===$.g)Z.a=Z.b=0;return Z},K6=Jr;var J$=1,eG=1,b3=0.14444444444444443*Math.PI,Q$=Math.cos(b3),X$=Math.sin(b3),$z=100/Math.log(1.39);var Qr=({l:$,c:Z,h:J,alpha:Q})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let X={mode:"lab65",l:(Math.exp($*J$/$z)-1)/0.0039},H=(Math.exp(0.0435*Z*eG*J$)-1)/0.075,G=H*Math.cos(J/180*Math.PI-b3),z=H*Math.sin(J/180*Math.PI-b3);if(X.a=G*Q$-z/0.83*X$,X.b=G*X$+z/0.83*Q$,Q!==void 0)X.alpha=Q;return X},pJ=Qr;var Xr=({l:$,a:Z,b:J,alpha:Q})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let X=Z*Q$+J*X$,H=0.83*(J*Q$-Z*X$),G=Math.sqrt(X*X+H*H),z={mode:"dlch",l:$z/J$*Math.log(1+0.0039*$),c:Math.log(1+0.075*G)/(0.0435*eG*J$)};if(z.c)z.h=c5((Math.atan2(H,X)+b3)/Math.PI*180);if(Q!==void 0)z.alpha=Q;return z},cJ=Xr;var jw=($)=>pJ(A4($,"dlch")),Cw=($)=>D4(cJ($),"dlab"),Hr={mode:"dlab",parse:["--din99o-lab"],serialize:"--din99o-lab",toMode:{lab65:jw,rgb:($)=>Y6(jw($))},fromMode:{lab65:Cw,rgb:($)=>Cw(K6($))},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-40.09,45.501],b:[-40.469,44.344]},interpolate:{l:D0,a:D0,b:D0,alpha:{use:D0,fixup:B5}}},Tw=Hr;var Gr={mode:"dlch",parse:["--din99o-lch"],serialize:"--din99o-lch",toMode:{lab65:pJ,dlab:($)=>D4($,"dlab"),rgb:($)=>Y6(pJ($))},fromMode:{lab65:cJ,dlab:($)=>A4($,"dlch"),rgb:($)=>cJ(K6($))},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,51.484],h:[0,360]},interpolate:{l:D0,c:D0,h:{use:D0,fixup:Y8},alpha:{use:D0,fixup:B5}},difference:{h:G6},average:{h:K8}},Ew=Gr;function iq({h:$,s:Z,i:J,alpha:Q}){if($=c5($!==void 0?$:0),Z===void 0)Z=0;if(J===void 0)J=0;let X=Math.abs($/60%2-1),H;switch(Math.floor($/60)){case 0:H={r:J*(1+Z*(3/(2-X)-1)),g:J*(1+Z*(3*(1-X)/(2-X)-1)),b:J*(1-Z)};break;case 1:H={r:J*(1+Z*(3*(1-X)/(2-X)-1)),g:J*(1+Z*(3/(2-X)-1)),b:J*(1-Z)};break;case 2:H={r:J*(1-Z),g:J*(1+Z*(3/(2-X)-1)),b:J*(1+Z*(3*(1-X)/(2-X)-1))};break;case 3:H={r:J*(1-Z),g:J*(1+Z*(3*(1-X)/(2-X)-1)),b:J*(1+Z*(3/(2-X)-1))};break;case 4:H={r:J*(1+Z*(3*(1-X)/(2-X)-1)),g:J*(1-Z),b:J*(1+Z*(3/(2-X)-1))};break;case 5:H={r:J*(1+Z*(3/(2-X)-1)),g:J*(1-Z),b:J*(1+Z*(3*(1-X)/(2-X)-1))};break;default:H={r:J*(1-Z),g:J*(1-Z),b:J*(1-Z)}}if(H.mode="rgb",Q!==void 0)H.alpha=Q;return H}function rq({r:$,g:Z,b:J,alpha:Q}){if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let X=Math.max($,Z,J),H=Math.min($,Z,J),G={mode:"hsi",s:$+Z+J===0?0:1-3*H/($+Z+J),i:($+Z+J)/3};if(X-H!==0)G.h=(X===$?(Z-J)/(X-H)+(Z<J)*6:X===Z?(J-$)/(X-H)+2:($-Z)/(X-H)+4)*60;if(Q!==void 0)G.alpha=Q;return G}var zr={mode:"hsi",toMode:{rgb:iq},parse:["--hsi"],serialize:"--hsi",fromMode:{rgb:rq},channels:["h","s","i","alpha"],ranges:{h:[0,360]},gamut:"rgb",interpolate:{h:{use:D0,fixup:Y8},s:D0,i:D0,alpha:{use:D0,fixup:B5}},difference:{h:H6},average:{h:K8}},Iw=zr;function aq({h:$,s:Z,l:J,alpha:Q}){if($=c5($!==void 0?$:0),Z===void 0)Z=0;if(J===void 0)J=0;let X=J+Z*(J<0.5?J:1-J),H=X-(X-J)*2*Math.abs($/60%2-1),G;switch(Math.floor($/60)){case 0:G={r:X,g:H,b:2*J-X};break;case 1:G={r:H,g:X,b:2*J-X};break;case 2:G={r:2*J-X,g:X,b:H};break;case 3:G={r:2*J-X,g:H,b:X};break;case 4:G={r:H,g:2*J-X,b:X};break;case 5:G={r:X,g:2*J-X,b:H};break;default:G={r:2*J-X,g:2*J-X,b:2*J-X}}if(G.mode="rgb",Q!==void 0)G.alpha=Q;return G}function nq({r:$,g:Z,b:J,alpha:Q}){if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let X=Math.max($,Z,J),H=Math.min($,Z,J),G={mode:"hsl",s:X===H?0:(X-H)/(1-Math.abs(X+H-1)),l:0.5*(X+H)};if(X-H!==0)G.h=(X===$?(Z-J)/(X-H)+(Z<J)*6:X===Z?(J-$)/(X-H)+2:($-Z)/(X-H)+4)*60;if(Q!==void 0)G.alpha=Q;return G}var Yr=($,Z)=>{switch(Z){case"deg":return+$;case"rad":return $/Math.PI*180;case"grad":return $/10*9;case"turn":return $*360}},Rw=Yr;var Kr=new RegExp(`^hsla?\\(\\s*${Xw}${X6}${S3}${X6}${S3}\\s*(?:,\\s*${fJ}\\s*)?\\)$`),Wr=($)=>{let Z=$.match(Kr);if(!Z)return;let J={mode:"hsl"};if(Z[3]!==void 0)J.h=+Z[3];else if(Z[1]!==void 0&&Z[2]!==void 0)J.h=Rw(Z[1],Z[2]);if(Z[4]!==void 0)J.s=Math.min(Math.max(0,Z[4]/100),1);if(Z[5]!==void 0)J.l=Math.min(Math.max(0,Z[5]/100),1);if(Z[6]!==void 0)J.alpha=Math.max(0,Math.min(1,Z[6]/100));else if(Z[7]!==void 0)J.alpha=Math.max(0,Math.min(1,+Z[7]));return J},kw=Wr;function Br($,Z){if(!Z||Z[0]!=="hsl"&&Z[0]!=="hsla")return;let J={mode:"hsl"},[,Q,X,H,G]=Z;if(Q.type!==A0.None){if(Q.type===A0.Percentage)return;J.h=Q.value}if(X.type!==A0.None){if(X.type===A0.Hue)return;J.s=X.value/100}if(H.type!==A0.None){if(H.type===A0.Hue)return;J.l=H.value/100}if(G.type!==A0.None)J.alpha=Math.min(1,Math.max(0,G.type===A0.Number?G.value:G.value/100));return J}var Sw=Br;var qr={mode:"hsl",toMode:{rgb:aq},fromMode:{rgb:nq},channels:["h","s","l","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[Sw,kw],serialize:($)=>`hsl(${$.h!==void 0?$.h:"none"} ${$.s!==void 0?$.s*100+"%":"none"} ${$.l!==void 0?$.l*100+"%":"none"}${$.alpha<1?` / ${$.alpha}`:""})`,interpolate:{h:{use:D0,fixup:Y8},s:D0,l:D0,alpha:{use:D0,fixup:B5}},difference:{h:H6},average:{h:K8}},Zz=qr;function dJ({h:$,s:Z,v:J,alpha:Q}){if($=c5($!==void 0?$:0),Z===void 0)Z=0;if(J===void 0)J=0;let X=Math.abs($/60%2-1),H;switch(Math.floor($/60)){case 0:H={r:J,g:J*(1-Z*X),b:J*(1-Z)};break;case 1:H={r:J*(1-Z*X),g:J,b:J*(1-Z)};break;case 2:H={r:J*(1-Z),g:J,b:J*(1-Z*X)};break;case 3:H={r:J*(1-Z),g:J*(1-Z*X),b:J};break;case 4:H={r:J*(1-Z*X),g:J*(1-Z),b:J};break;case 5:H={r:J,g:J*(1-Z),b:J*(1-Z*X)};break;default:H={r:J*(1-Z),g:J*(1-Z),b:J*(1-Z)}}if(H.mode="rgb",Q!==void 0)H.alpha=Q;return H}function lJ({r:$,g:Z,b:J,alpha:Q}){if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let X=Math.max($,Z,J),H=Math.min($,Z,J),G={mode:"hsv",s:X===0?0:1-H/X,v:X};if(X-H!==0)G.h=(X===$?(Z-J)/(X-H)+(Z<J)*6:X===Z?(J-$)/(X-H)+2:($-Z)/(X-H)+4)*60;if(Q!==void 0)G.alpha=Q;return G}var Ur={mode:"hsv",toMode:{rgb:dJ},parse:["--hsv"],serialize:"--hsv",fromMode:{rgb:lJ},channels:["h","s","v","alpha"],ranges:{h:[0,360]},gamut:"rgb",interpolate:{h:{use:D0,fixup:Y8},s:D0,v:D0,alpha:{use:D0,fixup:B5}},difference:{h:H6},average:{h:K8}},Jz=Ur;function sq({h:$,w:Z,b:J,alpha:Q}){if(Z===void 0)Z=0;if(J===void 0)J=0;if(Z+J>1){let X=Z+J;Z/=X,J/=X}return dJ({h:$,s:J===1?1:1-Z/(1-J),v:1-J,alpha:Q})}function oq($){let Z=lJ($);if(Z===void 0)return;let J=Z.s!==void 0?Z.s:0,Q=Z.v!==void 0?Z.v:0,X={mode:"hwb",w:(1-J)*Q,b:1-Q};if(Z.h!==void 0)X.h=Z.h;if(Z.alpha!==void 0)X.alpha=Z.alpha;return X}function Fr($,Z){if(!Z||Z[0]!=="hwb")return;let J={mode:"hwb"},[,Q,X,H,G]=Z;if(Q.type!==A0.None){if(Q.type===A0.Percentage)return;J.h=Q.value}if(X.type!==A0.None){if(X.type===A0.Hue)return;J.w=X.value/100}if(H.type!==A0.None){if(H.type===A0.Hue)return;J.b=H.value/100}if(G.type!==A0.None)J.alpha=Math.min(1,Math.max(0,G.type===A0.Number?G.value:G.value/100));return J}var bw=Fr;var Nr={mode:"hwb",toMode:{rgb:sq},fromMode:{rgb:oq},channels:["h","w","b","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[bw],serialize:($)=>`hwb(${$.h!==void 0?$.h:"none"} ${$.w!==void 0?$.w*100+"%":"none"} ${$.b!==void 0?$.b*100+"%":"none"}${$.alpha<1?` / ${$.alpha}`:""})`,interpolate:{h:{use:D0,fixup:Y8},w:D0,b:D0,alpha:{use:D0,fixup:B5}},difference:{h:Pw},average:{h:K8}},yw=Nr;var Qz=203;var Xz=0.1593017578125;var Hz=0.8359375,Gz=18.8515625,zz=18.6875;function Yz($){if($<0)return 0;let Z=Math.pow($,0.012683313515655966);return 1e4*Math.pow(Math.max(0,Z-0.8359375)/(18.8515625-18.6875*Z),6.277394636015326)}function Kz($){if($<0)return 0;let Z=Math.pow($/1e4,0.1593017578125);return Math.pow((0.8359375+18.8515625*Z)/(1+18.6875*Z),78.84375)}var tq=($)=>Math.max($/Qz,0),Vr=({i:$,t:Z,p:J,alpha:Q})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let X=Yz($+0.008609037037932761*Z+0.11102962500302593*J),H=Yz($-0.00860903703793275*Z-0.11102962500302599*J),G=Yz($+0.5600313357106791*Z-0.32062717498731885*J),z={mode:"xyz65",x:tq(2.070152218389422*X-1.3263473389671556*H+0.2066510476294051*G),y:tq(0.3647385209748074*X+0.680566024947227*H-0.0453045459220346*G),z:tq(-0.049747207535812*X-0.0492609666966138*H+1.1880659249923042*G)};if(Q!==void 0)z.alpha=Q;return z},eq=Vr;var $U=($=0)=>Math.max($*Qz,0),Lr=({x:$,y:Z,z:J,alpha:Q})=>{let X=$U($),H=$U(Z),G=$U(J),z=Kz(0.3592832590121217*X+0.6976051147779502*H-0.0358915932320289*G),Y=Kz(-0.1920808463704995*X+1.1004767970374323*H+0.0753748658519118*G),K=Kz(0.0070797844607477*X+0.0748396662186366*H+0.8433265453898765*G),W=0.5*z+0.5*Y,B=1.61376953125*z-3.323486328125*Y+1.709716796875*K,q=4.378173828125*z-4.24560546875*Y-0.132568359375*K,U={mode:"itp",i:W,t:B,p:q};if(Q!==void 0)U.alpha=Q;return U},ZU=Lr;var Mr={mode:"itp",channels:["i","t","p","alpha"],parse:["--ictcp"],serialize:"--ictcp",toMode:{xyz65:eq,rgb:($)=>Z4(eq($))},fromMode:{xyz65:ZU,rgb:($)=>ZU($4($))},ranges:{i:[0,0.581],t:[-0.369,0.272],p:[-0.164,0.331]},interpolate:{i:D0,t:D0,p:D0,alpha:{use:D0,fixup:B5}}},xw=Mr;var Ar=134.03437499999998,Dr=0.000000000016295499532821565,JU=($)=>{if($<0)return 0;let Z=Math.pow($/1e4,Xz);return Math.pow((Hz+Gz*Z)/(1+zz*Z),Ar)},QU=($=0)=>Math.max($*203,0),_r=({x:$,y:Z,z:J,alpha:Q})=>{$=QU($),Z=QU(Z),J=QU(J);let X=1.15*$-0.15*J,H=0.66*Z+0.34*$,G=JU(0.41478972*X+0.579999*H+0.014648*J),z=JU(-0.20151*X+1.120649*H+0.0531008*J),Y=JU(-0.0166008*X+0.2648*H+0.6684799*J),K=(G+z)/2,W={mode:"jab",j:0.44*K/(1-0.56*K)-Dr,a:3.524*G-4.066708*z+0.542708*Y,b:0.199076*G+1.096799*z-1.295875*Y};if(Q!==void 0)W.alpha=Q;return W},Wz=_r;var Or=134.03437499999998,hw=0.000000000016295499532821565,XU=($)=>{if($<0)return 0;let Z=Math.pow($,1/Or);return 1e4*Math.pow((Hz-Z)/(zz*Z-Gz),1/Xz)},HU=($)=>$/203,Pr=({j:$,a:Z,b:J,alpha:Q})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let X=($+hw)/(0.44+0.56*($+hw)),H=XU(X+0.13860504*Z+0.058047316*J),G=XU(X-0.13860504*Z-0.058047316*J),z=XU(X-0.096019242*Z-0.8118919*J),Y={mode:"xyz65",x:HU(1.661373024652174*H-0.914523081304348*G+0.23136208173913045*z),y:HU(-0.3250758611844533*H+1.571847026732543*G-0.21825383453227928*z),z:HU(-0.090982811*H-0.31272829*G+1.5227666*z)};if(Q!==void 0)Y.alpha=Q;return Y},Bz=Pr;var wr=($)=>{let Z=Wz($4($));if($.r===$.b&&$.b===$.g)Z.a=Z.b=0;return Z},qz=wr;var jr=($)=>Z4(Bz($)),Uz=jr;var Cr={mode:"jab",channels:["j","a","b","alpha"],parse:["--jzazbz"],serialize:"--jzazbz",fromMode:{rgb:qz,xyz65:Wz},toMode:{rgb:Uz,xyz65:Bz},ranges:{j:[0,0.222],a:[-0.109,0.129],b:[-0.185,0.134]},interpolate:{j:D0,a:D0,b:D0,alpha:{use:D0,fixup:B5}}},gw=Cr;var Tr=({j:$,a:Z,b:J,alpha:Q})=>{if(Z===void 0)Z=0;if(J===void 0)J=0;let X=Math.sqrt(Z*Z+J*J),H={mode:"jch",j:$,c:X};if(X)H.h=c5(Math.atan2(J,Z)*180/Math.PI);if(Q!==void 0)H.alpha=Q;return H},GU=Tr;var Er=({j:$,c:Z,h:J,alpha:Q})=>{if(J===void 0)J=0;let X={mode:"jab",j:$,a:Z?Z*Math.cos(J/180*Math.PI):0,b:Z?Z*Math.sin(J/180*Math.PI):0};if(Q!==void 0)X.alpha=Q;return X},zU=Er;var Ir={mode:"jch",parse:["--jzczhz"],serialize:"--jzczhz",toMode:{jab:zU,rgb:($)=>Uz(zU($))},fromMode:{rgb:($)=>GU(qz($)),jab:GU},channels:["j","c","h","alpha"],ranges:{j:[0,0.221],c:[0,0.19],h:[0,360]},interpolate:{h:{use:D0,fixup:Y8},c:D0,j:D0,alpha:{use:D0,fixup:B5}},difference:{h:G6},average:{h:K8}},vw=Ir;var W6=Math.pow(29,3)/Math.pow(3,3),H$=Math.pow(6,3)/Math.pow(29,3);var YU=($)=>Math.pow($,3)>H$?Math.pow($,3):(116*$-16)/W6,Rr=({l:$,a:Z,b:J,alpha:Q})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let X=($+16)/116,H=Z/500+X,G=X-J/200,z={mode:"xyz50",x:YU(H)*F1.X,y:YU(X)*F1.Y,z:YU(G)*F1.Z};if(Q!==void 0)z.alpha=Q;return z},G$=Rr;var kr=({x:$,y:Z,z:J,alpha:Q})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let X=c4({r:$*3.1341359569958707-Z*1.6173863321612538-0.4906619460083532*J,g:$*-0.978795502912089+Z*1.916254567259524+0.03344273116131949*J,b:$*0.07195537988411677-Z*0.2289768264158322+1.405386058324125*J});if(Q!==void 0)X.alpha=Q;return X},h2=kr;var Sr=($)=>h2(G$($)),Fz=Sr;var br=($)=>{let{r:Z,g:J,b:Q,alpha:X}=p4($),H={mode:"xyz50",x:0.436065742824811*Z+0.3851514688337912*J+0.14307845442264197*Q,y:0.22249319175623702*Z+0.7168870538238823*J+0.06061979053616537*Q,z:0.013923904500943465*Z+0.09708128566574634*J+0.7140993584005155*Q};if(X!==void 0)H.alpha=X;return H},g2=br;var KU=($)=>$>H$?Math.cbrt($):(W6*$+16)/116,yr=({x:$,y:Z,z:J,alpha:Q})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let X=KU($/F1.X),H=KU(Z/F1.Y),G=KU(J/F1.Z),z={mode:"lab",l:116*H-16,a:500*(X-H),b:200*(H-G)};if(Q!==void 0)z.alpha=Q;return z},z$=yr;var xr=($)=>{let Z=z$(g2($));if($.r===$.b&&$.b===$.g)Z.a=Z.b=0;return Z},Nz=xr;function hr($,Z){if(!Z||Z[0]!=="lab")return;let J={mode:"lab"},[,Q,X,H,G]=Z;if(Q.type===A0.Hue||X.type===A0.Hue||H.type===A0.Hue)return;if(Q.type!==A0.None)J.l=Math.min(Math.max(0,Q.value),100);if(X.type!==A0.None)J.a=X.type===A0.Number?X.value:X.value*125/100;if(H.type!==A0.None)J.b=H.type===A0.Number?H.value:H.value*125/100;if(G.type!==A0.None)J.alpha=Math.min(1,Math.max(0,G.type===A0.Number?G.value:G.value/100));return J}var fw=hr;var gr={mode:"lab",toMode:{xyz50:G$,rgb:Fz},fromMode:{xyz50:z$,rgb:Nz},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-125,125],b:[-125,125]},parse:[fw],serialize:($)=>`lab(${$.l!==void 0?$.l:"none"} ${$.a!==void 0?$.a:"none"} ${$.b!==void 0?$.b:"none"}${$.alpha<1?` / ${$.alpha}`:""})`,interpolate:{l:D0,a:D0,b:D0,alpha:{use:D0,fixup:B5}}},Y$=gr;var vr={...Y$,mode:"lab65",parse:["--lab-d65"],serialize:"--lab-d65",toMode:{xyz65:oG,rgb:Y6},fromMode:{xyz65:tG,rgb:K6},ranges:{l:[0,100],a:[-125,125],b:[-125,125]}},mw=vr;function fr($,Z){if(!Z||Z[0]!=="lch")return;let J={mode:"lch"},[,Q,X,H,G]=Z;if(Q.type!==A0.None){if(Q.type===A0.Hue)return;J.l=Math.min(Math.max(0,Q.value),100)}if(X.type!==A0.None)J.c=Math.max(0,X.type===A0.Number?X.value:X.value*150/100);if(H.type!==A0.None){if(H.type===A0.Percentage)return;J.h=H.value}if(G.type!==A0.None)J.alpha=Math.min(1,Math.max(0,G.type===A0.Number?G.value:G.value/100));return J}var uw=fr;var mr={mode:"lch",toMode:{lab:D4,rgb:($)=>Fz(D4($))},fromMode:{rgb:($)=>A4(Nz($)),lab:A4},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,150],h:[0,360]},parse:[uw],serialize:($)=>`lch(${$.l!==void 0?$.l:"none"} ${$.c!==void 0?$.c:"none"} ${$.h!==void 0?$.h:"none"}${$.alpha<1?` / ${$.alpha}`:""})`,interpolate:{h:{use:D0,fixup:Y8},c:D0,l:D0,alpha:{use:D0,fixup:B5}},difference:{h:G6},average:{h:K8}},K$=mr;var ur={...K$,mode:"lch65",parse:["--lch-d65"],serialize:"--lch-d65",toMode:{lab65:($)=>D4($,"lab65"),rgb:($)=>Y6(D4($,"lab65"))},fromMode:{rgb:($)=>A4(K6($),"lch65"),lab65:($)=>A4($,"lch65")},ranges:{l:[0,100],c:[0,150],h:[0,360]}},pw=ur;var pr=({l:$,u:Z,v:J,alpha:Q})=>{if(Z===void 0)Z=0;if(J===void 0)J=0;let X=Math.sqrt(Z*Z+J*J),H={mode:"lchuv",l:$,c:X};if(X)H.h=c5(Math.atan2(J,Z)*180/Math.PI);if(Q!==void 0)H.alpha=Q;return H},WU=pr;var cr=({l:$,c:Z,h:J,alpha:Q})=>{if(J===void 0)J=0;let X={mode:"luv",l:$,u:Z?Z*Math.cos(J/180*Math.PI):0,v:Z?Z*Math.sin(J/180*Math.PI):0};if(Q!==void 0)X.alpha=Q;return X},BU=cr;var cw=($,Z,J)=>4*$/($+15*Z+3*J),dw=($,Z,J)=>9*Z/($+15*Z+3*J),dr=cw(F1.X,F1.Y,F1.Z),lr=dw(F1.X,F1.Y,F1.Z),ir=($)=>$<=H$?W6*$:116*Math.cbrt($)-16,rr=({x:$,y:Z,z:J,alpha:Q})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let X=ir(Z/F1.Y),H=cw($,Z,J),G=dw($,Z,J);if(!isFinite(H)||!isFinite(G))X=H=G=0;else H=13*X*(H-dr),G=13*X*(G-lr);let z={mode:"luv",l:X,u:H,v:G};if(Q!==void 0)z.alpha=Q;return z},iJ=rr;var ar=($,Z,J)=>4*$/($+15*Z+3*J),nr=($,Z,J)=>9*Z/($+15*Z+3*J),sr=ar(F1.X,F1.Y,F1.Z),or=nr(F1.X,F1.Y,F1.Z),tr=({l:$,u:Z,v:J,alpha:Q})=>{if($===void 0)$=0;if($===0)return{mode:"xyz50",x:0,y:0,z:0};if(Z===void 0)Z=0;if(J===void 0)J=0;let X=Z/(13*$)+sr,H=J/(13*$)+or,G=F1.Y*($<=8?$/W6:Math.pow(($+16)/116,3)),z=G*(9*X)/(4*H),Y=G*(12-3*X-20*H)/(4*H),K={mode:"xyz50",x:z,y:G,z:Y};if(Q!==void 0)K.alpha=Q;return K},rJ=tr;var er=($)=>WU(iJ(g2($))),$a=($)=>h2(rJ(BU($))),Za={mode:"lchuv",toMode:{luv:BU,rgb:$a},fromMode:{rgb:er,luv:WU},channels:["l","c","h","alpha"],parse:["--lchuv"],serialize:"--lchuv",ranges:{l:[0,100],c:[0,176.956],h:[0,360]},interpolate:{h:{use:D0,fixup:Y8},c:D0,l:D0,alpha:{use:D0,fixup:B5}},difference:{h:G6},average:{h:K8}},lw=Za;var Ja={...u4,mode:"lrgb",toMode:{rgb:c4},fromMode:{rgb:p4},parse:["srgb-linear"],serialize:"srgb-linear"},iw=Ja;var Qa={mode:"luv",toMode:{xyz50:rJ,rgb:($)=>h2(rJ($))},fromMode:{xyz50:iJ,rgb:($)=>iJ(g2($))},channels:["l","u","v","alpha"],parse:["--luv"],serialize:"--luv",ranges:{l:[0,100],u:[-84.936,175.042],v:[-125.882,87.243]},interpolate:{l:D0,u:D0,v:D0,alpha:{use:D0,fixup:B5}}},rw=Qa;var Xa=({r:$,g:Z,b:J,alpha:Q})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let X=Math.cbrt(0.412221469470763*$+0.5363325372617348*Z+0.0514459932675022*J),H=Math.cbrt(0.2119034958178252*$+0.6806995506452344*Z+0.1073969535369406*J),G=Math.cbrt(0.0883024591900564*$+0.2817188391361215*Z+0.6299787016738222*J),z={mode:"oklab",l:0.210454268309314*X+0.7936177747023054*H-0.0040720430116193*G,a:1.9779985324311684*X-2.42859224204858*H+0.450593709617411*G,b:0.0259040424655478*X+0.7827717124575296*H-0.8086757549230774*G};if(Q!==void 0)z.alpha=Q;return z},Vz=Xa;var Ha=($)=>{let Z=Vz(p4($));if($.r===$.b&&$.b===$.g)Z.a=Z.b=0;return Z},B6=Ha;var Ga=({l:$,a:Z,b:J,alpha:Q})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let X=Math.pow($+0.3963377773761749*Z+0.2158037573099136*J,3),H=Math.pow($-0.1055613458156586*Z-0.0638541728258133*J,3),G=Math.pow($-0.0894841775298119*Z-1.2914855480194092*J,3),z={mode:"lrgb",r:4.076741636075957*X-3.3077115392580616*H+0.2309699031821044*G,g:-1.2684379732850317*X+2.6097573492876887*H-0.3413193760026573*G,b:-0.0041960761386756*X-0.7034186179359362*H+1.7076146940746117*G};if(Q!==void 0)z.alpha=Q;return z},v2=Ga;var za=($)=>c4(v2($)),q6=za;function aJ($){return 0.5*(1.170873786407767*$-0.206+Math.sqrt((1.170873786407767*$-0.206)*(1.170873786407767*$-0.206)+0.14050485436893204*$))}function y3($){return($*$+0.206*$)/(1.170873786407767*($+0.03))}function Ya($,Z){let J,Q,X,H,G,z,Y,K;if(-1.88170328*$-0.80936493*Z>1)J=1.19086277,Q=1.76576728,X=0.59662641,H=0.75515197,G=0.56771245,z=4.0767416621,Y=-3.3077115913,K=0.2309699292;else if(1.81444104*$-1.19445276*Z>1)J=0.73956515,Q=-0.45954404,X=0.08285427,H=0.1254107,G=0.14503204,z=-1.2684380046,Y=2.6097574011,K=-0.3413193965;else J=1.35733652,Q=-0.00915799,X=-1.1513021,H=-0.50559606,G=0.00692167,z=-0.0041960863,Y=-0.7034186147,K=1.707614701;let W=J+Q*$+X*Z+H*$*$+G*$*Z,B=0.3963377774*$+0.2158037573*Z,q=-0.1055613458*$-0.0638541728*Z,U=-0.0894841775*$-1.291485548*Z;{let F=1+W*B,N=1+W*q,L=1+W*U,V=F*F*F,M=N*N*N,A=L*L*L,O=3*B*F*F,_=3*q*N*N,D=3*U*L*L,T=6*B*B*F,k=6*q*q*N,x=6*U*U*L,I=z*V+Y*M+K*A,y=z*O+Y*_+K*D,C=z*T+Y*k+K*x;W=W-I*y/(y*y-0.5*I*C)}return W}function qU($,Z){let J=Ya($,Z),Q=v2({l:1,a:J*$,b:J*Z}),X=Math.cbrt(1/Math.max(Q.r,Q.g,Q.b)),H=X*J;return[X,H]}function Ka($,Z,J,Q,X,H=null){if(!H)H=qU($,Z);let G;if((J-X)*H[1]-(H[0]-X)*Q<=0)G=H[1]*X/(Q*H[0]+H[1]*(X-J));else{G=H[1]*(X-1)/(Q*(H[0]-1)+H[1]*(X-J));{let z=J-X,Y=Q,K=0.3963377774*$+0.2158037573*Z,W=-0.1055613458*$-0.0638541728*Z,B=-0.0894841775*$-1.291485548*Z,q=z+Y*K,U=z+Y*W,F=z+Y*B;{let N=X*(1-G)+G*J,L=G*Q,V=N+L*K,M=N+L*W,A=N+L*B,O=V*V*V,_=M*M*M,D=A*A*A,T=3*q*V*V,k=3*U*M*M,x=3*F*A*A,I=6*q*q*V,y=6*U*U*M,C=6*F*F*A,j=4.0767416621*O-3.3077115913*_+0.2309699292*D-1,R=4.0767416621*T-3.3077115913*k+0.2309699292*x,S=4.0767416621*I-3.3077115913*y+0.2309699292*C,E=R/(R*R-0.5*j*S),b=-j*E,g=-1.2684380046*O+2.6097574011*_-0.3413193965*D-1,u=-1.2684380046*T+2.6097574011*k-0.3413193965*x,w=-1.2684380046*I+2.6097574011*y-0.3413193965*C,s=u/(u*u-0.5*g*w),z0=-g*s,h=-0.0041960863*O-0.7034186147*_+1.707614701*D-1,t=-0.0041960863*T-0.7034186147*k+1.707614701*x,M0=-0.0041960863*I-0.7034186147*y+1.707614701*C,d=t/(t*t-0.5*h*M0),Y0=-h*d;b=E>=0?b:1e6,z0=s>=0?z0:1e6,Y0=d>=0?Y0:1e6,G+=Math.min(b,Math.min(z0,Y0))}}}return G}function nJ($,Z,J=null){if(!J)J=qU($,Z);let Q=J[0],X=J[1];return[X/Q,X/(1-Q)]}function Lz($,Z,J){let Q=qU(Z,J),X=Ka(Z,J,$,1,$,Q),H=nJ(Z,J,Q),G=0.11516993+1/(7.4477897+4.1590124*J+Z*(-2.19557347+1.75198401*J+Z*(-2.13704948-10.02301043*J+Z*(-4.24894561+5.38770819*J+4.69891013*Z)))),z=0.11239642+1/(1.6132032-0.68124379*J+Z*(0.40370612+0.90148123*J+Z*(-0.27087943+0.6122399*J+Z*(0.00299215-0.45399568*J-0.14661872*Z)))),Y=X/Math.min($*H[0],(1-$)*H[1]),K=$*G,W=(1-$)*z,B=0.9*Y*Math.sqrt(Math.sqrt(1/(1/(K*K*K*K)+1/(W*W*W*W))));return K=$*0.4,W=(1-$)*0.8,[Math.sqrt(1/(1/(K*K)+1/(W*W))),B,X]}function Mz($){let Z=$.l!==void 0?$.l:0,J=$.a!==void 0?$.a:0,Q=$.b!==void 0?$.b:0,X={mode:"okhsl",l:aJ(Z)};if($.alpha!==void 0)X.alpha=$.alpha;let H=Math.sqrt(J*J+Q*Q);if(!H)return X.s=0,X;let[G,z,Y]=Lz(Z,J/H,Q/H),K;if(H<z){let W=0,B=0.8*G,q=1-B/z;K=(H-W)/(B+q*(H-W))*0.8}else{let W=z,B=0.2*z*z*1.25*1.25/G,q=1-B/(Y-z);K=0.8+0.2*((H-W)/(B+q*(H-W)))}if(K)X.s=K,X.h=c5(Math.atan2(Q,J)*180/Math.PI);return X}function Az($){let Z=$.h!==void 0?$.h:0,J=$.s!==void 0?$.s:0,Q=$.l!==void 0?$.l:0,X={mode:"oklab",l:y3(Q)};if($.alpha!==void 0)X.alpha=$.alpha;if(!J||Q===1)return X.a=X.b=0,X;let H=Math.cos(Z/180*Math.PI),G=Math.sin(Z/180*Math.PI),[z,Y,K]=Lz(X.l,H,G),W,B,q,U;if(J<0.8)W=1.25*J,B=0,q=0.8*z,U=1-q/Y;else W=5*(J-0.8),B=Y,q=0.2*Y*Y*1.25*1.25/z,U=1-q/(K-Y);let F=B+W*q/(1-U*W);return X.a=F*H,X.b=F*G,X}var Wa={...Zz,mode:"okhsl",channels:["h","s","l","alpha"],parse:["--okhsl"],serialize:"--okhsl",fromMode:{oklab:Mz,rgb:($)=>Mz(B6($))},toMode:{oklab:Az,rgb:($)=>q6(Az($))}},aw=Wa;function Dz($){let Z=$.l!==void 0?$.l:0,J=$.a!==void 0?$.a:0,Q=$.b!==void 0?$.b:0,X=Math.sqrt(J*J+Q*Q),H=X?J/X:1,G=X?Q/X:1,[z,Y]=nJ(H,G),K=0.5,W=1-K/z,B=Y/(X+Z*Y),q=B*Z,U=B*X,F=y3(q),N=U*F/q,L=v2({l:F,a:H*N,b:G*N}),V=Math.cbrt(1/Math.max(L.r,L.g,L.b,0));Z=Z/V,X=X/V*aJ(Z)/Z,Z=aJ(Z);let M={mode:"okhsv",s:X?(K+Y)*U/(Y*K+Y*W*U):0,v:Z?Z/q:0};if(M.s)M.h=c5(Math.atan2(Q,J)*180/Math.PI);if($.alpha!==void 0)M.alpha=$.alpha;return M}function _z($){let Z={mode:"oklab"};if($.alpha!==void 0)Z.alpha=$.alpha;let J=$.h!==void 0?$.h:0,Q=$.s!==void 0?$.s:0,X=$.v!==void 0?$.v:0,H=Math.cos(J/180*Math.PI),G=Math.sin(J/180*Math.PI),[z,Y]=nJ(H,G),K=0.5,W=1-K/z,B=1-Q*K/(K+Y-Y*W*Q),q=Q*Y*K/(K+Y-Y*W*Q),U=y3(B),F=q*U/B,N=v2({l:U,a:H*F,b:G*F}),L=Math.cbrt(1/Math.max(N.r,N.g,N.b,0)),V=y3(X*B),M=q*V/B;return Z.l=V*L,Z.a=M*H*L,Z.b=M*G*L,Z}var Ba={...Jz,mode:"okhsv",channels:["h","s","v","alpha"],parse:["--okhsv"],serialize:"--okhsv",fromMode:{oklab:Dz,rgb:($)=>Dz(B6($))},toMode:{oklab:_z,rgb:($)=>q6(_z($))}},nw=Ba;function qa($,Z){if(!Z||Z[0]!=="oklab")return;let J={mode:"oklab"},[,Q,X,H,G]=Z;if(Q.type===A0.Hue||X.type===A0.Hue||H.type===A0.Hue)return;if(Q.type!==A0.None)J.l=Math.min(Math.max(0,Q.type===A0.Number?Q.value:Q.value/100),1);if(X.type!==A0.None)J.a=X.type===A0.Number?X.value:X.value*0.4/100;if(H.type!==A0.None)J.b=H.type===A0.Number?H.value:H.value*0.4/100;if(G.type!==A0.None)J.alpha=Math.min(1,Math.max(0,G.type===A0.Number?G.value:G.value/100));return J}var sw=qa;var Ua={...Y$,mode:"oklab",toMode:{lrgb:v2,rgb:q6},fromMode:{lrgb:Vz,rgb:B6},ranges:{l:[0,1],a:[-0.4,0.4],b:[-0.4,0.4]},parse:[sw],serialize:($)=>`oklab(${$.l!==void 0?$.l:"none"} ${$.a!==void 0?$.a:"none"} ${$.b!==void 0?$.b:"none"}${$.alpha<1?` / ${$.alpha}`:""})`},ow=Ua;function Fa($,Z){if(!Z||Z[0]!=="oklch")return;let J={mode:"oklch"},[,Q,X,H,G]=Z;if(Q.type!==A0.None){if(Q.type===A0.Hue)return;J.l=Math.min(Math.max(0,Q.type===A0.Number?Q.value:Q.value/100),1)}if(X.type!==A0.None)J.c=Math.max(0,X.type===A0.Number?X.value:X.value*0.4/100);if(H.type!==A0.None){if(H.type===A0.Percentage)return;J.h=H.value}if(G.type!==A0.None)J.alpha=Math.min(1,Math.max(0,G.type===A0.Number?G.value:G.value/100));return J}var tw=Fa;var Na={...K$,mode:"oklch",toMode:{oklab:($)=>D4($,"oklab"),rgb:($)=>q6(D4($,"oklab"))},fromMode:{rgb:($)=>A4(B6($),"oklch"),oklab:($)=>A4($,"oklch")},parse:[tw],serialize:($)=>`oklch(${$.l!==void 0?$.l:"none"} ${$.c!==void 0?$.c:"none"} ${$.h!==void 0?$.h:"none"}${$.alpha<1?` / ${$.alpha}`:""})`,ranges:{l:[0,1],c:[0,0.4],h:[0,360]}},ew=Na;var Va=($)=>{let{r:Z,g:J,b:Q,alpha:X}=p4($),H={mode:"xyz65",x:0.486570948648216*Z+0.265667693169093*J+0.1982172852343625*Q,y:0.2289745640697487*Z+0.6917385218365062*J+0.079286914093745*Q,z:0*Z+0.0451133818589026*J+1.043944368900976*Q};if(X!==void 0)H.alpha=X;return H},UU=Va;var La=({x:$,y:Z,z:J,alpha:Q})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let X=c4({r:$*2.4934969119414263-Z*0.9313836179191242-0.402710784450717*J,g:$*-0.8294889695615749+Z*1.7626640603183465+0.0236246858419436*J,b:$*0.0358458302437845-Z*0.0761723892680418+0.9568845240076871*J},"p3");if(Q!==void 0)X.alpha=Q;return X},FU=La;var Ma={...u4,mode:"p3",parse:["display-p3"],serialize:"display-p3",fromMode:{rgb:($)=>FU($4($)),xyz65:FU},toMode:{rgb:($)=>Z4(UU($)),xyz65:UU}},$j=Ma;var NU=($)=>{let Z=Math.abs($);if(Z>=0.001953125)return Math.sign($)*Math.pow(Z,0.5555555555555556);return 16*$},Aa=({x:$,y:Z,z:J,alpha:Q})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let X={mode:"prophoto",r:NU($*1.3457868816471585-Z*0.2555720873797946-0.0511018649755453*J),g:NU($*-0.5446307051249019+Z*1.5082477428451466+0.0205274474364214*J),b:NU($*0+Z*0+1.2119675456389452*J)};if(Q!==void 0)X.alpha=Q;return X},VU=Aa;var LU=($=0)=>{let Z=Math.abs($);if(Z>=0.03125)return Math.sign($)*Math.pow(Z,1.8);return $/16},Da=($)=>{let Z=LU($.r),J=LU($.g),Q=LU($.b),X={mode:"xyz50",x:0.7977666449006423*Z+0.1351812974005331*J+0.0313477341283922*Q,y:0.2880748288194013*Z+0.7118352342418731*J+0.0000899369387256*Q,z:0*Z+0*J+0.8251046025104602*Q};if($.alpha!==void 0)X.alpha=$.alpha;return X},MU=Da;var _a={...u4,mode:"prophoto",parse:["prophoto-rgb"],serialize:"prophoto-rgb",fromMode:{xyz50:VU,rgb:($)=>VU(g2($))},toMode:{xyz50:MU,rgb:($)=>h2(MU($))}},Zj=_a;var AU=($)=>{let Z=Math.abs($);if(Z>0.018053968510807)return(Math.sign($)||1)*(1.09929682680944*Math.pow(Z,0.45)-0.09929682680944008);return 4.5*$},Oa=({x:$,y:Z,z:J,alpha:Q})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let X={mode:"rec2020",r:AU($*1.7166511879712683-Z*0.3556707837763925-0.2533662813736599*J),g:AU($*-0.6666843518324893+Z*1.6164812366349395+0.0157685458139111*J),b:AU($*0.0176398574453108-Z*0.0427706132578085+0.9421031212354739*J)};if(Q!==void 0)X.alpha=Q;return X},DU=Oa;var _U=($=0)=>{let Z=Math.abs($);if(Z<0.08124285829863151)return $/4.5;return(Math.sign($)||1)*Math.pow((Z+1.09929682680944-1)/1.09929682680944,2.2222222222222223)},Pa=($)=>{let Z=_U($.r),J=_U($.g),Q=_U($.b),X={mode:"xyz65",x:0.6369580483012911*Z+0.1446169035862083*J+0.1688809751641721*Q,y:0.262700212011267*Z+0.6779980715188708*J+0.059301716469862*Q,z:0*Z+0.0280726930490874*J+1.0609850577107909*Q};if($.alpha!==void 0)X.alpha=$.alpha;return X},OU=Pa;var wa={...u4,mode:"rec2020",fromMode:{xyz65:DU,rgb:($)=>DU($4($))},toMode:{xyz65:OU,rgb:($)=>Z4(OU($))},parse:["rec2020"],serialize:"rec2020"},Jj=wa;var U6=0.0037930732552754493,Oz=Math.cbrt(0.0037930732552754493);var PU=($)=>Math.cbrt($)-Oz,ja=($)=>{let{r:Z,g:J,b:Q,alpha:X}=p4($),H=PU(0.3*Z+0.622*J+0.078*Q+U6),G=PU(0.23*Z+0.692*J+0.078*Q+U6),z=PU(0.2434226892454782*Z+0.2047674442449682*J+0.5518098665095535*Q+U6),Y={mode:"xyb",x:(H-G)/2,y:(H+G)/2,b:z-(H+G)/2};if(X!==void 0)Y.alpha=X;return Y},Qj=ja;var wU=($)=>Math.pow($+Oz,3),Ca=({x:$,y:Z,b:J,alpha:Q})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let X=wU($+Z)-U6,H=wU(Z-$)-U6,G=wU(J+Z)-U6,z=c4({r:11.031566904639861*X-9.866943908131562*H-0.16462299650829934*G,g:-3.2541473810744237*X+4.418770377582723*H-0.16462299650829934*G,b:-3.6588512867136815*X+2.7129230459360922*H+1.9459282407775895*G});if(Q!==void 0)z.alpha=Q;return z},Xj=Ca;var Ta={mode:"xyb",channels:["x","y","b","alpha"],parse:["--xyb"],serialize:"--xyb",toMode:{rgb:Xj},fromMode:{rgb:Qj},ranges:{x:[-0.0154,0.0281],y:[0,0.8453],b:[-0.2778,0.388]},interpolate:{x:D0,y:D0,b:D0,alpha:{use:D0,fixup:B5}}},Hj=Ta;var Ea={mode:"xyz50",parse:["xyz-d50"],serialize:"xyz-d50",toMode:{rgb:h2,lab:z$},fromMode:{rgb:g2,lab:G$},channels:["x","y","z","alpha"],ranges:{x:[0,0.964],y:[0,0.999],z:[0,0.825]},interpolate:{x:D0,y:D0,z:D0,alpha:{use:D0,fixup:B5}}},Gj=Ea;var Ia=($)=>{let{x:Z,y:J,z:Q,alpha:X}=$;if(Z===void 0)Z=0;if(J===void 0)J=0;if(Q===void 0)Q=0;let H={mode:"xyz50",x:1.0479298208405488*Z+0.0229467933410191*J-0.0501922295431356*Q,y:0.0296278156881593*Z+0.990434484573249*J-0.0170738250293851*Q,z:-0.0092430581525912*Z+0.0150551448965779*J+0.7518742899580008*Q};if(X!==void 0)H.alpha=X;return H},zj=Ia;var Ra=($)=>{let{x:Z,y:J,z:Q,alpha:X}=$;if(Z===void 0)Z=0;if(J===void 0)J=0;if(Q===void 0)Q=0;let H={mode:"xyz65",x:0.9554734527042182*Z-0.0230985368742614*J+0.0632593086610217*Q,y:-0.0283697069632081*Z+1.0099954580058226*J+0.021041398966943*Q,z:0.0123140016883199*Z-0.0205076964334779*J+1.3303659366080753*Q};if(X!==void 0)H.alpha=X;return H},Yj=Ra;var ka={mode:"xyz65",toMode:{rgb:Z4,xyz50:zj},fromMode:{rgb:$4,xyz50:Yj},ranges:{x:[0,0.95],y:[0,1],z:[0,1.088]},channels:["x","y","z","alpha"],parse:["xyz","xyz-d65"],serialize:"xyz-d65",interpolate:{x:D0,y:D0,z:D0,alpha:{use:D0,fixup:B5}}},Kj=ka;var Sa=({r:$,g:Z,b:J,alpha:Q})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let X={mode:"yiq",y:0.29889531*$+0.58662247*Z+0.11448223*J,i:0.59597799*$-0.2741761*Z-0.32180189*J,q:0.21147017*$-0.52261711*Z+0.31114694*J};if(Q!==void 0)X.alpha=Q;return X},Wj=Sa;var ba=({y:$,i:Z,q:J,alpha:Q})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let X={mode:"rgb",r:$+0.95608445*Z+0.6208885*J,g:$-0.27137664*Z-0.6486059*J,b:$-1.10561724*Z+1.70250126*J};if(Q!==void 0)X.alpha=Q;return X},Bj=ba;var ya={mode:"yiq",toMode:{rgb:Bj},fromMode:{rgb:Wj},channels:["y","i","q","alpha"],parse:["--yiq"],serialize:"--yiq",ranges:{i:[-0.595,0.595],q:[-0.522,0.522]},interpolate:{y:D0,i:D0,q:D0,alpha:{use:D0,fixup:B5}}},qj=ya;function jU($){let Z=lG("lrgb")($);return 0.2126*Z.r+0.7152*Z.g+0.0722*Z.b}var gE0=b5(Nw),vE0=b5(ww),fE0=b5(Tw),mE0=b5(Ew),uE0=b5(Iw),pE0=b5(Zz),cE0=b5(Jz),dE0=b5(yw),lE0=b5(xw),iE0=b5(gw),rE0=b5(vw),aE0=b5(Y$),nE0=b5(mw),sE0=b5(K$),oE0=b5(pw),tE0=b5(lw),eE0=b5(iw),$I0=b5(rw),ZI0=b5(aw),JI0=b5(nw),QI0=b5(ow),XI0=b5(ew),HI0=b5($j),GI0=b5(Zj),zI0=b5(Jj),YI0=b5(u4),KI0=b5(Hj),WI0=b5(Gj),BI0=b5(Kj),qI0=b5(qj);var F6={sans:{label:"Sans",sans:"system-ui",mono:"Geist Mono",googleFontsQuery:"Geist+Mono:wght@400;500"},serif:{label:"Serif",sans:"Literata",mono:"Geist Mono",googleFontsQuery:"Literata:wght@400;600;700&family=Geist+Mono:wght@400;500"},mono:{label:"Mono",sans:"Geist Mono",mono:"Geist Mono",googleFontsQuery:"Geist+Mono:wght@400;500;600"},geometric:{label:"Geometric",sans:"Manrope",mono:"Geist Mono",googleFontsQuery:"Manrope:wght@400;500;600&family=Geist+Mono:wght@400;500"},rounded:{label:"Rounded",sans:"SN Pro",mono:"Geist Mono",googleFontsQuery:"SN+Pro:wght@400;500;600&family=Geist+Mono:wght@400;500"},blobby:{label:"Blobby",sans:"Sour Gummy",mono:"Azeret Mono",googleFontsQuery:"Sour+Gummy:wght@400;500;600&family=Azeret+Mono:wght@400;500"},awkward:{label:"Awkward",sans:"Averia Sans Libre",mono:"Azeret Mono",googleFontsQuery:"Averia+Sans+Libre:wght@400;500;600&family=Azeret+Mono:wght@400;500"},comic:{label:"Comic",sans:"Comic Sans MS, Comic Sans, cursive",mono:"Geist Mono",googleFontsQuery:"Geist+Mono:wght@400;500"}},sJ={squishy:{label:"Squishy",radius:"0.875rem"},soft:{label:"Soft",radius:"0.625rem"},subtle:{label:"Subtle",radius:"0.375rem"},square:{label:"Square",radius:"0"}},Fj="oklch(0.205 0 0)";function Uj($){return jU($)>0.3?"oklch(0 0 0)":"oklch(1 0 0)"}var Nj={workspace:{primary:($)=>$,primaryForeground:($)=>Uj($),background:()=>"color-mix(var(--primary) 3%, oklch(1 0 0) 97%)",foreground:()=>"color-mix(var(--primary) 20%, oklch(0 0 0) 80%)",muted:()=>"color-mix(var(--background) 96%, var(--foreground) 4%)",mutedForeground:()=>"color-mix(var(--background) 50%, var(--foreground) 50%)",accent:()=>"color-mix(var(--primary) 4%, var(--foreground) 4%)",accentForeground:()=>"var(--foreground)",border:()=>"color-mix(var(--foreground) 7%, transparent)"},widget:{background:($)=>$,foreground:($)=>Uj($),primary:()=>"color-mix(var(--background) 3%, oklch(1 0 0) 97%)",primaryForeground:()=>"color-mix(var(--background) 20%, oklch(0 0 0) 80%)",muted:()=>"color-mix(var(--background) 97%, var(--foreground) 3%)",mutedForeground:()=>"color-mix(var(--background) 50%, var(--foreground) 50%)",accent:()=>"color-mix(var(--primary) 4%, var(--foreground) 4%)",accentForeground:()=>"var(--foreground)",border:()=>"color-mix(var(--foreground) 15%, transparent)"}},CU=Object.keys(Nj.workspace);function Vj($,Z="workspace"){let J={},Q=Nj[Z];for(let X of CU)J[X]=Q[X]($);return J}var oJ={default:{label:"Default"},paper:{label:"Paper",primary:"oklch(0.4328 0.0351 66.67)"},rose:{label:"Rose",primary:"oklch(0.6322 0.2171 26.02)"},tangerine:{label:"Tangerine",primary:"oklch(0.6886 0.22 37.15)"},sand:{label:"Sand",primary:"oklch(0.8334 0.1271 67.80)"},mint:{label:"Tropics",primary:"oklch(0.5774 0.1399 156.06)"},sky:{label:"Sky",primary:"oklch(0.5824 0.1830 253.59)"},lavender:{label:"Lavender",primary:"oklch(0.6025 0.2426 294.58)"}},x3={font:"sans",color:"default",radius:"soft"};function tJ($){return{...x3,...$}}var TU="moi-fonts",Lj="moi-font-previews",xa=Object.values(F6).map(($)=>$.googleFontsQuery).filter(Boolean).join("&family="),Aj=[["sans","--sans"],["mono","--mono"]],Dj=CU.map(($)=>[$,ha($)]),_j="--radius",Mj=[...Aj.map(([,$])=>$),...Dj.map(([,$])=>$),_j];function ha($){return`--${$.replace(/[A-Z]/g,(J)=>`-${J.toLowerCase()}`)}`}function f2($,Z="workspace"){let J={},Q=tJ($),X=F6[Q.font]??F6[x3.font],G=(oJ[Q.color]??oJ[x3.color]).primary??(Z==="widget"?Fj:void 0),z=G?Vj(G,Z):void 0,Y=sJ[Q.radius]??sJ[x3.radius];for(let[K,W]of Aj)J[W]=X[K];for(let[K,W]of Dj)J[W]=z?.[K];return J[_j]=Y.radius,J}function wz(){Pz.useEffect(()=>{if(document.getElementById(Lj))return;let $=document.createElement("link");return $.id=Lj,$.rel="stylesheet",$.href=`https://fonts.googleapis.com/css2?family=${xa}&display=swap`,document.head.appendChild($),()=>{$.remove()}},[])}function ga($){Pz.useEffect(()=>{let Z=document.documentElement,J=f2($);for(let Q of Mj){let X=J[Q];if(X)Z.style.setProperty(Q,X);else Z.style.removeProperty(Q)}return()=>{for(let Q of Mj)Z.style.removeProperty(Q)}},[$])}function Oj($){let{font:Z}=tJ($);ga($),Pz.useEffect(()=>{let J=F6[Z]??F6[x3.font],Q=document.getElementById(TU);if(!J.googleFontsQuery)Q?.remove();else{let X=`https://fonts.googleapis.com/css2?family=${J.googleFontsQuery}&display=swap`;if(Q)Q.href=X;else{let H=document.createElement("link");H.id=TU,H.rel="stylesheet",H.href=X,document.head.appendChild(H)}}return()=>{document.getElementById(TU)?.remove()}},[Z])}var W$=P(v(),1);var W8=P(l(),1),eJ={width:320,height:180,radius:32,topLeftRadius:18,bodyTop:24,tabEnd:124,shoulder:{width:48,roundness:20}};function va($){let{width:Z,height:J,radius:Q,topLeftRadius:X,bodyTop:H,tabEnd:G,shoulder:z}=eJ,Y=Math.min(Z/2,Q*$),K=Math.min(Z/2,X*$),W=Math.max(0,z.width),B=G+W,q=Math.max(0,Math.min(z.roundness,W/2));return[`M ${K} 0`,`H ${G}`,`C ${G+q} 0 ${B-q} ${H} ${B} ${H}`,`H ${Z-Y}`,`Q ${Z} ${H} ${Z} ${H+Q}`,`V ${J-Q}`,`Q ${Z} ${J} ${Z-Y} ${J}`,`H ${Y}`,`Q 0 ${J} 0 ${J-Q}`,`V ${X}`,`Q 0 0 ${K} 0`,"Z"].join(" ")}function fa(){let $=W$.useRef(null),[Z,J]=W$.useState(1);return W$.useLayoutEffect(()=>{let Q=$.current;if(!Q)return;let X=(z,Y)=>{if(z<=0||Y<=0)return;let K=z/eJ.width,B=Y/eJ.height/K;J((q)=>Math.abs(q-B)<0.001?q:B)},H=Q.getBoundingClientRect();X(H.width,H.height);let G=new ResizeObserver(([z])=>{if(z)X(z.contentRect.width,z.contentRect.height)});return G.observe(Q),()=>G.disconnect()},[]),{ref:$,horizontalRadiusScale:Z}}var jz=[e("opacity-40","-translate-x-3 translate-y-3 -rotate-6","group-hover:translate-y-2 group-focus-visible:translate-y-2"),e("opacity-50","translate-x-3 translate-y-2 rotate-5","group-hover:translate-y-1 group-focus-visible:translate-y-1"),e("opacity-100","-translate-x-1 translate-y-1 -rotate-2","group-hover:-translate-y-2 group-focus-visible:-translate-y-2")];function Pj({workspaceId:$}){let Z=nH($),J=Z.data?[...Z.data.thumbnails].reverse():[],Q=jz.slice(jz.length-J.length),X=Z.data?.firstUserMessage,H=Z.data?.theme,{ref:G,horizontalRadiusScale:z}=fa(),Y=va(z),K=`folder-noise-${$}`,W=f2(H);return W8.jsxs("div",{ref:G,style:W,className:"relative h-45 w-full font-sans",children:[W8.jsxs("svg",{viewBox:`0 0 ${eJ.width} ${eJ.height}`,preserveAspectRatio:"none","aria-hidden":"true",className:"absolute inset-0 h-full w-full overflow-visible",children:[W8.jsx("defs",{children:W8.jsxs("filter",{id:K,x:"0%",y:"0%",width:"100%",height:"100%",colorInterpolationFilters:"sRGB",children:[W8.jsx("feTurbulence",{type:"fractalNoise",baseFrequency:"0.5",numOctaves:"3",seed:"7",result:"noise"}),W8.jsx("feColorMatrix",{in:"noise",type:"saturate",values:"0",result:"monochromeNoise"}),W8.jsx("feComponentTransfer",{in:"monochromeNoise",result:"faintNoise",children:W8.jsx("feFuncA",{type:"linear",slope:"0.24"})}),W8.jsx("feComposite",{in:"faintNoise",in2:"SourceAlpha",operator:"in",result:"clippedNoise"}),W8.jsx("feBlend",{in:"SourceGraphic",in2:"clippedNoise",mode:"soft-light"})]})}),W8.jsx("path",{d:Y,filter:`url(#${K})`,className:"fill-accent"})]}),J.map((B,q)=>W8.jsx("img",{src:B,alt:"",loading:"lazy",className:e("absolute top-[12%] left-[14%] aspect-4/3 w-[72%] rounded-lg object-cover object-top shadow-xs","animate-in transition-transform duration-300 ease-out fade-in",Q[q])},q)),J.length===0&&X&&W8.jsx("div",{className:"absolute inset-x-[12%] top-[22%] flex justify-end",children:W8.jsx("div",{"aria-hidden":"true",className:e("w-max max-w-40 origin-center rounded-lg bg-card px-3 py-2 shadow-xs","animate-in transition-transform duration-300 ease-out fade-in",jz[jz.length-1],"group-hover:translate-y-0.5 group-focus-visible:translate-y-0.5"),children:W8.jsx("p",{className:"line-clamp-3 text-sm leading-normal whitespace-normal",children:X})})}),W8.jsx("div",{className:e("absolute inset-x-2 top-[40%] bottom-2 rounded-2xl bg-[color-mix(in_oklch,var(--accent),var(--foreground)_5%)]","mask-[linear-gradient(to_bottom,rgba(0,0,0,0.9)_0%,black_50%)] backdrop-blur-lg","inset-shadow-[0_0_12px_color-mix(in_oklab,var(--background)_20%,transparent)]")})]})}var Z5=P(l(),1);function jj(){wz();let[,$]=I4(),Z=aH(),J=f_(),Q=sH(),X=mP({onSuccess:(B)=>$(`/workspace/${B.id}`)}),H=m1((B)=>B.discoveredWorkspacesOpen),G=m1((B)=>B.setDiscoveredWorkspacesOpen);if(Z.isPending||J.isPending)return Z5.jsx("div",{className:"flex min-h-[50vh] items-center justify-center",children:Z5.jsx(A1,{size:20,stroke:1.5,className:"animate-spin text-muted-foreground"})});if(Z.isError||J.isError)return Z5.jsx("div",{className:"flex min-h-[50vh] items-center justify-center",children:Z5.jsx("p",{className:"text-sm text-muted-foreground",children:"Could not load spaces."})});let z=Z.data,Y=J.data,K=z.length;function W(B){X.startImport(B)}return Z5.jsxs("div",{className:"mx-auto w-full max-w-3xl px-8 pt-14 pb-16",children:[Z5.jsx(dP,{className:"mb-10"}),K>0?Z5.jsxs("section",{className:"mb-12",children:[Z5.jsxs("div",{className:"mb-4 flex items-center justify-between gap-2",children:[Z5.jsx("h1",{className:"text-sm font-medium text-foreground",children:"My workspaces"}),Z5.jsx(DJ,{trigger:Z5.jsxs(E0,{variant:"outline",size:"sm",children:[Z5.jsx(e8,{"data-icon":"inline-start",stroke:1.75}),"New"]})})]}),Z5.jsx("div",{className:"grid grid-cols-1 gap-x-4 gap-y-8 sm:grid-cols-2 md:grid-cols-3",children:z.map((B)=>Z5.jsx(ma,{workspace:B},B.id))})]}):Z5.jsxs("div",{className:"mb-10 flex flex-col items-center gap-4 px-8 pt-8 pb-16 text-center",children:[Z5.jsx(wj,{size:32,stroke:1.5,className:"text-muted-foreground"}),Z5.jsxs("div",{className:"flex flex-col gap-1.5",children:[Z5.jsx("h2",{className:"font-medium",children:"Let’s start with creating your first workspace"}),Z5.jsx("p",{className:"mx-auto max-w-sm text-sm text-muted-foreground",children:"Workspace is a place for all the chats, widgets, and views that share the same context. Create a new one or import an existing folder you’ve worked in before."})]}),Z5.jsx(DJ,{trigger:Z5.jsx(E0,{children:"Create workspace"})})]}),Y.length>0&&Z5.jsx("section",{children:Z5.jsxs(fG,{open:H,onOpenChange:G,className:"group",children:[Z5.jsxs(mG,{className:e("group/trigger","flex w-full items-center gap-1 pb-4 text-left outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring","text-muted-foreground group-data-open:text-foreground hover:text-foreground"),children:[Z5.jsx("span",{className:"text-sm font-medium",children:"Import from this computer"}),Z5.jsx(h3,{size:16,stroke:2,className:e("opacity-0 transition-[opacity,transform]","group-hover/trigger:opacity-100 group-focus-visible/trigger:opacity-100 group-data-open:rotate-90")})]}),Z5.jsx(uG,{children:Z5.jsx("ul",{className:"border-t border-border",children:Y.map((B)=>Z5.jsx(ua,{suggestion:B,onAdd:W},B.path))})})]})}),X.choice&&Z5.jsx(vP,{choice:X.choice,availability:Q.data?.availability,isPending:X.isPending,errorMessage:X.error?.message,onTypeChange:X.selectType,onSubmit:X.submit,onReset:X.reset})]})}function ma({workspace:$}){let Z=P3($),J=nH($.id),Q=J.data?.theme,X=J.data?.updatedAt??new Date($.addedAt).getTime();return Z5.jsxs(bZ,{href:`/workspace/${$.id}`,className:"group flex min-w-0 flex-col gap-3",children:[Z5.jsx(Pj,{workspaceId:$.id}),Z5.jsxs("div",{className:"flex min-w-0 flex-col gap-2 px-2",children:[Z5.jsxs("div",{className:"flex min-w-0 items-center gap-1.5 font-sans",style:f2(Q),children:[Z5.jsx("img",{src:$.icon??H2[$.type??"claude-code"],alt:"",className:"size-4 shrink-0 rounded-xs"}),Z5.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:Z})]}),Z5.jsx("span",{className:"text-xs text-muted-foreground",children:pa(X)})]})]})}function ua({suggestion:$,onAdd:Z}){let{path:J,types:Q}=$,X=P3($);return Z5.jsxs("li",{className:"flex items-center gap-2 border-b border-border px-1 py-3",children:[Z5.jsx(cO,{types:Q}),Z5.jsx("span",{className:"shrink-0 text-sm font-medium text-foreground",children:X}),Z5.jsx("span",{title:J,className:"min-w-0 flex-1 truncate text-xs text-muted-foreground",children:$.displayPath??J}),Z5.jsxs(E0,{variant:"outline",size:"sm",onClick:()=>Z($),children:[Z5.jsx(e8,{stroke:1.75}),"Add"]})]})}function pa($){let Z=Date.now()-$,J=Math.floor(Z/60000);if(J<1)return"Updated just now";if(J<60)return`Updated ${J} min${J===1?"":"s"} ago`;let Q=Math.floor(J/60);if(Q<24)return`Updated ${Q} hour${Q===1?"":"s"} ago`;let X=Math.floor(Q/24);if(X<30)return`Updated ${X} day${X===1?"":"s"} ago`;return`Updated ${new Date($).toLocaleDateString()}`}var Cz=P(l(),1);function Cj(){return Cz.jsx(SG,{showWorkspaces:!1,children:Cz.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:Cz.jsx(jj,{})})})}var Tz=P(v(),1);var EU=P(l(),1),Ij=($)=>$.map((Z)=>[...Z].map((J)=>J==="#"?1:0)),ca=["####.","#.#.#","#.#.#","#.#.#","#.#.#"],da=["###.#","#.#.#","#.#.#","#.#.#","###.#"],la=Ij([".....","####.","#.#.#","#.#.#","#.#.#"]),ia=Ij(ca.map(($,Z)=>`${$}.${da[Z]}`)),ra={moi:la,"moi-full":ia};function Rj($,Z,J){let Q=[];for(let X=0;X<Z;X++){let H=[];for(let G=0;G<$;G++)H.push(J(G,X));Q.push(H)}return Q}function Tj($,Z,J){let Q=Math.sin($*12.9898+Z*78.233+J*37.719)*43758.5453;return Q-Math.floor(Q)}function aa($,Z,J){return Rj(Z,J,(Q,X)=>{let H=Tj(Q,X,0)*Math.PI*2,G=5+Tj(Q,X,1)*6,z=0.5+0.5*Math.sin($*G+H);return z*z})}function na($,Z,J){return Rj(Z,J,(X,H)=>0.5+0.5*Math.sin(X*0.5+H*0.32-$*6.5))}var kj=0.55;function sa($,Z){let J=$.length,Q=$.reduce((Y,K)=>Math.max(Y,K.length),0),X=Math.min(Z/kj,1),H=1-Math.pow(1-X,3),G=Math.round((1-H)*J),z=[];for(let Y=0;Y<J;Y++){let K=[];for(let W=0;W<Q;W++)K.push($[Y-G]?.[W]??0);z.push(K)}return z}function Ej($,Z,J){let Q=ra[$];if(Z===void 0)return sa(Q,J);let X=Q.length,H=Q[0]?.length??0;return Z==="wave"?na(J,H,X):aa(J,H,X)}var oa=24;function ta($,Z,J){let[Q,X]=Tz.useState(()=>Ej($,Z,0));return Tz.useEffect(()=>{let H=0,G=null,z=0,Y=1000/J,K=(W)=>{if(G===null)G=W;let B=(W-G)/1000;if(W-z>=Y){if(z=W,X(Ej($,Z,B)),Z===void 0&&B>=kj)return}H=requestAnimationFrame(K)};return H=requestAnimationFrame(K),()=>cancelAnimationFrame(H)},[$,Z,J]),Q}function ea($){return`rgba(23, 23, 23, ${(0.1+Math.max(0,Math.min(1,$))*0.9).toFixed(3)})`}function Sj({sprite:$="moi",effect:Z,fps:J=oa,pixelSize:Q=3,gap:X=1,className:H}){let G=ta($,Z,J),z=G[0]?.length??0,Y=Z!==void 0;return EU.jsx("div",{className:e("grid",H),style:{gridTemplateColumns:`repeat(${z}, ${Q}px)`,gap:`${X}px`},children:G.flatMap((K,W)=>K.map((B,q)=>EU.jsx("div",{className:"rounded-[2px]",style:{width:Q,height:Q,background:ea(B),boxShadow:Y?`0 0 ${(Q*(0.4+B)).toFixed(1)}px rgba(23, 23, 23, ${(B*0.35).toFixed(3)})`:void 0}},`${W}-${q}`)))})}var U$=P(v(),1);var Iz=P(v(),1);var bj=()=>({emit($,...Z){for(let J=this.events[$]||[],Q=0,X=J.length;Q<X;Q++)J[Q](...Z)},events:{},on($,Z){return(this.events[$]||=[]).push(Z),()=>{this.events[$]=this.events[$]?.filter((J)=>Z!==J)}}});function IU($){return $==="agent"||$==="widgets"||$==="scratchpad"||typeof $==="string"&&(/^view:[^/]+$/.test($)||/^view-builder:[^/]+$/.test($))}function $Q($){return IU($)?$:null}function yj($,Z){return`/workspace/${$}/${Z}`}var RU=($)=>`view:${$}`,N6=($)=>$.startsWith("view:")?$.slice(5):null,ZQ=($)=>`view-builder:${$}`,g3=($)=>$.startsWith("view-builder:")?$.slice(13):null;function B$($){return typeof $==="object"&&$!==null&&!Array.isArray($)}function xj($){if(!B$($))return{};let Z=$.appletParams;return B$(Z)?Z:{}}var kU=2000;var $n=({kind:$,name:Z})=>`${$}:${Z}`,hj=1000,SU={cooldownMs:2000,windowMs:60000,maxPerWindow:10,maxKeys:64};function Zn($){let Z=bj(),J=cH(SU),Q=(H,G)=>{Q2($,{source:"runtime",kind:H.kind,name:H.name,message:G})},X=(H,G,z)=>{let Y=J.admit(`${G}\x00${z}`);if(Y==="cooldown")return Q(H,`sendChatMessage("${z}") was dropped: the same message was already sent less than ${SU.cooldownMs/1000}s ago. Call it from an event handler, not during render.`),!1;if(Y==="window")return Q(H,`sendChatMessage("${z}") was dropped: more than ${SU.maxPerWindow} messages in a minute from this workspace. Each one starts an agent run, so send only on a real user action.`),!1;return!0};return{on(H,G){return Z.on(H,G)},connect(H){let G=!0,z=$n(H);return{bridge:{focusTab(K,W){if(!G)return;if(!IU(K))return;Z.emit("focusTab",K,B$(W)?W:void 0)},sendChatMessage(K,W){if(!G)return;if(typeof K!=="string")return;let B=K.trim();if(!B)return;if(B.length>hj){Q(H,`sendChatMessage() was dropped: the message is ${B.length} characters (max ${hj}). Put long content in the context argument, not the message.`);return}if(!X(H,z,B))return;Z.emit("sendChatMessage",{message:B,source:z,...W!==void 0?{context:Jn(H,W,Q)}:{}})}},dispose:()=>{G=!1}}}}}function Jn($,Z,J){if(!B$(Z)){J($,"sendChatMessage() ignored its context argument: it must be a plain object.");return}let Q;try{Q=JSON.stringify(Z)}catch{J($,"sendChatMessage() ignored its context argument: it is not JSON-serializable (cycles, functions, or BigInt).");return}if(Q.length>kU){J($,`sendChatMessage() ignored its context argument: ${Q.length} characters serialized (max ${kU}). Send an id the agent can look up instead of the whole payload.`);return}return Z}var gj=new Map;function vj($){let Z=gj.get($);if(!Z)Z=Zn($),gj.set($,Z);return Z}function Rz($,Z,J){let Q=Iz.useRef(J);Q.current=J,Iz.useEffect(()=>{let X=(...H)=>Q.current(...H);return vj($).on(Z,X)},[$,Z])}var Ez=new Map;function fj($,Z,J,Q){let X=$.__attachBridge;if(typeof X!=="function")return;Ez.get(J)?.();let{bridge:H,dispose:G}=vj(Z).connect(Q);Ez.set(J,G),X(H)}function bU($){let Z=Ez.get($);if(!Z)return;Ez.delete($),Z()}function kz($,Z,J){return`${$}/${Z}/${J}`}var q$=new Map,JQ=new Map;function Qn($,Z,J){return q$.get(kz($,Z,J))??0}var Xn="module";function mj($,Z,J){return`/api/workspaces/${Z}/${$}/${J}/${Xn}?v=${Qn($,Z,J)}`}function Sz($,Z,J){return`/api/workspaces/${Z}/${$}/${J}`}function bz($,Z){return`${$==="widgets"?"widget":"view"}:${Z}`}function uj($){return JQ.get($)}function pj($,Z){JQ.set($,Z)}function yz($,Z,J){let Q=kz($,Z,J);JQ.delete(Q),q$.set(Q,(q$.get(Q)??0)+1),bU(Q)}function yU($){let Z=`${$}/`;for(let J of new Set([...JQ.keys(),...q$.keys()]))if(J.startsWith(Z))JQ.delete(J),q$.set(J,(q$.get(J)??0)+1),bU(J)}var Hn={kind:"widget",segment:"widgets",shouldReload:($,Z)=>$.type==="widget:updated"&&$.name===Z||$.type==="applets:refresh"&&$.only!=="views"},Gn={kind:"view",segment:"views",shouldReload:($,Z)=>$.type==="view:updated"&&$.name===Z||$.type==="applets:refresh"&&$.only!=="widgets"};function zn($,Z,J){let{segment:Q}=$,X=kz(Q,Z,J),H=uj(X);if(H)return H;let G=import(mj(Q,Z,J)).then((z)=>{if(!z.default)throw Error(`"${J}" has no default export`);return fj(z,Z,X,{kind:$.kind,name:J}),z.default});return pj(X,G),G}function cj($,Z){let J=o5(),[Q,X]=U$.useState({status:"loading",version:0}),H=U$.useCallback(()=>{X((G)=>({status:"loading",version:G.version})),zn($,J,Z).then((G)=>X((z)=>({status:"ready",Component:G,version:z.version+1}))).catch((G)=>{Q2(J,{source:"load",kind:$.kind,name:Z,message:String(G),...G instanceof Error&&G.stack?{stack:G.stack}:{}}),X((z)=>({status:"error",error:String(G),version:z.version+1}))})},[$,J,Z]);return U$.useEffect(()=>{H()},[H]),s1((G)=>{if($.shouldReload(G,Z))yz($.segment,J,Z),H()}),Q}function dj($){return cj(Hn,$)}function lj($){return cj(Gn,$)}function ij(){let $=o5();s1((Z)=>{if(Z.type==="view:updated")yz("views",$,Z.name);else if(Z.type==="widget:updated")yz("widgets",$,Z.name);else if(Z.type==="applets:refresh"){if(Z.only!=="views")yU("widgets");if(Z.only!=="widgets")yU("views")}})}var d4=P(v(),1);var Y2={staleTime:0,gcTime:300000,refetchOnMount:!0,refetchOnWindowFocus:!0};function rj($){return $1({queryKey:j0.layout($),queryFn:()=>D5(`/api/workspaces/${$}`),...Y2})}function m2($){let Z=s0();return s1((J)=>{if(J.type==="agent:updated"&&J.workspaceId===$)Z.setQueryData(j0.agent($),(Q)=>Q?{...Q,availability:J.availability,login:J.login}:Q);if(J.type==="env:updated"&&J.workspaceId===$)Z.invalidateQueries({queryKey:j0.agent($)})}),$1({queryKey:j0.agent($),queryFn:()=>D5(`/api/workspaces/${$}/agent`),staleTime:30000,refetchOnWindowFocus:!0})}function aj($){return D5(`/api/workspaces/${$}/auth/login`,{method:"POST"},"Could not start sign-in")}function nj($){return $1({queryKey:j0.skills($),queryFn:()=>D5(`/api/workspaces/${$}/skills`),...Y2})}async function Yn($){let Z=await fetch(`/api/workspaces/${$}/skills/update`,{method:"POST"}),J=await Z.text(),Q=null;try{Q=JSON.parse(J)}catch{}if(!Z.ok){let X=Q&&"error"in Q?Q.error:J,H=Error(X||"Failed to update workspace skill");if(Q?.skills)H.status={skills:Q.skills,updateAvailable:Q.updateAvailable};throw H}if(!Q)throw Error("Invalid workspace skill update response");return Q}function sj($){let Z=s0();return r5({mutationFn:()=>Yn($),onSuccess:(J)=>{Z.setQueryData(j0.skills($),J)},onError:(J)=>{if(J.status)Z.setQueryData(j0.skills($),J.status)}})}function oj($){return $1({queryKey:j0.widgets($),queryFn:async()=>{return(await D5(`/api/workspaces/${$}/widgets`)).widgets},...Y2})}function xz($){return $1({queryKey:j0.views($),queryFn:async()=>{return(await D5(`/api/workspaces/${$}/views`)).views},...Y2})}function tj($){let Z=s0();return r5({mutationFn:(J)=>L4(`/api/workspaces/${$}`,f1("PUT",J),"Failed to save layout"),onSuccess:()=>{Z.invalidateQueries({queryKey:j0.preview($)})}})}function xU(){return{open:["agent","widgets","scratchpad"],active:"agent"}}function ej(){return{version:1,widgetGrid:[],layoutMode:"split",tabs:xU()}}var QC=P(l(),1),hU=d4.createContext(null);function d5(){let $=d4.useContext(hU);if(!$)throw Error("useWorkspaceLayoutCtx must be used within <WorkspaceLayoutProvider>");return $}function ZC(){return d4.useContext(hU)?.layout.theme}function $C($){let{cwd:Z,name:J,provider:Q,agentId:X,...H}=$;return H}function JC({id:$,children:Z}){let J=s0(),Q=rj($),X=tj($),H=d4.useRef(X.mutate);H.current=X.mutate;let G=d4.useRef(null),z=d4.useCallback((K)=>{let W=j0.layout($),B=J.getQueryData(W);if(!B)return;let q={...B,...K};if(J.setQueryData(W,q),G.current)clearTimeout(G.current);G.current=setTimeout(()=>{G.current=null,H.current($C(q))},600)},[$,J]),Y=d4.useMemo(()=>({layout:Q.data?$C(Q.data):ej(),setLayout:z,name:Q.data?.name??null,icon:Q.data?.icon??null,cwd:Q.data?.cwd??null,provider:Q.data?.provider??null,workspaceId:$,isLoading:Q.isLoading}),[Q.data,Q.isLoading,z,$]);return QC.jsx(hU,{value:Y,children:Z})}var s4=P(v(),1);var GC=P(v(),1);var B9=P(l(),1),Kn="M5 11a7 7 0 0 1 14 0v7a1.78 1.78 0 0 1 -3.1 1.4a1.65 1.65 0 0 0 -2.6 0a1.65 1.65 0 0 1 -2.6 0a1.65 1.65 0 0 0 -2.6 0a1.78 1.78 0 0 1 -3.1 -1.4v-7",Wn=18.85;function V6($){return $.toFixed(3)}function Bn($){let Z="";for(let J=0;J<$.length-1;J+=1){let Q=$[J-1]??$[J],X=$[J],H=$[J+1],G=$[J+2]??H,z=J===0?{x:X.x,y:X.y+0.4}:{x:X.x+(H.x-Q.x)/6,y:X.y+(H.y-Q.y)/6},Y=J===$.length-2?{x:H.x,y:H.y+0.4}:{x:H.x-(G.x-X.x)/6,y:H.y-(G.y-X.y)/6};Z+=`C${V6(z.x)} ${V6(z.y)} ${V6(Y.x)} ${V6(Y.y)} ${V6(H.x)} ${V6(H.y)}`}return Z}function qn($){let Z=$*Math.PI*2,Q=(1-Math.abs($*2-1))*1.55,X=Wn+Q,H=Array.from({length:13},(z,Y)=>{let K=Y/12,W=Math.sin(Math.PI*K)**0.35,B=X+0.3*W,q=0.55*W*Math.sin(5*Math.PI*K-Z);return{x:5+14*K,y:B+q}}),G=X-11;return`M5 11a7 7 0 0 1 14 0v${V6(G)}${Bn(H.reverse())}v-${V6(G)}`}var XC=Array.from({length:17},($,Z)=>qn(Z/16)),q9=GC.forwardRef(function({animated:Z=!1,color:J="currentColor",size:Q=24,stroke:X=2,title:H,className:G,children:z,...Y},K){let W=HC(),B=Z&&!W;return B9.jsxs("svg",{ref:K,xmlns:"http://www.w3.org/2000/svg",width:Q,height:Q,viewBox:"0 0 24 24",fill:"none",stroke:J,strokeWidth:X,strokeLinecap:"round",strokeLinejoin:"round",className:e("tabler-icon tabler-icon-ghost",G),...Y,children:[H&&B9.jsx("title",{children:H}),B?B9.jsx(h5.path,{d:XC[0],animate:{d:XC},transition:{duration:2,ease:"linear",repeat:1/0}}):B9.jsx("path",{d:Kn}),B9.jsx("path",{d:"M10 10l.01 0"}),B9.jsx("path",{d:"M14 10l.01 0"}),B9.jsx("path",{d:"M10 14a3.5 3.5 0 0 0 4 0"}),z]})});q9.displayName=F$.displayName;var P4=P(v(),1);var zC=P(l(),1);function K2({className:$,...Z}){return zC.jsx(A1,{"data-slot":"spinner",role:"status","aria-label":"Loading",className:e("size-4 animate-spin",$),stroke:1.75,...Z})}var l4=P(l(),1);function gU($){if(!$)return;$.focus();let Z=$.value.length;$.setSelectionRange(Z,Z)}function hz({composerRef:$,className:Z,onMouseDown:J,children:Q,...X}){return l4.jsx("form",{...X,onMouseDown:(H)=>{if(J?.(H),H.defaultPrevented)return;if(H.target instanceof Element&&H.target.closest('button, input, textarea, select, a, [contenteditable="true"]'))return;gU($.current)},className:e("group/composer flex w-full cursor-text flex-col gap-1 rounded-xl bg-card p-2 text-card-foreground shadow-xs transition-[color,box-shadow] outline-none focus-within:shadow-sm",Z),children:Q})}function gz({textareaRef:$,className:Z,...J}){return l4.jsx("textarea",{...J,ref:$,className:e("field-sizing-content max-h-40 w-full resize-none bg-transparent px-2 py-1 text-sm leading-relaxed outline-none placeholder:text-muted-foreground disabled:opacity-50",Z)})}function vz({className:$,children:Z,...J}){return l4.jsx("div",{...J,className:e("flex items-center justify-end gap-3",$),children:Z})}function Un($){if($.status==="checking")return"Checking agent status…";return}function v3($,Z,J){return $&&!Z&&J.status==="available"}function fz({label:$,hasContent:Z,busy:J=!1,loading:Q=!1,availability:X}){let H=v3(Z,J||Q,X),G=Un(X),z=l4.jsx(E0,{type:"submit",size:"icon",disabled:!H,"aria-label":$,children:Q?l4.jsx(K2,{}):l4.jsx(YC,{stroke:1.5})});if(Q||!G)return z;return l4.jsxs(r1,{children:[l4.jsx(a1,{render:l4.jsx("span",{className:"inline-flex",children:z})}),l4.jsx(n1,{className:"max-w-64 text-center",children:G})]})}var _4=P(v(),1),Fn=48;function KC($,Z){let J=_4.useRef(!0),[Q,X]=_4.useState(!0),H=_4.useCallback((Y)=>{J.current=Y,X((K)=>K===Y?K:Y)},[]),G=_4.useCallback((Y="auto")=>{let K=$.current;if(!K)return;H(!0),K.scrollTo({top:K.scrollHeight,behavior:Y})},[$,H]),z=_4.useCallback(()=>{let Y=$.current;if(!Y)return;H(!1),Y.scrollTo({top:0,behavior:"auto"})},[$,H]);return _4.useEffect(()=>{let Y=$.current;if(!Y)return;let K=()=>{let W=Y.scrollHeight-Y.scrollTop-Y.clientHeight;H(W<=Fn)};return Y.addEventListener("scroll",K,{passive:!0}),()=>Y.removeEventListener("scroll",K)},[$,H]),_4.useEffect(()=>{let Y=$.current;if(!Y)return;let K=Y.firstElementChild??Y,W=new ResizeObserver(()=>{if(J.current)Y.scrollTop=Y.scrollHeight});return W.observe(K),()=>W.disconnect()},[$]),_4.useLayoutEffect(()=>{G("auto")},[Z,G]),{atBottom:Q,scrollToBottom:G,scrollToTop:z}}function Nn($){return $.origin.kind!=="replay"&&$.origin.kind!=="synthetic"&&$.origin.kind!=="subagent-prompt"}function Vn($,Z){let J=$.meta||Z.meta?{...$.meta,...Z.meta}:void 0;return{...$,parts:[...$.parts,...Z.parts],timestamp:Z.timestamp??$.timestamp,meta:J}}function WC($){let Z=[];for(let J of $){if(!Nn(J))continue;if(J.role!=="assistant"){Z.push(J);continue}let Q=Z.length>0?Z[Z.length-1]:null;if(Q?.role==="assistant")Z[Z.length-1]=Vn(Q,J);else Z.push(J)}return Z.map((J,Q)=>{let X=Z[Q-1];if(J.role!=="assistant"||X?.role!=="user"||X.origin.kind!=="user-input"||!X.timestamp||!J.timestamp)return J;let H=Date.parse(X.timestamp),G=Date.parse(J.timestamp);if(!Number.isFinite(H)||!Number.isFinite(G)||G<H)return J;return{...J,meta:{...J.meta,durationMs:G-H}}})}function vU($){switch($.kind){case"compact":return"Context compacted";case"model-change":return $.prev?`Model changed to ${$.model} (was ${$.prev})`:`Model changed to ${$.model}`;case"rate-limit":case"api-retry":case"hook":case"session-state":case"files-persisted":case"elicitation":default:return null}}function BC($){if(!$)return;let Z=Date.parse($);return Number.isNaN(Z)?void 0:Z}function qC($,Z){let J=Z.filter((Y)=>vU(Y)!==null);if(J.length===0)return $.map((Y)=>({kind:"turn",turn:Y}));let Q=[],X=[];for(let Y of J){let K=BC(Y.at);if(K===void 0)X.push(Y);else Q.push({notice:Y,time:K})}Q.sort((Y,K)=>Y.time-K.time);let H=[],G=0,z=Number.NEGATIVE_INFINITY;for(let Y of $){z=Math.max(z,BC(Y.timestamp)??z);while(G<Q.length&&Q[G].time<=z)H.push({kind:"notice",notice:Q[G].notice}),G+=1;H.push({kind:"turn",turn:Y})}for(;G<Q.length;G+=1)H.push({kind:"notice",notice:Q[G].notice});for(let Y of X)H.push({kind:"notice",notice:Y});return H}var mY=P(v(),1);async function UC($,Z){let J=new FormData;for(let X of Z)J.append("files",X);let Q=await fetch(`/api/workspaces/${$}/uploads`,{method:"POST",body:J});if(!Q.ok){let X=await Q.text().catch(()=>"");throw Error(X||`Upload failed (${Q.status})`)}return Q.json()}var k$=P(v(),1);function mz($){return $1({queryKey:j0.sessions($),queryFn:()=>D5(`/api/workspaces/${$}/sessions`),...Y2})}function Ln($,Z){return $?.filter((J)=>J.sessionId!==Z)}function FC($){let Z=s0();return r5({mutationFn:(J)=>L4(`/api/workspaces/${$}/sessions/${J}/archive`,{method:"POST"},"Couldn’t archive chat"),onSuccess:(J,Q)=>{Z.setQueryData(j0.sessions($),(X)=>Ln(X,Q)),Z.removeQueries({queryKey:j0.events($,Q)}),Z.removeQueries({queryKey:j0.sessionConfig($,Q)}),Z.invalidateQueries({queryKey:j0.preview($)})}})}function NC($,Z){return $1({queryKey:j0.events($,Z??""),queryFn:async()=>{let J=await fetch(`/api/workspaces/${$}/sessions/${Z}/events`),Q=J.ok?await J.json():[];return T_(Q)},enabled:Boolean(Z),staleTime:1/0,gcTime:300000,refetchOnMount:!1,refetchOnWindowFocus:!1})}function uz($,Z){return $1({queryKey:j0.sessionConfig($,Z??""),queryFn:()=>D5(`/api/workspaces/${$}/sessions/${Z}/config`),enabled:Boolean(Z),staleTime:1/0,gcTime:300000,refetchOnMount:!1,refetchOnWindowFocus:!1})}function VC($){let Z=s0();return r5({mutationFn:({patch:J,sessionId:Q})=>D5(`/api/workspaces/${$}/sessions/${Q}/config`,f1("PUT",J),"Failed to save chat settings"),onSuccess:(J,{sessionId:Q})=>{Z.setQueryData(j0.sessionConfig($,Q),J)}})}var Mn=["fable","opus","sonnet","haiku"];function LC($){let Z=$.resolvedModel??$.value,J=Mn.findIndex((Q)=>Z===Q||Z.startsWith(`${Q}[`)||Z.includes(`-${Q}-`));return J===-1?void 0:J}function An($,Z){if($===void 0&&Z===void 0)return 0;if($===void 0)return-1;if(Z===void 0)return 1;return $-Z}function Dn($,Z){return An(LC($),LC(Z))}var _n={"claude-code":Dn};function On($,Z){return $.map((J,Q)=>({model:J,index:Q})).sort((J,Q)=>Z(J.model,Q.model)||J.index-Q.index).map(({model:J})=>J)}function fU($,Z,J){if(Z&&$.includes(Z))return Z;if(J&&$.includes(J))return J;if($.includes("high"))return"high";return $[$.length-1]}function MC($,Z,J){let Q=fU($,Z,J);return Q?$.indexOf(Q):-1}function AC($){return $.length>1}function DC($,Z){if($.supportsFastMode!==!0)return!1;return Z??$.defaultFastMode??!1}function _C($,Z){let J=_n[Z];return J?On($,J):$}var p8={};S4(p8,{createHandle:()=>qT,Trigger:()=>YT,SubmenuTrigger:()=>BT,SubmenuRoot:()=>QT,Separator:()=>WT,Root:()=>WY,RadioItemIndicator:()=>$T,RadioItem:()=>eC,RadioGroup:()=>sC,Positioner:()=>rC,Portal:()=>dC,Popup:()=>uC,LinkItem:()=>fC,Item:()=>vC,Handle:()=>VY,GroupLabel:()=>hC,Group:()=>yC,CheckboxItemIndicator:()=>kC,CheckboxItem:()=>RC,Backdrop:()=>jC,Arrow:()=>PC});var OC=P(v(),1);var pz=P(v(),1),mU=pz.createContext(void 0);function J4($){let Z=pz.useContext(mU);if(Z===void 0&&!$)throw Error(I0(33));return Z}var cz=P(v(),1),uU=cz.createContext(void 0);function a5($){let Z=cz.useContext(uU);if(Z===void 0&&!$)throw Error(I0(36));return Z}var PC=OC.forwardRef(function(Z,J){let{className:Q,render:X,...H}=Z,{store:G}=a5(),{arrowRef:z,side:Y,align:K,arrowUncentered:W,arrowStyles:B}=J4(),U={open:G.useState("open"),side:Y,align:K,uncentered:W};return U0("div",Z,{ref:[z,J],stateAttributesMapping:x5,state:U,props:{style:B,"aria-hidden":!0,...H}})});var wC=P(v(),1);var dz=P(v(),1),Pn=dz.createContext(void 0);function u2($=!0){let Z=dz.useContext(Pn);if(Z===void 0&&!$)throw Error(I0(25));return Z}var wn={...x5,...s5},jC=wC.forwardRef(function(Z,J){let{className:Q,render:X,...H}=Z,{store:G}=a5(),z=G.useState("open"),Y=G.useState("mounted"),K=G.useState("transitionStatus"),W=G.useState("lastOpenChangeReason"),B=u2(),q={open:z,transitionStatus:K};return U0("div",Z,{ref:B?.backdropRef?[J,B.backdropRef]:J,state:q,stateAttributesMapping:wn,props:[{role:"presentation",hidden:!Y,style:{pointerEvents:W===q0.triggerHover?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},H]})});var az=P(v(),1);var lz=P(v(),1),pU=lz.createContext(void 0);function CC(){let $=lz.useContext(pU);if($===void 0)throw Error(I0(30));return $}var N$=P(v(),1);var TC=P(v(),1);function iz($){let{closeOnClick:Z,highlighted:J,id:Q,nodeId:X,store:H,itemRef:G,itemMetadata:z}=$,{events:Y}=H.useState("floatingTreeRoot"),K=u2(!0),W=K!==void 0;return TC.useMemo(()=>({id:Q,role:"menuitem",tabIndex:J?0:-1,onMouseMove(B){if(!X)return;Y.emit("itemhover",{nodeId:X,target:B.currentTarget})},onClick(B){if(Z)Y.emit("close",{domEvent:B,reason:q0.itemPress})},onMouseUp(B){if(K){let q=K.initialCursorPointRef.current;if(K.initialCursorPointRef.current=null,W&&q&&Math.abs(B.clientX-q.x)<=1&&Math.abs(B.clientY-q.y)<=1)return}if(G.current&&H.context.allowMouseUpTriggerRef.current&&(!W||B.button===2)){if(!z||z.type==="regular-item")G.current.click()}}}),[Z,J,Q,Y,X,H,G,K,W,z])}var V$={type:"regular-item"};function L6($){let{closeOnClick:Z,disabled:J=!1,highlighted:Q,id:X,store:H,nativeButton:G,itemMetadata:z,nodeId:Y}=$,K=N$.useRef(null),{getButtonProps:W,buttonRef:B}=S1({disabled:J,focusableWhenDisabled:!0,native:G}),q=iz({closeOnClick:Z,highlighted:Q,id:X,nodeId:Y,store:H,itemRef:K,itemMetadata:z}),U=N$.useCallback((N)=>{return t8(q,{onMouseEnter(){if(z.type!=="submenu-trigger")return;z.setActive()},onKeyUp(L){if(L.key===" "&&H.context.typingRef.current)L.preventBaseUIHandler()}},N,W)},[q,W,H,z]),F=q4(K,B);return N$.useMemo(()=>({getItemProps:U,itemRef:F}),[U,F])}var U9=P(v(),1);var rz=P(v(),1),cU=rz.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>{return()=>{}},elementsRef:{current:[]},nextIndexRef:{current:0}});function EC(){return rz.useContext(cU)}var jn=function($){return $[$.None=0]="None",$[$.GuessFromOrder=1]="GuessFromOrder",$}({});function Q4($={}){let{label:Z,metadata:J,textRef:Q,indexGuessBehavior:X,index:H}=$,{register:G,unregister:z,subscribeMapChange:Y,elementsRef:K,labelsRef:W,nextIndexRef:B}=EC(),q=U9.useRef(-1),[U,F]=U9.useState(H??(X===jn.GuessFromOrder?()=>{if(q.current===-1){let V=B.current;B.current+=1,q.current=V}return q.current}:-1)),N=U9.useRef(null),L=U9.useCallback((V)=>{if(N.current=V,U!==-1&&V!==null){if(K.current[U]=V,W){let M=Z!==void 0;W.current[U]=M?Z:Q?.current?.textContent??V.textContent}}},[U,K,W,Z,Q]);return W0(()=>{if(H!=null)return;let V=N.current;if(V)return G(V,J),()=>{z(V)};return},[H,G,z,J]),W0(()=>{if(H!=null)return;return Y((V)=>{let M=N.current?V.get(N.current)?.index:null;if(M!=null)F(M)})},[H,Y,F]),U9.useMemo(()=>({ref:L,index:U}),[U,L])}var dU=function($){return $.checked="data-checked",$.unchecked="data-unchecked",$.disabled="data-disabled",$.highlighted="data-highlighted",$}({});var M6={checked($){if($)return{[dU.checked]:""};return{[dU.unchecked]:""}},...s5};var IC=P(l(),1),RC=az.forwardRef(function(Z,J){let{render:Q,className:X,id:H,label:G,nativeButton:z=!1,disabled:Y=!1,closeOnClick:K=!1,checked:W,defaultChecked:B,onCheckedChange:q,...U}=Z,F=Q4({label:G}),N=J4(!0),L=e0(H),{store:V}=a5(),M=V.useState("isActive",F.index),A=V.useState("itemProps"),[O,_]=f4({controlled:W,default:B??!1,name:"MenuCheckboxItem",state:"checked"}),{getItemProps:D,itemRef:T}=L6({closeOnClick:K,disabled:Y,highlighted:M,id:L,store:V,nativeButton:z,nodeId:N?.nodeId,itemMetadata:V$}),k=az.useMemo(()=>({disabled:Y,highlighted:M,checked:O}),[Y,M,O]),x=K0((y)=>{let C={...O0(q0.itemPress,y.nativeEvent),preventUnmountOnClose:()=>{}};if(q?.(!O,C),C.isCanceled)return;_((j)=>!j)}),I=U0("div",Z,{state:k,stateAttributesMapping:M6,props:[A,{role:"menuitemcheckbox","aria-checked":O,onClick:x},U,D],ref:[T,J,F.ref]});return IC.jsx(pU.Provider,{value:k,children:I})});var nz=P(v(),1);var kC=nz.forwardRef(function(Z,J){let{render:Q,className:X,keepMounted:H=!1,...G}=Z,z=CC(),Y=nz.useRef(null),{transitionStatus:K,setMounted:W}=y4(z.checked);v1({open:z.checked,ref:Y,onComplete(){if(!z.checked)W(!1)}});let B={checked:z.checked,disabled:z.disabled,highlighted:z.highlighted,transitionStatus:K};return U0("span",Z,{state:B,ref:[J,Y],stateAttributesMapping:M6,props:{"aria-hidden":!0,...G},enabled:H||z.checked})});var L$=P(v(),1);var sz=P(v(),1),lU=sz.createContext(void 0);function SC(){let $=sz.useContext(lU);if($===void 0)throw Error(I0(31));return $}var bC=P(l(),1),yC=L$.forwardRef(function(Z,J){let{render:Q,className:X,...H}=Z,[G,z]=L$.useState(void 0),Y=L$.useMemo(()=>({setLabelId:z}),[z]),K=U0("div",Z,{ref:J,props:{role:"group","aria-labelledby":G,...H}});return bC.jsx(lU.Provider,{value:Y,children:K})});var xC=P(v(),1);var hC=xC.forwardRef(function(Z,J){let{className:Q,render:X,id:H,...G}=Z,z=e0(H),{setLabelId:Y}=SC();return W0(()=>{return Y(z),()=>{Y(void 0)}},[Y,z]),U0("div",Z,{ref:J,props:{id:z,role:"presentation",...G}})});var gC=P(v(),1);var vC=gC.forwardRef(function(Z,J){let{render:Q,className:X,id:H,label:G,nativeButton:z=!1,disabled:Y=!1,closeOnClick:K=!0,...W}=Z,B=Q4({label:G}),q=J4(!0),U=e0(H),{store:F}=a5(),N=F.useState("isActive",B.index),L=F.useState("itemProps"),{getItemProps:V,itemRef:M}=L6({closeOnClick:K,disabled:Y,highlighted:N,id:U,store:F,nativeButton:z,nodeId:q?.nodeId,itemMetadata:V$});return U0("div",Z,{state:{disabled:Y,highlighted:N},props:[L,W,V],ref:[M,J,B.ref]})});var M$=P(v(),1);var fC=M$.forwardRef(function(Z,J){let{render:Q,className:X,id:H,label:G,closeOnClick:z=!1,...Y}=Z,K=M$.useRef(null),W=Q4({label:G}),q=J4(!0)?.nodeId,U=e0(H),{store:F}=a5(),N=F.useState("isActive",W.index),L=F.useState("itemProps"),V=iz({closeOnClick:z,highlighted:N,id:U,nodeId:q,store:F,itemRef:K}),M=M$.useMemo(()=>({highlighted:N}),[N]);return U0("a",Z,{state:M,props:[L,Y,V],ref:[K,J,W.ref]})});var ez=P(v(),1);var oz=P(v(),1),Cn=oz.createContext(void 0);function tz($){let Z=oz.useContext(Cn);if(Z===void 0&&!$)throw Error(I0(69));return Z}var mC=P(l(),1),Tn={...x5,...s5},uC=ez.forwardRef(function(Z,J){let{render:Q,className:X,finalFocus:H,...G}=Z,{store:z}=a5(),{side:Y,align:K}=J4(),W=tz(!0)!=null,B=z.useState("open"),q=z.useState("transitionStatus"),U=z.useState("popupProps"),F=z.useState("mounted"),N=z.useState("instantType"),L=z.useState("activeTriggerElement"),V=z.useState("parent"),M=z.useState("lastOpenChangeReason"),A=z.useState("rootId"),O=z.useState("floatingRootContext"),_=z.useState("floatingTreeRoot"),D=z.useState("closeDelay"),T=z.useState("activeTriggerElement"),k=V.type==="context-menu";v1({open:B,ref:z.context.popupRef,onComplete(){if(B)z.context.onOpenChangeComplete?.(!0)}}),ez.useEffect(()=>{function R(S){z.setOpen(!1,O0(S.reason,S.domEvent))}return _.events.on("close",R),()=>{_.events.off("close",R)}},[_.events,z]);let x=z.useState("hoverEnabled"),I=z.useState("disabled");W3(O,{enabled:x&&!I&&!k&&V.type!=="menubar",closeDelay:D});let y={transitionStatus:q,side:Y,align:K,open:B,nested:V.type==="menu",instant:N},C=U0("div",Z,{state:y,ref:[J,z.context.popupRef],stateAttributesMapping:Tn,props:[U,{onKeyDown(R){if(W&&o9.has(R.key))R.stopPropagation()}},o8(q),G,{"data-rootownerid":A}]}),j=V.type===void 0||k;if(L||V.type==="menubar"&&M!==q0.outsidePress)j=!0;return mC.jsx(Y3,{context:O,modal:k,disabled:!F,returnFocus:H===void 0?j:H,initialFocus:V.type!=="menu",restoreFocus:!0,externalTree:V.type!=="menubar"?_:void 0,previousFocusableElement:T,nextFocusableElement:V.type===void 0?z.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:V.type===void 0?z.context.beforeContentFocusGuardRef:void 0,children:C})});var cC=P(v(),1);var $Y=P(v(),1),iU=$Y.createContext(void 0);function pC(){let $=$Y.useContext(iU);if($===void 0)throw Error(I0(32));return $}var rU=P(l(),1),dC=cC.forwardRef(function(Z,J){let{keepMounted:Q=!1,...X}=Z,{store:H}=a5();if(!(H.useState("mounted")||Q))return null;return rU.jsx(iU.Provider,{value:Q,children:rU.jsx(z3,{ref:J,...X})})});var p2=P(v(),1);var A6=P(v(),1);var lC=P(l(),1);function ZY($){let{children:Z,elementsRef:J,labelsRef:Q,onMapChange:X}=$,H=K0(X),G=A6.useRef(0),z=P5(In).current,Y=P5(En).current,[K,W]=A6.useState(0),B=A6.useRef(K),q=K0((V,M)=>{Y.set(V,M??null),B.current+=1,W(B.current)}),U=K0((V)=>{Y.delete(V),B.current+=1,W(B.current)}),F=A6.useMemo(()=>{kn(K);let V=new Map;return Array.from(Y.keys()).filter((A)=>A.isConnected).sort(Rn).forEach((A,O)=>{let _=Y.get(A)??{};V.set(A,{..._,index:O})}),V},[Y,K]);W0(()=>{if(typeof MutationObserver!=="function"||F.size===0)return;let V=new MutationObserver((M)=>{let A=new Set,O=(_)=>A.has(_)?A.delete(_):A.add(_);if(M.forEach((_)=>{_.removedNodes.forEach(O),_.addedNodes.forEach(O)}),A.size===0)B.current+=1,W(B.current)});return F.forEach((M,A)=>{if(A.parentElement)V.observe(A.parentElement,{childList:!0})}),()=>{V.disconnect()}},[F]),W0(()=>{if(B.current===K){if(J.current.length!==F.size)J.current.length=F.size;if(Q&&Q.current.length!==F.size)Q.current.length=F.size;G.current=F.size}H(F)},[H,F,J,Q,K]),W0(()=>{return()=>{J.current=[]}},[J]),W0(()=>{return()=>{if(Q)Q.current=[]}},[Q]);let N=K0((V)=>{return z.add(V),()=>{z.delete(V)}});W0(()=>{z.forEach((V)=>V(F))},[z,F]);let L=A6.useMemo(()=>({register:q,unregister:U,subscribeMapChange:N,elementsRef:J,labelsRef:Q,nextIndexRef:G}),[q,U,N,J,Q,G]);return lC.jsx(cU.Provider,{value:L,children:Z})}function En(){return new Map}function In(){return new Set}function Rn($,Z){let J=$.compareDocumentPosition(Z);if(J&Node.DOCUMENT_POSITION_FOLLOWING||J&Node.DOCUMENT_POSITION_CONTAINED_BY)return-1;if(J&Node.DOCUMENT_POSITION_PRECEDING||J&Node.DOCUMENT_POSITION_CONTAINS)return 1;return 0}function kn($){}var A$=P(l(),1),rC=p2.forwardRef(function(Z,J){let{anchor:Q,positionMethod:X="absolute",className:H,render:G,side:z,align:Y,sideOffset:K=0,alignOffset:W=0,collisionBoundary:B="clipping-ancestors",collisionPadding:q=5,arrowPadding:U=5,sticky:F=!1,disableAnchorTracking:N=!1,collisionAvoidance:L=iC,...V}=Z,{store:M}=a5(),A=pC(),O=u2(!0),_=M.useState("parent"),D=M.useState("floatingRootContext"),T=M.useState("floatingTreeRoot"),k=M.useState("mounted"),x=M.useState("open"),I=M.useState("modal"),y=M.useState("activeTriggerElement"),C=M.useState("transitionStatus"),j=M.useState("lastOpenChangeReason"),R=M.useState("floatingNodeId"),S=M.useState("floatingParentNodeId"),E=Q,b=K,g=W,u=Y,w=L;if(_.type==="context-menu"){if(E=Q??_.context?.anchor,u=u??"start",!z&&u!=="center")g=Z.alignOffset??2,b=Z.sideOffset??-5}let s=z,z0=u;if(_.type==="menu")s=s??"inline-end",z0=z0??"start",w=Z.collisionAvoidance??r9;else if(_.type==="menubar")s=s??"bottom",z0=z0??"start";let h=_.type==="context-menu",t=d9({anchor:E,floatingRootContext:D,positionMethod:O?"fixed":X,mounted:k,side:s,sideOffset:b,align:z0,alignOffset:g,arrowPadding:h?0:U,collisionBoundary:B,collisionPadding:q,sticky:F,nodeId:R,keepMounted:A,disableAnchorTracking:N,collisionAvoidance:w,shiftCrossAxis:h&&!(("side"in w)&&w.side==="flip"),externalTree:T}),M0=p2.useMemo(()=>{let N0={};if(!x)N0.pointerEvents="none";return{role:"presentation",hidden:!k,style:{...t.positionerStyles,...N0}}},[x,k,t.positionerStyles]);p2.useEffect(()=>{function N0(c){if(c.open){if(c.parentNodeId===R)M.set("hoverEnabled",!1);if(c.nodeId!==R&&c.parentNodeId===M.select("floatingParentNodeId"))M.setOpen(!1,O0(q0.siblingOpen))}}return T.events.on("menuopenchange",N0),()=>{T.events.off("menuopenchange",N0)}},[M,T.events,R]),p2.useEffect(()=>{if(M.select("floatingParentNodeId")==null)return;function N0(c){if(c.open||c.nodeId!==M.select("floatingParentNodeId"))return;let Z0=c.reason??q0.siblingOpen;M.setOpen(!1,O0(Z0))}return T.events.on("menuopenchange",N0),()=>{T.events.off("menuopenchange",N0)}},[T.events,M]),p2.useEffect(()=>{function N0(c){if(!x||c.nodeId!==M.select("floatingParentNodeId"))return;if(c.target&&y&&y!==c.target)M.setOpen(!1,O0(q0.siblingOpen))}return T.events.on("itemhover",N0),()=>{T.events.off("itemhover",N0)}},[T.events,x,y,M]),p2.useEffect(()=>{let N0={open:x,nodeId:R,parentNodeId:S,reason:M.select("lastOpenChangeReason")};T.events.emit("menuopenchange",N0)},[T.events,x,M,R,S]);let d={open:x,side:t.side,align:t.align,anchorHidden:t.anchorHidden,nested:_.type==="menu"},Y0=p2.useMemo(()=>({side:t.side,align:t.align,arrowRef:t.arrowRef,arrowUncentered:t.arrowUncentered,arrowStyles:t.arrowStyles,nodeId:t.context.nodeId}),[t.side,t.align,t.arrowRef,t.arrowUncentered,t.arrowStyles,t.context.nodeId]),B0=U0("div",Z,{state:d,stateAttributesMapping:x5,ref:[J,M.useStateSetter("positionerElement")],props:[M0,o8(C),V]}),J0=k&&_.type!=="menu"&&(_.type!=="menubar"&&I&&j!==q0.triggerHover||_.type==="menubar"&&_.context.modal),H0=null;if(_.type==="menubar")H0=_.context.contentElement;else if(_.type===void 0)H0=y;return A$.jsxs(mU.Provider,{value:Y0,children:[J0&&A$.jsx(v7,{ref:_.type==="context-menu"||_.type==="nested-context-menu"?_.context.internalBackdropRef:null,inert:j2(!x),cutout:H0}),A$.jsx(pZ,{id:R,children:A$.jsx(ZY,{elementsRef:M.context.itemDomElements,labelsRef:M.context.itemLabels,children:B0})})]})});var D$=P(v(),1);var JY=P(v(),1),aU=JY.createContext(void 0);function aC(){let $=JY.useContext(aU);if($===void 0)throw Error(I0(34));return $}var nC=P(l(),1),sC=D$.memo(D$.forwardRef(function(Z,J){let{render:Q,className:X,value:H,defaultValue:G,onValueChange:z,disabled:Y=!1,...K}=Z,[W,B]=f4({controlled:H,default:G,name:"MenuRadioGroup"}),q=K0(z),U=K0((V,M)=>{if(q?.(V,M),M.isCanceled)return;B(V)}),N=U0("div",Z,{state:{disabled:Y},ref:J,props:{role:"group","aria-disabled":Y||void 0,...K}}),L=D$.useMemo(()=>({value:W,setValue:U,disabled:Y}),[W,U,Y]);return nC.jsx(aU.Provider,{value:L,children:N})}));var XY=P(v(),1);var QY=P(v(),1),nU=QY.createContext(void 0);function oC(){let $=QY.useContext(nU);if($===void 0)throw Error(I0(35));return $}var tC=P(l(),1),eC=XY.forwardRef(function(Z,J){let{render:Q,className:X,id:H,label:G,nativeButton:z=!1,disabled:Y=!1,closeOnClick:K=!1,value:W,...B}=Z,q=Q4({label:G}),U=J4(!0),F=e0(H),{store:N}=a5(),L=N.useState("isActive",q.index),V=N.useState("itemProps"),{value:M,setValue:A,disabled:O}=aC(),_=O||Y,D=M===W,{getItemProps:T,itemRef:k}=L6({closeOnClick:K,disabled:_,highlighted:L,id:F,store:N,nativeButton:z,nodeId:U?.nodeId,itemMetadata:V$}),x=XY.useMemo(()=>({disabled:_,highlighted:L,checked:D}),[_,L,D]),I=K0((C)=>{let j={...O0(q0.itemPress,C.nativeEvent),preventUnmountOnClose:()=>{}};A(W,j)}),y=U0("div",Z,{state:x,stateAttributesMapping:M6,props:[V,{role:"menuitemradio","aria-checked":D,onClick:I},B,T],ref:[k,J,q.ref]});return tC.jsx(nU.Provider,{value:x,children:y})});var HY=P(v(),1);var $T=HY.forwardRef(function(Z,J){let{render:Q,className:X,keepMounted:H=!1,...G}=Z,z=oC(),Y=HY.useRef(null),{transitionStatus:K,setMounted:W}=y4(z.checked);v1({open:z.checked,ref:Y,onComplete(){if(!z.checked)W(!1)}});let B={checked:z.checked,disabled:z.disabled,highlighted:z.highlighted,transitionStatus:K};return U0("span",Z,{state:B,stateAttributesMapping:M6,ref:[J,Y],props:{"aria-hidden":!0,...G},enabled:H||z.checked})});var D1=P(v(),1);var GY=P(v(),1),Sn=GY.createContext(null);function zY($){let Z=GY.useContext(Sn);if(Z===null&&!$)throw Error(I0(5));return Z}var QQ=P(v(),1);var bn={...u9,disabled:C0(($)=>$.parent.type==="menubar"?$.parent.context.disabled||$.disabled:$.disabled),modal:C0(($)=>($.parent.type===void 0||$.parent.type==="context-menu")&&($.modal??!0)),allowMouseEnter:C0(($)=>$.allowMouseEnter),stickIfOpen:C0(($)=>$.stickIfOpen),parent:C0(($)=>$.parent),rootId:C0(($)=>{if($.parent.type==="menu")return $.parent.store.select("rootId");return $.parent.type!==void 0?$.parent.context.rootId:$.rootId}),activeIndex:C0(($)=>$.activeIndex),isActive:C0(($,Z)=>$.activeIndex===Z),hoverEnabled:C0(($)=>$.hoverEnabled),instantType:C0(($)=>$.instantType),lastOpenChangeReason:C0(($)=>$.openChangeReason),floatingTreeRoot:C0(($)=>{if($.parent.type==="menu")return $.parent.store.select("floatingTreeRoot");return $.floatingTreeRoot}),floatingNodeId:C0(($)=>$.floatingNodeId),floatingParentNodeId:C0(($)=>$.floatingParentNodeId),itemProps:C0(($)=>$.itemProps),closeDelay:C0(($)=>$.closeDelay),keyboardEventRelay:C0(($)=>{if($.keyboardEventRelay)return $.keyboardEventRelay;if($.parent.type==="menu")return $.parent.store.select("keyboardEventRelay");return})};class _$ extends K4{constructor($){super({...yn(),...$},{positionerRef:QQ.createRef(),popupRef:QQ.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:QQ.createRef(),beforeContentFocusGuardRef:QQ.createRef(),onOpenChangeComplete:void 0,triggerElements:new U4},bn);this.unsubscribeParentListener=this.observe("parent",(Z)=>{if(this.unsubscribeParentListener?.(),Z.type==="menu"){this.unsubscribeParentListener=Z.store.subscribe(()=>{this.notifyAll()}),this.context.allowMouseUpTriggerRef=Z.store.context.allowMouseUpTriggerRef;return}if(Z.type!==void 0)this.context.allowMouseUpTriggerRef=Z.context.allowMouseUpTriggerRef;this.unsubscribeParentListener=null})}setOpen($,Z){this.state.floatingRootContext.context.events.emit("setOpen",{open:$,eventDetails:Z})}static useStore($,Z){let J=P5(()=>{return new _$(Z)}).current;return $??J}unsubscribeParentListener=null}function yn(){return{...m9(),disabled:!1,modal:!0,allowMouseEnter:!1,stickIfOpen:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new Q3,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:_5,keyboardEventRelay:void 0,closeDelay:0}}var YY=P(v(),1),sU=YY.createContext(void 0);function KY(){return YY.useContext(sU)}var oU=P(l(),1),WY=hZ(function(Z){let{children:J,open:Q,onOpenChange:X,onOpenChangeComplete:H,defaultOpen:G=!1,disabled:z=!1,modal:Y,loopFocus:K=!0,orientation:W="vertical",actionsRef:B,closeParentOnEsc:q=!1,handle:U,triggerId:F,defaultTriggerId:N=null,highlightItemOnHover:L=!0}=Z,V=u2(!0),M=a5(!0),A=zY(!0),O=KY(),_=D1.useMemo(()=>{if(O&&M)return{type:"menu",store:M.store};if(A)return{type:"menubar",context:A};if(V&&!M)return{type:"context-menu",context:V};return{type:void 0}},[V,M,A,O]),D=_$.useStore(U?.store,{open:G,openProp:Q,activeTriggerId:N,triggerIdProp:F,parent:_});a9(()=>{if(Q===void 0&&D.state.open===!1&&G===!0)D.update({open:!0,activeTriggerId:N})}),D.useControlledProp("openProp",Q),D.useControlledProp("triggerIdProp",F),D.useContextCallback("onOpenChangeComplete",H);let T=D.useState("floatingTreeRoot"),k=X3(T),x=d1();W0(()=>{if(V&&!M)D.update({parent:{type:"context-menu",context:V},floatingNodeId:k,floatingParentNodeId:x});else if(M)D.update({floatingNodeId:k,floatingParentNodeId:x})},[V,M,k,x,D]);let I=D.useState("open"),y=D.useState("activeTriggerElement"),C=D.useState("positionerElement"),j=D.useState("hoverEnabled"),R=D.useState("modal"),S=D.useState("disabled"),E=D.useState("lastOpenChangeReason"),b=D.useState("parent"),g=D.useState("activeIndex"),u=D.useState("payload"),w=D.useState("floatingParentNodeId"),s=D1.useRef(null),z0=w!=null,h;D.useSyncedValues({disabled:z,modal:b.type===void 0?Y:void 0,rootId:J8()});let{openMethod:t,triggerProps:M0,reset:d}=u7(I);v9(D);let{forceUnmount:Y0}=f9(I,D,()=>{D.update({allowMouseEnter:!1,stickIfOpen:!0}),d()}),B0=D1.useRef(b.type!=="context-menu"),J0=q1();D1.useEffect(()=>{if(!I)s.current=null;if(b.type!=="context-menu")return;if(!I){J0.clear(),B0.current=!1;return}J0.start(500,()=>{B0.current=!0})},[J0,I,b.type]),f7(I&&R&&E!==q0.triggerHover&&t!=="touch",C),W0(()=>{if(!I&&!j)D.set("hoverEnabled",!0)},[I,j,D]);let H0=D1.useRef(!0),N0=q1(),c=K0((m0,P0)=>{let f0=P0.reason;if(I===m0&&P0.trigger===y&&E===f0)return;if(P0.preventUnmountOnClose=()=>{D.set("preventUnmountingOnClose",!0)},!m0&&P0.trigger==null)P0.trigger=y??void 0;if(X?.(m0,P0),P0.isCanceled)return;let h0={open:m0,nativeEvent:P0.event,reason:P0.reason,nested:z0};h?.emit("openchange",h0);let a0=P0.event;if(m0===!1&&a0?.type==="click"&&a0.pointerType==="touch"&&!H0.current)return;if(!m0&&g!==null){let b0=D.context.itemDomElements.current[g];queueMicrotask(()=>{b0?.setAttribute("tabindex","-1")})}if(m0&&f0===q0.triggerFocus)H0.current=!1,N0.start(300,()=>{H0.current=!0});else H0.current=!0,N0.clear();let n5=(f0===q0.triggerPress||f0===q0.itemPress)&&a0.detail===0&&a0?.isTrusted,j5=!m0&&(f0===q0.escapeKey||f0==null),R1={open:m0,openChangeReason:f0};s.current=P0.event??null;let T0=P0.trigger?.id??null;if(T0||m0)R1.activeTriggerId=T0,R1.activeTriggerElement=P0.trigger??null;if(D.update(R1),b.type==="menubar"&&(f0===q0.triggerFocus||f0===q0.focusOut||f0===q0.triggerHover||f0===q0.listNavigation||f0===q0.siblingOpen))D.set("instantType","group");else if(n5||j5)D.set("instantType",n5?"click":"dismiss");else D.set("instantType",void 0)}),Z0=D1.useCallback((m0)=>{let P0=O0(m0);return P0.preventUnmountOnClose=()=>{D.set("preventUnmountingOnClose",!0)},P0},[D]),$0=D1.useCallback(()=>{D.setOpen(!1,Z0(q0.imperativeAction))},[D,Z0]);D1.useImperativeHandle(B,()=>({unmount:Y0,close:$0}),[Y0,$0]);let G0;if(b.type==="context-menu")G0=b.context;D1.useImperativeHandle(G0?.positionerRef,()=>C,[C]),D1.useImperativeHandle(G0?.actionsRef,()=>({setOpen:c}),[c]);let r=z9({popupStore:D,onOpenChange:c});h=r.context.events,D1.useEffect(()=>{let m0=({open:P0,eventDetails:f0})=>c(P0,f0);return h.on("setOpen",m0),()=>{h?.off("setOpen",m0)}},[h,c]);let Q0=G9(r,{enabled:!S,bubbles:{escapeKey:q&&b.type==="menu"},outsidePress(){if(b.type!=="context-menu"||s.current?.type==="contextmenu")return!0;return B0.current},externalTree:z0?T:void 0}),a=U3(r,{role:"menu"}),p=x4(),o=D1.useCallback((m0)=>{if(D.select("activeIndex")===m0)return;D.set("activeIndex",m0)},[D]),n=pB(r,{enabled:!S,listRef:D.context.itemDomElements,activeIndex:g,nested:b.type!==void 0,loopFocus:K,orientation:W,parentOrientation:b.type==="menubar"?b.context.orientation:void 0,rtl:p==="rtl",disabledIndices:XQ,onNavigate:o,openOnArrowKeyDown:b.type!=="context-menu",externalTree:z0?T:void 0,focusItemOnHover:L}),V0=D1.useCallback((m0)=>{D.context.typingRef.current=m0},[D]),w0=cB(r,{listRef:D.context.itemLabels,activeIndex:g,resetMs:ZT,onMatch:(m0)=>{if(I&&m0!==g)D.set("activeIndex",m0)},onTypingChange:V0}),{getReferenceProps:v0,getFloatingProps:c0,getItemProps:m,getTriggerProps:i}=F8([Q0,a,n,w0]),f=D1.useMemo(()=>{let m0=t8(v0(),{onMouseMove(){D.set("allowMouseEnter",!0)}},M0);return delete m0.role,m0},[v0,D,M0]),X0=D1.useMemo(()=>{let m0=i();if(!m0)return m0;let P0=t8(m0,M0);return delete P0.role,delete P0["aria-controls"],P0},[i,M0]),L0=D1.useMemo(()=>c0({onMouseMove(){if(D.set("allowMouseEnter",!0),b.type==="menu")D.set("hoverEnabled",!1)},onClick(){if(D.select("hoverEnabled"))D.set("hoverEnabled",!1)},onKeyDown(m0){let P0=D.select("keyboardEventRelay");if(P0&&!m0.isPropagationStopped())P0(m0)}}),[c0,b.type,D]),k0=D1.useMemo(()=>m(),[m]);D.useSyncedValues({floatingRootContext:r,activeTriggerProps:f,inactiveTriggerProps:X0,popupProps:L0,itemProps:k0});let r0=D1.useMemo(()=>({store:D,parent:_}),[D,_]),J5=oU.jsx(uU.Provider,{value:r0,children:typeof J==="function"?J({payload:u}):J});if(b.type===void 0||b.type==="context-menu")return oU.jsx(cZ,{externalTree:T,children:J5});return J5});var JT=P(v(),1);var tU=P(l(),1);function QT($){let Z=a5().store,J=JT.useMemo(()=>({parentMenu:Z}),[Z]);return tU.jsx(sU.Provider,{value:J,children:tU.jsx(WY,{...$})})}var R8=P(v(),1),$F=P(W4(),1);function XT($){let Z=$.getBoundingClientRect(),J=window.getComputedStyle($,"::before"),Q=window.getComputedStyle($,"::after");if(!(J.content!=="none"||Q.content!=="none"))return Z;let H=parseFloat(J.width)||0,G=parseFloat(J.height)||0,z=parseFloat(Q.width)||0,Y=parseFloat(Q.height)||0,K=Math.max(Z.width,H,z),W=Math.max(Z.height,G,Y),B=K-Z.width,q=W-Z.height;return{left:Z.left-B/2,right:Z.right+B/2,top:Z.top-q/2,bottom:Z.bottom+q/2}}var qY=P(v(),1);function HT($={}){let{highlightItemOnHover:Z,highlightedIndex:J,onHighlightedIndexChange:Q}=BY(),{ref:X,index:H}=Q4($),G=J===H,z=qY.useRef(null),Y=q4(X,z);return{compositeProps:qY.useMemo(()=>({tabIndex:G?0:-1,onFocus(){Q(H)},onMouseMove(){let W=z.current;if(!Z||!W)return;let B=W.hasAttribute("disabled")||W.ariaDisabled==="true";if(!G&&!B)W.focus()}}),[G,Q,H,Z]),compositeRef:Y,index:H}}function GT($){let{render:Z,className:J,state:Q=_5,props:X=XQ,refs:H=XQ,metadata:G,stateAttributesMapping:z,tag:Y="div",...K}=$,{compositeProps:W,compositeRef:B}=HT({metadata:G});return U0(Y,$,{state:Q,ref:[...H,B],props:[W,...X,K],stateAttributesMapping:z})}function eU($){if(U1($)&&$.hasAttribute("data-rootownerid"))return $.getAttribute("data-rootownerid")??void 0;if(R7($))return;return eU(_H($))}var UY=P(v(),1);function zT($){let{enabled:Z=!0,mouseDownAction:J,open:Q}=$,X=UY.useRef(!1);return UY.useMemo(()=>{if(!Z)return _5;return{onMouseDown:(H)=>{if(J==="open"&&!Q||J==="close"&&Q)X.current=!0,g0(H.currentTarget).addEventListener("click",()=>{X.current=!1},{once:!0})},onClick:(H)=>{if(X.current)X.current=!1,H.preventBaseUIHandler()}}},[Z,J,Q])}var D6=P(l(),1),FY=2,YT=gX(function(Z,J){let{render:Q,className:X,disabled:H=!1,nativeButton:G=!0,id:z,openOnHover:Y,delay:K=100,closeDelay:W=0,handle:B,payload:q,...U}=Z,F=a5(!0),N=B?.store??F?.store;if(!N)throw Error(I0(85));let L=e0(z),V=N.useState("isTriggerActive",L),M=N.useState("floatingRootContext"),A=N.useState("isOpenedByTrigger",L),O=R8.useRef(null),_=hn(),D=BY(!0),T=j8(),k=R8.useMemo(()=>{return T??new Q3},[T]),x=X3(k),I=d1(),{registerTrigger:y,isMountedByThisTrigger:C}=g9(L,O,N,{payload:q,closeDelay:W,parent:_,floatingTreeRoot:k,floatingNodeId:x,floatingParentNodeId:I,keyboardEventRelay:D?.relayKeyboardEvent}),j=_.type==="menubar",R=N.useState("disabled"),S=H||R||j&&_.context.disabled,{getButtonProps:E,buttonRef:b}=S1({disabled:S,native:G});R8.useEffect(()=>{if(!A&&_.type===void 0)N.context.allowMouseUpTriggerRef.current=!1},[N,A,_.type]);let g=R8.useRef(null),u=q1(),w=K0((Q0)=>{if(!g.current)return;u.clear(),N.context.allowMouseUpTriggerRef.current=!1;let a=Q0.target;if(x0(g.current,a)||x0(N.select("positionerElement"),a)||a===g.current)return;if(a!=null&&eU(a)===N.select("rootId"))return;let p=XT(g.current);if(Q0.clientX>=p.left-FY&&Q0.clientX<=p.right+FY&&Q0.clientY>=p.top-FY&&Q0.clientY<=p.bottom+FY)return;k.events.emit("close",{domEvent:Q0,reason:q0.cancelOpen})});R8.useEffect(()=>{if(A&&N.select("lastOpenChangeReason")===q0.triggerHover)g0(g.current).addEventListener("mouseup",w,{once:!0})},[A,w,N]);let s=j&&_.context.hasSubmenuOpen,h=Y9(M,{enabled:(Y??s)&&!S&&_.type!=="context-menu"&&(!j||s&&!C),handleClose:K9({blockPointerEvents:!j}),mouseOnly:!0,move:!1,restMs:_.type===void 0?K:void 0,delay:{close:W},triggerElementRef:O,externalTree:k,isActiveTrigger:V}),t=xn(A,N.select("lastOpenChangeReason")),M0=H9(M,{enabled:!S&&_.type!=="context-menu",event:A&&j?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:_.type===void 0?t:!1}),d=sZ(M,{enabled:!S&&s}),Y0=zT({open:A,enabled:j,mouseDownAction:"open"}),B0=F8([M0,d]),J0={disabled:S,open:A},H0=N.useState("triggerProps",C),N0=[g,J,b,y,O],c=[B0.getReferenceProps(),h??_5,H0,{"aria-haspopup":"menu",id:L,onMouseDown:(Q0)=>{if(N.select("open"))return;u.start(200,()=>{N.context.allowMouseUpTriggerRef.current=!0}),g0(Q0.currentTarget).addEventListener("mouseup",w,{once:!0})}},j?{role:"menuitem"}:{},Y0,U,E],Z0=R8.useRef(null),$0=K0((Q0)=>{$F.flushSync(()=>{N.setOpen(!1,O0(q0.focusOut,Q0.nativeEvent,Q0.currentTarget))}),zH(Z0.current)?.focus()}),G0=K0((Q0)=>{let a=N.select("positionerElement");if(a&&e4(Q0,a))N.context.beforeContentFocusGuardRef.current?.focus();else{$F.flushSync(()=>{N.setOpen(!1,O0(q0.focusOut,Q0.nativeEvent,Q0.currentTarget))});let p=GH(N.context.triggerFocusTargetRef.current||O.current);while(p!==null&&x0(a,p)){let o=p;if(p=b9(p),p===o)break}p?.focus()}}),r=U0("button",Z,{enabled:!j,stateAttributesMapping:ZJ,state:J0,ref:N0,props:c});if(j)return D6.jsx(GT,{tag:"button",render:Q,className:X,state:J0,refs:N0,props:c,stateAttributesMapping:ZJ});if(A)return D6.jsxs(R8.Fragment,{children:[D6.jsx(P8,{ref:Z0,onFocus:$0},`${L}-pre-focus-guard`),D6.jsx(R8.Fragment,{children:r},L),D6.jsx(P8,{ref:N.context.triggerFocusTargetRef,onFocus:G0},`${L}-post-focus-guard`)]});return D6.jsx(R8.Fragment,{children:r},L)});function xn($,Z){let J=q1(),[Q,X]=R8.useState(!1);return W0(()=>{if($&&Z==="trigger-hover")X(!0),J.start(NY,()=>{X(!1)});else if(!$)J.clear(),X(!1)},[$,Z,J]),Q}function hn(){let $=u2(!0),Z=a5(!0),J=zY(!0);return R8.useMemo(()=>{if(J)return{type:"menubar",context:J};if($&&!Z)return{type:"context-menu",context:$};return{type:void 0}},[$,Z,J])}var KT=P(v(),1);var WT=KT.forwardRef(function(Z,J){let{className:Q,render:X,orientation:H="horizontal",...G}=Z;return U0("div",Z,{state:{orientation:H},ref:J,props:[{role:"separator","aria-orientation":H},G]})});var F9=P(v(),1);var BT=F9.forwardRef(function(Z,J){let{render:Q,className:X,label:H,id:G,nativeButton:z=!1,openOnHover:Y=!0,delay:K=100,closeDelay:W=0,disabled:B=!1,...q}=Z,U=Q4(),F=J4(),{store:N}=a5(),L=e0(G),V=N.useState("open"),M=N.useState("floatingRootContext"),A=N.useState("floatingTreeRoot"),O=hB(L,N),_=F9.useCallback((M0)=>{let d=O(M0);if(M0!==null&&N.select("open")&&N.select("activeTriggerId")==null)N.update({activeTriggerId:L,activeTriggerElement:M0,closeDelay:W});return d},[O,W,N,L]),D=F9.useRef(null),T=F9.useCallback((M0)=>{D.current=M0,N.set("activeTriggerElement",M0)},[N]),k=KY();if(!k?.parentMenu)throw Error(I0(37));N.useSyncedValue("closeDelay",W);let x=k.parentMenu,I=x.useState("itemProps"),y=x.useState("isActive",U.index),C=F9.useMemo(()=>({type:"submenu-trigger",setActive(){x.set("activeIndex",U.index)}}),[x,U.index]),j=N.useState("disabled"),R=B||j,{getItemProps:S,itemRef:E}=L6({closeOnClick:!1,disabled:R,highlighted:y,id:L,store:N,nativeButton:z,itemMetadata:C,nodeId:F?.nodeId}),b=N.useState("hoverEnabled"),g=x.useState("allowMouseEnter"),u=Y9(M,{enabled:b&&Y&&!R,handleClose:K9({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:K,delay:g?{open:K,close:W}:0,triggerElementRef:D,externalTree:A}),w=H9(M,{enabled:!R,event:"mousedown",toggle:!Y,ignoreMouse:Y,stickIfOpen:!1}),s=F8([w]),z0=N.useState("triggerProps",!0);return delete z0.id,U0("div",Z,{state:{disabled:R,highlighted:y,open:V},stateAttributesMapping:l9,props:[s.getReferenceProps(),u,z0,I,{tabIndex:V||y?0:-1,onBlur(){if(y)x.set("activeIndex",null)}},q,S],ref:[J,U.ref,E,_,T]})});class VY{constructor(){this.store=new _$}open($){let Z=$?this.store.context.triggerElements.getById($):void 0;if($&&!Z)throw Error(I0(83,$));this.store.setOpen(!0,O0("imperative-action",void 0,Z))}close(){this.store.setOpen(!1,O0("imperative-action",void 0,void 0))}get isOpen(){return this.store.state.open}}function qT(){return new VY}var k8=P(l(),1);function O$({...$}){return k8.jsx(p8.Root,{"data-slot":"dropdown-menu",...$})}function P$({...$}){return k8.jsx(p8.Trigger,{"data-slot":"dropdown-menu-trigger",...$})}function w$({align:$="start",alignOffset:Z=0,side:J="bottom",sideOffset:Q=4,className:X,...H}){return k8.jsx(p8.Portal,{children:k8.jsx(p8.Positioner,{className:"isolate z-50 outline-none",align:$,alignOffset:Z,side:J,sideOffset:Q,children:k8.jsx(p8.Popup,{"data-slot":"dropdown-menu-content",className:e("z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95",X),...H})})})}function j$({...$}){return k8.jsx(p8.Group,{"data-slot":"dropdown-menu-group",...$})}function MY({className:$,inset:Z,...J}){return k8.jsx(p8.GroupLabel,{"data-slot":"dropdown-menu-label","data-inset":Z,className:e("px-2 pt-1.5 pb-0.5 text-xs text-muted-foreground data-inset:pl-7",$),...J})}function HQ({className:$,inset:Z,variant:J="default",...Q}){return k8.jsx(p8.Item,{"data-slot":"dropdown-menu-item","data-inset":Z,"data-variant":J,className:e("group/dropdown-menu-item relative flex cursor-default items-center gap-2 rounded-md px-2 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",$),...Q})}function UT({...$}){return k8.jsx(p8.RadioGroup,{"data-slot":"dropdown-menu-radio-group",...$})}function FT({className:$,children:Z,inset:J,...Q}){return k8.jsxs(p8.RadioItem,{"data-slot":"dropdown-menu-radio-item","data-inset":J,className:e("relative flex cursor-default items-center gap-2 rounded-md py-1 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",$),...Q,children:[k8.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center","data-slot":"dropdown-menu-radio-item-indicator",children:k8.jsx(p8.RadioItemIndicator,{children:k8.jsx(LY,{stroke:1.75})})}),Z]})}function NT({className:$,...Z}){return k8.jsx(p8.Separator,{"data-slot":"dropdown-menu-separator",className:e("mx-2 my-1 h-px bg-border",$),...Z})}var _6={};S4(_6,{createHandle:()=>mT,Viewport:()=>fT,Trigger:()=>DT,Title:()=>ST,Root:()=>MT,Positioner:()=>wT,Portal:()=>PT,Popup:()=>CT,Handle:()=>PY,Description:()=>yT,Close:()=>hT,Backdrop:()=>RT,Arrow:()=>ET});var i4=P(v(),1);var AY=P(v(),1),ZF=AY.createContext(void 0);function C1($){let Z=AY.useContext(ZF);if(Z===void 0&&!$)throw Error(I0(47));return Z}var C$=P(v(),1),VT=P(W4(),1);function gn(){return{...m9(),disabled:!1,modal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,nested:!1,openOnHover:!1,closeDelay:0,hasViewport:!1}}var vn={...u9,disabled:C0(($)=>$.disabled),instantType:C0(($)=>$.instantType),openMethod:C0(($)=>$.openMethod),openChangeReason:C0(($)=>$.openChangeReason),modal:C0(($)=>$.modal),stickIfOpen:C0(($)=>$.stickIfOpen),titleElementId:C0(($)=>$.titleElementId),descriptionElementId:C0(($)=>$.descriptionElementId),openOnHover:C0(($)=>$.openOnHover),closeDelay:C0(($)=>$.closeDelay),hasViewport:C0(($)=>$.hasViewport)};class T$ extends K4{constructor($){let Z={...gn(),...$};if(Z.open&&$?.mounted===void 0)Z.mounted=!0;super(Z,{popupRef:C$.createRef(),backdropRef:C$.createRef(),internalBackdropRef:C$.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:C$.createRef(),beforeContentFocusGuardRef:C$.createRef(),stickIfOpenTimeout:new h1,triggerElements:new U4},vn)}setOpen=($,Z)=>{let J=Z.reason===q0.triggerHover,Q=Z.reason===q0.triggerPress&&Z.event.detail===0,X=!$&&(Z.reason===q0.escapeKey||Z.reason==null);if(Z.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.($,Z),Z.isCanceled)return;let H={open:$,nativeEvent:Z.event,reason:Z.reason,nested:this.state.nested,triggerElement:Z.trigger};this.state.floatingRootContext.context.events?.emit("openchange",H);let z=()=>{let Y={open:$,openChangeReason:Z.reason},K=Z.trigger?.id??null;if(K||$)Y.activeTriggerId=K,Y.activeTriggerElement=Z.trigger??null;this.update(Y)};if(J)this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(NY,()=>{this.set("stickIfOpen",!1)}),VT.flushSync(z);else z();if(Q||X)this.set("instantType",Q?"click":"dismiss");else if(Z.reason===q0.focusOut)this.set("instantType","focus");else this.set("instantType",void 0)};static useStore($,Z){let J=P5(()=>{return new T$(Z)}).current,Q=$??J;return _8(J.disposeEffect),Q}disposeEffect=()=>{return this.context.stickIfOpenTimeout.disposeEffect()}}var GQ=P(l(),1);function LT({props:$}){let{children:Z,open:J,defaultOpen:Q=!1,onOpenChange:X,onOpenChangeComplete:H,modal:G=!1,handle:z,triggerId:Y,defaultTriggerId:K=null}=$,W=T$.useStore(z?.store,{modal:G,open:Q,openProp:J,activeTriggerId:K,triggerIdProp:Y});a9(()=>{if(J===void 0&&W.state.open===!1&&Q===!0)W.update({open:!0,activeTriggerId:K})}),W.useControlledProp("openProp",J),W.useControlledProp("triggerIdProp",Y);let B=W.useState("open"),q=W.useState("positionerElement"),U=W.useState("payload"),F=W.useState("openChangeReason");W.useContextCallback("onOpenChange",X),W.useContextCallback("onOpenChangeComplete",H);let{openMethod:N,triggerProps:L,reset:V}=u7(B);v9(W);let{forceUnmount:M}=f9(B,W,()=>{W.update({stickIfOpen:!0,openChangeReason:null}),V()});f7(B&&G===!0&&F!==q0.triggerHover&&N!=="touch",q),i4.useEffect(()=>{if(!B)W.context.stickIfOpenTimeout.clear()},[W,B]);let A=i4.useCallback((S)=>{let E=O0(S);return E.preventUnmountOnClose=()=>{W.set("preventUnmountingOnClose",!0)},E},[W]),O=i4.useCallback(()=>{W.setOpen(!1,A(q0.imperativeAction))},[W,A]);i4.useImperativeHandle($.actionsRef,()=>({unmount:M,close:O}),[M,O]);let _=z9({popupStore:W,onOpenChange:W.setOpen}),D=G9(_,{outsidePressEvent:{mouse:G==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),T=U3(_),{getReferenceProps:k,getFloatingProps:x,getTriggerProps:I}=F8([D,T]),y=i4.useMemo(()=>{return k(L)},[k,L]),C=i4.useMemo(()=>{return I(L)},[I,L]),j=i4.useMemo(()=>{return x()},[x]);W.useSyncedValues({modal:G,openMethod:N,activeTriggerProps:y,inactiveTriggerProps:C,popupProps:j,floatingRootContext:_,nested:d1()!=null});let R=i4.useMemo(()=>({store:W}),[W]);return GQ.jsx(ZF.Provider,{value:R,children:typeof Z==="function"?Z({payload:U}):Z})}function MT($){if(C1(!0))return GQ.jsx(LT,{props:$});return GQ.jsx(cZ,{children:GQ.jsx(LT,{props:$})})}var W2=P(v(),1),JF=P(W4(),1);var AT=300;var f3=P(l(),1),DT=W2.forwardRef(function(Z,J){let{render:Q,className:X,disabled:H=!1,nativeButton:G=!0,handle:z,payload:Y,openOnHover:K=!1,delay:W=AT,closeDelay:B=0,id:q,...U}=Z,F=C1(!0),N=z?.store??F?.store;if(!N)throw Error(I0(74));let L=e0(q),V=N.useState("isTriggerActive",L),M=N.useState("floatingRootContext"),A=N.useState("isOpenedByTrigger",L),O=W2.useRef(null),{registerTrigger:_,isMountedByThisTrigger:D}=g9(L,O,N,{payload:Y,disabled:H,openOnHover:K,closeDelay:B}),T=N.useState("openChangeReason"),k=N.useState("stickIfOpen"),x=N.useState("openMethod"),I=Y9(M,{enabled:M!=null&&K&&(x!=="touch"||T!==q0.triggerPress),mouseOnly:!0,move:!1,handleClose:K9(),restMs:W,delay:{close:B},triggerElementRef:O,isActiveTrigger:V}),y=H9(M,{enabled:M!=null,stickIfOpen:k}),C=F8([y]),j=N.useState("triggerProps",D),R={disabled:H,open:A},{getButtonProps:S,buttonRef:E}=S1({disabled:H,native:G}),b=W2.useMemo(()=>({open(z0){if(z0&&T===q0.triggerPress)return ZJ.open(z0);return l9.open(z0)}}),[T]),g=U0("button",Z,{state:R,ref:[E,J,_,O],props:[C.getReferenceProps(),I,j,{[I7]:"",id:L},U,S],stateAttributesMapping:b}),u=W2.useRef(null),w=K0((z0)=>{JF.flushSync(()=>{N.setOpen(!1,O0(q0.focusOut,z0.nativeEvent,z0.currentTarget))}),zH(u.current)?.focus()}),s=K0((z0)=>{let h=N.select("positionerElement");if(h&&e4(z0,h))N.context.beforeContentFocusGuardRef.current?.focus();else{JF.flushSync(()=>{N.setOpen(!1,O0(q0.focusOut,z0.nativeEvent,z0.currentTarget))});let t=GH(N.context.triggerFocusTargetRef.current||O.current);while(t!==null&&x0(h,t)){let M0=t;if(t=b9(t),t===M0)break}t?.focus()}});if(V)return f3.jsxs(W2.Fragment,{children:[f3.jsx(P8,{ref:u,onFocus:w}),f3.jsx(W2.Fragment,{children:g},L),f3.jsx(P8,{ref:N.context.triggerFocusTargetRef,onFocus:s})]});return f3.jsx(W2.Fragment,{children:g},L)});var OT=P(v(),1);var DY=P(v(),1),QF=DY.createContext(void 0);function _T(){let $=DY.useContext(QF);if($===void 0)throw Error(I0(45));return $}var XF=P(l(),1),PT=OT.forwardRef(function(Z,J){let{keepMounted:Q=!1,...X}=Z,{store:H}=C1();if(!(H.useState("mounted")||Q))return null;return XF.jsx(QF.Provider,{value:Q,children:XF.jsx(z3,{ref:J,...X})})});var N9=P(v(),1);var _Y=P(v(),1),HF=_Y.createContext(void 0);function E$(){let $=_Y.useContext(HF);if(!$)throw Error(I0(46));return $}var zQ=P(l(),1),wT=N9.forwardRef(function(Z,J){let{render:Q,className:X,anchor:H,positionMethod:G="absolute",side:z="bottom",align:Y="center",sideOffset:K=0,alignOffset:W=0,collisionBoundary:B="clipping-ancestors",collisionPadding:q=5,arrowPadding:U=5,sticky:F=!1,disableAnchorTracking:N=!1,collisionAvoidance:L=r9,...V}=Z,{store:M}=C1(),A=_T(),O=X3(),_=M.useState("floatingRootContext"),D=M.useState("mounted"),T=M.useState("open"),k=M.useState("openChangeReason"),x=M.useState("activeTriggerElement"),I=M.useState("modal"),y=M.useState("positionerElement"),C=M.useState("instantType"),j=M.useState("transitionStatus"),R=M.useState("hasViewport"),S=N9.useRef(null),E=E2(y,!1,!1),b=d9({anchor:H,floatingRootContext:_,positionMethod:G,mounted:D,side:z,sideOffset:K,align:Y,alignOffset:W,arrowPadding:U,collisionBoundary:B,collisionPadding:q,sticky:F,disableAnchorTracking:N,keepMounted:A,nodeId:O,collisionAvoidance:L,adaptiveOrigin:R?kH:void 0}),g=N9.useMemo(()=>{let t={};if(!T)t.pointerEvents="none";return{role:"presentation",hidden:!D,style:{...b.positionerStyles,...t}}},[T,D,b.positionerStyles]),u=N9.useMemo(()=>({props:g,...b}),[g,b]),w=_.useState("domReferenceElement");W0(()=>{let t=w,M0=S.current;if(t)S.current=t;if(M0&&t&&t!==M0){M.set("instantType",void 0);let d=new AbortController;return E(()=>{M.set("instantType","trigger-change")},d.signal),()=>{d.abort()}}return},[w,E,M]);let s={open:T,side:u.side,align:u.align,anchorHidden:u.anchorHidden,instant:C},z0=N9.useCallback((t)=>{M.set("positionerElement",t)},[M]),h=U0("div",Z,{state:s,props:[u.props,o8(j),V],ref:[J,z0],stateAttributesMapping:x5});return zQ.jsxs(HF.Provider,{value:u,children:[D&&I===!0&&k!==q0.triggerHover&&zQ.jsx(v7,{ref:M.context.internalBackdropRef,inert:j2(!T),cutout:x}),zQ.jsx(pZ,{id:O,children:h})]})});var OY=P(v(),1);var jT=P(l(),1),fn={...x5,...s5},CT=OY.forwardRef(function(Z,J){let{className:Q,render:X,initialFocus:H,finalFocus:G,...z}=Z,{store:Y}=C1(),K=E$(),W=tz(!0)!=null,B=Y.useState("open"),q=Y.useState("openMethod"),U=Y.useState("instantType"),F=Y.useState("transitionStatus"),N=Y.useState("popupProps"),L=Y.useState("titleElementId"),V=Y.useState("descriptionElementId"),M=Y.useState("modal"),A=Y.useState("mounted"),O=Y.useState("openChangeReason"),_=Y.useState("activeTriggerElement"),D=Y.useState("floatingRootContext");v1({open:B,ref:Y.context.popupRef,onComplete(){if(B)Y.context.onOpenChangeComplete?.(!0)}});let T=Y.useState("disabled"),k=Y.useState("openOnHover"),x=Y.useState("closeDelay");W3(D,{enabled:k&&!T,closeDelay:x});function I(S){if(S==="touch")return Y.context.popupRef.current;return!0}let y=H===void 0?I:H,C={open:B,side:K.side,align:K.align,instant:U,transitionStatus:F},j=OY.useCallback((S)=>{Y.set("popupElement",S)},[Y]),R=U0("div",Z,{state:C,ref:[J,Y.context.popupRef,j],props:[N,{"aria-labelledby":L,"aria-describedby":V,onKeyDown(S){if(W&&o9.has(S.key))S.stopPropagation()}},o8(F),z],stateAttributesMapping:fn});return jT.jsx(Y3,{context:D,openInteractionType:q,modal:M==="trap-focus",disabled:!A||O===q0.triggerHover,initialFocus:y,returnFocus:G,restoreFocus:"popup",previousFocusableElement:U1(_)?_:void 0,nextFocusableElement:Y.context.triggerFocusTargetRef,beforeContentFocusGuardRef:Y.context.beforeContentFocusGuardRef,children:R})});var TT=P(v(),1);var ET=TT.forwardRef(function(Z,J){let{className:Q,render:X,...H}=Z,{store:G}=C1(),z=G.useState("open"),{arrowRef:Y,side:K,align:W,arrowUncentered:B,arrowStyles:q}=E$();return U0("div",Z,{state:{open:z,side:K,align:W,uncentered:B},ref:[J,Y],props:[{style:q,"aria-hidden":!0},H],stateAttributesMapping:x5})});var IT=P(v(),1);var mn={...x5,...s5},RT=IT.forwardRef(function(Z,J){let{className:Q,render:X,...H}=Z,{store:G}=C1(),z=G.useState("open"),Y=G.useState("mounted"),K=G.useState("transitionStatus"),W=G.useState("openChangeReason");return U0("div",Z,{state:{open:z,transitionStatus:K},ref:[G.context.backdropRef,J],props:[{role:"presentation",hidden:!Y,style:{pointerEvents:W===q0.triggerHover?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},H],stateAttributesMapping:mn})});var kT=P(v(),1);var ST=kT.forwardRef(function(Z,J){let{render:Q,className:X,...H}=Z,{store:G}=C1(),z=e0(H.id);return W0(()=>{return G.set("titleElementId",z),()=>{G.set("titleElementId",void 0)}},[G,z]),U0("h2",Z,{ref:J,props:[{id:z},H]})});var bT=P(v(),1);var yT=bT.forwardRef(function(Z,J){let{render:Q,className:X,...H}=Z,{store:G}=C1(),z=e0(H.id);return W0(()=>{return G.set("descriptionElementId",z),()=>{G.set("descriptionElementId",void 0)}},[G,z]),U0("p",Z,{ref:J,props:[{id:z},H]})});var xT=P(v(),1);var hT=xT.forwardRef(function(Z,J){let{render:Q,className:X,disabled:H=!1,nativeButton:G=!0,...z}=Z,{buttonRef:Y,getButtonProps:K}=S1({disabled:H,focusableWhenDisabled:!1,native:G}),{store:W}=C1();return U0("button",Z,{ref:[J,Y],props:[{onClick(q){W.setOpen(!1,O0(q0.closePress,q.nativeEvent,q.currentTarget))}},z,K]})});var vT=P(v(),1);var gT=function($){return $.popupWidth="--popup-width",$.popupHeight="--popup-height",$}({});var un={activationDirection:($)=>$?{"data-activation-direction":$}:null},fT=vT.forwardRef(function(Z,J){let{render:Q,className:X,children:H,...G}=Z,{store:z}=C1(),{side:Y}=E$(),K=z.useState("instantType"),{children:W,state:B}=uH({store:z,side:Y,cssVars:gT,children:H}),q={activationDirection:B.activationDirection,transitioning:B.transitioning,instant:K};return U0("div",Z,{state:q,ref:J,props:[G,{children:W}],stateAttributesMapping:un})});class PY{constructor(){this.store=new T$}open($){let Z=$?this.store.context.triggerElements.getById($)??void 0:void 0;if($&&!Z)throw Error(I0(80,$));this.store.setOpen(!0,O0(q0.imperativeAction,void 0,Z))}close(){this.store.setOpen(!1,O0(q0.imperativeAction,void 0,void 0))}get isOpen(){return this.store.state.open}}function mT(){return new PY}var m3=P(l(),1);function wY({...$}){return m3.jsx(_6.Root,{"data-slot":"popover",...$})}function jY({...$}){return m3.jsx(_6.Trigger,{"data-slot":"popover-trigger",...$})}function CY({className:$,align:Z="center",alignOffset:J=0,disableAnchorTracking:Q=!1,side:X="bottom",sideOffset:H=4,keepMounted:G=!1,container:z,...Y}){return m3.jsx(_6.Portal,{keepMounted:G,container:z,children:m3.jsx(_6.Positioner,{align:Z,alignOffset:J,disableAnchorTracking:Q,side:X,sideOffset:H,className:"isolate z-50",children:m3.jsx(_6.Popup,{"data-slot":"popover-content",className:e("z-50 flex w-72 origin-(--transform-origin) flex-col gap-3 rounded-lg bg-popover p-3 text-sm text-popover-foreground shadow-md outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",$),...Y})})})}function uT({className:$,...Z}){return m3.jsx("div",{"data-slot":"popover-header",className:e("flex flex-col gap-0.5 text-sm",$),...Z})}var gY=P(v(),1);var O6={};S4(O6,{Value:()=>iT,Track:()=>sT,Thumb:()=>JE,Root:()=>dT,Indicator:()=>QE,Control:()=>aT});var T1=P(v(),1);var pT=P(v(),1);function TY($,Z){let J=pT.useRef($),Q=K0(Z);W0(()=>{if(J.current===$)return;Q(J.current)},[$,Q]),W0(()=>{J.current=$},[$])}function S8($,Z=Number.MIN_SAFE_INTEGER,J=Number.MAX_SAFE_INTEGER){return Math.max(Z,Math.min($,J))}function GF($,Z,J=(Q,X)=>Q===X){return $.length===Z.length&&$.every((Q,X)=>J(Q,Z[X]))}function EY($,Z){return $-Z}function cT($,Z,J){let Q=$.slice();return Q[Z]=J,Q.sort(EY)}function IY($,Z,J,Q,X,H){let G=$;if(G=S8(G,J,Q),X)G=cT(H,Z,S8(G,H[Z-1]||-1/0,H[Z+1]||1/0));return G}function RY($,Z,J){if(!Array.isArray($))return!0;let Q=$.reduce((X,H,G,z)=>{if(G===z.length-1)return X;return X.push(Math.abs(H-z[G+1])),X},[]);return Math.min(...Q)>=Z*J}var r4={activeThumbIndex:()=>null,max:()=>null,min:()=>null,minStepsBetweenValues:()=>null,step:()=>null,values:()=>null,...E8};var kY=P(v(),1),zF=kY.createContext(void 0);function c2(){let $=kY.useContext(zF);if($===void 0)throw Error(I0(62));return $}var YF=P(l(),1);function pn($){return"key"in $?q0.keyboard:q0.inputChange}function cn($,Z){if(typeof $==="number"&&typeof Z==="number")return $===Z;if(Array.isArray($)&&Array.isArray(Z))return GF($,Z);return!1}var dT=T1.forwardRef(function(Z,J){let{"aria-labelledby":Q,className:X,defaultValue:H,disabled:G=!1,id:z,format:Y,largeStep:K=10,locale:W,render:B,max:q=100,min:U=0,minStepsBetweenValues:F=0,name:N,onValueChange:L,onValueCommitted:V,orientation:M="horizontal",step:A=1,thumbCollisionBehavior:O="push",thumbAlignment:_="center",value:D,...T}=Z,k=e0(z),x=K0(L),I=K0(V),{clearErrors:y}=v4(),{state:C,disabled:j,name:R,setTouched:S,setDirty:E,validityData:b,shouldValidateOnChange:g,validation:u}=j1(),{labelId:w}=H8(),s=Q??w,z0=j||G,h=R??N,[t,M0]=f4({controlled:D,default:H??U,name:"Slider"}),d=T1.useRef(null),Y0=T1.useRef(null),B0=T1.useRef([]),J0=T1.useRef(null),H0=T1.useRef(null),N0=T1.useRef(-1),c=T1.useRef(null),Z0=T1.useRef(null),$0=T1.useRef("none"),G0=V1(Y),[r,Q0]=T1.useState(-1),[a,p]=T1.useState(-1),[o,n]=T1.useState(!1),[V0,w0]=T1.useState(()=>new Map),[v0,c0]=T1.useState([void 0,void 0]),m=K0((P0)=>{if(Q0(P0),P0!==-1)p(P0)});l7({id:k,commit:u.commit,value:t,controlRef:Y0,name:h,getValue:()=>t}),TY(t,()=>{if(y(h),g())u.commit(t);else u.commit(t,!0);let P0=b.initialValue,f0;if(Array.isArray(t)&&Array.isArray(P0))f0=!GF(t,P0);else f0=t!==P0;E(f0)});let i=K0((P0)=>{if(P0)Y0.current=P0}),f=Array.isArray(t),X0=T1.useMemo(()=>{if(!f)return[S8(t,U,q)];return t.slice().sort(EY)},[q,U,f,t]),L0=K0((P0,f0)=>{if(Number.isNaN(P0)||cn(P0,t))return;let h0=f0??O0(q0.none,void 0,void 0,{activeThumbIndex:-1});$0.current=h0.reason;let a0=h0.event,j5=new(a0.constructor??Event)(a0.type,a0);if(Object.defineProperty(j5,"target",{writable:!0,value:{value:P0,name:h}}),h0.event=j5,Z0.current=P0,x(P0,h0),h0.isCanceled)return;M0(P0)}),k0=K0((P0,f0,h0)=>{let a0=IY(P0,f0,U,q,f,X0);if(RY(a0,A,F)){let n5=pn(h0);L0(a0,O0(n5,h0.nativeEvent,void 0,{activeThumbIndex:f0})),S(!0);let j5=Z0.current??a0;I(j5,NH(n5,h0.nativeEvent))}});if(W0(()=>{let P0=p5(g0(d.current));if(z0&&P0&&d.current?.contains(P0))P0.blur()},[z0]),z0&&r!==-1)m(-1);let r0=T1.useMemo(()=>({...C,activeThumbIndex:r,disabled:z0,dragging:o,orientation:M,max:q,min:U,minStepsBetweenValues:F,step:A,values:X0}),[C,r,z0,o,q,U,F,M,A,X0]),J5=T1.useMemo(()=>({active:r,controlRef:Y0,disabled:z0,dragging:o,validation:u,formatOptionsRef:G0,handleInputChange:k0,indicatorPosition:v0,inset:_!=="center",labelId:s,largeStep:K,lastUsedThumbIndex:a,lastChangedValueRef:Z0,lastChangeReasonRef:$0,locale:W,max:q,min:U,minStepsBetweenValues:F,name:h,onValueCommitted:I,orientation:M,pressedInputRef:J0,pressedThumbCenterOffsetRef:H0,pressedThumbIndexRef:N0,pressedValuesRef:c,registerFieldControlRef:i,renderBeforeHydration:_==="edge",setActive:m,setDragging:n,setIndicatorPosition:c0,setValue:L0,state:r0,step:A,thumbCollisionBehavior:O,thumbMap:V0,thumbRefs:B0,values:X0}),[r,Y0,s,z0,o,u,G0,k0,v0,K,a,Z0,$0,W,q,U,F,h,I,M,J0,H0,N0,c,i,m,n,c0,L0,r0,A,O,_,V0,B0,X0]),m0=U0("div",Z,{state:r0,ref:[J,d],props:[{"aria-labelledby":s,id:k,role:"group"},u.getValidationProps,T],stateAttributesMapping:r4});return YF.jsx(zF.Provider,{value:J5,children:YF.jsx(ZY,{elementsRef:B0,onMapChange:w0,children:m0})})});var I$=P(v(),1);var lT=new Map;function dn($,Z){let J=JSON.stringify({locale:$,options:Z}),Q=lT.get(J);if(Q)return Q;let X=new Intl.NumberFormat($,Z);return lT.set(J,X),X}function u3($,Z,J){if($==null)return"";return dn(Z,J).format($)}var iT=I$.forwardRef(function(Z,J){let{"aria-live":Q="off",render:X,className:H,children:G,...z}=Z,{thumbMap:Y,state:K,values:W,formatOptionsRef:B,locale:q}=c2(),U=I$.useMemo(()=>{let V="";for(let M of Y.values())if(M?.inputId)V+=`${M.inputId} `;return V.trim()===""?void 0:V.trim()},[Y]),F=I$.useMemo(()=>{let V=[];for(let M=0;M<W.length;M+=1)V.push(u3(W[M],q,B.current??void 0));return V},[B,q,W]),N=I$.useMemo(()=>{let V=[];for(let M=0;M<W.length;M+=1)V.push(F[M]||W[M]);return V.join(" – ")},[W,F]);return U0("output",Z,{state:K,ref:J,props:[{"aria-live":Q,children:typeof G==="function"?G(F,W):N,htmlFor:U},z],stateAttributesMapping:r4})});var B2=P(v(),1);function SY($){let Z=$.getBoundingClientRect();return{x:(Z.left+Z.right)/2,y:(Z.top+Z.bottom)/2}}function ln($){if(Math.abs($)<1){let J=$.toExponential().split("e-"),Q=J[0].split(".")[1];return(Q?Q.length:0)+parseInt(J[1],10)}let Z=$.toString().split(".")[1];return Z?Z.length:0}function bY($,Z,J){let Q=Math.round(($-J)/Z)*Z+J;return Number(Q.toFixed(ln(Z)))}function KF({values:$,index:Z,nextValue:J,min:Q,max:X,step:H,minStepsBetweenValues:G,initialValues:z}){if($.length===0)return[];let Y=$.slice(),K=H*G,W=Y.length-1,B=z??$,q=Q+Z*K,U=X-(W-Z)*K;Y[Z]=S8(J,q,U);for(let F=Z+1;F<=W;F+=1){let N=Y[F-1]+K,L=X-(W-F)*K,V=B[F]??Y[F],M=Math.max(Y[F],N);if(V<M)M=Math.max(V,N);Y[F]=S8(M,N,L)}for(let F=Z-1;F>=0;F-=1){let N=Y[F+1]-K,L=Q+F*K,V=B[F]??Y[F],M=Math.min(Y[F],N);if(V>M)M=Math.min(V,N);Y[F]=S8(M,L,N)}for(let F=0;F<=W;F+=1)Y[F]=Number(Y[F].toFixed(12));return Y}function rT({behavior:$,values:Z,currentValues:J,initialValues:Q,pressedIndex:X,nextValue:H,min:G,max:z,step:Y,minStepsBetweenValues:K}){let W=J??Z,B=Q??Z;if(!(W.length>1))return{value:H,thumbIndex:0,didSwap:!1};let U=Y*K;switch($){case"swap":{let F=W[X],N=0.0000001,L=W.slice(),V=L[X-1],M=L[X+1],A=V!=null?V+U:G,O=M!=null?M-U:z,_=S8(H,A,O),D=Number(_.toFixed(12));L[X]=D;let T=H>F,k=H<F,x=T&&M!=null&&H>=M-0.0000001,I=k&&V!=null&&H<=V+0.0000001;if(!x&&!I)return{value:L,thumbIndex:X,didSwap:!1};let y=x?X+1:X-1,C=L.map((E,b)=>{if(b===X)return D;let g=B[b];if(g!=null)return g;return W[b]}),j=H;if(x)j=Math.max(H,L[y]);else j=Math.min(H,L[y]);let R=KF({values:L,index:y,nextValue:j,min:G,max:z,step:Y,minStepsBetweenValues:K,initialValues:C}),S=x?y-1:y+1;if(S>=0&&S<R.length){let E=R[S-1],b=R[S+1],g=E!=null?E+U:G;g=Math.max(g,G+S*U);let u=b!=null?b-U:z;u=Math.min(u,z-(R.length-1-S)*U);let w=S8(D,g,u);R[S]=Number(w.toFixed(12))}return{value:R,thumbIndex:y,didSwap:!0}}case"push":return{value:KF({values:W,index:X,nextValue:H,min:G,max:z,step:Y,minStepsBetweenValues:K}),thumbIndex:X,didSwap:!1};case"none":default:{let F=W.slice(),N=F[X-1],L=F[X+1],V=N!=null?N+U:G,M=L!=null?L-U:z,A=S8(H,V,M);return F[X]=Number(A.toFixed(12)),{value:F,thumbIndex:X,didSwap:!1}}}}var rn=2;function an($,Z){if(!$)return{start:0,end:0};function J(H){let G=H!=null?parseFloat(H):0;return Number.isNaN(G)?0:G}let Q=!Z?"InlineStart":"Top",X=!Z?"InlineEnd":"Bottom";return{start:J($[`border${Q}Width`])+J($[`padding${Q}`]),end:J($[`border${X}Width`])+J($[`padding${X}`])}}function yY($,Z){if(Z.current!=null&&$.changedTouches){let J=$;for(let Q=0;Q<J.changedTouches.length;Q+=1){let X=J.changedTouches[Q];if(X.identifier===Z.current)return{x:X.clientX,y:X.clientY}}return null}return{x:$.clientX,y:$.clientY}}var aT=B2.forwardRef(function(Z,J){let{render:Q,className:X,...H}=Z,{disabled:G,dragging:z,validation:Y,inset:K,lastChangedValueRef:W,lastChangeReasonRef:B,max:q,min:U,minStepsBetweenValues:F,onValueCommitted:N,orientation:L,pressedInputRef:V,pressedThumbCenterOffsetRef:M,pressedThumbIndexRef:A,pressedValuesRef:O,registerFieldControlRef:_,renderBeforeHydration:D,setActive:T,setDragging:k,setValue:x,state:I,step:y,thumbCollisionBehavior:C,thumbRefs:j,values:R}=c2(),S=x4(),E=R.length>1,b=L==="vertical",g=B2.useRef(null),u=B2.useRef(null),w=K0((G0)=>{if(G0&&u.current==null){if(u.current==null)u.current=getComputedStyle(G0)}}),s=B2.useRef(null),z0=B2.useRef(0),h=B2.useRef(0),t=V1(R),M0=K0((G0)=>{if(A.current!==G0)A.current=G0;let r=j.current[G0];if(!r){M.current=null,V.current=null;return}V.current=r.querySelector('input[type="range"]')}),d=K0((G0)=>{let r=g.current;if(!r)return null;let{width:Q0,height:a,bottom:p,left:o,right:n}=r.getBoundingClientRect(),V0=an(u.current,b),w0=h.current,v0=(b?a:Q0)-V0.start-V0.end-w0*2,c0=M.current??0,m=G0.x-c0,i=G0.y-c0,f=b?p-i-V0.end:(S==="rtl"?n-m:m-o)-V0.start,X0=S8((f-w0)/v0,0,1),L0=(q-U)*X0+U;if(L0=bY(L0,y,U),L0=S8(L0,U,q),!E)return{value:L0,thumbIndex:0,didSwap:!1};let k0=A.current;if(k0<0)return null;let r0=rT({behavior:C,values:R,currentValues:t.current??R,initialValues:O.current,pressedIndex:k0,nextValue:L0,min:U,max:q,step:y,minStepsBetweenValues:F});if(C==="swap"&&r0.didSwap)M0(r0.thumbIndex);else A.current=r0.thumbIndex;return r0}),Y0=K0((G0)=>{O.current=E?R.slice():null,t.current=R;let r=A.current,Q0=r;if(r>-1&&r<R.length){if(R[r]===q){let a=r;while(a>0&&R[a-1]===q)a-=1;Q0=a}}else{let a=!b?"x":"y",p;Q0=-1;for(let o=0;o<j.current.length;o+=1){let n=j.current[o];if(V5(n)){let V0=SY(n),w0=Math.abs(G0[a]-V0[a]);if(p===void 0||w0<=p)Q0=o,p=w0}}}if(Q0>-1&&Q0!==r)M0(Q0);if(K){let a=j.current[Q0];if(V5(a)){let p=a.getBoundingClientRect(),o=!b?"width":"height";h.current=p[o]/2}}}),B0=K0((G0)=>{j.current?.[G0]?.querySelector('input[type="range"]')?.focus({preventScroll:!0})}),J0=K0((G0)=>{let r=yY(G0,s);if(r==null)return;if(z0.current+=1,G0.type==="pointermove"&&G0.buttons===0){H0(G0);return}let Q0=d(r);if(Q0==null)return;if(RY(Q0.value,y,F)){if(!z&&z0.current>rn)k(!0);if(x(Q0.value,O0(q0.drag,G0,void 0,{activeThumbIndex:Q0.thumbIndex})),t.current=Array.isArray(Q0.value)?Q0.value:[Q0.value],Q0.didSwap)B0(Q0.thumbIndex)}});function H0(G0){T(-1),k(!1),V.current=null,M.current=null;let r=yY(G0,s),Q0=r!=null?d(r):null;if(Q0!=null){let a=B.current;Y.commit(W.current??Q0.value),N(W.current??Q0.value,NH(a,G0))}if("pointerType"in G0&&g.current?.hasPointerCapture(G0.pointerId))g.current?.releasePointerCapture(G0.pointerId);A.current=-1,s.current=null,O.current=null,c()}let N0=K0((G0)=>{if(G)return;let r=G0.changedTouches[0];if(r!=null)s.current=r.identifier;let Q0=yY(G0,s);if(Q0!=null){Y0(Q0);let p=d(Q0);if(p==null)return;if(B0(p.thumbIndex),x(p.value,O0(q0.trackPress,G0,void 0,{activeThumbIndex:p.thumbIndex})),t.current=Array.isArray(p.value)?p.value:[p.value],p.didSwap)B0(p.thumbIndex)}z0.current=0;let a=g0(g.current);a.addEventListener("touchmove",J0,{passive:!0}),a.addEventListener("touchend",H0,{passive:!0})}),c=K0(()=>{let G0=g0(g.current);G0.removeEventListener("pointermove",J0),G0.removeEventListener("pointerup",H0),G0.removeEventListener("touchmove",J0),G0.removeEventListener("touchend",H0),O.current=null}),Z0=n8();return B2.useEffect(()=>{let G0=g.current;if(!G0)return()=>c();return G0.addEventListener("touchstart",N0,{passive:!0}),()=>{G0.removeEventListener("touchstart",N0),Z0.cancel(),c()}},[c,N0,g,Z0]),B2.useEffect(()=>{if(G)c()},[G,c]),U0("div",Z,{state:I,ref:[J,_,g,w],props:[{["data-base-ui-slider-control"]:D?"":void 0,onPointerDown(G0){let r=g.current;if(!r||G||G0.defaultPrevented||!V5(G0.target)||G0.button!==0)return;let Q0=yY(G0,s);if(Q0!=null){Y0(Q0);let p=d(Q0);if(p==null)return;if(x0(j.current[p.thumbIndex],p5(g0(r))))G0.preventDefault();else Z0.request(()=>{B0(p.thumbIndex)});if(k(!0),M.current==null){if(x(p.value,O0(q0.trackPress,G0.nativeEvent,void 0,{activeThumbIndex:p.thumbIndex})),t.current=Array.isArray(p.value)?p.value:[p.value],p.didSwap)B0(p.thumbIndex)}}if(G0.nativeEvent.pointerId)r.setPointerCapture(G0.nativeEvent.pointerId);z0.current=0;let a=g0(g.current);a.addEventListener("pointermove",J0,{passive:!0}),a.addEventListener("pointerup",H0,{once:!0})},tabIndex:-1},H],stateAttributesMapping:r4})});var nT=P(v(),1);var sT=nT.forwardRef(function(Z,J){let{render:Q,className:X,...H}=Z,{state:G}=c2();return U0("div",Z,{state:G,ref:J,props:[{style:{position:"relative"}},H],stateAttributesMapping:r4})});var X4=P(v(),1);function YQ($,Z,J){return($-Z)*100/(J-Z)}var xY=P(v(),1),nn=xY.createContext(void 0),sn={disableStyleElements:!1};function oT(){return xY.useContext(nn)??sn}var tT=function($){return $.index="data-index",$.dragging="data-dragging",$.orientation="data-orientation",$.disabled="data-disabled",$.valid="data-valid",$.invalid="data-invalid",$.touched="data-touched",$.dirty="data-dirty",$.focused="data-focused",$}({});var eT='!function(){const t=document.currentScript?.parentElement;if(!t)return;const e=t.closest("[data-base-ui-slider-control]");if(!e)return;const r=e.querySelector("[data-base-ui-slider-indicator]"),i=e.getBoundingClientRect(),n="vertical"===e.getAttribute("data-orientation")?"height":"width",o=e.querySelectorAll(\'input[type="range"]\'),l=o.length>1,s=o.length-1;let a=null,u=null;for(let t=0;t<o.length;t+=1){const e=o[t],y=parseFloat(e.getAttribute("value")??"");if(Number.isNaN(y))return;const c=e.parentElement;if(!c)return;const p=parseFloat(e.getAttribute("max")??"100"),g=parseFloat(e.getAttribute("min")??"0"),b=c?.getBoundingClientRect(),d=i[n]-b[n],m=100*(y-g)/(p-g),v=(b[n]/2+d*m/100)/i[n]*100;c.style.setProperty("--position",`${v}%`),Number.isFinite(v)&&(c.style.removeProperty("visibility"),r&&(0===t?(a=v,r.style.setProperty("--start-position",`${v}%`),l||r.style.removeProperty("visibility")):t===s&&(u=v-(a??0),r.style.setProperty("--end-position",`${v}%`),r.style.setProperty("--relative-size",`${u}%`),r.style.removeProperty("visibility"))))}}();';var KQ=P(l(),1),$E="PageUp",ZE="PageDown",on=new Set([zJ,YJ,KJ,WJ,BJ,qJ,$E,ZE]);function tn($,Z,J,Q){if(Z<0)return;if($.length===2){if(Z===0)return`${u3($[Z],Q,J)} start range`;return`${u3($[Z],Q,J)} end range`}return J?u3($[Z],Q,J):void 0}function R$($,Z,J,Q,X){return J===1?Math.min($+Z,X):Math.max($-Z,Q)}var JE=X4.forwardRef(function(Z,J){let{render:Q,children:X,className:H,"aria-describedby":G,"aria-label":z,"aria-labelledby":Y,disabled:K=!1,getAriaLabel:W,getAriaValueText:B,id:q,index:U,inputRef:F,onBlur:N,onFocus:L,onKeyDown:V,tabIndex:M,...A}=Z,{nonce:O}=oT(),_=e0(q),{active:D,lastUsedThumbIndex:T,controlRef:k,disabled:x,validation:I,formatOptionsRef:y,handleInputChange:C,inset:j,labelId:R,largeStep:S,locale:E,max:b,min:g,minStepsBetweenValues:u,name:w,orientation:s,pressedInputRef:z0,pressedThumbCenterOffsetRef:h,pressedThumbIndexRef:t,renderBeforeHydration:M0,setActive:d,setIndicatorPosition:Y0,state:B0,step:J0,values:H0}=c2(),N0=x4(),c=K||x,Z0=H0.length>1,$0=s==="vertical",G0=N0==="rtl",{setTouched:r,setFocused:Q0,validationMode:a}=j1(),p=X4.useRef(null),o=X4.useRef(null),n=e0(),V0=d7(),w0=Z0?n:V0,v0=X4.useMemo(()=>({inputId:w0}),[w0]),{ref:c0,index:m}=Q4({metadata:v0}),i=!Z0?0:U??m,f=i===H0.length-1,X0=H0[i],L0=YQ(X0,g,b),[k0,r0]=X4.useState(!1),[J5,m0]=X4.useState();_8(()=>r0(!0));let P0=T>=0&&T<H0.length?T:-1,f0=K0(()=>{let T0=k.current,b0=p.current;if(!T0||!b0)return;let p0=b0.getBoundingClientRect(),$5=T0.getBoundingClientRect(),K5=$0?"height":"width",O5=$5[K5]-p0[K5],u5=(p0[K5]/2+O5*L0/100)/$5[K5]*100;if(m0(u5),i===0)Y0((W5)=>[u5,W5[1]]);else if(f)Y0((W5)=>[W5[0],u5])});W0(()=>{if(j)queueMicrotask(f0)},[f0,j]),W0(()=>{if(j)f0()},[f0,j,L0]);let h0=X4.useCallback(()=>{let T0=$0?"bottom":"insetInlineStart",b0=$0?"left":"top",p0;if(Z0){if(D===i)p0=2;else if(P0===i)p0=1}else if(D===i)p0=1;if(!j){if(!Number.isFinite(L0))return $2;return{position:"absolute",[T0]:`${L0}%`,[b0]:"50%",translate:`${($0||!G0?-1:1)*50}% ${($0?1:-1)*50}%`,zIndex:p0}}return{["--position"]:`${J5}%`,visibility:M0&&!k0||J5===void 0?"hidden":void 0,position:"absolute",[T0]:"var(--position)",[b0]:"50%",translate:`${($0||!G0?-1:1)*50}% ${($0?1:-1)*50}%`,zIndex:p0}},[D,i,j,k0,J5,Z0,M0,G0,P0,L0,$0]),a0;if(s==="vertical")a0=G0?"vertical-rl":"vertical-lr";let n5=t8({"aria-label":typeof W==="function"?W(i):z,"aria-labelledby":Y??R,"aria-describedby":G,"aria-orientation":s,"aria-valuenow":X0,"aria-valuetext":typeof B==="function"?B(u3(X0,E,y.current??void 0),X0,i):tn(H0,i,y.current??void 0,E),disabled:c,id:w0,max:b,min:g,name:w,onChange(T0){C(T0.target.valueAsNumber,i,T0)},onFocus(){d(i),Q0(!0)},onBlur(){if(!p.current)return;if(d(-1),r(!0),Q0(!1),a==="onBlur")I.commit(IY(X0,i,g,b,Z0,H0))},onKeyDown(T0){if(!on.has(T0.key))return;if(o9.has(T0.key))T0.stopPropagation();let b0=null,p0=bY(X0,J0,g);switch(T0.key){case zJ:b0=R$(p0,T0.shiftKey?S:J0,1,g,b);break;case WJ:b0=R$(p0,T0.shiftKey?S:J0,G0?-1:1,g,b);break;case YJ:b0=R$(p0,T0.shiftKey?S:J0,-1,g,b);break;case KJ:b0=R$(p0,T0.shiftKey?S:J0,G0?1:-1,g,b);break;case $E:b0=R$(p0,S,1,g,b);break;case ZE:b0=R$(p0,S,-1,g,b);break;case qJ:if(b0=b,Z0)b0=Number.isFinite(H0[i+1])?H0[i+1]-J0*u:b;break;case BJ:if(b0=g,Z0)b0=Number.isFinite(H0[i-1])?H0[i-1]+J0*u:g;break;default:break}if(b0!==null)C(b0,i,T0),T0.preventDefault()},step:J0,style:{...$2,width:"100%",height:"100%",writingMode:a0},tabIndex:M??void 0,type:"range",value:X0??""},I.getInputValidationProps),j5=q4(o,I.inputRef,F);return U0("div",Z,{state:B0,ref:[J,c0,p],props:[{[tT.index]:i,children:KQ.jsxs(X4.Fragment,{children:[X,KQ.jsx("input",{ref:j5,...n5}),j&&!k0&&M0&&f&&KQ.jsx("script",{nonce:O,dangerouslySetInnerHTML:{__html:eT},suppressHydrationWarning:!0})]}),id:_,onBlur:N,onFocus:L,onPointerDown(T0){if(t.current=i,p.current!=null){let b0=s==="horizontal"?"x":"y",p0=SY(p.current),$5=(s==="horizontal"?T0.clientX:T0.clientY)-p0[b0];h.current=$5}if(o.current!=null&&z0.current!==o.current)z0.current=o.current},style:h0(),suppressHydrationWarning:M0||void 0,tabIndex:-1},A],stateAttributesMapping:r4})});var hY=P(v(),1);function en($,Z,J,Q,X,H){let G=J===void 0||Z&&Q===void 0?"hidden":void 0,z=$?"bottom":"insetInlineStart",Y=$?"height":"width",W={visibility:X&&!H?"hidden":G,position:$?"absolute":"relative",[$?"width":"height"]:"inherit"};if(W["--start-position"]=`${J??0}%`,!Z)return W[z]=0,W[Y]="var(--start-position)",W;return W["--relative-size"]=`${(Q??0)-(J??0)}%`,W[z]="var(--start-position)",W[Y]="var(--relative-size)",W}function $s($,Z,J,Q){let X=$?"bottom":"insetInlineStart",H=$?"height":"width",z={position:$?"absolute":"relative",[$?"width":"height"]:"inherit"};if(!Z)return z[X]=0,z[H]=`${J}%`,z;let Y=Q-J;return z[X]=`${J}%`,z[H]=`${Y}%`,z}var QE=hY.forwardRef(function(Z,J){let{render:Q,className:X,...H}=Z,{indicatorPosition:G,inset:z,max:Y,min:K,orientation:W,renderBeforeHydration:B,state:q,values:U}=c2(),[F,N]=hY.useState(!1);_8(()=>N(!0));let L=W==="vertical",V=U.length>1,M=z?en(L,V,G[0],G[1],B,F):$s(L,V,YQ(U[0],K,Y),YQ(U[U.length-1],K,Y));return U0("div",Z,{state:q,ref:J,props:[{["data-base-ui-slider-indicator"]:B?"":void 0,style:M,suppressHydrationWarning:B||void 0},H],stateAttributesMapping:r4})});var p3=P(l(),1);function XE({children:$,className:Z,defaultValue:J,value:Q,min:X=0,max:H=100,...G}){let[z,Y]=gY.useState(!1),K=Array.isArray(Q)?Q:Array.isArray(J)?J:[X,H];return gY.useEffect(()=>{let W=requestAnimationFrame(()=>Y(!0));return()=>cancelAnimationFrame(W)},[]),p3.jsx(O6.Root,{className:e("data-horizontal:w-full data-vertical:h-full",Z),"data-slot":"slider",defaultValue:J,value:Q,min:X,max:H,thumbAlignment:"edge",...G,children:p3.jsxs(O6.Control,{className:"relative flex w-full touch-none items-center select-none data-disabled:opacity-50 data-vertical:h-full data-vertical:min-h-40 data-vertical:w-auto data-vertical:flex-col",children:[p3.jsx(O6.Track,{"data-slot":"slider-track",className:"relative grow overflow-hidden rounded-full bg-muted select-none data-horizontal:h-1 data-horizontal:w-full data-vertical:h-full data-vertical:w-1",children:p3.jsx(O6.Indicator,{"data-slot":"slider-range",className:e("bg-primary select-none data-horizontal:h-full data-vertical:w-full",z&&"transition-[width] duration-150 ease-in-out")})}),$,Array.from({length:K.length},(W,B)=>p3.jsx(O6.Thumb,{"data-slot":"slider-thumb",className:e("relative block size-3 shrink-0 cursor-ew-resize rounded-full border border-ring bg-white ring-ring/50 select-none after:absolute after:-inset-2 hover:ring-3 focus-visible:ring-3 focus-visible:outline-hidden active:ring-3 disabled:pointer-events-none disabled:opacity-50",z&&"transition-[inset-inline-start,color,box-shadow] duration-150 ease-in-out")},B))]})})}var X5=P(l(),1);function HE($){return $?.split(/\s*·\s*/)[0]??""}function Zs($){return $.charAt(0).toUpperCase()+$.slice(1)}function Js($){return $==="xhigh"?"Extra":Zs($)}function GE($){return typeof $==="number"?$:$[0]??0}var zE={from:{opacity:0,filter:"blur(4px)"},to:{opacity:1,filter:"blur(0px)"}},YE={type:"spring",duration:0.3,delay:0.1,bounce:0};function WE({label:$,leadingIcon:Z,className:J,...Q}){return X5.jsxs(E0,{...Q,variant:"ghost",className:e("group/picker max-w-56 min-w-0 px-2 text-muted-foreground hover:text-muted-foreground",J),children:[Z,X5.jsx("span",{className:"truncate font-normal",children:$})]})}function Qs({current:$,model:Z,models:J,onValueChange:Q}){let X=HE(Z.description)||Z.displayName;return X5.jsxs(O$,{children:[X5.jsx(P$,{render:X5.jsx(WE,{label:X,"aria-label":`Model: ${X}`})}),X5.jsx(w$,{align:"end",side:"top",className:"w-max max-w-64 min-w-40",children:X5.jsxs(j$,{children:[X5.jsx(MY,{children:"Models"}),X5.jsx(UT,{value:$,onValueChange:Q,children:J.map((H)=>X5.jsx(FT,{value:H.value,closeOnClick:!0,children:HE(H.description)||H.displayName},H.value))})]})})]})}function Xs({currentEffort:$,effortLevels:Z,fastMode:J,showFastMode:Q,onFastModeChange:X,onValueChange:H}){let G=MC(Z,$),[z,Y]=k$.useState(!1),[K,W]=k$.useState(G),[B,q]=k$.useState(!1),F=Z[z?K:G]??$,N=Js(F),L=(M)=>{if(M)W(G);else q(!1);Y(M)},V=(M)=>{let A=Z[M];if(A&&A!==$)H(A)};return X5.jsxs(wY,{open:z,onOpenChange:L,children:[X5.jsx(jY,{render:X5.jsx(WE,{label:N,leadingIcon:J?X5.jsx(WQ,{stroke:1.5}):void 0,"aria-label":`Effort: ${N}`})}),X5.jsxs(CY,{align:"end",side:"top",className:"w-64",disableAnchorTracking:!0,children:[X5.jsx(uT,{className:"relative h-5 flex-row items-center",children:X5.jsx(O4,{mode:"popLayout",initial:!1,children:B?X5.jsxs(h5.div,{className:"flex h-5 w-full items-center justify-between text-sm text-muted-foreground","aria-hidden":"true",variants:zE,initial:"from",animate:"to",exit:"from",transition:YE,children:[X5.jsx("span",{children:"Faster"}),X5.jsx("span",{children:"Smarter"})]},"range"):X5.jsxs(h5.div,{className:"flex h-5 w-full items-center justify-between gap-2",variants:zE,initial:"from",animate:"to",exit:"from",transition:YE,children:[X5.jsxs("div",{className:"flex items-center gap-1",children:[X5.jsx("span",{className:"text-muted-foreground",children:"Effort"}),X5.jsx("output",{"aria-live":"polite",children:N})]}),Q&&X5.jsxs(r1,{children:[X5.jsx(a1,{render:X5.jsx(E0,{type:"button",variant:"ghost",size:"icon-sm","aria-label":J?"Turn off Fast mode":"Turn on Fast mode","aria-pressed":J,onClick:()=>X(!J),className:"-my-1 -mr-1",children:J?X5.jsx(KE,{className:"text-primary"}):X5.jsx(WQ,{className:"text-muted-foreground",stroke:1.5})})}),X5.jsxs(n1,{align:"center",className:"flex-col gap-0",children:[X5.jsx("span",{children:"Fast mode"}),X5.jsx("span",{className:"font-normal text-muted-foreground",children:"More usage"})]})]})]},"effort")})}),X5.jsxs("label",{className:"block",children:[X5.jsx("span",{className:"sr-only",children:"Reasoning effort"}),X5.jsx(XE,{value:K,min:0,max:Z.length-1,step:1,onPointerDown:(M)=>{if(M.button===0)q(!0)},onPointerCancel:()=>q(!1),onValueChange:(M)=>W(GE(M)),onValueCommitted:(M)=>{q(!1),V(GE(M))},className:e("**:data-[slot=slider-track]:h-6 **:data-[slot=slider-track]:rounded-sm","**:data-[slot=slider-thumb]:h-6 **:data-[slot=slider-thumb]:w-5 **:data-[slot=slider-thumb]:rounded-sm **:data-[slot=slider-thumb]:border-0 **:data-[slot=slider-thumb]:bg-card **:data-[slot=slider-thumb]:shadow-xs **:data-[slot=slider-thumb]:ring-0"),children:X5.jsx("span",{"data-slot":"slider-marks","aria-hidden":"true",className:"absolute inset-x-2 flex items-center justify-between",children:Array.from({length:Z.length},(M,A)=>X5.jsx("span",{className:e("size-1 rounded-full",A<=K?"bg-primary-foreground/30":"bg-foreground/30")},A))})})]})]})]})}var vY=k$.memo(function({scope:Z="active-chat"}){let{workspaceId:J,layout:Q,setLayout:X}=d5(),[H]=s9(),{data:G}=m2(J),z=G?.models??[],Y=z.find((y)=>y.value==="default"),K=G?_C(z.filter((y)=>y.value!=="default"),G.provider):[],W=Z==="active-chat"?H??null:null,B=uz(J,W).data,q=VC(J),U=(W?B?.model:void 0)??Q.selectedModel,F=(W?B?.effort:void 0)??Q.selectedEffort,N=(W?B?.fastMode:void 0)??Q.selectedFastMode,L=(y)=>{if(W)q.mutate({sessionId:W,patch:{model:y}});else X({selectedModel:y})},V=(y)=>{if(W)q.mutate({sessionId:W,patch:{effort:y}});else X({selectedEffort:y})},M=(y)=>{if(W)q.mutate({sessionId:W,patch:{fastMode:y}});else X({selectedFastMode:y})};if(K.length===0)return null;let A=K.some((y)=>y.value===U)?U:void 0,O=K.find((y)=>Y?.resolvedModel&&y.resolvedModel===Y.resolvedModel)??K[0],_=A??O.value,D=K.find((y)=>y.value===_)??K[0],T=D.supportsEffort?D.supportedEffortLevels??[]:[],k=fU(T,F,D.defaultEffort),x=AC(T)&&k!==void 0,I=DC(D,N);return X5.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[X5.jsx(Qs,{current:_,model:D,models:K,onValueChange:L}),x&&X5.jsx(Xs,{currentEffort:k,effortLevels:T,fastMode:I,showFastMode:D.supportsFastMode===!0,onFastModeChange:M,onValueChange:V},D.value)]})});var v5=P(l(),1);function qE({composerRef:$,onSend:Z,onStop:J,processing:Q,sessionId:X,availability:H}){let G=mY.useRef(null),z=o5(),Y=m1((A)=>A.composerDrafts[z]??""),K=V4((A)=>A.attachments[S2(z,X)]??Hs),[W,B]=mY.useState(!1),q=K.some((A)=>A.status==="uploading"),U=K.some((A)=>A.status==="ready"),F=Y.trim().length>0||U,N=v3(F,q,H),L=(A)=>m1.getState().setComposerDraft(z,A),V=(A)=>{if(A.length===0)return;let O=M1.getState(),_=A.map((D)=>({localId:crypto.randomUUID(),name:D.name||"file",mediaType:D.type||"application/octet-stream",previewUrl:D.type.startsWith("image/")?URL.createObjectURL(D):void 0,status:"uploading"}));O.addAttachments(z,X,_),_.forEach((D,T)=>{UC(z,[A[T]]).then(([k])=>M1.getState().updateAttachment(z,X,D.localId,{status:"ready",upload:k,mediaType:k.mediaType})).catch((k)=>M1.getState().updateAttachment(z,X,D.localId,{status:"error",error:k instanceof Error?k.message:"Upload failed"}))})},M=()=>{if(!N)return;Z(Y),m1.getState().setComposerDraft(z,"")};return v5.jsxs(hz,{composerRef:$,onSubmit:(A)=>{A.preventDefault(),M()},onDragOver:(A)=>{if(!A.dataTransfer.types.includes("Files"))return;A.preventDefault(),B(!0)},onDragLeave:(A)=>{if(A.currentTarget.contains(A.relatedTarget))return;B(!1)},onDrop:(A)=>{if(!A.dataTransfer.types.includes("Files"))return;A.preventDefault(),B(!1),V(Array.from(A.dataTransfer.files))},className:e(W&&"ring-2 ring-ring/60"),children:[K.length>0&&v5.jsx("div",{className:"flex flex-wrap gap-2 px-1 pt-1 pb-0.5",children:K.map((A)=>v5.jsx(Gs,{attachment:A,onRemove:()=>M1.getState().removeAttachment(z,X,A.localId)},A.localId))}),v5.jsx(gz,{textareaRef:$,id:"chat-input",name:"message",value:Y,onChange:(A)=>L(A.target.value),onKeyDown:(A)=>{if(A.key==="Enter"&&!A.shiftKey)A.preventDefault(),M()},onPaste:(A)=>{let O=Array.from(A.clipboardData?.files??[]);if(O.length===0)return;A.preventDefault(),V(O)},placeholder:Q?"Queue a follow-up":"Do anything",rows:1}),v5.jsxs(vz,{children:[v5.jsx("input",{ref:G,type:"file",multiple:!0,hidden:!0,onChange:(A)=>{V(Array.from(A.target.files??[])),A.target.value=""}}),v5.jsx(E0,{type:"button",variant:"ghost",size:"icon",className:"mr-auto",onClick:()=>G.current?.click(),"aria-label":"Attach files",children:v5.jsx(fY,{stroke:1.5})}),v5.jsx(vY,{}),Q?v5.jsxs(r1,{children:[v5.jsx(a1,{render:v5.jsx(E0,{type:"button",size:"icon",onClick:J,"aria-label":"Stop agent",children:v5.jsx(BE,{})})}),v5.jsx(n1,{children:"Stop answering"})]}):v5.jsx(fz,{label:"Send message",hasContent:F,busy:q,availability:H})]})]})}var Hs=[];function Gs({attachment:$,onRemove:Z}){let{name:J,previewUrl:Q,status:X,error:H}=$,G=!!Q;return v5.jsxs("div",{className:e("group relative flex items-center gap-2 overflow-hidden rounded-lg border border-border bg-accent text-accent-foreground",G?"size-14":"h-10 max-w-52 pr-2 pl-2",X==="error"&&"border-destructive/50"),title:H??J,children:[G?v5.jsx("img",{src:Q,alt:J,className:"size-full object-cover"}):v5.jsxs(v5.Fragment,{children:[v5.jsx(S$,{size:16,stroke:1.75,className:"shrink-0 text-muted-foreground"}),v5.jsx("span",{className:"truncate text-xs",children:J})]}),X==="uploading"&&v5.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-background/70",children:v5.jsx(A1,{size:16,stroke:1.75,className:"animate-spin text-muted-foreground"})}),X==="error"&&v5.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-destructive/10 text-[10px] text-destructive",children:"Failed"}),v5.jsx(E0,{type:"button",variant:"ghost",size:"icon-sm",onClick:Z,"aria-label":`Remove ${J}`,className:"absolute top-0.5 right-0.5 size-4 rounded-full bg-primary/70 text-primary-foreground opacity-0 transition-opacity group-hover:opacity-100 hover:bg-primary/80 [&_svg]:size-3",children:v5.jsx(Q8,{stroke:1.75})})]})}var c3=P(l(),1);function WF({className:$,prompt:Z,disabled:J=!1,onSelect:Q}){let X=Z.icon;return c3.jsxs(E0,{type:"button",size:"sm",disabled:J,onClick:()=>Q(Z),className:e("h-auto items-start justify-start gap-2 rounded-lg p-2 px-3 text-left leading-snug whitespace-normal",$),children:[c3.jsx(X,{stroke:2,"aria-hidden":!0,className:"mt-0.5 text-muted-foreground"}),c3.jsx("span",{children:Z.label})]})}function UE({prompts:$,disabled:Z=!1,onSelect:J}){return c3.jsx("div",{className:"row-gap-2 grid w-full grid-cols-1 gap-x-3 gap-y-2 py-2 @md:grid-cols-3",children:$.map((Q,X)=>{return c3.jsx(WF,{prompt:Q,disabled:Z,onSelect:J,className:e("h-full w-fit @md:w-full",X===0&&"@md:translate-y-3 @md:rotate-3 @md:hover:translate-y-2.5",X===1&&"@md:-rotate-1",X===2&&"@md:translate-y-3 @md:-rotate-4 @md:hover:translate-y-2.5")},Q.prompt)})})}var _1=P(l(),1),BF="Keep the final reply brief and user-facing. Do not include file or storage links, file paths, or bundle, test, and runtime-log summaries.",zs=[{label:"What's the weather?",prompt:"Build me a set of weather widgets that surface current conditions, today's hourly forecast, and a simple weekly outlook at a glance",context:["Build this onboarding example immediately without asking follow-up questions.","Create three separate widgets: current conditions, today's hourly forecast, and a seven-day outlook.","Use one shared Open-Meteo server function with no API key and use Berlin as the default location.","Give each widget an appropriate grid size and a compact, visually distinct layout with loading, error, and last-updated states.","Bundle all three widgets, smoke-test the shared weather function, and check runtime logs before finishing.",BF],icon:NE},{label:"Build a fun synthesizer",prompt:"Build me a view with a simple, playful synthesizer featuring a keyboard, five sound controls, and the ability to record, save, and load music files from the workspace",context:["Build this onboarding example immediately without asking follow-up questions, and don't use external services.","Create a responsive View that uses the browser's audio capabilities, with an onscreen piano and computer-keyboard controls.","Include five clearly labeled sound controls for waveform, attack, release, filter cutoff, and volume.","Let the user record timed note events, play and stop recordings, give them names, and save and load them as JSON music files in a workspace music folder.","Include clear empty and error states, then bundle the View and check runtime logs before finishing.",BF],icon:cY},{label:"Make a job tracker",prompt:"Build me a view with a visual job search board where I can add opportunities by pasting a job link, automatically extract the details, move opportunities through stages, and keep notes and related files in the workspace",context:["Build this onboarding example immediately without asking follow-up questions.","Create a visual View with Saved, Applied, Interviewing, Offer, and Closed stages.","Let the user add a job by pasting its URL, and use a server function to parse public metadata for the title, company, and location.","When a page blocks parsing or lacks metadata, keep the URL and provide editable manual fields.","Support moving opportunities between stages, editing their details and notes, and referencing related workspace files.","Persist the board in a workspace-local JSON file and include loading, empty, and error states.","Bundle the View and smoke-test its persistence and parsing functions before finishing.",BF],icon:pY}],Ys={label:"Explore the workspace",prompt:"Explore this workspace and suggest what moi can build based on its content",context:["Explore the existing workspace files before making suggestions.","Briefly explain what the workspace appears to be for and which content informed your ideas.","Propose a focused set of useful widgets or views that fit the work already here.","Wait for me to choose before building anything."],icon:FE};function VE({hasSentMessageFromMoi:$,isWorkspacePendingAnalysis:Z}){if(!$)return"chat-welcome";if(Z)return"workspace-welcome";return"empty"}var qF=e("flex flex-1 flex-col items-center justify-center");function LE({kind:$,disabled:Z=!1,onSelectPrompt:J}){if($==="chat-welcome")return _1.jsx(Ks,{disabled:Z,onSelectPrompt:J});if($==="workspace-welcome")return _1.jsx(Ws,{disabled:Z,onSelectPrompt:J});return _1.jsx(Bs,{})}function Ks({disabled:$=!1,onSelectPrompt:Z}){return _1.jsxs("div",{className:e(qF,"@container w-full max-w-md min-w-0"),children:[_1.jsxs("div",{className:"prose prose-sm min-w-0 wrap-anywhere prose-inherit",children:[_1.jsx("p",{children:"moi is the visual workspace for you and your agent. It grows and adapts to the work you're doing."}),_1.jsxs("p",{children:["Ask ",_1.jsx(uY,{Icon:F$,children:"Agent"})," to build"," ",_1.jsx(uY,{Icon:qQ,children:"Widgets"})," that surface information and quick actions, or entire ",_1.jsx(uY,{Icon:BQ,children:"Views"})," for more complex tools. Use ",_1.jsx(uY,{Icon:UQ,children:"Scratchpad"})," for exploring and shaping ideas with your agent."]}),_1.jsx("p",{children:"Give it a try:"})]}),_1.jsx(UE,{prompts:zs,disabled:$,onSelect:Z})]})}function Ws({disabled:$=!1,onSelectPrompt:Z}){return _1.jsxs("div",{className:e(qF,"gap-2"),children:[_1.jsx("div",{className:"prose prose-sm max-w-60 min-w-0 text-center wrap-anywhere text-muted-foreground prose-inherit",children:_1.jsx("p",{children:"See what moi can build for you"})}),_1.jsx(WF,{prompt:Ys,disabled:$,onSelect:Z})]})}function Bs(){return _1.jsx("div",{className:e(qF,"gap-1 text-center"),children:_1.jsx("p",{className:"mx-auto max-w-sm px-8 text-sm text-muted-foreground",children:"Chat with your agent, create widgets and views, and manage your workspace context from here"})})}function uY({Icon:$,children:Z}){return _1.jsxs("strong",{className:"inline-flex items-center gap-0.5 align-bottom font-medium",children:[_1.jsx($,{size:16,stroke:2,"aria-hidden":!0}),Z]})}var FQ=P(v(),1);var w5=P(l(),1);function qs($){if($.flavor==="cron"||$.flavor==="subagent")return $.flavor;let Z=$.origin?.provider.trim().toLowerCase();return Z?Z:null}function Us({active:$,canArchive:Z,confirmingArchive:J,onArchive:Q,onRequestArchive:X,onSelect:H,session:G,workspaceId:z}){let Y=FQ.useRef(!1),[K,W]=FQ.useState(!1),B=V4((N)=>dH(N.activity,z,G.sessionId)),q=qs(G);function U(){X(G.sessionId)}async function F(){if(Y.current)return;Y.current=!0,W(!0);try{await Q(G.sessionId)}catch{S7.add({title:"Couldn’t archive chat",type:"error"})}finally{Y.current=!1,W(!1)}}return w5.jsxs("div",{className:"group/chat relative",children:[w5.jsx(HQ,{className:e("font-medium group-hover/chat:bg-accent group-hover/chat:text-accent-foreground",$&&"bg-accent text-accent-foreground"),onClick:()=>H(G.sessionId),children:w5.jsx("div",{className:e("flex min-w-0 flex-1 overflow-hidden",(B||K)&&"mr-4 mask-r-from-[calc(100%-16px)]",Z&&!J&&"group-focus-within/chat:mr-4 group-focus-within/chat:mask-r-from-[calc(100%-16px)] group-hover/chat:mr-4 group-hover/chat:mask-r-from-[calc(100%-16px)] [@media(hover:none)]:mr-4 [@media(hover:none)]:mask-r-from-[calc(100%-16px)]",J&&"mr-14 mask-r-from-[calc(100%-16px)]"),children:w5.jsxs("span",{className:e("flex min-w-0 items-baseline gap-1.5",(B||K)&&"-mr-4",J?"-mr-14":Z&&"group-focus-within/chat:-mr-4 group-hover/chat:-mr-4 [@media(hover:none)]:-mr-4"),children:[w5.jsx("span",{className:"min-w-0 truncate",children:G.summary}),q&&w5.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:q})]})})}),B&&w5.jsx(K2,{className:e("pointer-events-none absolute top-1/2 right-1.5 -translate-y-1/2 text-muted-foreground",Z&&"group-focus-within/chat:hidden group-hover/chat:hidden [@media(hover:none)]:hidden",(J||K)&&"hidden")}),Z&&w5.jsx("div",{className:e("absolute top-1/2 right-0 flex -translate-y-1/2 items-center opacity-100 transition-none",!J&&"group-focus-within/chat:opacity-100 group-hover/chat:opacity-100 [@media(hover:hover)]:opacity-0",K&&"opacity-100!"),children:J?w5.jsx(E0,{type:"button",variant:"secondary",size:"sm","aria-label":`Confirm archive ${G.summary}`,tabIndex:-1,className:"mr-1 h-5 rounded-sm px-1.5 text-xs hover:bg-accent",disabled:K,onClick:F,onPointerDown:(N)=>N.stopPropagation(),children:"Confirm"}):w5.jsxs(r1,{children:[w5.jsx(a1,{render:w5.jsx(E0,{type:"button",variant:"ghost",size:"icon-sm","aria-label":`Archive ${G.summary}`,tabIndex:-1,className:"text-muted-foreground hover:bg-transparent hover:text-foreground",disabled:K,onClick:U,onPointerDown:(N)=>N.stopPropagation(),children:w5.jsx(AE,{stroke:1.75})})}),w5.jsx(n1,{side:"right",children:"Archive chat"})]})})]})}function Fs($){return`${$.getFullYear()}-${$.getMonth()}-${$.getDate()}`}function ME($){return Date.UTC($.getFullYear(),$.getMonth(),$.getDate())/86400000}function Ns($,Z){let J=ME(Z)-ME($);if(J===0)return"Today";if(J===1)return"Yesterday";if(J>=2&&J<=5)return`${J} days ago`;return $.toLocaleDateString([],{month:"short",day:"numeric",...$.getFullYear()===Z.getFullYear()?{}:{year:"numeric"}})}function Vs($,Z=new Date){let J=new Map;for(let Q of $.slice().sort((X,H)=>H.lastModified-X.lastModified)){let X=new Date(Q.lastModified),H=Fs(X),G=J.get(H);if(G){G.sessions.push(Q);continue}J.set(H,{key:H,label:Ns(X,Z),sessions:[Q]})}return[...J.values()]}function _E({onSelectSession:$,selectedSessionId:Z}){let J=o5(),[Q,X]=FQ.useState(null),{data:H=[]}=mz(J),G=m2(J).data?.supportsArchiving===!0,z=FC(J),Y=V4((N)=>P_(N.activity,J,Z)),W=H.find((N)=>N.sessionId===Z)?.summary??"New chat",B=Vs(H);function q(N){$(N)}function U(N){if(!N)X(null)}async function F(N){X(null),await z.mutateAsync(N);let L=M1.getState();if(L.clearAttachments(J,N),L.clearPreviewsForSession(J,N),Z===N)$(null)}return w5.jsxs(O$,{onOpenChange:U,children:[w5.jsx(P$,{render:w5.jsxs(E0,{className:"group",variant:"ghost",size:"sm",children:[w5.jsx("span",{className:"max-w-64 truncate",children:W}),Y?w5.jsx(K2,{className:"size-4!",stroke:2}):w5.jsx(dY,{className:"text-muted-foreground group-hover:text-foreground",stroke:1.75})]})}),w5.jsxs(w$,{align:"start",className:"flex max-h-100 w-max max-w-72 min-w-40 flex-col overflow-hidden",children:[w5.jsxs(HQ,{className:"shrink-0 gap-1 font-medium text-muted-foreground! **:text-muted-foreground!",onClick:()=>q(null),children:[w5.jsx(DE,{size:16,stroke:1.75}),"New chat"]}),B.length>0&&w5.jsxs(w5.Fragment,{children:[w5.jsx(NT,{className:"shrink-0"}),w5.jsx("div",{className:"no-scrollbar flex min-h-0 flex-1 scroll-fade flex-col gap-1 overflow-y-auto overscroll-contain [--scroll-fade-reveal:8px]",children:B.map((N)=>w5.jsxs(j$,{children:[w5.jsx(MY,{children:N.label}),N.sessions.map((L)=>w5.jsx(Us,{session:L,active:Z===L.sessionId,canArchive:G,confirmingArchive:Q===L.sessionId,onSelect:q,onArchive:F,onRequestArchive:X,workspaceId:J},L.sessionId))]},N.key))})]})]})]})}var yy=P(v(),1);function R5(){}function lY(){}function OE($,Z){let J=Z||{};return($[$.length-1]===""?[...$,""]:$).join((J.padRight?" ":"")+","+(J.padLeft===!1?"":" ")).trim()}var Ls=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ms=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,As={};function iY($,Z){return((Z||As).jsx?Ms:Ls).test($)}var Ds=/[ \t\n\f\r]/g;function UF($){return typeof $==="object"?$.type==="text"?PE($.value):!1:PE($)}function PE($){return $.replace(Ds,"")===""}class P6{constructor($,Z,J){if(this.normal=Z,this.property=$,J)this.space=J}}P6.prototype.normal={};P6.prototype.property={};P6.prototype.space=void 0;function FF($,Z){let J={},Q={};for(let X of $)Object.assign(J,X.property),Object.assign(Q,X.normal);return new P6(J,Q,Z)}function NQ($){return $.toLowerCase()}class N8{constructor($,Z){this.attribute=Z,this.property=$}}N8.prototype.attribute="";N8.prototype.booleanish=!1;N8.prototype.boolean=!1;N8.prototype.commaOrSpaceSeparated=!1;N8.prototype.commaSeparated=!1;N8.prototype.defined=!1;N8.prototype.mustUseProperty=!1;N8.prototype.number=!1;N8.prototype.overloadedBoolean=!1;N8.prototype.property="";N8.prototype.spaceSeparated=!1;N8.prototype.space=void 0;var VQ={};S4(VQ,{spaceSeparated:()=>f5,overloadedBoolean:()=>rY,number:()=>_0,commaSeparated:()=>w6,commaOrSpaceSeparated:()=>H4,booleanish:()=>E1,boolean:()=>Q5});var _s=0,Q5=d3(),E1=d3(),rY=d3(),_0=d3(),f5=d3(),w6=d3(),H4=d3();function d3(){return 2**++_s}var NF=Object.keys(VQ);class b$ extends N8{constructor($,Z,J,Q){let X=-1;super($,Z);if(wE(this,"space",Q),typeof J==="number")while(++X<NF.length){let H=NF[X];wE(this,NF[X],(J&VQ[H])===VQ[H])}}}b$.prototype.defined=!0;function wE($,Z,J){if(J)$[Z]=J}function a4($){let Z={},J={};for(let[Q,X]of Object.entries($.properties)){let H=new b$(Q,$.transform($.attributes||{},Q),X,$.space);if($.mustUseProperty&&$.mustUseProperty.includes(Q))H.mustUseProperty=!0;Z[Q]=H,J[NQ(Q)]=Q,J[NQ(H.attribute)]=Q}return new P6(Z,J,$.space)}var VF=a4({properties:{ariaActiveDescendant:null,ariaAtomic:E1,ariaAutoComplete:null,ariaBusy:E1,ariaChecked:E1,ariaColCount:_0,ariaColIndex:_0,ariaColSpan:_0,ariaControls:f5,ariaCurrent:null,ariaDescribedBy:f5,ariaDetails:null,ariaDisabled:E1,ariaDropEffect:f5,ariaErrorMessage:null,ariaExpanded:E1,ariaFlowTo:f5,ariaGrabbed:E1,ariaHasPopup:null,ariaHidden:E1,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:f5,ariaLevel:_0,ariaLive:null,ariaModal:E1,ariaMultiLine:E1,ariaMultiSelectable:E1,ariaOrientation:null,ariaOwns:f5,ariaPlaceholder:null,ariaPosInSet:_0,ariaPressed:E1,ariaReadOnly:E1,ariaRelevant:null,ariaRequired:E1,ariaRoleDescription:f5,ariaRowCount:_0,ariaRowIndex:_0,ariaRowSpan:_0,ariaSelected:E1,ariaSetSize:_0,ariaSort:null,ariaValueMax:_0,ariaValueMin:_0,ariaValueNow:_0,ariaValueText:null,role:null},transform($,Z){return Z==="role"?Z:"aria-"+Z.slice(4).toLowerCase()}});function aY($,Z){return Z in $?$[Z]:Z}function nY($,Z){return aY($,Z.toLowerCase())}var jE=a4({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:w6,acceptCharset:f5,accessKey:f5,action:null,allow:null,allowFullScreen:Q5,allowPaymentRequest:Q5,allowUserMedia:Q5,alt:null,as:null,async:Q5,autoCapitalize:null,autoComplete:f5,autoFocus:Q5,autoPlay:Q5,blocking:f5,capture:null,charSet:null,checked:Q5,cite:null,className:f5,cols:_0,colSpan:null,content:null,contentEditable:E1,controls:Q5,controlsList:f5,coords:_0|w6,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Q5,defer:Q5,dir:null,dirName:null,disabled:Q5,download:rY,draggable:E1,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Q5,formTarget:null,headers:f5,height:_0,hidden:rY,high:_0,href:null,hrefLang:null,htmlFor:f5,httpEquiv:f5,id:null,imageSizes:null,imageSrcSet:null,inert:Q5,inputMode:null,integrity:null,is:null,isMap:Q5,itemId:null,itemProp:f5,itemRef:f5,itemScope:Q5,itemType:f5,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Q5,low:_0,manifest:null,max:null,maxLength:_0,media:null,method:null,min:null,minLength:_0,multiple:Q5,muted:Q5,name:null,nonce:null,noModule:Q5,noValidate:Q5,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Q5,optimum:_0,pattern:null,ping:f5,placeholder:null,playsInline:Q5,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Q5,referrerPolicy:null,rel:f5,required:Q5,reversed:Q5,rows:_0,rowSpan:_0,sandbox:f5,scope:null,scoped:Q5,seamless:Q5,selected:Q5,shadowRootClonable:Q5,shadowRootDelegatesFocus:Q5,shadowRootMode:null,shape:null,size:_0,sizes:null,slot:null,span:_0,spellCheck:E1,src:null,srcDoc:null,srcLang:null,srcSet:null,start:_0,step:null,style:null,tabIndex:_0,target:null,title:null,translate:null,type:null,typeMustMatch:Q5,useMap:null,value:E1,width:_0,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:f5,axis:null,background:null,bgColor:null,border:_0,borderColor:null,bottomMargin:_0,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Q5,declare:Q5,event:null,face:null,frame:null,frameBorder:null,hSpace:_0,leftMargin:_0,link:null,longDesc:null,lowSrc:null,marginHeight:_0,marginWidth:_0,noResize:Q5,noHref:Q5,noShade:Q5,noWrap:Q5,object:null,profile:null,prompt:null,rev:null,rightMargin:_0,rules:null,scheme:null,scrolling:E1,standby:null,summary:null,text:null,topMargin:_0,valueType:null,version:null,vAlign:null,vLink:null,vSpace:_0,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Q5,disableRemotePlayback:Q5,prefix:null,property:null,results:_0,security:null,unselectable:null},space:"html",transform:nY});var CE=a4({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:H4,accentHeight:_0,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:_0,amplitude:_0,arabicForm:null,ascent:_0,attributeName:null,attributeType:null,azimuth:_0,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:_0,by:null,calcMode:null,capHeight:_0,className:f5,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:_0,diffuseConstant:_0,direction:null,display:null,dur:null,divisor:_0,dominantBaseline:null,download:Q5,dx:null,dy:null,edgeMode:null,editable:null,elevation:_0,enableBackground:null,end:null,event:null,exponent:_0,externalResourcesRequired:null,fill:null,fillOpacity:_0,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:w6,g2:w6,glyphName:w6,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:_0,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:_0,horizOriginX:_0,horizOriginY:_0,id:null,ideographic:_0,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:_0,k:_0,k1:_0,k2:_0,k3:_0,k4:_0,kernelMatrix:H4,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:_0,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:_0,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:_0,overlineThickness:_0,paintOrder:null,panose1:null,path:null,pathLength:_0,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:f5,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:_0,pointsAtY:_0,pointsAtZ:_0,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:H4,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:H4,rev:H4,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:H4,requiredFeatures:H4,requiredFonts:H4,requiredFormats:H4,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:_0,specularExponent:_0,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:_0,strikethroughThickness:_0,string:null,stroke:null,strokeDashArray:H4,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:_0,strokeOpacity:_0,strokeWidth:null,style:null,surfaceScale:_0,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:H4,tabIndex:_0,tableValues:null,target:null,targetX:_0,targetY:_0,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:H4,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:_0,underlineThickness:_0,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:_0,values:null,vAlphabetic:_0,vMathematical:_0,vectorEffect:null,vHanging:_0,vIdeographic:_0,version:null,vertAdvY:_0,vertOriginX:_0,vertOriginY:_0,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:_0,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:aY});var LF=a4({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform($,Z){return"xlink:"+Z.slice(5).toLowerCase()}});var MF=a4({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:nY});var AF=a4({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform($,Z){return"xml:"+Z.slice(3).toLowerCase()}});var DF={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"};var Os=/[A-Z]/g,TE=/-[a-z]/g,Ps=/^data[-\w.:]+$/i;function _F($,Z){let J=NQ(Z),Q=Z,X=N8;if(J in $.normal)return $.property[$.normal[J]];if(J.length>4&&J.slice(0,4)==="data"&&Ps.test(Z)){if(Z.charAt(4)==="-"){let H=Z.slice(5).replace(TE,js);Q="data"+H.charAt(0).toUpperCase()+H.slice(1)}else{let H=Z.slice(4);if(!TE.test(H)){let G=H.replace(Os,ws);if(G.charAt(0)!=="-")G="-"+G;Z="data"+G}}X=b$}return new X(Q,Z)}function ws($){return"-"+$.toLowerCase()}function js($){return $.charAt(1).toUpperCase()}var EE=FF([VF,jE,LF,MF,AF],"html"),sY=FF([VF,CE,LF,MF,AF],"svg");function IE($){return $.join(" ").trim()}var iE=P(pE(),1);var oY=cE("end"),y$=cE("start");function cE($){return Z;function Z(J){let Q=J&&J.position&&J.position[$]||{};if(typeof Q.line==="number"&&Q.line>0&&typeof Q.column==="number"&&Q.column>0)return{line:Q.line,column:Q.column,offset:typeof Q.offset==="number"&&Q.offset>-1?Q.offset:void 0}}}function wF($){let Z=y$($),J=oY($);if(Z&&J)return{start:Z,end:J}}function j6($){if(!$||typeof $!=="object")return"";if("position"in $||"type"in $)return dE($.position);if("start"in $||"end"in $)return dE($);if("line"in $||"column"in $)return jF($);return""}function jF($){return lE($&&$.line)+":"+lE($&&$.column)}function dE($){return jF($&&$.start)+"-"+jF($&&$.end)}function lE($){return $&&typeof $==="number"?$:1}class c1 extends Error{constructor($,Z,J){super();if(typeof Z==="string")J=Z,Z=void 0;let Q="",X={},H=!1;if(Z)if("line"in Z&&"column"in Z)X={place:Z};else if("start"in Z&&"end"in Z)X={place:Z};else if("type"in Z)X={ancestors:[Z],place:Z.position};else X={...Z};if(typeof $==="string")Q=$;else if(!X.cause&&$)H=!0,Q=$.message,X.cause=$;if(!X.ruleId&&!X.source&&typeof J==="string"){let z=J.indexOf(":");if(z===-1)X.ruleId=J;else X.source=J.slice(0,z),X.ruleId=J.slice(z+1)}if(!X.place&&X.ancestors&&X.ancestors){let z=X.ancestors[X.ancestors.length-1];if(z)X.place=z.position}let G=X.place&&"start"in X.place?X.place.start:X.place;this.ancestors=X.ancestors||void 0,this.cause=X.cause||void 0,this.column=G?G.column:void 0,this.fatal=void 0,this.file="",this.message=Q,this.line=G?G.line:void 0,this.name=j6(X.place)||"1:1",this.place=X.place||void 0,this.reason=this.message,this.ruleId=X.ruleId||void 0,this.source=X.source||void 0,this.stack=H&&X.cause&&typeof X.cause.stack==="string"?X.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}c1.prototype.file="";c1.prototype.name="";c1.prototype.reason="";c1.prototype.message="";c1.prototype.stack="";c1.prototype.column=void 0;c1.prototype.line=void 0;c1.prototype.ancestors=void 0;c1.prototype.cause=void 0;c1.prototype.fatal=void 0;c1.prototype.place=void 0;c1.prototype.ruleId=void 0;c1.prototype.source=void 0;var CF={}.hasOwnProperty,os=new Map,ts=/[A-Z]/g,es=new Set(["table","tbody","thead","tfoot","tr"]),$o=new Set(["td","th"]),rE="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function TF($,Z){if(!Z||Z.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let J=Z.filePath||void 0,Q;if(Z.development){if(typeof Z.jsxDEV!=="function")throw TypeError("Expected `jsxDEV` in options when `development: true`");Q=Yo(J,Z.jsxDEV)}else{if(typeof Z.jsx!=="function")throw TypeError("Expected `jsx` in production options");if(typeof Z.jsxs!=="function")throw TypeError("Expected `jsxs` in production options");Q=zo(J,Z.jsx,Z.jsxs)}let X={Fragment:Z.Fragment,ancestors:[],components:Z.components||{},create:Q,elementAttributeNameCase:Z.elementAttributeNameCase||"react",evaluater:Z.createEvaluater?Z.createEvaluater():void 0,filePath:J,ignoreInvalidStyle:Z.ignoreInvalidStyle||!1,passKeys:Z.passKeys!==!1,passNode:Z.passNode||!1,schema:Z.space==="svg"?sY:EE,stylePropertyNameCase:Z.stylePropertyNameCase||"dom",tableCellAlignToStyle:Z.tableCellAlignToStyle!==!1},H=aE(X,$,void 0);if(H&&typeof H!=="string")return H;return X.create($,X.Fragment,{children:H||void 0},void 0)}function aE($,Z,J){if(Z.type==="element")return Zo($,Z,J);if(Z.type==="mdxFlowExpression"||Z.type==="mdxTextExpression")return Jo($,Z);if(Z.type==="mdxJsxFlowElement"||Z.type==="mdxJsxTextElement")return Xo($,Z,J);if(Z.type==="mdxjsEsm")return Qo($,Z);if(Z.type==="root")return Ho($,Z,J);if(Z.type==="text")return Go($,Z)}function Zo($,Z,J){let Q=$.schema,X=Q;if(Z.tagName.toLowerCase()==="svg"&&Q.space==="html")X=sY,$.schema=X;$.ancestors.push(Z);let H=sE($,Z.tagName,!1),G=Ko($,Z),z=IF($,Z);if(es.has(Z.tagName))z=z.filter(function(Y){return typeof Y==="string"?!UF(Y):!0});return nE($,G,H,Z),EF(G,z),$.ancestors.pop(),$.schema=Q,$.create(Z,H,G,J)}function Jo($,Z){if(Z.data&&Z.data.estree&&$.evaluater){let Q=Z.data.estree.body[0];return R5(Q.type==="ExpressionStatement"),$.evaluater.evaluateExpression(Q.expression)}MQ($,Z.position)}function Qo($,Z){if(Z.data&&Z.data.estree&&$.evaluater)return $.evaluater.evaluateProgram(Z.data.estree);MQ($,Z.position)}function Xo($,Z,J){let Q=$.schema,X=Q;if(Z.name==="svg"&&Q.space==="html")X=sY,$.schema=X;$.ancestors.push(Z);let H=Z.name===null?$.Fragment:sE($,Z.name,!0),G=Wo($,Z),z=IF($,Z);return nE($,G,H,Z),EF(G,z),$.ancestors.pop(),$.schema=Q,$.create(Z,H,G,J)}function Ho($,Z,J){let Q={};return EF(Q,IF($,Z)),$.create(Z,$.Fragment,Q,J)}function Go($,Z){return Z.value}function nE($,Z,J,Q){if(typeof J!=="string"&&J!==$.Fragment&&$.passNode)Z.node=Q}function EF($,Z){if(Z.length>0){let J=Z.length>1?Z:Z[0];if(J)$.children=J}}function zo($,Z,J){return Q;function Q(X,H,G,z){let K=Array.isArray(G.children)?J:Z;return z?K(H,G,z):K(H,G)}}function Yo($,Z){return J;function J(Q,X,H,G){let z=Array.isArray(H.children),Y=y$(Q);return Z(X,H,G,z,{columnNumber:Y?Y.column-1:void 0,fileName:$,lineNumber:Y?Y.line:void 0},void 0)}}function Ko($,Z){let J={},Q,X;for(X in Z.properties)if(X!=="children"&&CF.call(Z.properties,X)){let H=Bo($,X,Z.properties[X]);if(H){let[G,z]=H;if($.tableCellAlignToStyle&&G==="align"&&typeof z==="string"&&$o.has(Z.tagName))Q=z;else J[G]=z}}if(Q){let H=J.style||(J.style={});H[$.stylePropertyNameCase==="css"?"text-align":"textAlign"]=Q}return J}function Wo($,Z){let J={};for(let Q of Z.attributes)if(Q.type==="mdxJsxExpressionAttribute")if(Q.data&&Q.data.estree&&$.evaluater){let H=Q.data.estree.body[0];R5(H.type==="ExpressionStatement");let G=H.expression;R5(G.type==="ObjectExpression");let z=G.properties[0];R5(z.type==="SpreadElement"),Object.assign(J,$.evaluater.evaluateExpression(z.argument))}else MQ($,Z.position);else{let X=Q.name,H;if(Q.value&&typeof Q.value==="object")if(Q.value.data&&Q.value.data.estree&&$.evaluater){let z=Q.value.data.estree.body[0];R5(z.type==="ExpressionStatement"),H=$.evaluater.evaluateExpression(z.expression)}else MQ($,Z.position);else H=Q.value===null?!0:Q.value;J[X]=H}return J}function IF($,Z){let J=[],Q=-1,X=$.passKeys?new Map:os;while(++Q<Z.children.length){let H=Z.children[Q],G;if($.passKeys){let Y=H.type==="element"?H.tagName:H.type==="mdxJsxFlowElement"||H.type==="mdxJsxTextElement"?H.name:void 0;if(Y){let K=X.get(Y)||0;G=Y+"-"+K,X.set(Y,K+1)}}let z=aE($,H,G);if(z!==void 0)J.push(z)}return J}function Bo($,Z,J){let Q=_F($.schema,Z);if(J===null||J===void 0||typeof J==="number"&&Number.isNaN(J))return;if(Array.isArray(J))J=Q.commaSeparated?OE(J):IE(J);if(Q.property==="style"){let X=typeof J==="object"?J:qo($,String(J));if($.stylePropertyNameCase==="css")X=Uo(X);return["style",X]}return[$.elementAttributeNameCase==="react"&&Q.space?DF[Q.property]||Q.property:Q.attribute,J]}function qo($,Z){try{return iE.default(Z,{reactCompat:!0})}catch(J){if($.ignoreInvalidStyle)return{};let Q=J,X=new c1("Cannot parse `style` attribute",{ancestors:$.ancestors,cause:Q,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw X.file=$.filePath||void 0,X.url=rE+"#cannot-parse-style-attribute",X}}function sE($,Z,J){let Q;if(!J)Q={type:"Literal",value:Z};else if(Z.includes(".")){let X=Z.split("."),H=-1,G;while(++H<X.length){let z=iY(X[H])?{type:"Identifier",name:X[H]}:{type:"Literal",value:X[H]};G=G?{type:"MemberExpression",object:G,property:z,computed:Boolean(H&&z.type==="Literal"),optional:!1}:z}R5(G,"always a result"),Q=G}else Q=iY(Z)&&!/^[a-z]/.test(Z)?{type:"Identifier",name:Z}:{type:"Literal",value:Z};if(Q.type==="Literal"){let X=Q.value;return CF.call($.components,X)?$.components[X]:X}if($.evaluater)return $.evaluater.evaluateExpression(Q);MQ($)}function MQ($,Z){let J=new c1("Cannot handle MDX estrees without `createEvaluater`",{ancestors:$.ancestors,place:Z,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw J.file=$.filePath||void 0,J.url=rE+"#cannot-handle-mdx-estrees-without-createevaluater",J}function Uo($){let Z={},J;for(J in $)if(CF.call($,J))Z[Fo(J)]=$[J];return Z}function Fo($){let Z=$.replace(ts,No);if(Z.slice(0,3)==="ms-")Z="-"+Z;return Z}function No($){return"-"+$.toLowerCase()}var AQ={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]};var p$=P(l(),1),AR=P(v(),1);var Vo={};function i3($,Z){let J=Z||Vo,Q=typeof J.includeImageAlt==="boolean"?J.includeImageAlt:!0,X=typeof J.includeHtml==="boolean"?J.includeHtml:!0;return tE($,Q,X)}function tE($,Z,J){if(Lo($)){if("value"in $)return $.type==="html"&&!J?"":$.value;if(Z&&"alt"in $&&$.alt)return $.alt;if("children"in $)return oE($.children,Z,J)}if(Array.isArray($))return oE($,Z,J);return""}function oE($,Z,J){let Q=[],X=-1;while(++X<$.length)Q[X]=tE($[X],Z,J);return Q.join("")}function Lo($){return Boolean($&&typeof $==="object")}var eE=document.createElement("i");function x$($){let Z="&"+$+";";eE.innerHTML=Z;let J=eE.textContent;if(J.charCodeAt(J.length-1)===59&&$!=="semi")return!1;return J===Z?!1:J}function b1($,Z,J,Q){let X=$.length,H=0,G;if(Z<0)Z=-Z>X?0:X+Z;else Z=Z>X?X:Z;if(J=J>0?J:0,Q.length<1e4)G=Array.from(Q),G.unshift(Z,J),$.splice(...G);else{if(J)$.splice(Z,J);while(H<Q.length)G=Q.slice(H,H+1e4),G.unshift(Z,0),$.splice(...G),H+=1e4,Z+=1e4}}function c8($,Z){if($.length>0)return b1($,$.length,0,Z),$;return Z}var $I={}.hasOwnProperty;function tY($){let Z={},J=-1;while(++J<$.length)Mo(Z,$[J]);return Z}function Mo($,Z){let J;for(J in Z){let X=($I.call($,J)?$[J]:void 0)||($[J]={}),H=Z[J],G;if(H)for(G in H){if(!$I.call(X,G))X[G]=[];let z=H[G];Ao(X[G],Array.isArray(z)?z:z?[z]:[])}}}function Ao($,Z){let J=-1,Q=[];while(++J<Z.length)(Z[J].add==="after"?$:Q).push(Z[J]);b1($,0,0,Q)}function eY($,Z){let J=Number.parseInt($,Z);if(J<9||J===11||J>13&&J<32||J>126&&J<160||J>55295&&J<57344||J>64975&&J<65008||(J&65535)===65535||(J&65535)===65534||J>1114111)return"�";return String.fromCodePoint(J)}function b8($){return $.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var t1=C6(/[A-Za-z]/),I1=C6(/[\dA-Za-z]/),ZI=C6(/[#-'*+\--9=?A-Z^-~]/);function r3($){return $!==null&&($<32||$===127)}var DQ=C6(/\d/),JI=C6(/[\dA-Fa-f]/),QI=C6(/[!-/:-@[-`{-~]/);function S0($){return $!==null&&$<-2}function q5($){return $!==null&&($<0||$===32)}function i0($){return $===-2||$===-1||$===32}var a3=C6(/\p{P}|\p{S}/u),d2=C6(/\s/);function C6($){return Z;function Z(J){return J!==null&&J>-1&&$.test(String.fromCharCode(J))}}function n4($){let Z=[],J=-1,Q=0,X=0;while(++J<$.length){let H=$.charCodeAt(J),G="";if(H===37&&I1($.charCodeAt(J+1))&&I1($.charCodeAt(J+2)))X=2;else if(H<128){if(!/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(H)))G=String.fromCharCode(H)}else if(H>55295&&H<57344){let z=$.charCodeAt(J+1);if(H<56320&&z>56319&&z<57344)G=String.fromCharCode(H,z),X=1;else G="�"}else G=String.fromCharCode(H);if(G)Z.push($.slice(Q,J),encodeURIComponent(G)),Q=J+X+1,G="";if(X)J+=X,X=0}return Z.join("")+$.slice(Q)}function d0($,Z,J,Q){let X=Q?Q-1:Number.POSITIVE_INFINITY,H=0;return G;function G(Y){if(i0(Y))return $.enter(J),z(Y);return Z(Y)}function z(Y){if(i0(Y)&&H++<X)return $.consume(Y),z;return $.exit(J),Z(Y)}}var XI={tokenize:Do};function Do($){let Z=$.attempt(this.parser.constructs.contentInitial,Q,X),J;return Z;function Q(z){if(z===null){$.consume(z);return}return $.enter("lineEnding"),$.consume(z),$.exit("lineEnding"),d0($,Z,"linePrefix")}function X(z){return $.enter("paragraph"),H(z)}function H(z){let Y=$.enter("chunkText",{contentType:"text",previous:J});if(J)J.next=Y;return J=Y,G(z)}function G(z){if(z===null){$.exit("chunkText"),$.exit("paragraph"),$.consume(z);return}if(S0(z))return $.consume(z),$.exit("chunkText"),H;return $.consume(z),G}}var GI={tokenize:_o},HI={tokenize:Oo};function _o($){let Z=this,J=[],Q=0,X,H,G;return z;function z(A){if(Q<J.length){let O=J[Q];return Z.containerState=O[1],$.attempt(O[0].continuation,Y,K)(A)}return K(A)}function Y(A){if(Q++,Z.containerState._closeFlow){if(Z.containerState._closeFlow=void 0,X)M();let O=Z.events.length,_=O,D;while(_--)if(Z.events[_][0]==="exit"&&Z.events[_][1].type==="chunkFlow"){D=Z.events[_][1].end;break}V(Q);let T=O;while(T<Z.events.length)Z.events[T][1].end={...D},T++;return b1(Z.events,_+1,0,Z.events.slice(O)),Z.events.length=T,K(A)}return z(A)}function K(A){if(Q===J.length){if(!X)return q(A);if(X.currentConstruct&&X.currentConstruct.concrete)return F(A);Z.interrupt=Boolean(X.currentConstruct&&!X._gfmTableDynamicInterruptHack)}return Z.containerState={},$.check(HI,W,B)(A)}function W(A){if(X)M();return V(Q),q(A)}function B(A){return Z.parser.lazy[Z.now().line]=Q!==J.length,G=Z.now().offset,F(A)}function q(A){return Z.containerState={},$.attempt(HI,U,F)(A)}function U(A){return Q++,J.push([Z.currentConstruct,Z.containerState]),q(A)}function F(A){if(A===null){if(X)M();V(0),$.consume(A);return}return X=X||Z.parser.flow(Z.now()),$.enter("chunkFlow",{_tokenizer:X,contentType:"flow",previous:H}),N(A)}function N(A){if(A===null){L($.exit("chunkFlow"),!0),V(0),$.consume(A);return}if(S0(A))return $.consume(A),L($.exit("chunkFlow")),Q=0,Z.interrupt=void 0,z;return $.consume(A),N}function L(A,O){let _=Z.sliceStream(A);if(O)_.push(null);if(A.previous=H,H)H.next=A;if(H=A,X.defineSkip(A.start),X.write(_),Z.parser.lazy[A.start.line]){let D=X.events.length;while(D--)if(X.events[D][1].start.offset<G&&(!X.events[D][1].end||X.events[D][1].end.offset>G))return;let T=Z.events.length,k=T,x,I;while(k--)if(Z.events[k][0]==="exit"&&Z.events[k][1].type==="chunkFlow"){if(x){I=Z.events[k][1].end;break}x=!0}V(Q),D=T;while(D<Z.events.length)Z.events[D][1].end={...I},D++;b1(Z.events,k+1,0,Z.events.slice(T)),Z.events.length=D}}function V(A){let O=J.length;while(O-- >A){let _=J[O];Z.containerState=_[1],_[0].exit.call(Z,$)}J.length=A}function M(){X.write([null]),H=void 0,X=void 0,Z.containerState._closeFlow=void 0}}function Oo($,Z,J){return d0($,$.attempt(this.parser.constructs.document,Z,J),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function V9($){if($===null||q5($)||d2($))return 1;if(a3($))return 2}function T6($,Z,J){let Q=[],X=-1;while(++X<$.length){let H=$[X].resolveAll;if(H&&!Q.includes(H))Z=H(Z,J),Q.push(H)}return Z}var _Q={name:"attention",resolveAll:Po,tokenize:wo};function Po($,Z){let J=-1,Q,X,H,G,z,Y,K,W;while(++J<$.length)if($[J][0]==="enter"&&$[J][1].type==="attentionSequence"&&$[J][1]._close){Q=J;while(Q--)if($[Q][0]==="exit"&&$[Q][1].type==="attentionSequence"&&$[Q][1]._open&&Z.sliceSerialize($[Q][1]).charCodeAt(0)===Z.sliceSerialize($[J][1]).charCodeAt(0)){if(($[Q][1]._close||$[J][1]._open)&&($[J][1].end.offset-$[J][1].start.offset)%3&&!(($[Q][1].end.offset-$[Q][1].start.offset+$[J][1].end.offset-$[J][1].start.offset)%3))continue;Y=$[Q][1].end.offset-$[Q][1].start.offset>1&&$[J][1].end.offset-$[J][1].start.offset>1?2:1;let B={...$[Q][1].end},q={...$[J][1].start};if(zI(B,-Y),zI(q,Y),G={type:Y>1?"strongSequence":"emphasisSequence",start:B,end:{...$[Q][1].end}},z={type:Y>1?"strongSequence":"emphasisSequence",start:{...$[J][1].start},end:q},H={type:Y>1?"strongText":"emphasisText",start:{...$[Q][1].end},end:{...$[J][1].start}},X={type:Y>1?"strong":"emphasis",start:{...G.start},end:{...z.end}},$[Q][1].end={...G.start},$[J][1].start={...z.end},K=[],$[Q][1].end.offset-$[Q][1].start.offset)K=c8(K,[["enter",$[Q][1],Z],["exit",$[Q][1],Z]]);if(K=c8(K,[["enter",X,Z],["enter",G,Z],["exit",G,Z],["enter",H,Z]]),K=c8(K,T6(Z.parser.constructs.insideSpan.null,$.slice(Q+1,J),Z)),K=c8(K,[["exit",H,Z],["enter",z,Z],["exit",z,Z],["exit",X,Z]]),$[J][1].end.offset-$[J][1].start.offset)W=2,K=c8(K,[["enter",$[J][1],Z],["exit",$[J][1],Z]]);else W=0;b1($,Q-1,J-Q+3,K),J=Q+K.length-W-2;break}}J=-1;while(++J<$.length)if($[J][1].type==="attentionSequence")$[J][1].type="data";return $}function wo($,Z){let J=this.parser.constructs.attentionMarkers.null,Q=this.previous,X=V9(Q),H;return G;function G(Y){return H=Y,$.enter("attentionSequence"),z(Y)}function z(Y){if(Y===H)return $.consume(Y),z;let K=$.exit("attentionSequence"),W=V9(Y),B=!W||W===2&&X||J.includes(Y),q=!X||X===2&&W||J.includes(Q);return K._open=Boolean(H===42?B:B&&(X||!q)),K._close=Boolean(H===42?q:q&&(W||!B)),Z(Y)}}function zI($,Z){$.column+=Z,$.offset+=Z,$._bufferIndex+=Z}var RF={name:"autolink",tokenize:jo};function jo($,Z,J){let Q=0;return X;function X(U){return $.enter("autolink"),$.enter("autolinkMarker"),$.consume(U),$.exit("autolinkMarker"),$.enter("autolinkProtocol"),H}function H(U){if(t1(U))return $.consume(U),G;if(U===64)return J(U);return K(U)}function G(U){if(U===43||U===45||U===46||I1(U))return Q=1,z(U);return K(U)}function z(U){if(U===58)return $.consume(U),Q=0,Y;if((U===43||U===45||U===46||I1(U))&&Q++<32)return $.consume(U),z;return Q=0,K(U)}function Y(U){if(U===62)return $.exit("autolinkProtocol"),$.enter("autolinkMarker"),$.consume(U),$.exit("autolinkMarker"),$.exit("autolink"),Z;if(U===null||U===32||U===60||r3(U))return J(U);return $.consume(U),Y}function K(U){if(U===64)return $.consume(U),W;if(ZI(U))return $.consume(U),K;return J(U)}function W(U){return I1(U)?B(U):J(U)}function B(U){if(U===46)return $.consume(U),Q=0,W;if(U===62)return $.exit("autolinkProtocol").type="autolinkEmail",$.enter("autolinkMarker"),$.consume(U),$.exit("autolinkMarker"),$.exit("autolink"),Z;return q(U)}function q(U){if((U===45||I1(U))&&Q++<63){let F=U===45?q:B;return $.consume(U),F}return J(U)}}var l2={partial:!0,tokenize:Co};function Co($,Z,J){return Q;function Q(H){return i0(H)?d0($,X,"linePrefix")(H):X(H)}function X(H){return H===null||S0(H)?Z(H):J(H)}}var $K={continuation:{tokenize:Eo},exit:Io,name:"blockQuote",tokenize:To};function To($,Z,J){let Q=this;return X;function X(G){if(G===62){let z=Q.containerState;if(!z.open)$.enter("blockQuote",{_container:!0}),z.open=!0;return $.enter("blockQuotePrefix"),$.enter("blockQuoteMarker"),$.consume(G),$.exit("blockQuoteMarker"),H}return J(G)}function H(G){if(i0(G))return $.enter("blockQuotePrefixWhitespace"),$.consume(G),$.exit("blockQuotePrefixWhitespace"),$.exit("blockQuotePrefix"),Z;return $.exit("blockQuotePrefix"),Z(G)}}function Eo($,Z,J){let Q=this;return X;function X(G){if(i0(G))return d0($,H,"linePrefix",Q.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(G);return H(G)}function H(G){return $.attempt($K,Z,J)(G)}}function Io($){$.exit("blockQuote")}var ZK={name:"characterEscape",tokenize:Ro};function Ro($,Z,J){return Q;function Q(H){return $.enter("characterEscape"),$.enter("escapeMarker"),$.consume(H),$.exit("escapeMarker"),X}function X(H){if(QI(H))return $.enter("characterEscapeValue"),$.consume(H),$.exit("characterEscapeValue"),$.exit("characterEscape"),Z;return J(H)}}var JK={name:"characterReference",tokenize:ko};function ko($,Z,J){let Q=this,X=0,H,G;return z;function z(B){return $.enter("characterReference"),$.enter("characterReferenceMarker"),$.consume(B),$.exit("characterReferenceMarker"),Y}function Y(B){if(B===35)return $.enter("characterReferenceMarkerNumeric"),$.consume(B),$.exit("characterReferenceMarkerNumeric"),K;return $.enter("characterReferenceValue"),H=31,G=I1,W(B)}function K(B){if(B===88||B===120)return $.enter("characterReferenceMarkerHexadecimal"),$.consume(B),$.exit("characterReferenceMarkerHexadecimal"),$.enter("characterReferenceValue"),H=6,G=JI,W;return $.enter("characterReferenceValue"),H=7,G=DQ,W(B)}function W(B){if(B===59&&X){let q=$.exit("characterReferenceValue");if(G===I1&&!x$(Q.sliceSerialize(q)))return J(B);return $.enter("characterReferenceMarker"),$.consume(B),$.exit("characterReferenceMarker"),$.exit("characterReference"),Z}if(G(B)&&X++<H)return $.consume(B),W;return J(B)}}var YI={partial:!0,tokenize:bo},QK={concrete:!0,name:"codeFenced",tokenize:So};function So($,Z,J){let Q=this,X={partial:!0,tokenize:_},H=0,G=0,z;return Y;function Y(D){return K(D)}function K(D){let T=Q.events[Q.events.length-1];return H=T&&T[1].type==="linePrefix"?T[2].sliceSerialize(T[1],!0).length:0,z=D,$.enter("codeFenced"),$.enter("codeFencedFence"),$.enter("codeFencedFenceSequence"),W(D)}function W(D){if(D===z)return G++,$.consume(D),W;if(G<3)return J(D);return $.exit("codeFencedFenceSequence"),i0(D)?d0($,B,"whitespace")(D):B(D)}function B(D){if(D===null||S0(D))return $.exit("codeFencedFence"),Q.interrupt?Z(D):$.check(YI,N,O)(D);return $.enter("codeFencedFenceInfo"),$.enter("chunkString",{contentType:"string"}),q(D)}function q(D){if(D===null||S0(D))return $.exit("chunkString"),$.exit("codeFencedFenceInfo"),B(D);if(i0(D))return $.exit("chunkString"),$.exit("codeFencedFenceInfo"),d0($,U,"whitespace")(D);if(D===96&&D===z)return J(D);return $.consume(D),q}function U(D){if(D===null||S0(D))return B(D);return $.enter("codeFencedFenceMeta"),$.enter("chunkString",{contentType:"string"}),F(D)}function F(D){if(D===null||S0(D))return $.exit("chunkString"),$.exit("codeFencedFenceMeta"),B(D);if(D===96&&D===z)return J(D);return $.consume(D),F}function N(D){return $.attempt(X,O,L)(D)}function L(D){return $.enter("lineEnding"),$.consume(D),$.exit("lineEnding"),V}function V(D){return H>0&&i0(D)?d0($,M,"linePrefix",H+1)(D):M(D)}function M(D){if(D===null||S0(D))return $.check(YI,N,O)(D);return $.enter("codeFlowValue"),A(D)}function A(D){if(D===null||S0(D))return $.exit("codeFlowValue"),M(D);return $.consume(D),A}function O(D){return $.exit("codeFenced"),Z(D)}function _(D,T,k){let x=0;return I;function I(S){return D.enter("lineEnding"),D.consume(S),D.exit("lineEnding"),y}function y(S){return D.enter("codeFencedFence"),i0(S)?d0(D,C,"linePrefix",Q.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(S):C(S)}function C(S){if(S===z)return D.enter("codeFencedFenceSequence"),j(S);return k(S)}function j(S){if(S===z)return x++,D.consume(S),j;if(x>=G)return D.exit("codeFencedFenceSequence"),i0(S)?d0(D,R,"whitespace")(S):R(S);return k(S)}function R(S){if(S===null||S0(S))return D.exit("codeFencedFence"),T(S);return k(S)}}}function bo($,Z,J){let Q=this;return X;function X(G){if(G===null)return J(G);return $.enter("lineEnding"),$.consume(G),$.exit("lineEnding"),H}function H(G){return Q.parser.lazy[Q.now().line]?J(G):Z(G)}}var OQ={name:"codeIndented",tokenize:xo},yo={partial:!0,tokenize:ho};function xo($,Z,J){let Q=this;return X;function X(K){return $.enter("codeIndented"),d0($,H,"linePrefix",5)(K)}function H(K){let W=Q.events[Q.events.length-1];return W&&W[1].type==="linePrefix"&&W[2].sliceSerialize(W[1],!0).length>=4?G(K):J(K)}function G(K){if(K===null)return Y(K);if(S0(K))return $.attempt(yo,G,Y)(K);return $.enter("codeFlowValue"),z(K)}function z(K){if(K===null||S0(K))return $.exit("codeFlowValue"),G(K);return $.consume(K),z}function Y(K){return $.exit("codeIndented"),Z(K)}}function ho($,Z,J){let Q=this;return X;function X(G){if(Q.parser.lazy[Q.now().line])return J(G);if(S0(G))return $.enter("lineEnding"),$.consume(G),$.exit("lineEnding"),X;return d0($,H,"linePrefix",5)(G)}function H(G){let z=Q.events[Q.events.length-1];return z&&z[1].type==="linePrefix"&&z[2].sliceSerialize(z[1],!0).length>=4?Z(G):S0(G)?X(G):J(G)}}var kF={name:"codeText",previous:vo,resolve:go,tokenize:fo};function go($){let Z=$.length-4,J=3,Q,X;if(($[J][1].type==="lineEnding"||$[J][1].type==="space")&&($[Z][1].type==="lineEnding"||$[Z][1].type==="space")){Q=J;while(++Q<Z)if($[Q][1].type==="codeTextData"){$[J][1].type="codeTextPadding",$[Z][1].type="codeTextPadding",J+=2,Z-=2;break}}Q=J-1,Z++;while(++Q<=Z)if(X===void 0){if(Q!==Z&&$[Q][1].type!=="lineEnding")X=Q}else if(Q===Z||$[Q][1].type==="lineEnding"){if($[X][1].type="codeTextData",Q!==X+2)$[X][1].end=$[Q-1][1].end,$.splice(X+2,Q-X-2),Z-=Q-X-2,Q=X+2;X=void 0}return $}function vo($){return $!==96||this.events[this.events.length-1][1].type==="characterEscape"}function fo($,Z,J){let Q=this,X=0,H,G;return z;function z(q){return $.enter("codeText"),$.enter("codeTextSequence"),Y(q)}function Y(q){if(q===96)return $.consume(q),X++,Y;return $.exit("codeTextSequence"),K(q)}function K(q){if(q===null)return J(q);if(q===32)return $.enter("space"),$.consume(q),$.exit("space"),K;if(q===96)return G=$.enter("codeTextSequence"),H=0,B(q);if(S0(q))return $.enter("lineEnding"),$.consume(q),$.exit("lineEnding"),K;return $.enter("codeTextData"),W(q)}function W(q){if(q===null||q===32||q===96||S0(q))return $.exit("codeTextData"),K(q);return $.consume(q),W}function B(q){if(q===96)return $.consume(q),H++,B;if(H===X)return $.exit("codeTextSequence"),$.exit("codeText"),Z(q);return G.type="codeTextData",W(q)}}class SF{constructor($){this.left=$?[...$]:[],this.right=[]}get($){if($<0||$>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+$+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");if($<this.left.length)return this.left[$];return this.right[this.right.length-$+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice($,Z){let J=Z===null||Z===void 0?Number.POSITIVE_INFINITY:Z;if(J<this.left.length)return this.left.slice($,J);if($>this.left.length)return this.right.slice(this.right.length-J+this.left.length,this.right.length-$+this.left.length).reverse();return this.left.slice($).concat(this.right.slice(this.right.length-J+this.left.length).reverse())}splice($,Z,J){let Q=Z||0;this.setCursor(Math.trunc($));let X=this.right.splice(this.right.length-Q,Number.POSITIVE_INFINITY);if(J)PQ(this.left,J);return X.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push($){this.setCursor(Number.POSITIVE_INFINITY),this.left.push($)}pushMany($){this.setCursor(Number.POSITIVE_INFINITY),PQ(this.left,$)}unshift($){this.setCursor(0),this.right.push($)}unshiftMany($){this.setCursor(0),PQ(this.right,$.reverse())}setCursor($){if($===this.left.length||$>this.left.length&&this.right.length===0||$<0&&this.left.length===0)return;if($<this.left.length){let Z=this.left.splice($,Number.POSITIVE_INFINITY);PQ(this.right,Z.reverse())}else{let Z=this.right.splice(this.left.length+this.right.length-$,Number.POSITIVE_INFINITY);PQ(this.left,Z.reverse())}}}function PQ($,Z){let J=0;if(Z.length<1e4)$.push(...Z);else while(J<Z.length)$.push(...Z.slice(J,J+1e4)),J+=1e4}function XK($){let Z={},J=-1,Q,X,H,G,z,Y,K,W=new SF($);while(++J<W.length){while(J in Z)J=Z[J];if(Q=W.get(J),J&&Q[1].type==="chunkFlow"&&W.get(J-1)[1].type==="listItemPrefix"){if(Y=Q[1]._tokenizer.events,H=0,H<Y.length&&Y[H][1].type==="lineEndingBlank")H+=2;if(H<Y.length&&Y[H][1].type==="content")while(++H<Y.length){if(Y[H][1].type==="content")break;if(Y[H][1].type==="chunkText")Y[H][1]._isInFirstContentOfListItem=!0,H++}}if(Q[0]==="enter"){if(Q[1].contentType)Object.assign(Z,mo(W,J)),J=Z[J],K=!0}else if(Q[1]._container){H=J,X=void 0;while(H--)if(G=W.get(H),G[1].type==="lineEnding"||G[1].type==="lineEndingBlank"){if(G[0]==="enter"){if(X)W.get(X)[1].type="lineEndingBlank";G[1].type="lineEnding",X=H}}else if(G[1].type==="linePrefix"||G[1].type==="listItemIndent");else break;if(X)Q[1].end={...W.get(X)[1].start},z=W.slice(X,J),z.unshift(Q),W.splice(X,J-X+1,z)}}return b1($,0,Number.POSITIVE_INFINITY,W.slice(0)),!K}function mo($,Z){let J=$.get(Z)[1],Q=$.get(Z)[2],X=Z-1,H=[],G=J._tokenizer;if(!G){if(G=Q.parser[J.contentType](J.start),J._contentTypeTextTrailing)G._contentTypeTextTrailing=!0}let z=G.events,Y=[],K={},W,B,q=-1,U=J,F=0,N=0,L=[N];while(U){while($.get(++X)[1]!==U);if(H.push(X),!U._tokenizer){if(W=Q.sliceStream(U),!U.next)W.push(null);if(B)G.defineSkip(U.start);if(U._isInFirstContentOfListItem)G._gfmTasklistFirstContentOfListItem=!0;if(G.write(W),U._isInFirstContentOfListItem)G._gfmTasklistFirstContentOfListItem=void 0}B=U,U=U.next}U=J;while(++q<z.length)if(z[q][0]==="exit"&&z[q-1][0]==="enter"&&z[q][1].type===z[q-1][1].type&&z[q][1].start.line!==z[q][1].end.line)N=q+1,L.push(N),U._tokenizer=void 0,U.previous=void 0,U=U.next;if(G.events=[],U)U._tokenizer=void 0,U.previous=void 0;else L.pop();q=L.length;while(q--){let V=z.slice(L[q],L[q+1]),M=H.pop();Y.push([M,M+V.length-1]),$.splice(M,2,V)}Y.reverse(),q=-1;while(++q<Y.length)K[F+Y[q][0]]=F+Y[q][1],F+=Y[q][1]-Y[q][0]-1;return K}var bF={resolve:po,tokenize:co},uo={partial:!0,tokenize:lo};function po($){return XK($),$}function co($,Z){let J;return Q;function Q(z){return $.enter("content"),J=$.enter("chunkContent",{contentType:"content"}),X(z)}function X(z){if(z===null)return H(z);if(S0(z))return $.check(uo,G,H)(z);return $.consume(z),X}function H(z){return $.exit("chunkContent"),$.exit("content"),Z(z)}function G(z){return $.consume(z),$.exit("chunkContent"),J.next=$.enter("chunkContent",{contentType:"content",previous:J}),J=J.next,X}}function lo($,Z,J){let Q=this;return X;function X(G){return $.exit("chunkContent"),$.enter("lineEnding"),$.consume(G),$.exit("lineEnding"),d0($,H,"linePrefix")}function H(G){if(G===null||S0(G))return J(G);let z=Q.events[Q.events.length-1];if(!Q.parser.constructs.disable.null.includes("codeIndented")&&z&&z[1].type==="linePrefix"&&z[2].sliceSerialize(z[1],!0).length>=4)return Z(G);return $.interrupt(Q.parser.constructs.flow,J,Z)(G)}}function HK($,Z,J,Q,X,H,G,z,Y){let K=Y||Number.POSITIVE_INFINITY,W=0;return B;function B(V){if(V===60)return $.enter(Q),$.enter(X),$.enter(H),$.consume(V),$.exit(H),q;if(V===null||V===32||V===41||r3(V))return J(V);return $.enter(Q),$.enter(G),$.enter(z),$.enter("chunkString",{contentType:"string"}),N(V)}function q(V){if(V===62)return $.enter(H),$.consume(V),$.exit(H),$.exit(X),$.exit(Q),Z;return $.enter(z),$.enter("chunkString",{contentType:"string"}),U(V)}function U(V){if(V===62)return $.exit("chunkString"),$.exit(z),q(V);if(V===null||V===60||S0(V))return J(V);return $.consume(V),V===92?F:U}function F(V){if(V===60||V===62||V===92)return $.consume(V),U;return U(V)}function N(V){if(!W&&(V===null||V===41||q5(V)))return $.exit("chunkString"),$.exit(z),$.exit(G),$.exit(Q),Z(V);if(W<K&&V===40)return $.consume(V),W++,N;if(V===41)return $.consume(V),W--,N;if(V===null||V===32||V===40||r3(V))return J(V);return $.consume(V),V===92?L:N}function L(V){if(V===40||V===41||V===92)return $.consume(V),N;return N(V)}}function GK($,Z,J,Q,X,H){let G=this,z=0,Y;return K;function K(U){return $.enter(Q),$.enter(X),$.consume(U),$.exit(X),$.enter(H),W}function W(U){if(z>999||U===null||U===91||U===93&&!Y||U===94&&!z&&"_hiddenFootnoteSupport"in G.parser.constructs)return J(U);if(U===93)return $.exit(H),$.enter(X),$.consume(U),$.exit(X),$.exit(Q),Z;if(S0(U))return $.enter("lineEnding"),$.consume(U),$.exit("lineEnding"),W;return $.enter("chunkString",{contentType:"string"}),B(U)}function B(U){if(U===null||U===91||U===93||S0(U)||z++>999)return $.exit("chunkString"),W(U);if($.consume(U),!Y)Y=!i0(U);return U===92?q:B}function q(U){if(U===91||U===92||U===93)return $.consume(U),z++,B;return B(U)}}function zK($,Z,J,Q,X,H){let G;return z;function z(q){if(q===34||q===39||q===40)return $.enter(Q),$.enter(X),$.consume(q),$.exit(X),G=q===40?41:q,Y;return J(q)}function Y(q){if(q===G)return $.enter(X),$.consume(q),$.exit(X),$.exit(Q),Z;return $.enter(H),K(q)}function K(q){if(q===G)return $.exit(H),Y(G);if(q===null)return J(q);if(S0(q))return $.enter("lineEnding"),$.consume(q),$.exit("lineEnding"),d0($,K,"linePrefix");return $.enter("chunkString",{contentType:"string"}),W(q)}function W(q){if(q===G||q===null||S0(q))return $.exit("chunkString"),K(q);return $.consume(q),q===92?B:W}function B(q){if(q===G||q===92)return $.consume(q),W;return W(q)}}function n3($,Z){let J;return Q;function Q(X){if(S0(X))return $.enter("lineEnding"),$.consume(X),$.exit("lineEnding"),J=!0,Q;if(i0(X))return d0($,Q,J?"linePrefix":"lineSuffix")(X);return Z(X)}}var yF={name:"definition",tokenize:ro},io={partial:!0,tokenize:ao};function ro($,Z,J){let Q=this,X;return H;function H(U){return $.enter("definition"),G(U)}function G(U){return GK.call(Q,$,z,J,"definitionLabel","definitionLabelMarker","definitionLabelString")(U)}function z(U){if(X=b8(Q.sliceSerialize(Q.events[Q.events.length-1][1]).slice(1,-1)),U===58)return $.enter("definitionMarker"),$.consume(U),$.exit("definitionMarker"),Y;return J(U)}function Y(U){return q5(U)?n3($,K)(U):K(U)}function K(U){return HK($,W,J,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(U)}function W(U){return $.attempt(io,B,B)(U)}function B(U){return i0(U)?d0($,q,"whitespace")(U):q(U)}function q(U){if(U===null||S0(U))return $.exit("definition"),Q.parser.defined.push(X),Z(U);return J(U)}}function ao($,Z,J){return Q;function Q(z){return q5(z)?n3($,X)(z):J(z)}function X(z){return zK($,H,J,"definitionTitle","definitionTitleMarker","definitionTitleString")(z)}function H(z){return i0(z)?d0($,G,"whitespace")(z):G(z)}function G(z){return z===null||S0(z)?Z(z):J(z)}}var xF={name:"hardBreakEscape",tokenize:no};function no($,Z,J){return Q;function Q(H){return $.enter("hardBreakEscape"),$.consume(H),X}function X(H){if(S0(H))return $.exit("hardBreakEscape"),Z(H);return J(H)}}var hF={name:"headingAtx",resolve:so,tokenize:oo};function so($,Z){let J=$.length-2,Q=3,X,H;if($[Q][1].type==="whitespace")Q+=2;if(J-2>Q&&$[J][1].type==="whitespace")J-=2;if($[J][1].type==="atxHeadingSequence"&&(Q===J-1||J-4>Q&&$[J-2][1].type==="whitespace"))J-=Q+1===J?2:4;if(J>Q)X={type:"atxHeadingText",start:$[Q][1].start,end:$[J][1].end},H={type:"chunkText",start:$[Q][1].start,end:$[J][1].end,contentType:"text"},b1($,Q,J-Q+1,[["enter",X,Z],["enter",H,Z],["exit",H,Z],["exit",X,Z]]);return $}function oo($,Z,J){let Q=0;return X;function X(W){return $.enter("atxHeading"),H(W)}function H(W){return $.enter("atxHeadingSequence"),G(W)}function G(W){if(W===35&&Q++<6)return $.consume(W),G;if(W===null||q5(W))return $.exit("atxHeadingSequence"),z(W);return J(W)}function z(W){if(W===35)return $.enter("atxHeadingSequence"),Y(W);if(W===null||S0(W))return $.exit("atxHeading"),Z(W);if(i0(W))return d0($,z,"whitespace")(W);return $.enter("atxHeadingText"),K(W)}function Y(W){if(W===35)return $.consume(W),Y;return $.exit("atxHeadingSequence"),z(W)}function K(W){if(W===null||W===35||q5(W))return $.exit("atxHeadingText"),z(W);return $.consume(W),K}}var KI=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],gF=["pre","script","style","textarea"];var vF={concrete:!0,name:"htmlFlow",resolveTo:$t,tokenize:Zt},to={partial:!0,tokenize:Qt},eo={partial:!0,tokenize:Jt};function $t($){let Z=$.length;while(Z--)if($[Z][0]==="enter"&&$[Z][1].type==="htmlFlow")break;if(Z>1&&$[Z-2][1].type==="linePrefix")$[Z][1].start=$[Z-2][1].start,$[Z+1][1].start=$[Z-2][1].start,$.splice(Z-2,2);return $}function Zt($,Z,J){let Q=this,X,H,G,z,Y;return K;function K(h){return W(h)}function W(h){return $.enter("htmlFlow"),$.enter("htmlFlowData"),$.consume(h),B}function B(h){if(h===33)return $.consume(h),q;if(h===47)return $.consume(h),H=!0,N;if(h===63)return $.consume(h),X=3,Q.interrupt?Z:w;if(t1(h))return $.consume(h),G=String.fromCharCode(h),L;return J(h)}function q(h){if(h===45)return $.consume(h),X=2,U;if(h===91)return $.consume(h),X=5,z=0,F;if(t1(h))return $.consume(h),X=4,Q.interrupt?Z:w;return J(h)}function U(h){if(h===45)return $.consume(h),Q.interrupt?Z:w;return J(h)}function F(h){if(h==="CDATA[".charCodeAt(z++)){if($.consume(h),z===6)return Q.interrupt?Z:C;return F}return J(h)}function N(h){if(t1(h))return $.consume(h),G=String.fromCharCode(h),L;return J(h)}function L(h){if(h===null||h===47||h===62||q5(h)){let t=h===47,M0=G.toLowerCase();if(!t&&!H&&gF.includes(M0))return X=1,Q.interrupt?Z(h):C(h);if(KI.includes(G.toLowerCase())){if(X=6,t)return $.consume(h),V;return Q.interrupt?Z(h):C(h)}return X=7,Q.interrupt&&!Q.parser.lazy[Q.now().line]?J(h):H?M(h):A(h)}if(h===45||I1(h))return $.consume(h),G+=String.fromCharCode(h),L;return J(h)}function V(h){if(h===62)return $.consume(h),Q.interrupt?Z:C;return J(h)}function M(h){if(i0(h))return $.consume(h),M;return I(h)}function A(h){if(h===47)return $.consume(h),I;if(h===58||h===95||t1(h))return $.consume(h),O;if(i0(h))return $.consume(h),A;return I(h)}function O(h){if(h===45||h===46||h===58||h===95||I1(h))return $.consume(h),O;return _(h)}function _(h){if(h===61)return $.consume(h),D;if(i0(h))return $.consume(h),_;return A(h)}function D(h){if(h===null||h===60||h===61||h===62||h===96)return J(h);if(h===34||h===39)return $.consume(h),Y=h,T;if(i0(h))return $.consume(h),D;return k(h)}function T(h){if(h===Y)return $.consume(h),Y=null,x;if(h===null||S0(h))return J(h);return $.consume(h),T}function k(h){if(h===null||h===34||h===39||h===47||h===60||h===61||h===62||h===96||q5(h))return _(h);return $.consume(h),k}function x(h){if(h===47||h===62||i0(h))return A(h);return J(h)}function I(h){if(h===62)return $.consume(h),y;return J(h)}function y(h){if(h===null||S0(h))return C(h);if(i0(h))return $.consume(h),y;return J(h)}function C(h){if(h===45&&X===2)return $.consume(h),E;if(h===60&&X===1)return $.consume(h),b;if(h===62&&X===4)return $.consume(h),s;if(h===63&&X===3)return $.consume(h),w;if(h===93&&X===5)return $.consume(h),u;if(S0(h)&&(X===6||X===7))return $.exit("htmlFlowData"),$.check(to,z0,j)(h);if(h===null||S0(h))return $.exit("htmlFlowData"),j(h);return $.consume(h),C}function j(h){return $.check(eo,R,z0)(h)}function R(h){return $.enter("lineEnding"),$.consume(h),$.exit("lineEnding"),S}function S(h){if(h===null||S0(h))return j(h);return $.enter("htmlFlowData"),C(h)}function E(h){if(h===45)return $.consume(h),w;return C(h)}function b(h){if(h===47)return $.consume(h),G="",g;return C(h)}function g(h){if(h===62){let t=G.toLowerCase();if(gF.includes(t))return $.consume(h),s;return C(h)}if(t1(h)&&G.length<8)return $.consume(h),G+=String.fromCharCode(h),g;return C(h)}function u(h){if(h===93)return $.consume(h),w;return C(h)}function w(h){if(h===62)return $.consume(h),s;if(h===45&&X===2)return $.consume(h),w;return C(h)}function s(h){if(h===null||S0(h))return $.exit("htmlFlowData"),z0(h);return $.consume(h),s}function z0(h){return $.exit("htmlFlow"),Z(h)}}function Jt($,Z,J){let Q=this;return X;function X(G){if(S0(G))return $.enter("lineEnding"),$.consume(G),$.exit("lineEnding"),H;return J(G)}function H(G){return Q.parser.lazy[Q.now().line]?J(G):Z(G)}}function Qt($,Z,J){return Q;function Q(X){return $.enter("lineEnding"),$.consume(X),$.exit("lineEnding"),$.attempt(l2,Z,J)}}var fF={name:"htmlText",tokenize:Xt};function Xt($,Z,J){let Q=this,X,H,G;return z;function z(w){return $.enter("htmlText"),$.enter("htmlTextData"),$.consume(w),Y}function Y(w){if(w===33)return $.consume(w),K;if(w===47)return $.consume(w),_;if(w===63)return $.consume(w),A;if(t1(w))return $.consume(w),k;return J(w)}function K(w){if(w===45)return $.consume(w),W;if(w===91)return $.consume(w),H=0,F;if(t1(w))return $.consume(w),M;return J(w)}function W(w){if(w===45)return $.consume(w),U;return J(w)}function B(w){if(w===null)return J(w);if(w===45)return $.consume(w),q;if(S0(w))return G=B,b(w);return $.consume(w),B}function q(w){if(w===45)return $.consume(w),U;return B(w)}function U(w){return w===62?E(w):w===45?q(w):B(w)}function F(w){if(w==="CDATA[".charCodeAt(H++))return $.consume(w),H===6?N:F;return J(w)}function N(w){if(w===null)return J(w);if(w===93)return $.consume(w),L;if(S0(w))return G=N,b(w);return $.consume(w),N}function L(w){if(w===93)return $.consume(w),V;return N(w)}function V(w){if(w===62)return E(w);if(w===93)return $.consume(w),V;return N(w)}function M(w){if(w===null||w===62)return E(w);if(S0(w))return G=M,b(w);return $.consume(w),M}function A(w){if(w===null)return J(w);if(w===63)return $.consume(w),O;if(S0(w))return G=A,b(w);return $.consume(w),A}function O(w){return w===62?E(w):A(w)}function _(w){if(t1(w))return $.consume(w),D;return J(w)}function D(w){if(w===45||I1(w))return $.consume(w),D;return T(w)}function T(w){if(S0(w))return G=T,b(w);if(i0(w))return $.consume(w),T;return E(w)}function k(w){if(w===45||I1(w))return $.consume(w),k;if(w===47||w===62||q5(w))return x(w);return J(w)}function x(w){if(w===47)return $.consume(w),E;if(w===58||w===95||t1(w))return $.consume(w),I;if(S0(w))return G=x,b(w);if(i0(w))return $.consume(w),x;return E(w)}function I(w){if(w===45||w===46||w===58||w===95||I1(w))return $.consume(w),I;return y(w)}function y(w){if(w===61)return $.consume(w),C;if(S0(w))return G=y,b(w);if(i0(w))return $.consume(w),y;return x(w)}function C(w){if(w===null||w===60||w===61||w===62||w===96)return J(w);if(w===34||w===39)return $.consume(w),X=w,j;if(S0(w))return G=C,b(w);if(i0(w))return $.consume(w),C;return $.consume(w),R}function j(w){if(w===X)return $.consume(w),X=void 0,S;if(w===null)return J(w);if(S0(w))return G=j,b(w);return $.consume(w),j}function R(w){if(w===null||w===34||w===39||w===60||w===61||w===96)return J(w);if(w===47||w===62||q5(w))return x(w);return $.consume(w),R}function S(w){if(w===47||w===62||q5(w))return x(w);return J(w)}function E(w){if(w===62)return $.consume(w),$.exit("htmlTextData"),$.exit("htmlText"),Z;return J(w)}function b(w){return $.exit("htmlTextData"),$.enter("lineEnding"),$.consume(w),$.exit("lineEnding"),g}function g(w){return i0(w)?d0($,u,"linePrefix",Q.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(w):u(w)}function u(w){return $.enter("htmlTextData"),G(w)}}var s3={name:"labelEnd",resolveAll:Yt,resolveTo:Kt,tokenize:Wt},Ht={tokenize:Bt},Gt={tokenize:qt},zt={tokenize:Ut};function Yt($){let Z=-1,J=[];while(++Z<$.length){let Q=$[Z][1];if(J.push($[Z]),Q.type==="labelImage"||Q.type==="labelLink"||Q.type==="labelEnd"){let X=Q.type==="labelImage"?4:2;Q.type="data",Z+=X}}if($.length!==J.length)b1($,0,$.length,J);return $}function Kt($,Z){let J=$.length,Q=0,X,H,G,z;while(J--)if(X=$[J][1],H){if(X.type==="link"||X.type==="labelLink"&&X._inactive)break;if($[J][0]==="enter"&&X.type==="labelLink")X._inactive=!0}else if(G){if($[J][0]==="enter"&&(X.type==="labelImage"||X.type==="labelLink")&&!X._balanced){if(H=J,X.type!=="labelLink"){Q=2;break}}}else if(X.type==="labelEnd")G=J;let Y={type:$[H][1].type==="labelLink"?"link":"image",start:{...$[H][1].start},end:{...$[$.length-1][1].end}},K={type:"label",start:{...$[H][1].start},end:{...$[G][1].end}},W={type:"labelText",start:{...$[H+Q+2][1].end},end:{...$[G-2][1].start}};return z=[["enter",Y,Z],["enter",K,Z]],z=c8(z,$.slice(H+1,H+Q+3)),z=c8(z,[["enter",W,Z]]),z=c8(z,T6(Z.parser.constructs.insideSpan.null,$.slice(H+Q+4,G-3),Z)),z=c8(z,[["exit",W,Z],$[G-2],$[G-1],["exit",K,Z]]),z=c8(z,$.slice(G+1)),z=c8(z,[["exit",Y,Z]]),b1($,H,$.length,z),$}function Wt($,Z,J){let Q=this,X=Q.events.length,H,G;while(X--)if((Q.events[X][1].type==="labelImage"||Q.events[X][1].type==="labelLink")&&!Q.events[X][1]._balanced){H=Q.events[X][1];break}return z;function z(q){if(!H)return J(q);if(H._inactive)return B(q);return G=Q.parser.defined.includes(b8(Q.sliceSerialize({start:H.end,end:Q.now()}))),$.enter("labelEnd"),$.enter("labelMarker"),$.consume(q),$.exit("labelMarker"),$.exit("labelEnd"),Y}function Y(q){if(q===40)return $.attempt(Ht,W,G?W:B)(q);if(q===91)return $.attempt(Gt,W,G?K:B)(q);return G?W(q):B(q)}function K(q){return $.attempt(zt,W,B)(q)}function W(q){return Z(q)}function B(q){return H._balanced=!0,J(q)}}function Bt($,Z,J){return Q;function Q(B){return $.enter("resource"),$.enter("resourceMarker"),$.consume(B),$.exit("resourceMarker"),X}function X(B){return q5(B)?n3($,H)(B):H(B)}function H(B){if(B===41)return W(B);return HK($,G,z,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(B)}function G(B){return q5(B)?n3($,Y)(B):W(B)}function z(B){return J(B)}function Y(B){if(B===34||B===39||B===40)return zK($,K,J,"resourceTitle","resourceTitleMarker","resourceTitleString")(B);return W(B)}function K(B){return q5(B)?n3($,W)(B):W(B)}function W(B){if(B===41)return $.enter("resourceMarker"),$.consume(B),$.exit("resourceMarker"),$.exit("resource"),Z;return J(B)}}function qt($,Z,J){let Q=this;return X;function X(z){return GK.call(Q,$,H,G,"reference","referenceMarker","referenceString")(z)}function H(z){return Q.parser.defined.includes(b8(Q.sliceSerialize(Q.events[Q.events.length-1][1]).slice(1,-1)))?Z(z):J(z)}function G(z){return J(z)}}function Ut($,Z,J){return Q;function Q(H){return $.enter("reference"),$.enter("referenceMarker"),$.consume(H),$.exit("referenceMarker"),X}function X(H){if(H===93)return $.enter("referenceMarker"),$.consume(H),$.exit("referenceMarker"),$.exit("reference"),Z;return J(H)}}var mF={name:"labelStartImage",resolveAll:s3.resolveAll,tokenize:Ft};function Ft($,Z,J){let Q=this;return X;function X(z){return $.enter("labelImage"),$.enter("labelImageMarker"),$.consume(z),$.exit("labelImageMarker"),H}function H(z){if(z===91)return $.enter("labelMarker"),$.consume(z),$.exit("labelMarker"),$.exit("labelImage"),G;return J(z)}function G(z){return z===94&&"_hiddenFootnoteSupport"in Q.parser.constructs?J(z):Z(z)}}var uF={name:"labelStartLink",resolveAll:s3.resolveAll,tokenize:Nt};function Nt($,Z,J){let Q=this;return X;function X(G){return $.enter("labelLink"),$.enter("labelMarker"),$.consume(G),$.exit("labelMarker"),$.exit("labelLink"),H}function H(G){return G===94&&"_hiddenFootnoteSupport"in Q.parser.constructs?J(G):Z(G)}}var wQ={name:"lineEnding",tokenize:Vt};function Vt($,Z){return J;function J(Q){return $.enter("lineEnding"),$.consume(Q),$.exit("lineEnding"),d0($,Z,"linePrefix")}}var o3={name:"thematicBreak",tokenize:Lt};function Lt($,Z,J){let Q=0,X;return H;function H(K){return $.enter("thematicBreak"),G(K)}function G(K){return X=K,z(K)}function z(K){if(K===X)return $.enter("thematicBreakSequence"),Y(K);if(Q>=3&&(K===null||S0(K)))return $.exit("thematicBreak"),Z(K);return J(K)}function Y(K){if(K===X)return $.consume(K),Q++,Y;return $.exit("thematicBreakSequence"),i0(K)?d0($,z,"whitespace")(K):z(K)}}var y8={continuation:{tokenize:_t},exit:Pt,name:"list",tokenize:Dt},Mt={partial:!0,tokenize:wt},At={partial:!0,tokenize:Ot};function Dt($,Z,J){let Q=this,X=Q.events[Q.events.length-1],H=X&&X[1].type==="linePrefix"?X[2].sliceSerialize(X[1],!0).length:0,G=0;return z;function z(U){let F=Q.containerState.type||(U===42||U===43||U===45?"listUnordered":"listOrdered");if(F==="listUnordered"?!Q.containerState.marker||U===Q.containerState.marker:DQ(U)){if(!Q.containerState.type)Q.containerState.type=F,$.enter(F,{_container:!0});if(F==="listUnordered")return $.enter("listItemPrefix"),U===42||U===45?$.check(o3,J,K)(U):K(U);if(!Q.interrupt||U===49)return $.enter("listItemPrefix"),$.enter("listItemValue"),Y(U)}return J(U)}function Y(U){if(DQ(U)&&++G<10)return $.consume(U),Y;if((!Q.interrupt||G<2)&&(Q.containerState.marker?U===Q.containerState.marker:U===41||U===46))return $.exit("listItemValue"),K(U);return J(U)}function K(U){return $.enter("listItemMarker"),$.consume(U),$.exit("listItemMarker"),Q.containerState.marker=Q.containerState.marker||U,$.check(l2,Q.interrupt?J:W,$.attempt(Mt,q,B))}function W(U){return Q.containerState.initialBlankLine=!0,H++,q(U)}function B(U){if(i0(U))return $.enter("listItemPrefixWhitespace"),$.consume(U),$.exit("listItemPrefixWhitespace"),q;return J(U)}function q(U){return Q.containerState.size=H+Q.sliceSerialize($.exit("listItemPrefix"),!0).length,Z(U)}}function _t($,Z,J){let Q=this;return Q.containerState._closeFlow=void 0,$.check(l2,X,H);function X(z){return Q.containerState.furtherBlankLines=Q.containerState.furtherBlankLines||Q.containerState.initialBlankLine,d0($,Z,"listItemIndent",Q.containerState.size+1)(z)}function H(z){if(Q.containerState.furtherBlankLines||!i0(z))return Q.containerState.furtherBlankLines=void 0,Q.containerState.initialBlankLine=void 0,G(z);return Q.containerState.furtherBlankLines=void 0,Q.containerState.initialBlankLine=void 0,$.attempt(At,Z,G)(z)}function G(z){return Q.containerState._closeFlow=!0,Q.interrupt=void 0,d0($,$.attempt(y8,Z,J),"linePrefix",Q.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z)}}function Ot($,Z,J){let Q=this;return d0($,X,"listItemIndent",Q.containerState.size+1);function X(H){let G=Q.events[Q.events.length-1];return G&&G[1].type==="listItemIndent"&&G[2].sliceSerialize(G[1],!0).length===Q.containerState.size?Z(H):J(H)}}function Pt($){$.exit(this.containerState.type)}function wt($,Z,J){let Q=this;return d0($,X,"listItemPrefixWhitespace",Q.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function X(H){let G=Q.events[Q.events.length-1];return!i0(H)&&G&&G[1].type==="listItemPrefixWhitespace"?Z(H):J(H)}}var YK={name:"setextUnderline",resolveTo:jt,tokenize:Ct};function jt($,Z){let J=$.length,Q,X,H;while(J--)if($[J][0]==="enter"){if($[J][1].type==="content"){Q=J;break}if($[J][1].type==="paragraph")X=J}else{if($[J][1].type==="content")$.splice(J,1);if(!H&&$[J][1].type==="definition")H=J}let G={type:"setextHeading",start:{...$[Q][1].start},end:{...$[$.length-1][1].end}};if($[X][1].type="setextHeadingText",H)$.splice(X,0,["enter",G,Z]),$.splice(H+1,0,["exit",$[Q][1],Z]),$[Q][1].end={...$[H][1].end};else $[Q][1]=G;return $.push(["exit",G,Z]),$}function Ct($,Z,J){let Q=this,X;return H;function H(K){let W=Q.events.length,B;while(W--)if(Q.events[W][1].type!=="lineEnding"&&Q.events[W][1].type!=="linePrefix"&&Q.events[W][1].type!=="content"){B=Q.events[W][1].type==="paragraph";break}if(!Q.parser.lazy[Q.now().line]&&(Q.interrupt||B))return $.enter("setextHeadingLine"),X=K,G(K);return J(K)}function G(K){return $.enter("setextHeadingLineSequence"),z(K)}function z(K){if(K===X)return $.consume(K),z;return $.exit("setextHeadingLineSequence"),i0(K)?d0($,Y,"lineSuffix")(K):Y(K)}function Y(K){if(K===null||S0(K))return $.exit("setextHeadingLine"),Z(K);return J(K)}}var WI={tokenize:Tt};function Tt($){let Z=this,J=$.attempt(l2,Q,$.attempt(this.parser.constructs.flowInitial,X,d0($,$.attempt(this.parser.constructs.flow,X,$.attempt(bF,X)),"linePrefix")));return J;function Q(H){if(H===null){$.consume(H);return}return $.enter("lineEndingBlank"),$.consume(H),$.exit("lineEndingBlank"),Z.currentConstruct=void 0,J}function X(H){if(H===null){$.consume(H);return}return $.enter("lineEnding"),$.consume(H),$.exit("lineEnding"),Z.currentConstruct=void 0,J}}var BI={resolveAll:NI()},qI=FI("string"),UI=FI("text");function FI($){return{resolveAll:NI($==="text"?Et:void 0),tokenize:Z};function Z(J){let Q=this,X=this.parser.constructs[$],H=J.attempt(X,G,z);return G;function G(W){return K(W)?H(W):z(W)}function z(W){if(W===null){J.consume(W);return}return J.enter("data"),J.consume(W),Y}function Y(W){if(K(W))return J.exit("data"),H(W);return J.consume(W),Y}function K(W){if(W===null)return!0;let B=X[W],q=-1;if(B)while(++q<B.length){let U=B[q];if(!U.previous||U.previous.call(Q,Q.previous))return!0}return!1}}}function NI($){return Z;function Z(J,Q){let X=-1,H;while(++X<=J.length)if(H===void 0){if(J[X]&&J[X][1].type==="data")H=X,X++}else if(!J[X]||J[X][1].type!=="data"){if(X!==H+2)J[H][1].end=J[X-1][1].end,J.splice(H+2,X-H-2),X=H+2;H=void 0}return $?$(J,Q):J}}function Et($,Z){let J=0;while(++J<=$.length)if((J===$.length||$[J][1].type==="lineEnding")&&$[J-1][1].type==="data"){let Q=$[J-1][1],X=Z.sliceStream(Q),H=X.length,G=-1,z=0,Y;while(H--){let K=X[H];if(typeof K==="string"){G=K.length;while(K.charCodeAt(G-1)===32)z++,G--;if(G)break;G=-1}else if(K===-2)Y=!0,z++;else if(K===-1);else{H++;break}}if(Z._contentTypeTextTrailing&&J===$.length)z=0;if(z){let K={type:J===$.length||Y||z<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:H?G:Q.start._bufferIndex+G,_index:Q.start._index+H,line:Q.end.line,column:Q.end.column-z,offset:Q.end.offset-z},end:{...Q.end}};if(Q.end={...K.start},Q.start.offset===Q.end.offset)Object.assign(Q,K);else $.splice(J,0,["enter",K,Z],["exit",K,Z]),J+=2}J++}return $}var pF={};S4(pF,{text:()=>yt,string:()=>bt,insideSpan:()=>xt,flowInitial:()=>kt,flow:()=>St,document:()=>It,disable:()=>gt,contentInitial:()=>Rt,attentionMarkers:()=>ht});var It={[42]:y8,[43]:y8,[45]:y8,[48]:y8,[49]:y8,[50]:y8,[51]:y8,[52]:y8,[53]:y8,[54]:y8,[55]:y8,[56]:y8,[57]:y8,[62]:$K},Rt={[91]:yF},kt={[-2]:OQ,[-1]:OQ,[32]:OQ},St={[35]:hF,[42]:o3,[45]:[YK,o3],[60]:vF,[61]:YK,[95]:o3,[96]:QK,[126]:QK},bt={[38]:JK,[92]:ZK},yt={[-5]:wQ,[-4]:wQ,[-3]:wQ,[33]:mF,[38]:JK,[42]:_Q,[60]:[RF,fF],[91]:uF,[92]:[xF,ZK],[93]:s3,[95]:_Q,[96]:kF},xt={null:[_Q,BI]},ht={null:[42,95]},gt={null:[]};function VI($,Z,J){let Q={_bufferIndex:-1,_index:0,line:J&&J.line||1,column:J&&J.column||1,offset:J&&J.offset||0},X={},H=[],G=[],z=[],Y=!0,K={attempt:x(T),check:x(k),consume:O,enter:_,exit:D,interrupt:x(k,{interrupt:!0})},W={code:null,containerState:{},defineSkip:V,events:[],now:L,parser:$,previous:null,sliceSerialize:F,sliceStream:N,write:U},B=Z.tokenize.call(W,K),q;if(Z.resolveAll)H.push(Z);return W;function U(j){if(G=c8(G,j),M(),G[G.length-1]!==null)return[];return I(Z,0),W.events=T6(H,W.events,W),W.events}function F(j,R){return ft(N(j),R)}function N(j){return vt(G,j)}function L(){let{_bufferIndex:j,_index:R,line:S,column:E,offset:b}=Q;return{_bufferIndex:j,_index:R,line:S,column:E,offset:b}}function V(j){X[j.line]=j.column,C()}function M(){let j;while(Q._index<G.length){let R=G[Q._index];if(typeof R==="string"){if(j=Q._index,Q._bufferIndex<0)Q._bufferIndex=0;while(Q._index===j&&Q._bufferIndex<R.length)A(R.charCodeAt(Q._bufferIndex))}else A(R)}}function A(j){Y=void 0,q=j,B=B(j)}function O(j){if(S0(j))Q.line++,Q.column=1,Q.offset+=j===-3?2:1,C();else if(j!==-1)Q.column++,Q.offset++;if(Q._bufferIndex<0)Q._index++;else if(Q._bufferIndex++,Q._bufferIndex===G[Q._index].length)Q._bufferIndex=-1,Q._index++;W.previous=j,Y=!0}function _(j,R){let S=R||{};return S.type=j,S.start=L(),W.events.push(["enter",S,W]),z.push(S),S}function D(j){let R=z.pop();return R.end=L(),W.events.push(["exit",R,W]),R}function T(j,R){I(j,R.from)}function k(j,R){R.restore()}function x(j,R){return S;function S(E,b,g){let u,w,s,z0;return Array.isArray(E)?t(E):("tokenize"in E)?t([E]):h(E);function h(B0){return J0;function J0(H0){let N0=H0!==null&&B0[H0],c=H0!==null&&B0.null,Z0=[...Array.isArray(N0)?N0:N0?[N0]:[],...Array.isArray(c)?c:c?[c]:[]];return t(Z0)(H0)}}function t(B0){if(u=B0,w=0,B0.length===0)return g;return M0(B0[w])}function M0(B0){return J0;function J0(H0){if(z0=y(),s=B0,!B0.partial)W.currentConstruct=B0;if(B0.name&&W.parser.constructs.disable.null.includes(B0.name))return Y0(H0);return B0.tokenize.call(R?Object.assign(Object.create(W),R):W,K,d,Y0)(H0)}}function d(B0){return Y=!0,j(s,z0),b}function Y0(B0){if(Y=!0,z0.restore(),++w<u.length)return M0(u[w]);return g}}}function I(j,R){if(j.resolveAll&&!H.includes(j))H.push(j);if(j.resolve)b1(W.events,R,W.events.length-R,j.resolve(W.events.slice(R),W));if(j.resolveTo)W.events=j.resolveTo(W.events,W)}function y(){let j=L(),R=W.previous,S=W.currentConstruct,E=W.events.length,b=Array.from(z);return{from:E,restore:g};function g(){Q=j,W.previous=R,W.currentConstruct=S,W.events.length=E,z=b,C()}}function C(){if(Q.line in X&&Q.column<2)Q.column=X[Q.line],Q.offset+=X[Q.line]-1}}function vt($,Z){let J=Z.start._index,Q=Z.start._bufferIndex,X=Z.end._index,H=Z.end._bufferIndex,G;if(J===X)G=[$[J].slice(Q,H)];else{if(G=$.slice(J,X),Q>-1){let z=G[0];if(typeof z==="string")G[0]=z.slice(Q);else G.shift()}if(H>0)G.push($[X].slice(0,H))}return G}function ft($,Z){let J=-1,Q=[],X;while(++J<$.length){let H=$[J],G;if(typeof H==="string")G=H;else switch(H){case-5:{G="\r";break}case-4:{G=`
|
|
30
|
-
`;break}case-3:{G=`\r
|
|
31
|
-
`;break}case-2:{G=Z?" ":"\t";break}case-1:{if(!Z&&X)continue;G=" ";break}default:G=String.fromCharCode(H)}X=H===-2,Q.push(G)}return Q.join("")}function cF($){let Q={constructs:tY([pF,...($||{}).extensions||[]]),content:X(XI),defined:[],document:X(GI),flow:X(WI),lazy:{},string:X(qI),text:X(UI)};return Q;function X(H){return G;function G(z){return VI(Q,H,z)}}}function dF($){while(!XK($));return $}var LI=/[\0\t\n\r]/g;function lF(){let $=1,Z="",J=!0,Q;return X;function X(H,G,z){let Y=[],K,W,B,q,U;if(H=Z+(typeof H==="string"?H.toString():new TextDecoder(G||void 0).decode(H)),B=0,Z="",J){if(H.charCodeAt(0)===65279)B++;J=void 0}while(B<H.length){if(LI.lastIndex=B,K=LI.exec(H),q=K&&K.index!==void 0?K.index:H.length,U=H.charCodeAt(q),!K){Z=H.slice(B);break}if(U===10&&B===q&&Q)Y.push(-3),Q=void 0;else{if(Q)Y.push(-5),Q=void 0;if(B<q)Y.push(H.slice(B,q)),$+=q-B;switch(U){case 0:{Y.push(65533),$++;break}case 9:{W=Math.ceil($/4)*4,Y.push(-2);while($++<W)Y.push(-1);break}case 10:{Y.push(-4),$=1;break}default:Q=!0,$=1}}B=q+1}if(z){if(Q)Y.push(-5);if(Z)Y.push(Z);Y.push(null)}return Y}}var mt=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function MI($){return $.replace(mt,ut)}function ut($,Z,J){if(Z)return Z;if(J.charCodeAt(0)===35){let X=J.charCodeAt(1),H=X===120||X===88;return eY(J.slice(H?2:1),H?16:10)}return x$(J)||$}var DI={}.hasOwnProperty;function iF($,Z,J){if(Z&&typeof Z==="object")J=Z,Z=void 0;return pt(J)(dF(cF(J).document().write(lF()($,Z,!0))))}function pt($){let Z={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:H(p),autolinkProtocol:x,autolinkEmail:x,atxHeading:H(G0),blockQuote:H(H0),characterEscape:x,characterReference:x,codeFenced:H(N0),codeFencedFenceInfo:G,codeFencedFenceMeta:G,codeIndented:H(N0,G),codeText:H(c,G),codeTextData:x,data:x,codeFlowValue:x,definition:H(Z0),definitionDestinationString:G,definitionLabelString:G,definitionTitleString:G,emphasis:H($0),hardBreakEscape:H(r),hardBreakTrailing:H(r),htmlFlow:H(Q0,G),htmlFlowData:x,htmlText:H(Q0,G),htmlTextData:x,image:H(a),label:G,link:H(p),listItem:H(n),listItemValue:q,listOrdered:H(o,B),listUnordered:H(o),paragraph:H(V0),reference:h,referenceString:G,resourceDestinationString:G,resourceTitleString:G,setextHeading:H(G0),strong:H(w0),thematicBreak:H(c0)},exit:{atxHeading:Y(),atxHeadingSequence:_,autolink:Y(),autolinkEmail:J0,autolinkProtocol:B0,blockQuote:Y(),characterEscapeValue:I,characterReferenceMarkerHexadecimal:M0,characterReferenceMarkerNumeric:M0,characterReferenceValue:d,characterReference:Y0,codeFenced:Y(L),codeFencedFence:N,codeFencedFenceInfo:U,codeFencedFenceMeta:F,codeFlowValue:I,codeIndented:Y(V),codeText:Y(S),codeTextData:I,data:I,definition:Y(),definitionDestinationString:O,definitionLabelString:M,definitionTitleString:A,emphasis:Y(),hardBreakEscape:Y(C),hardBreakTrailing:Y(C),htmlFlow:Y(j),htmlFlowData:I,htmlText:Y(R),htmlTextData:I,image:Y(b),label:u,labelText:g,lineEnding:y,link:Y(E),listItem:Y(),listOrdered:Y(),listUnordered:Y(),paragraph:Y(),referenceString:t,resourceDestinationString:w,resourceTitleString:s,resource:z0,setextHeading:Y(k),setextHeadingLineSequence:T,setextHeadingText:D,strong:Y(),thematicBreak:Y()}};_I(Z,($||{}).mdastExtensions||[]);let J={};return Q;function Q(m){let i={type:"root",children:[]},f={stack:[i],tokenStack:[],config:Z,enter:z,exit:K,buffer:G,resume:W,data:J},X0=[],L0=-1;while(++L0<m.length)if(m[L0][1].type==="listOrdered"||m[L0][1].type==="listUnordered")if(m[L0][0]==="enter")X0.push(L0);else{let k0=X0.pop();L0=X(m,k0,L0)}L0=-1;while(++L0<m.length){let k0=Z[m[L0][0]];if(DI.call(k0,m[L0][1].type))k0[m[L0][1].type].call(Object.assign({sliceSerialize:m[L0][2].sliceSerialize},f),m[L0][1])}if(f.tokenStack.length>0){let k0=f.tokenStack[f.tokenStack.length-1];(k0[1]||AI).call(f,void 0,k0[0])}i.position={start:E6(m.length>0?m[0][1].start:{line:1,column:1,offset:0}),end:E6(m.length>0?m[m.length-2][1].end:{line:1,column:1,offset:0})},L0=-1;while(++L0<Z.transforms.length)i=Z.transforms[L0](i)||i;return i}function X(m,i,f){let X0=i-1,L0=-1,k0=!1,r0,J5,m0,P0;while(++X0<=f){let f0=m[X0];switch(f0[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{if(f0[0]==="enter")L0++;else L0--;P0=void 0;break}case"lineEndingBlank":{if(f0[0]==="enter"){if(r0&&!P0&&!L0&&!m0)m0=X0;P0=void 0}break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:P0=void 0}if(!L0&&f0[0]==="enter"&&f0[1].type==="listItemPrefix"||L0===-1&&f0[0]==="exit"&&(f0[1].type==="listUnordered"||f0[1].type==="listOrdered")){if(r0){let h0=X0;J5=void 0;while(h0--){let a0=m[h0];if(a0[1].type==="lineEnding"||a0[1].type==="lineEndingBlank"){if(a0[0]==="exit")continue;if(J5)m[J5][1].type="lineEndingBlank",k0=!0;a0[1].type="lineEnding",J5=h0}else if(a0[1].type==="linePrefix"||a0[1].type==="blockQuotePrefix"||a0[1].type==="blockQuotePrefixWhitespace"||a0[1].type==="blockQuoteMarker"||a0[1].type==="listItemIndent");else break}if(m0&&(!J5||m0<J5))r0._spread=!0;r0.end=Object.assign({},J5?m[J5][1].start:f0[1].end),m.splice(J5||X0,0,["exit",r0,f0[2]]),X0++,f++}if(f0[1].type==="listItemPrefix"){let h0={type:"listItem",_spread:!1,start:Object.assign({},f0[1].start),end:void 0};r0=h0,m.splice(X0,0,["enter",h0,f0[2]]),X0++,f++,m0=void 0,P0=!0}}}return m[i][1]._spread=k0,f}function H(m,i){return f;function f(X0){if(z.call(this,m(X0),X0),i)i.call(this,X0)}}function G(){this.stack.push({type:"fragment",children:[]})}function z(m,i,f){this.stack[this.stack.length-1].children.push(m),this.stack.push(m),this.tokenStack.push([i,f||void 0]),m.position={start:E6(i.start),end:void 0}}function Y(m){return i;function i(f){if(m)m.call(this,f);K.call(this,f)}}function K(m,i){let f=this.stack.pop(),X0=this.tokenStack.pop();if(!X0)throw Error("Cannot close `"+m.type+"` ("+j6({start:m.start,end:m.end})+"): it’s not open");else if(X0[0].type!==m.type)if(i)i.call(this,m,X0[0]);else(X0[1]||AI).call(this,m,X0[0]);f.position.end=E6(m.end)}function W(){return i3(this.stack.pop())}function B(){this.data.expectingFirstListItemValue=!0}function q(m){if(this.data.expectingFirstListItemValue){let i=this.stack[this.stack.length-2];i.start=Number.parseInt(this.sliceSerialize(m),10),this.data.expectingFirstListItemValue=void 0}}function U(){let m=this.resume(),i=this.stack[this.stack.length-1];i.lang=m}function F(){let m=this.resume(),i=this.stack[this.stack.length-1];i.meta=m}function N(){if(this.data.flowCodeInside)return;this.buffer(),this.data.flowCodeInside=!0}function L(){let m=this.resume(),i=this.stack[this.stack.length-1];i.value=m.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function V(){let m=this.resume(),i=this.stack[this.stack.length-1];i.value=m.replace(/(\r?\n|\r)$/g,"")}function M(m){let i=this.resume(),f=this.stack[this.stack.length-1];f.label=i,f.identifier=b8(this.sliceSerialize(m)).toLowerCase()}function A(){let m=this.resume(),i=this.stack[this.stack.length-1];i.title=m}function O(){let m=this.resume(),i=this.stack[this.stack.length-1];i.url=m}function _(m){let i=this.stack[this.stack.length-1];if(!i.depth){let f=this.sliceSerialize(m).length;i.depth=f}}function D(){this.data.setextHeadingSlurpLineEnding=!0}function T(m){let i=this.stack[this.stack.length-1];i.depth=this.sliceSerialize(m).codePointAt(0)===61?1:2}function k(){this.data.setextHeadingSlurpLineEnding=void 0}function x(m){let f=this.stack[this.stack.length-1].children,X0=f[f.length-1];if(!X0||X0.type!=="text")X0=v0(),X0.position={start:E6(m.start),end:void 0},f.push(X0);this.stack.push(X0)}function I(m){let i=this.stack.pop();i.value+=this.sliceSerialize(m),i.position.end=E6(m.end)}function y(m){let i=this.stack[this.stack.length-1];if(this.data.atHardBreak){let f=i.children[i.children.length-1];f.position.end=E6(m.end),this.data.atHardBreak=void 0;return}if(!this.data.setextHeadingSlurpLineEnding&&Z.canContainEols.includes(i.type))x.call(this,m),I.call(this,m)}function C(){this.data.atHardBreak=!0}function j(){let m=this.resume(),i=this.stack[this.stack.length-1];i.value=m}function R(){let m=this.resume(),i=this.stack[this.stack.length-1];i.value=m}function S(){let m=this.resume(),i=this.stack[this.stack.length-1];i.value=m}function E(){let m=this.stack[this.stack.length-1];if(this.data.inReference){let i=this.data.referenceType||"shortcut";m.type+="Reference",m.referenceType=i,delete m.url,delete m.title}else delete m.identifier,delete m.label;this.data.referenceType=void 0}function b(){let m=this.stack[this.stack.length-1];if(this.data.inReference){let i=this.data.referenceType||"shortcut";m.type+="Reference",m.referenceType=i,delete m.url,delete m.title}else delete m.identifier,delete m.label;this.data.referenceType=void 0}function g(m){let i=this.sliceSerialize(m),f=this.stack[this.stack.length-2];f.label=MI(i),f.identifier=b8(i).toLowerCase()}function u(){let m=this.stack[this.stack.length-1],i=this.resume(),f=this.stack[this.stack.length-1];if(this.data.inReference=!0,f.type==="link"){let X0=m.children;f.children=X0}else f.alt=i}function w(){let m=this.resume(),i=this.stack[this.stack.length-1];i.url=m}function s(){let m=this.resume(),i=this.stack[this.stack.length-1];i.title=m}function z0(){this.data.inReference=void 0}function h(){this.data.referenceType="collapsed"}function t(m){let i=this.resume(),f=this.stack[this.stack.length-1];f.label=i,f.identifier=b8(this.sliceSerialize(m)).toLowerCase(),this.data.referenceType="full"}function M0(m){this.data.characterReferenceType=m.type}function d(m){let i=this.sliceSerialize(m),f=this.data.characterReferenceType,X0;if(f)X0=eY(i,f==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0;else X0=x$(i);let L0=this.stack[this.stack.length-1];L0.value+=X0}function Y0(m){let i=this.stack.pop();i.position.end=E6(m.end)}function B0(m){I.call(this,m);let i=this.stack[this.stack.length-1];i.url=this.sliceSerialize(m)}function J0(m){I.call(this,m);let i=this.stack[this.stack.length-1];i.url="mailto:"+this.sliceSerialize(m)}function H0(){return{type:"blockquote",children:[]}}function N0(){return{type:"code",lang:null,meta:null,value:""}}function c(){return{type:"inlineCode",value:""}}function Z0(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function $0(){return{type:"emphasis",children:[]}}function G0(){return{type:"heading",depth:0,children:[]}}function r(){return{type:"break"}}function Q0(){return{type:"html",value:""}}function a(){return{type:"image",title:null,url:"",alt:null}}function p(){return{type:"link",title:null,url:"",children:[]}}function o(m){return{type:"list",ordered:m.type==="listOrdered",start:null,spread:m._spread,children:[]}}function n(m){return{type:"listItem",spread:m._spread,checked:null,children:[]}}function V0(){return{type:"paragraph",children:[]}}function w0(){return{type:"strong",children:[]}}function v0(){return{type:"text",value:""}}function c0(){return{type:"thematicBreak"}}}function E6($){return{line:$.line,column:$.column,offset:$.offset}}function _I($,Z){let J=-1;while(++J<Z.length){let Q=Z[J];if(Array.isArray(Q))_I($,Q);else ct($,Q)}}function ct($,Z){let J;for(J in Z)if(DI.call(Z,J))switch(J){case"canContainEols":{let Q=Z[J];if(Q)$[J].push(...Q);break}case"transforms":{let Q=Z[J];if(Q)$[J].push(...Q);break}case"enter":case"exit":{let Q=Z[J];if(Q)Object.assign($[J],Q);break}}}function AI($,Z){if($)throw Error("Cannot close `"+$.type+"` ("+j6({start:$.start,end:$.end})+"): a different token (`"+Z.type+"`, "+j6({start:Z.start,end:Z.end})+") is open");else throw Error("Cannot close document, a token (`"+Z.type+"`, "+j6({start:Z.start,end:Z.end})+") is still open")}function KK($){let Z=this;Z.parser=J;function J(Q){return iF(Q,{...Z.data("settings"),...$,extensions:Z.data("micromarkExtensions")||[],mdastExtensions:Z.data("fromMarkdownExtensions")||[]})}}var WK=-1,h$=0,t3=1,g$=2,jQ=3,CQ=4,TQ=5,EQ=6,BK=7,qK=8;var OI=typeof self==="object"?self:globalThis,dt=($,Z)=>{let J=(X,H)=>{return $.set(H,X),X},Q=(X)=>{if($.has(X))return $.get(X);let[H,G]=Z[X];switch(H){case h$:case WK:return J(G,X);case t3:{let z=J([],X);for(let Y of G)z.push(Q(Y));return z}case g$:{let z=J({},X);for(let[Y,K]of G)z[Q(Y)]=Q(K);return z}case jQ:return J(new Date(G),X);case CQ:{let{source:z,flags:Y}=G;return J(new RegExp(z,Y),X)}case TQ:{let z=J(new Map,X);for(let[Y,K]of G)z.set(Q(Y),Q(K));return z}case EQ:{let z=J(new Set,X);for(let Y of G)z.add(Q(Y));return z}case BK:{let{name:z,message:Y}=G;return J(new OI[z](Y),X)}case qK:return J(BigInt(G),X);case"BigInt":return J(Object(BigInt(G)),X);case"ArrayBuffer":return J(new Uint8Array(G).buffer,G);case"DataView":{let{buffer:z}=new Uint8Array(G);return J(new DataView(z),G)}}return J(new OI[H](G),X)};return Q},rF=($)=>dt(new Map,$)(0);var v$="",{toString:lt}={},{keys:it}=Object,IQ=($)=>{let Z=typeof $;if(Z!=="object"||!$)return[h$,Z];let J=lt.call($).slice(8,-1);switch(J){case"Array":return[t3,v$];case"Object":return[g$,v$];case"Date":return[jQ,v$];case"RegExp":return[CQ,v$];case"Map":return[TQ,v$];case"Set":return[EQ,v$];case"DataView":return[t3,J]}if(J.includes("Array"))return[t3,J];if(J.includes("Error"))return[BK,J];return[g$,J]},UK=([$,Z])=>$===h$&&(Z==="function"||Z==="symbol"),rt=($,Z,J,Q)=>{let X=(G,z)=>{let Y=Q.push(G)-1;return J.set(z,Y),Y},H=(G)=>{if(J.has(G))return J.get(G);let[z,Y]=IQ(G);switch(z){case h$:{let W=G;switch(Y){case"bigint":z=qK,W=G.toString();break;case"function":case"symbol":if($)throw TypeError("unable to serialize "+Y);W=null;break;case"undefined":return X([WK],G)}return X([z,W],G)}case t3:{if(Y){let q=G;if(Y==="DataView")q=new Uint8Array(G.buffer);else if(Y==="ArrayBuffer")q=new Uint8Array(G);return X([Y,[...q]],G)}let W=[],B=X([z,W],G);for(let q of G)W.push(H(q));return B}case g$:{if(Y)switch(Y){case"BigInt":return X([Y,G.toString()],G);case"Boolean":case"Number":case"String":return X([Y,G.valueOf()],G)}if(Z&&"toJSON"in G)return H(G.toJSON());let W=[],B=X([z,W],G);for(let q of it(G))if($||!UK(IQ(G[q])))W.push([H(q),H(G[q])]);return B}case jQ:return X([z,G.toISOString()],G);case CQ:{let{source:W,flags:B}=G;return X([z,{source:W,flags:B}],G)}case TQ:{let W=[],B=X([z,W],G);for(let[q,U]of G)if($||!(UK(IQ(q))||UK(IQ(U))))W.push([H(q),H(U)]);return B}case EQ:{let W=[],B=X([z,W],G);for(let q of G)if($||!UK(IQ(q)))W.push(H(q));return B}}let{message:K}=G;return X([z,{name:Y,message:K}],G)};return H},aF=($,{json:Z,lossy:J}={})=>{let Q=[];return rt(!(Z||J),!!Z,new Map,Q)($),Q};var f$=typeof structuredClone==="function"?($,Z)=>Z&&(("json"in Z)||("lossy"in Z))?rF(aF($,Z)):structuredClone($):($,Z)=>rF(aF($,Z));function at($,Z){let J=[{type:"text",value:"↩"}];if(Z>1)J.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(Z)}]});return J}function nt($,Z){return"Back to reference "+($+1)+(Z>1?"-"+Z:"")}function PI($){let Z=typeof $.options.clobberPrefix==="string"?$.options.clobberPrefix:"user-content-",J=$.options.footnoteBackContent||at,Q=$.options.footnoteBackLabel||nt,X=$.options.footnoteLabel||"Footnotes",H=$.options.footnoteLabelTagName||"h2",G=$.options.footnoteLabelProperties||{className:["sr-only"]},z=[],Y=-1;while(++Y<$.footnoteOrder.length){let K=$.footnoteById.get($.footnoteOrder[Y]);if(!K)continue;let W=$.all(K),B=String(K.identifier).toUpperCase(),q=n4(B.toLowerCase()),U=0,F=[],N=$.footnoteCounts.get(B);while(N!==void 0&&++U<=N){if(F.length>0)F.push({type:"text",value:" "});let M=typeof J==="string"?J:J(Y,U);if(typeof M==="string")M={type:"text",value:M};F.push({type:"element",tagName:"a",properties:{href:"#"+Z+"fnref-"+q+(U>1?"-"+U:""),dataFootnoteBackref:"",ariaLabel:typeof Q==="string"?Q:Q(Y,U),className:["data-footnote-backref"]},children:Array.isArray(M)?M:[M]})}let L=W[W.length-1];if(L&&L.type==="element"&&L.tagName==="p"){let M=L.children[L.children.length-1];if(M&&M.type==="text")M.value+=" ";else L.children.push({type:"text",value:" "});L.children.push(...F)}else W.push(...F);let V={type:"element",tagName:"li",properties:{id:Z+"fn-"+q},children:$.wrap(W,!0)};$.patch(K,V),z.push(V)}if(z.length===0)return;return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:H,properties:{...f$(G),id:"footnote-label"},children:[{type:"text",value:X}]},{type:"text",value:`
|
|
32
|
-
`},{type:"element",tagName:"ol",properties:{},children:$.wrap(z,!0)},{type:"text",value:`
|
|
33
|
-
`}]}}var i2=function($){if($===null||$===void 0)return et;if(typeof $==="function")return FK($);if(typeof $==="object")return Array.isArray($)?st($):ot($);if(typeof $==="string")return tt($);throw Error("Expected function, string, or object as test")};function st($){let Z=[],J=-1;while(++J<$.length)Z[J]=i2($[J]);return FK(Q);function Q(...X){let H=-1;while(++H<Z.length)if(Z[H].apply(this,X))return!0;return!1}}function ot($){let Z=$;return FK(J);function J(Q){let X=Q,H;for(H in $)if(X[H]!==Z[H])return!1;return!0}}function tt($){return FK(Z);function Z(J){return J&&J.type===$}}function FK($){return Z;function Z(J,Q,X){return Boolean($e(J)&&$.call(this,J,typeof Q==="number"?Q:void 0,X||void 0))}}function et(){return!0}function $e($){return $!==null&&typeof $==="object"&&"type"in $}function wI($){return $}var jI=[],NK=!0,e3=!1,VK="skip";function RQ($,Z,J,Q){let X;if(typeof Z==="function"&&typeof J!=="function")Q=J,J=Z;else X=Z;let H=i2(X),G=Q?-1:1;z($,void 0,[])();function z(Y,K,W){let B=Y&&typeof Y==="object"?Y:{};if(typeof B.type==="string"){let U=typeof B.tagName==="string"?B.tagName:typeof B.name==="string"?B.name:void 0;Object.defineProperty(q,"name",{value:"node ("+wI(Y.type+(U?"<"+U+">":""))+")"})}return q;function q(){let U=jI,F,N,L;if(!Z||H(Y,K,W[W.length-1]||void 0)){if(U=Ze(J(Y,W)),U[0]===e3)return U}if("children"in Y&&Y.children){let V=Y;if(V.children&&U[0]!==VK){N=(Q?V.children.length:-1)+G,L=W.concat(V);while(N>-1&&N<V.children.length){let M=V.children[N];if(F=z(M,N,L)(),F[0]===e3)return F;N=typeof F[1]==="number"?F[1]:N+G}}}return U}}}function Ze($){if(Array.isArray($))return $;if(typeof $==="number")return[NK,$];return $===null||$===void 0?jI:[$]}function L9($,Z,J,Q){let X,H,G;if(typeof Z==="function"&&typeof J!=="function")H=void 0,G=Z,X=J;else H=Z,G=J,X=Q;RQ($,H,z,X);function z(Y,K){let W=K[K.length-1],B=W?W.children.indexOf(Y):void 0;return G(Y,B,W)}}function CI($,Z){let J={type:"element",tagName:"blockquote",properties:{},children:$.wrap($.all(Z),!0)};return $.patch(Z,J),$.applyData(Z,J)}function TI($,Z){let J={type:"element",tagName:"br",properties:{},children:[]};return $.patch(Z,J),[$.applyData(Z,J),{type:"text",value:`
|
|
34
|
-
`}]}function EI($,Z){let J=Z.value?Z.value+`
|
|
35
|
-
`:"",Q={},X=Z.lang?Z.lang.split(/\s+/):[];if(X.length>0)Q.className=["language-"+X[0]];let H={type:"element",tagName:"code",properties:Q,children:[{type:"text",value:J}]};if(Z.meta)H.data={meta:Z.meta};return $.patch(Z,H),H=$.applyData(Z,H),H={type:"element",tagName:"pre",properties:{},children:[H]},$.patch(Z,H),H}function II($,Z){let J={type:"element",tagName:"del",properties:{},children:$.all(Z)};return $.patch(Z,J),$.applyData(Z,J)}function RI($,Z){let J={type:"element",tagName:"em",properties:{},children:$.all(Z)};return $.patch(Z,J),$.applyData(Z,J)}function kI($,Z){let J=typeof $.options.clobberPrefix==="string"?$.options.clobberPrefix:"user-content-",Q=String(Z.identifier).toUpperCase(),X=n4(Q.toLowerCase()),H=$.footnoteOrder.indexOf(Q),G,z=$.footnoteCounts.get(Q);if(z===void 0)z=0,$.footnoteOrder.push(Q),G=$.footnoteOrder.length;else G=H+1;z+=1,$.footnoteCounts.set(Q,z);let Y={type:"element",tagName:"a",properties:{href:"#"+J+"fn-"+X,id:J+"fnref-"+X+(z>1?"-"+z:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(G)}]};$.patch(Z,Y);let K={type:"element",tagName:"sup",properties:{},children:[Y]};return $.patch(Z,K),$.applyData(Z,K)}function SI($,Z){let J={type:"element",tagName:"h"+Z.depth,properties:{},children:$.all(Z)};return $.patch(Z,J),$.applyData(Z,J)}function bI($,Z){if($.options.allowDangerousHtml){let J={type:"raw",value:Z.value};return $.patch(Z,J),$.applyData(Z,J)}return}function LK($,Z){let J=Z.referenceType,Q="]";if(J==="collapsed")Q+="[]";else if(J==="full")Q+="["+(Z.label||Z.identifier)+"]";if(Z.type==="imageReference")return[{type:"text",value:"!["+Z.alt+Q}];let X=$.all(Z),H=X[0];if(H&&H.type==="text")H.value="["+H.value;else X.unshift({type:"text",value:"["});let G=X[X.length-1];if(G&&G.type==="text")G.value+=Q;else X.push({type:"text",value:Q});return X}function yI($,Z){let J=String(Z.identifier).toUpperCase(),Q=$.definitionById.get(J);if(!Q)return LK($,Z);let X={src:n4(Q.url||""),alt:Z.alt};if(Q.title!==null&&Q.title!==void 0)X.title=Q.title;let H={type:"element",tagName:"img",properties:X,children:[]};return $.patch(Z,H),$.applyData(Z,H)}function xI($,Z){let J={src:n4(Z.url)};if(Z.alt!==null&&Z.alt!==void 0)J.alt=Z.alt;if(Z.title!==null&&Z.title!==void 0)J.title=Z.title;let Q={type:"element",tagName:"img",properties:J,children:[]};return $.patch(Z,Q),$.applyData(Z,Q)}function hI($,Z){let J={type:"text",value:Z.value.replace(/\r?\n|\r/g," ")};$.patch(Z,J);let Q={type:"element",tagName:"code",properties:{},children:[J]};return $.patch(Z,Q),$.applyData(Z,Q)}function gI($,Z){let J=String(Z.identifier).toUpperCase(),Q=$.definitionById.get(J);if(!Q)return LK($,Z);let X={href:n4(Q.url||"")};if(Q.title!==null&&Q.title!==void 0)X.title=Q.title;let H={type:"element",tagName:"a",properties:X,children:$.all(Z)};return $.patch(Z,H),$.applyData(Z,H)}function vI($,Z){let J={href:n4(Z.url)};if(Z.title!==null&&Z.title!==void 0)J.title=Z.title;let Q={type:"element",tagName:"a",properties:J,children:$.all(Z)};return $.patch(Z,Q),$.applyData(Z,Q)}function fI($,Z,J){let Q=$.all(Z),X=J?Je(J):mI(Z),H={},G=[];if(typeof Z.checked==="boolean"){let W=Q[0],B;if(W&&W.type==="element"&&W.tagName==="p")B=W;else B={type:"element",tagName:"p",properties:{},children:[]},Q.unshift(B);if(B.children.length>0)B.children.unshift({type:"text",value:" "});B.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:Z.checked,disabled:!0},children:[]}),H.className=["task-list-item"]}let z=-1;while(++z<Q.length){let W=Q[z];if(X||z!==0||W.type!=="element"||W.tagName!=="p")G.push({type:"text",value:`
|
|
36
|
-
`});if(W.type==="element"&&W.tagName==="p"&&!X)G.push(...W.children);else G.push(W)}let Y=Q[Q.length-1];if(Y&&(X||Y.type!=="element"||Y.tagName!=="p"))G.push({type:"text",value:`
|
|
37
|
-
`});let K={type:"element",tagName:"li",properties:H,children:G};return $.patch(Z,K),$.applyData(Z,K)}function Je($){let Z=!1;if($.type==="list"){Z=$.spread||!1;let J=$.children,Q=-1;while(!Z&&++Q<J.length)Z=mI(J[Q])}return Z}function mI($){let Z=$.spread;return Z===null||Z===void 0?$.children.length>1:Z}function uI($,Z){let J={},Q=$.all(Z),X=-1;if(typeof Z.start==="number"&&Z.start!==1)J.start=Z.start;while(++X<Q.length){let G=Q[X];if(G.type==="element"&&G.tagName==="li"&&G.properties&&Array.isArray(G.properties.className)&&G.properties.className.includes("task-list-item")){J.className=["contains-task-list"];break}}let H={type:"element",tagName:Z.ordered?"ol":"ul",properties:J,children:$.wrap(Q,!0)};return $.patch(Z,H),$.applyData(Z,H)}function pI($,Z){let J={type:"element",tagName:"p",properties:{},children:$.all(Z)};return $.patch(Z,J),$.applyData(Z,J)}function cI($,Z){let J={type:"root",children:$.wrap($.all(Z))};return $.patch(Z,J),$.applyData(Z,J)}function dI($,Z){let J={type:"element",tagName:"strong",properties:{},children:$.all(Z)};return $.patch(Z,J),$.applyData(Z,J)}function lI($,Z){let J=$.all(Z),Q=J.shift(),X=[];if(Q){let G={type:"element",tagName:"thead",properties:{},children:$.wrap([Q],!0)};$.patch(Z.children[0],G),X.push(G)}if(J.length>0){let G={type:"element",tagName:"tbody",properties:{},children:$.wrap(J,!0)},z=y$(Z.children[1]),Y=oY(Z.children[Z.children.length-1]);if(z&&Y)G.position={start:z,end:Y};X.push(G)}let H={type:"element",tagName:"table",properties:{},children:$.wrap(X,!0)};return $.patch(Z,H),$.applyData(Z,H)}function iI($,Z,J){let Q=J?J.children:void 0,H=(Q?Q.indexOf(Z):1)===0?"th":"td",G=J&&J.type==="table"?J.align:void 0,z=G?G.length:Z.children.length,Y=-1,K=[];while(++Y<z){let B=Z.children[Y],q={},U=G?G[Y]:void 0;if(U)q.align=U;let F={type:"element",tagName:H,properties:q,children:[]};if(B)F.children=$.all(B),$.patch(B,F),F=$.applyData(B,F);K.push(F)}let W={type:"element",tagName:"tr",properties:{},children:$.wrap(K,!0)};return $.patch(Z,W),$.applyData(Z,W)}function rI($,Z){let J={type:"element",tagName:"td",properties:{},children:$.all(Z)};return $.patch(Z,J),$.applyData(Z,J)}function nI($){let Z=String($),J=/\r?\n|\r/g,Q=J.exec(Z),X=0,H=[];while(Q)H.push(aI(Z.slice(X,Q.index),X>0,!0),Q[0]),X=Q.index+Q[0].length,Q=J.exec(Z);return H.push(aI(Z.slice(X),X>0,!1)),H.join("")}function aI($,Z,J){let Q=0,X=$.length;if(Z){let H=$.codePointAt(Q);while(H===9||H===32)Q++,H=$.codePointAt(Q)}if(J){let H=$.codePointAt(X-1);while(H===9||H===32)X--,H=$.codePointAt(X-1)}return X>Q?$.slice(Q,X):""}function sI($,Z){let J={type:"text",value:nI(String(Z.value))};return $.patch(Z,J),$.applyData(Z,J)}function oI($,Z){let J={type:"element",tagName:"hr",properties:{},children:[]};return $.patch(Z,J),$.applyData(Z,J)}var tI={blockquote:CI,break:TI,code:EI,delete:II,emphasis:RI,footnoteReference:kI,heading:SI,html:bI,imageReference:yI,image:xI,inlineCode:hI,linkReference:gI,link:vI,listItem:fI,list:uI,paragraph:pI,root:cI,strong:dI,table:lI,tableCell:rI,tableRow:iI,text:sI,thematicBreak:oI,toml:MK,yaml:MK,definition:MK,footnoteDefinition:MK};function MK(){return}var nF={}.hasOwnProperty,Qe={};function $R($,Z){let J=Z||Qe,Q=new Map,X=new Map,H=new Map,G={...tI,...J.handlers},z={all:K,applyData:He,definitionById:Q,footnoteById:X,footnoteCounts:H,footnoteOrder:[],handlers:G,one:Y,options:J,patch:Xe,wrap:ze};return L9($,function(W){if(W.type==="definition"||W.type==="footnoteDefinition"){let B=W.type==="definition"?Q:X,q=String(W.identifier).toUpperCase();if(!B.has(q))B.set(q,W)}}),z;function Y(W,B){let q=W.type,U=z.handlers[q];if(nF.call(z.handlers,q)&&U)return U(z,W,B);if(z.options.passThrough&&z.options.passThrough.includes(q)){if("children"in W){let{children:N,...L}=W,V=f$(L);return V.children=z.all(W),V}return f$(W)}return(z.options.unknownHandler||Ge)(z,W,B)}function K(W){let B=[];if("children"in W){let q=W.children,U=-1;while(++U<q.length){let F=z.one(q[U],W);if(F){if(U&&q[U-1].type==="break"){if(!Array.isArray(F)&&F.type==="text")F.value=eI(F.value);if(!Array.isArray(F)&&F.type==="element"){let N=F.children[0];if(N&&N.type==="text")N.value=eI(N.value)}}if(Array.isArray(F))B.push(...F);else B.push(F)}}}return B}}function Xe($,Z){if($.position)Z.position=wF($)}function He($,Z){let J=Z;if($&&$.data){let Q=$.data.hName,X=$.data.hChildren,H=$.data.hProperties;if(typeof Q==="string")if(J.type==="element")J.tagName=Q;else{let G="children"in J?J.children:[J];J={type:"element",tagName:Q,properties:{},children:G}}if(J.type==="element"&&H)Object.assign(J.properties,f$(H));if("children"in J&&J.children&&X!==null&&X!==void 0)J.children=X}return J}function Ge($,Z){let J=Z.data||{},Q="value"in Z&&!(nF.call(J,"hProperties")||nF.call(J,"hChildren"))?{type:"text",value:Z.value}:{type:"element",tagName:"div",properties:{},children:$.all(Z)};return $.patch(Z,Q),$.applyData(Z,Q)}function ze($,Z){let J=[],Q=-1;if(Z)J.push({type:"text",value:`
|
|
38
|
-
`});while(++Q<$.length){if(Q)J.push({type:"text",value:`
|
|
39
|
-
`});J.push($[Q])}if(Z&&$.length>0)J.push({type:"text",value:`
|
|
40
|
-
`});return J}function eI($){let Z=0,J=$.charCodeAt(Z);while(J===9||J===32)Z++,J=$.charCodeAt(Z);return $.slice(Z)}function AK($,Z){let J=$R($,Z),Q=J.one($,void 0),X=PI(J),H=Array.isArray(Q)?{type:"root",children:Q}:Q||{type:"root",children:[]};if(X)R5("children"in H),H.children.push({type:"text",value:`
|
|
41
|
-
`},X);return H}function DK($,Z){if($&&"run"in $)return async function(J,Q){let X=AK(J,{file:Q,...Z});await $.run(X,Q)};return function(J,Q){return AK(J,{file:Q,...$||Z})}}function sF($){if($)throw $}var PK=P(KR(),1);function kQ($){if(typeof $!=="object"||$===null)return!1;let Z=Object.getPrototypeOf($);return(Z===null||Z===Object.prototype||Object.getPrototypeOf(Z)===null)&&!(Symbol.toStringTag in $)&&!(Symbol.iterator in $)}function oF(){let $=[],Z={run:J,use:Q};return Z;function J(...X){let H=-1,G=X.pop();if(typeof G!=="function")throw TypeError("Expected function as last argument, not "+G);z(null,...X);function z(Y,...K){let W=$[++H],B=-1;if(Y){G(Y);return}while(++B<X.length)if(K[B]===null||K[B]===void 0)K[B]=X[B];if(X=K,W)WR(W,z)(...K);else G(null,...K)}}function Q(X){if(typeof X!=="function")throw TypeError("Expected `middelware` to be a function, not "+X);return $.push(X),Z}}function WR($,Z){let J;return Q;function Q(...G){let z=$.length>G.length,Y;if(z)G.push(X);try{Y=$.apply(this,G)}catch(K){let W=K;if(z&&J)throw W;return X(W)}if(!z)if(Y&&Y.then&&typeof Y.then==="function")Y.then(H,X);else if(Y instanceof Error)X(Y);else H(Y)}function X(G,...z){if(!J)J=!0,Z(G,...z)}function H(G){X(null,G)}}var q2={basename:Ye,dirname:Ke,extname:We,join:Be,sep:"/"};function Ye($,Z){if(Z!==void 0&&typeof Z!=="string")throw TypeError('"ext" argument must be a string');SQ($);let J=0,Q=-1,X=$.length,H;if(Z===void 0||Z.length===0||Z.length>$.length){while(X--)if($.codePointAt(X)===47){if(H){J=X+1;break}}else if(Q<0)H=!0,Q=X+1;return Q<0?"":$.slice(J,Q)}if(Z===$)return"";let G=-1,z=Z.length-1;while(X--)if($.codePointAt(X)===47){if(H){J=X+1;break}}else{if(G<0)H=!0,G=X+1;if(z>-1)if($.codePointAt(X)===Z.codePointAt(z--)){if(z<0)Q=X}else z=-1,Q=G}if(J===Q)Q=G;else if(Q<0)Q=$.length;return $.slice(J,Q)}function Ke($){if(SQ($),$.length===0)return".";let Z=-1,J=$.length,Q;while(--J)if($.codePointAt(J)===47){if(Q){Z=J;break}}else if(!Q)Q=!0;return Z<0?$.codePointAt(0)===47?"/":".":Z===1&&$.codePointAt(0)===47?"//":$.slice(0,Z)}function We($){SQ($);let Z=$.length,J=-1,Q=0,X=-1,H=0,G;while(Z--){let z=$.codePointAt(Z);if(z===47){if(G){Q=Z+1;break}continue}if(J<0)G=!0,J=Z+1;if(z===46){if(X<0)X=Z;else if(H!==1)H=1}else if(X>-1)H=-1}if(X<0||J<0||H===0||H===1&&X===J-1&&X===Q+1)return"";return $.slice(X,J)}function Be(...$){let Z=-1,J;while(++Z<$.length)if(SQ($[Z]),$[Z])J=J===void 0?$[Z]:J+"/"+$[Z];return J===void 0?".":qe(J)}function qe($){SQ($);let Z=$.codePointAt(0)===47,J=Ue($,!Z);if(J.length===0&&!Z)J=".";if(J.length>0&&$.codePointAt($.length-1)===47)J+="/";return Z?"/"+J:J}function Ue($,Z){let J="",Q=0,X=-1,H=0,G=-1,z,Y;while(++G<=$.length){if(G<$.length)z=$.codePointAt(G);else if(z===47)break;else z=47;if(z===47){if(X===G-1||H===1);else if(X!==G-1&&H===2){if(J.length<2||Q!==2||J.codePointAt(J.length-1)!==46||J.codePointAt(J.length-2)!==46){if(J.length>2){if(Y=J.lastIndexOf("/"),Y!==J.length-1){if(Y<0)J="",Q=0;else J=J.slice(0,Y),Q=J.length-1-J.lastIndexOf("/");X=G,H=0;continue}}else if(J.length>0){J="",Q=0,X=G,H=0;continue}}if(Z)J=J.length>0?J+"/..":"..",Q=2}else{if(J.length>0)J+="/"+$.slice(X+1,G);else J=$.slice(X+1,G);Q=G-X-1}X=G,H=0}else if(z===46&&H>-1)H++;else H=-1}return J}function SQ($){if(typeof $!=="string")throw TypeError("Path must be a string. Received "+JSON.stringify($))}var BR={cwd:Fe};function Fe(){return"/"}function m$($){return Boolean($!==null&&typeof $==="object"&&"href"in $&&$.href&&"protocol"in $&&$.protocol&&$.auth===void 0)}function qR($){if(typeof $==="string")$=new URL($);else if(!m$($)){let Z=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+$+"`");throw Z.code="ERR_INVALID_ARG_TYPE",Z}if($.protocol!=="file:"){let Z=TypeError("The URL must be of scheme file");throw Z.code="ERR_INVALID_URL_SCHEME",Z}return Ne($)}function Ne($){if($.hostname!==""){let Q=TypeError('File URL host must be "localhost" or empty on darwin');throw Q.code="ERR_INVALID_FILE_URL_HOST",Q}let Z=$.pathname,J=-1;while(++J<Z.length)if(Z.codePointAt(J)===37&&Z.codePointAt(J+1)===50){let Q=Z.codePointAt(J+2);if(Q===70||Q===102){let X=TypeError("File URL path must not include encoded / characters");throw X.code="ERR_INVALID_FILE_URL_PATH",X}}return decodeURIComponent(Z)}var tF=["history","path","basename","stem","extname","dirname"];class u${constructor($){let Z;if(!$)Z={};else if(m$($))Z={path:$};else if(typeof $==="string"||Ve($))Z={value:$};else Z=$;this.cwd="cwd"in Z?"":BR.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let J=-1;while(++J<tF.length){let X=tF[J];if(X in Z&&Z[X]!==void 0&&Z[X]!==null)this[X]=X==="history"?[...Z[X]]:Z[X]}let Q;for(Q in Z)if(!tF.includes(Q))this[Q]=Z[Q]}get basename(){return typeof this.path==="string"?q2.basename(this.path):void 0}set basename($){$N($,"basename"),eF($,"basename"),this.path=q2.join(this.dirname||"",$)}get dirname(){return typeof this.path==="string"?q2.dirname(this.path):void 0}set dirname($){UR(this.basename,"dirname"),this.path=q2.join($||"",this.basename)}get extname(){return typeof this.path==="string"?q2.extname(this.path):void 0}set extname($){if(eF($,"extname"),UR(this.dirname,"extname"),$){if($.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if($.includes(".",1))throw Error("`extname` cannot contain multiple dots")}this.path=q2.join(this.dirname,this.stem+($||""))}get path(){return this.history[this.history.length-1]}set path($){if(m$($))$=qR($);if($N($,"path"),this.path!==$)this.history.push($)}get stem(){return typeof this.path==="string"?q2.basename(this.path,this.extname):void 0}set stem($){$N($,"stem"),eF($,"stem"),this.path=q2.join(this.dirname||"",$+(this.extname||""))}fail($,Z,J){let Q=this.message($,Z,J);throw Q.fatal=!0,Q}info($,Z,J){let Q=this.message($,Z,J);return Q.fatal=void 0,Q}message($,Z,J){let Q=new c1($,Z,J);if(this.path)Q.name=this.path+":"+Q.name,Q.file=this.path;return Q.fatal=!1,this.messages.push(Q),Q}toString($){if(this.value===void 0)return"";if(typeof this.value==="string")return this.value;return new TextDecoder($||void 0).decode(this.value)}}function eF($,Z){if($&&$.includes(q2.sep))throw Error("`"+Z+"` cannot be a path: did not expect `"+q2.sep+"`")}function $N($,Z){if(!$)throw Error("`"+Z+"` cannot be empty")}function UR($,Z){if(!$)throw Error("Setting `"+Z+"` requires `path` to be set too")}function Ve($){return Boolean($&&typeof $==="object"&&"byteLength"in $&&"byteOffset"in $)}var FR=function($){let Q=this.constructor.prototype,X=Q[$],H=function(){return X.apply(H,arguments)};return Object.setPrototypeOf(H,Q),H};var Le={}.hasOwnProperty;class XN extends FR{constructor(){super("copy");this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=oF()}copy(){let $=new XN,Z=-1;while(++Z<this.attachers.length){let J=this.attachers[Z];$.use(...J)}return $.data(PK.default(!0,{},this.namespace)),$}data($,Z){if(typeof $==="string"){if(arguments.length===2)return QN("data",this.frozen),this.namespace[$]=Z,this;return Le.call(this.namespace,$)&&this.namespace[$]||void 0}if($)return QN("data",this.frozen),this.namespace=$,this;return this.namespace}freeze(){if(this.frozen)return this;let $=this;while(++this.freezeIndex<this.attachers.length){let[Z,...J]=this.attachers[this.freezeIndex];if(J[0]===!1)continue;if(J[0]===!0)J[0]=void 0;let Q=Z.call($,...J);if(typeof Q==="function")this.transformers.use(Q)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse($){this.freeze();let Z=OK($),J=this.parser||this.Parser;return ZN("parse",J),J(String(Z),Z)}process($,Z){let J=this;return this.freeze(),ZN("process",this.parser||this.Parser),JN("process",this.compiler||this.Compiler),Z?Q(void 0,Z):new Promise(Q);function Q(X,H){let G=OK($),z=J.parse(G);J.run(z,G,function(K,W,B){if(K||!W||!B)return Y(K);let q=W,U=J.stringify(q,B);if(Ae(U))B.value=U;else B.result=U;Y(K,B)});function Y(K,W){if(K||!W)H(K);else if(X)X(W);else R5(Z,"`done` is defined if `resolve` is not"),Z(void 0,W)}}}processSync($){let Z=!1,J;return this.freeze(),ZN("processSync",this.parser||this.Parser),JN("processSync",this.compiler||this.Compiler),this.process($,Q),VR("processSync","process",Z),R5(J,"we either bailed on an error or have a tree"),J;function Q(X,H){Z=!0,sF(X),J=H}}run($,Z,J){NR($),this.freeze();let Q=this.transformers;if(!J&&typeof Z==="function")J=Z,Z=void 0;return J?X(void 0,J):new Promise(X);function X(H,G){R5(typeof Z!=="function","`file` can’t be a `done` anymore, we checked");let z=OK(Z);Q.run($,z,Y);function Y(K,W,B){let q=W||$;if(K)G(K);else if(H)H(q);else R5(J,"`done` is defined if `resolve` is not"),J(void 0,q,B)}}}runSync($,Z){let J=!1,Q;return this.run($,Z,X),VR("runSync","run",J),R5(Q,"we either bailed on an error or have a tree"),Q;function X(H,G){sF(H),Q=G,J=!0}}stringify($,Z){this.freeze();let J=OK(Z),Q=this.compiler||this.Compiler;return JN("stringify",Q),NR($),Q($,J)}use($,...Z){let J=this.attachers,Q=this.namespace;if(QN("use",this.frozen),$===null||$===void 0);else if(typeof $==="function")z($,Z);else if(typeof $==="object")if(Array.isArray($))G($);else H($);else throw TypeError("Expected usable value, not `"+$+"`");return this;function X(Y){if(typeof Y==="function")z(Y,[]);else if(typeof Y==="object")if(Array.isArray(Y)){let[K,...W]=Y;z(K,W)}else H(Y);else throw TypeError("Expected usable value, not `"+Y+"`")}function H(Y){if(!("plugins"in Y)&&!("settings"in Y))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");if(G(Y.plugins),Y.settings)Q.settings=PK.default(!0,Q.settings,Y.settings)}function G(Y){let K=-1;if(Y===null||Y===void 0);else if(Array.isArray(Y))while(++K<Y.length){let W=Y[K];X(W)}else throw TypeError("Expected a list of plugins, not `"+Y+"`")}function z(Y,K){let W=-1,B=-1;while(++W<J.length)if(J[W][0]===Y){B=W;break}if(B===-1)J.push([Y,...K]);else if(K.length>0){let[q,...U]=K,F=J[B][1];if(kQ(F)&&kQ(q))q=PK.default(!0,F,q);J[B]=[Y,q,...U]}}}}var HN=new XN().freeze();function ZN($,Z){if(typeof Z!=="function")throw TypeError("Cannot `"+$+"` without `parser`")}function JN($,Z){if(typeof Z!=="function")throw TypeError("Cannot `"+$+"` without `compiler`")}function QN($,Z){if(Z)throw Error("Cannot call `"+$+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function NR($){if(!kQ($)||typeof $.type!=="string")throw TypeError("Expected node, got `"+$+"`")}function VR($,Z,J){if(!J)throw Error("`"+$+"` finished async. Use `"+Z+"` instead")}function OK($){return Me($)?$:new u$($)}function Me($){return Boolean($&&typeof $==="object"&&"message"in $&&"messages"in $)}function Ae($){return typeof $==="string"||De($)}function De($){return Boolean($&&typeof $==="object"&&"byteLength"in $&&"byteOffset"in $)}var _e="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",LR=[],MR={allowDangerousHtml:!0},Oe=/^(https?|ircs?|mailto|xmpp)$/i,Pe=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function wK($){let Z=we($),J=je($);return Ce(Z.runSync(Z.parse(J),J),$)}function we($){let Z=$.rehypePlugins||LR,J=$.remarkPlugins||LR,Q=$.remarkRehypeOptions?{...$.remarkRehypeOptions,...MR}:MR;return HN().use(KK).use(J).use(DK,Q).use(Z)}function je($){let Z=$.children||"",J=new u$;if(typeof Z==="string")J.value=Z;else lY("Unexpected value `"+Z+"` for `children` prop, expected `string`");return J}function Ce($,Z){let{allowedElements:J,allowElement:Q,components:X,disallowedElements:H,skipHtml:G,unwrapDisallowed:z}=Z,Y=Z.urlTransform||DR;for(let W of Pe)if(Object.hasOwn(Z,W.from))lY("Unexpected `"+W.from+"` prop, "+(W.to?"use `"+W.to+"` instead":"remove it")+" (see <"+_e+"#"+W.id+"> for more info)");if(J&&H)lY("Unexpected combined `allowedElements` and `disallowedElements`, expected one or the other");return L9($,K),TF($,{Fragment:p$.Fragment,components:X,ignoreInvalidStyle:!0,jsx:p$.jsx,jsxs:p$.jsxs,passKeys:!0,passNode:!0});function K(W,B,q){if(W.type==="raw"&&q&&typeof B==="number"){if(G)q.children.splice(B,1);else q.children[B]={type:"text",value:W.value};return B}if(W.type==="element"){let U;for(U in AQ)if(Object.hasOwn(AQ,U)&&Object.hasOwn(W.properties,U)){let F=W.properties[U],N=AQ[U];if(N===null||N.includes(W.tagName))W.properties[U]=Y(String(F||""),U,W)}}if(W.type==="element"){let U=J?!J.includes(W.tagName):H?H.includes(W.tagName):!1;if(!U&&Q&&typeof B==="number")U=!Q(W,B,q);if(U&&q&&typeof B==="number"){if(z&&W.children)q.children.splice(B,1,...W.children);else q.children.splice(B,1);return B}}}}function DR($){let Z=$.indexOf(":"),J=$.indexOf("?"),Q=$.indexOf("#"),X=$.indexOf("/");if(Z===-1||X!==-1&&Z>X||J!==-1&&Z>J||Q!==-1&&Z>Q||Oe.test($.slice(0,Z)))return $;return""}var jK=function($,Z,J){let Q=i2(J);if(!$||!$.type||!$.children)throw Error("Expected parent node");if(typeof Z==="number"){if(Z<0||Z===Number.POSITIVE_INFINITY)throw Error("Expected positive finite number as index")}else if(Z=$.children.indexOf(Z),Z<0)throw Error("Expected child node or index");while(++Z<$.children.length)if(Q($.children[Z],Z,$))return $.children[Z];return};var M9=function($){if($===null||$===void 0)return Ie;if(typeof $==="string")return Ee($);if(typeof $==="object")return Te($);if(typeof $==="function")return GN($);throw Error("Expected function, string, or array as `test`")};function Te($){let Z=[],J=-1;while(++J<$.length)Z[J]=M9($[J]);return GN(Q);function Q(...X){let H=-1;while(++H<Z.length)if(Z[H].apply(this,X))return!0;return!1}}function Ee($){return GN(Z);function Z(J){return J.tagName===$}}function GN($){return Z;function Z(J,Q,X){return Boolean(Re(J)&&$.call(this,J,typeof Q==="number"?Q:void 0,X||void 0))}}function Ie($){return Boolean($&&typeof $==="object"&&"type"in $&&$.type==="element"&&"tagName"in $&&typeof $.tagName==="string")}function Re($){return $!==null&&typeof $==="object"&&"type"in $&&"tagName"in $}var _R=/\n/g,OR=/[\t ]+/g,zN=M9("br"),PR=M9(ge),ke=M9("p"),wR=M9("tr"),Se=M9(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",he,ve]),jR=M9(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function YN($,Z){let J=Z||{},Q="children"in $?$.children:[],X=jR($),H=ER($,{whitespace:J.whitespace||"normal",breakBefore:!1,breakAfter:!1}),G=[];if($.type==="text"||$.type==="comment")G.push(...TR($,{whitespace:H,breakBefore:!0,breakAfter:!0}));let z=-1;while(++z<Q.length)G.push(...CR(Q[z],$,{whitespace:H,breakBefore:z?void 0:X,breakAfter:z<Q.length-1?zN(Q[z+1]):X}));let Y=[],K;z=-1;while(++z<G.length){let W=G[z];if(typeof W==="number"){if(K!==void 0&&W>K)K=W}else if(W){if(K!==void 0&&K>-1)Y.push(`
|
|
42
|
-
`.repeat(K)||" ");K=-1,Y.push(W)}}return Y.join("")}function CR($,Z,J){if($.type==="element")return be($,Z,J);if($.type==="text")return J.whitespace==="normal"?TR($,J):ye($);return[]}function be($,Z,J){let Q=ER($,J),X=$.children||[],H=-1,G=[];if(Se($))return G;let z,Y;if(zN($))Y=`
|
|
43
|
-
`;else if(wR($)&&jK(Z,$,wR))Y=`
|
|
44
|
-
`;else if(ke($))z=2,Y=2;else if(jR($))z=1,Y=1;while(++H<X.length)G=G.concat(CR(X[H],$,{whitespace:Q,breakBefore:H?void 0:z,breakAfter:H<X.length-1?zN(X[H+1]):Y}));if(PR($)&&jK(Z,$,PR))G.push("\t");if(z)G.unshift(z);if(Y)G.push(Y);return G}function TR($,Z){let J=String($.value),Q=[],X=[],H=0;while(H<=J.length){_R.lastIndex=H;let Y=_R.exec(J),K=Y&&"index"in Y?Y.index:J.length;Q.push(xe(J.slice(H,K).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),H===0?Z.breakBefore:!0,K===J.length?Z.breakAfter:!0)),H=K+1}let G=-1,z;while(++G<Q.length)if(Q[G].charCodeAt(Q[G].length-1)===8203||G<Q.length-1&&Q[G+1].charCodeAt(0)===8203)X.push(Q[G]),z=void 0;else if(Q[G]){if(typeof z==="number")X.push(z);X.push(Q[G]),z=0}else if(G===0||G===Q.length-1)X.push(0);return X}function ye($){return[String($.value)]}function xe($,Z,J){let Q=[],X=0,H;while(X<$.length){OR.lastIndex=X;let G=OR.exec($);if(H=G?G.index:$.length,!X&&!H&&G&&!Z)Q.push("");if(X!==H)Q.push($.slice(X,H));X=G?H+G[0].length:H}if(X!==H&&!J)Q.push("");return Q.join(" ")}function ER($,Z){if($.type==="element"){let J=$.properties||{};switch($.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return J.wrap?"pre-wrap":"pre";case"td":case"th":return J.noWrap?"nowrap":Z.whitespace;case"textarea":return"pre-wrap";default:}}return Z.whitespace}function he($){return Boolean(($.properties||{}).hidden)}function ge($){return $.tagName==="td"||$.tagName==="th"}function ve($){return $.tagName==="dialog"&&!($.properties||{}).open}function fe($){let Z=$.regex,J=$.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),Q="decltype\\(auto\\)",X="[a-zA-Z_]\\w*::",H="<[^<>]+>",G="(?!struct)(decltype\\(auto\\)|"+Z.optional("[a-zA-Z_]\\w*::")+"[a-zA-Z_]\\w*"+Z.optional("<[^<>]+>")+")",z={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},Y="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",K={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[$.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},$.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},W={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},B={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},$.inherit(K,{className:"string"}),{className:"string",begin:/<.*?>/},J,$.C_BLOCK_COMMENT_MODE]},q={className:"title",begin:Z.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE,relevance:0},U=Z.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE+"\\s*\\(",F=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],N=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],L=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],V=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],O={type:N,keyword:F,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:L},_={className:"function.dispatch",relevance:0,keywords:{_hint:V},begin:Z.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,$.IDENT_RE,Z.lookahead(/(<[^<>]+>|)\s*\(/))},D=[_,B,z,J,$.C_BLOCK_COMMENT_MODE,W,K],T={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:O,contains:D.concat([{begin:/\(/,end:/\)/,keywords:O,contains:D.concat(["self"]),relevance:0}]),relevance:0},k={className:"function",begin:"("+G+"[\\*&\\s]+)+"+U,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:O,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:"decltype\\(auto\\)",keywords:O,relevance:0},{begin:U,returnBegin:!0,contains:[q],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[K,W]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:[J,$.C_BLOCK_COMMENT_MODE,K,W,z,{begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:["self",J,$.C_BLOCK_COMMENT_MODE,K,W,z]}]},z,J,$.C_BLOCK_COMMENT_MODE,B]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:O,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(T,k,_,D,[B,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:O,contains:["self",z]},{begin:$.IDENT_RE+"::",keywords:O},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function IR($){let Z={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},J=fe($),Q=J.keywords;return Q.type=[...Q.type,...Z.type],Q.literal=[...Q.literal,...Z.literal],Q.built_in=[...Q.built_in,...Z.built_in],Q._hints=Z._hints,J.name="Arduino",J.aliases=["ino"],J.supersetOf="cpp",J}function RR($){let Z=$.regex,J={},Q={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[J]}]};Object.assign(J,{className:"variable",variants:[{begin:Z.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},Q]});let X={className:"subst",begin:/\$\(/,end:/\)/,contains:[$.BACKSLASH_ESCAPE]},H=$.inherit($.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),G={begin:/<<-?\s*(?=\w+)/,starts:{contains:[$.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},z={className:"string",begin:/"/,end:/"/,contains:[$.BACKSLASH_ESCAPE,J,X]};X.contains.push(z);let Y={match:/\\"/},K={className:"string",begin:/'/,end:/'/},W={match:/\\'/},B={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},$.NUMBER_MODE,J]},q=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],U=$.SHEBANG({binary:`(${q.join("|")})`,relevance:10}),F={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[$.inherit($.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},N=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],L=["true","false"],V={match:/(\/[a-z._-]+)+/},M=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],A=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],O=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],_=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:N,literal:L,built_in:[...M,...A,"set","shopt",...O,..._]},contains:[U,$.SHEBANG(),F,B,H,G,V,z,Y,K,W,J]}}function kR($){let Z=$.regex,J=$.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),Q="decltype\\(auto\\)",X="[a-zA-Z_]\\w*::",H="<[^<>]+>",G="(decltype\\(auto\\)|"+Z.optional("[a-zA-Z_]\\w*::")+"[a-zA-Z_]\\w*"+Z.optional("<[^<>]+>")+")",z={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},Y="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",K={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[$.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},$.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},W={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},B={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},$.inherit(K,{className:"string"}),{className:"string",begin:/<.*?>/},J,$.C_BLOCK_COMMENT_MODE]},q={className:"title",begin:Z.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE,relevance:0},U=Z.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE+"\\s*\\(",L={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},V=[B,z,J,$.C_BLOCK_COMMENT_MODE,W,K],M={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:L,contains:V.concat([{begin:/\(/,end:/\)/,keywords:L,contains:V.concat(["self"]),relevance:0}]),relevance:0},A={begin:"("+G+"[\\*&\\s]+)+"+U,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:L,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:"decltype\\(auto\\)",keywords:L,relevance:0},{begin:U,returnBegin:!0,contains:[$.inherit(q,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:L,relevance:0,contains:[J,$.C_BLOCK_COMMENT_MODE,K,W,z,{begin:/\(/,end:/\)/,keywords:L,relevance:0,contains:["self",J,$.C_BLOCK_COMMENT_MODE,K,W,z]}]},z,J,$.C_BLOCK_COMMENT_MODE,B]};return{name:"C",aliases:["h"],keywords:L,disableAutodetect:!0,illegal:"</",contains:[].concat(M,A,V,[B,{begin:$.IDENT_RE+"::",keywords:L},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},$.TITLE_MODE]}]),exports:{preprocessor:B,strings:K,keywords:L}}}function SR($){let Z=$.regex,J=$.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),Q="decltype\\(auto\\)",X="[a-zA-Z_]\\w*::",H="<[^<>]+>",G="(?!struct)(decltype\\(auto\\)|"+Z.optional("[a-zA-Z_]\\w*::")+"[a-zA-Z_]\\w*"+Z.optional("<[^<>]+>")+")",z={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},Y="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",K={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[$.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},$.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},W={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},B={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},$.inherit(K,{className:"string"}),{className:"string",begin:/<.*?>/},J,$.C_BLOCK_COMMENT_MODE]},q={className:"title",begin:Z.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE,relevance:0},U=Z.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE+"\\s*\\(",F=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],N=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],L=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],V=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],O={type:N,keyword:F,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:L},_={className:"function.dispatch",relevance:0,keywords:{_hint:V},begin:Z.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,$.IDENT_RE,Z.lookahead(/(<[^<>]+>|)\s*\(/))},D=[_,B,z,J,$.C_BLOCK_COMMENT_MODE,W,K],T={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:O,contains:D.concat([{begin:/\(/,end:/\)/,keywords:O,contains:D.concat(["self"]),relevance:0}]),relevance:0},k={className:"function",begin:"("+G+"[\\*&\\s]+)+"+U,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:O,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:"decltype\\(auto\\)",keywords:O,relevance:0},{begin:U,returnBegin:!0,contains:[q],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[K,W]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:[J,$.C_BLOCK_COMMENT_MODE,K,W,z,{begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:["self",J,$.C_BLOCK_COMMENT_MODE,K,W,z]}]},z,J,$.C_BLOCK_COMMENT_MODE,B]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:O,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(T,k,_,D,[B,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:O,contains:["self",z]},{begin:$.IDENT_RE+"::",keywords:O},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function bR($){let Z=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],J=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],Q=["default","false","null","true"],X=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],H=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],G={keyword:X.concat(H),built_in:Z,literal:Q},z=$.inherit($.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),Y={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},K={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},W={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},B=$.inherit(W,{illegal:/\n/}),q={className:"subst",begin:/\{/,end:/\}/,keywords:G},U=$.inherit(q,{illegal:/\n/}),F={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},$.BACKSLASH_ESCAPE,U]},N={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},q]},L=$.inherit(N,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},U]});q.contains=[N,F,W,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,Y,$.C_BLOCK_COMMENT_MODE],U.contains=[L,F,B,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,Y,$.inherit($.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];let V={variants:[K,N,F,W,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE]},M={begin:"<",end:">",contains:[{beginKeywords:"in out"},z]},A=$.IDENT_RE+"(<"+$.IDENT_RE+"(\\s*,\\s*"+$.IDENT_RE+")*>)?(\\[\\])?",O={begin:"@"+$.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:G,illegal:/::/,contains:[$.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},V,Y,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},z,M,$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[z,$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[z,M,$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+A+"\\s+)+"+$.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:G,contains:[{beginKeywords:J.join(" "),relevance:0},{begin:$.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[$.TITLE_MODE,M],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:G,relevance:0,contains:[V,Y,$.C_BLOCK_COMMENT_MODE]},$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE]},O]}}var me=($)=>{return{IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:$.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[$.APOS_STRING_MODE,$.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:$.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}},ue=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],pe=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],ce=[...ue,...pe],de=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),le=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),ie=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),re=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function yR($){let Z=$.regex,J=me($),Q={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},X="and or not only",H=/@-?\w[\w]*(-\w+)*/,G="[a-zA-Z-][a-zA-Z0-9_-]*",z=[$.APOS_STRING_MODE,$.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[J.BLOCK_COMMENT,Q,J.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\.[a-zA-Z-][a-zA-Z0-9_-]*",relevance:0},J.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+le.join("|")+")"},{begin:":(:)?("+ie.join("|")+")"}]},J.CSS_VARIABLE,{className:"attribute",begin:"\\b("+re.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[J.BLOCK_COMMENT,J.HEXCOLOR,J.IMPORTANT,J.CSS_NUMBER_MODE,...z,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...z,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},J.FUNCTION_DISPATCH]},{begin:Z.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:H},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:de.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...z,J.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+ce.join("|")+")\\b"}]}}function xR($){let Z=$.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:Z.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:Z.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function hR($){let H={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:H,illegal:"</",contains:[$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,{className:"string",variants:[$.QUOTE_STRING_MODE,$.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[$.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:H,illegal:/["']/}]}]}}function gR($){let Z=$.regex,J=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[$.HASH_COMMENT_MODE,$.QUOTE_STRING_MODE,$.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:Z.concat(J,Z.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function vR($){let Z=$.regex,J={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:$.NUMBER_RE}]},Q=$.COMMENT();Q.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];let X={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},H={className:"literal",begin:/\bon|off|true|false|yes|no\b/},G={className:"string",contains:[$.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},z={begin:/\[/,end:/\]/,contains:[Q,H,X,G,J,"self"],relevance:0},Y=/[A-Za-z0-9_-]+/,K=/"(\\"|[^"])*"/,W=/'[^']*'/,B=Z.either(Y,K,W),q=Z.concat(B,"(\\s*\\.\\s*",B,")*",Z.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[Q,{className:"section",begin:/\[+/,end:/\]+/},{begin:q,className:"attr",starts:{end:/$/,contains:[Q,z,H,X,G,J]}}]}}var c$="[0-9](_*[0-9])*",CK=`\\.(${c$})`,TK="[0-9a-fA-F](_*[0-9a-fA-F])*",fR={className:"number",variants:[{begin:`(\\b(${c$})((${CK})|\\.)?|(${CK}))[eE][+-]?(${c$})[fFdD]?\\b`},{begin:`\\b(${c$})((${CK})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${CK})[fFdD]?\\b`},{begin:`\\b(${c$})[fFdD]\\b`},{begin:`\\b0[xX]((${TK})\\.?|(${TK})?\\.(${TK}))[pP][+-]?(${c$})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${TK})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function mR($,Z,J){if(J===-1)return"";return $.replace(Z,(Q)=>{return mR($,Z,J-1)})}function uR($){let Z=$.regex,J="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",Q="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"+mR("(?:<"+"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"+"~~~(?:\\s*,\\s*"+"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"+"~~~)*>)?",/~~~/g,2),Y={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},K={className:"meta",begin:"@"+"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},W={className:"params",begin:/\(/,end:/\)/,keywords:Y,relevance:0,contains:[$.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:Y,illegal:/<\/|#/,contains:[$.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[$.BACKSLASH_ESCAPE]},$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[Z.concat(/(?!else)/,"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"),/\s+/,"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"],className:{1:"keyword",3:"title.class"},contains:[W,$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+Q+"\\s+)",$.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:Y,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:Y,relevance:0,contains:[K,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,fR,$.C_BLOCK_COMMENT_MODE]},$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE]},fR,K]}}var ae=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],ne=["true","false","null","undefined","NaN","Infinity"],pR=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],cR=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],dR=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],se=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],oe=[].concat(dR,pR,cR);function lR($){let Z=$.regex,J=(g,{after:u})=>{let w="</"+g[0].slice(1);return g.input.indexOf(w,u)!==-1},Q="[A-Za-z$_][0-9A-Za-z$_]*",X={begin:"<>",end:"</>"},H=/<[A-Za-z0-9\\._:-]+\s*\/>/,G={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(g,u)=>{let w=g[0].length+g.index,s=g.input[w];if(s==="<"||s===","){u.ignoreMatch();return}if(s===">"){if(!J(g,{after:w}))u.ignoreMatch()}let z0,h=g.input.substring(w);if(z0=h.match(/^\s*=/)){u.ignoreMatch();return}if(z0=h.match(/^\s+extends\s+/)){if(z0.index===0){u.ignoreMatch();return}}}},z={$pattern:"[A-Za-z$_][0-9A-Za-z$_]*",keyword:ae,literal:ne,built_in:oe,"variable.language":se},Y="[0-9](_?[0-9])*",K="\\.([0-9](_?[0-9])*)",W="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",B={className:"number",variants:[{begin:"(\\b(0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*)((\\.([0-9](_?[0-9])*))|\\.)?|(\\.([0-9](_?[0-9])*)))[eE][+-]?([0-9](_?[0-9])*)\\b"},{begin:"\\b(0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*)\\b((\\.([0-9](_?[0-9])*))\\b|\\.)?|(\\.([0-9](_?[0-9])*))\\b"},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},q={className:"subst",begin:"\\$\\{",end:"\\}",keywords:z,contains:[]},U={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,q],subLanguage:"xml"}},F={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,q],subLanguage:"css"}},N={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,q],subLanguage:"graphql"}},L={className:"string",begin:"`",end:"`",contains:[$.BACKSLASH_ESCAPE,q]},M={className:"comment",variants:[$.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:"[A-Za-z$_][0-9A-Za-z$_]*(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),$.C_BLOCK_COMMENT_MODE,$.C_LINE_COMMENT_MODE]},A=[$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,U,F,N,L,{match:/\$\d+/},B];q.contains=A.concat({begin:/\{/,end:/\}/,keywords:z,contains:["self"].concat(A)});let O=[].concat(M,q.contains),_=O.concat([{begin:/(\s*)\(/,end:/\)/,keywords:z,contains:["self"].concat(O)}]),D={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:z,contains:_},T={variants:[{match:[/class/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/\s+/,/extends/,/\s+/,Z.concat("[A-Za-z$_][0-9A-Za-z$_]*","(",Z.concat(/\./,"[A-Za-z$_][0-9A-Za-z$_]*"),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*"],scope:{1:"keyword",3:"title.class"}}]},k={relevance:0,match:Z.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...pR,...cR]}},x={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},I={variants:[{match:[/function/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[D],illegal:/%/},y={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function C(g){return Z.concat("(?!",g.join("|"),")")}let j={match:Z.concat(/\b/,C([...dR,"super","import"].map((g)=>`${g}\\s*\\(`)),"[A-Za-z$_][0-9A-Za-z$_]*",Z.lookahead(/\s*\(/)),className:"title.function",relevance:0},R={begin:Z.concat(/\./,Z.lookahead(Z.concat("[A-Za-z$_][0-9A-Za-z$_]*",/(?![0-9A-Za-z$_(])/))),end:"[A-Za-z$_][0-9A-Za-z$_]*",excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},S={match:[/get|set/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},D]},E="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+$.UNDERSCORE_IDENT_RE+")\\s*=>",b={match:[/const|var|let/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/\s*/,/=\s*/,/(async\s*)?/,Z.lookahead(E)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[D]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:z,exports:{PARAMS_CONTAINS:_,CLASS_REFERENCE:k},illegal:/#(?![$_A-z])/,contains:[$.SHEBANG({label:"shebang",binary:"node",relevance:5}),x,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,U,F,N,L,M,{match:/\$\d+/},B,k,{scope:"attr",match:"[A-Za-z$_][0-9A-Za-z$_]*"+Z.lookahead(":"),relevance:0},b,{begin:"("+$.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[M,$.REGEXP_MODE,{className:"function",begin:E,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:$.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:z,contains:_}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:X.begin,end:X.end},{match:H},{begin:G.begin,"on:begin":G.isTrulyOpeningTag,end:G.end}],subLanguage:"xml",contains:[{begin:G.begin,end:G.end,skip:!0,contains:["self"]}]}]},I,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+$.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[D,$.inherit($.TITLE_MODE,{begin:"[A-Za-z$_][0-9A-Za-z$_]*",className:"title.function"})]},{match:/\.\.\./,relevance:0},R,{match:"\\$[A-Za-z$_][0-9A-Za-z$_]*",relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[D]},j,y,T,S,{match:/\$[(.]/}]}}function iR($){let Z={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},J={match:/[{}[\],:]/,className:"punctuation",relevance:0},Q=["true","false","null"],X={scope:"literal",beginKeywords:Q.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:Q},contains:[Z,J,$.QUOTE_STRING_MODE,X,$.C_NUMBER_MODE,$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var d$="[0-9](_*[0-9])*",EK=`\\.(${d$})`,IK="[0-9a-fA-F](_*[0-9a-fA-F])*",te={className:"number",variants:[{begin:`(\\b(${d$})((${EK})|\\.)?|(${EK}))[eE][+-]?(${d$})[fFdD]?\\b`},{begin:`\\b(${d$})((${EK})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${EK})[fFdD]?\\b`},{begin:`\\b(${d$})[fFdD]\\b`},{begin:`\\b0[xX]((${IK})\\.?|(${IK})?\\.(${IK}))[pP][+-]?(${d$})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${IK})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function rR($){let Z={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},J={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},Q={className:"symbol",begin:$.UNDERSCORE_IDENT_RE+"@"},X={className:"subst",begin:/\$\{/,end:/\}/,contains:[$.C_NUMBER_MODE]},H={className:"variable",begin:"\\$"+$.UNDERSCORE_IDENT_RE},G={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[H,X]},{begin:"'",end:"'",illegal:/\n/,contains:[$.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[$.BACKSLASH_ESCAPE,H,X]}]};X.contains.push(G);let z={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+$.UNDERSCORE_IDENT_RE+")?"},Y={className:"meta",begin:"@"+$.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[$.inherit(G,{className:"string"}),"self"]}]},K=te,W=$.COMMENT("/\\*","\\*/",{contains:[$.C_BLOCK_COMMENT_MODE]}),B={variants:[{className:"type",begin:$.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},q=B;return q.variants[1].contains=[B],B.variants[1].contains=[q],{name:"Kotlin",aliases:["kt","kts"],keywords:Z,contains:[$.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),$.C_LINE_COMMENT_MODE,W,J,Q,z,Y,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:Z,relevance:5,contains:[{begin:$.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[$.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:Z,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[B,$.C_LINE_COMMENT_MODE,W],relevance:0},$.C_LINE_COMMENT_MODE,W,z,Y,G,$.C_NUMBER_MODE]},W]},{begin:[/class|interface|trait/,/\s+/,$.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},$.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},z,Y]},G,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
|
|
45
|
-
`},K]}}var ee=($)=>{return{IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:$.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[$.APOS_STRING_MODE,$.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:$.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}},$00=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],Z00=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],J00=[...$00,...Z00],Q00=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),aR=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),nR=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),X00=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),H00=aR.concat(nR).sort().reverse();function sR($){let Z=ee($),J=H00,Q="and or not only",X="[\\w-]+",H="([\\w-]+|@\\{[\\w-]+\\})",G=[],z=[],Y=function(A){return{className:"string",begin:"~?"+A+".*?"+A}},K=function(A,O,_){return{className:A,begin:O,relevance:_}},W={$pattern:/[a-z-]+/,keyword:"and or not only",attribute:Q00.join(" ")},B={begin:"\\(",end:"\\)",contains:z,keywords:W,relevance:0};z.push($.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,Y("'"),Y('"'),Z.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},Z.HEXCOLOR,B,K("variable","@@?[\\w-]+",10),K("variable","@\\{[\\w-]+\\}"),K("built_in","~?`[^`]*?`"),{className:"attribute",begin:"[\\w-]+\\s*:",end:":",returnBegin:!0,excludeEnd:!0},Z.IMPORTANT,{beginKeywords:"and not"},Z.FUNCTION_DISPATCH);let q=z.concat({begin:/\{/,end:/\}/,contains:G}),U={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(z)},F={begin:H+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},Z.CSS_VARIABLE,{className:"attribute",begin:"\\b("+X00.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:z}}]},N={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:W,returnEnd:!0,contains:z,relevance:0}},L={className:"variable",variants:[{begin:"@[\\w-]+\\s*:",relevance:15},{begin:"@[\\w-]+"}],starts:{end:"[;}]",returnEnd:!0,contains:q}},V={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:H,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,U,K("keyword","all\\b"),K("variable","@\\{[\\w-]+\\}"),{begin:"\\b("+J00.join("|")+")\\b",className:"selector-tag"},Z.CSS_NUMBER_MODE,K("selector-tag",H,0),K("selector-id","#"+H),K("selector-class","\\."+H,0),K("selector-tag","&",0),Z.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+aR.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+nR.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:q},{begin:"!important"},Z.FUNCTION_DISPATCH]},M={begin:`[\\w-]+:(:)?(${J.join("|")})`,returnBegin:!0,contains:[V]};return G.push($.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,N,L,M,F,V,U,Z.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:G}}function oR($){let Q={begin:"\\[=*\\[",end:"\\]=*\\]",contains:["self"]},X=[$.COMMENT("--(?!\\[=*\\[)","$"),$.COMMENT("--\\[=*\\[","\\]=*\\]",{contains:[Q],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:$.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:X.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[$.inherit($.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:X}].concat(X)},$.C_NUMBER_MODE,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,{className:"string",begin:"\\[=*\\[",end:"\\]=*\\]",contains:[Q],relevance:5}])}}function tR($){let Z={className:"variable",variants:[{begin:"\\$\\("+$.UNDERSCORE_IDENT_RE+"\\)",contains:[$.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},J={className:"string",begin:/"/,end:/"/,contains:[$.BACKSLASH_ESCAPE,Z]},Q={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[Z,J]},X={begin:"^"+$.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},H={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},G={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[Z]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[$.HASH_COMMENT_MODE,Z,J,Q,X,H,G]}}function eR($){let Z=$.regex,J={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},Q={begin:"^[-\\*]{3,}",end:"$"},X={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},H={className:"bullet",begin:"^[ \t]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},G={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},z=/[A-Za-z][A-Za-z0-9+.-]*/,Y={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:Z.concat(/\[.+?\]\(/,z,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},K={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},W={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},B=$.inherit(K,{contains:[]}),q=$.inherit(W,{contains:[]});K.contains.push(q),W.contains.push(B);let U=[J,Y];return[K,W,B,q].forEach((V)=>{V.contains=V.contains.concat(U)}),U=U.concat(K,W),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:U},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:U}]}]},J,H,K,W,{className:"quote",begin:"^>\\s+",contains:U,end:"$"},X,Q,Y,G,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function $k($){let Z={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},J=/[a-zA-Z@][a-zA-Z0-9_]*/,z={"variable.language":["this","super"],$pattern:J,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},Y={$pattern:J,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:z,illegal:"</",contains:[Z,$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,$.C_NUMBER_MODE,$.QUOTE_STRING_MODE,$.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[$.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},$.inherit($.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+Y.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:Y,contains:[$.UNDERSCORE_TITLE_MODE]},{begin:"\\."+$.UNDERSCORE_IDENT_RE,relevance:0}]}}function Zk($){let Z=$.regex,J=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],Q=/[dualxmsipngr]{0,12}/,X={$pattern:/[\w.]+/,keyword:J.join(" ")},H={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:X},G={begin:/->\{/,end:/\}/},z={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},Y={scope:"variable",variants:[{begin:/\$\d/},{begin:Z.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[z]},K={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},W=[$.BACKSLASH_ESCAPE,H,Y],B=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],q=(N,L,V="\\1")=>{let M=V==="\\1"?V:Z.concat(V,L);return Z.concat(Z.concat("(?:",N,")"),L,/(?:\\.|[^\\\/])*?/,M,/(?:\\.|[^\\\/])*?/,V,Q)},U=(N,L,V)=>{return Z.concat(Z.concat("(?:",N,")"),L,/(?:\\.|[^\\\/])*?/,V,Q)},F=[Y,$.HASH_COMMENT_MODE,$.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),G,{className:"string",contains:W,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[$.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[$.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},K,{begin:"(\\/\\/|"+$.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[$.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:q("s|tr|y",Z.either(...B,{capture:!0}))},{begin:q("s|tr|y","\\(","\\)")},{begin:q("s|tr|y","\\[","\\]")},{begin:q("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:U("(?:m|qr)?",/\//,/\//)},{begin:U("m|qr",Z.either(...B,{capture:!0}),/\1/)},{begin:U("m|qr",/\(/,/\)/)},{begin:U("m|qr",/\[/,/\]/)},{begin:U("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[$.TITLE_MODE,z]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[$.TITLE_MODE,z,K]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return H.contains=F,G.contains=F,{name:"Perl",aliases:["pl","pm"],keywords:X,contains:F}}function Jk($){let Z=$.regex,J=/(?![A-Za-z0-9])(?![$])/,Q=Z.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,J),X=Z.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,J),H=Z.concat(/[A-Z]+/,J),G={scope:"variable",match:"\\$+"+Q},z={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:0.1},{begin:/\?>/}]},Y={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},K=$.inherit($.APOS_STRING_MODE,{illegal:null}),W=$.inherit($.QUOTE_STRING_MODE,{illegal:null,contains:$.QUOTE_STRING_MODE.contains.concat(Y)}),B={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:$.QUOTE_STRING_MODE.contains.concat(Y),"on:begin":(R,S)=>{S.data._beginMatch=R[1]||R[2]},"on:end":(R,S)=>{if(S.data._beginMatch!==R[1])S.ignoreMatch()}},q=$.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),U=`[
|
|
46
|
-
]`,F={scope:"string",variants:[W,K,B,q]},N={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},L=["false","null","true"],V=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],M=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],O={keyword:V,literal:((R)=>{let S=[];return R.forEach((E)=>{if(S.push(E),E.toLowerCase()===E)S.push(E.toUpperCase());else S.push(E.toLowerCase())}),S})(L),built_in:M},_=(R)=>{return R.map((S)=>{return S.replace(/\|\d+$/,"")})},D={variants:[{match:[/new/,Z.concat(`[
|
|
47
|
-
]`,"+"),Z.concat("(?!",_(M).join("\\b|"),"\\b)"),X],scope:{1:"keyword",4:"title.class"}}]},T=Z.concat(Q,"\\b(?!\\()"),k={variants:[{match:[Z.concat(/::/,Z.lookahead(/(?!class\b)/)),T],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[X,Z.concat(/::/,Z.lookahead(/(?!class\b)/)),T],scope:{1:"title.class",3:"variable.constant"}},{match:[X,Z.concat("::",Z.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[X,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},x={scope:"attr",match:Z.concat(Q,Z.lookahead(":"),Z.lookahead(/(?!::)/))},I={relevance:0,begin:/\(/,end:/\)/,keywords:O,contains:[x,G,k,$.C_BLOCK_COMMENT_MODE,F,N,D]},y={relevance:0,match:[/\b/,Z.concat("(?!fn\\b|function\\b|",_(V).join("\\b|"),"|",_(M).join("\\b|"),"\\b)"),Q,Z.concat(`[
|
|
48
|
-
]`,"*"),Z.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[I]};I.contains.push(y);let C=[x,k,$.C_BLOCK_COMMENT_MODE,F,N,D],j={begin:Z.concat(/#\[\s*\\?/,Z.either(X,H)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:L,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:L,keyword:["new","array"]},contains:["self",...C]},...C,{scope:"meta",variants:[{match:X},{match:H}]}]};return{case_insensitive:!1,keywords:O,contains:[j,$.HASH_COMMENT_MODE,$.COMMENT("//","$"),$.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:$.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},z,{scope:"variable.language",match:/\$this\b/},G,y,k,{match:[/const/,/\s/,Q],scope:{1:"keyword",3:"variable.constant"}},D,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},$.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:O,contains:["self",j,G,k,$.C_BLOCK_COMMENT_MODE,F,N]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},$.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[$.inherit($.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},$.UNDERSCORE_TITLE_MODE]},F,N]}}function Qk($){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},$.inherit($.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),$.inherit($.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function Xk($){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function Hk($){let Z=$.regex,J=/[\p{XID_Start}_]\p{XID_Continue}*/u,Q=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],z={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:Q,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},Y={className:"meta",begin:/^(>>>|\.\.\.) /},K={className:"subst",begin:/\{/,end:/\}/,keywords:z,illegal:/#/},W={begin:/\{\{/,relevance:0},B={className:"string",contains:[$.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[$.BACKSLASH_ESCAPE,Y],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[$.BACKSLASH_ESCAPE,Y],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[$.BACKSLASH_ESCAPE,Y,W,K]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[$.BACKSLASH_ESCAPE,Y,W,K]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[$.BACKSLASH_ESCAPE,W,K]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[$.BACKSLASH_ESCAPE,W,K]},$.APOS_STRING_MODE,$.QUOTE_STRING_MODE]},q="[0-9](_?[0-9])*",U="(\\b([0-9](_?[0-9])*))?\\.([0-9](_?[0-9])*)|\\b([0-9](_?[0-9])*)\\.",F=`\\b|${Q.join("|")}`,N={className:"number",relevance:0,variants:[{begin:`(\\b([0-9](_?[0-9])*)|((\\b([0-9](_?[0-9])*))?\\.([0-9](_?[0-9])*)|\\b([0-9](_?[0-9])*)\\.))[eE][+-]?([0-9](_?[0-9])*)[jJ]?(?=${F})`},{begin:"((\\b([0-9](_?[0-9])*))?\\.([0-9](_?[0-9])*)|\\b([0-9](_?[0-9])*)\\.)[jJ]?"},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${F})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${F})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${F})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${F})`},{begin:`\\b([0-9](_?[0-9])*)[jJ](?=${F})`}]},L={className:"comment",begin:Z.lookahead(/# type:/),end:/$/,keywords:z,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},V={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:z,contains:["self",Y,N,B,$.HASH_COMMENT_MODE]}]};return K.contains=[B,N,Y],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:z,illegal:/(<\/|\?)|=>/,contains:[Y,N,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},B,L,$.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,J],scope:{1:"keyword",3:"title.function"},contains:[V]},{variants:[{match:[/\bclass/,/\s+/,J,/\s*/,/\(\s*/,J,/\s*\)/]},{match:[/\bclass/,/\s+/,J]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[N,V,B]}]}}function Gk($){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function zk($){let Z=$.regex,J=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,Q=Z.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),X=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,H=Z.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:J,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[$.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:Z.lookahead(Z.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:J},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),$.HASH_COMMENT_MODE,{scope:"string",contains:[$.BACKSLASH_ESCAPE],variants:[$.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),$.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),$.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),$.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),$.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),$.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[X,Q]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,Q]},{scope:{1:"punctuation",2:"number"},match:[H,Q]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,Q]}]},{scope:{3:"operator"},match:[J,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:X},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:H},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function Yk($){let Z=$.regex,J="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",Q=Z.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),X=Z.concat(Q,/(::\w+)*/),G={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},z={className:"doctag",begin:"@[A-Za-z]+"},Y={begin:"#<",end:">"},K=[$.COMMENT("#","$",{contains:[z]}),$.COMMENT("^=begin","^=end",{contains:[z],relevance:10}),$.COMMENT("^__END__",$.MATCH_NOTHING_RE)],W={className:"subst",begin:/#\{/,end:/\}/,keywords:G},B={className:"string",contains:[$.BACKSLASH_ESCAPE,W],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:Z.concat(/<<[-~]?'?/,Z.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[$.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[$.BACKSLASH_ESCAPE,W]})]}]},q="[1-9](_?[0-9])*|0",U="[0-9](_?[0-9])*",F={className:"number",relevance:0,variants:[{begin:"\\b([1-9](_?[0-9])*|0)(\\.([0-9](_?[0-9])*))?([eE][+-]?([0-9](_?[0-9])*)|r)?i?\\b"},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},N={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:G}]},D=[B,{variants:[{match:[/class\s+/,X,/\s+<\s+/,X]},{match:[/\b(class|module)\s+/,X]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:G},{match:[/(include|extend)\s+/,X],scope:{2:"title.class"},keywords:G},{relevance:0,match:[X,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:Q,scope:"title.class"},{match:[/def/,/\s+/,"([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)"],scope:{1:"keyword",3:"title.function"},contains:[N]},{begin:$.IDENT_RE+"::"},{className:"symbol",begin:$.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[B,{begin:"([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)"}],relevance:0},F,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:G},{begin:"("+$.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[$.BACKSLASH_ESCAPE,W],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(Y,K),relevance:0}].concat(Y,K);W.contains=D,N.contains=D;let T="[>?]>",k="[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]",x="(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>",I=[{begin:/^\s*=>/,starts:{end:"$",contains:D}},{className:"meta.prompt",begin:"^("+T+"|"+k+"|"+x+")(?=[ ])",starts:{end:"$",keywords:G,contains:D}}];return K.unshift(Y),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:G,illegal:/\/\*/,contains:[$.SHEBANG({binary:"ruby"})].concat(I).concat(K).concat(D)}}function Kk($){let Z=$.regex,J=/(r#)?/,Q=Z.concat(J,$.UNDERSCORE_IDENT_RE),X=Z.concat(J,$.IDENT_RE),H={className:"title.function.invoke",relevance:0,begin:Z.concat(/\b/,/(?!let|for|while|if|else|match\b)/,X,Z.lookahead(/\s*\(/))},G="([ui](8|16|32|64|128|size)|f(32|64))?",z=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],Y=["true","false","Some","None","Ok","Err"],K=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],W=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:$.IDENT_RE+"!?",type:W,keyword:z,literal:Y,built_in:K},illegal:"</",contains:[$.C_LINE_COMMENT_MODE,$.COMMENT("/\\*","\\*/",{contains:["self"]}),$.inherit($.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)([ui](8|16|32|64|128|size)|f(32|64))?"},{begin:"\\b0o([0-7_]+)([ui](8|16|32|64|128|size)|f(32|64))?"},{begin:"\\b0x([A-Fa-f0-9_]+)([ui](8|16|32|64|128|size)|f(32|64))?"},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)([ui](8|16|32|64|128|size)|f(32|64))?"}],relevance:0},{begin:[/fn/,/\s+/,Q],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[$.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,Q],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,Q,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,Q],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,Q],className:{1:"keyword",3:"title.class"}},{begin:$.IDENT_RE+"::",keywords:{keyword:"Self",built_in:K,type:W}},{className:"punctuation",begin:"->"},H]}}var G00=($)=>{return{IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:$.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[$.APOS_STRING_MODE,$.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:$.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}},z00=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],Y00=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],K00=[...z00,...Y00],W00=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),B00=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),q00=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),U00=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function Wk($){let Z=G00($),J=q00,Q=B00,X="@[a-z-]+",H="and or not only",G="[a-zA-Z-][a-zA-Z0-9_-]*",z={className:"variable",begin:"(\\$[a-zA-Z-][a-zA-Z0-9_-]*)\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,Z.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},Z.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+K00.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+Q.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+J.join("|")+")"},z,{begin:/\(/,end:/\)/,contains:[Z.CSS_NUMBER_MODE]},Z.CSS_VARIABLE,{className:"attribute",begin:"\\b("+U00.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[Z.BLOCK_COMMENT,z,Z.HEXCOLOR,Z.CSS_NUMBER_MODE,$.QUOTE_STRING_MODE,$.APOS_STRING_MODE,Z.IMPORTANT,Z.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:"@[a-z-]+",keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:W00.join(" ")},contains:[{begin:"@[a-z-]+",className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},z,$.QUOTE_STRING_MODE,$.APOS_STRING_MODE,Z.HEXCOLOR,Z.CSS_NUMBER_MODE]},Z.FUNCTION_DISPATCH]}}function Bk($){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function qk($){let Z=$.regex,J=$.COMMENT("--","$"),Q={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},X={begin:/"/,end:/"/,contains:[{match:/""/}]},H=["true","false","unknown"],G=["double precision","large object","with timezone","without timezone"],z=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],Y=["add","asc","collation","desc","final","first","last","view"],K=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],W=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],B=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],q=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],U=W,F=[...K,...Y].filter((_)=>{return!W.includes(_)}),N={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},L={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},V={match:Z.concat(/\b/,Z.either(...U),/\s*\(/),relevance:0,keywords:{built_in:U}};function M(_){return Z.concat(/\b/,Z.either(..._.map((D)=>{return D.replace(/\s+/,"\\s+")})),/\b/)}let A={scope:"keyword",match:M(q),relevance:0};function O(_,{exceptions:D,when:T}={}){let k=T;return D=D||[],_.map((x)=>{if(x.match(/\|\d+$/)||D.includes(x))return x;else if(k(x))return`${x}|0`;else return x})}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:O(F,{when:(_)=>_.length<3}),literal:H,type:z,built_in:B},contains:[{scope:"type",match:M(G)},A,V,N,Q,X,$.C_NUMBER_MODE,$.C_BLOCK_COMMENT_MODE,J,L]}}function Vk($){if(!$)return null;if(typeof $==="string")return $;return $.source}function bQ($){return l5("(?=",$,")")}function l5(...$){return $.map((J)=>Vk(J)).join("")}function F00($){let Z=$[$.length-1];if(typeof Z==="object"&&Z.constructor===Object)return $.splice($.length-1,1),Z;else return{}}function d8(...$){return"("+(F00($).capture?"":"?:")+$.map((Q)=>Vk(Q)).join("|")+")"}var BN=($)=>l5(/\b/,$,/\w$/.test($)?/\b/:/\B/),N00=["Protocol","Type"].map(BN),Uk=["init","self"].map(BN),V00=["Any","Self"],KN=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],Fk=["false","nil","true"],L00=["assignment","associativity","higherThan","left","lowerThan","none","right"],M00=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],Nk=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],Lk=d8(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),Mk=d8(Lk,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),WN=l5(Lk,Mk,"*"),Ak=d8(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),kK=d8(Ak,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),r2=l5(Ak,kK,"*"),RK=l5(/[A-Z]/,kK,"*"),A00=["attached","autoclosure",l5(/convention\(/,d8("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",l5(/objc\(/,r2,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],D00=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function Dk($){let Z={match:/\s+/,relevance:0},J=$.COMMENT("/\\*","\\*/",{contains:["self"]}),Q=[$.C_LINE_COMMENT_MODE,J],X={match:[/\./,d8(...N00,...Uk)],className:{2:"keyword"}},H={match:l5(/\./,d8(...KN)),relevance:0},G=KN.filter((r)=>typeof r==="string").concat(["_|0"]),z=KN.filter((r)=>typeof r!=="string").concat(V00).map(BN),Y={variants:[{className:"keyword",match:d8(...z,...Uk)}]},K={$pattern:d8(/\b\w+/,/#\w+/),keyword:G.concat(M00),literal:Fk},W=[X,H,Y],B={match:l5(/\./,d8(...Nk)),relevance:0},q={className:"built_in",match:l5(/\b/,d8(...Nk),/(?=\()/)},U=[B,q],F={match:/->/,relevance:0},N={className:"operator",relevance:0,variants:[{match:WN},{match:`\\.(\\.|${Mk})+`}]},L=[F,N],V="([0-9]_*)+",M="([0-9a-fA-F]_*)+",A={className:"number",relevance:0,variants:[{match:"\\b(([0-9]_*)+)(\\.(([0-9]_*)+))?([eE][+-]?(([0-9]_*)+))?\\b"},{match:"\\b0x(([0-9a-fA-F]_*)+)(\\.(([0-9a-fA-F]_*)+))?([pP][+-]?(([0-9]_*)+))?\\b"},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},O=(r="")=>({className:"subst",variants:[{match:l5(/\\/,r,/[0\\tnr"']/)},{match:l5(/\\/,r,/u\{[0-9a-fA-F]{1,8}\}/)}]}),_=(r="")=>({className:"subst",match:l5(/\\/,r,/[\t ]*(?:[\r\n]|\r\n)/)}),D=(r="")=>({className:"subst",label:"interpol",begin:l5(/\\/,r,/\(/),end:/\)/}),T=(r="")=>({begin:l5(r,/"""/),end:l5(/"""/,r),contains:[O(r),_(r),D(r)]}),k=(r="")=>({begin:l5(r,/"/),end:l5(/"/,r),contains:[O(r),D(r)]}),x={className:"string",variants:[T(),T("#"),T("##"),T("###"),k(),k("#"),k("##"),k("###")]},I=[$.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[$.BACKSLASH_ESCAPE]}],y={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:I},C=(r)=>{let Q0=l5(r,/\//),a=l5(/\//,r);return{begin:Q0,end:a,contains:[...I,{scope:"comment",begin:`#(?!.*${a})`,end:/$/}]}},j={scope:"regexp",variants:[C("###"),C("##"),C("#"),y]},R={match:l5(/`/,r2,/`/)},S={className:"variable",match:/\$\d+/},E={className:"variable",match:`\\$${kK}+`},b=[R,S,E],g={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:D00,contains:[...L,A,x]}]}},u={scope:"keyword",match:l5(/@/,d8(...A00),bQ(d8(/\(/,/\s+/)))},w={scope:"meta",match:l5(/@/,r2)},s=[g,u,w],z0={match:bQ(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:l5(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,kK,"+")},{className:"type",match:RK,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:l5(/\s+&\s+/,bQ(RK)),relevance:0}]},h={begin:/</,end:/>/,keywords:K,contains:[...Q,...W,...s,F,z0]};z0.contains.push(h);let t={match:l5(r2,/\s*:/),keywords:"_|0",relevance:0},M0={begin:/\(/,end:/\)/,relevance:0,keywords:K,contains:["self",t,...Q,j,...W,...U,...L,A,x,...b,...s,z0]},d={begin:/</,end:/>/,keywords:"repeat each",contains:[...Q,z0]},Y0={begin:d8(bQ(l5(r2,/\s*:/)),bQ(l5(r2,/\s+/,r2,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:r2}]},B0={begin:/\(/,end:/\)/,keywords:K,contains:[Y0,...Q,...W,...L,A,x,...s,z0,M0],endsParent:!0,illegal:/["']/},J0={match:[/(func|macro)/,/\s+/,d8(R.match,r2,WN)],className:{1:"keyword",3:"title.function"},contains:[d,B0,Z],illegal:[/\[/,/%/]},H0={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[d,B0,Z],illegal:/\[|%/},N0={match:[/operator/,/\s+/,WN],className:{1:"keyword",3:"title"}},c={begin:[/precedencegroup/,/\s+/,RK],className:{1:"keyword",3:"title"},contains:[z0],keywords:[...L00,...Fk],end:/}/},Z0={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},$0={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},G0={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,r2,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:K,contains:[d,...W,{begin:/:/,end:/\{/,keywords:K,contains:[{scope:"title.class.inherited",match:RK},...W],relevance:0}]};for(let r of x.variants){let Q0=r.contains.find((p)=>p.label==="interpol");Q0.keywords=K;let a=[...W,...U,...L,A,x,...b];Q0.contains=[...a,{begin:/\(/,end:/\)/,contains:["self",...a]}]}return{name:"Swift",keywords:K,contains:[...Q,J0,H0,Z0,$0,G0,N0,c,{beginKeywords:"import",end:/$/,contains:[...Q],relevance:0},j,...W,...U,...L,A,x,...b,...s,z0,M0]}}var _k=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],Ok=["true","false","null","undefined","NaN","Infinity"],Pk=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],wk=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],jk=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Ck=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Tk=[].concat(jk,Pk,wk);function _00($){let Z=$.regex,J=(g,{after:u})=>{let w="</"+g[0].slice(1);return g.input.indexOf(w,u)!==-1},Q="[A-Za-z$_][0-9A-Za-z$_]*",X={begin:"<>",end:"</>"},H=/<[A-Za-z0-9\\._:-]+\s*\/>/,G={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(g,u)=>{let w=g[0].length+g.index,s=g.input[w];if(s==="<"||s===","){u.ignoreMatch();return}if(s===">"){if(!J(g,{after:w}))u.ignoreMatch()}let z0,h=g.input.substring(w);if(z0=h.match(/^\s*=/)){u.ignoreMatch();return}if(z0=h.match(/^\s+extends\s+/)){if(z0.index===0){u.ignoreMatch();return}}}},z={$pattern:"[A-Za-z$_][0-9A-Za-z$_]*",keyword:_k,literal:Ok,built_in:Tk,"variable.language":Ck},Y="[0-9](_?[0-9])*",K="\\.([0-9](_?[0-9])*)",W="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",B={className:"number",variants:[{begin:"(\\b(0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*)((\\.([0-9](_?[0-9])*))|\\.)?|(\\.([0-9](_?[0-9])*)))[eE][+-]?([0-9](_?[0-9])*)\\b"},{begin:"\\b(0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*)\\b((\\.([0-9](_?[0-9])*))\\b|\\.)?|(\\.([0-9](_?[0-9])*))\\b"},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},q={className:"subst",begin:"\\$\\{",end:"\\}",keywords:z,contains:[]},U={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,q],subLanguage:"xml"}},F={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,q],subLanguage:"css"}},N={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,q],subLanguage:"graphql"}},L={className:"string",begin:"`",end:"`",contains:[$.BACKSLASH_ESCAPE,q]},M={className:"comment",variants:[$.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:"[A-Za-z$_][0-9A-Za-z$_]*(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),$.C_BLOCK_COMMENT_MODE,$.C_LINE_COMMENT_MODE]},A=[$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,U,F,N,L,{match:/\$\d+/},B];q.contains=A.concat({begin:/\{/,end:/\}/,keywords:z,contains:["self"].concat(A)});let O=[].concat(M,q.contains),_=O.concat([{begin:/(\s*)\(/,end:/\)/,keywords:z,contains:["self"].concat(O)}]),D={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:z,contains:_},T={variants:[{match:[/class/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/\s+/,/extends/,/\s+/,Z.concat("[A-Za-z$_][0-9A-Za-z$_]*","(",Z.concat(/\./,"[A-Za-z$_][0-9A-Za-z$_]*"),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*"],scope:{1:"keyword",3:"title.class"}}]},k={relevance:0,match:Z.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Pk,...wk]}},x={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},I={variants:[{match:[/function/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[D],illegal:/%/},y={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function C(g){return Z.concat("(?!",g.join("|"),")")}let j={match:Z.concat(/\b/,C([...jk,"super","import"].map((g)=>`${g}\\s*\\(`)),"[A-Za-z$_][0-9A-Za-z$_]*",Z.lookahead(/\s*\(/)),className:"title.function",relevance:0},R={begin:Z.concat(/\./,Z.lookahead(Z.concat("[A-Za-z$_][0-9A-Za-z$_]*",/(?![0-9A-Za-z$_(])/))),end:"[A-Za-z$_][0-9A-Za-z$_]*",excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},S={match:[/get|set/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},D]},E="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+$.UNDERSCORE_IDENT_RE+")\\s*=>",b={match:[/const|var|let/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/\s*/,/=\s*/,/(async\s*)?/,Z.lookahead(E)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[D]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:z,exports:{PARAMS_CONTAINS:_,CLASS_REFERENCE:k},illegal:/#(?![$_A-z])/,contains:[$.SHEBANG({label:"shebang",binary:"node",relevance:5}),x,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,U,F,N,L,M,{match:/\$\d+/},B,k,{scope:"attr",match:"[A-Za-z$_][0-9A-Za-z$_]*"+Z.lookahead(":"),relevance:0},b,{begin:"("+$.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[M,$.REGEXP_MODE,{className:"function",begin:E,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:$.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:z,contains:_}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:X.begin,end:X.end},{match:H},{begin:G.begin,"on:begin":G.isTrulyOpeningTag,end:G.end}],subLanguage:"xml",contains:[{begin:G.begin,end:G.end,skip:!0,contains:["self"]}]}]},I,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+$.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[D,$.inherit($.TITLE_MODE,{begin:"[A-Za-z$_][0-9A-Za-z$_]*",className:"title.function"})]},{match:/\.\.\./,relevance:0},R,{match:"\\$[A-Za-z$_][0-9A-Za-z$_]*",relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[D]},j,y,T,S,{match:/\$[(.]/}]}}function Ek($){let Z=$.regex,J=_00($),Q="[A-Za-z$_][0-9A-Za-z$_]*",X=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],H={begin:[/namespace/,/\s+/,$.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},G={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:X},contains:[J.exports.CLASS_REFERENCE]},z={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},Y=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],K={$pattern:"[A-Za-z$_][0-9A-Za-z$_]*",keyword:_k.concat(Y),literal:Ok,built_in:Tk.concat(X),"variable.language":Ck},W={className:"meta",begin:"@[A-Za-z$_][0-9A-Za-z$_]*"},B=(N,L,V)=>{let M=N.contains.findIndex((A)=>A.label===L);if(M===-1)throw Error("can not find mode to replace");N.contains.splice(M,1,V)};Object.assign(J.keywords,K),J.exports.PARAMS_CONTAINS.push(W);let q=J.contains.find((N)=>N.scope==="attr"),U=Object.assign({},q,{match:Z.concat("[A-Za-z$_][0-9A-Za-z$_]*",Z.lookahead(/\s*\?:/))});J.exports.PARAMS_CONTAINS.push([J.exports.CLASS_REFERENCE,q,U]),J.contains=J.contains.concat([W,H,G,U]),B(J,"shebang",$.SHEBANG()),B(J,"use_strict",z);let F=J.contains.find((N)=>N.label==="func.def");return F.relevance=0,Object.assign(J,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),J}function Ik($){let Z=$.regex,J={className:"string",begin:/"(""|[^/n])"C\b/},Q={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},X=/\d{1,2}\/\d{1,2}\/\d{4}/,H=/\d{4}-\d{1,2}-\d{1,2}/,G=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,z=/\d{1,2}(:\d{1,2}){1,2}/,Y={className:"literal",variants:[{begin:Z.concat(/# */,Z.either(H,X),/ *#/)},{begin:Z.concat(/# */,z,/ *#/)},{begin:Z.concat(/# */,G,/ *#/)},{begin:Z.concat(/# */,Z.either(H,X),/ +/,Z.either(G,z),/ *#/)}]},K={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},W={className:"label",begin:/^\w+:/},B=$.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),q=$.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[J,Q,Y,K,W,B,q,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[q]}]}}function Rk($){$.regex;let Z=$.COMMENT(/\(;/,/;\)/);Z.contains.push("self");let J=$.COMMENT(/;;/,/$/),Q=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],X={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},H={className:"variable",begin:/\$[\w_]+/},G={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},z={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},Y={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},K={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:Q},contains:[J,Z,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},H,G,X,$.QUOTE_STRING_MODE,Y,K,z]}}function kk($){let Z=$.regex,J=Z.concat(/[\p{L}_]/u,Z.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),Q=/[\p{L}0-9._:-]+/u,X={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},H={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},G=$.inherit(H,{begin:/\(/,end:/\)/}),z=$.inherit($.APOS_STRING_MODE,{className:"string"}),Y=$.inherit($.QUOTE_STRING_MODE,{className:"string"}),K={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:Q,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[X]},{begin:/'/,end:/'/,contains:[X]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[H,Y,z,G,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[H,G,Y,z]}]}]},$.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},X,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[Y]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[K],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[K],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:Z.concat(/</,Z.lookahead(Z.concat(J,Z.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:J,relevance:0,starts:K}]},{className:"tag",begin:Z.concat(/<\//,Z.lookahead(Z.concat(J,/>/))),contains:[{className:"name",begin:J,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function Sk($){let Q={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},X={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},H={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},G={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[$.BACKSLASH_ESCAPE,X]},z=$.inherit(G,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),Y="[0-9]{4}(-[0-9][0-9]){0,2}",K="([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?",W="(\\.[0-9]*)?",B="([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?",q={className:"number",begin:"\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b"},U={end:",",endsWithParent:!0,excludeEnd:!0,keywords:"true false yes no null",relevance:0},F={begin:/\{/,end:/\}/,contains:[U],illegal:"\\n",relevance:0},N={begin:"\\[",end:"\\]",contains:[U],illegal:"\\n",relevance:0},L=[Q,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+![\\w#;/?:@&=+$,.~*'()[\\]]+"},{className:"type",begin:"!<[\\w#;/?:@&=+$,.~*'()[\\]]+>"},{className:"type",begin:"![\\w#;/?:@&=+$,.~*'()[\\]]+"},{className:"type",begin:"!![\\w#;/?:@&=+$,.~*'()[\\]]+"},{className:"meta",begin:"&"+$.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+$.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},$.HASH_COMMENT_MODE,{beginKeywords:"true false yes no null",keywords:{literal:"true false yes no null"}},q,{className:"number",begin:$.C_NUMBER_RE+"\\b",relevance:0},F,N,H,G],V=[...L];return V.pop(),V.push(z),U.contains=V,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:L}}var qN={arduino:IR,bash:RR,c:kR,cpp:SR,csharp:bR,css:yR,diff:xR,go:hR,graphql:gR,ini:vR,java:uR,javascript:lR,json:iR,kotlin:rR,less:sR,lua:oR,makefile:tR,markdown:eR,objectivec:$k,perl:Zk,php:Jk,"php-template":Qk,plaintext:Xk,python:Hk,"python-repl":Gk,r:zk,ruby:Yk,rust:Kk,scss:Wk,shell:Bk,sql:qk,swift:Dk,typescript:Ek,vbnet:Ik,wasm:Rk,xml:kk,yaml:Sk};var JS=P(ZS(),1);var QS=JS.default;var XS={},B50="hljs-";function AN($){let Z=QS.newInstance();if($)H($);return{highlight:J,highlightAuto:Q,listLanguages:X,register:H,registerAlias:G,registered:z};function J(Y,K,W){R5(typeof Y==="string","expected `string` as `name`"),R5(typeof K==="string","expected `string` as `value`");let B=W||XS,q=typeof B.prefix==="string"?B.prefix:B50;if(!Z.getLanguage(Y))throw Error("Unknown language: `"+Y+"` is not registered");Z.configure({__emitter:HS,classPrefix:q});let U=Z.highlight(K,{ignoreIllegals:!0,language:Y});if(U.errorRaised)throw Error("Could not highlight with `Highlight.js`",{cause:U.errorRaised});let F=U._emitter.root,N=F.data;return N.language=U.language,N.relevance=U.relevance,F}function Q(Y,K){R5(typeof Y==="string","expected `string` as `value`");let B=(K||XS).subset||X(),q=-1,U=0,F;while(++q<B.length){let N=B[q];if(!Z.getLanguage(N))continue;let L=J(N,Y,K);if(L.data&&L.data.relevance!==void 0&&L.data.relevance>U)U=L.data.relevance,F=L}return F||{type:"root",children:[],data:{language:void 0,relevance:U}}}function X(){return Z.listLanguages()}function H(Y,K){if(typeof Y==="string")R5(K!==void 0,"expected `grammar`"),Z.registerLanguage(Y,K);else{let W;for(W in Y)if(Object.hasOwn(Y,W))Z.registerLanguage(W,Y[W])}}function G(Y,K){if(typeof Y==="string")R5(K!==void 0),Z.registerAliases(typeof K==="string"?K:[...K],{languageName:Y});else{let W;for(W in Y)if(Object.hasOwn(Y,W)){let B=Y[W];Z.registerAliases(typeof B==="string"?B:[...B],{languageName:W})}}}function z(Y){return Boolean(Z.getLanguage(Y))}}class HS{constructor($){this.options=$,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText($){if($==="")return;let Z=this.stack[this.stack.length-1],J=Z.children[Z.children.length-1];if(J&&J.type==="text")J.value+=$;else Z.children.push({type:"text",value:$})}startScope($){this.openNode(String($))}endScope(){this.closeNode()}__addSublanguage($,Z){let J=this.stack[this.stack.length-1],Q=$.root.children;if(Z)J.children.push({type:"element",tagName:"span",properties:{className:[Z]},children:Q});else J.children.push(...Q)}openNode($){let Z=this,J=$.split(".").map(function(H,G){return G?H+"_".repeat(G):Z.options.classPrefix+H}),Q=this.stack[this.stack.length-1],X={type:"element",tagName:"span",properties:{className:J},children:[]};Q.children.push(X),this.stack.push(X)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}var q50={};function xK($){let Z=$||q50,J=Z.aliases,Q=Z.detect||!1,X=Z.languages||qN,H=Z.plainText,G=Z.prefix,z=Z.subset,Y="hljs",K=AN(X);if(J)K.registerAlias(J);if(G){let W=G.indexOf("-");Y=W===-1?G:G.slice(0,W)}return function(W,B){L9(W,"element",function(q,U,F){if(q.tagName!=="code"||!F||F.type!=="element"||F.tagName!=="pre")return;let N=U50(q);if(N===!1||!N&&!Q||N&&H&&H.includes(N))return;if(!Array.isArray(q.properties.className))q.properties.className=[];if(!q.properties.className.includes(Y))q.properties.className.unshift(Y);let L=YN(q,{whitespace:"pre"}),V;try{V=N?K.highlight(N,L,{prefix:G}):K.highlightAuto(L,{prefix:G,subset:z})}catch(M){let A=M;if(N&&/Unknown language/.test(A.message)){B.message("Cannot highlight as `"+N+"`, it’s not registered",{ancestors:[F,q],cause:A,place:q.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw A}if(!N&&V.data&&V.data.language)q.properties.className.push("language-"+V.data.language);if(V.children.length>0)q.children=V.children})}}function U50($){let Z=$.properties.className,J=-1;if(!Array.isArray(Z))return;let Q;while(++J<Z.length){let X=String(Z[J]);if(X==="no-highlight"||X==="nohighlight")return!1;if(!Q&&X.slice(0,5)==="lang-")Q=X.slice(5);if(!Q&&X.slice(0,9)==="language-")Q=X.slice(9)}return Q}function DN($,Z){let J=String($);if(typeof Z!=="string")throw TypeError("Expected character");let Q=0,X=J.indexOf(Z);while(X!==-1)Q++,X=J.indexOf(Z,X+Z.length);return Q}function _N($){if(typeof $!=="string")throw TypeError("Expected a string");return $.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function ON($,Z,J){let X=i2((J||{}).ignore||[]),H=F50(Z),G=-1;while(++G<H.length)RQ($,"text",z);function z(K,W){let B=-1,q;while(++B<W.length){let U=W[B],F=q?q.children:void 0;if(X(U,F?F.indexOf(U):void 0,q))return;q=U}if(q)return Y(K,W)}function Y(K,W){let B=W[W.length-1],q=H[G][0],U=H[G][1],F=0,L=B.children.indexOf(K),V=!1,M=[];q.lastIndex=0;let A=q.exec(K.value);while(A){let O=A.index,_={index:A.index,input:A.input,stack:[...W,K]},D=U(...A,_);if(typeof D==="string")D=D.length>0?{type:"text",value:D}:void 0;if(D===!1)q.lastIndex=O+1;else{if(F!==O)M.push({type:"text",value:K.value.slice(F,O)});if(Array.isArray(D))M.push(...D);else if(D)M.push(D);F=O+A[0].length,V=!0}if(!q.global)break;A=q.exec(K.value)}if(V){if(F<K.value.length)M.push({type:"text",value:K.value.slice(F)});B.children.splice(L,1,...M)}else M=[K];return L+M.length}}function F50($){let Z=[];if(!Array.isArray($))throw TypeError("Expected find and replace tuple or list of tuples");let J=!$[0]||Array.isArray($[0])?$:[$],Q=-1;while(++Q<J.length){let X=J[Q];Z.push([N50(X[0]),V50(X[1])])}return Z}function N50($){return typeof $==="string"?new RegExp(_N($),"g"):$}function V50($){return typeof $==="function"?$:function(){return $}}var PN="phrasing",wN=["autolink","link","image","label"];function CN(){return{transforms:[O50],enter:{literalAutolink:L50,literalAutolinkEmail:jN,literalAutolinkHttp:jN,literalAutolinkWww:jN},exit:{literalAutolink:_50,literalAutolinkEmail:D50,literalAutolinkHttp:M50,literalAutolinkWww:A50}}}function TN(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:PN,notInConstruct:wN},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:PN,notInConstruct:wN},{character:":",before:"[ps]",after:"\\/",inConstruct:PN,notInConstruct:wN}]}}function L50($){this.enter({type:"link",title:null,url:"",children:[]},$)}function jN($){this.config.enter.autolinkProtocol.call(this,$)}function M50($){this.config.exit.autolinkProtocol.call(this,$)}function A50($){this.config.exit.data.call(this,$);let Z=this.stack[this.stack.length-1];R5(Z.type==="link"),Z.url="http://"+this.sliceSerialize($)}function D50($){this.config.exit.autolinkEmail.call(this,$)}function _50($){this.exit($)}function O50($){ON($,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,P50],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,w50]],{ignore:["link","linkReference"]})}function P50($,Z,J,Q,X){let H="";if(!GS(X))return!1;if(/^w/i.test(Z))J=Z+J,Z="",H="http://";if(!j50(J))return!1;let G=C50(J+Q);if(!G[0])return!1;let z={type:"link",title:null,url:H+Z+G[0],children:[{type:"text",value:Z+G[0]}]};if(G[1])return[z,{type:"text",value:G[1]}];return z}function w50($,Z,J,Q){if(!GS(Q,!0)||/[-\d_]$/.test(J))return!1;return{type:"link",title:null,url:"mailto:"+Z+"@"+J,children:[{type:"text",value:Z+"@"+J}]}}function j50($){let Z=$.split(".");if(Z.length<2||Z[Z.length-1]&&(/_/.test(Z[Z.length-1])||!/[a-zA-Z\d]/.test(Z[Z.length-1]))||Z[Z.length-2]&&(/_/.test(Z[Z.length-2])||!/[a-zA-Z\d]/.test(Z[Z.length-2])))return!1;return!0}function C50($){let Z=/[!"&'),.:;<>?\]}]+$/.exec($);if(!Z)return[$,void 0];$=$.slice(0,Z.index);let J=Z[0],Q=J.indexOf(")"),X=DN($,"("),H=DN($,")");while(Q!==-1&&X>H)$+=J.slice(0,Q+1),J=J.slice(Q+1),Q=J.indexOf(")"),H++;return[$,J]}function GS($,Z){let J=$.input.charCodeAt($.index-1);return($.index===0||d2(J)||a3(J))&&(!Z||J!==47)}zS.peek=x50;function T50(){this.buffer()}function E50($){this.enter({type:"footnoteReference",identifier:"",label:""},$)}function I50(){this.buffer()}function R50($){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},$)}function k50($){let Z=this.resume(),J=this.stack[this.stack.length-1];R5(J.type==="footnoteReference"),J.identifier=b8(this.sliceSerialize($)).toLowerCase(),J.label=Z}function S50($){this.exit($)}function b50($){let Z=this.resume(),J=this.stack[this.stack.length-1];R5(J.type==="footnoteDefinition"),J.identifier=b8(this.sliceSerialize($)).toLowerCase(),J.label=Z}function y50($){this.exit($)}function x50(){return"["}function zS($,Z,J,Q){let X=J.createTracker(Q),H=X.move("[^"),G=J.enter("footnoteReference"),z=J.enter("reference");return H+=X.move(J.safe(J.associationId($),{after:"]",before:H})),z(),G(),H+=X.move("]"),H}function EN(){return{enter:{gfmFootnoteCallString:T50,gfmFootnoteCall:E50,gfmFootnoteDefinitionLabelString:I50,gfmFootnoteDefinition:R50},exit:{gfmFootnoteCallString:k50,gfmFootnoteCall:S50,gfmFootnoteDefinitionLabelString:b50,gfmFootnoteDefinition:y50}}}function IN($){let Z=!1;if($&&$.firstLineBlank)Z=!0;return{handlers:{footnoteDefinition:J,footnoteReference:zS},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function J(Q,X,H,G){let z=H.createTracker(G),Y=z.move("[^"),K=H.enter("footnoteDefinition"),W=H.enter("label");if(Y+=z.move(H.safe(H.associationId(Q),{before:Y,after:"]"})),W(),Y+=z.move("]:"),Q.children&&Q.children.length>0)z.shift(4),Y+=z.move((Z?`
|
|
49
|
-
`:" ")+H.indentLines(H.containerFlow(Q,z.current()),Z?YS:h50));return K(),Y}}function h50($,Z,J){return Z===0?$:YS($,Z,J)}function YS($,Z,J){return(J?"":" ")+$}var g50=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];KS.peek=m50;function RN(){return{canContainEols:["delete"],enter:{strikethrough:v50},exit:{strikethrough:f50}}}function kN(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:g50}],handlers:{delete:KS}}}function v50($){this.enter({type:"delete",children:[]},$)}function f50($){this.exit($)}function KS($,Z,J,Q){let X=J.createTracker(Q),H=J.enter("strikethrough"),G=X.move("~~");return G+=J.containerPhrasing($,{...X.current(),before:G,after:"~"}),G+=X.move("~~"),H(),G}function m50(){return"~"}function u50($){return $.length}function BS($,Z){let J=Z||{},Q=(J.align||[]).concat(),X=J.stringLength||u50,H=[],G=[],z=[],Y=[],K=0,W=-1;while(++W<$.length){let N=[],L=[],V=-1;if($[W].length>K)K=$[W].length;while(++V<$[W].length){let M=p50($[W][V]);if(J.alignDelimiters!==!1){let A=X(M);if(L[V]=A,Y[V]===void 0||A>Y[V])Y[V]=A}N.push(M)}G[W]=N,z[W]=L}let B=-1;if(typeof Q==="object"&&"length"in Q)while(++B<K)H[B]=WS(Q[B]);else{let N=WS(Q);while(++B<K)H[B]=N}B=-1;let q=[],U=[];while(++B<K){let N=H[B],L="",V="";if(N===99)L=":",V=":";else if(N===108)L=":";else if(N===114)V=":";let M=J.alignDelimiters===!1?1:Math.max(1,Y[B]-L.length-V.length),A=L+"-".repeat(M)+V;if(J.alignDelimiters!==!1){if(M=L.length+M+V.length,M>Y[B])Y[B]=M;U[B]=M}q[B]=A}G.splice(1,0,q),z.splice(1,0,U),W=-1;let F=[];while(++W<G.length){let N=G[W],L=z[W];B=-1;let V=[];while(++B<K){let M=N[B]||"",A="",O="";if(J.alignDelimiters!==!1){let _=Y[B]-(L[B]||0),D=H[B];if(D===114)A=" ".repeat(_);else if(D===99)if(_%2)A=" ".repeat(_/2+0.5),O=" ".repeat(_/2-0.5);else A=" ".repeat(_/2),O=A;else O=" ".repeat(_)}if(J.delimiterStart!==!1&&!B)V.push("|");if(J.padding!==!1&&!(J.alignDelimiters===!1&&M==="")&&(J.delimiterStart!==!1||B))V.push(" ");if(J.alignDelimiters!==!1)V.push(A);if(V.push(M),J.alignDelimiters!==!1)V.push(O);if(J.padding!==!1)V.push(" ");if(J.delimiterEnd!==!1||B!==K-1)V.push("|")}F.push(J.delimiterEnd===!1?V.join("").replace(/ +$/,""):V.join(""))}return F.join(`
|
|
50
|
-
`)}function p50($){return $===null||$===void 0?"":String($)}function WS($){let Z=typeof $==="string"?$.codePointAt(0):0;return Z===67||Z===99?99:Z===76||Z===108?108:Z===82||Z===114?114:0}function qS($,Z,J,Q){let X=J.enter("blockquote"),H=J.createTracker(Q);H.move("> "),H.shift(2);let G=J.indentLines(J.containerFlow($,H.current()),c50);return X(),G}function c50($,Z,J){return">"+(J?"":" ")+$}function FS($,Z){return US($,Z.inConstruct,!0)&&!US($,Z.notInConstruct,!1)}function US($,Z,J){if(typeof Z==="string")Z=[Z];if(!Z||Z.length===0)return J;let Q=-1;while(++Q<Z.length)if($.includes(Z[Q]))return!0;return!1}function SN($,Z,J,Q){let X=-1;while(++X<J.unsafe.length)if(J.unsafe[X].character===`
|
|
51
|
-
`&&FS(J.stack,J.unsafe[X]))return/[ \t]/.test(Q.before)?"":" ";return"\\\n"}function NS($,Z){let J=String($),Q=J.indexOf(Z),X=Q,H=0,G=0;if(typeof Z!=="string")throw TypeError("Expected substring");while(Q!==-1){if(Q===X){if(++H>G)G=H}else H=1;X=Q+Z.length,Q=J.indexOf(Z,X)}return G}function VS($,Z){return Boolean(Z.options.fences===!1&&$.value&&!$.lang&&/[^ \r\n]/.test($.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test($.value))}function LS($){let Z=$.options.fence||"`";if(Z!=="`"&&Z!=="~")throw Error("Cannot serialize code with `"+Z+"` for `options.fence`, expected `` ` `` or `~`");return Z}function MS($,Z,J,Q){let X=LS(J),H=$.value||"",G=X==="`"?"GraveAccent":"Tilde";if(VS($,J)){let B=J.enter("codeIndented"),q=J.indentLines(H,d50);return B(),q}let z=J.createTracker(Q),Y=X.repeat(Math.max(NS(H,X)+1,3)),K=J.enter("codeFenced"),W=z.move(Y);if($.lang){let B=J.enter(`codeFencedLang${G}`);W+=z.move(J.safe($.lang,{before:W,after:" ",encode:["`"],...z.current()})),B()}if($.lang&&$.meta){let B=J.enter(`codeFencedMeta${G}`);W+=z.move(" "),W+=z.move(J.safe($.meta,{before:W,after:`
|
|
52
|
-
`,encode:["`"],...z.current()})),B()}if(W+=z.move(`
|
|
53
|
-
`),H)W+=z.move(H+`
|
|
54
|
-
`);return W+=z.move(Y),K(),W}function d50($,Z,J){return(J?"":" ")+$}function r$($){let Z=$.options.quote||'"';if(Z!=='"'&&Z!=="'")throw Error("Cannot serialize title with `"+Z+"` for `options.quote`, expected `\"`, or `'`");return Z}function AS($,Z,J,Q){let X=r$(J),H=X==='"'?"Quote":"Apostrophe",G=J.enter("definition"),z=J.enter("label"),Y=J.createTracker(Q),K=Y.move("[");if(K+=Y.move(J.safe(J.associationId($),{before:K,after:"]",...Y.current()})),K+=Y.move("]: "),z(),!$.url||/[\0- \u007F]/.test($.url))z=J.enter("destinationLiteral"),K+=Y.move("<"),K+=Y.move(J.safe($.url,{before:K,after:">",...Y.current()})),K+=Y.move(">");else z=J.enter("destinationRaw"),K+=Y.move(J.safe($.url,{before:K,after:$.title?" ":`
|
|
55
|
-
`,...Y.current()}));if(z(),$.title)z=J.enter(`title${H}`),K+=Y.move(" "+X),K+=Y.move(J.safe($.title,{before:K,after:X,...Y.current()})),K+=Y.move(X),z();return G(),K}function DS($){let Z=$.options.emphasis||"*";if(Z!=="*"&&Z!=="_")throw Error("Cannot serialize emphasis with `"+Z+"` for `options.emphasis`, expected `*`, or `_`");return Z}function R6($){return"&#x"+$.toString(16).toUpperCase()+";"}function a$($,Z,J){let Q=V9($),X=V9(Z);if(Q===void 0)return X===void 0?J==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:X===1?{inside:!0,outside:!0}:{inside:!1,outside:!0};if(Q===1)return X===void 0?{inside:!1,outside:!1}:X===1?{inside:!0,outside:!0}:{inside:!1,outside:!1};return X===void 0?{inside:!1,outside:!1}:X===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}bN.peek=l50;function bN($,Z,J,Q){let X=DS(J),H=J.enter("emphasis"),G=J.createTracker(Q),z=G.move(X),Y=G.move(J.containerPhrasing($,{after:X,before:z,...G.current()})),K=Y.charCodeAt(0),W=a$(Q.before.charCodeAt(Q.before.length-1),K,X);if(W.inside)Y=R6(K)+Y.slice(1);let B=Y.charCodeAt(Y.length-1),q=a$(Q.after.charCodeAt(0),B,X);if(q.inside)Y=Y.slice(0,-1)+R6(B);let U=G.move(X);return H(),J.attentionEncodeSurroundingInfo={after:q.outside,before:W.outside},z+Y+U}function l50($,Z,J){return J.options.emphasis||"*"}function _S($,Z){let J=!1;return L9($,function(Q){if("value"in Q&&/\r?\n|\r/.test(Q.value)||Q.type==="break")return J=!0,e3}),Boolean((!$.depth||$.depth<3)&&i3($)&&(Z.options.setext||J))}function OS($,Z,J,Q){let X=Math.max(Math.min(6,$.depth||1),1),H=J.createTracker(Q);if(_S($,J)){let W=J.enter("headingSetext"),B=J.enter("phrasing"),q=J.containerPhrasing($,{...H.current(),before:`
|
|
56
|
-
`,after:`
|
|
57
|
-
`});return B(),W(),q+`
|
|
58
|
-
`+(X===1?"=":"-").repeat(q.length-(Math.max(q.lastIndexOf("\r"),q.lastIndexOf(`
|
|
59
|
-
`))+1))}let G="#".repeat(X),z=J.enter("headingAtx"),Y=J.enter("phrasing");H.move(G+" ");let K=J.containerPhrasing($,{before:"# ",after:`
|
|
60
|
-
`,...H.current()});if(/^[\t ]/.test(K))K=R6(K.charCodeAt(0))+K.slice(1);if(K=K?G+" "+K:G,J.options.closeAtx)K+=" "+G;return Y(),z(),K}yN.peek=i50;function yN($){return $.value||""}function i50(){return"<"}xN.peek=r50;function xN($,Z,J,Q){let X=r$(J),H=X==='"'?"Quote":"Apostrophe",G=J.enter("image"),z=J.enter("label"),Y=J.createTracker(Q),K=Y.move("![");if(K+=Y.move(J.safe($.alt,{before:K,after:"]",...Y.current()})),K+=Y.move("]("),z(),!$.url&&$.title||/[\0- \u007F]/.test($.url))z=J.enter("destinationLiteral"),K+=Y.move("<"),K+=Y.move(J.safe($.url,{before:K,after:">",...Y.current()})),K+=Y.move(">");else z=J.enter("destinationRaw"),K+=Y.move(J.safe($.url,{before:K,after:$.title?" ":")",...Y.current()}));if(z(),$.title)z=J.enter(`title${H}`),K+=Y.move(" "+X),K+=Y.move(J.safe($.title,{before:K,after:X,...Y.current()})),K+=Y.move(X),z();return K+=Y.move(")"),G(),K}function r50(){return"!"}hN.peek=a50;function hN($,Z,J,Q){let X=$.referenceType,H=J.enter("imageReference"),G=J.enter("label"),z=J.createTracker(Q),Y=z.move("!["),K=J.safe($.alt,{before:Y,after:"]",...z.current()});Y+=z.move(K+"]["),G();let W=J.stack;J.stack=[],G=J.enter("reference");let B=J.safe(J.associationId($),{before:Y,after:"]",...z.current()});if(G(),J.stack=W,H(),X==="full"||!K||K!==B)Y+=z.move(B+"]");else if(X==="shortcut")Y=Y.slice(0,-1);else Y+=z.move("]");return Y}function a50(){return"!"}gN.peek=n50;function gN($,Z,J){let Q=$.value||"",X="`",H=-1;while(new RegExp("(^|[^`])"+X+"([^`]|$)").test(Q))X+="`";if(/[^ \r\n]/.test(Q)&&(/^[ \r\n]/.test(Q)&&/[ \r\n]$/.test(Q)||/^`|`$/.test(Q)))Q=" "+Q+" ";while(++H<J.unsafe.length){let G=J.unsafe[H],z=J.compilePattern(G),Y;if(!G.atBreak)continue;while(Y=z.exec(Q)){let K=Y.index;if(Q.charCodeAt(K)===10&&Q.charCodeAt(K-1)===13)K--;Q=Q.slice(0,K)+" "+Q.slice(Y.index+1)}}return X+Q+X}function n50(){return"`"}function vN($,Z){let J=i3($);return Boolean(!Z.options.resourceLink&&$.url&&!$.title&&$.children&&$.children.length===1&&$.children[0].type==="text"&&(J===$.url||"mailto:"+J===$.url)&&/^[a-z][a-z+.-]+:/i.test($.url)&&!/[\0- <>\u007F]/.test($.url))}fN.peek=s50;function fN($,Z,J,Q){let X=r$(J),H=X==='"'?"Quote":"Apostrophe",G=J.createTracker(Q),z,Y;if(vN($,J)){let W=J.stack;J.stack=[],z=J.enter("autolink");let B=G.move("<");return B+=G.move(J.containerPhrasing($,{before:B,after:">",...G.current()})),B+=G.move(">"),z(),J.stack=W,B}z=J.enter("link"),Y=J.enter("label");let K=G.move("[");if(K+=G.move(J.containerPhrasing($,{before:K,after:"](",...G.current()})),K+=G.move("]("),Y(),!$.url&&$.title||/[\0- \u007F]/.test($.url))Y=J.enter("destinationLiteral"),K+=G.move("<"),K+=G.move(J.safe($.url,{before:K,after:">",...G.current()})),K+=G.move(">");else Y=J.enter("destinationRaw"),K+=G.move(J.safe($.url,{before:K,after:$.title?" ":")",...G.current()}));if(Y(),$.title)Y=J.enter(`title${H}`),K+=G.move(" "+X),K+=G.move(J.safe($.title,{before:K,after:X,...G.current()})),K+=G.move(X),Y();return K+=G.move(")"),z(),K}function s50($,Z,J){return vN($,J)?"<":"["}mN.peek=o50;function mN($,Z,J,Q){let X=$.referenceType,H=J.enter("linkReference"),G=J.enter("label"),z=J.createTracker(Q),Y=z.move("["),K=J.containerPhrasing($,{before:Y,after:"]",...z.current()});Y+=z.move(K+"]["),G();let W=J.stack;J.stack=[],G=J.enter("reference");let B=J.safe(J.associationId($),{before:Y,after:"]",...z.current()});if(G(),J.stack=W,H(),X==="full"||!K||K!==B)Y+=z.move(B+"]");else if(X==="shortcut")Y=Y.slice(0,-1);else Y+=z.move("]");return Y}function o50(){return"["}function n$($){let Z=$.options.bullet||"*";if(Z!=="*"&&Z!=="+"&&Z!=="-")throw Error("Cannot serialize items with `"+Z+"` for `options.bullet`, expected `*`, `+`, or `-`");return Z}function PS($){let Z=n$($),J=$.options.bulletOther;if(!J)return Z==="*"?"-":"*";if(J!=="*"&&J!=="+"&&J!=="-")throw Error("Cannot serialize items with `"+J+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(J===Z)throw Error("Expected `bullet` (`"+Z+"`) and `bulletOther` (`"+J+"`) to be different");return J}function wS($){let Z=$.options.bulletOrdered||".";if(Z!=="."&&Z!==")")throw Error("Cannot serialize items with `"+Z+"` for `options.bulletOrdered`, expected `.` or `)`");return Z}function hK($){let Z=$.options.rule||"*";if(Z!=="*"&&Z!=="-"&&Z!=="_")throw Error("Cannot serialize rules with `"+Z+"` for `options.rule`, expected `*`, `-`, or `_`");return Z}function jS($,Z,J,Q){let X=J.enter("list"),H=J.bulletCurrent,G=$.ordered?wS(J):n$(J),z=$.ordered?G==="."?")":".":PS(J),Y=Z&&J.bulletLastUsed?G===J.bulletLastUsed:!1;if(!$.ordered){let W=$.children?$.children[0]:void 0;if((G==="*"||G==="-")&&W&&(!W.children||!W.children[0])&&J.stack[J.stack.length-1]==="list"&&J.stack[J.stack.length-2]==="listItem"&&J.stack[J.stack.length-3]==="list"&&J.stack[J.stack.length-4]==="listItem"&&J.indexStack[J.indexStack.length-1]===0&&J.indexStack[J.indexStack.length-2]===0&&J.indexStack[J.indexStack.length-3]===0)Y=!0;if(hK(J)===G&&W){let B=-1;while(++B<$.children.length){let q=$.children[B];if(q&&q.type==="listItem"&&q.children&&q.children[0]&&q.children[0].type==="thematicBreak"){Y=!0;break}}}}if(Y)G=z;J.bulletCurrent=G;let K=J.containerFlow($,Q);return J.bulletLastUsed=G,J.bulletCurrent=H,X(),K}function CS($){let Z=$.options.listItemIndent||"one";if(Z!=="tab"&&Z!=="one"&&Z!=="mixed")throw Error("Cannot serialize items with `"+Z+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return Z}function TS($,Z,J,Q){let X=CS(J),H=J.bulletCurrent||n$(J);if(Z&&Z.type==="list"&&Z.ordered)H=(typeof Z.start==="number"&&Z.start>-1?Z.start:1)+(J.options.incrementListMarker===!1?0:Z.children.indexOf($))+H;let G=H.length+1;if(X==="tab"||X==="mixed"&&(Z&&Z.type==="list"&&Z.spread||$.spread))G=Math.ceil(G/4)*4;let z=J.createTracker(Q);z.move(H+" ".repeat(G-H.length)),z.shift(G);let Y=J.enter("listItem"),K=J.indentLines(J.containerFlow($,z.current()),W);return Y(),K;function W(B,q,U){if(q)return(U?"":" ".repeat(G))+B;return(U?H:H+" ".repeat(G-H.length))+B}}function ES($,Z,J,Q){let X=J.enter("paragraph"),H=J.enter("phrasing"),G=J.containerPhrasing($,Q);return H(),X(),G}var uN=i2(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function IS($,Z,J,Q){return($.children.some(function(G){return uN(G)})?J.containerPhrasing:J.containerFlow).call(J,$,Q)}function RS($){let Z=$.options.strong||"*";if(Z!=="*"&&Z!=="_")throw Error("Cannot serialize strong with `"+Z+"` for `options.strong`, expected `*`, or `_`");return Z}pN.peek=t50;function pN($,Z,J,Q){let X=RS(J),H=J.enter("strong"),G=J.createTracker(Q),z=G.move(X+X),Y=G.move(J.containerPhrasing($,{after:X,before:z,...G.current()})),K=Y.charCodeAt(0),W=a$(Q.before.charCodeAt(Q.before.length-1),K,X);if(W.inside)Y=R6(K)+Y.slice(1);let B=Y.charCodeAt(Y.length-1),q=a$(Q.after.charCodeAt(0),B,X);if(q.inside)Y=Y.slice(0,-1)+R6(B);let U=G.move(X+X);return H(),J.attentionEncodeSurroundingInfo={after:q.outside,before:W.outside},z+Y+U}function t50($,Z,J){return J.options.strong||"*"}function kS($,Z,J,Q){return J.safe($.value,Q)}function SS($){let Z=$.options.ruleRepetition||3;if(Z<3)throw Error("Cannot serialize rules with repetition `"+Z+"` for `options.ruleRepetition`, expected `3` or more");return Z}function bS($,Z,J){let Q=(hK(J)+(J.options.ruleSpaces?" ":"")).repeat(SS(J));return J.options.ruleSpaces?Q.slice(0,-1):Q}var hQ={blockquote:qS,break:SN,code:MS,definition:AS,emphasis:bN,hardBreak:SN,heading:OS,html:yN,image:xN,imageReference:hN,inlineCode:gN,link:fN,linkReference:mN,list:jS,listItem:TS,paragraph:ES,root:IS,strong:pN,text:kS,thematicBreak:bS};function dN(){return{enter:{table:e50,tableData:yS,tableHeader:yS,tableRow:Z10},exit:{codeText:J10,table:$10,tableData:cN,tableHeader:cN,tableRow:cN}}}function e50($){let Z=$._align;R5(Z,"expected `_align` on table"),this.enter({type:"table",align:Z.map(function(J){return J==="none"?null:J}),children:[]},$),this.data.inTable=!0}function $10($){this.exit($),this.data.inTable=void 0}function Z10($){this.enter({type:"tableRow",children:[]},$)}function cN($){this.exit($)}function yS($){this.enter({type:"tableCell",children:[]},$)}function J10($){let Z=this.resume();if(this.data.inTable)Z=Z.replace(/\\([\\|])/g,Q10);let J=this.stack[this.stack.length-1];R5(J.type==="inlineCode"),J.value=Z,this.exit($)}function Q10($,Z){return Z==="|"?Z:$}function lN($){let Z=$||{},J=Z.tableCellPadding,Q=Z.tablePipeAlign,X=Z.stringLength,H=J?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
61
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[\t :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:q,table:G,tableCell:Y,tableRow:z}};function G(U,F,N,L){return K(W(U,N,L),U.align)}function z(U,F,N,L){let V=B(U,N,L),M=K([V]);return M.slice(0,M.indexOf(`
|
|
62
|
-
`))}function Y(U,F,N,L){let V=N.enter("tableCell"),M=N.enter("phrasing"),A=N.containerPhrasing(U,{...L,before:H,after:H});return M(),V(),A}function K(U,F){return BS(U,{align:F,alignDelimiters:Q,padding:J,stringLength:X})}function W(U,F,N){let L=U.children,V=-1,M=[],A=F.enter("table");while(++V<L.length)M[V]=B(L[V],F,N);return A(),M}function B(U,F,N){let L=U.children,V=-1,M=[],A=F.enter("tableRow");while(++V<L.length)M[V]=Y(L[V],U,F,N);return A(),M}function q(U,F,N){let L=hQ.inlineCode(U,F,N);if(N.stack.includes("tableCell"))L=L.replace(/\|/g,"\\$&");return L}}function iN(){return{exit:{taskListCheckValueChecked:xS,taskListCheckValueUnchecked:xS,paragraph:X10}}}function rN(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:H10}}}function xS($){let Z=this.stack[this.stack.length-2];R5(Z.type==="listItem"),Z.checked=$.type==="taskListCheckValueChecked"}function X10($){let Z=this.stack[this.stack.length-2];if(Z&&Z.type==="listItem"&&typeof Z.checked==="boolean"){let J=this.stack[this.stack.length-1];R5(J.type==="paragraph");let Q=J.children[0];if(Q&&Q.type==="text"){let X=Z.children,H=-1,G;while(++H<X.length){let z=X[H];if(z.type==="paragraph"){G=z;break}}if(G===J){if(Q.value=Q.value.slice(1),Q.value.length===0)J.children.shift();else if(J.position&&Q.position&&typeof Q.position.start.offset==="number")Q.position.start.column++,Q.position.start.offset++,J.position.start=Object.assign({},Q.position.start)}}}this.exit($)}function H10($,Z,J,Q){let X=$.children[0],H=typeof $.checked==="boolean"&&X&&X.type==="paragraph",G="["+($.checked?"x":" ")+"] ",z=J.createTracker(Q);if(H)z.move(G);let Y=hQ.listItem($,Z,J,{...Q,...z.current()});if(H)Y=Y.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,K);return Y;function K(W){return W+G}}function aN(){return[CN(),EN(),RN(),dN(),iN()]}function nN($){return{extensions:[TN(),IN($),kN(),lN($),rN()]}}var G10={tokenize:B10,partial:!0},hS={tokenize:q10,partial:!0},gS={tokenize:U10,partial:!0},vS={tokenize:F10,partial:!0},z10={tokenize:N10,partial:!0},fS={name:"wwwAutolink",tokenize:K10,previous:uS},mS={name:"protocolAutolink",tokenize:W10,previous:pS},A9={name:"emailAutolink",tokenize:Y10,previous:cS},a2={};function oN(){return{text:a2}}var J7=48;while(J7<123)if(a2[J7]=A9,J7++,J7===58)J7=65;else if(J7===91)J7=97;a2[43]=A9;a2[45]=A9;a2[46]=A9;a2[95]=A9;a2[72]=[A9,mS];a2[104]=[A9,mS];a2[87]=[A9,fS];a2[119]=[A9,fS];function Y10($,Z,J){let Q=this,X,H;return G;function G(B){if(!sN(B)||!cS.call(Q,Q.previous)||tN(Q.events))return J(B);return $.enter("literalAutolink"),$.enter("literalAutolinkEmail"),z(B)}function z(B){if(sN(B))return $.consume(B),z;if(B===64)return $.consume(B),Y;return J(B)}function Y(B){if(B===46)return $.check(z10,W,K)(B);if(B===45||B===95||I1(B))return H=!0,$.consume(B),Y;return W(B)}function K(B){return $.consume(B),X=!0,Y}function W(B){if(H&&X&&t1(Q.previous))return $.exit("literalAutolinkEmail"),$.exit("literalAutolink"),Z(B);return J(B)}}function K10($,Z,J){let Q=this;return X;function X(G){if(G!==87&&G!==119||!uS.call(Q,Q.previous)||tN(Q.events))return J(G);return $.enter("literalAutolink"),$.enter("literalAutolinkWww"),$.check(G10,$.attempt(hS,$.attempt(gS,H),J),J)(G)}function H(G){return $.exit("literalAutolinkWww"),$.exit("literalAutolink"),Z(G)}}function W10($,Z,J){let Q=this,X="",H=!1;return G;function G(B){if((B===72||B===104)&&pS.call(Q,Q.previous)&&!tN(Q.events))return $.enter("literalAutolink"),$.enter("literalAutolinkHttp"),X+=String.fromCodePoint(B),$.consume(B),z;return J(B)}function z(B){if(t1(B)&&X.length<5)return X+=String.fromCodePoint(B),$.consume(B),z;if(B===58){let q=X.toLowerCase();if(q==="http"||q==="https")return $.consume(B),Y}return J(B)}function Y(B){if(B===47){if($.consume(B),H)return K;return H=!0,Y}return J(B)}function K(B){return B===null||r3(B)||q5(B)||d2(B)||a3(B)?J(B):$.attempt(hS,$.attempt(gS,W),J)(B)}function W(B){return $.exit("literalAutolinkHttp"),$.exit("literalAutolink"),Z(B)}}function B10($,Z,J){let Q=0;return X;function X(G){if((G===87||G===119)&&Q<3)return Q++,$.consume(G),X;if(G===46&&Q===3)return $.consume(G),H;return J(G)}function H(G){return G===null?J(G):Z(G)}}function q10($,Z,J){let Q,X,H;return G;function G(K){if(K===46||K===95)return $.check(vS,Y,z)(K);if(K===null||q5(K)||d2(K)||K!==45&&a3(K))return Y(K);return H=!0,$.consume(K),G}function z(K){if(K===95)Q=!0;else X=Q,Q=void 0;return $.consume(K),G}function Y(K){if(X||Q||!H)return J(K);return Z(K)}}function U10($,Z){let J=0,Q=0;return X;function X(G){if(G===40)return J++,$.consume(G),X;if(G===41&&Q<J)return H(G);if(G===33||G===34||G===38||G===39||G===41||G===42||G===44||G===46||G===58||G===59||G===60||G===63||G===93||G===95||G===126)return $.check(vS,Z,H)(G);if(G===null||q5(G)||d2(G))return Z(G);return $.consume(G),X}function H(G){if(G===41)Q++;return $.consume(G),X}}function F10($,Z,J){return Q;function Q(z){if(z===33||z===34||z===39||z===41||z===42||z===44||z===46||z===58||z===59||z===63||z===95||z===126)return $.consume(z),Q;if(z===38)return $.consume(z),H;if(z===93)return $.consume(z),X;if(z===60||z===null||q5(z)||d2(z))return Z(z);return J(z)}function X(z){if(z===null||z===40||z===91||q5(z)||d2(z))return Z(z);return Q(z)}function H(z){return t1(z)?G(z):J(z)}function G(z){if(z===59)return $.consume(z),Q;if(t1(z))return $.consume(z),G;return J(z)}}function N10($,Z,J){return Q;function Q(H){return $.consume(H),X}function X(H){return I1(H)?J(H):Z(H)}}function uS($){return $===null||$===40||$===42||$===95||$===91||$===93||$===126||q5($)}function pS($){return!t1($)}function cS($){return!($===47||sN($))}function sN($){return $===43||$===45||$===46||$===95||I1($)}function tN($){let Z=$.length,J=!1;while(Z--){let Q=$[Z][1];if((Q.type==="labelLink"||Q.type==="labelImage")&&!Q._balanced){J=!0;break}if(Q._gfmAutolinkLiteralWalkedInto){J=!1;break}}if($.length>0&&!J)$[$.length-1][1]._gfmAutolinkLiteralWalkedInto=!0;return J}var V10={tokenize:P10,partial:!0};function eN(){return{document:{[91]:{name:"gfmFootnoteDefinition",tokenize:D10,continuation:{tokenize:_10},exit:O10}},text:{[91]:{name:"gfmFootnoteCall",tokenize:A10},[93]:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:L10,resolveTo:M10}}}}function L10($,Z,J){let Q=this,X=Q.events.length,H=Q.parser.gfmFootnotes||(Q.parser.gfmFootnotes=[]),G;while(X--){let Y=Q.events[X][1];if(Y.type==="labelImage"){G=Y;break}if(Y.type==="gfmFootnoteCall"||Y.type==="labelLink"||Y.type==="label"||Y.type==="image"||Y.type==="link")break}return z;function z(Y){if(!G||!G._balanced)return J(Y);let K=b8(Q.sliceSerialize({start:G.end,end:Q.now()}));if(K.codePointAt(0)!==94||!H.includes(K.slice(1)))return J(Y);return $.enter("gfmFootnoteCallLabelMarker"),$.consume(Y),$.exit("gfmFootnoteCallLabelMarker"),Z(Y)}}function M10($,Z){let J=$.length,Q;while(J--)if($[J][1].type==="labelImage"&&$[J][0]==="enter"){Q=$[J][1];break}$[J+1][1].type="data",$[J+3][1].type="gfmFootnoteCallLabelMarker";let X={type:"gfmFootnoteCall",start:Object.assign({},$[J+3][1].start),end:Object.assign({},$[$.length-1][1].end)},H={type:"gfmFootnoteCallMarker",start:Object.assign({},$[J+3][1].end),end:Object.assign({},$[J+3][1].end)};H.end.column++,H.end.offset++,H.end._bufferIndex++;let G={type:"gfmFootnoteCallString",start:Object.assign({},H.end),end:Object.assign({},$[$.length-1][1].start)},z={type:"chunkString",contentType:"string",start:Object.assign({},G.start),end:Object.assign({},G.end)},Y=[$[J+1],$[J+2],["enter",X,Z],$[J+3],$[J+4],["enter",H,Z],["exit",H,Z],["enter",G,Z],["enter",z,Z],["exit",z,Z],["exit",G,Z],$[$.length-2],$[$.length-1],["exit",X,Z]];return $.splice(J,$.length-J+1,...Y),$}function A10($,Z,J){let Q=this,X=Q.parser.gfmFootnotes||(Q.parser.gfmFootnotes=[]),H=0,G;return z;function z(B){return $.enter("gfmFootnoteCall"),$.enter("gfmFootnoteCallLabelMarker"),$.consume(B),$.exit("gfmFootnoteCallLabelMarker"),Y}function Y(B){if(B!==94)return J(B);return $.enter("gfmFootnoteCallMarker"),$.consume(B),$.exit("gfmFootnoteCallMarker"),$.enter("gfmFootnoteCallString"),$.enter("chunkString").contentType="string",K}function K(B){if(H>999||B===93&&!G||B===null||B===91||q5(B))return J(B);if(B===93){$.exit("chunkString");let q=$.exit("gfmFootnoteCallString");if(!X.includes(b8(Q.sliceSerialize(q))))return J(B);return $.enter("gfmFootnoteCallLabelMarker"),$.consume(B),$.exit("gfmFootnoteCallLabelMarker"),$.exit("gfmFootnoteCall"),Z}if(!q5(B))G=!0;return H++,$.consume(B),B===92?W:K}function W(B){if(B===91||B===92||B===93)return $.consume(B),H++,K;return K(B)}}function D10($,Z,J){let Q=this,X=Q.parser.gfmFootnotes||(Q.parser.gfmFootnotes=[]),H,G=0,z;return Y;function Y(F){return $.enter("gfmFootnoteDefinition")._container=!0,$.enter("gfmFootnoteDefinitionLabel"),$.enter("gfmFootnoteDefinitionLabelMarker"),$.consume(F),$.exit("gfmFootnoteDefinitionLabelMarker"),K}function K(F){if(F===94)return $.enter("gfmFootnoteDefinitionMarker"),$.consume(F),$.exit("gfmFootnoteDefinitionMarker"),$.enter("gfmFootnoteDefinitionLabelString"),$.enter("chunkString").contentType="string",W;return J(F)}function W(F){if(G>999||F===93&&!z||F===null||F===91||q5(F))return J(F);if(F===93){$.exit("chunkString");let N=$.exit("gfmFootnoteDefinitionLabelString");return H=b8(Q.sliceSerialize(N)),$.enter("gfmFootnoteDefinitionLabelMarker"),$.consume(F),$.exit("gfmFootnoteDefinitionLabelMarker"),$.exit("gfmFootnoteDefinitionLabel"),q}if(!q5(F))z=!0;return G++,$.consume(F),F===92?B:W}function B(F){if(F===91||F===92||F===93)return $.consume(F),G++,W;return W(F)}function q(F){if(F===58){if($.enter("definitionMarker"),$.consume(F),$.exit("definitionMarker"),!X.includes(H))X.push(H);return d0($,U,"gfmFootnoteDefinitionWhitespace")}return J(F)}function U(F){return Z(F)}}function _10($,Z,J){return $.check(l2,Z,$.attempt(V10,Z,J))}function O10($){$.exit("gfmFootnoteDefinition")}function P10($,Z,J){let Q=this;return d0($,X,"gfmFootnoteDefinitionIndent",5);function X(H){let G=Q.events[Q.events.length-1];return G&&G[1].type==="gfmFootnoteDefinitionIndent"&&G[2].sliceSerialize(G[1],!0).length===4?Z(H):J(H)}}function $V($){let J=($||{}).singleTilde,Q={name:"strikethrough",tokenize:H,resolveAll:X};if(J===null||J===void 0)J=!0;return{text:{[126]:Q},insideSpan:{null:[Q]},attentionMarkers:{null:[126]}};function X(G,z){let Y=-1;while(++Y<G.length)if(G[Y][0]==="enter"&&G[Y][1].type==="strikethroughSequenceTemporary"&&G[Y][1]._close){let K=Y;while(K--)if(G[K][0]==="exit"&&G[K][1].type==="strikethroughSequenceTemporary"&&G[K][1]._open&&G[Y][1].end.offset-G[Y][1].start.offset===G[K][1].end.offset-G[K][1].start.offset){G[Y][1].type="strikethroughSequence",G[K][1].type="strikethroughSequence";let W={type:"strikethrough",start:Object.assign({},G[K][1].start),end:Object.assign({},G[Y][1].end)},B={type:"strikethroughText",start:Object.assign({},G[K][1].end),end:Object.assign({},G[Y][1].start)},q=[["enter",W,z],["enter",G[K][1],z],["exit",G[K][1],z],["enter",B,z]],U=z.parser.constructs.insideSpan.null;if(U)b1(q,q.length,0,T6(U,G.slice(K+1,Y),z));b1(q,q.length,0,[["exit",B,z],["enter",G[Y][1],z],["exit",G[Y][1],z],["exit",W,z]]),b1(G,K-1,Y-K+3,q),Y=K+q.length-2;break}}Y=-1;while(++Y<G.length)if(G[Y][1].type==="strikethroughSequenceTemporary")G[Y][1].type="data";return G}function H(G,z,Y){let K=this.previous,W=this.events,B=0;return q;function q(F){if(K===126&&W[W.length-1][1].type!=="characterEscape")return Y(F);return G.enter("strikethroughSequenceTemporary"),U(F)}function U(F){let N=V9(K);if(F===126){if(B>1)return Y(F);return G.consume(F),B++,U}if(B<2&&!J)return Y(F);let L=G.exit("strikethroughSequenceTemporary"),V=V9(F);return L._open=!V||V===2&&Boolean(N),L._close=!N||N===2&&Boolean(V),z(F)}}}class ZV{constructor(){this.map=[]}add($,Z,J){w10(this,$,Z,J)}consume($){if(this.map.sort(function(X,H){return X[0]-H[0]}),this.map.length===0)return;let Z=this.map.length,J=[];while(Z>0)Z-=1,J.push($.slice(this.map[Z][0]+this.map[Z][1]),this.map[Z][2]),$.length=this.map[Z][0];J.push($.slice()),$.length=0;let Q=J.pop();while(Q){for(let X of Q)$.push(X);Q=J.pop()}this.map.length=0}}function w10($,Z,J,Q){let X=0;if(J===0&&Q.length===0)return;while(X<$.map.length){if($.map[X][0]===Z){$.map[X][1]+=J,$.map[X][2].push(...Q);return}X+=1}$.map.push([Z,J,Q])}function dS($,Z){let J=!1,Q=[];while(Z<$.length){let X=$[Z];if(J){if(X[0]==="enter"){if(X[1].type==="tableContent")Q.push($[Z+1][1].type==="tableDelimiterMarker"?"left":"none")}else if(X[1].type==="tableContent"){if($[Z-1][1].type==="tableDelimiterMarker"){let H=Q.length-1;Q[H]=Q[H]==="left"?"center":"right"}}else if(X[1].type==="tableDelimiterRow")break}else if(X[0]==="enter"&&X[1].type==="tableDelimiterRow")J=!0;Z+=1}return Q}function JV(){return{flow:{null:{name:"table",tokenize:j10,resolveAll:C10}}}}function j10($,Z,J){let Q=this,X=0,H=0,G;return z;function z(I){let y=Q.events.length-1;while(y>-1){let R=Q.events[y][1].type;if(R==="lineEnding"||R==="linePrefix")y--;else break}let C=y>-1?Q.events[y][1].type:null,j=C==="tableHead"||C==="tableRow"?D:Y;if(j===D&&Q.parser.lazy[Q.now().line])return J(I);return j(I)}function Y(I){return $.enter("tableHead"),$.enter("tableRow"),K(I)}function K(I){if(I===124)return W(I);return G=!0,H+=1,W(I)}function W(I){if(I===null)return J(I);if(S0(I)){if(H>1)return H=0,Q.interrupt=!0,$.exit("tableRow"),$.enter("lineEnding"),$.consume(I),$.exit("lineEnding"),U;return J(I)}if(i0(I))return d0($,W,"whitespace")(I);if(H+=1,G)G=!1,X+=1;if(I===124)return $.enter("tableCellDivider"),$.consume(I),$.exit("tableCellDivider"),G=!0,W;return $.enter("data"),B(I)}function B(I){if(I===null||I===124||q5(I))return $.exit("data"),W(I);return $.consume(I),I===92?q:B}function q(I){if(I===92||I===124)return $.consume(I),B;return B(I)}function U(I){if(Q.interrupt=!1,Q.parser.lazy[Q.now().line])return J(I);if($.enter("tableDelimiterRow"),G=!1,i0(I))return d0($,F,"linePrefix",Q.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I);return F(I)}function F(I){if(I===45||I===58)return L(I);if(I===124)return G=!0,$.enter("tableCellDivider"),$.consume(I),$.exit("tableCellDivider"),N;return _(I)}function N(I){if(i0(I))return d0($,L,"whitespace")(I);return L(I)}function L(I){if(I===58)return H+=1,G=!0,$.enter("tableDelimiterMarker"),$.consume(I),$.exit("tableDelimiterMarker"),V;if(I===45)return H+=1,V(I);if(I===null||S0(I))return O(I);return _(I)}function V(I){if(I===45)return $.enter("tableDelimiterFiller"),M(I);return _(I)}function M(I){if(I===45)return $.consume(I),M;if(I===58)return G=!0,$.exit("tableDelimiterFiller"),$.enter("tableDelimiterMarker"),$.consume(I),$.exit("tableDelimiterMarker"),A;return $.exit("tableDelimiterFiller"),A(I)}function A(I){if(i0(I))return d0($,O,"whitespace")(I);return O(I)}function O(I){if(I===124)return F(I);if(I===null||S0(I)){if(!G||X!==H)return _(I);return $.exit("tableDelimiterRow"),$.exit("tableHead"),Z(I)}return _(I)}function _(I){return J(I)}function D(I){return $.enter("tableRow"),T(I)}function T(I){if(I===124)return $.enter("tableCellDivider"),$.consume(I),$.exit("tableCellDivider"),T;if(I===null||S0(I))return $.exit("tableRow"),Z(I);if(i0(I))return d0($,T,"whitespace")(I);return $.enter("data"),k(I)}function k(I){if(I===null||I===124||q5(I))return $.exit("data"),T(I);return $.consume(I),I===92?x:k}function x(I){if(I===92||I===124)return $.consume(I),k;return k(I)}}function C10($,Z){let J=-1,Q=!0,X=0,H=[0,0,0,0],G=[0,0,0,0],z=!1,Y=0,K,W,B,q=new ZV;while(++J<$.length){let U=$[J],F=U[1];if(U[0]==="enter"){if(F.type==="tableHead"){if(z=!1,Y!==0)lS(q,Z,Y,K,W),W=void 0,Y=0;K={type:"table",start:Object.assign({},F.start),end:Object.assign({},F.end)},q.add(J,0,[["enter",K,Z]])}else if(F.type==="tableRow"||F.type==="tableDelimiterRow"){if(Q=!0,B=void 0,H=[0,0,0,0],G=[0,J+1,0,0],z)z=!1,W={type:"tableBody",start:Object.assign({},F.start),end:Object.assign({},F.end)},q.add(J,0,[["enter",W,Z]]);X=F.type==="tableDelimiterRow"?2:W?3:1}else if(X&&(F.type==="data"||F.type==="tableDelimiterMarker"||F.type==="tableDelimiterFiller")){if(Q=!1,G[2]===0){if(H[1]!==0)G[0]=G[1],B=gK(q,Z,H,X,void 0,B),H=[0,0,0,0];G[2]=J}}else if(F.type==="tableCellDivider")if(Q)Q=!1;else{if(H[1]!==0)G[0]=G[1],B=gK(q,Z,H,X,void 0,B);H=G,G=[H[1],J,0,0]}}else if(F.type==="tableHead")z=!0,Y=J;else if(F.type==="tableRow"||F.type==="tableDelimiterRow"){if(Y=J,H[1]!==0)G[0]=G[1],B=gK(q,Z,H,X,J,B);else if(G[1]!==0)B=gK(q,Z,G,X,J,B);X=0}else if(X&&(F.type==="data"||F.type==="tableDelimiterMarker"||F.type==="tableDelimiterFiller"))G[3]=J}if(Y!==0)lS(q,Z,Y,K,W);q.consume(Z.events),J=-1;while(++J<Z.events.length){let U=Z.events[J];if(U[0]==="enter"&&U[1].type==="table")U[1]._align=dS(Z.events,J)}return $}function gK($,Z,J,Q,X,H){let G=Q===1?"tableHeader":Q===2?"tableDelimiter":"tableData",z="tableContent";if(J[0]!==0)H.end=Object.assign({},s$(Z.events,J[0])),$.add(J[0],0,[["exit",H,Z]]);let Y=s$(Z.events,J[1]);if(H={type:G,start:Object.assign({},Y),end:Object.assign({},Y)},$.add(J[1],0,[["enter",H,Z]]),J[2]!==0){let K=s$(Z.events,J[2]),W=s$(Z.events,J[3]),B={type:"tableContent",start:Object.assign({},K),end:Object.assign({},W)};if($.add(J[2],0,[["enter",B,Z]]),Q!==2){let q=Z.events[J[2]],U=Z.events[J[3]];if(q[1].end=Object.assign({},U[1].end),q[1].type="chunkText",q[1].contentType="text",J[3]>J[2]+1){let F=J[2]+1,N=J[3]-J[2]-1;$.add(F,N,[])}}$.add(J[3]+1,0,[["exit",B,Z]])}if(X!==void 0)H.end=Object.assign({},s$(Z.events,X)),$.add(X,0,[["exit",H,Z]]),H=void 0;return H}function lS($,Z,J,Q,X){let H=[],G=s$(Z.events,J);if(X)X.end=Object.assign({},G),H.push(["exit",X,Z]);Q.end=Object.assign({},G),H.push(["exit",Q,Z]),$.add(J+1,0,H)}function s$($,Z){let J=$[Z],Q=J[0]==="enter"?"start":"end";return J[1][Q]}var T10={name:"tasklistCheck",tokenize:E10};function QV(){return{text:{[91]:T10}}}function E10($,Z,J){let Q=this;return X;function X(Y){if(Q.previous!==null||!Q._gfmTasklistFirstContentOfListItem)return J(Y);return $.enter("taskListCheck"),$.enter("taskListCheckMarker"),$.consume(Y),$.exit("taskListCheckMarker"),H}function H(Y){if(q5(Y))return $.enter("taskListCheckValueUnchecked"),$.consume(Y),$.exit("taskListCheckValueUnchecked"),G;if(Y===88||Y===120)return $.enter("taskListCheckValueChecked"),$.consume(Y),$.exit("taskListCheckValueChecked"),G;return J(Y)}function G(Y){if(Y===93)return $.enter("taskListCheckMarker"),$.consume(Y),$.exit("taskListCheckMarker"),$.exit("taskListCheck"),z;return J(Y)}function z(Y){if(S0(Y))return Z(Y);if(i0(Y))return $.check({tokenize:I10},Z,J)(Y);return J(Y)}}function I10($,Z,J){return d0($,Q,"whitespace");function Q(X){return X===null?J(X):Z(X)}}function iS($){return tY([oN(),eN(),$V($),JV(),QV()])}var R10={};function vK($){let Z=this,J=$||R10,Q=Z.data(),X=Q.micromarkExtensions||(Q.micromarkExtensions=[]),H=Q.fromMarkdownExtensions||(Q.fromMarkdownExtensions=[]),G=Q.toMarkdownExtensions||(Q.toMarkdownExtensions=[]);X.push(iS(J)),H.push(aN()),G.push(nN(J))}var Q7=P(l(),1),k10=[vK],S10=[xK],b10={code({className:$,children:Z,...J}){return Q7.jsx("code",{className:e("rounded-xs bg-accent px-1 py-0.5 font-mono font-normal before:content-none after:content-none",$),...J,children:Z})},pre({children:$}){return Q7.jsx("div",{className:"not-prose my-2 rounded-lg border border-border bg-[color-mix(var(--foreground)_5%,transparent)] px-3 py-2.5",children:Q7.jsx("pre",{className:"overflow-auto font-mono text-xs leading-relaxed whitespace-pre text-foreground [&>code]:rounded-none [&>code]:bg-transparent [&>code]:p-0",children:$})})}};function rS({size:$="sm",content:Z}){return Q7.jsx("div",{className:e("prose max-w-full min-w-0 wrap-anywhere prose-inherit",$==="sm"&&"prose-sm"),children:Q7.jsx(wK,{remarkPlugins:k10,rehypePlugins:S10,components:b10,children:Z})})}function aS({content:$}){return Q7.jsx(wK,{allowedElements:[],skipHtml:!0,unwrapDisallowed:!0,children:$})}var DV=P(v(),1);var nS="/agentation-4s0nn45p.png";var sS="/airtable-hsa66v6q.png";var oS="/apollo-2ed5dy2d.png";var tS="/asana-tvgtwbx2.png";var eS="/atlassian-b3tq39hs.png";var $b="/box-w3n36t5g.png";var XV="/chrome-tspm94rw.svg";var Zb="/clickup-qqrqqvqb.png";var Jb="/cloudflare-j9p931v6.png";var Qb="/context7-8ht0xjfy.png";var Xb="/datadog-70ne3yzt.png";var Hb="/discord-vejhptwx.png";var Gb="/dropbox-4m5s9mgr.png";var zb="/elevenlabs-2nzzej1t.png";var Yb="/exa-qqj3vr0x.png";var Kb="/figma-y9898rry.png";var Wb="/firecrawl-w2t8nehx.png";var Bb="/github-av5r5y3e.png";var qb="/gitlab-4pv5vm6b.png";var Ub="/gmail-sg6a5v3x.png";var Fb="/googlecalendar-nqhh2v7r.png";var Nb="/googledrive-6s8xyab7.png";var Vb="/grafana-1yfsnwr6.png";var Lb="/granola-7j3b0nk2.png";var Mb="/hubspot-hghcmc2t.png";var Ab="/huggingface-kxzaxj83.png";var Db="/intercom-td763jt8.png";var _b="/linear-v9s3az2d.png";var Ob="/monday-jdbs4wwf.png";var Pb="/mongodb-emzxvhd5.png";var wb="/neon-zj4qar44.png";var jb="/notion-w034c0b8.png";var Cb="/paper-zbt34fab.png";var Tb="/paypal-kwwf7xsc.png";var Eb="/perplexity-4y63rxvj.png";var Ib="/postgresql-qsspbsr1.png";var Rb="/posthog-sphppc4w.png";var kb="/puppeteer-2xjt1a9b.png";var Sb="/railway-834de8d2.png";var bb="/redis-spm6w2m1.png";var yb="/salesforce-1mk56v4z.png";var xb="/sentry-hdwpmvek.png";var hb="/shopify-90dadaav.png";var gb="/slack-1c1wj62s.png";var vb="/snowflake-hfpykpgy.png";var fb="/stripe-zrfaqbj3.png";var mb="/supabase-4vg33zf2.png";var ub="/telegram-v6tjyrs7.png";var pb="/twilio-dpyjdwpj.png";var cb="/vercel-7d0ssw28.png";var db="/zapier-p67qfch0.png";var k80={agentation:nS,airtable:sS,apollo:oS,asana:tS,atlassian:eS,box:$b,chrome:XV,"chrome-devtools":XV,clickup:Zb,cloudflare:Jb,context7:Qb,datadog:Xb,discord:Hb,dropbox:Gb,elevenlabs:zb,exa:Yb,figma:Kb,firecrawl:Wb,github:Bb,gitlab:qb,gmail:Ub,googlecalendar:Fb,googledrive:Nb,grafana:Vb,granola:Lb,hubspot:Mb,huggingface:Ab,intercom:Db,linear:_b,monday:Ob,mongodb:Pb,neon:wb,notion:jb,paper:Cb,paypal:Tb,perplexity:Eb,postgresql:Ib,posthog:Rb,puppeteer:kb,railway:Sb,redis:bb,salesforce:yb,sentry:xb,shopify:hb,slack:gb,snowflake:vb,stripe:fb,supabase:mb,telegram:ub,twilio:pb,vercel:cb,zapier:db},S80={"google drive":"googledrive","google calendar":"googlecalendar",gcal:"googlecalendar",gdrive:"googledrive","apollo.io":"apollo","paper-desktop":"paper","granola-mcp":"granola","claude-in-chrome":"chrome",postgres:"postgresql","hugging face":"huggingface",jira:"atlassian",confluence:"atlassian"};function lb($){let Z=$.match(/^claude[._]ai[._\s]+(.+)$/i);if(!Z)return $;return Z[1].replace(/_/g," ")}function fK($){return $.toLowerCase().replace(/[\s._-]+/g,"")}var b80=new Map(Object.entries(k80).map(([$,Z])=>[fK($),Z])),y80=new Map(Object.entries(S80).map(([$,Z])=>[fK($),fK(Z)]));function mK($){let Z=fK(lb($));return b80.get(y80.get(Z)??Z)}function uK($){return lb($).split(/[\s._-]+/).filter(Boolean).map((Z)=>Z[0].toUpperCase()+Z.slice(1)).join(" ")}var HV=P(l(),1);function gQ({open:$,children:Z}){return HV.jsx(O4,{initial:!1,children:$&&HV.jsx(h5.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{type:"spring",duration:0.25,bounce:0.1},className:"overflow-hidden",children:Z},"content")})}var ib=P(v(),1);var nb=P(l(),1),x80=/\.(png|jpe?g|gif|webp|avif|svg)$/i;function rb($,Z){if($.name!=="Read"||!Z)return null;let J=$.input,Q=typeof J.file_path==="string"?J.file_path:null;if(!Q||!x80.test(Q))return null;let X=Z.endsWith("/")?Z:`${Z}/`;if(!Q.startsWith(X))return null;return Q.slice(X.length)}function ab({relPath:$}){let Z=o5(),[J,Q]=ib.useState(!1);if(J)return null;let X=`/api/workspaces/${Z}/preview/${$.split("/").map(encodeURIComponent).join("/")}`;return nb.jsx("img",{src:X,alt:$,loading:"lazy",onError:()=>Q(!0),className:"max-h-64 max-w-full self-start rounded-lg border border-border object-contain"})}var mQ=P(v(),1);var ob=P(l(),1),h80=e("animate-[text-shimmer_2s_ease-in-out_infinite]","bg-clip-text text-transparent","bg-[length:200%_auto]","bg-[linear-gradient(90deg,var(--muted-foreground)_0%,var(--muted-foreground)_40%,var(--foreground)_50%,var(--muted-foreground)_60%,var(--muted-foreground)_100%)]");function sb({children:$,active:Z=!0,className:J}){return ob.jsx("span",{className:e(J,Z&&h80),children:$})}var vQ=P(l(),1);function pK({className:$}){return vQ.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",className:$,"aria-hidden":"true",children:[vQ.jsx("path",{d:"M3.49994 11.7501L11.6717 3.57855C12.7762 2.47398 14.5672 2.47398 15.6717 3.57855C16.7762 4.68312 16.7762 6.47398 15.6717 7.57855M15.6717 7.57855L9.49994 13.7501M15.6717 7.57855C16.7762 6.47398 18.5672 6.47398 19.6717 7.57855C20.7762 8.68312 20.7762 10.474 19.6717 11.5785L12.7072 18.543C12.3167 18.9335 12.3167 19.5667 12.7072 19.9572L13.9999 21.2499"}),vQ.jsx("path",{d:"M17.4999 9.74921L11.3282 15.921C10.2238 17.0255 8.43275 17.0255 7.32825 15.921C6.22376 14.8164 6.22376 13.0255 7.32825 11.921L13.4999 5.74939"})]})}var e1=P(l(),1),cK="group/row flex w-full items-center gap-2 py-1.5 text-left select-none";function t$({isFirst:$,isLast:Z,marker:J,loading:Q=!1,isError:X=!1,children:H}){let G=J!=null||Q;return e1.jsxs("div",{className:"relative flex gap-2.5",children:[e1.jsxs("div",{className:"relative w-[13px] shrink-0",children:[!$&&e1.jsx("span",{className:e("absolute top-0 left-1/2 w-px -translate-x-1/2 bg-border",G?"h-1":"h-2.5")}),!Z&&e1.jsx("span",{className:e("absolute bottom-0 left-1/2 w-px -translate-x-1/2 bg-border",G?"top-[26px]":"top-5")}),J?e1.jsx("span",{className:"absolute top-[15px] left-1/2 z-10 -translate-x-1/2 -translate-y-1/2",children:J}):Q?e1.jsx("span",{className:"absolute top-[15px] left-1/2 z-10 flex -translate-x-1/2 -translate-y-1/2 p-0.5",children:e1.jsx(A1,{size:12,stroke:1.75,className:"animate-spin text-muted-foreground"})}):e1.jsx("span",{className:e("absolute top-[15px] left-1/2 z-10 size-[5px] -translate-x-1/2 -translate-y-1/2 rounded-full",X?"bg-destructive":"bg-border")})]}),H]})}function fQ({open:$}){return e1.jsx(h5.span,{animate:{rotate:$?90:0},transition:{type:"spring",duration:0.2,bounce:0.1},className:e("flex shrink-0",$?"opacity-100":"opacity-0 group-hover/row:opacity-100"),children:e1.jsx(h3,{size:12,stroke:1.75})})}function o$({children:$,className:Z}){return e1.jsx("span",{className:e("flex size-4 items-center justify-center overflow-hidden rounded-xs bg-muted",Z),children:$})}function tb({icon:$,size:Z=12,stroke:J=1.75}){return e1.jsx(o$,{children:e1.jsx($,{size:Z,stroke:J,className:"text-muted-foreground"})})}function eb({src:$}){if(!$)return e1.jsx(o$,{children:e1.jsx(pK,{className:"size-3 text-muted-foreground"})});return e1.jsx(o$,{children:e1.jsx("img",{src:$,alt:"",className:"size-full object-cover"})})}var g80=/^[A-Za-z]:\//;function v80($=""){if(!$)return $;return $.replace(/\\/g,"/").replace(g80,(Z)=>Z.toUpperCase())}var f80=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;var $y=/^\/([A-Za-z]:)?$/;function m80(){if(typeof process<"u"&&typeof process.cwd==="function")return process.cwd().replace(/\\/g,"/");return"/"}var GV=function(...$){$=$.map((Q)=>v80(Q));let Z="",J=!1;for(let Q=$.length-1;Q>=-1&&!J;Q--){let X=Q>=0?$[Q]:m80();if(!X||X.length===0)continue;Z=`${X}/${Z}`,J=zV(X)}if(Z=Zy(Z,!J),J&&!zV(Z))return`/${Z}`;return Z.length>0?Z:"."};function Zy($,Z){let J="",Q=0,X=-1,H=0,G=null;for(let z=0;z<=$.length;++z){if(z<$.length)G=$[z];else if(G==="/")break;else G="/";if(G==="/"){if(X===z-1||H===1);else if(H===2){if(J.length<2||Q!==2||J[J.length-1]!=="."||J[J.length-2]!=="."){if(J.length>2){let Y=J.lastIndexOf("/");if(Y===-1)J="",Q=0;else J=J.slice(0,Y),Q=J.length-1-J.lastIndexOf("/");X=z,H=0;continue}else if(J.length>0){J="",Q=0,X=z,H=0;continue}}if(Z)J+=J.length>0?"/..":"..",Q=2}else{if(J.length>0)J+=`/${$.slice(X+1,z)}`;else J=$.slice(X+1,z);Q=z-X-1}X=z,H=0}else if(G==="."&&H!==-1)++H;else H=-1}return J}var zV=function($){return f80.test($)};var YV=function($,Z){let J=GV($).replace($y,"$1").split("/"),Q=GV(Z).replace($y,"$1").split("/");if(Q[0][1]===":"&&J[0][1]===":"&&J[0]!==Q[0])return Q.join("/");let X=[...J];for(let H of X){if(Q[0]!==H)break;J.shift(),Q.shift()}return[...J.map(()=>".."),...Q].join("/")};function Hy($){if(!($.name==="Bash"||$.name==="exec"))return null;let J=$.input??{},Q=typeof J.command==="string"?J.command:"";if(!Q)return null;let X=Q.match(/(?:^|\s|\$\()mcporter(?:\)?)\s+call\s+([A-Za-z0-9_-]+)\.([A-Za-z0-9_-]+)((?:\s+(?!&&|\|\||;|\|)\S+)*)/);if(!X)return null;return{server:X[1],tool:X[2],rest:(X[3]??"").trim()}}function Gy($){let Z=$.name;if(!Z.startsWith("mcp__"))return null;let J=Z.slice(5),Q=J.indexOf("__");if(Q<=0)return null;return{server:J.slice(0,Q),tool:J.slice(Q+2),rest:""}}function zy($){if($.provider!=="codex"||!$.mcpServer)return null;if($.name in Ky)return null;if($.mcpServer==="codex")return null;let Z=$.name.indexOf(".");if(Z>0)return{server:$.name.slice(0,Z),tool:$.name.slice(Z+1),rest:""};return{server:$.mcpServer,tool:$.name,rest:""}}function Yy($,Z){let J=Z.toLowerCase();return["-","_","."].find((X)=>J.startsWith($.toLowerCase()+X))?Z.slice($.length+1):Z}function H5($,Z){let J=$[Z];return typeof J==="string"?J:""}function e$($){let Z=Math.max(1,Math.round($/1000));if(Z<60)return`${Z}s`;let J=Math.floor(Z/60),Q=Z%60;return Q?`${J}m ${Q}s`:`${J}m`}function u80($){return(Z)=>Z.replace(/\/[^\s"']+/g,(J)=>{if(!$)return J;let Q=YV($,J);return Q.startsWith("..")?J:Q})}var p80={read:"Read file",write:"Write file",edit:"Edit file",apply_patch:"Edit",exec:"Bash",bash:"Bash",ls:"List files",find:"Find files",grep:"Search",process:"Manage process",web_search:"Web search",web_fetch:"Fetch",sessions_list:"List sessions",sessions_history:"Recall session",sessions_yield:"Yield to session",sessions_send:"Send to session",sessions_spawn:"Spawn session",subagents:"Run sub-agent",agents_list:"List agents",session_status:"Session status",image:"Analyze image",image_generate:"Generate image",memory_get:"Read memory",memory_search:"Search memory",update_plan:"Update plan",message:"Send message",browser:"Browser",canvas:"Canvas",cron:"Cron",gateway:"Gateway",code_execution:"Run Python",tts:"Text-to-speech",music_generate:"Generate music",video_generate:"Generate video",x_search:"Search X"},Jy={ToolSearch:"Tool search",WebSearch:"Web search",WebFetch:"Web fetch"},Ky={exec:"Bash",apply_patch:"Edit",web_search:"Web search",update_plan:"Update plan",subagent:"Run sub-agent",subagent_activity:"Sub-agent",review:"Review",view_image:"View image",generate_image:"Generate image",list_mcp_resources:"List MCP resources",list_mcp_resource_templates:"List MCP templates",read_mcp_resource:"Read MCP resource"},Wy={read:"Read",listFiles:"List files",search:"Search"};function By($){let Z=$?.commandActions;if(!Array.isArray(Z)||Z.length===0)return null;let J=Z[0],Q=J?.type;if(!Q||!(Q in Wy))return null;if(Z.some((X)=>X?.type!==Q))return null;return J}var Qy={spawn_agent:"Run sub-agent",send_input:"Message the agent",resume_agent:"Resume the agent",close_agent:"Stopping the agent"};function qy($){if($.provider==="openclaw")return p80[$.name]??Jy[$.name]??$.name;if($.provider==="codex"){if($.name==="exec"){let Z=By($.input);if(Z?.type)return Wy[Z.type]}if($.name==="subagent"){let Z=$.input?.action;if(typeof Z==="string"&&Z in Qy)return Qy[Z]}return Ky[$.name]??$.name}return Jy[$.name]??$.name}function c80($){if(!$.startsWith("mcp__"))return $;let Z=$.slice(5).split("__");return Z.length>=2?Z.slice(1).join("__"):Z[0]}function Uy($,Z){let J=$.input??{},Q=u80(Z);if($.provider==="openclaw")return l80($.name,J,Q)||Xy($.name,J,Q);if($.provider==="codex")return d80($.name,J,Q);return Xy($.name,J,Q)}function d80($,Z,J){if($==="exec"){let Q=By(Z);if(Q?.type==="read")return J(Q.path||Q.name||"");if(Q?.type==="search")return[Q.query&&`/${Q.query}/`,Q.path&&J(Q.path)].filter(Boolean).join(" ");if(Q?.type==="listFiles")return Q.path?J(Q.path):"";return J(`$ ${H5(Z,"command")}`)}if($==="apply_patch"){let Q=Z.changes;if(Array.isArray(Q))return Q.map((H)=>H&&typeof H==="object"?H.path:void 0).filter((H)=>typeof H==="string").map(J).join(", ");return""}if($==="web_search"){let Q=Z.queries;if(Array.isArray(Q)&&Q.length>0)return Q.filter((X)=>typeof X==="string").join(" · ");return H5(Z,"query")}if($==="update_plan"){let Q=Z.plan;return typeof Q==="string"?Q.split(`
|
|
63
|
-
`)[0]:""}if($==="subagent"){if(H5(Z,"action")==="close_agent")return"";return H5(Z,"prompt")}if($==="subagent_activity")return H5(Z,"kind");if($==="generate_image")return H5(Z,"prompt").split(`
|
|
64
|
-
`)[0];if($==="read_mcp_resource")return H5(Z,"uri");if($==="list_mcp_resources"||$==="list_mcp_resource_templates")return H5(Z,"server");return""}function Xy($,Z,J){if($==="Bash")return J(`$ ${H5(Z,"command")}`);if($==="Read"||$==="Write"||$==="Edit")return J(H5(Z,"file_path"));if($==="Glob")return J(H5(Z,"pattern"));if($==="Grep")return`/${H5(Z,"pattern")}/ ${J(H5(Z,"path"))}`;if($==="WebSearch")return H5(Z,"query");if($==="WebFetch")return H5(Z,"url");if($==="ToolSearch"){let Q=H5(Z,"query");if(Q.startsWith("select:"))return Q.slice(7).split(",").map(c80).join(", ");return Q}return""}function l80($,Z,J){if($==="read"||$==="write"||$==="edit")return J(H5(Z,"path"));if($==="apply_patch"){let Q=Z.changes;if(Array.isArray(Q)&&Q.length>0){let G=Q.map((z)=>z&&typeof z==="object"?H5(z,"path"):"").filter(Boolean);if(G.length===1)return J(G[0]);if(G.length>1)return`${G.length} files`}let X=H5(Z,"patch")||H5(Z,"input"),H=X.split(`
|
|
65
|
-
`).find((G)=>G.startsWith("*** "))??X.split(`
|
|
66
|
-
`)[0];return J(H??"")}if($==="exec"||$==="bash"){let Q=H5(Z,"command")||H5(Z,"code");return Q?J(`$ ${Q}`):""}if($==="ls"||$==="find"||$==="grep")return J(H5(Z,"path")||H5(Z,"pattern"));if($==="process"){let Q=H5(Z,"action"),X=H5(Z,"name");return[Q,X].filter(Boolean).join(" ")||J(H5(Z,"command"))}if($==="web_search"||$==="x_search")return H5(Z,"query");if($==="web_fetch")return H5(Z,"url");if($==="memory_search")return H5(Z,"query");if($==="memory_get")return H5(Z,"key")||H5(Z,"name");if($==="sessions_history"||$==="sessions_send"||$==="sessions_yield")return H5(Z,"sessionKey")||H5(Z,"agentId");if($==="sessions_list"||$==="agents_list")return H5(Z,"agentId");if($==="subagents"||$==="sessions_spawn")return H5(Z,"task")||H5(Z,"agentId");if($==="image"||$==="image_generate")return H5(Z,"prompt")||J(H5(Z,"path"));if($==="message")return H5(Z,"recipient")||H5(Z,"to");if($==="update_plan"){let Q=Z.plan;if(Array.isArray(Q)){let H=Q.find((G)=>!!G&&typeof G==="object"&&G.status==="in_progress")?.step??Q[0]?.step;if(typeof H==="string")return H}return""}return""}var y1=P(l(),1),Fy=[Ny,Vy,KV];function i80(){let[$,Z]=mQ.useState(0);mQ.useEffect(()=>{let Q=setInterval(()=>Z((X)=>(X+1)%Fy.length),600);return()=>clearInterval(Q)},[]);let J=Fy[$];return y1.jsx(o$,{className:"size-5",children:y1.jsx(J,{size:16,stroke:1.75,className:"text-foreground"})})}function Ly({call:$,cwd:Z,isFirst:J,isLast:Q,renderNestedParts:X}){let[H,G]=mQ.useState(!1),z=$.subagent,Y=$.input??{},K=z?.description??Y.description??"Subtask",W=z?.status,B=$.state==="error"||W==="failed",q=$.state==="running"||W==="running",U=z?.usage?.toolUses,F=z?.usage?.durationMs,L=(q&&z?.progress?.length?z.progress[z.progress.length-1]:null)??(U!=null?`Took ${U} step${U===1?"":"s"}`:null),V=(z?.transcript??[]).flatMap((O)=>O.parts),M=typeof $.output==="string"?$.output:"",A=V.length>0||!!M;return y1.jsx(t$,{isFirst:J,isLast:Q,marker:q?y1.jsx(i80,{}):y1.jsx(o$,{className:"size-5",children:y1.jsx(KV,{size:16,stroke:1.75,className:"text-foreground"})}),isError:B,children:y1.jsxs("div",{className:"min-w-0 flex-1",children:[y1.jsxs("button",{type:"button",title:`Agent: ${K}`,onClick:()=>A&&G((O)=>!O),className:e("group/row flex w-full flex-col items-start gap-0.5 py-1.5 text-left select-none",A?"cursor-pointer":"cursor-default"),children:[y1.jsxs("span",{className:"flex w-full items-center gap-2",children:[y1.jsxs(sb,{active:q,className:"min-w-0 flex-1 truncate text-xs font-medium",children:["Agent: ",K]}),!q&&F!=null&&y1.jsx("span",{className:"shrink-0 rounded-full border border-border px-1.5 text-[10px] font-medium text-muted-foreground tabular-nums",children:e$(F)}),W==="failed"&&y1.jsx("span",{className:"shrink-0 text-xs text-destructive",children:"✗"}),W==="stopped"&&y1.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:"✗"}),A&&y1.jsx(fQ,{open:H})]}),L&&y1.jsx("span",{className:"w-full truncate text-xs text-muted-foreground",children:L})]}),A&&y1.jsx(gQ,{open:H,children:y1.jsxs("div",{className:"mt-1 mb-1 overflow-hidden rounded-lg border border-border",children:[V.length>0&&y1.jsx("div",{className:"py-1.5 pr-2 pl-3",children:X(V,Z)}),M&&y1.jsx("div",{className:e("bg-muted/30 px-3.5 py-3 text-xs leading-relaxed whitespace-pre-wrap text-muted-foreground",V.length>0&&"border-t border-border"),children:M})]})})]})})}var X7=P(v(),1);var Ty=P(v(),1);var qV=new Set(["<",">","{","}","[","]"]),VV=new Set(["for","do","while","if","else","return","function","var","let","const","true","false","undefined","this","new","delete","typeof","in","instanceof","void","break","continue","switch","case","default","throw","try","catch","finally","debugger","with","yield","async","await","class","extends","super","import","export","from","static"]),r80=new Set([...VV,"type","interface","enum","implements","readonly","abstract","declare","namespace","module","private","protected","public","override","keyof","infer","is","asserts","satisfies","as","unknown","never","any","number","string","boolean","bigint","symbol","object"]),_y=new Set(["+","-","*","/","%","=","!","&","|","^","~","!","?",":",".",",",";","'",'"',".","(",")","[","]","#","@","\\",...qV]),a80={keywords:VV,onCommentStart:jy,onCommentEnd:Q40};function n80($){let Z=0;if(/\binterface\s+[A-Za-z_$][\w$]*/.test($))Z+=2;if(/\btype\s+[A-Za-z_$][\w$]*\s*=/.test($))Z+=2;if(/\benum\s+[A-Za-z_$][\w$]*/.test($))Z+=2;if(/\b(?:implements|readonly|declare|namespace|satisfies|infer|keyof|asserts)\b/.test($))Z+=2;if(/:\s*[A-Za-z_$][\w$]*(?:<[^>\n]+>)?(?:\[\])?(?=\s*[,)=;{])/m.test($))Z+=1;if(/\b(?:const|let|var)\s+[A-Za-z_$][\w$]*\s*:\s*/.test($))Z+=1;if(/\)\s*:\s*[A-Za-z_$][\w$]*(?:<[^>\n]+>)?(?:\[\])?\s*(?:=>|\{)/.test($))Z+=1;return Z>=2}function s80($,Z){if($[Z]!=="<")return!1;let J=0,Q=!1;for(let X=Z;X<$.length;X++){let H=$[X];if(H==="<"){J++;continue}if(H===">"){if(J--,J===0){let G=X+1;while(G<$.length&&/\s/.test($[G]))G++;if(!(Q&&$[G]==="("))return!1;let z=$.slice(G,G+320);return/\)\s*(?::[\s\S]{0,120}?)?=>/.test(z)}continue}if(J===0)continue;if(/[$A-Za-z_]/.test(H)){Q=!0;continue}if(/[\s,\.\=\?\:\|\&\[\]]/.test(H))continue;return!1}return!1}var dK=["identifier","keyword","string","class","property","entity","jsxliterals","sign","comment","break","space"],[$Z,o80,k6,WV,BV,t80,e80,n2,My,UV,Ay]=dK.map(($,Z)=>Z);function uQ($){return/^[^\S\r\n]+$/g.test($)}function $40($){return _y.has($)}function Z40($){return $.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function lK($){return/^[\w_]+$/.test($)||Oy($)}function Dy($){let Z=$[0];return lK(Z)&&Z===Z.toUpperCase()||$==="null"}function Oy($){return/[^\u0000-\u007f]/.test($)}function Py($){return/^[a-zA-Z]$/.test($)}function wy($){return Py($)||Oy($)}function ZZ($){return wy($[0])&&($.length===1||lK($.slice(1)))}function FV($){return $==="`"}function NV($){return $==='"'||$==="'"}function J40($){return NV($)||FV($)}function jy($,Z){let J=$+Z;if(J==="/*")return 2;return J==="//"?1:0}function Q40($,Z){return $+Z==="*/"?2:Z===`
|
|
67
|
-
`?1:0}function X40($){return $[0]==="/"&&!jy($[0],$[1])}function H40($,Z){let J={...a80,...Z},Q=!!(Z&&Z.keywords instanceof Set),X=n80($),H=Q?J.keywords:X?r80:VV,{onCommentStart:G,onCommentEnd:z}=J,Y=J.typeKeywords instanceof Set?J.typeKeywords:null,K="",W=-1,B=[-1,""],q=[-2,""],U=[],F=!1,N=0,L=!1,V=0,M=()=>F&&!L&&!N,A=()=>N&&!M(),O=()=>!N&&M()&&!L&&V>0,_=null,D=!1,T=0,k=0,x=()=>_!==null,I=()=>D,y=()=>k>T,C=()=>k>0&&k===T,j=()=>x()||y();function R(E){let b=E===`
|
|
68
|
-
`;if(A()){if(x())return k6;let[,u]=B;if(ZZ(E)){if(u==="<"||u==="</")return t80}}if(O())return e80;if(x()||y())return k6;else if(Y&&Y.has(E))return B[1]==="."?$Z:WV;else if(H.has(E))return B[1]==="."?$Z:o80;else if(b)return UV;else if(uQ(E))return Ay;else if(E.split("").every($40))return n2;else if(Dy(E))return A()?$Z:WV;else{if(ZZ(E)){let u=B[1]==="."&&ZZ(q[1]);if(!j()&&!u)return $Z;if(u)return BV}return k6}}let S=(E,b)=>{if(b)K=b;if(K){W=typeof E==="number"?E:R(K);let g=[W,K];if(W!==Ay&&W!==UV)q=B,B=g;U.push(g)}K=""};for(let E=0;E<$.length;E++){let b=$[E],g=$[E-1],u=$[E+1],w=g+b,s=b+u;if(typeof J.onQuote==="function"&&b==="'"&&!x()&&!O()&&!y()){let d=J.onQuote(b,E,$);if(typeof d==="number"&&d>=1&&!Number.isNaN(d)){let Y0=Math.min(d,$.length-E),B0=E+Y0;S(),K=$.slice(E,B0),S($Z),E=B0-1;continue}}if(NV(b)&&!O()&&!y()){if(S(),g!=="\\"){if(_&&b===_)_=null;else if(!_)_=b}S(k6,b);continue}if(!y()){if(g!=="\\n"&&FV(b)){S(),S(k6,b),k++;continue}}if(y()){if(g!=="\\n"&&FV(b)){if(k>0){S(),k--,S(k6,b);continue}}if(s==="${"){T++,S(k6),S(n2,s),E++;continue}}if(C()&&b==="}"){S(),T--,S(n2,b);continue}if(M()){if(b==="{"){S(),S(n2,b),L=!0;continue}}if(F){if(!N&&b==="<"){if(S(),u==="/")N=2,K=s,E++;else N=1,K=b;S(n2);continue}if(N){if(b===">"&&!"/=".includes(g)){if(S(),N===1)N=0,V++;else N=0,F=!1;S(n2,b);continue}if(s==="/>"||s==="</"){if(K!=="<"&&K!=="/")S();if(s==="/>")N=0;else V--;if(!V)F=!1;K=s,E++,S(n2);continue}if(b==="<"){S(),K=b,S(n2);continue}if(u==="-"&&!j()&&!O()){if(K){S(BV,K+b+u),E++;continue}}if(u==="="&&!j()){if(!uQ(b)){if(uQ(K))S();let d=K+b;if(ZZ(d)){S(BV,d);continue}}}}}if(!N&&(b==="<"&&wy(u)||s==="</")){let d=E-1;while(d>=0&&/\s/.test($[d]))d--;let Y0=d>=0?$[d]:"",[B0,J0]=B,H0=!1,N0=!1;if(K&&!uQ(K)){let $0=K;if(Dy($0)||$0==="true"||$0==="false")H0=!0;else if(H.has($0)&&ZZ($0))N0=!0;else if(ZZ($0))H0=!0}let c=b==="<"&&/[$\w\]\)]/.test(Y0)&&(H0||!N0&&(B0===$Z||B0===WV||B0===n2&&(J0===")"||J0==="]"))),Z0=b==="<"&&s80($,E);if(!c&&!Z0)N=u==="/"?2:1;if(b==="<"&&(u==="/"||Py(u))){if(!c&&!Z0&&!j()&&!O()&&!I())F=!0}}let z0=J40(b),h=y(),t=!F&&X40(s),M0=O();if(z0||h||NV(_))K+=b;else if(t){S();let[d,Y0]=B;if(t&&d!==-1&&!(d===n2&&Y0!==")"||d===My)){K=b,S();continue}D=!0;let B0=E++,J0=()=>E>=$.length,H0=()=>J0()||$[E]===`
|
|
69
|
-
`,N0=!1,c=!1;for(;!H0();E++){let Z0=$[E],$0=$[E-1]==="\\";if(!$0&&Z0==="[")c=!0;if(!$0&&Z0==="]")c=!1;if(Z0==="/"&&!c&&!$0){N0=!0;while(B0!==E&&/^[a-z]$/.test($[E+1])&&!H0())E++;break}}if(D=!1,B0!==E&&N0)K=$.slice(B0,E+1),S(k6);else K=b,S(),E=B0}else if(G(b,u)){S();let d=E,Y0=G(b,u);if(Y0){for(;E<$.length;E++)if(z($[E-1],$[E])==Y0)break}K=$.slice(d,E+1),S(My)}else if(b===" "||b===`
|
|
70
|
-
`)if(b===" "&&(uQ(K)||!K||M0)){if(K+=b,u==="<")S()}else S(),K=b,S();else if(L&&b==="}")S(),K=b,S(),L=!1;else if(M0&&!qV.has(b)||y()||(lK(b)===lK(K[K.length-1])||M())&&!_y.has(b))K+=b;else{if(w==="</")K=w;if(S(),w!=="</")K=b;if(s==="</"||s==="/>")K=s,S(),E++;else if(qV.has(b))S()}}return S(),U}function G40($,Z){let J=[],Q=Z&&typeof Z.lineClassName==="function"?Z.lineClassName:null,X=0,H=(K,W)=>{let B=Q?Q(W,X):"";return X++,{type:"element",tagName:"span",children:K,properties:{className:B?`sh__line ${B}`:"sh__line"}}};function G(K){let W=K.map(([,q])=>q).join(""),B=K.map(([q,U])=>{let F=dK[q];return{type:"element",tagName:"span",children:[{type:"text",value:U}],properties:{className:`sh__token--${F}`,style:{color:`var(--sh-${F})`}}}});J.push(H(B,W))}let z=[],Y=!1;for(let K=0;K<$.length;K++){let W=$[K],[B,q]=W,U=K===$.length-1;if(B!==UV){if(q.includes(`
|
|
71
|
-
`)){let F=q.split(`
|
|
72
|
-
`);for(let N=0;N<F.length;N++)if(z.push([B,F[N]]),N<F.length-1)G(z),z.length=0}else z.push(W);Y=!1}else{if(Y)G([]);else G(z),z.length=0;if(U)G([]);Y=!0}}if(z.length)G(z);return J}var z40=($)=>{let Z=`class="${$.className}"`;if($.style){let J=Object.entries($.style).map(([Q,X])=>`${Q}:${X}`).join(";");Z+=` style="${J}"`}return Z};function Y40($){return $.map((Z)=>{let{tagName:J}=Z,Q=Z.children.map((X)=>{let{tagName:H,children:G,properties:z}=X;return`<${H} ${z40(z)}>${Z40(G[0].value)}</${H}>`}).join("");return`<${J} class="${Z.properties.className}">${Q}</${J}>`}).join(`
|
|
73
|
-
`)}function Cy($,Z){let J=H40($,Z),Q=G40(J,Z);return Y40(Q)}var a15={TokenTypes:dK,TokenMap:new Map(dK.map(($,Z)=>[$,Z]))};var LV=P(l(),1),K40=e("[--sh-identifier:#1f2937]","[--sh-keyword:#cf222e]","[--sh-string:#16a34a]","[--sh-class:#2d6e7e]","[--sh-property:#0550ae]","[--sh-entity:#6f42c1]","[--sh-jsxliterals:#6f42c1]","[--sh-sign:#8b949e]","[--sh-comment:#9ca3af]");function Ey({code:$,className:Z}){let J=Ty.useMemo(()=>Cy($),[$]);return LV.jsx("pre",{className:e("overflow-auto font-mono text-xs leading-relaxed whitespace-pre",K40,Z),children:LV.jsx("code",{className:"font-mono",dangerouslySetInnerHTML:{__html:J}})})}var W40={ts:"ts",tsx:"tsx",js:"js",jsx:"jsx",mjs:"js",cjs:"js",json:"json",md:"md",mdx:"mdx",css:"css",scss:"scss",html:"html",py:"py",rb:"rb",go:"go",rs:"rs",java:"java",c:"c",h:"c",cpp:"cpp",sh:"sh",bash:"sh",yml:"yaml",yaml:"yaml",toml:"toml",sql:"sql",php:"php",swift:"swift",kt:"kt"};function B40($){let Z=$.split(/[\\/]/).pop()??"",J=Z.lastIndexOf("."),Q=J>0?Z.slice(J+1).toLowerCase():"";return W40[Q]??null}function q40($){let Z=$.trim();if(Z.length<2||!(Z.startsWith("{")||Z.startsWith("[")))return null;try{return JSON.stringify(JSON.parse(Z),null,2)}catch{return null}}function U40($){let Z=$.split(`
|
|
74
|
-
`);if(!Z.some((J)=>/^\s*\d+\t/.test(J)))return $;return Z.map((J)=>J.replace(/^\s*\d+\t/,"")).join(`
|
|
75
|
-
`)}function Iy($,Z){let J=$.input??{},Q=typeof J.file_path==="string"?J.file_path:typeof J.path==="string"?J.path:"",X=Q?B40(Q):null,H=$.name==="Read"||$.name==="read",G=$.name==="Write"||$.name==="write";if(X&&H&&Z)return{kind:"highlight",code:U40(Z),label:X};if(X&&G&&typeof J.content==="string"&&J.content)return{kind:"highlight",code:J.content,label:X};let z=q40(Z);if(z)return{kind:"highlight",code:z,label:"json"};return{kind:"plain"}}var l8=P(l(),1),MV="max-h-[280px] overflow-auto px-3 py-2.5 font-mono text-xs leading-relaxed";function ky({call:$,output:Z,isError:J}){let[Q,X]=X7.useState(!1),H=X7.useMemo(()=>J?{kind:"plain"}:Iy($,Z),[$,Z,J]);if(H.kind==="plain")return l8.jsx("div",{className:e("rounded-lg border",J?"border-destructive/30 bg-destructive/10":"border-border bg-muted"),children:l8.jsx("pre",{className:e(MV,"break-all whitespace-pre-wrap",J?"text-destructive":"text-muted-foreground"),children:Z||"(empty)"})});return l8.jsxs("div",{className:"overflow-hidden rounded-lg border border-border bg-muted",children:[l8.jsx(F40,{raw:Q,onRaw:X,label:H.label,copyText:Q?Z:H.code}),Q?l8.jsx("pre",{className:e(MV,"break-all whitespace-pre-wrap text-muted-foreground"),children:Z||"(empty)"}):l8.jsx(Ey,{code:H.code,className:e(MV,"text-muted-foreground")})]})}function F40({raw:$,onRaw:Z,label:J,copyText:Q}){return l8.jsxs("div",{className:"flex items-center gap-1 border-b border-border p-2",children:[[[!1,J],[!0,"raw"]].map(([H,G])=>l8.jsx(E0,{type:"button",variant:$===H?"outline":"ghost",size:"sm",onClick:()=>Z(H),className:"rounded-full text-xs uppercase",children:G},G)),l8.jsx("div",{className:"flex-1"}),l8.jsx(N40,{text:Q})]})}function N40({text:$}){let[Z,J]=X7.useState(!1);return X7.useEffect(()=>{if(!Z)return;let X=setTimeout(()=>J(!1),1500);return()=>clearTimeout(X)},[Z]),l8.jsx(E0,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>{navigator.clipboard?.writeText($).then(()=>J(!0)).catch(()=>{})},"aria-label":Z?"Copied":"Copy",children:Z?l8.jsx(LY,{stroke:1.75}):l8.jsx(Ry,{stroke:1.75})})}var A5=P(l(),1);function iK({parts:$,cwd:Z=null,processing:J=!1}){let Q=$.filter((X)=>X.type==="reasoning"||X.type==="tool-call");return A5.jsx("div",{className:"flex flex-col",children:Q.map((X,H)=>{let G=H===Q.length-1,z={isFirst:H===0,isLast:G};if(X.type==="reasoning")return A5.jsx(V40,{text:X.text,durationMs:X.durationMs,inProgress:J&&G,...z},H);return A5.jsx(L40,{call:X.call,cwd:Z,...z},X.call.toolCallId||H)})})}function AV({isFirst:$,isLast:Z,call:J,leading:Q,marker:X,name:H,brief:G,preview:z}){let[Y,K]=DV.useState(!1),W=J.state==="error",B=J.state==="running"||J.state==="pending",q=W?J.errorText??"":typeof J.output==="string"?J.output:"",U=!!(q||W||z),F=G?`${H}: ${G}`:H;return A5.jsx(t$,{isFirst:$,isLast:Z,marker:X,loading:B,isError:W,children:A5.jsxs("div",{className:"min-w-0 flex-1",children:[A5.jsxs("button",{type:"button",title:F,onClick:()=>U&&K((N)=>!N),className:e(cK,U?"cursor-pointer":"cursor-default"),children:[Q,A5.jsx("span",{className:"shrink-0 text-xs font-medium whitespace-nowrap",children:H}),G&&A5.jsx("span",{className:"min-w-0 self-baseline truncate text-[12px] text-muted-foreground",children:G}),B&&X&&A5.jsx(A1,{size:12,stroke:1.75,className:"shrink-0 animate-spin text-muted-foreground"}),U&&A5.jsx(fQ,{open:Y})]}),U&&A5.jsx(gQ,{open:Y,children:A5.jsxs("div",{className:"mt-1 mb-1 flex flex-col gap-1.5",children:[z,(q||W)&&A5.jsx(ky,{call:J,output:q,isError:W})]})})]})})}function V40({isFirst:$,isLast:Z,text:J,inProgress:Q=!1,durationMs:X}){let[H,G]=DV.useState(!1);if(!J){let K=X===void 0?"Thought":`Thought for ${e$(X)}`;return A5.jsx(t$,{isFirst:$,isLast:Z,loading:Q,children:A5.jsx("div",{className:e(cK,"min-w-0 flex-1 cursor-default"),children:A5.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:Q?"Thinking":K})})})}let z=Q?"Thinking":"Thought",Y=Q||H;return A5.jsx(t$,{isFirst:$,isLast:Z,loading:Q,children:A5.jsxs("div",{className:"min-w-0 flex-1",children:[A5.jsxs("button",{type:"button","aria-expanded":Y,onClick:()=>G((K)=>!K),className:e(cK,"cursor-pointer"),children:[A5.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:z}),A5.jsx(fQ,{open:Y})]}),A5.jsx(gQ,{open:Y,children:A5.jsx("div",{className:"mt-1 mb-1 pr-2 text-xs leading-relaxed whitespace-pre-wrap text-muted-foreground",children:A5.jsx(aS,{content:J})})})]})})}function L40({call:$,cwd:Z,isFirst:J,isLast:Q}){if($.caller==="subagent")return A5.jsx(Ly,{call:$,cwd:Z,isFirst:J,isLast:Q,renderNestedParts:(G,z)=>A5.jsx(iK,{parts:G,cwd:z})});if($.name==="Skill"&&$.skill){let G=$.state==="success";return A5.jsx(AV,{isFirst:J,isLast:Q,call:$,marker:G?A5.jsx(tb,{icon:Sy,size:16,stroke:1.75}):void 0,name:"Loading skill",brief:$.skill.skillName})}let X=Hy($)??Gy($)??zy($);if(X){let G=Yy(X.server,X.tool);return A5.jsx(AV,{isFirst:J,isLast:Q,call:$,marker:A5.jsx(eb,{src:mK(X.server)}),name:uK(X.server),brief:X.rest?`${G} ${X.rest}`:G})}let H=$.state==="error"?null:rb($,Z);return A5.jsx(AV,{isFirst:J,isLast:Q,call:$,leading:A5.jsx(M40,{call:$}),name:qy($),brief:Uy($,Z),preview:H?A5.jsx(ab,{relPath:H}):void 0})}function M40({call:$}){if($.caller!=="mcp"&&$.caller!=="server-tool")return null;let Z=$.caller==="mcp"?`mcp${$.mcpServer?`:${$.mcpServer.slice(0,8)}`:""}`:"server";return A5.jsx("span",{className:"shrink-0 rounded border border-border px-1 text-[9px] text-muted-foreground uppercase",children:Z})}var U5=P(l(),1);function xy(){return U5.jsx("div",{className:"flex items-center gap-1 px-1 py-3",children:[0,1,2].map(($)=>U5.jsx("span",{className:"block h-1 w-1 rounded-full bg-ring",style:{animation:"pulse-dot 1.4s ease-in-out infinite",animationDelay:`${$*0.2}s`}},$))})}function hy($){if($.type==="reasoning")return!0;if($.type==="tool-call")return!0;return!1}function A40($){let Z=[];for(let J of $)if(hy(J)){let Q=Z[Z.length-1];if(Q&&Q.kind==="run")Q.parts.push(J);else Z.push({kind:"run",parts:[J]})}else Z.push({kind:"single",part:J});return Z}function rK({parts:$,cwd:Z,processing:J=!1}){let Q=A40($);return U5.jsx("div",{className:"flex flex-col",children:Q.map((X,H)=>{let G=H===0?"":"mt-3",z=H===Q.length-1;return U5.jsx("div",{className:G,children:X.kind==="run"?U5.jsx(iK,{parts:X.parts,cwd:Z,processing:J&&z}):U5.jsx(w40,{part:X.part})},H)})})}function D40($){return $.some((Z)=>Z.type!=="text"||Z.text.trim().length>0)}function _40($){let Z=-1;for(let Q=$.length-1;Q>=0;Q--)if(hy($[Q])){Z=Q;break}if(Z<0)return null;let J=$.slice(Z+1);if(!D40(J))return null;return{work:$.slice(0,Z+1),response:J}}function O40({parts:$,cwd:Z,durationMs:J,defaultOpen:Q}){let X=J===void 0?"Worked":`Worked for ${e$(J)}`;return U5.jsxs(fG,{defaultOpen:Q,className:"group/collapsible",children:[U5.jsxs(mG,{className:"flex w-fit items-center gap-1 rounded-sm py-1 text-left text-sm text-muted-foreground transition-colors outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:[U5.jsx("span",{children:X}),U5.jsx(h3,{size:16,stroke:1.5,className:"shrink-0 transition-transform group-data-open/collapsible:rotate-90"})]}),U5.jsx(uG,{className:"overflow-hidden pt-2",children:U5.jsx(rK,{parts:$,cwd:Z})})]})}function P40({parts:$,cwd:Z,processing:J=!1,durationMs:Q}){let X=J?null:_40($);return U5.jsx("div",{className:"w-full min-w-0",children:J?U5.jsx(rK,{parts:$,cwd:Z,processing:!0}):X?U5.jsxs("div",{className:"flex flex-col gap-3",children:[U5.jsx(O40,{parts:X.work,cwd:Z,durationMs:Q}),U5.jsx(rK,{parts:X.response,cwd:Z})]}):U5.jsx(rK,{parts:$,cwd:Z})})}var gy=yy.memo(function({turn:Z,processing:J=!1}){let Q=d5().cwd;if(Z.role==="user"&&Z.origin.kind==="user-input"){let X=Z.parts.filter((G)=>G.type==="file"),H=Z.parts.filter((G)=>G.type==="text").map((G)=>G.type==="text"?G.text:"").join(`
|
|
76
|
-
`);if(!H&&X.length===0)return null;return U5.jsxs("div",{className:"flex w-full min-w-0 flex-col items-end gap-1.5 pl-8",children:[X.map((G,z)=>U5.jsx(vy,{mediaType:G.mediaType,url:G.url,filename:G.filename},z)),H&&U5.jsx("p",{className:e("max-w-full min-w-0 rounded-lg bg-primary px-3 py-2 text-sm leading-normal wrap-anywhere whitespace-pre-wrap text-primary-foreground","inset-shadow-[0_0_10px_color-mix(in_oklab,var(--color-white)_30%,transparent)]"),children:H})]})}return U5.jsx(P40,{parts:Z.parts,cwd:Q,processing:J,durationMs:Z.meta?.durationMs})});function w40({part:$}){switch($.type){case"text":return U5.jsx(rS,{content:$.text});case"tool-call":return U5.jsx(iK,{parts:[$],cwd:null});case"file":return U5.jsx(vy,{mediaType:$.mediaType,url:$.url,filename:$.filename});case"source-url":return U5.jsx(by,{url:$.url,title:$.title});case"source-document":return U5.jsx(by,{url:"#",title:$.title});case"data":return U5.jsx(j40,{name:$.name,data:$.data});case"reasoning":return null}}function vy({mediaType:$,url:Z,filename:J}){if($.startsWith("image/")&&Z)return U5.jsx("img",{src:Z,alt:J??"attachment",className:"max-h-64 max-w-full rounded-lg border border-border object-contain"});return U5.jsxs("div",{className:"flex items-center gap-1.5 rounded-lg border border-border bg-accent px-2.5 py-1.5 text-xs text-accent-foreground",children:[U5.jsx(S$,{size:16,stroke:1.75}),U5.jsx("span",{className:"truncate",children:J??$})]})}function by({url:$,title:Z}){return U5.jsx("a",{href:$,target:"_blank",rel:"noreferrer",className:"text-xs underline",children:Z??$})}function j40({name:$,data:Z}){return U5.jsxs("details",{children:[U5.jsxs("summary",{className:"cursor-pointer text-xs text-muted-foreground",children:["data:",$]}),U5.jsx("pre",{className:"mt-1 overflow-auto rounded bg-muted p-2 font-mono text-xs text-muted-foreground",children:JSON.stringify(Z,null,2)})]})}var t5=P(l(),1);function aK({active:$=!0,focusRequest:Z=0,docked:J=!1,chatLoaded:Q,view:X,previewTurn:H,sessionId:G,processing:z,composerBanner:Y,composerAvailability:K,send:W,stop:B,onSelectSession:q,onClose:U}){let F=o5(),N=P4.useRef(null),L=P4.useRef(null),V=X.turns,M=m1((E)=>E.hasSentMessageFromMoi),A=m1((E)=>(E.workspaceIdsPendingAnalysis??[]).includes(F)),O=V4((E)=>(E.attachments[S2(F,G??null)]??[]).some((b)=>b.status==="uploading")),_=!v3(!0,O,K),D=P4.useMemo(()=>WC(H?[...V,H]:V),[V,H]),T=P4.useMemo(()=>qC(D,X.notices),[D,X.notices]),k=D.length>0?D[D.length-1].id:null,x=Q&&T.length===0&&!z,I=VE({hasSentMessageFromMoi:M,isWorkspacePendingAnalysis:A}),{atBottom:y,scrollToBottom:C,scrollToTop:j}=KC(L,G);P4.useLayoutEffect(()=>{if(x&&I!=="empty")j()},[x,I,j]),P4.useEffect(()=>{if($)gU(N.current)},[$,Z]);let R=P4.useCallback((E,b)=>{W(E,b),C()},[W,C]),S=P4.useCallback((E)=>{if(_)return;R(E.prompt,{directives:E.context})},[R,_]);return t5.jsxs("div",{className:"flex min-h-0 flex-1 flex-col pt-2 pb-3",children:[t5.jsxs("header",{className:"mx-auto flex w-full max-w-[calc(var(--chat-max-container)+40px)] items-center justify-between pr-2 pb-2 pl-2",children:[t5.jsx(_E,{selectedSessionId:G??null,onSelectSession:q}),U&&J&&t5.jsxs(r1,{children:[t5.jsx(a1,{render:t5.jsx(E0,{variant:"ghost",size:"icon-sm",onClick:U,"aria-label":"Undock agent",children:t5.jsx(fy,{className:"size-5! text-muted-foreground",stroke:1.5})})}),t5.jsx(n1,{children:"Undock agent"})]}),U&&!J&&t5.jsx(E0,{variant:"ghost",size:"icon-sm",onClick:U,"aria-label":"Close chat",children:t5.jsx(Q8,{stroke:2})})]}),t5.jsxs("div",{className:"relative flex min-h-0 flex-1 flex-col",children:[t5.jsx("div",{ref:L,className:"flex scrollbar-thin flex-1 scroll-fade flex-col overflow-y-auto overscroll-contain px-5 pt-4 pb-12 [--scroll-fade-reveal:8px]",children:t5.jsxs("div",{className:"mx-auto flex w-full max-w-(--chat-max-container) flex-1 flex-col items-center gap-6",children:[x&&t5.jsx(LE,{kind:I,disabled:_,onSelectPrompt:S}),T.map((E)=>E.kind==="notice"?t5.jsx(C40,{notice:E.notice},`notice:${E.notice.id}`):t5.jsx(gy,{turn:E.turn,processing:z&&E.turn.id===k},E.turn.id)),z&&!H&&t5.jsx(xy,{})]})}),!y&&V.length>0&&t5.jsx(E0,{type:"button",variant:"outline",size:"icon",onClick:()=>C("smooth"),"aria-label":"Jump to latest",className:"absolute bottom-3 left-1/2 -translate-x-1/2 animate-in rounded-full fade-in slide-in-from-bottom-1",children:t5.jsx(dY,{stroke:1.5})})]}),t5.jsx("div",{className:"mx-auto flex w-full max-w-[calc(var(--chat-max-container)+24px)] flex-col px-3",children:t5.jsxs("div",{className:e("@container flex w-full flex-col transition-[padding]",Y&&"gap-2 rounded-t-xl rounded-b-2xl p-2",Y?.tone==="muted"&&"bg-muted",Y?.tone==="destructive"&&"bg-destructive/10"),children:[Y?.content,t5.jsx(qE,{composerRef:N,onSend:R,onStop:B,processing:z,sessionId:G??null,availability:K})]})})]})}function C40({notice:$}){let Z=vU($);if(!Z)return null;return t5.jsx("div",{className:"flex justify-center",children:t5.jsx("span",{className:"max-w-full truncate text-xs text-muted-foreground",children:Z})})}var D9=P(l(),1);function my({loading:$,open:Z,onOpenChange:J,onOpenChangeComplete:Q,children:X}){let H=()=>J(!1);return D9.jsxs(wY,{open:Z,onOpenChange:(z,Y)=>{if(!z&&Y.reason==="outside-press"){Y.cancel();return}J(z)},onOpenChangeComplete:Q,children:[D9.jsx(jY,{render:D9.jsx("div",{className:"fixed right-4 bottom-4 sm:right-6 sm:bottom-6",children:D9.jsx(h5.div,{variants:{from:{opacity:0,scale:0.8,filter:"blur(4px)"},to:{opacity:1,scale:1,filter:"blur(0px)"},invisible:{opacity:0,scale:1,filter:"blur(4px)"}},initial:"from",animate:Z?"invisible":"to",transition:{type:"spring",duration:0.3,delay:0.2,bounce:0},children:D9.jsx(E0,{variant:"outline",size:"icon-lg",className:"bg-card shadow-md hover:shadow-lg","aria-label":"Agent",children:D9.jsx(q9,{animated:$,stroke:1.75})})})})}),D9.jsx(CY,{side:"top",sideOffset:-48,align:"end",alignOffset:-8,className:"flex h-[calc(100vh-2rem)] w-[min(440px,calc(100vw-1rem))] flex-col gap-0 rounded-3xl p-0 sm:h-[calc(100vh-8rem)] sm:w-[min(440px,calc(100vw-2rem))] sm:p-1",keepMounted:!0,children:X(H)})]})}var S6=P(l(),1);function nK({className:$,title:Z,children:J,onClose:Q,ref:X}){return S6.jsxs(h5.div,{ref:X,className:e("absolute inset-x-4 bottom-4 no-scrollbar flex max-h-full flex-col gap-4 overflow-y-auto rounded-2xl bg-card text-card-foreground shadow-md","mx-auto max-w-[calc(var(--chat-max-container)+var(--page-pad)*2)] p-(--page-pad) pb-0",$),variants:{hidden:{opacity:0,y:40,filter:"blur(4px)"},visible:{opacity:1,y:0,filter:"blur(0px)"}},initial:"hidden",animate:"visible",exit:"hidden",transition:{type:"spring",duration:0.25,bounce:0},children:[S6.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-4",children:[S6.jsx("p",{className:"text-sm font-medium",children:Z}),S6.jsx(E0,{type:"button",variant:"ghost",size:"icon-sm",onClick:Q,"aria-label":"Close panel",children:S6.jsx(Q8,{stroke:1.75})})]}),S6.jsx("div",{className:"flex-1 pb-(--page-pad)",children:J})]})}var O1=P(l(),1),T40=Object.entries(F6),E40=Object.entries(oJ),I40=Object.entries(sJ);function _V({children:$,label:Z}){return O1.jsxs("div",{className:"flex flex-col gap-2",children:[O1.jsx("p",{className:"text-xs font-medium",children:Z}),O1.jsx("div",{role:"group","aria-label":Z,className:"grid grid-cols-4 gap-2",children:$})]})}function OV({active:$,children:Z,className:J,onSelect:Q,style:X}){return O1.jsxs("button",{type:"button","aria-pressed":$,onClick:Q,className:e("relative w-full rounded-lg bg-card text-left ring-1 ring-border transition-opacity outline-none focus-visible:ring-3 focus-visible:ring-ring/50","flex items-center gap-2 p-3",J,!$&&"cursor-pointer pr-9 opacity-70 hover:opacity-100"),style:X,children:[O1.jsx("div",{className:"flex flex-1 flex-col justify-center",children:Z}),$&&O1.jsx(MG,{size:20,stroke:1.5,"aria-hidden":"true"})]})}function uy({onClose:$,ref:Z}){wz();let{layout:J,setLayout:Q}=d5(),X=tJ(J.theme);function H(G){Q({theme:{...X,...G}})}return O1.jsx(nK,{ref:Z,title:"Customize",onClose:$,children:O1.jsxs("div",{className:"flex flex-col gap-4",children:[O1.jsx(_V,{label:"Font",children:T40.map(([G,z])=>O1.jsx(OV,{active:G===X.font,onSelect:()=>H({font:G}),style:{fontFamily:z.sans},children:O1.jsx("span",{className:"text-sm font-medium",children:z.label})},G))}),O1.jsx(_V,{label:"Colors",children:E40.map(([G,z])=>O1.jsx(OV,{active:G===X.color,className:z.primary&&"bg-background text-foreground",onSelect:()=>H({color:G}),style:f2({...X,color:G}),children:O1.jsxs("div",{className:"flex gap-2",children:[O1.jsx("span",{className:e("flex size-5 shrink-0 items-center justify-center rounded-sm text-[9px] leading-none font-bold",z.primary?"bg-primary text-primary-foreground":"bg-foreground text-background"),children:"Aa"}),O1.jsx("span",{className:"text-sm font-medium",children:z.label})]})},G))}),O1.jsx(_V,{label:"Radius",children:I40.map(([G,z])=>O1.jsx(OV,{active:G===X.radius,onSelect:()=>H({radius:G}),style:f2({...X,radius:G}),children:O1.jsxs("div",{className:"flex items-center gap-2",children:[O1.jsx("span",{className:"size-5 shrink-0 rounded-sm bg-card texture-checker-[10px] shadow-xs","aria-hidden":"true"}),O1.jsx("span",{className:"text-sm font-medium",children:z.label})]})},G))})]})})}var BZ=P(v(),1);function pQ($,Z,J,Q){let X=$.reduce((H,G)=>Math.max(H,G.y+G.h),0);for(let H=0;H<=X+J;H++)for(let G=0;G<=Q-Z;G++)if(!$.some((Y)=>!(G+Z<=Y.x||Y.x+Y.w<=G||H+J<=Y.y||Y.y+Y.h<=H)))return{x:G,y:H};return{x:0,y:X}}function cQ($,Z=[],J=4){let Q=[];for(let X of $){let{x:H,y:G}=X.x!==void 0&&X.y!==void 0?{x:X.x,y:X.y}:pQ([...Z,...Q],X.w,X.h,J);Q.push({i:X.id,x:H,y:G,w:X.w,h:X.h})}return Q}var PV=P(v(),1),sK=new Map;function R40($){let Z=window.__moiAppletCss?.get($)??"",J=sK.get($);if(!J){let H=document.createElement("style");H.dataset.appletStyle=$,document.head.appendChild(H),J={el:H,refs:0},sK.set($,J)}if(J.el.textContent!==Z)J.el.textContent=Z;J.refs++;let Q=J,X=!1;return()=>{if(X)return;if(X=!0,Q.refs--,Q.refs<=0)Q.el.remove(),sK.delete($)}}function k40($){let Z=sK.get($);if(!Z||Z.el===document.head.lastElementChild)return;document.head.appendChild(Z.el)}function oK($,Z,J=!1){PV.useInsertionEffect(()=>R40($),[$,Z]),PV.useInsertionEffect(()=>{if(J)k40($)},[$,J,Z])}var cy=P(l(),1);function py({segment:$,name:Z,version:J,children:Q}){let X=o5();return oK(Sz($,X,Z),J),cy.jsx("div",{"data-applet":bz($,Z),className:"size-full",children:Q})}var dy=P(v(),1);var JZ=P(l(),1);class dQ extends dy.Component{state={error:null};static getDerivedStateFromError($){return{error:$}}componentDidCatch($,Z){console.error(`[widget:${this.props.name}]`,$,Z.componentStack),Q2(this.props.workspaceId,{source:"render",kind:this.props.kind,name:this.props.name,message:$.message||String($),stack:[$.stack,Z.componentStack].filter(Boolean).join(`
|
|
77
|
-
`)})}componentDidUpdate($){if($.resetKey!==this.props.resetKey&&this.state.error)this.setState({error:null})}render(){if(this.state.error)return JZ.jsxs("div",{className:"flex h-full w-full flex-col items-start justify-start gap-1.5 p-4 text-xs",children:[JZ.jsxs("div",{className:"flex items-center gap-1.5 font-semibold text-destructive",children:[JZ.jsx(yH,{size:16,stroke:1.75}),"Widget crashed"]}),JZ.jsx("div",{className:"font-mono break-words text-muted-foreground",children:this.state.error.message})]});return this.props.children}}var b6=P(l(),1);function ly({name:$}){let Z=o5(),J=dj($);return b6.jsxs(O4,{mode:"wait",initial:!1,children:[J.status==="ready"&&b6.jsx(h5.div,{className:"absolute inset-0",initial:{opacity:0,filter:"blur(4px)"},animate:{opacity:1,filter:"blur(0px)"},exit:{opacity:0,filter:"blur(4px)"},transition:{duration:0.45,ease:"easeInOut"},children:b6.jsx(dQ,{name:$,kind:"widget",workspaceId:Z,resetKey:J.version,children:b6.jsx(py,{segment:"widgets",name:$,version:J.version,children:b6.jsx(J.Component,{})})})},J.version),J.status==="error"&&b6.jsx(h5.p,{className:"absolute inset-0 p-4 text-xs text-destructive",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:0.45,ease:"easeInOut"},children:J.error},`err-${J.version}`)]})}var iy=P(l(),1);function QZ({className:$,...Z}){return iy.jsx("div",{"data-slot":"skeleton",className:e("animate-pulse rounded-lg bg-muted",$),...Z})}var ay=P(v(),1);var y6=P(l(),1);function tK({editing:$,hidden:Z,onRemove:J,children:Q}){let X=ZC();return y6.jsxs(h5.div,{variants:{idle:{rotate:0},wiggle:{rotate:[0.5,-0.5],transition:{rotate:{repeat:1/0,repeatType:"reverse",duration:0.15,ease:"easeInOut"}}}},animate:$?"wiggle":"idle",transition:{type:"spring",duration:0.35,bounce:0},className:"group/widget relative size-full",children:[y6.jsx("div",{"data-widget-chrome":!0,style:f2(X,"widget"),className:e("absolute inset-0 overflow-hidden rounded-2xl text-foreground [corner-shape:superellipse(1.2)]","shadow-[0_1px_2px_-1px_rgba(0,0,0,0.08),0_2px_4px_0_rgba(0,0,0,0.03)]","after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit]","after:content-[''] after:[corner-shape:inherit]","after:shadow-[inset_0_0_0_1px_rgba(0,0,0,0.05)]",$&&"pointer-events-none"),children:Q}),$&&J&&y6.jsx("div",{className:"absolute -top-2 -right-2 opacity-0 transition-opacity group-hover/widget:opacity-100",children:y6.jsx(E0,{size:"icon-sm",variant:"outline",className:"rounded-full",onClick:J,children:Z?y6.jsx(e8,{stroke:1.75}):y6.jsx(ry,{stroke:1.75})})})]})}var XZ=P(l(),1),S40={0:"col-start-1",1:"col-start-2",2:"col-start-3",3:"col-start-4"},b40={0:"row-start-1",1:"row-start-2",2:"row-start-3",3:"row-start-4",4:"row-start-5",5:"row-start-6",6:"row-start-7",7:"row-start-8"},y40={1:"col-span-1",2:"col-span-2",3:"col-span-3",4:"col-span-4"},x40={1:"row-span-1",2:"row-span-2",3:"row-span-3",4:"row-span-4"};function ny({items:$,renderItem:Z,onClose:J,onRestore:Q,ref:X}){let H=ay.useMemo(()=>cQ($),[$]);return XZ.jsx(nK,{ref:X,title:"Hidden widgets",onClose:J,className:"max-h-[60vh]",children:XZ.jsx("div",{className:"grid auto-rows-[160px] grid-cols-4 gap-2",children:XZ.jsx(O4,{children:H.map((G)=>XZ.jsx(h5.div,{layoutId:G.i,className:e(S40[G.x],b40[G.y],y40[G.w],x40[G.h]),transition:{type:"spring",duration:0.35,bounce:0},children:XZ.jsx(tK,{editing:!0,onRemove:()=>Q(G.i),hidden:!0,children:Z(G.i)})},G.i))})})})}var XX=P(v(),1);function h6($){let{margin:Z,containerPadding:J,containerWidth:Q,cols:X}=$;return(Q-Z[0]*(X-1)-J[0]*2)/X}function U2($,Z,J){if(!Number.isFinite($))return $;return Math.round(Z*$+Math.max(0,$-1)*J)}function iQ($,Z,J,Q,X,H,G){let{margin:z,containerPadding:Y,rowHeight:K}=$,W=h6($),B,q,U,F;if(G)B=Math.round(G.width),q=Math.round(G.height);else B=U2(Q,W,z[0]),q=U2(X,K,z[1]);if(H)U=Math.round(H.top),F=Math.round(H.left);else if(G)U=Math.round(G.top),F=Math.round(G.left);else U=Math.round((K+z[1])*J+Y[1]),F=Math.round((W+z[0])*Z+Y[0]);if(!H&&!G){if(Number.isFinite(Q)){let L=Math.round((W+z[0])*(Z+Q)+Y[0])-F-B;if(L!==z[0])B+=L-z[0]}if(Number.isFinite(X)){let L=Math.round((K+z[1])*(J+X)+Y[1])-U-q;if(L!==z[1])q+=L-z[1]}}return{top:U,left:F,width:B,height:q}}function oy($,Z,J,Q,X){let{margin:H,containerPadding:G,cols:z,rowHeight:Y,maxRows:K}=$,W=h6($),B=Math.round((J-G[0])/(W+H[0])),q=Math.round((Z-G[1])/(Y+H[1]));return B=lQ(B,0,z-Q),q=lQ(q,0,K-X),{x:B,y:q}}function rQ($,Z,J){let{margin:Q,containerPadding:X,rowHeight:H}=$,G=h6($),z=Math.round((J-X[0])/(G+Q[0])),Y=Math.round((Z-X[1])/(H+Q[1]));return{x:z,y:Y}}function ty($,Z,J){let{margin:Q,rowHeight:X}=$,H=h6($),G=Math.max(1,Math.round((Z+Q[0])/(H+Q[0]))),z=Math.max(1,Math.round((J+Q[1])/(X+Q[1])));return{w:G,h:z}}function lQ($,Z,J){return Math.max(Math.min($,J),Z)}function $W($,Z){if($.i===Z.i)return!1;if($.x+$.w<=Z.x)return!1;if($.x>=Z.x+Z.w)return!1;if($.y+$.h<=Z.y)return!1;if($.y>=Z.y+Z.h)return!1;return!0}function g6($,Z){for(let J=0;J<$.length;J++){let Q=$[J];if(Q!==void 0&&$W(Q,Z))return Q}return}function wV($,Z){return $.filter((J)=>$W(J,Z))}function h40($,Z){if(Z==="horizontal")return jV($);if(Z==="vertical")return eK($);if(Z==="wrap")return eK($);return[...$]}function eK($){return[...$].sort((Z,J)=>{if(Z.y!==J.y)return Z.y-J.y;return Z.x-J.x})}function jV($){return[...$].sort((Z,J)=>{if(Z.x!==J.x)return Z.x-J.x;return Z.y-J.y})}function aQ($){let Z=0;for(let J=0;J<$.length;J++){let Q=$[J];if(Q!==void 0){let X=Q.y+Q.h;if(X>Z)Z=X}}return Z}function v6($,Z){for(let J=0;J<$.length;J++){let Q=$[J];if(Q!==void 0&&Q.i===Z)return Q}return}function nQ($){return $.filter((Z)=>Z.static===!0)}function _9($){return{i:$.i,x:$.x,y:$.y,w:$.w,h:$.h,minW:$.minW,maxW:$.maxW,minH:$.minH,maxH:$.maxH,moved:Boolean($.moved),static:Boolean($.static),isDraggable:$.isDraggable,isResizable:$.isResizable,resizeHandles:$.resizeHandles,constraints:$.constraints,isBounded:$.isBounded}}function HZ($){let Z=Array($.length);for(let J=0;J<$.length;J++){let Q=$[J];if(Q!==void 0)Z[J]=_9(Q)}return Z}function g40($,Z){let J=Array($.length);for(let Q=0;Q<$.length;Q++){let X=$[Q];if(X!==void 0)if(Z.i===X.i)J[Q]=Z;else J[Q]=X}return J}function ey($,Z,J){let Q=v6($,Z);if(!Q)return[[...$],null];return Q=J(_9(Q)),[g40($,Q),Q]}function CV($,Z){let J=nQ($);for(let Q=0;Q<$.length;Q++){let X=$[Q];if(X===void 0)continue;if(X.x+X.w>Z.cols)X.x=Z.cols-X.w;if(X.x<0)X.x=0,X.w=Z.cols;if(!X.static)J.push(X);else while(g6(J,X))X.y++}return $}function x6($,Z,J,Q,X,H,G,z,Y){if(Z.static&&Z.isDraggable!==!0)return[...$];if(Z.y===Q&&Z.x===J)return[...$];let{x:K,y:W}=Z;if(typeof J==="number")Z.x=J;if(typeof Q==="number")Z.y=Q;Z.moved=!0;let B=h40($,G);if(G==="vertical"&&typeof Q==="number"?W>=Q:G==="horizontal"&&typeof J==="number"?K>=J:!1)B=B.reverse();let U=wV(B,Z),F=U.length>0;if(F&&Y)return HZ($);if(F&&H)return Z.x=K,Z.y=W,Z.moved=!1,$;let N=[...$];for(let L=0;L<U.length;L++){let V=U[L];if(V===void 0)continue;if(V.moved)continue;if(V.static)N=sy(N,V,Z,X,G);else N=sy(N,Z,V,X,G)}return N}function sy($,Z,J,Q,X,H){let G=X==="horizontal",z=X==="vertical",Y=Z.static;if(Q){Q=!1;let B={x:G?Math.max(Z.x-J.w,0):J.x,y:z?Math.max(Z.y-J.h,0):J.y,w:J.w,h:J.h,i:"-1"},q=g6($,B),U=q!==void 0&&q.y+q.h>Z.y,F=q!==void 0&&Z.x+Z.w>q.x;if(!q)return x6($,J,G?B.x:void 0,z?B.y:void 0,Q,Y,X);if(U&&z)return x6($,J,void 0,J.y+1,Q,Y,X);if(U&&X===null)return Z.y=J.y,J.y=J.y+J.h,[...$];if(F&&G)return x6($,Z,J.x,void 0,Q,Y,X)}let K=G?J.x+1:void 0,W=z?J.y+1:void 0;if(K===void 0&&W===void 0)return[...$];return x6($,J,K,W,Q,Y,X)}function GZ($,Z,J){return Math.max(Z,Math.min(J,$))}var v40={name:"gridBounds",constrainPosition($,Z,J,{cols:Q,maxRows:X}){return{x:GZ(Z,0,Math.max(0,Q-$.w)),y:GZ(J,0,Math.max(0,X-$.h))}},constrainSize($,Z,J,Q,{cols:X,maxRows:H}){let G=Q==="w"||Q==="nw"||Q==="sw"?$.x+$.w:X-$.x,z=Q==="n"||Q==="nw"||Q==="ne"?$.y+$.h:H-$.y;return{w:GZ(Z,1,Math.max(1,G)),h:GZ(J,1,Math.max(1,z))}}},f40={name:"minMaxSize",constrainSize($,Z,J){return{w:GZ(Z,$.minW??1,$.maxW??1/0),h:GZ(J,$.minH??1,$.maxH??1/0)}}};var TV=[v40,f40];function sQ($,Z,J,Q,X){let H={x:J,y:Q};for(let G of $)if(G.constrainPosition)H=G.constrainPosition(Z,H.x,H.y,X);if(Z.constraints){for(let G of Z.constraints)if(G.constrainPosition)H=G.constrainPosition(Z,H.x,H.y,X)}return H}function $x($,Z,J,Q,X,H){let G={w:J,h:Q};for(let z of $)if(z.constrainSize)G=z.constrainSize(Z,G.w,G.h,X,H);if(Z.constraints){for(let z of Z.constraints)if(z.constrainSize)G=z.constrainSize(Z,G.w,G.h,X,H)}return G}function JW({top:$,left:Z,width:J,height:Q}){let X=`translate(${Z}px,${$}px)`;return{transform:X,WebkitTransform:X,MozTransform:X,msTransform:X,OTransform:X,width:`${J}px`,height:`${Q}px`,position:"absolute"}}function EV({top:$,left:Z,width:J,height:Q}){return{top:`${$}px`,left:`${Z}px`,width:`${J}px`,height:`${Q}px`,position:"absolute"}}function IV($){return $*100+"%"}function m40($,Z,J,Q){return $+J>Q?Z:J}function Zx($,Z,J){return $<0?Z:J}function u40($){return Math.max(0,$)}function ZW($){return Math.max(0,$)}var RV=($,Z,J)=>{let{left:Q,height:X,width:H}=Z,G=$.top-(X-$.height);return{left:Q,width:H,height:Zx(G,$.height,X),top:ZW(G)}},kV=($,Z,J)=>{let{top:Q,left:X,height:H,width:G}=Z;return{top:Q,height:H,width:m40($.left,$.width,G,J),left:u40(X)}},SV=($,Z,J)=>{let{top:Q,height:X,width:H}=Z,G=$.left+$.width-H;if(G<0)return{height:X,width:$.left+$.width,top:ZW(Q),left:0};return{height:X,width:H,top:ZW(Q),left:G}},bV=($,Z,J)=>{let{top:Q,left:X,height:H,width:G}=Z;return{width:G,left:X,height:Zx(Q,$.height,H),top:ZW(Q)}},p40=($,Z,J)=>RV($,kV($,Z,J)),c40=($,Z,J)=>RV($,SV($,Z)),d40=($,Z,J)=>bV($,kV($,Z,J)),l40=($,Z,J)=>bV($,SV($,Z)),i40={n:RV,ne:p40,e:kV,se:d40,s:bV,sw:l40,w:SV,nw:c40};function Jx($,Z,J,Q){let X=i40[$];if(!X)return J;return X(Z,{...Z,...J},Q)}var r40={type:"transform",scale:1,calcStyle($){return JW($)}};var Qx=r40,Xx={cols:12,rowHeight:150,margin:[10,10],containerPadding:null,maxRows:1/0},Hx={enabled:!0,bounded:!1,threshold:3},Gx={enabled:!0,handles:["se"]},zx={enabled:!1,defaultItem:{w:1,h:1}};function yV($,Z,J,Q,X){let H=Q==="x"?"w":"h";Z[Q]+=1;let G=$.findIndex((Y)=>Y.i===Z.i),z=X??nQ($).length>0;for(let Y=G+1;Y<$.length;Y++){let K=$[Y];if(K===void 0)continue;if(K.static)continue;if(!z&&K.y>Z.y+Z.h)break;if($W(Z,K))yV($,K,J+Z[H],Q,z)}Z[Q]=J}function a40($,Z,J,Q){Z.x=Math.max(Z.x,0),Z.y=Math.max(Z.y,0),Z.y=Math.min(Q,Z.y);while(Z.y>0&&!g6($,Z))Z.y--;let X;while((X=g6($,Z))!==void 0)yV(J,Z,X.y+X.h,"y");return Z.y=Math.max(Z.y,0),Z}function n40($,Z,J,Q){Z.x=Math.max(Z.x,0),Z.y=Math.max(Z.y,0);while(Z.x>0&&!g6($,Z))Z.x--;let X;while((X=g6($,Z))!==void 0)if(yV(Q,Z,X.x+X.w,"x"),Z.x+Z.w>J){Z.x=J-Z.w,Z.y++;while(Z.x>0&&!g6($,Z))Z.x--}return Z.x=Math.max(Z.x,0),Z}var oQ={type:"vertical",allowOverlap:!1,compact($,Z){let J=nQ($),Q=aQ(J),X=eK($),H=Array($.length);for(let G=0;G<X.length;G++){let z=X[G];if(z===void 0)continue;let Y=_9(z);if(!Y.static)Y=a40(J,Y,X,Q),Q=Math.max(Q,Y.y+Y.h),J.push(Y);let K=$.indexOf(z);H[K]=Y,Y.moved=!1}return H}},xV={type:"horizontal",allowOverlap:!1,compact($,Z){let J=nQ($),Q=jV($),X=Array($.length);for(let H=0;H<Q.length;H++){let G=Q[H];if(G===void 0)continue;let z=_9(G);if(!z.static)z=n40(J,z,Z,Q),J.push(z);let Y=$.indexOf(G);X[Y]=z,z.moved=!1}return X}},hV={type:null,allowOverlap:!1,compact($,Z){return HZ($)}},s40={...oQ,allowOverlap:!0,compact($,Z){return HZ($)}},o40={...xV,allowOverlap:!0,compact($,Z){return HZ($)}},t40={...hV,allowOverlap:!0};function gV($,Z=!1,J=!1){let Q;if(Z)if($==="vertical")Q=s40;else if($==="horizontal")Q=o40;else Q=t40;else if($==="vertical")Q=oQ;else if($==="horizontal")Q=xV;else Q=hV;if(J)return{...Q,preventCollision:J};return Q}var F2=P(v(),1);function vV($={}){let{measureBeforeMount:Z=!1,initialWidth:J=1280}=$,[Q,X]=F2.useState(J),[H,G]=F2.useState(!Z),z=F2.useRef(null),Y=F2.useRef(null),K=F2.useCallback(()=>{let W=z.current;if(W){let B=W.offsetWidth;if(X(B),!H)G(!0)}},[H]);return F2.useEffect(()=>{let W=z.current;if(!W)return;if(K(),typeof ResizeObserver<"u"){let B=null;return Y.current=new ResizeObserver((q)=>{let U=q[0];if(U){let F=U.contentRect.width;if(B!==null)cancelAnimationFrame(B);B=requestAnimationFrame(()=>{X(F),B=null})}}),Y.current.observe(W),()=>{if(B!==null)cancelAnimationFrame(B);if(Y.current)Y.current.disconnect(),Y.current=null}}return()=>{if(Y.current)Y.current.disconnect(),Y.current=null}},[K]),{width:Q,mounted:H,containerRef:z,measureWidth:K}}var R0=P(v(),1),Hh=P(BW(),1),Gh=P(Jh(),1);var P9=P(l(),1),H7=P(Kx(),1);function XL($){let{children:Z,cols:J,containerWidth:Q,margin:X,containerPadding:H,rowHeight:G,maxRows:z,isDraggable:Y,isResizable:K,isBounded:W,static:B,useCSSTransforms:q=!0,usePercentages:U=!1,transformScale:F=1,positionStrategy:N,dragThreshold:L=0,droppingPosition:V,className:M="",style:A,handle:O="",cancel:_="",x:D,y:T,w:k,h:x,minW:I=1,maxW:y=1/0,minH:C=1,maxH:j=1/0,i:R,resizeHandles:S,resizeHandle:E,constraints:b=TV,layoutItem:g,layout:u=[],onDragStart:w,onDrag:s,onDragStop:z0,onResizeStart:h,onResize:t,onResizeStop:M0}=$,[d,Y0]=R0.useState(!1),[B0,J0]=R0.useState(!1),H0=R0.useRef(null),N0=R0.useRef({left:0,top:0}),c=R0.useRef({top:0,left:0,width:0,height:0}),Z0=R0.useRef(void 0),$0=R0.useRef(u);$0.current=u;let G0=R0.useRef(null),r=R0.useRef(null),Q0=R0.useRef(!1),a=R0.useRef({x:0,y:0}),p=R0.useRef(!1),o=R0.useMemo(()=>({cols:J,containerPadding:H,containerWidth:Q,margin:X,maxRows:z,rowHeight:G}),[J,H,Q,X,z,G]),n=R0.useMemo(()=>({cols:J,maxRows:z,containerWidth:Q,containerHeight:0,rowHeight:G,margin:X,layout:[]}),[J,z,Q,G,X]),V0=R0.useCallback(()=>({...n,layout:$0.current}),[n]),w0=R0.useMemo(()=>g??{i:R,x:D,y:T,w:k,h:x,minW:I,maxW:y,minH:C,maxH:j},[g,R,D,T,k,x,I,y,C,j]),v0=R0.useCallback((T0)=>{if(N?.calcStyle)return N.calcStyle(T0);if(q)return JW(T0);let b0=EV(T0);if(U)return{...b0,left:IV(T0.left/Q),width:IV(T0.width/Q)};return b0},[N,q,U,Q]),c0=R0.useCallback((T0,{node:b0})=>{if(!w)return;let{offsetParent:p0}=b0;if(!p0)return;let $5=p0.getBoundingClientRect(),K5=b0.getBoundingClientRect(),O5=K5.left/F,m5=$5.left/F,u5=K5.top/F,W5=$5.top/F,K1;if(N?.calcDragPosition){let t0=T0;K1=N.calcDragPosition(t0.clientX,t0.clientY,t0.clientX-K5.left,t0.clientY-K5.top)}else K1={left:O5-m5+p0.scrollLeft,top:u5-W5+p0.scrollTop};if(N0.current=K1,L>0){let t0=T0;a.current={x:t0.clientX,y:t0.clientY},Q0.current=!0,p.current=!1,Y0(!0);return}Y0(!0);let k1=rQ(o,K1.top,K1.left),{x:x1,y:y0}=sQ(b,w0,k1.x,k1.y,V0());w(R,x1,y0,{e:T0,node:b0,newPosition:K1})},[w,F,o,N,L,b,w0,V0,R]),m=R0.useCallback((T0,{node:b0,deltaX:p0,deltaY:$5})=>{if(!s||!d)return;let K5=T0;if(Q0.current&&!p.current){let x1=K5.clientX-a.current.x,y0=K5.clientY-a.current.y;if(Math.hypot(x1,y0)<L)return;if(p.current=!0,Q0.current=!1,w){let u0=rQ(o,N0.current.top,N0.current.left),{x:G5,y:C5}=sQ(b,w0,u0.x,u0.y,V0());w(R,G5,C5,{e:T0,node:b0,newPosition:N0.current})}}let O5=N0.current.top+$5,m5=N0.current.left+p0;if(W){let{offsetParent:x1}=b0;if(x1){let y0=x1.clientHeight-U2(x,G,X[1]);O5=lQ(O5,0,y0);let t0=h6(o),u0=Q-U2(k,t0,X[0]);m5=lQ(m5,0,u0)}}let u5={top:O5,left:m5};N0.current=u5;let W5=rQ(o,O5,m5),{x:K1,y:k1}=sQ(b,w0,W5.x,W5.y,V0());s(R,K1,k1,{e:T0,node:b0,newPosition:u5})},[s,w,d,L,W,x,G,X,o,Q,k,R,b,w0,V0]),i=R0.useCallback((T0,{node:b0})=>{if(!z0||!d)return;let p0=Q0.current;if(Q0.current=!1,p.current=!1,a.current={x:0,y:0},p0){Y0(!1),N0.current={left:0,top:0};return}let{left:$5,top:K5}=N0.current,O5={top:K5,left:$5};Y0(!1),N0.current={left:0,top:0};let m5=rQ(o,K5,$5),{x:u5,y:W5}=sQ(b,w0,m5.x,m5.y,V0());z0(R,u5,W5,{e:T0,node:b0,newPosition:O5})},[z0,d,o,b,w0,V0,R]);G0.current=c0,r.current=m;let f=R0.useCallback((T0,{node:b0,size:p0,handle:$5},K5,O5)=>{let m5=O5==="onResizeStart"?h:O5==="onResize"?t:M0;if(!m5)return;let u5;if(b0)u5=Jx($5,K5,p0,Q);else u5={...p0,top:K5.top,left:K5.left};c.current=u5;let W5=ty(o,u5.width,u5.height),{w:K1,h:k1}=$x(b,w0,W5.w,W5.h,$5,V0());m5(R,K1,k1,{e:T0.nativeEvent,node:b0,size:u5,handle:$5})},[h,t,M0,Q,o,R,b,w0,V0]),X0=R0.useCallback((T0,b0)=>{J0(!0);let p0=iQ(o,D,T,k,x),$5={...b0,handle:b0.handle};f(T0,$5,p0,"onResizeStart")},[f,o,D,T,k,x]),L0=R0.useCallback((T0,b0)=>{let p0=iQ(o,D,T,k,x),$5={...b0,handle:b0.handle};f(T0,$5,p0,"onResize")},[f,o,D,T,k,x]),k0=R0.useCallback((T0,b0)=>{J0(!1),c.current={top:0,left:0,width:0,height:0};let p0=iQ(o,D,T,k,x),$5={...b0,handle:b0.handle};f(T0,$5,p0,"onResizeStop")},[f,o,D,T,k,x]);R0.useEffect(()=>{if(!V)return;let T0=H0.current;if(!T0)return;let b0=Z0.current||{left:0,top:0},p0=d&&(V.left!==b0.left||V.top!==b0.top);if(!d){let $5={node:T0,deltaX:V.left,deltaY:V.top,lastX:0,lastY:0,x:V.left,y:V.top};G0.current?.(V.e,$5)}else if(p0){let $5=V.left-N0.current.left,K5=V.top-N0.current.top,O5={node:T0,deltaX:$5,deltaY:K5,lastX:N0.current.left,lastY:N0.current.top,x:V.left,y:V.top};r.current?.(V.e,O5)}Z0.current=V},[V,d,R]);let r0=iQ(o,D,T,k,x,d?N0.current:null,B0?c.current:null),J5=R0.default.Children.only(Z),m0=h6(o),P0=[U2(I,m0,X[0]),U2(C,G,X[1])],f0=[U2(y,m0,X[0]),U2(j,G,X[1])],h0=J5.props,a0=h0.className,n5=h0.style,j5=R0.default.cloneElement(J5,{ref:H0,className:HL("react-grid-item",a0,M,{static:B,resizing:B0,"react-draggable":Y,"react-draggable-dragging":d,dropping:Boolean(V),cssTransforms:q}),style:{...A,...n5,...v0(r0)}}),R1=E;return j5=P9.jsx(Gh.Resizable,{draggableOpts:{disabled:!K},className:K?void 0:"react-resizable-hide",width:r0.width,height:r0.height,minConstraints:P0,maxConstraints:f0,onResizeStart:X0,onResize:L0,onResizeStop:k0,transformScale:F,resizeHandles:S,handle:R1,children:j5}),j5=P9.jsx(Hh.DraggableCore,{disabled:!Y,onStart:c0,onDrag:m,onStop:i,handle:O,cancel:".react-resizable-handle"+(_?","+_:""),scale:F,nodeRef:H0,children:j5}),j5}var O9=()=>{},Qh="react-grid-layout",zh=!1;try{zh=/firefox/i.test(navigator.userAgent)}catch{}function B60($,Z){let J=R0.default.Children.toArray($),Q=R0.default.Children.toArray(Z);if(J.length!==Q.length)return!1;for(let X=0;X<J.length;X++){let H=J[X],G=Q[X];if(H?.key!==G?.key)return!1}return!0}function Xh($,Z,J,Q){let X=[],H=new Set;R0.default.Children.forEach(Z,(z)=>{if(!R0.default.isValidElement(z)||z.key===null)return;let Y=String(z.key);H.add(Y);let K=$.find((W)=>W.i===Y);if(K)X.push(_9(K));else{let B=z.props["data-grid"];if(B)X.push({i:Y,x:B.x??0,y:B.y??0,w:B.w??1,h:B.h??1,minW:B.minW,maxW:B.maxW,minH:B.minH,maxH:B.maxH,static:B.static,isDraggable:B.isDraggable,isResizable:B.isResizable,resizeHandles:B.resizeHandles,isBounded:B.isBounded});else X.push({i:Y,x:0,y:aQ(X),w:1,h:1})}});let G=CV(X,{cols:J});return Q.compact(G,J)}function QX($){let{children:Z,width:J,gridConfig:Q,dragConfig:X,resizeConfig:H,dropConfig:G,positionStrategy:z=Qx,compactor:Y,constraints:K=TV,layout:W=[],droppingItem:B,autoSize:q=!0,className:U="",style:F={},innerRef:N,onLayoutChange:L=O9,onDragStart:V=O9,onDrag:M=O9,onDragStop:A=O9,onResizeStart:O=O9,onResize:_=O9,onResizeStop:D=O9,onDrop:T=O9,onDropDragOver:k=O9}=$,x=R0.useMemo(()=>({...Xx,...Q}),[Q]),I=R0.useMemo(()=>({...Hx,...X}),[X]),y=R0.useMemo(()=>({...Gx,...H}),[H]),C=R0.useMemo(()=>({...zx,...G}),[G]),{cols:j,rowHeight:R,maxRows:S,margin:E,containerPadding:b}=x,{enabled:g,bounded:u,handle:w,cancel:s,threshold:z0}=I,{enabled:h,handles:t,handleComponent:M0}=y,{enabled:d,defaultItem:Y0,onDragOver:B0}=C,J0=Y??gV("vertical"),H0=J0.type,N0=J0.allowOverlap,c=J0.preventCollision??!1,Z0=R0.useMemo(()=>B??{i:"__dropping-elem__",...Y0},[B,Y0]),$0=z.type==="transform",G0=z.scale,r=b??E,[Q0,a]=R0.useState(!1),[p,o]=R0.useState(()=>Xh(W,Z,j,J0)),[n,V0]=R0.useState(null),[w0,v0]=R0.useState(!1),[c0,m]=R0.useState(null),[i,f]=R0.useState(),X0=R0.useRef(null),L0=R0.useRef(null),k0=R0.useRef(null),r0=R0.useRef(0),J5=R0.useRef(p),m0=R0.useRef(W),P0=R0.useRef(Z),f0=R0.useRef(H0),h0=R0.useRef(p);h0.current=p,R0.useEffect(()=>{if(a(!0),!H7.deepEqual(p,W))L(p)},[]),R0.useEffect(()=>{if(n)return;if(c0)return;let y0=!H7.deepEqual(W,m0.current),t0=!B60(Z,P0.current),u0=H0!==f0.current;if(y0||t0||u0){let C5=Xh(y0?W:p,Z,j,J0);if(!H7.deepEqual(C5,p))o(C5)}m0.current=W,P0.current=Z,f0.current=H0},[W,Z,j,H0,J0,n,c0,p]),R0.useEffect(()=>{if(!n&&!H7.deepEqual(p,J5.current)){J5.current=p;let y0=p.filter((t0)=>t0.i!==Z0.i);L(y0)}},[p,n,L,Z0.i]);let a0=R0.useMemo(()=>{if(!q)return;let y0=aQ(p),t0=r[1];return y0*R+(y0-1)*E[1]+t0*2+"px"},[q,p,R,E,r]),n5=R0.useCallback((y0,t0,u0,G5)=>{let C5=h0.current,k5=v6(C5,y0);if(!k5)return;let W1={w:k5.w,h:k5.h,x:k5.x,y:k5.y,i:y0};X0.current=_9(k5),k0.current=C5,V0(W1),V(C5,k5,k5,null,G5.e,G5.node)},[V]),j5=R0.useCallback((y0,t0,u0,G5)=>{let C5=h0.current,k5=X0.current,W1=v6(C5,y0);if(!W1)return;let Z8={w:W1.w,h:W1.h,x:W1.x,y:W1.y,i:y0},B1=x6(C5,W1,t0,u0,!0,c,H0,j,N0);M(B1,k5,W1,Z8,G5.e,G5.node),o(J0.compact(B1,j)),V0(Z8)},[c,H0,j,N0,J0,M]),R1=R0.useCallback((y0,t0,u0,G5)=>{if(!n)return;let C5=h0.current,k5=X0.current,W1=v6(C5,y0);if(!W1)return;let Z8=x6(C5,W1,t0,u0,!0,c,H0,j,N0),B1=J0.compact(Z8,j);A(B1,k5,W1,null,G5.e,G5.node);let D8=k0.current;if(X0.current=null,k0.current=null,V0(null),o(B1),D8&&!H7.deepEqual(D8,B1))L(B1)},[n,c,H0,j,N0,J0,A,L]),T0=R0.useCallback((y0,t0,u0,G5)=>{let C5=h0.current,k5=v6(C5,y0);if(!k5)return;L0.current=_9(k5),k0.current=C5,v0(!0),O(C5,k5,k5,null,G5.e,G5.node)},[O]),b0=R0.useCallback((y0,t0,u0,G5)=>{let C5=h0.current,k5=L0.current,{handle:W1}=G5,Z8=!1,B1,D8,[VX,Z9]=ey(C5,y0,(N1)=>{if(B1=N1.x,D8=N1.y,["sw","w","nw","n","ne"].includes(W1)){if(["sw","nw","w"].includes(W1))B1=N1.x+(N1.w-t0),t0=N1.x!==B1&&B1<0?N1.w:t0,B1=B1<0?0:B1;if(["ne","n","nw"].includes(W1))D8=N1.y+(N1.h-u0),u0=N1.y!==D8&&D8<0?N1.h:u0,D8=D8<0?0:D8;Z8=!0}if(c&&!N0){if(wV(C5,{...N1,w:t0,h:u0,x:B1??N1.x,y:D8??N1.y}).filter((MX)=>MX.i!==N1.i).length>0)D8=N1.y,u0=N1.h,B1=N1.x,t0=N1.w,Z8=!1}return N1.w=t0,N1.h=u0,N1});if(!Z9)return;let jZ=VX;if(Z8&&B1!==void 0&&D8!==void 0)jZ=x6(VX,Z9,B1,D8,!0,c,H0,j,N0);let LX={w:Z9.w,h:Z9.h,x:Z9.x,y:Z9.y,i:y0,static:!0};_(jZ,k5,Z9,LX,G5.e,G5.node),o(J0.compact(jZ,j)),V0(LX)},[c,H0,j,N0,J0,_]),p0=R0.useCallback((y0,t0,u0,G5)=>{let C5=h0.current,k5=L0.current,W1=v6(C5,y0),Z8=J0.compact(C5,j);D(Z8,k5,W1??null,null,G5.e,G5.node);let B1=k0.current;if(L0.current=null,k0.current=null,V0(null),v0(!1),o(Z8),B1&&!H7.deepEqual(B1,Z8))L(Z8)},[j,J0,D,L]),$5=R0.useCallback(()=>{let y0=h0.current;if(!y0.some((G5)=>G5.i===Z0.i)){m(null),V0(null),f(void 0);return}let u0=J0.compact(y0.filter((G5)=>G5.i!==Z0.i),j);o(u0),m(null),V0(null),f(void 0)},[Z0.i,j,J0]),K5=R0.useCallback((y0)=>{if(y0.preventDefault(),y0.stopPropagation(),zh&&!y0.nativeEvent.target?.classList.contains(Qh))return!1;let t0=B0?B0(y0.nativeEvent):k(y0);if(t0===!1){if(c0)$5();return!1}let{dragOffsetX:u0=0,dragOffsetY:G5=0,...C5}=t0??{},k5={...Z0,...C5},W1=y0.currentTarget.getBoundingClientRect(),Z8={cols:j,margin:E,maxRows:S,rowHeight:R,containerWidth:J,containerPadding:r},B1=h6(Z8),D8=U2(k5.w,B1,E[0]),VX=U2(k5.h,R,E[1]),Z9=D8/2,jZ=VX/2,LX=y0.clientX-W1.left+u0-Z9,N1=y0.clientY-W1.top+G5-jZ,gW=Math.max(0,LX),MX=Math.max(0,N1),AX={left:gW/G0,top:MX/G0,e:y0.nativeEvent};if(!c0){let vW=oy(Z8,MX,gW,k5.w,k5.h);m(P9.jsx("div",{},k5.i)),f(AX);let Pm=h0.current.filter((wm)=>wm.i!==k5.i);o([...Pm,{...k5,x:vW.x,y:vW.y,static:!1,isDraggable:!0}])}else if(i){if(i.left!==AX.left||i.top!==AX.top)f(AX)}},[c0,i,Z0,B0,k,$5,G0,j,E,S,R,J,r]),O5=R0.useCallback((y0)=>{if(y0.preventDefault(),y0.stopPropagation(),r0.current--,r0.current<0)r0.current=0;if(r0.current===0)$5()},[$5]),m5=R0.useCallback((y0)=>{y0.preventDefault(),y0.stopPropagation(),r0.current++},[]),u5=R0.useCallback((y0)=>{y0.preventDefault(),y0.stopPropagation();let t0=h0.current,u0=t0.find((G5)=>G5.i===Z0.i);r0.current=0,$5(),T(t0,u0,y0.nativeEvent)},[Z0.i,$5,T]),W5=R0.useCallback((y0,t0)=>{if(!y0||!y0.key)return null;let u0=v6(p,String(y0.key));if(!u0)return null;let G5=typeof u0.isDraggable==="boolean"?u0.isDraggable:!u0.static&&g,C5=typeof u0.isResizable==="boolean"?u0.isResizable:!u0.static&&h,k5=u0.resizeHandles||[...t],W1=G5&&u&&u0.isBounded!==!1,Z8=M0;return P9.jsx(XL,{containerWidth:J,cols:j,margin:E,containerPadding:r,maxRows:S,rowHeight:R,cancel:s,handle:w,onDragStart:n5,onDrag:j5,onDragStop:R1,onResizeStart:T0,onResize:b0,onResizeStop:p0,isDraggable:G5,isResizable:C5,isBounded:W1,useCSSTransforms:$0&&Q0,usePercentages:!Q0,transformScale:G0,positionStrategy:z,dragThreshold:z0,w:u0.w,h:u0.h,x:u0.x,y:u0.y,i:u0.i,minH:u0.minH,minW:u0.minW,maxH:u0.maxH,maxW:u0.maxW,static:u0.static,droppingPosition:t0?i:void 0,resizeHandles:k5,resizeHandle:Z8,constraints:K,layoutItem:u0,layout:p,children:y0},u0.i)},[p,J,j,E,r,S,R,s,w,n5,j5,R1,T0,b0,p0,g,h,u,$0,Q0,G0,z,z0,i,t,M0,K]),K1=()=>{if(!n)return null;return P9.jsx(XL,{w:n.w,h:n.h,x:n.x,y:n.y,i:n.i,className:`react-grid-placeholder ${w0?"placeholder-resizing":""}`,containerWidth:J,cols:j,margin:E,containerPadding:r,maxRows:S,rowHeight:R,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:$0,transformScale:G0,constraints:K,layout:p,children:P9.jsx("div",{})})},k1=HL(Qh,U),x1={height:a0,...F};return P9.jsxs("div",{ref:N,className:k1,style:x1,onDrop:d?u5:void 0,onDragLeave:d?O5:void 0,onDragEnter:d?m5:void 0,onDragOver:d?K5:void 0,children:[R0.default.Children.map(Z,(y0)=>{if(!R0.default.isValidElement(y0))return null;return W5(y0)}),d&&c0&&W5(c0,!0),K1()]})}var G7=P(l(),1);function GL({items:$,editing:Z,renderItem:J,onLayoutChange:Q}){let[X,H]=XX.useState(()=>cQ($,[])),[G,z]=XX.useState($),{width:Y,containerRef:K,mounted:W}=vV({measureBeforeMount:!0});if(G!==$)z($),H((q)=>{let U=new Map(q.map((V)=>[V.i,V])),F=$.filter((V)=>U.has(V.id)).map((V)=>({...U.get(V.id),w:V.w,h:V.h})),N=new Set(F.map((V)=>V.i)),L=cQ($.filter((V)=>!N.has(V.id)),F);return[...F,...L]});let B=XX.useCallback((q)=>{H(q),Q?.(q.map((U)=>({id:U.i,w:U.w,h:U.h,x:U.x,y:U.y})))},[Q]);return G7.jsx("div",{ref:K,className:"mx-auto w-full max-w-[var(--column-w)]",children:W&&G7.jsx(QX,{width:Y,layout:X,gridConfig:{cols:4,rowHeight:160,margin:[8,8],containerPadding:[0,0]},dragConfig:{enabled:!!Z},resizeConfig:{enabled:!1},compactor:oQ,onLayoutChange:B,children:X.map((q)=>G7.jsx("div",{children:G7.jsx(h5.div,{layoutId:q.i,"data-snapshot-widget":q.i,className:"size-full",transition:{type:"spring",duration:0.35,bounce:0},children:J(q.i)})},q.i))})})}function Yh({items:$,editing:Z,renderItem:J,onLayoutChange:Q,onRemove:X}){return G7.jsx(GL,{items:$,editing:Z,onLayoutChange:Q,renderItem:(H)=>G7.jsx(tK,{editing:Z,onRemove:X?()=>X(H):void 0,children:J(H)})})}var z7=P(v(),1);function Kh($){let Z=s0();return r5({mutationFn:({key:J,thumbnails:Q})=>L4(`/api/workspaces/${$}/thumbnails`,f1("PUT",{key:J,thumbnails:Q}),"Failed to save thumbnails"),onMutate:({key:J})=>{Z.setQueryData(j0.layout($),(Q)=>Q?{...Q,widgetThumbnails:{key:J,at:new Date().toISOString()}}:Q)},onSuccess:()=>{Z.invalidateQueries({queryKey:j0.preview($)})}})}var U60=($)=>Math.min(1,400/Math.max($.offsetWidth,$.offsetHeight)),Bh=($,Z)=>{let J=new Map(Z.map((Q)=>[Q.id,Q.tag]));return[...$].sort().map((Q)=>`${Q}@${J.get(Q)??""}`).join(" ")},F60=($)=>new Promise((Z)=>{setTimeout(()=>Z(null),$)});async function qh($){let{createContext:Z,destroyContext:J,domToDataUrl:Q}=await import("/chunk-2vaafjp4.js"),X=async()=>{let H=await Z($,{scale:U60($),type:"image/webp",quality:0.8,backgroundColor:"#ffffff",timeout:1000,onCreateForeignObjectSvg:(G)=>{let z=document.createElement("style");z.textContent="[data-widget-chrome] { border-radius: 0 !important; box-shadow: none !important; }[data-widget-chrome]::after { display: none !important; }",G.append(z)}});try{return await Q(H)}finally{J(H)}};return Promise.race([X(),F60(1e4)])}var N60=5000,V60=10800000;function Uh({containerRef:$,widgets:Z,visibleIds:J,editing:Q}){let{layout:X,workspaceId:H}=d5(),G=Kh(H),z=z7.useRef(G.mutate);z.current=G.mutate;let Y=z7.useRef(!1),[K,W]=z7.useState(0),B=Bh(J,Z),q=Date.parse(X.widgetThumbnails?.at??""),U=!Number.isFinite(q)||Date.now()-q>V60,F=B!==""&&(B!==X.widgetThumbnails?.key||U);z7.useEffect(()=>{if(!F||Q)return;if(document.visibilityState!=="visible"){let V=()=>W((M)=>M+1);return document.addEventListener("visibilitychange",V,{once:!0}),()=>document.removeEventListener("visibilitychange",V)}let N=!1,L=setTimeout(async()=>{if(Y.current)return;Y.current=!0;try{let V={};for(let M of J){if(N)return;let A=$.current?.querySelector(`[data-snapshot-widget="${CSS.escape(M)}"]`),O=A?await qh(A):null;if(O)V[M]=O}if(N)return;z.current({key:B,thumbnails:V})}finally{Y.current=!1,W((V)=>V+1)}},N60);return()=>{N=!0,clearTimeout(L)}},[B,F,Q,K])}var F5=P(l(),1);function Fh($){return F5.jsx(ly,{name:$})}var L60=Array.from({length:10},($,Z)=>({id:`empty-widget-${Z}`,w:2,h:1}));function M60(){return F5.jsx(QZ,{className:"size-full animate-none rounded-2xl [corner-shape:superellipse(1.2)]"})}function A60({onCreateWidget:$}){return F5.jsxs("div",{className:"relative min-h-0 flex-1 pt-7",children:[F5.jsx("div",{"aria-hidden":"true",children:F5.jsx(GL,{items:L60,renderItem:M60})}),F5.jsx("div",{className:"absolute inset-0 flex items-center justify-center p-6",children:F5.jsxs("div",{className:"flex h-full w-full max-w-(--column-w) flex-col items-center justify-center gap-4 bg-radial from-background from-50% to-transparent to-75% text-center",children:[F5.jsxs("div",{className:"flex flex-col gap-1.5",children:[F5.jsx("h2",{className:"font-medium",children:"A little empty here"}),F5.jsx("p",{className:"mx-auto max-w-sm text-sm text-muted-foreground",children:"Widgets are small apps that can read data, perform tasks, and show a compact view of the information that matters."})]}),F5.jsxs(E0,{type:"button",variant:"secondary",size:"sm",onClick:$,children:[F5.jsx(e8,{"data-icon":"inline-start",stroke:1.5}),"Create widget"]})]})})]})}function D60({editing:$,onCreateWidget:Z,onEditingChange:J}){return F5.jsxs("div",{className:"mx-auto mb-4 flex w-full max-w-(--column-w) shrink-0 items-center justify-end gap-2",children:[$&&F5.jsxs(E0,{type:"button",variant:"ghost",size:"sm",className:"mr-auto",onClick:Z,children:[F5.jsx(e8,{"data-icon":"inline-start",stroke:1.75}),"New widget"]}),F5.jsx(O4,{mode:"popLayout",initial:!1,children:$?F5.jsx(h5.div,{variants:{from:{opacity:0,scale:0.8,filter:"blur(4px)"},to:{opacity:1,scale:1,filter:"blur(0px)"}},initial:"from",animate:"to",exit:"from",transition:{type:"spring",duration:0.3,bounce:0},children:F5.jsx(E0,{type:"button",size:"sm",onClick:()=>J(!1),children:"Done"})},"done"):F5.jsx(h5.div,{className:"flex items-center gap-1",variants:{from:{opacity:0,scale:0.8,filter:"blur(4px)"},to:{opacity:1,scale:1,filter:"blur(0px)"}},initial:"from",animate:"to",exit:"from",transition:{type:"spring",duration:0.3,bounce:0},children:F5.jsx(E0,{type:"button",variant:"ghost",size:"sm",className:"text-muted-foreground group-hover/widgets:opacity-100 [@media(hover:hover)]:opacity-0",onClick:()=>J(!0),children:"Edit widgets"})},"actions")})]})}function _60(){return F5.jsx("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center gap-3",children:F5.jsx("p",{className:"text-sm text-muted-foreground",children:"No widgets added yet"})})}function O60(){let[$,Z]=BZ.useState(0);return[BZ.useCallback((Q)=>{if(!Q)return;let X=new ResizeObserver(([H])=>{let G=H.borderBoxSize?.[0];Z(G?G.blockSize:H.contentRect.height)});return X.observe(Q),()=>X.disconnect()},[]),$]}function Vh({onCreateWidget:$,editing:Z,onEditingChange:J,widgets:Q}){let{layout:X,setLayout:H}=d5(),G=Q.length>0,z=new Set(X.widgetGrid.map((L)=>L.i)),Y=X.widgetGrid.filter((L)=>Q.some((V)=>V.id===L.i)).map((L)=>{let V=Q.find((M)=>M.id===L.i);return{id:L.i,w:V.config.colSpan,h:V.config.rowSpan,x:L.x,y:L.y}}),K=Q.filter((L)=>!z.has(L.id)).map((L)=>({id:L.id,w:L.config.colSpan,h:L.config.rowSpan})),[W,B]=O60(),q=Z&&K.length>0,U=BZ.useRef(null);Uh({containerRef:U,widgets:Q,visibleIds:Y.map((L)=>L.id),editing:Z});function F(L){H({widgetGrid:X.widgetGrid.filter((V)=>V.i!==L)})}function N(L){let V=Q.find((O)=>O.id===L);if(!V)return;let M=X.widgetGrid.map((O)=>{let _=Q.find((D)=>D.id===O.i);return{...O,w:_?.config.colSpan??1,h:_?.config.rowSpan??1}}),A=pQ(M,V.config.colSpan,V.config.rowSpan,4);H({widgetGrid:[...X.widgetGrid,{i:L,x:A.x,y:A.y}]})}return F5.jsx("div",{ref:U,className:"group/widgets relative min-h-0 flex-1",children:F5.jsxs(Nh,{children:[F5.jsx("div",{className:e("relative flex h-full flex-col p-4",G?"overflow-y-auto":"overflow-hidden"),children:G?F5.jsxs(F5.Fragment,{children:[F5.jsx(D60,{editing:Z,onCreateWidget:$,onEditingChange:J}),Y.length===0?F5.jsx(h5.div,{className:"mx-auto flex min-h-0 w-full max-w-[var(--column-w)] flex-1 flex-col",animate:{paddingBottom:q?B:0},transition:{type:"spring",duration:0.3,bounce:0},children:F5.jsx(_60,{})}):F5.jsx(h5.div,{animate:{marginBottom:q?B:0},transition:{type:"spring",duration:0.3,bounce:0},children:F5.jsx(Yh,{items:Y,editing:Z,renderItem:Fh,onRemove:F,onLayoutChange:(L)=>H({widgetGrid:L.map((V)=>({i:V.id,x:V.x??0,y:V.y??0}))})})})]}):F5.jsx(A60,{onCreateWidget:$})}),F5.jsx(O4,{children:G&&Z&&K.length>0&&F5.jsx(ny,{ref:W,items:K,renderItem:Fh,onClose:()=>J(!1),onRestore:N})})]})})}var Mh=P(l(),1);function Lh({children:$}){return Mh.jsx("header",{className:e("@container relative flex shrink-0 items-center gap-2.5 py-2 pr-3 pl-4","after:absolute after:top-full after:left-0 after:h-px after:w-full after:bg-border"),children:$})}var _L=P(v(),1);var B8=P(l(),1);function P60($){if($==="needs-auth")return"Needs auth";return $[0].toUpperCase()+$.slice(1)}function w60({name:$,status:Z}){let J=mK($),Q="size-full rounded-lg ring-2 ring-background";return B8.jsxs("span",{className:"relative size-10 shrink-0",children:[J?B8.jsx("img",{src:J,alt:"",className:"size-full rounded-lg ring-2 ring-background"}):B8.jsx("span",{className:"flex size-full items-center justify-center rounded-lg bg-muted text-muted-foreground ring-2 ring-background",children:B8.jsx(pK,{className:"size-5"})}),Z!=="connected"&&B8.jsx(Ah,{"aria-hidden":"true",size:16,stroke:1.75,className:"absolute -top-1 -right-1 rounded-full bg-card text-amber-400"})]})}function Dh($){return[...$].sort((Z,J)=>Number(J.status==="connected")-Number(Z.status==="connected"))}function _h({icon:$,children:Z}){return B8.jsxs("div",{className:"flex items-center gap-3 text-card-foreground",children:[$,B8.jsx("div",{className:"flex min-w-0 flex-1 flex-col justify-center gap-0.5",children:Z})]})}function Oh({server:$}){return B8.jsxs(_h,{icon:B8.jsx(w60,{name:$.name,status:$.status}),children:[B8.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:uK($.name)}),B8.jsx("span",{className:"text-sm text-muted-foreground",children:P60($.status)})]})}function Ph(){return B8.jsxs(_h,{icon:B8.jsx(QZ,{className:"size-10 shrink-0 rounded-lg"}),children:[B8.jsx(QZ,{className:"h-4 w-36 max-w-full"}),B8.jsx(QZ,{className:"h-4 w-20"})]})}function zL({children:$}){return B8.jsx("div",{className:"grid grid-cols-1 gap-6 sm:grid-cols-2",children:$})}function wh($,Z){return $1({queryKey:j0.mcp($),queryFn:()=>D5(`/api/workspaces/${$}/mcp`),enabled:Z,staleTime:1/0,gcTime:1/0,refetchOnMount:!1,refetchOnWindowFocus:!1})}var G4=P(l(),1);function qZ({title:$,description:Z,children:J}){return G4.jsxs("div",{className:"flex flex-col gap-6",children:[G4.jsxs("header",{className:"flex flex-col gap-0.5",children:[G4.jsx("h2",{className:"text-lg font-medium tracking-tight",children:$}),Z&&G4.jsx("p",{className:"text-sm text-muted-foreground",children:Z})]}),J]})}function UZ({label:$,children:Z}){return G4.jsxs("section",{className:"flex flex-col gap-2",children:[$&&G4.jsx("p",{className:"px-0.5 text-xs font-medium text-muted-foreground",children:$}),G4.jsx("div",{className:"flex flex-col divide-y divide-dashed divide-border overflow-hidden rounded-xl border border-border bg-card text-card-foreground",children:Z})]})}function FZ({title:$,description:Z,control:J}){return G4.jsxs("div",{className:"flex items-center gap-3 px-3.5 py-3",children:[G4.jsxs("div",{className:"flex min-w-0 flex-col",children:[G4.jsx("span",{className:"text-sm font-medium",children:$}),Z&&G4.jsx("span",{className:"text-xs text-muted-foreground",children:Z})]}),J&&G4.jsx("div",{className:"ml-auto flex shrink-0 items-center pl-3",children:J})]})}var h8=P(l(),1),j60=Array.from({length:4},($,Z)=>Z);function C60({connectors:$}){if($.isPending)return h8.jsx("div",{role:"status","aria-label":"Loading connectors",children:h8.jsx(zL,{children:j60.map((Z)=>h8.jsx(Ph,{},Z))})});if($.isError)return h8.jsxs(jh,{children:[h8.jsx("p",{className:"text-sm text-muted-foreground",children:"Could not load connectors."}),h8.jsx(E0,{variant:"outline",size:"sm",onClick:()=>$.refetch(),children:"Retry"})]});if($.data.length===0)return h8.jsxs(jh,{children:[h8.jsx(NW,{size:24,stroke:1.5,className:"text-muted-foreground"}),h8.jsx("p",{className:"text-sm text-foreground",children:"No connectors configured."})]});return h8.jsx(zL,{children:Dh($.data).map((Z)=>h8.jsx(Oh,{server:Z},Z.name))})}function jh({children:$}){return h8.jsx("div",{className:"flex min-h-48 flex-col items-center justify-center gap-3 rounded-xl border border-dashed border-border px-8 py-12 text-center",children:$})}function Ch(){let{workspaceId:$}=d5(),Z=wh($,!0);return h8.jsx(qZ,{title:"Connectors",description:"Connectors available to the agent in this workspace.",children:h8.jsx(C60,{connectors:Z})})}var qL=P(v(),1);var GX={};S4(GX,{Thumb:()=>Rh,Root:()=>Eh});var u6=P(v(),1);var VW=P(v(),1),YL=VW.createContext(void 0);function Th(){let $=VW.useContext(YL);if($===void 0)throw Error(I0(63));return $}var KL=function($){return $.checked="data-checked",$.unchecked="data-unchecked",$.disabled="data-disabled",$.readonly="data-readonly",$.required="data-required",$.valid="data-valid",$.invalid="data-invalid",$.touched="data-touched",$.dirty="data-dirty",$.filled="data-filled",$.focused="data-focused",$}({});var LW={...E8,checked($){if($)return{[KL.checked]:""};return{[KL.unchecked]:""}}};var HX=P(l(),1),Eh=u6.forwardRef(function(Z,J){let{checked:Q,className:X,defaultChecked:H,id:G,inputRef:z,name:Y,nativeButton:K=!1,onCheckedChange:W,readOnly:B=!1,required:q=!1,disabled:U=!1,render:F,uncheckedValue:N,value:L,...V}=Z,{clearErrors:M}=v4(),{state:A,setTouched:O,setDirty:_,validityData:D,setFilled:T,setFocused:k,shouldValidateOnChange:x,validationMode:I,disabled:y,name:C,validation:j}=j1(),{labelId:R}=H8(),S=y||U,E=C??Y,b=K0(W),g=u6.useRef(null),u=q4(g,z,j.inputRef),w=u6.useRef(null),s=e0(),z0=d7({id:G,implicit:!1,controlRef:w}),h=K?void 0:z0,[t,M0]=f4({controlled:Q,default:Boolean(H),name:"Switch",state:"checked"});l7({id:s,commit:j.commit,value:t,controlRef:w,name:E,getValue:()=>t}),W0(()=>{if(g.current)T(g.current.checked)},[g,T]),TY(t,()=>{if(M(E),_(t!==D.initialValue),T(t),x())j.commit(t);else j.commit(t,!0)});let{getButtonProps:d,buttonRef:Y0}=S1({disabled:S,native:K}),B0={id:K?z0:s,role:"switch","aria-checked":t,"aria-readonly":B||void 0,"aria-required":q||void 0,"aria-labelledby":R,onFocus(){if(!S)k(!0)},onBlur(){let c=g.current;if(!c||S)return;if(O(!0),k(!1),I==="onBlur")j.commit(c.checked)},onClick(c){if(B||S)return;c.preventDefault(),g.current?.dispatchEvent(new PointerEvent("click",{bubbles:!0,shiftKey:c.shiftKey,ctrlKey:c.ctrlKey,altKey:c.altKey,metaKey:c.metaKey}))}},J0=u6.useMemo(()=>t8({checked:t,disabled:S,id:h,name:E,required:q,style:E?TA:$2,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:u,onChange(c){if(c.nativeEvent.defaultPrevented)return;let Z0=c.target.checked,$0=O0(q0.none,c.nativeEvent);if(b?.(Z0,$0),$0.isCanceled)return;M0(Z0)},onFocus(){w.current?.focus()}},j.getInputValidationProps,L!==void 0?{value:L}:_5),[t,S,u,h,E,b,q,M0,j,L]),H0=u6.useMemo(()=>({...A,checked:t,disabled:S,readOnly:B,required:q}),[A,t,S,B,q]),N0=U0("span",Z,{state:H0,ref:[J,w,Y0],props:[B0,j.getValidationProps,V,d],stateAttributesMapping:LW});return HX.jsxs(YL.Provider,{value:H0,children:[N0,!t&&E&&N!==void 0&&HX.jsx("input",{type:"hidden",name:E,value:N}),HX.jsx("input",{...J0})]})});var Ih=P(v(),1);var Rh=Ih.forwardRef(function(Z,J){let{render:Q,className:X,...H}=Z,{state:G}=j1(),z=Th(),Y={...G,...z};return U0("span",Z,{state:Y,ref:J,stateAttributesMapping:LW,props:H})});var WL=P(l(),1);function kh({className:$,...Z}){return WL.jsx(GX.Root,{"data-slot":"switch",className:e("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border border-transparent shadow-xs transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-checked:bg-primary data-unchecked:bg-input",$),...Z,children:WL.jsx(GX.Thumb,{"data-slot":"switch-thumb",className:"pointer-events-none block size-4 rounded-full bg-background shadow-sm ring-0 transition-transform data-checked:translate-x-4 data-unchecked:translate-x-0.5"})})}var BL=["app-settings"];function Sh(){let $=s0();return s1((Z)=>{if(Z.type==="settings:updated")$.setQueryData(BL,Z.settings)}),$1({queryKey:BL,queryFn:()=>D5("/api/settings"),staleTime:30000})}function bh(){let $=s0();return r5({mutationFn:(Z)=>D5("/api/settings",f1("PATCH",Z),"Failed to save settings"),onSuccess:(Z)=>{$.setQueryData(BL,Z)}})}function yh($){return $1({queryKey:j0.env($),queryFn:()=>D5(`/api/workspaces/${$}/env`),...Y2})}function xh($){let Z=s0();return r5({mutationFn:(J)=>D5(`/api/workspaces/${$}/env`,f1("PUT",J)),onSuccess:(J)=>{Z.setQueryData(j0.env($),J)}})}function hh($){let Z=s0();return r5({mutationFn:(J)=>L4(`/api/workspaces/${$}/config`,f1("PUT",{name:J}),"Failed to save name"),onSuccess:()=>{Z.invalidateQueries({queryKey:j0.layout($)}),Z.invalidateQueries({queryKey:j0.all})}})}function gh($){let Z=s0();return r5({scope:{id:`workspace-icon:${$}`},mutationFn:(J)=>D5(`/api/workspaces/${$}/icon`,{method:"PUT",headers:{"Content-Type":J.type||"application/octet-stream"},body:J}),onSuccess:()=>{Z.invalidateQueries({queryKey:j0.layout($)}),Z.invalidateQueries({queryKey:j0.all})}})}function vh($){let Z=s0();return r5({scope:{id:`workspace-icon:${$}`},mutationFn:()=>L4(`/api/workspaces/${$}/icon`,{method:"DELETE"},"Failed to reset icon"),onSuccess:()=>{Z.invalidateQueries({queryKey:j0.layout($)}),Z.invalidateQueries({queryKey:j0.all})}})}function fh($){let Z=s0();return s1((J)=>{if(J.type==="env:updated"&&J.workspaceId===$)Z.invalidateQueries({queryKey:j0.env($)})}),{env:yh($),update:xh($)}}var P1=P(l(),1),T60={dotenv:".env",custom:"secret",both:"override"},E60=/^[A-Za-z_][A-Za-z0-9_]*$/;function uh(){let{workspaceId:$}=d5(),{env:Z,update:J}=fh($),[Q,X]=qL.useState(""),[H,G]=qL.useState(""),z=E60.test(Q),Y=z&&H.length>0&&!J.isPending,K=()=>{if(!Y)return;J.mutate({set:{[Q]:H}},{onSuccess:()=>{X(""),G("")}})},W=Z.data?.vars??[],B=Z.data?.files.reduce((U,F)=>U+F.count,0)??0,q=Z.data?.files.length??0;return P1.jsxs(qZ,{title:"Environment",description:"Secrets injected into widgets and the agent at run time. Values are write-only — they're never shown again once saved.",children:[P1.jsxs(UZ,{label:"Variables",children:[Z.isLoading?P1.jsx("div",{className:"flex items-center justify-center px-3.5 py-6 text-muted-foreground",children:P1.jsx(A1,{className:"size-4 animate-spin",stroke:1.75})}):W.length===0?P1.jsx("p",{className:"px-3.5 py-4 text-sm text-muted-foreground",children:"No variables yet."}):W.map((U)=>{let F=U.source!=="dotenv";return P1.jsxs("div",{className:"flex items-center gap-3 px-3.5 py-2.5",children:[P1.jsx("code",{className:"min-w-0 flex-1 truncate font-mono text-xs text-foreground",children:U.key}),P1.jsx("span",{className:"text-xs tracking-widest text-muted-foreground/60 select-none",children:"••••••"}),P1.jsx("span",{className:e("rounded-lg px-1.5 py-0.5 text-[11px] font-medium",U.source==="dotenv"?"bg-muted text-muted-foreground":"bg-primary/10 text-primary"),children:T60[U.source]}),!F&&P1.jsx("span",{className:"text-right text-[11px] text-muted-foreground/60",children:"from file"}),P1.jsx(E0,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>J.mutate({remove:[U.key]}),disabled:!F,"aria-label":`Delete ${U.key}`,className:"disabled:invisible",children:P1.jsx(mh,{stroke:1.75})})]},U.key)}),P1.jsxs("div",{className:"flex items-center gap-2 px-3.5 py-2.5",children:[P1.jsx(e9,{value:Q,onChange:(U)=>X(U.target.value),placeholder:"NEW_KEY","aria-invalid":Q.length>0&&!z,className:"h-7 w-40 font-mono text-xs"}),P1.jsx(e9,{value:H,onChange:(U)=>G(U.target.value),onKeyDown:(U)=>{if(U.key==="Enter")K()},type:"password",placeholder:"value",className:"h-7 flex-1 text-xs"}),P1.jsxs(E0,{variant:"outline",size:"sm",onClick:K,disabled:!Y,children:[J.isPending?P1.jsx(A1,{stroke:1.75,className:"animate-spin"}):P1.jsx(e8,{stroke:1.75}),"Add"]})]})]}),P1.jsx(UZ,{label:"From .env files",children:P1.jsx(FZ,{title:"Inherit .env files",description:q>0?`Discovered ${B} ${B===1?"key":"keys"} across ${q} ${q===1?"file":"files"} in this space.`:"No .env files found in this space.",control:P1.jsx(kh,{checked:Z.data?.inheritDotenv??!0,disabled:Z.isLoading,onCheckedChange:(U)=>J.mutate({inheritDotenv:U})})})})]})}var pv=P(v(),1);var L8=P(v(),1);var l0=P(v(),1),NZ=P(v(),1),T4=P(v(),1),Kg=P(l(),1),AW=P(v(),1),DW=P(v(),1),N5=P(l(),1),I60=Object.defineProperty,R60=($,Z)=>{for(var J in Z)I60($,J,{get:Z[J],enumerable:!0})},w9={};R60(w9,{ActiveEmoji:()=>jg,Empty:()=>wg,List:()=>_g,Loading:()=>Pg,Root:()=>Fg,Search:()=>Ng,SkinTone:()=>Cg,SkinToneSelector:()=>Og,Viewport:()=>Vg});var Qg="'Apple Color Emoji', 'Noto Color Emoji', 'Twemoji Mozilla', 'Android Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', EmojiSymbols, sans-serif",NL=["none","light","medium-light","medium","medium-dark","dark"];function UL($){return $.charAt(0).toUpperCase()+$.slice(1)}var V2=2,g8=null;function ph($){try{g8??=document.createElement("canvas").getContext("2d",{willReadFrequently:!0})}catch{}if(!g8||(queueMicrotask(()=>{g8&&(g8=null)}),g8.canvas.width=V2,g8.canvas.height=V2,g8.font=`2px ${Qg}`,g8.textBaseline="middle",g8.measureText($).width>=V2*2))return!1;g8.fillStyle="#00f",g8.fillText($,0,0);let Z=g8.getImageData(0,0,V2,V2).data;g8.clearRect(0,0,V2,V2),g8.fillStyle="#f00",g8.fillText($,0,0);let J=g8.getImageData(0,0,V2,V2).data;for(let Q=0;Q<V2*V2*4;Q+=4)if(Z[Q]!==J[Q]||Z[Q+1]!==J[Q+1]||Z[Q+2]!==J[Q+2])return!1;return!0}function ch($,Z,J){try{let Q=$.getItem(Z);if(!Q)throw Error(`No value found for "${Z}".`);let X=JSON.parse(Q);return J(X)}catch{return null}}function Xg($,Z,J){$.setItem(Z,JSON.stringify(J))}function dh($){return(Z)=>Z===void 0?void 0:$(Z)}function lh($){return(Z)=>Z===null?null:$(Z)}function V8($){if(typeof $!="string")throw Error();return $}function MW($){if(typeof $!="number")throw Error();return $}function Hg($){if(typeof $!="boolean")throw Error();return $}function p6($){return(Z)=>{if(typeof Z!="object"||Z===null)throw Error();let J={};for(let Q in $){let X=Z[Q];X===void 0&&$[Q](void 0),J[Q]=$[Q](X)}return J}}function FL($){return(Z)=>{if(!Array.isArray(Z))throw Error();return Z.length>0&&$(Z[0]),Z}}var Gg=($,Z)=>`${$}/${Z}/data.json`,zg=($,Z)=>`${$}/${Z}/messages.json`,k60=["bn","da","de","en-gb","en","es-mx","es","et","fi","fr","hi","hu","it","ja","ko","lt","ms","nb","nl","pl","pt","ru","sv","th","uk","vi","zh-hant","zh"],ih="en",Yg=($)=>`frimousse/data/${$}`,rh="frimousse/metadata";async function ah($,Z){try{return(await fetch($,{method:"HEAD",signal:Z})).headers.get("etag")}catch{return null}}async function S60($,Z,J){let[{emojis:Q,emojisEtag:X},{messages:H,messagesEtag:G}]=await Promise.all([fetch(Gg($,Z),{signal:J}).then(async(z)=>({emojis:await z.json(),emojisEtag:z.headers.get("etag")})),fetch(zg($,Z),{signal:J}).then(async(z)=>({messages:await z.json(),messagesEtag:z.headers.get("etag")}))]);return{emojis:Q,messages:H,emojisEtag:X,messagesEtag:G}}async function b60($,Z,J){let[Q,X]=await Promise.all([ah(Gg($,Z),J),ah(zg($,Z),J)]);return{emojisEtag:Q,messagesEtag:X}}function y60($){return $.skins?$.skins.filter((Z)=>typeof Z.tone=="number").reduce((Z,J)=>{let Q=NL[J.tone];return Z[Q]=J.emoji,Z},{}):void 0}async function nh($,Z,J){let{emojis:Q,emojisEtag:X,messages:H,messagesEtag:G}=await S60($,Z,J),z=H.subgroups.find((F)=>F.key==="country-flag"||F.key==="subdivision-flag"),Y=H.groups.filter((F)=>F.key!=="component"),K=Q.filter((F)=>("group"in F)),W=Y.map((F)=>({index:F.order,label:UL(F.message)})),B=H.skinTones.reduce((F,N)=>(F[N.key]=UL(N.message),F),{}),q=K.map((F)=>({emoji:F.emoji,category:F.group,version:F.version,label:UL(F.label),tags:F.tags??[],countryFlag:z&&F.subgroup===z.order||void 0,skins:y60(F)})),U={locale:Z,emojis:q,categories:W,skinTones:B};return Xg(localStorage,Yg(Z),{data:U,metadata:{emojisEtag:X,messagesEtag:G}}),U}function x60($,Z){let J=new Map;for(let G of $)J.has(G.version)||J.set(G.version,G.emoji);let Q=[...J.keys()].sort((G,z)=>z-G),X=Q[0]??0,H=ph("\uD83C\uDDEA\uD83C\uDDFA");if(typeof Z=="number")return{emojiVersion:Z,countryFlags:H};for(let G of Q){let z=J.get(G);if(ph(z))return{emojiVersion:G,countryFlags:H}}return{emojiVersion:X,countryFlags:H}}var h60=p6({emojiVersion:MW,countryFlags:Hg}),g60=p6({data:p6({locale:V8,emojis:FL(p6({emoji:V8,category:MW,label:V8,version:MW,tags:FL(V8),countryFlag:dh(Hg),skins:dh(p6({light:V8,"medium-light":V8,medium:V8,"medium-dark":V8,dark:V8}))})),categories:FL(p6({index:MW,label:V8})),skinTones:p6({light:V8,"medium-light":V8,medium:V8,"medium-dark":V8,dark:V8})}),metadata:p6({emojisEtag:lh(V8),messagesEtag:lh(V8)})});async function v60({locale:$,emojiVersion:Z,emojibaseUrl:J,signal:Q}){let X=typeof J=="string"?J:`https://cdn.jsdelivr.net/npm/emojibase-data@${typeof Z=="number"?Math.floor(Z):"latest"}`,H=ch(sessionStorage,rh,h60),G=ch(localStorage,Yg($),g60),z;if(!G)z=await nh(X,$,Q);else if(H)z=G.data;else try{let{emojisEtag:K,messagesEtag:W}=await b60(X,$,Q);z=!K||!W||K!==G.metadata.emojisEtag||W!==G.metadata.messagesEtag?await nh(X,$,Q):G.data}catch{z=G.data}H??=x60(z.emojis,Z),Xg(sessionStorage,rh,H);let Y=z.emojis.filter((K)=>{let W=K.version<=H.emojiVersion;return K.countryFlag?W&&H.countryFlags:W});return{locale:$,emojis:Y,categories:z.categories,skinTones:z.skinTones}}function sh($){return k60.includes($)?$:(console.warn(`Locale "${$}" is not supported, using "${ih}" instead.`),ih)}function oh($){return NL.includes($)?$:(console.warn(`Skin tone "${$}" is not valid, using "none" instead.`),"none")}function f60($,Z){let J=[];if(Z<=0)return J;for(let Q=0,X=$.length;Q<X;Q+=Z)J.push($.slice(Q,Q+Z));return J}function m60($,Z){if(!Z)return $;let J=Z.toLowerCase().trim(),Q=new WeakMap;return $.filter((X)=>{let H=0;X.label.toLowerCase().includes(J)&&(H+=10);for(let G of X.tags)G.toLowerCase().includes(J)&&(H+=1);return H>0?(Q.set(X,H),!0):!1}).sort((X,H)=>(Q.get(H)??0)-(Q.get(X)??0))}function u60($,Z,J,Q){let X=m60($.emojis,Q),H=[],G=[],z=[],Y={},K=0,W=0;for(let B of X)Y[B.category]||(Y[B.category]=[]),Y[B.category].push({emoji:J&&J!=="none"&&B.skins?B.skins[J]:B.emoji,label:B.label});for(let B of $.categories){let q=Y[B.index];if(!q||q.length===0)continue;let U=f60(Array.from(q),Z).map((F)=>({categoryIndex:K,emojis:F}));H.push(...U),G.push({label:B.label,rowsCount:U.length,startRowIndex:W}),z.push(W),K++,W+=U.length}return{count:X.length,categories:G,categoriesStartRowIndices:z,rows:H,skinTones:$.skinTones}}function p60($){let Z={},J=null,Q=null,X=new Set,H=()=>{if(J){Z=J,J=null;for(let K of X)K(Z)}Q=null},G=()=>J??Z,z=(K)=>{J??=Z,Object.assign(J,typeof K=="function"?K(G()):K),Q||(Q=requestAnimationFrame(H))},Y=(K)=>(X.add(K),()=>X.delete(K));return Z=$(z,G),{get:G,set:z,subscribe:Y}}function c60($){let[Z]=T4.useState($);return Z}function d60($){let Z=T4.createContext(null);return{useStore:()=>{let J=T4.useContext(Z);if(!J)throw Error($);return J},Provider:({store:J,children:Q})=>Kg.jsx(Z.Provider,{value:J,children:Q})}}function C4($,Z,J=Object.is){let[Q,X]=T4.useState(()=>Z($.get()));return T4.useEffect(()=>$.subscribe(()=>{let H=Z($.get());X((G)=>J(G,H)?G:H)}),[$,Z,J]),T4.useDebugValue(Q),Q}function s2($,Z,J){let Q=T4.useCallback((X)=>X[Z],[Z]);return C4($,Q,J)}var th=2;function l60($,Z,J,Q,X){let H=0;return p60((G,z)=>({locale:Z,columns:J,sticky:Q,skinTone:X,onEmojiSelect:$,data:null,search:"",interaction:"none",activeColumnIndex:0,activeRowIndex:0,rowHeight:null,categoryHeaderHeight:null,viewportWidth:null,viewportHeight:null,viewportCurrentCategoryIndex:null,viewportStartCategoryIndex:0,viewportStartRowIndex:0,viewportEndRowIndex:0,rootRef:null,searchRef:null,viewportRef:null,listRef:null,updateViewportState:(Y)=>{let K=z(),W=Y?.data??K.data,B=Y?.categoryHeaderHeight??K.categoryHeaderHeight,q=Y?.rowHeight??K.rowHeight,U=Y?.viewportHeight??K.viewportHeight;if(!W||W.rows.length===0||!B||!q||!U)return G({...Y,viewportStartCategoryIndex:0,viewportStartRowIndex:0,viewportEndRowIndex:0});let F=0,N=0;for(let k of W.categories)if(N++*B+k.startRowIndex*q<H)F+=B;else break;let L=W.categories.length*B+W.rows.length*q,V=Math.floor(th*q/2),M=Math.ceil(th*q/2),A=Math.min(H-F-V,L-U),O=A+U+M,_=Math.max(0,Math.floor(A/q)),D=Math.min(W.rows.length-1,Math.ceil(O/q)),T=W.rows[_]?.categoryIndex;return G(T===void 0&&Y?Y:{...Y,viewportStartCategoryIndex:T,viewportStartRowIndex:_,viewportEndRowIndex:D})},onDataChange:(Y)=>{z().updateViewportState({data:Y,activeColumnIndex:0,activeRowIndex:0})},onSearchChange:(Y)=>{G({search:Y,interaction:Y?"keyboard":"none"})},onActiveEmojiChange:(Y,K,W)=>{if(G({interaction:Y,activeColumnIndex:K,activeRowIndex:W}),Y!=="keyboard")return;let{listRef:B,viewportRef:q,sticky:U,rowHeight:F,viewportHeight:N,categoryHeaderHeight:L}=z(),V=B?.current,M=q?.current;if(!V||!M||!F||!L||!N)return;let A=W;A===0&&M.scrollTo({top:0,behavior:"instant"});let O=V.querySelector(`[aria-rowindex="${A}"]`);if(!(O instanceof HTMLElement))return;let _=O.offsetTop,D=getComputedStyle(O),T=Number.parseFloat(D.scrollMarginTop),k=Number.parseFloat(D.scrollMarginBottom),x=H+T;U&&_<H+N/2&&(x+=L);let I=x+N-k;(_<x||_+F>I)&&M.scrollTo({top:Math.max(_<x+L?_-Math.max(U?L:0,T):_-N+F+k,0),behavior:"instant"})},onActiveEmojiReset:()=>{G({interaction:"none",activeColumnIndex:0,activeRowIndex:0})},onRowHeightChange:(Y)=>{z().updateViewportState({rowHeight:Y})},onCategoryHeaderHeightChange:(Y)=>{z().updateViewportState({categoryHeaderHeight:Y})},onViewportSizeChange:(Y,K)=>{z().updateViewportState({viewportWidth:Y,viewportHeight:K})},onViewportScroll:(Y)=>{H=Y,z().updateViewportState()}}))}var{useStore:z4,Provider:i60}=d60("EmojiPicker.Root is missing.");function r60($){return $.search}function VL($){return $.interaction==="none"?void 0:$.data?.rows[$.activeRowIndex]?.emojis[$.activeColumnIndex]}function a60($){return $.data===void 0||typeof $.data?.count=="number"&&$.data.count===0}function n60($){return $.data===null||$.viewportHeight===null||$.rowHeight===null||$.categoryHeaderHeight===null}function Wg($){return $.data?.rows.length}function s60($){return $.data?.categories.length}function o60($){return $.data?.categoriesStartRowIndices}function t60($){return $.data?.skinTones}function Bg($,Z){return $?.emoji===Z?.emoji}function e60($,Z){return $?.categoryIndex!==Z?.categoryIndex||$?.emojis.length!==Z?.emojis.length?!1:!!$?.emojis.every((J,Q)=>Bg(J,Z?.emojis[Q]))}var zX="",eh=/\p{Emoji_Modifier_Base}/u,$30=/\uFE0F$/,Z30=/\u{1F3FB}|\u{1F3FC}|\u{1F3FD}|\u{1F3FE}|\u{1F3FF}/gu,J30={light:"\uD83C\uDFFB","medium-light":"\uD83C\uDFFC",medium:"\uD83C\uDFFD","medium-dark":"\uD83C\uDFFE",dark:"\uD83C\uDFFF"};function Q30($,Z){if(!$.split(zX).some((Q)=>eh.test(Q)))return $;let J=$.split(zX).map((Q)=>Q.replace(Z30,"")).join(zX);return Z==="none"?J:J.split(zX).map((Q,X,H)=>{let G=H.length>1;return!eh.test(Q)||G&&Q==="\uD83E\uDD1D"?Q:Q.replace($30,"")+J30[Z]}).join(zX)}function X30($){return NL.map((Z)=>({skinTone:Z,emoji:Q30($,Z)}))}function qg(){let $=z4(),Z=C4($,VL,Bg);return NZ.useDeferredValue(Z)}function Ug($="✋"){let Z=z4(),J=s2(Z,"skinTone"),Q=NZ.useMemo(()=>X30($),[$]),X=NZ.useCallback((H)=>{Z.set({skinTone:H})},[]);return[J,X,Q]}function LL($,Z){if(Object.is($,Z))return!0;if(typeof $!="object"||typeof Z!="object"||$===null||Z===null||Array.isArray($)!==Array.isArray(Z))return!1;let J=Object.keys($),Q=Object.keys(Z);return J.length!==Q.length?!1:J.every((X)=>(X in Z)&&$[X]===Z[X])}function H30(...$){}function G30($,Z){let J=null;if(typeof window.requestIdleCallback=="function")J=window.requestIdleCallback($,Z);else{let Q=Date.now();J=window.setTimeout(()=>{$({didTimeout:!1,timeRemaining:()=>Math.max(0,(Z?.timeout??50)-(Date.now()-Q))})},10)}return()=>{typeof window.cancelIdleCallback=="function"?window.cancelIdleCallback(J):window.clearTimeout(J)}}var L2=typeof window<"u"?AW.useLayoutEffect:AW.useEffect;function z30($){let Z=DW.useRef($);return L2(()=>{Z.current=$}),DW.useCallback((...J)=>Z.current(...J),[])}function Y30({emojiVersion:$,emojibaseUrl:Z}){let[J,Q]=l0.useState(void 0),X=z4(),H=s2(X,"locale"),G=s2(X,"columns"),z=s2(X,"skinTone"),Y=s2(X,"search");return l0.useEffect(()=>{let K=new AbortController,W=K.signal;return v60({locale:H,emojiVersion:$,emojibaseUrl:Z,signal:W}).then((B)=>{Q(B)}).catch((B)=>{W.aborted||console.error(B)}),()=>{K.abort()}},[$,Z,H]),l0.useEffect(()=>{if(J)return G30(()=>{X.get().onDataChange(u60(J,G,z,Y))},{timeout:100})},[J,G,z,Y]),null}var Fg=l0.forwardRef(({locale:$="en",columns:Z=9,skinTone:J="none",onEmojiSelect:Q=H30,emojiVersion:X,emojibaseUrl:H,onFocusCapture:G,onBlurCapture:z,children:Y,style:K,sticky:W=!0,...B},q)=>{let U=z30(Q),F=c60(()=>l60(U,sh($),Z,W,oh(J))),[N,L]=l0.useState(!1),V=l0.useRef(null),M=l0.useCallback((_)=>{_&&(V.current=_,F.set({rootRef:V}))},[]);L2(()=>{F.set({locale:sh($)})},[$]),L2(()=>{F.set({columns:Z})},[Z]),L2(()=>{F.set({sticky:W})},[W]),L2(()=>{F.set({skinTone:oh(J)})},[J]);let A=l0.useCallback((_)=>{G?.(_);let{searchRef:D,viewportRef:T}=F.get(),k=_.target===D?.current||_.target.hasAttribute("frimousse-search"),x=_.target===T?.current||_.target.hasAttribute("frimousse-viewport");_.isDefaultPrevented()||(L(k||x),_.isDefaultPrevented()||(L(k||x),x?F.get().onActiveEmojiChange("keyboard",0,0):k&&F.get().search===""&&F.set({interaction:"none"})))},[G]),O=l0.useCallback((_)=>{z?.(_),!_.isDefaultPrevented()&&!_.currentTarget.contains(_.relatedTarget)&&L(!1)},[z]);return L2(()=>{N||F.get().onActiveEmojiReset()},[N]),l0.useImperativeHandle(q,()=>V.current),l0.useEffect(()=>{if(!N)return;function _(D){if(D.defaultPrevented||!D.key.startsWith("Arrow")&&D.key!=="Enter")return;let{data:T,onEmojiSelect:k,onActiveEmojiChange:x,interaction:I,activeColumnIndex:y,activeRowIndex:C}=F.get();if(D.key==="Enter"){let j=VL(F.get());j&&(D.preventDefault(),k(j))}if(D.key.startsWith("Arrow")){let j=y,R=C;if(D.preventDefault(),I!=="none"){if(T?.rows&&T.rows.length>0)switch(D.key){case"ArrowLeft":{if(j===0){let S=R-1,E=T.rows[S];E&&(R=S,j=E.emojis.length-1)}else j-=1;break}case"ArrowRight":{if(j===T.rows[R].emojis.length-1){let S=R+1;T.rows[S]&&(R=S,j=0)}else j+=1;break}case"ArrowUp":{let S=T.rows[R-1];S&&(R-=1,S.emojis[j]||(j=S.emojis.length-1));break}case"ArrowDown":{let S=T.rows[R+1];S&&(R+=1,S.emojis[j]||(j=S.emojis.length-1));break}}x("keyboard",j,R)}else x("keyboard",0,0)}}return document.addEventListener("keydown",_),()=>{document.removeEventListener("keydown",_)}},[N]),L2(()=>{let _=null,D=null,T=null,k=null,x=F.subscribe((R)=>{V.current&&(_!==R.viewportWidth&&(_=R.viewportWidth,V.current.style.setProperty("--frimousse-viewport-width",`${R.viewportWidth}px`)),D!==R.viewportHeight&&(D=R.viewportHeight,V.current.style.setProperty("--frimousse-viewport-height",`${R.viewportHeight}px`)),T!==R.rowHeight&&(T=R.rowHeight,V.current.style.setProperty("--frimousse-row-height",`${R.rowHeight}px`)),k!==R.categoryHeaderHeight&&(k=R.categoryHeaderHeight,V.current.style.setProperty("--frimousse-category-header-height",`${R.categoryHeaderHeight}px`)))}),{viewportWidth:I,viewportHeight:y,rowHeight:C,categoryHeaderHeight:j}=F.get();return I&&V.current.style.setProperty("--frimousse-viewport-width",`${I}px`),y&&V.current.style.setProperty("--frimousse-viewport-height",`${y}px`),C&&V.current.style.setProperty("--frimousse-row-height",`${C}px`),j&&V.current.style.setProperty("--frimousse-category-header-height",`${j}px`),x},[]),N5.jsx("div",{"data-focused":N?"":void 0,"frimousse-root":"",onBlurCapture:O,onFocusCapture:A,...B,ref:M,style:{"--frimousse-emoji-font":Qg,...K},children:N5.jsxs(i60,{store:F,children:[N5.jsx(Y30,{emojiVersion:X,emojibaseUrl:H}),Y]})})}),Ng=l0.forwardRef(({value:$,defaultValue:Z,onChange:J,...Q},X)=>{let H=z4(),G=l0.useRef(null),z=l0.useCallback((B)=>{B&&(G.current=B,H.set({searchRef:G}))},[]),Y=typeof $=="string",K=l0.useRef(Y);l0.useEffect(()=>{K.current=Y},[Y]),L2(()=>{H.set({search:typeof $=="string"?$:typeof Z=="string"?Z:""})},[]),L2(()=>{typeof $=="string"&&H.get().onSearchChange($)},[$]);let W=l0.useCallback((B)=>{J?.(B),B.isDefaultPrevented()||H.get().onSearchChange(B.target.value)},[J]);return l0.useImperativeHandle(X,()=>G.current),N5.jsx("input",{autoCapitalize:"off",autoComplete:"off",autoCorrect:"off",enterKeyHint:"done","frimousse-search":"",placeholder:"Search…",spellCheck:!1,type:"search",...Q,defaultValue:Z,onChange:W,ref:z,value:$})}),K30=l0.memo(()=>{let $=qg();return $?N5.jsx("div",{"aria-live":"polite",style:{border:0,clip:"rect(0, 0, 0, 0)",height:1,margin:-1,overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:1,wordWrap:"normal"},children:$.label}):null}),Vg=l0.forwardRef(({children:$,onScroll:Z,onKeyDown:J,style:Q,...X},H)=>{let G=z4(),z=l0.useRef(null),Y=l0.useCallback((q)=>{q&&(z.current=q,G.set({viewportRef:z}))},[]),K=C4(G,Wg),W=C4(G,s60),B=l0.useCallback((q)=>{Z?.(q),G.get().onViewportScroll(q.currentTarget.scrollTop)},[Z]);return L2(()=>{if(!z.current)return;let q=new ResizeObserver(([U])=>{let F=U?.borderBoxSize[0]?.inlineSize??0,N=U?.borderBoxSize[0]?.blockSize??0,{onViewportSizeChange:L,viewportHeight:V,viewportWidth:M}=G.get();(V!==N||M!==F)&&L(F,N)});return q.observe(z.current),G.get().onViewportSizeChange(z.current.offsetWidth,z.current.clientHeight),()=>{q.disconnect()}},[]),l0.useImperativeHandle(H,()=>z.current),N5.jsxs("div",{"frimousse-viewport":"",...X,onScroll:B,ref:Y,style:{position:"relative",boxSizing:"border-box",contain:"layout paint",containIntrinsicSize:typeof K=="number"&&typeof W=="number"?`var(--frimousse-viewport-width, auto) calc(${K} * var(--frimousse-row-height) + ${W} * var(--frimousse-category-header-height))`:void 0,overflowY:"auto",overscrollBehavior:"contain",scrollbarGutter:"stable",willChange:"scroll-position",...Q},children:[N5.jsx(K30,{}),$]})});function Lg($,Z,J){return{emoji:{...$,isActive:J},role:"gridcell","aria-colindex":Z,"aria-selected":J||void 0,"aria-label":$.label,"data-active":J?"":void 0,"frimousse-emoji":"",style:{fontFamily:"var(--frimousse-emoji-font)"},tabIndex:-1}}function Mg($,Z=!1){return{role:Z?void 0:"row","aria-rowindex":Z?void 0:$,"frimousse-row":"",style:{contain:Z?void 0:"content",height:Z?void 0:"var(--frimousse-row-height)",display:"flex"}}}function Ag($,Z){return{"frimousse-category":"",style:{contain:"content",top:Z?`calc(${$} * var(--frimousse-category-header-height) + ${Z.startRowIndex} * var(--frimousse-row-height))`:void 0,height:Z?`calc(var(--frimousse-category-header-height) + ${Z.rowsCount} * var(--frimousse-row-height))`:void 0,width:"100%",pointerEvents:"none",position:"absolute"}}}function Dg($,Z=!1,J=!0){return{category:$,"frimousse-category-header":"",style:{contain:Z?void 0:"layout paint",height:Z?void 0:"var(--frimousse-category-header-height)",pointerEvents:"auto",position:J?"sticky":void 0,top:0}}}function $g($,Z,J,Q){return{"frimousse-list-sizer":"",style:{position:"relative",boxSizing:"border-box",height:`calc(${$} * var(--frimousse-row-height) + ${Z} * var(--frimousse-category-header-height))`,paddingTop:`calc(${J} * var(--frimousse-row-height) + ${Q} * var(--frimousse-category-header-height))`}}}function Zg($,Z,J){return{"aria-colcount":$,"aria-rowcount":Z,"frimousse-list":"",style:{"--frimousse-list-columns":$,...J},role:"grid"}}function W30($){$.preventDefault()}var B30=l0.memo(({Emoji:$,emoji:Z,columnIndex:J,rowIndex:Q})=>{let X=z4(),H=C4(X,(K)=>VL(K)?.emoji===Z.emoji),G=l0.useCallback(()=>{X.get().onEmojiSelect(Z)},[Z]),z=l0.useCallback(()=>{X.get().onActiveEmojiChange("pointer",J,Q)},[J,Q]),Y=l0.useCallback(()=>{X.get().onActiveEmojiReset()},[]);return N5.jsx($,{...Lg(Z,J,H),onClick:G,onPointerDown:W30,onPointerEnter:z,onPointerLeave:Y})}),q30=l0.memo(({Row:$,Emoji:Z,rowIndex:J})=>{let Q=z4(),X=C4(Q,(H)=>H.data?.rows[J],e60);return X?N5.jsx($,{...Mg(J),children:X.emojis.map((H,G)=>N5.jsx(B30,{Emoji:Z,columnIndex:G,emoji:H,rowIndex:J},H.label))}):null}),U30=l0.memo(({CategoryHeader:$,categoryIndex:Z})=>{let J=z4(),Q=C4(J,(H)=>H.data?.categories[Z],LL),X=s2(J,"sticky");return Q?N5.jsx("div",{...Ag(Z,Q),children:N5.jsx($,{...Dg({label:Q.label},!1,X)})}):null}),Jg=l0.memo(({CategoryHeader:$,Row:Z,Emoji:J})=>{let Q=l0.useRef(null),X=z4(),H=s2(X,"columns"),G=l0.useMemo(()=>Array(H).fill({emoji:"\uD83D\uDE42",label:""}),[H]),z=l0.useMemo(()=>({label:"Category"}),[]),Y=l0.useRef(null),K=l0.useRef(null);return L2(()=>{let W=Q.current?.parentElement?.parentElement;if(!W||!Y.current||!K.current)return;let B=new ResizeObserver((F)=>{for(let N of F){let L=N.contentRect.height,{onRowHeightChange:V,onCategoryHeaderHeightChange:M,rowHeight:A,categoryHeaderHeight:O}=X.get();N.target===Y.current&&A!==L&&V(L),N.target===K.current&&O!==L&&M(L)}});B.observe(W),B.observe(Y.current),B.observe(K.current);let{onRowHeightChange:q,onCategoryHeaderHeightChange:U}=X.get();return q(Y.current.clientHeight),U(K.current.clientHeight),()=>{B.disconnect()}},[]),N5.jsxs("div",{"aria-hidden":!0,ref:Q,style:{height:0,visibility:"hidden"},children:[N5.jsx("div",{"frimousse-row-sizer":"",ref:Y,children:N5.jsx(Z,{...Mg(-1,!0),children:G.map((W,B)=>N5.jsx(J,{...Lg(W,B,!1)},B))})}),N5.jsx("div",{...Ag(-1),children:N5.jsx("div",{"frimousse-category-header-sizer":"",ref:K,children:N5.jsx($,{...Dg(z,!0)})})})]})});function F30({category:$,...Z}){return N5.jsx("div",{...Z,children:$.label})}function N30({emoji:$,...Z}){return N5.jsx("button",{type:"button",...Z,children:$.emoji})}function V30({...$}){return N5.jsx("div",{...$})}var _g=l0.forwardRef(({style:$,components:Z,...J},Q)=>{let X=z4(),H=l0.useRef(null),G=l0.useCallback((V)=>{V&&(H.current=V,X.set({listRef:H}))},[]),z=Z?.CategoryHeader??F30,Y=Z?.Emoji??N30,K=Z?.Row??V30,W=s2(X,"columns"),B=s2(X,"viewportStartRowIndex"),q=s2(X,"viewportEndRowIndex"),U=C4(X,Wg),F=C4(X,o60,LL),N=l0.useMemo(()=>F?.filter((V)=>V<B).length??0,[F,B]),L=F?.length??0;return l0.useImperativeHandle(Q,()=>H.current),!U||!F||L===0?N5.jsx("div",{...Zg(W,0,$),...J,children:N5.jsx("div",{...$g(0,0,0,0),children:N5.jsx(Jg,{CategoryHeader:z,Emoji:Y,Row:K})})}):N5.jsx("div",{...Zg(W,U,$),...J,ref:G,children:N5.jsxs("div",{...$g(U,L,B,N),children:[N5.jsx(Jg,{CategoryHeader:z,Emoji:Y,Row:K}),Array.from({length:q-B+1},(V,M)=>{let A=B+M,O=F.indexOf(A);return N5.jsxs(l0.Fragment,{children:[O>=0&&N5.jsx("div",{style:{height:"var(--frimousse-category-header-height)"}}),N5.jsx(q30,{Emoji:Y,Row:K,rowIndex:A})]},A)}),Array.from({length:L},(V,M)=>N5.jsx(U30,{CategoryHeader:z,categoryIndex:M},M))]})})}),Og=l0.forwardRef(({emoji:$,onClick:Z,"aria-label":J="Change skin tone",...Q},X)=>{let H=z4(),G=C4(H,t60,LL),[z,Y,K]=Ug($),W=l0.useMemo(()=>Math.max(0,K.findIndex((L)=>L.skinTone===z)),[z,K]),B=K[W],q=K[(W+1)%K.length].skinTone,U=z==="none"?void 0:G?.[z],F=q==="none"?void 0:G?.[q],N=l0.useCallback((L)=>{Z?.(L),L.isDefaultPrevented()||Y(q)},[Z,Y,q]);return N5.jsx("button",{type:"button",...Q,"aria-label":J+(F?` (${F})`:""),"aria-live":"polite","aria-valuetext":U,"frimousse-skin-tone-selector":"",onClick:N,ref:X,children:B.emoji})});function Pg({children:$,...Z}){let J=z4();return C4(J,n60)?N5.jsx("span",{"frimousse-loading":"",...Z,children:$}):null}function L30({children:$}){let Z=z4(),J=C4(Z,r60);return $({search:J})}function wg({children:$,...Z}){let J=z4();return C4(J,a60)?N5.jsx("span",{"frimousse-empty":"",...Z,children:typeof $=="function"?N5.jsx(L30,{children:$}):$}):null}function jg({children:$}){let Z=qg();return $({emoji:Z})}function Cg({children:$,emoji:Z}){let[J,Q,X]=Ug(Z);return $({skinTone:J,setSkinTone:Q,skinToneVariations:X})}Fg.displayName="EmojiPicker.Root";Ng.displayName="EmojiPicker.Search";Vg.displayName="EmojiPicker.Viewport";_g.displayName="EmojiPicker.List";Pg.displayName="EmojiPicker.Loading";wg.displayName="EmojiPicker.Empty";Og.displayName="EmojiPicker.SkinToneSelector";jg.displayName="EmojiPicker.ActiveEmoji";Cg.displayName="EmojiPicker.SkinTone";var YX=["rocket","sparkles","bolt","flame","star","heart","diamond","trophy","target","bulb","brain","robot","wand","atom","flask","cpu","code","terminal","api","database","cube","hexagon","plug","tool","settings","bug","activity","chart","briefcase","folder","file","book","message","mail","bell","paperclip","key","shield","user","home","globe","world","planet","compass","map","calendar","cloud","sun","moon","snowflake","leaf","mountain","feather","ghost","music","piano","camera","photo","palette","gamepad","gift","cart","chef"],M30=new Set(YX);function Tg($){return M30.has($)}var Iv={rocket:Nv,sparkles:Av,bolt:WQ,flame:ng,star:Dv,heart:$v,diamond:rg,trophy:jv,target:Ov,bulb:xg,brain:bg,robot:Fv,wand:Tv,atom:Rg,flask:sg,cpu:cg,code:ug,terminal:Pv,api:Ig,database:lg,cube:dg,hexagon:Zv,plug:Uv,tool:wv,settings:KX,bug:yg,activity:Eg,chart:vg,briefcase:pY,folder:og,file:S$,book:Sg,message:Gv,mail:Xv,bell:kg,paperclip:fY,key:_W,shield:Vv,user:Cv,home:Jv,globe:eg,world:Ev,planet:qv,compass:pg,map:Hv,calendar:hg,cloud:mg,sun:_v,moon:zv,snowflake:Mv,leaf:Qv,mountain:Yv,feather:ag,ghost:F$,music:Kv,piano:cY,camera:gg,photo:Bv,palette:Wv,gamepad:ig,gift:tg,cart:Lv,chef:fg},ML=YX.map(($)=>({id:$,Icon:Iv[$]}));function OW($){return $&&Tg($)?Iv[$]:null}var DL=[{id:"sunrise",gradient:{angle:140,stops:["#FFE29F","#FFA99F","#FF719A"]}},{id:"ocean",gradient:{angle:135,stops:["#67E8F9","#3B82F6","#4F46E5"]}},{id:"meadow",gradient:{angle:135,stops:["#A7F3D0","#34D399","#059669"]}},{id:"dusk",gradient:{angle:120,stops:["#C471F5","#FA71CD"]}},{id:"midnight",gradient:{angle:135,stops:["#30CFD0","#330867"]}}];function AL($,Z,J){let Q=J*Math.PI/180,X=Z*Math.cos(Q),H=Z*Math.sin(Q),G=($+0.3963377774*X+0.2158037573*H)**3,z=($-0.1055613458*X-0.0638541728*H)**3,Y=($-0.0894841775*X-1.291485548*H)**3;return`#${[4.0767416621*G-3.3077115913*z+0.2309699292*Y,-1.2684380046*G+2.6097574011*z-0.3413193965*Y,-0.0041960863*G-0.7034186147*z+1.707614701*Y].map((W)=>{let B=Math.min(1,Math.max(0,W)),q=B<=0.0031308?12.92*B:1.055*B**0.4166666666666667-0.055;return Math.round(q*255).toString(16).padStart(2,"0")}).join("")}`}function Rv(){let $=Math.random()*360,Z=(35+Math.random()*55)*(Math.random()<0.5?-1:1),J=Math.round(115+Math.random()*55),Q=AL(0.83+Math.random()*0.06,0.09+Math.random()*0.06,$),X=AL(0.5+Math.random()*0.14,0.17+Math.random()*0.07,$+Z);if(Math.random()<0.4){let H=AL(0.7+Math.random()*0.05,0.15,$+Z/2);return{angle:J,stops:[Q,H,X]}}return{angle:J,stops:[Q,X]}}var A30="radial-gradient(120% 100% at 28% 12%, rgba(255,255,255,0.32), rgba(255,255,255,0) 58%)";function PW($){return`${A30}, linear-gradient(${$.angle}deg, ${$.stops.join(", ")})`}var $8=256;function kv($,Z){let J=Z.angle*Math.PI/180,Q=Math.sin(J),X=-Math.cos(J),H=$8*(Math.abs(Q)+Math.abs(X))/2,G=$8/2,z=$.createLinearGradient(G-Q*H,G-X*H,G+Q*H,G+X*H),Y=Z.stops.length-1;Z.stops.forEach((W,B)=>z.addColorStop(Y===0?0:B/Y,W)),$.fillStyle=z,$.fillRect(0,0,$8,$8);let K=$.createRadialGradient($8*0.28,$8*0.12,0,$8*0.28,$8*0.12,$8*1.1);K.addColorStop(0,"rgba(255,255,255,0.32)"),K.addColorStop(0.58,"rgba(255,255,255,0)"),$.fillStyle=K,$.fillRect(0,0,$8,$8)}function Sv($){return new Promise((Z,J)=>{$.toBlob((Q)=>Q?Z(Q):J(Error("Canvas is empty")),"image/png")})}function bv(){let $=document.createElement("canvas");$.width=$8,$.height=$8;let Z=$.getContext("2d");if(!Z)throw Error("2D canvas unavailable");return[$,Z]}var D30=0.92,_30=0.68;async function yv($,Z){let[J,Q]=bv();if(Z)kv(Q,Z);Q.textAlign="center",Q.textBaseline="middle";let X=Z?_30:D30;return Q.font=`${Math.round($8*X)}px "Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif`,Q.fillText($,$8/2,$8/2+$8*0.04),Sv(J)}function O30($){return new Promise((Z,J)=>{let Q=new Image;Q.onload=()=>Z(Q),Q.onerror=()=>J(Error("Failed to load SVG")),Q.src=$})}var P30=0.78,w30=0.6;async function xv($,Z){let[J,Q]=bv();if(Z)kv(Q,Z);let X=Z?"#ffffff":"#18181b",H=$.replace(/currentColor/g,X),G=await O30(`data:image/svg+xml;utf8,${encodeURIComponent(H)}`),z=$8*(Z?w30:P30),Y=($8-z)/2;return Q.drawImage(G,Y,Y,z,z),Sv(J)}var hv=["\uD83D\uDE80","✨","\uD83D\uDD25","⚡","\uD83D\uDCA1","\uD83E\uDDE0","\uD83E\uDD16","\uD83E\uDE84","\uD83E\uDDEA","⚙️","\uD83D\uDEE0️","\uD83D\uDCBB","\uD83D\uDCE6","\uD83D\uDCCA","\uD83D\uDCC8","\uD83D\uDCDD","\uD83D\uDCDA","\uD83C\uDFAF","\uD83C\uDFC6","\uD83D\uDC8E","\uD83E\uDE90","\uD83C\uDF0D","\uD83E\uDDED","\uD83C\uDFA8","\uD83C\uDFAE","☕"],wW="font-[Apple_Color_Emoji,Segoe_UI_Emoji,Noto_Color_Emoji,sans-serif]";var n0=P(l(),1);function j30({category:$,...Z}){return n0.jsx("div",{className:"bg-background px-2.5 pt-2.5 pb-1 text-xs font-medium text-muted-foreground",...Z,children:$.label})}function C30({children:$,...Z}){return n0.jsx("div",{className:"scroll-my-1 px-1.5",...Z,children:$})}function T30({emoji:$,...Z}){return n0.jsx("button",{className:e("flex size-9 items-center justify-center rounded-xl text-[22px] transition-colors duration-75 data-active:bg-muted",wW),...Z,children:$.emoji})}function uv({icon:$}){let{workspaceId:Z,provider:J}=d5(),{isPending:Q,mutateAsync:X}=gh(Z),{isPending:H,mutate:G}=vh(Z),[z,Y]=L8.useState("emoji"),[K,W]=L8.useState({id:"sunrise",gradient:DL[0].gradient}),[B,q]=L8.useState(null),[U,F]=L8.useState(null),[N,L]=L8.useState(""),[V,M]=L8.useState(null),[A,O]=L8.useState(null),[_,D]=L8.useState(!1),[T,k]=L8.useState(null),x=L8.useRef(null),I=L8.useRef(null),y=L8.useRef(null),C=ML.find((w)=>w.id===V),j=K.gradient!==null,R=Q||H,S=()=>{let w=Rv();q(w),W({id:"shuffle",gradient:w})},E=(w)=>{k(null),y.current=w,Y("upload"),O(URL.createObjectURL(w))};L8.useEffect(()=>{let w=!1,s=async()=>{let h;if(z==="upload"){if(!y.current)return;h=y.current}else if(z==="emoji"){if(!U)return;h=await yv(U,K.gradient)}else{let t=I.current?.querySelector("svg");if(!t)return;h=await xv(new XMLSerializer().serializeToString(t),K.gradient)}if(!w)await X(h)};k(null);let z0=window.setTimeout(()=>{s().catch((h)=>{if(!w)k(h instanceof Error?h.message:"Failed to save icon")})},150);return()=>{w=!0,window.clearTimeout(z0)}},[K.gradient,U,z,X,C,A]),L8.useEffect(()=>{return()=>{if(A)URL.revokeObjectURL(A)}},[A]);let b=()=>{y.current=null,F(null),M(null),O(null),k(null),G()},g=z==="emoji"&&U?"emoji":z==="icon"&&C?"glyph":"image",u=z==="upload"&&A?A:$??H2[J??"claude-code"];return n0.jsxs("div",{className:"flex gap-6",children:[n0.jsxs("div",{className:"flex w-24 shrink-0 flex-col items-center gap-2.5",children:[n0.jsx("div",{className:e("flex size-24 items-center justify-center overflow-hidden rounded-xl",g!=="image"&&!j&&"bg-[repeating-conic-gradient(#0000000d_0%_25%,transparent_0%_50%)] bg-size-[16px_16px]"),style:g!=="image"&&K.gradient?{background:PW(K.gradient)}:void 0,children:g==="emoji"?n0.jsx("span",{className:e("leading-none",wW,j?"text-[64px]":"text-[86px]"),children:U}):g==="glyph"&&C?n0.jsx(C.Icon,{stroke:1.5,className:e(j?"size-14 text-white":"size-18 text-foreground")}):n0.jsx("img",{src:u,alt:"",className:"size-full object-cover"})}),n0.jsx("button",{type:"button",onClick:b,disabled:R,className:"text-xs text-muted-foreground transition-colors hover:text-foreground disabled:opacity-50",children:"Reset to default"})]}),n0.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-3",children:[n0.jsx("div",{className:"flex gap-1 self-start rounded-xl bg-muted p-0.5",children:["emoji","icon","upload"].map((w)=>n0.jsx("button",{type:"button",onClick:()=>Y(w),className:e("rounded-lg px-3.5 py-1 text-xs font-medium capitalize transition-colors",z===w?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:w},w))}),n0.jsxs("div",{className:e("flex items-center gap-2",z==="upload"&&"pointer-events-none opacity-35"),children:[n0.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Background"}),n0.jsxs("div",{className:"flex items-center gap-2",children:[n0.jsx("button",{type:"button","aria-label":"No background",onClick:()=>W({id:"none",gradient:null}),className:e("flex size-7 items-center justify-center rounded-full bg-muted ring-offset-2 ring-offset-card transition-shadow",K.id==="none"?"ring-2 ring-primary":"ring-1 ring-border hover:ring-muted-foreground/30"),children:n0.jsx(vv,{size:16,stroke:1.75,className:"text-muted-foreground"})}),DL.map((w)=>n0.jsx("button",{type:"button","aria-label":`${w.id} background`,onClick:()=>W({id:w.id,gradient:w.gradient}),style:{background:PW(w.gradient)},className:e("size-7 rounded-full ring-offset-2 ring-offset-card transition-shadow",K.id===w.id?"ring-2 ring-primary":"hover:ring-2 hover:ring-muted-foreground/30")},w.id)),n0.jsx("button",{type:"button","aria-label":"Random background",title:"Surprise me",onClick:S,style:B?{background:PW(B)}:void 0,className:e("flex size-7 items-center justify-center rounded-full ring-offset-2 ring-offset-card transition-shadow",B?"text-white":"bg-muted text-muted-foreground ring-1 ring-border",K.id==="shuffle"?"ring-2 ring-primary":"hover:ring-2 hover:ring-muted-foreground/30"),children:n0.jsx(gv,{size:16,stroke:1.75})})]})]}),z==="emoji"?n0.jsxs(w9.Root,{onEmojiSelect:(w)=>F(w.emoji),emojibaseUrl:"/vendor/emojibase",columns:13,className:"isolate flex h-72 flex-col overflow-hidden rounded-xl border border-border bg-background",children:[n0.jsxs("div",{className:"flex items-center gap-1.5 p-1.5 pb-0",children:[n0.jsx(w9.Search,{placeholder:"Search emoji…",onChange:(w)=>L(w.target.value),className:"h-8 min-w-0 flex-1 appearance-none rounded-lg bg-muted px-2.5 text-sm outline-none placeholder:text-muted-foreground"}),n0.jsx(w9.SkinToneSelector,{className:"size-8 shrink-0 rounded-lg text-lg hover:bg-accent"})]}),n0.jsxs(w9.Viewport,{className:"relative scrollbar-thin flex-1 overflow-y-auto outline-none",children:[n0.jsxs(w9.Loading,{className:"absolute inset-0 flex items-center justify-center gap-2 text-xs text-muted-foreground",children:[n0.jsx(A1,{size:16,stroke:1.75,className:"animate-spin"}),"Loading emoji…"]}),N.trim()===""&&n0.jsxs("div",{className:"border-b border-dashed border-border pb-1.5",children:[n0.jsx("p",{className:"px-2.5 pt-2.5 pb-1 text-xs font-medium text-muted-foreground",children:"Favorites"}),n0.jsx("div",{className:"grid grid-cols-13 justify-items-start px-1.5",children:hv.map((w)=>n0.jsx("button",{type:"button",onClick:()=>F(w),className:e("flex size-9 items-center justify-center rounded-xl text-[22px] transition-colors duration-75",wW,U===w?"bg-primary/10":"hover:bg-accent"),children:w},w))})]}),n0.jsxs(w9.Empty,{className:"absolute inset-0 flex flex-col items-center justify-center gap-1 text-xs text-muted-foreground",children:[n0.jsx(fv,{size:20,stroke:1.5}),"No emoji found"]}),n0.jsx(w9.List,{className:"pb-1.5 select-none",components:{CategoryHeader:j30,Row:C30,Emoji:T30}})]})]}):z==="icon"?n0.jsx("div",{className:"grid scrollbar-thin h-72 grid-cols-[repeat(auto-fill,minmax(2.25rem,1fr))] content-start gap-1 overflow-y-auto rounded-xl border border-border bg-background p-1.5",children:ML.map(({id:w,Icon:s})=>n0.jsx("button",{type:"button","aria-label":w,onClick:()=>M(w),className:e("flex aspect-square items-center justify-center rounded-xl text-muted-foreground transition-colors [&_svg]:size-5",V===w?"bg-primary/10 text-primary":"hover:bg-accent hover:text-accent-foreground"),children:n0.jsx(s,{stroke:1.5})},w))}):n0.jsxs("button",{type:"button",onClick:()=>x.current?.click(),onDragOver:(w)=>{w.preventDefault(),D(!0)},onDragLeave:()=>D(!1),onDrop:(w)=>{w.preventDefault(),D(!1);let s=w.dataTransfer.files?.[0];if(s)E(s)},className:e("flex h-72 flex-col items-center justify-center gap-2 rounded-xl border border-dashed transition-colors",_?"border-primary bg-primary/5 text-primary":"border-border text-muted-foreground hover:border-muted-foreground/30 hover:text-foreground"),children:[n0.jsx(mv,{size:24,stroke:1.5}),n0.jsx("span",{className:"text-xs font-medium",children:"Click or drop an image"}),n0.jsx("span",{className:"text-[11px] text-muted-foreground/70",children:"PNG, JPG, GIF, or WebP"})]}),n0.jsx("div",{className:"min-h-4","aria-live":"polite",children:T?n0.jsx("p",{className:"text-xs text-destructive",children:T}):R?n0.jsx("p",{className:"text-xs text-muted-foreground",children:"Saving…"}):null})]}),n0.jsx("input",{ref:x,type:"file",accept:"image/png,image/jpeg,image/gif,image/webp",className:"hidden",onChange:(w)=>{let s=w.target.files?.[0];if(s)E(s);w.target.value=""}}),n0.jsx("span",{ref:I,"aria-hidden":!0,className:"hidden",children:C&&n0.jsx(C.Icon,{stroke:1.5})})]})}var q8=P(l(),1);function cv(){let{name:$,icon:Z,cwd:J,workspaceId:Q}=d5(),[,X]=I4(),H=hh(Q),G=c_(),[z,Y]=pv.useState($??"");return q8.jsxs(qZ,{title:"General",description:"Basic details for this space.",children:[q8.jsxs(UZ,{children:[q8.jsx(FZ,{title:"Name",description:"Shown in the sidebar and the workspace header.",control:q8.jsx(e9,{value:z,onChange:(B)=>Y(B.target.value),onBlur:()=>{let B=z.trim();if(B===($??""))return;H.mutate(B===""?null:B)},onKeyDown:(B)=>{if(B.key==="Enter")B.currentTarget.blur()},placeholder:"Space name",className:"w-56"})}),q8.jsx(FZ,{title:"Path",control:q8.jsx(e9,{value:J??"",readOnly:!0,"aria-label":"Workspace path",title:J??void 0,className:"w-56"})}),q8.jsxs("div",{className:"flex flex-col gap-4 px-3.5 py-3.5",children:[q8.jsxs("div",{className:"flex flex-col",children:[q8.jsx("span",{className:"text-sm font-medium",children:"Icon"}),q8.jsx("span",{className:"text-xs text-muted-foreground",children:"Pick an emoji or a glyph on a generated background, or upload an image."})]}),q8.jsx(uv,{icon:Z})]})]}),q8.jsxs(UZ,{label:"Danger zone",children:[q8.jsx(FZ,{title:"Remove space",description:"Remove this space from moi. Its folder and sessions stay on disk.",control:q8.jsxs(E0,{type:"button",variant:"destructive",size:"sm",onClick:()=>{let q=`Remove "${$??J??"this space"}" from your workspaces?
|
|
78
|
-
|
|
79
|
-
This only removes it from your list. The folder and its sessions stay on disk. You can add it back any time.`;if(!window.confirm(q))return;G.mutate(Q,{onSuccess:()=>X("/")})},disabled:G.isPending,children:[G.isPending&&q8.jsx(A1,{"data-icon":"inline-start",stroke:1.75,className:"animate-spin"}),"Remove"]})}),G.isError&&q8.jsx("p",{className:"px-3.5 py-3 text-xs text-destructive",children:G.error.message})]})]})}var z1=P(l(),1),E30=[{id:"general",label:"General",icon:KX},{id:"connectors",label:"Connectors",icon:NW},{id:"environment",label:"Environment",icon:_W}];function dv(){let[$,Z]=_L.useState(!1),[J,Q]=_L.useState("general");return z1.jsxs(z1.Fragment,{children:[z1.jsxs(r1,{children:[z1.jsx(a1,{render:z1.jsx(E0,{variant:"ghost",size:"icon-sm","aria-label":"Settings",onClick:()=>Z(!0),children:z1.jsx(KX,{stroke:1.75})})}),z1.jsx(n1,{children:"Settings"})]}),z1.jsx(p7,{open:$,onOpenChange:Z,children:z1.jsxs(HG,{className:"flex h-[min(680px,90vh)] w-[880px] max-w-[94vw]",children:[z1.jsx(c7,{className:"sr-only",children:"Space settings"}),z1.jsxs("nav",{className:"flex w-48 shrink-0 flex-col gap-0.5 border-r border-border bg-muted/30 p-3",children:[z1.jsx("p",{className:"px-2.5 pt-4 pb-2 text-[11px] font-semibold tracking-wider text-muted-foreground/80 uppercase",children:"Settings"}),E30.map((X)=>z1.jsxs(E0,{type:"button",variant:J===X.id?"secondary":"ghost",size:"sm",onClick:()=>Q(X.id),className:"justify-start",children:[z1.jsx(X.icon,{stroke:1.75}),X.label]},X.id))]}),z1.jsxs("div",{className:"relative scrollbar-thin min-w-0 flex-1 overflow-y-auto",children:[z1.jsxs("div",{className:"px-8 py-7",children:[J==="general"&&z1.jsx(cv,{}),J==="connectors"&&z1.jsx(Ch,{}),J==="environment"&&z1.jsx(uh,{})]}),z1.jsx(XG,{render:z1.jsx(E0,{variant:"ghost",size:"icon","aria-label":"Close",className:"absolute top-3 right-3",children:z1.jsx(Q8,{stroke:1.5})})})]})]})})]})}function I30($){if($.status==="available")return null;if($.status==="checking")return"this workspace's agent availability has not resolved yet";return"this workspace's agent is unavailable"}function lv({send:$,revealChat:Z,composerAvailability:J}){let Q=o5();Rz(Q,"sendChatMessage",(X)=>{let H=I30(J);if(H){Q2(Q,{source:"runtime",message:`sendChatMessage("${X.message}") was dropped: ${H}.`});return}let{message:G,...z}=X;Z(),$(G,{applet:z})})}var VZ=P(v(),1);var ov=P(v(),1);function jW($,Z){let J=$??[];if(J.findIndex((X)=>X.id===Z.id)===-1)return[...J,Z];return J.map((X)=>X.id===Z.id&&X.updatedAt<=Z.updatedAt?Z:X)}function CW($){let Z=s0();return s1((J)=>{if(J.type==="view-builder:updated"&&J.workspaceId===$)Z.setQueryData(j0.viewBuilders($),(Q)=>jW(Q,J.builder));else if(J.type==="view-builder:deleted"&&J.workspaceId===$)Z.setQueryData(j0.viewBuilders($),(Q)=>(Q??[]).filter((X)=>X.id!==J.builderId))}),$1({queryKey:j0.viewBuilders($),queryFn:async()=>{return(await D5(`/api/workspaces/${$}/view-builders`)).builders},...Y2})}function iv($){let Z=s0();return r5({mutationFn:()=>D5(`/api/workspaces/${$}/view-builders`,f1("POST"),"Failed to create view builder"),onSuccess:(J)=>{Z.setQueryData(j0.viewBuilders($),(Q)=>jW(Q,J))}})}function rv($){let Z=s0();return r5({mutationFn:({builderId:J,requirements:Q})=>D5(`/api/workspaces/${$}/view-builders/${J}`,f1("PATCH",{input:{requirements:Q}}),"Failed to save view requirements"),onSuccess:(J)=>{Z.setQueryData(j0.viewBuilders($),(Q)=>jW(Q,J))}})}function av($){let Z=s0();return r5({mutationFn:({builderId:J,requirements:Q,...X})=>D5(`/api/workspaces/${$}/view-builders/${J}/submit`,f1("POST",{input:{requirements:Q},availableIcons:YX,...X}),"Failed to start view builder"),onSuccess:(J)=>{Z.setQueryData(j0.viewBuilders($),(Q)=>jW(Q,J))}})}function nv($){let Z=s0();return r5({mutationFn:(J)=>L4(`/api/workspaces/${$}/view-builders/${J}`,{method:"DELETE"},"Failed to discard view builder"),onSuccess:(J,Q)=>{Z.setQueryData(j0.viewBuilders($),(X)=>(X??[]).filter((H)=>H.id!==Q))}})}var sv=new Map;function R30($){let Z=sv.get($)??[];return sv.delete($),Z}function k30($,Z=[]){return[...R30($),...Z]}function S30($,Z){if(!$.startsWith("view:"))return;return Object.keys(Z).length>0?Z:void 0}function b30($,Z,J){if($.startsWith("view:"))return Z?.find((Q)=>Q.id===$.slice(5))?.config.title||void 0;if($.startsWith("view-builder:"))return J?.find((Q)=>Q.id===$.slice(13))?.title||void 0;return}function tv({activeTab:$,appletParams:Z}){let J=o5(),Q=xz(J).data,X=CW(J).data;return ov.useCallback((H={})=>{let G=k30(J,H.directives??[]),z=S30($,Z);return{activeTab:$,tabTitle:b30($,Q,X),...z?{tabParams:z}:{},...H.applet?{applet:H.applet}:{},...G.length>0?{directives:G}:{}}},[J,$,Z,Q,X])}var ev=!0;function $f($,Z=[]){return($.trim()||Z.filter(Boolean).join(", ")).replace(/\s+/gu," ").trim().slice(0,64).trimEnd()}function OL($){return!$?.applet}function Zf($,Z,J){if(!OL(J))return[];return(M1.getState().attachments[S2($,Z)]??[]).filter((X)=>X.status==="ready"&&X.upload)}function TW({queryClient:$,workspaceId:Z,sessionId:J,parts:Q}){let X=`optimistic:${crypto.randomUUID()}`;return $.setQueryData(j0.events(Z,J),(H)=>GJ(H??HJ(),{kind:"turn",turn:{id:X,role:"user",origin:{kind:"user-input"},parts:Q,timestamp:new Date().toISOString()}})),M1.getState().setActivity(Z,J,"running"),M1.getState().setError(Z,J,null),X}function Jf({queryClient:$,workspaceId:Z,sessionId:J,text:Q,filenames:X=[]}){let H=$f(Q,X);if(!H)return;$.setQueryData(j0.sessions(Z),(G)=>[{sessionId:J,summary:H,lastModified:Date.now()},...(G??[]).filter((z)=>z.sessionId!==J)])}function EW($,Z,J,Q){let X=$?.models,H=!Z||!X||X.some((W)=>W.value===Z)?Z:void 0,G=X?.find((W)=>W.value===H),z=J&&(!G||(G.supportedEffortLevels??[]).includes(J))?J:void 0,Y=Q===void 0||!G||G.supportsFastMode?Q:!1,K=ev&&$?.supportsStreaming?!0:void 0;return{model:H,effort:z,...Y!==void 0?{fastMode:Y}:{},stream:K}}function y30($){return $.filter((Z)=>Z.text.length>0).map((Z)=>Z.kind==="reasoning"?{type:"reasoning",text:Z.text}:{type:"text",text:Z.text})}function Qf($){let Z=y30($?.blocks??[]);if(Z.length===0)return null;return{id:"live-preview",role:"assistant",origin:{kind:"user-input"},parts:Z}}var x30=HJ();function Xf($){let Z=o5(),J=s0(),{layout:Q}=d5(),[X,H]=s9(),G=X??null,z=m2(Z).data,Y=mz(Z).data,K=tv($),W=V4((D)=>G?D.activity[`${Z}:${G}`]??"idle":"idle"),B=QJ(W),q=V4((D)=>G?D.errors[`${Z}:${G}`]??null:null),U=NC(Z,G),F=U.data??x30,N=Y!==void 0&&(G===null||U.data!==void 0),L=V4((D)=>D.previews),V=VZ.useMemo(()=>Qf(w_(L,Z,G).root),[L,Z,G]),M=uz(Z,G).data,A=VZ.useCallback((D,T)=>{let k=D.trim(),x=Zf(Z,G,T);if(!k&&x.length===0)return;let I=G,y=!1;if(!I)I=crypto.randomUUID(),y=!0,H(I),Jf({queryClient:J,workspaceId:Z,sessionId:I,text:k,filenames:x.map((s)=>s.name)});let C=[];for(let s of x)if(s.upload?.kind==="image"&&s.previewUrl)C.push({type:"file",mediaType:s.mediaType,url:s.previewUrl,filename:s.name});else C.push({type:"file",mediaType:s.mediaType,url:"",filename:s.name});if(k)C.push({type:"text",text:k});let j=TW({queryClient:J,workspaceId:Z,sessionId:I,parts:C}),R=M?.model??Q.selectedModel,S=M?.effort??Q.selectedEffort,E=M?.fastMode??Q.selectedFastMode,{model:b,effort:g,fastMode:u,stream:w}=EW(z,R,S,E);if(rH({type:"chat",workspaceId:Z,content:k,sessionId:I,isNew:y,optimisticId:j,model:b,effort:g,fastMode:u,stream:w,context:K(T),...x.length>0?{attachments:x.map((s)=>s.upload.id)}:{}}),m1.getState().markMessageSentFromMoi(Z),y)J.invalidateQueries({queryKey:j0.preview(Z)});if(OL(T))M1.getState().clearAttachments(Z,G)},[G,Z,J,Q.selectedModel,Q.selectedEffort,Q.selectedFastMode,K,M?.model,M?.effort,M?.fastMode,H,z]),O=VZ.useCallback(()=>{if(!G)return;M1.getState().setError(Z,G,null)},[G,Z]),_=VZ.useCallback(()=>{if(!B||!G)return;rH({type:"stop",workspaceId:Z,sessionId:G})},[B,G,Z]);return{view:F,chatLoaded:N,previewTurn:V,sessionId:G,processing:B,error:q,send:A,stop:_,selectSession:H,dismissError:O}}var j9=P(v(),1);var Y1=P(l(),1);function Hf({builder:$,composerAvailability:Z,onSave:J,onSubmit:Q,onOpenChat:X,onDiscard:H}){let[G,z]=j9.useState($.input.requirements),[Y,K]=j9.useState(!1),[W,B]=j9.useState(null),q=j9.useRef(null),U=j9.useRef(J);U.current=J;let F=G.trim().length>0,N=v3(F,Y,Z);j9.useEffect(()=>{if($.status!=="draft"||G===$.input.requirements)return;let V=setTimeout(()=>{U.current(G).then(()=>B(null)).catch((M)=>B(M instanceof Error?M.message:"Could not save requirements"))},500);return()=>clearTimeout(V)},[$.input.requirements,$.status,G]);let L=async(V)=>{if(V.preventDefault(),!N)return;K(!0);try{await Q(G)}catch(M){B(M instanceof Error?M.message:"Could not start view builder"),K(!1)}};if($.status==="draft")return Y1.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center px-3 py-6",children:Y1.jsxs("div",{className:"flex w-full max-w-(--chat-max-container) flex-col gap-6",children:[Y1.jsxs("div",{className:"flex flex-col gap-1 text-center",children:[Y1.jsx("h1",{className:"font-medium",children:"What should this view do?"}),Y1.jsx("p",{className:"mx-auto max-w-sm text-sm text-muted-foreground",children:"Describe the content, data, and actions you need."})]}),Y1.jsxs(hz,{composerRef:q,onSubmit:L,children:[Y1.jsx("label",{className:"sr-only",htmlFor:`view-builder-${$.id}`,children:"View requirements"}),Y1.jsx(gz,{textareaRef:q,id:`view-builder-${$.id}`,value:G,onChange:(V)=>z(V.target.value),onKeyDown:(V)=>{if(V.key==="Enter"&&(V.metaKey||V.ctrlKey))V.preventDefault(),V.currentTarget.form?.requestSubmit()},placeholder:"Build a customer dashboard with…",rows:1,className:"min-h-16","aria-describedby":W?`view-builder-error-${$.id}`:void 0,"aria-invalid":Boolean(W),autoFocus:!0}),Y1.jsxs(vz,{children:[Y1.jsx(vY,{scope:"workspace"}),Y1.jsx(fz,{label:"Build view",hasContent:F,loading:Y,availability:Z})]})]}),W&&Y1.jsx("p",{id:`view-builder-error-${$.id}`,role:"alert",className:"text-sm text-destructive",children:W})]})});if($.status==="waiting")return Y1.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center p-6",children:Y1.jsxs("div",{className:"flex max-w-md flex-col items-center gap-4 text-center",children:[Y1.jsxs("div",{className:"flex flex-col gap-1",children:[Y1.jsx("h1",{className:"text-lg font-semibold",children:"The view needs your attention"}),Y1.jsx("p",{className:"text-sm text-muted-foreground",children:$.error??"Open its chat to answer or ask the agent to continue."})]}),Y1.jsxs("div",{className:"flex gap-2",children:[Y1.jsx(E0,{onClick:X,children:"Open chat"}),Y1.jsx(E0,{variant:"secondary",onClick:H,children:"Discard"})]})]})});return Y1.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center p-6",children:Y1.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[Y1.jsx(K2,{}),$.status==="ready"?"Opening view…":"Building view…"]})})}var Y4=P(v(),1);function Gf($,{activeId:Z,available:J,now:Q}){let X=[];if(Z!==null&&J.has(Z))X.push({id:Z,releasedAt:null});for(let H of $){if(H.id===Z||!J.has(H.id))continue;let G=H.releasedAt??Q;if(Q-G>=60000)continue;if(X.length>=4)break;X.push({id:H.id,releasedAt:G})}return X}function zf($,Z){let J=null;for(let{releasedAt:Q}of $){if(Q===null)continue;let X=Q+60000;if(J===null||X<J)J=X}return J===null?null:Math.max(0,J-Z)}function Yf($,Z){return $.length===Z.length&&$.every((J,Q)=>{let X=Z[Q];return J.id===X.id&&J.releasedAt===X.releasedAt})}var M8=P(l(),1);function Wf({views:$,activeViewId:Z,params:J}){let Q=h30(Z,$),X=new Set(Q.map((H)=>H.id));return M8.jsx("div",{className:e("relative min-h-0 flex-1 overflow-hidden",!Z&&"hidden"),children:$.filter((H)=>X.has(H.id)).map((H)=>M8.jsx(g30,{view:H,active:H.id===Z,params:J},H.id))})}function h30($,Z){let[J,Q]=Y4.useState([]),X=Y4.useRef(Z);X.current=Z;let H=Z.map((z)=>z.id).join(`
|
|
80
|
-
`),G=Y4.useCallback(()=>{Q((z)=>{let Y=Gf(z,{activeId:$,available:new Set(X.current.map((K)=>K.id)),now:Date.now()});return Yf(z,Y)?z:Y})},[$]);return Y4.useEffect(()=>{G()},[H,G]),Y4.useEffect(()=>{let z=zf(J,Date.now());if(z===null)return;let Y=setTimeout(G,z);return()=>clearTimeout(Y)},[G,J]),J}function g30({view:$,active:Z,params:J}){let Q=o5(),X=lj($.id),{current:H,outgoing:G}=f30(X,Z),[z,Y]=Y4.useState(J);if(Z&&z!==J)Y(J);oK(Sz("views",Q,$.id),H?.version??X.version,Z);let K=X.status==="error";return M8.jsxs(M8.Fragment,{children:[Z&&K&&M8.jsx("p",{className:"absolute inset-0 p-4 text-xs text-destructive",children:X.error}),Z&&!K&&!H&&M8.jsx(m30,{}),H&&!K&&M8.jsxs(Y4.Activity,{mode:Z?"visible":"hidden",children:[G&&M8.jsx(Kf,{view:$,build:G,params:z},G.version),M8.jsx(Kf,{view:$,build:H,params:z,entering:G!==null},H.version)]})]})}function Kf({view:$,build:Z,params:J,entering:Q}){let X=o5();return M8.jsx("div",{"data-applet":bz("views",$.id),className:e("absolute inset-0 overflow-auto",Q&&"animate-in duration-200 ease-out blur-in-4 fade-in"),children:M8.jsx(dQ,{name:$.id,kind:"view",workspaceId:X,resetKey:Z.version,children:M8.jsx(Z.Component,{params:J})})})}var v30=200;function f30($,Z){let[J,Q]=Y4.useState({current:null,outgoing:null});if($.status==="ready"&&J.current?.version!==$.version){let X={Component:$.Component,version:$.version};Q((H)=>({current:X,outgoing:Z?H.current:null}))}return Y4.useEffect(()=>{if(!J.outgoing)return;let X=setTimeout(()=>Q((H)=>({...H,outgoing:null})),v30);return()=>clearTimeout(X)},[J.outgoing]),J}function m30(){return M8.jsx("div",{className:"absolute inset-0 flex animate-in items-center justify-center delay-150 duration-200 fill-mode-both fade-in",children:M8.jsx(K2,{className:"text-muted-foreground"})})}function Bf(){let $=s0(),{workspaceId:Z,layout:J}=d5(),[,Q]=s9(),X=m2(Z).data,H=iv(Z),G=rv(Z),z=av(Z),Y=nv(Z);return{create:()=>H.mutateAsync(),save:(U,F)=>G.mutateAsync({builderId:U,requirements:F}),submit:async(U,F)=>{let N=F.trim();if(!N)return;let L=TW({queryClient:$,workspaceId:Z,sessionId:U.sessionId,parts:[{type:"text",text:N}]});Q(U.sessionId);let{model:V,effort:M,fastMode:A,stream:O}=EW(X,J.selectedModel,J.selectedEffort,J.selectedFastMode);try{await z.mutateAsync({builderId:U.id,requirements:N,optimisticId:L,model:V,effort:M,fastMode:A,stream:O})}catch(_){throw M1.getState().setActivity(Z,U.sessionId,"idle"),M1.getState().setError(Z,U.sessionId,_ instanceof Error?_.message:"Could not start view builder"),_}},discard:(U)=>Y.mutateAsync(U)}}var LZ=P(v(),1);function PL($){let Z=document.documentElement,J=getComputedStyle(Z).getPropertyValue($).trim(),Q=Number.parseFloat(J);if(!Number.isFinite(Q))return 0;return J.endsWith("rem")?Q*Number.parseFloat(getComputedStyle(Z).fontSize):Q}function qf(){let $=LZ.useRef(null),[Z,J]=LZ.useState(null);return LZ.useLayoutEffect(()=>{let Q=$.current;if(!Q)return;let X=(G)=>{let z=PL("--column-w"),Y=PL("--chat-min"),K=PL("--chat-max");J({fits:G-Y>=z,workspaceMinWidth:z,chatMinWidth:Y,chatMaxWidth:K})};X(Q.getBoundingClientRect().width);let H=new ResizeObserver(([G])=>{if(G)X(G.contentRect.width)});return H.observe(Q),()=>H.disconnect()},[]),{ref:$,fits:Z?.fits??!1,constraints:Z?{workspaceMinWidth:Z.workspaceMinWidth,chatMinWidth:Z.chatMinWidth,chatMaxWidth:Z.chatMaxWidth}:null}}var Ff=P(l(),1);function Uf({agentUnavailable:$,chatError:Z,skillUpdate:J}){return $??Z??J}function Y7({className:$,...Z}){return Ff.jsx("div",{...Z,className:e("w-full p-2 text-sm @xl:p-1 @xl:pl-3",$)})}var MZ=P(l(),1);function Nf({error:$,onDismiss:Z}){return MZ.jsxs(Y7,{role:"alert",className:"flex items-center gap-2 text-destructive",children:[MZ.jsx("span",{className:"flex-1 wrap-break-word",children:$}),MZ.jsx(E0,{type:"button",variant:"ghost",size:"icon-sm",onClick:Z,className:"text-destructive hover:text-destructive","aria-label":"Dismiss error",children:MZ.jsx(Q8,{stroke:1.75})})]})}var WX=P(v(),1);var C9=P(l(),1);function Lf({availability:$,login:Z,onStartLogin:J}){let[Q,X]=WX.useState("idle"),[H,G]=WX.useState(null);WX.useEffect(()=>{if(Z?.state!=="pending")X("idle")},[Z?.state]);let z=Z?.state==="pending"||Q==="waiting",Y=Z?.state==="failed"?Z.reason:null,K=z||Q==="starting",W=async()=>{let B=window.open("about:blank","moi-agent-login");if(B)B.opener=null;X("starting"),G(null);try{let q=await J();if(q.url){if(!B)throw Error("Allow pop-ups, then try again");B.location.href=q.url}else B?.close();X("waiting")}catch(q){B?.close(),X("idle"),G(q instanceof Error?q.message:"Could not start sign-in")}};return C9.jsxs(Y7,{role:"alert",className:"grid grid-cols-[auto_minmax(0,1fr)] gap-2 @xl:grid-cols-[auto_minmax(0,1fr)_auto] @xl:items-center",children:[C9.jsx(Vf,{size:20,stroke:1.5}),C9.jsxs("div",{className:"min-w-0 space-y-1",children:[C9.jsx("div",{className:"wrap-break-word",children:"Log in to your agent provider to send messages"}),(H??Y)&&C9.jsx("div",{className:"wrap-break-word text-destructive",children:H??Y})]}),$.loginCommand&&C9.jsxs(E0,{type:"button",size:"sm",onClick:()=>void W(),disabled:K,className:"col-span-2 w-fit @xl:col-span-1",children:[K&&C9.jsx(A1,{stroke:1.75,className:"animate-spin"}),Q==="starting"?"Opening browser to sign in…":z?"Waiting for log in…":"Log in"]})]})}var A8=P(l(),1);function Af({error:$,pendingAction:Z,onUpdate:J,onDismiss:Q}){if(!$&&Z==="auto")return A8.jsxs(Y7,{role:"status",className:"flex items-center gap-1.5 text-muted-foreground",children:[A8.jsx(A1,{size:20,stroke:1.5,className:"shrink-0 animate-spin"}),A8.jsx("span",{className:"wrap-break-word",children:"Updating moi skills…"})]});let X=Z!==null;return A8.jsxs(Y7,{role:$?"alert":"status",className:e("grid grid-cols-[minmax(0,1fr)_auto] gap-x-2 gap-y-2","@xl:flex @xl:items-center",$&&"text-destructive"),children:[A8.jsxs("div",{className:"flex min-w-0 items-start gap-1.5 @xl:order-1 @xl:flex-1 @xl:items-center",children:[A8.jsx(Mf,{size:20,stroke:1.5,className:"shrink-0"}),$?A8.jsx("span",{className:"wrap-break-word",children:`Update failed: ${$}`}):A8.jsx("span",{className:"wrap-break-word",children:"This workspace is using old moi skills"})]}),A8.jsx(E0,{type:"button",variant:"ghost",size:"icon-sm",onClick:Q,className:"col-start-2 row-start-1 -mt-1 -mr-1 text-muted-foreground hover:text-foreground @xl:order-4 @xl:m-0","aria-label":"Dismiss skill update",children:A8.jsx(Q8,{stroke:1.75})}),A8.jsxs("div",{className:"col-span-2 flex flex-wrap gap-1.5 @xl:contents",children:[A8.jsxs(E0,{type:"button",variant:"default",size:"sm",onClick:()=>J("auto"),disabled:X,className:"@xl:order-2",children:[Z==="auto"&&A8.jsx(A1,{stroke:1.75,className:"animate-spin"}),Z==="auto"?"Updating…":"Auto-update"]}),A8.jsxs(E0,{type:"button",variant:"secondary",size:"sm",onClick:()=>J("once"),disabled:X,className:"@xl:order-3",children:[Z==="once"&&A8.jsx(A1,{stroke:1.75,className:"animate-spin"}),Z==="once"?"Updating…":"Update once"]})]})]})}var c6=P(v(),1);function wL($){return{workspaceId:$,phase:"idle",pendingAction:null,error:null}}function u30($){return $.phase==="active"||$.phase==="idle"&&$.updateAvailable&&!$.autoUpdateEnabled}function p30($){return $.updateAvailable&&$.autoUpdateEnabled&&!$.updatePending&&$.phase==="idle"}function Df($){let Z=nj($),{isPending:J,mutate:Q,reset:X}=sj($),H=Sh(),{mutate:G}=bh(),z=H.data!==void 0,Y=H.data?.autoUpdateSkills??!1,K=c6.useCallback(()=>G({autoUpdateSkills:!0}),[G]),[W,B]=c6.useState(()=>wL($)),q=W.workspaceId===$?W:wL($);c6.useEffect(()=>{B(wL($)),X()},[$,X]);let U=c6.useCallback((L)=>{if(J)return;if(L==="auto")K();B({workspaceId:$,phase:"active",pendingAction:L,error:null}),Q(void 0,{onSuccess:()=>{B((V)=>V.workspaceId===$?{...V,phase:"dismissed",pendingAction:null,error:null}:V)},onError:(V)=>{B((M)=>M.workspaceId===$&&M.phase!=="dismissed"?{...M,phase:"active",pendingAction:null,error:V.message}:M)}})},[K,J,Q,$]),F=Z.data?.updateAvailable??!1;return c6.useEffect(()=>{if(z&&p30({updateAvailable:F,autoUpdateEnabled:Y,updatePending:J,phase:q.phase}))U("auto")},[Y,q.phase,U,z,F,J]),{bannerProps:z&&u30({updateAvailable:F,autoUpdateEnabled:Y,phase:q.phase})?{error:q.error,pendingAction:q.pendingAction,onUpdate:U,onDismiss:()=>{B((L)=>L.workspaceId===$?{...L,phase:"dismissed",pendingAction:null,error:null}:L)}}:null}}var IW=P(l(),1);function _f($,{chatError:Z,onDismissChatError:J}){let{data:Q,error:X}=m2($),H=Q?.availability,{bannerProps:G}=Df($),z=H?.available===!1?H:void 0;if(X)z={available:!1,reason:`Could not check agent status: ${X.message}`};let Y={status:"checking"};if(z)Y={status:"unavailable"};else if(H)Y={status:"available"};let K=z?{tone:"muted",content:IW.jsx(Lf,{availability:z,login:Q?.login,onStartLogin:()=>aj($)})}:void 0,W=Z?{tone:"destructive",content:IW.jsx(Nf,{error:Z,onDismiss:J})}:void 0,B=G?{tone:"muted",content:IW.jsx(Af,{...G})}:void 0,q=Uf({agentUnavailable:K,chatError:W,skillUpdate:B});return{composerAvailability:Y,composerBanner:q}}var jL=xU();function RW($){if(!$||!Array.isArray($.open))return jL;let Z=$.open.filter((J,Q,X)=>X.indexOf(J)===Q);if(Z.length===0)return jL;return{open:Z,active:Z.includes($.active)?$.active:Z[0]}}function BX($,Z,J){if($==="agent"||$==="widgets"||$==="scratchpad")return!0;let Q=g3($);if(Q)return J.some((H)=>H.id===Q);let X=N6($);return X?Z.some((H)=>H.id===X):!1}function kW($,Z,J){let Q=$.open.filter((X)=>BX(X,Z,J));return Q.length>0?Q:jL.open}function Of($){if(!$)return!1;let Z=$Q($);return Z===null||N6(Z)!==null}function Pf($,Z,J,Q,X){if($!==null&&BX($,J,Q)&&!(X&&$==="agent"))return $;let H=kW(Z,J,Q),G=X?H.filter((z)=>z!=="agent"):H;return G.includes(Z.active)?Z.active:G[0]??"agent"}var o2=P(v(),1);function wf({views:$,builders:Z,split:J}){let{layout:Q,setLayout:X,workspaceId:H}=d5(),[,G]=I4(),z=HB()["*"]??null,Y=CM(),K=o2.useMemo(()=>xj(Y),[Y]),W=RW(Q.tabs),B=o2.useRef(W);B.current=W;let q=$Q(z),U=Pf(q,W,$,Z,J),F=q!==null&&q===U,N=o2.useCallback((V,M)=>{G(yj(H,V),{replace:!0,...M?{state:{appletParams:M}}:{}})},[G,H]),L=o2.useCallback((V)=>{B.current=V,X({tabs:V})},[X]);return o2.useEffect(()=>{if(z===U)return;if(Of(z))c30(H,z,U);N(U)},[U,N,z,H]),o2.useEffect(()=>{if(!F)return;let V=B.current,M=V.open.includes(U)?V.open:[...V.open,U];if(M===V.open&&V.active===U)return;L({open:M,active:U})},[U,L,F]),{tabsState:W,activeTab:U,appletParams:K,navigateToTab:N,setTabs:L}}function c30($,Z,J){let Q=$Q(Z),X=Q?N6(Q):null;Q2($,{source:"runtime",...X?{kind:"view",name:X}:{},message:`Tab "${Z}" does not exist in this workspace — the URL redirected to "${J}". A link, bookmark, or focusTab call is pointing at a tab that was deleted or renamed.`})}var e5=P(l(),1),d30=Cf([yJ({variant:"ghost",size:"sm"}),"group/tab min-w-0"],{variants:{active:{true:"bg-accent text-accent-foreground"},dragging:{true:"invisible"},preview:{true:"cursor-grabbing ring-1 ring-border"}},compoundVariants:[{preview:!0}]});function l30({items:$}){return e5.jsxs(O$,{children:[e5.jsx(P$,{render:e5.jsx(E0,{type:"button",variant:"ghost",size:"icon-sm",className:"text-muted-foreground","aria-label":"Create tab",children:e5.jsx(e8,{stroke:1.75})})}),e5.jsx(w$,{align:"start",className:"min-w-48",children:e5.jsx(j$,{children:$.map(({key:Z,Icon:J,label:Q,onClick:X})=>e5.jsxs(HQ,{onClick:X,className:"font-medium",children:[e5.jsx(J,{stroke:2}),Q]},Z))})})]})}function jf($){let{tab:Z,active:J}=$,Q=$.preview===!0;return e5.jsxs("button",{type:"button","aria-hidden":Q||void 0,"aria-label":Z.label,disabled:Q,tabIndex:Q?-1:void 0,onClick:$.preview?void 0:()=>$.onSelect(Z.key),className:d30({active:J,dragging:$.preview?!1:$.state.isDragging,preview:Q}),...$.preview?{}:$.state.dragHandleProps,children:[e5.jsxs("div",{className:e("flex items-center gap-1 overflow-hidden select-none",Z.closable&&"group-hover/tab:mr-3"),children:[Z.Icon===q9?e5.jsx(q9,{"data-icon":"inline-start",stroke:2,animated:Z.loading}):Z.loading?e5.jsx(K2,{"data-icon":"inline-start"}):e5.jsx(Z.Icon,{"data-icon":"inline-start",stroke:2}),e5.jsx("span",{className:e("truncate",Z.closable&&"group-hover/tab:-mr-3 group-hover/tab:mask-r-from-[calc(100%-24px)] group-hover/tab:mask-r-to-[calc(100%-12px)]"),children:Z.label})]}),Z.closable&&e5.jsx("div",{"aria-label":`Close ${Z.label}`,tabIndex:Q?-1:void 0,className:e("absolute right-2 hidden size-3 items-center justify-center text-muted-foreground group-hover/tab:flex hover:text-foreground",Q&&"pointer-events-none"),onClick:$.preview?void 0:(X)=>{X.stopPropagation(),$.onClose(Z.key)},children:e5.jsx(Q8,{stroke:1.75})})]})}function Tf({tabs:$,active:Z,createItems:J,onSelect:Q,onClose:X,onReorder:H}){return e5.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-1",children:[e5.jsx("div",{className:"no-scrollbar min-w-0 scroll-fade-x overflow-x-auto overflow-y-hidden [--scroll-fade-reveal:16px]",children:e5.jsx(kG,{items:$,getId:(G)=>G.key,className:"flex w-max items-center gap-1",onReorder:(G)=>H(G),renderPlaceholder:()=>e5.jsx("div",{className:"pointer-events-none absolute inset-0 rounded-md bg-muted"}),renderOverlay:(G)=>e5.jsx(jf,{tab:G,active:Z===G.key,preview:!0}),renderItem:(G,z)=>e5.jsx(jf,{tab:G,active:Z===G.key,state:z,onSelect:Q,onClose:X})})}),e5.jsx("div",{className:"shrink-0",children:e5.jsx(l30,{items:J})})]})}var i6=P(v(),1);var PZ=P(l(),1),Y5=P(v(),1);function i30($,Z){let J=getComputedStyle($),Q=parseFloat(J.fontSize);return Z*Q}function r30($,Z){let J=getComputedStyle($.ownerDocument.documentElement),Q=parseFloat(J.fontSize);return Z*Q}function a30($){return $/100*window.innerHeight}function n30($){return $/100*window.innerWidth}function s30($){switch(typeof $){case"number":return[$,"px"];case"string":{let Z=parseFloat($);return $.endsWith("%")?[Z,"%"]:$.endsWith("px")?[Z,"px"]:$.endsWith("rem")?[Z,"rem"]:$.endsWith("em")?[Z,"em"]:$.endsWith("vh")?[Z,"vh"]:$.endsWith("vw")?[Z,"vw"]:[Z,"%"]}}}function qX({groupSize:$,panelElement:Z,styleProp:J}){let Q,[X,H]=s30(J);switch(H){case"%":{Q=X/100*$;break}case"px":{Q=X;break}case"rem":{Q=r30(Z,X);break}case"em":{Q=i30(Z,X);break}case"vh":{Q=a30(X);break}case"vw":{Q=n30(X);break}}return Q}function a8($){return parseFloat($.toFixed(3))}function wZ({group:$}){let{orientation:Z,panels:J}=$;return J.reduce((Q,X)=>(Q+=Z==="horizontal"?X.element.offsetWidth:X.element.offsetHeight,Q),0)}function TL($){let{panels:Z}=$,J=wZ({group:$});return J===0?Z.map((Q)=>({groupResizeBehavior:Q.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:Q.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:Q.panelConstraints.disabled,minSize:0,maxSize:100,panelId:Q.id})):Z.map((Q)=>{let{element:X,panelConstraints:H}=Q,G=0;if(H.collapsedSize!==void 0){let W=qX({groupSize:J,panelElement:X,styleProp:H.collapsedSize});G=a8(W/J*100)}let z;if(H.defaultSize!==void 0){let W=qX({groupSize:J,panelElement:X,styleProp:H.defaultSize});z=a8(W/J*100)}let Y=0;if(H.minSize!==void 0){let W=qX({groupSize:J,panelElement:X,styleProp:H.minSize});Y=a8(W/J*100)}let K=100;if(H.maxSize!==void 0){let W=qX({groupSize:J,panelElement:X,styleProp:H.maxSize});K=a8(W/J*100)}return{groupResizeBehavior:H.groupResizeBehavior,collapsedSize:G,collapsible:H.collapsible===!0,defaultSize:z,disabled:H.disabled,minSize:Y,maxSize:K,panelId:Q.id}})}function i5($,Z="Assertion error"){if(!$)throw Error(Z)}function EL($,Z){return Array.from(Z).sort($==="horizontal"?o30:t30)}function o30($,Z){let J=$.element.offsetLeft-Z.element.offsetLeft;return J!==0?J:$.element.offsetWidth-Z.element.offsetWidth}function t30($,Z){let J=$.element.offsetTop-Z.element.offsetTop;return J!==0?J:$.element.offsetHeight-Z.element.offsetHeight}function lf($){return $!==null&&typeof $=="object"&&"nodeType"in $&&$.nodeType===Node.ELEMENT_NODE}function rf($,Z){return{x:$.x>=Z.left&&$.x<=Z.right?0:Math.min(Math.abs($.x-Z.left),Math.abs($.x-Z.right)),y:$.y>=Z.top&&$.y<=Z.bottom?0:Math.min(Math.abs($.y-Z.top),Math.abs($.y-Z.bottom))}}function e30({orientation:$,rects:Z,targetRect:J}){let Q={x:J.x+J.width/2,y:J.y+J.height/2},X,H=Number.MAX_VALUE;for(let G of Z){let{x:z,y:Y}=rf(Q,G),K=$==="horizontal"?z:Y;K<H&&(H=K,X=G)}return i5(X,"No rect found"),X}var SW;function $70(){return SW===void 0&&(typeof matchMedia=="function"?SW=!!matchMedia("(pointer:coarse)").matches:SW=!1),SW}function af($){let{element:Z,orientation:J,panels:Q,separators:X}=$,H=EL(J,Array.from(Z.children).filter(lf).map((F)=>({element:F}))).map(({element:F})=>F),G=[],z=!1,Y=!1,K=-1,W=-1,B=0,q,U=[];{let F=-1;for(let N of H)N.hasAttribute("data-panel")&&(F++,N.hasAttribute("data-disabled")||(B++,K===-1&&(K=F),W=F))}if(B>1){let F=-1;for(let N of H)if(N.hasAttribute("data-panel")){F++;let L=Q.find((V)=>V.element===N);if(L){if(q){let V=q.element.getBoundingClientRect(),M=N.getBoundingClientRect(),A;if(Y){let O=J==="horizontal"?new DOMRect(V.right,V.top,0,V.height):new DOMRect(V.left,V.bottom,V.width,0),_=J==="horizontal"?new DOMRect(M.left,M.top,0,M.height):new DOMRect(M.left,M.top,M.width,0);switch(U.length){case 0:{A=[O,_];break}case 1:{let D=U[0],T=e30({orientation:J,rects:[V,M],targetRect:D.element.getBoundingClientRect()});A=[D,T===V?_:O];break}default:{A=U;break}}}else U.length?A=U:A=[J==="horizontal"?new DOMRect(V.right,M.top,M.left-V.right,M.height):new DOMRect(M.left,V.bottom,M.width,M.top-V.bottom)];for(let O of A){let _="width"in O?O:O.element.getBoundingClientRect(),D=$70()?$.resizeTargetMinimumSize.coarse:$.resizeTargetMinimumSize.fine;if(_.width<D){let k=D-_.width;_=new DOMRect(_.x-k/2,_.y,_.width+k,_.height)}if(_.height<D){let k=D-_.height;_=new DOMRect(_.x,_.y-k/2,_.width,_.height+k)}let T=F<=K||F>W;!z&&!T&&G.push({group:$,groupSize:wZ({group:$}),panels:[q,L],separator:"width"in O?void 0:O,rect:_}),z=!1}}Y=!1,q=L,U=[]}}else if(N.hasAttribute("data-separator")){N.ariaDisabled!==null&&(z=!0);let L=X.find((V)=>V.element===N);L?U.push(L):(q=void 0,U=[])}else Y=!0}return G}class IL{#$={};addListener($,Z){let J=this.#$[$];return J===void 0?this.#$[$]=[Z]:J.includes(Z)||J.push(Z),()=>{this.removeListener($,Z)}}emit($,Z){let J=this.#$[$];if(J!==void 0)if(J.length===1)J[0].call(null,Z);else{let Q=!1,X=null,H=Array.from(J);for(let G=0;G<H.length;G++){let z=H[G];try{z.call(null,Z)}catch(Y){X===null&&(Q=!0,X=Y)}}if(Q)throw X}}removeAllListeners(){this.#$={}}removeListener($,Z){let J=this.#$[$];if(J!==void 0){let Q=J.indexOf(Z);Q>=0&&J.splice(Q,1)}}}var _Z={cursorFlags:0,state:"inactive"},RL=new IL;function W7(){return _Z}function Z70($){return RL.addListener("change",$)}function J70($){let Z=_Z,J={..._Z};J.cursorFlags=$,_Z=J,RL.emit("change",{prev:Z,next:J})}function OZ($){let Z=_Z;_Z=$,RL.emit("change",{prev:Z,next:$})}var Q70=($)=>$,CL=()=>{},nf=1,sf=2,of=4,tf=8,Ef=3,If=12,bW;function Rf(){return bW===void 0&&(bW=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(bW=!0)),bW}function X70({cursorFlags:$,groups:Z,state:J}){let Q=0,X=0;switch(J){case"active":case"hover":Z.forEach((H)=>{if(!H.mutableState.disableCursor)switch(H.orientation){case"horizontal":{Q++;break}case"vertical":{X++;break}}})}if(!(Q===0&&X===0)){switch(J){case"active":{if($&&Rf()){let H=($&nf)!==0,G=($&sf)!==0,z=($&of)!==0,Y=($&tf)!==0;if(H)return z?"se-resize":Y?"ne-resize":"e-resize";if(G)return z?"sw-resize":Y?"nw-resize":"w-resize";if(z)return"s-resize";if(Y)return"n-resize"}break}}return Rf()?Q>0&&X>0?"move":Q>0?"ew-resize":"ns-resize":Q>0&&X>0?"grab":Q>0?"col-resize":"row-resize"}}var kf=new WeakMap;function kL($){if($.defaultView===null||$.defaultView===void 0)return;let{prevStyle:Z,styleSheet:J}=kf.get($)??{};J===void 0&&(J=new $.defaultView.CSSStyleSheet,$.adoptedStyleSheets&&(Object.isExtensible($.adoptedStyleSheets)?$.adoptedStyleSheets.push(J):$.adoptedStyleSheets=[...$.adoptedStyleSheets,J]));let Q=W7();switch(Q.state){case"active":case"hover":{let X=X70({cursorFlags:Q.cursorFlags,groups:Q.hitRegions.map((G)=>G.group),state:Q.state}),H=`*, *:hover {cursor: ${X} !important; }`;if(Z===H)return;Z=H,X?J.cssRules.length===0?J.insertRule(H):J.replaceSync(H):J.cssRules.length===1&&J.deleteRule(0);break}case"inactive":{Z=void 0,J.cssRules.length===1&&J.deleteRule(0);break}}kf.set($,{prevStyle:Z,styleSheet:J})}var e2=new Map,ef=new IL;function H70($){e2=new Map(e2),e2.delete($)}function Sf($,Z){for(let[J]of e2)if(J.id===$)return J}function d6($,Z){for(let[J,Q]of e2)if(J.id===$)return Q;if(Z)throw Error(`Could not find data for Group with id ${$}`)}function U7(){return e2}function SL($,Z){return ef.addListener("groupChange",(J)=>{J.group.id===$&&Z(J)})}function T9($,Z,J){let Q=e2.get($);e2=new Map(e2),e2.set($,Z),ef.emit("groupChange",{group:$,isUserInteraction:J?.isUserInteraction===!0,prev:Q,next:Z})}function $m($){let Z=W7(),J=!1;switch(Z.state){case"active":OZ({cursorFlags:0,state:"inactive"}),Z.hitRegions.length>0&&(kL($),J=!0,Z.hitRegions.forEach((Q)=>{let X=d6(Q.group.id,!0);T9(Q.group,X,{isUserInteraction:!0})}))}return J}function bf($){$.defaultPrevented||$m($.currentTarget)}function G70($,Z,J){let Q,X={x:1/0,y:1/0};for(let H of Z){let G=rf(J,H.rect);switch($){case"horizontal":{G.x<=X.x&&(Q=H,X=G);break}case"vertical":{G.y<=X.y&&(Q=H,X=G);break}}}return Q?{distance:X,hitRegion:Q}:void 0}function z70($){return $!==null&&typeof $=="object"&&"nodeType"in $&&$.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function Y70($,Z){if($===Z)throw Error("Cannot compare node with itself");let J={a:hf($),b:hf(Z)},Q;for(;J.a.at(-1)===J.b.at(-1);)Q=J.a.pop(),J.b.pop();i5(Q,"Stacking order can only be calculated for elements with a common ancestor");let X={a:xf(yf(J.a)),b:xf(yf(J.b))};if(X.a===X.b){let H=Q.childNodes,G={a:J.a.at(-1),b:J.b.at(-1)},z=H.length;for(;z--;){let Y=H[z];if(Y===G.a)return 1;if(Y===G.b)return-1}}return Math.sign(X.a-X.b)}var K70=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function W70($){let Z=getComputedStyle(Zm($)??$).display;return Z==="flex"||Z==="inline-flex"}function B70($){let Z=getComputedStyle($);return!!(Z.position==="fixed"||Z.zIndex!=="auto"&&(Z.position!=="static"||W70($))||+Z.opacity<1||("transform"in Z)&&Z.transform!=="none"||("webkitTransform"in Z)&&Z.webkitTransform!=="none"||("mixBlendMode"in Z)&&Z.mixBlendMode!=="normal"||("filter"in Z)&&Z.filter!=="none"||("webkitFilter"in Z)&&Z.webkitFilter!=="none"||("isolation"in Z)&&Z.isolation==="isolate"||K70.test(Z.willChange)||Z.webkitOverflowScrolling==="touch")}function yf($){let Z=$.length;for(;Z--;){let J=$[Z];if(i5(J,"Missing node"),B70(J))return J}return null}function xf($){return $&&Number(getComputedStyle($).zIndex)||0}function hf($){let Z=[];for(;$;)Z.push($),$=Zm($);return Z}function Zm($){let{parentNode:Z}=$;return z70(Z)?Z.host:Z}function q70($,Z){return $.x<Z.x+Z.width&&$.x+$.width>Z.x&&$.y<Z.y+Z.height&&$.y+$.height>Z.y}function U70({groupElement:$,hitRegion:Z,pointerEventTarget:J}){if(!lf(J)||J.contains($)||$.contains(J))return!0;if(Y70(J,$)>0){let Q=J;for(;Q;){if(Q.contains($))return!0;if(q70(Q.getBoundingClientRect(),Z))return!1;Q=Q.parentElement}}return!0}function bL($,Z){let J=[];return Z.forEach((Q,X)=>{if(X.disabled)return;let H=af(X),G=G70(X.orientation,H,{x:$.clientX,y:$.clientY});G&&G.distance.x<=0&&G.distance.y<=0&&U70({groupElement:X.element,hitRegion:G.hitRegion.rect,pointerEventTarget:$.target})&&J.push(G.hitRegion)}),J}function F70($,Z){if($.length!==Z.length)return!1;for(let J=0;J<$.length;J++)if($[J]!=Z[J])return!1;return!0}function v8($,Z,J=0){return Math.abs(a8($)-a8(Z))<=J}function t2($,Z){return v8($,Z)?0:$>Z?1:-1}function DZ({overrideDisabledPanels:$,panelConstraints:Z,prevSize:J,size:Q}){let{collapsedSize:X=0,collapsible:H,disabled:G,maxSize:z=100,minSize:Y=0}=Z;if(G&&!$)return J;if(t2(Q,Y)<0)if(H){let K=(X+Y)/2;t2(Q,K)<0?Q=X:Q=Y}else Q=Y;return Q=Math.min(z,Q),Q=a8(Q),Q}function FX({delta:$,initialLayout:Z,panelConstraints:J,pivotIndices:Q,prevLayout:X,trigger:H}){if(v8($,0))return Z;let G=H==="imperative-api",z=Object.values(Z),Y=Object.values(X),K=[...z],[W,B]=Q;i5(W!=null,"Invalid first pivot index"),i5(B!=null,"Invalid second pivot index");let q=0;switch(H){case"keyboard":{{let N=$<0?B:W,L=J[N];i5(L,`Panel constraints not found for index ${N}`);let{collapsedSize:V=0,collapsible:M,minSize:A=0}=L;if(M){let O=z[N];if(i5(O!=null,`Previous layout not found for panel index ${N}`),v8(O,V)){let _=A-O;t2(_,Math.abs($))>0&&($=$<0?0-_:_)}}}{let N=$<0?W:B,L=J[N];i5(L,`No panel constraints found for index ${N}`);let{collapsedSize:V=0,collapsible:M,minSize:A=0}=L;if(M){let O=z[N];if(i5(O!=null,`Previous layout not found for panel index ${N}`),v8(O,A)){let _=O-V;t2(_,Math.abs($))>0&&($=$<0?0-_:_)}}}break}default:{let N=$<0?B:W,L=J[N];i5(L,`Panel constraints not found for index ${N}`);let V=z[N],{collapsible:M,collapsedSize:A,minSize:O}=L;if(M&&t2(V,O)<0)if($>0){let _=O-A,D=_/2,T=V+$;t2(T,O)<0&&($=t2($,D)<=0?0:_)}else{let _=O-A,D=100-_/2,T=V-$;t2(T,O)<0&&($=t2(100+$,D)>0?0:-_)}break}}{let N=$<0?1:-1,L=$<0?B:W,V=0;for(;;){let A=z[L];i5(A!=null,`Previous layout not found for panel index ${L}`);let O=DZ({overrideDisabledPanels:G,panelConstraints:J[L],prevSize:A,size:100})-A;if(V+=O,L+=N,L<0||L>=J.length)break}let M=Math.min(Math.abs($),Math.abs(V));$=$<0?0-M:M}{let N=$<0?W:B;for(;N>=0&&N<J.length;){let L=Math.abs($)-Math.abs(q),V=z[N];i5(V!=null,`Previous layout not found for panel index ${N}`);let M=V-L,A=DZ({overrideDisabledPanels:G,panelConstraints:J[N],prevSize:V,size:M});if(!v8(V,A)&&(q+=V-A,K[N]=A,q.toFixed(3).localeCompare(Math.abs($).toFixed(3),void 0,{numeric:!0})>=0))break;$<0?N--:N++}}if(F70(Y,K))return X;{let N=$<0?B:W,L=z[N];i5(L!=null,`Previous layout not found for panel index ${N}`);let V=L+q,M=DZ({overrideDisabledPanels:G,panelConstraints:J[N],prevSize:L,size:V});if(K[N]=M,!v8(M,V)){let A=V-M,O=$<0?B:W;for(;O>=0&&O<J.length;){let _=K[O];i5(_!=null,`Previous layout not found for panel index ${O}`);let D=_+A,T=DZ({overrideDisabledPanels:G,panelConstraints:J[O],prevSize:_,size:D});if(v8(_,T)||(A-=T-_,K[O]=T),v8(A,0))break;$>0?O--:O++}}}let U=Object.values(K).reduce((N,L)=>L+N,0);if(!v8(U,100,0.1))return X;let F=Object.keys(X);return K.reduce((N,L,V)=>(N[F[V]]=L,N),{})}function B7($,Z){if(Object.keys($).length!==Object.keys(Z).length)return!1;for(let J in $)if(Z[J]===void 0||t2($[J],Z[J])!==0)return!1;return!0}function q7({layout:$,panelConstraints:Z}){let J=Object.values($),Q=[...J],X=Q.reduce((z,Y)=>z+Y,0);if(Q.length!==Z.length)throw Error(`Invalid ${Z.length} panel layout: ${Q.map((z)=>`${z}%`).join(", ")}`);if(!v8(X,100)&&Q.length>0)for(let z=0;z<Z.length;z++){let Y=Q[z];i5(Y!=null,`No layout data found for index ${z}`);let K=100/X*Y;Q[z]=K}let H=0;for(let z=0;z<Z.length;z++){let Y=J[z];i5(Y!=null,`No layout data found for index ${z}`);let K=Q[z];i5(K!=null,`No layout data found for index ${z}`);let W=DZ({overrideDisabledPanels:!0,panelConstraints:Z[z],prevSize:Y,size:K});K!=W&&(H+=K-W,Q[z]=W)}if(!v8(H,0))for(let z=0;z<Z.length;z++){let Y=Q[z];i5(Y!=null,`No layout data found for index ${z}`);let K=Y+H,W=DZ({overrideDisabledPanels:!0,panelConstraints:Z[z],prevSize:Y,size:K});if(Y!==W&&(H-=W-Y,Q[z]=W,v8(H,0)))break}let G=Object.keys($);return Q.reduce((z,Y,K)=>(z[G[K]]=Y,z),{})}function Jm({groupId:$,panelId:Z}){let J=()=>{let Y=U7();for(let[K,{defaultLayoutDeferred:W,derivedPanelConstraints:B,layout:q,groupSize:U,separatorToPanels:F}]of Y)if(K.id===$)return{defaultLayoutDeferred:W,derivedPanelConstraints:B,group:K,groupSize:U,layout:q,separatorToPanels:F};throw Error(`Group ${$} not found`)},Q=()=>{let Y=J().derivedPanelConstraints.find((K)=>K.panelId===Z);if(Y!==void 0)return Y;throw Error(`Panel constraints not found for Panel ${Z}`)},X=()=>{let Y=J().group.panels.find((K)=>K.id===Z);if(Y!==void 0)return Y;throw Error(`Layout not found for Panel ${Z}`)},H=()=>{let Y=J().layout[Z];if(Y!==void 0)return Y;throw Error(`Layout not found for Panel ${Z}`)},G=({nextSize:Y,panels:K,prevLayout:W,derivedPanelConstraints:B})=>{let q=H(),U=K.findIndex((L)=>L.id===Z),F=U===0,N=U===K.length-1;if(N&&Y<q&&(F||K.slice(0,U).every((L,V)=>{let M=B[V];return M?.collapsible&&v8(M.collapsedSize,W[M.panelId])}))){let L=K.slice(0,U).reduce((V,M)=>V+W[M.id],0);return{...W,[Z]:a8(100-L)}}return FX({delta:N?q-Y:Y-q,initialLayout:W,panelConstraints:B,pivotIndices:N?[U-1,U]:[U,U+1],prevLayout:W,trigger:"imperative-api"})},z=(Y)=>{let K=H();if(Y===K)return;let{defaultLayoutDeferred:W,derivedPanelConstraints:B,group:q,groupSize:U,layout:F,separatorToPanels:N}=J(),L=G({nextSize:Y,panels:q.panels,prevLayout:F,derivedPanelConstraints:B}),V=q7({layout:L,panelConstraints:B});B7(F,V)||T9(q,{defaultLayoutDeferred:W,derivedPanelConstraints:B,groupSize:U,layout:V,separatorToPanels:N})};return{collapse:()=>{let{collapsible:Y,collapsedSize:K}=Q(),{mutableValues:W}=X(),B=H();Y&&B!==K&&(W.expandToSize=B,z(K))},expand:()=>{let{collapsible:Y,collapsedSize:K,minSize:W}=Q(),{mutableValues:B}=X(),q=H();if(Y&&q===K){let U=B.expandToSize??W;U===0&&(U=1),z(U)}},getSize:()=>{let{group:Y}=J(),K=H(),{element:W}=X(),B=Y.orientation==="horizontal"?W.offsetWidth:W.offsetHeight;return{asPercentage:K,inPixels:B}},isCollapsed:()=>{let{collapsible:Y,collapsedSize:K}=Q(),W=H();return Y&&v8(K,W)},resize:(Y)=>{let{group:K}=J(),{element:W}=X(),B=wZ({group:K}),q=qX({groupSize:B,panelElement:W,styleProp:Y}),U=a8(q/B*100);z(U)}}}function gf($){if($.defaultPrevented)return;let Z=U7();bL($,Z).forEach((J)=>{if(J.separator&&!J.separator.disableDoubleClick){let Q=J.panels.find((X)=>X.panelConstraints.defaultSize!==void 0);if(Q){let X=Q.panelConstraints.defaultSize,H=Jm({groupId:J.group.id,panelId:Q.id});H&&X!==void 0&&(H.resize(X),$.preventDefault())}}})}function yW($){let Z=U7();for(let[J]of Z)if(J.separators.some((Q)=>Q.element===$))return J;throw Error("Could not find parent Group for separator element")}function Qm({groupId:$}){let Z=()=>{let J=U7();for(let[Q,X]of J)if(Q.id===$)return{group:Q,...X};throw Error(`Could not find Group with id "${$}"`)};return{getLayout(){let{defaultLayoutDeferred:J,layout:Q}=Z();return J?{}:Q},setLayout(J){let{defaultLayoutDeferred:Q,derivedPanelConstraints:X,group:H,groupSize:G,layout:z,separatorToPanels:Y}=Z(),K=q7({layout:J,panelConstraints:X});return Q?z:(B7(z,K)||T9(H,{defaultLayoutDeferred:Q,derivedPanelConstraints:X,groupSize:G,layout:K,separatorToPanels:Y}),K)}}}function K7($,Z){let J=yW($),Q=d6(J.id,!0),X=J.separators.find((W)=>W.element===$);i5(X,"Matching separator not found");let H=Q.separatorToPanels.get(X);i5(H,"Matching panels not found");let G=H.map((W)=>J.panels.indexOf(W)),z=Qm({groupId:J.id}).getLayout(),Y=FX({delta:Z,initialLayout:z,panelConstraints:Q.derivedPanelConstraints,pivotIndices:G,prevLayout:z,trigger:"keyboard"}),K=q7({layout:Y,panelConstraints:Q.derivedPanelConstraints});B7(z,K)||T9(J,{defaultLayoutDeferred:Q.defaultLayoutDeferred,derivedPanelConstraints:Q.derivedPanelConstraints,groupSize:Q.groupSize,layout:K,separatorToPanels:Q.separatorToPanels},{isUserInteraction:!0})}function vf($){if($.defaultPrevented)return;let Z=$.currentTarget,J=yW(Z);if(!J.disabled)switch($.key){case"ArrowDown":{$.preventDefault(),J.orientation==="vertical"&&K7(Z,5);break}case"ArrowLeft":{$.preventDefault(),J.orientation==="horizontal"&&K7(Z,-5);break}case"ArrowRight":{$.preventDefault(),J.orientation==="horizontal"&&K7(Z,5);break}case"ArrowUp":{$.preventDefault(),J.orientation==="vertical"&&K7(Z,-5);break}case"End":{$.preventDefault(),K7(Z,100);break}case"Enter":{$.preventDefault();let Q=yW(Z),X=d6(Q.id,!0),{derivedPanelConstraints:H,layout:G,separatorToPanels:z}=X,Y=Q.separators.find((q)=>q.element===Z);i5(Y,"Matching separator not found");let K=z.get(Y);i5(K,"Matching panels not found");let W=K[0],B=H.find((q)=>q.panelId===W.id);if(i5(B,"Panel metadata not found"),B.collapsible){let q=G[W.id],U=B.collapsedSize===q?Q.mutableState.expandedPanelSizes[W.id]??B.minSize:B.collapsedSize;K7(Z,U-q)}break}case"F6":{$.preventDefault();let Q=yW(Z).separators.map((G)=>G.element),X=Array.from(Q).findIndex((G)=>G===$.currentTarget);i5(X!==null,"Index not found");let H=$.shiftKey?X>0?X-1:Q.length-1:X+1<Q.length?X+1:0;Q[H].focus({preventScroll:!0});break}case"Home":{$.preventDefault(),K7(Z,-100);break}}}function ff($){if($.defaultPrevented)return;if($.pointerType==="mouse"&&$.button>0)return;let Z=U7(),J=bL($,Z),Q=new Map,X=!1;J.forEach((H)=>{H.separator&&(X||(X=!0,H.separator.element.focus({focusVisible:!1,preventScroll:!0})));let G=Z.get(H.group);G&&Q.set(H.group,G.layout)}),OZ({cursorFlags:0,hitRegions:J,initialLayoutMap:Q,pointerDownAtPoint:{x:$.clientX,y:$.clientY},state:"active"}),J.length&&$.preventDefault()}function Xm({document:$,event:Z,hitRegions:J,initialLayoutMap:Q,mountedGroups:X,pointerDownAtPoint:H,prevCursorFlags:G}){let z=0;J.forEach((K)=>{let{group:W,groupSize:B}=K,{orientation:q,panels:U}=W,{disableCursor:F}=W.mutableState,N=0;H?q==="horizontal"?N=(Z.clientX-H.x)/B*100:N=(Z.clientY-H.y)/B*100:q==="horizontal"?N=Z.clientX<0?-100:100:N=Z.clientY<0?-100:100;let L=Q.get(W),V=X.get(W);if(!L||!V)return;let{defaultLayoutDeferred:M,derivedPanelConstraints:A,groupSize:O,layout:_,separatorToPanels:D}=V;if(A&&_&&D){let T=FX({delta:N,initialLayout:L,panelConstraints:A,pivotIndices:K.panels.map((k)=>U.indexOf(k)),prevLayout:_,trigger:"mouse-or-touch"});if(B7(T,_)){if(N!==0&&!F)switch(q){case"horizontal":{z|=N<0?nf:sf;break}case"vertical":{z|=N<0?of:tf;break}}}else T9(K.group,{defaultLayoutDeferred:M,derivedPanelConstraints:A,groupSize:O,layout:T,separatorToPanels:D})}});let Y=0;Z.movementX===0?Y|=G&Ef:Y|=z&Ef,Z.movementY===0?Y|=G&If:Y|=z&If,J70(Y),kL($)}function mf($){let Z=U7(),J=W7();switch(J.state){case"active":Xm({document:$.currentTarget,event:$,hitRegions:J.hitRegions,initialLayoutMap:J.initialLayoutMap,mountedGroups:Z,prevCursorFlags:J.cursorFlags})}}function uf($){if($.defaultPrevented)return;let Z=W7(),J=U7();switch(Z.state){case"active":{if($.buttons===0){OZ({cursorFlags:0,state:"inactive"}),Z.hitRegions.forEach((Q)=>{let X=d6(Q.group.id,!0);T9(Q.group,X,{isUserInteraction:!0})});return}for(let Q of Z.hitRegions)if(Q.separator){let{element:X}=Q.separator;X.hasPointerCapture?.($.pointerId)||X.setPointerCapture?.($.pointerId)}Xm({document:$.currentTarget,event:$,hitRegions:Z.hitRegions,initialLayoutMap:Z.initialLayoutMap,mountedGroups:J,pointerDownAtPoint:Z.pointerDownAtPoint,prevCursorFlags:Z.cursorFlags});break}default:{let Q=bL($,J);Q.length===0?Z.state!=="inactive"&&OZ({cursorFlags:0,state:"inactive"}):OZ({cursorFlags:0,hitRegions:Q,state:"hover"}),kL($.currentTarget);break}}}function pf($){if($.relatedTarget instanceof HTMLIFrameElement)switch(W7().state){case"hover":OZ({cursorFlags:0,state:"inactive"})}}function cf($){if($.defaultPrevented)return;if($.pointerType==="mouse"&&$.button>0)return;$m($.currentTarget)&&$.preventDefault()}function df($){let Z=0,J=0,Q={};for(let H of $)if(H.defaultSize!==void 0){Z++;let G=a8(H.defaultSize);J+=G,Q[H.panelId]=G}else Q[H.panelId]=void 0;let X=$.length-Z;if(X!==0){let H=a8((100-J)/X);for(let G of $)G.defaultSize===void 0&&(Q[G.panelId]=H)}return Q}function N70($,Z,J){if(!J[0])return;let Q=$.panels.find((Y)=>Y.element===Z);if(!Q||!Q.onResize)return;let X=wZ({group:$}),H=$.orientation==="horizontal"?Q.element.offsetWidth:Q.element.offsetHeight,G=Q.mutableValues.prevSize,z={asPercentage:a8(H/X*100),inPixels:H};Q.mutableValues.prevSize=z,Q.onResize(z,Q.id,G)}function V70($,Z){if(Object.keys($).length!==Object.keys(Z).length)return!1;for(let J in $)if($[J]!==Z[J])return!1;return!0}function L70({group:$,nextGroupSize:Z,prevGroupSize:J,prevLayout:Q}){if(J<=0||Z<=0||J===Z)return Q;let X=0,H=0,G=!1,z=new Map,Y=[];for(let B of $.panels){let q=Q[B.id]??0;switch(B.panelConstraints.groupResizeBehavior){case"preserve-pixel-size":{G=!0;let U=q/100*J,F=a8(U/Z*100);z.set(B.id,F),X+=F;break}case"preserve-relative-size":default:{Y.push(B.id),H+=q;break}}}if(!G||Y.length===0)return Q;let K=100-X,W={...Q};if(z.forEach((B,q)=>{W[q]=B}),H>0)for(let B of Y){let q=Q[B]??0;W[B]=a8(q/H*K)}else{let B=a8(K/Y.length);for(let q of Y)W[q]=B}return W}function M70($,Z){let J=$.map((X)=>X.id),Q=Object.keys(Z);if(J.length!==Q.length)return!1;for(let X of J)if(!Q.includes(X))return!1;return!0}var AZ=new Map;function A70($){let Z=!0;i5($.element.ownerDocument.defaultView,"Cannot register an unmounted Group");let J=$.element.ownerDocument.defaultView.ResizeObserver,Q=new Set,X=new Set,H=new J((F)=>{for(let N of F){let{borderBoxSize:L,target:V}=N;if(V===$.element){if(Z){let M=wZ({group:$});if(M===0)return;let A=d6($.id);if(!A)return;let O=TL($),_=A.defaultLayoutDeferred?df(O):A.layout,D=L70({group:$,nextGroupSize:M,prevGroupSize:A.groupSize,prevLayout:_}),T=q7({layout:D,panelConstraints:O});if(!A.defaultLayoutDeferred&&B7(A.layout,T)&&V70(A.derivedPanelConstraints,O)&&A.groupSize===M)return;T9($,{defaultLayoutDeferred:!1,derivedPanelConstraints:O,groupSize:M,layout:T,separatorToPanels:A.separatorToPanels})}}else N70($,V,L)}});H.observe($.element),$.panels.forEach((F)=>{i5(!Q.has(F.id),`Panel ids must be unique; id "${F.id}" was used more than once`),Q.add(F.id),F.onResize&&H.observe(F.element)});let G=wZ({group:$}),z=TL($),Y=$.panels.map(({id:F})=>F).join(","),K=$.mutableState.defaultLayout;K&&(M70($.panels,K)||(K=void 0));let W=$.mutableState.layouts[Y]??K??df(z),B=q7({layout:W,panelConstraints:z}),q=$.element.ownerDocument;AZ.set(q,(AZ.get(q)??0)+1);let U=new Map;return af($).forEach((F)=>{F.separator&&U.set(F.separator,F.panels)}),T9($,{defaultLayoutDeferred:G===0,derivedPanelConstraints:z,groupSize:G,layout:B,separatorToPanels:U}),$.separators.forEach((F)=>{i5(!X.has(F.id),`Separator ids must be unique; id "${F.id}" was used more than once`),X.add(F.id),F.element.addEventListener("keydown",vf)}),AZ.get(q)===1&&(q.addEventListener("contextmenu",bf,!0),q.addEventListener("dblclick",gf,!0),q.addEventListener("pointerdown",ff,!0),q.addEventListener("pointerleave",mf),q.addEventListener("pointermove",uf),q.addEventListener("pointerout",pf),q.addEventListener("pointerup",cf,!0)),function(){Z=!1,AZ.set(q,Math.max(0,(AZ.get(q)??0)-1)),H70($),$.separators.forEach((F)=>{F.element.removeEventListener("keydown",vf)}),AZ.get(q)||(q.removeEventListener("contextmenu",bf,!0),q.removeEventListener("dblclick",gf,!0),q.removeEventListener("pointerdown",ff,!0),q.removeEventListener("pointerleave",mf),q.removeEventListener("pointermove",uf),q.removeEventListener("pointerout",pf),q.removeEventListener("pointerup",cf,!0)),H.disconnect()}}function D70(){let[$,Z]=Y5.useState({}),J=Y5.useCallback(()=>Z({}),[]);return[$,J]}function yL($){let Z=Y5.useId();return`${$??Z}`}var F7=typeof window<"u"?Y5.useLayoutEffect:Y5.useEffect;function UX($){let Z=Y5.useRef($);return F7(()=>{Z.current=$},[$]),Y5.useCallback((...J)=>Z.current?.(...J),[Z])}function xL(...$){return UX((Z)=>{$.forEach((J)=>{if(J)switch(typeof J){case"function":{J(Z);break}case"object":{J.current=Z;break}}})})}function hL($){let Z=Y5.useRef({...$});return F7(()=>{for(let J in $)Z.current[J]=$[J]},[$]),Z.current}var Hm=Y5.createContext(null);function _70($,Z){let J=Y5.useRef({getLayout:()=>({}),setLayout:Q70});Y5.useImperativeHandle(Z,()=>J.current,[]),F7(()=>{Object.assign(J.current,Qm({groupId:$}))})}function gL({children:$,className:Z,defaultLayout:J,disableCursor:Q,disabled:X,elementRef:H,groupRef:G,id:z,onLayoutChange:Y,onLayoutChanged:K,orientation:W="horizontal",resizeTargetMinimumSize:B={coarse:20,fine:10},style:q,...U}){let F=Y5.useRef({onLayoutChange:{},onLayoutChanged:{}}),N=UX((y)=>{B7(F.current.onLayoutChange,y)||(F.current.onLayoutChange=y,Y?.(y))}),L=UX((y,C)=>{B7(F.current.onLayoutChanged,y)||(F.current.onLayoutChanged=y,K?.(y,{isUserInteraction:C}))}),V=yL(z),M=Y5.useRef(null),[A,O]=D70(),_=Y5.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:B,separators:[]}),D=xL(M,H);_70(V,G);let T=UX((y,C)=>{let j=W7(),R=Sf(y),S=d6(y);if(S){let E=!1;switch(j.state){case"active":{E=j.hitRegions.some((b)=>b.group===R);break}}return{flexGrow:S.layout[C]??1,pointerEvents:E?"none":void 0}}if(J?.[C])return{flexGrow:J?.[C]}}),k=hL({defaultLayout:J,disableCursor:Q}),x=Y5.useMemo(()=>({get disableCursor(){return!!k.disableCursor},getPanelStyles:T,id:V,orientation:W,registerPanel:(y)=>{let C=_.current;return C.panels=EL(W,[...C.panels,y]),O(),()=>{C.panels=C.panels.filter((j)=>j!==y),O()}},registerSeparator:(y)=>{let C=_.current;return C.separators=EL(W,[...C.separators,y]),O(),()=>{C.separators=C.separators.filter((j)=>j!==y),O()}},updatePanelProps:(y,{disabled:C})=>{let j=_.current.panels.find((E)=>E.id===y);j&&(j.panelConstraints.disabled=C);let R=Sf(V),S=d6(V);R&&S&&T9(R,{...S,derivedPanelConstraints:TL(R)})},updateSeparatorProps:(y,{disabled:C,disableDoubleClick:j})=>{let R=_.current.separators.find((S)=>S.id===y);R&&(R.disabled=C,R.disableDoubleClick=j)}}),[T,V,O,W,k]),I=Y5.useRef(null);return F7(()=>{let y=M.current;if(y===null)return;let C=_.current,j;if(k.defaultLayout!==void 0&&Object.keys(k.defaultLayout).length===C.panels.length){j={};for(let w of C.panels){let s=k.defaultLayout[w.id];s!==void 0&&(j[w.id]=s)}}let R={disabled:!!X,element:y,id:V,mutableState:{defaultLayout:j,disableCursor:!!k.disableCursor,expandedPanelSizes:_.current.lastExpandedPanelSizes,layouts:_.current.layouts},orientation:W,panels:C.panels,resizeTargetMinimumSize:C.resizeTargetMinimumSize,separators:C.separators};I.current=R;let S=A70(R),{defaultLayoutDeferred:E,derivedPanelConstraints:b,layout:g}=d6(R.id,!0);!E&&b.length>0&&(N(g),L(g,!1));let u=SL(V,(w)=>{let{defaultLayoutDeferred:s,derivedPanelConstraints:z0,layout:h}=w.next;if(s||z0.length===0)return;let t=R.panels.map(({id:d})=>d).join(",");R.mutableState.layouts[t]=h,z0.forEach((d)=>{if(d.collapsible){let{layout:Y0}=w.prev??{};if(Y0){let B0=v8(d.collapsedSize,h[d.panelId]),J0=v8(d.collapsedSize,Y0[d.panelId]);B0&&!J0&&(R.mutableState.expandedPanelSizes[d.panelId]=Y0[d.panelId])}}});let M0=W7().state!=="active";N(h),M0&&L(h,w.isUserInteraction)});return()=>{I.current=null,S(),u()}},[X,V,L,N,W,A,k]),Y5.useEffect(()=>{let y=I.current;y&&(y.mutableState.defaultLayout=J,y.mutableState.disableCursor=!!Q)}),PZ.jsx(Hm.Provider,{value:x,children:PZ.jsx("div",{...U,className:Z,"data-group":!0,"data-testid":V,id:V,ref:D,style:{height:"100%",width:"100%",overflow:"hidden",...q,display:"flex",flexDirection:W==="horizontal"?"row":"column",flexWrap:"nowrap",touchAction:W==="horizontal"?"pan-y":"pan-x"},children:$})})}gL.displayName="Group";function vL(){let $=Y5.useContext(Hm);return i5($,"Group Context not found; did you render a Panel or Separator outside of a Group?"),$}function O70($,Z){let{id:J}=vL(),Q=Y5.useRef({collapse:CL,expand:CL,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:CL});Y5.useImperativeHandle(Z,()=>Q.current,[]),F7(()=>{Object.assign(Q.current,Jm({groupId:J,panelId:$}))})}function fL({children:$,className:Z,collapsedSize:J="0%",collapsible:Q=!1,defaultSize:X,disabled:H,elementRef:G,groupResizeBehavior:z="preserve-relative-size",id:Y,maxSize:K="100%",minSize:W="0%",onResize:B,panelRef:q,style:U,...F}){let N=!!Y,L=yL(Y),V=hL({disabled:H}),M=Y5.useRef(null),A=xL(M,G),{getPanelStyles:O,id:_,orientation:D,registerPanel:T,updatePanelProps:k}=vL(),x=B!==null,I=UX((R,S,E)=>{B?.(R,Y,E)});F7(()=>{let R=M.current;if(R!==null){let S={element:R,id:L,idIsStable:N,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:x?I:void 0,panelConstraints:{groupResizeBehavior:z,collapsedSize:J,collapsible:Q,defaultSize:X,disabled:V.disabled,maxSize:K,minSize:W}};return T(S)}},[z,J,Q,X,x,L,N,K,W,I,T,V]),Y5.useEffect(()=>{k(L,{disabled:H})},[H,L,k]),O70(L,q);let y=()=>{let R=O(_,L);if(R)return JSON.stringify(R)},C=Y5.useSyncExternalStore((R)=>SL(_,R),y,y),j;return C?j=JSON.parse(C):X!==void 0?j={flexGrow:void 0,flexShrink:void 0,flexBasis:X}:j={flexGrow:1},PZ.jsx("div",{...F,"data-disabled":H||void 0,"data-panel":!0,"data-testid":L,id:L,ref:A,style:{...P70,display:"flex",flexBasis:0,flexShrink:1,overflow:"visible",...j},children:PZ.jsx("div",{className:Z,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto",...U,touchAction:D==="horizontal"?"pan-y":"pan-x"},children:$})})}fL.displayName="Panel";var P70={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function w70({layout:$,panelConstraints:Z,panelId:J,panelIndex:Q}){let X,H,G=$[J],z=Z.find((Y)=>Y.panelId===J);if(z){let Y=z.maxSize,K=z.collapsible?z.collapsedSize:z.minSize,W=[Q,Q+1];H=q7({layout:FX({delta:K-G,initialLayout:$,panelConstraints:Z,pivotIndices:W,prevLayout:$}),panelConstraints:Z})[J],X=q7({layout:FX({delta:Y-G,initialLayout:$,panelConstraints:Z,pivotIndices:W,prevLayout:$}),panelConstraints:Z})[J]}return{valueControls:J,valueMax:X,valueMin:H,valueNow:G}}function mL({children:$,className:Z,disabled:J,disableDoubleClick:Q,elementRef:X,id:H,style:G,...z}){let Y=yL(H),K=hL({disabled:J,disableDoubleClick:Q}),[W,B]=Y5.useState({}),[q,U]=Y5.useState("inactive"),[F,N]=Y5.useState(!1),L=Y5.useRef(null),V=xL(L,X),{disableCursor:M,id:A,orientation:O,registerSeparator:_,updateSeparatorProps:D}=vL(),T=O==="horizontal"?"vertical":"horizontal";F7(()=>{let I=L.current;if(I!==null){let y={disabled:K.disabled,disableDoubleClick:K.disableDoubleClick,element:I,id:Y},C=_(y),j=Z70((S)=>{U(S.next.state!=="inactive"&&S.next.hitRegions.some((E)=>E.separator===y)?S.next.state:"inactive")}),R=SL(A,(S)=>{let{derivedPanelConstraints:E,layout:b,separatorToPanels:g}=S.next,u=g.get(y);if(u){let w=u[0],s=u.indexOf(w);B(w70({layout:b,panelConstraints:E,panelId:w.id,panelIndex:s}))}});return()=>{j(),R(),C()}}},[A,Y,_,K]),Y5.useEffect(()=>{D(Y,{disabled:J,disableDoubleClick:Q})},[J,Q,Y,D]);let k;J&&!M&&(k="not-allowed");let x;if(J)x="disabled";else switch(q){case"active":{x="active";break}default:F?x="focus":x=q}return PZ.jsx("div",{...z,"aria-controls":W.valueControls,"aria-disabled":J||void 0,"aria-orientation":T,"aria-valuemax":W.valueMax,"aria-valuemin":W.valueMin,"aria-valuenow":W.valueNow,children:$,className:Z,"data-separator":x,"data-testid":Y,id:Y,onBlur:()=>N(!1),onFocus:()=>N(!0),ref:V,role:"separator",style:{flexBasis:"auto",cursor:k,...G,flexGrow:0,flexShrink:0,touchAction:"none"},tabIndex:J?void 0:0})}mL.displayName="Separator";var NX=P(l(),1);function Gm({className:$,...Z}){return NX.jsx(gL,{"data-slot":"resizable-panel-group",className:e("flex h-full w-full aria-[orientation=vertical]:flex-col",$),...Z})}function uL({...$}){return NX.jsx(fL,{"data-slot":"resizable-panel",...$})}function zm({withHandle:$,className:Z,...J}){return NX.jsx(mL,{"data-slot":"resizable-handle",className:e("relative flex w-0 items-center justify-center ring-offset-background after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-ring focus-visible:outline-hidden aria-[orientation=horizontal]:h-0 aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2 [&[aria-orientation=horizontal]>div]:rotate-90",Z),...J,children:$&&NX.jsx("div",{className:"flex h-6 w-1 shrink-0 rounded-lg bg-border"})})}var l6=P(l(),1);function Ym({workspace:$,chat:Z,open:J,workspaceMinWidth:Q,chatMinWidth:X,chatMaxWidth:H,chatWidth:G,onCollapse:z,onChatWidthChange:Y}){let K=i6.useRef(null),W=i6.useRef(null),[B,q]=i6.useState(!1),U=Math.min(Math.max(G,X),H),F=i6.useRef(J?U:0).current;return i6.useLayoutEffect(()=>{let N=K.current;if(!N)return;if(J)N.resize(U);else N.collapse()},[U,J]),l6.jsxs(Gm,{orientation:"horizontal",className:e("overflow-visible!",B&&"[&>#chat]:transition-[flex-grow] [&>#chat]:duration-200 [&>#chat]:ease-in-out motion-reduce:[&>#chat]:transition-none!",B&&"has-[[data-separator=active]]:[&>#chat]:transition-none!"),onLayoutChanged:(N,L)=>{if(!B&&W.current===null)W.current=requestAnimationFrame(()=>{q(!0)});if(L.isUserInteraction)requestAnimationFrame(()=>{let V=K.current;if(!V)return;let M=V.getSize();if(M.inPixels>0)Y(Math.round(M.inPixels))})},children:[l6.jsx(uL,{id:"workspace",className:"overflow-visible!",minSize:Q,children:l6.jsx("div",{"data-slot":"workspace-split-workspace",className:"flex h-full min-h-0 min-w-0 flex-col",children:$})}),l6.jsx(zm,{"aria-label":"Resize chat",hidden:!J,disabled:!J}),l6.jsx(uL,{id:"chat","aria-hidden":!J,inert:!J,collapsible:!0,collapsedSize:0,defaultSize:F,minSize:X,maxSize:H,groupResizeBehavior:"preserve-pixel-size",panelRef:K,onResize:(N,L,V)=>{if(J&&N.inPixels===0&&V&&V.inPixels>0)z()},className:e("overflow-hidden!",B&&"transition-opacity duration-200 ease-in-out motion-reduce:transition-none",J?"opacity-100":"opacity-0"),children:l6.jsx("div",{"data-slot":"workspace-split-chat",className:"flex h-full min-h-0 min-w-(--chat-min) flex-col",children:Z})})]})}var L5=P(l(),1),C70=s4.lazy(()=>import("/chunk-kkj86722.js").then(($)=>({default:$.Scratchpad}))),qm=($)=>$.config.title||$.id,Um=($)=>OW($.icon)??BQ;function Fm($,Z){let J=Z.find((Q)=>Q.viewId===$.id);return OW($.config.icon)??OW(J?.icon)??BQ}function T70({onToggleMode:$}){return L5.jsxs(r1,{children:[L5.jsx(a1,{render:L5.jsx(E0,{variant:"ghost",size:"icon-sm",onClick:$,"aria-label":"Dock agent",children:L5.jsx(Wm,{stroke:1.75})})}),L5.jsx(n1,{children:"Dock agent"})]})}function E70({active:$,onToggle:Z}){return L5.jsxs(r1,{children:[L5.jsx(a1,{render:L5.jsx(E0,{variant:$?"secondary":"ghost",size:"icon-sm","aria-label":"Customize","aria-pressed":$,onClick:Z,children:L5.jsx(Bm,{stroke:1.75})})}),L5.jsx(n1,{children:"Customize"})]})}function I70($,Z,J,Q,X,H){if($==="agent")return{key:$,Icon:q9,label:"Agent",closable:Q,loading:X};if($==="widgets")return{key:$,Icon:qQ,label:"Widgets",closable:Q};if($==="scratchpad")return{key:$,Icon:UQ,label:"Scratchpad",closable:Q};let G=g3($),z=G?J.find((W)=>W.id===G):null;if(z)return{key:$,Icon:Um(z),label:z.title||z.viewId||"New view",closable:Q,loading:H(z.sessionId)};let Y=N6($),K=Y?Z.find((W)=>W.id===Y):null;return K?{key:$,Icon:Fm(K,J),label:qm(K),closable:Q}:null}function R70($,Z,J){let Q=new Set(Z),X=0;return $.map((H)=>Q.has(H)?J[X++]:H)}function Nm({widgets:$,views:Z,builders:J}){let{layout:Q,setLayout:X,name:H,icon:G,provider:z,workspaceId:Y}=d5(),K=Bf(),{ref:W,fits:B,constraints:q}=qf(),[U,F]=s4.useState("idle"),[N,L]=s4.useState(!1),[V,M]=s4.useState(0),A=m1((f)=>f.dockedChatWidth),O=m1((f)=>f.setDockedChatWidth),_=V4((f)=>f.activity),D=O_(_,Y);Oj(Q.theme);let T=kW(RW(Q.tabs),Z,J),k=T.filter((f)=>f!=="agent"),x=k.length>0,y=Q.layoutMode==="split"&&x&&B?"split":"fullscreen",C=y==="split",{tabsState:j,activeTab:R,appletParams:S,navigateToTab:E,setTabs:b}=wf({views:Z,builders:J,split:C}),{view:g,chatLoaded:u,previewTurn:w,sessionId:s,processing:z0,error:h,send:t,stop:M0,selectSession:d,dismissError:Y0}=Xf({activeTab:R,appletParams:S}),{composerBanner:B0,composerAvailability:J0}=_f(Y,{chatError:h,onDismissChatError:Y0}),H0=new Set(j.open),N0=(f)=>{X({layoutMode:f})},c=C?k:T,Z0=T.length>1,$0=c.map((f)=>I70(f,Z,J,Z0||g3(f)!==null,D,(X0)=>dH(_,Y,X0))).filter((f)=>Boolean(f)),G0=N6(R),r=G0?Z.find((f)=>f.id===G0):void 0,Q0=g3(R),a=Q0?J.find((f)=>f.id===Q0):void 0;s4.useEffect(()=>{if(j.open.filter((L0)=>BX(L0,Z,J)).length===j.open.length)return;let X0=kW(j,Z,J);X({tabs:{open:X0,active:X0.includes(j.active)?j.active:X0[0]}})},[J,X,j,Z]),s4.useEffect(()=>{let f=new Map;for(let P0 of J){if(P0.status!=="ready"||!P0.viewId)continue;if(!Z.some((f0)=>f0.id===P0.viewId))continue;f.set(ZQ(P0.id),RU(P0.viewId))}if(f.size===0)return;let X0=f.get(R);if(X0)E(X0);let L0=new Set(f.values()),k0=new Map([...f].map(([P0,f0])=>[f0,P0])),r0=[],J5=!1;for(let P0 of j.open){let f0=k0.get(P0);if(L0.has(P0)&&f0&&j.open.includes(f0)){J5=!0;continue}let h0=f.get(P0),a0=h0??P0;if(h0)J5=!0;if(!r0.includes(a0))r0.push(a0)}if(!J5)return;let m0=f.get(j.active)??j.active;X({tabs:{open:r0.length>0?r0:["agent"],active:m0}})},[R,J,E,X,j,Z]),s4.useEffect(()=>{if(y!=="fullscreen"||R==="agent")L(!1)},[R,y]);let p=(f,X0)=>{if(E(f,X0),f==="agent")L(!1),M((L0)=>L0+1)};Rz(Y,"focusTab",p),s1((f)=>{if(f.type==="tab:focus"&&f.workspaceId===Y)p(f.tab,f.params)});let o=(f)=>{let X0=g3(f),L0=X0?J.find((P0)=>P0.id===X0):void 0;if(!Z0&&!L0||!H0.has(f))return;let k0=j.open.filter((P0)=>P0!==f);if(k0.length===0)k0=["agent"];let r0=c.indexOf(f),J5=c[r0+1]??c[r0-1]??k0.find((P0)=>BX(P0,Z,J))??"agent",m0=j.active===f||!k0.includes(j.active)?J5:j.active;if(b({open:k0,active:m0}),R===f)E(J5);if(L0?.status==="draft")K.discard(L0.id)},n=(f)=>{let X0=ZQ(f.id);if(H0.has(X0)){let L0=j.open.filter((k0)=>k0!==X0);if(L0.length===0)L0=["agent"];if(b({open:L0,active:j.active===X0?L0[0]:j.active}),R===X0)E(L0[0])}K.discard(f.id)},V0=(f)=>{let X0=R70(j.open,c,f);if(X0===j.open)return;b({open:X0,active:j.active})},w0=(f)=>{if(f!==void 0)m1.getState().setComposerDraft(Y,f);if(y==="fullscreen"&&R!=="agent"){if(L(!0),N)M((X0)=>X0+1);return}M((X0)=>X0+1)};lv({send:t,revealChat:w0,composerAvailability:J0});let v0=[...!C&&!H0.has("agent")?[{key:"agent",Icon:q9,label:"Agent",onClick:()=>p("agent")}]:[],...!H0.has("widgets")?[{key:"widgets",Icon:qQ,label:"Widgets",onClick:()=>p("widgets")}]:[],...!H0.has("scratchpad")?[{key:"scratchpad",Icon:UQ,label:"Scratchpad",onClick:()=>p("scratchpad")}]:[],...Z.map((f)=>({view:f,tab:RU(f.id)})).filter(({tab:f})=>!H0.has(f)).map(({view:f,tab:X0})=>({key:X0,Icon:Fm(f,J),label:qm(f),onClick:()=>p(X0)})),...J.filter((f)=>f.status!=="ready").map((f)=>({builder:f,tab:ZQ(f.id)})).filter(({tab:f})=>!H0.has(f)).map(({builder:f,tab:X0})=>({key:X0,Icon:Um(f),label:f.title||f.viewId||"New view",onClick:()=>p(X0)})),{key:"create-view",Icon:Km,label:"New view",onClick:()=>{K.create().then((f)=>p(ZQ(f.id)))}}],c0=L5.jsx(aK,{active:y==="split",focusRequest:V,chatLoaded:u,view:g,previewTurn:w,sessionId:s,processing:z0,composerBanner:B0,composerAvailability:J0,send:t,stop:M0,onSelectSession:d,onClose:()=>N0("fullscreen"),docked:!0}),m=L5.jsx(aK,{active:y==="fullscreen"&&R==="agent",focusRequest:V,chatLoaded:u,view:g,previewTurn:w,sessionId:s,processing:z0,composerBanner:B0,composerAvailability:J0,send:t,stop:M0,onSelectSession:d}),i=L5.jsxs("div",{className:e("flex h-full min-h-0 min-w-0 flex-1 flex-col-reverse overflow-hidden bg-background shadow-xs transition-[border-radius]",y==="split"&&"rounded-xl"),children:[R==="agent"?m:R==="widgets"?L5.jsx(Vh,{editing:U==="editing",onEditingChange:(f)=>F(f?"editing":"idle"),widgets:$,onCreateWidget:()=>{d(null),w0("Create widget")}}):R==="scratchpad"?L5.jsx(s4.Suspense,{fallback:null,children:L5.jsx(C70,{})}):a?L5.jsx(Hf,{builder:a,composerAvailability:J0,onSave:(f)=>K.save(a.id,f),onSubmit:(f)=>{if(y==="fullscreen")L(!0);return K.submit(a,f)},onOpenChat:()=>{d(a.sessionId),w0()},onDiscard:()=>n(a)},a.id):null,L5.jsx(Wf,{views:Z,activeViewId:r?.id??null,params:S}),L5.jsxs(Lh,{children:[L5.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-4",children:[L5.jsxs("div",{className:"flex items-center gap-2",children:[L5.jsx("img",{src:G??H2[z??"claude-code"],alt:"",className:"size-5 shrink-0 rounded-xs"}),H&&L5.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:H})]}),L5.jsx(Tf,{tabs:$0,active:R,createItems:v0,onSelect:p,onClose:o,onReorder:V0})]}),L5.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[L5.jsx(E70,{active:U==="customizing",onToggle:()=>F(U==="customizing"?"idle":"customizing")}),L5.jsx(dv,{}),x&&B&&y==="fullscreen"&&L5.jsx(T70,{onToggleMode:()=>N0("split")})]})]})]});return L5.jsxs("div",{className:"relative flex h-full min-h-0 flex-col font-sans text-foreground",children:[L5.jsx("div",{ref:W,className:"flex min-h-0 flex-1",children:x&&B&&q?L5.jsx(Ym,{...q,workspace:i,chat:c0,open:y==="split",chatWidth:A,onCollapse:()=>N0("fullscreen"),onChatWidthChange:O}):i}),L5.jsx(O4,{children:U==="customizing"&&L5.jsx(uy,{onClose:()=>F("idle")})}),y==="fullscreen"&&R!=="agent"&&x&&L5.jsx(my,{loading:D,open:N,onOpenChange:L,onOpenChangeComplete:(f)=>{if(f)M((X0)=>X0+1)},children:(f)=>L5.jsx(aK,{active:N,focusRequest:V,chatLoaded:u,view:g,previewTurn:w,sessionId:s,processing:z0,composerBanner:B0,composerAvailability:J0,send:t,stop:M0,onSelectSession:d,onClose:f})})]})}var xW=P(v(),1);function Vm($,Z,J,Q){let X=xW.useRef(null);xW.useEffect(()=>{if(!Z)return;let H=new Map(Z.map((U)=>[U.id,{w:U.config.colSpan,h:U.config.rowSpan}]));if(X.current?.workspaceId!==$){X.current={workspaceId:$,sizes:H};return}let G=X.current.sizes,z=new Set(J.widgetGrid.map((U)=>U.i)),Y=Z.filter((U)=>{if(!G.has(U.id))return!z.has(U.id);if(!z.has(U.id))return!1;let N=G.get(U.id);return N.w!==U.config.colSpan||N.h!==U.config.rowSpan});if(X.current={workspaceId:$,sizes:H},Y.length===0)return;let K=new Map(Z.map((U)=>[U.id,U.config])),W=J.widgetGrid.filter((U)=>!Y.some((F)=>F.id===U.i)&&K.has(U.i)).map((U)=>{let F=K.get(U.i);return{i:U.i,x:U.x,y:U.y,w:F.colSpan,h:F.rowSpan}}),B=W.map(({i:U,x:F,y:N})=>({i:U,x:F,y:N})),q=[...W];for(let U of Y){let F=pQ(q,U.config.colSpan,U.config.rowSpan,4);B.push({i:U.id,x:F.x,y:F.y}),q.push({i:U.id,x:F.x,y:F.y,w:U.config.colSpan,h:U.config.rowSpan})}Q({widgetGrid:B})},[$,Z,J.widgetGrid,Q])}var M2=P(l(),1);function Mm({id:$}){return M2.jsx(Lm,{id:$,children:M2.jsx(JC,{id:$,children:M2.jsx(k70,{id:$})})})}function k70({id:$}){let Z=s0(),[J]=s9(),{layout:Q,setLayout:X,isLoading:H}=d5(),G=oj($),z=xz($),Y=CW($);Vm($,G.data,Q,X),ij(),s1((W)=>{if(W.type==="theme:updated"||W.type==="workspace:updated")Z.invalidateQueries({queryKey:j0.layout($)});else if(W.type==="widget-layout:updated"||W.type==="widget:updated")Z.invalidateQueries({queryKey:j0.widgets($)});else if(W.type==="view-layout:updated")Z.invalidateQueries({queryKey:j0.views($)})});let K=H||J===void 0||G.isLoading||z.isLoading||Y.isLoading;return M2.jsx(M2.Fragment,{children:M2.jsx(SG,{children:K?M2.jsx("div",{className:"flex h-full items-center justify-center",children:M2.jsx(Sj,{sprite:"moi",effect:"chaos"})}):M2.jsx(Nm,{widgets:G.data??[],views:z.data??[],builders:Y.data??[]})})})}var $9=P(l(),1),Am=null;function S70(){if(!Am)return $9.jsx(mM,{to:"/"});return $9.jsx(hW.Suspense,{fallback:null,children:$9.jsx(Am,{})})}function Dm(){let[,$]=I4();return hW.useEffect(()=>{return Kq((Z)=>$(`/workspace/${Z}`)),()=>Kq(null)},[$]),$9.jsxs(fM,{children:[$9.jsx(SX,{path:"/",component:Cj}),$9.jsx(SX,{path:"/dev/*?",component:S70}),$9.jsx(SX,{path:"/workspace/:id/*?",children:(Z)=>$9.jsx(Mm,{id:Z.id},Z.id)})]})}var r6=P(l(),1),Om=new nW;b_(Om);A_();function jZ5($){function Z(){return r6.jsx(oW,{client:Om,children:r6.jsxs(V_,{children:[r6.jsx(GB,{children:r6.jsx(Dm,{})}),r6.jsx(mD,{}),!1]})})}_m.createRoot($).render(r6.jsx(Z,{}))}export{jZ5 as mount};
|